@phillips/seldon 1.228.0 → 1.230.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/Input/Input.js +65 -64
- package/dist/components/Input/utils.d.ts +11 -0
- package/dist/components/Input/utils.js +108 -0
- package/dist/components/Select/Select.js +54 -53
- package/dist/patterns/CountryPicker/CountryPickerTrigger.js +38 -37
- package/dist/patterns/PhoneNumberInput/PhoneNumberInput.js +8 -7
- package/dist/scss/patterns/CountryPicker/_countryPickerTrigger.scss +9 -12
- package/dist/scss/patterns/FiltersInline/_filterButton.scss +17 -2
- package/dist/scss/patterns/PhoneNumberInput/_phoneNumberInput.scss +5 -15
- package/package.json +1 -1
|
@@ -1,52 +1,53 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
3
|
-
import
|
|
4
|
-
import { px as t, useNormalizedInputProps as
|
|
5
|
-
import { TextVariants as
|
|
6
|
-
import
|
|
7
|
-
|
|
1
|
+
import { jsxs as h, jsx as s } from "react/jsx-runtime";
|
|
2
|
+
import * as _ from "react";
|
|
3
|
+
import l from "../../node_modules/classnames/index.js";
|
|
4
|
+
import { px as t, useNormalizedInputProps as z } from "../../utils/index.js";
|
|
5
|
+
import { TextVariants as F } from "../Text/types.js";
|
|
6
|
+
import H from "../Text/Text.js";
|
|
7
|
+
import { getInputClassNames as M } from "./utils.js";
|
|
8
|
+
const q = _.forwardRef(
|
|
8
9
|
({
|
|
9
10
|
className: p,
|
|
10
|
-
inputAdornment:
|
|
11
|
-
adornmentPosition:
|
|
12
|
-
defaultValue:
|
|
13
|
-
disabled:
|
|
11
|
+
inputAdornment: r,
|
|
12
|
+
adornmentPosition: m = "start",
|
|
13
|
+
defaultValue: b,
|
|
14
|
+
disabled: f,
|
|
14
15
|
hideLabel: w,
|
|
15
|
-
id:
|
|
16
|
-
inline:
|
|
17
|
-
invalid:
|
|
18
|
-
invalidText:
|
|
19
|
-
labelText:
|
|
20
|
-
onChange:
|
|
21
|
-
onClick:
|
|
22
|
-
placeholder:
|
|
16
|
+
id: n,
|
|
17
|
+
inline: N,
|
|
18
|
+
invalid: x,
|
|
19
|
+
invalidText: y,
|
|
20
|
+
labelText: I,
|
|
21
|
+
onChange: v,
|
|
22
|
+
onClick: T,
|
|
23
|
+
placeholder: C,
|
|
23
24
|
readOnly: d,
|
|
24
|
-
size:
|
|
25
|
-
type:
|
|
26
|
-
value:
|
|
27
|
-
warn:
|
|
28
|
-
warnText:
|
|
29
|
-
isSkeletonLoading:
|
|
30
|
-
...
|
|
31
|
-
},
|
|
32
|
-
const e =
|
|
33
|
-
disabled:
|
|
34
|
-
id:
|
|
35
|
-
invalid:
|
|
36
|
-
invalidText:
|
|
25
|
+
size: P = "md",
|
|
26
|
+
type: o = "text",
|
|
27
|
+
value: j,
|
|
28
|
+
warn: k,
|
|
29
|
+
warnText: E,
|
|
30
|
+
isSkeletonLoading: i,
|
|
31
|
+
...u
|
|
32
|
+
}, R) => {
|
|
33
|
+
const e = z({
|
|
34
|
+
disabled: f,
|
|
35
|
+
id: n,
|
|
36
|
+
invalid: x,
|
|
37
|
+
invalidText: y,
|
|
37
38
|
readOnly: d,
|
|
38
|
-
type:
|
|
39
|
-
warn:
|
|
40
|
-
warnText:
|
|
41
|
-
}),
|
|
42
|
-
[`${t}-input--inline`]:
|
|
39
|
+
type: o,
|
|
40
|
+
warn: k,
|
|
41
|
+
warnText: E
|
|
42
|
+
}), V = l(`${t}-${o}-input`, `${t}-input`, `${t}-input--${P}`, {
|
|
43
|
+
[`${t}-input--inline`]: N,
|
|
43
44
|
[`${t}-input--readonly`]: d,
|
|
44
45
|
[`${t}-input--disabled`]: e.disabled,
|
|
45
46
|
[`${t}-input--invalid`]: e.invalid,
|
|
46
47
|
[`${t}-input--warn`]: e.warn,
|
|
47
48
|
[`${p}__wrapper`]: p,
|
|
48
|
-
[`${t}-input--hidden`]:
|
|
49
|
-
}),
|
|
49
|
+
[`${t}-input--hidden`]: u.hidden
|
|
50
|
+
}), a = M(), c = [
|
|
50
51
|
"text",
|
|
51
52
|
"number",
|
|
52
53
|
"password",
|
|
@@ -60,40 +61,40 @@ const q = z.forwardRef(
|
|
|
60
61
|
"time",
|
|
61
62
|
"week"
|
|
62
63
|
].includes(e.type ?? ""), $ = {
|
|
63
|
-
className:
|
|
64
|
-
"data-testid":
|
|
64
|
+
className: r && c ? l(a.wrapperInput, p, { [`${t}-skeleton`]: i }) : l(a.input, p, { [`${t}-skeleton`]: i }),
|
|
65
|
+
"data-testid": n,
|
|
65
66
|
disabled: e.disabled,
|
|
66
|
-
id:
|
|
67
|
-
onChange:
|
|
68
|
-
onClick:
|
|
69
|
-
placeholder:
|
|
67
|
+
id: n,
|
|
68
|
+
onChange: v,
|
|
69
|
+
onClick: T,
|
|
70
|
+
placeholder: i ? "" : C,
|
|
70
71
|
readOnly: d,
|
|
71
|
-
ref:
|
|
72
|
+
ref: R,
|
|
72
73
|
type: e.type,
|
|
73
|
-
...e.type !== "checkbox" && e.type !== "radio" ? { value:
|
|
74
|
-
...
|
|
74
|
+
...e.type !== "checkbox" && e.type !== "radio" ? { value: j, defaultValue: b } : {},
|
|
75
|
+
...u
|
|
75
76
|
};
|
|
76
|
-
return /* @__PURE__ */
|
|
77
|
-
/* @__PURE__ */
|
|
78
|
-
|
|
77
|
+
return /* @__PURE__ */ h("div", { className: V, children: [
|
|
78
|
+
/* @__PURE__ */ s(
|
|
79
|
+
H,
|
|
79
80
|
{
|
|
80
81
|
element: "label",
|
|
81
|
-
variant:
|
|
82
|
-
className:
|
|
83
|
-
[
|
|
84
|
-
[
|
|
82
|
+
variant: F.labelMedium,
|
|
83
|
+
className: l(a.label, {
|
|
84
|
+
[a.labelHidden]: w,
|
|
85
|
+
[a.skeleton]: i
|
|
85
86
|
}),
|
|
86
|
-
"data-testid": `label-${
|
|
87
|
-
htmlFor:
|
|
88
|
-
children:
|
|
87
|
+
"data-testid": `label-${n}`,
|
|
88
|
+
htmlFor: n,
|
|
89
|
+
children: I
|
|
89
90
|
}
|
|
90
91
|
),
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
/* @__PURE__ */
|
|
94
|
-
|
|
95
|
-
] }) : /* @__PURE__ */
|
|
96
|
-
e.validation ? e.validation : /* @__PURE__ */
|
|
92
|
+
r && c ? /* @__PURE__ */ h("div", { className: a.wrapper, "data-testid": `wrapper-${n}`, children: [
|
|
93
|
+
m === "start" && /* @__PURE__ */ s("span", { className: a.adornment, id: "adornment", "data-testid": `adornment-${n}`, children: r }),
|
|
94
|
+
/* @__PURE__ */ s("input", { ...$ }),
|
|
95
|
+
m === "end" && /* @__PURE__ */ s("span", { className: a.adornment, id: "adornment", "data-testid": `adornment-${n}`, children: r })
|
|
96
|
+
] }) : /* @__PURE__ */ s("input", { ...$ }),
|
|
97
|
+
e.validation ? e.validation : /* @__PURE__ */ s("p", { className: a.emptyValidation, children: " " })
|
|
97
98
|
] });
|
|
98
99
|
}
|
|
99
100
|
);
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const getInputClassNames: () => {
|
|
2
|
+
readonly adornment: "seldon-input__wrapper__adornment";
|
|
3
|
+
readonly emptyValidation: "seldon-input__empty-validation";
|
|
4
|
+
readonly input: "seldon-input__input";
|
|
5
|
+
readonly label: "seldon-input__label";
|
|
6
|
+
readonly labelHidden: "seldon-input__label--hidden";
|
|
7
|
+
readonly skeleton: "seldon-skeleton";
|
|
8
|
+
readonly validation: "seldon-input__validation";
|
|
9
|
+
readonly wrapper: "seldon-input__wrapper";
|
|
10
|
+
readonly wrapperInput: "seldon-input__wrapper__input";
|
|
11
|
+
};
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
import { px as p } from "../../utils/index.js";
|
|
2
|
+
import "react/jsx-runtime";
|
|
3
|
+
import "../../providers/SeldonProvider/utils.js";
|
|
4
|
+
import "react";
|
|
5
|
+
import "../Button/Button.js";
|
|
6
|
+
import "../IconButton/IconButton.js";
|
|
7
|
+
import "../Accordion/Accordion.js";
|
|
8
|
+
import "../Accordion/AccordionItem.js";
|
|
9
|
+
import "../../node_modules/classnames/index.js";
|
|
10
|
+
import "../Icon/Icon.js";
|
|
11
|
+
import "../Carousel/Carousel.js";
|
|
12
|
+
import "../Carousel/CarouselArrows.js";
|
|
13
|
+
import "../Carousel/CarouselContent.js";
|
|
14
|
+
import "../Carousel/CarouselItem.js";
|
|
15
|
+
import "../Carousel/CarouselDots.js";
|
|
16
|
+
import "../Collapsible/Collapsible.js";
|
|
17
|
+
import "../Collapsible/CollapsibleContent.js";
|
|
18
|
+
import "../Collapsible/CollapsibleTrigger.js";
|
|
19
|
+
import "../ContentPeek/ContentPeek.js";
|
|
20
|
+
import "../Detail/Detail.js";
|
|
21
|
+
import "../Drawer/Drawer.js";
|
|
22
|
+
import "../Dropdown/Dropdown.js";
|
|
23
|
+
import "../Grid/Grid.js";
|
|
24
|
+
import "../GridItem/GridItem.js";
|
|
25
|
+
import "./Input.js";
|
|
26
|
+
import "../Link/Link.js";
|
|
27
|
+
import "../Link/types.js";
|
|
28
|
+
import "../LinkBlock/LinkBlock.js";
|
|
29
|
+
import "../LinkList/LinkList.js";
|
|
30
|
+
import "../Modal/Modal.js";
|
|
31
|
+
import "../Navigation/Navigation.js";
|
|
32
|
+
import "../Navigation/NavigationItem/NavigationItem.js";
|
|
33
|
+
import "../Navigation/NavigationItemTrigger/NavigationItemTrigger.js";
|
|
34
|
+
import "../Navigation/NavigationList/NavigationList.js";
|
|
35
|
+
import "../Pagination/Pagination.js";
|
|
36
|
+
import "../PinchZoom/PinchZoom.js";
|
|
37
|
+
import "../Row/Row.js";
|
|
38
|
+
import "../Search/Search.js";
|
|
39
|
+
import "../SeldonImage/SeldonImage.js";
|
|
40
|
+
import "../Select/Select.js";
|
|
41
|
+
import "../SplitPanel/SplitPanel.js";
|
|
42
|
+
import "../Tabs/TabsContainer.js";
|
|
43
|
+
import "../Tabs/TabsContent.js";
|
|
44
|
+
import "../Tags/Tags.js";
|
|
45
|
+
import "../Text/Text.js";
|
|
46
|
+
import "../TextSymbol/TextSymbol.js";
|
|
47
|
+
import "../Video/Video.js";
|
|
48
|
+
import "../../patterns/DetailList/DetailList.js";
|
|
49
|
+
import "../../patterns/FavoritesCollectionTile/FavoritesCollectionTile.js";
|
|
50
|
+
import "../../patterns/HeroBanner/HeroBanner.js";
|
|
51
|
+
import "../../patterns/TextBanner/TextBanner.js";
|
|
52
|
+
import "../../patterns/LanguageSelector/LanguageSelector.js";
|
|
53
|
+
import "../../patterns/SaleHeaderBanner/SaleHeaderBanner.js";
|
|
54
|
+
import "../../patterns/SaleHeaderBanner/SaleHeaderBrowseAuctions.js";
|
|
55
|
+
import "../../patterns/Social/Social.js";
|
|
56
|
+
import "../../patterns/Subscribe/Subscribe.js";
|
|
57
|
+
import "../../patterns/UserManagement/UserManagement.js";
|
|
58
|
+
import "../../patterns/ViewingsList/StatefulViewingsList.js";
|
|
59
|
+
import "../../patterns/ViewingsList/ViewingsList.js";
|
|
60
|
+
import "../ComboBox/ComboBox.js";
|
|
61
|
+
import "../ComposedModal/ComposedModal.js";
|
|
62
|
+
import "../ExitGateCard/ExitGateCard.js";
|
|
63
|
+
import "../Loader/Loader.js";
|
|
64
|
+
import "../PageContentWrapper/PageContentWrapper.js";
|
|
65
|
+
import "../../patterns/FiltersInline/FilterButton.js";
|
|
66
|
+
import "../../patterns/FiltersInline/FiltersInline.js";
|
|
67
|
+
import "../../patterns/SaleCard/SaleCard.js";
|
|
68
|
+
import "../../patterns/SaleCard/SaleCardActions.js";
|
|
69
|
+
import "../../patterns/ViewingDetails/ViewingDetails.js";
|
|
70
|
+
import "../ProgressIndicator/ProgressIndicator.js";
|
|
71
|
+
import "../../site-furniture/Header/Header.js";
|
|
72
|
+
import "../AddToCalendar/AddToCalendar.js";
|
|
73
|
+
import "../Article/Article.js";
|
|
74
|
+
import "../Countdown/Countdown.js";
|
|
75
|
+
import "../DescriptiveRadioButton/DescriptiveRadioButton.js";
|
|
76
|
+
import "../DescriptiveRadioButtonGroup/DescriptiveRadioButtonGroup.js";
|
|
77
|
+
import "../Divider/Divider.js";
|
|
78
|
+
import "../FavoritingTileButton/FavoritingTileButton.js";
|
|
79
|
+
import "../Filter/Filter.js";
|
|
80
|
+
import "../Filter/FilterInput.js";
|
|
81
|
+
import "../Filter/FilterHeader.js";
|
|
82
|
+
import "../NotificationBanner/NotificationBanner.js";
|
|
83
|
+
import "../Pictogram/Pictogram.js";
|
|
84
|
+
import "../TextArea/TextArea.js";
|
|
85
|
+
import "../Toast/Toast.js";
|
|
86
|
+
import "../Toast/ToastContextProvider.js";
|
|
87
|
+
import "../../patterns/AccountPageHeader/AccountPageHeader.js";
|
|
88
|
+
import "../../patterns/BidSnapshot/BidSnapshot.js";
|
|
89
|
+
import "../../patterns/FilterMenu/FilterMenu.js";
|
|
90
|
+
import "../../patterns/ObjectTile/ObjectTile.js";
|
|
91
|
+
import "../../patterns/CountryPicker/CountryPicker.js";
|
|
92
|
+
import "../../patterns/ProgressWizard/ProgressWizard.js";
|
|
93
|
+
import "../../patterns/ProgressWizard/types.js";
|
|
94
|
+
import "../../patterns/PhoneNumberInput/PhoneNumberInput.js";
|
|
95
|
+
const Lp = () => ({
|
|
96
|
+
adornment: `${p}-input__wrapper__adornment`,
|
|
97
|
+
emptyValidation: `${p}-input__empty-validation`,
|
|
98
|
+
input: `${p}-input__input`,
|
|
99
|
+
label: `${p}-input__label`,
|
|
100
|
+
labelHidden: `${p}-input__label--hidden`,
|
|
101
|
+
skeleton: `${p}-skeleton`,
|
|
102
|
+
validation: `${p}-input__validation`,
|
|
103
|
+
wrapper: `${p}-input__wrapper`,
|
|
104
|
+
wrapperInput: `${p}-input__wrapper__input`
|
|
105
|
+
});
|
|
106
|
+
export {
|
|
107
|
+
Lp as getInputClassNames
|
|
108
|
+
};
|
|
@@ -1,86 +1,87 @@
|
|
|
1
|
-
import { jsxs as
|
|
2
|
-
import * as
|
|
1
|
+
import { jsxs as m, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import * as g from "react";
|
|
3
3
|
import n from "../../node_modules/classnames/index.js";
|
|
4
|
-
import { px as e, useNormalizedInputProps as
|
|
4
|
+
import { px as e, useNormalizedInputProps as k } from "../../utils/index.js";
|
|
5
5
|
import { SelectVariants as c } from "./types.js";
|
|
6
|
-
import
|
|
7
|
-
import { TextVariants as
|
|
8
|
-
import
|
|
9
|
-
|
|
6
|
+
import z from "../Icon/Icon.js";
|
|
7
|
+
import { TextVariants as D } from "../Text/types.js";
|
|
8
|
+
import F from "../Text/Text.js";
|
|
9
|
+
import { getInputClassNames as H } from "../Input/utils.js";
|
|
10
|
+
const M = g.forwardRef(
|
|
10
11
|
({
|
|
11
|
-
children:
|
|
12
|
-
className:
|
|
13
|
-
defaultValue:
|
|
14
|
-
disabled:
|
|
15
|
-
hideLabel:
|
|
12
|
+
children: d,
|
|
13
|
+
className: s,
|
|
14
|
+
defaultValue: u,
|
|
15
|
+
disabled: $,
|
|
16
|
+
hideLabel: f,
|
|
16
17
|
id: t,
|
|
17
|
-
showIcon:
|
|
18
|
-
variant:
|
|
19
|
-
inline:
|
|
20
|
-
invalid:
|
|
18
|
+
showIcon: o = !0,
|
|
19
|
+
variant: b = c.default,
|
|
20
|
+
inline: C,
|
|
21
|
+
invalid: _,
|
|
21
22
|
invalidText: v,
|
|
22
|
-
labelText:
|
|
23
|
-
onChange:
|
|
24
|
-
onClick:
|
|
25
|
-
readOnly:
|
|
26
|
-
size:
|
|
27
|
-
value:
|
|
23
|
+
labelText: w,
|
|
24
|
+
onChange: x,
|
|
25
|
+
onClick: q,
|
|
26
|
+
readOnly: p,
|
|
27
|
+
size: N = "md",
|
|
28
|
+
value: h,
|
|
28
29
|
warn: y,
|
|
29
|
-
warnText:
|
|
30
|
-
isStandalone:
|
|
31
|
-
...
|
|
30
|
+
warnText: S,
|
|
31
|
+
isStandalone: j = !1,
|
|
32
|
+
...I
|
|
32
33
|
}, P) => {
|
|
33
|
-
const
|
|
34
|
-
disabled:
|
|
34
|
+
const i = "select", a = k({
|
|
35
|
+
disabled: $,
|
|
35
36
|
id: t,
|
|
36
|
-
invalid:
|
|
37
|
+
invalid: _,
|
|
37
38
|
invalidText: v,
|
|
38
|
-
readOnly:
|
|
39
|
-
type:
|
|
39
|
+
readOnly: p,
|
|
40
|
+
type: i,
|
|
40
41
|
warn: y,
|
|
41
|
-
warnText:
|
|
42
|
-
}), R = n(`${e}-${
|
|
43
|
-
[`${e}-input--inline`]:
|
|
44
|
-
[`${e}-input--readonly`]:
|
|
42
|
+
warnText: S
|
|
43
|
+
}), l = H(), R = n(`${e}-${i}-input`, `${e}-input`, `${e}-input--${N}`, {
|
|
44
|
+
[`${e}-input--inline`]: C,
|
|
45
|
+
[`${e}-input--readonly`]: p,
|
|
45
46
|
[`${e}-input--disabled`]: a.disabled,
|
|
46
47
|
[`${e}-input--invalid`]: a.invalid,
|
|
47
48
|
[`${e}-input--warn`]: a.warn,
|
|
48
|
-
[`${
|
|
49
|
-
[`${e}-${
|
|
50
|
-
}), T = n(
|
|
51
|
-
[`${e}-input__select--tertiary`]:
|
|
49
|
+
[`${s}__wrapper`]: s,
|
|
50
|
+
[`${e}-${i}-input__standalone`]: j
|
|
51
|
+
}), T = n(s, l.input, {
|
|
52
|
+
[`${e}-input__select--tertiary`]: b === c.tertiary
|
|
52
53
|
}), V = n(`${e}-select-container`, {
|
|
53
|
-
[`${e}-select-container--show__icon`]:
|
|
54
|
+
[`${e}-select-container--show__icon`]: o
|
|
54
55
|
});
|
|
55
|
-
return /* @__PURE__ */
|
|
56
|
-
/* @__PURE__ */
|
|
57
|
-
|
|
56
|
+
return /* @__PURE__ */ m("div", { className: R, children: [
|
|
57
|
+
/* @__PURE__ */ r(
|
|
58
|
+
F,
|
|
58
59
|
{
|
|
59
60
|
element: "label",
|
|
60
|
-
variant:
|
|
61
|
+
variant: D.labelMedium,
|
|
61
62
|
"data-testid": `${t}-label`,
|
|
62
63
|
htmlFor: t,
|
|
63
|
-
className: n(
|
|
64
|
-
children:
|
|
64
|
+
className: n(l.label, { [l.labelHidden]: f }),
|
|
65
|
+
children: w
|
|
65
66
|
}
|
|
66
67
|
),
|
|
67
|
-
/* @__PURE__ */
|
|
68
|
-
/* @__PURE__ */
|
|
68
|
+
/* @__PURE__ */ m("div", { className: V, children: [
|
|
69
|
+
/* @__PURE__ */ r(
|
|
69
70
|
"select",
|
|
70
71
|
{
|
|
71
72
|
className: T,
|
|
72
73
|
"data-testid": t,
|
|
73
|
-
defaultValue:
|
|
74
|
+
defaultValue: u,
|
|
74
75
|
disabled: a.disabled,
|
|
75
76
|
id: t,
|
|
76
|
-
onChange:
|
|
77
|
+
onChange: x,
|
|
77
78
|
ref: P,
|
|
78
|
-
value:
|
|
79
|
-
...
|
|
80
|
-
children:
|
|
79
|
+
value: h,
|
|
80
|
+
...I,
|
|
81
|
+
children: d
|
|
81
82
|
}
|
|
82
83
|
),
|
|
83
|
-
|
|
84
|
+
o ? /* @__PURE__ */ r(z, { icon: "ChevronDown" }) : null
|
|
84
85
|
] }),
|
|
85
86
|
a.validation
|
|
86
87
|
] });
|
|
@@ -1,70 +1,71 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as p, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import k from "../../components/Icon/Icon.js";
|
|
3
3
|
import { TextVariants as w } from "../../components/Text/types.js";
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import { countries as
|
|
7
|
-
import { forwardRef as
|
|
8
|
-
import { useNormalizedInputProps as
|
|
9
|
-
|
|
4
|
+
import m from "../../components/Text/Text.js";
|
|
5
|
+
import i from "../../node_modules/classnames/index.js";
|
|
6
|
+
import { countries as I } from "./constants.js";
|
|
7
|
+
import { forwardRef as P } from "react";
|
|
8
|
+
import { useNormalizedInputProps as T } from "../../utils/index.js";
|
|
9
|
+
import { getInputClassNames as N } from "../../components/Input/utils.js";
|
|
10
|
+
const V = P(
|
|
10
11
|
({
|
|
11
|
-
labelText:
|
|
12
|
-
ariaLabel:
|
|
13
|
-
displayValue:
|
|
14
|
-
onClick:
|
|
12
|
+
labelText: d,
|
|
13
|
+
ariaLabel: s = d,
|
|
14
|
+
displayValue: f,
|
|
15
|
+
onClick: _,
|
|
15
16
|
hasError: n = !1,
|
|
16
|
-
errorMsg:
|
|
17
|
+
errorMsg: u,
|
|
17
18
|
id: o,
|
|
18
|
-
className:
|
|
19
|
+
className: h,
|
|
19
20
|
baseClassName: r,
|
|
20
|
-
variantConfig:
|
|
21
|
-
},
|
|
22
|
-
const { isPhone: l, value:
|
|
21
|
+
variantConfig: $
|
|
22
|
+
}, v) => {
|
|
23
|
+
const { isPhone: l, value: a } = $, e = T({
|
|
23
24
|
id: "country-picker-trigger-input",
|
|
24
25
|
invalid: n,
|
|
25
|
-
invalidText:
|
|
26
|
+
invalidText: u,
|
|
26
27
|
type: "text"
|
|
27
|
-
}),
|
|
28
|
-
return /* @__PURE__ */
|
|
29
|
-
/* @__PURE__ */
|
|
30
|
-
|
|
28
|
+
}), c = N(), y = e.invalidId, g = l ? a : I.filter((b) => b.name === a)?.[0]?.code, x = () => e.validation ? e.validation : /* @__PURE__ */ t("p", { className: c.emptyValidation, children: " " });
|
|
29
|
+
return /* @__PURE__ */ p("div", { className: i(`${r}__trigger`, h), children: [
|
|
30
|
+
/* @__PURE__ */ t(
|
|
31
|
+
m,
|
|
31
32
|
{
|
|
32
33
|
element: "label",
|
|
33
34
|
variant: w.labelMedium,
|
|
34
|
-
className:
|
|
35
|
+
className: i(`${r}__trigger-label`, c.label, {
|
|
35
36
|
[`${r}__trigger-label--error`]: n
|
|
36
37
|
}),
|
|
37
38
|
id: o ? `${o}-label` : void 0,
|
|
38
|
-
children:
|
|
39
|
+
children: d
|
|
39
40
|
}
|
|
40
41
|
),
|
|
41
|
-
/* @__PURE__ */
|
|
42
|
+
/* @__PURE__ */ p(
|
|
42
43
|
"button",
|
|
43
44
|
{
|
|
44
|
-
ref:
|
|
45
|
+
ref: v,
|
|
45
46
|
type: "button",
|
|
46
|
-
"aria-label":
|
|
47
|
+
"aria-label": s,
|
|
47
48
|
"aria-invalid": e.invalid,
|
|
48
|
-
"aria-describedby":
|
|
49
|
-
className:
|
|
49
|
+
"aria-describedby": y,
|
|
50
|
+
className: i(`${r}__trigger-btn`, c.input, {
|
|
50
51
|
[`${r}__trigger-btn--error`]: n,
|
|
51
52
|
[`${r}__trigger-btn--is-phone`]: l
|
|
52
53
|
}),
|
|
53
|
-
onClick:
|
|
54
|
+
onClick: _,
|
|
54
55
|
"data-testid": "country-picker-trigger",
|
|
55
56
|
id: o,
|
|
56
57
|
children: [
|
|
57
|
-
|
|
58
|
+
g && /* @__PURE__ */ t("span", { className: `${r}__trigger-flag`, children: /* @__PURE__ */ t(
|
|
58
59
|
"img",
|
|
59
60
|
{
|
|
60
|
-
src: `https://flagcdn.com/h20/${
|
|
61
|
-
srcSet: `https://flagcdn.com/h40/${
|
|
62
|
-
alt: `${
|
|
61
|
+
src: `https://flagcdn.com/h20/${g.toLowerCase()}.png`,
|
|
62
|
+
srcSet: `https://flagcdn.com/h40/${g.toLowerCase()}.png 2x`,
|
|
63
|
+
alt: `${a} flag`,
|
|
63
64
|
className: `${r}__trigger-flag-img`
|
|
64
65
|
}
|
|
65
66
|
) }),
|
|
66
|
-
/* @__PURE__ */
|
|
67
|
-
/* @__PURE__ */
|
|
67
|
+
/* @__PURE__ */ t(m, { className: i(`${r}__trigger-text`), children: f }),
|
|
68
|
+
/* @__PURE__ */ t("span", { className: i(`${r}__trigger-icon`), children: /* @__PURE__ */ t(k, { icon: "ChevronDown", color: "black-100", width: 16, height: 16 }) })
|
|
68
69
|
]
|
|
69
70
|
}
|
|
70
71
|
),
|
|
@@ -72,7 +73,7 @@ const j = b(
|
|
|
72
73
|
] });
|
|
73
74
|
}
|
|
74
75
|
);
|
|
75
|
-
|
|
76
|
+
V.displayName = "CountryPickerTrigger";
|
|
76
77
|
export {
|
|
77
|
-
|
|
78
|
+
V as default
|
|
78
79
|
};
|
|
@@ -2,9 +2,9 @@ import { jsxs as p, jsx as e } from "react/jsx-runtime";
|
|
|
2
2
|
import b, { forwardRef as _ } from "react";
|
|
3
3
|
import { getCommonProps as P, px as x, useNormalizedInputProps as I } from "../../utils/index.js";
|
|
4
4
|
import $ from "../../node_modules/classnames/index.js";
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { getSafeCountryCallingCode as
|
|
5
|
+
import L from "../CountryPicker/CountryPicker.js";
|
|
6
|
+
import S from "../../components/Input/Input.js";
|
|
7
|
+
import { getSafeCountryCallingCode as T } from "../CountryPicker/utils.js";
|
|
8
8
|
import { countries as j } from "../CountryPicker/constants.js";
|
|
9
9
|
const k = _(
|
|
10
10
|
({
|
|
@@ -41,11 +41,11 @@ const k = _(
|
|
|
41
41
|
}
|
|
42
42
|
),
|
|
43
43
|
/* @__PURE__ */ e(
|
|
44
|
-
|
|
44
|
+
L,
|
|
45
45
|
{
|
|
46
46
|
triggerLabelText: n,
|
|
47
47
|
triggerAriaLabel: `${n.replace("*", "")} country`,
|
|
48
|
-
triggerDisplayValue: i ? `+${
|
|
48
|
+
triggerDisplayValue: i ? `+${T(i.code)}` : "",
|
|
49
49
|
hasTriggerError: !!a,
|
|
50
50
|
modalTitle: "Country code",
|
|
51
51
|
searchInputLabel: "Search country",
|
|
@@ -58,7 +58,7 @@ const k = _(
|
|
|
58
58
|
)
|
|
59
59
|
] }),
|
|
60
60
|
/* @__PURE__ */ e("div", { className: `${t}__input`, children: /* @__PURE__ */ e(
|
|
61
|
-
|
|
61
|
+
S,
|
|
62
62
|
{
|
|
63
63
|
className: `${t}__input-phone`,
|
|
64
64
|
id: "phone-input",
|
|
@@ -71,7 +71,8 @@ const k = _(
|
|
|
71
71
|
invalid: !!a,
|
|
72
72
|
disabled: y,
|
|
73
73
|
invalidText: "",
|
|
74
|
-
"aria-describedby": r.invalidId
|
|
74
|
+
"aria-describedby": r.invalidId,
|
|
75
|
+
maxLength: 25
|
|
75
76
|
}
|
|
76
77
|
) })
|
|
77
78
|
] }),
|
|
@@ -7,8 +7,8 @@
|
|
|
7
7
|
width: 100%;
|
|
8
8
|
|
|
9
9
|
&-label {
|
|
10
|
-
font-variation-settings: 'wght' 600;
|
|
11
10
|
margin-bottom: $spacing-xsm;
|
|
11
|
+
white-space: nowrap;
|
|
12
12
|
|
|
13
13
|
&--error {
|
|
14
14
|
color: $error-red;
|
|
@@ -16,6 +16,8 @@
|
|
|
16
16
|
}
|
|
17
17
|
|
|
18
18
|
&-btn {
|
|
19
|
+
@include text($bodyMedium);
|
|
20
|
+
|
|
19
21
|
align-items: center;
|
|
20
22
|
appearance: none;
|
|
21
23
|
background: $white;
|
|
@@ -46,6 +48,8 @@
|
|
|
46
48
|
&-text {
|
|
47
49
|
flex: 1;
|
|
48
50
|
font-variation-settings: 'wght' 600;
|
|
51
|
+
margin-left: $spacing-xsm;
|
|
52
|
+
margin-right: $spacing-xsm;
|
|
49
53
|
overflow: hidden;
|
|
50
54
|
text-align: left;
|
|
51
55
|
text-overflow: ellipsis;
|
|
@@ -55,17 +59,11 @@
|
|
|
55
59
|
&-icon {
|
|
56
60
|
align-items: center;
|
|
57
61
|
display: flex;
|
|
58
|
-
margin-left: $spacing-sm;
|
|
59
|
-
|
|
60
|
-
@media (min-width: $breakpoint-md) {
|
|
61
|
-
height: 1.25rem;
|
|
62
|
-
width: 1.25rem;
|
|
63
|
-
}
|
|
64
62
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
63
|
+
// 1.4em matches the line-height from body-styles mixin, ensuring icon scales with font-size at different breakpoints
|
|
64
|
+
// This keeps the trigger button height aligned with the Input component across all screen sizes
|
|
65
|
+
height: 1.4em;
|
|
66
|
+
width: 1.4em;
|
|
69
67
|
}
|
|
70
68
|
|
|
71
69
|
&-flag {
|
|
@@ -73,7 +71,6 @@
|
|
|
73
71
|
display: flex;
|
|
74
72
|
height: 1rem;
|
|
75
73
|
justify-content: center;
|
|
76
|
-
margin-right: $spacing-sm;
|
|
77
74
|
overflow: hidden;
|
|
78
75
|
width: 1.5rem;
|
|
79
76
|
|
|
@@ -1,13 +1,28 @@
|
|
|
1
1
|
@use '../../allPartials' as *;
|
|
2
2
|
|
|
3
3
|
.#{$px}-filter-button {
|
|
4
|
-
border:
|
|
4
|
+
border: 1px solid $bg-border;
|
|
5
5
|
gap: 4px;
|
|
6
6
|
height: inherit;
|
|
7
7
|
padding: $spacing-xsm $spacing-sm;
|
|
8
8
|
|
|
9
|
+
&:hover {
|
|
10
|
+
border: 1px solid $black-100;
|
|
11
|
+
box-shadow: none;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
&:focus-visible {
|
|
15
|
+
box-shadow: 0 0 0 0.5px $bg-border;
|
|
16
|
+
outline: none;
|
|
17
|
+
}
|
|
18
|
+
|
|
9
19
|
&--selected {
|
|
10
|
-
border:
|
|
20
|
+
border: 1px solid $black-100;
|
|
21
|
+
|
|
22
|
+
&:focus-visible {
|
|
23
|
+
box-shadow: 0 0 0 0.5px $black-100;
|
|
24
|
+
outline: none;
|
|
25
|
+
}
|
|
11
26
|
}
|
|
12
27
|
|
|
13
28
|
&--filter {
|
|
@@ -15,18 +15,12 @@
|
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
&__country-picker {
|
|
18
|
-
flex: 0 0
|
|
19
|
-
margin-right: $spacing-xsm;
|
|
20
|
-
min-width: 150px; // just big enough for flag and 3 digit code
|
|
18
|
+
flex: 0 0 30%;
|
|
21
19
|
}
|
|
22
20
|
|
|
23
21
|
&__input {
|
|
24
|
-
flex: 1 1
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
&-phone {
|
|
28
|
-
margin-bottom: 0;
|
|
29
|
-
}
|
|
22
|
+
flex: 1 1 70%;
|
|
23
|
+
min-width: 0; // ensures input shrinks properly in flex container, 0 prevents overflow and lets flex-basis do its thing
|
|
30
24
|
|
|
31
25
|
// Hide input validation inside phone number input, we use a shared one
|
|
32
26
|
.#{$px}-input__validation {
|
|
@@ -39,17 +33,13 @@
|
|
|
39
33
|
}
|
|
40
34
|
|
|
41
35
|
@media screen and (min-width: $breakpoint-xl) {
|
|
42
|
-
&__wrapper {
|
|
43
|
-
align-items: center;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
36
|
&__country-picker {
|
|
47
|
-
flex: 0 0
|
|
37
|
+
flex: 0 0 37.5%;
|
|
48
38
|
min-width: 0;
|
|
49
39
|
}
|
|
50
40
|
|
|
51
41
|
&__input {
|
|
52
|
-
flex: 1 1
|
|
42
|
+
flex: 1 1 62.5%;
|
|
53
43
|
min-width: 0;
|
|
54
44
|
}
|
|
55
45
|
}
|