laif-ds 0.1.57 → 0.1.59
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/_virtual/index.js +5 -2
- package/dist/_virtual/index3.js +2 -5
- package/dist/_virtual/index4.js +5 -2
- package/dist/_virtual/index5.js +5 -5
- package/dist/_virtual/index6.js +2 -5
- package/dist/_virtual/index7.js +2 -5
- package/dist/_virtual/index8.js +5 -2
- package/dist/components/ui/app-select.js +36 -31
- package/dist/components/ui/date-picker.js +44 -32
- package/dist/components/ui/gantt/components/Chart/Chart.js +1 -1
- package/dist/index.d.ts +7 -3
- package/dist/node_modules/@radix-ui/react-slot/dist/index.js +29 -29
- package/dist/node_modules/@radix-ui/react-use-is-hydrated/dist/index.js +1 -1
- package/dist/node_modules/cmdk/dist/index.js +2 -2
- package/dist/node_modules/cmdk/node_modules/@radix-ui/react-dialog/dist/index.js +259 -0
- package/dist/node_modules/cmdk/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +128 -0
- package/dist/node_modules/cmdk/node_modules/@radix-ui/react-focus-scope/dist/index.js +138 -0
- package/dist/node_modules/cmdk/node_modules/@radix-ui/react-portal/dist/index.js +17 -0
- package/dist/node_modules/cmdk/node_modules/@radix-ui/react-primitive/dist/index.js +37 -0
- package/dist/node_modules/cmdk/node_modules/@radix-ui/react-slot/dist/index.js +51 -0
- package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
- package/dist/node_modules/react-is/index.js +1 -1
- package/dist/node_modules/recharts/es6/util/ReactUtils.js +1 -1
- package/dist/node_modules/style-to-object/cjs/index.js +1 -1
- package/dist/node_modules/unified/lib/index.js +1 -1
- package/dist/node_modules/use-sync-external-store/shim/index.js +1 -1
- package/dist/node_modules/vaul/dist/index.js +1 -1
- package/dist/node_modules/vaul/node_modules/@radix-ui/react-dialog/dist/index.js +262 -0
- package/dist/node_modules/vaul/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +128 -0
- package/dist/node_modules/vaul/node_modules/@radix-ui/react-focus-scope/dist/index.js +138 -0
- package/dist/node_modules/vaul/node_modules/@radix-ui/react-portal/dist/index.js +17 -0
- package/dist/node_modules/vaul/node_modules/@radix-ui/react-primitive/dist/index.js +37 -0
- package/dist/node_modules/vaul/node_modules/@radix-ui/react-slot/dist/index.js +51 -0
- package/dist/styles.v3.css +1 -1
- package/package.json +28 -28
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { __module as e } from "../../../_virtual/
|
|
2
|
+
import { __module as e } from "../../../_virtual/index2.js";
|
|
3
3
|
import { __require as i } from "../cjs/use-sync-external-store-shim.production.js";
|
|
4
4
|
import { __require as o } from "../cjs/use-sync-external-store-shim.development.js";
|
|
5
5
|
var r;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import { Trigger as me, Title as pe, Description as we, Root as he, Content as ge, Portal as ve, Overlay as ye } from "
|
|
2
|
+
import { Trigger as me, Title as pe, Description as we, Root as he, Content as ge, Portal as ve, Overlay as ye } from "../node_modules/@radix-ui/react-dialog/dist/index.js";
|
|
3
3
|
import * as be from "react";
|
|
4
4
|
import r, { useLayoutEffect as Se, useEffect as Te, useMemo as Re } from "react";
|
|
5
5
|
function Ee(t) {
|
|
@@ -0,0 +1,262 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as s from "react";
|
|
3
|
+
import { composeEventHandlers as p } from "../../../../../@radix-ui/primitive/dist/index.js";
|
|
4
|
+
import { useComposedRefs as _ } from "../../../../../@radix-ui/react-compose-refs/dist/index.js";
|
|
5
|
+
import { createContextScope as H, createContext as V } from "../../../../../@radix-ui/react-context/dist/index.js";
|
|
6
|
+
import { useId as R } from "../../../../../@radix-ui/react-id/dist/index.js";
|
|
7
|
+
import { useControllableState as q } from "../../../../../@radix-ui/react-use-controllable-state/dist/index.js";
|
|
8
|
+
import { DismissableLayer as K } from "../../react-dismissable-layer/dist/index.js";
|
|
9
|
+
import { FocusScope as U } from "../../react-focus-scope/dist/index.js";
|
|
10
|
+
import { Portal as Y } from "../../react-portal/dist/index.js";
|
|
11
|
+
import { Presence as h } from "../../../../../@radix-ui/react-presence/dist/index.js";
|
|
12
|
+
import { Primitive as m } from "../../react-primitive/dist/index.js";
|
|
13
|
+
import { useFocusGuards as Z } from "../../../../../@radix-ui/react-focus-guards/dist/index.js";
|
|
14
|
+
import z from "../../../../../react-remove-scroll/dist/es2015/Combination.js";
|
|
15
|
+
import { hideOthers as J } from "../../../../../aria-hidden/dist/es2015/index.js";
|
|
16
|
+
import { createSlot as Q } from "../../react-slot/dist/index.js";
|
|
17
|
+
import { jsx as i, jsxs as P, Fragment as O } from "react/jsx-runtime";
|
|
18
|
+
var v = "Dialog", [I, Ne] = H(v), [X, u] = I(v), x = (e) => {
|
|
19
|
+
const {
|
|
20
|
+
__scopeDialog: o,
|
|
21
|
+
children: n,
|
|
22
|
+
open: a,
|
|
23
|
+
defaultOpen: r,
|
|
24
|
+
onOpenChange: t,
|
|
25
|
+
modal: c = !0
|
|
26
|
+
} = e, l = s.useRef(null), d = s.useRef(null), [g, C] = q({
|
|
27
|
+
prop: a,
|
|
28
|
+
defaultProp: r ?? !1,
|
|
29
|
+
onChange: t,
|
|
30
|
+
caller: v
|
|
31
|
+
});
|
|
32
|
+
return /* @__PURE__ */ i(
|
|
33
|
+
X,
|
|
34
|
+
{
|
|
35
|
+
scope: o,
|
|
36
|
+
triggerRef: l,
|
|
37
|
+
contentRef: d,
|
|
38
|
+
contentId: R(),
|
|
39
|
+
titleId: R(),
|
|
40
|
+
descriptionId: R(),
|
|
41
|
+
open: g,
|
|
42
|
+
onOpenChange: C,
|
|
43
|
+
onOpenToggle: s.useCallback(() => C((j) => !j), [C]),
|
|
44
|
+
modal: c,
|
|
45
|
+
children: n
|
|
46
|
+
}
|
|
47
|
+
);
|
|
48
|
+
};
|
|
49
|
+
x.displayName = v;
|
|
50
|
+
var A = "DialogTrigger", T = s.forwardRef(
|
|
51
|
+
(e, o) => {
|
|
52
|
+
const { __scopeDialog: n, ...a } = e, r = u(A, n), t = _(o, r.triggerRef);
|
|
53
|
+
return /* @__PURE__ */ i(
|
|
54
|
+
m.button,
|
|
55
|
+
{
|
|
56
|
+
type: "button",
|
|
57
|
+
"aria-haspopup": "dialog",
|
|
58
|
+
"aria-expanded": r.open,
|
|
59
|
+
"aria-controls": r.contentId,
|
|
60
|
+
"data-state": N(r.open),
|
|
61
|
+
...a,
|
|
62
|
+
ref: t,
|
|
63
|
+
onClick: p(e.onClick, r.onOpenToggle)
|
|
64
|
+
}
|
|
65
|
+
);
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
T.displayName = A;
|
|
69
|
+
var E = "DialogPortal", [ee, b] = I(E, {
|
|
70
|
+
forceMount: void 0
|
|
71
|
+
}), M = (e) => {
|
|
72
|
+
const { __scopeDialog: o, forceMount: n, children: a, container: r } = e, t = u(E, o);
|
|
73
|
+
return /* @__PURE__ */ i(ee, { scope: o, forceMount: n, children: s.Children.map(a, (c) => /* @__PURE__ */ i(h, { present: n || t.open, children: /* @__PURE__ */ i(Y, { asChild: !0, container: r, children: c }) })) });
|
|
74
|
+
};
|
|
75
|
+
M.displayName = E;
|
|
76
|
+
var D = "DialogOverlay", w = s.forwardRef(
|
|
77
|
+
(e, o) => {
|
|
78
|
+
const n = b(D, e.__scopeDialog), { forceMount: a = n.forceMount, ...r } = e, t = u(D, e.__scopeDialog);
|
|
79
|
+
return t.modal ? /* @__PURE__ */ i(h, { present: a || t.open, children: /* @__PURE__ */ i(oe, { ...r, ref: o }) }) : null;
|
|
80
|
+
}
|
|
81
|
+
);
|
|
82
|
+
w.displayName = D;
|
|
83
|
+
var te = Q("DialogOverlay.RemoveScroll"), oe = s.forwardRef(
|
|
84
|
+
(e, o) => {
|
|
85
|
+
const { __scopeDialog: n, ...a } = e, r = u(D, n);
|
|
86
|
+
return (
|
|
87
|
+
// Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
|
|
88
|
+
// ie. when `Overlay` and `Content` are siblings
|
|
89
|
+
/* @__PURE__ */ i(z, { as: te, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ i(
|
|
90
|
+
m.div,
|
|
91
|
+
{
|
|
92
|
+
"data-state": N(r.open),
|
|
93
|
+
...a,
|
|
94
|
+
ref: o,
|
|
95
|
+
style: { pointerEvents: "auto", ...a.style }
|
|
96
|
+
}
|
|
97
|
+
) })
|
|
98
|
+
);
|
|
99
|
+
}
|
|
100
|
+
), f = "DialogContent", S = s.forwardRef(
|
|
101
|
+
(e, o) => {
|
|
102
|
+
const n = b(f, e.__scopeDialog), { forceMount: a = n.forceMount, ...r } = e, t = u(f, e.__scopeDialog);
|
|
103
|
+
return /* @__PURE__ */ i(h, { present: a || t.open, children: t.modal ? /* @__PURE__ */ i(re, { ...r, ref: o }) : /* @__PURE__ */ i(ne, { ...r, ref: o }) });
|
|
104
|
+
}
|
|
105
|
+
);
|
|
106
|
+
S.displayName = f;
|
|
107
|
+
var re = s.forwardRef(
|
|
108
|
+
(e, o) => {
|
|
109
|
+
const n = u(f, e.__scopeDialog), a = s.useRef(null), r = _(o, n.contentRef, a);
|
|
110
|
+
return s.useEffect(() => {
|
|
111
|
+
const t = a.current;
|
|
112
|
+
if (t) return J(t);
|
|
113
|
+
}, []), /* @__PURE__ */ i(
|
|
114
|
+
F,
|
|
115
|
+
{
|
|
116
|
+
...e,
|
|
117
|
+
ref: r,
|
|
118
|
+
trapFocus: n.open,
|
|
119
|
+
disableOutsidePointerEvents: !0,
|
|
120
|
+
onCloseAutoFocus: p(e.onCloseAutoFocus, (t) => {
|
|
121
|
+
var c;
|
|
122
|
+
t.preventDefault(), (c = n.triggerRef.current) == null || c.focus();
|
|
123
|
+
}),
|
|
124
|
+
onPointerDownOutside: p(e.onPointerDownOutside, (t) => {
|
|
125
|
+
const c = t.detail.originalEvent, l = c.button === 0 && c.ctrlKey === !0;
|
|
126
|
+
(c.button === 2 || l) && t.preventDefault();
|
|
127
|
+
}),
|
|
128
|
+
onFocusOutside: p(
|
|
129
|
+
e.onFocusOutside,
|
|
130
|
+
(t) => t.preventDefault()
|
|
131
|
+
)
|
|
132
|
+
}
|
|
133
|
+
);
|
|
134
|
+
}
|
|
135
|
+
), ne = s.forwardRef(
|
|
136
|
+
(e, o) => {
|
|
137
|
+
const n = u(f, e.__scopeDialog), a = s.useRef(!1), r = s.useRef(!1);
|
|
138
|
+
return /* @__PURE__ */ i(
|
|
139
|
+
F,
|
|
140
|
+
{
|
|
141
|
+
...e,
|
|
142
|
+
ref: o,
|
|
143
|
+
trapFocus: !1,
|
|
144
|
+
disableOutsidePointerEvents: !1,
|
|
145
|
+
onCloseAutoFocus: (t) => {
|
|
146
|
+
var c, l;
|
|
147
|
+
(c = e.onCloseAutoFocus) == null || c.call(e, t), t.defaultPrevented || (a.current || (l = n.triggerRef.current) == null || l.focus(), t.preventDefault()), a.current = !1, r.current = !1;
|
|
148
|
+
},
|
|
149
|
+
onInteractOutside: (t) => {
|
|
150
|
+
var d, g;
|
|
151
|
+
(d = e.onInteractOutside) == null || d.call(e, t), t.defaultPrevented || (a.current = !0, t.detail.originalEvent.type === "pointerdown" && (r.current = !0));
|
|
152
|
+
const c = t.target;
|
|
153
|
+
((g = n.triggerRef.current) == null ? void 0 : g.contains(c)) && t.preventDefault(), t.detail.originalEvent.type === "focusin" && r.current && t.preventDefault();
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
);
|
|
157
|
+
}
|
|
158
|
+
), F = s.forwardRef(
|
|
159
|
+
(e, o) => {
|
|
160
|
+
const { __scopeDialog: n, trapFocus: a, onOpenAutoFocus: r, onCloseAutoFocus: t, ...c } = e, l = u(f, n), d = s.useRef(null), g = _(o, d);
|
|
161
|
+
return Z(), /* @__PURE__ */ P(O, { children: [
|
|
162
|
+
/* @__PURE__ */ i(
|
|
163
|
+
U,
|
|
164
|
+
{
|
|
165
|
+
asChild: !0,
|
|
166
|
+
loop: !0,
|
|
167
|
+
trapped: a,
|
|
168
|
+
onMountAutoFocus: r,
|
|
169
|
+
onUnmountAutoFocus: t,
|
|
170
|
+
children: /* @__PURE__ */ i(
|
|
171
|
+
K,
|
|
172
|
+
{
|
|
173
|
+
role: "dialog",
|
|
174
|
+
id: l.contentId,
|
|
175
|
+
"aria-describedby": l.descriptionId,
|
|
176
|
+
"aria-labelledby": l.titleId,
|
|
177
|
+
"data-state": N(l.open),
|
|
178
|
+
...c,
|
|
179
|
+
ref: g,
|
|
180
|
+
onDismiss: () => l.onOpenChange(!1)
|
|
181
|
+
}
|
|
182
|
+
)
|
|
183
|
+
}
|
|
184
|
+
),
|
|
185
|
+
/* @__PURE__ */ P(O, { children: [
|
|
186
|
+
/* @__PURE__ */ i(ie, { titleId: l.titleId }),
|
|
187
|
+
/* @__PURE__ */ i(ce, { contentRef: d, descriptionId: l.descriptionId })
|
|
188
|
+
] })
|
|
189
|
+
] });
|
|
190
|
+
}
|
|
191
|
+
), y = "DialogTitle", W = s.forwardRef(
|
|
192
|
+
(e, o) => {
|
|
193
|
+
const { __scopeDialog: n, ...a } = e, r = u(y, n);
|
|
194
|
+
return /* @__PURE__ */ i(m.h2, { id: r.titleId, ...a, ref: o });
|
|
195
|
+
}
|
|
196
|
+
);
|
|
197
|
+
W.displayName = y;
|
|
198
|
+
var k = "DialogDescription", G = s.forwardRef(
|
|
199
|
+
(e, o) => {
|
|
200
|
+
const { __scopeDialog: n, ...a } = e, r = u(k, n);
|
|
201
|
+
return /* @__PURE__ */ i(m.p, { id: r.descriptionId, ...a, ref: o });
|
|
202
|
+
}
|
|
203
|
+
);
|
|
204
|
+
G.displayName = k;
|
|
205
|
+
var L = "DialogClose", ae = s.forwardRef(
|
|
206
|
+
(e, o) => {
|
|
207
|
+
const { __scopeDialog: n, ...a } = e, r = u(L, n);
|
|
208
|
+
return /* @__PURE__ */ i(
|
|
209
|
+
m.button,
|
|
210
|
+
{
|
|
211
|
+
type: "button",
|
|
212
|
+
...a,
|
|
213
|
+
ref: o,
|
|
214
|
+
onClick: p(e.onClick, () => r.onOpenChange(!1))
|
|
215
|
+
}
|
|
216
|
+
);
|
|
217
|
+
}
|
|
218
|
+
);
|
|
219
|
+
ae.displayName = L;
|
|
220
|
+
function N(e) {
|
|
221
|
+
return e ? "open" : "closed";
|
|
222
|
+
}
|
|
223
|
+
var $ = "DialogTitleWarning", [Pe, B] = V($, {
|
|
224
|
+
contentName: f,
|
|
225
|
+
titleName: y,
|
|
226
|
+
docsSlug: "dialog"
|
|
227
|
+
}), ie = ({ titleId: e }) => {
|
|
228
|
+
const o = B($), n = `\`${o.contentName}\` requires a \`${o.titleName}\` for the component to be accessible for screen reader users.
|
|
229
|
+
|
|
230
|
+
If you want to hide the \`${o.titleName}\`, you can wrap it with our VisuallyHidden component.
|
|
231
|
+
|
|
232
|
+
For more information, see https://radix-ui.com/primitives/docs/components/${o.docsSlug}`;
|
|
233
|
+
return s.useEffect(() => {
|
|
234
|
+
e && (document.getElementById(e) || console.error(n));
|
|
235
|
+
}, [n, e]), null;
|
|
236
|
+
}, se = "DialogDescriptionWarning", ce = ({ contentRef: e, descriptionId: o }) => {
|
|
237
|
+
const a = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${B(se).contentName}}.`;
|
|
238
|
+
return s.useEffect(() => {
|
|
239
|
+
var t;
|
|
240
|
+
const r = (t = e.current) == null ? void 0 : t.getAttribute("aria-describedby");
|
|
241
|
+
o && r && (document.getElementById(o) || console.warn(a));
|
|
242
|
+
}, [a, e, o]), null;
|
|
243
|
+
}, Oe = x, Ie = T, xe = M, Ae = w, Te = S, be = W, Me = G;
|
|
244
|
+
export {
|
|
245
|
+
Te as Content,
|
|
246
|
+
Me as Description,
|
|
247
|
+
x as Dialog,
|
|
248
|
+
ae as DialogClose,
|
|
249
|
+
S as DialogContent,
|
|
250
|
+
G as DialogDescription,
|
|
251
|
+
w as DialogOverlay,
|
|
252
|
+
M as DialogPortal,
|
|
253
|
+
W as DialogTitle,
|
|
254
|
+
T as DialogTrigger,
|
|
255
|
+
Ae as Overlay,
|
|
256
|
+
xe as Portal,
|
|
257
|
+
Oe as Root,
|
|
258
|
+
be as Title,
|
|
259
|
+
Ie as Trigger,
|
|
260
|
+
Pe as WarningProvider,
|
|
261
|
+
Ne as createDialogScope
|
|
262
|
+
};
|
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as n from "react";
|
|
3
|
+
import { composeEventHandlers as m } from "../../../../../@radix-ui/primitive/dist/index.js";
|
|
4
|
+
import { Primitive as g, dispatchDiscreteCustomEvent as k } from "../../react-primitive/dist/index.js";
|
|
5
|
+
import { useComposedRefs as R } from "../../../../../@radix-ui/react-compose-refs/dist/index.js";
|
|
6
|
+
import { useCallbackRef as w } from "../../../../../@radix-ui/react-use-callback-ref/dist/index.js";
|
|
7
|
+
import { useEscapeKeydown as U } from "../../../../../@radix-ui/react-use-escape-keydown/dist/index.js";
|
|
8
|
+
import { jsx as T } from "react/jsx-runtime";
|
|
9
|
+
var z = "DismissableLayer", y = "dismissableLayer.update", H = "dismissableLayer.pointerDownOutside", M = "dismissableLayer.focusOutside", L, B = n.createContext({
|
|
10
|
+
layers: /* @__PURE__ */ new Set(),
|
|
11
|
+
layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
|
|
12
|
+
branches: /* @__PURE__ */ new Set()
|
|
13
|
+
}), j = n.forwardRef(
|
|
14
|
+
(r, e) => {
|
|
15
|
+
const {
|
|
16
|
+
disableOutsidePointerEvents: i = !1,
|
|
17
|
+
onEscapeKeyDown: o,
|
|
18
|
+
onPointerDownOutside: t,
|
|
19
|
+
onFocusOutside: a,
|
|
20
|
+
onInteractOutside: l,
|
|
21
|
+
onDismiss: d,
|
|
22
|
+
...v
|
|
23
|
+
} = r, c = n.useContext(B), [u, S] = n.useState(null), f = (u == null ? void 0 : u.ownerDocument) ?? (globalThis == null ? void 0 : globalThis.document), [, F] = n.useState({}), W = R(e, (s) => S(s)), p = Array.from(c.layers), [A] = [...c.layersWithOutsidePointerEventsDisabled].slice(-1), N = p.indexOf(A), b = u ? p.indexOf(u) : -1, I = c.layersWithOutsidePointerEventsDisabled.size > 0, P = b >= N, _ = q((s) => {
|
|
24
|
+
const E = s.target, C = [...c.branches].some((h) => h.contains(E));
|
|
25
|
+
!P || C || (t == null || t(s), l == null || l(s), s.defaultPrevented || d == null || d());
|
|
26
|
+
}, f), D = G((s) => {
|
|
27
|
+
const E = s.target;
|
|
28
|
+
[...c.branches].some((h) => h.contains(E)) || (a == null || a(s), l == null || l(s), s.defaultPrevented || d == null || d());
|
|
29
|
+
}, f);
|
|
30
|
+
return U((s) => {
|
|
31
|
+
b === c.layers.size - 1 && (o == null || o(s), !s.defaultPrevented && d && (s.preventDefault(), d()));
|
|
32
|
+
}, f), n.useEffect(() => {
|
|
33
|
+
if (u)
|
|
34
|
+
return i && (c.layersWithOutsidePointerEventsDisabled.size === 0 && (L = f.body.style.pointerEvents, f.body.style.pointerEvents = "none"), c.layersWithOutsidePointerEventsDisabled.add(u)), c.layers.add(u), O(), () => {
|
|
35
|
+
i && c.layersWithOutsidePointerEventsDisabled.size === 1 && (f.body.style.pointerEvents = L);
|
|
36
|
+
};
|
|
37
|
+
}, [u, f, i, c]), n.useEffect(() => () => {
|
|
38
|
+
u && (c.layers.delete(u), c.layersWithOutsidePointerEventsDisabled.delete(u), O());
|
|
39
|
+
}, [u, c]), n.useEffect(() => {
|
|
40
|
+
const s = () => F({});
|
|
41
|
+
return document.addEventListener(y, s), () => document.removeEventListener(y, s);
|
|
42
|
+
}, []), /* @__PURE__ */ T(
|
|
43
|
+
g.div,
|
|
44
|
+
{
|
|
45
|
+
...v,
|
|
46
|
+
ref: W,
|
|
47
|
+
style: {
|
|
48
|
+
pointerEvents: I ? P ? "auto" : "none" : void 0,
|
|
49
|
+
...r.style
|
|
50
|
+
},
|
|
51
|
+
onFocusCapture: m(r.onFocusCapture, D.onFocusCapture),
|
|
52
|
+
onBlurCapture: m(r.onBlurCapture, D.onBlurCapture),
|
|
53
|
+
onPointerDownCapture: m(
|
|
54
|
+
r.onPointerDownCapture,
|
|
55
|
+
_.onPointerDownCapture
|
|
56
|
+
)
|
|
57
|
+
}
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
);
|
|
61
|
+
j.displayName = z;
|
|
62
|
+
var X = "DismissableLayerBranch", Y = n.forwardRef((r, e) => {
|
|
63
|
+
const i = n.useContext(B), o = n.useRef(null), t = R(e, o);
|
|
64
|
+
return n.useEffect(() => {
|
|
65
|
+
const a = o.current;
|
|
66
|
+
if (a)
|
|
67
|
+
return i.branches.add(a), () => {
|
|
68
|
+
i.branches.delete(a);
|
|
69
|
+
};
|
|
70
|
+
}, [i.branches]), /* @__PURE__ */ T(g.div, { ...r, ref: t });
|
|
71
|
+
});
|
|
72
|
+
Y.displayName = X;
|
|
73
|
+
function q(r, e = globalThis == null ? void 0 : globalThis.document) {
|
|
74
|
+
const i = w(r), o = n.useRef(!1), t = n.useRef(() => {
|
|
75
|
+
});
|
|
76
|
+
return n.useEffect(() => {
|
|
77
|
+
const a = (d) => {
|
|
78
|
+
if (d.target && !o.current) {
|
|
79
|
+
let v = function() {
|
|
80
|
+
x(
|
|
81
|
+
H,
|
|
82
|
+
i,
|
|
83
|
+
c,
|
|
84
|
+
{ discrete: !0 }
|
|
85
|
+
);
|
|
86
|
+
};
|
|
87
|
+
const c = { originalEvent: d };
|
|
88
|
+
d.pointerType === "touch" ? (e.removeEventListener("click", t.current), t.current = v, e.addEventListener("click", t.current, { once: !0 })) : v();
|
|
89
|
+
} else
|
|
90
|
+
e.removeEventListener("click", t.current);
|
|
91
|
+
o.current = !1;
|
|
92
|
+
}, l = window.setTimeout(() => {
|
|
93
|
+
e.addEventListener("pointerdown", a);
|
|
94
|
+
}, 0);
|
|
95
|
+
return () => {
|
|
96
|
+
window.clearTimeout(l), e.removeEventListener("pointerdown", a), e.removeEventListener("click", t.current);
|
|
97
|
+
};
|
|
98
|
+
}, [e, i]), {
|
|
99
|
+
// ensures we check React component tree (not just DOM tree)
|
|
100
|
+
onPointerDownCapture: () => o.current = !0
|
|
101
|
+
};
|
|
102
|
+
}
|
|
103
|
+
function G(r, e = globalThis == null ? void 0 : globalThis.document) {
|
|
104
|
+
const i = w(r), o = n.useRef(!1);
|
|
105
|
+
return n.useEffect(() => {
|
|
106
|
+
const t = (a) => {
|
|
107
|
+
a.target && !o.current && x(M, i, { originalEvent: a }, {
|
|
108
|
+
discrete: !1
|
|
109
|
+
});
|
|
110
|
+
};
|
|
111
|
+
return e.addEventListener("focusin", t), () => e.removeEventListener("focusin", t);
|
|
112
|
+
}, [e, i]), {
|
|
113
|
+
onFocusCapture: () => o.current = !0,
|
|
114
|
+
onBlurCapture: () => o.current = !1
|
|
115
|
+
};
|
|
116
|
+
}
|
|
117
|
+
function O() {
|
|
118
|
+
const r = new CustomEvent(y);
|
|
119
|
+
document.dispatchEvent(r);
|
|
120
|
+
}
|
|
121
|
+
function x(r, e, i, { discrete: o }) {
|
|
122
|
+
const t = i.originalEvent.target, a = new CustomEvent(r, { bubbles: !1, cancelable: !0, detail: i });
|
|
123
|
+
e && t.addEventListener(r, e, { once: !0 }), o ? k(t, a) : t.dispatchEvent(a);
|
|
124
|
+
}
|
|
125
|
+
export {
|
|
126
|
+
j as DismissableLayer,
|
|
127
|
+
Y as DismissableLayerBranch
|
|
128
|
+
};
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as d from "react";
|
|
3
|
+
import { useComposedRefs as R } from "../../../../../@radix-ui/react-compose-refs/dist/index.js";
|
|
4
|
+
import { Primitive as M } from "../../react-primitive/dist/index.js";
|
|
5
|
+
import { useCallbackRef as y } from "../../../../../@radix-ui/react-use-callback-ref/dist/index.js";
|
|
6
|
+
import { jsx as _ } from "react/jsx-runtime";
|
|
7
|
+
var F = "focusScope.autoFocusOnMount", T = "focusScope.autoFocusOnUnmount", N = { bubbles: !1, cancelable: !0 }, K = "FocusScope", k = d.forwardRef((e, n) => {
|
|
8
|
+
const {
|
|
9
|
+
loop: t = !1,
|
|
10
|
+
trapped: u = !1,
|
|
11
|
+
onMountAutoFocus: p,
|
|
12
|
+
onUnmountAutoFocus: L,
|
|
13
|
+
...g
|
|
14
|
+
} = e, [o, U] = d.useState(null), E = y(p), v = y(L), b = d.useRef(null), A = R(n, (s) => U(s)), a = d.useRef({
|
|
15
|
+
paused: !1,
|
|
16
|
+
pause() {
|
|
17
|
+
this.paused = !0;
|
|
18
|
+
},
|
|
19
|
+
resume() {
|
|
20
|
+
this.paused = !1;
|
|
21
|
+
}
|
|
22
|
+
}).current;
|
|
23
|
+
d.useEffect(() => {
|
|
24
|
+
if (u) {
|
|
25
|
+
let s = function(i) {
|
|
26
|
+
if (a.paused || !o) return;
|
|
27
|
+
const c = i.target;
|
|
28
|
+
o.contains(c) ? b.current = c : f(b.current, { select: !0 });
|
|
29
|
+
}, l = function(i) {
|
|
30
|
+
if (a.paused || !o) return;
|
|
31
|
+
const c = i.relatedTarget;
|
|
32
|
+
c !== null && (o.contains(c) || f(b.current, { select: !0 }));
|
|
33
|
+
}, r = function(i) {
|
|
34
|
+
if (document.activeElement === document.body)
|
|
35
|
+
for (const h of i)
|
|
36
|
+
h.removedNodes.length > 0 && f(o);
|
|
37
|
+
};
|
|
38
|
+
document.addEventListener("focusin", s), document.addEventListener("focusout", l);
|
|
39
|
+
const m = new MutationObserver(r);
|
|
40
|
+
return o && m.observe(o, { childList: !0, subtree: !0 }), () => {
|
|
41
|
+
document.removeEventListener("focusin", s), document.removeEventListener("focusout", l), m.disconnect();
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
}, [u, o, a.paused]), d.useEffect(() => {
|
|
45
|
+
if (o) {
|
|
46
|
+
S.add(a);
|
|
47
|
+
const s = document.activeElement;
|
|
48
|
+
if (!o.contains(s)) {
|
|
49
|
+
const r = new CustomEvent(F, N);
|
|
50
|
+
o.addEventListener(F, E), o.dispatchEvent(r), r.defaultPrevented || (w(W(I(o)), { select: !0 }), document.activeElement === s && f(o));
|
|
51
|
+
}
|
|
52
|
+
return () => {
|
|
53
|
+
o.removeEventListener(F, E), setTimeout(() => {
|
|
54
|
+
const r = new CustomEvent(T, N);
|
|
55
|
+
o.addEventListener(T, v), o.dispatchEvent(r), r.defaultPrevented || f(s ?? document.body, { select: !0 }), o.removeEventListener(T, v), S.remove(a);
|
|
56
|
+
}, 0);
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
}, [o, E, v, a]);
|
|
60
|
+
const P = d.useCallback(
|
|
61
|
+
(s) => {
|
|
62
|
+
if (!t && !u || a.paused) return;
|
|
63
|
+
const l = s.key === "Tab" && !s.altKey && !s.ctrlKey && !s.metaKey, r = document.activeElement;
|
|
64
|
+
if (l && r) {
|
|
65
|
+
const m = s.currentTarget, [i, c] = x(m);
|
|
66
|
+
i && c ? !s.shiftKey && r === c ? (s.preventDefault(), t && f(i, { select: !0 })) : s.shiftKey && r === i && (s.preventDefault(), t && f(c, { select: !0 })) : r === m && s.preventDefault();
|
|
67
|
+
}
|
|
68
|
+
},
|
|
69
|
+
[t, u, a.paused]
|
|
70
|
+
);
|
|
71
|
+
return /* @__PURE__ */ _(M.div, { tabIndex: -1, ...g, ref: A, onKeyDown: P });
|
|
72
|
+
});
|
|
73
|
+
k.displayName = K;
|
|
74
|
+
function w(e, { select: n = !1 } = {}) {
|
|
75
|
+
const t = document.activeElement;
|
|
76
|
+
for (const u of e)
|
|
77
|
+
if (f(u, { select: n }), document.activeElement !== t) return;
|
|
78
|
+
}
|
|
79
|
+
function x(e) {
|
|
80
|
+
const n = I(e), t = O(n, e), u = O(n.reverse(), e);
|
|
81
|
+
return [t, u];
|
|
82
|
+
}
|
|
83
|
+
function I(e) {
|
|
84
|
+
const n = [], t = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
|
|
85
|
+
acceptNode: (u) => {
|
|
86
|
+
const p = u.tagName === "INPUT" && u.type === "hidden";
|
|
87
|
+
return u.disabled || u.hidden || p ? NodeFilter.FILTER_SKIP : u.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
|
|
88
|
+
}
|
|
89
|
+
});
|
|
90
|
+
for (; t.nextNode(); ) n.push(t.currentNode);
|
|
91
|
+
return n;
|
|
92
|
+
}
|
|
93
|
+
function O(e, n) {
|
|
94
|
+
for (const t of e)
|
|
95
|
+
if (!D(t, { upTo: n })) return t;
|
|
96
|
+
}
|
|
97
|
+
function D(e, { upTo: n }) {
|
|
98
|
+
if (getComputedStyle(e).visibility === "hidden") return !0;
|
|
99
|
+
for (; e; ) {
|
|
100
|
+
if (n !== void 0 && e === n) return !1;
|
|
101
|
+
if (getComputedStyle(e).display === "none") return !0;
|
|
102
|
+
e = e.parentElement;
|
|
103
|
+
}
|
|
104
|
+
return !1;
|
|
105
|
+
}
|
|
106
|
+
function H(e) {
|
|
107
|
+
return e instanceof HTMLInputElement && "select" in e;
|
|
108
|
+
}
|
|
109
|
+
function f(e, { select: n = !1 } = {}) {
|
|
110
|
+
if (e && e.focus) {
|
|
111
|
+
const t = document.activeElement;
|
|
112
|
+
e.focus({ preventScroll: !0 }), e !== t && H(e) && n && e.select();
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
var S = V();
|
|
116
|
+
function V() {
|
|
117
|
+
let e = [];
|
|
118
|
+
return {
|
|
119
|
+
add(n) {
|
|
120
|
+
const t = e[0];
|
|
121
|
+
n !== t && (t == null || t.pause()), e = C(e, n), e.unshift(n);
|
|
122
|
+
},
|
|
123
|
+
remove(n) {
|
|
124
|
+
var t;
|
|
125
|
+
e = C(e, n), (t = e[0]) == null || t.resume();
|
|
126
|
+
}
|
|
127
|
+
};
|
|
128
|
+
}
|
|
129
|
+
function C(e, n) {
|
|
130
|
+
const t = [...e], u = t.indexOf(n);
|
|
131
|
+
return u !== -1 && t.splice(u, 1), t;
|
|
132
|
+
}
|
|
133
|
+
function W(e) {
|
|
134
|
+
return e.filter((n) => n.tagName !== "A");
|
|
135
|
+
}
|
|
136
|
+
export {
|
|
137
|
+
k as FocusScope
|
|
138
|
+
};
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as r from "react";
|
|
3
|
+
import m from "react-dom";
|
|
4
|
+
import { Primitive as c } from "../../react-primitive/dist/index.js";
|
|
5
|
+
import { useLayoutEffect as u } from "../../../../../@radix-ui/react-use-layout-effect/dist/index.js";
|
|
6
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
7
|
+
var p = "Portal", d = r.forwardRef((e, a) => {
|
|
8
|
+
var o;
|
|
9
|
+
const { container: i, ...n } = e, [s, f] = r.useState(!1);
|
|
10
|
+
u(() => f(!0), []);
|
|
11
|
+
const t = i || s && ((o = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : o.body);
|
|
12
|
+
return t ? m.createPortal(/* @__PURE__ */ l(c.div, { ...n, ref: a }), t) : null;
|
|
13
|
+
});
|
|
14
|
+
d.displayName = p;
|
|
15
|
+
export {
|
|
16
|
+
d as Portal
|
|
17
|
+
};
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as c from "react";
|
|
3
|
+
import * as f from "react-dom";
|
|
4
|
+
import { createSlot as p } from "../../react-slot/dist/index.js";
|
|
5
|
+
import { jsx as l } from "react/jsx-runtime";
|
|
6
|
+
var u = [
|
|
7
|
+
"a",
|
|
8
|
+
"button",
|
|
9
|
+
"div",
|
|
10
|
+
"form",
|
|
11
|
+
"h2",
|
|
12
|
+
"h3",
|
|
13
|
+
"img",
|
|
14
|
+
"input",
|
|
15
|
+
"label",
|
|
16
|
+
"li",
|
|
17
|
+
"nav",
|
|
18
|
+
"ol",
|
|
19
|
+
"p",
|
|
20
|
+
"select",
|
|
21
|
+
"span",
|
|
22
|
+
"svg",
|
|
23
|
+
"ul"
|
|
24
|
+
], h = u.reduce((t, i) => {
|
|
25
|
+
const e = p(`Primitive.${i}`), r = c.forwardRef((o, s) => {
|
|
26
|
+
const { asChild: m, ...a } = o, n = m ? e : i;
|
|
27
|
+
return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ l(n, { ...a, ref: s });
|
|
28
|
+
});
|
|
29
|
+
return r.displayName = `Primitive.${i}`, { ...t, [i]: r };
|
|
30
|
+
}, {});
|
|
31
|
+
function w(t, i) {
|
|
32
|
+
t && f.flushSync(() => t.dispatchEvent(i));
|
|
33
|
+
}
|
|
34
|
+
export {
|
|
35
|
+
h as Primitive,
|
|
36
|
+
w as dispatchDiscreteCustomEvent
|
|
37
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
"use client";
|
|
2
|
+
import * as o from "react";
|
|
3
|
+
import { useComposedRefs as m } from "../../../../../@radix-ui/react-compose-refs/dist/index.js";
|
|
4
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
5
|
+
// @__NO_SIDE_EFFECTS__
|
|
6
|
+
function V(r) {
|
|
7
|
+
const n = /* @__PURE__ */ y(r), l = o.forwardRef((t, e) => {
|
|
8
|
+
const { children: i, ...a } = t, c = o.Children.toArray(i), s = c.find(g);
|
|
9
|
+
if (s) {
|
|
10
|
+
const f = s.props.children, d = c.map((p) => p === s ? o.Children.count(f) > 1 ? o.Children.only(null) : o.isValidElement(f) ? f.props.children : null : p);
|
|
11
|
+
return /* @__PURE__ */ u(n, { ...a, ref: e, children: o.isValidElement(f) ? o.cloneElement(f, void 0, d) : null });
|
|
12
|
+
}
|
|
13
|
+
return /* @__PURE__ */ u(n, { ...a, ref: e, children: i });
|
|
14
|
+
});
|
|
15
|
+
return l.displayName = `${r}.Slot`, l;
|
|
16
|
+
}
|
|
17
|
+
// @__NO_SIDE_EFFECTS__
|
|
18
|
+
function y(r) {
|
|
19
|
+
const n = o.forwardRef((l, t) => {
|
|
20
|
+
const { children: e, ...i } = l, a = o.isValidElement(e) ? R(e) : void 0, c = m(a, t);
|
|
21
|
+
if (o.isValidElement(e)) {
|
|
22
|
+
const s = C(i, e.props);
|
|
23
|
+
return e.type !== o.Fragment && (s.ref = c), o.cloneElement(e, s);
|
|
24
|
+
}
|
|
25
|
+
return o.Children.count(e) > 1 ? o.Children.only(null) : null;
|
|
26
|
+
});
|
|
27
|
+
return n.displayName = `${r}.SlotClone`, n;
|
|
28
|
+
}
|
|
29
|
+
var E = Symbol("radix.slottable");
|
|
30
|
+
function g(r) {
|
|
31
|
+
return o.isValidElement(r) && typeof r.type == "function" && "__radixId" in r.type && r.type.__radixId === E;
|
|
32
|
+
}
|
|
33
|
+
function C(r, n) {
|
|
34
|
+
const l = { ...n };
|
|
35
|
+
for (const t in n) {
|
|
36
|
+
const e = r[t], i = n[t];
|
|
37
|
+
/^on[A-Z]/.test(t) ? e && i ? l[t] = (...c) => {
|
|
38
|
+
const s = i(...c);
|
|
39
|
+
return e(...c), s;
|
|
40
|
+
} : e && (l[t] = e) : t === "style" ? l[t] = { ...e, ...i } : t === "className" && (l[t] = [e, i].filter(Boolean).join(" "));
|
|
41
|
+
}
|
|
42
|
+
return { ...r, ...l };
|
|
43
|
+
}
|
|
44
|
+
function R(r) {
|
|
45
|
+
var t, e;
|
|
46
|
+
let n = (t = Object.getOwnPropertyDescriptor(r.props, "ref")) == null ? void 0 : t.get, l = n && "isReactWarning" in n && n.isReactWarning;
|
|
47
|
+
return l ? r.ref : (n = (e = Object.getOwnPropertyDescriptor(r, "ref")) == null ? void 0 : e.get, l = n && "isReactWarning" in n && n.isReactWarning, l ? r.props.ref : r.props.ref || r.ref);
|
|
48
|
+
}
|
|
49
|
+
export {
|
|
50
|
+
V as createSlot
|
|
51
|
+
};
|