-
Notifications
You must be signed in to change notification settings - Fork 36
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
bbbf5b1
commit cc14203
Showing
2 changed files
with
69 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,18 +1,82 @@ | ||
import React from 'react' | ||
|
||
import {Meta, StoryFn} from '@storybook/react' | ||
import {Box} from './Box' | ||
import { | ||
Box, | ||
BoxBackgroundColors, | ||
BoxBorderColorOptions, | ||
BoxBorderRadiusOptions, | ||
BoxBorderWidthOptions, | ||
BoxSpacingValues, | ||
} from './Box' | ||
import {Text} from '../' | ||
|
||
export default { | ||
title: 'Components/Box', | ||
component: Box, | ||
} as Meta<typeof Box> | ||
|
||
const Template: StoryFn<typeof Box> = args => ( | ||
<Box {...args}> | ||
export const Default = () => ( | ||
<Box> | ||
<Text>Default Box</Text> | ||
</Box> | ||
) | ||
|
||
export const Default = Template.bind({}) | ||
export const Playground: StoryFn<typeof Box> = args => ( | ||
<Box {...args}> | ||
<Text>Default Box</Text> | ||
</Box> | ||
) | ||
Playground.args = { | ||
padding: 'normal', | ||
margin: 'normal', | ||
backgroundColor: 'inset', | ||
borderRadius: 'medium', | ||
borderWidth: 'thin', | ||
borderColor: 'default', | ||
borderStyle: 'solid', | ||
} | ||
Playground.argTypes = { | ||
padding: { | ||
options: BoxSpacingValues, | ||
control: { | ||
type: 'select', | ||
}, | ||
}, | ||
margin: { | ||
options: BoxSpacingValues, | ||
control: { | ||
type: 'select', | ||
}, | ||
}, | ||
backgroundColor: { | ||
options: BoxBackgroundColors, | ||
control: { | ||
type: 'inline-radio', | ||
}, | ||
}, | ||
borderRadius: { | ||
options: BoxBorderRadiusOptions, | ||
control: { | ||
type: 'inline-radio', | ||
}, | ||
}, | ||
borderWidth: { | ||
options: BoxBorderWidthOptions, | ||
control: { | ||
type: 'inline-radio', | ||
}, | ||
}, | ||
borderColor: { | ||
options: BoxBorderColorOptions, | ||
control: { | ||
type: 'inline-radio', | ||
}, | ||
}, | ||
borderStyle: { | ||
options: ['none', 'solid'], | ||
control: { | ||
type: 'inline-radio', | ||
}, | ||
}, | ||
} |