@@ -20,32 +20,30 @@ export default {
20
20
21
21
const insertBox = ( e : any ) => {
22
22
const div = document . createElement ( 'div' ) ;
23
- const button = document . createElement ( 'uui-button ' ) ;
23
+ const label = document . createElement ( 'div ' ) ;
24
24
const buttonInline = document . createElement ( 'uui-button-inline-create' ) ;
25
25
buttonInline . addEventListener ( 'click' , insertBox ) ;
26
- button . innerHTML = GetRandomUmbracoWord ( ) ;
27
- button . setAttribute ( 'look' , 'outline' ) ;
28
- button . style . width = '100%' ;
29
- button . style . height = '50px' ;
26
+ label . innerHTML = GetRandomUmbracoWord ( ) ;
27
+ label . style . padding = '10px' ;
28
+ label . style . whiteSpace = 'nowrap' ;
30
29
31
30
if ( e . target . vertical ) {
32
- console . log ( 'YES' ) ;
33
31
buttonInline . setAttribute ( 'vertical' , 'true' ) ;
34
32
div . style . display = 'grid' ;
35
33
div . style . gridTemplateColumns = '1fr auto' ;
36
34
}
37
35
38
- div . appendChild ( button ) ;
36
+ div . appendChild ( label ) ;
39
37
div . appendChild ( buttonInline ) ;
40
38
41
39
e . target . parentElement . insertAdjacentElement ( 'afterend' , div ) ;
42
40
} ;
43
41
44
- const createBox = ( vertical : Boolean ) => html `< div
42
+ const createBox = ( vertical : Boolean ) => html ` < div
45
43
style ="${ vertical ? 'display: grid; grid-template-columns: 1fr auto' : '' } ">
46
- < uui-button look =" outline " style ="width: 100%; height: 50px; "
47
- > ${ GetRandomUmbracoWord ( ) } </ uui-button
48
- >
44
+ < div style ="padding: 10px; white-space: nowrap; " >
45
+ ${ GetRandomUmbracoWord ( ) }
46
+ </ div >
49
47
< uui-button-inline-create
50
48
?vertical =${ vertical }
51
49
@click =${ insertBox } > </ uui-button-inline-create >
@@ -59,10 +57,49 @@ const createBoxes = (count: Number, vertical = false) => {
59
57
return boxes ;
60
58
} ;
61
59
60
+ export const AAAOverview : Story = ( ) =>
61
+ html `< uui-button-inline-create
62
+ label ="Create Item "> </ uui-button-inline-create > ` ;
63
+ AAAOverview . storyName = 'Overview' ;
64
+
62
65
export const Vertical : Story = ( ) =>
63
66
html `< div id ="container " style ="max-width: 500px "> ${ createBoxes ( 5 ) } </ div > ` ;
64
67
68
+ Vertical . parameters = {
69
+ docs : {
70
+ source : {
71
+ code : `
72
+ <div>
73
+ <div style="padding: 10px;">Item 1</div>
74
+ <uui-button-inline-create label="Create Item"></uui-button-inline-create>
75
+ <div style="padding: 10px;">Item 2</div>
76
+ <uui-button-inline-create label="Create Item"></uui-button-inline-create>
77
+ <div style="padding: 10px;">Item 3</div>
78
+ <uui-button-inline-create label="Create Item"></uui-button-inline-create>
79
+ </div>
80
+ ` ,
81
+ } ,
82
+ } ,
83
+ } ;
84
+
65
85
export const Horizontal : Story = ( ) =>
66
86
html `< div id ="container-vertical " style ="display: flex; ">
67
87
${ createBoxes ( 5 , true ) }
68
88
</ div > ` ;
89
+
90
+ Horizontal . parameters = {
91
+ docs : {
92
+ source : {
93
+ code : `
94
+ <div style="'display: grid; grid-template-columns: 1fr auto;">
95
+ <div style="padding: 10px;">Item 1</div>
96
+ <uui-button-inline-create label="Create Item"></uui-button-inline-create>
97
+ <div style="padding: 10px;">Item 2</div>
98
+ <uui-button-inline-create label="Create Item"></uui-button-inline-create>
99
+ <div style="padding: 10px;">Item 3</div>
100
+ <uui-button-inline-create label="Create Item"></uui-button-inline-create>
101
+ </div>
102
+ ` ,
103
+ } ,
104
+ } ,
105
+ } ;
0 commit comments