@phillips/seldon 1.105.0 → 1.105.1

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.
@@ -0,0 +1,8 @@
1
+ import { toDate as t } from "./toDate.js";
2
+ function f(r, e) {
3
+ return +t(r) > +t(e);
4
+ }
5
+ export {
6
+ f as default,
7
+ f as isAfter
8
+ };
@@ -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 u, 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 A } from "../../utils/index.js";
5
- import F from "../DetailList/DetailList.js";
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(
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: a = m.ready,
14
- bidStatus: f,
15
- bidsLabelText: v = J,
16
- children: c,
17
- className: L,
18
- closingText: S = "Closes in",
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: g = "Current bid",
22
- formatDurationStr: x = (o) => o.replace(/seconds?/, "sec").replace(/minutes?/, "min"),
23
- lang: N = "en",
24
- lotCloseDate: d,
25
- numberOfBids: h = 0,
26
- startingBid: r,
27
- startingBidText: T = "Starting bid",
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: w = "Sold for",
30
- wonForText: y = "Won for",
31
- ...$
32
- }, W) => {
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
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__ */ 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,
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: f ? y : w,
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
- n && l ? /* @__PURE__ */ t(
48
- p,
50
+ l && n ? /* @__PURE__ */ t(
51
+ d,
49
52
  {
50
- label: g,
51
- subLabel: `(${v(h)})`,
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
- b || n && !l ? /* @__PURE__ */ t(p, { label: T, value: `${i}${r == null ? void 0 : r.toLocaleString()}`, hasWrap: !1 }) : null
59
+ v || l && !n ? /* @__PURE__ */ t(d, { label: W, value: `${i}${f == null ? void 0 : f.toLocaleString()}`, hasWrap: !1 }) : null
57
60
  ] }),
58
- f && !b ? R : null,
59
- _,
60
- M ? /* @__PURE__ */ t(
61
- H,
61
+ h && !v ? I : null,
62
+ V,
63
+ E ? /* @__PURE__ */ t(
64
+ K,
62
65
  {
63
- endDateTime: d,
64
- label: S,
65
- variant: I.compact,
66
- locale: G[N],
67
- formatDurationStr: x
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
- K.displayName = "BidSnapshot";
76
+ Y.displayName = "BidSnapshot";
74
77
  export {
75
- K as default
78
+ Y as default
76
79
  };
@@ -22,6 +22,7 @@ export declare const Playground: {
22
22
  lotStatus: LotStatus;
23
23
  currentBid: number;
24
24
  lotCloseDate: Date;
25
+ saleCloseDate: Date;
25
26
  lang: import('date-fns').Locale;
26
27
  startingBid: number;
27
28
  soldPrice: number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.105.0",
3
+ "version": "1.105.1",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"