@phillips/seldon 1.119.0 → 1.121.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 (116) hide show
  1. package/dist/_virtual/_commonjsHelpers.js +1 -1
  2. package/dist/components/Accordion/Accordion.js +18 -18
  3. package/dist/components/Accordion/AccordionItem.js +67 -68
  4. package/dist/components/Carousel/Carousel.js +49 -51
  5. package/dist/components/Carousel/CarouselDots.js +46 -47
  6. package/dist/components/ContentPeek/ContentPeek.js +47 -47
  7. package/dist/components/ErrorBoundary/ErrorBoundary.js +11 -12
  8. package/dist/components/Filter/Filter.js +40 -41
  9. package/dist/components/Filter/FilterHeader.js +24 -24
  10. package/dist/components/Input/Input.d.ts +1 -1
  11. package/dist/components/Input/Input.js +21 -20
  12. package/dist/components/Input/Input.stories.d.ts +7 -0
  13. package/dist/components/Link/utils.js +2 -2
  14. package/dist/components/LinkBlock/LinkBlock.js +12 -13
  15. package/dist/components/LinkList/LinkList.js +8 -11
  16. package/dist/components/Navigation/Navigation.js +21 -22
  17. package/dist/components/Navigation/NavigationItemTrigger/NavigationItemTrigger.js +48 -50
  18. package/dist/components/Navigation/NavigationList/NavigationList.js +33 -35
  19. package/dist/components/Pagination/Pagination.js +7 -7
  20. package/dist/components/Pagination/utils.js +1 -1
  21. package/dist/components/PinchZoom/PinchZoom.js +40 -43
  22. package/dist/components/Search/Search.js +94 -98
  23. package/dist/components/Search/SearchButton.js +19 -19
  24. package/dist/components/SeldonImage/SeldonImage.js +1 -1
  25. package/dist/components/Select/Select.js +22 -14
  26. package/dist/components/Select/Select.stories.d.ts +15 -0
  27. package/dist/components/Tabs/TabTrigger.js +13 -13
  28. package/dist/node_modules/@artsy/fresnel/dist/Breakpoints.js +2 -2
  29. package/dist/node_modules/@artsy/fresnel/dist/DynamicResponsive.js +1 -1
  30. package/dist/node_modules/@artsy/fresnel/dist/Interactions.js +2 -2
  31. package/dist/node_modules/@artsy/fresnel/dist/Media.js +2 -2
  32. package/dist/node_modules/@artsy/fresnel/dist/MediaQueries.js +1 -1
  33. package/dist/node_modules/@artsy/fresnel/dist/Utils.js +1 -1
  34. package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +1 -1
  35. package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +1 -1
  36. package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +2 -2
  37. package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +2 -2
  38. package/dist/node_modules/@radix-ui/primitive/dist/index.js +5 -5
  39. package/dist/node_modules/@radix-ui/react-accordion/dist/index.js +63 -67
  40. package/dist/node_modules/@radix-ui/react-context/dist/index.js +35 -35
  41. package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +79 -83
  42. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/primitive/dist/index.js +5 -5
  43. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-context/dist/index.js +43 -45
  44. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +86 -87
  45. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-focus-guards/dist/index.js +7 -8
  46. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-focus-scope/dist/index.js +56 -57
  47. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-portal/dist/index.js +12 -13
  48. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-presence/dist/index.js +37 -42
  49. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-primitive/dist/index.js +1 -1
  50. package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-slot/dist/index.js +18 -19
  51. package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +86 -87
  52. package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +7 -8
  53. package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +56 -57
  54. package/dist/node_modules/@radix-ui/react-id/dist/index.js +10 -10
  55. package/dist/node_modules/@radix-ui/react-popper/dist/index.js +113 -115
  56. package/dist/node_modules/@radix-ui/react-portal/dist/index.js +12 -13
  57. package/dist/node_modules/@radix-ui/react-presence/dist/index.js +33 -37
  58. package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +1 -1
  59. package/dist/node_modules/@radix-ui/react-select/dist/index.js +422 -439
  60. package/dist/node_modules/@radix-ui/react-select/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +1 -1
  61. package/dist/node_modules/@radix-ui/react-select/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +1 -1
  62. package/dist/node_modules/@radix-ui/react-slot/dist/index.js +18 -19
  63. package/dist/node_modules/@radix-ui/react-tabs/node_modules/@radix-ui/react-context/dist/index.js +39 -41
  64. package/dist/node_modules/@radix-ui/react-tabs/node_modules/@radix-ui/react-presence/dist/index.js +37 -42
  65. package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +7 -10
  66. package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +1 -1
  67. package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +1 -1
  68. package/dist/node_modules/aria-hidden/dist/es2015/index.js +1 -1
  69. package/dist/node_modules/change-case/dist/index.js +41 -44
  70. package/dist/node_modules/date-fns/differenceInCalendarDays.js +11 -11
  71. package/dist/node_modules/date-fns/differenceInDays.js +9 -9
  72. package/dist/node_modules/date-fns/differenceInHours.js +11 -11
  73. package/dist/node_modules/date-fns/differenceInMinutes.js +8 -8
  74. package/dist/node_modules/date-fns/differenceInSeconds.js +7 -7
  75. package/dist/node_modules/date-fns/formatDuration.js +11 -12
  76. package/dist/node_modules/date-fns/isSameWeek.js +8 -8
  77. package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +12 -12
  78. package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +3 -3
  79. package/dist/node_modules/date-fns/locale/zh-CN/_lib/formatDistance.js +5 -5
  80. package/dist/node_modules/date-fns/locale/zh-CN/_lib/localize.js +10 -10
  81. package/dist/node_modules/date-fns/startOfDay.js +6 -6
  82. package/dist/node_modules/date-fns/startOfWeek.js +7 -8
  83. package/dist/node_modules/embla-carousel/esm/embla-carousel.esm.js +1 -1
  84. package/dist/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js +1 -1
  85. package/dist/node_modules/exenv/index.js +2 -2
  86. package/dist/node_modules/get-nonce/dist/es2015/index.js +1 -1
  87. package/dist/node_modules/prop-types/checkPropTypes.js +2 -2
  88. package/dist/node_modules/prop-types/factoryWithTypeCheckers.js +3 -3
  89. package/dist/node_modules/react-intersection-observer/dist/index.js +2 -2
  90. package/dist/node_modules/react-lifecycles-compat/react-lifecycles-compat.es.js +1 -1
  91. package/dist/node_modules/react-modal/lib/components/ModalPortal.js +1 -1
  92. package/dist/node_modules/react-modal/lib/helpers/scopeTab.js +1 -1
  93. package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +1 -1
  94. package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +1 -1
  95. package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +1 -1
  96. package/dist/node_modules/react-transition-group/esm/Transition.js +1 -1
  97. package/dist/node_modules/react-zoom-pan-pinch/dist/index.esm.js +14 -14
  98. package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +1 -1
  99. package/dist/node_modules/usehooks-ts/dist/index.js +1 -1
  100. package/dist/node_modules/warning/warning.js +1 -1
  101. package/dist/node_modules/wheel-gestures/dist/wheel-gestures.esm.js +1 -1
  102. package/dist/patterns/BidSnapshot/BidSnapshot.js +58 -58
  103. package/dist/patterns/DetailList/DetailList.js +22 -22
  104. package/dist/patterns/FilterMenu/FilterMenu.js +15 -15
  105. package/dist/patterns/LanguageSelector/LanguageSelector.js +23 -23
  106. package/dist/patterns/LanguageSelector/utils.js +2 -5
  107. package/dist/patterns/ObjectTile/ObjectTile.d.ts +4 -0
  108. package/dist/patterns/ObjectTile/ObjectTile.js +50 -48
  109. package/dist/patterns/ObjectTile/ObjectTile.stories.d.ts +2 -0
  110. package/dist/patterns/ViewingsList/StatefulViewingsList.js +16 -16
  111. package/dist/patterns/ViewingsList/ViewingsList.js +42 -42
  112. package/dist/patterns/ViewingsList/ViewingsListCard.js +122 -123
  113. package/dist/patterns/ViewingsList/ViewingsListCardForm.js +170 -170
  114. package/dist/scss/patterns/ObjectTile/_objectTile.scss +17 -1
  115. package/dist/site-furniture/Header/Header.js +32 -32
  116. package/package.json +2 -1
