@phillips/seldon 1.105.0 → 1.105.2
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/node_modules/date-fns/isAfter.js +8 -0
- package/dist/patterns/BidSnapshot/BidSnapshot.d.ts +4 -0
- package/dist/patterns/BidSnapshot/BidSnapshot.js +55 -52
- package/dist/patterns/BidSnapshot/BidSnapshot.stories.d.ts +1 -0
- package/dist/patterns/ObjectTile/ObjectTile.d.ts +4 -0
- package/dist/patterns/ObjectTile/ObjectTile.js +65 -64
- package/package.json +1 -1
|
@@ -38,6 +38,10 @@ export interface BidSnapshotProps extends ComponentProps<'div'> {
|
|
|
38
38
|
* Language selection for the application
|
|
39
39
|
*/
|
|
40
40
|
lang?: keyof typeof SupportedLanguages;
|
|
41
|
+
/**
|
|
42
|
+
* When lots start to close for this sale
|
|
43
|
+
*/
|
|
44
|
+
saleCloseDate?: Date | null;
|
|
41
45
|
/**
|
|
42
46
|
* End time for this object
|
|
43
47
|
*/
|
|
@@ -1,76 +1,79 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import
|
|
4
|
-
import { getCommonProps as
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { LotStatus as m, SupportedLanguages as
|
|
8
|
-
import
|
|
9
|
-
import { CountdownVariants as
|
|
10
|
-
import
|
|
11
|
-
|
|
1
|
+
import { jsxs as L, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as q } from "react";
|
|
3
|
+
import z from "../../node_modules/classnames/index.js";
|
|
4
|
+
import { getCommonProps as D, findChildrenOfType as F, findChildrenExcludingTypes as G } from "../../utils/index.js";
|
|
5
|
+
import H from "../DetailList/DetailList.js";
|
|
6
|
+
import d from "../../components/Detail/Detail.js";
|
|
7
|
+
import { LotStatus as m, SupportedLanguages as J } from "../../types/commonTypes.js";
|
|
8
|
+
import K from "../../components/Countdown/Countdown.js";
|
|
9
|
+
import { CountdownVariants as Q } from "../../components/Countdown/types.js";
|
|
10
|
+
import S from "./BidMessage.js";
|
|
11
|
+
import { isAfter as g } from "../../node_modules/date-fns/isAfter.js";
|
|
12
|
+
import { differenceInMinutes as U } from "../../node_modules/date-fns/differenceInMinutes.js";
|
|
13
|
+
const X = (o) => o === 1 ? `${o} bid` : `${o} bids`, Y = q(
|
|
12
14
|
({
|
|
13
|
-
lotStatus:
|
|
14
|
-
bidStatus:
|
|
15
|
-
bidsLabelText:
|
|
16
|
-
children:
|
|
17
|
-
className:
|
|
18
|
-
closingText:
|
|
15
|
+
lotStatus: o = m.ready,
|
|
16
|
+
bidStatus: h,
|
|
17
|
+
bidsLabelText: w = X,
|
|
18
|
+
children: $,
|
|
19
|
+
className: C,
|
|
20
|
+
closingText: x = "Closes in",
|
|
19
21
|
currency: i = "$",
|
|
20
22
|
currentBid: s,
|
|
21
|
-
currentBidText:
|
|
22
|
-
formatDurationStr:
|
|
23
|
-
lang:
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
23
|
+
currentBidText: N = "Current bid",
|
|
24
|
+
formatDurationStr: T = (a) => a.replace(/seconds?/, "sec").replace(/minutes?/, "min"),
|
|
25
|
+
lang: y = "en",
|
|
26
|
+
saleCloseDate: r,
|
|
27
|
+
lotCloseDate: p,
|
|
28
|
+
numberOfBids: b = 0,
|
|
29
|
+
startingBid: f,
|
|
30
|
+
startingBidText: W = "Starting bid",
|
|
28
31
|
soldPrice: e,
|
|
29
|
-
soldForText:
|
|
30
|
-
wonForText:
|
|
31
|
-
|
|
32
|
-
},
|
|
33
|
-
const { className:
|
|
34
|
-
[`${
|
|
35
|
-
[`${
|
|
32
|
+
soldForText: M = "Sold for",
|
|
33
|
+
wonForText: j = "Won for",
|
|
34
|
+
...u
|
|
35
|
+
}, R) => {
|
|
36
|
+
const { className: a, ..._ } = D(u, "BidSnapshot"), n = s !== null && b > 0, v = o === m.ready, l = o === m.live, A = o === m.past, c = /* @__PURE__ */ new Date(), E = l && p && g(p, c) && r && (U(r, c) < 60 || g(c, r)), I = F($, S), V = G($, [S]), k = z(a, C, {
|
|
37
|
+
[`${a}--live`]: l,
|
|
38
|
+
[`${a}--has-bids`]: n
|
|
36
39
|
});
|
|
37
|
-
return /* @__PURE__ */
|
|
38
|
-
/* @__PURE__ */
|
|
39
|
-
|
|
40
|
-
|
|
40
|
+
return /* @__PURE__ */ L("div", { ..._, ...u, ref: R, className: k, children: [
|
|
41
|
+
/* @__PURE__ */ L(H, { hasSeparators: !0, className: `${a}__text`, children: [
|
|
42
|
+
A && n && e ? /* @__PURE__ */ t(
|
|
43
|
+
d,
|
|
41
44
|
{
|
|
42
|
-
label:
|
|
45
|
+
label: h ? j : M,
|
|
43
46
|
value: `${i}${e == null ? void 0 : e.toLocaleString()}`,
|
|
44
47
|
hasWrap: !1
|
|
45
48
|
}
|
|
46
49
|
) : null,
|
|
47
|
-
|
|
48
|
-
|
|
50
|
+
l && n ? /* @__PURE__ */ t(
|
|
51
|
+
d,
|
|
49
52
|
{
|
|
50
|
-
label:
|
|
51
|
-
subLabel: `(${
|
|
53
|
+
label: N,
|
|
54
|
+
subLabel: `(${w(b)})`,
|
|
52
55
|
value: `${i}${s == null ? void 0 : s.toLocaleString()}`,
|
|
53
56
|
hasWrap: !1
|
|
54
57
|
}
|
|
55
58
|
) : null,
|
|
56
|
-
|
|
59
|
+
v || l && !n ? /* @__PURE__ */ t(d, { label: W, value: `${i}${f == null ? void 0 : f.toLocaleString()}`, hasWrap: !1 }) : null
|
|
57
60
|
] }),
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
61
|
+
h && !v ? I : null,
|
|
62
|
+
V,
|
|
63
|
+
E ? /* @__PURE__ */ t(
|
|
64
|
+
K,
|
|
62
65
|
{
|
|
63
|
-
endDateTime:
|
|
64
|
-
label:
|
|
65
|
-
variant:
|
|
66
|
-
locale:
|
|
67
|
-
formatDurationStr:
|
|
66
|
+
endDateTime: p,
|
|
67
|
+
label: x,
|
|
68
|
+
variant: Q.compact,
|
|
69
|
+
locale: J[y],
|
|
70
|
+
formatDurationStr: T
|
|
68
71
|
}
|
|
69
72
|
) : null
|
|
70
73
|
] });
|
|
71
74
|
}
|
|
72
75
|
);
|
|
73
|
-
|
|
76
|
+
Y.displayName = "BidSnapshot";
|
|
74
77
|
export {
|
|
75
|
-
|
|
78
|
+
Y as default
|
|
76
79
|
};
|
|
@@ -16,6 +16,10 @@ export interface ObjectTileProps extends ComponentProps<'a'> {
|
|
|
16
16
|
* Estimate label text.
|
|
17
17
|
*/
|
|
18
18
|
estimateLabelText?: string;
|
|
19
|
+
/**
|
|
20
|
+
* Estimate on request text to use when estimate is not available.
|
|
21
|
+
*/
|
|
22
|
+
estimateOnRequestText?: string;
|
|
19
23
|
/**
|
|
20
24
|
* Element used for favoriting object
|
|
21
25
|
*/
|
|
@@ -1,104 +1,105 @@
|
|
|
1
|
-
import { jsxs as s, jsx as
|
|
2
|
-
import { memo as
|
|
3
|
-
import
|
|
4
|
-
import { getCommonProps as
|
|
1
|
+
import { jsxs as s, jsx as e, Fragment as O } from "react/jsx-runtime";
|
|
2
|
+
import { memo as z, forwardRef as B } from "react";
|
|
3
|
+
import F from "../../node_modules/classnames/index.js";
|
|
4
|
+
import { getCommonProps as I } from "../../utils/index.js";
|
|
5
5
|
import { TextVariants as l } from "../../components/Text/types.js";
|
|
6
6
|
import i from "../../components/Text/Text.js";
|
|
7
|
-
import
|
|
8
|
-
import
|
|
9
|
-
import
|
|
10
|
-
const
|
|
11
|
-
|
|
7
|
+
import L from "../DetailList/DetailList.js";
|
|
8
|
+
import R from "../../components/Detail/Detail.js";
|
|
9
|
+
import V from "../../components/SeldonImage/SeldonImage.js";
|
|
10
|
+
const W = z(
|
|
11
|
+
B(
|
|
12
12
|
({
|
|
13
|
-
badgeText:
|
|
14
|
-
className:
|
|
15
|
-
children:
|
|
13
|
+
badgeText: f,
|
|
14
|
+
className: $,
|
|
15
|
+
children: N,
|
|
16
16
|
element: r,
|
|
17
|
-
estimate:
|
|
18
|
-
estimateLabelText:
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
17
|
+
estimate: n,
|
|
18
|
+
estimateLabelText: g = "Estimate",
|
|
19
|
+
estimateOnRequestText: o,
|
|
20
|
+
favoriteElement: t,
|
|
21
|
+
imageAlt: u = "Brought to you by Phillips",
|
|
22
|
+
imageUrl: b = "",
|
|
23
|
+
imageSrcSet: v,
|
|
24
|
+
imageSizes: j,
|
|
25
|
+
imageLoading: k,
|
|
26
|
+
imageFetchPriority: y,
|
|
27
|
+
lotNumber: P,
|
|
28
|
+
makerText: c,
|
|
29
|
+
modelText: _,
|
|
30
|
+
referenceNumber: d,
|
|
31
|
+
titleText: h,
|
|
32
|
+
withdrawnText: m,
|
|
33
|
+
...p
|
|
34
|
+
}, S) => {
|
|
35
|
+
const { className: a, ...C } = I(p, "ObjectTile"), x = r != null ? r : "a", D = n || o;
|
|
36
|
+
return /* @__PURE__ */ s(x, { ...C, className: F(a, $), ...p, ref: S, children: [
|
|
37
|
+
/* @__PURE__ */ e(
|
|
38
|
+
V,
|
|
38
39
|
{
|
|
39
|
-
alt:
|
|
40
|
+
alt: u,
|
|
40
41
|
aspectRatio: "1/1",
|
|
41
|
-
className: `${
|
|
42
|
+
className: `${a}__img`,
|
|
42
43
|
objectFit: "cover",
|
|
43
|
-
src:
|
|
44
|
-
srcSet:
|
|
45
|
-
sizes:
|
|
46
|
-
loading:
|
|
47
|
-
fetchPriority:
|
|
44
|
+
src: b,
|
|
45
|
+
srcSet: v,
|
|
46
|
+
sizes: j,
|
|
47
|
+
loading: k,
|
|
48
|
+
fetchPriority: y
|
|
48
49
|
}
|
|
49
50
|
),
|
|
50
|
-
|
|
51
|
-
/* @__PURE__ */ s("div", { className: `${
|
|
52
|
-
/* @__PURE__ */
|
|
53
|
-
|
|
51
|
+
m ? null : /* @__PURE__ */ e(i, { className: `${a}__badge`, variant: l.badge, children: f }),
|
|
52
|
+
/* @__PURE__ */ s("div", { className: `${a}__lot-number-like`, children: [
|
|
53
|
+
/* @__PURE__ */ e(i, { className: `${a}__lot-number`, variant: l.heading3, element: "p", children: P }),
|
|
54
|
+
t && /* @__PURE__ */ e(t, {})
|
|
54
55
|
] }),
|
|
55
|
-
|
|
56
|
-
/* @__PURE__ */ s("div", { className: `${
|
|
57
|
-
|
|
58
|
-
|
|
56
|
+
m ? /* @__PURE__ */ e(i, { className: `${a}__withdrawn`, variant: l.heading4, children: m }) : /* @__PURE__ */ s(O, { children: [
|
|
57
|
+
/* @__PURE__ */ s("div", { className: `${a}__meta`, children: [
|
|
58
|
+
c ? /* @__PURE__ */ e(i, { className: `${a}__maker`, variant: l.heading3, children: c }) : null,
|
|
59
|
+
h ? /* @__PURE__ */ e(
|
|
59
60
|
i,
|
|
60
61
|
{
|
|
61
|
-
className: `${
|
|
62
|
+
className: `${a}__title ${a}__token-fix`,
|
|
62
63
|
variant: l.heading4,
|
|
63
64
|
element: "cite",
|
|
64
|
-
children:
|
|
65
|
+
children: h
|
|
65
66
|
}
|
|
66
67
|
) : null,
|
|
67
|
-
|
|
68
|
+
d ? /* @__PURE__ */ e(
|
|
68
69
|
i,
|
|
69
70
|
{
|
|
70
|
-
className: `${
|
|
71
|
+
className: `${a}__reference-number ${a}__token-fix`,
|
|
71
72
|
variant: l.heading4,
|
|
72
73
|
element: "p",
|
|
73
|
-
children:
|
|
74
|
+
children: d
|
|
74
75
|
}
|
|
75
76
|
) : null,
|
|
76
|
-
|
|
77
|
+
_ ? /* @__PURE__ */ e(
|
|
77
78
|
i,
|
|
78
79
|
{
|
|
79
|
-
className: `${
|
|
80
|
+
className: `${a}__model ${a}__token-fix`,
|
|
80
81
|
variant: l.heading4,
|
|
81
82
|
element: "p",
|
|
82
|
-
children:
|
|
83
|
+
children: _
|
|
83
84
|
}
|
|
84
85
|
) : null
|
|
85
86
|
] }),
|
|
86
|
-
|
|
87
|
-
|
|
87
|
+
D ? /* @__PURE__ */ e(L, { hasSeparators: !0, className: `${a}__estimate ${a}__section`, children: /* @__PURE__ */ e(
|
|
88
|
+
R,
|
|
88
89
|
{
|
|
89
|
-
className: `${
|
|
90
|
-
label:
|
|
91
|
-
value:
|
|
90
|
+
className: `${a}__estimate__label`,
|
|
91
|
+
label: g,
|
|
92
|
+
value: n || o,
|
|
92
93
|
hasWrap: !1
|
|
93
94
|
}
|
|
94
95
|
) }) : null,
|
|
95
|
-
/* @__PURE__ */
|
|
96
|
+
/* @__PURE__ */ e("div", { className: `${a}__section`, children: N })
|
|
96
97
|
] })
|
|
97
98
|
] });
|
|
98
99
|
}
|
|
99
100
|
)
|
|
100
101
|
);
|
|
101
|
-
|
|
102
|
+
W.displayName = "ObjectTile";
|
|
102
103
|
export {
|
|
103
|
-
|
|
104
|
+
W as default
|
|
104
105
|
};
|