Skip to content

Commit 74abd66

Browse files
committed
feat: update textarea
1 parent 4362a94 commit 74abd66

24 files changed

+166
-110
lines changed

README.md

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -37,16 +37,3 @@ pnpm run dev
3737
```sh
3838
pnpm run new:component
3939
```
40-
41-
## TODOs
42-
43-
There are a few things I'd like to add in terms of tooling:
44-
45-
- Storybook: for developing and testing different variants of components
46-
- Playwright: for visual regression testing
47-
- Stylelint: for ensuring CSS is clean (I'd especially like to lint for
48-
rational-ordering, which keeps properties with similar functionality grouped
49-
closely)
50-
- bundlesize: I'd like to add bundlesize check for extreme bloat. Sometimes you
51-
can accidentally include deps that are way too heavy for what they do and it's
52-
better to just write something yourself.

chromatic.config.json

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
{
2+
"onlyChanged": true,
3+
"projectId": "Project:68b5dc6266565ef268ed5075",
4+
"zip": true
5+
}

eslint.config.ts

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,13 @@ export default defineConfig([
5757
'sibling', // Same directory imports
5858
],
5959
'newlines-between': 'always',
60+
pathGroups: [
61+
{
62+
pattern: '@/**',
63+
group: 'internal',
64+
position: 'before',
65+
},
66+
],
6067
},
6168
],
6269
},

src/components/primitives/alert.tsx

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,7 @@ const alertVariants = cva(
99
variants: {
1010
variant: {
1111
default: 'bg-card text-card-foreground',
12-
destructive:
13-
'bg-card text-destructive *:data-[slot=alert-description]:text-destructive/90 [&>svg]:text-current',
12+
danger: 'bg-card text-danger *:data-[slot=alert-description]:text-danger/90 [&>svg]:text-current',
1413
},
1514
},
1615
defaultVariants: {
@@ -46,4 +45,4 @@ function AlertDescription({ className, ...props }: React.ComponentProps<'div'>)
4645
);
4746
}
4847

49-
export { Alert, AlertTitle, AlertDescription };
48+
export { Alert, AlertDescription, AlertTitle };

src/components/primitives/badge.tsx

Lines changed: 3 additions & 3 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 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',
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-danger aria-invalid:ring-danger/20 dark:aria-invalid:ring-danger/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',
14-
destructive:
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',
14+
danger:
15+
'border-transparent bg-danger text-white focus-visible:ring-danger/20 dark:bg-danger/60 dark:focus-visible:ring-danger/40 [a&]:hover:bg-danger/90',
1616
outline: 'text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground',
1717
},
1818
},

src/components/primitives/button.tsx

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

