@phillips/seldon 1.108.0 → 1.108.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.
@@ -4,30 +4,30 @@ import { getCommonProps as v } from "../../utils/index.js";
4
4
  import x from "../../node_modules/classnames/index.js";
5
5
  import { SupportedLanguages as $ } from "../../types/commonTypes.js";
6
6
  import { CountdownVariants as i } from "./types.js";
7
- import { Duration as a } from "./Duration.js";
7
+ import { Duration as m } from "./Duration.js";
8
8
  import { zhCN as j } from "../../node_modules/date-fns/locale/zh-CN.js";
9
9
  import { enUS as z } from "../../node_modules/date-fns/locale/en-US.js";
10
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(
11
+ import { differenceInHours as _ } from "../../node_modules/date-fns/differenceInHours.js";
12
+ import { differenceInMinutes as E } from "../../node_modules/date-fns/differenceInMinutes.js";
13
+ import { differenceInSeconds as F } from "../../node_modules/date-fns/differenceInSeconds.js";
14
+ const H = L(
15
15
  ({
16
16
  endDateTime: n,
17
- formatDurationStr: m,
17
+ formatDurationStr: r,
18
18
  label: l = "Lots Close in",
19
19
  intervalDescription: f,
20
20
  className: p,
21
21
  locale: h = "en",
22
22
  showBottomBorder: w = !0,
23
- variant: u = i.default,
24
- ...c
23
+ variant: c = i.default,
24
+ ...u
25
25
  }, C) => {
26
- const { className: r, ...y } = v(c, "Countdown"), [t, I] = b(/* @__PURE__ */ new Date()), s = h === $.zh ? j : z, o = {
26
+ const { className: s, ...y } = v(u, "Countdown"), [t, I] = b(/* @__PURE__ */ new Date()), a = h === $.zh ? j : z, o = {
27
27
  days: P(n, t),
28
- hours: S(n, t) % 24,
29
- minutes: _(n, t) % 60,
30
- seconds: E(n, t) % 60 % 60
28
+ hours: _(n, t) % 24,
29
+ minutes: E(n, t) % 60,
30
+ seconds: F(n, t) % 60 % 60
31
31
  };
32
32
  return g(() => {
33
33
  const N = setInterval(() => {
@@ -38,27 +38,27 @@ const F = L(
38
38
  "div",
39
39
  {
40
40
  ...y,
41
- className: x(r, p, {
42
- [`${r}--compact`]: u === i.compact,
43
- [`${r}--show-bottom-border`]: w
41
+ className: x(s, p, {
42
+ [`${s}--compact`]: c === i.compact,
43
+ [`${s}--show-bottom-border`]: w
44
44
  }),
45
- ...c,
45
+ ...u,
46
46
  ref: C,
47
47
  children: [
48
- /* @__PURE__ */ d("div", { className: `${r}__countdown-container`, role: "timer", "aria-label": l, children: [
48
+ /* @__PURE__ */ d("div", { className: `${s}__countdown-container`, role: "timer", "aria-label": l, children: [
49
49
  /* @__PURE__ */ e("span", { children: l }),
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
50
+ o.days > 0 ? /* @__PURE__ */ e(m, { duration: o, unit: "days", locale: a, formatDurationStr: r }) : null,
51
+ o.days > 0 || o.hours > 0 ? /* @__PURE__ */ e(m, { duration: o, unit: "hours", locale: a, formatDurationStr: r }) : null,
52
+ o.days === 0 ? /* @__PURE__ */ e(m, { duration: o, unit: "minutes", locale: a, formatDurationStr: r }) : null,
53
+ o.days === 0 && o.hours === 0 ? /* @__PURE__ */ e(m, { duration: o, unit: "seconds", locale: a, formatDurationStr: r }) : null
54
54
  ] }),
55
- u === i.default ? /* @__PURE__ */ e("span", { children: f }) : null
55
+ c === i.default ? /* @__PURE__ */ e("span", { children: f }) : null
56
56
  ]
57
57
  }
58
58
  );
59
59
  }
60
60
  );
61
- F.displayName = "Countdown";
61
+ H.displayName = "Countdown";
62
62
  export {
63
- F as default
63
+ H as default
64
64
  };
@@ -1,4 +1,5 @@
1
1
  import { ComponentProps } from 'react';
2
+ import { CountdownProps } from '../../components/Countdown';
2
3
  import { AuctionStatus } from '../../types/commonTypes';
3
4
  export interface SaleHeaderBannerProps extends ComponentProps<'div'> {
4
5
  /**
@@ -33,6 +34,14 @@ export interface SaleHeaderBannerProps extends ComponentProps<'div'> {
33
34
  * Where is the auction taking place?
34
35
  */
35
36
  location: React.ReactNode;
37
+ /**
38
+ * Lots close in text
39
+ */
40
+ countdownTimerLabel?: CountdownProps['label'];
41
+ /**
42
+ * The format of the countdown timer durations, i.e. minutes, hours, days, seconds (this is used for translating the countdown timer
43
+ */
44
+ countdownFormatDuration?: CountdownProps['formatDurationStr'];
36
45
  occurrenceInformation: {
37
46
  /**
38
47
  * Depending on auction state, when does the auction open or close
@@ -1,67 +1,73 @@
1
- import { jsxs as i, jsx as e } from "react/jsx-runtime";
2
- import { forwardRef as C } from "react";
3
- import { getCommonProps as b } from "../../utils/index.js";
4
- import P from "../../node_modules/classnames/index.js";
5
- import _ from "../../components/Countdown/Countdown.js";
6
- import j from "../../components/SeldonImage/SeldonImage.js";
7
- import { AuctionStatus as H } from "../../types/commonTypes.js";
1
+ import { jsxs as o, jsx as a } from "react/jsx-runtime";
2
+ import { forwardRef as j } from "react";
3
+ import { getCommonProps as H } from "../../utils/index.js";
4
+ import y from "../../node_modules/classnames/index.js";
5
+ import p from "../../components/Countdown/Countdown.js";
6
+ import D from "../../components/SeldonImage/SeldonImage.js";
7
+ import { AuctionStatus as F } 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 y from "../../components/PageContentWrapper/PageContentWrapper.js";
11
- const D = C(
10
+ import R from "../../components/PageContentWrapper/PageContentWrapper.js";
11
+ const z = j(
12
12
  ({
13
13
  auctionEndTime: s,
14
- auctionTitle: n,
15
- imageSrcUrl: p,
16
- imageSrcSet: f,
17
- imageSizes: h,
18
- imageLoading: v,
19
- imageFetchPriority: N,
20
- location: g,
21
- auctionState: $,
22
- occurrenceInformation: S,
23
- onClick: F,
24
- children: u,
25
- className: k,
26
- footerElement: w,
27
- headerLabel: x,
28
- ...o
14
+ auctionTitle: i,
15
+ imageSrcUrl: f,
16
+ imageSrcSet: h,
17
+ imageSizes: v,
18
+ imageLoading: N,
19
+ imageFetchPriority: g,
20
+ location: u,
21
+ countdownTimerLabel: S,
22
+ countdownFormatDuration: $,
23
+ auctionState: w,
24
+ occurrenceInformation: k,
25
+ onClick: A,
26
+ children: x,
27
+ className: B,
28
+ footerElement: b,
29
+ headerLabel: C,
30
+ ...n
29
31
  }, c) => {
30
- const { className: a, ...l } = b(o, "SaleHeaderBanner"), m = $ === H.live;
31
- return /* @__PURE__ */ i("div", { ...l, className: P(a, k), ...o, ref: c, children: [
32
- m && s ? /* @__PURE__ */ e("div", { className: `${a}__stack__mobile-countdown`, children: /* @__PURE__ */ e(_, { endDateTime: s, showBottomBorder: !1 }) }) : null,
33
- /* @__PURE__ */ e(
34
- j,
32
+ const { className: e, ...l } = H(n, "SaleHeaderBanner"), m = w === F.live, d = {
33
+ endDateTime: s,
34
+ label: S,
35
+ formatDurationStr: $
36
+ };
37
+ return /* @__PURE__ */ o("div", { ...l, className: y(e, B), ...n, ref: c, children: [
38
+ m && s ? /* @__PURE__ */ a("div", { className: `${e}__stack__mobile-countdown`, children: /* @__PURE__ */ a(p, { ...d, showBottomBorder: !1 }) }) : null,
39
+ /* @__PURE__ */ a(
40
+ D,
35
41
  {
36
42
  aspectRatio: "16/9",
37
- src: p,
38
- alt: String(n),
43
+ src: f,
44
+ alt: String(i),
39
45
  objectFit: "cover",
40
- className: `${a}__image`,
41
- srcSet: f,
42
- sizes: h,
43
- loading: v,
44
- fetchPriority: N
46
+ className: `${e}__image`,
47
+ srcSet: h,
48
+ sizes: v,
49
+ loading: N,
50
+ fetchPriority: g
45
51
  }
46
52
  ),
47
- /* @__PURE__ */ e(y, { className: `${a}__stack-wrapper`, ...l, ...o, ref: c, children: /* @__PURE__ */ i("div", { className: `${a}__stack`, children: [
48
- m && s ? /* @__PURE__ */ e("div", { className: `${a}__stack__desktop-countdown`, children: /* @__PURE__ */ e(_, { endDateTime: s }) }) : null,
49
- /* @__PURE__ */ e(t, { variant: r.badge, children: x }),
50
- /* @__PURE__ */ e(t, { variant: r.title1, children: n }),
51
- /* @__PURE__ */ e(t, { variant: r.string2, className: `${a}__location`, children: g }),
52
- /* @__PURE__ */ i("div", { className: `${a}__occurrence-details`, children: [
53
- S.map(({ date: d, occurrenceLabel: B }) => /* @__PURE__ */ i("div", { className: `${a}__occurrence-details-text`, children: [
54
- /* @__PURE__ */ e(t, { variant: r.string2, children: B }),
55
- /* @__PURE__ */ e(t, { variant: r.string2, className: `${a}__date`, children: d })
56
- ] }, String(d))),
57
- u
53
+ /* @__PURE__ */ a(R, { className: `${e}__stack-wrapper`, ...l, ...n, ref: c, children: /* @__PURE__ */ o("div", { className: `${e}__stack`, children: [
54
+ m && s ? /* @__PURE__ */ a("div", { className: `${e}__stack__desktop-countdown`, children: /* @__PURE__ */ a(p, { ...d }) }) : null,
55
+ /* @__PURE__ */ a(t, { variant: r.badge, children: C }),
56
+ /* @__PURE__ */ a(t, { variant: r.title1, children: i }),
57
+ /* @__PURE__ */ a(t, { variant: r.string2, className: `${e}__location`, children: u }),
58
+ /* @__PURE__ */ o("div", { className: `${e}__occurrence-details`, children: [
59
+ k.map(({ date: _, occurrenceLabel: P }) => /* @__PURE__ */ o("div", { className: `${e}__occurrence-details-text`, children: [
60
+ /* @__PURE__ */ a(t, { variant: r.string2, children: P }),
61
+ /* @__PURE__ */ a(t, { variant: r.string2, className: `${e}__date`, children: _ })
62
+ ] }, String(_))),
63
+ x
58
64
  ] }),
59
- w
65
+ b
60
66
  ] }) })
61
67
  ] });
62
68
  }
63
69
  );
64
- D.displayName = "SaleHeaderBanner";
70
+ z.displayName = "SaleHeaderBanner";
65
71
  export {
66
- D as default
72
+ z as default
67
73
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.108.0",
3
+ "version": "1.108.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"
@@ -121,7 +121,7 @@
121
121
  "ts-node": "^10.9.2",
122
122
  "type-fest": "^4.27.0",
123
123
  "typescript": "^5.5.4",
124
- "vite": "^5.4.6",
124
+ "vite": "^5.4.14",
125
125
  "vite-plugin-dts": "^4.2.4",
126
126
  "vite-plugin-svgr": "^4.2.0",
127
127
  "vite-tsconfig-paths": "^4.3.2",