@phillips/seldon 1.80.0 → 1.81.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.
Files changed (55) hide show
  1. package/dist/components/Countdown/Countdown.d.ts +36 -0
  2. package/dist/components/Countdown/Countdown.js +50 -0
  3. package/dist/components/Countdown/Countdown.stories.d.ts +19 -0
  4. package/dist/components/Countdown/Countdown.test.d.ts +1 -0
  5. package/dist/components/Countdown/Duration.d.ts +7 -0
  6. package/dist/components/Countdown/Duration.js +14 -0
  7. package/dist/components/Countdown/Duration.test.d.ts +1 -0
  8. package/dist/components/Countdown/index.d.ts +1 -0
  9. package/dist/components/Countdown/types.d.ts +4 -0
  10. package/dist/components/Countdown/types.js +4 -0
  11. package/dist/index.d.ts +3 -1
  12. package/dist/index.js +146 -144
  13. package/dist/node_modules/date-fns/_lib/defaultOptions.js +7 -0
  14. package/dist/node_modules/date-fns/_lib/getRoundingMethod.js +9 -0
  15. package/dist/node_modules/date-fns/_lib/getTimezoneOffsetInMilliseconds.js +18 -0
  16. package/dist/node_modules/date-fns/_lib/normalizeDates.js +11 -0
  17. package/dist/node_modules/date-fns/constants.js +7 -0
  18. package/dist/node_modules/date-fns/constructFrom.js +8 -0
  19. package/dist/node_modules/date-fns/differenceInCalendarDays.js +16 -0
  20. package/dist/node_modules/date-fns/differenceInDays.js +22 -0
  21. package/dist/node_modules/date-fns/differenceInHours.js +15 -0
  22. package/dist/node_modules/date-fns/differenceInMilliseconds.js +8 -0
  23. package/dist/node_modules/date-fns/differenceInMinutes.js +11 -0
  24. package/dist/node_modules/date-fns/differenceInSeconds.js +10 -0
  25. package/dist/node_modules/date-fns/formatDuration.js +23 -0
  26. package/dist/node_modules/date-fns/isSameWeek.js +14 -0
  27. package/dist/node_modules/date-fns/locale/_lib/buildFormatLongFn.js +9 -0
  28. package/dist/node_modules/date-fns/locale/_lib/buildLocalizeFn.js +18 -0
  29. package/dist/node_modules/date-fns/locale/_lib/buildMatchFn.js +31 -0
  30. package/dist/node_modules/date-fns/locale/_lib/buildMatchPatternFn.js +15 -0
  31. package/dist/node_modules/date-fns/locale/en-US/_lib/formatDistance.js +70 -0
  32. package/dist/node_modules/date-fns/locale/en-US/_lib/formatLong.js +33 -0
  33. package/dist/node_modules/date-fns/locale/en-US/_lib/formatRelative.js +11 -0
  34. package/dist/node_modules/date-fns/locale/en-US/_lib/localize.js +155 -0
  35. package/dist/node_modules/date-fns/locale/en-US/_lib/match.js +110 -0
  36. package/dist/node_modules/date-fns/locale/en-US.js +21 -0
  37. package/dist/node_modules/date-fns/locale/zh-CN/_lib/formatDistance.js +70 -0
  38. package/dist/node_modules/date-fns/locale/zh-CN/_lib/formatLong.js +33 -0
  39. package/dist/node_modules/date-fns/locale/zh-CN/_lib/formatRelative.js +21 -0
  40. package/dist/node_modules/date-fns/locale/zh-CN/_lib/localize.js +162 -0
  41. package/dist/node_modules/date-fns/locale/zh-CN/_lib/match.js +108 -0
  42. package/dist/node_modules/date-fns/locale/zh-CN.js +21 -0
  43. package/dist/node_modules/date-fns/startOfDay.js +9 -0
  44. package/dist/node_modules/date-fns/startOfWeek.js +11 -0
  45. package/dist/node_modules/date-fns/toDate.js +8 -0
  46. package/dist/node_modules/exenv/index.js +1 -1
  47. package/dist/node_modules/prop-types/node_modules/react-is/index.js +1 -1
  48. package/dist/patterns/SaleHeaderBanner/index.d.ts +0 -1
  49. package/dist/scss/componentStyles.scss +2 -0
  50. package/dist/scss/components/Countdown/_countdown.scss +25 -0
  51. package/dist/scss/components/Countdown/_duration.scss +13 -0
  52. package/dist/scss/patterns/SaleHeaderBanner/_saleHeaderBanner.scss +0 -11
  53. package/package.json +2 -1
  54. package/dist/patterns/SaleHeaderBanner/SaleHeaderCountdown.d.ts +0 -8
  55. package/dist/patterns/SaleHeaderBanner/SaleHeaderCountdown.js +0 -35
