@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
package/package.json
CHANGED
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import { cva, type VariantProps } from "class-variance-authority";
|
|
3
|
-
|
|
4
|
-
import { cn } from "@/lib/utils";
|
|
5
|
-
|
|
6
|
-
const badgeVariants = cva(
|
|
7
|
-
"badge",
|
|
8
|
-
{
|
|
9
|
-
variants: {
|
|
10
|
-
variant: {
|
|
11
|
-
default: "badge--default",
|
|
12
|
-
secondary: "badge--secondary",
|
|
13
|
-
destructive: "badge--destructive",
|
|
14
|
-
outline: "badge--outline",
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
defaultVariants: {
|
|
18
|
-
variant: "default",
|
|
19
|
-
},
|
|
20
|
-
},
|
|
21
|
-
);
|
|
22
|
-
|
|
23
|
-
export interface BadgeProps
|
|
24
|
-
extends React.HTMLAttributes<HTMLDivElement>,
|
|
25
|
-
VariantProps<typeof badgeVariants> {}
|
|
26
|
-
|
|
27
|
-
function Badge({ className, variant, ...props }: BadgeProps) {
|
|
28
|
-
return (
|
|
29
|
-
<div className={cn(badgeVariants({ variant }), className)} {...props} />
|
|
30
|
-
);
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
export { Badge, badgeVariants };
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
import { useTheme } from "next-themes";
|
|
2
|
-
import { Toaster as Sonner } from "sonner";
|
|
3
|
-
|
|
4
|
-
type ToasterProps = React.ComponentProps<typeof Sonner>;
|
|
5
|
-
|
|
6
|
-
const Toaster = ({ ...props }: ToasterProps) => {
|
|
7
|
-
const { theme = "system" } = useTheme();
|
|
8
|
-
|
|
9
|
-
return (
|
|
10
|
-
<Sonner
|
|
11
|
-
theme={theme as ToasterProps["theme"]}
|
|
12
|
-
className="toaster"
|
|
13
|
-
toastOptions={{
|
|
14
|
-
classNames: {
|
|
15
|
-
toast: "toast",
|
|
16
|
-
description: "toast-description",
|
|
17
|
-
actionButton: "toast-action",
|
|
18
|
-
cancelButton: "toast-cancel",
|
|
19
|
-
},
|
|
20
|
-
}}
|
|
21
|
-
{...props}
|
|
22
|
-
/>
|
|
23
|
-
);
|
|
24
|
-
};
|
|
25
|
-
|
|
26
|
-
export { Toaster };
|
|
@@ -1,76 +0,0 @@
|
|
|
1
|
-
import * as React from "react";
|
|
2
|
-
import * as ToggleGroupPrimitive from "@radix-ui/react-toggle-group";
|
|
3
|
-
import { cva, type VariantProps } from "class-variance-authority";
|
|
4
|
-
|
|
5
|
-
import { cn } from "@/lib/utils";
|
|
6
|
-
|
|
7
|
-
const toggleVariants = cva(
|
|
8
|
-
"toggle-group-item",
|
|
9
|
-
{
|
|
10
|
-
variants: {
|
|
11
|
-
variant: {
|
|
12
|
-
default: "toggle-group-item--default",
|
|
13
|
-
},
|
|
14
|
-
size: {
|
|
15
|
-
default: "toggle-group-item--size-default",
|
|
16
|
-
},
|
|
17
|
-
},
|
|
18
|
-
defaultVariants: {
|
|
19
|
-
variant: "default",
|
|
20
|
-
size: "default",
|
|
21
|
-
},
|
|
22
|
-
},
|
|
23
|
-
);
|
|
24
|
-
|
|
25
|
-
const ToggleGroupContext = React.createContext<
|
|
26
|
-
VariantProps<typeof toggleVariants>
|
|
27
|
-
>({
|
|
28
|
-
size: "default",
|
|
29
|
-
variant: "default",
|
|
30
|
-
});
|
|
31
|
-
|
|
32
|
-
const ToggleGroup = React.forwardRef<
|
|
33
|
-
React.ElementRef<typeof ToggleGroupPrimitive.Root>,
|
|
34
|
-
React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Root> &
|
|
35
|
-
VariantProps<typeof toggleVariants>
|
|
36
|
-
>(({ className, variant, size, children, ...props }, ref) => (
|
|
37
|
-
<ToggleGroupPrimitive.Root
|
|
38
|
-
ref={ref}
|
|
39
|
-
className={cn("toggle-group", className)}
|
|
40
|
-
{...props}
|
|
41
|
-
>
|
|
42
|
-
<ToggleGroupContext.Provider value={{ variant, size }}>
|
|
43
|
-
{children}
|
|
44
|
-
</ToggleGroupContext.Provider>
|
|
45
|
-
</ToggleGroupPrimitive.Root>
|
|
46
|
-
));
|
|
47
|
-
|
|
48
|
-
ToggleGroup.displayName = ToggleGroupPrimitive.Root.displayName;
|
|
49
|
-
|
|
50
|
-
const ToggleGroupItem = React.forwardRef<
|
|
51
|
-
React.ElementRef<typeof ToggleGroupPrimitive.Item>,
|
|
52
|
-
React.ComponentPropsWithoutRef<typeof ToggleGroupPrimitive.Item> &
|
|
53
|
-
VariantProps<typeof toggleVariants>
|
|
54
|
-
>(({ className, children, variant, size, ...props }, ref) => {
|
|
55
|
-
const context = React.useContext(ToggleGroupContext);
|
|
56
|
-
|
|
57
|
-
return (
|
|
58
|
-
<ToggleGroupPrimitive.Item
|
|
59
|
-
ref={ref}
|
|
60
|
-
className={cn(
|
|
61
|
-
toggleVariants({
|
|
62
|
-
variant: context.variant || variant,
|
|
63
|
-
size: context.size || size,
|
|
64
|
-
}),
|
|
65
|
-
className,
|
|
66
|
-
)}
|
|
67
|
-
{...props}
|
|
68
|
-
>
|
|
69
|
-
{children}
|
|
70
|
-
</ToggleGroupPrimitive.Item>
|
|
71
|
-
);
|
|
72
|
-
});
|
|
73
|
-
|
|
74
|
-
ToggleGroupItem.displayName = ToggleGroupPrimitive.Item.displayName;
|
|
75
|
-
|
|
76
|
-
export { ToggleGroup, ToggleGroupItem };
|
|
@@ -1,82 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { Alert, AlertTitle, AlertDescription } from "../../components/ui/alert";
|
|
3
|
-
import { AlertCircle, Terminal, CheckCircle2 } from "lucide-react";
|
|
4
|
-
|
|
5
|
-
const meta = {
|
|
6
|
-
title: "UI/Alert",
|
|
7
|
-
component: Alert,
|
|
8
|
-
tags: ["autodocs"],
|
|
9
|
-
parameters: {
|
|
10
|
-
layout: "padded",
|
|
11
|
-
},
|
|
12
|
-
} satisfies Meta<typeof Alert>;
|
|
13
|
-
|
|
14
|
-
export default meta;
|
|
15
|
-
|
|
16
|
-
type Story = StoryObj<typeof meta>;
|
|
17
|
-
|
|
18
|
-
export const Default: Story = {
|
|
19
|
-
render: () => (
|
|
20
|
-
<Alert>
|
|
21
|
-
<Terminal className="h-4 w-4" />
|
|
22
|
-
<AlertTitle>Heads up!</AlertTitle>
|
|
23
|
-
<AlertDescription>
|
|
24
|
-
You can add components to your app using the code below.
|
|
25
|
-
</AlertDescription>
|
|
26
|
-
</Alert>
|
|
27
|
-
),
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export const Destructive: Story = {
|
|
31
|
-
render: () => (
|
|
32
|
-
<Alert variant="destructive">
|
|
33
|
-
<AlertCircle className="h-4 w-4" />
|
|
34
|
-
<AlertTitle>Error</AlertTitle>
|
|
35
|
-
<AlertDescription>
|
|
36
|
-
Your session has expired. Please log in again.
|
|
37
|
-
</AlertDescription>
|
|
38
|
-
</Alert>
|
|
39
|
-
),
|
|
40
|
-
};
|
|
41
|
-
|
|
42
|
-
export const Success: Story = {
|
|
43
|
-
render: () => (
|
|
44
|
-
<Alert>
|
|
45
|
-
<CheckCircle2 className="h-4 w-4" />
|
|
46
|
-
<AlertTitle>Success</AlertTitle>
|
|
47
|
-
<AlertDescription>
|
|
48
|
-
Your changes have been saved successfully.
|
|
49
|
-
</AlertDescription>
|
|
50
|
-
</Alert>
|
|
51
|
-
),
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export const AllVariants: Story = {
|
|
55
|
-
render: () => (
|
|
56
|
-
<div className="space-y-4 max-w-md">
|
|
57
|
-
<Alert>
|
|
58
|
-
<Terminal className="h-4 w-4" />
|
|
59
|
-
<AlertTitle>Heads up!</AlertTitle>
|
|
60
|
-
<AlertDescription>
|
|
61
|
-
You can add components to your app using the code below.
|
|
62
|
-
</AlertDescription>
|
|
63
|
-
</Alert>
|
|
64
|
-
|
|
65
|
-
<Alert variant="destructive">
|
|
66
|
-
<AlertCircle className="h-4 w-4" />
|
|
67
|
-
<AlertTitle>Error</AlertTitle>
|
|
68
|
-
<AlertDescription>
|
|
69
|
-
Your session has expired. Please log in again.
|
|
70
|
-
</AlertDescription>
|
|
71
|
-
</Alert>
|
|
72
|
-
|
|
73
|
-
<Alert>
|
|
74
|
-
<CheckCircle2 className="h-4 w-4" />
|
|
75
|
-
<AlertTitle>Success</AlertTitle>
|
|
76
|
-
<AlertDescription>
|
|
77
|
-
Your changes have been saved successfully.
|
|
78
|
-
</AlertDescription>
|
|
79
|
-
</Alert>
|
|
80
|
-
</div>
|
|
81
|
-
),
|
|
82
|
-
};
|
|
@@ -1,106 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import {
|
|
3
|
-
AlertDialog,
|
|
4
|
-
AlertDialogTrigger,
|
|
5
|
-
AlertDialogContent,
|
|
6
|
-
AlertDialogHeader,
|
|
7
|
-
AlertDialogTitle,
|
|
8
|
-
AlertDialogDescription,
|
|
9
|
-
AlertDialogFooter,
|
|
10
|
-
AlertDialogAction,
|
|
11
|
-
AlertDialogCancel,
|
|
12
|
-
} from "../../components/ui/alert-dialog";
|
|
13
|
-
import { Button } from "../../components/ui/button";
|
|
14
|
-
import { useState } from "react";
|
|
15
|
-
|
|
16
|
-
const meta = {
|
|
17
|
-
title: "UI/AlertDialog",
|
|
18
|
-
component: AlertDialog,
|
|
19
|
-
tags: ["autodocs"],
|
|
20
|
-
parameters: {
|
|
21
|
-
layout: "centered",
|
|
22
|
-
},
|
|
23
|
-
} satisfies Meta<typeof AlertDialog>;
|
|
24
|
-
|
|
25
|
-
export default meta;
|
|
26
|
-
|
|
27
|
-
type Story = StoryObj<typeof meta>;
|
|
28
|
-
|
|
29
|
-
export const Default: Story = {
|
|
30
|
-
render: () => {
|
|
31
|
-
const [open, setOpen] = useState(false);
|
|
32
|
-
return (
|
|
33
|
-
<AlertDialog open={open} onOpenChange={setOpen}>
|
|
34
|
-
<AlertDialogTrigger asChild>
|
|
35
|
-
<Button>Open Alert</Button>
|
|
36
|
-
</AlertDialogTrigger>
|
|
37
|
-
<AlertDialogContent>
|
|
38
|
-
<AlertDialogHeader>
|
|
39
|
-
<AlertDialogTitle>Confirm Action</AlertDialogTitle>
|
|
40
|
-
<AlertDialogDescription>
|
|
41
|
-
Are you sure you want to proceed with this action?
|
|
42
|
-
</AlertDialogDescription>
|
|
43
|
-
</AlertDialogHeader>
|
|
44
|
-
<AlertDialogFooter>
|
|
45
|
-
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
46
|
-
<AlertDialogAction>Continue</AlertDialogAction>
|
|
47
|
-
</AlertDialogFooter>
|
|
48
|
-
</AlertDialogContent>
|
|
49
|
-
</AlertDialog>
|
|
50
|
-
);
|
|
51
|
-
},
|
|
52
|
-
};
|
|
53
|
-
|
|
54
|
-
export const Delete: Story = {
|
|
55
|
-
render: () => {
|
|
56
|
-
const [open, setOpen] = useState(false);
|
|
57
|
-
return (
|
|
58
|
-
<AlertDialog open={open} onOpenChange={setOpen}>
|
|
59
|
-
<AlertDialogTrigger asChild>
|
|
60
|
-
<Button variant="destructive">Delete Item</Button>
|
|
61
|
-
</AlertDialogTrigger>
|
|
62
|
-
<AlertDialogContent>
|
|
63
|
-
<AlertDialogHeader>
|
|
64
|
-
<AlertDialogTitle>Are you sure?</AlertDialogTitle>
|
|
65
|
-
<AlertDialogDescription>
|
|
66
|
-
This action cannot be undone. This will permanently delete the
|
|
67
|
-
item.
|
|
68
|
-
</AlertDialogDescription>
|
|
69
|
-
</AlertDialogHeader>
|
|
70
|
-
<AlertDialogFooter>
|
|
71
|
-
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
72
|
-
<AlertDialogAction className="bg-destructive text-destructive-foreground hover:bg-destructive/90">
|
|
73
|
-
Delete
|
|
74
|
-
</AlertDialogAction>
|
|
75
|
-
</AlertDialogFooter>
|
|
76
|
-
</AlertDialogContent>
|
|
77
|
-
</AlertDialog>
|
|
78
|
-
);
|
|
79
|
-
},
|
|
80
|
-
};
|
|
81
|
-
|
|
82
|
-
export const Warning: Story = {
|
|
83
|
-
render: () => {
|
|
84
|
-
const [open, setOpen] = useState(false);
|
|
85
|
-
return (
|
|
86
|
-
<AlertDialog open={open} onOpenChange={setOpen}>
|
|
87
|
-
<AlertDialogTrigger asChild>
|
|
88
|
-
<Button variant="outline">Show Warning</Button>
|
|
89
|
-
</AlertDialogTrigger>
|
|
90
|
-
<AlertDialogContent>
|
|
91
|
-
<AlertDialogHeader>
|
|
92
|
-
<AlertDialogTitle>Warning</AlertDialogTitle>
|
|
93
|
-
<AlertDialogDescription>
|
|
94
|
-
This action will have significant consequences. Please confirm
|
|
95
|
-
that you understand the risks.
|
|
96
|
-
</AlertDialogDescription>
|
|
97
|
-
</AlertDialogHeader>
|
|
98
|
-
<AlertDialogFooter>
|
|
99
|
-
<AlertDialogCancel>Cancel</AlertDialogCancel>
|
|
100
|
-
<AlertDialogAction>I Understand</AlertDialogAction>
|
|
101
|
-
</AlertDialogFooter>
|
|
102
|
-
</AlertDialogContent>
|
|
103
|
-
</AlertDialog>
|
|
104
|
-
);
|
|
105
|
-
},
|
|
106
|
-
};
|
|
@@ -1,94 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import {
|
|
3
|
-
Avatar,
|
|
4
|
-
AvatarImage,
|
|
5
|
-
AvatarFallback,
|
|
6
|
-
} from "../../components/ui/avatar";
|
|
7
|
-
|
|
8
|
-
const meta = {
|
|
9
|
-
title: "UI/Avatar",
|
|
10
|
-
component: Avatar,
|
|
11
|
-
tags: ["autodocs"],
|
|
12
|
-
parameters: {
|
|
13
|
-
layout: "centered",
|
|
14
|
-
},
|
|
15
|
-
} satisfies Meta<typeof Avatar>;
|
|
16
|
-
|
|
17
|
-
export default meta;
|
|
18
|
-
|
|
19
|
-
type Story = StoryObj<typeof meta>;
|
|
20
|
-
|
|
21
|
-
export const Default: Story = {
|
|
22
|
-
render: () => (
|
|
23
|
-
<Avatar>
|
|
24
|
-
<AvatarImage src="https://github.com/shadcn.png" />
|
|
25
|
-
<AvatarFallback>CN</AvatarFallback>
|
|
26
|
-
</Avatar>
|
|
27
|
-
),
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export const Fallback: Story = {
|
|
31
|
-
render: () => (
|
|
32
|
-
<Avatar>
|
|
33
|
-
<AvatarImage src="" />
|
|
34
|
-
<AvatarFallback>JD</AvatarFallback>
|
|
35
|
-
</Avatar>
|
|
36
|
-
),
|
|
37
|
-
};
|
|
38
|
-
|
|
39
|
-
export const Multiple: Story = {
|
|
40
|
-
render: () => (
|
|
41
|
-
<div className="flex gap-4">
|
|
42
|
-
<Avatar>
|
|
43
|
-
<AvatarImage src="https://github.com/shadcn.png" />
|
|
44
|
-
<AvatarFallback>CN</AvatarFallback>
|
|
45
|
-
</Avatar>
|
|
46
|
-
<Avatar>
|
|
47
|
-
<AvatarImage src="" />
|
|
48
|
-
<AvatarFallback>JD</AvatarFallback>
|
|
49
|
-
</Avatar>
|
|
50
|
-
<Avatar>
|
|
51
|
-
<AvatarImage src="" />
|
|
52
|
-
<AvatarFallback>AB</AvatarFallback>
|
|
53
|
-
</Avatar>
|
|
54
|
-
<Avatar>
|
|
55
|
-
<AvatarImage src="" />
|
|
56
|
-
<AvatarFallback>XY</AvatarFallback>
|
|
57
|
-
</Avatar>
|
|
58
|
-
</div>
|
|
59
|
-
),
|
|
60
|
-
};
|
|
61
|
-
|
|
62
|
-
export const WithUser: Story = {
|
|
63
|
-
render: () => (
|
|
64
|
-
<div className="flex items-center gap-3">
|
|
65
|
-
<Avatar>
|
|
66
|
-
<AvatarImage src="" />
|
|
67
|
-
<AvatarFallback>JD</AvatarFallback>
|
|
68
|
-
</Avatar>
|
|
69
|
-
<div>
|
|
70
|
-
<p className="text-sm font-semibold">John Doe</p>
|
|
71
|
-
<p className="text-xs text-gray-600">john@example.com</p>
|
|
72
|
-
</div>
|
|
73
|
-
</div>
|
|
74
|
-
),
|
|
75
|
-
};
|
|
76
|
-
|
|
77
|
-
export const Sizes: Story = {
|
|
78
|
-
render: () => (
|
|
79
|
-
<div className="flex items-center gap-4">
|
|
80
|
-
<Avatar className="h-8 w-8">
|
|
81
|
-
<AvatarImage src="" />
|
|
82
|
-
<AvatarFallback>CN</AvatarFallback>
|
|
83
|
-
</Avatar>
|
|
84
|
-
<Avatar>
|
|
85
|
-
<AvatarImage src="" />
|
|
86
|
-
<AvatarFallback>CN</AvatarFallback>
|
|
87
|
-
</Avatar>
|
|
88
|
-
<Avatar className="h-16 w-16">
|
|
89
|
-
<AvatarImage src="" />
|
|
90
|
-
<AvatarFallback>CN</AvatarFallback>
|
|
91
|
-
</Avatar>
|
|
92
|
-
</div>
|
|
93
|
-
),
|
|
94
|
-
};
|
|
@@ -1,60 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import { Badge } from "../../components/ui/badge";
|
|
3
|
-
|
|
4
|
-
const meta = {
|
|
5
|
-
title: "UI/Badge",
|
|
6
|
-
component: Badge,
|
|
7
|
-
tags: ["autodocs"],
|
|
8
|
-
parameters: {
|
|
9
|
-
layout: "centered",
|
|
10
|
-
},
|
|
11
|
-
argTypes: {
|
|
12
|
-
variant: {
|
|
13
|
-
control: { type: "select" },
|
|
14
|
-
options: ["default", "secondary", "destructive", "outline-solid"],
|
|
15
|
-
},
|
|
16
|
-
},
|
|
17
|
-
} satisfies Meta<typeof Badge>;
|
|
18
|
-
|
|
19
|
-
export default meta;
|
|
20
|
-
|
|
21
|
-
type Story = StoryObj<typeof meta>;
|
|
22
|
-
|
|
23
|
-
export const Default: Story = {
|
|
24
|
-
args: {
|
|
25
|
-
children: "Default",
|
|
26
|
-
variant: "default",
|
|
27
|
-
},
|
|
28
|
-
};
|
|
29
|
-
|
|
30
|
-
export const Secondary: Story = {
|
|
31
|
-
args: {
|
|
32
|
-
children: "Secondary",
|
|
33
|
-
variant: "secondary",
|
|
34
|
-
},
|
|
35
|
-
};
|
|
36
|
-
|
|
37
|
-
export const Destructive: Story = {
|
|
38
|
-
args: {
|
|
39
|
-
children: "Destructive",
|
|
40
|
-
variant: "destructive",
|
|
41
|
-
},
|
|
42
|
-
};
|
|
43
|
-
|
|
44
|
-
export const Outline: Story = {
|
|
45
|
-
args: {
|
|
46
|
-
children: "Outline",
|
|
47
|
-
variant: "outline",
|
|
48
|
-
},
|
|
49
|
-
};
|
|
50
|
-
|
|
51
|
-
export const AllVariants: Story = {
|
|
52
|
-
render: () => (
|
|
53
|
-
<div className="flex flex-wrap gap-4">
|
|
54
|
-
<Badge variant="default">Default</Badge>
|
|
55
|
-
<Badge variant="secondary">Secondary</Badge>
|
|
56
|
-
<Badge variant="destructive">Destructive</Badge>
|
|
57
|
-
<Badge variant="outline">Outline</Badge>
|
|
58
|
-
</div>
|
|
59
|
-
),
|
|
60
|
-
};
|
|
@@ -1,97 +0,0 @@
|
|
|
1
|
-
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
-
import {
|
|
3
|
-
Breadcrumb,
|
|
4
|
-
BreadcrumbItem,
|
|
5
|
-
BreadcrumbLink,
|
|
6
|
-
BreadcrumbList,
|
|
7
|
-
BreadcrumbPage,
|
|
8
|
-
BreadcrumbSeparator,
|
|
9
|
-
} from "../../components/ui/breadcrumb";
|
|
10
|
-
import { ChevronRight } from "lucide-react";
|
|
11
|
-
|
|
12
|
-
const meta = {
|
|
13
|
-
title: "UI/Breadcrumb",
|
|
14
|
-
component: Breadcrumb,
|
|
15
|
-
tags: ["autodocs"],
|
|
16
|
-
parameters: {
|
|
17
|
-
layout: "padded",
|
|
18
|
-
},
|
|
19
|
-
} satisfies Meta<typeof Breadcrumb>;
|
|
20
|
-
|
|
21
|
-
export default meta;
|
|
22
|
-
|
|
23
|
-
type Story = StoryObj<typeof meta>;
|
|
24
|
-
|
|
25
|
-
export const Default: Story = {
|
|
26
|
-
render: () => (
|
|
27
|
-
<Breadcrumb>
|
|
28
|
-
<BreadcrumbList>
|
|
29
|
-
<BreadcrumbItem>
|
|
30
|
-
<BreadcrumbLink href="/">Home</BreadcrumbLink>
|
|
31
|
-
</BreadcrumbItem>
|
|
32
|
-
<BreadcrumbSeparator />
|
|
33
|
-
<BreadcrumbItem>
|
|
34
|
-
<BreadcrumbLink href="/docs">Documentation</BreadcrumbLink>
|
|
35
|
-
</BreadcrumbItem>
|
|
36
|
-
<BreadcrumbSeparator />
|
|
37
|
-
<BreadcrumbItem>
|
|
38
|
-
<BreadcrumbPage>Getting Started</BreadcrumbPage>
|
|
39
|
-
</BreadcrumbItem>
|
|
40
|
-
</BreadcrumbList>
|
|
41
|
-
</Breadcrumb>
|
|
42
|
-
),
|
|
43
|
-
};
|
|
44
|
-
|
|
45
|
-
export const WithCustomSeparator: Story = {
|
|
46
|
-
render: () => (
|
|
47
|
-
<Breadcrumb>
|
|
48
|
-
<BreadcrumbList>
|
|
49
|
-
<BreadcrumbItem>
|
|
50
|
-
<BreadcrumbLink href="/">Home</BreadcrumbLink>
|
|
51
|
-
</BreadcrumbItem>
|
|
52
|
-
<BreadcrumbSeparator>
|
|
53
|
-
<ChevronRight className="h-4 w-4" />
|
|
54
|
-
</BreadcrumbSeparator>
|
|
55
|
-
<BreadcrumbItem>
|
|
56
|
-
<BreadcrumbLink href="/products">Products</BreadcrumbLink>
|
|
57
|
-
</BreadcrumbItem>
|
|
58
|
-
<BreadcrumbSeparator>
|
|
59
|
-
<ChevronRight className="h-4 w-4" />
|
|
60
|
-
</BreadcrumbSeparator>
|
|
61
|
-
<BreadcrumbItem>
|
|
62
|
-
<BreadcrumbPage>Product Details</BreadcrumbPage>
|
|
63
|
-
</BreadcrumbItem>
|
|
64
|
-
</BreadcrumbList>
|
|
65
|
-
</Breadcrumb>
|
|
66
|
-
),
|
|
67
|
-
};
|
|
68
|
-
|
|
69
|
-
export const Long: Story = {
|
|
70
|
-
render: () => (
|
|
71
|
-
<Breadcrumb>
|
|
72
|
-
<BreadcrumbList>
|
|
73
|
-
<BreadcrumbItem>
|
|
74
|
-
<BreadcrumbLink href="/">Home</BreadcrumbLink>
|
|
75
|
-
</BreadcrumbItem>
|
|
76
|
-
<BreadcrumbSeparator />
|
|
77
|
-
<BreadcrumbItem>
|
|
78
|
-
<BreadcrumbLink href="/docs">Docs</BreadcrumbLink>
|
|
79
|
-
</BreadcrumbItem>
|
|
80
|
-
<BreadcrumbSeparator />
|
|
81
|
-
<BreadcrumbItem>
|
|
82
|
-
<BreadcrumbLink href="/docs/components">Components</BreadcrumbLink>
|
|
83
|
-
</BreadcrumbItem>
|
|
84
|
-
<BreadcrumbSeparator />
|
|
85
|
-
<BreadcrumbItem>
|
|
86
|
-
<BreadcrumbLink href="/docs/components/breadcrumb">
|
|
87
|
-
Breadcrumb
|
|
88
|
-
</BreadcrumbLink>
|
|
89
|
-
</BreadcrumbItem>
|
|
90
|
-
<BreadcrumbSeparator />
|
|
91
|
-
<BreadcrumbItem>
|
|
92
|
-
<BreadcrumbPage>Implementation</BreadcrumbPage>
|
|
93
|
-
</BreadcrumbItem>
|
|
94
|
-
</BreadcrumbList>
|
|
95
|
-
</Breadcrumb>
|
|
96
|
-
),
|
|
97
|
-
};
|