@shohojdhara/atomix 0.3.14 → 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/CHANGELOG.md +20 -0
- package/build-tools/EXAMPLES.md +372 -0
- package/build-tools/README.md +242 -0
- package/build-tools/__tests__/error-handler.test.js +230 -0
- package/build-tools/__tests__/index.test.js +141 -0
- package/build-tools/__tests__/rollup-plugin.test.js +194 -0
- package/build-tools/__tests__/utils.test.js +161 -0
- package/build-tools/__tests__/vite-plugin.test.js +129 -0
- package/build-tools/__tests__/webpack-loader.test.js +190 -0
- package/build-tools/error-handler.js +308 -0
- package/build-tools/index.d.ts +44 -0
- package/build-tools/index.js +88 -0
- package/build-tools/package.json +50 -0
- package/build-tools/rollup-plugin.js +236 -0
- package/build-tools/types.d.ts +163 -0
- package/build-tools/utils.js +203 -0
- package/build-tools/vite-plugin.js +161 -0
- package/build-tools/webpack-loader.js +123 -0
- package/dist/atomix.css +21044 -2618
- package/dist/atomix.css.map +1 -1
- package/dist/atomix.min.css +77 -3
- package/dist/atomix.min.css.map +1 -1
- package/dist/build-tools/EXAMPLES.md +372 -0
- package/dist/build-tools/README.md +242 -0
- package/dist/build-tools/__tests__/error-handler.test.js +230 -0
- package/dist/build-tools/__tests__/index.test.js +141 -0
- package/dist/build-tools/__tests__/rollup-plugin.test.js +194 -0
- package/dist/build-tools/__tests__/utils.test.js +161 -0
- package/dist/build-tools/__tests__/vite-plugin.test.js +129 -0
- package/dist/build-tools/__tests__/webpack-loader.test.js +190 -0
- package/dist/build-tools/error-handler.js +308 -0
- package/dist/build-tools/index.d.ts +44 -0
- package/dist/build-tools/index.js +88 -0
- package/dist/build-tools/package.json +50 -0
- package/dist/build-tools/rollup-plugin.js +236 -0
- package/dist/build-tools/types.d.ts +163 -0
- package/dist/build-tools/utils.js +203 -0
- package/dist/build-tools/vite-plugin.js +161 -0
- package/dist/build-tools/webpack-loader.js +123 -0
- package/dist/charts.d.ts +1 -1
- package/dist/charts.js +86 -57
- package/dist/charts.js.map +1 -1
- package/dist/core.d.ts +1 -1
- package/dist/core.js +136 -112
- package/dist/core.js.map +1 -1
- package/dist/forms.d.ts +2 -5
- package/dist/forms.js +140 -128
- package/dist/forms.js.map +1 -1
- package/dist/heavy.d.ts +1 -1
- package/dist/heavy.js +136 -112
- package/dist/heavy.js.map +1 -1
- package/dist/index.d.ts +152 -78
- package/dist/index.esm.js +346 -340
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +359 -353
- 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 +23 -8
- package/scripts/atomix-cli.js +170 -73
- package/scripts/cli/__tests__/README.md +81 -0
- package/scripts/cli/__tests__/basic.test.js +115 -0
- package/scripts/cli/__tests__/component-generator.test.js +332 -0
- package/scripts/cli/__tests__/integration.test.js +327 -0
- package/scripts/cli/__tests__/test-setup.js +133 -0
- package/scripts/cli/__tests__/token-manager.test.js +251 -0
- package/scripts/cli/__tests__/utils.test.js +161 -0
- package/scripts/cli/component-generator.js +253 -299
- package/scripts/cli/dependency-checker.js +355 -0
- package/scripts/cli/interactive-init.js +46 -5
- package/scripts/cli/template-manager.js +0 -2
- package/scripts/cli/templates/common-templates.js +636 -0
- package/scripts/cli/templates/composable-templates.js +148 -126
- package/scripts/cli/templates/index.js +23 -16
- package/scripts/cli/templates/project-templates.js +151 -23
- package/scripts/cli/templates/react-templates.js +280 -210
- package/scripts/cli/templates/scss-templates.js +90 -91
- package/scripts/cli/templates/testing-templates.js +206 -27
- package/scripts/cli/templates/testing-utils.js +278 -0
- package/scripts/cli/templates/types-templates.js +70 -56
- package/scripts/cli/theme-bridge.js +8 -2
- package/scripts/cli/token-manager.js +318 -206
- package/scripts/cli/utils.js +0 -1
- package/src/components/Accordion/Accordion.stories.tsx +358 -850
- 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/AtomixGlass.tsx +80 -39
- package/src/components/AtomixGlass/AtomixGlassContainer.tsx +103 -81
- package/src/components/AtomixGlass/GlassFilter.tsx +9 -16
- package/src/components/AtomixGlass/__snapshots__/AtomixGlass.test.tsx.snap +8 -7
- package/src/components/AtomixGlass/glass-utils.ts +6 -5
- package/src/components/AtomixGlass/shader-utils.ts +133 -52
- package/src/components/AtomixGlass/stories/Customization.stories.tsx +131 -0
- package/src/components/AtomixGlass/stories/Examples.stories.tsx +2957 -2853
- package/src/components/AtomixGlass/stories/Modes.stories.tsx +1 -1
- package/src/components/AtomixGlass/stories/Overview.stories.tsx +348 -0
- package/src/components/AtomixGlass/stories/Performance.stories.tsx +103 -0
- package/src/components/AtomixGlass/stories/Playground.stories.tsx +51 -36
- package/src/components/AtomixGlass/stories/{ShaderVariants.stories.tsx → Shaders.stories.tsx} +2 -2
- package/src/components/AtomixGlass/stories/shared-components.tsx +90 -190
- package/src/components/Avatar/Avatar.stories.tsx +195 -0
- package/src/components/Avatar/Avatar.tsx +58 -56
- package/src/components/Badge/Badge.stories.tsx +122 -352
- package/src/components/Badge/Badge.test.tsx +41 -41
- package/src/components/Badge/Badge.tsx +64 -62
- package/src/components/Block/Block.stories.tsx +30 -11
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +142 -23
- package/src/components/Breadcrumb/Breadcrumb.tsx +62 -60
- package/src/components/Button/Button.stories.tsx +454 -1126
- package/src/components/Button/Button.test.tsx +123 -0
- package/src/components/Button/Button.tsx +88 -60
- package/src/components/Button/ButtonGroup.stories.tsx +376 -215
- package/src/components/Button/ButtonGroup.tsx +4 -15
- package/src/components/Callout/Callout.stories.tsx +316 -568
- package/src/components/Card/Card.stories.tsx +292 -81
- 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 +153 -16
- 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 +152 -66
- package/src/components/ColorModeToggle/ColorModeToggle.tsx +15 -3
- package/src/components/Countdown/Countdown.stories.tsx +114 -7
- package/src/components/DataTable/DataTable.stories.tsx +349 -144
- package/src/components/DataTable/DataTable.test.tsx +26 -148
- package/src/components/DataTable/DataTable.tsx +485 -456
- package/src/components/DatePicker/DatePicker.stories.tsx +310 -1066
- package/src/components/DatePicker/DatePicker.tsx +31 -26
- package/src/components/Dropdown/Dropdown.stories.tsx +153 -36
- package/src/components/Dropdown/Dropdown.tsx +313 -299
- package/src/components/EdgePanel/EdgePanel.stories.tsx +221 -25
- package/src/components/EdgePanel/EdgePanel.tsx +1 -3
- package/src/components/Footer/Footer.stories.tsx +396 -327
- package/src/components/Footer/Footer.tsx +130 -128
- package/src/components/Footer/FooterLink.tsx +2 -2
- package/src/components/Form/Checkbox.stories.tsx +140 -6
- package/src/components/Form/Checkbox.test.tsx +63 -0
- package/src/components/Form/Checkbox.tsx +122 -78
- package/src/components/Form/Form.stories.tsx +110 -19
- package/src/components/Form/FormGroup.stories.tsx +127 -4
- 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 +146 -17
- package/src/components/Form/Radio.tsx +68 -66
- package/src/components/Form/Select.stories.tsx +140 -8
- package/src/components/Form/Select.tsx +184 -182
- package/src/components/Form/Textarea.stories.tsx +149 -6
- package/src/components/Form/Textarea.test.tsx +27 -32
- package/src/components/Hero/Hero.stories.tsx +372 -38
- package/src/components/Hero/Hero.tsx +201 -55
- package/src/components/Icon/index.ts +7 -1
- package/src/components/List/List.stories.tsx +141 -3
- package/src/components/List/List.tsx +19 -23
- package/src/components/Modal/Modal.stories.tsx +183 -43
- 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 +354 -97
- package/src/components/Popover/Popover.tsx +41 -37
- package/src/components/Progress/Progress.stories.tsx +160 -7
- package/src/components/River/River.stories.tsx +3 -2
- package/src/components/SectionIntro/SectionIntro.stories.tsx +239 -47
- package/src/components/Slider/Slider.stories.tsx +12 -4
- package/src/components/Spinner/Spinner.stories.tsx +104 -8
- package/src/components/Spinner/Spinner.test.tsx +23 -23
- package/src/components/Spinner/Spinner.tsx +43 -46
- package/src/components/Steps/Steps.stories.tsx +173 -42
- package/src/components/Tabs/Tabs.stories.tsx +141 -12
- package/src/components/Tabs/Tabs.tsx +74 -72
- package/src/components/Testimonial/Testimonial.stories.tsx +120 -3
- package/src/components/Todo/Todo.stories.tsx +198 -9
- package/src/components/Toggle/Toggle.stories.tsx +137 -36
- package/src/components/Toggle/Toggle.test.tsx +65 -70
- package/src/components/Toggle/Toggle.tsx +4 -1
- package/src/components/Tooltip/Tooltip.stories.tsx +194 -100
- package/src/components/Tooltip/Tooltip.tsx +104 -106
- package/src/components/Upload/Upload.stories.tsx +241 -150
- 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/README.md +2 -2
- package/src/lib/__tests__/theme-tools.test.ts +219 -0
- package/src/lib/composables/index.ts +2 -2
- package/src/lib/composables/shared-mouse-tracker.ts +13 -14
- package/src/lib/composables/useAtomixGlass.ts +126 -97
- package/src/lib/composables/useChartExport.ts +3 -8
- package/src/lib/composables/useDataTable.ts +72 -43
- 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/components.ts +9 -32
- 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 +107 -105
- 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 +45 -0
- package/src/lib/utils/componentUtils.ts +8 -12
- package/src/lib/utils/csv.ts +19 -0
- package/src/lib/utils/dataTableExport.ts +2 -15
- 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 +1 -1
- package/src/styles/01-settings/_settings.accordion.scss +28 -7
- package/src/styles/01-settings/_settings.colors.scss +11 -11
- package/src/styles/01-settings/_settings.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 +4 -4
- package/src/styles/02-tools/_tools.button.scss +51 -21
- package/src/styles/02-tools/_tools.utility-api.scss +38 -12
- package/src/styles/03-generic/_generic.root.scss +4 -3
- package/src/styles/06-components/_components.accordion.scss +56 -14
- 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 +25 -17
- 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/_index.scss +2 -0
- 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 +2 -0
- 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 +45 -0
- package/src/styles/99-utilities/_utilities.text.scss +67 -46
- package/themes/dark-complementary/README.md +98 -0
- package/themes/dark-complementary/index.scss +158 -0
- package/themes/default-light/README.md +81 -0
- package/themes/default-light/index.scss +154 -0
- package/themes/high-contrast/README.md +105 -0
- package/themes/high-contrast/index.scss +172 -0
- package/themes/test-theme/README.md +38 -0
- package/themes/test-theme/index.scss +47 -0
- package/scripts/cli/templates-original-backup.js +0 -1655
- package/scripts/cli/templates_backup.js +0 -684
- package/src/components/AtomixGlass/stories/AtomixGlass.stories.tsx +0 -1438
- package/src/lib/composables/useButton.ts +0 -93
- package/src/lib/composables/useCheckbox.ts +0 -70
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import type { Meta, StoryObj } from '@storybook/react';
|
|
2
|
+
import { fn } from '@storybook/test';
|
|
2
3
|
import { HERO } from '../../lib/constants/components';
|
|
3
4
|
import { Button } from '../Button/Button';
|
|
4
|
-
import { Hero } from './Hero';
|
|
5
|
+
import { Hero, HeroProps } from './Hero';
|
|
5
6
|
|
|
6
7
|
// Extract class names without the leading dots
|
|
7
8
|
const HERO_CLASS = HERO.SELECTORS.HERO.replace('.', '');
|
|
@@ -22,15 +23,114 @@ const RIGHT_CLASS = HERO.CLASSES.RIGHT;
|
|
|
22
23
|
const LEFT_CLASS = HERO.CLASSES.LEFT;
|
|
23
24
|
const FULL_VH_CLASS = HERO.CLASSES.FULL_VH;
|
|
24
25
|
|
|
25
|
-
|
|
26
|
+
// Define missing variables
|
|
27
|
+
const demoText =
|
|
28
|
+
'Our design system helps you build beautiful, consistent, and accessible user interfaces faster than ever before. With a carefully crafted collection of components and guidelines, you can easily create stunning UIs that stand out.';
|
|
29
|
+
|
|
30
|
+
const showcaseText =
|
|
31
|
+
'This is an example of showcase text demonstrating the capabilities of the Atomix design system. Create beautiful interfaces with ease and consistency.';
|
|
32
|
+
|
|
33
|
+
const primaryActionButtons = (
|
|
34
|
+
<>
|
|
35
|
+
<Button variant="primary" size="lg" className="u-mr-3" onClick={fn()}>
|
|
36
|
+
Get Started
|
|
37
|
+
</Button>
|
|
38
|
+
<Button variant="secondary" size="lg" onClick={fn()}>
|
|
39
|
+
Learn More
|
|
40
|
+
</Button>
|
|
41
|
+
</>
|
|
42
|
+
);
|
|
43
|
+
|
|
44
|
+
const showcaseActionButtons = (
|
|
45
|
+
<>
|
|
46
|
+
<Button variant="primary" size="lg" className="u-mr-3" onClick={fn()}>
|
|
47
|
+
View Demo
|
|
48
|
+
</Button>
|
|
49
|
+
<Button variant="outline" size="lg" onClick={fn()}>
|
|
50
|
+
Contact Us
|
|
51
|
+
</Button>
|
|
52
|
+
</>
|
|
53
|
+
);
|
|
54
|
+
|
|
55
|
+
const meta: Meta<HeroProps> = {
|
|
26
56
|
title: 'Components/Hero',
|
|
27
57
|
component: Hero,
|
|
28
58
|
parameters: {
|
|
29
59
|
layout: 'padded',
|
|
30
60
|
docs: {
|
|
31
61
|
description: {
|
|
32
|
-
component:
|
|
33
|
-
|
|
62
|
+
component: `
|
|
63
|
+
# Hero
|
|
64
|
+
|
|
65
|
+
## Overview
|
|
66
|
+
|
|
67
|
+
Hero creates prominent banner sections typically used at the top of pages. It provides a flexible layout for titles, subtitles, text content, call-to-action buttons, and images. Heroes are ideal for landing pages, marketing sections, or any area requiring prominent visual presentation.
|
|
68
|
+
|
|
69
|
+
## Features
|
|
70
|
+
|
|
71
|
+
- Flexible content layout
|
|
72
|
+
- Customizable alignment (left, center, right)
|
|
73
|
+
- Background image support
|
|
74
|
+
- Overlay options
|
|
75
|
+
- Full viewport height option
|
|
76
|
+
- Parallax effect
|
|
77
|
+
- Video background support
|
|
78
|
+
- Responsive design
|
|
79
|
+
- Customizable column sizing
|
|
80
|
+
- Content width control
|
|
81
|
+
|
|
82
|
+
## Accessibility
|
|
83
|
+
|
|
84
|
+
- Screen reader: Title and content announced properly
|
|
85
|
+
- ARIA support: Proper roles and properties for hero components
|
|
86
|
+
- Keyboard support: Accessible via keyboard navigation
|
|
87
|
+
- Focus management: Maintains focus on interactive elements
|
|
88
|
+
|
|
89
|
+
## Usage Examples
|
|
90
|
+
|
|
91
|
+
### Basic Usage
|
|
92
|
+
|
|
93
|
+
\`\`\`tsx
|
|
94
|
+
<Hero
|
|
95
|
+
title="Hero Title"
|
|
96
|
+
subtitle="Hero Subtitle"
|
|
97
|
+
text="Hero text content"
|
|
98
|
+
/>
|
|
99
|
+
\`\`\`
|
|
100
|
+
|
|
101
|
+
### With Image
|
|
102
|
+
|
|
103
|
+
\`\`\`tsx
|
|
104
|
+
<Hero
|
|
105
|
+
title="Hero Title"
|
|
106
|
+
text="Hero text content"
|
|
107
|
+
imageSrc="/path/to/image.jpg"
|
|
108
|
+
imageAlt="Description of image"
|
|
109
|
+
/>
|
|
110
|
+
\`\`\`
|
|
111
|
+
|
|
112
|
+
## API Reference
|
|
113
|
+
|
|
114
|
+
### Props
|
|
115
|
+
|
|
116
|
+
| Prop | Type | Default | Description |
|
|
117
|
+
| ---- | ---- | ------- | ----------- |
|
|
118
|
+
| title | string | - | Hero title |
|
|
119
|
+
| subtitle | string | - | Hero subtitle |
|
|
120
|
+
| text | string | - | Hero text content |
|
|
121
|
+
| imageSrc | string | - | Image source URL |
|
|
122
|
+
| imageAlt | string | - | Image alt text |
|
|
123
|
+
| alignment | 'left' \\| 'center' \\| 'right' | 'left' | Content alignment |
|
|
124
|
+
| backgroundImageSrc | string | - | Background image source URL |
|
|
125
|
+
| showOverlay | boolean | false | Show background overlay |
|
|
126
|
+
| fullViewportHeight | boolean | false | Make hero full viewport height |
|
|
127
|
+
| imageColSize | number | 6 | Image column size (1-12) |
|
|
128
|
+
| contentColSize | number | 6 | Content column size (1-12) |
|
|
129
|
+
| contentWidth | string | '536px' | Custom width for the hero content |
|
|
130
|
+
| parallax | boolean | false | Enable parallax effect on background image |
|
|
131
|
+
| parallaxIntensity | number | 0.5 | Parallax effect intensity (0-1) |
|
|
132
|
+
| videoBackground | string | - | Video background URL |
|
|
133
|
+
`,
|
|
34
134
|
},
|
|
35
135
|
},
|
|
36
136
|
},
|
|
@@ -39,104 +139,213 @@ const meta = {
|
|
|
39
139
|
title: {
|
|
40
140
|
control: 'text',
|
|
41
141
|
description: 'Hero title',
|
|
142
|
+
table: {
|
|
143
|
+
type: { summary: 'string' },
|
|
144
|
+
defaultValue: { summary: '-' },
|
|
145
|
+
},
|
|
42
146
|
},
|
|
43
147
|
subtitle: {
|
|
44
148
|
control: 'text',
|
|
45
149
|
description: 'Hero subtitle',
|
|
150
|
+
table: {
|
|
151
|
+
type: { summary: 'string' },
|
|
152
|
+
defaultValue: { summary: '-' },
|
|
153
|
+
},
|
|
46
154
|
},
|
|
47
155
|
text: {
|
|
48
156
|
control: 'text',
|
|
49
157
|
description: 'Hero text content',
|
|
158
|
+
table: {
|
|
159
|
+
type: { summary: 'string' },
|
|
160
|
+
defaultValue: { summary: '-' },
|
|
161
|
+
},
|
|
50
162
|
},
|
|
51
163
|
imageSrc: {
|
|
52
164
|
control: 'text',
|
|
53
165
|
description: 'Image source URL',
|
|
166
|
+
table: {
|
|
167
|
+
type: { summary: 'string' },
|
|
168
|
+
defaultValue: { summary: '-' },
|
|
169
|
+
},
|
|
54
170
|
},
|
|
55
171
|
imageAlt: {
|
|
56
172
|
control: 'text',
|
|
57
173
|
description: 'Image alt text',
|
|
174
|
+
table: {
|
|
175
|
+
type: { summary: 'string' },
|
|
176
|
+
defaultValue: { summary: '-' },
|
|
177
|
+
},
|
|
58
178
|
},
|
|
59
179
|
alignment: {
|
|
60
180
|
control: { type: 'select', options: ['left', 'center', 'right'] },
|
|
61
181
|
description: 'Content alignment',
|
|
182
|
+
table: {
|
|
183
|
+
type: { summary: '"left" | "center" | "right"' },
|
|
184
|
+
defaultValue: { summary: 'left' },
|
|
185
|
+
},
|
|
62
186
|
},
|
|
63
187
|
backgroundImageSrc: {
|
|
64
188
|
control: 'text',
|
|
65
189
|
description: 'Background image source URL',
|
|
190
|
+
table: {
|
|
191
|
+
type: { summary: 'string' },
|
|
192
|
+
defaultValue: { summary: '-' },
|
|
193
|
+
},
|
|
66
194
|
},
|
|
67
195
|
showOverlay: {
|
|
68
196
|
control: 'boolean',
|
|
69
197
|
description: 'Show background overlay',
|
|
198
|
+
table: {
|
|
199
|
+
type: { summary: 'boolean' },
|
|
200
|
+
defaultValue: { summary: 'false' },
|
|
201
|
+
},
|
|
70
202
|
},
|
|
71
203
|
fullViewportHeight: {
|
|
72
204
|
control: 'boolean',
|
|
73
205
|
description: 'Make hero full viewport height',
|
|
206
|
+
table: {
|
|
207
|
+
type: { summary: 'boolean' },
|
|
208
|
+
defaultValue: { summary: 'false' },
|
|
209
|
+
},
|
|
74
210
|
},
|
|
75
211
|
imageColSize: {
|
|
76
212
|
control: { type: 'range', min: 1, max: 12, step: 1 },
|
|
77
213
|
description: 'Image column size (1-12)',
|
|
214
|
+
table: {
|
|
215
|
+
type: { summary: 'number' },
|
|
216
|
+
defaultValue: { summary: '6' },
|
|
217
|
+
},
|
|
78
218
|
},
|
|
79
219
|
contentColSize: {
|
|
80
220
|
control: { type: 'range', min: 1, max: 12, step: 1 },
|
|
81
221
|
description: 'Content column size (1-12)',
|
|
222
|
+
table: {
|
|
223
|
+
type: { summary: 'number' },
|
|
224
|
+
defaultValue: { summary: '6' },
|
|
225
|
+
},
|
|
82
226
|
},
|
|
83
227
|
contentWidth: {
|
|
84
228
|
control: 'text',
|
|
85
229
|
description: 'Custom width for the hero content (e.g., "800px", "50%")',
|
|
86
230
|
table: {
|
|
231
|
+
type: { summary: 'string' },
|
|
87
232
|
defaultValue: { summary: '536px' },
|
|
88
233
|
},
|
|
89
234
|
},
|
|
90
235
|
parallax: {
|
|
91
236
|
control: 'boolean',
|
|
92
237
|
description: 'Enable parallax effect on background image',
|
|
238
|
+
table: {
|
|
239
|
+
type: { summary: 'boolean' },
|
|
240
|
+
defaultValue: { summary: 'false' },
|
|
241
|
+
},
|
|
93
242
|
},
|
|
94
243
|
parallaxIntensity: {
|
|
95
244
|
control: { type: 'range', min: 0, max: 1, step: 0.1 },
|
|
96
245
|
description: 'Parallax effect intensity (0-1)',
|
|
246
|
+
table: {
|
|
247
|
+
type: { summary: 'number' },
|
|
248
|
+
defaultValue: { summary: '0.5' },
|
|
249
|
+
},
|
|
97
250
|
},
|
|
98
251
|
videoBackground: {
|
|
99
252
|
control: 'text',
|
|
100
253
|
description: 'Video background URL',
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
},
|
|
106
|
-
videoOptions: {
|
|
107
|
-
control: 'object',
|
|
108
|
-
description: 'Video background options',
|
|
109
|
-
},
|
|
110
|
-
backgroundSlider: {
|
|
111
|
-
control: 'object',
|
|
112
|
-
description: 'Background slider configuration with multiple images/videos',
|
|
254
|
+
table: {
|
|
255
|
+
type: { summary: 'string' },
|
|
256
|
+
defaultValue: { summary: '-' },
|
|
257
|
+
},
|
|
113
258
|
},
|
|
114
259
|
},
|
|
115
|
-
} satisfies Meta<
|
|
260
|
+
} satisfies Meta<HeroProps>;
|
|
116
261
|
|
|
117
262
|
export default meta;
|
|
118
|
-
type Story = StoryObj<
|
|
263
|
+
type Story = StoryObj<HeroProps>;
|
|
119
264
|
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
265
|
+
export const BasicUsage: Story = {
|
|
266
|
+
args: {
|
|
267
|
+
title: 'Discover Amazing Things',
|
|
268
|
+
subtitle: 'With Atomix Design System',
|
|
269
|
+
text: 'Our design system helps you build beautiful, consistent, and accessible user interfaces faster than ever before.',
|
|
270
|
+
alignment: 'center',
|
|
271
|
+
fullViewportHeight: true,
|
|
272
|
+
},
|
|
273
|
+
parameters: {
|
|
274
|
+
docs: {
|
|
275
|
+
description: {
|
|
276
|
+
story: 'Basic hero section with centered content and full viewport height.',
|
|
277
|
+
},
|
|
278
|
+
},
|
|
279
|
+
},
|
|
280
|
+
};
|
|
127
281
|
|
|
128
|
-
const
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
282
|
+
export const WithImage: Story = {
|
|
283
|
+
args: {
|
|
284
|
+
title: 'Beautiful Interfaces',
|
|
285
|
+
subtitle: 'Crafted with Atomix',
|
|
286
|
+
text: 'Create stunning user experiences with our carefully designed components and guidelines.',
|
|
287
|
+
imageSrc:
|
|
288
|
+
'https://images.unsplash.com/photo-1517245386807-bb43f82c33c4?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1170&q=80',
|
|
289
|
+
imageAlt: 'Laptop with design interface',
|
|
290
|
+
alignment: 'left',
|
|
291
|
+
fullViewportHeight: false,
|
|
292
|
+
},
|
|
293
|
+
parameters: {
|
|
294
|
+
docs: {
|
|
295
|
+
description: {
|
|
296
|
+
story: 'Hero section with accompanying image on the side.',
|
|
297
|
+
},
|
|
298
|
+
},
|
|
299
|
+
},
|
|
300
|
+
};
|
|
134
301
|
|
|
135
|
-
const
|
|
136
|
-
|
|
302
|
+
export const WithBackgroundImage: Story = {
|
|
303
|
+
args: {
|
|
304
|
+
title: 'Adventure Awaits',
|
|
305
|
+
subtitle: 'Begin Your Journey',
|
|
306
|
+
text: 'Explore new possibilities and create amazing products with our design system.',
|
|
307
|
+
backgroundImageSrc:
|
|
308
|
+
'https://images.unsplash.com/photo-1506744038136-46273834b3fb?ixlib=rb-4.0.3&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&w=1170&q=80',
|
|
309
|
+
showOverlay: true,
|
|
310
|
+
alignment: 'center',
|
|
311
|
+
fullViewportHeight: true,
|
|
312
|
+
},
|
|
313
|
+
parameters: {
|
|
314
|
+
docs: {
|
|
315
|
+
description: {
|
|
316
|
+
story: 'Hero section with background image and overlay.',
|
|
317
|
+
},
|
|
318
|
+
},
|
|
319
|
+
},
|
|
320
|
+
};
|
|
137
321
|
|
|
138
|
-
const
|
|
139
|
-
|
|
322
|
+
export const WithActions: Story = {
|
|
323
|
+
render: args => (
|
|
324
|
+
<Hero {...args}>
|
|
325
|
+
<div className={ACTIONS_CLASS}>
|
|
326
|
+
<Button variant="primary" size="lg" className="u-mr-3">
|
|
327
|
+
Get Started
|
|
328
|
+
</Button>
|
|
329
|
+
<Button variant="secondary" size="lg">
|
|
330
|
+
Learn More
|
|
331
|
+
</Button>
|
|
332
|
+
</div>
|
|
333
|
+
</Hero>
|
|
334
|
+
),
|
|
335
|
+
args: {
|
|
336
|
+
title: 'Ready to Get Started?',
|
|
337
|
+
text: 'Join thousands of satisfied users who have transformed their design workflow.',
|
|
338
|
+
alignment: 'center',
|
|
339
|
+
fullViewportHeight: true,
|
|
340
|
+
},
|
|
341
|
+
parameters: {
|
|
342
|
+
docs: {
|
|
343
|
+
description: {
|
|
344
|
+
story: 'Hero section with call-to-action buttons.',
|
|
345
|
+
},
|
|
346
|
+
},
|
|
347
|
+
},
|
|
348
|
+
};
|
|
140
349
|
|
|
141
350
|
/**
|
|
142
351
|
* Default Hero component with right-aligned content and image
|
|
@@ -190,8 +399,6 @@ export const WithCustomGlassEffect: Story = {
|
|
|
190
399
|
cornerRadius: 45,
|
|
191
400
|
mode: 'standard',
|
|
192
401
|
elasticity: 0.2,
|
|
193
|
-
showBorderEffects: true,
|
|
194
|
-
showHoverEffects: true,
|
|
195
402
|
onClick: () => {
|
|
196
403
|
console.log('Clicked!');
|
|
197
404
|
},
|
|
@@ -229,7 +436,7 @@ export const CenterAligned: Story = {
|
|
|
229
436
|
/**
|
|
230
437
|
* Hero with background image
|
|
231
438
|
*/
|
|
232
|
-
export const
|
|
439
|
+
export const UniqueWithBackgroundImage: Story = {
|
|
233
440
|
args: {
|
|
234
441
|
...Default.args,
|
|
235
442
|
title: 'Powerful Design System',
|
|
@@ -649,3 +856,130 @@ export const FullHeightSlider: Story = {
|
|
|
649
856
|
},
|
|
650
857
|
},
|
|
651
858
|
};
|
|
859
|
+
|
|
860
|
+
// Enhanced preview examples showcasing the most impressive capabilities
|
|
861
|
+
/**
|
|
862
|
+
* Premium showcase combining multiple advanced features
|
|
863
|
+
*/
|
|
864
|
+
export const PremiumShowcase: Story = {
|
|
865
|
+
args: {
|
|
866
|
+
title: 'Premium Hero Experience',
|
|
867
|
+
subtitle: 'Advanced Capabilities Combined',
|
|
868
|
+
text: 'This hero combines multiple advanced features: glass effect, background slider with videos, full viewport height, and interactive elements for a premium user experience.',
|
|
869
|
+
alignment: 'center',
|
|
870
|
+
showOverlay: true,
|
|
871
|
+
fullViewportHeight: true,
|
|
872
|
+
glass: {
|
|
873
|
+
displacementScale: 50,
|
|
874
|
+
blurAmount: 2,
|
|
875
|
+
saturation: 150,
|
|
876
|
+
aberrationIntensity: 0.5,
|
|
877
|
+
cornerRadius: 20,
|
|
878
|
+
overLight: true,
|
|
879
|
+
mode: 'standard',
|
|
880
|
+
},
|
|
881
|
+
actions: (
|
|
882
|
+
<>
|
|
883
|
+
<Button variant="primary" size="lg" className="u-mr-3" onClick={fn()}>
|
|
884
|
+
Explore Features
|
|
885
|
+
</Button>
|
|
886
|
+
<Button variant="secondary" size="lg" onClick={fn()}>
|
|
887
|
+
Get Started Now
|
|
888
|
+
</Button>
|
|
889
|
+
</>
|
|
890
|
+
),
|
|
891
|
+
contentWidth: '900px',
|
|
892
|
+
backgroundSlider: {
|
|
893
|
+
slides: [
|
|
894
|
+
{
|
|
895
|
+
type: 'video',
|
|
896
|
+
src: 'https://cdn.pixabay.com/video/2023/08/17/173860-844114591_large.mp4',
|
|
897
|
+
videoOptions: {
|
|
898
|
+
autoplay: true,
|
|
899
|
+
loop: true,
|
|
900
|
+
muted: true,
|
|
901
|
+
posterUrl: 'https://picsum.photos/id/1015/1920/1080',
|
|
902
|
+
},
|
|
903
|
+
},
|
|
904
|
+
{
|
|
905
|
+
type: 'image',
|
|
906
|
+
src: 'https://picsum.photos/id/1018/1920/1080',
|
|
907
|
+
alt: 'Stunning landscape',
|
|
908
|
+
},
|
|
909
|
+
{
|
|
910
|
+
type: 'video',
|
|
911
|
+
src: 'https://cdn.pixabay.com/video/2023/11/18/189639-886016299_large.mp4',
|
|
912
|
+
videoOptions: {
|
|
913
|
+
autoplay: true,
|
|
914
|
+
loop: true,
|
|
915
|
+
muted: true,
|
|
916
|
+
posterUrl: 'https://picsum.photos/id/1025/1920/1080',
|
|
917
|
+
},
|
|
918
|
+
},
|
|
919
|
+
],
|
|
920
|
+
autoplay: {
|
|
921
|
+
delay: 6000,
|
|
922
|
+
pauseOnHover: true,
|
|
923
|
+
},
|
|
924
|
+
loop: true,
|
|
925
|
+
transition: 'slide',
|
|
926
|
+
transitionDuration: 2000,
|
|
927
|
+
},
|
|
928
|
+
},
|
|
929
|
+
parameters: {
|
|
930
|
+
docs: {
|
|
931
|
+
description: {
|
|
932
|
+
story:
|
|
933
|
+
'Premium showcase combining multiple advanced features: glass effect, background slider with videos, full viewport height, and interactive elements.',
|
|
934
|
+
},
|
|
935
|
+
},
|
|
936
|
+
},
|
|
937
|
+
};
|
|
938
|
+
|
|
939
|
+
/**
|
|
940
|
+
* Minimalist design focusing on typography and content
|
|
941
|
+
*/
|
|
942
|
+
export const MinimalistDesign: Story = {
|
|
943
|
+
args: {
|
|
944
|
+
title: 'Focus on What Matters',
|
|
945
|
+
subtitle: 'Clean & Minimal Approach',
|
|
946
|
+
text: 'Sometimes simplicity speaks louder than complexity. This minimalist hero focuses purely on your content with subtle animations and refined typography.',
|
|
947
|
+
alignment: 'center',
|
|
948
|
+
fullViewportHeight: true,
|
|
949
|
+
showOverlay: false,
|
|
950
|
+
contentWidth: '700px',
|
|
951
|
+
},
|
|
952
|
+
parameters: {
|
|
953
|
+
docs: {
|
|
954
|
+
description: {
|
|
955
|
+
story:
|
|
956
|
+
'Minimalist design focusing on typography and content, with subtle animations and refined aesthetics.',
|
|
957
|
+
},
|
|
958
|
+
},
|
|
959
|
+
},
|
|
960
|
+
};
|
|
961
|
+
|
|
962
|
+
/**
|
|
963
|
+
* Hero with custom column styles
|
|
964
|
+
*/
|
|
965
|
+
export const WithCustomColumnStyles: Story = {
|
|
966
|
+
args: {
|
|
967
|
+
...Default.args,
|
|
968
|
+
title: 'Customized Columns',
|
|
969
|
+
text: 'This hero uses custom classes and inline styles on its layout columns. The content column has a custom background and padding, while the image column has a custom rotation effect.',
|
|
970
|
+
imageSrc: 'https://picsum.photos/id/20/712/500',
|
|
971
|
+
contentColClassName: 'u-bg-primary-50 u-p-6 u-rounded-lg',
|
|
972
|
+
contentColStyle: { border: '2px solid var(--atomix-color-primary-500)' },
|
|
973
|
+
imageColClassName: 'u-shadow-lg',
|
|
974
|
+
imageColStyle: { transform: 'rotate(-2deg)', transition: 'transform 0.3s ease' },
|
|
975
|
+
alignment: 'left',
|
|
976
|
+
},
|
|
977
|
+
parameters: {
|
|
978
|
+
docs: {
|
|
979
|
+
description: {
|
|
980
|
+
story:
|
|
981
|
+
'Demonstrates the use of imageColClassName, imageColStyle, contentColClassName, and contentColStyle to individually style the layout columns.',
|
|
982
|
+
},
|
|
983
|
+
},
|
|
984
|
+
},
|
|
985
|
+
};
|