@phillips/seldon 1.138.0 → 1.139.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 (47) hide show
  1. package/dist/index.d.ts +42 -41
  2. package/dist/index.js +171 -169
  3. package/dist/node_modules/@radix-ui/react-collapsible/dist/index.js +1 -1
  4. package/dist/node_modules/@radix-ui/react-collection/dist/index.js +27 -27
  5. package/dist/node_modules/@radix-ui/react-compose-refs/dist/index.js +24 -9
  6. package/dist/node_modules/@radix-ui/react-context/dist/index.js +50 -34
  7. package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +45 -45
  8. package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +1 -1
  9. package/dist/node_modules/@radix-ui/react-id/dist/index.js +10 -10
  10. package/dist/node_modules/@radix-ui/react-popover/dist/index.js +239 -0
  11. package/dist/node_modules/@radix-ui/react-presence/dist/index.js +30 -25
  12. package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +13 -13
  13. package/dist/node_modules/@radix-ui/react-select/dist/index.js +364 -338
  14. package/dist/node_modules/@radix-ui/react-slot/dist/index.js +41 -40
  15. package/dist/node_modules/@radix-ui/react-tabs/dist/index.js +2 -2
  16. package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +3 -3
  17. package/dist/node_modules/@radix-ui/react-visually-hidden/dist/index.js +1 -1
  18. package/dist/patterns/FavoritesCollectionTile/FavoritesCollectionTile.d.ts +75 -0
  19. package/dist/patterns/FavoritesCollectionTile/FavoritesCollectionTile.js +131 -0
  20. package/dist/patterns/FavoritesCollectionTile/FavoritesCollectionTile.stories.d.ts +78 -0
  21. package/dist/patterns/FavoritesCollectionTile/FavoritesCollectionTile.test.d.ts +1 -0
  22. package/dist/patterns/FavoritesCollectionTile/index.d.ts +1 -0
  23. package/dist/scss/_vars.scss +1 -0
  24. package/dist/scss/_vars.scss.js +1 -0
  25. package/dist/scss/componentStyles.scss +1 -0
  26. package/dist/scss/patterns/FavoritesCollectionTile/_favoritesCollectionTile.scss +159 -0
  27. package/package.json +2 -1
  28. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/primitive/dist/index.js +0 -9
  29. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-compose-refs/dist/index.js +0 -29
  30. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-context/dist/index.js +0 -68
  31. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +0 -127
  32. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-focus-guards/dist/index.js +0 -17
  33. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-focus-scope/dist/index.js +0 -136
  34. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-portal/dist/index.js +0 -15
  35. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-presence/dist/index.js +0 -70
  36. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-primitive/dist/index.js +0 -35
  37. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-slot/dist/index.js +0 -47
  38. package/dist/node_modules/@radix-ui/react-select/node_modules/react-remove-scroll/dist/es2015/Combination.js +0 -11
  39. package/dist/node_modules/@radix-ui/react-select/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +0 -112
  40. package/dist/node_modules/@radix-ui/react-select/node_modules/react-remove-scroll/dist/es2015/UI.js +0 -31
  41. package/dist/node_modules/@radix-ui/react-select/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +0 -16
  42. package/dist/node_modules/@radix-ui/react-select/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +0 -62
  43. package/dist/node_modules/@radix-ui/react-select/node_modules/react-remove-scroll/dist/es2015/medium.js +0 -5
  44. package/dist/node_modules/@radix-ui/react-select/node_modules/react-remove-scroll/dist/es2015/sidecar.js +0 -7
  45. package/dist/node_modules/@radix-ui/react-select/node_modules/tslib/tslib.es6.js +0 -27
  46. package/dist/node_modules/@radix-ui/react-tabs/node_modules/@radix-ui/react-context/dist/index.js +0 -53
  47. package/dist/node_modules/@radix-ui/react-tabs/node_modules/@radix-ui/react-presence/dist/index.js +0 -70
@@ -1,52 +1,68 @@
1
1
  import * as u from "react";
