@altimateai/ui-components 0.0.1-beta.4 → 0.0.1-beta.6

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.
Files changed (40) hide show
  1. package/dist/CoachForm.js +20 -8
  2. package/dist/assets/icons/index.d.ts +96 -0
  3. package/dist/chatbot/index.d.ts +43 -0
  4. package/dist/chatbotV2/index.d.ts +184 -0
  5. package/dist/index.d.ts +215 -0
  6. package/dist/lineage/index.d.ts +189 -0
  7. package/dist/shadcn/index.d.ts +516 -0
  8. package/dist/storybook/Accordion.stories.tsx +52 -0
  9. package/dist/storybook/Alert.stories.tsx +61 -0
  10. package/dist/storybook/AlertDialog.stories.tsx +161 -0
  11. package/dist/storybook/Avatar.stories.tsx +58 -0
  12. package/dist/storybook/Badge.stories.tsx +36 -0
  13. package/dist/storybook/Button.stories.tsx +109 -0
  14. package/dist/storybook/Card.stories.tsx +69 -0
  15. package/dist/storybook/Checkbox.stories.tsx +65 -0
  16. package/dist/storybook/Command.stories.tsx +35 -0
  17. package/dist/storybook/DropdownMenu.stories.tsx +36 -0
  18. package/dist/storybook/Form.stories.tsx +114 -0
  19. package/dist/storybook/HoverCard.stories.tsx +99 -0
  20. package/dist/storybook/Input.stories.tsx +53 -0
  21. package/dist/storybook/Label.stories.tsx +42 -0
  22. package/dist/storybook/Menubar.stories.tsx +159 -0
  23. package/dist/storybook/Pagination.stories.tsx +152 -0
  24. package/dist/storybook/Popover.stories.tsx +23 -0
  25. package/dist/storybook/Progress.stories.tsx +89 -0
  26. package/dist/storybook/RadioGroup.stories.tsx +58 -0
  27. package/dist/storybook/Resizable.stories.tsx +119 -0
  28. package/dist/storybook/ScrollArea.stories.tsx +101 -0
  29. package/dist/storybook/Select.stories.tsx +95 -0
  30. package/dist/storybook/Sheet.stories.tsx +69 -0
  31. package/dist/storybook/Sidebar.stories.tsx +97 -0
  32. package/dist/storybook/Slider.stories.tsx +79 -0
  33. package/dist/storybook/Switch.stories.tsx +90 -0
  34. package/dist/storybook/Textarea.stories.tsx +50 -0
  35. package/dist/storybook/Toast.stories.tsx +107 -0
  36. package/dist/storybook/Tooltip.stories.tsx +28 -0
  37. package/dist/storybook/Typography.stories.tsx +178 -0
  38. package/dist/types-FVWfXDNw.d.ts +104 -0
  39. package/package.json +2 -2
  40. package/readme.md +11 -11
