@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,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.outline = "none", e.style.opacity = "0", e.style.position = "fixed", e.style.pointerEvents = "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,16 +1,15 @@
1
- import * as r from "react";
2
- import s from "react-dom";
3
- import { Primitive as c } from "../../react-primitive/dist/index.js";
4
- import { useLayoutEffect as u } from "../../../../../react-use-layout-effect/dist/index.js";
5
- import { jsx as l } from "react/jsx-runtime";
6
- var p = "Portal", d = r.forwardRef((e, a) => {
7
- var o;
8
- const { container: f, ...i } = e, [m, n] = r.useState(!1);
9
- u(() => n(!0), []);
10
- const t = f || m && ((o = globalThis == null ? void 0 : globalThis.document) == null ? void 0 : o.body);
11
- return t ? s.createPortal(/* @__PURE__ */ l(c.div, { ...i, ref: a }), t) : null;
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;
12
11
  });
13
- d.displayName = p;
12
+ p.displayName = l;
14
13
  export {
15
- d as Portal
14
+ p as Portal
16
15
  };
@@ -1,19 +1,16 @@
1
- import * as a from "react";
2
- import { useComposedRefs as E } from "../../react-compose-refs/dist/index.js";
3
- import { useLayoutEffect as M } from "../../../../../react-use-layout-effect/dist/index.js";
4
- function T(n, e) {
5
- return a.useReducer((r, t) => {
6
- const o = e[r][t];
7
- return o != null ? o : r;
8
- }, n);
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);
9
6
  }
10
- var R = (n) => {
11
- const { present: e, children: r } = n, t = v(e), o = typeof r == "function" ? r({ present: t.isPresent }) : a.Children.only(r), c = E(t.ref, P(o));
12
- return typeof r == "function" || t.isPresent ? a.cloneElement(o, { ref: c }) : null;
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;
13
10
  };
14
- R.displayName = "Presence";
15
- function v(n) {
16
- const [e, r] = a.useState(), t = a.useRef({}), o = a.useRef(n), c = a.useRef("none"), A = n ? "mounted" : "unmounted", [N, s] = T(A, {
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, {
17
14
  mounted: {
18
15
  UNMOUNT: "unmounted",
19
16
  ANIMATION_OUT: "unmountSuspended"
@@ -26,50 +23,48 @@ function v(n) {
26
23
  MOUNT: "mounted"
27
24
  }
28
25
  });
29
- return a.useEffect(() => {
30
- const i = l(t.current);
31
- c.current = N === "mounted" ? i : "none";
32
- }, [N]), M(() => {
33
- const i = t.current, m = o.current;
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;
34
31
  if (m !== n) {
35
- const u = c.current, d = l(i);
36
- n ? s("MOUNT") : d === "none" || (i == null ? void 0 : i.display) === "none" ? s("UNMOUNT") : s(m && u !== d ? "ANIMATION_OUT" : "UNMOUNT"), o.current = 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;
37
34
  }
38
- }, [n, s]), M(() => {
39
- var i;
35
+ }, [n, s]), A(() => {
40
36
  if (e) {
41
- let m;
42
- const p = (i = e.ownerDocument.defaultView) != null ? i : window, u = (f) => {
43
- const g = l(t.current).includes(f.animationName);
44
- if (f.target === e && g && (s("ANIMATION_END"), !o.current)) {
45
- const O = e.style.animationFillMode;
46
- e.style.animationFillMode = "forwards", m = p.setTimeout(() => {
47
- e.style.animationFillMode === "forwards" && (e.style.animationFillMode = O);
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);
48
44
  });
49
45
  }
50
- }, d = (f) => {
51
- f.target === e && (c.current = l(t.current));
46
+ }, f = (u) => {
47
+ u.target === e && (c.current = l(r.current));
52
48
  };
53
- return e.addEventListener("animationstart", d), e.addEventListener("animationcancel", u), e.addEventListener("animationend", u), () => {
54
- p.clearTimeout(m), e.removeEventListener("animationstart", d), e.removeEventListener("animationcancel", u), e.removeEventListener("animationend", u);
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);
55
51
  };
56
52
  } else
57
53
  s("ANIMATION_END");
58
54
  }, [e, s]), {
59
55
  isPresent: ["mounted", "unmountSuspended"].includes(N),
60
- ref: a.useCallback((i) => {
61
- i && (t.current = getComputedStyle(i)), r(i);
56
+ ref: i.useCallback((o) => {
57
+ o && (r.current = getComputedStyle(o)), t(o);
62
58
  }, [])
63
59
  };
64
60
  }
65
61
  function l(n) {
66
- return (n == null ? void 0 : n.animationName) || "none";
62
+ return n?.animationName || "none";
67
63
  }
68
- function P(n) {
69
- var t, o;
70
- let e = (t = Object.getOwnPropertyDescriptor(n.props, "ref")) == null ? void 0 : t.get, r = e && "isReactWarning" in e && e.isReactWarning;
71
- return r ? n.ref : (e = (o = Object.getOwnPropertyDescriptor(n, "ref")) == null ? void 0 : o.get, r = e && "isReactWarning" in e && e.isReactWarning, r ? n.props.ref : n.props.ref || n.ref);
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);
72
67
  }
73
68
  export {
74
- R as Presence
69
+ T as Presence
75
70
  };
@@ -22,7 +22,7 @@ var c = [
22
22
  ], v = c.reduce((r, i) => {
23
23
  const t = s.forwardRef((o, e) => {
24
24
  const { asChild: m, ...a } = o, n = m ? p : i;
25
- return typeof window != "undefined" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ u(n, { ...a, ref: e });
25
+ return typeof window < "u" && (window[Symbol.for("radix-ui")] = !0), /* @__PURE__ */ u(n, { ...a, ref: e });
26
26
  });
27
27
  return t.displayName = `Primitive.${i}`, { ...r, [i]: t };
28
28
  }, {});