@ons/design-system 70.0.17 → 72.0.1

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 (204) hide show
  1. package/components/access-code/_macro.njk +4 -4
  2. package/components/access-code/_macro.spec.js +8 -8
  3. package/components/access-code/example-access-code-error.njk +2 -2
  4. package/components/access-code/example-access-code.njk +2 -2
  5. package/components/accordion/_macro.njk +1 -1
  6. package/components/accordion/_macro.spec.js +1 -1
  7. package/components/address-input/_macro.njk +7 -7
  8. package/components/address-input/_macro.spec.js +16 -15
  9. package/components/address-input/autosuggest.address.error.js +1 -1
  10. package/components/address-input/autosuggest.address.js +25 -25
  11. package/components/address-input/autosuggest.address.spec.js +6 -5
  12. package/components/address-input/example-address-input-editable.njk +5 -4
  13. package/components/address-input/example-address-input.njk +4 -5
  14. package/components/autosuggest/_autosuggest.scss +8 -8
  15. package/components/autosuggest/_macro.njk +5 -5
  16. package/components/autosuggest/autosuggest.spec.js +1 -1
  17. package/components/back-to-top/_back-to-top.scss +2 -2
  18. package/components/back-to-top/example-full-page-back-to-top.njk +6 -6
  19. package/components/breadcrumbs/_breadcrumbs.scss +1 -1
  20. package/components/button/_button.scss +24 -16
  21. package/components/button/_macro.njk +3 -3
  22. package/components/button/example-button-custom.njk +1 -1
  23. package/components/card/_card.scss +0 -6
  24. package/components/card/_macro.njk +9 -9
  25. package/components/card/_macro.spec.js +57 -24
  26. package/components/card/example-card-set-with-images.njk +30 -18
  27. package/components/card/example-card-set-with-lists.njk +57 -45
  28. package/components/card/example-card-set.njk +27 -15
  29. package/components/card/example-card.njk +9 -5
  30. package/components/char-check-limit/_macro.njk +1 -1
  31. package/components/checkboxes/_checkbox.scss +4 -4
  32. package/components/checkboxes/_checkboxes.scss +1 -1
  33. package/components/checkboxes/example-checkboxes-with-hidden-label.njk +4 -4
  34. package/components/cookies-banner/_cookies-banner.scss +5 -5
  35. package/components/cookies-banner/_macro.njk +15 -13
  36. package/components/cookies-banner/_macro.spec.js +1 -1
  37. package/components/details/_details.scss +5 -6
  38. package/components/details/_macro.njk +4 -4
  39. package/components/details/_macro.spec.js +1 -1
  40. package/components/document-list/_document-list.scss +0 -2
  41. package/components/document-list/_macro.njk +18 -18
  42. package/components/document-list/_macro.spec.js +16 -14
  43. package/components/document-list/example-document-list-article-featured.njk +5 -3
  44. package/components/document-list/example-document-list-articles.njk +15 -9
  45. package/components/document-list/example-document-list-downloads.njk +15 -9
  46. package/components/document-list/example-document-list-search-result-featured.njk +5 -3
  47. package/components/document-list/example-document-list-search-results.njk +20 -12
  48. package/components/download-resources/_download-resources.scss +1 -2
  49. package/components/download-resources/download-resources.spec.js +12 -6
  50. package/components/external-link/_macro.njk +1 -1
  51. package/components/external-link/_macro.spec.js +1 -1
  52. package/components/external-link/example-external-link.njk +1 -1
  53. package/components/feedback/_macro.njk +1 -1
  54. package/components/feedback/_macro.spec.js +3 -3
  55. package/components/feedback/example-feedback-call-to-action.njk +1 -1
  56. package/components/field/_field-group.scss +0 -2
  57. package/components/field/_field.scss +1 -2
  58. package/components/fieldset/_fieldset.scss +2 -2
  59. package/components/fieldset/_macro.njk +1 -1
  60. package/components/fieldset/_macro.spec.js +1 -1
  61. package/components/footer/_footer.scss +12 -7
  62. package/components/footer/_macro.njk +54 -34
  63. package/components/footer/_macro.spec.js +90 -28
  64. package/components/footer/example-footer-cymraeg.njk +1 -1
  65. package/components/footer/example-footer-transactional.njk +1 -1
  66. package/components/footer/example-footer-warning.njk +1 -1
  67. package/components/footer/example-footer-with-alternative-organisation.njk +99 -94
  68. package/components/footer/example-footer-with-coat-of-arms.njk +1 -1
  69. package/components/footer/example-footer-with-copyright.njk +1 -1
  70. package/components/footer/example-footer-with-multiple-logos-and-split-display.njk +173 -0
  71. package/components/footer/example-footer-with-multiple-logos.njk +172 -0
  72. package/components/footer/example-footer.njk +1 -1
  73. package/components/header/_header.scss +7 -14
  74. package/components/header/_macro.njk +19 -19
  75. package/components/header/_macro.spec.js +17 -17
  76. package/components/header/example-header-external-for-surveys.njk +2 -2
  77. package/components/header/example-header-external-welsh.njk +2 -2
  78. package/components/header/example-header-external-with-sub-navigation-removed.njk +1 -1
  79. package/components/header/example-header-external-with-sub-navigation.njk +1 -1
  80. package/components/header/example-header-multiple-logos.njk +4 -4
  81. package/components/hero/_hero.scss +6 -8
  82. package/components/hero/_macro.njk +1 -1
  83. package/components/icon/_icon.scss +4 -4
  84. package/components/icon/_macro.njk +4 -4
  85. package/components/icon/_macro.spec.js +2 -2
  86. package/components/image/_image.scss +1 -1
  87. package/components/image/_macro.njk +1 -1
  88. package/components/image/_macro.spec.js +10 -10
  89. package/components/image/example-image-for-regular-screens.njk +1 -1
  90. package/components/input/_input-type.scss +0 -2
  91. package/components/input/_input.scss +10 -10
  92. package/components/input/_macro.njk +4 -2
  93. package/components/input/example-input-search-with-character-check.njk +1 -1
  94. package/components/input/example-input-search.njk +1 -1
  95. package/components/label/_label.scss +1 -3
  96. package/components/language-selector/_macro.njk +3 -3
  97. package/components/language-selector/_macro.spec.js +7 -7
  98. package/components/list/_list.scss +1 -5
  99. package/components/list/_macro.njk +9 -10
  100. package/components/list/_macro.spec.js +50 -9
  101. package/components/list/example-inline-list-with-social-icon-prefix.njk +1 -1
  102. package/components/message/_macro.njk +3 -3
  103. package/components/message/_macro.spec.js +3 -3
  104. package/components/message-list/_macro.njk +2 -2
  105. package/components/message-list/_macro.spec.js +8 -4
  106. package/components/message-list/_message-list.scss +2 -2
  107. package/components/navigation/_macro.njk +9 -9
  108. package/components/navigation/_macro.spec.js +2 -2
  109. package/components/navigation/_navigation.scss +2 -6
  110. package/components/navigation/navigation.dom.js +1 -1
  111. package/components/navigation/navigation.spec.js +4 -4
  112. package/components/pagination/_macro.njk +2 -2
  113. package/components/pagination/_pagination.scss +1 -7
  114. package/components/panel/_macro.njk +5 -4
  115. package/components/panel/_macro.spec.js +2 -2
  116. package/components/panel/_panel.scss +12 -8
  117. package/components/password/_macro.njk +1 -1
  118. package/components/password/_macro.spec.js +2 -2
  119. package/components/phase-banner/_macro.njk +1 -1
  120. package/components/phase-banner/_phase-banner.scss +3 -4
  121. package/components/phase-banner/example-phase-banner-alpha.njk +1 -1
  122. package/components/phase-banner/example-phase-banner-beta.njk +1 -1
  123. package/components/question/_macro.njk +8 -8
  124. package/components/question/_macro.spec.js +3 -3
  125. package/components/question/_question.scss +3 -3
  126. package/components/radios/_macro.njk +1 -1
  127. package/components/radios/_macro.spec.js +1 -1
  128. package/components/radios/_radios.scss +1 -1
  129. package/components/radios/example-radios-with-clear-button-expanded.njk +1 -1
  130. package/components/radios/example-radios-with-clear-button.njk +1 -1
  131. package/components/related-content/_macro.spec.js +2 -2
  132. package/components/related-content/_related-content.scss +1 -1
  133. package/components/related-content/example-related-content-general.njk +2 -2
  134. package/components/related-content/example-related-content-social-media.njk +1 -1
  135. package/components/reply/_macro.njk +3 -1
  136. package/components/reply/_macro.spec.js +1 -1
  137. package/components/reply/reply.spec.js +1 -1
  138. package/components/section-navigation/_macro.njk +10 -10
  139. package/components/section-navigation/_macro.spec.js +15 -15
  140. package/components/section-navigation/_section-navigation.scss +4 -10
  141. package/components/section-navigation/example-section-navigation-single-vertical-with-title.njk +3 -3
  142. package/components/section-navigation/example-section-navigation-vertical.njk +14 -14
  143. package/components/section-navigation/example-section-navigation.njk +3 -3
  144. package/components/select/example-select-with-inline-label.njk +1 -1
  145. package/components/share-page/_macro.njk +7 -7
  146. package/components/share-page/_macro.spec.js +2 -2
  147. package/components/share-page/example-share-page.njk +1 -1
  148. package/components/status/_status.scss +1 -1
  149. package/components/summary/_macro.njk +33 -33
  150. package/components/summary/_macro.spec.js +34 -34
  151. package/components/summary/_summary.scss +2 -4
  152. package/components/summary/example-summary-card-grouped.njk +34 -34
  153. package/components/summary/example-summary-grouped-total.njk +7 -7
  154. package/components/summary/example-summary-grouped-with-errors.njk +9 -9
  155. package/components/summary/example-summary-grouped.njk +34 -34
  156. package/components/summary/example-summary-household.njk +7 -7
  157. package/components/summary/example-summary-hub-minimal.njk +8 -8
  158. package/components/summary/example-summary-hub.njk +16 -16
  159. package/components/summary/example-summary-multiple.njk +7 -7
  160. package/components/summary/example-summary-no-action.njk +5 -5
  161. package/components/summary/example-summary.njk +9 -9
  162. package/components/table/_table.scss +2 -3
  163. package/components/table-of-contents/_macro.njk +3 -3
  164. package/components/table-of-contents/_macro.spec.js +3 -3
  165. package/components/table-of-contents/example-table-of-contents-sticky-full-page.njk +1 -1
  166. package/components/tabs/_macro.njk +3 -3
  167. package/components/tabs/_macro.spec.js +3 -3
  168. package/components/tabs/_tabs.scss +3 -4
  169. package/components/tabs/example-tabs-details.njk +1 -1
  170. package/components/text-indent/_text-indent.scss +1 -1
  171. package/components/timeline/_macro.njk +4 -4
  172. package/components/timeline/_macro.spec.js +3 -3
  173. package/components/timeline/_timeline.scss +4 -3
  174. package/components/timeline/example-timeline.njk +1 -1
  175. package/components/upload/_upload.scss +2 -2
  176. package/components/video/_macro.njk +4 -4
  177. package/components/video/_macro.spec.js +2 -2
  178. package/components/video/_video.scss +1 -1
  179. package/components/video/example-video.njk +2 -2
  180. package/components/video/video.spec.js +2 -2
  181. package/css/main.css +1 -1
  182. package/layout/_dsTemplate.njk +1 -1
  183. package/layout/_template.njk +31 -31
  184. package/package.json +4 -5
  185. package/scripts/main.es5.js +1 -1
  186. package/scripts/main.js +1 -1
  187. package/scss/base/_global.scss +2 -0
  188. package/scss/base/_typography.scss +0 -2
  189. package/scss/main.scss +0 -1
  190. package/scss/objects/_container.scss +1 -1
  191. package/scss/objects/_page.scss +2 -3
  192. package/scss/overrides/rtl.scss +1 -1
  193. package/scss/utilities/_grid.scss +103 -96
  194. package/scss/utilities/_margin.scss +11 -5
  195. package/scss/utilities/_padding.scss +12 -5
  196. package/scss/utilities/_typography.scss +2 -1
  197. package/scss/vars/_forms.scss +8 -10
  198. package/scss/vars/_grid.scss +4 -4
  199. package/scss/vars/_typography.scss +26 -19
  200. package/components/call-to-action/_call-to-action.scss +0 -8
  201. package/components/call-to-action/_macro.njk +0 -24
  202. package/components/call-to-action/_macro.spec.js +0 -48
  203. package/components/call-to-action/example-call-to-action-default.njk +0 -15
  204. package/components/metadata/_macro.njk +0 -14
