From 04d9f2b656a4be5c11b3bbaef9fe62d770ba7101 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Stanis=C5=82aw=20Synowiec?= Date: Fri, 26 Apr 2024 18:10:58 +0200 Subject: [PATCH] fix: formating --- apps/web/app/page.tsx | 256 +++++++++++------------ packages/ui/src/components/ui/button.tsx | 78 +++---- packages/ui/src/lib/utils.ts | 6 +- 3 files changed, 165 insertions(+), 175 deletions(-) diff --git a/apps/web/app/page.tsx b/apps/web/app/page.tsx index 7f5a382..0049006 100644 --- a/apps/web/app/page.tsx +++ b/apps/web/app/page.tsx @@ -5,148 +5,138 @@ import styles from './page.module.css'; import { Button } from '@repo/ui/button'; function Gradient({ - conic, - className, - small, - }: { - small?: boolean; - conic?: boolean; - className?: string; + conic, + className, + small, +}: { + small?: boolean; + conic?: boolean; + className?: string; }): JSX.Element { - return ( - - ); + return ( + + ); } const LINKS = [ - { - title: 'Docs', - href: 'https://turbo.build/repo/docs', - description: 'Find in-depth information about Turborepo features and API.', - }, - { - title: 'Learn', - href: 'https://turbo.build/repo/docs/handbook', - description: 'Learn more about monorepos with our handbook.', - }, - { - title: 'Templates', - href: 'https://turbo.build/repo/docs/getting-started/from-example', - description: 'Choose from over 15 examples and deploy with a single click.', - }, - { - title: 'Deploy', - href: 'https://vercel.com/new', - description: - 'Instantly deploy your Turborepo to a shareable URL with Vercel.', - }, + { + title: 'Docs', + href: 'https://turbo.build/repo/docs', + description: 'Find in-depth information about Turborepo features and API.', + }, + { + title: 'Learn', + href: 'https://turbo.build/repo/docs/handbook', + description: 'Learn more about monorepos with our handbook.', + }, + { + title: 'Templates', + href: 'https://turbo.build/repo/docs/getting-started/from-example', + description: 'Choose from over 15 examples and deploy with a single click.', + }, + { + title: 'Deploy', + href: 'https://vercel.com/new', + description: + 'Instantly deploy your Turborepo to a shareable URL with Vercel.', + }, ]; export default function Page(): JSX.Element { - return ( -
-
-

- examples/basic  - web -

- -
+ return ( +
+
+

+ examples/basic  + web +

+ +
- + -
-
-
-
- -
-
- -
+
+
+
+
+ +
+
+ +
-
- Turborepo -
-
- -
- - Turborepo logo - - - - - - - - - - -
-
-
+
+ Turborepo +
+
+ +
+ + Turborepo logo + + + + + + + + + + +
+
+
-
- {LINKS.map(({ title, href, description }) => ( - - {description} - - ))} -
-
- ); +
+ {LINKS.map(({ title, href, description }) => ( + + {description} + + ))} +
+
+ ); } diff --git a/packages/ui/src/components/ui/button.tsx b/packages/ui/src/components/ui/button.tsx index b3fa852..b872594 100644 --- a/packages/ui/src/components/ui/button.tsx +++ b/packages/ui/src/components/ui/button.tsx @@ -4,51 +4,51 @@ import { cva, type VariantProps } from 'class-variance-authority'; import { cn } from '../../lib/utils'; const buttonVariants = cva( - 'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50', - { - variants: { - variant: { - default: 'bg-primary text-primary-foreground hover:bg-primary/90', - destructive: - 'bg-destructive text-destructive-foreground hover:bg-destructive/90', - outline: - 'border border-input bg-background hover:bg-accent hover:text-accent-foreground', - secondary: - 'bg-secondary text-secondary-foreground hover:bg-secondary/80', - ghost: 'hover:bg-accent hover:text-accent-foreground', - link: 'text-primary underline-offset-4 hover:underline', - }, - size: { - default: 'h-10 px-4 py-2', - sm: 'h-9 rounded-md px-3', - lg: 'h-11 rounded-md px-8', - icon: 'h-10 w-10', - }, - }, - defaultVariants: { - variant: 'default', - size: 'default', - }, - }, + 'inline-flex items-center justify-center whitespace-nowrap rounded-md text-sm font-medium ring-offset-background transition-colors focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:pointer-events-none disabled:opacity-50', + { + variants: { + variant: { + default: 'bg-primary text-primary-foreground hover:bg-primary/90', + destructive: + 'bg-destructive text-destructive-foreground hover:bg-destructive/90', + outline: + 'border border-input bg-background hover:bg-accent hover:text-accent-foreground', + secondary: + 'bg-secondary text-secondary-foreground hover:bg-secondary/80', + ghost: 'hover:bg-accent hover:text-accent-foreground', + link: 'text-primary underline-offset-4 hover:underline', + }, + size: { + default: 'h-10 px-4 py-2', + sm: 'h-9 rounded-md px-3', + lg: 'h-11 rounded-md px-8', + icon: 'h-10 w-10', + }, + }, + defaultVariants: { + variant: 'default', + size: 'default', + }, + }, ); export interface ButtonProps - extends React.ButtonHTMLAttributes, - VariantProps { - asChild?: boolean; + extends React.ButtonHTMLAttributes, + VariantProps { + asChild?: boolean; } const Button = React.forwardRef( - ({ className, variant, size, asChild = false, ...props }, ref) => { - const Comp = asChild ? Slot : 'button'; - return ( - - ); - }, + ({ className, variant, size, asChild = false, ...props }, ref) => { + const Comp = asChild ? Slot : 'button'; + return ( + + ); + }, ); Button.displayName = 'Button'; diff --git a/packages/ui/src/lib/utils.ts b/packages/ui/src/lib/utils.ts index d084cca..9ad0df4 100644 --- a/packages/ui/src/lib/utils.ts +++ b/packages/ui/src/lib/utils.ts @@ -1,6 +1,6 @@ -import { type ClassValue, clsx } from "clsx" -import { twMerge } from "tailwind-merge" +import { type ClassValue, clsx } from 'clsx'; +import { twMerge } from 'tailwind-merge'; export function cn(...inputs: ClassValue[]) { - return twMerge(clsx(inputs)) + return twMerge(clsx(inputs)); }