@auto-engineer/generate-react-client 1.12.1

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 (154) hide show
  1. package/CHANGELOG.md +12 -0
  2. package/LICENSE +10 -0
  3. package/dist/src/commands/generate-react-client.d.ts +21 -0
  4. package/dist/src/commands/generate-react-client.d.ts.map +1 -0
  5. package/dist/src/commands/generate-react-client.js +62 -0
  6. package/dist/src/commands/generate-react-client.js.map +1 -0
  7. package/dist/src/copy-starter.d.ts +2 -0
  8. package/dist/src/copy-starter.d.ts.map +1 -0
  9. package/dist/src/copy-starter.js +34 -0
  10. package/dist/src/copy-starter.js.map +1 -0
  11. package/dist/src/index.d.ts +10 -0
  12. package/dist/src/index.d.ts.map +1 -0
  13. package/dist/src/index.js +4 -0
  14. package/dist/src/index.js.map +1 -0
  15. package/dist/starter/.storybook/main.ts +33 -0
  16. package/dist/starter/.storybook/preview.tsx +35 -0
  17. package/dist/starter/components.json +29 -0
  18. package/dist/starter/index.html +12 -0
  19. package/dist/starter/package.json +60 -0
  20. package/dist/starter/pnpm-lock.yaml +5236 -0
  21. package/dist/starter/public/mockServiceWorker.js +336 -0
  22. package/dist/starter/src/App.tsx +15 -0
  23. package/dist/starter/src/components/.gitkeep +0 -0
  24. package/dist/starter/src/components/ui/Accordion.stories.tsx +47 -0
  25. package/dist/starter/src/components/ui/Accordion.tsx +51 -0
  26. package/dist/starter/src/components/ui/Alert.stories.tsx +27 -0
  27. package/dist/starter/src/components/ui/Alert.tsx +49 -0
  28. package/dist/starter/src/components/ui/AlertDialog.stories.tsx +65 -0
  29. package/dist/starter/src/components/ui/AlertDialog.tsx +163 -0
  30. package/dist/starter/src/components/ui/AspectRatio.stories.tsx +33 -0
  31. package/dist/starter/src/components/ui/AspectRatio.tsx +9 -0
  32. package/dist/starter/src/components/ui/Avatar.stories.tsx +42 -0
  33. package/dist/starter/src/components/ui/Avatar.tsx +87 -0
  34. package/dist/starter/src/components/ui/Badge.stories.tsx +36 -0
  35. package/dist/starter/src/components/ui/Badge.tsx +40 -0
  36. package/dist/starter/src/components/ui/Breadcrumb.stories.tsx +52 -0
  37. package/dist/starter/src/components/ui/Breadcrumb.tsx +92 -0
  38. package/dist/starter/src/components/ui/Button.stories.tsx +92 -0
  39. package/dist/starter/src/components/ui/Button.tsx +62 -0
  40. package/dist/starter/src/components/ui/ButtonGroup.stories.tsx +30 -0
  41. package/dist/starter/src/components/ui/ButtonGroup.tsx +75 -0
  42. package/dist/starter/src/components/ui/Calendar.stories.tsx +38 -0
  43. package/dist/starter/src/components/ui/Calendar.tsx +159 -0
  44. package/dist/starter/src/components/ui/Card.stories.tsx +42 -0
  45. package/dist/starter/src/components/ui/Card.tsx +56 -0
  46. package/dist/starter/src/components/ui/Carousel.stories.tsx +54 -0
  47. package/dist/starter/src/components/ui/Carousel.tsx +216 -0
  48. package/dist/starter/src/components/ui/Chart.stories.tsx +38 -0
  49. package/dist/starter/src/components/ui/Chart.tsx +296 -0
  50. package/dist/starter/src/components/ui/Checkbox.stories.tsx +31 -0
  51. package/dist/starter/src/components/ui/Checkbox.tsx +29 -0
  52. package/dist/starter/src/components/ui/Collapsible.stories.tsx +56 -0
  53. package/dist/starter/src/components/ui/Collapsible.tsx +15 -0
  54. package/dist/starter/src/components/ui/Combobox.stories.tsx +73 -0
  55. package/dist/starter/src/components/ui/Combobox.tsx +267 -0
  56. package/dist/starter/src/components/ui/Command.stories.tsx +69 -0
  57. package/dist/starter/src/components/ui/Command.tsx +137 -0
  58. package/dist/starter/src/components/ui/ContextMenu.stories.tsx +66 -0
  59. package/dist/starter/src/components/ui/ContextMenu.tsx +211 -0
  60. package/dist/starter/src/components/ui/DesignSystem-Colors.mdx +68 -0
  61. package/dist/starter/src/components/ui/DesignSystem-Colors.stories.tsx +116 -0
  62. package/dist/starter/src/components/ui/DesignSystem-Layout.mdx +64 -0
  63. package/dist/starter/src/components/ui/DesignSystem-Layout.stories.tsx +166 -0
  64. package/dist/starter/src/components/ui/DesignSystem-Typography.mdx +31 -0
  65. package/dist/starter/src/components/ui/DesignSystem-Typography.stories.tsx +79 -0
  66. package/dist/starter/src/components/ui/Dialog.stories.tsx +72 -0
  67. package/dist/starter/src/components/ui/Dialog.tsx +136 -0
  68. package/dist/starter/src/components/ui/Direction.stories.tsx +36 -0
  69. package/dist/starter/src/components/ui/Direction.tsx +18 -0
  70. package/dist/starter/src/components/ui/Drawer.stories.tsx +68 -0
  71. package/dist/starter/src/components/ui/Drawer.tsx +106 -0
  72. package/dist/starter/src/components/ui/DropdownMenu.stories.tsx +72 -0
  73. package/dist/starter/src/components/ui/DropdownMenu.tsx +219 -0
  74. package/dist/starter/src/components/ui/Empty.stories.tsx +35 -0
  75. package/dist/starter/src/components/ui/Empty.tsx +85 -0
  76. package/dist/starter/src/components/ui/Field.stories.tsx +47 -0
  77. package/dist/starter/src/components/ui/Field.tsx +226 -0
  78. package/dist/starter/src/components/ui/Form.stories.tsx +44 -0
  79. package/dist/starter/src/components/ui/Form.tsx +136 -0
  80. package/dist/starter/src/components/ui/HoverCard.stories.tsx +47 -0
  81. package/dist/starter/src/components/ui/HoverCard.tsx +36 -0
  82. package/dist/starter/src/components/ui/Input.stories.tsx +38 -0
  83. package/dist/starter/src/components/ui/Input.tsx +21 -0
  84. package/dist/starter/src/components/ui/InputGroup.stories.tsx +50 -0
  85. package/dist/starter/src/components/ui/InputGroup.tsx +147 -0
  86. package/dist/starter/src/components/ui/InputOTP.stories.tsx +40 -0
  87. package/dist/starter/src/components/ui/InputOTP.tsx +68 -0
  88. package/dist/starter/src/components/ui/Item.stories.tsx +61 -0
  89. package/dist/starter/src/components/ui/Item.tsx +158 -0
  90. package/dist/starter/src/components/ui/Kbd.stories.tsx +54 -0
  91. package/dist/starter/src/components/ui/Kbd.tsx +18 -0
  92. package/dist/starter/src/components/ui/Label.stories.tsx +85 -0
  93. package/dist/starter/src/components/ui/Label.tsx +40 -0
  94. package/dist/starter/src/components/ui/Menubar.stories.tsx +76 -0
  95. package/dist/starter/src/components/ui/Menubar.tsx +236 -0
  96. package/dist/starter/src/components/ui/NativeSelect.stories.tsx +42 -0
  97. package/dist/starter/src/components/ui/NativeSelect.tsx +44 -0
  98. package/dist/starter/src/components/ui/NavigationMenu.stories.tsx +78 -0
  99. package/dist/starter/src/components/ui/NavigationMenu.tsx +142 -0
  100. package/dist/starter/src/components/ui/Pagination.stories.tsx +75 -0
  101. package/dist/starter/src/components/ui/Pagination.tsx +100 -0
  102. package/dist/starter/src/components/ui/Popover.stories.tsx +51 -0
  103. package/dist/starter/src/components/ui/Popover.tsx +52 -0
  104. package/dist/starter/src/components/ui/Progress.stories.tsx +28 -0
  105. package/dist/starter/src/components/ui/Progress.tsx +24 -0
  106. package/dist/starter/src/components/ui/RadioGroup.stories.tsx +48 -0
  107. package/dist/starter/src/components/ui/RadioGroup.tsx +31 -0
  108. package/dist/starter/src/components/ui/Resizable.stories.tsx +69 -0
  109. package/dist/starter/src/components/ui/Resizable.tsx +47 -0
  110. package/dist/starter/src/components/ui/ScrollArea.stories.tsx +43 -0
  111. package/dist/starter/src/components/ui/ScrollArea.tsx +46 -0
  112. package/dist/starter/src/components/ui/Select.stories.tsx +57 -0
  113. package/dist/starter/src/components/ui/Select.tsx +162 -0
  114. package/dist/starter/src/components/ui/Separator.stories.tsx +40 -0
  115. package/dist/starter/src/components/ui/Separator.tsx +26 -0
  116. package/dist/starter/src/components/ui/Sheet.stories.tsx +66 -0
  117. package/dist/starter/src/components/ui/Sheet.tsx +107 -0
  118. package/dist/starter/src/components/ui/Sidebar.stories.tsx +94 -0
  119. package/dist/starter/src/components/ui/Sidebar.tsx +675 -0
  120. package/dist/starter/src/components/ui/Skeleton.stories.tsx +38 -0
  121. package/dist/starter/src/components/ui/Skeleton.tsx +7 -0
  122. package/dist/starter/src/components/ui/Slider.stories.tsx +21 -0
  123. package/dist/starter/src/components/ui/Slider.tsx +54 -0
  124. package/dist/starter/src/components/ui/Sonner.stories.tsx +44 -0
  125. package/dist/starter/src/components/ui/Sonner.tsx +34 -0
  126. package/dist/starter/src/components/ui/Spinner.stories.tsx +23 -0
  127. package/dist/starter/src/components/ui/Spinner.tsx +9 -0
  128. package/dist/starter/src/components/ui/Switch.stories.tsx +35 -0
  129. package/dist/starter/src/components/ui/Switch.tsx +33 -0
  130. package/dist/starter/src/components/ui/Table.stories.tsx +65 -0
  131. package/dist/starter/src/components/ui/Table.tsx +75 -0
  132. package/dist/starter/src/components/ui/Tabs.stories.tsx +51 -0
  133. package/dist/starter/src/components/ui/Tabs.tsx +69 -0
  134. package/dist/starter/src/components/ui/Textarea.stories.tsx +24 -0
  135. package/dist/starter/src/components/ui/Textarea.tsx +18 -0
  136. package/dist/starter/src/components/ui/Toast.stories.tsx +112 -0
  137. package/dist/starter/src/components/ui/Toast.tsx +114 -0
  138. package/dist/starter/src/components/ui/Toaster.tsx +28 -0
  139. package/dist/starter/src/components/ui/Toggle.stories.tsx +40 -0
  140. package/dist/starter/src/components/ui/Toggle.tsx +41 -0
  141. package/dist/starter/src/components/ui/ToggleGroup.stories.tsx +58 -0
  142. package/dist/starter/src/components/ui/ToggleGroup.tsx +80 -0
  143. package/dist/starter/src/components/ui/Tooltip.stories.tsx +40 -0
  144. package/dist/starter/src/components/ui/Tooltip.tsx +42 -0
  145. package/dist/starter/src/hooks/use-mobile.ts +19 -0
  146. package/dist/starter/src/hooks/use-toast.ts +186 -0
  147. package/dist/starter/src/index.css +123 -0
  148. package/dist/starter/src/lib/utils.ts +6 -0
  149. package/dist/starter/src/main.tsx +5 -0
  150. package/dist/starter/tsconfig.app.json +25 -0
  151. package/dist/starter/tsconfig.json +4 -0
  152. package/dist/starter/vite.config.ts +16 -0
  153. package/dist/tsconfig.tsbuildinfo +1 -0
  154. package/package.json +37 -0
