@phillips/seldon 1.143.0 → 1.143.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.
@@ -30,6 +30,9 @@ export interface CountdownProps extends ComponentProps<'div'> {
30
30
  * Variant of the countdown
31
31
  */
32
32
  variant?: CountdownVariants;
33
+ /**
34
+ * The current date time (defaults to new Date())
35
+ */
33
36
  currentDateTime?: Date;
34
37
  }
35
38
  /**
@@ -1,7 +1,7 @@
1
- import { jsxs as S, jsx as e } from "react/jsx-runtime";
2
- import { forwardRef as k } from "react";
3
- import q from "../../node_modules/classnames/index.js";
4
- import { getCommonProps as z, findChildrenOfType as D, findChildrenExcludingTypes as F } from "../../utils/index.js";
1
+ import { jsxs as S, jsx as t } from "react/jsx-runtime";
2
+ import { forwardRef as V } from "react";
3
+ import k from "../../node_modules/classnames/index.js";
4
+ import { getCommonProps as q, findChildrenOfType as z, findChildrenExcludingTypes as F } from "../../utils/index.js";
5
5
  import G from "../DetailList/DetailList.js";
6
6
  import d from "../../components/Detail/Detail.js";
7
7
  import { LotStatus as n, SupportedLanguages as H } from "../../types/commonTypes.js";
@@ -11,66 +11,67 @@ import { BidStatusEnum as Q } from "./types.js";
11
11
  import v from "./BidMessage.js";
12
12
  import { isAfter as L } from "../../node_modules/date-fns/isAfter.js";
13
13
  import { differenceInMinutes as U } from "../../node_modules/date-fns/differenceInMinutes.js";
14
- const X = (o) => o === 1 ? `${o} bid` : `${o} bids`, Y = k(
14
+ const X = (o) => o === 1 ? `${o} bid` : `${o} bids`, Y = V(
15
15
  ({
16
16
  lotStatus: o = n.ready,
17
17
  bidStatus: p,
18
18
  bidsLabelText: w = X,
19
19
  children: c,
20
20
  className: C,
21
- closingText: x = "Closes in",
22
- currency: t = "$",
21
+ closingText: T = "Closes in",
22
+ currency: r = "$",
23
23
  currentBid: f,
24
- currentBidText: N = "Current bid",
25
- formatDurationStr: T = (s) => s.replace(/seconds?/, "sec").replace(/minutes?/, "min"),
24
+ currentBidText: x = "Current bid",
25
+ formatDurationStr: N = (a) => a.replace(/seconds?/, "sec").replace(/minutes?/, "min"),
26
26
  lang: W = "en",
27
- saleCloseDate: r,
28
- lotCloseDate: i,
29
- numberOfBids: h = 0,
27
+ saleCloseDate: i,
28
+ lotCloseDate: l,
29
+ numberOfBids: u = 0,
30
30
  startingBid: y,
31
31
  startingBidText: B = "Starting bid",
32
- soldPrice: u,
32
+ soldPrice: h,
33
33
  soldForText: M = "Sold for",
34
34
  wonForText: j = "Won for",
35
35
  currentDateTime: E = /* @__PURE__ */ new Date(),
36
36
  ...$
