@altimateai/ui-components 0.0.1-beta.5 → 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.
- package/dist/CoachForm.js +1 -1
- package/dist/storybook/Accordion.stories.tsx +52 -52
- package/dist/storybook/Alert.stories.tsx +61 -61
- package/dist/storybook/AlertDialog.stories.tsx +161 -161
- package/dist/storybook/Avatar.stories.tsx +58 -58
- package/dist/storybook/Badge.stories.tsx +36 -36
- package/dist/storybook/Button.stories.tsx +109 -109
- package/dist/storybook/Card.stories.tsx +69 -69
- package/dist/storybook/Checkbox.stories.tsx +65 -65
- package/dist/storybook/Command.stories.tsx +35 -35
- package/dist/storybook/DropdownMenu.stories.tsx +36 -36
- package/dist/storybook/Form.stories.tsx +114 -114
- package/dist/storybook/HoverCard.stories.tsx +99 -99
- package/dist/storybook/Input.stories.tsx +53 -53
- package/dist/storybook/Label.stories.tsx +42 -42
- package/dist/storybook/Menubar.stories.tsx +159 -159
- package/dist/storybook/Pagination.stories.tsx +152 -152
- package/dist/storybook/Popover.stories.tsx +23 -23
- package/dist/storybook/Progress.stories.tsx +89 -89
- package/dist/storybook/RadioGroup.stories.tsx +58 -58
- package/dist/storybook/Resizable.stories.tsx +119 -119
- package/dist/storybook/ScrollArea.stories.tsx +101 -101
- package/dist/storybook/Select.stories.tsx +95 -95
- package/dist/storybook/Sheet.stories.tsx +69 -69
- package/dist/storybook/Sidebar.stories.tsx +97 -97
- package/dist/storybook/Slider.stories.tsx +79 -79
- package/dist/storybook/Switch.stories.tsx +90 -90
- package/dist/storybook/Textarea.stories.tsx +50 -50
- package/dist/storybook/Toast.stories.tsx +107 -107
- package/dist/storybook/Tooltip.stories.tsx +28 -28
- package/dist/storybook/Typography.stories.tsx +178 -178
- package/package.json +2 -2
- package/readme.md +11 -11
|
@@ -1,89 +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
|
-
);
|
|
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
|
+
);
|
|
@@ -1,58 +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
|
-
);
|
|
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
|
+
);
|
|
@@ -1,119 +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
|
-
);
|
|
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
|
+
);
|