@comicrelief/storybook 2.5.0 → 2.5.3
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
|
@@ -171,7 +171,7 @@ class MarketingConsentCheckbox extends Component {
|
|
|
171
171
|
<div id={`field-wrapper--${item.name}`} className="form__field--wrapper" >
|
|
172
172
|
{
|
|
173
173
|
item.options.map(option => (
|
|
174
|
-
<div key={option.value} className=
|
|
174
|
+
<div key={option.value} className={`form__field--wrapper form__checkbox form__checkbox--inline form__checkbox--inline-2-horizontal ${option.disabled && 'disabled'}`}>
|
|
175
175
|
<label className="form__field-label required" htmlFor={`field-label--${option.label}--${item.name}`} aria-label={`Can we contact you by ${item.name}?`}>
|
|
176
176
|
{option.label}
|
|
177
177
|
</label>
|
|
@@ -179,7 +179,7 @@ class MarketingConsentCheckbox extends Component {
|
|
|
179
179
|
<input
|
|
180
180
|
type="checkbox"
|
|
181
181
|
id={`field-label--${option.label}--${item.name}`}
|
|
182
|
-
className=
|
|
182
|
+
className={'form__field form__field--checkbox'}
|
|
183
183
|
name={option.name}
|
|
184
184
|
value={option.value}
|
|
185
185
|
onChange={e => this.handleCheckboxToggle(item, option, e)}
|
|
@@ -187,6 +187,7 @@ class MarketingConsentCheckbox extends Component {
|
|
|
187
187
|
ariarole="checkbox"
|
|
188
188
|
aria-label={`field-label--${option.label}--${item.name}`}
|
|
189
189
|
aria-checked={this.state.checkboxValidation[checkbox].value === option.value}
|
|
190
|
+
disabled={option.disabled}
|
|
190
191
|
/>
|
|
191
192
|
<span />
|
|
192
193
|
</div>
|
|
@@ -407,6 +407,9 @@ class PostcodeLookup extends Component {
|
|
|
407
407
|
*/
|
|
408
408
|
render() {
|
|
409
409
|
const isBrowser = browser();
|
|
410
|
+
|
|
411
|
+
const isChrome = isBrowser.name === 'chrome';
|
|
412
|
+
|
|
410
413
|
const postCodeField = {
|
|
411
414
|
id: 'postcode',
|
|
412
415
|
type: 'text',
|
|
@@ -417,15 +420,15 @@ class PostcodeLookup extends Component {
|
|
|
417
420
|
invalidErrorText: this.state.currentPostcodeValidation.errorMsg,
|
|
418
421
|
emptyFieldErrorText: 'Please enter your postcode',
|
|
419
422
|
extraClass: 'search-box',
|
|
420
|
-
autoComplete:
|
|
423
|
+
autoComplete: isChrome ? 'new-postcode' : 'off',
|
|
421
424
|
};
|
|
422
425
|
const addressPattern = /^[A-Za-z0-9]+[ _.'/&\w-]*$/;
|
|
423
426
|
const addressErrorMessage = 'This field only accepts alphanumeric characters and \' . - & _ /';
|
|
424
427
|
const addressOutputFields = [
|
|
425
|
-
{ id: 'address1', type: 'text', label: 'Address line 1', required: true, pattern: addressPattern, invalidErrorText: addressErrorMessage },
|
|
426
|
-
{ id: 'address2', type: 'text', label: 'Address line 2', required: false, pattern: addressPattern, invalidErrorText: addressErrorMessage },
|
|
427
|
-
{ id: 'address3', type: 'text', label: 'Address line 3', required: false, pattern: addressPattern, invalidErrorText: addressErrorMessage },
|
|
428
|
-
{ id: 'town', type: 'text', label: 'Town/City', required: true, pattern: addressPattern, invalidErrorText: addressErrorMessage },
|
|
428
|
+
{ id: 'address1', type: 'text', label: 'Address line 1', required: true, pattern: addressPattern, invalidErrorText: addressErrorMessage, autoComplete: isChrome ? 'new-address-1' : 'off' },
|
|
429
|
+
{ id: 'address2', type: 'text', label: 'Address line 2', required: false, pattern: addressPattern, invalidErrorText: addressErrorMessage, autoComplete: isChrome ? 'new-address-2' : 'off' },
|
|
430
|
+
{ id: 'address3', type: 'text', label: 'Address line 3', required: false, pattern: addressPattern, invalidErrorText: addressErrorMessage, autoComplete: isChrome ? 'new-address-3' : 'off' },
|
|
431
|
+
{ id: 'town', type: 'text', label: 'Town/City', required: true, pattern: addressPattern, invalidErrorText: addressErrorMessage, autoComplete: isChrome ? 'new-town' : 'off' },
|
|
429
432
|
];
|
|
430
433
|
const supportedAriaAttributes = isBrowser.name === 'firefox' && isBrowser.os.match('Windows') ?
|
|
431
434
|
{ 'aria-live': 'assertive', 'aria-relevant': 'additions removals' } : { 'aria-live': 'assertive', role: 'status' };
|