@phillips/seldon 1.143.2 → 1.144.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 (56) hide show
  1. package/dist/components/ComboBox/ComboBox.d.ts +69 -0
  2. package/dist/components/ComboBox/ComboBox.js +221 -0
  3. package/dist/components/ComboBox/ComboBox.stories.d.ts +18 -0
  4. package/dist/components/ComboBox/ComboBox.test.d.ts +1 -0
  5. package/dist/components/ComboBox/index.d.ts +1 -0
  6. package/dist/components/PhoneNumberPicker/PhoneNumberPicker.d.ts +38 -0
  7. package/dist/components/PhoneNumberPicker/PhoneNumberPicker.stories.d.ts +14 -0
  8. package/dist/components/PhoneNumberPicker/PhoneNumberPicker.test.d.ts +1 -0
  9. package/dist/index.d.ts +9 -1
  10. package/dist/index.js +108 -106
  11. package/dist/node_modules/@radix-ui/react-context/dist/index.js +34 -49
  12. package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +12 -12
  13. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/primitive/dist/index.js +9 -0
  14. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-compose-refs/dist/index.js +29 -0
  15. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-context/dist/index.js +68 -0
  16. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +127 -0
  17. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-focus-guards/dist/index.js +17 -0
  18. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-focus-scope/dist/index.js +136 -0
  19. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-id/dist/index.js +13 -0
  20. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-portal/dist/index.js +15 -0
  21. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-presence/dist/index.js +70 -0
  22. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-primitive/dist/index.js +35 -0
  23. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-slot/dist/index.js +48 -0
  24. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +10 -0
  25. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +32 -0
  26. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +14 -0
  27. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +6 -0
  28. package/dist/node_modules/@radix-ui/react-popover/dist/index.js +23 -22
  29. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/primitive/dist/index.js +9 -0
  30. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-arrow/dist/index.js +24 -0
  31. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-compose-refs/dist/index.js +29 -0
  32. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-context/dist/index.js +53 -0
  33. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +127 -0
  34. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-focus-guards/dist/index.js +17 -0
  35. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-focus-scope/dist/index.js +136 -0
  36. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-id/dist/index.js +13 -0
  37. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-popper/dist/index.js +218 -0
  38. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-portal/dist/index.js +15 -0
  39. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-presence/dist/index.js +70 -0
  40. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-primitive/dist/index.js +36 -0
  41. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-slot/dist/index.js +48 -0
  42. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +10 -0
  43. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-use-controllable-state/dist/index.js +52 -0
  44. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +14 -0
  45. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +6 -0
  46. package/dist/node_modules/@radix-ui/react-popover/node_modules/@radix-ui/react-use-size/dist/index.js +27 -0
  47. package/dist/node_modules/cmdk/dist/chunk-NZJY6EH4.js +17 -0
  48. package/dist/node_modules/cmdk/dist/index.js +312 -0
  49. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-compose-refs/dist/index.js +25 -0
  50. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-primitive/dist/index.js +31 -0
  51. package/dist/node_modules/cmdk/node_modules/@radix-ui/react-slot/dist/index.js +48 -0
  52. package/dist/scss/_vars.scss +3 -0
  53. package/dist/scss/_vars.scss.js +3 -0
  54. package/dist/scss/componentStyles.scss +1 -0
  55. package/dist/scss/components/ComboBox/_combobox.scss +149 -0
  56. package/package.json +4 -2
