@shohojdhara/atomix 0.3.3 → 0.3.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +46 -28
- package/dist/atomix.css +15 -9
- package/dist/atomix.css.map +1 -0
- package/dist/atomix.min.css +15108 -11
- package/dist/atomix.min.css.map +1 -0
- package/dist/charts.d.ts +1929 -0
- package/dist/charts.js +6482 -0
- package/dist/charts.js.map +1 -0
- package/dist/core.d.ts +1289 -0
- package/dist/core.js +3357 -0
- package/dist/core.js.map +1 -0
- package/dist/forms.d.ts +1085 -0
- package/dist/forms.js +2450 -0
- package/dist/forms.js.map +1 -0
- package/dist/heavy.d.ts +636 -0
- package/dist/heavy.js +4550 -0
- package/dist/heavy.js.map +1 -0
- package/dist/index.d.ts +5196 -4618
- package/dist/index.esm.js +4240 -2776
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +4057 -2571
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/layout.d.ts +300 -0
- package/dist/layout.js +336 -0
- package/dist/layout.js.map +1 -0
- package/dist/theme.d.ts +1992 -0
- package/dist/theme.js +5348 -0
- package/dist/theme.js.map +1 -0
- package/package.json +63 -68
- package/scripts/atomix-cli.js +879 -15
- package/scripts/cli/__tests__/cli-commands.test.js +204 -0
- package/scripts/cli/__tests__/utils.test.js +201 -0
- package/scripts/cli/__tests__/vitest.config.js +26 -0
- package/scripts/cli/interactive-init.js +37 -45
- package/scripts/cli/theme-bridge.js +129 -0
- package/scripts/cli/token-manager.js +32 -7
- package/scripts/cli/utils.js +347 -0
- package/scripts/sync-theme-config.js +22 -22
- package/src/components/Accordion/Accordion.tsx +5 -54
- package/src/components/Accordion/index.ts +1 -1
- package/src/components/Avatar/Avatar.tsx +3 -3
- package/src/components/Badge/Badge.tsx +3 -3
- package/src/components/Breadcrumb/Breadcrumb.tsx +3 -3
- package/src/components/Button/Button.tsx +36 -1
- package/src/components/Card/ElevationCard.tsx +1 -1
- package/src/components/Chart/AnimatedChart.tsx +19 -17
- package/src/components/Chart/AreaChart.tsx +5 -1
- package/src/components/Chart/BarChart.tsx +1 -0
- package/src/components/Chart/BubbleChart.tsx +6 -5
- package/src/components/Chart/ChartToolbar.tsx +1 -0
- package/src/components/Chart/FunnelChart.tsx +1 -1
- package/src/components/Chart/RadarChart.tsx +19 -12
- package/src/components/Chart/ScatterChart.tsx +3 -3
- package/src/components/Chart/TreemapChart.tsx +2 -1
- package/src/components/Chart/WaterfallChart.tsx +0 -1
- package/src/components/Chart/types.ts +12 -2
- package/src/components/Chart/utils.ts +4 -3
- package/src/components/DataTable/DataTable.tsx +3 -3
- package/src/components/Dropdown/Dropdown.tsx +12 -9
- package/src/components/Footer/FooterSection.tsx +3 -3
- package/src/components/Form/Checkbox.tsx +3 -3
- package/src/components/Form/Input.tsx +4 -2
- package/src/components/Form/Radio.tsx +3 -3
- package/src/components/Form/Select.tsx +3 -3
- package/src/components/Form/Textarea.tsx +4 -2
- package/src/components/List/List.stories.tsx +3 -3
- package/src/components/List/List.tsx +3 -3
- package/src/components/List/ListGroup.tsx +3 -1
- package/src/components/Modal/Modal.tsx +3 -3
- package/src/components/Navigation/Menu/MegaMenu.tsx +9 -3
- package/src/components/Navigation/Menu/Menu.tsx +9 -3
- package/src/components/Pagination/Pagination.tsx +6 -5
- package/src/components/PhotoViewer/PhotoViewerImage.tsx +2 -2
- package/src/components/Popover/Popover.tsx +4 -4
- package/src/components/Progress/Progress.tsx +6 -2
- package/src/components/Rating/Rating.tsx +5 -2
- package/src/components/Slider/Slider.tsx +10 -9
- package/src/components/Spinner/Spinner.tsx +3 -3
- package/src/components/Tabs/Tabs.tsx +3 -3
- package/src/components/Tooltip/Tooltip.tsx +3 -3
- package/src/components/index.ts +5 -2
- package/src/layouts/MasonryGrid/MasonryGrid.tsx +2 -2
- package/src/lib/composables/useChartPerformance.ts +102 -78
- package/src/lib/composables/useChartScale.ts +10 -0
- package/src/lib/composables/useHero.ts +9 -2
- package/src/lib/composables/useHeroBackgroundSlider.ts +5 -3
- package/src/lib/composables/useSideMenu.ts +1 -0
- package/src/lib/composables/useVideoPlayer.ts +3 -2
- package/src/lib/config/index.ts +275 -0
- package/src/lib/config/loader.ts +147 -0
- package/src/lib/hooks/index.ts +0 -1
- package/src/lib/hooks/useComponentCustomization.ts +10 -14
- package/src/lib/hooks/usePerformanceMonitor.ts +149 -0
- package/src/lib/index.ts +1 -0
- package/src/lib/patterns/index.ts +2 -2
- package/src/lib/patterns/slots.tsx +2 -2
- package/src/lib/theme/composeTheme.ts +1 -6
- package/src/lib/theme/config/index.ts +1 -1
- package/src/lib/theme/config/loader.ts +75 -41
- package/src/lib/theme/config/types.ts +21 -7
- package/src/lib/theme/config/validator.ts +1 -1
- package/src/lib/theme/constants.ts +12 -2
- package/src/lib/theme/core/ThemeEngine.ts +8 -0
- package/src/lib/theme/core/ThemeValidator.ts +5 -2
- package/src/lib/theme/createTheme.ts +0 -1
- package/src/lib/theme/createThemeFromConfig.ts +132 -0
- package/src/lib/theme/devtools/CLI.ts +161 -76
- package/src/lib/theme/devtools/Comparator.tsx +343 -0
- package/src/lib/theme/devtools/IMPROVEMENTS.md +429 -0
- package/src/lib/theme/devtools/Inspector.tsx +22 -7
- package/src/lib/theme/devtools/LiveEditor.tsx +399 -0
- package/src/lib/theme/devtools/README.md +433 -0
- package/src/lib/theme/devtools/index.ts +12 -11
- package/src/lib/theme/generateCSSVariables.ts +80 -39
- package/src/lib/theme/i18n/rtl.ts +2 -1
- package/src/lib/theme/index.ts +18 -2
- package/src/lib/theme/runtime/ThemeApplicator.ts +28 -11
- package/src/lib/theme/runtime/ThemeErrorBoundary.tsx +3 -3
- package/src/lib/theme/runtime/ThemeManager.test.ts +17 -1
- package/src/lib/theme/runtime/ThemeManager.ts +11 -7
- package/src/lib/theme/types.ts +42 -43
- package/src/lib/theme-tools.ts +8 -68
- package/src/lib/types/components.ts +252 -109
- package/src/lib/types/partProps.ts +0 -16
- package/src/lib/utils/fontPreloader.ts +148 -0
- package/src/lib/utils/index.ts +11 -0
- package/src/lib/utils/memoryMonitor.ts +189 -0
- package/src/styles/01-settings/_settings.fonts.scss +2 -5
- package/src/styles/01-settings/_settings.navbar.scss +1 -1
- package/src/styles/03-generic/_generated-root.css +26 -0
- package/src/styles/06-components/_components.navbar.scss +6 -5
- package/src/themes/README.md +1 -2
- package/src/themes/themes.config.js +30 -181
- package/dist/themes/applemix.css +0 -16576
- package/dist/themes/applemix.css.map +0 -1
- package/dist/themes/applemix.min.css +0 -73
- package/dist/themes/boomdevs.css +0 -16007
- package/dist/themes/boomdevs.css.map +0 -1
- package/dist/themes/boomdevs.min.css +0 -406
- package/dist/themes/esrar.css +0 -18424
- package/dist/themes/esrar.css.map +0 -1
- package/dist/themes/esrar.min.css +0 -221
- package/dist/themes/flashtrade.css +0 -17596
- package/dist/themes/flashtrade.css.map +0 -1
- package/dist/themes/flashtrade.min.css +0 -196
- package/dist/themes/mashroom.css +0 -31082
- package/dist/themes/mashroom.css.map +0 -1
- package/dist/themes/mashroom.min.css +0 -450
- package/dist/themes/shaj-default.css +0 -17200
- package/dist/themes/shaj-default.css.map +0 -1
- package/dist/themes/shaj-default.min.css +0 -502
- package/scripts/build-themes.js +0 -208
- package/src/components/AtomixGlass/atomixGLass.old.tsx +0 -1263
- package/src/lib/theme/__tests__/ThemeBuilder.test.ts +0 -223
- package/src/lib/theme/builders/ThemeBuilder.ts +0 -372
- package/src/lib/theme/errors.test.ts +0 -207
- package/src/lib/theme/generators/CSSGenerator.ts +0 -311
- package/src/lib/theme/generators/ConfigGenerator.ts +0 -287
- package/src/lib/theme/generators/TypeGenerator.ts +0 -228
- package/src/lib/theme/generators/index.ts +0 -21
- package/src/lib/theme/monitoring/ThemeAnalytics.ts +0 -409
- package/src/lib/theme/monitoring/index.ts +0 -17
- package/src/lib/theme/overrides/ComponentOverrides.ts +0 -243
- package/src/lib/theme/overrides/index.ts +0 -15
- package/src/lib/theme/whitelabel/WhiteLabelManager.ts +0 -364
- package/src/lib/theme/whitelabel/index.ts +0 -13
- package/src/themes/THEME_CHECKLIST.md +0 -74
- package/src/themes/applemix/01-settings/_index.scss +0 -24
- package/src/themes/applemix/01-settings/_settings.animations.scss +0 -0
- package/src/themes/applemix/01-settings/_settings.background.scss +0 -6
- package/src/themes/applemix/01-settings/_settings.colors.scss +0 -75
- package/src/themes/applemix/01-settings/_settings.config.scss +0 -15
- package/src/themes/applemix/01-settings/_settings.typography.scss +0 -30
- package/src/themes/applemix/02-tools/_index.scss +0 -4
- package/src/themes/applemix/03-generic/_index.scss +0 -7
- package/src/themes/applemix/04-elements/_index.scss +0 -7
- package/src/themes/applemix/05-objects/_index.scss +0 -7
- package/src/themes/applemix/06-components/_index.scss +0 -15
- package/src/themes/applemix/99-utilities/_index.scss +0 -7
- package/src/themes/applemix/README.md +0 -378
- package/src/themes/applemix/index.scss +0 -33
- package/src/themes/boomdevs/01-settings/_index.scss +0 -38
- package/src/themes/boomdevs/01-settings/_settings.accordion.scss +0 -12
- package/src/themes/boomdevs/01-settings/_settings.animations.scss +0 -11
- package/src/themes/boomdevs/01-settings/_settings.avatar.scss +0 -9
- package/src/themes/boomdevs/01-settings/_settings.badge.scss +0 -11
- package/src/themes/boomdevs/01-settings/_settings.border-radius.scss +0 -16
- package/src/themes/boomdevs/01-settings/_settings.border.scss +0 -10
- package/src/themes/boomdevs/01-settings/_settings.box-shadow.scss +0 -14
- package/src/themes/boomdevs/01-settings/_settings.breadcrumb.scss +0 -13
- package/src/themes/boomdevs/01-settings/_settings.breakpoints.scss +0 -15
- package/src/themes/boomdevs/01-settings/_settings.button.scss +0 -9
- package/src/themes/boomdevs/01-settings/_settings.callout.scss +0 -9
- package/src/themes/boomdevs/01-settings/_settings.card.scss +0 -11
- package/src/themes/boomdevs/01-settings/_settings.checkbox.scss +0 -9
- package/src/themes/boomdevs/01-settings/_settings.colors.scss +0 -145
- package/src/themes/boomdevs/01-settings/_settings.dropdown.scss +0 -11
- package/src/themes/boomdevs/01-settings/_settings.grid.scss +0 -16
- package/src/themes/boomdevs/01-settings/_settings.input.scss +0 -14
- package/src/themes/boomdevs/01-settings/_settings.link.scss +0 -11
- package/src/themes/boomdevs/01-settings/_settings.list.scss +0 -10
- package/src/themes/boomdevs/01-settings/_settings.modal.scss +0 -16
- package/src/themes/boomdevs/01-settings/_settings.navbar.scss +0 -16
- package/src/themes/boomdevs/01-settings/_settings.pagination.scss +0 -13
- package/src/themes/boomdevs/01-settings/_settings.progress.scss +0 -11
- package/src/themes/boomdevs/01-settings/_settings.rating.scss +0 -10
- package/src/themes/boomdevs/01-settings/_settings.spacing.scss +0 -33
- package/src/themes/boomdevs/01-settings/_settings.spinner.scss +0 -11
- package/src/themes/boomdevs/01-settings/_settings.steps.scss +0 -12
- package/src/themes/boomdevs/01-settings/_settings.tabs.scss +0 -12
- package/src/themes/boomdevs/01-settings/_settings.todo.scss +0 -15
- package/src/themes/boomdevs/01-settings/_settings.toggle.scss +0 -14
- package/src/themes/boomdevs/01-settings/_settings.tooltip.scss +0 -13
- package/src/themes/boomdevs/01-settings/_settings.typography.scss +0 -58
- package/src/themes/boomdevs/01-settings/_settings.video-player.scss +0 -12
- package/src/themes/boomdevs/02-tools/_index.scss +0 -7
- package/src/themes/boomdevs/03-generic/_index.scss +0 -7
- package/src/themes/boomdevs/04-elements/_index.scss +0 -7
- package/src/themes/boomdevs/05-objects/_index.scss +0 -7
- package/src/themes/boomdevs/06-components/_components.button.scss +0 -11
- package/src/themes/boomdevs/06-components/_index.scss +0 -11
- package/src/themes/boomdevs/99-utilities/_index.scss +0 -7
- package/src/themes/boomdevs/index.scss +0 -26
- package/src/themes/esrar/01-settings/_index.scss +0 -15
- package/src/themes/esrar/01-settings/_settings.colors.scss +0 -91
- package/src/themes/esrar/02-tools/_index.scss +0 -8
- package/src/themes/esrar/02-tools/_tools.animations.scss +0 -342
- package/src/themes/esrar/06-components/_components.accordion.scss +0 -49
- package/src/themes/esrar/06-components/_components.avatar-group.scss +0 -14
- package/src/themes/esrar/06-components/_components.avatar.scss +0 -61
- package/src/themes/esrar/06-components/_components.badge.scss +0 -117
- package/src/themes/esrar/06-components/_components.breadcrumb.scss +0 -65
- package/src/themes/esrar/06-components/_components.btn-group.scss +0 -19
- package/src/themes/esrar/06-components/_components.button.scss +0 -224
- package/src/themes/esrar/06-components/_components.callout.scss +0 -51
- package/src/themes/esrar/06-components/_components.card.scss +0 -134
- package/src/themes/esrar/06-components/_components.chart.scss +0 -24
- package/src/themes/esrar/06-components/_components.checkbox-group.scss +0 -26
- package/src/themes/esrar/06-components/_components.checkbox.scss +0 -71
- package/src/themes/esrar/06-components/_components.color-mode-toggle.scss +0 -29
- package/src/themes/esrar/06-components/_components.countdown.scss +0 -67
- package/src/themes/esrar/06-components/_components.data-table.scss +0 -22
- package/src/themes/esrar/06-components/_components.datepicker.scss +0 -20
- package/src/themes/esrar/06-components/_components.dropdown.scss +0 -272
- package/src/themes/esrar/06-components/_components.edge-panel.scss +0 -10
- package/src/themes/esrar/06-components/_components.form-group.scss +0 -15
- package/src/themes/esrar/06-components/_components.form.scss +0 -66
- package/src/themes/esrar/06-components/_components.hero.scss +0 -251
- package/src/themes/esrar/06-components/_components.icon.scss +0 -33
- package/src/themes/esrar/06-components/_components.image-gallery.scss +0 -29
- package/src/themes/esrar/06-components/_components.input.scss +0 -91
- package/src/themes/esrar/06-components/_components.list-group.scss +0 -26
- package/src/themes/esrar/06-components/_components.modal.scss +0 -148
- package/src/themes/esrar/06-components/_components.notification.scss +0 -80
- package/src/themes/esrar/06-components/_components.pagination.scss +0 -84
- package/src/themes/esrar/06-components/_components.popover.scss +0 -10
- package/src/themes/esrar/06-components/_components.progress.scss +0 -64
- package/src/themes/esrar/06-components/_components.rating.scss +0 -26
- package/src/themes/esrar/06-components/_components.skeleton.scss +0 -15
- package/src/themes/esrar/06-components/_components.slider.scss +0 -90
- package/src/themes/esrar/06-components/_components.spinner.scss +0 -71
- package/src/themes/esrar/06-components/_components.steps.scss +0 -76
- package/src/themes/esrar/06-components/_components.tab.scss +0 -58
- package/src/themes/esrar/06-components/_components.tag.scss +0 -21
- package/src/themes/esrar/06-components/_components.timeline.scss +0 -19
- package/src/themes/esrar/06-components/_components.toast.scss +0 -91
- package/src/themes/esrar/06-components/_components.toggle.scss +0 -74
- package/src/themes/esrar/06-components/_components.tooltip.scss +0 -45
- package/src/themes/esrar/06-components/_components.upload.scss +0 -102
- package/src/themes/esrar/06-components/_index.scss +0 -42
- package/src/themes/esrar/index.scss +0 -30
- package/src/themes/flashtrade/01-settings/_index.scss +0 -19
- package/src/themes/flashtrade/01-settings/_settings.animations.scss +0 -11
- package/src/themes/flashtrade/01-settings/_settings.background.scss +0 -9
- package/src/themes/flashtrade/01-settings/_settings.colors.scss +0 -79
- package/src/themes/flashtrade/01-settings/_settings.config.scss +0 -16
- package/src/themes/flashtrade/01-settings/_settings.typography.scss +0 -35
- package/src/themes/flashtrade/02-tools/_index.scss +0 -8
- package/src/themes/flashtrade/03-generic/_index.scss +0 -8
- package/src/themes/flashtrade/04-elements/_index.scss +0 -12
- package/src/themes/flashtrade/05-objects/_index.scss +0 -8
- package/src/themes/flashtrade/06-components/_components.badge.scss +0 -156
- package/src/themes/flashtrade/06-components/_components.button.scss +0 -135
- package/src/themes/flashtrade/06-components/_components.card.scss +0 -214
- package/src/themes/flashtrade/06-components/_components.navbar.scss +0 -227
- package/src/themes/flashtrade/06-components/_index.scss +0 -13
- package/src/themes/flashtrade/99-utilities/_index.scss +0 -9
- package/src/themes/flashtrade/99-utilities/_utilities.trading.scss +0 -187
- package/src/themes/flashtrade/README.md +0 -386
- package/src/themes/flashtrade/demo.html +0 -272
- package/src/themes/flashtrade/index.scss +0 -36
- package/src/themes/mashroom/01-settings/_index.scss +0 -69
- package/src/themes/mashroom/01-settings/_settings.accordion.scss +0 -32
- package/src/themes/mashroom/01-settings/_settings.animations.scss +0 -26
- package/src/themes/mashroom/01-settings/_settings.avatar-group.scss +0 -22
- package/src/themes/mashroom/01-settings/_settings.avatar.scss +0 -57
- package/src/themes/mashroom/01-settings/_settings.badge.scss +0 -19
- package/src/themes/mashroom/01-settings/_settings.border-radius.scss +0 -24
- package/src/themes/mashroom/01-settings/_settings.border.scss +0 -14
- package/src/themes/mashroom/01-settings/_settings.box-shadow.scss +0 -40
- package/src/themes/mashroom/01-settings/_settings.breadcrumb.scss +0 -0
- package/src/themes/mashroom/01-settings/_settings.breakpoints.scss +0 -17
- package/src/themes/mashroom/01-settings/_settings.btn-group.scss +0 -5
- package/src/themes/mashroom/01-settings/_settings.button.scss +0 -50
- package/src/themes/mashroom/01-settings/_settings.callout.scss +0 -81
- package/src/themes/mashroom/01-settings/_settings.card.scss +0 -52
- package/src/themes/mashroom/01-settings/_settings.checkbox-group.scss +0 -5
- package/src/themes/mashroom/01-settings/_settings.checkbox.scss +0 -23
- package/src/themes/mashroom/01-settings/_settings.color-mode.scss +0 -7
- package/src/themes/mashroom/01-settings/_settings.colors.scss +0 -180
- package/src/themes/mashroom/01-settings/_settings.config.scss +0 -4
- package/src/themes/mashroom/01-settings/_settings.countdown.scss +0 -20
- package/src/themes/mashroom/01-settings/_settings.data-table.scss +0 -56
- package/src/themes/mashroom/01-settings/_settings.datepicker.scss +0 -45
- package/src/themes/mashroom/01-settings/_settings.design-tokens.scss +0 -3
- package/src/themes/mashroom/01-settings/_settings.dropdown.scss +0 -45
- package/src/themes/mashroom/01-settings/_settings.edge-panel.scss +0 -24
- package/src/themes/mashroom/01-settings/_settings.fonts.scss +0 -8
- package/src/themes/mashroom/01-settings/_settings.form-group.scss +0 -14
- package/src/themes/mashroom/01-settings/_settings.form.scss +0 -6
- package/src/themes/mashroom/01-settings/_settings.grid.scss +0 -23
- package/src/themes/mashroom/01-settings/_settings.hero.scss +0 -41
- package/src/themes/mashroom/01-settings/_settings.input.scss +0 -51
- package/src/themes/mashroom/01-settings/_settings.link.scss +0 -13
- package/src/themes/mashroom/01-settings/_settings.list-group.scss +0 -16
- package/src/themes/mashroom/01-settings/_settings.list.scss +0 -13
- package/src/themes/mashroom/01-settings/_settings.masonry-grid.scss +0 -23
- package/src/themes/mashroom/01-settings/_settings.menu.scss +0 -50
- package/src/themes/mashroom/01-settings/_settings.messages.scss +0 -98
- package/src/themes/mashroom/01-settings/_settings.modal.scss +0 -41
- package/src/themes/mashroom/01-settings/_settings.nav.scss +0 -20
- package/src/themes/mashroom/01-settings/_settings.navbar.scss +0 -54
- package/src/themes/mashroom/01-settings/_settings.pagination.scss +0 -30
- package/src/themes/mashroom/01-settings/_settings.photoviewer.scss +0 -45
- package/src/themes/mashroom/01-settings/_settings.popover.scss +0 -20
- package/src/themes/mashroom/01-settings/_settings.position.scss +0 -9
- package/src/themes/mashroom/01-settings/_settings.progress.scss +0 -17
- package/src/themes/mashroom/01-settings/_settings.rating.scss +0 -11
- package/src/themes/mashroom/01-settings/_settings.river.scss +0 -50
- package/src/themes/mashroom/01-settings/_settings.sectionintro.scss +0 -31
- package/src/themes/mashroom/01-settings/_settings.select.scss +0 -47
- package/src/themes/mashroom/01-settings/_settings.side-menu.scss +0 -79
- package/src/themes/mashroom/01-settings/_settings.skeleton.scss +0 -24
- package/src/themes/mashroom/01-settings/_settings.spacing.scss +0 -66
- package/src/themes/mashroom/01-settings/_settings.spinner.scss +0 -34
- package/src/themes/mashroom/01-settings/_settings.steps.scss +0 -33
- package/src/themes/mashroom/01-settings/_settings.tabs.scss +0 -33
- package/src/themes/mashroom/01-settings/_settings.testimonials.scss +0 -24
- package/src/themes/mashroom/01-settings/_settings.todo.scss +0 -52
- package/src/themes/mashroom/01-settings/_settings.toggle.scss +0 -49
- package/src/themes/mashroom/01-settings/_settings.tooltip.scss +0 -20
- package/src/themes/mashroom/01-settings/_settings.typography.scss +0 -95
- package/src/themes/mashroom/01-settings/_settings.upload.scss +0 -96
- package/src/themes/mashroom/01-settings/_settings.z-layers.scss +0 -19
- package/src/themes/mashroom/02-tools/_index.scss +0 -8
- package/src/themes/mashroom/02-tools/_tools.psychedelic-gradients.scss +0 -78
- package/src/themes/mashroom/02-tools/_tools.trippy-effects.scss +0 -114
- package/src/themes/mashroom/03-generic/_index.scss +0 -6
- package/src/themes/mashroom/04-elements/_index.scss +0 -6
- package/src/themes/mashroom/05-objects/_index.scss +0 -6
- package/src/themes/mashroom/06-components/_components.accordion.scss +0 -187
- package/src/themes/mashroom/06-components/_components.avatar-group.scss +0 -276
- package/src/themes/mashroom/06-components/_components.avatar.scss +0 -114
- package/src/themes/mashroom/06-components/_components.badge.scss +0 -152
- package/src/themes/mashroom/06-components/_components.breadcrumb.scss +0 -162
- package/src/themes/mashroom/06-components/_components.btn-group.scss +0 -404
- package/src/themes/mashroom/06-components/_components.button.scss +0 -160
- package/src/themes/mashroom/06-components/_components.callout.scss +0 -140
- package/src/themes/mashroom/06-components/_components.card.scss +0 -225
- package/src/themes/mashroom/06-components/_components.checkbox.scss +0 -186
- package/src/themes/mashroom/06-components/_components.color-mode-toggle.scss +0 -308
- package/src/themes/mashroom/06-components/_components.countdown.scss +0 -402
- package/src/themes/mashroom/06-components/_components.data-table.scss +0 -354
- package/src/themes/mashroom/06-components/_components.datepicker.scss +0 -349
- package/src/themes/mashroom/06-components/_components.dropdown.scss +0 -334
- package/src/themes/mashroom/06-components/_components.edge-panel.scss +0 -413
- package/src/themes/mashroom/06-components/_components.form-group.scss +0 -433
- package/src/themes/mashroom/06-components/_components.form.scss +0 -358
- package/src/themes/mashroom/06-components/_components.hero.scss +0 -151
- package/src/themes/mashroom/06-components/_components.input.scss +0 -147
- package/src/themes/mashroom/06-components/_components.list-group.scss +0 -456
- package/src/themes/mashroom/06-components/_components.list.scss +0 -145
- package/src/themes/mashroom/06-components/_components.menu.scss +0 -497
- package/src/themes/mashroom/06-components/_components.messages.scss +0 -277
- package/src/themes/mashroom/06-components/_components.modal.scss +0 -264
- package/src/themes/mashroom/06-components/_components.nav.scss +0 -181
- package/src/themes/mashroom/06-components/_components.navbar.scss +0 -538
- package/src/themes/mashroom/06-components/_components.pagination.scss +0 -400
- package/src/themes/mashroom/06-components/_components.photoviewer.scss +0 -498
- package/src/themes/mashroom/06-components/_components.popover.scss +0 -383
- package/src/themes/mashroom/06-components/_components.product-review.scss +0 -408
- package/src/themes/mashroom/06-components/_components.progress.scss +0 -249
- package/src/themes/mashroom/06-components/_components.rating.scss +0 -300
- package/src/themes/mashroom/06-components/_components.river.scss +0 -570
- package/src/themes/mashroom/06-components/_components.sectionintro.scss +0 -546
- package/src/themes/mashroom/06-components/_components.select.scss +0 -455
- package/src/themes/mashroom/06-components/_components.side-menu.scss +0 -635
- package/src/themes/mashroom/06-components/_components.skeleton.scss +0 -447
- package/src/themes/mashroom/06-components/_components.slider.scss +0 -414
- package/src/themes/mashroom/06-components/_components.spinner.scss +0 -198
- package/src/themes/mashroom/06-components/_components.steps.scss +0 -350
- package/src/themes/mashroom/06-components/_components.tabs.scss +0 -269
- package/src/themes/mashroom/06-components/_components.testimonials.scss +0 -561
- package/src/themes/mashroom/06-components/_components.toggle.scss +0 -231
- package/src/themes/mashroom/06-components/_components.tooltip.scss +0 -167
- package/src/themes/mashroom/06-components/_components.upload.scss +0 -537
- package/src/themes/mashroom/06-components/_components.video-player.scss +0 -560
- package/src/themes/mashroom/06-components/_index.scss +0 -55
- package/src/themes/mashroom/99-utilities/_index.scss +0 -6
- package/src/themes/mashroom/index.scss +0 -26
- package/src/themes/shaj-default/01-settings/_index.scss +0 -69
- package/src/themes/shaj-default/01-settings/_settings.accordion.scss +0 -38
- package/src/themes/shaj-default/01-settings/_settings.animations.scss +0 -32
- package/src/themes/shaj-default/01-settings/_settings.avatar-group.scss +0 -28
- package/src/themes/shaj-default/01-settings/_settings.avatar.scss +0 -63
- package/src/themes/shaj-default/01-settings/_settings.badge.scss +0 -25
- package/src/themes/shaj-default/01-settings/_settings.border-radius.scss +0 -24
- package/src/themes/shaj-default/01-settings/_settings.border.scss +0 -20
- package/src/themes/shaj-default/01-settings/_settings.box-shadow.scss +0 -46
- package/src/themes/shaj-default/01-settings/_settings.breadcrumb.scss +0 -0
- package/src/themes/shaj-default/01-settings/_settings.breakpoints.scss +0 -23
- package/src/themes/shaj-default/01-settings/_settings.btn-group.scss +0 -11
- package/src/themes/shaj-default/01-settings/_settings.button.scss +0 -56
- package/src/themes/shaj-default/01-settings/_settings.callout.scss +0 -87
- package/src/themes/shaj-default/01-settings/_settings.card.scss +0 -52
- package/src/themes/shaj-default/01-settings/_settings.checkbox-group.scss +0 -11
- package/src/themes/shaj-default/01-settings/_settings.checkbox.scss +0 -29
- package/src/themes/shaj-default/01-settings/_settings.color-mode.scss +0 -13
- package/src/themes/shaj-default/01-settings/_settings.colors.scss +0 -91
- package/src/themes/shaj-default/01-settings/_settings.config.scss +0 -4
- package/src/themes/shaj-default/01-settings/_settings.countdown.scss +0 -26
- package/src/themes/shaj-default/01-settings/_settings.data-table.scss +0 -62
- package/src/themes/shaj-default/01-settings/_settings.datepicker.scss +0 -51
- package/src/themes/shaj-default/01-settings/_settings.design-tokens.scss +0 -9
- package/src/themes/shaj-default/01-settings/_settings.dropdown.scss +0 -51
- package/src/themes/shaj-default/01-settings/_settings.edge-panel.scss +0 -30
- package/src/themes/shaj-default/01-settings/_settings.fonts.scss +0 -13
- package/src/themes/shaj-default/01-settings/_settings.form-group.scss +0 -20
- package/src/themes/shaj-default/01-settings/_settings.form.scss +0 -12
- package/src/themes/shaj-default/01-settings/_settings.grid.scss +0 -29
- package/src/themes/shaj-default/01-settings/_settings.hero.scss +0 -47
- package/src/themes/shaj-default/01-settings/_settings.input.scss +0 -57
- package/src/themes/shaj-default/01-settings/_settings.link.scss +0 -19
- package/src/themes/shaj-default/01-settings/_settings.list-group.scss +0 -22
- package/src/themes/shaj-default/01-settings/_settings.list.scss +0 -19
- package/src/themes/shaj-default/01-settings/_settings.masonry-grid.scss +0 -29
- package/src/themes/shaj-default/01-settings/_settings.menu.scss +0 -56
- package/src/themes/shaj-default/01-settings/_settings.messages.scss +0 -104
- package/src/themes/shaj-default/01-settings/_settings.modal.scss +0 -47
- package/src/themes/shaj-default/01-settings/_settings.nav.scss +0 -26
- package/src/themes/shaj-default/01-settings/_settings.navbar.scss +0 -60
- package/src/themes/shaj-default/01-settings/_settings.pagination.scss +0 -36
- package/src/themes/shaj-default/01-settings/_settings.photoviewer.scss +0 -51
- package/src/themes/shaj-default/01-settings/_settings.popover.scss +0 -26
- package/src/themes/shaj-default/01-settings/_settings.position.scss +0 -15
- package/src/themes/shaj-default/01-settings/_settings.progress.scss +0 -23
- package/src/themes/shaj-default/01-settings/_settings.rating.scss +0 -17
- package/src/themes/shaj-default/01-settings/_settings.river.scss +0 -56
- package/src/themes/shaj-default/01-settings/_settings.sectionintro.scss +0 -37
- package/src/themes/shaj-default/01-settings/_settings.select.scss +0 -53
- package/src/themes/shaj-default/01-settings/_settings.side-menu.scss +0 -85
- package/src/themes/shaj-default/01-settings/_settings.skeleton.scss +0 -30
- package/src/themes/shaj-default/01-settings/_settings.spacing.scss +0 -72
- package/src/themes/shaj-default/01-settings/_settings.spinner.scss +0 -24
- package/src/themes/shaj-default/01-settings/_settings.steps.scss +0 -39
- package/src/themes/shaj-default/01-settings/_settings.tabs.scss +0 -39
- package/src/themes/shaj-default/01-settings/_settings.testimonials.scss +0 -30
- package/src/themes/shaj-default/01-settings/_settings.todo.scss +0 -58
- package/src/themes/shaj-default/01-settings/_settings.toggle.scss +0 -55
- package/src/themes/shaj-default/01-settings/_settings.tooltip.scss +0 -26
- package/src/themes/shaj-default/01-settings/_settings.typography.scss +0 -101
- package/src/themes/shaj-default/01-settings/_settings.upload.scss +0 -102
- package/src/themes/shaj-default/01-settings/_settings.z-layers.scss +0 -25
- package/src/themes/shaj-default/02-tools/_index.scss +0 -0
- package/src/themes/shaj-default/03-generic/_generic.root.scss +0 -0
- package/src/themes/shaj-default/03-generic/_index.scss +0 -2
- package/src/themes/shaj-default/04-elements/_index.scss +0 -0
- package/src/themes/shaj-default/05-objects/_index.scss +0 -0
- package/src/themes/shaj-default/06-components/_components.button.scss +0 -55
- package/src/themes/shaj-default/06-components/_components.card.scss +0 -57
- package/src/themes/shaj-default/06-components/_components.input.scss +0 -58
- package/src/themes/shaj-default/06-components/_components.navbar.scss +0 -99
- package/src/themes/shaj-default/06-components/_components.tooltip.scss +0 -0
- package/src/themes/shaj-default/06-components/_index.scss +0 -13
- package/src/themes/shaj-default/99-utilities/_index.scss +0 -0
- package/src/themes/shaj-default/index.scss +0 -25
- package/theme.config.ts +0 -360
package/dist/forms.js
ADDED
|
@@ -0,0 +1,2450 @@
|
|
|
1
|
+
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
|
+
|
|
3
|
+
import React, { useRef, useEffect, memo, forwardRef, useId, useState, useMemo, useCallback } from "react";
|
|
4
|
+
|
|
5
|
+
// Define checkbox class constants
|
|
6
|
+
const FORM_CLASSES_BASE = "c-form", FORM_CLASSES_DISABLED = "c-form--disabled", FORM_GROUP_CLASSES_BASE = "c-form-group", FORM_GROUP_CLASSES_SMALL = "c-form-group--sm", FORM_GROUP_CLASSES_LARGE = "c-form-group--lg", FORM_GROUP_CLASSES_INVALID = "c-form-group--invalid", FORM_GROUP_CLASSES_VALID = "c-form-group--valid", FORM_GROUP_CLASSES_DISABLED = "c-form-group--disabled", INPUT_CLASSES_BASE = "c-input", INPUT_CLASSES_SMALL = "c-input--sm", INPUT_CLASSES_LARGE = "c-input--lg", INPUT_CLASSES_INVALID = "is-invalid", INPUT_CLASSES_VALID = "is-valid", INPUT_CLASSES_DISABLED = "is-disabled", INPUT_CLASSES_FULL_WIDTH = "c-input--full-width", INPUT_CLASSES_PREFIX_ICON = "c-input--prefix-icon", INPUT_CLASSES_SUFFIX_ICON = "c-input--suffix-icon", INPUT_CLASSES_CLEARABLE = "c-input--clearable", INPUT_CLASSES_WITH_COUNTER = "c-input--with-counter", INPUT_CLASSES_PASSWORD_TOGGLE = "c-input--password-toggle", INPUT_ELEMENTS_WRAPPER = "c-input-wrapper", RADIO_CLASSES_BASE = "c-radio", RADIO_CLASSES_INVALID = "is-error", RADIO_CLASSES_VALID = "is-valid", RADIO_CLASSES_DISABLED = "is-disabled", SELECT_CLASSES_BASE = "c-select", SELECT_CLASSES_SELECTED = "c-select__selected", SELECT_CLASSES_SELECT_BODY = "c-select__body", SELECT_CLASSES_SELECT_PANEL = "c-select__panel", SELECT_CLASSES_SELECT_ITEMS = "c-select__items", SELECT_CLASSES_SELECT_ITEM = "c-select__item", SELECT_CLASSES_TOGGLE_ICON = "c-select__toggle-icon", SELECT_CLASSES_ICON_CARET = "icon-atomix-caret-down", SELECT_CLASSES_SMALL = "c-select--sm", SELECT_CLASSES_LARGE = "c-select--lg", SELECT_CLASSES_INVALID = "is-invalid", SELECT_CLASSES_VALID = "is-valid", SELECT_CLASSES_DISABLED = "is-disabled", SELECT_CLASSES_IS_OPEN = "is-open", TEXTAREA_CLASSES_BASE = "c-input c-input--textarea", TEXTAREA_CLASSES_SMALL = "c-input--sm", TEXTAREA_CLASSES_LARGE = "c-input--lg", TEXTAREA_CLASSES_INVALID = "is-invalid", TEXTAREA_CLASSES_VALID = "is-valid", TEXTAREA_CLASSES_DISABLED = "is-disabled", ATOMIX_GLASS = {
|
|
7
|
+
BASE_CLASS: "c-atomix-glass",
|
|
8
|
+
CONTAINER_CLASS: "c-atomix-glass__container",
|
|
9
|
+
INNER_CLASS: "c-atomix-glass__inner",
|
|
10
|
+
FILTER_CLASS: "c-atomix-glass__filter",
|
|
11
|
+
FILTER_OVERLAY_CLASS: "c-atomix-glass__filter-overlay",
|
|
12
|
+
FILTER_SHADOW_CLASS: "c-atomix-glass__filter-shadow",
|
|
13
|
+
CONTENT_CLASS: "c-atomix-glass__content",
|
|
14
|
+
BORDER_1_CLASS: "c-atomix-glass__border-1",
|
|
15
|
+
BORDER_2_CLASS: "c-atomix-glass__border-2",
|
|
16
|
+
HOVER_1_CLASS: "c-atomix-glass__hover-1",
|
|
17
|
+
HOVER_2_CLASS: "c-atomix-glass__hover-2",
|
|
18
|
+
HOVER_3_CLASS: "c-atomix-glass__hover-3",
|
|
19
|
+
BASE_LAYER_CLASS: "c-atomix-glass__base",
|
|
20
|
+
OVERLAY_LAYER_CLASS: "c-atomix-glass__overlay",
|
|
21
|
+
OVERLAY_HIGHLIGHT_CLASS: "c-atomix-glass__overlay-highlight",
|
|
22
|
+
BACKGROUND_LAYER_CLASS: "c-atomix-glass__background-layer",
|
|
23
|
+
BACKGROUND_LAYER_DARK_CLASS: "c-atomix-glass__background-layer--dark",
|
|
24
|
+
BACKGROUND_LAYER_BLACK_CLASS: "c-atomix-glass__background-layer--black",
|
|
25
|
+
BACKGROUND_LAYER_OVER_LIGHT_CLASS: "c-atomix-glass__background-layer--over-light",
|
|
26
|
+
BACKGROUND_LAYER_HIDDEN_CLASS: "c-atomix-glass__background-layer--hidden",
|
|
27
|
+
VARIANT_PREFIX: "c-atomix-glass--",
|
|
28
|
+
MODE_PREFIX: "c-atomix-glass--",
|
|
29
|
+
CLASSES: {
|
|
30
|
+
BASE: "c-atomix-glass",
|
|
31
|
+
CONTAINER: "c-atomix-glass__container",
|
|
32
|
+
INNER: "c-atomix-glass__inner",
|
|
33
|
+
FILTER: "c-atomix-glass__filter",
|
|
34
|
+
CONTENT: "c-atomix-glass__content",
|
|
35
|
+
ACTIVE: "active",
|
|
36
|
+
OVER_LIGHT: "c-atomix-glass__container--over-light",
|
|
37
|
+
// Mode variants
|
|
38
|
+
STANDARD: "c-atomix-glass--standard",
|
|
39
|
+
POLAR: "c-atomix-glass--polar",
|
|
40
|
+
PROMINENT: "c-atomix-glass--prominent",
|
|
41
|
+
SHADER: "c-atomix-glass--shader"
|
|
42
|
+
},
|
|
43
|
+
DEFAULTS: {
|
|
44
|
+
DISPLACEMENT_SCALE: 20,
|
|
45
|
+
BLUR_AMOUNT: 1,
|
|
46
|
+
SATURATION: 140,
|
|
47
|
+
ABERRATION_INTENSITY: 2.5,
|
|
48
|
+
ELASTICITY: .05,
|
|
49
|
+
CORNER_RADIUS: 16,
|
|
50
|
+
// Default border-radius matching design system
|
|
51
|
+
PADDING: "0 0",
|
|
52
|
+
MODE: "standard",
|
|
53
|
+
OVER_LIGHT: !1,
|
|
54
|
+
ENABLE_OVER_LIGHT_LAYERS: !0
|
|
55
|
+
},
|
|
56
|
+
CONSTANTS: {
|
|
57
|
+
ACTIVATION_ZONE: 200,
|
|
58
|
+
MIN_BLUR: .1,
|
|
59
|
+
MOUSE_INFLUENCE_DIVISOR: 100,
|
|
60
|
+
EDGE_FADE_PIXELS: 2,
|
|
61
|
+
DEFAULT_CORNER_RADIUS: 16,
|
|
62
|
+
// Fallback value matching design system
|
|
63
|
+
MAX_SIZE: 4096,
|
|
64
|
+
// Maximum width/height for glass size
|
|
65
|
+
// Gradient calculation constants
|
|
66
|
+
GRADIENT: {
|
|
67
|
+
BASE_ANGLE: 135,
|
|
68
|
+
// Base angle for border gradients (degrees)
|
|
69
|
+
ANGLE_MULTIPLIER: 1.2,
|
|
70
|
+
// Multiplier for mouse influence on angle
|
|
71
|
+
BORDER_STOP_1: {
|
|
72
|
+
MIN: 10,
|
|
73
|
+
// Minimum percentage for border stop 1
|
|
74
|
+
BASE: 33,
|
|
75
|
+
// Base percentage for border stop 1
|
|
76
|
+
MULTIPLIER: .3
|
|
77
|
+
},
|
|
78
|
+
BORDER_STOP_2: {
|
|
79
|
+
MAX: 90,
|
|
80
|
+
// Maximum percentage for border stop 2
|
|
81
|
+
BASE: 66,
|
|
82
|
+
// Base percentage for border stop 2
|
|
83
|
+
MULTIPLIER: .4
|
|
84
|
+
},
|
|
85
|
+
BORDER_OPACITY: {
|
|
86
|
+
BASE_1: .12,
|
|
87
|
+
// Base opacity for border gradient 1
|
|
88
|
+
BASE_2: .4,
|
|
89
|
+
// Base opacity for border gradient 2
|
|
90
|
+
BASE_3: .32,
|
|
91
|
+
// Base opacity for border gradient 3
|
|
92
|
+
BASE_4: .6,
|
|
93
|
+
// Base opacity for border gradient 4
|
|
94
|
+
MULTIPLIER_LOW: .008,
|
|
95
|
+
// Low multiplier for mouse influence on opacity
|
|
96
|
+
MULTIPLIER_HIGH: .012
|
|
97
|
+
},
|
|
98
|
+
CENTER_POSITION: 50,
|
|
99
|
+
// Center position percentage (50%)
|
|
100
|
+
HOVER_POSITION: {
|
|
101
|
+
DIVISOR_1: 2,
|
|
102
|
+
// Divisor for hover 1 position calculation
|
|
103
|
+
DIVISOR_2: 1.5,
|
|
104
|
+
// Divisor for hover 2 position calculation
|
|
105
|
+
MULTIPLIER_3: 1
|
|
106
|
+
},
|
|
107
|
+
BASE_LAYER_MULTIPLIER: .5
|
|
108
|
+
},
|
|
109
|
+
// Gradient opacity values for hover effects
|
|
110
|
+
GRADIENT_OPACITY: {
|
|
111
|
+
HOVER_1: {
|
|
112
|
+
BLACK_START: .3,
|
|
113
|
+
// Start opacity for black hover 1
|
|
114
|
+
BLACK_MID: .1,
|
|
115
|
+
// Mid opacity for black hover 1
|
|
116
|
+
BLACK_STOP: 30,
|
|
117
|
+
// Stop percentage for black hover 1
|
|
118
|
+
BLACK_END: 60,
|
|
119
|
+
// End percentage for black hover 1
|
|
120
|
+
WHITE_START: .5,
|
|
121
|
+
// Start opacity for white hover 1
|
|
122
|
+
WHITE_STOP: 50
|
|
123
|
+
},
|
|
124
|
+
HOVER_2: {
|
|
125
|
+
BLACK_START: .4,
|
|
126
|
+
// Start opacity for black hover 2
|
|
127
|
+
BLACK_MID: .15,
|
|
128
|
+
// Mid opacity for black hover 2
|
|
129
|
+
BLACK_STOP: 40,
|
|
130
|
+
// Stop percentage for black hover 2
|
|
131
|
+
BLACK_END: 80,
|
|
132
|
+
// End percentage for black hover 2
|
|
133
|
+
WHITE_START: 1,
|
|
134
|
+
// Start opacity for white hover 2
|
|
135
|
+
WHITE_STOP: 80
|
|
136
|
+
},
|
|
137
|
+
HOVER_3: {
|
|
138
|
+
BLACK_START: .5,
|
|
139
|
+
// Start opacity for black hover 3
|
|
140
|
+
BLACK_MID: .2,
|
|
141
|
+
// Mid opacity for black hover 3
|
|
142
|
+
BLACK_STOP: 50,
|
|
143
|
+
// Stop percentage for black hover 3
|
|
144
|
+
BLACK_END: 100,
|
|
145
|
+
// End percentage for black hover 3
|
|
146
|
+
WHITE_START: 1,
|
|
147
|
+
// Start opacity for white hover 3
|
|
148
|
+
WHITE_STOP: 100
|
|
149
|
+
}
|
|
150
|
+
},
|
|
151
|
+
// Base and overlay gradient constants
|
|
152
|
+
BASE_GRADIENT: {
|
|
153
|
+
ANGLE: 135,
|
|
154
|
+
// Gradient angle in degrees
|
|
155
|
+
BLACK_START_BASE: .15,
|
|
156
|
+
// Base start opacity for black
|
|
157
|
+
BLACK_START_MULTIPLIER: .003,
|
|
158
|
+
// Multiplier for mouse X influence on start
|
|
159
|
+
BLACK_MID_BASE: .1,
|
|
160
|
+
// Base mid opacity for black
|
|
161
|
+
BLACK_MID_MULTIPLIER: .002,
|
|
162
|
+
// Multiplier for mouse Y influence on mid
|
|
163
|
+
BLACK_MID_STOP: 50,
|
|
164
|
+
// Mid stop percentage
|
|
165
|
+
BLACK_END_BASE: .18,
|
|
166
|
+
// Base end opacity for black
|
|
167
|
+
BLACK_END_MULTIPLIER: .004,
|
|
168
|
+
// Multiplier for mouse X influence on end
|
|
169
|
+
WHITE_OPACITY: .1
|
|
170
|
+
},
|
|
171
|
+
OVERLAY_GRADIENT: {
|
|
172
|
+
BLACK_START_BASE: .12,
|
|
173
|
+
// Base start opacity for black overlay
|
|
174
|
+
BLACK_START_MULTIPLIER: .003,
|
|
175
|
+
// Multiplier for mouse X influence on start
|
|
176
|
+
BLACK_MID: .06,
|
|
177
|
+
// Mid opacity for black overlay
|
|
178
|
+
BLACK_MID_STOP: 40,
|
|
179
|
+
// Mid stop percentage
|
|
180
|
+
BLACK_END_BASE: .15,
|
|
181
|
+
// Base end opacity for black overlay
|
|
182
|
+
BLACK_END_MULTIPLIER: .003,
|
|
183
|
+
// Multiplier for mouse Y influence on end
|
|
184
|
+
WHITE_OPACITY: .05
|
|
185
|
+
},
|
|
186
|
+
// Overlay highlight constants
|
|
187
|
+
OVERLAY_HIGHLIGHT: {
|
|
188
|
+
POSITION_X: 20,
|
|
189
|
+
// X position percentage
|
|
190
|
+
POSITION_Y: 20,
|
|
191
|
+
// Y position percentage
|
|
192
|
+
WHITE_OPACITY: .4,
|
|
193
|
+
// White opacity in gradient
|
|
194
|
+
STOP: 60,
|
|
195
|
+
// Stop percentage
|
|
196
|
+
OPACITY_MULTIPLIER: .7
|
|
197
|
+
},
|
|
198
|
+
// Displacement and aberration multipliers
|
|
199
|
+
MULTIPLIERS: {
|
|
200
|
+
SHADER_DISPLACEMENT: .8,
|
|
201
|
+
// Displacement scale multiplier for shader mode
|
|
202
|
+
OVER_LIGHT_DISPLACEMENT: .6,
|
|
203
|
+
// Displacement scale multiplier for over-light mode
|
|
204
|
+
SHADER_ABERRATION: .7
|
|
205
|
+
},
|
|
206
|
+
// Saturation constants
|
|
207
|
+
SATURATION: {
|
|
208
|
+
HIGH_CONTRAST: 200
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
}, {CONSTANTS: CONSTANTS$1} = ATOMIX_GLASS, calculateDistance = (pos1, pos2) => {
|
|
212
|
+
if (!pos1 || !pos2 || "number" != typeof pos1.x || "number" != typeof pos1.y || "number" != typeof pos2.x || "number" != typeof pos2.y) return 0;
|
|
213
|
+
const deltaX = pos1.x - pos2.x, deltaY = pos1.y - pos2.y;
|
|
214
|
+
return Math.sqrt(deltaX * deltaX + deltaY * deltaY);
|
|
215
|
+
}, calculateElementCenter = rect => rect ? {
|
|
216
|
+
x: rect.left + rect.width / 2,
|
|
217
|
+
y: rect.top + rect.height / 2
|
|
218
|
+
} : {
|
|
219
|
+
x: 0,
|
|
220
|
+
y: 0
|
|
221
|
+
}, calculateMouseInfluence = mouseOffset => {
|
|
222
|
+
if (!mouseOffset || "number" != typeof mouseOffset.x || "number" != typeof mouseOffset.y) return 0;
|
|
223
|
+
// More responsive calculation for overlight effects
|
|
224
|
+
const influence = Math.sqrt(mouseOffset.x * mouseOffset.x + mouseOffset.y * mouseOffset.y) / CONSTANTS$1.MOUSE_INFLUENCE_DIVISOR;
|
|
225
|
+
return Math.min(1.5, influence);
|
|
226
|
+
// Cap influence for better control
|
|
227
|
+
}, clampBlur = value => "number" != typeof value || isNaN(value) ? CONSTANTS$1.MIN_BLUR : Math.max(CONSTANTS$1.MIN_BLUR, Math.min(50, value)), validateGlassSize = size => size && "number" == typeof size.width && "number" == typeof size.height && size.width > 0 && size.height > 0 && size.width <= CONSTANTS$1.MAX_SIZE && size.height <= CONSTANTS$1.MAX_SIZE, parseBorderRadiusValue = value => {
|
|
228
|
+
if ("number" == typeof value) return Math.max(0, value);
|
|
229
|
+
if ("string" != typeof value || !value.trim()) return CONSTANTS$1.DEFAULT_CORNER_RADIUS;
|
|
230
|
+
const trimmedValue = value.trim();
|
|
231
|
+
// Handle px values
|
|
232
|
+
if (trimmedValue.endsWith("px")) {
|
|
233
|
+
const parsed = parseFloat(trimmedValue);
|
|
234
|
+
return isNaN(parsed) ? CONSTANTS$1.DEFAULT_CORNER_RADIUS : Math.max(0, parsed);
|
|
235
|
+
}
|
|
236
|
+
// Handle rem values (assume 16px = 1rem)
|
|
237
|
+
if (trimmedValue.endsWith("rem")) {
|
|
238
|
+
const parsed = parseFloat(trimmedValue);
|
|
239
|
+
return isNaN(parsed) ? CONSTANTS$1.DEFAULT_CORNER_RADIUS : Math.max(0, 16 * parsed);
|
|
240
|
+
}
|
|
241
|
+
// Handle em values (assume 16px = 1em for simplicity)
|
|
242
|
+
if (trimmedValue.endsWith("em")) {
|
|
243
|
+
const parsed = parseFloat(trimmedValue);
|
|
244
|
+
return isNaN(parsed) ? CONSTANTS$1.DEFAULT_CORNER_RADIUS : Math.max(0, 16 * parsed);
|
|
245
|
+
}
|
|
246
|
+
// Handle percentage (convert to approximate px value, assuming 200px container)
|
|
247
|
+
if (trimmedValue.endsWith("%")) {
|
|
248
|
+
const parsed = parseFloat(trimmedValue);
|
|
249
|
+
return isNaN(parsed) ? CONSTANTS$1.DEFAULT_CORNER_RADIUS : Math.max(0, parsed / 100 * 200);
|
|
250
|
+
}
|
|
251
|
+
// Handle unitless numbers
|
|
252
|
+
const numValue = parseFloat(trimmedValue);
|
|
253
|
+
return isNaN(numValue) ? CONSTANTS$1.DEFAULT_CORNER_RADIUS : Math.max(0, numValue);
|
|
254
|
+
}, extractBorderRadiusFromElement = element => {
|
|
255
|
+
if (!element || !element.props) return null;
|
|
256
|
+
// Check inline styles first (highest priority)
|
|
257
|
+
if (element.props.style) {
|
|
258
|
+
const radiusFromStyle = (style => {
|
|
259
|
+
if (!style) return null;
|
|
260
|
+
// Check various border-radius properties
|
|
261
|
+
const borderRadius = style.borderRadius || style.borderTopLeftRadius || style.borderTopRightRadius || style.borderBottomLeftRadius || style.borderBottomRightRadius;
|
|
262
|
+
return void 0 !== borderRadius ? parseBorderRadiusValue(borderRadius) : null;
|
|
263
|
+
})(element.props.style);
|
|
264
|
+
if (null !== radiusFromStyle && radiusFromStyle > 0) return radiusFromStyle;
|
|
265
|
+
}
|
|
266
|
+
// If element has children, recursively check them
|
|
267
|
+
if (element.props.children) {
|
|
268
|
+
const childRadius = extractBorderRadiusFromChildren(element.props.children);
|
|
269
|
+
if (childRadius > 0 && childRadius !== CONSTANTS$1.DEFAULT_CORNER_RADIUS) return childRadius;
|
|
270
|
+
}
|
|
271
|
+
return null;
|
|
272
|
+
}, extractBorderRadiusFromChildren = children => {
|
|
273
|
+
if (!children) return CONSTANTS$1.DEFAULT_CORNER_RADIUS;
|
|
274
|
+
try {
|
|
275
|
+
const childArray = React.Children.toArray(children);
|
|
276
|
+
for (let i = 0; i < childArray.length; i++) {
|
|
277
|
+
const child = childArray[i];
|
|
278
|
+
if ( React.isValidElement(child)) {
|
|
279
|
+
const radius = extractBorderRadiusFromElement(child);
|
|
280
|
+
if (null !== radius) return radius;
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
} catch (error) {
|
|
284
|
+
// Silently handle errors
|
|
285
|
+
}
|
|
286
|
+
return CONSTANTS$1.DEFAULT_CORNER_RADIUS;
|
|
287
|
+
}, getDisplacementMap = (mode, displacementMap, polarDisplacementMap, prominentDisplacementMap, shaderMapUrl) => {
|
|
288
|
+
switch (mode) {
|
|
289
|
+
case "standard":
|
|
290
|
+
return displacementMap;
|
|
291
|
+
|
|
292
|
+
case "polar":
|
|
293
|
+
return polarDisplacementMap;
|
|
294
|
+
|
|
295
|
+
case "prominent":
|
|
296
|
+
return prominentDisplacementMap;
|
|
297
|
+
|
|
298
|
+
case "shader":
|
|
299
|
+
return shaderMapUrl || displacementMap;
|
|
300
|
+
|
|
301
|
+
default:
|
|
302
|
+
return console.warn("AtomixGlass: Invalid displacement mode"), displacementMap;
|
|
303
|
+
}
|
|
304
|
+
}, GlassFilterComponent = ({id: id, displacementScale: displacementScale, aberrationIntensity: aberrationIntensity, mode: mode, shaderMapUrl: shaderMapUrl, blurAmount: blurAmount}) => jsx("svg", {
|
|
305
|
+
style: {
|
|
306
|
+
position: "absolute",
|
|
307
|
+
width: "100%",
|
|
308
|
+
height: "100%",
|
|
309
|
+
inset: 0
|
|
310
|
+
},
|
|
311
|
+
"aria-hidden": "true",
|
|
312
|
+
suppressHydrationWarning: !0,
|
|
313
|
+
children: jsxs("defs", {
|
|
314
|
+
children: [ jsxs("radialGradient", {
|
|
315
|
+
id: `${id}-edge-mask`,
|
|
316
|
+
cx: "50%",
|
|
317
|
+
cy: "50%",
|
|
318
|
+
r: "50%",
|
|
319
|
+
children: [ jsx("stop", {
|
|
320
|
+
offset: "0%",
|
|
321
|
+
stopColor: "black",
|
|
322
|
+
stopOpacity: "0"
|
|
323
|
+
}), jsx("stop", {
|
|
324
|
+
offset: `${Math.max(30, 80 - 2 * aberrationIntensity)}%`,
|
|
325
|
+
stopColor: "black",
|
|
326
|
+
stopOpacity: "0"
|
|
327
|
+
}), jsx("stop", {
|
|
328
|
+
offset: "100%",
|
|
329
|
+
stopColor: "white",
|
|
330
|
+
stopOpacity: "1"
|
|
331
|
+
}) ]
|
|
332
|
+
}), jsxs("filter", {
|
|
333
|
+
id: id,
|
|
334
|
+
x: "-35%",
|
|
335
|
+
y: "-35%",
|
|
336
|
+
width: "170%",
|
|
337
|
+
height: "170%",
|
|
338
|
+
colorInterpolationFilters: "sRGB",
|
|
339
|
+
children: [ jsx("feImage", {
|
|
340
|
+
id: "feimage",
|
|
341
|
+
x: "0",
|
|
342
|
+
y: "0",
|
|
343
|
+
width: "100%",
|
|
344
|
+
height: "100%",
|
|
345
|
+
result: "DISPLACEMENT_MAP",
|
|
346
|
+
href: getDisplacementMap(mode, "data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAZABkAAD/2wCEAAQDAwMDAwQDAwQGBAMEBgcFBAQFBwgHBwcHBwgLCAkJCQkICwsMDAwMDAsNDQ4ODQ0SEhISEhQUFBQUFBQUFBQBBQUFCAgIEAsLEBQODg4UFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFBQUFP/CABEIAQABAAMBEQACEQEDEQH/xAAxAAEBAQEBAQAAAAAAAAAAAAADAgQIAQYBAQEBAQEBAQAAAAAAAAAAAAMCBAEACAf/2gAMAwEAAhADEAAAAPjPor6kOgOiKhKgKhKgOhKhOhKxKgKhOgKhKhKgKxOhKhOgKhKhKgKwKhKgKgKwG841nns9J/nn2KVCdCdCVAVCVCVAdCVCdiVAVidCVAVCVAdiVCVCdAVCVCVAVCVAVAViVZxsBrPPY6R/NvsY6E6ErEqAqE6ErAqE6E7E7ErA0ErArAqAqEuiVAXRLol0S6J0JUBWBUI0BXnG88djpH81+xjoToSoSoCoTsSoYQTsTsTQSsCsCsCsCsCoC6A0JeAuiXSLwn0SoioCoCoBsBrPFH0j+a/Yx0J0JUJUJ2BUMIR2MIRoBoJIBXnJAK840BUA0BdAegXhLpF4S8R+IuiVgVANAV546fSH5r9jHRHQFQlYxYnZQgnYwhQokgEgEmckzjecazlYD3OPQHoD0S8JcI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rVq1atWpppppppppppppp6q0000uc51atWrVq1ammmmmmmmmmmmmt1Vpppc5znVq1atWrVqaaaaaaaaaaaaaeqtNLnOc51atWrVq1ammmmmmmmmmmmmnqrS5znOc6tWrVq16222mmmmmmlVppp6tKuc5znOrVq1a9TbbbbTTTTTSq000qtLnOc5zq1atWrW0222200000qqqtKqrnOc5zq1atTbbbbbbbbTTTSqqqqqq5znOc6tTTTbbbbbbbbTTTSqqqqrlVznOctNNNtttttttttNNNNKqqqrqznKqrTTTTbbbbbbbbbTTTSqqqqrqznOc5aaaabbbbbbbbbaaaaVVVVVdWc5znVq1NNttttttttttNNKqqqqudWc5znVq16tbbbbbbbbbbTTSqqqq5XVnOc6tWrVrb1tttttttttNNKqqqqrWrK5VWmmm2230bbbbbbaaaXOc5zlVa1KuVVppptttt9G22222mmlzlVznK6tWVVWmmmm2222222222mlznOc5znLWppVVWmmm22222229bTWrOc5znOcq1qaaVpWmm222222229erVqznOc5znKtatStK0rTbTTbbbberXr1as5znOc5aVpppppWlabaabbbb1ta9WrVnOc5znU0rTTTTTTTTTbTTbbbTWvVq1as5znOdTTStNNNNNNNNNtNNtttN6tWvVq1ZznOrU00rTTTTTTTTTTTTTbTWvVq1atWrOc6tTTTStNNNNNNNNNNtNNtNa9WrVq1Z1Z1NNNNNK1q1NNNNNNNNNNNtNatWrVq1atWrU00000rWrVq1atWrVq1alaaa1atWrVq1NNNammmmla1atWrVq1aterVq16tWrVnVqa1NK1qaaaVX/xAAWEAADAAAAAAAAAAAAAAAAAAAhgJD/2gAIAQEAAz8AaExf/8QAGhEBAQEBAQEBAAAAAAAAAAAAAQISEQADEP/aAAgBAgEBAgDx48ePHjx48ePHjx48ePHjx48ePHjx48ePHj86IiIiIiInjx48ePHjx48IiIiIj0oooooooooRERER73ve60UUUUUUVrWiiiiiihERERER73ve97ooooorRWiiiiihKERERER73ve973RRRRWtFFFFFFCIiIiIiPe973ve60UUVrRRRRRRQiIlCIiI973ve973pRRWiiiiiiiiiiiiiiihEe973ve973RRWtFFFFFFFFFFFFFFFFFFa13ve973WitaKKKKKKKKKKKKKKKKKK1rWtd1rutFa1oooooooooooosssooorWta1rWta1rRRRRRRRRRRZZZZZZZZZWta1rWta1rRRRRRRRRZZZZZZZZZZZZe9a1rWta1rWitaKLLLLLLLLLLLLLLLLL3rWta1rWtFbLLLLLLLLLLLLLLLLLLLL3vWta1rWita1ssssssss+hZZZZZZZZe961rWta0Vre97LLLLLLLLLLLPoWWWWWXrWta1oorWta3ssss+hZZZZ9Cyyyyyyyyiita1orWta1ve9llllllllllllllllFFa0VorWta1ve9llllllllllllllllllFFFaK1rWta1rWiyyyyyyyyyyyyiiiiiiitFFa1rWta1oosoosssssoooosoooorRRRWta1rWta0UUUUUWUUUUUUUUUUUVoooorWta1rWtaKKKKKKmiiiiiiiiiiiiiiitd73ve61oSiiipoqaKKKKKKKKKK0UUUVrve973vREREZoSihEooooorRRRRWtd73ve9EREREREoSiiiiitFllllla73ve9ERERERESiiiiiitH0PoWWWWVrXe96IiIiMoiJRRRRRRWjwlFFllllFFd6IiIiIlCUUUUUUUUUePHjx48ePCIiIiIiIiUUUUUUUUUUUePHjx48ePHjx48ePHjx48IiUUUUUUJRRRX//xAAWEQADAAAAAAAAAAAAAAAAAAABYJD/2gAIAQIBAz8AtEV7/8QAFxEBAQEBAAAAAAAAAAAAAAAAAAECEP/aAAgBAwEBAgCtNNNNNNNNNNNNNNNNNNNNNNNNNNNNNcrTTTTTTTTTTTTTTTTTTTTTTTTTTTTTXKrTTTTTTTU000000000000000000001FVpppppqampqaaaaaaaaaaaaaaaaaaaa5Vaaaaampqampqammmmmmmmmmmlaaaaaaiq0001NTU1NTU1NTTTTTTTTTTSqqtNNNcqtNNSyzU1LNTU1NTTTTTTTTTSqqq001ytNLLLLNTU1NTU1NTbbbTTTTTSqqq001ytNLLLLLNTU1NTU3NttttNNNNNKqq001KrSyyyyyzU1NTU3Nzc02220000qqqqrSqqyyyyyzU1NTU3Nzc3NttttNNNKqqqqqqssssss1NTU3Nzc3NzbbbbTTTSqqqqqqrLLLLLNTU1Nzc3Nzc22220000qqqqqqqqssss1NTU3Nzc3NzbbbbbTTSqqqqqqqqqqzU1NTc3Nzc3Nzbc22000qqqqqqqqqqqtTU3Nzc3Nzc3NtzbTTSqqqqrKqqqqqtNNzc23Nzc3Nzc3NTU1KqqqrKqqqqqtNNNNttzc3Nzc3NzU1NLLLLLKqqqqqqqq0022223Nzc3NzU1NSyyyyyyqqqqqqqrTTbbbbc3Nzc3NTU1LLLLLLKsqqqqqqrTTTTbbbc3Nzc1NTUsssssssqqqqqqrTTTTTbbbTc3NTU1NTUsssssqqqqqqqq0000222023NTU1NTUsssssqqqqqqqq000000003NTU1NTU1LLLLLNKrTSqqqqtNNNNNNtNNTU1NSzUssss00qq0qqqqrTTTTTTTTTU1NTUs1LLLNNNKrTTTSqqq00000000001NTU1LNTU0000qtNNNKqqqtNNNNNNNNTU1NTUs1NNNNNKss1NNNK00qtK0000001NNTU0s000000qq000001NKrStNNNNK1NNNNStNNNNNKqtNNNNNNNK0000000rU0000rTTTTTSq00000rTTTTTTTTTTTTTTTTStNNNNKr/xAAUEQEAAAAAAAAAAAAAAAAAAACg/9oACAEDAQM/AAAf/9k=", "data:image/jpeg;base64,/9j/4AAQSkZJRgABAgAAZABkAAD/2wCEAAYEBAQFBAYFBQYJBgUGCQsIBgYICwwKCgsKCgwQDAwMDAwMEAwODxAPDgwTExQUExMcGxsbHB8fHx8fHx8fHx8BBwcHDQwNGBAQGBoVERUaHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fHx8fH//CABEIAQABAAMBEQACEQEDEQH/xAAxAAADAQEBAAAAAAAAAAAAAAABAgMABAcBAAMBAQEBAAAAAAAAAAAAAAIDBAEABQb/2gAMAwEAAhADEAAAAPG/tfu93bu3bs7d27t3bu2du7d27h3bs3du7d27t3bc3du7d27tvbu3du7d27T3E+2du05u7tm7O2cM7d2zt3Du2Y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AAH//EABsRAAMBAQEBAQAAAAAAAAAAAAABAhEDEDAg/9oACAEDAQECAPzmZmZnx3d3d3fjmZmZ8d3d3d+OZmZmfHd3d3fjmZmZmfDd3d3d9Qhe5mZmZ4xjGP3d3d3dEIQhCEZmZmZjGMYxjGbu7u6IQhCEIXmZhmMYxjGMYzd3d3UIQhCEIQlmZhjGMYxjGMfu7uoQhCEIQhLMzMGmMYxjGMZu7uppoQhCEIQklmZjTGMYxjGMbb3d1NCEIQhCEISzMxpjGMYxjGMb3d1NCEIkQhCEkszGmMYyihjGMbb3d1NCESSIkQhJLMxppjGUUUMYxtvd1NNNCJJESIQklmY0xjKKKKKGMbb3dTTTRJJJJJIhJLMxpjGUUUUUUMbb3dTTQiSSSSSRCSWZjTTGUUUUUUMbb3dTTRJJJJJJJIklmY0xjKKKKKKKG293U005JJJJJJJEkksaaaaoooooooobbb3U05JJJJJJJJEkksaaZRRRRRRRRQ223uppySSSSSSSSIQkNNMoooooooooptt7qackkkkkEEkiEksGmqKKLLKLKKKbbe6mnJJJBBBBJJKSSxpplFFFllllFFNtvdTTkkkggggkklJZjTTVFFFlllllFDbe6mnLkggggggkkSzGmUUUUWWWWWUUU291NOSSCCCCCCSRLMaaZRRRZZZZZRRTb3U5ckkEEEEEEkpLMaaaoossssssop0291OXJBBBBBBBBKSzGmMossssssssp0291OXJBBBzOZBBBKlZjTVFFllllllllOm3upy5cEEHM5kEEEqVmNNUUWWWWdCyyynTb1NOXLggg5nMggglSvGmUqLLOhZ0LLLKdNm6nLgggg5nMggglSsxpqlRZZ0Oh0OhZZTpt7qcuHBzOZzOZzOZBKleNNUUWWdDodDodCynQxmy5cEHM5n/xAAUEQEAAAAAAAAAAAAAAAAAAACg/9oACAEDAQM/AAAf/9k=", "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAQAAAAEACAIAAADTED8xAABVXElEQVR4nO19aZasPKxkuE5toffS+1/YR/8AS6GQZAxZd3qvffJQtjEe5AgNQGaN//N/caZxAAAODF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qGC2liNQdGdUra0xL+H/kMAsbYr+iHAAAAAElFTkSuQmCC", shaderMapUrl),
|
|
347
|
+
preserveAspectRatio: "xMidYMid slice"
|
|
348
|
+
}), jsx("feColorMatrix", {
|
|
349
|
+
in: "DISPLACEMENT_MAP",
|
|
350
|
+
type: "matrix",
|
|
351
|
+
values: "0.3 0.3 0.3 0 0\n 0.3 0.3 0.3 0 0\n 0.3 0.3 0.3 0 0\n 0 0 0 1 0",
|
|
352
|
+
result: "EDGE_INTENSITY"
|
|
353
|
+
}), jsx("feComponentTransfer", {
|
|
354
|
+
in: "EDGE_INTENSITY",
|
|
355
|
+
result: "EDGE_MASK",
|
|
356
|
+
children: jsx("feFuncA", {
|
|
357
|
+
type: "discrete",
|
|
358
|
+
tableValues: `0 ${.05 * aberrationIntensity} 1`
|
|
359
|
+
})
|
|
360
|
+
}), jsx("feOffset", {
|
|
361
|
+
in: "SourceGraphic",
|
|
362
|
+
dx: "0",
|
|
363
|
+
dy: "0",
|
|
364
|
+
result: "CENTER_ORIGINAL"
|
|
365
|
+
}), jsx("feDisplacementMap", {
|
|
366
|
+
in: "SourceGraphic",
|
|
367
|
+
in2: "DISPLACEMENT_MAP",
|
|
368
|
+
scale: displacementScale * ("shader" === mode ? 1 : -1),
|
|
369
|
+
xChannelSelector: "R",
|
|
370
|
+
yChannelSelector: "B",
|
|
371
|
+
result: "RED_DISPLACED"
|
|
372
|
+
}), jsx("feColorMatrix", {
|
|
373
|
+
in: "RED_DISPLACED",
|
|
374
|
+
type: "matrix",
|
|
375
|
+
values: "1 0 0 0 0\n 0 0 0 0 0\n 0 0 0 0 0\n 0 0 0 1 0",
|
|
376
|
+
result: "RED_CHANNEL"
|
|
377
|
+
}), jsx("feDisplacementMap", {
|
|
378
|
+
in: "SourceGraphic",
|
|
379
|
+
in2: "DISPLACEMENT_MAP",
|
|
380
|
+
scale: displacementScale * (("shader" === mode ? 1 : -1) - .02 * aberrationIntensity),
|
|
381
|
+
xChannelSelector: "R",
|
|
382
|
+
yChannelSelector: "B",
|
|
383
|
+
result: "GREEN_DISPLACED"
|
|
384
|
+
}), jsx("feColorMatrix", {
|
|
385
|
+
in: "GREEN_DISPLACED",
|
|
386
|
+
type: "matrix",
|
|
387
|
+
values: "0 0 0 0 0\n 0 1 0 0 0\n 0 0 0 0 0\n 0 0 0 1 0",
|
|
388
|
+
result: "GREEN_CHANNEL"
|
|
389
|
+
}), jsx("feDisplacementMap", {
|
|
390
|
+
in: "SourceGraphic",
|
|
391
|
+
in2: "DISPLACEMENT_MAP",
|
|
392
|
+
scale: displacementScale * (("shader" === mode ? 1 : -1) - .03 * aberrationIntensity),
|
|
393
|
+
xChannelSelector: "R",
|
|
394
|
+
yChannelSelector: "B",
|
|
395
|
+
result: "BLUE_DISPLACED"
|
|
396
|
+
}), jsx("feColorMatrix", {
|
|
397
|
+
in: "BLUE_DISPLACED",
|
|
398
|
+
type: "matrix",
|
|
399
|
+
values: "0 0 0 0 0\n 0 0 0 0 0\n 0 0 1 0 0\n 0 0 0 1 0",
|
|
400
|
+
result: "BLUE_CHANNEL"
|
|
401
|
+
}), jsx("feBlend", {
|
|
402
|
+
in: "GREEN_CHANNEL",
|
|
403
|
+
in2: "BLUE_CHANNEL",
|
|
404
|
+
mode: "screen",
|
|
405
|
+
result: "GB_COMBINED"
|
|
406
|
+
}), jsx("feBlend", {
|
|
407
|
+
in: "RED_CHANNEL",
|
|
408
|
+
in2: "GB_COMBINED",
|
|
409
|
+
mode: "screen",
|
|
410
|
+
result: "RGB_COMBINED"
|
|
411
|
+
}), jsx("feGaussianBlur", {
|
|
412
|
+
in: "RGB_COMBINED",
|
|
413
|
+
result: "ABERRATED_BLURRED",
|
|
414
|
+
stdDeviation: blurAmount * aberrationIntensity * .05
|
|
415
|
+
}), jsx("feComposite", {
|
|
416
|
+
in: "ABERRATED_BLURRED",
|
|
417
|
+
in2: "EDGE_MASK",
|
|
418
|
+
operator: "in",
|
|
419
|
+
result: "EDGE_ABERRATION"
|
|
420
|
+
}), jsx("feComponentTransfer", {
|
|
421
|
+
in: "EDGE_MASK",
|
|
422
|
+
result: "INVERTED_MASK",
|
|
423
|
+
children: jsx("feFuncA", {
|
|
424
|
+
type: "table",
|
|
425
|
+
tableValues: "1 0"
|
|
426
|
+
})
|
|
427
|
+
}), jsx("feComposite", {
|
|
428
|
+
in: "CENTER_ORIGINAL",
|
|
429
|
+
in2: "INVERTED_MASK",
|
|
430
|
+
operator: "in",
|
|
431
|
+
result: "CENTER_CLEAN"
|
|
432
|
+
}), jsx("feComposite", {
|
|
433
|
+
in: "EDGE_ABERRATION",
|
|
434
|
+
in2: "CENTER_CLEAN",
|
|
435
|
+
operator: "over"
|
|
436
|
+
}) ]
|
|
437
|
+
}) ]
|
|
438
|
+
})
|
|
439
|
+
});
|
|
440
|
+
|
|
441
|
+
/**
|
|
442
|
+
* Checkbox state and functionality
|
|
443
|
+
* @param initialProps - Initial checkbox properties
|
|
444
|
+
* @returns Checkbox state and methods
|
|
445
|
+
*/ GlassFilterComponent.displayName = "GlassFilter";
|
|
446
|
+
|
|
447
|
+
// Memoize component to prevent unnecessary re-renders
|
|
448
|
+
const GlassFilter = memo(GlassFilterComponent, ((prevProps, nextProps) => prevProps.id === nextProps.id && prevProps.displacementScale === nextProps.displacementScale && prevProps.aberrationIntensity === nextProps.aberrationIntensity && prevProps.mode === nextProps.mode && prevProps.shaderMapUrl === nextProps.shaderMapUrl && prevProps.blurAmount === nextProps.blurAmount)), sharedShaderCache = new Map, AtomixGlassContainer = forwardRef((({children: children, className: className = "", style: style, displacementScale: displacementScale = 25, blurAmount: blurAmount = .0625, saturation: saturation = 180, aberrationIntensity: aberrationIntensity = 2, mouseOffset: mouseOffset = {
|
|
449
|
+
x: 0,
|
|
450
|
+
y: 0
|
|
451
|
+
}, globalMousePosition: globalMousePosition = {
|
|
452
|
+
x: 0,
|
|
453
|
+
y: 0
|
|
454
|
+
}, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onMouseDown: onMouseDown, onMouseUp: onMouseUp, active: active = !1, isHovered: isHovered = !1, isActive: isActive = !1, overLight: overLight = !1, cornerRadius: cornerRadius = 0, padding: padding = "0 0", glassSize: glassSize = {
|
|
455
|
+
width: 0,
|
|
456
|
+
height: 0
|
|
457
|
+
}, onClick: onClick, mode: mode = "standard", effectiveDisableEffects: effectiveDisableEffects = !1, effectiveReducedMotion: effectiveReducedMotion = !1, shaderVariant: shaderVariant = "liquidGlass", enableLiquidBlur: enableLiquidBlur = !1, elasticity: elasticity = 0, contentRef: contentRef}, ref) => {
|
|
458
|
+
// Use React's useId() for SSR compatibility
|
|
459
|
+
// Note: In Next.js, IDs may differ between server and client
|
|
460
|
+
// We'll suppress hydration warnings on elements that use this ID
|
|
461
|
+
const filterId = useId(), [shaderMapUrl, setShaderMapUrl] = useState(""), shaderGeneratorRef = useRef(null), shaderUtilsRef = useRef(null), shaderDebounceTimeoutRef = useRef(null);
|
|
462
|
+
// Lazy load shader utilities only when shader mode is needed
|
|
463
|
+
useEffect((() => {
|
|
464
|
+
"shader" === mode ?
|
|
465
|
+
// Dynamic import shader utilities
|
|
466
|
+
Promise.resolve().then((() => shaderUtils)).then((shaderUtils => {
|
|
467
|
+
shaderUtilsRef.current = {
|
|
468
|
+
ShaderDisplacementGenerator: shaderUtils.ShaderDisplacementGenerator,
|
|
469
|
+
fragmentShaders: shaderUtils.fragmentShaders
|
|
470
|
+
};
|
|
471
|
+
})).catch((error => {
|
|
472
|
+
console.warn("AtomixGlassContainer: Error loading shader utilities", error);
|
|
473
|
+
})) :
|
|
474
|
+
// Clear shader utils when not in shader mode to free memory
|
|
475
|
+
shaderUtilsRef.current = null;
|
|
476
|
+
}), [ mode ]),
|
|
477
|
+
// Generate shader map with debouncing and caching
|
|
478
|
+
useEffect((() => {
|
|
479
|
+
// Enhanced validation for shader mode
|
|
480
|
+
if ("shader" === mode && glassSize && validateGlassSize(glassSize) && shaderUtilsRef.current) {
|
|
481
|
+
// Create cache key from size and variant
|
|
482
|
+
const cacheKey = `${glassSize.width}x${glassSize.height}-${shaderVariant}`, cachedUrl = (key => {
|
|
483
|
+
const entry = sharedShaderCache.get(key);
|
|
484
|
+
return entry ? (
|
|
485
|
+
// Update access timestamp for LRU
|
|
486
|
+
entry.timestamp = Date.now(), entry.url) : null;
|
|
487
|
+
})(cacheKey);
|
|
488
|
+
// Check shared cache first
|
|
489
|
+
if (cachedUrl) return void setShaderMapUrl(cachedUrl);
|
|
490
|
+
// Clear any pending debounce
|
|
491
|
+
shaderDebounceTimeoutRef.current && clearTimeout(shaderDebounceTimeoutRef.current);
|
|
492
|
+
// Debounce shader generation to avoid blocking on rapid size changes
|
|
493
|
+
const generateShader = () => {
|
|
494
|
+
if (shaderUtilsRef.current) try {
|
|
495
|
+
const {ShaderDisplacementGenerator: ShaderDisplacementGenerator, fragmentShaders: fragmentShaders} = shaderUtilsRef.current;
|
|
496
|
+
shaderGeneratorRef.current?.destroy();
|
|
497
|
+
const selectedShader = fragmentShaders[shaderVariant] || fragmentShaders.liquidGlass;
|
|
498
|
+
shaderGeneratorRef.current = new ShaderDisplacementGenerator({
|
|
499
|
+
width: glassSize.width,
|
|
500
|
+
height: glassSize.height,
|
|
501
|
+
fragment: selectedShader
|
|
502
|
+
});
|
|
503
|
+
// Use requestIdleCallback if available for non-blocking generation
|
|
504
|
+
const generate = () => {
|
|
505
|
+
const url = shaderGeneratorRef.current?.updateShader() || "";
|
|
506
|
+
((key, url) => {
|
|
507
|
+
// Evict oldest entries if at capacity
|
|
508
|
+
if (sharedShaderCache.size >= 15) {
|
|
509
|
+
const entries = Array.from(sharedShaderCache.entries());
|
|
510
|
+
// Sort by timestamp (oldest first)
|
|
511
|
+
entries.sort(((a, b) => a[1].timestamp - b[1].timestamp));
|
|
512
|
+
// Remove oldest entry
|
|
513
|
+
const oldestEntry = entries[0];
|
|
514
|
+
oldestEntry && sharedShaderCache.delete(oldestEntry[0]);
|
|
515
|
+
}
|
|
516
|
+
sharedShaderCache.set(key, {
|
|
517
|
+
url: url,
|
|
518
|
+
timestamp: Date.now()
|
|
519
|
+
}),
|
|
520
|
+
// Development mode: log cache size
|
|
521
|
+
"production" !== process.env.NODE_ENV && sharedShaderCache.size;
|
|
522
|
+
})(cacheKey, url), setShaderMapUrl(url);
|
|
523
|
+
};
|
|
524
|
+
"undefined" != typeof requestIdleCallback ? requestIdleCallback(generate, {
|
|
525
|
+
timeout: 1e3
|
|
526
|
+
}) :
|
|
527
|
+
// Fallback to setTimeout for browsers without requestIdleCallback
|
|
528
|
+
setTimeout(generate, 0);
|
|
529
|
+
} catch (error) {
|
|
530
|
+
console.warn("AtomixGlassContainer: Error generating shader map", error), setShaderMapUrl("");
|
|
531
|
+
} else
|
|
532
|
+
// Shader utils not loaded yet, retry after a short delay
|
|
533
|
+
shaderDebounceTimeoutRef.current = setTimeout(generateShader, 100);
|
|
534
|
+
};
|
|
535
|
+
// Debounce with 300ms delay
|
|
536
|
+
shaderDebounceTimeoutRef.current = setTimeout(generateShader, 300);
|
|
537
|
+
} else
|
|
538
|
+
// Not in shader mode, clear URL
|
|
539
|
+
setShaderMapUrl("");
|
|
540
|
+
// Cleanup function with error handling
|
|
541
|
+
return () => {
|
|
542
|
+
shaderDebounceTimeoutRef.current && (clearTimeout(shaderDebounceTimeoutRef.current),
|
|
543
|
+
shaderDebounceTimeoutRef.current = null);
|
|
544
|
+
try {
|
|
545
|
+
shaderGeneratorRef.current?.destroy();
|
|
546
|
+
} catch (error) {
|
|
547
|
+
console.warn("AtomixGlassContainer: Error during shader cleanup", error);
|
|
548
|
+
} finally {
|
|
549
|
+
shaderGeneratorRef.current = null;
|
|
550
|
+
}
|
|
551
|
+
};
|
|
552
|
+
}), [ mode, glassSize, shaderVariant ]);
|
|
553
|
+
// Removed forced reflow to avoid layout thrash and potential feedback sizing loops
|
|
554
|
+
const [rectCache, setRectCache] = useState(null);
|
|
555
|
+
useEffect((() => {
|
|
556
|
+
if (!ref || "function" == typeof ref) return;
|
|
557
|
+
const element = ref.current;
|
|
558
|
+
if (element) try {
|
|
559
|
+
setRectCache(element.getBoundingClientRect());
|
|
560
|
+
} catch (error) {
|
|
561
|
+
console.warn("AtomixGlassContainer: Error getting element bounds", error), setRectCache(null);
|
|
562
|
+
}
|
|
563
|
+
}), [ ref, glassSize ]);
|
|
564
|
+
// Pre-calculate static multipliers outside useMemo
|
|
565
|
+
const liquidBlur = useMemo((() => {
|
|
566
|
+
const defaultBlur = {
|
|
567
|
+
baseBlur: blurAmount,
|
|
568
|
+
edgeBlur: 1.25 * blurAmount,
|
|
569
|
+
centerBlur: 1.1 * blurAmount,
|
|
570
|
+
flowBlur: 1.2 * blurAmount
|
|
571
|
+
};
|
|
572
|
+
// Enhanced validation for liquid blur
|
|
573
|
+
if (!enableLiquidBlur || !rectCache || !globalMousePosition || "number" != typeof globalMousePosition.x || "number" != typeof globalMousePosition.y || isNaN(globalMousePosition.x) || isNaN(globalMousePosition.y)) return defaultBlur;
|
|
574
|
+
try {
|
|
575
|
+
// Cache center and distance calculations
|
|
576
|
+
const center = calculateElementCenter(rectCache), distance = calculateDistance(globalMousePosition, center), maxDistance = Math.sqrt(rectCache.width * rectCache.width + rectCache.height * rectCache.height) / 2, normalizedDistance = Math.min(distance / maxDistance, 1), mouseInfluence = calculateMouseInfluence(mouseOffset), baseBlur = blurAmount + mouseInfluence * blurAmount * .4, edgeBlur = baseBlur * (.8 + .6 * (1.5 * normalizedDistance + .3 * mouseInfluence)), centerBlur = baseBlur * (.3 + .4 * (.3 * (1 - normalizedDistance) + .2 * mouseInfluence)), deltaX = globalMousePosition.x - center.x, deltaY = globalMousePosition.y - center.y, flowDirection = Math.atan2(deltaY, deltaX), flowBlur = baseBlur * (.4 + .6 * (.5 * Math.sin(flowDirection + mouseInfluence * Math.PI) + .5)), stateMultiplier = (isHovered ? 1.2 : 1) * (isActive ? 1.4 : 1);
|
|
577
|
+
return {
|
|
578
|
+
baseBlur: clampBlur(baseBlur * stateMultiplier),
|
|
579
|
+
edgeBlur: clampBlur(edgeBlur * stateMultiplier),
|
|
580
|
+
centerBlur: clampBlur(centerBlur * stateMultiplier),
|
|
581
|
+
flowBlur: clampBlur(flowBlur * stateMultiplier)
|
|
582
|
+
};
|
|
583
|
+
} catch (error) {
|
|
584
|
+
return console.warn("AtomixGlassContainer: Error calculating liquid blur", error),
|
|
585
|
+
defaultBlur;
|
|
586
|
+
}
|
|
587
|
+
}), [ enableLiquidBlur, blurAmount, globalMousePosition, mouseOffset, isHovered, isActive, rectCache, style, glassSize ]), backdropStyle = useMemo((() => {
|
|
588
|
+
try {
|
|
589
|
+
const dynamicSaturation = saturation + 20 * (liquidBlur.baseBlur || 0), validatedBaseBlur = "number" != typeof liquidBlur.baseBlur || isNaN(liquidBlur.baseBlur) ? 0 : liquidBlur.baseBlur, validatedEdgeBlur = "number" != typeof liquidBlur.edgeBlur || isNaN(liquidBlur.edgeBlur) ? 0 : liquidBlur.edgeBlur, validatedCenterBlur = "number" != typeof liquidBlur.centerBlur || isNaN(liquidBlur.centerBlur) ? 0 : liquidBlur.centerBlur, validatedFlowBlur = "number" != typeof liquidBlur.flowBlur || isNaN(liquidBlur.flowBlur) ? 0 : liquidBlur.flowBlur, area = rectCache ? rectCache.width * rectCache.height : 0;
|
|
590
|
+
// Validate blur values before using them
|
|
591
|
+
return !enableLiquidBlur || effectiveReducedMotion || effectiveDisableEffects || area > 18e4 ? {
|
|
592
|
+
backdropFilter: `blur(${clampBlur(Math.max(validatedBaseBlur, .8 * validatedEdgeBlur, 1.1 * validatedCenterBlur, .9 * validatedFlowBlur))}px) saturate(${Math.min(dynamicSaturation, 200)}%) contrast(1.05) brightness(1.05)`
|
|
593
|
+
} : {
|
|
594
|
+
backdropFilter: `${[ `blur(${validatedBaseBlur}px)`, `blur(${validatedEdgeBlur}px)`, `blur(${validatedCenterBlur}px)`, `blur(${validatedFlowBlur}px)` ].join(" ")} saturate(${Math.min(dynamicSaturation, 200)}%) contrast(1.05) brightness(1.05)`
|
|
595
|
+
};
|
|
596
|
+
// Single-pass fallback: stronger radius to match perceived blur of multi-pass
|
|
597
|
+
} catch (error) {
|
|
598
|
+
return console.warn("AtomixGlassContainer: Error calculating backdrop style", error),
|
|
599
|
+
{
|
|
600
|
+
backdropFilter: `blur(${blurAmount}px) saturate(${saturation}%) contrast(1.05) brightness(1.05)`
|
|
601
|
+
};
|
|
602
|
+
}
|
|
603
|
+
}), [ filterId, liquidBlur, saturation, blurAmount, rectCache, effectiveReducedMotion, effectiveDisableEffects, enableLiquidBlur ]), containerVars = useMemo((() => {
|
|
604
|
+
try {
|
|
605
|
+
// Safe extraction of mouse offset values
|
|
606
|
+
const mx = mouseOffset && "number" == typeof mouseOffset.x && !isNaN(mouseOffset.x) ? mouseOffset.x : 0, my = mouseOffset && "number" == typeof mouseOffset.y && !isNaN(mouseOffset.y) ? mouseOffset.y : 0;
|
|
607
|
+
return {
|
|
608
|
+
"--atomix-glass-container-width": `${glassSize?.width}`,
|
|
609
|
+
"--atomix-glass-container-height": `${glassSize?.height}`,
|
|
610
|
+
"--atomix-glass-container-padding": padding || "0 0",
|
|
611
|
+
"--atomix-glass-container-radius": `${"number" != typeof cornerRadius || isNaN(cornerRadius) ? 0 : cornerRadius}px`,
|
|
612
|
+
"--atomix-glass-container-backdrop": backdropStyle?.backdropFilter || "none",
|
|
613
|
+
"--atomix-glass-container-shadow": overLight ? [ `inset 0 1px 0 rgba(255, 255, 255, ${.4 + .002 * mx})`, `inset 0 -1px 0 rgba(0, 0, 0, ${.2 + .001 * Math.abs(my)})`, `inset 0 0 20px rgba(0, 0, 0, ${.08 + .001 * Math.abs(mx + my)})`, `0 2px 12px rgba(0, 0, 0, ${.12 + .002 * Math.abs(my)})` ].join(", ") : "0 0 20px rgba(0, 0, 0, 0.15) inset, 0 4px 8px rgba(0, 0, 0, 0.08) inset",
|
|
614
|
+
"--atomix-glass-container-shadow-opacity": effectiveDisableEffects ? 0 : 1,
|
|
615
|
+
// Background and shadow values use design token-aligned RGB values
|
|
616
|
+
"--atomix-glass-container-bg": overLight ? `linear-gradient(${180 + .5 * mx}deg, rgba(255, 255, 255, 0.1) 0%, transparent 20%, transparent 80%, rgba(0, 0, 0, 0.05) 100%)` : "none",
|
|
617
|
+
"--atomix-glass-container-text-shadow": overLight ? "0px 2px 12px rgba(0, 0, 0, 0)" : "0px 2px 12px rgba(0, 0, 0, 0.4)",
|
|
618
|
+
"--atomix-glass-container-box-shadow": overLight ? "0px 16px 70px rgba(0, 0, 0, 0.75)" : "0px 12px 40px rgba(0, 0, 0, 0.25)"
|
|
619
|
+
};
|
|
620
|
+
} catch (error) {
|
|
621
|
+
return console.warn("AtomixGlassContainer: Error generating container variables", error),
|
|
622
|
+
{
|
|
623
|
+
"--atomix-glass-container-padding": "0 0",
|
|
624
|
+
"--atomix-glass-container-radius": "0px",
|
|
625
|
+
"--atomix-glass-container-backdrop": "none",
|
|
626
|
+
"--atomix-glass-container-shadow": "none",
|
|
627
|
+
"--atomix-glass-container-shadow-opacity": 1,
|
|
628
|
+
"--atomix-glass-container-bg": "none",
|
|
629
|
+
"--atomix-glass-container-text-shadow": "none"
|
|
630
|
+
};
|
|
631
|
+
}
|
|
632
|
+
}), [ glassSize, padding, cornerRadius, backdropStyle, mouseOffset, overLight, effectiveDisableEffects ]);
|
|
633
|
+
return jsx("div", {
|
|
634
|
+
ref: ref,
|
|
635
|
+
className: `${ATOMIX_GLASS.CONTAINER_CLASS} ${className} ${active ? ATOMIX_GLASS.CLASSES.ACTIVE : ""} ${overLight ? ATOMIX_GLASS.CLASSES.OVER_LIGHT : ""}`,
|
|
636
|
+
style: {
|
|
637
|
+
...style,
|
|
638
|
+
...containerVars
|
|
639
|
+
},
|
|
640
|
+
onClick: onClick,
|
|
641
|
+
children: jsxs("div", {
|
|
642
|
+
className: ATOMIX_GLASS.INNER_CLASS,
|
|
643
|
+
style: {
|
|
644
|
+
padding: "var(--atomix-glass-container-padding)",
|
|
645
|
+
boxShadow: "var(--atomix-glass-container-box-shadow)"
|
|
646
|
+
},
|
|
647
|
+
onMouseEnter: onMouseEnter,
|
|
648
|
+
onMouseLeave: onMouseLeave,
|
|
649
|
+
onMouseDown: onMouseDown,
|
|
650
|
+
onMouseUp: onMouseUp,
|
|
651
|
+
children: [ jsxs("div", {
|
|
652
|
+
className: ATOMIX_GLASS.FILTER_CLASS,
|
|
653
|
+
children: [ jsx(GlassFilter, {
|
|
654
|
+
blurAmount: blurAmount,
|
|
655
|
+
mode: mode,
|
|
656
|
+
id: filterId,
|
|
657
|
+
displacementScale: "number" != typeof displacementScale || isNaN(displacementScale) ? 0 : displacementScale,
|
|
658
|
+
aberrationIntensity: "number" != typeof aberrationIntensity || isNaN(aberrationIntensity) ? 0 : aberrationIntensity,
|
|
659
|
+
shaderMapUrl: shaderMapUrl
|
|
660
|
+
}), jsx("div", {
|
|
661
|
+
className: ATOMIX_GLASS.FILTER_OVERLAY_CLASS,
|
|
662
|
+
suppressHydrationWarning: !0,
|
|
663
|
+
style: {
|
|
664
|
+
filter: `url(#${filterId})`,
|
|
665
|
+
backdropFilter: "var(--atomix-glass-container-backdrop)",
|
|
666
|
+
borderRadius: "var(--atomix-glass-container-radius)"
|
|
667
|
+
}
|
|
668
|
+
}), jsx("div", {
|
|
669
|
+
className: ATOMIX_GLASS.FILTER_SHADOW_CLASS,
|
|
670
|
+
style: {
|
|
671
|
+
boxShadow: "var(--atomix-glass-container-shadow)",
|
|
672
|
+
opacity: "var(--atomix-glass-container-shadow-opacity)",
|
|
673
|
+
background: "var(--atomix-glass-container-bg)",
|
|
674
|
+
borderRadius: "var(--atomix-glass-container-radius)"
|
|
675
|
+
}
|
|
676
|
+
}) ]
|
|
677
|
+
}), jsx("div", {
|
|
678
|
+
ref: contentRef,
|
|
679
|
+
className: ATOMIX_GLASS.CONTENT_CLASS,
|
|
680
|
+
style: {
|
|
681
|
+
position: "relative",
|
|
682
|
+
textShadow: "var(--atomix-glass-container-text-shadow)",
|
|
683
|
+
...elasticity > 0 ? {
|
|
684
|
+
zIndex: 100
|
|
685
|
+
} : {}
|
|
686
|
+
},
|
|
687
|
+
children: children
|
|
688
|
+
}) ]
|
|
689
|
+
})
|
|
690
|
+
});
|
|
691
|
+
}));
|
|
692
|
+
|
|
693
|
+
// Module-level shared shader cache with LRU eviction
|
|
694
|
+
AtomixGlassContainer.displayName = "AtomixGlassContainer";
|
|
695
|
+
|
|
696
|
+
// Singleton instance
|
|
697
|
+
const globalMouseTracker = new
|
|
698
|
+
/**
|
|
699
|
+
* Global mouse tracker singleton
|
|
700
|
+
* Tracks mouse position at document level and distributes to subscribers
|
|
701
|
+
* Reduces event processing overhead when multiple AtomixGlass instances are present
|
|
702
|
+
*/
|
|
703
|
+
class {
|
|
704
|
+
constructor() {
|
|
705
|
+
this.listeners = new Set, this.position = {
|
|
706
|
+
x: 0,
|
|
707
|
+
y: 0
|
|
708
|
+
}, this.rafId = null, this.lastEvent = null, this.isTracking = !1,
|
|
709
|
+
/**
|
|
710
|
+
* Handle mouse move event
|
|
711
|
+
*/
|
|
712
|
+
this.handleMouseMove = e => {
|
|
713
|
+
this.lastEvent = e,
|
|
714
|
+
// Use requestAnimationFrame to throttle updates
|
|
715
|
+
null === this.rafId && (this.rafId = requestAnimationFrame((() => {
|
|
716
|
+
this.lastEvent && (this.position = {
|
|
717
|
+
x: this.lastEvent.clientX,
|
|
718
|
+
y: this.lastEvent.clientY
|
|
719
|
+
},
|
|
720
|
+
// Notify all subscribers
|
|
721
|
+
this.listeners.forEach((callback => {
|
|
722
|
+
try {
|
|
723
|
+
callback(this.position);
|
|
724
|
+
} catch (error) {
|
|
725
|
+
console.error("GlobalMouseTracker: Error in subscriber callback", error);
|
|
726
|
+
}
|
|
727
|
+
}))), this.rafId = null;
|
|
728
|
+
})));
|
|
729
|
+
};
|
|
730
|
+
}
|
|
731
|
+
/**
|
|
732
|
+
* Subscribe to mouse position updates
|
|
733
|
+
* @param callback Function to call when mouse position changes
|
|
734
|
+
* @returns Unsubscribe function
|
|
735
|
+
*/ subscribe(callback) {
|
|
736
|
+
// Return unsubscribe function
|
|
737
|
+
return this.listeners.add(callback),
|
|
738
|
+
// Start tracking if this is the first subscriber
|
|
739
|
+
1 === this.listeners.size && this.startTracking(),
|
|
740
|
+
// Immediately notify with current position
|
|
741
|
+
callback(this.position), () => {
|
|
742
|
+
this.unsubscribe(callback);
|
|
743
|
+
};
|
|
744
|
+
}
|
|
745
|
+
/**
|
|
746
|
+
* Unsubscribe from mouse position updates
|
|
747
|
+
*/ unsubscribe(callback) {
|
|
748
|
+
this.listeners.delete(callback),
|
|
749
|
+
// Stop tracking if no more subscribers
|
|
750
|
+
0 === this.listeners.size && this.stopTracking();
|
|
751
|
+
}
|
|
752
|
+
/**
|
|
753
|
+
* Start tracking mouse movement
|
|
754
|
+
*/ startTracking() {
|
|
755
|
+
this.isTracking || (this.isTracking = !0,
|
|
756
|
+
// Use document-level listener for global tracking
|
|
757
|
+
document.addEventListener("mousemove", this.handleMouseMove, {
|
|
758
|
+
passive: !0
|
|
759
|
+
}));
|
|
760
|
+
}
|
|
761
|
+
/**
|
|
762
|
+
* Stop tracking mouse movement
|
|
763
|
+
*/ stopTracking() {
|
|
764
|
+
this.isTracking && (this.isTracking = !1, document.removeEventListener("mousemove", this.handleMouseMove),
|
|
765
|
+
// Cancel any pending RAF
|
|
766
|
+
null !== this.rafId && (cancelAnimationFrame(this.rafId), this.rafId = null), this.lastEvent = null);
|
|
767
|
+
}
|
|
768
|
+
/**
|
|
769
|
+
* Get current mouse position (synchronous)
|
|
770
|
+
*/ getPosition() {
|
|
771
|
+
return {
|
|
772
|
+
...this.position
|
|
773
|
+
};
|
|
774
|
+
}
|
|
775
|
+
/**
|
|
776
|
+
* Get number of active subscribers (for debugging)
|
|
777
|
+
*/ getSubscriberCount() {
|
|
778
|
+
return this.listeners.size;
|
|
779
|
+
}
|
|
780
|
+
}, {CONSTANTS: CONSTANTS} = ATOMIX_GLASS, backgroundDetectionCache = new WeakMap, setCachedBackgroundDetection = (parentElement, overLightConfig, result, threshold) => {
|
|
781
|
+
parentElement && backgroundDetectionCache.set(parentElement, {
|
|
782
|
+
result: result,
|
|
783
|
+
timestamp: Date.now(),
|
|
784
|
+
config: overLightConfig,
|
|
785
|
+
threshold: threshold
|
|
786
|
+
});
|
|
787
|
+
};
|
|
788
|
+
|
|
789
|
+
/**
|
|
790
|
+
* Composable hook for AtomixGlass component logic
|
|
791
|
+
* Manages all state, calculations, and event handlers
|
|
792
|
+
*/
|
|
793
|
+
function useAtomixGlass({glassRef: glassRef, contentRef: contentRef, cornerRadius: cornerRadius, globalMousePosition: externalGlobalMousePosition, mouseOffset: externalMouseOffset, mouseContainer: mouseContainer, overLight: overLight = ATOMIX_GLASS.DEFAULTS.OVER_LIGHT, reducedMotion: reducedMotion = !1, highContrast: highContrast = !1, disableEffects: disableEffects = !1, elasticity: elasticity = .05, onClick: onClick, debugCornerRadius: debugCornerRadius = !1, debugOverLight: debugOverLight = !1, enablePerformanceMonitoring: enablePerformanceMonitoring = !1, children: children}) {
|
|
794
|
+
// State
|
|
795
|
+
const [isHovered, setIsHovered] = useState(!1), [isActive, setIsActive] = useState(!1), [glassSize, setGlassSize] = useState({
|
|
796
|
+
width: 270,
|
|
797
|
+
height: 69
|
|
798
|
+
}), [internalGlobalMousePosition, setInternalGlobalMousePosition] = useState({
|
|
799
|
+
x: 0,
|
|
800
|
+
y: 0
|
|
801
|
+
}), [internalMouseOffset, setInternalMouseOffset] = useState({
|
|
802
|
+
x: 0,
|
|
803
|
+
y: 0
|
|
804
|
+
}), [dynamicCornerRadius, setDynamicCornerRadius] = useState(CONSTANTS.DEFAULT_CORNER_RADIUS), [userPrefersReducedMotion, setUserPrefersReducedMotion] = useState(!1), [userPrefersHighContrast, setUserPrefersHighContrast] = useState(!1), [detectedOverLight, setDetectedOverLight] = useState(!1), effectiveCornerRadius = useMemo((() => void 0 !== cornerRadius ? Math.max(0, cornerRadius) : Math.max(0, dynamicCornerRadius)), [ cornerRadius, dynamicCornerRadius, debugCornerRadius ]), effectiveReducedMotion = useMemo((() => reducedMotion || userPrefersReducedMotion), [ reducedMotion, userPrefersReducedMotion ]), effectiveHighContrast = useMemo((() => highContrast || userPrefersHighContrast), [ highContrast, userPrefersHighContrast ]), effectiveDisableEffects = useMemo((() => disableEffects || effectiveReducedMotion), [ disableEffects, effectiveReducedMotion ]), globalMousePosition = useMemo((() => externalGlobalMousePosition || internalGlobalMousePosition), [ externalGlobalMousePosition, internalGlobalMousePosition ]), mouseOffset = useMemo((() => externalMouseOffset || internalMouseOffset), [ externalMouseOffset, internalMouseOffset ]);
|
|
805
|
+
// Extract border-radius from children
|
|
806
|
+
useEffect((() => {
|
|
807
|
+
const extractRadius = () => {
|
|
808
|
+
try {
|
|
809
|
+
let extractedRadius = null, extractionSource = "default";
|
|
810
|
+
if (contentRef.current) {
|
|
811
|
+
const firstChild = contentRef.current.firstElementChild;
|
|
812
|
+
if (firstChild) {
|
|
813
|
+
const domRadius = (element => {
|
|
814
|
+
if (!element || "undefined" == typeof window) return null;
|
|
815
|
+
try {
|
|
816
|
+
const computedStyles = window.getComputedStyle(element), borderRadius = computedStyles.borderRadius || computedStyles.borderTopLeftRadius || computedStyles.borderTopRightRadius || computedStyles.borderBottomLeftRadius || computedStyles.borderBottomRightRadius;
|
|
817
|
+
if (borderRadius && "0px" !== borderRadius && "auto" !== borderRadius) {
|
|
818
|
+
const parsed = parseBorderRadiusValue(borderRadius);
|
|
819
|
+
return parsed > 0 ? parsed : null;
|
|
820
|
+
}
|
|
821
|
+
return null;
|
|
822
|
+
} catch (error) {
|
|
823
|
+
return null;
|
|
824
|
+
}
|
|
825
|
+
})(firstChild);
|
|
826
|
+
null !== domRadius && domRadius > 0 && (extractedRadius = domRadius, extractionSource = "DOM element");
|
|
827
|
+
}
|
|
828
|
+
}
|
|
829
|
+
if (null === extractedRadius) {
|
|
830
|
+
const childRadius = extractBorderRadiusFromChildren(children);
|
|
831
|
+
childRadius > 0 && childRadius !== CONSTANTS.DEFAULT_CORNER_RADIUS && (extractedRadius = childRadius,
|
|
832
|
+
extractionSource = "React children");
|
|
833
|
+
}
|
|
834
|
+
null !== extractedRadius && extractedRadius > 0 ? setDynamicCornerRadius(extractedRadius) : process.env.NODE_ENV;
|
|
835
|
+
} catch (error) {
|
|
836
|
+
"production" !== process.env.NODE_ENV && debugCornerRadius && console.error("[AtomixGlass] Error extracting corner radius:", error);
|
|
837
|
+
}
|
|
838
|
+
};
|
|
839
|
+
extractRadius();
|
|
840
|
+
const timeoutId = setTimeout(extractRadius, 100);
|
|
841
|
+
return () => clearTimeout(timeoutId);
|
|
842
|
+
}), [ children, debugCornerRadius, contentRef ]),
|
|
843
|
+
// Media query handlers and background detection
|
|
844
|
+
useEffect((() => {
|
|
845
|
+
if (("auto" === overLight || "object" == typeof overLight && null !== overLight) && glassRef.current) {
|
|
846
|
+
const element = glassRef.current, cachedResult = ((parentElement, overLightConfig) => {
|
|
847
|
+
if (!parentElement) return null;
|
|
848
|
+
const cached = backgroundDetectionCache.get(parentElement);
|
|
849
|
+
return cached && ((config1, config2) => {
|
|
850
|
+
// Primitive comparison for boolean and 'auto'
|
|
851
|
+
if ("object" != typeof config1 || null === config1) return config1 === config2;
|
|
852
|
+
// Both must be objects at this point
|
|
853
|
+
if ("object" != typeof config2 || null === config2) return !1;
|
|
854
|
+
const obj1 = config1, obj2 = config2, props = [ "threshold", "opacity", "contrast", "brightness", "saturationBoost" ];
|
|
855
|
+
for (const prop of props) {
|
|
856
|
+
const val1 = obj1[prop], val2 = obj2[prop];
|
|
857
|
+
// If both are undefined, they're equal for this property
|
|
858
|
+
if (void 0 !== val1 || void 0 !== val2) {
|
|
859
|
+
// If one is undefined and the other isn't, they're different
|
|
860
|
+
if (void 0 === val1 || void 0 === val2) return !1;
|
|
861
|
+
// Compare numeric values (handle NaN and floating point precision)
|
|
862
|
+
if ("number" == typeof val1 && "number" == typeof val2) {
|
|
863
|
+
// Use Number.isNaN for proper NaN comparison
|
|
864
|
+
if (Number.isNaN(val1) && Number.isNaN(val2)) continue;
|
|
865
|
+
if (Number.isNaN(val1) || Number.isNaN(val2)) return !1;
|
|
866
|
+
// Compare with small epsilon for floating point numbers
|
|
867
|
+
if (Math.abs(val1 - val2) > Number.EPSILON) return !1;
|
|
868
|
+
} else if (val1 !== val2) return !1;
|
|
869
|
+
}
|
|
870
|
+
}
|
|
871
|
+
return !0;
|
|
872
|
+
})(cached.config, overLightConfig) ? (
|
|
873
|
+
// Update timestamp for LRU-like behavior (though WeakMap doesn't support LRU)
|
|
874
|
+
cached.timestamp = Date.now(), cached.result) : null;
|
|
875
|
+
})(element.parentElement, overLight);
|
|
876
|
+
if (null !== cachedResult) return void setDetectedOverLight(cachedResult);
|
|
877
|
+
const timeoutId = setTimeout((() => {
|
|
878
|
+
try {
|
|
879
|
+
if (!element) return void setDetectedOverLight(!1);
|
|
880
|
+
// Validate window context
|
|
881
|
+
if ("undefined" == typeof window || "function" != typeof window.getComputedStyle) return void setDetectedOverLight(!1);
|
|
882
|
+
let totalLuminance = 0, validSamples = 0, hasValidBackground = !1, currentElement = element.parentElement, depth = 0;
|
|
883
|
+
const maxDepth = 20, maxSamples = 10;
|
|
884
|
+
// Limit traversal depth to prevent infinite loops and performance issues
|
|
885
|
+
for (;currentElement && validSamples < maxSamples && depth < maxDepth; ) {
|
|
886
|
+
try {
|
|
887
|
+
const computedStyle = window.getComputedStyle(currentElement);
|
|
888
|
+
if (!computedStyle) {
|
|
889
|
+
currentElement = currentElement.parentElement, depth++;
|
|
890
|
+
continue;
|
|
891
|
+
}
|
|
892
|
+
const bgColor = computedStyle.backgroundColor, bgImage = computedStyle.backgroundImage;
|
|
893
|
+
// Check for solid color backgrounds
|
|
894
|
+
if (bgColor && "rgba(0, 0, 0, 0)" !== bgColor && "transparent" !== bgColor && "initial" !== bgColor && "none" !== bgColor) {
|
|
895
|
+
const rgb = bgColor.match(/\d+/g);
|
|
896
|
+
if (rgb && rgb.length >= 3) {
|
|
897
|
+
const r = Number(rgb[0]), g = Number(rgb[1]), b = Number(rgb[2]);
|
|
898
|
+
// Validate RGB values are valid numbers
|
|
899
|
+
if (!isNaN(r) && !isNaN(g) && !isNaN(b) && isFinite(r) && isFinite(g) && isFinite(b) && r >= 0 && r <= 255 && g >= 0 && g <= 255 && b >= 0 && b <= 255 && (r > 10 || g > 10 || b > 10)) {
|
|
900
|
+
const luminance = (.299 * r + .587 * g + .114 * b) / 255;
|
|
901
|
+
!isNaN(luminance) && isFinite(luminance) && (totalLuminance += luminance, validSamples++,
|
|
902
|
+
hasValidBackground = !0);
|
|
903
|
+
}
|
|
904
|
+
}
|
|
905
|
+
}
|
|
906
|
+
// Check for image backgrounds
|
|
907
|
+
bgImage && "none" !== bgImage && "initial" !== bgImage && (
|
|
908
|
+
// For image backgrounds, assume medium luminance
|
|
909
|
+
totalLuminance += .5, validSamples++, hasValidBackground = !0);
|
|
910
|
+
} catch (styleError) {
|
|
911
|
+
process.env.NODE_ENV;
|
|
912
|
+
}
|
|
913
|
+
// Move to parent element for next iteration
|
|
914
|
+
if (!currentElement) break;
|
|
915
|
+
// Exit loop if currentElement becomes null
|
|
916
|
+
currentElement = currentElement.parentElement, depth++;
|
|
917
|
+
}
|
|
918
|
+
// More conservative detection with better error handling
|
|
919
|
+
if (hasValidBackground && validSamples > 0) {
|
|
920
|
+
const avgLuminance = totalLuminance / validSamples;
|
|
921
|
+
if (!isNaN(avgLuminance) && isFinite(avgLuminance)) {
|
|
922
|
+
let threshold = .7;
|
|
923
|
+
// Conservative threshold for overlight
|
|
924
|
+
// If overLight is an object, use its threshold property with validation
|
|
925
|
+
if ("object" == typeof overLight && null !== overLight) {
|
|
926
|
+
const objConfig = overLight;
|
|
927
|
+
if (void 0 !== objConfig.threshold) {
|
|
928
|
+
const configThreshold = "number" == typeof objConfig.threshold && !isNaN(objConfig.threshold) && isFinite(objConfig.threshold) ? objConfig.threshold : .7;
|
|
929
|
+
threshold = Math.min(.9, Math.max(.1, configThreshold));
|
|
930
|
+
}
|
|
931
|
+
}
|
|
932
|
+
const isOverLightDetected = avgLuminance > threshold;
|
|
933
|
+
// Cache the result in shared cache
|
|
934
|
+
setCachedBackgroundDetection(element.parentElement, overLight, isOverLightDetected, threshold),
|
|
935
|
+
setDetectedOverLight(isOverLightDetected);
|
|
936
|
+
} else {
|
|
937
|
+
// Invalid luminance calculation, default to false
|
|
938
|
+
const result = !1, threshold = "object" == typeof overLight && null !== overLight && overLight.threshold || .7;
|
|
939
|
+
setCachedBackgroundDetection(element.parentElement, overLight, result, threshold),
|
|
940
|
+
setDetectedOverLight(result);
|
|
941
|
+
}
|
|
942
|
+
} else {
|
|
943
|
+
// Default to false if no valid background found
|
|
944
|
+
const result = !1, threshold = "object" == typeof overLight && null !== overLight && overLight.threshold || .7;
|
|
945
|
+
setCachedBackgroundDetection(element.parentElement, overLight, result, threshold),
|
|
946
|
+
setDetectedOverLight(result);
|
|
947
|
+
}
|
|
948
|
+
} catch (error) {
|
|
949
|
+
// Enhanced error logging with context
|
|
950
|
+
"development" === process.env.NODE_ENV && console.warn("AtomixGlass: Error detecting background brightness:", error);
|
|
951
|
+
const result = !1;
|
|
952
|
+
if (element && element.parentElement) {
|
|
953
|
+
const threshold = "object" == typeof overLight && null !== overLight && overLight.threshold || .7;
|
|
954
|
+
setCachedBackgroundDetection(element.parentElement, overLight, result, threshold);
|
|
955
|
+
}
|
|
956
|
+
setDetectedOverLight(result);
|
|
957
|
+
}
|
|
958
|
+
}), 150);
|
|
959
|
+
return () => clearTimeout(timeoutId);
|
|
960
|
+
}
|
|
961
|
+
if ("boolean" == typeof overLight &&
|
|
962
|
+
// For boolean values, disable auto-detection
|
|
963
|
+
// Cache is automatically managed by WeakMap (no manual clearing needed)
|
|
964
|
+
setDetectedOverLight(!1), "function" == typeof window.matchMedia) try {
|
|
965
|
+
const mediaQueryReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)"), mediaQueryHighContrast = window.matchMedia("(prefers-contrast: high)");
|
|
966
|
+
setUserPrefersReducedMotion(mediaQueryReducedMotion.matches), setUserPrefersHighContrast(mediaQueryHighContrast.matches);
|
|
967
|
+
const handleReducedMotionChange = e => {
|
|
968
|
+
setUserPrefersReducedMotion(e.matches);
|
|
969
|
+
}, handleHighContrastChange = e => {
|
|
970
|
+
setUserPrefersHighContrast(e.matches);
|
|
971
|
+
};
|
|
972
|
+
return mediaQueryReducedMotion.addEventListener ? (mediaQueryReducedMotion.addEventListener("change", handleReducedMotionChange),
|
|
973
|
+
mediaQueryHighContrast.addEventListener("change", handleHighContrastChange)) : mediaQueryReducedMotion.addListener && (mediaQueryReducedMotion.addListener(handleReducedMotionChange),
|
|
974
|
+
mediaQueryHighContrast.addListener(handleHighContrastChange)), () => {
|
|
975
|
+
try {
|
|
976
|
+
mediaQueryReducedMotion.removeEventListener ? (mediaQueryReducedMotion.removeEventListener("change", handleReducedMotionChange),
|
|
977
|
+
mediaQueryHighContrast.removeEventListener("change", handleHighContrastChange)) : mediaQueryReducedMotion.removeListener && (mediaQueryReducedMotion.removeListener(handleReducedMotionChange),
|
|
978
|
+
mediaQueryHighContrast.removeListener(handleHighContrastChange));
|
|
979
|
+
} catch (cleanupError) {
|
|
980
|
+
console.error("AtomixGlass: Error cleaning up media query listeners:", cleanupError);
|
|
981
|
+
}
|
|
982
|
+
};
|
|
983
|
+
} catch (error) {
|
|
984
|
+
return void console.error("AtomixGlass: Error setting up media queries:", error);
|
|
985
|
+
}
|
|
986
|
+
}), [ overLight, glassRef, debugOverLight ]);
|
|
987
|
+
// Mouse tracking using shared global tracker
|
|
988
|
+
// Cache bounding rect to avoid repeated getBoundingClientRect calls
|
|
989
|
+
const cachedRectRef = useRef(null), updateRectRef = useRef(null), handleGlobalMousePosition = useCallback((globalPos => {
|
|
990
|
+
if (externalGlobalMousePosition && externalMouseOffset)
|
|
991
|
+
// External mouse position provided, skip internal tracking
|
|
992
|
+
return;
|
|
993
|
+
if (effectiveDisableEffects) return;
|
|
994
|
+
const container = mouseContainer?.current || glassRef.current;
|
|
995
|
+
if (!container) return;
|
|
996
|
+
enablePerformanceMonitoring && performance.now();
|
|
997
|
+
// Use cached rect if available, otherwise get new one
|
|
998
|
+
let rect = cachedRectRef.current;
|
|
999
|
+
if (rect && 0 !== rect.width && 0 !== rect.height || (rect = container.getBoundingClientRect(),
|
|
1000
|
+
cachedRectRef.current = rect), 0 === rect.width || 0 === rect.height) return;
|
|
1001
|
+
const center = calculateElementCenter(rect), newOffset = {
|
|
1002
|
+
x: (globalPos.x - center.x) / rect.width * 100,
|
|
1003
|
+
y: (globalPos.y - center.y) / rect.height * 100
|
|
1004
|
+
};
|
|
1005
|
+
// Calculate offset relative to this container
|
|
1006
|
+
// React 18 automatically batches these updates
|
|
1007
|
+
setInternalMouseOffset(newOffset), setInternalGlobalMousePosition(globalPos), "production" !== process.env.NODE_ENV && enablePerformanceMonitoring && performance.now();
|
|
1008
|
+
}), [ mouseContainer, glassRef, externalGlobalMousePosition, externalMouseOffset, effectiveDisableEffects, enablePerformanceMonitoring ]);
|
|
1009
|
+
// Subscribe to shared mouse tracker
|
|
1010
|
+
useEffect((() => {
|
|
1011
|
+
if (externalGlobalMousePosition && externalMouseOffset)
|
|
1012
|
+
// External mouse position provided, don't subscribe
|
|
1013
|
+
return;
|
|
1014
|
+
if (effectiveDisableEffects)
|
|
1015
|
+
// Effects disabled, don't subscribe
|
|
1016
|
+
return;
|
|
1017
|
+
// Subscribe to shared tracker
|
|
1018
|
+
const unsubscribe = globalMouseTracker.subscribe(handleGlobalMousePosition), container = mouseContainer?.current || glassRef.current;
|
|
1019
|
+
// Update cached rect when container size changes
|
|
1020
|
+
let resizeObserver = null;
|
|
1021
|
+
return container && "undefined" != typeof ResizeObserver && (resizeObserver = new ResizeObserver((() => {
|
|
1022
|
+
null !== updateRectRef.current && cancelAnimationFrame(updateRectRef.current), updateRectRef.current = requestAnimationFrame((() => {
|
|
1023
|
+
const container = mouseContainer?.current || glassRef.current;
|
|
1024
|
+
container && (cachedRectRef.current = container.getBoundingClientRect()), updateRectRef.current = null;
|
|
1025
|
+
}));
|
|
1026
|
+
})), resizeObserver.observe(container)), () => {
|
|
1027
|
+
unsubscribe(), null !== updateRectRef.current && (cancelAnimationFrame(updateRectRef.current),
|
|
1028
|
+
updateRectRef.current = null), resizeObserver && resizeObserver.disconnect();
|
|
1029
|
+
};
|
|
1030
|
+
}), [ handleGlobalMousePosition, mouseContainer, glassRef, externalGlobalMousePosition, externalMouseOffset, effectiveDisableEffects ]);
|
|
1031
|
+
// Transform calculations
|
|
1032
|
+
const calculateDirectionalScale = useCallback((() => {
|
|
1033
|
+
if (!(globalMousePosition.x && globalMousePosition.y && glassRef.current && validateGlassSize(glassSize))) return "scale(1)";
|
|
1034
|
+
const rect = glassRef.current.getBoundingClientRect(), center = calculateElementCenter(rect), deltaX = globalMousePosition.x - center.x, deltaY = globalMousePosition.y - center.y, edgeDistanceX = Math.max(0, Math.abs(deltaX) - glassSize.width / 2), edgeDistanceY = Math.max(0, Math.abs(deltaY) - glassSize.height / 2), edgeDistance = calculateDistance({
|
|
1035
|
+
x: edgeDistanceX,
|
|
1036
|
+
y: edgeDistanceY
|
|
1037
|
+
}, {
|
|
1038
|
+
x: 0,
|
|
1039
|
+
y: 0
|
|
1040
|
+
});
|
|
1041
|
+
if (edgeDistance > CONSTANTS.ACTIVATION_ZONE) return "scale(1)";
|
|
1042
|
+
const fadeInFactor = 1 - edgeDistance / CONSTANTS.ACTIVATION_ZONE, centerDistance = calculateDistance(globalMousePosition, center);
|
|
1043
|
+
if (0 === centerDistance) return "scale(1)";
|
|
1044
|
+
const normalizedX = deltaX / centerDistance, normalizedY = deltaY / centerDistance, stretchIntensity = Math.min(centerDistance / 300, 1) * elasticity * fadeInFactor, scaleX = 1 + Math.abs(normalizedX) * stretchIntensity * .3 - Math.abs(normalizedY) * stretchIntensity * .15, scaleY = 1 + Math.abs(normalizedY) * stretchIntensity * .3 - Math.abs(normalizedX) * stretchIntensity * .15;
|
|
1045
|
+
return `scaleX(${Math.max(.8, scaleX)}) scaleY(${Math.max(.8, scaleY)})`;
|
|
1046
|
+
}), [ globalMousePosition, elasticity, glassSize, glassRef ]), calculateFadeInFactor = useCallback((() => {
|
|
1047
|
+
if (!(globalMousePosition.x && globalMousePosition.y && glassRef.current && validateGlassSize(glassSize))) return 0;
|
|
1048
|
+
const rect = glassRef.current.getBoundingClientRect(), center = calculateElementCenter(rect), edgeDistanceX = Math.max(0, Math.abs(globalMousePosition.x - center.x) - glassSize.width / 2), edgeDistanceY = Math.max(0, Math.abs(globalMousePosition.y - center.y) - glassSize.height / 2), edgeDistance = calculateDistance({
|
|
1049
|
+
x: edgeDistanceX,
|
|
1050
|
+
y: edgeDistanceY
|
|
1051
|
+
}, {
|
|
1052
|
+
x: 0,
|
|
1053
|
+
y: 0
|
|
1054
|
+
});
|
|
1055
|
+
return edgeDistance > CONSTANTS.ACTIVATION_ZONE ? 0 : 1 - edgeDistance / CONSTANTS.ACTIVATION_ZONE;
|
|
1056
|
+
}), [ globalMousePosition, glassSize, glassRef ]), calculateElasticTranslation = useCallback((() => {
|
|
1057
|
+
if (!glassRef.current) return {
|
|
1058
|
+
x: 0,
|
|
1059
|
+
y: 0
|
|
1060
|
+
};
|
|
1061
|
+
const fadeInFactor = calculateFadeInFactor(), rect = glassRef.current.getBoundingClientRect(), center = calculateElementCenter(rect);
|
|
1062
|
+
return {
|
|
1063
|
+
x: (globalMousePosition.x - center.x) * elasticity * .1 * fadeInFactor,
|
|
1064
|
+
y: (globalMousePosition.y - center.y) * elasticity * .1 * fadeInFactor
|
|
1065
|
+
};
|
|
1066
|
+
}), [ globalMousePosition, elasticity, calculateFadeInFactor, glassRef ]), elasticTranslation = useMemo((() => effectiveDisableEffects ? {
|
|
1067
|
+
x: 0,
|
|
1068
|
+
y: 0
|
|
1069
|
+
} : calculateElasticTranslation()), [ calculateElasticTranslation, effectiveDisableEffects ]), directionalScale = useMemo((() => effectiveDisableEffects ? "scale(1)" : calculateDirectionalScale()), [ calculateDirectionalScale, effectiveDisableEffects ]), transformStyle = useMemo((() => effectiveDisableEffects ? isActive && Boolean(onClick) ? "scale(0.98)" : "scale(1)" : `translate(${elasticTranslation.x}px, ${elasticTranslation.y}px) ${isActive && Boolean(onClick) ? "scale(0.96)" : directionalScale}`), [ elasticTranslation, isActive, onClick, directionalScale, effectiveDisableEffects ]);
|
|
1070
|
+
// Size management
|
|
1071
|
+
useEffect((() => {
|
|
1072
|
+
const isValidElement = element => null !== element && element instanceof HTMLElement && element.isConnected;
|
|
1073
|
+
let rafId = null, lastSize = {
|
|
1074
|
+
width: 0,
|
|
1075
|
+
height: 0
|
|
1076
|
+
}, lastCornerRadius = effectiveCornerRadius;
|
|
1077
|
+
const updateGlassSize = (forceUpdate = !1) => {
|
|
1078
|
+
null !== rafId && cancelAnimationFrame(rafId), rafId = requestAnimationFrame((() => {
|
|
1079
|
+
if (!isValidElement(glassRef.current)) return void (rafId = null);
|
|
1080
|
+
const rect = glassRef.current.getBoundingClientRect();
|
|
1081
|
+
if (rect.width <= 0 || rect.height <= 0) return void (rafId = null);
|
|
1082
|
+
// Measure actual rendered size without artificial offsets to avoid feedback loops
|
|
1083
|
+
const newSize = {
|
|
1084
|
+
width: Math.round(rect.width),
|
|
1085
|
+
height: Math.round(rect.height)
|
|
1086
|
+
}, cornerRadiusChanged = lastCornerRadius !== effectiveCornerRadius, dimensionsChanged = Math.abs(newSize.width - lastSize.width) > 1 || Math.abs(newSize.height - lastSize.height) > 1;
|
|
1087
|
+
var size;
|
|
1088
|
+
(forceUpdate || cornerRadiusChanged || dimensionsChanged) && validateGlassSize(size = newSize) && size.width <= CONSTANTS.MAX_SIZE && size.height <= CONSTANTS.MAX_SIZE && (lastSize = newSize,
|
|
1089
|
+
lastCornerRadius = effectiveCornerRadius, setGlassSize(newSize)), rafId = null;
|
|
1090
|
+
}));
|
|
1091
|
+
};
|
|
1092
|
+
let resizeTimeoutId = null;
|
|
1093
|
+
const debouncedResizeHandler = () => {
|
|
1094
|
+
resizeTimeoutId && clearTimeout(resizeTimeoutId), resizeTimeoutId = setTimeout((() => updateGlassSize(!1)), 16);
|
|
1095
|
+
}, initialTimeoutId = setTimeout((() => updateGlassSize(!0)), 0);
|
|
1096
|
+
let resizeObserver = null, resizeDebounceTimeout = null;
|
|
1097
|
+
// ResizeObserver has 98%+ browser support, no need for fallback
|
|
1098
|
+
if ("undefined" != typeof ResizeObserver && isValidElement(glassRef.current)) try {
|
|
1099
|
+
resizeObserver = new ResizeObserver((entries => {
|
|
1100
|
+
for (const entry of entries) if (entry.target === glassRef.current) {
|
|
1101
|
+
// Update cached rect when size changes
|
|
1102
|
+
glassRef.current && (cachedRectRef.current = glassRef.current.getBoundingClientRect()),
|
|
1103
|
+
// Debounce resize updates to match RAF timing (16ms)
|
|
1104
|
+
resizeDebounceTimeout && clearTimeout(resizeDebounceTimeout), resizeDebounceTimeout = setTimeout((() => updateGlassSize(!1)), 16);
|
|
1105
|
+
break;
|
|
1106
|
+
}
|
|
1107
|
+
})), resizeObserver.observe(glassRef.current);
|
|
1108
|
+
} catch (error) {
|
|
1109
|
+
console.warn("AtomixGlass: ResizeObserver not available, using window resize only", error);
|
|
1110
|
+
}
|
|
1111
|
+
return window.addEventListener("resize", debouncedResizeHandler, {
|
|
1112
|
+
passive: !0
|
|
1113
|
+
}), () => {
|
|
1114
|
+
clearTimeout(initialTimeoutId), null !== rafId && cancelAnimationFrame(rafId), resizeTimeoutId && clearTimeout(resizeTimeoutId),
|
|
1115
|
+
resizeDebounceTimeout && clearTimeout(resizeDebounceTimeout), window.removeEventListener("resize", debouncedResizeHandler),
|
|
1116
|
+
resizeObserver?.disconnect();
|
|
1117
|
+
};
|
|
1118
|
+
}), [ effectiveCornerRadius, glassRef ]);
|
|
1119
|
+
// OverLight config
|
|
1120
|
+
/**
|
|
1121
|
+
* Get effective overLight value based on configuration
|
|
1122
|
+
* - boolean: returns the boolean value directly
|
|
1123
|
+
* - 'auto': returns detectedOverLight (auto-detected from background)
|
|
1124
|
+
* - object: returns detectedOverLight (auto-detected, but config object provides customization)
|
|
1125
|
+
*/
|
|
1126
|
+
const getEffectiveOverLight = useCallback((() => "boolean" == typeof overLight ? overLight : ("auto" === overLight || "object" == typeof overLight && null !== overLight) && detectedOverLight), [ overLight, detectedOverLight ]), validateConfigValue = useCallback(((value, min, max, defaultValue) => "number" != typeof value || isNaN(value) || !isFinite(value) ? defaultValue : Math.min(max, Math.max(min, value))), []), overLightConfig = useMemo((() => {
|
|
1127
|
+
const isOverLight = getEffectiveOverLight(), mouseInfluence = calculateMouseInfluence(mouseOffset), hoverIntensity = isHovered ? 1.4 : 1, activeIntensity = isActive ? 1.6 : 1, baseConfig = {
|
|
1128
|
+
isOverLight: isOverLight,
|
|
1129
|
+
threshold: .7,
|
|
1130
|
+
opacity: isOverLight ? Math.min(.6, Math.max(.2, .5 * hoverIntensity * activeIntensity)) : 0,
|
|
1131
|
+
contrast: Math.min(1.8, Math.max(1, 1.4 + .3 * mouseInfluence)),
|
|
1132
|
+
brightness: Math.min(1.2, Math.max(.7, .85 + .15 * mouseInfluence)),
|
|
1133
|
+
saturationBoost: Math.min(2, Math.max(1, 1.3 + .4 * mouseInfluence)),
|
|
1134
|
+
shadowIntensity: Math.min(1.5, Math.max(.5, .9 + .5 * mouseInfluence)),
|
|
1135
|
+
borderOpacity: Math.min(1, Math.max(.3, .7 + .3 * mouseInfluence))
|
|
1136
|
+
};
|
|
1137
|
+
if ("object" == typeof overLight && null !== overLight) {
|
|
1138
|
+
const objConfig = overLight, validatedThreshold = validateConfigValue(objConfig.threshold, .1, 1, baseConfig.threshold), validatedOpacity = validateConfigValue(objConfig.opacity, .1, 1, baseConfig.opacity), validatedContrast = validateConfigValue(objConfig.contrast, .5, 2.5, baseConfig.contrast), validatedBrightness = validateConfigValue(objConfig.brightness, .5, 2, baseConfig.brightness), validatedSaturationBoost = validateConfigValue(objConfig.saturationBoost, .5, 3, baseConfig.saturationBoost), finalConfig = {
|
|
1139
|
+
...baseConfig,
|
|
1140
|
+
threshold: validatedThreshold,
|
|
1141
|
+
opacity: validatedOpacity * hoverIntensity * activeIntensity,
|
|
1142
|
+
contrast: validatedContrast + .3 * mouseInfluence,
|
|
1143
|
+
brightness: validatedBrightness + .15 * mouseInfluence,
|
|
1144
|
+
saturationBoost: validatedSaturationBoost + .4 * mouseInfluence
|
|
1145
|
+
};
|
|
1146
|
+
// Validate and apply object config values with proper clamping
|
|
1147
|
+
return process.env.NODE_ENV, finalConfig;
|
|
1148
|
+
}
|
|
1149
|
+
// Debug logging for non-object configs
|
|
1150
|
+
return process.env.NODE_ENV, baseConfig;
|
|
1151
|
+
}), [ overLight, getEffectiveOverLight, mouseOffset, isHovered, isActive, validateConfigValue, debugOverLight ]), handleMouseEnter = useCallback((() => setIsHovered(!0)), []), handleMouseLeave = useCallback((() => setIsHovered(!1)), []), handleMouseDown = useCallback((() => setIsActive(!0)), []), handleMouseUp = useCallback((() => setIsActive(!1)), []), handleKeyDown = useCallback((e => {
|
|
1152
|
+
!onClick || "Enter" !== e.key && " " !== e.key || (e.preventDefault(), onClick());
|
|
1153
|
+
}), [ onClick ]), handleMouseMove = useCallback((_e => {}), []);
|
|
1154
|
+
/**
|
|
1155
|
+
* Validate and clamp a numeric config value
|
|
1156
|
+
* @param value - The value to validate
|
|
1157
|
+
* @param min - Minimum allowed value
|
|
1158
|
+
* @param max - Maximum allowed value
|
|
1159
|
+
* @param defaultValue - Default value if validation fails
|
|
1160
|
+
* @returns Validated and clamped value
|
|
1161
|
+
*/ return {
|
|
1162
|
+
// State
|
|
1163
|
+
isHovered: isHovered,
|
|
1164
|
+
isActive: isActive,
|
|
1165
|
+
glassSize: glassSize,
|
|
1166
|
+
dynamicCornerRadius: dynamicCornerRadius,
|
|
1167
|
+
effectiveCornerRadius: effectiveCornerRadius,
|
|
1168
|
+
effectiveReducedMotion: effectiveReducedMotion,
|
|
1169
|
+
effectiveHighContrast: effectiveHighContrast,
|
|
1170
|
+
effectiveDisableEffects: effectiveDisableEffects,
|
|
1171
|
+
detectedOverLight: detectedOverLight,
|
|
1172
|
+
globalMousePosition: globalMousePosition,
|
|
1173
|
+
mouseOffset: mouseOffset,
|
|
1174
|
+
// OverLight config
|
|
1175
|
+
overLightConfig: overLightConfig,
|
|
1176
|
+
// Transform calculations
|
|
1177
|
+
elasticTranslation: elasticTranslation,
|
|
1178
|
+
directionalScale: directionalScale,
|
|
1179
|
+
transformStyle: transformStyle,
|
|
1180
|
+
// Event handlers
|
|
1181
|
+
handleMouseEnter: handleMouseEnter,
|
|
1182
|
+
handleMouseLeave: handleMouseLeave,
|
|
1183
|
+
handleMouseDown: handleMouseDown,
|
|
1184
|
+
handleMouseUp: handleMouseUp,
|
|
1185
|
+
handleMouseMove: handleMouseMove,
|
|
1186
|
+
handleKeyDown: handleKeyDown
|
|
1187
|
+
};
|
|
1188
|
+
}
|
|
1189
|
+
|
|
1190
|
+
/**
|
|
1191
|
+
* AtomixGlass - A high-performance glass morphism component with liquid distortion effects
|
|
1192
|
+
*
|
|
1193
|
+
* Features:
|
|
1194
|
+
* - Hardware-accelerated glass effects with SVG filters
|
|
1195
|
+
* - Mouse-responsive liquid distortion
|
|
1196
|
+
* - Dynamic border-radius extraction from children CSS properties
|
|
1197
|
+
* - Automatic light/dark theme detection via overLight prop
|
|
1198
|
+
* - Accessibility and performance optimizations
|
|
1199
|
+
* - Multiple displacement modes (standard, polar, prominent, shader)
|
|
1200
|
+
* - Design token integration for consistent theming
|
|
1201
|
+
* - Focus ring support for keyboard navigation
|
|
1202
|
+
* - Responsive breakpoints for mobile optimization
|
|
1203
|
+
* - Enhanced ARIA attributes for screen readers
|
|
1204
|
+
*
|
|
1205
|
+
* Design System Compliance:
|
|
1206
|
+
* - Uses design tokens for opacity, spacing, and colors
|
|
1207
|
+
* - Follows BEM methodology for class naming
|
|
1208
|
+
* - Implements focus-ring mixin for accessibility
|
|
1209
|
+
* - Supports reduced motion and high contrast preferences
|
|
1210
|
+
*
|
|
1211
|
+
* @example
|
|
1212
|
+
* // Basic usage with dynamic border-radius extraction
|
|
1213
|
+
* <AtomixGlass>
|
|
1214
|
+
* <div style={{ borderRadius: '12px' }}>Content with 12px radius</div>
|
|
1215
|
+
* </AtomixGlass>
|
|
1216
|
+
*
|
|
1217
|
+
* @example
|
|
1218
|
+
* // Manual border-radius override
|
|
1219
|
+
* <AtomixGlass cornerRadius={20}>
|
|
1220
|
+
* <div>Content with 20px glass radius</div>
|
|
1221
|
+
* </AtomixGlass>
|
|
1222
|
+
*
|
|
1223
|
+
* @example
|
|
1224
|
+
* // Interactive glass with click handler
|
|
1225
|
+
* <AtomixGlass onClick={() => console.log('Clicked')} aria-label="Glass card">
|
|
1226
|
+
* <div>Clickable content</div>
|
|
1227
|
+
* </AtomixGlass>
|
|
1228
|
+
*
|
|
1229
|
+
* @example
|
|
1230
|
+
* // OverLight - Boolean mode (explicit control)
|
|
1231
|
+
* <AtomixGlass overLight={true}>
|
|
1232
|
+
* <div>Content on light background</div>
|
|
1233
|
+
* </AtomixGlass>
|
|
1234
|
+
*
|
|
1235
|
+
* @example
|
|
1236
|
+
* // OverLight - Auto-detection mode
|
|
1237
|
+
* <AtomixGlass overLight="auto">
|
|
1238
|
+
* <div>Content with auto-detected background</div>
|
|
1239
|
+
* </AtomixGlass>
|
|
1240
|
+
*
|
|
1241
|
+
* @example
|
|
1242
|
+
* // OverLight - Object config with custom settings
|
|
1243
|
+
* <AtomixGlass
|
|
1244
|
+
* overLight={{
|
|
1245
|
+
* threshold: 0.8,
|
|
1246
|
+
* opacity: 0.6,
|
|
1247
|
+
* contrast: 1.8,
|
|
1248
|
+
* brightness: 1.0,
|
|
1249
|
+
* saturationBoost: 1.5
|
|
1250
|
+
* }}
|
|
1251
|
+
* >
|
|
1252
|
+
* <div>Content with custom overLight config</div>
|
|
1253
|
+
* </AtomixGlass>
|
|
1254
|
+
*
|
|
1255
|
+
* @example
|
|
1256
|
+
* // Debug mode for overLight detection
|
|
1257
|
+
* <AtomixGlass overLight="auto" debugOverLight={true}>
|
|
1258
|
+
* <div>Content with debug logging enabled</div>
|
|
1259
|
+
* </AtomixGlass>
|
|
1260
|
+
*/ function AtomixGlass({children: children, displacementScale: displacementScale = ATOMIX_GLASS.DEFAULTS.DISPLACEMENT_SCALE, blurAmount: blurAmount = ATOMIX_GLASS.DEFAULTS.BLUR_AMOUNT, saturation: saturation = ATOMIX_GLASS.DEFAULTS.SATURATION, aberrationIntensity: aberrationIntensity = ATOMIX_GLASS.DEFAULTS.ABERRATION_INTENSITY, elasticity: elasticity = ATOMIX_GLASS.DEFAULTS.ELASTICITY, cornerRadius: cornerRadius, globalMousePosition: externalGlobalMousePosition, mouseOffset: externalMouseOffset, mouseContainer: mouseContainer = null, className: className = "", padding: padding = ATOMIX_GLASS.DEFAULTS.PADDING, overLight: overLight = ATOMIX_GLASS.DEFAULTS.OVER_LIGHT, style: style = {}, mode: mode = ATOMIX_GLASS.DEFAULTS.MODE, onClick: onClick, shaderVariant: shaderVariant = "liquidGlass", "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, role: role, tabIndex: tabIndex, reducedMotion: reducedMotion = !1, highContrast: highContrast = !1, disableEffects: disableEffects = !1, enableLiquidBlur: enableLiquidBlur = !1, enableBorderEffect: enableBorderEffect = !0, enableOverLightLayers: enableOverLightLayers = ATOMIX_GLASS.DEFAULTS.ENABLE_OVER_LIGHT_LAYERS, enablePerformanceMonitoring: enablePerformanceMonitoring = !1, debugCornerRadius: debugCornerRadius = !1, debugOverLight: debugOverLight = !1}) {
|
|
1261
|
+
const glassRef = useRef(null), contentRef = useRef(null), opacityCacheRef = useRef(null), {isHovered: isHovered, isActive: isActive, glassSize: glassSize, effectiveCornerRadius: effectiveCornerRadius, effectiveReducedMotion: effectiveReducedMotion, effectiveHighContrast: effectiveHighContrast, effectiveDisableEffects: effectiveDisableEffects, overLightConfig: overLightConfig, globalMousePosition: globalMousePosition, mouseOffset: mouseOffset, transformStyle: transformStyle, handleMouseEnter: handleMouseEnter, handleMouseLeave: handleMouseLeave, handleMouseDown: handleMouseDown, handleMouseUp: handleMouseUp, handleKeyDown: handleKeyDown} = useAtomixGlass({
|
|
1262
|
+
glassRef: glassRef,
|
|
1263
|
+
contentRef: contentRef,
|
|
1264
|
+
cornerRadius: cornerRadius,
|
|
1265
|
+
globalMousePosition: externalGlobalMousePosition,
|
|
1266
|
+
mouseOffset: externalMouseOffset,
|
|
1267
|
+
mouseContainer: mouseContainer,
|
|
1268
|
+
overLight: overLight,
|
|
1269
|
+
reducedMotion: reducedMotion,
|
|
1270
|
+
highContrast: highContrast,
|
|
1271
|
+
disableEffects: disableEffects,
|
|
1272
|
+
elasticity: elasticity,
|
|
1273
|
+
onClick: onClick,
|
|
1274
|
+
debugCornerRadius: debugCornerRadius,
|
|
1275
|
+
debugOverLight: debugOverLight,
|
|
1276
|
+
enablePerformanceMonitoring: enablePerformanceMonitoring,
|
|
1277
|
+
children: children
|
|
1278
|
+
}), isOverLight = overLightConfig.isOverLight, shouldRenderOverLightLayers = enableOverLightLayers && isOverLight;
|
|
1279
|
+
// Read CSS custom properties once on mount and cache them
|
|
1280
|
+
useEffect((() => {
|
|
1281
|
+
if ("undefined" != typeof window && glassRef.current && !opacityCacheRef.current) try {
|
|
1282
|
+
const computedStyle = window.getComputedStyle(glassRef.current), opacity50Value = computedStyle.getPropertyValue("--atomix-opacity-50").trim(), opacity40Value = computedStyle.getPropertyValue("--atomix-opacity-40").trim(), opacity80Value = computedStyle.getPropertyValue("--atomix-opacity-80").trim(), opacity0Value = computedStyle.getPropertyValue("--atomix-opacity-0").trim(), parseOpacity = (value, defaultValue) => {
|
|
1283
|
+
if (!value) return defaultValue;
|
|
1284
|
+
const parsed = parseFloat(value);
|
|
1285
|
+
return isNaN(parsed) ? defaultValue : parsed;
|
|
1286
|
+
};
|
|
1287
|
+
opacityCacheRef.current = {
|
|
1288
|
+
opacity50: parseOpacity(opacity50Value, .5),
|
|
1289
|
+
opacity40: parseOpacity(opacity40Value, .4),
|
|
1290
|
+
opacity80: parseOpacity(opacity80Value, .8),
|
|
1291
|
+
opacity0: parseOpacity(opacity0Value, 0)
|
|
1292
|
+
};
|
|
1293
|
+
} catch (error) {
|
|
1294
|
+
// Fallback to defaults if reading fails
|
|
1295
|
+
opacityCacheRef.current = {
|
|
1296
|
+
opacity50: .5,
|
|
1297
|
+
opacity40: .4,
|
|
1298
|
+
opacity80: .8,
|
|
1299
|
+
opacity0: 0
|
|
1300
|
+
};
|
|
1301
|
+
}
|
|
1302
|
+
}), []);
|
|
1303
|
+
// Calculate base style with transforms (only dynamic values)
|
|
1304
|
+
const baseStyle = useMemo((() => ({
|
|
1305
|
+
...style,
|
|
1306
|
+
...0 !== elasticity && !effectiveDisableEffects && {
|
|
1307
|
+
transform: transformStyle
|
|
1308
|
+
}
|
|
1309
|
+
})), [ style, transformStyle, effectiveDisableEffects, elasticity ]), componentClassName = useMemo((() => [ ATOMIX_GLASS.BASE_CLASS, effectiveReducedMotion && `${ATOMIX_GLASS.BASE_CLASS}--reduced-motion`, effectiveHighContrast && `${ATOMIX_GLASS.BASE_CLASS}--high-contrast`, effectiveDisableEffects && `${ATOMIX_GLASS.BASE_CLASS}--disabled-effects`, className ].filter(Boolean).join(" ")), [ effectiveReducedMotion, effectiveHighContrast, effectiveDisableEffects, className ]), baseStylePosition = baseStyle.position, baseStyleTop = baseStyle.top, baseStyleLeft = baseStyle.left, positionStyles = useMemo((() => ({
|
|
1310
|
+
position: baseStylePosition || "absolute",
|
|
1311
|
+
top: baseStyleTop || 0,
|
|
1312
|
+
left: baseStyleLeft || 0
|
|
1313
|
+
})), [ baseStylePosition, baseStyleTop, baseStyleLeft ]), baseStyleWidth = baseStyle.width, baseStyleHeight = baseStyle.height, glassSizeWidth = glassSize.width, glassSizeHeight = glassSize.height, adjustedSize = useMemo((() => ({
|
|
1314
|
+
width: "fixed" !== baseStylePosition ? "100%" : baseStyleWidth || Math.max(glassSizeWidth, 0),
|
|
1315
|
+
height: "fixed" !== baseStylePosition ? "100%" : baseStyleHeight || Math.max(glassSizeHeight, 0)
|
|
1316
|
+
})), [ baseStylePosition, baseStyleWidth, baseStyleHeight, glassSizeWidth, glassSizeHeight ]), mouseOffsetX = mouseOffset.x, mouseOffsetY = mouseOffset.y, GRADIENT = ATOMIX_GLASS.CONSTANTS.GRADIENT, gradientCalculations = useMemo((() => {
|
|
1317
|
+
const mx = mouseOffsetX, my = mouseOffsetY, borderGradientAngle = GRADIENT.BASE_ANGLE + mx * GRADIENT.ANGLE_MULTIPLIER, borderStop1 = Math.max(GRADIENT.BORDER_STOP_1.MIN, GRADIENT.BORDER_STOP_1.BASE + my * GRADIENT.BORDER_STOP_1.MULTIPLIER), borderStop2 = Math.min(GRADIENT.BORDER_STOP_2.MAX, GRADIENT.BORDER_STOP_2.BASE + my * GRADIENT.BORDER_STOP_2.MULTIPLIER), borderOpacity1 = GRADIENT.BORDER_OPACITY.BASE_1 + Math.abs(mx) * GRADIENT.BORDER_OPACITY.MULTIPLIER_LOW, borderOpacity2 = GRADIENT.BORDER_OPACITY.BASE_2 + Math.abs(mx) * GRADIENT.BORDER_OPACITY.MULTIPLIER_HIGH, borderOpacity3 = GRADIENT.BORDER_OPACITY.BASE_3 + Math.abs(mx) * GRADIENT.BORDER_OPACITY.MULTIPLIER_LOW, borderOpacity4 = GRADIENT.BORDER_OPACITY.BASE_4 + Math.abs(mx) * GRADIENT.BORDER_OPACITY.MULTIPLIER_HIGH, hover1X = GRADIENT.CENTER_POSITION + mx / GRADIENT.HOVER_POSITION.DIVISOR_1, hover1Y = GRADIENT.CENTER_POSITION + my / GRADIENT.HOVER_POSITION.DIVISOR_1, hover2X = GRADIENT.CENTER_POSITION + mx / GRADIENT.HOVER_POSITION.DIVISOR_2, hover2Y = GRADIENT.CENTER_POSITION + my / GRADIENT.HOVER_POSITION.DIVISOR_2, hover3X = GRADIENT.CENTER_POSITION + mx * GRADIENT.HOVER_POSITION.MULTIPLIER_3, hover3Y = GRADIENT.CENTER_POSITION + my * GRADIENT.HOVER_POSITION.MULTIPLIER_3, baseX = GRADIENT.CENTER_POSITION + mx * GRADIENT.BASE_LAYER_MULTIPLIER, baseY = GRADIENT.CENTER_POSITION + my * GRADIENT.BASE_LAYER_MULTIPLIER;
|
|
1318
|
+
return {
|
|
1319
|
+
isOverLight: isOverLight,
|
|
1320
|
+
mx: mx,
|
|
1321
|
+
my: my,
|
|
1322
|
+
borderGradientAngle: borderGradientAngle,
|
|
1323
|
+
borderStop1: borderStop1,
|
|
1324
|
+
borderStop2: borderStop2,
|
|
1325
|
+
borderOpacity1: borderOpacity1,
|
|
1326
|
+
borderOpacity2: borderOpacity2,
|
|
1327
|
+
borderOpacity3: borderOpacity3,
|
|
1328
|
+
borderOpacity4: borderOpacity4,
|
|
1329
|
+
hover1X: hover1X,
|
|
1330
|
+
hover1Y: hover1Y,
|
|
1331
|
+
hover2X: hover2X,
|
|
1332
|
+
hover2Y: hover2Y,
|
|
1333
|
+
hover3X: hover3X,
|
|
1334
|
+
hover3Y: hover3Y,
|
|
1335
|
+
baseX: baseX,
|
|
1336
|
+
baseY: baseY
|
|
1337
|
+
};
|
|
1338
|
+
}), [ mouseOffsetX, mouseOffsetY, isOverLight ]), overLightOpacity = overLightConfig.opacity, opacityValues = useMemo((() => {
|
|
1339
|
+
// Use cached values if available, otherwise fallback to defaults
|
|
1340
|
+
const opacity50 = opacityCacheRef.current?.opacity50 ?? .5, opacity40 = opacityCacheRef.current?.opacity40 ?? .4, opacity80 = opacityCacheRef.current?.opacity80 ?? .8, opacity0 = opacityCacheRef.current?.opacity0 ?? 0;
|
|
1341
|
+
// Dynamic multiplier for overlay
|
|
1342
|
+
return {
|
|
1343
|
+
hover1: isHovered || isActive ? opacity50 : opacity0,
|
|
1344
|
+
hover2: isActive ? opacity50 : opacity0,
|
|
1345
|
+
hover3: isHovered ? opacity40 : isActive ? opacity80 : opacity0,
|
|
1346
|
+
base: isOverLight ? overLightOpacity || opacity40 : opacity0,
|
|
1347
|
+
over: isOverLight ? 1.1 * (overLightOpacity || opacity40) : opacity0
|
|
1348
|
+
};
|
|
1349
|
+
}), [ isHovered, isActive, isOverLight, overLightOpacity ]), gradientIsOverLight = gradientCalculations.isOverLight, gradientMx = gradientCalculations.mx, gradientMy = gradientCalculations.my, gradientBorderGradientAngle = gradientCalculations.borderGradientAngle, gradientBorderStop1 = gradientCalculations.borderStop1, gradientBorderStop2 = gradientCalculations.borderStop2, gradientBorderOpacity1 = gradientCalculations.borderOpacity1, gradientBorderOpacity2 = gradientCalculations.borderOpacity2, gradientBorderOpacity3 = gradientCalculations.borderOpacity3, gradientBorderOpacity4 = gradientCalculations.borderOpacity4, gradientHover1X = gradientCalculations.hover1X, gradientHover1Y = gradientCalculations.hover1Y, gradientHover2X = gradientCalculations.hover2X, gradientHover2Y = gradientCalculations.hover2Y, gradientHover3X = gradientCalculations.hover3X, gradientHover3Y = gradientCalculations.hover3Y, gradientBaseX = gradientCalculations.baseX, gradientBaseY = gradientCalculations.baseY, positionStylesPosition = positionStyles.position, positionStylesTop = positionStyles.top, positionStylesLeft = positionStyles.left, adjustedSizeWidth = adjustedSize.width, adjustedSizeHeight = adjustedSize.height, baseStyleTransform = baseStyle.transform, opacityValuesHover1 = opacityValues.hover1, opacityValuesHover2 = opacityValues.hover2, opacityValuesHover3 = opacityValues.hover3, opacityValuesBase = opacityValues.base, opacityValuesOver = opacityValues.over, glassVars = useMemo((() => {
|
|
1350
|
+
// RGB color values for rgba() functions
|
|
1351
|
+
// Note: CSS doesn't support rgba(var(--rgb), opacity) syntax, so we use direct values
|
|
1352
|
+
// These values align with design tokens: --atomix-white-rgb and --atomix-black-rgb
|
|
1353
|
+
// The actual RGB values are defined in SCSS and should match these fallbacks
|
|
1354
|
+
// TODO: Consider reading from CSS custom properties if browser support improves
|
|
1355
|
+
const whiteColor = "255, 255, 255";
|
|
1356
|
+
// Matches --atomix-white-rgb design token
|
|
1357
|
+
// Matches --atomix-black-rgb design token
|
|
1358
|
+
return {
|
|
1359
|
+
// Standard CSS custom properties for dynamic values
|
|
1360
|
+
"--atomix-glass-radius": `${effectiveCornerRadius}px`,
|
|
1361
|
+
"--atomix-glass-transform": baseStyleTransform || "none",
|
|
1362
|
+
"--atomix-glass-position": positionStylesPosition,
|
|
1363
|
+
"--atomix-glass-top": "fixed" !== positionStylesTop ? `${positionStylesTop}px` : "0",
|
|
1364
|
+
"--atomix-glass-left": "fixed" !== positionStylesLeft ? `${positionStylesLeft}px` : "0",
|
|
1365
|
+
"--atomix-glass-width": "fixed" !== baseStylePosition ? adjustedSizeWidth : `${adjustedSizeWidth}px`,
|
|
1366
|
+
"--atomix-glass-height": "fixed" !== baseStylePosition ? adjustedSizeHeight : `${adjustedSizeHeight}px`,
|
|
1367
|
+
// Border width: Use spacing token for consistency
|
|
1368
|
+
"--atomix-glass-border-width": "var(--atomix-spacing-0-5, 0.09375rem)",
|
|
1369
|
+
"--atomix-glass-blend-mode": gradientIsOverLight ? "multiply" : "overlay",
|
|
1370
|
+
// Dynamic gradients and backgrounds
|
|
1371
|
+
// Note: RGB values use design token-aligned constants (white: 255,255,255; black: 0,0,0)
|
|
1372
|
+
"--atomix-glass-border-gradient-1": `linear-gradient(${gradientBorderGradientAngle}deg, rgba(${whiteColor}, 0) 0%, rgba(${whiteColor}, ${gradientBorderOpacity1}) ${gradientBorderStop1}%, rgba(${whiteColor}, ${gradientBorderOpacity2}) ${gradientBorderStop2}%, rgba(${whiteColor}, 0) 100%)`,
|
|
1373
|
+
"--atomix-glass-border-gradient-2": `linear-gradient(${gradientBorderGradientAngle}deg, rgba(${whiteColor}, 0) 0%, rgba(${whiteColor}, ${gradientBorderOpacity3}) ${gradientBorderStop1}%, rgba(${whiteColor}, ${gradientBorderOpacity4}) ${gradientBorderStop2}%, rgba(${whiteColor}, 0) 100%)`,
|
|
1374
|
+
"--atomix-glass-hover-1-opacity": opacityValuesHover1,
|
|
1375
|
+
"--atomix-glass-hover-1-gradient": gradientIsOverLight ? `radial-gradient(circle at ${gradientHover1X}% ${gradientHover1Y}%, rgba(0, 0, 0, ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_1.BLACK_START}) 0%, rgba(0, 0, 0, ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_1.BLACK_MID}) ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_1.BLACK_STOP}%, rgba(0, 0, 0, 0) ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_1.BLACK_END}%)` : `radial-gradient(circle at ${gradientHover1X}% ${gradientHover1Y}%, rgba(${whiteColor}, ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_1.WHITE_START}) 0%, rgba(${whiteColor}, 0) ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_1.WHITE_STOP}%)`,
|
|
1376
|
+
"--atomix-glass-hover-2-opacity": opacityValuesHover2,
|
|
1377
|
+
"--atomix-glass-hover-2-gradient": gradientIsOverLight ? `radial-gradient(circle at ${gradientHover2X}% ${gradientHover2Y}%, rgba(0, 0, 0, ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_2.BLACK_START}) 0%, rgba(0, 0, 0, ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_2.BLACK_MID}) ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_2.BLACK_STOP}%, rgba(0, 0, 0, 0) ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_2.BLACK_END}%)` : `radial-gradient(circle at ${gradientHover2X}% ${gradientHover2Y}%, rgba(${whiteColor}, ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_2.WHITE_START}) 0%, rgba(${whiteColor}, 0) ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_2.WHITE_STOP}%)`,
|
|
1378
|
+
"--atomix-glass-hover-3-opacity": opacityValuesHover3,
|
|
1379
|
+
"--atomix-glass-hover-3-gradient": gradientIsOverLight ? `radial-gradient(circle at ${gradientHover3X}% ${gradientHover3Y}%, rgba(0, 0, 0, ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_3.BLACK_START}) 0%, rgba(0, 0, 0, ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_3.BLACK_MID}) ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_3.BLACK_STOP}%, rgba(0, 0, 0, 0) ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_3.BLACK_END}%)` : `radial-gradient(circle at ${gradientHover3X}% ${gradientHover3Y}%, rgba(${whiteColor}, ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_3.WHITE_START}) 0%, rgba(${whiteColor}, 0) ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_3.WHITE_STOP}%)`,
|
|
1380
|
+
"--atomix-glass-base-opacity": opacityValuesBase,
|
|
1381
|
+
"--atomix-glass-base-gradient": gradientIsOverLight ? `linear-gradient(${ATOMIX_GLASS.CONSTANTS.BASE_GRADIENT.ANGLE}deg, rgba(0, 0, 0, ${ATOMIX_GLASS.CONSTANTS.BASE_GRADIENT.BLACK_START_BASE + gradientMx * ATOMIX_GLASS.CONSTANTS.BASE_GRADIENT.BLACK_START_MULTIPLIER}) 0%, rgba(0, 0, 0, ${ATOMIX_GLASS.CONSTANTS.BASE_GRADIENT.BLACK_MID_BASE + gradientMy * ATOMIX_GLASS.CONSTANTS.BASE_GRADIENT.BLACK_MID_MULTIPLIER}) ${ATOMIX_GLASS.CONSTANTS.BASE_GRADIENT.BLACK_MID_STOP}%, rgba(0, 0, 0, ${ATOMIX_GLASS.CONSTANTS.BASE_GRADIENT.BLACK_END_BASE + Math.abs(gradientMx) * ATOMIX_GLASS.CONSTANTS.BASE_GRADIENT.BLACK_END_MULTIPLIER}) 100%)` : `rgba(${whiteColor}, ${ATOMIX_GLASS.CONSTANTS.BASE_GRADIENT.WHITE_OPACITY})`,
|
|
1382
|
+
"--atomix-glass-overlay-opacity": opacityValuesOver,
|
|
1383
|
+
"--atomix-glass-overlay-gradient": gradientIsOverLight ? `radial-gradient(circle at ${gradientBaseX}% ${gradientBaseY}%, rgba(0, 0, 0, ${ATOMIX_GLASS.CONSTANTS.OVERLAY_GRADIENT.BLACK_START_BASE + Math.abs(gradientMx) * ATOMIX_GLASS.CONSTANTS.OVERLAY_GRADIENT.BLACK_START_MULTIPLIER}) 0%, rgba(0, 0, 0, ${ATOMIX_GLASS.CONSTANTS.OVERLAY_GRADIENT.BLACK_MID}) ${ATOMIX_GLASS.CONSTANTS.OVERLAY_GRADIENT.BLACK_MID_STOP}%, rgba(0, 0, 0, ${ATOMIX_GLASS.CONSTANTS.OVERLAY_GRADIENT.BLACK_END_BASE + Math.abs(gradientMy) * ATOMIX_GLASS.CONSTANTS.OVERLAY_GRADIENT.BLACK_END_MULTIPLIER}) 100%)` : `rgba(${whiteColor}, ${ATOMIX_GLASS.CONSTANTS.OVERLAY_GRADIENT.WHITE_OPACITY})`
|
|
1384
|
+
};
|
|
1385
|
+
}), [
|
|
1386
|
+
// Position styles - only specific properties
|
|
1387
|
+
positionStylesPosition, positionStylesTop, positionStylesLeft,
|
|
1388
|
+
// Adjusted size - only specific properties
|
|
1389
|
+
adjustedSizeWidth, adjustedSizeHeight,
|
|
1390
|
+
// Base style - only transform property
|
|
1391
|
+
baseStyleTransform, baseStylePosition,
|
|
1392
|
+
// Other values
|
|
1393
|
+
effectiveCornerRadius, effectiveReducedMotion,
|
|
1394
|
+
// Gradient calculations - extracted properties
|
|
1395
|
+
gradientIsOverLight, gradientMx, gradientMy, gradientBorderGradientAngle, gradientBorderStop1, gradientBorderStop2, gradientBorderOpacity1, gradientBorderOpacity2, gradientBorderOpacity3, gradientBorderOpacity4, gradientHover1X, gradientHover1Y, gradientHover2X, gradientHover2Y, gradientHover3X, gradientHover3Y, gradientBaseX, gradientBaseY,
|
|
1396
|
+
// Opacity values - extracted properties
|
|
1397
|
+
opacityValuesHover1, opacityValuesHover2, opacityValuesHover3, opacityValuesBase, opacityValuesOver ]);
|
|
1398
|
+
// Build className with state modifiers
|
|
1399
|
+
return jsxs("div", {
|
|
1400
|
+
className: componentClassName,
|
|
1401
|
+
style: glassVars,
|
|
1402
|
+
role: role || (onClick ? "button" : void 0),
|
|
1403
|
+
tabIndex: onClick ? tabIndex ?? 0 : tabIndex,
|
|
1404
|
+
"aria-label": ariaLabel,
|
|
1405
|
+
"aria-describedby": ariaDescribedBy,
|
|
1406
|
+
"aria-disabled": !(!onClick || !effectiveDisableEffects) || !onClick && void 0,
|
|
1407
|
+
"aria-pressed": !(!onClick || !isActive) || !onClick && void 0,
|
|
1408
|
+
onKeyDown: onClick ? handleKeyDown : void 0,
|
|
1409
|
+
children: [ jsx(AtomixGlassContainer, {
|
|
1410
|
+
ref: glassRef,
|
|
1411
|
+
contentRef: contentRef,
|
|
1412
|
+
className: className,
|
|
1413
|
+
style: baseStyle,
|
|
1414
|
+
cornerRadius: effectiveCornerRadius,
|
|
1415
|
+
displacementScale: effectiveDisableEffects ? 0 : "shader" === mode ? displacementScale * ATOMIX_GLASS.CONSTANTS.MULTIPLIERS.SHADER_DISPLACEMENT : overLightConfig.isOverLight ? displacementScale * ATOMIX_GLASS.CONSTANTS.MULTIPLIERS.OVER_LIGHT_DISPLACEMENT : displacementScale,
|
|
1416
|
+
blurAmount: effectiveDisableEffects ? 0 : blurAmount,
|
|
1417
|
+
saturation: effectiveHighContrast ? ATOMIX_GLASS.CONSTANTS.SATURATION.HIGH_CONTRAST : overLightConfig.isOverLight ? saturation * overLightConfig.saturationBoost : saturation,
|
|
1418
|
+
aberrationIntensity: effectiveDisableEffects ? 0 : "shader" === mode ? aberrationIntensity * ATOMIX_GLASS.CONSTANTS.MULTIPLIERS.SHADER_ABERRATION : aberrationIntensity,
|
|
1419
|
+
glassSize: glassSize,
|
|
1420
|
+
padding: padding,
|
|
1421
|
+
mouseOffset: effectiveDisableEffects ? {
|
|
1422
|
+
x: 0,
|
|
1423
|
+
y: 0
|
|
1424
|
+
} : mouseOffset,
|
|
1425
|
+
globalMousePosition: effectiveDisableEffects ? {
|
|
1426
|
+
x: 0,
|
|
1427
|
+
y: 0
|
|
1428
|
+
} : globalMousePosition,
|
|
1429
|
+
onMouseEnter: handleMouseEnter,
|
|
1430
|
+
onMouseLeave: handleMouseLeave,
|
|
1431
|
+
onMouseDown: handleMouseDown,
|
|
1432
|
+
onMouseUp: handleMouseUp,
|
|
1433
|
+
active: isActive,
|
|
1434
|
+
isHovered: isHovered,
|
|
1435
|
+
isActive: isActive,
|
|
1436
|
+
overLight: overLightConfig.isOverLight,
|
|
1437
|
+
onClick: onClick,
|
|
1438
|
+
mode: mode,
|
|
1439
|
+
transform: baseStyle.transform,
|
|
1440
|
+
effectiveDisableEffects: effectiveDisableEffects,
|
|
1441
|
+
effectiveReducedMotion: effectiveReducedMotion,
|
|
1442
|
+
shaderVariant: shaderVariant,
|
|
1443
|
+
elasticity: elasticity,
|
|
1444
|
+
enableLiquidBlur: enableLiquidBlur,
|
|
1445
|
+
children: children
|
|
1446
|
+
}), Boolean(onClick) && jsxs(Fragment, {
|
|
1447
|
+
children: [ jsx("div", {
|
|
1448
|
+
className: ATOMIX_GLASS.HOVER_1_CLASS
|
|
1449
|
+
}), jsx("div", {
|
|
1450
|
+
className: ATOMIX_GLASS.HOVER_2_CLASS
|
|
1451
|
+
}), jsx("div", {
|
|
1452
|
+
className: ATOMIX_GLASS.HOVER_3_CLASS
|
|
1453
|
+
}) ]
|
|
1454
|
+
}), jsx("div", {
|
|
1455
|
+
className: [ ATOMIX_GLASS.BACKGROUND_LAYER_CLASS, ATOMIX_GLASS.BACKGROUND_LAYER_DARK_CLASS, isOverLight ? ATOMIX_GLASS.BACKGROUND_LAYER_OVER_LIGHT_CLASS : ATOMIX_GLASS.BACKGROUND_LAYER_HIDDEN_CLASS ].filter(Boolean).join(" "),
|
|
1456
|
+
style: {
|
|
1457
|
+
...positionStyles,
|
|
1458
|
+
height: adjustedSize.height,
|
|
1459
|
+
width: adjustedSize.width,
|
|
1460
|
+
borderRadius: `${effectiveCornerRadius}px`,
|
|
1461
|
+
transform: baseStyle.transform
|
|
1462
|
+
}
|
|
1463
|
+
}), jsx("div", {
|
|
1464
|
+
className: [ ATOMIX_GLASS.BACKGROUND_LAYER_CLASS, ATOMIX_GLASS.BACKGROUND_LAYER_BLACK_CLASS, isOverLight ? ATOMIX_GLASS.BACKGROUND_LAYER_OVER_LIGHT_CLASS : ATOMIX_GLASS.BACKGROUND_LAYER_HIDDEN_CLASS ].filter(Boolean).join(" "),
|
|
1465
|
+
style: {
|
|
1466
|
+
...positionStyles,
|
|
1467
|
+
height: adjustedSize.height,
|
|
1468
|
+
width: adjustedSize.width,
|
|
1469
|
+
borderRadius: `${effectiveCornerRadius}px`,
|
|
1470
|
+
transform: baseStyle.transform
|
|
1471
|
+
}
|
|
1472
|
+
}), shouldRenderOverLightLayers && jsxs(Fragment, {
|
|
1473
|
+
children: [ jsx("div", {
|
|
1474
|
+
className: ATOMIX_GLASS.BASE_LAYER_CLASS
|
|
1475
|
+
}), jsx("div", {
|
|
1476
|
+
className: ATOMIX_GLASS.OVERLAY_LAYER_CLASS
|
|
1477
|
+
}), jsx("div", {
|
|
1478
|
+
className: ATOMIX_GLASS.OVERLAY_HIGHLIGHT_CLASS,
|
|
1479
|
+
style: {
|
|
1480
|
+
opacity: opacityValues.over * ATOMIX_GLASS.CONSTANTS.OVERLAY_HIGHLIGHT.OPACITY_MULTIPLIER,
|
|
1481
|
+
background: `radial-gradient(circle at ${ATOMIX_GLASS.CONSTANTS.OVERLAY_HIGHLIGHT.POSITION_X}% ${ATOMIX_GLASS.CONSTANTS.OVERLAY_HIGHLIGHT.POSITION_Y}%, rgba(255, 255, 255, ${ATOMIX_GLASS.CONSTANTS.OVERLAY_HIGHLIGHT.WHITE_OPACITY}) 0%, transparent ${ATOMIX_GLASS.CONSTANTS.OVERLAY_HIGHLIGHT.STOP}%)`
|
|
1482
|
+
}
|
|
1483
|
+
}) ]
|
|
1484
|
+
}), enableBorderEffect && jsxs(Fragment, {
|
|
1485
|
+
children: [ jsx("span", {
|
|
1486
|
+
className: ATOMIX_GLASS.BORDER_1_CLASS
|
|
1487
|
+
}), jsx("span", {
|
|
1488
|
+
className: ATOMIX_GLASS.BORDER_2_CLASS
|
|
1489
|
+
}) ]
|
|
1490
|
+
}) ]
|
|
1491
|
+
});
|
|
1492
|
+
}
|
|
1493
|
+
|
|
1494
|
+
/**
|
|
1495
|
+
* Checkbox - A component for checkbox inputs
|
|
1496
|
+
*/ const Checkbox = memo((({label: label, checked: checked = !1, onChange: onChange, className: className = "", style: style, disabled: disabled = !1, required: required = !1, id: id, name: name, value: value, invalid: invalid = !1, valid: valid = !1, indeterminate: indeterminate = !1, ariaLabel: ariaLabel, ariaDescribedBy: ariaDescribedBy, glass: glass}) => {
|
|
1497
|
+
const {generateCheckboxClass: generateCheckboxClass, checkboxRef: checkboxRef} = function(initialProps) {
|
|
1498
|
+
// Default checkbox properties
|
|
1499
|
+
const defaultProps = {
|
|
1500
|
+
disabled: !1,
|
|
1501
|
+
invalid: !1,
|
|
1502
|
+
valid: !1,
|
|
1503
|
+
indeterminate: !1,
|
|
1504
|
+
...initialProps
|
|
1505
|
+
}, checkboxRef = useRef(null);
|
|
1506
|
+
// Ref for the checkbox input element
|
|
1507
|
+
// Handle indeterminate state
|
|
1508
|
+
return useEffect((() => {
|
|
1509
|
+
checkboxRef.current && (checkboxRef.current.indeterminate = Boolean(defaultProps.indeterminate));
|
|
1510
|
+
}), [ defaultProps.indeterminate ]), {
|
|
1511
|
+
defaultProps: defaultProps,
|
|
1512
|
+
generateCheckboxClass: props => {
|
|
1513
|
+
const {disabled: disabled = defaultProps.disabled, invalid: invalid = defaultProps.invalid, valid: valid = defaultProps.valid, indeterminate: indeterminate = defaultProps.indeterminate, className: className = ""} = props;
|
|
1514
|
+
let validationClass = "";
|
|
1515
|
+
return invalid ? validationClass = "is-error" : valid && (validationClass = "is-valid"),
|
|
1516
|
+
`c-checkbox ${validationClass} ${disabled ? "is-disabled" : ""} ${indeterminate ? "c-checkbox--mixed" : ""} ${className}`.trim();
|
|
1517
|
+
},
|
|
1518
|
+
checkboxRef: checkboxRef
|
|
1519
|
+
};
|
|
1520
|
+
}
|
|
1521
|
+
/**
|
|
1522
|
+
* Default theme colors for components
|
|
1523
|
+
*/
|
|
1524
|
+
/**
|
|
1525
|
+
* Form-specific constants
|
|
1526
|
+
*/ ({
|
|
1527
|
+
indeterminate: indeterminate,
|
|
1528
|
+
disabled: disabled,
|
|
1529
|
+
invalid: invalid,
|
|
1530
|
+
valid: valid
|
|
1531
|
+
}), checkboxClass = generateCheckboxClass({
|
|
1532
|
+
className: `${className} ${glass ? "c-checkbox--glass" : ""}`.trim(),
|
|
1533
|
+
disabled: disabled,
|
|
1534
|
+
invalid: invalid,
|
|
1535
|
+
valid: valid,
|
|
1536
|
+
indeterminate: indeterminate
|
|
1537
|
+
}), checkboxContent = jsxs("div", {
|
|
1538
|
+
className: checkboxClass,
|
|
1539
|
+
style: style,
|
|
1540
|
+
children: [ jsx("input", {
|
|
1541
|
+
ref: checkboxRef,
|
|
1542
|
+
type: "checkbox",
|
|
1543
|
+
className: "c-checkbox__input",
|
|
1544
|
+
checked: checked,
|
|
1545
|
+
onChange: onChange,
|
|
1546
|
+
disabled: disabled,
|
|
1547
|
+
required: required,
|
|
1548
|
+
id: id,
|
|
1549
|
+
name: name,
|
|
1550
|
+
value: value,
|
|
1551
|
+
"aria-label": label ? void 0 : ariaLabel,
|
|
1552
|
+
"aria-describedby": ariaDescribedBy,
|
|
1553
|
+
"aria-invalid": invalid
|
|
1554
|
+
}), label && jsx("label", {
|
|
1555
|
+
className: "c-checkbox__label",
|
|
1556
|
+
htmlFor: id,
|
|
1557
|
+
children: label
|
|
1558
|
+
}) ]
|
|
1559
|
+
});
|
|
1560
|
+
if (glass) {
|
|
1561
|
+
// Default glass settings for checkboxes
|
|
1562
|
+
const defaultGlassProps = {
|
|
1563
|
+
displacementScale: 40,
|
|
1564
|
+
blurAmount: 1,
|
|
1565
|
+
saturation: 160,
|
|
1566
|
+
aberrationIntensity: .3,
|
|
1567
|
+
cornerRadius: 6,
|
|
1568
|
+
mode: "shader"
|
|
1569
|
+
}, glassProps = !0 === glass ? defaultGlassProps : {
|
|
1570
|
+
...defaultGlassProps,
|
|
1571
|
+
...glass
|
|
1572
|
+
};
|
|
1573
|
+
return jsx(AtomixGlass, {
|
|
1574
|
+
...glassProps,
|
|
1575
|
+
children: checkboxContent
|
|
1576
|
+
});
|
|
1577
|
+
}
|
|
1578
|
+
return checkboxContent;
|
|
1579
|
+
}));
|
|
1580
|
+
|
|
1581
|
+
Checkbox.displayName = "Checkbox";
|
|
1582
|
+
|
|
1583
|
+
/**
|
|
1584
|
+
* Form - A component for creating form layouts
|
|
1585
|
+
*/
|
|
1586
|
+
const Form = ({children: children, onSubmit: onSubmit, onReset: onReset, className: className = "", style: style, disabled: disabled = !1, id: id, method: method = "post", encType: encType, noValidate: noValidate = !1, autoComplete: autoComplete = "on"}) => {
|
|
1587
|
+
const {generateFormClass: generateFormClass, handleSubmit: handleSubmit, handleReset: handleReset} =
|
|
1588
|
+
/**
|
|
1589
|
+
* Form state and functionality
|
|
1590
|
+
* @param initialProps - Initial form properties
|
|
1591
|
+
* @returns Form state and methods
|
|
1592
|
+
*/
|
|
1593
|
+
function(initialProps) {
|
|
1594
|
+
// Default form properties
|
|
1595
|
+
const defaultProps = {
|
|
1596
|
+
disabled: !1,
|
|
1597
|
+
...initialProps
|
|
1598
|
+
};
|
|
1599
|
+
/**
|
|
1600
|
+
* Generate form class based on properties
|
|
1601
|
+
* @param props - Form properties
|
|
1602
|
+
* @returns Class string
|
|
1603
|
+
*/ return {
|
|
1604
|
+
defaultProps: defaultProps,
|
|
1605
|
+
generateFormClass: props => {
|
|
1606
|
+
const {disabled: disabled = defaultProps.disabled, className: className = ""} = props;
|
|
1607
|
+
return `${FORM_CLASSES_BASE} ${disabled ? FORM_CLASSES_DISABLED : ""} ${className}`.trim();
|
|
1608
|
+
},
|
|
1609
|
+
handleSubmit: handler => event => {
|
|
1610
|
+
event.preventDefault(), !defaultProps.disabled && handler && handler(event);
|
|
1611
|
+
},
|
|
1612
|
+
handleReset: handler => event => {
|
|
1613
|
+
!defaultProps.disabled && handler && handler(event);
|
|
1614
|
+
}
|
|
1615
|
+
};
|
|
1616
|
+
}({
|
|
1617
|
+
disabled: disabled
|
|
1618
|
+
}), formClass = generateFormClass({
|
|
1619
|
+
className: className,
|
|
1620
|
+
disabled: disabled
|
|
1621
|
+
});
|
|
1622
|
+
return jsx("form", {
|
|
1623
|
+
id: id,
|
|
1624
|
+
className: formClass,
|
|
1625
|
+
style: style,
|
|
1626
|
+
onSubmit: handleSubmit(onSubmit),
|
|
1627
|
+
onReset: handleReset(onReset),
|
|
1628
|
+
method: method,
|
|
1629
|
+
encType: encType,
|
|
1630
|
+
noValidate: noValidate,
|
|
1631
|
+
autoComplete: autoComplete,
|
|
1632
|
+
children: children
|
|
1633
|
+
});
|
|
1634
|
+
};
|
|
1635
|
+
|
|
1636
|
+
Form.displayName = "Form";
|
|
1637
|
+
|
|
1638
|
+
/**
|
|
1639
|
+
* FormGroup - A component for grouping form controls with labels and help text
|
|
1640
|
+
*/
|
|
1641
|
+
const FormGroup = ({children: children, label: label, helperText: helperText, htmlFor: htmlFor, className: className = "", style: style, disabled: disabled = !1, required: required = !1, invalid: invalid = !1, valid: valid = !1, size: size = "md"}) => {
|
|
1642
|
+
const {generateFormGroupClass: generateFormGroupClass} =
|
|
1643
|
+
/**
|
|
1644
|
+
* Form Group state and functionality
|
|
1645
|
+
* @param initialProps - Initial form group properties
|
|
1646
|
+
* @returns Form Group state and methods
|
|
1647
|
+
*/
|
|
1648
|
+
function(initialProps) {
|
|
1649
|
+
// Default form group properties
|
|
1650
|
+
const defaultProps = {
|
|
1651
|
+
size: "md",
|
|
1652
|
+
disabled: !1,
|
|
1653
|
+
invalid: !1,
|
|
1654
|
+
valid: !1,
|
|
1655
|
+
...initialProps
|
|
1656
|
+
};
|
|
1657
|
+
/**
|
|
1658
|
+
* Generate form group class based on properties
|
|
1659
|
+
* @param props - Form group properties
|
|
1660
|
+
* @returns Class string
|
|
1661
|
+
*/ return {
|
|
1662
|
+
defaultProps: defaultProps,
|
|
1663
|
+
generateFormGroupClass: props => {
|
|
1664
|
+
const {size: size = defaultProps.size, disabled: disabled = defaultProps.disabled, invalid: invalid = defaultProps.invalid, valid: valid = defaultProps.valid, className: className = ""} = props;
|
|
1665
|
+
return `${FORM_GROUP_CLASSES_BASE} ${"md" === size ? "" : "sm" === size ? FORM_GROUP_CLASSES_SMALL : FORM_GROUP_CLASSES_LARGE} ${invalid ? FORM_GROUP_CLASSES_INVALID : valid ? FORM_GROUP_CLASSES_VALID : ""} ${disabled ? FORM_GROUP_CLASSES_DISABLED : ""} ${className}`.trim();
|
|
1666
|
+
}
|
|
1667
|
+
};
|
|
1668
|
+
}({
|
|
1669
|
+
size: size,
|
|
1670
|
+
disabled: disabled,
|
|
1671
|
+
invalid: invalid,
|
|
1672
|
+
valid: valid
|
|
1673
|
+
}), formGroupClass = generateFormGroupClass({
|
|
1674
|
+
className: className,
|
|
1675
|
+
disabled: disabled,
|
|
1676
|
+
invalid: invalid,
|
|
1677
|
+
valid: valid,
|
|
1678
|
+
size: size
|
|
1679
|
+
});
|
|
1680
|
+
return jsxs("div", {
|
|
1681
|
+
className: formGroupClass,
|
|
1682
|
+
style: style,
|
|
1683
|
+
children: [ label && jsxs("label", {
|
|
1684
|
+
className: "c-form-group__label",
|
|
1685
|
+
htmlFor: htmlFor,
|
|
1686
|
+
children: [ label, required && jsx("span", {
|
|
1687
|
+
className: "c-form-group__required",
|
|
1688
|
+
children: "*"
|
|
1689
|
+
}) ]
|
|
1690
|
+
}), jsx("div", {
|
|
1691
|
+
className: "c-form-group__field",
|
|
1692
|
+
children: children
|
|
1693
|
+
}), helperText && jsx("div", {
|
|
1694
|
+
className: "c-form-group__helper",
|
|
1695
|
+
children: helperText
|
|
1696
|
+
}) ]
|
|
1697
|
+
});
|
|
1698
|
+
};
|
|
1699
|
+
|
|
1700
|
+
FormGroup.displayName = "FormGroup";
|
|
1701
|
+
|
|
1702
|
+
/**
|
|
1703
|
+
* Input - A component for text input fields
|
|
1704
|
+
*/
|
|
1705
|
+
const Input = memo( forwardRef((({type: type = "text", value: value, onChange: onChange, onBlur: onBlur, onFocus: onFocus, placeholder: placeholder, className: className = "", style: style, disabled: disabled = !1, required: required = !1, readOnly: readOnly = !1, id: id, name: name, autoComplete: autoComplete, autoFocus: autoFocus = !1, size: size = "md", variant: variant, invalid: invalid = !1, valid: valid = !1, maxLength: maxLength, minLength: minLength, pattern: pattern, min: min, max: max, step: step, ariaLabel: ariaLabel, ariaDescribedBy: ariaDescribedBy, glass: glass}, ref) => {
|
|
1706
|
+
const {generateInputClass: generateInputClass} =
|
|
1707
|
+
/**
|
|
1708
|
+
* Input state and functionality
|
|
1709
|
+
* @param initialProps - Initial input properties
|
|
1710
|
+
* @returns Input state and methods
|
|
1711
|
+
*/
|
|
1712
|
+
function(initialProps) {
|
|
1713
|
+
// Default input properties
|
|
1714
|
+
const defaultProps = {
|
|
1715
|
+
size: "md",
|
|
1716
|
+
disabled: !1,
|
|
1717
|
+
invalid: !1,
|
|
1718
|
+
valid: !1,
|
|
1719
|
+
...initialProps
|
|
1720
|
+
};
|
|
1721
|
+
/**
|
|
1722
|
+
* Generate input class based on properties
|
|
1723
|
+
* @param props - Input properties
|
|
1724
|
+
* @returns Class string
|
|
1725
|
+
*/ return {
|
|
1726
|
+
defaultProps: defaultProps,
|
|
1727
|
+
generateInputClass: props => {
|
|
1728
|
+
const {size: size = defaultProps.size, variant: variant = defaultProps.variant, disabled: disabled = defaultProps.disabled, invalid: invalid = defaultProps.invalid, valid: valid = defaultProps.valid, className: className = "", type: type} = props;
|
|
1729
|
+
let validationClass = "";
|
|
1730
|
+
invalid ? validationClass = INPUT_CLASSES_INVALID : valid && (validationClass = INPUT_CLASSES_VALID);
|
|
1731
|
+
return `${INPUT_CLASSES_BASE} ${"md" === size ? "" : "sm" === size ? INPUT_CLASSES_SMALL : INPUT_CLASSES_LARGE} ${variant ? `c-input--${variant}` : ""} ${"textarea" === type ? "c-input--textarea" : ""} ${validationClass} ${disabled ? INPUT_CLASSES_DISABLED : ""} ${className}`.trim();
|
|
1732
|
+
},
|
|
1733
|
+
generateWrapperClass: props => {
|
|
1734
|
+
const {className: className = ""} = props, {prefixIcon: prefixIcon = !1, suffixIcon: suffixIcon = !1, clearable: clearable = !1, showCounter: showCounter = !1, showPasswordToggle: showPasswordToggle = !1, fullWidth: fullWidth = !1} = initialProps || {}, classes = [ INPUT_ELEMENTS_WRAPPER ];
|
|
1735
|
+
return prefixIcon && classes.push(INPUT_CLASSES_PREFIX_ICON), (suffixIcon || clearable || showPasswordToggle) && classes.push(INPUT_CLASSES_SUFFIX_ICON),
|
|
1736
|
+
clearable && classes.push(INPUT_CLASSES_CLEARABLE), showCounter && classes.push(INPUT_CLASSES_WITH_COUNTER),
|
|
1737
|
+
showPasswordToggle && classes.push(INPUT_CLASSES_PASSWORD_TOGGLE), fullWidth && classes.push(INPUT_CLASSES_FULL_WIDTH),
|
|
1738
|
+
className && classes.push(className), classes.filter(Boolean).join(" ");
|
|
1739
|
+
}
|
|
1740
|
+
};
|
|
1741
|
+
}({
|
|
1742
|
+
size: size,
|
|
1743
|
+
variant: variant,
|
|
1744
|
+
disabled: disabled,
|
|
1745
|
+
invalid: invalid,
|
|
1746
|
+
valid: valid
|
|
1747
|
+
}), inputClass = generateInputClass({
|
|
1748
|
+
className: `${className} ${glass ? "c-input--glass" : ""}`.trim(),
|
|
1749
|
+
size: size,
|
|
1750
|
+
variant: variant,
|
|
1751
|
+
disabled: disabled,
|
|
1752
|
+
invalid: invalid,
|
|
1753
|
+
valid: valid,
|
|
1754
|
+
type: type
|
|
1755
|
+
}), inputElement = jsx("input", {
|
|
1756
|
+
ref: ref,
|
|
1757
|
+
type: type,
|
|
1758
|
+
className: inputClass,
|
|
1759
|
+
value: value,
|
|
1760
|
+
onChange: onChange,
|
|
1761
|
+
onBlur: onBlur,
|
|
1762
|
+
onFocus: onFocus,
|
|
1763
|
+
placeholder: placeholder,
|
|
1764
|
+
disabled: disabled,
|
|
1765
|
+
required: required,
|
|
1766
|
+
readOnly: readOnly,
|
|
1767
|
+
id: id,
|
|
1768
|
+
name: name,
|
|
1769
|
+
autoComplete: autoComplete,
|
|
1770
|
+
autoFocus: autoFocus,
|
|
1771
|
+
maxLength: maxLength,
|
|
1772
|
+
minLength: minLength,
|
|
1773
|
+
pattern: pattern,
|
|
1774
|
+
min: min,
|
|
1775
|
+
max: max,
|
|
1776
|
+
step: step,
|
|
1777
|
+
"aria-label": ariaLabel,
|
|
1778
|
+
"aria-describedby": ariaDescribedBy,
|
|
1779
|
+
"aria-invalid": invalid,
|
|
1780
|
+
style: glass ? {
|
|
1781
|
+
...style
|
|
1782
|
+
} : style
|
|
1783
|
+
});
|
|
1784
|
+
if (glass) {
|
|
1785
|
+
// Default glass settings for inputs
|
|
1786
|
+
const defaultGlassProps = {
|
|
1787
|
+
displacementScale: 60,
|
|
1788
|
+
blurAmount: 1,
|
|
1789
|
+
saturation: 180,
|
|
1790
|
+
aberrationIntensity: .2,
|
|
1791
|
+
cornerRadius: 12,
|
|
1792
|
+
mode: "shader"
|
|
1793
|
+
}, glassProps = !0 === glass ? defaultGlassProps : {
|
|
1794
|
+
...defaultGlassProps,
|
|
1795
|
+
...glass
|
|
1796
|
+
};
|
|
1797
|
+
return jsx(AtomixGlass, {
|
|
1798
|
+
...glassProps,
|
|
1799
|
+
children: inputElement
|
|
1800
|
+
});
|
|
1801
|
+
}
|
|
1802
|
+
return inputElement;
|
|
1803
|
+
})));
|
|
1804
|
+
|
|
1805
|
+
Input.displayName = "Input";
|
|
1806
|
+
|
|
1807
|
+
/**
|
|
1808
|
+
* Radio - A component for radio button inputs
|
|
1809
|
+
*/
|
|
1810
|
+
const Radio = memo((({label: label, checked: checked = !1, onChange: onChange, className: className = "", style: style, disabled: disabled = !1, required: required = !1, id: id, name: name, value: value, invalid: invalid = !1, valid: valid = !1, ariaLabel: ariaLabel, ariaDescribedBy: ariaDescribedBy, glass: glass}) => {
|
|
1811
|
+
const {generateRadioClass: generateRadioClass} =
|
|
1812
|
+
/**
|
|
1813
|
+
* Radio state and functionality
|
|
1814
|
+
* @param initialProps - Initial radio properties
|
|
1815
|
+
* @returns Radio state and methods
|
|
1816
|
+
*/
|
|
1817
|
+
function(initialProps) {
|
|
1818
|
+
// Default radio properties
|
|
1819
|
+
const defaultProps = {
|
|
1820
|
+
disabled: !1,
|
|
1821
|
+
invalid: !1,
|
|
1822
|
+
valid: !1,
|
|
1823
|
+
...initialProps
|
|
1824
|
+
};
|
|
1825
|
+
/**
|
|
1826
|
+
* Generate radio class based on properties
|
|
1827
|
+
* @param props - Radio properties
|
|
1828
|
+
* @returns Class string
|
|
1829
|
+
*/ return {
|
|
1830
|
+
defaultProps: defaultProps,
|
|
1831
|
+
generateRadioClass: props => {
|
|
1832
|
+
const {disabled: disabled = defaultProps.disabled, invalid: invalid = defaultProps.invalid, valid: valid = defaultProps.valid, className: className = ""} = props;
|
|
1833
|
+
let validationClass = "";
|
|
1834
|
+
invalid ? validationClass = RADIO_CLASSES_INVALID : valid && (validationClass = RADIO_CLASSES_VALID);
|
|
1835
|
+
return `${RADIO_CLASSES_BASE} ${validationClass} ${disabled ? RADIO_CLASSES_DISABLED : ""} ${className}`.trim();
|
|
1836
|
+
}
|
|
1837
|
+
};
|
|
1838
|
+
}({
|
|
1839
|
+
disabled: disabled,
|
|
1840
|
+
invalid: invalid,
|
|
1841
|
+
valid: valid
|
|
1842
|
+
}), radioClass = generateRadioClass({
|
|
1843
|
+
className: `${className} ${glass ? "c-radio--glass" : ""}`.trim(),
|
|
1844
|
+
disabled: disabled,
|
|
1845
|
+
invalid: invalid,
|
|
1846
|
+
valid: valid
|
|
1847
|
+
}), radioContent = jsxs("div", {
|
|
1848
|
+
className: radioClass,
|
|
1849
|
+
style: style,
|
|
1850
|
+
children: [ jsx("input", {
|
|
1851
|
+
type: "radio",
|
|
1852
|
+
className: "c-radio__input",
|
|
1853
|
+
checked: checked,
|
|
1854
|
+
onChange: onChange,
|
|
1855
|
+
disabled: disabled,
|
|
1856
|
+
required: required,
|
|
1857
|
+
id: id,
|
|
1858
|
+
name: name,
|
|
1859
|
+
value: value,
|
|
1860
|
+
"aria-label": label ? void 0 : ariaLabel,
|
|
1861
|
+
"aria-describedby": ariaDescribedBy,
|
|
1862
|
+
"aria-invalid": invalid
|
|
1863
|
+
}), label && jsx("label", {
|
|
1864
|
+
className: "c-radio__label",
|
|
1865
|
+
htmlFor: id,
|
|
1866
|
+
children: label
|
|
1867
|
+
}) ]
|
|
1868
|
+
});
|
|
1869
|
+
if (glass) {
|
|
1870
|
+
// Default glass settings for radio buttons
|
|
1871
|
+
const defaultGlassProps = {
|
|
1872
|
+
displacementScale: 40,
|
|
1873
|
+
blurAmount: 1,
|
|
1874
|
+
saturation: 160,
|
|
1875
|
+
aberrationIntensity: .3,
|
|
1876
|
+
cornerRadius: 6,
|
|
1877
|
+
mode: "shader"
|
|
1878
|
+
}, glassProps = !0 === glass ? defaultGlassProps : {
|
|
1879
|
+
...defaultGlassProps,
|
|
1880
|
+
...glass
|
|
1881
|
+
};
|
|
1882
|
+
return jsx(AtomixGlass, {
|
|
1883
|
+
...glassProps,
|
|
1884
|
+
children: radioContent
|
|
1885
|
+
});
|
|
1886
|
+
}
|
|
1887
|
+
return radioContent;
|
|
1888
|
+
}));
|
|
1889
|
+
|
|
1890
|
+
Radio.displayName = "Radio";
|
|
1891
|
+
|
|
1892
|
+
/**
|
|
1893
|
+
* Select - A component for dropdown selection
|
|
1894
|
+
*/
|
|
1895
|
+
const Select = memo((({options: options = [], value: value, onChange: onChange, onBlur: onBlur, onFocus: onFocus, placeholder: placeholder = "Select an option", className: className = "", style: style, disabled: disabled = !1, required: required = !1, id: id, name: name, size: size = "md", invalid: invalid = !1, valid: valid = !1, multiple: multiple = !1, ariaLabel: ariaLabel, ariaDescribedBy: ariaDescribedBy, glass: glass}) => {
|
|
1896
|
+
const {generateSelectClass: generateSelectClass} =
|
|
1897
|
+
/**
|
|
1898
|
+
* Select state and functionality
|
|
1899
|
+
* @param initialProps - Initial select properties
|
|
1900
|
+
* @returns Select state and methods
|
|
1901
|
+
*/
|
|
1902
|
+
function(initialProps) {
|
|
1903
|
+
// Default select properties
|
|
1904
|
+
const defaultProps = {
|
|
1905
|
+
size: "md",
|
|
1906
|
+
disabled: !1,
|
|
1907
|
+
invalid: !1,
|
|
1908
|
+
valid: !1,
|
|
1909
|
+
...initialProps
|
|
1910
|
+
};
|
|
1911
|
+
/**
|
|
1912
|
+
* Generate select class based on properties
|
|
1913
|
+
* @param props - Select properties
|
|
1914
|
+
* @returns Class string
|
|
1915
|
+
*/ return {
|
|
1916
|
+
defaultProps: defaultProps,
|
|
1917
|
+
generateSelectClass: props => {
|
|
1918
|
+
const {size: size = defaultProps.size, disabled: disabled = defaultProps.disabled, invalid: invalid = defaultProps.invalid, valid: valid = defaultProps.valid, className: className = ""} = props;
|
|
1919
|
+
let validationClass = "";
|
|
1920
|
+
invalid ? validationClass = SELECT_CLASSES_INVALID : valid && (validationClass = SELECT_CLASSES_VALID);
|
|
1921
|
+
return `${SELECT_CLASSES_BASE} ${"md" === size ? "" : "sm" === size ? SELECT_CLASSES_SMALL : SELECT_CLASSES_LARGE} ${validationClass} ${disabled ? SELECT_CLASSES_DISABLED : ""} ${className}`.trim();
|
|
1922
|
+
}
|
|
1923
|
+
};
|
|
1924
|
+
}
|
|
1925
|
+
/**
|
|
1926
|
+
* Textarea state and functionality
|
|
1927
|
+
* @param initialProps - Initial textarea properties
|
|
1928
|
+
* @returns Textarea state and methods
|
|
1929
|
+
*/ ({
|
|
1930
|
+
size: size,
|
|
1931
|
+
disabled: disabled,
|
|
1932
|
+
invalid: invalid,
|
|
1933
|
+
valid: valid
|
|
1934
|
+
}), selectClass = generateSelectClass({
|
|
1935
|
+
className: `${className} ${glass ? "c-select--glass" : ""}`.trim(),
|
|
1936
|
+
size: size,
|
|
1937
|
+
disabled: disabled,
|
|
1938
|
+
invalid: invalid,
|
|
1939
|
+
valid: valid
|
|
1940
|
+
}), [isOpen, setIsOpen] = useState(!1), [selectedLabel, setSelectedLabel] = useState(placeholder), dropdownRef = useRef(null), panelRef = useRef(null), bodyRef = useRef(null), nativeSelectRef = useRef(null);
|
|
1941
|
+
// Update selected label when value changes
|
|
1942
|
+
useEffect((() => {
|
|
1943
|
+
if (value) {
|
|
1944
|
+
const selectedOption = options.find((opt => opt.value === value));
|
|
1945
|
+
selectedOption && setSelectedLabel(selectedOption.label);
|
|
1946
|
+
} else setSelectedLabel(placeholder);
|
|
1947
|
+
}), [ value, options, placeholder ]),
|
|
1948
|
+
// Handle click outside to close dropdown
|
|
1949
|
+
useEffect((() => {
|
|
1950
|
+
const handleClickOutside = event => {
|
|
1951
|
+
dropdownRef.current && !dropdownRef.current.contains(event.target) && (setIsOpen(!1),
|
|
1952
|
+
bodyRef.current && (bodyRef.current.style.height = "0px"));
|
|
1953
|
+
};
|
|
1954
|
+
return document.addEventListener("mousedown", handleClickOutside), () => {
|
|
1955
|
+
document.removeEventListener("mousedown", handleClickOutside);
|
|
1956
|
+
};
|
|
1957
|
+
}), []);
|
|
1958
|
+
// Toggle dropdown
|
|
1959
|
+
const selectContent = jsxs("div", {
|
|
1960
|
+
className: `${selectClass} ${isOpen ? SELECT_CLASSES_IS_OPEN : ""}`,
|
|
1961
|
+
ref: dropdownRef,
|
|
1962
|
+
style: style,
|
|
1963
|
+
"aria-expanded": isOpen,
|
|
1964
|
+
children: [ jsxs("select", {
|
|
1965
|
+
ref: nativeSelectRef,
|
|
1966
|
+
value: value,
|
|
1967
|
+
onChange: onChange,
|
|
1968
|
+
onBlur: onBlur,
|
|
1969
|
+
onFocus: onFocus,
|
|
1970
|
+
disabled: disabled,
|
|
1971
|
+
required: required,
|
|
1972
|
+
id: id,
|
|
1973
|
+
name: name,
|
|
1974
|
+
multiple: multiple,
|
|
1975
|
+
"aria-label": ariaLabel,
|
|
1976
|
+
"aria-describedby": ariaDescribedBy,
|
|
1977
|
+
"aria-invalid": invalid,
|
|
1978
|
+
style: {
|
|
1979
|
+
display: "none"
|
|
1980
|
+
},
|
|
1981
|
+
children: [ placeholder && jsx("option", {
|
|
1982
|
+
value: "",
|
|
1983
|
+
disabled: !0,
|
|
1984
|
+
children: placeholder
|
|
1985
|
+
}), options.map((option => jsx("option", {
|
|
1986
|
+
value: option.value,
|
|
1987
|
+
disabled: option.disabled,
|
|
1988
|
+
children: option.label
|
|
1989
|
+
}, option.value))) ]
|
|
1990
|
+
}), jsx("div", {
|
|
1991
|
+
className: SELECT_CLASSES_SELECTED,
|
|
1992
|
+
onClick: () => {
|
|
1993
|
+
disabled || (!isOpen && bodyRef.current && panelRef.current ? bodyRef.current.style.height = `${panelRef.current.clientHeight}px` : bodyRef.current && (bodyRef.current.style.height = "0px"),
|
|
1994
|
+
setIsOpen(!isOpen));
|
|
1995
|
+
},
|
|
1996
|
+
"aria-disabled": disabled,
|
|
1997
|
+
children: selectedLabel
|
|
1998
|
+
}), jsx("i", {
|
|
1999
|
+
className: `${SELECT_CLASSES_ICON_CARET} ${SELECT_CLASSES_TOGGLE_ICON}`
|
|
2000
|
+
}), jsx("div", {
|
|
2001
|
+
className: SELECT_CLASSES_SELECT_BODY,
|
|
2002
|
+
ref: bodyRef,
|
|
2003
|
+
style: {
|
|
2004
|
+
height: 0
|
|
2005
|
+
},
|
|
2006
|
+
children: jsx("div", {
|
|
2007
|
+
className: SELECT_CLASSES_SELECT_PANEL,
|
|
2008
|
+
ref: panelRef,
|
|
2009
|
+
children: jsx("ul", {
|
|
2010
|
+
className: SELECT_CLASSES_SELECT_ITEMS,
|
|
2011
|
+
children: options.map(((option, index) => jsx("li", {
|
|
2012
|
+
className: SELECT_CLASSES_SELECT_ITEM,
|
|
2013
|
+
"data-value": option.value,
|
|
2014
|
+
onClick: () => !option.disabled && (option => {
|
|
2015
|
+
if (setSelectedLabel(option.label), setIsOpen(!1), bodyRef.current && (bodyRef.current.style.height = "0px"),
|
|
2016
|
+
nativeSelectRef.current && (nativeSelectRef.current.value = option.value), onChange) {
|
|
2017
|
+
// Create a synthetic event
|
|
2018
|
+
const event = {
|
|
2019
|
+
target: {
|
|
2020
|
+
name: name,
|
|
2021
|
+
value: option.value
|
|
2022
|
+
}
|
|
2023
|
+
};
|
|
2024
|
+
onChange(event);
|
|
2025
|
+
}
|
|
2026
|
+
})(option),
|
|
2027
|
+
children: jsxs("label", {
|
|
2028
|
+
htmlFor: `SelectItem${index}`,
|
|
2029
|
+
className: "c-checkbox",
|
|
2030
|
+
children: [ jsx("input", {
|
|
2031
|
+
type: "checkbox",
|
|
2032
|
+
id: `SelectItem${index}`,
|
|
2033
|
+
className: "c-checkbox__input c-select__item-input",
|
|
2034
|
+
checked: value === option.value,
|
|
2035
|
+
readOnly: !0,
|
|
2036
|
+
disabled: option.disabled
|
|
2037
|
+
}), jsx("div", {
|
|
2038
|
+
className: "c-select__item-label",
|
|
2039
|
+
children: option.label
|
|
2040
|
+
}) ]
|
|
2041
|
+
})
|
|
2042
|
+
}, option.value)))
|
|
2043
|
+
})
|
|
2044
|
+
})
|
|
2045
|
+
}) ]
|
|
2046
|
+
});
|
|
2047
|
+
// Handle item selection
|
|
2048
|
+
if (glass) {
|
|
2049
|
+
// Default glass settings for select components
|
|
2050
|
+
const defaultGlassProps = {
|
|
2051
|
+
displacementScale: 60,
|
|
2052
|
+
blurAmount: 1,
|
|
2053
|
+
saturation: 180,
|
|
2054
|
+
aberrationIntensity: .2,
|
|
2055
|
+
cornerRadius: 12,
|
|
2056
|
+
mode: "shader"
|
|
2057
|
+
}, glassProps = !0 === glass ? defaultGlassProps : {
|
|
2058
|
+
...defaultGlassProps,
|
|
2059
|
+
...glass
|
|
2060
|
+
};
|
|
2061
|
+
return jsx(AtomixGlass, {
|
|
2062
|
+
...glassProps,
|
|
2063
|
+
children: selectContent
|
|
2064
|
+
});
|
|
2065
|
+
}
|
|
2066
|
+
return selectContent;
|
|
2067
|
+
}));
|
|
2068
|
+
|
|
2069
|
+
Select.displayName = "Select";
|
|
2070
|
+
|
|
2071
|
+
/**
|
|
2072
|
+
* Textarea - A component for multiline text input
|
|
2073
|
+
*/
|
|
2074
|
+
const Textarea = memo( forwardRef((({value: value, onChange: onChange, onBlur: onBlur, onFocus: onFocus, placeholder: placeholder, className: className = "", style: style, disabled: disabled = !1, required: required = !1, readOnly: readOnly = !1, id: id, name: name, rows: rows = 4, cols: cols, maxLength: maxLength, minLength: minLength, size: size = "md", variant: variant, invalid: invalid = !1, valid: valid = !1, autoFocus: autoFocus = !1, ariaLabel: ariaLabel, ariaDescribedBy: ariaDescribedBy, glass: glass}, ref) => {
|
|
2075
|
+
const {generateTextareaClass: generateTextareaClass} = function(initialProps) {
|
|
2076
|
+
// Default textarea properties
|
|
2077
|
+
const defaultProps = {
|
|
2078
|
+
size: "md",
|
|
2079
|
+
disabled: !1,
|
|
2080
|
+
invalid: !1,
|
|
2081
|
+
valid: !1,
|
|
2082
|
+
...initialProps
|
|
2083
|
+
};
|
|
2084
|
+
/**
|
|
2085
|
+
* Generate textarea class based on properties
|
|
2086
|
+
* @param props - Textarea properties
|
|
2087
|
+
* @returns Class string
|
|
2088
|
+
*/ return {
|
|
2089
|
+
defaultProps: defaultProps,
|
|
2090
|
+
generateTextareaClass: props => {
|
|
2091
|
+
const {size: size = defaultProps.size, variant: variant = defaultProps.variant, disabled: disabled = defaultProps.disabled, invalid: invalid = defaultProps.invalid, valid: valid = defaultProps.valid, className: className = ""} = props;
|
|
2092
|
+
let validationClass = "";
|
|
2093
|
+
invalid ? validationClass = TEXTAREA_CLASSES_INVALID : valid && (validationClass = TEXTAREA_CLASSES_VALID);
|
|
2094
|
+
return `${TEXTAREA_CLASSES_BASE} ${"md" === size ? "" : "sm" === size ? TEXTAREA_CLASSES_SMALL : TEXTAREA_CLASSES_LARGE} ${variant ? `c-input--${variant}` : ""} ${validationClass} ${disabled ? TEXTAREA_CLASSES_DISABLED : ""} ${className}`.trim();
|
|
2095
|
+
}
|
|
2096
|
+
};
|
|
2097
|
+
}({
|
|
2098
|
+
size: size,
|
|
2099
|
+
variant: variant,
|
|
2100
|
+
disabled: disabled,
|
|
2101
|
+
invalid: invalid,
|
|
2102
|
+
valid: valid
|
|
2103
|
+
}), textareaClass = generateTextareaClass({
|
|
2104
|
+
className: `${className} ${glass ? "c-input--glass" : ""}`.trim(),
|
|
2105
|
+
size: size,
|
|
2106
|
+
variant: variant,
|
|
2107
|
+
disabled: disabled,
|
|
2108
|
+
invalid: invalid,
|
|
2109
|
+
valid: valid
|
|
2110
|
+
}), textareaElement = jsx("textarea", {
|
|
2111
|
+
ref: ref,
|
|
2112
|
+
className: textareaClass,
|
|
2113
|
+
value: value,
|
|
2114
|
+
onChange: onChange,
|
|
2115
|
+
onBlur: onBlur,
|
|
2116
|
+
onFocus: onFocus,
|
|
2117
|
+
placeholder: placeholder,
|
|
2118
|
+
disabled: disabled,
|
|
2119
|
+
required: required,
|
|
2120
|
+
readOnly: readOnly,
|
|
2121
|
+
id: id,
|
|
2122
|
+
name: name,
|
|
2123
|
+
rows: rows,
|
|
2124
|
+
cols: cols,
|
|
2125
|
+
maxLength: maxLength,
|
|
2126
|
+
minLength: minLength,
|
|
2127
|
+
autoFocus: autoFocus,
|
|
2128
|
+
"aria-label": ariaLabel,
|
|
2129
|
+
"aria-describedby": ariaDescribedBy,
|
|
2130
|
+
"aria-invalid": invalid,
|
|
2131
|
+
style: glass ? {
|
|
2132
|
+
...style
|
|
2133
|
+
} : style
|
|
2134
|
+
});
|
|
2135
|
+
if (glass) {
|
|
2136
|
+
// Default glass settings for textareas
|
|
2137
|
+
const defaultGlassProps = {
|
|
2138
|
+
displacementScale: 60,
|
|
2139
|
+
blurAmount: 1,
|
|
2140
|
+
saturation: 180,
|
|
2141
|
+
aberrationIntensity: 1,
|
|
2142
|
+
cornerRadius: 8,
|
|
2143
|
+
mode: "shader"
|
|
2144
|
+
}, glassProps = !0 === glass ? defaultGlassProps : {
|
|
2145
|
+
...defaultGlassProps,
|
|
2146
|
+
...glass
|
|
2147
|
+
};
|
|
2148
|
+
return jsx(AtomixGlass, {
|
|
2149
|
+
...glassProps,
|
|
2150
|
+
children: textareaElement
|
|
2151
|
+
});
|
|
2152
|
+
}
|
|
2153
|
+
return textareaElement;
|
|
2154
|
+
})));
|
|
2155
|
+
|
|
2156
|
+
Textarea.displayName = "Textarea";
|
|
2157
|
+
|
|
2158
|
+
// Adapted from https://github.com/shuding/liquid-glass
|
|
2159
|
+
// Constants
|
|
2160
|
+
const smoothStep = (a, b, t) => {
|
|
2161
|
+
// Add input validation
|
|
2162
|
+
if ("number" != typeof a || "number" != typeof b || "number" != typeof t) return 0;
|
|
2163
|
+
const clamped = Math.max(0, Math.min(1, (t - a) / (b - a)));
|
|
2164
|
+
return clamped * clamped * (3 - 2 * clamped);
|
|
2165
|
+
}, calculateLength = (x, y) => {
|
|
2166
|
+
// Add input validation and error handling
|
|
2167
|
+
if ("number" != typeof x || "number" != typeof y || isNaN(x) || isNaN(y)) return 0;
|
|
2168
|
+
// Prevent potential overflow
|
|
2169
|
+
const maxX = Math.max(Math.abs(x), Math.abs(y));
|
|
2170
|
+
if (0 === maxX) return 0;
|
|
2171
|
+
const scaledX = x / maxX, scaledY = y / maxX;
|
|
2172
|
+
return maxX * Math.sqrt(scaledX * scaledX + scaledY * scaledY);
|
|
2173
|
+
}, roundedRectSDF = (x, y, width, height, radius) => {
|
|
2174
|
+
// Add input validation
|
|
2175
|
+
if ("number" != typeof x || "number" != typeof y || "number" != typeof width || "number" != typeof height || "number" != typeof radius) return 0;
|
|
2176
|
+
const qx = Math.abs(x) - width + radius, qy = Math.abs(y) - height + radius;
|
|
2177
|
+
return Math.min(Math.max(qx, qy), 0) + calculateLength(Math.max(qx, 0), Math.max(qy, 0)) - radius;
|
|
2178
|
+
}, createTexture = (x, y) => ({
|
|
2179
|
+
x: "number" != typeof x || isNaN(x) ? .5 : Math.max(0, Math.min(1, x)),
|
|
2180
|
+
y: "number" != typeof y || isNaN(y) ? .5 : Math.max(0, Math.min(1, y))
|
|
2181
|
+
}), validateVec2 = vec => vec && "number" == typeof vec.x && "number" == typeof vec.y && !isNaN(vec.x) && !isNaN(vec.y), clampValue = (value, min, max) =>
|
|
2182
|
+
// Add input validation
|
|
2183
|
+
"number" != typeof value || "number" != typeof min || "number" != typeof max || isNaN(value) ? min : isNaN(min) ? 0 : isNaN(max) ? 1 : Math.max(min, Math.min(max, value)), easeInOutCubic = t => {
|
|
2184
|
+
// Add input validation
|
|
2185
|
+
if ("number" != typeof t || isNaN(t)) return 0;
|
|
2186
|
+
const clampedT = Math.max(0, Math.min(1, t));
|
|
2187
|
+
return clampedT < .5 ? 4 * clampedT * clampedT * clampedT : 1 - Math.pow(-2 * clampedT + 2, 3) / 2;
|
|
2188
|
+
}, easeOutQuart = t => {
|
|
2189
|
+
// Add input validation
|
|
2190
|
+
if ("number" != typeof t || isNaN(t)) return 0;
|
|
2191
|
+
const clampedT = Math.max(0, Math.min(1, t));
|
|
2192
|
+
return 1 - Math.pow(1 - clampedT, 4);
|
|
2193
|
+
}, noise2D = (x, y) => {
|
|
2194
|
+
// Add input validation
|
|
2195
|
+
if ("number" != typeof x || "number" != typeof y || isNaN(x) || isNaN(y)) return 0;
|
|
2196
|
+
const X = 255 & Math.floor(x), Y = 255 & Math.floor(y), xf = x - Math.floor(x), yf = y - Math.floor(y), u = easeInOutCubic(xf), v = easeInOutCubic(yf), hash = (i, j) => {
|
|
2197
|
+
// Add input validation
|
|
2198
|
+
if ("number" != typeof i || "number" != typeof j) return 0;
|
|
2199
|
+
const n = i + 57 * j, hashed = 43758.5453 * Math.sin(12.9898 * n + 78.233);
|
|
2200
|
+
// Use a more stable hash function
|
|
2201
|
+
return hashed - Math.floor(hashed);
|
|
2202
|
+
}, a = hash(X, Y), b = hash(X + 1, Y), c = hash(X, Y + 1), x1 = a + u * (b - a);
|
|
2203
|
+
return x1 + v * (c + u * (hash(X + 1, Y + 1) - c) - x1);
|
|
2204
|
+
}, fbm = (x, y, octaves = 4) => {
|
|
2205
|
+
// Add input validation
|
|
2206
|
+
if ("number" != typeof x || "number" != typeof y || isNaN(x) || isNaN(y)) return 0;
|
|
2207
|
+
// Clamp octaves to prevent performance issues
|
|
2208
|
+
const clampedOctaves = Math.max(1, Math.min(8, Math.floor(octaves)));
|
|
2209
|
+
let value = 0, amplitude = .5, frequency = 1;
|
|
2210
|
+
for (let i = 0; i < clampedOctaves; i++) value += amplitude * noise2D(x * frequency, y * frequency),
|
|
2211
|
+
frequency *= 2, amplitude *= .5;
|
|
2212
|
+
return value;
|
|
2213
|
+
}, calculateParallaxOffset = (x, y, depth, mouseX = 0, mouseY = 0) => {
|
|
2214
|
+
// Add input validation
|
|
2215
|
+
if ("number" != typeof x || "number" != typeof y || "number" != typeof depth || "number" != typeof mouseX || "number" != typeof mouseY || isNaN(x) || isNaN(y) || isNaN(depth) || isNaN(mouseX) || isNaN(mouseY)) return {
|
|
2216
|
+
x: 0,
|
|
2217
|
+
y: 0
|
|
2218
|
+
};
|
|
2219
|
+
const parallaxStrength = Math.min(.02 * depth, .1);
|
|
2220
|
+
// Limit strength to prevent extreme values
|
|
2221
|
+
// Calculate offset based on view angle (simulated by mouse position)
|
|
2222
|
+
return {
|
|
2223
|
+
x: (x - mouseX) * parallaxStrength,
|
|
2224
|
+
y: (y - mouseY) * parallaxStrength
|
|
2225
|
+
};
|
|
2226
|
+
}, fragmentShaders = {
|
|
2227
|
+
liquidGlass: (uv, mousePosition) => {
|
|
2228
|
+
if (!validateVec2(uv)) return {
|
|
2229
|
+
x: .5,
|
|
2230
|
+
y: .5
|
|
2231
|
+
};
|
|
2232
|
+
const ix = uv.x - .5, iy = uv.y - .5, time = 8e-4 * Date.now(), mouseX = mousePosition && validateVec2(mousePosition) ? mousePosition.x - .5 : 0, mouseY = mousePosition && validateVec2(mousePosition) ? mousePosition.y - .5 : 0, mouseDistance = calculateLength(mouseX, mouseY), mouseFalloff = easeOutQuart(1 - Math.min(2 * mouseDistance, 1)), organicFlow = fbm(12 * (ix + .5 * mouseX) + time, 12 * (iy + .5 * mouseY) + .7 * time, 3) - .5, distanceToEdge = roundedRectSDF(ix, iy, .4, .3, .35), baseDisplacement = smoothStep(.8, 0, distanceToEdge - .05), radialDist = ((x, y, strength) => {
|
|
2233
|
+
// Add input validation
|
|
2234
|
+
if ("number" != typeof x || "number" != typeof y || isNaN(x) || isNaN(y) || isNaN(strength)) return {
|
|
2235
|
+
x: 0,
|
|
2236
|
+
y: 0
|
|
2237
|
+
};
|
|
2238
|
+
const distance = calculateLength(x, y), distortion = Math.pow(Math.min(distance, 10), 2) * strength;
|
|
2239
|
+
// Limit distance to prevent extreme values
|
|
2240
|
+
return {
|
|
2241
|
+
x: x * (1 + distortion),
|
|
2242
|
+
y: y * (1 + distortion)
|
|
2243
|
+
};
|
|
2244
|
+
})(ix, iy, .4 * .1), refractionX = 1.2 * (radialDist.x - ix) * baseDisplacement, refractionY = 1.2 * (radialDist.y - iy) * baseDisplacement, flowX = .018 * Math.sin(8 * (ix + 2 * mouseX) + 2 * time), flowY = .018 * Math.cos(8 * (iy + 2 * mouseY) + 1.5 * time), rippleEffect = (.015 * Math.sin(12 * (ix - mouseX) + 12 * (iy - mouseY) + 3 * time) + .012 * Math.cos(10 * (ix + mouseX) - 10 * (iy - mouseY) - 2 * time)) * mouseFalloff * mouseDistance, depthEffect = (Math.sin(15 * ix + time) * Math.cos(15 * iy - time) * .008 + Math.sin(20 * ix - .5 * time) * Math.cos(20 * iy + .5 * time) * .006) * baseDisplacement, liquidFlow = .85 * (flowX + flowY + .025 * organicFlow), totalDistortionX = refractionX + liquidFlow + rippleEffect + depthEffect, totalDistortionY = refractionY + .8 * liquidFlow + .9 * rippleEffect + depthEffect, chromaticOffset = ((x, y, intensity) => {
|
|
2245
|
+
// Add input validation
|
|
2246
|
+
if ("number" != typeof x || "number" != typeof y || "number" != typeof intensity || isNaN(x) || isNaN(y) || isNaN(intensity)) return {
|
|
2247
|
+
x: 0,
|
|
2248
|
+
y: 0
|
|
2249
|
+
};
|
|
2250
|
+
const distance = calculateLength(x, y);
|
|
2251
|
+
// Prevent division by zero and extreme values
|
|
2252
|
+
if (0 === distance) return {
|
|
2253
|
+
x: 0,
|
|
2254
|
+
y: 0
|
|
2255
|
+
};
|
|
2256
|
+
const angle = Math.atan2(y, x);
|
|
2257
|
+
return {
|
|
2258
|
+
x: Math.cos(angle) * distance * intensity,
|
|
2259
|
+
y: Math.sin(angle) * distance * intensity
|
|
2260
|
+
};
|
|
2261
|
+
})(ix, iy, .015 * baseDisplacement), scaled = smoothStep(0, 1, 1.15 * baseDisplacement), finalX = ix + totalDistortionX + .5 * chromaticOffset.x, finalY = iy + totalDistortionY + .5 * chromaticOffset.y;
|
|
2262
|
+
return createTexture(clampValue(finalX * scaled + .5, 0, 1), clampValue(finalY * scaled + .5, 0, 1));
|
|
2263
|
+
},
|
|
2264
|
+
// Premium Apple-style fluid glass with enhanced organic flow
|
|
2265
|
+
appleFluid: (uv, mousePosition) => {
|
|
2266
|
+
if (!validateVec2(uv)) return {
|
|
2267
|
+
x: .5,
|
|
2268
|
+
y: .5
|
|
2269
|
+
};
|
|
2270
|
+
const ix = uv.x - .5, iy = uv.y - .5, time = 8e-4 * Date.now() * .6, mouseX = mousePosition && validateVec2(mousePosition) ? mousePosition.x - .5 : 0, mouseY = mousePosition && validateVec2(mousePosition) ? mousePosition.y - .5 : 0, mouseDistance = calculateLength(mouseX, mouseY), mouseFalloff = easeOutQuart(1 - Math.min(1.5 * mouseDistance, 1)), organicX = fbm(10 * (ix + .3 * mouseX) + time, 10 * (iy + .3 * mouseY), 5) - .5, organicY = fbm(10 * (ix - .3 * mouseX), 10 * (iy - .3 * mouseY) + .8 * time, 5) - .5, distanceToEdge = roundedRectSDF(ix, iy, .42, .32, .38), mask = smoothStep(.85, -.1, distanceToEdge), fluidVelocityX = Math.sin(6 * ix + 2 * time) * Math.cos(4 * iy - time) * .025, fluidVelocityY = Math.cos(4 * ix - time) * Math.sin(6 * iy + 2 * time) * .025, vortexAngle = Math.atan2(iy - mouseY, ix - mouseX), vortexStrength = mouseFalloff * mouseDistance * .08, vortexX = Math.cos(vortexAngle + time) * vortexStrength, totalY = iy + (.035 * organicY + fluidVelocityY + Math.sin(vortexAngle + time) * vortexStrength) * mask;
|
|
2271
|
+
return createTexture(clampValue(ix + (.035 * organicX + fluidVelocityX + vortexX) * mask + .5, 0, 1), clampValue(totalY + .5, 0, 1));
|
|
2272
|
+
},
|
|
2273
|
+
// High-end glass with advanced refraction and depth
|
|
2274
|
+
premiumGlass: (uv, mousePosition) => {
|
|
2275
|
+
if (!validateVec2(uv)) return {
|
|
2276
|
+
x: .5,
|
|
2277
|
+
y: .5
|
|
2278
|
+
};
|
|
2279
|
+
const ix = uv.x - .5, iy = uv.y - .5, time = 8e-4 * Date.now() * .4, mouseX = mousePosition && validateVec2(mousePosition) ? mousePosition.x - .5 : 0, mouseY = mousePosition && validateVec2(mousePosition) ? mousePosition.y - .5 : 0, mouseDistance = calculateLength(mouseX, mouseY), centerDistance = calculateLength(ix, iy), refractionStrength = .3 * Math.pow(Math.min(centerDistance, 1), 1.5), refractionAngle = Math.atan2(iy, ix);
|
|
2280
|
+
// Multi-layer depth effect
|
|
2281
|
+
let depthX = 0, depthY = 0;
|
|
2282
|
+
for (let layer = 0; layer < 3; layer++) {
|
|
2283
|
+
const layerScale = 5 * (layer + 1), layerTime = time * (1 + .3 * layer), layerStrength = .01 / (layer + 1);
|
|
2284
|
+
depthX += Math.sin(ix * layerScale + layerTime) * layerStrength, depthY += Math.cos(iy * layerScale - layerTime) * layerStrength;
|
|
2285
|
+
}
|
|
2286
|
+
// Glass refraction with mouse influence
|
|
2287
|
+
const refractionX = Math.cos(refractionAngle) * refractionStrength * (1 + .5 * mouseDistance), refractionY = Math.sin(refractionAngle) * refractionStrength * (1 + .5 * mouseDistance), organicNoise = fbm(8 * ix + time, 8 * iy - time, 2) - .5, distanceToEdge = roundedRectSDF(ix, iy, .43, .33, .36), edgeMask = smoothStep(.9, -.05, distanceToEdge), finalY = iy + (refractionY + depthY + .015 * organicNoise) * edgeMask;
|
|
2288
|
+
return createTexture(clampValue(ix + (refractionX + depthX + .015 * organicNoise) * edgeMask + .5, 0, 1), clampValue(finalY + .5, 0, 1));
|
|
2289
|
+
},
|
|
2290
|
+
// Metallic liquid effect with shimmer
|
|
2291
|
+
liquidMetal: (uv, mousePosition) => {
|
|
2292
|
+
if (!validateVec2(uv)) return {
|
|
2293
|
+
x: .5,
|
|
2294
|
+
y: .5
|
|
2295
|
+
};
|
|
2296
|
+
const ix = uv.x - .5, iy = uv.y - .5, time = 8e-4 * Date.now() * 1.2, mouseX = mousePosition && validateVec2(mousePosition) ? mousePosition.x - .5 : 0, mouseY = mousePosition && validateVec2(mousePosition) ? mousePosition.y - .5 : 0, wave1 = Math.sin(20 * ix + 4 * time) * Math.cos(15 * iy - 3 * time) * .02, wave2 = Math.cos(15 * ix - 2 * time) * Math.sin(20 * iy + 5 * time) * .015, shimmer = .025 * fbm(25 * ix + 2 * time, 25 * iy - 2 * time, 4), flowAngle = Math.atan2(iy - mouseY, ix - mouseX), flowDistance = calculateLength(ix - mouseX, iy - mouseY), flowEffect = .02 * Math.sin(15 * flowDistance - 6 * time) * easeOutQuart(1 - Math.min(2 * flowDistance, 1)), distanceToEdge = roundedRectSDF(ix, iy, .41, .31, .37), mask = smoothStep(.88, -.08, distanceToEdge), totalX = ix + (wave1 + shimmer + Math.cos(flowAngle) * flowEffect) * mask, totalY = iy + (wave2 + .8 * shimmer + Math.sin(flowAngle) * flowEffect) * mask;
|
|
2297
|
+
return createTexture(clampValue(totalX + .5, 0, 1), clampValue(totalY + .5, 0, 1));
|
|
2298
|
+
},
|
|
2299
|
+
// basiBasi - Expert Premium Glass Shader
|
|
2300
|
+
// The most advanced shader with caustics, spectral dispersion, parallax depth, and volumetric effects
|
|
2301
|
+
basiBasi: (uv, mousePosition) => {
|
|
2302
|
+
if (!validateVec2(uv)) return {
|
|
2303
|
+
x: .5,
|
|
2304
|
+
y: .5
|
|
2305
|
+
};
|
|
2306
|
+
const ix = uv.x - .5, iy = uv.y - .5, time = 8e-4 * Date.now() * .5, mouseX = mousePosition && validateVec2(mousePosition) ? mousePosition.x - .5 : 0, mouseY = mousePosition && validateVec2(mousePosition) ? mousePosition.y - .5 : 0, mouseDistance = calculateLength(mouseX, mouseY), mouseFalloff = easeOutQuart(1 - Math.min(1.2 * mouseDistance, 1)), causticIntensity = ((x, y, time, intensity = 1) =>
|
|
2307
|
+
// Add input validation
|
|
2308
|
+
"number" != typeof x || "number" != typeof y || "number" != typeof time || "number" != typeof intensity || isNaN(x) || isNaN(y) || isNaN(time) || isNaN(intensity) ? .5 : .5 * (Math.sin(8 * x + 2 * time) * Math.cos(8 * y - 2 * time) * .5 + Math.sin(8 * (x + .5) * 1.3 - 2 * time * .8) * Math.cos(8 * (y - .3) * 1.3 + 2 * time * .8) * .3 + Math.sin(8 * (x - .3) * .7 + 2 * time * 1.2) * Math.cos(8 * (y + .4) * .7 - 2 * time * 1.2) * .2 + 1) * intensity)(ix, iy, time, .8), causticDistortion = .02 * (causticIntensity - .5), refractionAngle = Math.atan2(iy, ix), spectralDispersion = ((x, y, angle) => {
|
|
2309
|
+
// Add input validation
|
|
2310
|
+
if ("number" != typeof x || "number" != typeof y || "number" != typeof angle || isNaN(x) || isNaN(y) || isNaN(angle) || isNaN(.025)) return {
|
|
2311
|
+
r: {
|
|
2312
|
+
x: 0,
|
|
2313
|
+
y: 0
|
|
2314
|
+
},
|
|
2315
|
+
g: {
|
|
2316
|
+
x: 0,
|
|
2317
|
+
y: 0
|
|
2318
|
+
},
|
|
2319
|
+
b: {
|
|
2320
|
+
x: 0,
|
|
2321
|
+
y: 0
|
|
2322
|
+
}
|
|
2323
|
+
};
|
|
2324
|
+
const distance = calculateLength(x, y), dispersionStrength = Math.min(.025 * distance, 1), redOffset = .8 * dispersionStrength, greenOffset = 1 * dispersionStrength, blueOffset = 1.2 * dispersionStrength;
|
|
2325
|
+
return {
|
|
2326
|
+
r: {
|
|
2327
|
+
x: Math.cos(angle) * redOffset,
|
|
2328
|
+
y: Math.sin(angle) * redOffset
|
|
2329
|
+
},
|
|
2330
|
+
g: {
|
|
2331
|
+
x: Math.cos(angle) * greenOffset,
|
|
2332
|
+
y: Math.sin(angle) * greenOffset
|
|
2333
|
+
},
|
|
2334
|
+
b: {
|
|
2335
|
+
x: Math.cos(angle) * blueOffset,
|
|
2336
|
+
y: Math.sin(angle) * blueOffset
|
|
2337
|
+
}
|
|
2338
|
+
};
|
|
2339
|
+
})(ix, iy, refractionAngle), spectralX = (spectralDispersion.r.x + spectralDispersion.g.x + spectralDispersion.b.x) / 3, spectralY = (spectralDispersion.r.y + spectralDispersion.g.y + spectralDispersion.b.y) / 3;
|
|
2340
|
+
// === MULTI-LAYER PARALLAX DEPTH ===
|
|
2341
|
+
// Create depth perception with 7 layers
|
|
2342
|
+
let parallaxX = 0, parallaxY = 0;
|
|
2343
|
+
for (let layer = 0; layer < 7; layer++) {
|
|
2344
|
+
const parallaxOffset = calculateParallaxOffset(ix, iy, (layer + 1) / 7, mouseX, mouseY), layerNoise = fbm((ix + parallaxOffset.x) * (8 + 2 * layer) + time * (.5 + .1 * layer), (iy + parallaxOffset.y) * (8 + 2 * layer) - time * (.5 + .1 * layer), 3) - .5, layerWeight = 1 / (layer + 1);
|
|
2345
|
+
parallaxX += (parallaxOffset.x + .01 * layerNoise) * layerWeight, parallaxY += (parallaxOffset.y + .01 * layerNoise) * layerWeight;
|
|
2346
|
+
}
|
|
2347
|
+
// Normalize parallax effect
|
|
2348
|
+
parallaxX /= 7, parallaxY /= 7;
|
|
2349
|
+
// === VOLUMETRIC SCATTERING ===
|
|
2350
|
+
// Simulate light scattering through glass volume
|
|
2351
|
+
const volumetricDensity = ((x, y, depth, time) =>
|
|
2352
|
+
// Add input validation
|
|
2353
|
+
"number" != typeof x || "number" != typeof y || "number" != typeof time || isNaN(x) || isNaN(y) || isNaN(.5) || isNaN(time) ? .5 : fbm(5 * x + .5 * time, 5 * y - .5 * time, 3) * Math.exp(2 * -Math.max(0, .5)) * .5 + .5)(ix, iy, 0, time), scatteringX = Math.cos(refractionAngle) * volumetricDensity * .015, scatteringY = Math.sin(refractionAngle) * volumetricDensity * .015, turbulence = ((x, y, time, octaves = 5) => {
|
|
2354
|
+
// Add input validation
|
|
2355
|
+
if ("number" != typeof x || "number" != typeof y || "number" != typeof time || "number" != typeof octaves || isNaN(x) || isNaN(y) || isNaN(time) || isNaN(octaves)) return 0;
|
|
2356
|
+
// Clamp octaves to prevent performance issues
|
|
2357
|
+
const clampedOctaves = Math.max(1, Math.min(8, Math.floor(octaves)));
|
|
2358
|
+
let turbulence = 0, amplitude = 1, frequency = 1;
|
|
2359
|
+
for (let i = 0; i < clampedOctaves; i++) turbulence += Math.abs(noise2D(x * frequency + time, y * frequency - time)) * amplitude,
|
|
2360
|
+
frequency *= 2, amplitude *= .5;
|
|
2361
|
+
return turbulence;
|
|
2362
|
+
})(6 * ix, 6 * iy, time, 6), turbulenceX = .012 * Math.cos(turbulence * Math.PI * 2), turbulenceY = .012 * Math.sin(turbulence * Math.PI * 2), microSurface = ((x, y, time) =>
|
|
2363
|
+
// Add input validation
|
|
2364
|
+
"number" != typeof x || "number" != typeof y || "number" != typeof time || isNaN(x) || isNaN(y) || isNaN(time) ? .5 : .5 * (.7 * fbm(40 * x + .3 * time, 40 * y - .3 * time, 6) + .3 * fbm(80 * x, 80 * y, 4)))(ix, iy, time), microDetailX = .008 * (microSurface - .5), microDetailY = .008 * (microSurface - .5), centerDistance = calculateLength(ix, iy), dynamicRefraction = .35 * Math.pow(Math.min(centerDistance, 1), 1.8) * (1 + mouseFalloff * mouseDistance * .8), refractionX = Math.cos(refractionAngle) * dynamicRefraction, refractionY = Math.sin(refractionAngle) * dynamicRefraction, vortexAngle = Math.atan2(iy - mouseY, ix - mouseX), vortexDistance = calculateLength(ix - mouseX, iy - mouseY), vortexStrength = mouseFalloff * Math.sin(10 * vortexDistance - 3 * time) * .025, vortexX = Math.cos(vortexAngle + 2 * time) * vortexStrength, vortexY = Math.sin(vortexAngle + 2 * time) * vortexStrength, fluidX = Math.sin(10 * ix + 5 * mouseX + 2.5 * time) * Math.cos(8 * iy - 2 * time) * .018, fluidY = Math.cos(8 * ix - 2 * time) * Math.sin(10 * iy + 5 * mouseY + 2.5 * time) * .018, rippleEffect = (.012 * Math.sin(15 * Math.min(centerDistance, 10) - 4 * time) + .008 * Math.cos(20 * Math.min(centerDistance, 10) + 3 * time)) * mouseFalloff, rippleX = Math.cos(refractionAngle) * rippleEffect, rippleY = Math.sin(refractionAngle) * rippleEffect, distanceToEdge = roundedRectSDF(ix, iy, .44, .34, .39), edgeMask = smoothStep(.92, -.12, distanceToEdge), edgeSoftness = smoothStep(.85, .1, distanceToEdge), finalY = iy + (1.2 * refractionY + .8 * spectralY + 1.5 * parallaxY + .9 * scatteringY + 1 * turbulenceY + .6 * microDetailY + 1.3 * vortexY + 1.1 * fluidY + .7 * rippleY + .8 * causticDistortion) * edgeMask * edgeSoftness * .85;
|
|
2365
|
+
return createTexture(clampValue(ix + (1.2 * refractionX + .8 * spectralX + 1.5 * parallaxX + .9 * scatteringX + 1 * turbulenceX + .6 * microDetailX + 1.3 * vortexX + 1.1 * fluidX + .7 * rippleX + causticDistortion) * edgeMask * edgeSoftness * .85 + .5, 0, 1), clampValue(finalY + .5, 0, 1));
|
|
2366
|
+
}
|
|
2367
|
+
}, shaderUtils = Object.freeze( Object.defineProperty({
|
|
2368
|
+
__proto__: null,
|
|
2369
|
+
ShaderDisplacementGenerator: class {
|
|
2370
|
+
constructor(options) {
|
|
2371
|
+
if (this.options = options, this.canvasDPI = 1, !this.validateOptions(options)) throw new Error("Invalid shader options provided");
|
|
2372
|
+
this.canvas = document.createElement("canvas"),
|
|
2373
|
+
// Enhanced validation for canvas dimensions
|
|
2374
|
+
this.canvas.width = Math.max(1, Math.min(4096, Math.round(options.width * this.canvasDPI || 256))),
|
|
2375
|
+
this.canvas.height = Math.max(1, Math.min(4096, Math.round(options.height * this.canvasDPI || 256))),
|
|
2376
|
+
this.canvas.style.display = "none";
|
|
2377
|
+
const context = this.canvas.getContext("2d");
|
|
2378
|
+
if (!context) throw new Error("AtomixGlass: Could not get 2D canvas context");
|
|
2379
|
+
this.context = context;
|
|
2380
|
+
}
|
|
2381
|
+
validateOptions(options) {
|
|
2382
|
+
try {
|
|
2383
|
+
return options && "number" == typeof options.width && options.width > 0 && options.width <= 4096 && "number" == typeof options.height && options.height > 0 && options.height <= 4096 && "function" == typeof options.fragment;
|
|
2384
|
+
} catch (e) {
|
|
2385
|
+
// Graceful error handling
|
|
2386
|
+
return !1;
|
|
2387
|
+
}
|
|
2388
|
+
}
|
|
2389
|
+
updateShader(mousePosition) {
|
|
2390
|
+
try {
|
|
2391
|
+
const w = this.options.width * this.canvasDPI, h = this.options.height * this.canvasDPI;
|
|
2392
|
+
let maxScale = 0;
|
|
2393
|
+
const rawValues = [];
|
|
2394
|
+
// Calculate displacement values with enhanced smoothing
|
|
2395
|
+
for (let y = 0; y < h; y++) for (let x = 0; x < w; x++) {
|
|
2396
|
+
const uv = {
|
|
2397
|
+
x: x / w,
|
|
2398
|
+
y: y / h
|
|
2399
|
+
}, pos = this.options.fragment(uv, mousePosition);
|
|
2400
|
+
let dx = pos.x * w - x, dy = pos.y * h - y;
|
|
2401
|
+
// Apply edge smoothing for Apple-like effect
|
|
2402
|
+
const edgeX = 2 * Math.min(x / w, (w - x) / w), edgeY = 2 * Math.min(y / h, (h - y) / h), edgeFactor = Math.min(edgeX, edgeY);
|
|
2403
|
+
dx *= smoothStep(0, .2, edgeFactor), dy *= smoothStep(0, .2, edgeFactor), maxScale = Math.max(maxScale, Math.abs(dx), Math.abs(dy)),
|
|
2404
|
+
rawValues.push(dx, dy);
|
|
2405
|
+
}
|
|
2406
|
+
// Improved normalization to prevent artifacts while maintaining intensity
|
|
2407
|
+
maxScale = Math.max(maxScale, 1);
|
|
2408
|
+
// Create ImageData and fill it
|
|
2409
|
+
const imageData = this.context.createImageData(w, h), data = imageData.data;
|
|
2410
|
+
// Convert to image data with smoother normalization
|
|
2411
|
+
let rawIndex = 0;
|
|
2412
|
+
for (let y = 0; y < h; y++) for (let x = 0; x < w; x++) {
|
|
2413
|
+
const dx = rawValues[rawIndex++] || 0, dy = rawValues[rawIndex++] || 0, edgeDistance = Math.min(x, y, w - x - 1, h - y - 1), edgeFactor = Math.min(1, edgeDistance / 2), r = dx * edgeFactor / maxScale + .5, g = dy * edgeFactor / maxScale + .5, pixelIndex = 4 * (y * w + x);
|
|
2414
|
+
data[pixelIndex] = clampValue(255 * r, 0, 255), // Red channel (X displacement)
|
|
2415
|
+
data[pixelIndex + 1] = clampValue(255 * g, 0, 255), // Green channel (Y displacement)
|
|
2416
|
+
data[pixelIndex + 2] = clampValue(255 * g, 0, 255), // Blue channel (Y displacement for SVG filter compatibility)
|
|
2417
|
+
data[pixelIndex + 3] = 255;
|
|
2418
|
+
}
|
|
2419
|
+
return this.context.putImageData(imageData, 0, 0), this.canvas.toDataURL();
|
|
2420
|
+
} catch (error) {
|
|
2421
|
+
// Graceful fallback on error
|
|
2422
|
+
return console.warn("ShaderDisplacementGenerator: Error generating shader map, using fallback", error),
|
|
2423
|
+
"";
|
|
2424
|
+
// Return empty string as fallback
|
|
2425
|
+
}
|
|
2426
|
+
}
|
|
2427
|
+
destroy() {
|
|
2428
|
+
try {
|
|
2429
|
+
// Clear canvas data to free memory
|
|
2430
|
+
this.context && this.context.clearRect(0, 0, this.canvas.width, this.canvas.height),
|
|
2431
|
+
// Reduce memory footprint by setting dimensions to 0
|
|
2432
|
+
this.canvas.width = 0, this.canvas.height = 0,
|
|
2433
|
+
// Remove from DOM
|
|
2434
|
+
this.canvas.remove();
|
|
2435
|
+
} catch (e) {
|
|
2436
|
+
// Silently handle cleanup errors
|
|
2437
|
+
console.warn("ShaderDisplacementGenerator: Error during cleanup", e);
|
|
2438
|
+
}
|
|
2439
|
+
}
|
|
2440
|
+
getScale() {
|
|
2441
|
+
return this.canvasDPI;
|
|
2442
|
+
}
|
|
2443
|
+
},
|
|
2444
|
+
fragmentShaders: fragmentShaders
|
|
2445
|
+
}, Symbol.toStringTag, {
|
|
2446
|
+
value: "Module"
|
|
2447
|
+
}));
|
|
2448
|
+
|
|
2449
|
+
export { Checkbox, Form, FormGroup, Input, Radio, Select, Textarea };
|
|
2450
|
+
//# sourceMappingURL=forms.js.map
|