@auto-engineer/generate-react-client 1.64.0 → 1.66.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 (145) hide show
  1. package/CHANGELOG.md +140 -0
  2. package/dist/starter/.storybook/main.ts +17 -22
  3. package/dist/starter/.storybook/manager-head.html +31 -31
  4. package/dist/starter/.storybook/manager.ts +133 -133
  5. package/dist/starter/.storybook/preview-head.html +12 -12
  6. package/dist/starter/.storybook/preview.tsx +79 -79
  7. package/dist/starter/biome.json +126 -0
  8. package/dist/starter/codegen.ts +11 -11
  9. package/dist/starter/components.json +27 -27
  10. package/dist/starter/package.json +86 -80
  11. package/dist/starter/public/mockServiceWorker.js +261 -261
  12. package/dist/starter/scripts/build-component-db.ts +17 -20
  13. package/dist/starter/src/App.tsx +15 -17
  14. package/dist/starter/src/components/ui/Accordion.stories.tsx +35 -35
  15. package/dist/starter/src/components/ui/Accordion.tsx +33 -33
  16. package/dist/starter/src/components/ui/Alert.stories.tsx +15 -15
  17. package/dist/starter/src/components/ui/Alert.tsx +32 -32
  18. package/dist/starter/src/components/ui/AlertDialog.stories.tsx +50 -50
  19. package/dist/starter/src/components/ui/AlertDialog.tsx +114 -115
  20. package/dist/starter/src/components/ui/AspectRatio.stories.tsx +20 -20
  21. package/dist/starter/src/components/ui/AspectRatio.tsx +1 -1
  22. package/dist/starter/src/components/ui/Avatar.stories.tsx +27 -27
  23. package/dist/starter/src/components/ui/Avatar.tsx +63 -63
  24. package/dist/starter/src/components/ui/Badge.stories.tsx +14 -14
  25. package/dist/starter/src/components/ui/Badge.tsx +27 -27
  26. package/dist/starter/src/components/ui/Breadcrumb.stories.tsx +38 -38
  27. package/dist/starter/src/components/ui/Breadcrumb.tsx +63 -62
  28. package/dist/starter/src/components/ui/Button.stories.tsx +55 -55
  29. package/dist/starter/src/components/ui/Button.tsx +49 -49
  30. package/dist/starter/src/components/ui/ButtonGroup.stories.tsx +17 -17
  31. package/dist/starter/src/components/ui/ButtonGroup.tsx +52 -53
  32. package/dist/starter/src/components/ui/Calendar.stories.tsx +20 -19
  33. package/dist/starter/src/components/ui/Calendar.tsx +142 -143
  34. package/dist/starter/src/components/ui/Card.stories.tsx +29 -29
  35. package/dist/starter/src/components/ui/Card.tsx +31 -31
  36. package/dist/starter/src/components/ui/Carousel.stories.tsx +41 -41
  37. package/dist/starter/src/components/ui/Carousel.tsx +171 -172
  38. package/dist/starter/src/components/ui/Chart.stories.tsx +21 -21
  39. package/dist/starter/src/components/ui/Chart.tsx +244 -247
  40. package/dist/starter/src/components/ui/Checkbox.stories.tsx +11 -11
  41. package/dist/starter/src/components/ui/Checkbox.tsx +18 -18
  42. package/dist/starter/src/components/ui/Collapsible.stories.tsx +40 -40
  43. package/dist/starter/src/components/ui/Collapsible.tsx +3 -3
  44. package/dist/starter/src/components/ui/Combobox.stories.tsx +48 -48
  45. package/dist/starter/src/components/ui/Combobox.tsx +204 -205
  46. package/dist/starter/src/components/ui/Command.stories.tsx +55 -55
  47. package/dist/starter/src/components/ui/Command.tsx +102 -103
  48. package/dist/starter/src/components/ui/ContextMenu.stories.tsx +52 -52
  49. package/dist/starter/src/components/ui/ContextMenu.tsx +151 -151
  50. package/dist/starter/src/components/ui/DesignSystem-Colors.stories.tsx +92 -92
  51. package/dist/starter/src/components/ui/DesignSystem-Layout.stories.tsx +139 -139
  52. package/dist/starter/src/components/ui/DesignSystem-Overview.stories.tsx +676 -657
  53. package/dist/starter/src/components/ui/DesignSystem-Typography.stories.tsx +59 -59
  54. package/dist/starter/src/components/ui/Dialog.stories.tsx +56 -56
  55. package/dist/starter/src/components/ui/Dialog.tsx +97 -98
  56. package/dist/starter/src/components/ui/Direction.stories.tsx +20 -20
  57. package/dist/starter/src/components/ui/Direction.tsx +7 -7
  58. package/dist/starter/src/components/ui/Drawer.stories.tsx +54 -54
  59. package/dist/starter/src/components/ui/Drawer.tsx +70 -70
  60. package/dist/starter/src/components/ui/DropdownMenu.stories.tsx +58 -58
  61. package/dist/starter/src/components/ui/DropdownMenu.tsx +157 -157
  62. package/dist/starter/src/components/ui/Empty.stories.tsx +22 -22
  63. package/dist/starter/src/components/ui/Empty.tsx +58 -58
  64. package/dist/starter/src/components/ui/Field.stories.tsx +31 -31
  65. package/dist/starter/src/components/ui/Field.tsx +180 -181
  66. package/dist/starter/src/components/ui/Form.stories.tsx +29 -29
  67. package/dist/starter/src/components/ui/Form.tsx +93 -96
  68. package/dist/starter/src/components/ui/HoverCard.stories.tsx +34 -34
  69. package/dist/starter/src/components/ui/HoverCard.tsx +21 -21
  70. package/dist/starter/src/components/ui/Input.stories.tsx +18 -18
  71. package/dist/starter/src/components/ui/Input.tsx +14 -14
  72. package/dist/starter/src/components/ui/InputGroup.stories.tsx +34 -34
  73. package/dist/starter/src/components/ui/InputGroup.tsx +110 -111
  74. package/dist/starter/src/components/ui/InputOTP.stories.tsx +28 -28
  75. package/dist/starter/src/components/ui/InputOTP.tsx +43 -43
  76. package/dist/starter/src/components/ui/Item.stories.tsx +45 -45
  77. package/dist/starter/src/components/ui/Item.tsx +113 -114
  78. package/dist/starter/src/components/ui/Kbd.stories.tsx +31 -31
  79. package/dist/starter/src/components/ui/Kbd.tsx +11 -11
  80. package/dist/starter/src/components/ui/Label.stories.tsx +62 -62
  81. package/dist/starter/src/components/ui/Label.tsx +26 -25
  82. package/dist/starter/src/components/ui/Menubar.stories.tsx +62 -62
  83. package/dist/starter/src/components/ui/Menubar.tsx +173 -173
  84. package/dist/starter/src/components/ui/NativeSelect.stories.tsx +26 -26
  85. package/dist/starter/src/components/ui/NativeSelect.tsx +29 -29
  86. package/dist/starter/src/components/ui/NavigationMenu.stories.tsx +64 -64
  87. package/dist/starter/src/components/ui/NavigationMenu.tsx +103 -103
  88. package/dist/starter/src/components/ui/Pagination.stories.tsx +61 -61
  89. package/dist/starter/src/components/ui/Pagination.tsx +69 -71
  90. package/dist/starter/src/components/ui/Popover.stories.tsx +38 -38
  91. package/dist/starter/src/components/ui/Popover.tsx +25 -25
  92. package/dist/starter/src/components/ui/Progress.stories.tsx +9 -9
  93. package/dist/starter/src/components/ui/Progress.tsx +14 -14
  94. package/dist/starter/src/components/ui/RadioGroup.stories.tsx +35 -35
  95. package/dist/starter/src/components/ui/RadioGroup.tsx +19 -19
  96. package/dist/starter/src/components/ui/Resizable.stories.tsx +54 -54
  97. package/dist/starter/src/components/ui/Resizable.tsx +29 -29
  98. package/dist/starter/src/components/ui/ScrollArea.stories.tsx +27 -27
  99. package/dist/starter/src/components/ui/ScrollArea.tsx +34 -34
  100. package/dist/starter/src/components/ui/Select.stories.tsx +43 -43
  101. package/dist/starter/src/components/ui/Select.tsx +120 -120
  102. package/dist/starter/src/components/ui/Separator.stories.tsx +27 -27
  103. package/dist/starter/src/components/ui/Separator.tsx +17 -17
  104. package/dist/starter/src/components/ui/Sheet.stories.tsx +53 -53
  105. package/dist/starter/src/components/ui/Sheet.tsx +69 -69
  106. package/dist/starter/src/components/ui/Sidebar.stories.tsx +77 -77
  107. package/dist/starter/src/components/ui/Sidebar.tsx +563 -564
  108. package/dist/starter/src/components/ui/Skeleton.stories.tsx +25 -25
  109. package/dist/starter/src/components/ui/Skeleton.tsx +1 -1
  110. package/dist/starter/src/components/ui/Slider.stories.tsx +5 -5
  111. package/dist/starter/src/components/ui/Slider.tsx +45 -44
  112. package/dist/starter/src/components/ui/Sonner.stories.tsx +32 -32
  113. package/dist/starter/src/components/ui/Sonner.tsx +23 -23
  114. package/dist/starter/src/components/ui/Spinner.stories.tsx +8 -8
  115. package/dist/starter/src/components/ui/Spinner.tsx +1 -1
  116. package/dist/starter/src/components/ui/Switch.stories.tsx +16 -17
  117. package/dist/starter/src/components/ui/Switch.tsx +24 -24
  118. package/dist/starter/src/components/ui/Table.stories.tsx +50 -50
  119. package/dist/starter/src/components/ui/Table.tsx +45 -45
  120. package/dist/starter/src/components/ui/Tabs.stories.tsx +39 -39
  121. package/dist/starter/src/components/ui/Tabs.tsx +47 -47
  122. package/dist/starter/src/components/ui/Textarea.stories.tsx +9 -9
  123. package/dist/starter/src/components/ui/Textarea.tsx +11 -11
  124. package/dist/starter/src/components/ui/Toast.stories.tsx +77 -77
  125. package/dist/starter/src/components/ui/Toast.tsx +75 -75
  126. package/dist/starter/src/components/ui/Toaster.tsx +17 -19
  127. package/dist/starter/src/components/ui/Toggle.stories.tsx +20 -20
  128. package/dist/starter/src/components/ui/Toggle.tsx +26 -26
  129. package/dist/starter/src/components/ui/ToggleGroup.stories.tsx +41 -41
  130. package/dist/starter/src/components/ui/ToggleGroup.tsx +61 -62
  131. package/dist/starter/src/components/ui/Tooltip.stories.tsx +26 -26
  132. package/dist/starter/src/components/ui/Tooltip.tsx +24 -24
  133. package/dist/starter/src/gql/execute.ts +1 -1
  134. package/dist/starter/src/gql/fragment-masking.ts +1 -1
  135. package/dist/starter/src/gql/graphql.ts +3 -0
  136. package/dist/starter/src/hooks/use-mobile.ts +11 -11
  137. package/dist/starter/src/hooks/use-toast.ts +135 -135
  138. package/dist/starter/src/index.css +105 -105
  139. package/dist/starter/src/lib/utils.ts +1 -1
  140. package/dist/starter/src/main.tsx +4 -1
  141. package/dist/starter/tsconfig.app.json +24 -24
  142. package/dist/starter/tsconfig.json +8 -8
  143. package/dist/starter/vite.config.ts +38 -37
  144. package/dist/tsconfig.tsbuildinfo +1 -1
  145. package/package.json +3 -3