37
37
  }, P) => {
38
- const { className: s, ...R } = z($, "BidSnapshot"), l = f !== null && h > 0, b = o === n.ready, a = o === n.live, g = o === n.past, m = E, _ = a && i && L(i, m) && r && (U(r, m) < 60 || L(m, r)), A = D(c, v), I = F(c, [v]), V = q(s, C, {
39
- [`${s}--live`]: a,
40
- [`${s}--has-bids`]: l || g
38
+ const { className: a, ...R } = q($, "BidSnapshot"), m = f !== null && u > 0, b = o === n.ready, s = o === n.live, g = o === n.past, e = E, _ = s && l && L(l, e) && i && (U(i, e) < 60 || L(e, i)), A = z(c, v), D = F(c, [v]), I = k(a, C, {
39
+ [`${a}--live`]: s,
40
+ [`${a}--has-bids`]: m || g
41
41
  });
42
- return /* @__PURE__ */ S("div", { ...R, ...$, ref: P, className: V, children: [
43
- /* @__PURE__ */ S(G, { hasSeparators: !0, className: `${s}__text`, children: [
44
- g ? /* @__PURE__ */ e(
42
+ return /* @__PURE__ */ S("div", { ...R, ...$, ref: P, className: I, children: [
43
+ /* @__PURE__ */ S(G, { hasSeparators: !0, className: `${a}__text`, children: [
44
+ g ? /* @__PURE__ */ t(
45
45
  d,
46
46
  {
47
47
  label: p === Q.Won ? j : M,
48
- value: u ? `${t}${u?.toLocaleString()}` : "",
48
+ value: h ? `${r}${h?.toLocaleString()}` : "",
49
49
  hasWrap: !1
50
50
  }
51
51
  ) : null,
52
- a && l ? /* @__PURE__ */ e(
52
+ s && m ? /* @__PURE__ */ t(
53
53
  d,
54
54
  {
55
- label: N,
56
- subLabel: `(${w(h)})`,
57
- value: `${t}${f?.toLocaleString()}`,
55
+ label: x,
56
+ subLabel: `(${w(u)})`,
57
+ value: `${r}${f?.toLocaleString()}`,
58
58
  hasWrap: !1
59
59
  }
60
60
  ) : null,
61
- b || a && !l ? /* @__PURE__ */ e(d, { label: B, value: `${t}${y?.toLocaleString()}`, hasWrap: !1 }) : null
61
+ b || s && !m ? /* @__PURE__ */ t(d, { label: B, value: `${r}${y?.toLocaleString()}`, hasWrap: !1 }) : null
62
62
  ] }),
63
63
  p && !b ? A : null,
64
- I,
65
- _ ? /* @__PURE__ */ e(
64
+ D,
65
+ _ ? /* @__PURE__ */ t(
66
66
  J,
67
67
  {
68
- endDateTime: i,
69
- label: x,
68
+ endDateTime: l,
69
+ label: T,
70
70
  variant: K.compact,
71
71
  locale: H[W],
72
- formatDurationStr: T,
73
- showBottomBorder: !1
72
+ formatDurationStr: N,
73
+ showBottomBorder: !1,
74
+ currentDateTime: e
74
75
  }
75
76
  ) : null
76
77
  ] });
@@ -72,6 +72,10 @@ export interface SaleHeaderBannerProps extends ComponentProps<'div'> {
72
72
  * What action does the CTA take?
73
73
  */
74
74
  onClick?: () => void;
75
+ /**
76
+ * Current date time (defaults to new Date())
77
+ */
78
+ currentDateTime?: Date;
75
79
  }
76
80
  /**
77
81
  * ## Overview
@@ -1,15 +1,15 @@
1
1
  import { jsxs as n, jsx as a } from "react/jsx-runtime";
2
- import { forwardRef as H } from "react";
3
- import { getCommonProps as M } from "../../utils/index.js";
4
- import R from "../../node_modules/classnames/index.js";
2
+ import { forwardRef as M } from "react";
3
+ import { getCommonProps as R } from "../../utils/index.js";
4
+ import D from "../../node_modules/classnames/index.js";
5
5
  import h from "../../components/Countdown/Countdown.js";
6
- import D from "../../components/SeldonImage/SeldonImage.js";
7
- import { AuctionStatus as F } from "../../types/commonTypes.js";
6
+ import F from "../../components/SeldonImage/SeldonImage.js";
7
+ import { AuctionStatus as O } from "../../types/commonTypes.js";
8
8
  import { TextVariants as r } from "../../components/Text/types.js";
9
9
  import t from "../../components/Text/Text.js";
10
- import O from "../../components/PageContentWrapper/PageContentWrapper.js";
10
+ import q from "../../components/PageContentWrapper/PageContentWrapper.js";
11
11
  import { SSRMediaQuery as f } from "../../providers/SeldonProvider/utils.js";
12
- const q = H(
12
+ const z = M(
13
13
  ({
14
14
  auctionEndTime: i,
15
15
  auctionTitle: o,
@@ -23,23 +23,25 @@ const q = H(
23
23
  countdownFormatDuration: x,
24
24
  auctionState: B,
25
25
  occurrenceInformation: k,
26
- onClick: z,
26
+ onClick: A,
27
27
  children: C,
28
28
  className: P,
29
29
  footerElement: b,
30
30
  headerLabel: j,
31
31
  showTimer: c,
32
+ currentDateTime: y,
32
33
  ...s
33
34
  }, l) => {
34
- const { className: e, ...m } = M(s, "SaleHeaderBanner"), d = B === F.live, _ = {
35
+ const { className: e, ...m } = R(s, "SaleHeaderBanner"), d = B === O.live, _ = {
35
36
  endDateTime: i,
36
37
  label: w,
37
- formatDurationStr: x
38
+ formatDurationStr: x,
39
+ currentDateTime: y
38
40
  };
39
- return /* @__PURE__ */ n("div", { ...m, className: R(e, P), ...s, ref: l, children: [
41
+ return /* @__PURE__ */ n("div", { ...m, className: D(e, P), ...s, ref: l, children: [
40
42
  d && i && c ? /* @__PURE__ */ a(f.Media, { lessThan: "md", children: /* @__PURE__ */ a("div", { className: `${e}__stack__countdown`, children: /* @__PURE__ */ a(h, { ..._, showBottomBorder: !1 }) }) }) : null,
41
43
  /* @__PURE__ */ a(
42
- D,
44
+ F,
43
45
  {
44
46
  aspectRatio: "16/9",
45
47
  src: g,
@@ -52,14 +54,14 @@ const q = H(
52
54
  fetchPriority: S
53
55
  }
54
56
  ),
55
- /* @__PURE__ */ a(O, { className: `${e}__stack-wrapper`, ...m, ...s, ref: l, children: /* @__PURE__ */ n("div", { className: `${e}__stack`, children: [
57
+ /* @__PURE__ */ a(q, { className: `${e}__stack-wrapper`, ...m, ...s, ref: l, children: /* @__PURE__ */ n("div", { className: `${e}__stack`, children: [
56
58
  d && i && c ? /* @__PURE__ */ a(f.Media, { greaterThanOrEqual: "md", children: /* @__PURE__ */ a("div", { className: `${e}__stack__countdown`, children: /* @__PURE__ */ a(h, { ..._ }) }) }) : null,
57
59
  /* @__PURE__ */ a(t, { variant: r.badge, children: j }),
58
60
  /* @__PURE__ */ a(t, { variant: r.title1, children: o }),
59
61
  /* @__PURE__ */ a(t, { variant: r.string2, className: `${e}__location`, children: $ }),
60
62
  /* @__PURE__ */ n("div", { className: `${e}__occurrence-details`, children: [
61
- k.map(({ date: p, occurrenceLabel: y }) => /* @__PURE__ */ n("div", { className: `${e}__occurrence-details-text`, children: [
62
- /* @__PURE__ */ a(t, { variant: r.string2, children: y }),
63
+ k.map(({ date: p, occurrenceLabel: H }) => /* @__PURE__ */ n("div", { className: `${e}__occurrence-details-text`, children: [
64
+ /* @__PURE__ */ a(t, { variant: r.string2, children: H }),
63
65
  /* @__PURE__ */ a(t, { variant: r.string2, className: `${e}__date`, children: p })
64
66
  ] }, String(p))),
65
67
  C
@@ -69,7 +71,7 @@ const q = H(
69
71
  ] });
70
72
  }
71
73
  );
72
- q.displayName = "SaleHeaderBanner";
74
+ z.displayName = "SaleHeaderBanner";
73
75
  export {
74
- q as default
76
+ z as default
75
77
  };
@@ -30,12 +30,12 @@
30
30
 
31
31
  &--compact {
32
32
  .#{$px}-countdown__countdown-container {
33
+ gap: $spacing-xsm;
34
+
33
35
  @include Montserrat;
34
36
  .#{$px}-duration {
35
37
  @include Montserrat;
36
38
  }
37
-
38
- gap: $spacing-xsm;
39
39
  }
40
40
  }
41
41
 
@@ -54,6 +54,7 @@
54
54
  }
55
55
 
56
56
  &--hovered &__submenu {
57
+ cursor: default;
57
58
  left: 0;
58
59
  max-height: calc(90vh - #{$header-height});
59
60
  opacity: 1;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.143.0",
3
+ "version": "1.143.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"