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