@@ -1,27 +1,27 @@
1
- import * as React from 'react';
2
1
  import { cva, type VariantProps } from 'class-variance-authority';
3
2
  import { Slot } from 'radix-ui';
3
+ import type * as React from 'react';
4
4
 
5
5
  import { cn } from '@/lib/utils';
6
6
 
7
7
  const badgeVariants = cva(
8
- 'inline-flex items-center justify-center rounded-full border border-transparent 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',
9
- {
10
- variants: {
11
- variant: {
12
- default: 'bg-primary text-primary-foreground [a&]:hover:bg-primary/90',
13
- secondary: 'bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90',
14
- destructive:
15
- 'bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',
16
- outline: 'border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground',
17
- ghost: '[a&]:hover:bg-accent [a&]:hover:text-accent-foreground',
18
- link: 'text-primary underline-offset-4 [a&]:hover:underline',
19
- },
20
- },
21
- defaultVariants: {
22
- variant: 'default',
23
- },
24
- },
8
+ 'inline-flex items-center justify-center rounded-full border border-transparent 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',
9
+ {
10
+ variants: {
11
+ variant: {
12
+ default: 'bg-primary text-primary-foreground [a&]:hover:bg-primary/90',
13
+ secondary: 'bg-secondary text-secondary-foreground [a&]:hover:bg-secondary/90',
14
+ destructive:
15
+ 'bg-destructive text-white [a&]:hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',
16
+ outline: 'border-border text-foreground [a&]:hover:bg-accent [a&]:hover:text-accent-foreground',
17
+ ghost: '[a&]:hover:bg-accent [a&]:hover:text-accent-foreground',
18
+ link: 'text-primary underline-offset-4 [a&]:hover:underline',
19
+ },
20
+ },
21
+ defaultVariants: {
22
+ variant: 'default',
23
+ },
24
+ },
25
25
  );