77
const buttonVariants = cva(
8-
"inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
8+
"inline-flex shrink-0 items-center justify-center gap-2 rounded-md text-sm font-medium whitespace-nowrap transition-all outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:pointer-events-none disabled:opacity-50 aria-invalid:border-danger aria-invalid:ring-danger/20 dark:aria-invalid:ring-danger/40 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
99
{
1010
variants: {
1111
variant: {
1212
default: 'bg-primary text-primary-foreground shadow-xs hover:bg-primary/90',
13-
destructive:
14-
'bg-destructive text-white shadow-xs hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:bg-destructive/60 dark:focus-visible:ring-destructive/40',
13+
danger:
14+
'bg-danger text-white shadow-xs hover:bg-danger/90 focus-visible:ring-danger/20 dark:bg-danger/60 dark:focus-visible:ring-danger/40',
1515
outline:
1616
'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:border-input dark:bg-input/30 dark:hover:bg-input/50',
1717
secondary: 'bg-secondary text-secondary-foreground shadow-xs hover:bg-secondary/80',

src/components/primitives/checkbox.tsx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ function Checkbox({ className, ...props }: React.ComponentProps<typeof CheckboxP
1111
<CheckboxPrimitive.Root
1212
data-slot="checkbox"
1313
className={cn(
14-
'peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-destructive aria-invalid:ring-destructive/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:aria-invalid:ring-destructive/40 dark:data-[state=checked]:bg-primary',
14+
'peer size-4 shrink-0 rounded-[4px] border border-input shadow-xs transition-shadow outline-none focus-visible:border-ring focus-visible:ring-[3px] focus-visible:ring-ring/50 disabled:cursor-not-allowed disabled:opacity-50 aria-invalid:border-danger aria-invalid:ring-danger/20 data-[state=checked]:border-primary data-[state=checked]:bg-primary data-[state=checked]:text-primary-foreground dark:bg-input/30 dark:aria-invalid:ring-danger/40 dark:data-[state=checked]:bg-primary',
1515
className,
1616
)}
1717
{...props}

src/components/primitives/context-menu.tsx

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -89,15 +89,15 @@ function ContextMenuItem({
8989
...props
9090
}: React.ComponentProps<typeof ContextMenuPrimitive.Item> & {
9191
inset?: boolean;
92-
variant?: 'default' | 'destructive';
92+
variant?: 'default' | 'danger';
9393
}) {
9494
return (
9595
<ContextMenuPrimitive.Item
9696
data-slot="context-menu-item"
9797
data-inset={inset}
9898
data-variant={variant}
9999
className={cn(
100-
"relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:!text-destructive",
100+
"relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=danger]:text-danger data-[variant=danger]:focus:bg-danger/10 data-[variant=danger]:focus:text-danger dark:data-[variant=danger]:focus:bg-danger/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=danger]:*:[svg]:!text-danger",
101101
className,
102102
)}
103103
{...props}
@@ -194,18 +194,18 @@ function ContextMenuShortcut({ className, ...props }: React.ComponentProps<'span
194194

195195
export {
196196
ContextMenu,
197-
ContextMenuTrigger,
197+
ContextMenuCheckboxItem,
198198
ContextMenuContent,
199+
ContextMenuGroup,
199200
ContextMenuItem,
200-
ContextMenuCheckboxItem,
201-
ContextMenuRadioItem,
202201
ContextMenuLabel,
202+
ContextMenuPortal,
203+
ContextMenuRadioGroup,
204+
ContextMenuRadioItem,
203205
ContextMenuSeparator,
204206
ContextMenuShortcut,
205-
ContextMenuGroup,
206-
ContextMenuPortal,
207207
ContextMenuSub,
208208
ContextMenuSubContent,
209209
ContextMenuSubTrigger,
210-
ContextMenuRadioGroup,
210+
ContextMenuTrigger,
211211
};

src/components/primitives/dropdown-menu.tsx

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -47,15 +47,15 @@ function DropdownMenuItem({
4747
...props
4848
}: React.ComponentProps<typeof DropdownMenuPrimitive.Item> & {
4949
inset?: boolean;
50-
variant?: 'default' | 'destructive';
50+
variant?: 'default' | 'danger';
5151
}) {
5252
return (
5353
<DropdownMenuPrimitive.Item
5454
data-slot="dropdown-menu-item"
5555
data-inset={inset}
5656
data-variant={variant}
5757
className={cn(
58-
"relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 data-[variant=destructive]:focus:text-destructive dark:data-[variant=destructive]:focus:bg-destructive/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=destructive]:*:[svg]:!text-destructive",
58+
"relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none focus:bg-accent focus:text-accent-foreground data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 data-[variant=danger]:text-danger data-[variant=danger]:focus:bg-danger/10 data-[variant=danger]:focus:text-danger dark:data-[variant=danger]:focus:bg-danger/20 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4 [&_svg:not([class*='text-'])]:text-muted-foreground data-[variant=danger]:*:[svg]:!text-danger",
5959
className,
6060
)}
6161
{...props}
@@ -200,18 +200,18 @@ function DropdownMenuSubContent({
200200

201201
export {
202202
DropdownMenu,
203-
DropdownMenuPortal,
204-
DropdownMenuTrigger,
203+
DropdownMenuCheckboxItem,
205204
DropdownMenuContent,
206205
DropdownMenuGroup,
207-
DropdownMenuLabel,
208206
DropdownMenuItem,
209-
DropdownMenuCheckboxItem,
207+
DropdownMenuLabel,
208+
DropdownMenuPortal,
210209
DropdownMenuRadioGroup,
211210
DropdownMenuRadioItem,
212211
DropdownMenuSeparator,
213212
DropdownMenuShortcut,
214213
DropdownMenuSub,
215-
DropdownMenuSubTrigger,
216214
DropdownMenuSubContent,
215+
DropdownMenuSubTrigger,
216+
DropdownMenuTrigger,
217217
};

src/components/primitives/form.tsx

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,7 +86,7 @@ function FormLabel({ className, ...props }: React.ComponentProps<typeof LabelPri
8686
<Label
8787
data-slot="form-label"
8888
data-error={!!error}
89-
className={cn('data-[error=true]:text-destructive', className)}
89+
className={cn('data-[error=true]:text-danger', className)}
9090
htmlFor={formItemId}
9191
{...props}
9292
/>
@@ -129,10 +129,10 @@ function FormMessage({ className, ...props }: React.ComponentProps<'p'>) {
129129
}
130130

131131
return (
132-
<p data-slot="form-message" id={formMessageId} className={cn('text-sm text-destructive', className)} {...props}>
132+
<p data-slot="form-message" id={formMessageId} className={cn('text-sm text-danger', className)} {...props}>
133133
{body}
134134
</p>
135135
);
136136
}
137137

138-
export { useFormField, Form, FormItem, FormLabel, FormControl, FormDescription, FormMessage, FormField };
138+
export { Form, FormControl, FormDescription, FormField, FormItem, FormLabel, FormMessage, useFormField };

0 commit comments

Comments
 (0)