Skip to content

Commit ec9c6a2

Browse files
author
Nikolai Lopin
committed
docs: moves Divider stories to the divider folder
1 parent c6d1213 commit ec9c6a2

File tree

5 files changed

+80
-242
lines changed

5 files changed

+80
-242
lines changed

src/components/Divider/docs/Divider.mdx

Lines changed: 0 additions & 101 deletions
This file was deleted.
Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,41 @@
1+
import React from 'react';
2+
import { Meta, StoryObj } from '@storybook/react';
3+
import { Divider } from '../Divider';
4+
import { Box } from '../../Box/Box';
5+
import { Text } from '../../Text/Text';
6+
7+
const meta: Meta = {
8+
title: 'Components/Divider',
9+
component: Divider,
10+
argTypes: {
11+
offset: {
12+
description: 'Set margins from surrounding content in css units or Space scale',
13+
control: {
14+
type: 'text'
15+
}
16+
}
17+
},
18+
decorators: [
19+
(Story, context) => (
20+
<Box display={context.args.vertical ? 'flex' : undefined}>
21+
<Text>One</Text>
22+
<Story />
23+
<Text>Two</Text>
24+
</Box>
25+
)
26+
]
27+
};
28+
29+
export default meta;
30+
31+
type Story = StoryObj<typeof Divider>;
32+
33+
export const Default: Story = {};
34+
35+
export const Vertical: Story = {
36+
args: { vertical: true }
37+
};
38+
39+
export const WithoutOffset: Story = {
40+
args: { offset: 0 }
41+
};
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
import { Meta, ArgTypes, Primary, Stories, Unstyled } from '@storybook/blocks';
2+
import { Divider, InfoBanner } from '../../index';
3+
import * as DividerStories from './Divider.stories';
4+
5+
<Meta of={DividerStories} />
6+
7+
# Divider
8+
9+
**Primary UI element for visually separating content**
10+
11+
Renders a divider UI component: horizontal or vertical line that visually separates two pieces of data, content or UI.
12+
13+
<Primary />
14+
15+
### Properties
16+
17+
<ArgTypes of={Divider} />
18+
19+
## Default Behaviour
20+
21+
The horizontal divider takes up the full available width and the vertical divider takes up the full available height.
22+
23+
The horizontal divider is rendered by default. Set **vertical** prop to `true` to change the divider orientation.
24+
25+
## Divider vs Border
26+
27+
The default color of Divider is _$border.primary_ (#C6CDD4), however...
28+
29+
<Unstyled>
30+
<InfoBanner
31+
variant="warning"
32+
description="Divider is NOT a border, and should not be used as such. Please do not use this component as a border for elements."
33+
title=""
34+
/>
35+
</Unstyled>
36+
37+
Divider is naturally expected to have a certain offset from the elements it is 'dividing' or separating.
38+
39+
<Stories includePrimary={false} />

src/components/Divider/docs/WrappedDivider.tsx

Lines changed: 0 additions & 45 deletions
This file was deleted.

src/stories/components/Divider.stories.mdx

Lines changed: 0 additions & 96 deletions
This file was deleted.

0 commit comments

Comments
 (0)