26
26
 
27
27
  /**
@@ -29,17 +29,17 @@ const badgeVariants = cva(
29
29
  * Supports multiple visual variants: default, secondary, destructive, outline, ghost, and link.
30
30
  */
31
31
  function Badge({
32
- className,
33
- variant = 'default',
34
- /** Merges props onto the child element instead of rendering a span. Use with custom wrapper elements. */
35
- asChild = false,
36
- ...props
32
+ className,
33
+ variant = 'default',
34
+ /** Merges props onto the child element instead of rendering a span. Use with custom wrapper elements. */
35
+ asChild = false,
36
+ ...props
37
37
  }: React.ComponentProps<'span'> & VariantProps<typeof badgeVariants> & { asChild?: boolean }) {
38
- const Comp = asChild ? Slot.Root : 'span';
38
+ const Comp = asChild ? Slot.Root : 'span';
39
39
 
40
- return (
41
- <Comp data-slot="badge" data-variant={variant} className={cn(badgeVariants({ variant }), className)} {...props} />
42
- );
40
+ return (
41
+ <Comp data-slot="badge" data-variant={variant} className={cn(badgeVariants({ variant }), className)} {...props} />
42
+ );
43
43
  }
44
44
 
45
45
  export { Badge, badgeVariants };
@@ -1,54 +1,54 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react-vite';
2
2
  import {
3
- Breadcrumb,
4
- BreadcrumbList,
5
- BreadcrumbItem,
6
- BreadcrumbLink,
7
- BreadcrumbPage,
8
- BreadcrumbSeparator,
3
+ Breadcrumb,
4
+ BreadcrumbItem,
5
+ BreadcrumbLink,
6
+ BreadcrumbList,
7
+ BreadcrumbPage,
8
+ BreadcrumbSeparator,
9
9
  } from '@/components/ui/Breadcrumb';