@@ -0,0 +1,89 @@
1
+ import { Meta, StoryFn } from "@storybook/react";
2
+ import { Progress } from "../shadcn";
3
+ import { useEffect, useState } from "react";
4
+
5
+ export default {
6
+ title: "Shadcn/Components/Progress",
7
+ component: Progress,
8
+ argTypes: {
9
+ value: {
10
+ control: { type: "number", min: 0, max: 100 },
11
+ },
12
+ },
13
+ } as Meta;
14
+
15
+ const Template: StoryFn = args => <Progress {...args} />;
16
+
17
+ export const Default = Template.bind({});
18
+ Default.args = {
19
+ value: 40,
20
+ };
21
+
22
+ export const Empty = Template.bind({});
23
+ Empty.args = {
24
+ value: 0,
25
+ };
26
+
27
+ export const Full = Template.bind({});
28
+ Full.args = {
29
+ value: 100,
30
+ };
31
+
32
+ export const CustomStyles: StoryFn = () => (
33
+ <div className="al-space-y-4">
34
+ <Progress value={40} className="al-h-2" />
35
+ <Progress value={60} className="al-h-3 al-bg-secondary/20" />
36
+ <Progress value={80} className="al-h-4 [&>div]:al-bg-green-500" />
37
+ </div>
38
+ );
39
+
40
+ export const WithLabel: StoryFn = () => (
41
+ <div className="al-space-y-2">
42
+ <div className="al-flex al-justify-between al-text-sm">
43
+ <span>Progress</span>
44
+ <span>40%</span>
45
+ </div>
46
+ <Progress value={40} />
47
+ </div>
48
+ );
49
+
50
+ export const Animated: StoryFn = () => {
51
+ const [progress, setProgress] = useState(0);
52
+
53
+ useEffect(() => {
54
+ const timer = setInterval(() => {
55
+ setProgress(prevProgress => {
56
+ if (prevProgress === 100) {
57
+ return 0;
58
+ }
59
+ return Math.min(prevProgress + 10, 100);
60
+ });
61
+ }, 500);
62
+
63
+ return () => {
64
+ clearInterval(timer);
65
+ };
66
+ }, []);
67
+
68
+ return <Progress value={progress} />;
69
+ };
70
+
71
+ export const WithCustomMaxValue: StoryFn = () => (
72
+ <div className="al-space-y-2">
73
+ <div className="al-flex al-justify-between al-text-sm">
74
+ <span>Score</span>
75
+ <span>7/10</span>
76
+ </div>
77
+ <Progress value={7} max={10} />
78
+ </div>
79
+ );
80
+
81
+ export const Loading: StoryFn = () => (
82
+ <div className="al-space-y-2">
83
+ <div className="al-flex al-justify-between al-text-sm">
84
+ <span>Loading...</span>
85
+ <span className="al-text-muted-foreground">Please wait</span>
86
+ </div>
87
+ <Progress value={null} />
88
+ </div>
89
+ );
@@ -0,0 +1,58 @@
1
+ import { Meta, StoryFn } from "@storybook/react";
2
+ import { RadioGroup, RadioGroupItem } from "../shadcn";
3
+
4
+ export default {
5
+ title: "Shadcn/Components/RadioGroup",
6
+ component: RadioGroup,
7
+ } as Meta;
8
+
9
+ const Template: StoryFn = args => (
10
+ <RadioGroup defaultValue="option-1" {...args}>
11
+ {["option-1", "option-2", "option-3"].map(option => (
12
+ <div key={option} className="al-flex al-items-center al-space-x-2">
13
+ <RadioGroupItem value={option} id={option} />
14
+ <label htmlFor={option} className="al-text-sm al-font-medium">
15
+ {option.charAt(0).toUpperCase() + option.slice(1)}
16
+ </label>
17
+ </div>
18
+ ))}
19
+ </RadioGroup>
20
+ );
21
+
22
+ export const Default = Template.bind({});
23
+
24
+ export const WithDisabledOption = () => (
25
+ <RadioGroup defaultValue="option-1">
26
+ <div className="flex items-center space-x-2">
27
+ <RadioGroupItem value="option-1" id="option-1" />
28
+ <label htmlFor="option-1" className="text-sm font-medium">
29
+ Option 1
30
+ </label>
31
+ </div>
32
+ <div className="flex items-center space-x-2">
33
+ <RadioGroupItem value="option-2" id="option-2" disabled />
34
+ <label htmlFor="option-2" className="text-sm font-medium text-muted-foreground">
35
+ Option 2 (Disabled)
36
+ </label>
37
+ </div>
38
+ <div className="flex items-center space-x-2">
39
+ <RadioGroupItem value="option-3" id="option-3" />
40
+ <label htmlFor="option-3" className="text-sm font-medium">
41
+ Option 3
42
+ </label>
43
+ </div>
44
+ </RadioGroup>
45
+ );
46
+
47
+ export const Horizontal = () => (
48
+ <RadioGroup defaultValue="option-1" className="al-flex al-space-x-4">
49
+ {["option-1", "option-2", "option-3"].map(option => (
50
+ <div key={option} className="al-flex al-items-center al-space-x-2">
51
+ <RadioGroupItem value={option} id={`h-${option}`} />
52
+ <label htmlFor={`h-${option}`} className="al-text-sm al-font-medium">
53
+ {option.charAt(0).toUpperCase() + option.slice(1)}
54
+ </label>
55
+ </div>
56
+ ))}
57
+ </RadioGroup>
58
+ );
@@ -0,0 +1,119 @@
1
+ import { Meta, StoryFn } from "@storybook/react";
2
+ import { ResizablePanelGroup, ResizablePanel, ResizableHandle } from "../shadcn";
3
+
4
+ export default {
5
+ title: "Shadcn/Components/Resizable",
6
+ component: ResizablePanelGroup,
7
+ } as Meta;
8
+
9
+ export const HorizontalLayout: StoryFn = () => (
10
+ <div className="al-h-[400px] al-max-w-[800px] al-rounded-lg al-border">
11
+ <ResizablePanelGroup direction="horizontal">
12
+ <ResizablePanel defaultSize={25}>
13
+ <div className="al-flex al-h-full al-items-center al-justify-center al-p-6">
14
+ <span className="al-font-semibold">Sidebar</span>
15
+ </div>
16
+ </ResizablePanel>
17
+ <ResizableHandle withHandle />
18
+ <ResizablePanel defaultSize={75}>
19
+ <div className="al-flex al-h-full al-items-center al-justify-center al-p-6">
20
+ <span className="al-font-semibold">Content</span>
21
+ </div>
22
+ </ResizablePanel>
23
+ </ResizablePanelGroup>
24
+ </div>
25
+ );
26
+
27
+ export const VerticalLayout: StoryFn = () => (
28
+ <div className="al-h-[400px] al-max-w-[800px] al-rounded-lg al-border">
29
+ <ResizablePanelGroup direction="vertical">
30
+ <ResizablePanel defaultSize={25}>
31
+ <div className="al-flex al-h-full al-items-center al-justify-center al-p-6">
32
+ <span className="al-font-semibold">Header</span>
33
+ </div>
34
+ </ResizablePanel>
35
+ <ResizableHandle withHandle />
36
+ <ResizablePanel defaultSize={75}>
37
+ <div className="al-flex al-h-full al-items-center al-justify-center al-p-6">
38
+ <span className="al-font-semibold">Content</span>
39
+ </div>
40
+ </ResizablePanel>
41
+ </ResizablePanelGroup>
42
+ </div>
43
+ );
44
+
45
+ export const ThreePanels: StoryFn = () => (
46
+ <div className="al-h-[400px] al-max-w-[800px] al-rounded-lg al-border">
47
+ <ResizablePanelGroup direction="horizontal">
48
+ <ResizablePanel defaultSize={20}>
49
+ <div className="al-flex al-h-full al-items-center al-justify-center al-p-6">
50
+ <span className="al-font-semibold">Navigation</span>
51
+ </div>
52
+ </ResizablePanel>
53
+ <ResizableHandle withHandle />
54
+ <ResizablePanel defaultSize={60}>
55
+ <div className="al-flex al-h-full al-items-center al-justify-center al-p-6">
56
+ <span className="al-font-semibold">Content</span>
57
+ </div>
58
+ </ResizablePanel>
59
+ <ResizableHandle withHandle />
60
+ <ResizablePanel defaultSize={20}>
61
+ <div className="al-flex al-h-full al-items-center al-justify-center al-p-6">
62
+ <span className="al-font-semibold">Properties</span>
63
+ </div>
64
+ </ResizablePanel>
65
+ </ResizablePanelGroup>
66
+ </div>
67
+ );
68
+
69
+ export const NestedPanels: StoryFn = () => (
70
+ <div className="al-h-[400px] al-max-w-[800px] al-rounded-lg al-border">
71
+ <ResizablePanelGroup direction="horizontal">
72
+ <ResizablePanel defaultSize={30}>
73
+ <div className="al-flex al-h-full al-items-center al-justify-center al-p-6">
74
+ <span className="al-font-semibold">Sidebar</span>
75
+ </div>
76
+ </ResizablePanel>
77
+ <ResizableHandle withHandle />
78
+ <ResizablePanel defaultSize={70}>
79
+ <ResizablePanelGroup direction="vertical">
80
+ <ResizablePanel defaultSize={70}>
81
+ <div className="al-flex al-h-full al-items-center al-justify-center al-p-6">
82
+ <span className="al-font-semibold">Main Content</span>
83
+ </div>
84
+ </ResizablePanel>
85
+ <ResizableHandle withHandle />
86
+ <ResizablePanel defaultSize={30}>
87
+ <div className="al-flex al-h-full al-items-center al-justify-center al-p-6">
88
+ <span className="al-font-semibold">Console</span>
89
+ </div>
90
+ </ResizablePanel>
91
+ </ResizablePanelGroup>
92
+ </ResizablePanel>
93
+ </ResizablePanelGroup>
94
+ </div>
95
+ );
96
+
97
+ export const WithMinSize: StoryFn = () => (
98
+ <div className="al-h-[400px] al-max-w-[800px] al-rounded-lg al-border">
99
+ <ResizablePanelGroup direction="horizontal">
100
+ <ResizablePanel defaultSize={25} minSize={20}>
101
+ <div className="al-flex al-h-full al-items-center al-justify-center al-p-6">
102
+ <span className="al-font-semibold">Min 20%</span>
103
+ </div>
104
+ </ResizablePanel>
105
+ <ResizableHandle withHandle />
106
+ <ResizablePanel defaultSize={50}>
107
+ <div className="al-flex al-h-full al-items-center al-justify-center al-p-6">
108
+ <span className="al-font-semibold">Flexible</span>
109
+ </div>
110
+ </ResizablePanel>
111
+ <ResizableHandle withHandle />
112
+ <ResizablePanel defaultSize={25} minSize={15}>
113
+ <div className="al-flex al-h-full al-items-center al-justify-center al-p-6">
114
+ <span className="al-font-semibold">Min 15%</span>
115
+ </div>
116
+ </ResizablePanel>
117
+ </ResizablePanelGroup>
118
+ </div>
119
+ );
@@ -0,0 +1,101 @@
1
+ import { Meta, StoryFn } from "@storybook/react";
2
+ import { ScrollArea } from "../shadcn";
3
+
4
+ export default {
5
+ title: "Shadcn/Components/ScrollArea",
6
+ component: ScrollArea,
7
+ } as Meta;
8
+
9
+ const tags = Array.from({ length: 50 }).map((_, i, a) => `v1.2.0-beta.${a.length - i}`);
10
+
11
+ export const Default: StoryFn = () => (
12
+ <ScrollArea className="al-h-72 al-w-48 al-rounded-md al-border">
13
+ <div className="al-p-4">
14
+ <h4 className="al-mb-4 al-text-sm al-font-medium al-leading-none">Tags</h4>
15
+ {tags.map(tag => (
16
+ <div key={tag} className="al-text-sm">
17
+ {tag}
18
+ </div>
19
+ ))}
20
+ </div>
21
+ </ScrollArea>
22
+ );
23
+
24
+ export const HorizontalScroll: StoryFn = () => (
25
+ <ScrollArea className="al-w-96 al-whitespace-nowrap al-rounded-md al-border">
26
+ <div className="al-flex al-w-max al-space-x-4 al-p-4">
27
+ {Array.from({ length: 50 }, (_, i) => (
28
+ <div key={i} className="al-w-40 al-shrink-0 al-rounded-md al-border al-p-4">
29
+ <div className="al-text-sm">Item {i + 1}</div>
30
+ </div>
31
+ ))}
32
+ </div>
33
+ </ScrollArea>
34
+ );
35
+
36
+ export const WithContent: StoryFn = () => (
37
+ <ScrollArea className="al-h-[300px] al-w-[350px] al-rounded-md al-border al-p-4">
38
+ <div className="al-space-y-4">
39
+ <h4 className="al-text-sm al-font-medium al-leading-none">Documentation</h4>
40
+ {Array.from({ length: 20 }, (_, i) => (
41
+ <div key={i} className="al-text-sm">
42
+ <h5 className="al-mb-1 al-font-medium">Section {i + 1}</h5>
43
+ <p className="al-text-muted-foreground">
44
+ Lorem ipsum dolor sit amet, consectetur adipiscing elit. Sed do eiusmod tempor
45
+ incididunt ut labore et dolore magna aliqua.
46
+ </p>
47
+ </div>
48
+ ))}
49
+ </div>
50
+ </ScrollArea>
51
+ );
52
+
53
+ export const WithCard: StoryFn = () => (
54
+ <ScrollArea className="al-h-[300px] al-w-[600px] al-rounded-lg al-border">
55
+ <div className="al-p-6">
56
+ <h4 className="al-mb-4 al-text-xl al-font-bold">Recent Activity</h4>
57
+ {Array.from({ length: 20 }, (_, i) => (
58
+ <div key={i} className="al-mb-4 al-rounded-lg al-border al-p-4 last:al-mb-0">
59
+ <div className="al-flex al-items-center al-justify-between">
60
+ <div className="al-space-y-1">
61
+ <p className="al-text-sm al-font-medium al-leading-none">Activity {i + 1}</p>
62
+ <p className="al-text-sm al-text-muted-foreground">
63
+ This is a description of the activity that occurred.
64
+ </p>
65
+ </div>
66
+ <div className="al-text-sm al-text-muted-foreground">
67
+ {new Date().toLocaleDateString()}
68
+ </div>
69
+ </div>
70
+ </div>
71
+ ))}
72
+ </div>
73
+ </ScrollArea>
74
+ );
75
+
76
+ export const WithNestedContent: StoryFn = () => (
77
+ <ScrollArea className="al-h-[400px] al-w-[600px] al-rounded-lg al-border">
78
+ <div className="al-p-6">
79
+ <h4 className="al-mb-4 al-text-xl al-font-bold">Nested Content Example</h4>
80
+ <div className="al-grid al-gap-4">
81
+ {Array.from({ length: 5 }, (_, i) => (
82
+ <div key={i} className="al-space-y-2">
83
+ <h5 className="al-text-lg al-font-semibold">Section {i + 1}</h5>
84
+ <ScrollArea className="al-h-[150px] al-w-full al-rounded-md al-border">
85
+ <div className="al-p-4">
86
+ {Array.from({ length: 10 }, (_, j) => (
87
+ <div key={j} className="al-mb-2 al-rounded al-border al-p-2 last:al-mb-0">
88
+ <p className="al-text-sm">Subsection {j + 1}</p>
89
+ <p className="al-text-xs al-text-muted-foreground">
90
+ Nested scrollable content example.
91
+ </p>
92
+ </div>
93
+ ))}
94
+ </div>
95
+ </ScrollArea>
96
+ </div>
97
+ ))}
98
+ </div>
99
+ </div>
100
+ </ScrollArea>
101
+ );
@@ -0,0 +1,95 @@
1
+ import { Meta, StoryFn } from "@storybook/react";
2
+ import {
3
+ Select,
4
+ SelectTrigger,
5
+ SelectContent,
6
+ SelectItem,
7
+ SelectValue,
8
+ SelectGroup,
9
+ SelectLabel,
10
+ SelectSeparator,
11
+ } from "../shadcn";
12
+
13
+ export default {
14
+ title: "Shadcn/Components/Select",
15
+ component: Select,
16
+ } as Meta;
17
+
18
+ const Template: StoryFn = args => (
19
+ <Select {...args}>
20
+ <SelectTrigger>
21
+ <SelectValue placeholder="Select an option" />
22
+ </SelectTrigger>
23
+ <SelectContent>
24
+ <SelectItem value="option1">Option 1</SelectItem>
25
+ <SelectItem value="option2">Option 2</SelectItem>
26
+ <SelectItem value="option3">Option 3</SelectItem>
27
+ </SelectContent>
28
+ </Select>
29
+ );
30
+
31
+ export const Default = Template.bind({});
32
+
33
+ export const WithGroups: StoryFn = () => (
34
+ <Select>
35
+ <SelectTrigger className="al-w-[280px]">
36
+ <SelectValue placeholder="Select a fruit" />
37
+ </SelectTrigger>
38
+ <SelectContent>
39
+ <SelectGroup>
40
+ <SelectLabel>Fruits</SelectLabel>
41
+ <SelectItem value="apple">Apple</SelectItem>
42
+ <SelectItem value="banana">Banana</SelectItem>
43
+ <SelectItem value="orange">Orange</SelectItem>
44
+ </SelectGroup>
45
+ <SelectSeparator />
46
+ <SelectGroup>
47
+ <SelectLabel>Vegetables</SelectLabel>
48
+ <SelectItem value="carrot">Carrot</SelectItem>
49
+ <SelectItem value="potato">Potato</SelectItem>
50
+ <SelectItem value="tomato">Tomato</SelectItem>
51
+ </SelectGroup>
52
+ </SelectContent>
53
+ </Select>
54
+ );
55
+
56
+ export const Disabled: StoryFn = () => (
57
+ <Select disabled>
58
+ <SelectTrigger className="al-w-[280px]">
59
+ <SelectValue placeholder="Select an option" />
60
+ </SelectTrigger>
61
+ <SelectContent>
62
+ <SelectItem value="option1">Option 1</SelectItem>
63
+ <SelectItem value="option2">Option 2</SelectItem>
64
+ <SelectItem value="option3">Option 3</SelectItem>
65
+ </SelectContent>
66
+ </Select>
67
+ );
68
+
69
+ export const WithDisabledOptions: StoryFn = () => (
70
+ <Select>
71
+ <SelectTrigger className="al-w-[280px]">
72
+ <SelectValue placeholder="Select an option" />
73
+ </SelectTrigger>
74
+ <SelectContent>
75
+ <SelectItem value="option1">Option 1</SelectItem>
76
+ <SelectItem value="option2" disabled>
77
+ Option 2 (Disabled)
78
+ </SelectItem>
79
+ <SelectItem value="option3">Option 3</SelectItem>
80
+ </SelectContent>
81
+ </Select>
82
+ );
83
+
84
+ export const WithDefaultValue: StoryFn = () => (
85
+ <Select defaultValue="option2">
86
+ <SelectTrigger className="al-w-[280px]">
87
+ <SelectValue />
88
+ </SelectTrigger>
89
+ <SelectContent>
90
+ <SelectItem value="option1">Option 1</SelectItem>
91
+ <SelectItem value="option2">Option 2</SelectItem>
92
+ <SelectItem value="option3">Option 3</SelectItem>
93
+ </SelectContent>
94
+ </Select>
95
+ );
@@ -0,0 +1,69 @@
1
+ import { Meta, StoryFn } from "@storybook/react";
2
+ import { Button } from "../shadcn";
3
+ import { Sheet, SheetTrigger, SheetContent, SheetHeader, SheetTitle } from "../shadcn";
4
+
5
+ export default {
6
+ title: "Shadcn/Components/Sheet",
7
+ component: Sheet,
8
+ argTypes: {
9
+ side: {
10
+ control: "select",
11
+ options: ["top", "right", "bottom", "left"],
12
+ },
13
+ },
14
+ } as Meta;
15
+
16
+ const Template: StoryFn = ({ side = "right" }) => (
17
+ <Sheet>
18
+ <SheetTrigger asChild>
19
+ <Button variant="outline">Open Sheet</Button>
20
+ </SheetTrigger>
21
+ <SheetContent side={side}>
22
+ <SheetHeader>
23
+ <SheetTitle>Sheet Title</SheetTitle>
24
+ </SheetHeader>
25
+ <div className="al-py-4">
26
+ <p>This is the sheet content.</p>
27
+ </div>
28
+ </SheetContent>
29
+ </Sheet>
30
+ );
31
+
32
+ export const Default = Template.bind({});
33
+
34
+ export const LeftSide = Template.bind({});
35
+ LeftSide.args = {
36
+ side: "left",
37
+ };
38
+
39
+ export const TopSide = Template.bind({});
40
+ TopSide.args = {
41
+ side: "top",
42
+ };
43
+
44
+ export const BottomSide = Template.bind({});
45
+ BottomSide.args = {
46
+ side: "bottom",
47
+ };
48
+
49
+ export const WithForm = () => (
50
+ <Sheet>
51
+ <SheetTrigger asChild>
52
+ <Button variant="outline">Edit Profile</Button>
53
+ </SheetTrigger>
54
+ <SheetContent>
55
+ <SheetHeader>
56
+ <SheetTitle>Edit Profile</SheetTitle>
57
+ </SheetHeader>
58
+ <div className="al-grid al-gap-4 al-py-4">
59
+ <div className="al-grid al-gap-2">
60
+ <label htmlFor="name">Name</label>
61
+ <input id="name" className="al-border al-rounded al-p-2" />
62
+ </div>
63
+ </div>
64
+ <div className="al-flex al-justify-end">
65
+ <Button>Save Changes</Button>
66
+ </div>
67
+ </SheetContent>
68
+ </Sheet>
69
+ );
@@ -0,0 +1,97 @@
1
+ import type { Meta, StoryFn } from "@storybook/react";
2
+ import { Sidebar, SidebarProvider } from "../shadcn";
3
+
4
+ export default {
5
+ title: "Shadcn/Components/Sidebar",
6
+ component: Sidebar,
7
+ decorators: [
8
+ Story => (
9
+ <SidebarProvider>
10
+ <Story />
11
+ </SidebarProvider>
12
+ ),
13
+ ],
14
+ parameters: {
15
+ layout: "fullscreen",
16
+ },
17
+ } as Meta<typeof Sidebar>;
18
+
19
+ const Template: StoryFn<typeof Sidebar> = args => (
20
+ <div className="al-h-screen">
21
+ <Sidebar {...args}>
22
+ <div className="al-p-4">
23
+ <h2 className="al-text-lg al-font-semibold">Sidebar Content</h2>
24
+ <p className="al-mt-2">This is an example of sidebar content.</p>
25
+ <ul className="al-mt-4 al-space-y-2">
26
+ <li>Menu Item 1</li>
27
+ <li>Menu Item 2</li>
28
+ <li>Menu Item 3</li>
29
+ </ul>
30
+ </div>
31
+ </Sidebar>
32
+ </div>
33
+ );
34
+
35
+ export const Default = Template.bind({});
36
+ Default.args = {};
37
+
38
+ export const RightSide = Template.bind({});
39
+ RightSide.args = {
40
+ side: "right",
41
+ };
42
+
43
+ export const FloatingVariant = Template.bind({});
44
+ FloatingVariant.args = {
45
+ variant: "floating",
46
+ };
47
+
48
+ export const InsetVariant = Template.bind({});
49
+ InsetVariant.args = {
50
+ variant: "inset",
51
+ };
52
+
53
+ export const IconCollapsible = Template.bind({});
54
+ IconCollapsible.args = {
55
+ collapsible: "icon",
56
+ };
57
+
58
+ export const NonCollapsible = Template.bind({});
59
+ NonCollapsible.args = {
60
+ collapsible: "none",
61
+ };
62
+
63
+ // Example with custom content and styling
64
+ export const CustomStyling = Template.bind({});
65
+ CustomStyling.args = {
66
+ className: "al-bg-primary al-text-primary-foreground",
67
+ };
68
+
69
+ // Example with controlled state
70
+ export const ControlledState: StoryFn<typeof Sidebar> = args => {
71
+ return (
72
+ <div className="al-h-screen">
73
+ <SidebarProvider defaultOpen={false}>
74
+ <Sidebar {...args}>
75
+ <div className="al-p-4">
76
+ <h2 className="al-text-lg al-font-semibold">Controlled Sidebar</h2>
77
+ <p className="al-mt-2">This sidebar starts in a collapsed state.</p>
78
+ </div>
79
+ </Sidebar>
80
+ </SidebarProvider>
81
+ </div>
82
+ );
83
+ };
84
+
85
+ // Example with mobile view
86
+ export const MobileView: StoryFn<typeof Sidebar> = args => {
87
+ return (
88
+ <div className="al-h-screen al-w-screen md:al-hidden">
89
+ <Sidebar {...args}>
90
+ <div className="al-p-4">
91
+ <h2 className="al-text-lg al-font-semibold">Mobile Sidebar</h2>
92
+ <p className="al-mt-2">This sidebar is optimized for mobile view.</p>
93
+ </div>
94
+ </Sidebar>
95
+ </div>
96
+ );
97
+ };