@@ -0,0 +1,17 @@
1
+ import * as r from "react";
2
+ var t = 0;
3
+ function a() {
4
+ r.useEffect(() => {
5
+ const e = document.querySelectorAll("[data-radix-focus-guard]");
6
+ return document.body.insertAdjacentElement("afterbegin", e[0] ?? n()), document.body.insertAdjacentElement("beforeend", e[1] ?? n()), t++, () => {
7
+ t === 1 && document.querySelectorAll("[data-radix-focus-guard]").forEach((o) => o.remove()), t--;
8
+ };
9
+ }, []);
10
+ }
11
+ function n() {
12
+ const e = document.createElement("span");
13
+ return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "none", e;
14
+ }
15
+ export {
16
+ a as useFocusGuards
17
+ };
@@ -0,0 +1,136 @@
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 y } from "../../react-use-callback-ref/dist/index.js";
5
+ import { jsx as _ } from "react/jsx-runtime";
6
+ var F = "focusScope.autoFocusOnMount", T = "focusScope.autoFocusOnUnmount", N = { bubbles: !1, cancelable: !0 }, K = "FocusScope", k = d.forwardRef((e, t) => {
7
+ const {
8
+ loop: n = !1,
9
+ trapped: u = !1,
10
+ onMountAutoFocus: p,
11
+ onUnmountAutoFocus: L,
12
+ ...g
13
+ } = 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({
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 s = function(i) {
25
+ if (a.paused || !o) return;
26
+ const c = i.target;
27
+ o.contains(c) ? b.current = c : f(b.current, { select: !0 });
28
+ }, l = function(i) {
29
+ if (a.paused || !o) return;
30
+ const c = i.relatedTarget;
31
+ c !== null && (o.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(o);
36
+ };
37
+ document.addEventListener("focusin", s), document.addEventListener("focusout", l);
38
+ const m = new MutationObserver(r);
39
+ return o && m.observe(o, { childList: !0, subtree: !0 }), () => {
40
+ document.removeEventListener("focusin", s), document.removeEventListener("focusout", l), m.disconnect();
41
+ };
42
+ }
43
+ }, [u, o, a.paused]), d.useEffect(() => {
44
+ if (o) {
45
+ O.add(a);
46
+ const s = document.activeElement;
47
+ if (!o.contains(s)) {
48
+ const r = new CustomEvent(F, N);
49
+ o.addEventListener(F, E), o.dispatchEvent(r), r.defaultPrevented || (w(W(I(o)), { select: !0 }), document.activeElement === s && f(o));
50
+ }
51
+ return () => {
52
+ o.removeEventListener(F, E), setTimeout(() => {
53
+ const r = new CustomEvent(T, N);
54
+ o.addEventListener(T, v), o.dispatchEvent(r), r.defaultPrevented || f(s ?? document.body, { select: !0 }), o.removeEventListener(T, v), O.remove(a);
55
+ }, 0);
56
+ };
57
+ }
58
+ }, [o, E, v, a]);
59
+ const P = d.useCallback(
60
+ (s) => {
61
+ if (!n && !u || a.paused) return;
62
+ const l = s.key === "Tab" && !s.altKey && !s.ctrlKey && !s.metaKey, r = document.activeElement;
63
+ if (l && r) {
64
+ const m = s.currentTarget, [i, c] = x(m);
65
+ 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();
66
+ }
67
+ },
68
+ [n, 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: t = !1 } = {}) {
74
+ const n = document.activeElement;
75
+ for (const u of e)
76
+ if (f(u, { select: t }), document.activeElement !== n) return;
77
+ }
78
+ function x(e) {
79
+ const t = I(e), n = S(t, e), u = S(t.reverse(), e);
80
+ return [n, u];
81
+ }
82
+ function I(e) {
83
+ const t = [], n = 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 (; n.nextNode(); ) t.push(n.currentNode);
90
+ return t;
91
+ }
92
+ function S(e, t) {
93
+ for (const n of e)
94
+ if (!D(n, { upTo: t })) return n;
95
+ }
96
+ function D(e, { upTo: t }) {
97
+ if (getComputedStyle(e).visibility === "hidden") return !0;
98
+ for (; e; ) {
99
+ if (t !== void 0 && e === t) 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: t = !1 } = {}) {
109
+ if (e && e.focus) {
110
+ const n = document.activeElement;
111
+ e.focus({ preventScroll: !0 }), e !== n && H(e) && t && e.select();
112
+ }
113
+ }
114
+ var O = V();
115
+ function V() {
116
+ let e = [];
117
+ return {
118
+ add(t) {
119
+ const n = e[0];
120
+ t !== n && n?.pause(), e = C(e, t), e.unshift(t);
121
+ },
122
+ remove(t) {
123
+ e = C(e, t), e[0]?.resume();
124
+ }
125
+ };
126
+ }
127
+ function C(e, t) {
128
+ const n = [...e], u = n.indexOf(t);
129
+ return u !== -1 && n.splice(u, 1), n;
130
+ }
131
+ function W(e) {
132
+ return e.filter((t) => t.tagName !== "A");
133
+ }
134
+ export {
135
+ k as FocusScope
136
+ };
@@ -0,0 +1,13 @@
1
+ import * as r from "react";
2
+ import { useLayoutEffect as e } from "../../react-use-layout-effect/dist/index.js";
3
+ var f = r[" useId ".trim().toString()] || (() => {
4
+ }), s = 0;
5
+ function n(t) {
6
+ const [o, u] = r.useState(f());
7
+ return e(() => {
8
+ t || u((a) => a ?? String(s++));
9
+ }, [t]), t || (o ? `radix-${o}` : "");
10
+ }
11
+ export {
12
+ n as useId
13
+ };
@@ -0,0 +1,15 @@
1
+ import * as o from "react";
2
+ import n from "react-dom";
3
+ import { Primitive as s } from "../../react-primitive/dist/index.js";
4
+ import { useLayoutEffect as c } from "../../react-use-layout-effect/dist/index.js";
5
+ import { jsx as u } from "react/jsx-runtime";
6
+ var l = "Portal", p = o.forwardRef((r, e) => {
7
+ const { container: a, ...f } = r, [i, m] = o.useState(!1);
8
+ c(() => m(!0), []);
9
+ const t = a || i && globalThis?.document?.body;
10
+ return t ? n.createPortal(/* @__PURE__ */ u(s.div, { ...f, ref: e }), t) : null;
11
+ });
12
+ p.displayName = l;
13
+ export {
14
+ p as Portal
15
+ };
@@ -0,0 +1,70 @@
1
+ import * as i from "react";
2
+ import { useComposedRefs as O } from "../../react-compose-refs/dist/index.js";
3
+ import { useLayoutEffect as A } from "../../react-use-layout-effect/dist/index.js";
4
+ function E(n, e) {
5
+ return i.useReducer((t, r) => e[t][r] ?? t, n);
6
+ }
7
+ var T = (n) => {
8
+ const { present: e, children: t } = n, r = R(e), a = typeof t == "function" ? t({ present: r.isPresent }) : i.Children.only(t), c = O(r.ref, v(a));
9
+ return typeof t == "function" || r.isPresent ? i.cloneElement(a, { ref: c }) : null;
10
+ };
11
+ T.displayName = "Presence";
12
+ function R(n) {
13
+ const [e, t] = i.useState(), r = i.useRef({}), a = i.useRef(n), c = i.useRef("none"), p = n ? "mounted" : "unmounted", [N, s] = E(p, {
14
+ mounted: {
15
+ UNMOUNT: "unmounted",
16
+ ANIMATION_OUT: "unmountSuspended"
17
+ },
18
+ unmountSuspended: {
19
+ MOUNT: "mounted",
20
+ ANIMATION_END: "unmounted"
21
+ },
22
+ unmounted: {
23
+ MOUNT: "mounted"
24
+ }
25
+ });
26
+ return i.useEffect(() => {
27
+ const o = l(r.current);
28
+ c.current = N === "mounted" ? o : "none";
29
+ }, [N]), A(() => {
30
+ const o = r.current, m = a.current;
31
+ if (m !== n) {
32
+ const f = c.current, u = l(o);
33
+ n ? s("MOUNT") : u === "none" || o?.display === "none" ? s("UNMOUNT") : s(m && f !== u ? "ANIMATION_OUT" : "UNMOUNT"), a.current = n;
34
+ }
35
+ }, [n, s]), A(() => {
36
+ if (e) {
37
+ let o;
38
+ const m = e.ownerDocument.defaultView ?? window, d = (u) => {
39
+ const g = l(r.current).includes(u.animationName);
40
+ if (u.target === e && g && (s("ANIMATION_END"), !a.current)) {
41
+ const y = e.style.animationFillMode;
42
+ e.style.animationFillMode = "forwards", o = m.setTimeout(() => {
43
+ e.style.animationFillMode === "forwards" && (e.style.animationFillMode = y);
44
+ });
45
+ }
46
+ }, f = (u) => {
47
+ u.target === e && (c.current = l(r.current));
48
+ };
49
+ return e.addEventListener("animationstart", f), e.addEventListener("animationcancel", d), e.addEventListener("animationend", d), () => {
50
+ m.clearTimeout(o), e.removeEventListener("animationstart", f), e.removeEventListener("animationcancel", d), e.removeEventListener("animationend", d);
51
+ };
52
+ } else
53
+ s("ANIMATION_END");
54
+ }, [e, s]), {
55
+ isPresent: ["mounted", "unmountSuspended"].includes(N),
56
+ ref: i.useCallback((o) => {
57
+ o && (r.current = getComputedStyle(o)), t(o);
58
+ }, [])
59
+ };
60
+ }
61
+ function l(n) {
62
+ return n?.animationName || "none";
63
+ }
64
+ function v(n) {
65
+ let e = Object.getOwnPropertyDescriptor(n.props, "ref")?.get, t = e && "isReactWarning" in e && e.isReactWarning;
66
+ return t ? n.ref : (e = Object.getOwnPropertyDescriptor(n, "ref")?.get, t = e && "isReactWarning" in e && e.isReactWarning, t ? n.props.ref : n.props.ref || n.ref);
67
+ }
68
+ export {
69
+ T as Presence
70
+ };
@@ -0,0 +1,35 @@
1
+ import * as f from "react";
2
+ import * as p from "react-dom";
3
+ import { createSlot as c } from "../../react-slot/dist/index.js";
4
+ import { jsx as u } from "react/jsx-runtime";
5
+ var l = [
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
+ ], h = l.reduce((t, i) => {
23
+ const o = c(`Primitive.${i}`), r = f.forwardRef((e, m) => {
24
+ const { asChild: a, ...s } = e, n = a ? o : i;
25
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ u(n, { ...s, ref: m });
26
+ });
27
+ return r.displayName = `Primitive.${i}`, { ...t, [i]: r };
28
+ }, {});
29
+ function w(t, i) {
30
+ t && p.flushSync(() => t.dispatchEvent(i));
31
+ }
32
+ export {
33
+ h as Primitive,
34
+ w as dispatchDiscreteCustomEvent
35
+ };
@@ -0,0 +1,48 @@
1
+ import * as l from "react";
2
+ import { composeRefs as m } from "../../react-compose-refs/dist/index.js";
3
+ import { jsx as u } from "react/jsx-runtime";
4
+ // @__NO_SIDE_EFFECTS__
5
+ function b(e) {
6
+ const r = /* @__PURE__ */ y(e), t = l.forwardRef((o, n) => {
7
+ const { children: i, ...c } = o, s = l.Children.toArray(i), f = s.find(E);
8
+ if (f) {
9
+ const a = f.props.children, d = s.map((p) => p === f ? l.Children.count(a) > 1 ? l.Children.only(null) : l.isValidElement(a) ? a.props.children : null : p);
10
+ return /* @__PURE__ */ u(r, { ...c, ref: n, children: l.isValidElement(a) ? l.cloneElement(a, void 0, d) : null });
11
+ }
12
+ return /* @__PURE__ */ u(r, { ...c, ref: n, children: i });
13
+ });
14
+ return t.displayName = `${e}.Slot`, t;
15
+ }
16
+ // @__NO_SIDE_EFFECTS__
17
+ function y(e) {
18
+ const r = l.forwardRef((t, o) => {
19
+ const { children: n, ...i } = t;
20
+ if (l.isValidElement(n)) {
21
+ const c = S(n), s = C(i, n.props);
22
+ return n.type !== l.Fragment && (s.ref = o ? m(o, c) : c), l.cloneElement(n, s);
23
+ }
24
+ return l.Children.count(n) > 1 ? l.Children.only(null) : null;
25
+ });
26
+ return r.displayName = `${e}.SlotClone`, r;
27
+ }
28
+ var g = Symbol("radix.slottable");
29
+ function E(e) {
30
+ return l.isValidElement(e) && typeof e.type == "function" && "__radixId" in e.type && e.type.__radixId === g;
31
+ }
32
+ function C(e, r) {
33
+ const t = { ...r };
34
+ for (const o in r) {
35
+ const n = e[o], i = r[o];
36
+ /^on[A-Z]/.test(o) ? n && i ? t[o] = (...s) => {
37
+ i(...s), n(...s);
38
+ } : n && (t[o] = n) : o === "style" ? t[o] = { ...n, ...i } : o === "className" && (t[o] = [n, i].filter(Boolean).join(" "));
39
+ }
40
+ return { ...e, ...t };
41
+ }
42
+ function S(e) {
43
+ let r = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, t = r && "isReactWarning" in r && r.isReactWarning;
44
+ return t ? e.ref : (r = Object.getOwnPropertyDescriptor(e, "ref")?.get, t = r && "isReactWarning" in r && r.isReactWarning, t ? e.props.ref : e.props.ref || e.ref);
45
+ }
46
+ export {
47
+ b as createSlot
48
+ };
@@ -0,0 +1,10 @@
1
+ import * as e from "react";
2
+ function c(r) {
3
+ const t = e.useRef(r);
4
+ return e.useEffect(() => {
5
+ t.current = r;
6
+ }), e.useMemo(() => (...u) => t.current?.(...u), []);
7
+ }
8
+ export {
9
+ c as useCallbackRef
10
+ };
@@ -0,0 +1,32 @@
1
+ import * as l from "react";
2
+ import { useCallbackRef as f } from "../../react-use-callback-ref/dist/index.js";
3
+ function R({
4
+ prop: t,
5
+ defaultProp: r,
6
+ onChange: s = () => {
7
+ }
8
+ }) {
9
+ const [e, n] = v({ defaultProp: r, onChange: s }), o = t !== void 0, i = o ? t : e, u = f(s), d = l.useCallback(
10
+ (c) => {
11
+ if (o) {
12
+ const a = typeof c == "function" ? c(t) : c;
13
+ a !== t && u(a);
14
+ } else
15
+ n(c);
16
+ },
17
+ [o, t, n, u]
18
+ );
19
+ return [i, d];
20
+ }
21
+ function v({
22
+ defaultProp: t,
23
+ onChange: r
24
+ }) {
25
+ const s = l.useState(t), [e] = s, n = l.useRef(e), o = f(r);
26
+ return l.useEffect(() => {
27
+ n.current !== e && (o(e), n.current = e);
28
+ }, [e, n, o]), s;
29
+ }
30
+ export {
31
+ R as useControllableState
32
+ };
@@ -0,0 +1,14 @@
1
+ import * as r from "react";
2
+ import { useCallbackRef as s } from "../../react-use-callback-ref/dist/index.js";
3
+ function p(n, e = globalThis?.document) {
4
+ const t = s(n);
5
+ r.useEffect(() => {
6
+ const o = (a) => {
7
+ a.key === "Escape" && t(a);
8
+ };
9
+ return e.addEventListener("keydown", o, { capture: !0 }), () => e.removeEventListener("keydown", o, { capture: !0 });
10
+ }, [t, e]);
11
+ }
12
+ export {
13
+ p as useEscapeKeydown
14
+ };
@@ -0,0 +1,6 @@
1
+ import * as t from "react";
2
+ var e = globalThis?.document ? t.useLayoutEffect : () => {
3
+ };
4
+ export {
5
+ e as useLayoutEffect
6
+ };
@@ -1,23 +1,23 @@
1
1
  import * as c from "react";
2
- import { composeEventHandlers as P } from "../../primitive/dist/index.js";
3
- import { useComposedRefs as O } from "../../react-compose-refs/dist/index.js";
4
- import { createContextScope as L } from "../../react-context/dist/index.js";
5
- import { DismissableLayer as G } from "../../react-dismissable-layer/dist/index.js";
6
- import { useFocusGuards as H } from "../../react-focus-guards/dist/index.js";
7
- import { FocusScope as K } from "../../react-focus-scope/dist/index.js";
8
- import { useId as $ } from "../../react-id/dist/index.js";
9
- import { createPopperScope as _, Anchor as x, Content as j, Arrow as U, Root as V } from "../../react-popper/dist/index.js";
10
- import { Portal as W } from "../../react-portal/dist/index.js";
11
- import { Presence as w } from "../../react-presence/dist/index.js";
12
- import { Primitive as E } from "../../react-primitive/dist/index.js";
13
- import { createSlot as Z } from "../../react-slot/dist/index.js";
14
- import { useControllableState as q } from "../../react-use-controllable-state/dist/index.js";
2
+ import { composeEventHandlers as P } from "../node_modules/@radix-ui/primitive/dist/index.js";
3
+ import { useComposedRefs as O } from "../node_modules/@radix-ui/react-compose-refs/dist/index.js";
4
+ import { createContextScope as L } from "../node_modules/@radix-ui/react-context/dist/index.js";
5
+ import { DismissableLayer as G } from "../node_modules/@radix-ui/react-dismissable-layer/dist/index.js";
6
+ import { useFocusGuards as H } from "../node_modules/@radix-ui/react-focus-guards/dist/index.js";
7
+ import { FocusScope as K } from "../node_modules/@radix-ui/react-focus-scope/dist/index.js";
8
+ import { useId as $ } from "../node_modules/@radix-ui/react-id/dist/index.js";
9
+ import { createPopperScope as _, Anchor as x, Content as j, Arrow as U, Root as V } from "../node_modules/@radix-ui/react-popper/dist/index.js";
10
+ import { Portal as W } from "../node_modules/@radix-ui/react-portal/dist/index.js";
11
+ import { Presence as w } from "../node_modules/@radix-ui/react-presence/dist/index.js";
12
+ import { Primitive as E } from "../node_modules/@radix-ui/react-primitive/dist/index.js";
13
+ import { createSlot as Z } from "../node_modules/@radix-ui/react-slot/dist/index.js";
14
+ import { useControllableState as q } from "../node_modules/@radix-ui/react-use-controllable-state/dist/index.js";
15
15
  import { hideOthers as z } from "../../../aria-hidden/dist/es2015/index.js";
16
16
  import B from "../../../react-remove-scroll/dist/es2015/Combination.js";
17
17
  import { jsx as p } from "react/jsx-runtime";
18
- var R = "Popover", [b, _o] = L(R, [
18
+ var C = "Popover", [b, _o] = L(C, [
19
19
  _
20
- ]), m = _(), [J, u] = b(R), F = (o) => {
20
+ ]), m = _(), [J, u] = b(C), F = (o) => {
21
21
  const {
22
22
  __scopePopover: n,
23
23
  children: t,
@@ -25,10 +25,11 @@ var R = "Popover", [b, _o] = L(R, [
25
25
  defaultOpen: e,
26
26
  onOpenChange: r,
27
27
  modal: s = !1
28
- } = o, i = m(n), d = c.useRef(null), [v, g] = c.useState(!1), [h = !1, l] = q({
28
+ } = o, i = m(n), d = c.useRef(null), [v, g] = c.useState(!1), [h, l] = q({
29
29
  prop: a,
30
- defaultProp: e,
31
- onChange: r
30
+ defaultProp: e ?? !1,
31
+ onChange: r,
32
+ caller: C
32
33
  });
33
34
  return /* @__PURE__ */ p(V, { ...i, children: /* @__PURE__ */ p(
34
35
  J,
@@ -38,7 +39,7 @@ var R = "Popover", [b, _o] = L(R, [
38
39
  triggerRef: d,
39
40
  open: h,
40
41
  onOpenChange: l,
41
- onOpenToggle: c.useCallback(() => l((C) => !C), [l]),
42
+ onOpenToggle: c.useCallback(() => l((R) => !R), [l]),
42
43
  hasCustomAnchor: v,
43
44
  onCustomAnchorAdd: c.useCallback(() => g(!0), []),
44
45
  onCustomAnchorRemove: c.useCallback(() => g(!1), []),
@@ -47,7 +48,7 @@ var R = "Popover", [b, _o] = L(R, [
47
48
  }
48
49
  ) });
49
50
  };
50
- F.displayName = R;
51
+ F.displayName = C;
51
52
  var N = "PopoverAnchor", Q = c.forwardRef(
52
53
  (o, n) => {
53
54
  const { __scopePopover: t, ...a } = o, e = u(N, t), r = m(t), { onCustomAnchorAdd: s, onCustomAnchorRemove: i } = e;
@@ -154,7 +155,7 @@ var oo = Z("PopoverContent.RemoveScroll"), eo = c.forwardRef(
154
155
  onFocusOutside: v,
155
156
  onInteractOutside: g,
156
157
  ...h
157
- } = o, l = u(f, t), C = m(t);
158
+ } = o, l = u(f, t), R = m(t);
158
159
  return H(), /* @__PURE__ */ p(
159
160
  K,
160
161
  {
@@ -179,7 +180,7 @@ var oo = Z("PopoverContent.RemoveScroll"), eo = c.forwardRef(
179
180
  "data-state": T(l.open),
180
181
  role: "dialog",
181
182
  id: l.contentId,
182
- ...C,
183
+ ...R,
183
184
  ...h,
184
185
  ref: n,
185
186
  style: {
@@ -0,0 +1,9 @@
1
+ function f(n, r, { checkForDefaultPrevented: t = !0 } = {}) {
2
+ return function(e) {
3
+ if (n?.(e), t === !1 || !e.defaultPrevented)
4
+ return r?.(e);
5
+ };
6
+ }
7
+ export {
8
+ f as composeEventHandlers
9
+ };
@@ -0,0 +1,24 @@
1
+ import * as n from "react";
2
+ import { Primitive as p } from "../../react-primitive/dist/index.js";
3
+ import { jsx as o } from "react/jsx-runtime";
4
+ var v = "Arrow", e = n.forwardRef((r, i) => {
5
+ const { children: t, width: a = 10, height: s = 5, ...m } = r;
6
+ return /* @__PURE__ */ o(
7
+ p.svg,
8
+ {
9
+ ...m,
10
+ ref: i,
11
+ width: a,
12
+ height: s,
13
+ viewBox: "0 0 30 10",
14
+ preserveAspectRatio: "none",
15
+ children: r.asChild ? t : /* @__PURE__ */ o("polygon", { points: "0,0 30,0 15,10" })
16
+ }
17
+ );
18
+ });
19
+ e.displayName = v;
20
+ var h = e;
21
+ export {
22
+ e as Arrow,
23
+ h as Root
24
+ };
@@ -0,0 +1,29 @@
1
+ import * as f from "react";
2
+ function l(n, o) {
3
+ if (typeof n == "function")
4
+ return n(o);
5
+ n != null && (n.current = o);
6
+ }
7
+ function i(...n) {
8
+ return (o) => {
9
+ let u = !1;
10
+ const c = n.map((t) => {
11
+ const e = l(t, o);
12
+ return !u && typeof e == "function" && (u = !0), e;
13
+ });
14
+ if (u)
15
+ return () => {
16
+ for (let t = 0; t < c.length; t++) {
17
+ const e = c[t];
18
+ typeof e == "function" ? e() : l(n[t], null);
19
+ }
20
+ };
21
+ };
22
+ }
23
+ function s(...n) {
24
+ return f.useCallback(i(...n), n);
25
+ }
26
+ export {
27
+ i as composeRefs,
28
+ s as useComposedRefs
29
+ };
@@ -0,0 +1,53 @@
1
+ import * as u from "react";
2
+ import { jsx as _ } from "react/jsx-runtime";
3
+ function P(e, p = []) {
4
+ let n = [];
5
+ function m(s, t) {
6
+ const o = u.createContext(t), c = n.length;
7
+ n = [...n, t];
8
+ const a = (i) => {
9
+ const { scope: f, children: C, ...x } = i, d = f?.[e]?.[c] || o, v = u.useMemo(() => x, Object.values(x));
10
+ return /* @__PURE__ */ _(d.Provider, { value: v, children: C });
11
+ };
12
+ a.displayName = s + "Provider";
13
+ function S(i, f) {
14
+ const C = f?.[e]?.[c] || o, x = u.useContext(C);
15
+ if (x) return x;
16
+ if (t !== void 0) return t;
17
+ throw new Error(`\`${i}\` must be used within \`${s}\``);
18
+ }
19
+ return [a, S];
20
+ }
21
+ const r = () => {
22
+ const s = n.map((t) => u.createContext(t));
23
+ return function(o) {
24
+ const c = o?.[e] || s;
25
+ return u.useMemo(
26
+ () => ({ [`__scope${e}`]: { ...o, [e]: c } }),
27
+ [o, c]
28
+ );
29
+ };
30
+ };
31
+ return r.scopeName = e, [m, h(r, ...p)];
32
+ }
33
+ function h(...e) {
34
+ const p = e[0];
35
+ if (e.length === 1) return p;
36
+ const n = () => {
37
+ const m = e.map((r) => ({
38
+ useScope: r(),
39
+ scopeName: r.scopeName
40
+ }));
41
+ return function(s) {
42
+ const t = m.reduce((o, { useScope: c, scopeName: a }) => {
43
+ const i = c(s)[`__scope${a}`];
44
+ return { ...o, ...i };
45
+ }, {});
46
+ return u.useMemo(() => ({ [`__scope${p.scopeName}`]: t }), [t]);
47
+ };
48
+ };
49
+ return n.scopeName = p.scopeName, n;
50
+ }
51
+ export {
52
+ P as createContextScope
53
+ };