2
- import { jsx as _ } from "react/jsx-runtime";
3
- function P(e, p = []) {
2
+ import { jsx as f } from "react/jsx-runtime";
3
+ function $(t, c) {
4
+ const n = u.createContext(c), p = (r) => {
5
+ const { children: e, ...o } = r, s = u.useMemo(() => o, Object.values(o));
6
+ return /* @__PURE__ */ f(n.Provider, { value: s, children: e });
7
+ };
8
+ p.displayName = t + "Provider";
9
+ function i(r) {
10
+ const e = u.useContext(n);
11
+ if (e) return e;
12
+ if (c !== void 0) return c;
13
+ throw new Error(`\`${r}\` must be used within \`${t}\``);
14
+ }
15
+ return [p, i];
16
+ }
17
+ function w(t, c = []) {
4
18
  let n = [];
5
- function m(s, t) {
6
- const o = u.createContext(t), c = n.length;
7
- n = [...n, t];
8
- function 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
- function S(i, f) {
13
- const C = f?.[e][c] || o, x = u.useContext(C);
14
- if (x) return x;
15
- if (t !== void 0) return t;
16
- throw new Error(`\`${i}\` must be used within \`${s}\``);
19
+ function p(r, e) {
20
+ const o = u.createContext(e), s = n.length;
21
+ n = [...n, e];
22
+ const d = (x) => {
23
+ const { scope: m, children: v, ...a } = x, S = m?.[t]?.[s] || o, h = u.useMemo(() => a, Object.values(a));
24
+ return /* @__PURE__ */ f(S.Provider, { value: h, children: v });
25
+ };
26
+ d.displayName = r + "Provider";
27
+ function C(x, m) {
28
+ const v = m?.[t]?.[s] || o, a = u.useContext(v);
29
+ if (a) return a;
30
+ if (e !== void 0) return e;
31
+ throw new Error(`\`${x}\` must be used within \`${r}\``);
17
32
  }
18
- return a.displayName = s + "Provider", [a, S];
33
+ return [d, C];
19
34
  }
20
- const r = () => {
21
- const s = n.map((t) => u.createContext(t));
35
+ const i = () => {
36
+ const r = n.map((e) => u.createContext(e));
22
37
  return function(o) {
23
- const c = o?.[e] || s;
38
+ const s = o?.[t] || r;
24
39
  return u.useMemo(
25
- () => ({ [`__scope${e}`]: { ...o, [e]: c } }),
26
- [o, c]
40
+ () => ({ [`__scope${t}`]: { ...o, [t]: s } }),
41
+ [o, s]
27
42
  );
28
43
  };
29
44
  };
30
- return r.scopeName = e, [m, h(r, ...p)];
45
+ return i.scopeName = t, [p, P(i, ...c)];
31
46
  }
32
- function h(...e) {
33
- const p = e[0];
34
- if (e.length === 1) return p;
47
+ function P(...t) {
48
+ const c = t[0];
49
+ if (t.length === 1) return c;
35
50
  const n = () => {
36
- const m = e.map((r) => ({
37
- useScope: r(),
38
- scopeName: r.scopeName
51
+ const p = t.map((i) => ({
52
+ useScope: i(),
53
+ scopeName: i.scopeName
39
54
  }));
40
- return function(s) {
41
- const t = m.reduce((o, { useScope: c, scopeName: a }) => {
42
- const i = c(s)[`__scope${a}`];
43
- return { ...o, ...i };
55
+ return function(r) {
56
+ const e = p.reduce((o, { useScope: s, scopeName: d }) => {
57
+ const x = s(r)[`__scope${d}`];
58
+ return { ...o, ...x };
44
59
  }, {});
45
- return u.useMemo(() => ({ [`__scope${p.scopeName}`]: t }), [t]);
60
+ return u.useMemo(() => ({ [`__scope${c.scopeName}`]: e }), [e]);
46
61
  };
47
62
  };
48
- return n.scopeName = p.scopeName, n;
63
+ return n.scopeName = c.scopeName, n;
49
64
  }
50
65
  export {
51
- P as createContextScope
66
+ $ as createContext,
67
+ w as createContextScope
52
68
  };
@@ -1,20 +1,20 @@
1
1
  import * as s from "react";
2
- import { composeEventHandlers as p } from "../node_modules/@radix-ui/primitive/dist/index.js";
3
- import { useComposedRefs as R } from "../node_modules/@radix-ui/react-compose-refs/dist/index.js";
4
- import { createContextScope as H, createContext as V } from "../node_modules/@radix-ui/react-context/dist/index.js";
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
5
  import { useId as C } from "../../react-id/dist/index.js";
6
6
  import { useControllableState as q } from "../../react-use-controllable-state/dist/index.js";
7
- import { DismissableLayer as K } from "../node_modules/@radix-ui/react-dismissable-layer/dist/index.js";
8
- import { FocusScope as U } from "../node_modules/@radix-ui/react-focus-scope/dist/index.js";
9
- import { Portal as Y } from "../node_modules/@radix-ui/react-portal/dist/index.js";
10
- import { Presence as _ } from "../node_modules/@radix-ui/react-presence/dist/index.js";
11
- import { Primitive as g } from "../node_modules/@radix-ui/react-primitive/dist/index.js";
12
- import { useFocusGuards as Z } from "../node_modules/@radix-ui/react-focus-guards/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 g } from "../../react-primitive/dist/index.js";
12
+ import { useFocusGuards as Z } from "../../react-focus-guards/dist/index.js";
13
13
  import z from "../../../react-remove-scroll/dist/es2015/Combination.js";
14
14
  import { hideOthers as J } from "../../../aria-hidden/dist/es2015/index.js";
15
- import { Slot as Q } from "../node_modules/@radix-ui/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) => {
15
+ import { createSlot as Q } from "../../react-slot/dist/index.js";
16
+ import { jsx as i, jsxs as P, Fragment as O } from "react/jsx-runtime";
17
+ var h = "Dialog", [I, Ne] = H(h), [X, u] = I(h), x = (e) => {
18
18
  const {
19
19
  __scopeDialog: t,
20
20
  children: n,
@@ -55,7 +55,7 @@ var A = "DialogTrigger", ee = s.forwardRef(
55
55
  "aria-haspopup": "dialog",
56
56
  "aria-expanded": r.open,
57
57
  "aria-controls": r.contentId,
58
- "data-state": P(r.open),
58
+ "data-state": N(r.open),
59
59
  ...a,
60
60
  ref: o,
61
61
  onClick: p(e.onClick, r.onOpenToggle)
@@ -64,7 +64,7 @@ var A = "DialogTrigger", ee = s.forwardRef(
64
64
  }
65
65
  );
66
66
  ee.displayName = A;
67
- var E = "DialogPortal", [oe, T] = O(E, {
67
+ var E = "DialogPortal", [oe, T] = I(E, {
68
68
  forceMount: void 0
69
69
  }), b = (e) => {
70
70
  const { __scopeDialog: t, forceMount: n, children: a, container: r } = e, o = u(E, t);
@@ -74,20 +74,20 @@ b.displayName = E;
74
74
  var m = "DialogOverlay", M = s.forwardRef(
75
75
  (e, t) => {
76
76
  const n = T(m, e.__scopeDialog), { forceMount: a = n.forceMount, ...r } = e, o = u(m, e.__scopeDialog);
77
- return o.modal ? /* @__PURE__ */ i(_, { present: a || o.open, children: /* @__PURE__ */ i(te, { ...r, ref: t }) }) : null;
77
+ return o.modal ? /* @__PURE__ */ i(_, { present: a || o.open, children: /* @__PURE__ */ i(re, { ...r, ref: t }) }) : null;
78
78
  }
79
79
  );
80
80
  M.displayName = m;
81
- var te = s.forwardRef(
81
+ var te = Q("DialogOverlay.RemoveScroll"), re = s.forwardRef(
82
82
  (e, t) => {
83
83
  const { __scopeDialog: n, ...a } = e, r = u(m, n);
84
84
  return (
85
85
  // Make sure `Content` is scrollable even when it doesn't live inside `RemoveScroll`
86
86
  // ie. when `Overlay` and `Content` are siblings
87
- /* @__PURE__ */ i(z, { as: Q, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ i(
87
+ /* @__PURE__ */ i(z, { as: te, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ i(
88
88
  g.div,
89
89
  {
90
- "data-state": P(r.open),
90
+ "data-state": N(r.open),
91
91
  ...a,
92
92
  ref: t,
93
93
  style: { pointerEvents: "auto", ...a.style }
@@ -98,18 +98,18 @@ var te = s.forwardRef(
98
98
  ), d = "DialogContent", w = s.forwardRef(
99
99
  (e, t) => {
100
100
  const n = T(d, e.__scopeDialog), { forceMount: a = n.forceMount, ...r } = e, o = u(d, e.__scopeDialog);
101
- return /* @__PURE__ */ i(_, { present: a || o.open, children: o.modal ? /* @__PURE__ */ i(re, { ...r, ref: t }) : /* @__PURE__ */ i(ne, { ...r, ref: t }) });
101
+ return /* @__PURE__ */ i(_, { present: a || o.open, children: o.modal ? /* @__PURE__ */ i(ne, { ...r, ref: t }) : /* @__PURE__ */ i(ae, { ...r, ref: t }) });
102
102
  }
103
103
  );
104
104
  w.displayName = d;
105
- var re = s.forwardRef(
105
+ var ne = s.forwardRef(
106
106
  (e, t) => {
107
107
  const n = u(d, e.__scopeDialog), a = s.useRef(null), r = R(t, n.contentRef, a);
108
108
  return s.useEffect(() => {
109
109
  const o = a.current;
110
110
  if (o) return J(o);
111
111
  }, []), /* @__PURE__ */ i(
112
- F,
112
+ S,
113
113
  {
114
114
  ...e,
115
115
  ref: r,
@@ -129,11 +129,11 @@ var re = s.forwardRef(
129
129
  }
130
130
  );
131
131
  }
132
- ), ne = s.forwardRef(
132
+ ), ae = s.forwardRef(
133
133
  (e, t) => {
134
134
  const n = u(d, e.__scopeDialog), a = s.useRef(!1), r = s.useRef(!1);
135
135
  return /* @__PURE__ */ i(
136
- F,
136
+ S,
137
137
  {
138
138
  ...e,
139
139
  ref: t,
@@ -150,10 +150,10 @@ var re = s.forwardRef(
150
150
  }
151
151
  );
152
152
  }
153
- ), F = s.forwardRef(
153
+ ), S = s.forwardRef(
154
154
  (e, t) => {
155
155
  const { __scopeDialog: n, trapFocus: a, onOpenAutoFocus: r, onCloseAutoFocus: o, ...l } = e, c = u(d, n), f = s.useRef(null), D = R(t, f);
156
- return Z(), /* @__PURE__ */ y(I, { children: [
156
+ return Z(), /* @__PURE__ */ P(O, { children: [
157
157
  /* @__PURE__ */ i(
158
158
  U,
159
159
  {
@@ -169,7 +169,7 @@ var re = s.forwardRef(
169
169
  id: c.contentId,
170
170
  "aria-describedby": c.descriptionId,
171
171
  "aria-labelledby": c.titleId,
172
- "data-state": P(c.open),
172
+ "data-state": N(c.open),
173
173
  ...l,
174
174
  ref: D,
175
175
  onDismiss: () => c.onOpenChange(!1)
@@ -177,19 +177,19 @@ var re = s.forwardRef(
177
177
  )
178
178
  }
179
179
  ),
180
- /* @__PURE__ */ y(I, { children: [
181
- /* @__PURE__ */ i(ae, { titleId: c.titleId }),
182
- /* @__PURE__ */ i(se, { contentRef: f, descriptionId: c.descriptionId })
180
+ /* @__PURE__ */ P(O, { children: [
181
+ /* @__PURE__ */ i(ie, { titleId: c.titleId }),
182
+ /* @__PURE__ */ i(ce, { contentRef: f, descriptionId: c.descriptionId })
183
183
  ] })
184
184
  ] });
185
185
  }
186
- ), N = "DialogTitle", S = s.forwardRef(
186
+ ), y = "DialogTitle", F = s.forwardRef(
187
187
  (e, t) => {
188
- const { __scopeDialog: n, ...a } = e, r = u(N, n);
188
+ const { __scopeDialog: n, ...a } = e, r = u(y, n);
189
189
  return /* @__PURE__ */ i(g.h2, { id: r.titleId, ...a, ref: t });
190
190
  }
191
191
  );
192
- S.displayName = N;
192
+ F.displayName = y;
193
193
  var W = "DialogDescription", k = s.forwardRef(
194
194
  (e, t) => {
195
195
  const { __scopeDialog: n, ...a } = e, r = u(W, n);
@@ -212,14 +212,14 @@ var G = "DialogClose", L = s.forwardRef(
212
212
  }
213
213
  );
214
214
  L.displayName = G;
215
- function P(e) {
215
+ function N(e) {
216
216
  return e ? "open" : "closed";
217
217
  }
218
218
  var $ = "DialogTitleWarning", [Pe, B] = V($, {
219
219
  contentName: d,
220
- titleName: N,
220
+ titleName: y,
221
221
  docsSlug: "dialog"
222
- }), ae = ({ titleId: e }) => {
222
+ }), ie = ({ titleId: e }) => {
223
223
  const t = B($), n = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
224
224
 
225
225
  If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
@@ -228,29 +228,29 @@ For more information, see https://radix-ui.com/primitives/docs/components/${t.do
228
228
  return s.useEffect(() => {
229
229
  e && (document.getElementById(e) || console.error(n));
230
230
  }, [n, e]), null;
231
- }, ie = "DialogDescriptionWarning", se = ({ contentRef: e, descriptionId: t }) => {
232
- const a = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${B(ie).contentName}}.`;
231
+ }, se = "DialogDescriptionWarning", ce = ({ contentRef: e, descriptionId: t }) => {
232
+ const a = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${B(se).contentName}}.`;
233
233
  return s.useEffect(() => {
234
234
  const r = e.current?.getAttribute("aria-describedby");
235
235
  t && r && (document.getElementById(t) || console.warn(a));
236
236
  }, [a, e, t]), null;
237
- }, ye = x, Ie = b, Oe = M, xe = w, Ae = S, Te = k, be = L;
237
+ }, Oe = x, Ie = b, xe = M, Ae = w, Te = F, be = k, Me = L;
238
238
  export {
239
- be as Close,
240
- xe as Content,
241
- Te as Description,
239
+ Me as Close,
240
+ Ae as Content,
241
+ be as Description,
242
242
  x as Dialog,
243
243
  L as DialogClose,
244
244
  w as DialogContent,
245
245
  k as DialogDescription,
246
246
  M as DialogOverlay,
247
247
  b as DialogPortal,
248
- S as DialogTitle,
248
+ F as DialogTitle,
249
249
  ee as DialogTrigger,
250
- Oe as Overlay,
250
+ xe as Overlay,
251
251
  Ie as Portal,
252
- ye as Root,
253
- Ae as Title,
252
+ Oe as Root,
253
+ Te as Title,
254
254
  Pe as WarningProvider,
255
255
  Ne as createDialogScope
256
256
  };
@@ -10,7 +10,7 @@ function a() {
10
10
  }
11
11
  function n() {
12
12
  const e = document.createElement("span");
13
- return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.cssText = "outline: none; opacity: 0; position: fixed; pointer-events: none", e;
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
14
  }
15
15
  export {
16
16
  a as useFocusGuards
@@ -1,13 +1,13 @@
1
- import * as e from "react";
2
- import { useLayoutEffect as a } from "../../react-use-layout-effect/dist/index.js";
3
- var s = e.useId || (() => {
4
- }), i = 0;
5
- function d(o) {
6
- const [t, r] = e.useState(s());
7
- return a(() => {
8
- r((u) => u ?? String(i++));
9
- }, [o]), t ? `radix-${t}` : "";
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
10
  }
11
11
  export {
12
- d as useId
12
+ n as useId
13
13
  };
@@ -0,0 +1,239 @@
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";
15
+ import { hideOthers as z } from "../../../aria-hidden/dist/es2015/index.js";
16
+ import B from "../../../react-remove-scroll/dist/es2015/Combination.js";
17
+ import { jsx as p } from "react/jsx-runtime";
18
+ var R = "Popover", [b, _o] = L(R, [
19
+ _
20
+ ]), m = _(), [J, u] = b(R), F = (o) => {
21
+ const {
22
+ __scopePopover: n,
23
+ children: t,
24
+ open: a,
25
+ defaultOpen: e,
26
+ onOpenChange: r,
27
+ modal: s = !1
28
+ } = o, i = m(n), d = c.useRef(null), [v, g] = c.useState(!1), [h = !1, l] = q({
29
+ prop: a,
30
+ defaultProp: e,
31
+ onChange: r
32
+ });
33
+ return /* @__PURE__ */ p(V, { ...i, children: /* @__PURE__ */ p(
34
+ J,
35
+ {
36
+ scope: n,
37
+ contentId: $(),
38
+ triggerRef: d,
39
+ open: h,
40
+ onOpenChange: l,
41
+ onOpenToggle: c.useCallback(() => l((C) => !C), [l]),
42
+ hasCustomAnchor: v,
43
+ onCustomAnchorAdd: c.useCallback(() => g(!0), []),
44
+ onCustomAnchorRemove: c.useCallback(() => g(!1), []),
45
+ modal: s,
46
+ children: t
47
+ }
48
+ ) });
49
+ };
50
+ F.displayName = R;
51
+ var N = "PopoverAnchor", Q = c.forwardRef(
52
+ (o, n) => {
53
+ const { __scopePopover: t, ...a } = o, e = u(N, t), r = m(t), { onCustomAnchorAdd: s, onCustomAnchorRemove: i } = e;
54
+ return c.useEffect(() => (s(), () => i()), [s, i]), /* @__PURE__ */ p(x, { ...r, ...a, ref: n });
55
+ }
56
+ );
57
+ Q.displayName = N;
58
+ var S = "PopoverTrigger", y = c.forwardRef(
59
+ (o, n) => {
60
+ const { __scopePopover: t, ...a } = o, e = u(S, t), r = m(t), s = O(n, e.triggerRef), i = /* @__PURE__ */ p(
61
+ E.button,
62
+ {
63
+ type: "button",
64
+ "aria-haspopup": "dialog",
65
+ "aria-expanded": e.open,
66
+ "aria-controls": e.contentId,
67
+ "data-state": T(e.open),
68
+ ...a,
69
+ ref: s,
70
+ onClick: P(o.onClick, e.onOpenToggle)
71
+ }
72
+ );
73
+ return e.hasCustomAnchor ? i : /* @__PURE__ */ p(x, { asChild: !0, ...r, children: i });
74
+ }
75
+ );
76
+ y.displayName = S;
77
+ var A = "PopoverPortal", [X, Y] = b(A, {
78
+ forceMount: void 0
79
+ }), D = (o) => {
80
+ const { __scopePopover: n, forceMount: t, children: a, container: e } = o, r = u(A, n);
81
+ return /* @__PURE__ */ p(X, { scope: n, forceMount: t, children: /* @__PURE__ */ p(w, { present: t || r.open, children: /* @__PURE__ */ p(W, { asChild: !0, container: e, children: a }) }) });
82
+ };
83
+ D.displayName = A;
84
+ var f = "PopoverContent", M = c.forwardRef(
85
+ (o, n) => {
86
+ const t = Y(f, o.__scopePopover), { forceMount: a = t.forceMount, ...e } = o, r = u(f, o.__scopePopover);
87
+ return /* @__PURE__ */ p(w, { present: a || r.open, children: r.modal ? /* @__PURE__ */ p(eo, { ...e, ref: n }) : /* @__PURE__ */ p(ro, { ...e, ref: n }) });
88
+ }
89
+ );
90
+ M.displayName = f;
91
+ var oo = Z("PopoverContent.RemoveScroll"), eo = c.forwardRef(
92
+ (o, n) => {
93
+ const t = u(f, o.__scopePopover), a = c.useRef(null), e = O(n, a), r = c.useRef(!1);
94
+ return c.useEffect(() => {
95
+ const s = a.current;
96
+ if (s) return z(s);
97
+ }, []), /* @__PURE__ */ p(B, { as: oo, allowPinchZoom: !0, children: /* @__PURE__ */ p(
98
+ k,
99
+ {
100
+ ...o,
101
+ ref: e,
102
+ trapFocus: t.open,
103
+ disableOutsidePointerEvents: !0,
104
+ onCloseAutoFocus: P(o.onCloseAutoFocus, (s) => {
105
+ s.preventDefault(), r.current || t.triggerRef.current?.focus();
106
+ }),
107
+ onPointerDownOutside: P(
108
+ o.onPointerDownOutside,
109
+ (s) => {
110
+ const i = s.detail.originalEvent, d = i.button === 0 && i.ctrlKey === !0, v = i.button === 2 || d;
111
+ r.current = v;
112
+ },
113
+ { checkForDefaultPrevented: !1 }
114
+ ),
115
+ onFocusOutside: P(
116
+ o.onFocusOutside,
117
+ (s) => s.preventDefault(),
118
+ { checkForDefaultPrevented: !1 }
119
+ )
120
+ }
121
+ ) });
122
+ }
123
+ ), ro = c.forwardRef(
124
+ (o, n) => {
125
+ const t = u(f, o.__scopePopover), a = c.useRef(!1), e = c.useRef(!1);
126
+ return /* @__PURE__ */ p(
127
+ k,
128
+ {
129
+ ...o,
130
+ ref: n,
131
+ trapFocus: !1,
132
+ disableOutsidePointerEvents: !1,
133
+ onCloseAutoFocus: (r) => {
134
+ o.onCloseAutoFocus?.(r), r.defaultPrevented || (a.current || t.triggerRef.current?.focus(), r.preventDefault()), a.current = !1, e.current = !1;
135
+ },
136
+ onInteractOutside: (r) => {
137
+ o.onInteractOutside?.(r), r.defaultPrevented || (a.current = !0, r.detail.originalEvent.type === "pointerdown" && (e.current = !0));
138
+ const s = r.target;
139
+ t.triggerRef.current?.contains(s) && r.preventDefault(), r.detail.originalEvent.type === "focusin" && e.current && r.preventDefault();
140
+ }
141
+ }
142
+ );
143
+ }
144
+ ), k = c.forwardRef(
145
+ (o, n) => {
146
+ const {
147
+ __scopePopover: t,
148
+ trapFocus: a,
149
+ onOpenAutoFocus: e,
150
+ onCloseAutoFocus: r,
151
+ disableOutsidePointerEvents: s,
152
+ onEscapeKeyDown: i,
153
+ onPointerDownOutside: d,
154
+ onFocusOutside: v,
155
+ onInteractOutside: g,
156
+ ...h
157
+ } = o, l = u(f, t), C = m(t);
158
+ return H(), /* @__PURE__ */ p(
159
+ K,
160
+ {
161
+ asChild: !0,
162
+ loop: !0,
163
+ trapped: a,
164
+ onMountAutoFocus: e,
165
+ onUnmountAutoFocus: r,
166
+ children: /* @__PURE__ */ p(
167
+ G,
168
+ {
169
+ asChild: !0,
170
+ disableOutsidePointerEvents: s,
171
+ onInteractOutside: g,
172
+ onEscapeKeyDown: i,
173
+ onPointerDownOutside: d,
174
+ onFocusOutside: v,
175
+ onDismiss: () => l.onOpenChange(!1),
176
+ children: /* @__PURE__ */ p(
177
+ j,
178
+ {
179
+ "data-state": T(l.open),
180
+ role: "dialog",
181
+ id: l.contentId,
182
+ ...C,
183
+ ...h,
184
+ ref: n,
185
+ style: {
186
+ ...h.style,
187
+ "--radix-popover-content-transform-origin": "var(--radix-popper-transform-origin)",
188
+ "--radix-popover-content-available-width": "var(--radix-popper-available-width)",
189
+ "--radix-popover-content-available-height": "var(--radix-popper-available-height)",
190
+ "--radix-popover-trigger-width": "var(--radix-popper-anchor-width)",
191
+ "--radix-popover-trigger-height": "var(--radix-popper-anchor-height)"
192
+ }
193
+ }
194
+ )
195
+ }
196
+ )
197
+ }
198
+ );
199
+ }
200
+ ), I = "PopoverClose", to = c.forwardRef(
201
+ (o, n) => {
202
+ const { __scopePopover: t, ...a } = o, e = u(I, t);
203
+ return /* @__PURE__ */ p(
204
+ E.button,
205
+ {
206
+ type: "button",
207
+ ...a,
208
+ ref: n,
209
+ onClick: P(o.onClick, () => e.onOpenChange(!1))
210
+ }
211
+ );
212
+ }
213
+ );
214
+ to.displayName = I;
215
+ var no = "PopoverArrow", ao = c.forwardRef(
216
+ (o, n) => {
217
+ const { __scopePopover: t, ...a } = o, e = m(t);
218
+ return /* @__PURE__ */ p(U, { ...e, ...a, ref: n });
219
+ }
220
+ );
221
+ ao.displayName = no;
222
+ function T(o) {
223
+ return o ? "open" : "closed";
224
+ }
225
+ var xo = F, wo = y, Eo = D, bo = M;
226
+ export {
227
+ bo as Content,
228
+ F as Popover,
229
+ Q as PopoverAnchor,
230
+ ao as PopoverArrow,
231
+ to as PopoverClose,
232
+ M as PopoverContent,
233
+ D as PopoverPortal,
234
+ y as PopoverTrigger,
235
+ Eo as Portal,
236
+ xo as Root,
237
+ wo as Trigger,
238
+ _o as createPopoverScope
239
+ };