@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,23 +1,32 @@
|
|
|
1
1
|
import React from 'react';
|
|
2
|
-
import {
|
|
2
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
3
3
|
import { River } from './River';
|
|
4
|
-
import type { RiverProps } from './River';
|
|
5
4
|
|
|
6
|
-
|
|
5
|
+
const meta = {
|
|
7
6
|
title: 'Components/River',
|
|
8
7
|
component: River,
|
|
8
|
+
parameters: {
|
|
9
|
+
layout: 'fullscreen',
|
|
10
|
+
docs: {
|
|
11
|
+
description: {
|
|
12
|
+
component:
|
|
13
|
+
'The River component provides a flexible two-column layout pattern with an image on one side and content on the other. It supports various alignment options, background images, overlays, and can be reversed or centered. Rivers are ideal for showcasing features, products, or any content requiring side-by-side image and text presentation.',
|
|
14
|
+
},
|
|
15
|
+
},
|
|
16
|
+
},
|
|
17
|
+
tags: ['autodocs'],
|
|
9
18
|
argTypes: {
|
|
10
19
|
center: {
|
|
11
20
|
control: { type: 'boolean' },
|
|
12
|
-
|
|
21
|
+
description: 'Whether to center the content',
|
|
13
22
|
},
|
|
14
23
|
breakout: {
|
|
15
24
|
control: { type: 'boolean' },
|
|
16
|
-
|
|
25
|
+
description: 'Whether to break out of container constraints',
|
|
17
26
|
},
|
|
18
27
|
reverse: {
|
|
19
28
|
control: { type: 'boolean' },
|
|
20
|
-
|
|
29
|
+
description: 'Whether to reverse the image and content positions',
|
|
21
30
|
},
|
|
22
31
|
backgroundImageSrc: {
|
|
23
32
|
control: { type: 'text' },
|
|
@@ -25,7 +34,6 @@ export default {
|
|
|
25
34
|
},
|
|
26
35
|
showOverlay: {
|
|
27
36
|
control: { type: 'boolean' },
|
|
28
|
-
defaultValue: true,
|
|
29
37
|
description: 'Show background overlay',
|
|
30
38
|
},
|
|
31
39
|
contentWidth: {
|
|
@@ -33,145 +41,215 @@ export default {
|
|
|
33
41
|
description: 'Custom width for the river content (e.g., "800px", "50%")',
|
|
34
42
|
},
|
|
35
43
|
},
|
|
36
|
-
}
|
|
44
|
+
} satisfies Meta<typeof River>;
|
|
37
45
|
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
<River {...args} />
|
|
41
|
-
</div>
|
|
42
|
-
);
|
|
46
|
+
export default meta;
|
|
47
|
+
type Story = StoryObj<typeof meta>;
|
|
43
48
|
|
|
44
49
|
// Default river (image left, content right)
|
|
45
|
-
export const Default =
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
<a href="#" className="c-btn c-btn--primary">
|
|
51
|
-
Get Started
|
|
52
|
-
</a>
|
|
50
|
+
export const Default: Story = {
|
|
51
|
+
render: args => (
|
|
52
|
+
<div style={{ padding: '0', maxWidth: '100%' }}>
|
|
53
|
+
<River {...args} />
|
|
54
|
+
</div>
|
|
53
55
|
),
|
|
54
|
-
|
|
55
|
-
|
|
56
|
+
args: {
|
|
57
|
+
title: 'Streamline Your Workflow',
|
|
58
|
+
text: 'Our platform provides a comprehensive suite of tools to optimize your workflow and increase productivity. With intuitive interfaces and powerful features, you can accomplish more in less time.',
|
|
59
|
+
actions: (
|
|
60
|
+
<a href="#" className="c-btn c-btn--primary">
|
|
61
|
+
Get Started
|
|
62
|
+
</a>
|
|
63
|
+
),
|
|
64
|
+
imageSrc: 'https://unsplash.it/g/500/300',
|
|
65
|
+
imageAlt: 'Workflow diagram',
|
|
66
|
+
},
|
|
56
67
|
};
|
|
57
68
|
|
|
58
69
|
// Reverse layout (content left, image right)
|
|
59
|
-
export const Reverse =
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
70
|
+
export const Reverse: Story = {
|
|
71
|
+
render: args => (
|
|
72
|
+
<div style={{ padding: '0', maxWidth: '100%' }}>
|
|
73
|
+
<River {...args} />
|
|
74
|
+
</div>
|
|
75
|
+
),
|
|
76
|
+
args: {
|
|
77
|
+
title: 'Data-Driven Insights',
|
|
78
|
+
text: 'Harness the power of analytics to make informed decisions. Our advanced data visualization tools help you understand trends and identify opportunities for growth.',
|
|
79
|
+
actions: (
|
|
80
|
+
<a href="#" className="c-btn c-btn--primary">
|
|
81
|
+
Get Started
|
|
82
|
+
</a>
|
|
83
|
+
),
|
|
84
|
+
imageSrc: 'https://unsplash.it/g/500/300',
|
|
85
|
+
imageAlt: 'Workflow diagram',
|
|
86
|
+
reverse: true,
|
|
87
|
+
},
|
|
65
88
|
};
|
|
66
89
|
|
|
67
90
|
// Center layout (content centered)
|
|
68
|
-
export const Centered =
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
91
|
+
export const Centered: Story = {
|
|
92
|
+
render: args => (
|
|
93
|
+
<div style={{ padding: '0', maxWidth: '100%' }}>
|
|
94
|
+
<River {...args} />
|
|
95
|
+
</div>
|
|
96
|
+
),
|
|
97
|
+
args: {
|
|
98
|
+
title: 'Award-Winning Support',
|
|
99
|
+
text: 'Our dedicated team of experts is available around the clock to provide assistance and ensure your success. Experience the highest level of customer service.',
|
|
100
|
+
actions: (
|
|
101
|
+
<a href="#" className="c-btn c-btn--primary">
|
|
102
|
+
Get Started
|
|
103
|
+
</a>
|
|
104
|
+
),
|
|
105
|
+
imageSrc: 'https://unsplash.it/g/500/300',
|
|
106
|
+
imageAlt: 'Workflow diagram',
|
|
107
|
+
center: true,
|
|
108
|
+
},
|
|
74
109
|
};
|
|
75
110
|
|
|
76
111
|
// Breakout layout (full width)
|
|
77
|
-
export const Breakout =
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
112
|
+
export const Breakout: Story = {
|
|
113
|
+
render: args => (
|
|
114
|
+
<div style={{ padding: '0', maxWidth: '100%' }}>
|
|
115
|
+
<River {...args} />
|
|
116
|
+
</div>
|
|
117
|
+
),
|
|
118
|
+
args: {
|
|
119
|
+
title: 'Scale With Confidence',
|
|
120
|
+
text: "Our robust infrastructure adapts to your needs, whether you're a small business or a global enterprise. Grow your operations without worrying about technical limitations.",
|
|
121
|
+
actions: (
|
|
122
|
+
<a href="#" className="c-btn c-btn--primary">
|
|
123
|
+
Get Started
|
|
124
|
+
</a>
|
|
125
|
+
),
|
|
126
|
+
imageSrc: 'https://unsplash.it/g/500/300',
|
|
127
|
+
imageAlt: 'Workflow diagram',
|
|
128
|
+
breakout: true,
|
|
129
|
+
},
|
|
83
130
|
};
|
|
84
131
|
|
|
85
132
|
// Multi-paragraph text
|
|
86
|
-
export const MultiParagraph =
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
'Our innovative solutions are designed to transform how you work, making complex tasks simple and intuitive.',
|
|
92
|
-
"By focusing on user experience and practical functionality, we've created tools that adapt to your workflow rather than forcing you to adapt to them.",
|
|
93
|
-
'Experience the difference that thoughtful design and powerful technology can make in your daily operations.',
|
|
94
|
-
],
|
|
95
|
-
actions: (
|
|
96
|
-
<a href="#" className="c-btn c-btn--primary">
|
|
97
|
-
Learn More
|
|
98
|
-
</a>
|
|
133
|
+
export const MultiParagraph: Story = {
|
|
134
|
+
render: args => (
|
|
135
|
+
<div style={{ padding: '0', maxWidth: '100%' }}>
|
|
136
|
+
<River {...args} />
|
|
137
|
+
</div>
|
|
99
138
|
),
|
|
139
|
+
args: {
|
|
140
|
+
title: 'Revolutionize Your Approach',
|
|
141
|
+
text: [
|
|
142
|
+
'Our innovative solutions are designed to transform how you work, making complex tasks simple and intuitive.',
|
|
143
|
+
"By focusing on user experience and practical functionality, we've created tools that adapt to your workflow rather than forcing you to adapt to them.",
|
|
144
|
+
'Experience the difference that thoughtful design and powerful technology can make in your daily operations.',
|
|
145
|
+
],
|
|
146
|
+
actions: (
|
|
147
|
+
<a href="#" className="c-btn c-btn--primary">
|
|
148
|
+
Learn More
|
|
149
|
+
</a>
|
|
150
|
+
),
|
|
151
|
+
imageSrc: 'https://unsplash.it/g/500/300',
|
|
152
|
+
imageAlt: 'Workflow diagram',
|
|
153
|
+
},
|
|
100
154
|
};
|
|
101
155
|
|
|
102
156
|
// Content columns
|
|
103
|
-
export const ContentColumns =
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
content: <h2 className="c-river__title">Flexible Content Layout</h2>,
|
|
109
|
-
},
|
|
110
|
-
{
|
|
111
|
-
type: 'text',
|
|
112
|
-
content: (
|
|
113
|
-
<div>
|
|
114
|
-
<p className="c-river__text">
|
|
115
|
-
Use content columns to create custom layouts with different types of content. This
|
|
116
|
-
approach gives you more control over the structure and presentation of your information.
|
|
117
|
-
</p>
|
|
118
|
-
<p className="c-river__text">
|
|
119
|
-
Perfect for featuring important statistics, quotes, or highlighting key information
|
|
120
|
-
alongside your main content.
|
|
121
|
-
</p>
|
|
122
|
-
</div>
|
|
123
|
-
),
|
|
124
|
-
},
|
|
125
|
-
],
|
|
126
|
-
actions: (
|
|
127
|
-
<a href="#" className="c-btn c-btn--primary">
|
|
128
|
-
Explore Options
|
|
129
|
-
</a>
|
|
157
|
+
export const ContentColumns: Story = {
|
|
158
|
+
render: args => (
|
|
159
|
+
<div style={{ padding: '0', maxWidth: '100%' }}>
|
|
160
|
+
<River {...args} />
|
|
161
|
+
</div>
|
|
130
162
|
),
|
|
131
|
-
|
|
163
|
+
args: {
|
|
164
|
+
contentColumns: [
|
|
165
|
+
{
|
|
166
|
+
type: 'title',
|
|
167
|
+
content: <h2 className="c-river__title">Flexible Content Layout</h2>,
|
|
168
|
+
},
|
|
169
|
+
{
|
|
170
|
+
type: 'text',
|
|
171
|
+
content: (
|
|
172
|
+
<div>
|
|
173
|
+
<p className="c-river__text">
|
|
174
|
+
Use content columns to create custom layouts with different types of content. This
|
|
175
|
+
approach gives you more control over the structure and presentation of your information.
|
|
176
|
+
</p>
|
|
177
|
+
<p className="c-river__text">
|
|
178
|
+
Perfect for featuring important statistics, quotes, or highlighting key information
|
|
179
|
+
alongside your main content.
|
|
180
|
+
</p>
|
|
181
|
+
</div>
|
|
182
|
+
),
|
|
183
|
+
},
|
|
184
|
+
],
|
|
185
|
+
actions: (
|
|
186
|
+
<a href="#" className="c-btn c-btn--primary">
|
|
187
|
+
Explore Options
|
|
188
|
+
</a>
|
|
189
|
+
),
|
|
190
|
+
imageSrc: 'https://unsplash.it/g/500/300',
|
|
191
|
+
},
|
|
132
192
|
};
|
|
133
193
|
|
|
134
194
|
// Custom title styling
|
|
135
|
-
export const CustomTitle =
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
<a href="#" className="c-btn u-pl-0">
|
|
141
|
-
Text Link <i className="icon-lux-circle"></i>
|
|
142
|
-
</a>
|
|
195
|
+
export const CustomTitle: Story = {
|
|
196
|
+
render: args => (
|
|
197
|
+
<div style={{ padding: '0', maxWidth: '100%' }}>
|
|
198
|
+
<River {...args} />
|
|
199
|
+
</div>
|
|
143
200
|
),
|
|
144
|
-
|
|
145
|
-
|
|
201
|
+
args: {
|
|
202
|
+
title: <h1 className="c-river__title u-text-gradient">Custom Title with Gradient</h1>,
|
|
203
|
+
text: 'The sun had set, leaving the sky painted in shades of orange and pink as the stars twinkled above. The air was filled with the sound of crickets and the rustle of leaves in the gentle breeze.',
|
|
204
|
+
actions: (
|
|
205
|
+
<a href="#" className="c-btn u-pl-0">
|
|
206
|
+
Text Link <i className="icon-lux-circle"></i>
|
|
207
|
+
</a>
|
|
208
|
+
),
|
|
209
|
+
imageSrc: 'https://unsplash.it/g/712/196',
|
|
210
|
+
imageAlt: 'Image',
|
|
211
|
+
},
|
|
146
212
|
};
|
|
147
213
|
|
|
148
214
|
// With background image
|
|
149
|
-
export const WithBackgroundAndContent =
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
<a href="#" className="c-btn c-btn--light">
|
|
155
|
-
View Documentation
|
|
156
|
-
</a>
|
|
215
|
+
export const WithBackgroundAndContent: Story = {
|
|
216
|
+
render: args => (
|
|
217
|
+
<div style={{ padding: '0', maxWidth: '100%' }}>
|
|
218
|
+
<River {...args} />
|
|
219
|
+
</div>
|
|
157
220
|
),
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
221
|
+
args: {
|
|
222
|
+
title: 'Build Faster Applications',
|
|
223
|
+
text: 'Our component library is designed for developers who want to create beautiful interfaces with minimal effort. With built-in TypeScript support and comprehensive documentation, you can focus on building features, not fighting with UI.',
|
|
224
|
+
actions: (
|
|
225
|
+
<a href="#" className="c-btn c-btn--light">
|
|
226
|
+
View Documentation
|
|
227
|
+
</a>
|
|
228
|
+
),
|
|
229
|
+
imageSrc: 'https://unsplash.it/g/500/300',
|
|
230
|
+
backgroundImageSrc: 'https://unsplash.it/g/1920/600',
|
|
231
|
+
showOverlay: true,
|
|
232
|
+
},
|
|
161
233
|
};
|
|
162
234
|
|
|
163
235
|
// With custom content width
|
|
164
|
-
export const CustomContentWidth =
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
<a href="#" className="c-btn c-btn--primary">
|
|
170
|
-
Explore API
|
|
171
|
-
</a>
|
|
236
|
+
export const CustomContentWidth: Story = {
|
|
237
|
+
render: args => (
|
|
238
|
+
<div style={{ padding: '0', maxWidth: '100%' }}>
|
|
239
|
+
<River {...args} />
|
|
240
|
+
</div>
|
|
172
241
|
),
|
|
173
|
-
|
|
174
|
-
|
|
242
|
+
args: {
|
|
243
|
+
title: 'Powerful Developer Experience',
|
|
244
|
+
text: 'Our River component gives you complete control over your content layout. Customize content width, background images, and layouts to create engaging sections that convert visitors into customers.',
|
|
245
|
+
actions: (
|
|
246
|
+
<a href="#" className="c-btn c-btn--primary">
|
|
247
|
+
Explore API
|
|
248
|
+
</a>
|
|
249
|
+
),
|
|
250
|
+
imageSrc: 'https://unsplash.it/g/500/300',
|
|
251
|
+
contentWidth: '800px',
|
|
252
|
+
},
|
|
175
253
|
};
|
|
176
254
|
|
|
177
255
|
// Multiple Rivers layout example
|
|
@@ -227,4 +305,6 @@ const MultipeRiversExample: React.FC = () => {
|
|
|
227
305
|
);
|
|
228
306
|
};
|
|
229
307
|
|
|
230
|
-
export const MultipleRivers:
|
|
308
|
+
export const MultipleRivers: Story = {
|
|
309
|
+
render: () => <MultipeRiversExample />,
|
|
310
|
+
};
|
|
@@ -1,36 +1,46 @@
|
|
|
1
|
-
import { Meta, StoryObj } from '@storybook/react';
|
|
1
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
2
|
import { Button } from '../Button';
|
|
3
3
|
import { SectionIntro } from './SectionIntro';
|
|
4
|
+
import { SIZES } from '../../lib/constants/components';
|
|
4
5
|
|
|
5
|
-
const meta
|
|
6
|
+
const meta = {
|
|
6
7
|
title: 'Components/SectionIntro',
|
|
7
8
|
component: SectionIntro,
|
|
8
9
|
parameters: {
|
|
9
10
|
layout: 'padded',
|
|
11
|
+
docs: {
|
|
12
|
+
description: {
|
|
13
|
+
component:
|
|
14
|
+
'The SectionIntro component provides a prominent introduction section for pages or content areas. It supports titles, labels, text content, images, background images, and call-to-action buttons. SectionIntros are ideal for page headers, section introductions, or any area requiring prominent content presentation.',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
10
17
|
},
|
|
18
|
+
tags: ['autodocs'],
|
|
11
19
|
argTypes: {
|
|
12
|
-
title: { control: 'text' },
|
|
13
|
-
label: { control: 'text' },
|
|
14
|
-
text: { control: 'text' },
|
|
20
|
+
title: { control: 'text', description: 'Main title text' },
|
|
21
|
+
label: { control: 'text', description: 'Label text displayed above the title' },
|
|
22
|
+
text: { control: 'text', description: 'Description text content' },
|
|
15
23
|
alignment: {
|
|
16
24
|
control: { type: 'select' },
|
|
17
25
|
options: ['left', 'center', 'right'],
|
|
26
|
+
description: 'Text alignment',
|
|
18
27
|
},
|
|
19
28
|
size: {
|
|
20
29
|
control: { type: 'select' },
|
|
21
|
-
options:
|
|
30
|
+
options: SIZES,
|
|
31
|
+
description: 'Size variant',
|
|
22
32
|
},
|
|
23
33
|
skeleton: { control: 'boolean' },
|
|
24
34
|
showOverlay: { control: 'boolean' },
|
|
25
35
|
actions: { control: false },
|
|
26
36
|
backgroundImageSrc: { control: 'text' },
|
|
27
37
|
imageSrc: { control: 'text' },
|
|
28
|
-
imageAlt: { control: 'text' },
|
|
38
|
+
imageAlt: { control: 'text', description: 'Alt text for the image' },
|
|
29
39
|
},
|
|
30
|
-
}
|
|
40
|
+
} satisfies Meta<typeof SectionIntro>;
|
|
31
41
|
|
|
32
42
|
export default meta;
|
|
33
|
-
type Story = StoryObj<typeof
|
|
43
|
+
type Story = StoryObj<typeof meta>;
|
|
34
44
|
|
|
35
45
|
// Default SectionIntro
|
|
36
46
|
export const Default: Story = {
|
|
@@ -10,7 +10,14 @@ const meta = {
|
|
|
10
10
|
component: Slider,
|
|
11
11
|
parameters: {
|
|
12
12
|
layout: 'padded',
|
|
13
|
+
docs: {
|
|
14
|
+
description: {
|
|
15
|
+
component:
|
|
16
|
+
'The Slider component provides a carousel/slideshow interface for displaying multiple items in a scrollable container. It supports horizontal and vertical orientations, navigation controls, pagination, autoplay, and various transition effects. Sliders are ideal for showcasing images, cards, testimonials, or any collection of content.',
|
|
17
|
+
},
|
|
18
|
+
},
|
|
13
19
|
},
|
|
20
|
+
tags: ['autodocs'],
|
|
14
21
|
argTypes: {
|
|
15
22
|
slides: { control: 'object' },
|
|
16
23
|
slidesToShow: { control: { type: 'number', min: 1, max: 5 } },
|
|
@@ -25,16 +25,9 @@ export const Slider = forwardRef<HTMLDivElement, SliderProps>((props, ref) => {
|
|
|
25
25
|
...rest
|
|
26
26
|
} = props;
|
|
27
27
|
|
|
28
|
-
|
|
29
|
-
return (
|
|
30
|
-
<div className="c-slider c-slider--empty" style={{ height, width, ...style }}>
|
|
31
|
-
<div className="c-slider__empty-message">No slides available</div>
|
|
32
|
-
</div>
|
|
33
|
-
);
|
|
34
|
-
}
|
|
35
|
-
|
|
28
|
+
// Hooks must be called unconditionally - before early return
|
|
36
29
|
const slider = useSlider({
|
|
37
|
-
slides,
|
|
30
|
+
slides: slides || [],
|
|
38
31
|
slidesToShow,
|
|
39
32
|
spaceBetween,
|
|
40
33
|
loop,
|
|
@@ -72,6 +65,14 @@ export const Slider = forwardRef<HTMLDivElement, SliderProps>((props, ref) => {
|
|
|
72
65
|
return allSlides.length * (slideWidth + spaceBetween) - spaceBetween;
|
|
73
66
|
}, [allSlides.length, slideWidth, spaceBetween]);
|
|
74
67
|
|
|
68
|
+
if (!slides || slides.length === 0) {
|
|
69
|
+
return (
|
|
70
|
+
<div className="c-slider c-slider--empty" style={{ height, width, ...style }}>
|
|
71
|
+
<div className="c-slider__empty-message">No slides available</div>
|
|
72
|
+
</div>
|
|
73
|
+
);
|
|
74
|
+
}
|
|
75
|
+
|
|
75
76
|
const containerClasses = [
|
|
76
77
|
'c-slider',
|
|
77
78
|
direction === 'vertical' && 'c-slider--vertical',
|
|
@@ -1,21 +1,30 @@
|
|
|
1
|
+
import React from 'react';
|
|
1
2
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
3
|
import { Spinner } from './Spinner';
|
|
4
|
+
import { THEME_COLORS, SIZES } from '../../lib/constants/components';
|
|
3
5
|
|
|
4
6
|
const meta = {
|
|
5
7
|
title: 'Components/Spinner',
|
|
6
8
|
component: Spinner,
|
|
7
9
|
parameters: {
|
|
8
10
|
layout: 'centered',
|
|
11
|
+
docs: {
|
|
12
|
+
description: {
|
|
13
|
+
component:
|
|
14
|
+
'The Spinner component provides visual feedback during loading states. It displays an animated loading indicator that can be customized with different variants and sizes. Use spinners to indicate that content is being loaded or processed.',
|
|
15
|
+
},
|
|
16
|
+
},
|
|
9
17
|
},
|
|
18
|
+
tags: ['autodocs'],
|
|
10
19
|
argTypes: {
|
|
11
20
|
variant: {
|
|
12
21
|
control: { type: 'select' },
|
|
13
|
-
options:
|
|
22
|
+
options: THEME_COLORS,
|
|
14
23
|
description: 'The color variant of the spinner',
|
|
15
24
|
},
|
|
16
25
|
size: {
|
|
17
26
|
control: { type: 'select' },
|
|
18
|
-
options:
|
|
27
|
+
options: SIZES,
|
|
19
28
|
description: 'The size of the spinner',
|
|
20
29
|
},
|
|
21
30
|
fullscreen: {
|
|
@@ -26,7 +35,7 @@ const meta = {
|
|
|
26
35
|
} satisfies Meta<typeof Spinner>;
|
|
27
36
|
|
|
28
37
|
export default meta;
|
|
29
|
-
type Story = StoryObj<typeof
|
|
38
|
+
type Story = StoryObj<typeof meta>;
|
|
30
39
|
|
|
31
40
|
// Default Spinner
|
|
32
41
|
export const Default: Story = {
|
|
@@ -52,14 +61,9 @@ export const Sizes: Story = {
|
|
|
52
61
|
export const ColorVariants: Story = {
|
|
53
62
|
render: () => (
|
|
54
63
|
<div className="u-d-flex u-flex-wrap u-gap-3 u-align-items-center">
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
<Spinner variant="info" />
|
|
59
|
-
<Spinner variant="warning" />
|
|
60
|
-
<Spinner variant="error" />
|
|
61
|
-
<Spinner variant="light" />
|
|
62
|
-
<Spinner variant="dark" />
|
|
64
|
+
{THEME_COLORS.map(color => (
|
|
65
|
+
<Spinner key={color} variant={color} />
|
|
66
|
+
))}
|
|
63
67
|
</div>
|
|
64
68
|
),
|
|
65
69
|
};
|
|
@@ -1,10 +1,10 @@
|
|
|
1
|
-
import React from 'react';
|
|
1
|
+
import React, { memo } from 'react';
|
|
2
2
|
import { SpinnerProps } from '../../lib/types/components';
|
|
3
3
|
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> = ({
|
|
7
|
+
export const Spinner: React.FC<SpinnerProps> = memo(({
|
|
8
8
|
size = 'md',
|
|
9
9
|
variant = 'primary',
|
|
10
10
|
fullscreen = false,
|
|
@@ -43,7 +43,7 @@ export const Spinner: React.FC<SpinnerProps> = ({
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
return spinnerContent;
|
|
46
|
-
};
|
|
46
|
+
});
|
|
47
47
|
|
|
48
48
|
export type { SpinnerProps };
|
|
49
49
|
|