@konstructio/ui 0.1.2-alpha.3 → 0.1.2-alpha.30

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/DatePicker.css +1 -1
  2. package/dist/Modal-5xSxFoaD.js +99 -0
  3. package/dist/_commonjsHelpers-DaMA6jEr.js +8 -0
  4. package/dist/chevron-down-DgT-uSF9.js +5 -0
  5. package/dist/chevron-right-DYvXLeql.js +7 -0
  6. package/dist/chevron-up-DrQr2Fwd.js +5 -0
  7. package/dist/components/Alert/Alert.js +2 -2
  8. package/dist/components/AlertDialog/AlertDialog.js +1 -1
  9. package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
  10. package/dist/components/AlertDialog/components/index.js +1 -1
  11. package/dist/components/Badge/Badge.js +30 -33
  12. package/dist/components/Badge/Badge.variants.js +8 -6
  13. package/dist/components/Breadcrumb/Breadcrumb.js +1 -1
  14. package/dist/components/Breadcrumb/components/Item/Item.js +24 -23
  15. package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
  16. package/dist/components/Button/Button.js +1 -1
  17. package/dist/components/Button/Button.variants.js +1 -1
  18. package/dist/components/Card/Card.variants.js +5 -9
  19. package/dist/components/Checkbox/Checkbox.js +6 -6
  20. package/dist/components/Command/Command.js +2 -2
  21. package/dist/components/Command/components/Command.js +1 -1
  22. package/dist/components/Command/components/CommandEmpty.js +1 -1
  23. package/dist/components/Command/components/CommandGroup.js +1 -1
  24. package/dist/components/Command/components/CommandInput.js +2 -2
  25. package/dist/components/Command/components/CommandItem.js +1 -1
  26. package/dist/components/Command/components/CommandList.js +1 -1
  27. package/dist/components/Command/components/CommandSeparator.js +1 -1
  28. package/dist/components/Command/components/DialogContent.js +2 -2
  29. package/dist/components/Command/components/DialogOverlay.js +1 -1
  30. package/dist/components/Datepicker/DatePicker.js +1209 -1147
  31. package/dist/components/Divider/Divider.variants.js +1 -1
  32. package/dist/components/Dropdown/Dropdown.js +46 -28
  33. package/dist/components/Dropdown/Dropdown.variants.js +32 -9
  34. package/dist/components/Dropdown/components/List/List.js +133 -54
  35. package/dist/components/Dropdown/components/List/List.variants.js +9 -7
  36. package/dist/components/Dropdown/components/ListItem/ListItem.js +74 -24
  37. package/dist/components/Dropdown/components/ListItem/ListItem.variants.js +9 -7
  38. package/dist/components/Dropdown/components/Wrapper.js +144 -109
  39. package/dist/components/Dropdown/constants/index.js +4 -0
  40. package/dist/components/Dropdown/constants/pagination.js +4 -0
  41. package/dist/components/Dropdown/contexts/dropdown.context.js +26 -8
  42. package/dist/components/Dropdown/contexts/dropdown.provider.js +48 -19
  43. package/dist/components/Dropdown/hooks/useDropdown.js +83 -39
  44. package/dist/components/Dropdown/hooks/useNavigationList.js +28 -36
  45. package/dist/components/DropdownButton/DropdownButton.js +1 -1
  46. package/dist/components/Filter/Filter.variants.js +2 -2
  47. package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +1 -1
  48. package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +1 -1
  49. package/dist/components/Input/Input.js +1 -1
  50. package/dist/components/Input/Input.variants.js +1 -1
  51. package/dist/components/Loading/Loading.js +1 -7
  52. package/dist/components/Modal/Modal.js +2 -2
  53. package/dist/components/Modal/components/Body/Body.js +1 -1
  54. package/dist/components/Modal/components/Footer/Footer.js +1 -1
  55. package/dist/components/Modal/components/Header/Header.js +1 -1
  56. package/dist/components/Modal/components/Wrapper/Wrapper.js +3 -3
  57. package/dist/components/Modal/components/index.js +1 -1
  58. package/dist/components/NumberInput/NumberInput.js +2 -2
  59. package/dist/components/PhoneNumberInput/PhoneNumberInput.js +8 -0
  60. package/dist/components/PhoneNumberInput/PhoneNumberInput.variants.js +45 -0
  61. package/dist/components/PhoneNumberInput/components/FlagContent/FlagContent.js +27 -0
  62. package/dist/components/PhoneNumberInput/components/FlagSelectorList/FlagSelectorList.js +629 -0
  63. package/dist/components/PhoneNumberInput/components/FlagSelectorWrapper/FlagSelectorWrapper.js +36 -0
  64. package/dist/components/PhoneNumberInput/components/TruncateText/TruncateText.js +45 -0
  65. package/dist/components/PhoneNumberInput/components/Wrapper.js +625 -0
  66. package/dist/components/PhoneNumberInput/components/index.js +6 -0
  67. package/dist/components/PhoneNumberInput/contexts/index.js +8 -0
  68. package/dist/components/PhoneNumberInput/contexts/phone-number.context.js +28 -0
  69. package/dist/components/PhoneNumberInput/contexts/phone-number.hook.js +13 -0
  70. package/dist/components/PhoneNumberInput/contexts/phone-number.provider.js +6137 -0
  71. package/dist/components/PhoneNumberInput/utils/index.js +11 -0
  72. package/dist/components/PieChart/PieChart.js +647 -664
  73. package/dist/components/RadioCard/RadioCard.variants.js +1 -6
  74. package/dist/components/RadioGroup/RadioGroup.js +1 -1
  75. package/dist/components/Range/Range.js +1 -1
  76. package/dist/components/Sidebar/Sidebar.variants.js +2 -2
  77. package/dist/components/Sidebar/components/Wrapper/Wrapper.js +29 -28
  78. package/dist/components/Slider/Slider.js +1 -1
  79. package/dist/components/Switch/Switch.js +8 -8
  80. package/dist/components/Switch/Switch.variants.js +4 -4
  81. package/dist/components/Tabs/Tabs.js +1 -1
  82. package/dist/components/Tabs/Tabs.variants.js +45 -24
  83. package/dist/components/Tabs/components/Content.js +1 -1
  84. package/dist/components/Tabs/components/List.js +1 -1
  85. package/dist/components/Tabs/components/Trigger.js +9 -8
  86. package/dist/components/Tag/Tag.js +1 -1
  87. package/dist/components/TagSelect/components/Wrapper/Wrapper.js +98 -49
  88. package/dist/components/TimePicker/TimePicker.variants.js +2 -2
  89. package/dist/components/TimePicker/components/Wrapper/Wrapper.js +2 -2
  90. package/dist/components/Toast/Toast.js +206 -181
  91. package/dist/components/Tooltip/Tooltip.js +1 -1
  92. package/dist/components/Typography/Typography.variants.js +18 -23
  93. package/dist/components/VirtualizedTable/VirtualizedTable.js +119 -0
  94. package/dist/components/VirtualizedTable/VirtualizedTable.variants.js +5 -0
  95. package/dist/components/VirtualizedTable/assets/chevron-down.js +25 -0
  96. package/dist/components/VirtualizedTable/assets/chevron-up.js +25 -0
  97. package/dist/components/VirtualizedTable/assets/index.js +6 -0
  98. package/dist/components/VirtualizedTable/components/Actions/Actions.js +72 -0
  99. package/dist/components/VirtualizedTable/components/Body/Body.js +51 -0
  100. package/dist/components/VirtualizedTable/components/DotPaginate/DotPaginate.js +165 -0
  101. package/dist/components/VirtualizedTable/components/DropdownPaginate/DropdownPaginate.js +34 -0
  102. package/dist/components/VirtualizedTable/components/Filter/Filter.js +88 -0
  103. package/dist/components/VirtualizedTable/components/FormPaginate/FormPaginate.js +48 -0
  104. package/dist/components/VirtualizedTable/components/Header/Header.js +84 -0
  105. package/dist/components/VirtualizedTable/components/Pagination/Pagination.js +53 -0
  106. package/dist/components/VirtualizedTable/components/Skeleton/Skeleton.js +67 -0
  107. package/dist/components/VirtualizedTable/components/TruncateText/TruncateText.js +34 -0
  108. package/dist/components/VirtualizedTable/components/WrapperBody/WrapperBody.js +27 -0
  109. package/dist/components/VirtualizedTable/components/index.js +16 -0
  110. package/dist/components/VirtualizedTable/constants/index.js +5 -0
  111. package/dist/components/VirtualizedTable/constants/pagination.js +5 -0
  112. package/dist/components/VirtualizedTable/contexts/index.js +8 -0
  113. package/dist/components/VirtualizedTable/contexts/table.context.js +32 -0
  114. package/dist/components/VirtualizedTable/contexts/table.hook.js +11 -0
  115. package/dist/components/VirtualizedTable/contexts/table.provider.js +85 -0
  116. package/dist/components/index.js +79 -73
  117. package/dist/contexts/theme.provider.js +0 -1
  118. package/dist/{createLucideIcon-DbC6TvM5.js → createLucideIcon-D4r5Phnh.js} +0 -24
  119. package/dist/debounce-BFejQm9P.js +200 -0
  120. package/dist/ellipsis-vertical-BVPtjl5f.js +9 -0
  121. package/dist/{index-h-Ul0anl.js → index--V_ZsiQe.js} +1 -22
  122. package/dist/index-2hB40Iuc.js +1873 -0
  123. package/dist/index-BZPx6jYI.js +8 -0
  124. package/dist/{index-bwWKd82e.js → index-BbQkJE5L.js} +1 -1
  125. package/dist/index-BtQfgaSF.js +60 -0
  126. package/dist/index-C3tHPg8y.js +662 -0
  127. package/dist/index-CIAmiWcw.js +200 -0
  128. package/dist/index-CSFe9uC5.js +14 -0
  129. package/dist/index-CSWGJT-v.js +1722 -0
  130. package/dist/index-CigKKiZS.js +91 -0
  131. package/dist/index-DDByhzds.js +137 -0
  132. package/dist/{index-BAraV3ai.js → index-DH2Fnov1.js} +11 -12
  133. package/dist/index-DLcqcWxM.js +29 -0
  134. package/dist/index-Dbt2vBmS.js +136 -0
  135. package/dist/{index-DB2XhXHn.js → index-DpW9ExsS.js} +7 -7
  136. package/dist/index-DrWQH0QF.js +55 -0
  137. package/dist/{index-D3xzCzcO.js → index-X4k_cU8k.js} +4 -4
  138. package/dist/index-kyuBfLcN.js +479 -0
  139. package/dist/{index-C1g_chDT.js → index-mPY_8Y5v.js} +2 -2
  140. package/dist/index-ohdbKsws.js +27 -0
  141. package/dist/index.d.ts +184 -18
  142. package/dist/index.js +106 -98
  143. package/dist/libphonenumber-_7ZyKWA7.js +11549 -0
  144. package/dist/package.json +46 -32
  145. package/dist/styles.css +1 -1
  146. package/dist/ui/civo-theme.css +191 -167
  147. package/dist/{useBreadcrumb-B8DnuqkR.js → useBreadcrumb-BAHbGQ_O.js} +0 -10
  148. package/dist/utils/index.js +534 -501
  149. package/dist/{x-BPcqkRZd.js → x-DPU9OdYH.js} +1 -1
  150. package/package.json +46 -32
  151. package/dist/Modal-V67Uz78z.js +0 -98
  152. package/dist/_commonjsHelpers-C6fGbg64.js +0 -6
  153. package/dist/chevron-down-BLZPftpV.js +0 -11
  154. package/dist/chevron-up-RLP4nX7V.js +0 -54
  155. package/dist/index-BXuxPoz7.js +0 -435
  156. package/dist/index-BfXxHr_2.js +0 -125
  157. package/dist/index-C9T9HQaa.js +0 -423
  158. package/dist/index-CZnD2QxM.js +0 -32
  159. package/dist/index-CrBonFvu.js +0 -144
  160. package/dist/index-Cvx4lqTq.js +0 -47
  161. package/dist/index-DQH6odE9.js +0 -82
  162. package/dist/index-Oq5GlCHP.js +0 -131
  163. package/dist/index-iXyXtdgP.js +0 -31
