@adam-milo/ui 1.0.29 → 1.0.31

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 (163) hide show
  1. package/dist/index.cjs +1 -1
  2. package/dist/index.js +3 -1
  3. package/dist/index10.cjs +1 -1
  4. package/dist/index10.js +1 -1
  5. package/dist/index11.cjs +1 -1
  6. package/dist/index11.js +1 -1
  7. package/dist/index12.cjs +1 -1
  8. package/dist/index12.js +1 -1
  9. package/dist/index13.cjs +1 -1
  10. package/dist/index13.js +1 -1
  11. package/dist/index14.cjs +1 -1
  12. package/dist/index14.js +1 -1
  13. package/dist/index15.cjs +1 -1
  14. package/dist/index15.js +2 -2
  15. package/dist/index16.cjs +1 -1
  16. package/dist/index16.js +1 -1
  17. package/dist/index17.cjs +1 -1
  18. package/dist/index17.js +1 -1
  19. package/dist/index18.cjs +1 -1
  20. package/dist/index18.js +1 -1
  21. package/dist/index2.cjs +1 -1
  22. package/dist/index2.js +1 -1
  23. package/dist/index20.cjs +1 -1
  24. package/dist/index20.js +53 -12
  25. package/dist/index21.cjs +1 -0
  26. package/dist/index21.js +14 -0
  27. package/dist/index23.cjs +1 -1
  28. package/dist/index23.js +20 -299
  29. package/dist/index24.cjs +1 -1
  30. package/dist/index24.js +298 -13
  31. package/dist/index25.cjs +1 -0
  32. package/dist/index25.js +16 -0
  33. package/dist/{index27.cjs → index28.cjs} +1 -1
  34. package/dist/{index27.js → index28.js} +21 -21
  35. package/dist/index3.cjs +1 -1
  36. package/dist/index3.js +2 -2
  37. package/dist/index4.cjs +1 -1
  38. package/dist/index4.js +1 -1
  39. package/dist/index42.cjs +1 -1
  40. package/dist/index42.js +16 -6
  41. package/dist/index44.cjs +1 -1
  42. package/dist/index44.js +3 -36
  43. package/dist/index45.cjs +1 -1
  44. package/dist/index45.js +6 -59
  45. package/dist/index46.cjs +1 -1
  46. package/dist/index46.js +67 -7
  47. package/dist/index47.cjs +1 -1
  48. package/dist/index47.js +28 -201
  49. package/dist/index48.cjs +1 -1
  50. package/dist/index48.js +58 -23
  51. package/dist/index49.cjs +1 -1
  52. package/dist/index49.js +6 -204
  53. package/dist/index5.cjs +1 -1
  54. package/dist/index5.js +1 -1
  55. package/dist/index50.cjs +1 -1
  56. package/dist/index50.js +208 -10
  57. package/dist/index51.cjs +1 -1
  58. package/dist/index51.js +22 -286
  59. package/dist/index52.cjs +1 -1
  60. package/dist/index52.js +203 -13
  61. package/dist/index53.cjs +1 -1
  62. package/dist/index53.js +10 -39
  63. package/dist/index54.cjs +1 -1
  64. package/dist/index54.js +283 -79
  65. package/dist/index55.cjs +1 -1
  66. package/dist/index55.js +15 -11
  67. package/dist/index56.cjs +1 -1
  68. package/dist/index56.js +38 -66
  69. package/dist/index57.cjs +1 -1
  70. package/dist/index57.js +86 -3
  71. package/dist/index58.cjs +1 -1
  72. package/dist/index58.js +10 -10
  73. package/dist/index59.cjs +1 -1
  74. package/dist/index59.js +66 -29
  75. package/dist/index6.cjs +1 -1
  76. package/dist/index6.js +2 -2
  77. package/dist/index60.cjs +1 -1
  78. package/dist/index60.js +3 -119
  79. package/dist/index61.cjs +1 -1
  80. package/dist/index61.js +11 -8
  81. package/dist/index62.cjs +1 -0
  82. package/dist/index62.js +34 -0
  83. package/dist/index63.cjs +1 -1
  84. package/dist/index63.js +118 -13
  85. package/dist/index64.cjs +1 -1
  86. package/dist/index64.js +7 -293
  87. package/dist/index65.cjs +1 -1
  88. package/dist/index65.js +14 -22
  89. package/dist/index66.cjs +1 -1
  90. package/dist/index66.js +291 -33
  91. package/dist/index67.cjs +1 -1
  92. package/dist/index67.js +22 -622
  93. package/dist/index68.cjs +1 -1
  94. package/dist/index68.js +35 -35
  95. package/dist/index69.cjs +1 -1
  96. package/dist/index69.js +620 -33
  97. package/dist/index7.cjs +1 -1
  98. package/dist/index7.js +1 -1
  99. package/dist/index70.cjs +1 -1
  100. package/dist/index70.js +37 -5
  101. package/dist/index71.cjs +1 -1
  102. package/dist/index71.js +36 -8
  103. package/dist/index72.cjs +1 -1
  104. package/dist/index72.js +5 -3
  105. package/dist/index73.cjs +1 -1
  106. package/dist/index73.js +8 -33
  107. package/dist/index74.cjs +1 -1
  108. package/dist/index74.js +3 -178
  109. package/dist/index75.cjs +1 -1
  110. package/dist/index75.js +31 -17
  111. package/dist/index76.cjs +1 -1
  112. package/dist/index76.js +165 -706
  113. package/dist/index77.cjs +1 -1
  114. package/dist/index77.js +16 -149
  115. package/dist/index78.cjs +1 -1
  116. package/dist/index78.js +697 -149
  117. package/dist/index79.cjs +1 -1
  118. package/dist/index79.js +146 -80
  119. package/dist/index8.cjs +1 -1
  120. package/dist/index8.js +1 -1
  121. package/dist/index80.cjs +1 -1
  122. package/dist/index80.js +170 -44
  123. package/dist/index81.cjs +1 -1
  124. package/dist/index81.js +44 -10
  125. package/dist/index82.cjs +1 -1
  126. package/dist/index82.js +11 -17
  127. package/dist/index83.cjs +1 -1
  128. package/dist/index83.js +14 -97
  129. package/dist/index84.cjs +1 -1
  130. package/dist/index84.js +99 -8
  131. package/dist/index85.cjs +1 -1
  132. package/dist/index85.js +82 -23
  133. package/dist/index86.cjs +1 -1
  134. package/dist/index86.js +8 -34
  135. package/dist/index87.cjs +1 -1
  136. package/dist/index87.js +27 -14
  137. package/dist/index88.cjs +1 -1
  138. package/dist/index88.js +30 -41
  139. package/dist/index89.cjs +1 -1
  140. package/dist/index89.js +13 -6
  141. package/dist/index9.cjs +1 -1
  142. package/dist/index9.js +2 -2
  143. package/dist/index90.cjs +1 -0
  144. package/dist/index90.js +48 -0
  145. package/dist/index91.cjs +1 -0
  146. package/dist/index91.js +9 -0
  147. package/dist/src/components/forms/radio/Radio.component.d.ts.map +1 -1
  148. package/dist/src/components/layout/grid/Grid.component.d.ts +53 -0
  149. package/dist/src/components/layout/grid/Grid.component.d.ts.map +1 -0
  150. package/dist/src/index.d.ts +2 -0
  151. package/dist/src/index.d.ts.map +1 -1
  152. package/dist/style.css +1 -1
  153. package/package.json +2 -1
  154. package/dist/index22.cjs +0 -1
  155. package/dist/index22.js +0 -22
  156. package/dist/index40.cjs +0 -1
  157. package/dist/index40.js +0 -21
  158. package/dist/index41.cjs +0 -1
  159. package/dist/index41.js +0 -6
  160. package/dist/index43.cjs +0 -1
  161. package/dist/index43.js +0 -70
  162. /package/dist/{index35.cjs → index36.cjs} +0 -0
  163. /package/dist/{index35.js → index36.js} +0 -0
