@shohojdhara/atomix 0.3.11 → 0.3.13
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/dist/atomix.css +15 -17
- package/dist/atomix.css.map +1 -1
- package/dist/atomix.min.css +5 -15255
- package/dist/atomix.min.css.map +1 -1
- package/dist/charts.js +94 -74
- package/dist/charts.js.map +1 -1
- package/dist/core.js +94 -74
- package/dist/core.js.map +1 -1
- package/dist/forms.js +94 -74
- package/dist/forms.js.map +1 -1
- package/dist/heavy.js +94 -74
- package/dist/heavy.js.map +1 -1
- package/dist/index.d.ts +9 -27
- package/dist/index.esm.js +163 -161
- package/dist/index.esm.js.map +1 -1
- package/dist/index.js +163 -161
- package/dist/index.js.map +1 -1
- package/dist/index.min.js +1 -1
- package/dist/index.min.js.map +1 -1
- package/package.json +1 -1
- package/src/components/AtomixGlass/AtomixGlass.tsx +124 -127
- package/src/components/AtomixGlass/AtomixGlassContainer.tsx +55 -62
- package/src/components/AtomixGlass/GlassFilter.tsx +15 -4
- package/src/components/AtomixGlass/stories/Modes.stories.tsx +1 -2
- package/src/components/EdgePanel/EdgePanel.stories.tsx +2 -7
- package/src/components/EdgePanel/EdgePanel.tsx +0 -10
- package/src/components/Form/Radio.stories.tsx +235 -103
- package/src/components/Navigation/Nav/NavDropdown.tsx +8 -4
- package/src/components/Navigation/SideMenu/SideMenu.tsx +2 -22
- package/src/components/Navigation/SideMenu/SideMenuItem.tsx +11 -15
- package/src/lib/types/components.ts +2 -26
- package/src/styles/06-components/_components.atomix-glass.scss +14 -15
- package/src/styles/06-components/_components.edge-panel.scss +4 -4
- package/src/styles/06-components/_components.nav.scss +3 -0
package/dist/charts.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { jsx, jsxs, Fragment } from "react/jsx-runtime";
|
|
2
2
|
|
|
3
|
-
import React, { useState, useRef, useEffect, useCallback, useMemo, memo, forwardRef,
|
|
3
|
+
import React, { useState, useRef, useEffect, useCallback, useMemo, memo, forwardRef, createContext, useContext } from "react";
|
|
4
4
|
|
|
5
5
|
import * as PhosphorIcons from "@phosphor-icons/react";
|
|
6
6
|
|
|
@@ -1586,7 +1586,6 @@ const {CONSTANTS: CONSTANTS$1} = ATOMIX_GLASS, calculateDistance = (pos1, pos2)
|
|
|
1586
1586
|
inset: 0
|
|
1587
1587
|
},
|
|
1588
1588
|
"aria-hidden": "true",
|
|
1589
|
-
suppressHydrationWarning: !0,
|
|
1590
1589
|
children: jsxs("defs", {
|
|
1591
1590
|
children: [ jsxs("radialGradient", {
|
|
1592
1591
|
id: `${id}-edge-mask`,
|
|
@@ -1614,7 +1613,7 @@ const {CONSTANTS: CONSTANTS$1} = ATOMIX_GLASS, calculateDistance = (pos1, pos2)
|
|
|
1614
1613
|
height: "170%",
|
|
1615
1614
|
colorInterpolationFilters: "sRGB",
|
|
1616
1615
|
children: [ jsx("feImage", {
|
|
1617
|
-
id:
|
|
1616
|
+
id: `${id}-image`,
|
|
1618
1617
|
x: "0",
|
|
1619
1618
|
y: "0",
|
|
1620
1619
|
width: "100%",
|
|
@@ -1720,7 +1719,13 @@ const {CONSTANTS: CONSTANTS$1} = ATOMIX_GLASS, calculateDistance = (pos1, pos2)
|
|
|
1720
1719
|
*/ GlassFilterComponent.displayName = "GlassFilter";
|
|
1721
1720
|
|
|
1722
1721
|
// Memoize component to prevent unnecessary re-renders
|
|
1723
|
-
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))
|
|
1722
|
+
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));
|
|
1723
|
+
|
|
1724
|
+
// Module-level counter for deterministic ID generation
|
|
1725
|
+
let idCounter = 0;
|
|
1726
|
+
|
|
1727
|
+
// Module-level shared shader cache with LRU eviction
|
|
1728
|
+
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 = {
|
|
1724
1729
|
x: 0,
|
|
1725
1730
|
y: 0
|
|
1726
1731
|
}, globalMousePosition: globalMousePosition = {
|
|
@@ -1731,10 +1736,8 @@ const GlassFilter = memo(GlassFilterComponent, ((prevProps, nextProps) => prevP
|
|
|
1731
1736
|
height: 0
|
|
1732
1737
|
}, onClick: onClick, mode: mode = "standard", effectiveDisableEffects: effectiveDisableEffects = !1, effectiveReducedMotion: effectiveReducedMotion = !1, shaderVariant: shaderVariant = "liquidGlass", enableLiquidBlur: enableLiquidBlur = !1, elasticity: elasticity = 0, contentRef: contentRef}, ref) => {
|
|
1733
1738
|
// Generate a stable, deterministic ID for SSR compatibility
|
|
1734
|
-
//
|
|
1735
|
-
|
|
1736
|
-
// generated once and remains stable across renders.
|
|
1737
|
-
const baseId = useId(), [filterId] = useState((() => `atomix-glass-filter-${baseId.replace(/:/g, "-").replace(/^[^a-z]/i, "atomix-")}`)), [shaderMapUrl, setShaderMapUrl] = useState(""), shaderGeneratorRef = useRef(null), shaderUtilsRef = useRef(null), shaderDebounceTimeoutRef = useRef(null);
|
|
1739
|
+
// Use a module-level counter that's consistent across server and client
|
|
1740
|
+
const filterId = useMemo((() => "atomix-glass-filter-" + ++idCounter), []), [shaderMapUrl, setShaderMapUrl] = useState(""), shaderGeneratorRef = useRef(null), shaderUtilsRef = useRef(null), shaderDebounceTimeoutRef = useRef(null);
|
|
1738
1741
|
// Lazy load shader utilities only when shader mode is needed
|
|
1739
1742
|
useEffect((() => {
|
|
1740
1743
|
"shader" === mode ?
|
|
@@ -1745,7 +1748,7 @@ const GlassFilter = memo(GlassFilterComponent, ((prevProps, nextProps) => prevP
|
|
|
1745
1748
|
fragmentShaders: shaderUtils.fragmentShaders
|
|
1746
1749
|
};
|
|
1747
1750
|
})).catch((error => {
|
|
1748
|
-
console.warn("AtomixGlassContainer: Error loading shader utilities", error);
|
|
1751
|
+
console.warn("AtomixGlassContainer: Error loading shader utilities", String(error).replace(/[\r\n]/g, ""));
|
|
1749
1752
|
})) :
|
|
1750
1753
|
// Clear shader utils when not in shader mode to free memory
|
|
1751
1754
|
shaderUtilsRef.current = null;
|
|
@@ -1775,9 +1778,9 @@ const GlassFilter = memo(GlassFilterComponent, ((prevProps, nextProps) => prevP
|
|
|
1775
1778
|
width: glassSize.width,
|
|
1776
1779
|
height: glassSize.height,
|
|
1777
1780
|
fragment: selectedShader
|
|
1778
|
-
})
|
|
1779
|
-
//
|
|
1780
|
-
|
|
1781
|
+
}),
|
|
1782
|
+
// Defer shader generation with longer delay to avoid blocking
|
|
1783
|
+
setTimeout((() => {
|
|
1781
1784
|
const url = shaderGeneratorRef.current?.updateShader() || "";
|
|
1782
1785
|
((key, url) => {
|
|
1783
1786
|
// Evict oldest entries if at capacity
|
|
@@ -1796,20 +1799,15 @@ const GlassFilter = memo(GlassFilterComponent, ((prevProps, nextProps) => prevP
|
|
|
1796
1799
|
// Development mode: log cache size
|
|
1797
1800
|
"undefined" != typeof process && "production" === process.env?.NODE_ENV || sharedShaderCache.size;
|
|
1798
1801
|
})(cacheKey, url), setShaderMapUrl(url);
|
|
1799
|
-
};
|
|
1800
|
-
"undefined" != typeof requestIdleCallback ? requestIdleCallback(generate, {
|
|
1801
|
-
timeout: 1e3
|
|
1802
|
-
}) :
|
|
1803
|
-
// Fallback to setTimeout for browsers without requestIdleCallback
|
|
1804
|
-
setTimeout(generate, 0);
|
|
1802
|
+
}), 100);
|
|
1805
1803
|
} catch (error) {
|
|
1806
1804
|
console.warn("AtomixGlassContainer: Error generating shader map", error), setShaderMapUrl("");
|
|
1807
1805
|
} else
|
|
1808
1806
|
// Shader utils not loaded yet, retry after a short delay
|
|
1809
1807
|
shaderDebounceTimeoutRef.current = setTimeout(generateShader, 100);
|
|
1810
1808
|
};
|
|
1811
|
-
// Debounce with
|
|
1812
|
-
shaderDebounceTimeoutRef.current = setTimeout(generateShader,
|
|
1809
|
+
// Debounce with 500ms delay to reduce frequency
|
|
1810
|
+
shaderDebounceTimeoutRef.current = setTimeout(generateShader, 500);
|
|
1813
1811
|
} else
|
|
1814
1812
|
// Not in shader mode, clear URL
|
|
1815
1813
|
setShaderMapUrl("");
|
|
@@ -1876,7 +1874,7 @@ const GlassFilter = memo(GlassFilterComponent, ((prevProps, nextProps) => prevP
|
|
|
1876
1874
|
backdropFilter: `blur(${blurAmount}px) saturate(${saturation}%) contrast(1.05) brightness(1.05)`
|
|
1877
1875
|
};
|
|
1878
1876
|
}
|
|
1879
|
-
}), [
|
|
1877
|
+
}), [ liquidBlur, saturation, blurAmount, rectCache, effectiveReducedMotion, effectiveDisableEffects, enableLiquidBlur ]), containerVars = useMemo((() => {
|
|
1880
1878
|
try {
|
|
1881
1879
|
// Safe extraction of mouse offset values
|
|
1882
1880
|
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;
|
|
@@ -1935,7 +1933,6 @@ const GlassFilter = memo(GlassFilterComponent, ((prevProps, nextProps) => prevP
|
|
|
1935
1933
|
shaderMapUrl: shaderMapUrl
|
|
1936
1934
|
}), jsx("div", {
|
|
1937
1935
|
className: ATOMIX_GLASS.FILTER_OVERLAY_CLASS,
|
|
1938
|
-
suppressHydrationWarning: !0,
|
|
1939
1936
|
style: {
|
|
1940
1937
|
filter: `url(#${filterId})`,
|
|
1941
1938
|
backdropFilter: "var(--atomix-glass-container-backdrop)",
|
|
@@ -1966,7 +1963,6 @@ const GlassFilter = memo(GlassFilterComponent, ((prevProps, nextProps) => prevP
|
|
|
1966
1963
|
});
|
|
1967
1964
|
}));
|
|
1968
1965
|
|
|
1969
|
-
// Module-level shared shader cache with LRU eviction
|
|
1970
1966
|
AtomixGlassContainer.displayName = "AtomixGlassContainer";
|
|
1971
1967
|
|
|
1972
1968
|
// Singleton instance
|
|
@@ -2563,38 +2559,80 @@ function useAtomixGlass({glassRef: glassRef, contentRef: contentRef, cornerRadiu
|
|
|
2563
2559
|
}, adjustedSize = {
|
|
2564
2560
|
width: "fixed" !== style.position ? "100%" : style.width ? style.width : Math.max(glassSize.width, 0),
|
|
2565
2561
|
height: "fixed" !== style.position ? "100%" : style.height ? style.height : Math.max(glassSize.height, 0)
|
|
2566
|
-
},
|
|
2567
|
-
|
|
2568
|
-
|
|
2569
|
-
|
|
2570
|
-
|
|
2571
|
-
|
|
2572
|
-
|
|
2573
|
-
|
|
2574
|
-
|
|
2575
|
-
|
|
2576
|
-
|
|
2577
|
-
|
|
2578
|
-
|
|
2579
|
-
|
|
2580
|
-
|
|
2581
|
-
|
|
2582
|
-
|
|
2583
|
-
|
|
2584
|
-
|
|
2585
|
-
|
|
2586
|
-
|
|
2587
|
-
|
|
2588
|
-
|
|
2589
|
-
|
|
2590
|
-
|
|
2591
|
-
|
|
2592
|
-
|
|
2593
|
-
|
|
2594
|
-
|
|
2595
|
-
|
|
2596
|
-
|
|
2597
|
-
|
|
2562
|
+
}, gradientValues = useMemo((() => {
|
|
2563
|
+
const mx = mouseOffset.x, my = mouseOffset.y, absMx = Math.abs(mx), absMy = Math.abs(my), GRADIENT = ATOMIX_GLASS.CONSTANTS.GRADIENT;
|
|
2564
|
+
return {
|
|
2565
|
+
borderGradientAngle: GRADIENT.BASE_ANGLE + mx * GRADIENT.ANGLE_MULTIPLIER,
|
|
2566
|
+
borderStop1: Math.max(GRADIENT.BORDER_STOP_1.MIN, GRADIENT.BORDER_STOP_1.BASE + my * GRADIENT.BORDER_STOP_1.MULTIPLIER),
|
|
2567
|
+
borderStop2: Math.min(GRADIENT.BORDER_STOP_2.MAX, GRADIENT.BORDER_STOP_2.BASE + my * GRADIENT.BORDER_STOP_2.MULTIPLIER),
|
|
2568
|
+
borderOpacities: [ GRADIENT.BORDER_OPACITY.BASE_1 + absMx * GRADIENT.BORDER_OPACITY.MULTIPLIER_LOW, GRADIENT.BORDER_OPACITY.BASE_2 + absMx * GRADIENT.BORDER_OPACITY.MULTIPLIER_HIGH, GRADIENT.BORDER_OPACITY.BASE_3 + absMx * GRADIENT.BORDER_OPACITY.MULTIPLIER_LOW, GRADIENT.BORDER_OPACITY.BASE_4 + absMx * GRADIENT.BORDER_OPACITY.MULTIPLIER_HIGH ],
|
|
2569
|
+
hoverPositions: {
|
|
2570
|
+
hover1: {
|
|
2571
|
+
x: GRADIENT.CENTER_POSITION + mx / GRADIENT.HOVER_POSITION.DIVISOR_1,
|
|
2572
|
+
y: GRADIENT.CENTER_POSITION + my / GRADIENT.HOVER_POSITION.DIVISOR_1
|
|
2573
|
+
},
|
|
2574
|
+
hover2: {
|
|
2575
|
+
x: GRADIENT.CENTER_POSITION + mx / GRADIENT.HOVER_POSITION.DIVISOR_2,
|
|
2576
|
+
y: GRADIENT.CENTER_POSITION + my / GRADIENT.HOVER_POSITION.DIVISOR_2
|
|
2577
|
+
},
|
|
2578
|
+
hover3: {
|
|
2579
|
+
x: GRADIENT.CENTER_POSITION + mx * GRADIENT.HOVER_POSITION.MULTIPLIER_3,
|
|
2580
|
+
y: GRADIENT.CENTER_POSITION + my * GRADIENT.HOVER_POSITION.MULTIPLIER_3
|
|
2581
|
+
}
|
|
2582
|
+
},
|
|
2583
|
+
basePosition: {
|
|
2584
|
+
x: GRADIENT.CENTER_POSITION + mx * GRADIENT.BASE_LAYER_MULTIPLIER,
|
|
2585
|
+
y: GRADIENT.CENTER_POSITION + my * GRADIENT.BASE_LAYER_MULTIPLIER
|
|
2586
|
+
},
|
|
2587
|
+
mx: mx,
|
|
2588
|
+
my: my,
|
|
2589
|
+
absMx: absMx,
|
|
2590
|
+
absMy: absMy
|
|
2591
|
+
};
|
|
2592
|
+
}), [ mouseOffset.x, mouseOffset.y ]), opacityValues = useMemo((() => {
|
|
2593
|
+
const overLightOpacity = overLightConfig.opacity;
|
|
2594
|
+
return {
|
|
2595
|
+
hover1: isHovered || isActive ? .5 : 0,
|
|
2596
|
+
hover2: isActive ? .5 : 0,
|
|
2597
|
+
hover3: isHovered ? .4 : isActive ? .8 : 0,
|
|
2598
|
+
base: isOverLight ? overLightOpacity || .4 : 0,
|
|
2599
|
+
over: isOverLight ? 1.1 * (overLightOpacity || .4) : 0
|
|
2600
|
+
};
|
|
2601
|
+
}), [ isHovered, isActive, isOverLight, overLightConfig.opacity ]), glassVars = useMemo((() => {
|
|
2602
|
+
const whiteColor = "255, 255, 255", {borderGradientAngle: borderGradientAngle, borderStop1: borderStop1, borderStop2: borderStop2, borderOpacities: borderOpacities, hoverPositions: hoverPositions, basePosition: basePosition, mx: mx, my: my, absMx: absMx, absMy: absMy} = gradientValues;
|
|
2603
|
+
return {
|
|
2604
|
+
"--atomix-glass-radius": `${effectiveCornerRadius}px`,
|
|
2605
|
+
"--atomix-glass-transform": transformStyle || "none",
|
|
2606
|
+
"--atomix-glass-position": positionStyles.position,
|
|
2607
|
+
"--atomix-glass-top": "fixed" !== positionStyles.top ? `${positionStyles.top}px` : "0",
|
|
2608
|
+
"--atomix-glass-left": "fixed" !== positionStyles.left ? `${positionStyles.left}px` : "0",
|
|
2609
|
+
"--atomix-glass-width": "fixed" !== style.position ? adjustedSize.width : `${adjustedSize.width}px`,
|
|
2610
|
+
"--atomix-glass-height": "fixed" !== style.position ? adjustedSize.height : `${adjustedSize.height}px`,
|
|
2611
|
+
"--atomix-glass-border-width": "var(--atomix-spacing-0-5, 0.09375rem)",
|
|
2612
|
+
"--atomix-glass-blend-mode": isOverLight ? "multiply" : "overlay",
|
|
2613
|
+
"--atomix-glass-border-gradient-1": `linear-gradient(${borderGradientAngle}deg, rgba(${whiteColor}, 0) 0%, rgba(${whiteColor}, ${borderOpacities[0]}) ${borderStop1}%, rgba(${whiteColor}, ${borderOpacities[1]}) ${borderStop2}%, rgba(${whiteColor}, 0) 100%)`,
|
|
2614
|
+
"--atomix-glass-border-gradient-2": `linear-gradient(${borderGradientAngle}deg, rgba(${whiteColor}, 0) 0%, rgba(${whiteColor}, ${borderOpacities[2]}) ${borderStop1}%, rgba(${whiteColor}, ${borderOpacities[3]}) ${borderStop2}%, rgba(${whiteColor}, 0) 100%)`,
|
|
2615
|
+
"--atomix-glass-hover-1-opacity": opacityValues.hover1,
|
|
2616
|
+
"--atomix-glass-hover-1-gradient": isOverLight ? `radial-gradient(circle at ${hoverPositions.hover1.x}% ${hoverPositions.hover1.y}%, 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 ${hoverPositions.hover1.x}% ${hoverPositions.hover1.y}%, rgba(${whiteColor}, ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_1.WHITE_START}) 0%, rgba(${whiteColor}, 0) ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_1.WHITE_STOP}%)`,
|
|
2617
|
+
"--atomix-glass-hover-2-opacity": opacityValues.hover2,
|
|
2618
|
+
"--atomix-glass-hover-2-gradient": isOverLight ? `radial-gradient(circle at ${hoverPositions.hover2.x}% ${hoverPositions.hover2.y}%, 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 ${hoverPositions.hover2.x}% ${hoverPositions.hover2.y}%, rgba(${whiteColor}, ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_2.WHITE_START}) 0%, rgba(${whiteColor}, 0) ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_2.WHITE_STOP}%)`,
|
|
2619
|
+
"--atomix-glass-hover-3-opacity": opacityValues.hover3,
|
|
2620
|
+
"--atomix-glass-hover-3-gradient": isOverLight ? `radial-gradient(circle at ${hoverPositions.hover3.x}% ${hoverPositions.hover3.y}%, 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 ${hoverPositions.hover3.x}% ${hoverPositions.hover3.y}%, rgba(${whiteColor}, ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_3.WHITE_START}) 0%, rgba(${whiteColor}, 0) ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_3.WHITE_STOP}%)`,
|
|
2621
|
+
"--atomix-glass-base-opacity": opacityValues.base,
|
|
2622
|
+
"--atomix-glass-base-gradient": isOverLight ? `linear-gradient(${ATOMIX_GLASS.CONSTANTS.BASE_GRADIENT.ANGLE}deg, rgba(0, 0, 0, ${ATOMIX_GLASS.CONSTANTS.BASE_GRADIENT.BLACK_START_BASE + mx * ATOMIX_GLASS.CONSTANTS.BASE_GRADIENT.BLACK_START_MULTIPLIER}) 0%, rgba(0, 0, 0, ${ATOMIX_GLASS.CONSTANTS.BASE_GRADIENT.BLACK_MID_BASE + my * 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 + absMx * ATOMIX_GLASS.CONSTANTS.BASE_GRADIENT.BLACK_END_MULTIPLIER}) 100%)` : `rgba(${whiteColor}, ${ATOMIX_GLASS.CONSTANTS.BASE_GRADIENT.WHITE_OPACITY})`,
|
|
2623
|
+
"--atomix-glass-overlay-opacity": opacityValues.over,
|
|
2624
|
+
"--atomix-glass-overlay-gradient": isOverLight ? `radial-gradient(circle at ${basePosition.x}% ${basePosition.y}%, rgba(0, 0, 0, ${ATOMIX_GLASS.CONSTANTS.OVERLAY_GRADIENT.BLACK_START_BASE + absMx * 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 + absMy * ATOMIX_GLASS.CONSTANTS.OVERLAY_GRADIENT.BLACK_END_MULTIPLIER}) 100%)` : `rgba(${whiteColor}, ${ATOMIX_GLASS.CONSTANTS.OVERLAY_GRADIENT.WHITE_OPACITY})`
|
|
2625
|
+
};
|
|
2626
|
+
}), [ gradientValues, opacityValues, effectiveCornerRadius, transformStyle, positionStyles, adjustedSize, style.position, isOverLight ]), renderBackgroundLayer = layerType => jsx("div", {
|
|
2627
|
+
className: [ ATOMIX_GLASS.BACKGROUND_LAYER_CLASS, "dark" === layerType ? ATOMIX_GLASS.BACKGROUND_LAYER_DARK_CLASS : ATOMIX_GLASS.BACKGROUND_LAYER_BLACK_CLASS, isOverLight ? ATOMIX_GLASS.BACKGROUND_LAYER_OVER_LIGHT_CLASS : ATOMIX_GLASS.BACKGROUND_LAYER_HIDDEN_CLASS ].filter(Boolean).join(" "),
|
|
2628
|
+
style: {
|
|
2629
|
+
...positionStyles,
|
|
2630
|
+
height: adjustedSize.height,
|
|
2631
|
+
width: adjustedSize.width,
|
|
2632
|
+
borderRadius: `${effectiveCornerRadius}px`,
|
|
2633
|
+
transform: baseStyle.transform
|
|
2634
|
+
}
|
|
2635
|
+
});
|
|
2598
2636
|
return jsxs("div", {
|
|
2599
2637
|
className: componentClassName,
|
|
2600
2638
|
style: glassVars,
|
|
@@ -2650,25 +2688,7 @@ function useAtomixGlass({glassRef: glassRef, contentRef: contentRef, cornerRadiu
|
|
|
2650
2688
|
}), jsx("div", {
|
|
2651
2689
|
className: ATOMIX_GLASS.HOVER_3_CLASS
|
|
2652
2690
|
}) ]
|
|
2653
|
-
}),
|
|
2654
|
-
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(" "),
|
|
2655
|
-
style: {
|
|
2656
|
-
...positionStyles,
|
|
2657
|
-
height: adjustedSize.height,
|
|
2658
|
-
width: adjustedSize.width,
|
|
2659
|
-
borderRadius: `${effectiveCornerRadius}px`,
|
|
2660
|
-
transform: baseStyle.transform
|
|
2661
|
-
}
|
|
2662
|
-
}), jsx("div", {
|
|
2663
|
-
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(" "),
|
|
2664
|
-
style: {
|
|
2665
|
-
...positionStyles,
|
|
2666
|
-
height: adjustedSize.height,
|
|
2667
|
-
width: adjustedSize.width,
|
|
2668
|
-
borderRadius: `${effectiveCornerRadius}px`,
|
|
2669
|
-
transform: baseStyle.transform
|
|
2670
|
-
}
|
|
2671
|
-
}), shouldRenderOverLightLayers && jsxs(Fragment, {
|
|
2691
|
+
}), renderBackgroundLayer("dark"), renderBackgroundLayer("black"), shouldRenderOverLightLayers && jsxs(Fragment, {
|
|
2672
2692
|
children: [ jsx("div", {
|
|
2673
2693
|
className: ATOMIX_GLASS.BASE_LAYER_CLASS
|
|
2674
2694
|
}), jsx("div", {
|