@syscore/ui-library 1.1.10 → 1.1.11
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/client/App.tsx +47 -0
- package/client/components/icons/ConceptIcons.tsx +667 -0
- package/client/components/icons/NavAccount.tsx +31 -0
- package/client/components/icons/NavBullet.tsx +19 -0
- package/client/components/icons/NavLogo.tsx +36 -0
- package/client/components/icons/ProviderBadges.tsx +295 -0
- package/client/components/icons/ProviderSeals.tsx +319 -0
- package/client/components/icons/SealHealthSafetyRating.tsx +65 -0
- package/client/components/icons/SealIwbiMember.tsx +86 -0
- package/client/components/icons/SealWell.tsx +84 -0
- package/client/components/icons/SealWellCertification.tsx +138 -0
- package/client/components/icons/SealWellCommunity.tsx +122 -0
- package/client/components/icons/SealWellResidence.tsx +122 -0
- package/client/components/icons/SealWorksWithWell.tsx +140 -0
- package/client/components/icons/UtilityAccordion.tsx +21 -0
- package/client/components/icons/UtilityChevronDown.tsx +36 -0
- package/client/components/icons/UtilityClassification.tsx +45 -0
- package/client/components/icons/UtilityClose.tsx +41 -0
- package/client/components/icons/UtilityDrag.tsx +69 -0
- package/client/components/icons/UtilityEdit.tsx +42 -0
- package/client/components/icons/UtilityOptions.tsx +45 -0
- package/client/components/icons/UtilityPortfolio.tsx +87 -0
- package/client/components/icons/UtilityReset.tsx +41 -0
- package/client/components/icons/UtilityScoring.tsx +43 -0
- package/client/components/icons/UtilitySearch.tsx +38 -0
- package/client/components/icons/UtilitySort.tsx +52 -0
- package/client/components/icons/UtilityText.tsx +34 -0
- package/client/components/icons/WaterMarkWWWProducts.tsx +26 -0
- package/client/components/icons/WaterMarkWellProjects.tsx +30 -0
- package/client/components/icons/WatermarkMemberOrg.tsx +59 -0
- package/client/components/icons/WellSeal.tsx +79 -0
- package/client/components/icons/X.tsx +35 -0
- package/client/hooks/UseTabs.tsx +35 -0
- package/client/hooks/use-mobile.tsx +21 -0
- package/client/hooks/use-segmented-control.ts +42 -0
- package/client/hooks/use-toast.ts +188 -0
- package/client/pages/Index.tsx +88 -0
- package/client/pages/NotFound.tsx +29 -0
- package/client/ui/Accordion/Accordion.stories.tsx +74 -0
- package/client/ui/Alert/Alert.stories.tsx +82 -0
- package/client/ui/AlertDialog/AlertDialog.stories.tsx +106 -0
- package/client/ui/AspectRatio.stories.tsx +78 -0
- package/client/ui/Avatar/Avatar.stories.tsx +94 -0
- package/client/ui/Badge/Badge.stories.tsx +60 -0
- package/client/ui/Breadcrumb/Breadcrumb.stories.tsx +97 -0
- package/client/ui/Button.stories.tsx +429 -0
- package/client/ui/Calendar/Calendar.stories.tsx +99 -0
- package/client/ui/Card.stories.tsx +84 -0
- package/client/ui/Carousel/Carousel.stories.tsx +85 -0
- package/client/ui/Chart/Chart.stories.tsx +58 -0
- package/client/ui/Checkbox/Checkbox.stories.tsx +112 -0
- package/client/ui/Collapsible/Collapsible.stories.tsx +101 -0
- package/client/ui/Colors.stories.tsx +1041 -0
- package/client/ui/Command/Command.stories.tsx +97 -0
- package/client/ui/ContextMenu/ContextMenu.stories.tsx +74 -0
- package/client/ui/Dialog.stories.tsx +69 -0
- package/client/ui/Drawer/Drawer.stories.tsx +87 -0
- package/client/ui/DropdownMenu/DropdownMenu.stories.tsx +139 -0
- package/client/ui/Form/Form.stories.tsx +74 -0
- package/client/ui/HoverCard/HoverCard.stories.tsx +94 -0
- package/client/ui/Icons.stories.tsx +328 -0
- package/client/ui/Input/Input.stories.tsx +69 -0
- package/client/ui/InputOTP/InputOTP.stories.tsx +85 -0
- package/client/ui/Label.stories.tsx +66 -0
- package/client/ui/Menubar/Menubar.stories.tsx +88 -0
- package/client/ui/Navigation.stories.tsx +57 -0
- package/client/ui/NavigationMenu/NavigationMenu.stories.tsx +106 -0
- package/client/ui/Pagination/Pagination.stories.tsx +115 -0
- package/client/ui/Popover/Popover.stories.tsx +99 -0
- package/client/ui/Progress/Progress.stories.tsx +63 -0
- package/client/ui/RadioGroup/RadioGroup.stories.tsx +110 -0
- package/client/ui/Resizable/Resizable.stories.tsx +88 -0
- package/client/ui/ScrollArea/ScrollArea.stories.tsx +64 -0
- package/client/ui/SearchField.stories.tsx +63 -0
- package/client/ui/Select/Select.stories.tsx +111 -0
- package/client/ui/Separator/Separator.stories.tsx +67 -0
- package/client/ui/Sheet/Sheet.stories.tsx +138 -0
- package/client/ui/Sidebar/Sidebar.stories.tsx +92 -0
- package/client/ui/Skeleton/Skeleton.stories.tsx +65 -0
- package/client/ui/Slider/Slider.stories.tsx +101 -0
- package/client/ui/Sonner/Sonner.stories.tsx +48 -0
- package/client/ui/StrategyTable.stories.tsx +138 -0
- package/client/ui/Switch/Switch.stories.tsx +96 -0
- package/client/ui/Table/Table.stories.tsx +135 -0
- package/client/ui/Tabs.stories.tsx +33 -0
- package/client/ui/Tag.stories.tsx +190 -0
- package/client/ui/Textarea/Textarea.stories.tsx +56 -0
- package/client/ui/Toast/Toast.stories.tsx +76 -0
- package/client/ui/Toaster/Toaster.stories.tsx +52 -0
- package/client/ui/Toggle.stories.tsx +248 -0
- package/client/ui/ToggleGroup/ToggleGroup.stories.tsx +88 -0
- package/client/ui/Tooltip.stories.tsx +72 -0
- package/client/ui/Typography.stories.tsx +421 -0
- package/client/ui/WELLDashboard/WELLDashboard.stories.tsx +115 -0
- package/client/ui/WELLDashboard/index.tsx +221 -0
- package/client/vite-env.d.ts +1 -0
- package/dist/ui/index.cjs.js +1 -1
- package/dist/ui/index.d.ts +1 -0
- package/dist/ui/index.es.js +163 -1
- package/package.json +2 -1
|
@@ -0,0 +1,101 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Slider } from "../../components/ui/slider";
|
|
3
|
+
import { useState } from "react";
|
|
4
|
+
|
|
5
|
+
const meta = {
|
|
6
|
+
title: "UI/Slider",
|
|
7
|
+
component: Slider,
|
|
8
|
+
tags: ["autodocs"],
|
|
9
|
+
parameters: {
|
|
10
|
+
layout: "padded",
|
|
11
|
+
},
|
|
12
|
+
} satisfies Meta<typeof Slider>;
|
|
13
|
+
|
|
14
|
+
export default meta;
|
|
15
|
+
|
|
16
|
+
type Story = StoryObj<typeof meta>;
|
|
17
|
+
|
|
18
|
+
export const Default: Story = {
|
|
19
|
+
render: () => {
|
|
20
|
+
const [value, setValue] = useState([50]);
|
|
21
|
+
return (
|
|
22
|
+
<div className="w-full max-w-md space-y-4">
|
|
23
|
+
<Slider
|
|
24
|
+
value={value}
|
|
25
|
+
onValueChange={setValue}
|
|
26
|
+
min={0}
|
|
27
|
+
max={100}
|
|
28
|
+
step={1}
|
|
29
|
+
/>
|
|
30
|
+
<p className="text-sm text-gray-600">Value: {value[0]}</p>
|
|
31
|
+
</div>
|
|
32
|
+
);
|
|
33
|
+
},
|
|
34
|
+
};
|
|
35
|
+
|
|
36
|
+
export const Range: Story = {
|
|
37
|
+
render: () => {
|
|
38
|
+
const [value, setValue] = useState([20, 80]);
|
|
39
|
+
return (
|
|
40
|
+
<div className="w-full max-w-md space-y-4">
|
|
41
|
+
<Slider
|
|
42
|
+
value={value}
|
|
43
|
+
onValueChange={setValue}
|
|
44
|
+
min={0}
|
|
45
|
+
max={100}
|
|
46
|
+
step={1}
|
|
47
|
+
/>
|
|
48
|
+
<p className="text-sm text-gray-600">
|
|
49
|
+
Range: {value[0]} - {value[1]}
|
|
50
|
+
</p>
|
|
51
|
+
</div>
|
|
52
|
+
);
|
|
53
|
+
},
|
|
54
|
+
};
|
|
55
|
+
|
|
56
|
+
export const WithSteps: Story = {
|
|
57
|
+
render: () => {
|
|
58
|
+
const [value, setValue] = useState([50]);
|
|
59
|
+
const steps = [0, 25, 50, 75, 100];
|
|
60
|
+
return (
|
|
61
|
+
<div className="w-full max-w-md space-y-4">
|
|
62
|
+
<Slider
|
|
63
|
+
value={value}
|
|
64
|
+
onValueChange={setValue}
|
|
65
|
+
min={0}
|
|
66
|
+
max={100}
|
|
67
|
+
step={25}
|
|
68
|
+
/>
|
|
69
|
+
<div className="flex justify-between text-xs text-gray-600">
|
|
70
|
+
{steps.map((step) => (
|
|
71
|
+
<span key={step}>{step}</span>
|
|
72
|
+
))}
|
|
73
|
+
</div>
|
|
74
|
+
<p className="text-sm text-gray-600">Value: {value[0]}</p>
|
|
75
|
+
</div>
|
|
76
|
+
);
|
|
77
|
+
},
|
|
78
|
+
};
|
|
79
|
+
|
|
80
|
+
export const Price: Story = {
|
|
81
|
+
render: () => {
|
|
82
|
+
const [value, setValue] = useState([250, 750]);
|
|
83
|
+
return (
|
|
84
|
+
<div className="w-full max-w-md space-y-4">
|
|
85
|
+
<Slider
|
|
86
|
+
value={value}
|
|
87
|
+
onValueChange={setValue}
|
|
88
|
+
min={0}
|
|
89
|
+
max={1000}
|
|
90
|
+
step={10}
|
|
91
|
+
/>
|
|
92
|
+
<div className="flex justify-between items-center">
|
|
93
|
+
<p className="text-sm font-medium">Price Range</p>
|
|
94
|
+
<p className="text-sm font-medium">
|
|
95
|
+
${value[0]} - ${value[1]}
|
|
96
|
+
</p>
|
|
97
|
+
</div>
|
|
98
|
+
</div>
|
|
99
|
+
);
|
|
100
|
+
},
|
|
101
|
+
};
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
|
|
3
|
+
const meta = {
|
|
4
|
+
title: "UI/Sonner",
|
|
5
|
+
tags: ["autodocs"],
|
|
6
|
+
parameters: {
|
|
7
|
+
layout: "centered",
|
|
8
|
+
},
|
|
9
|
+
};
|
|
10
|
+
|
|
11
|
+
export default meta;
|
|
12
|
+
|
|
13
|
+
type Story = StoryObj;
|
|
14
|
+
|
|
15
|
+
export const Default: Story = {
|
|
16
|
+
render: () => (
|
|
17
|
+
<div className="p-4 border rounded-lg max-w-md">
|
|
18
|
+
<h3 className="font-semibold mb-2">Sonner Toast Component</h3>
|
|
19
|
+
<p className="text-sm text-gray-600 mb-4">
|
|
20
|
+
Sonner is a toast notification library for React. This component can be
|
|
21
|
+
configured to show various types of notifications.
|
|
22
|
+
</p>
|
|
23
|
+
<div className="space-y-2">
|
|
24
|
+
<button className="w-full px-4 py-2 text-sm bg-blue-600 text-white rounded hover:bg-blue-700">
|
|
25
|
+
Show Success
|
|
26
|
+
</button>
|
|
27
|
+
<button className="w-full px-4 py-2 text-sm bg-red-600 text-white rounded hover:bg-red-700">
|
|
28
|
+
Show Error
|
|
29
|
+
</button>
|
|
30
|
+
<button className="w-full px-4 py-2 text-sm bg-yellow-600 text-white rounded hover:bg-yellow-700">
|
|
31
|
+
Show Warning
|
|
32
|
+
</button>
|
|
33
|
+
</div>
|
|
34
|
+
</div>
|
|
35
|
+
),
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
export const Info: Story = {
|
|
39
|
+
render: () => (
|
|
40
|
+
<div className="p-4 bg-blue-50 border border-blue-200 rounded-lg max-w-md">
|
|
41
|
+
<h4 className="font-medium text-blue-900 mb-1">Info</h4>
|
|
42
|
+
<p className="text-sm text-blue-800">
|
|
43
|
+
Sonner provides a simple way to display notifications to users with
|
|
44
|
+
various positions and configurations.
|
|
45
|
+
</p>
|
|
46
|
+
</div>
|
|
47
|
+
),
|
|
48
|
+
};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { StrategyTable } from "@/components/ui/StrategyTable";
|
|
3
|
+
import {
|
|
4
|
+
IconConceptMind,
|
|
5
|
+
IconConceptCommunity,
|
|
6
|
+
IconConceptMovement,
|
|
7
|
+
} from "@/components/icons/ConceptIcons";
|
|
8
|
+
|
|
9
|
+
const meta = {
|
|
10
|
+
title: "Review/StrategyTable",
|
|
11
|
+
component: StrategyTable,
|
|
12
|
+
tags: ["autodocs"],
|
|
13
|
+
parameters: {
|
|
14
|
+
layout: "padded",
|
|
15
|
+
},
|
|
16
|
+
} satisfies Meta<typeof StrategyTable>;
|
|
17
|
+
|
|
18
|
+
export default meta;
|
|
19
|
+
|
|
20
|
+
type Story = StoryObj<typeof meta>;
|
|
21
|
+
|
|
22
|
+
const mockData = [
|
|
23
|
+
{
|
|
24
|
+
concept: {
|
|
25
|
+
id: "mind",
|
|
26
|
+
type: "mind" as const,
|
|
27
|
+
name: "Mind",
|
|
28
|
+
icon: <IconConceptMind />,
|
|
29
|
+
},
|
|
30
|
+
theme: {
|
|
31
|
+
id: "theme1",
|
|
32
|
+
code: "M01",
|
|
33
|
+
name: "Mental Health Support",
|
|
34
|
+
},
|
|
35
|
+
strategies: [
|
|
36
|
+
{
|
|
37
|
+
id: "strategy1",
|
|
38
|
+
code: "M01.1",
|
|
39
|
+
name: "Mental Health Support Policy",
|
|
40
|
+
score: "12",
|
|
41
|
+
hasTarget: true,
|
|
42
|
+
},
|
|
43
|
+
{
|
|
44
|
+
id: "strategy2",
|
|
45
|
+
code: "M01.2",
|
|
46
|
+
name: "Mental Health Resources",
|
|
47
|
+
score: "8",
|
|
48
|
+
hasTarget: false,
|
|
49
|
+
},
|
|
50
|
+
],
|
|
51
|
+
},
|
|
52
|
+
{
|
|
53
|
+
concept: {
|
|
54
|
+
id: "community",
|
|
55
|
+
type: "community" as const,
|
|
56
|
+
name: "Community",
|
|
57
|
+
icon: <IconConceptCommunity />,
|
|
58
|
+
},
|
|
59
|
+
theme: {
|
|
60
|
+
id: "theme2",
|
|
61
|
+
code: "C01",
|
|
62
|
+
name: "Social Equity",
|
|
63
|
+
},
|
|
64
|
+
strategies: [
|
|
65
|
+
{
|
|
66
|
+
id: "strategy3",
|
|
67
|
+
code: "C01.1",
|
|
68
|
+
name: "Accessibility Features",
|
|
69
|
+
score: "15",
|
|
70
|
+
hasTarget: true,
|
|
71
|
+
},
|
|
72
|
+
],
|
|
73
|
+
},
|
|
74
|
+
{
|
|
75
|
+
concept: {
|
|
76
|
+
id: "movement",
|
|
77
|
+
type: "movement" as const,
|
|
78
|
+
name: "Movement",
|
|
79
|
+
icon: <IconConceptMovement />,
|
|
80
|
+
},
|
|
81
|
+
theme: {
|
|
82
|
+
id: "theme3",
|
|
83
|
+
code: "V01",
|
|
84
|
+
name: "Physical Activity",
|
|
85
|
+
},
|
|
86
|
+
strategies: [
|
|
87
|
+
{
|
|
88
|
+
id: "strategy4",
|
|
89
|
+
code: "V01.1",
|
|
90
|
+
name: "Active Design",
|
|
91
|
+
score: "10",
|
|
92
|
+
hasTarget: false,
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
id: "strategy5",
|
|
96
|
+
code: "V01.2",
|
|
97
|
+
name: "Exercise Facilities",
|
|
98
|
+
score: "6",
|
|
99
|
+
hasTarget: true,
|
|
100
|
+
},
|
|
101
|
+
],
|
|
102
|
+
},
|
|
103
|
+
];
|
|
104
|
+
|
|
105
|
+
export const Default: Story = {
|
|
106
|
+
render: () => <StrategyTable data={mockData} />,
|
|
107
|
+
};
|
|
108
|
+
|
|
109
|
+
export const SingleConcept: Story = {
|
|
110
|
+
render: () => (
|
|
111
|
+
<StrategyTable
|
|
112
|
+
data={[
|
|
113
|
+
{
|
|
114
|
+
concept: {
|
|
115
|
+
id: "mind",
|
|
116
|
+
type: "mind" as const,
|
|
117
|
+
name: "Mind",
|
|
118
|
+
icon: <IconConceptMind />,
|
|
119
|
+
},
|
|
120
|
+
theme: {
|
|
121
|
+
id: "theme1",
|
|
122
|
+
code: "M01",
|
|
123
|
+
name: "Mental Health Support",
|
|
124
|
+
},
|
|
125
|
+
strategies: [
|
|
126
|
+
{
|
|
127
|
+
id: "strategy1",
|
|
128
|
+
code: "M01.1",
|
|
129
|
+
name: "Mental Health Support Policy",
|
|
130
|
+
score: "12",
|
|
131
|
+
hasTarget: true,
|
|
132
|
+
},
|
|
133
|
+
],
|
|
134
|
+
},
|
|
135
|
+
]}
|
|
136
|
+
/>
|
|
137
|
+
),
|
|
138
|
+
};
|
|
@@ -0,0 +1,96 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { Switch } from "../../components/ui/switch";
|
|
3
|
+
import { Label } from "../../components/ui/Label";
|
|
4
|
+
import { useState } from "react";
|
|
5
|
+
|
|
6
|
+
const meta = {
|
|
7
|
+
title: "UI/Switch",
|
|
8
|
+
component: Switch,
|
|
9
|
+
tags: ["autodocs"],
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: "centered",
|
|
12
|
+
},
|
|
13
|
+
} satisfies Meta<typeof Switch>;
|
|
14
|
+
|
|
15
|
+
export default meta;
|
|
16
|
+
|
|
17
|
+
type Story = StoryObj<typeof meta>;
|
|
18
|
+
|
|
19
|
+
export const Default: Story = {
|
|
20
|
+
render: () => {
|
|
21
|
+
const [checked, setChecked] = useState(false);
|
|
22
|
+
return <Switch checked={checked} onCheckedChange={setChecked} />;
|
|
23
|
+
},
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export const Checked: Story = {
|
|
27
|
+
render: () => {
|
|
28
|
+
const [checked, setChecked] = useState(true);
|
|
29
|
+
return <Switch checked={checked} onCheckedChange={setChecked} />;
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
export const Disabled: Story = {
|
|
34
|
+
render: () => <Switch disabled />,
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
export const WithLabel: Story = {
|
|
38
|
+
render: () => {
|
|
39
|
+
const [checked, setChecked] = useState(false);
|
|
40
|
+
return (
|
|
41
|
+
<div className="flex items-center space-x-2">
|
|
42
|
+
<Switch
|
|
43
|
+
id="notifications"
|
|
44
|
+
checked={checked}
|
|
45
|
+
onCheckedChange={setChecked}
|
|
46
|
+
/>
|
|
47
|
+
<Label htmlFor="notifications">Enable notifications</Label>
|
|
48
|
+
</div>
|
|
49
|
+
);
|
|
50
|
+
},
|
|
51
|
+
};
|
|
52
|
+
|
|
53
|
+
export const Multiple: Story = {
|
|
54
|
+
render: () => {
|
|
55
|
+
const [settings, setSettings] = useState({
|
|
56
|
+
email: true,
|
|
57
|
+
push: false,
|
|
58
|
+
sms: false,
|
|
59
|
+
});
|
|
60
|
+
|
|
61
|
+
return (
|
|
62
|
+
<div className="space-y-4 w-full max-w-md">
|
|
63
|
+
<div className="flex items-center justify-between">
|
|
64
|
+
<Label htmlFor="email">Email Notifications</Label>
|
|
65
|
+
<Switch
|
|
66
|
+
id="email"
|
|
67
|
+
checked={settings.email}
|
|
68
|
+
onCheckedChange={(value) =>
|
|
69
|
+
setSettings({ ...settings, email: value })
|
|
70
|
+
}
|
|
71
|
+
/>
|
|
72
|
+
</div>
|
|
73
|
+
<div className="flex items-center justify-between">
|
|
74
|
+
<Label htmlFor="push">Push Notifications</Label>
|
|
75
|
+
<Switch
|
|
76
|
+
id="push"
|
|
77
|
+
checked={settings.push}
|
|
78
|
+
onCheckedChange={(value) =>
|
|
79
|
+
setSettings({ ...settings, push: value })
|
|
80
|
+
}
|
|
81
|
+
/>
|
|
82
|
+
</div>
|
|
83
|
+
<div className="flex items-center justify-between">
|
|
84
|
+
<Label htmlFor="sms">SMS Notifications</Label>
|
|
85
|
+
<Switch
|
|
86
|
+
id="sms"
|
|
87
|
+
checked={settings.sms}
|
|
88
|
+
onCheckedChange={(value) =>
|
|
89
|
+
setSettings({ ...settings, sms: value })
|
|
90
|
+
}
|
|
91
|
+
/>
|
|
92
|
+
</div>
|
|
93
|
+
</div>
|
|
94
|
+
);
|
|
95
|
+
},
|
|
96
|
+
};
|
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import {
|
|
3
|
+
Table,
|
|
4
|
+
TableBody,
|
|
5
|
+
TableCell,
|
|
6
|
+
TableHead,
|
|
7
|
+
TableHeader,
|
|
8
|
+
TableRow,
|
|
9
|
+
} from "../../components/ui/table";
|
|
10
|
+
|
|
11
|
+
const meta = {
|
|
12
|
+
title: "UI/Table",
|
|
13
|
+
component: Table,
|
|
14
|
+
tags: ["autodocs"],
|
|
15
|
+
parameters: {
|
|
16
|
+
layout: "padded",
|
|
17
|
+
},
|
|
18
|
+
} satisfies Meta<typeof Table>;
|
|
19
|
+
|
|
20
|
+
export default meta;
|
|
21
|
+
|
|
22
|
+
type Story = StoryObj<typeof meta>;
|
|
23
|
+
|
|
24
|
+
export const Default: Story = {
|
|
25
|
+
render: () => (
|
|
26
|
+
<div className="overflow-x-auto w-full max-w-2xl">
|
|
27
|
+
<Table>
|
|
28
|
+
<TableHeader>
|
|
29
|
+
<TableRow>
|
|
30
|
+
<TableHead>Name</TableHead>
|
|
31
|
+
<TableHead>Email</TableHead>
|
|
32
|
+
<TableHead>Role</TableHead>
|
|
33
|
+
<TableHead>Status</TableHead>
|
|
34
|
+
</TableRow>
|
|
35
|
+
</TableHeader>
|
|
36
|
+
<TableBody>
|
|
37
|
+
<TableRow>
|
|
38
|
+
<TableCell>John Doe</TableCell>
|
|
39
|
+
<TableCell>john@example.com</TableCell>
|
|
40
|
+
<TableCell>Admin</TableCell>
|
|
41
|
+
<TableCell>Active</TableCell>
|
|
42
|
+
</TableRow>
|
|
43
|
+
<TableRow>
|
|
44
|
+
<TableCell>Jane Smith</TableCell>
|
|
45
|
+
<TableCell>jane@example.com</TableCell>
|
|
46
|
+
<TableCell>User</TableCell>
|
|
47
|
+
<TableCell>Active</TableCell>
|
|
48
|
+
</TableRow>
|
|
49
|
+
<TableRow>
|
|
50
|
+
<TableCell>Bob Johnson</TableCell>
|
|
51
|
+
<TableCell>bob@example.com</TableCell>
|
|
52
|
+
<TableCell>Moderator</TableCell>
|
|
53
|
+
<TableCell>Inactive</TableCell>
|
|
54
|
+
</TableRow>
|
|
55
|
+
</TableBody>
|
|
56
|
+
</Table>
|
|
57
|
+
</div>
|
|
58
|
+
),
|
|
59
|
+
};
|
|
60
|
+
|
|
61
|
+
export const WithBadges: Story = {
|
|
62
|
+
render: () => (
|
|
63
|
+
<div className="overflow-x-auto w-full max-w-2xl">
|
|
64
|
+
<Table>
|
|
65
|
+
<TableHeader>
|
|
66
|
+
<TableRow>
|
|
67
|
+
<TableHead>Product</TableHead>
|
|
68
|
+
<TableHead>Price</TableHead>
|
|
69
|
+
<TableHead>Quantity</TableHead>
|
|
70
|
+
<TableHead>Status</TableHead>
|
|
71
|
+
</TableRow>
|
|
72
|
+
</TableHeader>
|
|
73
|
+
<TableBody>
|
|
74
|
+
<TableRow>
|
|
75
|
+
<TableCell>Laptop</TableCell>
|
|
76
|
+
<TableCell>$999</TableCell>
|
|
77
|
+
<TableCell>5</TableCell>
|
|
78
|
+
<TableCell>
|
|
79
|
+
<span className="inline-flex items-center rounded-full bg-green-100 px-3 py-1 text-xs font-medium text-green-800">
|
|
80
|
+
In Stock
|
|
81
|
+
</span>
|
|
82
|
+
</TableCell>
|
|
83
|
+
</TableRow>
|
|
84
|
+
<TableRow>
|
|
85
|
+
<TableCell>Monitor</TableCell>
|
|
86
|
+
<TableCell>$299</TableCell>
|
|
87
|
+
<TableCell>0</TableCell>
|
|
88
|
+
<TableCell>
|
|
89
|
+
<span className="inline-flex items-center rounded-full bg-red-100 px-3 py-1 text-xs font-medium text-red-800">
|
|
90
|
+
Out of Stock
|
|
91
|
+
</span>
|
|
92
|
+
</TableCell>
|
|
93
|
+
</TableRow>
|
|
94
|
+
<TableRow>
|
|
95
|
+
<TableCell>Keyboard</TableCell>
|
|
96
|
+
<TableCell>$99</TableCell>
|
|
97
|
+
<TableCell>2</TableCell>
|
|
98
|
+
<TableCell>
|
|
99
|
+
<span className="inline-flex items-center rounded-full bg-yellow-100 px-3 py-1 text-xs font-medium text-yellow-800">
|
|
100
|
+
Low Stock
|
|
101
|
+
</span>
|
|
102
|
+
</TableCell>
|
|
103
|
+
</TableRow>
|
|
104
|
+
</TableBody>
|
|
105
|
+
</Table>
|
|
106
|
+
</div>
|
|
107
|
+
),
|
|
108
|
+
};
|
|
109
|
+
|
|
110
|
+
export const Striped: Story = {
|
|
111
|
+
render: () => (
|
|
112
|
+
<div className="overflow-x-auto w-full max-w-2xl">
|
|
113
|
+
<Table>
|
|
114
|
+
<TableHeader>
|
|
115
|
+
<TableRow>
|
|
116
|
+
<TableHead>ID</TableHead>
|
|
117
|
+
<TableHead>Project</TableHead>
|
|
118
|
+
<TableHead>Date</TableHead>
|
|
119
|
+
<TableHead>Amount</TableHead>
|
|
120
|
+
</TableRow>
|
|
121
|
+
</TableHeader>
|
|
122
|
+
<TableBody>
|
|
123
|
+
{[1, 2, 3, 4, 5].map((row, idx) => (
|
|
124
|
+
<TableRow key={idx} className={idx % 2 === 0 ? "bg-gray-50" : ""}>
|
|
125
|
+
<TableCell>{String(row).padStart(4, "0")}</TableCell>
|
|
126
|
+
<TableCell>Project {row}</TableCell>
|
|
127
|
+
<TableCell>2024-01-{String(row).padStart(2, "0")}</TableCell>
|
|
128
|
+
<TableCell>${(row * 1000).toFixed(2)}</TableCell>
|
|
129
|
+
</TableRow>
|
|
130
|
+
))}
|
|
131
|
+
</TableBody>
|
|
132
|
+
</Table>
|
|
133
|
+
</div>
|
|
134
|
+
),
|
|
135
|
+
};
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import { AnimatedTabs } from "@/components/ui/Tabs";
|
|
3
|
+
|
|
4
|
+
const meta = {
|
|
5
|
+
title: "Review/Tabs",
|
|
6
|
+
component: AnimatedTabs,
|
|
7
|
+
tags: ["autodocs"],
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: "padded",
|
|
10
|
+
},
|
|
11
|
+
} satisfies Meta<typeof AnimatedTabs>;
|
|
12
|
+
|
|
13
|
+
export default meta;
|
|
14
|
+
|
|
15
|
+
type Story = StoryObj<typeof meta>;
|
|
16
|
+
|
|
17
|
+
const tabs = [
|
|
18
|
+
{ label: "Home", value: "home" },
|
|
19
|
+
{ label: "About", value: "about" },
|
|
20
|
+
{ label: "Contact", value: "contact" },
|
|
21
|
+
];
|
|
22
|
+
|
|
23
|
+
export const Default: Story = {
|
|
24
|
+
render: () => <AnimatedTabs tabs={tabs} />,
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
export const WithDangerZone: Story = {
|
|
28
|
+
render: () => (
|
|
29
|
+
<AnimatedTabs
|
|
30
|
+
tabs={[...tabs, { label: "Danger Zone", value: "danger-zone" }]}
|
|
31
|
+
/>
|
|
32
|
+
),
|
|
33
|
+
};
|