@@ -1,51 +1,51 @@
1
- import * as i from "react";
1
+ import * as u from "react";
2
2
  import { jsx as _ } from "react/jsx-runtime";
3
- function P(t, x = []) {
4
- let o = [];
5
- function f(u, e) {
6
- const n = i.createContext(e), r = o.length;
7
- o = [...o, e];
8
- function m(a) {
9
- const { scope: c, children: C, ...p } = a, d = (c == null ? void 0 : c[t][r]) || n, v = i.useMemo(() => p, Object.values(p));
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
+ function a(i) {
9
+ const { scope: f, children: C, ...x } = i, d = f?.[e][c] || o, v = u.useMemo(() => x, Object.values(x));
10
10
  return /* @__PURE__ */ _(d.Provider, { value: v, children: C });
11
11
  }
12
- function S(a, c) {
13
- const C = (c == null ? void 0 : c[t][r]) || n, p = i.useContext(C);
14
- if (p) return p;
15
- if (e !== void 0) return e;
16
- throw new Error(`\`${a}\` must be used within \`${u}\``);
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}\``);
17
17
  }
18
- return m.displayName = u + "Provider", [m, S];
18
+ return a.displayName = s + "Provider", [a, S];
19
19
  }
20
- const s = () => {
21
- const u = o.map((e) => i.createContext(e));
22
- return function(n) {
23
- const r = (n == null ? void 0 : n[t]) || u;
24
- return i.useMemo(
25
- () => ({ [`__scope${t}`]: { ...n, [t]: r } }),
26
- [n, r]
20
+ const r = () => {
21
+ const s = n.map((t) => u.createContext(t));
22
+ return function(o) {
23
+ const c = o?.[e] || s;
24
+ return u.useMemo(
25
+ () => ({ [`__scope${e}`]: { ...o, [e]: c } }),
26
+ [o, c]
27
27
  );
28
28
  };
29
29
  };
30
- return s.scopeName = t, [f, h(s, ...x)];
30
+ return r.scopeName = e, [m, h(r, ...p)];
31
31
  }
32
- function h(...t) {
33
- const x = t[0];
34
- if (t.length === 1) return x;
35
- const o = () => {
36
- const f = t.map((s) => ({
37
- useScope: s(),
38
- scopeName: s.scopeName
32
+ function h(...e) {
33
+ const p = e[0];
34
+ if (e.length === 1) return p;
35
+ const n = () => {
36
+ const m = e.map((r) => ({
37
+ useScope: r(),
38
+ scopeName: r.scopeName
39
39
  }));
40
- return function(u) {
41
- const e = f.reduce((n, { useScope: r, scopeName: m }) => {
42
- const a = r(u)[`__scope${m}`];
43
- return { ...n, ...a };
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 };
44
44
  }, {});
45
- return i.useMemo(() => ({ [`__scope${x.scopeName}`]: e }), [e]);
45
+ return u.useMemo(() => ({ [`__scope${p.scopeName}`]: t }), [t]);
46
46
  };
47
47
  };
48
- return o.scopeName = x.scopeName, o;
48
+ return n.scopeName = p.scopeName, n;
49
49
  }
50
50
  export {
51
51
  P as createContextScope
@@ -8,7 +8,7 @@ import { DismissableLayer as K } from "../node_modules/@radix-ui/react-dismissab
8
8
  import { FocusScope as U } from "../node_modules/@radix-ui/react-focus-scope/dist/index.js";
9
9
  import { Portal as Y } from "../node_modules/@radix-ui/react-portal/dist/index.js";
10
10
  import { Presence as _ } from "../node_modules/@radix-ui/react-presence/dist/index.js";
11
- import { Primitive as m } from "../node_modules/@radix-ui/react-primitive/dist/index.js";
11
+ import { Primitive as g } from "../node_modules/@radix-ui/react-primitive/dist/index.js";
12
12
  import { useFocusGuards as Z } from "../node_modules/@radix-ui/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";
@@ -16,40 +16,40 @@ import { Slot as Q } from "../node_modules/@radix-ui/react-slot/dist/index.js";
16
16
  import { jsx as i, jsxs as y, Fragment as I } from "react/jsx-runtime";
17
17
  var h = "Dialog", [O, Ne] = H(h), [X, u] = O(h), x = (e) => {
18
18
  const {
19
- __scopeDialog: o,
19
+ __scopeDialog: t,
20
20
  children: n,
21
21
  open: a,
22
22
  defaultOpen: r,
23
- onOpenChange: t,
24
- modal: c = !0
25
- } = e, l = s.useRef(null), d = s.useRef(null), [g = !1, v] = q({
23
+ onOpenChange: o,
24
+ modal: l = !0
25
+ } = e, c = s.useRef(null), f = s.useRef(null), [D = !1, v] = q({
26
26
  prop: a,
27
27
  defaultProp: r,
28
- onChange: t
28
+ onChange: o
29
29
  });
30
30
  return /* @__PURE__ */ i(
31
31
  X,
32
32
  {
33
- scope: o,
34
- triggerRef: l,
35
- contentRef: d,
33
+ scope: t,
34
+ triggerRef: c,
35
+ contentRef: f,
36
36
  contentId: C(),
37
37
  titleId: C(),
38
38
  descriptionId: C(),
39
- open: g,
39
+ open: D,
40
40
  onOpenChange: v,
41
41
  onOpenToggle: s.useCallback(() => v((j) => !j), [v]),
42
- modal: c,
42
+ modal: l,
43
43
  children: n
44
44
  }
45
45
  );
46
46
  };
47
47
  x.displayName = h;
48
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);
49
+ (e, t) => {
50
+ const { __scopeDialog: n, ...a } = e, r = u(A, n), o = R(t, r.triggerRef);
51
51
  return /* @__PURE__ */ i(
52
- m.button,
52
+ g.button,
53
53
  {
54
54
  type: "button",
55
55
  "aria-haspopup": "dialog",
@@ -57,57 +57,57 @@ var A = "DialogTrigger", ee = s.forwardRef(
57
57
  "aria-controls": r.contentId,
58
58
  "data-state": P(r.open),
59
59
  ...a,
60
- ref: t,
60
+ ref: o,
61
61
  onClick: p(e.onClick, r.onOpenToggle)
62
62
  }
63
63
  );
64
64
  }
65
65
  );
66
66
  ee.displayName = A;
67
- var E = "DialogPortal", [te, T] = O(E, {
67
+ var E = "DialogPortal", [oe, T] = O(E, {
68
68
  forceMount: void 0
69
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 }) })) });
70
+ const { __scopeDialog: t, forceMount: n, children: a, container: r } = e, o = u(E, t);
71
+ return /* @__PURE__ */ i(oe, { scope: t, forceMount: n, children: s.Children.map(a, (l) => /* @__PURE__ */ i(_, { present: n || o.open, children: /* @__PURE__ */ i(Y, { asChild: !0, container: r, children: l }) })) });
72
72
  };
73
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;
74
+ var m = "DialogOverlay", M = s.forwardRef(
75
+ (e, t) => {
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;
78
78
  }
79
79
  );
80
- M.displayName = D;
81
- var oe = s.forwardRef(
82
- (e, o) => {
83
- const { __scopeDialog: n, ...a } = e, r = u(D, n);
80
+ M.displayName = m;
81
+ var te = s.forwardRef(
82
+ (e, t) => {
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
87
  /* @__PURE__ */ i(z, { as: Q, allowPinchZoom: !0, shards: [r.contentRef], children: /* @__PURE__ */ i(
88
- m.div,
88
+ g.div,
89
89
  {
90
90
  "data-state": P(r.open),
91
91
  ...a,
92
- ref: o,
92
+ ref: t,
93
93
  style: { pointerEvents: "auto", ...a.style }
94
94
  }
95
95
  ) })
96
96
  );
97
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 }) });
98
+ ), d = "DialogContent", w = s.forwardRef(
99
+ (e, t) => {
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 }) });
102
102
  }
