@phillips/seldon 1.210.1 → 1.210.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/Countdown/Countdown.stories.d.ts +13 -1
- package/dist/components/Text/Text.stories.d.ts +5 -0
- package/dist/patterns/CountryPicker/CountryPicker.stories.d.ts +4 -0
- package/dist/patterns/CountryPicker/CountryPickerModal.stories.d.ts +16 -0
- package/dist/patterns/CountryPicker/CountryPickerOption.js +26 -25
- package/dist/patterns/CountryPicker/CountryPickerTrigger.js +16 -15
- package/dist/scss/patterns/CountryPicker/_countryPickerOption.scss +16 -1
- package/dist/scss/patterns/CountryPicker/_countryPickerTrigger.scss +16 -0
- package/package.json +1 -1
|
@@ -39,7 +39,14 @@ export declare const Seconds: {
|
|
|
39
39
|
};
|
|
40
40
|
};
|
|
41
41
|
};
|
|
42
|
-
export declare const Compact:
|
|
42
|
+
export declare const Compact: {
|
|
43
|
+
(props: CountdownProps): import("react/jsx-runtime").JSX.Element;
|
|
44
|
+
parameters: {
|
|
45
|
+
chromatic: {
|
|
46
|
+
disableSnapshot: boolean;
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
};
|
|
43
50
|
export declare const ClosingCountdown: {
|
|
44
51
|
(props: CountdownProps): import("react/jsx-runtime").JSX.Element;
|
|
45
52
|
argTypes: {
|
|
@@ -48,4 +55,9 @@ export declare const ClosingCountdown: {
|
|
|
48
55
|
options: CountdownVariants[];
|
|
49
56
|
};
|
|
50
57
|
};
|
|
58
|
+
parameters: {
|
|
59
|
+
chromatic: {
|
|
60
|
+
disableSnapshot: boolean;
|
|
61
|
+
};
|
|
62
|
+
};
|
|
51
63
|
};
|
|
@@ -12,3 +12,7 @@ export declare const Playground: {
|
|
|
12
12
|
};
|
|
13
13
|
};
|
|
14
14
|
export declare const CountryPhoneCodePicker: (props: CountryPickerProps) => import("react/jsx-runtime").JSX.Element;
|
|
15
|
+
export declare const PreSelectedCountry: {
|
|
16
|
+
(): import("react/jsx-runtime").JSX.Element;
|
|
17
|
+
storyName: string;
|
|
18
|
+
};
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { Meta } from '@storybook/react';
|
|
2
|
+
import { default as CountryPickerModal, CountryPickerModalProps } from './CountryPickerModal';
|
|
3
|
+
import { ModalBaseProps } from './types';
|
|
4
|
+
declare const meta: Meta<typeof CountryPickerModal>;
|
|
5
|
+
export default meta;
|
|
6
|
+
export declare const DefaultOpen: {
|
|
7
|
+
(props: ModalBaseProps & CountryPickerModalProps): import("react/jsx-runtime").JSX.Element;
|
|
8
|
+
args: {
|
|
9
|
+
modalTitle: string;
|
|
10
|
+
searchInputLabel: string;
|
|
11
|
+
searchInputPlaceholder: string;
|
|
12
|
+
selectButtonLabel: string;
|
|
13
|
+
baseClassName: string;
|
|
14
|
+
isOpen: boolean;
|
|
15
|
+
};
|
|
16
|
+
};
|
|
@@ -1,36 +1,36 @@
|
|
|
1
|
-
import { jsxs as _, jsx as
|
|
1
|
+
import { jsxs as _, jsx as r } from "react/jsx-runtime";
|
|
2
2
|
import $ from "../../components/Text/Text.js";
|
|
3
|
-
import { TextVariants as
|
|
4
|
-
import
|
|
5
|
-
import { getSafeCountryCallingCode as
|
|
6
|
-
const
|
|
3
|
+
import { TextVariants as g } from "../../components/Text/types.js";
|
|
4
|
+
import d from "../../node_modules/classnames/index.js";
|
|
5
|
+
import { getSafeCountryCallingCode as h } from "./utils.js";
|
|
6
|
+
const y = ({
|
|
7
7
|
code: t,
|
|
8
8
|
name: n,
|
|
9
|
-
isChecked:
|
|
10
|
-
inputName:
|
|
9
|
+
isChecked: p,
|
|
10
|
+
inputName: e,
|
|
11
11
|
baseClassName: o,
|
|
12
|
-
variantConfig:
|
|
12
|
+
variantConfig: f
|
|
13
13
|
}) => {
|
|
14
|
-
const c = `${o}__radio-${t}`, { isPhone: i, onChange: l } =
|
|
14
|
+
const c = `${o}__radio-${t}`, { isPhone: i, onChange: l } = f;
|
|
15
15
|
return /* @__PURE__ */ _(
|
|
16
16
|
"label",
|
|
17
17
|
{
|
|
18
18
|
htmlFor: c,
|
|
19
|
-
className:
|
|
20
|
-
[`${o}__option--selected`]:
|
|
19
|
+
className: d(`${o}__option`, {
|
|
20
|
+
[`${o}__option--selected`]: p,
|
|
21
21
|
[`${o}__option--is-phone`]: i
|
|
22
22
|
}),
|
|
23
|
-
"aria-label": i ? `${n} +${
|
|
23
|
+
"aria-label": i ? `${n} +${h(t)}` : n,
|
|
24
24
|
children: [
|
|
25
|
-
/* @__PURE__ */
|
|
25
|
+
/* @__PURE__ */ r(
|
|
26
26
|
"input",
|
|
27
27
|
{
|
|
28
28
|
type: "radio",
|
|
29
29
|
id: c,
|
|
30
|
-
name:
|
|
31
|
-
checked:
|
|
32
|
-
className:
|
|
33
|
-
[`${o}__radio--selected`]:
|
|
30
|
+
name: e,
|
|
31
|
+
checked: p,
|
|
32
|
+
className: d(`${o}__radio`, {
|
|
33
|
+
[`${o}__radio--selected`]: p,
|
|
34
34
|
[`${o}__radio--visually-hidden`]: i
|
|
35
35
|
}),
|
|
36
36
|
onChange: () => {
|
|
@@ -39,24 +39,25 @@ const v = ({
|
|
|
39
39
|
}
|
|
40
40
|
),
|
|
41
41
|
/* @__PURE__ */ _("span", { className: `${o}__option-content`, children: [
|
|
42
|
-
/* @__PURE__ */
|
|
43
|
-
i && /* @__PURE__ */ _($, { variant:
|
|
42
|
+
/* @__PURE__ */ r($, { variant: g.string2, className: `${o}__option-name`, children: n }),
|
|
43
|
+
i && /* @__PURE__ */ _($, { variant: g.string2, className: `${o}__option-code`, children: [
|
|
44
44
|
"+",
|
|
45
|
-
|
|
45
|
+
h(t)
|
|
46
46
|
] })
|
|
47
47
|
] }),
|
|
48
|
-
/* @__PURE__ */
|
|
48
|
+
/* @__PURE__ */ r("span", { className: `${o}__option-flag`, children: /* @__PURE__ */ r(
|
|
49
49
|
"img",
|
|
50
50
|
{
|
|
51
|
-
src: `https://flagcdn.com/
|
|
51
|
+
src: `https://flagcdn.com/h20/${t.toLowerCase()}.png`,
|
|
52
|
+
srcSet: `https://flagcdn.com/h40/${t.toLowerCase()}.png 2x`,
|
|
52
53
|
alt: `${n} flag`,
|
|
53
|
-
className: `${o}__option-flag`
|
|
54
|
+
className: `${o}__option-flag-img`
|
|
54
55
|
}
|
|
55
|
-
)
|
|
56
|
+
) })
|
|
56
57
|
]
|
|
57
58
|
}
|
|
58
59
|
);
|
|
59
60
|
};
|
|
60
61
|
export {
|
|
61
|
-
|
|
62
|
+
y as CountryPickerOption
|
|
62
63
|
};
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { jsxs as d, jsx as i } from "react/jsx-runtime";
|
|
2
2
|
import y from "../../components/Icon/Icon.js";
|
|
3
3
|
import { TextVariants as k } from "../../components/Text/types.js";
|
|
4
|
-
import
|
|
4
|
+
import w from "../../components/Text/Text.js";
|
|
5
5
|
import t from "../../node_modules/classnames/index.js";
|
|
6
|
-
import { countries as
|
|
6
|
+
import { countries as P } from "./constants.js";
|
|
7
7
|
import { forwardRef as I } from "react";
|
|
8
8
|
import { useNormalizedInputProps as T, px as b } from "../../utils/index.js";
|
|
9
9
|
const j = I(
|
|
@@ -17,17 +17,17 @@ const j = I(
|
|
|
17
17
|
id: e,
|
|
18
18
|
className: f,
|
|
19
19
|
baseClassName: r,
|
|
20
|
-
variantConfig:
|
|
21
|
-
},
|
|
22
|
-
const { isPhone:
|
|
20
|
+
variantConfig: h
|
|
21
|
+
}, u) => {
|
|
22
|
+
const { isPhone: c, value: a } = h, n = T({
|
|
23
23
|
id: "country-picker-trigger-input",
|
|
24
24
|
invalid: o,
|
|
25
25
|
invalidText: s,
|
|
26
26
|
type: "text"
|
|
27
|
-
}), $ = n.invalidId, g =
|
|
27
|
+
}), $ = n.invalidId, g = c ? a : P.filter((x) => x.name === a)?.[0]?.code, v = () => n.validation ? n.validation : /* @__PURE__ */ i("p", { className: `${b}-input__validation`, children: " " });
|
|
28
28
|
return /* @__PURE__ */ d("div", { className: t(`${r}__trigger`, f), children: [
|
|
29
29
|
/* @__PURE__ */ i(
|
|
30
|
-
|
|
30
|
+
w,
|
|
31
31
|
{
|
|
32
32
|
variant: k.string2,
|
|
33
33
|
className: t(`${r}__trigger-label`, {
|
|
@@ -40,33 +40,34 @@ const j = I(
|
|
|
40
40
|
/* @__PURE__ */ d(
|
|
41
41
|
"button",
|
|
42
42
|
{
|
|
43
|
-
ref:
|
|
43
|
+
ref: u,
|
|
44
44
|
type: "button",
|
|
45
45
|
"aria-label": p,
|
|
46
46
|
"aria-invalid": n.invalid,
|
|
47
47
|
"aria-describedby": $,
|
|
48
48
|
className: t(`${r}__trigger-btn`, {
|
|
49
49
|
[`${r}__trigger-btn--error`]: o,
|
|
50
|
-
[`${r}__trigger-btn--is-phone`]:
|
|
50
|
+
[`${r}__trigger-btn--is-phone`]: c
|
|
51
51
|
}),
|
|
52
52
|
onClick: _,
|
|
53
53
|
"data-testid": "country-picker-trigger",
|
|
54
54
|
id: e,
|
|
55
55
|
children: [
|
|
56
|
-
g && /* @__PURE__ */ i(
|
|
56
|
+
g && /* @__PURE__ */ i("span", { className: `${r}__trigger-flag`, children: /* @__PURE__ */ i(
|
|
57
57
|
"img",
|
|
58
58
|
{
|
|
59
|
-
src: `https://flagcdn.com/
|
|
60
|
-
|
|
61
|
-
|
|
59
|
+
src: `https://flagcdn.com/h20/${g.toLowerCase()}.png`,
|
|
60
|
+
srcSet: `https://flagcdn.com/h40/${g.toLowerCase()}.png 2x`,
|
|
61
|
+
alt: `${a} flag`,
|
|
62
|
+
className: `${r}__trigger-flag-img`
|
|
62
63
|
}
|
|
63
|
-
),
|
|
64
|
+
) }),
|
|
64
65
|
/* @__PURE__ */ i("span", { className: t(`${r}__trigger-text`), children: m }),
|
|
65
66
|
/* @__PURE__ */ i("span", { className: t(`${r}__trigger-icon`), children: /* @__PURE__ */ i(y, { icon: "ChevronDown", color: "black-100", width: 16, height: 16 }) })
|
|
66
67
|
]
|
|
67
68
|
}
|
|
68
69
|
),
|
|
69
|
-
!
|
|
70
|
+
!c && v()
|
|
70
71
|
] });
|
|
71
72
|
}
|
|
72
73
|
);
|
|
@@ -39,9 +39,24 @@
|
|
|
39
39
|
}
|
|
40
40
|
|
|
41
41
|
&-flag {
|
|
42
|
+
align-items: center;
|
|
43
|
+
display: flex;
|
|
42
44
|
height: 1rem;
|
|
45
|
+
justify-content: center;
|
|
43
46
|
margin-right: $spacing-sm;
|
|
44
|
-
|
|
47
|
+
overflow: hidden;
|
|
48
|
+
width: 1.5rem;
|
|
49
|
+
|
|
50
|
+
@media (min-width: $breakpoint-md) {
|
|
51
|
+
height: 1.25rem;
|
|
52
|
+
width: 1.75rem;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
&-img {
|
|
56
|
+
display: block;
|
|
57
|
+
height: 100%;
|
|
58
|
+
width: auto;
|
|
59
|
+
}
|
|
45
60
|
}
|
|
46
61
|
}
|
|
47
62
|
.#{$px}-country-picker__radio {
|
|
@@ -74,8 +74,24 @@
|
|
|
74
74
|
}
|
|
75
75
|
|
|
76
76
|
&-flag {
|
|
77
|
+
align-items: center;
|
|
78
|
+
display: flex;
|
|
77
79
|
height: 1rem;
|
|
80
|
+
justify-content: center;
|
|
78
81
|
margin-right: $spacing-sm;
|
|
82
|
+
overflow: hidden;
|
|
83
|
+
width: 1.5rem;
|
|
84
|
+
|
|
85
|
+
@media (min-width: $breakpoint-md) {
|
|
86
|
+
height: 1.25rem;
|
|
87
|
+
width: 1.75rem;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
&-img {
|
|
91
|
+
display: block;
|
|
92
|
+
height: 100%;
|
|
93
|
+
width: auto;
|
|
94
|
+
}
|
|
79
95
|
}
|
|
80
96
|
}
|
|
81
97
|
}
|