10
10
 
11
11
  const meta: Meta<typeof Breadcrumb> = {
12
- title: 'UI Components/Breadcrumb',
13
- component: Breadcrumb,
12
+ title: 'UI Components/Breadcrumb',
13
+ component: Breadcrumb,
14
14
  };
15
15
  export default meta;
16
16
  type Story = StoryObj<typeof Breadcrumb>;
17
17
 
18
18
  /** Shows a three-level breadcrumb trail with home, category, and current page. */
19
19
  export const Default: Story = {
20
- render: () => (
21
- <Breadcrumb>
22
- <BreadcrumbList>
23
- <BreadcrumbItem>
24
- <BreadcrumbLink href="/">Home</BreadcrumbLink>
25
- </BreadcrumbItem>
26
- <BreadcrumbSeparator />
27
- <BreadcrumbItem>
28
- <BreadcrumbLink href="/components">Components</BreadcrumbLink>
29
- </BreadcrumbItem>
30
- <BreadcrumbSeparator />
31
- <BreadcrumbItem>
32
- <BreadcrumbPage>Breadcrumb</BreadcrumbPage>
33
- </BreadcrumbItem>
34
- </BreadcrumbList>
35
- </Breadcrumb>
36
- ),
20
+ render: () => (
21
+ <Breadcrumb>
22
+ <BreadcrumbList>
23
+ <BreadcrumbItem>
24
+ <BreadcrumbLink href="/">Home</BreadcrumbLink>
25
+ </BreadcrumbItem>
26
+ <BreadcrumbSeparator />
27
+ <BreadcrumbItem>
28
+ <BreadcrumbLink href="/components">Components</BreadcrumbLink>
29
+ </BreadcrumbItem>
30
+ <BreadcrumbSeparator />
31
+ <BreadcrumbItem>
32
+ <BreadcrumbPage>Breadcrumb</BreadcrumbPage>
33
+ </BreadcrumbItem>
34
+ </BreadcrumbList>
35
+ </Breadcrumb>
36
+ ),
37
37
  };
38
38
 
39
39
  /** Shows a minimal two-level breadcrumb with just a parent link and current page. */
40
40
  export const TwoLevels: Story = {
41
- render: () => (
42
- <Breadcrumb>
43
- <BreadcrumbList>
44
- <BreadcrumbItem>
45
- <BreadcrumbLink href="/">Dashboard</BreadcrumbLink>
46
- </BreadcrumbItem>
47
- <BreadcrumbSeparator />
48
- <BreadcrumbItem>
49
- <BreadcrumbPage>Settings</BreadcrumbPage>
50
- </BreadcrumbItem>
51
- </BreadcrumbList>
52
- </Breadcrumb>
53
- ),
41
+ render: () => (
42
+ <Breadcrumb>
43
+ <BreadcrumbList>
44
+ <BreadcrumbItem>
45
+ <BreadcrumbLink href="/">Dashboard</BreadcrumbLink>
46
+ </BreadcrumbItem>
47
+ <BreadcrumbSeparator />
48
+ <BreadcrumbItem>
49
+ <BreadcrumbPage>Settings</BreadcrumbPage>
50
+ </BreadcrumbItem>
51
+ </BreadcrumbList>
52
+ </Breadcrumb>
53
+ ),
54
54
  };
