import { Layout, Playground, Attributes } from 'lib/components'
import { Spacer, Grid } from 'components'

export const meta = {
  title: 'Spacer',
  group: 'Layout',
}

## Spacer

Provide empty space.

<Playground
  title="Vertical"
  scope={{ Spacer, Grid }}
  code={`
<Grid.Container>
  <Grid xs={24} style={{ background: '#444', borderRadius: '15px' }}>
    <Spacer h={2}/>
  </Grid>
  <Spacer h={2}/>
  <Grid xs={24} style={{ background: '#666', borderRadius: '15px' }}>
    <Spacer h={3}/>
  </Grid>
  <Spacer h={3}/>
  <Grid xs={24} style={{ background: '#999', borderRadius: '15px' }}>
    <Spacer h={4}/>
  </Grid>
</Grid.Container>
`}
/>

<Playground
  title="Horizontal"
  scope={{ Spacer, Grid }}
  code={`
<Grid.Container>
  <Grid xs={4} style={{ background: '#444', borderRadius: '15px' }} />
  <Spacer w={5}/>
  <Grid xs={4} style={{ background: '#444', borderRadius: '15px' }} />
</Grid.Container>
`}
/>

<Attributes edit="/pages/en-us/components/spacer.mdx">
<Attributes.Title>Spacer.Props</Attributes.Title>

| Attribute  | Description    | Type               | Accepted values          | Default |
| ---------- | -------------- | ------------------ | ------------------------ | ------- |
| **w**      | x-axis spacing | `number` / `float` | -                        | 1       |
| **h**      | y-axis spacing | `number` / `float` | -                        | 1       |
| **inline** | inline space   | `boolean`          | -                        | `false` |
| ...        | native props   | `HTMLAttributes`   | `'id', 'className', ...` | -       |

</Attributes>

export default ({ children }) => <Layout meta={meta}>{children}</Layout>
