@konstructio/ui 0.0.13-alpha.2 → 0.1.0-alpha.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/DatePicker.css +1 -0
- package/dist/{Modal-i7eolhYH.js → Modal-B2ujmsSW.js} +2 -2
- package/dist/components/Alert/Alert.js +1 -1
- package/dist/components/AlertDialog/AlertDialog.js +55 -41
- package/dist/components/AlertDialog/components/AlertDialogTrigger.js +1 -1
- package/dist/components/AlertDialog/components/index.js +1 -1
- package/dist/components/Badge/Badge.js +79 -0
- package/dist/components/Badge/Badge.variants.js +68 -0
- package/dist/components/Breadcrumb/Breadcrumb.js +43 -52
- package/dist/components/Breadcrumb/Breadcrumb.variants.js +10 -41
- package/dist/components/Breadcrumb/components/Item/Item.js +22 -23
- package/dist/components/Breadcrumb/components/Item/Item.variants.js +43 -56
- package/dist/components/Button/Button.js +30 -26
- package/dist/components/Button/Button.variants.js +115 -28
- package/dist/components/Checkbox/Checkbox.js +297 -187
- package/dist/components/Checkbox/Checkbox.variants.js +12 -15
- package/dist/components/Command/Command.js +2 -2
- package/dist/components/Command/components/Command.js +1 -1
- package/dist/components/Command/components/CommandEmpty.js +1 -1
- package/dist/components/Command/components/CommandGroup.js +1 -1
- package/dist/components/Command/components/CommandInput.js +1 -1
- package/dist/components/Command/components/CommandItem.js +1 -1
- package/dist/components/Command/components/CommandList.js +1 -1
- package/dist/components/Command/components/CommandSeparator.js +1 -1
- package/dist/components/Command/components/DialogContent.js +1 -1
- package/dist/components/Command/components/DialogOverlay.js +1 -1
- package/dist/components/Datepicker/DatePicker.js +2711 -0
- package/dist/components/Datepicker/DatePicker.variants.js +5 -0
- package/dist/components/Divider/Divider.variants.js +9 -12
- package/dist/components/Dropdown/contexts/dropdown.hook.js +5 -3
- package/dist/components/Input/Input.js +106 -137
- package/dist/components/Input/Input.variants.js +15 -13
- package/dist/components/Loading/Loading.js +14 -99
- package/dist/components/Modal/Modal.js +2 -2
- package/dist/components/Modal/components/Body/Body.js +1 -1
- package/dist/components/Modal/components/Footer/Footer.js +1 -1
- package/dist/components/Modal/components/Header/Header.js +1 -1
- package/dist/components/Modal/components/Wrapper/Wrapper.js +2 -2
- package/dist/components/Modal/components/index.js +1 -1
- package/dist/components/NumberInput/NumberInput.js +1 -1
- package/dist/components/Radio/Radio.variants.js +14 -12
- package/dist/components/RadioGroup/RadioGroup.js +1 -1
- package/dist/components/Range/Range.js +1 -1
- package/dist/components/Slider/Slider.js +1 -1
- package/dist/components/Switch/Switch.js +141 -126
- package/dist/components/Tabs/Tabs.js +24 -0
- package/dist/components/Tabs/Tabs.variants.js +58 -0
- package/dist/components/Tabs/components/Content.js +19 -0
- package/dist/components/Tabs/components/List.js +20 -0
- package/dist/components/Tabs/components/Trigger.js +26 -0
- package/dist/components/Tag/Tag.js +1 -1
- package/dist/components/TimePicker/TimePicker.js +8 -0
- package/dist/components/TimePicker/TimePicker.variants.js +62 -0
- package/dist/components/TimePicker/components/HoursList/HoursList.js +93 -0
- package/dist/components/TimePicker/components/MeridianList/MeridianList.js +68 -0
- package/dist/components/TimePicker/components/MinutesList/MinutesList.js +60 -0
- package/dist/components/TimePicker/components/Wrapper/Wrapper.js +102 -0
- package/dist/components/TimePicker/components/WrapperList/WrapperList.js +51 -0
- package/dist/components/TimePicker/components/WrapperList/WrapperList.variants.js +16 -0
- package/dist/components/TimePicker/components/index.js +4 -0
- package/dist/components/TimePicker/contexts/index.js +8 -0
- package/dist/components/TimePicker/contexts/time-picker.context.js +22 -0
- package/dist/components/TimePicker/contexts/time-picker.hook.js +13 -0
- package/dist/components/TimePicker/contexts/time-picker.provider.js +46 -0
- package/dist/components/TimePicker/utils/index.js +6 -0
- package/dist/components/Toast/Toast.js +37 -35
- package/dist/components/Tooltip/Tooltip.js +1 -1
- package/dist/components/Typography/Typography.js +1 -1
- package/dist/components/index.js +72 -66
- package/dist/createLucideIcon-BA2PlKw1.js +94 -0
- package/dist/index-55GVbfLI.js +432 -0
- package/dist/{index-D9BbbgUq.js → index-B-qIIQlg.js} +2 -2
- package/dist/index-BRcC_VTj.js +31 -0
- package/dist/{index-Bry5AFQ2.js → index-Bc1LNrRD.js} +1 -1
- package/dist/index-BdMNhZnh.js +9 -0
- package/dist/index-C2xwUZXm.js +323 -0
- package/dist/{index-YaQrdkGE.js → index-CQ6ORxI_.js} +31 -30
- package/dist/index-Cq1I1cG9.js +129 -0
- package/dist/index-Cs8Lv8Wj.js +13 -0
- package/dist/{index-dRxIWVBr.js → index-DmCJ8fIR.js} +6 -5
- package/dist/index-DwYXX2sM.js +13 -0
- package/dist/{index-g-TFwd6Y.js → index-ObZsP5Eh.js} +2 -1
- package/dist/{index-DvFiic6N.js → index-Ud3-A7-K.js} +95 -101
- package/dist/{index-G_6jG4Qc.js → index-Y44iCJcQ.js} +18 -18
- package/dist/index-tIydFizp.js +83 -0
- package/dist/{index-AM3avohj.js → index-xPmNHv1y.js} +3 -3
- package/dist/index.d.ts +72 -13
- package/dist/index.js +78 -72
- package/dist/package.json +25 -22
- package/dist/styles.css +1 -1
- package/dist/ui/civo-theme.css +263 -0
- package/dist/ui/kubefirst-theme.css +1 -1
- package/dist/ui/theme.css +11 -0
- package/dist/ui/utilities.css +11 -2
- package/dist/utils/index.js +3 -3
- package/package.json +25 -22
- package/dist/index-BOx5P4tS.js +0 -423
- package/dist/index-Bk324h27.js +0 -82
- package/dist/index-CWKdynYu.js +0 -32
- package/dist/index-bYyfdsls.js +0 -118
|
@@ -1,20 +1,14 @@
|
|
|
1
1
|
import * as i from "react";
|
|
2
|
-
import {
|
|
3
|
-
import { u as S, c as
|
|
4
|
-
import {
|
|
5
|
-
import { P as
|
|
2
|
+
import { a as Ee, c as he, b as _, d as ye } from "./index-Cq1I1cG9.js";
|
|
3
|
+
import { u as S, c as De } from "./index-tIydFizp.js";
|
|
4
|
+
import { u as w } from "./index-Cs8Lv8Wj.js";
|
|
5
|
+
import { P as be, D as Ce } from "./index-CQ6ORxI_.js";
|
|
6
|
+
import { P as N } from "./index-ObZsP5Eh.js";
|
|
7
|
+
import { u as j } from "./index-DwYXX2sM.js";
|
|
6
8
|
import { jsx as f, jsxs as q, Fragment as B } from "react/jsx-runtime";
|
|
7
|
-
import { P as
|
|
9
|
+
import { P as U } from "./index-Y44iCJcQ.js";
|
|
8
10
|
import { R as Ae } from "./Combination-b348x__d.js";
|
|
9
|
-
var
|
|
10
|
-
}), Oe = 0;
|
|
11
|
-
function M(e) {
|
|
12
|
-
const [n, t] = i.useState(Ne());
|
|
13
|
-
return Ee(() => {
|
|
14
|
-
t((o) => o ?? String(Oe++));
|
|
15
|
-
}, [e]), n ? `radix-${n}` : "";
|
|
16
|
-
}
|
|
17
|
-
var x = "focusScope.autoFocusOnMount", w = "focusScope.autoFocusOnUnmount", V = { bubbles: !1, cancelable: !0 }, _e = "FocusScope", Q = i.forwardRef((e, n) => {
|
|
11
|
+
var x = "focusScope.autoFocusOnMount", L = "focusScope.autoFocusOnUnmount", V = { bubbles: !1, cancelable: !0 }, Re = "FocusScope", Q = i.forwardRef((e, n) => {
|
|
18
12
|
const {
|
|
19
13
|
loop: t = !1,
|
|
20
14
|
trapped: o = !1,
|
|
@@ -42,8 +36,8 @@ var x = "focusScope.autoFocusOnMount", w = "focusScope.autoFocusOnUnmount", V =
|
|
|
42
36
|
y !== null && (s.contains(y) || C(u.current, { select: !0 }));
|
|
43
37
|
}, v = function(D) {
|
|
44
38
|
if (document.activeElement === document.body)
|
|
45
|
-
for (const
|
|
46
|
-
|
|
39
|
+
for (const $ of D)
|
|
40
|
+
$.removedNodes.length > 0 && C(s);
|
|
47
41
|
};
|
|
48
42
|
document.addEventListener("focusin", l), document.addEventListener("focusout", b);
|
|
49
43
|
const O = new MutationObserver(v);
|
|
@@ -57,36 +51,36 @@ var x = "focusScope.autoFocusOnMount", w = "focusScope.autoFocusOnUnmount", V =
|
|
|
57
51
|
const l = document.activeElement;
|
|
58
52
|
if (!s.contains(l)) {
|
|
59
53
|
const v = new CustomEvent(x, V);
|
|
60
|
-
s.addEventListener(x, m), s.dispatchEvent(v), v.defaultPrevented || (Ie(
|
|
54
|
+
s.addEventListener(x, m), s.dispatchEvent(v), v.defaultPrevented || (Ne(Ie(X(s)), { select: !0 }), document.activeElement === l && C(s));
|
|
61
55
|
}
|
|
62
56
|
return () => {
|
|
63
57
|
s.removeEventListener(x, m), setTimeout(() => {
|
|
64
|
-
const v = new CustomEvent(
|
|
65
|
-
s.addEventListener(
|
|
58
|
+
const v = new CustomEvent(L, V);
|
|
59
|
+
s.addEventListener(L, h), s.dispatchEvent(v), v.defaultPrevented || C(l ?? document.body, { select: !0 }), s.removeEventListener(L, h), Z.remove(p);
|
|
66
60
|
}, 0);
|
|
67
61
|
};
|
|
68
62
|
}
|
|
69
63
|
}, [s, m, h, p]);
|
|
70
|
-
const
|
|
64
|
+
const P = i.useCallback(
|
|
71
65
|
(l) => {
|
|
72
66
|
if (!t && !o || p.paused) return;
|
|
73
67
|
const b = l.key === "Tab" && !l.altKey && !l.ctrlKey && !l.metaKey, v = document.activeElement;
|
|
74
68
|
if (b && v) {
|
|
75
|
-
const O = l.currentTarget, [D, y] =
|
|
69
|
+
const O = l.currentTarget, [D, y] = Oe(O);
|
|
76
70
|
D && y ? !l.shiftKey && v === y ? (l.preventDefault(), t && C(D, { select: !0 })) : l.shiftKey && v === D && (l.preventDefault(), t && C(y, { select: !0 })) : v === O && l.preventDefault();
|
|
77
71
|
}
|
|
78
72
|
},
|
|
79
73
|
[t, o, p.paused]
|
|
80
74
|
);
|
|
81
|
-
return /* @__PURE__ */ f(N.div, { tabIndex: -1, ...c, ref: d, onKeyDown:
|
|
75
|
+
return /* @__PURE__ */ f(N.div, { tabIndex: -1, ...c, ref: d, onKeyDown: P });
|
|
82
76
|
});
|
|
83
|
-
Q.displayName =
|
|
84
|
-
function
|
|
77
|
+
Q.displayName = Re;
|
|
78
|
+
function Ne(e, { select: n = !1 } = {}) {
|
|
85
79
|
const t = document.activeElement;
|
|
86
80
|
for (const o of e)
|
|
87
81
|
if (C(o, { select: n }), document.activeElement !== t) return;
|
|
88
82
|
}
|
|
89
|
-
function
|
|
83
|
+
function Oe(e) {
|
|
90
84
|
const n = X(e), t = Y(n, e), o = Y(n.reverse(), e);
|
|
91
85
|
return [t, o];
|
|
92
86
|
}
|
|
@@ -102,9 +96,9 @@ function X(e) {
|
|
|
102
96
|
}
|
|
103
97
|
function Y(e, n) {
|
|
104
98
|
for (const t of e)
|
|
105
|
-
if (!
|
|
99
|
+
if (!_e(t, { upTo: n })) return t;
|
|
106
100
|
}
|
|
107
|
-
function
|
|
101
|
+
function _e(e, { upTo: n }) {
|
|
108
102
|
if (getComputedStyle(e).visibility === "hidden") return !0;
|
|
109
103
|
for (; e; ) {
|
|
110
104
|
if (n !== void 0 && e === n) return !1;
|
|
@@ -113,17 +107,17 @@ function Te(e, { upTo: n }) {
|
|
|
113
107
|
}
|
|
114
108
|
return !1;
|
|
115
109
|
}
|
|
116
|
-
function
|
|
110
|
+
function Pe(e) {
|
|
117
111
|
return e instanceof HTMLInputElement && "select" in e;
|
|
118
112
|
}
|
|
119
113
|
function C(e, { select: n = !1 } = {}) {
|
|
120
114
|
if (e && e.focus) {
|
|
121
115
|
const t = document.activeElement;
|
|
122
|
-
e.focus({ preventScroll: !0 }), e !== t &&
|
|
116
|
+
e.focus({ preventScroll: !0 }), e !== t && Pe(e) && n && e.select();
|
|
123
117
|
}
|
|
124
118
|
}
|
|
125
|
-
var Z =
|
|
126
|
-
function
|
|
119
|
+
var Z = Te();
|
|
120
|
+
function Te() {
|
|
127
121
|
let e = [];
|
|
128
122
|
return {
|
|
129
123
|
add(n) {
|
|
@@ -140,15 +134,15 @@ function z(e, n) {
|
|
|
140
134
|
const t = [...e], o = t.indexOf(n);
|
|
141
135
|
return o !== -1 && t.splice(o, 1), t;
|
|
142
136
|
}
|
|
143
|
-
function
|
|
137
|
+
function Ie(e) {
|
|
144
138
|
return e.filter((n) => n.tagName !== "A");
|
|
145
139
|
}
|
|
146
|
-
var
|
|
147
|
-
function
|
|
140
|
+
var k = 0;
|
|
141
|
+
function Fe() {
|
|
148
142
|
i.useEffect(() => {
|
|
149
143
|
const e = document.querySelectorAll("[data-radix-focus-guard]");
|
|
150
|
-
return document.body.insertAdjacentElement("afterbegin", e[0] ?? J()), document.body.insertAdjacentElement("beforeend", e[1] ?? J()),
|
|
151
|
-
|
|
144
|
+
return document.body.insertAdjacentElement("afterbegin", e[0] ?? J()), document.body.insertAdjacentElement("beforeend", e[1] ?? J()), k++, () => {
|
|
145
|
+
k === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((n) => n.remove()), k--;
|
|
152
146
|
};
|
|
153
147
|
}, []);
|
|
154
148
|
}
|
|
@@ -156,14 +150,14 @@ function J() {
|
|
|
156
150
|
const e = document.createElement("span");
|
|
157
151
|
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;
|
|
158
152
|
}
|
|
159
|
-
var
|
|
153
|
+
var Se = function(e) {
|
|
160
154
|
if (typeof document > "u")
|
|
161
155
|
return null;
|
|
162
156
|
var n = Array.isArray(e) ? e[0] : e;
|
|
163
157
|
return n.ownerDocument.body;
|
|
164
|
-
},
|
|
158
|
+
}, R = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), I = {}, W = 0, ee = function(e) {
|
|
165
159
|
return e && (e.host || ee(e.parentNode));
|
|
166
|
-
},
|
|
160
|
+
}, Me = function(e, n) {
|
|
167
161
|
return n.map(function(t) {
|
|
168
162
|
if (e.contains(t))
|
|
169
163
|
return t;
|
|
@@ -172,10 +166,10 @@ var we = function(e) {
|
|
|
172
166
|
}).filter(function(t) {
|
|
173
167
|
return !!t;
|
|
174
168
|
});
|
|
175
|
-
},
|
|
176
|
-
var a =
|
|
177
|
-
|
|
178
|
-
var r =
|
|
169
|
+
}, we = function(e, n, t, o) {
|
|
170
|
+
var a = Me(n, Array.isArray(e) ? e : [e]);
|
|
171
|
+
I[t] || (I[t] = /* @__PURE__ */ new WeakMap());
|
|
172
|
+
var r = I[t], c = [], s = /* @__PURE__ */ new Set(), g = new Set(a), m = function(u) {
|
|
179
173
|
!u || s.has(u) || (s.add(u), m(u.parentNode));
|
|
180
174
|
};
|
|
181
175
|
a.forEach(m);
|
|
@@ -185,26 +179,26 @@ var we = function(e) {
|
|
|
185
179
|
h(d);
|
|
186
180
|
else
|
|
187
181
|
try {
|
|
188
|
-
var p = d.getAttribute(o),
|
|
189
|
-
|
|
182
|
+
var p = d.getAttribute(o), P = p !== null && p !== "false", l = (R.get(d) || 0) + 1, b = (r.get(d) || 0) + 1;
|
|
183
|
+
R.set(d, l), r.set(d, b), c.push(d), l === 1 && P && T.set(d, !0), b === 1 && d.setAttribute(t, "true"), P || d.setAttribute(o, "true");
|
|
190
184
|
} catch (v) {
|
|
191
185
|
console.error("aria-hidden: cannot operate on ", d, v);
|
|
192
186
|
}
|
|
193
187
|
});
|
|
194
188
|
};
|
|
195
|
-
return h(n), s.clear(),
|
|
189
|
+
return h(n), s.clear(), W++, function() {
|
|
196
190
|
c.forEach(function(u) {
|
|
197
|
-
var d =
|
|
198
|
-
|
|
199
|
-
}),
|
|
191
|
+
var d = R.get(u) - 1, p = r.get(u) - 1;
|
|
192
|
+
R.set(u, d), r.set(u, p), d || (T.has(u) || u.removeAttribute(o), T.delete(u)), p || u.removeAttribute(t);
|
|
193
|
+
}), W--, W || (R = /* @__PURE__ */ new WeakMap(), R = /* @__PURE__ */ new WeakMap(), T = /* @__PURE__ */ new WeakMap(), I = {});
|
|
200
194
|
};
|
|
201
|
-
},
|
|
195
|
+
}, xe = function(e, n, t) {
|
|
202
196
|
t === void 0 && (t = "data-aria-hidden");
|
|
203
|
-
var o = Array.from(Array.isArray(e) ? e : [e]), a =
|
|
204
|
-
return a ? (o.push.apply(o, Array.from(a.querySelectorAll("[aria-live]"))),
|
|
197
|
+
var o = Array.from(Array.isArray(e) ? e : [e]), a = Se(e);
|
|
198
|
+
return a ? (o.push.apply(o, Array.from(a.querySelectorAll("[aria-live]"))), we(o, a, t, "aria-hidden")) : function() {
|
|
205
199
|
return null;
|
|
206
200
|
};
|
|
207
|
-
},
|
|
201
|
+
}, M = "Dialog", [te, et] = he(M), [Le, E] = te(M), ne = (e) => {
|
|
208
202
|
const {
|
|
209
203
|
__scopeDialog: n,
|
|
210
204
|
children: t,
|
|
@@ -212,20 +206,21 @@ var we = function(e) {
|
|
|
212
206
|
defaultOpen: a,
|
|
213
207
|
onOpenChange: r,
|
|
214
208
|
modal: c = !0
|
|
215
|
-
} = e, s = i.useRef(null), g = i.useRef(null), [m
|
|
209
|
+
} = e, s = i.useRef(null), g = i.useRef(null), [m, h] = Ee({
|
|
216
210
|
prop: o,
|
|
217
|
-
defaultProp: a,
|
|
218
|
-
onChange: r
|
|
211
|
+
defaultProp: a ?? !1,
|
|
212
|
+
onChange: r,
|
|
213
|
+
caller: M
|
|
219
214
|
});
|
|
220
215
|
return /* @__PURE__ */ f(
|
|
221
|
-
|
|
216
|
+
Le,
|
|
222
217
|
{
|
|
223
218
|
scope: n,
|
|
224
219
|
triggerRef: s,
|
|
225
220
|
contentRef: g,
|
|
226
|
-
contentId:
|
|
227
|
-
titleId:
|
|
228
|
-
descriptionId:
|
|
221
|
+
contentId: w(),
|
|
222
|
+
titleId: w(),
|
|
223
|
+
descriptionId: w(),
|
|
229
224
|
open: m,
|
|
230
225
|
onOpenChange: h,
|
|
231
226
|
onOpenToggle: i.useCallback(() => h((u) => !u), [h]),
|
|
@@ -234,7 +229,7 @@ var we = function(e) {
|
|
|
234
229
|
}
|
|
235
230
|
);
|
|
236
231
|
};
|
|
237
|
-
ne.displayName =
|
|
232
|
+
ne.displayName = M;
|
|
238
233
|
var oe = "DialogTrigger", re = i.forwardRef(
|
|
239
234
|
(e, n) => {
|
|
240
235
|
const { __scopeDialog: t, ...o } = e, a = E(oe, t), r = S(n, a.triggerRef);
|
|
@@ -245,7 +240,7 @@ var oe = "DialogTrigger", re = i.forwardRef(
|
|
|
245
240
|
"aria-haspopup": "dialog",
|
|
246
241
|
"aria-expanded": a.open,
|
|
247
242
|
"aria-controls": a.contentId,
|
|
248
|
-
"data-state":
|
|
243
|
+
"data-state": H(a.open),
|
|
249
244
|
...o,
|
|
250
245
|
ref: r,
|
|
251
246
|
onClick: _(e.onClick, a.onOpenToggle)
|
|
@@ -254,30 +249,30 @@ var oe = "DialogTrigger", re = i.forwardRef(
|
|
|
254
249
|
}
|
|
255
250
|
);
|
|
256
251
|
re.displayName = oe;
|
|
257
|
-
var K = "DialogPortal", [
|
|
252
|
+
var K = "DialogPortal", [ke, ae] = te(K, {
|
|
258
253
|
forceMount: void 0
|
|
259
254
|
}), se = (e) => {
|
|
260
255
|
const { __scopeDialog: n, forceMount: t, children: o, container: a } = e, r = E(K, n);
|
|
261
|
-
return /* @__PURE__ */ f(
|
|
256
|
+
return /* @__PURE__ */ f(ke, { scope: n, forceMount: t, children: i.Children.map(o, (c) => /* @__PURE__ */ f(U, { present: t || r.open, children: /* @__PURE__ */ f(be, { asChild: !0, container: a, children: c }) })) });
|
|
262
257
|
};
|
|
263
258
|
se.displayName = K;
|
|
264
259
|
var F = "DialogOverlay", ie = i.forwardRef(
|
|
265
260
|
(e, n) => {
|
|
266
261
|
const t = ae(F, e.__scopeDialog), { forceMount: o = t.forceMount, ...a } = e, r = E(F, e.__scopeDialog);
|
|
267
|
-
return r.modal ? /* @__PURE__ */ f(
|
|
262
|
+
return r.modal ? /* @__PURE__ */ f(U, { present: o || r.open, children: /* @__PURE__ */ f(Ue, { ...a, ref: n }) }) : null;
|
|
268
263
|
}
|
|
269
264
|
);
|
|
270
265
|
ie.displayName = F;
|
|
271
|
-
var
|
|
266
|
+
var We = De("DialogOverlay.RemoveScroll"), Ue = i.forwardRef(
|
|
272
267
|
(e, n) => {
|
|
273
268
|
const { __scopeDialog: t, ...o } = e, a = E(F, t);
|
|
274
269
|
return (
|
|
275
270
|
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
276
271
|
// ie. when `Overlay` and `Content` are siblings
|
|
277
|
-
/* @__PURE__ */ f(Ae, { as:
|
|
272
|
+
/* @__PURE__ */ f(Ae, { as: We, allowPinchZoom: !0, shards: [a.contentRef], children: /* @__PURE__ */ f(
|
|
278
273
|
N.div,
|
|
279
274
|
{
|
|
280
|
-
"data-state":
|
|
275
|
+
"data-state": H(a.open),
|
|
281
276
|
...o,
|
|
282
277
|
ref: n,
|
|
283
278
|
style: { pointerEvents: "auto", ...o.style }
|
|
@@ -285,19 +280,19 @@ var Ge = be("DialogOverlay.RemoveScroll"), $e = i.forwardRef(
|
|
|
285
280
|
) })
|
|
286
281
|
);
|
|
287
282
|
}
|
|
288
|
-
),
|
|
283
|
+
), A = "DialogContent", ce = i.forwardRef(
|
|
289
284
|
(e, n) => {
|
|
290
|
-
const t = ae(
|
|
291
|
-
return /* @__PURE__ */ f(
|
|
285
|
+
const t = ae(A, e.__scopeDialog), { forceMount: o = t.forceMount, ...a } = e, r = E(A, e.__scopeDialog);
|
|
286
|
+
return /* @__PURE__ */ f(U, { present: o || r.open, children: r.modal ? /* @__PURE__ */ f(Ke, { ...a, ref: n }) : /* @__PURE__ */ f(Ge, { ...a, ref: n }) });
|
|
292
287
|
}
|
|
293
288
|
);
|
|
294
|
-
ce.displayName =
|
|
295
|
-
var
|
|
289
|
+
ce.displayName = A;
|
|
290
|
+
var Ke = i.forwardRef(
|
|
296
291
|
(e, n) => {
|
|
297
|
-
const t = E(
|
|
292
|
+
const t = E(A, e.__scopeDialog), o = i.useRef(null), a = S(n, t.contentRef, o);
|
|
298
293
|
return i.useEffect(() => {
|
|
299
294
|
const r = o.current;
|
|
300
|
-
if (r) return
|
|
295
|
+
if (r) return xe(r);
|
|
301
296
|
}, []), /* @__PURE__ */ f(
|
|
302
297
|
ue,
|
|
303
298
|
{
|
|
@@ -320,9 +315,9 @@ var He = i.forwardRef(
|
|
|
320
315
|
}
|
|
321
316
|
);
|
|
322
317
|
}
|
|
323
|
-
),
|
|
318
|
+
), Ge = i.forwardRef(
|
|
324
319
|
(e, n) => {
|
|
325
|
-
const t = E(
|
|
320
|
+
const t = E(A, e.__scopeDialog), o = i.useRef(!1), a = i.useRef(!1);
|
|
326
321
|
return /* @__PURE__ */ f(
|
|
327
322
|
ue,
|
|
328
323
|
{
|
|
@@ -345,8 +340,8 @@ var He = i.forwardRef(
|
|
|
345
340
|
}
|
|
346
341
|
), ue = i.forwardRef(
|
|
347
342
|
(e, n) => {
|
|
348
|
-
const { __scopeDialog: t, trapFocus: o, onOpenAutoFocus: a, onCloseAutoFocus: r, ...c } = e, s = E(
|
|
349
|
-
return
|
|
343
|
+
const { __scopeDialog: t, trapFocus: o, onOpenAutoFocus: a, onCloseAutoFocus: r, ...c } = e, s = E(A, t), g = i.useRef(null), m = S(n, g);
|
|
344
|
+
return Fe(), /* @__PURE__ */ q(B, { children: [
|
|
350
345
|
/* @__PURE__ */ f(
|
|
351
346
|
Q,
|
|
352
347
|
{
|
|
@@ -356,13 +351,13 @@ var He = i.forwardRef(
|
|
|
356
351
|
onMountAutoFocus: a,
|
|
357
352
|
onUnmountAutoFocus: r,
|
|
358
353
|
children: /* @__PURE__ */ f(
|
|
359
|
-
|
|
354
|
+
Ce,
|
|
360
355
|
{
|
|
361
356
|
role: "dialog",
|
|
362
357
|
id: s.contentId,
|
|
363
358
|
"aria-describedby": s.descriptionId,
|
|
364
359
|
"aria-labelledby": s.titleId,
|
|
365
|
-
"data-state":
|
|
360
|
+
"data-state": H(s.open),
|
|
366
361
|
...c,
|
|
367
362
|
ref: m,
|
|
368
363
|
onDismiss: () => s.onOpenChange(!1)
|
|
@@ -371,8 +366,8 @@ var He = i.forwardRef(
|
|
|
371
366
|
}
|
|
372
367
|
),
|
|
373
368
|
/* @__PURE__ */ q(B, { children: [
|
|
374
|
-
/* @__PURE__ */ f(
|
|
375
|
-
/* @__PURE__ */ f(
|
|
369
|
+
/* @__PURE__ */ f(He, { titleId: s.titleId }),
|
|
370
|
+
/* @__PURE__ */ f(je, { contentRef: g, descriptionId: s.descriptionId })
|
|
376
371
|
] })
|
|
377
372
|
] });
|
|
378
373
|
}
|
|
@@ -405,14 +400,14 @@ var pe = "DialogClose", ve = i.forwardRef(
|
|
|
405
400
|
}
|
|
406
401
|
);
|
|
407
402
|
ve.displayName = pe;
|
|
408
|
-
function
|
|
403
|
+
function H(e) {
|
|
409
404
|
return e ? "open" : "closed";
|
|
410
405
|
}
|
|
411
|
-
var me = "DialogTitleWarning", [
|
|
412
|
-
contentName:
|
|
406
|
+
var me = "DialogTitleWarning", [tt, ge] = ye(me, {
|
|
407
|
+
contentName: A,
|
|
413
408
|
titleName: G,
|
|
414
409
|
docsSlug: "dialog"
|
|
415
|
-
}),
|
|
410
|
+
}), He = ({ titleId: e }) => {
|
|
416
411
|
const n = ge(me), t = `\`${n.contentName}\` requires a \`${n.titleName}\` for the component to be accessible for screen reader users.
|
|
417
412
|
|
|
418
413
|
If you want to hide the \`${n.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
@@ -421,26 +416,25 @@ For more information, see https://radix-ui.com/primitives/docs/components/${n.do
|
|
|
421
416
|
return i.useEffect(() => {
|
|
422
417
|
e && (document.getElementById(e) || console.error(t));
|
|
423
418
|
}, [t, e]), null;
|
|
424
|
-
},
|
|
425
|
-
const o = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ge(
|
|
419
|
+
}, $e = "DialogDescriptionWarning", je = ({ contentRef: e, descriptionId: n }) => {
|
|
420
|
+
const o = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${ge($e).contentName}}.`;
|
|
426
421
|
return i.useEffect(() => {
|
|
427
422
|
var r;
|
|
428
423
|
const a = (r = e.current) == null ? void 0 : r.getAttribute("aria-describedby");
|
|
429
424
|
n && a && (document.getElementById(n) || console.warn(o));
|
|
430
425
|
}, [o, e, n]), null;
|
|
431
|
-
},
|
|
426
|
+
}, nt = ne, ot = re, rt = se, at = ie, st = ce, it = le, ct = de, ut = ve;
|
|
432
427
|
export {
|
|
433
|
-
|
|
428
|
+
st as C,
|
|
434
429
|
le as D,
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
430
|
+
at as O,
|
|
431
|
+
rt as P,
|
|
432
|
+
nt as R,
|
|
433
|
+
it as T,
|
|
434
|
+
tt as W,
|
|
440
435
|
se as a,
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
M as u
|
|
436
|
+
ut as b,
|
|
437
|
+
et as c,
|
|
438
|
+
ct as d,
|
|
439
|
+
ot as e
|
|
446
440
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
1
|
import * as a from "react";
|
|
2
|
-
import { u as T } from "./index-
|
|
3
|
-
import { u as A } from "./index-
|
|
2
|
+
import { u as T } from "./index-tIydFizp.js";
|
|
3
|
+
import { u as A } from "./index-Cq1I1cG9.js";
|
|
4
4
|
function E(n, e) {
|
|
5
5
|
return a.useReducer((r, t) => e[r][t] ?? r, n);
|
|
6
6
|
}
|
|
7
7
|
var R = (n) => {
|
|
8
|
-
const { present: e, children: r } = n, t = P(e),
|
|
9
|
-
return typeof r == "function" || t.isPresent ? a.cloneElement(
|
|
8
|
+
const { present: e, children: r } = n, t = P(e), i = typeof r == "function" ? r({ present: t.isPresent }) : a.Children.only(r), c = T(t.ref, v(i));
|
|
9
|
+
return typeof r == "function" || t.isPresent ? a.cloneElement(i, { ref: c }) : null;
|
|
10
10
|
};
|
|
11
11
|
R.displayName = "Presence";
|
|
12
12
|
function P(n) {
|
|
13
|
-
const [e, r] = a.useState(), t = a.useRef(
|
|
13
|
+
const [e, r] = a.useState(), t = a.useRef(null), i = a.useRef(n), c = a.useRef("none"), p = n ? "mounted" : "unmounted", [N, s] = E(p, {
|
|
14
14
|
mounted: {
|
|
15
15
|
UNMOUNT: "unmounted",
|
|
16
16
|
ANIMATION_OUT: "unmountSuspended"
|
|
@@ -24,22 +24,22 @@ function P(n) {
|
|
|
24
24
|
}
|
|
25
25
|
});
|
|
26
26
|
return a.useEffect(() => {
|
|
27
|
-
const
|
|
28
|
-
c.current = N === "mounted" ?
|
|
27
|
+
const o = l(t.current);
|
|
28
|
+
c.current = N === "mounted" ? o : "none";
|
|
29
29
|
}, [N]), A(() => {
|
|
30
|
-
const
|
|
30
|
+
const o = t.current, m = i.current;
|
|
31
31
|
if (m !== n) {
|
|
32
|
-
const f = c.current, u = l(
|
|
33
|
-
n ? s("MOUNT") : u === "none" || (
|
|
32
|
+
const f = c.current, u = l(o);
|
|
33
|
+
n ? s("MOUNT") : u === "none" || (o == null ? void 0 : o.display) === "none" ? s("UNMOUNT") : s(m && f !== u ? "ANIMATION_OUT" : "UNMOUNT"), i.current = n;
|
|
34
34
|
}
|
|
35
35
|
}, [n, s]), A(() => {
|
|
36
36
|
if (e) {
|
|
37
|
-
let
|
|
37
|
+
let o;
|
|
38
38
|
const m = e.ownerDocument.defaultView ?? window, d = (u) => {
|
|
39
39
|
const g = l(t.current).includes(u.animationName);
|
|
40
|
-
if (u.target === e && g && (s("ANIMATION_END"), !
|
|
40
|
+
if (u.target === e && g && (s("ANIMATION_END"), !i.current)) {
|
|
41
41
|
const O = e.style.animationFillMode;
|
|
42
|
-
e.style.animationFillMode = "forwards",
|
|
42
|
+
e.style.animationFillMode = "forwards", o = m.setTimeout(() => {
|
|
43
43
|
e.style.animationFillMode === "forwards" && (e.style.animationFillMode = O);
|
|
44
44
|
});
|
|
45
45
|
}
|
|
@@ -47,14 +47,14 @@ function P(n) {
|
|
|
47
47
|
u.target === e && (c.current = l(t.current));
|
|
48
48
|
};
|
|
49
49
|
return e.addEventListener("animationstart", f), e.addEventListener("animationcancel", d), e.addEventListener("animationend", d), () => {
|
|
50
|
-
m.clearTimeout(
|
|
50
|
+
m.clearTimeout(o), e.removeEventListener("animationstart", f), e.removeEventListener("animationcancel", d), e.removeEventListener("animationend", d);
|
|
51
51
|
};
|
|
52
52
|
} else
|
|
53
53
|
s("ANIMATION_END");
|
|
54
54
|
}, [e, s]), {
|
|
55
55
|
isPresent: ["mounted", "unmountSuspended"].includes(N),
|
|
56
|
-
ref: a.useCallback((
|
|
57
|
-
|
|
56
|
+
ref: a.useCallback((o) => {
|
|
57
|
+
t.current = o ? getComputedStyle(o) : null, r(o);
|
|
58
58
|
}, [])
|
|
59
59
|
};
|
|
60
60
|
}
|
|
@@ -62,9 +62,9 @@ function l(n) {
|
|
|
62
62
|
return (n == null ? void 0 : n.animationName) || "none";
|
|
63
63
|
}
|
|
64
64
|
function v(n) {
|
|
65
|
-
var t,
|
|
65
|
+
var t, i;
|
|
66
66
|
let e = (t = Object.getOwnPropertyDescriptor(n.props, "ref")) == null ? void 0 : t.get, r = e && "isReactWarning" in e && e.isReactWarning;
|
|
67
|
-
return r ? n.ref : (e = (
|
|
67
|
+
return r ? n.ref : (e = (i = Object.getOwnPropertyDescriptor(n, "ref")) == null ? void 0 : i.get, r = e && "isReactWarning" in e && e.isReactWarning, r ? n.props.ref : n.props.ref || n.ref);
|
|
68
68
|
}
|
|
69
69
|
export {
|
|
70
70
|
R as P
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
import * as l from "react";
|
|
2
|
+
import { jsx as f, Fragment as S } from "react/jsx-runtime";
|
|
3
|
+
function d(e, t) {
|
|
4
|
+
if (typeof e == "function")
|
|
5
|
+
return e(t);
|
|
6
|
+
e != null && (e.current = t);
|
|
7
|
+
}
|
|
8
|
+
function g(...e) {
|
|
9
|
+
return (t) => {
|
|
10
|
+
let r = !1;
|
|
11
|
+
const o = e.map((n) => {
|
|
12
|
+
const i = d(n, t);
|
|
13
|
+
return !r && typeof i == "function" && (r = !0), i;
|
|
14
|
+
});
|
|
15
|
+
if (r)
|
|
16
|
+
return () => {
|
|
17
|
+
for (let n = 0; n < o.length; n++) {
|
|
18
|
+
const i = o[n];
|
|
19
|
+
typeof i == "function" ? i() : d(e[n], null);
|
|
20
|
+
}
|
|
21
|
+
};
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
function C(...e) {
|
|
25
|
+
return l.useCallback(g(...e), e);
|
|
26
|
+
}
|
|
27
|
+
// @__NO_SIDE_EFFECTS__
|
|
28
|
+
function E(e) {
|
|
29
|
+
const t = /* @__PURE__ */ R(e), r = l.forwardRef((o, n) => {
|
|
30
|
+
const { children: i, ...c } = o, a = l.Children.toArray(i), s = a.find(b);
|
|
31
|
+
if (s) {
|
|
32
|
+
const u = s.props.children, y = a.map((p) => p === s ? l.Children.count(u) > 1 ? l.Children.only(null) : l.isValidElement(u) ? u.props.children : null : p);
|
|
33
|
+
return /* @__PURE__ */ f(t, { ...c, ref: n, children: l.isValidElement(u) ? l.cloneElement(u, void 0, y) : null });
|
|
34
|
+
}
|
|
35
|
+
return /* @__PURE__ */ f(t, { ...c, ref: n, children: i });
|
|
36
|
+
});
|
|
37
|
+
return r.displayName = `${e}.Slot`, r;
|
|
38
|
+
}
|
|
39
|
+
var x = /* @__PURE__ */ E("Slot");
|
|
40
|
+
// @__NO_SIDE_EFFECTS__
|
|
41
|
+
function R(e) {
|
|
42
|
+
const t = l.forwardRef((r, o) => {
|
|
43
|
+
const { children: n, ...i } = r, c = l.isValidElement(n) ? V(n) : void 0, a = C(c, o);
|
|
44
|
+
if (l.isValidElement(n)) {
|
|
45
|
+
const s = h(i, n.props);
|
|
46
|
+
return n.type !== l.Fragment && (s.ref = a), l.cloneElement(n, s);
|
|
47
|
+
}
|
|
48
|
+
return l.Children.count(n) > 1 ? l.Children.only(null) : null;
|
|
49
|
+
});
|
|
50
|
+
return t.displayName = `${e}.SlotClone`, t;
|
|
51
|
+
}
|
|
52
|
+
var m = Symbol("radix.slottable");
|
|
53
|
+
// @__NO_SIDE_EFFECTS__
|
|
54
|
+
function I(e) {
|
|
55
|
+
const t = ({ children: r }) => /* @__PURE__ */ f(S, { children: r });
|
|
56
|
+
return t.displayName = `${e}.Slottable`, t.__radixId = m, t;
|
|
57
|
+
}
|
|
58
|
+
function b(e) {
|
|
59
|
+
return l.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === m;
|
|
60
|
+
}
|
|
61
|
+
function h(e, t) {
|
|
62
|
+
const r = { ...t };
|
|
63
|
+
for (const o in t) {
|
|
64
|
+
const n = e[o], i = t[o];
|
|
65
|
+
/^on[A-Z]/.test(o) ? n && i ? r[o] = (...a) => {
|
|
66
|
+
const s = i(...a);
|
|
67
|
+
return n(...a), s;
|
|
68
|
+
} : n && (r[o] = n) : o === "style" ? r[o] = { ...n, ...i } : o === "className" && (r[o] = [n, i].filter(Boolean).join(" "));
|
|
69
|
+
}
|
|
70
|
+
return { ...e, ...r };
|
|
71
|
+
}
|
|
72
|
+
function V(e) {
|
|
73
|
+
var o, n;
|
|
74
|
+
let t = (o = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : o.get, r = t && "isReactWarning" in t && t.isReactWarning;
|
|
75
|
+
return r ? e.ref : (t = (n = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : n.get, r = t && "isReactWarning" in t && t.isReactWarning, r ? e.props.ref : e.props.ref || e.ref);
|
|
76
|
+
}
|
|
77
|
+
export {
|
|
78
|
+
x as S,
|
|
79
|
+
g as a,
|
|
80
|
+
I as b,
|
|
81
|
+
E as c,
|
|
82
|
+
C as u
|
|
83
|
+
};
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsx as i, jsxs as w } from "react/jsx-runtime";
|
|
2
2
|
import * as l from "react";
|
|
3
|
-
import { c as M, b as x } from "./index-
|
|
4
|
-
import { u as A, b as I } from "./index-
|
|
5
|
-
import { c as v, R as $, P as L, O as F, W as G, C as W, T as j, d as B, b as D, e as Y } from "./index-
|
|
3
|
+
import { c as M, b as x } from "./index-Cq1I1cG9.js";
|
|
4
|
+
import { u as A, b as I } from "./index-tIydFizp.js";
|
|
5
|
+
import { c as v, R as $, P as L, O as F, W as G, C as W, T as j, d as B, b as D, e as Y } from "./index-Ud3-A7-K.js";
|
|
6
6
|
import { Button as k } from "./components/Button/Button.js";
|
|
7
7
|
import { cn as q } from "./utils/index.js";
|
|
8
8
|
var f = "AlertDialog", [H, se] = M(f, [
|