@@ -0,0 +1,479 @@
1
+ import * as i from "react";
2
+ import { P as O, a as Ee, c as ye, b as _, e as he } from "./index-CIAmiWcw.js";
3
+ import { u as F, c as Ce } from "./index-DLcqcWxM.js";
4
+ import { u as w } from "./index-BbQkJE5L.js";
5
+ import { D as De } from "./index-Dbt2vBmS.js";
6
+ import { u as $ } from "./index-0ioNhtNM.js";
7
+ import { jsx as u, jsxs as j, Fragment as B } from "react/jsx-runtime";
8
+ import { P as be } from "./index-CSFe9uC5.js";
9
+ import { P as U } from "./index-mPY_8Y5v.js";
10
+ import { R as Re } from "./Combination-VYaRRJBZ.js";
11
+ var x = "focusScope.autoFocusOnMount", W = "focusScope.autoFocusOnUnmount", q = { bubbles: !1, cancelable: !0 }, Ae = "FocusScope", Q = i.forwardRef((e, t) => {
12
+ const {
13
+ loop: n = !1,
14
+ trapped: o = !1,
15
+ onMountAutoFocus: r,
16
+ onUnmountAutoFocus: a,
17
+ ...l
18
+ } = e, [s, m] = i.useState(null), p = $(r), E = $(a), c = i.useRef(null), d = F(t, (f) => m(f)), v = i.useRef({
19
+ paused: !1,
20
+ pause() {
21
+ this.paused = !0;
22
+ },
23
+ resume() {
24
+ this.paused = !1;
25
+ }
26
+ }).current;
27
+ i.useEffect(() => {
28
+ if (o) {
29
+ let f = function(C) {
30
+ if (v.paused || !s) return;
31
+ const h = C.target;
32
+ s.contains(h) ? c.current = h : b(c.current, { select: !0 });
33
+ }, D = function(C) {
34
+ if (v.paused || !s) return;
35
+ const h = C.relatedTarget;
36
+ h !== null && (s.contains(h) || b(c.current, { select: !0 }));
37
+ }, g = function(C) {
38
+ if (document.activeElement === document.body)
39
+ for (const H of C)
40
+ H.removedNodes.length > 0 && b(s);
41
+ };
42
+ document.addEventListener("focusin", f), document.addEventListener("focusout", D);
43
+ const N = new MutationObserver(g);
44
+ return s && N.observe(s, { childList: !0, subtree: !0 }), () => {
45
+ document.removeEventListener("focusin", f), document.removeEventListener("focusout", D), N.disconnect();
46
+ };
47
+ }
48
+ }, [o, s, v.paused]), i.useEffect(() => {
49
+ if (s) {
50
+ Y.add(v);
51
+ const f = document.activeElement;
52
+ if (!s.contains(f)) {
53
+ const g = new CustomEvent(x, q);
54
+ s.addEventListener(x, p), s.dispatchEvent(g), g.defaultPrevented || (Oe(Ie(X(s)), { select: !0 }), document.activeElement === f && b(s));
55
+ }
56
+ return () => {
57
+ s.removeEventListener(x, p), setTimeout(() => {
58
+ const g = new CustomEvent(W, q);
59
+ s.addEventListener(W, E), s.dispatchEvent(g), g.defaultPrevented || b(f ?? document.body, { select: !0 }), s.removeEventListener(W, E), Y.remove(v);
60
+ }, 0);
61
+ };
62
+ }
63
+ }, [s, p, E, v]);
64
+ const P = i.useCallback(
65
+ (f) => {
66
+ if (!n && !o || v.paused) return;
67
+ const D = f.key === "Tab" && !f.altKey && !f.ctrlKey && !f.metaKey, g = document.activeElement;
68
+ if (D && g) {
69
+ const N = f.currentTarget, [C, h] = Ne(N);
70
+ C && h ? !f.shiftKey && g === h ? (f.preventDefault(), n && b(C, { select: !0 })) : f.shiftKey && g === C && (f.preventDefault(), n && b(h, { select: !0 })) : g === N && f.preventDefault();
71
+ }
72
+ },
73
+ [n, o, v.paused]
74
+ );
75
+ return /* @__PURE__ */ u(O.div, { tabIndex: -1, ...l, ref: d, onKeyDown: P });
76
+ });
77
+ Q.displayName = Ae;
78
+ function Oe(e, { select: t = !1 } = {}) {
79
+ const n = document.activeElement;
80
+ for (const o of e)
81
+ if (b(o, { select: t }), document.activeElement !== n) return;
82
+ }
83
+ function Ne(e) {
84
+ const t = X(e), n = Z(t, e), o = Z(t.reverse(), e);
85
+ return [n, o];
86
+ }
87
+ function X(e) {
88
+ const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
89
+ acceptNode: (o) => {
90
+ const r = o.tagName === "INPUT" && o.type === "hidden";
91
+ return o.disabled || o.hidden || r ? NodeFilter.FILTER_SKIP : o.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
92
+ }
93
+ });
94
+ for (; n.nextNode(); ) t.push(n.currentNode);
95
+ return t;
96
+ }
97
+ function Z(e, t) {
98
+ for (const n of e)
99
+ if (!_e(n, { upTo: t })) return n;
100
+ }
101
+ function _e(e, { upTo: t }) {
102
+ if (getComputedStyle(e).visibility === "hidden") return !0;
103
+ for (; e; ) {
104
+ if (t !== void 0 && e === t) return !1;
105
+ if (getComputedStyle(e).display === "none") return !0;
106
+ e = e.parentElement;
107
+ }
108
+ return !1;
109
+ }
110
+ function Pe(e) {
111
+ return e instanceof HTMLInputElement && "select" in e;
112
+ }
113
+ function b(e, { select: t = !1 } = {}) {
114
+ if (e && e.focus) {
115
+ const n = document.activeElement;
116
+ e.focus({ preventScroll: !0 }), e !== n && Pe(e) && t && e.select();
117
+ }
118
+ }
119
+ var Y = Se();
120
+ function Se() {
121
+ let e = [];
122
+ return {
123
+ add(t) {
124
+ const n = e[0];
125
+ t !== n && n?.pause(), e = z(e, t), e.unshift(t);
126
+ },
127
+ remove(t) {
128
+ e = z(e, t), e[0]?.resume();
129
+ }
130
+ };
131
+ }
132
+ function z(e, t) {
133
+ const n = [...e], o = n.indexOf(t);
134
+ return o !== -1 && n.splice(o, 1), n;
135
+ }
136
+ function Ie(e) {
137
+ return e.filter((t) => t.tagName !== "A");
138
+ }
139
+ var L = 0;
140
+ function Te() {
141
+ i.useEffect(() => {
142
+ const e = document.querySelectorAll("[data-radix-focus-guard]");
143
+ return document.body.insertAdjacentElement("afterbegin", e[0] ?? J()), document.body.insertAdjacentElement("beforeend", e[1] ?? J()), L++, () => {
144
+ L === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((t) => t.remove()), L--;
145
+ };
146
+ }, []);
147
+ }
148
+ function J() {
149
+ const e = document.createElement("span");
150
+ return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "none", e;
151
+ }
152
+ var Fe = function(e) {
153
+ if (typeof document > "u")
154
+ return null;
155
+ var t = Array.isArray(e) ? e[0] : e;
156
+ return t.ownerDocument.body;
157
+ }, A = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap(), I = {}, k = 0, ee = function(e) {
158
+ return e && (e.host || ee(e.parentNode));
159
+ }, Me = function(e, t) {
160
+ return t.map(function(n) {
161
+ if (e.contains(n))
162
+ return n;
163
+ var o = ee(n);
164
+ return o && e.contains(o) ? o : (console.error("aria-hidden", n, "in not contained inside", e, ". Doing nothing"), null);
165
+ }).filter(function(n) {
166
+ return !!n;
167
+ });
168
+ }, we = function(e, t, n, o) {
169
+ var r = Me(t, Array.isArray(e) ? e : [e]);
170
+ I[n] || (I[n] = /* @__PURE__ */ new WeakMap());
171
+ var a = I[n], l = [], s = /* @__PURE__ */ new Set(), m = new Set(r), p = function(c) {
172
+ !c || s.has(c) || (s.add(c), p(c.parentNode));
173
+ };
174
+ r.forEach(p);
175
+ var E = function(c) {
176
+ !c || m.has(c) || Array.prototype.forEach.call(c.children, function(d) {
177
+ if (s.has(d))
178
+ E(d);
179
+ else
180
+ try {
181
+ var v = d.getAttribute(o), P = v !== null && v !== "false", f = (A.get(d) || 0) + 1, D = (a.get(d) || 0) + 1;
182
+ A.set(d, f), a.set(d, D), l.push(d), f === 1 && P && S.set(d, !0), D === 1 && d.setAttribute(n, "true"), P || d.setAttribute(o, "true");
183
+ } catch (g) {
184
+ console.error("aria-hidden: cannot operate on ", d, g);
185
+ }
186
+ });
187
+ };
188
+ return E(t), s.clear(), k++, function() {
189
+ l.forEach(function(c) {
190
+ var d = A.get(c) - 1, v = a.get(c) - 1;
191
+ A.set(c, d), a.set(c, v), d || (S.has(c) || c.removeAttribute(o), S.delete(c)), v || c.removeAttribute(n);
192
+ }), k--, k || (A = /* @__PURE__ */ new WeakMap(), A = /* @__PURE__ */ new WeakMap(), S = /* @__PURE__ */ new WeakMap(), I = {});
193
+ };
194
+ }, xe = function(e, t, n) {
195
+ n === void 0 && (n = "data-aria-hidden");
196
+ var o = Array.from(Array.isArray(e) ? e : [e]), r = Fe(e);
197
+ return r ? (o.push.apply(o, Array.from(r.querySelectorAll("[aria-live]"))), we(o, r, n, "aria-hidden")) : function() {
198
+ return null;
199
+ };
200
+ };
201
+ // @__NO_SIDE_EFFECTS__
202
+ function We(e) {
203
+ const t = /* @__PURE__ */ Le(e), n = i.forwardRef((o, r) => {
204
+ const { children: a, ...l } = o, s = i.Children.toArray(a), m = s.find(Ue);
205
+ if (m) {
206
+ const p = m.props.children, E = s.map((c) => c === m ? i.Children.count(p) > 1 ? i.Children.only(null) : i.isValidElement(p) ? p.props.children : null : c);
207
+ return /* @__PURE__ */ u(t, { ...l, ref: r, children: i.isValidElement(p) ? i.cloneElement(p, void 0, E) : null });
208
+ }
209
+ return /* @__PURE__ */ u(t, { ...l, ref: r, children: a });
210
+ });
211
+ return n.displayName = `${e}.Slot`, n;
212
+ }
213
+ // @__NO_SIDE_EFFECTS__
214
+ function Le(e) {
215
+ const t = i.forwardRef((n, o) => {
216
+ const { children: r, ...a } = n;
217
+ if (i.isValidElement(r)) {
218
+ const l = Ge(r), s = Ke(a, r.props);
219
+ return r.type !== i.Fragment && (s.ref = o ? Ce(o, l) : l), i.cloneElement(r, s);
220
+ }
221
+ return i.Children.count(r) > 1 ? i.Children.only(null) : null;
222
+ });
223
+ return t.displayName = `${e}.SlotClone`, t;
224
+ }
225
+ var ke = Symbol("radix.slottable");
226
+ function Ue(e) {
227
+ return i.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === ke;
228
+ }
229
+ function Ke(e, t) {
230
+ const n = { ...t };
231
+ for (const o in t) {
232
+ const r = e[o], a = t[o];
233
+ /^on[A-Z]/.test(o) ? r && a ? n[o] = (...s) => {
234
+ const m = a(...s);
235
+ return r(...s), m;
236
+ } : r && (n[o] = r) : o === "style" ? n[o] = { ...r, ...a } : o === "className" && (n[o] = [r, a].filter(Boolean).join(" "));
237
+ }
238
+ return { ...e, ...n };
239
+ }
240
+ function Ge(e) {
241
+ let t = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning;
242
+ return n ? e.ref : (t = Object.getOwnPropertyDescriptor(e, "ref")?.get, n = t && "isReactWarning" in t && t.isReactWarning, n ? e.props.ref : e.props.ref || e.ref);
243
+ }
244
+ var M = "Dialog", [te, st] = ye(M), [Ve, y] = te(M), ne = (e) => {
245
+ const {
246
+ __scopeDialog: t,
247
+ children: n,
248
+ open: o,
249
+ defaultOpen: r,
250
+ onOpenChange: a,
251
+ modal: l = !0
252
+ } = e, s = i.useRef(null), m = i.useRef(null), [p, E] = Ee({
253
+ prop: o,
254
+ defaultProp: r ?? !1,
255
+ onChange: a,
256
+ caller: M
257
+ });
258
+ return /* @__PURE__ */ u(
259
+ Ve,
260
+ {
261
+ scope: t,
262
+ triggerRef: s,
263
+ contentRef: m,
264
+ contentId: w(),
265
+ titleId: w(),
266
+ descriptionId: w(),
267
+ open: p,
268
+ onOpenChange: E,
269
+ onOpenToggle: i.useCallback(() => E((c) => !c), [E]),
270
+ modal: l,
271
+ children: n
272
+ }
273
+ );
274
+ };
275
+ ne.displayName = M;
276
+ var oe = "DialogTrigger", re = i.forwardRef(
277
+ (e, t) => {
278
+ const { __scopeDialog: n, ...o } = e, r = y(oe, n), a = F(t, r.triggerRef);
279
+ return /* @__PURE__ */ u(
280
+ O.button,
281
+ {
282
+ type: "button",
283
+ "aria-haspopup": "dialog",
284
+ "aria-expanded": r.open,
285
+ "aria-controls": r.contentId,
286
+ "data-state": V(r.open),
287
+ ...o,
288
+ ref: a,
289
+ onClick: _(e.onClick, r.onOpenToggle)
290
+ }
291
+ );
292
+ }
293
+ );
294
+ re.displayName = oe;
295
+ var K = "DialogPortal", [He, ae] = te(K, {
296
+ forceMount: void 0
297
+ }), se = (e) => {
298
+ const { __scopeDialog: t, forceMount: n, children: o, container: r } = e, a = y(K, t);
299
+ return /* @__PURE__ */ u(He, { scope: t, forceMount: n, children: i.Children.map(o, (l) => /* @__PURE__ */ u(U, { present: n || a.open, children: /* @__PURE__ */ u(be, { asChild: !0, container: r, children: l }) })) });
300
+ };
301
+ se.displayName = K;
302
+ var T = "DialogOverlay", ie = i.forwardRef(
303
+ (e, t) => {
304
+ const n = ae(T, e.__scopeDialog), { forceMount: o = n.forceMount, ...r } = e, a = y(T, e.__scopeDialog);
305
+ return a.modal ? /* @__PURE__ */ u(U, { present: o || a.open, children: /* @__PURE__ */ u(je, { ...r, ref: t }) }) : null;
306
+ }
307
+ );
308
+ ie.displayName = T;
309
+ var $e = /* @__PURE__ */ We("DialogOverlay.RemoveScroll"), je = i.forwardRef(
310
+ (e, t) => {
311
+ const { __scopeDialog: n, ...o } = e, r = y(T, n);
312
+ return (
313
+ // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
314
+ // ie. when `Overlay` and `Content` are siblings
315
+ /* @__PURE__ */ u(Re, { as: $e, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ u(
316
+ O.div,
317
+ {
318
+ "data-state": V(r.open),
319
+ ...o,
320
+ ref: t,
321
+ style: { pointerEvents: "auto", ...o.style }
322
+ }
323
+ ) })
324
+ );
325
+ }
326
+ ), R = "DialogContent", ce = i.forwardRef(
327
+ (e, t) => {
328
+ const n = ae(R, e.__scopeDialog), { forceMount: o = n.forceMount, ...r } = e, a = y(R, e.__scopeDialog);
329
+ return /* @__PURE__ */ u(U, { present: o || a.open, children: a.modal ? /* @__PURE__ */ u(Be, { ...r, ref: t }) : /* @__PURE__ */ u(qe, { ...r, ref: t }) });
330
+ }
331
+ );
332
+ ce.displayName = R;
333
+ var Be = i.forwardRef(
334
+ (e, t) => {
335
+ const n = y(R, e.__scopeDialog), o = i.useRef(null), r = F(t, n.contentRef, o);
336
+ return i.useEffect(() => {
337
+ const a = o.current;
338
+ if (a) return xe(a);
339
+ }, []), /* @__PURE__ */ u(
340
+ ue,
341
+ {
342
+ ...e,
343
+ ref: r,
344
+ trapFocus: n.open,
345
+ disableOutsidePointerEvents: !0,
346
+ onCloseAutoFocus: _(e.onCloseAutoFocus, (a) => {
347
+ a.preventDefault(), n.triggerRef.current?.focus();
348
+ }),
349
+ onPointerDownOutside: _(e.onPointerDownOutside, (a) => {
350
+ const l = a.detail.originalEvent, s = l.button === 0 && l.ctrlKey === !0;
351
+ (l.button === 2 || s) && a.preventDefault();
352
+ }),
353
+ onFocusOutside: _(
354
+ e.onFocusOutside,
355
+ (a) => a.preventDefault()
356
+ )
357
+ }
358
+ );
359
+ }
360
+ ), qe = i.forwardRef(
361
+ (e, t) => {
362
+ const n = y(R, e.__scopeDialog), o = i.useRef(!1), r = i.useRef(!1);
363
+ return /* @__PURE__ */ u(
364
+ ue,
365
+ {
366
+ ...e,
367
+ ref: t,
368
+ trapFocus: !1,
369
+ disableOutsidePointerEvents: !1,
370
+ onCloseAutoFocus: (a) => {
371
+ e.onCloseAutoFocus?.(a), a.defaultPrevented || (o.current || n.triggerRef.current?.focus(), a.preventDefault()), o.current = !1, r.current = !1;
372
+ },
373
+ onInteractOutside: (a) => {
374
+ e.onInteractOutside?.(a), a.defaultPrevented || (o.current = !0, a.detail.originalEvent.type === "pointerdown" && (r.current = !0));
375
+ const l = a.target;
376
+ n.triggerRef.current?.contains(l) && a.preventDefault(), a.detail.originalEvent.type === "focusin" && r.current && a.preventDefault();
377
+ }
378
+ }
379
+ );
380
+ }
381
+ ), ue = i.forwardRef(
382
+ (e, t) => {
383
+ const { __scopeDialog: n, trapFocus: o, onOpenAutoFocus: r, onCloseAutoFocus: a, ...l } = e, s = y(R, n), m = i.useRef(null), p = F(t, m);
384
+ return Te(), /* @__PURE__ */ j(B, { children: [
385
+ /* @__PURE__ */ u(
386
+ Q,
387
+ {
388
+ asChild: !0,
389
+ loop: !0,
390
+ trapped: o,
391
+ onMountAutoFocus: r,
392
+ onUnmountAutoFocus: a,
393
+ children: /* @__PURE__ */ u(
394
+ De,
395
+ {
396
+ role: "dialog",
397
+ id: s.contentId,
398
+ "aria-describedby": s.descriptionId,
399
+ "aria-labelledby": s.titleId,
400
+ "data-state": V(s.open),
401
+ ...l,
402
+ ref: p,
403
+ onDismiss: () => s.onOpenChange(!1)
404
+ }
405
+ )
406
+ }
407
+ ),
408
+ /* @__PURE__ */ j(B, { children: [
409
+ /* @__PURE__ */ u(Ze, { titleId: s.titleId }),
410
+ /* @__PURE__ */ u(ze, { contentRef: m, descriptionId: s.descriptionId })
411
+ ] })
412
+ ] });
413
+ }
414
+ ), G = "DialogTitle", le = i.forwardRef(
415
+ (e, t) => {
416
+ const { __scopeDialog: n, ...o } = e, r = y(G, n);
417
+ return /* @__PURE__ */ u(O.h2, { id: r.titleId, ...o, ref: t });
418
+ }
419
+ );
420
+ le.displayName = G;
421
+ var fe = "DialogDescription", de = i.forwardRef(
422
+ (e, t) => {
423
+ const { __scopeDialog: n, ...o } = e, r = y(fe, n);
424
+ return /* @__PURE__ */ u(O.p, { id: r.descriptionId, ...o, ref: t });
425
+ }
426
+ );
427
+ de.displayName = fe;
428
+ var pe = "DialogClose", me = i.forwardRef(
429
+ (e, t) => {
430
+ const { __scopeDialog: n, ...o } = e, r = y(pe, n);
431
+ return /* @__PURE__ */ u(
432
+ O.button,
433
+ {
434
+ type: "button",
435
+ ...o,
436
+ ref: t,
437
+ onClick: _(e.onClick, () => r.onOpenChange(!1))
438
+ }
439
+ );
440
+ }
441
+ );
442
+ me.displayName = pe;
443
+ function V(e) {
444
+ return e ? "open" : "closed";
445
+ }
446
+ var ve = "DialogTitleWarning", [it, ge] = he(ve, {
447
+ contentName: R,
448
+ titleName: G,
449
+ docsSlug: "dialog"
450
+ }), Ze = ({ titleId: e }) => {
451
+ const t = ge(ve), n = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
452
+
453
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
454
+
455
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;
456
+ return i.useEffect(() => {
457
+ e && (document.getElementById(e) || console.error(n));
458
+ }, [n, e]), null;
459
+ }, Ye = "DialogDescriptionWarning", ze = ({ contentRef: e, descriptionId: t }) => {
460
+ const o = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ge(Ye).contentName}}.`;
461
+ return i.useEffect(() => {
462
+ const r = e.current?.getAttribute("aria-describedby");
463
+ t && r && (document.getElementById(t) || console.warn(o));
464
+ }, [o, e, t]), null;
465
+ }, ct = ne, ut = re, lt = se, ft = ie, dt = ce, pt = le, mt = de, vt = me;
466
+ export {
467
+ dt as C,
468
+ le as D,
469
+ ft as O,
470
+ lt as P,
471
+ ct as R,
472
+ pt as T,
473
+ it as W,
474
+ se as a,
475
+ vt as b,
476
+ st as c,
477
+ mt as d,
478
+ ut as e
479
+ };
@@ -1,6 +1,6 @@
1
1
  import * as i from "react";
2
- import { u as y } from "./index-DQH6odE9.js";
3
- import { u as A } from "./index-BfXxHr_2.js";
2
+ import { u as y } from "./index-DLcqcWxM.js";
3
+ import { u as A } from "./index-CIAmiWcw.js";
4
4
  function T(n, e) {
5
5
  return i.useReducer((t, r) => e[t][r] ?? t, n);
6
6
  }
@@ -0,0 +1,27 @@
1
+ import * as h from "react";
2
+ import { u as z } from "./index-CIAmiWcw.js";
3
+ function n(r) {
4
+ const [d, e] = h.useState(void 0);
5
+ return z(() => {
6
+ if (r) {
7
+ e({ width: r.offsetWidth, height: r.offsetHeight });
8
+ const f = new ResizeObserver((i) => {
9
+ if (!Array.isArray(i) || !i.length)
10
+ return;
11
+ const b = i[0];
12
+ let o, t;
13
+ if ("borderBoxSize" in b) {
14
+ const s = b.borderBoxSize, u = Array.isArray(s) ? s[0] : s;
15
+ o = u.inlineSize, t = u.blockSize;
16
+ } else
17
+ o = r.offsetWidth, t = r.offsetHeight;
18
+ e({ width: o, height: t });
19
+ });
20
+ return f.observe(r, { box: "border-box" }), () => f.unobserve(r);
21
+ } else
22
+ e(void 0);
23
+ }, [r]), d;
24
+ }
25
+ export {
26
+ n as u
27
+ };