@phillips/seldon 1.213.0 → 1.214.0-beta.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.
- package/dist/_virtual/index4.js +2 -2
- package/dist/_virtual/index5.js +2 -2
- package/dist/_virtual/index6.js +2 -2
- package/dist/assets/formatted/Clock.d.ts +9 -0
- package/dist/assets/formatted/Clock.js +35 -0
- package/dist/assets/formatted/index.d.ts +1 -0
- package/dist/assets/formatted/index.js +14 -12
- package/dist/components/AddToCalendar/AddToCalendar.js +24 -25
- package/dist/components/Article/Article.js +17 -17
- package/dist/components/Breadcrumb/BreadcrumbItem.js +13 -13
- package/dist/components/Button/Button.d.ts +4 -0
- package/dist/components/Button/Button.js +71 -53
- package/dist/components/Button/Button.stories.d.ts +7 -1
- package/dist/components/ComboBox/ComboBox.js +34 -29
- package/dist/components/ComposedModal/ComposedModal.js +33 -33
- package/dist/components/ComposedModal/ComposedModal.stories.d.ts +1 -0
- package/dist/components/Countdown/Countdown.js +90 -51
- package/dist/components/Countdown/Duration.d.ts +3 -1
- package/dist/components/Countdown/Duration.js +17 -9
- package/dist/components/Countdown/types.d.ts +2 -1
- package/dist/components/Countdown/types.js +1 -1
- package/dist/components/DescriptiveRadioButton/DescriptiveRadioButton.js +21 -21
- package/dist/components/Detail/Detail.d.ts +2 -0
- package/dist/components/Detail/Detail.js +26 -15
- package/dist/components/Detail/Detail.stories.d.ts +9 -2
- package/dist/components/Drawer/DrawerHeader.js +22 -20
- package/dist/components/ExitGateCard/ExitGateCard.js +29 -29
- package/dist/components/FavoritingTileButton/FavoritingTileButton.js +30 -31
- package/dist/components/Filter/Filter.js +36 -34
- package/dist/components/Filter/FilterHeader.d.ts +4 -0
- package/dist/components/Filter/FilterHeader.js +30 -22
- package/dist/components/Input/Input.js +43 -39
- package/dist/components/Input/Input.stories.d.ts +16 -0
- package/dist/components/Link/Link.js +11 -11
- package/dist/components/Link/Link.stories.d.ts +17 -1
- package/dist/components/Link/types.d.ts +9 -4
- package/dist/components/Link/types.js +3 -3
- package/dist/components/LinkBlock/LinkBlock.js +19 -11
- package/dist/components/Modal/Modal.d.ts +0 -4
- package/dist/components/Modal/Modal.js +6 -6
- package/dist/components/Navigation/NavigationItem/NavigationItem.js +31 -23
- package/dist/components/Navigation/NavigationItemTrigger/NavigationItemTrigger.js +29 -29
- package/dist/components/Navigation/NavigationList/NavigationList.js +5 -5
- package/dist/components/Pagination/Pagination.js +22 -21
- package/dist/components/ProgressIndicator/ProgressIndicator.js +22 -22
- package/dist/components/Search/Search.js +55 -53
- package/dist/components/Search/SearchResults/SearchResults.js +16 -16
- package/dist/components/Select/Select.d.ts +4 -0
- package/dist/components/Select/Select.js +51 -45
- package/dist/components/Select/Select.stories.d.ts +1 -0
- package/dist/components/Tabs/TabsContainer.js +1 -1
- package/dist/components/Tags/Tags.js +32 -30
- package/dist/components/Text/Text.js +17 -9
- package/dist/components/Text/types.d.ts +42 -1
- package/dist/components/Text/types.js +3 -3
- package/dist/components/Text/utils.js +40 -7
- package/dist/components/TextArea/TextArea.js +38 -34
- package/dist/components/Toast/Toast.js +4 -4
- package/dist/node_modules/ics/dist/index.js +2 -2
- package/dist/node_modules/ics/dist/pipeline/index.js +1 -1
- package/dist/node_modules/prop-types/node_modules/react-is/index.js +1 -1
- package/dist/patterns/AccountPageHeader/AccountPageHeader.js +45 -28
- package/dist/patterns/BidSnapshot/BidMessage.d.ts +6 -1
- package/dist/patterns/BidSnapshot/BidMessage.js +14 -13
- package/dist/patterns/BidSnapshot/BidSnapshot.d.ts +7 -1
- package/dist/patterns/BidSnapshot/BidSnapshot.js +84 -66
- package/dist/patterns/BidSnapshot/BidSnapshot.stories.d.ts +100 -0
- package/dist/patterns/CountryPicker/CountryPickerCountryList.js +5 -5
- package/dist/patterns/CountryPicker/CountryPickerModal.js +8 -8
- package/dist/patterns/CountryPicker/CountryPickerOption.js +22 -20
- package/dist/patterns/CountryPicker/CountryPickerTrigger.js +39 -38
- package/dist/patterns/FavoritesCollectionTile/FavoritesCollectionTile.js +52 -52
- package/dist/patterns/FavoritesCollectionTile/FavoritesCollectionTile.stories.d.ts +1 -0
- package/dist/patterns/FiltersInline/FilterButton.js +41 -25
- package/dist/patterns/FiltersInline/FilterDropdownMenuDesktop.js +50 -52
- package/dist/patterns/FiltersInline/FilterDropdownMenuMobile.js +31 -31
- package/dist/patterns/HeroBanner/HeroBanner.js +21 -21
- package/dist/patterns/LanguageSelector/LanguageSelector.js +34 -34
- package/dist/patterns/ObjectTile/ObjectTile.js +51 -66
- package/dist/patterns/ObjectTile/ObjectTile.stories.d.ts +36 -0
- package/dist/patterns/PhoneNumberInput/PhoneNumberInput.js +7 -6
- package/dist/patterns/SaleCard/SaleCard.js +37 -45
- package/dist/patterns/SaleCard/SaleCard.stories.d.ts +1 -1
- package/dist/patterns/SaleCard/SaleCardActions.js +9 -8
- package/dist/patterns/SaleHeaderBanner/SaleHeaderBanner.js +49 -49
- package/dist/patterns/SaleHeaderBanner/SaleHeaderBrowseAuctions.js +19 -12
- package/dist/patterns/Social/Social.js +20 -20
- package/dist/patterns/Subscribe/Subscribe.stories.d.ts +0 -1
- package/dist/patterns/TextBanner/TextBanner.js +12 -12
- package/dist/patterns/UserManagement/UserManagement.js +13 -13
- package/dist/patterns/ViewingDetails/ViewingDetails.d.ts +4 -0
- package/dist/patterns/ViewingDetails/ViewingDetails.js +36 -34
- package/dist/patterns/ViewingDetails/ViewingDetails.stories.d.ts +2 -0
- package/dist/patterns/ViewingDetails/ViewingDetailsMock.d.ts +2 -0
- package/dist/scss/_reset.scss +4 -0
- package/dist/scss/_type.scss +172 -65
- package/dist/scss/_vars.scss +92 -197
- package/dist/scss/_vars.scss.js +94 -199
- package/dist/scss/componentStyles.scss +178 -0
- package/dist/scss/components/Accordion/_accordion.scss +6 -4
- package/dist/scss/components/Breadcrumb/_breadcrumb.scss +8 -1
- package/dist/scss/components/Button/_button.scss +33 -7
- package/dist/scss/components/ComboBox/_combobox.scss +7 -5
- package/dist/scss/components/ComposedModal/_composedModal.scss +0 -4
- package/dist/scss/components/Countdown/_countdown.scss +8 -9
- package/dist/scss/components/Countdown/_duration.scss +0 -2
- package/dist/scss/components/DatePicker/_datePicker.scss +11 -10
- package/dist/scss/components/Detail/_detail.scss +15 -6
- package/dist/scss/components/Divider/_divider.scss +3 -3
- package/dist/scss/components/Drawer/_drawerHeader.scss +0 -7
- package/dist/scss/components/Dropdown/_dropdown.scss +2 -2
- package/dist/scss/components/FavoritingTileButton/_favoritingTileButton.scss +5 -0
- package/dist/scss/components/Filter/_filter.scss +23 -8
- package/dist/scss/components/Icon/_icon.stories.scss +1 -1
- package/dist/scss/components/IconButton/_iconButton.scss +3 -5
- package/dist/scss/components/Input/_input.scss +22 -14
- package/dist/scss/components/Link/_link.scss +13 -8
- package/dist/scss/components/LinkBlock/_linkBlock.scss +5 -1
- package/dist/scss/components/LinkList/_linkList.scss +8 -0
- package/dist/scss/components/Modal/_modal.scss +2 -2
- package/dist/scss/components/Navigation/NavigationItem/_navigationItem.scss +33 -14
- package/dist/scss/components/Navigation/NavigationItemTrigger/_navigationItemTrigger.scss +1 -1
- package/dist/scss/components/Navigation/NavigationList/_navigationList.scss +2 -2
- package/dist/scss/components/NotificationBanner/_notificationBanner.scss +4 -10
- package/dist/scss/components/Pagination/_pagination.scss +17 -1
- package/dist/scss/components/ProgressIndicator/_progressIndicator.scss +5 -0
- package/dist/scss/components/Search/SearchResults/_searchResults.scss +5 -0
- package/dist/scss/components/Search/_search.scss +9 -10
- package/dist/scss/components/Search/_searchButton.scss +0 -1
- package/dist/scss/components/Select/_select.scss +8 -3
- package/dist/scss/components/Tabs/_tabs.scss +4 -5
- package/dist/scss/components/Tags/_tags.scss +0 -2
- package/dist/scss/components/TextArea/_textArea.scss +2 -4
- package/dist/scss/components/TextSymbol/_textSymbol.scss +2 -2
- package/dist/scss/patterns/AccountPageHeader/_accountPageHeader.scss +4 -0
- package/dist/scss/patterns/BidSnapshot/_bidSnapshot.scss +9 -10
- package/dist/scss/patterns/CountryPicker/_countryPickerModal.scss +4 -0
- package/dist/scss/patterns/CountryPicker/_countryPickerOption.scss +3 -0
- package/dist/scss/patterns/CountryPicker/_countryPickerTrigger.scss +4 -7
- package/dist/scss/patterns/DetailList/_detailList.scss +4 -0
- package/dist/scss/patterns/FavoritesCollectionTile/_favoritesCollectionTile.scss +6 -8
- package/dist/scss/patterns/FilterMenu/_filterMenu.scss +2 -1
- package/dist/scss/patterns/FiltersInline/_filterButton.scss +11 -2
- package/dist/scss/patterns/FiltersInline/_filterDropdownMenu.scss +1 -9
- package/dist/scss/patterns/FiltersInline/_filtersInline.scss +5 -0
- package/dist/scss/patterns/HeroBanner/_heroBanner.scss +13 -6
- package/dist/scss/patterns/ObjectTile/_objectTile.scss +13 -12
- package/dist/scss/patterns/PhoneNumberInput/_phoneNumberInput.scss +9 -2
- package/dist/scss/patterns/SaleCard/_saleCard.scss +13 -22
- package/dist/scss/patterns/SaleHeaderBanner/_saleHeaderBanner.scss +16 -3
- package/dist/scss/patterns/Social/_social.scss +4 -1
- package/dist/scss/patterns/Subscribe/_subscribe.scss +3 -3
- package/dist/scss/patterns/TextBanner/_textBanner.scss +9 -3
- package/dist/scss/patterns/ViewingDetails/_viewingDetails.scss +15 -3
- package/dist/scss/site-furniture/Footer/_footer.scss +8 -2
- package/dist/scss/site-furniture/Header/_header.scss +8 -4
- package/dist/site-furniture/Footer/Footer.js +4 -4
- package/package.json +4 -3
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { jsxs as T, jsx as i } from "react/jsx-runtime";
|
|
2
|
-
import { Root as ht, Trigger as _t, Portal as vt, Content as
|
|
2
|
+
import { Root as ht, Trigger as _t, Portal as vt, Content as bt } from "../../node_modules/@radix-ui/react-popover/dist/index.js";
|
|
3
3
|
import d from "../../node_modules/classnames/index.js";
|
|
4
|
-
import { Command as
|
|
5
|
-
import Nt, { useState as B, useCallback as g, useRef as
|
|
4
|
+
import { Command as Ct, CommandInput as yt, CommandList as $t, CommandGroup as wt, CommandItem as gt } from "../../node_modules/cmdk/dist/index.js";
|
|
5
|
+
import Nt, { useState as B, useCallback as g, useRef as x, useMemo as k } from "react";
|
|
6
6
|
import { useOnClickOutside as It } from "../../node_modules/usehooks-ts/dist/index.js";
|
|
7
7
|
import "../../assets/formatted/AccountActive.js";
|
|
8
8
|
import "../../assets/formatted/Account.js";
|
|
@@ -33,7 +33,7 @@ import Tt from "../../assets/formatted/ChevronDown.js";
|
|
|
33
33
|
import "../../assets/formatted/ChevronLeft.js";
|
|
34
34
|
import "../../assets/formatted/ChevronRight.js";
|
|
35
35
|
import "../../assets/formatted/ChevronUp.js";
|
|
36
|
-
import
|
|
36
|
+
import xt from "../../assets/formatted/CloseX.js";
|
|
37
37
|
import "../../assets/formatted/ConditionReport.js";
|
|
38
38
|
import "../../assets/formatted/Delete.js";
|
|
39
39
|
import "../../assets/formatted/Download.js";
|
|
@@ -84,12 +84,15 @@ import "../../assets/formatted/VolumeMaximum.js";
|
|
|
84
84
|
import "../../assets/formatted/VolumeMid.js";
|
|
85
85
|
import "../../assets/formatted/VolumeMinimum.js";
|
|
86
86
|
import "../../assets/formatted/WeChat.js";
|
|
87
|
+
import "../../assets/formatted/Clock.js";
|
|
87
88
|
import "../../assets/formatted/LiveNow.js";
|
|
88
|
-
import { getCommonProps as
|
|
89
|
+
import { getCommonProps as kt, useNormalizedInputProps as Lt } from "../../utils/index.js";
|
|
89
90
|
import U from "../IconButton/IconButton.js";
|
|
90
91
|
import { ButtonVariants as W } from "../Button/types.js";
|
|
91
92
|
import { usePrevious as Ot } from "../../utils/usePrevious.js";
|
|
92
|
-
|
|
93
|
+
import { TextVariants as Vt } from "../Text/types.js";
|
|
94
|
+
import Dt from "../Text/Text.js";
|
|
95
|
+
const Mt = Nt.forwardRef(function({
|
|
93
96
|
options: n = [],
|
|
94
97
|
className: X,
|
|
95
98
|
id: s,
|
|
@@ -111,19 +114,19 @@ const Dt = Nt.forwardRef(function({
|
|
|
111
114
|
invalidText: it,
|
|
112
115
|
countOfCharsBeforeDropdown: j = 0,
|
|
113
116
|
...at
|
|
114
|
-
},
|
|
115
|
-
const { className: e, ...lt } =
|
|
117
|
+
}, V) {
|
|
118
|
+
const { className: e, ...lt } = kt({ id: s }, "ComboBox"), st = Tt, nt = xt, q = Lt({
|
|
116
119
|
id: s,
|
|
117
120
|
invalid: N,
|
|
118
121
|
invalidText: it,
|
|
119
122
|
type: "text"
|
|
120
|
-
}), [f, z] = B(!1), [mt, ct] = B(""), G = Ot(p),
|
|
123
|
+
}), [f, z] = B(!1), [mt, ct] = B(""), G = Ot(p), D = g((t) => t.label || t.value, []), [o, b] = B(() => {
|
|
121
124
|
if (p !== void 0) {
|
|
122
125
|
const t = n.find((r) => r.value === p);
|
|
123
|
-
return t ? t.displayValue ||
|
|
126
|
+
return t ? t.displayValue || D(t) : "";
|
|
124
127
|
}
|
|
125
128
|
return "";
|
|
126
|
-
}),
|
|
129
|
+
}), C = x(null), y = x(null), $ = x(!1), M = x(null), m = g((t) => D(t), [D]), h = p !== void 0, R = h ? p : mt, a = k(() => n.find((t) => t.value === R) || null, [n, R]), _ = k(() => a ? a.displayValue || m(a) : "", [a, m]), c = k(() => {
|
|
127
130
|
if (!o || a && o === _)
|
|
128
131
|
return n;
|
|
129
132
|
const t = o.toLowerCase().trim();
|
|
@@ -147,20 +150,20 @@ const Dt = Nt.forwardRef(function({
|
|
|
147
150
|
(t) => {
|
|
148
151
|
h || ct(t.value);
|
|
149
152
|
const r = t.displayValue || m(t);
|
|
150
|
-
|
|
153
|
+
b(r), u && u(t.value, t), l(!1), $.current = !0, requestAnimationFrame(() => {
|
|
151
154
|
$.current = !1;
|
|
152
155
|
});
|
|
153
156
|
},
|
|
154
157
|
[h, u, l, m]
|
|
155
158
|
), pt = (t) => {
|
|
156
|
-
l(!1), $.current = !0, t.preventDefault(), t.stopPropagation(), u && h && u("", null),
|
|
159
|
+
l(!1), $.current = !0, t.preventDefault(), t.stopPropagation(), u && h && u("", null), b(""), y.current?.focus(), requestAnimationFrame(() => {
|
|
157
160
|
$.current = !1;
|
|
158
161
|
});
|
|
159
162
|
}, ut = () => {
|
|
160
163
|
z(!f), y.current?.focus();
|
|
161
164
|
}, ft = (t) => {
|
|
162
|
-
|
|
163
|
-
}, K =
|
|
165
|
+
b(t), t !== "" && c.length > 0 && l(!0, t);
|
|
166
|
+
}, K = k(() => {
|
|
164
167
|
if (h) {
|
|
165
168
|
if (p !== G)
|
|
166
169
|
return a ? _ : o;
|
|
@@ -174,9 +177,9 @@ const Dt = Nt.forwardRef(function({
|
|
|
174
177
|
}, [h, o, p, G, a, _]), E = (t) => {
|
|
175
178
|
if (a) {
|
|
176
179
|
const r = _;
|
|
177
|
-
r !== K && !t &&
|
|
180
|
+
r !== K && !t && b(r);
|
|
178
181
|
} else
|
|
179
|
-
|
|
182
|
+
b("");
|
|
180
183
|
}, F = g(() => {
|
|
181
184
|
const t = n.filter((r) => {
|
|
182
185
|
const w = m(r).toLowerCase(), P = r.value.toLowerCase(), A = r.displayValue?.toLowerCase(), v = o.toLowerCase();
|
|
@@ -184,9 +187,9 @@ const Dt = Nt.forwardRef(function({
|
|
|
184
187
|
});
|
|
185
188
|
t.length === 1 && I(t[0]);
|
|
186
189
|
}, [o, n, I, m]);
|
|
187
|
-
return It(
|
|
188
|
-
t.target.closest(`.${e}__item`) || t.target.closest(`.${e}__content`) ||
|
|
189
|
-
}), /* @__PURE__ */ T("div", { ref:
|
|
190
|
+
return It(C, (t) => {
|
|
191
|
+
t.target.closest(`.${e}__item`) || t.target.closest(`.${e}__content`) || C.current?.contains(t.target) || t.target === C.current || (F(), E(), l(!1));
|
|
192
|
+
}), /* @__PURE__ */ T("div", { ref: V, className: d(e, X), id: s, ...lt, ...at, children: [
|
|
190
193
|
L && /* @__PURE__ */ i(
|
|
191
194
|
"input",
|
|
192
195
|
{
|
|
@@ -195,14 +198,16 @@ const Dt = Nt.forwardRef(function({
|
|
|
195
198
|
id: L,
|
|
196
199
|
value: R || "",
|
|
197
200
|
ref: (t) => {
|
|
198
|
-
typeof
|
|
201
|
+
typeof V == "function" && t && V(t);
|
|
199
202
|
}
|
|
200
203
|
}
|
|
201
204
|
),
|
|
202
|
-
/* @__PURE__ */ T("div", { ref:
|
|
205
|
+
/* @__PURE__ */ T("div", { ref: C, className: `${e}__wrapper`, children: [
|
|
203
206
|
/* @__PURE__ */ i(
|
|
204
|
-
|
|
207
|
+
Dt,
|
|
205
208
|
{
|
|
209
|
+
element: "label",
|
|
210
|
+
variant: Vt.labelMedium,
|
|
206
211
|
htmlFor: `${s}-input`,
|
|
207
212
|
className: d(`${e}__label`, {
|
|
208
213
|
[`${e}__label--hidden`]: et,
|
|
@@ -213,7 +218,7 @@ const Dt = Nt.forwardRef(function({
|
|
|
213
218
|
}
|
|
214
219
|
),
|
|
215
220
|
/* @__PURE__ */ i(
|
|
216
|
-
|
|
221
|
+
Ct,
|
|
217
222
|
{
|
|
218
223
|
loop: !0,
|
|
219
224
|
onKeyDown: (t) => {
|
|
@@ -304,7 +309,7 @@ const Dt = Nt.forwardRef(function({
|
|
|
304
309
|
}
|
|
305
310
|
) }),
|
|
306
311
|
f && /* @__PURE__ */ i(vt, { container: rt?.current || document.body, children: /* @__PURE__ */ i(
|
|
307
|
-
|
|
312
|
+
bt,
|
|
308
313
|
{
|
|
309
314
|
className: `${e}__content`,
|
|
310
315
|
"aria-label": tt,
|
|
@@ -316,7 +321,7 @@ const Dt = Nt.forwardRef(function({
|
|
|
316
321
|
document.activeElement !== y.current && y.current?.focus();
|
|
317
322
|
},
|
|
318
323
|
style: {
|
|
319
|
-
width:
|
|
324
|
+
width: C.current?.offsetWidth || "100%"
|
|
320
325
|
},
|
|
321
326
|
children: /* @__PURE__ */ i($t, { className: `${e}__list`, children: c.length > 0 ? /* @__PURE__ */ i(wt, { className: `${e}__group`, children: c.map((t) => /* @__PURE__ */ i(
|
|
322
327
|
gt,
|
|
@@ -336,11 +341,11 @@ const Dt = Nt.forwardRef(function({
|
|
|
336
341
|
] })
|
|
337
342
|
}
|
|
338
343
|
),
|
|
339
|
-
q.validation ? q.validation : /* @__PURE__ */ i("p", { className: d(`${e}
|
|
344
|
+
q.validation ? q.validation : /* @__PURE__ */ i("p", { className: d(`${e}__empty-validation`), children: " " })
|
|
340
345
|
] })
|
|
341
346
|
] });
|
|
342
347
|
});
|
|
343
|
-
|
|
348
|
+
Mt.displayName = "ComboBox";
|
|
344
349
|
export {
|
|
345
|
-
|
|
350
|
+
Mt as default
|
|
346
351
|
};
|
|
@@ -1,58 +1,58 @@
|
|
|
1
|
-
import { jsxs as o, jsx as
|
|
2
|
-
import
|
|
1
|
+
import { jsxs as o, jsx as e, Fragment as _ } from "react/jsx-runtime";
|
|
2
|
+
import h from "../../node_modules/classnames/index.js";
|
|
3
3
|
import { forwardRef as x } from "react";
|
|
4
|
-
import { getCommonProps as
|
|
5
|
-
import
|
|
4
|
+
import { getCommonProps as $, noOp as b } from "../../utils/index.js";
|
|
5
|
+
import g from "../Divider/Divider.js";
|
|
6
6
|
import y from "../Modal/Modal.js";
|
|
7
|
-
import { TextVariants as
|
|
8
|
-
import
|
|
7
|
+
import { TextVariants as C } from "../Text/types.js";
|
|
8
|
+
import M from "../Text/Text.js";
|
|
9
9
|
const j = x(
|
|
10
10
|
({
|
|
11
|
-
children:
|
|
12
|
-
className:
|
|
13
|
-
overlayClassName:
|
|
14
|
-
isOpen:
|
|
15
|
-
onClose:
|
|
16
|
-
maxHeightValue:
|
|
17
|
-
title:
|
|
11
|
+
children: i,
|
|
12
|
+
className: t,
|
|
13
|
+
overlayClassName: P,
|
|
14
|
+
isOpen: c = !1,
|
|
15
|
+
onClose: p = b,
|
|
16
|
+
maxHeightValue: f = "60vh",
|
|
17
|
+
title: N,
|
|
18
18
|
footerContent: m,
|
|
19
|
-
secondaryButton:
|
|
20
|
-
primaryButton:
|
|
21
|
-
id:
|
|
19
|
+
secondaryButton: r,
|
|
20
|
+
primaryButton: d,
|
|
21
|
+
id: s,
|
|
22
22
|
...l
|
|
23
|
-
},
|
|
23
|
+
}, n) => {
|
|
24
24
|
const {
|
|
25
25
|
className: a,
|
|
26
|
-
"data-testid":
|
|
26
|
+
"data-testid": T,
|
|
27
27
|
...v
|
|
28
|
-
} =
|
|
28
|
+
} = $({ id: s, ...l }, "ComposedModal");
|
|
29
29
|
return /* @__PURE__ */ o(
|
|
30
30
|
y,
|
|
31
31
|
{
|
|
32
|
-
isOpen:
|
|
33
|
-
onClose:
|
|
32
|
+
isOpen: c,
|
|
33
|
+
onClose: p,
|
|
34
34
|
...l,
|
|
35
35
|
...v,
|
|
36
|
-
className:
|
|
37
|
-
id:
|
|
38
|
-
ref:
|
|
36
|
+
className: h(`${a}`, t),
|
|
37
|
+
id: s,
|
|
38
|
+
ref: n,
|
|
39
|
+
title: N,
|
|
39
40
|
children: [
|
|
40
|
-
|
|
41
|
-
/* @__PURE__ */ s(
|
|
41
|
+
/* @__PURE__ */ e(
|
|
42
42
|
"div",
|
|
43
43
|
{
|
|
44
44
|
className: `${a}__body`,
|
|
45
|
-
style: { "--max-modal-body-height":
|
|
46
|
-
children:
|
|
45
|
+
style: { "--max-modal-body-height": f },
|
|
46
|
+
children: i
|
|
47
47
|
}
|
|
48
48
|
),
|
|
49
|
-
(
|
|
50
|
-
/* @__PURE__ */
|
|
49
|
+
(r || d || m) && /* @__PURE__ */ o(_, { children: [
|
|
50
|
+
/* @__PURE__ */ e(g, { className: `${a}__divider`, id: `${s}-divider` }),
|
|
51
51
|
/* @__PURE__ */ o("div", { className: `${a}__btns-group`, children: [
|
|
52
|
-
|
|
53
|
-
|
|
52
|
+
r,
|
|
53
|
+
d
|
|
54
54
|
] }),
|
|
55
|
-
m && /* @__PURE__ */
|
|
55
|
+
m && /* @__PURE__ */ e(M, { variant: C.bodySmall, className: `${a}__disclaimer`, children: m })
|
|
56
56
|
] })
|
|
57
57
|
]
|
|
58
58
|
}
|
|
@@ -1,72 +1,111 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
1
|
+
import { jsxs as h, jsx as t } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as z, useState as P, useEffect as S, useMemo as _ } from "react";
|
|
3
3
|
import { getCommonProps as E } from "../../utils/index.js";
|
|
4
4
|
import F from "../../node_modules/classnames/index.js";
|
|
5
5
|
import { SupportedLanguages as H } from "../../types/commonTypes.js";
|
|
6
|
-
import { CountdownVariants as
|
|
7
|
-
import { Duration as
|
|
8
|
-
import {
|
|
9
|
-
import
|
|
10
|
-
import {
|
|
11
|
-
import {
|
|
12
|
-
import {
|
|
13
|
-
import {
|
|
14
|
-
import {
|
|
15
|
-
|
|
6
|
+
import { CountdownVariants as c } from "./types.js";
|
|
7
|
+
import { Duration as f } from "./Duration.js";
|
|
8
|
+
import { TextVariants as w } from "../Text/types.js";
|
|
9
|
+
import R from "../Text/Text.js";
|
|
10
|
+
import { zhCN as U } from "../../node_modules/date-fns/locale/zh-CN.js";
|
|
11
|
+
import { enUS as k } from "../../node_modules/date-fns/locale/en-US.js";
|
|
12
|
+
import { differenceInDays as y } from "../../node_modules/date-fns/differenceInDays.js";
|
|
13
|
+
import { differenceInHours as I } from "../../node_modules/date-fns/differenceInHours.js";
|
|
14
|
+
import { differenceInMinutes as x } from "../../node_modules/date-fns/differenceInMinutes.js";
|
|
15
|
+
import { differenceInSeconds as C } from "../../node_modules/date-fns/differenceInSeconds.js";
|
|
16
|
+
import { differenceInMilliseconds as q } from "../../node_modules/date-fns/differenceInMilliseconds.js";
|
|
17
|
+
const A = z(
|
|
16
18
|
({
|
|
17
19
|
endDateTime: o,
|
|
18
|
-
formatDurationStr:
|
|
19
|
-
label:
|
|
20
|
+
formatDurationStr: m,
|
|
21
|
+
label: d = "Lots Close in",
|
|
20
22
|
intervalDescription: N,
|
|
21
|
-
className:
|
|
23
|
+
className: b,
|
|
22
24
|
locale: $ = "en",
|
|
23
|
-
showBottomBorder:
|
|
24
|
-
variant:
|
|
25
|
-
getCurrentDateTime:
|
|
26
|
-
...
|
|
27
|
-
},
|
|
28
|
-
const { className: r, ...
|
|
29
|
-
days:
|
|
30
|
-
hours:
|
|
31
|
-
minutes:
|
|
32
|
-
seconds: (
|
|
25
|
+
showBottomBorder: g = !0,
|
|
26
|
+
variant: i = c.default,
|
|
27
|
+
getCurrentDateTime: e = () => /* @__PURE__ */ new Date(),
|
|
28
|
+
...p
|
|
29
|
+
}, L) => {
|
|
30
|
+
const { className: r, ...M } = E(p, "Countdown"), [n, V] = P(e() || /* @__PURE__ */ new Date()), a = $ === H.zh ? U : k, s = {
|
|
31
|
+
days: y(o, n) > 0 ? y(o, n) : 0,
|
|
32
|
+
hours: I(o, n) > 0 ? I(o, n) % 24 : 0,
|
|
33
|
+
minutes: x(o, n) > 0 ? x(o, n) % 60 : 0,
|
|
34
|
+
seconds: (C(o, n) > 0 ? C(o, n) % 60 : 0) % 60
|
|
33
35
|
};
|
|
34
|
-
|
|
35
|
-
const
|
|
36
|
-
|
|
36
|
+
S(() => {
|
|
37
|
+
const u = setInterval(() => {
|
|
38
|
+
V(e() || /* @__PURE__ */ new Date());
|
|
37
39
|
}, 1e3);
|
|
38
|
-
return () => clearInterval(
|
|
39
|
-
}, [o,
|
|
40
|
-
const
|
|
41
|
-
const
|
|
42
|
-
return !!
|
|
43
|
-
}, [o,
|
|
44
|
-
return
|
|
40
|
+
return () => clearInterval(u);
|
|
41
|
+
}, [o, e]);
|
|
42
|
+
const j = _(() => {
|
|
43
|
+
const u = e();
|
|
44
|
+
return !!u && new Date(o).getTime() > u.getTime();
|
|
45
|
+
}, [o, e]), v = q(o, n) <= 3 * 60 * 1e3, l = i === c.sm ? w.labelSmall : w.labelMedium;
|
|
46
|
+
return j ? /* @__PURE__ */ h(
|
|
45
47
|
"div",
|
|
46
48
|
{
|
|
47
|
-
...
|
|
48
|
-
className: F(r,
|
|
49
|
-
[`${r}--compact`]:
|
|
50
|
-
[`${r}--
|
|
51
|
-
[`${r}--
|
|
49
|
+
...M,
|
|
50
|
+
className: F(r, b, {
|
|
51
|
+
[`${r}--compact`]: i === c.compact,
|
|
52
|
+
[`${r}--sm`]: i === c.sm,
|
|
53
|
+
[`${r}--show-bottom-border`]: g,
|
|
54
|
+
[`${r}--closing-lot`]: v
|
|
52
55
|
}),
|
|
53
|
-
...
|
|
54
|
-
ref:
|
|
56
|
+
...p,
|
|
57
|
+
ref: L,
|
|
55
58
|
children: [
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
/* @__PURE__ */
|
|
58
|
-
s.days > 0 ? /* @__PURE__ */
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
/* @__PURE__ */ h("div", { className: `${r}__countdown-container`, role: "timer", "aria-label": d, children: [
|
|
60
|
+
/* @__PURE__ */ t(R, { variant: l, children: d }),
|
|
61
|
+
s.days > 0 ? /* @__PURE__ */ t(
|
|
62
|
+
f,
|
|
63
|
+
{
|
|
64
|
+
duration: s,
|
|
65
|
+
unit: "days",
|
|
66
|
+
locale: a,
|
|
67
|
+
formatDurationStr: m,
|
|
68
|
+
textVariant: l
|
|
69
|
+
}
|
|
70
|
+
) : null,
|
|
71
|
+
s.days > 0 || s.hours > 0 ? /* @__PURE__ */ t(
|
|
72
|
+
f,
|
|
73
|
+
{
|
|
74
|
+
duration: s,
|
|
75
|
+
unit: "hours",
|
|
76
|
+
locale: a,
|
|
77
|
+
formatDurationStr: m,
|
|
78
|
+
textVariant: l
|
|
79
|
+
}
|
|
80
|
+
) : null,
|
|
81
|
+
s.days === 0 ? /* @__PURE__ */ t(
|
|
82
|
+
f,
|
|
83
|
+
{
|
|
84
|
+
duration: s,
|
|
85
|
+
unit: "minutes",
|
|
86
|
+
locale: a,
|
|
87
|
+
formatDurationStr: m,
|
|
88
|
+
textVariant: l
|
|
89
|
+
}
|
|
90
|
+
) : null,
|
|
91
|
+
s.days === 0 && s.hours === 0 ? /* @__PURE__ */ t(
|
|
92
|
+
f,
|
|
93
|
+
{
|
|
94
|
+
duration: s,
|
|
95
|
+
unit: "seconds",
|
|
96
|
+
locale: a,
|
|
97
|
+
formatDurationStr: m,
|
|
98
|
+
textVariant: l
|
|
99
|
+
}
|
|
100
|
+
) : null
|
|
62
101
|
] }),
|
|
63
|
-
|
|
102
|
+
i === c.default ? /* @__PURE__ */ t("span", { children: N }) : null
|
|
64
103
|
]
|
|
65
104
|
}
|
|
66
105
|
) : null;
|
|
67
106
|
}
|
|
68
107
|
);
|
|
69
|
-
|
|
108
|
+
A.displayName = "Countdown";
|
|
70
109
|
export {
|
|
71
|
-
|
|
110
|
+
A as default
|
|
72
111
|
};
|
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { Duration as DurationValue, DurationUnit, Locale } from 'date-fns';
|
|
2
|
+
import { TextVariants } from '../Text';
|
|
2
3
|
export interface DurationProps {
|
|
3
4
|
duration: DurationValue;
|
|
4
5
|
unit: DurationUnit;
|
|
5
6
|
locale: Locale;
|
|
6
7
|
formatDurationStr?: (duration: string) => string;
|
|
8
|
+
textVariant?: TextVariants;
|
|
7
9
|
}
|
|
8
|
-
export declare const Duration: ({ duration, unit, locale, formatDurationStr }: DurationProps) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export declare const Duration: ({ duration, unit, locale, formatDurationStr, textVariant, }: DurationProps) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -1,13 +1,21 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { px as
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
1
|
+
import { jsxs as p, jsx as a } from "react/jsx-runtime";
|
|
2
|
+
import { px as d } from "../../utils/index.js";
|
|
3
|
+
import { TextVariants as l } from "../Text/types.js";
|
|
4
|
+
import i from "../Text/Text.js";
|
|
5
|
+
import { formatDuration as c } from "../../node_modules/date-fns/formatDuration.js";
|
|
6
|
+
const b = ({
|
|
7
|
+
duration: m,
|
|
8
|
+
unit: s,
|
|
9
|
+
locale: e,
|
|
10
|
+
formatDurationStr: n = (r) => r,
|
|
11
|
+
textVariant: t = l.labelMedium
|
|
12
|
+
}) => {
|
|
13
|
+
const r = `${d}-duration`, o = c(m, { format: [s], zero: !0, locale: e }).split(" ");
|
|
14
|
+
return /* @__PURE__ */ p("div", { className: r, children: [
|
|
15
|
+
/* @__PURE__ */ a(i, { variant: t, children: o[0].padStart(2, "0") }),
|
|
16
|
+
/* @__PURE__ */ a(i, { variant: t, children: n(o[1]) })
|
|
9
17
|
] });
|
|
10
18
|
};
|
|
11
19
|
export {
|
|
12
|
-
|
|
20
|
+
b as Duration
|
|
13
21
|
};
|
|
@@ -1,38 +1,38 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import { forwardRef as
|
|
3
|
-
import { getCommonProps as
|
|
1
|
+
import { jsxs as c, jsx as o } from "react/jsx-runtime";
|
|
2
|
+
import { forwardRef as h } from "react";
|
|
3
|
+
import { getCommonProps as u } from "../../utils/index.js";
|
|
4
4
|
import r from "../../node_modules/classnames/index.js";
|
|
5
|
-
import
|
|
6
|
-
import { TextVariants as
|
|
7
|
-
const $ =
|
|
8
|
-
({ labelText: m, description:
|
|
9
|
-
const { className: e, ...
|
|
10
|
-
|
|
5
|
+
import i from "../Text/Text.js";
|
|
6
|
+
import { TextVariants as N } from "../Text/types.js";
|
|
7
|
+
const $ = h(
|
|
8
|
+
({ labelText: m, description: t, className: n, containerClassName: l, id: d, ...a }, _) => {
|
|
9
|
+
const { className: e, ...p } = u(
|
|
10
|
+
a,
|
|
11
11
|
"descriptive-radio-button"
|
|
12
|
-
), s =
|
|
13
|
-
return /* @__PURE__ */
|
|
12
|
+
), s = d, f = t ? `${s}-desc` : void 0;
|
|
13
|
+
return /* @__PURE__ */ c(
|
|
14
14
|
"label",
|
|
15
15
|
{
|
|
16
16
|
htmlFor: s,
|
|
17
17
|
className: r(`${e}__container`, l, {
|
|
18
|
-
[`${e}__container--selected`]:
|
|
18
|
+
[`${e}__container--selected`]: a.checked
|
|
19
19
|
}),
|
|
20
20
|
children: [
|
|
21
|
-
/* @__PURE__ */
|
|
21
|
+
/* @__PURE__ */ o(
|
|
22
22
|
"input",
|
|
23
23
|
{
|
|
24
|
-
...
|
|
25
|
-
...
|
|
26
|
-
ref:
|
|
24
|
+
...p,
|
|
25
|
+
...a,
|
|
26
|
+
ref: _,
|
|
27
27
|
id: s,
|
|
28
28
|
type: "radio",
|
|
29
|
-
className: r(`${e}__input`,
|
|
30
|
-
checked:
|
|
29
|
+
className: r(`${e}__input`, n),
|
|
30
|
+
checked: a.checked
|
|
31
31
|
}
|
|
32
32
|
),
|
|
33
|
-
/* @__PURE__ */
|
|
34
|
-
/* @__PURE__ */ i
|
|
35
|
-
|
|
33
|
+
/* @__PURE__ */ c("span", { className: `${e}__label-content`, children: [
|
|
34
|
+
/* @__PURE__ */ o(i, { variant: N.labelLarge, className: `${e}__label-text`, children: m }),
|
|
35
|
+
t && /* @__PURE__ */ o(i, { id: f, className: `${e}__description`, children: t })
|
|
36
36
|
] })
|
|
37
37
|
]
|
|
38
38
|
}
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { default as React, ComponentProps } from 'react';
|
|
2
|
+
import { TextVariants } from '../Text';
|
|
2
3
|
export interface DetailProps extends ComponentProps<'div'> {
|
|
3
4
|
hasWrap?: boolean;
|
|
4
5
|
label: React.ReactNode;
|
|
5
6
|
subLabel?: React.ReactNode;
|
|
6
7
|
value: React.ReactNode;
|
|
8
|
+
textVariant?: TextVariants;
|
|
7
9
|
}
|
|
8
10
|
/**
|
|
9
11
|
* ## Overview
|
|
@@ -1,21 +1,32 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as i, jsx as e } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as p } from "react";
|
|
3
|
-
import { getCommonProps as
|
|
4
|
-
import
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
3
|
+
import { getCommonProps as N } from "../../utils/index.js";
|
|
4
|
+
import r from "../../node_modules/classnames/index.js";
|
|
5
|
+
import { TextVariants as b } from "../Text/types.js";
|
|
6
|
+
import m from "../Text/Text.js";
|
|
7
|
+
const h = p(
|
|
8
|
+
({ className: t = "", hasWrap: c = !0, label: n, subLabel: l, value: d, textVariant: s = b.labelMedium, ...o }, _) => {
|
|
9
|
+
const { className: a, ...f } = N(o, "Detail");
|
|
10
|
+
return /* @__PURE__ */ i("div", { ...f, className: r(a, t), ...o, ref: _, children: [
|
|
11
|
+
/* @__PURE__ */ i(
|
|
12
|
+
"dt",
|
|
13
|
+
{
|
|
14
|
+
className: r(`${a}__label-section`, {
|
|
15
|
+
[`${a}__label--no-wrap`]: !c,
|
|
16
|
+
[`${a}__label-section--has-sub-label`]: l
|
|
17
|
+
}),
|
|
18
|
+
children: [
|
|
19
|
+
/* @__PURE__ */ e(m, { variant: s, className: r(`${a}__label-section--label`), children: n }),
|
|
20
|
+
" ",
|
|
21
|
+
l ? /* @__PURE__ */ e(m, { className: `${a}__sub-label`, variant: s, children: l }) : null
|
|
22
|
+
]
|
|
23
|
+
}
|
|
24
|
+
),
|
|
25
|
+
/* @__PURE__ */ e("dd", { className: `${a}__value`, children: /* @__PURE__ */ e(m, { variant: s, children: d }) })
|
|
15
26
|
] });
|
|
16
27
|
}
|
|
17
28
|
);
|
|
18
|
-
|
|
29
|
+
h.displayName = "Detail";
|
|
19
30
|
export {
|
|
20
|
-
|
|
31
|
+
h as default
|
|
21
32
|
};
|
|
@@ -8,8 +8,15 @@ export declare const Playground: {
|
|
|
8
8
|
(props: DetailProps): import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
args: {
|
|
10
10
|
label: string;
|
|
11
|
-
|
|
12
|
-
value: import("react/jsx-runtime").JSX.Element;
|
|
11
|
+
value: string;
|
|
13
12
|
};
|
|
14
13
|
argTypes: {};
|
|
15
14
|
};
|
|
15
|
+
export declare const WithSubLabel: {
|
|
16
|
+
(props: DetailProps): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
args: {
|
|
18
|
+
subLabel: string;
|
|
19
|
+
label: string;
|
|
20
|
+
value: string;
|
|
21
|
+
};
|
|
22
|
+
};
|