@thecb/components 10.9.0-beta.3 → 10.9.0-beta.4

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": "10.9.0-beta.3",
3
+ "version": "10.9.0-beta.4",
4
4
  "description": "Common lib for CityBase react components",
5
5
  "main": "dist/index.cjs.js",
6
6
  "typings": "dist/index.d.ts",
@@ -11,9 +11,7 @@ const CountryDropdown = ({
11
11
  showErrors,
12
12
  onChange,
13
13
  isRequired = false,
14
- dataQa = null,
15
- htmlFor = null,
16
- inputId = null
14
+ dataQa = null
17
15
  }) => (
18
16
  <FormSelect
19
17
  options={options}
@@ -25,8 +23,6 @@ const CountryDropdown = ({
25
23
  showErrors={showErrors}
26
24
  onChange={onChange}
27
25
  autocompleteValue="country-name"
28
- htmlFor={htmlFor}
29
- inputId={inputId}
30
26
  isRequired={isRequired}
31
27
  />
32
28
  );
@@ -135,8 +135,7 @@ const Dropdown = ({
135
135
  autocompleteValue, // browser autofill value, like country-name
136
136
  smoothScroll = true,
137
137
  ariaInvalid = false,
138
- isRequired = false,
139
- inputId = false
138
+ isRequired = false
140
139
  }) => {
141
140
  const [inputValue, setInputValue] = useState("");
142
141
  const [optionsState, setOptionsState] = useState([]);
@@ -330,7 +329,6 @@ const Dropdown = ({
330
329
  dataQa={`${ariaLabelledby}-dropdown`}
331
330
  >
332
331
  <Box
333
- id={inputId}
334
332
  as="input"
335
333
  autoComplete={autocompleteValue}
336
334
  aria-controls={`${ariaLabelledby}_listbox`}
@@ -117,8 +117,6 @@ const FormInput = ({
117
117
  removeFromValue, // regex of characters to remove before setting value
118
118
  dataQa = null,
119
119
  isRequired = false,
120
- htmlFor = null,
121
- inputId = null,
122
120
  ...props
123
121
  }) => {
124
122
  const [showPassword, setShowPassword] = useState(false);
@@ -156,7 +154,6 @@ const FormInput = ({
156
154
  text-transform: uppercase;
157
155
  }`}
158
156
  id={createIdFromString(labelTextWhenNoError)}
159
- htmlFor={htmlFor}
160
157
  >
161
158
  {labelTextWhenNoError}
162
159
  </Text>
@@ -176,7 +173,6 @@ const FormInput = ({
176
173
  text-transform: uppercase;
177
174
  }`}
178
175
  id={createIdFromString(labelTextWhenNoError)}
179
- htmlFor={htmlFor}
180
176
  >
181
177
  {labelTextWhenNoError}
182
178
  </Text>
@@ -208,7 +204,6 @@ const FormInput = ({
208
204
  <Box padding="0">
209
205
  {formatter ? (
210
206
  <FormattedInputField
211
- id={inputId || props?.id}
212
207
  aria-labelledby={createIdFromString(labelTextWhenNoError)}
213
208
  aria-describedby={createIdFromString(
214
209
  labelTextWhenNoError,
@@ -246,7 +241,6 @@ const FormInput = ({
246
241
  />
247
242
  ) : (
248
243
  <InputField
249
- id={inputId || props?.id}
250
244
  aria-labelledby={createIdFromString(labelTextWhenNoError)}
251
245
  aria-describedby={createIdFromString(
252
246
  labelTextWhenNoError,
@@ -25,9 +25,7 @@ const FormSelect = ({
25
25
  smoothScroll = true, // whether the browser should animate scroll to selected item on first open
26
26
  dataQa = null,
27
27
  widthFitOptions = false,
28
- isRequired = false,
29
- htmlFor = null,
30
- inputId = null
28
+ isRequired = false
31
29
  }) => {
32
30
  const [open, setOpen] = useState(false);
33
31
  const dropdownRef = useRef(null);
@@ -65,14 +63,12 @@ const FormSelect = ({
65
63
  text-transform: uppercase;
66
64
  }`}
67
65
  id={createIdFromString(labelTextWhenNoError)}
68
- htmlFor={htmlFor}
69
66
  >
70
67
  {labelTextWhenNoError}
71
68
  </Text>
72
69
  </Cluster>
73
70
  </Box>
74
71
  <Dropdown
75
- inputId={inputId}
76
72
  ariaLabelledby={createIdFromString(labelTextWhenNoError)}
77
73
  ariaDescribedby={createIdFromString(
78
74
  labelTextWhenNoError,
@@ -24,8 +24,6 @@ export interface FormSelectProps {
24
24
  smoothScroll?: boolean;
25
25
  dataQa?: string | null;
26
26
  widthFitOptions?: boolean;
27
- htmlFor?: string;
28
- inputId?: string;
29
27
  }
30
28
 
31
29
  export const FormSelect: React.FC<Expand<FormSelectProps> &
@@ -27,7 +27,6 @@ export interface BoxProps {
27
27
  extraStyles?: string;
28
28
  srOnly?: boolean;
29
29
  dataQa?: string;
30
- id?: string;
31
30
  }
32
31
 
33
32
  export const Box: React.FC<Expand<BoxProps> &
@@ -46,7 +46,6 @@ const Box = forwardRef(
46
46
  extraStyles,
47
47
  srOnly = false,
48
48
  dataQa,
49
- id,
50
49
  children,
51
50
  ...rest
52
51
  },
@@ -88,7 +87,6 @@ const Box = forwardRef(
88
87
  onBlur={onBlur}
89
88
  onTouchEnd={onTouchEnd}
90
89
  ref={ref}
91
- id={id}
92
90
  {...rest}
93
91
  >
94
92
  {children && safeChildren(children, <Fragment />)}
@@ -10,9 +10,7 @@ const FormStateDropdown = ({
10
10
  fieldActions,
11
11
  showErrors,
12
12
  countryCode,
13
- isRequired = false,
14
- htmlFor = null,
15
- inputId = null
13
+ isRequired = false
16
14
  }) => {
17
15
  const placeholder =
18
16
  countryCode === "US" ? placeHolderOptionUS : placeHolderOption;
@@ -26,8 +24,6 @@ const FormStateDropdown = ({
26
24
  errorMessages={errorMessages}
27
25
  showErrors={showErrors}
28
26
  autocompleteValue="address-level1"
29
- htmlFor={htmlFor}
30
- inputId={inputId}
31
27
  isRequired={isRequired}
32
28
  />
33
29
  );
@@ -10,8 +10,6 @@ export interface TextProps {
10
10
  as?: string;
11
11
  dataQa?: string;
12
12
  variant?: string;
13
- htmlFor?: string;
14
- inputId?: string;
15
13
  }
16
14
 
17
15
  export const Text: React.FC<Expand<TextProps> &
@@ -70,8 +70,6 @@ const AddressForm = ({
70
70
  }
71
71
  }}
72
72
  showErrors={showErrors}
73
- htmlFor="country-name"
74
- inputId="country-name"
75
73
  dataQa="Country"
76
74
  isRequired={true}
77
75
  />
@@ -83,8 +81,6 @@ const AddressForm = ({
83
81
  showErrors={showErrors}
84
82
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
85
83
  autocompleteValue="address-line1"
86
- htmlFor="address-line1"
87
- inputId="address-line1"
88
84
  dataQa="Address"
89
85
  isRequired={true}
90
86
  />
@@ -95,8 +91,6 @@ const AddressForm = ({
95
91
  showErrors={showErrors}
96
92
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
97
93
  autocompleteValue="address-line2"
98
- htmlFor="address-line2"
99
- inputId="address-line2"
100
94
  dataQa="Address Line 2"
101
95
  />
102
96
  <FormInput
@@ -107,8 +101,6 @@ const AddressForm = ({
107
101
  showErrors={showErrors}
108
102
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
109
103
  autocompleteValue="address-level2"
110
- htmlFor="city"
111
- inputId="city"
112
104
  dataQa="City"
113
105
  isRequired={true}
114
106
  />
@@ -120,9 +112,6 @@ const AddressForm = ({
120
112
  fieldActions={actions.fields.stateProvince}
121
113
  showErrors={showErrors}
122
114
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
123
- autocompleteValue="address-level1"
124
- htmlFor="stateOrProvince"
125
- inputId="stateOrProvince"
126
115
  dataQa="State or Province"
127
116
  isRequired={true}
128
117
  />
@@ -136,8 +125,6 @@ const AddressForm = ({
136
125
  showErrors={showErrors}
137
126
  onKeyDown={e => e.key === "Enter" && handleSubmit(e)}
138
127
  autocompleteValue="postal-code"
139
- htmlFor="postal-code"
140
- inputId="postal-code"
141
128
  dataQa="Zip code"
142
129
  isRequired={true}
143
130
  />