@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,133 +1,132 @@
1
1
  import * as s from "react";
2
- import { useFloating as ye, offset as Ae, shift as ve, flip as Ce, size as be, arrow as Se, hide as Oe, limitShift as Re } from "../../../@floating-ui/react-dom/dist/floating-ui.react-dom.js";
3
- import { Root as Ee } from "../../react-arrow/dist/index.js";
4
- import { useComposedRefs as Z } from "../../react-compose-refs/dist/index.js";
5
- import { createContextScope as Ne } from "../../react-context/dist/index.js";
6
- import { Primitive as U } from "../../react-primitive/dist/index.js";
7
- import { useCallbackRef as _e } from "../../react-use-callback-ref/dist/index.js";
8
- import { useLayoutEffect as L } from "../../react-use-layout-effect/dist/index.js";
9
- import { useSize as $e } from "../../react-use-size/dist/index.js";
2
+ import { useFloating as fe, offset as me, shift as he, flip as ge, size as ue, arrow as we, hide as Pe, limitShift as xe } from "../../../@floating-ui/react-dom/dist/floating-ui.react-dom.js";
3
+ import { Root as ye } from "../../react-arrow/dist/index.js";
4
+ import { useComposedRefs as I } from "../../react-compose-refs/dist/index.js";
5
+ import { createContextScope as Ae } from "../../react-context/dist/index.js";
6
+ import { Primitive as Y } from "../../react-primitive/dist/index.js";
7
+ import { useCallbackRef as ve } from "../../react-use-callback-ref/dist/index.js";
8
+ import { useLayoutEffect as z } from "../../react-use-layout-effect/dist/index.js";
9
+ import { useSize as Ce } from "../../react-use-size/dist/index.js";
10
10
  import { jsx as f } from "react/jsx-runtime";
