Skip to content

Commit cb0ea1f

Browse files
committed
align user card examples
1 parent 74f9a1d commit cb0ea1f

File tree

1 file changed

+54
-38
lines changed

1 file changed

+54
-38
lines changed

packages/uui-card-user/lib/uui-card-user.story.ts

Lines changed: 54 additions & 38 deletions
Original file line numberDiff line numberDiff line change
@@ -9,21 +9,26 @@ export default {
99
args: {
1010
name: 'John Rabbit',
1111
},
12+
decorators: [
13+
(Story: any) => html`<div style="width: 200px;">${Story()}</div>`,
14+
],
1215
};
1316

17+
const cardContent = html`
18+
<div style="margin-bottom: 12px">Editors</div>
19+
<div>Has not logged in yet</div>
20+
`;
21+
1422
const Template: Story = props => html`
15-
<div style="width: 200px">
16-
<uui-card-user
17-
name=${props.name}
18-
?selectable=${props.selectable}
19-
?select-only=${props.selectOnly}
20-
?selected=${props.selected}
21-
?error=${props.error}
22-
?disabled=${props.disabled}>
23-
<div style="margin-bottom: 12px">Editors</div>
24-
<div>Has not logged in yet</div>
25-
</uui-card-user>
26-
</div>
23+
<uui-card-user
24+
name=${props.name}
25+
?selectable=${props.selectable}
26+
?select-only=${props.selectOnly}
27+
?selected=${props.selected}
28+
?error=${props.error}
29+
?disabled=${props.disabled}>
30+
${cardContent}
31+
</uui-card-user>
2732
`;
2833

2934
export const AAAOverview = Template.bind({});
@@ -47,7 +52,9 @@ Selectable.parameters = {
4752
docs: {
4853
source: {
4954
code: `
50-
<uui-card-user name="John Rabbit" selectable></uui-card-user>`,
55+
<uui-card-user name="John Rabbit" selectable>
56+
<!-- Content -->
57+
</uui-card-user>`,
5158
},
5259
},
5360
};
@@ -59,11 +66,13 @@ SelectOnly.args = {
5966
};
6067

6168
SelectOnly.parameters = {
62-
controls: { include: ['selectable'] },
69+
controls: { include: ['selectable, selectOnly'] },
6370
docs: {
6471
source: {
6572
code: `
66-
<uui-card-user name="John Rabbit" selectable></uui-card-user>`,
73+
<uui-card-user name="John Rabbit" selectable select-only>
74+
<!-- Content -->
75+
</uui-card-user>`,
6776
},
6877
},
6978
};
@@ -78,7 +87,9 @@ Disabled.parameters = {
7887
docs: {
7988
source: {
8089
code: `
81-
<uui-card-user name="John Rabbit" disabled></uui-card-user>`,
90+
<uui-card-user name="John Rabbit" disabled>
91+
<!-- Content -->
92+
</uui-card-user>`,
8293
},
8394
},
8495
};
@@ -93,50 +104,55 @@ Error.parameters = {
93104
docs: {
94105
source: {
95106
code: `
96-
<uui-card-user name="John Rabbit" error></uui-card-user>`,
107+
<uui-card-user name="John Rabbit" error>
108+
<!-- Content -->
109+
</uui-card-user>`,
97110
},
98111
},
99112
};
100113

101114
export const Actions: Story = () => html`
102-
<div style="width: 200px">
103-
<uui-card-user name="John Rabbit">
104-
<uui-action-bar slot="actions">
105-
<uui-button label="Remove">Remove</uui-button>
106-
</uui-action-bar>
107-
</uui-card-user>
108-
</div>
115+
<uui-card-user name="John Rabbit">
116+
<uui-action-bar slot="actions">
117+
<uui-button label="Remove">Remove</uui-button>
118+
</uui-action-bar>
119+
120+
${cardContent}
121+
</uui-card-user>
109122
`;
110123

111124
Actions.parameters = {
112125
docs: {
113126
source: {
114127
code: `
115-
<uui-card-user
116-
name="John Rabbit">
117-
<uui-action-bar slot="actions">
118-
<uui-button label="Remove">Remove</uui-button>
119-
</uui-action-bar>
120-
</uui-card-user>`,
128+
<uui-card-user name="John Rabbit">
129+
<uui-action-bar slot="actions">
130+
<uui-button label="Remove">Remove</uui-button>
131+
</uui-action-bar>
132+
133+
<!-- Content -->
134+
</uui-card-user>`,
121135
},
122136
},
123137
};
124138

125139
export const Tags: Story = () => html`
126-
<div style="width: 200px">
127-
<uui-card-user name="John Rabbit">
128-
<uui-tag slot="tag" size="s" look="danger">Disabled</uui-tag>
129-
</uui-card-user>
130-
</div>
140+
<uui-card-user name="John Rabbit">
141+
<uui-tag slot="tag" size="s" look="danger">Disabled</uui-tag>
142+
143+
${cardContent}
144+
</uui-card-user>
131145
`;
132146

133147
Tags.parameters = {
134148
docs: {
135149
source: {
136150
code: `
137-
<uui-card-user name="John Rabbit">
138-
<uui-tag slot="tag" size="s" look="danger">Disabled</uui-tag>
139-
</uui-card-user>`,
151+
<uui-card-user name="John Rabbit">
152+
<uui-tag slot="tag" size="s" look="danger">Disabled</uui-tag>
153+
154+
<!-- Content -->
155+
</uui-card-user>`,
140156
},
141157
},
142158
};

0 commit comments

Comments
 (0)