-
Notifications
You must be signed in to change notification settings - Fork 6
/
side-drawer-as-container.stories.js
170 lines (152 loc) · 4.97 KB
/
side-drawer-as-container.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
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
import '@vonage/vwc-side-drawer';
import '@vonage/vwc-top-app-bar';
import '@vonage/vwc-top-app-bar-fixed';
import '@vonage/vwc-icon';
import '@vonage/vwc-layout';
import '@vonage/vwc-list';
import '@vonage/vwc-list/vwc-list-item';
import '@vonage/vwc-list/vwc-list-expansion-panel';
import '@vonage/vwc-text';
import { html } from 'lit-element';
import { spread } from '@open-wc/lit-helpers';
export default {
title: 'Getting Started/Usage Examples/Side Drawer',
argTypes: {
alternate: {
control: {
type: 'inline-radio',
options: { true: '', false: undefined }
}
},
open: {
control: {
type: 'inline-radio',
options: { true: '', false: undefined }
}
},
type: {
control: {
type: 'select',
options: ['', 'modal', 'dismissible'],
}
},
}
};
const style = html`
<style>
.sb-show-main.sb-main-padded {
padding: 0;
}
vwc-side-drawer#side-drawer{
--side-drawer-background-color: var(--vvd-color-neutral-10);
}
</style>
`;
const loremIpsum = () => html`
<vwc-layout gutters="md">
<div>
Lorem Ipsum is simply dummy text of the printing and typesetting industry. Lorem Ipsum has been the industry's
standard dummy text ever since the 1500s, when an unknown printer took a galley of type and scrambled it to make
a type specimen book. It has survived not only five centuries, but also the leap into electronic typesetting,
remaining essentially unchanged. It was popularised in the 1960s with the release of Letraset sheets containing
Lorem Ipsum passages, and more recently with desktop publishing software like Aldus PageMaker including versions
of Lorem Ipsum.
</div>
</vwc-layout>
`;
const content = () => Array(20).fill().map(loremIpsum);
const sideDrawerContent = html`
<span slot="top-bar">
<vwc-icon type="vonage-mono"></vwc-icon>
<vwc-text font-face="body-1-bold"> VONAGE</vwc-text>
</span>
<vwc-list innerRole="navigation" innerAriaLabel="Primary navigation" itemRoles="link">
<vwc-list-item shape="rounded" graphic="icon">
<vwc-icon slot="graphic" type="home-line"></vwc-icon>1st level item
</vwc-list-item>
<p>
<vwc-text font-face="body-2-bold">SECTION TITLE</vwc-text>
</p>
<vwc-list-item shape="rounded" graphic="icon">
<vwc-icon slot="graphic" type="chat-line"></vwc-icon>1st level item
</vwc-list-item>
<vwc-list-expansion-panel open>
<vwc-list-item slot="header" shape="rounded" graphic="icon">
<vwc-icon slot="graphic" type="chat-line"></vwc-icon>1st level item
</vwc-list-item>
<vwc-list-expansion-panel open>
<vwc-list-item slot="header" shape="rounded">2nd level item</vwc-list-item>
<vwc-list-item shape="rounded">3rd level item</vwc-list-item>
<vwc-list-item shape="rounded">3rd level item</vwc-list-item>
</vwc-list-expansion-panel>
</vwc-list-expansion-panel>
<p>
<vwc-text font-face="body-2-bold">SECTION TITLE</vwc-text>
</p>
<vwc-list-expansion-panel>
<vwc-list-item slot="header" shape="rounded" graphic="icon">
<vwc-icon slot="graphic" type="chat-line"></vwc-icon>1st level item
</vwc-list-item>
<vwc-list-item shape="rounded">2nd level item</vwc-list-item>
<vwc-list-item shape="rounded">2nd level item</vwc-list-item>
</vwc-list-expansion-panel>
</vwc-list>`;
const topAppBarContent = html`
<div slot="actionItems">
<vwc-button label="Action" layout="outlined" icon="search-line" type="submit">
<button type="submit" style="display: none;"></button>
</vwc-button>
<vwc-button label="Action" layout="outlined" icon="info-line" type="submit">
<button type="submit" style="display: none;"></button>
</vwc-button>
<vwc-button label="Action" layout="outlined" icon="share-line" type="submit">
<button type="submit" style="display: none;"></button>
</vwc-button>
</div>
`;
const topAppBarFixedContent = html`
<div slot="actionItems">
<vwc-icon-button icon="search-line"></vwc-icon-button>
<vwc-icon-button icon="info-line"></vwc-icon-button>
<vwc-icon-button icon="share-line"></vwc-icon-button>
</div>
`;
const WithAppContentTemplate = args => html`
${style}
<vwc-side-drawer id="side-drawer" hastopbar ...=${spread(args)}>
${sideDrawerContent}
<main slot="app-content">
${content()}
</main>
</vwc-side-drawer>
`;
export const WithAppContent = WithAppContentTemplate.bind({});
WithAppContent.args = {};
const WithTopAppBarTemplate = args => html`
${style}
<vwc-side-drawer alternate hastopbar ...=${spread(args)}>
${sideDrawerContent}
<vwc-top-app-bar slot="app-content">
${topAppBarContent}
<main>
${content()}
</main>
</vwc-top-app-bar>
</vwc-side-drawer>
`;
export const WithTopAppBar = WithTopAppBarTemplate.bind({});
WithTopAppBar.args = {};
const WithTopAppBarFixedTemplate = args => html`
${style}
<vwc-side-drawer alternate hastopbar ...=${spread(args)}>
${sideDrawerContent}
<vwc-top-app-bar-fixed slot="app-content">
${topAppBarFixedContent}
<main>
${content()}
</main>
</vwc-top-app-bar-fixed>
</vwc-side-drawer>
`;
export const WithTopAppBarFixed = WithTopAppBarFixedTemplate.bind({});
WithTopAppBarFixed.args = {};