package/dist/index52.js CHANGED
@@ -1,18 +1,208 @@
1
1
  import * as React from "react";
2
- import ReactDOM__default from "react-dom";
3
- import { Primitive } from "./index53.js";
4
- import { useLayoutEffect as useLayoutEffect2 } from "./index57.js";
2
+ import { useComposedRefs } from "./index47.js";
3
+ import { Primitive } from "./index56.js";
4
+ import { useCallbackRef } from "./index58.js";
5
5
  import { jsx } from "react/jsx-runtime";
6
- var PORTAL_NAME = "Portal";
7
- var Portal = React.forwardRef((props, forwardedRef) => {
8
- var _a;
9
- const { container: containerProp, ...portalProps } = props;
10
- const [mounted, setMounted] = React.useState(false);
11
- useLayoutEffect2(() => setMounted(true), []);
12
- const container = containerProp || mounted && ((_a = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : _a.body);
13
- return container ? ReactDOM__default.createPortal(/* @__PURE__ */ jsx(Primitive.div, { ...portalProps, ref: forwardedRef }), container) : null;
6
+ var AUTOFOCUS_ON_MOUNT = "focusScope.autoFocusOnMount";
7
+ var AUTOFOCUS_ON_UNMOUNT = "focusScope.autoFocusOnUnmount";
8
+ var EVENT_OPTIONS = { bubbles: false, cancelable: true };
9
+ var FOCUS_SCOPE_NAME = "FocusScope";
10
+ var FocusScope = React.forwardRef((props, forwardedRef) => {
11
+ const {
12
+ loop = false,
13
+ trapped = false,
14
+ onMountAutoFocus: onMountAutoFocusProp,
15
+ onUnmountAutoFocus: onUnmountAutoFocusProp,
16
+ ...scopeProps
17
+ } = props;
18
+ const [container, setContainer] = React.useState(null);
19
+ const onMountAutoFocus = useCallbackRef(onMountAutoFocusProp);
20
+ const onUnmountAutoFocus = useCallbackRef(onUnmountAutoFocusProp);
21
+ const lastFocusedElementRef = React.useRef(null);
22
+ const composedRefs = useComposedRefs(forwardedRef, (node) => setContainer(node));
23
+ const focusScope = React.useRef({
24
+ paused: false,
25
+ pause() {
26
+ this.paused = true;
27
+ },
28
+ resume() {
29
+ this.paused = false;
30
+ }
31
+ }).current;
32
+ React.useEffect(() => {
33
+ if (trapped) {
34
+ let handleFocusIn2 = function(event) {
35
+ if (focusScope.paused || !container) return;
36
+ const target = event.target;
37
+ if (container.contains(target)) {
38
+ lastFocusedElementRef.current = target;
39
+ } else {
40
+ focus(lastFocusedElementRef.current, { select: true });
41
+ }
42
+ }, handleFocusOut2 = function(event) {
43
+ if (focusScope.paused || !container) return;
44
+ const relatedTarget = event.relatedTarget;
45
+ if (relatedTarget === null) return;
46
+ if (!container.contains(relatedTarget)) {
47
+ focus(lastFocusedElementRef.current, { select: true });
48
+ }
49
+ }, handleMutations2 = function(mutations) {
50
+ const focusedElement = document.activeElement;
51
+ if (focusedElement !== document.body) return;
52
+ for (const mutation of mutations) {
53
+ if (mutation.removedNodes.length > 0) focus(container);
54
+ }
55
+ };
56
+ document.addEventListener("focusin", handleFocusIn2);
57
+ document.addEventListener("focusout", handleFocusOut2);
58
+ const mutationObserver = new MutationObserver(handleMutations2);
59
+ if (container) mutationObserver.observe(container, { childList: true, subtree: true });
60
+ return () => {
61
+ document.removeEventListener("focusin", handleFocusIn2);
62
+ document.removeEventListener("focusout", handleFocusOut2);
63
+ mutationObserver.disconnect();
64
+ };
65
+ }
66
+ }, [trapped, container, focusScope.paused]);
67
+ React.useEffect(() => {
68
+ if (container) {
69
+ focusScopesStack.add(focusScope);
70
+ const previouslyFocusedElement = document.activeElement;
71
+ const hasFocusedCandidate = container.contains(previouslyFocusedElement);
72
+ if (!hasFocusedCandidate) {
73
+ const mountEvent = new CustomEvent(AUTOFOCUS_ON_MOUNT, EVENT_OPTIONS);
74
+ container.addEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
75
+ container.dispatchEvent(mountEvent);
76
+ if (!mountEvent.defaultPrevented) {
77
+ focusFirst(removeLinks(getTabbableCandidates(container)), { select: true });
78
+ if (document.activeElement === previouslyFocusedElement) {
79
+ focus(container);
80
+ }
81
+ }
82
+ }
83
+ return () => {
84
+ container.removeEventListener(AUTOFOCUS_ON_MOUNT, onMountAutoFocus);
85
+ setTimeout(() => {
86
+ const unmountEvent = new CustomEvent(AUTOFOCUS_ON_UNMOUNT, EVENT_OPTIONS);
87
+ container.addEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
88
+ container.dispatchEvent(unmountEvent);
89
+ if (!unmountEvent.defaultPrevented) {
90
+ focus(previouslyFocusedElement ?? document.body, { select: true });
91
+ }
92
+ container.removeEventListener(AUTOFOCUS_ON_UNMOUNT, onUnmountAutoFocus);
93
+ focusScopesStack.remove(focusScope);
94
+ }, 0);
95
+ };
96
+ }
97
+ }, [container, onMountAutoFocus, onUnmountAutoFocus, focusScope]);
98
+ const handleKeyDown = React.useCallback(
99
+ (event) => {
100
+ if (!loop && !trapped) return;
101
+ if (focusScope.paused) return;
102
+ const isTabKey = event.key === "Tab" && !event.altKey && !event.ctrlKey && !event.metaKey;
103
+ const focusedElement = document.activeElement;
104
+ if (isTabKey && focusedElement) {
105
+ const container2 = event.currentTarget;
106
+ const [first, last] = getTabbableEdges(container2);
107
+ const hasTabbableElementsInside = first && last;
108
+ if (!hasTabbableElementsInside) {
109
+ if (focusedElement === container2) event.preventDefault();
110
+ } else {
111
+ if (!event.shiftKey && focusedElement === last) {
112
+ event.preventDefault();
113
+ if (loop) focus(first, { select: true });
114
+ } else if (event.shiftKey && focusedElement === first) {
115
+ event.preventDefault();
116
+ if (loop) focus(last, { select: true });
117
+ }
118
+ }
119
+ }
120
+ },
121
+ [loop, trapped, focusScope.paused]
122
+ );
123
+ return /* @__PURE__ */ jsx(Primitive.div, { tabIndex: -1, ...scopeProps, ref: composedRefs, onKeyDown: handleKeyDown });
14
124
  });
15
- Portal.displayName = PORTAL_NAME;
125
+ FocusScope.displayName = FOCUS_SCOPE_NAME;
126
+ function focusFirst(candidates, { select = false } = {}) {
127
+ const previouslyFocusedElement = document.activeElement;
128
+ for (const candidate of candidates) {
129
+ focus(candidate, { select });
130
+ if (document.activeElement !== previouslyFocusedElement) return;
131
+ }
132
+ }
133
+ function getTabbableEdges(container) {
134
+ const candidates = getTabbableCandidates(container);
135
+ const first = findVisible(candidates, container);
136
+ const last = findVisible(candidates.reverse(), container);
137
+ return [first, last];
138
+ }
139
+ function getTabbableCandidates(container) {
140
+ const nodes = [];
141
+ const walker = document.createTreeWalker(container, NodeFilter.SHOW_ELEMENT, {
142
+ acceptNode: (node) => {
143
+ const isHiddenInput = node.tagName === "INPUT" && node.type === "hidden";
144
+ if (node.disabled || node.hidden || isHiddenInput) return NodeFilter.FILTER_SKIP;
145
+ return node.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
146
+ }
147
+ });
148
+ while (walker.nextNode()) nodes.push(walker.currentNode);
149
+ return nodes;
150
+ }
151
+ function findVisible(elements, container) {
152
+ for (const element of elements) {
153
+ if (!isHidden(element, { upTo: container })) return element;
154
+ }
155
+ }
156
+ function isHidden(node, { upTo }) {
157
+ if (getComputedStyle(node).visibility === "hidden") return true;
158
+ while (node) {
159
+ if (upTo !== void 0 && node === upTo) return false;
160
+ if (getComputedStyle(node).display === "none") return true;
161
+ node = node.parentElement;
162
+ }
163
+ return false;
164
+ }
165
+ function isSelectableInput(element) {
166
+ return element instanceof HTMLInputElement && "select" in element;
167
+ }
168
+ function focus(element, { select = false } = {}) {
169
+ if (element && element.focus) {
170
+ const previouslyFocusedElement = document.activeElement;
171
+ element.focus({ preventScroll: true });
172
+ if (element !== previouslyFocusedElement && isSelectableInput(element) && select)
173
+ element.select();
174
+ }
175
+ }
176
+ var focusScopesStack = createFocusScopesStack();
177
+ function createFocusScopesStack() {
178
+ let stack = [];
179
+ return {
180
+ add(focusScope) {
181
+ const activeFocusScope = stack[0];
182
+ if (focusScope !== activeFocusScope) {
183
+ activeFocusScope == null ? void 0 : activeFocusScope.pause();
184
+ }
185
+ stack = arrayRemove(stack, focusScope);
186
+ stack.unshift(focusScope);
187
+ },
188
+ remove(focusScope) {
189
+ var _a;
190
+ stack = arrayRemove(stack, focusScope);
191
+ (_a = stack[0]) == null ? void 0 : _a.resume();
192
+ }
193
+ };
194
+ }
195
+ function arrayRemove(array, item) {
196
+ const updatedArray = [...array];
197
+ const index = updatedArray.indexOf(item);
198
+ if (index !== -1) {
199
+ updatedArray.splice(index, 1);
200
+ }
201
+ return updatedArray;
202
+ }
203
+ function removeLinks(items) {
204
+ return items.filter((item) => item.tagName !== "A");
205
+ }
16
206
  export {
17
- Portal
207
+ FocusScope
18
208
  };
package/dist/index53.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("react-dom"),r=require("./index54.cjs"),i=require("react/jsx-runtime");function n(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const i=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,i.get?i:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}const o=n(e),c=n(t);var u=["a","button","div","form","h2","h3","img","input","label","li","nav","ol","p","select","span","svg","ul"].reduce((e,t)=>{const n=r.createSlot(`Primitive.${t}`),c=o.forwardRef((e,r)=>{const{asChild:o,...c}=e,u=o?n:t;return"undefined"!=typeof window&&(window[Symbol.for("radix-ui")]=!0),i.jsx(u,{...c,ref:r})});return c.displayName=`Primitive.${t}`,{...e,[t]:c}},{});exports.Primitive=u,exports.dispatchDiscreteCustomEvent=function(e,t){e&&c.flushSync(()=>e.dispatchEvent(t))};
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),t=require("./index60.cjs");function r(e){const t=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const r in e)if("default"!==r){const n=Object.getOwnPropertyDescriptor(e,r);Object.defineProperty(t,r,n.get?n:{enumerable:!0,get:()=>e[r]})}return t.default=e,Object.freeze(t)}const n=r(e);var o=n[" useId ".trim().toString()]||(()=>{}),u=0;exports.useId=function(e){const[r,c]=n.useState(o());return t.useLayoutEffect(()=>{c(e=>e??String(u++))},[e]),e||(r?`radix-${r}`:"")};
package/dist/index53.js CHANGED
@@ -1,43 +1,14 @@
1
1
  import * as React from "react";
2
- import * as ReactDOM from "react-dom";
3
- import { createSlot } from "./index54.js";
4
- import { jsx } from "react/jsx-runtime";
5
- var NODES = [
6
- "a",
7
- "button",
8
- "div",
9
- "form",
10
- "h2",
11
- "h3",
12
- "img",
13
- "input",
14
- "label",
15
- "li",
16
- "nav",
17
- "ol",
18
- "p",
19
- "select",
20
- "span",
21
- "svg",
22
- "ul"
23
- ];
24
- var Primitive = NODES.reduce((primitive, node) => {
25
- const Slot = createSlot(`Primitive.${node}`);
26
- const Node = React.forwardRef((props, forwardedRef) => {
27
- const { asChild, ...primitiveProps } = props;
28
- const Comp = asChild ? Slot : node;
29
- if (typeof window !== "undefined") {
30
- window[Symbol.for("radix-ui")] = true;
31
- }
32
- return /* @__PURE__ */ jsx(Comp, { ...primitiveProps, ref: forwardedRef });
33
- });
34
- Node.displayName = `Primitive.${node}`;
35
- return { ...primitive, [node]: Node };
36
- }, {});
37
- function dispatchDiscreteCustomEvent(target, event) {
38
- if (target) ReactDOM.flushSync(() => target.dispatchEvent(event));
2
+ import { useLayoutEffect as useLayoutEffect2 } from "./index60.js";
3
+ var useReactId = React[" useId ".trim().toString()] || (() => void 0);
4
+ var count = 0;
5
+ function useId(deterministicId) {
6
+ const [id, setId] = React.useState(useReactId());
7
+ useLayoutEffect2(() => {
8
+ setId((reactId) => reactId ?? String(count++));
9
+ }, [deterministicId]);
10
+ return deterministicId || (id ? `radix-${id}` : "");
39
11
  }
40
12
  export {
41
- Primitive,
42
- dispatchDiscreteCustomEvent
13
+ useId
43
14
  };
package/dist/index54.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),r=require("./index44.cjs"),n=require("react/jsx-runtime");function t(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const n in e)if("default"!==n){const t=Object.getOwnPropertyDescriptor(e,n);Object.defineProperty(r,n,t.get?t:{enumerable:!0,get:()=>e[n]})}return r.default=e,Object.freeze(r)}const o=t(e);function i(e){const n=o.forwardRef((e,n)=>{const{children:t,...i}=e;if(o.isValidElement(t)){const e=function(e){var r,n;let t=null==(r=Object.getOwnPropertyDescriptor(e.props,"ref"))?void 0:r.get,o=t&&"isReactWarning"in t&&t.isReactWarning;if(o)return e.ref;if(t=null==(n=Object.getOwnPropertyDescriptor(e,"ref"))?void 0:n.get,o=t&&"isReactWarning"in t&&t.isReactWarning,o)return e.props.ref;return e.props.ref||e.ref}(t),l=function(e,r){const n={...r};for(const t in r){const o=e[t],i=r[t];/^on[A-Z]/.test(t)?o&&i?n[t]=(...e)=>{const r=i(...e);return o(...e),r}:o&&(n[t]=o):"style"===t?n[t]={...o,...i}:"className"===t&&(n[t]=[o,i].filter(Boolean).join(" "))}return{...e,...n}}(i,t.props);return t.type!==o.Fragment&&(l.ref=n?r.composeRefs(n,e):e),o.cloneElement(t,l)}return o.Children.count(t)>1?o.Children.only(null):null});return n.displayName=`${e}.SlotClone`,n}var l=Symbol("radix.slottable");function c(e){return o.isValidElement(e)&&"function"==typeof e.type&&"__radixId"in e.type&&e.type.__radixId===l}exports.createSlot=function(e){const r=i(e),t=o.forwardRef((e,t)=>{const{children:i,...l}=e,s=o.Children.toArray(i),u=s.find(c);if(u){const e=u.props.children,i=s.map(r=>r===u?o.Children.count(e)>1?o.Children.only(null):o.isValidElement(e)?e.props.children:null:r);return n.jsx(r,{...l,ref:t,children:o.isValidElement(e)?o.cloneElement(e,void 0,i):null})}return n.jsx(r,{...l,ref:t,children:i})});return t.displayName=`${e}.Slot`,t};
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("react"),r=require("./index66.cjs"),t=require("./index67.cjs"),o=require("./index47.cjs"),i=require("./index48.cjs"),n=require("./index56.cjs"),a=require("./index58.cjs"),s=require("./index60.cjs"),l=require("./index68.cjs"),d=require("react/jsx-runtime"),p=require("./index69.cjs");function c(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e)for(const t in e)if("default"!==t){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:()=>e[t]})}return r.default=e,Object.freeze(r)}const u=c(e);var f="Popper",[h,x]=i.createContextScope(f),[g,m]=h(f),y=e=>{const{__scopePopper:r,children:t}=e,[o,i]=u.useState(null);return d.jsx(g,{scope:r,anchor:o,onAnchorChange:i,children:t})};y.displayName=f;var w="PopperAnchor",v=u.forwardRef((e,r)=>{const{__scopePopper:t,virtualRef:i,...a}=e,s=m(w,t),l=u.useRef(null),p=o.useComposedRefs(r,l),c=u.useRef(null);return u.useEffect(()=>{const e=c.current;c.current=(null==i?void 0:i.current)||l.current,e!==c.current&&s.onAnchorChange(c.current)}),i?null:d.jsx(n.Primitive.div,{...a,ref:p})});v.displayName=w;var P="PopperContent",[b,j]=h(P),S=u.forwardRef((e,t)=>{var i,c,f,h,x,g;const{__scopePopper:y,side:w="bottom",sideOffset:v=0,align:j="center",alignOffset:S=0,arrowPadding:A=0,avoidCollisions:O=!0,collisionBoundary:C=[],collisionPadding:_=0,sticky:H="partial",hideWhenDetached:z=!1,updatePositionStrategy:E="optimized",onPlaced:W,...Y}=e,D=m(P,y),[N,X]=u.useState(null),k=o.useComposedRefs(t,e=>X(e)),[F,M]=u.useState(null),B=l.useSize(F),I=(null==B?void 0:B.width)??0,L=(null==B?void 0:B.height)??0,T=w+("center"!==j?"-"+j:""),U="number"==typeof _?_:{top:0,right:0,bottom:0,left:0,..._},G=Array.isArray(C)?C:[C],J=G.length>0,K={padding:U,boundary:G.filter(q),altBoundary:J},{refs:Q,floatingStyles:V,placement:Z,isPositioned:ee,middlewareData:re}=r.useFloating({strategy:"fixed",placement:T,whileElementsMounted:(...e)=>p.autoUpdate(...e,{animationFrame:"always"===E}),elements:{reference:D.anchor},middleware:[r.offset({mainAxis:v+L,alignmentAxis:S}),O&&r.shift({mainAxis:!0,crossAxis:!1,limiter:"partial"===H?r.limitShift():void 0,...K}),O&&r.flip({...K}),r.size({...K,apply:({elements:e,rects:r,availableWidth:t,availableHeight:o})=>{const{width:i,height:n}=r.reference,a=e.floating.style;a.setProperty("--radix-popper-available-width",`${t}px`),a.setProperty("--radix-popper-available-height",`${o}px`),a.setProperty("--radix-popper-anchor-width",`${i}px`),a.setProperty("--radix-popper-anchor-height",`${n}px`)}}),F&&r.arrow({element:F,padding:A}),R({arrowWidth:I,arrowHeight:L}),z&&r.hide({strategy:"referenceHidden",...K})]}),[te,oe]=$(Z),ie=a.useCallbackRef(W);s.useLayoutEffect(()=>{ee&&(null==ie||ie())},[ee,ie]);const ne=null==(i=re.arrow)?void 0:i.x,ae=null==(c=re.arrow)?void 0:c.y,se=0!==(null==(f=re.arrow)?void 0:f.centerOffset),[le,de]=u.useState();return s.useLayoutEffect(()=>{N&&de(window.getComputedStyle(N).zIndex)},[N]),d.jsx("div",{ref:Q.setFloating,"data-radix-popper-content-wrapper":"",style:{...V,transform:ee?V.transform:"translate(0, -200%)",minWidth:"max-content",zIndex:le,"--radix-popper-transform-origin":[null==(h=re.transformOrigin)?void 0:h.x,null==(x=re.transformOrigin)?void 0:x.y].join(" "),...(null==(g=re.hide)?void 0:g.referenceHidden)&&{visibility:"hidden",pointerEvents:"none"}},dir:e.dir,children:d.jsx(b,{scope:y,placedSide:te,onArrowChange:M,arrowX:ne,arrowY:ae,shouldHideArrow:se,children:d.jsx(n.Primitive.div,{"data-side":te,"data-align":oe,...Y,ref:k,style:{...Y.style,animation:ee?void 0:"none"}})})})});S.displayName=P;var A="PopperArrow",O={top:"bottom",right:"left",bottom:"top",left:"right"},C=u.forwardRef(function(e,r){const{__scopePopper:o,...i}=e,n=j(A,o),a=O[n.placedSide];return d.jsx("span",{ref:n.onArrowChange,style:{position:"absolute",left:n.arrowX,top:n.arrowY,[a]:0,transformOrigin:{top:"",right:"0 0",bottom:"center 0",left:"100% 0"}[n.placedSide],transform:{top:"translateY(100%)",right:"translateY(50%) rotate(90deg) translateX(-50%)",bottom:"rotate(180deg)",left:"translateY(50%) rotate(-90deg) translateX(50%)"}[n.placedSide],visibility:n.shouldHideArrow?"hidden":void 0},children:d.jsx(t.Root,{...i,ref:r,style:{...i.style,display:"block"}})})});function q(e){return null!==e}C.displayName=A;var R=e=>({name:"transformOrigin",options:e,fn(r){var t,o,i;const{placement:n,rects:a,middlewareData:s}=r,l=0!==(null==(t=s.arrow)?void 0:t.centerOffset),d=l?0:e.arrowWidth,p=l?0:e.arrowHeight,[c,u]=$(n),f={start:"0%",center:"50%",end:"100%"}[u],h=((null==(o=s.arrow)?void 0:o.x)??0)+d/2,x=((null==(i=s.arrow)?void 0:i.y)??0)+p/2;let g="",m="";return"bottom"===c?(g=l?f:`${h}px`,m=-p+"px"):"top"===c?(g=l?f:`${h}px`,m=`${a.floating.height+p}px`):"right"===c?(g=-p+"px",m=l?f:`${x}px`):"left"===c&&(g=`${a.floating.width+p}px`,m=l?f:`${x}px`),{data:{x:g,y:m}}}});function $(e){const[r,t="center"]=e.split("-");return[r,t]}var _=y,H=v,z=S,E=C;exports.Anchor=H,exports.Arrow=E,exports.Content=z,exports.Popper=y,exports.PopperAnchor=v,exports.PopperArrow=C,exports.PopperContent=S,exports.Root=_,exports.createPopperScope=x;