@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.
@@ -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;
@@ -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 _, jsx as l } from "react/jsx-runtime";
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 G from "../../components/Detail/Detail.js";
7
- import { LotStatus as a, SupportedLanguages as H } from "../../types/commonTypes.js";
8
- import I from "../../components/Countdown/Countdown.js";
9
- import { CountdownVariants as J } from "../../components/Countdown/types.js";
10
- import { BidStatusEnum as u } from "./types.js";
11
- import g from "./BidMessage.js";
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: o = a.ready,
15
- bidStatus: e,
16
- bidsLabelText: C = K,
17
- children: m,
18
- className: $,
19
- closingText: b = "Closes in",
20
- currency: v = "$",
21
- currentBid: i,
22
- currentBidText: y = "Current bid",
23
- formatDurationStr: L = (s) => s.replace(/seconds?/, "sec").replace(/minutes?/, "min"),
24
- lang: S = "en",
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: p = 0,
27
- startingBid: T,
28
- startingBidText: x = "Starting bid",
29
- soldForText: N = "Sold for",
30
- wonForText: w = "Won for",
31
- ...c
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
- var h;
34
- const { className: s, ...P } = q(c, "BidSnapshot"), n = i !== null && p > 0, j = e === u.Winning || e === u.Won, f = o === a.ready, t = o === a.live, B = o === a.past, D = t && d, E = z(m, g), M = A(m, [g]), R = k(s, $, {
35
- [`${s}--live`]: t,
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
- let r = y;
39
- return (f || !n) && (r = x), B && n && (r = j ? w : N), /* @__PURE__ */ _("div", { ...P, ...c, ref: W, className: R, children: [
40
- /* @__PURE__ */ l(F, { hasSeparators: !0, className: `${s}__text`, children: /* @__PURE__ */ l(
41
- G,
42
- {
43
- label: r,
44
- subLabel: t && i && `(${C(p)})`,
45
- value: `${v}${(h = i || T) == null ? void 0 : h.toLocaleString()}`,
46
- hasWrap: !1
47
- }
48
- ) }),
49
- e && !f ? E : null,
50
- M,
51
- D ? /* @__PURE__ */ l(
52
- I,
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: b,
56
- variant: J.compact,
57
- locale: H[S],
58
- formatDurationStr: L
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
- Q.displayName = "BidSnapshot";
73
+ K.displayName = "BidSnapshot";
65
74
  export {
66
- Q as default
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 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.0",
3
+ "version": "1.99.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"