laif-ds 0.2.19 → 0.2.21

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (51) hide show
  1. package/dist/_virtual/index4.js +5 -5
  2. package/dist/_virtual/index5.js +5 -5
  3. package/dist/_virtual/index6.js +2 -2
  4. package/dist/_virtual/index7.js +2 -2
  5. package/dist/components/ui/app-stepper.js +212 -0
  6. package/dist/components/ui/file-preview.js +215 -138
  7. package/dist/components/ui/file-previewer.js +1 -1
  8. package/dist/components/ui/file-uploader.js +109 -96
  9. package/dist/components/ui/stepper.js +387 -0
  10. package/dist/index.d.ts +52 -1
  11. package/dist/index.js +30 -28
  12. package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +70 -69
  13. package/dist/node_modules/@radix-ui/react-accordion/dist/index.js +24 -25
  14. package/dist/node_modules/@radix-ui/react-alert-dialog/dist/index.js +22 -23
  15. package/dist/node_modules/@radix-ui/react-avatar/dist/index.js +28 -29
  16. package/dist/node_modules/@radix-ui/react-checkbox/dist/index.js +1 -2
  17. package/dist/node_modules/@radix-ui/react-context-menu/dist/index.js +49 -50
  18. package/dist/node_modules/@radix-ui/react-dropdown-menu/dist/index.js +22 -23
  19. package/dist/node_modules/@radix-ui/react-hover-card/dist/index.js +6 -7
  20. package/dist/node_modules/@radix-ui/react-menubar/dist/index.js +31 -32
  21. package/dist/node_modules/@radix-ui/react-navigation-menu/dist/index.js +56 -57
  22. package/dist/node_modules/@radix-ui/react-popover/dist/index.js +6 -7
  23. package/dist/node_modules/@radix-ui/react-progress/dist/index.js +20 -21
  24. package/dist/node_modules/@radix-ui/react-radio-group/dist/index.js +12 -13
  25. package/dist/node_modules/@radix-ui/react-scroll-area/dist/index.js +5 -6
  26. package/dist/node_modules/@radix-ui/react-select/dist/index.js +17 -18
  27. package/dist/node_modules/@radix-ui/react-slider/dist/index.js +39 -40
  28. package/dist/node_modules/@radix-ui/react-switch/dist/index.js +12 -13
  29. package/dist/node_modules/@radix-ui/react-tabs/dist/index.js +13 -14
  30. package/dist/node_modules/@radix-ui/react-toggle-group/dist/index.js +20 -21
  31. package/dist/node_modules/@radix-ui/react-tooltip/dist/index.js +8 -9
  32. package/dist/node_modules/cmdk/dist/index.js +2 -2
  33. package/dist/node_modules/eventemitter3/index2.js +1 -1
  34. package/dist/node_modules/hast-util-to-jsx-runtime/lib/index.js +1 -1
  35. package/dist/node_modules/style-to-object/cjs/index.js +1 -1
  36. package/dist/node_modules/unified/lib/index.js +1 -1
  37. package/dist/node_modules/vaul/dist/index.js +1 -1
  38. package/dist/styles.v3.css +1 -1
  39. package/package.json +3 -2
  40. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-dialog/dist/index.js +0 -255
  41. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +0 -128
  42. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-focus-scope/dist/index.js +0 -137
  43. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-portal/dist/index.js +0 -16
  44. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-primitive/dist/index.js +0 -37
  45. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-slot/dist/index.js +0 -50
  46. package/dist/node_modules/vaul/node_modules/@radix-ui/react-dialog/dist/index.js +0 -258
  47. package/dist/node_modules/vaul/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +0 -128
  48. package/dist/node_modules/vaul/node_modules/@radix-ui/react-focus-scope/dist/index.js +0 -137
  49. package/dist/node_modules/vaul/node_modules/@radix-ui/react-portal/dist/index.js +0 -16
  50. package/dist/node_modules/vaul/node_modules/@radix-ui/react-primitive/dist/index.js +0 -37
  51. package/dist/node_modules/vaul/node_modules/@radix-ui/react-slot/dist/index.js +0 -50
