@regardio/react 0.7.24 → 0.8.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (54) hide show
  1. package/dist/button/index.d.mts +2 -2
  2. package/dist/button/index.mjs +2 -2
  3. package/dist/button-BllZdqCA.mjs +109 -0
  4. package/dist/carousel/index.mjs +1 -1
  5. package/dist/checkbox/index.mjs +12 -17
  6. package/dist/combobox/index.d.mts +142 -0
  7. package/dist/combobox/index.mjs +238 -0
  8. package/dist/field/index.d.mts +2 -2
  9. package/dist/field/index.mjs +26 -26
  10. package/dist/fieldset/index.d.mts +2 -2
  11. package/dist/fieldset/index.mjs +18 -21
  12. package/dist/icon-button/index.d.mts +1 -1
  13. package/dist/icon-button/index.mjs +1 -1
  14. package/dist/index-BTB1biC_.d.mts +19 -0
  15. package/dist/index-DEHa010W.d.mts +35 -0
  16. package/dist/input/index.d.mts +1 -1
  17. package/dist/input/index.mjs +1 -1
  18. package/dist/input-BHRHF8xW.mjs +62 -0
  19. package/dist/password-input/index.d.mts +2 -2
  20. package/dist/password-input/index.mjs +5 -6
  21. package/dist/radio/index.mjs +12 -17
  22. package/dist/slider/index.mjs +6 -13
  23. package/dist/switch/index.mjs +7 -12
  24. package/dist/text/index.d.mts +6 -3
  25. package/dist/text/index.mjs +6 -3
  26. package/dist/toggle/index.mjs +44 -29
  27. package/package.json +27 -15
  28. package/src/button/button.test.tsx +12 -8
  29. package/src/button/button.tsx +50 -59
  30. package/src/button/index.ts +2 -2
  31. package/src/checkbox/checkbox.tsx +11 -14
  32. package/src/combobox/combobox.stories.tsx +137 -0
  33. package/src/combobox/combobox.tsx +435 -0
  34. package/src/combobox/index.ts +2 -0
  35. package/src/field/field.test.tsx +1 -1
  36. package/src/field/field.tsx +21 -13
  37. package/src/fieldset/fieldset.test.tsx +1 -1
  38. package/src/fieldset/fieldset.tsx +6 -6
  39. package/src/icon-button/icon-button.test.tsx +1 -1
  40. package/src/input/input.stories.tsx +0 -11
  41. package/src/input/input.test.tsx +5 -2
  42. package/src/input/input.tsx +34 -75
  43. package/src/password-input/password-input.tsx +4 -5
  44. package/src/radio/radio.tsx +11 -14
  45. package/src/slider/slider.tsx +6 -8
  46. package/src/storybook.css +27 -0
  47. package/src/switch/switch.tsx +6 -11
  48. package/src/text/text.tsx +6 -3
  49. package/src/toggle/toggle.test.tsx +1 -2
  50. package/src/toggle/toggle.tsx +44 -29
  51. package/dist/button-wigUM1BB.mjs +0 -127
  52. package/dist/index-B_G_f749.d.mts +0 -29
  53. package/dist/index-DH3W0i5O.d.mts +0 -35
  54. package/dist/input-C2SM4-AB.mjs +0 -71
