oneslash-design-system 1.2.24 → 1.2.25
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/components/alert.d.ts +4 -2
- package/dist/components/alert.jsx +18 -13
- package/dist/components/button.d.ts +2 -1
- package/dist/components/button.jsx +5 -2
- package/dist/components/checkBox.d.ts +2 -1
- package/dist/components/checkBox.jsx +13 -6
- package/dist/components/emptyBox.d.ts +2 -1
- package/dist/components/emptyBox.jsx +9 -4
- package/dist/components/icon.d.ts +12 -0
- package/dist/components/icon.jsx +30 -0
- package/dist/components/line.d.ts +7 -0
- package/dist/components/line.jsx +10 -0
- package/dist/components/menuItem.d.ts +2 -1
- package/dist/components/menuItem.jsx +9 -4
- package/dist/components/modal.d.ts +3 -2
- package/dist/components/modal.jsx +43 -23
- package/dist/components/radioGroup.d.ts +1 -0
- package/dist/components/radioGroup.jsx +4 -1
- package/dist/components/tab.d.ts +6 -1
- package/dist/components/tab.jsx +11 -9
- package/dist/components/tabsContainer.jsx +4 -1
- package/dist/components/tag.d.ts +6 -3
- package/dist/components/tag.jsx +88 -28
- package/dist/components/textField.d.ts +5 -2
- package/dist/components/textField.jsx +29 -16
- package/dist/components/textarea.d.ts +4 -2
- package/dist/components/textarea.jsx +31 -11
- package/dist/output.css +537 -446
- package/dist/stories/Alert.stories.d.ts +15 -0
- package/dist/stories/Alert.stories.jsx +121 -0
- package/dist/stories/Button.stories.d.ts +12 -0
- package/dist/stories/Button.stories.jsx +81 -0
- package/dist/stories/Checkbox.stories.d.ts +10 -0
- package/dist/stories/Checkbox.stories.jsx +45 -0
- package/dist/stories/EmptyBox.stories.d.ts +7 -0
- package/dist/stories/EmptyBox.stories.jsx +30 -0
- package/dist/stories/Icon.stories.d.ts +13 -0
- package/dist/stories/Icon.stories.jsx +130 -0
- package/dist/stories/IconButton.stories.d.ts +13 -0
- package/dist/stories/IconButton.stories.jsx +87 -0
- package/dist/stories/Line.stories.d.ts +9 -0
- package/dist/stories/Line.stories.jsx +64 -0
- package/dist/stories/Link.stories.d.ts +10 -0
- package/dist/stories/Link.stories.jsx +59 -0
- package/dist/stories/LoadingScreen.stories.d.ts +10 -0
- package/dist/stories/LoadingScreen.stories.jsx +39 -0
- package/dist/stories/Menu.stories.d.ts +8 -0
- package/dist/stories/Menu.stories.jsx +42 -0
- package/dist/stories/MenuItem.stories.d.ts +11 -0
- package/dist/stories/MenuItem.stories.jsx +62 -0
- package/dist/stories/Modal.stories.d.ts +10 -0
- package/dist/stories/Modal.stories.jsx +77 -0
- package/dist/stories/Navigation.stories.d.ts +7 -0
- package/dist/stories/Navigation.stories.jsx +31 -0
- package/dist/stories/Popover.stories.d.ts +7 -0
- package/dist/stories/Popover.stories.jsx +47 -0
- package/dist/stories/RadioGroup.stories.d.ts +8 -0
- package/dist/stories/RadioGroup.stories.jsx +53 -0
- package/dist/stories/Select.stories.d.ts +10 -0
- package/dist/stories/Select.stories.jsx +85 -0
- package/dist/stories/Tab.stories.d.ts +11 -0
- package/dist/stories/Tab.stories.jsx +63 -0
- package/dist/stories/Table.stories.d.ts +8 -0
- package/dist/stories/Table.stories.jsx +84 -0
- package/dist/stories/TabsContainer.stories.d.ts +10 -0
- package/dist/stories/TabsContainer.stories.jsx +52 -0
- package/dist/stories/Tag.stories.d.ts +17 -0
- package/dist/stories/Tag.stories.jsx +143 -0
- package/dist/stories/TextField.stories.d.ts +13 -0
- package/dist/stories/TextField.stories.jsx +96 -0
- package/dist/stories/Textarea.stories.d.ts +12 -0
- package/dist/stories/Textarea.stories.jsx +84 -0
- package/dist/stories/TimeStamp.stories.d.ts +16 -0
- package/dist/stories/TimeStamp.stories.jsx +140 -0
- package/dist/stories/Tooltip.stories.d.ts +9 -0
- package/dist/stories/Tooltip.stories.jsx +52 -0
- package/dist/stories/UserImage.stories.d.ts +10 -0
- package/dist/stories/UserImage.stories.jsx +46 -0
- package/dist/tailwind.config.js +1 -0
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +10 -3
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import Alert from "../components/alert";
|
|
3
|
+
declare const meta: Meta<typeof Alert>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Alert>;
|
|
6
|
+
export declare const Success: Story;
|
|
7
|
+
export declare const Warning: Story;
|
|
8
|
+
export declare const Error: Story;
|
|
9
|
+
export declare const Info: Story;
|
|
10
|
+
export declare const AutoDismiss: Story;
|
|
11
|
+
export declare const InlineSuccess: Story;
|
|
12
|
+
export declare const InlineWarning: Story;
|
|
13
|
+
export declare const InlineError: Story;
|
|
14
|
+
export declare const InlineInfo: Story;
|
|
15
|
+
export declare const InlineAllTypes: Story;
|
|
@@ -0,0 +1,121 @@
|
|
|
1
|
+
import React, { useState } from "react";
|
|
2
|
+
import Alert from "../components/alert";
|
|
3
|
+
import Button from "../components/button";
|
|
4
|
+
var meta = {
|
|
5
|
+
title: "Components/Alert",
|
|
6
|
+
component: Alert,
|
|
7
|
+
argTypes: {
|
|
8
|
+
type: {
|
|
9
|
+
control: "select",
|
|
10
|
+
options: ["success", "warning", "error", "info", "default"],
|
|
11
|
+
},
|
|
12
|
+
variant: {
|
|
13
|
+
control: "select",
|
|
14
|
+
options: ["toast", "inline"],
|
|
15
|
+
},
|
|
16
|
+
message: { control: "text" },
|
|
17
|
+
showCloseButton: { control: "boolean" },
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
export default meta;
|
|
21
|
+
// Wrapper component to handle state
|
|
22
|
+
var AlertWrapper = function (args) {
|
|
23
|
+
var _a = useState(true), open = _a[0], setOpen = _a[1];
|
|
24
|
+
return (<div>
|
|
25
|
+
<Button size="medium" type="primary" state="enabled" label="Show Alert" onClickButton={function () { return setOpen(true); }}/>
|
|
26
|
+
<Alert {...args} open={open} onClose={function () { return setOpen(false); }}/>
|
|
27
|
+
</div>);
|
|
28
|
+
};
|
|
29
|
+
export var Success = {
|
|
30
|
+
render: function (args) { return <AlertWrapper {...args}/>; },
|
|
31
|
+
args: {
|
|
32
|
+
type: "success",
|
|
33
|
+
message: "Operation completed successfully!",
|
|
34
|
+
showCloseButton: true,
|
|
35
|
+
},
|
|
36
|
+
};
|
|
37
|
+
export var Warning = {
|
|
38
|
+
render: function (args) { return <AlertWrapper {...args}/>; },
|
|
39
|
+
args: {
|
|
40
|
+
type: "warning",
|
|
41
|
+
message: "Please review your changes before proceeding.",
|
|
42
|
+
showCloseButton: true,
|
|
43
|
+
},
|
|
44
|
+
};
|
|
45
|
+
export var Error = {
|
|
46
|
+
render: function (args) { return <AlertWrapper {...args}/>; },
|
|
47
|
+
args: {
|
|
48
|
+
type: "error",
|
|
49
|
+
message: "An error occurred. Please try again.",
|
|
50
|
+
showCloseButton: true,
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
export var Info = {
|
|
54
|
+
render: function (args) { return <AlertWrapper {...args}/>; },
|
|
55
|
+
args: {
|
|
56
|
+
type: "info",
|
|
57
|
+
message: "This is an informational message.",
|
|
58
|
+
showCloseButton: true,
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
export var AutoDismiss = {
|
|
62
|
+
render: function (args) { return <AlertWrapper {...args}/>; },
|
|
63
|
+
args: {
|
|
64
|
+
type: "info",
|
|
65
|
+
message: "This alert will auto-dismiss in 5 seconds.",
|
|
66
|
+
showCloseButton: false,
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
// Inline variant stories
|
|
70
|
+
var InlineAlertWrapper = function (args) {
|
|
71
|
+
var _a = useState(true), open = _a[0], setOpen = _a[1];
|
|
72
|
+
return (<div style={{ maxWidth: "500px" }}>
|
|
73
|
+
{!open && (<Button size="medium" type="primary" state="enabled" label="Show Alert" onClickButton={function () { return setOpen(true); }}/>)}
|
|
74
|
+
<Alert {...args} open={open} onClose={function () { return setOpen(false); }}/>
|
|
75
|
+
</div>);
|
|
76
|
+
};
|
|
77
|
+
export var InlineSuccess = {
|
|
78
|
+
render: function (args) { return <InlineAlertWrapper {...args}/>; },
|
|
79
|
+
args: {
|
|
80
|
+
type: "success",
|
|
81
|
+
message: "Your changes have been saved.",
|
|
82
|
+
variant: "inline",
|
|
83
|
+
showCloseButton: true,
|
|
84
|
+
},
|
|
85
|
+
};
|
|
86
|
+
export var InlineWarning = {
|
|
87
|
+
render: function (args) { return <InlineAlertWrapper {...args}/>; },
|
|
88
|
+
args: {
|
|
89
|
+
type: "warning",
|
|
90
|
+
message: "Your session will expire in 5 minutes.",
|
|
91
|
+
variant: "inline",
|
|
92
|
+
showCloseButton: true,
|
|
93
|
+
},
|
|
94
|
+
};
|
|
95
|
+
export var InlineError = {
|
|
96
|
+
render: function (args) { return <InlineAlertWrapper {...args}/>; },
|
|
97
|
+
args: {
|
|
98
|
+
type: "error",
|
|
99
|
+
message: "Failed to save changes. Please try again.",
|
|
100
|
+
variant: "inline",
|
|
101
|
+
showCloseButton: true,
|
|
102
|
+
},
|
|
103
|
+
};
|
|
104
|
+
export var InlineInfo = {
|
|
105
|
+
render: function (args) { return <InlineAlertWrapper {...args}/>; },
|
|
106
|
+
args: {
|
|
107
|
+
type: "info",
|
|
108
|
+
message: "New features are available. Check them out!",
|
|
109
|
+
variant: "inline",
|
|
110
|
+
showCloseButton: true,
|
|
111
|
+
},
|
|
112
|
+
};
|
|
113
|
+
export var InlineAllTypes = {
|
|
114
|
+
render: function () { return (<div style={{ display: "flex", flexDirection: "column", gap: "12px", maxWidth: "500px" }}>
|
|
115
|
+
<Alert type="success" message="Success alert message" variant="inline" showCloseButton/>
|
|
116
|
+
<Alert type="warning" message="Warning alert message" variant="inline" showCloseButton/>
|
|
117
|
+
<Alert type="error" message="Error alert message" variant="inline" showCloseButton/>
|
|
118
|
+
<Alert type="info" message="Info alert message" variant="inline" showCloseButton/>
|
|
119
|
+
<Alert type="default" message="Default alert message" variant="inline" showCloseButton/>
|
|
120
|
+
</div>); },
|
|
121
|
+
};
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import Button from "../components/button";
|
|
3
|
+
declare const meta: Meta<typeof Button>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Button>;
|
|
6
|
+
export declare const Primary: Story;
|
|
7
|
+
export declare const Secondary: Story;
|
|
8
|
+
export declare const Tertiary: Story;
|
|
9
|
+
export declare const WithIcons: Story;
|
|
10
|
+
export declare const Disabled: Story;
|
|
11
|
+
export declare const Small: Story;
|
|
12
|
+
export declare const Large: Story;
|
|
@@ -0,0 +1,81 @@
|
|
|
1
|
+
import Button from "../components/button";
|
|
2
|
+
var meta = {
|
|
3
|
+
title: "Components/Button",
|
|
4
|
+
component: Button,
|
|
5
|
+
argTypes: {
|
|
6
|
+
size: {
|
|
7
|
+
control: "select",
|
|
8
|
+
options: ["small", "medium", "large"],
|
|
9
|
+
},
|
|
10
|
+
type: {
|
|
11
|
+
control: "select",
|
|
12
|
+
options: ["primary", "secondary", "tertiary", "textOnly"],
|
|
13
|
+
},
|
|
14
|
+
state: {
|
|
15
|
+
control: "select",
|
|
16
|
+
options: ["enabled", "hovered", "focused", "disabled"],
|
|
17
|
+
},
|
|
18
|
+
label: { control: "text" },
|
|
19
|
+
decoIcon: { control: "text" },
|
|
20
|
+
actionIcon: { control: "text" },
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
export default meta;
|
|
24
|
+
export var Primary = {
|
|
25
|
+
args: {
|
|
26
|
+
size: "medium",
|
|
27
|
+
type: "primary",
|
|
28
|
+
state: "enabled",
|
|
29
|
+
label: "Primary Button",
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
export var Secondary = {
|
|
33
|
+
args: {
|
|
34
|
+
size: "medium",
|
|
35
|
+
type: "secondary",
|
|
36
|
+
state: "enabled",
|
|
37
|
+
label: "Secondary Button",
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
export var Tertiary = {
|
|
41
|
+
args: {
|
|
42
|
+
size: "medium",
|
|
43
|
+
type: "tertiary",
|
|
44
|
+
state: "enabled",
|
|
45
|
+
label: "Tertiary Button",
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
export var WithIcons = {
|
|
49
|
+
args: {
|
|
50
|
+
size: "medium",
|
|
51
|
+
type: "primary",
|
|
52
|
+
state: "enabled",
|
|
53
|
+
label: "With Icons",
|
|
54
|
+
decoIcon: "Star",
|
|
55
|
+
actionIcon: "ChevronRight",
|
|
56
|
+
},
|
|
57
|
+
};
|
|
58
|
+
export var Disabled = {
|
|
59
|
+
args: {
|
|
60
|
+
size: "medium",
|
|
61
|
+
type: "primary",
|
|
62
|
+
state: "disabled",
|
|
63
|
+
label: "Disabled Button",
|
|
64
|
+
},
|
|
65
|
+
};
|
|
66
|
+
export var Small = {
|
|
67
|
+
args: {
|
|
68
|
+
size: "small",
|
|
69
|
+
type: "primary",
|
|
70
|
+
state: "enabled",
|
|
71
|
+
label: "Small Button",
|
|
72
|
+
},
|
|
73
|
+
};
|
|
74
|
+
export var Large = {
|
|
75
|
+
args: {
|
|
76
|
+
size: "large",
|
|
77
|
+
type: "primary",
|
|
78
|
+
state: "enabled",
|
|
79
|
+
label: "Large Button",
|
|
80
|
+
},
|
|
81
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import Checkbox from "../components/checkBox";
|
|
3
|
+
declare const meta: Meta<typeof Checkbox>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Checkbox>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Checked: Story;
|
|
8
|
+
export declare const Disabled: Story;
|
|
9
|
+
export declare const DisabledChecked: Story;
|
|
10
|
+
export declare const NoLabel: Story;
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
import Checkbox from "../components/checkBox";
|
|
2
|
+
var meta = {
|
|
3
|
+
title: "Components/Checkbox",
|
|
4
|
+
component: Checkbox,
|
|
5
|
+
argTypes: {
|
|
6
|
+
label: { control: "text" },
|
|
7
|
+
checked: { control: "boolean" },
|
|
8
|
+
disabled: { control: "boolean" },
|
|
9
|
+
},
|
|
10
|
+
};
|
|
11
|
+
export default meta;
|
|
12
|
+
export var Default = {
|
|
13
|
+
args: {
|
|
14
|
+
label: "Accept terms and conditions",
|
|
15
|
+
checked: false,
|
|
16
|
+
disabled: false,
|
|
17
|
+
},
|
|
18
|
+
};
|
|
19
|
+
export var Checked = {
|
|
20
|
+
args: {
|
|
21
|
+
label: "I agree to the privacy policy",
|
|
22
|
+
checked: true,
|
|
23
|
+
disabled: false,
|
|
24
|
+
},
|
|
25
|
+
};
|
|
26
|
+
export var Disabled = {
|
|
27
|
+
args: {
|
|
28
|
+
label: "This option is disabled",
|
|
29
|
+
checked: false,
|
|
30
|
+
disabled: true,
|
|
31
|
+
},
|
|
32
|
+
};
|
|
33
|
+
export var DisabledChecked = {
|
|
34
|
+
args: {
|
|
35
|
+
label: "Disabled and checked",
|
|
36
|
+
checked: true,
|
|
37
|
+
disabled: true,
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
export var NoLabel = {
|
|
41
|
+
args: {
|
|
42
|
+
checked: false,
|
|
43
|
+
disabled: false,
|
|
44
|
+
},
|
|
45
|
+
};
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import EmptyBox from "../components/emptyBox";
|
|
3
|
+
declare const meta: Meta<typeof EmptyBox>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof EmptyBox>;
|
|
6
|
+
export declare const Small: Story;
|
|
7
|
+
export declare const Large: Story;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import EmptyBox from "../components/emptyBox";
|
|
2
|
+
var meta = {
|
|
3
|
+
title: "Components/EmptyBox",
|
|
4
|
+
component: EmptyBox,
|
|
5
|
+
argTypes: {
|
|
6
|
+
text: { control: "text" },
|
|
7
|
+
size: {
|
|
8
|
+
control: "select",
|
|
9
|
+
options: ["small", "large"],
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
export default meta;
|
|
14
|
+
export var Small = {
|
|
15
|
+
args: {
|
|
16
|
+
text: "No items found",
|
|
17
|
+
size: "small",
|
|
18
|
+
},
|
|
19
|
+
};
|
|
20
|
+
export var Large = {
|
|
21
|
+
args: {
|
|
22
|
+
text: "No data available. Try adding some items to get started.",
|
|
23
|
+
size: "large",
|
|
24
|
+
},
|
|
25
|
+
decorators: [
|
|
26
|
+
function (Story) { return (<div style={{ height: "300px" }}>
|
|
27
|
+
<Story />
|
|
28
|
+
</div>); },
|
|
29
|
+
],
|
|
30
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import Icon from "../components/icon";
|
|
3
|
+
declare const meta: Meta<typeof Icon>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Icon>;
|
|
6
|
+
export declare const Default: Story;
|
|
7
|
+
export declare const Small: Story;
|
|
8
|
+
export declare const Large: Story;
|
|
9
|
+
export declare const CustomSize: Story;
|
|
10
|
+
export declare const AllColors: Story;
|
|
11
|
+
export declare const AllSizes: Story;
|
|
12
|
+
export declare const CommonIcons: Story;
|
|
13
|
+
export declare const StrokeWidths: Story;
|
|
@@ -0,0 +1,130 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Icon from "../components/icon";
|
|
3
|
+
var meta = {
|
|
4
|
+
title: "Components/Icon",
|
|
5
|
+
component: Icon,
|
|
6
|
+
argTypes: {
|
|
7
|
+
name: {
|
|
8
|
+
control: "text",
|
|
9
|
+
description: "Lucide icon name",
|
|
10
|
+
},
|
|
11
|
+
size: {
|
|
12
|
+
control: "select",
|
|
13
|
+
options: ["small", "medium", "large"],
|
|
14
|
+
},
|
|
15
|
+
color: {
|
|
16
|
+
control: "select",
|
|
17
|
+
options: ["primary", "secondary", "disabled", "error", "warning", "success", "info", "accent", "inherit"],
|
|
18
|
+
},
|
|
19
|
+
strokeWidth: {
|
|
20
|
+
control: { type: "range", min: 1, max: 4, step: 0.5 },
|
|
21
|
+
},
|
|
22
|
+
},
|
|
23
|
+
};
|
|
24
|
+
export default meta;
|
|
25
|
+
export var Default = {
|
|
26
|
+
args: {
|
|
27
|
+
name: "House",
|
|
28
|
+
size: "medium",
|
|
29
|
+
color: "primary",
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
export var Small = {
|
|
33
|
+
args: {
|
|
34
|
+
name: "Settings",
|
|
35
|
+
size: "small",
|
|
36
|
+
color: "primary",
|
|
37
|
+
},
|
|
38
|
+
};
|
|
39
|
+
export var Large = {
|
|
40
|
+
args: {
|
|
41
|
+
name: "Star",
|
|
42
|
+
size: "large",
|
|
43
|
+
color: "primary",
|
|
44
|
+
},
|
|
45
|
+
};
|
|
46
|
+
export var CustomSize = {
|
|
47
|
+
args: {
|
|
48
|
+
name: "Heart",
|
|
49
|
+
size: 48,
|
|
50
|
+
color: "error",
|
|
51
|
+
},
|
|
52
|
+
};
|
|
53
|
+
export var AllColors = {
|
|
54
|
+
render: function (args) { return (<div style={{ display: "flex", gap: "16px", alignItems: "center" }}>
|
|
55
|
+
<Icon {...args} color="primary"/>
|
|
56
|
+
<Icon {...args} color="secondary"/>
|
|
57
|
+
<Icon {...args} color="disabled"/>
|
|
58
|
+
<Icon {...args} color="error"/>
|
|
59
|
+
<Icon {...args} color="warning"/>
|
|
60
|
+
<Icon {...args} color="success"/>
|
|
61
|
+
<Icon {...args} color="info"/>
|
|
62
|
+
<Icon {...args} color="accent"/>
|
|
63
|
+
</div>); },
|
|
64
|
+
args: {
|
|
65
|
+
name: "Circle",
|
|
66
|
+
size: "large",
|
|
67
|
+
},
|
|
68
|
+
};
|
|
69
|
+
export var AllSizes = {
|
|
70
|
+
render: function (args) { return (<div style={{ display: "flex", gap: "16px", alignItems: "center" }}>
|
|
71
|
+
<Icon {...args} size="small"/>
|
|
72
|
+
<Icon {...args} size="medium"/>
|
|
73
|
+
<Icon {...args} size="large"/>
|
|
74
|
+
<Icon {...args} size={48}/>
|
|
75
|
+
</div>); },
|
|
76
|
+
args: {
|
|
77
|
+
name: "Star",
|
|
78
|
+
color: "accent",
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
export var CommonIcons = {
|
|
82
|
+
render: function (args) { return (<div style={{ display: "flex", gap: "16px", flexWrap: "wrap" }}>
|
|
83
|
+
<Icon {...args} name="House"/>
|
|
84
|
+
<Icon {...args} name="Settings"/>
|
|
85
|
+
<Icon {...args} name="User"/>
|
|
86
|
+
<Icon {...args} name="Mail"/>
|
|
87
|
+
<Icon {...args} name="Bell"/>
|
|
88
|
+
<Icon {...args} name="Search"/>
|
|
89
|
+
<Icon {...args} name="Heart"/>
|
|
90
|
+
<Icon {...args} name="Star"/>
|
|
91
|
+
<Icon {...args} name="Pencil"/>
|
|
92
|
+
<Icon {...args} name="Trash2"/>
|
|
93
|
+
<Icon {...args} name="Download"/>
|
|
94
|
+
<Icon {...args} name="Upload"/>
|
|
95
|
+
<Icon {...args} name="Share"/>
|
|
96
|
+
<Icon {...args} name="Copy"/>
|
|
97
|
+
<Icon {...args} name="Check"/>
|
|
98
|
+
<Icon {...args} name="X"/>
|
|
99
|
+
<Icon {...args} name="Plus"/>
|
|
100
|
+
<Icon {...args} name="Minus"/>
|
|
101
|
+
<Icon {...args} name="ChevronLeft"/>
|
|
102
|
+
<Icon {...args} name="ChevronRight"/>
|
|
103
|
+
<Icon {...args} name="ChevronUp"/>
|
|
104
|
+
<Icon {...args} name="ChevronDown"/>
|
|
105
|
+
<Icon {...args} name="ArrowLeft"/>
|
|
106
|
+
<Icon {...args} name="ArrowRight"/>
|
|
107
|
+
<Icon {...args} name="Info"/>
|
|
108
|
+
<Icon {...args} name="CircleAlert"/>
|
|
109
|
+
<Icon {...args} name="TriangleAlert"/>
|
|
110
|
+
<Icon {...args} name="CircleCheck"/>
|
|
111
|
+
</div>); },
|
|
112
|
+
args: {
|
|
113
|
+
size: "medium",
|
|
114
|
+
color: "primary",
|
|
115
|
+
},
|
|
116
|
+
};
|
|
117
|
+
export var StrokeWidths = {
|
|
118
|
+
render: function (args) { return (<div style={{ display: "flex", gap: "16px", alignItems: "center" }}>
|
|
119
|
+
<Icon {...args} strokeWidth={1}/>
|
|
120
|
+
<Icon {...args} strokeWidth={1.5}/>
|
|
121
|
+
<Icon {...args} strokeWidth={2}/>
|
|
122
|
+
<Icon {...args} strokeWidth={2.5}/>
|
|
123
|
+
<Icon {...args} strokeWidth={3}/>
|
|
124
|
+
</div>); },
|
|
125
|
+
args: {
|
|
126
|
+
name: "Heart",
|
|
127
|
+
size: "large",
|
|
128
|
+
color: "primary",
|
|
129
|
+
},
|
|
130
|
+
};
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import IconButton from "../components/iconButton";
|
|
3
|
+
declare const meta: Meta<typeof IconButton>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof IconButton>;
|
|
6
|
+
export declare const Primary: Story;
|
|
7
|
+
export declare const Secondary: Story;
|
|
8
|
+
export declare const Tertiary: Story;
|
|
9
|
+
export declare const IconOnly: Story;
|
|
10
|
+
export declare const Selected: Story;
|
|
11
|
+
export declare const Disabled: Story;
|
|
12
|
+
export declare const Loading: Story;
|
|
13
|
+
export declare const AllSizes: Story;
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import IconButton from "../components/iconButton";
|
|
3
|
+
var meta = {
|
|
4
|
+
title: "Components/IconButton",
|
|
5
|
+
component: IconButton,
|
|
6
|
+
argTypes: {
|
|
7
|
+
color: {
|
|
8
|
+
control: "select",
|
|
9
|
+
options: ["primary", "secondary", "tertiary", "iconOnly"],
|
|
10
|
+
},
|
|
11
|
+
state: {
|
|
12
|
+
control: "select",
|
|
13
|
+
options: ["enabled", "selected", "disabled"],
|
|
14
|
+
},
|
|
15
|
+
size: {
|
|
16
|
+
control: "select",
|
|
17
|
+
options: ["large", "medium", "small"],
|
|
18
|
+
},
|
|
19
|
+
iconName: { control: "text" },
|
|
20
|
+
loading: { control: "boolean" },
|
|
21
|
+
},
|
|
22
|
+
};
|
|
23
|
+
export default meta;
|
|
24
|
+
export var Primary = {
|
|
25
|
+
args: {
|
|
26
|
+
color: "primary",
|
|
27
|
+
state: "enabled",
|
|
28
|
+
size: "medium",
|
|
29
|
+
iconName: "Plus",
|
|
30
|
+
},
|
|
31
|
+
};
|
|
32
|
+
export var Secondary = {
|
|
33
|
+
args: {
|
|
34
|
+
color: "secondary",
|
|
35
|
+
state: "enabled",
|
|
36
|
+
size: "medium",
|
|
37
|
+
iconName: "Settings",
|
|
38
|
+
},
|
|
39
|
+
};
|
|
40
|
+
export var Tertiary = {
|
|
41
|
+
args: {
|
|
42
|
+
color: "tertiary",
|
|
43
|
+
state: "enabled",
|
|
44
|
+
size: "medium",
|
|
45
|
+
iconName: "Search",
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
export var IconOnly = {
|
|
49
|
+
args: {
|
|
50
|
+
color: "iconOnly",
|
|
51
|
+
state: "enabled",
|
|
52
|
+
size: "medium",
|
|
53
|
+
iconName: "X",
|
|
54
|
+
},
|
|
55
|
+
};
|
|
56
|
+
export var Selected = {
|
|
57
|
+
args: {
|
|
58
|
+
color: "primary",
|
|
59
|
+
state: "selected",
|
|
60
|
+
size: "medium",
|
|
61
|
+
iconName: "Check",
|
|
62
|
+
},
|
|
63
|
+
};
|
|
64
|
+
export var Disabled = {
|
|
65
|
+
args: {
|
|
66
|
+
color: "primary",
|
|
67
|
+
state: "disabled",
|
|
68
|
+
size: "medium",
|
|
69
|
+
iconName: "Plus",
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
export var Loading = {
|
|
73
|
+
args: {
|
|
74
|
+
color: "primary",
|
|
75
|
+
state: "enabled",
|
|
76
|
+
size: "medium",
|
|
77
|
+
iconName: "RefreshCw",
|
|
78
|
+
loading: true,
|
|
79
|
+
},
|
|
80
|
+
};
|
|
81
|
+
export var AllSizes = {
|
|
82
|
+
render: function () { return (<div style={{ display: "flex", gap: "16px", alignItems: "center" }}>
|
|
83
|
+
<IconButton color="primary" state="enabled" size="small" iconName="Star"/>
|
|
84
|
+
<IconButton color="primary" state="enabled" size="medium" iconName="Star"/>
|
|
85
|
+
<IconButton color="primary" state="enabled" size="large" iconName="Star"/>
|
|
86
|
+
</div>); },
|
|
87
|
+
};
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import Line from "../components/line";
|
|
3
|
+
declare const meta: Meta<typeof Line>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Line>;
|
|
6
|
+
export declare const Horizontal: Story;
|
|
7
|
+
export declare const Vertical: Story;
|
|
8
|
+
export declare const InFlexContainer: Story;
|
|
9
|
+
export declare const BetweenSections: Story;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import Line from "../components/line";
|
|
3
|
+
var meta = {
|
|
4
|
+
title: "Components/Line",
|
|
5
|
+
component: Line,
|
|
6
|
+
argTypes: {
|
|
7
|
+
direction: {
|
|
8
|
+
control: "select",
|
|
9
|
+
options: ["horizontal", "vertical"],
|
|
10
|
+
},
|
|
11
|
+
},
|
|
12
|
+
};
|
|
13
|
+
export default meta;
|
|
14
|
+
export var Horizontal = {
|
|
15
|
+
args: {
|
|
16
|
+
direction: "horizontal",
|
|
17
|
+
},
|
|
18
|
+
decorators: [
|
|
19
|
+
function (Story) { return (<div style={{ width: "100%", padding: "16px" }}>
|
|
20
|
+
<p>Content above</p>
|
|
21
|
+
<Story />
|
|
22
|
+
<p>Content below</p>
|
|
23
|
+
</div>); },
|
|
24
|
+
],
|
|
25
|
+
};
|
|
26
|
+
export var Vertical = {
|
|
27
|
+
args: {
|
|
28
|
+
direction: "vertical",
|
|
29
|
+
},
|
|
30
|
+
decorators: [
|
|
31
|
+
function (Story) { return (<div style={{ display: "flex", alignItems: "center", height: "100px", gap: "16px" }}>
|
|
32
|
+
<span>Left</span>
|
|
33
|
+
<Story />
|
|
34
|
+
<span>Right</span>
|
|
35
|
+
</div>); },
|
|
36
|
+
],
|
|
37
|
+
};
|
|
38
|
+
export var InFlexContainer = {
|
|
39
|
+
render: function () { return (<div style={{ display: "flex", alignItems: "center", gap: "16px", height: "40px" }}>
|
|
40
|
+
<span>Item 1</span>
|
|
41
|
+
<Line direction="vertical"/>
|
|
42
|
+
<span>Item 2</span>
|
|
43
|
+
<Line direction="vertical"/>
|
|
44
|
+
<span>Item 3</span>
|
|
45
|
+
</div>); },
|
|
46
|
+
};
|
|
47
|
+
export var BetweenSections = {
|
|
48
|
+
render: function () { return (<div style={{ display: "flex", flexDirection: "column", gap: "16px" }}>
|
|
49
|
+
<div>
|
|
50
|
+
<h3>Section 1</h3>
|
|
51
|
+
<p>Some content here</p>
|
|
52
|
+
</div>
|
|
53
|
+
<Line direction="horizontal"/>
|
|
54
|
+
<div>
|
|
55
|
+
<h3>Section 2</h3>
|
|
56
|
+
<p>More content here</p>
|
|
57
|
+
</div>
|
|
58
|
+
<Line direction="horizontal"/>
|
|
59
|
+
<div>
|
|
60
|
+
<h3>Section 3</h3>
|
|
61
|
+
<p>Even more content</p>
|
|
62
|
+
</div>
|
|
63
|
+
</div>); },
|
|
64
|
+
};
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
2
|
+
import Link from "../components/link";
|
|
3
|
+
declare const meta: Meta<typeof Link>;
|
|
4
|
+
export default meta;
|
|
5
|
+
type Story = StoryObj<typeof Link>;
|
|
6
|
+
export declare const Info: Story;
|
|
7
|
+
export declare const Error: Story;
|
|
8
|
+
export declare const Warning: Story;
|
|
9
|
+
export declare const Success: Story;
|
|
10
|
+
export declare const AllColors: Story;
|