@thecb/components 8.4.11-beta.9 → 8.4.11
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/index.cjs.js +215 -177
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +215 -177
- package/dist/index.esm.js.map +1 -1
- package/package.json +1 -1
- package/src/components/atoms/alert/Alert.js +0 -1
- package/src/components/atoms/checkbox/Checkbox.js +1 -1
- package/src/components/atoms/country-dropdown/CountryDropdown.js +1 -3
- package/src/components/atoms/country-dropdown/CountryDropdown.stories.js +0 -2
- package/src/components/atoms/dropdown/Dropdown.js +14 -13
- package/src/components/atoms/form-layouts/FormInput.js +13 -7
- package/src/components/atoms/form-select/FormSelect.js +22 -18
- package/src/components/molecules/address-form/AddressForm.js +3 -12
- package/src/components/molecules/payment-details/PaymentDetails.js +36 -16
- package/dist/src/apps/checkout/pages/payment/sub-pages/payment-amount/PaymentAmount_old.js +0 -49322
- package/src/.DS_Store +0 -0
- package/src/components/.DS_Store +0 -0
- package/src/components/atoms/.DS_Store +0 -0
- package/src/components/atoms/icons/.DS_Store +0 -0
package/package.json
CHANGED
|
@@ -9,8 +9,7 @@ const CountryDropdown = ({
|
|
|
9
9
|
field,
|
|
10
10
|
fieldActions,
|
|
11
11
|
showErrors,
|
|
12
|
-
onChange
|
|
13
|
-
...rest
|
|
12
|
+
onChange
|
|
14
13
|
}) => (
|
|
15
14
|
<FormSelect
|
|
16
15
|
options={options}
|
|
@@ -21,7 +20,6 @@ const CountryDropdown = ({
|
|
|
21
20
|
showErrors={showErrors}
|
|
22
21
|
onChange={onChange}
|
|
23
22
|
autocompleteValue="country-name"
|
|
24
|
-
{...rest}
|
|
25
23
|
/>
|
|
26
24
|
);
|
|
27
25
|
export default CountryDropdown;
|
|
@@ -26,8 +26,6 @@ const story = page({
|
|
|
26
26
|
const CountryFormWrapper = ({ fields, actions }) => (
|
|
27
27
|
<Box minHeight="300px">
|
|
28
28
|
<CountryDropdown
|
|
29
|
-
aria-label="Country"
|
|
30
|
-
labelTextWhenNoError="Country"
|
|
31
29
|
errorMessages={errorMessages}
|
|
32
30
|
options={options}
|
|
33
31
|
field={fields.country}
|
|
@@ -288,13 +288,14 @@ const Dropdown = ({
|
|
|
288
288
|
as="input"
|
|
289
289
|
aria-multiline="false"
|
|
290
290
|
aria-autocomplete="list"
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
291
|
+
aria-controls={`${ariaLabelledby}_listbox`}
|
|
292
|
+
aria-activedescendant="focused_option"
|
|
293
|
+
aria-owns={`${ariaLabelledby}_listbox`}
|
|
294
294
|
aria-haspopup="listbox"
|
|
295
295
|
aria-labelledby={ariaLabelledby}
|
|
296
296
|
aria-describedby={ariaDescribedby}
|
|
297
|
-
|
|
297
|
+
aria-expanded={isOpen}
|
|
298
|
+
autocomplete={autocompleteValue}
|
|
298
299
|
background={isOpen ? themeValues.hoverColor : WHITE}
|
|
299
300
|
borderRadius="2px"
|
|
300
301
|
borderSize="1px"
|
|
@@ -315,7 +316,6 @@ const Dropdown = ({
|
|
|
315
316
|
minHeight="48px"
|
|
316
317
|
minWidth="100%"
|
|
317
318
|
name={autocompleteValue}
|
|
318
|
-
// aria-expanded={isOpen}
|
|
319
319
|
onChange={e => {
|
|
320
320
|
// support autofill and copy/paste
|
|
321
321
|
if (e.target.value !== inputValue) {
|
|
@@ -325,6 +325,7 @@ const Dropdown = ({
|
|
|
325
325
|
}}
|
|
326
326
|
padding="12px"
|
|
327
327
|
placeholder={getSelection()}
|
|
328
|
+
role="combobox"
|
|
328
329
|
themeValues={themeValues}
|
|
329
330
|
title={hasTitles ? getSelection() : null}
|
|
330
331
|
type="text"
|
|
@@ -390,14 +391,14 @@ const Dropdown = ({
|
|
|
390
391
|
: MINESHAFT_GREY
|
|
391
392
|
}
|
|
392
393
|
extraStyles={`padding-left: 16px;
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
394
|
+
cursor: ${
|
|
395
|
+
disabledValues.includes(choice.value)
|
|
396
|
+
? "default"
|
|
397
|
+
: "pointer"
|
|
398
|
+
};
|
|
399
|
+
white-space: nowrap;
|
|
400
|
+
overflow: hidden;
|
|
401
|
+
text-overflow: ellipsis;`}
|
|
401
402
|
>
|
|
402
403
|
{choice.text}
|
|
403
404
|
</Text>
|
|
@@ -127,7 +127,7 @@ const FormInput = ({
|
|
|
127
127
|
};
|
|
128
128
|
|
|
129
129
|
return (
|
|
130
|
-
<Stack childGap="0.25rem"
|
|
130
|
+
<Stack childGap="0.25rem">
|
|
131
131
|
<Box padding="0">
|
|
132
132
|
{helperModal ? (
|
|
133
133
|
<Cluster justify="space-between" align="center">
|
|
@@ -194,11 +194,14 @@ const FormInput = ({
|
|
|
194
194
|
</Box>
|
|
195
195
|
)}
|
|
196
196
|
</Box>
|
|
197
|
-
<Box padding="0"
|
|
197
|
+
<Box padding="0">
|
|
198
198
|
{formatter ? (
|
|
199
199
|
<FormattedInputField
|
|
200
200
|
aria-labelledby={createIdFromString(labelTextWhenNoError)}
|
|
201
|
-
aria-describedby={createIdFromString(
|
|
201
|
+
aria-describedby={createIdFromString(
|
|
202
|
+
labelTextWhenNoError,
|
|
203
|
+
"error message"
|
|
204
|
+
)}
|
|
202
205
|
aria-invalid={
|
|
203
206
|
(field.dirty && field.hasErrors) ||
|
|
204
207
|
(field.hasErrors && showErrors)
|
|
@@ -215,13 +218,16 @@ const FormInput = ({
|
|
|
215
218
|
themeValues={themeValues}
|
|
216
219
|
$customHeight={customHeight}
|
|
217
220
|
$extraStyles={extraStyles}
|
|
218
|
-
|
|
221
|
+
autoComplete={autocomplete}
|
|
219
222
|
{...props}
|
|
220
223
|
/>
|
|
221
224
|
) : (
|
|
222
225
|
<InputField
|
|
223
226
|
aria-labelledby={createIdFromString(labelTextWhenNoError)}
|
|
224
|
-
aria-describedby={createIdFromString(
|
|
227
|
+
aria-describedby={createIdFromString(
|
|
228
|
+
labelTextWhenNoError,
|
|
229
|
+
"error message"
|
|
230
|
+
)}
|
|
225
231
|
aria-invalid={
|
|
226
232
|
(field.dirty && field.hasErrors) ||
|
|
227
233
|
(field.hasErrors && showErrors)
|
|
@@ -238,12 +244,12 @@ const FormInput = ({
|
|
|
238
244
|
background={background}
|
|
239
245
|
$customHeight={customHeight}
|
|
240
246
|
$extraStyles={extraStyles}
|
|
241
|
-
|
|
247
|
+
autoComplete={autocomplete}
|
|
242
248
|
{...props}
|
|
243
249
|
/>
|
|
244
250
|
)}
|
|
245
251
|
</Box>
|
|
246
|
-
<Stack direction="row" justify="space-between"
|
|
252
|
+
<Stack direction="row" justify="space-between" aria-live="polite">
|
|
247
253
|
{(field.hasErrors && field.dirty) || (field.hasErrors && showErrors) ? (
|
|
248
254
|
<Text
|
|
249
255
|
color={ERROR_COLOR}
|
|
@@ -62,7 +62,10 @@ const FormSelect = ({
|
|
|
62
62
|
</Box>
|
|
63
63
|
<Dropdown
|
|
64
64
|
ariaLabelledby={createIdFromString(labelTextWhenNoError)}
|
|
65
|
-
ariaDescribedby={createIdFromString(
|
|
65
|
+
ariaDescribedby={createIdFromString(
|
|
66
|
+
labelTextWhenNoError,
|
|
67
|
+
"error message"
|
|
68
|
+
)}
|
|
66
69
|
maxHeight={dropdownMaxHeight}
|
|
67
70
|
hasTitles={hasTitles}
|
|
68
71
|
placeholder={options[0] ? options[0].text : ""}
|
|
@@ -80,24 +83,25 @@ const FormSelect = ({
|
|
|
80
83
|
disabled={disabled}
|
|
81
84
|
autocompleteValue={autocompleteValue}
|
|
82
85
|
smoothScroll={smoothScroll}
|
|
83
|
-
required={options.required}
|
|
84
86
|
/>
|
|
85
|
-
<Stack direction="row" justify="space-between"
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
87
|
+
<Stack direction="row" justify="space-between" aria-live="polite">
|
|
88
|
+
{(field.hasErrors && field.dirty) || (field.hasErrors && showErrors) ? (
|
|
89
|
+
<Text
|
|
90
|
+
color={ERROR_COLOR}
|
|
91
|
+
variant="pXS"
|
|
92
|
+
weight={themeValues.fontWeight}
|
|
93
|
+
extraStyles={`word-break: break-word;
|
|
94
|
+
font-family: Public Sans;
|
|
95
|
+
&::first-letter {
|
|
96
|
+
text-transform: uppercase;
|
|
97
|
+
}`}
|
|
98
|
+
id={createIdFromString(labelTextWhenNoError, "error message")}
|
|
99
|
+
>
|
|
100
|
+
{errorMessages[field.errors[0]]}
|
|
101
|
+
</Text>
|
|
102
|
+
) : (
|
|
103
|
+
<Text extraStyles={`height: ${themeValues.lineHeight};`} />
|
|
104
|
+
)}
|
|
101
105
|
</Stack>
|
|
102
106
|
</SelectContainer>
|
|
103
107
|
);
|
|
@@ -64,18 +64,15 @@ const AddressForm = ({
|
|
|
64
64
|
}
|
|
65
65
|
}}
|
|
66
66
|
showErrors={showErrors}
|
|
67
|
-
aria-label="Country"
|
|
68
67
|
/>
|
|
69
68
|
<FormInput
|
|
70
69
|
labelTextWhenNoError="Address"
|
|
71
70
|
errorMessages={street1ErrorMessages}
|
|
72
|
-
required={true}
|
|
73
71
|
field={fields.street1}
|
|
74
72
|
fieldActions={actions.fields.street1}
|
|
75
73
|
showErrors={showErrors}
|
|
76
74
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
77
75
|
autocomplete="address-line1"
|
|
78
|
-
aria-label="Address Line 1"
|
|
79
76
|
/>
|
|
80
77
|
<FormInput
|
|
81
78
|
labelTextWhenNoError="Apt, Suite, Unit, Floor, etc. (Optional)"
|
|
@@ -84,18 +81,15 @@ const AddressForm = ({
|
|
|
84
81
|
showErrors={showErrors}
|
|
85
82
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
86
83
|
autocomplete="address-line2"
|
|
87
|
-
aria-label="Address Line 2"
|
|
88
84
|
/>
|
|
89
85
|
<FormInput
|
|
90
86
|
labelTextWhenNoError="City"
|
|
91
|
-
required={true}
|
|
92
87
|
errorMessages={cityErrorMessages}
|
|
93
88
|
field={fields.city}
|
|
94
89
|
fieldActions={actions.fields.city}
|
|
95
90
|
showErrors={showErrors}
|
|
96
91
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
97
|
-
autocomplete="
|
|
98
|
-
aria-label="City"
|
|
92
|
+
autocomplete="address-level2"
|
|
99
93
|
/>
|
|
100
94
|
<StateProvinceDropdown
|
|
101
95
|
labelTextWhenNoError={isUS ? "State" : "State or Province"}
|
|
@@ -105,8 +99,7 @@ const AddressForm = ({
|
|
|
105
99
|
fieldActions={actions.fields.stateProvince}
|
|
106
100
|
showErrors={showErrors}
|
|
107
101
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
108
|
-
|
|
109
|
-
required={true}
|
|
102
|
+
autocomplete="address-level1"
|
|
110
103
|
/>
|
|
111
104
|
<FormInput
|
|
112
105
|
isNum={isUS}
|
|
@@ -117,14 +110,12 @@ const AddressForm = ({
|
|
|
117
110
|
fieldActions={actions.fields.zip}
|
|
118
111
|
showErrors={showErrors}
|
|
119
112
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
120
|
-
aria-label="zip code"
|
|
121
113
|
autocomplete="postal-code"
|
|
122
|
-
required={true}
|
|
123
114
|
/>
|
|
124
115
|
{showWalletCheckbox && (
|
|
125
116
|
<Checkbox
|
|
126
117
|
name="address checkbox"
|
|
127
|
-
title="Save address to
|
|
118
|
+
title="Save address to wallet"
|
|
128
119
|
checked={walletCheckboxMarked}
|
|
129
120
|
onChange={saveToWallet}
|
|
130
121
|
/>
|
|
@@ -13,6 +13,7 @@ import { displayCurrency } from "../../../util/general";
|
|
|
13
13
|
import { themeComponent } from "../../../util/themeUtils";
|
|
14
14
|
import CollapsibleSection from "../collapsible-section";
|
|
15
15
|
|
|
16
|
+
import LoadingLine from "../../atoms/loading-line";
|
|
16
17
|
import LabeledAmount from "../../atoms/labeled-amount";
|
|
17
18
|
import LineItem from "../../atoms/line-item";
|
|
18
19
|
import Title from "../../atoms/title";
|
|
@@ -120,22 +121,41 @@ const PaymentDetailsContent = ({
|
|
|
120
121
|
);
|
|
121
122
|
|
|
122
123
|
const LoadingDetails = () => (
|
|
123
|
-
<Box
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
124
|
+
<Box padding="0" minHeight="196px">
|
|
125
|
+
<Box
|
|
126
|
+
padding="0"
|
|
127
|
+
extraStyles={`position: absolute;
|
|
128
|
+
height: 200px;
|
|
129
|
+
width: 100%;
|
|
130
|
+
display: flex;
|
|
131
|
+
justify-content: center;
|
|
132
|
+
align-items: center;`}
|
|
133
|
+
>
|
|
134
|
+
<Spinner size="100" centerSpinner />
|
|
135
|
+
</Box>
|
|
136
|
+
<Stack childGap="16px">
|
|
137
|
+
<Cluster nowrap justify="space-between" align="start">
|
|
138
|
+
<LoadingLine exactWidth="110" height="27px" />
|
|
139
|
+
<LoadingLine exactWidth="60" height="27px" />
|
|
140
|
+
</Cluster>
|
|
141
|
+
<SolidDivider />
|
|
142
|
+
<Box padding="0.5rem 0">
|
|
143
|
+
<Cluster justify="space-between" align="start">
|
|
144
|
+
<LoadingLine exactWidth="80" height="27px" />
|
|
145
|
+
<LoadingLine exactWidth="60" height="27px" />
|
|
146
|
+
</Cluster>
|
|
147
|
+
<Box padding="4px 0" />
|
|
148
|
+
<Cluster justify="space-between" align="start">
|
|
149
|
+
<LoadingLine exactWidth="100" height="27px" />
|
|
150
|
+
<LoadingLine exactWidth="50" height="27px" />
|
|
151
|
+
</Cluster>
|
|
152
|
+
</Box>
|
|
153
|
+
<SolidDivider />
|
|
154
|
+
<Stack justify="space-between" direction="row">
|
|
155
|
+
<LoadingLine exactWidth="55" height="30px" />
|
|
156
|
+
<LoadingLine exactWidth="70" height="30px" />
|
|
157
|
+
</Stack>
|
|
158
|
+
</Stack>
|
|
139
159
|
</Box>
|
|
140
160
|
);
|
|
141
161
|
|