@auto-engineer/generate-react-client 1.63.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 +45 -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,72 +1,72 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import {
|
|
2
|
+
import { ResizableHandle, ResizablePanel, ResizablePanelGroup } from '@/components/ui/Resizable';
|
|
3
3
|
|
|
4
4
|
const meta: Meta<typeof ResizablePanelGroup> = {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
title: 'UI Components/Resizable',
|
|
6
|
+
component: ResizablePanelGroup,
|
|
7
7
|
};
|
|
8
8
|
export default meta;
|
|
9
9
|
type Story = StoryObj<typeof ResizablePanelGroup>;
|
|
10
10
|
|
|
11
11
|
/** Shows two resizable panels split equally with a minimal divider. */
|
|
12
12
|
export const Default: Story = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
13
|
+
render: () => (
|
|
14
|
+
<ResizablePanelGroup orientation="horizontal" className="min-h-[200px] max-w-md rounded-lg border">
|
|
15
|
+
<ResizablePanel defaultSize={50}>
|
|
16
|
+
<div className="flex h-full items-center justify-center p-6">
|
|
17
|
+
<span className="font-semibold">Panel One</span>
|
|
18
|
+
</div>
|
|
19
|
+
</ResizablePanel>
|
|
20
|
+
<ResizableHandle />
|
|
21
|
+
<ResizablePanel defaultSize={50}>
|
|
22
|
+
<div className="flex h-full items-center justify-center p-6">
|
|
23
|
+
<span className="font-semibold">Panel Two</span>
|
|
24
|
+
</div>
|
|
25
|
+
</ResizablePanel>
|
|
26
|
+
</ResizablePanelGroup>
|
|
27
|
+
),
|
|
28
28
|
};
|
|
29
29
|
|
|
30
30
|
/** Shows two panels with a visible grip handle on the divider. */
|
|
31
31
|
export const WithHandle: Story = {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
32
|
+
render: () => (
|
|
33
|
+
<ResizablePanelGroup orientation="horizontal" className="min-h-[200px] max-w-md rounded-lg border">
|
|
34
|
+
<ResizablePanel defaultSize={30}>
|
|
35
|
+
<div className="flex h-full items-center justify-center p-6">
|
|
36
|
+
<span className="font-semibold">Sidebar</span>
|
|
37
|
+
</div>
|
|
38
|
+
</ResizablePanel>
|
|
39
|
+
<ResizableHandle withHandle />
|
|
40
|
+
<ResizablePanel defaultSize={70}>
|
|
41
|
+
<div className="flex h-full items-center justify-center p-6">
|
|
42
|
+
<span className="font-semibold">Content</span>
|
|
43
|
+
</div>
|
|
44
|
+
</ResizablePanel>
|
|
45
|
+
</ResizablePanelGroup>
|
|
46
|
+
),
|
|
47
47
|
};
|
|
48
48
|
|
|
49
49
|
/** Shows three resizable panels with grip handles between them. */
|
|
50
50
|
export const ThreePanels: Story = {
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
51
|
+
render: () => (
|
|
52
|
+
<ResizablePanelGroup orientation="horizontal" className="min-h-[200px] max-w-lg rounded-lg border">
|
|
53
|
+
<ResizablePanel defaultSize={25}>
|
|
54
|
+
<div className="flex h-full items-center justify-center p-6">
|
|
55
|
+
<span className="font-semibold">Left</span>
|
|
56
|
+
</div>
|
|
57
|
+
</ResizablePanel>
|
|
58
|
+
<ResizableHandle withHandle />
|
|
59
|
+
<ResizablePanel defaultSize={50}>
|
|
60
|
+
<div className="flex h-full items-center justify-center p-6">
|
|
61
|
+
<span className="font-semibold">Center</span>
|
|
62
|
+
</div>
|
|
63
|
+
</ResizablePanel>
|
|
64
|
+
<ResizableHandle withHandle />
|
|
65
|
+
<ResizablePanel defaultSize={25}>
|
|
66
|
+
<div className="flex h-full items-center justify-center p-6">
|
|
67
|
+
<span className="font-semibold">Right</span>
|
|
68
|
+
</div>
|
|
69
|
+
</ResizablePanel>
|
|
70
|
+
</ResizablePanelGroup>
|
|
71
|
+
),
|
|
72
72
|
};
|
|
@@ -10,45 +10,45 @@ import { cn } from '@/lib/utils';
|
|
|
10
10
|
* Built on react-resizable-panels. Compose with ResizablePanel and ResizableHandle.
|
|
11
11
|
*/
|
|
12
12
|
function ResizablePanelGroup({ className, ...props }: ResizablePrimitive.GroupProps) {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
13
|
+
return (
|
|
14
|
+
<ResizablePrimitive.Group
|
|
15
|
+
data-slot="resizable-panel-group"
|
|
16
|
+
className={cn('flex h-full w-full aria-[orientation=vertical]:flex-col', className)}
|
|
17
|
+
{...props}
|
|
18
|
+
/>
|
|
19
|
+
);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
/** A panel within a ResizablePanelGroup whose size can be adjusted by dragging adjacent handles. */
|
|
23
23
|
function ResizablePanel({ ...props }: ResizablePrimitive.PanelProps) {
|
|
24
|
-
|
|
24
|
+
return <ResizablePrimitive.Panel data-slot="resizable-panel" {...props} />;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
27
|
/** A draggable divider between resizable panels. Set withHandle to show a visible grip icon. */
|
|
28
28
|
function ResizableHandle({
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
29
|
+
/** When true, renders a visible grip icon on the handle for better discoverability. */
|
|
30
|
+
withHandle,
|
|
31
|
+
className,
|
|
32
|
+
...props
|
|
33
33
|
}: ResizablePrimitive.SeparatorProps & {
|
|
34
|
-
|
|
34
|
+
withHandle?: boolean;
|
|
35
35
|
}) {
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
36
|
+
return (
|
|
37
|
+
<ResizablePrimitive.Separator
|
|
38
|
+
data-slot="resizable-handle"
|
|
39
|
+
className={cn(
|
|
40
|
+
'bg-border focus-visible:ring-ring relative flex w-px items-center justify-center after:absolute after:inset-y-0 after:left-1/2 after:w-1 after:-translate-x-1/2 focus-visible:ring-1 focus-visible:ring-offset-1 focus-visible:outline-hidden aria-[orientation=horizontal]:h-px aria-[orientation=horizontal]:w-full aria-[orientation=horizontal]:after:left-0 aria-[orientation=horizontal]:after:h-1 aria-[orientation=horizontal]:after:w-full aria-[orientation=horizontal]:after:translate-x-0 aria-[orientation=horizontal]:after:-translate-y-1/2 [&[aria-orientation=horizontal]>div]:rotate-90',
|
|
41
|
+
className,
|
|
42
|
+
)}
|
|
43
|
+
{...props}
|
|
44
|
+
>
|
|
45
|
+
{withHandle && (
|
|
46
|
+
<div className="bg-border z-10 flex h-4 w-3 items-center justify-center rounded-xs border">
|
|
47
|
+
<GripVerticalIcon className="size-2.5" />
|
|
48
|
+
</div>
|
|
49
|
+
)}
|
|
50
|
+
</ResizablePrimitive.Separator>
|
|
51
|
+
);
|
|
52
52
|
}
|
|
53
53
|
|
|
54
54
|
export { ResizableHandle, ResizablePanel, ResizablePanelGroup };
|
|
@@ -3,8 +3,8 @@ import { ScrollArea, ScrollBar } from '@/components/ui/ScrollArea';
|
|
|
3
3
|
import { Separator } from '@/components/ui/Separator';
|
|
4
4
|
|
|
5
5
|
const meta: Meta<typeof ScrollArea> = {
|
|
6
|
-
|
|
7
|
-
|
|
6
|
+
title: 'UI Components/ScrollArea',
|
|
7
|
+
component: ScrollArea,
|
|
8
8
|
};
|
|
9
9
|
export default meta;
|
|
10
10
|
type Story = StoryObj<typeof ScrollArea>;
|
|
@@ -13,33 +13,33 @@ const tags = Array.from({ length: 50 }, (_, i) => `Item ${i + 1}`);
|
|
|
13
13
|
|
|
14
14
|
/** Shows a vertical scroll area with a long list of items. */
|
|
15
15
|
export const Default: Story = {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
16
|
+
render: () => (
|
|
17
|
+
<ScrollArea className="h-72 w-48 rounded-md border">
|
|
18
|
+
<div className="p-4">
|
|
19
|
+
<h4 className="mb-4 text-sm font-medium leading-none">Tags</h4>
|
|
20
|
+
{tags.map((tag) => (
|
|
21
|
+
<div key={tag}>
|
|
22
|
+
<div className="text-sm">{tag}</div>
|
|
23
|
+
<Separator className="my-2" />
|
|
24
|
+
</div>
|
|
25
|
+
))}
|
|
26
|
+
</div>
|
|
27
|
+
</ScrollArea>
|
|
28
|
+
),
|
|
29
29
|
};
|
|
30
30
|
|
|
31
31
|
/** Shows a horizontal scroll area with a row of cards. */
|
|
32
32
|
export const Horizontal: Story = {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
33
|
+
render: () => (
|
|
34
|
+
<ScrollArea className="w-96 whitespace-nowrap rounded-md border">
|
|
35
|
+
<div className="flex w-max space-x-4 p-4">
|
|
36
|
+
{Array.from({ length: 20 }, (_, i) => (
|
|
37
|
+
<div key={i} className="bg-muted flex h-24 w-36 shrink-0 items-center justify-center rounded-md">
|
|
38
|
+
<span className="text-sm font-medium">Card {i + 1}</span>
|
|
39
|
+
</div>
|
|
40
|
+
))}
|
|
41
|
+
</div>
|
|
42
|
+
<ScrollBar orientation="horizontal" />
|
|
43
|
+
</ScrollArea>
|
|
44
|
+
),
|
|
45
45
|
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import { ScrollArea as ScrollAreaPrimitive } from 'radix-ui';
|
|
2
|
+
import type * as React from 'react';
|
|
3
3
|
|
|
4
4
|
import { cn } from '@/lib/utils';
|
|
5
5
|
|
|
@@ -8,44 +8,44 @@ import { cn } from '@/lib/utils';
|
|
|
8
8
|
* Replaces native browser scrollbars with consistent cross-platform styled scrollbars.
|
|
9
9
|
*/
|
|
10
10
|
function ScrollArea({ className, children, ...props }: React.ComponentProps<typeof ScrollAreaPrimitive.Root>) {
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
11
|
+
return (
|
|
12
|
+
<ScrollAreaPrimitive.Root data-slot="scroll-area" className={cn('relative', className)} {...props}>
|
|
13
|
+
<ScrollAreaPrimitive.Viewport
|
|
14
|
+
data-slot="scroll-area-viewport"
|
|
15
|
+
className="focus-visible:ring-ring/50 size-full rounded-[inherit] transition-[color,box-shadow] outline-none focus-visible:ring-[3px] focus-visible:outline-1"
|
|
16
|
+
>
|
|
17
|
+
{children}
|
|
18
|
+
</ScrollAreaPrimitive.Viewport>
|
|
19
|
+
<ScrollBar />
|
|
20
|
+
<ScrollAreaPrimitive.Corner />
|
|
21
|
+
</ScrollAreaPrimitive.Root>
|
|
22
|
+
);
|
|
23
23
|
}
|
|
24
24
|
|
|
25
25
|
/** A styled scrollbar track and thumb. Defaults to vertical; set orientation="horizontal" for horizontal scrolling. */
|
|
26
26
|
function ScrollBar({
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
27
|
+
className,
|
|
28
|
+
orientation = 'vertical',
|
|
29
|
+
...props
|
|
30
30
|
}: React.ComponentProps<typeof ScrollAreaPrimitive.ScrollAreaScrollbar>) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
31
|
+
return (
|
|
32
|
+
<ScrollAreaPrimitive.ScrollAreaScrollbar
|
|
33
|
+
data-slot="scroll-area-scrollbar"
|
|
34
|
+
orientation={orientation}
|
|
35
|
+
className={cn(
|
|
36
|
+
'flex touch-none p-px transition-colors select-none',
|
|
37
|
+
orientation === 'vertical' && 'h-full w-2.5 border-l border-l-transparent',
|
|
38
|
+
orientation === 'horizontal' && 'h-2.5 flex-col border-t border-t-transparent',
|
|
39
|
+
className,
|
|
40
|
+
)}
|
|
41
|
+
{...props}
|
|
42
|
+
>
|
|
43
|
+
<ScrollAreaPrimitive.ScrollAreaThumb
|
|
44
|
+
data-slot="scroll-area-thumb"
|
|
45
|
+
className="bg-border relative flex-1 rounded-full"
|
|
46
|
+
/>
|
|
47
|
+
</ScrollAreaPrimitive.ScrollAreaScrollbar>
|
|
48
|
+
);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
export { ScrollArea, ScrollBar };
|
|
@@ -1,59 +1,59 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
2
|
import {
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
3
|
+
Select,
|
|
4
|
+
SelectContent,
|
|
5
|
+
SelectGroup,
|
|
6
|
+
SelectItem,
|
|
7
|
+
SelectLabel,
|
|
8
|
+
SelectTrigger,
|
|
9
|
+
SelectValue,
|
|
10
10
|
} from '@/components/ui/Select';
|
|
11
11
|
|
|
12
12
|
const meta: Meta<typeof Select> = {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
title: 'UI Components/Select',
|
|
14
|
+
component: Select,
|
|
15
15
|
};
|
|
16
16
|
export default meta;
|
|
17
17
|
type Story = StoryObj<typeof Select>;
|
|
18
18
|
|
|
19
19
|
/** Shows a basic select with a list of fruit options. */
|
|
20
20
|
export const Default: Story = {
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
21
|
+
render: () => (
|
|
22
|
+
<Select>
|
|
23
|
+
<SelectTrigger className="w-[180px]">
|
|
24
|
+
<SelectValue placeholder="Select a fruit" />
|
|
25
|
+
</SelectTrigger>
|
|
26
|
+
<SelectContent>
|
|
27
|
+
<SelectItem value="apple">Apple</SelectItem>
|
|
28
|
+
<SelectItem value="banana">Banana</SelectItem>
|
|
29
|
+
<SelectItem value="cherry">Cherry</SelectItem>
|
|
30
|
+
<SelectItem value="grape">Grape</SelectItem>
|
|
31
|
+
<SelectItem value="orange">Orange</SelectItem>
|
|
32
|
+
</SelectContent>
|
|
33
|
+
</Select>
|
|
34
|
+
),
|
|
35
35
|
};
|
|
36
36
|
|
|
37
37
|
/** Shows options organized into labeled groups for categorized selection. */
|
|
38
38
|
export const Grouped: Story = {
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
39
|
+
render: () => (
|
|
40
|
+
<Select>
|
|
41
|
+
<SelectTrigger className="w-[220px]">
|
|
42
|
+
<SelectValue placeholder="Select a timezone" />
|
|
43
|
+
</SelectTrigger>
|
|
44
|
+
<SelectContent>
|
|
45
|
+
<SelectGroup>
|
|
46
|
+
<SelectLabel>North America</SelectLabel>
|
|
47
|
+
<SelectItem value="est">Eastern Standard Time (EST)</SelectItem>
|
|
48
|
+
<SelectItem value="cst">Central Standard Time (CST)</SelectItem>
|
|
49
|
+
<SelectItem value="pst">Pacific Standard Time (PST)</SelectItem>
|
|
50
|
+
</SelectGroup>
|
|
51
|
+
<SelectGroup>
|
|
52
|
+
<SelectLabel>Europe</SelectLabel>
|
|
53
|
+
<SelectItem value="gmt">Greenwich Mean Time (GMT)</SelectItem>
|
|
54
|
+
<SelectItem value="cet">Central European Time (CET)</SelectItem>
|
|
55
|
+
</SelectGroup>
|
|
56
|
+
</SelectContent>
|
|
57
|
+
</Select>
|
|
58
|
+
),
|
|
59
59
|
};
|