@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
|
@@ -3,13 +3,7 @@ import type { CSSProperties } from 'react';
|
|
|
3
3
|
import type { DisplacementMode, MousePosition, GlassSize } from '../../lib/types/components';
|
|
4
4
|
import type { FragmentShaderType } from './shader-utils';
|
|
5
5
|
import { GlassFilter } from './GlassFilter';
|
|
6
|
-
import {
|
|
7
|
-
calculateElementCenter,
|
|
8
|
-
calculateDistance,
|
|
9
|
-
calculateMouseInfluence,
|
|
10
|
-
clampBlur,
|
|
11
|
-
validateGlassSize,
|
|
12
|
-
} from './glass-utils';
|
|
6
|
+
import { calculateMouseInfluence, clampBlur, validateGlassSize } from './glass-utils';
|
|
13
7
|
import { ATOMIX_GLASS } from '../../lib/constants/components';
|
|
14
8
|
|
|
15
9
|
const { CONSTANTS } = ATOMIX_GLASS;
|
|
@@ -58,7 +52,9 @@ const setCachedShader = (key: string, url: string): void => {
|
|
|
58
52
|
// Development mode: log cache size
|
|
59
53
|
if (typeof process === 'undefined' || process.env?.NODE_ENV !== 'production') {
|
|
60
54
|
if (sharedShaderCache.size >= MAX_CACHE_SIZE * 0.8) {
|
|
61
|
-
console.log(
|
|
55
|
+
console.log(
|
|
56
|
+
`AtomixGlass: Shader cache size: ${String(sharedShaderCache.size).replace(/[\r\n]/g, '')}/${String(MAX_CACHE_SIZE).replace(/[\r\n]/g, '')}`
|
|
57
|
+
);
|
|
62
58
|
}
|
|
63
59
|
}
|
|
64
60
|
};
|
|
@@ -76,10 +72,15 @@ interface AtomixGlassContainerProps {
|
|
|
76
72
|
onMouseEnter?: () => void;
|
|
77
73
|
onMouseDown?: () => void;
|
|
78
74
|
onMouseUp?: () => void;
|
|
79
|
-
active?: boolean;
|
|
80
75
|
isHovered?: boolean;
|
|
81
76
|
isActive?: boolean;
|
|
82
77
|
overLight?: boolean;
|
|
78
|
+
overLightConfig?: {
|
|
79
|
+
contrast?: number;
|
|
80
|
+
brightness?: number;
|
|
81
|
+
shadowIntensity?: number;
|
|
82
|
+
borderOpacity?: number;
|
|
83
|
+
};
|
|
83
84
|
cornerRadius?: number;
|
|
84
85
|
padding?: string;
|
|
85
86
|
glassSize?: GlassSize;
|
|
@@ -115,10 +116,10 @@ export const AtomixGlassContainer = forwardRef<HTMLDivElement, AtomixGlassContai
|
|
|
115
116
|
onMouseLeave,
|
|
116
117
|
onMouseDown,
|
|
117
118
|
onMouseUp,
|
|
118
|
-
active = false,
|
|
119
119
|
isHovered = false,
|
|
120
120
|
isActive = false,
|
|
121
121
|
overLight = false,
|
|
122
|
+
overLightConfig = {},
|
|
122
123
|
cornerRadius = 0,
|
|
123
124
|
padding = '0 0',
|
|
124
125
|
glassSize = { width: 0, height: 0 },
|
|
@@ -153,14 +154,19 @@ export const AtomixGlassContainer = forwardRef<HTMLDivElement, AtomixGlassContai
|
|
|
153
154
|
useEffect(() => {
|
|
154
155
|
if (mode === 'shader') {
|
|
155
156
|
// Dynamic import shader utilities
|
|
156
|
-
import('./shader-utils')
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
157
|
+
import('./shader-utils')
|
|
158
|
+
.then(shaderUtils => {
|
|
159
|
+
shaderUtilsRef.current = {
|
|
160
|
+
ShaderDisplacementGenerator: shaderUtils.ShaderDisplacementGenerator,
|
|
161
|
+
fragmentShaders: shaderUtils.fragmentShaders,
|
|
162
|
+
};
|
|
163
|
+
})
|
|
164
|
+
.catch(error => {
|
|
165
|
+
console.warn(
|
|
166
|
+
'AtomixGlassContainer: Error loading shader utilities',
|
|
167
|
+
String(error).replace(/[\r\n]/g, '')
|
|
168
|
+
);
|
|
169
|
+
});
|
|
164
170
|
} else {
|
|
165
171
|
// Clear shader utils when not in shader mode to free memory
|
|
166
172
|
shaderUtilsRef.current = null;
|
|
@@ -170,7 +176,12 @@ export const AtomixGlassContainer = forwardRef<HTMLDivElement, AtomixGlassContai
|
|
|
170
176
|
// Generate shader map with debouncing and caching
|
|
171
177
|
useEffect(() => {
|
|
172
178
|
// Enhanced validation for shader mode
|
|
173
|
-
if (
|
|
179
|
+
if (
|
|
180
|
+
mode === 'shader' &&
|
|
181
|
+
glassSize &&
|
|
182
|
+
validateGlassSize(glassSize) &&
|
|
183
|
+
shaderUtilsRef.current
|
|
184
|
+
) {
|
|
174
185
|
// Create cache key from size and variant
|
|
175
186
|
const cacheKey = `${glassSize.width}x${glassSize.height}-${shaderVariant}`;
|
|
176
187
|
|
|
@@ -262,11 +273,13 @@ export const AtomixGlassContainer = forwardRef<HTMLDivElement, AtomixGlassContai
|
|
|
262
273
|
const EDGE_BLUR_MULTIPLIER = 1.25;
|
|
263
274
|
const CENTER_BLUR_MULTIPLIER = 1.1;
|
|
264
275
|
const FLOW_BLUR_MULTIPLIER = 1.2;
|
|
265
|
-
const MOUSE_INFLUENCE_BLUR_FACTOR = 0.
|
|
276
|
+
const MOUSE_INFLUENCE_BLUR_FACTOR = 0.15;
|
|
266
277
|
const EDGE_INTENSITY_MULTIPLIER = 1.5;
|
|
267
|
-
const EDGE_INTENSITY_MOUSE_FACTOR = 0.
|
|
278
|
+
const EDGE_INTENSITY_MOUSE_FACTOR = 0.15;
|
|
268
279
|
const CENTER_INTENSITY_DISTANCE_FACTOR = 0.3;
|
|
269
|
-
const CENTER_INTENSITY_MOUSE_FACTOR = 0.
|
|
280
|
+
const CENTER_INTENSITY_MOUSE_FACTOR = 0.1;
|
|
281
|
+
// Maximum blur multiplier relative to base — prevents runaway blur
|
|
282
|
+
const MAX_BLUR_RELATIVE = 2;
|
|
270
283
|
|
|
271
284
|
const liquidBlur = useMemo(() => {
|
|
272
285
|
const defaultBlur = {
|
|
@@ -280,60 +293,42 @@ export const AtomixGlassContainer = forwardRef<HTMLDivElement, AtomixGlassContai
|
|
|
280
293
|
if (
|
|
281
294
|
!enableLiquidBlur ||
|
|
282
295
|
!rectCache ||
|
|
283
|
-
!
|
|
284
|
-
typeof
|
|
285
|
-
typeof
|
|
286
|
-
isNaN(
|
|
287
|
-
isNaN(
|
|
296
|
+
!mouseOffset ||
|
|
297
|
+
typeof mouseOffset.x !== 'number' ||
|
|
298
|
+
typeof mouseOffset.y !== 'number' ||
|
|
299
|
+
isNaN(mouseOffset.x) ||
|
|
300
|
+
isNaN(mouseOffset.y)
|
|
288
301
|
) {
|
|
289
302
|
return defaultBlur;
|
|
290
303
|
}
|
|
291
304
|
|
|
292
305
|
try {
|
|
293
|
-
// Cache center and distance calculations
|
|
294
|
-
const center = calculateElementCenter(rectCache);
|
|
295
|
-
const distance = calculateDistance(globalMousePosition, center);
|
|
296
|
-
const maxDistance =
|
|
297
|
-
Math.sqrt(rectCache.width * rectCache.width + rectCache.height * rectCache.height) / 2;
|
|
298
|
-
const normalizedDistance = Math.min(distance / maxDistance, 1);
|
|
299
306
|
const mouseInfluence = calculateMouseInfluence(mouseOffset);
|
|
307
|
+
const maxBlur = blurAmount * MAX_BLUR_RELATIVE;
|
|
300
308
|
|
|
301
|
-
const baseBlur =
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
const
|
|
306
|
-
const
|
|
307
|
-
const
|
|
308
|
-
const
|
|
309
|
-
const
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
const activeMultiplier = isActive ? 1.4 : 1;
|
|
314
|
-
const stateMultiplier = hoverMultiplier * activeMultiplier;
|
|
315
|
-
|
|
309
|
+
const baseBlur = Math.min(
|
|
310
|
+
maxBlur,
|
|
311
|
+
blurAmount + mouseInfluence * blurAmount * MOUSE_INFLUENCE_BLUR_FACTOR
|
|
312
|
+
);
|
|
313
|
+
const edgeIntensity = mouseInfluence * EDGE_INTENSITY_MOUSE_FACTOR;
|
|
314
|
+
const edgeBlur = Math.min(maxBlur, baseBlur * (0.8 + edgeIntensity * 0.4));
|
|
315
|
+
const centerIntensity = mouseInfluence * CENTER_INTENSITY_MOUSE_FACTOR;
|
|
316
|
+
const centerBlur = Math.min(maxBlur, baseBlur * (0.3 + centerIntensity * 0.3));
|
|
317
|
+
const flowBlur = Math.min(maxBlur, baseBlur * FLOW_BLUR_MULTIPLIER);
|
|
318
|
+
|
|
319
|
+
// NOTE: hover/active multipliers intentionally omitted here —
|
|
320
|
+
// they belong on opacity layers, not the blur filter itself.
|
|
316
321
|
return {
|
|
317
|
-
baseBlur: clampBlur(baseBlur
|
|
318
|
-
edgeBlur: clampBlur(edgeBlur
|
|
319
|
-
centerBlur: clampBlur(centerBlur
|
|
320
|
-
flowBlur: clampBlur(flowBlur
|
|
322
|
+
baseBlur: clampBlur(baseBlur),
|
|
323
|
+
edgeBlur: clampBlur(edgeBlur),
|
|
324
|
+
centerBlur: clampBlur(centerBlur),
|
|
325
|
+
flowBlur: clampBlur(flowBlur),
|
|
321
326
|
};
|
|
322
327
|
} catch (error) {
|
|
323
328
|
console.warn('AtomixGlassContainer: Error calculating liquid blur', error);
|
|
324
329
|
return defaultBlur;
|
|
325
330
|
}
|
|
326
|
-
}, [
|
|
327
|
-
enableLiquidBlur,
|
|
328
|
-
blurAmount,
|
|
329
|
-
globalMousePosition,
|
|
330
|
-
mouseOffset,
|
|
331
|
-
isHovered,
|
|
332
|
-
isActive,
|
|
333
|
-
rectCache,
|
|
334
|
-
style,
|
|
335
|
-
glassSize,
|
|
336
|
-
]);
|
|
331
|
+
}, [enableLiquidBlur, blurAmount, mouseOffset, rectCache]);
|
|
337
332
|
|
|
338
333
|
const backdropStyle = useMemo(() => {
|
|
339
334
|
try {
|
|
@@ -364,15 +359,18 @@ export const AtomixGlassContainer = forwardRef<HTMLDivElement, AtomixGlassContai
|
|
|
364
359
|
const useMultiPass = enableLiquidBlur && !devicePrefersPerformance && !areaIsLarge;
|
|
365
360
|
|
|
366
361
|
if (useMultiPass) {
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
362
|
+
// Use a single weighted-average blur instead of stacking multiple
|
|
363
|
+
// blur() calls. CSS blur() is additive — stacking 4 passes
|
|
364
|
+
// causes the perceived blur to compound far beyond any single value.
|
|
365
|
+
const weightedBlur = clampBlur(
|
|
366
|
+
validatedBaseBlur * 0.4 +
|
|
367
|
+
validatedEdgeBlur * 0.25 +
|
|
368
|
+
validatedCenterBlur * 0.15 +
|
|
369
|
+
validatedFlowBlur * 0.2
|
|
370
|
+
);
|
|
373
371
|
|
|
374
372
|
return {
|
|
375
|
-
backdropFilter:
|
|
373
|
+
backdropFilter: `blur(${weightedBlur}px) saturate(${Math.min(dynamicSaturation, 200)}%) contrast(${overLightConfig?.contrast || 1.05}) brightness(${overLightConfig?.brightness || 1.05})`,
|
|
376
374
|
};
|
|
377
375
|
}
|
|
378
376
|
|
|
@@ -387,7 +385,7 @@ export const AtomixGlassContainer = forwardRef<HTMLDivElement, AtomixGlassContai
|
|
|
387
385
|
);
|
|
388
386
|
|
|
389
387
|
return {
|
|
390
|
-
backdropFilter: `blur(${effectiveBlur}px) saturate(${Math.min(dynamicSaturation, 200)}%) contrast(1.05) brightness(1.05)`,
|
|
388
|
+
backdropFilter: `blur(${effectiveBlur}px) saturate(${Math.min(dynamicSaturation, 200)}%) contrast(${overLightConfig?.contrast || 1.05}) brightness(${overLightConfig?.brightness || 1.05})`,
|
|
391
389
|
};
|
|
392
390
|
} catch (error) {
|
|
393
391
|
console.warn('AtomixGlassContainer: Error calculating backdrop style', error);
|
|
@@ -424,11 +422,11 @@ export const AtomixGlassContainer = forwardRef<HTMLDivElement, AtomixGlassContai
|
|
|
424
422
|
'--atomix-glass-container-backdrop': backdropStyle?.backdropFilter || 'none',
|
|
425
423
|
'--atomix-glass-container-shadow': overLight
|
|
426
424
|
? [
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
425
|
+
`inset 0 1px 0 rgba(255, 255, 255, ${(0.4 + mx * 0.002) * (overLightConfig?.shadowIntensity || 1)})`,
|
|
426
|
+
`inset 0 -1px 0 rgba(0, 0, 0, ${(0.2 + Math.abs(my) * 0.001) * (overLightConfig?.shadowIntensity || 1)})`,
|
|
427
|
+
`inset 0 0 20px rgba(0, 0, 0, ${(0.08 + Math.abs(mx + my) * 0.001) * (overLightConfig?.shadowIntensity || 1)})`,
|
|
428
|
+
`0 2px 12px rgba(0, 0, 0, ${(0.12 + Math.abs(my) * 0.002) * (overLightConfig?.shadowIntensity || 1)})`,
|
|
429
|
+
].join(', ')
|
|
432
430
|
: '0 0 20px rgba(0, 0, 0, 0.15) inset, 0 4px 8px rgba(0, 0, 0, 0.08) inset',
|
|
433
431
|
'--atomix-glass-container-shadow-opacity': effectiveDisableEffects ? 0 : 1,
|
|
434
432
|
// Background and shadow values use design token-aligned RGB values
|
|
@@ -464,10 +462,29 @@ export const AtomixGlassContainer = forwardRef<HTMLDivElement, AtomixGlassContai
|
|
|
464
462
|
effectiveDisableEffects,
|
|
465
463
|
]);
|
|
466
464
|
|
|
465
|
+
// Helper to force no transition/animation overrides with !important
|
|
466
|
+
const setForceNoTransition = (el: HTMLElement | null) => {
|
|
467
|
+
if (el) {
|
|
468
|
+
el.style.setProperty('transition-duration', '0s', 'important');
|
|
469
|
+
el.style.setProperty('animation-duration', '0s', 'important');
|
|
470
|
+
el.style.setProperty('transition-delay', '0s', 'important');
|
|
471
|
+
}
|
|
472
|
+
};
|
|
473
|
+
|
|
467
474
|
return (
|
|
468
475
|
<div
|
|
469
|
-
ref={
|
|
470
|
-
|
|
476
|
+
ref={el => {
|
|
477
|
+
// Apply force no-transition
|
|
478
|
+
setForceNoTransition(el);
|
|
479
|
+
|
|
480
|
+
// Handle forwarded ref
|
|
481
|
+
if (typeof ref === 'function') {
|
|
482
|
+
ref(el);
|
|
483
|
+
} else if (ref) {
|
|
484
|
+
(ref as React.MutableRefObject<HTMLDivElement | null>).current = el;
|
|
485
|
+
}
|
|
486
|
+
}}
|
|
487
|
+
className={`${ATOMIX_GLASS.CONTAINER_CLASS} ${className} ${isActive ? ATOMIX_GLASS.CLASSES.ACTIVE : ''} ${overLight ? ATOMIX_GLASS.CLASSES.OVER_LIGHT : ''}`}
|
|
471
488
|
style={{ ...style, ...containerVars }}
|
|
472
489
|
onClick={onClick}
|
|
473
490
|
>
|
|
@@ -484,7 +501,10 @@ export const AtomixGlassContainer = forwardRef<HTMLDivElement, AtomixGlassContai
|
|
|
484
501
|
onMouseDown={onMouseDown}
|
|
485
502
|
onMouseUp={onMouseUp}
|
|
486
503
|
>
|
|
487
|
-
<div
|
|
504
|
+
<div
|
|
505
|
+
className={ATOMIX_GLASS.FILTER_CLASS}
|
|
506
|
+
style={{ zIndex: 1, position: 'absolute', inset: 0 }}
|
|
507
|
+
>
|
|
488
508
|
<GlassFilter
|
|
489
509
|
blurAmount={blurAmount}
|
|
490
510
|
mode={mode}
|
|
@@ -503,6 +523,7 @@ export const AtomixGlassContainer = forwardRef<HTMLDivElement, AtomixGlassContai
|
|
|
503
523
|
/>
|
|
504
524
|
{/* Enhanced Apple Liquid Glass Inner Shadow Layer */}
|
|
505
525
|
<div
|
|
526
|
+
ref={setForceNoTransition}
|
|
506
527
|
className={ATOMIX_GLASS.FILTER_OVERLAY_CLASS}
|
|
507
528
|
style={
|
|
508
529
|
{
|
|
@@ -532,7 +553,8 @@ export const AtomixGlassContainer = forwardRef<HTMLDivElement, AtomixGlassContai
|
|
|
532
553
|
{
|
|
533
554
|
position: 'relative',
|
|
534
555
|
textShadow: `var(--atomix-glass-container-text-shadow)`,
|
|
535
|
-
|
|
556
|
+
// Ensure content is always above the filter layer (zIndex 1)
|
|
557
|
+
zIndex: elasticity > 0 ? 100 : 2,
|
|
536
558
|
} as CSSProperties
|
|
537
559
|
}
|
|
538
560
|
>
|
|
@@ -544,4 +566,4 @@ export const AtomixGlassContainer = forwardRef<HTMLDivElement, AtomixGlassContai
|
|
|
544
566
|
}
|
|
545
567
|
);
|
|
546
568
|
|
|
547
|
-
AtomixGlassContainer.displayName = 'AtomixGlassContainer';
|
|
569
|
+
AtomixGlassContainer.displayName = 'AtomixGlassContainer';
|
|
@@ -35,12 +35,7 @@ const GlassFilterComponent: React.FC<GlassFilterProps> = ({
|
|
|
35
35
|
aria-hidden="true"
|
|
36
36
|
>
|
|
37
37
|
<defs>
|
|
38
|
-
<radialGradient
|
|
39
|
-
id={`${id}-edge-mask`}
|
|
40
|
-
cx="50%"
|
|
41
|
-
cy="50%"
|
|
42
|
-
r="50%"
|
|
43
|
-
>
|
|
38
|
+
<radialGradient id={`${id}-edge-mask`} cx="50%" cy="50%" r="50%">
|
|
44
39
|
<stop offset="0%" stopColor="black" stopOpacity="0" />
|
|
45
40
|
<stop
|
|
46
41
|
offset={`${Math.max(30, 80 - aberrationIntensity * 2)}%`}
|
|
@@ -49,14 +44,7 @@ const GlassFilterComponent: React.FC<GlassFilterProps> = ({
|
|
|
49
44
|
/>
|
|
50
45
|
<stop offset="100%" stopColor="white" stopOpacity="1" />
|
|
51
46
|
</radialGradient>
|
|
52
|
-
<filter
|
|
53
|
-
id={id}
|
|
54
|
-
x="-35%"
|
|
55
|
-
y="-35%"
|
|
56
|
-
width="170%"
|
|
57
|
-
height="170%"
|
|
58
|
-
colorInterpolationFilters="sRGB"
|
|
59
|
-
>
|
|
47
|
+
<filter id={id} x="-35%" y="-35%" width="170%" height="170%" colorInterpolationFilters="sRGB">
|
|
60
48
|
<feImage
|
|
61
49
|
id={`${id}-image`}
|
|
62
50
|
x="0"
|
|
@@ -64,7 +52,13 @@ const GlassFilterComponent: React.FC<GlassFilterProps> = ({
|
|
|
64
52
|
width="100%"
|
|
65
53
|
height="100%"
|
|
66
54
|
result="DISPLACEMENT_MAP"
|
|
67
|
-
href={getDisplacementMap(
|
|
55
|
+
href={getDisplacementMap(
|
|
56
|
+
mode,
|
|
57
|
+
displacementMap,
|
|
58
|
+
polarDisplacementMap,
|
|
59
|
+
prominentDisplacementMap,
|
|
60
|
+
shaderMapUrl
|
|
61
|
+
)}
|
|
68
62
|
preserveAspectRatio="xMidYMid slice"
|
|
69
63
|
/>
|
|
70
64
|
|
|
@@ -178,4 +172,3 @@ export const GlassFilter = memo(GlassFilterComponent, (prevProps, nextProps) =>
|
|
|
178
172
|
prevProps.blurAmount === nextProps.blurAmount
|
|
179
173
|
);
|
|
180
174
|
});
|
|
181
|
-
|
|
@@ -4,11 +4,11 @@ exports[`AtomixGlass Visual Regression > matches snapshot with default props 1`]
|
|
|
4
4
|
<div>
|
|
5
5
|
<div
|
|
6
6
|
class="c-atomix-glass"
|
|
7
|
-
style="--atomix-glass-radius: 16px; --atomix-glass-transform: translate(0px, 0px) scale(1); --atomix-glass-position: absolute; --atomix-glass-top: 0px; --atomix-glass-left: 0px; --atomix-glass-width: 100%; --atomix-glass-height: 100%; --atomix-glass-border-width: var(--atomix-spacing-0-5, 0.09375rem); --atomix-glass-blend-mode: overlay; --atomix-glass-border-gradient-1: linear-gradient(135deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.
|
|
7
|
+
style="--atomix-glass-radius: 16px; --atomix-glass-transform: translate(0px, 0px) scale(1); --atomix-glass-position: absolute; --atomix-glass-top: 0px; --atomix-glass-left: 0px; --atomix-glass-width: 100%; --atomix-glass-height: 100%; --atomix-glass-border-width: var(--atomix-spacing-0-5, 0.09375rem); --atomix-glass-blend-mode: overlay; --atomix-glass-border-gradient-1: linear-gradient(135deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.08399999999999999) 33%, rgba(255, 255, 255, 0.27999999999999997) 66%, rgba(255, 255, 255, 0) 100%); --atomix-glass-border-gradient-2: linear-gradient(135deg, rgba(255, 255, 255, 0) 0%, rgba(255, 255, 255, 0.22399999999999998) 33%, rgba(255, 255, 255, 0.42) 66%, rgba(255, 255, 255, 0) 100%); --atomix-glass-hover-1-opacity: 0; --atomix-glass-hover-1-gradient: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 0.5) 0%, rgba(255, 255, 255, 0) 50%); --atomix-glass-hover-2-opacity: 0; --atomix-glass-hover-2-gradient: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 80%); --atomix-glass-hover-3-opacity: 0; --atomix-glass-hover-3-gradient: radial-gradient(circle at 50% 50%, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%); --atomix-glass-base-opacity: 0; --atomix-glass-base-gradient: rgba(255, 255, 255, 0.1); --atomix-glass-overlay-opacity: 0; --atomix-glass-overlay-gradient: rgba(255, 255, 255, 0.05);"
|
|
8
8
|
>
|
|
9
9
|
<div
|
|
10
10
|
class="c-atomix-glass__container "
|
|
11
|
-
style="transform: translate(0px, 0px) scale(1); --atomix-glass-container-width: 270; --atomix-glass-container-height: 69; --atomix-glass-container-padding: 0 0; --atomix-glass-container-radius: 16px; --atomix-glass-container-backdrop: blur(1.2100000000000002px) saturate(160%) contrast(1.
|
|
11
|
+
style="transform: translate(0px, 0px) scale(1); --atomix-glass-container-width: 270; --atomix-glass-container-height: 69; --atomix-glass-container-padding: 0 0; --atomix-glass-container-radius: 16px; --atomix-glass-container-backdrop: blur(1.2100000000000002px) saturate(160%) contrast(1.4) brightness(0.9); --atomix-glass-container-shadow: 0 0 20px rgba(0, 0, 0, 0.15) inset, 0 4px 8px rgba(0, 0, 0, 0.08) inset; --atomix-glass-container-shadow-opacity: 1; --atomix-glass-container-bg: none; --atomix-glass-container-text-shadow: 0px 2px 12px rgba(0, 0, 0, 0.4); --atomix-glass-container-box-shadow: 0px 12px 40px rgba(0, 0, 0, 0.25); transition-duration: 0s !important; animation-duration: 0s !important; transition-delay: 0s;"
|
|
12
12
|
>
|
|
13
13
|
<div
|
|
14
14
|
class="c-atomix-glass__inner"
|
|
@@ -16,6 +16,7 @@ exports[`AtomixGlass Visual Regression > matches snapshot with default props 1`]
|
|
|
16
16
|
>
|
|
17
17
|
<div
|
|
18
18
|
class="c-atomix-glass__filter"
|
|
19
|
+
style="z-index: 1; position: absolute; inset: 0;"
|
|
19
20
|
>
|
|
20
21
|
<svg
|
|
21
22
|
aria-hidden="true"
|
|
@@ -25,7 +26,7 @@ exports[`AtomixGlass Visual Regression > matches snapshot with default props 1`]
|
|
|
25
26
|
<radialgradient
|
|
26
27
|
cx="50%"
|
|
27
28
|
cy="50%"
|
|
28
|
-
id="
|
|
29
|
+
id="atomix-glass-filter-14-edge-mask"
|
|
29
30
|
r="50%"
|
|
30
31
|
>
|
|
31
32
|
<stop
|
|
@@ -47,7 +48,7 @@ exports[`AtomixGlass Visual Regression > matches snapshot with default props 1`]
|
|
|
47
48
|
<filter
|
|
48
49
|
color-interpolation-filters="sRGB"
|
|
49
50
|
height="170%"
|
|
50
|
-
id="
|
|
51
|
+
id="atomix-glass-filter-14"
|
|
51
52
|
width="170%"
|
|
52
53
|
x="-35%"
|
|
53
54
|
y="-35%"
|
|
@@ -55,7 +56,7 @@ exports[`AtomixGlass Visual Regression > matches snapshot with default props 1`]
|
|
|
55
56
|
<feimage
|
|
56
57
|
height="100%"
|
|
57
58
|
href="data:image/jpeg;base64,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cUAUAkEkziomgGgkoxZGgxZFQFQlYnQHRdPfj/10KCSCKESCNiVkViPSLpD0h6I0Q0I0A2IoBWBIJIBKBIJoJIJ2R2J0JWBUJ0JUB0XTv479dFZDYiglYigkhEgjZFQjRFQjRFQjQigFYigHYigmgEgmglYlYnQlQlYlQHQlQnQ9P/kf1yVkNiNCNkNiVENiNiViNEViNkVCVgKCViViViSCViSCVgdCViVCViVCdgVCVCdD1D+U/XBWQ2I0I2Q2JUQ2I0JWQ0I2JUQ2JUI2JUI2J0JWJWJWA2R0BWJ0I2JUJ2BUJUJ0P//EABkQAQEBAQEBAAAAAAAAAAAAAAECABEDEP/aAAgBAQABAgB1atWrVq1atWrVq1atWrVq1atWrVq1atWrVq+OrVq1atWrVq1atWrVq1atWrVq1atWrVq1atXxVppppppdWrVq1atWrVq1NNNNNNNNNNNPVWmmmmms6tWrVq1atWpppppppppppppp6q0000uc51atWrVq1ammmmmmmmmmmmmt1Vpppc5znVq1atWrVqaaaaaaaaaaaaaeqtNLnOc51atWrVq1ammmmmmmmmmmmmnqrS5znOc6tWrVq16222mmmmmmlVppp6tKuc5znOrVq1a9TbbbbTTTTTSq000qtLnOc5zq1atWrW0222200000qqqtKqrnOc5zq1atTbbbbbbbbTTTSqqqqqq5znOc6tTTTbbbbbbbbTTTSqqqqrlVznOctNNNtttttttttNNNNKqqqrqznKqrTTTTbbbbbbbbbTTTSqqqqrqznOc5aaaabbbbbbbbbaaaaVVVVVdWc5znVq1NNttttttttttNNKqqqqudWc5znVq16tbbbbbbbbbbTTSqqqq5XVnOc6tWrVrb1tttttttttNNKqqqqrWrK5VWmmm2230bbbbbbaaaXOc5zlVa1KuVVppptttt9G22222mmlzlVznK6tWVVWmmmm2222222222mlznOc5znLWppVVWmmm22222229bTWrOc5znOcq1qaaVpWmm222222229erVqznOc5znKtatStK0rTbTTbbbberXr1as5znOc5aVpppppWlabaabbbb1ta9WrVnOc5znU0rTTTTTTTTTbTTbbbTWvVq1as5znOdTTStNNNNNNNNNtNNtttN6tWvVq1ZznOrU00rTTTTTTTTTTTTTbTWvVq1atWrOc6tTTTStNNNNNNNNNNtNNtNa9WrVq1Z1Z1NNNNNK1q1NNNNNNNNNNNtNatWrVq1atWrU00000rWrVq1atWrVq1alaaa1atWrVq1NNNammmmla1atWrVq1aterVq16tWrVnVqa1NK1qaaaVX/xAAWEAADAAAAAAAAAAAAAAAAAAAhgJD/2gAIAQEAAz8AaExf/8QAGhEBAQEBAQEBAAAAAAAAAAAAAQISEQADEP/aAAgBAgEBAgDx48ePHjx48ePHjx48ePHjx48ePHjx48ePHj86IiIiIiInjx48ePHjx48IiIiIj0oooooooooRERER73ve60UUUUUUVrWiiiiiihERERER73ve97ooooorRWiiiiihKERERER73ve973RRRRWtFFFFFFCIiIiIiPe973ve60UUVrRRRRRRQiIlCIiI973ve973pRRWiiiiiiiiiiiiiiihEe973ve973RRWtFFFFFFFFFFFFFFFFFFa13ve973WitaKKKKKKKKKKKKKKKKKK1rWtd1rutFa1oooooooooooosssooorWta1rWta1rRRRRRRRRRRZZZZZZZZZWta1rWta1rRRRRRRRRZZZZZZZZZZZZe9a1rWta1rWitaKLLLLLLLLLLLLLLLLL3rWta1rWtFbLLLLLLLLLLLLLLLLLLLL3vWta1rWita1ssssssss+hZZZZZZZZe961rWta0Vre97LLLLLLLLLLLPoWWWWWXrWta1oorWta3ssss+hZZZZ9Cyyyyyyyyiita1orWta1ve9llllllllllllllllFFa0VorWta1ve9llllllllllllllllllFFFaK1rWta1rWiyyyyyyyyyyyyiiiiiiitFFa1rWta1oosoosssssoooosoooorRRRWta1rWta0UUUUUWUUUUUUUUUUUVoooorWta1rWtaKKKKKKmiiiiiiiiiiiiiiitd73ve61oSiiipoqaKKKKKKKKKK0UUUVrve973vREREZoSihEooooorRRRRWtd73ve9EREREREoSiiiiitFllllla73ve9ERERERESiiiiiitH0PoWWWWVrXe96IiIiMoiJRRRRRRWjwlFFllllFFd6IiIiIlCUUUUUUUUUePHjx48ePCIiIiIiIiUUUUUUUUUUUePHjx48ePHjx48ePHjx48IiUUUUUUJRRRX//xAAWEQADAAAAAAAAAAAAAAAAAAABYJD/2gAIAQIBAz8AtEV7/8QAFxEBAQEBAAAAAAAAAAAAAAAAAAECEP/aAAgBAwEBAgCtNNNNNNNNNNNNNNNNNNNNNNNNNNNNNcrTTTTTTTTTTTTTTTTTTTTTTTTTTTTTXKrTTTTTTTU000000000000000000001FVpppppqampqaaaaaaaaaaaaaaaaaaaa5Vaaaaampqampqammmmmmmmmmmlaaaaaaiq0001NTU1NTU1NTTTTTTTTTTSqqtNNNcqtNNSyzU1LNTU1NTTTTTTTTTSqqq001ytNLLLLNTU1NTU1NTbbbTTTTTSqqq001ytNLLLLLNTU1NTU3NttttNNNNNKqq001KrSyyyyyzU1NTU3Nzc02220000qqqqrSqqyyyyyzU1NTU3Nzc3NttttNNNKqqqqqqssssss1NTU3Nzc3NzbbbbTTTSqqqqqqrLLLLLNTU1Nzc3Nzc22220000qqqqqqqqssss1NTU3Nzc3NzbbbbbTTSqqqqqqqqqqzU1NTc3Nzc3Nzbc22000qqqqqqqqqqqtTU3Nzc3Nzc3NtzbTTSqqqqrKqqqqqtNNzc23Nzc3Nzc3NTU1KqqqrKqqqqqtNNNNttzc3Nzc3NzU1NLLLLLKqqqqqqqq0022223Nzc3NzU1NSyyyyyyqqqqqqqrTTbbbbc3Nzc3NTU1LLLLLLKsqqqqqqrTTTTbbbc3Nzc1NTUsssssssqqqqqqrTTTTTbbbTc3NTU1NTUsssssqqqqqqqq0000222023NTU1NTUsssssqqqqqqqq000000003NTU1NTU1LLLLLNKrTSqqqqtNNNNNNtNNTU1NSzUssss00qq0qqqqrTTTTTTTTTU1NTUs1LLLNNNKrTTTSqqq00000000001NTU1LNTU0000qtNNNKqqqtNNNNNNNNTU1NTUs1NNNNNKss1NNNK00qtK0000001NNTU0s000000qq000001NKrStNNNNK1NNNNStNNNNNKqtNNNNNNNK0000000rU0000rTTTTTSq00000rTTTTTTTTTTTTTTTTStNNNNKr/xAAUEQEAAAAAAAAAAAAAAAAAAACg/9oACAEDAQM/AAAf/9k="
|
|
58
|
-
id="
|
|
59
|
+
id="atomix-glass-filter-14-image"
|
|
59
60
|
preserveAspectRatio="xMidYMid slice"
|
|
60
61
|
result="DISPLACEMENT_MAP"
|
|
61
62
|
width="100%"
|
|
@@ -185,11 +186,11 @@ exports[`AtomixGlass Visual Regression > matches snapshot with default props 1`]
|
|
|
185
186
|
</svg>
|
|
186
187
|
<div
|
|
187
188
|
class="c-atomix-glass__filter-overlay"
|
|
188
|
-
style="filter: url(
|
|
189
|
+
style="filter: url(#atomix-glass-filter-14); border-radius: var(--atomix-glass-container-radius); transition-duration: 0s !important; animation-duration: 0s !important; transition-delay: 0s;"
|
|
189
190
|
/>
|
|
190
191
|
<div
|
|
191
192
|
class="c-atomix-glass__filter-shadow"
|
|
192
|
-
style="box-shadow: var(--atomix-glass-container-shadow); border-radius: var(--atomix-glass-radius);"
|
|
193
|
+
style="box-shadow: var(--atomix-glass-container-shadow); border-radius: var(--atomix-glass-container-radius);"
|
|
193
194
|
/>
|
|
194
195
|
</div>
|
|
195
196
|
<div
|
|
@@ -44,9 +44,11 @@ export const calculateMouseInfluence = (mouseOffset: MousePosition): number => {
|
|
|
44
44
|
if (!mouseOffset || typeof mouseOffset.x !== 'number' || typeof mouseOffset.y !== 'number') {
|
|
45
45
|
return 0;
|
|
46
46
|
}
|
|
47
|
-
//
|
|
48
|
-
const influence =
|
|
49
|
-
|
|
47
|
+
// Bounded calculation — keeps the glass effect subtle and stable
|
|
48
|
+
const influence =
|
|
49
|
+
Math.sqrt(mouseOffset.x * mouseOffset.x + mouseOffset.y * mouseOffset.y) /
|
|
50
|
+
CONSTANTS.MOUSE_INFLUENCE_DIVISOR;
|
|
51
|
+
return Math.min(0.8, influence); // Tighter cap to prevent blur/filter blow-out
|
|
50
52
|
};
|
|
51
53
|
|
|
52
54
|
/**
|
|
@@ -59,7 +61,7 @@ export const calculateOverLightIntensity = (
|
|
|
59
61
|
if (!mouseOffset || typeof mouseOffset.x !== 'number' || typeof mouseOffset.y !== 'number') {
|
|
60
62
|
return baseIntensity;
|
|
61
63
|
}
|
|
62
|
-
|
|
64
|
+
|
|
63
65
|
// Calculate additional intensity based on mouse position
|
|
64
66
|
const mouseInfluence = calculateMouseInfluence(mouseOffset);
|
|
65
67
|
return Math.min(1.0, baseIntensity * (1 + mouseInfluence * 0.3));
|
|
@@ -260,4 +262,3 @@ export const getDisplacementMap = (
|
|
|
260
262
|
return displacementMap;
|
|
261
263
|
}
|
|
262
264
|
};
|
|
263
|
-
|