@thecb/components 8.4.11-beta.8 → 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 +202 -164
- package/dist/index.cjs.js.map +1 -1
- package/dist/index.esm.js +202 -164
- 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/country-dropdown/CountryDropdown.js +1 -3
- package/src/components/atoms/dropdown/Dropdown.js +10 -9
- package/src/components/atoms/form-layouts/FormInput.js +3 -3
- package/src/components/atoms/form-select/FormSelect.js +18 -17
- 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;
|
|
@@ -295,7 +295,7 @@ const Dropdown = ({
|
|
|
295
295
|
aria-labelledby={ariaLabelledby}
|
|
296
296
|
aria-describedby={ariaDescribedby}
|
|
297
297
|
aria-expanded={isOpen}
|
|
298
|
-
|
|
298
|
+
autocomplete={autocompleteValue}
|
|
299
299
|
background={isOpen ? themeValues.hoverColor : WHITE}
|
|
300
300
|
borderRadius="2px"
|
|
301
301
|
borderSize="1px"
|
|
@@ -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,7 +194,7 @@ 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)}
|
|
@@ -249,7 +249,7 @@ const FormInput = ({
|
|
|
249
249
|
/>
|
|
250
250
|
)}
|
|
251
251
|
</Box>
|
|
252
|
-
<Stack direction="row" justify="space-between" aria-
|
|
252
|
+
<Stack direction="row" justify="space-between" aria-live="polite">
|
|
253
253
|
{(field.hasErrors && field.dirty) || (field.hasErrors && showErrors) ? (
|
|
254
254
|
<Text
|
|
255
255
|
color={ERROR_COLOR}
|
|
@@ -83,24 +83,25 @@ const FormSelect = ({
|
|
|
83
83
|
disabled={disabled}
|
|
84
84
|
autocompleteValue={autocompleteValue}
|
|
85
85
|
smoothScroll={smoothScroll}
|
|
86
|
-
required={options.required}
|
|
87
86
|
/>
|
|
88
|
-
<Stack direction="row" justify="space-between" aria-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
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
|
+
)}
|
|
104
105
|
</Stack>
|
|
105
106
|
</SelectContainer>
|
|
106
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="Apt, Suite, Unit, Floor, etc. (Optional)"
|
|
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,9 +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
|
-
aria-label={isUS ? "state" : "state or province"}
|
|
110
|
-
required={true}
|
|
102
|
+
autocomplete="address-level1"
|
|
111
103
|
/>
|
|
112
104
|
<FormInput
|
|
113
105
|
isNum={isUS}
|
|
@@ -118,13 +110,12 @@ const AddressForm = ({
|
|
|
118
110
|
fieldActions={actions.fields.zip}
|
|
119
111
|
showErrors={showErrors}
|
|
120
112
|
onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
|
|
121
|
-
aria-label="zip code"
|
|
122
113
|
autocomplete="postal-code"
|
|
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
|
|