Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: Reorganize Storybook sidebar nav to better reflect USWDS docs #785

Merged
merged 4 commits into from
Jan 27, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion .storybook/preview.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,16 @@ import 'uswds/dist/css/uswds.css'
import '../src/styles/index.scss'
import './custom-styles.scss'

import { addParameters } from '@storybook/client-api'
import { INITIAL_VIEWPORTS } from '@storybook/addon-viewport'

export const parameters = {
viewport: {
viewports: INITIAL_VIEWPORTS,
},
options: {
storySort: {
method: 'alphabetical',
Copy link
Contributor

@haworku haworku Jan 14, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice. Can we put the list below in alphabetical order too with "Components" first? Its also the most important stuff and it seems like by default storybook opens to the first story if you don't have a landing page

order: ['Components', 'Design tokens', 'Page templates', 'Other'],
},
},
}
2 changes: 1 addition & 1 deletion src/components/Accordion/Accordion.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import { Accordion } from './Accordion'

export default {
title: 'Accordion',
title: 'Components/Accordion',
component: Accordion,
parameters: {
info: `
Expand Down
2 changes: 1 addition & 1 deletion src/components/Alert/Alert.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Alert } from './Alert'
import { Button } from '../Button/Button'

export default {
title: 'Alert',
title: 'Components/Alert',
component: Alert,
parameters: {
info: `
Expand Down
2 changes: 1 addition & 1 deletion src/components/Button/Button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import { Button } from './Button'

export default {
title: 'Button',
title: 'Components/Button',
component: Button,
parameters: {
info: `
Expand Down
2 changes: 1 addition & 1 deletion src/components/ButtonGroup/ButtonGroup.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Button } from '../Button/Button'
import { Link } from '../Link/Link'

export default {
title: 'ButtonGroup',
title: 'Components/Button groups',
brandonlenz marked this conversation as resolved.
Show resolved Hide resolved
component: ButtonGroup,
parameters: {
info: `
Expand Down
2 changes: 1 addition & 1 deletion src/components/Footer/Address/Address.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import { Address } from './Address'

export default {
title: 'Footer/Address',
title: 'Components/Footer/Address',
component: Address,
parameters: {
info: `
Expand Down
2 changes: 1 addition & 1 deletion src/components/Footer/Footer/Footer.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import { TextInput } from '../../forms/TextInput/TextInput'
import logoImg from 'uswds/dist/img/logo-img.png'

export default {
title: 'Footer/Footer',
title: 'Components/Footer',
component: Footer,
parameters: {
info: `
Expand Down
2 changes: 1 addition & 1 deletion src/components/Footer/FooterNav/FooterNav.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Footer } from '../Footer/Footer'
import { FooterNav } from './FooterNav'

export default {
title: 'Footer/FooterNav',
title: 'Components/Footer/FooterNav',
component: FooterNav,
parameters: {
info: `
Expand Down
2 changes: 1 addition & 1 deletion src/components/Footer/Logo/Logo.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { Logo } from './Logo'
import logoImg from 'uswds/src/img/logo-img.png'

export default {
title: 'Footer/Logo',
title: 'Components/Footer/Logo',
component: Logo,
parameters: {
info: `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React from 'react'
import { SocialLinks } from './SocialLinks'

export default {
title: 'Footer/SocialLinks',
title: 'Components/Footer/SocialLinks',
component: SocialLinks,
parameters: {
info: `
Expand Down
2 changes: 1 addition & 1 deletion src/components/GovBanner/GovBanner.stories.tsx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import React from 'react'
import { GovBanner } from './GovBanner'

export default { title: 'GovBanner', component: GovBanner }
export default { title: 'Components/Banner', component: GovBanner }

export const govBannerDefault = (): React.ReactElement => (
<GovBanner aria-label="Official government website" />
Expand Down
2 changes: 1 addition & 1 deletion src/components/Link/Link.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import { Link } from './Link'

export default {
title: 'Link',
title: 'Components/Typography/Link',
component: Link,
parameters: {
info: `Link component
Expand Down
2 changes: 1 addition & 1 deletion src/components/Modal/Modal.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { Button } from '../Button/Button'
import { Modal, Overlay, ModalContainer, connectModal, useModal } from './Modal'

export default {
title: 'Modal',
title: 'Other/Modal',
component: Modal,
parameters: {
info: `Truss-designed component`,
Expand Down
2 changes: 1 addition & 1 deletion src/components/Search/Search.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import { Search } from './Search'

export default {
title: 'Search',
title: 'Components/Search',
component: Search,
parameters: {
info: `
Expand Down
2 changes: 1 addition & 1 deletion src/components/SideNav/SideNav.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import { SideNav } from './SideNav'

export default {
title: 'SideNav',
title: 'Components/Side navigation',
component: SideNav,
}

Expand Down
2 changes: 1 addition & 1 deletion src/components/Table/Table.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import { Table } from './Table'

export default {
title: 'Table',
title: 'Components/Table',
component: Table,
parameters: {
info: `
Expand Down
2 changes: 1 addition & 1 deletion src/components/Tag/Tag.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import { Tag } from './Tag'

export default {
title: 'Tag',
title: 'Components/Tag',
component: Tag,
parameters: {
info: `
Expand Down
2 changes: 1 addition & 1 deletion src/components/card/Card.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { CardMedia } from './CardMedia/CardMedia'
import { Button } from '../Button/Button'

export default {
title: 'Card',
title: 'Components/Card',
component: Card,
parameters: {
info: `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { FormGroup } from '../FormGroup/FormGroup'
import { Label } from '../Label/Label'

export default {
title: 'Forms/CharacterCount',
title: 'Components/Form controls/CharacterCount',
parameters: {
info: `
USWDS 2.0 Character count component
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/Checkbox/Checkbox.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import { Checkbox } from './Checkbox'

export default {
title: 'Forms/Checkbox',
title: 'Components/Form controls/Checkbox',
component: Checkbox,
parameters: {
info: `
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/ComboBox/ComboBox.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Label } from '../Label/Label'
import { fruits } from './fruits'

export default {
title: 'Forms/ComboBox',
title: 'Components/Form controls/Combo box',
component: ComboBox,
parameters: {
info: `
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/DateInput/DateInput.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { DateInputGroup } from '../DateInputGroup/DateInputGroup'
import { Fieldset } from '../Fieldset/Fieldset'

export default {
title: 'Forms/DateInput',
title: 'Components/Form controls/Date input',
component: DateInput,
parameters: {
info: `
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/Dropdown/Dropdown.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Dropdown } from './Dropdown'
import { Label } from '../Label/Label'

export default {
title: 'Forms/Dropdown',
title: 'Components/Form controls/Dropdown',
component: Dropdown,
parameters: {
info: `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import { ErrorMessage } from './ErrorMessage'

export default {
title: 'Forms/ErrorMessage',
title: 'Components/Form elements/ErrorMessage',
component: ErrorMessage,
parameters: {
info: `
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/Fieldset/Fieldset.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { Checkbox } from '../Checkbox/Checkbox'
import { Radio } from '../Radio/Radio'

export default {
title: 'Forms/Fieldset',
title: 'Components/Form elements/Fieldset',
component: Fieldset,
parameters: {
info: `
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/Form/Form.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import { TextInput } from '../TextInput/TextInput'
import { Textarea } from '../Textarea/Textarea'

export default {
title: 'Forms/Form',
title: 'Components/Form templates',
component: Form,
parameters: {
info: `
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/FormGroup/FormGroup.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { TextInput } from '../TextInput/TextInput'
import { ErrorMessage } from '../ErrorMessage/ErrorMessage'

export default {
title: 'Forms/FormGroup',
title: 'Components/Form elements/FormGroup',
component: FormGroup,
parameters: {
info: `
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/Label/Label.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import { Label } from './Label'

export default {
title: 'Forms/Label',
title: 'Components/Form elements/Label',
component: Label,
parameters: {
info: `
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/Radio/Radio.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import { Radio } from './Radio'

export default {
title: 'Forms/Radio',
title: 'Components/Form controls/Radio buttons',
component: Radio,
parameters: {
info: `
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/RangeInput/RangeInput.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { RangeInput } from './RangeInput'
import { Label } from '../Label/Label'

export default {
title: 'Forms/RangeInput',
title: 'Components/Form controls/Range slider',
component: RangeInput,
parameters: {
info: `
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/TextInput/TextInput.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import { TextInput } from './TextInput'

export default {
title: 'Forms/TextInput',
title: 'Components/Form controls/Text input',
component: TextInput,
parameters: {
info: `
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/Textarea/Textarea.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import { Textarea } from './Textarea'

export default {
title: 'Forms/Textarea',
title: 'Components/Form controls/Textarea',
component: Textarea,
parameters: {
info: `
Expand Down
2 changes: 1 addition & 1 deletion src/components/forms/Validation/Validation.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ import { ValidationChecklist } from './ValidationChecklist'
import { ValidationItem } from './ValidationItem'

export default {
title: 'Forms/Validation',
title: 'Components/Form controls/Validation',
component: ValidationChecklist,
subcomponents: { ValidationItem },
parameters: {
Expand Down
2 changes: 1 addition & 1 deletion src/components/grid/Grid.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { GridContainer } from './GridContainer/GridContainer'
import { Grid } from './Grid/Grid'

export default {
title: 'Grid',
title: 'Components/Grid',
component: Grid,
parameters: {
info: `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import { ExtendedNav } from './ExtendedNav'

export default {
title: 'Header/ExtendedNav',
title: 'Components/Header/ExtendedNav',
component: ExtendedNav,
parameters: {
info: `
Expand Down
2 changes: 1 addition & 1 deletion src/components/header/Header/Header.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ import { NavDropDownButton } from '../NavDropDownButton/NavDropDownButton'
import { ExtendedNav } from '../ExtendedNav/ExtendedNav'

export default {
title: 'Header/Header',
title: 'Components/Header',
component: Header,
parameters: {
info: `
Expand Down
2 changes: 1 addition & 1 deletion src/components/header/MegaMenu/MegaMenu.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import { MegaMenu } from './MegaMenu'

export default {
title: 'Header/MegaMenu',
title: 'Components/Header/MegaMenu',
component: MegaMenu,
parameters: {
info: `
Expand Down
2 changes: 1 addition & 1 deletion src/components/header/Menu/Menu.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import { Menu } from './Menu'

export default {
title: 'Header/Menu',
title: 'Components/Header/Menu',
component: Menu,
parameters: {
info: `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import { NavCloseButton } from './NavCloseButton'

export default {
title: 'Header/NavCloseButton',
title: 'Components/Header/NavCloseButton',
component: NavCloseButton,
parameters: {
info: `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { Header } from '../Header/Header'
import { PrimaryNav } from '../PrimaryNav/PrimaryNav'

export default {
title: 'Header/NavDropDownButton',
title: 'Components/Header/NavDropDownButton',
component: NavDropDownButton,
parameters: {
info: `
Expand Down
2 changes: 1 addition & 1 deletion src/components/header/NavList/NavList.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import { NavList } from './NavList'

export default {
title: 'Header/NavList',
title: 'Components/Header/NavList',
component: NavList,
parameters: {
info: `
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import { NavMenuButton } from './NavMenuButton'

export default {
title: 'Header/NavMenuButton',
title: 'Components/Header/NavMenuButton',
component: NavMenuButton,
parameters: {
info: `
Expand Down
2 changes: 1 addition & 1 deletion src/components/header/PrimaryNav/PrimaryNav.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import React from 'react'
import { PrimaryNav } from './PrimaryNav'

export default {
title: 'Header/PrimaryNav',
title: 'Components/Header/PrimaryNav',
component: PrimaryNav,
parameters: {
info: `
Expand Down
Loading