@phillips/seldon 1.98.1 → 1.100.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/components/Carousel/Carousel.stories.d.ts +7 -0
- package/dist/components/Carousel/CarouselDot.d.ts +16 -0
- package/dist/components/Carousel/CarouselDot.js +40 -0
- package/dist/components/Carousel/CarouselDots.js +76 -59
- package/dist/components/Countdown/Countdown.d.ts +4 -0
- package/dist/components/Countdown/Countdown.js +35 -33
- package/dist/components/PinchZoom/PinchZoom.d.ts +12 -0
- package/dist/components/PinchZoom/PinchZoom.js +45 -27
- package/dist/node_modules/react-intersection-observer/dist/index.js +122 -0
- package/dist/patterns/SaleHeaderBanner/SaleHeaderBanner.d.ts +4 -0
- package/dist/patterns/SaleHeaderBanner/SaleHeaderBanner.js +41 -38
- package/dist/scss/components/Carousel/_carousel.scss +25 -4
- package/dist/scss/components/Countdown/_countdown.scss +7 -2
- package/dist/scss/patterns/SaleHeaderBanner/_saleHeaderBanner.scss +16 -0
- package/package.json +2 -1
|
@@ -19,4 +19,11 @@ export declare const CarouselWithDots: {
|
|
|
19
19
|
};
|
|
20
20
|
argTypes: {};
|
|
21
21
|
};
|
|
22
|
+
export declare const CarouselWithDotsOverflow: {
|
|
23
|
+
(props: CarouselProps & CarouselDotsProps): import("react/jsx-runtime").JSX.Element;
|
|
24
|
+
args: {
|
|
25
|
+
maxDots: number;
|
|
26
|
+
};
|
|
27
|
+
argTypes: {};
|
|
28
|
+
};
|
|
22
29
|
export declare const ControlledCarousel: (props: CarouselProps & CarouselDotsProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
interface Props {
|
|
2
|
+
/** Whether the dot is selected */
|
|
3
|
+
isSelected: boolean;
|
|
4
|
+
/** Callback function when the dot is clicked */
|
|
5
|
+
onClick: () => void;
|
|
6
|
+
/** Base class name for styling */
|
|
7
|
+
baseClassName: string;
|
|
8
|
+
/** Reference to the scrollable container */
|
|
9
|
+
scrollableContainerRef: React.RefObject<HTMLDivElement>;
|
|
10
|
+
/** Callback function when the dot comes into view within the scrollable container */
|
|
11
|
+
onInViewChange: (inView: boolean) => void;
|
|
12
|
+
/** Variant of the dot */
|
|
13
|
+
variant?: 'sm' | 'md';
|
|
14
|
+
}
|
|
15
|
+
export declare const CarouselDot: ({ isSelected, onClick, baseClassName, scrollableContainerRef, onInViewChange, variant, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
16
|
+
export {};
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { jsx as n } from "react/jsx-runtime";
|
|
2
|
+
import r from "../../node_modules/classnames/index.js";
|
|
3
|
+
import { useInView as m } from "../../node_modules/react-intersection-observer/dist/index.js";
|
|
4
|
+
const l = ({
|
|
5
|
+
isSelected: i,
|
|
6
|
+
onClick: e,
|
|
7
|
+
baseClassName: o,
|
|
8
|
+
scrollableContainerRef: c,
|
|
9
|
+
onInViewChange: p,
|
|
10
|
+
variant: t = "md"
|
|
11
|
+
}) => {
|
|
12
|
+
const { ref: d } = m({
|
|
13
|
+
threshold: 0,
|
|
14
|
+
root: c.current,
|
|
15
|
+
onChange(a) {
|
|
16
|
+
p(a);
|
|
17
|
+
}
|
|
18
|
+
});
|
|
19
|
+
return /* @__PURE__ */ n(
|
|
20
|
+
"button",
|
|
21
|
+
{
|
|
22
|
+
ref: d,
|
|
23
|
+
role: "button",
|
|
24
|
+
onClick: e,
|
|
25
|
+
className: r(`${o}-pagination-dot__container`),
|
|
26
|
+
children: /* @__PURE__ */ n(
|
|
27
|
+
"span",
|
|
28
|
+
{
|
|
29
|
+
className: r(`${o}-pagination-dot`, {
|
|
30
|
+
[`${o}-pagination-dot--selected`]: i,
|
|
31
|
+
[`${o}-pagination-dot--${t}`]: t
|
|
32
|
+
})
|
|
33
|
+
}
|
|
34
|
+
)
|
|
35
|
+
}
|
|
36
|
+
);
|
|
37
|
+
};
|
|
38
|
+
export {
|
|
39
|
+
l as CarouselDot
|
|
40
|
+
};
|
|
@@ -1,75 +1,92 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { useCarousel as
|
|
5
|
-
import { getCommonProps as
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
1
|
+
import { jsx as u } from "react/jsx-runtime";
|
|
2
|
+
import B from "../../node_modules/classnames/index.js";
|
|
3
|
+
import { forwardRef as E, useId as L, useState as S, useRef as M, useCallback as a, useEffect as W, useMemo as q } from "react";
|
|
4
|
+
import { useCarousel as z } from "./utils.js";
|
|
5
|
+
import { getCommonProps as A } from "../../utils/index.js";
|
|
6
|
+
import { CarouselDot as F } from "./CarouselDot.js";
|
|
7
|
+
const G = E(
|
|
8
|
+
({ className: w, maxDots: g = 9, position: N = "inline", numberOfSlides: v = 0, ...h }, V) => {
|
|
9
|
+
const { className: l, ...b } = A(h, "Carousel"), k = L(), { api: o, onSlideChange: n } = z(), [y, R] = S(0), [i, T] = S(
|
|
10
|
+
Array.from({ length: v }, (e, t) => t)
|
|
11
|
+
), c = M(null), [C, D] = S([]), $ = a((e) => {
|
|
12
|
+
var t, m;
|
|
13
|
+
c.current && ((m = (t = c.current).scrollTo) == null || m.call(t, {
|
|
14
|
+
// 8px width + 12px gap
|
|
15
|
+
left: e * 20 - c.current.offsetWidth / 2 + 10,
|
|
16
|
+
// Center dot in container
|
|
17
|
+
behavior: "smooth"
|
|
18
|
+
}));
|
|
19
|
+
}, []), O = a(
|
|
20
|
+
(e) => {
|
|
21
|
+
o && (o.scrollTo(e, !0), n == null || n(e));
|
|
13
22
|
},
|
|
14
|
-
[
|
|
15
|
-
),
|
|
16
|
-
|
|
17
|
-
}, []),
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
(t) => {
|
|
21
|
-
o == null || o(t.selectedScrollSnap());
|
|
23
|
+
[o, n]
|
|
24
|
+
), f = a((e) => {
|
|
25
|
+
T(e.scrollSnapList());
|
|
26
|
+
}, []), s = a(
|
|
27
|
+
(e) => {
|
|
28
|
+
R(e.selectedScrollSnap()), $(e.selectedScrollSnap());
|
|
22
29
|
},
|
|
23
|
-
[
|
|
30
|
+
[$]
|
|
31
|
+
), p = a(
|
|
32
|
+
(e) => {
|
|
33
|
+
n == null || n(e.selectedScrollSnap());
|
|
34
|
+
},
|
|
35
|
+
[n]
|
|
24
36
|
);
|
|
25
|
-
|
|
26
|
-
if (
|
|
27
|
-
return
|
|
28
|
-
|
|
37
|
+
W(() => {
|
|
38
|
+
if (o)
|
|
39
|
+
return f(o), s(o), o.on("reInit", f).on("reInit", s).on("select", s).on("settle", p), () => {
|
|
40
|
+
o.off("reInit", f).off("reInit", s).off("select", s).off("settle", p);
|
|
29
41
|
};
|
|
30
|
-
}, [
|
|
31
|
-
const
|
|
32
|
-
|
|
33
|
-
const t = Math.floor(l / 2);
|
|
34
|
-
let n = Math.max(0, g - t);
|
|
35
|
-
const r = Math.min(i.length, n + l);
|
|
36
|
-
return r - n < l && (n = Math.max(0, r - l)), i.slice(n, r);
|
|
37
|
-
})();
|
|
38
|
-
return /* @__PURE__ */ c(
|
|
42
|
+
}, [o, f, s, p]);
|
|
43
|
+
const r = q(() => C.sort((e, t) => e - t), [C]);
|
|
44
|
+
return /* @__PURE__ */ u(
|
|
39
45
|
"div",
|
|
40
46
|
{
|
|
41
|
-
ref:
|
|
47
|
+
ref: V,
|
|
42
48
|
role: "group",
|
|
43
49
|
"aria-roledescription": "pagination",
|
|
44
50
|
"aria-label": "pagination",
|
|
45
|
-
className:
|
|
46
|
-
...
|
|
47
|
-
...
|
|
48
|
-
children: /* @__PURE__ */
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
"
|
|
52
|
-
{
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
51
|
+
className: B(`${l}-pagination`, w, `${l}-pagination-${N}`),
|
|
52
|
+
...h,
|
|
53
|
+
...b,
|
|
54
|
+
children: /* @__PURE__ */ u("div", { className: `${l}-pagination-container`, children: /* @__PURE__ */ u(
|
|
55
|
+
"div",
|
|
56
|
+
{
|
|
57
|
+
style: { "--max-width": `${g * 8 + (g - 1) * 12}px` },
|
|
58
|
+
className: `${l}-pagination-container-inner`,
|
|
59
|
+
ref: c,
|
|
60
|
+
children: i.map((e, t) => {
|
|
61
|
+
const m = y === t, d = r.indexOf(t), P = (
|
|
62
|
+
// The dot is out of view
|
|
63
|
+
d === -1 || // The dot must be either among the first two or last two visible dots
|
|
64
|
+
(d <= 1 || d >= r.length - 2) && // Don't shrink if we're showing the first two dots (index 0,1) and both are visible
|
|
65
|
+
!(t <= 1 && r.includes(0) && r.includes(1)) && // Don't shrink if we're showing the last two dots and both are visible
|
|
66
|
+
!(t >= i.length - 2 && r.includes(i.length - 1) && r.includes(i.length - 2))
|
|
67
|
+
);
|
|
68
|
+
return /* @__PURE__ */ u(
|
|
69
|
+
F,
|
|
58
70
|
{
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
71
|
+
onClick: () => O(t),
|
|
72
|
+
isSelected: m,
|
|
73
|
+
baseClassName: l,
|
|
74
|
+
scrollableContainerRef: c,
|
|
75
|
+
onInViewChange: (_) => {
|
|
76
|
+
D(_ ? (I) => [...I, t] : (I) => I.filter((j) => j !== t));
|
|
77
|
+
},
|
|
78
|
+
variant: P ? "sm" : "md"
|
|
79
|
+
},
|
|
80
|
+
`${k}-dot-${t}`
|
|
81
|
+
);
|
|
82
|
+
})
|
|
83
|
+
}
|
|
84
|
+
) })
|
|
68
85
|
}
|
|
69
86
|
);
|
|
70
87
|
}
|
|
71
88
|
);
|
|
72
|
-
|
|
89
|
+
G.displayName = "CarouselDots";
|
|
73
90
|
export {
|
|
74
|
-
|
|
91
|
+
G as default
|
|
75
92
|
};
|
|
@@ -22,6 +22,10 @@ export interface CountdownProps extends ComponentProps<'div'> {
|
|
|
22
22
|
* Locale to use to format date strings
|
|
23
23
|
*/
|
|
24
24
|
locale?: SupportedLanguages;
|
|
25
|
+
/**
|
|
26
|
+
* Displays a border below the Countdown if true
|
|
27
|
+
*/
|
|
28
|
+
showBottomBorder?: boolean;
|
|
25
29
|
/**
|
|
26
30
|
* Variant of the countdown
|
|
27
31
|
*/
|
|
@@ -1,62 +1,64 @@
|
|
|
1
1
|
import { jsxs as d, jsx as e } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as
|
|
2
|
+
import { forwardRef as L, useState as b, useEffect as g } from "react";
|
|
3
3
|
import { getCommonProps as v } from "../../utils/index.js";
|
|
4
4
|
import x from "../../node_modules/classnames/index.js";
|
|
5
|
-
import { SupportedLanguages as
|
|
5
|
+
import { SupportedLanguages as $ } from "../../types/commonTypes.js";
|
|
6
6
|
import { CountdownVariants as i } from "./types.js";
|
|
7
|
-
import { Duration as
|
|
8
|
-
import { zhCN as
|
|
9
|
-
import { enUS as
|
|
10
|
-
import { differenceInDays as
|
|
11
|
-
import { differenceInHours as
|
|
12
|
-
import { differenceInMinutes as
|
|
13
|
-
import { differenceInSeconds as
|
|
14
|
-
const
|
|
7
|
+
import { Duration as a } from "./Duration.js";
|
|
8
|
+
import { zhCN as j } from "../../node_modules/date-fns/locale/zh-CN.js";
|
|
9
|
+
import { enUS as z } from "../../node_modules/date-fns/locale/en-US.js";
|
|
10
|
+
import { differenceInDays as P } from "../../node_modules/date-fns/differenceInDays.js";
|
|
11
|
+
import { differenceInHours as S } from "../../node_modules/date-fns/differenceInHours.js";
|
|
12
|
+
import { differenceInMinutes as _ } from "../../node_modules/date-fns/differenceInMinutes.js";
|
|
13
|
+
import { differenceInSeconds as E } from "../../node_modules/date-fns/differenceInSeconds.js";
|
|
14
|
+
const F = L(
|
|
15
15
|
({
|
|
16
16
|
endDateTime: n,
|
|
17
|
-
formatDurationStr:
|
|
17
|
+
formatDurationStr: m,
|
|
18
18
|
label: l = "Lots Close in",
|
|
19
19
|
intervalDescription: f,
|
|
20
20
|
className: p,
|
|
21
21
|
locale: h = "en",
|
|
22
|
-
|
|
23
|
-
|
|
22
|
+
showBottomBorder: w = !0,
|
|
23
|
+
variant: u = i.default,
|
|
24
|
+
...c
|
|
24
25
|
}, C) => {
|
|
25
|
-
const { className:
|
|
26
|
-
days:
|
|
27
|
-
hours:
|
|
28
|
-
minutes:
|
|
29
|
-
seconds:
|
|
26
|
+
const { className: r, ...y } = v(c, "Countdown"), [t, I] = b(/* @__PURE__ */ new Date()), s = h === $.zh ? j : z, o = {
|
|
27
|
+
days: P(n, t),
|
|
28
|
+
hours: S(n, t) % 24,
|
|
29
|
+
minutes: _(n, t) % 60,
|
|
30
|
+
seconds: E(n, t) % 60 % 60
|
|
30
31
|
};
|
|
31
32
|
return g(() => {
|
|
32
|
-
const
|
|
33
|
-
|
|
33
|
+
const N = setInterval(() => {
|
|
34
|
+
I(/* @__PURE__ */ new Date());
|
|
34
35
|
}, 1e3);
|
|
35
|
-
return () => clearInterval(
|
|
36
|
+
return () => clearInterval(N);
|
|
36
37
|
}, [n]), /* @__PURE__ */ d(
|
|
37
38
|
"div",
|
|
38
39
|
{
|
|
39
|
-
...
|
|
40
|
-
className: x(
|
|
41
|
-
[`${
|
|
40
|
+
...y,
|
|
41
|
+
className: x(r, p, {
|
|
42
|
+
[`${r}--compact`]: u === i.compact,
|
|
43
|
+
[`${r}--show-bottom-border`]: w
|
|
42
44
|
}),
|
|
43
|
-
...
|
|
45
|
+
...c,
|
|
44
46
|
ref: C,
|
|
45
47
|
children: [
|
|
46
|
-
/* @__PURE__ */ d("div", { className: `${
|
|
48
|
+
/* @__PURE__ */ d("div", { className: `${r}__countdown-container`, role: "timer", "aria-label": l, children: [
|
|
47
49
|
/* @__PURE__ */ e("span", { children: l }),
|
|
48
|
-
o.days > 0 ? /* @__PURE__ */ e(
|
|
49
|
-
o.days > 0 || o.hours > 0 ? /* @__PURE__ */ e(
|
|
50
|
-
o.days === 0 ? /* @__PURE__ */ e(
|
|
51
|
-
o.days === 0 && o.hours === 0 ? /* @__PURE__ */ e(
|
|
50
|
+
o.days > 0 ? /* @__PURE__ */ e(a, { duration: o, unit: "days", locale: s, formatDurationStr: m }) : null,
|
|
51
|
+
o.days > 0 || o.hours > 0 ? /* @__PURE__ */ e(a, { duration: o, unit: "hours", locale: s }) : null,
|
|
52
|
+
o.days === 0 ? /* @__PURE__ */ e(a, { duration: o, unit: "minutes", locale: s, formatDurationStr: m }) : null,
|
|
53
|
+
o.days === 0 && o.hours === 0 ? /* @__PURE__ */ e(a, { duration: o, unit: "seconds", locale: s, formatDurationStr: m }) : null
|
|
52
54
|
] }),
|
|
53
|
-
|
|
55
|
+
u === i.default ? /* @__PURE__ */ e("span", { children: f }) : null
|
|
54
56
|
]
|
|
55
57
|
}
|
|
56
58
|
);
|
|
57
59
|
}
|
|
58
60
|
);
|
|
59
|
-
|
|
61
|
+
F.displayName = "Countdown";
|
|
60
62
|
export {
|
|
61
|
-
|
|
63
|
+
F as default
|
|
62
64
|
};
|
|
@@ -4,6 +4,14 @@ export interface PinchZoomProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
4
4
|
* Function to call when the zoom changes.
|
|
5
5
|
*/
|
|
6
6
|
onZoomChange?: (isZoomed: boolean) => void;
|
|
7
|
+
/**
|
|
8
|
+
* Function to call when the user is at the left edge.
|
|
9
|
+
*/
|
|
10
|
+
onAtLeftEdge?: (isAtLeftEdge: boolean) => void;
|
|
11
|
+
/**
|
|
12
|
+
* Function to call when the user is at the right edge.
|
|
13
|
+
*/
|
|
14
|
+
onAtRightEdge?: (isAtRightEdge: boolean) => void;
|
|
7
15
|
/**
|
|
8
16
|
* Children to render.
|
|
9
17
|
*/
|
|
@@ -12,6 +20,10 @@ export interface PinchZoomProps extends React.HTMLAttributes<HTMLDivElement> {
|
|
|
12
20
|
* max zoom level
|
|
13
21
|
*/
|
|
14
22
|
maxZoom?: number;
|
|
23
|
+
/**
|
|
24
|
+
* Force reset the zoom state.
|
|
25
|
+
*/
|
|
26
|
+
isZoomReset?: boolean;
|
|
15
27
|
}
|
|
16
28
|
/**
|
|
17
29
|
* ## Overview
|
|
@@ -1,48 +1,66 @@
|
|
|
1
|
-
import { jsx as
|
|
2
|
-
import { useState as
|
|
3
|
-
import { getCommonProps as
|
|
4
|
-
import { TransformWrapper as
|
|
5
|
-
import
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
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 = ({
|
|
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
|
|
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);
|
|
12
29
|
},
|
|
13
|
-
[s]
|
|
30
|
+
[s, r, e]
|
|
14
31
|
);
|
|
15
|
-
return /* @__PURE__ */
|
|
16
|
-
|
|
32
|
+
return /* @__PURE__ */ S(
|
|
33
|
+
B,
|
|
17
34
|
{
|
|
18
|
-
maxScale:
|
|
19
|
-
onTransformed:
|
|
35
|
+
maxScale: X,
|
|
36
|
+
onTransformed: k,
|
|
20
37
|
minScale: 1,
|
|
21
38
|
disablePadding: !0,
|
|
22
39
|
doubleClick: {
|
|
23
|
-
mode:
|
|
40
|
+
mode: i ? "reset" : "toggle"
|
|
24
41
|
},
|
|
25
42
|
wheel: {
|
|
26
43
|
smoothStep: 0.01
|
|
27
44
|
},
|
|
28
45
|
panning: {
|
|
29
|
-
disabled: !
|
|
46
|
+
disabled: !i
|
|
30
47
|
},
|
|
31
|
-
|
|
32
|
-
|
|
48
|
+
ref: u,
|
|
49
|
+
children: /* @__PURE__ */ S(
|
|
50
|
+
D,
|
|
33
51
|
{
|
|
34
|
-
wrapperProps: {
|
|
35
|
-
wrapperClass:
|
|
36
|
-
[`${
|
|
52
|
+
wrapperProps: { ...$, ...f },
|
|
53
|
+
wrapperClass: T(l, w, {
|
|
54
|
+
[`${l}-zoomed`]: i
|
|
37
55
|
}),
|
|
38
|
-
contentClass: `${
|
|
39
|
-
children:
|
|
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
|
|
40
58
|
}
|
|
41
59
|
)
|
|
42
60
|
}
|
|
43
61
|
);
|
|
44
62
|
};
|
|
45
|
-
|
|
63
|
+
F.displayName = "PinchZoom";
|
|
46
64
|
export {
|
|
47
|
-
|
|
65
|
+
F as default
|
|
48
66
|
};
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import * as v from "react";
|
|
2
|
+
var S = /* @__PURE__ */ new Map(), h = /* @__PURE__ */ new WeakMap(), E = 0, M = void 0;
|
|
3
|
+
function O(e) {
|
|
4
|
+
return e ? (h.has(e) || (E += 1, h.set(e, E.toString())), h.get(e)) : "0";
|
|
5
|
+
}
|
|
6
|
+
function T(e) {
|
|
7
|
+
return Object.keys(e).sort().filter(
|
|
8
|
+
(t) => e[t] !== void 0
|
|
9
|
+
).map((t) => `${t}_${t === "root" ? O(e.root) : e[t]}`).toString();
|
|
10
|
+
}
|
|
11
|
+
function _(e) {
|
|
12
|
+
const t = T(e);
|
|
13
|
+
let n = S.get(t);
|
|
14
|
+
if (!n) {
|
|
15
|
+
const u = /* @__PURE__ */ new Map();
|
|
16
|
+
let c;
|
|
17
|
+
const i = new IntersectionObserver((s) => {
|
|
18
|
+
s.forEach((r) => {
|
|
19
|
+
var o;
|
|
20
|
+
const g = r.isIntersecting && c.some((d) => r.intersectionRatio >= d);
|
|
21
|
+
e.trackVisibility && typeof r.isVisible == "undefined" && (r.isVisible = g), (o = u.get(r.target)) == null || o.forEach((d) => {
|
|
22
|
+
d(g, r);
|
|
23
|
+
});
|
|
24
|
+
});
|
|
25
|
+
}, e);
|
|
26
|
+
c = i.thresholds || (Array.isArray(e.threshold) ? e.threshold : [e.threshold || 0]), n = {
|
|
27
|
+
id: t,
|
|
28
|
+
observer: i,
|
|
29
|
+
elements: u
|
|
30
|
+
}, S.set(t, n);
|
|
31
|
+
}
|
|
32
|
+
return n;
|
|
33
|
+
}
|
|
34
|
+
function x(e, t, n = {}, u = M) {
|
|
35
|
+
if (typeof window.IntersectionObserver == "undefined" && u !== void 0) {
|
|
36
|
+
const o = e.getBoundingClientRect();
|
|
37
|
+
return t(u, {
|
|
38
|
+
isIntersecting: u,
|
|
39
|
+
target: e,
|
|
40
|
+
intersectionRatio: typeof n.threshold == "number" ? n.threshold : 0,
|
|
41
|
+
time: 0,
|
|
42
|
+
boundingClientRect: o,
|
|
43
|
+
intersectionRect: o,
|
|
44
|
+
rootBounds: o
|
|
45
|
+
}), () => {
|
|
46
|
+
};
|
|
47
|
+
}
|
|
48
|
+
const { id: c, observer: i, elements: s } = _(n), r = s.get(e) || [];
|
|
49
|
+
return s.has(e) || s.set(e, r), r.push(t), i.observe(e), function() {
|
|
50
|
+
r.splice(r.indexOf(t), 1), r.length === 0 && (s.delete(e), i.unobserve(e)), s.size === 0 && (i.disconnect(), S.delete(c));
|
|
51
|
+
};
|
|
52
|
+
}
|
|
53
|
+
function B({
|
|
54
|
+
threshold: e,
|
|
55
|
+
delay: t,
|
|
56
|
+
trackVisibility: n,
|
|
57
|
+
rootMargin: u,
|
|
58
|
+
root: c,
|
|
59
|
+
triggerOnce: i,
|
|
60
|
+
skip: s,
|
|
61
|
+
initialInView: r,
|
|
62
|
+
fallbackInView: o,
|
|
63
|
+
onChange: g
|
|
64
|
+
} = {}) {
|
|
65
|
+
var d;
|
|
66
|
+
const [b, V] = v.useState(null), l = v.useRef(), [R, y] = v.useState({
|
|
67
|
+
inView: !!r,
|
|
68
|
+
entry: void 0
|
|
69
|
+
});
|
|
70
|
+
l.current = g, v.useEffect(
|
|
71
|
+
() => {
|
|
72
|
+
if (s || !b) return;
|
|
73
|
+
let a;
|
|
74
|
+
return a = x(
|
|
75
|
+
b,
|
|
76
|
+
(A, I) => {
|
|
77
|
+
y({
|
|
78
|
+
inView: A,
|
|
79
|
+
entry: I
|
|
80
|
+
}), l.current && l.current(A, I), I.isIntersecting && i && a && (a(), a = void 0);
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
root: c,
|
|
84
|
+
rootMargin: u,
|
|
85
|
+
threshold: e,
|
|
86
|
+
// @ts-ignore
|
|
87
|
+
trackVisibility: n,
|
|
88
|
+
// @ts-ignore
|
|
89
|
+
delay: t
|
|
90
|
+
},
|
|
91
|
+
o
|
|
92
|
+
), () => {
|
|
93
|
+
a && a();
|
|
94
|
+
};
|
|
95
|
+
},
|
|
96
|
+
// We break the rule here, because we aren't including the actual `threshold` variable
|
|
97
|
+
// eslint-disable-next-line react-hooks/exhaustive-deps
|
|
98
|
+
[
|
|
99
|
+
// If the threshold is an array, convert it to a string, so it won't change between renders.
|
|
100
|
+
Array.isArray(e) ? e.toString() : e,
|
|
101
|
+
b,
|
|
102
|
+
c,
|
|
103
|
+
u,
|
|
104
|
+
i,
|
|
105
|
+
s,
|
|
106
|
+
n,
|
|
107
|
+
o,
|
|
108
|
+
t
|
|
109
|
+
]
|
|
110
|
+
);
|
|
111
|
+
const w = (d = R.entry) == null ? void 0 : d.target, p = v.useRef();
|
|
112
|
+
!b && w && !i && !s && p.current !== w && (p.current = w, y({
|
|
113
|
+
inView: !!r,
|
|
114
|
+
entry: void 0
|
|
115
|
+
}));
|
|
116
|
+
const f = [V, R.inView, R.entry];
|
|
117
|
+
return f.ref = f[0], f.inView = f[1], f.entry = f[2], f;
|
|
118
|
+
}
|
|
119
|
+
export {
|
|
120
|
+
x as observe,
|
|
121
|
+
B as useInView
|
|
122
|
+
};
|
|
@@ -1,6 +1,10 @@
|
|
|
1
1
|
import { ComponentProps } from 'react';
|
|
2
2
|
import { AuctionStatus } from '../../types/commonTypes';
|
|
3
3
|
export interface SaleHeaderBannerProps extends ComponentProps<'div'> {
|
|
4
|
+
/**
|
|
5
|
+
* The time that lots start to close (for live auctions)
|
|
6
|
+
*/
|
|
7
|
+
auctionEndTime?: Date;
|
|
4
8
|
/**
|
|
5
9
|
* What is the title of the auction?
|
|
6
10
|
*/
|
|
@@ -1,55 +1,58 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as s, jsx as a } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as S } from "react";
|
|
3
|
-
import { getCommonProps as
|
|
3
|
+
import { getCommonProps as k } from "../../utils/index.js";
|
|
4
4
|
import C from "../../node_modules/classnames/index.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import {
|
|
8
|
-
import t from "../../components/Text/
|
|
9
|
-
import
|
|
10
|
-
import
|
|
11
|
-
|
|
5
|
+
import f from "../../components/Countdown/Countdown.js";
|
|
6
|
+
import b from "../../components/SeldonImage/SeldonImage.js";
|
|
7
|
+
import { AuctionStatus as N } from "../../types/commonTypes.js";
|
|
8
|
+
import { TextVariants as t } from "../../components/Text/types.js";
|
|
9
|
+
import o from "../../components/Text/Text.js";
|
|
10
|
+
import j from "../../components/PageContentWrapper/PageContentWrapper.js";
|
|
11
|
+
import H from "../../components/Button/Button.js";
|
|
12
|
+
const P = S(
|
|
12
13
|
({
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
auctionEndTime: r,
|
|
15
|
+
auctionTitle: i,
|
|
16
|
+
imageSrcUrl: h,
|
|
17
|
+
location: v,
|
|
18
|
+
auctionState: l,
|
|
17
19
|
occurrenceInformation: g,
|
|
18
|
-
ctaLabel:
|
|
19
|
-
onClick:
|
|
20
|
-
children:
|
|
21
|
-
className:
|
|
22
|
-
...
|
|
23
|
-
},
|
|
24
|
-
const { className:
|
|
25
|
-
return /* @__PURE__ */
|
|
26
|
-
/* @__PURE__ */ e(
|
|
27
|
-
|
|
20
|
+
ctaLabel: $ = "Register to Bid",
|
|
21
|
+
onClick: u,
|
|
22
|
+
children: B,
|
|
23
|
+
className: w,
|
|
24
|
+
...n
|
|
25
|
+
}, m) => {
|
|
26
|
+
const { className: e, ...c } = k(n, "SaleHeaderBanner"), d = l === N.live, _ = l === N.past;
|
|
27
|
+
return /* @__PURE__ */ s("div", { ...c, className: C(e, w), ...n, ref: m, children: [
|
|
28
|
+
d && r ? /* @__PURE__ */ a("div", { className: `${e}__stack__mobile-countdown`, children: /* @__PURE__ */ a(f, { endDateTime: r, showBottomBorder: !1 }) }) : null,
|
|
29
|
+
/* @__PURE__ */ a(
|
|
30
|
+
b,
|
|
28
31
|
{
|
|
29
32
|
aspectRatio: "16/9",
|
|
30
|
-
src:
|
|
31
|
-
alt: String(
|
|
33
|
+
src: h,
|
|
34
|
+
alt: String(i),
|
|
32
35
|
objectFit: "cover",
|
|
33
|
-
className: `${
|
|
36
|
+
className: `${e}__image`
|
|
34
37
|
}
|
|
35
38
|
),
|
|
36
|
-
/* @__PURE__ */
|
|
37
|
-
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
/* @__PURE__ */
|
|
40
|
-
/* @__PURE__ */
|
|
41
|
-
g.map(({ date: p, occurrenceLabel:
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
/* @__PURE__ */
|
|
39
|
+
/* @__PURE__ */ a(j, { className: `${e}__stack-wrapper`, ...c, ...n, ref: m, children: /* @__PURE__ */ s("div", { className: `${e}__stack`, children: [
|
|
40
|
+
d && r ? /* @__PURE__ */ a("div", { className: `${e}__stack__desktop-countdown`, children: /* @__PURE__ */ a(f, { endDateTime: r }) }) : null,
|
|
41
|
+
/* @__PURE__ */ a(o, { variant: t.title1, children: i }),
|
|
42
|
+
/* @__PURE__ */ a(o, { variant: t.string2, className: `${e}__location`, children: v }),
|
|
43
|
+
/* @__PURE__ */ s("div", { className: `${e}__occurrence-details`, children: [
|
|
44
|
+
g.map(({ date: p, occurrenceLabel: x }) => /* @__PURE__ */ s("div", { className: `${e}__occurrence-details-text`, children: [
|
|
45
|
+
/* @__PURE__ */ a(o, { variant: t.string2, children: x }),
|
|
46
|
+
/* @__PURE__ */ a(o, { variant: t.string2, className: `${e}__date`, children: p })
|
|
44
47
|
] }, String(p))),
|
|
45
|
-
|
|
48
|
+
_ ? B : null
|
|
46
49
|
] }),
|
|
47
|
-
|
|
50
|
+
_ ? null : /* @__PURE__ */ a(H, { className: `${e}__cta`, onClick: u, children: $ })
|
|
48
51
|
] }) })
|
|
49
52
|
] });
|
|
50
53
|
}
|
|
51
54
|
);
|
|
52
|
-
|
|
55
|
+
P.displayName = "SaleHeaderBanner";
|
|
53
56
|
export {
|
|
54
|
-
|
|
57
|
+
P as default
|
|
55
58
|
};
|
|
@@ -60,26 +60,47 @@
|
|
|
60
60
|
}
|
|
61
61
|
|
|
62
62
|
&-container-inner {
|
|
63
|
+
align-items: center;
|
|
63
64
|
display: flex;
|
|
64
65
|
gap: 12px;
|
|
66
|
+
max-width: var(--max-width);
|
|
67
|
+
overflow: auto;
|
|
68
|
+
-webkit-overflow-scrolling: touch;
|
|
69
|
+
-ms-overflow-style: none; /* Internet Explorer 10+ */
|
|
70
|
+
scroll-snap-type: x mandatory;
|
|
71
|
+
scrollbar-width: none; /* Firefox */
|
|
72
|
+
|
|
73
|
+
&::-webkit-scrollbar {
|
|
74
|
+
display: none; /* Safari and Chrome */
|
|
75
|
+
}
|
|
65
76
|
}
|
|
66
77
|
|
|
67
|
-
&-
|
|
78
|
+
&-dot__container {
|
|
68
79
|
align-items: center;
|
|
69
80
|
display: flex;
|
|
70
81
|
height: 8px;
|
|
71
82
|
justify-content: center;
|
|
83
|
+
min-width: 8px;
|
|
72
84
|
padding: 1px;
|
|
85
|
+
scroll-snap-align: center;
|
|
73
86
|
width: 8px;
|
|
74
87
|
}
|
|
75
88
|
|
|
76
89
|
&-dot {
|
|
77
90
|
border-radius: 50%;
|
|
78
|
-
height: 100%;
|
|
79
91
|
outline: 1px solid #adadad;
|
|
80
|
-
width: 100%;
|
|
81
92
|
|
|
82
|
-
|
|
93
|
+
&--md {
|
|
94
|
+
height: 100%;
|
|
95
|
+
width: 100%;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
&--sm {
|
|
99
|
+
height: 50%;
|
|
100
|
+
width: 50%;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
&--selected {
|
|
83
104
|
background-color: #525050;
|
|
84
105
|
outline-color: #525050;
|
|
85
106
|
}
|
|
@@ -4,15 +4,20 @@
|
|
|
4
4
|
@include text($body2);
|
|
5
5
|
|
|
6
6
|
align-items: center;
|
|
7
|
-
border-bottom:
|
|
7
|
+
border-bottom: none;
|
|
8
8
|
display: flex;
|
|
9
9
|
flex-direction: column;
|
|
10
10
|
gap: $spacing-micro;
|
|
11
11
|
justify-content: center;
|
|
12
|
-
margin-bottom:
|
|
12
|
+
margin-bottom: 0;
|
|
13
13
|
padding: 0 $spacing-sm $spacing-sm;
|
|
14
14
|
width: 100%;
|
|
15
15
|
|
|
16
|
+
&--show-bottom-border {
|
|
17
|
+
border-bottom: 1px solid $light-gray;
|
|
18
|
+
margin-bottom: 1.5rem;
|
|
19
|
+
}
|
|
20
|
+
|
|
16
21
|
&__countdown-container {
|
|
17
22
|
@include text($heading5);
|
|
18
23
|
|
|
@@ -21,6 +21,22 @@
|
|
|
21
21
|
height: 100%;
|
|
22
22
|
justify-content: center;
|
|
23
23
|
padding: $spacing-md 0;
|
|
24
|
+
|
|
25
|
+
&__mobile-countdown {
|
|
26
|
+
display: block;
|
|
27
|
+
|
|
28
|
+
@include media($size-md, $type: 'min') {
|
|
29
|
+
display: none;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
&__desktop-countdown {
|
|
34
|
+
display: none;
|
|
35
|
+
|
|
36
|
+
@include media($size-md, $type: 'min') {
|
|
37
|
+
display: block;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
24
40
|
}
|
|
25
41
|
|
|
26
42
|
&__location {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phillips/seldon",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.100.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/PhillipsAuctionHouse/seldon"
|
|
@@ -55,6 +55,7 @@
|
|
|
55
55
|
"embla-carousel-wheel-gestures": "^8.0.1",
|
|
56
56
|
"flatpickr": "^4.6.13",
|
|
57
57
|
"html-react-parser": "^5.1.12",
|
|
58
|
+
"react-intersection-observer": "^9.13.1",
|
|
58
59
|
"react-modal": "^3.16.1",
|
|
59
60
|
"react-transition-group": "^4.4.5",
|
|
60
61
|
"react-zoom-pan-pinch": "^3.6.1",
|