@@ -0,0 +1,21 @@
1
+ import { isSameWeek as f } from "../../../isSameWeek.js";
2
+ function i(t, r, o) {
3
+ const e = "eeee p";
4
+ return f(t, r, o) ? e : t.getTime() > r.getTime() ? "'下个'" + e : "'上个'" + e;
5
+ }
6
+ const m = {
7
+ lastWeek: i,
8
+ // days before yesterday, maybe in this week or last week
9
+ yesterday: "'昨天' p",
10
+ today: "'今天' p",
11
+ tomorrow: "'明天' p",
12
+ nextWeek: i,
13
+ // days after tomorrow, maybe in this week or next week
14
+ other: "PP p"
15
+ }, c = (t, r, o, e) => {
16
+ const n = m[t];
17
+ return typeof n == "function" ? n(r, o, e) : n;
18
+ };
19
+ export {
20
+ c as formatRelative
21
+ };
@@ -0,0 +1,162 @@
1
+ import { buildLocalizeFn as e } from "../../_lib/buildLocalizeFn.js";
2
+ const i = {
3
+ narrow: ["前", "公元"],
4
+ abbreviated: ["前", "公元"],
5
+ wide: ["公元前", "公元"]
6
+ }, r = {
7
+ narrow: ["1", "2", "3", "4"],
8
+ abbreviated: ["第一季", "第二季", "第三季", "第四季"],
9
+ wide: ["第一季度", "第二季度", "第三季度", "第四季度"]
10
+ }, o = {
11
+ narrow: [
12
+ "一",
13
+ "二",
14
+ "三",
15
+ "四",
16
+ "五",
17
+ "六",
18
+ "七",
19
+ "八",
20
+ "九",
21
+ "十",
22
+ "十一",
23
+ "十二"
24
+ ],
25
+ abbreviated: [
26
+ "1月",
27
+ "2月",
28
+ "3月",
29
+ "4月",
30
+ "5月",
31
+ "6月",
32
+ "7月",
33
+ "8月",
34
+ "9月",
35
+ "10月",
36
+ "11月",
37
+ "12月"
38
+ ],
39
+ wide: [
40
+ "一月",
41
+ "二月",
42
+ "三月",
43
+ "四月",
44
+ "五月",
45
+ "六月",
46
+ "七月",
47
+ "八月",
48
+ "九月",
49
+ "十月",
50
+ "十一月",
51
+ "十二月"
52
+ ]
53
+ }, d = {
54
+ narrow: ["日", "一", "二", "三", "四", "五", "六"],
55
+ short: ["日", "一", "二", "三", "四", "五", "六"],
56
+ abbreviated: ["周日", "周一", "周二", "周三", "周四", "周五", "周六"],
57
+ wide: ["星期日", "星期一", "星期二", "星期三", "星期四", "星期五", "星期六"]
58
+ }, m = {
59
+ narrow: {
60
+ am: "上",
61
+ pm: "下",
62
+ midnight: "凌晨",
63
+ noon: "午",
64
+ morning: "早",
65
+ afternoon: "下午",
66
+ evening: "晚",
67
+ night: "夜"
68
+ },
69
+ abbreviated: {
70
+ am: "上午",
71
+ pm: "下午",
72
+ midnight: "凌晨",
73
+ noon: "中午",
74
+ morning: "早晨",
75
+ afternoon: "中午",
76
+ evening: "晚上",
77
+ night: "夜间"
78
+ },
79
+ wide: {
80
+ am: "上午",
81
+ pm: "下午",
82
+ midnight: "凌晨",
83
+ noon: "中午",
84
+ morning: "早晨",
85
+ afternoon: "中午",
86
+ evening: "晚上",
87
+ night: "夜间"
88
+ }
89
+ }, u = {
90
+ narrow: {
91
+ am: "上",
92
+ pm: "下",
93
+ midnight: "凌晨",
94
+ noon: "午",
95
+ morning: "早",
96
+ afternoon: "下午",
97
+ evening: "晚",
98
+ night: "夜"
99
+ },
100
+ abbreviated: {
101
+ am: "上午",
102
+ pm: "下午",
103
+ midnight: "凌晨",
104
+ noon: "中午",
105
+ morning: "早晨",
106
+ afternoon: "中午",
107
+ evening: "晚上",
108
+ night: "夜间"
109
+ },
110
+ wide: {
111
+ am: "上午",
112
+ pm: "下午",
113
+ midnight: "凌晨",
114
+ noon: "中午",
115
+ morning: "早晨",
116
+ afternoon: "中午",
117
+ evening: "晚上",
118
+ night: "夜间"
119
+ }
120
+ }, g = (t, a) => {
121
+ const n = Number(t);
122
+ switch (a == null ? void 0 : a.unit) {
123
+ case "date":
124
+ return n.toString() + "日";
125
+ case "hour":
126
+ return n.toString() + "时";
127
+ case "minute":
128
+ return n.toString() + "分";
129
+ case "second":
130
+ return n.toString() + "秒";
131
+ default:
132
+ return "第 " + n.toString();
133
+ }
134
+ }, s = {
135
+ ordinalNumber: g,
136
+ era: e({
137
+ values: i,
138
+ defaultWidth: "wide"
139
+ }),
140
+ quarter: e({
141
+ values: r,
142
+ defaultWidth: "wide",
143
+ argumentCallback: (t) => t - 1
144
+ }),
145
+ month: e({
146
+ values: o,
147
+ defaultWidth: "wide"
148
+ }),
149
+ day: e({
150
+ values: d,
151
+ defaultWidth: "wide"
152
+ }),
153
+ dayPeriod: e({
154
+ values: m,
155
+ defaultWidth: "wide",
156
+ formattingValues: u,
157
+ defaultFormattingWidth: "wide"
158
+ })
159
+ };
160
+ export {
161
+ s as localize
162
+ };
@@ -0,0 +1,108 @@
1
+ import { buildMatchFn as a } from "../../_lib/buildMatchFn.js";
2
+ import { buildMatchPatternFn as i } from "../../_lib/buildMatchPatternFn.js";
3
+ const e = /^(第\s*)?\d+(日|时|分|秒)?/i, r = /\d+/i, n = {
4
+ narrow: /^(前)/i,
5
+ abbreviated: /^(前)/i,
6
+ wide: /^(公元前|公元)/i
7
+ }, s = {
8
+ any: [/^(前)/i, /^(公元)/i]
9
+ }, d = {
10
+ narrow: /^[1234]/i,
11
+ abbreviated: /^第[一二三四]刻/i,
12
+ wide: /^第[一二三四]刻钟/i
13
+ }, h = {
14
+ any: [/(1|一)/i, /(2|二)/i, /(3|三)/i, /(4|四)/i]
15
+ }, o = {
16
+ narrow: /^(一|二|三|四|五|六|七|八|九|十[二一])/i,
17
+ abbreviated: /^(一|二|三|四|五|六|七|八|九|十[二一]|\d|1[12])月/i,
18
+ wide: /^(一|二|三|四|五|六|七|八|九|十[二一])月/i
19
+ }, c = {
20
+ narrow: [
21
+ /^一/i,
22
+ /^二/i,
23
+ /^三/i,
24
+ /^四/i,
25
+ /^五/i,
26
+ /^六/i,
27
+ /^七/i,
28
+ /^八/i,
29
+ /^九/i,
30
+ /^十(?!(一|二))/i,
31
+ /^十一/i,
32
+ /^十二/i
33
+ ],
34
+ any: [
35
+ /^一|1/i,
36
+ /^二|2/i,
37
+ /^三|3/i,
38
+ /^四|4/i,
39
+ /^五|5/i,
40
+ /^六|6/i,
41
+ /^七|7/i,
42
+ /^八|8/i,
43
+ /^九|9/i,
44
+ /^十(?!(一|二))|10/i,
45
+ /^十一|11/i,
46
+ /^十二|12/i
47
+ ]
48
+ }, P = {
49
+ narrow: /^[一二三四五六日]/i,
50
+ short: /^[一二三四五六日]/i,
51
+ abbreviated: /^周[一二三四五六日]/i,
52
+ wide: /^星期[一二三四五六日]/i
53
+ }, m = {
54
+ any: [/日/i, /一/i, /二/i, /三/i, /四/i, /五/i, /六/i]
55
+ }, l = {
56
+ any: /^(上午?|下午?|午夜|[中正]午|早上?|下午|晚上?|凌晨|)/i
57
+ }, u = {
58
+ any: {
59
+ am: /^上午?/i,
60
+ pm: /^下午?/i,
61
+ midnight: /^午夜/i,
62
+ noon: /^[中正]午/i,
63
+ morning: /^早上/i,
64
+ afternoon: /^下午/i,
65
+ evening: /^晚上?/i,
66
+ night: /^凌晨/i
67
+ }
68
+ }, b = {
69
+ ordinalNumber: i({
70
+ matchPattern: e,
71
+ parsePattern: r,
72
+ valueCallback: (t) => parseInt(t, 10)
73
+ }),
74
+ era: a({
75
+ matchPatterns: n,
76
+ defaultMatchWidth: "wide",
77
+ parsePatterns: s,
78
+ defaultParseWidth: "any"
79
+ }),
80
+ quarter: a({
81
+ matchPatterns: d,
82
+ defaultMatchWidth: "wide",
83
+ parsePatterns: h,
84
+ defaultParseWidth: "any",
85
+ valueCallback: (t) => t + 1
86
+ }),
87
+ month: a({
88
+ matchPatterns: o,
89
+ defaultMatchWidth: "wide",
90
+ parsePatterns: c,
91
+ defaultParseWidth: "any"
92
+ }),
93
+ day: a({
94
+ matchPatterns: P,
95
+ defaultMatchWidth: "wide",
96
+ parsePatterns: m,
97
+ defaultParseWidth: "any"
98
+ }),
99
+ dayPeriod: a({
100
+ matchPatterns: l,
101
+ defaultMatchWidth: "any",
102
+ parsePatterns: u,
103
+ defaultParseWidth: "any"
104
+ })
105
+ };
106
+ export {
107
+ b as match
108
+ };
@@ -0,0 +1,21 @@
1
+ import { formatDistance as o } from "./zh-CN/_lib/formatDistance.js";
2
+ import { formatLong as t } from "./zh-CN/_lib/formatLong.js";
3
+ import { formatRelative as a } from "./zh-CN/_lib/formatRelative.js";
4
+ import { localize as r } from "./zh-CN/_lib/localize.js";
5
+ import { match as m } from "./zh-CN/_lib/match.js";
6
+ const s = {
7
+ code: "zh-CN",
8
+ formatDistance: o,
9
+ formatLong: t,
10
+ formatRelative: a,
11
+ localize: r,
12
+ match: m,
13
+ options: {
14
+ weekStartsOn: 1,
15
+ firstWeekContainsDate: 4
16
+ }
17
+ };
18
+ export {
19
+ s as default,
20
+ s as zhCN
21
+ };
@@ -0,0 +1,9 @@
1
+ import { toDate as e } from "./toDate.js";
2
+ function u(a, t) {
3
+ const r = e(a, t == null ? void 0 : t.in);
4
+ return r.setHours(0, 0, 0, 0), r;
5
+ }
6
+ export {
7
+ u as default,
8
+ u as startOfDay
9
+ };
@@ -0,0 +1,11 @@
1
+ import { getDefaultOptions as m } from "./_lib/defaultOptions.js";
2
+ import { toDate as n } from "./toDate.js";
3
+ function x(D, e) {
4
+ var c, O, l, k, u, d, s, w;
5
+ const a = m(), r = (w = (s = (k = (l = e == null ? void 0 : e.weekStartsOn) != null ? l : (O = (c = e == null ? void 0 : e.locale) == null ? void 0 : c.options) == null ? void 0 : O.weekStartsOn) != null ? k : a.weekStartsOn) != null ? s : (d = (u = a.locale) == null ? void 0 : u.options) == null ? void 0 : d.weekStartsOn) != null ? w : 0, t = n(D, e == null ? void 0 : e.in), f = t.getDay(), S = (f < r ? 7 : 0) + f - r;
6
+ return t.setDate(t.getDate() - S), t.setHours(0, 0, 0, 0), t;
7
+ }
8
+ export {
9
+ x as default,
10
+ x as startOfWeek
11
+ };
@@ -0,0 +1,8 @@
1
+ import { constructFrom as r } from "./constructFrom.js";
2
+ function e(t, o) {
3
+ return r(o || t, t);
4
+ }
5
+ export {
6
+ e as default,
7
+ e as toDate
8
+ };
@@ -1,4 +1,4 @@
1
- import { __module as t } from "../../_virtual/index6.js";
1
+ import { __module as t } from "../../_virtual/index5.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/index5.js";
1
+ import { __module as e } from "../../../../_virtual/index6.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,4 +1,3 @@
1
1
  export { default as SaleHeaderBanner, type SaleHeaderBannerProps } from './SaleHeaderBanner';
