@shohojdhara/atomix 0.4.0 → 0.4.2

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.
Files changed (150) hide show
  1. package/dist/atomix.css +0 -14
  2. package/dist/atomix.css.map +1 -1
  3. package/dist/atomix.min.css +4 -4
  4. package/dist/atomix.min.css.map +1 -1
  5. package/dist/charts.d.ts +12 -19
  6. package/dist/charts.js +555 -359
  7. package/dist/charts.js.map +1 -1
  8. package/dist/core.d.ts +98 -28
  9. package/dist/core.js +1082 -733
  10. package/dist/core.js.map +1 -1
  11. package/dist/forms.d.ts +26 -21
  12. package/dist/forms.js +937 -350
  13. package/dist/forms.js.map +1 -1
  14. package/dist/heavy.d.ts +14 -21
  15. package/dist/heavy.js +409 -256
  16. package/dist/heavy.js.map +1 -1
  17. package/dist/index.d.ts +518 -284
  18. package/dist/index.esm.js +1993 -1237
  19. package/dist/index.esm.js.map +1 -1
  20. package/dist/index.js +1994 -1237
  21. package/dist/index.js.map +1 -1
  22. package/dist/index.min.js +1 -1
  23. package/dist/index.min.js.map +1 -1
  24. package/package.json +2 -2
  25. package/scripts/atomix-cli.js +43 -1
  26. package/scripts/cli/__tests__/utils.test.js +6 -2
  27. package/scripts/cli/migration-tools.js +2 -2
  28. package/scripts/cli/theme-bridge.js +7 -9
  29. package/scripts/cli/utils.js +2 -1
  30. package/src/components/Accordion/Accordion.stories.tsx +40 -0
  31. package/src/components/Accordion/Accordion.tsx +174 -56
  32. package/src/components/Accordion/AccordionCompound.test.tsx +70 -0
  33. package/src/components/AtomixGlass/AtomixGlass.tsx +82 -54
  34. package/src/components/AtomixGlass/AtomixGlassContainer.tsx +17 -18
  35. package/src/components/AtomixGlass/README.md +5 -5
  36. package/src/components/AtomixGlass/stories/Customization.stories.tsx +2 -2
  37. package/src/components/AtomixGlass/stories/Examples.stories.tsx +42 -42
  38. package/src/components/AtomixGlass/stories/Modes.stories.tsx +5 -5
  39. package/src/components/AtomixGlass/stories/Overview.stories.tsx +3 -3
  40. package/src/components/AtomixGlass/stories/Performance.stories.tsx +2 -2
  41. package/src/components/AtomixGlass/stories/Playground.stories.tsx +45 -45
  42. package/src/components/AtomixGlass/stories/Shaders.stories.tsx +3 -3
  43. package/src/components/Badge/Badge.stories.tsx +1 -1
  44. package/src/components/Badge/Badge.tsx +1 -1
  45. package/src/components/Breadcrumb/Breadcrumb.tsx +185 -65
  46. package/src/components/Breadcrumb/BreadcrumbCompound.test.tsx +84 -0
  47. package/src/components/Breadcrumb/index.ts +2 -2
  48. package/src/components/Button/Button.stories.tsx +1 -1
  49. package/src/components/Button/README.md +2 -2
  50. package/src/components/Callout/Callout.stories.tsx +166 -1011
  51. package/src/components/Callout/Callout.test.tsx +3 -3
  52. package/src/components/Callout/Callout.tsx +196 -84
  53. package/src/components/Callout/CalloutCompound.test.tsx +72 -0
  54. package/src/components/Callout/README.md +2 -2
  55. package/src/components/Chart/Chart.stories.tsx +1 -1
  56. package/src/components/Chart/Chart.tsx +5 -5
  57. package/src/components/Chart/TreemapChart.tsx +37 -29
  58. package/src/components/DatePicker/readme.md +3 -3
  59. package/src/components/Dropdown/Dropdown.stories.tsx +1 -1
  60. package/src/components/Dropdown/Dropdown.tsx +133 -20
  61. package/src/components/Dropdown/DropdownCompound.test.tsx +64 -0
  62. package/src/components/EdgePanel/EdgePanel.stories.tsx +7 -7
  63. package/src/components/EdgePanel/EdgePanel.tsx +164 -112
  64. package/src/components/EdgePanel/EdgePanelCompound.test.tsx +53 -0
  65. package/src/components/Form/Checkbox.stories.tsx +1 -1
  66. package/src/components/Form/Checkbox.tsx +1 -1
  67. package/src/components/Form/Input.stories.tsx +1 -1
  68. package/src/components/Form/Input.tsx +1 -1
  69. package/src/components/Form/Radio.stories.tsx +1 -1
  70. package/src/components/Form/Radio.tsx +1 -1
  71. package/src/components/Form/Select.stories.tsx +24 -1
  72. package/src/components/Form/Select.test.tsx +99 -0
  73. package/src/components/Form/Select.tsx +145 -94
  74. package/src/components/Form/SelectOption.tsx +88 -0
  75. package/src/components/Form/Textarea.stories.tsx +1 -1
  76. package/src/components/Form/Textarea.tsx +1 -1
  77. package/src/components/Hero/Hero.stories.tsx +39 -2
  78. package/src/components/Hero/Hero.test.tsx +142 -0
  79. package/src/components/Hero/Hero.tsx +143 -4
  80. package/src/components/List/List.test.tsx +62 -0
  81. package/src/components/List/List.tsx +16 -5
  82. package/src/components/List/ListItem.tsx +20 -0
  83. package/src/components/Messages/Messages.stories.tsx +1 -1
  84. package/src/components/Messages/Messages.tsx +2 -2
  85. package/src/components/Modal/Modal.stories.tsx +66 -2
  86. package/src/components/Modal/Modal.tsx +115 -35
  87. package/src/components/Modal/ModalCompound.test.tsx +94 -0
  88. package/src/components/Navigation/Nav/Nav.stories.tsx +2 -2
  89. package/src/components/Navigation/Nav/Nav.tsx +1 -1
  90. package/src/components/Navigation/Navbar/Navbar.stories.tsx +3 -3
  91. package/src/components/Navigation/Navbar/Navbar.tsx +1 -1
  92. package/src/components/Navigation/SideMenu/SideMenu.stories.tsx +2 -2
  93. package/src/components/Navigation/SideMenu/SideMenu.tsx +1 -1
  94. package/src/components/Pagination/Pagination.stories.tsx +1 -1
  95. package/src/components/Pagination/Pagination.tsx +1 -1
  96. package/src/components/Popover/Popover.stories.tsx +1 -1
  97. package/src/components/Popover/Popover.tsx +1 -1
  98. package/src/components/Progress/Progress.tsx +1 -1
  99. package/src/components/Rating/Rating.stories.tsx +1 -1
  100. package/src/components/Rating/Rating.test.tsx +73 -0
  101. package/src/components/Rating/Rating.tsx +25 -37
  102. package/src/components/Spinner/Spinner.tsx +1 -1
  103. package/src/components/Steps/Steps.stories.tsx +1 -1
  104. package/src/components/Steps/Steps.tsx +125 -22
  105. package/src/components/Steps/StepsCompound.test.tsx +81 -0
  106. package/src/components/Tabs/Tabs.stories.tsx +1 -1
  107. package/src/components/Tabs/Tabs.tsx +198 -45
  108. package/src/components/Tabs/TabsCompound.test.tsx +64 -0
  109. package/src/components/Todo/Todo.tsx +0 -1
  110. package/src/components/Toggle/Toggle.stories.tsx +1 -1
  111. package/src/components/Toggle/Toggle.tsx +1 -1
  112. package/src/components/Tooltip/Tooltip.stories.tsx +1 -1
  113. package/src/components/VideoPlayer/VideoPlayer.stories.tsx +2 -2
  114. package/src/lib/composables/__tests__/useAtomixGlassPerf.test.tsx +88 -0
  115. package/src/lib/composables/__tests__/useChart.test.ts +50 -0
  116. package/src/lib/composables/__tests__/useChart.test.tsx +139 -0
  117. package/src/lib/composables/__tests__/useHeroBackgroundSlider.test.tsx +59 -0
  118. package/src/lib/composables/__tests__/useSliderAutoplay.test.tsx +68 -0
  119. package/src/lib/composables/atomix-glass/useGlassBackgroundDetection.ts +329 -0
  120. package/src/lib/composables/atomix-glass/useGlassCornerRadius.ts +82 -0
  121. package/src/lib/composables/atomix-glass/useGlassMouseTracking.ts +153 -0
  122. package/src/lib/composables/atomix-glass/useGlassOverLight.ts +198 -0
  123. package/src/lib/composables/atomix-glass/useGlassSize.ts +117 -0
  124. package/src/lib/composables/atomix-glass/useGlassState.ts +112 -0
  125. package/src/lib/composables/atomix-glass/useGlassTransforms.ts +160 -0
  126. package/src/lib/composables/glass-styles.ts +302 -0
  127. package/src/lib/composables/index.ts +0 -8
  128. package/src/lib/composables/useAtomixGlass.ts +331 -537
  129. package/src/lib/composables/useAtomixGlassStyles.ts +307 -0
  130. package/src/lib/composables/useBarChart.ts +1 -1
  131. package/src/lib/composables/useBreadcrumb.ts +6 -6
  132. package/src/lib/composables/useChart.ts +104 -21
  133. package/src/lib/composables/useHeroBackgroundSlider.ts +16 -7
  134. package/src/lib/composables/useSlider.ts +66 -34
  135. package/src/lib/theme/devtools/CLI.ts +2 -10
  136. package/src/lib/theme/utils/__tests__/themeUtils.test.ts +213 -0
  137. package/src/lib/types/components.ts +21 -23
  138. package/src/lib/utils/__tests__/componentUtils.test.ts +57 -2
  139. package/src/lib/utils/__tests__/dom.test.ts +100 -0
  140. package/src/lib/utils/__tests__/fontPreloader.test.ts +102 -0
  141. package/src/lib/utils/__tests__/themeNaming.test.ts +117 -0
  142. package/src/lib/utils/themeNaming.ts +1 -1
  143. package/src/styles/06-components/_components.accordion.scss +0 -2
  144. package/src/styles/06-components/_components.chart.scss +0 -1
  145. package/src/styles/06-components/_components.dropdown.scss +0 -1
  146. package/src/styles/06-components/_components.edge-panel.scss +0 -2
  147. package/src/styles/06-components/_components.photoviewer.scss +0 -1
  148. package/src/styles/06-components/_components.river.scss +0 -1
  149. package/src/styles/06-components/_components.slider.scss +0 -3
  150. package/src/styles/99-utilities/_utilities.glass-fixes.scss +0 -1
package/dist/index.esm.js CHANGED
@@ -8,9 +8,379 @@ import { Pause, Play, SkipBack, SkipForward, SpeakerX, SpeakerHigh, Gear, Downlo
8
8
 
9
9
  import { createPortal } from "react-dom";
10
10
 
11
- /**
12
- * Default theme colors for components
13
- */ const THEME_COLORS = [ "primary", "secondary", "success", "info", "warning", "error", "light", "dark" ], SIZES = [ "sm", "md", "lg" ], CLASS_PREFIX = {
11
+ var commonjsGlobal = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {};
12
+
13
+ function getDefaultExportFromCjs(x) {
14
+ return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x.default : x;
15
+ }
16
+
17
+ var fails$9 = function(exec) {
18
+ try {
19
+ return !!exec();
20
+ } catch (error) {
21
+ return !0;
22
+ }
23
+ }, functionBindNative = !fails$9((function() {
24
+ // eslint-disable-next-line es/no-function-prototype-bind -- safe
25
+ var test = function() {/* empty */}.bind();
26
+ // eslint-disable-next-line no-prototype-builtins -- safe
27
+ return "function" != typeof test || test.hasOwnProperty("prototype");
28
+ })), NATIVE_BIND$3 = functionBindNative, FunctionPrototype$1 = Function.prototype, call$5 = FunctionPrototype$1.call, uncurryThisWithBind = NATIVE_BIND$3 && FunctionPrototype$1.bind.bind(call$5, call$5), functionUncurryThis = NATIVE_BIND$3 ? uncurryThisWithBind : function(fn) {
29
+ return function() {
30
+ return call$5.apply(fn, arguments);
31
+ };
32
+ }, objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf), check = function(it) {
33
+ return it && it.Math === Math && it;
34
+ }, globalThis_1 =
35
+ // eslint-disable-next-line es/no-global-this -- safe
36
+ check("object" == typeof globalThis && globalThis) || check("object" == typeof window && window) ||
37
+ // eslint-disable-next-line no-restricted-globals -- safe
38
+ check("object" == typeof self && self) || check("object" == typeof commonjsGlobal && commonjsGlobal) || check("object" == typeof commonjsGlobal && commonjsGlobal) ||
39
+ // eslint-disable-next-line no-new-func -- fallback
40
+ function() {
41
+ return this;
42
+ }() || Function("return this")(), NATIVE_BIND$2 = functionBindNative, FunctionPrototype = Function.prototype, apply$1 = FunctionPrototype.apply, call$4 = FunctionPrototype.call, functionApply = "object" == typeof Reflect && Reflect.apply || (NATIVE_BIND$2 ? call$4.bind(apply$1) : function() {
43
+ return call$4.apply(apply$1, arguments);
44
+ }), uncurryThis$7 = functionUncurryThis, toString$3 = uncurryThis$7({}.toString), stringSlice = uncurryThis$7("".slice), classofRaw$2 = function(it) {
45
+ return stringSlice(toString$3(it), 8, -1);
46
+ }, classofRaw$1 = classofRaw$2, uncurryThis$6 = functionUncurryThis, functionUncurryThisClause = function(fn) {
47
+ // Nashorn bug:
48
+ // https://github.com/zloirock/core-js/issues/1128
49
+ // https://github.com/zloirock/core-js/issues/1130
50
+ if ("Function" === classofRaw$1(fn)) return uncurryThis$6(fn);
51
+ }, documentAll = "object" == typeof document && document.all, isCallable$8 = void 0 === documentAll && void 0 !== documentAll ? function(argument) {
52
+ return "function" == typeof argument || argument === documentAll;
53
+ } : function(argument) {
54
+ return "function" == typeof argument;
55
+ }, objectGetOwnPropertyDescriptor = {}, descriptors = !fails$9((function() {
56
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
57
+ return 7 !== Object.defineProperty({}, 1, {
58
+ get: function() {
59
+ return 7;
60
+ }
61
+ })[1];
62
+ })), NATIVE_BIND$1 = functionBindNative, call$3 = Function.prototype.call, functionCall = NATIVE_BIND$1 ? call$3.bind(call$3) : function() {
63
+ return call$3.apply(call$3, arguments);
64
+ }, objectPropertyIsEnumerable = {}, $propertyIsEnumerable = {}.propertyIsEnumerable, getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor, NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({
65
+ 1: 2
66
+ }, 1);
67
+
68
+ // `Object.prototype.propertyIsEnumerable` method implementation
69
+ // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
70
+ objectPropertyIsEnumerable.f = NASHORN_BUG ? function(V) {
71
+ var descriptor = getOwnPropertyDescriptor$1(this, V);
72
+ return !!descriptor && descriptor.enumerable;
73
+ } : $propertyIsEnumerable;
74
+
75
+ var match, version, createPropertyDescriptor$2 = function(bitmap, value) {
76
+ return {
77
+ enumerable: !(1 & bitmap),
78
+ configurable: !(2 & bitmap),
79
+ writable: !(4 & bitmap),
80
+ value: value
81
+ };
82
+ }, fails$6 = fails$9, classof$4 = classofRaw$2, $Object$3 = Object, split = functionUncurryThis("".split), indexedObject = fails$6((function() {
83
+ // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
84
+ // eslint-disable-next-line no-prototype-builtins -- safe
85
+ return !$Object$3("z").propertyIsEnumerable(0);
86
+ })) ? function(it) {
87
+ return "String" === classof$4(it) ? split(it, "") : $Object$3(it);
88
+ } : $Object$3, isNullOrUndefined$2 = function(it) {
89
+ return null == it;
90
+ }, isNullOrUndefined$1 = isNullOrUndefined$2, $TypeError$7 = TypeError, requireObjectCoercible$3 = function(it) {
91
+ if (isNullOrUndefined$1(it)) throw new $TypeError$7("Can't call method on " + it);
92
+ return it;
93
+ }, IndexedObject$1 = indexedObject, requireObjectCoercible$2 = requireObjectCoercible$3, toIndexedObject$2 = function(it) {
94
+ return IndexedObject$1(requireObjectCoercible$2(it));
95
+ }, isCallable$7 = isCallable$8, isObject$6 = function(it) {
96
+ return "object" == typeof it ? null !== it : isCallable$7(it);
97
+ }, path$3 = {}, path$2 = path$3, globalThis$b = globalThis_1, isCallable$6 = isCallable$8, aFunction = function(variable) {
98
+ return isCallable$6(variable) ? variable : void 0;
99
+ }, navigator$1 = globalThis_1.navigator, userAgent$2 = navigator$1 && navigator$1.userAgent, environmentUserAgent = userAgent$2 ? String(userAgent$2) : "", globalThis$9 = globalThis_1, userAgent$1 = environmentUserAgent, process$1 = globalThis$9.process, Deno$1 = globalThis$9.Deno, versions = process$1 && process$1.versions || Deno$1 && Deno$1.version, v8 = versions && versions.v8;
100
+
101
+ v8 && (
102
+ // in old Chrome, versions of V8 isn't V8 = Chrome / 10
103
+ // but their correct versions are not interesting for us
104
+ version = (match = v8.split("."))[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1])),
105
+ // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
106
+ // so check `userAgent` even if `.v8` exists, but 0
107
+ !version && userAgent$1 && (!(match = userAgent$1.match(/Edge\/(\d+)/)) || match[1] >= 74) && (match = userAgent$1.match(/Chrome\/(\d+)/)) && (version = +match[1]);
108
+
109
+ var environmentV8Version = version, V8_VERSION = environmentV8Version, fails$5 = fails$9, $String$3 = globalThis_1.String, symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$5((function() {
110
+ var symbol = Symbol("symbol detection");
111
+ // Chrome 38 Symbol has incorrect toString conversion
112
+ // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
113
+ // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
114
+ // of course, fail.
115
+ return !$String$3(symbol) || !(Object(symbol) instanceof Symbol) ||
116
+ // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
117
+ !Symbol.sham && V8_VERSION && V8_VERSION < 41;
118
+ })), useSymbolAsUid = symbolConstructorDetection && !Symbol.sham && "symbol" == typeof Symbol.iterator, isCallable$5 = isCallable$8, isPrototypeOf$2 = objectIsPrototypeOf, $Object$2 = Object, isSymbol$2 = useSymbolAsUid ? function(it) {
119
+ return "symbol" == typeof it;
120
+ } : function(it) {
121
+ var $Symbol = function(namespace, method) {
122
+ return arguments.length < 2 ? aFunction(path$2[namespace]) || aFunction(globalThis$b[namespace]) : path$2[namespace] && path$2[namespace][method] || globalThis$b[namespace] && globalThis$b[namespace][method];
123
+ }("Symbol");
124
+ return isCallable$5($Symbol) && isPrototypeOf$2($Symbol.prototype, $Object$2(it));
125
+ }, $String$2 = String, isCallable$4 = isCallable$8, $TypeError$6 = TypeError, aCallable$3 = function(argument) {
126
+ if (isCallable$4(argument)) return argument;
127
+ throw new $TypeError$6(function(argument) {
128
+ try {
129
+ return $String$2(argument);
130
+ } catch (error) {
131
+ return "Object";
132
+ }
133
+ }(argument) + " is not a function");
134
+ }, aCallable$2 = aCallable$3, isNullOrUndefined = isNullOrUndefined$2, call$2 = functionCall, isCallable$3 = isCallable$8, isObject$5 = isObject$6, $TypeError$5 = TypeError, sharedStore = {
135
+ exports: {}
136
+ }, globalThis$7 = globalThis_1, defineProperty = Object.defineProperty, globalThis$6 = globalThis_1, store$1 = sharedStore.exports = globalThis$6["__core-js_shared__"] || function(key, value) {
137
+ try {
138
+ defineProperty(globalThis$7, key, {
139
+ value: value,
140
+ configurable: !0,
141
+ writable: !0
142
+ });
143
+ } catch (error) {
144
+ globalThis$7[key] = value;
145
+ }
146
+ return value;
147
+ }("__core-js_shared__", {});
148
+
149
+ /* eslint-disable es/no-symbol -- required for testing */ (store$1.versions || (store$1.versions = [])).push({
150
+ version: "3.43.0",
151
+ mode: "pure",
152
+ copyright: "© 2014-2025 Denis Pushkarev (zloirock.ru)",
153
+ license: "https://github.com/zloirock/core-js/blob/v3.43.0/LICENSE",
154
+ source: "https://github.com/zloirock/core-js"
155
+ });
156
+
157
+ var key, value, store = sharedStore.exports, requireObjectCoercible$1 = requireObjectCoercible$3, $Object$1 = Object, toObject$2 = function(argument) {
158
+ return $Object$1(requireObjectCoercible$1(argument));
159
+ }, toObject$1 = toObject$2, hasOwnProperty = functionUncurryThis({}.hasOwnProperty), hasOwnProperty_1 = Object.hasOwn || function(it, key) {
160
+ return hasOwnProperty(toObject$1(it), key);
161
+ }, uncurryThis$3 = functionUncurryThis, id = 0, postfix = Math.random(), toString$2 = uncurryThis$3(1.1.toString), hasOwn$2 = hasOwnProperty_1, NATIVE_SYMBOL = symbolConstructorDetection, USE_SYMBOL_AS_UID = useSymbolAsUid, Symbol$1 = globalThis_1.Symbol, WellKnownSymbolsStore = store[key = "wks"] || (store[key] = value || {}), createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1.for || Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || function(key) {
162
+ return "Symbol(" + (void 0 === key ? "" : key) + ")_" + toString$2(++id + postfix, 36);
163
+ }, wellKnownSymbol$5 = function(name) {
164
+ return hasOwn$2(WellKnownSymbolsStore, name) || (WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn$2(Symbol$1, name) ? Symbol$1[name] : createWellKnownSymbol("Symbol." + name)),
165
+ WellKnownSymbolsStore[name];
166
+ }, call$1 = functionCall, isObject$4 = isObject$6, isSymbol$1 = isSymbol$2, $TypeError$4 = TypeError, TO_PRIMITIVE = wellKnownSymbol$5("toPrimitive"), toPrimitive = function(input, pref) {
167
+ if (!isObject$4(input) || isSymbol$1(input)) return input;
168
+ var result, func, exoticToPrim = (func = input[TO_PRIMITIVE], isNullOrUndefined(func) ? void 0 : aCallable$2(func));
169
+ if (exoticToPrim) {
170
+ if (void 0 === pref && (pref = "default"), result = call$1(exoticToPrim, input, pref),
171
+ !isObject$4(result) || isSymbol$1(result)) return result;
172
+ throw new $TypeError$4("Can't convert object to primitive value");
173
+ }
174
+ return void 0 === pref && (pref = "number"), function(input, pref) {
175
+ var fn, val;
176
+ if ("string" === pref && isCallable$3(fn = input.toString) && !isObject$5(val = call$2(fn, input))) return val;
177
+ if (isCallable$3(fn = input.valueOf) && !isObject$5(val = call$2(fn, input))) return val;
178
+ if ("string" !== pref && isCallable$3(fn = input.toString) && !isObject$5(val = call$2(fn, input))) return val;
179
+ throw new $TypeError$5("Can't convert object to primitive value");
180
+ }(input, pref);
181
+ }, isSymbol = isSymbol$2, toPropertyKey$2 = function(argument) {
182
+ var key = toPrimitive(argument, "string");
183
+ return isSymbol(key) ? key : key + "";
184
+ }, isObject$3 = isObject$6, document$1 = globalThis_1.document, EXISTS = isObject$3(document$1) && isObject$3(document$1.createElement), ie8DomDefine = !descriptors && !fails$9((function() {
185
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
186
+ return 7 !== Object.defineProperty((it = "div", EXISTS ? document$1.createElement(it) : {}), "a", {
187
+ get: function() {
188
+ return 7;
189
+ }
190
+ }).a;
191
+ var it;
192
+ })), DESCRIPTORS$3 = descriptors, call = functionCall, propertyIsEnumerableModule = objectPropertyIsEnumerable, createPropertyDescriptor$1 = createPropertyDescriptor$2, toIndexedObject$1 = toIndexedObject$2, toPropertyKey$1 = toPropertyKey$2, hasOwn$1 = hasOwnProperty_1, IE8_DOM_DEFINE$1 = ie8DomDefine, $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
193
+
194
+ // `Object.getOwnPropertyDescriptor` method
195
+ // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
196
+ objectGetOwnPropertyDescriptor.f = DESCRIPTORS$3 ? $getOwnPropertyDescriptor$1 : function(O, P) {
197
+ if (O = toIndexedObject$1(O), P = toPropertyKey$1(P), IE8_DOM_DEFINE$1) try {
198
+ return $getOwnPropertyDescriptor$1(O, P);
199
+ } catch (error) {/* empty */}
200
+ if (hasOwn$1(O, P)) return createPropertyDescriptor$1(!call(propertyIsEnumerableModule.f, O, P), O[P]);
201
+ };
202
+
203
+ var fails$3 = fails$9, isCallable$2 = isCallable$8, replacement = /#|\.prototype\./, isForced$1 = function(feature, detection) {
204
+ var value = data[normalize(feature)];
205
+ return value === POLYFILL || value !== NATIVE && (isCallable$2(detection) ? fails$3(detection) : !!detection);
206
+ }, normalize = isForced$1.normalize = function(string) {
207
+ return String(string).replace(replacement, ".").toLowerCase();
208
+ }, data = isForced$1.data = {}, NATIVE = isForced$1.NATIVE = "N", POLYFILL = isForced$1.POLYFILL = "P", isForced_1 = isForced$1, aCallable$1 = aCallable$3, NATIVE_BIND = functionBindNative, bind$1 = functionUncurryThisClause(functionUncurryThisClause.bind), objectDefineProperty = {}, v8PrototypeDefineBug = descriptors && fails$9((function() {
209
+ // eslint-disable-next-line es/no-object-defineproperty -- required for testing
210
+ return 42 !== Object.defineProperty((function() {/* empty */}), "prototype", {
211
+ value: 42,
212
+ writable: !1
213
+ }).prototype;
214
+ })), isObject$2 = isObject$6, $String$1 = String, $TypeError$3 = TypeError, DESCRIPTORS$1 = descriptors, IE8_DOM_DEFINE = ie8DomDefine, V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug, anObject = function(argument) {
215
+ if (isObject$2(argument)) return argument;
216
+ throw new $TypeError$3($String$1(argument) + " is not an object");
217
+ }, toPropertyKey = toPropertyKey$2, $TypeError$2 = TypeError, $defineProperty = Object.defineProperty, $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
218
+
219
+ // `Object.defineProperty` method
220
+ // https://tc39.es/ecma262/#sec-object.defineproperty
221
+ objectDefineProperty.f = DESCRIPTORS$1 ? V8_PROTOTYPE_DEFINE_BUG ? function(O, P, Attributes) {
222
+ if (anObject(O), P = toPropertyKey(P), anObject(Attributes), "function" == typeof O && "prototype" === P && "value" in Attributes && "writable" in Attributes && !Attributes.writable) {
223
+ var current = $getOwnPropertyDescriptor(O, P);
224
+ current && current.writable && (O[P] = Attributes.value, Attributes = {
225
+ configurable: "configurable" in Attributes ? Attributes.configurable : current.configurable,
226
+ enumerable: "enumerable" in Attributes ? Attributes.enumerable : current.enumerable,
227
+ writable: !1
228
+ });
229
+ }
230
+ return $defineProperty(O, P, Attributes);
231
+ } : $defineProperty : function(O, P, Attributes) {
232
+ if (anObject(O), P = toPropertyKey(P), anObject(Attributes), IE8_DOM_DEFINE) try {
233
+ return $defineProperty(O, P, Attributes);
234
+ } catch (error) {/* empty */}
235
+ if ("get" in Attributes || "set" in Attributes) throw new $TypeError$2("Accessors not supported");
236
+ return "value" in Attributes && (O[P] = Attributes.value), O;
237
+ };
238
+
239
+ var definePropertyModule = objectDefineProperty, createPropertyDescriptor = createPropertyDescriptor$2, createNonEnumerableProperty$1 = descriptors ? function(object, key, value) {
240
+ return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
241
+ } : function(object, key, value) {
242
+ return object[key] = value, object;
243
+ }, globalThis$3 = globalThis_1, apply = functionApply, uncurryThis$1 = functionUncurryThisClause, isCallable$1 = isCallable$8, getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f, isForced = isForced_1, path$1 = path$3, bind = function(fn, that) {
244
+ return aCallable$1(fn), void 0 === that ? fn : NATIVE_BIND ? bind$1(fn, that) : function() {
245
+ return fn.apply(that, arguments);
246
+ };
247
+ }, createNonEnumerableProperty = createNonEnumerableProperty$1, hasOwn = hasOwnProperty_1, wrapConstructor = function(NativeConstructor) {
248
+ var Wrapper = function(a, b, c) {
249
+ if (this instanceof Wrapper) {
250
+ switch (arguments.length) {
251
+ case 0:
252
+ return new NativeConstructor;
253
+
254
+ case 1:
255
+ return new NativeConstructor(a);
256
+
257
+ case 2:
258
+ return new NativeConstructor(a, b);
259
+ }
260
+ return new NativeConstructor(a, b, c);
261
+ }
262
+ return apply(NativeConstructor, this, arguments);
263
+ };
264
+ return Wrapper.prototype = NativeConstructor.prototype, Wrapper;
265
+ }, _export = function(options, source) {
266
+ var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE, key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor, TARGET = options.target, GLOBAL = options.global, STATIC = options.stat, PROTO = options.proto, nativeSource = GLOBAL ? globalThis$3 : STATIC ? globalThis$3[TARGET] : globalThis$3[TARGET] && globalThis$3[TARGET].prototype, target = GLOBAL ? path$1 : path$1[TARGET] || createNonEnumerableProperty(path$1, TARGET, {})[TARGET], targetPrototype = target.prototype;
267
+ for (key in source)
268
+ // contains in native
269
+ USE_NATIVE = !(FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? "." : "#") + key, options.forced)) && nativeSource && hasOwn(nativeSource, key),
270
+ targetProperty = target[key], USE_NATIVE && (nativeProperty = options.dontCallGetSet ? (descriptor = getOwnPropertyDescriptor(nativeSource, key)) && descriptor.value : nativeSource[key]),
271
+ // export native or implementation
272
+ sourceProperty = USE_NATIVE && nativeProperty ? nativeProperty : source[key], (FORCED || PROTO || typeof targetProperty != typeof sourceProperty) && (
273
+ // bind methods to global for calling from export context
274
+ resultProperty = options.bind && USE_NATIVE ? bind(sourceProperty, globalThis$3) : options.wrap && USE_NATIVE ? wrapConstructor(sourceProperty) : PROTO && isCallable$1(sourceProperty) ? uncurryThis$1(sourceProperty) : sourceProperty,
275
+ // add a flag to not completely full polyfills
276
+ (options.sham || sourceProperty && sourceProperty.sham || targetProperty && targetProperty.sham) && createNonEnumerableProperty(resultProperty, "sham", !0),
277
+ createNonEnumerableProperty(target, key, resultProperty), PROTO && (hasOwn(path$1, VIRTUAL_PROTOTYPE = TARGET + "Prototype") || createNonEnumerableProperty(path$1, VIRTUAL_PROTOTYPE, {}),
278
+ // export virtual prototype methods
279
+ createNonEnumerableProperty(path$1[VIRTUAL_PROTOTYPE], key, sourceProperty),
280
+ // export real prototype methods
281
+ options.real && targetPrototype && (FORCED || !targetPrototype[key]) && createNonEnumerableProperty(targetPrototype, key, sourceProperty)));
282
+ }, ceil = Math.ceil, floor = Math.floor, trunc = Math.trunc || function(x) {
283
+ var n = +x;
284
+ return (n > 0 ? floor : ceil)(n);
285
+ }, toIntegerOrInfinity$2 = function(argument) {
286
+ var number = +argument;
287
+ // eslint-disable-next-line no-self-compare -- NaN check
288
+ return number != number || 0 === number ? 0 : trunc(number);
289
+ }, toIntegerOrInfinity$1 = toIntegerOrInfinity$2, max = Math.max, min$1 = Math.min, toIntegerOrInfinity = toIntegerOrInfinity$2, min = Math.min, lengthOfArrayLike$2 = function(obj) {
290
+ return argument = obj.length, (len = toIntegerOrInfinity(argument)) > 0 ? min(len, 9007199254740991) : 0;
291
+ var argument, len;
292
+ }, toIndexedObject = toIndexedObject$2, lengthOfArrayLike$1 = lengthOfArrayLike$2, createMethod$1 = function(IS_INCLUDES) {
293
+ return function($this, el, fromIndex) {
294
+ var O = toIndexedObject($this), length = lengthOfArrayLike$1(O);
295
+ if (0 === length) return !IS_INCLUDES && -1;
296
+ var value, index = function(index, length) {
297
+ var integer = toIntegerOrInfinity$1(index);
298
+ return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
299
+ }(fromIndex, length);
300
+ // Array#includes uses SameValueZero equality algorithm
301
+ // eslint-disable-next-line no-self-compare -- NaN check
302
+ if (IS_INCLUDES && el != el) {
303
+ for (;length > index; )
304
+ // eslint-disable-next-line no-self-compare -- NaN check
305
+ if ((value = O[index++]) != value) return !0;
306
+ // Array#indexOf ignores holes, Array#includes - not
307
+ } else for (;length > index; index++) if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
308
+ return !IS_INCLUDES && -1;
309
+ };
310
+ }, $includes = [ createMethod$1(!0), createMethod$1(!1) ][0];
311
+
312
+ // `Array.prototype.includes` method
313
+ // https://tc39.es/ecma262/#sec-array.prototype.includes
314
+ _export({
315
+ target: "Array",
316
+ proto: !0,
317
+ forced: fails$9((function() {
318
+ // eslint-disable-next-line es/no-array-prototype-includes -- detection
319
+ return !Array(1).includes();
320
+ }))
321
+ }, {
322
+ includes: function(el /* , fromIndex = 0 */) {
323
+ return $includes(this, el, arguments.length > 1 ? arguments[1] : void 0);
324
+ }
325
+ });
326
+
327
+ var globalThis$2 = globalThis_1, path = path$3, getBuiltInPrototypeMethod$3 = function(CONSTRUCTOR, METHOD) {
328
+ var Namespace = path[CONSTRUCTOR + "Prototype"], pureMethod = Namespace && Namespace[METHOD];
329
+ if (pureMethod) return pureMethod;
330
+ var NativeConstructor = globalThis$2[CONSTRUCTOR], NativePrototype = NativeConstructor && NativeConstructor.prototype;
331
+ return NativePrototype && NativePrototype[METHOD];
332
+ }, includes$4 = getBuiltInPrototypeMethod$3("Array", "includes"), isObject$1 = isObject$6, classof$3 = classofRaw$2, MATCH$1 = wellKnownSymbol$5("match"), $TypeError$1 = TypeError, test = {};
333
+
334
+ test[wellKnownSymbol$5("toStringTag")] = "z";
335
+
336
+ var TO_STRING_TAG_SUPPORT = "[object z]" === String(test), isCallable = isCallable$8, classofRaw = classofRaw$2, TO_STRING_TAG = wellKnownSymbol$5("toStringTag"), $Object = Object, CORRECT_ARGUMENTS = "Arguments" === classofRaw(function() {
337
+ return arguments;
338
+ }()), classof$1 = TO_STRING_TAG_SUPPORT ? classofRaw : function(it) {
339
+ var O, tag, result;
340
+ return void 0 === it ? "Undefined" : null === it ? "Null" : "string" == typeof (tag = function(it, key) {
341
+ try {
342
+ return it[key];
343
+ } catch (error) {/* empty */}
344
+ }(O = $Object(it), TO_STRING_TAG)) ? tag : CORRECT_ARGUMENTS ? classofRaw(O) : "Object" === (result = classofRaw(O)) && isCallable(O.callee) ? "Arguments" : result;
345
+ }, $String = String, MATCH = wellKnownSymbol$5("match"), $$1 = _export, notARegExp = function(it) {
346
+ if (function(it) {
347
+ var isRegExp;
348
+ return isObject$1(it) && (void 0 !== (isRegExp = it[MATCH$1]) ? !!isRegExp : "RegExp" === classof$3(it));
349
+ }(it)) throw new $TypeError$1("The method doesn't accept regular expressions");
350
+ return it;
351
+ }, requireObjectCoercible = requireObjectCoercible$3, toString = function(argument) {
352
+ if ("Symbol" === classof$1(argument)) throw new TypeError("Cannot convert a Symbol value to a string");
353
+ return $String(argument);
354
+ }, stringIndexOf = functionUncurryThis("".indexOf);
355
+
356
+ // `String.prototype.includes` method
357
+ // https://tc39.es/ecma262/#sec-string.prototype.includes
358
+ $$1({
359
+ target: "String",
360
+ proto: !0,
361
+ forced: !function(METHOD_NAME) {
362
+ var regexp = /./;
363
+ try {
364
+ "/./"[METHOD_NAME](regexp);
365
+ } catch (error1) {
366
+ try {
367
+ return regexp[MATCH] = !1, "/./"[METHOD_NAME](regexp);
368
+ } catch (error2) {/* empty */}
369
+ }
370
+ return !1;
371
+ }("includes")
372
+ }, {
373
+ includes: function(searchString /* , position = 0 */) {
374
+ return !!~stringIndexOf(toString(requireObjectCoercible(this)), toString(notARegExp(searchString)), arguments.length > 1 ? arguments[1] : void 0);
375
+ }
376
+ });
377
+
378
+ var includes$3 = getBuiltInPrototypeMethod$3("String", "includes"), isPrototypeOf$1 = objectIsPrototypeOf, arrayMethod = includes$4, stringMethod = includes$3, ArrayPrototype$1 = Array.prototype, StringPrototype = String.prototype;
379
+
380
+ const _includesInstanceProperty = getDefaultExportFromCjs((function(it) {
381
+ var own = it.includes;
382
+ return it === ArrayPrototype$1 || isPrototypeOf$1(ArrayPrototype$1, it) && own === ArrayPrototype$1.includes ? arrayMethod : "string" == typeof it || it === StringPrototype || isPrototypeOf$1(StringPrototype, it) && own === StringPrototype.includes ? stringMethod : own;
383
+ })), THEME_COLORS = [ "primary", "secondary", "success", "info", "warning", "error", "light", "dark" ], SIZES = [ "sm", "md", "lg" ], CLASS_PREFIX = {
14
384
  COMPONENT: "c-",
15
385
  UTILITY: "u-",
16
386
  LAYOUT: "l-",
@@ -1523,7 +1893,7 @@ import { createPortal } from "react-dom";
1523
1893
  };
