@syscore/ui-library 1.27.3 → 2.0.0-beta-publish-workflow-beta.2
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 +0 -2
- package/client/assets/alert/icon-clear.svg +4 -0
- package/client/assets/alert/icon-done.svg +3 -0
- package/client/assets/avatar-identity/photo.png +0 -0
- package/client/assets/avatar-identity/placeholder-icon.svg +8 -0
- package/client/assets/breadcrumb/icon-ellipsis.svg +5 -0
- package/client/assets/breadcrumb/icon-home.svg +3 -0
- package/client/assets/breadcrumb/icon-separator.svg +3 -0
- package/client/assets/button-v01/icon-back.svg +4 -0
- package/client/assets/button-v01/icon-check.svg +3 -0
- package/client/assets/button-v01/icon-close.svg +4 -0
- package/client/assets/button-v01/icon-delete.svg +3 -0
- package/client/assets/button-v01/icon-device.svg +3 -0
- package/client/assets/dropdown/icon-carrot-contract.svg +3 -0
- package/client/assets/dropdown/icon-carrot-expand.svg +3 -0
- package/client/assets/dropdown/icon-clear.svg +4 -0
- package/client/assets/dropdown/icon-enter.svg +3 -0
- package/client/components/icons/UtilityChangeType.tsx +21 -0
- package/client/components/ui/alert-dialog-panel.tsx +246 -0
- package/client/components/ui/alert-v02.tsx +214 -0
- package/client/components/ui/app-bar.tsx +299 -0
- package/client/components/ui/avatar-identity.tsx +122 -0
- package/client/components/ui/banner.tsx +108 -0
- package/client/components/ui/bottom-navigation.tsx +223 -0
- package/client/components/ui/breadcrumb-trail.tsx +170 -0
- package/client/components/ui/button-v01.tsx +238 -0
- package/client/components/ui/button.tsx +2 -0
- package/client/components/ui/card.tsx +108 -26
- package/client/components/ui/code-badge.tsx +62 -0
- package/client/components/ui/date-picker.tsx +188 -0
- package/client/components/ui/dropdown.tsx +448 -0
- package/client/components/ui/empty-state.tsx +197 -0
- package/client/components/ui/file-upload.tsx +214 -0
- package/client/components/ui/footer.tsx +179 -0
- package/client/components/ui/layout.tsx +1182 -0
- package/client/components/ui/pagination-v01.tsx +157 -0
- package/client/components/ui/password-field-v01.tsx +67 -0
- package/client/components/ui/search-field-v01.tsx +192 -0
- package/client/components/ui/section-heading.tsx +49 -0
- package/client/components/ui/sidebar.tsx +2 -3
- package/client/components/ui/standard-navigation.tsx +8 -2
- package/client/components/ui/stepper.tsx +148 -0
- package/client/components/ui/switch-v01.tsx +71 -0
- package/client/components/ui/system-bar.tsx +119 -0
- package/client/components/ui/table-v01.tsx +230 -0
- package/client/components/ui/tabs-v01.tsx +99 -0
- package/client/components/ui/tag-v02.tsx +113 -0
- package/client/components/ui/text-area-v01.tsx +33 -0
- package/client/components/ui/text-field-v01.tsx +108 -0
- package/client/components/ui/timeline.tsx +181 -0
- package/client/components/ui/toast-v01.tsx +206 -0
- package/client/components/ui/tooltip.tsx +264 -71
- package/client/global.css +9565 -4378
- package/client/storybook.css +125 -0
- package/client/ui/Accordion.stories.tsx +1 -1
- package/client/ui/AlertDialogPanel/AlertDialogPanel.stories.tsx +150 -0
- package/client/ui/AlertV02/AlertV02.stories.tsx +188 -0
- package/client/ui/AppBar/app-bar.stories.tsx +280 -0
- package/client/ui/AspectRatio.stories.tsx +1 -1
- package/client/ui/AvatarIdentity/AvatarIdentity.stories.tsx +77 -0
- package/client/ui/Banner/banner.stories.tsx +238 -0
- package/client/ui/BottomNavigation/bottom-navigation.stories.tsx +285 -0
- package/client/ui/BreadcrumbTrail/BreadcrumbTrail.stories.tsx +232 -0
- package/client/ui/Button.stories.tsx +1 -1
- package/client/ui/ButtonV01/ButtonV01.stories.tsx +417 -0
- package/client/ui/Calendar/Calendar.stories.tsx +1 -1
- package/client/ui/Card.stories.tsx +285 -168
- package/client/ui/Carousel/Carousel.stories.tsx +1 -1
- package/client/ui/Chart/Chart.stories.tsx +1 -1
- package/client/ui/Checkbox.stories.tsx +1 -1
- package/client/ui/Collapsible/Collapsible.stories.tsx +1 -1
- package/client/ui/Colors.stories.tsx +1 -1
- package/client/ui/Command/Command.stories.tsx +1 -1
- package/client/ui/ContextMenu/ContextMenu.stories.tsx +1 -1
- package/client/ui/DatePicker/DatePicker.stories.tsx +293 -0
- package/client/ui/Dialog.stories.tsx +1 -1
- package/client/ui/Drawer/Drawer.stories.tsx +1 -1
- package/client/ui/Dropdown/Dropdown.stories.tsx +205 -0
- package/client/ui/EmptyState/empty-state.stories.tsx +251 -0
- package/client/ui/FileUpload/FileUpload.stories.tsx +218 -0
- package/client/ui/Footer/footer.stories.tsx +194 -0
- package/client/ui/Form/Form.stories.tsx +1 -1
- package/client/ui/Hero.stories.tsx +1 -1
- package/client/ui/HoverCard/HoverCard.stories.tsx +1 -1
- package/client/ui/Icons.stories.tsx +1 -1
- package/client/ui/Input.stories.tsx +1 -1
- package/client/ui/InputOTP/InputOTP.stories.tsx +1 -1
- package/client/ui/Label.stories.tsx +1 -1
- package/client/ui/Layout/Center.stories.tsx +100 -0
- package/client/ui/Layout/Columns.stories.tsx +136 -0
- package/client/ui/Layout/Container.stories.tsx +104 -0
- package/client/ui/Layout/FormLayout.stories.tsx +144 -0
- package/client/ui/Layout/Grid.stories.tsx +158 -0
- package/client/ui/Layout/GridSpan.stories.tsx +75 -0
- package/client/ui/Layout/HStack.stories.tsx +128 -0
- package/client/ui/Layout/Layout.stories.tsx +287 -0
- package/client/ui/Layout/LayoutContent.stories.tsx +91 -0
- package/client/ui/Layout/LayoutFooter.stories.tsx +77 -0
- package/client/ui/Layout/LayoutHeader.stories.tsx +104 -0
- package/client/ui/Layout/LayoutPanel.stories.tsx +143 -0
- package/client/ui/Layout/Positioned.stories.tsx +113 -0
- package/client/ui/Layout/Section.stories.tsx +84 -0
- package/client/ui/Layout/ShowHide.stories.tsx +99 -0
- package/client/ui/Layout/Spacer.stories.tsx +149 -0
- package/client/ui/Layout/Stack.stories.tsx +69 -0
- package/client/ui/Layout/StackItem.stories.tsx +124 -0
- package/client/ui/Layout/VStack.stories.tsx +101 -0
- package/client/ui/Layout/controls.ts +33 -0
- package/client/ui/Layout/demo.tsx +37 -0
- package/client/ui/Menubar/Menubar.stories.tsx +1 -1
- package/client/ui/MobileNav.stories.tsx +1 -1
- package/client/ui/Navigation.stories.tsx +1 -1
- package/client/ui/NavigationMenu/NavigationMenu.stories.tsx +1 -1
- package/client/ui/PageHeader.stories.tsx +13 -13
- package/client/ui/Pagination/Pagination.stories.tsx +178 -98
- package/client/ui/Pagination/PaginationLegacy.stories.tsx +121 -0
- package/client/ui/Panel.stories.tsx +1 -1
- package/client/ui/Popover/Popover.stories.tsx +1 -1
- package/client/ui/Progress/Progress.stories.tsx +1 -1
- package/client/ui/RadioGroup/RadioGroup.stories.tsx +1 -1
- package/client/ui/Resizable/Resizable.stories.tsx +1 -1
- package/client/ui/ScrollArea/ScrollArea.stories.tsx +1 -1
- package/client/ui/SearchField/SearchField.stories.tsx +153 -0
- package/client/ui/{SearchField.stories.tsx → SearchField/SearchFieldLegacy.stories.tsx} +2 -2
- package/client/ui/SectionBadge.stories.tsx +1 -1
- package/client/ui/Select.stories.tsx +1 -1
- package/client/ui/Separator/Separator.stories.tsx +1 -1
- package/client/ui/Sheet/Sheet.stories.tsx +1 -1
- package/client/ui/Sidebar/Sidebar.stories.tsx +57 -8
- package/client/ui/Skeleton/Skeleton.stories.tsx +1 -1
- package/client/ui/Slider/Slider.stories.tsx +1 -1
- package/client/ui/StandardNavigation.stories.tsx +1 -1
- package/client/ui/Stepper/Stepper.stories.tsx +344 -0
- package/client/ui/Switch.stories.tsx +1 -1
- package/client/ui/SwitchV01/SwitchV01.stories.tsx +152 -0
- package/client/ui/SystemBar/system-bar.stories.tsx +179 -0
- package/client/ui/Table/TableV01.stories.tsx +256 -0
- package/client/ui/Tabs.stories.tsx +1 -1
- package/client/ui/TabsV01/TabsV01.stories.tsx +144 -0
- package/client/ui/Tag.stories.tsx +1 -1
- package/client/ui/TagV02/TagStatusV02.stories.tsx +132 -0
- package/client/ui/TagV02/TagV02.stories.tsx +142 -0
- package/client/ui/TextAreaV01/TextAreaV01.stories.tsx +146 -0
- package/client/ui/TextFieldV01/PasswordFieldV01.stories.tsx +161 -0
- package/client/ui/TextFieldV01/TextFieldV01.stories.tsx +160 -0
- package/client/ui/Textarea.stories.tsx +1 -1
- package/client/ui/Timeline/timeline.stories.tsx +404 -0
- package/client/ui/Toast/Toast.stories.tsx +1 -1
- package/client/ui/ToastV01/ToastV01.stories.tsx +201 -0
- package/client/ui/Toaster/Toaster.stories.tsx +1 -1
- package/client/ui/Toggle.stories.tsx +1 -1
- package/client/ui/Tooltip.stories.tsx +287 -114
- package/client/ui/Typography.stories.tsx +1 -1
- package/dist/index.cjs.js +1 -1
- package/dist/index.d.ts +649 -13
- package/dist/index.es.js +4405 -653
- package/package.json +1 -1
- package/client/components/ui/badge.tsx +0 -33
- package/client/components/ui/sonner.tsx +0 -26
- package/client/components/ui/toggle-group.tsx +0 -76
- package/client/ui/Alert/Alert.stories.tsx +0 -82
- package/client/ui/AlertDialog/AlertDialog.stories.tsx +0 -106
- package/client/ui/Avatar/Avatar.stories.tsx +0 -94
- package/client/ui/Badge/Badge.stories.tsx +0 -60
- package/client/ui/Breadcrumb/Breadcrumb.stories.tsx +0 -97
- package/client/ui/DropdownMenu/DropdownMenu.stories.tsx +0 -139
- package/client/ui/Sonner/Sonner.stories.tsx +0 -48
- package/client/ui/Table/Table.stories.tsx +0 -135
- package/client/ui/ToggleGroup/ToggleGroup.stories.tsx +0 -88
|
@@ -1,139 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import {
|
|
3
|
-
DropdownMenu,
|
|
4
|
-
DropdownMenuTrigger,
|
|
5
|
-
DropdownMenuContent,
|
|
6
|
-
DropdownMenuItem,
|
|
7
|
-
DropdownMenuSeparator,
|
|
8
|
-
DropdownMenuCheckboxItem,
|
|
9
|
-
DropdownMenuRadioGroup,
|
|
10
|
-
DropdownMenuRadioItem,
|
|
11
|
-
} from "../../components/ui/dropdown-menu";
|
|
12
|
-
import { Button } from "../../components/ui/button";
|
|
13
|
-
import { ChevronDown } from "lucide-react";
|
|
14
|
-
import { useState } from "react";
|
|
15
|
-
|
|
16
|
-
const meta = {
|
|
17
|
-
title: "UI/DropdownMenu",
|
|
18
|
-
component: DropdownMenu,
|
|
19
|
-
tags: ["autodocs"],
|
|
20
|
-
parameters: {
|
|
21
|
-
layout: "padded",
|
|
22
|
-
},
|
|
23
|
-
} satisfies Meta<typeof DropdownMenu>;
|
|
24
|
-
|
|
25
|
-
export default meta;
|
|
26
|
-
|
|
27
|
-
type Story = StoryObj<typeof meta>;
|
|
28
|
-
|
|
29
|
-
export const Default: Story = {
|
|
30
|
-
render: () => (
|
|
31
|
-
<DropdownMenu>
|
|
32
|
-
<DropdownMenuTrigger asChild>
|
|
33
|
-
<Button variant="outline">
|
|
34
|
-
Open Menu
|
|
35
|
-
<ChevronDown className="ml-2 h-4 w-4" />
|
|
36
|
-
</Button>
|
|
37
|
-
</DropdownMenuTrigger>
|
|
38
|
-
<DropdownMenuContent align="end" className="w-56">
|
|
39
|
-
<DropdownMenuItem>Profile</DropdownMenuItem>
|
|
40
|
-
<DropdownMenuItem>Settings</DropdownMenuItem>
|
|
41
|
-
<DropdownMenuSeparator />
|
|
42
|
-
<DropdownMenuItem>Sign Out</DropdownMenuItem>
|
|
43
|
-
</DropdownMenuContent>
|
|
44
|
-
</DropdownMenu>
|
|
45
|
-
),
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
export const WithCheckboxes: Story = {
|
|
49
|
-
render: () => {
|
|
50
|
-
const [items, setItems] = useState({
|
|
51
|
-
bold: false,
|
|
52
|
-
italic: false,
|
|
53
|
-
underline: false,
|
|
54
|
-
});
|
|
55
|
-
return (
|
|
56
|
-
<DropdownMenu>
|
|
57
|
-
<DropdownMenuTrigger asChild>
|
|
58
|
-
<Button variant="outline">Text Options</Button>
|
|
59
|
-
</DropdownMenuTrigger>
|
|
60
|
-
<DropdownMenuContent className="w-56">
|
|
61
|
-
<DropdownMenuCheckboxItem
|
|
62
|
-
checked={items.bold}
|
|
63
|
-
onCheckedChange={(checked) => setItems({ ...items, bold: checked })}
|
|
64
|
-
>
|
|
65
|
-
Bold
|
|
66
|
-
</DropdownMenuCheckboxItem>
|
|
67
|
-
<DropdownMenuCheckboxItem
|
|
68
|
-
checked={items.italic}
|
|
69
|
-
onCheckedChange={(checked) =>
|
|
70
|
-
setItems({ ...items, italic: checked })
|
|
71
|
-
}
|
|
72
|
-
>
|
|
73
|
-
Italic
|
|
74
|
-
</DropdownMenuCheckboxItem>
|
|
75
|
-
<DropdownMenuCheckboxItem
|
|
76
|
-
checked={items.underline}
|
|
77
|
-
onCheckedChange={(checked) =>
|
|
78
|
-
setItems({ ...items, underline: checked })
|
|
79
|
-
}
|
|
80
|
-
>
|
|
81
|
-
Underline
|
|
82
|
-
</DropdownMenuCheckboxItem>
|
|
83
|
-
</DropdownMenuContent>
|
|
84
|
-
</DropdownMenu>
|
|
85
|
-
);
|
|
86
|
-
},
|
|
87
|
-
};
|
|
88
|
-
|
|
89
|
-
export const WithRadio: Story = {
|
|
90
|
-
render: () => {
|
|
91
|
-
const [theme, setTheme] = useState("light");
|
|
92
|
-
return (
|
|
93
|
-
<DropdownMenu>
|
|
94
|
-
<DropdownMenuTrigger asChild>
|
|
95
|
-
<Button variant="outline">Theme</Button>
|
|
96
|
-
</DropdownMenuTrigger>
|
|
97
|
-
<DropdownMenuContent className="w-56">
|
|
98
|
-
<DropdownMenuRadioGroup value={theme} onValueChange={setTheme}>
|
|
99
|
-
<DropdownMenuRadioItem value="light">Light</DropdownMenuRadioItem>
|
|
100
|
-
<DropdownMenuRadioItem value="dark">Dark</DropdownMenuRadioItem>
|
|
101
|
-
<DropdownMenuRadioItem value="system">System</DropdownMenuRadioItem>
|
|
102
|
-
</DropdownMenuRadioGroup>
|
|
103
|
-
</DropdownMenuContent>
|
|
104
|
-
</DropdownMenu>
|
|
105
|
-
);
|
|
106
|
-
},
|
|
107
|
-
};
|
|
108
|
-
|
|
109
|
-
export const Complex: Story = {
|
|
110
|
-
render: () => {
|
|
111
|
-
const [showNotifications, setShowNotifications] = useState(true);
|
|
112
|
-
const [theme, setTheme] = useState("light");
|
|
113
|
-
return (
|
|
114
|
-
<DropdownMenu>
|
|
115
|
-
<DropdownMenuTrigger asChild>
|
|
116
|
-
<Button variant="outline">Menu</Button>
|
|
117
|
-
</DropdownMenuTrigger>
|
|
118
|
-
<DropdownMenuContent className="w-56">
|
|
119
|
-
<DropdownMenuItem>Profile</DropdownMenuItem>
|
|
120
|
-
<DropdownMenuItem>Settings</DropdownMenuItem>
|
|
121
|
-
<DropdownMenuSeparator />
|
|
122
|
-
<DropdownMenuCheckboxItem
|
|
123
|
-
checked={showNotifications}
|
|
124
|
-
onCheckedChange={setShowNotifications}
|
|
125
|
-
>
|
|
126
|
-
Show Notifications
|
|
127
|
-
</DropdownMenuCheckboxItem>
|
|
128
|
-
<DropdownMenuSeparator />
|
|
129
|
-
<DropdownMenuRadioGroup value={theme} onValueChange={setTheme}>
|
|
130
|
-
<DropdownMenuRadioItem value="light">Light</DropdownMenuRadioItem>
|
|
131
|
-
<DropdownMenuRadioItem value="dark">Dark</DropdownMenuRadioItem>
|
|
132
|
-
</DropdownMenuRadioGroup>
|
|
133
|
-
<DropdownMenuSeparator />
|
|
134
|
-
<DropdownMenuItem className="text-red-600">Sign Out</DropdownMenuItem>
|
|
135
|
-
</DropdownMenuContent>
|
|
136
|
-
</DropdownMenu>
|
|
137
|
-
);
|
|
138
|
-
},
|
|
139
|
-
};
|
|
@@ -1,48 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,135 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,88 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { ToggleGroup, ToggleGroupItem } from "../../components/ui/toggle-group";
|
|
3
|
-
import {
|
|
4
|
-
Bold,
|
|
5
|
-
Italic,
|
|
6
|
-
Underline,
|
|
7
|
-
AlignLeft,
|
|
8
|
-
AlignCenter,
|
|
9
|
-
AlignRight,
|
|
10
|
-
} from "lucide-react";
|
|
11
|
-
import { useState } from "react";
|
|
12
|
-
|
|
13
|
-
const meta = {
|
|
14
|
-
title: "UI/ToggleGroup",
|
|
15
|
-
component: ToggleGroup,
|
|
16
|
-
tags: ["autodocs"],
|
|
17
|
-
parameters: {
|
|
18
|
-
layout: "padded",
|
|
19
|
-
},
|
|
20
|
-
} satisfies Meta<typeof ToggleGroup>;
|
|
21
|
-
|
|
22
|
-
export default meta;
|
|
23
|
-
|
|
24
|
-
type Story = StoryObj<typeof meta>;
|
|
25
|
-
|
|
26
|
-
export const Default: Story = {
|
|
27
|
-
render: () => {
|
|
28
|
-
const [value, setValue] = useState("");
|
|
29
|
-
return (
|
|
30
|
-
<ToggleGroup type="single" value={value} onValueChange={setValue}>
|
|
31
|
-
<ToggleGroupItem value="left">Left</ToggleGroupItem>
|
|
32
|
-
<ToggleGroupItem value="center">Center</ToggleGroupItem>
|
|
33
|
-
<ToggleGroupItem value="right">Right</ToggleGroupItem>
|
|
34
|
-
</ToggleGroup>
|
|
35
|
-
);
|
|
36
|
-
},
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export const Multiple: Story = {
|
|
40
|
-
render: () => {
|
|
41
|
-
const [value, setValue] = useState<string[]>([]);
|
|
42
|
-
return (
|
|
43
|
-
<ToggleGroup type="multiple" value={value} onValueChange={setValue}>
|
|
44
|
-
<ToggleGroupItem value="bold">
|
|
45
|
-
<Bold className="h-4 w-4 mr-2" />
|
|
46
|
-
Bold
|
|
47
|
-
</ToggleGroupItem>
|
|
48
|
-
<ToggleGroupItem value="italic">
|
|
49
|
-
<Italic className="h-4 w-4 mr-2" />
|
|
50
|
-
Italic
|
|
51
|
-
</ToggleGroupItem>
|
|
52
|
-
<ToggleGroupItem value="underline">
|
|
53
|
-
<Underline className="h-4 w-4 mr-2" />
|
|
54
|
-
Underline
|
|
55
|
-
</ToggleGroupItem>
|
|
56
|
-
</ToggleGroup>
|
|
57
|
-
);
|
|
58
|
-
},
|
|
59
|
-
};
|
|
60
|
-
|
|
61
|
-
export const TextAlignment: Story = {
|
|
62
|
-
render: () => {
|
|
63
|
-
const [value, setValue] = useState("left");
|
|
64
|
-
return (
|
|
65
|
-
<ToggleGroup type="single" value={value} onValueChange={setValue}>
|
|
66
|
-
<ToggleGroupItem value="left" aria-label="Align left">
|
|
67
|
-
<AlignLeft className="h-4 w-4" />
|
|
68
|
-
</ToggleGroupItem>
|
|
69
|
-
<ToggleGroupItem value="center" aria-label="Align center">
|
|
70
|
-
<AlignCenter className="h-4 w-4" />
|
|
71
|
-
</ToggleGroupItem>
|
|
72
|
-
<ToggleGroupItem value="right" aria-label="Align right">
|
|
73
|
-
<AlignRight className="h-4 w-4" />
|
|
74
|
-
</ToggleGroupItem>
|
|
75
|
-
</ToggleGroup>
|
|
76
|
-
);
|
|
77
|
-
},
|
|
78
|
-
};
|
|
79
|
-
|
|
80
|
-
export const Disabled: Story = {
|
|
81
|
-
render: () => (
|
|
82
|
-
<ToggleGroup type="single" defaultValue="option1" disabled>
|
|
83
|
-
<ToggleGroupItem value="option1">Option 1</ToggleGroupItem>
|
|
84
|
-
<ToggleGroupItem value="option2">Option 2</ToggleGroupItem>
|
|
85
|
-
<ToggleGroupItem value="option3">Option 3</ToggleGroupItem>
|
|
86
|
-
</ToggleGroup>
|
|
87
|
-
),
|
|
88
|
-
};
|