@shohojdhara/atomix 0.3.15 → 0.4.0
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/build-tools/index.d.ts +31 -30
- package/build-tools/package.json +4 -21
- package/dist/atomix.css +20924 -2611
- package/dist/atomix.css.map +1 -1
- package/dist/atomix.min.css +76 -2
- package/dist/atomix.min.css.map +1 -1
- package/dist/build-tools/index.d.ts +31 -30
- package/dist/build-tools/package.json +4 -21
- package/dist/charts.js.map +1 -1
- package/dist/core.js.map +1 -1
- package/dist/forms.js.map +1 -1
- package/dist/heavy.js.map +1 -1
- package/dist/index.d.ts +144 -18
- package/dist/index.esm.js +110 -55
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +110 -55
- 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.js.map +1 -1
- package/dist/theme.d.ts +9 -9
- package/dist/theme.js.map +1 -1
- package/package.json +1 -1
- package/src/components/Accordion/Accordion.stories.tsx +32 -23
- package/src/components/Accordion/Accordion.test.tsx +70 -50
- package/src/components/Accordion/Accordion.tsx +99 -94
- package/src/components/AtomixGlass/AtomixGlass.test.tsx +1 -1
- package/src/components/AtomixGlass/GlassFilter.tsx +9 -16
- package/src/components/AtomixGlass/glass-utils.ts +4 -3
- package/src/components/AtomixGlass/shader-utils.ts +128 -52
- package/src/components/AtomixGlass/stories/Playground.stories.tsx +1 -1
- package/src/components/AtomixGlass/stories/Shaders.stories.tsx +1 -1
- package/src/components/Avatar/Avatar.stories.tsx +45 -62
- package/src/components/Avatar/Avatar.tsx +58 -56
- package/src/components/Badge/Badge.stories.tsx +20 -9
- package/src/components/Badge/Badge.test.tsx +41 -41
- package/src/components/Badge/Badge.tsx +64 -62
- package/src/components/Block/Block.stories.tsx +14 -4
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +9 -8
- package/src/components/Breadcrumb/Breadcrumb.tsx +62 -60
- package/src/components/Button/Button.stories.tsx +13 -22
- package/src/components/Button/Button.test.tsx +97 -81
- package/src/components/Button/Button.tsx +46 -14
- package/src/components/Button/ButtonGroup.stories.tsx +37 -32
- package/src/components/Button/ButtonGroup.tsx +4 -15
- package/src/components/Callout/Callout.stories.tsx +109 -16
- package/src/components/Card/Card.stories.tsx +67 -36
- package/src/components/Card/Card.tsx +30 -14
- package/src/components/Chart/AreaChart.tsx +1 -1
- package/src/components/Chart/CandlestickChart.tsx +23 -16
- package/src/components/Chart/Chart.stories.tsx +4 -9
- package/src/components/Chart/Chart.tsx +40 -44
- package/src/components/Chart/ChartRenderer.tsx +39 -12
- package/src/components/Chart/ChartToolbar.tsx +21 -5
- package/src/components/Chart/DonutChart.tsx +1 -1
- package/src/components/Chart/FunnelChart.tsx +4 -1
- package/src/components/Chart/GaugeChart.tsx +3 -1
- package/src/components/Chart/HeatmapChart.tsx +50 -37
- package/src/components/Chart/LineChart.tsx +3 -2
- package/src/components/Chart/MultiAxisChart.tsx +24 -16
- package/src/components/Chart/RadarChart.tsx +19 -17
- package/src/components/Chart/ScatterChart.tsx +29 -21
- package/src/components/ColorModeToggle/ColorModeToggle.stories.tsx +6 -2
- package/src/components/ColorModeToggle/ColorModeToggle.tsx +15 -3
- package/src/components/Countdown/Countdown.stories.tsx +7 -7
- package/src/components/DataTable/DataTable.stories.tsx +43 -38
- package/src/components/DataTable/DataTable.test.tsx +26 -148
- package/src/components/DataTable/DataTable.tsx +485 -456
- package/src/components/DatePicker/DatePicker.stories.tsx +32 -47
- package/src/components/DatePicker/DatePicker.tsx +31 -26
- package/src/components/Dropdown/Dropdown.stories.tsx +2 -5
- package/src/components/Dropdown/Dropdown.tsx +313 -299
- package/src/components/EdgePanel/EdgePanel.stories.tsx +6 -19
- package/src/components/EdgePanel/EdgePanel.tsx +1 -3
- package/src/components/Footer/Footer.stories.tsx +21 -16
- package/src/components/Footer/Footer.tsx +130 -128
- package/src/components/Footer/FooterLink.tsx +2 -2
- package/src/components/Form/Checkbox.test.tsx +49 -49
- package/src/components/Form/Checkbox.tsx +108 -100
- package/src/components/Form/Form.stories.tsx +2 -10
- package/src/components/Form/Input.stories.tsx +22 -39
- package/src/components/Form/Input.test.tsx +38 -44
- package/src/components/Form/Radio.stories.tsx +6 -12
- package/src/components/Form/Radio.tsx +68 -66
- package/src/components/Form/Select.tsx +184 -182
- package/src/components/Form/Textarea.test.tsx +27 -32
- package/src/components/Hero/Hero.stories.tsx +56 -23
- package/src/components/Hero/Hero.tsx +201 -55
- package/src/components/Icon/index.ts +7 -1
- package/src/components/List/List.tsx +19 -23
- package/src/components/Modal/Modal.stories.tsx +2 -1
- package/src/components/Modal/Modal.tsx +130 -127
- package/src/components/Navigation/Menu/MegaMenu.tsx +70 -70
- package/src/components/Navigation/Nav/NavDropdown.tsx +1 -5
- package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +128 -28
- package/src/components/Navigation/SideMenu/SideMenu.tsx +5 -7
- package/src/components/Navigation/SideMenu/SideMenuItem.tsx +4 -5
- package/src/components/Pagination/Pagination.stories.tsx +7 -4
- package/src/components/Pagination/Pagination.tsx +199 -202
- package/src/components/PhotoViewer/PhotoViewer.tsx +4 -1
- package/src/components/Popover/Popover.stories.tsx +99 -192
- package/src/components/Popover/Popover.tsx +41 -37
- package/src/components/Progress/Progress.stories.tsx +35 -44
- package/src/components/River/River.stories.tsx +2 -1
- package/src/components/SectionIntro/SectionIntro.stories.tsx +71 -71
- package/src/components/Slider/Slider.stories.tsx +12 -4
- package/src/components/Spinner/Spinner.stories.tsx +3 -1
- package/src/components/Spinner/Spinner.test.tsx +23 -23
- package/src/components/Spinner/Spinner.tsx +43 -46
- package/src/components/Steps/Steps.stories.tsx +8 -6
- package/src/components/Tabs/Tabs.stories.tsx +12 -9
- package/src/components/Tabs/Tabs.tsx +74 -72
- package/src/components/Toggle/Toggle.stories.tsx +27 -13
- package/src/components/Toggle/Toggle.test.tsx +65 -70
- package/src/components/Toggle/Toggle.tsx +4 -1
- package/src/components/Tooltip/Tooltip.stories.tsx +24 -20
- package/src/components/Tooltip/Tooltip.tsx +104 -106
- package/src/components/Upload/Upload.stories.tsx +129 -127
- package/src/components/Upload/Upload.tsx +287 -283
- package/src/components/VideoPlayer/VideoPlayer.tsx +6 -1
- package/src/components/index.ts +13 -2
- package/src/layouts/Grid/Grid.stories.tsx +9 -3
- package/src/layouts/MasonryGrid/MasonryGrid.tsx +5 -1
- package/src/lib/__tests__/theme-tools.test.ts +32 -6
- package/src/lib/composables/shared-mouse-tracker.ts +13 -14
- package/src/lib/composables/useAtomixGlass.ts +106 -49
- package/src/lib/composables/useChartExport.ts +1 -1
- package/src/lib/composables/useDataTable.ts +29 -17
- package/src/lib/composables/useHero.ts +58 -14
- package/src/lib/composables/useHeroBackgroundSlider.ts +2 -9
- package/src/lib/composables/useInput.ts +10 -8
- package/src/lib/composables/useSideMenu.ts +6 -5
- package/src/lib/composables/useTooltip.ts +1 -2
- package/src/lib/composables/useVideoPlayer.ts +44 -35
- package/src/lib/config/index.ts +154 -154
- package/src/lib/constants/cssVariables.ts +29 -29
- package/src/lib/hooks/__tests__/useComponentCustomization.test.ts +2 -6
- package/src/lib/hooks/index.ts +1 -1
- package/src/lib/hooks/useComponentCustomization.ts +11 -17
- package/src/lib/hooks/usePerformanceMonitor.ts +6 -7
- package/src/lib/patterns/__tests__/slots.test.ts +1 -1
- package/src/lib/patterns/index.ts +1 -1
- package/src/lib/patterns/slots.tsx +8 -13
- package/src/lib/storybook/InteractiveDemo.tsx +13 -18
- package/src/lib/storybook/PreviewContainer.tsx +1 -1
- package/src/lib/storybook/VariantsGrid.tsx +3 -7
- package/src/lib/storybook/index.ts +1 -1
- package/src/lib/theme/adapters/cssVariableMapper.ts +47 -74
- package/src/lib/theme/adapters/index.ts +3 -9
- package/src/lib/theme/adapters/themeAdapter.ts +41 -26
- package/src/lib/theme/config/index.ts +1 -1
- package/src/lib/theme/config/types.ts +2 -2
- package/src/lib/theme/config/validator.ts +10 -5
- package/src/lib/theme/constants/constants.ts +2 -2
- package/src/lib/theme/constants/index.ts +1 -2
- package/src/lib/theme/core/__tests__/createTheme.test.ts +20 -22
- package/src/lib/theme/core/composeTheme.ts +32 -26
- package/src/lib/theme/core/createTheme.ts +1 -1
- package/src/lib/theme/core/createThemeObject.ts +308 -301
- package/src/lib/theme/core/index.ts +3 -3
- package/src/lib/theme/devtools/CLI.ts +106 -104
- package/src/lib/theme/devtools/Comparator.tsx +50 -32
- package/src/lib/theme/devtools/DesignTokensCustomizer.stories.tsx +50 -48
- package/src/lib/theme/devtools/DesignTokensCustomizer.tsx +257 -63
- package/src/lib/theme/devtools/Inspector.tsx +75 -60
- package/src/lib/theme/devtools/LiveEditor.tsx +97 -76
- package/src/lib/theme/devtools/Preview.tsx +150 -106
- package/src/lib/theme/devtools/ThemeValidator.ts +29 -21
- package/src/lib/theme/devtools/index.ts +3 -9
- package/src/lib/theme/devtools/useHistory.ts +23 -21
- package/src/lib/theme/errors/errors.ts +12 -11
- package/src/lib/theme/errors/index.ts +2 -7
- package/src/lib/theme/generators/generateCSS.ts +9 -13
- package/src/lib/theme/generators/generateCSSNested.ts +1 -6
- package/src/lib/theme/generators/generateCSSVariables.ts +673 -630
- package/src/lib/theme/generators/index.ts +1 -4
- package/src/lib/theme/i18n/index.ts +1 -1
- package/src/lib/theme/i18n/rtl.ts +13 -13
- package/src/lib/theme/index.ts +7 -16
- package/src/lib/theme/runtime/ThemeApplicator.ts +4 -4
- package/src/lib/theme/runtime/ThemeContext.tsx +1 -1
- package/src/lib/theme/runtime/ThemeErrorBoundary.tsx +19 -23
- package/src/lib/theme/runtime/ThemeProvider.tsx +230 -239
- package/src/lib/theme/runtime/__tests__/ThemeProvider.integration.test.tsx +1 -1
- package/src/lib/theme/runtime/__tests__/ThemeProvider.test.tsx +24 -29
- package/src/lib/theme/runtime/index.ts +2 -5
- package/src/lib/theme/runtime/useTheme.ts +18 -18
- package/src/lib/theme/runtime/useThemeTokens.ts +22 -22
- package/src/lib/theme/test/testTheme.ts +15 -16
- package/src/lib/theme/tokens/index.ts +2 -7
- package/src/lib/theme/tokens/tokens.ts +25 -24
- package/src/lib/theme/types.ts +428 -411
- package/src/lib/theme/utils/__tests__/themeValidation.test.ts +3 -3
- package/src/lib/theme/utils/componentTheming.ts +18 -18
- package/src/lib/theme/utils/domUtils.ts +277 -289
- package/src/lib/theme/utils/index.ts +1 -2
- package/src/lib/theme/utils/injectCSS.ts +10 -14
- package/src/lib/theme/utils/naming.ts +20 -16
- package/src/lib/theme/utils/themeHelpers.ts +10 -12
- package/src/lib/theme/utils/themeUtils.ts +85 -86
- package/src/lib/theme/utils/themeValidation.ts +82 -33
- package/src/lib/theme-tools.ts +8 -6
- package/src/lib/types/components.ts +172 -71
- package/src/lib/types/partProps.ts +1 -1
- package/src/lib/utils/__tests__/csv.test.ts +1 -1
- package/src/lib/utils/componentUtils.ts +8 -12
- package/src/lib/utils/csv.ts +3 -1
- package/src/lib/utils/dataTableExport.ts +1 -5
- package/src/lib/utils/fontPreloader.ts +10 -19
- package/src/lib/utils/icons.ts +4 -1
- package/src/lib/utils/index.ts +2 -6
- package/src/lib/utils/memoryMonitor.ts +10 -8
- package/src/lib/utils/themeNaming.ts +2 -2
- package/src/styles/01-settings/_index.scss +0 -1
- package/src/styles/01-settings/_settings.colors.scss +8 -8
- package/src/styles/01-settings/_settings.design-tokens.scss +61 -50
- package/src/styles/01-settings/_settings.navbar.scss +1 -1
- package/src/styles/01-settings/_settings.spacing.scss +3 -4
- package/src/styles/01-settings/_settings.tooltip.scss +1 -1
- package/src/styles/01-settings/_settings.typography.scss +1 -1
- package/src/styles/02-tools/_tools.button.scss +51 -21
- package/src/styles/02-tools/_tools.utility-api.scss +30 -18
- package/src/styles/03-generic/_generic.root.scss +4 -3
- package/src/styles/06-components/_components.atomix-glass.scss +13 -9
- package/src/styles/06-components/_components.button.scss +16 -4
- package/src/styles/06-components/_components.callout.scss +27 -21
- package/src/styles/06-components/_components.card.scss +5 -14
- package/src/styles/06-components/_components.chart.scss +22 -19
- package/src/styles/06-components/_components.checkbox.scss +3 -1
- package/src/styles/06-components/_components.color-mode-toggle.scss +3 -1
- package/src/styles/06-components/_components.edge-panel.scss +9 -2
- package/src/styles/06-components/_components.footer.scss +1 -1
- package/src/styles/06-components/_components.side-menu.scss +5 -5
- package/src/styles/06-components/_components.toggle.scss +18 -0
- package/src/styles/06-components/_index.scss +1 -1
- package/src/styles/06-components/old.chart.styles.scss +0 -2
- package/src/styles/99-utilities/_utilities.border.scss +69 -27
- package/src/styles/99-utilities/_utilities.display.scss +1 -1
- package/src/styles/99-utilities/_utilities.opacity.scss +10 -0
- package/src/styles/99-utilities/_utilities.position.scss +16 -9
- package/src/styles/99-utilities/_utilities.scss +1 -1
- package/src/styles/99-utilities/_utilities.sizes.scss +47 -18
- package/src/styles/99-utilities/_utilities.spacing.scss +118 -66
- package/src/styles/99-utilities/_utilities.text-gradient.scss +30 -30
- package/src/styles/99-utilities/_utilities.text.scss +67 -46
|
@@ -18,29 +18,29 @@ const meta = {
|
|
|
18
18
|
},
|
|
19
19
|
tags: ['autodocs'],
|
|
20
20
|
argTypes: {
|
|
21
|
-
title: {
|
|
22
|
-
control: 'text',
|
|
23
|
-
description: 'Main title text (supports ReactNode)',
|
|
21
|
+
title: {
|
|
22
|
+
control: 'text',
|
|
23
|
+
description: 'Main title text (supports ReactNode)',
|
|
24
24
|
table: {
|
|
25
25
|
type: { summary: 'ReactNode' },
|
|
26
26
|
defaultValue: { summary: 'undefined' },
|
|
27
|
-
}
|
|
27
|
+
},
|
|
28
28
|
},
|
|
29
|
-
label: {
|
|
30
|
-
control: 'text',
|
|
31
|
-
description: 'Label text displayed above the title (supports ReactNode)',
|
|
29
|
+
label: {
|
|
30
|
+
control: 'text',
|
|
31
|
+
description: 'Label text displayed above the title (supports ReactNode)',
|
|
32
32
|
table: {
|
|
33
33
|
type: { summary: 'ReactNode' },
|
|
34
34
|
defaultValue: { summary: 'undefined' },
|
|
35
|
-
}
|
|
35
|
+
},
|
|
36
36
|
},
|
|
37
|
-
text: {
|
|
38
|
-
control: 'text',
|
|
39
|
-
description: 'Description text content (supports ReactNode)',
|
|
37
|
+
text: {
|
|
38
|
+
control: 'text',
|
|
39
|
+
description: 'Description text content (supports ReactNode)',
|
|
40
40
|
table: {
|
|
41
41
|
type: { summary: 'ReactNode' },
|
|
42
42
|
defaultValue: { summary: 'undefined' },
|
|
43
|
-
}
|
|
43
|
+
},
|
|
44
44
|
},
|
|
45
45
|
alignment: {
|
|
46
46
|
control: { type: 'radio', options: ['left', 'center', 'right'] },
|
|
@@ -49,7 +49,7 @@ const meta = {
|
|
|
49
49
|
table: {
|
|
50
50
|
type: { summary: '"left" | "center" | "right"' },
|
|
51
51
|
defaultValue: { summary: 'left' },
|
|
52
|
-
}
|
|
52
|
+
},
|
|
53
53
|
},
|
|
54
54
|
size: {
|
|
55
55
|
control: { type: 'radio', options: SIZES },
|
|
@@ -58,55 +58,55 @@ const meta = {
|
|
|
58
58
|
table: {
|
|
59
59
|
type: { summary: '"sm" | "md" | "lg"' },
|
|
60
60
|
defaultValue: { summary: 'md' },
|
|
61
|
-
}
|
|
61
|
+
},
|
|
62
62
|
},
|
|
63
|
-
skeleton: {
|
|
63
|
+
skeleton: {
|
|
64
64
|
control: 'boolean',
|
|
65
65
|
description: 'Show skeleton loading state',
|
|
66
66
|
table: {
|
|
67
67
|
type: { summary: 'boolean' },
|
|
68
68
|
defaultValue: { summary: false },
|
|
69
|
-
}
|
|
69
|
+
},
|
|
70
70
|
},
|
|
71
|
-
showOverlay: {
|
|
71
|
+
showOverlay: {
|
|
72
72
|
control: 'boolean',
|
|
73
73
|
description: 'Whether to show an overlay on the background',
|
|
74
74
|
table: {
|
|
75
75
|
type: { summary: 'boolean' },
|
|
76
76
|
defaultValue: { summary: false },
|
|
77
|
-
}
|
|
77
|
+
},
|
|
78
78
|
},
|
|
79
|
-
actions: {
|
|
79
|
+
actions: {
|
|
80
80
|
control: { type: 'text' },
|
|
81
81
|
description: 'Call to action elements (supports ReactNode)',
|
|
82
82
|
table: {
|
|
83
83
|
type: { summary: 'ReactNode' },
|
|
84
84
|
defaultValue: { summary: 'undefined' },
|
|
85
|
-
}
|
|
85
|
+
},
|
|
86
86
|
},
|
|
87
|
-
backgroundImageSrc: {
|
|
87
|
+
backgroundImageSrc: {
|
|
88
88
|
control: 'text',
|
|
89
89
|
description: 'URL for the background image',
|
|
90
90
|
table: {
|
|
91
91
|
type: { summary: 'string' },
|
|
92
92
|
defaultValue: { summary: 'undefined' },
|
|
93
|
-
}
|
|
93
|
+
},
|
|
94
94
|
},
|
|
95
|
-
imageSrc: {
|
|
95
|
+
imageSrc: {
|
|
96
96
|
control: 'text',
|
|
97
97
|
description: 'URL for the foreground image',
|
|
98
98
|
table: {
|
|
99
99
|
type: { summary: 'string' },
|
|
100
100
|
defaultValue: { summary: 'undefined' },
|
|
101
|
-
}
|
|
101
|
+
},
|
|
102
102
|
},
|
|
103
|
-
imageAlt: {
|
|
104
|
-
control: 'text',
|
|
105
|
-
description: 'Alt text for the image',
|
|
103
|
+
imageAlt: {
|
|
104
|
+
control: 'text',
|
|
105
|
+
description: 'Alt text for the image',
|
|
106
106
|
table: {
|
|
107
107
|
type: { summary: 'string' },
|
|
108
108
|
defaultValue: { summary: 'Section image' },
|
|
109
|
-
}
|
|
109
|
+
},
|
|
110
110
|
},
|
|
111
111
|
className: {
|
|
112
112
|
control: 'text',
|
|
@@ -114,7 +114,7 @@ const meta = {
|
|
|
114
114
|
table: {
|
|
115
115
|
type: { summary: 'string' },
|
|
116
116
|
defaultValue: { summary: '' },
|
|
117
|
-
}
|
|
117
|
+
},
|
|
118
118
|
},
|
|
119
119
|
style: {
|
|
120
120
|
control: 'object',
|
|
@@ -122,7 +122,7 @@ const meta = {
|
|
|
122
122
|
table: {
|
|
123
123
|
type: { summary: 'CSSProperties' },
|
|
124
124
|
defaultValue: { summary: '{}' },
|
|
125
|
-
}
|
|
125
|
+
},
|
|
126
126
|
},
|
|
127
127
|
},
|
|
128
128
|
args: {
|
|
@@ -151,10 +151,10 @@ export const BasicUsage: Story = {
|
|
|
151
151
|
parameters: {
|
|
152
152
|
docs: {
|
|
153
153
|
description: {
|
|
154
|
-
story: 'Basic usage of the SectionIntro component with title, label, and text.'
|
|
155
|
-
}
|
|
156
|
-
}
|
|
157
|
-
}
|
|
154
|
+
story: 'Basic usage of the SectionIntro component with title, label, and text.',
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
},
|
|
158
158
|
};
|
|
159
159
|
|
|
160
160
|
// With actions example
|
|
@@ -175,10 +175,10 @@ export const WithActions: Story = {
|
|
|
175
175
|
parameters: {
|
|
176
176
|
docs: {
|
|
177
177
|
description: {
|
|
178
|
-
story: 'SectionIntro with call-to-action buttons.'
|
|
179
|
-
}
|
|
180
|
-
}
|
|
181
|
-
}
|
|
178
|
+
story: 'SectionIntro with call-to-action buttons.',
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
},
|
|
182
182
|
};
|
|
183
183
|
|
|
184
184
|
// Center-aligned example
|
|
@@ -193,10 +193,10 @@ export const CenterAligned: Story = {
|
|
|
193
193
|
parameters: {
|
|
194
194
|
docs: {
|
|
195
195
|
description: {
|
|
196
|
-
story: 'Center-aligned SectionIntro content.'
|
|
197
|
-
}
|
|
198
|
-
}
|
|
199
|
-
}
|
|
196
|
+
story: 'Center-aligned SectionIntro content.',
|
|
197
|
+
},
|
|
198
|
+
},
|
|
199
|
+
},
|
|
200
200
|
};
|
|
201
201
|
|
|
202
202
|
// Right-aligned example
|
|
@@ -211,10 +211,10 @@ export const RightAligned: Story = {
|
|
|
211
211
|
parameters: {
|
|
212
212
|
docs: {
|
|
213
213
|
description: {
|
|
214
|
-
story: 'Right-aligned SectionIntro content.'
|
|
215
|
-
}
|
|
216
|
-
}
|
|
217
|
-
}
|
|
214
|
+
story: 'Right-aligned SectionIntro content.',
|
|
215
|
+
},
|
|
216
|
+
},
|
|
217
|
+
},
|
|
218
218
|
};
|
|
219
219
|
|
|
220
220
|
// With background image example
|
|
@@ -232,10 +232,10 @@ export const WithBackgroundImage: Story = {
|
|
|
232
232
|
parameters: {
|
|
233
233
|
docs: {
|
|
234
234
|
description: {
|
|
235
|
-
story: 'SectionIntro with a background image and overlay.'
|
|
236
|
-
}
|
|
237
|
-
}
|
|
238
|
-
}
|
|
235
|
+
story: 'SectionIntro with a background image and overlay.',
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
},
|
|
239
239
|
};
|
|
240
240
|
|
|
241
241
|
// With foreground image example
|
|
@@ -253,10 +253,10 @@ export const WithForegroundImage: Story = {
|
|
|
253
253
|
parameters: {
|
|
254
254
|
docs: {
|
|
255
255
|
description: {
|
|
256
|
-
story: 'SectionIntro with a foreground image.'
|
|
257
|
-
}
|
|
258
|
-
}
|
|
259
|
-
}
|
|
256
|
+
story: 'SectionIntro with a foreground image.',
|
|
257
|
+
},
|
|
258
|
+
},
|
|
259
|
+
},
|
|
260
260
|
};
|
|
261
261
|
|
|
262
262
|
// Small size example
|
|
@@ -271,10 +271,10 @@ export const SmallSize: Story = {
|
|
|
271
271
|
parameters: {
|
|
272
272
|
docs: {
|
|
273
273
|
description: {
|
|
274
|
-
story: 'Small-sized SectionIntro for compact layouts.'
|
|
275
|
-
}
|
|
276
|
-
}
|
|
277
|
-
}
|
|
274
|
+
story: 'Small-sized SectionIntro for compact layouts.',
|
|
275
|
+
},
|
|
276
|
+
},
|
|
277
|
+
},
|
|
278
278
|
};
|
|
279
279
|
|
|
280
280
|
// Large size example
|
|
@@ -289,10 +289,10 @@ export const LargeSize: Story = {
|
|
|
289
289
|
parameters: {
|
|
290
290
|
docs: {
|
|
291
291
|
description: {
|
|
292
|
-
story: 'Large-sized SectionIntro for prominent displays.'
|
|
293
|
-
}
|
|
294
|
-
}
|
|
295
|
-
}
|
|
292
|
+
story: 'Large-sized SectionIntro for prominent displays.',
|
|
293
|
+
},
|
|
294
|
+
},
|
|
295
|
+
},
|
|
296
296
|
};
|
|
297
297
|
|
|
298
298
|
// Skeleton loading state example
|
|
@@ -308,10 +308,10 @@ export const SkeletonLoading: Story = {
|
|
|
308
308
|
parameters: {
|
|
309
309
|
docs: {
|
|
310
310
|
description: {
|
|
311
|
-
story: 'Skeleton loading state of the SectionIntro component.'
|
|
312
|
-
}
|
|
313
|
-
}
|
|
314
|
-
}
|
|
311
|
+
story: 'Skeleton loading state of the SectionIntro component.',
|
|
312
|
+
},
|
|
313
|
+
},
|
|
314
|
+
},
|
|
315
315
|
};
|
|
316
316
|
|
|
317
317
|
// Full featured example
|
|
@@ -338,8 +338,8 @@ export const FullFeaturedExample: Story = {
|
|
|
338
338
|
parameters: {
|
|
339
339
|
docs: {
|
|
340
340
|
description: {
|
|
341
|
-
story: 'Full featured SectionIntro with all options enabled.'
|
|
342
|
-
}
|
|
343
|
-
}
|
|
344
|
-
}
|
|
345
|
-
};
|
|
341
|
+
story: 'Full featured SectionIntro with all options enabled.',
|
|
342
|
+
},
|
|
343
|
+
},
|
|
344
|
+
},
|
|
345
|
+
};
|
|
@@ -225,7 +225,9 @@ const basicSlides: SliderSlide[] = [
|
|
|
225
225
|
>
|
|
226
226
|
<div className="u-text-center">
|
|
227
227
|
<h2 className="u-text-3 u-c-white u-mb-3">Developer Friendly</h2>
|
|
228
|
-
<p className="u-text-base u-c-white u-mb-4">
|
|
228
|
+
<p className="u-text-base u-c-white u-mb-4">
|
|
229
|
+
Well documented with clear APIs and examples
|
|
230
|
+
</p>
|
|
229
231
|
<Button variant="primary">View Docs</Button>
|
|
230
232
|
</div>
|
|
231
233
|
</div>
|
|
@@ -295,7 +297,9 @@ const basicSlides: SliderSlide[] = [
|
|
|
295
297
|
>
|
|
296
298
|
<div className="u-text-center">
|
|
297
299
|
<h2 className="u-text-3 u-c-white u-mb-3">RTL Support</h2>
|
|
298
|
-
<p className="u-text-base u-c-white u-mb-4">
|
|
300
|
+
<p className="u-text-base u-c-white u-mb-4">
|
|
301
|
+
Full right-to-left language support built-in
|
|
302
|
+
</p>
|
|
299
303
|
<Button variant="info">Learn More</Button>
|
|
300
304
|
</div>
|
|
301
305
|
</div>
|
|
@@ -317,7 +321,9 @@ const basicSlides: SliderSlide[] = [
|
|
|
317
321
|
>
|
|
318
322
|
<div className="u-text-center">
|
|
319
323
|
<h2 className="u-text-3 u-c-white u-mb-3">Open Source</h2>
|
|
320
|
-
<p className="u-text-base u-c-white u-mb-4">
|
|
324
|
+
<p className="u-text-base u-c-white u-mb-4">
|
|
325
|
+
Free to use and contribute to the community
|
|
326
|
+
</p>
|
|
321
327
|
<Button variant="success">View on GitHub</Button>
|
|
322
328
|
</div>
|
|
323
329
|
</div>
|
|
@@ -342,7 +348,9 @@ const productSlides: SliderSlide[] = [
|
|
|
342
348
|
}}
|
|
343
349
|
/>
|
|
344
350
|
<h3 className="u-text-4 u-font-bold u-mb-2">Premium Plan</h3>
|
|
345
|
-
<p className="u-text-sm u-c-muted u-mb-3">
|
|
351
|
+
<p className="u-text-sm u-c-muted u-mb-3">
|
|
352
|
+
Perfect for small teams and growing businesses
|
|
353
|
+
</p>
|
|
346
354
|
<div className="u-mb-4">
|
|
347
355
|
<span className="u-text-1 u-font-bold">$29</span>
|
|
348
356
|
<span className="u-text-sm u-c-muted">/month</span>
|
|
@@ -149,7 +149,9 @@ export const AllVariants: Story = {
|
|
|
149
149
|
|
|
150
150
|
export const Fullscreen: Story = {
|
|
151
151
|
render: () => (
|
|
152
|
-
<div
|
|
152
|
+
<div
|
|
153
|
+
style={{ height: '200px', display: 'flex', alignItems: 'center', justifyContent: 'center' }}
|
|
154
|
+
>
|
|
153
155
|
<Spinner fullscreen={true} variant="primary" size="lg" />
|
|
154
156
|
</div>
|
|
155
157
|
),
|
|
@@ -4,32 +4,32 @@ import { Spinner } from './Spinner';
|
|
|
4
4
|
|
|
5
5
|
// Mock AtomixGlass component
|
|
6
6
|
vi.mock('../AtomixGlass/AtomixGlass', () => ({
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
AtomixGlass: ({ children, ...props }: any) => (
|
|
8
|
+
<div data-testid="atomix-glass" data-glass-props={JSON.stringify(props)}>
|
|
9
|
+
{children}
|
|
10
|
+
</div>
|
|
11
|
+
),
|
|
12
12
|
}));
|
|
13
13
|
|
|
14
14
|
describe('Spinner Component', () => {
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
15
|
+
it('renders with default accessibility props', () => {
|
|
16
|
+
render(<Spinner />);
|
|
17
|
+
const spinner = screen.getByRole('status');
|
|
18
|
+
expect(spinner).toBeInTheDocument();
|
|
19
|
+
expect(spinner).toHaveAttribute('aria-label', 'Loading');
|
|
20
|
+
expect(screen.getByText('Loading...')).toBeInTheDocument();
|
|
21
|
+
});
|
|
22
22
|
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
it('renders with custom accessibility props', () => {
|
|
24
|
+
render(<Spinner role="alert" aria-label="Please wait" />);
|
|
25
|
+
const spinner = screen.getByRole('alert');
|
|
26
|
+
expect(spinner).toBeInTheDocument();
|
|
27
|
+
expect(spinner).toHaveAttribute('aria-label', 'Please wait');
|
|
28
|
+
expect(screen.getByText('Please wait')).toBeInTheDocument();
|
|
29
|
+
});
|
|
30
30
|
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
31
|
+
it('renders as glass when enabled', () => {
|
|
32
|
+
render(<Spinner glass />);
|
|
33
|
+
expect(screen.getByTestId('atomix-glass')).toBeInTheDocument();
|
|
34
|
+
});
|
|
35
35
|
});
|
|
@@ -4,53 +4,50 @@ import { useSpinner } from '../../lib/composables/useSpinner';
|
|
|
4
4
|
import { SPINNER } from '../../lib/constants/components';
|
|
5
5
|
import { AtomixGlass } from '../AtomixGlass/AtomixGlass';
|
|
6
6
|
|
|
7
|
-
export const Spinner: React.FC<SpinnerProps> = memo(
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
className={spinnerClass}
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
return <AtomixGlass {...glassProps}>{spinnerContent}</AtomixGlass>;
|
|
7
|
+
export const Spinner: React.FC<SpinnerProps> = memo(
|
|
8
|
+
({
|
|
9
|
+
size = 'md',
|
|
10
|
+
variant = 'primary',
|
|
11
|
+
fullscreen = false,
|
|
12
|
+
className = '',
|
|
13
|
+
style,
|
|
14
|
+
glass,
|
|
15
|
+
'aria-label': ariaLabel,
|
|
16
|
+
role = 'status',
|
|
17
|
+
}) => {
|
|
18
|
+
const { generateSpinnerClass } = useSpinner({
|
|
19
|
+
size,
|
|
20
|
+
variant,
|
|
21
|
+
fullscreen,
|
|
22
|
+
});
|
|
23
|
+
|
|
24
|
+
const spinnerClass = generateSpinnerClass({
|
|
25
|
+
size,
|
|
26
|
+
variant,
|
|
27
|
+
fullscreen,
|
|
28
|
+
className: `${className} ${glass ? 'c-spinner--glass' : ''}`.trim(),
|
|
29
|
+
});
|
|
30
|
+
|
|
31
|
+
const spinnerContent = (
|
|
32
|
+
<div className={spinnerClass} style={style} role={role} aria-label={ariaLabel || 'Loading'}>
|
|
33
|
+
<span className={SPINNER.VISUALLY_HIDDEN}>{ariaLabel || 'Loading...'}</span>
|
|
34
|
+
</div>
|
|
35
|
+
);
|
|
36
|
+
|
|
37
|
+
if (glass) {
|
|
38
|
+
const defaultGlassProps = {
|
|
39
|
+
displacementScale: 20,
|
|
40
|
+
blurAmount: 1,
|
|
41
|
+
cornerRadius: 999,
|
|
42
|
+
mode: 'shader' as const,
|
|
43
|
+
};
|
|
44
|
+
const glassProps = glass === true ? defaultGlassProps : { ...defaultGlassProps, ...glass };
|
|
45
|
+
return <AtomixGlass {...glassProps}>{spinnerContent}</AtomixGlass>;
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
return spinnerContent;
|
|
50
49
|
}
|
|
51
|
-
|
|
52
|
-
return spinnerContent;
|
|
53
|
-
});
|
|
50
|
+
);
|
|
54
51
|
|
|
55
52
|
export type { SpinnerProps };
|
|
56
53
|
|
|
@@ -129,7 +129,7 @@ export const BasicHorizontal: Story = {
|
|
|
129
129
|
activeIndex: 1,
|
|
130
130
|
vertical: false,
|
|
131
131
|
},
|
|
132
|
-
render:
|
|
132
|
+
render: args => (
|
|
133
133
|
<div style={{ padding: '30px' }}>
|
|
134
134
|
<Steps {...args} />
|
|
135
135
|
</div>
|
|
@@ -156,7 +156,7 @@ export const BasicVertical: Story = {
|
|
|
156
156
|
activeIndex: 1,
|
|
157
157
|
vertical: true,
|
|
158
158
|
},
|
|
159
|
-
render:
|
|
159
|
+
render: args => (
|
|
160
160
|
<div style={{ padding: '30px' }}>
|
|
161
161
|
<Steps {...args} />
|
|
162
162
|
</div>
|
|
@@ -243,7 +243,9 @@ export const WithIcons: Story = {
|
|
|
243
243
|
};
|
|
244
244
|
|
|
245
245
|
// Interactive steps with buttons for navigation
|
|
246
|
-
const InteractiveStepsTemplate: React.FC<{ onStepChange?: (index: number) => void }> = ({
|
|
246
|
+
const InteractiveStepsTemplate: React.FC<{ onStepChange?: (index: number) => void }> = ({
|
|
247
|
+
onStepChange,
|
|
248
|
+
}) => {
|
|
247
249
|
const [activeStep, setActiveStep] = React.useState(0);
|
|
248
250
|
|
|
249
251
|
const handleStepChange = (stepIndex: number) => {
|
|
@@ -316,7 +318,7 @@ export const GlassHorizontal: Story = {
|
|
|
316
318
|
vertical: false,
|
|
317
319
|
glass: true,
|
|
318
320
|
},
|
|
319
|
-
render:
|
|
321
|
+
render: args => (
|
|
320
322
|
<div
|
|
321
323
|
style={{
|
|
322
324
|
background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
|
|
@@ -356,7 +358,7 @@ export const GlassVertical: Story = {
|
|
|
356
358
|
vertical: true,
|
|
357
359
|
glass: true,
|
|
358
360
|
},
|
|
359
|
-
render:
|
|
361
|
+
render: args => (
|
|
360
362
|
<div
|
|
361
363
|
style={{
|
|
362
364
|
background:
|
|
@@ -405,7 +407,7 @@ export const GlassCustom: Story = {
|
|
|
405
407
|
cornerRadius: 12,
|
|
406
408
|
},
|
|
407
409
|
},
|
|
408
|
-
render:
|
|
410
|
+
render: args => (
|
|
409
411
|
<div
|
|
410
412
|
style={{
|
|
411
413
|
background: 'linear-gradient(45deg, #ff6b6b, #4ecdc4, #45b7d1, #96ceb4, #feca57)',
|
|
@@ -180,13 +180,15 @@ export const WithDifferentActiveTab: Story = {
|
|
|
180
180
|
|
|
181
181
|
export const WithGlassEffect: Story = {
|
|
182
182
|
render: args => (
|
|
183
|
-
<div
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
183
|
+
<div
|
|
184
|
+
style={{
|
|
185
|
+
maxWidth: '600px',
|
|
186
|
+
margin: '0 auto',
|
|
187
|
+
padding: '30px',
|
|
188
|
+
background: 'linear-gradient(135deg, #667eea 0%, #764ba2 100%)',
|
|
189
|
+
minHeight: '300px',
|
|
190
|
+
}}
|
|
191
|
+
>
|
|
190
192
|
<Tabs {...args} />
|
|
191
193
|
</div>
|
|
192
194
|
),
|
|
@@ -224,7 +226,8 @@ export const WithRichContent: Story = {
|
|
|
224
226
|
parameters: {
|
|
225
227
|
docs: {
|
|
226
228
|
description: {
|
|
227
|
-
story:
|
|
229
|
+
story:
|
|
230
|
+
'Demonstrates tabs containing rich HTML content including headings, lists, and tables, showing the flexibility of the tabs component.',
|
|
228
231
|
},
|
|
229
232
|
},
|
|
230
233
|
},
|
|
@@ -392,4 +395,4 @@ export const GlassCustom: Story = {
|
|
|
392
395
|
</div>
|
|
393
396
|
</div>
|
|
394
397
|
),
|
|
395
|
-
};
|
|
398
|
+
};
|