|
1 | 1 | import '.';
|
2 | 2 |
|
3 | 3 | import { Story } from '@storybook/web-components';
|
4 |
| -import { |
5 |
| - InterfaceLookNames, |
6 |
| - InterfaceLookType, |
7 |
| -} from '@umbraco-ui/uui-base/lib/types'; |
8 | 4 | import { html } from 'lit-html';
|
9 | 5 |
|
10 | 6 | export default {
|
11 | 7 | title: 'Buttons/Button Group',
|
12 | 8 | component: 'uui-button-group',
|
13 | 9 | id: 'uui-button-group',
|
14 | 10 | args: {
|
15 |
| - look: '', |
| 11 | + look: 'primary', |
| 12 | + color: 'primary', |
16 | 13 | },
|
17 | 14 | argTypes: {
|
18 | 15 | look: {
|
19 | 16 | control: {
|
20 | 17 | type: 'select',
|
21 | 18 | },
|
22 |
| - options: InterfaceLookNames, |
| 19 | + options: ['default', 'primary', 'secondary', 'outline', 'placeholder'], |
| 20 | + }, |
| 21 | + color: { |
| 22 | + control: { |
| 23 | + type: 'select', |
| 24 | + }, |
| 25 | + options: ['primary', 'positive', 'warning', 'danger'], |
23 | 26 | },
|
24 | 27 | },
|
25 | 28 | };
|
26 | 29 |
|
| 30 | +const looks = ['default', 'primary', 'secondary', 'outline', 'placeholder']; |
| 31 | +const colors = ['primary', 'positive', 'warning', 'danger']; |
| 32 | + |
27 | 33 | export const AAAOverview: Story = props => html`
|
28 | 34 | <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> |
| 35 | + <uui-button |
| 36 | + look="${props.look}" |
| 37 | + color="${props.color}" |
| 38 | + label="Button 1"></uui-button> |
| 39 | + <uui-button |
| 40 | + look="${props.look}" |
| 41 | + color="${props.color}" |
| 42 | + label="Button 2"></uui-button> |
| 43 | + <uui-button |
| 44 | + look="${props.look}" |
| 45 | + color="${props.color}" |
| 46 | + label="Button 3"></uui-button> |
| 47 | + <uui-button |
| 48 | + look="${props.look}" |
| 49 | + color="${props.color}" |
| 50 | + label="Button 4"></uui-button> |
33 | 51 | </uui-button-group>
|
34 | 52 | `;
|
35 | 53 |
|
36 | 54 | AAAOverview.storyName = 'Overview';
|
37 | 55 |
|
38 |
| -export const Looks = () => html` |
39 |
| - ${InterfaceLookNames.map( |
40 |
| - (lookName: InterfaceLookType) => |
41 |
| - html` <div>${lookName}</div> |
| 56 | +export const MixedLooksAndColors = () => html` |
| 57 | + ${colors.map( |
| 58 | + color => html` |
| 59 | + <div style="margin-bottom: 32px"> |
| 60 | + <h4>${color}</h4> |
42 | 61 | <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 />` |
| 62 | + ${looks.map( |
| 63 | + look => html`<uui-button color=${color} look=${look}> |
| 64 | + ${look} |
| 65 | + </uui-button>` |
| 66 | + )} |
| 67 | + </uui-button-group> |
| 68 | + </div> |
| 69 | + ` |
50 | 70 | )}
|
51 | 71 | `;
|
52 | 72 |
|
53 |
| -Looks.parameters = { |
| 73 | +MixedLooksAndColors.parameters = { |
54 | 74 | controls: { disable: true },
|
55 | 75 | docs: {
|
56 | 76 | source: {
|
57 | 77 | code: `
|
58 | 78 | <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> |
| 79 | + <uui-button look="[look]" color="[color]>Button 1</uui-button> |
| 80 | + <uui-button look="[look]" color="[color]>Button 2</uui-button> |
| 81 | + <uui-button look="[look]" color="[color]>Button 3</uui-button> |
| 82 | + <uui-button look="[look]" color="[color]>Button 4</uui-button> |
63 | 83 | </uui-button-group>`,
|
64 | 84 | },
|
65 | 85 | },
|
66 | 86 | };
|
67 | 87 |
|
68 |
| -export const MixedLooks = () => |
69 |
| - html`<uui-button-group> |
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 |
| - |
76 |
| -MixedLooks.parameters = { |
77 |
| - controls: { disable: true }, |
78 |
| - docs: { |
79 |
| - source: { |
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>`, |
87 |
| - }, |
88 |
| - }, |
89 |
| -}; |
| 88 | +export const LooksAndColors = () => html` |
| 89 | + ${colors.map( |
| 90 | + color => html` |
| 91 | + <div style="margin-bottom: 32px; display: block"> |
| 92 | + <h4>${color}</h4> |
| 93 | + ${looks.map( |
| 94 | + look => html` |
| 95 | + <uui-button-group style="margin-bottom: 16px; display: block"> |
| 96 | + <uui-button |
| 97 | + look="outline" |
| 98 | + label="Button 1" |
| 99 | + color=${color} |
| 100 | + look=${look}></uui-button> |
| 101 | + <uui-button |
| 102 | + look="outline" |
| 103 | + label="Button 2" |
| 104 | + color=${color} |
| 105 | + look=${look}></uui-button> |
| 106 | + <uui-button |
| 107 | + look="outline" |
| 108 | + label="Button 3" |
| 109 | + color=${color} |
| 110 | + look=${look}></uui-button> |
| 111 | + <uui-button |
| 112 | + look="danger" |
| 113 | + label="Button 4" |
| 114 | + color=${color} |
| 115 | + look=${look}></uui-button> |
| 116 | + </uui-button-group> |
| 117 | + ` |
| 118 | + )} |
| 119 | + </div> |
| 120 | + ` |
| 121 | + )} |
| 122 | +`; |
90 | 123 |
|
91 | 124 | // export const Icon = () =>
|
92 | 125 | // html`<uui-button-group
|
|
0 commit comments