@shohojdhara/atomix 0.3.14 → 0.3.15
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/CHANGELOG.md +20 -0
- package/build-tools/EXAMPLES.md +372 -0
- package/build-tools/README.md +242 -0
- package/build-tools/__tests__/error-handler.test.js +230 -0
- package/build-tools/__tests__/index.test.js +141 -0
- package/build-tools/__tests__/rollup-plugin.test.js +194 -0
- package/build-tools/__tests__/utils.test.js +161 -0
- package/build-tools/__tests__/vite-plugin.test.js +129 -0
- package/build-tools/__tests__/webpack-loader.test.js +190 -0
- package/build-tools/error-handler.js +308 -0
- package/build-tools/index.d.ts +43 -0
- package/build-tools/index.js +88 -0
- package/build-tools/package.json +67 -0
- package/build-tools/rollup-plugin.js +236 -0
- package/build-tools/types.d.ts +163 -0
- package/build-tools/utils.js +203 -0
- package/build-tools/vite-plugin.js +161 -0
- package/build-tools/webpack-loader.js +123 -0
- package/dist/atomix.css +203 -90
- package/dist/atomix.css.map +1 -1
- package/dist/atomix.min.css +3 -3
- package/dist/atomix.min.css.map +1 -1
- package/dist/build-tools/EXAMPLES.md +372 -0
- package/dist/build-tools/README.md +242 -0
- package/dist/build-tools/__tests__/error-handler.test.js +230 -0
- package/dist/build-tools/__tests__/index.test.js +141 -0
- package/dist/build-tools/__tests__/rollup-plugin.test.js +194 -0
- package/dist/build-tools/__tests__/utils.test.js +161 -0
- package/dist/build-tools/__tests__/vite-plugin.test.js +129 -0
- package/dist/build-tools/__tests__/webpack-loader.test.js +190 -0
- package/dist/build-tools/error-handler.js +308 -0
- package/dist/build-tools/index.d.ts +43 -0
- package/dist/build-tools/index.js +88 -0
- package/dist/build-tools/package.json +67 -0
- package/dist/build-tools/rollup-plugin.js +236 -0
- package/dist/build-tools/types.d.ts +163 -0
- package/dist/build-tools/utils.js +203 -0
- package/dist/build-tools/vite-plugin.js +161 -0
- package/dist/build-tools/webpack-loader.js +123 -0
- package/dist/charts.d.ts +1 -1
- package/dist/charts.js +86 -57
- package/dist/charts.js.map +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +136 -112
- package/dist/core.js.map +1 -1
- package/dist/forms.d.ts +2 -5
- package/dist/forms.js +140 -128
- package/dist/forms.js.map +1 -1
- package/dist/heavy.d.ts +1 -1
- package/dist/heavy.js +136 -112
- package/dist/heavy.js.map +1 -1
- package/dist/index.d.ts +9 -61
- package/dist/index.esm.js +237 -286
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +250 -299
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +23 -8
- package/scripts/atomix-cli.js +170 -73
- package/scripts/cli/__tests__/README.md +81 -0
- package/scripts/cli/__tests__/basic.test.js +115 -0
- package/scripts/cli/__tests__/component-generator.test.js +332 -0
- package/scripts/cli/__tests__/integration.test.js +327 -0
- package/scripts/cli/__tests__/test-setup.js +133 -0
- package/scripts/cli/__tests__/token-manager.test.js +251 -0
- package/scripts/cli/__tests__/utils.test.js +161 -0
- package/scripts/cli/component-generator.js +253 -299
- package/scripts/cli/dependency-checker.js +355 -0
- package/scripts/cli/interactive-init.js +46 -5
- package/scripts/cli/template-manager.js +0 -2
- package/scripts/cli/templates/common-templates.js +636 -0
- package/scripts/cli/templates/composable-templates.js +148 -126
- package/scripts/cli/templates/index.js +23 -16
- package/scripts/cli/templates/project-templates.js +151 -23
- package/scripts/cli/templates/react-templates.js +280 -210
- package/scripts/cli/templates/scss-templates.js +90 -91
- package/scripts/cli/templates/testing-templates.js +206 -27
- package/scripts/cli/templates/testing-utils.js +278 -0
- package/scripts/cli/templates/types-templates.js +70 -56
- package/scripts/cli/theme-bridge.js +8 -2
- package/scripts/cli/token-manager.js +318 -206
- package/scripts/cli/utils.js +0 -1
- package/src/components/Accordion/Accordion.stories.tsx +369 -870
- package/src/components/AtomixGlass/AtomixGlass.tsx +80 -39
- package/src/components/AtomixGlass/AtomixGlassContainer.tsx +103 -81
- package/src/components/AtomixGlass/__snapshots__/AtomixGlass.test.tsx.snap +8 -7
- package/src/components/AtomixGlass/glass-utils.ts +2 -2
- package/src/components/AtomixGlass/shader-utils.ts +5 -0
- package/src/components/AtomixGlass/stories/Customization.stories.tsx +131 -0
- package/src/components/AtomixGlass/stories/Examples.stories.tsx +2957 -2853
- package/src/components/AtomixGlass/stories/Modes.stories.tsx +1 -1
- package/src/components/AtomixGlass/stories/Overview.stories.tsx +348 -0
- package/src/components/AtomixGlass/stories/Performance.stories.tsx +103 -0
- package/src/components/AtomixGlass/stories/Playground.stories.tsx +50 -35
- package/src/components/AtomixGlass/stories/{ShaderVariants.stories.tsx → Shaders.stories.tsx} +1 -1
- package/src/components/AtomixGlass/stories/shared-components.tsx +90 -190
- package/src/components/Avatar/Avatar.stories.tsx +213 -1
- package/src/components/Badge/Badge.stories.tsx +121 -362
- package/src/components/Block/Block.stories.tsx +21 -12
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +141 -23
- package/src/components/Button/Button.stories.tsx +463 -1126
- package/src/components/Button/Button.test.tsx +107 -0
- package/src/components/Button/Button.tsx +46 -50
- package/src/components/Button/ButtonGroup.stories.tsx +373 -217
- package/src/components/Callout/Callout.stories.tsx +289 -634
- package/src/components/Card/Card.stories.tsx +248 -68
- package/src/components/Chart/Chart.stories.tsx +150 -8
- package/src/components/ColorModeToggle/ColorModeToggle.stories.tsx +151 -69
- package/src/components/Countdown/Countdown.stories.tsx +115 -8
- package/src/components/DataTable/DataTable.stories.tsx +346 -146
- package/src/components/DatePicker/DatePicker.stories.tsx +325 -1066
- package/src/components/Dropdown/Dropdown.stories.tsx +153 -33
- package/src/components/EdgePanel/EdgePanel.stories.tsx +230 -21
- package/src/components/Footer/Footer.stories.tsx +392 -328
- package/src/components/Form/Checkbox.stories.tsx +140 -6
- package/src/components/Form/Checkbox.test.tsx +63 -0
- package/src/components/Form/Checkbox.tsx +87 -51
- package/src/components/Form/Form.stories.tsx +119 -20
- package/src/components/Form/FormGroup.stories.tsx +127 -4
- package/src/components/Form/Radio.stories.tsx +140 -5
- package/src/components/Form/Select.stories.tsx +140 -8
- package/src/components/Form/Textarea.stories.tsx +149 -6
- package/src/components/Hero/Hero.stories.tsx +333 -32
- package/src/components/List/List.stories.tsx +141 -3
- package/src/components/Modal/Modal.stories.tsx +181 -42
- package/src/components/Popover/Popover.stories.tsx +448 -98
- package/src/components/Progress/Progress.stories.tsx +167 -5
- package/src/components/River/River.stories.tsx +1 -1
- package/src/components/SectionIntro/SectionIntro.stories.tsx +240 -48
- package/src/components/Spinner/Spinner.stories.tsx +102 -8
- package/src/components/Steps/Steps.stories.tsx +172 -43
- package/src/components/Tabs/Tabs.stories.tsx +136 -10
- package/src/components/Testimonial/Testimonial.stories.tsx +120 -3
- package/src/components/Todo/Todo.stories.tsx +198 -9
- package/src/components/Toggle/Toggle.stories.tsx +126 -39
- package/src/components/Tooltip/Tooltip.stories.tsx +194 -104
- package/src/components/Upload/Upload.stories.tsx +113 -24
- package/src/lib/README.md +2 -2
- package/src/lib/__tests__/theme-tools.test.ts +193 -0
- package/src/lib/composables/index.ts +2 -2
- package/src/lib/composables/useAtomixGlass.ts +28 -56
- package/src/lib/composables/useChartExport.ts +2 -7
- package/src/lib/composables/useDataTable.ts +46 -29
- package/src/lib/constants/components.ts +9 -32
- package/src/lib/theme/devtools/CLI.ts +1 -1
- package/src/lib/types/components.ts +1 -1
- package/src/lib/utils/__tests__/csv.test.ts +45 -0
- package/src/lib/utils/csv.ts +17 -0
- package/src/lib/utils/dataTableExport.ts +1 -10
- package/src/styles/01-settings/_index.scss +2 -1
- package/src/styles/01-settings/_settings.accordion.scss +28 -7
- package/src/styles/01-settings/_settings.colors.scss +11 -11
- package/src/styles/01-settings/_settings.typography.scss +5 -5
- package/src/styles/02-tools/_tools.utility-api.scss +14 -0
- package/src/styles/06-components/_components.accordion.scss +56 -14
- package/src/styles/06-components/_components.checkbox.scss +23 -17
- package/src/styles/99-utilities/_index.scss +2 -0
- package/src/styles/99-utilities/_utilities.scss +3 -1
- package/src/styles/99-utilities/_utilities.text-gradient.scss +45 -0
- package/themes/dark-complementary/README.md +98 -0
- package/themes/dark-complementary/index.scss +158 -0
- package/themes/default-light/README.md +81 -0
- package/themes/default-light/index.scss +154 -0
- package/themes/high-contrast/README.md +105 -0
- package/themes/high-contrast/index.scss +172 -0
- package/themes/test-theme/README.md +38 -0
- package/themes/test-theme/index.scss +47 -0
- package/scripts/cli/templates-original-backup.js +0 -1655
- package/scripts/cli/templates_backup.js +0 -684
- package/src/components/AtomixGlass/stories/AtomixGlass.stories.tsx +0 -1438
- package/src/lib/composables/useButton.ts +0 -93
- package/src/lib/composables/useCheckbox.ts +0 -70
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
import { fn } from '@storybook/test';
|
|
3
4
|
import { AtomixGlass } from '../AtomixGlass/AtomixGlass';
|
|
4
5
|
import { BADGE, SIZES, THEME_COLORS } from '../../lib/constants/components';
|
|
5
6
|
import { Badge } from './Badge';
|
|
@@ -25,28 +26,52 @@ const meta = {
|
|
|
25
26
|
control: { type: 'select' },
|
|
26
27
|
options: THEME_COLORS,
|
|
27
28
|
description: 'The visual style of the badge',
|
|
28
|
-
|
|
29
|
+
table: {
|
|
30
|
+
type: { summary: 'string' },
|
|
31
|
+
defaultValue: { summary: 'primary' },
|
|
32
|
+
},
|
|
29
33
|
},
|
|
30
34
|
size: {
|
|
31
35
|
control: { type: 'select' },
|
|
32
36
|
options: SIZES,
|
|
33
37
|
description: 'The size of the badge',
|
|
34
|
-
|
|
38
|
+
table: {
|
|
39
|
+
type: { summary: 'string' },
|
|
40
|
+
defaultValue: { summary: 'md' },
|
|
41
|
+
},
|
|
35
42
|
},
|
|
36
43
|
disabled: {
|
|
37
44
|
control: 'boolean',
|
|
38
45
|
description: 'Whether the badge is disabled',
|
|
46
|
+
table: {
|
|
47
|
+
type: { summary: 'boolean' },
|
|
48
|
+
defaultValue: { summary: 'false' },
|
|
49
|
+
},
|
|
39
50
|
},
|
|
40
51
|
icon: {
|
|
41
|
-
control: '
|
|
52
|
+
control: 'object',
|
|
42
53
|
description: 'Optional icon element to display in the badge',
|
|
54
|
+
table: {
|
|
55
|
+
type: { summary: 'ReactNode' },
|
|
56
|
+
},
|
|
43
57
|
},
|
|
44
58
|
glass: {
|
|
45
|
-
control: '
|
|
59
|
+
control: 'object',
|
|
46
60
|
description: 'Enable glass morphism effect',
|
|
61
|
+
table: {
|
|
62
|
+
type: { summary: 'boolean | GlassConfig' },
|
|
63
|
+
defaultValue: { summary: 'false' },
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
label: {
|
|
67
|
+
control: 'text',
|
|
68
|
+
description: 'The text content of the badge',
|
|
69
|
+
table: {
|
|
70
|
+
type: { summary: 'string' },
|
|
71
|
+
},
|
|
47
72
|
},
|
|
48
73
|
},
|
|
49
|
-
}
|
|
74
|
+
};
|
|
50
75
|
|
|
51
76
|
export default meta;
|
|
52
77
|
type Story = StoryObj<typeof meta>;
|
|
@@ -71,93 +96,16 @@ const Icon = () => (
|
|
|
71
96
|
);
|
|
72
97
|
|
|
73
98
|
/**
|
|
74
|
-
*
|
|
99
|
+
* Basic badge usage with minimal props
|
|
75
100
|
*/
|
|
76
|
-
export const
|
|
101
|
+
export const BasicUsage: Story = {
|
|
77
102
|
args: {
|
|
78
|
-
label: '
|
|
103
|
+
label: 'Badge',
|
|
79
104
|
variant: 'primary',
|
|
80
105
|
size: 'md',
|
|
81
106
|
},
|
|
82
107
|
};
|
|
83
108
|
|
|
84
|
-
/**
|
|
85
|
-
* Secondary badge variant - used for secondary information.
|
|
86
|
-
*/
|
|
87
|
-
export const Secondary: Story = {
|
|
88
|
-
args: {
|
|
89
|
-
label: 'Secondary',
|
|
90
|
-
variant: 'secondary',
|
|
91
|
-
size: 'md',
|
|
92
|
-
},
|
|
93
|
-
};
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* Success badge variant - indicates successful or positive status.
|
|
97
|
-
*/
|
|
98
|
-
export const Success: Story = {
|
|
99
|
-
args: {
|
|
100
|
-
label: 'Success',
|
|
101
|
-
variant: 'success',
|
|
102
|
-
size: 'md',
|
|
103
|
-
},
|
|
104
|
-
};
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Info badge variant - used for informational status.
|
|
108
|
-
*/
|
|
109
|
-
export const Info: Story = {
|
|
110
|
-
args: {
|
|
111
|
-
label: 'Info',
|
|
112
|
-
variant: 'info',
|
|
113
|
-
size: 'md',
|
|
114
|
-
},
|
|
115
|
-
};
|
|
116
|
-
|
|
117
|
-
/**
|
|
118
|
-
* Warning badge variant - indicates caution or warning status.
|
|
119
|
-
*/
|
|
120
|
-
export const Warning: Story = {
|
|
121
|
-
args: {
|
|
122
|
-
label: 'Warning',
|
|
123
|
-
variant: 'warning',
|
|
124
|
-
size: 'md',
|
|
125
|
-
},
|
|
126
|
-
};
|
|
127
|
-
|
|
128
|
-
/**
|
|
129
|
-
* Error badge variant - indicates error or critical status.
|
|
130
|
-
*/
|
|
131
|
-
export const Error: Story = {
|
|
132
|
-
args: {
|
|
133
|
-
label: 'Error',
|
|
134
|
-
variant: 'error',
|
|
135
|
-
size: 'md',
|
|
136
|
-
},
|
|
137
|
-
};
|
|
138
|
-
|
|
139
|
-
/**
|
|
140
|
-
* Light badge variant - light color scheme.
|
|
141
|
-
*/
|
|
142
|
-
export const Light: Story = {
|
|
143
|
-
args: {
|
|
144
|
-
label: 'Light',
|
|
145
|
-
variant: 'light',
|
|
146
|
-
size: 'md',
|
|
147
|
-
},
|
|
148
|
-
};
|
|
149
|
-
|
|
150
|
-
/**
|
|
151
|
-
* Dark badge variant - dark color scheme.
|
|
152
|
-
*/
|
|
153
|
-
export const Dark: Story = {
|
|
154
|
-
args: {
|
|
155
|
-
label: 'Dark',
|
|
156
|
-
variant: 'dark',
|
|
157
|
-
size: 'md',
|
|
158
|
-
},
|
|
159
|
-
};
|
|
160
|
-
|
|
161
109
|
/**
|
|
162
110
|
* Small size badge variant.
|
|
163
111
|
*/
|
|
@@ -192,44 +140,45 @@ export const Large: Story = {
|
|
|
192
140
|
};
|
|
193
141
|
|
|
194
142
|
/**
|
|
195
|
-
*
|
|
143
|
+
* Shows all badge states (default, disabled)
|
|
196
144
|
*/
|
|
197
|
-
export const
|
|
145
|
+
export const AllStates: Story = {
|
|
198
146
|
args: {
|
|
199
|
-
label: '
|
|
147
|
+
label: 'All States',
|
|
200
148
|
variant: 'primary',
|
|
201
|
-
size: 'md',
|
|
202
|
-
disabled: true,
|
|
203
149
|
},
|
|
150
|
+
render: () => (
|
|
151
|
+
<div className="u-flex u-flex-wrap u-gap-2">
|
|
152
|
+
<Badge label="Default" variant="primary" />
|
|
153
|
+
<Badge label="Disabled" variant="primary" disabled={true} />
|
|
154
|
+
</div>
|
|
155
|
+
),
|
|
204
156
|
};
|
|
205
157
|
|
|
206
158
|
/**
|
|
207
|
-
*
|
|
159
|
+
* Shows badges with icons in different positions
|
|
208
160
|
*/
|
|
209
|
-
export const
|
|
161
|
+
export const WithIcons: Story = {
|
|
210
162
|
args: {
|
|
211
|
-
label: 'With
|
|
163
|
+
label: 'With Icons',
|
|
212
164
|
variant: 'primary',
|
|
213
|
-
size: 'md',
|
|
214
|
-
icon: <Icon />,
|
|
215
165
|
},
|
|
166
|
+
render: () => (
|
|
167
|
+
<div className="u-flex u-flex-wrap u-gap-2">
|
|
168
|
+
<Badge label="With Icon" variant="primary" icon={<Icon />} />
|
|
169
|
+
<Badge label="Icon Only" variant="secondary" icon={<Icon />} />
|
|
170
|
+
</div>
|
|
171
|
+
),
|
|
216
172
|
};
|
|
217
173
|
|
|
218
174
|
/**
|
|
219
|
-
*
|
|
175
|
+
* Shows all available badge color variants
|
|
220
176
|
*/
|
|
221
177
|
export const AllVariants: Story = {
|
|
222
178
|
args: {
|
|
223
|
-
label: '
|
|
179
|
+
label: 'All Variants',
|
|
224
180
|
variant: 'primary',
|
|
225
181
|
},
|
|
226
|
-
parameters: {
|
|
227
|
-
docs: {
|
|
228
|
-
description: {
|
|
229
|
-
story: 'Displays all available badge color variants for easy comparison and selection.',
|
|
230
|
-
},
|
|
231
|
-
},
|
|
232
|
-
},
|
|
233
182
|
render: () => (
|
|
234
183
|
<div className="u-flex u-flex-wrap u-gap-2">
|
|
235
184
|
{THEME_COLORS.map(color => (
|
|
@@ -240,20 +189,13 @@ export const AllVariants: Story = {
|
|
|
240
189
|
};
|
|
241
190
|
|
|
242
191
|
/**
|
|
243
|
-
*
|
|
192
|
+
* Shows all available badge sizes
|
|
244
193
|
*/
|
|
245
194
|
export const AllSizes: Story = {
|
|
246
195
|
args: {
|
|
247
|
-
label: '
|
|
196
|
+
label: 'All Sizes',
|
|
248
197
|
variant: 'primary',
|
|
249
198
|
},
|
|
250
|
-
parameters: {
|
|
251
|
-
docs: {
|
|
252
|
-
description: {
|
|
253
|
-
story: 'Compares all available badge sizes to help choose the appropriate size for your use case.',
|
|
254
|
-
},
|
|
255
|
-
},
|
|
256
|
-
},
|
|
257
199
|
render: () => (
|
|
258
200
|
<div className="u-flex u-items-center u-gap-2">
|
|
259
201
|
<Badge label="Small" variant="primary" size="sm" />
|
|
@@ -264,44 +206,40 @@ export const AllSizes: Story = {
|
|
|
264
206
|
};
|
|
265
207
|
|
|
266
208
|
/**
|
|
267
|
-
*
|
|
209
|
+
* Shows numeric badges commonly used for notifications
|
|
268
210
|
*/
|
|
269
|
-
export const
|
|
211
|
+
export const NumericBadges: Story = {
|
|
270
212
|
args: {
|
|
271
|
-
label: '
|
|
213
|
+
label: 'Numeric Badges',
|
|
214
|
+
variant: 'primary',
|
|
272
215
|
},
|
|
273
216
|
render: () => (
|
|
274
|
-
<div className="u-flex u-
|
|
275
|
-
<
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
<
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
<Badge label="Warning" variant="warning" icon={<Icon />} />
|
|
301
|
-
<Badge label="Success" variant="success" icon={<Icon />} />
|
|
302
|
-
<Badge label="Error" variant="error" icon={<Icon />} />
|
|
303
|
-
</div>
|
|
304
|
-
</div>
|
|
217
|
+
<div className="u-flex u-gap-2">
|
|
218
|
+
<Badge label="1" variant="primary" />
|
|
219
|
+
<Badge label="2" variant="secondary" />
|
|
220
|
+
<Badge label="9+" variant="success" />
|
|
221
|
+
<Badge label="12" variant="error" />
|
|
222
|
+
<Badge label="5" variant="warning" />
|
|
223
|
+
<Badge label="42" variant="info" />
|
|
224
|
+
</div>
|
|
225
|
+
),
|
|
226
|
+
};
|
|
227
|
+
|
|
228
|
+
/**
|
|
229
|
+
* Shows status badges with different semantic meanings
|
|
230
|
+
*/
|
|
231
|
+
export const StatusBadges: Story = {
|
|
232
|
+
args: {
|
|
233
|
+
label: 'Status Badges',
|
|
234
|
+
variant: 'primary',
|
|
235
|
+
},
|
|
236
|
+
render: () => (
|
|
237
|
+
<div className="u-flex u-flex-wrap u-gap-2">
|
|
238
|
+
<Badge label="New" variant="primary" />
|
|
239
|
+
<Badge label="Active" variant="success" />
|
|
240
|
+
<Badge label="Pending" variant="warning" />
|
|
241
|
+
<Badge label="Failed" variant="error" />
|
|
242
|
+
<Badge label="Archived" variant="secondary" />
|
|
305
243
|
</div>
|
|
306
244
|
),
|
|
307
245
|
};
|
|
@@ -342,7 +280,7 @@ export const UsageExamples: Story = {
|
|
|
342
280
|
|
|
343
281
|
<div>
|
|
344
282
|
<h3 className="u-mt-0 u-mb-2">In cards</h3>
|
|
345
|
-
<div className="u-p-4 u-shadow u-flex u-flex-column u-gap-2">
|
|
283
|
+
<div className="u-p-4 u-rounded-lg u-shadow-md u-bg-white u-flex u-flex-column u-gap-2">
|
|
346
284
|
<div className="u-flex u-justify-between">
|
|
347
285
|
<h4 className="u-m-0">Product Title</h4>
|
|
348
286
|
<Badge label="Sale" variant="error" />
|
|
@@ -357,18 +295,12 @@ export const UsageExamples: Story = {
|
|
|
357
295
|
|
|
358
296
|
<div>
|
|
359
297
|
<h3 className="u-mt-0 u-mb-2">In lists</h3>
|
|
360
|
-
<ul className="u-p-0 u-m-0
|
|
361
|
-
<li
|
|
362
|
-
className="u-py-2 u-flex u-justify-between"
|
|
363
|
-
style={{ borderBottom: '1px solid #e0e0e0' }}
|
|
364
|
-
>
|
|
298
|
+
<ul className="u-p-0 u-m-0 u-list-none">
|
|
299
|
+
<li className="u-py-2 u-flex u-justify-between u-border-b u-border-gray-200">
|
|
365
300
|
<span>Task 1</span>
|
|
366
301
|
<Badge label="Completed" variant="success" size="sm" />
|
|
367
302
|
</li>
|
|
368
|
-
<li
|
|
369
|
-
className="u-py-2 u-flex u-justify-between"
|
|
370
|
-
style={{ borderBottom: '1px solid #e0e0e0' }}
|
|
371
|
-
>
|
|
303
|
+
<li className="u-py-2 u-flex u-justify-between u-border-b u-border-gray-200">
|
|
372
304
|
<span>Task 2</span>
|
|
373
305
|
<Badge label="In Progress" variant="warning" size="sm" />
|
|
374
306
|
</li>
|
|
@@ -383,194 +315,53 @@ export const UsageExamples: Story = {
|
|
|
383
315
|
};
|
|
384
316
|
|
|
385
317
|
/**
|
|
386
|
-
*
|
|
318
|
+
* Shows badge accessibility features
|
|
387
319
|
*/
|
|
388
|
-
export const
|
|
320
|
+
export const AccessibilityFeatures: Story = {
|
|
389
321
|
args: {
|
|
390
|
-
label: '
|
|
322
|
+
label: 'Accessibility Features',
|
|
391
323
|
variant: 'primary',
|
|
392
324
|
},
|
|
325
|
+
parameters: {
|
|
326
|
+
docs: {
|
|
327
|
+
description: {
|
|
328
|
+
story: 'Examples of accessible badge implementations with proper ARIA labels and keyboard navigation support.',
|
|
329
|
+
},
|
|
330
|
+
},
|
|
331
|
+
},
|
|
393
332
|
render: () => (
|
|
394
|
-
<div className="u-flex u-flex-column u-gap-
|
|
333
|
+
<div className="u-flex u-flex-column u-gap-4">
|
|
395
334
|
<div>
|
|
396
|
-
<h3 className="u-mt-0 u-mb-2">
|
|
397
|
-
<
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
<div className="u-flex u-gap-5 u-mt-4">
|
|
401
|
-
<div className="u-p-5 u-shadow u-flex-1">
|
|
402
|
-
<h4 className="u-mt-0">Current Theme</h4>
|
|
403
|
-
<div className="u-flex u-flex-wrap u-gap-2">
|
|
404
|
-
{THEME_COLORS.map(color => (
|
|
405
|
-
<Badge key={color} label={color} variant={color} />
|
|
406
|
-
))}
|
|
407
|
-
</div>
|
|
408
|
-
</div>
|
|
335
|
+
<h3 className="u-mt-0 u-mb-2">With ARIA Labels</h3>
|
|
336
|
+
<div className="u-flex u-gap-2">
|
|
337
|
+
<Badge label="Inbox" variant="primary" aria-label="3 new messages" />
|
|
338
|
+
<Badge label="Alert" variant="error" aria-label="Critical notification" />
|
|
409
339
|
</div>
|
|
410
340
|
</div>
|
|
411
|
-
|
|
341
|
+
|
|
412
342
|
<div>
|
|
413
|
-
<h3 className="u-mt-
|
|
414
|
-
<
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
<span className="u-inline-block" style={{ width: '120px' }}>
|
|
420
|
-
Primary:
|
|
421
|
-
</span>
|
|
422
|
-
<Badge label="New Feature" variant="primary" />
|
|
423
|
-
</div>
|
|
424
|
-
<div className="u-flex u-items-center u-gap-2">
|
|
425
|
-
<span className="u-inline-block" style={{ width: '120px' }}>
|
|
426
|
-
Success:
|
|
427
|
-
</span>
|
|
428
|
-
<Badge label="Completed" variant="success" />
|
|
429
|
-
</div>
|
|
430
|
-
<div className="u-flex u-items-center u-gap-2">
|
|
431
|
-
<span className="u-inline-block" style={{ width: '120px' }}>
|
|
432
|
-
Warning:
|
|
433
|
-
</span>
|
|
434
|
-
<Badge label="In Progress" variant="warning" />
|
|
435
|
-
</div>
|
|
436
|
-
<div className="u-flex u-items-center u-gap-2">
|
|
437
|
-
<span className="u-inline-block" style={{ width: '120px' }}>
|
|
438
|
-
Error:
|
|
439
|
-
</span>
|
|
440
|
-
<Badge label="Failed" variant="error" />
|
|
441
|
-
</div>
|
|
343
|
+
<h3 className="u-mt-0 u-mb-2">Interactive Badges</h3>
|
|
344
|
+
<div className="u-flex u-gap-2">
|
|
345
|
+
<Badge
|
|
346
|
+
label="Closable Tag"
|
|
347
|
+
variant="info"
|
|
348
|
+
/>
|
|
442
349
|
</div>
|
|
443
350
|
</div>
|
|
444
|
-
|
|
445
|
-
<div className="u-mt-4">
|
|
446
|
-
<p>
|
|
447
|
-
Use the Color Mode toggle in the Storybook toolbar to switch between light and dark mode!
|
|
448
|
-
</p>
|
|
449
|
-
</div>
|
|
450
351
|
</div>
|
|
451
352
|
),
|
|
452
353
|
};
|
|
453
354
|
|
|
454
355
|
/**
|
|
455
|
-
*
|
|
356
|
+
* Shows badges with glass effect enabled
|
|
456
357
|
*/
|
|
457
|
-
export const
|
|
358
|
+
export const WithGlassEffect: Story = {
|
|
458
359
|
args: {
|
|
459
|
-
label: 'Glass
|
|
360
|
+
label: 'Glass Effect',
|
|
460
361
|
variant: 'primary',
|
|
461
|
-
size: 'md',
|
|
462
|
-
glass: true,
|
|
463
|
-
},
|
|
464
|
-
decorators: [
|
|
465
|
-
Story => (
|
|
466
|
-
<div
|
|
467
|
-
style={{
|
|
468
|
-
background:
|
|
469
|
-
'url(https://cdn.pixabay.com/photo/2021/06/14/22/46/milky-way-6337038_1280.jpg)',
|
|
470
|
-
backgroundSize: 'cover',
|
|
471
|
-
backgroundPosition: 'center',
|
|
472
|
-
padding: '10rem 25rem',
|
|
473
|
-
borderRadius: '8px',
|
|
474
|
-
}}
|
|
475
|
-
>
|
|
476
|
-
<Story />
|
|
477
|
-
</div>
|
|
478
|
-
),
|
|
479
|
-
],
|
|
480
|
-
};
|
|
481
|
-
|
|
482
|
-
export const GlassSecondary: Story = {
|
|
483
|
-
args: {
|
|
484
|
-
label: 'Glass Secondary',
|
|
485
|
-
variant: 'secondary',
|
|
486
|
-
size: 'md',
|
|
487
|
-
glass: true,
|
|
488
|
-
},
|
|
489
|
-
decorators: [
|
|
490
|
-
Story => (
|
|
491
|
-
<div
|
|
492
|
-
style={{
|
|
493
|
-
background:
|
|
494
|
-
'url(https://images.unsplash.com/photo-1584384689201-e0bcbe2c7f1d?ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&q=80&w=1287)',
|
|
495
|
-
backgroundSize: 'cover',
|
|
496
|
-
backgroundPosition: 'center',
|
|
497
|
-
padding: '10rem 25rem',
|
|
498
|
-
borderRadius: '8px',
|
|
499
|
-
}}
|
|
500
|
-
>
|
|
501
|
-
<Story />
|
|
502
|
-
</div>
|
|
503
|
-
),
|
|
504
|
-
],
|
|
505
|
-
};
|
|
506
|
-
|
|
507
|
-
export const GlassSuccess: Story = {
|
|
508
|
-
args: {
|
|
509
|
-
label: 'Glass Success',
|
|
510
|
-
variant: 'success',
|
|
511
|
-
size: 'md',
|
|
512
|
-
glass: true,
|
|
513
|
-
},
|
|
514
|
-
decorators: [
|
|
515
|
-
Story => (
|
|
516
|
-
<div
|
|
517
|
-
style={{
|
|
518
|
-
background: 'url(https://cdn.pixabay.com/photo/2025/07/29/15/55/mantis-9742906_1280.jpg)',
|
|
519
|
-
backgroundSize: 'cover',
|
|
520
|
-
backgroundPosition: 'center',
|
|
521
|
-
padding: '10rem 25rem',
|
|
522
|
-
borderRadius: '8px',
|
|
523
|
-
}}
|
|
524
|
-
>
|
|
525
|
-
<Story />
|
|
526
|
-
</div>
|
|
527
|
-
),
|
|
528
|
-
],
|
|
529
|
-
};
|
|
530
|
-
|
|
531
|
-
export const GlassWithIcon: Story = {
|
|
532
|
-
args: {
|
|
533
|
-
label: 'Glass with Icon',
|
|
534
|
-
variant: 'primary',
|
|
535
|
-
size: 'md',
|
|
536
|
-
icon: <Icon />,
|
|
537
|
-
glass: true,
|
|
538
|
-
},
|
|
539
|
-
decorators: [
|
|
540
|
-
Story => (
|
|
541
|
-
<div
|
|
542
|
-
style={{
|
|
543
|
-
background:
|
|
544
|
-
'url(https://cdn.pixabay.com/photo/2023/07/07/20/42/grasshopper-8113345_1280.jpg)',
|
|
545
|
-
backgroundSize: 'cover',
|
|
546
|
-
backgroundPosition: 'center',
|
|
547
|
-
padding: '10rem 25rem',
|
|
548
|
-
borderRadius: '8px',
|
|
549
|
-
}}
|
|
550
|
-
>
|
|
551
|
-
<Story />
|
|
552
|
-
</div>
|
|
553
|
-
),
|
|
554
|
-
],
|
|
555
|
-
};
|
|
556
|
-
|
|
557
|
-
export const GlassAllVariants: Story = {
|
|
558
|
-
args: {
|
|
559
|
-
label: 'Glass Badge',
|
|
560
|
-
variant: 'primary',
|
|
561
|
-
glass: true,
|
|
562
362
|
},
|
|
563
363
|
render: () => (
|
|
564
|
-
<div
|
|
565
|
-
style={{
|
|
566
|
-
background:
|
|
567
|
-
'url(https://cdn.pixabay.com/photo/2023/07/07/20/42/grasshopper-8113345_1280.jpg)',
|
|
568
|
-
backgroundSize: 'cover',
|
|
569
|
-
backgroundPosition: 'center',
|
|
570
|
-
padding: '10rem 25rem',
|
|
571
|
-
borderRadius: '8px',
|
|
572
|
-
}}
|
|
573
|
-
>
|
|
364
|
+
<div className="u-bg-cover u-bg-center u-rounded-xl u-p-24" style={{backgroundImage: 'url(https://cdn.pixabay.com/photo/2023/07/07/20/42/grasshopper-8113345_1280.jpg)'}}>
|
|
574
365
|
<div className="u-flex u-flex-wrap u-gap-2">
|
|
575
366
|
{THEME_COLORS.map(color => (
|
|
576
367
|
<Badge key={color} label={color} variant={color} glass={true} />
|
|
@@ -580,33 +371,10 @@ export const GlassAllVariants: Story = {
|
|
|
580
371
|
),
|
|
581
372
|
};
|
|
582
373
|
|
|
583
|
-
|
|
584
|
-
|
|
585
|
-
|
|
586
|
-
|
|
587
|
-
glass: true,
|
|
588
|
-
},
|
|
589
|
-
render: () => (
|
|
590
|
-
<div
|
|
591
|
-
style={{
|
|
592
|
-
background:
|
|
593
|
-
'url(https://cdn.pixabay.com/photo/2025/07/18/15/17/grasshopper-9721629_1280.jpg)',
|
|
594
|
-
backgroundSize: 'cover',
|
|
595
|
-
backgroundPosition: 'center',
|
|
596
|
-
padding: '10rem 25rem',
|
|
597
|
-
borderRadius: '8px',
|
|
598
|
-
}}
|
|
599
|
-
>
|
|
600
|
-
<div className="u-flex u-items-center u-gap-2">
|
|
601
|
-
<Badge label="Small" variant="primary" size="sm" glass={true} />
|
|
602
|
-
<Badge label="Medium" variant="primary" size="md" glass={true} />
|
|
603
|
-
<Badge label="Large" variant="primary" size="lg" glass={true} />
|
|
604
|
-
</div>
|
|
605
|
-
</div>
|
|
606
|
-
),
|
|
607
|
-
};
|
|
608
|
-
|
|
609
|
-
export const GlassCustomSettings: Story = {
|
|
374
|
+
/**
|
|
375
|
+
* Shows badges with custom glass settings
|
|
376
|
+
*/
|
|
377
|
+
export const WithCustomGlassSettings: Story = {
|
|
610
378
|
args: {
|
|
611
379
|
label: 'Custom Glass',
|
|
612
380
|
variant: 'primary',
|
|
@@ -618,20 +386,11 @@ export const GlassCustomSettings: Story = {
|
|
|
618
386
|
aberrationIntensity: 1,
|
|
619
387
|
cornerRadius: 16,
|
|
620
388
|
mode: 'polar',
|
|
621
|
-
}
|
|
389
|
+
},
|
|
622
390
|
},
|
|
623
391
|
decorators: [
|
|
624
392
|
Story => (
|
|
625
|
-
<div
|
|
626
|
-
style={{
|
|
627
|
-
background:
|
|
628
|
-
'url(https://cdn.pixabay.com/photo/2021/06/14/22/46/milky-way-6337038_1280.jpg)',
|
|
629
|
-
backgroundSize: 'cover',
|
|
630
|
-
backgroundPosition: 'center',
|
|
631
|
-
padding: '10rem 25rem',
|
|
632
|
-
borderRadius: '8px',
|
|
633
|
-
}}
|
|
634
|
-
>
|
|
393
|
+
<div className="u-bg-cover u-bg-center u-rounded-xl u-p-24" style={{backgroundImage: 'url(https://cdn.pixabay.com/photo/2021/06/14/22/46/milky-way-6337038_1280.jpg)'}}>
|
|
635
394
|
<Story />
|
|
636
395
|
</div>
|
|
637
396
|
),
|