@phillips/seldon 1.98.0 → 1.99.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/Countdown/Countdown.d.ts +4 -0
- package/dist/components/Countdown/Countdown.js +35 -33
- package/dist/node_modules/exenv/index.js +1 -1
- package/dist/node_modules/prop-types/node_modules/react-is/index.js +1 -1
- package/dist/patterns/BidSnapshot/BidSnapshot.d.ts +4 -0
- package/dist/patterns/BidSnapshot/BidSnapshot.js +59 -50
- package/dist/patterns/BidSnapshot/BidSnapshot.stories.d.ts +7 -0
- package/dist/patterns/SaleHeaderBanner/SaleHeaderBanner.d.ts +4 -0
- package/dist/patterns/SaleHeaderBanner/SaleHeaderBanner.js +41 -38
- package/dist/scss/components/Countdown/_countdown.scss +7 -2
- package/dist/scss/patterns/SaleHeaderBanner/_saleHeaderBanner.scss +16 -0
- package/package.json +1 -1
|
@@ -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
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { __module as e } from "../../../../_virtual/
|
|
1
|
+
import { __module as e } from "../../../../_virtual/index5.js";
|
|
2
2
|
import { __require as o } from "./cjs/react-is.production.min.js";
|
|
3
3
|
import { __require as t } from "./cjs/react-is.development.js";
|
|
4
4
|
var r;
|
|
@@ -54,6 +54,10 @@ export interface BidSnapshotProps extends ComponentProps<'div'> {
|
|
|
54
54
|
* Starting bid text, a string for label of starting bid detail
|
|
55
55
|
*/
|
|
56
56
|
startingBidText?: string;
|
|
57
|
+
/**
|
|
58
|
+
* Sold For amount
|
|
59
|
+
* */
|
|
60
|
+
soldPrice?: number;
|
|
57
61
|
/**
|
|
58
62
|
* Sold for label text, a string for label of sold for detail
|
|
59
63
|
*/
|
|
@@ -1,67 +1,76 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as u, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as V } from "react";
|
|
3
3
|
import k from "../../node_modules/classnames/index.js";
|
|
4
4
|
import { getCommonProps as q, findChildrenOfType as z, findChildrenExcludingTypes as A } from "../../utils/index.js";
|
|
5
5
|
import F from "../DetailList/DetailList.js";
|
|
6
|
-
import
|
|
7
|
-
import { LotStatus as
|
|
8
|
-
import
|
|
9
|
-
import { CountdownVariants as
|
|
10
|
-
import
|
|
11
|
-
|
|
12
|
-
const K = (o) => o === 1 ? `${o} bid` : `${o} bids`, Q = V(
|
|
6
|
+
import p from "../../components/Detail/Detail.js";
|
|
7
|
+
import { LotStatus as m, SupportedLanguages as G } from "../../types/commonTypes.js";
|
|
8
|
+
import H from "../../components/Countdown/Countdown.js";
|
|
9
|
+
import { CountdownVariants as I } from "../../components/Countdown/types.js";
|
|
10
|
+
import C from "./BidMessage.js";
|
|
11
|
+
const J = (a) => a === 1 ? `${a} bid` : `${a} bids`, K = V(
|
|
13
12
|
({
|
|
14
|
-
lotStatus:
|
|
15
|
-
bidStatus:
|
|
16
|
-
bidsLabelText:
|
|
17
|
-
children:
|
|
18
|
-
className:
|
|
19
|
-
closingText:
|
|
20
|
-
currency:
|
|
21
|
-
currentBid:
|
|
22
|
-
currentBidText:
|
|
23
|
-
formatDurationStr:
|
|
24
|
-
lang:
|
|
13
|
+
lotStatus: a = m.ready,
|
|
14
|
+
bidStatus: f,
|
|
15
|
+
bidsLabelText: v = J,
|
|
16
|
+
children: c,
|
|
17
|
+
className: L,
|
|
18
|
+
closingText: S = "Closes in",
|
|
19
|
+
currency: i = "$",
|
|
20
|
+
currentBid: s,
|
|
21
|
+
currentBidText: g = "Current bid",
|
|
22
|
+
formatDurationStr: x = (o) => o.replace(/seconds?/, "sec").replace(/minutes?/, "min"),
|
|
23
|
+
lang: N = "en",
|
|
25
24
|
lotCloseDate: d,
|
|
26
|
-
numberOfBids:
|
|
27
|
-
startingBid:
|
|
28
|
-
startingBidText:
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
25
|
+
numberOfBids: h = 0,
|
|
26
|
+
startingBid: r,
|
|
27
|
+
startingBidText: T = "Starting bid",
|
|
28
|
+
soldPrice: e,
|
|
29
|
+
soldForText: w = "Sold for",
|
|
30
|
+
wonForText: y = "Won for",
|
|
31
|
+
...$
|
|
32
32
|
}, W) => {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
[`${
|
|
36
|
-
[`${s}--has-bids`]: n
|
|
33
|
+
const { className: o, ...j } = q($, "BidSnapshot"), l = s !== null && h > 0, b = a === m.ready, n = a === m.live, D = a === m.past, M = n && d, R = z(c, C), _ = A(c, [C]), E = k(o, L, {
|
|
34
|
+
[`${o}--live`]: n,
|
|
35
|
+
[`${o}--has-bids`]: l
|
|
37
36
|
});
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
37
|
+
return /* @__PURE__ */ u("div", { ...j, ...$, ref: W, className: E, children: [
|
|
38
|
+
/* @__PURE__ */ u(F, { hasSeparators: !0, className: `${o}__text`, children: [
|
|
39
|
+
D && l && e ? /* @__PURE__ */ t(
|
|
40
|
+
p,
|
|
41
|
+
{
|
|
42
|
+
label: f ? y : w,
|
|
43
|
+
value: `${i}${e == null ? void 0 : e.toLocaleString()}`,
|
|
44
|
+
hasWrap: !1
|
|
45
|
+
}
|
|
46
|
+
) : null,
|
|
47
|
+
n && l ? /* @__PURE__ */ t(
|
|
48
|
+
p,
|
|
49
|
+
{
|
|
50
|
+
label: g,
|
|
51
|
+
subLabel: `(${v(h)})`,
|
|
52
|
+
value: `${i}${s == null ? void 0 : s.toLocaleString()}`,
|
|
53
|
+
hasWrap: !1
|
|
54
|
+
}
|
|
55
|
+
) : null,
|
|
56
|
+
b || n && !l ? /* @__PURE__ */ t(p, { label: T, value: `${i}${r == null ? void 0 : r.toLocaleString()}`, hasWrap: !1 }) : null
|
|
57
|
+
] }),
|
|
58
|
+
f && !b ? R : null,
|
|
59
|
+
_,
|
|
60
|
+
M ? /* @__PURE__ */ t(
|
|
61
|
+
H,
|
|
53
62
|
{
|
|
54
63
|
endDateTime: d,
|
|
55
|
-
label:
|
|
56
|
-
variant:
|
|
57
|
-
locale:
|
|
58
|
-
formatDurationStr:
|
|
64
|
+
label: S,
|
|
65
|
+
variant: I.compact,
|
|
66
|
+
locale: G[N],
|
|
67
|
+
formatDurationStr: x
|
|
59
68
|
}
|
|
60
69
|
) : null
|
|
61
70
|
] });
|
|
62
71
|
}
|
|
63
72
|
);
|
|
64
|
-
|
|
73
|
+
K.displayName = "BidSnapshot";
|
|
65
74
|
export {
|
|
66
|
-
|
|
75
|
+
K as default
|
|
67
76
|
};
|
|
@@ -24,6 +24,7 @@ export declare const Playground: {
|
|
|
24
24
|
lotCloseDate: Date;
|
|
25
25
|
lang: import('date-fns').Locale;
|
|
26
26
|
startingBid: number;
|
|
27
|
+
soldPrice: number;
|
|
27
28
|
};
|
|
28
29
|
argTypes: {
|
|
29
30
|
bidStatus: {
|
|
@@ -32,5 +33,11 @@ export declare const Playground: {
|
|
|
32
33
|
type: string;
|
|
33
34
|
};
|
|
34
35
|
};
|
|
36
|
+
auctionStatus: {
|
|
37
|
+
options: typeof LotStatus;
|
|
38
|
+
control: {
|
|
39
|
+
type: string;
|
|
40
|
+
};
|
|
41
|
+
};
|
|
35
42
|
};
|
|
36
43
|
};
|
|
@@ -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
|
};
|
|
@@ -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 {
|