@cmsgov/design-system-core
Advanced tools
Comparing version 3.2.0 to 3.3.0
@@ -43,2 +43,6 @@ 'use strict'; | ||
_this.headingId = _this.props.headingId || (0, _lodash2.default)('alert_'); | ||
if (!props.heading && !props.children) { | ||
console.error('Empty <Alert> components are not allowed, please use the \'heading\' prop or include children.'); | ||
} | ||
return _this; | ||
@@ -50,7 +54,9 @@ } | ||
value: function heading() { | ||
return _react2.default.createElement( | ||
'h3', | ||
{ className: 'ds-c-alert__heading', id: this.headingId }, | ||
this.props.heading | ||
); | ||
if (this.props.heading) { | ||
return _react2.default.createElement( | ||
'h3', | ||
{ className: 'ds-c-alert__heading', id: this.headingId }, | ||
this.props.heading | ||
); | ||
} | ||
} | ||
@@ -67,3 +73,3 @@ }, { | ||
role: this.props.role, | ||
'aria-labelledby': this.headingId | ||
'aria-labelledby': this.props.heading ? this.headingId : undefined | ||
}, | ||
@@ -87,8 +93,22 @@ _react2.default.createElement( | ||
Alert.propTypes = { | ||
children: _propTypes2.default.node.isRequired, | ||
children: _propTypes2.default.node, | ||
/** | ||
* Text for the alert heading | ||
*/ | ||
heading: _propTypes2.default.string, | ||
/** | ||
* Optional id used to link the `aria-labelledby` attribute to the heading. If not provided, a unique id will be automatically generated and used. | ||
*/ | ||
headingId: _propTypes2.default.string, | ||
/** | ||
* Boolean to hide the `Alert` icon | ||
*/ | ||
hideIcon: _propTypes2.default.bool, | ||
/** ARIA `role` */ | ||
/** | ||
* ARIA `role`, defaults to 'region' | ||
*/ | ||
role: _propTypes2.default.oneOf(['alert', 'alertdialog', 'region']), | ||
/** | ||
* A string corresponding to the `Alert` variation classes (`error`, `warn`, `success`) | ||
*/ | ||
variation: _propTypes2.default.oneOf(['error', 'warn', 'success']) | ||
@@ -95,0 +115,0 @@ }; |
@@ -96,3 +96,2 @@ 'use strict'; | ||
_this.listboxHeadingId = (0, _lodash2.default)('autocomplete_header_'); | ||
_this.loader = null; | ||
return _this; | ||
@@ -165,2 +164,3 @@ } | ||
id: _this3.id, | ||
inputRef: _this3.props.inputRef, | ||
labelId: _this3.labelId, | ||
@@ -314,2 +314,6 @@ onBlur: child.props.onBlur, | ||
/** | ||
* Access a reference to the child `TextField`'s `input` element | ||
*/ | ||
inputRef: _propTypes2.default.func, | ||
/** | ||
* Used to determine the string value for the selected item (which is used to compute the `inputValue`). | ||
@@ -316,0 +320,0 @@ * |
@@ -47,12 +47,18 @@ 'use strict'; | ||
function Button() { | ||
function Button(props) { | ||
_classCallCheck(this, Button); | ||
return _possibleConstructorReturn(this, (Button.__proto__ || Object.getPrototypeOf(Button)).apply(this, arguments)); | ||
var _this = _possibleConstructorReturn(this, (Button.__proto__ || Object.getPrototypeOf(Button)).call(this, props)); | ||
if (props['buttonRef']) { | ||
console.error('[Deprecated]: Please remove the React property \'buttonRef\' for the <Button> component. It is no longer supported and will be removed in a future release, use \'inputRef\' instead'); | ||
} | ||
return _this; | ||
} | ||
// Get an object of props to pass to the rendered <Button> component | ||
_createClass(Button, [{ | ||
key: 'attrs', | ||
// Get an object of props to pass to the rendered <Button> component | ||
value: function attrs() { | ||
@@ -69,2 +75,3 @@ /** | ||
component = _props.component, | ||
inputRef = _props.inputRef, | ||
inverse = _props.inverse, | ||
@@ -75,3 +82,3 @@ onClick = _props.onClick, | ||
buttonRef = _props.buttonRef, | ||
props = _objectWithoutProperties(_props, ['className', 'component', 'inverse', 'onClick', 'size', 'variation', 'buttonRef']); | ||
props = _objectWithoutProperties(_props, ['className', 'component', 'inputRef', 'inverse', 'onClick', 'size', 'variation', 'buttonRef']); | ||
@@ -130,3 +137,5 @@ var attrs = _extends({ | ||
ComponentType, | ||
_extends({ ref: this.props.buttonRef }, attrs), | ||
_extends({ | ||
ref: this.props.inputRef || this.props.buttonRef | ||
}, attrs), | ||
this.props.children | ||
@@ -159,2 +168,6 @@ ); | ||
href: _propTypes2.default.string, | ||
/** | ||
* Access a reference to the `button` or `a` element | ||
*/ | ||
inputRef: _propTypes2.default.func, | ||
/** Applies the inverse theme styling */ | ||
@@ -168,3 +181,3 @@ inverse: _propTypes2.default.bool, | ||
/** | ||
* Access a reference to the `button` or `a` element | ||
* (Deprecated) Access a reference to the `button` or `a` element | ||
*/ | ||
@@ -171,0 +184,0 @@ buttonRef: _propTypes2.default.func, |
@@ -65,2 +65,7 @@ 'use strict'; | ||
if (props['inputPlacement'] === 'right') { | ||
console.error('[Deprecated]: Please remove the React property \'inputPlacement\' for the <Choice> component. It is no longer supported and will be removed in a future release.'); | ||
} | ||
_this.input = null; | ||
_this.handleChange = _this.handleChange.bind(_this); | ||
@@ -168,6 +173,6 @@ _this.id = _this.props.id || (0, _lodash2.default)(_this.props.type + '_' + _this.props.name + '_'); | ||
onChange: this.handleChange, | ||
ref: function ref(input) { | ||
_this2.input = input; | ||
ref: function ref(_ref) { | ||
_this2.input = _ref; | ||
if (inputRef) { | ||
inputRef(input); | ||
inputRef(_ref); | ||
} | ||
@@ -253,3 +258,3 @@ } | ||
/** | ||
* Placement of the input relative to the text label | ||
* (Deprecated) Placement of the input relative to the text label | ||
*/ | ||
@@ -256,0 +261,0 @@ inputPlacement: _propTypes2.default.oneOf(['left', 'right']), |
@@ -328,5 +328,5 @@ 'use strict'; | ||
*/ | ||
type: _propTypes2.default.oneOf(['checkbox', 'radio', 'select']), | ||
type: _propTypes2.default.oneOf(['checkbox', 'radio']), | ||
/** | ||
* Adds `aria-label` attribute if component renders a select | ||
* Adds `aria-label` attribute if component renders a select (deprecated) | ||
*/ | ||
@@ -333,0 +333,0 @@ ariaLabel: _propTypes2.default.string |
@@ -63,2 +63,4 @@ 'use strict'; | ||
} | ||
console.error('[Deprecated] The <Select> component is no longer supported and will be removed in a future release, please use <Dropdown> instead.'); | ||
} | ||
@@ -65,0 +67,0 @@ }, { |
@@ -54,6 +54,11 @@ 'use strict'; | ||
function Dropdown() { | ||
function Dropdown(props) { | ||
_classCallCheck(this, Dropdown); | ||
return _possibleConstructorReturn(this, (Dropdown.__proto__ || Object.getPrototypeOf(Dropdown)).apply(this, arguments)); | ||
var _this = _possibleConstructorReturn(this, (Dropdown.__proto__ || Object.getPrototypeOf(Dropdown)).call(this, props)); | ||
if (props['fieldRef']) { | ||
console.error('[Deprecated]: Please remove the React property \'fieldRef\' for the <Dropdown> component. It is no longer supported and will be removed in a future release, use \'inputRef\' instead.'); | ||
} | ||
return _this; | ||
} | ||
@@ -65,3 +70,3 @@ | ||
if (this.props.focusTrigger) { | ||
this.selectRef && this.selectRef.focus(); | ||
this.focusRef && this.focusRef.focus(); | ||
} | ||
@@ -91,2 +96,3 @@ } | ||
hint = _props.hint, | ||
inputRef = _props.inputRef, | ||
inversed = _props.inversed, | ||
@@ -98,3 +104,3 @@ label = _props.label, | ||
size = _props.size, | ||
selectProps = _objectWithoutProperties(_props, ['className', 'errorMessage', 'fieldClassName', 'fieldRef', 'focusTrigger', 'hint', 'inversed', 'label', 'labelClassName', 'options', 'requirementLabel', 'size']); | ||
selectProps = _objectWithoutProperties(_props, ['className', 'errorMessage', 'fieldClassName', 'fieldRef', 'focusTrigger', 'hint', 'inputRef', 'inversed', 'label', 'labelClassName', 'options', 'requirementLabel', 'size']); | ||
/* eslint-enable prefer-const */ | ||
@@ -137,7 +143,11 @@ | ||
if (focusTrigger) { | ||
_this2.selectRef = _ref; | ||
_this2.focusRef = _ref; | ||
} else { | ||
if (inputRef) { | ||
inputRef(_ref); | ||
} | ||
if (fieldRef) { | ||
fieldRef(_ref); | ||
} | ||
} | ||
if (fieldRef) { | ||
fieldRef(_ref); | ||
} | ||
} | ||
@@ -179,3 +189,3 @@ /* eslint-enable no-return-assign */ | ||
/** | ||
* Access a reference to the `select` element | ||
* (Deprecated) Access a reference to the `select` element | ||
*/ | ||
@@ -192,2 +202,6 @@ fieldRef: _propTypes2.default.func, | ||
/** | ||
* Access a reference to the `select` element | ||
*/ | ||
inputRef: _propTypes2.default.func, | ||
/** | ||
* Applies the "inverse" UI theme | ||
@@ -194,0 +208,0 @@ */ |
@@ -67,2 +67,6 @@ 'use strict'; | ||
_this.labelId = props.labelId || (0, _lodash2.default)('textfield_label_'); | ||
if (props['fieldRef']) { | ||
console.error('[Deprecated]: Please remove the React property \'fieldRef\' for the <TextField> component. It is no longer supported and will be removed in a future release, use \'inputRef\' instead.'); | ||
} | ||
return _this; | ||
@@ -75,3 +79,3 @@ } | ||
if (this.props.focusTrigger) { | ||
this.loader && this.loader.focus(); | ||
this.focusRef && this.focusRef.focus(); | ||
} | ||
@@ -148,2 +152,3 @@ } | ||
inversed = _props.inversed, | ||
inputRef = _props.inputRef, | ||
label = _props.label, | ||
@@ -158,3 +163,3 @@ labelClassName = _props.labelClassName, | ||
type = _props.type, | ||
fieldProps = _objectWithoutProperties(_props, ['ariaLabel', 'className', 'errorMessage', 'fieldClassName', 'fieldRef', 'focusTrigger', 'hint', 'id', 'inversed', 'label', 'labelClassName', 'labelId', 'mask', 'multiline', 'requirementLabel', 'rows', 'size', 'type']); | ||
fieldProps = _objectWithoutProperties(_props, ['ariaLabel', 'className', 'errorMessage', 'fieldClassName', 'fieldRef', 'focusTrigger', 'hint', 'id', 'inversed', 'inputRef', 'label', 'labelClassName', 'labelId', 'mask', 'multiline', 'requirementLabel', 'rows', 'size', 'type']); | ||
@@ -177,5 +182,14 @@ var FieldComponent = multiline ? 'textarea' : 'input'; | ||
/* eslint-disable no-return-assign */ | ||
, ref: focusTrigger ? function (loader) { | ||
return _this2.loader = loader; | ||
} : fieldRef | ||
, ref: function ref(_ref) { | ||
if (focusTrigger) { | ||
_this2.focusRef = _ref; | ||
} else { | ||
if (inputRef) { | ||
inputRef(_ref); | ||
} | ||
if (fieldRef) { | ||
fieldRef(_ref); | ||
} | ||
} | ||
} | ||
/* eslint-enable no-return-assign */ | ||
@@ -236,3 +250,3 @@ , rows: _rows, | ||
/** | ||
* Access a reference to the `input` or `textarea` element | ||
* (Deprecated) Access a reference to the `input` or `textarea` element | ||
*/ | ||
@@ -253,2 +267,6 @@ fieldRef: _propTypes2.default.func, | ||
/** | ||
* Access a reference to the `input` or `textarea` element | ||
*/ | ||
inputRef: _propTypes2.default.func, | ||
/** | ||
* Text showing the requirement ("Required", "Optional", etc.). See [Required and Optional Fields]({{root}}/guidelines/forms/#required-and-optional-fields). | ||
@@ -280,10 +298,2 @@ */ | ||
/** | ||
* `max` HTML input attribute | ||
*/ | ||
max: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string]), | ||
/** | ||
* `min` HTML input attribute | ||
*/ | ||
min: _propTypes2.default.oneOfType([_propTypes2.default.number, _propTypes2.default.string]), | ||
/** | ||
* Whether or not the text field is a multiline text field | ||
@@ -290,0 +300,0 @@ */ |
{ | ||
"name": "@cmsgov/design-system-core", | ||
"version": "3.2.0", | ||
"version": "3.3.0", | ||
"publishConfig": { | ||
@@ -12,3 +12,3 @@ "access": "public" | ||
"dependencies": { | ||
"@cmsgov/design-system-support": "^3.2.0", | ||
"@cmsgov/design-system-support": "^3.3.0", | ||
"classnames": "^2.2.5", | ||
@@ -15,0 +15,0 @@ "core-js": "^2.5.3", |
@@ -6,6 +6,17 @@ import Alert from './Alert'; | ||
ReactDOM.render( | ||
<Alert heading="A react component"> | ||
This is an example of a React Alert component. | ||
</Alert>, | ||
<div> | ||
<Alert heading="Status heading"> | ||
<p className="ds-c-alert__text">This is a React Alert component.</p> | ||
</Alert> | ||
<Alert className={'ds-u-margin-top--2'}> | ||
<p className="ds-c-alert__text"> | ||
This is a React Alert component without a heading. | ||
</p> | ||
</Alert> | ||
<Alert | ||
heading="Alert with only a heading" | ||
className={'ds-u-margin-top--2'} | ||
/> | ||
</div>, | ||
document.getElementById('js-example') | ||
); |
@@ -11,10 +11,18 @@ import PropTypes from 'prop-types'; | ||
this.headingId = this.props.headingId || uniqueId('alert_'); | ||
if (!props.heading && !props.children) { | ||
console.error( | ||
`Empty <Alert> components are not allowed, please use the 'heading' prop or include children.` | ||
); | ||
} | ||
} | ||
heading() { | ||
return ( | ||
<h3 className="ds-c-alert__heading" id={this.headingId}> | ||
{this.props.heading} | ||
</h3> | ||
); | ||
if (this.props.heading) { | ||
return ( | ||
<h3 className="ds-c-alert__heading" id={this.headingId}> | ||
{this.props.heading} | ||
</h3> | ||
); | ||
} | ||
} | ||
@@ -34,3 +42,3 @@ | ||
role={this.props.role} | ||
aria-labelledby={this.headingId} | ||
aria-labelledby={this.props.heading ? this.headingId : undefined} | ||
> | ||
@@ -49,8 +57,22 @@ <div className="ds-c-alert__body"> | ||
Alert.propTypes = { | ||
children: PropTypes.node.isRequired, | ||
children: PropTypes.node, | ||
/** | ||
* Text for the alert heading | ||
*/ | ||
heading: PropTypes.string, | ||
/** | ||
* Optional id used to link the `aria-labelledby` attribute to the heading. If not provided, a unique id will be automatically generated and used. | ||
*/ | ||
headingId: PropTypes.string, | ||
/** | ||
* Boolean to hide the `Alert` icon | ||
*/ | ||
hideIcon: PropTypes.bool, | ||
/** ARIA `role` */ | ||
/** | ||
* ARIA `role`, defaults to 'region' | ||
*/ | ||
role: PropTypes.oneOf(['alert', 'alertdialog', 'region']), | ||
/** | ||
* A string corresponding to the `Alert` variation classes (`error`, `warn`, `success`) | ||
*/ | ||
variation: PropTypes.oneOf(['error', 'warn', 'success']) | ||
@@ -57,0 +79,0 @@ }; |
@@ -48,3 +48,2 @@ /** | ||
this.listboxHeadingId = uniqueId('autocomplete_header_'); | ||
this.loader = null; | ||
} | ||
@@ -118,2 +117,3 @@ | ||
id: this.id, | ||
inputRef: this.props.inputRef, | ||
labelId: this.labelId, | ||
@@ -181,11 +181,10 @@ onBlur: child.props.onBlur, | ||
> | ||
{label && | ||
!loading && ( | ||
<h5 | ||
className="ds-u-margin--0 ds-u-padding--1" | ||
id={this.listboxHeadingId} | ||
> | ||
{label} | ||
</h5> | ||
)} | ||
{label && !loading && ( | ||
<h5 | ||
className="ds-u-margin--0 ds-u-padding--1" | ||
id={this.listboxHeadingId} | ||
> | ||
{label} | ||
</h5> | ||
)} | ||
@@ -274,2 +273,6 @@ <ul | ||
/** | ||
* Access a reference to the child `TextField`'s `input` element | ||
*/ | ||
inputRef: PropTypes.func, | ||
/** | ||
* Used to determine the string value for the selected item (which is used to compute the `inputValue`). | ||
@@ -276,0 +279,0 @@ * |
@@ -16,2 +16,12 @@ import PropTypes from 'prop-types'; | ||
export class Button extends React.PureComponent { | ||
constructor(props) { | ||
super(props); | ||
if (props['buttonRef']) { | ||
console.error( | ||
`[Deprecated]: Please remove the React property 'buttonRef' for the <Button> component. It is no longer supported and will be removed in a future release, use 'inputRef' instead` | ||
); | ||
} | ||
} | ||
// Get an object of props to pass to the rendered <Button> component | ||
@@ -29,2 +39,3 @@ attrs() { | ||
component, | ||
inputRef, | ||
inverse, | ||
@@ -94,3 +105,6 @@ onClick, | ||
return ( | ||
<ComponentType ref={this.props.buttonRef} {...attrs}> | ||
<ComponentType | ||
ref={this.props.inputRef || this.props.buttonRef} | ||
{...attrs} | ||
> | ||
{this.props.children} | ||
@@ -121,2 +135,6 @@ </ComponentType> | ||
href: PropTypes.string, | ||
/** | ||
* Access a reference to the `button` or `a` element | ||
*/ | ||
inputRef: PropTypes.func, | ||
/** Applies the inverse theme styling */ | ||
@@ -130,3 +148,3 @@ inverse: PropTypes.bool, | ||
/** | ||
* Access a reference to the `button` or `a` element | ||
* (Deprecated) Access a reference to the `button` or `a` element | ||
*/ | ||
@@ -133,0 +151,0 @@ buttonRef: PropTypes.func, |
@@ -22,2 +22,9 @@ import EvEmitter from 'ev-emitter'; | ||
if (props['inputPlacement'] === 'right') { | ||
console.error( | ||
`[Deprecated]: Please remove the React property 'inputPlacement' for the <Choice> component. It is no longer supported and will be removed in a future release.` | ||
); | ||
} | ||
this.input = null; | ||
this.handleChange = this.handleChange.bind(this); | ||
@@ -119,6 +126,6 @@ this.id = | ||
onChange={this.handleChange} | ||
ref={input => { | ||
this.input = input; | ||
ref={ref => { | ||
this.input = ref; | ||
if (inputRef) { | ||
inputRef(input); | ||
inputRef(ref); | ||
} | ||
@@ -201,3 +208,3 @@ }} | ||
/** | ||
* Placement of the input relative to the text label | ||
* (Deprecated) Placement of the input relative to the text label | ||
*/ | ||
@@ -204,0 +211,0 @@ inputPlacement: PropTypes.oneOf(['left', 'right']), |
@@ -5,13 +5,2 @@ import ChoiceList from './ChoiceList'; | ||
const selectChoices = [ | ||
{ label: 'A', value: 'A' }, | ||
{ defaultChecked: true, label: 'B', value: 'B' }, | ||
{ label: 'C', value: 'C' }, | ||
{ label: 'D', value: 'D' }, | ||
{ label: 'E', value: 'E' }, | ||
{ label: 'F', value: 'F' }, | ||
{ label: 'G', value: 'G' }, | ||
{ label: 'H', value: 'H' } | ||
]; | ||
ReactDOM.render( | ||
@@ -59,25 +48,4 @@ <div> | ||
/> | ||
<ChoiceList | ||
choices={selectChoices} | ||
hint="Example hint text" | ||
label="Select example" | ||
name="select_choices_field" | ||
/> | ||
<ChoiceList | ||
choices={selectChoices} | ||
size="small" | ||
label="Small select example" | ||
name="small_select_choices_field" | ||
/> | ||
<ChoiceList | ||
choices={selectChoices} | ||
size="medium" | ||
label="Medium select example" | ||
name="medium_select_choices_field" | ||
/> | ||
</div>, | ||
document.getElementById('js-example') | ||
); |
@@ -260,5 +260,5 @@ import Choice from './Choice'; | ||
*/ | ||
type: PropTypes.oneOf(['checkbox', 'radio', 'select']), | ||
type: PropTypes.oneOf(['checkbox', 'radio']), | ||
/** | ||
* Adds `aria-label` attribute if component renders a select | ||
* Adds `aria-label` attribute if component renders a select (deprecated) | ||
*/ | ||
@@ -265,0 +265,0 @@ ariaLabel: PropTypes.string |
@@ -21,2 +21,6 @@ import PropTypes from 'prop-types'; | ||
} | ||
console.error( | ||
`[Deprecated] The <Select> component is no longer supported and will be removed in a future release, please use <Dropdown> instead.` | ||
); | ||
} | ||
@@ -23,0 +27,0 @@ |
@@ -34,4 +34,6 @@ /* global driver */ | ||
await assertNoAxeViolations(); | ||
// TODO: implement `inert` to prevent main application node from containing focusable elements | ||
// Remove this temporarily disabled rule | ||
await assertNoAxeViolations(null, 'aria-hidden-focus'); | ||
}); | ||
}); |
@@ -17,5 +17,15 @@ import FormLabel from '../FormLabel/FormLabel'; | ||
export class Dropdown extends React.PureComponent { | ||
constructor(props) { | ||
super(props); | ||
if (props['fieldRef']) { | ||
console.error( | ||
`[Deprecated]: Please remove the React property 'fieldRef' for the <Dropdown> component. It is no longer supported and will be removed in a future release, use 'inputRef' instead.` | ||
); | ||
} | ||
} | ||
componentDidMount() { | ||
if (this.props.focusTrigger) { | ||
this.selectRef && this.selectRef.focus(); | ||
this.focusRef && this.focusRef.focus(); | ||
} | ||
@@ -41,2 +51,3 @@ } | ||
hint, | ||
inputRef, | ||
inversed, | ||
@@ -85,7 +96,11 @@ label, | ||
if (focusTrigger) { | ||
this.selectRef = ref; | ||
this.focusRef = ref; | ||
} else { | ||
if (inputRef) { | ||
inputRef(ref); | ||
} | ||
if (fieldRef) { | ||
fieldRef(ref); | ||
} | ||
} | ||
if (fieldRef) { | ||
fieldRef(ref); | ||
} | ||
}} | ||
@@ -126,3 +141,3 @@ /* eslint-enable no-return-assign */ | ||
/** | ||
* Access a reference to the `select` element | ||
* (Deprecated) Access a reference to the `select` element | ||
*/ | ||
@@ -139,2 +154,6 @@ fieldRef: PropTypes.func, | ||
/** | ||
* Access a reference to the `select` element | ||
*/ | ||
inputRef: PropTypes.func, | ||
/** | ||
* Applies the "inverse" UI theme | ||
@@ -141,0 +160,0 @@ */ |
@@ -19,2 +19,8 @@ import FormLabel from '../FormLabel/FormLabel'; | ||
this.labelId = props.labelId || uniqueId('textfield_label_'); | ||
if (props['fieldRef']) { | ||
console.error( | ||
`[Deprecated]: Please remove the React property 'fieldRef' for the <TextField> component. It is no longer supported and will be removed in a future release, use 'inputRef' instead.` | ||
); | ||
} | ||
} | ||
@@ -24,3 +30,3 @@ | ||
if (this.props.focusTrigger) { | ||
this.loader && this.loader.focus(); | ||
this.focusRef && this.focusRef.focus(); | ||
} | ||
@@ -66,5 +72,3 @@ } | ||
<div | ||
className={`ds-c-field__before ds-c-field__before--${ | ||
this.props.mask | ||
}`} | ||
className={`ds-c-field__before ds-c-field__before--${this.props.mask}`} | ||
> | ||
@@ -88,2 +92,3 @@ {content[this.props.mask]} | ||
inversed, | ||
inputRef, | ||
label, | ||
@@ -100,3 +105,2 @@ labelClassName, | ||
} = this.props; | ||
const FieldComponent = multiline ? 'textarea' : 'input'; | ||
@@ -127,3 +131,14 @@ const _rows = multiline && rows ? rows : undefined; | ||
/* eslint-disable no-return-assign */ | ||
ref={focusTrigger ? loader => (this.loader = loader) : fieldRef} | ||
ref={ref => { | ||
if (focusTrigger) { | ||
this.focusRef = ref; | ||
} else { | ||
if (inputRef) { | ||
inputRef(ref); | ||
} | ||
if (fieldRef) { | ||
fieldRef(ref); | ||
} | ||
} | ||
}} | ||
/* eslint-enable no-return-assign */ | ||
@@ -182,3 +197,3 @@ rows={_rows} | ||
/** | ||
* Access a reference to the `input` or `textarea` element | ||
* (Deprecated) Access a reference to the `input` or `textarea` element | ||
*/ | ||
@@ -199,2 +214,6 @@ fieldRef: PropTypes.func, | ||
/** | ||
* Access a reference to the `input` or `textarea` element | ||
*/ | ||
inputRef: PropTypes.func, | ||
/** | ||
* Text showing the requirement ("Required", "Optional", etc.). See [Required and Optional Fields]({{root}}/guidelines/forms/#required-and-optional-fields). | ||
@@ -226,10 +245,2 @@ */ | ||
/** | ||
* `max` HTML input attribute | ||
*/ | ||
max: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), | ||
/** | ||
* `min` HTML input attribute | ||
*/ | ||
min: PropTypes.oneOfType([PropTypes.number, PropTypes.string]), | ||
/** | ||
* Whether or not the text field is a multiline text field | ||
@@ -236,0 +247,0 @@ */ |
@@ -5,10 +5,11 @@ /* global driver */ | ||
export default async function assertNoAxeViolations(url) { | ||
export default async function assertNoAxeViolations(url, disabledRules = []) { | ||
if (url) { | ||
await driver.get(url); | ||
} | ||
const defaultDisabledRules = ['bypass']; | ||
await AxeBuilder(driver) | ||
.withTags(RULESET_ALL) | ||
.disableRules('bypass') | ||
.disableRules(defaultDisabledRules.concat(disabledRules)) | ||
.analyze((err, results) => { | ||
@@ -15,0 +16,0 @@ if (err) { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
1705505
355
13924
29