@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.
Files changed (182) hide show
  1. package/README.md +35 -15
  2. package/components/access-code/_macro.njk +1 -1
  3. package/components/access-code/_macro.spec.js +162 -0
  4. package/components/access-code/uac.spec.js +26 -0
  5. package/components/accordion/_macro.spec.js +224 -0
  6. package/components/accordion/accordion.spec.js +134 -0
  7. package/components/address-input/_macro.njk +1 -1
  8. package/components/address-input/_macro.spec.js +465 -0
  9. package/components/address-input/autosuggest.address.js +5 -4
  10. package/components/address-input/autosuggest.address.setter.js +9 -3
  11. package/components/address-input/autosuggest.address.spec.js +733 -0
  12. package/components/address-output/_macro.njk +6 -6
  13. package/components/address-output/_macro.spec.js +122 -0
  14. package/components/autosuggest/_macro.njk +1 -1
  15. package/components/autosuggest/_macro.spec.js +229 -0
  16. package/components/autosuggest/autosuggest.helpers.js +2 -3
  17. package/components/autosuggest/autosuggest.helpers.spec.js +85 -0
  18. package/components/autosuggest/autosuggest.js +4 -2
  19. package/components/autosuggest/autosuggest.spec.js +625 -0
  20. package/components/autosuggest/autosuggest.ui.js +6 -2
  21. package/components/breadcrumbs/_macro.spec.js +129 -0
  22. package/components/button/_button.scss +75 -33
  23. package/components/button/_macro.njk +6 -6
  24. package/components/button/_macro.spec.js +446 -0
  25. package/components/button/button.spec.js +290 -0
  26. package/components/call-to-action/_macro.njk +3 -1
  27. package/components/call-to-action/_macro.spec.js +52 -0
  28. package/components/card/_macro.njk +26 -19
  29. package/components/card/_macro.spec.js +261 -0
  30. package/components/char-check-limit/_macro.spec.js +73 -0
  31. package/components/char-check-limit/character-check.spec.js +196 -0
  32. package/components/char-check-limit/character-limit.js +1 -1
  33. package/components/checkboxes/_checkbox-macro.spec.js +419 -0
  34. package/components/checkboxes/_macro.njk +1 -3
  35. package/components/checkboxes/_macro.spec.js +306 -0
  36. package/components/checkboxes/checkbox-with-autoselect.js +2 -1
  37. package/components/checkboxes/checkboxes.spec.js +208 -0
  38. package/components/code-highlight/_macro.spec.js +56 -0
  39. package/components/code-highlight/code-highlight.spec.js +18 -0
  40. package/components/collapsible/_macro.spec.js +204 -0
  41. package/components/collapsible/collapsible.js +2 -1
  42. package/components/collapsible/collapsible.spec.js +236 -0
  43. package/components/content-pagination/_macro.spec.js +199 -0
  44. package/components/cookies-banner/_macro.njk +1 -1
  45. package/components/cookies-banner/_macro.spec.js +171 -0
  46. package/components/cookies-banner/cookies-banner.spec.js +90 -0
  47. package/components/date-input/_macro.njk +6 -3
  48. package/components/date-input/_macro.spec.js +286 -0
  49. package/components/document-list/_macro.njk +3 -5
  50. package/components/document-list/_macro.spec.js +491 -0
  51. package/components/download-resources/download-resources.spec.js +540 -0
  52. package/components/duration/_macro.njk +7 -6
  53. package/components/duration/_macro.spec.js +251 -0
  54. package/components/error/_macro.spec.js +97 -0
  55. package/components/external-link/_macro.njk +5 -2
  56. package/components/external-link/_macro.spec.js +77 -0
  57. package/components/feedback/_macro.njk +5 -3
  58. package/components/feedback/_macro.spec.js +122 -0
  59. package/components/field/_macro.njk +2 -2
  60. package/components/field/_macro.spec.js +97 -0
  61. package/components/fieldset/_macro.njk +3 -3
  62. package/components/fieldset/_macro.spec.js +173 -0
  63. package/components/footer/_footer.scss +19 -4
  64. package/components/footer/_macro.njk +106 -137
  65. package/components/footer/_macro.spec.js +678 -0
  66. package/components/header/_header.scss +65 -46
  67. package/components/header/_macro.njk +173 -121
  68. package/components/header/_macro.spec.js +618 -0
  69. package/components/hero/_hero.scss +30 -143
  70. package/components/hero/_macro.njk +12 -23
  71. package/components/hero/_macro.spec.js +218 -0
  72. package/components/icons/_macro.njk +258 -30
  73. package/components/icons/_macro.spec.js +140 -0
  74. package/components/images/_macro.njk +1 -1
  75. package/components/images/_macro.spec.js +121 -0
  76. package/components/input/_input-type.scss +12 -5
  77. package/components/input/_input.scss +8 -0
  78. package/components/input/_macro.njk +4 -5
  79. package/components/input/_macro.spec.js +658 -0
  80. package/components/label/_macro.spec.js +189 -0
  81. package/components/language-selector/_macro.njk +1 -1
  82. package/components/language-selector/_macro.spec.js +137 -0
  83. package/components/lists/_list.scss +4 -0
  84. package/components/lists/_macro.njk +4 -7
  85. package/components/lists/_macro.spec.js +618 -0
  86. package/components/message/_macro.spec.js +137 -0
  87. package/components/message-list/_macro.njk +7 -7
  88. package/components/message-list/_macro.spec.js +159 -0
  89. package/components/metadata/_macro.spec.js +167 -0
  90. package/components/modal/_macro.njk +6 -6
  91. package/components/modal/_macro.spec.js +87 -0
  92. package/components/modal/modal.spec.js +59 -0
  93. package/components/mutually-exclusive/_macro.njk +2 -2
  94. package/components/mutually-exclusive/_macro.spec.js +184 -0
  95. package/components/mutually-exclusive/mutually-exclusive.checkboxes.spec.js +203 -0
  96. package/components/mutually-exclusive/mutually-exclusive.date.spec.js +142 -0
  97. package/components/mutually-exclusive/mutually-exclusive.duration.spec.js +141 -0
  98. package/components/mutually-exclusive/mutually-exclusive.email.spec.js +117 -0
  99. package/components/mutually-exclusive/mutually-exclusive.multiple-options.checkboxes.spec.js +213 -0
  100. package/components/mutually-exclusive/mutually-exclusive.number.spec.js +125 -0
  101. package/components/mutually-exclusive/mutually-exclusive.textarea.spec.js +131 -0
  102. package/components/navigation/_macro.njk +45 -38
  103. package/components/navigation/_macro.spec.js +329 -0
  104. package/components/navigation/_navigation.scss +20 -4
  105. package/components/navigation/navigation.dom.js +1 -1
  106. package/components/navigation/navigation.spec.js +232 -0
  107. package/components/pagination/_macro.njk +1 -1
  108. package/components/pagination/_macro.spec.js +411 -0
  109. package/components/panel/_macro.njk +6 -6
  110. package/components/panel/_macro.spec.js +423 -0
  111. package/components/password/_macro.spec.js +137 -0
  112. package/components/password/password.spec.js +40 -0
  113. package/components/phase-banner/_macro.spec.js +73 -0
  114. package/components/promotional-banner/_macro.spec.js +97 -0
  115. package/components/question/_macro.njk +16 -22
  116. package/components/question/_macro.spec.js +309 -0
  117. package/components/quote/_macro.spec.js +81 -0
  118. package/components/radios/_macro.njk +3 -6
  119. package/components/radios/_macro.spec.js +575 -0
  120. package/components/radios/radios.spec.js +180 -0
  121. package/components/related-content/_macro.njk +14 -21
  122. package/components/related-content/_macro.spec.js +133 -0
  123. package/components/related-content/_section-macro.njk +10 -0
  124. package/components/related-content/_section-macro.spec.js +43 -0
  125. package/components/relationships/_macro.spec.js +108 -0
  126. package/components/relationships/relationships.spec.js +84 -0
  127. package/components/reply/_macro.njk +2 -2
  128. package/components/reply/_macro.spec.js +69 -0
  129. package/components/reply/reply.spec.js +78 -0
  130. package/components/search/_macro.njk +14 -12
  131. package/components/search/_macro.spec.js +44 -0
  132. package/components/search/_search.scss +7 -7
  133. package/components/section-navigation/_macro.njk +7 -2
  134. package/components/section-navigation/_macro.spec.js +206 -0
  135. package/components/select/_macro.njk +3 -3
  136. package/components/select/_macro.spec.js +203 -0
  137. package/components/select/select.spec.js +56 -0
  138. package/components/share-page/_macro.njk +6 -4
  139. package/components/share-page/_macro.spec.js +110 -0
  140. package/components/skip-to-content/_macro.spec.js +57 -0
  141. package/components/skip-to-content/skip-to-content.spec.js +44 -0
  142. package/components/status/_macro.spec.js +77 -0
  143. package/components/summary/_macro.njk +5 -5
  144. package/components/summary/_macro.spec.js +472 -0
  145. package/components/table/_macro.njk +2 -2
  146. package/components/table/_macro.spec.js +557 -0
  147. package/components/table/table.spec.js +155 -0
  148. package/components/table-of-contents/_macro.njk +35 -35
  149. package/components/table-of-contents/_macro.spec.js +178 -0
  150. package/components/table-of-contents/toc.js +29 -25
  151. package/components/table-of-contents/toc.spec.js +61 -0
  152. package/components/tabs/_macro.njk +1 -1
  153. package/components/tabs/_macro.spec.js +79 -0
  154. package/components/tabs/tabs.spec.js +162 -0
  155. package/components/text-indent/_macro.spec.js +52 -0
  156. package/components/textarea/_macro.njk +5 -3
  157. package/components/textarea/_macro.spec.js +300 -0
  158. package/components/textarea/textarea.spec.js +98 -0
  159. package/components/timeline/_macro.njk +3 -3
  160. package/components/timeline/_macro.spec.js +81 -0
  161. package/components/timeout-modal/_macro.spec.js +68 -0
  162. package/components/timeout-modal/timeout-modal.spec.js +226 -0
  163. package/components/timeout-panel/_macro.njk +0 -1
  164. package/components/timeout-panel/_macro.spec.js +54 -0
  165. package/components/timeout-panel/timeout-panel.dom.js +1 -2
  166. package/components/timeout-panel/timeout-panel.spec.js +161 -0
  167. package/components/upload/_macro.spec.js +75 -0
  168. package/components/video/_macro.spec.js +34 -0
  169. package/css/census.css +3 -1
  170. package/css/ids.css +2 -0
  171. package/css/main.css +1 -1
  172. package/img/dummy-brand-logo.svg +1 -0
  173. package/js/cookies-settings.spec.js +154 -0
  174. package/layout/_template.njk +7 -4
  175. package/package.json +10 -23
  176. package/scripts/main.es5.js +2 -2
  177. package/scripts/main.js +1 -1
  178. package/scss/ids.scss +2 -0
  179. package/scss/settings/_census.scss +141 -0
  180. package/scss/settings/_ids.scss +48 -0
  181. package/scss/utilities/_margin.scss +1 -0
  182. 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-white;
233
+ color: $color-text-inverse-link;
234
234
  .ons-svg-icon {
235
- fill: $color-white;
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-branded-tint;
256
+ color: $color-text-inverse-link-hover;
257
257
  .ons-svg-icon {
258
- fill: $color-branded-tint;
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 rgba(0, 0, 0, 0.6);
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
- &--text-link,
306
- &--mobile {
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
- &--text-link:focus:hover,
320
- &--mobile:focus:hover {
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
- &--mobile:hover & {
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
- &--mobile:active:focus &,
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
- &--mobile.active:focus & {
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
- &--mobile:focus & {
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
- .ons-btn__inner {
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-link;
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-link;
448
+ fill: $color-branded-text;
417
449
  float: right;
418
450
  margin-top: 3px;
419
451
  }
420
452
  }
453
+ }
421
454
 
422
- &:active,
423
- &:active:focus {
424
- .ons-btn__inner {
425
- background: $color-branded-secondary;
426
- color: $color-white;
427
- .ons-svg-icon {
428
- fill: $color-white;
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 }}"{% elif params.name is defined and params.name and tag == "a" %}id="{{ params.name }}"{% endif %}
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 window") }}</span>
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>