Skip to content
This repository has been archived by the owner on May 24, 2024. It is now read-only.

Commit

Permalink
Label prop type changed to string (#2698)
Browse files Browse the repository at this point in the history
* Prop type changed

* Changelog & Upgrade Guide

* Upgrade Guide updated

* Typo fixed

* Upgrade Guide update.

* Form field update

Co-authored-by: Pranav Agarwal <agarwal.pranav300@gmail.com>
Co-authored-by: Manuel,Ryan <Ryan.Manuel@Cerner.com>
  • Loading branch information
3 people authored Mar 27, 2020
1 parent 66e2501 commit 2db9369
Show file tree
Hide file tree
Showing 25 changed files with 94 additions and 13 deletions.
2 changes: 2 additions & 0 deletions packages/terra-form-checkbox/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ ChangeLog

Unreleased
----------
### Breaking Changes
* `labelText` and `legend` props' type changed from node to string.

3.34.0 - (March 10, 2020)
------------------
Expand Down
2 changes: 1 addition & 1 deletion packages/terra-form-checkbox/src/Checkbox.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const propTypes = {
/**
* Text of the label.
*/
labelText: PropTypes.node.isRequired,
labelText: PropTypes.string.isRequired,
/**
* Additional attributes for the text object.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/terra-form-checkbox/src/CheckboxField.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const propTypes = {
/**
* The legend of the form control children.
*/
legend: PropTypes.node.isRequired,
legend: PropTypes.string.isRequired,
/**
* Attributes to attach to the legend.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ import { Badge } from 'terra-form-checkbox/package.json?dev-site-package';

# Terra Form Checkbox Upgrade Guide

## Changes from version 3 to version 4

### Props

#### Updated
* Form Fields allowed the `label` to be a node, which potentially breaks the display when injecting other non-inline-only text elements (terra-text) or has the potential to completely break accessibility if something non-text based would be passed in.
* `labelText` prop's type changed from node to string.
* `legend` prop's type changed from node to string.

##### Steps to Update
To upgrade from 3.0 to 4.0 each existing Checkbox must be reviewed and updated to ensure only a string is being passed to the `labelText` and `legend ` props. Solutions passing node data types need to be reworked to provide only a string.

## Changes from version 2 to version 3

### Changes to CSS Custom Properties
Expand Down
2 changes: 2 additions & 0 deletions packages/terra-form-field/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ ChangeLog

Unreleased
----------
### Breaking Changes
* `label` prop's type changed from node to string.

3.34.0 - (March 10, 2020)
------------------
Expand Down
2 changes: 1 addition & 1 deletion packages/terra-form-field/src/Field.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ const propTypes = {
/**
* The label of the form control children.
*/
label: PropTypes.node.isRequired,
label: PropTypes.string.isRequired,
/**
* Attributes to attach to the label.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ import { Badge } from 'terra-form-field/package.json?dev-site-package';

# Terra Form Field Upgrade Guide

## Changes from version 3 to version 4

### Props

#### Updated
* Form Fields allowed the `label` to be a node, which potentially breaks the display when injecting other non-inline-only text elements (terra-text) or has the potential to completely break accessibility if something non-text based would be passed in.
* `label` prop's type changed from node to string.

##### Steps to Upgrade
To upgrade from 3.0 to 4.0 each existing Field must be reviewed and updated to ensure only a string is being passed to the `label` prop. Solutions passing node data types need to be reworked to provide only a string.

## Changes from 2.0 to 3.0

### Changes to CSS Custom Properties
Expand Down
2 changes: 2 additions & 0 deletions packages/terra-form-input/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ ChangeLog

Unreleased
----------
### Breaking Changes
* `label` prop's type changed from node to string.

2.36.0 - (March 10, 2020)
------------------
Expand Down
2 changes: 1 addition & 1 deletion packages/terra-form-input/src/InputField.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const propTypes = {
/**
* The label of the form control children.
*/
label: PropTypes.node.isRequired,
label: PropTypes.string.isRequired,
/**
* The defaultValue of the input field. Use this to create an uncontrolled input.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ import { Badge } from 'terra-form-input/package.json?dev-site-package';

# Terra Form Input Upgrade Guide

## Changes from version 2 to version 3

### Props

#### Updated
* Form Fields allowed the `label` to be a node, which potentially breaks the display when injecting other non-inline-only text elements (terra-text) or has the potential to completely break accessibility if something non-text based would be passed in.
* `label` prop's type changed from node to string.

##### Steps to Upgrade
To upgrade from 2.0 to 3.0 each existing Input must be reviewed and updated to ensure only a string is being passed to the `label` prop. Solutions passing node data types need to be reworked to provide only a string.

## Changes from version 1 to version 2

### Changes to CSS Custom Properties
Expand Down
2 changes: 2 additions & 0 deletions packages/terra-form-radio/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ ChangeLog

Unreleased
----------
### Breaking Changes
* `labelText` and `legend` props' type changed from node to string.

3.39.0 - (March 10, 2020)
------------------
Expand Down
2 changes: 1 addition & 1 deletion packages/terra-form-radio/src/Radio.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ const propTypes = {
/**
* Text of the label.
*/
labelText: PropTypes.node.isRequired,
labelText: PropTypes.string.isRequired,
/**
* Additional attributes for the text object.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/terra-form-radio/src/RadioField.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ const propTypes = {
/**
* The legend of the form control children.
*/
legend: PropTypes.node.isRequired,
legend: PropTypes.string.isRequired,
/**
* Attributes to attach to the legend.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,18 @@ import { Badge } from 'terra-form-radio/package.json?dev-site-package';

# Terra Form Radio Upgrade Guide

## Changes from version 3 to version 4

### Props

#### Updated
* Form Fields allowed the `label` to be a node, which potentially breaks the display when injecting other non-inline-only text elements (terra-text) or has the potential to completely break accessibility if something non-text based would be passed in.
* `labelText` prop's type changed from node to string.
* `legend` prop's type changed from node to string.

##### Steps to Upgrade
To upgrade from 3.0 to 4.0 each existing Radio must be reviewed and updated to ensure only a string is being passed to the `labelText` and `legend ` props. Solutions passing node data types need to be reworked to provide only a string.

## Changes from version 2 to version 3

### Changes to CSS Custom Properties
Expand Down
3 changes: 3 additions & 0 deletions packages/terra-form-select/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,9 @@ ChangeLog

Unreleased
----------
### Breaking Changes
* `label` prop's type changed from node to string.

### Changed
* Fixed `onBlur` event for mobile to not be triggered when selecting an option

Expand Down
2 changes: 1 addition & 1 deletion packages/terra-form-select/src/ComboboxField.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const propTypes = {
/**
* The field label.
*/
label: PropTypes.node.isRequired,
label: PropTypes.string.isRequired,
/**
* The default value of the select. Can be a string, number, or array of strings/numbers.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/terra-form-select/src/MultiSelectField.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const propTypes = {
/**
* The field label.
*/
label: PropTypes.node.isRequired,
label: PropTypes.string.isRequired,
/**
* The default value of the select. Can be a string, number, or array of strings/numbers.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/terra-form-select/src/SearchSelectField.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const propTypes = {
/**
* The field label.
*/
label: PropTypes.node.isRequired,
label: PropTypes.string.isRequired,
/**
* The default value of the select. Can be a string, number, or array of strings/numbers.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/terra-form-select/src/SelectField.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ const propTypes = {
/**
* The field label.
*/
label: PropTypes.node.isRequired,
label: PropTypes.string.isRequired,
/**
* The default value of the select. Can be a string, number, or array of strings/numbers.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/terra-form-select/src/SingleSelectField.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ const propTypes = {
/**
* The field label.
*/
label: PropTypes.node.isRequired,
label: PropTypes.string.isRequired,
/**
* The default value of the select. Can be a string, number, or array of strings/numbers.
*/
Expand Down
2 changes: 1 addition & 1 deletion packages/terra-form-select/src/TagSelectField.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const propTypes = {
/**
* The field label.
*/
label: PropTypes.node.isRequired,
label: PropTypes.string.isRequired,
/**
* The default value of the select. Can be a string, number, or array of strings/numbers.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ import { Badge } from 'terra-form-select/package.json?dev-site-package';

# Terra Form Select Upgrade Guide

## Changes from version 5 to version 6

### Props

#### Updated
* Form Fields allowed the `label` to be a node, which potentially breaks the display when injecting other non-inline-only text elements (terra-text) or has the potential to completely break accessibility if something non-text based would be passed in.
* `label` prop's type changed from node to string.

##### Steps to Upgrade
To upgrade from 5.0 to 6.0 each existing Select must be reviewed and updated to ensure only a string is being passed to the `label` props. Solutions passing node data types need to be reworked to provide only a string.

## Changes from version 4 to version 5

### Changes to CSS Custom Properties
Expand Down
2 changes: 2 additions & 0 deletions packages/terra-form-textarea/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,8 @@ ChangeLog

Unreleased
----------
### Breaking Changes
* `label` prop's type changed from node to string.

3.38.0 - (March 10, 2020)
------------------
Expand Down
2 changes: 1 addition & 1 deletion packages/terra-form-textarea/src/TextareaField.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ const propTypes = {
/**
* The label of the form control children.
*/
label: PropTypes.node.isRequired,
label: PropTypes.string.isRequired,
/**
* The defaultValue of the input field. Use this to create an uncontrolled input.
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,17 @@ import { Badge } from 'terra-form-textarea/package.json?dev-site-package';

# Terra Form Textarea Upgrade Guide

## Changes from version 3 to version 4

### Props

#### Updated
* Form Fields allowed the `label` to be a node, which potentially breaks the display when injecting other non-inline-only text elements (terra-text) or has the potential to completely break accessibility if something non-text based would be passed in.
* `label` prop's type changed from node to string.

##### Steps to Upgrade
To upgrade from 3.0 to 4.0 each existing Textarea must be reviewed and updated to ensure only a string is being passed to the `label` props. Solutions passing node data types need to be reworked to provide only a string.

## Changes from version 2 to version 3

### Changes to CSS Custom Properties
Expand Down

0 comments on commit 2db9369

Please sign in to comment.