@@ -1,6 +1,6 @@
1
- import * as React from 'react';
2
1
  import { ChevronRight, MoreHorizontal } from 'lucide-react';
3
2
  import { Slot } from 'radix-ui';
3
+ import type * as React from 'react';
4
4
 
5
5
  import { cn } from '@/lib/utils';
6
6
 
@@ -10,95 +10,96 @@ import { cn } from '@/lib/utils';
10
10
  * Renders as a `<nav>` with `aria-label="breadcrumb"` for accessibility.
11
11
  */
12
12
  function Breadcrumb({ ...props }: React.ComponentProps<'nav'>) {
13
- return <nav aria-label="breadcrumb" data-slot="breadcrumb" {...props} />;
13
+ return <nav aria-label="breadcrumb" data-slot="breadcrumb" {...props} />;
14
14
  }
15
15
 
16
16
  /** The ordered list container for breadcrumb items, handling wrapping and spacing. */
17
17
  function BreadcrumbList({ className, ...props }: React.ComponentProps<'ol'>) {
18
- return (
19
- <ol
20
- data-slot="breadcrumb-list"
21
- className={cn(
22
- 'text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5',
23
- className,
24
- )}
25
- {...props}
26
- />
27
- );
18
+ return (
19
+ <ol
20
+ data-slot="breadcrumb-list"
21
+ className={cn(
22
+ 'text-muted-foreground flex flex-wrap items-center gap-1.5 text-sm break-words sm:gap-2.5',
23
+ className,
24
+ )}
25
+ {...props}
26
+ />
27
+ );
28
28
  }
29
29
 
30
30
  /** A single step in the breadcrumb trail, wrapping a link or the current page label. */
31
31
  function BreadcrumbItem({ className, ...props }: React.ComponentProps<'li'>) {
32
- return <li data-slot="breadcrumb-item" className={cn('inline-flex items-center gap-1.5', className)} {...props} />;
32
+ return <li data-slot="breadcrumb-item" className={cn('inline-flex items-center gap-1.5', className)} {...props} />;
33
33
  }
34
34
 
35
35
  /** A navigable link within a breadcrumb item. Use `asChild` to render a router Link component instead of an anchor. */
36
36
  function BreadcrumbLink({
37
- /** Merges props onto the child element instead of rendering an anchor tag. */
38
- asChild,
39
- className,
40
- ...props
37
+ /** Merges props onto the child element instead of rendering an anchor tag. */
38
+ asChild,
39
+ className,
40
+ ...props
41
41
  }: React.ComponentProps<'a'> & {
42
- asChild?: boolean;
42
+ asChild?: boolean;
43
43
  }) {
44
- const Comp = asChild ? Slot.Root : 'a';
44
+ const Comp = asChild ? Slot.Root : 'a';
45
45
 
46
- return (
47
- <Comp data-slot="breadcrumb-link" className={cn('hover:text-foreground transition-colors', className)} {...props} />
48
- );
46
+ return (
47
+ <Comp data-slot="breadcrumb-link" className={cn('hover:text-foreground transition-colors', className)} {...props} />
48
+ );
49
49
  }
50
50
 
51
51
  /** The current page label in the breadcrumb trail, marked with `aria-current="page"` and rendered as non-interactive text. */
52
52
  function BreadcrumbPage({ className, ...props }: React.ComponentProps<'span'>) {
53
- return (
54
- <span
55
- data-slot="breadcrumb-page"
56
- role="link"
57
- aria-disabled="true"
58
- aria-current="page"
59
- className={cn('text-foreground font-normal', className)}
60
- {...props}
61
- />
62
- );
53
+ return (
54
+ <span
55
+ data-slot="breadcrumb-page"
56
+ role="link"
57
+ tabIndex={0}
58
+ aria-disabled="true"
59
+ aria-current="page"
60
+ className={cn('text-foreground font-normal', className)}
61
+ {...props}
62
+ />
63
+ );
63
64
  }
64
65
 
65
66
  /** A visual divider between breadcrumb items, defaulting to a chevron-right icon. Pass children to customize the separator. */
