@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,19 +1,29 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import { fn } from '@storybook/test';
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
4
3
|
import { Steps } from './Steps';
|
|
5
|
-
import type { StepsProps } from './Steps';
|
|
6
4
|
|
|
7
|
-
|
|
5
|
+
const meta = {
|
|
8
6
|
title: 'Components/Steps',
|
|
9
7
|
component: Steps,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'padded',
|
|
10
|
+
docs: {
|
|
11
|
+
description: {
|
|
12
|
+
component:
|
|
13
|
+
'The Steps component displays a sequence of steps in a process or workflow. It provides visual progress indication and can be displayed horizontally or vertically. Steps are ideal for multi-step forms, onboarding flows, or any process that requires clear progress visualization.',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
tags: ['autodocs'],
|
|
10
18
|
argTypes: {
|
|
11
19
|
activeIndex: {
|
|
12
20
|
control: { type: 'number' },
|
|
21
|
+
description: 'The index of the currently active step',
|
|
13
22
|
defaultValue: 1,
|
|
14
23
|
},
|
|
15
24
|
vertical: {
|
|
16
25
|
control: { type: 'boolean' },
|
|
26
|
+
description: 'Whether to display steps vertically',
|
|
17
27
|
defaultValue: false,
|
|
18
28
|
},
|
|
19
29
|
glass: {
|
|
@@ -21,103 +31,124 @@ export default {
|
|
|
21
31
|
description: 'Enable glass morphism effect',
|
|
22
32
|
},
|
|
23
33
|
},
|
|
24
|
-
}
|
|
34
|
+
} satisfies Meta<typeof Steps>;
|
|
25
35
|
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
<Steps {...args} />
|
|
29
|
-
</div>
|
|
30
|
-
);
|
|
36
|
+
export default meta;
|
|
37
|
+
type Story = StoryObj<typeof meta>;
|
|
31
38
|
|
|
32
39
|
// Default horizontal steps
|
|
33
|
-
export const Default =
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
export const Default: Story = {
|
|
41
|
+
render: args => (
|
|
42
|
+
<div style={{ padding: '30px' }}>
|
|
43
|
+
<Steps {...args} />
|
|
44
|
+
</div>
|
|
45
|
+
),
|
|
46
|
+
args: {
|
|
47
|
+
items: [
|
|
48
|
+
{ number: 1, text: 'Step 1' },
|
|
49
|
+
{ number: 2, text: 'Step 2' },
|
|
50
|
+
{ number: 3, text: 'Step 3' },
|
|
51
|
+
{ number: 4, text: 'Step 4' },
|
|
52
|
+
{ number: 5, text: 'Step 5' },
|
|
53
|
+
],
|
|
54
|
+
activeIndex: 1,
|
|
55
|
+
vertical: false,
|
|
56
|
+
},
|
|
44
57
|
};
|
|
45
58
|
|
|
46
59
|
// Vertical steps
|
|
47
|
-
export const Vertical =
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
60
|
+
export const Vertical: Story = {
|
|
61
|
+
render: args => (
|
|
62
|
+
<div style={{ padding: '30px' }}>
|
|
63
|
+
<Steps {...args} />
|
|
64
|
+
</div>
|
|
65
|
+
),
|
|
66
|
+
args: {
|
|
67
|
+
items: [
|
|
68
|
+
{ number: 1, text: 'Step 1' },
|
|
69
|
+
{ number: 2, text: 'Step 2' },
|
|
70
|
+
{ number: 3, text: 'Step 3' },
|
|
71
|
+
{ number: 4, text: 'Step 4' },
|
|
72
|
+
{ number: 5, text: 'Step 5' },
|
|
73
|
+
],
|
|
74
|
+
activeIndex: 1,
|
|
75
|
+
vertical: true,
|
|
76
|
+
},
|
|
58
77
|
};
|
|
59
78
|
|
|
60
79
|
// Steps with custom content
|
|
61
|
-
export const WithCustomContent =
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
80
|
+
export const WithCustomContent: Story = {
|
|
81
|
+
render: args => (
|
|
82
|
+
<div style={{ padding: '30px' }}>
|
|
83
|
+
<Steps {...args} />
|
|
84
|
+
</div>
|
|
85
|
+
),
|
|
86
|
+
args: {
|
|
87
|
+
items: [
|
|
88
|
+
{
|
|
89
|
+
number: 1,
|
|
90
|
+
text: 'Registration',
|
|
91
|
+
content: <p style={{ marginTop: '10px', fontSize: '0.85em' }}>Create your account</p>,
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
number: 2,
|
|
95
|
+
text: 'Personal Info',
|
|
96
|
+
content: <p style={{ marginTop: '10px', fontSize: '0.85em' }}>Tell us about yourself</p>,
|
|
97
|
+
},
|
|
98
|
+
{
|
|
99
|
+
number: 3,
|
|
100
|
+
text: 'Preferences',
|
|
101
|
+
content: <p style={{ marginTop: '10px', fontSize: '0.85em' }}>Select your preferences</p>,
|
|
102
|
+
},
|
|
103
|
+
{
|
|
104
|
+
number: 4,
|
|
105
|
+
text: 'Payment',
|
|
106
|
+
content: <p style={{ marginTop: '10px', fontSize: '0.85em' }}>Add payment information</p>,
|
|
107
|
+
},
|
|
108
|
+
{
|
|
109
|
+
number: 5,
|
|
110
|
+
text: 'Confirmation',
|
|
111
|
+
content: <p style={{ marginTop: '10px', fontSize: '0.85em' }}>Complete your signup</p>,
|
|
112
|
+
},
|
|
113
|
+
],
|
|
114
|
+
activeIndex: 1,
|
|
115
|
+
vertical: false,
|
|
116
|
+
},
|
|
92
117
|
};
|
|
93
118
|
|
|
94
119
|
// Steps with custom icons instead of numbers
|
|
95
|
-
export const WithIcons =
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
120
|
+
export const WithIcons: Story = {
|
|
121
|
+
render: args => (
|
|
122
|
+
<div style={{ padding: '30px' }}>
|
|
123
|
+
<Steps {...args} />
|
|
124
|
+
</div>
|
|
125
|
+
),
|
|
126
|
+
args: {
|
|
127
|
+
items: [
|
|
128
|
+
{
|
|
129
|
+
number: <i className="icon-lux-user" style={{ fontSize: '16px' }}></i>,
|
|
130
|
+
text: 'Account',
|
|
131
|
+
},
|
|
132
|
+
{
|
|
133
|
+
number: <i className="icon-lux-settings" style={{ fontSize: '16px' }}></i>,
|
|
134
|
+
text: 'Settings',
|
|
135
|
+
},
|
|
136
|
+
{
|
|
137
|
+
number: <i className="icon-lux-calendar" style={{ fontSize: '16px' }}></i>,
|
|
138
|
+
text: 'Schedule',
|
|
139
|
+
},
|
|
140
|
+
{
|
|
141
|
+
number: <i className="icon-lux-card" style={{ fontSize: '16px' }}></i>,
|
|
142
|
+
text: 'Payment',
|
|
143
|
+
},
|
|
144
|
+
{
|
|
145
|
+
number: <i className="icon-lux-check" style={{ fontSize: '16px' }}></i>,
|
|
146
|
+
text: 'Complete',
|
|
147
|
+
},
|
|
148
|
+
],
|
|
149
|
+
activeIndex: 1,
|
|
150
|
+
vertical: false,
|
|
151
|
+
},
|
|
121
152
|
};
|
|
122
153
|
|
|
123
154
|
// Interactive steps with buttons for navigation
|
|
@@ -155,13 +186,16 @@ const InteractiveSteps: React.FC = () => {
|
|
|
155
186
|
);
|
|
156
187
|
};
|
|
157
188
|
|
|
158
|
-
export const Interactive:
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
189
|
+
export const Interactive: Story = {
|
|
190
|
+
args: {} as any,
|
|
191
|
+
render: () => (
|
|
192
|
+
<div style={{ padding: '30px' }}>
|
|
193
|
+
<InteractiveSteps />
|
|
194
|
+
</div>
|
|
195
|
+
),
|
|
196
|
+
};
|
|
163
197
|
|
|
164
|
-
export const Glass = {
|
|
198
|
+
export const Glass: Story = {
|
|
165
199
|
args: {
|
|
166
200
|
items: [
|
|
167
201
|
{ number: 1, text: 'Glass Step 1' },
|
|
@@ -193,7 +227,7 @@ export const Glass = {
|
|
|
193
227
|
),
|
|
194
228
|
};
|
|
195
229
|
|
|
196
|
-
export const GlassVertical = {
|
|
230
|
+
export const GlassVertical: Story = {
|
|
197
231
|
args: {
|
|
198
232
|
items: [
|
|
199
233
|
{ number: 1, text: 'Glass Step 1' },
|
|
@@ -228,7 +262,7 @@ export const GlassVertical = {
|
|
|
228
262
|
),
|
|
229
263
|
};
|
|
230
264
|
|
|
231
|
-
export const GlassCustom = {
|
|
265
|
+
export const GlassCustom: Story = {
|
|
232
266
|
args: {
|
|
233
267
|
items: [
|
|
234
268
|
{ number: 1, text: 'Custom Glass Step 1' },
|
|
@@ -245,7 +279,7 @@ export const GlassCustom = {
|
|
|
245
279
|
saturation: 200,
|
|
246
280
|
aberrationIntensity: 0.8,
|
|
247
281
|
cornerRadius: 12,
|
|
248
|
-
},
|
|
282
|
+
} as any,
|
|
249
283
|
},
|
|
250
284
|
render: (args: any) => (
|
|
251
285
|
<div
|
|
@@ -1,14 +1,28 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
|
+
import type { AtomixGlassProps } from '../../lib/types/components';
|
|
4
4
|
import { Tabs } from './Tabs';
|
|
5
5
|
|
|
6
|
-
|
|
6
|
+
// Helper type for glass props in stories (without children requirement)
|
|
7
|
+
type GlassProps = boolean | Omit<AtomixGlassProps, 'children'>;
|
|
8
|
+
|
|
9
|
+
const meta = {
|
|
7
10
|
title: 'Components/Tabs',
|
|
8
11
|
component: Tabs,
|
|
12
|
+
parameters: {
|
|
13
|
+
layout: 'padded',
|
|
14
|
+
docs: {
|
|
15
|
+
description: {
|
|
16
|
+
component:
|
|
17
|
+
'The Tabs component organizes content into multiple panels accessible via tab navigation. It provides a clean interface for switching between different views or sections of content. Tabs support keyboard navigation and can include rich content in each panel.',
|
|
18
|
+
},
|
|
19
|
+
},
|
|
20
|
+
},
|
|
21
|
+
tags: ['autodocs'],
|
|
9
22
|
argTypes: {
|
|
10
23
|
activeIndex: {
|
|
11
24
|
control: { type: 'number' },
|
|
25
|
+
description: 'The index of the currently active tab',
|
|
12
26
|
defaultValue: 0,
|
|
13
27
|
},
|
|
14
28
|
glass: {
|
|
@@ -16,123 +30,157 @@ export default {
|
|
|
16
30
|
description: 'Enable glass morphism effect',
|
|
17
31
|
},
|
|
18
32
|
},
|
|
19
|
-
}
|
|
33
|
+
} satisfies Meta<typeof Tabs>;
|
|
20
34
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
<Tabs {...args} />
|
|
24
|
-
</div>
|
|
25
|
-
);
|
|
35
|
+
export default meta;
|
|
36
|
+
type Story = StoryObj<typeof meta>;
|
|
26
37
|
|
|
27
|
-
|
|
28
|
-
Default
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
38
|
+
/**
|
|
39
|
+
* Default tabs component with three tabs.
|
|
40
|
+
*/
|
|
41
|
+
export const Default: Story = {
|
|
42
|
+
render: args => (
|
|
43
|
+
<div style={{ maxWidth: '600px', margin: '0 auto', padding: '30px' }}>
|
|
44
|
+
<Tabs {...args} />
|
|
45
|
+
</div>
|
|
46
|
+
),
|
|
47
|
+
args: {
|
|
48
|
+
items: [
|
|
49
|
+
{
|
|
50
|
+
label: 'Tab 1',
|
|
51
|
+
content: <p>This is the content for Tab 1. Default tab content.</p>,
|
|
52
|
+
},
|
|
53
|
+
{
|
|
54
|
+
label: 'Tab 2',
|
|
55
|
+
content: <p>This is the content for Tab 2. It contains different information.</p>,
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
label: 'Tab 3',
|
|
59
|
+
content: <p>This is the content for Tab 3. Another unique content section.</p>,
|
|
60
|
+
},
|
|
61
|
+
],
|
|
62
|
+
activeIndex: 0,
|
|
63
|
+
},
|
|
44
64
|
};
|
|
45
65
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
66
|
+
/**
|
|
67
|
+
* Tabs with a different tab initially active (Tab 2).
|
|
68
|
+
*/
|
|
69
|
+
export const WithDifferentActiveTab: Story = {
|
|
70
|
+
render: args => (
|
|
71
|
+
<div style={{ maxWidth: '600px', margin: '0 auto', padding: '30px' }}>
|
|
72
|
+
<Tabs {...args} />
|
|
73
|
+
</div>
|
|
74
|
+
),
|
|
75
|
+
args: {
|
|
76
|
+
items: [
|
|
77
|
+
{
|
|
78
|
+
label: 'Tab 1',
|
|
79
|
+
content: <p>This is the content for Tab 1.</p>,
|
|
80
|
+
},
|
|
81
|
+
{
|
|
82
|
+
label: 'Tab 2',
|
|
83
|
+
content: <p>This is the content for Tab 2. It's initially active.</p>,
|
|
84
|
+
},
|
|
85
|
+
{
|
|
86
|
+
label: 'Tab 3',
|
|
87
|
+
content: <p>This is the content for Tab 3.</p>,
|
|
88
|
+
},
|
|
89
|
+
],
|
|
90
|
+
activeIndex: 1,
|
|
91
|
+
},
|
|
63
92
|
};
|
|
64
93
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
<li>Responsive design</li>
|
|
75
|
-
<li>Accessible navigation</li>
|
|
76
|
-
<li>Smooth transitions</li>
|
|
77
|
-
</ul>
|
|
78
|
-
</div>
|
|
79
|
-
),
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
label: 'Specifications',
|
|
83
|
-
content: (
|
|
84
|
-
<div>
|
|
85
|
-
<h3>Technical Specifications</h3>
|
|
86
|
-
<table style={{ width: '100%', borderCollapse: 'collapse' }}>
|
|
87
|
-
<thead>
|
|
88
|
-
<tr>
|
|
89
|
-
<th style={{ border: '1px solid #ddd', padding: '8px', textAlign: 'left' }}>
|
|
90
|
-
Property
|
|
91
|
-
</th>
|
|
92
|
-
<th style={{ border: '1px solid #ddd', padding: '8px', textAlign: 'left' }}>
|
|
93
|
-
Value
|
|
94
|
-
</th>
|
|
95
|
-
</tr>
|
|
96
|
-
</thead>
|
|
97
|
-
<tbody>
|
|
98
|
-
<tr>
|
|
99
|
-
<td style={{ border: '1px solid #ddd', padding: '8px' }}>Size</td>
|
|
100
|
-
<td style={{ border: '1px solid #ddd', padding: '8px' }}>Medium</td>
|
|
101
|
-
</tr>
|
|
102
|
-
<tr>
|
|
103
|
-
<td style={{ border: '1px solid #ddd', padding: '8px' }}>Material</td>
|
|
104
|
-
<td style={{ border: '1px solid #ddd', padding: '8px' }}>Aluminum</td>
|
|
105
|
-
</tr>
|
|
106
|
-
</tbody>
|
|
107
|
-
</table>
|
|
108
|
-
</div>
|
|
109
|
-
),
|
|
94
|
+
/**
|
|
95
|
+
* Tabs with rich content including headings, lists, and tables.
|
|
96
|
+
*/
|
|
97
|
+
export const WithRichContent: Story = {
|
|
98
|
+
parameters: {
|
|
99
|
+
docs: {
|
|
100
|
+
description: {
|
|
101
|
+
story: 'Demonstrates tabs containing rich HTML content including headings, lists, and tables, showing the flexibility of the tabs component.',
|
|
102
|
+
},
|
|
110
103
|
},
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
104
|
+
},
|
|
105
|
+
render: args => (
|
|
106
|
+
<div style={{ maxWidth: '600px', margin: '0 auto', padding: '30px' }}>
|
|
107
|
+
<Tabs {...args} />
|
|
108
|
+
</div>
|
|
109
|
+
),
|
|
110
|
+
args: {
|
|
111
|
+
items: [
|
|
112
|
+
{
|
|
113
|
+
label: 'Features',
|
|
114
|
+
content: (
|
|
115
|
+
<div>
|
|
116
|
+
<h3>Key Features</h3>
|
|
117
|
+
<ul>
|
|
118
|
+
<li>Responsive design</li>
|
|
119
|
+
<li>Accessible navigation</li>
|
|
120
|
+
<li>Smooth transitions</li>
|
|
121
|
+
</ul>
|
|
121
122
|
</div>
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
123
|
+
),
|
|
124
|
+
},
|
|
125
|
+
{
|
|
126
|
+
label: 'Specifications',
|
|
127
|
+
content: (
|
|
128
|
+
<div>
|
|
129
|
+
<h3>Technical Specifications</h3>
|
|
130
|
+
<table style={{ width: '100%', borderCollapse: 'collapse' }}>
|
|
131
|
+
<thead>
|
|
132
|
+
<tr>
|
|
133
|
+
<th style={{ border: '1px solid #ddd', padding: '8px', textAlign: 'left' }}>
|
|
134
|
+
Property
|
|
135
|
+
</th>
|
|
136
|
+
<th style={{ border: '1px solid #ddd', padding: '8px', textAlign: 'left' }}>
|
|
137
|
+
Value
|
|
138
|
+
</th>
|
|
139
|
+
</tr>
|
|
140
|
+
</thead>
|
|
141
|
+
<tbody>
|
|
142
|
+
<tr>
|
|
143
|
+
<td style={{ border: '1px solid #ddd', padding: '8px' }}>Size</td>
|
|
144
|
+
<td style={{ border: '1px solid #ddd', padding: '8px' }}>Medium</td>
|
|
145
|
+
</tr>
|
|
146
|
+
<tr>
|
|
147
|
+
<td style={{ border: '1px solid #ddd', padding: '8px' }}>Material</td>
|
|
148
|
+
<td style={{ border: '1px solid #ddd', padding: '8px' }}>Aluminum</td>
|
|
149
|
+
</tr>
|
|
150
|
+
</tbody>
|
|
151
|
+
</table>
|
|
127
152
|
</div>
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
153
|
+
),
|
|
154
|
+
},
|
|
155
|
+
{
|
|
156
|
+
label: 'Reviews',
|
|
157
|
+
content: (
|
|
158
|
+
<div>
|
|
159
|
+
<h3>Customer Reviews</h3>
|
|
160
|
+
<div style={{ padding: '10px', marginBottom: '10px', backgroundColor: '#f9f9f9' }}>
|
|
161
|
+
<p style={{ marginBottom: '5px' }}>
|
|
162
|
+
<strong>John D.</strong> ★★★★★
|
|
163
|
+
</p>
|
|
164
|
+
<p>Great product, highly recommended!</p>
|
|
165
|
+
</div>
|
|
166
|
+
<div style={{ padding: '10px', backgroundColor: '#f9f9f9' }}>
|
|
167
|
+
<p style={{ marginBottom: '5px' }}>
|
|
168
|
+
<strong>Sarah T.</strong> ★★★★☆
|
|
169
|
+
</p>
|
|
170
|
+
<p>Very good quality and fast shipping.</p>
|
|
171
|
+
</div>
|
|
172
|
+
</div>
|
|
173
|
+
),
|
|
174
|
+
},
|
|
175
|
+
],
|
|
176
|
+
activeIndex: 0,
|
|
177
|
+
},
|
|
133
178
|
};
|
|
134
179
|
|
|
135
|
-
|
|
180
|
+
/**
|
|
181
|
+
* Tabs with glass morphism effect enabled.
|
|
182
|
+
*/
|
|
183
|
+
export const Glass: Story = {
|
|
136
184
|
args: {
|
|
137
185
|
items: [
|
|
138
186
|
{
|
|
@@ -170,7 +218,10 @@ export const Glass = {
|
|
|
170
218
|
),
|
|
171
219
|
};
|
|
172
220
|
|
|
173
|
-
|
|
221
|
+
/**
|
|
222
|
+
* Tabs with custom glass morphism settings.
|
|
223
|
+
*/
|
|
224
|
+
export const GlassCustom: Story = {
|
|
174
225
|
args: {
|
|
175
226
|
items: [
|
|
176
227
|
{
|
|
@@ -193,9 +244,9 @@ export const GlassCustom = {
|
|
|
193
244
|
saturation: 200,
|
|
194
245
|
aberrationIntensity: 0.8,
|
|
195
246
|
cornerRadius: 12,
|
|
196
|
-
},
|
|
247
|
+
} as GlassProps,
|
|
197
248
|
},
|
|
198
|
-
render:
|
|
249
|
+
render: args => (
|
|
199
250
|
<div
|
|
200
251
|
style={{
|
|
201
252
|
background:
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import React, { useState, ReactNode } from 'react';
|
|
1
|
+
import React, { useState, ReactNode, memo } from 'react';
|
|
2
2
|
import { TAB } from '../../lib/constants/components';
|
|
3
3
|
import { AtomixGlass } from '../AtomixGlass/AtomixGlass';
|
|
4
4
|
import { AtomixGlassProps } from '../../lib/types/components';
|
|
@@ -61,7 +61,7 @@ export interface TabsProps {
|
|
|
61
61
|
/**
|
|
62
62
|
* Tabs component for switching between different content panels
|
|
63
63
|
*/
|
|
64
|
-
export const Tabs: React.FC<TabsProps> = ({
|
|
64
|
+
export const Tabs: React.FC<TabsProps> = memo(({
|
|
65
65
|
items,
|
|
66
66
|
activeIndex = TAB.DEFAULTS.ACTIVE_INDEX,
|
|
67
67
|
onTabChange,
|
|
@@ -137,7 +137,7 @@ export const Tabs: React.FC<TabsProps> = ({
|
|
|
137
137
|
}
|
|
138
138
|
|
|
139
139
|
return tabContent;
|
|
140
|
-
};
|
|
140
|
+
});
|
|
141
141
|
|
|
142
142
|
Tabs.displayName = 'Tabs';
|
|
143
143
|
|