@phillips/seldon 1.118.2 → 1.119.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 (17) hide show
  1. package/dist/components/Navigation/NavigationItemTrigger/NavigationItemTrigger.js +39 -38
  2. package/dist/components/Search/Search.js +23 -22
  3. package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +1 -1
  4. package/dist/node_modules/@radix-ui/react-select/dist/index.js +1 -1
  5. package/dist/node_modules/@radix-ui/{react-dialog → react-select}/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +28 -28
  6. package/dist/node_modules/@radix-ui/react-select/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +62 -0
  7. package/dist/node_modules/react-remove-scroll/dist/es2015/SideEffect.js +28 -28
  8. package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +33 -31
  9. package/dist/scss/components/Search/SearchResults/_searchResults.scss +8 -0
  10. package/package.json +2 -1
  11. package/dist/node_modules/@radix-ui/react-dialog/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +0 -64
  12. /package/dist/node_modules/@radix-ui/{react-dialog → react-select}/node_modules/react-remove-scroll/dist/es2015/Combination.js +0 -0
  13. /package/dist/node_modules/@radix-ui/{react-dialog → react-select}/node_modules/react-remove-scroll/dist/es2015/UI.js +0 -0
  14. /package/dist/node_modules/@radix-ui/{react-dialog → react-select}/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +0 -0
  15. /package/dist/node_modules/@radix-ui/{react-dialog → react-select}/node_modules/react-remove-scroll/dist/es2015/medium.js +0 -0
  16. /package/dist/node_modules/@radix-ui/{react-dialog → react-select}/node_modules/react-remove-scroll/dist/es2015/sidecar.js +0 -0
  17. /package/dist/node_modules/@radix-ui/{react-dialog → react-select}/node_modules/tslib/tslib.es6.js +0 -0
@@ -1,68 +1,69 @@
1
- import { jsxs as u, Fragment as k, jsx as o } from "react/jsx-runtime";
2
- import { getCommonProps as y, findChildrenOfType as E, px as h } from "../../../utils/index.js";
3
- import L from "../../../node_modules/classnames/index.js";
4
- import c, { forwardRef as M, useState as b } from "react";
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
5
  import { TextVariants as N } from "../../Text/types.js";
6
6
  import C from "../../Text/Text.js";
7
- import w from "../NavigationList/NavigationList.js";
8
- import A from "../../Accordion/Accordion.js";
9
- import H from "../../Accordion/AccordionItem.js";
7
+ import L from "../NavigationList/NavigationList.js";
8
+ import M from "../../Accordion/Accordion.js";
9
+ import A from "../../Accordion/AccordionItem.js";
10
10
  import { SSRMediaQuery as v } from "../../../providers/SeldonProvider/utils.js";
11
- import { AccordionItemVariant as I } from "../../Accordion/types.js";
11
+ import { AccordionItemVariant as H } from "../../Accordion/types.js";
12
12
  import { HeaderContext as x } from "../../../site-furniture/Header/Header.js";
13
- const O = ({ id: m, label: i, children: l }) => {
14
- const { isMenuOpen: d } = c.useContext(x);
15
- return /* @__PURE__ */ o(A, { children: /* @__PURE__ */ o(
16
- H,
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,
17
18
  {
18
19
  hasTransition: !0,
19
20
  id: `accordion-item-${m}`,
20
- label: /* @__PURE__ */ o(C, { variant: N.snwHeaderLink, children: i }),
21
- variant: I.lg,
22
- children: l
21
+ label: /* @__PURE__ */ r(C, { variant: N.snwHeaderLink, children: i }),
22
+ variant: H.lg,
23
+ children: c
23
24
  },
24
25
  `accordion-key-${i}`
25
26
  ) }, `accordion-key-${i}-${d}`);
26
- }, R = M(
27
- ({ id: m, label: i, children: l, className: d, onClick: T, ..._ }, $) => {
28
- const { className: s, ...f } = y({ id: m }, "NavigationItemTrigger"), [g, e] = b(!1), t = E(l, w), { closeMenu: n } = c.useContext(x);
29
- return /* @__PURE__ */ u(k, { children: [
30
- /* @__PURE__ */ o(v.Media, { lessThan: "md", children: /* @__PURE__ */ o(O, { id: m, label: i, ...f, children: t ? c.cloneElement(t[0], {
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], {
31
32
  className: `${s}__submenu--mobile`,
32
- onClick: (p) => {
33
- var r, a;
34
- (a = (r = t[0].props) == null ? void 0 : r.onClick) == null || a.call(r, p), e == null || e(!1), n == null || n();
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();
35
36
  }
36
37
  }) : null }) }),
37
- /* @__PURE__ */ o(v.Media, { greaterThanOrEqual: "md", children: /* @__PURE__ */ u(
38
+ /* @__PURE__ */ r(v.Media, { greaterThanOrEqual: "md", children: /* @__PURE__ */ u(
38
39
  "li",
39
40
  {
40
- ...f,
41
+ ...g,
41
42
  ref: $,
42
- "aria-expanded": g,
43
- className: L(d, s, `${h}-nav__item`, {
44
- [`${s}--hovered`]: g
43
+ "aria-expanded": p,
44
+ className: b(d, s, `${h}-nav__item`, {
45
+ [`${s}--hovered`]: p
45
46
  }),
46
47
  onClick: T,
47
- onMouseOver: () => e(!0),
48
- onMouseOut: () => e(!1),
48
+ onMouseOver: () => o(!0),
49
+ onMouseOut: () => o(!1),
49
50
  ..._,
50
51
  children: [
51
- /* @__PURE__ */ o("button", { className: `${h}-nav__item-trigger`, type: "button", children: /* @__PURE__ */ o(C, { variant: N.snwHeaderLink, children: i }) }),
52
- t ? c.cloneElement(t[0], {
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], {
53
54
  className: `${s}__submenu`,
54
- onClick: (p) => {
55
- var r, a;
56
- (a = (r = t[0].props) == null ? void 0 : r.onClick) == null || a.call(r, p), e == null || e(!1), n == null || n();
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();
57
58
  }
58
59
  }) : null
59
60
  ]
60
61
  }
61
62
  ) })
62
- ] });
63
+ ] }) });
63
64
  }
64
65
  );
