@phillips/seldon 1.215.0 → 1.217.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.
- package/dist/components/Accordion/Accordion.stories.d.ts +1 -1
- package/dist/components/Accordion/AccordionItem.js +101 -105
- package/dist/components/Accordion/types.d.ts +9 -3
- package/dist/components/Accordion/types.js +1 -1
- package/dist/components/Accordion/utils.d.ts +3 -3
- package/dist/components/Accordion/utils.js +7 -7
- 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 +33 -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 +27 -16
- package/dist/components/Detail/Detail.stories.d.ts +35 -2
- package/dist/components/Detail/index.d.ts +1 -0
- package/dist/components/Detail/types.d.ts +5 -0
- package/dist/components/Detail/types.js +4 -0
- 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 +17 -18
- 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 +37 -39
- 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/index.js +192 -190
- 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 +11 -1
- package/dist/patterns/BidSnapshot/BidSnapshot.js +76 -64
- package/dist/patterns/BidSnapshot/BidSnapshot.stories.d.ts +114 -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/DetailList/DetailList.d.ts +7 -2
- package/dist/patterns/DetailList/DetailList.js +25 -24
- package/dist/patterns/DetailList/DetailList.stories.d.ts +1 -0
- 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 +26 -28
- package/dist/patterns/ObjectTile/ObjectTile.js +66 -73
- package/dist/patterns/ObjectTile/ObjectTile.stories.d.ts +36 -0
- package/dist/patterns/PhoneNumberInput/PhoneNumberInput.js +7 -6
- package/dist/patterns/SaleCard/SaleCard.js +31 -39
- 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 +22 -22
- package/dist/patterns/Subscribe/Subscribe.js +57 -55
- 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 +181 -0
- package/dist/scss/components/Accordion/_accordion.scss +14 -28
- package/dist/scss/components/AddToCalendar/_addToCalendar.scss +0 -4
- package/dist/scss/components/Breadcrumb/_breadcrumb.scss +8 -1
- package/dist/scss/components/Button/_button.scss +40 -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 +13 -10
- 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 +29 -8
- package/dist/scss/components/LinkBlock/_linkBlock.scss +5 -1
- package/dist/scss/components/LinkList/_linkList.scss +6 -0
- package/dist/scss/components/Modal/_modal.scss +2 -2
- package/dist/scss/components/Navigation/NavigationItem/_navigationItem.scss +30 -14
- package/dist/scss/components/Navigation/NavigationItemTrigger/_navigationItemTrigger.scss +2 -2
- package/dist/scss/components/Navigation/NavigationList/_navigationList.scss +5 -4
- package/dist/scss/components/NotificationBanner/_notificationBanner.scss +10 -21
- 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 +3 -11
- 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 +1 -6
- package/dist/scss/components/Tags/_tags.scss +1 -2
- package/dist/scss/components/TextArea/_textArea.scss +2 -4
- package/dist/scss/components/TextSymbol/_textSymbol.scss +1 -4
- package/dist/scss/patterns/AccountPageHeader/_accountPageHeader.scss +4 -0
- package/dist/scss/patterns/BidSnapshot/_bidSnapshot.scss +12 -11
- 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 +8 -2
- 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 +12 -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 +5 -6
- package/dist/scss/patterns/LanguageSelector/_languageSelector.scss +4 -0
- 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 +7 -23
- package/dist/scss/patterns/SaleHeaderBanner/_saleHeaderBanner.scss +16 -3
- package/dist/scss/patterns/Social/_social.scss +5 -1
- package/dist/scss/patterns/Subscribe/_subscribe.scss +0 -12
- 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 +24 -4
- package/dist/scss/site-furniture/Header/_header.scss +12 -4
- package/dist/site-furniture/Footer/Footer.js +4 -4
- package/dist/site-furniture/Header/Header.js +76 -57
- package/package.json +4 -3
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsxs as k, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as B, useMemo as T } from "react";
|
|
3
3
|
import u from "../../node_modules/classnames/index.js";
|
|
4
|
-
import { getCommonProps as F, px as
|
|
4
|
+
import { getCommonProps as F, px as g } from "../../utils/index.js";
|
|
5
5
|
import M from "../Select/Select.js";
|
|
6
6
|
import x from "../IconButton/IconButton.js";
|
|
7
7
|
import { ButtonVariants as $ } from "../Button/types.js";
|
|
@@ -12,34 +12,34 @@ const z = B(
|
|
|
12
12
|
({
|
|
13
13
|
className: P,
|
|
14
14
|
onChange: _,
|
|
15
|
-
variant:
|
|
15
|
+
variant: S = "inline",
|
|
16
16
|
options: r = [],
|
|
17
|
-
value:
|
|
17
|
+
value: b,
|
|
18
18
|
isDisabled: c,
|
|
19
|
-
previousLabel:
|
|
20
|
-
nextLabel:
|
|
19
|
+
previousLabel: j = "Previous",
|
|
20
|
+
nextLabel: C = "Next",
|
|
21
21
|
selectLabel: v = "Select",
|
|
22
22
|
...m
|
|
23
|
-
},
|
|
24
|
-
const
|
|
25
|
-
const
|
|
26
|
-
R(
|
|
23
|
+
}, N) => {
|
|
24
|
+
const w = "pagination", { className: a, ...I } = F(m, "Pagination"), { id: l } = m, { pendingState: O, setPendingState: R } = q(f(b)), d = O || b, p = (e, o) => {
|
|
25
|
+
const s = f(e);
|
|
26
|
+
R(s), _(s, o);
|
|
27
27
|
}, [t, n] = T(() => {
|
|
28
|
-
const e = r.findIndex((h) => f(h) ===
|
|
28
|
+
const e = r.findIndex((h) => f(h) === d) - 1, o = r.at(e) || "", s = (r.findIndex((h) => f(h) === d) + 1) % r.length, V = r[s];
|
|
29
29
|
return [o, V];
|
|
30
|
-
}, [r,
|
|
30
|
+
}, [r, d]);
|
|
31
31
|
return /* @__PURE__ */ k(
|
|
32
32
|
"div",
|
|
33
33
|
{
|
|
34
|
-
ref:
|
|
35
|
-
className: u(`${
|
|
36
|
-
...
|
|
34
|
+
ref: N,
|
|
35
|
+
className: u(`${g}-${w}`, { [`${a}__wrapper`]: a }, P),
|
|
36
|
+
...I,
|
|
37
37
|
...m,
|
|
38
38
|
children: [
|
|
39
39
|
/* @__PURE__ */ i(
|
|
40
40
|
x,
|
|
41
41
|
{
|
|
42
|
-
className: u(`${a}__button`, `${
|
|
42
|
+
className: u(`${a}__button`, `${g}-left-arrow`, {
|
|
43
43
|
[`${a}__button--is-disabled`]: c
|
|
44
44
|
}),
|
|
45
45
|
onClick: (e) => {
|
|
@@ -47,19 +47,19 @@ const z = B(
|
|
|
47
47
|
},
|
|
48
48
|
"data-testid": `${l}-previous-button`,
|
|
49
49
|
isDisabled: c,
|
|
50
|
-
"aria-label":
|
|
50
|
+
"aria-label": j,
|
|
51
51
|
variant: $.primary,
|
|
52
52
|
href: typeof t == "object" && t.href ? t.href : void 0,
|
|
53
53
|
prefetch: typeof t == "object" && t.prefetch ? t.prefetch : void 0,
|
|
54
|
-
children: /* @__PURE__ */ i(y, { icon: "ChevronRight" })
|
|
54
|
+
children: /* @__PURE__ */ i(y, { icon: "ChevronRight", height: "16", width: "16" })
|
|
55
55
|
}
|
|
56
56
|
),
|
|
57
57
|
/* @__PURE__ */ i(
|
|
58
58
|
M,
|
|
59
59
|
{
|
|
60
|
-
className:
|
|
60
|
+
className: S === "inline" ? `${g}--inline-pagination` : void 0,
|
|
61
61
|
"aria-label": v,
|
|
62
|
-
value:
|
|
62
|
+
value: d,
|
|
63
63
|
onChange: (e) => {
|
|
64
64
|
const o = W(r, e?.currentTarget.value);
|
|
65
65
|
o && p(o, e);
|
|
@@ -70,6 +70,7 @@ const z = B(
|
|
|
70
70
|
disabled: c,
|
|
71
71
|
showIcon: !1,
|
|
72
72
|
id: `${l}-select-button`,
|
|
73
|
+
isStandalone: !0,
|
|
73
74
|
children: r.map((e) => {
|
|
74
75
|
const o = f(e);
|
|
75
76
|
return /* @__PURE__ */ i("option", { value: o, children: typeof e == "string" || typeof e == "number" ? e : e.label }, o);
|
|
@@ -87,11 +88,11 @@ const z = B(
|
|
|
87
88
|
},
|
|
88
89
|
"data-testid": `${l}-next-button`,
|
|
89
90
|
isDisabled: c,
|
|
90
|
-
"aria-label":
|
|
91
|
+
"aria-label": C,
|
|
91
92
|
variant: $.primary,
|
|
92
93
|
href: typeof n == "object" && n.href ? n.href : void 0,
|
|
93
94
|
prefetch: typeof n == "object" && n.prefetch ? n.prefetch : void 0,
|
|
94
|
-
children: /* @__PURE__ */ i(y, { icon: "ChevronRight" })
|
|
95
|
+
children: /* @__PURE__ */ i(y, { icon: "ChevronRight", height: "16", width: "16" })
|
|
95
96
|
}
|
|
96
97
|
)
|
|
97
98
|
]
|
|
@@ -1,54 +1,54 @@
|
|
|
1
1
|
import { jsx as r, jsxs as d } from "react/jsx-runtime";
|
|
2
2
|
import { Root as P } from "../../node_modules/@radix-ui/react-progress/dist/index.js";
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { getCommonProps as
|
|
3
|
+
import { forwardRef as S, Fragment as $ } from "react";
|
|
4
|
+
import { getCommonProps as C } from "../../utils/index.js";
|
|
5
5
|
import h from "../../node_modules/classnames/index.js";
|
|
6
|
-
import
|
|
6
|
+
import I from "../Icon/Icon.js";
|
|
7
7
|
import { TextVariants as p } from "../Text/types.js";
|
|
8
8
|
import _ from "../Text/Text.js";
|
|
9
|
-
const T =
|
|
9
|
+
const T = S(
|
|
10
10
|
({
|
|
11
|
-
totalSteps:
|
|
11
|
+
totalSteps: l,
|
|
12
12
|
currentStep: f,
|
|
13
13
|
className: u,
|
|
14
14
|
stepLabels: e,
|
|
15
|
-
progressIndicatorAriaLabel:
|
|
16
|
-
completedIconAriaLabel:
|
|
17
|
-
...
|
|
15
|
+
progressIndicatorAriaLabel: N = "Progress Indicator",
|
|
16
|
+
completedIconAriaLabel: g = "Completed Icon",
|
|
17
|
+
...m
|
|
18
18
|
}, v) => {
|
|
19
|
-
const { className: a, ...M } =
|
|
20
|
-
if (
|
|
21
|
-
const t = Math.max(1, Math.min(10, Math.floor(
|
|
22
|
-
return /* @__PURE__ */ r("div", { ...M, className: h(a, u), ...
|
|
23
|
-
const s = o + 1,
|
|
24
|
-
return /* @__PURE__ */ d(
|
|
19
|
+
const { className: a, ...M } = C(m, "ProgressIndicator");
|
|
20
|
+
if (l <= 0) return null;
|
|
21
|
+
const t = Math.max(1, Math.min(10, Math.floor(l))), c = Math.max(1, Math.min(t, Math.floor(f)));
|
|
22
|
+
return /* @__PURE__ */ r("div", { ...M, className: h(a, u), ...m, ref: v, children: /* @__PURE__ */ r(P, { value: c, max: t, "aria-label": N, children: /* @__PURE__ */ r("div", { className: `${a}__steps`, children: Array.from({ length: t }).map((x, o) => {
|
|
23
|
+
const s = o + 1, i = c > s, n = c === s;
|
|
24
|
+
return /* @__PURE__ */ d($, { children: [
|
|
25
25
|
/* @__PURE__ */ d(
|
|
26
26
|
"div",
|
|
27
27
|
{
|
|
28
28
|
className: `${a}__item`,
|
|
29
|
-
"aria-current":
|
|
29
|
+
"aria-current": n ? "step" : void 0,
|
|
30
30
|
"data-testid": `progress-step-${s}`,
|
|
31
31
|
children: [
|
|
32
32
|
/* @__PURE__ */ r(
|
|
33
33
|
"span",
|
|
34
34
|
{
|
|
35
35
|
className: h(`${a}__circle`, {
|
|
36
|
-
[`${a}__circle--active`]:
|
|
37
|
-
[`${a}__circle--current`]:
|
|
36
|
+
[`${a}__circle--active`]: i,
|
|
37
|
+
[`${a}__circle--current`]: n
|
|
38
38
|
}),
|
|
39
|
-
children:
|
|
40
|
-
|
|
39
|
+
children: i ? /* @__PURE__ */ r(
|
|
40
|
+
I,
|
|
41
41
|
{
|
|
42
42
|
icon: "Success",
|
|
43
|
-
"aria-label":
|
|
43
|
+
"aria-label": g,
|
|
44
44
|
color: "currentColor",
|
|
45
45
|
width: 20,
|
|
46
46
|
height: 20
|
|
47
47
|
}
|
|
48
|
-
) : /* @__PURE__ */ r(_, { variant: p.
|
|
48
|
+
) : /* @__PURE__ */ r(_, { variant: p.labelSmall, children: s })
|
|
49
49
|
}
|
|
50
50
|
),
|
|
51
|
-
e && e[o] && /* @__PURE__ */ r("span", { className: `${a}__label`, children: /* @__PURE__ */ r(_, { variant: p.
|
|
51
|
+
e && e[o] && /* @__PURE__ */ r("span", { className: `${a}__label`, children: /* @__PURE__ */ r(_, { variant: p.bodySmall, children: e[o] }) })
|
|
52
52
|
]
|
|
53
53
|
}
|
|
54
54
|
),
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { jsx as t, jsxs as u } from "react/jsx-runtime";
|
|
2
|
-
import { forwardRef as j, useContext as D, useRef as
|
|
3
|
-
import { getCommonProps as A, px as F, encodeURLSearchParams as
|
|
4
|
-
import
|
|
2
|
+
import { forwardRef as j, useContext as D, useRef as f, useState as H, useEffect as O } from "react";
|
|
3
|
+
import { getCommonProps as A, px as F, encodeURLSearchParams as w } from "../../utils/index.js";
|
|
4
|
+
import s from "../../node_modules/classnames/index.js";
|
|
5
5
|
import K from "../Input/Input.js";
|
|
6
6
|
import M from "../Link/Link.js";
|
|
7
7
|
import U from "./SearchResults/SearchResults.js";
|
|
@@ -11,86 +11,87 @@ import { useOnClickOutside as z } from "../../node_modules/usehooks-ts/dist/inde
|
|
|
11
11
|
import { HeaderContext as B } from "../../site-furniture/Header/Header.js";
|
|
12
12
|
import { SearchButton as G } from "./SearchButton.js";
|
|
13
13
|
import J from "../../node_modules/react-remove-scroll/dist/es2015/Combination.js";
|
|
14
|
-
import Q from "
|
|
15
|
-
|
|
14
|
+
import { LinkVariants as Q } from "../Link/types.js";
|
|
15
|
+
import W from "../../node_modules/react-transition-group/esm/CSSTransition.js";
|
|
16
|
+
const X = j(
|
|
16
17
|
({
|
|
17
18
|
onSearch: S,
|
|
18
19
|
onCancel: _,
|
|
19
|
-
searchResults:
|
|
20
|
-
state:
|
|
21
|
-
defaultValue:
|
|
20
|
+
searchResults: N = [],
|
|
21
|
+
state: o = "idle",
|
|
22
|
+
defaultValue: R = "",
|
|
22
23
|
className: C,
|
|
23
24
|
placeholder: I = "",
|
|
24
|
-
searchButtonText:
|
|
25
|
+
searchButtonText: i = "Search",
|
|
25
26
|
loadingText: E = "Search In Progress...",
|
|
26
27
|
invalidText: b = "Invalid search",
|
|
27
|
-
getAllResultsText:
|
|
28
|
+
getAllResultsText: k = (e) => `View all results for ${e}`,
|
|
28
29
|
getAllResultsLink: v = (e) => `/Search?Search=${e}`,
|
|
29
30
|
...x
|
|
30
|
-
},
|
|
31
|
-
const { className: e, "data-testid":
|
|
31
|
+
}, L) => {
|
|
32
|
+
const { className: e, "data-testid": l, ...P } = A(x, "Search"), c = D(B), d = f(null), m = f(null), g = f(null), a = c.isSearchExpanded, n = d.current?.value, [T, h] = H(!0), y = S ? (r) => {
|
|
32
33
|
S(r.target.value);
|
|
33
34
|
} : void 0;
|
|
34
35
|
z(g, (r) => {
|
|
35
|
-
_?.(),
|
|
36
|
+
_?.(), p(!1), r.stopPropagation();
|
|
36
37
|
});
|
|
37
38
|
const $ = (r) => {
|
|
38
39
|
if (r.stopPropagation(), r.key === "Enter") {
|
|
39
|
-
if (r.preventDefault(),
|
|
40
|
-
const V =
|
|
41
|
-
|
|
40
|
+
if (r.preventDefault(), n && n.length > 2) {
|
|
41
|
+
const V = w(v(n));
|
|
42
|
+
h(!1), window.location.href = V;
|
|
42
43
|
}
|
|
43
|
-
r.currentTarget instanceof HTMLAnchorElement && (
|
|
44
|
+
r.currentTarget instanceof HTMLAnchorElement && (h(!1), r.currentTarget.click());
|
|
44
45
|
}
|
|
45
|
-
r.key === "Escape" && (
|
|
46
|
+
r.key === "Escape" && (m.current?.reset(), c.setIsSearchExpanded(!1));
|
|
46
47
|
};
|
|
47
48
|
O(() => {
|
|
48
49
|
if (a) {
|
|
49
|
-
|
|
50
|
+
d.current?.focus();
|
|
50
51
|
return;
|
|
51
52
|
}
|
|
52
53
|
}, [a]);
|
|
53
|
-
const
|
|
54
|
-
|
|
54
|
+
const p = (r) => {
|
|
55
|
+
m.current?.reset(), c.setIsSearchExpanded(r);
|
|
55
56
|
};
|
|
56
|
-
return /* @__PURE__ */ t(J, { enabled: a, allowPinchZoom: !0, removeScrollBar: !1, children: /* @__PURE__ */ t("div", { className: `${e}__container`, ref:
|
|
57
|
+
return /* @__PURE__ */ t(J, { enabled: a, allowPinchZoom: !0, removeScrollBar: !1, children: /* @__PURE__ */ t("div", { className: `${e}__container`, ref: L, children: /* @__PURE__ */ u(
|
|
57
58
|
"div",
|
|
58
59
|
{
|
|
59
60
|
className: `${e}__container__inner`,
|
|
60
61
|
ref: g,
|
|
61
62
|
onClick: (r) => {
|
|
62
|
-
a || (
|
|
63
|
+
a || (p(!0), r.stopPropagation());
|
|
63
64
|
},
|
|
64
65
|
children: [
|
|
65
|
-
/* @__PURE__ */ t(q, { variant: Z.
|
|
66
|
+
/* @__PURE__ */ t(q, { variant: Z.headingSmall, className: `${e}__container__inner__label`, children: i }),
|
|
66
67
|
/* @__PURE__ */ t(
|
|
67
68
|
"div",
|
|
68
69
|
{
|
|
69
|
-
...
|
|
70
|
-
className:
|
|
71
|
-
"data-testid":
|
|
70
|
+
...P,
|
|
71
|
+
className: s(e, C, { [`${e}--active`]: a }),
|
|
72
|
+
"data-testid": l,
|
|
72
73
|
role: "search",
|
|
73
74
|
...x,
|
|
74
75
|
children: /* @__PURE__ */ u(
|
|
75
76
|
"form",
|
|
76
77
|
{
|
|
77
|
-
"data-testid": `${
|
|
78
|
-
className:
|
|
78
|
+
"data-testid": `${l}-form`,
|
|
79
|
+
className: s(`${e}__form`, {
|
|
79
80
|
[`${e}__form--active`]: a
|
|
80
81
|
}),
|
|
81
|
-
ref:
|
|
82
|
+
ref: m,
|
|
82
83
|
children: [
|
|
83
84
|
/* @__PURE__ */ u(
|
|
84
85
|
"div",
|
|
85
86
|
{
|
|
86
|
-
className:
|
|
87
|
+
className: s(`${e}__content-wrapper`, {
|
|
87
88
|
[`${e}__content-wrapper--active`]: a
|
|
88
89
|
}),
|
|
89
90
|
role: "combobox",
|
|
90
91
|
"aria-haspopup": "listbox",
|
|
91
92
|
children: [
|
|
92
93
|
/* @__PURE__ */ t(
|
|
93
|
-
|
|
94
|
+
W,
|
|
94
95
|
{
|
|
95
96
|
in: a,
|
|
96
97
|
classNames: `${F}-input`,
|
|
@@ -103,15 +104,15 @@ const W = j(
|
|
|
103
104
|
className: `${e}__input`,
|
|
104
105
|
id: "search-input",
|
|
105
106
|
hideLabel: !0,
|
|
106
|
-
labelText:
|
|
107
|
+
labelText: i,
|
|
107
108
|
placeholder: a ? I : "",
|
|
108
109
|
type: "text",
|
|
109
|
-
defaultValue:
|
|
110
|
-
invalid:
|
|
110
|
+
defaultValue: R,
|
|
111
|
+
invalid: o === "invalid",
|
|
111
112
|
invalidText: b,
|
|
112
113
|
onKeyDown: $,
|
|
113
114
|
onChange: y,
|
|
114
|
-
ref:
|
|
115
|
+
ref: d
|
|
115
116
|
}
|
|
116
117
|
)
|
|
117
118
|
}
|
|
@@ -120,33 +121,34 @@ const W = j(
|
|
|
120
121
|
G,
|
|
121
122
|
{
|
|
122
123
|
className: e,
|
|
123
|
-
searchButtonText:
|
|
124
|
-
state:
|
|
125
|
-
testId:
|
|
124
|
+
searchButtonText: i,
|
|
125
|
+
state: o,
|
|
126
|
+
testId: l,
|
|
126
127
|
isSearchExpanded: a,
|
|
127
|
-
setIsSearchExpanded:
|
|
128
|
+
setIsSearchExpanded: p,
|
|
128
129
|
onCancel: _
|
|
129
130
|
}
|
|
130
131
|
)
|
|
131
132
|
]
|
|
132
133
|
}
|
|
133
134
|
),
|
|
134
|
-
a && T &&
|
|
135
|
+
a && T && n && n.length > 2 ? /* @__PURE__ */ t(
|
|
135
136
|
U,
|
|
136
137
|
{
|
|
137
|
-
autoCompleteResults:
|
|
138
|
-
isLoading:
|
|
138
|
+
autoCompleteResults: N,
|
|
139
|
+
isLoading: o === "loading",
|
|
139
140
|
loadingText: E,
|
|
140
141
|
onKeyDown: $,
|
|
141
|
-
userInputValue:
|
|
142
|
-
closeSearch:
|
|
143
|
-
children: /* @__PURE__ */ t(
|
|
144
|
-
|
|
142
|
+
userInputValue: n,
|
|
143
|
+
closeSearch: h,
|
|
144
|
+
children: /* @__PURE__ */ t(
|
|
145
|
+
"li",
|
|
145
146
|
{
|
|
146
|
-
|
|
147
|
-
children: /* @__PURE__ */ t("p", { children:
|
|
148
|
-
}
|
|
149
|
-
|
|
147
|
+
className: s(`${e}__result`, `${e}__result--view-all`),
|
|
148
|
+
children: /* @__PURE__ */ t(M, { href: w(v(n)), variant: Q.linkLarge, children: /* @__PURE__ */ t("p", { children: k(n) }) })
|
|
149
|
+
},
|
|
150
|
+
"viewAllSearchResults"
|
|
151
|
+
)
|
|
150
152
|
}
|
|
151
153
|
) : null
|
|
152
154
|
]
|
|
@@ -159,7 +161,7 @@ const W = j(
|
|
|
159
161
|
) }) });
|
|
160
162
|
}
|
|
161
163
|
);
|
|
162
|
-
|
|
164
|
+
X.displayName = "Search";
|
|
163
165
|
export {
|
|
164
|
-
|
|
166
|
+
X as default
|
|
165
167
|
};
|
|
@@ -1,37 +1,37 @@
|
|
|
1
|
-
import { jsx as r, jsxs as
|
|
1
|
+
import { jsx as r, jsxs as u } from "react/jsx-runtime";
|
|
2
2
|
import { px as e } from "../../../utils/index.js";
|
|
3
3
|
import f from "../../Link/Link.js";
|
|
4
4
|
import { LinkVariants as L } from "../../Link/types.js";
|
|
5
|
-
const
|
|
5
|
+
const b = ({
|
|
6
6
|
autoCompleteResults: l = [],
|
|
7
|
-
isLoading:
|
|
8
|
-
children:
|
|
7
|
+
isLoading: n,
|
|
8
|
+
children: t,
|
|
9
9
|
loadingText: c = "Loading...",
|
|
10
10
|
onKeyDown: o,
|
|
11
11
|
userInputValue: h = "",
|
|
12
12
|
closeSearch: d
|
|
13
13
|
}) => {
|
|
14
14
|
const m = Array.isArray(l) && l.length > 0;
|
|
15
|
-
function _(
|
|
16
|
-
return
|
|
17
|
-
(
|
|
15
|
+
function _(a, s) {
|
|
16
|
+
return a.split(new RegExp(`(${s})`, "gi")).map(
|
|
17
|
+
(i, p) => i.toLocaleLowerCase() === s.toLocaleLowerCase() ? /* @__PURE__ */ r("strong", { children: i }, p) : i
|
|
18
18
|
);
|
|
19
19
|
}
|
|
20
|
-
return /* @__PURE__ */ r("div", { className: `${e}-search__results`, children: /* @__PURE__ */
|
|
21
|
-
|
|
22
|
-
m && l.map((
|
|
20
|
+
return /* @__PURE__ */ r("div", { className: `${e}-search__results`, children: /* @__PURE__ */ u("ul", { "data-testid": "search-results", className: `${e}-search__results-container`, children: [
|
|
21
|
+
n ? /* @__PURE__ */ r("li", { className: `${e}-search__result`, children: c }) : null,
|
|
22
|
+
m && l.map((a, s) => /* @__PURE__ */ r("li", { className: `${e}-search__result`, children: /* @__PURE__ */ r(
|
|
23
23
|
f,
|
|
24
24
|
{
|
|
25
|
-
href:
|
|
25
|
+
href: a.url,
|
|
26
26
|
onKeyDown: o,
|
|
27
27
|
onClick: () => d(!1),
|
|
28
|
-
variant: L.
|
|
29
|
-
children: /* @__PURE__ */ r("span", { "data-testid": `search-result-${
|
|
28
|
+
variant: L.linkLarge,
|
|
29
|
+
children: /* @__PURE__ */ r("span", { "data-testid": `search-result-${s}`, className: "${px}-search__result__label", children: _(a.label, h) })
|
|
30
30
|
}
|
|
31
|
-
) },
|
|
32
|
-
|
|
31
|
+
) }, a.id)),
|
|
32
|
+
t
|
|
33
33
|
] }) });
|
|
34
34
|
};
|
|
35
35
|
export {
|
|
36
|
-
|
|
36
|
+
b as default
|
|
37
37
|
};
|
|
@@ -19,6 +19,10 @@ export interface SelectProps extends Merge<InputProps, React.ComponentProps<'sel
|
|
|
19
19
|
* Determines the variant of the select
|
|
20
20
|
*/
|
|
21
21
|
variant?: SelectVariants;
|
|
22
|
+
/**
|
|
23
|
+
* Determines if the select is not in a form
|
|
24
|
+
*/
|
|
25
|
+
isStandalone?: boolean;
|
|
22
26
|
}
|
|
23
27
|
/**
|
|
24
28
|
* ## Overview
|
|
@@ -1,86 +1,92 @@
|
|
|
1
1
|
import { jsxs as p, jsx as s } from "react/jsx-runtime";
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
import { px as e, useNormalizedInputProps as
|
|
2
|
+
import * as k from "react";
|
|
3
|
+
import n from "../../node_modules/classnames/index.js";
|
|
4
|
+
import { px as e, useNormalizedInputProps as z } from "../../utils/index.js";
|
|
5
5
|
import { SelectVariants as c } from "./types.js";
|
|
6
|
-
import
|
|
7
|
-
|
|
6
|
+
import D from "../Icon/Icon.js";
|
|
7
|
+
import { TextVariants as F } from "../Text/types.js";
|
|
8
|
+
import I from "../Text/Text.js";
|
|
9
|
+
const M = k.forwardRef(
|
|
8
10
|
({
|
|
9
|
-
children:
|
|
11
|
+
children: m,
|
|
10
12
|
className: i,
|
|
11
|
-
defaultValue:
|
|
13
|
+
defaultValue: d,
|
|
12
14
|
disabled: u,
|
|
13
15
|
hideLabel: $,
|
|
14
16
|
id: t,
|
|
15
|
-
showIcon:
|
|
17
|
+
showIcon: r = !0,
|
|
16
18
|
variant: _ = c.default,
|
|
17
19
|
inline: f,
|
|
18
20
|
invalid: b,
|
|
19
|
-
invalidText:
|
|
20
|
-
labelText:
|
|
21
|
+
invalidText: v,
|
|
22
|
+
labelText: h,
|
|
21
23
|
onChange: w,
|
|
22
|
-
onClick:
|
|
23
|
-
readOnly:
|
|
24
|
-
size:
|
|
25
|
-
value:
|
|
24
|
+
onClick: g,
|
|
25
|
+
readOnly: o,
|
|
26
|
+
size: x = "md",
|
|
27
|
+
value: C,
|
|
26
28
|
warn: y,
|
|
27
29
|
warnText: N,
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
30
|
+
isStandalone: S = !1,
|
|
31
|
+
...j
|
|
32
|
+
}, P) => {
|
|
33
|
+
const l = "select", a = z({
|
|
31
34
|
disabled: u,
|
|
32
35
|
id: t,
|
|
33
36
|
invalid: b,
|
|
34
|
-
invalidText:
|
|
35
|
-
readOnly:
|
|
36
|
-
type:
|
|
37
|
+
invalidText: v,
|
|
38
|
+
readOnly: o,
|
|
39
|
+
type: l,
|
|
37
40
|
warn: y,
|
|
38
41
|
warnText: N
|
|
39
|
-
}),
|
|
42
|
+
}), R = n(`${e}-${l}-input`, `${e}-input`, `${e}-input--${x}`, {
|
|
40
43
|
[`${e}-input--inline`]: f,
|
|
41
|
-
[`${e}-input--readonly`]:
|
|
42
|
-
[`${e}-input--disabled`]:
|
|
43
|
-
[`${e}-input--invalid`]:
|
|
44
|
-
[`${e}-input--warn`]:
|
|
45
|
-
[`${i}__wrapper`]: i
|
|
46
|
-
|
|
44
|
+
[`${e}-input--readonly`]: o,
|
|
45
|
+
[`${e}-input--disabled`]: a.disabled,
|
|
46
|
+
[`${e}-input--invalid`]: a.invalid,
|
|
47
|
+
[`${e}-input--warn`]: a.warn,
|
|
48
|
+
[`${i}__wrapper`]: i,
|
|
49
|
+
[`${e}-${l}-input__standalone`]: S
|
|
50
|
+
}), T = n(i, `${e}-input__input`, {
|
|
47
51
|
[`${e}-input__select--tertiary`]: _ === c.tertiary
|
|
48
|
-
}),
|
|
49
|
-
[`${e}-select-container--show__icon`]:
|
|
52
|
+
}), V = n(`${e}-select-container`, {
|
|
53
|
+
[`${e}-select-container--show__icon`]: r
|
|
50
54
|
});
|
|
51
|
-
return /* @__PURE__ */ p("div", { className:
|
|
55
|
+
return /* @__PURE__ */ p("div", { className: R, children: [
|
|
52
56
|
/* @__PURE__ */ s(
|
|
53
|
-
|
|
57
|
+
I,
|
|
54
58
|
{
|
|
59
|
+
element: "label",
|
|
60
|
+
variant: F.labelMedium,
|
|
55
61
|
"data-testid": `${t}-label`,
|
|
56
62
|
htmlFor: t,
|
|
57
|
-
className:
|
|
58
|
-
children:
|
|
63
|
+
className: n(`${e}-input__label`, { [`${e}-input__label--hidden`]: $ }),
|
|
64
|
+
children: h
|
|
59
65
|
}
|
|
60
66
|
),
|
|
61
|
-
/* @__PURE__ */ p("div", { className:
|
|
67
|
+
/* @__PURE__ */ p("div", { className: V, children: [
|
|
62
68
|
/* @__PURE__ */ s(
|
|
63
69
|
"select",
|
|
64
70
|
{
|
|
65
|
-
className:
|
|
71
|
+
className: T,
|
|
66
72
|
"data-testid": t,
|
|
67
|
-
defaultValue:
|
|
68
|
-
disabled:
|
|
73
|
+
defaultValue: d,
|
|
74
|
+
disabled: a.disabled,
|
|
69
75
|
id: t,
|
|
70
76
|
onChange: w,
|
|
71
|
-
ref:
|
|
72
|
-
value:
|
|
73
|
-
...
|
|
74
|
-
children:
|
|
77
|
+
ref: P,
|
|
78
|
+
value: C,
|
|
79
|
+
...j,
|
|
80
|
+
children: m
|
|
75
81
|
}
|
|
76
82
|
),
|
|
77
|
-
|
|
83
|
+
r ? /* @__PURE__ */ s(D, { icon: "ChevronDown" }) : null
|
|
78
84
|
] }),
|
|
79
|
-
|
|
85
|
+
a.validation
|
|
80
86
|
] });
|
|
81
87
|
}
|
|
82
88
|
);
|
|
83
|
-
|
|
89
|
+
M.displayName = "Select";
|
|
84
90
|
export {
|
|
85
|
-
|
|
91
|
+
M as default
|
|
86
92
|
};
|
|
@@ -120,6 +120,7 @@ export declare const Tertiary: {
|
|
|
120
120
|
};
|
|
121
121
|
};
|
|
122
122
|
};
|
|
123
|
+
export declare const IsStandalone: ({ playgroundWidth, ...args }: StoryProps) => import("react/jsx-runtime").JSX.Element;
|
|
123
124
|
export declare const CustomLabel: {
|
|
124
125
|
({ playgroundWidth, ...args }: StoryProps): import("react/jsx-runtime").JSX.Element;
|
|
125
126
|
args: {
|
|
@@ -26,7 +26,7 @@ const x = N(
|
|
|
26
26
|
value: e.value,
|
|
27
27
|
className: `${a}__tabs-trigger`,
|
|
28
28
|
onClick: f,
|
|
29
|
-
children: /* @__PURE__ */ r(C, { variant: v.
|
|
29
|
+
children: /* @__PURE__ */ r(C, { variant: v.labelMedium, children: e.label })
|
|
30
30
|
},
|
|
31
31
|
e.value
|
|
32
32
|
)),
|