@phillips/seldon 1.31.2 → 1.33.0

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