@@ -0,0 +1,435 @@
1
+ import {
2
+ Combobox as BaseUICombobox,
3
+ type ComboboxArrowProps,
4
+ type ComboboxBackdropProps,
5
+ type ComboboxGroupProps,
6
+ type ComboboxLabelProps,
7
+ type ComboboxPortalProps,
8
+ type ComboboxRowProps,
9
+ type ComboboxStatusProps,
10
+ } from '@base-ui/react/combobox';
11
+ import { tv } from '@regardio/tailwind/utils';
12
+ import type { ComponentProps, ForwardRefExoticComponent, ReactNode, RefAttributes } from 'react';
13
+ import type { JSX } from 'react/jsx-runtime';
14
+
15
+ const comboboxInputGroup = tv({
16
+ base: ['relative', 'w-full'],
17
+ });
18
+
19
+ const comboboxInput = tv({
20
+ base: [
21
+ 'w-full',
22
+ 'border',
23
+ 'border-current',
24
+ 'rounded-md',
25
+ 'bg-background-muted',
26
+ 'text-foreground',
27
+ 'placeholder:text-muted-foreground',
28
+ 'focus-visible:outline-2',
29
+ 'focus-visible:outline-offset-2',
30
+ 'focus-visible:outline-ring',
31
+ 'transition-colors',
32
+ ],
33
+ defaultVariants: {
34
+ size: 'md',
35
+ },
36
+ variants: {
37
+ size: {
38
+ lg: ['px-4', 'py-3', 'text-lg'],
39
+ md: ['px-3', 'py-2'],
40
+ sm: ['px-2', 'py-1', 'text-sm'],
41
+ },
42
+ },
43
+ });
44
+
45
+ const comboboxTrigger = tv({
46
+ base: [
47
+ 'absolute',
48
+ 'right-0',
49
+ 'top-0',
50
+ 'bottom-0',
51
+ 'flex',
52
+ 'items-center',
53
+ 'px-3',
54
+ 'text-muted-foreground',
55
+ 'hover:text-foreground',
56
+ 'cursor-pointer',
57
+ ],
58
+ });
59
+
60
+ const comboboxIcon = tv({
61
+ base: ['flex', 'items-center'],
62
+ });
63
+
64
+ const comboboxClear = tv({
65
+ base: [
66
+ 'absolute',
67
+ 'right-10',
68
+ 'top-0',
69
+ 'bottom-0',
70
+ 'flex',
71
+ 'items-center',
72
+ 'px-2',
73
+ 'text-muted-foreground',
74
+ 'hover:text-foreground',
75
+ 'cursor-pointer',
76
+ ],
77
+ });
78
+
79
+ const comboboxChips = tv({
80
+ base: [
81
+ 'flex',
82
+ 'flex-wrap',
83
+ 'gap-1',
84
+ 'pr-10',
85
+ 'px-3',
86
+ 'py-2',
87
+ 'border',
88
+ 'border-current',
89
+ 'rounded-md',
90
+ 'bg-background-muted',
91
+ 'min-h-[42px]',
92
+ ],
93
+ });
94
+
95
+ const comboboxChip = tv({
96
+ base: [
97
+ 'inline-flex',
98
+ 'items-center',
99
+ 'gap-1',
100
+ 'px-2',
101
+ 'py-1',
102
+ 'rounded',
103
+ 'bg-muted',
104
+ 'text-foreground',
105
+ 'text-sm',
106
+ ],
107
+ });
108
+
109
+ const comboboxChipRemove = tv({
110
+ base: [
111
+ 'flex',
112
+ 'items-center',
113
+ 'text-muted-foreground',
114
+ 'hover:text-foreground',
115
+ 'cursor-pointer',
116
+ ],
117
+ });
118
+
119
+ const comboboxPositioner = tv({
120
+ base: ['absolute', 'z-50'],
121
+ });
122
+
123
+ const comboboxPopup = tv({
124
+ base: [
125
+ 'min-w-[var(--anchor-width)]',
126
+ 'mt-1',
127
+ 'rounded-md',
128
+ 'border',
129
+ 'border-current',
130
+ 'bg-background',
131
+ 'shadow-lg',
132
+ 'overflow-hidden',
133
+ ],
134
+ });
135
+
136
+ const comboboxList = tv({
137
+ base: ['max-h-60', 'overflow-auto', 'py-1', 'bg-background'],
138
+ });
139
+
140
+ const comboboxItem = tv({
141
+ base: [
142
+ 'flex',
143
+ 'items-center',
144
+ 'gap-2',
145
+ 'px-3',
146
+ 'py-2',
147
+ 'cursor-pointer',
148
+ 'text-foreground',
149
+ 'data-[highlighted]:bg-muted',
150
+ 'data-[selected]:bg-primary',
151
+ 'data-[selected]:text-primary-foreground',
152
+ ],
153
+ });
154
+
155
+ const comboboxItemIndicator = tv({
156
+ base: ['flex', 'data-[unselected]:hidden'],
157
+ });
158
+
159
+ const comboboxEmpty = tv({
160
+ base: ['px-3', 'py-2', 'text-muted-foreground'],
161
+ });
162
+
163
+ const comboboxGroupLabel = tv({
164
+ base: ['px-3', 'py-2', 'text-muted-foreground', 'font-semibold'],
165
+ });
166
+
167
+ const comboboxSeparator = tv({
168
+ base: ['my-1', 'h-px', 'bg-border'],
169
+ });
170
+
171
+ export type ComboboxSize = 'sm' | 'md' | 'lg';
172
+
173
+ interface ComboboxInputGroupProps extends ComponentProps<typeof BaseUICombobox.InputGroup> {
174
+ className?: string;
175
+ }
176
+
177
+ interface ComboboxInputProps extends Omit<ComponentProps<typeof BaseUICombobox.Input>, 'size'> {
178
+ className?: string;
179
+ size?: ComboboxSize;
180
+ }
181
+
182
+ interface ComboboxTriggerProps extends ComponentProps<typeof BaseUICombobox.Trigger> {
183
+ children?: ReactNode;
184
+ className?: string;
185
+ }
186
+
187
+ interface ComboboxIconProps extends ComponentProps<typeof BaseUICombobox.Icon> {
188
+ className?: string;
189
+ }
190
+
191
+ interface ComboboxClearProps extends ComponentProps<typeof BaseUICombobox.Clear> {
192
+ children?: ReactNode;
193
+ className?: string;
194
+ }
195
+
196
+ interface ComboboxChipsProps extends ComponentProps<typeof BaseUICombobox.Chips> {
197
+ className?: string;
198
+ }
199
+
200
+ interface ComboboxChipProps extends ComponentProps<typeof BaseUICombobox.Chip> {
201
+ className?: string;
202
+ }
203
+
204
+ interface ComboboxChipRemoveProps extends ComponentProps<typeof BaseUICombobox.ChipRemove> {
205
+ children?: ReactNode;
206
+ className?: string;
207
+ }
208
+
209
+ interface ComboboxPositionerProps extends ComponentProps<typeof BaseUICombobox.Positioner> {
210
+ className?: string;
211
+ }
212
+
213
+ interface ComboboxPopupProps extends ComponentProps<typeof BaseUICombobox.Popup> {
214
+ className?: string;
215
+ }
216
+
217
+ interface ComboboxListProps extends ComponentProps<typeof BaseUICombobox.List> {
218
+ className?: string;
219
+ }
220
+
221
+ interface ComboboxItemProps extends ComponentProps<typeof BaseUICombobox.Item> {
222
+ className?: string;
223
+ }
224
+
225
+ interface ComboboxItemIndicatorProps extends ComponentProps<typeof BaseUICombobox.ItemIndicator> {
226
+ className?: string;
227
+ }
228
+
229
+ interface ComboboxEmptyProps extends ComponentProps<typeof BaseUICombobox.Empty> {
230
+ className?: string;
231
+ }
232
+
233
+ interface ComboboxGroupLabelProps extends ComponentProps<typeof BaseUICombobox.GroupLabel> {
234
+ className?: string;
235
+ }
236
+
237
+ interface ComboboxSeparatorProps extends ComponentProps<typeof BaseUICombobox.Separator> {
238
+ className?: string;
239
+ }
240
+
241
+ const ComboboxInputGroup = ({ className, ...props }: ComboboxInputGroupProps): JSX.Element => (
242
+ <BaseUICombobox.InputGroup
243
+ className={comboboxInputGroup({ className })}
244
+ {...props}
245
+ />
246
+ );
247
+
248
+ const ComboboxInput = ({ className, size = 'md', ...props }: ComboboxInputProps): JSX.Element => (
249
+ <BaseUICombobox.Input
250
+ className={comboboxInput({ className, size })}
251
+ {...props}
252
+ />
253
+ );
254
+
255
+ const ComboboxTrigger = ({ className, children, ...props }: ComboboxTriggerProps): JSX.Element => (
256
+ <BaseUICombobox.Trigger
257
+ className={comboboxTrigger({ className })}
258
+ {...props}
259
+ >
260
+ {children}
261
+ </BaseUICombobox.Trigger>
262
+ );
263
+
264
+ const ComboboxIcon = ({ className, children = '▼', ...props }: ComboboxIconProps): JSX.Element => (
265
+ <BaseUICombobox.Icon
266
+ className={comboboxIcon({ className })}
267
+ {...props}
268
+ >
269
+ {children}
270
+ </BaseUICombobox.Icon>
271
+ );
272
+
273
+ const ComboboxClear = ({
274
+ className,
275
+ children = '✕',
276
+ ...props
277
+ }: ComboboxClearProps): JSX.Element => (
278
+ <BaseUICombobox.Clear
279
+ className={comboboxClear({ className })}
280
+ {...props}
281
+ >
282
+ {children}
283
+ </BaseUICombobox.Clear>
284
+ );
285
+
286
+ const ComboboxChips = ({ className, ...props }: ComboboxChipsProps): JSX.Element => (
287
+ <BaseUICombobox.Chips
288
+ className={comboboxChips({ className })}
289
+ {...props}
290
+ />
291
+ );
292
+
293
+ const ComboboxChip = ({ className, ...props }: ComboboxChipProps): JSX.Element => (
294
+ <BaseUICombobox.Chip
295
+ className={comboboxChip({ className })}
296
+ {...props}
297
+ />
298
+ );
299
+
300
+ const ComboboxChipRemove = ({
301
+ className,
302
+ children = '✕',
303
+ ...props
304
+ }: ComboboxChipRemoveProps): JSX.Element => (
305
+ <BaseUICombobox.ChipRemove
306
+ className={comboboxChipRemove({ className })}
307
+ {...props}
308
+ >
309
+ {children}
310
+ </BaseUICombobox.ChipRemove>
311
+ );
312
+
313
+ const ComboboxPositioner = ({ className, ...props }: ComboboxPositionerProps): JSX.Element => (
314
+ <BaseUICombobox.Positioner
315
+ className={comboboxPositioner({ className })}
316
+ {...props}
317
+ />
318
+ );
319
+
320
+ const ComboboxPopup = ({ className, ...props }: ComboboxPopupProps): JSX.Element => (
321
+ <BaseUICombobox.Popup
322
+ className={comboboxPopup({ className })}
323
+ {...props}
324
+ />
325
+ );
326
+
327
+ const ComboboxList = ({ className, ...props }: ComboboxListProps): JSX.Element => (
328
+ <BaseUICombobox.List
329
+ className={comboboxList({ className })}
330
+ {...props}
331
+ />
332
+ );
333
+
334
+ const ComboboxItem = ({ className, ...props }: ComboboxItemProps): JSX.Element => (
335
+ <BaseUICombobox.Item
336
+ className={comboboxItem({ className })}
337
+ {...props}
338
+ />
339
+ );
340
+
341
+ const ComboboxItemIndicator = ({
342
+ className,
343
+ children = '✓',
344
+ ...props
345
+ }: ComboboxItemIndicatorProps): JSX.Element => (
346
+ <BaseUICombobox.ItemIndicator
347
+ className={comboboxItemIndicator({ className })}
348
+ {...props}
349
+ >
350
+ {children}
351
+ </BaseUICombobox.ItemIndicator>
352
+ );
353
+
354
+ const ComboboxEmpty = ({ className, ...props }: ComboboxEmptyProps): JSX.Element => (
355
+ <BaseUICombobox.Empty
356
+ className={comboboxEmpty({ className })}
357
+ {...props}
358
+ />
359
+ );
360
+
361
+ const ComboboxGroupLabel = ({ className, ...props }: ComboboxGroupLabelProps): JSX.Element => (
362
+ <BaseUICombobox.GroupLabel
363
+ className={comboboxGroupLabel({ className })}
364
+ {...props}
365
+ />
366
+ );
367
+
368
+ const ComboboxSeparator = ({ className, ...props }: ComboboxSeparatorProps): JSX.Element => (
369
+ <BaseUICombobox.Separator
370
+ className={comboboxSeparator({ className })}
371
+ {...props}
372
+ />
373
+ );
374
+
375
+ export const Combobox: {
376
+ Arrow: ForwardRefExoticComponent<Omit<ComboboxArrowProps, 'ref'> & RefAttributes<HTMLDivElement>>;
377
+ Backdrop: ForwardRefExoticComponent<
378
+ Omit<ComboboxBackdropProps, 'ref'> & RefAttributes<HTMLDivElement>
379
+ >;
380
+ Chip: ({ className, ...props }: ComboboxChipProps) => JSX.Element;
381
+ ChipRemove: ({ className, children, ...props }: ComboboxChipRemoveProps) => JSX.Element;
382
+ Chips: ({ className, ...props }: ComboboxChipsProps) => JSX.Element;
383
+ Clear: ({ className, children, ...props }: ComboboxClearProps) => JSX.Element;
384
+ Collection: typeof BaseUICombobox.Collection;
385
+ Empty: ({ className, ...props }: ComboboxEmptyProps) => JSX.Element;
386
+ Group: ForwardRefExoticComponent<Omit<ComboboxGroupProps, 'ref'> & RefAttributes<HTMLDivElement>>;
387
+ GroupLabel: ({ className, ...props }: ComboboxGroupLabelProps) => JSX.Element;
388
+ Icon: ({ className, children, ...props }: ComboboxIconProps) => JSX.Element;
389
+ Input: ({ className, size, ...props }: ComboboxInputProps) => JSX.Element;
390
+ InputGroup: ({ className, ...props }: ComboboxInputGroupProps) => JSX.Element;
391
+ Item: ({ className, ...props }: ComboboxItemProps) => JSX.Element;
392
+ ItemIndicator: ({ className, children, ...props }: ComboboxItemIndicatorProps) => JSX.Element;
393
+ Label: ForwardRefExoticComponent<Omit<ComboboxLabelProps, 'ref'> & RefAttributes<HTMLDivElement>>;
394
+ List: ({ className, ...props }: ComboboxListProps) => JSX.Element;
395
+ Popup: ({ className, ...props }: ComboboxPopupProps) => JSX.Element;
396
+ Portal: ForwardRefExoticComponent<
397
+ Omit<ComboboxPortalProps, 'ref'> & RefAttributes<HTMLDivElement>
398
+ >;
399
+ Positioner: ({ className, ...props }: ComboboxPositionerProps) => JSX.Element;
400
+ Root: typeof BaseUICombobox.Root;
401
+ Row: ForwardRefExoticComponent<Omit<ComboboxRowProps, 'ref'> & RefAttributes<HTMLDivElement>>;
402
+ Separator: ({ className, ...props }: ComboboxSeparatorProps) => JSX.Element;
403
+ Status: ForwardRefExoticComponent<
404
+ Omit<ComboboxStatusProps, 'ref'> & RefAttributes<HTMLDivElement>
405
+ >;
406
+ Trigger: ({ className, children, ...props }: ComboboxTriggerProps) => JSX.Element;
407
+ Value: typeof BaseUICombobox.Value;
408
+ } = {
409
+ Arrow: BaseUICombobox.Arrow,
410
+ Backdrop: BaseUICombobox.Backdrop,
411
+ Chip: ComboboxChip,
412
+ ChipRemove: ComboboxChipRemove,
413
+ Chips: ComboboxChips,
414
+ Clear: ComboboxClear,
415
+ Collection: BaseUICombobox.Collection,
416
+ Empty: ComboboxEmpty,
417
+ Group: BaseUICombobox.Group,
418
+ GroupLabel: ComboboxGroupLabel,
419
+ Icon: ComboboxIcon,
420
+ Input: ComboboxInput,
421
+ InputGroup: ComboboxInputGroup,
422
+ Item: ComboboxItem,
423
+ ItemIndicator: ComboboxItemIndicator,
424
+ Label: BaseUICombobox.Label,
425
+ List: ComboboxList,
426
+ Popup: ComboboxPopup,
427
+ Portal: BaseUICombobox.Portal,
428
+ Positioner: ComboboxPositioner,
429
+ Root: BaseUICombobox.Root,
430
+ Row: BaseUICombobox.Row,
431
+ Separator: ComboboxSeparator,
432
+ Status: BaseUICombobox.Status,
433
+ Trigger: ComboboxTrigger,
434
+ Value: BaseUICombobox.Value,
435
+ };
@@ -0,0 +1,2 @@
1
+ export type { ComboboxSize } from './combobox';
2
+ export { Combobox } from './combobox';
@@ -56,6 +56,6 @@ describe('Field', () => {
56
56
  <Field.Label variant="error">Error Label</Field.Label>
57
57
  </Field.Root>,
58
58
  );
59
- expect(screen.getByText('Error Label')).toHaveClass('text-red-600');
59
+ expect(screen.getByText('Error Label')).toHaveClass('text-destructive');
60
60
  });
