Skip to content

Commit 8c91288

Browse files
committed
docs(storybook): handle the default slot
1 parent 9e87aa7 commit 8c91288

File tree

1 file changed

+16
-10
lines changed

1 file changed

+16
-10
lines changed

packages/uui-badge/lib/uui-badge.story.ts

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ export default {
1313
id: 'uui-badge',
1414
args: {
1515
look: 'primary',
16-
default: '1',
16+
slot: '1',
1717
attention: false,
1818
},
1919
argTypes: {
@@ -29,22 +29,25 @@ export default {
2929
],
3030
control: { type: 'select' },
3131
},
32+
slot: {
33+
control: { type: 'text' },
34+
},
3235
},
3336
};
3437

3538
const Template: Story = props => html` <uui-icon-registry-essential>
3639
<div
3740
style="position:relative; width:80px; height:80px; border: 2px dashed black;">
3841
<uui-badge .look=${props.look} ?attention=${props.attention}
39-
>${props.default}</uui-badge
42+
>${props.slot}</uui-badge
4043
>
4144
</div>
4245
</uui-icon-registry-essential>`;
4346

4447
export const AAAOverview = Template.bind({});
4548
AAAOverview.args = {
4649
look: 'primary',
47-
default: '1',
50+
slot: '1',
4851
attention: false,
4952
};
5053
AAAOverview.storyName = 'Overview';
@@ -63,7 +66,7 @@ AAAOverview.parameters = {
6366
export const WithAttention = Template.bind({});
6467
WithAttention.args = {
6568
look: 'danger',
66-
default: '!',
69+
slot: '!',
6770
attention: true,
6871
};
6972
WithAttention.parameters = {
@@ -81,7 +84,7 @@ WithAttention.parameters = {
8184
export const WithText = Template.bind({});
8285
WithText.args = {
8386
look: 'positive',
84-
default: 'Published',
87+
slot: 'Published',
8588
};
8689
WithText.parameters = {
8790
docs: {
@@ -98,9 +101,12 @@ WithText.parameters = {
98101
export const WithIcon = Template.bind({});
99102
WithIcon.args = {
100103
look: 'positive',
101-
default: html`<uui-icon name="favorite"></uui-icon>`,
104+
slot: html`<uui-icon name="favorite"></uui-icon>`,
102105
};
103106
WithIcon.parameters = {
107+
controls: {
108+
exclude: ['slot'],
109+
},
104110
docs: {
105111
source: {
106112
code: `
@@ -118,11 +124,11 @@ WithIcon.parameters = {
118124

119125
export const OnButton: Story = props => html` <uui-button look="outline">
120126
Button label
121-
<uui-badge .look=${props.look}>${props.default}</uui-badge>
127+
<uui-badge .look=${props.look}>${props.slot}</uui-badge>
122128
</uui-button>`;
123129
OnButton.args = {
124130
look: 'danger',
125-
default: '!',
131+
slot: '!',
126132
};
127133
OnButton.parameters = {
128134
docs: {
@@ -143,14 +149,14 @@ export const Looks: Story = props => html`
143149
html`<div
144150
style="position:relative; display:inline-block; width:10px; height:10px; margin-right: 16px;">
145151
<uui-badge .look=${lookName} ?attention=${props.attention}
146-
>${props.default}</uui-badge
152+
>${props.slot}</uui-badge
147153
>
148154
</div>`
149155
)}
150156
`;
151157
Looks.args = {
152158
look: 'primary',
153-
default: '!',
159+
slot: '!',
154160
};
155161

156162
let lookNamesDocsCode = '';

0 commit comments

Comments
 (0)