-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
338 lines (323 loc) · 11.7 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
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
<!doctype html>
<meta http-equiv="Content-type" content="text/html;charset=UTF-8">
<html>
<head>
<!-- Web Components polyfill -->
<script>
if ('registerElement' in document
&& 'createShadowRoot' in HTMLElement.prototype
&& 'import' in document.createElement('link')
&& 'content' in document.createElement('template')) {
} else {
document.write('<script src="../webcomponentsjs/webcomponents.min.js"><\/script>');
}
</script>
<link rel="import" href="../tef_button/tef_button.html">
<link rel="import" href="../tef_input/tef_input.html">
<link rel="import" href="tef_group.html">
<link id="themeComps" rel="stylesheet" href="../theme_telefonica/css/components.telefonica.css">
<script id="themeVars" src="../theme_telefonica/theme.telefonica.js"></script>
<style>
header[columns] { padding-top: 30px; }
h1 { margin-top: 0; }
header > div { padding-top: 2px; }
code {
display: block;
overflow: hidden;
}
style {
display: block;
white-space: pre;
color: #0086B3;
border: 1px solid #cfcece;
background: #f2f2f2;
margin: 20px 0;
line-height: 25px;
overflow-y: auto;
border-radius: 4px;
}
/*Custom styles for this demo*/
tef-group + tef-group{
margin-left: 20px;
}
</style>
</head>
<body>
<div class="tef-wrapper">
<header columns="2" columns-xs="1">
<h1>tef-group</h1>
<div>
<label>Change theme</label>
<div class="tef-dropdown" icon="angle_down">
<select id="themeSelector">
<option value="telefonica">Telefónica</option>
<option value="movistar">Movistar</option>
<option value="o2">O2</option>
<option value="vivo">Vivo</option>
</select>
</div>
</div>
</header>
<h2>Default container</h2>
<tef-group>
<tef-button>First</tef-button>
<tef-button>Middle</tef-button>
<tef-button>Last</tef-button>
</tef-group>
<code>
<style>
<tef-group>
<tef-button>First</tef-button>
<tef-button>Middle</tef-button>
<tef-button>Last</tef-button>
</tef-group>
</style>
</code>
<h2>Toggle</h2>
<p>If you set the <b>toggle</b> attribute, all buttons will have the toggle behaviour.</p>
<tef-group toggle>
<tef-button>First</tef-button>
<tef-button>Middle</tef-button>
<tef-button>Last</tef-button>
</tef-group>
<code>
<style>
<tef-group toggle>
<tef-button>First</tef-button>
<tef-button>Middle</tef-button>
<tef-button>Last</tef-button>
</tef-group>
</style>
</code>
<h2>Toggle single</h2>
<p>If you also set <b>single</b>, only one button at a time can be pressed. </p>
<tef-group toggle single>
<tef-button>First</tef-button>
<tef-button>Middle</tef-button>
<tef-button>Last</tef-button>
</tef-group>
<code>
<style>
<tef-group toggle single>
<tef-button>First</tef-button>
<tef-button>Middle</tef-button>
<tef-button>Last</tef-button>
</tef-group>
</style>
</code>
<h2>Size</h2>
<p>The <b>size</b> attribute will set the size of all the elements inside the group. You can also set the size of each element individually.</p>
<tef-group size="small">
<tef-button>First</tef-button>
<tef-button>Middle</tef-button>
<tef-button>Last</tef-button>
</tef-group>
<tef-group size="large">
<tef-button>First</tef-button>
<tef-button>Middle</tef-button>
<tef-button>Last</tef-button>
</tef-group>
<tef-group>
<tef-button size="large">First</tef-button>
<tef-button>Middle</tef-button>
<tef-button size="small">Last</tef-button>
</tef-group>
<code>
<style>
<tef-group size="small">
<tef-button>First</tef-button>
<tef-button>Middle</tef-button>
<tef-button>Last</tef-button>
</tef-group>
<tef-group size="large">
<tef-button>First</tef-button>
<tef-button>Middle</tef-button>
<tef-button>Last</tef-button>
</tef-group>
<tef-group>
<tef-button size="large">First</tef-button>
<tef-button>Middle</tef-button>
<tef-button size="small">Last</tef-button>
</tef-group>
</style>
</code>
<h2>Colors</h2>
<tef-group>
<tef-button>Default</tef-button>
<tef-button type="positive">Positive</tef-button>
<tef-button type="negative">Negative</tef-button>
<tef-button type="subdued">Subdued</tef-button>
<tef-button type="significant">Significant</tef-button>
</tef-group>
<code>
<style>
<tef-group>
<tef-button>Default</tef-button>
<tef-button type="positive">Positive</tef-button>
<tef-button type="negative">Negative</tef-button>
<tef-button type="subdued">Subdued</tef-button>
<tef-button type="significant">Significant</tef-button>
</tef-group>
</style>
</code>
<h2>Icons</h2>
<tef-group>
<tef-button>
<span>Close</span>
<i icon="close"></i>
</tef-button>
<tef-button>
<i icon="close"></i>
<span>Close</span>
</tef-button>
<tef-button>
<i icon="close"></i>
</tef-button>
</tef-group>
<code>
<style>
<tef-group>
<tef-button>
<span>Close</span><i icon="close"></i>
</tef-button>
<tef-button>
<i icon="close"></i><span>Close</span>
</tef-button>
<tef-button>
<i icon="close"></i>
</tef-button>
</tef-group>
</style>
</code>
<h2>Disabled</h2>
<p>The <b>disabled</b> attribute will disable all buttons and inputs inside the tef-group.</p>
<tef-group disabled>
<tef-button>Default</tef-button>
<tef-button type="positive">Positive</tef-button>
<tef-button type="negative">Negative</tef-button>
<tef-button type="subdued">Subdued</tef-button>
<tef-button type="significant">Significant</tef-button>
</tef-group>
<code>
<style>
<tef-group disabled>
<tef-button>Default</tef-button>
<tef-button type="positive">Positive</tef-button>
<tef-button type="negative">Negative</tef-button>
<tef-button type="subdued">Subdued</tef-button>
<tef-button type="significant">Significant</tef-button>
</tef-group>
</style>
</code>
<h2>Inline Inputs & buttons</h2>
<p>You can group tef-input elements with tef-button elements.</p>
<p>With the <b>row</b> attribute the elements will have a blank space between them.</p>
<tef-group row size="small">
<tef-button>Anchor</tef-button>
<tef-input placeholder="Enter user name"></tef-input>
<tef-button type="positive">Button</tef-button>
</tef-group>
<tef-group row>
<tef-button>Anchor</tef-button>
<tef-input placeholder="Enter user name"></tef-input>
<tef-button type="positive">Button</tef-button>
</tef-group>
<tef-group row size="large">
<tef-button>Anchor</tef-button>
<tef-input placeholder="Enter user name"></tef-input>
<tef-button type="positive">Button</tef-button>
</tef-group>
<code>
<style>
<tef-group row size="small">
<tef-button>Anchor</tef-button>
<tef-input placeholder="Enter user name"></tef-input>
<tef-button type="positive">Button</tef-button>
</tef-group>
</style>
</code>
<h2>Grouped Inputs & buttons</h2>
<p>If <b>row</b> is not set, the buttons and inputs will be grouped together.</p>
<tef-group size="small">
<tef-button>Anchor</tef-button>
<tef-input placeholder="Enter user name"></tef-input>
<tef-button type="positive">Button</tef-button>
</tef-group>
<tef-group>
<tef-button>Anchor</tef-button>
<tef-input placeholder="Enter user name"></tef-input>
<tef-button type="positive">Button</tef-button>
</tef-group>
<tef-group size="large">
<tef-button>Anchor</tef-button>
<tef-input placeholder="Enter user name"></tef-input>
<tef-button type="positive">Button</tef-button>
</tef-group>
<code>
<style>
<tef-group>
<tef-button>Anchor</tef-button>
<tef-input placeholder="Enter user name"></tef-input>
<tef-button type="positive">Button</tef-button>
</tef-group>
</style>
</code>
<tef-group>
<tef-button>
<i icon="minus"></i>
</tef-button>
<tef-button>
<i icon="plus"></i>
</tef-button>
<tef-input placeholder="Enter user name"></tef-input>
</tef-group>
<tef-group>
<tef-button>
<i icon="minus"></i>
</tef-button>
<tef-input placeholder="Enter user name"></tef-input>
<tef-button>
<i icon="plus"></i>
</tef-button>
</tef-group>
<tef-group>
<tef-input placeholder="Enter user name"></tef-input>
<tef-button>
<i icon="minus"></i>
</tef-button>
<tef-button>
<i icon="plus"></i>
</tef-button>
</tef-group>
<code>
<style>
<tef-group>
<tef-button>
<i icon="minus"></i>
</tef-button>
<tef-button>
<i icon="plus"></i>
</tef-button>
<tef-input placeholder="Enter user name"></tef-input>
</tef-group>
</style>
</code>
</div>
<script>
var theme = document.getElementById('themeSelector');
theme.addEventListener('change', function() {
var linkComps = document.getElementById('themeComps');
linkComps.href = '../theme_'
+ theme.value + '/css/components.'
+ theme.value + '.css';
var linkVars = document.createElement('script');
linkVars.id = "themeVars";
linkVars.src = '../theme_'
+ theme.value + '/theme.'
+ theme.value + '.js';
document.head.removeChild(document.getElementById("themeVars"));
document.head.appendChild(linkVars);
});
</script>
</body>
</html>