2
2
  export { default as SaleHeaderBrowseAuctions, type SaleHeaderBrowseAuctionsProps } from './SaleHeaderBrowseAuctions';
3
- export { default as SaleHeaderCountdown, type SaleHeaderCountdownProps } from './SaleHeaderCountdown';
4
3
  export { AuctionState } from './types';
@@ -36,6 +36,8 @@
36
36
  @use 'components/ContentPeek/contentPeek';
37
37
  @use 'components/PageContentWrapper/pageContentWrapper';
38
38
  @use 'components/Carousel/carousel';
39
+ @use 'components/Countdown/countdown';
40
+ @use 'components/Countdown/duration';
39
41
 
40
42
  // Patterns
41
43
  @use 'patterns/HeroBanner/heroBanner';
@@ -0,0 +1,25 @@
1
+ @use '../../allPartials' as *;
2
+
3
+ .#{$px}-countdown {
4
+ @include text($body2);
5
+
6
+ align-items: center;
7
+ border-bottom: 1px solid $light-gray;
8
+ display: flex;
9
+ flex-direction: column;
10
+ gap: $spacing-micro;
11
+ justify-content: center;
12
+ margin-bottom: 1.5rem;
13
+ padding: 0 $spacing-sm $spacing-sm;
14
+ width: 100%;
15
+
16
+ &__countdown-container {
17
+ @include text($heading5);
18
+
19
+ align-items: center;
20
+ display: flex;
21
+ gap: $spacing-sm;
22
+ justify-content: center;
23
+ text-transform: inherit;
24
+ }
25
+ }
@@ -0,0 +1,13 @@
1
+ @use '../../allPartials' as *;
2
+
3
+ .#{$px}-duration {
4
+ @include text($heading5);
5
+
6
+ display: flex;
7
+ gap: $spacing-micro;
8
+
9
+ &--fixed-width {
10
+ min-width: 1.75rem;
11
+ text-align: right;
12
+ }
13
+ }
@@ -23,17 +23,6 @@
23
23
  padding: $spacing-md 0;
