@phillips/seldon 1.98.1 → 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.
@@ -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 N, useState as L, useEffect as g } from "react";
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 j } from "../../types/commonTypes.js";
5
+ import { SupportedLanguages as $ } from "../../types/commonTypes.js";
6
6
  import { CountdownVariants as i } from "./types.js";
7
- import { Duration as s } from "./Duration.js";
8
- import { zhCN as z } from "../../node_modules/date-fns/locale/zh-CN.js";
9
- import { enUS as P } from "../../node_modules/date-fns/locale/en-US.js";
10
- import { differenceInDays as S } from "../../node_modules/date-fns/differenceInDays.js";
11
- import { differenceInHours as _ } from "../../node_modules/date-fns/differenceInHours.js";
12
- import { differenceInMinutes as $ } from "../../node_modules/date-fns/differenceInMinutes.js";
13
- import { differenceInSeconds as b } from "../../node_modules/date-fns/differenceInSeconds.js";
14
- const E = N(
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: a,
17
+ formatDurationStr: m,
18
18
  label: l = "Lots Close in",
19
19
  intervalDescription: f,
20
20
  className: p,
21
21
  locale: h = "en",
22
- variant: c = i.default,
23
- ...u
22
+ showBottomBorder: w = !0,
23
+ variant: u = i.default,
24
+ ...c
24
25
  }, C) => {
25
- const { className: m, ...w } = v(u, "Countdown"), [r, y] = L(/* @__PURE__ */ new Date()), t = h === j.zh ? z : P, o = {
26
- days: S(n, r),
27
- hours: _(n, r) % 24,
28
- minutes: $(n, r) % 60,
29
- seconds: b(n, r) % 60 % 60
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 I = setInterval(() => {
33
- y(/* @__PURE__ */ new Date());
33
+ const N = setInterval(() => {
34
+ I(/* @__PURE__ */ new Date());
34
35
  }, 1e3);
35
- return () => clearInterval(I);
36
+ return () => clearInterval(N);
36
37
  }, [n]), /* @__PURE__ */ d(
37
38
  "div",
38
39
  {
39
- ...w,
40
- className: x(m, p, {
41
- [`${m}--compact`]: c === i.compact
40
+ ...y,
41
+ className: x(r, p, {
42
+ [`${r}--compact`]: u === i.compact,
43
+ [`${r}--show-bottom-border`]: w
42
44
  }),
43
- ...u,
45
+ ...c,
44
46
  ref: C,
45
47
  children: [
46
- /* @__PURE__ */ d("div", { className: `${m}__countdown-container`, role: "timer", "aria-label": l, children: [
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(s, { duration: o, unit: "days", locale: t, formatDurationStr: a }) : null,
49
- o.days > 0 || o.hours > 0 ? /* @__PURE__ */ e(s, { duration: o, unit: "hours", locale: t }) : null,
50
- o.days === 0 ? /* @__PURE__ */ e(s, { duration: o, unit: "minutes", locale: t, formatDurationStr: a }) : null,
51
- o.days === 0 && o.hours === 0 ? /* @__PURE__ */ e(s, { duration: o, unit: "seconds", locale: t, formatDurationStr: a }) : null
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
- c === i.default ? /* @__PURE__ */ e("span", { children: f }) : null
55
+ u === i.default ? /* @__PURE__ */ e("span", { children: f }) : null
54
56
  ]
55
57
  }
56
58
  );
57
59
  }
58
60
  );
59
- E.displayName = "Countdown";
61
+ F.displayName = "Countdown";
60
62
  export {
61
- E as default
63
+ F as default
62
64
  };
@@ -1,4 +1,4 @@
1
- import { __module as t } from "../../_virtual/index5.js";
1
+ import { __module as t } from "../../_virtual/index6.js";
2
2
  /*!
3
3
  Copyright (c) 2015 Jed Watson.
4
4
  Based on code that is Copyright 2013-2015, Facebook, Inc.
@@ -1,4 +1,4 @@
1
- import { __module as e } from "../../../../_virtual/index6.js";
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;
@@ -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 r, jsx as e } from "react/jsx-runtime";
1
+ import { jsxs as s, jsx as a } from "react/jsx-runtime";
2
2
  import { forwardRef as S } from "react";
3
- import { getCommonProps as u } from "../../utils/index.js";
3
+ import { getCommonProps as k } from "../../utils/index.js";
4
4
  import C from "../../node_modules/classnames/index.js";
5
- import j from "../../components/SeldonImage/SeldonImage.js";
6
- import { AuctionStatus as _ } from "../../types/commonTypes.js";
7
- import { TextVariants as s } from "../../components/Text/types.js";
8
- import t from "../../components/Text/Text.js";
9
- import H from "../../components/PageContentWrapper/PageContentWrapper.js";
10
- import P from "../../components/Button/Button.js";
11
- const R = S(
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
- auctionTitle: o,
14
- imageSrcUrl: f,
15
- location: N,
16
- auctionState: n,
14
+ auctionEndTime: r,
15
+ auctionTitle: i,
16
+ imageSrcUrl: h,
17
+ location: v,
18
+ auctionState: l,
17
19
  occurrenceInformation: g,
18
- ctaLabel: v = "Register to Bid",
19
- onClick: h,
20
- children: m,
21
- className: $,
22
- ...i
23
- }, c) => {
24
- const { className: a, ...l } = u(i, "SaleHeaderBanner"), x = n === _.live, d = n === _.past;
25
- return /* @__PURE__ */ r("div", { ...l, className: C(a, $), ...i, ref: c, children: [
26
- /* @__PURE__ */ e(
27
- j,
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: f,
31
- alt: String(o),
33
+ src: h,
34
+ alt: String(i),
32
35
  objectFit: "cover",
33
- className: `${a}__image`
36
+ className: `${e}__image`
34
37
  }
35
38
  ),
36
- /* @__PURE__ */ e(H, { className: `${a}__stack-wrapper`, ...l, ...i, ref: c, children: /* @__PURE__ */ r("div", { className: `${a}__stack`, children: [
37
- x && m,
38
- /* @__PURE__ */ e(t, { variant: s.title1, children: o }),
39
- /* @__PURE__ */ e(t, { variant: s.string2, className: `${a}__location`, children: N }),
40
- /* @__PURE__ */ r("div", { className: `${a}__occurrence-details`, children: [
41
- g.map(({ date: p, occurrenceLabel: B }) => /* @__PURE__ */ r("div", { className: `${a}__occurrence-details-text`, children: [
42
- /* @__PURE__ */ e(t, { variant: s.string2, children: B }),
43
- /* @__PURE__ */ e(t, { variant: s.string2, className: `${a}__date`, children: p })
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
- d && m
48
+ _ ? B : null
46
49
  ] }),
47
- !d && /* @__PURE__ */ e(P, { className: `${a}__cta`, onClick: h, children: v })
50
+ _ ? null : /* @__PURE__ */ a(H, { className: `${e}__cta`, onClick: u, children: $ })
48
51
  ] }) })
49
52
  ] });
50
53
  }
51
54
  );
52
- R.displayName = "SaleHeaderBanner";
55
+ P.displayName = "SaleHeaderBanner";
53
56
  export {
54
- R as default
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: 1px solid $light-gray;
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: 1.5rem;
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.98.1",
3
+ "version": "1.99.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"