@ons/design-system 50.0.1 → 53.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +35 -15
- package/components/access-code/_macro.njk +1 -1
- package/components/access-code/_macro.spec.js +162 -0
- package/components/access-code/uac.spec.js +26 -0
- package/components/accordion/_macro.spec.js +224 -0
- package/components/accordion/accordion.spec.js +134 -0
- package/components/address-input/_macro.njk +1 -1
- package/components/address-input/_macro.spec.js +465 -0
- package/components/address-input/autosuggest.address.js +5 -4
- package/components/address-input/autosuggest.address.setter.js +9 -3
- package/components/address-input/autosuggest.address.spec.js +733 -0
- package/components/address-output/_macro.njk +6 -6
- package/components/address-output/_macro.spec.js +122 -0
- package/components/autosuggest/_macro.njk +1 -1
- package/components/autosuggest/_macro.spec.js +229 -0
- package/components/autosuggest/autosuggest.helpers.js +2 -3
- package/components/autosuggest/autosuggest.helpers.spec.js +85 -0
- package/components/autosuggest/autosuggest.js +4 -2
- package/components/autosuggest/autosuggest.spec.js +625 -0
- package/components/autosuggest/autosuggest.ui.js +6 -2
- package/components/breadcrumbs/_macro.spec.js +129 -0
- package/components/button/_button.scss +75 -33
- package/components/button/_macro.njk +6 -6
- package/components/button/_macro.spec.js +446 -0
- package/components/button/button.spec.js +290 -0
- package/components/call-to-action/_macro.njk +3 -1
- package/components/call-to-action/_macro.spec.js +52 -0
- package/components/card/_macro.njk +26 -19
- package/components/card/_macro.spec.js +261 -0
- package/components/char-check-limit/_macro.spec.js +73 -0
- package/components/char-check-limit/character-check.spec.js +196 -0
- package/components/char-check-limit/character-limit.js +1 -1
- package/components/checkboxes/_checkbox-macro.spec.js +419 -0
- package/components/checkboxes/_macro.njk +1 -3
- package/components/checkboxes/_macro.spec.js +306 -0
- package/components/checkboxes/checkbox-with-autoselect.js +2 -1
- package/components/checkboxes/checkboxes.spec.js +208 -0
- package/components/code-highlight/_macro.spec.js +56 -0
- package/components/code-highlight/code-highlight.spec.js +18 -0
- package/components/collapsible/_macro.spec.js +204 -0
- package/components/collapsible/collapsible.js +2 -1
- package/components/collapsible/collapsible.spec.js +236 -0
- package/components/content-pagination/_macro.spec.js +199 -0
- package/components/cookies-banner/_macro.njk +1 -1
- package/components/cookies-banner/_macro.spec.js +171 -0
- package/components/cookies-banner/cookies-banner.spec.js +90 -0
- package/components/date-input/_macro.njk +6 -3
- package/components/date-input/_macro.spec.js +286 -0
- package/components/document-list/_macro.njk +3 -5
- package/components/document-list/_macro.spec.js +491 -0
- package/components/download-resources/download-resources.spec.js +540 -0
- package/components/duration/_macro.njk +7 -6
- package/components/duration/_macro.spec.js +251 -0
- package/components/error/_macro.spec.js +97 -0
- package/components/external-link/_macro.njk +5 -2
- package/components/external-link/_macro.spec.js +77 -0
- package/components/feedback/_macro.njk +5 -3
- package/components/feedback/_macro.spec.js +122 -0
- package/components/field/_macro.njk +2 -2
- package/components/field/_macro.spec.js +97 -0
- package/components/fieldset/_macro.njk +3 -3
- package/components/fieldset/_macro.spec.js +173 -0
- package/components/footer/_footer.scss +19 -4
- package/components/footer/_macro.njk +106 -137
- package/components/footer/_macro.spec.js +678 -0
- package/components/header/_header.scss +65 -46
- package/components/header/_macro.njk +173 -121
- package/components/header/_macro.spec.js +618 -0
- package/components/hero/_hero.scss +30 -143
- package/components/hero/_macro.njk +12 -23
- package/components/hero/_macro.spec.js +218 -0
- package/components/icons/_macro.njk +258 -30
- package/components/icons/_macro.spec.js +140 -0
- package/components/images/_macro.njk +1 -1
- package/components/images/_macro.spec.js +121 -0
- package/components/input/_input-type.scss +12 -5
- package/components/input/_input.scss +8 -0
- package/components/input/_macro.njk +4 -5
- package/components/input/_macro.spec.js +658 -0
- package/components/label/_macro.spec.js +189 -0
- package/components/language-selector/_macro.njk +1 -1
- package/components/language-selector/_macro.spec.js +137 -0
- package/components/lists/_list.scss +4 -0
- package/components/lists/_macro.njk +4 -7
- package/components/lists/_macro.spec.js +618 -0
- package/components/message/_macro.spec.js +137 -0
- package/components/message-list/_macro.njk +7 -7
- package/components/message-list/_macro.spec.js +159 -0
- package/components/metadata/_macro.spec.js +167 -0
- package/components/modal/_macro.njk +6 -6
- package/components/modal/_macro.spec.js +87 -0
- package/components/modal/modal.spec.js +59 -0
- package/components/mutually-exclusive/_macro.njk +2 -2
- package/components/mutually-exclusive/_macro.spec.js +184 -0
- package/components/mutually-exclusive/mutually-exclusive.checkboxes.spec.js +203 -0
- package/components/mutually-exclusive/mutually-exclusive.date.spec.js +142 -0
- package/components/mutually-exclusive/mutually-exclusive.duration.spec.js +141 -0
- package/components/mutually-exclusive/mutually-exclusive.email.spec.js +117 -0
- package/components/mutually-exclusive/mutually-exclusive.multiple-options.checkboxes.spec.js +213 -0
- package/components/mutually-exclusive/mutually-exclusive.number.spec.js +125 -0
- package/components/mutually-exclusive/mutually-exclusive.textarea.spec.js +131 -0
- package/components/navigation/_macro.njk +45 -38
- package/components/navigation/_macro.spec.js +329 -0
- package/components/navigation/_navigation.scss +20 -4
- package/components/navigation/navigation.dom.js +1 -1
- package/components/navigation/navigation.spec.js +232 -0
- package/components/pagination/_macro.njk +1 -1
- package/components/pagination/_macro.spec.js +411 -0
- package/components/panel/_macro.njk +6 -6
- package/components/panel/_macro.spec.js +423 -0
- package/components/password/_macro.spec.js +137 -0
- package/components/password/password.spec.js +40 -0
- package/components/phase-banner/_macro.spec.js +73 -0
- package/components/promotional-banner/_macro.spec.js +97 -0
- package/components/question/_macro.njk +16 -22
- package/components/question/_macro.spec.js +309 -0
- package/components/quote/_macro.spec.js +81 -0
- package/components/radios/_macro.njk +3 -6
- package/components/radios/_macro.spec.js +575 -0
- package/components/radios/radios.spec.js +180 -0
- package/components/related-content/_macro.njk +14 -21
- package/components/related-content/_macro.spec.js +133 -0
- package/components/related-content/_section-macro.njk +10 -0
- package/components/related-content/_section-macro.spec.js +43 -0
- package/components/relationships/_macro.spec.js +108 -0
- package/components/relationships/relationships.spec.js +84 -0
- package/components/reply/_macro.njk +2 -2
- package/components/reply/_macro.spec.js +69 -0
- package/components/reply/reply.spec.js +78 -0
- package/components/search/_macro.njk +14 -12
- package/components/search/_macro.spec.js +44 -0
- package/components/search/_search.scss +7 -7
- package/components/section-navigation/_macro.njk +7 -2
- package/components/section-navigation/_macro.spec.js +206 -0
- package/components/select/_macro.njk +3 -3
- package/components/select/_macro.spec.js +203 -0
- package/components/select/select.spec.js +56 -0
- package/components/share-page/_macro.njk +6 -4
- package/components/share-page/_macro.spec.js +110 -0
- package/components/skip-to-content/_macro.spec.js +57 -0
- package/components/skip-to-content/skip-to-content.spec.js +44 -0
- package/components/status/_macro.spec.js +77 -0
- package/components/summary/_macro.njk +5 -5
- package/components/summary/_macro.spec.js +472 -0
- package/components/table/_macro.njk +2 -2
- package/components/table/_macro.spec.js +557 -0
- package/components/table/table.spec.js +155 -0
- package/components/table-of-contents/_macro.njk +35 -35
- package/components/table-of-contents/_macro.spec.js +178 -0
- package/components/table-of-contents/toc.js +29 -25
- package/components/table-of-contents/toc.spec.js +61 -0
- package/components/tabs/_macro.njk +1 -1
- package/components/tabs/_macro.spec.js +79 -0
- package/components/tabs/tabs.spec.js +162 -0
- package/components/text-indent/_macro.spec.js +52 -0
- package/components/textarea/_macro.njk +5 -3
- package/components/textarea/_macro.spec.js +300 -0
- package/components/textarea/textarea.spec.js +98 -0
- package/components/timeline/_macro.njk +3 -3
- package/components/timeline/_macro.spec.js +81 -0
- package/components/timeout-modal/_macro.spec.js +68 -0
- package/components/timeout-modal/timeout-modal.spec.js +226 -0
- package/components/timeout-panel/_macro.njk +0 -1
- package/components/timeout-panel/_macro.spec.js +54 -0
- package/components/timeout-panel/timeout-panel.dom.js +1 -2
- package/components/timeout-panel/timeout-panel.spec.js +161 -0
- package/components/upload/_macro.spec.js +75 -0
- package/components/video/_macro.spec.js +34 -0
- package/css/census.css +3 -1
- package/css/ids.css +2 -0
- package/css/main.css +1 -1
- package/img/dummy-brand-logo.svg +1 -0
- package/js/cookies-settings.spec.js +154 -0
- package/layout/_template.njk +7 -4
- package/package.json +10 -23
- package/scripts/main.es5.js +2 -2
- package/scripts/main.js +1 -1
- package/scss/ids.scss +2 -0
- package/scss/settings/_census.scss +141 -0
- package/scss/settings/_ids.scss +48 -0
- package/scss/utilities/_margin.scss +1 -0
- package/scss/vars/_colors.scss +5 -2
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
/** @jest-environment jsdom */
|
|
2
|
+
|
|
3
|
+
import * as cheerio from 'cheerio';
|
|
4
|
+
|
|
5
|
+
import axe from '../../tests/helpers/axe';
|
|
6
|
+
import { mapAll } from '../../tests/helpers/cheerio';
|
|
7
|
+
import { renderComponent, templateFaker } from '../../tests/helpers/rendering';
|
|
8
|
+
|
|
9
|
+
const EXAMPLE_BREADCRUMBS_MINIMAL = {
|
|
10
|
+
itemsList: [
|
|
11
|
+
{
|
|
12
|
+
url: 'https://example.com/',
|
|
13
|
+
text: 'Home',
|
|
14
|
+
},
|
|
15
|
+
{
|
|
16
|
+
url: 'https://example.com/guide/',
|
|
17
|
+
text: 'Guide',
|
|
18
|
+
},
|
|
19
|
+
],
|
|
20
|
+
};
|
|
21
|
+
|
|
22
|
+
const EXAMPLE_BREADCRUMBS = {
|
|
23
|
+
classes: 'extra-class another-extra-class',
|
|
24
|
+
ariaLabel: 'Breadcrumbs label',
|
|
25
|
+
id: 'example-breadcrumbs',
|
|
26
|
+
itemsList: [
|
|
27
|
+
{
|
|
28
|
+
itemClasses: 'item-extra-class item-another-extra-class',
|
|
29
|
+
linkClasses: 'link-extra-class link-another-extra-class',
|
|
30
|
+
url: 'https://example.com/',
|
|
31
|
+
text: 'Home',
|
|
32
|
+
attributes: {
|
|
33
|
+
'data-a': '123',
|
|
34
|
+
'data-b': '456',
|
|
35
|
+
},
|
|
36
|
+
id: 'first-breadcrumb',
|
|
37
|
+
},
|
|
38
|
+
{
|
|
39
|
+
url: 'https://example.com/guide/',
|
|
40
|
+
text: 'Guide',
|
|
41
|
+
id: 'second-breadcrumb',
|
|
42
|
+
attributes: {
|
|
43
|
+
'data-a': '789',
|
|
44
|
+
'data-b': 'ABC',
|
|
45
|
+
},
|
|
46
|
+
},
|
|
47
|
+
],
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
describe('macro: breadcrumbs', () => {
|
|
51
|
+
it('passes jest-axe checks', async () => {
|
|
52
|
+
const $ = cheerio.load(renderComponent('breadcrumbs', EXAMPLE_BREADCRUMBS));
|
|
53
|
+
|
|
54
|
+
const results = await axe($.html());
|
|
55
|
+
expect(results).toHaveNoViolations();
|
|
56
|
+
});
|
|
57
|
+
|
|
58
|
+
it('has additionally provided style classes', () => {
|
|
59
|
+
const $ = cheerio.load(renderComponent('breadcrumbs', EXAMPLE_BREADCRUMBS));
|
|
60
|
+
|
|
61
|
+
expect($('.ons-breadcrumb').hasClass('extra-class')).toBe(true);
|
|
62
|
+
expect($('.ons-breadcrumb').hasClass('another-extra-class')).toBe(true);
|
|
63
|
+
});
|
|
64
|
+
|
|
65
|
+
it('has a default `aria-label` of "Breadcrumbs"', () => {
|
|
66
|
+
const $ = cheerio.load(renderComponent('breadcrumbs', EXAMPLE_BREADCRUMBS_MINIMAL));
|
|
67
|
+
|
|
68
|
+
expect($('.ons-breadcrumb').attr('aria-label')).toBe('Breadcrumbs');
|
|
69
|
+
});
|
|
70
|
+
|
|
71
|
+
it('has the provided `ariaLabel` for `aria-label`', () => {
|
|
72
|
+
const $ = cheerio.load(renderComponent('breadcrumbs', EXAMPLE_BREADCRUMBS));
|
|
73
|
+
|
|
74
|
+
expect($('.ons-breadcrumb').attr('aria-label')).toBe('Breadcrumbs label');
|
|
75
|
+
});
|
|
76
|
+
|
|
77
|
+
it('has the provided `id`', () => {
|
|
78
|
+
const $ = cheerio.load(renderComponent('breadcrumbs', EXAMPLE_BREADCRUMBS));
|
|
79
|
+
|
|
80
|
+
expect($('.ons-breadcrumb').attr('id')).toBe('example-breadcrumbs');
|
|
81
|
+
});
|
|
82
|
+
|
|
83
|
+
it('has additionally provided style classes on `item` element', () => {
|
|
84
|
+
const $ = cheerio.load(renderComponent('breadcrumbs', EXAMPLE_BREADCRUMBS));
|
|
85
|
+
|
|
86
|
+
expect($('.ons-breadcrumb__item:first').hasClass('item-extra-class')).toBe(true);
|
|
87
|
+
expect($('.ons-breadcrumb__item:first').hasClass('item-another-extra-class')).toBe(true);
|
|
88
|
+
});
|
|
89
|
+
|
|
90
|
+
it('has additionally provided style classes on `link` element', () => {
|
|
91
|
+
const $ = cheerio.load(renderComponent('breadcrumbs', EXAMPLE_BREADCRUMBS));
|
|
92
|
+
|
|
93
|
+
expect($('.ons-breadcrumb__link:first').hasClass('link-extra-class')).toBe(true);
|
|
94
|
+
expect($('.ons-breadcrumb__link:first').hasClass('link-another-extra-class')).toBe(true);
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
it('has provided `url` on `link` elements', () => {
|
|
98
|
+
const $ = cheerio.load(renderComponent('breadcrumbs', EXAMPLE_BREADCRUMBS));
|
|
99
|
+
|
|
100
|
+
const urls = mapAll($('.ons-breadcrumb__link'), node => node.attr('href'));
|
|
101
|
+
expect(urls).toEqual(['https://example.com/', 'https://example.com/guide/']);
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it('has provided `text` on `link` elements', () => {
|
|
105
|
+
const $ = cheerio.load(renderComponent('breadcrumbs', EXAMPLE_BREADCRUMBS));
|
|
106
|
+
|
|
107
|
+
const labels = mapAll($('.ons-breadcrumb__link'), node => node.text().trim());
|
|
108
|
+
expect(labels).toEqual(['Home', 'Guide']);
|
|
109
|
+
});
|
|
110
|
+
|
|
111
|
+
it('has provided `attributes` on `link` elements', () => {
|
|
112
|
+
const $ = cheerio.load(renderComponent('breadcrumbs', EXAMPLE_BREADCRUMBS));
|
|
113
|
+
|
|
114
|
+
const testValuesA = mapAll($('.ons-breadcrumb__link'), node => node.attr('data-a'));
|
|
115
|
+
expect(testValuesA).toEqual(['123', '789']);
|
|
116
|
+
const testValuesB = mapAll($('.ons-breadcrumb__link'), node => node.attr('data-b'));
|
|
117
|
+
expect(testValuesB).toEqual(['456', 'ABC']);
|
|
118
|
+
});
|
|
119
|
+
|
|
120
|
+
it('has a "chevron" icon for each breadcrumb item', () => {
|
|
121
|
+
const faker = templateFaker();
|
|
122
|
+
const iconsSpy = faker.spy('icons');
|
|
123
|
+
|
|
124
|
+
faker.renderComponent('breadcrumbs', EXAMPLE_BREADCRUMBS_MINIMAL);
|
|
125
|
+
|
|
126
|
+
const iconTypes = iconsSpy.occurrences.map(occurrence => occurrence.iconType);
|
|
127
|
+
expect(iconTypes).toEqual(['chevron', 'chevron']);
|
|
128
|
+
});
|
|
129
|
+
});
|
|
@@ -230,9 +230,9 @@ $button-shadow-size: 3px;
|
|
|
230
230
|
|
|
231
231
|
&--text-link-inverse & {
|
|
232
232
|
&__inner {
|
|
233
|
-
color: $color-
|
|
233
|
+
color: $color-text-inverse-link;
|
|
234
234
|
.ons-svg-icon {
|
|
235
|
-
fill: $color-
|
|
235
|
+
fill: $color-text-inverse-link;
|
|
236
236
|
}
|
|
237
237
|
}
|
|
238
238
|
}
|
|
@@ -253,9 +253,9 @@ $button-shadow-size: 3px;
|
|
|
253
253
|
&--text-link-inverse:active &,
|
|
254
254
|
&--text-link-inverse.active & {
|
|
255
255
|
&__inner {
|
|
256
|
-
color: $color-
|
|
256
|
+
color: $color-text-inverse-link-hover;
|
|
257
257
|
.ons-svg-icon {
|
|
258
|
-
fill: $color-
|
|
258
|
+
fill: $color-text-inverse-link-hover;
|
|
259
259
|
}
|
|
260
260
|
}
|
|
261
261
|
}
|
|
@@ -279,8 +279,7 @@ $button-shadow-size: 3px;
|
|
|
279
279
|
}
|
|
280
280
|
}
|
|
281
281
|
|
|
282
|
-
&--ghost
|
|
283
|
-
&--mobile & {
|
|
282
|
+
&--ghost & {
|
|
284
283
|
&__inner {
|
|
285
284
|
background: transparent;
|
|
286
285
|
border: 2px solid rgba(255, 255, 255, 0.6);
|
|
@@ -293,36 +292,51 @@ $button-shadow-size: 3px;
|
|
|
293
292
|
}
|
|
294
293
|
|
|
295
294
|
&--ghost-dark & {
|
|
296
|
-
@extend .ons-btn--secondary;
|
|
297
295
|
&__inner {
|
|
298
296
|
background: transparent;
|
|
299
|
-
border: 2px solid
|
|
297
|
+
border: 2px solid $color-black;
|
|
298
|
+
box-shadow: none;
|
|
300
299
|
color: $color-text;
|
|
300
|
+
.ons-svg-icon {
|
|
301
|
+
fill: $color-black;
|
|
302
|
+
}
|
|
301
303
|
}
|
|
302
304
|
}
|
|
303
305
|
|
|
304
306
|
&--ghost,
|
|
305
|
-
&--
|
|
306
|
-
&--
|
|
307
|
+
&--ghost-dark,
|
|
308
|
+
&--dropdown,
|
|
309
|
+
&--text-link {
|
|
307
310
|
&:active,
|
|
308
311
|
.active {
|
|
309
312
|
top: 0;
|
|
310
313
|
}
|
|
311
314
|
}
|
|
312
315
|
|
|
313
|
-
&--ghost:active:focus
|
|
316
|
+
&--ghost:active:focus,
|
|
317
|
+
&--ghost-dark:active:focus {
|
|
314
318
|
box-shadow: none;
|
|
315
319
|
outline: 3px solid transparent;
|
|
316
320
|
}
|
|
317
321
|
|
|
318
322
|
&--ghost:focus:hover,
|
|
319
|
-
&--
|
|
320
|
-
&--
|
|
323
|
+
&--ghost-dark:focus:hover,
|
|
324
|
+
&--dropdown:focus:hover,
|
|
325
|
+
&--text-link:focus:hover {
|
|
321
326
|
outline: none;
|
|
322
327
|
}
|
|
323
328
|
|
|
324
|
-
&--ghost:hover &,
|
|
325
|
-
&--
|
|
329
|
+
&--ghost-dark:focus:hover &,
|
|
330
|
+
&--dropdown:focus:hover & {
|
|
331
|
+
&__inner {
|
|
332
|
+
color: $color-text;
|
|
333
|
+
.ons-svg-icon {
|
|
334
|
+
fill: $color-text;
|
|
335
|
+
}
|
|
336
|
+
}
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
&--ghost:hover & {
|
|
326
340
|
&__inner {
|
|
327
341
|
background: rgba(0, 0, 0, 0.1);
|
|
328
342
|
border-color: $color-white;
|
|
@@ -330,11 +344,8 @@ $button-shadow-size: 3px;
|
|
|
330
344
|
}
|
|
331
345
|
|
|
332
346
|
&--ghost:active &,
|
|
333
|
-
&--mobile:active &,
|
|
334
347
|
&--ghost:active:focus &,
|
|
335
|
-
&--
|
|
336
|
-
&--ghost.active &,
|
|
337
|
-
&--mobile.active & {
|
|
348
|
+
&--ghost.active & {
|
|
338
349
|
&__inner {
|
|
339
350
|
background: rgba(0, 0, 0, 0.2);
|
|
340
351
|
border-color: rgba(255, 255, 255, 0.6);
|
|
@@ -345,8 +356,23 @@ $button-shadow-size: 3px;
|
|
|
345
356
|
}
|
|
346
357
|
}
|
|
347
358
|
|
|
359
|
+
&--ghost-dark:hover &,
|
|
360
|
+
&--ghost-dark:active &,
|
|
361
|
+
&--ghost-dark:active:focus &,
|
|
362
|
+
&--ghost-dark.active & {
|
|
363
|
+
&__inner {
|
|
364
|
+
background: $color-black;
|
|
365
|
+
border-color: $color-black;
|
|
366
|
+
color: $color-white;
|
|
367
|
+
.ons-svg-icon {
|
|
368
|
+
fill: $color-white;
|
|
369
|
+
}
|
|
370
|
+
}
|
|
371
|
+
}
|
|
372
|
+
|
|
348
373
|
&--ghost.active:focus &,
|
|
349
|
-
&--
|
|
374
|
+
&--ghost-dark.active:focus &,
|
|
375
|
+
&--dropdown.active:focus & {
|
|
350
376
|
&__inner {
|
|
351
377
|
background: $color-focus;
|
|
352
378
|
color: $color-text-link-focus;
|
|
@@ -357,7 +383,8 @@ $button-shadow-size: 3px;
|
|
|
357
383
|
}
|
|
358
384
|
|
|
359
385
|
&--ghost:focus &,
|
|
360
|
-
&--
|
|
386
|
+
&--ghost-dark:focus &,
|
|
387
|
+
&--dropdown:focus & {
|
|
361
388
|
&__inner {
|
|
362
389
|
box-shadow: none;
|
|
363
390
|
.ons-svg-icon {
|
|
@@ -395,17 +422,22 @@ $button-shadow-size: 3px;
|
|
|
395
422
|
}
|
|
396
423
|
|
|
397
424
|
&--dropdown {
|
|
398
|
-
@extend .ons-btn--ghost;
|
|
399
425
|
@extend .ons-btn--mobile;
|
|
400
426
|
|
|
401
427
|
width: 100%;
|
|
428
|
+
}
|
|
402
429
|
|
|
403
|
-
|
|
430
|
+
&--dropdown & {
|
|
431
|
+
@extend .ons-btn--mobile;
|
|
432
|
+
|
|
433
|
+
width: 100%;
|
|
434
|
+
|
|
435
|
+
&__inner {
|
|
404
436
|
background: $color-branded-tint;
|
|
405
437
|
border: none;
|
|
406
438
|
border-radius: 0;
|
|
407
439
|
box-shadow: none;
|
|
408
|
-
color: $color-text
|
|
440
|
+
color: $color-branded-text;
|
|
409
441
|
display: block;
|
|
410
442
|
font-size: 1rem;
|
|
411
443
|
font-weight: normal;
|
|
@@ -413,20 +445,30 @@ $button-shadow-size: 3px;
|
|
|
413
445
|
text-align: left;
|
|
414
446
|
|
|
415
447
|
.ons-svg-icon {
|
|
416
|
-
fill: $color-text
|
|
448
|
+
fill: $color-branded-text;
|
|
417
449
|
float: right;
|
|
418
450
|
margin-top: 3px;
|
|
419
451
|
}
|
|
420
452
|
}
|
|
453
|
+
}
|
|
421
454
|
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
455
|
+
&--dropdown:hover & {
|
|
456
|
+
&__inner {
|
|
457
|
+
background: $color-branded-secondary;
|
|
458
|
+
color: $color-white;
|
|
459
|
+
.ons-svg-icon {
|
|
460
|
+
fill: $color-white;
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
|
|
465
|
+
&--dropdown:active &,
|
|
466
|
+
&--dropdown:active:focus & {
|
|
467
|
+
&__inner {
|
|
468
|
+
background: $color-branded-secondary;
|
|
469
|
+
color: $color-white;
|
|
470
|
+
.ons-svg-icon {
|
|
471
|
+
fill: $color-white;
|
|
430
472
|
}
|
|
431
473
|
}
|
|
432
474
|
}
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
{% endif %}
|
|
50
50
|
class="ons-btn{% if params.classes is defined and params.classes %} {{ params.classes }}{% endif %}{% if params.variants is defined and params.variants %}{% if params.variants is not string %}{% for variant in params.variants %} ons-btn--{{ variant }}{% endfor %}{% else %} ons-btn--{{ params.variants }}{% endif %}{% endif %}{% if params.url is defined and params.url %} ons-btn--link ons-js-submit-btn{% endif %}{% if params.buttonStyle == "download" %} ons-btn--download{% endif %}{% if params.buttonStyle == "print" %} ons-btn--print ons-u-d-no ons-js-print-btn{% endif %}{% if params.submitType == "loader" %} ons-btn--loader ons-js-loader ons-js-submit-btn{% endif %}{% if params.submitType == "timer" %} ons-js-timer ons-js-submit-btn{% endif %}"
|
|
51
51
|
{% if params.id is defined and params.id %}id="{{ params.id }}"{% endif %}
|
|
52
|
-
{% if params.value is defined and params.value %}value="{{ params.value }}"{% endif %}
|
|
53
|
-
{% if params.name is defined and params.name and tag != "a" %}name="{{ params.name }}"{%
|
|
52
|
+
{% if params.value is defined and params.value and tag != "a" %}value="{{ params.value }}"{% endif %}
|
|
53
|
+
{% if params.name is defined and params.name and tag != "a" %}name="{{ params.name }}"{% endif %}
|
|
54
54
|
{% if params.url is defined and params.url and params.newWindow is defined and params.newWindow %}target="_blank" rel="noopener"{% endif %}
|
|
55
55
|
{% if params.buttonStyle == "download" and (params.removeDownloadAttribute is not defined or not params.removeDownloadAttribute or params.removeDownloadAttribute != true) %} download{% endif %}
|
|
56
56
|
{% if params.attributes is defined and params.attributes %}{% for attribute, value in (params.attributes.items() if params.attributes is mapping and params.attributes.items else params.attributes) %} {{attribute}}="{{value}}"{% endfor %}{% endif %}
|
|
@@ -65,7 +65,7 @@
|
|
|
65
65
|
})
|
|
66
66
|
}}
|
|
67
67
|
{% endif -%}
|
|
68
|
-
{{- params.html | safe if params.html is defined and params.html else params.text -}}
|
|
68
|
+
<span class="ons-btn__text">{{- params.html | safe if params.html is defined and params.html else params.text -}}</span>
|
|
69
69
|
{%- if iconPosition == "after" %}
|
|
70
70
|
{{
|
|
71
71
|
onsIcon({
|
|
@@ -80,13 +80,13 @@
|
|
|
80
80
|
"iconType": iconType
|
|
81
81
|
})
|
|
82
82
|
}}
|
|
83
|
-
<span class="ons-u-vh@xxs@s">{{- params.html | safe if params.html is defined and params.html else params.text -}}</span>
|
|
83
|
+
<span class="ons-btn__text ons-u-vh@xxs@s">{{- params.html | safe if params.html is defined and params.html else params.text -}}</span>
|
|
84
84
|
{% else -%}
|
|
85
|
-
{{- params.html | safe if params.html is defined and params.html else params.text -}}
|
|
85
|
+
<span class="ons-btn__text">{{- params.html | safe if params.html is defined and params.html else params.text -}}</span>
|
|
86
86
|
{% endif -%}
|
|
87
87
|
</span>
|
|
88
88
|
{% if params.url is defined and params.url and params.newWindow is defined and params.newWindow %}
|
|
89
|
-
<span class="ons-btn__new-window-description ons-u-vh">{{ params.newWindowDescription | default("opens in a new
|
|
89
|
+
<span class="ons-btn__new-window-description ons-u-vh">({{ params.newWindowDescription | default("opens in a new tab") }})</span>
|
|
90
90
|
{% endif %}
|
|
91
91
|
{% if params.buttonContext is defined and params.buttonContext %}
|
|
92
92
|
<span class="ons-btn__context ons-u-vh">{{ params.buttonContext }}</span>
|