1524
1894
 
1525
1895
  /**
1526
- * Default sizes for components
1896
+ * Default theme colors for components
1527
1897
  */
1528
1898
  /**
1529
1899
  * Accordion functionality hook
@@ -1579,7 +1949,7 @@ function useAccordion(initialProps) {
1579
1949
  };
1580
1950
  }
1581
1951
 
1582
- const {CONSTANTS: CONSTANTS$1} = ATOMIX_GLASS, calculateDistance = (pos1, pos2) => {
1952
+ const {CONSTANTS: CONSTANTS$2} = ATOMIX_GLASS, calculateDistance = (pos1, pos2) => {
1583
1953
  if (!pos1 || !pos2 || "number" != typeof pos1.x || "number" != typeof pos1.y || "number" != typeof pos2.x || "number" != typeof pos2.y) return 0;
1584
1954
  const deltaX = pos1.x - pos2.x, deltaY = pos1.y - pos2.y;
1585
1955
  return Math.sqrt(deltaX * deltaX + deltaY * deltaY);
@@ -1592,36 +1962,36 @@ const {CONSTANTS: CONSTANTS$1} = ATOMIX_GLASS, calculateDistance = (pos1, pos2)
1592
1962
  }, calculateMouseInfluence = mouseOffset => {
1593
1963
  if (!mouseOffset || "number" != typeof mouseOffset.x || "number" != typeof mouseOffset.y) return 0;
1594
1964
  // Bounded calculation — keeps the glass effect subtle and stable
1595
- const influence = Math.sqrt(mouseOffset.x * mouseOffset.x + mouseOffset.y * mouseOffset.y) / CONSTANTS$1.MOUSE_INFLUENCE_DIVISOR;
1965
+ const influence = Math.sqrt(mouseOffset.x * mouseOffset.x + mouseOffset.y * mouseOffset.y) / CONSTANTS$2.MOUSE_INFLUENCE_DIVISOR;
1596
1966
  return Math.min(.8, influence);
1597
1967
  // Tighter cap to prevent blur/filter blow-out
1598
- }, 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 => {
1968
+ }, clampBlur = value => "number" != typeof value || isNaN(value) ? CONSTANTS$2.MIN_BLUR : Math.max(CONSTANTS$2.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$2.MAX_SIZE && size.height <= CONSTANTS$2.MAX_SIZE, parseBorderRadiusValue = value => {
1599
1969
  if ("number" == typeof value) return Math.max(0, value);
1600
- if ("string" != typeof value || !value.trim()) return CONSTANTS$1.DEFAULT_CORNER_RADIUS;
1970
+ if ("string" != typeof value || !value.trim()) return CONSTANTS$2.DEFAULT_CORNER_RADIUS;
1601
1971
  const trimmedValue = value.trim();
1602
1972
  // Handle px values
1603
1973
  if (trimmedValue.endsWith("px")) {
1604
1974
  const parsed = parseFloat(trimmedValue);
1605
- return isNaN(parsed) ? CONSTANTS$1.DEFAULT_CORNER_RADIUS : Math.max(0, parsed);
1975
+ return isNaN(parsed) ? CONSTANTS$2.DEFAULT_CORNER_RADIUS : Math.max(0, parsed);
1606
1976
  }
1607
1977
  // Handle rem values (assume 16px = 1rem)
1608
1978
  if (trimmedValue.endsWith("rem")) {
1609
1979
  const parsed = parseFloat(trimmedValue);
1610
- return isNaN(parsed) ? CONSTANTS$1.DEFAULT_CORNER_RADIUS : Math.max(0, 16 * parsed);
1980
+ return isNaN(parsed) ? CONSTANTS$2.DEFAULT_CORNER_RADIUS : Math.max(0, 16 * parsed);
1611
1981
  }
1612
1982
  // Handle em values (assume 16px = 1em for simplicity)
1613
1983
  if (trimmedValue.endsWith("em")) {
1614
1984
  const parsed = parseFloat(trimmedValue);
1615
- return isNaN(parsed) ? CONSTANTS$1.DEFAULT_CORNER_RADIUS : Math.max(0, 16 * parsed);
1985
+ return isNaN(parsed) ? CONSTANTS$2.DEFAULT_CORNER_RADIUS : Math.max(0, 16 * parsed);
1616
1986
  }
1617
1987
  // Handle percentage (convert to approximate px value, assuming 200px container)
1618
1988
  if (trimmedValue.endsWith("%")) {
1619
1989
  const parsed = parseFloat(trimmedValue);
1620
- return isNaN(parsed) ? CONSTANTS$1.DEFAULT_CORNER_RADIUS : Math.max(0, parsed / 100 * 200);
1990
+ return isNaN(parsed) ? CONSTANTS$2.DEFAULT_CORNER_RADIUS : Math.max(0, parsed / 100 * 200);
1621
1991
  }
1622
1992
  // Handle unitless numbers
1623
1993
  const numValue = parseFloat(trimmedValue);
1624
- return isNaN(numValue) ? CONSTANTS$1.DEFAULT_CORNER_RADIUS : Math.max(0, numValue);
1994
+ return isNaN(numValue) ? CONSTANTS$2.DEFAULT_CORNER_RADIUS : Math.max(0, numValue);
1625
1995
  }, extractBorderRadiusFromElement = element => {
1626
1996
  if (!element || !element.props) return null;
1627
1997
  // Check inline styles first (highest priority)
@@ -1637,11 +2007,11 @@ const {CONSTANTS: CONSTANTS$1} = ATOMIX_GLASS, calculateDistance = (pos1, pos2)
1637
2007
  // If element has children, recursively check them
1638
2008
  if (element.props.children) {
1639
2009
  const childRadius = extractBorderRadiusFromChildren(element.props.children);
1640
- if (childRadius > 0 && childRadius !== CONSTANTS$1.DEFAULT_CORNER_RADIUS) return childRadius;
2010
+ if (childRadius > 0 && childRadius !== CONSTANTS$2.DEFAULT_CORNER_RADIUS) return childRadius;
1641
2011
  }
1642
2012
  return null;
1643
2013
  }, extractBorderRadiusFromChildren = children => {
1644
- if (!children) return CONSTANTS$1.DEFAULT_CORNER_RADIUS;
2014
+ if (!children) return CONSTANTS$2.DEFAULT_CORNER_RADIUS;
1645
2015
  try {
1646
2016
  const childArray = React.Children.toArray(children);
1647
2017
  for (let i = 0; i < childArray.length; i++) {
@@ -1654,7 +2024,7 @@ const {CONSTANTS: CONSTANTS$1} = ATOMIX_GLASS, calculateDistance = (pos1, pos2)
1654
2024
  } catch (error) {
1655
2025
  // Silently handle errors
1656
2026
  }
1657
- return CONSTANTS$1.DEFAULT_CORNER_RADIUS;
2027
+ return CONSTANTS$2.DEFAULT_CORNER_RADIUS;
1658
2028
  }, getDisplacementMap = (mode, displacementMap, polarDisplacementMap, prominentDisplacementMap, shaderMapUrl) => {
1659
2029
  switch (mode) {
1660
2030
  case "standard":
@@ -1825,10 +2195,10 @@ const sharedShaderCache = new Map, AtomixGlassContainer = forwardRef((({childre
1825
2195
  }, globalMousePosition: globalMousePosition = {
1826
2196
  x: 0,
1827
2197
  y: 0
1828
- }, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onMouseDown: onMouseDown, onMouseUp: onMouseUp, isHovered: isHovered = !1, isActive: isActive = !1, overLight: overLight = !1, overLightConfig: overLightConfig = {}, cornerRadius: cornerRadius = 0, padding: padding = "0 0", glassSize: glassSize = {
2198
+ }, onMouseEnter: onMouseEnter, onMouseLeave: onMouseLeave, onMouseDown: onMouseDown, onMouseUp: onMouseUp, isHovered: isHovered = !1, isActive: isActive = !1, overLight: overLight = !1, overLightConfig: overLightConfig = {}, borderRadius: borderRadius = 0, padding: padding = "0 0", glassSize: glassSize = {
1829
2199
  width: 0,
1830
2200
  height: 0
1831
- }, onClick: onClick, mode: mode = "standard", effectiveDisableEffects: effectiveDisableEffects = !1, effectiveReducedMotion: effectiveReducedMotion = !1, shaderVariant: shaderVariant = "liquidGlass", enableLiquidBlur: enableLiquidBlur = !1, elasticity: elasticity = 0, contentRef: contentRef}, ref) => {
2201
+ }, onClick: onClick, mode: mode = "standard", effectiveWithoutEffects: effectiveWithoutEffects = !1, effectiveReducedMotion: effectiveReducedMotion = !1, shaderVariant: shaderVariant = "liquidGlass", withLiquidBlur: withLiquidBlur = !1, elasticity: elasticity = 0, contentRef: contentRef}, ref) => {
1832
2202
  // Generate a stable, deterministic ID for SSR compatibility
1833
2203
  // Use a module-level counter that's consistent across server and client
1834
2204
  const filterId = useMemo((() => "atomix-glass-filter-" + ++idCounter), []), [shaderMapUrl, setShaderMapUrl] = useState(""), shaderGeneratorRef = useRef(null), shaderUtilsRef = useRef(null), shaderDebounceTimeoutRef = useRef(null);
@@ -1938,7 +2308,7 @@ const sharedShaderCache = new Map, AtomixGlassContainer = forwardRef((({childre
1938
2308
  flowBlur: 1.2 * blurAmount
1939
2309
  };
1940
2310
  // Enhanced validation for liquid blur
1941
- if (!enableLiquidBlur || !rectCache || !mouseOffset || "number" != typeof mouseOffset.x || "number" != typeof mouseOffset.y || isNaN(mouseOffset.x) || isNaN(mouseOffset.y)) return defaultBlur;
2311
+ if (!withLiquidBlur || !rectCache || !mouseOffset || "number" != typeof mouseOffset.x || "number" != typeof mouseOffset.y || isNaN(mouseOffset.x) || isNaN(mouseOffset.y)) return defaultBlur;
1942
2312
  try {
1943
2313
  const mouseInfluence = calculateMouseInfluence(mouseOffset), maxBlur = 2 * blurAmount, baseBlur = Math.min(maxBlur, blurAmount + mouseInfluence * blurAmount * .15), edgeIntensity = .15 * mouseInfluence, edgeBlur = Math.min(maxBlur, baseBlur * (.8 + .4 * edgeIntensity)), centerIntensity = .1 * mouseInfluence, centerBlur = Math.min(maxBlur, baseBlur * (.3 + .3 * centerIntensity)), flowBlur = Math.min(maxBlur, 1.2 * baseBlur);
1944
2314
  // NOTE: hover/active multipliers intentionally omitted here —
@@ -1953,14 +2323,14 @@ const sharedShaderCache = new Map, AtomixGlassContainer = forwardRef((({childre
1953
2323
  return console.warn("AtomixGlassContainer: Error calculating liquid blur", error),
1954
2324
  defaultBlur;
1955
2325
  }
1956
- }), [ enableLiquidBlur, blurAmount, mouseOffset, rectCache ]), backdropStyle = useMemo((() => {
2326
+ }), [ withLiquidBlur, blurAmount, mouseOffset, rectCache ]), backdropStyle = useMemo((() => {
1957
2327
  try {
1958
2328
  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;
1959
2329
  // Validate blur values before using them
1960
- return !enableLiquidBlur || effectiveReducedMotion || effectiveDisableEffects || area > 18e4 ? {
2330
+ return !withLiquidBlur || effectiveReducedMotion || effectiveWithoutEffects || area > 18e4 ? {
1961
2331
  backdropFilter: `blur(${clampBlur(Math.max(validatedBaseBlur, .8 * validatedEdgeBlur, 1.1 * validatedCenterBlur, .9 * validatedFlowBlur))}px) saturate(${Math.min(dynamicSaturation, 200)}%) contrast(${overLightConfig?.contrast || 1.05}) brightness(${overLightConfig?.brightness || 1.05})`
1962
2332
  } : {
1963
- backdropFilter: `blur(${clampBlur(.4 * validatedBaseBlur + .25 * validatedEdgeBlur + .15 * validatedCenterBlur + .2 * validatedFlowBlur)}px) saturate(${Math.min(dynamicSaturation, 200)}%) contrast(${overLightConfig?.contrast || 1.05}) brightness(${overLightConfig?.brightness || 1.05})`
2333
+ backdropFilter: `blur(${clampBlur(.4 * validatedBaseBlur + .25 * validatedEdgeBlur + .15 * validatedCenterBlur + .2 * validatedFlowBlur)}px) saturate(${Math.min(dynamicSaturation, 200)}%) contrast(${overLightConfig?.contrast || 1}) brightness(${overLightConfig?.brightness || 1})`
1964
2334
  };
1965
2335
  // Single-pass fallback: stronger radius to match perceived blur of multi-pass
1966
2336
  } catch (error) {
@@ -1969,7 +2339,7 @@ const sharedShaderCache = new Map, AtomixGlassContainer = forwardRef((({childre
1969
2339
  backdropFilter: `blur(${blurAmount}px) saturate(${saturation}%) contrast(1.05) brightness(1.05)`
1970
2340
  };
1971
2341
  }
1972
- }), [ liquidBlur, saturation, blurAmount, rectCache, effectiveReducedMotion, effectiveDisableEffects, enableLiquidBlur ]), containerVars = useMemo((() => {
2342
+ }), [ liquidBlur, saturation, blurAmount, rectCache, effectiveReducedMotion, effectiveWithoutEffects, withLiquidBlur ]), containerVars = useMemo((() => {
1973
2343
  try {
1974
2344
  // Safe extraction of mouse offset values
1975
2345
  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;
@@ -1977,10 +2347,10 @@ const sharedShaderCache = new Map, AtomixGlassContainer = forwardRef((({childre
1977
2347
  "--atomix-glass-container-width": `${glassSize?.width}`,
1978
2348
  "--atomix-glass-container-height": `${glassSize?.height}`,
1979
2349
  "--atomix-glass-container-padding": padding || "0 0",
1980
- "--atomix-glass-container-radius": `${"number" != typeof cornerRadius || isNaN(cornerRadius) ? 0 : cornerRadius}px`,
2350
+ "--atomix-glass-container-radius": `${"number" != typeof borderRadius || isNaN(borderRadius) ? 0 : borderRadius}px`,
1981
2351
  "--atomix-glass-container-backdrop": backdropStyle?.backdropFilter || "none",
1982
2352
  "--atomix-glass-container-shadow": overLight ? [ `inset 0 1px 0 rgba(255, 255, 255, ${(.4 + .002 * mx) * (overLightConfig?.shadowIntensity || 1)})`, `inset 0 -1px 0 rgba(0, 0, 0, ${(.2 + .001 * Math.abs(my)) * (overLightConfig?.shadowIntensity || 1)})`, `inset 0 0 20px rgba(0, 0, 0, ${(.08 + .001 * Math.abs(mx + my)) * (overLightConfig?.shadowIntensity || 1)})`, `0 2px 12px rgba(0, 0, 0, ${(.12 + .002 * Math.abs(my)) * (overLightConfig?.shadowIntensity || 1)})` ].join(", ") : "0 0 20px rgba(0, 0, 0, 0.15) inset, 0 4px 8px rgba(0, 0, 0, 0.08) inset",
1983
- "--atomix-glass-container-shadow-opacity": effectiveDisableEffects ? 0 : 1,
2353
+ "--atomix-glass-container-shadow-opacity": effectiveWithoutEffects ? 0 : 1,
1984
2354
  // Background and shadow values use design token-aligned RGB values
1985
2355
  "--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",
1986
2356
  "--atomix-glass-container-text-shadow": overLight ? "0px 2px 12px rgba(0, 0, 0, 0)" : "0px 2px 12px rgba(0, 0, 0, 0.4)",
@@ -1998,14 +2368,10 @@ const sharedShaderCache = new Map, AtomixGlassContainer = forwardRef((({childre
1998
2368
  "--atomix-glass-container-text-shadow": "none"
1999
2369
  };
2000
2370
  }
2001
- }), [ glassSize, padding, cornerRadius, backdropStyle, mouseOffset, overLight, effectiveDisableEffects ]), setForceNoTransition = el => {
2002
- el && (el.style.setProperty("transition-duration", "0s", "important"), el.style.setProperty("animation-duration", "0s", "important"),
2003
- el.style.setProperty("transition-delay", "0s", "important"));
2004
- };
2371
+ }), [ glassSize, padding, borderRadius, backdropStyle, mouseOffset, overLight, effectiveWithoutEffects ]);
2005
2372
  return jsx("div", {
2006
2373
  ref: el => {
2007
2374
  // Apply force no-transition
2008
- setForceNoTransition(el),
2009
2375
  // Handle forwarded ref
2010
2376
  "function" == typeof ref ? ref(el) : ref && (ref.current = el);
2011
2377
  },
@@ -2040,7 +2406,10 @@ const sharedShaderCache = new Map, AtomixGlassContainer = forwardRef((({childre
2040
2406
  aberrationIntensity: "number" != typeof aberrationIntensity || isNaN(aberrationIntensity) ? 0 : aberrationIntensity,
2041
2407
  shaderMapUrl: shaderMapUrl
2042
2408
  }), jsx("div", {
2043
- ref: setForceNoTransition,
2409
+ ref: el => {
2410
+ el && (el.style.setProperty("transition-duration", "0s", "important"), el.style.setProperty("animation-duration", "0s", "important"),
2411
+ el.style.setProperty("transition-delay", "0s", "important"));
2412
+ },
2044
2413
  className: ATOMIX_GLASS.FILTER_OVERLAY_CLASS,
2045
2414
  style: {
2046
2415
  filter: `url(#${filterId})`,
@@ -2157,7 +2526,128 @@ class {
2157
2526
  */ getSubscriberCount() {
2158
2527
  return this.listeners.size;
2159
2528
  }
