Skip to content

Commit 34f5132

Browse files
author
Zack Jones
committed
WECH-23: Added Box story
1 parent 731d7c7 commit 34f5132

File tree

1 file changed

+57
-0
lines changed

1 file changed

+57
-0
lines changed
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
import React from 'react';
2+
import { ComponentStory, ComponentMeta } from '@storybook/react';
3+
import { Box } from '../..';
4+
5+
const description1 =
6+
'This component serves as a wrapper component for most layout related needs. Use Box to set values such as `display`, `width`, `height`, and more. In practice, this component is used frequently as a wrapper around other components to achieve Box Model related styling.';
7+
8+
const description2 =
9+
'The Box supports `space`, `layout`, `position`, `color`, `flexbox`, `grid-layout` and `background` [styled-system](https://styled-system.com/table) props.';
10+
11+
const Example = () => (
12+
<>
13+
Box can be used to create both{' '}
14+
<Box as="span" bg="#9ED9BB">
15+
inline
16+
</Box>{' '}
17+
and
18+
<Box bg="#9FC5F1">block-level elements,</Box>
19+
<Box bg="#FF9CFC" width={[1, 1, 1 / 2]}>
20+
elements with fixed or responsive width and height,
21+
</Box>
22+
<Box bg="#FFEB9C" p={4} mt={2}>
23+
and more!
24+
</Box>
25+
</>
26+
);
27+
28+
const code = `
29+
Box can be used to create both
30+
<Box as="span" bg="#9ED9BB">inline</Box>
31+
and
32+
<Box bg="#9FC5F1">block-level elements,</Box>
33+
<Box bg="#FF9CFC" width={[1, 1, 1 / 2]}>elements with fixed or responsive width and height,</Box>
34+
<Box bg="#FFEB9C" p={4} mt={2}>and more!</Box>
35+
`;
36+
37+
export default {
38+
title: 'Components/Box',
39+
component: Example,
40+
parameters: {
41+
docs: {
42+
description: {
43+
component: `${description1}\n\n${description2}`
44+
}
45+
}
46+
},
47+
argTypes: {}
48+
} as ComponentMeta<typeof Example>;
49+
50+
const Template: ComponentStory<typeof Example> = () => <Example />;
51+
52+
export const Default = Template.bind({});
53+
Default.parameters = {
54+
docs: {
55+
source: { code, language: 'jsx', type: 'auto' }
56+
}
57+
};

0 commit comments

Comments
 (0)