From a51e270899e27ea4f493673824d3a785946e795c Mon Sep 17 00:00:00 2001 From: CJ Skillingstad Date: Thu, 24 Jan 2019 15:14:46 -0800 Subject: [PATCH 01/29] ActionBar --- src/ActionBar/ActionBar.js | 11 ++++++++--- src/ActionBar/ActionBar.test.js | 21 ++++++++++++++++++--- 2 files changed, 26 insertions(+), 6 deletions(-) diff --git a/src/ActionBar/ActionBar.js b/src/ActionBar/ActionBar.js index 0be8506db..78d8c59c7 100644 --- a/src/ActionBar/ActionBar.js +++ b/src/ActionBar/ActionBar.js @@ -11,7 +11,7 @@ export const ActionBar = ({ mobile, width, children, className, ...props }) => { return ( {mobile ? ( -
+
{children}
) : ( @@ -27,6 +27,11 @@ ActionBar.propTypes = { width: PropTypes.string }; +ActionBar.defaultProps = { + mobile: false, + width: '319px' +}; + export const ActionBarBack = ({ onClick, className, buttonProps, ...props }) => { const actionBarBackClasses = classnames( 'fd-action-bar__back', @@ -68,10 +73,10 @@ export const ActionBarHeader = ({ className, description, descriptionProps, titl }; ActionBarHeader.propTypes = { + description: PropTypes.string.isRequired, + title: PropTypes.string.isRequired, className: PropTypes.string, - description: PropTypes.string, descriptionProps: PropTypes.object, - title: PropTypes.string, titleProps: PropTypes.object }; diff --git a/src/ActionBar/ActionBar.test.js b/src/ActionBar/ActionBar.test.js index 14eccbdd4..5d8dc1599 100644 --- a/src/ActionBar/ActionBar.test.js +++ b/src/ActionBar/ActionBar.test.js @@ -114,7 +114,12 @@ describe('', () => { }); test('should allow props to be spread to the ActionBarHeader component', () => { - const element = mount(); + const element = mount( + + ); expect( element.getDOMNode().attributes['data-sample'].value @@ -122,7 +127,12 @@ describe('', () => { }); test('should allow props to be spread to the ActionBarHeader component\'s h1 element', () => { - const element = mount(); + const element = mount( + + ); expect( element.find('h1').getDOMNode().attributes['data-sample'].value @@ -130,7 +140,12 @@ describe('', () => { }); test('should allow props to be spread to the ActionBarHeader component\'s p element', () => { - const element = mount(); + const element = mount( + + ); expect( element.find('p').getDOMNode().attributes['data-sample'].value From 2e76203c2823eab06e57565da062460f711a3bd9 Mon Sep 17 00:00:00 2001 From: CJ Skillingstad Date: Thu, 24 Jan 2019 15:27:04 -0800 Subject: [PATCH 02/29] Alert --- src/Alert/Alert.Component.js | 2 +- src/Alert/Alert.js | 6 +++++- 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Alert/Alert.Component.js b/src/Alert/Alert.Component.js index 885bb08b8..0d0efc512 100644 --- a/src/Alert/Alert.Component.js +++ b/src/Alert/Alert.Component.js @@ -157,7 +157,7 @@ export const AlertComponent = () => { } ]}> + linkText='link'> Default alert with a{' '} diff --git a/src/Alert/Alert.js b/src/Alert/Alert.js index ed8859dfd..f5bae6cab 100644 --- a/src/Alert/Alert.js +++ b/src/Alert/Alert.js @@ -77,5 +77,9 @@ Alert.propTypes = { link: PropTypes.string, linkProps: PropTypes.object, linkText: PropTypes.string, - type: PropTypes.oneOf(['', 'warning', 'error', 'success', 'information']) + type: PropTypes.oneOf(['warning', 'error', 'success', 'information']) +}; + +Alert.defaultProps = { + dismissible: false }; From 8e48224c2ffe8585b399e521a7ef0de00200dbb1 Mon Sep 17 00:00:00 2001 From: CJ Skillingstad Date: Thu, 24 Jan 2019 16:50:06 -0800 Subject: [PATCH 03/29] Button --- src/Button/Button.js | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/Button/Button.js b/src/Button/Button.js index fba9f25e6..004c54ab5 100644 --- a/src/Button/Button.js +++ b/src/Button/Button.js @@ -33,25 +33,35 @@ export const Button = ({ ); return (); }; Button.propTypes = { + children: PropTypes.node, + className: PropTypes.string, compact: PropTypes.bool, disabled: PropTypes.bool, dropdown: PropTypes.bool, glyph: PropTypes.string, navbar: PropTypes.bool, - option: PropTypes.oneOf(['', 'emphasized', 'light', 'shell']), + option: PropTypes.oneOf(['emphasized', 'light', 'shell']), selected: PropTypes.bool, - type: PropTypes.oneOf(['', 'standard', 'positive', 'negative', 'medium']), + type: PropTypes.oneOf(['standard', 'positive', 'negative', 'medium']), typeAttr: PropTypes.string, onClick: PropTypes.func }; +Button.defaultProps = { + compact: false, + disabled: false, + dropdown: false, + navbar: false, + selected: false +}; + export const ButtonGroup = ({children, ...props}) => { return (
Date: Fri, 25 Jan 2019 10:25:58 -0800 Subject: [PATCH 04/29] Calendar --- src/Calendar/Calendar.js | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/Calendar/Calendar.js b/src/Calendar/Calendar.js index dbbda1a17..3386a1720 100644 --- a/src/Calendar/Calendar.js +++ b/src/Calendar/Calendar.js @@ -574,5 +574,12 @@ Calendar.propTypes = { tableBodyProps: PropTypes.object, tableHeaderProps: PropTypes.object, tableProps: PropTypes.object, - yearListProps: PropTypes.object + yearListProps: PropTypes.object, + onChange: PropTypes.func +}; + +Calendar.defaultProps = { + disableFutureDates: false, + disablePastDates: false, + disableWeekends: false }; From 91e4877926ed08cfa017eaed7be6d7ac5da59a1a Mon Sep 17 00:00:00 2001 From: CJ Skillingstad Date: Fri, 25 Jan 2019 12:43:25 -0800 Subject: [PATCH 05/29] DatePicker --- src/DatePicker/DatePicker.js | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/DatePicker/DatePicker.js b/src/DatePicker/DatePicker.js index f56526bb2..04c063501 100644 --- a/src/DatePicker/DatePicker.js +++ b/src/DatePicker/DatePicker.js @@ -443,3 +443,8 @@ DatePicker.propTypes = { enableRangeSelection: PropTypes.bool, inputProps: PropTypes.object }; + +DatePicker.defaultProps = { + compact: false, + enableRangeSelection: false +}; From 655b005ce258c9de1a3a43946d93165e70fee0ca Mon Sep 17 00:00:00 2001 From: CJ Skillingstad Date: Fri, 25 Jan 2019 13:49:10 -0800 Subject: [PATCH 06/29] Dropdown --- src/Dropdown/Dropdown.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/src/Dropdown/Dropdown.js b/src/Dropdown/Dropdown.js index dfa15a9cc..c2c8a6c75 100644 --- a/src/Dropdown/Dropdown.js +++ b/src/Dropdown/Dropdown.js @@ -25,3 +25,7 @@ Dropdown.propTypes = { className: PropTypes.string, standard: PropTypes.bool }; + +Dropdown.defaultProps = { + standard: false +}; From f1e2f19475e9122ecff42f6229caa9e84bf26aa9 Mon Sep 17 00:00:00 2001 From: CJ Skillingstad Date: Fri, 25 Jan 2019 14:07:11 -0800 Subject: [PATCH 07/29] FormRadio --- src/Forms/Forms.js | 28 ++++++++++++++++++---- src/Forms/__snapshots__/Forms.test.js.snap | 23 ++++++++++-------- 2 files changed, 36 insertions(+), 15 deletions(-) diff --git a/src/Forms/Forms.js b/src/Forms/Forms.js index a5ae16e0f..00e2ed9a2 100644 --- a/src/Forms/Forms.js +++ b/src/Forms/Forms.js @@ -46,6 +46,11 @@ FormItem.propTypes = { isInline: PropTypes.bool }; +FormItem.defaultProps = { + isCheck: false, + isInline: false +}; + // ------------------------------------------------- Form Label ---------------------------------------------- export const FormLabel = ({ required, children, className, ...props }) => { const formLabelClasses = classnames( @@ -68,6 +73,10 @@ FormLabel.propTypes = { required: PropTypes.bool }; +FormLabel.defaultProps = { + required: false +}; + // ------------------------------------------------- Form Message ---------------------------------------------- export const FormMessage = ({ type, children, className, ...props }) => { const formMessageClasses = classnames( @@ -88,7 +97,7 @@ export const FormMessage = ({ type, children, className, ...props }) => { FormMessage.propTypes = { children: PropTypes.node, className: PropTypes.string, - type: PropTypes.oneOf(['', 'error', 'warning', 'help']) + type: PropTypes.oneOf(['error', 'warning', 'help']) }; // ------------------------------------------------- Form Input ---------------------------------------------- @@ -183,7 +192,7 @@ export const FormSelect = ({ disabled, children, className, ...props }) => { ); @@ -194,6 +203,10 @@ FormSelect.propTypes = { disabled: PropTypes.bool }; +FormSelect.defaultProps = { + disabled: false +}; + // ------------------------------------------------- Form Radio ---------------------------------------------- export class FormRadio extends Component { constructor(props) { @@ -223,7 +236,7 @@ export class FormRadio extends Component { create form item 1`] = ` className="fd-form__item fd-form__item--inline fd-form__item--check" >
`; @@ -27,8 +22,6 @@ exports[` @@ -37,8 +30,6 @@ exports[` @@ -47,8 +38,6 @@ exports[` @@ -57,8 +46,6 @@ exports[` @@ -67,8 +54,6 @@ exports[` @@ -77,7 +62,6 @@ exports[` @@ -97,8 +80,6 @@ exports[` @@ -107,8 +88,6 @@ exports[` diff --git a/src/Calendar/Calendar.js b/src/Calendar/Calendar.js index 5433a604c..80734308e 100644 --- a/src/Calendar/Calendar.js +++ b/src/Calendar/Calendar.js @@ -583,12 +583,6 @@ Calendar.propTypes = { onChange: PropTypes.func }; -Calendar.defaultProps = { - disableFutureDates: false, - disablePastDates: false, - disableWeekends: false -}; - Calendar.propDescriptions = { blockedDates: 'Blocks dates that are in between the blocked dates.', disableAfterDate: 'Disables dates of a calendar that come after the specified date.', diff --git a/src/ComboboxInput/ComboboxInput.js b/src/ComboboxInput/ComboboxInput.js index 1ccb5c43f..3e716852d 100644 --- a/src/ComboboxInput/ComboboxInput.js +++ b/src/ComboboxInput/ComboboxInput.js @@ -60,11 +60,6 @@ ComboboxInput.propTypes = { popoverProps: PropTypes.object }; -ComboboxInput.defaultTypes = { - compact: false, - placeholder: '' -}; - ComboboxInput.propDescriptions = { menu: 'An object containing a `Menu` component.' }; diff --git a/src/DatePicker/DatePicker.js b/src/DatePicker/DatePicker.js index 516ae65ec..7025a93ed 100644 --- a/src/DatePicker/DatePicker.js +++ b/src/DatePicker/DatePicker.js @@ -445,11 +445,6 @@ DatePicker.propTypes = { inputProps: PropTypes.object }; -DatePicker.defaultProps = { - compact: false, - enableRangeSelection: false -}; - DatePicker.propDescriptions = { ...Calendar.propDescriptions, enableRangeSelection: 'Set to **true** to enable the selection of a date range (begin and end).' diff --git a/src/Dropdown/Dropdown.js b/src/Dropdown/Dropdown.js index 8378b0592..2dbadaf22 100644 --- a/src/Dropdown/Dropdown.js +++ b/src/Dropdown/Dropdown.js @@ -26,10 +26,6 @@ Dropdown.propTypes = { standard: PropTypes.bool }; -Dropdown.defaultProps = { - standard: false -}; - Dropdown.propDescriptions = { standard: 'Set to **true** to enable a dropdown for toolbar.' }; diff --git a/src/Dropdown/__snapshots__/Dropdown.test.js.snap b/src/Dropdown/__snapshots__/Dropdown.test.js.snap index ecbaa7ce8..796c4c50e 100644 --- a/src/Dropdown/__snapshots__/Dropdown.test.js.snap +++ b/src/Dropdown/__snapshots__/Dropdown.test.js.snap @@ -14,8 +14,6 @@ exports[` create dropdown component 1`] = ` > @@ -83,8 +81,6 @@ exports[` create dropdown component 2`] = ` > @@ -152,8 +148,6 @@ exports[` create dropdown component 3`] = ` > @@ -222,8 +216,6 @@ exports[` create dropdown component 4`] = ` > @@ -295,7 +287,6 @@ exports[` create dropdown component 5`] = ` diff --git a/src/InputGroup/InputGroup.js b/src/InputGroup/InputGroup.js index 551c61a6b..c0d7f101c 100644 --- a/src/InputGroup/InputGroup.js +++ b/src/InputGroup/InputGroup.js @@ -268,9 +268,7 @@ InputGroup.propTypes = { }; InputGroup.defaultProps = { - actions: false, addonPos: 'after', - compact: false, inputType: 'text', inputValue: '' }; diff --git a/src/InputGroup/__snapshots__/InputGroup.test.js.snap b/src/InputGroup/__snapshots__/InputGroup.test.js.snap index 444a65d22..2a56df382 100644 --- a/src/InputGroup/__snapshots__/InputGroup.test.js.snap +++ b/src/InputGroup/__snapshots__/InputGroup.test.js.snap @@ -271,8 +271,6 @@ exports[` create input group items 13`] = ` > @@ -295,8 +293,6 @@ exports[` create input group items 14`] = ` > diff --git a/src/ListGroup/__snapshots__/ListGroup.test.js.snap b/src/ListGroup/__snapshots__/ListGroup.test.js.snap index 5ac54ee45..94ae791a1 100644 --- a/src/ListGroup/__snapshots__/ListGroup.test.js.snap +++ b/src/ListGroup/__snapshots__/ListGroup.test.js.snap @@ -49,8 +49,6 @@ exports[` create list group 1`] = ` > @@ -162,8 +160,6 @@ exports[` create panels 3`] = ` > diff --git a/src/SearchInput/SearchInput.js b/src/SearchInput/SearchInput.js index 7ca859bf0..02de93abf 100644 --- a/src/SearchInput/SearchInput.js +++ b/src/SearchInput/SearchInput.js @@ -281,12 +281,6 @@ SearchInput.propTypes = { onSearch: PropTypes.func }; -SearchInput.defaultProps = { - compact: false, - inShellbar: false, - noSearchBtn: false -}; - SearchInput.propDescriptions = { noSearchBtn: 'Set to **true** to render without a search button.', onEnter: 'Callback function when the user hits the key.', diff --git a/src/Shellbar/Shellbar.js b/src/Shellbar/Shellbar.js index ee44b27d3..d02928942 100644 --- a/src/Shellbar/Shellbar.js +++ b/src/Shellbar/Shellbar.js @@ -404,12 +404,6 @@ Shellbar.propTypes = { subtitle: PropTypes.string }; -Shellbar.defaultProps = { - actions: null, - copilot: false, - logoSAP: false -}; - Shellbar.propDescriptions = { actions: 'Holds all product actions and links.', copilot: 'For use with applications that utilize CoPilot.', diff --git a/src/SideNavigation/SideNavigation.js b/src/SideNavigation/SideNavigation.js index b7510a0f2..403e1dd5b 100644 --- a/src/SideNavigation/SideNavigation.js +++ b/src/SideNavigation/SideNavigation.js @@ -24,10 +24,6 @@ SideNav.propTypes = { icons: PropTypes.bool }; -SideNav.defaultProps = { - icons: false -}; - SideNav.propDescriptions = { icons: 'Set to **true** enables side navigation collapsed with icons.' }; diff --git a/src/Tile/Tile.js b/src/Tile/Tile.js index bf1a6dddd..f3a6db486 100644 --- a/src/Tile/Tile.js +++ b/src/Tile/Tile.js @@ -45,10 +45,6 @@ Tile.propTypes = { rowSpan: PropTypes.number }; -Tile.defaultProps = { - disabled: false -}; - Tile.propDescriptions = { backgroundColor: 'Sets a background color class.', colorAccent: 'Sets a background color accent class. Options include numbers from 1 to 9.', @@ -136,10 +132,6 @@ ProductTile.propTypes = { disabled: PropTypes.bool }; -ProductTile.defaultProps = { - disabled: false -}; - export const ProductTileContent = props => { const { title, children, className, titleProps, ...rest } = props; diff --git a/src/Tile/__snapshots__/Tile.test.js.snap b/src/Tile/__snapshots__/Tile.test.js.snap index fb74dbf81..9a4b2869e 100644 --- a/src/Tile/__snapshots__/Tile.test.js.snap +++ b/src/Tile/__snapshots__/Tile.test.js.snap @@ -92,8 +92,6 @@ exports[` create tile component 4`] = ` >
create tile component 6`] = ` >
create time component 1`] = `
create time component 1`] = ` exports[`
@@ -480,7 +446,6 @@ exports[`
@@ -513,7 +477,6 @@ exports[`
@@ -527,7 +490,6 @@ exports[`