|
|
|
@ -1,7 +1,7 @@ |
|
|
|
|
import { Story, Preview, Props } from '@storybook/addon-docs/blocks'; |
|
|
|
|
import { Layout, HorizontalGroup, VerticalGroup } from './Layout'; |
|
|
|
|
import { Button } from '../Button'; |
|
|
|
|
import { Select } from '../index'; |
|
|
|
|
import { Story, Preview, Props } from "@storybook/addon-docs/blocks"; |
|
|
|
|
import { Layout, HorizontalGroup, VerticalGroup } from "./Layout"; |
|
|
|
|
import { Button } from "../Button"; |
|
|
|
|
import { Select } from "../index"; |
|
|
|
|
|
|
|
|
|
# Layout |
|
|
|
|
|
|
|
|
@ -12,93 +12,85 @@ Used for aligning items in specified orientation. Useful for multiple elements t |
|
|
|
|
Expects multiple elements as `children` prop. This is the base for more specialised `Horizontal-` and `VerticalGroup` components. |
|
|
|
|
|
|
|
|
|
### Props |
|
|
|
|
|
|
|
|
|
<Props of={Layout} /> |
|
|
|
|
|
|
|
|
|
## Horizontal |
|
|
|
|
|
|
|
|
|
Used for horizontally aligning several elements (e.g. Button, Select) with a predefined spacing between them. |
|
|
|
|
|
|
|
|
|
<Preview> |
|
|
|
|
<HorizontalGroup> |
|
|
|
|
<Button>Button 1</Button> |
|
|
|
|
<Button>Button 2</Button> |
|
|
|
|
<Button>Button 3</Button> |
|
|
|
|
</HorizontalGroup> |
|
|
|
|
</Preview> |
|
|
|
|
|
|
|
|
|
<Preview> |
|
|
|
|
</Preview> |
|
|
|
|
<Preview> |
|
|
|
|
<HorizontalGroup> |
|
|
|
|
<Select |
|
|
|
|
size='sm' |
|
|
|
|
size="sm" |
|
|
|
|
onChange={() => {}} |
|
|
|
|
options={[ |
|
|
|
|
{ value: 1, label: 'Option 1' }, |
|
|
|
|
{ value: 2, label: 'Option 2' }, |
|
|
|
|
{ value: 1, label: "Option 1" }, |
|
|
|
|
{ value: 2, label: "Option 2" }, |
|
|
|
|
]} |
|
|
|
|
/> |
|
|
|
|
<Select |
|
|
|
|
size='sm' |
|
|
|
|
size="sm" |
|
|
|
|
onChange={() => {}} |
|
|
|
|
options={[ |
|
|
|
|
{ value: 1, label: 'Option 1' }, |
|
|
|
|
{ value: 2, label: 'Option 2' }, |
|
|
|
|
{ value: 1, label: "Option 1" }, |
|
|
|
|
{ value: 2, label: "Option 2" }, |
|
|
|
|
]} |
|
|
|
|
/> |
|
|
|
|
<Select |
|
|
|
|
size='sm' |
|
|
|
|
size="sm" |
|
|
|
|
onChange={() => {}} |
|
|
|
|
options={[ |
|
|
|
|
{ value: 1, label: 'Option 1' }, |
|
|
|
|
{ value: 2, label: 'Option 2' }, |
|
|
|
|
{ value: 1, label: "Option 1" }, |
|
|
|
|
{ value: 2, label: "Option 2" }, |
|
|
|
|
]} |
|
|
|
|
/> |
|
|
|
|
</HorizontalGroup> |
|
|
|
|
</Preview> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Props |
|
|
|
|
<Props of={HorizontalGroup} /> |
|
|
|
|
|
|
|
|
|
</Preview> |
|
|
|
|
|
|
|
|
|
## Vertical |
|
|
|
|
|
|
|
|
|
Used for vertically aligning several elements (e.g. Button, Select) with a predefined spacing between them. |
|
|
|
|
|
|
|
|
|
<Preview> |
|
|
|
|
<VerticalGroup> |
|
|
|
|
<Button>Button 1</Button> |
|
|
|
|
<Button>Button 2</Button> |
|
|
|
|
<Button>Button 3</Button> |
|
|
|
|
</VerticalGroup> |
|
|
|
|
</Preview> |
|
|
|
|
|
|
|
|
|
<Preview> |
|
|
|
|
<VerticalGroup justify='center'> |
|
|
|
|
</Preview> |
|
|
|
|
<Preview> |
|
|
|
|
<VerticalGroup justify="center"> |
|
|
|
|
<Select |
|
|
|
|
size='sm' |
|
|
|
|
size="sm" |
|
|
|
|
onChange={() => {}} |
|
|
|
|
options={[ |
|
|
|
|
{ value: 1, label: 'Option 1' }, |
|
|
|
|
{ value: 2, label: 'Option 2' }, |
|
|
|
|
{ value: 1, label: "Option 1" }, |
|
|
|
|
{ value: 2, label: "Option 2" }, |
|
|
|
|
]} |
|
|
|
|
/> |
|
|
|
|
<Select |
|
|
|
|
size='sm' |
|
|
|
|
size="sm" |
|
|
|
|
onChange={() => {}} |
|
|
|
|
options={[ |
|
|
|
|
{ value: 1, label: 'Option 1' }, |
|
|
|
|
{ value: 2, label: 'Option 2' }, |
|
|
|
|
{ value: 1, label: "Option 1" }, |
|
|
|
|
{ value: 2, label: "Option 2" }, |
|
|
|
|
]} |
|
|
|
|
/> |
|
|
|
|
<Select |
|
|
|
|
size='sm' |
|
|
|
|
size="sm" |
|
|
|
|
onChange={() => {}} |
|
|
|
|
options={[ |
|
|
|
|
{ value: 1, label: 'Option 1' }, |
|
|
|
|
{ value: 2, label: 'Option 2' }, |
|
|
|
|
{ value: 1, label: "Option 1" }, |
|
|
|
|
{ value: 2, label: "Option 2" }, |
|
|
|
|
]} |
|
|
|
|
/> |
|
|
|
|
</VerticalGroup> |
|
|
|
|
</Preview> |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
### Props |
|
|
|
|
<Props of={VerticalGroup} /> |
|
|
|
|
</Preview> |
|
|
|
|