Skip to content

Commit

Permalink
refactor(Storybook): improve components hierarchy
Browse files Browse the repository at this point in the history
  • Loading branch information
christian-roy committed Jun 23, 2021
1 parent beb3c06 commit d659861
Show file tree
Hide file tree
Showing 50 changed files with 60 additions and 55 deletions.
5 changes: 5 additions & 0 deletions packages/storybook/.storybook/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,11 @@ export const decorators = [
];

export const parameters = {
options: {
storySort: {
method: 'alphabetical'
}
},
docs: {
container: DocsContainer,
page: DocsPage,
Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/stories/0-intro.stories.mdx
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Button, DesignSystem, InlineMessage, testTheme } from '@equisoft/design-elements-react';
import { ArgsTable, Canvas, Meta } from '@storybook/addon-docs/blocks';

<Meta title="Intro" />
<Meta title="Introduction" />

# Equisoft's Design System
## Getting Started
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { AddButton } from '@equisoft/design-elements-react';
import { Story } from '@storybook/react';
import React from 'react';
import { InvertedBackground } from '../utils/inverted-background';
import { InvertedBackground } from './utils/inverted-background';

export default {
title: 'Buttons/Add',
title: 'Controls/Add Button',
component: AddButton,
};

Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/stories/application-menu.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import { RouterDecorator } from './utils/router-decorator';
import CustomLogoSvg from './assets/customLogo.svg';

export default {
title: 'Application Menu',
title: 'Structure/Application Menu',
component: ApplicationMenu,
decorators: [RouterDecorator],
};
Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/stories/avatar.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { DesktopDecorator, MobileDecorator } from './utils/device-context-decora
import AvatarImg from './assets/avatars.png';

export default {
title: 'Avatar',
title: 'Data/Avatar',
component: Avatar,
};

Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/stories/banner.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from 'react';
import { DeviceContextDecorator } from './utils/device-context-decorator';

export default {
title: 'Banner',
title: 'Feedback/Banner',
component: Banner,
decorators: [DeviceContextDecorator],
};
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Breadcrumb, BreadcrumbElement } from '@equisoft/design-elements-react';
import { Story } from '@storybook/react';
import React from 'react';
import { RouterDecorator } from '../utils/router-decorator';
import { RouterDecorator } from './utils/router-decorator';

const routeMap = (length: number): BreadcrumbElement[] => {
const routes = [];
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Button } from '@equisoft/design-elements-react';
import { Story } from '@storybook/react';
import React from 'react';
import { InvertedBackground } from '../utils/inverted-background';
import { InvertedBackground } from './utils/inverted-background';

export default {
title: 'Buttons',
title: 'Controls/Button',
component: Button,
};

Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/stories/card-link.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from 'react';
import { RouterDecorator } from './utils/router-decorator';

export default {
title: 'Card Link',
title: 'Navigation/Card Link',
component: CardLink,
decorators: [RouterDecorator],
};
Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/stories/card.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Story } from '@storybook/react';
import * as React from 'react';

export default {
title: 'Card',
title: 'Structure/Card',
component: Card,
};

Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/stories/carousel.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React, { ReactNodeArray } from 'react';
import styled from 'styled-components';

export default {
title: 'Carousel',
title: 'Disclosure/Carousel',
component: Carousel,
};

Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/stories/checkbox-group.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { forceReRender, Story } from '@storybook/react';
import React, { ChangeEvent } from 'react';

export default {
title: 'Checkbox Group',
title: 'Controls/Checkbox Group',
component: CheckboxGroup,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ const skipOption = {
};

export default {
title: 'Chooser Button Group',
title: 'Controls/Chooser Button Group',
component: ChooserButtonGroup,
};

Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/stories/chooser-card.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Story } from '@storybook/react';
import React, { useState } from 'react';

export default {
title: 'Chooser Card',
title: 'Controls/Chooser Card',
component: ChooserCard,
};

Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/stories/datepicker.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ const upcomingDate = new Date();
upcomingDate.setDate(upcomingDate.getDate() + 5);

export default {
title: 'Datepicker',
title: 'Controls/Datepicker',
component: Datepicker,
decorators: [decorateWith(Container)],
};
Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/stories/enso-spinner.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Story } from '@storybook/react';
import React from 'react';

export default {
title: 'Spinners',
title: 'Feedback/Enso Spinner',
component: EnsoSpinner,
};

Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/stories/external-link.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Story } from '@storybook/react';
import React from 'react';

export default {
title: 'External Link',
title: 'Navigation/External Link',
component: ExternalLink,
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { GlobalNavigation, GlobalNavigationItem } from '@equisoft/design-elements-react';
import { Story } from '@storybook/react';
import React from 'react';
import { RouterDecorator } from '../utils/router-decorator';
import { ShadowDomDecorator } from '../utils/shadow-dom-decorator';
import { ButtonProps } from '../../../react/dist/components/buttons/icon-button';
import { RouterDecorator } from './utils/router-decorator';
import { ShadowDomDecorator } from './utils/shadow-dom-decorator';
import { ButtonProps } from '../../react/dist/components/buttons/icon-button';

export default {
title: 'Navigation/Global Navigation',
title: 'Structure/Global Navigation',
component: GlobalNavigation,
decorators: [RouterDecorator],
};
Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/stories/heading.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Heading } from '@equisoft/design-elements-react';
import React, { VoidFunctionComponent } from 'react';

