@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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@thecb/components",
3
- "version": "8.4.11-beta.8",
3
+ "version": "8.4.11",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -92,7 +92,6 @@ const Alert = ({
92
92
  borderSize={noBorder ? "0px" : "1px"}
93
93
  boxShadow={enableBoxShadow ? generateShadows()?.inset?.base : ""}
94
94
  extraStyles={extraStyles}
95
- role="alert"
96
95
  >
97
96
  {maxContentWidth ? (
98
97
  <Center maxWidth={maxContentWidth}>{content}</Center>
@@ -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
- autoComplete={autocompleteValue}
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
- cursor: ${
394
- disabledValues.includes(choice.value)
395
- ? "default"
396
- : "pointer"
397
- };
398
- white-space: nowrap;
399
- overflow: hidden;
400
- text-overflow: ellipsis;`}
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" aria-live="assertive">
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" aria-live="assertive">
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-role="alert">
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-role="alert">
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
- {(field.hasErrors && field.dirty) || (field.hasErrors && showErrors)
101
- ? errorMessages[field.errors[0]]
102
- : ""}
103
- </Text>
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="city"
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
- autoComplete="administrative-area"
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 Wallet"
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
- padding="0"
125
- background={GRECIAN_GREY}
126
- borderRadius="4px"
127
- minHeight="196px"
128
- >
129
- <Cover minHeight="196px" singleChild fillCenter>
130
- <Center intrinsic>
131
- <Box
132
- padding="0"
133
- extraStyles={`flex-grow: 1; display: flex; justify-content: center; align-items: center;`}
134
- >
135
- <Spinner size="100" centerSpinner />
136
- </Box>
137
- </Center>
138
- </Cover>
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