11
- import { autoUpdate as He } from "../../../@floating-ui/dom/dist/floating-ui.dom.js";
12
- var _ = "Popper", [q, Ge] = Ne(_), [We, G] = q(_), J = (e) => {
13
- const { __scopePopper: i, children: n } = e, [t, a] = s.useState(null);
14
- return /* @__PURE__ */ f(We, { scope: i, anchor: t, onAnchorChange: a, children: n });
11
+ import { autoUpdate as Se } from "../../../@floating-ui/dom/dist/floating-ui.dom.js";
12
+ var b = "Popper", [M, ke] = Ae(b), [be, X] = M(b), D = (e) => {
13
+ const { __scopePopper: a, children: o } = e, [i, n] = s.useState(null);
14
+ return /* @__PURE__ */ f(be, { scope: a, anchor: i, onAnchorChange: n, children: o });
15
15
  };
16
- J.displayName = _;
17
- var K = "PopperAnchor", Q = s.forwardRef(
18
- (e, i) => {
19
- const { __scopePopper: n, virtualRef: t, ...a } = e, r = G(K, n), o = s.useRef(null), x = Z(i, o);
16
+ D.displayName = b;
17
+ var F = "PopperAnchor", k = s.forwardRef(
18
+ (e, a) => {
19
+ const { __scopePopper: o, virtualRef: i, ...n } = e, t = X(F, o), r = s.useRef(null), g = I(a, r);
20
20
  return s.useEffect(() => {
21
- r.onAnchorChange((t == null ? void 0 : t.current) || o.current);
22
- }), t ? null : /* @__PURE__ */ f(U.div, { ...a, ref: x });
21
+ t.onAnchorChange(i?.current || r.current);
22
+ }), i ? null : /* @__PURE__ */ f(Y.div, { ...n, ref: g });
23
23
  }
24
24
  );
25
- Q.displayName = K;
26
- var $ = "PopperContent", [Ie, Ye] = q($), V = s.forwardRef(
27
- (e, i) => {
28
- var M, X, D, F, k, B, T, j;
25
+ k.displayName = F;
26
+ var O = "PopperContent", [Oe, Re] = M(O), B = s.forwardRef(
27
+ (e, a) => {
29
28
  const {
30
- __scopePopper: n,
31
- side: t = "bottom",
32
- sideOffset: a = 0,
33
- align: r = "center",
34
- alignOffset: o = 0,
35
- arrowPadding: x = 0,
29
+ __scopePopper: o,
30
+ side: i = "bottom",
31
+ sideOffset: n = 0,
32
+ align: t = "center",
33
+ alignOffset: r = 0,
34
+ arrowPadding: g = 0,
36
35
  avoidCollisions: p = !0,
37
36
  collisionBoundary: c = [],
38
- collisionPadding: P = 0,
37
+ collisionPadding: u = 0,
39
38
  sticky: m = "partial",
40
- hideWhenDetached: A = !1,
41
- updatePositionStrategy: v = "optimized",
39
+ hideWhenDetached: P = !1,
40
+ updatePositionStrategy: x = "optimized",
42
41
  onPlaced: l,
43
42
  ...d
44
- } = e, C = G($, n), [h, b] = s.useState(null), S = Z(i, (y) => b(y)), [g, oe] = s.useState(null), u = $e(g), ne = (M = u == null ? void 0 : u.width) != null ? M : 0, H = (X = u == null ? void 0 : u.height) != null ? X : 0, ae = t + (r !== "center" ? "-" + r : ""), ie = typeof P == "number" ? P : { top: 0, right: 0, bottom: 0, left: 0, ...P }, W = Array.isArray(c) ? c : [c], se = W.length > 0, O = {
45
- padding: ie,
46
- boundary: W.filter(Xe),
43
+ } = e, Z = X(O, o), [C, U] = s.useState(null), q = I(a, (w) => U(w)), [S, G] = s.useState(null), R = Ce(S), J = R?.width ?? 0, E = R?.height ?? 0, K = i + (t !== "center" ? "-" + t : ""), Q = typeof u == "number" ? u : { top: 0, right: 0, bottom: 0, left: 0, ...u }, N = Array.isArray(c) ? c : [c], V = N.length > 0, y = {
44
+ padding: Q,
45
+ boundary: N.filter(Ne),
47
46
  // with `strategy: 'fixed'`, this is the only way to get it to respect boundaries
48
- altBoundary: se
49
- }, { refs: pe, floatingStyles: I, placement: ce, isPositioned: R, middlewareData: w } = ye({
47
+ altBoundary: V
48
+ }, { refs: ee, floatingStyles: _, placement: te, isPositioned: A, middlewareData: h } = fe({
50
49
  // default to `fixed` strategy so users don't have to pick and we also avoid focus scroll issues
51
50
  strategy: "fixed",
52
- placement: ae,
53
- whileElementsMounted: (...y) => He(...y, {
54
- animationFrame: v === "always"
51
+ placement: K,
52
+ whileElementsMounted: (...w) => Se(...w, {
53
+ animationFrame: x === "always"
55
54
  }),
56
55
  elements: {
57
- reference: C.anchor
56
+ reference: Z.anchor
58
57
  },
59
58
  middleware: [
60
- Ae({ mainAxis: a + H, alignmentAxis: o }),
61
- p && ve({
59
+ me({ mainAxis: n + E, alignmentAxis: r }),
60
+ p && he({
62
61
  mainAxis: !0,
63
62
  crossAxis: !1,
64
- limiter: m === "partial" ? Re() : void 0,
65
- ...O
63
+ limiter: m === "partial" ? xe() : void 0,
64
+ ...y
66
65
  }),
67
- p && Ce({ ...O }),
68
- be({
69
- ...O,
70
- apply: ({ elements: y, rects: z, availableWidth: ue, availableHeight: we }) => {
71
- const { width: xe, height: Pe } = z.reference, N = y.floating.style;
72
- N.setProperty("--radix-popper-available-width", `${ue}px`), N.setProperty("--radix-popper-available-height", `${we}px`), N.setProperty("--radix-popper-anchor-width", `${xe}px`), N.setProperty("--radix-popper-anchor-height", `${Pe}px`);
66
+ p && ge({ ...y }),
67
+ ue({
68
+ ...y,
69
+ apply: ({ elements: w, rects: W, availableWidth: pe, availableHeight: ce }) => {
70
+ const { width: de, height: le } = W.reference, v = w.floating.style;
71
+ v.setProperty("--radix-popper-available-width", `${pe}px`), v.setProperty("--radix-popper-available-height", `${ce}px`), v.setProperty("--radix-popper-anchor-width", `${de}px`), v.setProperty("--radix-popper-anchor-height", `${le}px`);
73
72
  }
74
73
  }),
75
- g && Se({ element: g, padding: x }),
76
- De({ arrowWidth: ne, arrowHeight: H }),
77
- A && Oe({ strategy: "referenceHidden", ...O })
74
+ S && we({ element: S, padding: g }),
75
+ _e({ arrowWidth: J, arrowHeight: E }),
76
+ P && Pe({ strategy: "referenceHidden", ...y })
78
77
  ]
79
- }), [Y, de] = re(ce), E = _e(l);
80
- L(() => {
81
- R && (E == null || E());
82
- }, [R, E]);
83
- const le = (D = w.arrow) == null ? void 0 : D.x, fe = (F = w.arrow) == null ? void 0 : F.y, me = ((k = w.arrow) == null ? void 0 : k.centerOffset) !== 0, [he, ge] = s.useState();
84
- return L(() => {
85
- h && ge(window.getComputedStyle(h).zIndex);
86
- }, [h]), /* @__PURE__ */ f(
78
+ }), [$, re] = L(te), H = ve(l);
79
+ z(() => {
80
+ A && H?.();
81
+ }, [A, H]);
82
+ const oe = h.arrow?.x, ne = h.arrow?.y, ae = h.arrow?.centerOffset !== 0, [ie, se] = s.useState();
83
+ return z(() => {
84
+ C && se(window.getComputedStyle(C).zIndex);
85
+ }, [C]), /* @__PURE__ */ f(
87
86
  "div",
88
87
  {
89
- ref: pe.setFloating,
88
+ ref: ee.setFloating,
90
89
  "data-radix-popper-content-wrapper": "",
91
90
  style: {
92
- ...I,
93
- transform: R ? I.transform : "translate(0, -200%)",
91
+ ..._,
92
+ transform: A ? _.transform : "translate(0, -200%)",
94
93
  // keep off the page when measuring
95
94
  minWidth: "max-content",
96
- zIndex: he,
95
+ zIndex: ie,
97
96
  "--radix-popper-transform-origin": [
98
- (B = w.transformOrigin) == null ? void 0 : B.x,
99
- (T = w.transformOrigin) == null ? void 0 : T.y
97
+ h.transformOrigin?.x,
98
+ h.transformOrigin?.y
100
99
  ].join(" "),
101
100
  // hide the content if using the hide middleware and should be hidden
102
101
  // set visibility to hidden and disable pointer events so the UI behaves
103
102
  // as if the PopperContent isn't there at all
104
- ...((j = w.hide) == null ? void 0 : j.referenceHidden) && {
103
+ ...h.hide?.referenceHidden && {
105
104
  visibility: "hidden",
106
105
  pointerEvents: "none"
107
106
  }
108
107
  },
109
108
  dir: e.dir,
110
109
  children: /* @__PURE__ */ f(
111
- Ie,
110
+ Oe,
112
111
  {
113
- scope: n,
114
- placedSide: Y,
115
- onArrowChange: oe,
116
- arrowX: le,
117
- arrowY: fe,
118
- shouldHideArrow: me,
112
+ scope: o,
113
+ placedSide: $,
114
+ onArrowChange: G,
115
+ arrowX: oe,
116
+ arrowY: ne,
117
+ shouldHideArrow: ae,
119
118
  children: /* @__PURE__ */ f(
120
- U.div,
119
+ Y.div,
121
120
  {
122
- "data-side": Y,
123
- "data-align": de,
121
+ "data-side": $,
122
+ "data-align": re,
124
123
  ...d,
125
- ref: S,
124
+ ref: q,
126
125
  style: {
127
126
  ...d.style,
128
127
  // if the PopperContent hasn't been placed yet (not all measurements done)
129
128
  // we prevent animations so that users's animation don't kick in too early referring wrong sides
130
- animation: R ? void 0 : "none"
129
+ animation: A ? void 0 : "none"
131
130
  }
132
131
  }
133
132
  )
@@ -137,14 +136,14 @@ var $ = "PopperContent", [Ie, Ye] = q($), V = s.forwardRef(
137
136
  );
138
137
  }
139
138
  );
140
- V.displayName = $;
141
- var ee = "PopperArrow", Me = {
139
+ B.displayName = O;
140
+ var T = "PopperArrow", Ee = {
142
141
  top: "bottom",
143
142
  right: "left",
144
143
  bottom: "top",
145
144
  left: "right"
146
- }, te = s.forwardRef(function(i, n) {
147
- const { __scopePopper: t, ...a } = i, r = Ye(ee, t), o = Me[r.placedSide];
145
+ }, j = s.forwardRef(function(a, o) {
146
+ const { __scopePopper: i, ...n } = a, t = Re(T, i), r = Ee[t.placedSide];
148
147
  return (
149
148
  // we have to use an extra wrapper because `ResizeObserver` (used by `useSize`)
150
149
  // doesn't report size as we'd expect on SVG elements.
@@ -152,33 +151,33 @@ var ee = "PopperArrow", Me = {
152
151
  /* @__PURE__ */ f(
153
152
  "span",
154
153
  {
155
- ref: r.onArrowChange,
154
+ ref: t.onArrowChange,
156
155
  style: {
157
156
  position: "absolute",
158
- left: r.arrowX,
159
- top: r.arrowY,
160
- [o]: 0,
157
+ left: t.arrowX,
158
+ top: t.arrowY,
159
+ [r]: 0,
161
160
  transformOrigin: {
162
161
  top: "",
163
162
  right: "0 0",
164
163
  bottom: "center 0",
165
164
  left: "100% 0"
166
- }[r.placedSide],
165
+ }[t.placedSide],
167
166
  transform: {
168
167
  top: "translateY(100%)",
169
168
  right: "translateY(50%) rotate(90deg) translateX(-50%)",
170
169
  bottom: "rotate(180deg)",
171
170
  left: "translateY(50%) rotate(-90deg) translateX(50%)"
172
- }[r.placedSide],
173
- visibility: r.shouldHideArrow ? "hidden" : void 0
171
+ }[t.placedSide],
172
+ visibility: t.shouldHideArrow ? "hidden" : void 0
174
173
  },
175
174
  children: /* @__PURE__ */ f(
176
- Ee,
175
+ ye,
177
176
  {
178
- ...a,
179
- ref: n,
177
+ ...n,
178
+ ref: o,
180
179
  style: {
181
- ...a.style,
180
+ ...n.style,
182
181
  // ensures the element can be measured correctly (mostly for if SVG)
183
182
  display: "block"
184
183
  }
@@ -188,33 +187,32 @@ var ee = "PopperArrow", Me = {
188
187
  )
189
188
  );
190
189
  });
191
- te.displayName = ee;
192
- function Xe(e) {
190
+ j.displayName = T;
191
+ function Ne(e) {
193
192
  return e !== null;
194
193
  }
195
- var De = (e) => ({
194
+ var _e = (e) => ({
196
195
  name: "transformOrigin",
197
196
  options: e,
198
- fn(i) {
199
- var C, h, b, S, g;
200
- const { placement: n, rects: t, middlewareData: a } = i, o = ((C = a.arrow) == null ? void 0 : C.centerOffset) !== 0, x = o ? 0 : e.arrowWidth, p = o ? 0 : e.arrowHeight, [c, P] = re(n), m = { start: "0%", center: "50%", end: "100%" }[P], A = ((b = (h = a.arrow) == null ? void 0 : h.x) != null ? b : 0) + x / 2, v = ((g = (S = a.arrow) == null ? void 0 : S.y) != null ? g : 0) + p / 2;
197
+ fn(a) {
198
+ const { placement: o, rects: i, middlewareData: n } = a, r = n.arrow?.centerOffset !== 0, g = r ? 0 : e.arrowWidth, p = r ? 0 : e.arrowHeight, [c, u] = L(o), m = { start: "0%", center: "50%", end: "100%" }[u], P = (n.arrow?.x ?? 0) + g / 2, x = (n.arrow?.y ?? 0) + p / 2;
201
199
  let l = "", d = "";
202
- return c === "bottom" ? (l = o ? m : `${A}px`, d = `${-p}px`) : c === "top" ? (l = o ? m : `${A}px`, d = `${t.floating.height + p}px`) : c === "right" ? (l = `${-p}px`, d = o ? m : `${v}px`) : c === "left" && (l = `${t.floating.width + p}px`, d = o ? m : `${v}px`), { data: { x: l, y: d } };
200
+ return c === "bottom" ? (l = r ? m : `${P}px`, d = `${-p}px`) : c === "top" ? (l = r ? m : `${P}px`, d = `${i.floating.height + p}px`) : c === "right" ? (l = `${-p}px`, d = r ? m : `${x}px`) : c === "left" && (l = `${i.floating.width + p}px`, d = r ? m : `${x}px`), { data: { x: l, y: d } };
203
201
  }
204
202
  });
205
- function re(e) {
206
- const [i, n = "center"] = e.split("-");
207
- return [i, n];
203
+ function L(e) {
204
+ const [a, o = "center"] = e.split("-");
205
+ return [a, o];
208
206
  }
209
- var Je = J, Ke = Q, Qe = V, Ve = te;
207
+ var Be = D, Te = k, je = B, Le = j;
210
208
  export {
211
- Ke as Anchor,
212
- Ve as Arrow,
213
- Qe as Content,
214
- J as Popper,
215
- Q as PopperAnchor,
216
- te as PopperArrow,
217
- V as PopperContent,
218
- Je as Root,
219
- Ge as createPopperScope
209
+ Te as Anchor,
210
+ Le as Arrow,
211
+ je as Content,
212
+ D as Popper,
213
+ k as PopperAnchor,
214
+ j as PopperArrow,
215
+ B as PopperContent,
216
+ Be as Root,
217
+ ke as createPopperScope
220
218
  };
@@ -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,20 +1,17 @@
1
- import * as a from "react";
1
+ import * as i from "react";
2
2
  import * as g from "react-dom";
3
3
  import { useComposedRefs as O } from "../../react-compose-refs/dist/index.js";
4
- import { useLayoutEffect as l } from "../../react-use-layout-effect/dist/index.js";
5
- function E(e, n) {
6
- return a.useReducer((o, r) => {
7
- const i = n[o][r];
8
- return i != null ? i : o;
9
- }, e);
4
+ import { useLayoutEffect as A } from "../../react-use-layout-effect/dist/index.js";
5
+ function E(n, e) {
6
+ return i.useReducer((t, o) => e[t][o] ?? t, n);
10
7
  }
11
- var M = (e) => {
12
- const { present: n, children: o } = e, r = R(n), i = typeof o == "function" ? o({ present: r.isPresent }) : a.Children.only(o), c = O(r.ref, T(i));
13
- return typeof o == "function" || r.isPresent ? a.cloneElement(i, { ref: c }) : null;
8
+ var M = (n) => {
9
+ const { present: e, children: t } = n, o = R(e), a = typeof t == "function" ? t({ present: o.isPresent }) : i.Children.only(t), c = O(o.ref, y(a));
10
+ return typeof t == "function" || o.isPresent ? i.cloneElement(a, { ref: c }) : null;
14
11
  };
15
12
  M.displayName = "Presence";
16
- function R(e) {
17
- const [n, o] = a.useState(), r = a.useRef({}), i = a.useRef(e), c = a.useRef("none"), p = e ? "mounted" : "unmounted", [N, s] = E(p, {
13
+ function R(n) {
14
+ const [e, t] = i.useState(), o = i.useRef({}), a = i.useRef(n), c = i.useRef("none"), l = n ? "mounted" : "unmounted", [N, s] = E(l, {
18
15
  mounted: {
19
16
  UNMOUNT: "unmounted",
20
17
  ANIMATION_OUT: "unmountSuspended"
@@ -27,42 +24,41 @@ function R(e) {
27
24
  MOUNT: "mounted"
28
25
  }
29
26
  });
30
- return a.useEffect(() => {
31
- const t = d(r.current);
32
- c.current = N === "mounted" ? t : "none";
33
- }, [N]), l(() => {
34
- const t = r.current, u = i.current;
35
- if (u !== e) {
36
- const A = c.current, f = d(t);
37
- e ? s("MOUNT") : f === "none" || (t == null ? void 0 : t.display) === "none" ? s("UNMOUNT") : s(u && A !== f ? "ANIMATION_OUT" : "UNMOUNT"), i.current = e;
27
+ return i.useEffect(() => {
28
+ const r = d(o.current);
29
+ c.current = N === "mounted" ? r : "none";
30
+ }, [N]), A(() => {
31
+ const r = o.current, u = a.current;
32
+ if (u !== n) {
33
+ const p = c.current, f = d(r);
34
+ n ? s("MOUNT") : f === "none" || r?.display === "none" ? s("UNMOUNT") : s(u && p !== f ? "ANIMATION_OUT" : "UNMOUNT"), a.current = n;
38
35
  }
39
- }, [e, s]), l(() => {
40
- if (n) {
41
- const t = (m) => {
42
- const f = d(r.current).includes(m.animationName);
43
- m.target === n && f && g.flushSync(() => s("ANIMATION_END"));
36
+ }, [n, s]), A(() => {
37
+ if (e) {
38
+ const r = (m) => {
39
+ const f = d(o.current).includes(m.animationName);
40
+ m.target === e && f && g.flushSync(() => s("ANIMATION_END"));
44
41
  }, u = (m) => {
45
- m.target === n && (c.current = d(r.current));
42
+ m.target === e && (c.current = d(o.current));
46
43
  };
47
- return n.addEventListener("animationstart", u), n.addEventListener("animationcancel", t), n.addEventListener("animationend", t), () => {
48
- n.removeEventListener("animationstart", u), n.removeEventListener("animationcancel", t), n.removeEventListener("animationend", t);
44
+ return e.addEventListener("animationstart", u), e.addEventListener("animationcancel", r), e.addEventListener("animationend", r), () => {
45
+ e.removeEventListener("animationstart", u), e.removeEventListener("animationcancel", r), e.removeEventListener("animationend", r);
49
46
  };
50
47
  } else
51
48
  s("ANIMATION_END");
52
- }, [n, s]), {
49
+ }, [e, s]), {
53
50
  isPresent: ["mounted", "unmountSuspended"].includes(N),
54
- ref: a.useCallback((t) => {
55
- t && (r.current = getComputedStyle(t)), o(t);
51
+ ref: i.useCallback((r) => {
52
+ r && (o.current = getComputedStyle(r)), t(r);
56
53
  }, [])
57
54
  };
58
55
  }
59
- function d(e) {
60
- return (e == null ? void 0 : e.animationName) || "none";
56
+ function d(n) {
57
+ return n?.animationName || "none";
61
58
  }
62
- function T(e) {
63
- var r, i;
64
- let n = (r = Object.getOwnPropertyDescriptor(e.props, "ref")) == null ? void 0 : r.get, o = n && "isReactWarning" in n && n.isReactWarning;
65
- return o ? e.ref : (n = (i = Object.getOwnPropertyDescriptor(e, "ref")) == null ? void 0 : i.get, o = n && "isReactWarning" in n && n.isReactWarning, o ? e.props.ref : e.props.ref || e.ref);
59
+ function y(n) {
60
+ let e = Object.getOwnPropertyDescriptor(n.props, "ref")?.get, t = e && "isReactWarning" in e && e.isReactWarning;
61
+ 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);
66
62
  }
67
63
  export {
68
64
  M as Presence
@@ -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
  }, {});