2160
- }, {CONSTANTS: CONSTANTS} = ATOMIX_GLASS, backgroundDetectionCache = new WeakMap, setCachedBackgroundDetection = (parentElement, overLightConfig, result, threshold) => {
2529
+ }, updateAtomixGlassStyles = (wrapperElement, containerElement, params) => {
2530
+ if (!wrapperElement && !containerElement) return;
2531
+ const {mouseOffset: mouseOffset, globalMousePosition: globalMousePosition, glassSize: glassSize, isHovered: isHovered, isActive: isActive, isOverLight: isOverLight, baseOverLightConfig: baseOverLightConfig, effectiveBorderRadius: effectiveBorderRadius, effectiveWithoutEffects: effectiveWithoutEffects, effectiveReducedMotion: effectiveReducedMotion, elasticity: elasticity, directionalScale: directionalScale, onClick: onClick, withLiquidBlur: withLiquidBlur, blurAmount: blurAmount = ATOMIX_GLASS.DEFAULTS.BLUR_AMOUNT, saturation: saturation = ATOMIX_GLASS.DEFAULTS.SATURATION, padding: padding = ATOMIX_GLASS.DEFAULTS.PADDING} = params, mouseInfluence = calculateMouseInfluence(mouseOffset), hoverIntensity = isHovered ? 1.4 : 1, activeIntensity = isActive ? 1.6 : 1, overLightConfig = {
2532
+ opacity: baseOverLightConfig.opacity * hoverIntensity * activeIntensity,
2533
+ contrast: Math.min(1.6, baseOverLightConfig.contrast + .1 * mouseInfluence),
2534
+ brightness: Math.min(1.1, baseOverLightConfig.brightness + .05 * mouseInfluence),
2535
+ shadowIntensity: Math.min(1.2, Math.max(.5, baseOverLightConfig.shadowIntensity + .2 * mouseInfluence)),
2536
+ borderOpacity: Math.min(1, Math.max(.3, baseOverLightConfig.borderOpacity + .1 * mouseInfluence)),
2537
+ saturationBoost: baseOverLightConfig.saturationBoost
2538
+ };
2539
+ // Calculate mouse influence
2540
+ // Calculate elastic translation
2541
+ let elasticTranslation = {
2542
+ x: 0,
2543
+ y: 0
2544
+ };
2545
+ if (!effectiveWithoutEffects && wrapperElement) {
2546
+ const rect = wrapperElement.getBoundingClientRect(), center = calculateElementCenter(rect);
2547
+ // Calculate fade in factor
2548
+ let fadeInFactor = 0;
2549
+ if (globalMousePosition.x && globalMousePosition.y && validateGlassSize(glassSize)) {
2550
+ const 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({
2551
+ x: edgeDistanceX,
2552
+ y: edgeDistanceY
2553
+ }, {
2554
+ x: 0,
2555
+ y: 0
2556
+ });
2557
+ fadeInFactor = edgeDistance > ATOMIX_GLASS.CONSTANTS.ACTIVATION_ZONE ? 0 : 1 - edgeDistance / ATOMIX_GLASS.CONSTANTS.ACTIVATION_ZONE;
2558
+ }
2559
+ elasticTranslation = {
2560
+ x: (globalMousePosition.x - center.x) * elasticity * .1 * fadeInFactor,
2561
+ y: (globalMousePosition.y - center.y) * elasticity * .1 * fadeInFactor
2562
+ };
2563
+ }
2564
+ const transformStyle = effectiveWithoutEffects ? isActive && Boolean(onClick) ? "scale(0.98)" : "scale(1)" : `translate(${elasticTranslation.x}px, ${elasticTranslation.y}px) ${isActive && Boolean(onClick) ? "scale(0.96)" : directionalScale}`;
2565
+ // Update Wrapper Styles (glassVars)
2566
+ if (wrapperElement) {
2567
+ const mx = mouseOffset.x, my = mouseOffset.y, absMx = Math.abs(mx), absMy = Math.abs(my), GRADIENT = ATOMIX_GLASS.CONSTANTS.GRADIENT, 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), 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 ], configBorderOpacity = overLightConfig.borderOpacity, whiteColor = ATOMIX_GLASS.CONSTANTS.PALETTE.WHITE, blackColor = ATOMIX_GLASS.CONSTANTS.PALETTE.BLACK, hoverPositions = {
2568
+ hover1: {
2569
+ x: GRADIENT.CENTER_POSITION + mx / GRADIENT.HOVER_POSITION.DIVISOR_1,
2570
+ y: GRADIENT.CENTER_POSITION + my / GRADIENT.HOVER_POSITION.DIVISOR_1
2571
+ },
2572
+ hover2: {
2573
+ x: GRADIENT.CENTER_POSITION + mx / GRADIENT.HOVER_POSITION.DIVISOR_2,
2574
+ y: GRADIENT.CENTER_POSITION + my / GRADIENT.HOVER_POSITION.DIVISOR_2
2575
+ },
2576
+ hover3: {
2577
+ x: GRADIENT.CENTER_POSITION + mx * GRADIENT.HOVER_POSITION.MULTIPLIER_3,
2578
+ y: GRADIENT.CENTER_POSITION + my * GRADIENT.HOVER_POSITION.MULTIPLIER_3
2579
+ }
2580
+ }, basePosition = {
2581
+ x: GRADIENT.CENTER_POSITION + mx * GRADIENT.BASE_LAYER_MULTIPLIER,
2582
+ y: GRADIENT.CENTER_POSITION + my * GRADIENT.BASE_LAYER_MULTIPLIER
2583
+ }, opacityValues = {
2584
+ hover1: isHovered || isActive ? .5 : 0,
2585
+ hover2: isActive ? .5 : 0,
2586
+ hover3: isHovered ? .4 : isActive ? .8 : 0,
2587
+ base: isOverLight ? overLightConfig.opacity : 0,
2588
+ over: isOverLight ? 1.1 * overLightConfig.opacity : 0
2589
+ }, style = wrapperElement.style;
2590
+ style.setProperty("--atomix-glass-transform", transformStyle || "none"),
2591
+ // Gradients
2592
+ style.setProperty("--atomix-glass-border-gradient-1", `linear-gradient(${borderGradientAngle}deg, rgba(${whiteColor}, 0) 0%, rgba(${whiteColor}, ${(borderOpacities[0] ?? 1) * configBorderOpacity}) ${borderStop1}%, rgba(${whiteColor}, ${(borderOpacities[1] ?? 1) * configBorderOpacity}) ${borderStop2}%, rgba(${whiteColor}, 0) 100%)`),
2593
+ style.setProperty("--atomix-glass-border-gradient-2", `linear-gradient(${borderGradientAngle}deg, rgba(${whiteColor}, 0) 0%, rgba(${whiteColor}, ${(borderOpacities[2] ?? 1) * configBorderOpacity}) ${borderStop1}%, rgba(${whiteColor}, ${(borderOpacities[3] ?? 1) * configBorderOpacity}) ${borderStop2}%, rgba(${whiteColor}, 0) 100%)`),
2594
+ // Hover gradients
2595
+ style.setProperty("--atomix-glass-hover-1-gradient", isOverLight ? `radial-gradient(circle at ${hoverPositions.hover1.x}% ${hoverPositions.hover1.y}%, rgba(${blackColor}, ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_1.BLACK_START}) 0%, rgba(${blackColor}, ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_1.BLACK_MID}) ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_1.BLACK_STOP}%, rgba(${blackColor}, 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}%)`),
2596
+ style.setProperty("--atomix-glass-hover-2-gradient", isOverLight ? `radial-gradient(circle at ${hoverPositions.hover2.x}% ${hoverPositions.hover2.y}%, rgba(${blackColor}, ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_2.BLACK_START}) 0%, rgba(${blackColor}, ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_2.BLACK_MID}) ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_2.BLACK_STOP}%, rgba(${blackColor}, 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}%)`),
2597
+ style.setProperty("--atomix-glass-hover-3-gradient", isOverLight ? `radial-gradient(circle at ${hoverPositions.hover3.x}% ${hoverPositions.hover3.y}%, rgba(${blackColor}, ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_3.BLACK_START}) 0%, rgba(${blackColor}, ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_3.BLACK_MID}) ${ATOMIX_GLASS.CONSTANTS.GRADIENT_OPACITY.HOVER_3.BLACK_STOP}%, rgba(${blackColor}, 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}%)`),
2598
+ style.setProperty("--atomix-glass-base-gradient", isOverLight ? `linear-gradient(${ATOMIX_GLASS.CONSTANTS.BASE_GRADIENT.ANGLE}deg, rgba(${blackColor}, ${ATOMIX_GLASS.CONSTANTS.BASE_GRADIENT.BLACK_START_BASE + mx * ATOMIX_GLASS.CONSTANTS.BASE_GRADIENT.BLACK_START_MULTIPLIER}) 0%, rgba(${blackColor}, ${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(${blackColor}, ${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})`),
2599
+ style.setProperty("--atomix-glass-overlay-gradient", isOverLight ? `radial-gradient(circle at ${basePosition.x}% ${basePosition.y}%, rgba(${blackColor}, ${ATOMIX_GLASS.CONSTANTS.OVERLAY_GRADIENT.BLACK_START_BASE + absMx * ATOMIX_GLASS.CONSTANTS.OVERLAY_GRADIENT.BLACK_START_MULTIPLIER}) 0%, rgba(${blackColor}, ${ATOMIX_GLASS.CONSTANTS.OVERLAY_GRADIENT.BLACK_MID}) ${ATOMIX_GLASS.CONSTANTS.OVERLAY_GRADIENT.BLACK_MID_STOP}%, rgba(${blackColor}, ${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})`),
2600
+ // Opacities
2601
+ style.setProperty("--atomix-glass-hover-1-opacity", opacityValues.hover1.toString()),
2602
+ style.setProperty("--atomix-glass-hover-2-opacity", opacityValues.hover2.toString()),
2603
+ style.setProperty("--atomix-glass-hover-3-opacity", opacityValues.hover3.toString()),
2604
+ style.setProperty("--atomix-glass-base-opacity", opacityValues.base.toString()),
2605
+ style.setProperty("--atomix-glass-overlay-opacity", opacityValues.over.toString()),
2606
+ style.setProperty("--atomix-glass-overlay-highlight-opacity", (opacityValues.over * ATOMIX_GLASS.CONSTANTS.OVERLAY_HIGHLIGHT.OPACITY_MULTIPLIER).toString()),
2607
+ // Other
2608
+ style.setProperty("--atomix-glass-blend-mode", isOverLight ? "multiply" : "overlay"),
2609
+ style.setProperty("--atomix-glass-radius", `${effectiveBorderRadius}px`);
2610
+ }
2611
+ // Update Container Styles (containerVars)
2612
+ if (containerElement) {
2613
+ const mx = mouseOffset.x, my = mouseOffset.y, EDGE_BLUR_MULTIPLIER = 1.25, CENTER_BLUR_MULTIPLIER = 1.1, FLOW_BLUR_MULTIPLIER = 1.2, MOUSE_INFLUENCE_BLUR_FACTOR = .15, EDGE_INTENSITY_MOUSE_FACTOR = .15, CENTER_INTENSITY_MOUSE_FACTOR = .1, MAX_BLUR_RELATIVE = 2, rect = containerElement.getBoundingClientRect();
2614
+ let liquidBlur = {
2615
+ baseBlur: blurAmount,
2616
+ edgeBlur: blurAmount * EDGE_BLUR_MULTIPLIER,
2617
+ centerBlur: blurAmount * CENTER_BLUR_MULTIPLIER,
2618
+ flowBlur: blurAmount * FLOW_BLUR_MULTIPLIER
2619
+ };
2620
+ if (withLiquidBlur && rect) {
2621
+ const mouseInfluence = calculateMouseInfluence(mouseOffset), maxBlur = blurAmount * MAX_BLUR_RELATIVE, baseBlur = Math.min(maxBlur, blurAmount + mouseInfluence * blurAmount * MOUSE_INFLUENCE_BLUR_FACTOR), edgeIntensity = mouseInfluence * EDGE_INTENSITY_MOUSE_FACTOR, edgeBlur = Math.min(maxBlur, baseBlur * (.8 + .4 * edgeIntensity)), centerIntensity = mouseInfluence * CENTER_INTENSITY_MOUSE_FACTOR, centerBlur = Math.min(maxBlur, baseBlur * (.3 + .3 * centerIntensity)), flowBlur = Math.min(maxBlur, baseBlur * FLOW_BLUR_MULTIPLIER);
2622
+ liquidBlur = {
2623
+ baseBlur: clampBlur(baseBlur),
2624
+ edgeBlur: clampBlur(edgeBlur),
2625
+ centerBlur: clampBlur(centerBlur),
2626
+ flowBlur: clampBlur(flowBlur)
2627
+ };
2628
+ }
2629
+ // Backdrop filter
2630
+ let backdropFilterString = `blur(${blurAmount}px) saturate(${saturation}%) contrast(1.05) brightness(1.05)`;
2631
+ const dynamicSaturation = saturation + 20 * (liquidBlur.baseBlur || 0), area = rect ? rect.width * rect.height : 0;
2632
+ backdropFilterString = !withLiquidBlur || effectiveReducedMotion || effectiveWithoutEffects || area > 18e4 ? `blur(${clampBlur(Math.max(liquidBlur.baseBlur, .8 * liquidBlur.edgeBlur, 1.1 * liquidBlur.centerBlur, .9 * liquidBlur.flowBlur))}px) saturate(${Math.min(dynamicSaturation, 200)}%) contrast(${overLightConfig.contrast}) brightness(${overLightConfig.brightness})` : `blur(${clampBlur(.4 * liquidBlur.baseBlur + .25 * liquidBlur.edgeBlur + .15 * liquidBlur.centerBlur + .2 * liquidBlur.flowBlur)}px) saturate(${Math.min(dynamicSaturation, 200)}%) contrast(${overLightConfig.contrast}) brightness(${overLightConfig.brightness})`;
2633
+ // Container variables
2634
+ const style = containerElement.style;
2635
+ style.setProperty("--atomix-glass-container-width", `${glassSize.width}`), style.setProperty("--atomix-glass-container-height", `${glassSize.height}`),
2636
+ style.setProperty("--atomix-glass-container-padding", padding), style.setProperty("--atomix-glass-container-radius", `${effectiveBorderRadius}px`),
2637
+ style.setProperty("--atomix-glass-container-backdrop", backdropFilterString),
2638
+ // Shadows
2639
+ style.setProperty("--atomix-glass-container-shadow", isOverLight ? [ `inset 0 1px 0 rgba(255, 255, 255, ${(.4 + .002 * mx) * (overLightConfig.shadowIntensity || 1)})`, `inset 0 -1px 0 rgba(0, 0, 0, ${(.2 + .001 * Math.abs(my)) * (overLightConfig.shadowIntensity || 1)})`, `inset 0 0 20px rgba(0, 0, 0, ${(.08 + .001 * Math.abs(mx + my)) * (overLightConfig.shadowIntensity || 1)})`, `0 2px 12px rgba(0, 0, 0, ${(.12 + .002 * Math.abs(my)) * (overLightConfig.shadowIntensity || 1)})` ].join(", ") : "0 0 20px rgba(0, 0, 0, 0.15) inset, 0 4px 8px rgba(0, 0, 0, 0.08) inset"),
2640
+ style.setProperty("--atomix-glass-container-shadow-opacity", effectiveWithoutEffects ? "0" : "1"),
2641
+ style.setProperty("--atomix-glass-container-bg", isOverLight ? `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"),
2642
+ style.setProperty("--atomix-glass-container-text-shadow", isOverLight ? "0px 2px 12px rgba(0, 0, 0, 0)" : "0px 2px 12px rgba(0, 0, 0, 0.4)"),
2643
+ style.setProperty("--atomix-glass-container-box-shadow", isOverLight ? "0px 16px 70px rgba(0, 0, 0, 0.75)" : "0px 12px 40px rgba(0, 0, 0, 0.25)");
2644
+ }
2645
+ }, {CONSTANTS: CONSTANTS$1} = ATOMIX_GLASS;
2646
+
2647
+ /**
2648
+ * Updates the styles of the AtomixGlass wrapper and container elements imperatively
2649
+ * to avoid React re-renders on mouse movement.
2650
+ */ const {CONSTANTS: CONSTANTS} = ATOMIX_GLASS, backgroundDetectionCache = new WeakMap, setCachedBackgroundDetection = (parentElement, overLightConfig, result, threshold) => {
2161
2651
  parentElement && backgroundDetectionCache.set(parentElement, {
2162
2652
  result: result,
2163
2653
  timestamp: Date.now(),
@@ -2170,18 +2660,74 @@ class {
2170
2660
  * Composable hook for AtomixGlass component logic
2171
2661
  * Manages all state, calculations, and event handlers
2172
2662
  */
2173
- 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}) {
2663
+ function useAtomixGlass({glassRef: glassRef, contentRef: contentRef, wrapperRef: wrapperRef, borderRadius: borderRadius, globalMousePosition: externalGlobalMousePosition, mouseOffset: externalMouseOffset, mouseContainer: mouseContainer, overLight: overLight = ATOMIX_GLASS.DEFAULTS.OVER_LIGHT, reducedMotion: reducedMotion = !1, highContrast: highContrast = !1, withoutEffects: withoutEffects = !1, elasticity: elasticity = .05, onClick: onClick, debugBorderRadius: debugBorderRadius = !1, debugOverLight: debugOverLight = !1, debugPerformance: debugPerformance = !1, children: children, blurAmount: blurAmount, saturation: saturation, padding: padding, withLiquidBlur: withLiquidBlur}) {
2174
2664
  // State
2175
- const [isHovered, setIsHovered] = useState(!1), [isActive, setIsActive] = useState(!1), [glassSize, setGlassSize] = useState({
2176
- width: 270,
2177
- height: 69
2178
- }), [internalGlobalMousePosition, setInternalGlobalMousePosition] = useState({
2665
+ const [isHovered, setIsHovered] = useState(!1), [isActive, setIsActive] = useState(!1), cachedRectRef = useRef(null), internalGlobalMousePositionRef = useRef({
2179
2666
  x: 0,
2180
2667
  y: 0
2181
- }), [internalMouseOffset, setInternalMouseOffset] = useState({
2668
+ }), internalMouseOffsetRef = useRef({
2182
2669
  x: 0,
2183
2670
  y: 0
2184
- }), [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 ]), 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 ]);
2671
+ }), [dynamicBorderRadius, setDynamicCornerRadius] = useState(CONSTANTS.DEFAULT_CORNER_RADIUS), [userPrefersReducedMotion, setUserPrefersReducedMotion] = useState(!1), [userPrefersHighContrast, setUserPrefersHighContrast] = useState(!1), [detectedOverLight, setDetectedOverLight] = useState(!1), effectiveBorderRadius = useMemo((() => void 0 !== borderRadius ? Math.max(0, borderRadius) : Math.max(0, dynamicBorderRadius)), [ borderRadius, dynamicBorderRadius ]), {glassSize: glassSize} = function({glassRef: glassRef, effectiveBorderRadius: effectiveBorderRadius, cachedRectRef: cachedRectRef}) {
2672
+ const [glassSize, setGlassSize] = useState({
2673
+ width: 270,
2674
+ height: 69
2675
+ });
2676
+ return useEffect((() => {
2677
+ const isValidElement = element => null !== element && element instanceof HTMLElement && element.isConnected;
2678
+ let rafId = null, lastSize = {
2679
+ width: 0,
2680
+ height: 0
2681
+ }, lastCornerRadius = effectiveBorderRadius;
2682
+ const updateGlassSize = (forceUpdate = !1) => {
2683
+ null !== rafId && cancelAnimationFrame(rafId), rafId = requestAnimationFrame((() => {
2684
+ if (!isValidElement(glassRef.current)) return void (rafId = null);
2685
+ const rect = glassRef.current.getBoundingClientRect();
2686
+ if (rect.width <= 0 || rect.height <= 0) return void (rafId = null);
2687
+ // Measure actual rendered size without artificial offsets to avoid feedback loops
2688
+ const newSize = {
2689
+ width: Math.round(rect.width),
2690
+ height: Math.round(rect.height)
2691
+ }, cornerRadiusChanged = lastCornerRadius !== effectiveBorderRadius, dimensionsChanged = Math.abs(newSize.width - lastSize.width) > 1 || Math.abs(newSize.height - lastSize.height) > 1;
2692
+ var size;
2693
+ (forceUpdate || cornerRadiusChanged || dimensionsChanged) && validateGlassSize(size = newSize) && size.width <= CONSTANTS$1.MAX_SIZE && size.height <= CONSTANTS$1.MAX_SIZE && (lastSize = newSize,
2694
+ lastCornerRadius = effectiveBorderRadius, setGlassSize(newSize)), rafId = null;
2695
+ }));
2696
+ };
2697
+ let resizeTimeoutId = null;
2698
+ const debouncedResizeHandler = () => {
2699
+ resizeTimeoutId && clearTimeout(resizeTimeoutId), resizeTimeoutId = setTimeout((() => updateGlassSize(!1)), 16);
2700
+ }, initialTimeoutId = setTimeout((() => updateGlassSize(!0)), 0);
2701
+ let resizeObserver = null, resizeDebounceTimeout = null;
2702
+ // ResizeObserver has 98%+ browser support, no need for fallback
2703
+ if ("undefined" != typeof ResizeObserver && isValidElement(glassRef.current)) try {
2704
+ resizeObserver = new ResizeObserver((entries => {
2705
+ for (const entry of entries) if (entry.target === glassRef.current) {
2706
+ // Update cached rect when size changes
2707
+ glassRef.current && cachedRectRef && (cachedRectRef.current = glassRef.current.getBoundingClientRect()),
2708
+ // Debounce resize updates to match RAF timing (16ms)
2709
+ resizeDebounceTimeout && clearTimeout(resizeDebounceTimeout), resizeDebounceTimeout = setTimeout((() => updateGlassSize(!1)), 16);
2710
+ break;
2711
+ }
2712
+ })), resizeObserver.observe(glassRef.current);
2713
+ } catch (error) {
2714
+ console.warn("AtomixGlass: ResizeObserver not available, using window resize only", error);
2715
+ }
2716
+ return window.addEventListener("resize", debouncedResizeHandler, {
2717
+ passive: !0
2718
+ }), () => {
2719
+ clearTimeout(initialTimeoutId), null !== rafId && cancelAnimationFrame(rafId), resizeTimeoutId && clearTimeout(resizeTimeoutId),
2720
+ resizeDebounceTimeout && clearTimeout(resizeDebounceTimeout), window.removeEventListener("resize", debouncedResizeHandler),
2721
+ resizeObserver?.disconnect();
2722
+ };
2723
+ }), [ effectiveBorderRadius, glassRef, cachedRectRef ]), {
2724
+ glassSize: glassSize
2725
+ };
2726
+ }({
2727
+ glassRef: glassRef,
2728
+ effectiveBorderRadius: effectiveBorderRadius,
2729
+ cachedRectRef: cachedRectRef
2730
+ }), effectiveReducedMotion = useMemo((() => reducedMotion || userPrefersReducedMotion), [ reducedMotion, userPrefersReducedMotion ]), effectiveHighContrast = useMemo((() => highContrast || userPrefersHighContrast), [ highContrast, userPrefersHighContrast ]), effectiveWithoutEffects = useMemo((() => withoutEffects || effectiveReducedMotion), [ withoutEffects, effectiveReducedMotion ]), globalMousePosition = externalGlobalMousePosition || internalGlobalMousePositionRef.current, mouseOffset = externalMouseOffset || internalMouseOffsetRef.current;
2185
2731
  // Extract border-radius from children
2186
2732
  useEffect((() => {
2187
2733
  const extractRadius = () => {
@@ -2212,13 +2758,13 @@ function useAtomixGlass({glassRef: glassRef, contentRef: contentRef, cornerRadiu
2212
2758
  }
2213
2759
  null !== extractedRadius && extractedRadius > 0 && setDynamicCornerRadius(extractedRadius);
2214
2760
  } catch (error) {
2215
- "undefined" != typeof process && "production" === process.env?.NODE_ENV || !debugCornerRadius || console.error("[AtomixGlass] Error extracting corner radius:", error);
2761
+ "undefined" != typeof process && "production" === process.env?.NODE_ENV || !debugBorderRadius || console.error("[AtomixGlass] Error extracting corner radius:", error);
2216
2762
  }
2217
2763
  };
2218
2764
  extractRadius();
2219
2765
  const timeoutId = setTimeout(extractRadius, 100);
2220
2766
  return () => clearTimeout(timeoutId);
2221
- }), [ children, debugCornerRadius, contentRef ]),
2767
+ }), [ children, debugBorderRadius, contentRef ]),
2222
2768
  // Media query handlers and background detection
2223
2769
  useEffect((() => {
2224
2770
  if (("auto" === overLight || "object" == typeof overLight && null !== overLight) && glassRef.current) {
@@ -2274,72 +2820,52 @@ function useAtomixGlass({glassRef: glassRef, contentRef: contentRef, cornerRadiu
2274
2820
  const rgb = bgColor.match(/\d+/g);
2275
2821
  if (rgb && rgb.length >= 3) {
2276
2822
  const r = Number(rgb[0]), g = Number(rgb[1]), b = Number(rgb[2]);
2277
- // Validate RGB values are valid numbers
2278
- 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)) {
2823
+ if (!isNaN(r) && !isNaN(g) && !isNaN(b) && (r > 10 || g > 10 || b > 10)) {
2279
2824
  const luminance = (.299 * r + .587 * g + .114 * b) / 255;
2280
2825
  !isNaN(luminance) && isFinite(luminance) && (totalLuminance += luminance, validSamples++,
2281
2826
  hasValidBackground = !0);
2282
2827
  }
2283
2828
  }
2284
2829
  }
2285
- // Check for image backgrounds
2286
- bgImage && "none" !== bgImage && "initial" !== bgImage && (
2287
- // For image backgrounds, assume medium luminance
2288
- totalLuminance += .5, validSamples++, hasValidBackground = !0);
2830
+ bgImage && "none" !== bgImage && "initial" !== bgImage && (totalLuminance += .5,
2831
+ validSamples++, hasValidBackground = !0);
2289
2832
  } catch (styleError) {
2290
- "undefined" == typeof process || process.env;
2833
+ // Silently continue
2291
2834
  }
2292
- // Move to parent element for next iteration
2293
- if (!currentElement) break;
2294
- // Exit loop if currentElement becomes null
2295
- currentElement = currentElement.parentElement, depth++;
2835
+ if (!currentElement) break;
2836
+ currentElement = currentElement.parentElement, depth++;
2296
2837
  }
2297
- // More conservative detection with better error handling
2298
- if (hasValidBackground && validSamples > 0) {
2838
+ if (hasValidBackground && validSamples > 0) {
2299
2839
  const avgLuminance = totalLuminance / validSamples;
2300
2840
  if (!isNaN(avgLuminance) && isFinite(avgLuminance)) {
2301
2841
  let threshold = .7;
2302
- // Conservative threshold for overlight
2303
- // If overLight is an object, use its threshold property with validation
2304
- if ("object" == typeof overLight && null !== overLight) {
2842
+ if ("object" == typeof overLight && null !== overLight) {
2305
2843
  const objConfig = overLight;
2306
2844
  if (void 0 !== objConfig.threshold) {
2307
- const configThreshold = "number" == typeof objConfig.threshold && !isNaN(objConfig.threshold) && isFinite(objConfig.threshold) ? objConfig.threshold : .7;
2845
+ const configThreshold = "number" != typeof objConfig.threshold || isNaN(objConfig.threshold) ? .7 : objConfig.threshold;
2308
2846
  threshold = Math.min(.9, Math.max(.1, configThreshold));
2309
2847
  }
2310
2848
  }
2311
2849
  const isOverLightDetected = avgLuminance > threshold;
2312
- // Cache the result in shared cache
2313
- setCachedBackgroundDetection(element.parentElement, overLight, isOverLightDetected, threshold),
2850
+ setCachedBackgroundDetection(element.parentElement, overLight, isOverLightDetected, threshold),
2314
2851
  setDetectedOverLight(isOverLightDetected);
2315
2852
  } else {
2316
- // Invalid luminance calculation, default to false
2317
2853
  const result = !1, threshold = "object" == typeof overLight && null !== overLight && overLight.threshold || .7;
2318
2854
  setCachedBackgroundDetection(element.parentElement, overLight, result, threshold),
2319
2855
  setDetectedOverLight(result);
2320
2856
  }
2321
2857
  } else {
2322
- // Default to false if no valid background found
2323
2858
  const result = !1, threshold = "object" == typeof overLight && null !== overLight && overLight.threshold || .7;
2324
2859
  setCachedBackgroundDetection(element.parentElement, overLight, result, threshold),
2325
2860
  setDetectedOverLight(result);
2326
2861
  }
2327
2862
  } catch (error) {
2328
- // Enhanced error logging with context
2329
- "undefined" != typeof process && "development" !== process.env?.NODE_ENV || console.warn("AtomixGlass: Error detecting background brightness:", error);
2330
- const result = !1;
2331
- if (element && element.parentElement) {
2332
- const threshold = "object" == typeof overLight && null !== overLight && overLight.threshold || .7;
2333
- setCachedBackgroundDetection(element.parentElement, overLight, result, threshold);
2334
- }
2335
- setDetectedOverLight(result);
2863
+ setDetectedOverLight(!1);
2336
2864
  }
2337
2865
  }), 150);
2338
2866
  return () => clearTimeout(timeoutId);
2339
2867
  }
2340
- if ("boolean" == typeof overLight &&
2341
- // For boolean values, disable auto-detection
2342
- setDetectedOverLight(!1), "function" == typeof window.matchMedia) try {
2868
+ if ("boolean" == typeof overLight && setDetectedOverLight(!1), "function" == typeof window.matchMedia) try {
2343
2869
  const mediaQueryReducedMotion = window.matchMedia("(prefers-reduced-motion: reduce)"), mediaQueryHighContrast = window.matchMedia("(prefers-contrast: high)");
2344
2870
  setUserPrefersReducedMotion(mediaQueryReducedMotion.matches), setUserPrefersHighContrast(mediaQueryHighContrast.matches);
2345
2871
  const handleReducedMotionChange = e => {
@@ -2350,65 +2876,54 @@ function useAtomixGlass({glassRef: glassRef, contentRef: contentRef, cornerRadiu
2350
2876
  return mediaQueryReducedMotion.addEventListener ? (mediaQueryReducedMotion.addEventListener("change", handleReducedMotionChange),
2351
2877
  mediaQueryHighContrast.addEventListener("change", handleHighContrastChange)) : mediaQueryReducedMotion.addListener && (mediaQueryReducedMotion.addListener(handleReducedMotionChange),
2352
2878
  mediaQueryHighContrast.addListener(handleHighContrastChange)), () => {
2353
- try {
2354
- mediaQueryReducedMotion.removeEventListener ? (mediaQueryReducedMotion.removeEventListener("change", handleReducedMotionChange),
2355
- mediaQueryHighContrast.removeEventListener("change", handleHighContrastChange)) : mediaQueryReducedMotion.removeListener && (mediaQueryReducedMotion.removeListener(handleReducedMotionChange),
2356
- mediaQueryHighContrast.removeListener(handleHighContrastChange));
2357
- } catch (cleanupError) {
2358
- console.error("AtomixGlass: Error cleaning up media query listeners:", cleanupError);
2359
- }
2879
+ // ignore
2360
2880
  };
2361
2881
  } catch (error) {
2362
- return void console.error("AtomixGlass: Error setting up media queries:", error);
2882
+ return;
2363
2883
  }
2364
2884
  }), [ overLight, glassRef, debugOverLight ]);
2365
- // Mouse tracking using shared global tracker
2366
- // Cache bounding rect to avoid repeated getBoundingClientRect calls
2367
- const cachedRectRef = useRef(null), updateRectRef = useRef(null), handleGlobalMousePosition = useCallback((globalPos => {
2368
- if (externalGlobalMousePosition && externalMouseOffset)
2369
- // External mouse position provided, skip internal tracking
2370
- return;
2371
- if (effectiveDisableEffects) return;
2372
- const container = mouseContainer?.current || glassRef.current;
2373
- if (!container) return;
2374
- enablePerformanceMonitoring && performance.now();
2375
- // Use cached rect if available, otherwise get new one
2376
- let rect = cachedRectRef.current;
2377
- if (rect && 0 !== rect.width && 0 !== rect.height || (rect = container.getBoundingClientRect(),
2378
- cachedRectRef.current = rect), 0 === rect.width || 0 === rect.height) return;
2379
- const center = calculateElementCenter(rect), newOffset = {
2380
- x: (globalPos.x - center.x) / rect.width * 100,
2381
- y: (globalPos.y - center.y) / rect.height * 100
2885
+ /**
2886
+ * Get effective overLight value based on configuration
2887
+ */
2888
+ 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))), []), baseOverLightConfig = useMemo((() => {
2889
+ const isOverLight = getEffectiveOverLight(), baseConfig = {
2890
+ isOverLight: isOverLight,
2891
+ threshold: .7,
2892
+ opacity: isOverLight ? Math.min(.6, Math.max(.2, .5)) : 0,
2893
+ contrast: 1,
2894
+ // Base contrast
2895
+ brightness: 1,
2896
+ // Base brightness
2897
+ saturationBoost: 1.3,
2898
+ shadowIntensity: .9,
2899
+ borderOpacity: .7
2382
2900
  };
2383
- // Calculate offset relative to this container
2384
- // React 18 automatically batches these updates
2385
- setInternalMouseOffset(newOffset), setInternalGlobalMousePosition(globalPos), "undefined" != typeof process && "production" === process.env?.NODE_ENV || !enablePerformanceMonitoring || performance.now();
2386
- }), [ mouseContainer, glassRef, externalGlobalMousePosition, externalMouseOffset, effectiveDisableEffects, enablePerformanceMonitoring ]);
2387
- // Subscribe to shared mouse tracker
2388
- useEffect((() => {
2389
- if (externalGlobalMousePosition && externalMouseOffset)
2390
- // External mouse position provided, don't subscribe
2391
- return;
2392
- if (effectiveDisableEffects)
2393
- // Effects disabled, don't subscribe
2394
- return;
2395
- // Subscribe to shared tracker
2396
- const unsubscribe = globalMouseTracker.subscribe(handleGlobalMousePosition), container = mouseContainer?.current || glassRef.current;
2397
- // Update cached rect when container size changes
2398
- let resizeObserver = null;
2399
- return container && "undefined" != typeof ResizeObserver && (resizeObserver = new ResizeObserver((() => {
2400
- null !== updateRectRef.current && cancelAnimationFrame(updateRectRef.current), updateRectRef.current = requestAnimationFrame((() => {
2401
- const container = mouseContainer?.current || glassRef.current;
2402
- container && (cachedRectRef.current = container.getBoundingClientRect()), updateRectRef.current = null;
2403
- }));
2404
- })), resizeObserver.observe(container)), () => {
2405
- unsubscribe(), null !== updateRectRef.current && (cancelAnimationFrame(updateRectRef.current),
2406
- updateRectRef.current = null), resizeObserver && resizeObserver.disconnect();
2901
+ if ("object" == typeof overLight && null !== overLight) {
2902
+ 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);
2903
+ return {
2904
+ ...baseConfig,
2905
+ threshold: validatedThreshold,
2906
+ opacity: validatedOpacity,
2907
+ contrast: validatedContrast,
2908
+ brightness: validatedBrightness,
2909
+ saturationBoost: validatedSaturationBoost
2910
+ };
2911
+ }
2912
+ return baseConfig;
2913
+ }), [ overLight, getEffectiveOverLight, validateConfigValue ]), overLightConfig = useMemo((() => {
2914
+ const mouseInfluence = calculateMouseInfluence(mouseOffset), hoverIntensity = isHovered ? 1.4 : 1, activeIntensity = isActive ? 1.6 : 1;
2915
+ return {
2916
+ isOverLight: baseOverLightConfig.isOverLight,
2917
+ threshold: baseOverLightConfig.threshold,
2918
+ opacity: baseOverLightConfig.opacity * hoverIntensity * activeIntensity,
2919
+ contrast: Math.min(1.6, baseOverLightConfig.contrast + .1 * mouseInfluence),
2920
+ brightness: Math.min(1.1, baseOverLightConfig.brightness + .05 * mouseInfluence),
2921
+ saturationBoost: baseOverLightConfig.saturationBoost,
2922
+ shadowIntensity: Math.min(1.2, Math.max(.5, baseOverLightConfig.shadowIntensity + .2 * mouseInfluence)),
2923
+ borderOpacity: Math.min(1, Math.max(.3, baseOverLightConfig.borderOpacity + .1 * mouseInfluence))
2407
2924
  };
2408
- }), [ handleGlobalMousePosition, mouseContainer, glassRef, externalGlobalMousePosition, externalMouseOffset, effectiveDisableEffects ]);
2409
- // Transform calculations
2410
- const calculateDirectionalScale = useCallback((() => {
2411
- if (!0 === overLight || "auto" === overLight && detectedOverLight || "object" == typeof overLight && null !== overLight && detectedOverLight) return "scale(1)";
2925
+ }), [ baseOverLightConfig, mouseOffset, isHovered, isActive ]), updateRectRef = useRef(null), calculateDirectionalScale = useCallback((() => {
2926
+ if (baseOverLightConfig.isOverLight) return "scale(1)";
2412
2927
  if (!(globalMousePosition.x && globalMousePosition.y && glassRef.current && validateGlassSize(glassSize))) return "scale(1)";
2413
2928
  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({
2414
2929
  x: edgeDistanceX,
@@ -2422,7 +2937,7 @@ function useAtomixGlass({glassRef: glassRef, contentRef: contentRef, cornerRadiu
2422
2937
  if (0 === centerDistance) return "scale(1)";
2423
2938
  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;
2424
2939
  return `scaleX(${Math.max(.8, scaleX)}) scaleY(${Math.max(.8, scaleY)})`;
2425
- }), [ globalMousePosition, elasticity, glassSize, glassRef, overLight, detectedOverLight ]), calculateFadeInFactor = useCallback((() => {
2940
+ }), [ globalMousePosition, elasticity, glassSize, glassRef, baseOverLightConfig ]), calculateFadeInFactor = useCallback((() => {
2426
2941
  if (!(globalMousePosition.x && globalMousePosition.y && glassRef.current && validateGlassSize(glassSize))) return 0;
2427
2942
  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({
2428
2943
  x: edgeDistanceX,
@@ -2442,122 +2957,110 @@ function useAtomixGlass({glassRef: glassRef, contentRef: contentRef, cornerRadiu
2442
2957
  x: (globalMousePosition.x - center.x) * elasticity * .1 * fadeInFactor,
2443
2958
  y: (globalMousePosition.y - center.y) * elasticity * .1 * fadeInFactor
2444
2959
  };
2445
- }), [ globalMousePosition, elasticity, calculateFadeInFactor, glassRef ]), elasticTranslation = useMemo((() => effectiveDisableEffects ? {
2960
+ }), [ globalMousePosition, elasticity, calculateFadeInFactor, glassRef ]), elasticTranslation = useMemo((() => effectiveWithoutEffects ? {
2446
2961
  x: 0,
2447
2962
  y: 0
2448
- } : 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 ]);
2449
- // Size management
2450
- useEffect((() => {
2451
- const isValidElement = element => null !== element && element instanceof HTMLElement && element.isConnected;
2452
- let rafId = null, lastSize = {
2453
- width: 0,
2454
- height: 0
2455
- }, lastCornerRadius = effectiveCornerRadius;
2456
- const updateGlassSize = (forceUpdate = !1) => {
2457
- null !== rafId && cancelAnimationFrame(rafId), rafId = requestAnimationFrame((() => {
2458
- if (!isValidElement(glassRef.current)) return void (rafId = null);
2459
- const rect = glassRef.current.getBoundingClientRect();
2460
- if (rect.width <= 0 || rect.height <= 0) return void (rafId = null);
2461
- // Measure actual rendered size without artificial offsets to avoid feedback loops
2462
- const newSize = {
2463
- width: Math.round(rect.width),
2464
- height: Math.round(rect.height)
2465
- }, cornerRadiusChanged = lastCornerRadius !== effectiveCornerRadius, dimensionsChanged = Math.abs(newSize.width - lastSize.width) > 1 || Math.abs(newSize.height - lastSize.height) > 1;
2466
- var size;
2467
- (forceUpdate || cornerRadiusChanged || dimensionsChanged) && validateGlassSize(size = newSize) && size.width <= CONSTANTS.MAX_SIZE && size.height <= CONSTANTS.MAX_SIZE && (lastSize = newSize,
2468
- lastCornerRadius = effectiveCornerRadius, setGlassSize(newSize)), rafId = null;
2469
- }));
2470
- };
2471
- let resizeTimeoutId = null;
2472
- const debouncedResizeHandler = () => {
2473
- resizeTimeoutId && clearTimeout(resizeTimeoutId), resizeTimeoutId = setTimeout((() => updateGlassSize(!1)), 16);
2474
- }, initialTimeoutId = setTimeout((() => updateGlassSize(!0)), 0);
2475
- let resizeObserver = null, resizeDebounceTimeout = null;
2476
- // ResizeObserver has 98%+ browser support, no need for fallback
2477
- if ("undefined" != typeof ResizeObserver && isValidElement(glassRef.current)) try {
2478
- resizeObserver = new ResizeObserver((entries => {
2479
- for (const entry of entries) if (entry.target === glassRef.current) {
2480
- // Update cached rect when size changes
2481
- glassRef.current && (cachedRectRef.current = glassRef.current.getBoundingClientRect()),
2482
- // Debounce resize updates to match RAF timing (16ms)
2483
- resizeDebounceTimeout && clearTimeout(resizeDebounceTimeout), resizeDebounceTimeout = setTimeout((() => updateGlassSize(!1)), 16);
2484
- break;
2485
- }
2486
- })), resizeObserver.observe(glassRef.current);
2487
- } catch (error) {
2488
- console.warn("AtomixGlass: ResizeObserver not available, using window resize only", error);
2489
- }
2490
- return window.addEventListener("resize", debouncedResizeHandler, {
2491
- passive: !0
2492
- }), () => {
2493
- clearTimeout(initialTimeoutId), null !== rafId && cancelAnimationFrame(rafId), resizeTimeoutId && clearTimeout(resizeTimeoutId),
2494
- resizeDebounceTimeout && clearTimeout(resizeDebounceTimeout), window.removeEventListener("resize", debouncedResizeHandler),
2495
- resizeObserver?.disconnect();
2963
+ } : calculateElasticTranslation()), [ calculateElasticTranslation, effectiveWithoutEffects ]), directionalScale = useMemo((() => effectiveWithoutEffects ? "scale(1)" : calculateDirectionalScale()), [ calculateDirectionalScale, effectiveWithoutEffects ]), transformStyle = useMemo((() => effectiveWithoutEffects ? 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, effectiveWithoutEffects ]), handleGlobalMousePosition = useCallback((globalPos => {
2964
+ if (externalGlobalMousePosition && externalMouseOffset) return;
2965
+ if (effectiveWithoutEffects) return;
2966
+ const container = mouseContainer?.current || glassRef.current;
2967
+ if (!container) return;
2968
+ // Use cached rect if available, otherwise get new one
2969
+ let rect = cachedRectRef.current;
2970
+ if (rect && 0 !== rect.width && 0 !== rect.height || (rect = container.getBoundingClientRect(),
2971
+ cachedRectRef.current = rect), 0 === rect.width || 0 === rect.height) return;
2972
+ const center = calculateElementCenter(rect), newOffset = {
2973
+ x: (globalPos.x - center.x) / rect.width * 100,
2974
+ y: (globalPos.y - center.y) / rect.height * 100
2496
2975
  };
2497
- }), [ effectiveCornerRadius, glassRef ]);
2498
- // OverLight config
2976
+ // Calculate offset relative to this container
2977
+ // Store in refs instead of state
2978
+ internalMouseOffsetRef.current = newOffset, internalGlobalMousePositionRef.current = globalPos,
2979
+ // Imperative style update
2980
+ updateAtomixGlassStyles(wrapperRef?.current || null, glassRef.current, {
2981
+ mouseOffset: newOffset,
2982
+ globalMousePosition: globalPos,
2983
+ glassSize: glassSize,
2984
+ isHovered: isHovered,
2985
+ isActive: isActive,
2986
+ isOverLight: baseOverLightConfig.isOverLight,
2987
+ baseOverLightConfig: baseOverLightConfig,
2988
+ effectiveBorderRadius: effectiveBorderRadius,
2989
+ effectiveWithoutEffects: effectiveWithoutEffects,
2990
+ effectiveReducedMotion: effectiveReducedMotion,
2991
+ elasticity: elasticity,
2992
+ directionalScale: isActive && Boolean(onClick) ? "scale(0.96)" : "scale(1)",
2993
+ // Simplified directional scale for fast path
2994
+ onClick: onClick,
2995
+ withLiquidBlur: withLiquidBlur,
2996
+ blurAmount: blurAmount,
2997
+ saturation: saturation,
2998
+ padding: padding
2999
+ });
3000
+ }), [ mouseContainer, glassRef, wrapperRef, externalGlobalMousePosition, externalMouseOffset, effectiveWithoutEffects, glassSize, isHovered, isActive, baseOverLightConfig, effectiveBorderRadius, effectiveReducedMotion, elasticity, onClick, withLiquidBlur, blurAmount, saturation, padding ]);
2499
3001
  /**
2500
- * Get effective overLight value based on configuration
2501
- * - boolean: returns the boolean value directly
2502
- * - 'auto': returns detectedOverLight (auto-detected from background)
2503
- * - object: returns detectedOverLight (auto-detected, but config object provides customization)
2504
- */
2505
- 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((() => {
2506
- const isOverLight = getEffectiveOverLight(), mouseInfluence = calculateMouseInfluence(mouseOffset), hoverIntensity = isHovered ? 1.4 : 1, activeIntensity = isActive ? 1.6 : 1, baseConfig = {
2507
- isOverLight: isOverLight,
2508
- threshold: .7,
2509
- opacity: isOverLight ? Math.min(.6, Math.max(.2, .5 * hoverIntensity * activeIntensity)) : 0,
2510
- contrast: Math.min(1.6, Math.max(1, 1.4 + .1 * mouseInfluence)),
2511
- brightness: Math.min(1.1, Math.max(.8, .9 + .05 * mouseInfluence)),
2512
- saturationBoost: 1.3,
2513
- // Fixed value dynamic saturation amplifies perceived displacement
2514
- shadowIntensity: Math.min(1.2, Math.max(.5, .9 + .2 * mouseInfluence)),
2515
- borderOpacity: Math.min(1, Math.max(.3, .7 + .1 * mouseInfluence))
3002
+ * Validate and clamp a numeric config value
3003
+ */
3004
+ // Subscribe to shared mouse tracker
3005
+ useEffect((() => {
3006
+ if (externalGlobalMousePosition && externalMouseOffset) return;
3007
+ if (effectiveWithoutEffects) return;
3008
+ const unsubscribe = globalMouseTracker.subscribe(handleGlobalMousePosition), container = mouseContainer?.current || glassRef.current;
3009
+ let resizeObserver = null;
3010
+ return container && "undefined" != typeof ResizeObserver && (resizeObserver = new ResizeObserver((() => {
3011
+ null !== updateRectRef.current && cancelAnimationFrame(updateRectRef.current), updateRectRef.current = requestAnimationFrame((() => {
3012
+ const container = mouseContainer?.current || glassRef.current;
3013
+ container && (cachedRectRef.current = container.getBoundingClientRect()), updateRectRef.current = null;
3014
+ }));
3015
+ })), resizeObserver.observe(container)), () => {
3016
+ unsubscribe(), null !== updateRectRef.current && (cancelAnimationFrame(updateRectRef.current),
3017
+ updateRectRef.current = null), resizeObserver && resizeObserver.disconnect();
2516
3018
  };
2517
- if ("object" == typeof overLight && null !== overLight) {
2518
- 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 = {
2519
- ...baseConfig,
2520
- threshold: validatedThreshold,
2521
- opacity: validatedOpacity * hoverIntensity * activeIntensity,
2522
- contrast: Math.min(1.6, validatedContrast + .1 * mouseInfluence),
2523
- brightness: Math.min(1.1, validatedBrightness + .05 * mouseInfluence),
2524
- saturationBoost: validatedSaturationBoost
2525
- };
2526
- // Validate and apply object config values with proper clamping
2527
- return "undefined" == typeof process || process.env, finalConfig;
2528
- }
2529
- // Debug logging for non-object configs
2530
- return "undefined" == typeof process || process.env, baseConfig;
2531
- }), [ 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 => {
3019
+ }), [ handleGlobalMousePosition, mouseContainer, glassRef, externalGlobalMousePosition, externalMouseOffset, effectiveWithoutEffects ]),
3020
+ // Also call updateStyles on other state changes (hover, active, etc)
3021
+ useEffect((() => {
3022
+ updateAtomixGlassStyles(wrapperRef?.current || null, glassRef.current, {
3023
+ mouseOffset: externalMouseOffset || internalMouseOffsetRef.current,
3024
+ globalMousePosition: externalGlobalMousePosition || internalGlobalMousePositionRef.current,
3025
+ glassSize: glassSize,
3026
+ isHovered: isHovered,
3027
+ isActive: isActive,
3028
+ isOverLight: baseOverLightConfig.isOverLight,
3029
+ baseOverLightConfig: baseOverLightConfig,
3030
+ effectiveBorderRadius: effectiveBorderRadius,
3031
+ effectiveWithoutEffects: effectiveWithoutEffects,
3032
+ effectiveReducedMotion: effectiveReducedMotion,
3033
+ elasticity: elasticity,
3034
+ directionalScale: directionalScale,
3035
+ onClick: onClick,
3036
+ withLiquidBlur: withLiquidBlur,
3037
+ blurAmount: blurAmount,
3038
+ saturation: saturation,
3039
+ padding: padding
3040
+ });
3041
+ }), [ isHovered, isActive, glassSize, baseOverLightConfig, effectiveBorderRadius, effectiveWithoutEffects, effectiveReducedMotion, elasticity, directionalScale, wrapperRef, glassRef, externalMouseOffset, externalGlobalMousePosition, withLiquidBlur, blurAmount, saturation, padding, onClick ]);
3042
+ // Event handlers
3043
+ const handleMouseEnter = useCallback((() => setIsHovered(!0)), []), handleMouseLeave = useCallback((() => setIsHovered(!1)), []), handleMouseDown = useCallback((() => setIsActive(!0)), []), handleMouseUp = useCallback((() => setIsActive(!1)), []), handleMouseMove = useCallback((_e => {}), []), handleKeyDown = useCallback((e => {
2532
3044
  !onClick || "Enter" !== e.key && " " !== e.key || (e.preventDefault(), onClick());
2533
- }), [ onClick ]), handleMouseMove = useCallback((_e => {}), []);
2534
- /**
2535
- * Validate and clamp a numeric config value
2536
- * @param value - The value to validate
2537
- * @param min - Minimum allowed value
2538
- * @param max - Maximum allowed value
2539
- * @param defaultValue - Default value if validation fails
2540
- * @returns Validated and clamped value
2541
- */ return {
2542
- // State
3045
+ }), [ onClick ]);
3046
+ return {
2543
3047
  isHovered: isHovered,
2544
3048
  isActive: isActive,
2545
3049
  glassSize: glassSize,
2546
- dynamicCornerRadius: dynamicCornerRadius,
2547
- effectiveCornerRadius: effectiveCornerRadius,
3050
+ dynamicBorderRadius: dynamicBorderRadius,
3051
+ effectiveBorderRadius: effectiveBorderRadius,
2548
3052
  effectiveReducedMotion: effectiveReducedMotion,
2549
3053
  effectiveHighContrast: effectiveHighContrast,
2550
- effectiveDisableEffects: effectiveDisableEffects,
3054
+ effectiveWithoutEffects: effectiveWithoutEffects,
2551
3055
  detectedOverLight: detectedOverLight,
2552
3056
  globalMousePosition: globalMousePosition,
3057
+ // This is now static (refs or props) unless prop changes
2553
3058
  mouseOffset: mouseOffset,
2554
- // OverLight config
3059
+ // This is now static (refs or props) unless prop changes
2555
3060
  overLightConfig: overLightConfig,
2556
- // Transform calculations
2557
3061
  elasticTranslation: elasticTranslation,
2558
3062
  directionalScale: directionalScale,
2559
3063
  transformStyle: transformStyle,
2560
- // Event handlers
2561
3064
  handleMouseEnter: handleMouseEnter,
2562
3065
  handleMouseLeave: handleMouseLeave,
2563
3066
  handleMouseDown: handleMouseDown,
@@ -2596,7 +3099,7 @@ function useAtomixGlass({glassRef: glassRef, contentRef: contentRef, cornerRadiu
2596
3099
  *
2597
3100
  * @example
2598
3101
  * // Manual border-radius override
2599
- * <AtomixGlass cornerRadius={20}>
3102
+ * <AtomixGlass borderRadius={20}>
2600
3103
  * <div>Content with 20px glass radius</div>
2601
3104
  * </AtomixGlass>
2602
3105
  *
@@ -2637,37 +3140,48 @@ function useAtomixGlass({glassRef: glassRef, contentRef: contentRef, cornerRadiu
2637
3140
  * <AtomixGlass overLight="auto" debugOverLight={true}>
2638
3141
  * <div>Content with debug logging enabled</div>
2639
3142
  * </AtomixGlass>
2640
- */ 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}) {
2641
- const glassRef = useRef(null), contentRef = 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({
3143
+ */ 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, borderRadius: borderRadius, 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, withoutEffects: withoutEffects = !1, withLiquidBlur: withLiquidBlur = !1, withBorder: withBorder = !0, withOverLightLayers: withOverLightLayers = ATOMIX_GLASS.DEFAULTS.ENABLE_OVER_LIGHT_LAYERS, debugPerformance: debugPerformance = !1, debugBorderRadius: debugBorderRadius = !1, debugOverLight: debugOverLight = !1, height: height, width: width, ...rest}) {
3144
+ const glassRef = useRef(null), contentRef = useRef(null), {isHovered: isHovered, isActive: isActive, glassSize: glassSize, effectiveBorderRadius: effectiveBorderRadius, effectiveReducedMotion: effectiveReducedMotion, effectiveHighContrast: effectiveHighContrast, effectiveWithoutEffects: effectiveWithoutEffects, overLightConfig: overLightConfig, globalMousePosition: globalMousePosition, mouseOffset: mouseOffset, transformStyle: transformStyle, handleMouseEnter: handleMouseEnter, handleMouseLeave: handleMouseLeave, handleMouseDown: handleMouseDown, handleMouseUp: handleMouseUp, handleKeyDown: handleKeyDown} = useAtomixGlass({
2642
3145
  glassRef: glassRef,
2643
3146
  contentRef: contentRef,
2644
- cornerRadius: cornerRadius,
3147
+ borderRadius: borderRadius,
2645
3148
  globalMousePosition: externalGlobalMousePosition,
2646
3149
  mouseOffset: externalMouseOffset,
2647
3150
  mouseContainer: mouseContainer,
2648
3151
  overLight: overLight,
2649
3152
  reducedMotion: reducedMotion,
2650
3153
  highContrast: highContrast,
2651
- disableEffects: disableEffects,
3154
+ withoutEffects: withoutEffects,
2652
3155
  elasticity: elasticity,
2653
3156
  onClick: onClick,
2654
- debugCornerRadius: debugCornerRadius,
3157
+ debugBorderRadius: debugBorderRadius,
2655
3158
  debugOverLight: debugOverLight,
2656
- enablePerformanceMonitoring: enablePerformanceMonitoring,
2657
- children: children
2658
- }), isOverLight = useMemo((() => overLightConfig?.isOverLight), [ overLight ]), shouldRenderOverLightLayers = enableOverLightLayers && isOverLight, baseStyle = {
3159
+ debugPerformance: debugPerformance,
3160
+ children: children,
3161
+ blurAmount: blurAmount,
3162
+ saturation: saturation,
3163
+ withLiquidBlur: withLiquidBlur,
3164
+ padding: padding,
3165
+ style: style
3166
+ }), isOverLight = useMemo((() => overLightConfig?.isOverLight), [ overLight ]), shouldRenderOverLightLayers = withOverLightLayers && isOverLight, baseStyle = {
2659
3167
  ...style,
2660
- ...!effectiveDisableEffects && {
3168
+ ...!effectiveWithoutEffects && {
2661
3169
  transform: transformStyle
2662
3170
  }
2663
- }, componentClassName = [ 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(" "), positionStyles = useMemo((() => ({
3171
+ }, componentClassName = [ ATOMIX_GLASS.BASE_CLASS, effectiveReducedMotion && `${ATOMIX_GLASS.BASE_CLASS}--reduced-motion`, effectiveHighContrast && `${ATOMIX_GLASS.BASE_CLASS}--high-contrast`, effectiveWithoutEffects && `${ATOMIX_GLASS.BASE_CLASS}--disabled-effects`, className ].filter(Boolean).join(" "), positionStyles = useMemo((() => ({
2664
3172
  position: style.position || "absolute",
2665
3173
  top: style.top || 0,
2666
3174
  left: style.left || 0
2667
- })), [ style.position, style.top, style.left ]), adjustedSize = useMemo((() => ({
2668
- width: "fixed" !== style.position ? "100%" : style.width ? style.width : Math.max(glassSize.width, 0),
2669
- height: "fixed" !== style.position ? "100%" : style.height ? style.height : Math.max(glassSize.height, 0)
2670
- })), [ style.position, style.width, style.height, glassSize.width, glassSize.height ]), gradientValues = useMemo((() => {
3175
+ })), [ style.position, style.top, style.left ]), adjustedSize = useMemo((() => {
3176
+ const resolveSize = (propValue, styleValue, measuredSize) => {
3177
+ const explicitSize = propValue ?? styleValue;
3178
+ return void 0 !== explicitSize ? "number" == typeof explicitSize ? `${explicitSize}px` : explicitSize : "fixed" === positionStyles.position ? `${Math.max(measuredSize, 0)}px` : "100%";
3179
+ };
3180
+ return {
3181
+ width: resolveSize(width, style.width, glassSize.width),
3182
+ height: resolveSize(height, style.height, glassSize.height)
3183
+ };
3184
+ }), [ width, height, style.width, style.height, positionStyles.position, glassSize.width, glassSize.height ]), gradientValues = useMemo((() => {
2671
3185
  const mx = mouseOffset.x, my = mouseOffset.y, absMx = Math.abs(mx), absMy = Math.abs(my), GRADIENT = ATOMIX_GLASS.CONSTANTS.GRADIENT;
2672
3186
  return {
2673
3187
  borderGradientAngle: GRADIENT.BASE_ANGLE + mx * GRADIENT.ANGLE_MULTIPLIER,
@@ -2709,13 +3223,13 @@ function useAtomixGlass({glassRef: glassRef, contentRef: contentRef, cornerRadiu
2709
3223
  }), [ isHovered, isActive, isOverLight, overLightConfig.opacity ]), glassVars = useMemo((() => {
2710
3224
  const whiteColor = ATOMIX_GLASS.CONSTANTS.PALETTE.WHITE, blackColor = ATOMIX_GLASS.CONSTANTS.PALETTE.BLACK, {borderGradientAngle: borderGradientAngle, borderStop1: borderStop1, borderStop2: borderStop2, borderOpacities: borderOpacities, hoverPositions: hoverPositions, basePosition: basePosition, mx: mx, my: my, absMx: absMx, absMy: absMy} = gradientValues, configBorderOpacity = overLightConfig?.borderOpacity ?? 1;
2711
3225
  return {
2712
- "--atomix-glass-radius": `${effectiveCornerRadius}px`,
3226
+ "--atomix-glass-radius": `${effectiveBorderRadius}px`,
2713
3227
  "--atomix-glass-transform": transformStyle || "none",
2714
3228
  "--atomix-glass-position": positionStyles.position,
2715
3229
  "--atomix-glass-top": "fixed" !== positionStyles.top ? `${positionStyles.top}px` : "0",
2716
3230
  "--atomix-glass-left": "fixed" !== positionStyles.left ? `${positionStyles.left}px` : "0",
2717
- "--atomix-glass-width": "fixed" !== style.position ? adjustedSize.width : `${adjustedSize.width}px`,
2718
- "--atomix-glass-height": "fixed" !== style.position ? adjustedSize.height : `${adjustedSize.height}px`,
3231
+ "--atomix-glass-width": adjustedSize.width,
3232
+ "--atomix-glass-height": adjustedSize.height,
2719
3233
  "--atomix-glass-border-width": "var(--atomix-spacing-0-5, 0.09375rem)",
2720
3234
  "--atomix-glass-blend-mode": isOverLight ? "multiply" : "overlay",
2721
3235
  "--atomix-glass-border-gradient-1": `linear-gradient(${borderGradientAngle}deg, rgba(${whiteColor}, 0) 0%, rgba(${whiteColor}, ${(borderOpacities[0] ?? 1) * configBorderOpacity}) ${borderStop1}%, rgba(${whiteColor}, ${(borderOpacities[1] ?? 1) * configBorderOpacity}) ${borderStop2}%, rgba(${whiteColor}, 0) 100%)`,
@@ -2731,24 +3245,25 @@ function useAtomixGlass({glassRef: glassRef, contentRef: contentRef, cornerRadiu
2731
3245
  "--atomix-glass-overlay-opacity": opacityValues.over,
2732
3246
  "--atomix-glass-overlay-gradient": isOverLight ? `radial-gradient(circle at ${basePosition.x}% ${basePosition.y}%, rgba(${blackColor}, ${ATOMIX_GLASS.CONSTANTS.OVERLAY_GRADIENT.BLACK_START_BASE + absMx * ATOMIX_GLASS.CONSTANTS.OVERLAY_GRADIENT.BLACK_START_MULTIPLIER}) 0%, rgba(${blackColor}, ${ATOMIX_GLASS.CONSTANTS.OVERLAY_GRADIENT.BLACK_MID}) ${ATOMIX_GLASS.CONSTANTS.OVERLAY_GRADIENT.BLACK_MID_STOP}%, rgba(${blackColor}, ${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})`
2733
3247
  };
2734
- }), [ gradientValues, opacityValues, effectiveCornerRadius, transformStyle, positionStyles, adjustedSize, style.position, isOverLight, overLightConfig.borderOpacity ]), renderBackgroundLayer = layerType => jsx("div", {
3248
+ }), [ gradientValues, opacityValues, effectiveBorderRadius, transformStyle, positionStyles, adjustedSize, isOverLight, overLightConfig.borderOpacity ]), renderBackgroundLayer = layerType => jsx("div", {
2735
3249
  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(" "),
2736
3250
  style: {
2737
3251
  ...positionStyles,
2738
3252
  height: adjustedSize.height,
2739
3253
  width: adjustedSize.width,
2740
- borderRadius: `${effectiveCornerRadius}px`,
3254
+ borderRadius: `${effectiveBorderRadius}px`,
2741
3255
  transform: baseStyle.transform
2742
3256
  }
2743
3257
  });
2744
3258
  return jsxs("div", {
3259
+ ...rest,
2745
3260
  className: componentClassName,
2746
3261
  style: glassVars,
2747
3262
  role: role || (onClick ? "button" : void 0),
2748
3263
  tabIndex: onClick ? tabIndex ?? 0 : tabIndex,
2749
3264
  "aria-label": ariaLabel,
2750
3265
  "aria-describedby": ariaDescribedBy,
2751
- "aria-disabled": !(!onClick || !effectiveDisableEffects) || !onClick && void 0,
3266
+ "aria-disabled": !(!onClick || !effectiveWithoutEffects) || !onClick && void 0,
2752
3267
  "aria-pressed": !(!onClick || !isActive) || !onClick && void 0,
2753
3268
  onKeyDown: onClick ? handleKeyDown : void 0,
2754
3269
  children: [ jsx(AtomixGlassContainer, {
@@ -2756,18 +3271,18 @@ function useAtomixGlass({glassRef: glassRef, contentRef: contentRef, cornerRadiu
2756
3271
  contentRef: contentRef,
2757
3272
  className: className,
2758
3273
  style: baseStyle,
2759
- cornerRadius: effectiveCornerRadius,
2760
- displacementScale: effectiveDisableEffects ? 0 : "shader" === mode ? displacementScale * ATOMIX_GLASS.CONSTANTS.MULTIPLIERS.SHADER_DISPLACEMENT : isOverLight ? displacementScale * ATOMIX_GLASS.CONSTANTS.MULTIPLIERS.OVER_LIGHT_DISPLACEMENT : displacementScale,
2761
- blurAmount: effectiveDisableEffects ? 0 : blurAmount,
3274
+ borderRadius: effectiveBorderRadius,
3275
+ displacementScale: effectiveWithoutEffects ? 0 : "shader" === mode ? displacementScale * ATOMIX_GLASS.CONSTANTS.MULTIPLIERS.SHADER_DISPLACEMENT : isOverLight ? displacementScale * ATOMIX_GLASS.CONSTANTS.MULTIPLIERS.OVER_LIGHT_DISPLACEMENT : displacementScale,
3276
+ blurAmount: effectiveWithoutEffects ? 0 : blurAmount,
2762
3277
  saturation: effectiveHighContrast ? ATOMIX_GLASS.CONSTANTS.SATURATION.HIGH_CONTRAST : isOverLight ? saturation * overLightConfig.saturationBoost : saturation,
2763
- aberrationIntensity: effectiveDisableEffects ? 0 : "shader" === mode ? aberrationIntensity * ATOMIX_GLASS.CONSTANTS.MULTIPLIERS.SHADER_ABERRATION : aberrationIntensity,
3278
+ aberrationIntensity: effectiveWithoutEffects ? 0 : "shader" === mode ? aberrationIntensity * ATOMIX_GLASS.CONSTANTS.MULTIPLIERS.SHADER_ABERRATION : aberrationIntensity,
2764
3279
  glassSize: glassSize,
2765
3280
  padding: padding,
2766
- mouseOffset: effectiveDisableEffects ? {
3281
+ mouseOffset: effectiveWithoutEffects ? {
2767
3282
  x: 0,
2768
3283
  y: 0
2769
3284
  } : mouseOffset,
2770
- globalMousePosition: effectiveDisableEffects ? {
3285
+ globalMousePosition: effectiveWithoutEffects ? {
2771
3286
  x: 0,
2772
3287
  y: 0
2773
3288
  } : globalMousePosition,
@@ -2787,11 +3302,11 @@ function useAtomixGlass({glassRef: glassRef, contentRef: contentRef, cornerRadiu
2787
3302
  onClick: onClick,
2788
3303
  mode: mode,
2789
3304
  transform: baseStyle.transform,
2790
- effectiveDisableEffects: effectiveDisableEffects,
3305
+ effectiveWithoutEffects: effectiveWithoutEffects,
2791
3306
  effectiveReducedMotion: effectiveReducedMotion,
2792
3307
  shaderVariant: shaderVariant,
2793
3308
  elasticity: elasticity,
2794
- enableLiquidBlur: enableLiquidBlur,
3309
+ withLiquidBlur: withLiquidBlur,
2795
3310
  children: children
2796
3311
  }), Boolean(onClick) && jsxs(Fragment, {
2797
3312
  children: [ jsx("div", {
@@ -2813,17 +3328,87 @@ function useAtomixGlass({glassRef: glassRef, contentRef: contentRef, cornerRadiu
2813
3328
  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}%)`
2814
3329
  }
2815
3330
  }) ]