@@ -1,255 +0,0 @@
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 $, createContext as B } 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 j } from "../../../../../@radix-ui/react-use-controllable-state/dist/index.js";
8
- import { DismissableLayer as H } from "../../react-dismissable-layer/dist/index.js";
9
- import { FocusScope as V } from "../../react-focus-scope/dist/index.js";
10
- import { Portal as q } from "../../react-portal/dist/index.js";
11
- import { Presence as h } from "../../../../../@radix-ui/react-presence/dist/index.js";
12
- import { Primitive as g } from "../../react-primitive/dist/index.js";
13
- import { useFocusGuards as K } from "../../../../../@radix-ui/react-focus-guards/dist/index.js";
14
- import U from "../../../../../react-remove-scroll/dist/es2015/Combination.js";
15
- import { hideOthers as Y } from "../../../../../aria-hidden/dist/es2015/index.js";
16
- import { createSlot as Z } from "../../react-slot/dist/index.js";
17
- import { jsx as i, jsxs as P, Fragment as O } from "react/jsx-runtime";
18
- var D = "Dialog", [I, Ne] = $(D), [z, u] = I(D), x = (e) => {
19
- const {
20
- __scopeDialog: t,
21
- children: n,
22
- open: a,
23
- defaultOpen: r,
24
- onOpenChange: o,
25
- modal: l = !0
26
- } = e, c = s.useRef(null), f = s.useRef(null), [v, C] = j({
27
- prop: a,
28
- defaultProp: r ?? !1,
29
- onChange: o,
30
- caller: D
31
- });
32
- return /* @__PURE__ */ i(
33
- z,
34
- {
35
- scope: t,
36
- triggerRef: c,
37
- contentRef: f,
38
- contentId: R(),
39
- titleId: R(),
40
- descriptionId: R(),
41
- open: v,
42
- onOpenChange: C,
43
- onOpenToggle: s.useCallback(() => C((L) => !L), [C]),
44
- modal: l,
45
- children: n
46
- }
47
- );
48
- };
49
- x.displayName = D;
50
- var A = "DialogTrigger", J = s.forwardRef(
51
- (e, t) => {
52
- const { __scopeDialog: n, ...a } = e, r = u(A, n), o = _(t, r.triggerRef);
53
- return /* @__PURE__ */ i(
54
- g.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: o,
63
- onClick: p(e.onClick, r.onOpenToggle)
64
- }
65
- );
66
- }
67
- );
68
- J.displayName = A;
69
- var E = "DialogPortal", [Q, b] = I(E, {
70
- forceMount: void 0
71
- }), T = (e) => {
72
- const { __scopeDialog: t, forceMount: n, children: a, container: r } = e, o = u(E, t);
73
- return /* @__PURE__ */ i(Q, { scope: t, forceMount: n, children: s.Children.map(a, (l) => /* @__PURE__ */ i(h, { present: n || o.open, children: /* @__PURE__ */ i(q, { asChild: !0, container: r, children: l }) })) });
74
- };
75
- T.displayName = E;
76
- var m = "DialogOverlay", M = s.forwardRef(
77
- (e, t) => {
78
- const n = b(m, e.__scopeDialog), { forceMount: a = n.forceMount, ...r } = e, o = u(m, e.__scopeDialog);
79
- return o.modal ? /* @__PURE__ */ i(h, { present: a || o.open, children: /* @__PURE__ */ i(ee, { ...r, ref: t }) }) : null;
80
- }
81
- );
82
- M.displayName = m;
83
- var X = Z("DialogOverlay.RemoveScroll"), ee = s.forwardRef(
84
- (e, t) => {
85
- const { __scopeDialog: n, ...a } = e, r = u(m, 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(U, { as: X, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ i(
90
- g.div,
91
- {
92
- "data-state": N(r.open),
93
- ...a,
94
- ref: t,
95
- style: { pointerEvents: "auto", ...a.style }
96
- }
97
- ) })
98
- );
99
- }
100
- ), d = "DialogContent", w = s.forwardRef(
101
- (e, t) => {
102
- const n = b(d, e.__scopeDialog), { forceMount: a = n.forceMount, ...r } = e, o = u(d, e.__scopeDialog);
103
- return /* @__PURE__ */ i(h, { present: a || o.open, children: o.modal ? /* @__PURE__ */ i(oe, { ...r, ref: t }) : /* @__PURE__ */ i(te, { ...r, ref: t }) });
104
- }
105
- );
106
- w.displayName = d;
107
- var oe = s.forwardRef(
108
- (e, t) => {
109
- const n = u(d, e.__scopeDialog), a = s.useRef(null), r = _(t, n.contentRef, a);
110
- return s.useEffect(() => {
111
- const o = a.current;
112
- if (o) return Y(o);
113
- }, []), /* @__PURE__ */ i(
114
- S,
115
- {
116
- ...e,
117
- ref: r,
118
- trapFocus: n.open,
119
- disableOutsidePointerEvents: !0,
120
- onCloseAutoFocus: p(e.onCloseAutoFocus, (o) => {
121
- o.preventDefault(), n.triggerRef.current?.focus();
122
- }),
123
- onPointerDownOutside: p(e.onPointerDownOutside, (o) => {
124
- const l = o.detail.originalEvent, c = l.button === 0 && l.ctrlKey === !0;
125
- (l.button === 2 || c) && o.preventDefault();
126
- }),
127
- onFocusOutside: p(
128
- e.onFocusOutside,
129
- (o) => o.preventDefault()
130
- )
131
- }
132
- );
133
- }
134
- ), te = s.forwardRef(
135
- (e, t) => {
136
- const n = u(d, e.__scopeDialog), a = s.useRef(!1), r = s.useRef(!1);
137
- return /* @__PURE__ */ i(
138
- S,
139
- {
140
- ...e,
141
- ref: t,
142
- trapFocus: !1,
143
- disableOutsidePointerEvents: !1,
144
- onCloseAutoFocus: (o) => {
145
- e.onCloseAutoFocus?.(o), o.defaultPrevented || (a.current || n.triggerRef.current?.focus(), o.preventDefault()), a.current = !1, r.current = !1;
146
- },
147
- onInteractOutside: (o) => {
148
- e.onInteractOutside?.(o), o.defaultPrevented || (a.current = !0, o.detail.originalEvent.type === "pointerdown" && (r.current = !0));
149
- const l = o.target;
150
- n.triggerRef.current?.contains(l) && o.preventDefault(), o.detail.originalEvent.type === "focusin" && r.current && o.preventDefault();
151
- }
152
- }
153
- );
154
- }
155
- ), S = s.forwardRef(
156
- (e, t) => {
157
- const { __scopeDialog: n, trapFocus: a, onOpenAutoFocus: r, onCloseAutoFocus: o, ...l } = e, c = u(d, n), f = s.useRef(null), v = _(t, f);
158
- return K(), /* @__PURE__ */ P(O, { children: [
159
- /* @__PURE__ */ i(
160
- V,
161
- {
162
- asChild: !0,
163
- loop: !0,
164
- trapped: a,
165
- onMountAutoFocus: r,
166
- onUnmountAutoFocus: o,
167
- children: /* @__PURE__ */ i(
168
- H,
169
- {
170
- role: "dialog",
171
- id: c.contentId,
172
- "aria-describedby": c.descriptionId,
173
- "aria-labelledby": c.titleId,
174
- "data-state": N(c.open),
175
- ...l,
176
- ref: v,
177
- onDismiss: () => c.onOpenChange(!1)
178
- }
179
- )
180
- }
181
- ),
182
- /* @__PURE__ */ P(O, { children: [
183
- /* @__PURE__ */ i(ie, { titleId: c.titleId }),
184
- /* @__PURE__ */ i(ce, { contentRef: f, descriptionId: c.descriptionId })
185
- ] })
186
- ] });
187
- }
188
- ), y = "DialogTitle", re = s.forwardRef(
189
- (e, t) => {
190
- const { __scopeDialog: n, ...a } = e, r = u(y, n);
191
- return /* @__PURE__ */ i(g.h2, { id: r.titleId, ...a, ref: t });
192
- }
193
- );
194
- re.displayName = y;
195
- var F = "DialogDescription", ne = s.forwardRef(
196
- (e, t) => {
197
- const { __scopeDialog: n, ...a } = e, r = u(F, n);
198
- return /* @__PURE__ */ i(g.p, { id: r.descriptionId, ...a, ref: t });
199
- }
200
- );
201
- ne.displayName = F;
202
- var W = "DialogClose", ae = s.forwardRef(
203
- (e, t) => {
204
- const { __scopeDialog: n, ...a } = e, r = u(W, n);
205
- return /* @__PURE__ */ i(
206
- g.button,
207
- {
208
- type: "button",
209
- ...a,
210
- ref: t,
211
- onClick: p(e.onClick, () => r.onOpenChange(!1))
212
- }
213
- );
214
- }
215
- );
216
- ae.displayName = W;
217
- function N(e) {
218
- return e ? "open" : "closed";
219
- }
220
- var k = "DialogTitleWarning", [Pe, G] = B(k, {
221
- contentName: d,
222
- titleName: y,
223
- docsSlug: "dialog"
224
- }), ie = ({ titleId: e }) => {
225
- const t = G(k), n = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
226
-
227
- If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
228
-
229
- For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;
230
- return s.useEffect(() => {
231
- e && (document.getElementById(e) || console.error(n));
232
- }, [n, e]), null;
233
- }, se = "DialogDescriptionWarning", ce = ({ contentRef: e, descriptionId: t }) => {
234
- const a = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${G(se).contentName}}.`;
235
- return s.useEffect(() => {
236
- const r = e.current?.getAttribute("aria-describedby");
237
- t && r && (document.getElementById(t) || console.warn(a));
238
- }, [a, e, t]), null;
239
- }, Oe = x, Ie = T, xe = M, Ae = w;
240
- export {
241
- Ae as Content,
242
- x as Dialog,
243
- ae as DialogClose,
244
- w as DialogContent,
245
- ne as DialogDescription,
246
- M as DialogOverlay,
247
- T as DialogPortal,
248
- re as DialogTitle,
249
- J as DialogTrigger,
250
- xe as Overlay,
251
- Ie as Portal,
252
- Oe as Root,
253
- Pe as WarningProvider,
254
- Ne as createDialogScope
255
- };
@@ -1,128 +0,0 @@
1
- "use client";
2
- import * as n from "react";
3
- import { composeEventHandlers as h } from "../../../../../@radix-ui/primitive/dist/index.js";
4
- import { Primitive as w, dispatchDiscreteCustomEvent as k } from "../../react-primitive/dist/index.js";
5
- import { useComposedRefs as g } from "../../../../../@radix-ui/react-compose-refs/dist/index.js";
6
- import { useCallbackRef as R } 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", C, B = n.createContext({
10
- layers: /* @__PURE__ */ new Set(),
11
- layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
12
- branches: /* @__PURE__ */ new Set()
13
- }), K = n.forwardRef(
14
- (s, e) => {
15
- const {
16
- disableOutsidePointerEvents: r = !1,
17
- onEscapeKeyDown: a,
18
- onPointerDownOutside: i,
19
- onFocusOutside: c,
20
- onInteractOutside: f,
21
- onDismiss: d,
22
- ...E
23
- } = s, o = n.useContext(B), [u, F] = n.useState(null), l = u?.ownerDocument ?? globalThis?.document, [, I] = n.useState({}), S = g(e, (t) => F(t)), p = Array.from(o.layers), [W] = [...o.layersWithOutsidePointerEventsDisabled].slice(-1), A = p.indexOf(W), b = u ? p.indexOf(u) : -1, N = o.layersWithOutsidePointerEventsDisabled.size > 0, D = b >= A, _ = Y((t) => {
24
- const v = t.target, P = [...o.branches].some((m) => m.contains(v));
25
- !D || P || (i?.(t), f?.(t), t.defaultPrevented || d?.());
26
- }, l), O = q((t) => {
27
- const v = t.target;
28
- [...o.branches].some((m) => m.contains(v)) || (c?.(t), f?.(t), t.defaultPrevented || d?.());
29
- }, l);
30
- return U((t) => {
31
- b === o.layers.size - 1 && (a?.(t), !t.defaultPrevented && d && (t.preventDefault(), d()));
32
- }, l), n.useEffect(() => {
33
- if (u)
34
- return r && (o.layersWithOutsidePointerEventsDisabled.size === 0 && (C = l.body.style.pointerEvents, l.body.style.pointerEvents = "none"), o.layersWithOutsidePointerEventsDisabled.add(u)), o.layers.add(u), L(), () => {
35
- r && o.layersWithOutsidePointerEventsDisabled.size === 1 && (l.body.style.pointerEvents = C);
36
- };
37
- }, [u, l, r, o]), n.useEffect(() => () => {
38
- u && (o.layers.delete(u), o.layersWithOutsidePointerEventsDisabled.delete(u), L());
39
- }, [u, o]), n.useEffect(() => {
40
- const t = () => I({});
41
- return document.addEventListener(y, t), () => document.removeEventListener(y, t);
42
- }, []), /* @__PURE__ */ T(
43
- w.div,
44
- {
45
- ...E,
46
- ref: S,
47
- style: {
48
- pointerEvents: N ? D ? "auto" : "none" : void 0,
49
- ...s.style
50
- },
51
- onFocusCapture: h(s.onFocusCapture, O.onFocusCapture),
52
- onBlurCapture: h(s.onBlurCapture, O.onBlurCapture),
53
- onPointerDownCapture: h(
54
- s.onPointerDownCapture,
55
- _.onPointerDownCapture
56
- )
57
- }
58
- );
59
- }
60
- );
61
- K.displayName = z;
62
- var j = "DismissableLayerBranch", X = n.forwardRef((s, e) => {
63
- const r = n.useContext(B), a = n.useRef(null), i = g(e, a);
64
- return n.useEffect(() => {
65
- const c = a.current;
66
- if (c)
67
- return r.branches.add(c), () => {
68
- r.branches.delete(c);
69
- };
70
- }, [r.branches]), /* @__PURE__ */ T(w.div, { ...s, ref: i });
71
- });
72
- X.displayName = j;
73
- function Y(s, e = globalThis?.document) {
74
- const r = R(s), a = n.useRef(!1), i = n.useRef(() => {
75
- });
76
- return n.useEffect(() => {
77
- const c = (d) => {
78
- if (d.target && !a.current) {
79
- let E = function() {
80
- x(
81
- H,
82
- r,
83
- o,
84
- { discrete: !0 }
85
- );
86
- };
87
- const o = { originalEvent: d };
88
- d.pointerType === "touch" ? (e.removeEventListener("click", i.current), i.current = E, e.addEventListener("click", i.current, { once: !0 })) : E();
89
- } else
90
- e.removeEventListener("click", i.current);
91
- a.current = !1;
92
- }, f = window.setTimeout(() => {
93
- e.addEventListener("pointerdown", c);
94
- }, 0);
95
- return () => {
96
- window.clearTimeout(f), e.removeEventListener("pointerdown", c), e.removeEventListener("click", i.current);
97
- };
98
- }, [e, r]), {
99
- // ensures we check React component tree (not just DOM tree)
100
- onPointerDownCapture: () => a.current = !0
101
- };
102
- }
103
- function q(s, e = globalThis?.document) {
104
- const r = R(s), a = n.useRef(!1);
105
- return n.useEffect(() => {
106
- const i = (c) => {
107
- c.target && !a.current && x(M, r, { originalEvent: c }, {
108
- discrete: !1
109
- });
110
- };
111
- return e.addEventListener("focusin", i), () => e.removeEventListener("focusin", i);
112
- }, [e, r]), {
113
- onFocusCapture: () => a.current = !0,
114
- onBlurCapture: () => a.current = !1
115
- };
116
- }
117
- function L() {
118
- const s = new CustomEvent(y);
119
- document.dispatchEvent(s);
120
- }
121
- function x(s, e, r, { discrete: a }) {
122
- const i = r.originalEvent.target, c = new CustomEvent(s, { bubbles: !1, cancelable: !0, detail: r });
123
- e && i.addEventListener(s, e, { once: !0 }), a ? k(i, c) : i.dispatchEvent(c);
124
- }
125
- export {
126
- K as DismissableLayer,
127
- X as DismissableLayerBranch
128
- };
@@ -1,137 +0,0 @@
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, t) => {
8
- const {
9
- loop: n = !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(t, (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
- O.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), O.remove(a);
56
- }, 0);
57
- };
58
- }
59
- }, [o, E, v, a]);
60
- const P = d.useCallback(
61
- (s) => {
62
- if (!n && !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(), n && f(i, { select: !0 })) : s.shiftKey && r === i && (s.preventDefault(), n && f(c, { select: !0 })) : r === m && s.preventDefault();
67
- }
68
- },
69
- [n, 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: t = !1 } = {}) {
75
- const n = document.activeElement;
76
- for (const u of e)
77
- if (f(u, { select: t }), document.activeElement !== n) return;
78
- }
79
- function x(e) {
80
- const t = I(e), n = S(t, e), u = S(t.reverse(), e);
81
- return [n, u];
82
- }
83
- function I(e) {
84
- const t = [], n = 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 (; n.nextNode(); ) t.push(n.currentNode);
91
- return t;
92
- }
93
- function S(e, t) {
94
- for (const n of e)
95
- if (!D(n, { upTo: t })) return n;
96
- }
97
- function D(e, { upTo: t }) {
98
- if (getComputedStyle(e).visibility === "hidden") return !0;
99
- for (; e; ) {
100
- if (t !== void 0 && e === t) 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: t = !1 } = {}) {
110
- if (e && e.focus) {
111
- const n = document.activeElement;
112
- e.focus({ preventScroll: !0 }), e !== n && H(e) && t && e.select();
113
- }
114
- }
115
- var O = V();
116
- function V() {
117
- let e = [];
118
- return {
119
- add(t) {
120
- const n = e[0];
121
- t !== n && n?.pause(), e = C(e, t), e.unshift(t);
122
- },
123
- remove(t) {
124
- e = C(e, t), e[0]?.resume();
125
- }
126
- };
127
- }
128
- function C(e, t) {
129
- const n = [...e], u = n.indexOf(t);
130
- return u !== -1 && n.splice(u, 1), n;
131
- }
132
- function W(e) {
133
- return e.filter((t) => t.tagName !== "A");
134
- }
135
- export {
136
- k as FocusScope
137
- };
@@ -1,16 +0,0 @@
1
- "use client";
2
- import * as o from "react";
3
- import f from "react-dom";
4
- import { Primitive as m } from "../../react-primitive/dist/index.js";
5
- import { useLayoutEffect as c } from "../../../../../@radix-ui/react-use-layout-effect/dist/index.js";
6
- import { jsx as u } from "react/jsx-runtime";
7
- var l = "Portal", p = o.forwardRef((r, e) => {
8
- const { container: a, ...i } = r, [n, s] = o.useState(!1);
9
- c(() => s(!0), []);
10
- const t = a || n && globalThis?.document?.body;
11
- return t ? f.createPortal(/* @__PURE__ */ u(m.div, { ...i, ref: e }), t) : null;
12
- });
13
- p.displayName = l;
14
- export {
15
- p as Portal
16
- };
@@ -1,37 +0,0 @@
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
- };
@@ -1,50 +0,0 @@
1
- "use client";
2
- import * as t 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(e) {
7
- const r = /* @__PURE__ */ y(e), o = t.forwardRef((l, n) => {
8
- const { children: i, ...a } = l, c = t.Children.toArray(i), s = c.find(g);
9
- if (s) {
10
- const f = s.props.children, d = c.map((p) => p === s ? t.Children.count(f) > 1 ? t.Children.only(null) : t.isValidElement(f) ? f.props.children : null : p);
11
- return /* @__PURE__ */ u(r, { ...a, ref: n, children: t.isValidElement(f) ? t.cloneElement(f, void 0, d) : null });
12
- }
13
- return /* @__PURE__ */ u(r, { ...a, ref: n, children: i });
14
- });
15
- return o.displayName = `${e}.Slot`, o;
16
- }
17
- // @__NO_SIDE_EFFECTS__
18
- function y(e) {
19
- const r = t.forwardRef((o, l) => {
20
- const { children: n, ...i } = o, a = t.isValidElement(n) ? R(n) : void 0, c = m(a, l);
21
- if (t.isValidElement(n)) {
22
- const s = C(i, n.props);
23
- return n.type !== t.Fragment && (s.ref = c), t.cloneElement(n, s);
24
- }
25
- return t.Children.count(n) > 1 ? t.Children.only(null) : null;
26
- });
27
- return r.displayName = `${e}.SlotClone`, r;
28
- }
29
- var E = Symbol("radix.slottable");
30
- function g(e) {
31
- return t.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === E;
32
- }
33
- function C(e, r) {
34
- const o = { ...r };
35
- for (const l in r) {
36
- const n = e[l], i = r[l];
37
- /^on[A-Z]/.test(l) ? n && i ? o[l] = (...c) => {
38
- const s = i(...c);
39
- return n(...c), s;
40
- } : n && (o[l] = n) : l === "style" ? o[l] = { ...n, ...i } : l === "className" && (o[l] = [n, i].filter(Boolean).join(" "));
41
- }
42
- return { ...e, ...o };
43
- }
44
- function R(e) {
45
- let r = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, o = r && "isReactWarning" in r && r.isReactWarning;
46
- return o ? e.ref : (r = Object.getOwnPropertyDescriptor(e, "ref")?.get, o = r && "isReactWarning" in r && r.isReactWarning, o ? e.props.ref : e.props.ref || e.ref);
47
- }
48
- export {
49
- V as createSlot
50
- };