66
67
  function BreadcrumbSeparator({ children, className, ...props }: React.ComponentProps<'li'>) {
67
- return (
68
- <li
69
- data-slot="breadcrumb-separator"
70
- role="presentation"
71
- aria-hidden="true"
72
- className={cn('[&>svg]:size-3.5', className)}
73
- {...props}
74
- >
75
- {children ?? <ChevronRight />}
76
- </li>
77
- );
68
+ return (
69
+ <li
70
+ data-slot="breadcrumb-separator"
71
+ role="presentation"
72
+ aria-hidden="true"
73
+ className={cn('[&>svg]:size-3.5', className)}
74
+ {...props}
75
+ >
76
+ {children ?? <ChevronRight />}
77
+ </li>
78
+ );
78
79
  }
79
80
 
80
81
  /** A "..." indicator used to collapse intermediate breadcrumb levels when the trail is too long. */
81
82
  function BreadcrumbEllipsis({ className, ...props }: React.ComponentProps<'span'>) {
82
- return (
83
- <span
84
- data-slot="breadcrumb-ellipsis"
85
- role="presentation"
86
- aria-hidden="true"
87
- className={cn('flex size-9 items-center justify-center', className)}
88
- {...props}
89
- >
90
- <MoreHorizontal className="size-4" />
91
- <span className="sr-only">More</span>
92
- </span>
93
- );
83
+ return (
84
+ <span
85
+ data-slot="breadcrumb-ellipsis"
86
+ role="presentation"
87
+ aria-hidden="true"
88
+ className={cn('flex size-9 items-center justify-center', className)}
89
+ {...props}
90
+ >
91
+ <MoreHorizontal className="size-4" />
92
+ <span className="sr-only">More</span>
93
+ </span>
94
+ );
94
95
  }
95
96
 
96
97
  export {
97
- Breadcrumb,
98
- BreadcrumbList,
99
- BreadcrumbItem,
100
- BreadcrumbLink,
101
- BreadcrumbPage,
102
- BreadcrumbSeparator,
103
- BreadcrumbEllipsis,
98
+ Breadcrumb,
99
+ BreadcrumbList,
100
+ BreadcrumbItem,
101
+ BreadcrumbLink,
102
+ BreadcrumbPage,
103
+ BreadcrumbSeparator,
104
+ BreadcrumbEllipsis,
104
105
  };
@@ -2,101 +2,101 @@ import type { Meta, StoryObj } from '@storybook/react-vite';
2
2
  import { Button } from '@/components/ui/Button';
3
3
 
4
4
  const meta: Meta<typeof Button> = {
5
- title: 'UI Components/Button',
6
- component: Button,
5
+ title: 'UI Components/Button',
6
+ component: Button,
7
7
  };
8
8
  export default meta;
9
9
  type Story = StoryObj<typeof Button>;
10
10
 
11
11
  /** Shows the primary filled button variant. */
12
12
  export const Default: Story = {
13
- args: {
14
- children: 'Button',
15
- },
13
+ args: {
14
+ children: 'Button',
15
+ },
16
16
  };
17
17
 
18
18
  /** Shows the secondary button variant with muted styling. */
19
19
  export const Secondary: Story = {
20
- args: {
21
- variant: 'secondary',
22
- children: 'Secondary',
23
- },
20
+ args: {
21
+ variant: 'secondary',
22
+ children: 'Secondary',
23
+ },
24
24
  };
25
25
 
26
26
  /** Shows the destructive button variant for dangerous actions like delete. */
27
27
  export const Destructive: Story = {
28
- args: {
29
- variant: 'destructive',
30
- children: 'Destructive',
31
- },
28
+ args: {
29
+ variant: 'destructive',
30
+ children: 'Destructive',
31
+ },
32
32
  };
33
33
 
34
34
  /** Shows the outline button variant with a border and transparent background. */
35
35
  export const Outline: Story = {
36
- args: {
37
- variant: 'outline',
38
- children: 'Outline',
39
- },
36
+ args: {
37
+ variant: 'outline',
38
+ children: 'Outline',
39
+ },
40
40
  };
41
41
 
42
42
  /** Shows the ghost button variant with no background until hovered. */
43
43
  export const Ghost: Story = {
44
- args: {
45
- variant: 'ghost',
46
- children: 'Ghost',
47
- },
44
+ args: {
45
+ variant: 'ghost',
46
+ children: 'Ghost',
47
+ },
48
48
  };
49
49
 
50
50
  /** Shows the link button variant styled as an inline text link with underline on hover. */
51
51
  export const Link: Story = {
52
- args: {
53
- variant: 'link',
54
- children: 'Link',
55
- },
52
+ args: {
53
+ variant: 'link',
54
+ children: 'Link',
55
+ },
56
56
  };
57
57
 
58
58
  /** Shows a compact small-sized button. */
59
59
  export const Small: Story = {
60
- args: {
61
- size: 'sm',
62
- children: 'Small',
63
- },
60
+ args: {
61
+ size: 'sm',
62
+ children: 'Small',
63
+ },
64
64
  };
