-
Notifications
You must be signed in to change notification settings - Fork 6
/
button.stories.js
73 lines (58 loc) 路 2.44 KB
/
button.stories.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
import '@vonage/vwc-button/vwc-button.js';
import '@vonage/vwc-circular-progress';
import { html } from 'lit-element';
import { spread } from '@open-wc/lit-helpers';
import { argTypes } from './arg-types.js';
export default {
title: 'Components/Button',
component: 'vwc-button',
argTypes
};
const Template = args => html`<vwc-button ...=${spread(args)}>`;
export const Basic = Template.bind({});
Basic.args = { label: 'Basic', layout: 'text' };
export const Filled = Template.bind({});
Filled.args = { label: 'Filled', layout: 'filled' };
export const Outlined = Template.bind({});
Outlined.args = { label: 'Outlined', layout: 'outlined' };
export const PillShape = Template.bind({});
PillShape.args = { label: 'Filled', layout: 'filled', shape: 'pill' };
export const Dense = Template.bind({});
Dense.args = { label: 'Dense', layout: 'filled', dense: '' };
export const Enlarged = Template.bind({});
Enlarged.args = { label: 'Enlarged', layout: 'filled', enlarged: '' };
export const Icon = Template.bind({});
Icon.args = { label: 'Icon', layout: 'filled', icon: 'download' };
export const Stacked = Template.bind({});
Stacked.args = { label: 'Action', layout: 'filled', icon: 'compose-line', stacked: '' };
export const Disabled = Template.bind({});
Disabled.args = { label: 'Disabled', layout: 'filled', disabled: '' };
const TemplateState = args => html`<vwc-button ...=${spread(args)}>
<vwc-circular-progress
slot="trailingIcon"
indeterminate
density="-7.5"
></vwc-circular-progress>
</vwc-button>`;
export const Pending = TemplateState.bind({});
Pending.args = { label: 'Pending', layout: 'filled', disabled: '' };
const TemplateSizes = args => html`
<style>
.wrapper {
display: grid;
grid-template-columns: repeat(2, 100px);
gap: 2rem;
justify-items: center;
}
</style>
<div class="wrapper">
<vwc-button label="Button" layout="filled" dense ...=${spread(args)}></vwc-button>
<vwc-button label="Button" layout="filled" icon="calendar-line" dense ...=${spread(args)}></vwc-button>
<vwc-button label="Button" layout="filled" ...=${spread(args)}></vwc-button>
<vwc-button label="Button" layout="filled" icon="calendar-line" ...=${spread(args)}></vwc-button>
<vwc-button label="Button" layout="filled" enlarged ...=${spread(args)}></vwc-button>
<vwc-button label="Button" layout="filled" icon="calendar-line" enlarged ...=${spread(args)}></vwc-button>
</div>
<vwc-button >
</vwc-button>`;
export const MixesSizes = TemplateSizes.bind({});