24
24
  }
25
25
 
26
- // update when adding in actual countdown timer
27
- &__countdown-container {
28
- align-items: center;
29
- border-bottom: 1px solid $light-gray;
30
- display: flex;
31
- gap: $spacing-sm;
32
- justify-content: center;
33
- margin-bottom: 1.5rem;
34
- width: 100%;
35
- }
36
-
37
26
  &__location {
38
27
  font-variation-settings: 'wght' 600;
39
28
  margin: $margin-xsm 0;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@phillips/seldon",
3
- "version": "1.80.0",
3
+ "version": "1.81.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "https://github.com/PhillipsAuctionHouse/seldon"
@@ -49,6 +49,7 @@
49
49
  "@types/dompurify": "^3.0.5",
50
50
  "change-case": "^5.4.4",
51
51
  "classnames": "^2.5.1",
52
+ "date-fns": "^4.1.0",
52
53
  "dompurify": "^3.1.6",
53
54
  "embla-carousel-react": "^8.3.0",
54
55
  "embla-carousel-wheel-gestures": "^8.0.1",
@@ -1,8 +0,0 @@
1
- import { ComponentProps } from 'react';
2
- export interface SaleHeaderCountdownProps extends ComponentProps<'div'> {
3
- label?: string;
4
- daysLabel?: string;
5
- hoursLabel?: string;
6
- }
7
- declare const SaleHeaderCountdown: import('react').ForwardRefExoticComponent<Omit<SaleHeaderCountdownProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
8
- export default SaleHeaderCountdown;
@@ -1,35 +0,0 @@
1
- import { jsxs as a, jsx as l } from "react/jsx-runtime";
2
- import { forwardRef as c } from "react";
3
- import { getCommonProps as f } from "../../utils/index.js";
4
- import { TextVariants as e } from "../../components/Text/types.js";
5
- import r from "../../components/Text/Text.js";
6
- const h = c(
7
- ({ label: n = "Lots Close in", daysLabel: s = "Days", hoursLabel: t = "Hours", className: p, ...o }, i) => {
8
- const { className: m, ...d } = f(o, "SaleHeaderBanner");
9
- return /* @__PURE__ */ a(
10
- "div",
11
- {
12
- id: "PLACEHOLDER FOR TIMER COMPONENT",
13
- className: `${m}__countdown-container`,
14
- ...d,
15
- ...o,
16
- ref: i,
17
- children: [
18
- /* @__PURE__ */ l(r, { variant: e.heading5, children: n }),
19
- /* @__PURE__ */ a(r, { variant: e.heading5, children: [
20
- "2 ",
21
- s
22
- ] }),
23
- /* @__PURE__ */ a(r, { variant: e.heading5, children: [
24
- "17 ",
25
- t
26
- ] })
27
- ]
28
- }
29
- );
30
- }
31
- );
32
- h.displayName = "SaleHeaderCountdown";
33
- export {
34
- h as default
35
- };