Skip to content

Commit e91afd0

Browse files
committed
chore: add prettier tailwind config
1 parent 115e3d2 commit e91afd0

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+325
-222
lines changed

.prettierrc

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,5 +14,8 @@
1414
"printWidth": 80
1515
}
1616
}
17-
]
17+
],
18+
"plugins": ["prettier-plugin-tailwindcss"],
19+
"tailwindStylesheet": "./src/index.css",
20+
"tailwindFunctions": ["clsx", "twMerge", "cn", "cva"]
1821
}

package.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -106,14 +106,15 @@
106106
"eslint-plugin-prettier": "^5.5.4",
107107
"eslint-plugin-react": "^7.37.5",
108108
"eslint-plugin-react-hooks": "^5.2.0",
109-
"eslint-plugin-tailwindcss": "3.18.2",
109+
"eslint-plugin-tailwindcss": "4.0.0-beta.0",
110110
"generate-react-cli": "^8.4.0",
111111
"globals": "^16.3.0",
112112
"html-validate": "^10.0.0",
113113
"jsdom": "^22.1.0",
114114
"lefthook": "^1.5.2",
115115
"npm-run-all": "^4.1.5",
116116
"playwright": "^1.55.0",
117+
"prettier-plugin-tailwindcss": "^0.6.14",
117118
"pretty": "^2.0.0",
118119
"storybook": "^9.1.3",
119120
"tw-animate-css": "^1.3.7",

pnpm-lock.yaml

Lines changed: 139 additions & 8 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