65
- R.displayName = "NavigationItemTrigger";
66
+ P.displayName = "NavigationItemTrigger";
66
67
  export {
67
- R as default
68
+ P as default
68
69
  };
@@ -1,6 +1,6 @@
1
1
  import { jsx as t, jsxs as u } from "react/jsx-runtime";
2
2
  import c, { useEffect as V } from "react";
3
- import { getCommonProps as j, px as D, encodeURLSearchParams as I } from "../../utils/index.js";
3
+ import { getCommonProps as j, px as D, encodeURLSearchParams as N } from "../../utils/index.js";
4
4
  import _ from "../../node_modules/classnames/index.js";
5
5
  import H from "../Input/Input.js";
6
6
  import O from "../Link/Link.js";
@@ -9,25 +9,26 @@ import { TextVariants as F } from "../Text/types.js";
9
9
  import K from "../Text/Text.js";
10
10
  import { useOnClickOutside as M } from "../../node_modules/usehooks-ts/dist/index.js";
11
11
  import { HeaderContext as U } from "../../site-furniture/Header/Header.js";
12
- import { SearchButton as q } from "./SearchButton.js";
12
+ import { SearchButton as Z } from "./SearchButton.js";
13
+ import q from "../../node_modules/react-remove-scroll/dist/es2015/Combination.js";
13
14
  import z from "../../node_modules/react-transition-group/esm/CSSTransition.js";
