@shohojdhara/atomix 0.3.4 → 0.3.6
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/README.md +101 -199
- package/atomix.config.ts +241 -0
- package/dist/atomix.css +269 -189
- package/dist/atomix.css.map +1 -0
- package/dist/atomix.min.css +15179 -11
- package/dist/atomix.min.css.map +1 -0
- package/dist/charts.d.ts +1929 -0
- package/dist/charts.js +6477 -0
- package/dist/charts.js.map +1 -0
- package/dist/core.d.ts +1289 -0
- package/dist/core.js +3373 -0
- package/dist/core.js.map +1 -0
- package/dist/forms.d.ts +1085 -0
- package/dist/forms.js +2466 -0
- package/dist/forms.js.map +1 -0
- package/dist/heavy.d.ts +636 -0
- package/dist/heavy.js +4566 -0
- package/dist/heavy.js.map +1 -0
- package/dist/index.d.ts +5171 -4792
- package/dist/index.esm.js +6098 -4563
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +6291 -4747
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/layout.d.ts +300 -0
- package/dist/layout.js +336 -0
- package/dist/layout.js.map +1 -0
- package/dist/theme.d.ts +2122 -0
- package/dist/theme.js +6084 -0
- package/dist/theme.js.map +1 -0
- package/package.json +59 -27
- package/scripts/atomix-cli.js +544 -16
- package/scripts/cli/__tests__/cli-commands.test.js +204 -0
- package/scripts/cli/__tests__/utils.test.js +201 -0
- package/scripts/cli/__tests__/vitest.config.js +26 -0
- package/scripts/cli/interactive-init.js +1 -1
- package/scripts/cli/token-manager.js +32 -7
- package/scripts/cli/utils.js +347 -0
- package/src/components/Accordion/Accordion.stories.tsx +50 -17
- package/src/components/Accordion/Accordion.tsx +5 -54
- package/src/components/Accordion/index.ts +1 -1
- package/src/components/AtomixGlass/AtomixGlass.tsx +65 -31
- package/src/components/AtomixGlass/AtomixGlassContainer.tsx +11 -4
- package/src/components/AtomixGlass/stories/AtomixGlass.stories.tsx +1 -32
- package/src/components/AtomixGlass/stories/Examples.stories.tsx +2 -2
- package/src/components/AtomixGlass/stories/shared-components.tsx +0 -31
- package/src/components/Avatar/Avatar.stories.tsx +7 -0
- package/src/components/Avatar/Avatar.tsx +3 -3
- package/src/components/Badge/Badge.stories.tsx +91 -13
- package/src/components/Badge/Badge.tsx +3 -3
- package/src/components/Block/Block.stories.tsx +7 -23
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +7 -0
- package/src/components/Breadcrumb/Breadcrumb.tsx +3 -3
- package/src/components/Button/Button.stories.tsx +141 -22
- package/src/components/Button/ButtonGroup.stories.tsx +315 -0
- package/src/components/Button/ButtonGroup.tsx +67 -0
- package/src/components/Button/index.ts +2 -0
- package/src/components/Callout/Callout.stories.tsx +8 -6
- package/src/components/Card/Card.stories.tsx +82 -28
- package/src/components/Card/ElevationCard.tsx +1 -1
- package/src/components/Chart/AnimatedChart.tsx +19 -18
- package/src/components/Chart/AreaChart.tsx +5 -2
- package/src/components/Chart/BarChart.tsx +1 -1
- package/src/components/Chart/BubbleChart.tsx +6 -6
- package/src/components/Chart/CandlestickChart.tsx +0 -1
- package/src/components/Chart/Chart.stories.tsx +5 -7
- package/src/components/Chart/Chart.tsx +0 -16
- package/src/components/Chart/ChartRenderer.tsx +1 -1
- package/src/components/Chart/ChartToolbar.tsx +1 -0
- package/src/components/Chart/DonutChart.tsx +0 -1
- package/src/components/Chart/FunnelChart.tsx +1 -2
- package/src/components/Chart/GaugeChart.tsx +0 -1
- package/src/components/Chart/HeatmapChart.tsx +0 -1
- package/src/components/Chart/LineChart.tsx +0 -1
- package/src/components/Chart/MultiAxisChart.tsx +0 -1
- package/src/components/Chart/PieChart.tsx +0 -1
- package/src/components/Chart/RadarChart.tsx +19 -13
- package/src/components/Chart/ScatterChart.tsx +3 -4
- package/src/components/Chart/TreemapChart.tsx +2 -1
- package/src/components/Chart/WaterfallChart.tsx +0 -2
- package/src/components/Chart/types.ts +12 -2
- package/src/components/Chart/utils.ts +4 -3
- package/src/components/ColorModeToggle/ColorModeToggle.stories.tsx +7 -0
- package/src/components/DataTable/DataTable.stories.tsx +23 -16
- package/src/components/DataTable/DataTable.tsx +3 -3
- package/src/components/DatePicker/DatePicker.stories.tsx +27 -19
- package/src/components/Dropdown/Dropdown.stories.tsx +11 -19
- package/src/components/Dropdown/Dropdown.tsx +12 -9
- package/src/components/EdgePanel/EdgePanel.stories.tsx +1 -0
- package/src/components/Footer/Footer.stories.tsx +8 -6
- package/src/components/Footer/FooterLink.tsx +9 -2
- package/src/components/Footer/FooterSection.tsx +3 -3
- package/src/components/Form/Checkbox.stories.tsx +7 -0
- package/src/components/Form/Checkbox.tsx +3 -3
- package/src/components/Form/Form.stories.tsx +7 -0
- package/src/components/Form/FormGroup.stories.tsx +9 -1
- package/src/components/Form/Input.stories.tsx +69 -16
- package/src/components/Form/Input.tsx +4 -2
- package/src/components/Form/Radio.stories.tsx +9 -1
- package/src/components/Form/Radio.tsx +3 -3
- package/src/components/Form/Select.stories.tsx +9 -1
- package/src/components/Form/Select.tsx +3 -3
- package/src/components/Form/Textarea.stories.tsx +10 -2
- package/src/components/Form/Textarea.tsx +4 -2
- package/src/components/Hero/Hero.stories.tsx +7 -0
- package/src/components/List/List.stories.tsx +10 -3
- package/src/components/List/List.tsx +3 -3
- package/src/components/List/ListGroup.tsx +3 -1
- package/src/components/Messages/Messages.stories.tsx +8 -7
- package/src/components/Modal/Modal.stories.tsx +17 -6
- package/src/components/Modal/Modal.tsx +3 -3
- package/src/components/Navigation/Menu/MegaMenu.tsx +9 -3
- package/src/components/Navigation/Menu/Menu.stories.tsx +7 -0
- package/src/components/Navigation/Menu/Menu.tsx +9 -3
- package/src/components/Navigation/Nav/Nav.stories.tsx +7 -0
- package/src/components/Navigation/Navbar/Navbar.stories.tsx +1 -0
- package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +1 -1
- package/src/components/Pagination/Pagination.stories.tsx +188 -111
- package/src/components/Pagination/Pagination.tsx +88 -7
- package/src/components/PhotoViewer/PhotoViewer.stories.tsx +10 -5
- package/src/components/PhotoViewer/PhotoViewerImage.tsx +2 -2
- package/src/components/Popover/Popover.stories.tsx +191 -115
- package/src/components/Popover/Popover.tsx +4 -4
- package/src/components/ProductReview/ProductReview.stories.tsx +80 -58
- package/src/components/Progress/Progress.stories.tsx +79 -49
- package/src/components/Progress/Progress.tsx +6 -2
- package/src/components/Rating/Rating.stories.tsx +109 -84
- package/src/components/Rating/Rating.tsx +5 -2
- package/src/components/River/River.stories.tsx +194 -114
- package/src/components/SectionIntro/SectionIntro.stories.tsx +19 -9
- package/src/components/Slider/Slider.stories.tsx +7 -0
- package/src/components/Slider/Slider.tsx +10 -9
- package/src/components/Spinner/Spinner.stories.tsx +15 -11
- package/src/components/Spinner/Spinner.tsx +3 -3
- package/src/components/Steps/Steps.stories.tsx +132 -98
- package/src/components/Tabs/Tabs.stories.tsx +163 -112
- package/src/components/Tabs/Tabs.tsx +3 -3
- package/src/components/Testimonial/Testimonial.stories.tsx +114 -68
- package/src/components/Todo/Todo.stories.tsx +38 -12
- package/src/components/Toggle/Toggle.stories.tsx +61 -28
- package/src/components/Tooltip/Tooltip.stories.tsx +318 -200
- package/src/components/Tooltip/Tooltip.tsx +3 -3
- package/src/components/Upload/Upload.stories.tsx +122 -84
- package/src/components/VideoPlayer/VideoPlayer.stories.tsx +7 -24
- package/src/components/index.ts +6 -2
- package/src/layouts/MasonryGrid/MasonryGrid.tsx +2 -2
- package/src/lib/composables/useAtomixGlass.ts +2 -3
- package/src/lib/composables/useChartPerformance.ts +102 -78
- package/src/lib/composables/useChartScale.ts +10 -0
- package/src/lib/composables/useHero.ts +9 -2
- package/src/lib/composables/useHeroBackgroundSlider.ts +5 -3
- package/src/lib/composables/useNavbar.ts +0 -10
- package/src/lib/composables/useSideMenu.ts +1 -0
- package/src/lib/composables/useVideoPlayer.ts +3 -2
- package/src/lib/config/loader.ts +57 -14
- package/src/lib/constants/components.ts +10 -0
- package/src/lib/hooks/index.ts +0 -1
- package/src/lib/hooks/useComponentCustomization.ts +11 -15
- package/src/lib/hooks/usePerformanceMonitor.ts +149 -0
- package/src/lib/patterns/index.ts +2 -2
- package/src/lib/patterns/slots.tsx +2 -2
- package/src/lib/theme/README.md +174 -0
- package/src/lib/theme/adapters/index.ts +31 -0
- package/src/lib/theme/adapters/themeAdapter.ts +287 -0
- package/src/lib/theme/config/__tests__/configLoader.test.ts +207 -0
- package/src/lib/theme/config/configLoader.ts +254 -0
- package/src/lib/theme/config/loader.ts +37 -48
- package/src/lib/theme/config/types.ts +2 -2
- package/src/lib/theme/config/validator.ts +15 -91
- package/src/lib/theme/{constants.ts → constants/constants.ts} +0 -18
- package/src/lib/theme/constants/index.ts +8 -0
- package/src/lib/theme/core/ThemeRegistry.ts +19 -6
- package/src/lib/theme/core/__tests__/createTheme.test.ts +132 -0
- package/src/lib/theme/core/composeTheme.ts +155 -0
- package/src/lib/theme/core/createTheme.ts +94 -0
- package/src/lib/theme/{createTheme.ts → core/createThemeObject.ts} +10 -6
- package/src/lib/theme/core/index.ts +5 -19
- package/src/lib/theme/devtools/Comparator.tsx +346 -22
- package/src/lib/theme/devtools/IMPROVEMENTS.md +139 -38
- package/src/lib/theme/devtools/Inspector.tsx +335 -51
- package/src/lib/theme/devtools/LiveEditor.tsx +489 -112
- package/src/lib/theme/devtools/Preview.tsx +471 -221
- package/src/lib/theme/{core → devtools}/ThemeValidator.ts +6 -3
- package/src/lib/theme/devtools/index.ts +14 -4
- package/src/lib/theme/devtools/useHistory.ts +130 -0
- package/src/lib/theme/errors/index.ts +12 -0
- package/src/lib/theme/generators/cssFile.ts +79 -0
- package/src/lib/theme/generators/generateCSS.ts +89 -0
- package/src/lib/theme/{generateCSSVariables.ts → generators/generateCSSVariables.ts} +4 -14
- package/src/lib/theme/generators/index.ts +19 -0
- package/src/lib/theme/i18n/rtl.ts +7 -7
- package/src/lib/theme/index.ts +120 -15
- package/src/lib/theme/runtime/ThemeApplicator.ts +53 -95
- package/src/lib/theme/{ThemeContext.tsx → runtime/ThemeContext.tsx} +1 -1
- package/src/lib/theme/runtime/ThemeErrorBoundary.tsx +4 -4
- package/src/lib/theme/runtime/ThemeProvider.tsx +456 -179
- package/src/lib/theme/runtime/index.ts +1 -2
- package/src/lib/theme/runtime/useTheme.ts +1 -2
- package/src/lib/theme/test/testTheme.ts +385 -0
- package/src/lib/theme/tokens/index.ts +12 -0
- package/src/lib/theme/tokens/tokens.ts +721 -0
- package/src/lib/theme/types.ts +6 -42
- package/src/lib/theme/{utils.ts → utils/domUtils.ts} +2 -2
- package/src/lib/theme/utils/index.ts +11 -0
- package/src/lib/theme/utils/injectCSS.ts +90 -0
- package/src/lib/theme/utils/themeHelpers.ts +78 -0
- package/src/lib/theme/{themeUtils.ts → utils/themeUtils.ts} +1 -1
- package/src/lib/theme-tools.ts +8 -9
- package/src/lib/types/components.ts +93 -34
- package/src/lib/types/partProps.ts +0 -16
- package/src/lib/utils/componentUtils.ts +1 -1
- package/src/lib/utils/fontPreloader.ts +148 -0
- package/src/lib/utils/index.ts +11 -0
- package/src/lib/utils/memoryMonitor.ts +189 -0
- package/src/styles/01-settings/_settings.design-tokens.scss +4 -1
- package/src/styles/01-settings/_settings.fonts.scss +2 -5
- package/src/styles/02-tools/_tools.button.scss +66 -79
- package/src/styles/06-components/_components.atomix-glass.scss +13 -3
- package/src/styles/06-components/_components.navbar.scss +0 -6
- package/src/styles/06-components/_components.pagination.scss +88 -0
- package/scripts/build-themes.js +0 -208
- package/scripts/sync-theme-config.js +0 -309
- package/src/components/AtomixGlass/atomixGLass.old.tsx +0 -1263
- package/src/lib/theme/composeTheme.ts +0 -370
- package/src/lib/theme/core/ThemeCache.ts +0 -283
- package/src/lib/theme/core/ThemeEngine.test.ts +0 -146
- package/src/lib/theme/core/ThemeEngine.ts +0 -657
- package/src/lib/theme/createThemeFromConfig.ts +0 -132
- package/src/lib/theme/devtools/CLI.ts +0 -364
- package/src/lib/theme/runtime/ThemeManager.test.ts +0 -192
- package/src/lib/theme/runtime/ThemeManager.ts +0 -442
- package/src/styles/03-generic/_generated-root.css +0 -5
- package/src/themes/README.md +0 -442
- package/src/themes/themes.config.js +0 -35
- /package/src/lib/theme/{cssVariableMapper.ts → adapters/cssVariableMapper.ts} +0 -0
- /package/src/lib/theme/{errors.ts → errors/errors.ts} +0 -0
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { ReactNode } from 'react';
|
|
1
|
+
import React, { ReactNode, memo } from 'react';
|
|
2
2
|
import { BREADCRUMB } from '../../lib/constants/components';
|
|
3
3
|
|
|
4
4
|
export interface BreadcrumbItem {
|
|
@@ -69,7 +69,7 @@ export interface BreadcrumbProps {
|
|
|
69
69
|
*/
|
|
70
70
|
style?: React.CSSProperties;
|
|
71
71
|
}
|
|
72
|
-
export const Breadcrumb: React.FC<BreadcrumbProps> = ({
|
|
72
|
+
export const Breadcrumb: React.FC<BreadcrumbProps> = memo(({
|
|
73
73
|
items,
|
|
74
74
|
divider,
|
|
75
75
|
className = '',
|
|
@@ -129,7 +129,7 @@ export const Breadcrumb: React.FC<BreadcrumbProps> = ({
|
|
|
129
129
|
</ol>
|
|
130
130
|
</nav>
|
|
131
131
|
);
|
|
132
|
-
};
|
|
132
|
+
});
|
|
133
133
|
|
|
134
134
|
Breadcrumb.displayName = 'Breadcrumb';
|
|
135
135
|
|
|
@@ -1,12 +1,20 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import { Button } from './Button';
|
|
3
|
+
import { SIZES } from '../../lib/constants/components';
|
|
3
4
|
|
|
4
5
|
const meta = {
|
|
5
6
|
title: 'Components/Button',
|
|
6
7
|
component: Button,
|
|
7
8
|
parameters: {
|
|
8
9
|
layout: 'centered',
|
|
10
|
+
docs: {
|
|
11
|
+
description: {
|
|
12
|
+
component:
|
|
13
|
+
'The Button component is a versatile interactive element used to trigger actions throughout the application. It supports multiple variants, sizes, states, and can include icons. Buttons are essential for user interactions and provide clear visual feedback for clickable actions.',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
9
16
|
},
|
|
17
|
+
tags: ['autodocs'],
|
|
10
18
|
argTypes: {
|
|
11
19
|
variant: {
|
|
12
20
|
control: { type: 'select' },
|
|
@@ -30,11 +38,13 @@ const meta = {
|
|
|
30
38
|
'link',
|
|
31
39
|
],
|
|
32
40
|
description: 'The visual style of the button',
|
|
41
|
+
defaultValue: 'primary',
|
|
33
42
|
},
|
|
34
43
|
size: {
|
|
35
44
|
control: { type: 'select' },
|
|
36
|
-
options:
|
|
45
|
+
options: SIZES,
|
|
37
46
|
description: 'The size of the button',
|
|
47
|
+
defaultValue: 'md',
|
|
38
48
|
},
|
|
39
49
|
disabled: {
|
|
40
50
|
control: 'boolean',
|
|
@@ -108,7 +118,9 @@ const Icon = () => (
|
|
|
108
118
|
</svg>
|
|
109
119
|
);
|
|
110
120
|
|
|
111
|
-
|
|
121
|
+
/**
|
|
122
|
+
* Primary button variant - the main call-to-action style.
|
|
123
|
+
*/
|
|
112
124
|
export const Primary: Story = {
|
|
113
125
|
args: {
|
|
114
126
|
label: 'Primary Button',
|
|
@@ -117,6 +129,9 @@ export const Primary: Story = {
|
|
|
117
129
|
},
|
|
118
130
|
};
|
|
119
131
|
|
|
132
|
+
/**
|
|
133
|
+
* Secondary button variant - used for secondary actions.
|
|
134
|
+
*/
|
|
120
135
|
export const Secondary: Story = {
|
|
121
136
|
args: {
|
|
122
137
|
label: 'Secondary Button',
|
|
@@ -125,6 +140,9 @@ export const Secondary: Story = {
|
|
|
125
140
|
},
|
|
126
141
|
};
|
|
127
142
|
|
|
143
|
+
/**
|
|
144
|
+
* Success button variant - indicates successful or positive actions.
|
|
145
|
+
*/
|
|
128
146
|
export const Success: Story = {
|
|
129
147
|
args: {
|
|
130
148
|
label: 'Success Button',
|
|
@@ -133,6 +151,9 @@ export const Success: Story = {
|
|
|
133
151
|
},
|
|
134
152
|
};
|
|
135
153
|
|
|
154
|
+
/**
|
|
155
|
+
* Info button variant - used for informational actions.
|
|
156
|
+
*/
|
|
136
157
|
export const Info: Story = {
|
|
137
158
|
args: {
|
|
138
159
|
label: 'Info Button',
|
|
@@ -141,6 +162,9 @@ export const Info: Story = {
|
|
|
141
162
|
},
|
|
142
163
|
};
|
|
143
164
|
|
|
165
|
+
/**
|
|
166
|
+
* Warning button variant - indicates caution or warning actions.
|
|
167
|
+
*/
|
|
144
168
|
export const Warning: Story = {
|
|
145
169
|
args: {
|
|
146
170
|
label: 'Warning Button',
|
|
@@ -149,6 +173,9 @@ export const Warning: Story = {
|
|
|
149
173
|
},
|
|
150
174
|
};
|
|
151
175
|
|
|
176
|
+
/**
|
|
177
|
+
* Error button variant - indicates destructive or error actions.
|
|
178
|
+
*/
|
|
152
179
|
export const Error: Story = {
|
|
153
180
|
args: {
|
|
154
181
|
label: 'Error Button',
|
|
@@ -157,7 +184,9 @@ export const Error: Story = {
|
|
|
157
184
|
},
|
|
158
185
|
};
|
|
159
186
|
|
|
160
|
-
|
|
187
|
+
/**
|
|
188
|
+
* Outline primary button variant - outlined style with primary color.
|
|
189
|
+
*/
|
|
161
190
|
export const OutlinePrimary: Story = {
|
|
162
191
|
args: {
|
|
163
192
|
label: 'Outline Primary',
|
|
@@ -166,6 +195,9 @@ export const OutlinePrimary: Story = {
|
|
|
166
195
|
},
|
|
167
196
|
};
|
|
168
197
|
|
|
198
|
+
/**
|
|
199
|
+
* Outline secondary button variant - outlined style with secondary color.
|
|
200
|
+
*/
|
|
169
201
|
export const OutlineSecondary: Story = {
|
|
170
202
|
args: {
|
|
171
203
|
label: 'Outline Secondary',
|
|
@@ -174,7 +206,9 @@ export const OutlineSecondary: Story = {
|
|
|
174
206
|
},
|
|
175
207
|
};
|
|
176
208
|
|
|
177
|
-
|
|
209
|
+
/**
|
|
210
|
+
* Link button variant - styled as a text link.
|
|
211
|
+
*/
|
|
178
212
|
export const LinkButton: Story = {
|
|
179
213
|
args: {
|
|
180
214
|
label: 'Link Button',
|
|
@@ -183,7 +217,9 @@ export const LinkButton: Story = {
|
|
|
183
217
|
},
|
|
184
218
|
};
|
|
185
219
|
|
|
186
|
-
|
|
220
|
+
/**
|
|
221
|
+
* Small size button variant.
|
|
222
|
+
*/
|
|
187
223
|
export const Small: Story = {
|
|
188
224
|
args: {
|
|
189
225
|
label: 'Small Button',
|
|
@@ -192,6 +228,9 @@ export const Small: Story = {
|
|
|
192
228
|
},
|
|
193
229
|
};
|
|
194
230
|
|
|
231
|
+
/**
|
|
232
|
+
* Medium size button variant (default).
|
|
233
|
+
*/
|
|
195
234
|
export const Medium: Story = {
|
|
196
235
|
args: {
|
|
197
236
|
label: 'Medium Button',
|
|
@@ -200,6 +239,9 @@ export const Medium: Story = {
|
|
|
200
239
|
},
|
|
201
240
|
};
|
|
202
241
|
|
|
242
|
+
/**
|
|
243
|
+
* Large size button variant.
|
|
244
|
+
*/
|
|
203
245
|
export const Large: Story = {
|
|
204
246
|
args: {
|
|
205
247
|
label: 'Large Button',
|
|
@@ -208,7 +250,9 @@ export const Large: Story = {
|
|
|
208
250
|
},
|
|
209
251
|
};
|
|
210
252
|
|
|
211
|
-
|
|
253
|
+
/**
|
|
254
|
+
* Disabled button state - non-interactive button.
|
|
255
|
+
*/
|
|
212
256
|
export const Disabled: Story = {
|
|
213
257
|
args: {
|
|
214
258
|
label: 'Disabled Button',
|
|
@@ -218,7 +262,9 @@ export const Disabled: Story = {
|
|
|
218
262
|
},
|
|
219
263
|
};
|
|
220
264
|
|
|
221
|
-
|
|
265
|
+
/**
|
|
266
|
+
* Button with icon - displays an icon alongside the label.
|
|
267
|
+
*/
|
|
222
268
|
export const WithIcon: Story = {
|
|
223
269
|
args: {
|
|
224
270
|
label: 'Button with Icon',
|
|
@@ -228,6 +274,9 @@ export const WithIcon: Story = {
|
|
|
228
274
|
},
|
|
229
275
|
};
|
|
230
276
|
|
|
277
|
+
/**
|
|
278
|
+
* Icon-only button - displays only an icon without text.
|
|
279
|
+
*/
|
|
231
280
|
export const IconOnly: Story = {
|
|
232
281
|
args: {
|
|
233
282
|
label: 'Add',
|
|
@@ -238,12 +287,21 @@ export const IconOnly: Story = {
|
|
|
238
287
|
},
|
|
239
288
|
};
|
|
240
289
|
|
|
241
|
-
|
|
290
|
+
/**
|
|
291
|
+
* Showcase of all button color variants in a single view.
|
|
292
|
+
*/
|
|
242
293
|
export const AllVariants: Story = {
|
|
243
294
|
args: {
|
|
244
295
|
label: 'Button',
|
|
245
296
|
variant: 'success',
|
|
246
297
|
},
|
|
298
|
+
parameters: {
|
|
299
|
+
docs: {
|
|
300
|
+
description: {
|
|
301
|
+
story: 'Displays all available button color variants side by side for easy comparison.',
|
|
302
|
+
},
|
|
303
|
+
},
|
|
304
|
+
},
|
|
247
305
|
render: () => (
|
|
248
306
|
<div className="u-d-flex u-flex-wrap u-gap-2">
|
|
249
307
|
<Button label="Primary" variant="primary" />
|
|
@@ -258,12 +316,21 @@ export const AllVariants: Story = {
|
|
|
258
316
|
),
|
|
259
317
|
};
|
|
260
318
|
|
|
261
|
-
|
|
319
|
+
/**
|
|
320
|
+
* Showcase of all outline button variants in a single view.
|
|
321
|
+
*/
|
|
262
322
|
export const AllOutlineVariants: Story = {
|
|
263
323
|
args: {
|
|
264
324
|
label: 'Button',
|
|
265
325
|
variant: 'outline-primary',
|
|
266
326
|
},
|
|
327
|
+
parameters: {
|
|
328
|
+
docs: {
|
|
329
|
+
description: {
|
|
330
|
+
story: 'Displays all available outline button variants with transparent backgrounds and colored borders.',
|
|
331
|
+
},
|
|
332
|
+
},
|
|
333
|
+
},
|
|
267
334
|
render: () => (
|
|
268
335
|
<div className="u-d-flex u-flex-wrap u-gap-2">
|
|
269
336
|
<Button label="Outline Primary" variant="outline-primary" />
|
|
@@ -278,12 +345,21 @@ export const AllOutlineVariants: Story = {
|
|
|
278
345
|
),
|
|
279
346
|
};
|
|
280
347
|
|
|
281
|
-
|
|
348
|
+
/**
|
|
349
|
+
* Showcase of all button sizes (small, medium, large) in a single view.
|
|
350
|
+
*/
|
|
282
351
|
export const AllSizes: Story = {
|
|
283
352
|
args: {
|
|
284
353
|
label: 'Button',
|
|
285
354
|
variant: 'primary',
|
|
286
355
|
},
|
|
356
|
+
parameters: {
|
|
357
|
+
docs: {
|
|
358
|
+
description: {
|
|
359
|
+
story: 'Compares all available button sizes to help choose the appropriate size for your use case.',
|
|
360
|
+
},
|
|
361
|
+
},
|
|
362
|
+
},
|
|
287
363
|
render: () => (
|
|
288
364
|
<div className="u-d-flex u-align-items-center u-gap-2">
|
|
289
365
|
<Button label="Small" variant="primary" size="sm" />
|
|
@@ -293,7 +369,9 @@ export const AllSizes: Story = {
|
|
|
293
369
|
),
|
|
294
370
|
};
|
|
295
371
|
|
|
296
|
-
|
|
372
|
+
/**
|
|
373
|
+
* Showcase of button icon variants and icon-only buttons.
|
|
374
|
+
*/
|
|
297
375
|
export const IconButtonVariants: Story = {
|
|
298
376
|
args: {
|
|
299
377
|
label: 'Button',
|
|
@@ -313,7 +391,9 @@ export const IconButtonVariants: Story = {
|
|
|
313
391
|
),
|
|
314
392
|
};
|
|
315
393
|
|
|
316
|
-
|
|
394
|
+
/**
|
|
395
|
+
* Rounded button - fully rounded (pill-shaped) button style.
|
|
396
|
+
*/
|
|
317
397
|
export const Rounded: Story = {
|
|
318
398
|
args: {
|
|
319
399
|
label: 'Rounded Button',
|
|
@@ -323,7 +403,9 @@ export const Rounded: Story = {
|
|
|
323
403
|
},
|
|
324
404
|
};
|
|
325
405
|
|
|
326
|
-
|
|
406
|
+
/**
|
|
407
|
+
* Showcase of all button variants with rounded (pill) shape.
|
|
408
|
+
*/
|
|
327
409
|
export const RoundedVariants: Story = {
|
|
328
410
|
args: {
|
|
329
411
|
label: 'Button',
|
|
@@ -344,7 +426,9 @@ export const RoundedVariants: Story = {
|
|
|
344
426
|
),
|
|
345
427
|
};
|
|
346
428
|
|
|
347
|
-
|
|
429
|
+
/**
|
|
430
|
+
* Button using the label prop for text content.
|
|
431
|
+
*/
|
|
348
432
|
export const WithLabel: Story = {
|
|
349
433
|
args: {
|
|
350
434
|
label: 'Button with Label',
|
|
@@ -352,6 +436,9 @@ export const WithLabel: Story = {
|
|
|
352
436
|
},
|
|
353
437
|
};
|
|
354
438
|
|
|
439
|
+
/**
|
|
440
|
+
* Button using children prop for text content.
|
|
441
|
+
*/
|
|
355
442
|
export const WithChildren: Story = {
|
|
356
443
|
render: () => (
|
|
357
444
|
<Button variant="primary">
|
|
@@ -360,6 +447,9 @@ export const WithChildren: Story = {
|
|
|
360
447
|
),
|
|
361
448
|
};
|
|
362
449
|
|
|
450
|
+
/**
|
|
451
|
+
* Button with icon and text content as children.
|
|
452
|
+
*/
|
|
363
453
|
export const WithIconAndText: Story = {
|
|
364
454
|
render: () => (
|
|
365
455
|
<Button variant="primary">
|
|
@@ -369,7 +459,9 @@ export const WithIconAndText: Story = {
|
|
|
369
459
|
),
|
|
370
460
|
};
|
|
371
461
|
|
|
372
|
-
|
|
462
|
+
/**
|
|
463
|
+
* Button with glass morphism effect enabled.
|
|
464
|
+
*/
|
|
373
465
|
export const GlassEffect: Story = {
|
|
374
466
|
args: {
|
|
375
467
|
label: 'Glass Button',
|
|
@@ -1191,7 +1283,9 @@ export const GlassStatesShowcase: Story = {
|
|
|
1191
1283
|
),
|
|
1192
1284
|
};
|
|
1193
1285
|
|
|
1194
|
-
|
|
1286
|
+
/**
|
|
1287
|
+
* Button in loading state - shows loading spinner.
|
|
1288
|
+
*/
|
|
1195
1289
|
export const Loading: Story = {
|
|
1196
1290
|
args: {
|
|
1197
1291
|
label: 'Save',
|
|
@@ -1200,6 +1294,9 @@ export const Loading: Story = {
|
|
|
1200
1294
|
},
|
|
1201
1295
|
};
|
|
1202
1296
|
|
|
1297
|
+
/**
|
|
1298
|
+
* Button in loading state with custom loading text.
|
|
1299
|
+
*/
|
|
1203
1300
|
export const LoadingWithText: Story = {
|
|
1204
1301
|
args: {
|
|
1205
1302
|
label: 'Save',
|
|
@@ -1220,7 +1317,9 @@ export const LoadingStates: Story = {
|
|
|
1220
1317
|
),
|
|
1221
1318
|
};
|
|
1222
1319
|
|
|
1223
|
-
|
|
1320
|
+
/**
|
|
1321
|
+
* Full-width button - takes the full width of its container.
|
|
1322
|
+
*/
|
|
1224
1323
|
export const FullWidth: Story = {
|
|
1225
1324
|
args: {
|
|
1226
1325
|
label: 'Full Width Button',
|
|
@@ -1239,7 +1338,9 @@ export const FullWidthButtons: Story = {
|
|
|
1239
1338
|
),
|
|
1240
1339
|
};
|
|
1241
1340
|
|
|
1242
|
-
|
|
1341
|
+
/**
|
|
1342
|
+
* Block-level button - displays as a block element.
|
|
1343
|
+
*/
|
|
1243
1344
|
export const Block: Story = {
|
|
1244
1345
|
args: {
|
|
1245
1346
|
label: 'Block Button',
|
|
@@ -1248,7 +1349,9 @@ export const Block: Story = {
|
|
|
1248
1349
|
},
|
|
1249
1350
|
};
|
|
1250
1351
|
|
|
1251
|
-
|
|
1352
|
+
/**
|
|
1353
|
+
* Button with icon positioned at the start (left side).
|
|
1354
|
+
*/
|
|
1252
1355
|
export const IconStart: Story = {
|
|
1253
1356
|
args: {
|
|
1254
1357
|
label: 'Icon Start',
|
|
@@ -1258,6 +1361,9 @@ export const IconStart: Story = {
|
|
|
1258
1361
|
},
|
|
1259
1362
|
};
|
|
1260
1363
|
|
|
1364
|
+
/**
|
|
1365
|
+
* Button with icon positioned at the end (right side).
|
|
1366
|
+
*/
|
|
1261
1367
|
export const IconEnd: Story = {
|
|
1262
1368
|
args: {
|
|
1263
1369
|
label: 'Icon End',
|
|
@@ -1277,7 +1383,9 @@ export const IconPositions: Story = {
|
|
|
1277
1383
|
),
|
|
1278
1384
|
};
|
|
1279
1385
|
|
|
1280
|
-
|
|
1386
|
+
/**
|
|
1387
|
+
* Button in active state - visually indicates active/pressed state.
|
|
1388
|
+
*/
|
|
1281
1389
|
export const Active: Story = {
|
|
1282
1390
|
args: {
|
|
1283
1391
|
label: 'Active Button',
|
|
@@ -1286,7 +1394,9 @@ export const Active: Story = {
|
|
|
1286
1394
|
},
|
|
1287
1395
|
};
|
|
1288
1396
|
|
|
1289
|
-
|
|
1397
|
+
/**
|
|
1398
|
+
* Button in selected state - visually indicates selected state.
|
|
1399
|
+
*/
|
|
1290
1400
|
export const Selected: Story = {
|
|
1291
1401
|
args: {
|
|
1292
1402
|
label: 'Selected Button',
|
|
@@ -1295,8 +1405,17 @@ export const Selected: Story = {
|
|
|
1295
1405
|
},
|
|
1296
1406
|
};
|
|
1297
1407
|
|
|
1298
|
-
|
|
1408
|
+
/**
|
|
1409
|
+
* Comprehensive example showcasing multiple button features and states.
|
|
1410
|
+
*/
|
|
1299
1411
|
export const Comprehensive: Story = {
|
|
1412
|
+
parameters: {
|
|
1413
|
+
docs: {
|
|
1414
|
+
description: {
|
|
1415
|
+
story: 'A comprehensive example demonstrating various button features including loading states, layout variants, icon positioning, and different states all in one view.',
|
|
1416
|
+
},
|
|
1417
|
+
},
|
|
1418
|
+
},
|
|
1300
1419
|
render: () => (
|
|
1301
1420
|
<div style={{ display: 'flex', flexDirection: 'column', gap: '2rem', maxWidth: '600px' }}>
|
|
1302
1421
|
<div>
|