UNPKG

react-conventions

Version:

An open source set of React components that implement Ambassador's Design and UX patterns.

60 lines (56 loc) 2.41 kB
import React from 'react' import PropsList from 'private/modules/PropsList'; import docs from '!!docgen!react-conventions/lib/Dropdown/Dropdown'; import CodeExample from 'private/modules/CodeExample' import ExampleDropdownButton from './ExampleDropdownButton' import exampleDropdownButtonCode from '!raw!./ExampleDropdownButton' import ExampleDropdownCallback from './ExampleDropdownCallback' import exampleDropdownCallbackCode from '!raw!./ExampleDropdownCallback' import ExampleDropdownList from './ExampleDropdownList' import exampleDropdownListCode from '!raw!./ExampleDropdownList' import ExampleDropdownConfirmation from './ExampleDropdownConfirmation' import exampleDropdownConfirmationCode from '!raw!./ExampleDropdownConfirmation' import styles from 'private/css/content' const description = { dropdownButtonDefault: 'This is the **dropdown component** with a `<Button />` trigger.', dropdownButtonCallback: 'This is the **dropdown component** with a callback function to open.', dropdownList: 'This is the **dropdown component** that displays a list.', dropdownConfirmation: 'This is the **dropdown component** that displays a list with a confirmation overlay when clicked.' }; const DropdownPage = () => ( <div> <div className={styles.content}> <div className={styles.block}> <CodeExample title='Button Dropdown' description={description.dropdownButtonDefault} markup={exampleDropdownButtonCode}> <ExampleDropdownButton /> </CodeExample> <CodeExample title='Dropdown with callback for open/close' description={description.dropdownButtonCallback} markup={exampleDropdownCallbackCode}> <ExampleDropdownCallback /> </CodeExample> <CodeExample title='Dropdown with list' description={description.dropdownList} markup={exampleDropdownListCode} > <ExampleDropdownList /> </CodeExample> <CodeExample title='Dropdown with confirmation' description={description.dropdownConfirmation} markup={exampleDropdownConfirmationCode} > <ExampleDropdownConfirmation /> </CodeExample> </div> <div className={styles.block}> <h3>Dropdown Props</h3> <PropsList list={docs[0].props} /> </div> </div> </div> ) export default DropdownPage