@konstructio/ui 0.1.0-alpha.9 → 0.1.1-alpha.1

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 (167) hide show
  1. package/dist/DatePicker.css +1 -1
  2. package/dist/{Modal-CrG0m703.js → Modal-0oht63vU.js} +32 -32
  3. package/dist/assets/icons/components/Search.js +26 -0
  4. package/dist/assets/icons/components/Warning.js +22 -0
  5. package/dist/assets/icons/components/index.js +6 -0
  6. package/dist/{chevron-down-UW8ts6wI.js → chevron-down-CVce9Mvh.js} +2 -2
  7. package/dist/components/Alert/Alert.js +23 -25
  8. package/dist/components/Alert/Alert.variants.js +1 -1
  9. package/dist/components/AlertDialog/AlertDialog.js +1 -1
  10. package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
  11. package/dist/components/AlertDialog/components/index.js +1 -1
  12. package/dist/components/AlertDialog/hooks/useAlertDialog.js +7 -7
  13. package/dist/components/Autocomplete/Autocomplete.variants.js +3 -4
  14. package/dist/components/Autocomplete/components/List/List.variants.js +3 -7
  15. package/dist/components/Autocomplete/hooks/useAutocomplete.js +38 -43
  16. package/dist/components/Autocomplete/hooks/useNavigationList.js +29 -37
  17. package/dist/components/Badge/Badge.js +40 -42
  18. package/dist/components/Badge/Badge.variants.js +1 -1
  19. package/dist/components/Breadcrumb/Breadcrumb.variants.js +1 -1
  20. package/dist/components/Breadcrumb/components/Item/Item.js +22 -21
  21. package/dist/components/Breadcrumb/components/Item/Item.variants.js +1 -1
  22. package/dist/components/Breadcrumb/hooks/useBreadcrumb.js +1 -1
  23. package/dist/components/Button/Button.js +15 -15
  24. package/dist/components/Button/Button.variants.js +10 -77
  25. package/dist/components/Card/Card.variants.js +3 -5
  26. package/dist/components/Checkbox/Checkbox.js +48 -47
  27. package/dist/components/Checkbox/Checkbox.variants.js +3 -4
  28. package/dist/components/Command/Command.js +2 -2
  29. package/dist/components/Command/Command.variants.js +1 -1
  30. package/dist/components/Command/components/Command.js +1 -1
  31. package/dist/components/Command/components/CommandEmpty.js +1 -1
  32. package/dist/components/Command/components/CommandGroup.js +1 -1
  33. package/dist/components/Command/components/CommandInput.js +1 -1
  34. package/dist/components/Command/components/CommandItem.js +13 -13
  35. package/dist/components/Command/components/CommandList.js +1 -1
  36. package/dist/components/Command/components/CommandSeparator.js +1 -1
  37. package/dist/components/Command/components/DialogContent.js +1 -1
  38. package/dist/components/Command/components/DialogOverlay.js +1 -1
  39. package/dist/components/Datepicker/DatePicker.js +1496 -1577
  40. package/dist/components/Datepicker/DatePicker.variants.js +1 -1
  41. package/dist/components/Divider/Divider.variants.js +1 -1
  42. package/dist/components/Dropdown/Dropdown.js +28 -6
  43. package/dist/components/Dropdown/Dropdown.variants.js +43 -26
  44. package/dist/components/Dropdown/components/List/List.variants.js +1 -1
  45. package/dist/components/Dropdown/components/ListItem/ListItem.variants.js +5 -5
  46. package/dist/components/Dropdown/components/Wrapper.js +96 -86
  47. package/dist/components/Dropdown/contexts/dropdown.provider.js +12 -12
  48. package/dist/components/Dropdown/hooks/useDropdown.js +26 -30
  49. package/dist/components/Dropdown/hooks/useNavigationList.js +25 -31
  50. package/dist/components/DropdownButton/DropdownButton.js +135 -0
  51. package/dist/components/Filter/Filter.variants.js +1 -1
  52. package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.hook.js +47 -49
  53. package/dist/components/Filter/components/BadgeDropdown/BadgeMultiSelect.js +1 -1
  54. package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.hook.js +41 -42
  55. package/dist/components/Filter/components/DateFilterDropdown/DateFilterDropdown.js +30 -30
  56. package/dist/components/Filter/components/ResetButton/ResetButton.js +22 -16
  57. package/dist/components/Input/Input.js +116 -109
  58. package/dist/components/Input/Input.variants.js +18 -5
  59. package/dist/components/Loading/Loading.js +2 -2
  60. package/dist/components/Loading/Loading.variants.js +1 -2
  61. package/dist/components/Modal/Modal.js +2 -2
  62. package/dist/components/Modal/components/Body/Body.js +1 -1
  63. package/dist/components/Modal/components/Footer/Footer.js +1 -1
  64. package/dist/components/Modal/components/Header/Header.js +1 -1
  65. package/dist/components/Modal/components/Wrapper/Wrapper.js +2 -2
  66. package/dist/components/Modal/components/Wrapper/Wrapper.variants.js +7 -9
  67. package/dist/components/Modal/components/index.js +1 -1
  68. package/dist/components/Modal/hooks/useModal.js +16 -17
  69. package/dist/components/NumberInput/NumberInput.js +91 -91
  70. package/dist/components/NumberInput/NumberInput.variants.js +1 -1
  71. package/dist/components/PieChart/PieChart.js +5138 -0
  72. package/dist/components/ProgressBar/ProgressBar.js +58 -26
  73. package/dist/components/ProgressBar/ProgressBar.variants.js +1 -1
  74. package/dist/components/Radio/Radio.js +64 -48
  75. package/dist/components/Radio/Radio.variants.js +3 -3
  76. package/dist/components/RadioCard/RadioCard.js +26 -23
  77. package/dist/components/RadioCard/RadioCard.variants.js +1 -1
  78. package/dist/components/RadioCardGroup/RadioCardGroup.js +28 -28
  79. package/dist/components/RadioCardGroup/RadioCardGroup.variants.js +1 -1
  80. package/dist/components/RadioGroup/RadioGroup.js +37 -37
  81. package/dist/components/RadioGroup/RadioGroup.variants.js +1 -1
  82. package/dist/components/Range/Range.js +1 -1
  83. package/dist/components/Range/Range.variants.js +2 -3
  84. package/dist/components/Sidebar/Sidebar.js +4 -3
  85. package/dist/components/Sidebar/Sidebar.variants.js +1 -1
  86. package/dist/components/Sidebar/components/Footer/Footer.js +5 -4
  87. package/dist/components/Sidebar/components/Footer/Footer.variants.js +1 -1
  88. package/dist/components/Sidebar/components/Logo/Logo.js +6 -5
  89. package/dist/components/Sidebar/components/Logo/Logo.variants.js +1 -1
  90. package/dist/components/Sidebar/components/Navigation/Navigation.js +5 -4
  91. package/dist/components/Sidebar/components/Navigation/Navigation.variants.js +1 -1
  92. package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.js +14 -13
  93. package/dist/components/Sidebar/components/NavigationGroup/NavigationGroup.variants.js +1 -1
  94. package/dist/components/Sidebar/components/NavigationOption/NavigationOption.js +13 -12
  95. package/dist/components/Sidebar/components/NavigationOption/NavigationOption.variants.js +1 -1
  96. package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.js +5 -6
  97. package/dist/components/Sidebar/components/NavigationSeparator/NavigationSeparator.variants.js +1 -1
  98. package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.js +9 -8
  99. package/dist/components/Sidebar/components/NavigationTitle/NavigationTitle.variants.js +1 -1
  100. package/dist/components/Sidebar/components/Wrapper/Wrapper.js +15 -14
  101. package/dist/components/Slider/Slider.js +1 -1
  102. package/dist/components/Slider/Slider.variants.js +2 -8
  103. package/dist/components/Switch/Switch.js +54 -54
  104. package/dist/components/Switch/Switch.variants.js +2 -3
  105. package/dist/components/Table/Table.variants.js +1 -1
  106. package/dist/components/Tabs/Tabs.js +20 -16
  107. package/dist/components/Tabs/Tabs.variants.js +3 -5
  108. package/dist/components/Tabs/components/Content.js +10 -13
  109. package/dist/components/Tabs/components/List.js +9 -8
  110. package/dist/components/Tabs/components/Trigger.js +12 -16
  111. package/dist/components/Tabs/components/index.js +8 -0
  112. package/dist/components/Tag/Tag.js +1 -1
  113. package/dist/components/Tag/Tag.variants.js +1 -1
  114. package/dist/components/TagSelect/TagSelect.variants.js +1 -1
  115. package/dist/components/TagSelect/components/Item/Item.variants.js +1 -1
  116. package/dist/components/TagSelect/components/List/List.variants.js +1 -1
  117. package/dist/components/TagSelect/hooks/useTagSelect.js +14 -16
  118. package/dist/components/TextArea/TextArea.variants.js +4 -5
  119. package/dist/components/TimePicker/TimePicker.variants.js +6 -7
  120. package/dist/components/TimePicker/components/HoursList/HoursList.js +21 -26
  121. package/dist/components/TimePicker/components/MeridianList/MeridianList.js +19 -20
  122. package/dist/components/TimePicker/components/MinutesList/MinutesList.js +24 -25
  123. package/dist/components/TimePicker/components/Wrapper/Wrapper.js +33 -34
  124. package/dist/components/TimePicker/components/WrapperList/WrapperList.variants.js +1 -1
  125. package/dist/components/Toast/Toast.js +223 -232
  126. package/dist/components/Toast/Toast.variants.js +8 -11
  127. package/dist/components/Tooltip/Tooltip.js +1 -1
  128. package/dist/components/Tooltip/Tooltip.variants.js +7 -14
  129. package/dist/components/Tooltip/hooks/useTooltip.js +8 -9
  130. package/dist/components/Typography/Typography.js +26 -31
  131. package/dist/components/Typography/Typography.variants.js +1 -1
  132. package/dist/components/index.js +78 -66
  133. package/dist/contexts/theme.provider.js +28 -29
  134. package/dist/{createLucideIcon-ByJ0JZvK.js → createLucideIcon-BpsAkT97.js} +4 -4
  135. package/dist/index-0ioNhtNM.js +10 -0
  136. package/dist/{index-CvfCCTEO.js → index-BAraV3ai.js} +7 -7
  137. package/dist/index-BXuxPoz7.js +435 -0
  138. package/dist/index-BfXxHr_2.js +125 -0
  139. package/dist/index-C1g_chDT.js +70 -0
  140. package/dist/{index-BCGvACM9.js → index-C9T9HQaa.js} +1 -1
  141. package/dist/{index-Bc1LNrRD.js → index-CZnD2QxM.js} +1 -1
  142. package/dist/index-CrBonFvu.js +144 -0
  143. package/dist/{index-rUBNhTeF.js → index-Cvx4lqTq.js} +2 -2
  144. package/dist/{index-BNmRGtA6.js → index-D29mdTf5.js} +3 -3
  145. package/dist/{index-Dkt8F6CZ.js → index-D3xzCzcO.js} +12 -12
  146. package/dist/index-DB2XhXHn.js +431 -0
  147. package/dist/{index-B5MIi2tR.js → index-DQH6odE9.js} +2 -3
  148. package/dist/index-Oq5GlCHP.js +131 -0
  149. package/dist/{index-Cs8Lv8Wj.js → index-bwWKd82e.js} +1 -1
  150. package/dist/{index--EmNlyHx.js → index-iXyXtdgP.js} +1 -1
  151. package/dist/index.d.ts +157 -9
  152. package/dist/index.js +88 -76
  153. package/dist/package.json +41 -37
  154. package/dist/styles.css +1 -1
  155. package/dist/ui/civo-theme.css +261 -241
  156. package/dist/ui/kubefirst-theme.css +4 -4
  157. package/dist/ui/theme.css +0 -2
  158. package/dist/{useBreadcrumb-DMERrNkJ.js → useBreadcrumb-B8DnuqkR.js} +254 -261
  159. package/dist/utils/index.js +25 -26
  160. package/package.json +41 -37
  161. package/dist/index-BNU3RH-3.js +0 -133
  162. package/dist/index-BvCZBMfr.js +0 -432
  163. package/dist/index-Cq1I1cG9.js +0 -129
  164. package/dist/index-DLYwlPRZ.js +0 -440
  165. package/dist/index-DNRcvRTB.js +0 -145
  166. package/dist/index-Dm-ooN_M.js +0 -71
  167. package/dist/index-DwYXX2sM.js +0 -13
