@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,46 +1,45 @@
1
- import * as l from "react";
1
+ import * as o from "react";
2
2
  import { composeRefs as u } from "../../react-compose-refs/dist/index.js";
3
3
  import { jsx as c, Fragment as d } from "react/jsx-runtime";
4
- var m = l.forwardRef((e, n) => {
5
- const { children: r, ...t } = e, o = l.Children.toArray(r), i = o.find(y);
4
+ var m = o.forwardRef((e, n) => {
5
+ const { children: r, ...t } = e, l = o.Children.toArray(r), i = l.find(y);
6
6
  if (i) {
7
- const s = i.props.children, a = o.map((p) => p === i ? l.Children.count(s) > 1 ? l.Children.only(null) : l.isValidElement(s) ? s.props.children : null : p);
8
- return /* @__PURE__ */ c(f, { ...t, ref: n, children: l.isValidElement(s) ? l.cloneElement(s, void 0, a) : null });
7
+ const s = i.props.children, a = l.map((p) => p === i ? o.Children.count(s) > 1 ? o.Children.only(null) : o.isValidElement(s) ? s.props.children : null : p);
8
+ return /* @__PURE__ */ c(f, { ...t, ref: n, children: o.isValidElement(s) ? o.cloneElement(s, void 0, a) : null });
9
9
  }
10
10
  return /* @__PURE__ */ c(f, { ...t, ref: n, children: r });
11
11
  });
12
12
  m.displayName = "Slot";
13
- var f = l.forwardRef((e, n) => {
13
+ var f = o.forwardRef((e, n) => {
14
14
  const { children: r, ...t } = e;
15
- if (l.isValidElement(r)) {
16
- const o = C(r);
17
- return l.cloneElement(r, {
15
+ if (o.isValidElement(r)) {
16
+ const l = C(r);
17
+ return o.cloneElement(r, {
18
18
  ...h(t, r.props),
19
19
  // @ts-ignore
20
- ref: n ? u(n, o) : o
20
+ ref: n ? u(n, l) : l
21
21
  });
22
22
  }
23
- return l.Children.count(r) > 1 ? l.Children.only(null) : null;
23
+ return o.Children.count(r) > 1 ? o.Children.only(null) : null;
24
24
  });
25
25
  f.displayName = "SlotClone";
26
26
  var g = ({ children: e }) => /* @__PURE__ */ c(d, { children: e });
27
27
  function y(e) {
28
- return l.isValidElement(e) && e.type === g;
28
+ return o.isValidElement(e) && e.type === g;
29
29
  }
30
30
  function h(e, n) {
31
31
  const r = { ...n };
32
32
  for (const t in n) {
33
- const o = e[t], i = n[t];
34
- /^on[A-Z]/.test(t) ? o && i ? r[t] = (...a) => {
35
- i(...a), o(...a);
36
- } : o && (r[t] = o) : t === "style" ? r[t] = { ...o, ...i } : t === "className" && (r[t] = [o, i].filter(Boolean).join(" "));
33
+ const l = e[t], i = n[t];
34
+ /^on[A-Z]/.test(t) ? l && i ? r[t] = (...a) => {
35
+ i(...a), l(...a);
36
+ } : l && (r[t] = l) : t === "style" ? r[t] = { ...l, ...i } : t === "className" && (r[t] = [l, i].filter(Boolean).join(" "));
37
37
  }
38
38
  return { ...e, ...r };
39
39
  }
40
40
  function C(e) {
41
- var t, o;
42
- let n = (t = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : t.get, r = n && "isReactWarning" in n && n.isReactWarning;
43
- return r ? e.ref : (n = (o = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : o.get, r = n && "isReactWarning" in n && n.isReactWarning, r ? e.props.ref : e.props.ref || e.ref);
41
+ let n = Object.getOwnPropertyDescriptor(e.props, "ref")?.get, r = n && "isReactWarning" in n && n.isReactWarning;
42
+ return r ? e.ref : (n = Object.getOwnPropertyDescriptor(e, "ref")?.get, r = n && "isReactWarning" in n && n.isReactWarning, r ? e.props.ref : e.props.ref || e.ref);
44
43
  }
45
44
  export {
46
45
  m as Slot,
@@ -1,128 +1,127 @@
1
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({
2
+ import { composeEventHandlers as h } from "../../primitive/dist/index.js";
3
+ import { Primitive as w, dispatchDiscreteCustomEvent as k } from "../../react-primitive/dist/index.js";
4
+ import { useComposedRefs as g } from "../../react-compose-refs/dist/index.js";
5
+ import { useCallbackRef as R } from "../../react-use-callback-ref/dist/index.js";
6
+ import { useEscapeKeydown as U } from "../../react-use-escape-keydown/dist/index.js";
7
+ import { jsx as T } from "react/jsx-runtime";
8
+ var z = "DismissableLayer", y = "dismissableLayer.update", H = "dismissableLayer.pointerDownOutside", M = "dismissableLayer.focusOutside", C, B = n.createContext({
9
9
  layers: /* @__PURE__ */ new Set(),
10
10
  layersWithOutsidePointerEventsDisabled: /* @__PURE__ */ new Set(),
11
11
  branches: /* @__PURE__ */ new Set()
12
- }), X = n.forwardRef(
13
- (r, e) => {
14
- var C;
12
+ }), K = n.forwardRef(
13
+ (s, e) => {
15
14
  const {
16
- disableOutsidePointerEvents: i = !1,
17
- onEscapeKeyDown: o,
18
- onPointerDownOutside: t,
19
- onFocusOutside: a,
20
- onInteractOutside: l,
15
+ disableOutsidePointerEvents: r = !1,
16
+ onEscapeKeyDown: a,
17
+ onPointerDownOutside: i,
18
+ onFocusOutside: c,
19
+ onInteractOutside: f,
21
20
  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(() => {
21
+ ...E
22
+ } = s, o = n.useContext(B), [u, F] = n.useState(null), l = u?.ownerDocument ?? globalThis?.document, [, I] = n.useState({}), S = g(e, (t) => F(t)), p = Array.from(o.layers), [W] = [...o.layersWithOutsidePointerEventsDisabled].slice(-1), A = p.indexOf(W), b = u ? p.indexOf(u) : -1, N = o.layersWithOutsidePointerEventsDisabled.size > 0, D = b >= A, _ = Y((t) => {
23
+ const v = t.target, P = [...o.branches].some((m) => m.contains(v));
24
+ !D || P || (i?.(t), f?.(t), t.defaultPrevented || d?.());
25
+ }, l), O = q((t) => {
26
+ const v = t.target;
27
+ [...o.branches].some((m) => m.contains(v)) || (c?.(t), f?.(t), t.defaultPrevented || d?.());
28
+ }, l);
29
+ return U((t) => {
30
+ b === o.layers.size - 1 && (a?.(t), !t.defaultPrevented && d && (t.preventDefault(), d()));
31
+ }, l), n.useEffect(() => {
33
32
  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);
33
+ return r && (o.layersWithOutsidePointerEventsDisabled.size === 0 && (C = l.body.style.pointerEvents, l.body.style.pointerEvents = "none"), o.layersWithOutsidePointerEventsDisabled.add(u)), o.layers.add(u), L(), () => {
34
+ r && o.layersWithOutsidePointerEventsDisabled.size === 1 && (l.body.style.pointerEvents = C);
36
35
  };
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,
36
+ }, [u, l, r, o]), n.useEffect(() => () => {
37
+ u && (o.layers.delete(u), o.layersWithOutsidePointerEventsDisabled.delete(u), L());
38
+ }, [u, o]), n.useEffect(() => {
39
+ const t = () => I({});
40
+ return document.addEventListener(y, t), () => document.removeEventListener(y, t);
41
+ }, []), /* @__PURE__ */ T(
42
+ w.div,
44
43
  {
45
- ...v,
46
- ref: A,
44
+ ...E,
45
+ ref: S,
47
46
  style: {
48
- pointerEvents: _ ? P ? "auto" : "none" : void 0,
49
- ...r.style
47
+ pointerEvents: N ? D ? "auto" : "none" : void 0,
48
+ ...s.style
50
49
  },
51
- onFocusCapture: m(r.onFocusCapture, D.onFocusCapture),
52
- onBlurCapture: m(r.onBlurCapture, D.onBlurCapture),
53
- onPointerDownCapture: m(
54
- r.onPointerDownCapture,
55
- k.onPointerDownCapture
50
+ onFocusCapture: h(s.onFocusCapture, O.onFocusCapture),
51
+ onBlurCapture: h(s.onBlurCapture, O.onBlurCapture),
52
+ onPointerDownCapture: h(
53
+ s.onPointerDownCapture,
54
+ _.onPointerDownCapture
56
55
  )
57
56
  }
58
57
  );
59
58
  }
60
59
  );
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);
60
+ K.displayName = z;
61
+ var j = "DismissableLayerBranch", X = n.forwardRef((s, e) => {
62
+ const r = n.useContext(B), a = n.useRef(null), i = g(e, a);
64
63
  return n.useEffect(() => {
65
- const a = o.current;
66
- if (a)
67
- return i.branches.add(a), () => {
68
- i.branches.delete(a);
64
+ const c = a.current;
65
+ if (c)
66
+ return r.branches.add(c), () => {
67
+ r.branches.delete(c);
69
68
  };
70
- }, [i.branches]), /* @__PURE__ */ B(R.div, { ...r, ref: t });
69
+ }, [r.branches]), /* @__PURE__ */ T(w.div, { ...s, ref: i });
71
70
  });
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(() => {
71
+ X.displayName = j;
72
+ function Y(s, e = globalThis?.document) {
73
+ const r = R(s), a = n.useRef(!1), i = n.useRef(() => {
75
74
  });
76
75
  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,
76
+ const c = (d) => {
77
+ if (d.target && !a.current) {
78
+ let E = function() {
79
+ x(
80
+ H,
81
+ r,
82
+ o,
84
83
  { discrete: !0 }
85
84
  );
86
85
  };
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();
86
+ const o = { originalEvent: d };
87
+ d.pointerType === "touch" ? (e.removeEventListener("click", i.current), i.current = E, e.addEventListener("click", i.current, { once: !0 })) : E();
89
88
  } else
90
- e.removeEventListener("click", t.current);
91
- o.current = !1;
92
- }, l = window.setTimeout(() => {
93
- e.addEventListener("pointerdown", a);
89
+ e.removeEventListener("click", i.current);
90
+ a.current = !1;
91
+ }, f = window.setTimeout(() => {
92
+ e.addEventListener("pointerdown", c);
94
93
  }, 0);
95
94
  return () => {
96
- window.clearTimeout(l), e.removeEventListener("pointerdown", a), e.removeEventListener("click", t.current);
95
+ window.clearTimeout(f), e.removeEventListener("pointerdown", c), e.removeEventListener("click", i.current);
97
96
  };
98
- }, [e, i]), {
97
+ }, [e, r]), {
99
98
  // ensures we check React component tree (not just DOM tree)
100
- onPointerDownCapture: () => o.current = !0
99
+ onPointerDownCapture: () => a.current = !0
101
100
  };
102
101
  }
103
- function J(r, e = globalThis == null ? void 0 : globalThis.document) {
104
- const i = T(r), o = n.useRef(!1);
102
+ function q(s, e = globalThis?.document) {
103
+ const r = R(s), a = n.useRef(!1);
105
104
  return n.useEffect(() => {
106
- const t = (a) => {
107
- a.target && !o.current && S(j, i, { originalEvent: a }, {
105
+ const i = (c) => {
106
+ c.target && !a.current && x(M, r, { originalEvent: c }, {
108
107
  discrete: !1
109
108
  });
110
109
  };
111
- return e.addEventListener("focusin", t), () => e.removeEventListener("focusin", t);
112
- }, [e, i]), {
113
- onFocusCapture: () => o.current = !0,
114
- onBlurCapture: () => o.current = !1
110
+ return e.addEventListener("focusin", i), () => e.removeEventListener("focusin", i);
111
+ }, [e, r]), {
112
+ onFocusCapture: () => a.current = !0,
113
+ onBlurCapture: () => a.current = !1
115
114
  };
116
115
  }
117
- function g() {
118
- const r = new CustomEvent(y);
119
- document.dispatchEvent(r);
116
+ function L() {
117
+ const s = new CustomEvent(y);
118
+ document.dispatchEvent(s);
120
119
  }
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);
120
+ function x(s, e, r, { discrete: a }) {
121
+ const i = r.originalEvent.target, c = new CustomEvent(s, { bubbles: !1, cancelable: !0, detail: r });
122
+ e && i.addEventListener(s, e, { once: !0 }), a ? k(i, c) : i.dispatchEvent(c);
124
123
  }
125
124
  export {
126
- X as DismissableLayer,
127
- q as DismissableLayerBranch
125
+ K as DismissableLayer,
126
+ X as DismissableLayerBranch
128
127
  };
@@ -1,18 +1,17 @@
1
- import * as u from "react";
1
+ import * as r from "react";
2
2
  var t = 0;
3
- function c() {
4
- u.useEffect(() => {
5
- var n, o;
3
+ function a() {
4
+ r.useEffect(() => {
6
5
  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--;
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--;
9
8
  };
10
9
  }, []);
11
10
  }
12
- function r() {
11
+ function n() {
13
12
  const e = document.createElement("span");
14
13
  return e.setAttribute("data-radix-focus-guard", ""), e.tabIndex = 0, e.style.cssText = "outline: none; opacity: 0; position: fixed; pointer-events: none", e;
15
14
  }
16
15
  export {
17
- c as useFocusGuards
16
+ a as useFocusGuards
18
17
  };
@@ -1,16 +1,16 @@
1
1
  import * as d from "react";
2
2
  import { useComposedRefs as R } from "../../react-compose-refs/dist/index.js";
3
3
  import { Primitive as M } from "../../react-primitive/dist/index.js";
4
- import { useCallbackRef as N } from "../../react-use-callback-ref/dist/index.js";
4
+ import { useCallbackRef as y } from "../../react-use-callback-ref/dist/index.js";
5
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) => {
6
+ var F = "focusScope.autoFocusOnMount", T = "focusScope.autoFocusOnUnmount", N = { bubbles: !1, cancelable: !0 }, K = "FocusScope", k = d.forwardRef((e, t) => {
7
7
  const {
8
- loop: t = !1,
8
+ loop: n = !1,
9
9
  trapped: u = !1,
10
10
  onMountAutoFocus: p,
11
11
  onUnmountAutoFocus: L,
12
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({
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
14
  paused: !1,
15
15
  pause() {
16
16
  this.paused = !0;
@@ -21,82 +21,82 @@ var F = "focusScope.autoFocusOnMount", T = "focusScope.autoFocusOnUnmount", y =
21
21
  }).current;
22
22
  d.useEffect(() => {
23
23
  if (u) {
24
- let o = function(i) {
25
- if (a.paused || !s) return;
24
+ let s = function(i) {
25
+ if (a.paused || !o) return;
26
26
  const c = i.target;
27
- s.contains(c) ? b.current = c : f(b.current, { select: !0 });
27
+ o.contains(c) ? b.current = c : f(b.current, { select: !0 });
28
28
  }, l = function(i) {
29
- if (a.paused || !s) return;
29
+ if (a.paused || !o) return;
30
30
  const c = i.relatedTarget;
31
- c !== null && (s.contains(c) || f(b.current, { select: !0 }));
31
+ c !== null && (o.contains(c) || f(b.current, { select: !0 }));
32
32
  }, r = function(i) {
33
33
  if (document.activeElement === document.body)
34
34
  for (const h of i)
35
- h.removedNodes.length > 0 && f(s);
35
+ h.removedNodes.length > 0 && f(o);
36
36
  };
37
- document.addEventListener("focusin", o), document.addEventListener("focusout", l);
37
+ document.addEventListener("focusin", s), document.addEventListener("focusout", l);
38
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();
39
+ return o && m.observe(o, { childList: !0, subtree: !0 }), () => {
40
+ document.removeEventListener("focusin", s), document.removeEventListener("focusout", l), m.disconnect();
41
41
  };
42
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));
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
50
  }
51
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);
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
55
  }, 0);
56
56
  };
57
57
  }
58
- }, [s, E, v, a]);
58
+ }, [o, E, v, a]);
59
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;
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
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();
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
66
  }
67
67
  },
68
- [t, u, a.paused]
68
+ [n, u, a.paused]
69
69
  );
70
70
  return /* @__PURE__ */ _(M.div, { tabIndex: -1, ...g, ref: A, onKeyDown: P });
71
71
  });
72
72
  k.displayName = K;
73
- function w(e, { select: n = !1 } = {}) {
74
- const t = document.activeElement;
73
+ function w(e, { select: t = !1 } = {}) {
74
+ const n = document.activeElement;
75
75
  for (const u of e)
76
- if (f(u, { select: n }), document.activeElement !== t) return;
76
+ if (f(u, { select: t }), document.activeElement !== n) return;
77
77
  }
78
78
  function x(e) {
79
- const n = I(e), t = O(n, e), u = O(n.reverse(), e);
80
- return [t, u];
79
+ const t = I(e), n = S(t, e), u = S(t.reverse(), e);
80
+ return [n, u];
81
81
  }
82
82
  function I(e) {
83
- const n = [], t = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
83
+ const t = [], n = document.createTreeWalker(e, NodeFilter.SHOW_ELEMENT, {
84
84
  acceptNode: (u) => {
85
85
  const p = u.tagName === "INPUT" && u.type === "hidden";
86
86
  return u.disabled || u.hidden || p ? NodeFilter.FILTER_SKIP : u.tabIndex >= 0 ? NodeFilter.FILTER_ACCEPT : NodeFilter.FILTER_SKIP;
87
87
  }
88
88
  });
89
- for (; t.nextNode(); ) n.push(t.currentNode);
90
- return n;
89
+ for (; n.nextNode(); ) t.push(n.currentNode);
90
+ return t;
91
91
  }
92
- function O(e, n) {
93
- for (const t of e)
94
- if (!D(t, { upTo: n })) return t;
92
+ function S(e, t) {
93
+ for (const n of e)
94
+ if (!D(n, { upTo: t })) return n;
95
95
  }
96
- function D(e, { upTo: n }) {
96
+ function D(e, { upTo: t }) {
97
97
  if (getComputedStyle(e).visibility === "hidden") return !0;
98
98
  for (; e; ) {
99
- if (n !== void 0 && e === n) return !1;
99
+ if (t !== void 0 && e === t) return !1;
100
100
  if (getComputedStyle(e).display === "none") return !0;
101
101
  e = e.parentElement;
102
102
  }
@@ -105,32 +105,31 @@ function D(e, { upTo: n }) {
105
105
  function H(e) {
106
106
  return e instanceof HTMLInputElement && "select" in e;
107
107
  }
108
- function f(e, { select: n = !1 } = {}) {
108
+ function f(e, { select: t = !1 } = {}) {
109
109
  if (e && e.focus) {
110
- const t = document.activeElement;
111
- e.focus({ preventScroll: !0 }), e !== t && H(e) && n && e.select();
110
+ const n = document.activeElement;
111
+ e.focus({ preventScroll: !0 }), e !== n && H(e) && t && e.select();
112
112
  }
113
113
  }
114
- var S = V();
114
+ var O = V();
115
115
  function V() {
116
116
  let e = [];
117
117
  return {
118
- add(n) {
119
- const t = e[0];
120
- n !== t && (t == null || t.pause()), e = C(e, n), e.unshift(n);
118
+ add(t) {
119
+ const n = e[0];
120
+ t !== n && n?.pause(), e = C(e, t), e.unshift(t);
121
121
  },
122
- remove(n) {
123
- var t;
124
- e = C(e, n), (t = e[0]) == null || t.resume();
122
+ remove(t) {
123
+ e = C(e, t), e[0]?.resume();
125
124
  }
126
125
  };
127
126
  }
128
- function C(e, n) {
129
- const t = [...e], u = t.indexOf(n);
130
- return u !== -1 && t.splice(u, 1), t;
127
+ function C(e, t) {
128
+ const n = [...e], u = n.indexOf(t);
129
+ return u !== -1 && n.splice(u, 1), n;
131
130
  }
132
131
  function W(e) {
133
- return e.filter((n) => n.tagName !== "A");
132
+ return e.filter((t) => t.tagName !== "A");
134
133
  }
135
134
  export {
136
135
  k as FocusScope
@@ -1,13 +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}` : "";
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}` : "";
10
10
  }
11
11
  export {
12
- a as useId
12
+ d as useId
13
13
  };