create-auto-app 1.34.0 → 1.35.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.
- package/package.json +2 -2
- package/templates/typical/.context/components-db.json +4006 -0
- package/templates/typical/.gitignore +1 -1
- package/templates/typical/auto.config.ts +85 -80
- package/templates/typical/client/.gitignore +0 -4
- package/templates/typical/client/.storybook/main.ts +0 -66
- package/templates/typical/client/.storybook/manager-head.html +0 -154
- package/templates/typical/client/.storybook/manager.ts +0 -164
- package/templates/typical/client/.storybook/preview-head.html +0 -31
- package/templates/typical/client/.storybook/preview.tsx +0 -120
- package/templates/typical/client/codegen.ts +0 -17
- package/templates/typical/client/components.json +0 -29
- package/templates/typical/client/index.html +0 -12
- package/templates/typical/client/package.json +0 -69
- package/templates/typical/client/pnpm-lock.yaml +0 -7868
- package/templates/typical/client/public/blank.svg +0 -1
- package/templates/typical/client/public/mockServiceWorker.js +0 -336
- package/templates/typical/client/src/App.tsx +0 -29
- package/templates/typical/client/src/components/.gitkeep +0 -0
- package/templates/typical/client/src/components/ui/Accordion.stories.tsx +0 -49
- package/templates/typical/client/src/components/ui/Accordion.tsx +0 -55
- package/templates/typical/client/src/components/ui/Alert.stories.tsx +0 -29
- package/templates/typical/client/src/components/ui/Alert.tsx +0 -56
- package/templates/typical/client/src/components/ui/AlertDialog.stories.tsx +0 -67
- package/templates/typical/client/src/components/ui/AlertDialog.tsx +0 -178
- package/templates/typical/client/src/components/ui/AspectRatio.stories.tsx +0 -35
- package/templates/typical/client/src/components/ui/AspectRatio.tsx +0 -13
- package/templates/typical/client/src/components/ui/Avatar.stories.tsx +0 -45
- package/templates/typical/client/src/components/ui/Avatar.tsx +0 -98
- package/templates/typical/client/src/components/ui/Badge.stories.tsx +0 -41
- package/templates/typical/client/src/components/ui/Badge.tsx +0 -45
- package/templates/typical/client/src/components/ui/Breadcrumb.stories.tsx +0 -54
- package/templates/typical/client/src/components/ui/Breadcrumb.tsx +0 -104
- package/templates/typical/client/src/components/ui/Button.stories.tsx +0 -102
- package/templates/typical/client/src/components/ui/Button.tsx +0 -67
- package/templates/typical/client/src/components/ui/ButtonGroup.stories.tsx +0 -32
- package/templates/typical/client/src/components/ui/ButtonGroup.tsx +0 -81
- package/templates/typical/client/src/components/ui/Calendar.stories.tsx +0 -40
- package/templates/typical/client/src/components/ui/Calendar.tsx +0 -165
- package/templates/typical/client/src/components/ui/Card.stories.tsx +0 -44
- package/templates/typical/client/src/components/ui/Card.tsx +0 -66
- package/templates/typical/client/src/components/ui/Carousel.stories.tsx +0 -56
- package/templates/typical/client/src/components/ui/Carousel.tsx +0 -225
- package/templates/typical/client/src/components/ui/Chart.stories.tsx +0 -39
- package/templates/typical/client/src/components/ui/Chart.tsx +0 -305
- package/templates/typical/client/src/components/ui/Checkbox.stories.tsx +0 -35
- package/templates/typical/client/src/components/ui/Checkbox.tsx +0 -30
- package/templates/typical/client/src/components/ui/Collapsible.stories.tsx +0 -58
- package/templates/typical/client/src/components/ui/Collapsible.tsx +0 -18
- package/templates/typical/client/src/components/ui/Combobox.stories.tsx +0 -75
- package/templates/typical/client/src/components/ui/Combobox.tsx +0 -296
- package/templates/typical/client/src/components/ui/Command.stories.tsx +0 -71
- package/templates/typical/client/src/components/ui/Command.tsx +0 -157
- package/templates/typical/client/src/components/ui/ContextMenu.stories.tsx +0 -68
- package/templates/typical/client/src/components/ui/ContextMenu.tsx +0 -231
- package/templates/typical/client/src/components/ui/DesignSystem-Colors.mdx +0 -68
- package/templates/typical/client/src/components/ui/DesignSystem-Colors.stories.tsx +0 -117
- package/templates/typical/client/src/components/ui/DesignSystem-Layout.mdx +0 -64
- package/templates/typical/client/src/components/ui/DesignSystem-Layout.stories.tsx +0 -167
- package/templates/typical/client/src/components/ui/DesignSystem-Overview.stories.tsx +0 -748
- package/templates/typical/client/src/components/ui/DesignSystem-Typography.mdx +0 -31
- package/templates/typical/client/src/components/ui/DesignSystem-Typography.stories.tsx +0 -80
- package/templates/typical/client/src/components/ui/Dialog.stories.tsx +0 -74
- package/templates/typical/client/src/components/ui/Dialog.tsx +0 -154
- package/templates/typical/client/src/components/ui/Direction.stories.tsx +0 -38
- package/templates/typical/client/src/components/ui/Direction.tsx +0 -24
- package/templates/typical/client/src/components/ui/Drawer.stories.tsx +0 -70
- package/templates/typical/client/src/components/ui/Drawer.tsx +0 -124
- package/templates/typical/client/src/components/ui/DropdownMenu.stories.tsx +0 -74
- package/templates/typical/client/src/components/ui/DropdownMenu.tsx +0 -239
- package/templates/typical/client/src/components/ui/Empty.stories.tsx +0 -37
- package/templates/typical/client/src/components/ui/Empty.tsx +0 -98
- package/templates/typical/client/src/components/ui/Field.stories.tsx +0 -50
- package/templates/typical/client/src/components/ui/Field.tsx +0 -251
- package/templates/typical/client/src/components/ui/Form.stories.tsx +0 -45
- package/templates/typical/client/src/components/ui/Form.tsx +0 -148
- package/templates/typical/client/src/components/ui/HoverCard.stories.tsx +0 -49
- package/templates/typical/client/src/components/ui/HoverCard.tsx +0 -39
- package/templates/typical/client/src/components/ui/Input.stories.tsx +0 -42
- package/templates/typical/client/src/components/ui/Input.tsx +0 -22
- package/templates/typical/client/src/components/ui/InputGroup.stories.tsx +0 -53
- package/templates/typical/client/src/components/ui/InputGroup.tsx +0 -153
- package/templates/typical/client/src/components/ui/InputOTP.stories.tsx +0 -42
- package/templates/typical/client/src/components/ui/InputOTP.tsx +0 -72
- package/templates/typical/client/src/components/ui/Item.stories.tsx +0 -64
- package/templates/typical/client/src/components/ui/Item.tsx +0 -168
- package/templates/typical/client/src/components/ui/Kbd.stories.tsx +0 -59
- package/templates/typical/client/src/components/ui/Kbd.tsx +0 -22
- package/templates/typical/client/src/components/ui/Label.stories.tsx +0 -90
- package/templates/typical/client/src/components/ui/Label.tsx +0 -44
- package/templates/typical/client/src/components/ui/Menubar.stories.tsx +0 -78
- package/templates/typical/client/src/components/ui/Menubar.tsx +0 -251
- package/templates/typical/client/src/components/ui/NativeSelect.stories.tsx +0 -45
- package/templates/typical/client/src/components/ui/NativeSelect.tsx +0 -50
- package/templates/typical/client/src/components/ui/NavigationMenu.stories.tsx +0 -80
- package/templates/typical/client/src/components/ui/NavigationMenu.tsx +0 -152
- package/templates/typical/client/src/components/ui/Pagination.stories.tsx +0 -77
- package/templates/typical/client/src/components/ui/Pagination.tsx +0 -108
- package/templates/typical/client/src/components/ui/Popover.stories.tsx +0 -53
- package/templates/typical/client/src/components/ui/Popover.tsx +0 -57
- package/templates/typical/client/src/components/ui/Progress.stories.tsx +0 -32
- package/templates/typical/client/src/components/ui/Progress.tsx +0 -25
- package/templates/typical/client/src/components/ui/RadioGroup.stories.tsx +0 -50
- package/templates/typical/client/src/components/ui/RadioGroup.tsx +0 -36
- package/templates/typical/client/src/components/ui/Resizable.stories.tsx +0 -72
- package/templates/typical/client/src/components/ui/Resizable.tsx +0 -54
- package/templates/typical/client/src/components/ui/ScrollArea.stories.tsx +0 -45
- package/templates/typical/client/src/components/ui/ScrollArea.tsx +0 -51
- package/templates/typical/client/src/components/ui/Select.stories.tsx +0 -59
- package/templates/typical/client/src/components/ui/Select.tsx +0 -171
- package/templates/typical/client/src/components/ui/Separator.stories.tsx +0 -42
- package/templates/typical/client/src/components/ui/Separator.tsx +0 -27
- package/templates/typical/client/src/components/ui/Sheet.stories.tsx +0 -68
- package/templates/typical/client/src/components/ui/Sheet.tsx +0 -115
- package/templates/typical/client/src/components/ui/Sidebar.stories.tsx +0 -96
- package/templates/typical/client/src/components/ui/Sidebar.tsx +0 -695
- package/templates/typical/client/src/components/ui/Skeleton.stories.tsx +0 -40
- package/templates/typical/client/src/components/ui/Skeleton.tsx +0 -11
- package/templates/typical/client/src/components/ui/Slider.stories.tsx +0 -24
- package/templates/typical/client/src/components/ui/Slider.tsx +0 -55
- package/templates/typical/client/src/components/ui/Sonner.stories.tsx +0 -45
- package/templates/typical/client/src/components/ui/Sonner.tsx +0 -38
- package/templates/typical/client/src/components/ui/Spinner.stories.tsx +0 -26
- package/templates/typical/client/src/components/ui/Spinner.tsx +0 -13
- package/templates/typical/client/src/components/ui/Switch.stories.tsx +0 -39
- package/templates/typical/client/src/components/ui/Switch.tsx +0 -35
- package/templates/typical/client/src/components/ui/Table.stories.tsx +0 -67
- package/templates/typical/client/src/components/ui/Table.tsx +0 -86
- package/templates/typical/client/src/components/ui/Tabs.stories.tsx +0 -53
- package/templates/typical/client/src/components/ui/Tabs.tsx +0 -75
- package/templates/typical/client/src/components/ui/Textarea.stories.tsx +0 -27
- package/templates/typical/client/src/components/ui/Textarea.tsx +0 -22
- package/templates/typical/client/src/components/ui/Toast.stories.tsx +0 -116
- package/templates/typical/client/src/components/ui/Toast.tsx +0 -123
- package/templates/typical/client/src/components/ui/Toaster.tsx +0 -32
- package/templates/typical/client/src/components/ui/Toggle.stories.tsx +0 -44
- package/templates/typical/client/src/components/ui/Toggle.tsx +0 -42
- package/templates/typical/client/src/components/ui/ToggleGroup.stories.tsx +0 -61
- package/templates/typical/client/src/components/ui/ToggleGroup.tsx +0 -83
- package/templates/typical/client/src/components/ui/Tooltip.stories.tsx +0 -42
- package/templates/typical/client/src/components/ui/Tooltip.tsx +0 -48
- package/templates/typical/client/src/gql/execute.ts +0 -11
- package/templates/typical/client/src/gql/fragment-masking.ts +0 -83
- package/templates/typical/client/src/gql/gql.ts +0 -9
- package/templates/typical/client/src/gql/graphql.ts +0 -182
- package/templates/typical/client/src/gql/index.ts +0 -2
- package/templates/typical/client/src/graphql/mutations.ts +0 -0
- package/templates/typical/client/src/graphql/queries.ts +0 -0
- package/templates/typical/client/src/hooks/.gitkeep +0 -0
- package/templates/typical/client/src/hooks/use-mobile.ts +0 -19
- package/templates/typical/client/src/hooks/use-toast.ts +0 -186
- package/templates/typical/client/src/index.css +0 -121
- package/templates/typical/client/src/lib/utils.ts +0 -6
- package/templates/typical/client/src/main.tsx +0 -5
- package/templates/typical/client/tsconfig.app.json +0 -26
- package/templates/typical/client/tsconfig.json +0 -10
- package/templates/typical/client/vite.config.ts +0 -50
|
@@ -1,231 +0,0 @@
|
|
|
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
|
-
/** Right-click menu with keyboard navigation. Supports submenus, checkbox/radio items, separators, and shortcuts. */
|
|
10
|
-
function ContextMenu({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Root>) {
|
|
11
|
-
return <ContextMenuPrimitive.Root data-slot="context-menu" {...props} />;
|
|
12
|
-
}
|
|
13
|
-
|
|
14
|
-
/** The element that opens the context menu on right-click. Wraps its children. */
|
|
15
|
-
function ContextMenuTrigger({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Trigger>) {
|
|
16
|
-
return <ContextMenuPrimitive.Trigger data-slot="context-menu-trigger" {...props} />;
|
|
17
|
-
}
|
|
18
|
-
|
|
19
|
-
/** Groups related context menu items for accessibility. */
|
|
20
|
-
function ContextMenuGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Group>) {
|
|
21
|
-
return <ContextMenuPrimitive.Group data-slot="context-menu-group" {...props} />;
|
|
22
|
-
}
|
|
23
|
-
|
|
24
|
-
/** Renders context menu content into a React portal. */
|
|
25
|
-
function ContextMenuPortal({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Portal>) {
|
|
26
|
-
return <ContextMenuPrimitive.Portal data-slot="context-menu-portal" {...props} />;
|
|
27
|
-
}
|
|
28
|
-
|
|
29
|
-
/** Container for a submenu within the context menu. */
|
|
30
|
-
function ContextMenuSub({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Sub>) {
|
|
31
|
-
return <ContextMenuPrimitive.Sub data-slot="context-menu-sub" {...props} />;
|
|
32
|
-
}
|
|
33
|
-
|
|
34
|
-
/** Groups radio items for single-selection within the context menu. */
|
|
35
|
-
function ContextMenuRadioGroup({ ...props }: React.ComponentProps<typeof ContextMenuPrimitive.RadioGroup>) {
|
|
36
|
-
return <ContextMenuPrimitive.RadioGroup data-slot="context-menu-radio-group" {...props} />;
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/** Menu item that opens a nested submenu on hover or keyboard navigation. Shows a chevron indicator. */
|
|
40
|
-
function ContextMenuSubTrigger({
|
|
41
|
-
className,
|
|
42
|
-
inset,
|
|
43
|
-
children,
|
|
44
|
-
...props
|
|
45
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.SubTrigger> & {
|
|
46
|
-
inset?: boolean;
|
|
47
|
-
}) {
|
|
48
|
-
return (
|
|
49
|
-
<ContextMenuPrimitive.SubTrigger
|
|
50
|
-
data-slot="context-menu-sub-trigger"
|
|
51
|
-
data-inset={inset}
|
|
52
|
-
className={cn(
|
|
53
|
-
"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",
|
|
54
|
-
className,
|
|
55
|
-
)}
|
|
56
|
-
{...props}
|
|
57
|
-
>
|
|
58
|
-
{children}
|
|
59
|
-
<ChevronRightIcon className="ml-auto" />
|
|
60
|
-
</ContextMenuPrimitive.SubTrigger>
|
|
61
|
-
);
|
|
62
|
-
}
|
|
63
|
-
|
|
64
|
-
/** Popup content for a nested submenu. */
|
|
65
|
-
function ContextMenuSubContent({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.SubContent>) {
|
|
66
|
-
return (
|
|
67
|
-
<ContextMenuPrimitive.SubContent
|
|
68
|
-
data-slot="context-menu-sub-content"
|
|
69
|
-
className={cn(
|
|
70
|
-
'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',
|
|
71
|
-
className,
|
|
72
|
-
)}
|
|
73
|
-
{...props}
|
|
74
|
-
/>
|
|
75
|
-
);
|
|
76
|
-
}
|
|
77
|
-
|
|
78
|
-
/** The positioned popup container for context menu items. Portals to the document body. */
|
|
79
|
-
function ContextMenuContent({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Content>) {
|
|
80
|
-
return (
|
|
81
|
-
<ContextMenuPrimitive.Portal>
|
|
82
|
-
<ContextMenuPrimitive.Content
|
|
83
|
-
data-slot="context-menu-content"
|
|
84
|
-
className={cn(
|
|
85
|
-
'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',
|
|
86
|
-
className,
|
|
87
|
-
)}
|
|
88
|
-
{...props}
|
|
89
|
-
/>
|
|
90
|
-
</ContextMenuPrimitive.Portal>
|
|
91
|
-
);
|
|
92
|
-
}
|
|
93
|
-
|
|
94
|
-
/**
|
|
95
|
-
* A selectable action within the context menu.
|
|
96
|
-
* Use variant="destructive" for dangerous actions like delete.
|
|
97
|
-
*/
|
|
98
|
-
function ContextMenuItem({
|
|
99
|
-
className,
|
|
100
|
-
/** Adds left padding to align with items that have icons or indicators. */
|
|
101
|
-
inset,
|
|
102
|
-
/** Use "destructive" for dangerous actions. */
|
|
103
|
-
variant = 'default',
|
|
104
|
-
...props
|
|
105
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Item> & {
|
|
106
|
-
inset?: boolean;
|
|
107
|
-
variant?: 'default' | 'destructive';
|
|
108
|
-
}) {
|
|
109
|
-
return (
|
|
110
|
-
<ContextMenuPrimitive.Item
|
|
111
|
-
data-slot="context-menu-item"
|
|
112
|
-
data-inset={inset}
|
|
113
|
-
data-variant={variant}
|
|
114
|
-
className={cn(
|
|
115
|
-
"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",
|
|
116
|
-
className,
|
|
117
|
-
)}
|
|
118
|
-
{...props}
|
|
119
|
-
/>
|
|
120
|
-
);
|
|
121
|
-
}
|
|
122
|
-
|
|
123
|
-
/** A toggleable checkbox item within the context menu. Shows a check indicator when active. */
|
|
124
|
-
function ContextMenuCheckboxItem({
|
|
125
|
-
className,
|
|
126
|
-
children,
|
|
127
|
-
checked,
|
|
128
|
-
...props
|
|
129
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.CheckboxItem>) {
|
|
130
|
-
return (
|
|
131
|
-
<ContextMenuPrimitive.CheckboxItem
|
|
132
|
-
data-slot="context-menu-checkbox-item"
|
|
133
|
-
className={cn(
|
|
134
|
-
"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",
|
|
135
|
-
className,
|
|
136
|
-
)}
|
|
137
|
-
checked={checked}
|
|
138
|
-
{...props}
|
|
139
|
-
>
|
|
140
|
-
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
141
|
-
<ContextMenuPrimitive.ItemIndicator>
|
|
142
|
-
<CheckIcon className="size-4" />
|
|
143
|
-
</ContextMenuPrimitive.ItemIndicator>
|
|
144
|
-
</span>
|
|
145
|
-
{children}
|
|
146
|
-
</ContextMenuPrimitive.CheckboxItem>
|
|
147
|
-
);
|
|
148
|
-
}
|
|
149
|
-
|
|
150
|
-
/** A radio-selectable item within a ContextMenuRadioGroup. Shows a dot indicator when selected. */
|
|
151
|
-
function ContextMenuRadioItem({
|
|
152
|
-
className,
|
|
153
|
-
children,
|
|
154
|
-
...props
|
|
155
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.RadioItem>) {
|
|
156
|
-
return (
|
|
157
|
-
<ContextMenuPrimitive.RadioItem
|
|
158
|
-
data-slot="context-menu-radio-item"
|
|
159
|
-
className={cn(
|
|
160
|
-
"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",
|
|
161
|
-
className,
|
|
162
|
-
)}
|
|
163
|
-
{...props}
|
|
164
|
-
>
|
|
165
|
-
<span className="pointer-events-none absolute left-2 flex size-3.5 items-center justify-center">
|
|
166
|
-
<ContextMenuPrimitive.ItemIndicator>
|
|
167
|
-
<CircleIcon className="size-2 fill-current" />
|
|
168
|
-
</ContextMenuPrimitive.ItemIndicator>
|
|
169
|
-
</span>
|
|
170
|
-
{children}
|
|
171
|
-
</ContextMenuPrimitive.RadioItem>
|
|
172
|
-
);
|
|
173
|
-
}
|
|
174
|
-
|
|
175
|
-
/** Non-interactive label within a context menu, used for section headings. */
|
|
176
|
-
function ContextMenuLabel({
|
|
177
|
-
className,
|
|
178
|
-
inset,
|
|
179
|
-
...props
|
|
180
|
-
}: React.ComponentProps<typeof ContextMenuPrimitive.Label> & {
|
|
181
|
-
inset?: boolean;
|
|
182
|
-
}) {
|
|
183
|
-
return (
|
|
184
|
-
<ContextMenuPrimitive.Label
|
|
185
|
-
data-slot="context-menu-label"
|
|
186
|
-
data-inset={inset}
|
|
187
|
-
className={cn('text-foreground px-2 py-1.5 text-sm font-medium data-[inset]:pl-8', className)}
|
|
188
|
-
{...props}
|
|
189
|
-
/>
|
|
190
|
-
);
|
|
191
|
-
}
|
|
192
|
-
|
|
193
|
-
/** Visual divider between groups of context menu items. */
|
|
194
|
-
function ContextMenuSeparator({ className, ...props }: React.ComponentProps<typeof ContextMenuPrimitive.Separator>) {
|
|
195
|
-
return (
|
|
196
|
-
<ContextMenuPrimitive.Separator
|
|
197
|
-
data-slot="context-menu-separator"
|
|
198
|
-
className={cn('bg-border -mx-1 my-1 h-px', className)}
|
|
199
|
-
{...props}
|
|
200
|
-
/>
|
|
201
|
-
);
|
|
202
|
-
}
|
|
203
|
-
|
|
204
|
-
/** Displays a keyboard shortcut hint aligned to the right side of a context menu item. */
|
|
205
|
-
function ContextMenuShortcut({ className, ...props }: React.ComponentProps<'span'>) {
|
|
206
|
-
return (
|
|
207
|
-
<span
|
|
208
|
-
data-slot="context-menu-shortcut"
|
|
209
|
-
className={cn('text-muted-foreground ml-auto text-xs tracking-widest', className)}
|
|
210
|
-
{...props}
|
|
211
|
-
/>
|
|
212
|
-
);
|
|
213
|
-
}
|
|
214
|
-
|
|
215
|
-
export {
|
|
216
|
-
ContextMenu,
|
|
217
|
-
ContextMenuTrigger,
|
|
218
|
-
ContextMenuContent,
|
|
219
|
-
ContextMenuItem,
|
|
220
|
-
ContextMenuCheckboxItem,
|
|
221
|
-
ContextMenuRadioItem,
|
|
222
|
-
ContextMenuLabel,
|
|
223
|
-
ContextMenuSeparator,
|
|
224
|
-
ContextMenuShortcut,
|
|
225
|
-
ContextMenuGroup,
|
|
226
|
-
ContextMenuPortal,
|
|
227
|
-
ContextMenuSub,
|
|
228
|
-
ContextMenuSubContent,
|
|
229
|
-
ContextMenuSubTrigger,
|
|
230
|
-
ContextMenuRadioGroup,
|
|
231
|
-
};
|
|
@@ -1,68 +0,0 @@
|
|
|
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 />
|
|
@@ -1,117 +0,0 @@
|
|
|
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
|
-
tags: ['!autodocs', '!manifest'],
|
|
110
|
-
};
|
|
111
|
-
export default meta;
|
|
112
|
-
|
|
113
|
-
type Story = StoryObj;
|
|
114
|
-
|
|
115
|
-
export const Default: Story = {
|
|
116
|
-
render: () => <ColorSwatches />,
|
|
117
|
-
};
|
|
@@ -1,64 +0,0 @@
|
|
|
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 />
|
|
@@ -1,167 +0,0 @@
|
|
|
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
|
-
tags: ['!autodocs', '!manifest'],
|
|
158
|
-
parameters: {
|
|
159
|
-
layout: 'fullscreen',
|
|
160
|
-
},
|
|
161
|
-
};
|
|
162
|
-
export default meta;
|
|
163
|
-
type Story = StoryObj;
|
|
164
|
-
|
|
165
|
-
export const Default: Story = {
|
|
166
|
-
render: () => <LayoutShowcase />,
|
|
167
|
-
};
|