@altimateai/ui-components 0.0.1-beta.3 → 0.0.1-beta.5
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/dist/Accordion.js +43 -114
- package/dist/Badge.js +1 -1
- package/dist/CoachForm.js +7125 -7242
- package/dist/DbtDocsRenderer.js +833 -2651
- package/dist/Tooltip.js +115 -0
- package/dist/chatbot/index.d.ts +7 -3
- package/dist/chatbot/index.js +100 -96
- package/dist/chatbotV2/index.d.ts +10 -2
- package/dist/flowchart-elk-definition-170a3958.js +1 -1
- package/dist/index.d.ts +28 -30
- package/dist/index.js +1 -1
- package/dist/index2.js +1 -5
- package/dist/lineage/index.d.ts +9 -3
- package/dist/lineage/index.js +2284 -2710
- package/dist/main.js +49 -184
- package/dist/mindmap-definition-44684416.js +1 -1
- package/dist/redux-toolkit.modern.js +1 -1
- package/dist/shadcn/index.d.ts +3 -4
- package/dist/shadcn/index.js +352 -382
- package/dist/storybook/Accordion.stories.tsx +5 -14
- package/dist/storybook/Alert.stories.tsx +3 -7
- package/dist/storybook/AlertDialog.stories.tsx +7 -12
- package/dist/storybook/Button.stories.tsx +7 -27
- package/dist/storybook/Card.stories.tsx +1 -8
- package/dist/storybook/Checkbox.stories.tsx +7 -16
- package/dist/storybook/Form.stories.tsx +3 -9
- package/dist/storybook/HoverCard.stories.tsx +7 -13
- package/dist/storybook/Label.stories.tsx +1 -1
- package/dist/storybook/Pagination.stories.tsx +1 -4
- package/dist/storybook/Popover.stories.tsx +1 -3
- package/dist/storybook/Progress.stories.tsx +2 -2
- package/dist/storybook/RadioGroup.stories.tsx +4 -7
- package/dist/storybook/ScrollArea.stories.tsx +11 -30
- package/dist/storybook/Select.stories.tsx +1 -1
- package/dist/storybook/Sheet.stories.tsx +1 -7
- package/dist/storybook/Sidebar.stories.tsx +4 -4
- package/dist/storybook/Slider.stories.tsx +2 -4
- package/dist/storybook/Switch.stories.tsx +4 -13
- package/dist/storybook/Textarea.stories.tsx +1 -1
- package/dist/storybook/Toast.stories.tsx +7 -11
- package/dist/storybook/Tooltip.stories.tsx +2 -7
- package/dist/{types-PVxbm0tZ.d.ts → types-FVWfXDNw.d.ts} +10 -5
- package/dist/v4.js +524 -514
- package/package.json +2 -2
- package/dist/Stack.js +0 -132
- /package/dist/{Stack.css → v4.css} +0 -0
|
@@ -1,10 +1,5 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import {
|
|
3
|
-
Accordion,
|
|
4
|
-
AccordionContent,
|
|
5
|
-
AccordionItem,
|
|
6
|
-
AccordionTrigger,
|
|
7
|
-
} from "../shadcn";
|
|
2
|
+
import { Accordion, AccordionContent, AccordionItem, AccordionTrigger } from "../shadcn";
|
|
8
3
|
|
|
9
4
|
const meta: Meta<typeof Accordion> = {
|
|
10
5
|
title: "Shadcn/Components/Accordion",
|
|
@@ -19,22 +14,18 @@ export const Default: Story = {
|
|
|
19
14
|
<Accordion type="single" collapsible className="al-w-full">
|
|
20
15
|
<AccordionItem value="item-1">
|
|
21
16
|
<AccordionTrigger>Is it accessible?</AccordionTrigger>
|
|
22
|
-
<AccordionContent>
|
|
23
|
-
Yes. It adheres to the WAI-ARIA design pattern.
|
|
24
|
-
</AccordionContent>
|
|
17
|
+
<AccordionContent>Yes. It adheres to the WAI-ARIA design pattern.</AccordionContent>
|
|
25
18
|
</AccordionItem>
|
|
26
19
|
<AccordionItem value="item-2">
|
|
27
20
|
<AccordionTrigger>Is it styled?</AccordionTrigger>
|
|
28
21
|
<AccordionContent>
|
|
29
|
-
Yes. It comes with default styles that matches the other
|
|
30
|
-
components' aesthetic.
|
|
22
|
+
Yes. It comes with default styles that matches the other components' aesthetic.
|
|
31
23
|
</AccordionContent>
|
|
32
24
|
</AccordionItem>
|
|
33
25
|
<AccordionItem value="item-3">
|
|
34
26
|
<AccordionTrigger>Is it animated?</AccordionTrigger>
|
|
35
27
|
<AccordionContent>
|
|
36
|
-
Yes. It's animated by default, but you can disable it if you
|
|
37
|
-
prefer.
|
|
28
|
+
Yes. It's animated by default, but you can disable it if you prefer.
|
|
38
29
|
</AccordionContent>
|
|
39
30
|
</AccordionItem>
|
|
40
31
|
</Accordion>
|
|
@@ -47,7 +38,7 @@ export const Multiple: Story = {
|
|
|
47
38
|
<AccordionItem value="item-1">
|
|
48
39
|
<AccordionTrigger>Can I open multiple items?</AccordionTrigger>
|
|
49
40
|
<AccordionContent>
|
|
50
|
-
Yes. Just set the type prop to
|
|
41
|
+
Yes. Just set the type prop to "multiple" on the Accordion component.
|
|
51
42
|
</AccordionContent>
|
|
52
43
|
</AccordionItem>
|
|
53
44
|
<AccordionItem value="item-2">
|
|
@@ -13,7 +13,7 @@ export default {
|
|
|
13
13
|
},
|
|
14
14
|
} as Meta;
|
|
15
15
|
|
|
16
|
-
const Template: StoryFn =
|
|
16
|
+
const Template: StoryFn = args => (
|
|
17
17
|
<Alert {...args}>
|
|
18
18
|
<AlertTitle>Heads up!</AlertTitle>
|
|
19
19
|
<AlertDescription>
|
|
@@ -36,9 +36,7 @@ export const WithIcon: StoryFn = () => (
|
|
|
36
36
|
<Alert>
|
|
37
37
|
<InfoCircleIcon className="al-h-4 al-w-4" />
|
|
38
38
|
<AlertTitle>Info Alert</AlertTitle>
|
|
39
|
-
<AlertDescription>
|
|
40
|
-
This is an informational alert with an icon.
|
|
41
|
-
</AlertDescription>
|
|
39
|
+
<AlertDescription>This is an informational alert with an icon.</AlertDescription>
|
|
42
40
|
</Alert>
|
|
43
41
|
);
|
|
44
42
|
|
|
@@ -46,9 +44,7 @@ export const DestructiveWithIcon: StoryFn = () => (
|
|
|
46
44
|
<Alert variant="destructive">
|
|
47
45
|
<InfoCircleIcon className="al-h-4 al-w-4" />
|
|
48
46
|
<AlertTitle>Error Alert</AlertTitle>
|
|
49
|
-
<AlertDescription>
|
|
50
|
-
Something went wrong! Please try again later.
|
|
51
|
-
</AlertDescription>
|
|
47
|
+
<AlertDescription>Something went wrong! Please try again later.</AlertDescription>
|
|
52
48
|
</Alert>
|
|
53
49
|
);
|
|
54
50
|
|
|
@@ -23,8 +23,8 @@ const Template: StoryFn = () => (
|
|
|
23
23
|
<AlertDialogHeader>
|
|
24
24
|
<AlertDialogTitle>Are you absolutely sure?</AlertDialogTitle>
|
|
25
25
|
<AlertDialogDescription>
|
|
26
|
-
This action cannot be undone. This will permanently delete your
|
|
27
|
-
|
|
26
|
+
This action cannot be undone. This will permanently delete your account and remove your
|
|
27
|
+
data from our servers.
|
|
28
28
|
</AlertDialogDescription>
|
|
29
29
|
</AlertDialogHeader>
|
|
30
30
|
<AlertDialogFooter>
|
|
@@ -46,8 +46,8 @@ export const DestructiveAction: StoryFn = () => (
|
|
|
46
46
|
<AlertDialogHeader>
|
|
47
47
|
<AlertDialogTitle>Delete Account</AlertDialogTitle>
|
|
48
48
|
<AlertDialogDescription>
|
|
49
|
-
This will permanently delete your account and remove all your data.
|
|
50
|
-
|
|
49
|
+
This will permanently delete your account and remove all your data. This action cannot be
|
|
50
|
+
undone.
|
|
51
51
|
</AlertDialogDescription>
|
|
52
52
|
</AlertDialogHeader>
|
|
53
53
|
<AlertDialogFooter>
|
|
@@ -84,9 +84,7 @@ export const WithCustomTrigger: StoryFn = () => (
|
|
|
84
84
|
<AlertDialogContent>
|
|
85
85
|
<AlertDialogHeader>
|
|
86
86
|
<AlertDialogTitle>Delete Item</AlertDialogTitle>
|
|
87
|
-
<AlertDialogDescription>
|
|
88
|
-
Are you sure you want to delete this item?
|
|
89
|
-
</AlertDialogDescription>
|
|
87
|
+
<AlertDialogDescription>Are you sure you want to delete this item?</AlertDialogDescription>
|
|
90
88
|
</AlertDialogHeader>
|
|
91
89
|
<AlertDialogFooter>
|
|
92
90
|
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
@@ -103,15 +101,12 @@ export const WithForm: StoryFn = () => (
|
|
|
103
101
|
<AlertDialogHeader>
|
|
104
102
|
<AlertDialogTitle>Unsubscribe from Newsletter</AlertDialogTitle>
|
|
105
103
|
<AlertDialogDescription>
|
|
106
|
-
Please tell us why you
|
|
104
|
+
Please tell us why you're unsubscribing:
|
|
107
105
|
</AlertDialogDescription>
|
|
108
106
|
</AlertDialogHeader>
|
|
109
107
|
<div className="al-grid al-gap-4 al-py-4">
|
|
110
108
|
<div className="al-grid al-gap-2">
|
|
111
|
-
<label
|
|
112
|
-
htmlFor="reason"
|
|
113
|
-
className="al-text-sm al-font-medium al-leading-none"
|
|
114
|
-
>
|
|
109
|
+
<label htmlFor="reason" className="al-text-sm al-font-medium al-leading-none">
|
|
115
110
|
Reason
|
|
116
111
|
</label>
|
|
117
112
|
<select
|
|
@@ -8,14 +8,7 @@ export default {
|
|
|
8
8
|
argTypes: {
|
|
9
9
|
variant: {
|
|
10
10
|
control: "select",
|
|
11
|
-
options: [
|
|
12
|
-
"default",
|
|
13
|
-
"destructive",
|
|
14
|
-
"outline",
|
|
15
|
-
"secondary",
|
|
16
|
-
"ghost",
|
|
17
|
-
"link",
|
|
18
|
-
],
|
|
11
|
+
options: ["default", "destructive", "outline", "secondary", "ghost", "link"],
|
|
19
12
|
},
|
|
20
13
|
size: {
|
|
21
14
|
control: "select",
|
|
@@ -24,7 +17,7 @@ export default {
|
|
|
24
17
|
},
|
|
25
18
|
} as Meta;
|
|
26
19
|
|
|
27
|
-
const Template: StoryFn<ButtonProps> =
|
|
20
|
+
const Template: StoryFn<ButtonProps> = args => <Button {...args} />;
|
|
28
21
|
|
|
29
22
|
export const Default = Template.bind({});
|
|
30
23
|
Default.args = {
|
|
@@ -67,24 +60,14 @@ Icon.args = {
|
|
|
67
60
|
children: "🔍",
|
|
68
61
|
};
|
|
69
62
|
|
|
70
|
-
const buttonVariants = [
|
|
71
|
-
"Default",
|
|
72
|
-
"Secondary",
|
|
73
|
-
"Destructive",
|
|
74
|
-
"Success",
|
|
75
|
-
"Ghost",
|
|
76
|
-
"Link",
|
|
77
|
-
];
|
|
63
|
+
const buttonVariants = ["Default", "Secondary", "Destructive", "Success", "Ghost", "Link"];
|
|
78
64
|
|
|
79
65
|
export const Buttons = {
|
|
80
66
|
render: () => (
|
|
81
67
|
<div className="al-space-y-4">
|
|
82
|
-
{buttonVariants.map(
|
|
83
|
-
<div className="al-space-x-4">
|
|
84
|
-
<Button
|
|
85
|
-
variant={v.toLowerCase() as ButtonProps["variant"]}
|
|
86
|
-
className="al-align-bottom"
|
|
87
|
-
>
|
|
68
|
+
{buttonVariants.map(v => (
|
|
69
|
+
<div className="al-space-x-4" key={v}>
|
|
70
|
+
<Button variant={v.toLowerCase() as ButtonProps["variant"]} className="al-align-bottom">
|
|
88
71
|
{v}
|
|
89
72
|
</Button>
|
|
90
73
|
<Button
|
|
@@ -101,10 +84,7 @@ export const Buttons = {
|
|
|
101
84
|
>
|
|
102
85
|
{v} disabled
|
|
103
86
|
</Button>
|
|
104
|
-
<Button
|
|
105
|
-
variant={v.toLowerCase() as ButtonProps["variant"]}
|
|
106
|
-
className="al-align-bottom"
|
|
107
|
-
>
|
|
87
|
+
<Button variant={v.toLowerCase() as ButtonProps["variant"]} className="al-align-bottom">
|
|
108
88
|
<CloseIcon />
|
|
109
89
|
{v} with icon
|
|
110
90
|
</Button>
|
|
@@ -1,13 +1,6 @@
|
|
|
1
1
|
import { Meta, StoryFn } from "@storybook/react";
|
|
2
2
|
import { Button } from "../shadcn";
|
|
3
|
-
import {
|
|
4
|
-
Card,
|
|
5
|
-
CardHeader,
|
|
6
|
-
CardTitle,
|
|
7
|
-
CardDescription,
|
|
8
|
-
CardContent,
|
|
9
|
-
CardFooter,
|
|
10
|
-
} from "../shadcn";
|
|
3
|
+
import { Card, CardHeader, CardTitle, CardDescription, CardContent, CardFooter } from "../shadcn";
|
|
11
4
|
|
|
12
5
|
export default {
|
|
13
6
|
title: "Shadcn/Components/Card",
|
|
@@ -13,7 +13,7 @@ export default meta;
|
|
|
13
13
|
type Story = StoryObj<typeof Checkbox>;
|
|
14
14
|
|
|
15
15
|
export const Default: Story = {
|
|
16
|
-
render:
|
|
16
|
+
render: args => (
|
|
17
17
|
<div className="al-flex al-items-center al-space-x-2">
|
|
18
18
|
<Checkbox {...args} id="terms" />
|
|
19
19
|
<label
|
|
@@ -27,13 +27,10 @@ export const Default: Story = {
|
|
|
27
27
|
};
|
|
28
28
|
|
|
29
29
|
export const Checked: Story = {
|
|
30
|
-
render:
|
|
30
|
+
render: args => (
|
|
31
31
|
<div className="al-flex al-items-center al-space-x-2">
|
|
32
32
|
<Checkbox {...args} id="checked" defaultChecked />
|
|
33
|
-
<label
|
|
34
|
-
htmlFor="checked"
|
|
35
|
-
className="al-text-sm al-font-medium al-leading-none"
|
|
36
|
-
>
|
|
33
|
+
<label htmlFor="checked" className="al-text-sm al-font-medium al-leading-none">
|
|
37
34
|
Checked by default
|
|
38
35
|
</label>
|
|
39
36
|
</div>
|
|
@@ -41,13 +38,10 @@ export const Checked: Story = {
|
|
|
41
38
|
};
|
|
42
39
|
|
|
43
40
|
export const Disabled: Story = {
|
|
44
|
-
render:
|
|
41
|
+
render: args => (
|
|
45
42
|
<div className="al-flex al-items-center al-space-x-2">
|
|
46
43
|
<Checkbox {...args} id="disabled" disabled />
|
|
47
|
-
<label
|
|
48
|
-
htmlFor="disabled"
|
|
49
|
-
className="al-text-sm al-font-medium al-leading-none al-opacity-70"
|
|
50
|
-
>
|
|
44
|
+
<label htmlFor="disabled" className="al-text-sm al-font-medium al-leading-none al-opacity-70">
|
|
51
45
|
Disabled checkbox
|
|
52
46
|
</label>
|
|
53
47
|
</div>
|
|
@@ -55,14 +49,11 @@ export const Disabled: Story = {
|
|
|
55
49
|
};
|
|
56
50
|
|
|
57
51
|
export const WithDescription: Story = {
|
|
58
|
-
render:
|
|
52
|
+
render: args => (
|
|
59
53
|
<div className="al-items-top al-flex al-space-x-2">
|
|
60
54
|
<Checkbox {...args} id="description" />
|
|
61
55
|
<div className="al-grid al-gap-1.5 al-leading-none">
|
|
62
|
-
<label
|
|
63
|
-
htmlFor="description"
|
|
64
|
-
className="al-text-sm al-font-medium al-leading-none"
|
|
65
|
-
>
|
|
56
|
+
<label htmlFor="description" className="al-text-sm al-font-medium al-leading-none">
|
|
66
57
|
Accept terms
|
|
67
58
|
</label>
|
|
68
59
|
<p className="al-text-sm al-text-muted-foreground">
|
|
@@ -37,9 +37,7 @@ const Template: StoryFn = () => {
|
|
|
37
37
|
className="al-flex al-h-10 al-w-full al-rounded-md al-border al-border-input al-bg-background al-px-3 al-py-2 al-text-sm"
|
|
38
38
|
/>
|
|
39
39
|
</FormControl>
|
|
40
|
-
<FormDescription>
|
|
41
|
-
This is your public display name.
|
|
42
|
-
</FormDescription>
|
|
40
|
+
<FormDescription>This is your public display name.</FormDescription>
|
|
43
41
|
<FormMessage />
|
|
44
42
|
</FormItem>
|
|
45
43
|
)}
|
|
@@ -73,9 +71,7 @@ export const WithValidation: StoryFn = () => {
|
|
|
73
71
|
className="al-flex al-h-10 al-w-full al-rounded-md al-border al-border-input al-bg-background al-px-3 al-py-2 al-text-sm"
|
|
74
72
|
/>
|
|
75
73
|
</FormControl>
|
|
76
|
-
<FormDescription>
|
|
77
|
-
Username must be at least 2 characters.
|
|
78
|
-
</FormDescription>
|
|
74
|
+
<FormDescription>Username must be at least 2 characters.</FormDescription>
|
|
79
75
|
<FormMessage />
|
|
80
76
|
</FormItem>
|
|
81
77
|
)}
|
|
@@ -107,9 +103,7 @@ export const WithError: StoryFn = () => {
|
|
|
107
103
|
className="al-flex al-h-10 al-w-full al-rounded-md al-border al-border-destructive al-bg-background al-px-3 al-py-2 al-text-sm"
|
|
108
104
|
/>
|
|
109
105
|
</FormControl>
|
|
110
|
-
<FormDescription>
|
|
111
|
-
Username must be at least 2 characters.
|
|
112
|
-
</FormDescription>
|
|
106
|
+
<FormDescription>Username must be at least 2 characters.</FormDescription>
|
|
113
107
|
<FormMessage>Username is too short</FormMessage>
|
|
114
108
|
</FormItem>
|
|
115
109
|
)}
|
|
@@ -31,14 +31,10 @@ const Template: StoryFn = () => (
|
|
|
31
31
|
</Avatar>
|
|
32
32
|
<div className="al-space-y-1">
|
|
33
33
|
<h4 className="al-text-sm al-font-semibold">@nextjs</h4>
|
|
34
|
-
<p className="al-text-sm">
|
|
35
|
-
The React Framework – created and maintained by @vercel.
|
|
36
|
-
</p>
|
|
34
|
+
<p className="al-text-sm">The React Framework – created and maintained by @vercel.</p>
|
|
37
35
|
<div className="al-flex al-items-center al-pt-2">
|
|
38
36
|
<CloseIcon className="al-mr-2 al-h-4 al-w-4 al-opacity-70" />{" "}
|
|
39
|
-
<span className="al-text-xs al-text-muted-foreground">
|
|
40
|
-
Joined December 2021
|
|
41
|
-
</span>
|
|
37
|
+
<span className="al-text-xs al-text-muted-foreground">Joined December 2021</span>
|
|
42
38
|
</div>
|
|
43
39
|
</div>
|
|
44
40
|
</div>
|
|
@@ -57,8 +53,8 @@ export const WithCustomAlignment: StoryFn = () => (
|
|
|
57
53
|
<div className="al-space-y-2">
|
|
58
54
|
<h4 className="al-text-sm al-font-semibold">Right Aligned Content</h4>
|
|
59
55
|
<p className="al-text-sm">
|
|
60
|
-
This hover card
|
|
61
|
-
|
|
56
|
+
This hover card's content is aligned to the end (right) of the trigger element. It
|
|
57
|
+
also has a custom width of 80 units.
|
|
62
58
|
</p>
|
|
63
59
|
</div>
|
|
64
60
|
</HoverCardContent>
|
|
@@ -74,8 +70,8 @@ export const WithCustomOffset: StoryFn = () => (
|
|
|
74
70
|
<div className="al-space-y-2">
|
|
75
71
|
<h4 className="al-text-sm al-font-semibold">Custom Offset Content</h4>
|
|
76
72
|
<p className="al-text-sm">
|
|
77
|
-
This hover card has a larger offset from the trigger element (10 units
|
|
78
|
-
|
|
73
|
+
This hover card has a larger offset from the trigger element (10 units instead of the
|
|
74
|
+
default 4).
|
|
79
75
|
</p>
|
|
80
76
|
</div>
|
|
81
77
|
</HoverCardContent>
|
|
@@ -93,9 +89,7 @@ export const WithRichContent: StoryFn = () => (
|
|
|
93
89
|
<h4 className="al-text-sm al-font-semibold">@johndoe</h4>
|
|
94
90
|
<p className="al-text-sm">Staff Engineer at Acme Corp</p>
|
|
95
91
|
<div className="al-flex al-items-center al-pt-2">
|
|
96
|
-
<span className="al-text-xs al-text-muted-foreground">
|
|
97
|
-
Joined December 2021
|
|
98
|
-
</span>
|
|
92
|
+
<span className="al-text-xs al-text-muted-foreground">Joined December 2021</span>
|
|
99
93
|
</div>
|
|
100
94
|
</div>
|
|
101
95
|
<div className="al-w-12 al-h-12 al-rounded-full al-bg-secondary" />
|
|
@@ -96,10 +96,7 @@ export const WithDisabledControls: StoryFn = () => (
|
|
|
96
96
|
<Pagination>
|
|
97
97
|
<PaginationContent>
|
|
98
98
|
<PaginationItem>
|
|
99
|
-
<PaginationPrevious
|
|
100
|
-
href="#"
|
|
101
|
-
className="pointer-events-none opacity-50"
|
|
102
|
-
/>
|
|
99
|
+
<PaginationPrevious href="#" className="pointer-events-none opacity-50" />
|
|
103
100
|
</PaginationItem>
|
|
104
101
|
<PaginationItem>
|
|
105
102
|
<PaginationLink href="#" isActive>
|
|
@@ -14,9 +14,7 @@ const Template: StoryFn = () => (
|
|
|
14
14
|
<PopoverContent>
|
|
15
15
|
<div className="al-space-y-2">
|
|
16
16
|
<h4 className="al-font-medium al-leading-none">Popover Content</h4>
|
|
17
|
-
<p className="al-text-sm al-text-muted-foreground">
|
|
18
|
-
This is the popover content.
|
|
19
|
-
</p>
|
|
17
|
+
<p className="al-text-sm al-text-muted-foreground">This is the popover content.</p>
|
|
20
18
|
</div>
|
|
21
19
|
</PopoverContent>
|
|
22
20
|
</Popover>
|
|
@@ -12,7 +12,7 @@ export default {
|
|
|
12
12
|
},
|
|
13
13
|
} as Meta;
|
|
14
14
|
|
|
15
|
-
const Template: StoryFn =
|
|
15
|
+
const Template: StoryFn = args => <Progress {...args} />;
|
|
16
16
|
|
|
17
17
|
export const Default = Template.bind({});
|
|
18
18
|
Default.args = {
|
|
@@ -52,7 +52,7 @@ export const Animated: StoryFn = () => {
|
|
|
52
52
|
|
|
53
53
|
useEffect(() => {
|
|
54
54
|
const timer = setInterval(() => {
|
|
55
|
-
setProgress(
|
|
55
|
+
setProgress(prevProgress => {
|
|
56
56
|
if (prevProgress === 100) {
|
|
57
57
|
return 0;
|
|
58
58
|
}
|
|
@@ -6,9 +6,9 @@ export default {
|
|
|
6
6
|
component: RadioGroup,
|
|
7
7
|
} as Meta;
|
|
8
8
|
|
|
9
|
-
const Template: StoryFn =
|
|
9
|
+
const Template: StoryFn = args => (
|
|
10
10
|
<RadioGroup defaultValue="option-1" {...args}>
|
|
11
|
-
{["option-1", "option-2", "option-3"].map(
|
|
11
|
+
{["option-1", "option-2", "option-3"].map(option => (
|
|
12
12
|
<div key={option} className="al-flex al-items-center al-space-x-2">
|
|
13
13
|
<RadioGroupItem value={option} id={option} />
|
|
14
14
|
<label htmlFor={option} className="al-text-sm al-font-medium">
|
|
@@ -31,10 +31,7 @@ export const WithDisabledOption = () => (
|
|
|
31
31
|
</div>
|
|
32
32
|
<div className="flex items-center space-x-2">
|
|
33
33
|
<RadioGroupItem value="option-2" id="option-2" disabled />
|
|
34
|
-
<label
|
|
35
|
-
htmlFor="option-2"
|
|
36
|
-
className="text-sm font-medium text-muted-foreground"
|
|
37
|
-
>
|
|
34
|
+
<label htmlFor="option-2" className="text-sm font-medium text-muted-foreground">
|
|
38
35
|
Option 2 (Disabled)
|
|
39
36
|
</label>
|
|
40
37
|
</div>
|
|
@@ -49,7 +46,7 @@ export const WithDisabledOption = () => (
|
|
|
49
46
|
|
|
50
47
|
export const Horizontal = () => (
|
|
51
48
|
<RadioGroup defaultValue="option-1" className="al-flex al-space-x-4">
|
|
52
|
-
{["option-1", "option-2", "option-3"].map(
|
|
49
|
+
{["option-1", "option-2", "option-3"].map(option => (
|
|
53
50
|
<div key={option} className="al-flex al-items-center al-space-x-2">
|
|
54
51
|
<RadioGroupItem value={option} id={`h-${option}`} />
|
|
55
52
|
<label htmlFor={`h-${option}`} className="al-text-sm al-font-medium">
|
|
@@ -6,17 +6,13 @@ export default {
|
|
|
6
6
|
component: ScrollArea,
|
|
7
7
|
} as Meta;
|
|
8
8
|
|
|
9
|
-
const tags = Array.from({ length: 50 }).map(
|
|
10
|
-
(_, i, a) => `v1.2.0-beta.${a.length - i}`
|
|
11
|
-
);
|
|
9
|
+
const tags = Array.from({ length: 50 }).map((_, i, a) => `v1.2.0-beta.${a.length - i}`);
|
|
12
10
|
|
|
13
11
|
export const Default: StoryFn = () => (
|
|
14
12
|
<ScrollArea className="al-h-72 al-w-48 al-rounded-md al-border">
|
|
15
13
|
<div className="al-p-4">
|
|
16
|
-
<h4 className="al-mb-4 al-text-sm al-font-medium al-leading-none">
|
|
17
|
-
|
|
18
|
-
</h4>
|
|
19
|
-
{tags.map((tag) => (
|
|
14
|
+
<h4 className="al-mb-4 al-text-sm al-font-medium al-leading-none">Tags</h4>
|
|
15
|
+
{tags.map(tag => (
|
|
20
16
|
<div key={tag} className="al-text-sm">
|
|
21
17
|
{tag}
|
|
22
18
|
</div>
|
|
@@ -29,10 +25,7 @@ export const HorizontalScroll: StoryFn = () => (
|
|
|
29
25
|
<ScrollArea className="al-w-96 al-whitespace-nowrap al-rounded-md al-border">
|
|
30
26
|
<div className="al-flex al-w-max al-space-x-4 al-p-4">
|
|
31
27
|
{Array.from({ length: 50 }, (_, i) => (
|
|
32
|
-
<div
|
|
33
|
-
key={i}
|
|
34
|
-
className="al-w-40 al-shrink-0 al-rounded-md al-border al-p-4"
|
|
35
|
-
>
|
|
28
|
+
<div key={i} className="al-w-40 al-shrink-0 al-rounded-md al-border al-p-4">
|
|
36
29
|
<div className="al-text-sm">Item {i + 1}</div>
|
|
37
30
|
</div>
|
|
38
31
|
))}
|
|
@@ -43,15 +36,13 @@ export const HorizontalScroll: StoryFn = () => (
|
|
|
43
36
|
export const WithContent: StoryFn = () => (
|
|
44
37
|
<ScrollArea className="al-h-[300px] al-w-[350px] al-rounded-md al-border al-p-4">
|
|
45
38
|
<div className="al-space-y-4">
|
|
46
|
-
<h4 className="al-text-sm al-font-medium al-leading-none">
|
|
47
|
-
Documentation
|
|
48
|
-
</h4>
|
|
39
|
+
<h4 className="al-text-sm al-font-medium al-leading-none">Documentation</h4>
|
|
49
40
|
{Array.from({ length: 20 }, (_, i) => (
|
|
50
41
|
<div key={i} className="al-text-sm">
|
|
51
42
|
<h5 className="al-mb-1 al-font-medium">Section {i + 1}</h5>
|
|
52
43
|
<p className="al-text-muted-foreground">
|
|
53
|
-
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do
|
|
54
|
-
|
|
44
|
+
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor
|
|
45
|
+
incididunt ut labore et dolore magna aliqua.
|
|
55
46
|
</p>
|
|
56
47
|
</div>
|
|
57
48
|
))}
|
|
@@ -64,15 +55,10 @@ export const WithCard: StoryFn = () => (
|
|
|
64
55
|
<div className="al-p-6">
|
|
65
56
|
<h4 className="al-mb-4 al-text-xl al-font-bold">Recent Activity</h4>
|
|
66
57
|
{Array.from({ length: 20 }, (_, i) => (
|
|
67
|
-
<div
|
|
68
|
-
key={i}
|
|
69
|
-
className="al-mb-4 al-rounded-lg al-border al-p-4 last:al-mb-0"
|
|
70
|
-
>
|
|
58
|
+
<div key={i} className="al-mb-4 al-rounded-lg al-border al-p-4 last:al-mb-0">
|
|
71
59
|
<div className="al-flex al-items-center al-justify-between">
|
|
72
60
|
<div className="al-space-y-1">
|
|
73
|
-
<p className="al-text-sm al-font-medium al-leading-none">
|
|
74
|
-
Activity {i + 1}
|
|
75
|
-
</p>
|
|
61
|
+
<p className="al-text-sm al-font-medium al-leading-none">Activity {i + 1}</p>
|
|
76
62
|
<p className="al-text-sm al-text-muted-foreground">
|
|
77
63
|
This is a description of the activity that occurred.
|
|
78
64
|
</p>
|
|
@@ -90,9 +76,7 @@ export const WithCard: StoryFn = () => (
|
|
|
90
76
|
export const WithNestedContent: StoryFn = () => (
|
|
91
77
|
<ScrollArea className="al-h-[400px] al-w-[600px] al-rounded-lg al-border">
|
|
92
78
|
<div className="al-p-6">
|
|
93
|
-
<h4 className="al-mb-4 al-text-xl al-font-bold">
|
|
94
|
-
Nested Content Example
|
|
95
|
-
</h4>
|
|
79
|
+
<h4 className="al-mb-4 al-text-xl al-font-bold">Nested Content Example</h4>
|
|
96
80
|
<div className="al-grid al-gap-4">
|
|
97
81
|
{Array.from({ length: 5 }, (_, i) => (
|
|
98
82
|
<div key={i} className="al-space-y-2">
|
|
@@ -100,10 +84,7 @@ export const WithNestedContent: StoryFn = () => (
|
|
|
100
84
|
<ScrollArea className="al-h-[150px] al-w-full al-rounded-md al-border">
|
|
101
85
|
<div className="al-p-4">
|
|
102
86
|
{Array.from({ length: 10 }, (_, j) => (
|
|
103
|
-
<div
|
|
104
|
-
key={j}
|
|
105
|
-
className="al-mb-2 al-rounded al-border al-p-2 last:al-mb-0"
|
|
106
|
-
>
|
|
87
|
+
<div key={j} className="al-mb-2 al-rounded al-border al-p-2 last:al-mb-0">
|
|
107
88
|
<p className="al-text-sm">Subsection {j + 1}</p>
|
|
108
89
|
<p className="al-text-xs al-text-muted-foreground">
|
|
109
90
|
Nested scrollable content example.
|
|
@@ -1,12 +1,6 @@
|
|
|
1
1
|
import { Meta, StoryFn } from "@storybook/react";
|
|
2
2
|
import { Button } from "../shadcn";
|
|
3
|
-
import {
|
|
4
|
-
Sheet,
|
|
5
|
-
SheetTrigger,
|
|
6
|
-
SheetContent,
|
|
7
|
-
SheetHeader,
|
|
8
|
-
SheetTitle,
|
|
9
|
-
} from "../shadcn";
|
|
3
|
+
import { Sheet, SheetTrigger, SheetContent, SheetHeader, SheetTitle } from "../shadcn";
|
|
10
4
|
|
|
11
5
|
export default {
|
|
12
6
|
title: "Shadcn/Components/Sheet",
|
|
@@ -5,7 +5,7 @@ export default {
|
|
|
5
5
|
title: "Shadcn/Components/Sidebar",
|
|
6
6
|
component: Sidebar,
|
|
7
7
|
decorators: [
|
|
8
|
-
|
|
8
|
+
Story => (
|
|
9
9
|
<SidebarProvider>
|
|
10
10
|
<Story />
|
|
11
11
|
</SidebarProvider>
|
|
@@ -16,7 +16,7 @@ export default {
|
|
|
16
16
|
},
|
|
17
17
|
} as Meta<typeof Sidebar>;
|
|
18
18
|
|
|
19
|
-
const Template: StoryFn<typeof Sidebar> =
|
|
19
|
+
const Template: StoryFn<typeof Sidebar> = args => (
|
|
20
20
|
<div className="al-h-screen">
|
|
21
21
|
<Sidebar {...args}>
|
|
22
22
|
<div className="al-p-4">
|
|
@@ -67,7 +67,7 @@ CustomStyling.args = {
|
|
|
67
67
|
};
|
|
68
68
|
|
|
69
69
|
// Example with controlled state
|
|
70
|
-
export const ControlledState: StoryFn<typeof Sidebar> =
|
|
70
|
+
export const ControlledState: StoryFn<typeof Sidebar> = args => {
|
|
71
71
|
return (
|
|
72
72
|
<div className="al-h-screen">
|
|
73
73
|
<SidebarProvider defaultOpen={false}>
|
|
@@ -83,7 +83,7 @@ export const ControlledState: StoryFn<typeof Sidebar> = (args) => {
|
|
|
83
83
|
};
|
|
84
84
|
|
|
85
85
|
// Example with mobile view
|
|
86
|
-
export const MobileView: StoryFn<typeof Sidebar> =
|
|
86
|
+
export const MobileView: StoryFn<typeof Sidebar> = args => {
|
|
87
87
|
return (
|
|
88
88
|
<div className="al-h-screen al-w-screen md:al-hidden">
|
|
89
89
|
<Sidebar {...args}>
|
|
@@ -23,7 +23,7 @@ export default {
|
|
|
23
23
|
},
|
|
24
24
|
} as Meta<typeof Slider>;
|
|
25
25
|
|
|
26
|
-
const Template: StoryFn =
|
|
26
|
+
const Template: StoryFn = args => (
|
|
27
27
|
<div className="al-w-[60%] al-space-y-4">
|
|
28
28
|
<Slider {...args} />
|
|
29
29
|
</div>
|
|
@@ -71,9 +71,7 @@ export const WithLabels: StoryFn = () => (
|
|
|
71
71
|
<div className="al-grid al-gap-4 al-pt-4">
|
|
72
72
|
<div className="al-flex al-items-center al-justify-between">
|
|
73
73
|
<label className="al-text-sm al-font-medium">Volume</label>
|
|
74
|
-
<span className="al-w-12 al-rounded-md al-text-right al-text-sm">
|
|
75
|
-
50%
|
|
76
|
-
</span>
|
|
74
|
+
<span className="al-w-12 al-rounded-md al-text-right al-text-sm">50%</span>
|
|
77
75
|
</div>
|
|
78
76
|
<Slider defaultValue={[50]} max={100} step={1} />
|
|
79
77
|
</div>
|
|
@@ -18,7 +18,7 @@ export default {
|
|
|
18
18
|
},
|
|
19
19
|
} as Meta;
|
|
20
20
|
|
|
21
|
-
const Template: StoryFn =
|
|
21
|
+
const Template: StoryFn = args => <Switch {...args} />;
|
|
22
22
|
|
|
23
23
|
export const Default = Template.bind({});
|
|
24
24
|
Default.args = {
|
|
@@ -60,10 +60,7 @@ export const WithDescription: StoryFn = () => (
|
|
|
60
60
|
<div className="al-flex al-flex-col al-space-y-2">
|
|
61
61
|
<div className="al-flex al-items-center al-space-x-2">
|
|
62
62
|
<Switch id="notifications" />
|
|
63
|
-
<label
|
|
64
|
-
htmlFor="notifications"
|
|
65
|
-
className="al-text-sm al-font-medium al-leading-none"
|
|
66
|
-
>
|
|
63
|
+
<label htmlFor="notifications" className="al-text-sm al-font-medium al-leading-none">
|
|
67
64
|
Enable Notifications
|
|
68
65
|
</label>
|
|
69
66
|
</div>
|
|
@@ -77,19 +74,13 @@ export const InForm: StoryFn = () => (
|
|
|
77
74
|
<form className="al-w-full al-max-w-sm">
|
|
78
75
|
<div className="al-flex al-flex-col al-space-y-4">
|
|
79
76
|
<div className="al-flex al-items-center al-justify-between">
|
|
80
|
-
<label
|
|
81
|
-
htmlFor="marketing"
|
|
82
|
-
className="al-text-sm al-font-medium al-leading-none"
|
|
83
|
-
>
|
|
77
|
+
<label htmlFor="marketing" className="al-text-sm al-font-medium al-leading-none">
|
|
84
78
|
Marketing emails
|
|
85
79
|
</label>
|
|
86
80
|
<Switch id="marketing" />
|
|
87
81
|
</div>
|
|
88
82
|
<div className="al-flex al-items-center al-justify-between">
|
|
89
|
-
<label
|
|
90
|
-
htmlFor="newsletter"
|
|
91
|
-
className="al-text-sm al-font-medium al-leading-none"
|
|
92
|
-
>
|
|
83
|
+
<label htmlFor="newsletter" className="al-text-sm al-font-medium al-leading-none">
|
|
93
84
|
Weekly newsletter
|
|
94
85
|
</label>
|
|
95
86
|
<Switch id="newsletter" defaultChecked />
|