@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,60 +1,58 @@
1
- import { jsx as r, Fragment as k, jsxs as u } from "react/jsx-runtime";
2
- import { getCommonProps as y, findChildrenOfType as R, px as h } from "../../../utils/index.js";
3
- import b from "../../../node_modules/classnames/index.js";
4
- import l, { forwardRef as w, useState as E } from "react";
5
- import { TextVariants as N } from "../../Text/types.js";
6
- import C from "../../Text/Text.js";
7
- import L from "../NavigationList/NavigationList.js";
8
- import M from "../../Accordion/Accordion.js";
9
- import A from "../../Accordion/AccordionItem.js";
10
- import { SSRMediaQuery as v } from "../../../providers/SeldonProvider/utils.js";
11
- import { AccordionItemVariant as H } from "../../Accordion/types.js";
12
- import { HeaderContext as x } from "../../../site-furniture/Header/Header.js";
13
- import I from "../../../node_modules/react-remove-scroll/dist/es2015/Combination.js";
14
- const O = ({ id: m, label: i, children: c }) => {
15
- const { isMenuOpen: d } = l.useContext(x);
16
- return /* @__PURE__ */ r(M, { children: /* @__PURE__ */ r(
17
- A,
1
+ import { jsx as e, Fragment as _, jsxs as u } from "react/jsx-runtime";
2
+ import { getCommonProps as $, findChildrenOfType as b, px as f } from "../../../utils/index.js";
3
+ import k from "../../../node_modules/classnames/index.js";
4
+ import a, { forwardRef as M, useState as I } from "react";
5
+ import { TextVariants as h } from "../../Text/types.js";
6
+ import v from "../../Text/Text.js";
7
+ import O from "../NavigationList/NavigationList.js";
8
+ import S from "../../Accordion/Accordion.js";
9
+ import y from "../../Accordion/AccordionItem.js";
10
+ import { SSRMediaQuery as g } from "../../../providers/SeldonProvider/utils.js";
11
+ import { AccordionItemVariant as R } from "../../Accordion/types.js";
12
+ import { HeaderContext as N } from "../../../site-furniture/Header/Header.js";
13
+ import w from "../../../node_modules/react-remove-scroll/dist/es2015/Combination.js";
14
+ const E = ({ id: n, label: o, children: m }) => {
15
+ const { isMenuOpen: s } = a.useContext(N);
16
+ return /* @__PURE__ */ e(S, { children: /* @__PURE__ */ e(
17
+ y,
18
18
  {
19
19
  hasTransition: !0,
20
- id: `accordion-item-${m}`,
21
- label: /* @__PURE__ */ r(C, { variant: N.snwHeaderLink, children: i }),
22
- variant: H.lg,
23
- children: c
20
+ id: `accordion-item-${n}`,
21
+ label: /* @__PURE__ */ e(v, { variant: h.snwHeaderLink, children: o }),
22
+ variant: R.lg,
23
+ children: m
24
24
  },
25
- `accordion-key-${i}`
26
- ) }, `accordion-key-${i}-${d}`);
27
- }, P = w(
28
- ({ id: m, label: i, children: c, className: d, onClick: T, ..._ }, $) => {
29
- const { className: s, ...g } = y({ id: m }, "NavigationItemTrigger"), [p, o] = E(!1), t = R(c, L), { closeMenu: a } = l.useContext(x);
30
- return /* @__PURE__ */ r(k, { children: /* @__PURE__ */ u(I, { enabled: p, allowPinchZoom: !0, removeScrollBar: !1, children: [
31
- /* @__PURE__ */ r(v.Media, { lessThan: "md", children: /* @__PURE__ */ r(O, { id: m, label: i, ...g, children: t ? l.cloneElement(t[0], {
32
- className: `${s}__submenu--mobile`,
33
- onClick: (f) => {
34
- var e, n;
35
- (n = (e = t[0].props) == null ? void 0 : e.onClick) == null || n.call(e, f), o == null || o(!1), a == null || a();
25
+ `accordion-key-${o}`
26
+ ) }, `accordion-key-${o}-${s}`);
27
+ }, L = M(
28
+ ({ id: n, label: o, children: m, className: s, onClick: C, ...x }, T) => {
29
+ const { className: t, ...d } = $({ id: n }, "NavigationItemTrigger"), [l, i] = I(!1), r = b(m, O), { closeMenu: p } = a.useContext(N);
30
+ return /* @__PURE__ */ e(_, { children: /* @__PURE__ */ u(w, { enabled: l, allowPinchZoom: !0, removeScrollBar: !1, children: [
31
+ /* @__PURE__ */ e(g.Media, { lessThan: "md", children: /* @__PURE__ */ e(E, { id: n, label: o, ...d, children: r ? a.cloneElement(r[0], {
32
+ className: `${t}__submenu--mobile`,
33
+ onClick: (c) => {
34
+ r[0].props?.onClick?.(c), i?.(!1), p?.();
36
35
  }
37
36
  }) : null }) }),
38
- /* @__PURE__ */ r(v.Media, { greaterThanOrEqual: "md", children: /* @__PURE__ */ u(
37
+ /* @__PURE__ */ e(g.Media, { greaterThanOrEqual: "md", children: /* @__PURE__ */ u(
39
38
  "li",
40
39
  {
41
- ...g,
42
- ref: $,
43
- "aria-expanded": p,
44
- className: b(d, s, `${h}-nav__item`, {
45
- [`${s}--hovered`]: p
40
+ ...d,
41
+ ref: T,
42
+ "aria-expanded": l,
43
+ className: k(s, t, `${f}-nav__item`, {
44
+ [`${t}--hovered`]: l
46
45
  }),
47
- onClick: T,
48
- onMouseOver: () => o(!0),
49
- onMouseOut: () => o(!1),
50
- ..._,
46
+ onClick: C,
47
+ onMouseOver: () => i(!0),
48
+ onMouseOut: () => i(!1),
49
+ ...x,
51
50
  children: [
52
- /* @__PURE__ */ r("button", { className: `${h}-nav__item-trigger`, type: "button", children: /* @__PURE__ */ r(C, { variant: N.snwHeaderLink, children: i }) }),
53
- t ? l.cloneElement(t[0], {
54
- className: `${s}__submenu`,
55
- onClick: (f) => {
56
- var e, n;
57
- (n = (e = t[0].props) == null ? void 0 : e.onClick) == null || n.call(e, f), o == null || o(!1), a == null || a();
51
+ /* @__PURE__ */ e("button", { className: `${f}-nav__item-trigger`, type: "button", children: /* @__PURE__ */ e(v, { variant: h.snwHeaderLink, children: o }) }),
52
+ r ? a.cloneElement(r[0], {
53
+ className: `${t}__submenu`,
54
+ onClick: (c) => {
55
+ r[0].props?.onClick?.(c), i?.(!1), p?.();
58
56
  }
59
57
  }) : null
60
58
  ]
@@ -63,7 +61,7 @@ const O = ({ id: m, label: i, children: c }) => {
63
61
  ] }) });
64
62
  }
65
63
  );
66
- P.displayName = "NavigationItemTrigger";
64
+ L.displayName = "NavigationItemTrigger";
67
65
  export {
68
- P as default
66
+ L as default
69
67
  };
@@ -1,53 +1,51 @@
1
- import { jsxs as m, jsx as c } from "react/jsx-runtime";
2
- import * as n from "react";
3
- import { px as e } from "../../../utils/index.js";
4
- import p from "../../../node_modules/classnames/index.js";
5
- import { TextVariants as N } from "../../Text/types.js";
6
- import $ from "../../Text/Text.js";
7
- const x = n.forwardRef(
8
- ({ id: v, children: i, className: g, isOffScreen: f, leftSectionHeading: d, rightSectionHeading: u, onClick: s }, h) => {
9
- const o = n.Children.toArray(i).map((t) => {
10
- if (n.isValidElement(t) && t.props.navGroup === "nav-link-start")
11
- return n.cloneElement(t, {
12
- onClick: (r) => {
13
- var a, l;
14
- s == null || s(r), (l = (a = t.props) == null ? void 0 : a.onClick) == null || l.call(a, r);
1
+ import { jsxs as r, jsx as f } from "react/jsx-runtime";
2
+ import * as a from "react";
3
+ import { px as n } from "../../../utils/index.js";
4
+ import o from "../../../node_modules/classnames/index.js";
5
+ import { TextVariants as d } from "../../Text/types.js";
6
+ import u from "../../Text/Text.js";
7
+ const g = a.forwardRef(
8
+ ({ id: _, children: s, className: N, isOffScreen: m, leftSectionHeading: p, rightSectionHeading: c, onClick: v }, $) => {
9
+ const l = a.Children.toArray(s).map((t) => {
10
+ if (a.isValidElement(t) && t.props.navGroup === "nav-link-start")
11
+ return a.cloneElement(t, {
12
+ onClick: (e) => {
13
+ v?.(e), t.props?.onClick?.(e);
15
14
  }
16
15
  });
17
- }).filter(Boolean), _ = n.Children.toArray(i).map((t) => {
18
- if (n.isValidElement(t) && t.props.navGroup === "nav-link-end")
19
- return n.cloneElement(t, {
20
- onClick: (r) => {
21
- var a, l;
22
- s == null || s(r), (l = (a = t.props) == null ? void 0 : a.onClick) == null || l.call(a, r);
16
+ }).filter(Boolean), i = a.Children.toArray(s).map((t) => {
17
+ if (a.isValidElement(t) && t.props.navGroup === "nav-link-end")
18
+ return a.cloneElement(t, {
19
+ onClick: (e) => {
20
+ v?.(e), t.props?.onClick?.(e);
23
21
  }
24
22
  });
25
23
  }).filter(Boolean);
26
- return /* @__PURE__ */ m(
24
+ return /* @__PURE__ */ r(
27
25
  "ul",
28
26
  {
29
- "aria-hidden": f,
30
- id: v,
31
- "data-testid": v,
27
+ "aria-hidden": m,
28
+ id: _,
29
+ "data-testid": _,
32
30
  role: "list",
33
- className: p(g, `${e}-nav__list`, { [`${e}-nav__list--offscreen`]: f }),
34
- ref: h,
31
+ className: o(N, `${n}-nav__list`, { [`${n}-nav__list--offscreen`]: m }),
32
+ ref: $,
35
33
  children: [
36
- o.length > 0 ? /* @__PURE__ */ m("div", { className: p(`${e}-nav__list__section`, `${e}-nav__list__section--start`), children: [
37
- d ? /* @__PURE__ */ c($, { variant: N.heading4, className: `${e}-nav__list__section--start__title`, children: d }) : null,
38
- o
34
+ l.length > 0 ? /* @__PURE__ */ r("div", { className: o(`${n}-nav__list__section`, `${n}-nav__list__section--start`), children: [
35
+ p ? /* @__PURE__ */ f(u, { variant: d.heading4, className: `${n}-nav__list__section--start__title`, children: p }) : null,
36
+ l
39
37
  ] }) : null,
40
- _.length > 0 ? /* @__PURE__ */ m("div", { className: p(`${e}-nav__list__section`, `${e}-nav__list__section--end`), children: [
41
- u ? /* @__PURE__ */ c($, { variant: N.heading4, className: `${e}-nav__list__section--end__title`, children: u }) : null,
42
- _
38
+ i.length > 0 ? /* @__PURE__ */ r("div", { className: o(`${n}-nav__list__section`, `${n}-nav__list__section--end`), children: [
39
+ c ? /* @__PURE__ */ f(u, { variant: d.heading4, className: `${n}-nav__list__section--end__title`, children: c }) : null,
40
+ i
43
41
  ] }) : null,
44
- !o.length && !_.length ? i : null
42
+ !l.length && !i.length ? s : null
45
43
  ]
46
44
  }
47
45
  );
48
46
  }
49
47
  );
50
- x.displayName = "NavigationList";
48
+ g.displayName = "NavigationList";
51
49
  export {
52
- x as default
50
+ g as default
53
51
  };
@@ -1,6 +1,6 @@
1
1
  import { jsxs as k, jsx as o } from "react/jsx-runtime";
2
2
  import { useMemo as B } from "react";
3
- import v from "../../node_modules/classnames/index.js";
3
+ import b from "../../node_modules/classnames/index.js";
4
4
  import { getCommonProps as T, px as u } from "../../utils/index.js";
5
5
  import F from "../Select/Select.js";
6
6
  import x from "../../assets/chevronRight.svg.js";
@@ -17,7 +17,7 @@ const L = ({
17
17
  isDisabled: m,
18
18
  previousLabel: C = "Previous",
19
19
  nextLabel: N = "Next",
20
- selectLabel: b = "Select",
20
+ selectLabel: v = "Select",
21
21
  ...s
22
22
  }) => {
23
23
  const O = "pagination", { className: c, ...I } = T(s, "Pagination"), { id: p } = s, { pendingState: _, setPendingState: w } = R(i(g)), f = _ || g, d = (e, r) => {
@@ -30,14 +30,14 @@ const L = ({
30
30
  return /* @__PURE__ */ k(
31
31
  "div",
32
32
  {
33
- className: v(`${u}-${O}`, { [`${c}__wrapper`]: c }, $),
33
+ className: b(`${u}-${O}`, { [`${c}__wrapper`]: c }, $),
34
34
  ...I,
35
35
  ...s,
36
36
  children: [
37
37
  /* @__PURE__ */ o(
38
38
  y,
39
39
  {
40
- className: v(`${c}__button`, `${u}-left-arrow`),
40
+ className: b(`${c}__button`, `${u}-left-arrow`),
41
41
  onClick: (e) => {
42
42
  typeof t == "object" && t.href && e.preventDefault(), d(t);
43
43
  },
@@ -54,15 +54,15 @@ const L = ({
54
54
  F,
55
55
  {
56
56
  className: j === "inline" ? `${u}--inline-pagination` : void 0,
57
- "aria-label": b,
57
+ "aria-label": v,
58
58
  value: f,
59
59
  onChange: (e) => {
60
- const r = M(a, e == null ? void 0 : e.currentTarget.value);
60
+ const r = M(a, e?.currentTarget.value);
61
61
  r && d(r, e);
62
62
  },
63
63
  "data-testid": `${p}-select-button`,
64
64
  hideLabel: !0,
65
- labelText: b,
65
+ labelText: v,
66
66
  disabled: m,
67
67
  showIcon: !1,
68
68
  children: a.map((e) => {
@@ -1,4 +1,4 @@
1
- const n = (e) => typeof e == "string" || typeof e == "number" ? e : e == null ? void 0 : e.value, f = (e, r) => e.find(
1
+ const n = (e) => typeof e == "string" || typeof e == "number" ? e : e?.value, f = (e, r) => e.find(
2
2
  (t) => n(t) === r || n(t) === parseInt(r)
3
3
  );
4
4
  export {
@@ -1,66 +1,63 @@
1
- import { jsx as S } from "react/jsx-runtime";
2
- import { useState as j, useRef as y, useEffect as I, useCallback as V, isValidElement as W, cloneElement as q } from "react";
3
- import { getCommonProps as v } from "../../utils/index.js";
4
- import { TransformWrapper as B, TransformComponent as D } from "../../node_modules/react-zoom-pan-pinch/dist/index.esm.js";
5
- import T from "../../node_modules/classnames/index.js";
6
- const F = ({
1
+ import { jsx as p } from "react/jsx-runtime";
2
+ import { useState as X, useRef as h, useEffect as w, useCallback as C, isValidElement as E, cloneElement as $ } from "react";
3
+ import { getCommonProps as k } from "../../utils/index.js";
4
+ import { TransformWrapper as z, TransformComponent as M } from "../../node_modules/react-zoom-pan-pinch/dist/index.esm.js";
5
+ import d from "../../node_modules/classnames/index.js";
6
+ const g = ({
7
7
  onZoomChange: s,
8
- onAtLeftEdge: r,
9
- onAtRightEdge: e,
10
- children: a,
11
- maxZoom: X = 10,
12
- className: w,
13
- isZoomReset: p = !1,
14
- ...f
8
+ onAtLeftEdge: m,
9
+ onAtRightEdge: l,
10
+ children: e,
11
+ maxZoom: u = 10,
12
+ className: b,
13
+ isZoomReset: n = !1,
14
+ ...i
15
15
  }) => {
16
- var b;
17
- const { className: l, ...$ } = v(f, "PinchZoom"), [i, m] = j(!1), u = y(null);
18
- I(() => {
19
- var t;
20
- p && ((t = u.current) == null || t.resetTransform(), m(!1), s == null || s(!1));
21
- }, [p, s]);
22
- const k = V(
23
- (t) => {
24
- var o, N, d, x;
25
- const { state: c, instance: P } = t;
26
- c.scale > 0.99 && c.scale < 1.01 ? (m(!1), s == null || s(!1)) : (m(!0), s == null || s(!0));
27
- const z = Math.abs(c.positionX - ((N = (o = P.bounds) == null ? void 0 : o.maxPositionX) != null ? N : 0)) < 0.01, M = Math.abs(c.positionX - ((x = (d = P.bounds) == null ? void 0 : d.minPositionX) != null ? x : 0)) < 0.01;
28
- r == null || r(z), e == null || e(M);
16
+ const { className: o, ...P } = k(i, "PinchZoom"), [t, r] = X(!1), c = h(null);
17
+ w(() => {
18
+ n && (c.current?.resetTransform(), r(!1), s?.(!1));
19
+ }, [n, s]);
20
+ const N = C(
21
+ (x) => {
22
+ const { state: a, instance: f } = x;
23
+ a.scale > 0.99 && a.scale < 1.01 ? (r(!1), s?.(!1)) : (r(!0), s?.(!0));
24
+ const S = Math.abs(a.positionX - (f.bounds?.maxPositionX ?? 0)) < 0.01, T = Math.abs(a.positionX - (f.bounds?.minPositionX ?? 0)) < 0.01;
25
+ m?.(S), l?.(T);
29
26
  },
30
- [s, r, e]
27
+ [s, m, l]
31
28
  );
32
- return /* @__PURE__ */ S(
33
- B,
29
+ return /* @__PURE__ */ p(
30
+ z,
34
31
  {
35
- maxScale: X,
36
- onTransformed: k,
32
+ maxScale: u,
33
+ onTransformed: N,
37
34
  minScale: 1,
38
35
  disablePadding: !0,
39
36
  doubleClick: {
40
- mode: i ? "reset" : "toggle"
37
+ mode: t ? "reset" : "toggle"
41
38
  },
42
39
  wheel: {
43
40
  smoothStep: 0.01
44
41
  },
45
42
  panning: {
46
- disabled: !i
43
+ disabled: !t
47
44
  },
48
- ref: u,
49
- children: /* @__PURE__ */ S(
50
- D,
45
+ ref: c,
46
+ children: /* @__PURE__ */ p(
47
+ M,
51
48
  {
52
- wrapperProps: { ...$, ...f },
53
- wrapperClass: T(l, w, {
54
- [`${l}-zoomed`]: i
49
+ wrapperProps: { ...P, ...i },
50
+ wrapperClass: d(o, b, {
51
+ [`${o}-zoomed`]: t
55
52
  }),
56
- contentClass: `${l}-content`,
57
- children: W(a) ? q(a, { className: T(`${l}-child`, (b = a == null ? void 0 : a.props) == null ? void 0 : b.className) }) : a
53
+ contentClass: `${o}-content`,
54
+ children: E(e) ? $(e, { className: d(`${o}-child`, e?.props?.className) }) : e
58
55
  }
59
56
  )
60
57
  }
61
58
  );
62
59
  };
63
- F.displayName = "PinchZoom";
60
+ g.displayName = "PinchZoom";
64
61
  export {
65
- F as default
62
+ g as default
66
63
  };
@@ -1,154 +1,150 @@
1
- import { jsx as t, jsxs as u } from "react/jsx-runtime";
2
- import c, { useEffect as V } from "react";
3
- import { getCommonProps as j, px as D, encodeURLSearchParams as N } from "../../utils/index.js";
4
- import _ from "../../node_modules/classnames/index.js";
5
- import H from "../Input/Input.js";
6
- import O from "../Link/Link.js";
7
- import A from "./SearchResults/SearchResults.js";
8
- import { TextVariants as F } from "../Text/types.js";
9
- import K from "../Text/Text.js";
10
- import { useOnClickOutside as M } from "../../node_modules/usehooks-ts/dist/index.js";
11
- import { HeaderContext as U } from "../../site-furniture/Header/Header.js";
12
- import { SearchButton as Z } from "./SearchButton.js";
13
- import q from "../../node_modules/react-remove-scroll/dist/es2015/Combination.js";
14
- import z from "../../node_modules/react-transition-group/esm/CSSTransition.js";
15
- const ie = ({
16
- onSearch: S,
17
- onCancel: i,
18
- searchResults: I = [],
19
- state: l = "idle",
20
- defaultValue: E = "",
21
- className: b,
22
- placeholder: w = "",
23
- searchButtonText: d = "Search",
24
- loadingText: C = "Search In Progress...",
25
- invalidText: P = "Invalid search",
26
- getAllResultsText: k = (r) => `View all results for ${r}`,
27
- getAllResultsLink: v = (r) => `/Search?Search=${r}`,
28
- ...x
1
+ import { jsx as t, jsxs as h } from "react/jsx-runtime";
2
+ import s, { useEffect as T } from "react";
3
+ import { getCommonProps as y, px as V, encodeURLSearchParams as $ } from "../../utils/index.js";
4
+ import p from "../../node_modules/classnames/index.js";
5
+ import j from "../Input/Input.js";
6
+ import D from "../Link/Link.js";
7
+ import H from "./SearchResults/SearchResults.js";
8
+ import { TextVariants as O } from "../Text/types.js";
9
+ import A from "../Text/Text.js";
10
+ import { useOnClickOutside as F } from "../../node_modules/usehooks-ts/dist/index.js";
11
+ import { HeaderContext as K } from "../../site-furniture/Header/Header.js";
12
+ import { SearchButton as M } from "./SearchButton.js";
13
+ import U from "../../node_modules/react-remove-scroll/dist/es2015/Combination.js";
14
+ import Z from "../../node_modules/react-transition-group/esm/CSSTransition.js";
15
+ const oe = ({
16
+ onSearch: u,
17
+ onCancel: _,
18
+ searchResults: R = [],
19
+ state: i = "idle",
20
+ defaultValue: C = "",
21
+ className: N,
22
+ placeholder: I = "",
23
+ searchButtonText: c = "Search",
24
+ loadingText: E = "Search In Progress...",
25
+ invalidText: b = "Invalid search",
26
+ getAllResultsText: w = (e) => `View all results for ${e}`,
27
+ getAllResultsLink: S = (e) => `/Search?Search=${e}`,
28
+ ...v
29
29
  }) => {
30
- var R;
31
- const { className: r, "data-testid": m, ...L } = j(x, "Search"), f = c.useContext(U), h = c.useRef(null), p = c.useRef(null), g = c.useRef(null), a = f.isSearchExpanded, s = (R = h.current) == null ? void 0 : R.value, T = S ? (e) => {
32
- S(e.target.value);
30
+ const { className: e, "data-testid": l, ...P } = y(v, "Search"), d = s.useContext(K), m = s.useRef(null), f = s.useRef(null), x = s.useRef(null), a = d.isSearchExpanded, n = m.current?.value, k = u ? (r) => {
31
+ u(r.target.value);
33
32
  } : void 0;
34
- M(g, (e) => {
35
- i == null || i(), n(!1), e.stopPropagation();
33
+ F(x, (r) => {
34
+ _?.(), o(!1), r.stopPropagation();
36
35
  });
37
- const $ = (e) => {
38
- var o;
39
- if (e.stopPropagation(), e.key === "Enter") {
40
- if (e.preventDefault(), s && s.length > 2) {
41
- const y = N(v(s));
42
- n(!1), window.location.href = y;
36
+ const g = (r) => {
37
+ if (r.stopPropagation(), r.key === "Enter") {
38
+ if (r.preventDefault(), n && n.length > 2) {
39
+ const L = $(S(n));
40
+ o(!1), window.location.href = L;
43
41
  }
44
- e.currentTarget instanceof HTMLAnchorElement && (n(!1), e.currentTarget.click());
42
+ r.currentTarget instanceof HTMLAnchorElement && (o(!1), r.currentTarget.click());
45
43
  }
46
- e.key === "Escape" && ((o = p.current) == null || o.reset(), f.setIsSearchExpanded(!1));
44
+ r.key === "Escape" && (f.current?.reset(), d.setIsSearchExpanded(!1));
47
45
  };
48
- V(() => {
49
- var e;
46
+ T(() => {
50
47
  if (a) {
51
- (e = h.current) == null || e.focus();
48
+ m.current?.focus();
52
49
  return;
53
50
  }
54
51
  }, [a]);
55
- const n = (e) => {
56
- var o;
57
- (o = p.current) == null || o.reset(), f.setIsSearchExpanded(e);
52
+ const o = (r) => {
53
+ f.current?.reset(), d.setIsSearchExpanded(r);
58
54
  };
59
- return /* @__PURE__ */ t(q, { enabled: a, allowPinchZoom: !0, removeScrollBar: !1, children: /* @__PURE__ */ t("div", { className: `${r}__container`, children: /* @__PURE__ */ u(
55
+ return /* @__PURE__ */ t(U, { enabled: a, allowPinchZoom: !0, removeScrollBar: !1, children: /* @__PURE__ */ t("div", { className: `${e}__container`, children: /* @__PURE__ */ h(
60
56
  "div",
61
57
  {
62
- className: `${r}__container__inner`,
63
- ref: g,
64
- onClick: (e) => {
65
- a || (n(!0), e.stopPropagation());
58
+ className: `${e}__container__inner`,
59
+ ref: x,
60
+ onClick: (r) => {
61
+ a || (o(!0), r.stopPropagation());
66
62
  },
67
63
  children: [
68
- /* @__PURE__ */ t(K, { variant: F.heading4, className: `${r}__container__inner__label`, children: d }),
64
+ /* @__PURE__ */ t(A, { variant: O.heading4, className: `${e}__container__inner__label`, children: c }),
69
65
  /* @__PURE__ */ t(
70
66
  "div",
71
67
  {
72
- ...L,
73
- className: _(r, b, { [`${r}--active`]: a }),
74
- "data-testid": m,
68
+ ...P,
69
+ className: p(e, N, { [`${e}--active`]: a }),
70
+ "data-testid": l,
75
71
  role: "search",
76
- ...x,
77
- children: /* @__PURE__ */ u(
72
+ ...v,
73
+ children: /* @__PURE__ */ h(
78
74
  "form",
79
75
  {
80
- "data-testid": `${m}-form`,
81
- className: _(`${r}__form`, {
82
- [`${r}__form--active`]: a
76
+ "data-testid": `${l}-form`,
77
+ className: p(`${e}__form`, {
78
+ [`${e}__form--active`]: a
83
79
  }),
84
- ref: p,
80
+ ref: f,
85
81
  children: [
86
- /* @__PURE__ */ u(
82
+ /* @__PURE__ */ h(
87
83
  "div",
88
84
  {
89
- className: _(`${r}__content-wrapper`, {
90
- [`${r}__content-wrapper--active`]: a
85
+ className: p(`${e}__content-wrapper`, {
86
+ [`${e}__content-wrapper--active`]: a
91
87
  }),
92
88
  role: "combobox",
93
89
  "aria-haspopup": "listbox",
94
90
  children: [
95
91
  /* @__PURE__ */ t(
96
- z,
92
+ Z,
97
93
  {
98
94
  in: a,
99
- classNames: `${D}-input`,
95
+ classNames: `${V}-input`,
100
96
  addEndListener: () => {
101
97
  },
102
98
  children: /* @__PURE__ */ t(
103
- H,
99
+ j,
104
100
  {
105
101
  "aria-hidden": !a,
106
- className: `${r}__input`,
102
+ className: `${e}__input`,
107
103
  id: "search-input",
108
104
  hideLabel: !0,
109
- labelText: d,
110
- placeholder: a ? w : "",
105
+ labelText: c,
106
+ placeholder: a ? I : "",
111
107
  type: "text",
112
- defaultValue: E,
113
- invalid: l === "invalid",
114
- invalidText: P,
115
- onKeyDown: $,
116
- onChange: T,
117
- ref: h
108
+ defaultValue: C,
109
+ invalid: i === "invalid",
110
+ invalidText: b,
111
+ onKeyDown: g,
112
+ onChange: k,
113
+ ref: m
118
114
  }
119
115
  )
120
116
  }
121
117
  ),
122
118
  /* @__PURE__ */ t(
123
- Z,
119
+ M,
124
120
  {
125
- className: r,
126
- searchButtonText: d,
127
- state: l,
128
- testId: m,
121
+ className: e,
122
+ searchButtonText: c,
123
+ state: i,
124
+ testId: l,
129
125
  isSearchExpanded: a,
130
- setIsSearchExpanded: n,
131
- onCancel: i
126
+ setIsSearchExpanded: o,
127
+ onCancel: _
132
128
  }
133
129
  )
134
130
  ]
135
131
  }
136
132
  ),
137
- s && s.length > 2 ? /* @__PURE__ */ t(
138
- A,
133
+ n && n.length > 2 ? /* @__PURE__ */ t(
134
+ H,
139
135
  {
140
- autoCompleteResults: I,
141
- isLoading: l === "loading",
142
- loadingText: C,
143
- onKeyDown: $,
144
- userInputValue: s,
145
- closeSearch: n,
146
- children: /* @__PURE__ */ t("li", { className: `${r}__result`, children: /* @__PURE__ */ t(
147
- O,
136
+ autoCompleteResults: R,
137
+ isLoading: i === "loading",
138
+ loadingText: E,
139
+ onKeyDown: g,
140
+ userInputValue: n,
141
+ closeSearch: o,
142
+ children: /* @__PURE__ */ t("li", { className: `${e}__result`, children: /* @__PURE__ */ t(
143
+ D,
148
144
  {
149
- onClick: () => n(!1),
150
- href: ((e) => N(v(e)))(s),
151
- children: /* @__PURE__ */ t("p", { children: k(s) })
145
+ onClick: () => o(!1),
146
+ href: ((r) => $(S(r)))(n),
147
+ children: /* @__PURE__ */ t("p", { children: w(n) })
152
148
  }
153
149
  ) }, "viewAllSearchResults")
154
150
  }
@@ -163,5 +159,5 @@ const ie = ({
163
159
  ) }) });
164
160
  };
165
161
  export {
166
- ie as default
162
+ oe as default
167
163
  };