@@ -20,6 +20,20 @@ export default {
20
20
] ,
21
21
} ;
22
22
23
+ /* TODO: we should make some kind of component for this data layout */
24
+ const cardContent = html `
25
+ < ul style ="list-style: none; padding-inline-start: 0px; margin: 0; ">
26
+ < li > < span style ="font-weight: 700 "> Created:</ span > Yesterday</ li >
27
+ < li >
28
+ < span style ="font-weight: 700 "> Last Edited: </ span > 2021-03-15 09:29
29
+ </ li >
30
+ < li > < span style ="font-weight: 700 "> Some property:</ span > Some value</ li >
31
+ < li >
32
+ < span style ="font-weight: 700 "> Another property:</ span > Another value
33
+ </ li >
34
+ </ ul >
35
+ ` ;
36
+
23
37
export const AAAOverview : Story = props =>
24
38
html `
25
39
< uui-card-content-node
@@ -29,17 +43,7 @@ export const AAAOverview: Story = props =>
29
43
?error=${ props . error }
30
44
?disabled=${ props . disabled } >
31
45
< uui-tag size ="s " slot ="tag " look ="positive "> Published</ uui-tag >
32
- <!-- TODO: we should make some kind of component for this data layout: -->
33
- < ul style ="list-style: none; padding-inline-start: 0px; margin: 0; ">
34
- < li > < span style ="font-weight: 700 "> Created:</ span > Yesterday</ li >
35
- < li >
36
- < span style ="font-weight: 700 "> Last Edited: </ span > 2021-03-15 09:29
37
- </ li >
38
- < li > < span style ="font-weight: 700 "> Some property:</ span > Some value</ li >
39
- < li >
40
- < span style ="font-weight: 700 "> Another property:</ span > Another value
41
- </ li >
42
- </ ul >
46
+ ${ cardContent }
43
47
</ uui-card-content-node >
44
48
` ;
45
49
AAAOverview . storyName = 'Overview' ;
@@ -68,82 +72,63 @@ AAAOverview.parameters = {
68
72
} ,
69
73
} ;
70
74
71
- export const CustomIcon : Story = props => html `
75
+ export const CustomIcon : Story = ( ) => html `
72
76
< uui-icon-registry-essential >
73
- < uui-card-content-node
74
- name =${ props . name }
75
- ?selectable =${ props . selectable }
76
- ?selected=${ props . selected }
77
- ?error=${ props . error }
78
- ?disabled=${ props . disabled } >
79
- < uui-icon slot ="icon " name ="picture "> </ uui-icon >
80
- < uui-tag size ="s " slot ="tag " look ="positive "> Published</ uui-tag >
81
- <!-- TODO: we should make some kind of component for this data layout: -->
82
- < ul style ="list-style: none; padding-inline-start: 0px; margin: 0; ">
83
- < li > < span style ="font-weight: 700 "> Created:</ span > Yesterday</ li >
84
- < li >
85
- < span style ="font-weight: 700 "> Last Edited: </ span > 2021-03-15 09:29
86
- </ li >
87
- < li > < span style ="font-weight: 700 "> Some property:</ span > Some value</ li >
88
- < li >
89
- < span style ="font-weight: 700 "> Another property:</ span > Another value
90
- </ li >
91
- </ ul >
77
+ < uui-card-content-node name ="The card ">
78
+ < uui-icon slot ="icon " name ="wand "> </ uui-icon >
79
+ ${ cardContent }
92
80
</ uui-card-content-node >
93
81
</ uui-icon-registry-essential >
94
82
` ;
95
83
96
84
CustomIcon . parameters = {
85
+ controls : { include : [ '' ] } ,
97
86
docs : {
98
87
source : {
99
88
code : `
100
- <uui-card-content-node selectable name="The card">
101
- <uui-icon slot="icon" name="bug"></uui-icon>
102
- </uui-card-content-node>
103
- ` ,
89
+ <uui-icon-registry-essential>
90
+ <uui-card-content-node name="The card">
91
+ <uui-icon slot="icon" name="wand"></uui-icon>
92
+
93
+ <!-- Content -->
94
+ </uui-card-content-node>
95
+ <uui-icon-registry-essential>
96
+ ` ,
104
97
} ,
105
98
} ,
106
99
} ;
107
100
108
- export const Actions : Story = props => html `
109
- < uui-card-content-node
110
- name =${ props . name }
111
- ?selectable =${ props . selectable }
112
- ?selected=${ props . selected }
113
- ?error=${ props . error }
114
- ?disabled=${ props . disabled } >
101
+ export const Actions : Story = ( ) => html `
102
+ < uui-card-content-node name ="The card ">
115
103
< uui-action-bar slot ="actions ">
116
104
< uui-button label ="Remove "> Remove</ uui-button >
117
105
</ uui-action-bar >
118
- <!-- TODO: we should make some kind of component for this data layout: -->
119
- < ul style ="list-style: none; padding-inline-start: 0px; margin: 0; ">
120
- < li > < span style ="font-weight: 700 "> Created:</ span > Yesterday</ li >
121
- < li >
122
- < span style ="font-weight: 700 "> Last Edited: </ span > 2021-03-15 09:29
123
- </ li >
124
- < li > < span style ="font-weight: 700 "> Some property:</ span > Some value</ li >
125
- < li >
126
- < span style ="font-weight: 700 "> Another property:</ span > Another value
127
- </ li >
128
- </ ul >
106
+ ${ cardContent }
129
107
</ uui-card-content-node >
130
108
` ;
131
109
132
110
Actions . parameters = {
111
+ controls : { include : [ '' ] } ,
133
112
docs : {
134
113
source : {
135
114
code : `
136
- <uui-card-content-node selectable name="The card">
137
- <uui-action-bar slot="actions">
138
- <uui-button label="Remove">Remove</uui-button>
139
- </uui-action-bar>
140
- </uui-card-content-node>
115
+ <uui-card-content-node name="The card">
116
+ <uui-action-bar slot="actions">
117
+ <uui-button label="Remove">Remove</uui-button>
118
+ </uui-action-bar>
119
+
120
+ <!-- Content -->
121
+ </uui-card-content-node>
141
122
` ,
142
123
} ,
143
124
} ,
144
125
} ;
145
126
146
- export const Disabled = AAAOverview . bind ( { } ) ;
127
+ export const Disabled : Story = props => html `
128
+ < uui-card-content-node ?disabled =${ props . disabled } name ="The card">
129
+ ${ cardContent }
130
+ </ uui-card-content-node >
131
+ ` ;
147
132
148
133
Disabled . args = {
149
134
disabled : true ,
@@ -153,7 +138,53 @@ Disabled.parameters = {
153
138
docs : {
154
139
source : {
155
140
code : `
156
- <uui-card-content-node disabled name="The card"></uui-card-content-node>
141
+ <uui-card-content-node name="The card" disabled>
142
+ <!-- Content -->
143
+ </uui-card-content-node>
144
+ ` ,
145
+ } ,
146
+ } ,
147
+ } ;
148
+
149
+ export const Error : Story = props => html `
150
+ < uui-card-content-node ?error =${ props . error } name ="The card">
151
+ ${ cardContent }
152
+ </ uui-card-content-node >
153
+ ` ;
154
+
155
+ Error . args = {
156
+ error : true ,
157
+ } ;
158
+ Error . parameters = {
159
+ controls : { include : [ 'error' ] } ,
160
+ docs : {
161
+ source : {
162
+ code : `
163
+ <uui-card-content-node name="The card" error>
164
+ <!-- Content -->
165
+ </uui-card-content-node>
166
+ ` ,
167
+ } ,
168
+ } ,
169
+ } ;
170
+
171
+ export const Selectable : Story = props => html `
172
+ < uui-card-content-node ?selectable =${ props . selectable } name ="The card">
173
+ ${ cardContent }
174
+ </ uui-card-content-node >
175
+ ` ;
176
+
177
+ Selectable . args = {
178
+ selectable : true ,
179
+ } ;
180
+ Selectable . parameters = {
181
+ controls : { include : [ 'selectable' ] } ,
182
+ docs : {
183
+ source : {
184
+ code : `
185
+ <uui-card-content-node name="The card" selectable>
186
+ <!-- Content -->
187
+ </uui-card-content-node>
157
188
` ,
158
189
} ,
159
190
} ,
0 commit comments