@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
|
@@ -15,7 +15,7 @@ import React, { useState } from 'react';
|
|
|
15
15
|
import { Grid, GridCol, Container } from '../../../layouts/Grid';
|
|
16
16
|
|
|
17
17
|
const meta: Meta<typeof AtomixGlass> = {
|
|
18
|
-
title: 'Components/AtomixGlass/Modes',
|
|
18
|
+
title: 'Components/AtomixGlass/Features/Modes',
|
|
19
19
|
component: AtomixGlass,
|
|
20
20
|
parameters: {
|
|
21
21
|
layout: 'fullscreen',
|
|
@@ -0,0 +1,348 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Overview.stories.tsx
|
|
3
|
+
*
|
|
4
|
+
* Overview and basic usage for AtomixGlass
|
|
5
|
+
*
|
|
6
|
+
* @package Atomix
|
|
7
|
+
* @component AtomixGlass
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
11
|
+
import { fn } from '@storybook/test';
|
|
12
|
+
import React from 'react';
|
|
13
|
+
import AtomixGlass from '../AtomixGlass';
|
|
14
|
+
import Button from '../../Button/Button';
|
|
15
|
+
import { BackgroundWrapper, backgroundImages } from './shared-components';
|
|
16
|
+
|
|
17
|
+
// ============================================================================
|
|
18
|
+
// TYPE DEFINITIONS
|
|
19
|
+
// ============================================================================
|
|
20
|
+
|
|
21
|
+
/**
|
|
22
|
+
* Type helper for story props without children requirement
|
|
23
|
+
*/
|
|
24
|
+
type AtomixGlassStoryProps = Omit<React.ComponentProps<typeof AtomixGlass>, 'children'> & {
|
|
25
|
+
children?: React.ReactNode;
|
|
26
|
+
};
|
|
27
|
+
|
|
28
|
+
// ============================================================================
|
|
29
|
+
// EVENT HANDLERS
|
|
30
|
+
// ============================================================================
|
|
31
|
+
|
|
32
|
+
/**
|
|
33
|
+
* Event handlers for documentation
|
|
34
|
+
*/
|
|
35
|
+
const mockHandlers = {
|
|
36
|
+
onClick: fn(),
|
|
37
|
+
onAction: fn(),
|
|
38
|
+
onChange: fn(),
|
|
39
|
+
};
|
|
40
|
+
|
|
41
|
+
// ============================================================================
|
|
42
|
+
// META CONFIGURATION
|
|
43
|
+
// ============================================================================
|
|
44
|
+
|
|
45
|
+
const meta: Meta<typeof AtomixGlass> = {
|
|
46
|
+
title: 'Components/AtomixGlass',
|
|
47
|
+
component: AtomixGlass,
|
|
48
|
+
parameters: {
|
|
49
|
+
layout: 'fullscreen',
|
|
50
|
+
docs: {
|
|
51
|
+
description: {
|
|
52
|
+
component: `
|
|
53
|
+
# AtomixGlass
|
|
54
|
+
|
|
55
|
+
## Overview
|
|
56
|
+
|
|
57
|
+
AtomixGlass is a premium glass morphism component with realistic light refraction, chromatic aberration, and interactive effects. Perfect for cards, modals, and premium UI elements that need visual depth and elegance.
|
|
58
|
+
|
|
59
|
+
## Features
|
|
60
|
+
|
|
61
|
+
- Realistic glass effect with displacement and blur
|
|
62
|
+
- Chromatic aberration for depth perception
|
|
63
|
+
- Interactive hover effects with mouse tracking
|
|
64
|
+
- Multiple rendering modes (standard, polar, prominent, shader)
|
|
65
|
+
- Highly customizable parameters
|
|
66
|
+
- Performance optimized for smooth animations
|
|
67
|
+
|
|
68
|
+
## Accessibility
|
|
69
|
+
|
|
70
|
+
- Keyboard support: Full keyboard navigation compatibility
|
|
71
|
+
- Screen reader: Proper ARIA labels and descriptions
|
|
72
|
+
- ARIA support: All standard ARIA attributes supported
|
|
73
|
+
- Focus management: Proper focus handling within the component
|
|
74
|
+
|
|
75
|
+
## Usage Examples
|
|
76
|
+
|
|
77
|
+
### Basic Usage
|
|
78
|
+
|
|
79
|
+
\`\`\`typescript
|
|
80
|
+
<AtomixGlass>
|
|
81
|
+
<div>Your content here</div>
|
|
82
|
+
</AtomixGlass>
|
|
83
|
+
\`\`\`
|
|
84
|
+
|
|
85
|
+
### With Custom Configuration
|
|
86
|
+
|
|
87
|
+
\`\`\`typescript
|
|
88
|
+
<AtomixGlass
|
|
89
|
+
displacementScale={80}
|
|
90
|
+
blurAmount={0.5}
|
|
91
|
+
saturation={140}
|
|
92
|
+
aberrationIntensity={2}
|
|
93
|
+
>
|
|
94
|
+
<div>Your premium content here</div>
|
|
95
|
+
</AtomixGlass>
|
|
96
|
+
\`\`\`
|
|
97
|
+
|
|
98
|
+
## API Reference
|
|
99
|
+
|
|
100
|
+
### Props
|
|
101
|
+
|
|
102
|
+
| Prop | Type | Default | Description |
|
|
103
|
+
| -------- | -------------- | --------- | ----------------------- |
|
|
104
|
+
| children | ReactNode | undefined | Content to display inside the glass effect |
|
|
105
|
+
| displacementScale | number | 70 | Displacement scale for the glass effect |
|
|
106
|
+
| blurAmount | number | 0.0625 | Blur amount for the backdrop |
|
|
107
|
+
| saturation | number | 140 | Saturation percentage for the backdrop |
|
|
108
|
+
| aberrationIntensity | number | 2 | Chromatic aberration intensity |
|
|
109
|
+
| elasticity | number | 0.15 | Elasticity factor for mouse interactions |
|
|
110
|
+
| cornerRadius | number | 20 | Corner radius in pixels |
|
|
111
|
+
| overLight | boolean/object | "auto" | OverLight configuration mode |
|
|
112
|
+
| mode | "standard/polar/prominent/shader" | "standard" | Glass effect mode |
|
|
113
|
+
| onClick | function | undefined | Click event handler |
|
|
114
|
+
|
|
115
|
+
## Design Tokens
|
|
116
|
+
|
|
117
|
+
Used design tokens:
|
|
118
|
+
|
|
119
|
+
- \`--atomix-glass-displacement-scale\`: Displacement scale value
|
|
120
|
+
- \`--atomix-glass-blur-amount\`: Blur amount value
|
|
121
|
+
- \`--atomix-glass-saturation\`: Saturation value
|
|
122
|
+
- \`--atomix-glass-aberration-intensity\`: Aberration intensity value
|
|
123
|
+
|
|
124
|
+
## Notes
|
|
125
|
+
|
|
126
|
+
This component is performance-intensive. Use sparingly and consider performance implications on mobile devices.
|
|
127
|
+
`,
|
|
128
|
+
},
|
|
129
|
+
},
|
|
130
|
+
},
|
|
131
|
+
tags: ['autodocs'],
|
|
132
|
+
argTypes: {
|
|
133
|
+
children: {
|
|
134
|
+
control: 'text',
|
|
135
|
+
description: 'Content to display inside the glass effect',
|
|
136
|
+
table: {
|
|
137
|
+
category: 'Content',
|
|
138
|
+
defaultValue: { summary: '-' },
|
|
139
|
+
},
|
|
140
|
+
},
|
|
141
|
+
displacementScale: {
|
|
142
|
+
control: { type: 'range', min: 0, max: 100, step: 1 },
|
|
143
|
+
description: 'Displacement scale for the glass effect (default: 70)',
|
|
144
|
+
table: {
|
|
145
|
+
category: 'Visual',
|
|
146
|
+
defaultValue: { summary: '70' },
|
|
147
|
+
},
|
|
148
|
+
},
|
|
149
|
+
blurAmount: {
|
|
150
|
+
control: { type: 'range', min: 0, max: 10, step: 0.5 },
|
|
151
|
+
description: 'Blur amount for the backdrop (default: 0.0625)',
|
|
152
|
+
table: {
|
|
153
|
+
category: 'Visual',
|
|
154
|
+
defaultValue: { summary: '0.0625' },
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
saturation: {
|
|
158
|
+
control: { type: 'range', min: 100, max: 300, step: 5 },
|
|
159
|
+
description: 'Saturation percentage for the backdrop (default: 140)',
|
|
160
|
+
table: {
|
|
161
|
+
category: 'Visual',
|
|
162
|
+
defaultValue: { summary: '140' },
|
|
163
|
+
},
|
|
164
|
+
},
|
|
165
|
+
aberrationIntensity: {
|
|
166
|
+
control: { type: 'range', min: 0, max: 10, step: 0.1 },
|
|
167
|
+
description: 'Chromatic aberration intensity (default: 2)',
|
|
168
|
+
table: {
|
|
169
|
+
category: 'Visual',
|
|
170
|
+
defaultValue: { summary: '2' },
|
|
171
|
+
},
|
|
172
|
+
},
|
|
173
|
+
elasticity: {
|
|
174
|
+
control: { type: 'range', min: 0, max: 1, step: 0.01 },
|
|
175
|
+
description: 'Elasticity factor for mouse interactions (default: 0.15)',
|
|
176
|
+
table: {
|
|
177
|
+
category: 'Interaction',
|
|
178
|
+
defaultValue: { summary: '0.15' },
|
|
179
|
+
},
|
|
180
|
+
},
|
|
181
|
+
cornerRadius: {
|
|
182
|
+
control: { type: 'range', min: 0, max: 50, step: 1 },
|
|
183
|
+
description: 'Corner radius in pixels (default: 20)',
|
|
184
|
+
table: {
|
|
185
|
+
category: 'Visual',
|
|
186
|
+
defaultValue: { summary: '20' },
|
|
187
|
+
},
|
|
188
|
+
},
|
|
189
|
+
overLight: {
|
|
190
|
+
control: {
|
|
191
|
+
type: 'select',
|
|
192
|
+
labels: {
|
|
193
|
+
false: 'false (Dark Background)',
|
|
194
|
+
true: 'true (Light Background)',
|
|
195
|
+
auto: 'auto (Auto-detect)',
|
|
196
|
+
},
|
|
197
|
+
},
|
|
198
|
+
options: [false, true, 'auto'],
|
|
199
|
+
description: 'OverLight configuration mode',
|
|
200
|
+
table: {
|
|
201
|
+
category: 'Visual',
|
|
202
|
+
defaultValue: { summary: '"auto"' },
|
|
203
|
+
type: { summary: 'boolean | "auto"' },
|
|
204
|
+
},
|
|
205
|
+
},
|
|
206
|
+
mode: {
|
|
207
|
+
control: { type: 'inline-radio', options: ['standard', 'polar', 'prominent', 'shader'] },
|
|
208
|
+
description: 'Glass effect mode (default: "standard")',
|
|
209
|
+
table: {
|
|
210
|
+
category: 'Visual',
|
|
211
|
+
defaultValue: { summary: '"standard"' },
|
|
212
|
+
},
|
|
213
|
+
},
|
|
214
|
+
onClick: {
|
|
215
|
+
action: 'clicked',
|
|
216
|
+
description: 'Click event handler',
|
|
217
|
+
table: {
|
|
218
|
+
category: 'Events',
|
|
219
|
+
defaultValue: { summary: '-' },
|
|
220
|
+
},
|
|
221
|
+
},
|
|
222
|
+
padding: {
|
|
223
|
+
control: { type: 'text' },
|
|
224
|
+
description: 'Padding for the glass component',
|
|
225
|
+
table: {
|
|
226
|
+
category: 'Style',
|
|
227
|
+
defaultValue: { summary: '24px' },
|
|
228
|
+
},
|
|
229
|
+
},
|
|
230
|
+
className: {
|
|
231
|
+
control: 'text',
|
|
232
|
+
description: 'Additional CSS class names',
|
|
233
|
+
table: {
|
|
234
|
+
category: 'Style',
|
|
235
|
+
defaultValue: { summary: '-' },
|
|
236
|
+
},
|
|
237
|
+
},
|
|
238
|
+
style: {
|
|
239
|
+
control: 'object',
|
|
240
|
+
description: 'CSS style object',
|
|
241
|
+
table: {
|
|
242
|
+
category: 'Style',
|
|
243
|
+
defaultValue: { summary: '{}' },
|
|
244
|
+
},
|
|
245
|
+
},
|
|
246
|
+
'aria-label': {
|
|
247
|
+
control: 'text',
|
|
248
|
+
description: 'ARIA label for accessibility',
|
|
249
|
+
table: {
|
|
250
|
+
category: 'Accessibility',
|
|
251
|
+
defaultValue: { summary: '-' },
|
|
252
|
+
},
|
|
253
|
+
},
|
|
254
|
+
reducedMotion: {
|
|
255
|
+
control: 'boolean',
|
|
256
|
+
description: 'Override for reduced motion preference (default: false)',
|
|
257
|
+
table: {
|
|
258
|
+
category: 'Accessibility',
|
|
259
|
+
defaultValue: { summary: 'false' },
|
|
260
|
+
},
|
|
261
|
+
},
|
|
262
|
+
},
|
|
263
|
+
} satisfies Meta<typeof AtomixGlass>;
|
|
264
|
+
|
|
265
|
+
export default meta;
|
|
266
|
+
type Story = StoryObj<typeof meta>;
|
|
267
|
+
|
|
268
|
+
// ============================================================================
|
|
269
|
+
// BASIC USAGE STORIES
|
|
270
|
+
// ============================================================================
|
|
271
|
+
|
|
272
|
+
export const BasicUsage: Story = {
|
|
273
|
+
args: {
|
|
274
|
+
children: (
|
|
275
|
+
<div className="u-text-center">
|
|
276
|
+
<h2 className="u-mb-4 u-mt-0 u-text-white u-text-28">Basic Glass Effect</h2>
|
|
277
|
+
<p className="u-mb-6 u-mt-0 u-text-white u-opacity-90">
|
|
278
|
+
This is a basic AtomixGlass component with default settings.
|
|
279
|
+
</p>
|
|
280
|
+
<Button variant="primary" glass>
|
|
281
|
+
Click Me
|
|
282
|
+
</Button>
|
|
283
|
+
</div>
|
|
284
|
+
),
|
|
285
|
+
padding: '32px', // Increased padding for better visual appearance
|
|
286
|
+
},
|
|
287
|
+
render: args => (
|
|
288
|
+
<div className="u-bg-gradient-to-br u-from-indigo-500 u-via-purple-500 u-to-blue-500 u-min-h-screen u-w-full u-flex u-items-center u-justify-center">
|
|
289
|
+
<div className="u-w-full u-h-full">
|
|
290
|
+
<div className="u-flex u-justify-center u-items-center u-h-full">
|
|
291
|
+
<AtomixGlass {...args} />
|
|
292
|
+
</div>
|
|
293
|
+
</div>
|
|
294
|
+
</div>
|
|
295
|
+
),
|
|
296
|
+
parameters: {
|
|
297
|
+
docs: {
|
|
298
|
+
description: {
|
|
299
|
+
story: 'The basic usage of the AtomixGlass component with default configuration.',
|
|
300
|
+
},
|
|
301
|
+
},
|
|
302
|
+
},
|
|
303
|
+
};
|
|
304
|
+
|
|
305
|
+
export const WithAllProps: Story = {
|
|
306
|
+
args: {
|
|
307
|
+
children: (
|
|
308
|
+
<div className="u-text-center">
|
|
309
|
+
<h2 className="u-mb-4 u-mt-0 u-text-white u-text-24">Fully Configured Glass</h2>
|
|
310
|
+
<p className="u-mb-6 u-mt-0 u-text-white u-opacity-90 u-text-16">
|
|
311
|
+
This glass component uses all configurable properties.
|
|
312
|
+
</p>
|
|
313
|
+
<div className="u-flex u-gap-4 u-justify-center">
|
|
314
|
+
<Button variant="primary" glass>
|
|
315
|
+
Primary
|
|
316
|
+
</Button>
|
|
317
|
+
<Button variant="outline-primary" glass>
|
|
318
|
+
Outline
|
|
319
|
+
</Button>
|
|
320
|
+
</div>
|
|
321
|
+
</div>
|
|
322
|
+
),
|
|
323
|
+
displacementScale: 80,
|
|
324
|
+
blurAmount: 0.5,
|
|
325
|
+
saturation: 150,
|
|
326
|
+
aberrationIntensity: 2.5,
|
|
327
|
+
elasticity: 0.2,
|
|
328
|
+
cornerRadius: 24,
|
|
329
|
+
mode: 'standard',
|
|
330
|
+
overLight: true,
|
|
331
|
+
padding: '32px', // Increased padding for better visual appearance
|
|
332
|
+
onClick: mockHandlers.onClick,
|
|
333
|
+
},
|
|
334
|
+
render: args => (
|
|
335
|
+
<BackgroundWrapper backgroundImage={backgroundImages[0]}>
|
|
336
|
+
<div className="u-flex u-justify-center u-items-center u-h-full">
|
|
337
|
+
<AtomixGlass {...args} />
|
|
338
|
+
</div>
|
|
339
|
+
</BackgroundWrapper>
|
|
340
|
+
),
|
|
341
|
+
parameters: {
|
|
342
|
+
docs: {
|
|
343
|
+
description: {
|
|
344
|
+
story: 'Demonstrates AtomixGlass with all configurable props set to custom values.',
|
|
345
|
+
},
|
|
346
|
+
},
|
|
347
|
+
},
|
|
348
|
+
};
|
|
@@ -0,0 +1,103 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Performance.stories.tsx
|
|
3
|
+
*
|
|
4
|
+
* Stories focusing on performance optimization and stress testing.
|
|
5
|
+
*
|
|
6
|
+
* @package Atomix
|
|
7
|
+
* @component AtomixGlass
|
|
8
|
+
*/
|
|
9
|
+
|
|
10
|
+
import React from 'react';
|
|
11
|
+
import type { Meta, StoryObj } from '@storybook/react';
|
|
12
|
+
import AtomixGlass from '../AtomixGlass';
|
|
13
|
+
import { BackgroundWrapper, backgroundImages } from './shared-components';
|
|
14
|
+
|
|
15
|
+
const meta: Meta<typeof AtomixGlass> = {
|
|
16
|
+
title: 'Components/AtomixGlass/Features/Performance',
|
|
17
|
+
component: AtomixGlass,
|
|
18
|
+
parameters: {
|
|
19
|
+
layout: 'fullscreen',
|
|
20
|
+
docs: {
|
|
21
|
+
description: {
|
|
22
|
+
component:
|
|
23
|
+
'Performance-focused examples including mobile optimization and stress testing with multiple instances.',
|
|
24
|
+
},
|
|
25
|
+
},
|
|
26
|
+
},
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
export default meta;
|
|
30
|
+
type Story = StoryObj<typeof AtomixGlass>;
|
|
31
|
+
|
|
32
|
+
export const OptimizedForMobile: Story = {
|
|
33
|
+
args: {
|
|
34
|
+
children: (
|
|
35
|
+
<div className="u-text-center">
|
|
36
|
+
<h3 className="u-m-0 u-text-white u-text-20 u-mb-3">Mobile Optimized</h3>
|
|
37
|
+
<p className="u-m-0 u-text-white u-opacity-90 u-text-14">
|
|
38
|
+
Lower intensity settings for better mobile performance
|
|
39
|
+
</p>
|
|
40
|
+
</div>
|
|
41
|
+
),
|
|
42
|
+
displacementScale: 30, // Lower for performance
|
|
43
|
+
blurAmount: 0.2,
|
|
44
|
+
saturation: 120,
|
|
45
|
+
aberrationIntensity: 1.0,
|
|
46
|
+
elasticity: 0.1,
|
|
47
|
+
cornerRadius: 16,
|
|
48
|
+
padding: '28px',
|
|
49
|
+
},
|
|
50
|
+
render: args => (
|
|
51
|
+
<div className="u-bg-gradient-to-br u-from-indigo-500 u-via-purple-500 u-to-blue-500 u-min-h-screen u-w-full u-flex u-items-center u-justify-center">
|
|
52
|
+
<div className="u-w-full u-h-full">
|
|
53
|
+
<div className="u-flex u-justify-center u-items-center u-h-full">
|
|
54
|
+
<AtomixGlass {...args} />
|
|
55
|
+
</div>
|
|
56
|
+
</div>
|
|
57
|
+
</div>
|
|
58
|
+
),
|
|
59
|
+
parameters: {
|
|
60
|
+
docs: {
|
|
61
|
+
description: {
|
|
62
|
+
story: 'Optimized configuration for mobile devices with reduced performance impact.',
|
|
63
|
+
},
|
|
64
|
+
},
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
|
|
68
|
+
export const WithManyInstances: Story = {
|
|
69
|
+
parameters: {
|
|
70
|
+
docs: {
|
|
71
|
+
description: {
|
|
72
|
+
story:
|
|
73
|
+
'Shows multiple instances of AtomixGlass in a single view - useful for performance testing.',
|
|
74
|
+
},
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
render: () => {
|
|
78
|
+
return (
|
|
79
|
+
<BackgroundWrapper backgroundImage={backgroundImages[3]}>
|
|
80
|
+
<div className="u-flex u-flex-wrap u-gap-6 u-w-full u-py-60 u-max-w-7xl u-mx-auto u-p-4 u-justify-center">
|
|
81
|
+
{[1, 2, 3, 4].map(index => (
|
|
82
|
+
<AtomixGlass
|
|
83
|
+
key={index}
|
|
84
|
+
displacementScale={40}
|
|
85
|
+
blurAmount={0.25}
|
|
86
|
+
saturation={130}
|
|
87
|
+
aberrationIntensity={1.2}
|
|
88
|
+
elasticity={0.1}
|
|
89
|
+
cornerRadius={16}
|
|
90
|
+
padding="28px"
|
|
91
|
+
className="u-text-center"
|
|
92
|
+
>
|
|
93
|
+
<h4 className="u-m-0 u-text-white u-text-18 u-mb-2">Glass #{index}</h4>
|
|
94
|
+
<p className="u-m-0 u-text-white u-opacity-80 u-text-14">
|
|
95
|
+
Instance #{index} of AtomixGlass
|
|
96
|
+
</p>
|
|
97
|
+
</AtomixGlass>
|
|
98
|
+
))}
|
|
99
|
+
</div>
|
|
100
|
+
</BackgroundWrapper>
|
|
101
|
+
);
|
|
102
|
+
},
|
|
103
|
+
};
|
|
@@ -316,7 +316,7 @@ export const Playground: Story = {
|
|
|
316
316
|
);
|
|
317
317
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
318
318
|
const [selectedShader, setSelectedShader] = useState<
|
|
319
|
-
'liquidGlass' | 'plasma' | 'waves' | 'noise'
|
|
319
|
+
'liquidGlass' | 'plasma' | 'waves' | 'noise' | 'appleFluid' | 'liquidMetal'
|
|
320
320
|
>('liquidGlass');
|
|
321
321
|
// eslint-disable-next-line react-hooks/rules-of-hooks
|
|
322
322
|
const [showCode, setShowCode] = useState(false);
|
|
@@ -436,6 +436,19 @@ export const Playground: Story = {
|
|
|
436
436
|
</AtomixGlass>`;
|
|
437
437
|
};
|
|
438
438
|
|
|
439
|
+
// ... rest of the component
|
|
440
|
+
|
|
441
|
+
const options = [
|
|
442
|
+
{ value: 'liquidGlass', label: 'Liquid Glass (Standard)' },
|
|
443
|
+
{ value: 'premiumGlass', label: 'Premium Glass' },
|
|
444
|
+
{ value: 'appleFluid', label: 'Apple Fluid' },
|
|
445
|
+
{ value: 'liquidMetal', label: 'Liquid Metal' },
|
|
446
|
+
{ value: 'basiBasi', label: 'Expert (BasiBasi)' },
|
|
447
|
+
{ value: 'plasma', label: 'Plasma (Legacy)' },
|
|
448
|
+
{ value: 'waves', label: 'Waves (Legacy)' },
|
|
449
|
+
{ value: 'noise', label: 'Noise (Legacy)' },
|
|
450
|
+
];
|
|
451
|
+
|
|
439
452
|
const copyCode = () => {
|
|
440
453
|
navigator.clipboard.writeText(generateCode());
|
|
441
454
|
setCopiedCode(true);
|
|
@@ -460,10 +473,10 @@ export const Playground: Story = {
|
|
|
460
473
|
Math.min(
|
|
461
474
|
100,
|
|
462
475
|
100 -
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
476
|
+
settings.displacementScale * 0.15 -
|
|
477
|
+
Math.abs(settings.blurAmount) * 2 -
|
|
478
|
+
settings.aberrationIntensity * 3 -
|
|
479
|
+
settings.elasticity * 20
|
|
467
480
|
)
|
|
468
481
|
);
|
|
469
482
|
|
|
@@ -481,7 +494,7 @@ export const Playground: Story = {
|
|
|
481
494
|
};
|
|
482
495
|
|
|
483
496
|
const backgrounds = [
|
|
484
|
-
'https://images.unsplash.com/photo-
|
|
497
|
+
'https://images.unsplash.com/photo-1579546929518-9e396f3cc809',
|
|
485
498
|
'https://images.unsplash.com/photo-1734760858517-ff3e30c4a420?ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&q=80&w=987',
|
|
486
499
|
'https://images.unsplash.com/photo-1590634875052-89c137f8df21?ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&q=80&w=2072',
|
|
487
500
|
'https://images.unsplash.com/photo-1592880476174-2932b3061c30?ixlib=rb-4.1.0&ixid=M3wxMjA3fDB8MHxwaG90by1wYWdlfHx8fGVufDB8fHx8fA%3D%3D&auto=format&fit=crop&q=80&w=2070',
|
|
@@ -548,7 +561,8 @@ export const Playground: Story = {
|
|
|
548
561
|
className="u-m-0 u-text-white u-font-bold"
|
|
549
562
|
style={{
|
|
550
563
|
fontSize: '1.75rem',
|
|
551
|
-
background:
|
|
564
|
+
background:
|
|
565
|
+
'linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.8) 100%)',
|
|
552
566
|
WebkitBackgroundClip: 'text',
|
|
553
567
|
WebkitTextFillColor: 'transparent',
|
|
554
568
|
backgroundClip: 'text',
|
|
@@ -690,12 +704,12 @@ export const Playground: Story = {
|
|
|
690
704
|
: 'Off'
|
|
691
705
|
: typeof value === 'number'
|
|
692
706
|
? value.toFixed(
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
707
|
+
key.includes('Amount') ||
|
|
708
|
+
key.includes('elasticity') ||
|
|
709
|
+
key.includes('aberration')
|
|
710
|
+
? 2
|
|
711
|
+
: 0
|
|
712
|
+
)
|
|
699
713
|
: value}
|
|
700
714
|
</span>
|
|
701
715
|
</div>
|
|
@@ -723,8 +737,8 @@ export const Playground: Story = {
|
|
|
723
737
|
}
|
|
724
738
|
step={
|
|
725
739
|
key === 'aberrationIntensity' ||
|
|
726
|
-
|
|
727
|
-
|
|
740
|
+
key === 'elasticity' ||
|
|
741
|
+
key === 'blurAmount'
|
|
728
742
|
? 0.01
|
|
729
743
|
: 1
|
|
730
744
|
}
|
|
@@ -790,18 +804,15 @@ export const Playground: Story = {
|
|
|
790
804
|
fontSize: '1rem',
|
|
791
805
|
}}
|
|
792
806
|
>
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
<option value="noise" style={{ background: '#1a1a1a' }}>
|
|
803
|
-
Noise
|
|
804
|
-
</option>
|
|
807
|
+
{options.map(opt => (
|
|
808
|
+
<option
|
|
809
|
+
key={opt.value}
|
|
810
|
+
value={opt.value}
|
|
811
|
+
style={{ background: '#1a1a1a' }}
|
|
812
|
+
>
|
|
813
|
+
{opt.label}
|
|
814
|
+
</option>
|
|
815
|
+
))}
|
|
805
816
|
</select>
|
|
806
817
|
</div>
|
|
807
818
|
)}
|
|
@@ -908,7 +919,8 @@ export const Playground: Story = {
|
|
|
908
919
|
className="u-m-0 u-font-bold"
|
|
909
920
|
style={{
|
|
910
921
|
fontSize: '1.75rem',
|
|
911
|
-
background:
|
|
922
|
+
background:
|
|
923
|
+
'linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.8) 100%)',
|
|
912
924
|
WebkitBackgroundClip: 'text',
|
|
913
925
|
WebkitTextFillColor: 'transparent',
|
|
914
926
|
backgroundClip: 'text',
|
|
@@ -987,7 +999,8 @@ export const Playground: Story = {
|
|
|
987
999
|
gap: '8px',
|
|
988
1000
|
padding: '10px 24px',
|
|
989
1001
|
borderRadius: '28px',
|
|
990
|
-
background:
|
|
1002
|
+
background:
|
|
1003
|
+
'linear-gradient(135deg, rgba(122, 255, 215, 0.25) 0%, rgba(102, 126, 234, 0.25) 100%)',
|
|
991
1004
|
border: '1px solid rgba(122, 255, 215, 0.3)',
|
|
992
1005
|
color: '#7AFFD7',
|
|
993
1006
|
fontSize: '0.875rem',
|
|
@@ -1020,7 +1033,8 @@ export const Playground: Story = {
|
|
|
1020
1033
|
className="u-mb-4 u-font-bold"
|
|
1021
1034
|
style={{
|
|
1022
1035
|
fontSize: '2.75rem',
|
|
1023
|
-
background:
|
|
1036
|
+
background:
|
|
1037
|
+
'linear-gradient(135deg, #fff 0%, rgba(255,255,255,0.8) 100%)',
|
|
1024
1038
|
WebkitBackgroundClip: 'text',
|
|
1025
1039
|
WebkitTextFillColor: 'transparent',
|
|
1026
1040
|
backgroundClip: 'text',
|
|
@@ -1043,10 +1057,7 @@ export const Playground: Story = {
|
|
|
1043
1057
|
affects the visual appearance and performance characteristics of the glass
|
|
1044
1058
|
effect.
|
|
1045
1059
|
</p>
|
|
1046
|
-
<div
|
|
1047
|
-
className="u-flex u-justify-center u-flex-wrap"
|
|
1048
|
-
style={{ gap: '1rem' }}
|
|
1049
|
-
>
|
|
1060
|
+
<div className="u-flex u-justify-center u-flex-wrap" style={{ gap: '1rem' }}>
|
|
1050
1061
|
<Button variant="primary" size="lg">
|
|
1051
1062
|
Primary Action
|
|
1052
1063
|
</Button>
|
|
@@ -1107,11 +1118,15 @@ export const Playground: Story = {
|
|
|
1107
1118
|
</div>
|
|
1108
1119
|
<div>
|
|
1109
1120
|
<div className="u-text-xs u-opacity-70">Blur</div>
|
|
1110
|
-
<div className="u-font-semibold">
|
|
1121
|
+
<div className="u-font-semibold">
|
|
1122
|
+
{settings.blurAmount.toFixed(2)}
|
|
1123
|
+
</div>
|
|
1111
1124
|
</div>
|
|
1112
1125
|
<div>
|
|
1113
1126
|
<div className="u-text-xs u-opacity-70">Elasticity</div>
|
|
1114
|
-
<div className="u-font-semibold">
|
|
1127
|
+
<div className="u-font-semibold">
|
|
1128
|
+
{settings.elasticity.toFixed(2)}
|
|
1129
|
+
</div>
|
|
1115
1130
|
</div>
|
|
1116
1131
|
</div>
|
|
1117
1132
|
</div>
|
package/src/components/AtomixGlass/stories/{ShaderVariants.stories.tsx → Shaders.stories.tsx}
RENAMED
|
@@ -14,7 +14,7 @@ import AtomixGlass from '../AtomixGlass';
|
|
|
14
14
|
import { BackgroundWrapper } from './shared-components';
|
|
15
15
|
|
|
16
16
|
const meta: Meta<typeof AtomixGlass> = {
|
|
17
|
-
title: 'Components/AtomixGlass/
|
|
17
|
+
title: 'Components/AtomixGlass/Features/Shaders',
|
|
18
18
|
component: AtomixGlass,
|
|
19
19
|
parameters: {
|
|
20
20
|
layout: 'fullscreen',
|
|
@@ -73,7 +73,7 @@ export const LiquidGlass: Story = {
|
|
|
73
73
|
margin: '0 0 16px 0',
|
|
74
74
|
fontSize: '38px',
|
|
75
75
|
fontWeight: 700,
|
|
76
|
-
background: '
|
|
76
|
+
background: 'url(https://images.unsplash.com/photo-1579546929518-9e396f3cc809)',
|
|
77
77
|
WebkitBackgroundClip: 'text',
|
|
78
78
|
WebkitTextFillColor: 'transparent',
|
|
79
79
|
backgroundClip: 'text',
|