@shohojdhara/atomix 0.3.12 → 0.3.14
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +19 -0
- package/README.md +2 -0
- package/dist/atomix.css +101 -88
- package/dist/atomix.css.map +1 -1
- package/dist/atomix.min.css +5 -15258
- package/dist/atomix.min.css.map +1 -1
- package/dist/charts.d.ts +1 -1
- package/dist/charts.js +17 -19
- package/dist/charts.js.map +1 -1
- package/dist/core.d.ts +41 -11
- package/dist/core.js +55 -41
- package/dist/core.js.map +1 -1
- package/dist/forms.d.ts +28 -11
- package/dist/forms.js +25 -24
- package/dist/forms.js.map +1 -1
- package/dist/heavy.d.ts +1 -1
- package/dist/heavy.js +32 -25
- package/dist/heavy.js.map +1 -1
- package/dist/index.d.ts +122 -46
- package/dist/index.esm.js +865 -200
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +870 -204
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/dist/theme.d.ts +27 -2
- package/dist/theme.js +721 -108
- package/dist/theme.js.map +1 -1
- package/package.json +1 -1
- package/scripts/atomix-cli.js +610 -1111
- package/scripts/cli/component-generator.js +610 -0
- package/scripts/cli/documentation-sync.js +542 -0
- package/scripts/cli/interactive-init.js +84 -288
- package/scripts/cli/mappings.js +211 -0
- package/scripts/cli/migration-tools.js +95 -288
- package/scripts/cli/template-manager.js +107 -0
- package/scripts/cli/templates/README.md +123 -0
- package/scripts/cli/templates/composable-templates.js +149 -0
- package/scripts/cli/templates/config-templates.js +126 -0
- package/scripts/cli/templates/index.js +95 -0
- package/scripts/cli/templates/project-templates.js +214 -0
- package/scripts/cli/templates/react-templates.js +261 -0
- package/scripts/cli/templates/scss-templates.js +156 -0
- package/scripts/cli/templates/storybook-templates.js +236 -0
- package/scripts/cli/templates/testing-templates.js +45 -0
- package/scripts/cli/templates/token-templates.js +447 -0
- package/scripts/cli/templates/types-templates.js +133 -0
- package/scripts/cli/templates-original-backup.js +1655 -0
- package/scripts/cli/templates.js +35 -0
- package/scripts/cli/templates_backup.js +684 -0
- package/scripts/cli/theme-bridge.js +20 -14
- package/scripts/cli/token-manager.js +150 -77
- package/scripts/cli/utils.js +37 -25
- package/src/components/Accordion/Accordion.stories.tsx +5 -5
- package/src/components/Accordion/Accordion.test.tsx +57 -0
- package/src/components/Accordion/Accordion.tsx +4 -0
- package/src/components/AtomixGlass/AtomixGlassContainer.tsx +41 -44
- package/src/components/AtomixGlass/stories/AtomixGlass.stories.tsx +1 -1
- package/src/components/AtomixGlass/stories/Examples.stories.tsx +37 -37
- package/src/components/AtomixGlass/stories/Modes.stories.tsx +1 -2
- package/src/components/AtomixGlass/stories/Playground.stories.tsx +50 -51
- package/src/components/Avatar/Avatar.stories.tsx +26 -26
- package/src/components/Badge/Badge.stories.tsx +31 -31
- package/src/components/Badge/Badge.test.tsx +51 -0
- package/src/components/Badge/Badge.tsx +20 -1
- package/src/components/Block/Block.stories.tsx +5 -5
- package/src/components/Breadcrumb/Breadcrumb.stories.tsx +1 -1
- package/src/components/Breadcrumb/Breadcrumb.tsx +2 -2
- package/src/components/Button/Button.stories.tsx +13 -13
- package/src/components/Button/Button.tsx +4 -4
- package/src/components/Button/ButtonGroup.stories.tsx +2 -2
- package/src/components/Button/README.md +5 -0
- package/src/components/Callout/Callout.stories.tsx +11 -11
- package/src/components/Callout/Callout.test.tsx +10 -10
- package/src/components/Callout/Callout.tsx +7 -7
- package/src/components/Callout/README.md +9 -8
- package/src/components/Card/Card.tsx +2 -2
- package/src/components/Chart/Chart.stories.tsx +6 -6
- package/src/components/Chart/Chart.tsx +1 -1
- package/src/components/ColorModeToggle/ColorModeToggle.stories.tsx +1 -1
- package/src/components/DataTable/DataTable.tsx +14 -12
- package/src/components/DatePicker/DatePicker.stories.tsx +6 -6
- package/src/components/Dropdown/Dropdown.stories.tsx +4 -4
- package/src/components/Form/Checkbox.stories.tsx +3 -3
- package/src/components/Form/Checkbox.tsx +4 -2
- package/src/components/Form/Form.stories.tsx +3 -3
- package/src/components/Form/FormGroup.stories.tsx +1 -1
- package/src/components/Form/Input.stories.tsx +28 -16
- package/src/components/Form/Input.test.tsx +59 -0
- package/src/components/Form/Input.tsx +97 -95
- package/src/components/Form/Radio.stories.tsx +94 -94
- package/src/components/Form/Radio.tsx +2 -2
- package/src/components/Form/Select.stories.tsx +4 -4
- package/src/components/Form/Select.tsx +2 -2
- package/src/components/Form/Textarea.stories.tsx +22 -7
- package/src/components/Form/Textarea.test.tsx +45 -0
- package/src/components/Form/Textarea.tsx +88 -86
- package/src/components/List/List.stories.tsx +2 -2
- package/src/components/Modal/Modal.stories.tsx +4 -4
- package/src/components/Navigation/Navbar/Navbar.stories.tsx +5 -5
- package/src/components/Navigation/Navbar/Navbar.tsx +1 -1
- package/src/components/Navigation/README.md +1 -1
- package/src/components/Pagination/Pagination.stories.tsx +5 -2
- package/src/components/Pagination/Pagination.tsx +1 -1
- package/src/components/PhotoViewer/PhotoViewer.stories.tsx +10 -10
- package/src/components/Popover/Popover.stories.tsx +1 -1
- package/src/components/ProductReview/ProductReview.tsx +1 -1
- package/src/components/Progress/Progress.tsx +46 -46
- package/src/components/Rating/Rating.stories.tsx +4 -4
- package/src/components/Rating/Rating.tsx +8 -8
- package/src/components/Slider/Slider.stories.tsx +63 -63
- package/src/components/Spinner/Spinner.stories.tsx +2 -2
- package/src/components/Spinner/Spinner.test.tsx +35 -0
- package/src/components/Spinner/Spinner.tsx +9 -2
- package/src/components/Testimonial/Testimonial.stories.tsx +1 -1
- package/src/components/Toggle/Toggle.stories.tsx +32 -9
- package/src/components/Toggle/Toggle.test.tsx +91 -0
- package/src/components/Toggle/Toggle.tsx +44 -27
- package/src/components/Tooltip/Tooltip.tsx +1 -1
- package/src/layouts/Grid/Grid.stories.tsx +49 -49
- package/src/layouts/MasonryGrid/MasonryGrid.stories.tsx +2 -2
- package/src/lib/composables/useAccordion.ts +12 -3
- package/src/lib/composables/useBreadcrumb.ts +2 -2
- package/src/lib/composables/useCallout.ts +7 -7
- package/src/lib/composables/useNavbar.ts +1 -1
- package/src/lib/constants/components.ts +1 -1
- package/src/lib/storybook/InteractiveDemo.tsx +113 -0
- package/src/lib/storybook/PreviewContainer.tsx +36 -0
- package/src/lib/storybook/VariantsGrid.tsx +21 -0
- package/src/lib/storybook/index.ts +3 -0
- package/src/lib/theme/core/createThemeObject.ts +9 -5
- package/src/lib/theme/devtools/CLI.ts +155 -0
- package/src/lib/theme/devtools/DesignTokensCustomizer.stories.tsx +213 -0
- package/src/lib/theme/devtools/DesignTokensCustomizer.tsx +566 -0
- package/src/lib/theme/devtools/LiveEditor.tsx +2 -1
- package/src/lib/theme/devtools/index.ts +3 -0
- package/src/lib/theme/errors/errors.ts +8 -0
- package/src/lib/theme/runtime/ThemeProvider.tsx +117 -57
- package/src/lib/theme/runtime/__tests__/ThemeProvider.integration.test.tsx +305 -0
- package/src/lib/theme/runtime/__tests__/ThemeProvider.test.tsx +588 -0
- package/src/lib/theme/utils/__tests__/themeValidation.test.ts +264 -0
- package/src/lib/theme/utils/index.ts +1 -0
- package/src/lib/theme/utils/themeValidation.ts +501 -0
- package/src/lib/theme-tools.ts +32 -3
- package/src/lib/types/components.ts +81 -26
- package/src/lib/utils/themeNaming.ts +1 -1
- package/src/styles/06-components/_components.atomix-glass.scss +14 -15
- package/src/styles/06-components/_components.callout.scss +29 -33
- package/src/styles/06-components/_index.scss +1 -1
- package/src/styles/99-utilities/_utilities.display.scss +14 -3
- package/src/styles/99-utilities/_utilities.flex.scss +10 -10
- package/src/styles/99-utilities/_utilities.text.scss +28 -8
- package/scripts/cli/__tests__/cli-commands.test.js +0 -204
- package/scripts/cli/__tests__/utils.test.js +0 -201
- package/scripts/cli/__tests__/vitest.config.js +0 -26
package/dist/forms.d.ts
CHANGED
|
@@ -328,7 +328,7 @@ interface OverLightObjectConfig {
|
|
|
328
328
|
* AtomixGlass component props interface
|
|
329
329
|
*/
|
|
330
330
|
interface AtomixGlassProps {
|
|
331
|
-
children
|
|
331
|
+
children?: React.ReactNode;
|
|
332
332
|
displacementScale?: number;
|
|
333
333
|
blurAmount?: number;
|
|
334
334
|
saturation?: number;
|
|
@@ -504,12 +504,17 @@ interface FormGroupProps extends BaseComponentProps {
|
|
|
504
504
|
interface InputProps extends BaseComponentProps {
|
|
505
505
|
/**
|
|
506
506
|
* Input type
|
|
507
|
+
* @default 'text'
|
|
507
508
|
*/
|
|
508
509
|
type?: string;
|
|
509
510
|
/**
|
|
510
511
|
* Input value
|
|
511
512
|
*/
|
|
512
513
|
value?: string | number;
|
|
514
|
+
/**
|
|
515
|
+
* Default value for uncontrolled input
|
|
516
|
+
*/
|
|
517
|
+
defaultValue?: string | number;
|
|
513
518
|
/**
|
|
514
519
|
* Change handler
|
|
515
520
|
*/
|
|
@@ -552,6 +557,7 @@ interface InputProps extends BaseComponentProps {
|
|
|
552
557
|
autoFocus?: boolean;
|
|
553
558
|
/**
|
|
554
559
|
* Size variant
|
|
560
|
+
* @default 'md'
|
|
555
561
|
*/
|
|
556
562
|
size?: Size;
|
|
557
563
|
/**
|
|
@@ -593,11 +599,11 @@ interface InputProps extends BaseComponentProps {
|
|
|
593
599
|
/**
|
|
594
600
|
* Accessible label (if no visible label)
|
|
595
601
|
*/
|
|
596
|
-
|
|
602
|
+
'aria-label'?: string;
|
|
597
603
|
/**
|
|
598
604
|
* ID of element that describes this input
|
|
599
605
|
*/
|
|
600
|
-
|
|
606
|
+
'aria-describedby'?: string;
|
|
601
607
|
/**
|
|
602
608
|
* Glass morphism effect
|
|
603
609
|
*/
|
|
@@ -702,6 +708,7 @@ interface SelectProps extends BaseComponentProps {
|
|
|
702
708
|
name?: string;
|
|
703
709
|
/**
|
|
704
710
|
* Size variant
|
|
711
|
+
* @default 'md'
|
|
705
712
|
*/
|
|
706
713
|
size?: Size;
|
|
707
714
|
/**
|
|
@@ -719,11 +726,11 @@ interface SelectProps extends BaseComponentProps {
|
|
|
719
726
|
/**
|
|
720
727
|
* Accessible label (if no visible label)
|
|
721
728
|
*/
|
|
722
|
-
|
|
729
|
+
'aria-label'?: string;
|
|
723
730
|
/**
|
|
724
731
|
* ID of element that describes this select
|
|
725
732
|
*/
|
|
726
|
-
|
|
733
|
+
'aria-describedby'?: string;
|
|
727
734
|
/**
|
|
728
735
|
* Glass morphism effect for the select
|
|
729
736
|
* Can be a boolean to enable with default settings, or an object with AtomixGlassProps to customize the effect
|
|
@@ -789,16 +796,20 @@ interface CheckboxProps extends BaseComponentProps {
|
|
|
789
796
|
/**
|
|
790
797
|
* Accessible label (if no visible label)
|
|
791
798
|
*/
|
|
792
|
-
|
|
799
|
+
'aria-label'?: string;
|
|
793
800
|
/**
|
|
794
801
|
* ID of element that describes this checkbox
|
|
795
802
|
*/
|
|
796
|
-
|
|
803
|
+
'aria-describedby'?: string;
|
|
797
804
|
/**
|
|
798
805
|
* Glass morphism effect for the checkbox
|
|
799
806
|
* Can be a boolean to enable with default settings, or an object with AtomixGlassProps to customize the effect
|
|
800
807
|
*/
|
|
801
808
|
glass?: AtomixGlassProps | boolean;
|
|
809
|
+
/**
|
|
810
|
+
* Click handler
|
|
811
|
+
*/
|
|
812
|
+
onClick?: (event: React.MouseEvent<HTMLInputElement>) => void;
|
|
802
813
|
/**
|
|
803
814
|
* Error message to display
|
|
804
815
|
*/
|
|
@@ -884,11 +895,11 @@ interface RadioProps extends BaseComponentProps {
|
|
|
884
895
|
/**
|
|
885
896
|
* Accessible label (if no visible label)
|
|
886
897
|
*/
|
|
887
|
-
|
|
898
|
+
'aria-label'?: string;
|
|
888
899
|
/**
|
|
889
900
|
* ID of element that describes this radio
|
|
890
901
|
*/
|
|
891
|
-
|
|
902
|
+
'aria-describedby'?: string;
|
|
892
903
|
/**
|
|
893
904
|
* Glass morphism effect for the radio button
|
|
894
905
|
* Can be a boolean to enable with default settings, or an object with AtomixGlassProps to customize the effect
|
|
@@ -944,6 +955,10 @@ interface TextareaProps extends BaseComponentProps {
|
|
|
944
955
|
* Textarea value
|
|
945
956
|
*/
|
|
946
957
|
value?: string;
|
|
958
|
+
/**
|
|
959
|
+
* Default value for uncontrolled textarea
|
|
960
|
+
*/
|
|
961
|
+
defaultValue?: string;
|
|
947
962
|
/**
|
|
948
963
|
* Change handler
|
|
949
964
|
*/
|
|
@@ -978,6 +993,7 @@ interface TextareaProps extends BaseComponentProps {
|
|
|
978
993
|
name?: string;
|
|
979
994
|
/**
|
|
980
995
|
* Number of rows
|
|
996
|
+
* @default 4
|
|
981
997
|
*/
|
|
982
998
|
rows?: number;
|
|
983
999
|
/**
|
|
@@ -994,6 +1010,7 @@ interface TextareaProps extends BaseComponentProps {
|
|
|
994
1010
|
minLength?: number;
|
|
995
1011
|
/**
|
|
996
1012
|
* Size variant
|
|
1013
|
+
* @default 'md'
|
|
997
1014
|
*/
|
|
998
1015
|
size?: Size;
|
|
999
1016
|
/**
|
|
@@ -1015,11 +1032,11 @@ interface TextareaProps extends BaseComponentProps {
|
|
|
1015
1032
|
/**
|
|
1016
1033
|
* Accessible label (if no visible label)
|
|
1017
1034
|
*/
|
|
1018
|
-
|
|
1035
|
+
'aria-label'?: string;
|
|
1019
1036
|
/**
|
|
1020
1037
|
* ID of element that describes this textarea
|
|
1021
1038
|
*/
|
|
1022
|
-
|
|
1039
|
+
'aria-describedby'?: string;
|
|
1023
1040
|
/**
|
|
1024
1041
|
* Glass morphism effect
|
|
1025
1042
|
*/
|
package/dist/forms.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
|
|
3
|
-
import React, { useRef, useEffect, memo, forwardRef,
|
|
3
|
+
import React, { useRef, useEffect, memo, forwardRef, useMemo, useState, useCallback } from "react";
|
|
4
4
|
|
|
5
5
|
// Define checkbox class constants
|
|
6
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 = {
|
|
@@ -444,7 +444,13 @@ const FORM_CLASSES_BASE = "c-form", FORM_CLASSES_DISABLED = "c-form--disabled",
|
|
|
444
444
|
*/ GlassFilterComponent.displayName = "GlassFilter";
|
|
445
445
|
|
|
446
446
|
// Memoize component to prevent unnecessary re-renders
|
|
447
|
-
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))
|
|
447
|
+
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));
|
|
448
|
+
|
|
449
|
+
// Module-level counter for deterministic ID generation
|
|
450
|
+
let idCounter = 0;
|
|
451
|
+
|
|
452
|
+
// Module-level shared shader cache with LRU eviction
|
|
453
|
+
const 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 = {
|
|
448
454
|
x: 0,
|
|
449
455
|
y: 0
|
|
450
456
|
}, globalMousePosition: globalMousePosition = {
|
|
@@ -455,10 +461,8 @@ const GlassFilter = memo(GlassFilterComponent, ((prevProps, nextProps) => prevP
|
|
|
455
461
|
height: 0
|
|
456
462
|
}, onClick: onClick, mode: mode = "standard", effectiveDisableEffects: effectiveDisableEffects = !1, effectiveReducedMotion: effectiveReducedMotion = !1, shaderVariant: shaderVariant = "liquidGlass", enableLiquidBlur: enableLiquidBlur = !1, elasticity: elasticity = 0, contentRef: contentRef}, ref) => {
|
|
457
463
|
// Generate a stable, deterministic ID for SSR compatibility
|
|
458
|
-
// Use a
|
|
459
|
-
const [
|
|
460
|
-
// Use a simple counter for deterministic IDs
|
|
461
|
-
"undefined" == typeof window ? `atomix-glass-filter-ssr-${Math.random().toString(36).substring(2, 11)}` : `atomix-glass-filter-${Date.now()}-${Math.random().toString(36).substring(2, 11)}`)), [shaderMapUrl, setShaderMapUrl] = useState(""), shaderGeneratorRef = useRef(null), shaderUtilsRef = useRef(null), shaderDebounceTimeoutRef = useRef(null);
|
|
464
|
+
// Use a module-level counter that's consistent across server and client
|
|
465
|
+
const filterId = useMemo((() => "atomix-glass-filter-" + ++idCounter), []), [shaderMapUrl, setShaderMapUrl] = useState(""), shaderGeneratorRef = useRef(null), shaderUtilsRef = useRef(null), shaderDebounceTimeoutRef = useRef(null);
|
|
462
466
|
// Lazy load shader utilities only when shader mode is needed
|
|
463
467
|
useEffect((() => {
|
|
464
468
|
"shader" === mode ?
|
|
@@ -499,9 +503,9 @@ const GlassFilter = memo(GlassFilterComponent, ((prevProps, nextProps) => prevP
|
|
|
499
503
|
width: glassSize.width,
|
|
500
504
|
height: glassSize.height,
|
|
501
505
|
fragment: selectedShader
|
|
502
|
-
})
|
|
503
|
-
//
|
|
504
|
-
|
|
506
|
+
}),
|
|
507
|
+
// Defer shader generation with longer delay to avoid blocking
|
|
508
|
+
setTimeout((() => {
|
|
505
509
|
const url = shaderGeneratorRef.current?.updateShader() || "";
|
|
506
510
|
((key, url) => {
|
|
507
511
|
// Evict oldest entries if at capacity
|
|
@@ -520,20 +524,15 @@ const GlassFilter = memo(GlassFilterComponent, ((prevProps, nextProps) => prevP
|
|
|
520
524
|
// Development mode: log cache size
|
|
521
525
|
"undefined" != typeof process && "production" === process.env?.NODE_ENV || sharedShaderCache.size;
|
|
522
526
|
})(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);
|
|
527
|
+
}), 100);
|
|
529
528
|
} catch (error) {
|
|
530
529
|
console.warn("AtomixGlassContainer: Error generating shader map", error), setShaderMapUrl("");
|
|
531
530
|
} else
|
|
532
531
|
// Shader utils not loaded yet, retry after a short delay
|
|
533
532
|
shaderDebounceTimeoutRef.current = setTimeout(generateShader, 100);
|
|
534
533
|
};
|
|
535
|
-
// Debounce with
|
|
536
|
-
shaderDebounceTimeoutRef.current = setTimeout(generateShader,
|
|
534
|
+
// Debounce with 500ms delay to reduce frequency
|
|
535
|
+
shaderDebounceTimeoutRef.current = setTimeout(generateShader, 500);
|
|
537
536
|
} else
|
|
538
537
|
// Not in shader mode, clear URL
|
|
539
538
|
setShaderMapUrl("");
|
|
@@ -600,7 +599,7 @@ const GlassFilter = memo(GlassFilterComponent, ((prevProps, nextProps) => prevP
|
|
|
600
599
|
backdropFilter: `blur(${blurAmount}px) saturate(${saturation}%) contrast(1.05) brightness(1.05)`
|
|
601
600
|
};
|
|
602
601
|
}
|
|
603
|
-
}), [
|
|
602
|
+
}), [ liquidBlur, saturation, blurAmount, rectCache, effectiveReducedMotion, effectiveDisableEffects, enableLiquidBlur ]), containerVars = useMemo((() => {
|
|
604
603
|
try {
|
|
605
604
|
// Safe extraction of mouse offset values
|
|
606
605
|
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;
|
|
@@ -689,7 +688,6 @@ const GlassFilter = memo(GlassFilterComponent, ((prevProps, nextProps) => prevP
|
|
|
689
688
|
});
|
|
690
689
|
}));
|
|
691
690
|
|
|
692
|
-
// Module-level shared shader cache with LRU eviction
|
|
693
691
|
AtomixGlassContainer.displayName = "AtomixGlassContainer";
|
|
694
692
|
|
|
695
693
|
// Singleton instance
|
|
@@ -1439,7 +1437,7 @@ function useAtomixGlass({glassRef: glassRef, contentRef: contentRef, cornerRadiu
|
|
|
1439
1437
|
|
|
1440
1438
|
/**
|
|
1441
1439
|
* Checkbox - A component for checkbox inputs
|
|
1442
|
-
*/ 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,
|
|
1440
|
+
*/ 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, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, onClick: onClick, glass: glass}) => {
|
|
1443
1441
|
const {generateCheckboxClass: generateCheckboxClass, checkboxRef: checkboxRef} = function(initialProps) {
|
|
1444
1442
|
// Default checkbox properties
|
|
1445
1443
|
const defaultProps = {
|
|
@@ -1489,6 +1487,7 @@ function useAtomixGlass({glassRef: glassRef, contentRef: contentRef, cornerRadiu
|
|
|
1489
1487
|
className: "c-checkbox__input",
|
|
1490
1488
|
checked: checked,
|
|
1491
1489
|
onChange: onChange,
|
|
1490
|
+
onClick: onClick,
|
|
1492
1491
|
disabled: disabled,
|
|
1493
1492
|
required: required,
|
|
1494
1493
|
id: id,
|
|
@@ -1648,7 +1647,7 @@ FormGroup.displayName = "FormGroup";
|
|
|
1648
1647
|
/**
|
|
1649
1648
|
* Input - A component for text input fields
|
|
1650
1649
|
*/
|
|
1651
|
-
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,
|
|
1650
|
+
const Input = memo( forwardRef((({type: type = "text", value: value, defaultValue: defaultValue, 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, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, glass: glass}, ref) => {
|
|
1652
1651
|
const {generateInputClass: generateInputClass} =
|
|
1653
1652
|
/**
|
|
1654
1653
|
* Input state and functionality
|
|
@@ -1703,6 +1702,7 @@ const Input = memo( forwardRef((({type: type = "text", value: value, onChange:
|
|
|
1703
1702
|
type: type,
|
|
1704
1703
|
className: inputClass,
|
|
1705
1704
|
value: value,
|
|
1705
|
+
defaultValue: defaultValue,
|
|
1706
1706
|
onChange: onChange,
|
|
1707
1707
|
onBlur: onBlur,
|
|
1708
1708
|
onFocus: onFocus,
|
|
@@ -1753,7 +1753,7 @@ Input.displayName = "Input";
|
|
|
1753
1753
|
/**
|
|
1754
1754
|
* Radio - A component for radio button inputs
|
|
1755
1755
|
*/
|
|
1756
|
-
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,
|
|
1756
|
+
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, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, glass: glass}) => {
|
|
1757
1757
|
const {generateRadioClass: generateRadioClass} =
|
|
1758
1758
|
/**
|
|
1759
1759
|
* Radio state and functionality
|
|
@@ -1838,7 +1838,7 @@ Radio.displayName = "Radio";
|
|
|
1838
1838
|
/**
|
|
1839
1839
|
* Select - A component for dropdown selection
|
|
1840
1840
|
*/
|
|
1841
|
-
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,
|
|
1841
|
+
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, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, glass: glass}) => {
|
|
1842
1842
|
const {generateSelectClass: generateSelectClass} =
|
|
1843
1843
|
/**
|
|
1844
1844
|
* Select state and functionality
|
|
@@ -2017,7 +2017,7 @@ Select.displayName = "Select";
|
|
|
2017
2017
|
/**
|
|
2018
2018
|
* Textarea - A component for multiline text input
|
|
2019
2019
|
*/
|
|
2020
|
-
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,
|
|
2020
|
+
const Textarea = memo( forwardRef((({value: value, defaultValue: defaultValue, 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, "aria-label": ariaLabel, "aria-describedby": ariaDescribedBy, glass: glass}, ref) => {
|
|
2021
2021
|
const {generateTextareaClass: generateTextareaClass} = function(initialProps) {
|
|
2022
2022
|
// Default textarea properties
|
|
2023
2023
|
const defaultProps = {
|
|
@@ -2057,6 +2057,7 @@ const Textarea = memo( forwardRef((({value: value, onChange: onChange, onBlur:
|
|
|
2057
2057
|
ref: ref,
|
|
2058
2058
|
className: textareaClass,
|
|
2059
2059
|
value: value,
|
|
2060
|
+
defaultValue: defaultValue,
|
|
2060
2061
|
onChange: onChange,
|
|
2061
2062
|
onBlur: onBlur,
|
|
2062
2063
|
onFocus: onFocus,
|