diff --git a/packages/docs/pages/icons.tsx b/packages/docs/pages/icons.tsx index 391ef1e22..11a8118c3 100644 --- a/packages/docs/pages/icons.tsx +++ b/packages/docs/pages/icons.tsx @@ -15,9 +15,9 @@ import { RUFlagIcon, USFlagIcon, } from '@bigcommerce/big-design-icons/flags'; -import React, { useEffect, useState } from 'react'; +import React, { Fragment, useEffect, useState } from 'react'; -import { Code, CodePreview, CodeSnippet, PageNavigation } from '../components'; +import { Code, CodePreview, CodeSnippet, ContentRoutingTabs, List, NextLink } from '../components'; import { FlagIconPropTable, IconPropTable } from '../PropTables'; type BigDesignIcons = Omit; @@ -35,162 +35,193 @@ const IconsPage = () => { fetchIcons(); }, []); - const items = [ - { - id: 'examples', - title: 'Examples', - render: () => ( - <> - - To use an icon import the component from the package: - {`import { CheckIcon } from '@bigcommerce/big-design-icons';`} - Use it anywhere in your app: - - {/* jsx-to-string:start */} - - {/* jsx-to-string:end */} - - - - - A complete list of available flags is located{' '} - - here - - . - - - To use a flag import the component from the package: - - {`import { USFlagIcon } from '@bigcommerce/big-design-icons/flags';`} - - Use it anywhere in your app: - - - {/* jsx-to-string:start */} - - {/* jsx-to-string:end */} - - - - {/* jsx-to-string:start */} - {function Example() { - const [value, setValue] = useState(''); - const handleChange = (val) => setValue(val); - - return ( -
- - }, + { value: 'mx', content: 'Mexico', icon: }, + { value: 'ca', content: 'Canada', icon: }, + { value: 'en', content: 'England', icon: }, + { value: 'fr', content: 'France', icon: }, + { value: 'gr', content: 'Germany', icon: }, + { value: 'ar', content: 'Argentina', icon: }, + { value: 'ru', content: 'Russia', disabled: true, icon: }, + { value: 'ch', content: 'Chile', icon: }, + { value: 'jp', content: 'Japan', icon: }, + { value: 'cn', content: 'China', icon: }, + { value: 'sk', content: 'South Korea', icon: }, + { value: 'au', content: 'Australia', icon: }, + ]} + placeholder={'Choose country'} + placement={'bottom-start'} + required + value={value} + /> + +
+ ); + }} + {/* jsx-to-string:end */} +
+ + ), + }, + ]} + /> +
+ + ( + + + npm install @bigcommerce/big-design-icons // or yarn add @bigcommerce/big-design-icons + + + ), + }, + { + id: 'flag-icon', + title: 'Flag icon', + render: () => ( + + + + ), + }, + ]} + /> + + + + + {Object.keys(icons).map((iconName) => { + const Icon = icons[iconName]; + + return ( + + + {`<${iconName} />`} + + ); + })} + + ); };