File tree Expand file tree Collapse file tree 2 files changed +69
-5
lines changed
apps/docs/content/components/Box Expand file tree Collapse file tree 2 files changed +69
-5
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ title: Box
3
3
status : Experimental
4
4
a11yReviewed : false
5
5
source : https://github.com/primer/brand/blob/main/packages/react/src/Box/Box.tsx
6
- storybook : ' /brand/storybook/?path=/story/components-box--default '
6
+ storybook : ' /brand/storybook/?path=/story/components-box--playground '
7
7
description : Use a box to simplify the process of applying one-off styles to an element
8
8
---
9
9
Original file line number Diff line number Diff line change 1
1
import React from 'react'
2
2
3
3
import { Meta , StoryFn } from '@storybook/react'
4
- import { Box } from './Box'
4
+ import {
5
+ Box ,
6
+ BoxBackgroundColors ,
7
+ BoxBorderColorOptions ,
8
+ BoxBorderRadiusOptions ,
9
+ BoxBorderWidthOptions ,
10
+ BoxSpacingValues ,
11
+ } from './Box'
5
12
import { Text } from '../'
6
13
7
14
export default {
8
15
title : 'Components/Box' ,
9
16
component : Box ,
10
17
} as Meta < typeof Box >
11
18
12
- const Template : StoryFn < typeof Box > = args => (
13
- < Box { ... args } >
19
+ export const Default = ( ) => (
20
+ < Box >
14
21
< Text > Default Box</ Text >
15
22
</ Box >
16
23
)
17
24
18
- export const Default = Template . bind ( { } )
25
+ export const Playground : StoryFn < typeof Box > = args => (
26
+ < Box { ...args } >
27
+ < Text > Default Box</ Text >
28
+ </ Box >
29
+ )
30
+ Playground . args = {
31
+ padding : 'normal' ,
32
+ margin : 'normal' ,
33
+ backgroundColor : 'inset' ,
34
+ borderRadius : 'medium' ,
35
+ borderWidth : 'thin' ,
36
+ borderColor : 'default' ,
37
+ borderStyle : 'solid' ,
38
+ }
39
+ Playground . argTypes = {
40
+ padding : {
41
+ options : BoxSpacingValues ,
42
+ control : {
43
+ type : 'select' ,
44
+ } ,
45
+ } ,
46
+ margin : {
47
+ options : BoxSpacingValues ,
48
+ control : {
49
+ type : 'select' ,
50
+ } ,
51
+ } ,
52
+ backgroundColor : {
53
+ options : BoxBackgroundColors ,
54
+ control : {
55
+ type : 'inline-radio' ,
56
+ } ,
57
+ } ,
58
+ borderRadius : {
59
+ options : BoxBorderRadiusOptions ,
60
+ control : {
61
+ type : 'inline-radio' ,
62
+ } ,
63
+ } ,
64
+ borderWidth : {
65
+ options : BoxBorderWidthOptions ,
66
+ control : {
67
+ type : 'inline-radio' ,
68
+ } ,
69
+ } ,
70
+ borderColor : {
71
+ options : BoxBorderColorOptions ,
72
+ control : {
73
+ type : 'inline-radio' ,
74
+ } ,
75
+ } ,
76
+ borderStyle : {
77
+ options : [ 'none' , 'solid' ] ,
78
+ control : {
79
+ type : 'inline-radio' ,
80
+ } ,
81
+ } ,
82
+ }
You can’t perform that action at this time.
0 commit comments