@windstream/react-shared-components 0.0.1
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/LICENSE +21 -0
- package/README.md +360 -0
- package/dist/core.d.ts +389 -0
- package/dist/index.d.ts +389 -0
- package/dist/index.esm.js +35 -0
- package/dist/index.esm.js.map +1 -0
- package/dist/index.js +35 -0
- package/dist/index.js.map +1 -0
- package/dist/styles.css +3 -0
- package/dist/utils/index.d.ts +11 -0
- package/dist/utils/index.esm.js +2 -0
- package/dist/utils/index.esm.js.map +1 -0
- package/dist/utils/index.js +2 -0
- package/dist/utils/index.js.map +1 -0
- package/package.json +151 -0
- package/src/components/accordion/Accordion.stories.tsx +225 -0
- package/src/components/accordion/index.tsx +36 -0
- package/src/components/accordion/types.ts +10 -0
- package/src/components/alert-card/AlertCard.stories.tsx +172 -0
- package/src/components/alert-card/index.tsx +35 -0
- package/src/components/alert-card/types.ts +9 -0
- package/src/components/brand-button/BrandButton.stories.tsx +221 -0
- package/src/components/brand-button/helpers.ts +35 -0
- package/src/components/brand-button/index.tsx +90 -0
- package/src/components/brand-button/types.ts +27 -0
- package/src/components/button/Button.stories.tsx +108 -0
- package/src/components/button/index.tsx +23 -0
- package/src/components/button/types.ts +14 -0
- package/src/components/call-button/CallButton.stories.tsx +324 -0
- package/src/components/call-button/index.tsx +80 -0
- package/src/components/call-button/types.ts +9 -0
- package/src/components/checkbox/Checkbox.stories.tsx +248 -0
- package/src/components/checkbox/index.tsx +185 -0
- package/src/components/checkbox/types.ts +24 -0
- package/src/components/checklist/Checklist.stories.tsx +151 -0
- package/src/components/checklist/index.tsx +33 -0
- package/src/components/checklist/types.ts +6 -0
- package/src/components/collapse/Collapse.stories.tsx +256 -0
- package/src/components/collapse/index.tsx +44 -0
- package/src/components/collapse/types.ts +6 -0
- package/src/components/divider/Divider.stories.tsx +206 -0
- package/src/components/divider/index.tsx +23 -0
- package/src/components/divider/type.ts +3 -0
- package/src/components/input/Input.stories.tsx +358 -0
- package/src/components/input/index.tsx +174 -0
- package/src/components/input/types.ts +37 -0
- package/src/components/link/Link.stories.tsx +163 -0
- package/src/components/link/index.tsx +96 -0
- package/src/components/link/types.ts +25 -0
- package/src/components/list/List.stories.tsx +272 -0
- package/src/components/list/index.tsx +86 -0
- package/src/components/list/list-item/index.tsx +36 -0
- package/src/components/list/list-item/types.ts +13 -0
- package/src/components/list/types.ts +29 -0
- package/src/components/material-icon/MaterialIcon.stories.tsx +330 -0
- package/src/components/material-icon/constants.ts +95 -0
- package/src/components/material-icon/index.tsx +44 -0
- package/src/components/material-icon/types.ts +31 -0
- package/src/components/modal/Modal.stories.tsx +171 -0
- package/src/components/modal/index.tsx +168 -0
- package/src/components/modal/types.ts +24 -0
- package/src/components/radio-button/RadioButton.stories.tsx +307 -0
- package/src/components/radio-button/index.tsx +73 -0
- package/src/components/radio-button/types.ts +22 -0
- package/src/components/see-more/SeeMore.stories.tsx +182 -0
- package/src/components/see-more/index.tsx +38 -0
- package/src/components/see-more/types.ts +4 -0
- package/src/components/select/Select.stories.tsx +410 -0
- package/src/components/select/index.tsx +150 -0
- package/src/components/select/types.ts +34 -0
- package/src/components/select-plan-button/SelectPlanButton.stories.tsx +160 -0
- package/src/components/select-plan-button/index.tsx +21 -0
- package/src/components/select-plan-button/types.ts +4 -0
- package/src/components/skeleton/Skeleton.stories.tsx +180 -0
- package/src/components/skeleton/index.tsx +61 -0
- package/src/components/skeleton/types.ts +4 -0
- package/src/components/spinner/Spinner.stories.tsx +335 -0
- package/src/components/spinner/index.tsx +44 -0
- package/src/components/spinner/types.ts +5 -0
- package/src/components/text/Text.stories.tsx +302 -0
- package/src/components/text/index.tsx +26 -0
- package/src/components/text/types.ts +45 -0
- package/src/components/tooltip/Tooltip.stories.tsx +220 -0
- package/src/components/tooltip/index.tsx +78 -0
- package/src/components/tooltip/types.ts +7 -0
- package/src/components/view-cart-button/ViewCartButton.stories.tsx +241 -0
- package/src/components/view-cart-button/index.tsx +39 -0
- package/src/components/view-cart-button/types.ts +5 -0
- package/src/hooks/use-body-scroll-lock.ts +31 -0
- package/src/index.ts +81 -0
- package/src/setupTests.ts +46 -0
- package/src/stories/DocsTemplate.tsx +26 -0
- package/src/stories/assets/accessibility.png +0 -0
- package/src/stories/assets/accessibility.svg +1 -0
- package/src/stories/assets/addon-library.png +0 -0
- package/src/stories/assets/assets.png +0 -0
- package/src/stories/assets/avif-test-image.avif +0 -0
- package/src/stories/assets/context.png +0 -0
- package/src/stories/assets/discord.svg +1 -0
- package/src/stories/assets/docs.png +0 -0
- package/src/stories/assets/figma-plugin.png +0 -0
- package/src/stories/assets/github.svg +1 -0
- package/src/stories/assets/share.png +0 -0
- package/src/stories/assets/styling.png +0 -0
- package/src/stories/assets/testing.png +0 -0
- package/src/stories/assets/theming.png +0 -0
- package/src/stories/assets/tutorials.svg +1 -0
- package/src/stories/assets/youtube.svg +1 -0
- package/src/styles/globals.css +50 -0
- package/src/types/global.d.ts +9 -0
- package/src/utils/index.ts +49 -0
- package/tailwind.config.cjs +524 -0
|
@@ -0,0 +1,206 @@
|
|
|
1
|
+
import { Divider } from "./index";
|
|
2
|
+
import { DocsPage } from "@shared/stories/DocsTemplate";
|
|
3
|
+
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof Divider> = {
|
|
7
|
+
title: "Components/Divider",
|
|
8
|
+
component: Divider,
|
|
9
|
+
tags: ["autodocs"],
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: "centered",
|
|
12
|
+
docs: {
|
|
13
|
+
page: DocsPage,
|
|
14
|
+
description: {
|
|
15
|
+
component:
|
|
16
|
+
"A simple divider component used to separate content sections with a horizontal line.",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
argTypes: {
|
|
21
|
+
className: {
|
|
22
|
+
control: { type: "text" },
|
|
23
|
+
description: "Additional CSS classes",
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
args: {},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default meta;
|
|
30
|
+
type Story = StoryObj<typeof meta>;
|
|
31
|
+
|
|
32
|
+
// Default divider
|
|
33
|
+
export const Default: Story = {
|
|
34
|
+
args: {},
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
// Horizontal divider
|
|
38
|
+
export const Horizontal: Story = {
|
|
39
|
+
render: () => (
|
|
40
|
+
<div className="w-full max-w-md space-y-4">
|
|
41
|
+
<p className="body2 text-text">Content above the divider</p>
|
|
42
|
+
<Divider />
|
|
43
|
+
<p className="body2 text-text">Content below the divider</p>
|
|
44
|
+
</div>
|
|
45
|
+
),
|
|
46
|
+
parameters: {
|
|
47
|
+
docs: {
|
|
48
|
+
description: {
|
|
49
|
+
story: "Default horizontal divider separating content sections.",
|
|
50
|
+
},
|
|
51
|
+
},
|
|
52
|
+
},
|
|
53
|
+
};
|
|
54
|
+
|
|
55
|
+
// Custom styling
|
|
56
|
+
export const CustomStyling: Story = {
|
|
57
|
+
args: {
|
|
58
|
+
className: "h-0.5 bg-border-brand",
|
|
59
|
+
},
|
|
60
|
+
render: (args) => (
|
|
61
|
+
<div className="w-full max-w-md space-y-4">
|
|
62
|
+
<p className="body2 text-text">Content above</p>
|
|
63
|
+
<Divider {...args} />
|
|
64
|
+
<p className="body2 text-text">Content below</p>
|
|
65
|
+
</div>
|
|
66
|
+
),
|
|
67
|
+
};
|
|
68
|
+
|
|
69
|
+
// Multiple dividers
|
|
70
|
+
export const Multiple: Story = {
|
|
71
|
+
render: () => (
|
|
72
|
+
<div className="w-full max-w-md space-y-4">
|
|
73
|
+
<div>
|
|
74
|
+
<h3 className="subheading1 text-text mb-2">Section 1</h3>
|
|
75
|
+
<p className="body2 text-text">Content for section 1</p>
|
|
76
|
+
</div>
|
|
77
|
+
<Divider />
|
|
78
|
+
<div>
|
|
79
|
+
<h3 className="subheading1 text-text mb-2">Section 2</h3>
|
|
80
|
+
<p className="body2 text-text">Content for section 2</p>
|
|
81
|
+
</div>
|
|
82
|
+
<Divider />
|
|
83
|
+
<div>
|
|
84
|
+
<h3 className="subheading1 text-text mb-2">Section 3</h3>
|
|
85
|
+
<p className="body2 text-text">Content for section 3</p>
|
|
86
|
+
</div>
|
|
87
|
+
</div>
|
|
88
|
+
),
|
|
89
|
+
parameters: {
|
|
90
|
+
docs: {
|
|
91
|
+
description: {
|
|
92
|
+
story: "Multiple dividers used to separate different content sections.",
|
|
93
|
+
},
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
|
|
98
|
+
// In list
|
|
99
|
+
export const InList: Story = {
|
|
100
|
+
render: () => (
|
|
101
|
+
<div className="w-full max-w-md space-y-0 border border-border-default rounded">
|
|
102
|
+
<div className="p-4">
|
|
103
|
+
<p className="body2 text-text">List item 1</p>
|
|
104
|
+
</div>
|
|
105
|
+
<Divider />
|
|
106
|
+
<div className="p-4">
|
|
107
|
+
<p className="body2 text-text">List item 2</p>
|
|
108
|
+
</div>
|
|
109
|
+
<Divider />
|
|
110
|
+
<div className="p-4">
|
|
111
|
+
<p className="body2 text-text">List item 3</p>
|
|
112
|
+
</div>
|
|
113
|
+
</div>
|
|
114
|
+
),
|
|
115
|
+
parameters: {
|
|
116
|
+
docs: {
|
|
117
|
+
description: {
|
|
118
|
+
story: "Dividers used within a list to separate items.",
|
|
119
|
+
},
|
|
120
|
+
},
|
|
121
|
+
},
|
|
122
|
+
};
|
|
123
|
+
|
|
124
|
+
// Thick divider
|
|
125
|
+
export const Thick: Story = {
|
|
126
|
+
args: {
|
|
127
|
+
className: "h-1 bg-border-default",
|
|
128
|
+
},
|
|
129
|
+
render: (args) => (
|
|
130
|
+
<div className="w-full max-w-md space-y-4">
|
|
131
|
+
<p className="body2 text-text">Content above</p>
|
|
132
|
+
<Divider {...args} />
|
|
133
|
+
<p className="body2 text-text">Content below</p>
|
|
134
|
+
</div>
|
|
135
|
+
),
|
|
136
|
+
};
|
|
137
|
+
|
|
138
|
+
// Colored divider
|
|
139
|
+
export const Colored: Story = {
|
|
140
|
+
args: {
|
|
141
|
+
className: "h-0.5 bg-border-brand",
|
|
142
|
+
},
|
|
143
|
+
render: (args) => (
|
|
144
|
+
<div className="w-full max-w-md space-y-4">
|
|
145
|
+
<p className="body2 text-text">Content above</p>
|
|
146
|
+
<Divider {...args} />
|
|
147
|
+
<p className="body2 text-text">Content below</p>
|
|
148
|
+
</div>
|
|
149
|
+
),
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
// All variants showcase
|
|
153
|
+
export const AllVariants: Story = {
|
|
154
|
+
render: () => (
|
|
155
|
+
<div className="w-full max-w-2xl space-y-8">
|
|
156
|
+
<div>
|
|
157
|
+
<h3 className="mb-3 text-lg font-semibold">Default Divider</h3>
|
|
158
|
+
<div className="space-y-4">
|
|
159
|
+
<p className="body2 text-text">Content above</p>
|
|
160
|
+
<Divider />
|
|
161
|
+
<p className="body2 text-text">Content below</p>
|
|
162
|
+
</div>
|
|
163
|
+
</div>
|
|
164
|
+
<div>
|
|
165
|
+
<h3 className="mb-3 text-lg font-semibold">Custom Styled</h3>
|
|
166
|
+
<div className="space-y-4">
|
|
167
|
+
<p className="body2 text-text">Content above</p>
|
|
168
|
+
<Divider className="h-0.5 bg-border-brand" />
|
|
169
|
+
<p className="body2 text-text">Content below</p>
|
|
170
|
+
</div>
|
|
171
|
+
</div>
|
|
172
|
+
<div>
|
|
173
|
+
<h3 className="mb-3 text-lg font-semibold">Thick Divider</h3>
|
|
174
|
+
<div className="space-y-4">
|
|
175
|
+
<p className="body2 text-text">Content above</p>
|
|
176
|
+
<Divider className="h-1 bg-border-default" />
|
|
177
|
+
<p className="body2 text-text">Content below</p>
|
|
178
|
+
</div>
|
|
179
|
+
</div>
|
|
180
|
+
<div>
|
|
181
|
+
<h3 className="mb-3 text-lg font-semibold">In List</h3>
|
|
182
|
+
<div className="border border-border-default rounded">
|
|
183
|
+
<div className="p-4">
|
|
184
|
+
<p className="body2 text-text">Item 1</p>
|
|
185
|
+
</div>
|
|
186
|
+
<Divider />
|
|
187
|
+
<div className="p-4">
|
|
188
|
+
<p className="body2 text-text">Item 2</p>
|
|
189
|
+
</div>
|
|
190
|
+
<Divider />
|
|
191
|
+
<div className="p-4">
|
|
192
|
+
<p className="body2 text-text">Item 3</p>
|
|
193
|
+
</div>
|
|
194
|
+
</div>
|
|
195
|
+
</div>
|
|
196
|
+
</div>
|
|
197
|
+
),
|
|
198
|
+
parameters: {
|
|
199
|
+
docs: {
|
|
200
|
+
description: {
|
|
201
|
+
story: "Showcase of all divider variants and use cases.",
|
|
202
|
+
},
|
|
203
|
+
},
|
|
204
|
+
},
|
|
205
|
+
};
|
|
206
|
+
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
|
|
3
|
+
import { cx } from "@shared/utils";
|
|
4
|
+
|
|
5
|
+
import { DividerProps } from "./type";
|
|
6
|
+
|
|
7
|
+
export const Divider: React.FC<DividerProps> = (props: DividerProps) => {
|
|
8
|
+
const { className, ...rest } = props;
|
|
9
|
+
|
|
10
|
+
return (
|
|
11
|
+
<div
|
|
12
|
+
className={cx(
|
|
13
|
+
"bg-bg-surface-tertiary-active h-[1px] border-t-0 opacity-100",
|
|
14
|
+
className
|
|
15
|
+
)}
|
|
16
|
+
{...rest}
|
|
17
|
+
/>
|
|
18
|
+
);
|
|
19
|
+
};
|
|
20
|
+
|
|
21
|
+
Divider.displayName = "Divider";
|
|
22
|
+
|
|
23
|
+
export type { DividerProps };
|
|
@@ -0,0 +1,358 @@
|
|
|
1
|
+
import { Input } from "./index";
|
|
2
|
+
import { DocsPage } from "@shared/stories/DocsTemplate";
|
|
3
|
+
|
|
4
|
+
import type { Meta, StoryObj } from "@storybook/react";
|
|
5
|
+
|
|
6
|
+
const meta: Meta<typeof Input> = {
|
|
7
|
+
title: "Components/Input",
|
|
8
|
+
component: Input,
|
|
9
|
+
tags: ["autodocs"],
|
|
10
|
+
parameters: {
|
|
11
|
+
layout: "centered",
|
|
12
|
+
docs: {
|
|
13
|
+
page: DocsPage,
|
|
14
|
+
description: {
|
|
15
|
+
component:
|
|
16
|
+
"A comprehensive input component with support for labels, error states, icons, loading states, and multiple sizes.",
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
argTypes: {
|
|
21
|
+
placeholder: {
|
|
22
|
+
control: { type: "text" },
|
|
23
|
+
description: "Placeholder text",
|
|
24
|
+
},
|
|
25
|
+
label: {
|
|
26
|
+
control: { type: "text" },
|
|
27
|
+
description: "Label text",
|
|
28
|
+
},
|
|
29
|
+
size: {
|
|
30
|
+
control: { type: "select" },
|
|
31
|
+
options: ["slim", "medium", "large"],
|
|
32
|
+
description: "Input size",
|
|
33
|
+
},
|
|
34
|
+
state: {
|
|
35
|
+
control: { type: "select" },
|
|
36
|
+
options: ["default", "focus", "active", "hover", "filled", "error"],
|
|
37
|
+
description: "Visual state",
|
|
38
|
+
},
|
|
39
|
+
hasError: {
|
|
40
|
+
control: { type: "boolean" },
|
|
41
|
+
description: "Show error state",
|
|
42
|
+
},
|
|
43
|
+
errorText: {
|
|
44
|
+
control: { type: "text" },
|
|
45
|
+
description: "Error message text",
|
|
46
|
+
},
|
|
47
|
+
disabled: {
|
|
48
|
+
control: { type: "boolean" },
|
|
49
|
+
description: "Disable the input",
|
|
50
|
+
},
|
|
51
|
+
loading: {
|
|
52
|
+
control: { type: "boolean" },
|
|
53
|
+
description: "Show loading state",
|
|
54
|
+
},
|
|
55
|
+
required: {
|
|
56
|
+
control: { type: "boolean" },
|
|
57
|
+
description: "Mark input as required",
|
|
58
|
+
},
|
|
59
|
+
type: {
|
|
60
|
+
control: { type: "select" },
|
|
61
|
+
options: ["text", "email", "password", "number", "tel"],
|
|
62
|
+
description: "Input type",
|
|
63
|
+
},
|
|
64
|
+
prefixIconName: {
|
|
65
|
+
control: { type: "select" },
|
|
66
|
+
options: ["location_on", "search"],
|
|
67
|
+
description: "Prefix icon name",
|
|
68
|
+
},
|
|
69
|
+
suffixIconName: {
|
|
70
|
+
control: { type: "select" },
|
|
71
|
+
options: ["visibility", "visibility_off", "lock"],
|
|
72
|
+
description: "Suffix icon name",
|
|
73
|
+
},
|
|
74
|
+
},
|
|
75
|
+
args: {
|
|
76
|
+
placeholder: "Enter text...",
|
|
77
|
+
size: "medium",
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
|
|
81
|
+
export default meta;
|
|
82
|
+
type Story = StoryObj<typeof meta>;
|
|
83
|
+
|
|
84
|
+
// Default input
|
|
85
|
+
export const Default: Story = {
|
|
86
|
+
args: {},
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
// With label
|
|
90
|
+
export const WithLabel: Story = {
|
|
91
|
+
args: {
|
|
92
|
+
label: "Email Address",
|
|
93
|
+
placeholder: "Enter your email",
|
|
94
|
+
},
|
|
95
|
+
};
|
|
96
|
+
|
|
97
|
+
// Required input
|
|
98
|
+
export const Required: Story = {
|
|
99
|
+
args: {
|
|
100
|
+
label: "Required Field",
|
|
101
|
+
placeholder: "This field is required",
|
|
102
|
+
required: true,
|
|
103
|
+
},
|
|
104
|
+
};
|
|
105
|
+
|
|
106
|
+
// Error state
|
|
107
|
+
export const Error: Story = {
|
|
108
|
+
args: {
|
|
109
|
+
label: "Email Address",
|
|
110
|
+
placeholder: "Enter your email",
|
|
111
|
+
hasError: true,
|
|
112
|
+
errorText: "Please enter a valid email address",
|
|
113
|
+
},
|
|
114
|
+
};
|
|
115
|
+
|
|
116
|
+
// Different sizes
|
|
117
|
+
export const Sizes: Story = {
|
|
118
|
+
render: () => (
|
|
119
|
+
<div className="w-full max-w-md space-y-4">
|
|
120
|
+
<div>
|
|
121
|
+
<Input
|
|
122
|
+
size="slim"
|
|
123
|
+
placeholder="Slim input"
|
|
124
|
+
label="Slim Size"
|
|
125
|
+
/>
|
|
126
|
+
</div>
|
|
127
|
+
<div>
|
|
128
|
+
<Input
|
|
129
|
+
size="medium"
|
|
130
|
+
placeholder="Medium input"
|
|
131
|
+
label="Medium Size"
|
|
132
|
+
/>
|
|
133
|
+
</div>
|
|
134
|
+
<div>
|
|
135
|
+
<Input
|
|
136
|
+
size="large"
|
|
137
|
+
placeholder="Large input"
|
|
138
|
+
label="Large Size"
|
|
139
|
+
/>
|
|
140
|
+
</div>
|
|
141
|
+
</div>
|
|
142
|
+
),
|
|
143
|
+
parameters: {
|
|
144
|
+
docs: {
|
|
145
|
+
description: {
|
|
146
|
+
story: "All available input sizes: slim, medium, and large.",
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
},
|
|
150
|
+
};
|
|
151
|
+
|
|
152
|
+
// With prefix icon
|
|
153
|
+
export const WithPrefixIcon: Story = {
|
|
154
|
+
args: {
|
|
155
|
+
label: "Search",
|
|
156
|
+
placeholder: "Search...",
|
|
157
|
+
prefixIconName: "search",
|
|
158
|
+
prefixIconSize: 24,
|
|
159
|
+
},
|
|
160
|
+
};
|
|
161
|
+
|
|
162
|
+
// With suffix icon
|
|
163
|
+
export const WithSuffixIcon: Story = {
|
|
164
|
+
args: {
|
|
165
|
+
label: "Password",
|
|
166
|
+
placeholder: "Enter password",
|
|
167
|
+
type: "password",
|
|
168
|
+
suffixIconName: "visibility",
|
|
169
|
+
suffixIconSize: 24,
|
|
170
|
+
},
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
// Password input
|
|
174
|
+
export const Password: Story = {
|
|
175
|
+
args: {
|
|
176
|
+
label: "Password",
|
|
177
|
+
placeholder: "Enter your password",
|
|
178
|
+
type: "password",
|
|
179
|
+
suffixIconName: "visibility",
|
|
180
|
+
},
|
|
181
|
+
};
|
|
182
|
+
|
|
183
|
+
// Loading state
|
|
184
|
+
export const Loading: Story = {
|
|
185
|
+
args: {
|
|
186
|
+
label: "Loading Input",
|
|
187
|
+
placeholder: "Loading...",
|
|
188
|
+
loading: true,
|
|
189
|
+
},
|
|
190
|
+
};
|
|
191
|
+
|
|
192
|
+
// Disabled state
|
|
193
|
+
export const Disabled: Story = {
|
|
194
|
+
args: {
|
|
195
|
+
label: "Disabled Input",
|
|
196
|
+
placeholder: "This input is disabled",
|
|
197
|
+
disabled: true,
|
|
198
|
+
},
|
|
199
|
+
};
|
|
200
|
+
|
|
201
|
+
// Different states
|
|
202
|
+
export const States: Story = {
|
|
203
|
+
render: () => (
|
|
204
|
+
<div className="w-full max-w-md space-y-4">
|
|
205
|
+
<div>
|
|
206
|
+
<Input
|
|
207
|
+
label="Default State"
|
|
208
|
+
placeholder="Default input"
|
|
209
|
+
state="default"
|
|
210
|
+
/>
|
|
211
|
+
</div>
|
|
212
|
+
<div>
|
|
213
|
+
<Input
|
|
214
|
+
label="Hover State"
|
|
215
|
+
placeholder="Hover over me"
|
|
216
|
+
state="hover"
|
|
217
|
+
/>
|
|
218
|
+
</div>
|
|
219
|
+
<div>
|
|
220
|
+
<Input
|
|
221
|
+
label="Focus State"
|
|
222
|
+
placeholder="Focus on me"
|
|
223
|
+
state="focus"
|
|
224
|
+
/>
|
|
225
|
+
</div>
|
|
226
|
+
<div>
|
|
227
|
+
<Input
|
|
228
|
+
label="Error State"
|
|
229
|
+
placeholder="Error input"
|
|
230
|
+
state="error"
|
|
231
|
+
errorText="This field has an error"
|
|
232
|
+
/>
|
|
233
|
+
</div>
|
|
234
|
+
</div>
|
|
235
|
+
),
|
|
236
|
+
parameters: {
|
|
237
|
+
docs: {
|
|
238
|
+
description: {
|
|
239
|
+
story: "Different visual states of the input component.",
|
|
240
|
+
},
|
|
241
|
+
},
|
|
242
|
+
},
|
|
243
|
+
};
|
|
244
|
+
|
|
245
|
+
// Email input
|
|
246
|
+
export const Email: Story = {
|
|
247
|
+
args: {
|
|
248
|
+
label: "Email",
|
|
249
|
+
placeholder: "example@email.com",
|
|
250
|
+
type: "email",
|
|
251
|
+
},
|
|
252
|
+
};
|
|
253
|
+
|
|
254
|
+
// Phone input
|
|
255
|
+
export const Phone: Story = {
|
|
256
|
+
args: {
|
|
257
|
+
label: "Phone Number",
|
|
258
|
+
placeholder: "(555) 123-4567",
|
|
259
|
+
type: "tel",
|
|
260
|
+
},
|
|
261
|
+
};
|
|
262
|
+
|
|
263
|
+
// Form example
|
|
264
|
+
export const FormExample: Story = {
|
|
265
|
+
render: () => (
|
|
266
|
+
<form className="w-full max-w-md space-y-4">
|
|
267
|
+
<Input
|
|
268
|
+
label="First Name"
|
|
269
|
+
placeholder="Enter your first name"
|
|
270
|
+
required
|
|
271
|
+
/>
|
|
272
|
+
<Input
|
|
273
|
+
label="Last Name"
|
|
274
|
+
placeholder="Enter your last name"
|
|
275
|
+
required
|
|
276
|
+
/>
|
|
277
|
+
<Input
|
|
278
|
+
label="Email"
|
|
279
|
+
placeholder="Enter your email"
|
|
280
|
+
type="email"
|
|
281
|
+
required
|
|
282
|
+
/>
|
|
283
|
+
<Input
|
|
284
|
+
label="Password"
|
|
285
|
+
placeholder="Enter your password"
|
|
286
|
+
type="password"
|
|
287
|
+
suffixIconName="visibility"
|
|
288
|
+
required
|
|
289
|
+
/>
|
|
290
|
+
<Input
|
|
291
|
+
label="Phone Number"
|
|
292
|
+
placeholder="(555) 123-4567"
|
|
293
|
+
type="tel"
|
|
294
|
+
/>
|
|
295
|
+
</form>
|
|
296
|
+
),
|
|
297
|
+
parameters: {
|
|
298
|
+
docs: {
|
|
299
|
+
description: {
|
|
300
|
+
story: "Example of multiple inputs used together in a form.",
|
|
301
|
+
},
|
|
302
|
+
},
|
|
303
|
+
},
|
|
304
|
+
};
|
|
305
|
+
|
|
306
|
+
// All variants showcase
|
|
307
|
+
export const AllVariants: Story = {
|
|
308
|
+
render: () => (
|
|
309
|
+
<div className="w-full max-w-2xl space-y-6">
|
|
310
|
+
<div>
|
|
311
|
+
<h3 className="mb-3 text-lg font-semibold">Sizes</h3>
|
|
312
|
+
<div className="space-y-3">
|
|
313
|
+
<Input size="slim" placeholder="Slim" label="Slim" />
|
|
314
|
+
<Input size="medium" placeholder="Medium" label="Medium" />
|
|
315
|
+
<Input size="large" placeholder="Large" label="Large" />
|
|
316
|
+
</div>
|
|
317
|
+
</div>
|
|
318
|
+
<div>
|
|
319
|
+
<h3 className="mb-3 text-lg font-semibold">With Icons</h3>
|
|
320
|
+
<div className="space-y-3">
|
|
321
|
+
<Input
|
|
322
|
+
placeholder="Search..."
|
|
323
|
+
label="With Prefix Icon"
|
|
324
|
+
prefixIconName="search"
|
|
325
|
+
/>
|
|
326
|
+
<Input
|
|
327
|
+
placeholder="Password"
|
|
328
|
+
label="With Suffix Icon"
|
|
329
|
+
type="password"
|
|
330
|
+
suffixIconName="visibility"
|
|
331
|
+
/>
|
|
332
|
+
</div>
|
|
333
|
+
</div>
|
|
334
|
+
<div>
|
|
335
|
+
<h3 className="mb-3 text-lg font-semibold">States</h3>
|
|
336
|
+
<div className="space-y-3">
|
|
337
|
+
<Input placeholder="Default" label="Default" />
|
|
338
|
+
<Input
|
|
339
|
+
placeholder="Error"
|
|
340
|
+
label="Error"
|
|
341
|
+
hasError
|
|
342
|
+
errorText="This field has an error"
|
|
343
|
+
/>
|
|
344
|
+
<Input placeholder="Loading" label="Loading" loading />
|
|
345
|
+
<Input placeholder="Disabled" label="Disabled" disabled />
|
|
346
|
+
</div>
|
|
347
|
+
</div>
|
|
348
|
+
</div>
|
|
349
|
+
),
|
|
350
|
+
parameters: {
|
|
351
|
+
docs: {
|
|
352
|
+
description: {
|
|
353
|
+
story: "Complete showcase of all input variants, sizes, and states.",
|
|
354
|
+
},
|
|
355
|
+
},
|
|
356
|
+
},
|
|
357
|
+
};
|
|
358
|
+
|