-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.html
251 lines (208 loc) · 16.2 KB
/
index.html
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
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
<!doctype html>
<html lang="en">
<head>
<meta charset="UTF-8" />
<link rel="icon" type="image/svg+xml" href="/vite.svg" />
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title>Vite + Lit + TS</title>
<link rel="stylesheet" href="./src/index.css" />
<script type="module" src="/src/components/button/button.ts"></script>
<script type="module" src="/src/components/form-control-enhancer/form-control-enhancer.ts"></script>
<script type="module" src="/src/components/typography/typography.ts"></script>
<style>
.special-button::part(root) {
background-color: aquamarine;
color: #000;
}
h1,
h2,
h3,
h4,
h5,
h6 {
color: salmon;
}
p {
color: red;
}
</style>
</head>
<body>
<wds-typography appearance="h1" no-margins="both">Playground</wds-typography>
<article>
<wds-typography appearance="h2">h2 - Title</wds-typography>
<wds-typography appearance="h2">h2 - Title</wds-typography>
<wds-typography>Lorem ipsum dolor sit amet consectetur adipisicing elit. Ducimus, dolores. Quia, voluptatum corporis? Velit, voluptates. Ullam quaerat asperiores quam fugit tempore recusandae, nesciunt neque dolor? Iste, corporis eligendi aliquid quod quam quasi dolorem laudantium unde reprehenderit provident alias exercitationem, nam inventore quo natus pariatur. Voluptates doloremque aliquid ea! Odit mollitia modi qui nemo id rerum! Doloremque repudiandae asperiores voluptatem eos et libero dolor amet reiciendis praesentium eligendi! Et tempora, reprehenderit nemo sed eum ratione quisquam consequatur eius? Blanditiis, illo. Nisi quaerat, esse quasi aliquid maxime fuga vero blanditiis explicabo dignissimos consequuntur molestiae eum ex. Consequuntur eveniet in enim mollitia laborum?</wds-typography>
<p>HOST Lorem ipsum dolor sit amet consectetur adipisicing elit. Ducimus, dolores. Quia, voluptatum corporis? Velit, voluptates. Ullam quaerat asperiores quam fugit tempore recusandae, nesciunt neque dolor? Iste, corporis eligendi aliquid quod quam quasi dolorem laudantium unde reprehenderit provident alias exercitationem, nam inventore quo natus pariatur. Voluptates doloremque aliquid ea! Odit mollitia modi qui nemo id rerum! Doloremque repudiandae asperiores voluptatem eos et libero dolor amet reiciendis praesentium eligendi! Et tempora, reprehenderit nemo sed eum ratione quisquam consequatur eius? Blanditiis, illo. Nisi quaerat, esse quasi aliquid maxime fuga vero blanditiis explicabo dignissimos consequuntur molestiae eum ex. Consequuntur eveniet in enim mollitia laborum?</p>
<wds-typography appearance="h2">h2 - Title</wds-typography>
<wds-typography>Lorem ipsum dolor sit amet consectetur adipisicing elit. Ducimus, dolores. Quia, voluptatum corporis? Velit, voluptates. Ullam quaerat asperiores quam fugit tempore recusandae, nesciunt neque dolor? Iste, corporis eligendi aliquid quod quam quasi dolorem laudantium unde reprehenderit provident alias exercitationem, nam inventore quo natus pariatur. Voluptates doloremque aliquid ea! Odit mollitia modi qui nemo id rerum! Doloremque repudiandae asperiores voluptatem eos et libero dolor amet reiciendis praesentium eligendi! Et tempora, reprehenderit nemo sed eum ratione quisquam consequatur eius? Blanditiis, illo. Nisi quaerat, esse quasi aliquid maxime fuga vero blanditiis explicabo dignissimos consequuntur molestiae eum ex. Consequuntur eveniet in enim mollitia laborum?</wds-typography>
<wds-typography appearance="h3">h3 - Title</wds-typography>
<wds-typography>Lorem ipsum dolor sit amet consectetur adipisicing elit. Ducimus, dolores. Quia, voluptatum corporis? Velit, voluptates. Ullam quaerat asperiores quam fugit tempore recusandae, nesciunt neque dolor? Iste, corporis eligendi aliquid quod quam quasi dolorem laudantium unde reprehenderit provident alias exercitationem, nam inventore quo natus pariatur. Voluptates doloremque aliquid ea! Odit mollitia modi qui nemo id rerum! Doloremque repudiandae asperiores voluptatem eos et libero dolor amet reiciendis praesentium eligendi! Et tempora, reprehenderit nemo sed eum ratione quisquam consequatur eius? Blanditiis, illo. Nisi quaerat, esse quasi aliquid maxime fuga vero blanditiis explicabo dignissimos consequuntur molestiae eum ex. Consequuntur eveniet in enim mollitia laborum?</wds-typography>
<wds-typography>Lorem ipsum dolor sit amet consectetur adipisicing elit. Ducimus, dolores. Quia, voluptatum corporis? Velit, voluptates. Ullam quaerat asperiores quam fugit tempore recusandae, nesciunt neque dolor? Iste, corporis eligendi aliquid quod quam quasi dolorem laudantium unde reprehenderit provident alias exercitationem, nam inventore quo natus pariatur. Voluptates doloremque aliquid ea! Odit mollitia modi qui nemo id rerum! Doloremque repudiandae asperiores voluptatem eos et libero dolor amet reiciendis praesentium eligendi! Et tempora, reprehenderit nemo sed eum ratione quisquam consequatur eius? Blanditiis, illo. Nisi quaerat, esse quasi aliquid maxime fuga vero blanditiis explicabo dignissimos consequuntur molestiae eum ex. Consequuntur eveniet in enim mollitia laborum?</wds-typography>
<wds-typography>Lorem ipsum dolor sit amet consectetur adipisicing elit. Ducimus, dolores. Quia, voluptatum corporis? Velit, voluptates. Ullam quaerat asperiores quam fugit tempore recusandae, nesciunt neque dolor? Iste, corporis eligendi aliquid quod quam quasi dolorem laudantium unde reprehenderit provident alias exercitationem, nam inventore quo natus pariatur. Voluptates doloremque aliquid ea! Odit mollitia modi qui nemo id rerum! Doloremque repudiandae asperiores voluptatem eos et libero dolor amet reiciendis praesentium eligendi! Et tempora, reprehenderit nemo sed eum ratione quisquam consequatur eius? Blanditiis, illo. Nisi quaerat, esse quasi aliquid maxime fuga vero blanditiis explicabo dignissimos consequuntur molestiae eum ex. Consequuntur eveniet in enim mollitia laborum?</wds-typography>
<wds-typography appearance="h4">h4 - Title</wds-typography>
<wds-typography>Lorem ipsum dolor sit amet consectetur adipisicing elit. Ducimus, dolores. Quia, voluptatum corporis? Velit, voluptates. Ullam quaerat asperiores quam fugit tempore recusandae, nesciunt neque dolor? Iste, corporis eligendi aliquid quod quam quasi dolorem laudantium unde reprehenderit provident alias exercitationem, nam inventore quo natus pariatur. Voluptates doloremque aliquid ea! Odit mollitia modi qui nemo id rerum! Doloremque repudiandae asperiores voluptatem eos et libero dolor amet reiciendis praesentium eligendi! Et tempora, reprehenderit nemo sed eum ratione quisquam consequatur eius? Blanditiis, illo. Nisi quaerat, esse quasi aliquid maxime fuga vero blanditiis explicabo dignissimos consequuntur molestiae eum ex. Consequuntur eveniet in enim mollitia laborum?</wds-typography>
<wds-typography appearance="h5">h5 - Title</wds-typography>
<wds-typography>Lorem ipsum dolor sit amet consectetur adipisicing elit. Ducimus, dolores. Quia, voluptatum corporis? Velit, voluptates. Ullam quaerat asperiores quam fugit tempore recusandae, nesciunt neque dolor? Iste, corporis eligendi aliquid quod quam quasi dolorem laudantium unde reprehenderit provident alias exercitationem, nam inventore quo natus pariatur. Voluptates doloremque aliquid ea! Odit mollitia modi qui nemo id rerum! Doloremque repudiandae asperiores voluptatem eos et libero dolor amet reiciendis praesentium eligendi! Et tempora, reprehenderit nemo sed eum ratione quisquam consequatur eius? Blanditiis, illo. Nisi quaerat, esse quasi aliquid maxime fuga vero blanditiis explicabo dignissimos consequuntur molestiae eum ex. Consequuntur eveniet in enim mollitia laborum?</wds-typography>
<wds-typography appearance="h6">h6 - Title</wds-typography>
<wds-typography>Lorem ipsum dolor sit amet consectetur adipisicing elit. Ducimus, dolores. Quia, voluptatum corporis? Velit, voluptates. Ullam quaerat asperiores quam fugit tempore recusandae, nesciunt neque dolor? Iste, corporis eligendi aliquid quod quam quasi dolorem laudantium unde reprehenderit provident alias exercitationem, nam inventore quo natus pariatur. Voluptates doloremque aliquid ea! Odit mollitia modi qui nemo id rerum! Doloremque repudiandae asperiores voluptatem eos et libero dolor amet reiciendis praesentium eligendi! Et tempora, reprehenderit nemo sed eum ratione quisquam consequatur eius? Blanditiis, illo. Nisi quaerat, esse quasi aliquid maxime fuga vero blanditiis explicabo dignissimos consequuntur molestiae eum ex. Consequuntur eveniet in enim mollitia laborum?</wds-typography>
</article>
<p>HOST Lorem ipsum dolor sit amet consectetur adipisicing elit. Ducimus, dolores. Quia, voluptatum corporis? Velit, voluptates. Ullam quaerat asperiores quam fugit tempore recusandae, nesciunt neque dolor? Iste, corporis eligendi aliquid quod quam quasi dolorem laudantium unde reprehenderit provident alias exercitationem, nam inventore quo natus pariatur. Voluptates doloremque aliquid ea! Odit mollitia modi qui nemo id rerum! Doloremque repudiandae asperiores voluptatem eos et libero dolor amet reiciendis praesentium eligendi! Et tempora, reprehenderit nemo sed eum ratione quisquam consequatur eius? Blanditiis, illo. Nisi quaerat, esse quasi aliquid maxime fuga vero blanditiis explicabo dignissimos consequuntur molestiae eum ex. Consequuntur eveniet in enim mollitia laborum?</p>
<div>
<wds-button>Button default</wds-button>
<wds-button disabled>Button default disabled</wds-button>
<wds-button danger>Button danger</wds-button>
<wds-button full-width>Button default full-width</wds-button>
<wds-button disabled full-width>Button default disabled full-width</wds-button>
<hr>
<wds-button appearance="accent">Button accent</wds-button>
<wds-button appearance="accent" disabled>Button accent disabled</wds-button>
<wds-button appearance="accent" full-width>Button accent full-width</wds-button>
<wds-button appearance="accent" disabled full-width>Button accent disabled full-width</wds-button>
</div>
<hr>
<wds-form-control-enhancer>
<select required>
<option value="">Select option</option>
<option value="1">Option 1</option>
<option value="2">Option 2</option>
<option value="3">Option 3</option>
<option value="4">Option 4</option>
</select>
</wds-form-control-enhancer>
<wds-form-control-enhancer full-width>
<select>
<option value="">Pick</option>
<option value="1">1. asdas</option>
<option value="2">2. asdas</option>
<option value="3">3. asdas</option>
<option value="4">4. asdas</option>
</select>
</wds-form-control-enhancer>
<hr>
<form id="js-special-form">
<input type="text" name="readonly2" readonly value="readonly2" />
<fieldset>
<legend>
Yes or No?<span aria-label="required">*</span>
</legend>
<wds-form-control-enhancer>
<input type="radio" required name="driver" id="r1" value="yes" />
</wds-form-control-enhancer>
<label for="r1">Yes</label>
<wds-form-control-enhancer>
<input type="radio" required name="driver" id="r2" value="no" />
</wds-form-control-enhancer>
<label for="r2">No</label>
</fieldset>
<fieldset>
<wds-form-control-enhancer>
<input type="checkbox" required />
</wds-form-control-enhancer>
</fieldset>
<wds-form-control-enhancer>
<textarea name="textarea">textarea</textarea>
</wds-form-control-enhancer>
<wds-form-control-enhancer>
<input type="checkbox" name="check" value="check" />
</wds-form-control-enhancer>
<wds-form-control-enhancer>
<input type="range" name="range" value="range" />
</wds-form-control-enhancer>
<wds-form-control-enhancer>
<input type="text" name="demo" value="demo" />
</wds-form-control-enhancer>
<wds-form-control-enhancer full-width>
<input type="text" name="placeholder" placeholder="placeholder" />
</wds-form-control-enhancer>
<wds-form-control-enhancer>
<input type="text" name="disabled" placeholder="disabled" disabled />
</wds-form-control-enhancer>
<wds-form-control-enhancer>
<input type="text" name="readonly" readonly value="readonly" />
</wds-form-control-enhancer>
<wds-form-control-enhancer>
<input type="checkbox" name="check" value="check" />
</wds-form-control-enhancer>
<wds-form-control-enhancer full-width>
<input type="range" name="range" value="range" />
</wds-form-control-enhancer>
<wds-form-control-enhancer>
<input type="text" name="disabled" placeholder="disabled" disabled />
</wds-form-control-enhancer>
<wds-form-control-enhancer>
<input type="text" name="readonly" readonly value="readonly" />
</wds-form-control-enhancer>
<wds-button type="button" class="special-button" id="js-special-button">Form Button special</wds-button>
<wds-button type="reset">Form Reset</wds-button>
<wds-button appearance="accent" type="submit">Form Submit</wds-button>
<button>Native button</button>
</form>
<wds-button class="button button-primary" data-modal-trigger="1">Open modal</wds-button>
<dialog
class="modal" data-modal="1"
role="alertdialog"
aria-modal="true"
aria-labelledby="confirmation-dialog-title"
aria-describedby="confirmation-dialog-description"
>
<h6 id="confirmation-dialog-title" class="modal-title">Modal title</h6>
<div class="modal-content" id="confirmation-dialog-description">
<p>Modal body text goes here.</p>
</div>
<footer class="modal-footer">
<wds-button class="button button-secondary" data-modal-close="1">Close</wds-button>
<wds-button class="button button-primary" data-modal-close="1">Save changes</wds-button>
</footer>
</dialog>
<script>
const dialogRootElementList = document.querySelectorAll('[data-modal]');
const dialogTriggerElementList = document.querySelectorAll('[data-modal-trigger]');
const dialogCloseElementList = document.querySelectorAll('[data-modal-close]');
if (dialogRootElementList?.length) {
dialogTriggerElementList.forEach((dialogTriggerElementListItem) => {
dialogTriggerElementListItem.addEventListener('click', () => {
const selectedDialogRootElement = [...dialogRootElementList]
.find(dialogRootElementListItem =>
dialogRootElementListItem.dataset?.modal === dialogTriggerElementListItem.dataset?.modalTrigger);
if (selectedDialogRootElement) {
selectedDialogRootElement.showModal();
}
});
});
dialogCloseElementList.forEach((dialogCloseElementListItem) => {
dialogCloseElementListItem.addEventListener('click', () => {
const selectedDialogRootElement = [...dialogRootElementList]
.find(dialogRootElementListItem =>
dialogRootElementListItem.dataset?.modal === dialogCloseElementListItem.dataset?.modalClose);
if (selectedDialogRootElement) {
selectedDialogRootElement.close();
}
});
});
}
</script>
<script>
function getFormValues(form) {
const formData = new FormData(form);
for (let pair of formData.entries()) {
console.log(pair[0] + ": " + pair[1]);
}
return Object.fromEntries(formData);
};
document.addEventListener("DOMContentLoaded", (event) => {
const specialButtonElement = document.querySelector('#js-special-button');
const specialFormElement = document.querySelector('#js-special-form');
specialButtonElement.addEventListener('click', (event) => {
console.log('special button click', event);
})
specialFormElement.addEventListener('submit', (event) => {
event.preventDefault();
const formValues = getFormValues(event.target);
console.log('special form submit > event', event);
console.log('special form submit > formValues', formValues);
})
});
</script>
</body>
</html>