@@ -0,0 +1,435 @@
1
+ import * as i from "react";
2
+ import { a as Ee, c as he, b as _, d as ye } from "./index-BfXxHr_2.js";
3
+ import { u as S, c as De } from "./index-DQH6odE9.js";
4
+ import { u as w } from "./index-bwWKd82e.js";
5
+ import { P as be, D as Ce } from "./index-CrBonFvu.js";
6
+ import { P as N } from "./index-C9T9HQaa.js";
7
+ import { u as j } from "./index-0ioNhtNM.js";
8
+ import { jsx as l, jsxs as q, Fragment as B } from "react/jsx-runtime";
9
+ import { P as U } from "./index-C1g_chDT.js";
10
+ import { R as Ae } from "./Combination-VYaRRJBZ.js";
11
+ var x = "focusScope.autoFocusOnMount", L = "focusScope.autoFocusOnUnmount", V = { bubbles: !1, cancelable: !0 }, Re = "FocusScope", Q = i.forwardRef((e, o) => {
12
+ const {
13
+ loop: t = !1,
14
+ trapped: n = !1,
15
+ onMountAutoFocus: r,
16
+ onUnmountAutoFocus: a,
17
+ ...d
18
+ } = e, [s, y] = i.useState(null), g = j(r), E = j(a), c = i.useRef(null), f = S(o, (u) => y(u)), p = 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 (n) {
29
+ let u = function(D) {
30
+ if (p.paused || !s) return;
31
+ const h = D.target;
32
+ s.contains(h) ? c.current = h : C(c.current, { select: !0 });
33
+ }, b = function(D) {
34
+ if (p.paused || !s) return;
35
+ const h = D.relatedTarget;
36
+ h !== null && (s.contains(h) || C(c.current, { select: !0 }));
37
+ }, v = function(D) {
38
+ if (document.activeElement === document.body)
39
+ for (const $ of D)
40
+ $.removedNodes.length > 0 && C(s);
41
+ };
42
+ document.addEventListener("focusin", u), document.addEventListener("focusout", b);
43
+ const O = new MutationObserver(v);
44
+ return s && O.observe(s, { childList: !0, subtree: !0 }), () => {
45
+ document.removeEventListener("focusin", u), document.removeEventListener("focusout", b), O.disconnect();
46
+ };
47
+ }
48
+ }, [n, s, p.paused]), i.useEffect(() => {
49
+ if (s) {
50
+ Z.add(p);
51
+ const u = document.activeElement;
52
+ if (!s.contains(u)) {
53
+ const v = new CustomEvent(x, V);
54
+ s.addEventListener(x, g), s.dispatchEvent(v), v.defaultPrevented || (Ne(Fe(X(s)), { select: !0 }), document.activeElement === u && C(s));
55
+ }
56
+ return () => {
57
+ s.removeEventListener(x, g), setTimeout(() => {
58
+ const v = new CustomEvent(L, V);
59
+ s.addEventListener(L, E), s.dispatchEvent(v), v.defaultPrevented || C(u ?? document.body, { select: !0 }), s.removeEventListener(L, E), Z.remove(p);
60
+ }, 0);
61
+ };
62
+ }
63
+ }, [s, g, E, p]);
64
+ const P = i.useCallback(
65
+ (u) => {
66
+ if (!t && !n || p.paused) return;
67
+ const b = u.key === "Tab" && !u.altKey && !u.ctrlKey && !u.metaKey, v = document.activeElement;
68
+ if (b && v) {
69
+ const O = u.currentTarget, [D, h] = Oe(O);
70
+ D && h ? !u.shiftKey && v === h ? (u.preventDefault(), t && C(D, { select: !0 })) : u.shiftKey && v === D && (u.preventDefault(), t && C(h, { select: !0 })) : v === O && u.preventDefault();
71
+ }
72
+ },
73
+ [t, n, p.paused]
74
+ );
75
+ return /* @__PURE__ */ l(N.div, { tabIndex: -1, ...d, ref: f, onKeyDown: P });
76
+ });
77
+ Q.displayName = Re;
78
+ function Ne(e, { select: o = !1 } = {}) {
79
+ const t = document.activeElement;
80
+ for (const n of e)
81
+ if (C(n, { select: o }), document.activeElement !== t) return;
82
+ }
83
+ function Oe(e) {
84
+ const o = X(e), t = Y(o, e), n = Y(o.reverse(), e);
85
+ return [t, n];
86
+ }
87
+ function X(e) {
88
+ const o = [], t = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
89
+ acceptNode: (n) => {
90
+ const r = n.tagName === "INPUT" && n.type === "hidden";
91
+ return n.disabled || n.hidden || r ? NodeFilter.FILTER_SKIP : n.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
92
+ }
93
+ });
94
+ for (; t.nextNode(); ) o.push(t.currentNode);
95
+ return o;
96
+ }
97
+ function Y(e, o) {
98
+ for (const t of e)
99
+ if (!_e(t, { upTo: o })) return t;
100
+ }
101
+ function _e(e, { upTo: o }) {
102
+ if (getComputedStyle(e).visibility === "hidden") return !0;
103
+ for (; e; ) {
104
+ if (o !== void 0 && e === o) 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 C(e, { select: o = !1 } = {}) {
114
+ if (e && e.focus) {
115
+ const t = document.activeElement;
116
+ e.focus({ preventScroll: !0 }), e !== t && Pe(e) && o && e.select();
117
+ }
118
+ }
119
+ var Z = Te();
120
+ function Te() {
121
+ let e = [];
122
+ return {
123
+ add(o) {
124
+ const t = e[0];
125
+ o !== t && t?.pause(), e = z(e, o), e.unshift(o);
126
+ },
127
+ remove(o) {
128
+ e = z(e, o), e[0]?.resume();
129
+ }
130
+ };
131
+ }
132
+ function z(e, o) {
133
+ const t = [...e], n = t.indexOf(o);
134
+ return n !== -1 && t.splice(n, 1), t;
135
+ }
136
+ function Fe(e) {
137
+ return e.filter((o) => o.tagName !== "A");
138
+ }
139
+ var k = 0;
140
+ function Ie() {
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()), k++, () => {
144
+ k === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((o) => o.remove()), k--;
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 Se = function(e) {
153
+ if (typeof document > "u")
154
+ return null;
155
+ var o = Array.isArray(e) ? e[0] : e;
156
+ return o.ownerDocument.body;
157
+ }, R = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), F = {}, W = 0, ee = function(e) {
158
+ return e && (e.host || ee(e.parentNode));
159
+ }, Me = function(e, o) {
160
+ return o.map(function(t) {
161
+ if (e.contains(t))
162
+ return t;
163
+ var n = ee(t);
164
+ return n && e.contains(n) ? n : (console.error("aria-hidden", t, "in not contained inside", e, ". Doing nothing"), null);
165
+ }).filter(function(t) {
166
+ return !!t;
167
+ });
168
+ }, we = function(e, o, t, n) {
169
+ var r = Me(o, Array.isArray(e) ? e : [e]);
170
+ F[t] || (F[t] = /* @__PURE__ */ new WeakMap());
171
+ var a = F[t], d = [], s = /* @__PURE__ */ new Set(), y = new Set(r), g = function(c) {
172
+ !c || s.has(c) || (s.add(c), g(c.parentNode));
173
+ };
174
+ r.forEach(g);
175
+ var E = function(c) {
176
+ !c || y.has(c) || Array.prototype.forEach.call(c.children, function(f) {
177
+ if (s.has(f))
178
+ E(f);
179
+ else
180
+ try {
181
+ var p = f.getAttribute(n), P = p !== null && p !== "false", u = (R.get(f) || 0) + 1, b = (a.get(f) || 0) + 1;
182
+ R.set(f, u), a.set(f, b), d.push(f), u === 1 && P && T.set(f, !0), b === 1 && f.setAttribute(t, "true"), P || f.setAttribute(n, "true");
183
+ } catch (v) {
184
+ console.error("aria-hidden: cannot operate on ", f, v);
185
+ }
186
+ });
187
+ };
188
+ return E(o), s.clear(), W++, function() {
189
+ d.forEach(function(c) {
190
+ var f = R.get(c) - 1, p = a.get(c) - 1;
191
+ R.set(c, f), a.set(c, p), f || (T.has(c) || c.removeAttribute(n), T.delete(c)), p || c.removeAttribute(t);
192
+ }), W--, W || (R = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), F = {});
193
+ };
194
+ }, xe = function(e, o, t) {
195
+ t === void 0 && (t = "data-aria-hidden");
196
+ var n = Array.from(Array.isArray(e) ? e : [e]), r = Se(e);
197
+ return r ? (n.push.apply(n, Array.from(r.querySelectorAll("[aria-live]"))), we(n, r, t, "aria-hidden")) : function() {
198
+ return null;
199
+ };
200
+ }, M = "Dialog", [te, et] = he(M), [Le, m] = te(M), oe = (e) => {
201
+ const {
202
+ __scopeDialog: o,
203
+ children: t,
204
+ open: n,
205
+ defaultOpen: r,
206
+ onOpenChange: a,
207
+ modal: d = !0
208
+ } = e, s = i.useRef(null), y = i.useRef(null), [g, E] = Ee({
209
+ prop: n,
210
+ defaultProp: r ?? !1,
211
+ onChange: a,
212
+ caller: M
213
+ });
214
+ return /* @__PURE__ */ l(
215
+ Le,
216
+ {
217
+ scope: o,
218
+ triggerRef: s,
219
+ contentRef: y,
220
+ contentId: w(),
221
+ titleId: w(),
222
+ descriptionId: w(),
223
+ open: g,
224
+ onOpenChange: E,
225
+ onOpenToggle: i.useCallback(() => E((c) => !c), [E]),
226
+ modal: d,
227
+ children: t
228
+ }
229
+ );
230
+ };
231
+ oe.displayName = M;
232
+ var ne = "DialogTrigger", re = i.forwardRef(
233
+ (e, o) => {
234
+ const { __scopeDialog: t, ...n } = e, r = m(ne, t), a = S(o, r.triggerRef);
235
+ return /* @__PURE__ */ l(
236
+ N.button,
237
+ {
238
+ type: "button",
239
+ "aria-haspopup": "dialog",
240
+ "aria-expanded": r.open,
241
+ "aria-controls": r.contentId,
242
+ "data-state": H(r.open),
243
+ ...n,
244
+ ref: a,
245
+ onClick: _(e.onClick, r.onOpenToggle)
246
+ }
247
+ );
248
+ }
249
+ );
250
+ re.displayName = ne;
251
+ var K = "DialogPortal", [ke, ae] = te(K, {
252
+ forceMount: void 0
253
+ }), se = (e) => {
254
+ const { __scopeDialog: o, forceMount: t, children: n, container: r } = e, a = m(K, o);
255
+ return /* @__PURE__ */ l(ke, { scope: o, forceMount: t, children: i.Children.map(n, (d) => /* @__PURE__ */ l(U, { present: t || a.open, children: /* @__PURE__ */ l(be, { asChild: !0, container: r, children: d }) })) });
256
+ };
257
+ se.displayName = K;
258
+ var I = "DialogOverlay", ie = i.forwardRef(
259
+ (e, o) => {
260
+ const t = ae(I, e.__scopeDialog), { forceMount: n = t.forceMount, ...r } = e, a = m(I, e.__scopeDialog);
261
+ return a.modal ? /* @__PURE__ */ l(U, { present: n || a.open, children: /* @__PURE__ */ l(Ue, { ...r, ref: o }) }) : null;
262
+ }
263
+ );
264
+ ie.displayName = I;
265
+ var We = De("DialogOverlay.RemoveScroll"), Ue = i.forwardRef(
266
+ (e, o) => {
267
+ const { __scopeDialog: t, ...n } = e, r = m(I, t);
268
+ return (
269
+ // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
270
+ // ie. when `Overlay` and `Content` are siblings
271
+ /* @__PURE__ */ l(Ae, { as: We, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ l(
272
+ N.div,
273
+ {
274
+ "data-state": H(r.open),
275
+ ...n,
276
+ ref: o,
277
+ style: { pointerEvents: "auto", ...n.style }
278
+ }
279
+ ) })
280
+ );
281
+ }
282
+ ), A = "DialogContent", ce = i.forwardRef(
283
+ (e, o) => {
284
+ const t = ae(A, e.__scopeDialog), { forceMount: n = t.forceMount, ...r } = e, a = m(A, e.__scopeDialog);
285
+ return /* @__PURE__ */ l(U, { present: n || a.open, children: a.modal ? /* @__PURE__ */ l(Ke, { ...r, ref: o }) : /* @__PURE__ */ l(Ge, { ...r, ref: o }) });
286
+ }
287
+ );
288
+ ce.displayName = A;
289
+ var Ke = i.forwardRef(
290
+ (e, o) => {
291
+ const t = m(A, e.__scopeDialog), n = i.useRef(null), r = S(o, t.contentRef, n);
292
+ return i.useEffect(() => {
293
+ const a = n.current;
294
+ if (a) return xe(a);
295
+ }, []), /* @__PURE__ */ l(
296
+ ue,
297
+ {
298
+ ...e,
299
+ ref: r,
300
+ trapFocus: t.open,
301
+ disableOutsidePointerEvents: !0,
302
+ onCloseAutoFocus: _(e.onCloseAutoFocus, (a) => {
303
+ a.preventDefault(), t.triggerRef.current?.focus();
304
+ }),
305
+ onPointerDownOutside: _(e.onPointerDownOutside, (a) => {
306
+ const d = a.detail.originalEvent, s = d.button === 0 && d.ctrlKey === !0;
307
+ (d.button === 2 || s) && a.preventDefault();
308
+ }),
309
+ onFocusOutside: _(
310
+ e.onFocusOutside,
311
+ (a) => a.preventDefault()
312
+ )
313
+ }
314
+ );
315
+ }
316
+ ), Ge = i.forwardRef(
317
+ (e, o) => {
318
+ const t = m(A, e.__scopeDialog), n = i.useRef(!1), r = i.useRef(!1);
319
+ return /* @__PURE__ */ l(
320
+ ue,
321
+ {
322
+ ...e,
323
+ ref: o,
324
+ trapFocus: !1,
325
+ disableOutsidePointerEvents: !1,
326
+ onCloseAutoFocus: (a) => {
327
+ e.onCloseAutoFocus?.(a), a.defaultPrevented || (n.current || t.triggerRef.current?.focus(), a.preventDefault()), n.current = !1, r.current = !1;
328
+ },
329
+ onInteractOutside: (a) => {
330
+ e.onInteractOutside?.(a), a.defaultPrevented || (n.current = !0, a.detail.originalEvent.type === "pointerdown" && (r.current = !0));
331
+ const d = a.target;
332
+ t.triggerRef.current?.contains(d) && a.preventDefault(), a.detail.originalEvent.type === "focusin" && r.current && a.preventDefault();
333
+ }
334
+ }
335
+ );
336
+ }
337
+ ), ue = i.forwardRef(
338
+ (e, o) => {
339
+ const { __scopeDialog: t, trapFocus: n, onOpenAutoFocus: r, onCloseAutoFocus: a, ...d } = e, s = m(A, t), y = i.useRef(null), g = S(o, y);
340
+ return Ie(), /* @__PURE__ */ q(B, { children: [
341
+ /* @__PURE__ */ l(
342
+ Q,
343
+ {
344
+ asChild: !0,
345
+ loop: !0,
346
+ trapped: n,
347
+ onMountAutoFocus: r,
348
+ onUnmountAutoFocus: a,
349
+ children: /* @__PURE__ */ l(
350
+ Ce,
351
+ {
352
+ role: "dialog",
353
+ id: s.contentId,
354
+ "aria-describedby": s.descriptionId,
355
+ "aria-labelledby": s.titleId,
356
+ "data-state": H(s.open),
357
+ ...d,
358
+ ref: g,
359
+ onDismiss: () => s.onOpenChange(!1)
360
+ }
361
+ )
362
+ }
363
+ ),
364
+ /* @__PURE__ */ q(B, { children: [
365
+ /* @__PURE__ */ l(He, { titleId: s.titleId }),
366
+ /* @__PURE__ */ l(je, { contentRef: y, descriptionId: s.descriptionId })
367
+ ] })
368
+ ] });
369
+ }
370
+ ), G = "DialogTitle", le = i.forwardRef(
371
+ (e, o) => {
372
+ const { __scopeDialog: t, ...n } = e, r = m(G, t);
373
+ return /* @__PURE__ */ l(N.h2, { id: r.titleId, ...n, ref: o });
374
+ }
375
+ );
376
+ le.displayName = G;
377
+ var fe = "DialogDescription", de = i.forwardRef(
378
+ (e, o) => {
379
+ const { __scopeDialog: t, ...n } = e, r = m(fe, t);
380
+ return /* @__PURE__ */ l(N.p, { id: r.descriptionId, ...n, ref: o });
381
+ }
382
+ );
383
+ de.displayName = fe;
384
+ var pe = "DialogClose", ve = i.forwardRef(
385
+ (e, o) => {
386
+ const { __scopeDialog: t, ...n } = e, r = m(pe, t);
387
+ return /* @__PURE__ */ l(
388
+ N.button,
389
+ {
390
+ type: "button",
391
+ ...n,
392
+ ref: o,
393
+ onClick: _(e.onClick, () => r.onOpenChange(!1))
394
+ }
395
+ );
396
+ }
397
+ );
398
+ ve.displayName = pe;
399
+ function H(e) {
400
+ return e ? "open" : "closed";
401
+ }
402
+ var me = "DialogTitleWarning", [tt, ge] = ye(me, {
403
+ contentName: A,
404
+ titleName: G,
405
+ docsSlug: "dialog"
406
+ }), He = ({ titleId: e }) => {
407
+ const o = ge(me), t = `\`${o.contentName}\` requires a \`${o.titleName}\` for the component to be accessible for screen reader users.
408
+
409
+ If you want to hide the \`${o.titleName}\`, you can wrap it with our VisuallyHidden component.
410
+
411
+ For more information, see https://radix-ui.com/primitives/docs/components/${o.docsSlug}`;
412
+ return i.useEffect(() => {
413
+ e && (document.getElementById(e) || console.error(t));
414
+ }, [t, e]), null;
415
+ }, $e = "DialogDescriptionWarning", je = ({ contentRef: e, descriptionId: o }) => {
416
+ const n = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ge($e).contentName}}.`;
417
+ return i.useEffect(() => {
418
+ const r = e.current?.getAttribute("aria-describedby");
419
+ o && r && (document.getElementById(o) || console.warn(n));
420
+ }, [n, e, o]), null;
421
+ }, ot = oe, nt = re, rt = se, at = ie, st = ce, it = le, ct = de, ut = ve;
422
+ export {
423
+ st as C,
424
+ le as D,
425
+ at as O,
426
+ rt as P,
427
+ ot as R,
428
+ it as T,
429
+ tt as W,
430
+ se as a,
431
+ ut as b,
432
+ et as c,
433
+ ct as d,
434
+ nt as e
435
+ };
@@ -0,0 +1,125 @@
1
+ import * as c from "react";
2
+ import { jsx as x } from "react/jsx-runtime";
3
+ function R(e, s) {
4
+ const t = c.createContext(s), i = (u) => {
5
+ const { children: r, ...o } = u, l = c.useMemo(() => o, Object.values(o));
6
+ return /* @__PURE__ */ x(t.Provider, { value: l, children: r });
7
+ };
8
+ i.displayName = e + "Provider";
9
+ function n(u) {
10
+ const r = c.useContext(t);
11
+ if (r) return r;
12
+ if (s !== void 0) return s;
13
+ throw new Error(`\`${u}\` must be used within \`${e}\``);
14
+ }
15
+ return [i, n];
16
+ }
17
+ function g(e, s = []) {
18
+ let t = [];
19
+ function i(u, r) {
20
+ const o = c.createContext(r), l = t.length;
21
+ t = [...t, r];
22
+ const d = (f) => {
23
+ const { scope: m, children: p, ...v } = f, C = m?.[e]?.[l] || o, h = c.useMemo(() => v, Object.values(v));
24
+ return /* @__PURE__ */ x(C.Provider, { value: h, children: p });
25
+ };
26
+ d.displayName = u + "Provider";
27
+ function a(f, m) {
28
+ const p = m?.[e]?.[l] || o, v = c.useContext(p);
29
+ if (v) return v;
30
+ if (r !== void 0) return r;
31
+ throw new Error(`\`${f}\` must be used within \`${u}\``);
32
+ }
33
+ return [d, a];
34
+ }
35
+ const n = () => {
36
+ const u = t.map((r) => c.createContext(r));
37
+ return function(o) {
38
+ const l = o?.[e] || u;
39
+ return c.useMemo(
40
+ () => ({ [`__scope${e}`]: { ...o, [e]: l } }),
41
+ [o, l]
42
+ );
43
+ };
44
+ };
45
+ return n.scopeName = e, [i, S(n, ...s)];
46
+ }
47
+ function S(...e) {
48
+ const s = e[0];
49
+ if (e.length === 1) return s;
50
+ const t = () => {
51
+ const i = e.map((n) => ({
52
+ useScope: n(),
53
+ scopeName: n.scopeName
54
+ }));
55
+ return function(u) {
56
+ const r = i.reduce((o, { useScope: l, scopeName: d }) => {
57
+ const f = l(u)[`__scope${d}`];
58
+ return { ...o, ...f };
59
+ }, {});
60
+ return c.useMemo(() => ({ [`__scope${s.scopeName}`]: r }), [r]);
61
+ };
62
+ };
63
+ return t.scopeName = s.scopeName, t;
64
+ }
65
+ function _(e, s, { checkForDefaultPrevented: t = !0 } = {}) {
66
+ return function(n) {
67
+ if (e?.(n), t === !1 || !n.defaultPrevented)
68
+ return s?.(n);
69
+ };
70
+ }
71
+ var P = globalThis?.document ? c.useLayoutEffect : () => {
72
+ }, b = c[" useInsertionEffect ".trim().toString()] || P;
73
+ function y({
74
+ prop: e,
75
+ defaultProp: s,
76
+ onChange: t = () => {
77
+ },
78
+ caller: i
79
+ }) {
80
+ const [n, u, r] = w({
81
+ defaultProp: s,
82
+ onChange: t
83
+ }), o = e !== void 0, l = o ? e : n;
84
+ {
85
+ const a = c.useRef(e !== void 0);
86
+ c.useEffect(() => {
87
+ const f = a.current;
88
+ f !== o && console.warn(
89
+ `${i} is changing from ${f ? "controlled" : "uncontrolled"} to ${o ? "controlled" : "uncontrolled"}. Components should not switch from controlled to uncontrolled (or vice versa). Decide between using a controlled or uncontrolled value for the lifetime of the component.`
90
+ ), a.current = o;
91
+ }, [o, i]);
92
+ }
93
+ const d = c.useCallback(
94
+ (a) => {
95
+ if (o) {
96
+ const f = E(a) ? a(e) : a;
97
+ f !== e && r.current?.(f);
98
+ } else
99
+ u(a);
100
+ },
101
+ [o, e, u, r]
102
+ );
103
+ return [l, d];
104
+ }
105
+ function w({
106
+ defaultProp: e,
107
+ onChange: s
108
+ }) {
109
+ const [t, i] = c.useState(e), n = c.useRef(t), u = c.useRef(s);
110
+ return b(() => {
111
+ u.current = s;
112
+ }, [s]), c.useEffect(() => {
113
+ n.current !== t && (u.current?.(t), n.current = t);
114
+ }, [t, n]), [t, i, u];
115
+ }
116
+ function E(e) {
117
+ return typeof e == "function";
118
+ }
119
+ export {
120
+ y as a,
121
+ _ as b,
122
+ g as c,
123
+ R as d,
124
+ P as u
125
+ };
@@ -0,0 +1,70 @@
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";
4
+ function T(n, e) {
5
+ return i.useReducer((t, r) => e[t][r] ?? t, n);
6
+ }
7
+ var E = (n) => {
8
+ const { present: e, children: t } = n, r = R(e), a = typeof t == "function" ? t({ present: r.isPresent }) : i.Children.only(t), c = y(r.ref, P(a));
9
+ return typeof t == "function" || r.isPresent ? i.cloneElement(a, { ref: c }) : null;
10
+ };
11
+ E.displayName = "Presence";
12
+ function R(n) {
13
+ const [e, t] = i.useState(), r = i.useRef(null), a = i.useRef(n), c = i.useRef("none"), p = n ? "mounted" : "unmounted", [N, s] = T(p, {
14
+ mounted: {
15
+ UNMOUNT: "unmounted",
16
+ ANIMATION_OUT: "unmountSuspended"
17
+ },
18
+ unmountSuspended: {
19
+ MOUNT: "mounted",
20
+ ANIMATION_END: "unmounted"
21
+ },
22
+ unmounted: {
23
+ MOUNT: "mounted"
24
+ }
25
+ });
26
+ return i.useEffect(() => {
27
+ const o = l(r.current);
28
+ c.current = N === "mounted" ? o : "none";
29
+ }, [N]), A(() => {
30
+ const o = r.current, m = a.current;
31
+ if (m !== n) {
32
+ const f = c.current, u = l(o);
33
+ n ? s("MOUNT") : u === "none" || o?.display === "none" ? s("UNMOUNT") : s(m && f !== u ? "ANIMATION_OUT" : "UNMOUNT"), a.current = n;
34
+ }
35
+ }, [n, s]), A(() => {
36
+ if (e) {
37
+ let o;
38
+ const m = e.ownerDocument.defaultView ?? window, d = (u) => {
39
+ const g = l(r.current).includes(CSS.escape(u.animationName));
40
+ if (u.target === e && g && (s("ANIMATION_END"), !a.current)) {
41
+ const O = e.style.animationFillMode;
42
+ e.style.animationFillMode = "forwards", o = m.setTimeout(() => {
43
+ e.style.animationFillMode === "forwards" && (e.style.animationFillMode = O);
44
+ });
45
+ }
46
+ }, f = (u) => {
47
+ u.target === e && (c.current = l(r.current));
48
+ };
49
+ return e.addEventListener("animationstart", f), e.addEventListener("animationcancel", d), e.addEventListener("animationend", d), () => {
50
+ m.clearTimeout(o), e.removeEventListener("animationstart", f), e.removeEventListener("animationcancel", d), e.removeEventListener("animationend", d);
51
+ };
52
+ } else
53
+ s("ANIMATION_END");
54
+ }, [e, s]), {
55
+ isPresent: ["mounted", "unmountSuspended"].includes(N),
56
+ ref: i.useCallback((o) => {
57
+ r.current = o ? getComputedStyle(o) : null, t(o);
58
+ }, [])
59
+ };
60
+ }
61
+ function l(n) {
62
+ return n?.animationName || "none";
63
+ }
64
+ function P(n) {
65
+ let e = Object.getOwnPropertyDescriptor(n.props, "ref")?.get, t = e && "isReactWarning" in e && e.isReactWarning;
66
+ return t ? n.ref : (e = Object.getOwnPropertyDescriptor(n, "ref")?.get, t = e && "isReactWarning" in e && e.isReactWarning, t ? n.props.ref : n.props.ref || n.ref);
67
+ }
68
+ export {
69
+ E as P
70
+ };
@@ -1,7 +1,7 @@
1
1
  import * as D from "react";
2
2
  import R from "react";
3
3
  import { g as b } from "./_commonjsHelpers-C6fGbg64.js";
4
- import { c as w } from "./index-B5MIi2tR.js";
4
+ import { c as w } from "./index-DQH6odE9.js";
5
5
  import { jsx as N } from "react/jsx-runtime";
6
6
  var v = { exports: {} }, u = {};
7
7
  /**
@@ -1,5 +1,5 @@
1
1
  import * as f from "react";
2
- import { u as a } from "./index-Cq1I1cG9.js";
2
+ import { u as a } from "./index-BfXxHr_2.js";
3
3
  function h(r) {
4
4
  const e = f.useRef({ value: r, previous: r });
5
5
  return f.useMemo(() => (e.current.value !== r && (e.current.previous = e.current.value, e.current.value = r), e.current.previous), [r]);