Skip to content

Commit 94ee863

Browse files
author
Warren Buckley
authored
docs(storybook): add badge improvements
* Improving docs for badge * Remove comment
1 parent 589667d commit 94ee863

File tree

1 file changed

+58
-9
lines changed

1 file changed

+58
-9
lines changed

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

Lines changed: 58 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -32,12 +32,14 @@ export default {
3232
},
3333
};
3434

35-
const Template: Story = props => html` <div
36-
style="position:relative; width:80px; height:80px; border: 2px dashed black;">
37-
<uui-badge .look=${props.look} ?attention=${props.attention}
38-
>${props.slot}</uui-badge
39-
>
40-
</div>`;
35+
const Template: Story = props => html` <uui-icon-registry-essential>
36+
<div
37+
style="position:relative; width:80px; height:80px; border: 2px dashed black;">
38+
<uui-badge .look=${props.look} ?attention=${props.attention}
39+
>${props.slot}</uui-badge
40+
>
41+
</div>
42+
</uui-icon-registry-essential>`;
4143

4244
export const AAAOverview = Template.bind({});
4345
AAAOverview.args = {
@@ -50,7 +52,7 @@ AAAOverview.parameters = {
5052
docs: {
5153
source: {
5254
code: `
53-
<div style="position:relative;">
55+
<div style="position:relative; width:80px; height:80px; border: 2px dashed black;">
5456
<uui-badge>1</uui-badge>
5557
</div>
5658
`,
@@ -64,6 +66,17 @@ WithAttention.args = {
6466
slot: '!',
6567
attention: true,
6668
};
69+
WithAttention.parameters = {
70+
docs: {
71+
source: {
72+
code: `
73+
<div style="position:relative; width:80px; height:80px; border: 2px dashed black;">
74+
<uui-badge look="danger" attention>!</uui-badge>
75+
</div>
76+
`,
77+
},
78+
},
79+
};
6780

6881
export const WithText = Template.bind({});
6982
WithText.args = {
@@ -74,7 +87,9 @@ WithText.parameters = {
7487
docs: {
7588
source: {
7689
code: `
90+
<div style="position:relative; width:80px; height:80px; border: 2px dashed black;">
7791
<uui-badge look="positive">Published</uui-badge>
92+
</div>
7893
`,
7994
},
8095
},
@@ -83,7 +98,22 @@ WithText.parameters = {
8398
export const WithIcon = Template.bind({});
8499
WithIcon.args = {
85100
look: 'positive',
86-
slot: html`<uui-icon name="info"></uui-icon>`,
101+
slot: html`<uui-icon name="favorite"></uui-icon>`,
102+
};
103+
WithIcon.parameters = {
104+
docs: {
105+
source: {
106+
code: `
107+
<div style="position:relative; width:80px; height:80px; border: 2px dashed black;">
108+
<uui-icon-registry-essential>
109+
<uui-badge look="positive">
110+
<uui-icon name="favorite"></uui-icon>
111+
</uui-badge>
112+
</uui-icon-registry-essential>
113+
</div>
114+
`,
115+
},
116+
},
87117
};
88118

89119
export const OnButton: Story = props => html` <uui-button look="outline">
@@ -99,7 +129,7 @@ OnButton.parameters = {
99129
source: {
100130
code: `
101131
<uui-button look="outline">
102-
<uui-badge look="positive">!</uui-badge>
132+
<uui-badge look="danger">!</uui-badge>
103133
Button label
104134
</uui-button>
105135
`,
@@ -122,3 +152,22 @@ Looks.args = {
122152
look: 'primary',
123153
slot: '!',
124154
};
155+
156+
let lookNamesDocsCode = '';
157+
InterfaceLookNames.forEach((lookName: InterfaceLookType) => {
158+
lookNamesDocsCode =
159+
lookNamesDocsCode +
160+
`
161+
<div style="position:relative; display:inline-block; width:10px; height:10px; margin-right:16px;">
162+
<uui-badge look="${lookName}">!</uui-badge>
163+
</div>
164+
`;
165+
});
166+
167+
Looks.parameters = {
168+
docs: {
169+
source: {
170+
code: lookNamesDocsCode,
171+
},
172+
},
173+
};

0 commit comments

Comments
 (0)