@@ -178,7 +178,19 @@ describe('macro: list', () => {
178
178
  const $ = cheerio.load(
179
179
  renderComponent('list', {
180
180
  element: 'ol',
181
- itemsList: [{ text: 'Only item' }],
181
+ attributes: {
182
+ a: 123,
183
+ b: 456,
184
+ },
185
+ itemsList: [
186
+ {
187
+ text: 'Only item',
188
+ attributes: {
189
+ c: 789,
190
+ d: 123,
191
+ },
192
+ },
193
+ ],
182
194
  }),
183
195
  );
184
196
 
@@ -193,6 +205,16 @@ describe('macro: list', () => {
193
205
  it('does not output any <li> elements', () => {
194
206
  expect($('.ons-list li').length).toBe(0);
195
207
  });
208
+
209
+ it('has additionally provided list `attributes`', () => {
210
+ expect($('.ons-list').attr('a')).toBe('123');
211
+ expect($('.ons-list').attr('b')).toBe('456');
212
+ });
213
+
214
+ it('has additionally provided list item `attributes`', () => {
215
+ expect($('.ons-list--p').attr('c')).toBe('789');
216
+ expect($('.ons-list--p').attr('d')).toBe('123');
217
+ });
196
218
  });
197
219
 
198
220
  it('has additionally provided `attributes`', () => {
@@ -247,6 +269,25 @@ describe('macro: list', () => {
247
269
 
248
270
  expect($('a').length).toBe(0);
249
271
  });
272
+
273
+ it('has additionally provided `attributes`', () => {
274
+ const $ = cheerio.load(
275
+ renderComponent('list', {
276
+ itemsList: [
277
+ {
278
+ ...item,
279
+ attributes: {
280
+ a: 123,
281
+ b: 456,
282
+ },
283
+ },
284
+ ],
285
+ }),
286
+ );
287
+
288
+ expect($('.ons-list__item').attr('a')).toBe('123');
289
+ expect($('.ons-list__item').attr('b')).toBe('456');
290
+ });
250
291
  });
251
292
 
252
293
  describe('content with an internal link', () => {
@@ -380,7 +421,7 @@ describe('macro: list', () => {
380
421
  expect($('.ons-list__link .ons-u-vh').text()).toBe(' (opens in a new tab)');
381
422
  });
382
423
 
383
- it('has additionally provided `attributes`', () => {
424
+ it('list item has additionally provided `attributes`', () => {
384
425
  const $ = cheerio.load(
385
426
  renderComponent('list', {
386
427
  itemsList: [
@@ -396,8 +437,8 @@ describe('macro: list', () => {
396
437
  }),
397
438
  );
398
439
 
399
- expect($('.ons-list__link').attr('a')).toBe('123');
400
- expect($('.ons-list__link').attr('b')).toBe('456');
440
+ expect($('.ons-list__item').attr('a')).toBe('123');
441
+ expect($('.ons-list__item').attr('b')).toBe('456');
401
442
  });
402
443
 
403
444
  it('renders visually hidden prefix', () => {
@@ -451,7 +492,7 @@ describe('macro: list', () => {
451
492
 
452
493
  expect(externalLinkSpy.occurrences[0]).toEqual({
453
494
  url: 'https://example.com/external-link',
454
- linkText: expectedItemText,
495
+ text: expectedItemText,
455
496
  });
456
497
  });
457
498
 
@@ -603,12 +644,12 @@ describe('macro: list', () => {
603
644
  itemsList: [{ text: 'First item' }, { text: 'Second item', iconType: 'print' }, { text: 'Third item' }],
604
645
  iconPosition,
605
646
  iconType: 'check',
606
- iconSize: 'xxl',
647
+ iconSize: '2xl',
607
648
  });
608
649
 
609
- expect(iconsSpy.occurrences[0]).toEqual({ iconType: 'check', iconSize: 'xxl' });
610
- expect(iconsSpy.occurrences[1]).toEqual({ iconType: 'print', iconSize: 'xxl' });
611
- expect(iconsSpy.occurrences[2]).toEqual({ iconType: 'check', iconSize: 'xxl' });
650
+ expect(iconsSpy.occurrences[0]).toEqual({ iconType: 'check', iconSize: '2xl' });
651
+ expect(iconsSpy.occurrences[1]).toEqual({ iconType: 'print', iconSize: '2xl' });
652
+ expect(iconsSpy.occurrences[2]).toEqual({ iconType: 'check', iconSize: '2xl' });
612
653
  });
613
654
 
614
655
  it('renders the icon before the item text', () => {
@@ -3,7 +3,7 @@
3
3
  onsList({
4
4
  "variants": 'inline',
5
5
  "iconPosition": 'before',
6
- "iconSize": 'xxl',
6
+ "iconSize": '2xl',
7
7
  "itemsList": [
8
8
  {
9
9
  "url": '#0',
@@ -21,15 +21,15 @@
21
21
  </dd>
22
22
  </div>
23
23
  </dl>
24
- {% if params.unreadLink %}
24
+ {% if params.unreadLinkUrl %}
25
25
  <a
26
26
  class="ons-message__unread-link"
27
27
  {% if params.unreadLinkId %}id="{{ params.unreadLinkId }}"{% endif %}
28
- href="{{ params.unreadLink }}"
28
+ href="{{ params.unreadLinkUrl }}"
29
29
  >{{ params.unreadLinkText }}</a
30
30
  >
31
31
  {% endif %}
32
32
  </div>
33
- <div class="ons-message__body" {% if params.messageID %}id="{{ params.messageID }}"{% endif %}>{{ caller() }}</div>
33
+ <div class="ons-message__body" {% if params.messageId %}id="{{ params.messageId }}"{% endif %}>{{ caller() }}</div>
34
34
  </div>
35
35
  {%- endmacro -%}
@@ -15,13 +15,13 @@ const EXAMPLE_MESSAGE_MINIMAL = {
15
15
 
16
16
  const EXAMPLE_MESSAGE = {
17
17
  ...EXAMPLE_MESSAGE_MINIMAL,
18
- unreadLink: 'https://example.com/message/1',
18
+ unreadLinkUrl: 'https://example.com/message/1',
19
19
  unreadLinkText: 'Unread message',
20
20
  id: 'message1',
21
21
  fromId: 'from1',
22
22
  sentId: 'sent1',
23
23
  unreadLinkId: 'unreadLink1',
24
- messageID: 'messageBody1',
24
+ messageId: 'messageBody1',
25
25
  };
26
26
 
27
27
  describe('macro: message', () => {
@@ -92,7 +92,7 @@ describe('macro: message', () => {
92
92
  expect($('.ons-message__timestamp .ons-message__value').attr('id')).toBe('sent1');
93
93
  });
94
94
 
95
- it('has the provided `unreadLink`', () => {
95
+ it('has the provided `unreadLinkUrl`', () => {
96
96
  const $ = cheerio.load(renderComponent('message', EXAMPLE_MESSAGE, ['Message content...']));
97
97
 
98
98
  expect($('.ons-message__unread-link').attr('href')).toBe('https://example.com/message/1');
@@ -3,7 +3,7 @@
3
3
  {% for message in params.messages %}
4
4
  <li class="ons-message-item" aria-labelledby="{{ message.id }}">
5
5
  <h3 class="ons-message-item__subject" id="{{ message.id }}">
6
- <a href="{{ message.url }}" class="ons-u-fs-r--b">{{ message.subject }}</a>
6
+ <a href="{{ message.subject.url }}" class="ons-u-fs-r--b">{{ message.subject.text }}</a>
7
7
  {% if message.unread %}<span class="ons-message-item__unread ons-u-fs-s">({{ params.unreadText }})</span>{% endif %}
8
8
  </h3>
9
9
  <dl class="ons-message-item__metadata" aria-label="{{ params.ariaLabelMetaData | default("Message metadata") }}">
@@ -20,7 +20,7 @@
20
20
  {{ message.body | safe }}
21
21
  </div>
22
22
  <div class="ons-message-item__link ons-u-vh">
23
- <a href="{{ message.url }}">{{ params.hiddenReadLabel }}: {{ message.subject }}</a>
23
+ <a href="{{ message.subject.url }}">{{ params.hiddenReadLabel }}: {{ message.subject.text }}</a>
24
24
  </div>
25
25
  </li>
26
26
  {% endfor %}
@@ -14,16 +14,20 @@ const EXAMPLE_MESSAGE_LIST_MINIMAL = {
14
14
  {
15
15
  id: 'message1',
16
16
  unread: true,
17
- url: 'https://example.com/message/1',
18
- subject: 'Example message subject',
17
+ subject: {
18
+ url: 'https://example.com/message/1',
19
+ text: 'Example message subject',
20
+ },
19
21
  fromText: 'Example Sender 1',
20
22
  dateText: 'Tue 4 Jul 2020 at 7:47',
21
23
  body: 'An example message.',
22
24
  },
23
25
  {
24
26
  id: 'message2',
25
- url: 'https://example.com/message/2',
26
- subject: 'Another example message subject',
27
+ subject: {
28
+ url: 'https://example.com/message/2',
29
+ text: 'Another example message subject',
30
+ },
27
31
  fromText: 'Example Sender 2',
28
32
  dateText: 'Mon 1 Oct 2019 at 9:52',
29
33
  body: 'Another example message.',
@@ -12,7 +12,7 @@
12
12
  }
13
13
 
14
14
  &__subject {
15
- margin: 0 0 0.2rem;
15
+ margin: 0 0 0.25rem;
16
16
  }
17
17
 
18
18
  &__metadata {
@@ -20,7 +20,7 @@
20
20
 
21
21
  &-term,
22
22
  &-value {
23
- margin: 0 0 0.3rem;
23
+ margin: 0 0 0.25rem;
24
24
  }
25
25
  }
26
26
  }
@@ -3,12 +3,12 @@
3
3
  {% from "components/autosuggest/_macro.njk" import onsAutosuggest %}
4
4
  <div class="ons-navigation-wrapper{{ ' ons-navigation-wrapper--neutral' if params.variants == 'neutral' }}">
5
5
  <div
6
- class="ons-container ons-container--gutterless@xxs@l{{ ' ons-container--full-width' if params.fullWidth or params.navigation.fullWidth }}{{ ' ons-container--wide' if params.wide or params.navigation.wide }}"
6
+ class="ons-container ons-container--gutterless@2xs@l{{ ' ons-container--full-width' if params.fullWidth or params.navigation.fullWidth }}{{ ' ons-container--wide' if params.wide or params.navigation.wide }}"
7
7
  >
8
8
  {% if params.siteSearchAutosuggest %}
9
9
  <div class="ons-navigation-search ons-js-navigation-search">
10
10
  {% set autosuggestClasses = "ons-input-search ons-input-search--icon" %}
11
- {% set autosuggestLabelClasses = "ons-u-pl-l" %}
11
+ {% set autosuggestLabelClasses = "ons-u-pl-xl" %}
12
12
  {% if params.variants == "neutral" %}
13
13
  {% set autosuggestClasses = autosuggestClasses + ' ons-input-search--dark' %}
14
14
  {% else %}
@@ -77,13 +77,13 @@
77
77
  {% if params.navigation.subNavigation %}
78
78
  {% if not params.navigation.subNavigation.removeHorizontalSubNav %}
79
79
  <nav
80
- class="ons-navigation ons-navigation--sub ons-u-d-no@xxs@l{{ ' ' + params.navigation.subNavigation.classes if params.navigation.subNavigation.classes else '' }}"
80
+ class="ons-navigation ons-navigation--sub ons-u-d-no@2xs@l{{ ' ' + params.navigation.subNavigation.classes if params.navigation.subNavigation.classes else '' }}"
81
81
  id="{{ params.navigation.subNavigation.id }}"
82
82
  aria-label="{{ params.navigation.subNavigation.ariaLabel | default('Section menu') }}"
83
83
  data-analytics="header-section-navigation"
84
84
  >
85
85
  <div
86
- class="ons-container ons-container--gutterless@xxs@l{{ ' ons-container--full-width' if params.fullWidth or params.navigation.fullWidth }}{{ ' ons-container--wide' if params.wide or params.navigation.wide }}"
86
+ class="ons-container ons-container--gutterless@2xs@l{{ ' ons-container--full-width' if params.fullWidth or params.navigation.fullWidth }}{{ ' ons-container--wide' if params.wide or params.navigation.wide }}"
87
87
  >
88
88
  <ul class="ons-navigation__list ons-navigation__list">
89
89
  {% for item in params.navigation.subNavigation.itemsList %}
@@ -123,20 +123,20 @@
123
123
  })
124
124
  }}
125
125
  <nav
126
- class="ons-navigation ons-navigation--sub-mobile ons-u-d-no ons-js-secondary-nav ons-u-mt-xs"
126
+ class="ons-navigation ons-navigation--sub-mobile ons-u-d-no ons-js-secondary-nav ons-u-mt-2xs"
127
127
  id="{{ params.navigation.subNavigation.id }}--mobile"
128
128
  aria-hidden="true"
129
129
  aria-label="{{ params.navigation.subNavigation.ariaLabel | default("Section menu") }}"
130
130
  data-analytics="header-section-navigation"
131
131
  >
132
132
  <div
133
- class="ons-container ons-container--gutterless@xxs@l{{ ' ons-container--full-width' if params.navigation.fullWidth }}{{ ' ons-container--wide' if params.navigation.wide }}"
133
+ class="ons-container ons-container--gutterless@2xs@l{{ ' ons-container--full-width' if params.navigation.fullWidth }}{{ ' ons-container--wide' if params.navigation.wide }}"
134
134
  >
135
135
  <ul class="ons-navigation__list ons-navigation__list--parent">
136
136
  <li
137
- class="ons-navigation__item{{ ' ons-navigation__item--active' if (params.navigation.subNavigation.overviewURL == params.navigation.subNavigation.currentPath) }}"
137
+ class="ons-navigation__item{{ ' ons-navigation__item--active' if (params.navigation.subNavigation.overviewUrl == params.navigation.subNavigation.currentPath) }}"
138
138
  >
139
- <a class="ons-navigation__link" href="{{ params.navigation.subNavigation.overviewURL }}"
139
+ <a class="ons-navigation__link" href="{{ params.navigation.subNavigation.overviewUrl }}"
140
140
  >{{ params.navigation.subNavigation.overviewText | default('Overview') }}</a
141
141
  >
142
142
  </li>
@@ -162,7 +162,7 @@
162
162
  <h3 class="ons-navigation__list-header">{{ section.sectionTitle }}</h3>
163
163
  {% endif %}
164
164
  <ul
165
- class="ons-navigation__list ons-navigation__list--child ons-list--dashed ons-u-ml-s ons-u-mt-xs"
165
+ class="ons-navigation__list ons-navigation__list--child ons-list--dashed ons-u-ml-s ons-u-mt-2xs"
166
166
  >
167
167
  {% for child in section.children %}
168
168
  <li
@@ -29,7 +29,7 @@ const PARAMS = {
29
29
  ],
30
30
  subNavigation: {
31
31
  id: 'sub-nav',
32
- overviewURL: '#overview',
32
+ overviewUrl: '#overview',
33
33
  overviewText: 'Overview',
34
34
  ariaLabel: 'Section menu',
35
35
  itemsList: [
@@ -138,7 +138,7 @@ describe('macro: navigation', () => {
138
138
  classes: 'ons-input-search ons-input-search--icon',
139
139
  label: {
140
140
  id: 'ons-site-search-label',
141
- classes: 'ons-u-pl-l ons-label--white',
141
+ classes: 'ons-u-pl-xl ons-label--white',
142
142
  },
143
143
  },
144
144
  });
@@ -3,7 +3,6 @@
3
3
 
4
4
  &-wrapper {
5
5
  background: var(--ons-color-header);
6
- margin-top: -0.03rem;
7
6
 
8
7
  &--neutral {
9
8
  background: var(--ons-color-header-neutral);
@@ -42,8 +41,7 @@
42
41
  }
43
42
 
44
43
  &-header {
45
- font-size: 1rem;
46
- margin: 0.75rem 0 0.6rem;
44
+ margin: 0.75rem 0 0.5rem;
47
45
  padding: 0 0 0 1rem;
48
46
  }
49
47
  }
@@ -51,7 +49,6 @@
51
49
  &__item {
52
50
  border-left: 4px solid transparent;
53
51
  display: block;
54
- margin: 0 0 0.2rem;
55
52
  &--active,
56
53
  &:hover {
57
54
  border-color: var(--ons-color-white);
@@ -72,7 +69,7 @@
72
69
  border-left: 0;
73
70
  display: inline-block;
74
71
  margin: 0 0 0 1rem;
75
- padding: 0 0 0.3rem;
72
+ padding: 0 0 0.25rem;
76
73
  position: relative;
77
74
  text-align: center;
78
75
 
@@ -123,7 +120,6 @@
123
120
 
124
121
  @include mq(l) {
125
122
  display: inline-block;
126
- font-size: 1rem;
127
123
  margin: 0;
128
124
  padding: 0;
129
125
  }
@@ -3,7 +3,7 @@ import domready from '../../js/domready';
3
3
  domready(async () => {
4
4
  const toggleNavigationBtn = document.querySelector('.ons-js-navigation-button');
5
5
  const navigationEl = document.querySelector('.ons-js-navigation');
6
- const navigationHideClass = 'ons-u-d-no@xxs@l';
6
+ const navigationHideClass = 'ons-u-d-no@2xs@l';
7
7
  const toggleSubNavigationBtn = document.querySelector('.ons-js-sub-navigation-button');
8
8
  const subNavigationEl = document.querySelector('.ons-js-secondary-nav');
9
9
  const subNavigationHideClass = 'ons-u-d-no';
@@ -49,7 +49,7 @@ const EXAMPLE_NAVIGATION_WITH_SUBNAVIGATION = {
49
49
  ],
50
50
  subNavigation: {
51
51
  id: 'sub-nav',
52
- overviewURL: '#overview',
52
+ overviewUrl: '#overview',
53
53
  overviewText: 'Overview',
54
54
  ariaLabel: 'Section menu',
55
55
  currentPath: '#1',
@@ -108,7 +108,7 @@ const EXAMPLE_NAVIGATION_WITH_SUBNAVIGATION_REMOVED = {
108
108
  ],
109
109
  subNavigation: {
110
110
  id: 'sub-nav-hidden',
111
- overviewURL: '#overview',
111
+ overviewUrl: '#overview',
112
112
  overviewText: 'Overview',
113
113
  ariaLabel: 'Section menu',
114
114
  currentPath: '#1',
@@ -212,7 +212,7 @@ describe('script: navigation', () => {
212
212
 
213
213
  it('has the hide class removed from the navigation list', async () => {
214
214
  const hasClass = await page.$eval(navEl, (node) =>
215
- node.classList.contains('ons-u-d-no@xxs@l' || 'ons-u-d-no' || 'ons-u-d-no@xs@l'),
215
+ node.classList.contains('ons-u-d-no@2xs@l' || 'ons-u-d-no' || 'ons-u-d-no@xs@l'),
216
216
  );
217
217
  expect(hasClass).toBe(false);
218
218
  });
@@ -284,7 +284,7 @@ describe('script: navigation', () => {
284
284
 
285
285
  it('has the hide class removed from the navigation list', async () => {
286
286
  const hasClass = await page.$eval(navEl, (node) =>
287
- node.classList.contains('ons-u-d-no@xxs@l' || 'ons-u-d-no' || 'ons-u-d-no@xs@l'),
287
+ node.classList.contains('ons-u-d-no@2xs@l' || 'ons-u-d-no' || 'ons-u-d-no@xs@l'),
288
288
  );
289
289
  expect(hasClass).toBe(false);
290
290
  });
@@ -26,7 +26,7 @@
26
26
  {{-
27
27
  onsIcon({
28
28
  "iconType": 'arrow-previous',
29
- "classes": 'ons-u-mr-xs',
29
+ "classes": 'ons-u-mr-2xs',
30
30
  "iconSize": 'm'
31
31
  })
32
32
  -}}
@@ -93,7 +93,7 @@
93
93
  {{-
94
94
  onsIcon({
95
95
  "iconType": 'arrow-next',
96
- "classes": 'ons-u-ml-xs',
96
+ "classes": 'ons-u-ml-2xs',
97
97
  "iconSize": 'm'
98
98
  })
99
99
  -}}
@@ -3,7 +3,7 @@ $pagination-item-width: 2.5rem;
3
3
 
4
4
  .ons-pagination {
5
5
  &__position {
6
- margin: 0 0 0.4rem;
6
+ margin: 0 0 0.5rem;
7
7
  }
8
8
 
9
9
  &__items {
@@ -27,12 +27,6 @@ $pagination-item-width: 2.5rem;
27
27
  }
28
28
  }
29
29
 
30
- &__items > & {
31
- &__item--current {
32
- margin: 0 0 0 $pagination-item-padding;
33
- }
34
- }
35
-
36
30
  &__item,
37
31
  &__link {
38
32
  height: $pagination-item-width;
@@ -52,13 +52,14 @@
52
52
 
53
53
  {% if params.title %}
54
54
  {% if params.variant == 'error' %}
55
- {% set defaultTitleTag = "h2" %}
55
+ {% set defaultTitleTag = "h" ~ 2 %}
56
56
  {% else %}
57
57
  {% set defaultTitleTag = "div" %}
58
58
  {% endif %}
59
- {% set titleTag = params.titleTag | default(defaultTitleTag) %}
60
- {% set openingTag = "<" + titleTag %}
61
- {% set closingTag = "</" + titleTag + ">" %}
59
+ {% set headingLevel = "h" ~ params.headingLevel if params.headingLevel else undefined %}
60
+ {% set titleTag = headingLevel | default(defaultTitleTag) %}
61
+ {% set openingTag = "<" ~ titleTag %}
62
+ {% set closingTag = "</" ~ titleTag ~ ">" %}
62
63
  <div class="ons-panel__header">
63
64
  {{ openingTag | safe }} id="alert"{% if params.variant %}data-qa="{{ params.variant }}-header"{% endif %}
64
65
  class="ons-panel__title ons-u-fs-r--b">{{ params.title | safe }}{{ closingTag | safe }}
@@ -147,12 +147,12 @@ describe('macro: panel', () => {
147
147
  expect(titleTag).toBe('div');
148
148
  });
149
149
 
150
- it('has the provided `titleTag`', () => {
150
+ it('has the provided `headingLevel`', () => {
151
151
  const $ = cheerio.load(
152
152
  renderComponent('panel', {
153
153
  ...EXAMPLE_PANEL_BASIC,
154
154
  title: 'Panel title',
155
- titleTag: 'h3',
155
+ headingLevel: 3,
156
156
  }),
157
157
  );
158
158
 
@@ -33,11 +33,11 @@
33
33
 
34
34
  // Removes inherited bottom margin to make whitespace inside panel equal
35
35
  > *:last-child {
36
- margin-bottom: 0;
36
+ @extend .ons-u-mb-no;
37
37
  }
38
38
 
39
39
  .ons-field {
40
- margin-bottom: 0;
40
+ @extend .ons-u-mb-no;
41
41
  }
42
42
 
43
43
  &:focus {
@@ -66,17 +66,17 @@
66
66
  // Removes inherited bottom margin to make whitespace inside panel equal
67
67
  > *:last-child,
68
68
  strong > *:last-child {
69
- margin-bottom: 0;
69
+ @extend .ons-u-mb-no;
70
70
  }
71
71
 
72
- &.ons-icon-margin--xxxl {
72
+ &.ons-icon-margin--3xl {
73
73
  padding-left: 2.7rem !important;
74
74
 
75
75
  @include mq(m) {
76
76
  padding-left: 3.5rem !important;
77
77
  }
78
78
  }
79
- &.ons-icon-margin--xxl {
79
+ &.ons-icon-margin--2xl {
80
80
  padding-left: 2.45rem !important;
81
81
 
82
82
  @include mq(m) {
@@ -121,7 +121,8 @@
121
121
 
122
122
  &--footer {
123
123
  background-color: var(--ons-color-grey-15) !important;
124
- margin-bottom: 0;
124
+ @extend .ons-u-mb-no;
125
+
125
126
  padding: 1rem 0 !important;
126
127
  }
127
128
  }
@@ -130,7 +131,8 @@
130
131
  &--announcement {
131
132
  border: 0 !important;
132
133
  color: var(--ons-color-white);
133
- margin-bottom: 0;
134
+ @extend .ons-u-mb-no;
135
+
134
136
  outline: none !important;
135
137
  padding: 1rem 0 !important;
136
138
  a {
@@ -198,6 +200,7 @@
198
200
  }
199
201
 
200
202
  &__icon {
203
+ top: 1.2rem;
201
204
  background-color: var(--ons-color-white);
202
205
  color: var(--ons-color-black);
203
206
  display: flex;
@@ -217,10 +220,10 @@
217
220
  &--success & {
218
221
  &__icon {
219
222
  left: 0;
223
+ top: 0.875rem;
220
224
  padding-left: 1rem;
221
225
  .ons-icon {
222
226
  fill: var(--ons-color-success) !important;
223
- margin-top: -15% !important;
224
227
  }
225
228
  }
226
229
  }
@@ -231,6 +234,7 @@
231
234
 
232
235
  &--bare & {
233
236
  &__icon {
237
+ top: -0.2rem;
234
238
  height: 1.3rem;
235
239
  width: 1.3rem;
236
240
  }
@@ -35,7 +35,7 @@
35
35
  "id": params.id,
36
36
  "name": params.name,
37
37
  "type": "password",
38
- "classes": "ons-u-mt-xs ons-js-password-input" + (" ons-input--error" if params.error else ""),
38
+ "classes": "ons-u-mt-2xs ons-js-password-input" + (" ons-input--error" if params.error else ""),
39
39
  "dontWrap": true
40
40
  })
41
41
  }}
@@ -115,7 +115,7 @@ describe('macro: password', () => {
115
115
  id: 'example-password',
116
116
  name: 'example-password-name',
117
117
  type: 'password',
118
- classes: 'ons-u-mt-xs ons-js-password-input',
118
+ classes: 'ons-u-mt-2xs ons-js-password-input',
119
119
  dontWrap: true,
120
120
  });
121
121
  });
@@ -130,7 +130,7 @@ describe('macro: password', () => {
130
130
  id: 'example-password',
131
131
  name: 'example-password-name',
132
132
  type: 'password',
133
- classes: 'ons-u-mt-xs ons-js-password-input ons-input--error',
133
+ classes: 'ons-u-mt-2xs ons-js-password-input ons-input--error',
134
134
  dontWrap: true,
135
135
  });
136
136
  });
@@ -1,7 +1,7 @@
1
1
  {% macro onsPhaseBanner(params) %}
2
2
  <div class="ons-phase-banner">
3
3
  <div class="ons-container{{ ' ons-container--full-width' if params.fullWidth }}{{ ' ons-container--wide' if params.wide }}">
4
- <div class="ons-grid ons-grid--flex ons-grid--gutterless ons-grid--vertical-top ons-grid--no-wrap">
4
+ <div class="ons-grid ons-grid-flex ons-grid--gutterless ons-grid-flex--vertical-center ons-grid-flex--no-wrap">
5
5
  {% if not params.hideBadge %}
6
6
  <div class="ons-grid__col ons-col-auto ons-u-flex-no-grow ons-u-flex-no-shrink">
7
7
  <strong class="ons-phase-banner__badge">{{ params.badge | default("Beta") }}</strong>
@@ -2,12 +2,11 @@
2
2
  background: var(--ons-color-white);
3
3
  border-bottom: 1px solid var(--ons-color-borders);
4
4
  padding: 0.5rem 0;
5
-
6
5
  &__badge {
7
6
  background: var(--ons-color-black);
8
7
  color: var(--ons-color-white);
9
- font-size: 0.85rem;
10
- line-height: 1em;
8
+ @extend .ons-u-fs-s--b;
9
+
11
10
  margin: 0 0.5rem 0 0;
12
11
  outline: 2px solid transparent; // Add transparent outline because Windows High Contrast Mode doesn't show background
13
12
  padding: 0.4rem;
@@ -15,6 +14,6 @@
15
14
  }
16
15
 
17
16
  &__desc {
18
- margin-top: 0.3rem;
17
+ margin-top: 0.25rem;
19
18
  }
20
19
  }
@@ -9,7 +9,7 @@
9
9
  {{
10
10
  onsExternalLink({
11
11
  "url": "#0",
12
- "linkText": "give feedback"
12
+ "text": "give feedback"
13
13
  })
14
14
  }}
15
15
  {% endset %}
@@ -9,7 +9,7 @@
9
9
  {{
10
10
  onsExternalLink({
11
11
  "url": "#0",
12
- "linkText": "give feedback"
12
+ "text": "give feedback"
13
13
  })
14
14
  }}
15
15
  {% endset %}