65
65
 
66
66
  /** Shows a larger button with more padding. */
67
67
  export const Large: Story = {
68
- args: {
69
- size: 'lg',
70
- children: 'Large',
71
- },
68
+ args: {
69
+ size: 'lg',
70
+ children: 'Large',
71
+ },
72
72
  };
73
73
 
74
74
  /** Shows an icon-only square button. */
75
75
  export const Icon: Story = {
76
- args: {
77
- size: 'icon',
78
- children: 'X',
79
- },
76
+ args: {
77
+ size: 'icon',
78
+ children: 'X',
79
+ },
80
80
  };
81
81
 
82
82
  /** Displays all button variants and sizes side by side for visual comparison. */
83
83
  export const AllVariants: Story = {
84
- render: () => (
85
- <div className="flex flex-col gap-4">
86
- <div className="flex flex-wrap items-center gap-2">
87
- <Button variant="default">Default</Button>
88
- <Button variant="secondary">Secondary</Button>
89
- <Button variant="destructive">Destructive</Button>
90
- <Button variant="outline">Outline</Button>
91
- <Button variant="ghost">Ghost</Button>
92
- <Button variant="link">Link</Button>
93
- </div>
94
- <div className="flex flex-wrap items-center gap-2">
95
- <Button size="sm">Small</Button>
96
- <Button size="default">Default</Button>
97
- <Button size="lg">Large</Button>
98
- <Button size="icon">X</Button>
99
- </div>
100
- </div>
101
- ),
84
+ render: () => (
85
+ <div className="flex flex-col gap-4">
86
+ <div className="flex flex-wrap items-center gap-2">
87
+ <Button variant="default">Default</Button>
88
+ <Button variant="secondary">Secondary</Button>
89
+ <Button variant="destructive">Destructive</Button>
90
+ <Button variant="outline">Outline</Button>
91
+ <Button variant="ghost">Ghost</Button>
92
+ <Button variant="link">Link</Button>
93
+ </div>
94
+ <div className="flex flex-wrap items-center gap-2">
95
+ <Button size="sm">Small</Button>
96
+ <Button size="default">Default</Button>
97
+ <Button size="lg">Large</Button>
98
+ <Button size="icon">X</Button>
99
+ </div>
100
+ </div>
101
+ ),
102
102
  };
@@ -1,39 +1,39 @@
1
- import * as React from 'react';
2
1
  import { cva, type VariantProps } from 'class-variance-authority';
3
2
  import { Slot } from 'radix-ui';
3
+ import type * as React from 'react';
4
4
 
5
5
  import { cn } from '@/lib/utils';
6
6
 
7
7
  const buttonVariants = cva(
8
- "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-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",
9
- {
10
- variants: {
11
- variant: {
12
- default: 'bg-primary text-primary-foreground hover:bg-primary/90',
13
- destructive:
14
- 'bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',
15
- outline:
16
- 'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50',
17
- secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
18
- ghost: 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',
19
- link: 'text-primary underline-offset-4 hover:underline',
20
- },
21
- size: {
22
- default: 'h-9 px-4 py-2 has-[>svg]:px-3',
23
- xs: "h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",
24
- sm: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5',
25
- lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',
26
- icon: 'size-9',
27
- 'icon-xs': "size-6 rounded-md [&_svg:not([class*='size-'])]:size-3",
28
- 'icon-sm': 'size-8',
29
- 'icon-lg': 'size-10',
30
- },
31
- },
32
- defaultVariants: {
33
- variant: 'default',
34
- size: 'default',
35
- },
36
- },
8
+ "inline-flex items-center justify-center gap-2 whitespace-nowrap rounded-md text-sm font-medium transition-all disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4 shrink-0 [&_svg]:shrink-0 outline-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",
9
+ {
10
+ variants: {
11
+ variant: {
12
+ default: 'bg-primary text-primary-foreground hover:bg-primary/90',
13
+ destructive:
14
+ 'bg-destructive text-white hover:bg-destructive/90 focus-visible:ring-destructive/20 dark:focus-visible:ring-destructive/40 dark:bg-destructive/60',
15
+ outline:
16
+ 'border bg-background shadow-xs hover:bg-accent hover:text-accent-foreground dark:bg-input/30 dark:border-input dark:hover:bg-input/50',
17
+ secondary: 'bg-secondary text-secondary-foreground hover:bg-secondary/80',
18
+ ghost: 'hover:bg-accent hover:text-accent-foreground dark:hover:bg-accent/50',
19
+ link: 'text-primary underline-offset-4 hover:underline',
20
+ },
21
+ size: {
22
+ default: 'h-9 px-4 py-2 has-[>svg]:px-3',
23
+ xs: "h-6 gap-1 rounded-md px-2 text-xs has-[>svg]:px-1.5 [&_svg:not([class*='size-'])]:size-3",
24
+ sm: 'h-8 rounded-md gap-1.5 px-3 has-[>svg]:px-2.5',
25
+ lg: 'h-10 rounded-md px-6 has-[>svg]:px-4',
26
+ icon: 'size-9',
27
+ 'icon-xs': "size-6 rounded-md [&_svg:not([class*='size-'])]:size-3",
28
+ 'icon-sm': 'size-8',
29
+ 'icon-lg': 'size-10',
30
+ },
31
+ },
32
+ defaultVariants: {
33
+ variant: 'default',
34
+ size: 'default',
35
+ },
36
+ },
37
37
  );
