From af0626b6b3a77b65725d829b43994cf013ca95d1 Mon Sep 17 00:00:00 2001 From: Josh Black Date: Fri, 3 Apr 2020 09:29:15 -0500 Subject: [PATCH] docs(dropdown,combobox): remove itemToElement examples (#5748) * chore(project): sync generated files * docs(dropdown,combobox): remove itemToElement examples Co-authored-by: TJ Egan --- .../src/components/ComboBox/ComboBox-story.js | 28 --------------- .../src/components/Dropdown/Dropdown-story.js | 34 ------------------- 2 files changed, 62 deletions(-) diff --git a/packages/react/src/components/ComboBox/ComboBox-story.js b/packages/react/src/components/ComboBox/ComboBox-story.js index 38f85dab2af1..714ff5921298 100644 --- a/packages/react/src/components/ComboBox/ComboBox-story.js +++ b/packages/react/src/components/ComboBox/ComboBox-story.js @@ -56,16 +56,6 @@ const props = () => ({ onChange: action('onChange'), }); -const itemToElement = item => { - const itemAsArray = item.text.split(' '); - return ( -
- {itemAsArray[0]} - {itemAsArray[1]} -
- ); -}; - const ControlledComboBoxApp = props => { const [selectedItem, setSelectedItem] = useState(items[0]); let uid = items.length; @@ -119,24 +109,6 @@ storiesOf('ComboBox', module) }, } ) - .add( - 'items as components', - () => ( -
- (item ? item.text : '')} - itemToElement={itemToElement} - {...props()} - /> -
- ), - { - info: { - text: 'ComboBox', - }, - } - ) .add( 'application-level control for selection', () => , diff --git a/packages/react/src/components/Dropdown/Dropdown-story.js b/packages/react/src/components/Dropdown/Dropdown-story.js index 28e271789a00..1057c5cf07b5 100644 --- a/packages/react/src/components/Dropdown/Dropdown-story.js +++ b/packages/react/src/components/Dropdown/Dropdown-story.js @@ -72,21 +72,6 @@ const props = () => ({ ), }); -const itemToElement = item => { - const [first, ...rest] = item.text.split(' '); - return ( -
- {first} - {rest.join(' ')} -
- ); -}; - storiesOf('Dropdown', module) .addDecorator(withKnobs) .add( @@ -124,25 +109,6 @@ storiesOf('Dropdown', module) }, } ) - .add( - 'items as components', - () => ( -
- (item ? item.text : '')} - itemToElement={itemToElement} - onChange={action('onChange')} - /> -
- ), - { - info: { - text: `Rendering items as custom components`, - }, - } - ) .add( 'fully controlled', () => (