14
- const ne = ({
15
+ const ie = ({
15
16
  onSearch: S,
16
17
  onCancel: i,
17
- searchResults: R = [],
18
+ searchResults: I = [],
18
19
  state: l = "idle",
19
20
  defaultValue: E = "",
20
21
  className: b,
21
22
  placeholder: w = "",
22
23
  searchButtonText: d = "Search",
23
24
  loadingText: C = "Search In Progress...",
24
- invalidText: k = "Invalid search",
25
- getAllResultsText: P = (r) => `View all results for ${r}`,
25
+ invalidText: P = "Invalid search",
26
+ getAllResultsText: k = (r) => `View all results for ${r}`,
26
27
  getAllResultsLink: v = (r) => `/Search?Search=${r}`,
27
28
  ...x
28
29
  }) => {
29
- var N;
30
- const { className: r, "data-testid": m, ...L } = j(x, "Search"), f = c.useContext(U), p = c.useRef(null), h = c.useRef(null), g = c.useRef(null), a = f.isSearchExpanded, s = (N = p.current) == null ? void 0 : N.value, T = S ? (e) => {
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) => {
31
32
  S(e.target.value);
32
33
  } : void 0;
33
34
  M(g, (e) => {
@@ -37,25 +38,25 @@ const ne = ({
37
38
  var o;
38
39
  if (e.stopPropagation(), e.key === "Enter") {
39
40
  if (e.preventDefault(), s && s.length > 2) {
40
- const y = I(v(s));
41
+ const y = N(v(s));
41
42
  n(!1), window.location.href = y;
42
43
  }
43
44
  e.currentTarget instanceof HTMLAnchorElement && (n(!1), e.currentTarget.click());
44
45
  }
45
- e.key === "Escape" && ((o = h.current) == null || o.reset(), f.setIsSearchExpanded(!1));
46
+ e.key === "Escape" && ((o = p.current) == null || o.reset(), f.setIsSearchExpanded(!1));
46
47
  };
47
48
  V(() => {
48
49
  var e;
49
50
  if (a) {
50
- (e = p.current) == null || e.focus();
51
+ (e = h.current) == null || e.focus();
51
52
  return;
52
53
  }
53
54
  }, [a]);
54
55
  const n = (e) => {
55
56
  var o;
56
- (o = h.current) == null || o.reset(), f.setIsSearchExpanded(e);
57
+ (o = p.current) == null || o.reset(), f.setIsSearchExpanded(e);
57
58
  };
58
- return /* @__PURE__ */ t("div", { className: `${r}__container`, children: /* @__PURE__ */ u(
59
+ return /* @__PURE__ */ t(q, { enabled: a, allowPinchZoom: !0, removeScrollBar: !1, children: /* @__PURE__ */ t("div", { className: `${r}__container`, children: /* @__PURE__ */ u(
59
60
  "div",
60
61
  {
61
62
  className: `${r}__container__inner`,
@@ -80,7 +81,7 @@ const ne = ({
80
81
  className: _(`${r}__form`, {
81
82
  [`${r}__form--active`]: a
82
83
  }),
83
- ref: h,
84
+ ref: p,
84
85
  children: [
85
86
  /* @__PURE__ */ u(
86
87
  "div",
@@ -110,16 +111,16 @@ const ne = ({
110
111
  type: "text",
111
112
  defaultValue: E,
112
113
  invalid: l === "invalid",
113
- invalidText: k,
114
+ invalidText: P,
114
115
  onKeyDown: $,
115
116
  onChange: T,
116
- ref: p
117
+ ref: h
117
118
  }
118
119
  )
119
120
  }
120
121
  ),
121
122
  /* @__PURE__ */ t(
122
- q,
123
+ Z,
123
124
  {
124
125
  className: r,
125
126
  searchButtonText: d,
@@ -136,7 +137,7 @@ const ne = ({
136
137
  s && s.length > 2 ? /* @__PURE__ */ t(
137
138
  A,
138
139
  {
139
- autoCompleteResults: R,
140
+ autoCompleteResults: I,
140
141
  isLoading: l === "loading",
141
142
  loadingText: C,
142
143
  onKeyDown: $,
@@ -146,8 +147,8 @@ const ne = ({
146
147
  O,
147
148
  {
148
149
  onClick: () => n(!1),
149
- href: ((e) => I(v(e)))(s),
150
- children: /* @__PURE__ */ t("p", { children: P(s) })
150
+ href: ((e) => N(v(e)))(s),
151
+ children: /* @__PURE__ */ t("p", { children: k(s) })
151
152
  }
152
153
  ) }, "viewAllSearchResults")
153
154
  }
@@ -159,8 +160,8 @@ const ne = ({
159
160
  )
160
161
  ]
161
162
  }
162
- ) });
163
+ ) }) });
163
164
  };
164
165
  export {
165
- ne as default
166
+ ie as default
166
167
  };
@@ -10,7 +10,7 @@ import { Portal as Y } from "../node_modules/@radix-ui/react-portal/dist/index.j
10
10
  import { Presence as _ } from "../node_modules/@radix-ui/react-presence/dist/index.js";
11
11
  import { Primitive as m } from "../node_modules/@radix-ui/react-primitive/dist/index.js";
12
12
  import { useFocusGuards as Z } from "../node_modules/@radix-ui/react-focus-guards/dist/index.js";
13
- import z from "../node_modules/react-remove-scroll/dist/es2015/Combination.js";
13
+ import z from "../../../react-remove-scroll/dist/es2015/Combination.js";
14
14
  import { hideOthers as J } from "../../../aria-hidden/dist/es2015/index.js";
15
15
  import { Slot as Q } from "../node_modules/@radix-ui/react-slot/dist/index.js";
16
16
  import { jsx as i, jsxs as y, Fragment as I } from "react/jsx-runtime";
@@ -20,7 +20,7 @@ import { useLayoutEffect as z } from "../../react-use-layout-effect/dist/index.j
20
20
  import { usePrevious as mt } from "../../react-use-previous/dist/index.js";
21
21
  import { VisuallyHidden as ht } from "../../react-visually-hidden/dist/index.js";
22
22
  import { hideOthers as vt } from "../../../aria-hidden/dist/es2015/index.js";
23
- import gt from "../../../react-remove-scroll/dist/es2015/Combination.js";
23
+ import gt from "../node_modules/react-remove-scroll/dist/es2015/Combination.js";
24
24
  import { jsx as p, Fragment as Te, jsxs as ce } from "react/jsx-runtime";
25
25
  var St = [" ", "Enter", "ArrowUp", "ArrowDown"], wt = [" ", "Enter"], re = "Select", [ae, de, Ct] = tt(re), [ee, io] = ot(re, [
26
26
  Ct,
@@ -4,47 +4,47 @@ import { RemoveScrollBar as A } from "../../../../../../react-remove-scroll-bar/
4
4
  import { styleSingleton as I } from "../../../../../../react-style-singleton/dist/es2015/component.js";
5
5
  import { nonPassive as s } from "./aggresiveCapture.js";
6
6
  import { locationCouldBeScrolled as T, handleScroll as W } from "./handleScroll.js";
7
- var b = function(t) {
7
+ var k = function(t) {
8
8
  return "changedTouches" in t ? [t.changedTouches[0].clientX, t.changedTouches[0].clientY] : [0, 0];
9
9
  }, Y = function(t) {
10
10
  return [t.deltaX, t.deltaY];
11
11
  }, B = function(t) {
12
12
  return t && "current" in t ? t.current : t;
13
- }, p = function(t, c) {
13
+ }, F = function(t, c) {
14
14
  return t[0] === c[0] && t[1] === c[1];
15
- }, F = function(t) {
15
+ }, O = function(t) {
16
16
  return `
17
17
  .block-interactivity-`.concat(t, ` {pointer-events: none;}
18
18
  .allow-interactivity-`).concat(t, ` {pointer-events: all;}
19
19
  `);
20
- }, K = 0, f = [];
21
- function z(t) {
22
- var c = n.useRef([]), E = n.useRef([0, 0]), d = n.useRef(), h = n.useState(K++)[0], m = n.useState(I)[0], g = n.useRef(t);
20
+ }, Q = 0, f = [];
21
+ function G(t) {
22
+ var c = n.useRef([]), E = n.useRef([0, 0]), d = n.useRef(), v = n.useState(Q++)[0], m = n.useState(I)[0], g = n.useRef(t);
23
23
  n.useEffect(function() {
24
24
  g.current = t;
25
25
  }, [t]), n.useEffect(function() {
26
26
  if (t.inert) {
27
- document.body.classList.add("block-interactivity-".concat(h));
27
+ document.body.classList.add("block-interactivity-".concat(v));
28
28
  var e = x([t.lockRef.current], (t.shards || []).map(B), !0).filter(Boolean);
29
29
  return e.forEach(function(r) {
30
- return r.classList.add("allow-interactivity-".concat(h));
30
+ return r.classList.add("allow-interactivity-".concat(v));
31
31
  }), function() {
32
- document.body.classList.remove("block-interactivity-".concat(h)), e.forEach(function(r) {
33
- return r.classList.remove("allow-interactivity-".concat(h));
32
+ document.body.classList.remove("block-interactivity-".concat(v)), e.forEach(function(r) {
33
+ return r.classList.remove("allow-interactivity-".concat(v));
34
34
  });
35
35
  };
36
36
  }
37
37
  }, [t.inert, t.lockRef.current, t.shards]);
38
- var k = n.useCallback(function(e, r) {
39
- if ("touches" in e && e.touches.length === 2 || e.type === "wheel" && e.ctrlKey)
38
+ var y = n.useCallback(function(e, r) {
39
+ if ("touches" in e && e.touches.length === 2)
40
40
  return !g.current.allowPinchZoom;
41
- var l = b(e), o = E.current, u = "deltaX" in e ? e.deltaX : o[0] - l[0], i = "deltaY" in e ? e.deltaY : o[1] - l[1], a, C = e.target, v = Math.abs(u) > Math.abs(i) ? "h" : "v";
42
- if ("touches" in e && v === "h" && C.type === "range")
41
+ var l = k(e), o = E.current, u = "deltaX" in e ? e.deltaX : o[0] - l[0], i = "deltaY" in e ? e.deltaY : o[1] - l[1], a, C = e.target, h = Math.abs(u) > Math.abs(i) ? "h" : "v";
42
+ if ("touches" in e && h === "h" && C.type === "range")
43
43
  return !1;
44
- var y = T(v, C);
45
- if (!y)
44
+ var b = T(h, C);
45
+ if (!b)
46
46
  return !0;
47
- if (y ? a = v : (a = v === "v" ? "h" : "v", y = T(v, C)), !y)
47
+ if (b ? a = h : (a = h === "v" ? "h" : "v", b = T(h, C)), !b)
48
48
  return !1;
49
49
  if (!d.current && "changedTouches" in e && (u || i) && (d.current = a), !a)
50
50
  return !0;
@@ -53,8 +53,8 @@ function z(t) {
53
53
  }, []), S = n.useCallback(function(e) {
54
54
  var r = e;
55
55
  if (!(!f.length || f[f.length - 1] !== m)) {
56
- var l = "deltaY" in r ? Y(r) : b(r), o = c.current.filter(function(a) {
57
- return a.name === r.type && (a.target === r.target || r.target === a.shadowParent) && p(a.delta, l);
56
+ var l = "deltaY" in r ? Y(r) : k(r), o = c.current.filter(function(a) {
57
+ return a.name === r.type && (a.target === r.target || r.target === a.shadowParent) && F(a.delta, l);
58
58
  })[0];
59
59
  if (o && o.should) {
60
60
  r.cancelable && r.preventDefault();
@@ -63,23 +63,23 @@ function z(t) {
63
63
  if (!o) {
64
64
  var u = (g.current.shards || []).map(B).filter(Boolean).filter(function(a) {
65
65
  return a.contains(r.target);
66
- }), i = u.length > 0 ? k(r, u[0]) : !g.current.noIsolation;
66
+ }), i = u.length > 0 ? y(r, u[0]) : !g.current.noIsolation;
67
67
  i && r.cancelable && r.preventDefault();
68
68
  }
69
69
  }
70
70
  }, []), R = n.useCallback(function(e, r, l, o) {
71
- var u = { name: e, delta: r, target: l, should: o, shadowParent: O(l) };
71
+ var u = { name: e, delta: r, target: l, should: o, shadowParent: Z(l) };
72
72
  c.current.push(u), setTimeout(function() {
73
73
  c.current = c.current.filter(function(i) {
74
74
  return i !== u;
75
75
  });
76
76
  }, 1);
77
77
  }, []), w = n.useCallback(function(e) {
78
- E.current = b(e), d.current = void 0;
78
+ E.current = k(e), d.current = void 0;
79
79
  }, []), L = n.useCallback(function(e) {
80
- R(e.type, Y(e), e.target, k(e, t.lockRef.current));
80
+ R(e.type, Y(e), e.target, y(e, t.lockRef.current));
81
81
  }, []), M = n.useCallback(function(e) {
82
- R(e.type, b(e), e.target, k(e, t.lockRef.current));
82
+ R(e.type, k(e), e.target, y(e, t.lockRef.current));
83
83
  }, []);
84
84
  n.useEffect(function() {
85
85
  return f.push(m), t.setCallbacks({
@@ -96,17 +96,17 @@ function z(t) {
96
96
  return n.createElement(
97
97
  n.Fragment,
98
98
  null,
99
- D ? n.createElement(m, { styles: F(h) }) : null,
99
+ D ? n.createElement(m, { styles: O(v) }) : null,
100
100
  X ? n.createElement(A, { gapMode: t.gapMode }) : null
101
101
  );
102
102
  }
103
- function O(t) {
103
+ function Z(t) {
104
104
  for (var c = null; t !== null; )
105
105
  t instanceof ShadowRoot && (c = t.host, t = t.host), t = t.parentNode;
106
106
  return c;
107
107
  }
108
108
  export {
109
- z as RemoveScrollSideCar,
109
+ G as RemoveScrollSideCar,
110
110
  Y as getDeltaXY,
111
- b as getTouchXY
111
+ k as getTouchXY
112
112
  };
@@ -0,0 +1,62 @@
1
+ var p = function(r) {
2
+ return r.tagName === "TEXTAREA";
3
+ }, w = function(r, e) {
4
+ var o = window.getComputedStyle(r);
5
+ return (
6
+ // not-not-scrollable
7
+ o[e] !== "hidden" && // contains scroll inside self
8
+ !(o.overflowY === o.overflowX && !p(r) && o[e] === "visible")
9
+ );
10
+ }, y = function(r) {
11
+ return w(r, "overflowY");
12
+ }, H = function(r) {
13
+ return w(r, "overflowX");
14
+ }, R = function(r, e) {
15
+ var o = e.ownerDocument, t = e;
16
+ do {
17
+ typeof ShadowRoot != "undefined" && t instanceof ShadowRoot && (t = t.host);
18
+ var a = g(r, t);
19
+ if (a) {
20
+ var n = b(r, t), i = n[1], l = n[2];
21
+ if (i > l)
22
+ return !0;
23
+ }
24
+ t = t.parentNode;
25
+ } while (t && t !== o.body);
26
+ return !1;
27
+ }, B = function(r) {
28
+ var e = r.scrollTop, o = r.scrollHeight, t = r.clientHeight;
29
+ return [
30
+ e,
31
+ o,
32
+ t
33
+ ];
34
+ }, V = function(r) {
35
+ var e = r.scrollLeft, o = r.scrollWidth, t = r.clientWidth;
36
+ return [
37
+ e,
38
+ o,
39
+ t
40
+ ];
41
+ }, g = function(r, e) {
42
+ return r === "v" ? y(e) : H(e);
43
+ }, b = function(r, e) {
44
+ return r === "v" ? B(e) : V(e);
45
+ }, D = function(r, e) {
46
+ return r === "h" && e === "rtl" ? -1 : 1;
47
+ }, W = function(r, e, o, t, a) {
48
+ var n = D(r, window.getComputedStyle(e).direction), i = n * t, l = o.target, f = e.contains(l), c = !1, d = i > 0, s = 0, h = 0;
49
+ do {
50
+ var u = b(r, l), v = u[0], m = u[1], C = u[2], S = m - C - n * v;
51
+ (v || S) && g(r, l) && (s += S, h += v), l instanceof ShadowRoot ? l = l.host : l = l.parentNode;
52
+ } while (
53
+ // portaled content
54
+ !f && l !== document.body || // self content
55
+ f && (e.contains(l) || e === l)
56
+ );
57
+ return (d && (Math.abs(s) < 1 || !a) || !d && (Math.abs(h) < 1 || !a)) && (c = !0), c;
58
+ };
59
+ export {
60
+ W as handleScroll,
61
+ R as locationCouldBeScrolled
62
+ };
@@ -4,47 +4,47 @@ import { RemoveScrollBar as A } from "../../../react-remove-scroll-bar/dist/es20
4
4
  import { styleSingleton as I } from "../../../react-style-singleton/dist/es2015/component.js";
5
5
  import { nonPassive as s } from "./aggresiveCapture.js";
6
6
  import { locationCouldBeScrolled as T, handleScroll as W } from "./handleScroll.js";
7
- var k = function(t) {
7
+ var b = function(t) {
8
8
  return "changedTouches" in t ? [t.changedTouches[0].clientX, t.changedTouches[0].clientY] : [0, 0];
9
9
  }, Y = function(t) {
10
10
  return [t.deltaX, t.deltaY];
11
11
  }, B = function(t) {
12
12
  return t && "current" in t ? t.current : t;
13
- }, F = function(t, c) {
13
+ }, p = function(t, c) {
14
14
  return t[0] === c[0] && t[1] === c[1];
15
- }, O = function(t) {
15
+ }, F = function(t) {
16
16
  return `
17
17
  .block-interactivity-`.concat(t, ` {pointer-events: none;}
18
18
  .allow-interactivity-`).concat(t, ` {pointer-events: all;}
19
19
  `);
20
- }, Q = 0, f = [];
21
- function G(t) {
22
- var c = n.useRef([]), E = n.useRef([0, 0]), d = n.useRef(), v = n.useState(Q++)[0], m = n.useState(I)[0], g = n.useRef(t);
20
+ }, K = 0, f = [];
21
+ function z(t) {
22
+ var c = n.useRef([]), E = n.useRef([0, 0]), d = n.useRef(), h = n.useState(K++)[0], m = n.useState(I)[0], g = n.useRef(t);
23
23
  n.useEffect(function() {
24
24
  g.current = t;
25
25
  }, [t]), n.useEffect(function() {
26
26
  if (t.inert) {
27
- document.body.classList.add("block-interactivity-".concat(v));
27
+ document.body.classList.add("block-interactivity-".concat(h));
28
28
  var e = x([t.lockRef.current], (t.shards || []).map(B), !0).filter(Boolean);
29
29
  return e.forEach(function(r) {
30
- return r.classList.add("allow-interactivity-".concat(v));
30
+ return r.classList.add("allow-interactivity-".concat(h));
31
31
  }), function() {
32
- document.body.classList.remove("block-interactivity-".concat(v)), e.forEach(function(r) {
33
- return r.classList.remove("allow-interactivity-".concat(v));
32
+ document.body.classList.remove("block-interactivity-".concat(h)), e.forEach(function(r) {
33
+ return r.classList.remove("allow-interactivity-".concat(h));
34
34
  });
35
35
  };
36
36
  }
37
37
  }, [t.inert, t.lockRef.current, t.shards]);
38
- var y = n.useCallback(function(e, r) {
39
- if ("touches" in e && e.touches.length === 2)
38
+ var k = n.useCallback(function(e, r) {
39
+ if ("touches" in e && e.touches.length === 2 || e.type === "wheel" && e.ctrlKey)
40
40
  return !g.current.allowPinchZoom;
41
- var l = k(e), o = E.current, u = "deltaX" in e ? e.deltaX : o[0] - l[0], i = "deltaY" in e ? e.deltaY : o[1] - l[1], a, C = e.target, h = Math.abs(u) > Math.abs(i) ? "h" : "v";
42
- if ("touches" in e && h === "h" && C.type === "range")
41
+ var l = b(e), o = E.current, u = "deltaX" in e ? e.deltaX : o[0] - l[0], i = "deltaY" in e ? e.deltaY : o[1] - l[1], a, C = e.target, v = Math.abs(u) > Math.abs(i) ? "h" : "v";
42
+ if ("touches" in e && v === "h" && C.type === "range")
43
43
  return !1;
44
- var b = T(h, C);
45
- if (!b)
44
+ var y = T(v, C);
45
+ if (!y)
46
46
  return !0;
47
- if (b ? a = h : (a = h === "v" ? "h" : "v", b = T(h, C)), !b)
47
+ if (y ? a = v : (a = v === "v" ? "h" : "v", y = T(v, C)), !y)
48
48
  return !1;
49
49
  if (!d.current && "changedTouches" in e && (u || i) && (d.current = a), !a)
50
50
  return !0;
@@ -53,8 +53,8 @@ function G(t) {
53
53
  }, []), S = n.useCallback(function(e) {
54
54
  var r = e;
55
55
  if (!(!f.length || f[f.length - 1] !== m)) {
56
- var l = "deltaY" in r ? Y(r) : k(r), o = c.current.filter(function(a) {
57
- return a.name === r.type && (a.target === r.target || r.target === a.shadowParent) && F(a.delta, l);
56
+ var l = "deltaY" in r ? Y(r) : b(r), o = c.current.filter(function(a) {
57
+ return a.name === r.type && (a.target === r.target || r.target === a.shadowParent) && p(a.delta, l);
58
58
  })[0];
59
59
  if (o && o.should) {
60
60
  r.cancelable && r.preventDefault();
@@ -63,23 +63,23 @@ function G(t) {
63
63
  if (!o) {
64
64
  var u = (g.current.shards || []).map(B).filter(Boolean).filter(function(a) {
65
65
  return a.contains(r.target);
66
- }), i = u.length > 0 ? y(r, u[0]) : !g.current.noIsolation;
66
+ }), i = u.length > 0 ? k(r, u[0]) : !g.current.noIsolation;
67
67
  i && r.cancelable && r.preventDefault();
68
68
  }
69
69
  }
70
70
  }, []), R = n.useCallback(function(e, r, l, o) {
71
- var u = { name: e, delta: r, target: l, should: o, shadowParent: Z(l) };
71
+ var u = { name: e, delta: r, target: l, should: o, shadowParent: O(l) };
72
72
  c.current.push(u), setTimeout(function() {
73
73
  c.current = c.current.filter(function(i) {
74
74
  return i !== u;
75
75
  });
76
76
  }, 1);
77
77
  }, []), w = n.useCallback(function(e) {
78
- E.current = k(e), d.current = void 0;
78
+ E.current = b(e), d.current = void 0;
79
79
  }, []), L = n.useCallback(function(e) {
80
- R(e.type, Y(e), e.target, y(e, t.lockRef.current));
80
+ R(e.type, Y(e), e.target, k(e, t.lockRef.current));
81
81
  }, []), M = n.useCallback(function(e) {
82
- R(e.type, k(e), e.target, y(e, t.lockRef.current));
82
+ R(e.type, b(e), e.target, k(e, t.lockRef.current));
83
83
  }, []);
84
84
  n.useEffect(function() {
85
85
  return f.push(m), t.setCallbacks({
@@ -96,17 +96,17 @@ function G(t) {
96
96
  return n.createElement(
97
97
  n.Fragment,
98
98
  null,
99
- D ? n.createElement(m, { styles: O(v) }) : null,
99
+ D ? n.createElement(m, { styles: F(h) }) : null,
100
100
  X ? n.createElement(A, { gapMode: t.gapMode }) : null
101
101
  );
102
102
  }
103
- function Z(t) {
103
+ function O(t) {
104
104
  for (var c = null; t !== null; )
105
105
  t instanceof ShadowRoot && (c = t.host, t = t.host), t = t.parentNode;
106
106
  return c;
107
107
  }
108
108
  export {
109
- G as RemoveScrollSideCar,
109
+ z as RemoveScrollSideCar,
110
110
  Y as getDeltaXY,
111
- k as getTouchXY
111
+ b as getTouchXY
112
112
  };
@@ -1,58 +1,60 @@
1
- var p = function(r) {
2
- return r.tagName === "TEXTAREA";
3
- }, w = function(r, e) {
4
- var o = window.getComputedStyle(r);
1
+ var p = function(e) {
2
+ return e.tagName === "TEXTAREA";
3
+ }, w = function(e, r) {
4
+ if (!(e instanceof Element))
5
+ return !1;
6
+ var o = window.getComputedStyle(e);
5
7
  return (
6
8
  // not-not-scrollable
7
- o[e] !== "hidden" && // contains scroll inside self
8
- !(o.overflowY === o.overflowX && !p(r) && o[e] === "visible")
9
+ o[r] !== "hidden" && // contains scroll inside self
10
+ !(o.overflowY === o.overflowX && !p(e) && o[r] === "visible")
9
11
  );
10
- }, y = function(r) {
11
- return w(r, "overflowY");
12
- }, H = function(r) {
13
- return w(r, "overflowX");
14
- }, R = function(r, e) {
15
- var o = e.ownerDocument, t = e;
12
+ }, y = function(e) {
13
+ return w(e, "overflowY");
14
+ }, H = function(e) {
15
+ return w(e, "overflowX");
16
+ }, R = function(e, r) {
17
+ var o = r.ownerDocument, t = r;
16
18
  do {
17
19
  typeof ShadowRoot != "undefined" && t instanceof ShadowRoot && (t = t.host);
18
- var a = g(r, t);
20
+ var a = g(e, t);
19
21
  if (a) {
20
- var n = b(r, t), i = n[1], l = n[2];
22
+ var n = b(e, t), i = n[1], l = n[2];
21
23
  if (i > l)
22
24
  return !0;
23
25
  }
24
26
  t = t.parentNode;
25
27
  } while (t && t !== o.body);
26
28
  return !1;
27
- }, B = function(r) {
28
- var e = r.scrollTop, o = r.scrollHeight, t = r.clientHeight;
29
+ }, B = function(e) {
30
+ var r = e.scrollTop, o = e.scrollHeight, t = e.clientHeight;
29
31
  return [
30
- e,
32
+ r,
31
33
  o,
32
34
  t
33
35
  ];
34
- }, V = function(r) {
35
- var e = r.scrollLeft, o = r.scrollWidth, t = r.clientWidth;
36
+ }, V = function(e) {
37
+ var r = e.scrollLeft, o = e.scrollWidth, t = e.clientWidth;
36
38
  return [
37
- e,
39
+ r,
38
40
  o,
39
41
  t
40
42
  ];
41
- }, g = function(r, e) {
42
- return r === "v" ? y(e) : H(e);
43
- }, b = function(r, e) {
44
- return r === "v" ? B(e) : V(e);
45
- }, D = function(r, e) {
46
- return r === "h" && e === "rtl" ? -1 : 1;
47
- }, W = function(r, e, o, t, a) {
48
- var n = D(r, window.getComputedStyle(e).direction), i = n * t, l = o.target, f = e.contains(l), c = !1, d = i > 0, s = 0, h = 0;
43
+ }, g = function(e, r) {
44
+ return e === "v" ? y(r) : H(r);
45
+ }, b = function(e, r) {
46
+ return e === "v" ? B(r) : V(r);
47
+ }, D = function(e, r) {
48
+ return e === "h" && r === "rtl" ? -1 : 1;
49
+ }, W = function(e, r, o, t, a) {
50
+ var n = D(e, window.getComputedStyle(r).direction), i = n * t, l = o.target, f = r.contains(l), c = !1, d = i > 0, s = 0, h = 0;
49
51
  do {
50
- var u = b(r, l), v = u[0], m = u[1], C = u[2], S = m - C - n * v;
51
- (v || S) && g(r, l) && (s += S, h += v), l instanceof ShadowRoot ? l = l.host : l = l.parentNode;
52
+ var u = b(e, l), v = u[0], m = u[1], C = u[2], S = m - C - n * v;
53
+ (v || S) && g(e, l) && (s += S, h += v), l instanceof ShadowRoot ? l = l.host : l = l.parentNode;
52
54
  } while (
53
55
  // portaled content
54
56
  !f && l !== document.body || // self content
55
- f && (e.contains(l) || e === l)
57
+ f && (r.contains(l) || r === l)
56
58
  );
57
59
  return (d && (Math.abs(s) < 1 || !a) || !d && (Math.abs(h) < 1 || !a)) && (c = !0), c;
58
60
  };
@@ -6,11 +6,19 @@
6
6
  display: flex;
7
7
  flex-direction: column;
8
8
  gap: 0.625rem;
9
+ max-height: calc(90vh - #{$header-height});
10
+ -ms-overflow-style: none; /* Internet Explorer 10+ */
11
+ overflow-y: scroll;
9
12
  padding: $spacing-sm;
10
13
  position: absolute;
14
+ scrollbar-width: none; /* Firefox */
11
15
  top: $search-size;
12
16
  width: 100%;
13
17
 
18
+ &::-webkit-scrollbar {
19
+ display: none; /* Safari and Chrome */
20
+ }
21
+
14
22
  @include isHeaderMobile {
15
23
  padding: $spacing-sm 0;
16
24
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.118.2",
3
+ "version": "1.119.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"
@@ -58,6 +58,7 @@
58
58
  "html-react-parser": "^5.2.2",
59
59
  "react-intersection-observer": "^9.13.1",
60
60
  "react-modal": "^3.16.1",
61
+ "react-remove-scroll": "^2.6.3",
61
62
  "react-transition-group": "^4.4.5",
62
63
  "react-zoom-pan-pinch": "^3.6.1",
63
64
  "usehooks-ts": "^3.1.0"
@@ -1,64 +0,0 @@
1
- var p = function(e) {
2
- return e.tagName === "TEXTAREA";
3
- }, w = function(e, r) {
4
- if (!(e instanceof Element))
5
- return !1;
6
- var o = window.getComputedStyle(e);
7
- return (
8
- // not-not-scrollable
9
- o[r] !== "hidden" && // contains scroll inside self
10
- !(o.overflowY === o.overflowX && !p(e) && o[r] === "visible")
11
- );
12
- }, y = function(e) {
13
- return w(e, "overflowY");
14
- }, H = function(e) {
15
- return w(e, "overflowX");
16
- }, R = function(e, r) {
17
- var o = r.ownerDocument, t = r;
18
- do {
19
- typeof ShadowRoot != "undefined" && t instanceof ShadowRoot && (t = t.host);
20
- var a = g(e, t);
21
- if (a) {
22
- var n = b(e, t), i = n[1], l = n[2];
23
- if (i > l)
24
- return !0;
25
- }
26
- t = t.parentNode;
27
- } while (t && t !== o.body);
28
- return !1;
29
- }, B = function(e) {
30
- var r = e.scrollTop, o = e.scrollHeight, t = e.clientHeight;
31
- return [
32
- r,
33
- o,
34
- t
35
- ];
36
- }, V = function(e) {
37
- var r = e.scrollLeft, o = e.scrollWidth, t = e.clientWidth;
38
- return [
39
- r,
40
- o,
41
- t
42
- ];
43
- }, g = function(e, r) {
44
- return e === "v" ? y(r) : H(r);
45
- }, b = function(e, r) {
46
- return e === "v" ? B(r) : V(r);
47
- }, D = function(e, r) {
48
- return e === "h" && r === "rtl" ? -1 : 1;
49
- }, W = function(e, r, o, t, a) {
50
- var n = D(e, window.getComputedStyle(r).direction), i = n * t, l = o.target, f = r.contains(l), c = !1, d = i > 0, s = 0, h = 0;
51
- do {
52
- var u = b(e, l), v = u[0], m = u[1], C = u[2], S = m - C - n * v;
53
- (v || S) && g(e, l) && (s += S, h += v), l instanceof ShadowRoot ? l = l.host : l = l.parentNode;
54
- } while (
55
- // portaled content
56
- !f && l !== document.body || // self content
57
- f && (r.contains(l) || r === l)
58
- );
59
- return (d && (Math.abs(s) < 1 || !a) || !d && (Math.abs(h) < 1 || !a)) && (c = !0), c;
60
- };
61
- export {
62
- W as handleScroll,
63
- R as locationCouldBeScrolled
64
- };