38
38
 
39
39
  /**
@@ -41,27 +41,27 @@ const buttonVariants = cva(
41
41
  * Supports six visual variants (default, secondary, destructive, outline, ghost, link) and multiple sizes including icon-only modes.
42
42
  */
43
43
  function Button({
44
- className,
45
- variant = 'default',
46
- size = 'default',
47
- /** Merges props onto the child element instead of rendering a button. Use with Link or anchor components for navigation. */
48
- asChild = false,
49
- ...props
44
+ className,
45
+ variant = 'default',
46
+ size = 'default',
47
+ /** Merges props onto the child element instead of rendering a button. Use with Link or anchor components for navigation. */
48
+ asChild = false,
49
+ ...props
50
50
  }: React.ComponentProps<'button'> &
51
- VariantProps<typeof buttonVariants> & {
52
- asChild?: boolean;
53
- }) {
54
- const Comp = asChild ? Slot.Root : 'button';
51
+ VariantProps<typeof buttonVariants> & {
52
+ asChild?: boolean;
53
+ }) {
54
+ const Comp = asChild ? Slot.Root : 'button';
55
55
 
56
- return (
57
- <Comp
58
- data-slot="button"
59
- data-variant={variant}
60
- data-size={size}
61
- className={cn(buttonVariants({ variant, size, className }))}
62
- {...props}
63
- />
64
- );
56
+ return (
57
+ <Comp
58
+ data-slot="button"
59
+ data-variant={variant}
60
+ data-size={size}
61
+ className={cn(buttonVariants({ variant, size, className }))}
62
+ {...props}
63
+ />
64
+ );
65
65
  }
66
66
 
67
67
  export { Button, buttonVariants };
@@ -1,32 +1,32 @@
1
1
  import type { Meta, StoryObj } from '@storybook/react-vite';
2
- import { ButtonGroup } from '@/components/ui/ButtonGroup';
3
2
  import { Button } from '@/components/ui/Button';
3
+ import { ButtonGroup } from '@/components/ui/ButtonGroup';
4
4
 
5
5
  const meta: Meta<typeof ButtonGroup> = {
6
- title: 'UI Components/ButtonGroup',
7
- component: ButtonGroup,
6
+ title: 'UI Components/ButtonGroup',
7
+ component: ButtonGroup,
8
8
  };
9
9
  export default meta;
10
10
  type Story = StoryObj<typeof ButtonGroup>;
11
11
 
12
12
  /** Shows a horizontal group of three outline buttons with connected borders. */
13
13
  export const Default: Story = {
14
- render: () => (
15
- <ButtonGroup>
16
- <Button variant="outline">Left</Button>
17
- <Button variant="outline">Center</Button>
18
- <Button variant="outline">Right</Button>
19
- </ButtonGroup>
20
- ),
14
+ render: () => (
15
+ <ButtonGroup>
16
+ <Button variant="outline">Left</Button>
17
+ <Button variant="outline">Center</Button>
18
+ <Button variant="outline">Right</Button>
19
+ </ButtonGroup>
20
+ ),
21
21
  };
22
22
 
23
23
  /** Shows a vertically stacked button group. */
24
24
  export const Vertical: Story = {
25
- render: () => (
26
- <ButtonGroup orientation="vertical">
27
- <Button variant="outline">Top</Button>
28
- <Button variant="outline">Middle</Button>
29
- <Button variant="outline">Bottom</Button>
30
- </ButtonGroup>
31
- ),
25
+ render: () => (
26
+ <ButtonGroup orientation="vertical">
27
+ <Button variant="outline">Top</Button>
28
+ <Button variant="outline">Middle</Button>
29
+ <Button variant="outline">Bottom</Button>
30
+ </ButtonGroup>
31
+ ),
32
32
  };