src/components/primitives/accordion.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,13 @@ function AccordionTrigger({ className, children, ...props }: React.ComponentProp
2424
<AccordionPrimitive.Trigger
2525
data-slot="accordion-trigger"
2626
className={cn(
27-
'focus-visible:border-ring focus-visible:ring-ring/50 flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:ring-[3px] disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180',
27+
'flex flex-1 items-start justify-between gap-4 rounded-md py-4 text-left text-sm font-medium transition-all outline-none hover:underline focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 [&[data-state=open]>svg]:rotate-180',
2828
className,
2929
)}
3030
{...props}
3131
>
3232
{children}
33-
<ChevronDownIcon className="text-muted-foreground pointer-events-none size-4 shrink-0 translate-y-0.5 transition-transform duration-200" />
33+
<ChevronDownIcon className="pointer-events-none size-4 shrink-0 translate-y-0.5 text-muted-foreground transition-transform duration-200" />
3434
</AccordionPrimitive.Trigger>
3535
</AccordionPrimitive.Header>
3636
);
@@ -40,7 +40,7 @@ function AccordionContent({ className, children, ...props }: React.ComponentProp
4040
return (
4141
<AccordionPrimitive.Content
4242
data-slot="accordion-content"
43-
className="data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down overflow-hidden text-sm"
43+
className="overflow-hidden text-sm data-[state=closed]:animate-accordion-up data-[state=open]:animate-accordion-down"
4444
{...props}
4545
>
4646
<div className={cn('pt-0 pb-4', className)}>{children}</div>

src/components/primitives/alert-dialog.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ function AlertDialogOverlay({ className, ...props }: React.ComponentProps<typeof
2121
<AlertDialogPrimitive.Overlay
2222
data-slot="alert-dialog-overlay"
2323
className={cn(
24-
'data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 fixed inset-0 z-50 bg-black/50',
24+
'fixed inset-0 z-50 bg-black/50 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:animate-in data-[state=open]:fade-in-0',
2525
className,
2626
)}
2727
{...props}
@@ -36,7 +36,7 @@ function AlertDialogContent({ className, ...props }: React.ComponentProps<typeof
3636
<AlertDialogPrimitive.Content
3737
data-slot="alert-dialog-content"
3838
className={cn(
39-
'bg-background data-[state=open]:animate-in data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=open]:fade-in-0 data-[state=closed]:zoom-out-95 data-[state=open]:zoom-in-95 fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border p-6 shadow-lg duration-200 sm:max-w-lg',
39+
'fixed top-[50%] left-[50%] z-50 grid w-full max-w-[calc(100%-2rem)] translate-x-[-50%] translate-y-[-50%] gap-4 rounded-lg border bg-background p-6 shadow-lg duration-200 data-[state=closed]:animate-out data-[state=closed]:fade-out-0 data-[state=closed]:zoom-out-95 data-[state=open]:animate-in data-[state=open]:fade-in-0 data-[state=open]:zoom-in-95 sm:max-w-lg',
4040
className,
4141
)}
4242
{...props}
@@ -82,7 +82,7 @@ function AlertDialogDescription({
8282
return (
8383
<AlertDialogPrimitive.Description
8484
data-slot="alert-dialog-description"
85-
className={cn('text-muted-foreground text-sm', className)}
85+
className={cn('text-sm text-muted-foreground', className)}
8686
{...props}
8787
/>
8888
);

src/components/primitives/alert.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,13 @@ import type * as React from 'react';
44
import { cn } from '@/lib/utils';
55

66
const alertVariants = cva(
7-
'relative w-full rounded-lg border px-4 py-3 text-sm grid has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] grid-cols-[0_1fr] has-[>svg]:gap-x-3 gap-y-0.5 items-start [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current',
7+
'relative grid w-full grid-cols-[0_1fr] items-start gap-y-0.5 rounded-lg border px-4 py-3 text-sm has-[>svg]:grid-cols-[calc(var(--spacing)*4)_1fr] has-[>svg]:gap-x-3 [&>svg]:size-4 [&>svg]:translate-y-0.5 [&>svg]:text-current',
88
{
99
variants: {
1010
variant: {
1111
default: 'bg-card text-card-foreground',
1212
destructive:
13-
'text-destructive bg-card [&>svg]:text-current *:data-[slot=alert-description]:text-destructive/90',
13+
'bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current',
1414
},
1515
},
1616
defaultVariants: {
@@ -38,7 +38,7 @@ function AlertDescription({ className, ...props }: React.ComponentProps<'div'>)
3838
<div
3939
data-slot="alert-description"
4040
className={cn(
41-
'text-muted-foreground col-start-2 grid justify-items-start gap-1 text-sm [&_p]:leading-relaxed',
41+
'col-start-2 grid justify-items-start gap-1 text-sm text-muted-foreground [&_p]:leading-relaxed',
4242
className,
4343
)}
4444
{...props}

src/components/primitives/avatar.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ function AvatarFallback({ className, ...props }: React.ComponentProps<typeof Ava
2323
return (
2424
<AvatarPrimitive.Fallback
2525
data-slot="avatar-fallback"
26-
className={cn('bg-muted flex size-full items-center justify-center rounded-full', className)}
26+
className={cn('flex size-full items-center justify-center rounded-full bg-muted', className)}
2727
{...props}
2828
/>
2929
);

src/components/primitives/badge.tsx

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,14 +5,14 @@ import type * as React from 'react';
55
import { cn } from '@/lib/utils';
66

77
const badgeVariants = cva(
8-
'inline-flex items-center justify-center rounded-md border px-2 py-0.5 text-xs font-medium w-fit whitespace-nowrap shrink-0 [&>svg]:size-3 gap-1 [&>svg]:pointer-events-none focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:ring-[3px] aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive transition-[color,box-shadow] overflow-hidden',
8+
'inline-flex w-fit shrink-0 items-center justify-center gap-1 overflow-hidden rounded-md border px-2 py-0.5 text-xs font-medium whitespace-nowrap transition-[color,box-shadow] focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&>svg]:pointer-events-none [&>svg]:size-3',
99
{
1010
variants: {
1111
variant: {
1212
default: 'border-transparent bg-primary text-primary-foreground [a&]:hover:bg-primary/90',
1313
secondary: 'border-transparent bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90',
1414
destructive:
15-
'border-transparent bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',
15+
'border-transparent bg-destructive text-white focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40 [a&]:hover:bg-destructive/90',
1616
outline: 'text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground',
1717
},
1818
},

0 commit comments

Comments
 (0)