export default {
title: 'Heading',
title: 'Text/Heading',
component: Heading,
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { IconButton } from '@equisoft/design-elements-react';
import { Story } from '@storybook/react';
import React from 'react';
import { InvertedBackground } from '../utils/inverted-background';
import { InvertedBackground } from './utils/inverted-background';

export default {
title: 'Buttons/Icon',
title: 'Controls/Icon Button',
component: IconButton,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Story } from '@storybook/react';
import React, { ComponentType } from 'react';

export default {
title: 'Icon/library',
title: 'Icons/Library',
component: Icon,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Story } from '@storybook/react';
import React from 'react';

export default {
title: 'Icon',
title: 'Icons/Icon',
component: Icon,
};

Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/stories/inline-message.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Story } from '@storybook/react';
import React from 'react';

export default {
title: 'Inline Message',
title: 'Feedback/Inline Message',
component: InlineMessage,
};

Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/stories/inputs.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Story } from '@storybook/react';
import React from 'react';

export default {
title: 'Input Text Fields',
title: 'Controls/Text Input',
component: TextInput,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ const legendItems: LegendItem[] = [
];

export default {
title: 'Results/Legend',
title: 'Data/Legend',
component: Legend,
};

Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/stories/listbox.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Story } from '@storybook/react';
import React from 'react';

export default {
title: 'Listbox',
title: 'Controls/Listbox',
component: Listbox,
};

Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/stories/modal-dialog.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {Button, ModalDialog, useModal} from '@equisoft/design-elements-react';
import {ArgsTable, Meta, Preview, Story} from '@storybook/addon-docs/blocks';
import {Fragment} from 'react';

<Meta title="Modal / Modal Dialog" component={ModalDialog} />
<Meta title="Disclosure/Modal Dialog" component={ModalDialog} />

# Modal Dialog

Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/stories/modal.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import {Button, Modal, useModal} from '@equisoft/design-elements-react';
import {ArgsTable, Meta, Preview, Story} from '@storybook/addon-docs/blocks';
import {Fragment} from 'react';

<Meta title="Modal / Modal" component={Modal} />
<Meta title="Disclosure/Modal" component={Modal} />

# Modal

Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/stories/money-input.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Story } from '@storybook/react';
import React, { useState } from 'react';

export default {
title: 'Money Input',
title: 'Controls/Money Input',
component: MoneyInput,
};

Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/stories/nav-menu-button.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ import { RouterDecorator } from './utils/router-decorator';
import { ShadowDomDecorator } from './utils/shadow-dom-decorator';

export default {
title: 'Nav Menu Button',
title: 'Navigation/Nav Menu Button',
component: NavMenuButton,
decorators: [RouterDecorator],
};
Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/stories/pagination.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React, { useState } from 'react';
import { DeviceContextDecorator } from './utils/device-context-decorator';

export default {
title: 'Pagination',
title: 'Navigation/Pagination',
component: Pagination,
decorators: [DeviceContextDecorator],
};
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Story } from '@storybook/react';
import React from 'react';

export default {
title: 'Results/Progress Bar',
title: 'Data/Progress Bar',
component: ProgressBar,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import React from 'react';
import styled from 'styled-components';

export default {
title: 'Results/Progress Circle',
title: 'Data/Progress Circle',
component: ProgressCircle,
};

Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/stories/progress.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Story } from '@storybook/react';
import React from 'react';

export default {
title: 'Progress',
title: 'Data/Progress',
component: Progress,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { forceReRender, Story } from '@storybook/react';
import React, { ChangeEvent } from 'react';

export default {
title: 'Radio Button Group',
title: 'Controls/Radio Button Group',
component: RadioButtonGroup,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { RouteLink } from '@equisoft/design-elements-react';
import { Story } from '@storybook/react';
import React from 'react';
import { Link, NavLink } from 'react-router-dom';
import { RouterDecorator } from '../utils/router-decorator';
import { RouterDecorator } from './utils/router-decorator';

export default {
title: 'Navigation/Route Link',
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Story } from '@storybook/react';
import * as React from 'react';

export default {
title: 'Search/Search Contextual',
title: 'Controls/Search Contextual',
component: SearchContextual,
};

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Story } from '@storybook/react';
import React from 'react';

export default {
title: 'Search/Search Global',
title: 'Controls/Search Global',
component: SearchGlobal,
};

Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/stories/select.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ const skipOption = {
};

export default {
title: 'Select',
title: 'Controls/Select',
component: Select,
decorators: [decorateWith(Container)],
};
Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/stories/side-drawer.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ const Box = styled.div`
`;

export default {
title: 'Side Drawer',
title: 'Structure/Side Drawer',
component: SideDrawer,
};

Expand Down
2 changes: 1 addition & 1 deletion packages/storybook/stories/skip-link.stories.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import React, { VoidFunctionComponent } from 'react';
import styled from 'styled-components';

export default {
title: 'Skip Link',
title: 'Navigation/Skip Link',
component: SkipLink,
};

Expand Down
Loading

0 comments on commit d659861

Please sign in to comment.