@stokr/components-library 5.0.0 → 5.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/AddressItem/AddressItem.d.ts +38 -0
- package/dist/components/AddressItem/AddressItem.js +51 -0
- package/dist/components/AddressItem/AddressItem.styles.d.ts +31 -0
- package/dist/components/AddressItem/AddressItem.styles.js +71 -0
- package/dist/components/Checkbox/Checkbox.styles.d.ts +1 -0
- package/dist/components/Collapsible/Collapsible.d.ts +10 -4
- package/dist/components/Collapsible/Collapsible.js +6 -14
- package/dist/components/Collapsible/Collapsible.styles.d.ts +3 -1
- package/dist/components/Collapsible/Collapsible.styles.js +26 -9
- package/dist/components/Country/CountrySelect.js +9 -14
- package/dist/components/Country/FlagFor.d.ts +9 -0
- package/dist/components/Country/FlagFor.js +25 -0
- package/dist/components/Country/flagLoaders.d.ts +5 -0
- package/dist/components/Country/flagLoaders.js +270 -0
- package/dist/components/Country/flagStore.d.ts +6 -0
- package/dist/components/Country/flagStore.js +29 -0
- package/dist/components/FAQ/FAQ.d.ts +29 -0
- package/dist/components/FAQ/FAQ.js +18 -18
- package/dist/components/FAQ/FAQ.styles.d.ts +11 -3
- package/dist/components/FAQ/FAQ.styles.js +55 -1
- package/dist/components/IdentityInfo/IdentityInfo.js +2 -1
- package/dist/components/IdentityInfo/IdentityInfo.styles.js +3 -1
- package/dist/components/InfoBox/InfoBox.d.ts +13 -11
- package/dist/components/InfoBox/InfoBox.js +27 -12
- package/dist/components/Input/Input.d.ts +3 -0
- package/dist/components/Input/Input.js +5 -2
- package/dist/components/Input/Input.styles.d.ts +4 -0
- package/dist/components/Input/Input.styles.js +56 -0
- package/dist/components/Input/Select.d.ts +57 -0
- package/dist/components/Input/Select.js +89 -99
- package/dist/components/Input/Select.styles.d.ts +89 -0
- package/dist/components/Input/Select.styles.js +102 -2
- package/dist/components/MaterialIcon/requiredIcons.d.ts +1 -1
- package/dist/components/MaterialIcon/requiredIcons.js +2 -0
- package/dist/components/PanelCard/PanelCard.d.ts +51 -0
- package/dist/components/PanelCard/PanelCard.js +35 -0
- package/dist/components/PanelCard/PanelCard.styles.d.ts +29 -0
- package/dist/components/PanelCard/PanelCard.styles.js +84 -0
- package/dist/components/Radio/Radio.styles.d.ts +1 -0
- package/dist/components/StepSidebar/MobileStepProgress.d.ts +12 -0
- package/dist/components/StepSidebar/MobileStepProgress.js +14 -0
- package/dist/components/StepSidebar/MobileStepProgress.styles.d.ts +15 -0
- package/dist/components/StepSidebar/MobileStepProgress.styles.js +41 -0
- package/dist/components/StepSidebar/StepProgress.d.ts +14 -0
- package/dist/components/StepSidebar/StepProgress.js +14 -0
- package/dist/components/StepSidebar/StepProgress.styles.d.ts +30 -0
- package/dist/components/StepSidebar/StepProgress.styles.js +106 -0
- package/dist/components/StepSidebar/StepSidebar.d.ts +36 -0
- package/dist/components/StepSidebar/StepSidebar.js +58 -0
- package/dist/components/StepSidebar/StepSidebar.styles.d.ts +55 -0
- package/dist/components/StepSidebar/StepSidebar.styles.js +174 -0
- package/dist/components/StokrLoader/StokrLoader.d.ts +16 -2
- package/dist/components/StokrLoader/StokrLoader.js +140 -26
- package/dist/components/TaxResidenceCard/TaxResidenceCard.js +26 -11
- package/dist/components/TaxResidenceCard/TaxResidenceCard.styles.d.ts +29 -12
- package/dist/components/TaxResidenceCard/TaxResidenceCard.styles.js +85 -7
- package/dist/constants/chainLogos.d.ts +9 -0
- package/dist/constants/chainLogos.js +17 -0
- package/dist/index.d.ts +73 -6
- package/dist/index.js +21 -4
- package/dist/static/images/chains/avalanche.svg +7 -0
- package/dist/static/images/chains/avalanche.svg.js +4 -0
- package/dist/static/images/chains/ethereum.svg +14 -0
- package/dist/static/images/chains/ethereum.svg.js +4 -0
- package/dist/static/images/chains/liquid.svg +7 -0
- package/dist/static/images/chains/liquid.svg.js +4 -0
- package/dist/static/images/chains/solana.svg +29 -0
- package/dist/static/images/chains/solana.svg.js +4 -0
- package/dist/static/images/chains/stellar.svg +17 -0
- package/dist/static/images/chains/stellar.svg.js +4 -0
- package/dist/static/images/chains/tempo.svg +11 -0
- package/dist/static/images/chains/tempo.svg.js +4 -0
- package/dist/styles/borderedField.d.ts +11 -0
- package/dist/styles/borderedField.js +53 -0
- package/package.json +1 -1
- package/dist/static/images/globe.svg.js +0 -5
- package/dist/static/images/trash.svg +0 -17
- package/dist/static/images/trash.svg.js +0 -5
|
@@ -1,5 +1,6 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import
|
|
1
|
+
import { jsxs, jsx } from "react/jsx-runtime";
|
|
2
|
+
import { useId } from "react";
|
|
3
|
+
import styled, { keyframes, css } from "styled-components";
|
|
3
4
|
import { breakpoint } from "../../design-system/styled/breakpoint.js";
|
|
4
5
|
const loaderGif = "https://res.cloudinary.com/stokr/image/upload/f_webp,fl_awebp,q_auto/v1575035788/Static/stokr_loader_white_400x400_egnhgb.gif";
|
|
5
6
|
const RING_CIRCUMFERENCE = 1021;
|
|
@@ -31,6 +32,106 @@ const RingSvg = styled.svg`
|
|
|
31
32
|
}
|
|
32
33
|
`;
|
|
33
34
|
const LoaderRing = ({ size = 400, className }) => /* @__PURE__ */ jsx(RingSvg, { className, width: size, height: size, viewBox: "0 0 400 400", role: "img", "aria-label": "Loading", children: /* @__PURE__ */ jsx("circle", { cx: "200", cy: "200", r: "162.5", fill: "none", stroke: "currentColor", strokeWidth: "75" }) });
|
|
35
|
+
const LOGO_WIDTH = 140;
|
|
36
|
+
const LOGO_HEIGHT = 34;
|
|
37
|
+
const LOGO_O_CENTER = "64.94px 17px";
|
|
38
|
+
const LOGO_O_CIRCUMFERENCE = 86.35;
|
|
39
|
+
const LOGO_O_DRAWN = 64.76;
|
|
40
|
+
const LOGO_LETTERS = [
|
|
41
|
+
{
|
|
42
|
+
key: "s",
|
|
43
|
+
d: "M14.8041 9.24243C13.2455 7.01254 11.6592 5.89746 10.0438 5.89746C9.25726 5.89746 8.61397 6.11412 8.1137 6.54658C7.61343 6.97961 7.36329 7.46753 7.36329 8.01005C7.36329 8.55315 7.54164 9.0665 7.89945 9.55038C8.38521 10.1963 9.85041 11.5827 12.2948 13.7094C14.5816 15.6755 15.9682 16.9151 16.4545 17.4285C17.6693 18.6903 18.5304 19.8964 19.0381 21.0485C19.5455 22.2 19.7995 23.4578 19.7995 24.8221C19.7995 27.4778 18.9063 29.6707 17.1208 31.402C15.3348 33.133 13.0066 33.9985 10.1356 33.9985C7.8926 33.9985 5.93918 33.4334 4.27479 32.3042C2.61068 31.1744 1.18548 29.3995 0 26.9786L5.03781 23.8541C6.55288 26.7146 8.29644 28.1449 10.2688 28.1449C11.2973 28.1449 12.1622 27.8372 12.8625 27.2207C13.563 26.6048 13.9132 25.8933 13.9132 25.0862C13.9132 24.353 13.6485 23.6195 13.1197 22.8858C12.5907 22.1523 11.426 21.03 9.62493 19.5188C6.19397 16.6436 3.97808 14.4244 2.97753 12.8621C1.97699 11.2998 1.47699 9.74104 1.47699 8.18627C1.47699 5.94166 2.30932 4.01597 3.9737 2.40978C5.63781 0.803307 7.69178 0.000213623 10.1348 0.000213623C11.7066 0.000213623 13.203 0.374027 14.6244 1.12252C16.046 1.87044 17.5852 3.23512 19.2427 5.2157L19.8038 5.83564L15.2899 9.93054L14.8041 9.24243Z"
|
|
44
|
+
},
|
|
45
|
+
{ key: "t", d: "M28 7.75029H33.3333V34H38.6667V7.75029H44V1.91705H28V7.75029Z" },
|
|
46
|
+
{
|
|
47
|
+
key: "k",
|
|
48
|
+
d: "M110.8 1.91705H103.596L95.3794 12.6707L94.0003 14.4478V1.91705H88V34H94.0003V17.9804L95.3794 19.9973L104.885 34H112L100 16.5008L110.8 1.91705Z"
|
|
49
|
+
},
|
|
50
|
+
{
|
|
51
|
+
key: "r",
|
|
52
|
+
d: "M132.873 12.4215H132.873C132.866 17.5985 125.568 17.0776 123.965 17.0796V12.4215V12.4138V7.75566C125.568 7.75735 132.866 7.23676 132.873 12.4138H132.873V12.4175V12.4215ZM133.447 21.3952C136.481 20.0128 138.812 17.3912 138.812 12.4186C138.812 2.82858 130.151 1.96959 124.481 1.92016C124.436 1.9196 124.39 1.91903 124.345 1.91875C124.236 1.9179 124.129 1.91762 124.022 1.91762C123.96 1.91734 123.897 1.91705 123.836 1.91705C123.815 1.91705 123.796 1.91705 123.776 1.91705C123.62 1.91705 123.469 1.9179 123.319 1.91847C123.274 1.91875 123.227 1.91875 123.182 1.91903C123.017 1.9179 122.855 1.91762 122.695 1.91762H122.682C122.657 1.91762 122.633 1.9179 122.608 1.9179C122.436 1.9179 122.268 1.91847 122.103 1.91931C121.844 1.92044 121.592 1.92214 121.354 1.92327H118.026H118.003V12.4186V22.914L118 34H123.965V22.9199C124.243 22.9196 124.529 22.9174 124.823 22.9129C124.831 22.9129 124.838 22.9129 124.846 22.9126C125.123 22.9083 125.406 22.9013 125.694 22.8917C125.738 22.89 125.782 22.8883 125.826 22.8866C126.388 22.8663 126.968 22.8326 127.558 22.7809C127.603 22.7773 127.647 22.7753 127.692 22.7711L133.508 34H140L133.447 21.3952Z"
|
|
53
|
+
}
|
|
54
|
+
];
|
|
55
|
+
const logoWipe = keyframes`
|
|
56
|
+
to { transform: scaleY(1); }
|
|
57
|
+
`;
|
|
58
|
+
const logoDraw = keyframes`
|
|
59
|
+
from { stroke-dasharray: 0 ${LOGO_O_CIRCUMFERENCE}; }
|
|
60
|
+
to { stroke-dasharray: ${LOGO_O_DRAWN} ${LOGO_O_CIRCUMFERENCE}; }
|
|
61
|
+
`;
|
|
62
|
+
const logoSpin = keyframes`
|
|
63
|
+
to { transform: rotate(360deg); }
|
|
64
|
+
`;
|
|
65
|
+
const LogoSvg = styled.svg`
|
|
66
|
+
display: block;
|
|
67
|
+
max-width: 100%;
|
|
68
|
+
height: auto;
|
|
69
|
+
color: var(--stokr-text-primary);
|
|
70
|
+
|
|
71
|
+
.wipe {
|
|
72
|
+
transform-box: fill-box;
|
|
73
|
+
transform-origin: 50% 0;
|
|
74
|
+
transform: scaleY(0);
|
|
75
|
+
animation: ${logoWipe} 0.95s cubic-bezier(0.65, 0, 0.35, 1) forwards;
|
|
76
|
+
}
|
|
77
|
+
|
|
78
|
+
.wipe-s {
|
|
79
|
+
animation-delay: 0s;
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
.wipe-t {
|
|
83
|
+
animation-delay: 0.15s;
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
.wipe-k {
|
|
87
|
+
animation-delay: 0.6s;
|
|
88
|
+
}
|
|
89
|
+
|
|
90
|
+
.wipe-r {
|
|
91
|
+
animation-delay: 0.75s;
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
.draw {
|
|
95
|
+
animation: ${logoDraw} 1s cubic-bezier(0.65, 0, 0.35, 1) 0.3s both;
|
|
96
|
+
}
|
|
97
|
+
|
|
98
|
+
.spin {
|
|
99
|
+
transform-origin: ${LOGO_O_CENTER};
|
|
100
|
+
animation: ${logoSpin} 2.2s cubic-bezier(0.65, 0, 0.35, 1) 1.8s infinite;
|
|
101
|
+
}
|
|
102
|
+
`;
|
|
103
|
+
const LoaderLogo = ({ width = LOGO_WIDTH, className }) => {
|
|
104
|
+
const id = useId().replace(/:/g, "");
|
|
105
|
+
return /* @__PURE__ */ jsxs(
|
|
106
|
+
LogoSvg,
|
|
107
|
+
{
|
|
108
|
+
className,
|
|
109
|
+
width,
|
|
110
|
+
height: width * LOGO_HEIGHT / LOGO_WIDTH,
|
|
111
|
+
viewBox: `0 0 ${LOGO_WIDTH} ${LOGO_HEIGHT}`,
|
|
112
|
+
fill: "none",
|
|
113
|
+
role: "img",
|
|
114
|
+
"aria-label": "Loading",
|
|
115
|
+
children: [
|
|
116
|
+
/* @__PURE__ */ jsx("defs", { children: LOGO_LETTERS.map(({ key }) => /* @__PURE__ */ jsx("clipPath", { id: `${id}-${key}`, children: /* @__PURE__ */ jsx("rect", { className: `wipe wipe-${key}`, x: "-2", y: "-1", width: LOGO_WIDTH + 4, height: LOGO_HEIGHT + 2 }) }, key)) }),
|
|
117
|
+
LOGO_LETTERS.map(({ key, d }) => /* @__PURE__ */ jsx("g", { clipPath: `url(#${id}-${key})`, children: /* @__PURE__ */ jsx("path", { fillRule: "evenodd", clipRule: "evenodd", d, fill: "currentColor" }) }, key)),
|
|
118
|
+
/* @__PURE__ */ jsx("g", { className: "spin", children: /* @__PURE__ */ jsx(
|
|
119
|
+
"circle",
|
|
120
|
+
{
|
|
121
|
+
className: "draw",
|
|
122
|
+
cx: "64.94",
|
|
123
|
+
cy: "17",
|
|
124
|
+
r: "13.743",
|
|
125
|
+
stroke: "currentColor",
|
|
126
|
+
strokeWidth: "6.515",
|
|
127
|
+
strokeDasharray: `${LOGO_O_DRAWN} ${LOGO_O_CIRCUMFERENCE}`,
|
|
128
|
+
transform: "rotate(-90 64.94 17)"
|
|
129
|
+
}
|
|
130
|
+
) })
|
|
131
|
+
]
|
|
132
|
+
}
|
|
133
|
+
);
|
|
134
|
+
};
|
|
34
135
|
const CenterFullWidth = styled.div`
|
|
35
136
|
width: 100%;
|
|
36
137
|
height: 100%;
|
|
@@ -52,7 +153,7 @@ const fadeIn = keyframes`
|
|
|
52
153
|
}
|
|
53
154
|
`;
|
|
54
155
|
const StyledStokrLoader = styled.div.withConfig({
|
|
55
|
-
shouldForwardProp: (props) => !["noFullscreen"].includes(props)
|
|
156
|
+
shouldForwardProp: (props) => !["noFullscreen", "variant"].includes(props)
|
|
56
157
|
})`
|
|
57
158
|
align-items: center;
|
|
58
159
|
animation: ${fadeIn} 1.8s ease-in-out forwards;
|
|
@@ -72,33 +173,45 @@ const StyledStokrLoader = styled.div.withConfig({
|
|
|
72
173
|
top: unset;
|
|
73
174
|
`}
|
|
74
175
|
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
width: 150px;
|
|
80
|
-
}
|
|
81
|
-
`}
|
|
176
|
+
${({ variant }) => variant === "logo" ? css`
|
|
177
|
+
svg {
|
|
178
|
+
width: 200px;
|
|
179
|
+
}
|
|
82
180
|
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
181
|
+
${breakpoint.Medium`
|
|
182
|
+
svg {
|
|
183
|
+
width: 300px;
|
|
184
|
+
}
|
|
185
|
+
`}
|
|
186
|
+
` : css`
|
|
187
|
+
/* 320px, 375px and 768px at the 16px base. */
|
|
188
|
+
${breakpoint.Small`
|
|
189
|
+
svg {
|
|
190
|
+
height: 150px;
|
|
191
|
+
width: 150px;
|
|
192
|
+
}
|
|
193
|
+
`}
|
|
89
194
|
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
195
|
+
${breakpoint.Small`
|
|
196
|
+
svg {
|
|
197
|
+
height: 180px;
|
|
198
|
+
width: 180px;
|
|
199
|
+
}
|
|
200
|
+
`}
|
|
201
|
+
|
|
202
|
+
${breakpoint.Medium`
|
|
203
|
+
svg {
|
|
204
|
+
height: 300px;
|
|
205
|
+
width: 300px;
|
|
206
|
+
}
|
|
207
|
+
`}
|
|
208
|
+
`}
|
|
96
209
|
`;
|
|
97
|
-
function StokrLoader({ noFullscreen }) {
|
|
98
|
-
return /* @__PURE__ */ jsx(StyledStokrLoader, { noFullscreen, children: /* @__PURE__ */ jsx(LoaderRing, {}) });
|
|
210
|
+
function StokrLoader({ noFullscreen, variant = "ring" }) {
|
|
211
|
+
return /* @__PURE__ */ jsx(StyledStokrLoader, { noFullscreen, variant, children: variant === "logo" ? /* @__PURE__ */ jsx(LoaderLogo, {}) : /* @__PURE__ */ jsx(LoaderRing, {}) });
|
|
99
212
|
}
|
|
100
|
-
const StokrLoaderBox = () => {
|
|
101
|
-
return /* @__PURE__ */ jsx(CenterFullWidth, { children: /* @__PURE__ */ jsx(LoaderRing, {}) });
|
|
213
|
+
const StokrLoaderBox = ({ variant = "ring" }) => {
|
|
214
|
+
return /* @__PURE__ */ jsx(CenterFullWidth, { children: variant === "logo" ? /* @__PURE__ */ jsx(LoaderLogo, { width: 200 }) : /* @__PURE__ */ jsx(LoaderRing, {}) });
|
|
102
215
|
};
|
|
103
216
|
const fadeInOut = keyframes`
|
|
104
217
|
50% {
|
|
@@ -133,6 +246,7 @@ const LoadingDots = (props) => {
|
|
|
133
246
|
};
|
|
134
247
|
export {
|
|
135
248
|
AnimatedSpan,
|
|
249
|
+
LoaderLogo,
|
|
136
250
|
LoaderRing,
|
|
137
251
|
LoadingDots,
|
|
138
252
|
StokrLoader,
|
|
@@ -3,10 +3,17 @@ import { useState, useMemo, useCallback } from "react";
|
|
|
3
3
|
import PropTypes from "prop-types";
|
|
4
4
|
import { Input } from "../Input/Input.js";
|
|
5
5
|
import { Checkbox } from "../Checkbox/Checkbox.js";
|
|
6
|
-
import
|
|
7
|
-
import
|
|
8
|
-
import { FlagFor, CountrySelect } from "../Country/CountrySelect.js";
|
|
6
|
+
import { MaterialIcon } from "../MaterialIcon/MaterialIcon.js";
|
|
7
|
+
import { CountrySelect } from "../Country/CountrySelect.js";
|
|
9
8
|
import { CardWrapper, CardHeader, HeaderIcon, FlagWrapper, HeaderTitle, HeaderActions, DeleteButton, ChevronIcon, CardBodyCollapse, CardBody, CheckboxRow } from "./TaxResidenceCard.styles.js";
|
|
9
|
+
import { FlagFor } from "../Country/FlagFor.js";
|
|
10
|
+
const NO_TIN_TEXT_STYLE = {
|
|
11
|
+
fontSize: 12,
|
|
12
|
+
lineHeight: "18px",
|
|
13
|
+
fontWeight: 400,
|
|
14
|
+
letterSpacing: "0.6px",
|
|
15
|
+
color: "var(--stokr-text-primary)"
|
|
16
|
+
};
|
|
10
17
|
const TaxResidenceCard = (props) => {
|
|
11
18
|
const {
|
|
12
19
|
id,
|
|
@@ -25,6 +32,7 @@ const TaxResidenceCard = (props) => {
|
|
|
25
32
|
countryPlaceholder = "Search countries",
|
|
26
33
|
disabled = false,
|
|
27
34
|
hideNoTin = false,
|
|
35
|
+
variant = "default",
|
|
28
36
|
error,
|
|
29
37
|
touched,
|
|
30
38
|
dataCy
|
|
@@ -39,6 +47,7 @@ const TaxResidenceCard = (props) => {
|
|
|
39
47
|
() => country ? countries?.find((c) => c.value === country) : null,
|
|
40
48
|
[countries, country]
|
|
41
49
|
);
|
|
50
|
+
const bordered = variant === "bordered";
|
|
42
51
|
const headerTitle = selectedCountry?.label || emptyTitle;
|
|
43
52
|
const toggle = useCallback(() => {
|
|
44
53
|
const next = !isOpen;
|
|
@@ -68,11 +77,12 @@ const TaxResidenceCard = (props) => {
|
|
|
68
77
|
onDelete?.();
|
|
69
78
|
};
|
|
70
79
|
const cy = dataCy || `tax-residence-card-${id}`;
|
|
71
|
-
return /* @__PURE__ */ jsxs(CardWrapper, { isOpen, "data-cy": cy, children: [
|
|
80
|
+
return /* @__PURE__ */ jsxs(CardWrapper, { isOpen, $variant: variant, "data-cy": cy, children: [
|
|
72
81
|
/* @__PURE__ */ jsxs(
|
|
73
82
|
CardHeader,
|
|
74
83
|
{
|
|
75
84
|
isOpen,
|
|
85
|
+
$variant: variant,
|
|
76
86
|
onClick: toggle,
|
|
77
87
|
onKeyDown: handleHeaderKeyDown,
|
|
78
88
|
role: "button",
|
|
@@ -81,9 +91,9 @@ const TaxResidenceCard = (props) => {
|
|
|
81
91
|
"aria-controls": `${id}-body`,
|
|
82
92
|
"data-cy": `${cy}-toggle`,
|
|
83
93
|
children: [
|
|
84
|
-
/* @__PURE__ */ jsx(HeaderIcon, { "aria-hidden": "true", children: selectedCountry ? /* @__PURE__ */ jsx(FlagWrapper, { children: /* @__PURE__ */ jsx(FlagFor, { code: selectedCountry.value }) }) : /* @__PURE__ */ jsx(
|
|
85
|
-
/* @__PURE__ */ jsx(HeaderTitle, { children: headerTitle }),
|
|
86
|
-
/* @__PURE__ */ jsxs(HeaderActions, { children: [
|
|
94
|
+
/* @__PURE__ */ jsx(HeaderIcon, { "aria-hidden": "true", children: selectedCountry ? /* @__PURE__ */ jsx(FlagWrapper, { $variant: variant, children: /* @__PURE__ */ jsx(FlagFor, { code: selectedCountry.value }) }) : /* @__PURE__ */ jsx(MaterialIcon, { name: "language", size: 20 }) }),
|
|
95
|
+
/* @__PURE__ */ jsx(HeaderTitle, { $variant: variant, children: headerTitle }),
|
|
96
|
+
/* @__PURE__ */ jsxs(HeaderActions, { $variant: variant, children: [
|
|
87
97
|
onDelete && !disabled && /* @__PURE__ */ jsx(
|
|
88
98
|
DeleteButton,
|
|
89
99
|
{
|
|
@@ -92,15 +102,15 @@ const TaxResidenceCard = (props) => {
|
|
|
92
102
|
"aria-label": `Delete ${headerTitle}`,
|
|
93
103
|
disabled,
|
|
94
104
|
"data-cy": `${cy}-delete`,
|
|
95
|
-
children: /* @__PURE__ */ jsx(
|
|
105
|
+
children: /* @__PURE__ */ jsx(MaterialIcon, { name: "delete", size: 20 })
|
|
96
106
|
}
|
|
97
107
|
),
|
|
98
|
-
/* @__PURE__ */ jsx(ChevronIcon, { isOpen, "aria-hidden": "true" })
|
|
108
|
+
/* @__PURE__ */ jsx(ChevronIcon, { isOpen, $variant: variant, "aria-hidden": "true" })
|
|
99
109
|
] })
|
|
100
110
|
]
|
|
101
111
|
}
|
|
102
112
|
),
|
|
103
|
-
/* @__PURE__ */ jsx(CardBodyCollapse, { isOpened: isOpen, children: /* @__PURE__ */ jsxs(CardBody, { id: `${id}-body`, children: [
|
|
113
|
+
/* @__PURE__ */ jsx(CardBodyCollapse, { isOpened: isOpen, $variant: variant, children: /* @__PURE__ */ jsxs(CardBody, { id: `${id}-body`, $variant: variant, children: [
|
|
104
114
|
/* @__PURE__ */ jsx(
|
|
105
115
|
CountrySelect,
|
|
106
116
|
{
|
|
@@ -112,6 +122,7 @@ const TaxResidenceCard = (props) => {
|
|
|
112
122
|
onChange: handleCountryChange,
|
|
113
123
|
placeholder: countryPlaceholder,
|
|
114
124
|
disabled,
|
|
125
|
+
variant,
|
|
115
126
|
error: !!error?.country,
|
|
116
127
|
touched: !!touched?.country,
|
|
117
128
|
dataCy: `${cy}-country`
|
|
@@ -126,12 +137,13 @@ const TaxResidenceCard = (props) => {
|
|
|
126
137
|
value: tin,
|
|
127
138
|
onChange: handleTinChange,
|
|
128
139
|
disabled: disabled || noTinIssued,
|
|
140
|
+
variant,
|
|
129
141
|
error: !!error?.tin,
|
|
130
142
|
touched: !!touched?.tin,
|
|
131
143
|
"data-cy": `${cy}-tin`
|
|
132
144
|
}
|
|
133
145
|
),
|
|
134
|
-
(disabled && (tin === "" || !tin) || !disabled) && !hideNoTin && /* @__PURE__ */ jsx(CheckboxRow, { children: /* @__PURE__ */ jsx(
|
|
146
|
+
(disabled && (tin === "" || !tin) || !disabled) && !hideNoTin && /* @__PURE__ */ jsx(CheckboxRow, { $variant: variant, children: /* @__PURE__ */ jsx(
|
|
135
147
|
Checkbox,
|
|
136
148
|
{
|
|
137
149
|
id: `${id}-no-tin`,
|
|
@@ -140,6 +152,7 @@ const TaxResidenceCard = (props) => {
|
|
|
140
152
|
checked: noTinIssued,
|
|
141
153
|
onChange: handleNoTinChange,
|
|
142
154
|
disabled,
|
|
155
|
+
textStyle: bordered ? NO_TIN_TEXT_STYLE : void 0,
|
|
143
156
|
"data-cy": `${cy}-no-tin`
|
|
144
157
|
}
|
|
145
158
|
) })
|
|
@@ -189,6 +202,8 @@ TaxResidenceCard.propTypes = {
|
|
|
189
202
|
disabled: PropTypes.bool,
|
|
190
203
|
/** Whether to hide the "no TIN issued" checkbox. */
|
|
191
204
|
hideNoTin: PropTypes.bool,
|
|
205
|
+
/** `bordered`: white card with a 20px padding and boxed fields (sign-up redesign). Default keeps the list look. */
|
|
206
|
+
variant: PropTypes.oneOf(["default", "bordered"]),
|
|
192
207
|
/** Per-field error flags: `{ country, tin }`. */
|
|
193
208
|
error: PropTypes.shape({
|
|
194
209
|
country: PropTypes.bool,
|
|
@@ -1,7 +1,9 @@
|
|
|
1
|
+
import { FieldVariant } from '../../styles/borderedField';
|
|
1
2
|
export declare const CardWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
2
3
|
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
3
4
|
}, {
|
|
4
5
|
isOpen?: boolean;
|
|
6
|
+
$variant?: FieldVariant;
|
|
5
7
|
}>> & string;
|
|
6
8
|
/**
|
|
7
9
|
* Header is a click target, but it CANNOT be a real `<button>` because we
|
|
@@ -13,25 +15,34 @@ export declare const CardHeader: import('styled-components/dist/types').IStyledC
|
|
|
13
15
|
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
14
16
|
}, {
|
|
15
17
|
isOpen?: boolean;
|
|
18
|
+
$variant?: FieldVariant;
|
|
16
19
|
}>> & string;
|
|
17
20
|
/**
|
|
18
21
|
* Slot in front of the title. Has no intrinsic size of its own — children
|
|
19
22
|
* (flag wrapper or globe SVG) define their own dimensions so each icon keeps
|
|
20
23
|
* its natural aspect ratio (3:2 for flags, 1:1 for the globe).
|
|
21
24
|
*/
|
|
22
|
-
export declare const HeaderIcon: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "style"> & {
|
|
25
|
+
export declare const HeaderIcon: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "style"> & {
|
|
23
26
|
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
24
|
-
}
|
|
27
|
+
}, {
|
|
28
|
+
$variant?: FieldVariant;
|
|
29
|
+
}>> & string;
|
|
25
30
|
/** 3:2 frame for country flags so they line up across rows. */
|
|
26
|
-
export declare const FlagWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "style"> & {
|
|
31
|
+
export declare const FlagWrapper: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "style"> & {
|
|
27
32
|
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
28
|
-
}
|
|
29
|
-
|
|
33
|
+
}, {
|
|
34
|
+
$variant?: FieldVariant;
|
|
35
|
+
}>> & string;
|
|
36
|
+
export declare const HeaderTitle: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "style"> & {
|
|
30
37
|
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
31
|
-
}
|
|
32
|
-
|
|
38
|
+
}, {
|
|
39
|
+
$variant?: FieldVariant;
|
|
40
|
+
}>> & string;
|
|
41
|
+
export declare const HeaderActions: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
33
42
|
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
34
|
-
}
|
|
43
|
+
}, {
|
|
44
|
+
$variant?: FieldVariant;
|
|
45
|
+
}>> & string;
|
|
35
46
|
/**
|
|
36
47
|
* Plain icon button hosting an inline-SVG <TrashIcon>: the screenshot calls for a thin outline
|
|
37
48
|
* trash, which we draw ourselves to keep stroke weight and metrics consistent with the globe icon.
|
|
@@ -43,15 +54,21 @@ export declare const ChevronIcon: import('styled-components/dist/types').IStyled
|
|
|
43
54
|
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
44
55
|
}, {
|
|
45
56
|
isOpen?: boolean;
|
|
57
|
+
$variant?: FieldVariant;
|
|
46
58
|
}>, "children"> & Partial<Pick<import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLSpanElement>, HTMLSpanElement>, "style"> & {
|
|
47
59
|
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
48
60
|
}, {
|
|
49
61
|
isOpen?: boolean;
|
|
62
|
+
$variant?: FieldVariant;
|
|
50
63
|
}>, "children">>> & string;
|
|
51
64
|
export declare const CardBodyCollapse: any;
|
|
52
|
-
export declare const CardBody: import('styled-components/dist/types').IStyledComponentBase<"web", Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
65
|
+
export declare const CardBody: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
53
66
|
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
54
|
-
}
|
|
55
|
-
|
|
67
|
+
}, {
|
|
68
|
+
$variant?: FieldVariant;
|
|
69
|
+
}>> & string;
|
|
70
|
+
export declare const CheckboxRow: import('styled-components/dist/types').IStyledComponentBase<"web", import('styled-components/dist/types').Merged<Omit<import('react').DetailedHTMLProps<import('react').HTMLAttributes<HTMLDivElement>, HTMLDivElement>, "style"> & {
|
|
56
71
|
style?: import('react').CSSProperties | import('styled-components/dist/types').CSSPropertiesWithVars;
|
|
57
|
-
}
|
|
72
|
+
}, {
|
|
73
|
+
$variant?: FieldVariant;
|
|
74
|
+
}>> & string;
|
|
@@ -1,8 +1,12 @@
|
|
|
1
1
|
import styled, { css } from "styled-components";
|
|
2
2
|
import { Collapse } from "react-collapse";
|
|
3
3
|
import { glyph } from "../MaterialIcon/glyph.js";
|
|
4
|
+
import { BORDERED_BORDER } from "../../styles/borderedField.js";
|
|
5
|
+
import { text } from "../../design-system/styled/text.js";
|
|
6
|
+
const bordered = (rules) => (props) => props.$variant === "bordered" && rules;
|
|
7
|
+
const NOT_FORWARDED = ["isOpen", "$variant"];
|
|
4
8
|
const CardWrapper = styled.div.withConfig({
|
|
5
|
-
shouldForwardProp: (prop) => !
|
|
9
|
+
shouldForwardProp: (prop) => !NOT_FORWARDED.includes(prop)
|
|
6
10
|
})`
|
|
7
11
|
background: var(--stokr-background-default);
|
|
8
12
|
border: 1px solid var(--stokr-border-subtle);
|
|
@@ -17,12 +21,21 @@ const CardWrapper = styled.div.withConfig({
|
|
|
17
21
|
box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
|
|
18
22
|
`}
|
|
19
23
|
|
|
24
|
+
${bordered(css`
|
|
25
|
+
padding: var(--stokr-space-5);
|
|
26
|
+
border: ${BORDERED_BORDER};
|
|
27
|
+
border-radius: var(--stokr-radius-lg);
|
|
28
|
+
background: var(--stokr-background-default);
|
|
29
|
+
box-shadow: var(--stokr-elevation-md);
|
|
30
|
+
overflow: visible;
|
|
31
|
+
`)}
|
|
32
|
+
|
|
20
33
|
& + & {
|
|
21
34
|
margin-top: 12px;
|
|
22
35
|
}
|
|
23
36
|
`;
|
|
24
37
|
const CardHeader = styled.div.withConfig({
|
|
25
|
-
shouldForwardProp: (prop) => !
|
|
38
|
+
shouldForwardProp: (prop) => !NOT_FORWARDED.includes(prop)
|
|
26
39
|
})`
|
|
27
40
|
display: flex;
|
|
28
41
|
align-items: center;
|
|
@@ -45,6 +58,21 @@ const CardHeader = styled.div.withConfig({
|
|
|
45
58
|
&:focus-visible {
|
|
46
59
|
box-shadow: inset 0 0 0 2px var(--stokr-color-blue-500);
|
|
47
60
|
}
|
|
61
|
+
|
|
62
|
+
${bordered(css`
|
|
63
|
+
padding: 0;
|
|
64
|
+
|
|
65
|
+
&:hover {
|
|
66
|
+
background-color: transparent;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
&:focus-visible {
|
|
70
|
+
box-shadow: none;
|
|
71
|
+
outline: 2px solid var(--stokr-border-focus);
|
|
72
|
+
outline-offset: 4px;
|
|
73
|
+
border-radius: var(--stokr-radius-sm);
|
|
74
|
+
}
|
|
75
|
+
`)}
|
|
48
76
|
`;
|
|
49
77
|
const HeaderIcon = styled.span`
|
|
50
78
|
display: inline-flex;
|
|
@@ -54,8 +82,14 @@ const HeaderIcon = styled.span`
|
|
|
54
82
|
margin-right: 16px;
|
|
55
83
|
flex-shrink: 0;
|
|
56
84
|
color: var(--stokr-text-primary);
|
|
85
|
+
|
|
86
|
+
${bordered(css`
|
|
87
|
+
margin-right: var(--stokr-space-3);
|
|
88
|
+
`)}
|
|
57
89
|
`;
|
|
58
|
-
const FlagWrapper = styled.span
|
|
90
|
+
const FlagWrapper = styled.span.withConfig({
|
|
91
|
+
shouldForwardProp: (prop) => !NOT_FORWARDED.includes(prop)
|
|
92
|
+
})`
|
|
59
93
|
display: inline-flex;
|
|
60
94
|
width: 24px;
|
|
61
95
|
height: 18px;
|
|
@@ -69,8 +103,14 @@ const FlagWrapper = styled.span`
|
|
|
69
103
|
object-fit: cover;
|
|
70
104
|
display: block;
|
|
71
105
|
}
|
|
106
|
+
|
|
107
|
+
${bordered(css`
|
|
108
|
+
height: 20px;
|
|
109
|
+
`)}
|
|
72
110
|
`;
|
|
73
|
-
const HeaderTitle = styled.span
|
|
111
|
+
const HeaderTitle = styled.span.withConfig({
|
|
112
|
+
shouldForwardProp: (prop) => !NOT_FORWARDED.includes(prop)
|
|
113
|
+
})`
|
|
74
114
|
flex: 1;
|
|
75
115
|
min-width: 0;
|
|
76
116
|
font-family: var(--stokr-font-family-base);
|
|
@@ -83,13 +123,25 @@ const HeaderTitle = styled.span`
|
|
|
83
123
|
white-space: nowrap;
|
|
84
124
|
overflow: hidden;
|
|
85
125
|
text-overflow: ellipsis;
|
|
126
|
+
|
|
127
|
+
${bordered(css`
|
|
128
|
+
${text("subtitleS")}
|
|
129
|
+
text-transform: none;
|
|
130
|
+
color: var(--stokr-text-primary);
|
|
131
|
+
`)}
|
|
86
132
|
`;
|
|
87
|
-
const HeaderActions = styled.div
|
|
133
|
+
const HeaderActions = styled.div.withConfig({
|
|
134
|
+
shouldForwardProp: (prop) => !NOT_FORWARDED.includes(prop)
|
|
135
|
+
})`
|
|
88
136
|
display: flex;
|
|
89
137
|
align-items: center;
|
|
90
138
|
gap: 14px;
|
|
91
139
|
margin-left: 12px;
|
|
92
140
|
flex-shrink: 0;
|
|
141
|
+
|
|
142
|
+
${bordered(css`
|
|
143
|
+
gap: var(--stokr-space-3);
|
|
144
|
+
`)}
|
|
93
145
|
`;
|
|
94
146
|
const DeleteButton = styled.button`
|
|
95
147
|
display: inline-flex;
|
|
@@ -128,7 +180,7 @@ const DeleteButton = styled.button`
|
|
|
128
180
|
}
|
|
129
181
|
`;
|
|
130
182
|
const ChevronIcon = styled.span.withConfig({
|
|
131
|
-
shouldForwardProp: (prop) => !
|
|
183
|
+
shouldForwardProp: (prop) => !NOT_FORWARDED.includes(prop)
|
|
132
184
|
}).attrs({
|
|
133
185
|
children: glyph("keyboard_arrow_down")
|
|
134
186
|
})`
|
|
@@ -142,18 +194,44 @@ const ChevronIcon = styled.span.withConfig({
|
|
|
142
194
|
${(props) => props.isOpen && css`
|
|
143
195
|
transform: rotate(180deg);
|
|
144
196
|
`}
|
|
197
|
+
|
|
198
|
+
${bordered(css`
|
|
199
|
+
font-size: 16px;
|
|
200
|
+
`)}
|
|
145
201
|
`;
|
|
146
|
-
const CardBodyCollapse = styled(Collapse)
|
|
202
|
+
const CardBodyCollapse = styled(Collapse).withConfig({
|
|
203
|
+
shouldForwardProp: (prop) => !NOT_FORWARDED.includes(prop)
|
|
204
|
+
})`
|
|
147
205
|
border-top: 1px solid var(--stokr-border-subtle);
|
|
206
|
+
|
|
207
|
+
${bordered(css`
|
|
208
|
+
border-top: 0;
|
|
209
|
+
`)}
|
|
148
210
|
`;
|
|
149
211
|
const CardBody = styled.div`
|
|
150
212
|
display: flex;
|
|
151
213
|
flex-direction: column;
|
|
152
214
|
gap: 26px;
|
|
153
215
|
padding: 24px 22px 20px;
|
|
216
|
+
|
|
217
|
+
${bordered(css`
|
|
218
|
+
gap: var(--stokr-space-8);
|
|
219
|
+
padding: var(--stokr-space-8) 0 0;
|
|
220
|
+
|
|
221
|
+
/* Figma labels the card's fields 14/20; the shared bordered label is 12/16. */
|
|
222
|
+
& > * > label {
|
|
223
|
+
font-size: 14px;
|
|
224
|
+
line-height: 20px;
|
|
225
|
+
letter-spacing: 0.5px;
|
|
226
|
+
}
|
|
227
|
+
`)}
|
|
154
228
|
`;
|
|
155
229
|
const CheckboxRow = styled.div`
|
|
156
230
|
padding-top: 4px;
|
|
231
|
+
|
|
232
|
+
${bordered(css`
|
|
233
|
+
padding-top: 0;
|
|
234
|
+
`)}
|
|
157
235
|
`;
|
|
158
236
|
export {
|
|
159
237
|
CardBody,
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import liquid from "../static/images/chains/liquid.svg.js";
|
|
2
|
+
import ethereum from "../static/images/chains/ethereum.svg.js";
|
|
3
|
+
import stellar from "../static/images/chains/stellar.svg.js";
|
|
4
|
+
import solana from "../static/images/chains/solana.svg.js";
|
|
5
|
+
import tempo from "../static/images/chains/tempo.svg.js";
|
|
6
|
+
import avalanche from "../static/images/chains/avalanche.svg.js";
|
|
7
|
+
const chainLogos = {
|
|
8
|
+
liquid,
|
|
9
|
+
ethereum,
|
|
10
|
+
stellar,
|
|
11
|
+
solana,
|
|
12
|
+
tempo,
|
|
13
|
+
avalanche
|
|
14
|
+
};
|
|
15
|
+
export {
|
|
16
|
+
chainLogos
|
|
17
|
+
};
|