@auto-engineer/generate-react-client 1.64.0 → 1.66.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +140 -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/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +3 -3
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
'use client';
|
|
2
2
|
|
|
3
|
-
import * as React from 'react';
|
|
3
|
+
import type * as React from 'react';
|
|
4
4
|
|
|
5
5
|
import { cn } from '@/lib/utils';
|
|
6
6
|
|
|
@@ -9,78 +9,78 @@ import { cn } from '@/lib/utils';
|
|
|
9
9
|
* Compose with TableHeader, TableBody, TableFooter, TableRow, TableHead, TableCell, and TableCaption subcomponents.
|
|
10
10
|
*/
|
|
11
11
|
function Table({ className, ...props }: React.ComponentProps<'table'>) {
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
12
|
+
return (
|
|
13
|
+
<div data-slot="table-container" className="relative w-full overflow-x-auto">
|
|
14
|
+
<table data-slot="table" className={cn('w-full caption-bottom text-sm', className)} {...props} />
|
|
15
|
+
</div>
|
|
16
|
+
);
|
|
17
17
|
}
|
|
18
18
|
|
|
19
19
|
/** The header section of a Table, rendering a thead with bottom-bordered rows. */
|
|
20
20
|
function TableHeader({ className, ...props }: React.ComponentProps<'thead'>) {
|
|
21
|
-
|
|
21
|
+
return <thead data-slot="table-header" className={cn('[&_tr]:border-b', className)} {...props} />;
|
|
22
22
|
}
|
|
23
23
|
|
|
24
24
|
/** The body section of a Table, rendering a tbody with no border on the last row. */
|
|
25
25
|
function TableBody({ className, ...props }: React.ComponentProps<'tbody'>) {
|
|
26
|
-
|
|
26
|
+
return <tbody data-slot="table-body" className={cn('[&_tr:last-child]:border-0', className)} {...props} />;
|
|
27
27
|
}
|
|
28
28
|
|
|
29
29
|
/** The footer section of a Table, rendering a tfoot with a muted background and top border. */
|
|
30
30
|
function TableFooter({ className, ...props }: React.ComponentProps<'tfoot'>) {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
31
|
+
return (
|
|
32
|
+
<tfoot
|
|
33
|
+
data-slot="table-footer"
|
|
34
|
+
className={cn('bg-muted/50 border-t font-medium [&>tr]:last:border-b-0', className)}
|
|
35
|
+
{...props}
|
|
36
|
+
/>
|
|
37
|
+
);
|
|
38
38
|
}
|
|
39
39
|
|
|
40
40
|
/** A table row with hover highlight and selected state styling via data-state="selected". */
|
|
41
41
|
function TableRow({ className, ...props }: React.ComponentProps<'tr'>) {
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
return (
|
|
43
|
+
<tr
|
|
44
|
+
data-slot="table-row"
|
|
45
|
+
className={cn('hover:bg-muted/50 data-[state=selected]:bg-muted border-b transition-colors', className)}
|
|
46
|
+
{...props}
|
|
47
|
+
/>
|
|
48
|
+
);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
51
|
/** A table header cell with bold text and left alignment. Automatically adjusts padding when containing a checkbox. */
|
|
52
52
|
function TableHead({ className, ...props }: React.ComponentProps<'th'>) {
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
53
|
+
return (
|
|
54
|
+
<th
|
|
55
|
+
data-slot="table-head"
|
|
56
|
+
className={cn(
|
|
57
|
+
'text-foreground h-10 px-2 text-left align-middle font-medium whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',
|
|
58
|
+
className,
|
|
59
|
+
)}
|
|
60
|
+
{...props}
|
|
61
|
+
/>
|
|
62
|
+
);
|
|
63
63
|
}
|
|
64
64
|
|
|
65
65
|
/** A table data cell with standard padding and vertical alignment. */
|
|
66
66
|
function TableCell({ className, ...props }: React.ComponentProps<'td'>) {
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
67
|
+
return (
|
|
68
|
+
<td
|
|
69
|
+
data-slot="table-cell"
|
|
70
|
+
className={cn(
|
|
71
|
+
'p-2 align-middle whitespace-nowrap [&:has([role=checkbox])]:pr-0 [&>[role=checkbox]]:translate-y-[2px]',
|
|
72
|
+
className,
|
|
73
|
+
)}
|
|
74
|
+
{...props}
|
|
75
|
+
/>
|
|
76
|
+
);
|
|
77
77
|
}
|
|
78
78
|
|
|
79
79
|
/** A table caption rendered below the table body in muted text. */
|
|
80
80
|
function TableCaption({ className, ...props }: React.ComponentProps<'caption'>) {
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
81
|
+
return (
|
|
82
|
+
<caption data-slot="table-caption" className={cn('text-muted-foreground mt-4 text-sm', className)} {...props} />
|
|
83
|
+
);
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
export { Table, TableHeader, TableBody, TableFooter, TableHead, TableRow, TableCell, TableCaption };
|
|
@@ -1,53 +1,53 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
|
-
import { Tabs, TabsList, TabsTrigger
|
|
2
|
+
import { Tabs, TabsContent, TabsList, TabsTrigger } from '@/components/ui/Tabs';
|
|
3
3
|
|
|
4
4
|
const meta: Meta<typeof Tabs> = {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
title: 'UI Components/Tabs',
|
|
6
|
+
component: Tabs,
|
|
7
7
|
};
|
|
8
8
|
export default meta;
|
|
9
9
|
type Story = StoryObj<typeof Tabs>;
|
|
10
10
|
|
|
11
11
|
/** Shows the default pill-style tabs with three panels. */
|
|
12
12
|
export const Default: Story = {
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
13
|
+
render: () => (
|
|
14
|
+
<Tabs defaultValue="account" className="w-[400px]">
|
|
15
|
+
<TabsList>
|
|
16
|
+
<TabsTrigger value="account">Account</TabsTrigger>
|
|
17
|
+
<TabsTrigger value="password">Password</TabsTrigger>
|
|
18
|
+
<TabsTrigger value="settings">Settings</TabsTrigger>
|
|
19
|
+
</TabsList>
|
|
20
|
+
<TabsContent value="account">
|
|
21
|
+
<p className="text-sm text-muted-foreground p-4">Make changes to your account here.</p>
|
|
22
|
+
</TabsContent>
|
|
23
|
+
<TabsContent value="password">
|
|
24
|
+
<p className="text-sm text-muted-foreground p-4">Change your password here.</p>
|
|
25
|
+
</TabsContent>
|
|
26
|
+
<TabsContent value="settings">
|
|
27
|
+
<p className="text-sm text-muted-foreground p-4">Adjust your settings here.</p>
|
|
28
|
+
</TabsContent>
|
|
29
|
+
</Tabs>
|
|
30
|
+
),
|
|
31
31
|
};
|
|
32
32
|
|
|
33
33
|
/** Shows the line variant where the active tab is indicated by an underline rather than a background. */
|
|
34
34
|
export const LineVariant: Story = {
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
35
|
+
render: () => (
|
|
36
|
+
<Tabs defaultValue="overview" className="w-[400px]">
|
|
37
|
+
<TabsList variant="line">
|
|
38
|
+
<TabsTrigger value="overview">Overview</TabsTrigger>
|
|
39
|
+
<TabsTrigger value="analytics">Analytics</TabsTrigger>
|
|
40
|
+
<TabsTrigger value="reports">Reports</TabsTrigger>
|
|
41
|
+
</TabsList>
|
|
42
|
+
<TabsContent value="overview">
|
|
43
|
+
<p className="text-sm text-muted-foreground p-4">Overview content goes here.</p>
|
|
44
|
+
</TabsContent>
|
|
45
|
+
<TabsContent value="analytics">
|
|
46
|
+
<p className="text-sm text-muted-foreground p-4">Analytics content goes here.</p>
|
|
47
|
+
</TabsContent>
|
|
48
|
+
<TabsContent value="reports">
|
|
49
|
+
<p className="text-sm text-muted-foreground p-4">Reports content goes here.</p>
|
|
50
|
+
</TabsContent>
|
|
51
|
+
</Tabs>
|
|
52
|
+
),
|
|
53
53
|
};
|
|
@@ -1,75 +1,75 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
1
|
import { cva, type VariantProps } from 'class-variance-authority';
|
|
3
2
|
import { Tabs as TabsPrimitive } from 'radix-ui';
|
|
3
|
+
import type * as React from 'react';
|
|
4
4
|
|
|
5
5
|
import { cn } from '@/lib/utils';
|
|
6
6
|
|
|
7
7
|
/** Layered content panels activated by tab triggers. Supports horizontal and vertical orientations with keyboard navigation. */
|
|
8
8
|
function Tabs({ className, orientation = 'horizontal', ...props }: React.ComponentProps<typeof TabsPrimitive.Root>) {
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
9
|
+
return (
|
|
10
|
+
<TabsPrimitive.Root
|
|
11
|
+
data-slot="tabs"
|
|
12
|
+
data-orientation={orientation}
|
|
13
|
+
orientation={orientation}
|
|
14
|
+
className={cn('group/tabs flex gap-2 data-[orientation=horizontal]:flex-col', className)}
|
|
15
|
+
{...props}
|
|
16
|
+
/>
|
|
17
|
+
);
|
|
18
18
|
}
|
|
19
19
|
|
|
20
20
|
const tabsListVariants = cva(
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
21
|
+
'rounded-lg p-[3px] group-data-[orientation=horizontal]/tabs:h-9 data-[variant=line]:rounded-none group/tabs-list text-muted-foreground inline-flex w-fit items-center justify-center group-data-[orientation=vertical]/tabs:h-fit group-data-[orientation=vertical]/tabs:flex-col',
|
|
22
|
+
{
|
|
23
|
+
variants: {
|
|
24
|
+
variant: {
|
|
25
|
+
default: 'bg-muted',
|
|
26
|
+
line: 'gap-1 bg-transparent',
|
|
27
|
+
},
|
|
28
|
+
},
|
|
29
|
+
defaultVariants: {
|
|
30
|
+
variant: 'default',
|
|
31
|
+
},
|
|
32
|
+
},
|
|
33
33
|
);
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* The container for tab triggers. Supports "default" (pill background) and "line" (underline indicator) variants.
|
|
37
37
|
*/
|
|
38
38
|
function TabsList({
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
39
|
+
className,
|
|
40
|
+
variant = 'default',
|
|
41
|
+
...props
|
|
42
42
|
}: React.ComponentProps<typeof TabsPrimitive.List> & VariantProps<typeof tabsListVariants>) {
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
43
|
+
return (
|
|
44
|
+
<TabsPrimitive.List
|
|
45
|
+
data-slot="tabs-list"
|
|
46
|
+
data-variant={variant}
|
|
47
|
+
className={cn(tabsListVariants({ variant }), className)}
|
|
48
|
+
{...props}
|
|
49
|
+
/>
|
|
50
|
+
);
|
|
51
51
|
}
|
|
52
52
|
|
|
53
53
|
/** A clickable tab button that activates its associated TabsContent panel. */
|
|
54
54
|
function TabsTrigger({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Trigger>) {
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
55
|
+
return (
|
|
56
|
+
<TabsPrimitive.Trigger
|
|
57
|
+
data-slot="tabs-trigger"
|
|
58
|
+
className={cn(
|
|
59
|
+
"focus-visible:border-ring focus-visible:ring-ring/50 focus-visible:outline-ring text-foreground/60 hover:text-foreground dark:text-muted-foreground dark:hover:text-foreground relative inline-flex h-[calc(100%-1px)] flex-1 items-center justify-center gap-1.5 rounded-md border border-transparent px-2 py-1 text-sm font-medium whitespace-nowrap transition-all group-data-[orientation=vertical]/tabs:w-full group-data-[orientation=vertical]/tabs:justify-start focus-visible:ring-[3px] focus-visible:outline-1 disabled:pointer-events-none disabled:opacity-50 group-data-[variant=default]/tabs-list:data-[state=active]:shadow-sm group-data-[variant=line]/tabs-list:data-[state=active]:shadow-none [&_svg]:pointer-events-none [&_svg]:shrink-0 [&_svg:not([class*='size-'])]:size-4",
|
|
60
|
+
'group-data-[variant=line]/tabs-list:bg-transparent group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:border-transparent dark:group-data-[variant=line]/tabs-list:data-[state=active]:bg-transparent',
|
|
61
|
+
'data-[state=active]:bg-background dark:data-[state=active]:text-foreground dark:data-[state=active]:border-input dark:data-[state=active]:bg-input/30 data-[state=active]:text-foreground',
|
|
62
|
+
'after:bg-foreground after:absolute after:opacity-0 after:transition-opacity group-data-[orientation=horizontal]/tabs:after:inset-x-0 group-data-[orientation=horizontal]/tabs:after:bottom-[-5px] group-data-[orientation=horizontal]/tabs:after:h-0.5 group-data-[orientation=vertical]/tabs:after:inset-y-0 group-data-[orientation=vertical]/tabs:after:-right-1 group-data-[orientation=vertical]/tabs:after:w-0.5 group-data-[variant=line]/tabs-list:data-[state=active]:after:opacity-100',
|
|
63
|
+
className,
|
|
64
|
+
)}
|
|
65
|
+
{...props}
|
|
66
|
+
/>
|
|
67
|
+
);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
/** The content panel associated with a tab trigger, shown when its corresponding trigger is active. */
|
|
71
71
|
function TabsContent({ className, ...props }: React.ComponentProps<typeof TabsPrimitive.Content>) {
|
|
72
|
-
|
|
72
|
+
return <TabsPrimitive.Content data-slot="tabs-content" className={cn('flex-1 outline-none', className)} {...props} />;
|
|
73
73
|
}
|
|
74
74
|
|
|
75
75
|
export { Tabs, TabsList, TabsTrigger, TabsContent, tabsListVariants };
|
|
@@ -2,8 +2,8 @@ import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
|
2
2
|
import { Textarea } from '@/components/ui/Textarea';
|
|
3
3
|
|
|
4
4
|
const meta: Meta<typeof Textarea> = {
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
title: 'UI Components/Textarea',
|
|
6
|
+
component: Textarea,
|
|
7
7
|
};
|
|
8
8
|
export default meta;
|
|
9
9
|
type Story = StoryObj<typeof Textarea>;
|
|
@@ -13,15 +13,15 @@ export const Default: Story = {};
|
|
|
13
13
|
|
|
14
14
|
/** Shows the textarea with placeholder text. */
|
|
15
15
|
export const WithPlaceholder: Story = {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
16
|
+
args: {
|
|
17
|
+
placeholder: 'Type your message here...',
|
|
18
|
+
},
|
|
19
19
|
};
|
|
20
20
|
|
|
21
21
|
/** Shows a disabled textarea that cannot receive input. */
|
|
22
22
|
export const Disabled: Story = {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
23
|
+
args: {
|
|
24
|
+
placeholder: 'This textarea is disabled',
|
|
25
|
+
disabled: true,
|
|
26
|
+
},
|
|
27
27
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
1
|
+
import type * as React from 'react';
|
|
2
2
|
|
|
3
3
|
import { cn } from '@/lib/utils';
|
|
4
4
|
|
|
@@ -7,16 +7,16 @@ import { cn } from '@/lib/utils';
|
|
|
7
7
|
* Supports aria-invalid styling for form validation errors.
|
|
8
8
|
*/
|
|
9
9
|
function Textarea({ className, ...props }: React.ComponentProps<'textarea'>) {
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
10
|
+
return (
|
|
11
|
+
<textarea
|
|
12
|
+
data-slot="textarea"
|
|
13
|
+
className={cn(
|
|
14
|
+
'border-input placeholder: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 flex field-sizing-content min-h-16 w-full rounded-md border bg-transparent px-3 py-2 text-base shadow-xs transition-[color,box-shadow] outline-none focus-visible:ring-[3px] disabled:cursor-not-allowed disabled:opacity-50 md:text-sm',
|
|
15
|
+
className,
|
|
16
|
+
)}
|
|
17
|
+
{...props}
|
|
18
|
+
/>
|
|
19
|
+
);
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export { Textarea };
|
|
@@ -1,116 +1,116 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react-vite';
|
|
2
2
|
import { Button } from '@/components/ui/Button';
|
|
3
3
|
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
4
|
+
Toast,
|
|
5
|
+
ToastAction,
|
|
6
|
+
ToastClose,
|
|
7
|
+
ToastDescription,
|
|
8
|
+
ToastProvider,
|
|
9
|
+
ToastTitle,
|
|
10
|
+
ToastViewport,
|
|
11
11
|
} from '@/components/ui/Toast';
|
|
12
12
|
import { Toaster } from '@/components/ui/Toaster';
|
|
13
13
|
import { useToast } from '@/hooks/use-toast';
|
|
14
14
|
|
|
15
15
|
const meta: Meta<typeof Toast> = {
|
|
16
|
-
|
|
17
|
-
|
|
16
|
+
title: 'UI Components/Toast',
|
|
17
|
+
component: Toast,
|
|
18
18
|
};
|
|
19
19
|
export default meta;
|
|
20
20
|
type Story = StoryObj<typeof Toast>;
|
|
21
21
|
|
|
22
22
|
function ToastDemo() {
|
|
23
|
-
|
|
23
|
+
const { toast } = useToast();
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
25
|
+
return (
|
|
26
|
+
<div>
|
|
27
|
+
<Toaster />
|
|
28
|
+
<Button
|
|
29
|
+
variant="outline"
|
|
30
|
+
onClick={() => {
|
|
31
|
+
toast({
|
|
32
|
+
title: 'UI Components/Scheduled: Catch up',
|
|
33
|
+
description: 'Friday, February 10, 2026 at 5:57 PM',
|
|
34
|
+
});
|
|
35
|
+
}}
|
|
36
|
+
>
|
|
37
|
+
Show Toast
|
|
38
|
+
</Button>
|
|
39
|
+
</div>
|
|
40
|
+
);
|
|
41
41
|
}
|
|
42
42
|
|
|
43
43
|
/** Demonstrates triggering a basic toast notification with a title and description. */
|
|
44
44
|
export const Default: Story = {
|
|
45
|
-
|
|
45
|
+
render: () => <ToastDemo />,
|
|
46
46
|
};
|
|
47
47
|
|
|
48
48
|
function ToastDestructiveDemo() {
|
|
49
|
-
|
|
49
|
+
const { toast } = useToast();
|
|
50
50
|
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
51
|
+
return (
|
|
52
|
+
<div>
|
|
53
|
+
<Toaster />
|
|
54
|
+
<Button
|
|
55
|
+
variant="outline"
|
|
56
|
+
onClick={() => {
|
|
57
|
+
toast({
|
|
58
|
+
variant: 'destructive',
|
|
59
|
+
title: 'UI Components/Uh oh! Something went wrong.',
|
|
60
|
+
description: 'There was a problem with your request.',
|
|
61
|
+
});
|
|
62
|
+
}}
|
|
63
|
+
>
|
|
64
|
+
Show Destructive Toast
|
|
65
|
+
</Button>
|
|
66
|
+
</div>
|
|
67
|
+
);
|
|
68
68
|
}
|
|
69
69
|
|
|
70
70
|
/** Shows a destructive-variant toast for error or warning scenarios. */
|
|
71
71
|
export const Destructive: Story = {
|
|
72
|
-
|
|
72
|
+
render: () => <ToastDestructiveDemo />,
|
|
73
73
|
};
|
|
74
74
|
|
|
75
75
|
function ToastWithActionDemo() {
|
|
76
|
-
|
|
76
|
+
const { toast } = useToast();
|
|
77
77
|
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
78
|
+
return (
|
|
79
|
+
<div>
|
|
80
|
+
<Toaster />
|
|
81
|
+
<Button
|
|
82
|
+
variant="outline"
|
|
83
|
+
onClick={() => {
|
|
84
|
+
toast({
|
|
85
|
+
title: 'UI Components/Event created',
|
|
86
|
+
description: 'Sunday, December 03, 2023 at 9:00 AM',
|
|
87
|
+
action: <ToastAction altText="Undo">Undo</ToastAction>,
|
|
88
|
+
});
|
|
89
|
+
}}
|
|
90
|
+
>
|
|
91
|
+
Show Toast with Action
|
|
92
|
+
</Button>
|
|
93
|
+
</div>
|
|
94
|
+
);
|
|
95
95
|
}
|
|
96
96
|
|
|
97
97
|
/** Shows a toast with an action button (e.g., "Undo") alongside the message. */
|
|
98
98
|
export const WithAction: Story = {
|
|
99
|
-
|
|
99
|
+
render: () => <ToastWithActionDemo />,
|
|
100
100
|
};
|
|
101
101
|
|
|
102
102
|
/** Shows a toast rendered inline (always open) using the primitive subcomponents directly. */
|
|
103
103
|
export const Inline: Story = {
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
104
|
+
render: () => (
|
|
105
|
+
<ToastProvider>
|
|
106
|
+
<Toast open>
|
|
107
|
+
<div className="grid gap-1">
|
|
108
|
+
<ToastTitle>Toast Title</ToastTitle>
|
|
109
|
+
<ToastDescription>This is a toast description.</ToastDescription>
|
|
110
|
+
</div>
|
|
111
|
+
<ToastClose />
|
|
112
|
+
</Toast>
|
|
113
|
+
<ToastViewport />
|
|
114
|
+
</ToastProvider>
|
|
115
|
+
),
|
|
116
116
|
};
|