103
103
  );
104
- w.displayName = f;
104
+ w.displayName = d;
105
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);
106
+ (e, t) => {
107
+ const n = u(d, e.__scopeDialog), a = s.useRef(null), r = R(t, n.contentRef, a);
108
108
  return s.useEffect(() => {
109
- const t = a.current;
110
- if (t) return J(t);
109
+ const o = a.current;
110
+ if (o) return J(o);
111
111
  }, []), /* @__PURE__ */ i(
112
112
  F,
113
113
  {
@@ -115,47 +115,44 @@ var re = s.forwardRef(
115
115
  ref: r,
116
116
  trapFocus: n.open,
117
117
  disableOutsidePointerEvents: !0,
118
- onCloseAutoFocus: p(e.onCloseAutoFocus, (t) => {
119
- var c;
120
- t.preventDefault(), (c = n.triggerRef.current) == null || c.focus();
118
+ onCloseAutoFocus: p(e.onCloseAutoFocus, (o) => {
119
+ o.preventDefault(), n.triggerRef.current?.focus();
121
120
  }),
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();
121
+ onPointerDownOutside: p(e.onPointerDownOutside, (o) => {
122
+ const l = o.detail.originalEvent, c = l.button === 0 && l.ctrlKey === !0;
123
+ (l.button === 2 || c) && o.preventDefault();
125
124
  }),
126
125
  onFocusOutside: p(
127
126
  e.onFocusOutside,
128
- (t) => t.preventDefault()
127
+ (o) => o.preventDefault()
129
128
  )
130
129
  }
131
130
  );
132
131
  }
133
132
  ), ne = s.forwardRef(
134
- (e, o) => {
135
- const n = u(f, e.__scopeDialog), a = s.useRef(!1), r = s.useRef(!1);
133
+ (e, t) => {
134
+ const n = u(d, e.__scopeDialog), a = s.useRef(!1), r = s.useRef(!1);
136
135
  return /* @__PURE__ */ i(
137
136
  F,
138
137
  {
139
138
  ...e,
140
- ref: o,
139
+ ref: t,
141
140
  trapFocus: !1,
142
141
  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;
142
+ onCloseAutoFocus: (o) => {
143
+ e.onCloseAutoFocus?.(o), o.defaultPrevented || (a.current || n.triggerRef.current?.focus(), o.preventDefault()), a.current = !1, r.current = !1;
146
144
  },
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();
145
+ onInteractOutside: (o) => {
146
+ e.onInteractOutside?.(o), o.defaultPrevented || (a.current = !0, o.detail.originalEvent.type === "pointerdown" && (r.current = !0));
147
+ const l = o.target;
148
+ n.triggerRef.current?.contains(l) && o.preventDefault(), o.detail.originalEvent.type === "focusin" && r.current && o.preventDefault();
152
149
  }
153
150
  }
154
151
  );
155
152
  }
156
153
  ), 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);
154
+ (e, t) => {
155
+ const { __scopeDialog: n, trapFocus: a, onOpenAutoFocus: r, onCloseAutoFocus: o, ...l } = e, c = u(d, n), f = s.useRef(null), D = R(t, f);
159
156
  return Z(), /* @__PURE__ */ y(I, { children: [
160
157
  /* @__PURE__ */ i(
161
158
  U,
@@ -164,51 +161,51 @@ var re = s.forwardRef(
164
161
  loop: !0,
165
162
  trapped: a,
166
163
  onMountAutoFocus: r,
167
- onUnmountAutoFocus: t,
164
+ onUnmountAutoFocus: o,
168
165
  children: /* @__PURE__ */ i(
169
166
  K,
170
167
  {
171
168
  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)
169
+ id: c.contentId,
170
+ "aria-describedby": c.descriptionId,
171
+ "aria-labelledby": c.titleId,
172
+ "data-state": P(c.open),
173
+ ...l,
174
+ ref: D,
175
+ onDismiss: () => c.onOpenChange(!1)
179
176
  }
180
177
  )
181
178
  }
182
179
  ),
183
180
  /* @__PURE__ */ y(I, { children: [
184
- /* @__PURE__ */ i(ae, { titleId: l.titleId }),
185
- /* @__PURE__ */ i(se, { contentRef: d, descriptionId: l.descriptionId })
181
+ /* @__PURE__ */ i(ae, { titleId: c.titleId }),
182
+ /* @__PURE__ */ i(se, { contentRef: f, descriptionId: c.descriptionId })
186
183
  ] })
187
184
  ] });
188
185
  }
189
186
  ), N = "DialogTitle", S = s.forwardRef(
190
- (e, o) => {
187
+ (e, t) => {
191
188
  const { __scopeDialog: n, ...a } = e, r = u(N, n);
192
- return /* @__PURE__ */ i(m.h2, { id: r.titleId, ...a, ref: o });
189
+ return /* @__PURE__ */ i(g.h2, { id: r.titleId, ...a, ref: t });
193
190
  }
194
191
  );
195
192
  S.displayName = N;
196
193
  var W = "DialogDescription", k = s.forwardRef(
197
- (e, o) => {
194
+ (e, t) => {
198
195
  const { __scopeDialog: n, ...a } = e, r = u(W, n);
199
- return /* @__PURE__ */ i(m.p, { id: r.descriptionId, ...a, ref: o });
196
+ return /* @__PURE__ */ i(g.p, { id: r.descriptionId, ...a, ref: t });
200
197
  }
201
198
  );
202
199
  k.displayName = W;
203
200
  var G = "DialogClose", L = s.forwardRef(
204
- (e, o) => {
201
+ (e, t) => {
205
202
  const { __scopeDialog: n, ...a } = e, r = u(G, n);
206
203
  return /* @__PURE__ */ i(
207
- m.button,
204
+ g.button,
208
205
  {
209
206
  type: "button",
210
207
  ...a,
211
- ref: o,
208
+ ref: t,
212
209
  onClick: p(e.onClick, () => r.onOpenChange(!1))
213
210
  }
214
211
  );
@@ -219,25 +216,24 @@ function P(e) {
219
216
  return e ? "open" : "closed";
220
217
  }
221
218
  var $ = "DialogTitleWarning", [Pe, B] = V($, {
222
- contentName: f,
219
+ contentName: d,
223
220
  titleName: N,
224
221
  docsSlug: "dialog"
225
222
  }), ae = ({ titleId: e }) => {
226
- const o = B($), n = `\`${o.contentName}\` requires a \`${o.titleName}\` for the component to be accessible for screen reader users.
223
+ const t = B($), n = `\`${t.contentName}\` requires a \`${t.titleName}\` for the component to be accessible for screen reader users.
227
224
 
228
- If you want to hide the \`${o.titleName}\`, you can wrap it with our VisuallyHidden component.
225
+ If you want to hide the \`${t.titleName}\`, you can wrap it with our VisuallyHidden component.
229
226
 
230
- For more information, see https://radix-ui.com/primitives/docs/components/${o.docsSlug}`;
227
+ For more information, see https://radix-ui.com/primitives/docs/components/${t.docsSlug}`;
231
228
  return s.useEffect(() => {
232
229
  e && (document.getElementById(e) || console.error(n));
233
230
  }, [n, e]), null;
234
- }, ie = "DialogDescriptionWarning", se = ({ contentRef: e, descriptionId: o }) => {
231
+ }, ie = "DialogDescriptionWarning", se = ({ contentRef: e, descriptionId: t }) => {
235
232
  const a = `Warning: Missing \`Description\` or \`aria-describedby={undefined}\` for {${B(ie).contentName}}.`;
236
233
  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;
234
+ const r = e.current?.getAttribute("aria-describedby");
235
+ t && r && (document.getElementById(t) || console.warn(a));
236
+ }, [a, e, t]), null;
241
237
  }, ye = x, Ie = b, Oe = M, xe = w, Ae = S, Te = k, be = L;
242
238
  export {
243
239
  be as Close,
@@ -1,9 +1,9 @@
1
- function h(f, c, { checkForDefaultPrevented: p = !0 } = {}) {
2
- return function(s) {
3
- if (f == null || f(s), p === !1 || !s.defaultPrevented)
4
- return c == null ? void 0 : c(s);
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
5
  };
6
6
  }
7
7
  export {
8
- h as composeEventHandlers
8
+ f as composeEventHandlers
9
9
  };
@@ -1,70 +1,68 @@
1
1
  import * as u from "react";
2
- import { jsx as h } from "react/jsx-runtime";
3
- function w(e, c) {
4
- const o = u.createContext(c), a = (r) => {
5
- const { children: t, ...n } = r, s = u.useMemo(() => n, Object.values(n));
6
- return /* @__PURE__ */ h(o.Provider, { value: s, children: t });
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
7
  };
8
- a.displayName = e + "Provider";
8
+ p.displayName = t + "Provider";
9
9
  function i(r) {
10
- const t = u.useContext(o);
11
- if (t) return t;
10
+ const e = u.useContext(n);
11
+ if (e) return e;
12
12
  if (c !== void 0) return c;
13
- throw new Error(`\`${r}\` must be used within \`${e}\``);
13
+ throw new Error(`\`${r}\` must be used within \`${t}\``);
14
14
  }
15
- return [a, i];
15
+ return [p, i];
16
16
  }
17
- function _(e, c = []) {
18
- let o = [];
19
- function a(r, t) {
20
- const n = u.createContext(t), s = o.length;
21
- o = [...o, t];
22
- const p = (d) => {
23
- var S;
24
- const { scope: x, children: C, ...m } = d, v = ((S = x == null ? void 0 : x[e]) == null ? void 0 : S[s]) || n, P = u.useMemo(() => m, Object.values(m));
25
- return /* @__PURE__ */ h(v.Provider, { value: P, children: C });
17
+ function w(t, c = []) {
18
+ let n = [];
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 });
26
25
  };
27
- p.displayName = r + "Provider";
28
- function f(d, x) {
29
- var v;
30
- const C = ((v = x == null ? void 0 : x[e]) == null ? void 0 : v[s]) || n, m = u.useContext(C);
31
- if (m) return m;
32
- if (t !== void 0) return t;
33
- throw new Error(`\`${d}\` must be used within \`${r}\``);
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}\``);
34
32
  }
35
- return [p, f];
33
+ return [d, C];
36
34
  }
37
35
  const i = () => {
38
- const r = o.map((t) => u.createContext(t));
39
- return function(n) {
40
- const s = (n == null ? void 0 : n[e]) || r;
36
+ const r = n.map((e) => u.createContext(e));
37
+ return function(o) {
38
+ const s = o?.[t] || r;
41
39
  return u.useMemo(
42
- () => ({ [`__scope${e}`]: { ...n, [e]: s } }),
43
- [n, s]
40
+ () => ({ [`__scope${t}`]: { ...o, [t]: s } }),
41
+ [o, s]
44
42
  );
45
43
  };
46
44
  };
47
- return i.scopeName = e, [a, l(i, ...c)];
45
+ return i.scopeName = t, [p, P(i, ...c)];
48
46
  }
49
- function l(...e) {
50
- const c = e[0];
51
- if (e.length === 1) return c;
52
- const o = () => {
53
- const a = e.map((i) => ({
47
+ function P(...t) {
48
+ const c = t[0];
49
+ if (t.length === 1) return c;
50
+ const n = () => {
51
+ const p = t.map((i) => ({
54
52
  useScope: i(),
55
53
  scopeName: i.scopeName
56
54
  }));
57
55
  return function(r) {
58
- const t = a.reduce((n, { useScope: s, scopeName: p }) => {
59
- const d = s(r)[`__scope${p}`];
60
- return { ...n, ...d };
56
+ const e = p.reduce((o, { useScope: s, scopeName: d }) => {
57
+ const x = s(r)[`__scope${d}`];
58
+ return { ...o, ...x };
61
59
  }, {});
62
- return u.useMemo(() => ({ [`__scope${c.scopeName}`]: t }), [t]);
60
+ return u.useMemo(() => ({ [`__scope${c.scopeName}`]: e }), [e]);
63
61
  };
64
62
  };
65
- return o.scopeName = c.scopeName, o;
63
+ return n.scopeName = c.scopeName, n;
66
64
  }
67
65
  export {
68
- w as createContext,
69
- _ as createContextScope
66
+ $ as createContext,
67
+ w as createContextScope
70
68
  };