61
61
  });
@@ -3,12 +3,12 @@ import { tv } from '@regardio/tailwind/utils';
3
3
  import type { ComponentProps, ReactNode } from 'react';
4
4
 
5
5
  const fieldRootVariants = {
6
- default: [],
7
- required: ['after:content-["*"]', 'after:ml-1', 'after:text-red-500'],
6
+ default: ['space-y-1'],
7
+ required: ['space-y-1', 'after:content-["*"]', 'after:ml-1', 'after:text-destructive'],
8
8
  } as const;
9
9
 
10
10
  const fieldRoot = tv({
11
- base: ['space-y-1'],
11
+ base: [],
12
12
  defaultVariants: {
13
13
  variant: 'default',
14
14
  },
@@ -18,44 +18,52 @@ const fieldRoot = tv({
18
18
  });
19
19
 
20
20
  const fieldLabel = tv({
21
- base: ['block', 'text-sm', 'font-medium', 'text-gray-700', 'mb-1'],
21
+ base: [],
22
22
  defaultVariants: {
23
23
  variant: 'default',
24
24
  },
25
25
  variants: {
26
26
  variant: {
27
- default: [],
28
- error: ['text-red-600'],
27
+ default: ['block', 'text-foreground', 'mb-1'],
28
+ error: ['block', 'text-destructive', 'mb-1'],
29
29
  },
30
30
  },
31
31
  });
32
32
 
33
33
  const fieldDescription = tv({
34
- base: ['text-sm', 'text-gray-500', 'mt-1'],
34
+ base: [],
35
35
  defaultVariants: {
36
36
  variant: 'default',
37
37
  },
38
38
  variants: {
39
39
  variant: {
40
- default: [],
41
- error: ['text-red-600'],
40
+ default: ['text-muted-foreground', 'mt-1'],
41
+ error: ['text-destructive', 'mt-1'],
42
42
  },
43
43
  },
44
44
  });
45
45
 
46
46
  const fieldError = tv({
47
- base: ['text-sm', 'text-red-600', 'mt-1'],
47
+ base: [],
48
+ defaultVariants: {
49
+ variant: 'default',
50
+ },
51
+ variants: {
52
+ variant: {
53
+ default: ['text-destructive', 'mt-1'],
54
+ },
55
+ },
48
56
  });
49
57
 
50
58
  const fieldItem = tv({
51
- base: ['flex', 'flex-col'],
59
+ base: [],
52
60
  defaultVariants: {
53
61
  layout: 'default',
54
62
  },
55
63
  variants: {
56
64
  layout: {
57
- default: [],
58
- horizontal: ['flex-row', 'items-center', 'gap-2'],
65
+ default: ['flex', 'flex-col'],
66
+ horizontal: ['flex', 'flex-row', 'items-center', 'gap-2'],
59
67
  },
60
68
  },
61
69
  });
@@ -29,7 +29,7 @@ describe('Fieldset', () => {
29
29
  <Fieldset.Legend size="small">Small Legend</Fieldset.Legend>
30
30
  </Fieldset.Root>,
31
31
  );
32
- expect(screen.getByText('Small Legend')).toHaveClass('text-base', 'font-medium');
32
+ expect(screen.getByText('Small Legend')).toHaveClass('mb-1');
33
33
  });
34
34
 
35
35
  it('applies custom className to FieldsetRoot', () => {
@@ -3,12 +3,12 @@ import { tv } from '@regardio/tailwind/utils';
3
3
  import type { ComponentProps } from 'react';
4
4
 
5
5
  const fieldsetRootVariants = {
6
- compact: ['space-y-2'],
7
- default: ['space-y-4'],
6
+ compact: ['border', 'border-current', 'rounded-lg', 'p-4', 'space-y-2'],
7
+ default: ['border', 'border-current', 'rounded-lg', 'p-4', 'space-y-4'],
8
8
  } as const;
9
9
 
10
10
  const fieldsetRoot = tv({
11
- base: ['border', 'border-gray-200', 'rounded-lg', 'p-4'],
11
+ base: [],
12
12
  defaultVariants: {
13
13
  variant: 'default',
14
14
  },
@@ -18,14 +18,14 @@ const fieldsetRoot = tv({
18
18
  });
19
19
 
20
20
  const fieldsetLegend = tv({
21
- base: ['text-lg', 'font-semibold', 'text-gray-900', 'mb-2'],
21
+ base: [],
22
22
  defaultVariants: {
23
23
  size: 'default',
24
24
  },
25
25
  variants: {
26
26
  size: {
27
- default: [],
28
- small: ['text-base', 'font-medium', 'text-gray-900', 'mb-1'],
27
+ default: ['text-foreground', 'mb-2'],
28
+ small: ['text-foreground', 'mb-1'],
29
29
  },
30
30
  },
31
31
  });
@@ -51,7 +51,7 @@ describe('IconButton', () => {
51
51
  />,
52
52
  );
53
53
  const button = screen.getByTestId('variant-button');
54
- expect(button).toHaveClass('bg-gray-100');
54
+ expect(button).toHaveClass('bg-secondary', 'text-secondary-foreground');
55
55
  });
56
56
 
57
57
  it('uses title as aria-label when provided', () => {
@@ -46,13 +46,6 @@ export const ErrorState: Story = {
46
46
  },
47
47
  };
48
48
 
49
- export const Success: Story = {
50
- args: {
51
- placeholder: 'Success state',
52
- variant: 'success',
53
- },
54
- };
55
-
56
49
  export const Small: Story = {
57
50
  args: {
58
51
  placeholder: 'Small input',
@@ -116,10 +109,6 @@ export const AllVariants: Story = {
116
109
  placeholder="Error input"
117
110
  variant="error"
118
111
  />
119
- <Input
120
- placeholder="Success input"
121
- variant="success"
122
- />
123
112
  </div>
124
113
  ),
125
114
  };
@@ -15,7 +15,10 @@ describe('Input', () => {
15
15
  variant="error"
16
16
  />,
17
17
  );
18
- expect(screen.getByPlaceholderText('Error input')).toHaveClass('border-red-300');
18
+ expect(screen.getByPlaceholderText('Error input')).toHaveClass(
19
+ 'border-destructive',
20
+ 'text-destructive',
21
+ );
19
22
  });
20
23
 
21
24
  it('applies size styles', () => {
@@ -25,7 +28,7 @@ describe('Input', () => {
25
28
  size="lg"
26
29
  />,
27
30
  );
28
- expect(screen.getByPlaceholderText('Large input')).toHaveClass('px-4', 'py-3', 'text-lg');
31
+ expect(screen.getByPlaceholderText('Large input')).toHaveClass('px-4', 'py-3');
29
32
  });
30
33
 
31
34
  it('applies custom className', () => {