Skip to content

Commit

Permalink
fix(react-components): update type for invalidText, warnText (#7433)
Browse files Browse the repository at this point in the history
Co-authored-by: kodiakhq[bot] <49736102+kodiakhq[bot]@users.noreply.github.com>
  • Loading branch information
epodgaetskiy and kodiakhq[bot] committed Dec 11, 2020
1 parent 23adf93 commit bfab4c3
Show file tree
Hide file tree
Showing 11 changed files with 28 additions and 28 deletions.
24 changes: 12 additions & 12 deletions packages/react/__tests__/__snapshots__/PublicAPI-test.js.snap
Original file line number Diff line number Diff line change
Expand Up @@ -566,7 +566,7 @@ Map {
"type": "bool",
},
"invalidText": Object {
"type": "string",
"type": "node",
},
"itemToElement": Object {
"type": "func",
Expand Down Expand Up @@ -2219,7 +2219,7 @@ Map {
"type": "bool",
},
"invalidText": Object {
"type": "string",
"type": "node",
},
"labelText": Object {
"isRequired": true,
Expand Down Expand Up @@ -2254,7 +2254,7 @@ Map {
"type": "bool",
},
"warnText": Object {
"type": "string",
"type": "node",
},
},
},
Expand Down Expand Up @@ -2328,7 +2328,7 @@ Map {
"type": "bool",
},
"invalidText": Object {
"type": "string",
"type": "node",
},
"itemToElement": Object {
"type": "func",
Expand Down Expand Up @@ -2401,7 +2401,7 @@ Map {
"type": "bool",
},
"warnText": Object {
"type": "string",
"type": "node",
},
},
"render": [Function],
Expand Down Expand Up @@ -3564,7 +3564,7 @@ Map {
"type": "bool",
},
"invalidText": Object {
"type": "string",
"type": "node",
},
"itemToString": Object {
"type": "func",
Expand Down Expand Up @@ -3625,7 +3625,7 @@ Map {
"type": "bool",
},
"warnText": Object {
"type": "string",
"type": "node",
},
},
},
Expand Down Expand Up @@ -3795,7 +3795,7 @@ Map {
"type": "bool",
},
"invalidText": Object {
"type": "string",
"type": "node",
},
"itemToString": Object {
"type": "func",
Expand Down Expand Up @@ -3868,7 +3868,7 @@ Map {
"type": "bool",
},
"warnText": Object {
"type": "string",
"type": "node",
},
},
"render": [Function],
Expand Down Expand Up @@ -4660,7 +4660,7 @@ Map {
"type": "bool",
},
"invalidText": Object {
"type": "string",
"type": "node",
},
"labelText": Object {
"type": "node",
Expand Down Expand Up @@ -5233,7 +5233,7 @@ Map {
"type": "bool",
},
"invalidText": Object {
"type": "string",
"type": "node",
},
"labelText": Object {
"isRequired": true,
Expand Down Expand Up @@ -5896,7 +5896,7 @@ Map {
"type": "bool",
},
"invalidText": Object {
"type": "string",
"type": "node",
},
"labelText": Object {
"type": "node",
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/ComboBox/ComboBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -114,7 +114,7 @@ export default class ComboBox extends React.Component {
/**
* Message which is displayed if the value is invalid.
*/
invalidText: PropTypes.string,
invalidText: PropTypes.node,

/**
* Optional function to render items as custom components instead of strings.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ export default class DatePickerInput extends Component {
/**
* Specify the text to be rendered when the input is invalid
*/
invalidText: PropTypes.string,
invalidText: PropTypes.node,

/**
* Provide the text that will be read by a screen reader when visiting this
Expand Down Expand Up @@ -114,7 +114,7 @@ export default class DatePickerInput extends Component {
/**
* Provide the text that is displayed when the control is in warning state
*/
warnText: PropTypes.string,
warnText: PropTypes.node,
};

static defaultProps = {
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/components/Dropdown/Dropdown.js
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ Dropdown.propTypes = {
/**
* Message which is displayed if the value is invalid.
*/
invalidText: PropTypes.string,
invalidText: PropTypes.node,

/**
* Function to render items as custom components instead of strings.
Expand Down Expand Up @@ -335,7 +335,7 @@ Dropdown.propTypes = {
/**
* Provide the text that is displayed when the control is in warning state
*/
warnText: PropTypes.string,
warnText: PropTypes.node,
};

Dropdown.defaultProps = {
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/components/ListBox/ListBox.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ ListBox.propTypes = {
/**
* Specify the text to be displayed when the control is invalid
*/
invalidText: PropTypes.string,
invalidText: PropTypes.node,

/**
* Specify if the control should render open
Expand Down Expand Up @@ -135,7 +135,7 @@ ListBox.propTypes = {
/**
* Provide the text that is displayed when the control is in warning state
*/
warnText: PropTypes.string,
warnText: PropTypes.node,
};

ListBox.defaultProps = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ export default class FilterableMultiSelect extends React.Component {
/**
* If invalid, what is the error?
*/
invalidText: PropTypes.string,
invalidText: PropTypes.node,

/**
* Helper function passed to downshift that allows the library to render a
Expand Down Expand Up @@ -144,7 +144,7 @@ export default class FilterableMultiSelect extends React.Component {
/**
* Provide the text that is displayed when the control is in warning state
*/
warnText: PropTypes.string,
warnText: PropTypes.node,
};

static getDerivedStateFromProps({ open }, state) {
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/components/MultiSelect/MultiSelect.js
Original file line number Diff line number Diff line change
Expand Up @@ -316,7 +316,7 @@ MultiSelect.propTypes = {
/**
* If invalid, what is the error?
*/
invalidText: PropTypes.string,
invalidText: PropTypes.node,

/**
* Helper function passed to downshift that allows the library to render a
Expand Down Expand Up @@ -407,7 +407,7 @@ MultiSelect.propTypes = {
/**
* Provide the text that is displayed when the control is in warning state
*/
warnText: PropTypes.string,
warnText: PropTypes.node,
};

MultiSelect.defaultProps = {
Expand Down
4 changes: 2 additions & 2 deletions packages/react/src/components/NumberInput/NumberInput.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ class NumberInput extends Component {
/**
* Message which is displayed if the value is invalid.
*/
invalidText: PropTypes.string,
invalidText: PropTypes.node,
/**
* `true` to use the mobile variant.
*/
Expand Down Expand Up @@ -151,7 +151,7 @@ class NumberInput extends Component {
/**
* Provide the text that is displayed when the control is in warning state
*/
warnText: PropTypes.string,
warnText: PropTypes.node,
};

static defaultProps = {
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/Select/Select.js
Original file line number Diff line number Diff line change
Expand Up @@ -179,7 +179,7 @@ Select.propTypes = {
/**
* Message which is displayed if the value is invalid.
*/
invalidText: PropTypes.string,
invalidText: PropTypes.node,

/**
* Provide label text to be read by screen readers when interacting with the
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/TextArea/TextArea.js
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ TextArea.propTypes = {
/**
* Provide the text that is displayed when the control is in an invalid state
*/
invalidText: PropTypes.string,
invalidText: PropTypes.node,

/**
* Provide the text that will be read by a screen reader when visiting this
Expand Down
2 changes: 1 addition & 1 deletion packages/react/src/components/TimePicker/TimePicker.js
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ export default class TimePicker extends Component {
/**
* Provide the text that is displayed when the control is in an invalid state
*/
invalidText: PropTypes.string,
invalidText: PropTypes.node,

/**
* Provide the text that will be read by a screen reader when visiting this
Expand Down

0 comments on commit bfab4c3

Please sign in to comment.