@auto-engineer/generate-react-client 1.64.0 → 1.65.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/CHANGELOG.md +21 -0
- package/dist/starter/.storybook/main.ts +17 -22
- package/dist/starter/.storybook/manager-head.html +31 -31
- package/dist/starter/.storybook/manager.ts +133 -133
- package/dist/starter/.storybook/preview-head.html +12 -12
- package/dist/starter/.storybook/preview.tsx +79 -79
- package/dist/starter/biome.json +126 -0
- package/dist/starter/codegen.ts +11 -11
- package/dist/starter/components.json +27 -27
- package/dist/starter/package.json +86 -80
- package/dist/starter/public/mockServiceWorker.js +261 -261
- package/dist/starter/scripts/build-component-db.ts +17 -20
- package/dist/starter/src/App.tsx +15 -17
- package/dist/starter/src/components/ui/Accordion.stories.tsx +35 -35
- package/dist/starter/src/components/ui/Accordion.tsx +33 -33
- package/dist/starter/src/components/ui/Alert.stories.tsx +15 -15
- package/dist/starter/src/components/ui/Alert.tsx +32 -32
- package/dist/starter/src/components/ui/AlertDialog.stories.tsx +50 -50
- package/dist/starter/src/components/ui/AlertDialog.tsx +114 -115
- package/dist/starter/src/components/ui/AspectRatio.stories.tsx +20 -20
- package/dist/starter/src/components/ui/AspectRatio.tsx +1 -1
- package/dist/starter/src/components/ui/Avatar.stories.tsx +27 -27
- package/dist/starter/src/components/ui/Avatar.tsx +63 -63
- package/dist/starter/src/components/ui/Badge.stories.tsx +14 -14
- package/dist/starter/src/components/ui/Badge.tsx +27 -27
- package/dist/starter/src/components/ui/Breadcrumb.stories.tsx +38 -38
- package/dist/starter/src/components/ui/Breadcrumb.tsx +63 -62
- package/dist/starter/src/components/ui/Button.stories.tsx +55 -55
- package/dist/starter/src/components/ui/Button.tsx +49 -49
- package/dist/starter/src/components/ui/ButtonGroup.stories.tsx +17 -17
- package/dist/starter/src/components/ui/ButtonGroup.tsx +52 -53
- package/dist/starter/src/components/ui/Calendar.stories.tsx +20 -19
- package/dist/starter/src/components/ui/Calendar.tsx +142 -143
- package/dist/starter/src/components/ui/Card.stories.tsx +29 -29
- package/dist/starter/src/components/ui/Card.tsx +31 -31
- package/dist/starter/src/components/ui/Carousel.stories.tsx +41 -41
- package/dist/starter/src/components/ui/Carousel.tsx +171 -172
- package/dist/starter/src/components/ui/Chart.stories.tsx +21 -21
- package/dist/starter/src/components/ui/Chart.tsx +244 -247
- package/dist/starter/src/components/ui/Checkbox.stories.tsx +11 -11
- package/dist/starter/src/components/ui/Checkbox.tsx +18 -18
- package/dist/starter/src/components/ui/Collapsible.stories.tsx +40 -40
- package/dist/starter/src/components/ui/Collapsible.tsx +3 -3
- package/dist/starter/src/components/ui/Combobox.stories.tsx +48 -48
- package/dist/starter/src/components/ui/Combobox.tsx +204 -205
- package/dist/starter/src/components/ui/Command.stories.tsx +55 -55
- package/dist/starter/src/components/ui/Command.tsx +102 -103
- package/dist/starter/src/components/ui/ContextMenu.stories.tsx +52 -52
- package/dist/starter/src/components/ui/ContextMenu.tsx +151 -151
- package/dist/starter/src/components/ui/DesignSystem-Colors.stories.tsx +92 -92
- package/dist/starter/src/components/ui/DesignSystem-Layout.stories.tsx +139 -139
- package/dist/starter/src/components/ui/DesignSystem-Overview.stories.tsx +676 -657
- package/dist/starter/src/components/ui/DesignSystem-Typography.stories.tsx +59 -59
- package/dist/starter/src/components/ui/Dialog.stories.tsx +56 -56
- package/dist/starter/src/components/ui/Dialog.tsx +97 -98
- package/dist/starter/src/components/ui/Direction.stories.tsx +20 -20
- package/dist/starter/src/components/ui/Direction.tsx +7 -7
- package/dist/starter/src/components/ui/Drawer.stories.tsx +54 -54
- package/dist/starter/src/components/ui/Drawer.tsx +70 -70
- package/dist/starter/src/components/ui/DropdownMenu.stories.tsx +58 -58
- package/dist/starter/src/components/ui/DropdownMenu.tsx +157 -157
- package/dist/starter/src/components/ui/Empty.stories.tsx +22 -22
- package/dist/starter/src/components/ui/Empty.tsx +58 -58
- package/dist/starter/src/components/ui/Field.stories.tsx +31 -31
- package/dist/starter/src/components/ui/Field.tsx +180 -181
- package/dist/starter/src/components/ui/Form.stories.tsx +29 -29
- package/dist/starter/src/components/ui/Form.tsx +93 -96
- package/dist/starter/src/components/ui/HoverCard.stories.tsx +34 -34
- package/dist/starter/src/components/ui/HoverCard.tsx +21 -21
- package/dist/starter/src/components/ui/Input.stories.tsx +18 -18
- package/dist/starter/src/components/ui/Input.tsx +14 -14
- package/dist/starter/src/components/ui/InputGroup.stories.tsx +34 -34
- package/dist/starter/src/components/ui/InputGroup.tsx +110 -111
- package/dist/starter/src/components/ui/InputOTP.stories.tsx +28 -28
- package/dist/starter/src/components/ui/InputOTP.tsx +43 -43
- package/dist/starter/src/components/ui/Item.stories.tsx +45 -45
- package/dist/starter/src/components/ui/Item.tsx +113 -114
- package/dist/starter/src/components/ui/Kbd.stories.tsx +31 -31
- package/dist/starter/src/components/ui/Kbd.tsx +11 -11
- package/dist/starter/src/components/ui/Label.stories.tsx +62 -62
- package/dist/starter/src/components/ui/Label.tsx +26 -25
- package/dist/starter/src/components/ui/Menubar.stories.tsx +62 -62
- package/dist/starter/src/components/ui/Menubar.tsx +173 -173
- package/dist/starter/src/components/ui/NativeSelect.stories.tsx +26 -26
- package/dist/starter/src/components/ui/NativeSelect.tsx +29 -29
- package/dist/starter/src/components/ui/NavigationMenu.stories.tsx +64 -64
- package/dist/starter/src/components/ui/NavigationMenu.tsx +103 -103
- package/dist/starter/src/components/ui/Pagination.stories.tsx +61 -61
- package/dist/starter/src/components/ui/Pagination.tsx +69 -71
- package/dist/starter/src/components/ui/Popover.stories.tsx +38 -38
- package/dist/starter/src/components/ui/Popover.tsx +25 -25
- package/dist/starter/src/components/ui/Progress.stories.tsx +9 -9
- package/dist/starter/src/components/ui/Progress.tsx +14 -14
- package/dist/starter/src/components/ui/RadioGroup.stories.tsx +35 -35
- package/dist/starter/src/components/ui/RadioGroup.tsx +19 -19
- package/dist/starter/src/components/ui/Resizable.stories.tsx +54 -54
- package/dist/starter/src/components/ui/Resizable.tsx +29 -29
- package/dist/starter/src/components/ui/ScrollArea.stories.tsx +27 -27
- package/dist/starter/src/components/ui/ScrollArea.tsx +34 -34
- package/dist/starter/src/components/ui/Select.stories.tsx +43 -43
- package/dist/starter/src/components/ui/Select.tsx +120 -120
- package/dist/starter/src/components/ui/Separator.stories.tsx +27 -27
- package/dist/starter/src/components/ui/Separator.tsx +17 -17
- package/dist/starter/src/components/ui/Sheet.stories.tsx +53 -53
- package/dist/starter/src/components/ui/Sheet.tsx +69 -69
- package/dist/starter/src/components/ui/Sidebar.stories.tsx +77 -77
- package/dist/starter/src/components/ui/Sidebar.tsx +563 -564
- package/dist/starter/src/components/ui/Skeleton.stories.tsx +25 -25
- package/dist/starter/src/components/ui/Skeleton.tsx +1 -1
- package/dist/starter/src/components/ui/Slider.stories.tsx +5 -5
- package/dist/starter/src/components/ui/Slider.tsx +45 -44
- package/dist/starter/src/components/ui/Sonner.stories.tsx +32 -32
- package/dist/starter/src/components/ui/Sonner.tsx +23 -23
- package/dist/starter/src/components/ui/Spinner.stories.tsx +8 -8
- package/dist/starter/src/components/ui/Spinner.tsx +1 -1
- package/dist/starter/src/components/ui/Switch.stories.tsx +16 -17
- package/dist/starter/src/components/ui/Switch.tsx +24 -24
- package/dist/starter/src/components/ui/Table.stories.tsx +50 -50
- package/dist/starter/src/components/ui/Table.tsx +45 -45
- package/dist/starter/src/components/ui/Tabs.stories.tsx +39 -39
- package/dist/starter/src/components/ui/Tabs.tsx +47 -47
- package/dist/starter/src/components/ui/Textarea.stories.tsx +9 -9
- package/dist/starter/src/components/ui/Textarea.tsx +11 -11
- package/dist/starter/src/components/ui/Toast.stories.tsx +77 -77
- package/dist/starter/src/components/ui/Toast.tsx +75 -75
- package/dist/starter/src/components/ui/Toaster.tsx +17 -19
- package/dist/starter/src/components/ui/Toggle.stories.tsx +20 -20
- package/dist/starter/src/components/ui/Toggle.tsx +26 -26
- package/dist/starter/src/components/ui/ToggleGroup.stories.tsx +41 -41
- package/dist/starter/src/components/ui/ToggleGroup.tsx +61 -62
- package/dist/starter/src/components/ui/Tooltip.stories.tsx +26 -26
- package/dist/starter/src/components/ui/Tooltip.tsx +24 -24
- package/dist/starter/src/gql/execute.ts +1 -1
- package/dist/starter/src/gql/fragment-masking.ts +1 -1
- package/dist/starter/src/gql/graphql.ts +3 -0
- package/dist/starter/src/hooks/use-mobile.ts +11 -11
- package/dist/starter/src/hooks/use-toast.ts +135 -135
- package/dist/starter/src/index.css +105 -105
- package/dist/starter/src/lib/utils.ts +1 -1
- package/dist/starter/src/main.tsx +4 -1
- package/dist/starter/tsconfig.app.json +24 -24
- package/dist/starter/tsconfig.json +8 -8
- package/dist/starter/vite.config.ts +38 -37
- package/package.json +3 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import * as React from 'react';
|
|
4
3
|
import { CheckIcon, ChevronDownIcon, ChevronUpIcon } from 'lucide-react';
|
|
5
4
|
import { Select as SelectPrimitive } from 'radix-ui';
|
|
5
|
+
import type * as React from 'react';
|
|
6
6
|
|
|
7
7
|
import { cn } from '@/lib/utils';
|
|
8
8
|
|
|
@@ -11,161 +11,161 @@ import { cn } from '@/lib/utils';
|
|
|
11
11
|
* Compose with SelectTrigger, SelectValue, SelectContent, and SelectItem for a fully accessible select experience.
|
|
12
12
|
*/
|
|
13
13
|
function Select({ ...props }: React.ComponentProps<typeof SelectPrimitive.Root>) {
|
|
14
|
-
|
|
14
|
+
return <SelectPrimitive.Root data-slot="select" {...props} />;
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
function SelectGroup({ ...props }: React.ComponentProps<typeof SelectPrimitive.Group>) {
|
|
18
|
-
|
|
18
|
+
return <SelectPrimitive.Group data-slot="select-group" {...props} />;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
21
|
function SelectValue({ ...props }: React.ComponentProps<typeof SelectPrimitive.Value>) {
|
|
22
|
-
|
|
22
|
+
return <SelectPrimitive.Value data-slot="select-value" {...props} />;
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
/** The button that opens the select dropdown, displaying the currently selected value. */
|
|
26
26
|
function SelectTrigger({
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
27
|
+
className,
|
|
28
|
+
/** Controls the height: "default" (36px) or "sm" (32px). */
|
|
29
|
+
size = 'default',
|
|
30
|
+
children,
|
|
31
|
+
...props
|
|
32
32
|
}: React.ComponentProps<typeof SelectPrimitive.Trigger> & {
|
|
33
|
-
|
|
33
|
+
size?: 'sm' | 'default';
|
|
34
34
|
}) {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
35
|
+
return (
|
|
36
|
+
<SelectPrimitive.Trigger
|
|
37
|
+
data-slot="select-trigger"
|
|
38
|
+
data-size={size}
|
|
39
|
+
className={cn(
|
|
40
|
+
"border-input data-[placeholder]:text-muted-foreground [&_svg:not([class*='text-'])]:text-muted-foreground focus-visible:border-ring focus-visible:ring-ring/50 aria-invalid:ring-destructive/20 dark:aria-invalid:ring-destructive/40 aria-invalid:border-destructive dark:bg-input/30 dark:hover:bg-input/50 flex w-fit items-center justify-between gap-2 rounded-md border bg-transparent px-3 py-2 text-sm whitespace-nowrap shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 data-[size=default]:h-9 data-[size=sm]:h-8 *:data-[slot=select-value]:line-clamp-1 *:data-[slot=select-value]:flex *:data-[slot=select-value]:items-center *:data-[slot=select-value]:gap-2 [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
41
|
+
className,
|
|
42
|
+
)}
|
|
43
|
+
{...props}
|
|
44
|
+
>
|
|
45
|
+
{children}
|
|
46
|
+
<SelectPrimitive.Icon asChild>
|
|
47
|
+
<ChevronDownIcon className="size-4 opacity-50" />
|
|
48
|
+
</SelectPrimitive.Icon>
|
|
49
|
+
</SelectPrimitive.Trigger>
|
|
50
|
+
);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
/** The dropdown panel containing the list of select options, rendered via a portal. */
|
|
54
54
|
function SelectContent({
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
55
|
+
className,
|
|
56
|
+
children,
|
|
57
|
+
position = 'item-aligned',
|
|
58
|
+
align = 'center',
|
|
59
|
+
...props
|
|
60
60
|
}: React.ComponentProps<typeof SelectPrimitive.Content>) {
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
61
|
+
return (
|
|
62
|
+
<SelectPrimitive.Portal>
|
|
63
|
+
<SelectPrimitive.Content
|
|
64
|
+
data-slot="select-content"
|
|
65
|
+
className={cn(
|
|
66
|
+
'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 relative z-50 max-h-(--radix-select-content-available-height) min-w-[8rem] origin-(--radix-select-content-transform-origin) overflow-x-hidden overflow-y-auto rounded-md border shadow-md',
|
|
67
|
+
position === 'popper' &&
|
|
68
|
+
'data-[side=bottom]:translate-y-1 data-[side=left]:-translate-x-1 data-[side=right]:translate-x-1 data-[side=top]:-translate-y-1',
|
|
69
|
+
className,
|
|
70
|
+
)}
|
|
71
|
+
position={position}
|
|
72
|
+
align={align}
|
|
73
|
+
{...props}
|
|
74
|
+
>
|
|
75
|
+
<SelectScrollUpButton />
|
|
76
|
+
<SelectPrimitive.Viewport
|
|
77
|
+
className={cn(
|
|
78
|
+
'p-1',
|
|
79
|
+
position === 'popper' &&
|
|
80
|
+
'h-[var(--radix-select-trigger-height)] w-full min-w-[var(--radix-select-trigger-width)] scroll-my-1',
|
|
81
|
+
)}
|
|
82
|
+
>
|
|
83
|
+
{children}
|
|
84
|
+
</SelectPrimitive.Viewport>
|
|
85
|
+
<SelectScrollDownButton />
|
|
86
|
+
</SelectPrimitive.Content>
|
|
87
|
+
</SelectPrimitive.Portal>
|
|
88
|
+
);
|
|
89
89
|
}
|
|
90
90
|
|
|
91
91
|
/** A non-interactive label used to title a group of select options within SelectGroup. */
|
|
92
92
|
function SelectLabel({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Label>) {
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
93
|
+
return (
|
|
94
|
+
<SelectPrimitive.Label
|
|
95
|
+
data-slot="select-label"
|
|
96
|
+
className={cn('text-muted-foreground px-2 py-1.5 text-xs', className)}
|
|
97
|
+
{...props}
|
|
98
|
+
/>
|
|
99
|
+
);
|
|
100
100
|
}
|
|
101
101
|
|
|
102
102
|
/** A selectable option within the dropdown that shows a checkmark when selected. */
|
|
103
103
|
function SelectItem({ className, children, ...props }: React.ComponentProps<typeof SelectPrimitive.Item>) {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
104
|
+
return (
|
|
105
|
+
<SelectPrimitive.Item
|
|
106
|
+
data-slot="select-item"
|
|
107
|
+
className={cn(
|
|
108
|
+
"focus:bg-accent focus:text-accent-foreground [&_svg:not([class*='text-'])]:text-muted-foreground relative flex w-full cursor-default items-center gap-2 rounded-sm py-1.5 pr-8 pl-2 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 *:[span]:last:flex *:[span]:last:items-center *:[span]:last:gap-2",
|
|
109
|
+
className,
|
|
110
|
+
)}
|
|
111
|
+
{...props}
|
|
112
|
+
>
|
|
113
|
+
<span data-slot="select-item-indicator" className="absolute right-2 flex size-3.5 items-center justify-center">
|
|
114
|
+
<SelectPrimitive.ItemIndicator>
|
|
115
|
+
<CheckIcon className="size-4" />
|
|
116
|
+
</SelectPrimitive.ItemIndicator>
|
|
117
|
+
</span>
|
|
118
|
+
<SelectPrimitive.ItemText>{children}</SelectPrimitive.ItemText>
|
|
119
|
+
</SelectPrimitive.Item>
|
|
120
|
+
);
|
|
121
121
|
}
|
|
122
122
|
|
|
123
123
|
function SelectSeparator({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.Separator>) {
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
124
|
+
return (
|
|
125
|
+
<SelectPrimitive.Separator
|
|
126
|
+
data-slot="select-separator"
|
|
127
|
+
className={cn('bg-border pointer-events-none -mx-1 my-1 h-px', className)}
|
|
128
|
+
{...props}
|
|
129
|
+
/>
|
|
130
|
+
);
|
|
131
131
|
}
|
|
132
132
|
|
|
133
133
|
function SelectScrollUpButton({ className, ...props }: React.ComponentProps<typeof SelectPrimitive.ScrollUpButton>) {
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
134
|
+
return (
|
|
135
|
+
<SelectPrimitive.ScrollUpButton
|
|
136
|
+
data-slot="select-scroll-up-button"
|
|
137
|
+
className={cn('flex cursor-default items-center justify-center py-1', className)}
|
|
138
|
+
{...props}
|
|
139
|
+
>
|
|
140
|
+
<ChevronUpIcon className="size-4" />
|
|
141
|
+
</SelectPrimitive.ScrollUpButton>
|
|
142
|
+
);
|
|
143
143
|
}
|
|
144
144
|
|
|
145
145
|
function SelectScrollDownButton({
|
|
146
|
-
|
|
147
|
-
|
|
146
|
+
className,
|
|
147
|
+
...props
|
|
148
148
|
}: React.ComponentProps<typeof SelectPrimitive.ScrollDownButton>) {
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
149
|
+
return (
|
|
150
|
+
<SelectPrimitive.ScrollDownButton
|
|
151
|
+
data-slot="select-scroll-down-button"
|
|
152
|
+
className={cn('flex cursor-default items-center justify-center py-1', className)}
|
|
153
|
+
{...props}
|
|
154
|
+
>
|
|
155
|
+
<ChevronDownIcon className="size-4" />
|
|
156
|
+
</SelectPrimitive.ScrollDownButton>
|
|
157
|
+
);
|
|
158
158
|
}
|
|
159
159
|
|
|
160
160
|
export {
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
161
|
+
Select,
|
|
162
|
+
SelectContent,
|
|
163
|
+
SelectGroup,
|
|
164
|
+
SelectItem,
|
|
165
|
+
SelectLabel,
|
|
166
|
+
SelectScrollDownButton,
|
|
167
|
+
SelectScrollUpButton,
|
|
168
|
+
SelectSeparator,
|
|
169
|
+
SelectTrigger,
|
|
170
|
+
SelectValue,
|
|
171
171
|
};
|
|
@@ -2,41 +2,41 @@ import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
|
2
2
|
import { Separator } from '@/components/ui/Separator';
|
|
3
3
|
|
|
4
4
|
const meta: Meta<typeof Separator> = {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
title: 'UI Components/Separator',
|
|
6
|
+
component: Separator,
|
|
7
7
|
};
|
|
8
8
|
export default meta;
|
|
9
9
|
type Story = StoryObj<typeof Separator>;
|
|
10
10
|
|
|
11
11
|
/** Shows both horizontal and vertical separators dividing content sections. */
|
|
12
12
|
export const Default: Story = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
13
|
+
render: () => (
|
|
14
|
+
<div>
|
|
15
|
+
<div className="space-y-1">
|
|
16
|
+
<h4 className="text-sm font-medium leading-none">Radix Primitives</h4>
|
|
17
|
+
<p className="text-muted-foreground text-sm">An open-source UI component library.</p>
|
|
18
|
+
</div>
|
|
19
|
+
<Separator className="my-4" />
|
|
20
|
+
<div className="flex h-5 items-center space-x-4 text-sm">
|
|
21
|
+
<div>Blog</div>
|
|
22
|
+
<Separator orientation="vertical" />
|
|
23
|
+
<div>Docs</div>
|
|
24
|
+
<Separator orientation="vertical" />
|
|
25
|
+
<div>Source</div>
|
|
26
|
+
</div>
|
|
27
|
+
</div>
|
|
28
|
+
),
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
/** Shows vertical separators between inline text items. */
|
|
32
32
|
export const Vertical: Story = {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
33
|
+
render: () => (
|
|
34
|
+
<div className="flex h-12 items-center space-x-4 text-sm">
|
|
35
|
+
<div>First</div>
|
|
36
|
+
<Separator orientation="vertical" />
|
|
37
|
+
<div>Second</div>
|
|
38
|
+
<Separator orientation="vertical" />
|
|
39
|
+
<div>Third</div>
|
|
40
|
+
</div>
|
|
41
|
+
),
|
|
42
42
|
};
|
|
@@ -1,27 +1,27 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import { Separator as SeparatorPrimitive } from 'radix-ui';
|
|
2
|
+
import type * as React from 'react';
|
|
3
3
|
|
|
4
4
|
import { cn } from '@/lib/utils';
|
|
5
5
|
|
|
6
6
|
/** A visual divider between content sections. Renders as horizontal or vertical line. Decorative by default (hidden from screen readers). */
|
|
7
7
|
function Separator({
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
8
|
+
className,
|
|
9
|
+
orientation = 'horizontal',
|
|
10
|
+
decorative = true,
|
|
11
|
+
...props
|
|
12
12
|
}: React.ComponentProps<typeof SeparatorPrimitive.Root>) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
13
|
+
return (
|
|
14
|
+
<SeparatorPrimitive.Root
|
|
15
|
+
data-slot="separator"
|
|
16
|
+
decorative={decorative}
|
|
17
|
+
orientation={orientation}
|
|
18
|
+
className={cn(
|
|
19
|
+
'bg-border shrink-0 data-[orientation=horizontal]:h-px data-[orientation=horizontal]:w-full data-[orientation=vertical]:h-full data-[orientation=vertical]:w-px',
|
|
20
|
+
className,
|
|
21
|
+
)}
|
|
22
|
+
{...props}
|
|
23
|
+
/>
|
|
24
|
+
);
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
export { Separator };
|
|
@@ -1,68 +1,68 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import { Sheet, SheetTrigger, SheetContent, SheetHeader, SheetTitle, SheetDescription } from '@/components/ui/Sheet';
|
|
3
2
|
import { Button } from '@/components/ui/Button';
|
|
3
|
+
import { Sheet, SheetContent, SheetDescription, SheetHeader, SheetTitle, SheetTrigger } from '@/components/ui/Sheet';
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof Sheet> = {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
title: 'UI Components/Sheet',
|
|
7
|
+
component: Sheet,
|
|
8
8
|
};
|
|
9
9
|
export default meta;
|
|
10
10
|
type Story = StoryObj<typeof Sheet>;
|
|
11
11
|
|
|
12
12
|
/** Shows a sheet sliding in from the right with a profile editing form. */
|
|
13
13
|
export const Default: Story = {
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
14
|
+
render: () => (
|
|
15
|
+
<Sheet>
|
|
16
|
+
<SheetTrigger asChild>
|
|
17
|
+
<Button variant="outline">Open Sheet</Button>
|
|
18
|
+
</SheetTrigger>
|
|
19
|
+
<SheetContent>
|
|
20
|
+
<SheetHeader>
|
|
21
|
+
<SheetTitle>Edit Profile</SheetTitle>
|
|
22
|
+
<SheetDescription>Make changes to your profile here. Click save when you are done.</SheetDescription>
|
|
23
|
+
</SheetHeader>
|
|
24
|
+
<div className="grid gap-4 px-4 py-4">
|
|
25
|
+
<div className="grid grid-cols-4 items-center gap-4">
|
|
26
|
+
<span className="text-right text-sm">Name</span>
|
|
27
|
+
<input className="border-input col-span-3 h-9 rounded-md border px-3 text-sm" defaultValue="John Doe" />
|
|
28
|
+
</div>
|
|
29
|
+
<div className="grid grid-cols-4 items-center gap-4">
|
|
30
|
+
<span className="text-right text-sm">Username</span>
|
|
31
|
+
<input className="border-input col-span-3 h-9 rounded-md border px-3 text-sm" defaultValue="@johndoe" />
|
|
32
|
+
</div>
|
|
33
|
+
</div>
|
|
34
|
+
</SheetContent>
|
|
35
|
+
</Sheet>
|
|
36
|
+
),
|
|
37
37
|
};
|
|
38
38
|
|
|
39
39
|
/** Shows a sheet sliding in from the left with navigation links. */
|
|
40
40
|
export const LeftSide: Story = {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
41
|
+
render: () => (
|
|
42
|
+
<Sheet>
|
|
43
|
+
<SheetTrigger asChild>
|
|
44
|
+
<Button variant="outline">Open Left Sheet</Button>
|
|
45
|
+
</SheetTrigger>
|
|
46
|
+
<SheetContent side="left">
|
|
47
|
+
<SheetHeader>
|
|
48
|
+
<SheetTitle>Navigation</SheetTitle>
|
|
49
|
+
<SheetDescription>Browse through the application.</SheetDescription>
|
|
50
|
+
</SheetHeader>
|
|
51
|
+
<nav className="grid gap-2 px-4 py-4">
|
|
52
|
+
<a href="#" className="text-sm hover:underline">
|
|
53
|
+
Home
|
|
54
|
+
</a>
|
|
55
|
+
<a href="#" className="text-sm hover:underline">
|
|
56
|
+
About
|
|
57
|
+
</a>
|
|
58
|
+
<a href="#" className="text-sm hover:underline">
|
|
59
|
+
Settings
|
|
60
|
+
</a>
|
|
61
|
+
<a href="#" className="text-sm hover:underline">
|
|
62
|
+
Help
|
|
63
|
+
</a>
|
|
64
|
+
</nav>
|
|
65
|
+
</SheetContent>
|
|
66
|
+
</Sheet>
|
|
67
|
+
),
|
|
68
68
|
};
|