@phillips/seldon 1.189.0 → 1.191.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/Carousel/Carousel.d.ts +0 -4
- package/dist/components/Carousel/Carousel.js +63 -57
- package/dist/components/Carousel/Carousel.stories.d.ts +0 -1
- package/dist/components/Carousel/CarouselArrows.js +31 -19
- package/dist/index.d.ts +1 -0
- package/dist/index.js +43 -41
- package/dist/patterns/CountryPicker/CountryPickerModal.js +41 -42
- package/dist/patterns/CountryPicker/CountryPickerTrigger.js +10 -18
- package/dist/patterns/PhoneNumberInput/PhoneNumberInput.d.ts +51 -0
- package/dist/patterns/PhoneNumberInput/PhoneNumberInput.js +79 -0
- package/dist/patterns/PhoneNumberInput/PhoneNumberInput.stories.d.ts +49 -0
- package/dist/patterns/PhoneNumberInput/PhoneNumberInput.test.d.ts +1 -0
- package/dist/patterns/PhoneNumberInput/index.d.ts +1 -0
- package/dist/patterns/PhoneNumberInput/types.d.ts +2 -0
- package/dist/scss/_vars.scss +1 -1
- package/dist/scss/_vars.scss.js +1 -1
- package/dist/scss/componentStyles.scss +1 -0
- package/dist/scss/patterns/CountryPicker/_countryPickerModal.scss +0 -12
- package/dist/scss/patterns/CountryPicker/_countryPickerTrigger.scss +30 -10
- package/dist/scss/patterns/PhoneNumberInput/_phoneNumberInput.scss +68 -0
- package/package.json +2 -1
|
@@ -35,10 +35,6 @@ export interface CarouselProps extends ComponentProps<'div'> {
|
|
|
35
35
|
* The threshold for slides to be considered in view. A value of 0.1 means that 10% of the slide must be in view for it to be considered in view.
|
|
36
36
|
*/
|
|
37
37
|
inViewThreshold?: number;
|
|
38
|
-
/**
|
|
39
|
-
* The number of slides to scroll at once.
|
|
40
|
-
*/
|
|
41
|
-
slidesToScroll?: number;
|
|
42
38
|
}
|
|
43
39
|
type CarouselContextProps = {
|
|
44
40
|
carouselRef: ReturnType<typeof useEmblaCarousel>[0];
|
|
@@ -1,28 +1,27 @@
|
|
|
1
1
|
import { jsx as c } from "react/jsx-runtime";
|
|
2
|
-
import { createContext as
|
|
3
|
-
import { getCommonProps as
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { WheelGesturesPlugin as
|
|
8
|
-
const
|
|
2
|
+
import { createContext as P, forwardRef as I, useEffect as f, useCallback as m } from "react";
|
|
3
|
+
import { getCommonProps as E } from "../../utils/index.js";
|
|
4
|
+
import y from "../../node_modules/classnames/index.js";
|
|
5
|
+
import S from "../../node_modules/embla-carousel-class-names/esm/embla-carousel-class-names.esm.js";
|
|
6
|
+
import V from "../../node_modules/embla-carousel-react/esm/embla-carousel-react.esm.js";
|
|
7
|
+
import { WheelGesturesPlugin as A } from "../../node_modules/embla-carousel-wheel-gestures/dist/embla-carousel-wheel-gestures.esm.js";
|
|
8
|
+
const R = P(null), K = I(
|
|
9
9
|
({
|
|
10
|
-
loop:
|
|
11
|
-
startIndex:
|
|
12
|
-
onSlideChange:
|
|
10
|
+
loop: u = !1,
|
|
11
|
+
startIndex: d = 0,
|
|
12
|
+
onSlideChange: o,
|
|
13
13
|
className: p,
|
|
14
|
-
children:
|
|
15
|
-
columnGap:
|
|
16
|
-
useWheelGestures:
|
|
17
|
-
disableDrag:
|
|
18
|
-
disableNavigationDrag:
|
|
19
|
-
inViewThreshold:
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
const { className: C, ...b } = y(t, "Carousel");
|
|
14
|
+
children: w,
|
|
15
|
+
columnGap: x,
|
|
16
|
+
useWheelGestures: N = !1,
|
|
17
|
+
disableDrag: i = !1,
|
|
18
|
+
disableNavigationDrag: v = null,
|
|
19
|
+
inViewThreshold: b = 0.99,
|
|
20
|
+
...n
|
|
21
|
+
}, h) => {
|
|
22
|
+
const { className: g, ...k } = E(n, "Carousel");
|
|
24
23
|
let s = {};
|
|
25
|
-
switch (
|
|
24
|
+
switch (v) {
|
|
26
25
|
case "mobile":
|
|
27
26
|
s = { breakpoints: { "(max-width: 960px)": { watchDrag: !1 } } };
|
|
28
27
|
break;
|
|
@@ -35,75 +34,82 @@ const E = g(null), K = I(
|
|
|
35
34
|
default:
|
|
36
35
|
s = {};
|
|
37
36
|
}
|
|
38
|
-
const [
|
|
37
|
+
const [C, e] = V(
|
|
39
38
|
{
|
|
40
|
-
loop:
|
|
41
|
-
startIndex:
|
|
42
|
-
inViewThreshold:
|
|
43
|
-
...s
|
|
44
|
-
slidesToScroll: k
|
|
39
|
+
loop: u,
|
|
40
|
+
startIndex: d,
|
|
41
|
+
inViewThreshold: b,
|
|
42
|
+
...s
|
|
45
43
|
},
|
|
46
44
|
[
|
|
47
|
-
...
|
|
48
|
-
|
|
45
|
+
...N ? [
|
|
46
|
+
A({
|
|
49
47
|
forceWheelAxis: "x"
|
|
50
48
|
})
|
|
51
49
|
] : [],
|
|
52
|
-
|
|
50
|
+
S({
|
|
53
51
|
snapped: "carousel-item-in-view"
|
|
54
52
|
})
|
|
55
53
|
]
|
|
56
54
|
);
|
|
57
|
-
|
|
58
|
-
|
|
55
|
+
f(() => {
|
|
56
|
+
i ? e?.reInit({
|
|
59
57
|
watchDrag: () => !1
|
|
60
58
|
}) : e?.reInit({
|
|
61
59
|
watchDrag: () => !0
|
|
62
60
|
});
|
|
63
|
-
}, [
|
|
64
|
-
const
|
|
65
|
-
(
|
|
66
|
-
|
|
61
|
+
}, [i, e]);
|
|
62
|
+
const D = m(
|
|
63
|
+
(l) => {
|
|
64
|
+
if (l.key === "ArrowLeft") {
|
|
65
|
+
l.preventDefault(), e?.scrollPrev();
|
|
66
|
+
const r = e?.slideNodes().filter((t) => t === document.activeElement)[0]?.previousElementSibling;
|
|
67
|
+
r && r?.focus();
|
|
68
|
+
} else if (l.key === "ArrowRight") {
|
|
69
|
+
l.preventDefault(), e?.scrollNext();
|
|
70
|
+
const r = e?.slideNodes().filter((t) => t === document.activeElement)[0]?.nextElementSibling;
|
|
71
|
+
r && r?.focus();
|
|
72
|
+
}
|
|
67
73
|
},
|
|
68
74
|
[e]
|
|
69
|
-
),
|
|
70
|
-
(
|
|
71
|
-
if (!
|
|
75
|
+
), a = m(
|
|
76
|
+
(l) => {
|
|
77
|
+
if (!l)
|
|
72
78
|
return;
|
|
73
|
-
const
|
|
74
|
-
|
|
79
|
+
const r = l.slidesInView()?.[0];
|
|
80
|
+
r !== void 0 && o?.(r);
|
|
75
81
|
},
|
|
76
|
-
[
|
|
82
|
+
[o]
|
|
77
83
|
);
|
|
78
|
-
return
|
|
84
|
+
return f(() => {
|
|
79
85
|
if (e)
|
|
80
|
-
return e.on("slidesInView",
|
|
81
|
-
e.off("slidesInView",
|
|
86
|
+
return e.on("slidesInView", a), () => {
|
|
87
|
+
e.off("slidesInView", a);
|
|
82
88
|
};
|
|
83
|
-
}, [e,
|
|
84
|
-
|
|
89
|
+
}, [e, a]), /* @__PURE__ */ c(
|
|
90
|
+
R.Provider,
|
|
85
91
|
{
|
|
86
92
|
value: {
|
|
87
|
-
carouselRef:
|
|
93
|
+
carouselRef: C,
|
|
88
94
|
api: e,
|
|
89
95
|
scrollPrev: () => e?.scrollPrev(),
|
|
90
96
|
scrollNext: () => e?.scrollNext(),
|
|
91
97
|
canScrollPrev: e?.canScrollPrev() ?? !1,
|
|
92
98
|
canScrollNext: e?.canScrollNext() ?? !1,
|
|
93
|
-
columnGap:
|
|
94
|
-
onSlideChange:
|
|
99
|
+
columnGap: x,
|
|
100
|
+
onSlideChange: o
|
|
95
101
|
},
|
|
96
102
|
children: /* @__PURE__ */ c(
|
|
97
103
|
"div",
|
|
98
104
|
{
|
|
99
|
-
ref:
|
|
100
|
-
onKeyDownCapture:
|
|
101
|
-
className:
|
|
105
|
+
ref: h,
|
|
106
|
+
onKeyDownCapture: D,
|
|
107
|
+
className: y(g, p),
|
|
102
108
|
role: "region",
|
|
103
109
|
"aria-roledescription": "carousel",
|
|
104
|
-
...
|
|
105
|
-
...
|
|
106
|
-
children:
|
|
110
|
+
...n,
|
|
111
|
+
...k,
|
|
112
|
+
children: w
|
|
107
113
|
}
|
|
108
114
|
)
|
|
109
115
|
}
|
|
@@ -112,6 +118,6 @@ const E = g(null), K = I(
|
|
|
112
118
|
);
|
|
113
119
|
K.displayName = "Carousel";
|
|
114
120
|
export {
|
|
115
|
-
|
|
121
|
+
R as CarouselContext,
|
|
116
122
|
K as default
|
|
117
123
|
};
|
|
@@ -1,31 +1,43 @@
|
|
|
1
|
-
import { jsxs as
|
|
1
|
+
import { jsxs as h, jsx as s } from "react/jsx-runtime";
|
|
2
2
|
import u from "../../node_modules/classnames/index.js";
|
|
3
|
-
import { forwardRef as
|
|
4
|
-
import { getCommonProps as
|
|
5
|
-
import { useCarousel as
|
|
6
|
-
import
|
|
7
|
-
const
|
|
8
|
-
const { className:
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
3
|
+
import { forwardRef as f, useCallback as n } from "react";
|
|
4
|
+
import { getCommonProps as p } from "../../utils/index.js";
|
|
5
|
+
import { useCarousel as C } from "./utils.js";
|
|
6
|
+
import t from "../Icon/Icon.js";
|
|
7
|
+
const v = f(({ className: l, ...i }, a) => {
|
|
8
|
+
const { className: r, ...c } = p(i, "CarouselArrows"), { api: e } = C(), m = n(() => {
|
|
9
|
+
if (e)
|
|
10
|
+
if (e?.slidesInView().length <= 1)
|
|
11
|
+
e.scrollPrev(!0);
|
|
12
|
+
else {
|
|
13
|
+
const o = e?.slidesInView();
|
|
14
|
+
e?.scrollTo(Math.max(0, o[0] - (o.length ?? 1)));
|
|
15
|
+
}
|
|
16
|
+
}, [e]), d = n(() => {
|
|
17
|
+
if (e)
|
|
18
|
+
if (e?.slidesInView().length <= 1)
|
|
19
|
+
e?.scrollNext(!0);
|
|
20
|
+
else {
|
|
21
|
+
const w = (e?.slidesInView()).slice(-1)[0] + 1;
|
|
22
|
+
e?.scrollTo(w);
|
|
23
|
+
}
|
|
24
|
+
}, [e]);
|
|
25
|
+
return /* @__PURE__ */ h(
|
|
14
26
|
"div",
|
|
15
27
|
{
|
|
16
|
-
ref:
|
|
28
|
+
ref: a,
|
|
17
29
|
"aria-roledescription": "carousel-arrow-navigation",
|
|
18
|
-
className: u(`${
|
|
19
|
-
...
|
|
30
|
+
className: u(`${r}`, l),
|
|
31
|
+
...i,
|
|
20
32
|
...c,
|
|
21
33
|
children: [
|
|
22
|
-
/* @__PURE__ */
|
|
23
|
-
/* @__PURE__ */
|
|
34
|
+
/* @__PURE__ */ s("button", { "data-testid": "prev-arrow", className: `${r}-prev-btn`, onClick: () => m(), children: /* @__PURE__ */ s("div", { className: `${r}-prev-btn__icon`, children: /* @__PURE__ */ s(t, { icon: "ChevronLeft", height: "2rem" }) }) }),
|
|
35
|
+
/* @__PURE__ */ s("button", { "data-testid": "next-arrow", className: `${r}-next-btn`, onClick: () => d(), children: /* @__PURE__ */ s("div", { className: `${r}-next-btn__icon`, children: /* @__PURE__ */ s(t, { icon: "ChevronRight", height: "2rem" }) }) })
|
|
24
36
|
]
|
|
25
37
|
}
|
|
26
38
|
);
|
|
27
39
|
});
|
|
28
|
-
|
|
40
|
+
v.displayName = "CarouselArrows";
|
|
29
41
|
export {
|
|
30
|
-
|
|
42
|
+
v as default
|
|
31
43
|
};
|
package/dist/index.d.ts
CHANGED
package/dist/index.js
CHANGED
|
@@ -2,11 +2,11 @@ import { PaddingTokens as a, SpacingTokens as f, defaultYear as s, emailValidati
|
|
|
2
2
|
import { default as C } from "./pages/Page.js";
|
|
3
3
|
import { SSRMediaQuery as B, ssrMediaQueryStyle as P } from "./providers/SeldonProvider/utils.js";
|
|
4
4
|
import { usePendingState as A } from "./utils/hooks.js";
|
|
5
|
-
import { AuctionStatus as
|
|
6
|
-
import { default as
|
|
5
|
+
import { AuctionStatus as b, LotStatus as V, SupportedLanguages as y } from "./types/commonTypes.js";
|
|
6
|
+
import { default as k } from "./components/Button/Button.js";
|
|
7
7
|
import { ButtonVariants as w } from "./components/Button/types.js";
|
|
8
8
|
import { default as F } from "./components/IconButton/IconButton.js";
|
|
9
|
-
import { default as
|
|
9
|
+
import { default as H } from "./components/Accordion/Accordion.js";
|
|
10
10
|
import { default as E } from "./components/Accordion/AccordionItem.js";
|
|
11
11
|
import { AccordionItemVariant as R, AccordionVariants as U } from "./components/Accordion/types.js";
|
|
12
12
|
import { default as Q } from "./components/Breadcrumb/Breadcrumb.js";
|
|
@@ -30,12 +30,12 @@ import { default as Ce } from "./components/ErrorBoundary/ErrorBoundary.js";
|
|
|
30
30
|
import { default as Be } from "./components/Grid/Grid.js";
|
|
31
31
|
import { default as Ie } from "./components/GridItem/GridItem.js";
|
|
32
32
|
import { GridItemAlign as Le } from "./components/GridItem/types.js";
|
|
33
|
-
import { default as
|
|
34
|
-
import { default as
|
|
35
|
-
import { LinkVariants as
|
|
33
|
+
import { default as Ve } from "./components/Input/Input.js";
|
|
34
|
+
import { default as he } from "./components/Link/Link.js";
|
|
35
|
+
import { LinkVariants as ve } from "./components/Link/types.js";
|
|
36
36
|
import { default as De } from "./components/LinkBlock/LinkBlock.js";
|
|
37
|
-
import { default as
|
|
38
|
-
import { default as
|
|
37
|
+
import { default as Ne } from "./components/LinkList/LinkList.js";
|
|
38
|
+
import { default as Me } from "./components/Modal/Modal.js";
|
|
39
39
|
import { default as Ge } from "./components/Navigation/Navigation.js";
|
|
40
40
|
import { default as Ue } from "./components/Navigation/NavigationItem/NavigationItem.js";
|
|
41
41
|
import { default as Qe } from "./components/Navigation/NavigationItemTrigger/NavigationItemTrigger.js";
|
|
@@ -56,12 +56,12 @@ import { default as Ct } from "./components/Text/Text.js";
|
|
|
56
56
|
import { TextSymbolVariants as Bt } from "./components/TextSymbol/types.js";
|
|
57
57
|
import { default as It } from "./components/TextSymbol/TextSymbol.js";
|
|
58
58
|
import { default as Lt } from "./components/Video/Video.js";
|
|
59
|
-
import { default as
|
|
60
|
-
import { DetailListAlignment as
|
|
61
|
-
import { default as
|
|
59
|
+
import { default as Vt } from "./patterns/DetailList/DetailList.js";
|
|
60
|
+
import { DetailListAlignment as ht } from "./patterns/DetailList/types.js";
|
|
61
|
+
import { default as vt } from "./patterns/FavoritesCollectionTile/FavoritesCollectionTile.js";
|
|
62
62
|
import { default as Dt } from "./patterns/HeroBanner/HeroBanner.js";
|
|
63
|
-
import { default as
|
|
64
|
-
import { default as
|
|
63
|
+
import { default as Nt } from "./patterns/TextBanner/TextBanner.js";
|
|
64
|
+
import { default as Mt } from "./patterns/LanguageSelector/LanguageSelector.js";
|
|
65
65
|
import { default as Gt } from "./patterns/SaleHeaderBanner/SaleHeaderBanner.js";
|
|
66
66
|
import { default as Ut } from "./patterns/SaleHeaderBanner/SaleHeaderBrowseAuctions.js";
|
|
67
67
|
import { default as Qt } from "./patterns/Social/Social.js";
|
|
@@ -82,12 +82,12 @@ import { default as So } from "./patterns/FiltersInline/FiltersInline.js";
|
|
|
82
82
|
import { FilterButtonIconType as To, FilterButtonType as Bo } from "./patterns/FiltersInline/types.js";
|
|
83
83
|
import { default as Io } from "./patterns/SaleCard/SaleCard.js";
|
|
84
84
|
import { SaleCardActions as Lo } from "./patterns/SaleCard/SaleCardActions.js";
|
|
85
|
-
import { SaleCardVariants as
|
|
86
|
-
import { default as
|
|
87
|
-
import { default as
|
|
85
|
+
import { SaleCardVariants as Vo } from "./patterns/SaleCard/types.js";
|
|
86
|
+
import { default as ho } from "./patterns/ViewingDetails/ViewingDetails.js";
|
|
87
|
+
import { default as vo } from "./components/ProgressIndicator/ProgressIndicator.js";
|
|
88
88
|
import { default as Do } from "./site-furniture/Footer/Footer.js";
|
|
89
|
-
import { default as
|
|
90
|
-
import { default as
|
|
89
|
+
import { default as No } from "./site-furniture/Header/Header.js";
|
|
90
|
+
import { default as Mo } from "./components/AddToCalendar/AddToCalendar.js";
|
|
91
91
|
import { default as Go } from "./components/Article/Article.js";
|
|
92
92
|
import { default as Uo } from "./components/Countdown/Countdown.js";
|
|
93
93
|
import { CountdownVariants as Qo } from "./components/Countdown/types.js";
|
|
@@ -108,25 +108,26 @@ import { default as gr } from "./patterns/AccountPageHeader/AccountPageHeader.js
|
|
|
108
108
|
import { default as Cr } from "./patterns/BidSnapshot/BidSnapshot.js";
|
|
109
109
|
import { default as Br } from "./patterns/BidSnapshot/BidMessage.js";
|
|
110
110
|
import { BidMessageVariants as Ir, BidStatusEnum as Ar } from "./patterns/BidSnapshot/types.js";
|
|
111
|
-
import { default as
|
|
111
|
+
import { default as br } from "./patterns/FilterMenu/FilterMenu.js";
|
|
112
112
|
import { default as yr } from "./patterns/ObjectTile/ObjectTile.js";
|
|
113
|
-
import { default as
|
|
113
|
+
import { default as kr } from "./patterns/CountryPicker/CountryPicker.js";
|
|
114
|
+
import { default as wr } from "./patterns/PhoneNumberInput/PhoneNumberInput.js";
|
|
114
115
|
export {
|
|
115
|
-
|
|
116
|
+
H as Accordion,
|
|
116
117
|
E as AccordionItem,
|
|
117
118
|
R as AccordionItemVariant,
|
|
118
119
|
U as AccordionVariants,
|
|
119
120
|
gr as AccountPageHeader,
|
|
120
|
-
|
|
121
|
+
Mo as AddToCalendar,
|
|
121
122
|
Go as Article,
|
|
122
|
-
|
|
123
|
+
b as AuctionStatus,
|
|
123
124
|
qt as AuthState,
|
|
124
125
|
Br as BidMessage,
|
|
125
126
|
Ir as BidMessageVariants,
|
|
126
127
|
Cr as BidSnapshot,
|
|
127
128
|
Ar as BidStatusEnum,
|
|
128
129
|
Q as Breadcrumb,
|
|
129
|
-
|
|
130
|
+
k as Button,
|
|
130
131
|
w as ButtonVariants,
|
|
131
132
|
Y as Carousel,
|
|
132
133
|
q as CarouselArrows,
|
|
@@ -142,43 +143,43 @@ export {
|
|
|
142
143
|
pe as ContentPeekHeightUnits,
|
|
143
144
|
Uo as Countdown,
|
|
144
145
|
Qo as CountdownVariants,
|
|
145
|
-
|
|
146
|
+
kr as CountryPicker,
|
|
146
147
|
zo as DescriptiveRadioButton,
|
|
147
148
|
Yo as DescriptiveRadioButtonGroup,
|
|
148
149
|
ie as Detail,
|
|
149
|
-
|
|
150
|
-
|
|
150
|
+
Vt as DetailList,
|
|
151
|
+
ht as DetailListAlignment,
|
|
151
152
|
qo as Divider,
|
|
152
153
|
ne as Drawer,
|
|
153
154
|
ge as Dropdown,
|
|
154
155
|
Ce as ErrorBoundary,
|
|
155
156
|
mo as ExitGateCard,
|
|
156
|
-
|
|
157
|
+
vt as FavoritesCollectionTile,
|
|
157
158
|
Ko as FavoritingTileButton,
|
|
158
159
|
_o as Filter,
|
|
159
160
|
To as FilterButtonIconType,
|
|
160
161
|
Bo as FilterButtonType,
|
|
161
162
|
or as FilterHeader,
|
|
162
163
|
er as FilterInput,
|
|
163
|
-
|
|
164
|
+
br as FilterMenu,
|
|
164
165
|
So as FiltersInline,
|
|
165
166
|
Do as Footer,
|
|
166
167
|
Be as Grid,
|
|
167
168
|
Ie as GridItem,
|
|
168
169
|
Le as GridItemAlign,
|
|
169
|
-
|
|
170
|
+
No as Header,
|
|
170
171
|
Dt as HeroBanner,
|
|
171
172
|
z as Icon,
|
|
172
173
|
F as IconButton,
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
174
|
+
Ve as Input,
|
|
175
|
+
Mt as LanguageSelector,
|
|
176
|
+
he as Link,
|
|
176
177
|
De as LinkBlock,
|
|
177
|
-
|
|
178
|
-
|
|
178
|
+
Ne as LinkList,
|
|
179
|
+
ve as LinkVariants,
|
|
179
180
|
uo as Loader,
|
|
180
|
-
|
|
181
|
-
|
|
181
|
+
V as LotStatus,
|
|
182
|
+
Me as Modal,
|
|
182
183
|
Ge as Navigation,
|
|
183
184
|
Ue as NavigationItem,
|
|
184
185
|
Qe as NavigationItemTrigger,
|
|
@@ -189,15 +190,16 @@ export {
|
|
|
189
190
|
C as Page,
|
|
190
191
|
xo as PageContentWrapper,
|
|
191
192
|
Ye as Pagination,
|
|
193
|
+
wr as PhoneNumberInput,
|
|
192
194
|
co as PhoneNumberPicker,
|
|
193
195
|
sr as Pictogram,
|
|
194
196
|
qe as PinchZoom,
|
|
195
|
-
|
|
197
|
+
vo as ProgressIndicator,
|
|
196
198
|
Ke as Row,
|
|
197
199
|
B as SSRMediaQuery,
|
|
198
200
|
Io as SaleCard,
|
|
199
201
|
Lo as SaleCardActions,
|
|
200
|
-
|
|
202
|
+
Vo as SaleCardVariants,
|
|
201
203
|
Gt as SaleHeaderBanner,
|
|
202
204
|
Ut as SaleHeaderBrowseAuctions,
|
|
203
205
|
_e as Search,
|
|
@@ -219,7 +221,7 @@ export {
|
|
|
219
221
|
Ct as Text,
|
|
220
222
|
ct as TextAlignments,
|
|
221
223
|
dr as TextArea,
|
|
222
|
-
|
|
224
|
+
Nt as TextBanner,
|
|
223
225
|
Bt as TextSymbolVariants,
|
|
224
226
|
It as TextSymbols,
|
|
225
227
|
gt as TextVariants,
|
|
@@ -227,7 +229,7 @@ export {
|
|
|
227
229
|
ir as ToastProvider,
|
|
228
230
|
Kt as UserManagement,
|
|
229
231
|
Lt as Video,
|
|
230
|
-
|
|
232
|
+
ho as ViewingDetails,
|
|
231
233
|
eo as ViewingsList,
|
|
232
234
|
s as defaultYear,
|
|
233
235
|
l as emailValidation,
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import { jsx as o, jsxs as
|
|
1
|
+
import { jsx as o, jsxs as k } from "react/jsx-runtime";
|
|
2
2
|
import { forwardRef as j, useState as S, useEffect as H, useRef as V, useMemo as f } from "react";
|
|
3
|
-
import
|
|
4
|
-
import
|
|
5
|
-
import
|
|
6
|
-
import
|
|
7
|
-
import { TextVariants as
|
|
3
|
+
import L from "../../components/Button/Button.js";
|
|
4
|
+
import N from "../../components/Input/Input.js";
|
|
5
|
+
import U from "../../components/Modal/Modal.js";
|
|
6
|
+
import A from "../../components/Text/Text.js";
|
|
7
|
+
import { TextVariants as G } from "../../components/Text/types.js";
|
|
8
8
|
import { countries as v } from "./constants.js";
|
|
9
|
-
import { getSafeCountryCallingCode as
|
|
10
|
-
import { ButtonVariants as
|
|
11
|
-
import
|
|
12
|
-
import { CountryPickerCountryList as
|
|
9
|
+
import { getSafeCountryCallingCode as K } from "./utils.js";
|
|
10
|
+
import { ButtonVariants as O } from "../../components/Button/types.js";
|
|
11
|
+
import Z from "../../components/Icon/Icon.js";
|
|
12
|
+
import { CountryPickerCountryList as q } from "./CountryPickerCountryList.js";
|
|
13
13
|
const w = ["US", "GB", "HK", "CH"], z = (n, l) => {
|
|
14
14
|
if (!l) return n;
|
|
15
15
|
const d = l.replace(/[.*?^${}()|[\]\\]/g, "\\$&").replace(/\+/g, "");
|
|
16
16
|
if (!d) return n;
|
|
17
17
|
const i = new RegExp(d, "gi");
|
|
18
18
|
return n.filter((u) => {
|
|
19
|
-
const h = u.name, t = u.code, p =
|
|
19
|
+
const h = u.name, t = u.code, p = K(t).replace(/\+/g, "");
|
|
20
20
|
return i.test(h) || i.test(t) || i.test(p) || i.test("+" + p);
|
|
21
21
|
});
|
|
22
22
|
}, J = j(
|
|
@@ -31,56 +31,55 @@ const w = ["US", "GB", "HK", "CH"], z = (n, l) => {
|
|
|
31
31
|
baseClassName: t,
|
|
32
32
|
variantConfig: _
|
|
33
33
|
}, p) => {
|
|
34
|
-
const { value: g, onChange:
|
|
34
|
+
const { value: g, onChange: y, isPhone: E } = _, [c, I] = S(g), C = (e) => v.some((a) => a.code === e);
|
|
35
35
|
H(() => {
|
|
36
36
|
I(g);
|
|
37
37
|
}, [n, g]);
|
|
38
|
-
const [s, B] = S(""), D = V(null), F = V(null), [
|
|
38
|
+
const [s, B] = S(""), D = V(null), F = V(null), [x, P] = f(() => {
|
|
39
39
|
const e = w.map((r) => v.filter(($) => $.code === r)).flat(), a = v.filter((r) => !w.includes(r.code));
|
|
40
40
|
return [
|
|
41
41
|
e,
|
|
42
42
|
// keep original order for prioritized
|
|
43
43
|
a.sort((r, $) => r.name.localeCompare($.name))
|
|
44
44
|
];
|
|
45
|
-
}, []), M = f(() => z(
|
|
45
|
+
}, []), M = f(() => z(x, s), [x, s]), R = f(() => z(P, s), [P, s]), T = f(() => {
|
|
46
46
|
const e = {};
|
|
47
|
-
return
|
|
47
|
+
return R.forEach((a) => {
|
|
48
48
|
const r = a.name[0].toUpperCase();
|
|
49
49
|
e[r] || (e[r] = []), e[r].push(a);
|
|
50
50
|
}), e;
|
|
51
|
-
}, [
|
|
51
|
+
}, [R]);
|
|
52
52
|
return /* @__PURE__ */ o(
|
|
53
|
-
|
|
53
|
+
U,
|
|
54
54
|
{
|
|
55
55
|
isOpen: n,
|
|
56
56
|
onClose: l,
|
|
57
57
|
"data-testid": "country-picker-modal",
|
|
58
58
|
className: `${t}__modal`,
|
|
59
59
|
ref: p,
|
|
60
|
-
children: /* @__PURE__ */
|
|
61
|
-
/* @__PURE__ */
|
|
62
|
-
/* @__PURE__ */ o(
|
|
63
|
-
/* @__PURE__ */
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
] })
|
|
60
|
+
children: /* @__PURE__ */ k("div", { className: `${t}__wrapper`, children: [
|
|
61
|
+
/* @__PURE__ */ k("div", { className: `${t}__header`, children: [
|
|
62
|
+
/* @__PURE__ */ o(A, { variant: G.heading3, className: `${t}__header-text`, children: m }),
|
|
63
|
+
/* @__PURE__ */ o("div", { className: `${t}__input-wrapper`, children: /* @__PURE__ */ o(
|
|
64
|
+
N,
|
|
65
|
+
{
|
|
66
|
+
id: "countrySearch",
|
|
67
|
+
type: "search",
|
|
68
|
+
labelText: d,
|
|
69
|
+
hideLabel: !0,
|
|
70
|
+
placeholder: i,
|
|
71
|
+
value: s,
|
|
72
|
+
onChange: (e) => {
|
|
73
|
+
B(e.target.value);
|
|
74
|
+
},
|
|
75
|
+
autoFocus: !0,
|
|
76
|
+
className: `${t}__input`,
|
|
77
|
+
inputAdornment: /* @__PURE__ */ o("span", { "aria-hidden": "true", children: /* @__PURE__ */ o(Z, { icon: "Search", width: 16, height: 16, color: "$cta-inactive" }) })
|
|
78
|
+
}
|
|
79
|
+
) })
|
|
81
80
|
] }),
|
|
82
81
|
/* @__PURE__ */ o(
|
|
83
|
-
|
|
82
|
+
q,
|
|
84
83
|
{
|
|
85
84
|
filteredPrioritized: M,
|
|
86
85
|
groupedCountries: T,
|
|
@@ -92,16 +91,16 @@ const w = ["US", "GB", "HK", "CH"], z = (n, l) => {
|
|
|
92
91
|
}
|
|
93
92
|
),
|
|
94
93
|
/* @__PURE__ */ o("div", { className: `${t}__button-container`, children: /* @__PURE__ */ o(
|
|
95
|
-
|
|
94
|
+
L,
|
|
96
95
|
{
|
|
97
96
|
onClick: () => {
|
|
98
|
-
c && (E ?
|
|
97
|
+
c && (E ? C(c) && y(c) : C(c) || y(c), l?.());
|
|
99
98
|
},
|
|
100
99
|
className: `${t}__button`,
|
|
101
100
|
"data-testid": "country-picker-modal-select-button",
|
|
102
101
|
ref: D,
|
|
103
102
|
type: "button",
|
|
104
|
-
variant:
|
|
103
|
+
variant: O.secondary,
|
|
105
104
|
isDisabled: !c,
|
|
106
105
|
children: u
|
|
107
106
|
}
|
|
@@ -1,20 +1,20 @@
|
|
|
1
1
|
import { jsxs as a, jsx as t } from "react/jsx-runtime";
|
|
2
2
|
import x from "../../components/Icon/Icon.js";
|
|
3
3
|
import { TextVariants as m } from "../../components/Text/types.js";
|
|
4
|
-
import
|
|
4
|
+
import f from "../../components/Text/Text.js";
|
|
5
5
|
import i from "../../node_modules/classnames/index.js";
|
|
6
6
|
import { countries as y } from "./constants.js";
|
|
7
7
|
import { forwardRef as k } from "react";
|
|
8
8
|
const w = k(
|
|
9
|
-
({ labelText: c, displayValue:
|
|
10
|
-
const { isPhone: l, value: g } = u, d =
|
|
9
|
+
({ labelText: c, displayValue: p, onClick: $, hasError: o = !1, errorMsg: e, id: n, className: h, baseClassName: r, variantConfig: u }, v) => {
|
|
10
|
+
const { isPhone: l, value: g } = u, d = e ? `${r}__trigger-error-msg` : void 0, _ = l ? g : y.filter((s) => s.name === g)?.[0]?.code;
|
|
11
11
|
return /* @__PURE__ */ a("div", { className: i(`${r}__trigger`, h), children: [
|
|
12
12
|
/* @__PURE__ */ t(
|
|
13
|
-
|
|
13
|
+
f,
|
|
14
14
|
{
|
|
15
15
|
variant: m.string2,
|
|
16
16
|
className: i(`${r}__trigger-label`, {
|
|
17
|
-
[`${r}__trigger-label--error`]:
|
|
17
|
+
[`${r}__trigger-label--error`]: o
|
|
18
18
|
}),
|
|
19
19
|
id: n ? `${n}-label` : void 0,
|
|
20
20
|
children: c
|
|
@@ -26,10 +26,10 @@ const w = k(
|
|
|
26
26
|
ref: v,
|
|
27
27
|
type: "button",
|
|
28
28
|
"aria-label": c,
|
|
29
|
-
"aria-invalid":
|
|
29
|
+
"aria-invalid": o,
|
|
30
30
|
"aria-describedby": d,
|
|
31
31
|
className: i(`${r}__trigger-btn`, {
|
|
32
|
-
[`${r}__trigger-btn--error`]:
|
|
32
|
+
[`${r}__trigger-btn--error`]: o,
|
|
33
33
|
[`${r}__trigger-btn--is-phone`]: l
|
|
34
34
|
}),
|
|
35
35
|
onClick: $,
|
|
@@ -44,20 +44,12 @@ const w = k(
|
|
|
44
44
|
className: `${r}__trigger-flag`
|
|
45
45
|
}
|
|
46
46
|
),
|
|
47
|
-
/* @__PURE__ */ t("span", { className: i(`${r}__trigger-text`), children:
|
|
48
|
-
/* @__PURE__ */ t("span", { className: i(`${r}__trigger-icon`), children: /* @__PURE__ */ t(x, { icon: "ChevronDown", color: "
|
|
47
|
+
/* @__PURE__ */ t("span", { className: i(`${r}__trigger-text`), children: p }),
|
|
48
|
+
/* @__PURE__ */ t("span", { className: i(`${r}__trigger-icon`), children: /* @__PURE__ */ t(x, { icon: "ChevronDown", color: "black-100", width: 16, height: 16 }) })
|
|
49
49
|
]
|
|
50
50
|
}
|
|
51
51
|
),
|
|
52
|
-
|
|
53
|
-
p,
|
|
54
|
-
{
|
|
55
|
-
variant: m.string2,
|
|
56
|
-
className: i(`${r}__trigger-error-msg`),
|
|
57
|
-
id: d,
|
|
58
|
-
children: o
|
|
59
|
-
}
|
|
60
|
-
)
|
|
52
|
+
o && e && /* @__PURE__ */ t(f, { variant: m.string2, className: `${r}__trigger-error-msg`, id: d, children: e })
|
|
61
53
|
] });
|
|
62
54
|
}
|
|
63
55
|
);
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
import { default as React, ComponentProps } from 'react';
|
|
2
|
+
import { CountryCode } from './types';
|
|
3
|
+
export interface PhoneNumberInputProps extends Omit<ComponentProps<'div'>, 'onChange'> {
|
|
4
|
+
/**
|
|
5
|
+
* The current phone number value.
|
|
6
|
+
* This represents the phone number entered by the user without country code.
|
|
7
|
+
*/
|
|
8
|
+
value?: string;
|
|
9
|
+
/**
|
|
10
|
+
* The country code associated with the phone number.
|
|
11
|
+
*/
|
|
12
|
+
countryCode?: CountryCode;
|
|
13
|
+
/**
|
|
14
|
+
* Callback function triggered when the phone number or country code changes.
|
|
15
|
+
* @param value - The updated phone number value.
|
|
16
|
+
* @param countryCode - The updated country code.
|
|
17
|
+
*/
|
|
18
|
+
handleValueChange?: (rawValue: string, countryCode: CountryCode) => void;
|
|
19
|
+
/**
|
|
20
|
+
* The label for the combined fields.
|
|
21
|
+
*/
|
|
22
|
+
label?: string;
|
|
23
|
+
/**
|
|
24
|
+
* Indicates whether the input field is required.
|
|
25
|
+
* If true, the field will be marked as required.
|
|
26
|
+
*/
|
|
27
|
+
required?: boolean;
|
|
28
|
+
/**
|
|
29
|
+
* Indicates whether there is an error in the input field.
|
|
30
|
+
*/
|
|
31
|
+
error?: boolean;
|
|
32
|
+
/**
|
|
33
|
+
* The error message to display when there is an error.
|
|
34
|
+
*/
|
|
35
|
+
errorText?: string;
|
|
36
|
+
/**
|
|
37
|
+
* Indicates whether the input field is disabled.
|
|
38
|
+
*/
|
|
39
|
+
disabled?: boolean;
|
|
40
|
+
}
|
|
41
|
+
/**
|
|
42
|
+
* ## Overview
|
|
43
|
+
*
|
|
44
|
+
* A component for entering phone numbers with country code selection.
|
|
45
|
+
*
|
|
46
|
+
* [Figma Link](https://www.figma.com/design/kSxOhnqIhilZ9hIJd3bPgP/RW-Registration?node-id=6101-43645&m=dev)
|
|
47
|
+
*
|
|
48
|
+
* [Storybook Link](https://phillips-seldon.netlify.app/?path=/docs/patterns-PhoneNumberInput--overview)
|
|
49
|
+
*/
|
|
50
|
+
declare const PhoneNumberInput: React.ForwardRefExoticComponent<Omit<PhoneNumberInputProps, "ref"> & React.RefAttributes<HTMLDivElement>>;
|
|
51
|
+
export default PhoneNumberInput;
|
|
@@ -0,0 +1,79 @@
|
|
|
1
|
+
import { jsxs as i, jsx as r } from "react/jsx-runtime";
|
|
2
|
+
import v, { forwardRef as P } from "react";
|
|
3
|
+
import { getCommonProps as $ } from "../../utils/index.js";
|
|
4
|
+
import I from "../../node_modules/classnames/index.js";
|
|
5
|
+
import x from "../CountryPicker/CountryPicker.js";
|
|
6
|
+
import S from "../../components/Input/Input.js";
|
|
7
|
+
import { getSafeCountryCallingCode as L } from "../CountryPicker/utils.js";
|
|
8
|
+
import { countries as T } from "../CountryPicker/constants.js";
|
|
9
|
+
import l from "../../components/Text/Text.js";
|
|
10
|
+
const j = P(
|
|
11
|
+
({
|
|
12
|
+
className: m,
|
|
13
|
+
value: d = "",
|
|
14
|
+
countryCode: u = "",
|
|
15
|
+
handleValueChange: p,
|
|
16
|
+
label: h = "Phone",
|
|
17
|
+
required: f = !1,
|
|
18
|
+
error: s,
|
|
19
|
+
errorText: t,
|
|
20
|
+
disabled: y = !1,
|
|
21
|
+
...b
|
|
22
|
+
}, g) => {
|
|
23
|
+
const { className: e, ...N } = $(b, "PhoneNumberInput"), [o, _] = v.useState(u || void 0), n = T.find((a) => a.code === o), C = (a) => {
|
|
24
|
+
p?.(a.target.value, o || "");
|
|
25
|
+
}, c = t ? `${e}-error-text` : void 0;
|
|
26
|
+
return /* @__PURE__ */ i("div", { ref: g, className: I(`${e}`, m), ...N, children: [
|
|
27
|
+
/* @__PURE__ */ i("div", { className: `${e}__wrapper`, children: [
|
|
28
|
+
/* @__PURE__ */ i("div", { className: `${e}__country-picker`, children: [
|
|
29
|
+
/* @__PURE__ */ r("input", { type: "hidden", name: "phoneNumber", value: d, "data-testid": "phone-number-hidden-input" }),
|
|
30
|
+
/* @__PURE__ */ r(
|
|
31
|
+
"input",
|
|
32
|
+
{
|
|
33
|
+
type: "hidden",
|
|
34
|
+
name: "phoneCountryCode",
|
|
35
|
+
value: o || "",
|
|
36
|
+
"data-testid": "phone-country-code-hidden-input"
|
|
37
|
+
}
|
|
38
|
+
),
|
|
39
|
+
/* @__PURE__ */ r(
|
|
40
|
+
x,
|
|
41
|
+
{
|
|
42
|
+
triggerLabelText: "Phone Number",
|
|
43
|
+
triggerDisplayValue: n ? `+${L(n.code)}` : "",
|
|
44
|
+
hasTriggerError: !!s,
|
|
45
|
+
modalTitle: "Country code",
|
|
46
|
+
searchInputLabel: "Search country",
|
|
47
|
+
searchInputPlaceholder: "Search country",
|
|
48
|
+
selectButtonLabel: "Select",
|
|
49
|
+
isPhone: !0,
|
|
50
|
+
value: n?.code,
|
|
51
|
+
onChange: _
|
|
52
|
+
}
|
|
53
|
+
)
|
|
54
|
+
] }),
|
|
55
|
+
/* @__PURE__ */ r("div", { className: `${e}__input`, children: /* @__PURE__ */ r(
|
|
56
|
+
S,
|
|
57
|
+
{
|
|
58
|
+
id: "phone-input",
|
|
59
|
+
type: "tel",
|
|
60
|
+
labelText: h,
|
|
61
|
+
hideLabel: !0,
|
|
62
|
+
value: d,
|
|
63
|
+
onChange: C,
|
|
64
|
+
required: f,
|
|
65
|
+
invalid: !!s,
|
|
66
|
+
disabled: y,
|
|
67
|
+
invalidText: "",
|
|
68
|
+
"aria-describedby": c
|
|
69
|
+
}
|
|
70
|
+
) })
|
|
71
|
+
] }),
|
|
72
|
+
t ? /* @__PURE__ */ r(l, { className: `${e}__error ${e}__error-msg`, id: c, children: t }) : /* @__PURE__ */ r(l, { className: `${e}__error`, children: " " })
|
|
73
|
+
] });
|
|
74
|
+
}
|
|
75
|
+
);
|
|
76
|
+
j.displayName = "PhoneNumberInput";
|
|
77
|
+
export {
|
|
78
|
+
j as default
|
|
79
|
+
};
|
|
@@ -0,0 +1,49 @@
|
|
|
1
|
+
import { PhoneNumberInputProps } from './PhoneNumberInput';
|
|
2
|
+
declare const meta: {
|
|
3
|
+
title: string;
|
|
4
|
+
component: import('react').ForwardRefExoticComponent<Omit<PhoneNumberInputProps, "ref"> & import('react').RefAttributes<HTMLDivElement>>;
|
|
5
|
+
};
|
|
6
|
+
export default meta;
|
|
7
|
+
export declare const Playground: {
|
|
8
|
+
(props: Partial<PhoneNumberInputProps>): import("react/jsx-runtime").JSX.Element;
|
|
9
|
+
args: {
|
|
10
|
+
value: string;
|
|
11
|
+
countryCode: string;
|
|
12
|
+
label: string;
|
|
13
|
+
required: boolean;
|
|
14
|
+
disabled: boolean;
|
|
15
|
+
error: boolean;
|
|
16
|
+
errorText: string;
|
|
17
|
+
};
|
|
18
|
+
argTypes: {
|
|
19
|
+
value: {
|
|
20
|
+
control: string;
|
|
21
|
+
description: string;
|
|
22
|
+
};
|
|
23
|
+
countryCode: {
|
|
24
|
+
control: string;
|
|
25
|
+
description: string;
|
|
26
|
+
};
|
|
27
|
+
label: {
|
|
28
|
+
control: string;
|
|
29
|
+
description: string;
|
|
30
|
+
};
|
|
31
|
+
required: {
|
|
32
|
+
control: string;
|
|
33
|
+
description: string;
|
|
34
|
+
};
|
|
35
|
+
disabled: {
|
|
36
|
+
control: string;
|
|
37
|
+
description: string;
|
|
38
|
+
};
|
|
39
|
+
error: {
|
|
40
|
+
control: string;
|
|
41
|
+
description: string;
|
|
42
|
+
};
|
|
43
|
+
errorText: {
|
|
44
|
+
control: string;
|
|
45
|
+
description: string;
|
|
46
|
+
};
|
|
47
|
+
};
|
|
48
|
+
};
|
|
49
|
+
export declare const InDrawerWithControllerAndValidation: () => import("react/jsx-runtime").JSX.Element;
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export { default as PhoneNumberInput, type PhoneNumberInputProps } from './PhoneNumberInput';
|
package/dist/scss/_vars.scss
CHANGED
|
@@ -86,7 +86,7 @@ $off-white: $grey-25;
|
|
|
86
86
|
|
|
87
87
|
// --- Legacy Notification color palette ---
|
|
88
88
|
$error-red: $highlight-red;
|
|
89
|
-
$error-pink: $highlight-
|
|
89
|
+
$error-pink: $highlight-red;
|
|
90
90
|
$warn-yellow: $highlight-yellow;
|
|
91
91
|
$post-sale-pink: $highlight-purple;
|
|
92
92
|
$cta-blue: $highlight-blue;
|
package/dist/scss/_vars.scss.js
CHANGED
|
@@ -86,7 +86,7 @@ $off-white: $grey-25;
|
|
|
86
86
|
|
|
87
87
|
// --- Legacy Notification color palette ---
|
|
88
88
|
$error-red: $highlight-red;
|
|
89
|
-
$error-pink: $highlight-
|
|
89
|
+
$error-pink: $highlight-red;
|
|
90
90
|
$warn-yellow: $highlight-yellow;
|
|
91
91
|
$post-sale-pink: $highlight-purple;
|
|
92
92
|
$cta-blue: $highlight-blue;
|
|
@@ -83,18 +83,6 @@
|
|
|
83
83
|
}
|
|
84
84
|
}
|
|
85
85
|
|
|
86
|
-
&__input-icon {
|
|
87
|
-
align-items: center;
|
|
88
|
-
color: $dark-gray;
|
|
89
|
-
display: flex;
|
|
90
|
-
left: $spacing-xsm;
|
|
91
|
-
pointer-events: none;
|
|
92
|
-
position: absolute;
|
|
93
|
-
top: 50%;
|
|
94
|
-
transform: translateY(-50%);
|
|
95
|
-
z-index: 2;
|
|
96
|
-
}
|
|
97
|
-
|
|
98
86
|
.#{$px}-country-picker__input-wrapper .seldon-input__label {
|
|
99
87
|
border: 0;
|
|
100
88
|
height: 1px;
|
|
@@ -7,9 +7,11 @@
|
|
|
7
7
|
width: 100%;
|
|
8
8
|
|
|
9
9
|
&-label {
|
|
10
|
-
|
|
10
|
+
@include text($string2);
|
|
11
|
+
|
|
12
|
+
color: $pure-black;
|
|
11
13
|
font-variation-settings: 'wght' 600;
|
|
12
|
-
margin-bottom: $spacing-
|
|
14
|
+
margin-bottom: $spacing-xsm;
|
|
13
15
|
|
|
14
16
|
&--error {
|
|
15
17
|
color: $error-red;
|
|
@@ -17,11 +19,13 @@
|
|
|
17
19
|
}
|
|
18
20
|
|
|
19
21
|
&-btn {
|
|
22
|
+
@include text($string2);
|
|
23
|
+
|
|
20
24
|
align-items: center;
|
|
21
25
|
appearance: none;
|
|
22
|
-
background: $white
|
|
23
|
-
border: 1px solid $
|
|
24
|
-
border-radius:
|
|
26
|
+
background: $white;
|
|
27
|
+
border: 1px solid $black-100;
|
|
28
|
+
border-radius: 0.1875rem;
|
|
25
29
|
box-sizing: border-box;
|
|
26
30
|
cursor: pointer;
|
|
27
31
|
display: flex;
|
|
@@ -29,9 +33,6 @@
|
|
|
29
33
|
font-variation-settings: 'wght' 600;
|
|
30
34
|
justify-content: space-between;
|
|
31
35
|
padding: $spacing-xsm;
|
|
32
|
-
transition:
|
|
33
|
-
border-color 0.2s,
|
|
34
|
-
box-shadow 0.2s;
|
|
35
36
|
width: 100%;
|
|
36
37
|
|
|
37
38
|
&:focus-visible {
|
|
@@ -42,11 +43,12 @@
|
|
|
42
43
|
|
|
43
44
|
&--error {
|
|
44
45
|
border-color: $error-red;
|
|
46
|
+
box-shadow: inset 0 0 3px 3px $error-pink;
|
|
45
47
|
}
|
|
46
48
|
}
|
|
47
49
|
|
|
48
50
|
&-text {
|
|
49
|
-
color: $
|
|
51
|
+
color: $pure-black;
|
|
50
52
|
flex: 1;
|
|
51
53
|
overflow: hidden;
|
|
52
54
|
text-align: left;
|
|
@@ -58,11 +60,29 @@
|
|
|
58
60
|
align-items: center;
|
|
59
61
|
display: flex;
|
|
60
62
|
margin-left: $spacing-sm;
|
|
63
|
+
|
|
64
|
+
@media (min-width: $breakpoint-md) {
|
|
65
|
+
height: 1.25rem;
|
|
66
|
+
width: 1.25rem;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
@media (min-width: $breakpoint-xl) {
|
|
70
|
+
height: 1.5rem;
|
|
71
|
+
width: 1.5rem;
|
|
72
|
+
}
|
|
61
73
|
}
|
|
62
74
|
|
|
63
75
|
&-error-msg {
|
|
64
|
-
|
|
76
|
+
animation: reveal 0.45s linear forwards;
|
|
65
77
|
margin-top: $spacing-micro;
|
|
78
|
+
|
|
79
|
+
// Reveal animation (match Input)
|
|
80
|
+
max-height: 2em;
|
|
81
|
+
opacity: 1;
|
|
82
|
+
transition: opacity 0.2s;
|
|
83
|
+
visibility: visible;
|
|
84
|
+
white-space: nowrap;
|
|
85
|
+
will-change: opacity, max-height;
|
|
66
86
|
}
|
|
67
87
|
|
|
68
88
|
&-flag {
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
@use '../../allPartials' as *;
|
|
2
|
+
|
|
3
|
+
.#{$px}-phone-number-input {
|
|
4
|
+
display: flex;
|
|
5
|
+
flex-direction: column;
|
|
6
|
+
position: relative;
|
|
7
|
+
width: 100%;
|
|
8
|
+
|
|
9
|
+
&__wrapper {
|
|
10
|
+
display: flex;
|
|
11
|
+
flex-direction: row;
|
|
12
|
+
gap: $spacing-xsm;
|
|
13
|
+
width: 100%;
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
&__error {
|
|
17
|
+
-webkit-box-orient: vertical;
|
|
18
|
+
display: -webkit-box;
|
|
19
|
+
-webkit-line-clamp: 2;
|
|
20
|
+
line-height: $spacing-md;
|
|
21
|
+
|
|
22
|
+
&-msg {
|
|
23
|
+
animation: reveal 0.45s linear forwards;
|
|
24
|
+
|
|
25
|
+
// Reveal animation (match Input)
|
|
26
|
+
max-height: 2em;
|
|
27
|
+
opacity: 1;
|
|
28
|
+
overflow: hidden;
|
|
29
|
+
transition: opacity 0.2s;
|
|
30
|
+
visibility: visible;
|
|
31
|
+
will-change: opacity, max-height;
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
// Hide the validation from the Input component
|
|
36
|
+
.#{$px}-input__validation {
|
|
37
|
+
display: none;
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
&__country-picker {
|
|
41
|
+
flex: 0 0 25%;
|
|
42
|
+
margin-right: $spacing-xsm;
|
|
43
|
+
min-width: 150px; // just big enough for flag and 3 digit code
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
&__input {
|
|
47
|
+
flex: 1 1 75%;
|
|
48
|
+
flex-grow: 1;
|
|
49
|
+
margin-top: calc(var(--string-line-height-size2) + 0.5rem);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
@media screen and (min-width: $breakpoint-xl) {
|
|
53
|
+
&__wrapper {
|
|
54
|
+
align-items: center;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
&__country-picker {
|
|
58
|
+
flex: 0 0 40%;
|
|
59
|
+
min-width: 0;
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
&__input {
|
|
63
|
+
flex: 1 1 60%;
|
|
64
|
+
margin-top: calc(var(--string-line-height-size2) + 1rem);
|
|
65
|
+
min-width: 0;
|
|
66
|
+
}
|
|
67
|
+
}
|
|
68
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@phillips/seldon",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.191.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "https://github.com/PhillipsAuctionHouse/seldon"
|
|
@@ -124,6 +124,7 @@
|
|
|
124
124
|
"react": "^18.3.1",
|
|
125
125
|
"react-docgen-typescript": "^2.2.2",
|
|
126
126
|
"react-dom": "^18.2.0",
|
|
127
|
+
"react-hook-form": "^7.62.0",
|
|
127
128
|
"rimraf": "^6.0.1",
|
|
128
129
|
"rollup-plugin-copy": "^3.5.0",
|
|
129
130
|
"rollup-plugin-peer-deps-external": "^2.2.4",
|