@arcadeai/design-system 0.7.2 → 0.7.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/assets/index.css +1 -1
- package/dist/{check-CxcShTlQ.js → check-B5h1DvDs.js} +2 -2
- package/dist/{chevron-down-D_a-ccxi.js → chevron-down-DmZMdOiC.js} +2 -2
- package/dist/{chevron-right-DriXIqe5.js → chevron-right-BYYHEJjK.js} +2 -2
- package/dist/components/ui/atoms/accordion.js +70 -74
- package/dist/components/ui/atoms/alert.js +2 -2
- package/dist/components/ui/atoms/avatar.js +5 -5
- package/dist/components/ui/atoms/badge.js +3 -3
- package/dist/components/ui/atoms/breadcrumb.js +5 -5
- package/dist/components/ui/atoms/button.js +3 -3
- package/dist/components/ui/atoms/card.js +1 -1
- package/dist/components/ui/atoms/chart.js +2153 -2154
- package/dist/components/ui/atoms/collapsible.js +1 -1
- package/dist/components/ui/atoms/command.js +15 -15
- package/dist/components/ui/atoms/dialog.js +2 -2
- package/dist/components/ui/atoms/dropdown-menu.js +367 -384
- package/dist/components/ui/atoms/form.d.ts +1 -1
- package/dist/components/ui/atoms/form.js +182 -199
- package/dist/components/ui/atoms/hover-card.js +40 -41
- package/dist/components/ui/atoms/input.js +1 -1
- package/dist/components/ui/atoms/label.js +18 -19
- package/dist/components/ui/atoms/popover.js +107 -110
- package/dist/components/ui/atoms/progress.js +3 -3
- package/dist/components/ui/atoms/resizable.js +8 -8
- package/dist/components/ui/atoms/scroll-area.js +82 -84
- package/dist/components/ui/atoms/select.js +393 -407
- package/dist/components/ui/atoms/separator.js +2 -2
- package/dist/components/ui/atoms/sheet.js +2 -2
- package/dist/components/ui/atoms/sidebar.js +17 -17
- package/dist/components/ui/atoms/skeleton.js +1 -1
- package/dist/components/ui/atoms/slider.js +213 -214
- package/dist/components/ui/atoms/sonner.js +28 -28
- package/dist/components/ui/atoms/switch.js +7 -7
- package/dist/components/ui/atoms/table.js +1 -1
- package/dist/components/ui/atoms/tabs.js +8 -8
- package/dist/components/ui/atoms/textarea.js +1 -1
- package/dist/components/ui/atoms/toggle.js +5 -5
- package/dist/components/ui/atoms/tooltip.js +103 -104
- package/dist/{createLucideIcon-B6fy1GTR.js → createLucideIcon-XRdN60yz.js} +4 -4
- package/dist/index-0ioNhtNM.js +10 -0
- package/dist/index-437EL2iq.js +52 -0
- package/dist/{index-CB1Wkg0G.js → index-5Bhkapwi.js} +2 -3
- package/dist/index-B695uy69.js +9 -0
- package/dist/{index-CHDs-SiB.js → index-BGQepRFJ.js} +1 -1
- package/dist/{index-BAhNQL1u.js → index-BvWMjxZ5.js} +22 -23
- package/dist/index-C8_QusYl.js +70 -0
- package/dist/index-CCKe-Mpx.js +6 -0
- package/dist/{index-DdnpnyX2.js → index-CQhYMnjT.js} +4 -4
- package/dist/{index-C9KW2H79.js → index-CpDnqHCm.js} +1 -1
- package/dist/{index-CxK6rt_N.js → index-CtSXVDca.js} +8 -8
- package/dist/{index-umR1UobZ.js → index-Cv867SGx.js} +1 -1
- package/dist/{index-CuMpq4Un.js → index-CxO14pcK.js} +2 -2
- package/dist/index-DFZozV_h.js +68 -0
- package/dist/index-DLfXSskr.js +255 -0
- package/dist/{index-D2uXV4lz.js → index-DMCYNwtg.js} +8 -8
- package/dist/index-DYHsXnnS.js +144 -0
- package/dist/{index-nluJZSbA.js → index-DfNPZZ8M.js} +1 -1
- package/dist/{index-Dy7YuPrV.js → index-f0YS5Ufh.js} +319 -321
- package/dist/lib/utils.js +1 -1
- package/dist/{utils-Dy2WjYNJ.js → utils-CRiPKpXj.js} +41 -42
- package/package.json +32 -26
- package/dist/index-CL4N9wMT.js +0 -259
- package/dist/index-DLeNytVF.js +0 -9
- package/dist/index-DYfkNB0n.js +0 -54
- package/dist/index-DuekHEmj.js +0 -6
- package/dist/index-DwYXX2sM.js +0 -13
- package/dist/index-QMp1pYFl.js +0 -145
- package/dist/index-UFb2E87s.js +0 -70
- package/dist/index-p7nYL7BU.js +0 -71
|
@@ -0,0 +1,255 @@
|
|
|
1
|
+
import { c as V } from "./createLucideIcon-XRdN60yz.js";
|
|
2
|
+
import * as s from "react";
|
|
3
|
+
import { c as g } from "./index-B695uy69.js";
|
|
4
|
+
import { u as _, c as q } from "./index-5Bhkapwi.js";
|
|
5
|
+
import { c as K, a as U } from "./index-DFZozV_h.js";
|
|
6
|
+
import { u as R } from "./index-Cv867SGx.js";
|
|
7
|
+
import { u as X } from "./index-437EL2iq.js";
|
|
8
|
+
import { P as Y, D as Z } from "./index-DYHsXnnS.js";
|
|
9
|
+
import { h as z, R as J, u as Q, F as ee } from "./index-BvWMjxZ5.js";
|
|
10
|
+
import { P as h } from "./index-C8_QusYl.js";
|
|
11
|
+
import { P as p } from "./index-CpDnqHCm.js";
|
|
12
|
+
import { jsx as i, jsxs as N, Fragment as O } from "react/jsx-runtime";
|
|
13
|
+
/**
|
|
14
|
+
* @license lucide-react v0.525.0 - ISC
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the ISC license.
|
|
17
|
+
* See the LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/
|
|
19
|
+
const oe = [
|
|
20
|
+
["path", { d: "M18 6 6 18", key: "1bl5f8" }],
|
|
21
|
+
["path", { d: "m6 6 12 12", key: "d8bk6v" }]
|
|
22
|
+
], Pe = V("x", oe);
|
|
23
|
+
var D = "Dialog", [I, ye] = K(D), [te, u] = I(D), x = (e) => {
|
|
24
|
+
const {
|
|
25
|
+
__scopeDialog: t,
|
|
26
|
+
children: n,
|
|
27
|
+
open: a,
|
|
28
|
+
defaultOpen: r,
|
|
29
|
+
onOpenChange: o,
|
|
30
|
+
modal: l = !0
|
|
31
|
+
} = e, c = s.useRef(null), f = s.useRef(null), [v, C] = X({
|
|
32
|
+
prop: a,
|
|
33
|
+
defaultProp: r ?? !1,
|
|
34
|
+
onChange: o,
|
|
35
|
+
caller: D
|
|
36
|
+
});
|
|
37
|
+
return /* @__PURE__ */ i(
|
|
38
|
+
te,
|
|
39
|
+
{
|
|
40
|
+
scope: t,
|
|
41
|
+
triggerRef: c,
|
|
42
|
+
contentRef: f,
|
|
43
|
+
contentId: R(),
|
|
44
|
+
titleId: R(),
|
|
45
|
+
descriptionId: R(),
|
|
46
|
+
open: v,
|
|
47
|
+
onOpenChange: C,
|
|
48
|
+
onOpenToggle: s.useCallback(() => C((H) => !H), [C]),
|
|
49
|
+
modal: l,
|
|
50
|
+
children: n
|
|
51
|
+
}
|
|
52
|
+
);
|
|
53
|
+
};
|
|
54
|
+
x.displayName = D;
|
|
55
|
+
var b = "DialogTrigger", A = s.forwardRef(
|
|
56
|
+
(e, t) => {
|
|
57
|
+
const { __scopeDialog: n, ...a } = e, r = u(b, n), o = _(t, r.triggerRef);
|
|
58
|
+
return /* @__PURE__ */ i(
|
|
59
|
+
p.button,
|
|
60
|
+
{
|
|
61
|
+
type: "button",
|
|
62
|
+
"aria-haspopup": "dialog",
|
|
63
|
+
"aria-expanded": r.open,
|
|
64
|
+
"aria-controls": r.contentId,
|
|
65
|
+
"data-state": E(r.open),
|
|
66
|
+
...a,
|
|
67
|
+
ref: o,
|
|
68
|
+
onClick: g(e.onClick, r.onOpenToggle)
|
|
69
|
+
}
|
|
70
|
+
);
|
|
71
|
+
}
|
|
72
|
+
);
|
|
73
|
+
A.displayName = b;
|
|
74
|
+
var P = "DialogPortal", [re, T] = I(P, {
|
|
75
|
+
forceMount: void 0
|
|
76
|
+
}), M = (e) => {
|
|
77
|
+
const { __scopeDialog: t, forceMount: n, children: a, container: r } = e, o = u(P, t);
|
|
78
|
+
return /* @__PURE__ */ i(re, { scope: t, forceMount: n, children: s.Children.map(a, (l) => /* @__PURE__ */ i(h, { present: n || o.open, children: /* @__PURE__ */ i(Y, { asChild: !0, container: r, children: l }) })) });
|
|
79
|
+
};
|
|
80
|
+
M.displayName = P;
|
|
81
|
+
var m = "DialogOverlay", w = s.forwardRef(
|
|
82
|
+
(e, t) => {
|
|
83
|
+
const n = T(m, e.__scopeDialog), { forceMount: a = n.forceMount, ...r } = e, o = u(m, e.__scopeDialog);
|
|
84
|
+
return o.modal ? /* @__PURE__ */ i(h, { present: a || o.open, children: /* @__PURE__ */ i(ae, { ...r, ref: t }) }) : null;
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
w.displayName = m;
|
|
88
|
+
var ne = q("DialogOverlay.RemoveScroll"), ae = s.forwardRef(
|
|
89
|
+
(e, t) => {
|
|
90
|
+
const { __scopeDialog: n, ...a } = e, r = u(m, n);
|
|
91
|
+
return (
|
|
92
|
+
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
93
|
+
// ie. when `Overlay` and `Content` are siblings
|
|
94
|
+
/* @__PURE__ */ i(J, { as: ne, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ i(
|
|
95
|
+
p.div,
|
|
96
|
+
{
|
|
97
|
+
"data-state": E(r.open),
|
|
98
|
+
...a,
|
|
99
|
+
ref: t,
|
|
100
|
+
style: { pointerEvents: "auto", ...a.style }
|
|
101
|
+
}
|
|
102
|
+
) })
|
|
103
|
+
);
|
|
104
|
+
}
|
|
105
|
+
), d = "DialogContent", F = s.forwardRef(
|
|
106
|
+
(e, t) => {
|
|
107
|
+
const n = T(d, e.__scopeDialog), { forceMount: a = n.forceMount, ...r } = e, o = u(d, e.__scopeDialog);
|
|
108
|
+
return /* @__PURE__ */ i(h, { present: a || o.open, children: o.modal ? /* @__PURE__ */ i(ie, { ...r, ref: t }) : /* @__PURE__ */ i(se, { ...r, ref: t }) });
|
|
109
|
+
}
|
|
110
|
+
);
|
|
111
|
+
F.displayName = d;
|
|
112
|
+
var ie = s.forwardRef(
|
|
113
|
+
(e, t) => {
|
|
114
|
+
const n = u(d, e.__scopeDialog), a = s.useRef(null), r = _(t, n.contentRef, a);
|
|
115
|
+
return s.useEffect(() => {
|
|
116
|
+
const o = a.current;
|
|
117
|
+
if (o) return z(o);
|
|
118
|
+
}, []), /* @__PURE__ */ i(
|
|
119
|
+
S,
|
|
120
|
+
{
|
|
121
|
+
...e,
|
|
122
|
+
ref: r,
|
|
123
|
+
trapFocus: n.open,
|
|
124
|
+
disableOutsidePointerEvents: !0,
|
|
125
|
+
onCloseAutoFocus: g(e.onCloseAutoFocus, (o) => {
|
|
126
|
+
o.preventDefault(), n.triggerRef.current?.focus();
|
|
127
|
+
}),
|
|
128
|
+
onPointerDownOutside: g(e.onPointerDownOutside, (o) => {
|
|
129
|
+
const l = o.detail.originalEvent, c = l.button === 0 && l.ctrlKey === !0;
|
|
130
|
+
(l.button === 2 || c) && o.preventDefault();
|
|
131
|
+
}),
|
|
132
|
+
onFocusOutside: g(
|
|
133
|
+
e.onFocusOutside,
|
|
134
|
+
(o) => o.preventDefault()
|
|
135
|
+
)
|
|
136
|
+
}
|
|
137
|
+
);
|
|
138
|
+
}
|
|
139
|
+
), se = s.forwardRef(
|
|
140
|
+
(e, t) => {
|
|
141
|
+
const n = u(d, e.__scopeDialog), a = s.useRef(!1), r = s.useRef(!1);
|
|
142
|
+
return /* @__PURE__ */ i(
|
|
143
|
+
S,
|
|
144
|
+
{
|
|
145
|
+
...e,
|
|
146
|
+
ref: t,
|
|
147
|
+
trapFocus: !1,
|
|
148
|
+
disableOutsidePointerEvents: !1,
|
|
149
|
+
onCloseAutoFocus: (o) => {
|
|
150
|
+
e.onCloseAutoFocus?.(o), o.defaultPrevented || (a.current || n.triggerRef.current?.focus(), o.preventDefault()), a.current = !1, r.current = !1;
|
|
151
|
+
},
|
|
152
|
+
onInteractOutside: (o) => {
|
|
153
|
+
e.onInteractOutside?.(o), o.defaultPrevented || (a.current = !0, o.detail.originalEvent.type === "pointerdown" && (r.current = !0));
|
|
154
|
+
const l = o.target;
|
|
155
|
+
n.triggerRef.current?.contains(l) && o.preventDefault(), o.detail.originalEvent.type === "focusin" && r.current && o.preventDefault();
|
|
156
|
+
}
|
|
157
|
+
}
|
|
158
|
+
);
|
|
159
|
+
}
|
|
160
|
+
), S = s.forwardRef(
|
|
161
|
+
(e, t) => {
|
|
162
|
+
const { __scopeDialog: n, trapFocus: a, onOpenAutoFocus: r, onCloseAutoFocus: o, ...l } = e, c = u(d, n), f = s.useRef(null), v = _(t, f);
|
|
163
|
+
return Q(), /* @__PURE__ */ N(O, { children: [
|
|
164
|
+
/* @__PURE__ */ i(
|
|
165
|
+
ee,
|
|
166
|
+
{
|
|
167
|
+
asChild: !0,
|
|
168
|
+
loop: !0,
|
|
169
|
+
trapped: a,
|
|
170
|
+
onMountAutoFocus: r,
|
|
171
|
+
onUnmountAutoFocus: o,
|
|
172
|
+
children: /* @__PURE__ */ i(
|
|
173
|
+
Z,
|
|
174
|
+
{
|
|
175
|
+
role: "dialog",
|
|
176
|
+
id: c.contentId,
|
|
177
|
+
"aria-describedby": c.descriptionId,
|
|
178
|
+
"aria-labelledby": c.titleId,
|
|
179
|
+
"data-state": E(c.open),
|
|
180
|
+
...l,
|
|
181
|
+
ref: v,
|
|
182
|
+
onDismiss: () => c.onOpenChange(!1)
|
|
183
|
+
}
|
|
184
|
+
)
|
|
185
|
+
}
|
|
186
|
+
),
|
|
187
|
+
/* @__PURE__ */ N(O, { children: [
|
|
188
|
+
/* @__PURE__ */ i(ce, { titleId: c.titleId }),
|
|
189
|
+
/* @__PURE__ */ i(ue, { contentRef: f, descriptionId: c.descriptionId })
|
|
190
|
+
] })
|
|
191
|
+
] });
|
|
192
|
+
}
|
|
193
|
+
), y = "DialogTitle", W = s.forwardRef(
|
|
194
|
+
(e, t) => {
|
|
195
|
+
const { __scopeDialog: n, ...a } = e, r = u(y, n);
|
|
196
|
+
return /* @__PURE__ */ i(p.h2, { id: r.titleId, ...a, ref: t });
|
|
197
|
+
}
|
|
198
|
+
);
|
|
199
|
+
W.displayName = y;
|
|
200
|
+
var k = "DialogDescription", L = s.forwardRef(
|
|
201
|
+
(e, t) => {
|
|
202
|
+
const { __scopeDialog: n, ...a } = e, r = u(k, n);
|
|
203
|
+
return /* @__PURE__ */ i(p.p, { id: r.descriptionId, ...a, ref: t });
|
|
204
|
+
}
|
|
205
|
+
);
|
|
206
|
+
L.displayName = k;
|
|
207
|
+
var G = "DialogClose", $ = s.forwardRef(
|
|
208
|
+
(e, t) => {
|
|
209
|
+
const { __scopeDialog: n, ...a } = e, r = u(G, n);
|
|
210
|
+
return /* @__PURE__ */ i(
|
|
211
|
+
p.button,
|
|
212
|
+
{
|
|
213
|
+
type: "button",
|
|
214
|
+
...a,
|
|
215
|
+
ref: t,
|
|
216
|
+
onClick: g(e.onClick, () => r.onOpenChange(!1))
|
|
217
|
+
}
|
|
218
|
+
);
|
|
219
|
+
}
|
|
220
|
+
);
|
|
221
|
+
$.displayName = G;
|
|
222
|
+
function E(e) {
|
|
223
|
+
return e ? "open" : "closed";
|
|
224
|
+
}
|
|
225
|
+
var B = "DialogTitleWarning", [Ee, j] = U(B, {
|
|
226
|
+
contentName: d,
|
|
227
|
+
titleName: y,
|
|
228
|
+
docsSlug: "dialog"
|
|
229
|
+
}), ce = ({ titleId: e }) => {
|
|
230
|
+
const t = j(B), n = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
|
|
231
|
+
|
|
232
|
+
If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
233
|
+
|
|
234
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;
|
|
235
|
+
return s.useEffect(() => {
|
|
236
|
+
e && (document.getElementById(e) || console.error(n));
|
|
237
|
+
}, [n, e]), null;
|
|
238
|
+
}, le = "DialogDescriptionWarning", ue = ({ contentRef: e, descriptionId: t }) => {
|
|
239
|
+
const a = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${j(le).contentName}}.`;
|
|
240
|
+
return s.useEffect(() => {
|
|
241
|
+
const r = e.current?.getAttribute("aria-describedby");
|
|
242
|
+
t && r && (document.getElementById(t) || console.warn(a));
|
|
243
|
+
}, [a, e, t]), null;
|
|
244
|
+
}, Ne = x, Oe = A, Ie = M, xe = w, be = F, Ae = W, Te = L, Me = $;
|
|
245
|
+
export {
|
|
246
|
+
Me as C,
|
|
247
|
+
Te as D,
|
|
248
|
+
xe as O,
|
|
249
|
+
Ie as P,
|
|
250
|
+
Ne as R,
|
|
251
|
+
Oe as T,
|
|
252
|
+
Pe as X,
|
|
253
|
+
be as a,
|
|
254
|
+
Ae as b
|
|
255
|
+
};
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import * as s from "react";
|
|
2
|
-
import { c as p } from "./index-
|
|
3
|
-
import { c as V } from "./index-
|
|
4
|
-
import { u as j } from "./index-
|
|
5
|
-
import { c as z } from "./index-
|
|
6
|
-
import { u as q } from "./index-
|
|
7
|
-
import { P as G } from "./index-
|
|
8
|
-
import { u as J } from "./index-
|
|
9
|
-
import { u as Q } from "./index-
|
|
2
|
+
import { c as p } from "./index-B695uy69.js";
|
|
3
|
+
import { c as V } from "./index-CxO14pcK.js";
|
|
4
|
+
import { u as j } from "./index-5Bhkapwi.js";
|
|
5
|
+
import { c as z } from "./index-DFZozV_h.js";
|
|
6
|
+
import { u as q } from "./index-Cv867SGx.js";
|
|
7
|
+
import { P as G } from "./index-CpDnqHCm.js";
|
|
8
|
+
import { u as J } from "./index-0ioNhtNM.js";
|
|
9
|
+
import { u as Q } from "./index-437EL2iq.js";
|
|
10
10
|
import { u as W } from "./index-ByaXH_ih.js";
|
|
11
11
|
import { jsx as d } from "react/jsx-runtime";
|
|
12
12
|
var y = "rovingFocusGroup.onEntryFocus", X = { bubbles: !1, cancelable: !0 }, I = "RovingFocusGroup", [P, N, Z] = V(I), [$, Fe] = z(
|
|
@@ -0,0 +1,144 @@
|
|
|
1
|
+
import * as r from "react";
|
|
2
|
+
import { c as p } from "./index-B695uy69.js";
|
|
3
|
+
import { P as h, d as k } from "./index-CpDnqHCm.js";
|
|
4
|
+
import { u as T } from "./index-5Bhkapwi.js";
|
|
5
|
+
import { u as b } from "./index-0ioNhtNM.js";
|
|
6
|
+
import { jsx as P } from "react/jsx-runtime";
|
|
7
|
+
import M from "react-dom";
|
|
8
|
+
import { u as U } from "./index-CCKe-Mpx.js";
|
|
9
|
+
function z(n, e = globalThis?.document) {
|
|
10
|
+
const t = b(n);
|
|
11
|
+
r.useEffect(() => {
|
|
12
|
+
const o = (s) => {
|
|
13
|
+
s.key === "Escape" && t(s);
|
|
14
|
+
};
|
|
15
|
+
return e.addEventListener("keydown", o, { capture: !0 }), () => e.removeEventListener("keydown", o, { capture: !0 });
|
|
16
|
+
}, [t, e]);
|
|
17
|
+
}
|
|
18
|
+
var H = "DismissableLayer", y = "dismissableLayer.update", K = "dismissableLayer.pointerDownOutside", j = "dismissableLayer.focusOutside", R, B = r.createContext({
|
|
19
|
+
layers: /* @__PURE__ */ new Set(),
|
|
20
|
+
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
21
|
+
branches: /* @__PURE__ */ new Set()
|
|
22
|
+
}), X = r.forwardRef(
|
|
23
|
+
(n, e) => {
|
|
24
|
+
const {
|
|
25
|
+
disableOutsidePointerEvents: t = !1,
|
|
26
|
+
onEscapeKeyDown: o,
|
|
27
|
+
onPointerDownOutside: s,
|
|
28
|
+
onFocusOutside: a,
|
|
29
|
+
onInteractOutside: d,
|
|
30
|
+
onDismiss: l,
|
|
31
|
+
...E
|
|
32
|
+
} = n, c = r.useContext(B), [u, F] = r.useState(null), f = u?.ownerDocument ?? globalThis?.document, [, I] = r.useState({}), S = T(e, (i) => F(i)), D = Array.from(c.layers), [A] = [...c.layersWithOutsidePointerEventsDisabled].slice(-1), N = D.indexOf(A), O = u ? D.indexOf(u) : -1, W = c.layersWithOutsidePointerEventsDisabled.size > 0, L = O >= N, _ = G((i) => {
|
|
33
|
+
const v = i.target, w = [...c.branches].some((m) => m.contains(v));
|
|
34
|
+
!L || w || (s?.(i), d?.(i), i.defaultPrevented || l?.());
|
|
35
|
+
}, f), C = J((i) => {
|
|
36
|
+
const v = i.target;
|
|
37
|
+
[...c.branches].some((m) => m.contains(v)) || (a?.(i), d?.(i), i.defaultPrevented || l?.());
|
|
38
|
+
}, f);
|
|
39
|
+
return z((i) => {
|
|
40
|
+
O === c.layers.size - 1 && (o?.(i), !i.defaultPrevented && l && (i.preventDefault(), l()));
|
|
41
|
+
}, f), r.useEffect(() => {
|
|
42
|
+
if (u)
|
|
43
|
+
return t && (c.layersWithOutsidePointerEventsDisabled.size === 0 && (R = f.body.style.pointerEvents, f.body.style.pointerEvents = "none"), c.layersWithOutsidePointerEventsDisabled.add(u)), c.layers.add(u), g(), () => {
|
|
44
|
+
t && c.layersWithOutsidePointerEventsDisabled.size === 1 && (f.body.style.pointerEvents = R);
|
|
45
|
+
};
|
|
46
|
+
}, [u, f, t, c]), r.useEffect(() => () => {
|
|
47
|
+
u && (c.layers.delete(u), c.layersWithOutsidePointerEventsDisabled.delete(u), g());
|
|
48
|
+
}, [u, c]), r.useEffect(() => {
|
|
49
|
+
const i = () => I({});
|
|
50
|
+
return document.addEventListener(y, i), () => document.removeEventListener(y, i);
|
|
51
|
+
}, []), /* @__PURE__ */ P(
|
|
52
|
+
h.div,
|
|
53
|
+
{
|
|
54
|
+
...E,
|
|
55
|
+
ref: S,
|
|
56
|
+
style: {
|
|
57
|
+
pointerEvents: W ? L ? "auto" : "none" : void 0,
|
|
58
|
+
...n.style
|
|
59
|
+
},
|
|
60
|
+
onFocusCapture: p(n.onFocusCapture, C.onFocusCapture),
|
|
61
|
+
onBlurCapture: p(n.onBlurCapture, C.onBlurCapture),
|
|
62
|
+
onPointerDownCapture: p(
|
|
63
|
+
n.onPointerDownCapture,
|
|
64
|
+
_.onPointerDownCapture
|
|
65
|
+
)
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
}
|
|
69
|
+
);
|
|
70
|
+
X.displayName = H;
|
|
71
|
+
var Y = "DismissableLayerBranch", q = r.forwardRef((n, e) => {
|
|
72
|
+
const t = r.useContext(B), o = r.useRef(null), s = T(e, o);
|
|
73
|
+
return r.useEffect(() => {
|
|
74
|
+
const a = o.current;
|
|
75
|
+
if (a)
|
|
76
|
+
return t.branches.add(a), () => {
|
|
77
|
+
t.branches.delete(a);
|
|
78
|
+
};
|
|
79
|
+
}, [t.branches]), /* @__PURE__ */ P(h.div, { ...n, ref: s });
|
|
80
|
+
});
|
|
81
|
+
q.displayName = Y;
|
|
82
|
+
function G(n, e = globalThis?.document) {
|
|
83
|
+
const t = b(n), o = r.useRef(!1), s = r.useRef(() => {
|
|
84
|
+
});
|
|
85
|
+
return r.useEffect(() => {
|
|
86
|
+
const a = (l) => {
|
|
87
|
+
if (l.target && !o.current) {
|
|
88
|
+
let E = function() {
|
|
89
|
+
x(
|
|
90
|
+
K,
|
|
91
|
+
t,
|
|
92
|
+
c,
|
|
93
|
+
{ discrete: !0 }
|
|
94
|
+
);
|
|
95
|
+
};
|
|
96
|
+
const c = { originalEvent: l };
|
|
97
|
+
l.pointerType === "touch" ? (e.removeEventListener("click", s.current), s.current = E, e.addEventListener("click", s.current, { once: !0 })) : E();
|
|
98
|
+
} else
|
|
99
|
+
e.removeEventListener("click", s.current);
|
|
100
|
+
o.current = !1;
|
|
101
|
+
}, d = window.setTimeout(() => {
|
|
102
|
+
e.addEventListener("pointerdown", a);
|
|
103
|
+
}, 0);
|
|
104
|
+
return () => {
|
|
105
|
+
window.clearTimeout(d), e.removeEventListener("pointerdown", a), e.removeEventListener("click", s.current);
|
|
106
|
+
};
|
|
107
|
+
}, [e, t]), {
|
|
108
|
+
// ensures we check React component tree (not just DOM tree)
|
|
109
|
+
onPointerDownCapture: () => o.current = !0
|
|
110
|
+
};
|
|
111
|
+
}
|
|
112
|
+
function J(n, e = globalThis?.document) {
|
|
113
|
+
const t = b(n), o = r.useRef(!1);
|
|
114
|
+
return r.useEffect(() => {
|
|
115
|
+
const s = (a) => {
|
|
116
|
+
a.target && !o.current && x(j, t, { originalEvent: a }, {
|
|
117
|
+
discrete: !1
|
|
118
|
+
});
|
|
119
|
+
};
|
|
120
|
+
return e.addEventListener("focusin", s), () => e.removeEventListener("focusin", s);
|
|
121
|
+
}, [e, t]), {
|
|
122
|
+
onFocusCapture: () => o.current = !0,
|
|
123
|
+
onBlurCapture: () => o.current = !1
|
|
124
|
+
};
|
|
125
|
+
}
|
|
126
|
+
function g() {
|
|
127
|
+
const n = new CustomEvent(y);
|
|
128
|
+
document.dispatchEvent(n);
|
|
129
|
+
}
|
|
130
|
+
function x(n, e, t, { discrete: o }) {
|
|
131
|
+
const s = t.originalEvent.target, a = new CustomEvent(n, { bubbles: !1, cancelable: !0, detail: t });
|
|
132
|
+
e && s.addEventListener(n, e, { once: !0 }), o ? k(s, a) : s.dispatchEvent(a);
|
|
133
|
+
}
|
|
134
|
+
var Q = "Portal", V = r.forwardRef((n, e) => {
|
|
135
|
+
const { container: t, ...o } = n, [s, a] = r.useState(!1);
|
|
136
|
+
U(() => a(!0), []);
|
|
137
|
+
const d = t || s && globalThis?.document?.body;
|
|
138
|
+
return d ? M.createPortal(/* @__PURE__ */ P(h.div, { ...o, ref: e }), d) : null;
|
|
139
|
+
});
|
|
140
|
+
V.displayName = Q;
|
|
141
|
+
export {
|
|
142
|
+
X as D,
|
|
143
|
+
V as P
|
|
144
|
+
};
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import * as i from "react";
|
|
2
|
-
import { P as o } from "./index-
|
|
2
|
+
import { P as o } from "./index-CpDnqHCm.js";
|
|
3
3
|
import { jsx as t } from "react/jsx-runtime";
|
|
4
4
|
var d = Object.freeze({
|
|
5
5
|
// See: https://github.com/twbs/bootstrap/blob/main/scss/mixins/_visually-hidden.scss
|