@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.
- package/dist/_virtual/_commonjsHelpers.js +1 -1
- package/dist/components/Accordion/Accordion.js +18 -18
- package/dist/components/Accordion/AccordionItem.js +67 -68
- package/dist/components/Carousel/Carousel.js +49 -51
- package/dist/components/Carousel/CarouselDots.js +46 -47
- package/dist/components/ContentPeek/ContentPeek.js +47 -47
- package/dist/components/ErrorBoundary/ErrorBoundary.js +11 -12
- package/dist/components/Filter/Filter.js +40 -41
- package/dist/components/Filter/FilterHeader.js +24 -24
- package/dist/components/Input/Input.d.ts +1 -1
- package/dist/components/Input/Input.js +21 -20
- package/dist/components/Input/Input.stories.d.ts +7 -0
- package/dist/components/Link/utils.js +2 -2
- package/dist/components/LinkBlock/LinkBlock.js +12 -13
- package/dist/components/LinkList/LinkList.js +8 -11
- package/dist/components/Navigation/Navigation.js +21 -22
- package/dist/components/Navigation/NavigationItemTrigger/NavigationItemTrigger.js +48 -50
- package/dist/components/Navigation/NavigationList/NavigationList.js +33 -35
- package/dist/components/Pagination/Pagination.js +7 -7
- package/dist/components/Pagination/utils.js +1 -1
- package/dist/components/PinchZoom/PinchZoom.js +40 -43
- package/dist/components/Search/Search.js +94 -98
- package/dist/components/Search/SearchButton.js +19 -19
- package/dist/components/SeldonImage/SeldonImage.js +1 -1
- package/dist/components/Select/Select.js +22 -14
- package/dist/components/Select/Select.stories.d.ts +15 -0
- package/dist/components/Tabs/TabTrigger.js +13 -13
- package/dist/node_modules/@artsy/fresnel/dist/Breakpoints.js +2 -2
- package/dist/node_modules/@artsy/fresnel/dist/DynamicResponsive.js +1 -1
- package/dist/node_modules/@artsy/fresnel/dist/Interactions.js +2 -2
- package/dist/node_modules/@artsy/fresnel/dist/Media.js +2 -2
- package/dist/node_modules/@artsy/fresnel/dist/MediaQueries.js +1 -1
- package/dist/node_modules/@artsy/fresnel/dist/Utils.js +1 -1
- package/dist/node_modules/@floating-ui/core/dist/floating-ui.core.js +1 -1
- package/dist/node_modules/@floating-ui/dom/dist/floating-ui.dom.js +1 -1
- package/dist/node_modules/@floating-ui/react-dom/dist/floating-ui.react-dom.js +2 -2
- package/dist/node_modules/@floating-ui/utils/dist/floating-ui.utils.dom.js +2 -2
- package/dist/node_modules/@radix-ui/primitive/dist/index.js +5 -5
- package/dist/node_modules/@radix-ui/react-accordion/dist/index.js +63 -67
- package/dist/node_modules/@radix-ui/react-context/dist/index.js +35 -35
- package/dist/node_modules/@radix-ui/react-dialog/dist/index.js +79 -83
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/primitive/dist/index.js +5 -5
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-context/dist/index.js +43 -45
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +86 -87
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-focus-guards/dist/index.js +7 -8
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-focus-scope/dist/index.js +56 -57
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-portal/dist/index.js +12 -13
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-presence/dist/index.js +37 -42
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-primitive/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-dialog/node_modules/@radix-ui/react-slot/dist/index.js +18 -19
- package/dist/node_modules/@radix-ui/react-dismissable-layer/dist/index.js +86 -87
- package/dist/node_modules/@radix-ui/react-focus-guards/dist/index.js +7 -8
- package/dist/node_modules/@radix-ui/react-focus-scope/dist/index.js +56 -57
- package/dist/node_modules/@radix-ui/react-id/dist/index.js +10 -10
- package/dist/node_modules/@radix-ui/react-popper/dist/index.js +113 -115
- package/dist/node_modules/@radix-ui/react-portal/dist/index.js +12 -13
- package/dist/node_modules/@radix-ui/react-presence/dist/index.js +33 -37
- package/dist/node_modules/@radix-ui/react-primitive/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-select/dist/index.js +422 -439
- package/dist/node_modules/@radix-ui/react-select/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +1 -1
- package/dist/node_modules/@radix-ui/react-select/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +1 -1
- package/dist/node_modules/@radix-ui/react-slot/dist/index.js +18 -19
- package/dist/node_modules/@radix-ui/react-tabs/node_modules/@radix-ui/react-context/dist/index.js +39 -41
- package/dist/node_modules/@radix-ui/react-tabs/node_modules/@radix-ui/react-presence/dist/index.js +37 -42
- package/dist/node_modules/@radix-ui/react-use-callback-ref/dist/index.js +7 -10
- package/dist/node_modules/@radix-ui/react-use-escape-keydown/dist/index.js +1 -1
- package/dist/node_modules/@radix-ui/react-use-layout-effect/dist/index.js +1 -1
- package/dist/node_modules/aria-hidden/dist/es2015/index.js +1 -1
- package/dist/node_modules/change-case/dist/index.js +41 -44
- package/dist/node_modules/date-fns/differenceInCalendarDays.js +11 -11
- package/dist/node_modules/date-fns/differenceInDays.js +9 -9
- package/dist/node_modules/date-fns/differenceInHours.js +11 -11
- package/dist/node_modules/date-fns/differenceInMinutes.js +8 -8
- package/dist/node_modules/date-fns/differenceInSeconds.js +7 -7
- package/dist/node_modules/date-fns/formatDuration.js +11 -12
- package/dist/node_modules/date-fns/isSameWeek.js +8 -8
- package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +12 -12
- package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +3 -3
- package/dist/node_modules/date-fns/locale/zh-CN/_lib/formatDistance.js +5 -5
- package/dist/node_modules/date-fns/locale/zh-CN/_lib/localize.js +10 -10
- package/dist/node_modules/date-fns/startOfDay.js +6 -6
- package/dist/node_modules/date-fns/startOfWeek.js +7 -8
- package/dist/node_modules/embla-carousel/esm/embla-carousel.esm.js +1 -1
- package/dist/node_modules/embla-carousel-reactive-utils/esm/embla-carousel-reactive-utils.esm.js +1 -1
- package/dist/node_modules/exenv/index.js +2 -2
- package/dist/node_modules/get-nonce/dist/es2015/index.js +1 -1
- package/dist/node_modules/prop-types/checkPropTypes.js +2 -2
- package/dist/node_modules/prop-types/factoryWithTypeCheckers.js +3 -3
- package/dist/node_modules/react-intersection-observer/dist/index.js +2 -2
- package/dist/node_modules/react-lifecycles-compat/react-lifecycles-compat.es.js +1 -1
- package/dist/node_modules/react-modal/lib/components/ModalPortal.js +1 -1
- package/dist/node_modules/react-modal/lib/helpers/scopeTab.js +1 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/aggresiveCapture.js +1 -1
- package/dist/node_modules/react-remove-scroll/dist/es2015/handleScroll.js +1 -1
- package/dist/node_modules/react-remove-scroll-bar/dist/es2015/utils.js +1 -1
- package/dist/node_modules/react-transition-group/esm/Transition.js +1 -1
- package/dist/node_modules/react-zoom-pan-pinch/dist/index.esm.js +14 -14
- package/dist/node_modules/use-callback-ref/dist/es2015/useMergeRef.js +1 -1
- package/dist/node_modules/usehooks-ts/dist/index.js +1 -1
- package/dist/node_modules/warning/warning.js +1 -1
- package/dist/node_modules/wheel-gestures/dist/wheel-gestures.esm.js +1 -1
- package/dist/patterns/BidSnapshot/BidSnapshot.js +58 -58
- package/dist/patterns/DetailList/DetailList.js +22 -22
- package/dist/patterns/FilterMenu/FilterMenu.js +15 -15
- package/dist/patterns/LanguageSelector/LanguageSelector.js +23 -23
- package/dist/patterns/LanguageSelector/utils.js +2 -5
- package/dist/patterns/ObjectTile/ObjectTile.d.ts +4 -0
- package/dist/patterns/ObjectTile/ObjectTile.js +50 -48
- package/dist/patterns/ObjectTile/ObjectTile.stories.d.ts +2 -0
- package/dist/patterns/ViewingsList/StatefulViewingsList.js +16 -16
- package/dist/patterns/ViewingsList/ViewingsList.js +42 -42
- package/dist/patterns/ViewingsList/ViewingsListCard.js +122 -123
- package/dist/patterns/ViewingsList/ViewingsListCardForm.js +170 -170
- package/dist/scss/patterns/ObjectTile/_objectTile.scss +17 -1
- package/dist/site-furniture/Header/Header.js +32 -32
- package/package.json +2 -1
|
@@ -1,60 +1,58 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { getCommonProps as
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import { TextVariants as
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
import { SSRMediaQuery as
|
|
11
|
-
import { AccordionItemVariant as
|
|
12
|
-
import { HeaderContext as
|
|
13
|
-
import
|
|
14
|
-
const
|
|
15
|
-
const { isMenuOpen:
|
|
16
|
-
return /* @__PURE__ */
|
|
17
|
-
|
|
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-${
|
|
21
|
-
label: /* @__PURE__ */
|
|
22
|
-
variant:
|
|
23
|
-
children:
|
|
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-${
|
|
26
|
-
) }, `accordion-key-${
|
|
27
|
-
},
|
|
28
|
-
({ id:
|
|
29
|
-
const { className:
|
|
30
|
-
return /* @__PURE__ */
|
|
31
|
-
/* @__PURE__ */
|
|
32
|
-
className: `${
|
|
33
|
-
onClick: (
|
|
34
|
-
|
|
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__ */
|
|
37
|
+
/* @__PURE__ */ e(g.Media, { greaterThanOrEqual: "md", children: /* @__PURE__ */ u(
|
|
39
38
|
"li",
|
|
40
39
|
{
|
|
41
|
-
...
|
|
42
|
-
ref:
|
|
43
|
-
"aria-expanded":
|
|
44
|
-
className:
|
|
45
|
-
[`${
|
|
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:
|
|
48
|
-
onMouseOver: () =>
|
|
49
|
-
onMouseOut: () =>
|
|
50
|
-
...
|
|
46
|
+
onClick: C,
|
|
47
|
+
onMouseOver: () => i(!0),
|
|
48
|
+
onMouseOut: () => i(!1),
|
|
49
|
+
...x,
|
|
51
50
|
children: [
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
|
|
54
|
-
className: `${
|
|
55
|
-
onClick: (
|
|
56
|
-
|
|
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
|
-
|
|
64
|
+
L.displayName = "NavigationItemTrigger";
|
|
67
65
|
export {
|
|
68
|
-
|
|
66
|
+
L as default
|
|
69
67
|
};
|
|
@@ -1,53 +1,51 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import { px as
|
|
4
|
-
import
|
|
5
|
-
import { TextVariants as
|
|
6
|
-
import
|
|
7
|
-
const
|
|
8
|
-
({ id:
|
|
9
|
-
const
|
|
10
|
-
if (
|
|
11
|
-
return
|
|
12
|
-
onClick: (
|
|
13
|
-
|
|
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),
|
|
18
|
-
if (
|
|
19
|
-
return
|
|
20
|
-
onClick: (
|
|
21
|
-
|
|
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__ */
|
|
24
|
+
return /* @__PURE__ */ r(
|
|
27
25
|
"ul",
|
|
28
26
|
{
|
|
29
|
-
"aria-hidden":
|
|
30
|
-
id:
|
|
31
|
-
"data-testid":
|
|
27
|
+
"aria-hidden": m,
|
|
28
|
+
id: _,
|
|
29
|
+
"data-testid": _,
|
|
32
30
|
role: "list",
|
|
33
|
-
className:
|
|
34
|
-
ref:
|
|
31
|
+
className: o(N, `${n}-nav__list`, { [`${n}-nav__list--offscreen`]: m }),
|
|
32
|
+
ref: $,
|
|
35
33
|
children: [
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
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
|
-
|
|
41
|
-
|
|
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
|
-
!
|
|
42
|
+
!l.length && !i.length ? s : null
|
|
45
43
|
]
|
|
46
44
|
}
|
|
47
45
|
);
|
|
48
46
|
}
|
|
49
47
|
);
|
|
50
|
-
|
|
48
|
+
g.displayName = "NavigationList";
|
|
51
49
|
export {
|
|
52
|
-
|
|
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
|
|
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:
|
|
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:
|
|
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:
|
|
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":
|
|
57
|
+
"aria-label": v,
|
|
58
58
|
value: f,
|
|
59
59
|
onChange: (e) => {
|
|
60
|
-
const r = M(a, e
|
|
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:
|
|
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
|
|
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
|
|
2
|
-
import { useState as
|
|
3
|
-
import { getCommonProps as
|
|
4
|
-
import { TransformWrapper as
|
|
5
|
-
import
|
|
6
|
-
const
|
|
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:
|
|
9
|
-
onAtRightEdge:
|
|
10
|
-
children:
|
|
11
|
-
maxZoom:
|
|
12
|
-
className:
|
|
13
|
-
isZoomReset:
|
|
14
|
-
...
|
|
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
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
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,
|
|
27
|
+
[s, m, l]
|
|
31
28
|
);
|
|
32
|
-
return /* @__PURE__ */
|
|
33
|
-
|
|
29
|
+
return /* @__PURE__ */ p(
|
|
30
|
+
z,
|
|
34
31
|
{
|
|
35
|
-
maxScale:
|
|
36
|
-
onTransformed:
|
|
32
|
+
maxScale: u,
|
|
33
|
+
onTransformed: N,
|
|
37
34
|
minScale: 1,
|
|
38
35
|
disablePadding: !0,
|
|
39
36
|
doubleClick: {
|
|
40
|
-
mode:
|
|
37
|
+
mode: t ? "reset" : "toggle"
|
|
41
38
|
},
|
|
42
39
|
wheel: {
|
|
43
40
|
smoothStep: 0.01
|
|
44
41
|
},
|
|
45
42
|
panning: {
|
|
46
|
-
disabled: !
|
|
43
|
+
disabled: !t
|
|
47
44
|
},
|
|
48
|
-
ref:
|
|
49
|
-
children: /* @__PURE__ */
|
|
50
|
-
|
|
45
|
+
ref: c,
|
|
46
|
+
children: /* @__PURE__ */ p(
|
|
47
|
+
M,
|
|
51
48
|
{
|
|
52
|
-
wrapperProps: {
|
|
53
|
-
wrapperClass:
|
|
54
|
-
[`${
|
|
49
|
+
wrapperProps: { ...P, ...i },
|
|
50
|
+
wrapperClass: d(o, b, {
|
|
51
|
+
[`${o}-zoomed`]: t
|
|
55
52
|
}),
|
|
56
|
-
contentClass: `${
|
|
57
|
-
children:
|
|
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
|
-
|
|
60
|
+
g.displayName = "PinchZoom";
|
|
64
61
|
export {
|
|
65
|
-
|
|
62
|
+
g as default
|
|
66
63
|
};
|
|
@@ -1,154 +1,150 @@
|
|
|
1
|
-
import { jsx as t, jsxs as
|
|
2
|
-
import
|
|
3
|
-
import { getCommonProps as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { TextVariants as
|
|
9
|
-
import
|
|
10
|
-
import { useOnClickOutside as
|
|
11
|
-
import { HeaderContext as
|
|
12
|
-
import { SearchButton as
|
|
13
|
-
import
|
|
14
|
-
import
|
|
15
|
-
const
|
|
16
|
-
onSearch:
|
|
17
|
-
onCancel:
|
|
18
|
-
searchResults:
|
|
19
|
-
state:
|
|
20
|
-
defaultValue:
|
|
21
|
-
className:
|
|
22
|
-
placeholder:
|
|
23
|
-
searchButtonText:
|
|
24
|
-
loadingText:
|
|
25
|
-
invalidText:
|
|
26
|
-
getAllResultsText:
|
|
27
|
-
getAllResultsLink:
|
|
28
|
-
...
|
|
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
|
-
|
|
31
|
-
|
|
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
|
-
|
|
35
|
-
|
|
33
|
+
F(x, (r) => {
|
|
34
|
+
_?.(), o(!1), r.stopPropagation();
|
|
36
35
|
});
|
|
37
|
-
const
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
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
|
-
|
|
42
|
+
r.currentTarget instanceof HTMLAnchorElement && (o(!1), r.currentTarget.click());
|
|
45
43
|
}
|
|
46
|
-
|
|
44
|
+
r.key === "Escape" && (f.current?.reset(), d.setIsSearchExpanded(!1));
|
|
47
45
|
};
|
|
48
|
-
|
|
49
|
-
var e;
|
|
46
|
+
T(() => {
|
|
50
47
|
if (a) {
|
|
51
|
-
|
|
48
|
+
m.current?.focus();
|
|
52
49
|
return;
|
|
53
50
|
}
|
|
54
51
|
}, [a]);
|
|
55
|
-
const
|
|
56
|
-
|
|
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(
|
|
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: `${
|
|
63
|
-
ref:
|
|
64
|
-
onClick: (
|
|
65
|
-
a || (
|
|
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(
|
|
64
|
+
/* @__PURE__ */ t(A, { variant: O.heading4, className: `${e}__container__inner__label`, children: c }),
|
|
69
65
|
/* @__PURE__ */ t(
|
|
70
66
|
"div",
|
|
71
67
|
{
|
|
72
|
-
...
|
|
73
|
-
className:
|
|
74
|
-
"data-testid":
|
|
68
|
+
...P,
|
|
69
|
+
className: p(e, N, { [`${e}--active`]: a }),
|
|
70
|
+
"data-testid": l,
|
|
75
71
|
role: "search",
|
|
76
|
-
...
|
|
77
|
-
children: /* @__PURE__ */
|
|
72
|
+
...v,
|
|
73
|
+
children: /* @__PURE__ */ h(
|
|
78
74
|
"form",
|
|
79
75
|
{
|
|
80
|
-
"data-testid": `${
|
|
81
|
-
className:
|
|
82
|
-
[`${
|
|
76
|
+
"data-testid": `${l}-form`,
|
|
77
|
+
className: p(`${e}__form`, {
|
|
78
|
+
[`${e}__form--active`]: a
|
|
83
79
|
}),
|
|
84
|
-
ref:
|
|
80
|
+
ref: f,
|
|
85
81
|
children: [
|
|
86
|
-
/* @__PURE__ */
|
|
82
|
+
/* @__PURE__ */ h(
|
|
87
83
|
"div",
|
|
88
84
|
{
|
|
89
|
-
className:
|
|
90
|
-
[`${
|
|
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
|
-
|
|
92
|
+
Z,
|
|
97
93
|
{
|
|
98
94
|
in: a,
|
|
99
|
-
classNames: `${
|
|
95
|
+
classNames: `${V}-input`,
|
|
100
96
|
addEndListener: () => {
|
|
101
97
|
},
|
|
102
98
|
children: /* @__PURE__ */ t(
|
|
103
|
-
|
|
99
|
+
j,
|
|
104
100
|
{
|
|
105
101
|
"aria-hidden": !a,
|
|
106
|
-
className: `${
|
|
102
|
+
className: `${e}__input`,
|
|
107
103
|
id: "search-input",
|
|
108
104
|
hideLabel: !0,
|
|
109
|
-
labelText:
|
|
110
|
-
placeholder: a ?
|
|
105
|
+
labelText: c,
|
|
106
|
+
placeholder: a ? I : "",
|
|
111
107
|
type: "text",
|
|
112
|
-
defaultValue:
|
|
113
|
-
invalid:
|
|
114
|
-
invalidText:
|
|
115
|
-
onKeyDown:
|
|
116
|
-
onChange:
|
|
117
|
-
ref:
|
|
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
|
-
|
|
119
|
+
M,
|
|
124
120
|
{
|
|
125
|
-
className:
|
|
126
|
-
searchButtonText:
|
|
127
|
-
state:
|
|
128
|
-
testId:
|
|
121
|
+
className: e,
|
|
122
|
+
searchButtonText: c,
|
|
123
|
+
state: i,
|
|
124
|
+
testId: l,
|
|
129
125
|
isSearchExpanded: a,
|
|
130
|
-
setIsSearchExpanded:
|
|
131
|
-
onCancel:
|
|
126
|
+
setIsSearchExpanded: o,
|
|
127
|
+
onCancel: _
|
|
132
128
|
}
|
|
133
129
|
)
|
|
134
130
|
]
|
|
135
131
|
}
|
|
136
132
|
),
|
|
137
|
-
|
|
138
|
-
|
|
133
|
+
n && n.length > 2 ? /* @__PURE__ */ t(
|
|
134
|
+
H,
|
|
139
135
|
{
|
|
140
|
-
autoCompleteResults:
|
|
141
|
-
isLoading:
|
|
142
|
-
loadingText:
|
|
143
|
-
onKeyDown:
|
|
144
|
-
userInputValue:
|
|
145
|
-
closeSearch:
|
|
146
|
-
children: /* @__PURE__ */ t("li", { className: `${
|
|
147
|
-
|
|
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: () =>
|
|
150
|
-
href: ((
|
|
151
|
-
children: /* @__PURE__ */ t("p", { children:
|
|
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
|
-
|
|
162
|
+
oe as default
|
|
167
163
|
};
|