@phillips/seldon 1.149.0 → 1.149.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.
@@ -1,4 +1,4 @@
1
- var e = { exports: {} };
1
+ var r = {};
2
2
  export {
3
- e as __module
3
+ r as __exports
4
4
  };
@@ -1,4 +1,4 @@
1
- var e = { exports: {} };
1
+ var e = {};
2
2
  export {
3
- e as __module
3
+ e as __exports
4
4
  };
@@ -1,4 +1,4 @@
1
- var r = {};
1
+ var e = { exports: {} };
2
2
  export {
3
- r as __exports
3
+ e as __module
4
4
  };
@@ -1,4 +1,4 @@
1
- var e = {};
1
+ var e = { exports: {} };
2
2
  export {
3
- e as __exports
3
+ e as __module
4
4
  };
@@ -31,9 +31,9 @@ export interface CountdownProps extends ComponentProps<'div'> {
31
31
  */
32
32
  variant?: CountdownVariants;
33
33
  /**
34
- * The current date time (defaults to new Date())
34
+ * Function to get the current date time
35
35
  */
36
- currentDateTime?: Date;
36
+ getCurrentDateTime?: () => Date | null;
37
37
  }
38
38
  /**
39
39
  * ## Overview
@@ -1,69 +1,72 @@
1
- import { jsxs as d, jsx as e } from "react/jsx-runtime";
2
- import { forwardRef as j, useState as z, useEffect as E, useMemo as F } from "react";
3
- import { getCommonProps as H } from "../../utils/index.js";
4
- import R from "../../node_modules/classnames/index.js";
5
- import { SupportedLanguages as S } from "../../types/commonTypes.js";
6
- import { CountdownVariants as i } from "./types.js";
7
- import { Duration as a } from "./Duration.js";
8
- import { zhCN as U } from "../../node_modules/date-fns/locale/zh-CN.js";
9
- import { enUS as V } 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 h } from "../../node_modules/date-fns/differenceInHours.js";
12
- import { differenceInMinutes as w } from "../../node_modules/date-fns/differenceInMinutes.js";
13
- import { differenceInSeconds as C } from "../../node_modules/date-fns/differenceInSeconds.js";
14
- import { differenceInMilliseconds as k } from "../../node_modules/date-fns/differenceInMilliseconds.js";
15
- const q = j(
1
+ import { jsxs as p, jsx as e } from "react/jsx-runtime";
2
+ import { forwardRef as M, useState as j, useEffect as z, useMemo as P } from "react";
3
+ import { getCommonProps as E } from "../../utils/index.js";
4
+ import F from "../../node_modules/classnames/index.js";
5
+ import { SupportedLanguages as H } from "../../types/commonTypes.js";
6
+ import { CountdownVariants as m } from "./types.js";
7
+ import { Duration as i } from "./Duration.js";
8
+ import { zhCN as R } from "../../node_modules/date-fns/locale/zh-CN.js";
9
+ import { enUS as S } from "../../node_modules/date-fns/locale/en-US.js";
10
+ import { differenceInDays as h } from "../../node_modules/date-fns/differenceInDays.js";
11
+ import { differenceInHours as w } from "../../node_modules/date-fns/differenceInHours.js";
12
+ import { differenceInMinutes as y } from "../../node_modules/date-fns/differenceInMinutes.js";
13
+ import { differenceInSeconds as I } from "../../node_modules/date-fns/differenceInSeconds.js";
14
+ import { differenceInMilliseconds as U } from "../../node_modules/date-fns/differenceInMilliseconds.js";
15
+ const V = M(
16
16
  ({
17
17
  endDateTime: o,
18
- formatDurationStr: t,
19
- label: m = "Lots Close in",
20
- intervalDescription: g,
21
- className: y,
22
- locale: I = "en",
23
- showBottomBorder: N = !0,
24
- variant: u = i.default,
25
- currentDateTime: l = /* @__PURE__ */ new Date(),
26
- ...f
27
- }, $) => {
28
- const { className: r, ...b } = H(f, "Countdown"), [n, L] = z(l), c = I === S.zh ? U : V, s = {
29
- days: p(o, n) > 0 ? p(o, n) : 0,
30
- hours: h(o, n) > 0 ? h(o, n) % 24 : 0,
31
- minutes: w(o, n) > 0 ? w(o, n) % 60 : 0,
32
- seconds: (C(o, n) > 0 ? C(o, n) % 60 : 0) % 60
18
+ formatDurationStr: l,
19
+ label: u = "Lots Close in",
20
+ intervalDescription: N,
21
+ className: C,
22
+ locale: $ = "en",
23
+ showBottomBorder: b = !0,
24
+ variant: f = m.default,
25
+ getCurrentDateTime: t = () => /* @__PURE__ */ new Date(),
26
+ ...d
27
+ }, g) => {
28
+ const { className: r, ...L } = E(d, "Countdown"), [n, _] = j(t() || /* @__PURE__ */ new Date()), c = $ === H.zh ? R : S, s = {
29
+ days: h(o, n) > 0 ? h(o, n) : 0,
30
+ hours: w(o, n) > 0 ? w(o, n) % 24 : 0,
31
+ minutes: y(o, n) > 0 ? y(o, n) % 60 : 0,
32
+ seconds: (I(o, n) > 0 ? I(o, n) % 60 : 0) % 60
33
33
  };
34
- E(() => {
35
- const x = setInterval(() => {
36
- L((M) => new Date(M.getTime() + 1e3));
34
+ z(() => {
35
+ const a = setInterval(() => {
36
+ _(t() || /* @__PURE__ */ new Date());
37
37
  }, 1e3);
38
- return () => clearInterval(x);
39
- }, [o, l]);
40
- const _ = F(() => new Date(o).getTime() > l.getTime(), [o, l]), v = k(o, n) <= 3 * 60 * 1e3;
41
- return _ ? /* @__PURE__ */ d(
38
+ return () => clearInterval(a);
39
+ }, [o, t]);
40
+ const v = P(() => {
41
+ const a = t();
42
+ return !!a && new Date(o).getTime() > a.getTime();
43
+ }, [o, t]), x = U(o, n) <= 3 * 60 * 1e3;
44
+ return v ? /* @__PURE__ */ p(
42
45
  "div",
43
46
  {
44
- ...b,
45
- className: R(r, y, {
46
- [`${r}--compact`]: u === i.compact,
47
- [`${r}--show-bottom-border`]: N,
48
- [`${r}--closing-lot`]: v
47
+ ...L,
48
+ className: F(r, C, {
49
+ [`${r}--compact`]: f === m.compact,
50
+ [`${r}--show-bottom-border`]: b,
51
+ [`${r}--closing-lot`]: x
49
52
  }),
50
- ...f,
51
- ref: $,
53
+ ...d,
54
+ ref: g,
52
55
  children: [
53
- /* @__PURE__ */ d("div", { className: `${r}__countdown-container`, role: "timer", "aria-label": m, children: [
54
- /* @__PURE__ */ e("span", { className: `${r}__label`, children: m }),
55
- s.days > 0 ? /* @__PURE__ */ e(a, { duration: s, unit: "days", locale: c, formatDurationStr: t }) : null,
56
- s.days > 0 || s.hours > 0 ? /* @__PURE__ */ e(a, { duration: s, unit: "hours", locale: c, formatDurationStr: t }) : null,
57
- s.days === 0 ? /* @__PURE__ */ e(a, { duration: s, unit: "minutes", locale: c, formatDurationStr: t }) : null,
58
- s.days === 0 && s.hours === 0 ? /* @__PURE__ */ e(a, { duration: s, unit: "seconds", locale: c, formatDurationStr: t }) : null
56
+ /* @__PURE__ */ p("div", { className: `${r}__countdown-container`, role: "timer", "aria-label": u, children: [
57
+ /* @__PURE__ */ e("span", { className: `${r}__label`, children: u }),
58
+ s.days > 0 ? /* @__PURE__ */ e(i, { duration: s, unit: "days", locale: c, formatDurationStr: l }) : null,
59
+ s.days > 0 || s.hours > 0 ? /* @__PURE__ */ e(i, { duration: s, unit: "hours", locale: c, formatDurationStr: l }) : null,
60
+ s.days === 0 ? /* @__PURE__ */ e(i, { duration: s, unit: "minutes", locale: c, formatDurationStr: l }) : null,
61
+ s.days === 0 && s.hours === 0 ? /* @__PURE__ */ e(i, { duration: s, unit: "seconds", locale: c, formatDurationStr: l }) : null
59
62
  ] }),
60
- u === i.default ? /* @__PURE__ */ e("span", { children: g }) : null
63
+ f === m.default ? /* @__PURE__ */ e("span", { children: N }) : null
61
64
  ]
62
65
  }
63
66
  ) : null;
64
67
  }
65
68
  );
66
- q.displayName = "Countdown";
69
+ V.displayName = "Countdown";
67
70
  export {
68
- q as default
71
+ V as default
69
72
  };
@@ -16,6 +16,9 @@ export declare const Playground: {
16
16
  type: string;
17
17
  options: CountdownVariants[];
18
18
  };
19
+ endDateTime: {
20
+ control: string;
21
+ };
19
22
  };
20
23
  };
21
24
  export declare const Days: (props: CountdownProps) => import("react/jsx-runtime").JSX.Element;
@@ -0,0 +1,22 @@
1
+ import { jsx as s } from "react/jsx-runtime";
2
+ import d from "../../node_modules/classnames/index.js";
3
+ import { forwardRef as i } from "react";
4
+ import { px as a } from "../../utils/index.js";
5
+ const m = i(
6
+ ({ "aria-label": r = "Loading", isCentered: e = !0, className: o, ...t }, l) => /* @__PURE__ */ s(
7
+ "span",
8
+ {
9
+ ref: l,
10
+ ...t,
11
+ className: d(o, `${a}-loader`, { [`${a}-loader--centered`]: e }),
12
+ "data-testid": "loader",
13
+ role: "status",
14
+ "aria-live": "polite",
15
+ "aria-label": r
16
+ }
17
+ )
18
+ );
19
+ m.displayName = "Loader";
20
+ export {
21
+ m as default
22
+ };
@@ -0,0 +1 @@
1
+ export { default as Loader, type LoaderProps } from './Loader';
package/dist/index.d.ts CHANGED
@@ -57,6 +57,7 @@ export * from './providers/SeldonProvider/SeldonProvider';
57
57
  export * from './components/Carousel';
58
58
  export * from './components/ComboBox';
59
59
  export * from './components/Detail';
60
+ export * from './components/Loader';
60
61
  export { default as PageContentWrapper } from './components/PageContentWrapper/PageContentWrapper';
61
62
  export * from './components/PinchZoom';
62
63
  export * from './components/SeldonImage';
@@ -66,20 +67,20 @@ export * from './patterns/SaleHeaderBanner';
66
67
  export { default as Footer, type FooterProps } from './site-furniture/Footer/Footer';
67
68
  export { default as Header, type HeaderProps } from './site-furniture/Header/Header';
68
69
  export * from './types/commonTypes';
70
+ export * from './components/AddToCalendar';
69
71
  export * from './components/Article';
72
+ export * from './components/AuctionTile';
70
73
  export * from './components/Countdown';
71
74
  export * from './components/Countdown/types';
72
75
  export * from './components/Divider';
73
76
  export * from './components/FavoritingTileButton';
74
77
  export * from './components/Filter';
75
78
  export * from './components/Icon';
79
+ export * from './components/Pictogram';
76
80
  export * from './components/TextArea';
77
81
  export * from './components/Toast';
78
- export * from './components/AddToCalendar';
79
82
  export * from './patterns/AccountPageHeader';
80
83
  export * from './patterns/BidSnapshot';
81
84
  export * from './patterns/FilterMenu';
82
85
  export * from './patterns/ObjectTile';
83
86
  export * from './utils/hooks';
84
- export * from './components/Pictogram';
85
- export * from './components/AuctionTile';
package/dist/index.js CHANGED
@@ -72,45 +72,46 @@ import { default as Kt } from "./patterns/ViewingsList/StatefulViewingsList.js";
72
72
  import { default as _t } from "./patterns/ViewingsList/ViewingsList.js";
73
73
  import { SeldonProvider as eo } from "./providers/SeldonProvider/SeldonProvider.js";
74
74
  import { default as oo } from "./components/ComboBox/ComboBox.js";
75
- import { default as ao } from "./components/PageContentWrapper/PageContentWrapper.js";
76
- import { default as so } from "./site-furniture/Footer/Footer.js";
77
- import { default as mo } from "./site-furniture/Header/Header.js";
78
- import { default as uo } from "./components/Article/Article.js";
79
- import { default as xo } from "./components/Countdown/Countdown.js";
80
- import { CountdownVariants as go } from "./components/Countdown/types.js";
81
- import { default as So } from "./components/Divider/Divider.js";
82
- import { default as To } from "./components/FavoritingTileButton/FavoritingTileButton.js";
83
- import { default as Ao } from "./components/Filter/Filter.js";
84
- import { default as Lo } from "./components/Filter/FilterInput.js";
85
- import { default as bo } from "./components/Filter/FilterHeader.js";
86
- import { default as ho } from "./components/TextArea/TextArea.js";
87
- import { default as vo } from "./components/Toast/Toast.js";
88
- import { ToastProvider as yo } from "./components/Toast/ToastContextProvider.js";
89
- import { useToast as Do } from "./components/Toast/useToast.js";
90
- import { default as Mo } from "./components/AddToCalendar/AddToCalendar.js";
91
- import { default as Eo } from "./patterns/AccountPageHeader/AccountPageHeader.js";
92
- import { default as Go } from "./patterns/BidSnapshot/BidSnapshot.js";
93
- import { default as Ro } from "./patterns/BidSnapshot/BidMessage.js";
94
- import { BidMessageVariants as jo, BidStatusEnum as zo } from "./patterns/BidSnapshot/types.js";
95
- import { default as Yo } from "./patterns/FilterMenu/FilterMenu.js";
96
- import { default as qo } from "./patterns/ObjectTile/ObjectTile.js";
97
- import { default as Ko } from "./components/Pictogram/Pictogram.js";
98
- import { default as _o } from "./components/AuctionTile/AuctionTile.js";
75
+ import { default as ao } from "./components/Loader/Loader.js";
76
+ import { default as so } from "./components/PageContentWrapper/PageContentWrapper.js";
77
+ import { default as mo } from "./site-furniture/Footer/Footer.js";
78
+ import { default as uo } from "./site-furniture/Header/Header.js";
79
+ import { default as xo } from "./components/AddToCalendar/AddToCalendar.js";
80
+ import { default as go } from "./components/Article/Article.js";
81
+ import { default as So } from "./components/AuctionTile/AuctionTile.js";
82
+ import { default as To } from "./components/Countdown/Countdown.js";
83
+ import { CountdownVariants as Ao } from "./components/Countdown/types.js";
84
+ import { default as Lo } from "./components/Divider/Divider.js";
85
+ import { default as bo } from "./components/FavoritingTileButton/FavoritingTileButton.js";
86
+ import { default as ho } from "./components/Filter/Filter.js";
87
+ import { default as vo } from "./components/Filter/FilterInput.js";
88
+ import { default as yo } from "./components/Filter/FilterHeader.js";
89
+ import { default as Do } from "./components/Pictogram/Pictogram.js";
90
+ import { default as Mo } from "./components/TextArea/TextArea.js";
91
+ import { default as Eo } from "./components/Toast/Toast.js";
92
+ import { ToastProvider as Go } from "./components/Toast/ToastContextProvider.js";
93
+ import { useToast as Ro } from "./components/Toast/useToast.js";
94
+ import { default as jo } from "./patterns/AccountPageHeader/AccountPageHeader.js";
95
+ import { default as Wo } from "./patterns/BidSnapshot/BidSnapshot.js";
96
+ import { default as Zo } from "./patterns/BidSnapshot/BidMessage.js";
97
+ import { BidMessageVariants as Jo, BidStatusEnum as Ko } from "./patterns/BidSnapshot/types.js";
98
+ import { default as _o } from "./patterns/FilterMenu/FilterMenu.js";
99
+ import { default as er } from "./patterns/ObjectTile/ObjectTile.js";
99
100
  export {
100
101
  M as Accordion,
101
102
  E as AccordionItem,
102
103
  G as AccordionItemVariant,
103
104
  O as AccordionVariants,
104
- Eo as AccountPageHeader,
105
- Mo as AddToCalendar,
106
- uo as Article,
105
+ jo as AccountPageHeader,
106
+ xo as AddToCalendar,
107
+ go as Article,
107
108
  b as AuctionStatus,
108
- _o as AuctionTile,
109
+ So as AuctionTile,
109
110
  Yt as AuthState,
110
- Ro as BidMessage,
111
- jo as BidMessageVariants,
112
- Go as BidSnapshot,
113
- zo as BidStatusEnum,
111
+ Zo as BidMessage,
112
+ Jo as BidMessageVariants,
113
+ Wo as BidSnapshot,
114
+ Ko as BidStatusEnum,
114
115
  Q as Breadcrumb,
115
116
  v as Button,
116
117
  y as ButtonVariants,
@@ -125,26 +126,26 @@ export {
125
126
  oo as ComboBox,
126
127
  de as ContentPeek,
127
128
  pe as ContentPeekHeightUnits,
128
- xo as Countdown,
129
- go as CountdownVariants,
129
+ To as Countdown,
130
+ Ao as CountdownVariants,
130
131
  ie as Detail,
131
132
  Vt as DetailList,
132
133
  kt as DetailListAlignment,
133
- So as Divider,
134
+ Lo as Divider,
134
135
  ne as Drawer,
135
136
  ce as Dropdown,
136
137
  Ce as ErrorBoundary,
137
138
  wt as FavoritesCollectionTile,
138
- To as FavoritingTileButton,
139
- Ao as Filter,
140
- bo as FilterHeader,
141
- Lo as FilterInput,
142
- Yo as FilterMenu,
143
- so as Footer,
139
+ bo as FavoritingTileButton,
140
+ ho as Filter,
141
+ yo as FilterHeader,
142
+ vo as FilterInput,
143
+ _o as FilterMenu,
144
+ mo as Footer,
144
145
  Pe as Grid,
145
146
  Be as GridItem,
146
147
  Ie as GridItemAlign,
147
- mo as Header,
148
+ uo as Header,
148
149
  Ht as HeroBanner,
149
150
  z as Icon,
150
151
  D as IconButton,
@@ -154,18 +155,19 @@ export {
154
155
  He as LinkBlock,
155
156
  Fe as LinkList,
156
157
  we as LinkVariants,
158
+ ao as Loader,
157
159
  V as LotStatus,
158
160
  Ne as Modal,
159
161
  Ue as Navigation,
160
162
  Oe as NavigationItem,
161
163
  Qe as NavigationItemTrigger,
162
164
  ze as NavigationList,
163
- qo as ObjectTile,
165
+ er as ObjectTile,
164
166
  a as PaddingTokens,
165
167
  C as Page,
166
- ao as PageContentWrapper,
168
+ so as PageContentWrapper,
167
169
  Ye as Pagination,
168
- Ko as Pictogram,
170
+ Do as Pictogram,
169
171
  qe as PinchZoom,
170
172
  Ke as Row,
171
173
  P as SSRMediaQuery,
@@ -189,12 +191,12 @@ export {
189
191
  xt as TagsList,
190
192
  Ct as Text,
191
193
  gt as TextAlignments,
192
- ho as TextArea,
194
+ Mo as TextArea,
193
195
  Pt as TextSymbolVariants,
194
196
  Bt as TextSymbols,
195
197
  ct as TextVariants,
196
- vo as Toast,
197
- yo as ToastProvider,
198
+ Eo as Toast,
199
+ Go as ToastProvider,
198
200
  qt as UserManagement,
199
201
  It as Video,
200
202
  _t as ViewingsList,
@@ -211,5 +213,5 @@ export {
211
213
  A as ssrMediaQueryStyle,
212
214
  c as useNormalizedInputProps,
213
215
  L as usePendingState,
214
- Do as useToast
216
+ Ro as useToast
215
217
  };
@@ -1,4 +1,4 @@
1
- import { __module as t } from "../../_virtual/index5.js";
1
+ import { __module as t } from "../../_virtual/index7.js";
2
2
  /*!
3
3
  Copyright (c) 2015 Jed Watson.
4
4
  Based on code that is Copyright 2013-2015, Facebook, Inc.
@@ -1,6 +1,6 @@
1
- import { __exports as l } from "../../../_virtual/index7.js";
1
+ import { __exports as l } from "../../../_virtual/index5.js";
2
2
  import "./pipeline/index.js";
3
- import { __exports as _ } from "../../../_virtual/index8.js";
3
+ import { __exports as _ } from "../../../_virtual/index6.js";
4
4
  Object.defineProperty(l, "__esModule", {
5
5
  value: !0
6
6
  });
@@ -1,4 +1,4 @@
1
- import { __exports as u } from "../../../../_virtual/index8.js";
1
+ import { __exports as u } from "../../../../_virtual/index6.js";
2
2
  import "./build.js";
3
3
  import "./format.js";
4
4
  import "./validate.js";
@@ -1,4 +1,4 @@
1
- import { __module as e } from "../../../../_virtual/index6.js";
1
+ import { __module as e } from "../../../../_virtual/index8.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;
@@ -71,9 +71,9 @@ export interface BidSnapshotProps extends ComponentProps<'div'> {
71
71
  */
72
72
  wonForText?: string;
73
73
  /**
74
- * Current date time
74
+ * Function to get the current date time
75
75
  */
76
- currentDateTime?: Date;
76
+ getCurrentDateTime?: () => Date | null;
77
77
  }
78
78
  /**
79
79
  * ## Overview
@@ -1,77 +1,77 @@
1
- import { jsxs as v, jsx as n } 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";
1
+ import { jsxs as w, 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";
5
5
  import G from "../DetailList/DetailList.js";
6
6
  import p from "../../components/Detail/Detail.js";
7
- import { LotStatus as t, SupportedLanguages as H } from "../../types/commonTypes.js";
7
+ import { LotStatus as n, SupportedLanguages as H } from "../../types/commonTypes.js";
8
8
  import J from "../../components/Countdown/Countdown.js";
9
9
  import { CountdownVariants as K } from "../../components/Countdown/types.js";
10
10
  import { BidStatusEnum as Q } from "./types.js";
11
11
  import L from "./BidMessage.js";
12
- import { isAfter as w } from "../../node_modules/date-fns/isAfter.js";
12
+ import { isAfter as x } 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 = V(
14
+ const X = (o) => o === 1 ? `${o} bid` : `${o} bids`, Y = k(
15
15
  ({
16
- lotStatus: o = t.ready,
16
+ lotStatus: o = n.ready,
17
17
  bidStatus: d,
18
18
  bidsLabelText: C = X,
19
19
  children: c,
20
- className: T,
21
- closingText: x = "Closes in",
22
- currency: r = "$",
20
+ className: N,
21
+ closingText: W = "Closes in",
22
+ currency: t = "$",
23
23
  currentBid: f,
24
- currentBidText: N = "Current bid",
25
- formatDurationStr: W = (a) => a.replace(/seconds?/, "sec").replace(/minutes?/, "min"),
26
- lang: y = "en",
27
- saleCloseDate: i,
28
- lotCloseDate: l,
29
- numberOfBids: u = 0,
30
- startingBid: h,
31
- startingBidText: B = "Starting bid",
24
+ currentBidText: y = "Current bid",
25
+ formatDurationStr: T = (s) => s.replace(/seconds?/, "sec").replace(/minutes?/, "min"),
26
+ lang: B = "en",
27
+ saleCloseDate: r,
28
+ lotCloseDate: i,
29
+ numberOfBids: h = 0,
30
+ startingBid: u,
31
+ startingBidText: M = "Starting bid",
32
32
  soldPrice: $,
33
- soldForText: M = "Sold for",
34
- wonForText: j = "Won for",
35
- currentDateTime: E = /* @__PURE__ */ new Date(),
36
- ...b
33
+ soldForText: j = "Sold for",
34
+ wonForText: E = "Won for",
35
+ getCurrentDateTime: b = () => /* @__PURE__ */ new Date(),
36
+ ...S
37
37
  }, P) => {
38
- const { className: a, ...R } = q(b, "BidSnapshot"), m = f !== null && u > 0, g = o === t.ready, s = o === t.live, S = o === t.past, e = E, _ = s && l && w(l, e) && i && (U(i, e) < 60 || w(e, i)), A = z(c, L), D = F(c, [L]), I = k(a, T, {
39
- [`${a}--live`]: s,
40
- [`${a}--has-bids`]: m || S
38
+ const { className: s, ...R } = z(S, "BidSnapshot"), l = f !== null && h > 0, g = o === n.ready, a = o === n.live, v = o === n.past, m = b() || /* @__PURE__ */ new Date(), _ = a && i && x(i, m) && r && (U(r, m) < 60 || x(m, r)), A = D(c, L), I = F(c, [L]), V = q(s, N, {
39
+ [`${s}--live`]: a,
40
+ [`${s}--has-bids`]: l || v
41
41
  });
42
- return /* @__PURE__ */ v("div", { ...R, ...b, ref: P, className: I, children: [
43
- /* @__PURE__ */ v(G, { hasSeparators: !0, className: `${a}__text`, children: [
44
- S ? /* @__PURE__ */ n(
42
+ return /* @__PURE__ */ w("div", { ...R, ...S, ref: P, className: V, children: [
43
+ /* @__PURE__ */ w(G, { hasSeparators: !0, className: `${s}__text`, children: [
44
+ v ? /* @__PURE__ */ e(
45
45
  p,
46
46
  {
47
- label: d === Q.Won ? j : M,
48
- value: $ ? `${r}${$?.toLocaleString()}` : "",
47
+ label: d === Q.Won ? E : j,
48
+ value: $ ? `${t}${$?.toLocaleString()}` : "",
49
49
  hasWrap: !1
50
50
  }
51
51
  ) : null,
52
- s && m ? /* @__PURE__ */ n(
52
+ a && l ? /* @__PURE__ */ e(
53
53
  p,
54
54
  {
55
- label: N,
56
- subLabel: `(${C(u)})`,
57
- value: `${r}${f?.toLocaleString()}`,
55
+ label: y,
56
+ subLabel: `(${C(h)})`,
57
+ value: `${t}${f?.toLocaleString()}`,
58
58
  hasWrap: !1
59
59
  }
60
60
  ) : null,
61
- h && (g || s && !m) ? /* @__PURE__ */ n(p, { label: B, value: `${r}${h?.toLocaleString()}`, hasWrap: !1 }) : null
61
+ u && (g || a && !l) ? /* @__PURE__ */ e(p, { label: M, value: `${t}${u?.toLocaleString()}`, hasWrap: !1 }) : null
62
62
  ] }),
63
63
  d && !g ? A : null,
64
- D,
65
- _ ? /* @__PURE__ */ n(
64
+ I,
65
+ _ ? /* @__PURE__ */ e(
66
66
  J,
67
67
  {
68
- endDateTime: l,
69
- label: x,
68
+ endDateTime: i,
69
+ label: W,
70
70
  variant: K.compact,
71
- locale: H[y],
72
- formatDurationStr: W,
71
+ locale: H[B],
72
+ formatDurationStr: T,
73
73
  showBottomBorder: !1,
74
- currentDateTime: e
74
+ getCurrentDateTime: b
75
75
  }
76
76
  ) : null
77
77
  ] });
@@ -73,9 +73,9 @@ export interface SaleHeaderBannerProps extends ComponentProps<'div'> {
73
73
  */
74
74
  onClick?: () => void;
75
75
  /**
76
- * Current date time (defaults to new Date())
76
+ * Function to get the current date time (defaults to new Date())
77
77
  */
78
- currentDateTime?: Date;
78
+ getCurrentDateTime?: () => Date | null;
79
79
  }
80
80
  /**
81
81
  * ## Overview
@@ -29,14 +29,14 @@ const z = M(
29
29
  footerElement: b,
30
30
  headerLabel: j,
31
31
  showTimer: c,
32
- currentDateTime: y,
32
+ getCurrentDateTime: y,
33
33
  ...s
34
34
  }, l) => {
35
35
  const { className: e, ...m } = R(s, "SaleHeaderBanner"), d = B === O.live, _ = {
36
36
  endDateTime: i,
37
37
  label: w,
38
38
  formatDurationStr: x,
39
- currentDateTime: y
39
+ getCurrentDateTime: y
40
40
  };
41
41
  return /* @__PURE__ */ n("div", { ...m, className: D(e, P), ...s, ref: l, children: [
42
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,
@@ -25,11 +25,32 @@ export declare const Playground: {
25
25
  type: string;
26
26
  };
27
27
  };
28
+ currentDateTime: {
29
+ control: {
30
+ type: string;
31
+ };
32
+ };
28
33
  };
29
34
  };
30
35
  export declare const PreSale: (props: SaleHeaderBannerProps) => import("react/jsx-runtime").JSX.Element;
31
36
  export declare const PreSaleTwoOccurrences: (props: SaleHeaderBannerProps) => import("react/jsx-runtime").JSX.Element;
32
37
  export declare const PreSaleThreeOccurrences: (props: SaleHeaderBannerProps) => import("react/jsx-runtime").JSX.Element;
33
- export declare const OpenForBidding: (props: SaleHeaderBannerProps) => import("react/jsx-runtime").JSX.Element;
38
+ export declare const OpenForBidding: {
39
+ (props: SaleHeaderBannerProps & {
40
+ currentDateTime?: Date;
41
+ }): import("react/jsx-runtime").JSX.Element;
42
+ argTypes: {
43
+ currentDateTime: {
44
+ control: {
45
+ type: string;
46
+ };
47
+ };
48
+ auctionEndTime: {
49
+ control: {
50
+ type: string;
51
+ };
52
+ };
53
+ };
54
+ };
34
55
  export declare const Closed: (props: SaleHeaderBannerProps) => import("react/jsx-runtime").JSX.Element;
35
56
  export declare const MissingImage: (props: SaleHeaderBannerProps) => import("react/jsx-runtime").JSX.Element;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.149.0",
3
+ "version": "1.149.2",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"