@@ -0,0 +1,211 @@
1
+ 'use client';
2
+
3
+ import * as React from 'react';
4
+ import { CheckIcon, ChevronRightIcon, CircleIcon } from 'lucide-react';
5
+ import { ContextMenu as ContextMenuPrimitive } from 'radix-ui';
6
+
7
+ import { cn } from '@/lib/utils';
8
+
9
+ function ContextMenu({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Root>) {
10
+ return <ContextMenuPrimitive.Root data-slot="context-menu" {...props} />;
11
+ }
12
+
13
+ function ContextMenuTrigger({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>) {
14
+ return <ContextMenuPrimitive.Trigger data-slot="context-menu-trigger" {...props} />;
15
+ }
16
+
17
+ function ContextMenuGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Group>) {
18
+ return <ContextMenuPrimitive.Group data-slot="context-menu-group" {...props} />;
19
+ }
20
+
21
+ function ContextMenuPortal({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Portal>) {
22
+ return <ContextMenuPrimitive.Portal data-slot="context-menu-portal" {...props} />;
23
+ }
24
+
25
+ function ContextMenuSub({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Sub>) {
26
+ return <ContextMenuPrimitive.Sub data-slot="context-menu-sub" {...props} />;
27
+ }
28
+
29
+ function ContextMenuRadioGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>) {
30
+ return <ContextMenuPrimitive.RadioGroup data-slot="context-menu-radio-group" {...props} />;
31
+ }
32
+
33
+ function ContextMenuSubTrigger({
34
+ className,
35
+ inset,
36
+ children,
37
+ ...props
38
+ }: React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {
39
+ inset?: boolean;
40
+ }) {
41
+ return (
42
+ <ContextMenuPrimitive.SubTrigger
43
+ data-slot="context-menu-sub-trigger"
44
+ data-inset={inset}
45
+ className={cn(
46
+ "focus:bg-accent focus:text-accent-foreground data-[state=open]:bg-accent data-[state=open]:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground flex cursor-default items-center rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
47
+ className,
48
+ )}
49
+ {...props}
50
+ >
51
+ {children}
52
+ <ChevronRightIcon className="ml-auto" />
53
+ </ContextMenuPrimitive.SubTrigger>
54
+ );
55
+ }
56
+
57
+ function ContextMenuSubContent({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.SubContent>) {
58
+ return (
59
+ <ContextMenuPrimitive.SubContent
60
+ data-slot="context-menu-sub-content"
61
+ className={cn(
62
+ 'bg-popover text-popover-foreground 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 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-hidden rounded-md border p-1 shadow-lg',
63
+ className,
64
+ )}
65
+ {...props}
66
+ />
67
+ );
68
+ }
69
+
70
+ function ContextMenuContent({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Content>) {
71
+ return (
72
+ <ContextMenuPrimitive.Portal>
73
+ <ContextMenuPrimitive.Content
74
+ data-slot="context-menu-content"
75
+ className={cn(
76
+ 'bg-popover text-popover-foreground 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 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 z-50 max-h-(--radix-context-menu-content-available-height) min-w-[8rem] origin-(--radix-context-menu-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border p-1 shadow-md',
77
+ className,
78
+ )}
79
+ {...props}
80
+ />
81
+ </ContextMenuPrimitive.Portal>
82
+ );
83
+ }
84
+
85
+ function ContextMenuItem({
86
+ className,
87
+ inset,
88
+ variant = 'default',
89
+ ...props
90
+ }: React.ComponentProps<typeof ContextMenuPrimitive.Item> & {
91
+ inset?: boolean;
92
+ variant?: 'default' | 'destructive';
93
+ }) {
94
+ return (
95
+ <ContextMenuPrimitive.Item
96
+ data-slot="context-menu-item"
97
+ data-inset={inset}
98
+ data-variant={variant}
99
+ className={cn(
100
+ "focus:bg-accent focus:text-accent-foreground data-[variant=destructive]:text-destructive data-[variant=destructive]:focus:bg-destructive/10 dark:data-[variant=destructive]:focus:bg-destructive/20 data-[variant=destructive]:focus:text-destructive data-[variant=destructive]:*:[svg]:!text-destructive [&_svg:not([class*='text-'])]:text-muted-foreground relative flex cursor-default items-center gap-2 rounded-sm px-2 py-1.5 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 data-[inset]:pl-8 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
101
+ className,
102
+ )}
103
+ {...props}
104
+ />
105
+ );
106
+ }
107
+
108
+ function ContextMenuCheckboxItem({
109
+ className,
110
+ children,
111
+ checked,
112
+ ...props
113
+ }: React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem>) {
114
+ return (
115
+ <ContextMenuPrimitive.CheckboxItem
116
+ data-slot="context-menu-checkbox-item"
117
+ className={cn(
118
+ "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
119
+ className,
120
+ )}
121
+ checked={checked}
122
+ {...props}
123
+ >
124
+ <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
125
+ <ContextMenuPrimitive.ItemIndicator>
126
+ <CheckIcon className="size-4" />
127
+ </ContextMenuPrimitive.ItemIndicator>
128
+ </span>
129
+ {children}
130
+ </ContextMenuPrimitive.CheckboxItem>
131
+ );
132
+ }
133
+
134
+ function ContextMenuRadioItem({
135
+ className,
136
+ children,
137
+ ...props
138
+ }: React.ComponentProps<typeof ContextMenuPrimitive.RadioItem>) {
139
+ return (
140
+ <ContextMenuPrimitive.RadioItem
141
+ data-slot="context-menu-radio-item"
142
+ className={cn(
143
+ "focus:bg-accent focus:text-accent-foreground relative flex cursor-default items-center gap-2 rounded-sm py-1.5 pr-2 pl-8 text-sm outline-hidden select-none data-[disabled]:pointer-events-none data-[disabled]:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
144
+ className,
145
+ )}
146
+ {...props}
147
+ >
148
+ <span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
149
+ <ContextMenuPrimitive.ItemIndicator>
150
+ <CircleIcon className="size-2 fill-current" />
151
+ </ContextMenuPrimitive.ItemIndicator>
152
+ </span>
153
+ {children}
154
+ </ContextMenuPrimitive.RadioItem>
155
+ );
156
+ }
157
+
158
+ function ContextMenuLabel({
159
+ className,
160
+ inset,
161
+ ...props
162
+ }: React.ComponentProps<typeof ContextMenuPrimitive.Label> & {
163
+ inset?: boolean;
164
+ }) {
165
+ return (
166
+ <ContextMenuPrimitive.Label
167
+ data-slot="context-menu-label"
168
+ data-inset={inset}
169
+ className={cn('text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:pl-8', className)}
170
+ {...props}
171
+ />
172
+ );
173
+ }
174
+
175
+ function ContextMenuSeparator({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Separator>) {
176
+ return (
177
+ <ContextMenuPrimitive.Separator
178
+ data-slot="context-menu-separator"
179
+ className={cn('bg-border -mx-1 my-1 h-px', className)}
180
+ {...props}
181
+ />
182
+ );
183
+ }
184
+
185
+ function ContextMenuShortcut({ className, ...props }: React.ComponentProps<'span'>) {
186
+ return (
187
+ <span
188
+ data-slot="context-menu-shortcut"
189
+ className={cn('text-muted-foreground ml-auto text-xs tracking-widest', className)}
190
+ {...props}
191
+ />
192
+ );
193
+ }
194
+
195
+ export {
196
+ ContextMenu,
197
+ ContextMenuTrigger,
198
+ ContextMenuContent,
199
+ ContextMenuItem,
200
+ ContextMenuCheckboxItem,
201
+ ContextMenuRadioItem,
202
+ ContextMenuLabel,
203
+ ContextMenuSeparator,
204
+ ContextMenuShortcut,
205
+ ContextMenuGroup,
206
+ ContextMenuPortal,
207
+ ContextMenuSub,
208
+ ContextMenuSubContent,
209
+ ContextMenuSubTrigger,
210
+ ContextMenuRadioGroup,
211
+ };
@@ -0,0 +1,68 @@
1
+ import { Meta, Stories } from '@storybook/addon-docs/blocks';
2
+
3
+ <Meta title="Design System/Colors" />
4
+
5
+ # Colors
6
+
7
+ Semantic color tokens used throughout the design system. Each token is defined as a CSS custom property and mapped to a Tailwind CSS utility class via the theme configuration in `index.css`.
8
+
9
+ ## Core
10
+
11
+ | CSS Variable | Tailwind Class | Usage |
12
+ |---|---|---|
13
+ | `--primary` | `bg-primary` | Primary actions, active states |
14
+ | `--primary-foreground` | `text-primary-foreground` | Text on primary backgrounds |
15
+ | `--secondary` | `bg-secondary` | Secondary actions, less prominent UI |
16
+ | `--secondary-foreground` | `text-secondary-foreground` | Text on secondary backgrounds |
17
+ | `--accent` | `bg-accent` | Highlighted or accented areas |
18
+ | `--accent-foreground` | `text-accent-foreground` | Text on accent backgrounds |
19
+ | `--muted` | `bg-muted` | Subdued backgrounds, disabled states |
20
+ | `--muted-foreground` | `text-muted-foreground` | De-emphasized text, placeholders |
21
+ | `--destructive` | `bg-destructive` | Destructive actions, error states |
22
+ | `--destructive-foreground` | `text-destructive-foreground` | Text on destructive backgrounds |
23
+ | `--background` | `bg-background` | Page background |
24
+ | `--foreground` | `text-foreground` | Default body text |
25
+
26
+ ## Surface
27
+
28
+ | CSS Variable | Tailwind Class | Usage |
29
+ |---|---|---|
30
+ | `--card` | `bg-card` | Card backgrounds |
31
+ | `--card-foreground` | `text-card-foreground` | Text inside cards |
32
+ | `--popover` | `bg-popover` | Popover and dropdown backgrounds |
33
+ | `--popover-foreground` | `text-popover-foreground` | Text inside popovers |
34
+
35
+ ## UI
36
+
37
+ | CSS Variable | Tailwind Class | Usage |
38
+ |---|---|---|
39
+ | `--border` | `border-border` | Default border color |
40
+ | `--input` | `border-input` | Input field borders |
41
+ | `--ring` | `ring-ring` | Focus ring color |
42
+
43
+ ## Charts
44
+
45
+ | CSS Variable | Tailwind Class | Usage |
46
+ |---|---|---|
47
+ | `--chart-1` | `bg-chart-1` | Chart color 1 |
48
+ | `--chart-2` | `bg-chart-2` | Chart color 2 |
49
+ | `--chart-3` | `bg-chart-3` | Chart color 3 |
50
+ | `--chart-4` | `bg-chart-4` | Chart color 4 |
51
+ | `--chart-5` | `bg-chart-5` | Chart color 5 |
52
+
53
+ ## Sidebar
54
+
55
+ | CSS Variable | Tailwind Class | Usage |
56
+ |---|---|---|
57
+ | `--sidebar` | `bg-sidebar` | Sidebar background |
58
+ | `--sidebar-foreground` | `text-sidebar-foreground` | Sidebar text |
59
+ | `--sidebar-primary` | `bg-sidebar-primary` | Sidebar primary actions |
60
+ | `--sidebar-primary-foreground` | `text-sidebar-primary-foreground` | Text on sidebar primary |
61
+ | `--sidebar-accent` | `bg-sidebar-accent` | Sidebar accented areas |
62
+ | `--sidebar-accent-foreground` | `text-sidebar-accent-foreground` | Text on sidebar accent |
63
+ | `--sidebar-border` | `border-sidebar-border` | Sidebar border color |
64
+ | `--sidebar-ring` | `ring-sidebar-ring` | Sidebar focus ring |
65
+
66
+ ## Swatches
67
+
68
+ <Stories />
@@ -0,0 +1,116 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+
3
+ interface ColorToken {
4
+ variable: string;
5
+ utility: string;
6
+ }
7
+
8
+ interface ColorGroup {
9
+ label: string;
10
+ tokens: ColorToken[];
11
+ }
12
+
13
+ const colorGroups: ColorGroup[] = [
14
+ {
15
+ label: 'Core',
16
+ tokens: [
17
+ { variable: '--primary', utility: 'bg-primary' },
18
+ { variable: '--primary-foreground', utility: 'bg-primary-foreground' },
19
+ { variable: '--secondary', utility: 'bg-secondary' },
20
+ { variable: '--secondary-foreground', utility: 'bg-secondary-foreground' },
21
+ { variable: '--accent', utility: 'bg-accent' },
22
+ { variable: '--accent-foreground', utility: 'bg-accent-foreground' },
23
+ { variable: '--muted', utility: 'bg-muted' },
24
+ { variable: '--muted-foreground', utility: 'bg-muted-foreground' },
25
+ { variable: '--destructive', utility: 'bg-destructive' },
26
+ { variable: '--destructive-foreground', utility: 'bg-destructive-foreground' },
27
+ { variable: '--background', utility: 'bg-background' },
28
+ { variable: '--foreground', utility: 'bg-foreground' },
29
+ ],
30
+ },
31
+ {
32
+ label: 'Surface',
33
+ tokens: [
34
+ { variable: '--card', utility: 'bg-card' },
35
+ { variable: '--card-foreground', utility: 'bg-card-foreground' },
36
+ { variable: '--popover', utility: 'bg-popover' },
37
+ { variable: '--popover-foreground', utility: 'bg-popover-foreground' },
38
+ ],
39
+ },
40
+ {
41
+ label: 'UI',
42
+ tokens: [
43
+ { variable: '--border', utility: 'bg-border' },
44
+ { variable: '--input', utility: 'bg-input' },
45
+ { variable: '--ring', utility: 'bg-ring' },
46
+ ],
47
+ },
48
+ {
49
+ label: 'Charts',
50
+ tokens: [
51
+ { variable: '--chart-1', utility: 'bg-chart-1' },
52
+ { variable: '--chart-2', utility: 'bg-chart-2' },
53
+ { variable: '--chart-3', utility: 'bg-chart-3' },
54
+ { variable: '--chart-4', utility: 'bg-chart-4' },
55
+ { variable: '--chart-5', utility: 'bg-chart-5' },
56
+ ],
57
+ },
58
+ {
59
+ label: 'Sidebar',
60
+ tokens: [
61
+ { variable: '--sidebar', utility: 'bg-sidebar' },
62
+ { variable: '--sidebar-foreground', utility: 'bg-sidebar-foreground' },
63
+ { variable: '--sidebar-primary', utility: 'bg-sidebar-primary' },
64
+ {
65
+ variable: '--sidebar-primary-foreground',
66
+ utility: 'bg-sidebar-primary-foreground',
67
+ },
68
+ { variable: '--sidebar-accent', utility: 'bg-sidebar-accent' },
69
+ {
70
+ variable: '--sidebar-accent-foreground',
71
+ utility: 'bg-sidebar-accent-foreground',
72
+ },
73
+ { variable: '--sidebar-border', utility: 'bg-sidebar-border' },
74
+ { variable: '--sidebar-ring', utility: 'bg-sidebar-ring' },
75
+ ],
76
+ },
77
+ ];
78
+
79
+ function ColorSwatch({ variable, utility }: ColorToken) {
80
+ return (
81
+ <div className="flex flex-col items-center gap-1.5">
82
+ <div className="h-16 w-16 rounded-md border border-border" style={{ backgroundColor: `var(${variable})` }} />
83
+ <span className="text-xs font-mono text-foreground">{variable}</span>
84
+ <span className="text-xs font-mono text-muted-foreground">{utility}</span>
85
+ </div>
86
+ );
87
+ }
88
+
89
+ function ColorSwatches() {
90
+ return (
91
+ <div className="flex flex-col gap-10 p-6">
92
+ {colorGroups.map((group) => (
93
+ <section key={group.label}>
94
+ <h2 className="mb-4 text-lg font-semibold text-foreground">{group.label}</h2>
95
+ <div className="flex flex-wrap gap-6">
96
+ {group.tokens.map((token) => (
97
+ <ColorSwatch key={token.variable} {...token} />
98
+ ))}
99
+ </div>
100
+ </section>
101
+ ))}
102
+ </div>
103
+ );
104
+ }
105
+
106
+ const meta: Meta = {
107
+ title: 'Design System/Colors',
108
+ component: ColorSwatches,
109
+ };
110
+ export default meta;
111
+
112
+ type Story = StoryObj;
113
+
114
+ export const Default: Story = {
115
+ render: () => <ColorSwatches />,
116
+ };
@@ -0,0 +1,64 @@
1
+ import { Meta, Stories } from '@storybook/addon-docs/blocks';
2
+
3
+ <Meta title="Design System/Layout" />
4
+
5
+ # Layout
6
+
7
+ Spacing, border radius, and shadow tokens used throughout the design system.
8
+
9
+ ## Spacing
10
+
11
+ The spacing scale uses Tailwind utility classes. Apply these consistently to maintain visual rhythm.
12
+
13
+ | Purpose | Classes | When to use |
14
+ | --- | --- | --- |
15
+ | Section gaps | `space-y-16`, `py-16` | Between major page sections |
16
+ | Content gaps | `space-y-6`, `space-y-8` | Between content blocks within a section |
17
+ | Element gaps | `space-y-3`, `gap-3` | Between related elements (form fields, list items) |
18
+ | Padding | `p-4` | Compact containers (cards, popovers) |
19
+ | Padding | `p-6` | Standard containers |
20
+ | Padding | `p-8` | Spacious containers (hero sections, modals) |
21
+
22
+ ### Guidelines
23
+
24
+ - Use `space-y-*` for vertical stacking of block elements.
25
+ - Use `gap-*` with flex or grid layouts.
26
+ - Prefer consistent padding within a component; avoid mixing `p-4` and `p-8` at the same level.
27
+
28
+ ## Border Radius
29
+
30
+ Border radius values are derived from the `--radius` CSS custom property (default `0.625rem`).
31
+
32
+ | Class | CSS Variable | Value |
33
+ | --- | --- | --- |
34
+ | `rounded-sm` | `--radius-sm` | `calc(var(--radius) - 4px)` |
35
+ | `rounded-md` | `--radius-md` | `calc(var(--radius) - 2px)` |
36
+ | `rounded-lg` | `--radius-lg` | `var(--radius)` |
37
+ | `rounded-xl` | `--radius-xl` | `calc(var(--radius) + 4px)` |
38
+
39
+ ### Guidelines
40
+
41
+ - `rounded-sm` -- Small inline elements (badges, tags).
42
+ - `rounded-md` -- Inputs, buttons, and form controls.
43
+ - `rounded-lg` -- Cards, dialogs, and container surfaces.
44
+ - `rounded-xl` -- Large hero cards or featured sections.
45
+
46
+ ## Shadows
47
+
48
+ Shadows add depth and elevation. Use the Tailwind shadow utilities.
49
+
50
+ | Class | Usage |
51
+ | --- | --- |
52
+ | `shadow-sm` | Subtle lift for cards and inputs at rest |
53
+ | `shadow` | Default elevation for interactive surfaces |
54
+ | `shadow-md` | Hover states, dropdown menus |
55
+ | `shadow-lg` | Modals, popovers, floating panels |
56
+ | `shadow-xl` | Prominent overlays, feature highlights |
57
+
58
+ ### Guidelines
59
+
60
+ - Shadows should increase with elevation: resting surfaces use `shadow-sm`, overlays use `shadow-lg` or `shadow-xl`.
61
+ - Avoid applying shadows to flat, inline elements like text or badges.
62
+ - Combine shadows with border radius for polished container surfaces.
63
+
64
+ <Stories />
@@ -0,0 +1,166 @@
1
+ import type { Meta, StoryObj } from '@storybook/react-vite';
2
+
3
+ function SpacingScale() {
4
+ const spacingItems = [
5
+ { label: 'Section gaps', classes: 'space-y-16, py-16', demo: 'space-y-16 py-16' },
6
+ { label: 'Content gaps', classes: 'space-y-6, space-y-8', demo: 'space-y-6' },
7
+ { label: 'Element gaps', classes: 'space-y-3, gap-3', demo: 'gap-3' },
8
+ { label: 'Padding', classes: 'p-4, p-6, p-8', demo: '' },
9
+ ];
10
+
11
+ return (
12
+ <div className="space-y-8">
13
+ <h2 className="text-xl font-semibold">Spacing Scale</h2>
14
+
15
+ {/* Section gaps */}
16
+ <div>
17
+ <h3 className="mb-2 text-sm font-medium text-muted-foreground">
18
+ Section gaps: <code className="text-xs">space-y-16</code>, <code className="text-xs">py-16</code>
19
+ </h3>
20
+ <div className="space-y-16 rounded-lg border border-border p-4">
21
+ <div className="h-8 rounded bg-primary/20" />
22
+ <div className="h-8 rounded bg-primary/20" />
23
+ </div>
24
+ </div>
25
+
26
+ {/* Content gaps */}
27
+ <div>
28
+ <h3 className="mb-2 text-sm font-medium text-muted-foreground">
29
+ Content gaps: <code className="text-xs">space-y-6</code>, <code className="text-xs">space-y-8</code>
30
+ </h3>
31
+ <div className="flex gap-8">
32
+ <div className="flex-1">
33
+ <p className="mb-1 text-xs text-muted-foreground">space-y-6</p>
34
+ <div className="space-y-6 rounded-lg border border-border p-4">
35
+ <div className="h-6 rounded bg-primary/20" />
36
+ <div className="h-6 rounded bg-primary/20" />
37
+ <div className="h-6 rounded bg-primary/20" />
38
+ </div>
39
+ </div>
40
+ <div className="flex-1">
41
+ <p className="mb-1 text-xs text-muted-foreground">space-y-8</p>
42
+ <div className="space-y-8 rounded-lg border border-border p-4">
43
+ <div className="h-6 rounded bg-primary/20" />
44
+ <div className="h-6 rounded bg-primary/20" />
45
+ <div className="h-6 rounded bg-primary/20" />
46
+ </div>
47
+ </div>
48
+ </div>
49
+ </div>
50
+
51
+ {/* Element gaps */}
52
+ <div>
53
+ <h3 className="mb-2 text-sm font-medium text-muted-foreground">
54
+ Element gaps: <code className="text-xs">space-y-3</code>, <code className="text-xs">gap-3</code>
55
+ </h3>
56
+ <div className="flex gap-8">
57
+ <div className="flex-1">
58
+ <p className="mb-1 text-xs text-muted-foreground">space-y-3</p>
59
+ <div className="space-y-3 rounded-lg border border-border p-4">
60
+ <div className="h-4 rounded bg-primary/20" />
61
+ <div className="h-4 rounded bg-primary/20" />
62
+ <div className="h-4 rounded bg-primary/20" />
63
+ </div>
64
+ </div>
65
+ <div className="flex-1">
66
+ <p className="mb-1 text-xs text-muted-foreground">gap-3</p>
67
+ <div className="flex gap-3 rounded-lg border border-border p-4">
68
+ <div className="h-4 flex-1 rounded bg-primary/20" />
69
+ <div className="h-4 flex-1 rounded bg-primary/20" />
70
+ <div className="h-4 flex-1 rounded bg-primary/20" />
71
+ </div>
72
+ </div>
73
+ </div>
74
+ </div>
75
+
76
+ {/* Padding */}
77
+ <div>
78
+ <h3 className="mb-2 text-sm font-medium text-muted-foreground">
79
+ Padding: <code className="text-xs">p-4</code>, <code className="text-xs">p-6</code>,{' '}
80
+ <code className="text-xs">p-8</code>
81
+ </h3>
82
+ <div className="flex gap-6">
83
+ {(['p-4', 'p-6', 'p-8'] as const).map((padding) => (
84
+ <div key={padding} className="flex-1">
85
+ <p className="mb-1 text-xs text-muted-foreground">{padding}</p>
86
+ <div className={`${padding} rounded-lg border border-border`}>
87
+ <div className="h-8 rounded bg-primary/20" />
88
+ </div>
89
+ </div>
90
+ ))}
91
+ </div>
92
+ </div>
93
+ </div>
94
+ );
95
+ }
96
+
97
+ function BorderRadiusScale() {
98
+ const radii = [
99
+ { label: 'rounded-sm', variable: '--radius-sm', formula: 'calc(var(--radius) - 4px)' },
100
+ { label: 'rounded-md', variable: '--radius-md', formula: 'calc(var(--radius) - 2px)' },
101
+ { label: 'rounded-lg', variable: '--radius-lg', formula: 'var(--radius)' },
102
+ { label: 'rounded-xl', variable: '--radius-xl', formula: 'calc(var(--radius) + 4px)' },
103
+ ];
104
+
105
+ return (
106
+ <div className="space-y-8">
107
+ <h2 className="text-xl font-semibold">Border Radius</h2>
108
+ <div className="flex flex-wrap gap-6">
109
+ {radii.map(({ label, variable, formula }) => (
110
+ <div key={label} className="flex flex-col items-center gap-2">
111
+ <div className={`flex h-24 w-24 items-center justify-center border border-border bg-primary/10 ${label}`}>
112
+ <span className="text-xs text-muted-foreground">{label.replace('rounded-', '')}</span>
113
+ </div>
114
+ <code className="text-xs">{label}</code>
115
+ <span className="text-xs text-muted-foreground">{formula}</span>
116
+ </div>
117
+ ))}
118
+ </div>
119
+ </div>
120
+ );
121
+ }
122
+
123
+ function ShadowScale() {
124
+ const shadows = ['shadow-sm', 'shadow', 'shadow-md', 'shadow-lg', 'shadow-xl'] as const;
125
+
126
+ return (
127
+ <div className="space-y-8">
128
+ <h2 className="text-xl font-semibold">Shadows</h2>
129
+ <div className="flex flex-wrap gap-8">
130
+ {shadows.map((shadow) => (
131
+ <div key={shadow} className="flex flex-col items-center gap-3">
132
+ <div className={`flex h-24 w-24 items-center justify-center rounded-lg bg-background ${shadow}`}>
133
+ <span className="text-xs text-muted-foreground">
134
+ {shadow === 'shadow' ? 'default' : shadow.replace('shadow-', '')}
135
+ </span>
136
+ </div>
137
+ <code className="text-xs">{shadow}</code>
138
+ </div>
139
+ ))}
140
+ </div>
141
+ </div>
142
+ );
143
+ }
144
+
145
+ function LayoutShowcase() {
146
+ return (
147
+ <div className="space-y-16 p-8">
148
+ <SpacingScale />
149
+ <BorderRadiusScale />
150
+ <ShadowScale />
151
+ </div>
152
+ );
153
+ }
154
+
155
+ const meta: Meta = {
156
+ title: 'Design System/Layout',
157
+ parameters: {
158
+ layout: 'fullscreen',
159
+ },
160
+ };
161
+ export default meta;
162
+ type Story = StoryObj;
163
+
164
+ export const Default: Story = {
165
+ render: () => <LayoutShowcase />,
166
+ };
@@ -0,0 +1,31 @@
1
+ import { Meta, Stories } from '@storybook/addon-docs/blocks';
2
+
3
+ <Meta title="Design System/Typography" />
4
+
5
+ # Typography
6
+
7
+ Typography classes used across the design system. All styles are composed from
8
+ Tailwind CSS utility classes -- no custom font-size tokens are needed.
9
+
10
+ ## Reference
11
+
12
+ | Element | Tailwind Classes | Usage |
13
+ | --- | --- | --- |
14
+ | **H1** | `text-5xl font-extrabold tracking-tight` | Hero or display headings |
15
+ | **H2** | `text-4xl font-bold tracking-tight` | Page-level headings |
16
+ | **H3** | `text-3xl font-bold` | Section headings |
17
+ | **H4** | `text-2xl font-semibold` | Subsection headings |
18
+ | **H5** | `text-xl font-semibold` | Card or widget headings |
19
+ | **Body (lead)** | `text-base leading-relaxed` | Long-form paragraphs where extra line-height aids readability |
20
+ | **Body** | `text-base` | Default body text, UI labels |
21
+ | **Muted** | `text-sm text-muted-foreground` | Descriptions, help text, secondary information |
22
+ | **Small / Caption** | `text-xs text-muted-foreground` | Captions, timestamps, metadata |
23
+
24
+ ## Guidelines
25
+
26
+ - Prefer semantic heading order (`H1` > `H2` > `H3` ...) for accessibility.
27
+ - Use **lead body** (`leading-relaxed`) only for multi-line content blocks; single-line labels should use the plain **body** style.
28
+ - `text-muted-foreground` maps to the theme's muted colour and automatically adapts between light and dark modes.
29
+ - Avoid mixing heading classes with body classes on the same element.
30
+
31
+ <Stories />