Skip to content

Commit 55bf623

Browse files
committed
simplify button group docs
1 parent 1d69353 commit 55bf623

File tree

1 file changed

+58
-44
lines changed

1 file changed

+58
-44
lines changed

packages/uui-button-group/lib/uui-button-group.story.ts

Lines changed: 58 additions & 44 deletions
Original file line numberDiff line numberDiff line change
@@ -11,65 +11,79 @@ export default {
1111
title: 'Buttons/Button Group',
1212
component: 'uui-button-group',
1313
id: 'uui-button-group',
14+
args: {
15+
look: '',
16+
},
17+
argTypes: {
18+
look: {
19+
control: {
20+
type: 'select',
21+
},
22+
options: InterfaceLookNames,
23+
},
24+
},
1425
};
1526

16-
const buttons = ['development', 'staging', 'live'];
27+
export const AAAOverview: Story = props => html`
28+
<uui-button-group>
29+
<uui-button look="${props.look}" label="Button 1"></uui-button>
30+
<uui-button look="${props.look}" label="Button 2"></uui-button>
31+
<uui-button look="${props.look}" label="Button 3"></uui-button>
32+
<uui-button look="${props.look}" label="Button 4"></uui-button>
33+
</uui-button-group>
34+
`;
1735

18-
export const AAAOverview: Story = () =>
19-
html`<uui-button-group
20-
>${buttons.map(
21-
el => html`<uui-button look="secondary">${el}</uui-button>`
22-
)}</uui-button-group
23-
>`;
2436
AAAOverview.storyName = 'Overview';
25-
AAAOverview.parameters = {
26-
docs: {
27-
source: {
28-
code: html`<uui-button-group>
29-
<uui-button look="secondary">development</uui-button>
30-
<uui-button look="secondary">staging</uui-button>
31-
<uui-button look="secondary">live</uui-button>
32-
</uui-button-group>`.strings,
33-
},
34-
},
35-
};
3637

37-
function uppercaseFirstLetter(s: string) {
38-
return s.charAt(0).toUpperCase() + s.slice(1);
39-
}
40-
export const AllStyles = () => html`
38+
export const Looks = () => html`
4139
${InterfaceLookNames.map(
4240
(lookName: InterfaceLookType) =>
43-
html` <uui-button-group>
44-
<uui-button .look=${lookName}>
45-
${uppercaseFirstLetter(lookName)} look
46-
</uui-button>
47-
<uui-button .look=${lookName}> Second option </uui-button>
48-
<uui-button .look=${lookName}> Small </uui-button>
49-
<uui-button .look=${lookName}>
50-
Large other option
51-
</uui-button> </uui-button-group
52-
><br /><br /><br />`
41+
html` <div>${lookName}</div>
42+
<uui-button-group>
43+
<uui-button .look=${lookName} label="Button 1"></uui-button>
44+
<uui-button .look=${lookName} label="Button 2"></uui-button>
45+
<uui-button .look=${lookName} label="Button 3"></uui-button>
46+
<uui-button
47+
.look=${lookName}
48+
label="Button 4"></uui-button> </uui-button-group
49+
><br /><br />`
5350
)}
5451
`;
5552

53+
Looks.parameters = {
54+
controls: { disable: true },
55+
docs: {
56+
source: {
57+
code: `
58+
<uui-button-group>
59+
<uui-button look="[look]">Button 1</uui-button>
60+
<uui-button look="[look]">Button 2</uui-button>
61+
<uui-button look="[look]">Button 3</uui-button>
62+
<uui-button look="[look]">Button 4</uui-button>
63+
</uui-button-group>`,
64+
},
65+
},
66+
};
67+
5668
export const MixedLooks = () =>
5769
html`<uui-button-group>
58-
<uui-button look="primary">Hello</uui-button>
59-
${buttons.map(
60-
el => html`<uui-button look="secondary">${el}</uui-button>`
61-
)}<uui-button look="danger">World</uui-button></uui-button-group
62-
>`;
70+
<uui-button look="outline" label="Button 1"></uui-button>
71+
<uui-button look="outline" label="Button 2"></uui-button>
72+
<uui-button look="outline" label="Button 3"></uui-button>
73+
<uui-button look="danger" label="Button 4"></uui-button>
74+
</uui-button-group>`;
75+
6376
MixedLooks.parameters = {
77+
controls: { disable: true },
6478
docs: {
6579
source: {
66-
code: html`<uui-button-group>
67-
<uui-button look="primary">Hello</uui-button>
68-
<uui-button>development</uui-button>
69-
<uui-button>staging</uui-button>
70-
<uui-button>live</uui-button>
71-
<uui-button look="danger">World</uui-button>
72-
</uui-button-group>`.strings,
80+
code: `
81+
<uui-button-group>
82+
<uui-button look="outline">Button 1</uui-button>
83+
<uui-button look="outline">Button 2</uui-button>
84+
<uui-button look="outline">Button 3</uui-button>
85+
<uui-button look="danger">Button 4</uui-button>
86+
</uui-button-group>`,
7387
},
7488
},
7589
};

0 commit comments

Comments
 (0)