2816
- }), enableBorderEffect && jsxs(Fragment, {
3331
+ }), withBorder && jsxs(Fragment, {
2817
3332
  children: [ jsx("span", {
2818
- className: ATOMIX_GLASS.BORDER_1_CLASS
3333
+ className: ATOMIX_GLASS.BORDER_1_CLASS,
3334
+ style: {
3335
+ width: glassSize.width,
3336
+ height: glassSize.height
3337
+ }
2819
3338
  }), jsx("span", {
2820
- className: ATOMIX_GLASS.BORDER_2_CLASS
3339
+ className: ATOMIX_GLASS.BORDER_2_CLASS,
3340
+ style: {
3341
+ width: glassSize.width,
3342
+ height: glassSize.height
3343
+ }
2821
3344
  }) ]
2822
3345
  }) ]
2823
3346
  });
2824
3347
  }
2825
3348
 
2826
- const Accordion = memo((({title: title, children: children, defaultOpen: defaultOpen = !1, isOpen: controlledOpen, onOpenChange: onOpenChange, onOpen: onOpen, onClose: onClose, disabled: disabled = !1, iconPosition: iconPosition = "right", icon: icon, className: className = "", style: style, glass: glass}) => {
3349
+ // Default icon
3350
+ const DefaultIcon = () => jsx("i", {
3351
+ className: "c-accordion__icon",
3352
+ "aria-hidden": "true",
3353
+ children: jsx("svg", {
3354
+ xmlns: "http://www.w3.org/2000/svg",
3355
+ width: "24",
3356
+ height: "24",
3357
+ viewBox: "0 0 24 24",
3358
+ fill: "none",
3359
+ stroke: "currentColor",
3360
+ strokeWidth: "2",
3361
+ strokeLinecap: "round",
3362
+ strokeLinejoin: "round",
3363
+ "aria-hidden": "true",
3364
+ focusable: "false",
3365
+ children: jsx("polyline", {
3366
+ points: "6 9 12 15 18 9"
3367
+ })
3368
+ })
3369
+ }), AccordionHeader = forwardRef((({title: title, icon: icon, iconPosition: iconPosition = "right", isOpen: isOpen, children: children, className: className = "", ...props}, ref) => {
3370
+ // Determine icon to render. Explicit check for undefined to allow null/false to hide icon.
3371
+ const iconElement = void 0 === icon ? jsx(DefaultIcon, {}) : icon;
3372
+ return jsxs("button", {
3373
+ ref: ref,
3374
+ type: "button",
3375
+ className: className,
3376
+ ...props,
3377
+ children: [ title && jsx("span", {
3378
+ className: "c-accordion__title",
3379
+ children: title
3380
+ }), children, iconElement ]
3381
+ });
3382
+ }));
3383
+
3384
+ AccordionHeader.displayName = "AccordionHeader";
3385
+
3386
+ const AccordionBody = forwardRef((({children: children, className: className = "", panelRef: panelRef, contentRef: contentRef, ...props}, ref) => {
3387
+ const mergedPanelRef = React.useMemo((() =>
3388
+ // Helper to merge refs
3389
+ function(...refs) {
3390
+ return node => {
3391
+ refs.forEach((ref => {
3392
+ "function" == typeof ref ? ref(node) : null != ref && (ref.current = node);
3393
+ }));
3394
+ };
3395
+ }(ref, panelRef)), [ ref, panelRef ]);
3396
+ return jsx("div", {
3397
+ ref: mergedPanelRef,
3398
+ className: className,
3399
+ role: "region",
3400
+ ...props,
3401
+ children: jsx("div", {
3402
+ className: ACCORDION.SELECTORS.BODY.replace(".", ""),
3403
+ ref: contentRef,
3404
+ children: children
3405
+ })
3406
+ });
3407
+ }));
3408
+
3409
+ AccordionBody.displayName = "AccordionBody";
3410
+
3411
+ const AccordionImpl = memo((({title: title, children: children, defaultOpen: defaultOpen = !1, isOpen: controlledOpen, onOpenChange: onOpenChange, onOpen: onOpen, onClose: onClose, disabled: disabled = !1, iconPosition: iconPosition = "right", icon: icon, className: className = "", style: style, glass: glass}) => {
2827
3412
  // Generate unique IDs for accessibility
2828
3413
  const instanceId = useId(), buttonId = `accordion-header-${instanceId}`, panelId = `accordion-panel-${instanceId}`, {state: state, toggle: toggle, updatePanelHeight: updatePanelHeight, panelRef: panelRef, contentRef: contentRef, generateClassNames: generateClassNames, generateHeaderClassNames: generateHeaderClassNames} = useAccordion({
2829
3414
  defaultOpen: defaultOpen,
@@ -2833,53 +3418,59 @@ const Accordion = memo((({title: title, children: children, defaultOpen: defaul
2833
3418
  onOpenChange: onOpenChange,
2834
3419
  onOpen: onOpen,
2835
3420
  onClose: onClose
2836
- }), defaultIcon = jsx("i", {
2837
- className: "c-accordion__icon",
2838
- "aria-hidden": "true",
2839
- children: jsx("svg", {
2840
- xmlns: "http://www.w3.org/2000/svg",
2841
- width: "24",
2842
- height: "24",
2843
- viewBox: "0 0 24 24",
2844
- fill: "none",
2845
- stroke: "currentColor",
2846
- strokeWidth: "2",
2847
- strokeLinecap: "round",
2848
- strokeLinejoin: "round",
2849
- "aria-hidden": "true",
2850
- focusable: "false",
2851
- children: jsx("polyline", {
2852
- points: "6 9 12 15 18 9"
2853
- })
2854
- })
2855
- }), accordionContent = jsxs("div", {
3421
+ }), headerClassNames = generateHeaderClassNames(), panelClassNames = ACCORDION.SELECTORS.PANEL.replace(".", ""), hasCompoundComponents = React.Children.toArray(children).some((child => {
3422
+ var _context;
3423
+
3424
+ return React.isValidElement(child) && _includesInstanceProperty(_context = [ "AccordionHeader", "AccordionBody" ]).call(_context, child.type.displayName);
3425
+ })), content = jsx("div", {
2856
3426
  className: generateClassNames(className) + (glass ? " c-accordion--glass" : ""),
2857
3427
  style: style,
2858
- children: [ jsxs("button", {
2859
- id: buttonId,
2860
- className: generateHeaderClassNames(),
2861
- onClick: toggle,
2862
- "aria-expanded": state.isOpen,
2863
- "aria-controls": panelId,
2864
- "aria-disabled": disabled,
2865
- disabled: disabled,
2866
- type: "button",
2867
- children: [ jsx("span", {
2868
- className: "c-accordion__title",
2869
- children: title
2870
- }), icon || defaultIcon ]
2871
- }), jsx("div", {
2872
- id: panelId,
2873
- className: ACCORDION.SELECTORS.PANEL.replace(".", ""),
2874
- ref: panelRef,
2875
- role: "region",
2876
- "aria-labelledby": buttonId,
2877
- children: jsx("div", {
2878
- className: ACCORDION.SELECTORS.BODY.replace(".", ""),
2879
- ref: contentRef,
3428
+ children: hasCompoundComponents ? React.Children.map(children, (child => {
3429
+ if ( React.isValidElement(child)) {
3430
+ if ("AccordionHeader" === child.type.displayName)
3431
+ return React.cloneElement(child, {
3432
+ id: buttonId,
3433
+ className: `${headerClassNames} ${child.props.className || ""}`.trim(),
3434
+ onClick: e => {
3435
+ toggle(), child.props.onClick?.(e);
3436
+ },
3437
+ "aria-expanded": state.isOpen,
3438
+ "aria-controls": panelId,
3439
+ "aria-disabled": disabled,
3440
+ disabled: disabled,
3441
+ iconPosition: child.props.iconPosition || iconPosition
3442
+ });
3443
+ if ("AccordionBody" === child.type.displayName)
3444
+ return React.cloneElement(child, {
3445
+ id: panelId,
3446
+ className: `${panelClassNames} ${child.props.className || ""}`.trim(),
3447
+ "aria-labelledby": buttonId,
3448
+ panelRef: panelRef,
3449
+ contentRef: contentRef
3450
+ });
3451
+ }
3452
+ return child;
3453
+ })) : jsxs(Fragment, {
3454
+ children: [ jsx(AccordionHeader, {
3455
+ id: buttonId,
3456
+ className: headerClassNames,
3457
+ onClick: toggle,
3458
+ "aria-expanded": state.isOpen,
3459
+ "aria-controls": panelId,
3460
+ "aria-disabled": disabled,
3461
+ disabled: disabled,
3462
+ title: title,
3463
+ icon: icon,
3464
+ iconPosition: iconPosition
3465
+ }), jsx(AccordionBody, {
3466
+ id: panelId,
3467
+ className: panelClassNames,
3468
+ "aria-labelledby": buttonId,
3469
+ panelRef: panelRef,
3470
+ contentRef: contentRef,
2880
3471
  children: children
2881
- })
2882
- }) ]
3472
+ }) ]
3473
+ })
2883
3474
  });
2884
3475
  if (glass) {
2885
3476
  // Default glass settings for accordions
@@ -2892,16 +3483,20 @@ const Accordion = memo((({title: title, children: children, defaultOpen: defaul
2892
3483
  };
2893
3484
  return jsx(AtomixGlass, {
2894
3485
  ...glassProps,
2895
- children: accordionContent
3486
+ children: content
2896
3487
  });
2897
3488
  }
2898
- return accordionContent;
3489
+ return content;
2899
3490
  }));
2900
3491
 
2901
- // Set display name for debugging
2902
- Accordion.displayName = "Accordion";
3492
+ AccordionImpl.displayName = "Accordion";
3493
+
3494
+ // Attach subcomponents
3495
+ const AccordionWithSubcomponents = AccordionImpl;
2903
3496
 
2904
- const AtomixLogo = ({height: height = 24, width: width = 24, color: color = "currentColor", ...props}) => jsxs("svg", {
3497
+ AccordionWithSubcomponents.Header = AccordionHeader, AccordionWithSubcomponents.Body = AccordionBody;
3498
+
3499
+ const Accordion = AccordionWithSubcomponents, AtomixLogo = ({height: height = 24, width: width = 24, color: color = "currentColor", ...props}) => jsxs("svg", {
2905
3500
  width: width,
2906
3501
  height: height,
2907
3502
  viewBox: "0 0 24 24",
@@ -3230,8 +3825,6 @@ const AtomixLogo = ({height: height = 24, width: width = 24, color: color = "cur
3230
3825
  // Convert string size to pixel value if needed
3231
3826
  };
3232
3827
 
3233
- // Adapted from https://github.com/shuding/liquid-glass
3234
- // Constants
3235
3828
  Icon.displayName = "Icon";
3236
3829
 
3237
3830
  const Avatar = memo((({src: src, alt: alt = "Avatar", initials: initials, icon: icon, size: size = "md", circle: circle = !1, className: className = "", disabled: disabled = !1, onClick: onClick, style: style, glass: glass}) => {
@@ -3349,7 +3942,7 @@ const Badge = memo((({label: label, variant: variant = "primary", size: size =
3349
3942
  // Default glass settings for badges
3350
3943
  const defaultGlassProps = {
3351
3944
  displacementScale: 20,
3352
- cornerRadius: ref.current?.getBoundingClientRect().width ? ref.current?.getBoundingClientRect().width / 2 : 16,
3945
+ borderRadius: ref.current?.getBoundingClientRect().width ? ref.current?.getBoundingClientRect().width / 2 : 16,
3353
3946
  className: "c-badge--glass",
3354
3947
  elasticity: 0
3355
3948
  }, glassProps = !0 === glass ? defaultGlassProps : {
@@ -3470,37 +4063,77 @@ const useBlock = () => ({
3470
4063
  * ```
3471
4064
  */ Block.displayName = "Block";
3472
4065
 
3473
- const Breadcrumb = memo((({items: items, divider: divider, className: className = "", "aria-label": ariaLabel = "Breadcrumb", LinkComponent: LinkComponent, style: style}) => {
4066
+ const BreadcrumbItem = forwardRef((({children: children, href: href, active: active, icon: icon, onClick: onClick, className: className = "", style: style, linkAs: linkAs, linkProps: linkProps = {}, ...props}, ref) => {
4067
+ const itemClasses = [ BREADCRUMB.CLASSES.ITEM, active ? BREADCRUMB.CLASSES.ACTIVE : "", className ].filter(Boolean).join(" "), linkContent = jsxs(Fragment, {
4068
+ children: [ icon && jsx("span", {
4069
+ className: "c-breadcrumb__icon",
4070
+ children: icon
4071
+ }), children ]
4072
+ }), commonLinkProps = {
4073
+ className: BREADCRUMB.CLASSES.LINK,
4074
+ onClick: onClick,
4075
+ style: style,
4076
+ // Apply style to the link as per legacy behavior
4077
+ ...linkProps
4078
+ };
4079
+ return jsx("li", {
4080
+ ref: ref,
4081
+ className: itemClasses,
4082
+ style: style,
4083
+ ...props,
4084
+ children: href && !active ?
4085
+ // @ts-ignore - Dynamic components are tricky in TS without stricter types
4086
+ jsx(linkAs || "a", {
4087
+ href: href,
4088
+ ...commonLinkProps,
4089
+ children: linkContent
4090
+ }) : jsx("span", {
4091
+ className: BREADCRUMB.CLASSES.LINK,
4092
+ children: linkContent
4093
+ })
4094
+ });
4095
+ }));
4096
+
4097
+ BreadcrumbItem.displayName = "BreadcrumbItem";
4098
+
4099
+ const Breadcrumb = memo((function({items: items, divider: divider, className: className = "", "aria-label": ariaLabel = "Breadcrumb", LinkComponent: LinkComponent, style: style, children: children}) {
3474
4100
  const breadcrumbClasses = [ BREADCRUMB.CLASSES.BASE, className ].filter(Boolean).join(" ");
4101
+ let content;
4102
+ if (items && items.length > 0)
4103
+ // Legacy rendering
4104
+ content = items.map(((item, index) => {
4105
+ const isLast = index === items.length - 1;
4106
+ return jsx(BreadcrumbItem, {
4107
+ href: item.href,
4108
+ active: item.active || isLast,
4109
+ icon: item.icon,
4110
+ onClick: item.onClick,
4111
+ className: item.className,
4112
+ style: item.style,
4113
+ linkAs: LinkComponent,
4114
+ children: item.label
4115
+ }, index);
4116
+ })); else {
4117
+ // Compound rendering
4118
+ const childrenCount = Children.count(children);
4119
+ content = Children.map(children, ((child, index) => {
4120
+ if ( isValidElement(child)) {
4121
+ const isLast = index === childrenCount - 1, childProps = child.props, {active: active, linkAs: linkAs, ...otherProps} = childProps;
4122
+
4123
+ return cloneElement(child, {
4124
+ active: active ?? (!!isLast || void 0),
4125
+ linkAs: linkAs ?? LinkComponent
4126
+ });
4127
+ }
4128
+ return child;
4129
+ }));
4130
+ }
3475
4131
  return jsx("nav", {
3476
4132
  "aria-label": ariaLabel,
3477
4133
  style: style,
3478
4134
  children: jsx("ol", {
3479
4135
  className: breadcrumbClasses,
3480
- children: items.map(((item, index) => {
3481
- const isLast = index === items.length - 1, itemClasses = [ BREADCRUMB.CLASSES.ITEM, item.active || isLast ? BREADCRUMB.CLASSES.ACTIVE : "" ].filter(Boolean).join(" "), linkContent = jsxs(Fragment, {
3482
- children: [ item.icon && jsx("span", {
3483
- className: "c-breadcrumb__icon",
3484
- children: item.icon
3485
- }), item.label ]
3486
- }), linkProps = {
3487
- href: item.href,
3488
- className: BREADCRUMB.CLASSES.LINK,
3489
- onClick: item.onClick,
3490
- style: item.style
3491
- };
3492
- return jsx("li", {
3493
- className: itemClasses,
3494
- style: item.style,
3495
- children: item.href && !item.active ? jsx(LinkComponent || "a", {
3496
- ...linkProps,
3497
- children: linkContent
3498
- }) : jsx("span", {
3499
- className: BREADCRUMB.CLASSES.LINK,
3500
- children: linkContent
3501
- })
3502
- }, index);
3503
- }))
4136
+ children: content
3504
4137
  })
3505
4138
  });
3506
4139
  }));
@@ -3531,7 +4164,7 @@ function useSpinner(initialProps) {
3531
4164
  };
3532
4165
  }
3533
4166
 
3534
- Breadcrumb.displayName = "Breadcrumb";
4167
+ Breadcrumb.displayName = "Breadcrumb", Breadcrumb.Item = BreadcrumbItem;
3535
4168
 
3536
4169
  const Spinner = memo((({size: size = "md", variant: variant = "primary", fullscreen: fullscreen = !1, className: className = "", style: style, glass: glass, "aria-label": ariaLabel, role: role = "status"}) => {
3537
4170
  const {generateSpinnerClass: generateSpinnerClass} = useSpinner({
@@ -3557,7 +4190,7 @@ const Spinner = memo((({size: size = "md", variant: variant = "primary", fullsc
3557
4190
  const defaultGlassProps = {
3558
4191
  displacementScale: 20,
3559
4192
  blurAmount: 1,
3560
- cornerRadius: 999,
4193
+ borderRadius: 999,
3561
4194
  mode: "shader"
3562
4195
  }, glassProps = !0 === glass ? defaultGlassProps : {
3563
4196
  ...defaultGlassProps,
@@ -3596,7 +4229,7 @@ class ThemeNaming {
3596
4229
  * Convert camelCase to kebab-case for CSS variables
3597
4230
  * @param str - String to convert
3598
4231
  */ static camelToKebab(str) {
3599
- return str.replace(/([a-z0-9]|(?=[A-Z]))([A-Z])/g, "$1-$2").toLowerCase();
4232
+ return str.replace(/([a-z0-9])([A-Z])/g, "$1-$2").toLowerCase();
3600
4233
  }
3601
4234
  /**
3602
4235
  * Convert kebab-case to camelCase for JavaScript properties
@@ -3748,431 +4381,129 @@ const Button = React.memo( forwardRef((({label: label, children: children, onCl
3748
4381
  });
3749
4382
  if (glass) {
3750
4383
  // Default glass props
3751
- const defaultGlassProps = {
3752
- displacementScale: 20,
3753
- blurAmount: 0,
3754
- saturation: 200,
3755
- elasticity: 0
3756
- }, glassProps = !0 === glass ? defaultGlassProps : {
3757
- ...defaultGlassProps,
3758
- ...glass
3759
- };
3760
- return jsx(AtomixGlass, {
3761
- ...glassProps,
3762
- children: content
3763
- });
3764
- }
3765
- return content;
3766
- })));
3767
-
3768
- Button.displayName = "Button";
3769
-
3770
- /**
3771
- * ButtonGroup - A component for grouping buttons together
3772
- *
3773
- * Groups buttons together with proper border radius handling and spacing.
3774
- * The buttons will be visually connected with shared borders.
3775
- *
3776
- * @example
3777
- * ```tsx
3778
- * <ButtonGroup>
3779
- * <Button label="Left" />
3780
- * <Button label="Middle" />
3781
- * <Button label="Right" />
3782
- * </ButtonGroup>
3783
- * ```
3784
- */
3785
- const ButtonGroup = ({children: children, className: className = "", style: style, "aria-label": ariaLabel, role: role = "group"}) => {
3786
- // Generate CSS classes
3787
- const buttonGroupClasses = [ BUTTON_GROUP.CLASSES.BASE, className ].filter(Boolean).join(" "), buttonChildren = Children.toArray(children).filter((child => isValidElement(child) && child.type === Button));
3788
- // Get valid Button children
3789
- return jsx("div", {
3790
- className: buttonGroupClasses,
3791
- style: style,
3792
- role: role,
3793
- "aria-label": ariaLabel,
3794
- children: buttonChildren.map(((child, index) => isValidElement(child) ? cloneElement(child, {
3795
- key: index,
3796
- ...child.props
3797
- }) : null))
3798
- });
3799
- };
3800
-
3801
- ButtonGroup.displayName = "ButtonGroup";
3802
-
3803
- var commonjsGlobal = "undefined" != typeof globalThis ? globalThis : "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof self ? self : {};
3804
-
3805
- function getDefaultExportFromCjs(x) {
3806
- return x && x.__esModule && Object.prototype.hasOwnProperty.call(x, "default") ? x.default : x;
3807
- }
3808
-
3809
- var fails$9 = function(exec) {
3810
- try {
3811
- return !!exec();
3812
- } catch (error) {
3813
- return !0;
3814
- }
3815
- }, functionBindNative = !fails$9((function() {
3816
- // eslint-disable-next-line es/no-function-prototype-bind -- safe
3817
- var test = function() {/* empty */}.bind();
3818
- // eslint-disable-next-line no-prototype-builtins -- safe
3819
- return "function" != typeof test || test.hasOwnProperty("prototype");
3820
- })), NATIVE_BIND$3 = functionBindNative, FunctionPrototype$1 = Function.prototype, call$5 = FunctionPrototype$1.call, uncurryThisWithBind = NATIVE_BIND$3 && FunctionPrototype$1.bind.bind(call$5, call$5), functionUncurryThis = NATIVE_BIND$3 ? uncurryThisWithBind : function(fn) {
3821
- return function() {
3822
- return call$5.apply(fn, arguments);
3823
- };
3824
- }, objectIsPrototypeOf = functionUncurryThis({}.isPrototypeOf), check = function(it) {
3825
- return it && it.Math === Math && it;
3826
- }, globalThis_1 =
3827
- // eslint-disable-next-line es/no-global-this -- safe
3828
- check("object" == typeof globalThis && globalThis) || check("object" == typeof window && window) ||
3829
- // eslint-disable-next-line no-restricted-globals -- safe
3830
- check("object" == typeof self && self) || check("object" == typeof commonjsGlobal && commonjsGlobal) || check("object" == typeof commonjsGlobal && commonjsGlobal) ||
3831
- // eslint-disable-next-line no-new-func -- fallback
3832
- function() {
3833
- return this;
3834
- }() || Function("return this")(), NATIVE_BIND$2 = functionBindNative, FunctionPrototype = Function.prototype, apply$1 = FunctionPrototype.apply, call$4 = FunctionPrototype.call, functionApply = "object" == typeof Reflect && Reflect.apply || (NATIVE_BIND$2 ? call$4.bind(apply$1) : function() {
3835
- return call$4.apply(apply$1, arguments);
3836
- }), uncurryThis$7 = functionUncurryThis, toString$3 = uncurryThis$7({}.toString), stringSlice = uncurryThis$7("".slice), classofRaw$2 = function(it) {
3837
- return stringSlice(toString$3(it), 8, -1);
3838
- }, classofRaw$1 = classofRaw$2, uncurryThis$6 = functionUncurryThis, functionUncurryThisClause = function(fn) {
3839
- // Nashorn bug:
3840
- // https://github.com/zloirock/core-js/issues/1128
3841
- // https://github.com/zloirock/core-js/issues/1130
3842
- if ("Function" === classofRaw$1(fn)) return uncurryThis$6(fn);
3843
- }, documentAll = "object" == typeof document && document.all, isCallable$8 = void 0 === documentAll && void 0 !== documentAll ? function(argument) {
3844
- return "function" == typeof argument || argument === documentAll;
3845
- } : function(argument) {
3846
- return "function" == typeof argument;
3847
- }, objectGetOwnPropertyDescriptor = {}, descriptors = !fails$9((function() {
3848
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
3849
- return 7 !== Object.defineProperty({}, 1, {
3850
- get: function() {
3851
- return 7;
3852
- }
3853
- })[1];
3854
- })), NATIVE_BIND$1 = functionBindNative, call$3 = Function.prototype.call, functionCall = NATIVE_BIND$1 ? call$3.bind(call$3) : function() {
3855
- return call$3.apply(call$3, arguments);
3856
- }, objectPropertyIsEnumerable = {}, $propertyIsEnumerable = {}.propertyIsEnumerable, getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor, NASHORN_BUG = getOwnPropertyDescriptor$1 && !$propertyIsEnumerable.call({
3857
- 1: 2
3858
- }, 1);
3859
-
3860
- // `Object.prototype.propertyIsEnumerable` method implementation
3861
- // https://tc39.es/ecma262/#sec-object.prototype.propertyisenumerable
3862
- objectPropertyIsEnumerable.f = NASHORN_BUG ? function(V) {
3863
- var descriptor = getOwnPropertyDescriptor$1(this, V);
3864
- return !!descriptor && descriptor.enumerable;
3865
- } : $propertyIsEnumerable;
3866
-
3867
- var match, version, createPropertyDescriptor$2 = function(bitmap, value) {
3868
- return {
3869
- enumerable: !(1 & bitmap),
3870
- configurable: !(2 & bitmap),
3871
- writable: !(4 & bitmap),
3872
- value: value
3873
- };
3874
- }, fails$6 = fails$9, classof$4 = classofRaw$2, $Object$3 = Object, split = functionUncurryThis("".split), indexedObject = fails$6((function() {
3875
- // throws an error in rhino, see https://github.com/mozilla/rhino/issues/346
3876
- // eslint-disable-next-line no-prototype-builtins -- safe
3877
- return !$Object$3("z").propertyIsEnumerable(0);
3878
- })) ? function(it) {
3879
- return "String" === classof$4(it) ? split(it, "") : $Object$3(it);
3880
- } : $Object$3, isNullOrUndefined$2 = function(it) {
3881
- return null == it;
3882
- }, isNullOrUndefined$1 = isNullOrUndefined$2, $TypeError$7 = TypeError, requireObjectCoercible$3 = function(it) {
3883
- if (isNullOrUndefined$1(it)) throw new $TypeError$7("Can't call method on " + it);
3884
- return it;
3885
- }, IndexedObject$1 = indexedObject, requireObjectCoercible$2 = requireObjectCoercible$3, toIndexedObject$2 = function(it) {
3886
- return IndexedObject$1(requireObjectCoercible$2(it));
3887
- }, isCallable$7 = isCallable$8, isObject$6 = function(it) {
3888
- return "object" == typeof it ? null !== it : isCallable$7(it);
3889
- }, path$3 = {}, path$2 = path$3, globalThis$b = globalThis_1, isCallable$6 = isCallable$8, aFunction = function(variable) {
3890
- return isCallable$6(variable) ? variable : void 0;
3891
- }, navigator$1 = globalThis_1.navigator, userAgent$2 = navigator$1 && navigator$1.userAgent, environmentUserAgent = userAgent$2 ? String(userAgent$2) : "", globalThis$9 = globalThis_1, userAgent$1 = environmentUserAgent, process$1 = globalThis$9.process, Deno$1 = globalThis$9.Deno, versions = process$1 && process$1.versions || Deno$1 && Deno$1.version, v8 = versions && versions.v8;
3892
-
3893
- v8 && (
3894
- // in old Chrome, versions of V8 isn't V8 = Chrome / 10
3895
- // but their correct versions are not interesting for us
3896
- version = (match = v8.split("."))[0] > 0 && match[0] < 4 ? 1 : +(match[0] + match[1])),
3897
- // BrowserFS NodeJS `process` polyfill incorrectly set `.v8` to `0.0`
3898
- // so check `userAgent` even if `.v8` exists, but 0
3899
- !version && userAgent$1 && (!(match = userAgent$1.match(/Edge\/(\d+)/)) || match[1] >= 74) && (match = userAgent$1.match(/Chrome\/(\d+)/)) && (version = +match[1]);
3900
-
3901
- var environmentV8Version = version, V8_VERSION = environmentV8Version, fails$5 = fails$9, $String$3 = globalThis_1.String, symbolConstructorDetection = !!Object.getOwnPropertySymbols && !fails$5((function() {
3902
- var symbol = Symbol("symbol detection");
3903
- // Chrome 38 Symbol has incorrect toString conversion
3904
- // `get-own-property-symbols` polyfill symbols converted to object are not Symbol instances
3905
- // nb: Do not call `String` directly to avoid this being optimized out to `symbol+''` which will,
3906
- // of course, fail.
3907
- return !$String$3(symbol) || !(Object(symbol) instanceof Symbol) ||
3908
- // Chrome 38-40 symbols are not inherited from DOM collections prototypes to instances
3909
- !Symbol.sham && V8_VERSION && V8_VERSION < 41;
3910
- })), useSymbolAsUid = symbolConstructorDetection && !Symbol.sham && "symbol" == typeof Symbol.iterator, isCallable$5 = isCallable$8, isPrototypeOf$2 = objectIsPrototypeOf, $Object$2 = Object, isSymbol$2 = useSymbolAsUid ? function(it) {
3911
- return "symbol" == typeof it;
3912
- } : function(it) {
3913
- var $Symbol = function(namespace, method) {
3914
- return arguments.length < 2 ? aFunction(path$2[namespace]) || aFunction(globalThis$b[namespace]) : path$2[namespace] && path$2[namespace][method] || globalThis$b[namespace] && globalThis$b[namespace][method];
3915
- }("Symbol");
3916
- return isCallable$5($Symbol) && isPrototypeOf$2($Symbol.prototype, $Object$2(it));
3917
- }, $String$2 = String, isCallable$4 = isCallable$8, $TypeError$6 = TypeError, aCallable$3 = function(argument) {
3918
- if (isCallable$4(argument)) return argument;
3919
- throw new $TypeError$6(function(argument) {
3920
- try {
3921
- return $String$2(argument);
3922
- } catch (error) {
3923
- return "Object";
3924
- }
3925
- }(argument) + " is not a function");
3926
- }, aCallable$2 = aCallable$3, isNullOrUndefined = isNullOrUndefined$2, call$2 = functionCall, isCallable$3 = isCallable$8, isObject$5 = isObject$6, $TypeError$5 = TypeError, sharedStore = {
3927
- exports: {}
3928
- }, globalThis$7 = globalThis_1, defineProperty = Object.defineProperty, globalThis$6 = globalThis_1, store$1 = sharedStore.exports = globalThis$6["__core-js_shared__"] || function(key, value) {
3929
- try {
3930
- defineProperty(globalThis$7, key, {
3931
- value: value,
3932
- configurable: !0,
3933
- writable: !0
3934
- });
3935
- } catch (error) {
3936
- globalThis$7[key] = value;
3937
- }
3938
- return value;
3939
- }("__core-js_shared__", {});
3940
-
3941
- /* eslint-disable es/no-symbol -- required for testing */ (store$1.versions || (store$1.versions = [])).push({
3942
- version: "3.43.0",
3943
- mode: "pure",
3944
- copyright: "© 2014-2025 Denis Pushkarev (zloirock.ru)",
3945
- license: "https://github.com/zloirock/core-js/blob/v3.43.0/LICENSE",
3946
- source: "https://github.com/zloirock/core-js"
3947
- });
3948
-
3949
- var key, value, store = sharedStore.exports, requireObjectCoercible$1 = requireObjectCoercible$3, $Object$1 = Object, toObject$2 = function(argument) {
3950
- return $Object$1(requireObjectCoercible$1(argument));
3951
- }, toObject$1 = toObject$2, hasOwnProperty = functionUncurryThis({}.hasOwnProperty), hasOwnProperty_1 = Object.hasOwn || function(it, key) {
3952
- return hasOwnProperty(toObject$1(it), key);
3953
- }, uncurryThis$3 = functionUncurryThis, id = 0, postfix = Math.random(), toString$2 = uncurryThis$3(1.1.toString), hasOwn$2 = hasOwnProperty_1, NATIVE_SYMBOL = symbolConstructorDetection, USE_SYMBOL_AS_UID = useSymbolAsUid, Symbol$1 = globalThis_1.Symbol, WellKnownSymbolsStore = store[key = "wks"] || (store[key] = value || {}), createWellKnownSymbol = USE_SYMBOL_AS_UID ? Symbol$1.for || Symbol$1 : Symbol$1 && Symbol$1.withoutSetter || function(key) {
3954
- return "Symbol(" + (void 0 === key ? "" : key) + ")_" + toString$2(++id + postfix, 36);
3955
- }, wellKnownSymbol$5 = function(name) {
3956
- return hasOwn$2(WellKnownSymbolsStore, name) || (WellKnownSymbolsStore[name] = NATIVE_SYMBOL && hasOwn$2(Symbol$1, name) ? Symbol$1[name] : createWellKnownSymbol("Symbol." + name)),
3957
- WellKnownSymbolsStore[name];
3958
- }, call$1 = functionCall, isObject$4 = isObject$6, isSymbol$1 = isSymbol$2, $TypeError$4 = TypeError, TO_PRIMITIVE = wellKnownSymbol$5("toPrimitive"), toPrimitive = function(input, pref) {
3959
- if (!isObject$4(input) || isSymbol$1(input)) return input;
3960
- var result, func, exoticToPrim = (func = input[TO_PRIMITIVE], isNullOrUndefined(func) ? void 0 : aCallable$2(func));
3961
- if (exoticToPrim) {
3962
- if (void 0 === pref && (pref = "default"), result = call$1(exoticToPrim, input, pref),
3963
- !isObject$4(result) || isSymbol$1(result)) return result;
3964
- throw new $TypeError$4("Can't convert object to primitive value");
4384
+ const defaultGlassProps = {
4385
+ displacementScale: 20,
4386
+ blurAmount: 0,
4387
+ saturation: 200,
4388
+ elasticity: 0
4389
+ }, glassProps = !0 === glass ? defaultGlassProps : {
4390
+ ...defaultGlassProps,
4391
+ ...glass
4392
+ };
4393
+ return jsx(AtomixGlass, {
4394
+ ...glassProps,
4395
+ children: content
4396
+ });
3965
4397
  }
3966
- return void 0 === pref && (pref = "number"), function(input, pref) {
3967
- var fn, val;
3968
- if ("string" === pref && isCallable$3(fn = input.toString) && !isObject$5(val = call$2(fn, input))) return val;
3969
- if (isCallable$3(fn = input.valueOf) && !isObject$5(val = call$2(fn, input))) return val;
3970
- if ("string" !== pref && isCallable$3(fn = input.toString) && !isObject$5(val = call$2(fn, input))) return val;
3971
- throw new $TypeError$5("Can't convert object to primitive value");
3972
- }(input, pref);
3973
- }, isSymbol = isSymbol$2, toPropertyKey$2 = function(argument) {
3974
- var key = toPrimitive(argument, "string");
3975
- return isSymbol(key) ? key : key + "";
3976
- }, isObject$3 = isObject$6, document$1 = globalThis_1.document, EXISTS = isObject$3(document$1) && isObject$3(document$1.createElement), ie8DomDefine = !descriptors && !fails$9((function() {
3977
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
3978
- return 7 !== Object.defineProperty((it = "div", EXISTS ? document$1.createElement(it) : {}), "a", {
3979
- get: function() {
3980
- return 7;
3981
- }
3982
- }).a;
3983
- var it;
3984
- })), DESCRIPTORS$3 = descriptors, call = functionCall, propertyIsEnumerableModule = objectPropertyIsEnumerable, createPropertyDescriptor$1 = createPropertyDescriptor$2, toIndexedObject$1 = toIndexedObject$2, toPropertyKey$1 = toPropertyKey$2, hasOwn$1 = hasOwnProperty_1, IE8_DOM_DEFINE$1 = ie8DomDefine, $getOwnPropertyDescriptor$1 = Object.getOwnPropertyDescriptor;
4398
+ return content;
4399
+ })));
3985
4400
 
3986
- // `Object.getOwnPropertyDescriptor` method
3987
- // https://tc39.es/ecma262/#sec-object.getownpropertydescriptor
3988
- objectGetOwnPropertyDescriptor.f = DESCRIPTORS$3 ? $getOwnPropertyDescriptor$1 : function(O, P) {
3989
- if (O = toIndexedObject$1(O), P = toPropertyKey$1(P), IE8_DOM_DEFINE$1) try {
3990
- return $getOwnPropertyDescriptor$1(O, P);
3991
- } catch (error) {/* empty */}
3992
- if (hasOwn$1(O, P)) return createPropertyDescriptor$1(!call(propertyIsEnumerableModule.f, O, P), O[P]);
4401
+ Button.displayName = "Button";
4402
+
4403
+ /**
4404
+ * ButtonGroup - A component for grouping buttons together
4405
+ *
4406
+ * Groups buttons together with proper border radius handling and spacing.
4407
+ * The buttons will be visually connected with shared borders.
4408
+ *
4409
+ * @example
4410
+ * ```tsx
4411
+ * <ButtonGroup>
4412
+ * <Button label="Left" />
4413
+ * <Button label="Middle" />
4414
+ * <Button label="Right" />
4415
+ * </ButtonGroup>
4416
+ * ```
4417
+ */
4418
+ const ButtonGroup = ({children: children, className: className = "", style: style, "aria-label": ariaLabel, role: role = "group"}) => {
4419
+ // Generate CSS classes
4420
+ const buttonGroupClasses = [ BUTTON_GROUP.CLASSES.BASE, className ].filter(Boolean).join(" "), buttonChildren = Children.toArray(children).filter((child => isValidElement(child) && child.type === Button));
4421
+ // Get valid Button children
4422
+ return jsx("div", {
4423
+ className: buttonGroupClasses,
4424
+ style: style,
4425
+ role: role,
4426
+ "aria-label": ariaLabel,
4427
+ children: buttonChildren.map(((child, index) => isValidElement(child) ? cloneElement(child, {
4428
+ key: index,
4429
+ ...child.props
4430
+ }) : null))
4431
+ });
3993
4432
  };
3994
4433
 
3995
- var fails$3 = fails$9, isCallable$2 = isCallable$8, replacement = /#|\.prototype\./, isForced$1 = function(feature, detection) {
3996
- var value = data[normalize(feature)];
3997
- return value === POLYFILL || value !== NATIVE && (isCallable$2(detection) ? fails$3(detection) : !!detection);
3998
- }, normalize = isForced$1.normalize = function(string) {
3999
- return String(string).replace(replacement, ".").toLowerCase();
4000
- }, data = isForced$1.data = {}, NATIVE = isForced$1.NATIVE = "N", POLYFILL = isForced$1.POLYFILL = "P", isForced_1 = isForced$1, aCallable$1 = aCallable$3, NATIVE_BIND = functionBindNative, bind$1 = functionUncurryThisClause(functionUncurryThisClause.bind), objectDefineProperty = {}, v8PrototypeDefineBug = descriptors && fails$9((function() {
4001
- // eslint-disable-next-line es/no-object-defineproperty -- required for testing
4002
- return 42 !== Object.defineProperty((function() {/* empty */}), "prototype", {
4003
- value: 42,
4004
- writable: !1
4005
- }).prototype;
4006
- })), isObject$2 = isObject$6, $String$1 = String, $TypeError$3 = TypeError, DESCRIPTORS$1 = descriptors, IE8_DOM_DEFINE = ie8DomDefine, V8_PROTOTYPE_DEFINE_BUG = v8PrototypeDefineBug, anObject = function(argument) {
4007
- if (isObject$2(argument)) return argument;
4008
- throw new $TypeError$3($String$1(argument) + " is not an object");
4009
- }, toPropertyKey = toPropertyKey$2, $TypeError$2 = TypeError, $defineProperty = Object.defineProperty, $getOwnPropertyDescriptor = Object.getOwnPropertyDescriptor;
4434
+ ButtonGroup.displayName = "ButtonGroup";
4010
4435
 
4011
- // `Object.defineProperty` method
4012
- // https://tc39.es/ecma262/#sec-object.defineproperty
4013
- objectDefineProperty.f = DESCRIPTORS$1 ? V8_PROTOTYPE_DEFINE_BUG ? function(O, P, Attributes) {
4014
- if (anObject(O), P = toPropertyKey(P), anObject(Attributes), "function" == typeof O && "prototype" === P && "value" in Attributes && "writable" in Attributes && !Attributes.writable) {
4015
- var current = $getOwnPropertyDescriptor(O, P);
4016
- current && current.writable && (O[P] = Attributes.value, Attributes = {
4017
- configurable: "configurable" in Attributes ? Attributes.configurable : current.configurable,
4018
- enumerable: "enumerable" in Attributes ? Attributes.enumerable : current.enumerable,
4019
- writable: !1
4020
- });
4021
- }
4022
- return $defineProperty(O, P, Attributes);
4023
- } : $defineProperty : function(O, P, Attributes) {
4024
- if (anObject(O), P = toPropertyKey(P), anObject(Attributes), IE8_DOM_DEFINE) try {
4025
- return $defineProperty(O, P, Attributes);
4026
- } catch (error) {/* empty */}
4027
- if ("get" in Attributes || "set" in Attributes) throw new $TypeError$2("Accessors not supported");
4028
- return "value" in Attributes && (O[P] = Attributes.value), O;
4029
- };
4436
+ // Subcomponents
4437
+ const CalloutIcon = forwardRef((({children: children, className: className = "", ...props}, ref) => jsx("div", {
4438
+ ref: ref,
4439
+ className: `c-callout__icon ${className}`.trim(),
4440
+ ...props,
4441
+ children: children
4442
+ })));
4030
4443
 
4031
- var definePropertyModule = objectDefineProperty, createPropertyDescriptor = createPropertyDescriptor$2, createNonEnumerableProperty$1 = descriptors ? function(object, key, value) {
4032
- return definePropertyModule.f(object, key, createPropertyDescriptor(1, value));
4033
- } : function(object, key, value) {
4034
- return object[key] = value, object;
4035
- }, globalThis$3 = globalThis_1, apply = functionApply, uncurryThis$1 = functionUncurryThisClause, isCallable$1 = isCallable$8, getOwnPropertyDescriptor = objectGetOwnPropertyDescriptor.f, isForced = isForced_1, path$1 = path$3, bind = function(fn, that) {
4036
- return aCallable$1(fn), void 0 === that ? fn : NATIVE_BIND ? bind$1(fn, that) : function() {
4037
- return fn.apply(that, arguments);
4038
- };
4039
- }, createNonEnumerableProperty = createNonEnumerableProperty$1, hasOwn = hasOwnProperty_1, wrapConstructor = function(NativeConstructor) {
4040
- var Wrapper = function(a, b, c) {
4041
- if (this instanceof Wrapper) {
4042
- switch (arguments.length) {
4043
- case 0:
4044
- return new NativeConstructor;
4444
+ CalloutIcon.displayName = "CalloutIcon";
4045
4445
 
4046
- case 1:
4047
- return new NativeConstructor(a);
4446
+ const CalloutMessage = forwardRef((({children: children, className: className = "", ...props}, ref) => jsx("div", {
4447
+ ref: ref,
4448
+ className: `c-callout__message ${className}`.trim(),
4449
+ ...props,
4450
+ children: children
4451
+ })));
4048
4452
 
4049
- case 2:
4050
- return new NativeConstructor(a, b);
4051
- }
4052
- return new NativeConstructor(a, b, c);
4053
- }
4054
- return apply(NativeConstructor, this, arguments);
4055
- };
4056
- return Wrapper.prototype = NativeConstructor.prototype, Wrapper;
4057
- }, _export = function(options, source) {
4058
- var FORCED, USE_NATIVE, VIRTUAL_PROTOTYPE, key, sourceProperty, targetProperty, nativeProperty, resultProperty, descriptor, TARGET = options.target, GLOBAL = options.global, STATIC = options.stat, PROTO = options.proto, nativeSource = GLOBAL ? globalThis$3 : STATIC ? globalThis$3[TARGET] : globalThis$3[TARGET] && globalThis$3[TARGET].prototype, target = GLOBAL ? path$1 : path$1[TARGET] || createNonEnumerableProperty(path$1, TARGET, {})[TARGET], targetPrototype = target.prototype;
4059
- for (key in source)
4060
- // contains in native
4061
- USE_NATIVE = !(FORCED = isForced(GLOBAL ? key : TARGET + (STATIC ? "." : "#") + key, options.forced)) && nativeSource && hasOwn(nativeSource, key),
4062
- targetProperty = target[key], USE_NATIVE && (nativeProperty = options.dontCallGetSet ? (descriptor = getOwnPropertyDescriptor(nativeSource, key)) && descriptor.value : nativeSource[key]),
4063
- // export native or implementation
4064
- sourceProperty = USE_NATIVE && nativeProperty ? nativeProperty : source[key], (FORCED || PROTO || typeof targetProperty != typeof sourceProperty) && (
4065
- // bind methods to global for calling from export context
4066
- resultProperty = options.bind && USE_NATIVE ? bind(sourceProperty, globalThis$3) : options.wrap && USE_NATIVE ? wrapConstructor(sourceProperty) : PROTO && isCallable$1(sourceProperty) ? uncurryThis$1(sourceProperty) : sourceProperty,
4067
- // add a flag to not completely full polyfills
4068
- (options.sham || sourceProperty && sourceProperty.sham || targetProperty && targetProperty.sham) && createNonEnumerableProperty(resultProperty, "sham", !0),
4069
- createNonEnumerableProperty(target, key, resultProperty), PROTO && (hasOwn(path$1, VIRTUAL_PROTOTYPE = TARGET + "Prototype") || createNonEnumerableProperty(path$1, VIRTUAL_PROTOTYPE, {}),
4070
- // export virtual prototype methods
4071
- createNonEnumerableProperty(path$1[VIRTUAL_PROTOTYPE], key, sourceProperty),
4072
- // export real prototype methods
4073
- options.real && targetPrototype && (FORCED || !targetPrototype[key]) && createNonEnumerableProperty(targetPrototype, key, sourceProperty)));
4074
- }, ceil = Math.ceil, floor = Math.floor, trunc = Math.trunc || function(x) {
4075
- var n = +x;
4076
- return (n > 0 ? floor : ceil)(n);
4077
- }, toIntegerOrInfinity$2 = function(argument) {
4078
- var number = +argument;
4079
- // eslint-disable-next-line no-self-compare -- NaN check
4080
- return number != number || 0 === number ? 0 : trunc(number);
4081
- }, toIntegerOrInfinity$1 = toIntegerOrInfinity$2, max = Math.max, min$1 = Math.min, toIntegerOrInfinity = toIntegerOrInfinity$2, min = Math.min, lengthOfArrayLike$2 = function(obj) {
4082
- return argument = obj.length, (len = toIntegerOrInfinity(argument)) > 0 ? min(len, 9007199254740991) : 0;
4083
- var argument, len;
4084
- }, toIndexedObject = toIndexedObject$2, lengthOfArrayLike$1 = lengthOfArrayLike$2, createMethod$1 = function(IS_INCLUDES) {
4085
- return function($this, el, fromIndex) {
4086
- var O = toIndexedObject($this), length = lengthOfArrayLike$1(O);
4087
- if (0 === length) return !IS_INCLUDES && -1;
4088
- var value, index = function(index, length) {
4089
- var integer = toIntegerOrInfinity$1(index);
4090
- return integer < 0 ? max(integer + length, 0) : min$1(integer, length);
4091
- }(fromIndex, length);
4092
- // Array#includes uses SameValueZero equality algorithm
4093
- // eslint-disable-next-line no-self-compare -- NaN check
4094
- if (IS_INCLUDES && el != el) {
4095
- for (;length > index; )
4096
- // eslint-disable-next-line no-self-compare -- NaN check
4097
- if ((value = O[index++]) != value) return !0;
4098
- // Array#indexOf ignores holes, Array#includes - not
4099
- } else for (;length > index; index++) if ((IS_INCLUDES || index in O) && O[index] === el) return IS_INCLUDES || index || 0;
4100
- return !IS_INCLUDES && -1;
4101
- };
4102
- }, $includes = [ createMethod$1(!0), createMethod$1(!1) ][0];
4453
+ CalloutMessage.displayName = "CalloutMessage";
4103
4454
 
4104
- // `Array.prototype.includes` method
4105
- // https://tc39.es/ecma262/#sec-array.prototype.includes
4106
- _export({
4107
- target: "Array",
4108
- proto: !0,
4109
- forced: fails$9((function() {
4110
- // eslint-disable-next-line es/no-array-prototype-includes -- detection
4111
- return !Array(1).includes();
4112
- }))
4113
- }, {
4114
- includes: function(el /* , fromIndex = 0 */) {
4115
- return $includes(this, el, arguments.length > 1 ? arguments[1] : void 0);
4116
- }
4117
- });
4455
+ const CalloutTitle = forwardRef((({children: children, className: className = "", ...props}, ref) => jsx("div", {
4456
+ ref: ref,
4457
+ className: `c-callout__title ${className}`.trim(),
4458
+ ...props,
4459
+ children: children
4460
+ })));
4118
4461
 
4119
- var globalThis$2 = globalThis_1, path = path$3, getBuiltInPrototypeMethod$3 = function(CONSTRUCTOR, METHOD) {
4120
- var Namespace = path[CONSTRUCTOR + "Prototype"], pureMethod = Namespace && Namespace[METHOD];
4121
- if (pureMethod) return pureMethod;
4122
- var NativeConstructor = globalThis$2[CONSTRUCTOR], NativePrototype = NativeConstructor && NativeConstructor.prototype;
4123
- return NativePrototype && NativePrototype[METHOD];
4124
- }, includes$4 = getBuiltInPrototypeMethod$3("Array", "includes"), isObject$1 = isObject$6, classof$3 = classofRaw$2, MATCH$1 = wellKnownSymbol$5("match"), $TypeError$1 = TypeError, test = {};
4462
+ CalloutTitle.displayName = "CalloutTitle";
4125
4463
 
4126
- test[wellKnownSymbol$5("toStringTag")] = "z";
4464
+ const CalloutText = forwardRef((({children: children, className: className = "", ...props}, ref) => jsx("div", {
4465
+ ref: ref,
4466
+ className: `c-callout__text ${className}`.trim(),
4467
+ ...props,
4468
+ children: children
4469
+ })));
4127
4470
 
4128
- var TO_STRING_TAG_SUPPORT = "[object z]" === String(test), isCallable = isCallable$8, classofRaw = classofRaw$2, TO_STRING_TAG = wellKnownSymbol$5("toStringTag"), $Object = Object, CORRECT_ARGUMENTS = "Arguments" === classofRaw(function() {
4129
- return arguments;
4130
- }()), classof$1 = TO_STRING_TAG_SUPPORT ? classofRaw : function(it) {
4131
- var O, tag, result;
4132
- return void 0 === it ? "Undefined" : null === it ? "Null" : "string" == typeof (tag = function(it, key) {
4133
- try {
4134
- return it[key];
4135
- } catch (error) {/* empty */}
4136
- }(O = $Object(it), TO_STRING_TAG)) ? tag : CORRECT_ARGUMENTS ? classofRaw(O) : "Object" === (result = classofRaw(O)) && isCallable(O.callee) ? "Arguments" : result;
4137
- }, $String = String, MATCH = wellKnownSymbol$5("match"), $$1 = _export, notARegExp = function(it) {
4138
- if (function(it) {
4139
- var isRegExp;
4140
- return isObject$1(it) && (void 0 !== (isRegExp = it[MATCH$1]) ? !!isRegExp : "RegExp" === classof$3(it));
4141
- }(it)) throw new $TypeError$1("The method doesn't accept regular expressions");
4142
- return it;
4143
- }, requireObjectCoercible = requireObjectCoercible$3, toString = function(argument) {
4144
- if ("Symbol" === classof$1(argument)) throw new TypeError("Cannot convert a Symbol value to a string");
4145
- return $String(argument);
4146
- }, stringIndexOf = functionUncurryThis("".indexOf);
4471
+ CalloutText.displayName = "CalloutText";
4147
4472
 
4148
- // `String.prototype.includes` method
4149
- // https://tc39.es/ecma262/#sec-string.prototype.includes
4150
- $$1({
4151
- target: "String",
4152
- proto: !0,
4153
- forced: !function(METHOD_NAME) {
4154
- var regexp = /./;
4155
- try {
4156
- "/./"[METHOD_NAME](regexp);
4157
- } catch (error1) {
4158
- try {
4159
- return regexp[MATCH] = !1, "/./"[METHOD_NAME](regexp);
4160
- } catch (error2) {/* empty */}
4161
- }
4162
- return !1;
4163
- }("includes")
4164
- }, {
4165
- includes: function(searchString /* , position = 0 */) {
4166
- return !!~stringIndexOf(toString(requireObjectCoercible(this)), toString(notARegExp(searchString)), arguments.length > 1 ? arguments[1] : void 0);
4167
- }
4168
- });
4473
+ const CalloutActions = forwardRef((({children: children, className: className = "", ...props}, ref) => jsx("div", {
4474
+ ref: ref,
4475
+ className: `c-callout__actions ${className}`.trim(),
4476
+ ...props,
4477
+ children: children
4478
+ })));
4169
4479
 
4170
- var includes$3 = getBuiltInPrototypeMethod$3("String", "includes"), isPrototypeOf$1 = objectIsPrototypeOf, arrayMethod = includes$4, stringMethod = includes$3, ArrayPrototype$1 = Array.prototype, StringPrototype = String.prototype;
4480
+ CalloutActions.displayName = "CalloutActions";
4171
4481
 
4172
- const _includesInstanceProperty = getDefaultExportFromCjs((function(it) {
4173
- var own = it.includes;
4174
- return it === ArrayPrototype$1 || isPrototypeOf$1(ArrayPrototype$1, it) && own === ArrayPrototype$1.includes ? arrayMethod : "string" == typeof it || it === StringPrototype || isPrototypeOf$1(StringPrototype, it) && own === StringPrototype.includes ? stringMethod : own;
4175
- })), Callout = ({title: title, children: children, icon: icon, variant: variant = "primary", onClose: onClose, actions: actions, compact: compact = !1, isToast: isToast = !1, glass: glass, className: className, style: style, ...props}) => {
4482
+ const CalloutCloseButton = forwardRef((({onClick: onClick, className: className = "", ...props}, ref) => jsx("button", {
4483
+ ref: ref,
4484
+ className: `c-callout__close-btn ${className}`.trim(),
4485
+ onClick: onClick,
4486
+ "aria-label": "Close",
4487
+ ...props,
4488
+ children: jsx(Icon, {
4489
+ name: "X",
4490
+ size: "md"
4491
+ })
4492
+ })));
4493
+
4494
+ CalloutCloseButton.displayName = "CalloutCloseButton";
4495
+
4496
+ // Wrapper for content (icon + message)
4497
+ const CalloutContent = forwardRef((({children: children, className: className = "", ...props}, ref) => jsx("div", {
4498
+ ref: ref,
4499
+ className: `c-callout__content ${className}`.trim(),
4500
+ ...props,
4501
+ children: children
4502
+ })));
4503
+
4504
+ CalloutContent.displayName = "CalloutContent";
4505
+
4506
+ const Callout = memo((({title: title, children: children, icon: icon, variant: variant = "primary", onClose: onClose, actions: actions, compact: compact = !1, isToast: isToast = !1, glass: glass, className: className, style: style, ...props}) => {
4176
4507
  const {generateCalloutClass: generateCalloutClass, handleClose: handleClose} =
4177
4508
  /**
4178
4509
  * Callout state and functionality
@@ -4202,10 +4533,7 @@ const _includesInstanceProperty = getDefaultExportFromCjs((function(it) {
4202
4533
  handler && handler();
4203
4534
  }
4204
4535
  };
4205
- }
4206
- /**
4207
- * Callout component for displaying important messages, notifications, or alerts
4208
- */ ({
4536
+ }({
4209
4537
  variant: variant,
4210
4538
  compact: compact,
4211
4539
  isToast: isToast,
@@ -4221,7 +4549,11 @@ const _includesInstanceProperty = getDefaultExportFromCjs((function(it) {
4221
4549
  return isToast ? (baseAttributes.role = "alert", baseAttributes["aria-live"] = "polite") : _includesInstanceProperty(_context = [ "warning", "error" ]).call(_context, variant) ? (baseAttributes.role = "alert",
4222
4550
  baseAttributes["aria-live"] = "assertive") : _includesInstanceProperty(_context2 = [ "info", "success" ]).call(_context2, variant) && (baseAttributes.role = "status",
4223
4551
  baseAttributes["aria-live"] = "polite"), baseAttributes;
4224
- }, calloutContent = jsxs(Fragment, {
4552
+ }, calloutContent = React.Children.toArray(children).some((child => {
4553
+ var _context3;
4554
+
4555
+ return React.isValidElement(child) && _includesInstanceProperty(_context3 = [ "CalloutIcon", "CalloutMessage", "CalloutTitle", "CalloutText", "CalloutActions", "CalloutContent" ]).call(_context3, child.type.displayName);
4556
+ })) ? children : jsxs(Fragment, {
4225
4557
  children: [ jsxs("div", {
4226
4558
  className: "c-callout__content",
4227
4559
  children: [ icon && jsx("div", {
@@ -4255,7 +4587,7 @@ const _includesInstanceProperty = getDefaultExportFromCjs((function(it) {
4255
4587
  // Default glass settings for callouts
4256
4588
  const defaultGlassProps = {
4257
4589
  displacementScale: 30,
4258
- cornerRadius: 8,
4590
+ borderRadius: 8,
4259
4591
  elasticity: 0
4260
4592
  }, glassProps = !0 === glass ? defaultGlassProps : {
4261
4593
  ...defaultGlassProps,
@@ -4277,7 +4609,7 @@ const _includesInstanceProperty = getDefaultExportFromCjs((function(it) {
4277
4609
  children: jsx("div", {
4278
4610
  className: "c-callout__glass-content",
4279
4611
  style: {
4280
- borderRadius: glassProps.cornerRadius
4612
+ borderRadius: glassProps.borderRadius
4281
4613
  },
4282
4614
  children: calloutContent
4283
4615
  })
@@ -4297,9 +4629,13 @@ const _includesInstanceProperty = getDefaultExportFromCjs((function(it) {
4297
4629
  style: style,
4298
4630
  children: calloutContent
4299
4631
  });
4300
- };
4632
+ }));
4301
4633
 
4302
- Callout.displayName = "Callout";
4634
+ Callout.displayName = "Callout",
4635
+ // Attach subcomponents
4636
+ Callout.Icon = CalloutIcon, Callout.Message = CalloutMessage, Callout.Title = CalloutTitle,
4637
+ Callout.Text = CalloutText, Callout.Actions = CalloutActions, Callout.CloseButton = CalloutCloseButton,
4638
+ Callout.Content = CalloutContent;
4303
4639
 
4304
4640
  const Card = React.memo( forwardRef((({
4305
4641
  // Variants
@@ -4952,12 +5288,22 @@ const _reduceInstanceProperty = getDefaultExportFromCjs((function(it) {
4952
5288
  left: 40
4953
5289
  }, config) => {
4954
5290
  if (!datasets || 0 === datasets.length) return null;
4955
- // Flatten all data points to find min/max values
4956
- const allDataPoints = datasets.flatMap((dataset => dataset.data));
4957
- if (0 === allDataPoints.length) return null;
4958
- const minValue = Math.min(...allDataPoints.map((point => point.value))), maxValue = Math.max(...allDataPoints.map((point => point.value))), valueRange = maxValue - minValue || 1, innerWidth = width - padding.left - padding.right, innerHeight = height - padding.top - padding.bottom;
4959
- return {
4960
- xScale: (index, dataLength = allDataPoints.length) => dataLength <= 1 ? padding.left + innerWidth / 2 : padding.left + index / (dataLength - 1) * innerWidth,
5291
+ // Calculate total points and min/max values efficiently avoiding spread operator
5292
+ let totalPoints = 0, minValue = 1 / 0, maxValue = -1 / 0, hasValidData = !1;
5293
+ for (const dataset of datasets) if (dataset.data) {
5294
+ totalPoints += dataset.data.length;
5295
+ const {min: min, max: max, hasValid: hasValid} = getDatasetBounds(dataset.data);
5296
+ hasValid && (min < minValue && (minValue = min), max > maxValue && (maxValue = max),
5297
+ hasValidData = !0);
5298
+ }
5299
+ if (0 === totalPoints) return null;
5300
+ // Handle case with no valid numeric data
5301
+ hasValidData || (minValue = 0, maxValue = 0);
5302
+ const valueRange = maxValue - minValue || 1, innerWidth = width - padding.left - padding.right, innerHeight = height - padding.top - padding.bottom;
5303
+ // Avoid division by zero
5304
+ // Apply padding
5305
+ return {
5306
+ xScale: (index, dataLength = totalPoints) => dataLength <= 1 ? padding.left + innerWidth / 2 : padding.left + index / (dataLength - 1) * innerWidth,
4961
5307
  yScale: value => padding.top + innerHeight - (value - minValue) / valueRange * innerHeight,
4962
5308
  minValue: minValue,
4963
5309
  maxValue: maxValue,
@@ -5012,6 +5358,29 @@ const _reduceInstanceProperty = getDefaultExportFromCjs((function(it) {
5012
5358
 
5013
5359
  /**
5014
5360
  * Hook for chart data processing and transformation
5361
+ */
5362
+ /**
5363
+ * Helper to calculate min/max values from a dataset efficiently
5364
+ * avoiding spread operator which can cause stack overflow on large arrays
5365
+ */
5366
+ function getDatasetBounds(data) {
5367
+ let min = 1 / 0, max = -1 / 0, hasValid = !1;
5368
+ if (data && data.length > 0) for (let i = 0; i < data.length; i++) {
5369
+ const point = data[i];
5370
+ if (point && "number" == typeof point.value) {
5371
+ const val = point.value;
5372
+ val < min && (min = val), val > max && (max = val), hasValid = !0;
5373
+ }
5374
+ }
5375
+ return {
5376
+ min: min,
5377
+ max: max,
5378
+ hasValid: hasValid
5379
+ };
5380
+ }
5381
+
5382
+ /**
5383
+ * Hook for managing chart toolbar state and generating chart-specific configurations
5015
5384
  */ const ChartToolbar = memo( forwardRef((({chartType: chartType = "line", groups: groups = [], enableDefaults: enableDefaults = !0, defaults: defaults = {
5016
5385
  refresh: !0,
5017
5386
  export: !0,
@@ -5432,11 +5801,7 @@ toolbarConfig: toolbarConfig, customToolbarActions: customToolbarActions, custom
5432
5801
  onZoomReset: handleZoomReset,
5433
5802
  onPanToggle: handlePanToggle,
5434
5803
  onReset: handleReset
5435
- })), [ onRefresh, onExport, handleFullscreenChange, handleZoomIn, handleZoomOut, handleZoomReset, handlePanToggle, handleReset ]), {state: toolbarState, handlers: toolbarHandlers, toolbarGroups: toolbarGroups} =
5436
- /**
5437
- * Hook for managing chart toolbar state and generating chart-specific configurations
5438
- */
5439
- function(chartType, config = {}, handlers = {}) {
5804
+ })), [ onRefresh, onExport, handleFullscreenChange, handleZoomIn, handleZoomOut, handleZoomReset, handlePanToggle, handleReset ]), {state: toolbarState, handlers: toolbarHandlers, toolbarGroups: toolbarGroups} = function(chartType, config = {}, handlers = {}) {
5440
5805
  const [state, setState] = useState({
5441
5806
  isFullscreen: !1,
5442
5807
  isExporting: !1,
@@ -5821,16 +6186,16 @@ toolbarConfig: toolbarConfig, customToolbarActions: customToolbarActions, custom
5821
6186
  aberrationIntensity: 1.5,
5822
6187
  elasticity: 0,
5823
6188
  // No elastic effect for charts
5824
- enableLiquidBlur: !1,
6189
+ withLiquidBlur: !1,
5825
6190
  // Keep it simple
5826
- enableBorderEffect: !0,
6191
+ withBorder: !0,
5827
6192
  mode: "standard",
5828
6193
  mouseContainer: chartContainerRef,
5829
6194
  reducedMotion: !1
5830
6195
  })), []), glassProps = useMemo((() => glass ? !0 === glass ? defaultChartGlassProps : {
5831
6196
  ...defaultChartGlassProps,
5832
6197
  ...glass
5833
- } : null), [ glass, defaultChartGlassProps ]), chartBorderRadius = useMemo((() => glassProps?.cornerRadius || void 0), [ glassProps?.cornerRadius ]), chartContextValue = useMemo((() => ({
6198
+ } : null), [ glass, defaultChartGlassProps ]), chartBorderRadius = useMemo((() => glassProps?.borderRadius || void 0), [ glassProps?.borderRadius ]), chartContextValue = useMemo((() => ({
5834
6199
  zoomLevel: zoomLevel,
5835
6200
  panOffset: panOffset,
5836
6201
  panEnabled: panEnabled,
@@ -5961,7 +6326,7 @@ toolbarConfig: toolbarConfig, customToolbarActions: customToolbarActions, custom
5961
6326
  }) ]
5962
6327
  }), wrappedChart = glassProps ? jsx(AtomixGlass, {
5963
6328
  ...glassProps,
5964
- cornerRadius: chartBorderRadius,
6329
+ borderRadius: chartBorderRadius,
5965
6330
  style: {
5966
6331
  width: "100%",
5967
6332
  height: "100%",
@@ -6014,7 +6379,13 @@ const ChartRenderer = memo( forwardRef((({datasets: datasets = [], config: conf
6014
6379
  // Get chart context (zoom/pan state from toolbar) - optional
6015
6380
  // Always call useContext to maintain consistent hook order
6016
6381
  const chartContext = useContext(ChartContext), {calculateScales: calculateScales, getChartColors: getChartColors} = useChart(), {processedData: processedData, isProcessing: isProcessing} = function(datasets, options) {
6017
- const [processedData, setProcessedData] = useState(datasets), [isProcessing, setIsProcessing] = useState(!1), {enableDecimation: enableDecimation = !1, maxDataPoints: maxDataPoints = 1e3, enableRealTime: enableRealTime = !1, realTimeInterval: realTimeInterval = 1e3} = options || {}, decimateData = useCallback(((data, maxPoints) => {
6382
+ const [processedData, setProcessedData] = useState(datasets), [isProcessing, setIsProcessing] = useState(!1), {enableDecimation: enableDecimation = !1, maxDataPoints: maxDataPoints = 1e3, enableRealTime: enableRealTime = !1, realTimeInterval: realTimeInterval = 1e3} = options || {}, lastDataSignature = useRef(""), getDatasetSignature = useCallback((data => data.map((d => `${d.label}:${JSON.stringify(d.data)}`)).join("|")), []);
6383
+ // Update signature when processedData changes (e.g. via props)
6384
+ useEffect((() => {
6385
+ lastDataSignature.current = getDatasetSignature(processedData);
6386
+ }), [ processedData, getDatasetSignature ]);
6387
+ // Data decimation for performance
6388
+ const decimateData = useCallback(((data, maxPoints) => {
6018
6389
  if (!enableDecimation || !data.length) return data;
6019
6390
  const dataLength = data[0]?.data?.length || 0;
6020
6391
  if (dataLength <= maxPoints) return data;
@@ -6034,10 +6405,17 @@ const ChartRenderer = memo( forwardRef((({datasets: datasets = [], config: conf
6034
6405
  }), []), calculateTrendLine = useCallback((values => {
6035
6406
  const n = values.length;
6036
6407
  if (n < 2) return values.map((() => null));
6037
- const xSum = _reduceInstanceProperty(values).call(values, ((sum, _, i) => sum + i), 0), ySum = _reduceInstanceProperty(values).call(values, ((sum, val) => sum + val), 0), slope = (n * _reduceInstanceProperty(values).call(values, ((sum, val, i) => sum + i * val), 0) - xSum * ySum) / (n * _reduceInstanceProperty(values).call(values, ((sum, _, i) => sum + i * i), 0) - xSum * xSum), intercept = (ySum - slope * xSum) / n;
6408
+ let xSum = 0, ySum = 0, xySum = 0, x2Sum = 0;
6409
+ for (let i = 0; i < n; i++) {
6410
+ const val = values[i], safeVal = "number" == typeof val ? val : 0;
6411
+ // Treat null/undefined as 0 to match original reduce behavior
6412
+ xSum += i, ySum += safeVal, xySum += i * safeVal, x2Sum += i * i;
6413
+ }
6414
+ const slope = (n * xySum - xSum * ySum) / (n * x2Sum - xSum * xSum), intercept = (ySum - slope * xSum) / n;
6038
6415
  return values.map(((_, i) => slope * i + intercept));
6039
6416
  }), []);
6040
- // Process data when datasets change
6417
+ // Moving average calculation
6418
+ // Process data when datasets change
6041
6419
  return useEffect((() => {
6042
6420
  setIsProcessing(!0), (async () => {
6043
6421
  let processed = [ ...datasets ];
@@ -6049,11 +6427,12 @@ const ChartRenderer = memo( forwardRef((({datasets: datasets = [], config: conf
6049
6427
  useEffect((() => {
6050
6428
  if (!enableRealTime) return;
6051
6429
  const interval = setInterval((() => {
6052
- setProcessedData((prev => [ ...prev ]));
6053
- // Trigger re-render for real-time updates
6054
- }), realTimeInterval);
6430
+ setProcessedData((prev =>
6431
+ // Only trigger update if signature changed
6432
+ getDatasetSignature(prev) === lastDataSignature.current ? prev : [ ...prev ]));
6433
+ }), realTimeInterval);
6055
6434
  return () => clearInterval(interval);
6056
- }), [ enableRealTime, realTimeInterval ]), {
6435
+ }), [ enableRealTime, realTimeInterval, getDatasetSignature ]), {
6057
6436
  processedData: processedData,
6058
6437
  isProcessing: isProcessing,
6059
6438
  decimateData: decimateData,
@@ -6074,12 +6453,12 @@ const ChartRenderer = memo( forwardRef((({datasets: datasets = [], config: conf
6074
6453
  */
6075
6454
  function(datasets, options) {
6076
6455
  const {enableVirtualization: enableVirtualization = !1, enableMemoization: enableMemoization = !0, debounceMs: debounceMs = 100} = options || {}, [isOptimizing, setIsOptimizing] = useState(!1), debounceRef = useRef(null), memoizedScales = useMemo((() => enableMemoization ? datasets.map((dataset => {
6077
- const values = dataset.data?.map((d => d.value)).filter((v => "number" == typeof v)) || [], validValues = values.length > 0 ? values : [ 0 ];
6456
+ const {min: min, max: max, hasValid: hasValid} = getDatasetBounds(dataset.data);
6078
6457
  return {
6079
6458
  label: dataset.label,
6080
6459
  dataLength: dataset.data?.length || 0,
6081
- minValue: Math.min(...validValues),
6082
- maxValue: Math.max(...validValues)
6460
+ minValue: hasValid ? min : 0,
6461
+ maxValue: hasValid ? max : 0
6083
6462
  };
6084
6463
  })) : null), [ datasets, enableMemoization ]), debouncedUpdate = useCallback((callback => {
6085
6464
  debounceRef.current && clearTimeout(debounceRef.current), debounceRef.current = setTimeout((() => {
@@ -6178,8 +6557,8 @@ const ChartRenderer = memo( forwardRef((({datasets: datasets = [], config: conf
6178
6557
  const getAccessibleDescription = useCallback((() => {
6179
6558
  if (!datasets.length) return "Empty chart";
6180
6559
  const datasetDescriptions = datasets.map(((dataset, i) => {
6181
- const dataCount = dataset.data?.length || 0, values = dataset.data?.map((d => d.value)).filter((v => "number" == typeof v)) || [], min = values.length > 0 ? Math.min(...values) : 0, max = values.length > 0 ? Math.max(...values) : 0;
6182
- return `Dataset ${i + 1}: ${dataset.label}, ${dataCount} points, range ${min} to ${max}`;
6560
+ const dataCount = dataset.data?.length || 0, {min: min, max: max, hasValid: hasValid} = getDatasetBounds(dataset.data), minVal = hasValid ? min : 0, maxVal = hasValid ? max : 0;
6561
+ return `Dataset ${i + 1}: ${dataset.label}, ${dataCount} points, range ${minVal} to ${maxVal}`;
6183
6562
  })).join(". ");
6184
6563
  return `Chart with ${datasets.length} datasets. ${datasetDescriptions}`;
6185
6564
  }), [ datasets ]);
@@ -8425,14 +8804,14 @@ const ScatterChart = memo( forwardRef((({datasets: datasets = [], config: confi
8425
8804
 
8426
8805
  ScatterChart.displayName = "ScatterChart";
8427
8806
 
8428
- const TreemapChart = memo( forwardRef((({data: data = [], algorithm: algorithm = "squarified", colorConfig: colorConfig = {
8807
+ const DEFAULT_COLOR_CONFIG = {
8429
8808
  scheme: "category"
8430
- }, labelConfig: labelConfig = {
8809
+ }, DEFAULT_LABEL_CONFIG = {
8431
8810
  showLabels: !0,
8432
8811
  minSize: 1e3,
8433
8812
  fontSize: 12,
8434
8813
  textColor: "white"
8435
- }, onDataPointClick: onDataPointClick, config: config = {}, ...props}, ref) => {
8814
+ }, DEFAULT_CONFIG = {}, TreemapChart = memo( forwardRef((({data: data = [], algorithm: algorithm = "squarified", colorConfig: colorConfig = DEFAULT_COLOR_CONFIG, labelConfig: labelConfig = DEFAULT_LABEL_CONFIG, onDataPointClick: onDataPointClick, config: config = DEFAULT_CONFIG, ...props}, ref) => {
8436
8815
  const [hoveredNode, setHoveredNode] = useState(null), [selectedNode, setSelectedNode] = useState(null);
8437
8816
  useState({
8438
8817
  x: 0,
@@ -8544,87 +8923,87 @@ const TreemapChart = memo( forwardRef((({data: data = [], algorithm: algorithm
8544
8923
  remainingHeight -= rowHeight), currentRow = [];
8545
8924
  }
8546
8925
  }
8547
- }), []);
8926
+ }), []), renderContent = useCallback((({scales: scales, colors: colors, datasets: renderedDatasets, handlers: handlers, hoveredPoint: hoveredPoint}) => {
8927
+ if (!data.length) return null;
8928
+ // Calculate available space with padding
8929
+ const availableWidth = scales.width - 40, availableHeight = scales.height - 40, leafNodes = data.filter((item => !item.children || 0 === item.children.length));
8930
+ if (!leafNodes.length) return null;
8931
+ const totalValue = _reduceInstanceProperty(leafNodes).call(leafNodes, ((sum, node) => sum + node.value), 0), treemapNodes = leafNodes.map(((item, index) => ({
8932
+ id: item.id,
8933
+ label: item.label,
8934
+ value: item.value,
8935
+ color: generateColor(item, 0, index) || "transparent",
8936
+ x: 0,
8937
+ // Will be calculated by squarify
8938
+ y: 0,
8939
+ // Will be calculated by squarify
8940
+ width: 0,
8941
+ // Will be calculated by squarify
8942
+ height: 0,
8943
+ // Will be calculated by squarify
8944
+ depth: 0,
8945
+ children: [],
8946
+ originalData: item
8947
+ })));
8948
+ // Create treemap nodes with proper dimensions
8949
+ // Apply squarified algorithm to layout nodes proportionally by value
8950
+ if ("squarified" === algorithm && totalValue > 0) squarify(treemapNodes, 20, 20, availableWidth, availableHeight); else {
8951
+ // Fallback: simple grid layout (equal sizes)
8952
+ const cols = Math.ceil(Math.sqrt(leafNodes.length)), rows = Math.ceil(leafNodes.length / cols), nodeWidth = availableWidth / cols, nodeHeight = availableHeight / rows;
8953
+ treemapNodes.forEach(((node, index) => {
8954
+ const col = index % cols, row = Math.floor(index / cols);
8955
+ node.x = 20 + col * nodeWidth, node.y = 20 + row * nodeHeight, node.width = nodeWidth,
8956
+ node.height = nodeHeight;
8957
+ }));
8958
+ }
8959
+ return jsx(Fragment, {
8960
+ children: treemapNodes.map((node => {
8961
+ const isHovered = hoveredNode === node, isSelected = selectedNode === node, area = node.width * node.height, showLabel = labelConfig.showLabels && area >= (labelConfig.minSize || 1e3);
8962
+ return jsxs("g", {
8963
+ children: [ jsx("rect", {
8964
+ x: node.x,
8965
+ y: node.y,
8966
+ width: node.width,
8967
+ height: node.height,
8968
+ fill: node.color,
8969
+ className: `c-chart__treemap-node ${isHovered ? "c-chart__treemap-node--hovered" : ""} ${isSelected ? "c-chart__treemap-node--selected" : ""}`,
8970
+ onClick: () => {
8971
+ setSelectedNode(node), handlers.onDataPointClick?.(node.originalData, 0, 0);
8972
+ },
8973
+ onMouseEnter: e => {
8974
+ setHoveredNode(node);
8975
+ const rect = e.currentTarget.getBoundingClientRect();
8976
+ handlers.onPointHover(0, 0, node.x, node.y, rect.left + rect.width / 2, rect.top + rect.height / 2);
8977
+ },
8978
+ onMouseLeave: () => {
8979
+ setHoveredNode(null), handlers.onPointLeave();
8980
+ }
8981
+ }), showLabel && jsx("text", {
8982
+ x: node.x + node.width / 2,
8983
+ y: node.y + node.height / 2,
8984
+ textAnchor: "middle",
8985
+ dominantBaseline: "middle",
8986
+ className: "c-chart__treemap-label",
8987
+ style: {
8988
+ fontSize: labelConfig.fontSize,
8989
+ fill: labelConfig.textColor
8990
+ },
8991
+ children: node.label
8992
+ }) ]
8993
+ }, node.id);
8994
+ }))
8995
+ });
8996
+ }), [ data, algorithm, generateColor, squarify, labelConfig, hoveredNode, selectedNode ]), datasets = useMemo((() => [ {
8997
+ label: "Treemap Data",
8998
+ data: data
8999
+ } ]), [ data ]);
8548
9000
  // Squarified treemap algorithm
8549
9001
  return jsx(BaseChart, {
8550
9002
  ref: ref,
8551
9003
  type: "treemap",
8552
- datasets: [ {
8553
- label: "Treemap Data",
8554
- data: data
8555
- } ],
9004
+ datasets: datasets,
8556
9005
  config: config,
8557
- renderContent: ({scales: scales, colors: colors, datasets: renderedDatasets, handlers: handlers, hoveredPoint: hoveredPoint}) => {
8558
- if (!data.length) return null;
8559
- // Calculate available space with padding
8560
- const availableWidth = scales.width - 40, availableHeight = scales.height - 40, leafNodes = data.filter((item => !item.children || 0 === item.children.length));
8561
- if (!leafNodes.length) return null;
8562
- const totalValue = _reduceInstanceProperty(leafNodes).call(leafNodes, ((sum, node) => sum + node.value), 0), treemapNodes = leafNodes.map(((item, index) => ({
8563
- id: item.id,
8564
- label: item.label,
8565
- value: item.value,
8566
- color: generateColor(item, 0, index) || "transparent",
8567
- x: 0,
8568
- // Will be calculated by squarify
8569
- y: 0,
8570
- // Will be calculated by squarify
8571
- width: 0,
8572
- // Will be calculated by squarify
8573
- height: 0,
8574
- // Will be calculated by squarify
8575
- depth: 0,
8576
- children: [],
8577
- originalData: item
8578
- })));
8579
- // Create treemap nodes with proper dimensions
8580
- // Apply squarified algorithm to layout nodes proportionally by value
8581
- if ("squarified" === algorithm && totalValue > 0) squarify(treemapNodes, 20, 20, availableWidth, availableHeight); else {
8582
- // Fallback: simple grid layout (equal sizes)
8583
- const cols = Math.ceil(Math.sqrt(leafNodes.length)), rows = Math.ceil(leafNodes.length / cols), nodeWidth = availableWidth / cols, nodeHeight = availableHeight / rows;
8584
- treemapNodes.forEach(((node, index) => {
8585
- const col = index % cols, row = Math.floor(index / cols);
8586
- node.x = 20 + col * nodeWidth, node.y = 20 + row * nodeHeight, node.width = nodeWidth,
8587
- node.height = nodeHeight;
8588
- }));
8589
- }
8590
- return jsx(Fragment, {
8591
- children: treemapNodes.map((node => {
8592
- const isHovered = hoveredNode === node, isSelected = selectedNode === node, area = node.width * node.height, showLabel = labelConfig.showLabels && area >= (labelConfig.minSize || 1e3);
8593
- return jsxs("g", {
8594
- children: [ jsx("rect", {
8595
- x: node.x,
8596
- y: node.y,
8597
- width: node.width,
8598
- height: node.height,
8599
- fill: node.color,
8600
- className: `c-chart__treemap-node ${isHovered ? "c-chart__treemap-node--hovered" : ""} ${isSelected ? "c-chart__treemap-node--selected" : ""}`,
8601
- onClick: () => {
8602
- setSelectedNode(node), handlers.onDataPointClick?.(node.originalData, 0, 0);
8603
- },
8604
- onMouseEnter: e => {
8605
- setHoveredNode(node);
8606
- const rect = e.currentTarget.getBoundingClientRect();
8607
- handlers.onPointHover(0, 0, node.x, node.y, rect.left + rect.width / 2, rect.top + rect.height / 2);
8608
- },
8609
- onMouseLeave: () => {
8610
- setHoveredNode(null), handlers.onPointLeave();
8611
- }
8612
- }), showLabel && jsx("text", {
8613
- x: node.x + node.width / 2,
8614
- y: node.y + node.height / 2,
8615
- textAnchor: "middle",
8616
- dominantBaseline: "middle",
8617
- className: "c-chart__treemap-label",
8618
- style: {
8619
- fontSize: labelConfig.fontSize,
8620
- fill: labelConfig.textColor
8621
- },
8622
- children: node.label
8623
- }) ]
8624
- }, node.id);
8625
- }))
8626
- });
8627
- },
9006
+ renderContent: renderContent,
8628
9007
  onDataPointClick: onDataPointClick,
8629
9008
  interactive: !0,
8630
9009
  ...props
@@ -9312,7 +9691,7 @@ const DOTS = "...", range = (start, end) => {
9312
9691
  blurAmount: 1,
9313
9692
  saturation: 160,
9314
9693
  aberrationIntensity: .5,
9315
- cornerRadius: 8,
9694
+ borderRadius: 8,
9316
9695
  mode: "shader"
9317
9696
  }, glassProps = !0 === glass ? defaultGlassProps : {
9318
9697
  ...defaultGlassProps,
@@ -9383,7 +9762,7 @@ const Checkbox = React.memo( forwardRef((({label: label, checked: checked, onCh
9383
9762
  blurAmount: 1,
9384
9763
  saturation: 160,
9385
9764
  aberrationIntensity: .3,
9386
- cornerRadius: 6,
9765
+ borderRadius: 6,
9387
9766
  mode: "shader"
9388
9767
  }, glassProps = !0 === glass ? defaultGlassProps : {
9389
9768
  ...defaultGlassProps,
@@ -9405,7 +9784,38 @@ const DropdownContext = createContext({
9405
9784
  close: () => {},
9406
9785
  id: "",
9407
9786
  trigger: "click"
9408
- }), DropdownItem = memo((({children: children, href: href, active: active = !1, disabled: disabled = !1, icon: icon, onClick: onClick, className: className = "", LinkComponent: LinkComponent, ...props}) => {
9787
+ }), DropdownMenu = forwardRef((({children: children, className: className = "", ...props}, ref) => {
9788
+ const {glass: glass} = useContext(DropdownStyleContext);
9789
+ // We need to access glass prop here?
9790
+ // Wait, the original code wrapped <ul> in Context Provider.
9791
+ // And applied glass wrapper around <ul>.
9792
+ // If we use Compound Component, DropdownMenu should be the list.
9793
+ return jsx("ul", {
9794
+ ref: ref,
9795
+ className: `c-dropdown__menu ${glass ? "c-dropdown__menu--glass" : ""} ${className}`.trim(),
9796
+ ...props,
9797
+ children: children
9798
+ });
9799
+ }));
9800
+
9801
+ // Compound Components
9802
+ DropdownMenu.displayName = "DropdownMenu";
9803
+
9804
+ const DropdownTrigger = forwardRef((({children: children, className: className = "", onClick: onClick, onKeyDown: onKeyDown, ...props}, ref) => jsx("div", {
9805
+ ref: ref,
9806
+ className: `c-dropdown__toggle ${className}`.trim(),
9807
+ onClick: onClick,
9808
+ onKeyDown: onKeyDown,
9809
+ ...props,
9810
+ children: children
9811
+ })));
9812
+
9813
+ DropdownTrigger.displayName = "DropdownTrigger";
9814
+
9815
+ /**
9816
+ * DropdownItem component for menu items
9817
+ */
9818
+ const DropdownItem = memo((({children: children, href: href, active: active = !1, disabled: disabled = !1, icon: icon, onClick: onClick, className: className = "", LinkComponent: LinkComponent, ...props}) => {
9409
9819
  const {close: close} = useContext(DropdownContext), handleClick = e => {
9410
9820
  disabled ? e.preventDefault() : (onClick && onClick(e),
9411
9821
  // Always close the dropdown when an item is clicked
@@ -9447,7 +9857,7 @@ const DropdownContext = createContext({
9447
9857
  }))), DropdownHeader = memo((({children: children, className: className = ""}) => jsx("li", {
9448
9858
  className: `c-dropdown__header ${className}`,
9449
9859
  children: children
9450
- }))), Dropdown = memo((({children: children, menu: menu, placement: placement = "bottom-start", trigger: trigger = "click", offset: offset = DROPDOWN.DEFAULTS.OFFSET, isOpen: controlledIsOpen, onOpenChange: onOpenChange, closeOnClickOutside: closeOnClickOutside = !0, closeOnEscape: closeOnEscape = !0, maxHeight: maxHeight, minWidth: minWidth = DROPDOWN.DEFAULTS.MIN_WIDTH, variant: variant, className: className = "", style: style, glass: glass, ...props}) => {
9860
+ }))), DropdownStyleContext = createContext({}), Dropdown = memo((({children: children, menu: menu, placement: placement = "bottom-start", trigger: trigger = "click", offset: offset = DROPDOWN.DEFAULTS.OFFSET, isOpen: controlledIsOpen, onOpenChange: onOpenChange, closeOnClickOutside: closeOnClickOutside = !0, closeOnEscape: closeOnEscape = !0, maxHeight: maxHeight, minWidth: minWidth = DROPDOWN.DEFAULTS.MIN_WIDTH, variant: variant, className: className = "", style: style, glass: glass, ...props}) => {
9451
9861
  // Set up controlled vs uncontrolled state
9452
9862
  const [uncontrolledIsOpen, setUncontrolledIsOpen] = useState(!1), isControlled = void 0 !== controlledIsOpen, isOpen = isControlled ? controlledIsOpen : uncontrolledIsOpen, dropdownRef = useRef(null), toggleRef = useRef(null), menuRef = useRef(null), dropdownId = useRef(`dropdown-${Math.random().toString(36).substring(2, 9)}`).current, setIsOpen = useCallback((nextIsOpen => {
9453
9863
  isControlled || setUncontrolledIsOpen(nextIsOpen), onOpenChange && onOpenChange(nextIsOpen);
@@ -9510,20 +9920,59 @@ const DropdownContext = createContext({
9510
9920
  "hover" === trigger && setIsOpen(!0);
9511
9921
  }), [ trigger, setIsOpen ]), dropdownClasses = [ "c-dropdown", "click" === trigger ? "c-dropdown--onclick" : "", variant ? `c-dropdown--${variant}` : "", isOpen ? "is-open" : "", glass ? "c-dropdown--glass" : "", className ].filter(Boolean).join(" "), menuStyleProps = {};
9512
9922
  // Event handlers
9513
- maxHeight && (menuStyleProps.maxHeight = maxHeight), void 0 !== minWidth && (menuStyleProps.minWidth = "number" == typeof minWidth ? `${minWidth}px` : minWidth);
9923
+ let triggerContent, menuContentNode;
9924
+ maxHeight && (menuStyleProps.maxHeight = maxHeight), void 0 !== minWidth && (menuStyleProps.minWidth = "number" == typeof minWidth ? `${minWidth}px` : minWidth),
9925
+ React.Children.toArray(children).some((child => {
9926
+ var _context;
9927
+
9928
+ return React.isValidElement(child) && _includesInstanceProperty(_context = [ "DropdownTrigger", "DropdownMenu" ]).call(_context, child.type.displayName);
9929
+ })) ?
9930
+ // Find Trigger and Menu in children
9931
+ React.Children.forEach(children, (child => {
9932
+ React.isValidElement(child) && ("DropdownTrigger" === child.type.displayName ? triggerContent = React.cloneElement(child, {
9933
+ ref: toggleRef,
9934
+ onClick: e => {
9935
+ handleToggleClick(e), child.props.onClick?.(e);
9936
+ },
9937
+ onKeyDown: e => {
9938
+ handleToggleKeyDown(e), child.props.onKeyDown?.(e);
9939
+ },
9940
+ "aria-haspopup": "menu",
9941
+ "aria-expanded": isOpen,
9942
+ "aria-controls": dropdownId,
9943
+ tabIndex: 0
9944
+ }) : "DropdownMenu" === child.type.displayName && (menuContentNode = child));
9945
+ })) : (
9946
+ // Legacy mode
9947
+ triggerContent = jsx("div", {
9948
+ ref: toggleRef,
9949
+ className: "c-dropdown__toggle",
9950
+ onClick: handleToggleClick,
9951
+ onKeyDown: handleToggleKeyDown,
9952
+ "aria-haspopup": "menu",
9953
+ "aria-expanded": isOpen,
9954
+ "aria-controls": dropdownId,
9955
+ tabIndex: 0,
9956
+ children: children
9957
+ }), menuContentNode = jsx("ul", {
9958
+ className: "c-dropdown__menu " + (glass ? "c-dropdown__menu--glass" : ""),
9959
+ children: menu
9960
+ }));
9514
9961
  const menuContent = jsx("div", {
9515
9962
  className: "c-dropdown__menu-inner",
9516
9963
  style: menuStyleProps,
9517
- children: jsx(DropdownContext.Provider, {
9964
+ children: jsx(DropdownStyleContext.Provider, {
9518
9965
  value: {
9519
- isOpen: isOpen,
9520
- close: close,
9521
- id: dropdownId,
9522
- trigger: trigger
9966
+ glass: glass
9523
9967
  },
9524
- children: jsx("ul", {
9525
- className: "c-dropdown__menu " + (glass ? "c-dropdown__menu--glass" : ""),
9526
- children: menu
9968
+ children: jsx(DropdownContext.Provider, {
9969
+ value: {
9970
+ isOpen: isOpen,
9971
+ close: close,
9972
+ id: dropdownId,
9973
+ trigger: trigger
9974
+ },
9975
+ children: menuContentNode
9527
9976
  })
9528
9977
  })
9529
9978
  });
@@ -9533,17 +9982,7 @@ const DropdownContext = createContext({
9533
9982
  style: style,
9534
9983
  onMouseEnter: "hover" === trigger ? handleHoverOpen : void 0,
9535
9984
  ...props,
9536
- children: [ jsx("div", {
9537
- ref: toggleRef,
9538
- className: "c-dropdown__toggle",
9539
- onClick: handleToggleClick,
9540
- onKeyDown: handleToggleKeyDown,
9541
- "aria-haspopup": "menu",
9542
- "aria-expanded": isOpen,
9543
- "aria-controls": dropdownId,
9544
- tabIndex: 0,
9545
- children: children
9546
- }), jsx("div", {
9985
+ children: [ triggerContent, jsx("div", {
9547
9986
  ref: menuRef,
9548
9987
  id: dropdownId,
9549
9988
  className: `c-dropdown__menu-wrapper c-dropdown__menu-wrapper--${placement} ${isOpen ? "is-open" : ""} ${glass ? "is-glass" : ""}`,
@@ -9571,9 +10010,9 @@ const DropdownContext = createContext({
9571
10010
  }));
9572
10011
 
9573
10012
  /**
9574
- * DropdownItem component for menu items
9575
- */ Dropdown.displayName = "Dropdown", DropdownItem.displayName = "DropdownItem",
9576
- DropdownDivider.displayName = "DropdownDivider", DropdownHeader.displayName = "DropdownHeader";
10013
+ * DropdownDivider component for separating groups of items
10014
+ */ Dropdown.displayName = "Dropdown", Dropdown.Trigger = DropdownTrigger, Dropdown.Menu = DropdownMenu,
10015
+ Dropdown.Item = DropdownItem, Dropdown.Divider = DropdownDivider, Dropdown.Header = DropdownHeader;
9577
10016
 
9578
10017
  /**
9579
10018
  * DataTable - A flexible and accessible data table component with advanced features
@@ -10662,53 +11101,50 @@ function useEdgePanel(initialProps) {
10662
11101
  };
10663
11102
  }
10664
11103
 
10665
- /**
10666
- * EdgePanel - A sliding panel component that appears from any screen edge
10667
- *
10668
- * @component
10669
- * @example
10670
- * ```tsx
10671
- * // Basic usage
10672
- * <EdgePanel
10673
- * title="My Panel"
10674
- * isOpen={isOpen}
10675
- * onOpenChange={setIsOpen}
10676
- * position="start"
10677
- * >
10678
- * <p>Panel content</p>
10679
- * </EdgePanel>
10680
- *
10681
- * // With glass effect
10682
- * <EdgePanel
10683
- * title="Glass Panel"
10684
- * isOpen={isOpen}
10685
- * onOpenChange={setIsOpen}
10686
- * position="end"
10687
- * glass={true}
10688
- * >
10689
- * <p>Panel with glass morphism</p>
10690
- * </EdgePanel>
10691
- *
10692
- * // With custom glass configuration
10693
- * <EdgePanel
10694
- * title="Custom Glass"
10695
- * isOpen={isOpen}
10696
- * onOpenChange={setIsOpen}
10697
- * position="start"
10698
- * glass={{
10699
- * mode: 'shader',
10700
- * shaderVariant: 'liquidGlass',
10701
- * displacementScale: 70,
10702
- * blurAmount: 1.8,
10703
- * saturation: 170,
10704
- * }}
10705
- * >
10706
- * <p>Panel with custom glass effect</p>
10707
- * </EdgePanel>
10708
- * ```
10709
- */ DatePicker.displayName = "DatePicker";
11104
+ // Subcomponents
11105
+ DatePicker.displayName = "DatePicker";
11106
+
11107
+ const EdgePanelHeader = forwardRef((({children: children, className: className = "", ...props}, ref) => jsx("div", {
11108
+ ref: ref,
11109
+ className: `c-edge-panel__header ${className}`.trim(),
11110
+ ...props,
11111
+ children: children
11112
+ })));
11113
+
11114
+ EdgePanelHeader.displayName = "EdgePanelHeader";
11115
+
11116
+ const EdgePanelBody = forwardRef((({children: children, className: className = "", ...props}, ref) => jsx("div", {
11117
+ ref: ref,
11118
+ className: `c-edge-panel__body ${className}`.trim(),
11119
+ ...props,
11120
+ children: children
11121
+ })));
11122
+
11123
+ EdgePanelBody.displayName = "EdgePanelBody";
11124
+
11125
+ const EdgePanelFooter = forwardRef((({children: children, className: className = "", ...props}, ref) => jsx("div", {
11126
+ ref: ref,
11127
+ className: `c-edge-panel__footer ${className}`.trim(),
11128
+ ...props,
11129
+ children: children
11130
+ })));
11131
+
11132
+ EdgePanelFooter.displayName = "EdgePanelFooter";
11133
+
11134
+ const EdgePanelCloseButton = forwardRef((({className: className = "", onClick: onClick, ...props}, ref) => jsx("button", {
11135
+ ref: ref,
11136
+ className: `c-edge-panel__close c-btn c-btn--icon ${className}`.trim(),
11137
+ onClick: onClick,
11138
+ "aria-label": "Close panel",
11139
+ ...props,
11140
+ children: jsx(Icon, {
11141
+ name: "X"
11142
+ })
11143
+ })));
11144
+
11145
+ EdgePanelCloseButton.displayName = "EdgePanelCloseButton";
10710
11146
 
10711
- const EdgePanel = ({title: title, children: children, position: position = "start", mode: mode = "slide", isOpen: isOpen = !1, onOpenChange: onOpenChange, backdrop: backdrop = !0, closeOnBackdropClick: closeOnBackdropClick = !0, closeOnEscape: closeOnEscape = !0, className: className = "", style: style, glass: glass}) => {
11147
+ const EdgePanel = memo((({title: title, children: children, position: position = "start", mode: mode = "slide", isOpen: isOpen = !1, onOpenChange: onOpenChange, backdrop: backdrop = !0, closeOnBackdropClick: closeOnBackdropClick = !0, closeOnEscape: closeOnEscape = !0, className: className = "", style: style, glass: glass}) => {
10712
11148
  const {isOpen: isOpenState, containerRef: containerRef, backdropRef: backdropRef, generateEdgePanelClass: generateEdgePanelClass, closePanel: closePanel, handleBackdropClick: handleBackdropClick} = useEdgePanel({
10713
11149
  position: position,
10714
11150
  mode: mode,
@@ -10725,13 +11161,23 @@ const EdgePanel = ({title: title, children: children, position: position = "star
10725
11161
  });
10726
11162
  // Moved useRef outside of conditional rendering to fix hook order issue
10727
11163
  // If not open and not controlled by parent, don't render
11164
+ // Note: useEdgePanel manages internal state if onOpenChange is not provided?
11165
+ // Looking at useEdgePanel (implied): it seems to return isOpenState.
11166
+ // If we return null here, animations might be cut off.
11167
+ // Usually EdgePanel/Drawer should stay mounted but hidden or conditionally mounted.
11168
+ // The original code returned null if !isOpenState && isOpen === false.
11169
+ // Let's keep that logic.
10728
11170
  if (!isOpenState && !1 === isOpen) return null;
10729
11171
  const defaultGlassProps = {
10730
11172
  elasticity: 0
10731
11173
  }, glassProps = !0 === glass ? defaultGlassProps : {
10732
11174
  ...defaultGlassProps,
10733
11175
  ...glass
10734
- }, panelContent = jsxs(Fragment, {
11176
+ }, panelContent = React.Children.toArray(children).some((child => {
11177
+ var _context;
11178
+
11179
+ return React.isValidElement(child) && _includesInstanceProperty(_context = [ "EdgePanelHeader", "EdgePanelBody", "EdgePanelFooter" ]).call(_context, child.type.displayName);
11180
+ })) ? children : jsxs(Fragment, {
10735
11181
  children: [ jsxs("div", {
10736
11182
  className: "c-edge-panel__header",
10737
11183
  children: [ jsx("h4", {
@@ -10774,7 +11220,7 @@ const EdgePanel = ({title: title, children: children, position: position = "star
10774
11220
  }) : panelContent
10775
11221
  }) ]
10776
11222
  });
10777
- };
11223
+ }));
10778
11224
 
10779
11225
  /**
10780
11226
  * Form state and functionality
@@ -10808,7 +11254,8 @@ function useForm(initialProps) {
10808
11254
 
10809
11255
  /**
10810
11256
  * Form - A component for creating form layouts
10811
- */ EdgePanel.displayName = "EdgePanel";
11257
+ */ EdgePanel.displayName = "EdgePanel", EdgePanel.Header = EdgePanelHeader, EdgePanel.Body = EdgePanelBody,
11258
+ EdgePanel.Footer = EdgePanelFooter, EdgePanel.CloseButton = EdgePanelCloseButton;
10812
11259
 
10813
11260
  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"}) => {
10814
11261
  const {generateFormClass: generateFormClass, handleSubmit: handleSubmit, handleReset: handleReset} = useForm({
@@ -10988,7 +11435,7 @@ const Input = memo( forwardRef((({type: type = "text", value: value, defaultVal
10988
11435
  blurAmount: 1,
10989
11436
  saturation: 180,
10990
11437
  aberrationIntensity: .2,
10991
- cornerRadius: 12,
11438
+ borderRadius: 12,
10992
11439
  mode: "shader"
10993
11440
  }, glassProps = !0 === glass ? defaultGlassProps : {
10994
11441
  ...defaultGlassProps,
@@ -11028,7 +11475,7 @@ function useHero(initialProps) {
11028
11475
  * @returns Slider state and methods
11029
11476
  */
11030
11477
  function(config) {
11031
- const {slides: slides, autoplay: autoplay, loop: loop = !0, transition: transition = "fade", transitionDuration: transitionDuration = 1e3} = config, [currentIndex, setCurrentIndex] = useState(0), [isTransitioning, setIsTransitioning] = useState(!1), autoplayRef = useRef(null), isPausedRef = useRef(!1), slideRefs = useMemo((() => slides.map((() => React.createRef()))), [ slides.length ]), videoRefs = useMemo((() => slides.map((() => React.createRef()))), [ slides.length ]), handleSlideTransition = useCallback((nextIndex => {
11478
+ const {slides: slides, autoplay: autoplay, loop: loop = !0, transition: transition = "fade", transitionDuration: transitionDuration = 1e3} = config, [currentIndex, setCurrentIndex] = useState(0), [isTransitioning, setIsTransitioning] = useState(!1), autoplayRef = useRef(null), isPausedRef = useRef(!1), callbackRef = useRef(), slideRefs = useMemo((() => slides.map((() => React.createRef()))), [ slides.length ]), videoRefs = useMemo((() => slides.map((() => React.createRef()))), [ slides.length ]), handleSlideTransition = useCallback((nextIndex => {
11032
11479
  if (nextIndex === currentIndex || isTransitioning) return;
11033
11480
  if (nextIndex < 0 || nextIndex >= slides.length) return;
11034
11481
  setIsTransitioning(!0),
@@ -11049,7 +11496,17 @@ function useHero(initialProps) {
11049
11496
  let nextIndex;
11050
11497
  nextIndex = loop ? (currentIndex + 1) % slides.length : Math.min(currentIndex + 1, slides.length - 1),
11051
11498
  handleSlideTransition(nextIndex);
11052
- }), [ currentIndex, slides.length, loop, handleSlideTransition ]), pauseAutoplay = useCallback((() => {
11499
+ }), [ currentIndex, slides.length, loop, handleSlideTransition ]);
11500
+ // Update callbackRef whenever nextSlide or isTransitioning changes
11501
+ useEffect((() => {
11502
+ callbackRef.current = () => {
11503
+ isPausedRef.current || isTransitioning || nextSlide();
11504
+ };
11505
+ }), [ nextSlide, isTransitioning ]);
11506
+ /**
11507
+ * Pause autoplay
11508
+ */
11509
+ const pauseAutoplay = useCallback((() => {
11053
11510
  isPausedRef.current = !0, autoplayRef.current && (clearInterval(autoplayRef.current),
11054
11511
  autoplayRef.current = null);
11055
11512
  }), []), resumeAutoplay = useCallback((() => {
@@ -11058,24 +11515,26 @@ function useHero(initialProps) {
11058
11515
  const delay = "object" == typeof autoplay ? autoplay.delay : 3e3;
11059
11516
  // Restart autoplay
11060
11517
  autoplayRef.current || (autoplayRef.current = setInterval((() => {
11061
- isPausedRef.current || isTransitioning || nextSlide();
11518
+ callbackRef.current && callbackRef.current();
11062
11519
  }), delay));
11063
11520
  }
11064
- }), [ autoplay, slides.length, nextSlide, isTransitioning ]);
11521
+ }), [ autoplay, slides.length ]);
11522
+ /**
11523
+ * Resume autoplay
11524
+ */
11065
11525
  // Autoplay effect
11066
11526
  return useEffect((() => {
11067
11527
  if (!autoplay || slides.length <= 1) return;
11068
11528
  const delay = "object" == typeof autoplay ? autoplay.delay : 3e3;
11069
- return "object" == typeof autoplay && autoplay.pauseOnHover,
11070
11529
  // Clear any existing interval
11071
- autoplayRef.current && (clearInterval(autoplayRef.current), autoplayRef.current = null),
11530
+ return autoplayRef.current && (clearInterval(autoplayRef.current), autoplayRef.current = null),
11072
11531
  // Start autoplay if not paused
11073
11532
  isPausedRef.current || (autoplayRef.current = setInterval((() => {
11074
- isPausedRef.current || isTransitioning || nextSlide();
11533
+ callbackRef.current && callbackRef.current();
11075
11534
  }), delay)), () => {
11076
11535
  autoplayRef.current && (clearInterval(autoplayRef.current), autoplayRef.current = null);
11077
11536
  };
11078
- }), [ autoplay, slides.length, nextSlide, isTransitioning ]),
11537
+ }), [ autoplay, slides.length ]),
11079
11538
  // Initialize first video if needed
11080
11539
  useEffect((() => {
11081
11540
  if (slides.length > 0 && "video" === slides[currentIndex]?.type) {
@@ -12076,7 +12535,14 @@ function useTodo(initialProps) {
12076
12535
  }
12077
12536
 
12078
12537
  function useSlider(options) {
12079
- const {slides: slides, slidesToShow: slidesToShow = 1, spaceBetween: spaceBetween = 0, loop: loop = !1, initialSlide: initialSlide = 0, direction: direction = "horizontal", speed: speed = 300, allowTouchMove: allowTouchMove = !0, threshold: threshold = 50, autoplay: autoplay, onSlideChange: onSlideChange} = options, containerRef = useRef(null), wrapperRef = useRef(null), repositioningRef = useRef(!1), autoplayRef = useRef(null), [autoplayRunning, setAutoplayRunning] = useState(!1), [realIndex, setRealIndex] = useState(initialSlide), [internalIndex, setInternalIndex] = useState(0), [isTransitioning, setIsTransitioning] = useState(!1), [containerSize, setContainerSize] = useState(0), [touching, setTouching] = useState(!1), [touchStart, setTouchStart] = useState(0), [dragOffset, setDragOffset] = useState(0), slideWidth = useMemo((() => 0 === containerSize ? 0 : (containerSize - spaceBetween * (slidesToShow - 1)) / slidesToShow), [ containerSize, spaceBetween, slidesToShow ]), allSlides = useMemo((() => loop && 0 !== slides.length ? [ ...slides.map(((slide, i) => ({
12538
+ const {slides: slides, slidesToShow: slidesToShow = 1, spaceBetween: spaceBetween = 0, loop: loop = !1, initialSlide: initialSlide = 0, direction: direction = "horizontal", speed: speed = 300, allowTouchMove: allowTouchMove = !0, threshold: threshold = 50, autoplay: autoplay, onSlideChange: onSlideChange} = options, containerRef = useRef(null), wrapperRef = useRef(null), repositioningRef = useRef(!1), autoplayRef = useRef(null), [autoplayRunning, setAutoplayRunning] = useState(!1), sliderStateRef = useRef({
12539
+ isTransitioning: !1,
12540
+ loop: loop,
12541
+ slides: slides,
12542
+ slidesToShow: slidesToShow,
12543
+ speed: speed,
12544
+ onSlideChange: onSlideChange
12545
+ }), [realIndex, setRealIndex] = useState(initialSlide), [internalIndex, setInternalIndex] = useState(0), [isTransitioning, setIsTransitioning] = useState(!1), [containerSize, setContainerSize] = useState(0), [touching, setTouching] = useState(!1), [touchStart, setTouchStart] = useState(0), [dragOffset, setDragOffset] = useState(0), slideWidth = useMemo((() => 0 === containerSize ? 0 : (containerSize - spaceBetween * (slidesToShow - 1)) / slidesToShow), [ containerSize, spaceBetween, slidesToShow ]), allSlides = useMemo((() => loop && 0 !== slides.length ? [ ...slides.map(((slide, i) => ({
12080
12546
  ...slide,
12081
12547
  id: `set1-${slide.id || i}`
12082
12548
  }))), ...slides.map(((slide, i) => ({
@@ -12086,6 +12552,17 @@ function useSlider(options) {
12086
12552
  ...slide,
12087
12553
  id: `set3-${slide.id || i}`
12088
12554
  }))) ] : slides), [ slides, loop ]), loopedSlides = slides.length, translateValue = useMemo((() => 0 === slideWidth ? 0 : -internalIndex * slideWidth + dragOffset), [ slideWidth, internalIndex, dragOffset ]);
12555
+ // Update the ref whenever the relevant state/props change
12556
+ useEffect((() => {
12557
+ sliderStateRef.current = {
12558
+ isTransitioning: isTransitioning,
12559
+ loop: loop,
12560
+ slides: slides,
12561
+ slidesToShow: slidesToShow,
12562
+ speed: speed,
12563
+ onSlideChange: onSlideChange
12564
+ };
12565
+ }), [ isTransitioning, loop, slides, slidesToShow, speed, onSlideChange ]),
12089
12566
  // Autoplay effect
12090
12567
  useEffect((() => {
12091
12568
  if (!autoplay) return autoplayRef.current && (clearInterval(autoplayRef.current),
@@ -12097,32 +12574,34 @@ function useSlider(options) {
12097
12574
  autoplayRef.current && clearInterval(autoplayRef.current),
12098
12575
  // Create new interval
12099
12576
  autoplayRef.current = setInterval((() => {
12577
+ // Use ref to get the latest state without resetting the interval
12578
+ const {isTransitioning: currentIsTransitioning, loop: currentLoop, slides: currentSlides, slidesToShow: currentSlidesToShow, speed: currentSpeed, onSlideChange: currentOnSlideChange} = sliderStateRef.current;
12100
12579
  // We need to use a functional update to get the latest values
12101
- setRealIndex((prevRealIndex => {
12102
- if (isTransitioning) return prevRealIndex;
12580
+ setRealIndex((prevRealIndex => {
12581
+ if (currentIsTransitioning) return prevRealIndex;
12103
12582
  // Stop autoplay on interaction if disableOnInteraction is true
12104
12583
  let nextIndex;
12105
12584
  // Trigger the slide change
12106
12585
  if (disableOnInteraction && autoplayRef.current && (clearInterval(autoplayRef.current),
12107
- autoplayRef.current = null, setAutoplayRunning(!1)), nextIndex = loop ? (prevRealIndex + 1) % slides.length : Math.min(prevRealIndex + 1, slides.length - slidesToShow),
12586
+ autoplayRef.current = null, setAutoplayRunning(!1)), nextIndex = currentLoop ? (prevRealIndex + 1) % currentSlides.length : Math.min(prevRealIndex + 1, currentSlides.length - currentSlidesToShow),
12108
12587
  reverseDirection) {
12109
12588
  // For reverse direction, we would go to previous slide
12110
- const prevIndex = loop ? 0 === prevRealIndex ? slides.length - 1 : prevRealIndex - 1 : Math.max(prevRealIndex - 1, 0);
12111
- return setInternalIndex(loop ? slides.length + prevIndex : prevIndex), setIsTransitioning(!0),
12112
- setDragOffset(0), setTimeout((() => {
12113
- setIsTransitioning(!1), onSlideChange?.(prevIndex);
12114
- }), speed), prevIndex;
12589
+ const prevIndex = currentLoop ? 0 === prevRealIndex ? currentSlides.length - 1 : prevRealIndex - 1 : Math.max(prevRealIndex - 1, 0);
12590
+ return setInternalIndex(currentLoop ? currentSlides.length + prevIndex : prevIndex),
12591
+ setIsTransitioning(!0), setDragOffset(0), setTimeout((() => {
12592
+ setIsTransitioning(!1), currentOnSlideChange?.(prevIndex);
12593
+ }), currentSpeed), prevIndex;
12115
12594
  }
12116
12595
  // Normal direction
12117
- return setInternalIndex(loop ? slides.length + nextIndex : nextIndex), setIsTransitioning(!0),
12118
- setDragOffset(0), setTimeout((() => {
12119
- setIsTransitioning(!1), onSlideChange?.(nextIndex),
12596
+ return setInternalIndex(currentLoop ? currentSlides.length + nextIndex : nextIndex),
12597
+ setIsTransitioning(!0), setDragOffset(0), setTimeout((() => {
12598
+ setIsTransitioning(!1), currentOnSlideChange?.(nextIndex),
12120
12599
  // Reposition after transition ends for looped sliders
12121
- loop && nextIndex >= 2 * slides.length && (repositioningRef.current = !0, setInternalIndex(slides.length + nextIndex),
12122
- setTimeout((() => {
12600
+ currentLoop && nextIndex >= 2 * currentSlides.length && (repositioningRef.current = !0,
12601
+ setInternalIndex(currentSlides.length + nextIndex), setTimeout((() => {
12123
12602
  repositioningRef.current = !1;
12124
12603
  }), 0));
12125
- }), speed), nextIndex;
12604
+ }), currentSpeed), nextIndex;
12126
12605
  }));
12127
12606
  }), delay), setAutoplayRunning(!0);
12128
12607
  // Handle pause on mouse enter/leave if enabled
@@ -12133,17 +12612,18 @@ function useSlider(options) {
12133
12612
  }, handleMouseLeave = () => {
12134
12613
  // Restart autoplay
12135
12614
  autoplayRef.current && clearInterval(autoplayRef.current), autoplayRef.current = setInterval((() => {
12615
+ const {isTransitioning: currentIsTransitioning, loop: currentLoop, slides: currentSlides, slidesToShow: currentSlidesToShow, speed: currentSpeed, onSlideChange: currentOnSlideChange} = sliderStateRef.current;
12136
12616
  setRealIndex((prevRealIndex => {
12137
- if (isTransitioning) return prevRealIndex;
12617
+ if (currentIsTransitioning) return prevRealIndex;
12138
12618
  let nextIndex;
12139
- return nextIndex = loop ? (prevRealIndex + 1) % slides.length : Math.min(prevRealIndex + 1, slides.length - slidesToShow),
12140
- setInternalIndex(loop ? slides.length + nextIndex : nextIndex), setIsTransitioning(!0),
12619
+ return nextIndex = currentLoop ? (prevRealIndex + 1) % currentSlides.length : Math.min(prevRealIndex + 1, currentSlides.length - currentSlidesToShow),
12620
+ setInternalIndex(currentLoop ? currentSlides.length + nextIndex : nextIndex), setIsTransitioning(!0),
12141
12621
  setDragOffset(0), setTimeout((() => {
12142
- setIsTransitioning(!1), onSlideChange?.(nextIndex), loop && nextIndex >= 2 * slides.length && (repositioningRef.current = !0,
12143
- setInternalIndex(slides.length + nextIndex), setTimeout((() => {
12622
+ setIsTransitioning(!1), currentOnSlideChange?.(nextIndex), currentLoop && nextIndex >= 2 * currentSlides.length && (repositioningRef.current = !0,
12623
+ setInternalIndex(currentSlides.length + nextIndex), setTimeout((() => {
12144
12624
  repositioningRef.current = !1;
12145
12625
  }), 0));
12146
- }), speed), nextIndex;
12626
+ }), currentSpeed), nextIndex;
12147
12627
  }));
12148
12628
  }), delay), setAutoplayRunning(!0);
12149
12629
  };
@@ -12155,7 +12635,7 @@ function useSlider(options) {
12155
12635
  containerElement && (containerElement.removeEventListener("mouseenter", handleMouseEnter),
12156
12636
  containerElement.removeEventListener("mouseleave", handleMouseLeave)), setAutoplayRunning(!1);
12157
12637
  };
12158
- }), [ autoplay, slides.length, loop, slidesToShow, isTransitioning, speed, onSlideChange, repositioningRef ]),
12638
+ }), [ autoplay, repositioningRef ]),
12159
12639
  // Initialize
12160
12640
  useEffect((() => {
12161
12641
  setInternalIndex(loop ? slides.length + initialSlide : initialSlide);
@@ -12381,8 +12861,6 @@ function useSlider(options) {
12381
12861
  };
12382
12862
  }
12383
12863
 
12384
- // Button composables
12385
- // export * from './useButton';
12386
12864
  // Accordion composables
12387
12865
  const composablesImport = Object.freeze( Object.defineProperty({
12388
12866
  __proto__: null,
@@ -12423,124 +12901,191 @@ const composablesImport = Object.freeze( Object.defineProperty({
12423
12901
  useTodo: useTodo
12424
12902
  }, Symbol.toStringTag, {
12425
12903
  value: "Module"
12426
- })), 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}) => {
12904
+ })), SelectContext = createContext(null), SelectOption = memo((({value: value, children: children, disabled: disabled = !1, className: className = "", style: style}) => {
12905
+ const context = useContext(SelectContext), label = "string" == typeof children ? children : value;
12906
+ // We assume children is the label if it's a string, or we need a way to get label.
12907
+ // For simplicity, we use children as label for registration if it's a string.
12908
+ if (useEffect((() => {
12909
+ if (context) return context.registerOption({
12910
+ value: value,
12911
+ label: label,
12912
+ disabled: disabled
12913
+ }), () => {
12914
+ context.unregisterOption(value);
12915
+ };
12916
+ }), [ context, value, label, disabled ]), !context) return console.warn("SelectOption must be used within a Select component"),
12917
+ null;
12918
+ const {selectedValue: selectedValue, onSelect: onSelect} = context, isSelected = Array.isArray(selectedValue) ? _includesInstanceProperty(selectedValue).call(selectedValue, value) : selectedValue === value;
12919
+ return jsx("li", {
12920
+ className: `${SELECT.CLASSES.SELECT_ITEM} ${className}`.trim(),
12921
+ "data-value": value,
12922
+ onClick: e => {
12923
+ e.preventDefault(), e.stopPropagation(), disabled || onSelect(value, label);
12924
+ },
12925
+ style: style,
12926
+ role: "option",
12927
+ "aria-selected": isSelected,
12928
+ "aria-disabled": disabled,
12929
+ children: jsxs("label", {
12930
+ className: "c-checkbox",
12931
+ style: {
12932
+ pointerEvents: "none"
12933
+ },
12934
+ children: [ jsx("input", {
12935
+ type: "checkbox",
12936
+ className: "c-checkbox__input c-select__item-input",
12937
+ checked: isSelected,
12938
+ readOnly: !0,
12939
+ disabled: disabled,
12940
+ tabIndex: -1
12941
+ }), jsx("div", {
12942
+ className: "c-select__item-label",
12943
+ children: children
12944
+ }) ]
12945
+ })
12946
+ });
12947
+ }));
12948
+
12949
+ SelectOption.displayName = "SelectOption";
12950
+
12951
+ /**
12952
+ * Select - A component for dropdown selection
12953
+ */
12954
+ 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, children: children}) => {
12427
12955
  const {generateSelectClass: generateSelectClass} = useSelect({
12428
12956
  size: size,
12429
12957
  disabled: disabled,
12430
12958
  invalid: invalid,
12431
12959
  valid: valid
12432
12960
  }), selectClass = generateSelectClass({
12433
- className: `${className} ${glass ? "c-select--glass" : ""}`.trim(),
12434
- size: size,
12435
- disabled: disabled,
12436
- invalid: invalid,
12437
- valid: valid
12438
- }), [isOpen, setIsOpen] = useState(!1), [selectedLabel, setSelectedLabel] = useState(placeholder), dropdownRef = useRef(null), panelRef = useRef(null), bodyRef = useRef(null), nativeSelectRef = useRef(null);
12439
- // Update selected label when value changes
12440
- useEffect((() => {
12441
- if (value) {
12442
- const selectedOption = options.find((opt => opt.value === value));
12443
- selectedOption && setSelectedLabel(selectedOption.label);
12444
- } else setSelectedLabel(placeholder);
12445
- }), [ value, options, placeholder ]),
12446
- // Handle click outside to close dropdown
12447
- useEffect((() => {
12448
- const handleClickOutside = event => {
12449
- dropdownRef.current && !dropdownRef.current.contains(event.target) && (setIsOpen(!1),
12450
- bodyRef.current && (bodyRef.current.style.height = "0px"));
12451
- };
12452
- return document.addEventListener("mousedown", handleClickOutside), () => {
12453
- document.removeEventListener("mousedown", handleClickOutside);
12454
- };
12455
- }), []);
12456
- // Toggle dropdown
12457
- const selectContent = jsxs("div", {
12458
- className: `${selectClass} ${isOpen ? SELECT.CLASSES.IS_OPEN : ""}`,
12459
- ref: dropdownRef,
12460
- style: style,
12461
- "aria-expanded": isOpen,
12462
- children: [ jsxs("select", {
12463
- ref: nativeSelectRef,
12464
- value: value,
12465
- onChange: onChange,
12466
- onBlur: onBlur,
12467
- onFocus: onFocus,
12468
- disabled: disabled,
12469
- required: required,
12470
- id: id,
12471
- name: name,
12472
- multiple: multiple,
12473
- "aria-label": ariaLabel,
12474
- "aria-describedby": ariaDescribedBy,
12475
- "aria-invalid": invalid,
12476
- style: {
12477
- display: "none"
12478
- },
12479
- children: [ placeholder && jsx("option", {
12480
- value: "",
12481
- disabled: !0,
12482
- children: placeholder
12483
- }), options.map((option => jsx("option", {
12484
- value: option.value,
12485
- disabled: option.disabled,
12486
- children: option.label
12487
- }, option.value))) ]
12488
- }), jsx("div", {
12489
- className: SELECT.CLASSES.SELECTED,
12490
- onClick: () => {
12491
- disabled || (!isOpen && bodyRef.current && panelRef.current ? bodyRef.current.style.height = `${panelRef.current.clientHeight}px` : bodyRef.current && (bodyRef.current.style.height = "0px"),
12492
- setIsOpen(!isOpen));
12493
- },
12494
- "aria-disabled": disabled,
12495
- children: selectedLabel
12496
- }), jsx("i", {
12497
- className: `${SELECT.CLASSES.ICON_CARET} ${SELECT.CLASSES.TOGGLE_ICON}`
12498
- }), jsx("div", {
12499
- className: SELECT.CLASSES.SELECT_BODY,
12500
- ref: bodyRef,
12501
- style: {
12502
- height: 0
12503
- },
12504
- children: jsx("div", {
12505
- className: SELECT.CLASSES.SELECT_PANEL,
12506
- ref: panelRef,
12507
- children: jsx("ul", {
12508
- className: SELECT.CLASSES.SELECT_ITEMS,
12509
- children: options.map(((option, index) => jsx("li", {
12510
- className: SELECT.CLASSES.SELECT_ITEM,
12511
- "data-value": option.value,
12512
- onClick: () => !option.disabled && (option => {
12513
- if (setSelectedLabel(option.label), setIsOpen(!1), bodyRef.current && (bodyRef.current.style.height = "0px"),
12514
- nativeSelectRef.current && (nativeSelectRef.current.value = option.value), onChange) {
12515
- // Create a synthetic event
12516
- const event = {
12517
- target: {
12518
- name: name,
12519
- value: option.value
12520
- }
12521
- };
12522
- onChange(event);
12523
- }
12524
- })(option),
12525
- children: jsxs("label", {
12526
- htmlFor: `SelectItem${index}`,
12527
- className: "c-checkbox",
12528
- children: [ jsx("input", {
12529
- type: "checkbox",
12530
- id: `SelectItem${index}`,
12531
- className: "c-checkbox__input c-select__item-input",
12532
- checked: value === option.value,
12533
- readOnly: !0,
12534
- disabled: option.disabled
12535
- }), jsx("div", {
12536
- className: "c-select__item-label",
12537
- children: option.label
12538
- }) ]
12539
- })
12540
- }, option.value)))
12961
+ className: `${className} ${glass ? "c-select--glass" : ""}`.trim(),
12962
+ size: size,
12963
+ disabled: disabled,
12964
+ invalid: invalid,
12965
+ valid: valid
12966
+ }), [isOpen, setIsOpen] = useState(!1), [selectedLabel, setSelectedLabel] = useState(placeholder), dropdownRef = useRef(null), panelRef = useRef(null), bodyRef = useRef(null), nativeSelectRef = useRef(null), [registeredOptions, setRegisteredOptions] = useState([]), registerOption = useCallback((option => {
12967
+ setRegisteredOptions((prev => prev.some((o => o.value === option.value)) ? prev : [ ...prev, option ]));
12968
+ }), []), unregisterOption = useCallback((value => {
12969
+ setRegisteredOptions((prev => prev.filter((o => o.value !== value))));
12970
+ }), []), hasOptionsProp = options && options.length > 0, activeOptions = hasOptionsProp ? options : registeredOptions;
12971
+ // Update selected label when value changes
12972
+ useEffect((() => {
12973
+ if (value) {
12974
+ const selectedOption = activeOptions.find((opt => opt.value === value));
12975
+ selectedOption && setSelectedLabel(selectedOption.label);
12976
+ } else setSelectedLabel(placeholder);
12977
+ }), [ value, activeOptions, placeholder ]),
12978
+ // Handle click outside to close dropdown
12979
+ useEffect((() => {
12980
+ const handleClickOutside = event => {
12981
+ dropdownRef.current && !dropdownRef.current.contains(event.target) && (setIsOpen(!1),
12982
+ bodyRef.current && (bodyRef.current.style.height = "0px"));
12983
+ };
12984
+ return document.addEventListener("mousedown", handleClickOutside), () => {
12985
+ document.removeEventListener("mousedown", handleClickOutside);
12986
+ };
12987
+ }), []);
12988
+ // Toggle dropdown
12989
+ const handleItemClick = useCallback((option => {
12990
+ if (setSelectedLabel(option.label), setIsOpen(!1), bodyRef.current && (bodyRef.current.style.height = "0px"),
12991
+ nativeSelectRef.current && (nativeSelectRef.current.value = option.value), onChange) {
12992
+ // Create a synthetic event
12993
+ const event = {
12994
+ target: {
12995
+ name: name,
12996
+ value: option.value
12997
+ }
12998
+ };
12999
+ onChange(event);
13000
+ }
13001
+ }), [ onChange, name ]), onSelect = useCallback(((val, label) => {
13002
+ handleItemClick({
13003
+ value: val,
13004
+ label: label
13005
+ });
13006
+ }), [ handleItemClick ]), contextValue = React.useMemo((() => ({
13007
+ registerOption: registerOption,
13008
+ unregisterOption: unregisterOption,
13009
+ selectedValue: value,
13010
+ onSelect: onSelect
13011
+ })), [ registerOption, unregisterOption, value, onSelect ]), selectContent = jsx(SelectContext.Provider, {
13012
+ value: contextValue,
13013
+ children: jsxs("div", {
13014
+ className: `${selectClass} ${isOpen ? SELECT.CLASSES.IS_OPEN : ""}`,
13015
+ ref: dropdownRef,
13016
+ style: style,
13017
+ "aria-expanded": isOpen,
13018
+ children: [ jsxs("select", {
13019
+ ref: nativeSelectRef,
13020
+ value: value,
13021
+ onChange: onChange,
13022
+ onBlur: onBlur,
13023
+ onFocus: onFocus,
13024
+ disabled: disabled,
13025
+ required: required,
13026
+ id: id,
13027
+ name: name,
13028
+ multiple: multiple,
13029
+ "aria-label": ariaLabel,
13030
+ "aria-describedby": ariaDescribedBy,
13031
+ "aria-invalid": invalid,
13032
+ style: {
13033
+ display: "none"
13034
+ },
13035
+ children: [ placeholder && jsx("option", {
13036
+ value: "",
13037
+ disabled: !0,
13038
+ children: placeholder
13039
+ }), activeOptions.map((option => jsx("option", {
13040
+ value: option.value,
13041
+ disabled: option.disabled,
13042
+ children: option.label
13043
+ }, option.value))) ]
13044
+ }), jsx("div", {
13045
+ className: SELECT.CLASSES.SELECTED,
13046
+ onClick: () => {
13047
+ disabled || (!isOpen && bodyRef.current && panelRef.current ? bodyRef.current.style.height = `${panelRef.current.clientHeight}px` : bodyRef.current && (bodyRef.current.style.height = "0px"),
13048
+ setIsOpen(!isOpen));
13049
+ },
13050
+ "aria-disabled": disabled,
13051
+ children: selectedLabel
13052
+ }), jsx("i", {
13053
+ className: `${SELECT.CLASSES.ICON_CARET} ${SELECT.CLASSES.TOGGLE_ICON}`
13054
+ }), jsx("div", {
13055
+ className: SELECT.CLASSES.SELECT_BODY,
13056
+ ref: bodyRef,
13057
+ style: {
13058
+ height: 0
13059
+ },
13060
+ children: jsx("div", {
13061
+ className: SELECT.CLASSES.SELECT_PANEL,
13062
+ ref: panelRef,
13063
+ children: jsx("ul", {
13064
+ className: SELECT.CLASSES.SELECT_ITEMS,
13065
+ children: hasOptionsProp ? options.map(((option, index) => jsx("li", {
13066
+ className: SELECT.CLASSES.SELECT_ITEM,
13067
+ "data-value": option.value,
13068
+ onClick: () => !option.disabled && handleItemClick(option),
13069
+ children: jsxs("label", {
13070
+ htmlFor: `SelectItem${index}`,
13071
+ className: "c-checkbox",
13072
+ children: [ jsx("input", {
13073
+ type: "checkbox",
13074
+ id: `SelectItem${index}`,
13075
+ className: "c-checkbox__input c-select__item-input",
13076
+ checked: value === option.value,
13077
+ readOnly: !0,
13078
+ disabled: option.disabled
13079
+ }), jsx("div", {
13080
+ className: "c-select__item-label",
13081
+ children: option.label
13082
+ }) ]
13083
+ })
13084
+ }, option.value))) : children
13085
+ })
12541
13086
  })
12542
- })
12543
- }) ]
13087
+ }) ]
13088
+ })
12544
13089
  });
12545
13090
  // Handle item selection
12546
13091
  if (glass) {
@@ -12550,7 +13095,7 @@ const composablesImport = Object.freeze( Object.defineProperty({
12550
13095
  blurAmount: 1,
12551
13096
  saturation: 180,
12552
13097
  aberrationIntensity: .2,
12553
- cornerRadius: 12,
13098
+ borderRadius: 12,
12554
13099
  mode: "shader"
12555
13100
  }, glassProps = !0 === glass ? defaultGlassProps : {
12556
13101
  ...defaultGlassProps,
@@ -12564,9 +13109,7 @@ const composablesImport = Object.freeze( Object.defineProperty({
12564
13109
  return selectContent;
12565
13110
  }));
12566
13111
 
12567
- /**
12568
- * Select - A component for dropdown selection
12569
- */ Select.displayName = "Select";
13112
+ Select.displayName = "Select", Select.Option = SelectOption;
12570
13113
 
12571
13114
  /**
12572
13115
  * Radio - A component for radio button inputs
@@ -12610,7 +13153,7 @@ const Radio = memo((({label: label, checked: checked = !1, onChange: onChange,
12610
13153
  blurAmount: 1,
12611
13154
  saturation: 160,
12612
13155
  aberrationIntensity: .3,
12613
- cornerRadius: 6,
13156
+ borderRadius: 6,
12614
13157
  mode: "shader"
12615
13158
  }, glassProps = !0 === glass ? defaultGlassProps : {
12616
13159
  ...defaultGlassProps,
@@ -12676,7 +13219,7 @@ const Textarea = memo( forwardRef((({value: value, defaultValue: defaultValue,
12676
13219
  blurAmount: 1,
12677
13220
  saturation: 180,
12678
13221
  aberrationIntensity: 1,
12679
- cornerRadius: 8,
13222
+ borderRadius: 8,
12680
13223
  mode: "shader"
12681
13224
  }, glassProps = !0 === glass ? defaultGlassProps : {
12682
13225
  ...defaultGlassProps,
@@ -13444,7 +13987,7 @@ const Hero = ({title: title, subtitle: subtitle, text: text, imageSrc: imageSrc,
13444
13987
  autoplay: !0,
13445
13988
  loop: !0,
13446
13989
  muted: !0
13447
- }, backgroundSlider: backgroundSlider, headingLevel: headingLevel = "h1", reverseOnMobile: reverseOnMobile = !1, parts: parts, ...rest}) => {
13990
+ }, backgroundSlider: backgroundSlider, headingLevel: headingLevel = "h1", reverseOnMobile: reverseOnMobile = !1, parts: parts, backgroundElement: backgroundElement, ...rest}) => {
13448
13991
  // Define dynamic heading tag
13449
13992
  const HeadingTag = headingLevel, {generateHeroClassNames: generateHeroClassNames, generateImageColClass: generateImageColClass, generateContentColClass: generateContentColClass, hasBackgroundImage: hasBackgroundImage, hasForegroundImage: hasForegroundImage, useGridLayout: useGridLayout, heroRef: heroRef, videoRef: videoRef, backgroundSlider: sliderHook, hasBackgroundSlider: hasBackgroundSlider} = useHero({
13450
13993
  title: title,
@@ -13517,7 +14060,7 @@ const Hero = ({title: title, subtitle: subtitle, text: text, imageSrc: imageSrc,
13517
14060
  blurAmount: 3,
13518
14061
  saturation: 180,
13519
14062
  aberrationIntensity: 0,
13520
- cornerRadius: 8,
14063
+ borderRadius: 8,
13521
14064
  overLight: !1,
13522
14065
  mode: "standard",
13523
14066
  children: jsxs("div", {
@@ -13603,7 +14146,7 @@ const Hero = ({title: title, subtitle: subtitle, text: text, imageSrc: imageSrc,
13603
14146
  "data-parallax": parallax ? "true" : void 0,
13604
14147
  "data-parallax-intensity": parallax ? parallaxIntensity : void 0,
13605
14148
  ...rest,
13606
- children: [ (() => {
14149
+ children: [ backgroundElement, (() => {
13607
14150
  // Render background slider if configured
13608
14151
  if (hasBackgroundSlider && backgroundSlider && sliderHook) {
13609
14152
  const {slides: slides, transition: transition = "fade", transitionDuration: transitionDuration = 1e3} = backgroundSlider, {currentIndex: currentIndex, slideRefs: slideRefs, videoRefs: videoRefs} = sliderHook;
@@ -13698,7 +14241,81 @@ const Hero = ({title: title, subtitle: subtitle, text: text, imageSrc: imageSrc,
13698
14241
  });
13699
14242
  };
13700
14243
 
13701
- Hero.displayName = "Hero";
14244
+ Hero.Title = ({children: children, className: className, level: level = "h1", ...props}) => jsx(level, {
14245
+ className: `${HERO.SELECTORS.TITLE.replace(".", "")} ${className || ""}`.trim(),
14246
+ ...props,
14247
+ children: children
14248
+ }), Hero.Subtitle = ({children: children, className: className, ...props}) => jsx("p", {
14249
+ className: `${HERO.SELECTORS.SUBTITLE.replace(".", "")} ${className || ""}`.trim(),
14250
+ ...props,
14251
+ children: children
14252
+ }), Hero.Text = ({children: children, className: className, ...props}) => jsx("p", {
14253
+ className: `${HERO.SELECTORS.TEXT.replace(".", "")} ${className || ""}`.trim(),
14254
+ ...props,
14255
+ children: children
14256
+ }), Hero.Actions = ({children: children, className: className, ...props}) => jsx("div", {
14257
+ className: `${HERO.SELECTORS.ACTIONS.replace(".", "")} ${className || ""}`.trim(),
14258
+ ...props,
14259
+ children: children
14260
+ }), Hero.Content = ({children: children, className: className, style: style, glass: glass, ...props}) => {
14261
+ const contentClass = `${HERO.SELECTORS.CONTENT.replace(".", "")} ${className || ""}`.trim();
14262
+ if (glass) {
14263
+ const glassProps = "boolean" == typeof glass ? {
14264
+ displacementScale: 60,
14265
+ blurAmount: 3,
14266
+ saturation: 180,
14267
+ aberrationIntensity: 0,
14268
+ borderRadius: 8,
14269
+ overLight: !1,
14270
+ mode: "standard"
14271
+ } : glass;
14272
+ return jsx("div", {
14273
+ className: contentClass,
14274
+ style: style,
14275
+ ...props,
14276
+ children: jsx(AtomixGlass, {
14277
+ ...glassProps,
14278
+ children: jsx("div", {
14279
+ className: "u-p-4",
14280
+ children: children
14281
+ })
14282
+ })
14283
+ });
14284
+ }
14285
+ return jsx("div", {
14286
+ className: contentClass,
14287
+ style: style,
14288
+ ...props,
14289
+ children: children
14290
+ });
14291
+ }, Hero.Image = ({src: src, alt: alt = "", className: className, wrapperClassName: wrapperClassName, wrapperStyle: wrapperStyle, ...props}) => jsx("div", {
14292
+ className: `${HERO.SELECTORS.IMAGE_WRAPPER.replace(".", "")} ${wrapperClassName || ""}`.trim(),
14293
+ style: wrapperStyle,
14294
+ children: jsx("img", {
14295
+ src: src,
14296
+ alt: alt,
14297
+ className: `${HERO.SELECTORS.IMAGE.replace(".", "")} ${className || ""}`.trim(),
14298
+ ...props
14299
+ })
14300
+ }), Hero.Background = ({className: className, style: style, src: src, children: children, ...props}) => jsxs("div", {
14301
+ className: `${HERO.SELECTORS.BG.replace(".", "")} ${className || ""}`.trim(),
14302
+ style: style,
14303
+ ...props,
14304
+ children: [ src && jsx("img", {
14305
+ src: src,
14306
+ alt: "Background",
14307
+ className: HERO.SELECTORS.BG_IMAGE.replace(".", "")
14308
+ }), children ]
14309
+ }), Hero.displayName = "Hero";
14310
+
14311
+ const ListItem = forwardRef((({children: children, className: className = "", ...props}, ref) => jsx("li", {
14312
+ ref: ref,
14313
+ className: `${LIST.ITEM_CLASS} ${className}`.trim(),
14314
+ ...props,
14315
+ children: children
14316
+ })));
14317
+
14318
+ ListItem.displayName = "ListItem";
13702
14319
 
13703
14320
  const List = memo((({children: children, variant: variant = "default", className: className = "", style: style, ...props}) => {
13704
14321
  var _context;
@@ -13709,14 +14326,14 @@ const List = memo((({children: children, variant: variant = "default", classNam
13709
14326
  className: listClasses,
13710
14327
  style: style,
13711
14328
  ...props,
13712
- children: React.Children.map(children, (child => jsx("li", {
14329
+ children: React.Children.map(children, (child => React.isValidElement(child) && child.type === ListItem ? child : jsx("li", {
13713
14330
  className: "c-list__item",
13714
14331
  children: child
13715
14332
  })))
13716
14333
  });
13717
14334
  }));
13718
14335
 
13719
- List.displayName = "List";
14336
+ List.displayName = "List", List.Item = ListItem;
13720
14337
 
13721
14338
  const ListGroup = ({children: children, className: className = "", style: style, variant: variant = "default"}) => {
13722
14339
  // Generate CSS classes
@@ -13762,7 +14379,7 @@ const Messages = ({messages: messages = [], otherAvatar: otherAvatar, selfAvatar
13762
14379
  onSendMessage: onSendMessage
13763
14380
  }), messagesId = id || `messages-${Math.random().toString(36).substr(2, 9)}`, inputId = `${messagesId}-input`, defaultGlassProps = {
13764
14381
  displacementScale: 150,
13765
- cornerRadius: 12,
14382
+ borderRadius: 12,
13766
14383
  elasticity: 0,
13767
14384
  aberrationIntensity: 2
13768
14385
  }, messagesClasses = `${MESSAGES.CLASSES.BASE} ${glass ? "c-messages--glass" : ""} ${disabled ? "is-disabled" : ""} ${className}`, messagesContent = jsxs(Fragment, {
@@ -13908,7 +14525,7 @@ const Messages = ({messages: messages = [], otherAvatar: otherAvatar, selfAvatar
13908
14525
  children: jsx("div", {
13909
14526
  className: "c-messages__glass-content",
13910
14527
  style: {
13911
- borderRadius: glassProps.cornerRadius
14528
+ borderRadius: glassProps.borderRadius
13912
14529
  },
13913
14530
  children: messagesContent
13914
14531
  })
@@ -13933,10 +14550,59 @@ const Messages = ({messages: messages = [], otherAvatar: otherAvatar, selfAvatar
13933
14550
  * Messages component for displaying a chat interface with messages, images, and file attachments
13934
14551
  */ Messages.displayName = "Messages";
13935
14552
 
13936
- /**
13937
- * Modal component for displaying overlay content
13938
- */
13939
- const Modal = memo((({children: children, isOpen: isOpen = !1, onOpenChange: onOpenChange, onClose: onClose, onOpen: onOpen, title: title, subtitle: subtitle, size: size = "md", backdrop: backdrop = !0, keyboard: keyboard = !0, className: className = "", style: style, closeButton: closeButton = !0, footer: footer, glass: glass, ...props}) => {
14553
+ const ModalHeader = forwardRef((({title: title, subtitle: subtitle, closeButton: closeButton, onClose: onClose, children: children, className: className = "", ...props}, ref) => jsxs("div", {
14554
+ ref: ref,
14555
+ className: `c-modal__header ${className}`.trim(),
14556
+ ...props,
14557
+ children: [ jsxs("div", {
14558
+ className: "c-modal__header-content",
14559
+ children: [ title && jsx("h3", {
14560
+ className: "c-modal__title",
14561
+ children: title
14562
+ }), subtitle && jsx("p", {
14563
+ className: "c-modal__sub",
14564
+ children: subtitle
14565
+ }), children ]
14566
+ }), closeButton && jsx("button", {
14567
+ type: "button",
14568
+ className: "c-modal__close c-btn js-modal-close",
14569
+ onClick: onClose,
14570
+ "aria-label": "Close modal",
14571
+ children: jsx("svg", {
14572
+ width: "20",
14573
+ height: "20",
14574
+ viewBox: "0 0 20 20",
14575
+ fill: "none",
14576
+ xmlns: "http://www.w3.org/2000/svg",
14577
+ children: jsx("path", {
14578
+ d: "M16.0672 15.1828C16.1253 15.2409 16.1713 15.3098 16.2028 15.3857C16.2342 15.4615 16.2504 15.5429 16.2504 15.625C16.2504 15.7071 16.2342 15.7884 16.2028 15.8643C16.1713 15.9402 16.1253 16.0091 16.0672 16.0672C16.0091 16.1252 15.9402 16.1713 15.8643 16.2027C15.7885 16.2342 15.7071 16.2503 15.625 16.2503C15.5429 16.2503 15.4616 16.2342 15.3857 16.2027C15.3098 16.1713 15.2409 16.1252 15.1828 16.0672L10 10.8836L4.8172 16.0672C4.69992 16.1844 4.54086 16.2503 4.37501 16.2503C4.20916 16.2503 4.0501 16.1844 3.93282 16.0672C3.81555 15.9499 3.74966 15.7908 3.74966 15.625C3.74966 15.4591 3.81555 15.3001 3.93282 15.1828L9.11642 9.99998L3.93282 4.81717C3.81555 4.69989 3.74966 4.54083 3.74966 4.37498C3.74966 4.20913 3.81555 4.05007 3.93282 3.93279C4.0501 3.81552 4.20916 3.74963 4.37501 3.74963C4.54086 3.74963 4.69992 3.81552 4.8172 3.93279L10 9.11639L15.1828 3.93279C15.3001 3.81552 15.4592 3.74963 15.625 3.74963C15.7909 3.74963 15.9499 3.81552 16.0672 3.93279C16.1845 4.05007 16.2504 4.20913 16.2504 4.37498C16.2504 4.54083 16.1845 4.69989 16.0672 4.81717L10.8836 9.99998L16.0672 15.1828Z",
14579
+ fill: "#141414"
14580
+ })
14581
+ })
14582
+ }) ]
14583
+ })));
14584
+
14585
+ ModalHeader.displayName = "ModalHeader";
14586
+
14587
+ const ModalBody = forwardRef((({children: children, className: className = "", ...props}, ref) => jsx("div", {
14588
+ ref: ref,
14589
+ className: `c-modal__body ${className}`.trim(),
14590
+ ...props,
14591
+ children: children
14592
+ })));
14593
+
14594
+ ModalBody.displayName = "ModalBody";
14595
+
14596
+ const ModalFooter = forwardRef((({children: children, className: className = "", ...props}, ref) => jsx("div", {
14597
+ ref: ref,
14598
+ className: `c-modal__footer ${className}`.trim(),
14599
+ ...props,
14600
+ children: children
14601
+ })));
14602
+
14603
+ ModalFooter.displayName = "ModalFooter";
14604
+
14605
+ const ModalImpl = memo((({children: children, isOpen: isOpen = !1, onOpenChange: onOpenChange, onClose: onClose, onOpen: onOpen, title: title, subtitle: subtitle, size: size = "md", backdrop: backdrop = !0, keyboard: keyboard = !0, className: className = "", style: style, closeButton: closeButton = !0, footer: footer, glass: glass, ...props}) => {
13940
14606
  const modalRef = useRef(null), dialogRef = useRef(null), backdropRef = useRef(null), {isOpen: isOpenState, open: open, close: close} =
13941
14607
  /**
13942
14608
  * Hook for managing modal state
@@ -13986,43 +14652,26 @@ const Modal = memo((({children: children, isOpen: isOpen = !1, onOpenChange: on
13986
14652
  };
13987
14653
  }), [ isOpenState, close, keyboard ]);
13988
14654
  // Handle backdrop click
13989
- const modalClasses = [ "c-modal", isOpenState ? MODAL.CLASSES.IS_OPEN : "", size ? `c-modal--${size}` : "", glass ? "c-modal--glass" : "", className ].filter(Boolean).join(" "), modalContent = jsxs("div", {
14655
+ const modalClasses = [ "c-modal", isOpenState ? MODAL.CLASSES.IS_OPEN : "", size ? `c-modal--${size}` : "", glass ? "c-modal--glass" : "", className ].filter(Boolean).join(" "), hasCompoundComponents = React.Children.toArray(children).some((child => {
14656
+ var _context;
14657
+
14658
+ return React.isValidElement(child) && _includesInstanceProperty(_context = [ "ModalHeader", "ModalBody", "ModalFooter" ]).call(_context, child.type.displayName);
14659
+ })), modalContent = jsx("div", {
13990
14660
  className: "c-modal__content",
13991
- children: [ (title || closeButton) && jsxs("div", {
13992
- className: "c-modal__header",
13993
- children: [ jsxs("div", {
13994
- className: "c-modal__header-content",
13995
- children: [ title && jsx("h3", {
13996
- className: "c-modal__title",
13997
- children: title
13998
- }), subtitle && jsx("p", {
13999
- className: "c-modal__sub",
14000
- children: subtitle
14001
- }) ]
14002
- }), closeButton && jsx("button", {
14003
- type: "button",
14004
- className: "c-modal__close c-btn js-modal-close",
14005
- onClick: close,
14006
- "aria-label": "Close modal",
14007
- children: jsx("svg", {
14008
- width: "20",
14009
- height: "20",
14010
- viewBox: "0 0 20 20",
14011
- fill: "none",
14012
- xmlns: "http://www.w3.org/2000/svg",
14013
- children: jsx("path", {
14014
- d: "M16.0672 15.1828C16.1253 15.2409 16.1713 15.3098 16.2028 15.3857C16.2342 15.4615 16.2504 15.5429 16.2504 15.625C16.2504 15.7071 16.2342 15.7884 16.2028 15.8643C16.1713 15.9402 16.1253 16.0091 16.0672 16.0672C16.0091 16.1252 15.9402 16.1713 15.8643 16.2027C15.7885 16.2342 15.7071 16.2503 15.625 16.2503C15.5429 16.2503 15.4616 16.2342 15.3857 16.2027C15.3098 16.1713 15.2409 16.1252 15.1828 16.0672L10 10.8836L4.8172 16.0672C4.69992 16.1844 4.54086 16.2503 4.37501 16.2503C4.20916 16.2503 4.0501 16.1844 3.93282 16.0672C3.81555 15.9499 3.74966 15.7908 3.74966 15.625C3.74966 15.4591 3.81555 15.3001 3.93282 15.1828L9.11642 9.99998L3.93282 4.81717C3.81555 4.69989 3.74966 4.54083 3.74966 4.37498C3.74966 4.20913 3.81555 4.05007 3.93282 3.93279C4.0501 3.81552 4.20916 3.74963 4.37501 3.74963C4.54086 3.74963 4.69992 3.81552 4.8172 3.93279L10 9.11639L15.1828 3.93279C15.3001 3.81552 15.4592 3.74963 15.625 3.74963C15.7909 3.74963 15.9499 3.81552 16.0672 3.93279C16.1845 4.05007 16.2504 4.20913 16.2504 4.37498C16.2504 4.54083 16.1845 4.69989 16.0672 4.81717L10.8836 9.99998L16.0672 15.1828Z",
14015
- fill: "#141414"
14016
- })
14017
- })
14661
+ children: hasCompoundComponents ? React.Children.map(children, (child => React.isValidElement(child) && "ModalHeader" === child.type.displayName ? React.cloneElement(child, {
14662
+ onClose: child.props.onClose || close
14663
+ }) : child)) : jsxs(Fragment, {
14664
+ children: [ (title || closeButton) && jsx(ModalHeader, {
14665
+ title: title,
14666
+ subtitle: subtitle,
14667
+ closeButton: closeButton,
14668
+ onClose: close
14669
+ }), jsx(ModalBody, {
14670
+ children: children
14671
+ }), footer && jsx(ModalFooter, {
14672
+ children: footer
14018
14673
  }) ]
14019
- }), jsx("div", {
14020
- className: "c-modal__body",
14021
- children: children
14022
- }), footer && jsx("div", {
14023
- className: "c-modal__footer",
14024
- children: footer
14025
- }) ]
14674
+ })
14026
14675
  });
14027
14676
  // Assemble classes
14028
14677
  return jsxs("div", {
@@ -14067,24 +14716,15 @@ const Modal = memo((({children: children, isOpen: isOpen = !1, onOpenChange: on
14067
14716
  });
14068
14717
  }));
14069
14718
 
14070
- Modal.displayName = "Modal";
14719
+ ModalImpl.displayName = "Modal";
14071
14720
 
14072
- /**
14073
- * Nav component provides a container for navigation items with proper alignment and accessibility.
14074
- *
14075
- * @example
14076
- * ```tsx
14077
- * <Nav alignment="center">
14078
- * <NavItem href="/">Home</NavItem>
14079
- * <NavItem href="/about">About</NavItem>
14080
- * <NavDropdown title="Services">
14081
- * <MenuItem href="/web">Web Design</MenuItem>
14082
- * <MenuItem href="/mobile">Mobile Apps</MenuItem>
14083
- * </NavDropdown>
14084
- * </Nav>
14085
- * ```
14086
- */
14087
- const Nav = forwardRef((({children: children, alignment: alignment = "start", variant: variant = "default", className: className = "", disabled: disabled = !1, glass: glass}, ref) => {
14721
+ // Attach subcomponents
14722
+ const ModalWithSubcomponents = ModalImpl;
14723
+
14724
+ ModalWithSubcomponents.Header = ModalHeader, ModalWithSubcomponents.Body = ModalBody,
14725
+ ModalWithSubcomponents.Footer = ModalFooter;
14726
+
14727
+ const Modal = ModalWithSubcomponents, Nav = forwardRef((({children: children, alignment: alignment = "start", variant: variant = "default", className: className = "", disabled: disabled = !1, glass: glass}, ref) => {
14088
14728
  const {generateNavClass: generateNavClass} = useNav({
14089
14729
  alignment: alignment,
14090
14730
  variant: variant
@@ -14113,7 +14753,7 @@ const Nav = forwardRef((({children: children, alignment: alignment = "start", v
14113
14753
  const defaultGlassProps = {
14114
14754
  displacementScale: 60,
14115
14755
  blurAmount: 1.5,
14116
- cornerRadius: 8,
14756
+ borderRadius: 8,
14117
14757
  mode: "shader"
14118
14758
  }, glassProps = !0 === glass ? defaultGlassProps : {
14119
14759
  ...defaultGlassProps,
@@ -14127,7 +14767,21 @@ const Nav = forwardRef((({children: children, alignment: alignment = "start", v
14127
14767
  return navContent;
14128
14768
  }));
14129
14769
 
14130
- Nav.displayName = "Nav";
14770
+ /**
14771
+ * Nav component provides a container for navigation items with proper alignment and accessibility.
14772
+ *
14773
+ * @example
14774
+ * ```tsx
14775
+ * <Nav alignment="center">
14776
+ * <NavItem href="/">Home</NavItem>
14777
+ * <NavItem href="/about">About</NavItem>
14778
+ * <NavDropdown title="Services">
14779
+ * <MenuItem href="/web">Web Design</MenuItem>
14780
+ * <MenuItem href="/mobile">Mobile Apps</MenuItem>
14781
+ * </NavDropdown>
14782
+ * </Nav>
14783
+ * ```
14784
+ */ Nav.displayName = "Nav";
14131
14785
 
14132
14786
  /**
14133
14787
  * NavItem component represents a single navigation item that can be a link, dropdown trigger, or mega menu trigger.
@@ -14305,7 +14959,7 @@ const Navbar = forwardRef((({brand: brand, children: children, variant: variant
14305
14959
  const defaultGlassProps = {
14306
14960
  displacementScale: 30,
14307
14961
  blurAmount: 2,
14308
- cornerRadius: 0,
14962
+ borderRadius: 0,
14309
14963
  elasticity: 0,
14310
14964
  mode: "shader",
14311
14965
  shaderVariant: "premiumGlass"
@@ -14686,7 +15340,7 @@ const SideMenu = forwardRef((({title: title, children: children, menuItems: men
14686
15340
  const defaultGlassProps = {
14687
15341
  displacementScale: 70,
14688
15342
  blurAmount: 2,
14689
- cornerRadius: 12,
15343
+ borderRadius: 12,
14690
15344
  mode: "shader"
14691
15345
  }, glassProps = !0 === glass ? defaultGlassProps : {
14692
15346
  ...defaultGlassProps,
@@ -16259,7 +16913,7 @@ const PopoverContext = createContext({
16259
16913
  blurAmount: 1,
16260
16914
  saturation: 160,
16261
16915
  aberrationIntensity: .5,
16262
- cornerRadius: 8,
16916
+ borderRadius: 8,
16263
16917
  mode: "shader"
16264
16918
  }, glassProps = !0 === glass ? defaultGlassProps : {
16265
16919
  ...defaultGlassProps,
@@ -16310,7 +16964,14 @@ const PopoverContext = createContext({
16310
16964
  /**
16311
16965
  * Hook for managing rating component state and interactions
16312
16966
  */
16313
- const Rating = forwardRef((({value: valueProp = 0, defaultValue: defaultValue, maxValue: maxValue = 5, allowHalf: allowHalf = !1, readOnly: readOnly = !1, size: size = "md", variant: variant, onChange: onChange, className: className = "", style: style, label: label, id: id, useVanillaJS: useVanillaJS = !1, glass: glass, ...restProps}, ref) => {
16967
+ const calculateStarValue = (e, starValue, allowHalf) => {
16968
+ if (!allowHalf) return starValue;
16969
+ // Get the star element's bounding rectangle
16970
+ const starRect = e.currentTarget.getBoundingClientRect(), starCenterX = starRect.left + starRect.width / 2, adjustedValue = e.clientX < starCenterX ? starValue - .5 : starValue;
16971
+ // Calculate the x position within the star
16972
+ return Math.max(.5, adjustedValue);
16973
+ // Ensure minimum of 0.5
16974
+ }, Rating = forwardRef((({value: valueProp = 0, defaultValue: defaultValue, maxValue: maxValue = 5, allowHalf: allowHalf = !1, readOnly: readOnly = !1, size: size = "md", variant: variant, onChange: onChange, className: className = "", style: style, label: label, id: id, useVanillaJS: useVanillaJS = !1, glass: glass, ...restProps}, ref) => {
16314
16975
  const internalRef = useRef(null), ratingInstance = useRef(null), {currentValue: currentValue, hoverValue: hoverValue, focusedIndex: focusedIndex, setHoverValue: setHoverValue, setFocused: setFocused, handleKeyDown: handleKeyDown} = (({value: value = 0, maxValue: maxValue = 5, allowHalf: allowHalf = !1, readOnly: readOnly = !1, onChange: onChange}) => {
16315
16976
  // Determine if component is in controlled mode
16316
16977
  const isControlled = void 0 !== onChange, [internalValue, setInternalValue] = useState(value), [hoverValue, setHoverValue] = useState(null), [focusedIndex, setFocusedIndex] = useState(null), currentValue = isControlled ? value : internalValue, handleMouseEnter = useCallback((starValue => {
@@ -16372,30 +17033,14 @@ const Rating = forwardRef((({value: valueProp = 0, defaultValue: defaultValue,
16372
17033
  readOnly: readOnly,
16373
17034
  onChange: onChange
16374
17035
  }), forkedRef = useForkRef(internalRef, ref), handleMouseEnter = useCallback(((e, starValue) => {
16375
- if (!readOnly) if (allowHalf) {
16376
- // Get the star element's bounding rectangle
16377
- const starRect = e.currentTarget.getBoundingClientRect(), starCenterX = starRect.left + starRect.width / 2, adjustedValue = e.clientX < starCenterX ? starValue - .5 : starValue;
16378
- // Calculate the x position within the star
16379
- setHoverValue(Math.max(.5, adjustedValue));
16380
- } else setHoverValue(starValue);
17036
+ readOnly || setHoverValue(calculateStarValue(e, starValue, !!allowHalf));
16381
17037
  }), [ readOnly, allowHalf, setHoverValue ]), handleMouseMove = useCallback(((e, starValue) => {
16382
- if (readOnly || !allowHalf) return;
16383
- // Get the star element's bounding rectangle
16384
- const starRect = e.currentTarget.getBoundingClientRect(), starCenterX = starRect.left + starRect.width / 2, adjustedValue = e.clientX < starCenterX ? starValue - .5 : starValue;
16385
- // Calculate the x position within the star
16386
- setHoverValue(Math.max(.5, adjustedValue));
16387
- } // Ensure minimum of 0.5
16388
- ), [ readOnly, allowHalf, setHoverValue ]), handleMouseLeave = useCallback((() => {
17038
+ !readOnly && allowHalf && setHoverValue(calculateStarValue(e, starValue, !!allowHalf));
17039
+ }), [ readOnly, allowHalf, setHoverValue ]), handleMouseLeave = useCallback((() => {
16389
17040
  readOnly || setHoverValue(null);
16390
17041
  }), [ readOnly, setHoverValue ]), handleClick = useCallback(((e, starValue) => {
16391
17042
  if (readOnly) return;
16392
- let newValue = starValue;
16393
- if (allowHalf) {
16394
- // Get the star element's bounding rectangle
16395
- const starRect = e.currentTarget.getBoundingClientRect(), starCenterX = starRect.left + starRect.width / 2;
16396
- // Calculate the x position within the star
16397
- newValue = e.clientX < starCenterX ? starValue - .5 : starValue, newValue = Math.max(.5, newValue);
16398
- }
17043
+ const newValue = calculateStarValue(e, starValue, !!allowHalf);
16399
17044
  onChange?.(newValue);
16400
17045
  }), [ readOnly, onChange, allowHalf ]);
16401
17046
  // Use vanilla JS implementation if specified
@@ -16500,7 +17145,7 @@ const Rating = forwardRef((({value: valueProp = 0, defaultValue: defaultValue,
16500
17145
  blurAmount: 1,
16501
17146
  saturation: 160,
16502
17147
  aberrationIntensity: .5,
16503
- cornerRadius: 8,
17148
+ borderRadius: 8,
16504
17149
  mode: "shader"
16505
17150
  }, glassProps = !0 === glass ? defaultGlassProps : {
16506
17151
  ...defaultGlassProps,
@@ -16514,21 +17159,8 @@ const Rating = forwardRef((({value: valueProp = 0, defaultValue: defaultValue,
16514
17159
  return ratingContent;
16515
17160
  }));
16516
17161
 
16517
- /**
16518
- * Rating component for displaying and collecting star ratings
16519
- *
16520
- * @example
16521
- * // Basic usage
16522
- * <Rating value={3} onChange={handleRatingChange} />
16523
- *
16524
- * @example
16525
- * // Read-only with custom variant
16526
- * <Rating value={4.5} readOnly variant="warning" />
16527
- *
16528
- * @example
16529
- * // With half-star support
16530
- * <Rating value={3.5} allowHalf maxValue={5} />
16531
- */ Rating.displayName = "Rating";
17162
+ // Helper function to calculate star value based on mouse position
17163
+ Rating.displayName = "Rating";
16532
17164
 
16533
17165
  /**
16534
17166
  * ProductReview component for collecting user ratings and feedback
@@ -16673,7 +17305,7 @@ const Progress = memo( forwardRef((({value: value, variant: variant = "primary"
16673
17305
  const defaultGlassProps = {
16674
17306
  displacementScale: 30,
16675
17307
  blurAmount: .5,
16676
- cornerRadius: 8,
17308
+ borderRadius: 8,
16677
17309
  mode: "shader"
16678
17310
  }, glassProps = !0 === glass ? defaultGlassProps : {
16679
17311
  ...defaultGlassProps,
@@ -17003,39 +17635,72 @@ const Slider = forwardRef(((props, ref) => {
17003
17635
 
17004
17636
  Slider.displayName = "Slider";
17005
17637
 
17638
+ const StepsItem = forwardRef((({children: children, className: className = "", number: number, title: title, active: active, completed: completed, index: index, ...props}, ref) => {
17639
+ const itemClasses = [ "c-steps__item", active ? STEPS.CLASSES.ACTIVE : "", completed ? STEPS.CLASSES.COMPLETED : "", className ].filter(Boolean).join(" ");
17640
+ return jsxs("div", {
17641
+ ref: ref,
17642
+ className: itemClasses,
17643
+ "aria-current": active ? "step" : void 0,
17644
+ "data-index": index,
17645
+ ...props,
17646
+ children: [ jsx("div", {
17647
+ className: "c-steps__line"
17648
+ }), jsxs("div", {
17649
+ className: "c-steps__content",
17650
+ children: [ null != number && jsx("div", {
17651
+ className: "c-steps__number",
17652
+ children: number
17653
+ }), title && jsx("div", {
17654
+ className: "c-steps__text",
17655
+ children: title
17656
+ }), children && jsx("div", {
17657
+ className: "c-steps__custom-content",
17658
+ children: children
17659
+ }) ]
17660
+ }) ]
17661
+ });
17662
+ }));
17663
+
17664
+ StepsItem.displayName = "StepsItem";
17665
+
17006
17666
  /**
17007
17667
  * Steps component for displaying a sequence of steps
17008
17668
  */
17009
- const Steps = ({items: items, activeIndex: activeIndex = 0, vertical: vertical = !1, onStepChange: onStepChange, className: className = "", style: style, glass: glass}) => {
17669
+ const Steps = ({items: items, activeIndex: activeIndex = 0, vertical: vertical = !1, onStepChange: onStepChange, className: className = "", style: style, glass: glass, children: children}) => {
17010
17670
  const [currentStep, setCurrentStep] = useState(activeIndex);
17011
17671
  // Update steps when activeIndex prop changes
17012
- useEffect((() => {
17672
+ let content;
17673
+ useEffect((() => {
17013
17674
  currentStep !== activeIndex && setCurrentStep(activeIndex);
17014
- }), [ activeIndex ]);
17675
+ }), [ activeIndex ]),
17676
+ // Legacy rendering
17677
+ content = items && items.length > 0 ? items.map(((item, index) => jsx(StepsItem, {
17678
+ index: index,
17679
+ number: item.number,
17680
+ title: item.text,
17681
+ active: index <= currentStep,
17682
+ completed: index < currentStep,
17683
+ children: item.content
17684
+ }, `step-${index}`))) : Children.map(children, ((child, index) => {
17685
+ if ( isValidElement(child)) {
17686
+ const childProps = child.props, isActive = childProps.active ?? index <= currentStep, isCompleted = childProps.completed ?? index < currentStep, number = childProps.number ?? index + 1;
17687
+ // Inject active/completed based on index if not explicitly provided
17688
+
17689
+ return cloneElement(child, {
17690
+ index: index,
17691
+ active: isActive,
17692
+ completed: isCompleted,
17693
+ number: number
17694
+ });
17695
+ }
17696
+ return child;
17697
+ }));
17015
17698
  const stepsContent = jsx("div", {
17016
17699
  className: `c-steps ${vertical ? STEPS.CLASSES.VERTICAL : ""} ${className}`,
17017
17700
  style: style,
17018
17701
  role: "navigation",
17019
17702
  "aria-label": "Steps",
17020
- children: items.map(((item, index) => jsxs("div", {
17021
- className: `c-steps__item ${index <= currentStep ? STEPS.CLASSES.ACTIVE : ""} ${index < currentStep ? STEPS.CLASSES.COMPLETED : ""}`,
17022
- "aria-current": index === currentStep ? "step" : void 0,
17023
- children: [ jsx("div", {
17024
- className: "c-steps__line"
17025
- }), jsxs("div", {
17026
- className: "c-steps__content",
17027
- children: [ jsx("div", {
17028
- className: "c-steps__number",
17029
- children: item.number
17030
- }), jsx("div", {
17031
- className: "c-steps__text",
17032
- children: item.text
17033
- }), item.content && jsx("div", {
17034
- className: "c-steps__custom-content",
17035
- children: item.content
17036
- }) ]
17037
- }) ]
17038
- }, `step-${index}`)))
17703
+ children: content
17039
17704
  });
17040
17705
  if (glass) {
17041
17706
  // Default glass settings for steps
@@ -17044,7 +17709,7 @@ const Steps = ({items: items, activeIndex: activeIndex = 0, vertical: vertical =
17044
17709
  blurAmount: 1,
17045
17710
  saturation: 160,
17046
17711
  aberrationIntensity: .5,
17047
- cornerRadius: 8,
17712
+ borderRadius: 8,
17048
17713
  mode: "shader"
17049
17714
  }, glassProps = !0 === glass ? defaultGlassProps : {
17050
17715
  ...defaultGlassProps,
@@ -17058,24 +17723,104 @@ const Steps = ({items: items, activeIndex: activeIndex = 0, vertical: vertical =
17058
17723
  return stepsContent;
17059
17724
  };
17060
17725
 
17061
- Steps.displayName = "Steps";
17726
+ Steps.displayName = "Steps", Steps.Item = StepsItem, Steps.Step = StepsItem;
17062
17727
 
17063
- /**
17064
- * Tabs component for switching between different content panels
17065
- */
17066
- const Tabs = memo((({items: items, activeIndex: activeIndex = TAB.DEFAULTS.ACTIVE_INDEX, onTabChange: onTabChange, className: className = "", style: style, glass: glass}) => {
17067
- const [currentTab, setCurrentTab] = useState(activeIndex), tabContent = jsxs("div", {
17068
- className: `c-tabs js-atomix-tab ${className}`,
17069
- style: style,
17728
+ // Context for compound usage
17729
+ const TabsContext = createContext({
17730
+ currentTab: 0,
17731
+ handleTabClick: () => {}
17732
+ }), TabsList = forwardRef((({children: children, className: className = "", ...props}, ref) => jsx("ul", {
17733
+ ref: ref,
17734
+ className: `c-tabs__nav ${className}`.trim(),
17735
+ ...props,
17736
+ children: React.Children.map(children, ((child, index) => React.isValidElement(child) ? React.cloneElement(child, {
17737
+ index: index
17738
+ }) : child))
17739
+ })));
17740
+
17741
+ // Compound components
17742
+ TabsList.displayName = "TabsList";
17743
+
17744
+ const TabsTrigger = forwardRef((({children: children, className: className = "", index: index, onClick: onClick, ...props}, ref) => {
17745
+ const {currentTab: currentTab, handleTabClick: handleTabClick} = useContext(TabsContext);
17746
+ // Safety check if used outside context or without index
17747
+ void 0 === index && console.warn("TabsTrigger requires an index prop or must be a direct child of TabsList");
17748
+ const isActive = void 0 !== index && currentTab === index;
17749
+ return jsx("li", {
17750
+ className: "c-tabs__nav-item",
17751
+ children: jsx("button", {
17752
+ ref: ref,
17753
+ className: `c-tabs__nav-btn ${isActive ? TAB.CLASSES.ACTIVE : ""} ${className}`.trim(),
17754
+ onClick: e => {
17755
+ void 0 !== index && handleTabClick(index), onClick?.(e);
17756
+ },
17757
+ "data-tabindex": index,
17758
+ role: "tab",
17759
+ "aria-selected": isActive,
17760
+ "aria-controls": `tab-panel-${index}`,
17761
+ type: "button",
17762
+ ...props,
17763
+ children: children
17764
+ })
17765
+ });
17766
+ }));
17767
+
17768
+ TabsTrigger.displayName = "TabsTrigger";
17769
+
17770
+ const TabsPanels = forwardRef((({children: children, className: className = "", ...props}, ref) => jsx("div", {
17771
+ ref: ref,
17772
+ className: `c-tabs__panels ${className}`.trim(),
17773
+ ...props,
17774
+ children: React.Children.map(children, ((child, index) => React.isValidElement(child) ? React.cloneElement(child, {
17775
+ index: index
17776
+ }) : child))
17777
+ })));
17778
+
17779
+ TabsPanels.displayName = "TabsPanels";
17780
+
17781
+ const TabsPanel = forwardRef((({children: children, className: className = "", index: index, style: style, ...props}, ref) => {
17782
+ const {currentTab: currentTab} = useContext(TabsContext), isActive = void 0 !== index && currentTab === index;
17783
+ return jsx("div", {
17784
+ ref: ref,
17785
+ className: `c-tabs__panel ${isActive ? TAB.CLASSES.ACTIVE : ""} ${className}`.trim(),
17786
+ "data-tabindex": index,
17787
+ id: `tab-panel-${index}`,
17788
+ role: "tabpanel",
17789
+ "aria-labelledby": `tab-nav-${index}`,
17790
+ style: {
17791
+ height: isActive ? "auto" : "0px",
17792
+ opacity: isActive ? 1 : 0,
17793
+ overflow: "hidden",
17794
+ transition: "height 0.3s ease, opacity 0.3s ease",
17795
+ ...style
17796
+ },
17797
+ ...props,
17798
+ children: jsx("div", {
17799
+ className: "c-tabs__panel-body",
17800
+ children: children
17801
+ })
17802
+ });
17803
+ }));
17804
+
17805
+ TabsPanel.displayName = "TabsPanel";
17806
+
17807
+ const Tabs = memo((({items: items, activeIndex: activeIndex = TAB.DEFAULTS.ACTIVE_INDEX, onTabChange: onTabChange, className: className = "", style: style, glass: glass, children: children}) => {
17808
+ const [currentTab, setCurrentTab] = useState(activeIndex), handleTabClick = index => {
17809
+ setCurrentTab(index), onTabChange && onTabChange(index);
17810
+ };
17811
+ // Handle tab change
17812
+ // Determine content based on mode (legacy items vs compound children)
17813
+ let content;
17814
+ // Use items prop if provided
17815
+ // Legacy mode
17816
+ content = items && items.length > 0 ? jsxs(Fragment, {
17070
17817
  children: [ jsx("ul", {
17071
17818
  className: "c-tabs__nav",
17072
17819
  children: items.map(((item, index) => jsx("li", {
17073
17820
  className: "c-tabs__nav-item",
17074
17821
  children: jsx("button", {
17075
17822
  className: `c-tabs__nav-btn ${index === currentTab ? TAB.CLASSES.ACTIVE : ""}`,
17076
- onClick: () => (index => {
17077
- setCurrentTab(index), onTabChange && onTabChange(index);
17078
- })(index),
17823
+ onClick: () => handleTabClick(index),
17079
17824
  "data-tabindex": index,
17080
17825
  role: "tab",
17081
17826
  "aria-selected": index === currentTab,
@@ -17103,16 +17848,26 @@ const Tabs = memo((({items: items, activeIndex: activeIndex = TAB.DEFAULTS.ACTI
17103
17848
  })
17104
17849
  }, `tab-panel-${index}`)))
17105
17850
  }) ]
17851
+ }) : jsx(TabsContext.Provider, {
17852
+ value: {
17853
+ currentTab: currentTab,
17854
+ handleTabClick: handleTabClick
17855
+ },
17856
+ children: children
17106
17857
  });
17107
- // Handle tab change
17108
- if (glass) {
17858
+ const wrapper = jsx("div", {
17859
+ className: `c-tabs js-atomix-tab ${className}`,
17860
+ style: style,
17861
+ children: content
17862
+ });
17863
+ if (glass) {
17109
17864
  // Default glass settings for tabs
17110
17865
  const defaultGlassProps = {
17111
17866
  displacementScale: 60,
17112
17867
  blurAmount: 1,
17113
17868
  saturation: 160,
17114
17869
  aberrationIntensity: .5,
17115
- cornerRadius: 8,
17870
+ borderRadius: 8,
17116
17871
  mode: "shader"
17117
17872
  }, glassProps = !0 === glass ? defaultGlassProps : {
17118
17873
  ...defaultGlassProps,
@@ -17120,13 +17875,14 @@ const Tabs = memo((({items: items, activeIndex: activeIndex = TAB.DEFAULTS.ACTI
17120
17875
  };
17121
17876
  return jsx(AtomixGlass, {
17122
17877
  ...glassProps,
17123
- children: tabContent
17878
+ children: wrapper
17124
17879
  });
17125
17880
  }
17126
- return tabContent;
17881
+ return wrapper;
17127
17882
  }));
17128
17883
 
17129
- Tabs.displayName = "Tabs";
17884
+ Tabs.displayName = "Tabs", Tabs.List = TabsList, Tabs.Trigger = TabsTrigger, Tabs.Panels = TabsPanels,
17885
+ Tabs.Panel = TabsPanel;
17130
17886
 
17131
17887
  /**
17132
17888
  * Testimonial component for displaying customer quotes and feedback
@@ -17354,7 +18110,7 @@ const Toggle = ({checked: controlledChecked, defaultChecked: defaultChecked = !1
17354
18110
  blurAmount: 1,
17355
18111
  saturation: 160,
17356
18112
  aberrationIntensity: .5,
17357
- cornerRadius: 8,
18113
+ borderRadius: 8,
17358
18114
  mode: "shader"
17359
18115
  }, glassProps = !0 === glass ? defaultGlassProps : {
17360
18116
  ...defaultGlassProps,