@ons/design-system 70.0.8 → 70.0.9

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 (201) hide show
  1. package/components/access-code/_macro.njk +31 -25
  2. package/components/access-code/example-access-code-error.njk +49 -37
  3. package/components/access-code/example-access-code.njk +40 -30
  4. package/components/accordion/_macro.njk +7 -6
  5. package/components/accordion/example-accordion-open.njk +0 -1
  6. package/components/address-input/_macro.njk +23 -11
  7. package/components/address-input/autosuggest.address.js +0 -5
  8. package/components/address-input/example-address-input-editable.njk +52 -50
  9. package/components/address-input/example-address-input-manual.njk +23 -21
  10. package/components/address-input/example-address-input.njk +40 -38
  11. package/components/address-output/_macro.njk +6 -6
  12. package/components/autosuggest/_macro.njk +57 -37
  13. package/components/autosuggest/example-autosuggest-country-multiple.njk +26 -26
  14. package/components/autosuggest/example-autosuggest-country.njk +24 -24
  15. package/components/back-to-top/example-back-to-top.njk +183 -6
  16. package/components/back-to-top/example-full-page-back-to-top.njk +135 -123
  17. package/components/breadcrumbs/_macro.njk +12 -4
  18. package/components/browser-banner/_macro.njk +6 -3
  19. package/components/button/_button.scss +36 -1
  20. package/components/button/_macro.njk +63 -62
  21. package/components/button/example-button-ghost.njk +1 -0
  22. package/components/call-to-action/_macro.njk +7 -5
  23. package/components/call-to-action/example-call-to-action-default.njk +3 -2
  24. package/components/card/_macro.njk +26 -10
  25. package/components/card/example-card-set-with-images.njk +31 -29
  26. package/components/card/example-card-set-with-lists.njk +58 -56
  27. package/components/card/example-card-set.njk +28 -26
  28. package/components/card/example-card.njk +9 -7
  29. package/components/char-check-limit/_macro.njk +1 -3
  30. package/components/checkboxes/_checkbox-macro.njk +19 -15
  31. package/components/checkboxes/_macro.njk +81 -72
  32. package/components/checkboxes/example-checkboxes-disabled.njk +30 -30
  33. package/components/checkboxes/example-checkboxes-error.njk +0 -1
  34. package/components/checkboxes/example-checkboxes-with-descriptions.njk +7 -5
  35. package/components/checkboxes/example-checkboxes-with-hidden-label.njk +162 -170
  36. package/components/checkboxes/example-checkboxes-with-revealed-checkboxes-expanded.njk +81 -81
  37. package/components/checkboxes/example-checkboxes-with-revealed-checkboxes.njk +79 -79
  38. package/components/checkboxes/example-checkboxes-with-revealed-select-expanded.njk +7 -5
  39. package/components/checkboxes/example-checkboxes-with-revealed-select.njk +7 -5
  40. package/components/checkboxes/example-checkboxes-with-revealed-text-input-expanded.njk +7 -5
  41. package/components/checkboxes/example-checkboxes-with-revealed-text-input.njk +7 -5
  42. package/components/checkboxes/example-checkboxes-with-select-all-button.njk +7 -5
  43. package/components/checkboxes/example-checkboxes-with-visible-text-input.njk +7 -5
  44. package/components/checkboxes/example-checkboxes.njk +7 -5
  45. package/components/content-pagination/_macro.njk +34 -32
  46. package/components/content-pagination/example-content-pagination.njk +17 -17
  47. package/components/cookies-banner/_macro.njk +19 -6
  48. package/components/cookies-banner/example-cookies-banner-cymraeg.njk +2 -1
  49. package/components/cookies-banner/example-cookies-banner.njk +3 -4
  50. package/components/date-input/_macro.njk +71 -63
  51. package/components/date-input/example-date-input-error-for-single-field.njk +0 -1
  52. package/components/date-input/example-date-input-error.njk +0 -1
  53. package/components/description-list/_macro.njk +20 -11
  54. package/components/details/_macro.njk +18 -11
  55. package/components/details/example-details-with-warning.njk +15 -10
  56. package/components/document-list/_macro.njk +102 -93
  57. package/components/document-list/example-document-list-article-featured.njk +27 -25
  58. package/components/document-list/example-document-list-articles.njk +55 -53
  59. package/components/document-list/example-document-list-downloads.njk +49 -47
  60. package/components/document-list/example-document-list-search-result-featured.njk +19 -17
  61. package/components/document-list/example-document-list-search-results.njk +60 -58
  62. package/components/duration/_macro.njk +61 -55
  63. package/components/duration/example-duration-error-for-single-field.njk +28 -26
  64. package/components/duration/example-duration-single-field.njk +23 -19
  65. package/components/duration/example-duration.njk +33 -29
  66. package/components/error/_macro.njk +8 -6
  67. package/components/external-link/_macro.njk +7 -5
  68. package/components/external-link/example-external-link.njk +9 -6
  69. package/components/feedback/_macro.njk +7 -5
  70. package/components/field/_macro.njk +2 -2
  71. package/components/fieldset/_macro.njk +23 -16
  72. package/components/footer/_macro.njk +28 -21
  73. package/components/footer/_macro.spec.js +1 -1
  74. package/components/footer/example-footer-cymraeg.njk +2 -1
  75. package/components/footer/example-footer-default.njk +3 -4
  76. package/components/footer/example-footer-transactional.njk +2 -1
  77. package/components/footer/example-footer-warning.njk +2 -1
  78. package/components/footer/example-footer-with-alternative-organisation.njk +2 -1
  79. package/components/footer/example-footer-with-coat-of-arms.njk +2 -1
  80. package/components/footer/example-footer-with-copyright.njk +2 -1
  81. package/components/footer/example-footer.njk +2 -1
  82. package/components/header/_header.scss +24 -19
  83. package/components/header/_macro.njk +183 -141
  84. package/components/header/example-header-default.njk +2 -1
  85. package/components/header/example-header-external-for-survey-with-description.njk +2 -1
  86. package/components/header/example-header-external-for-surveys.njk +2 -1
  87. package/components/header/example-header-external-welsh.njk +7 -7
  88. package/components/header/example-header-external-with-navigation-and-search.njk +3 -2
  89. package/components/header/example-header-external-with-navigation.njk +2 -1
  90. package/components/header/example-header-external-with-service-links.njk +2 -1
  91. package/components/header/example-header-external-with-sub-navigation-removed.njk +2 -1
  92. package/components/header/example-header-external-with-sub-navigation.njk +3 -2
  93. package/components/header/example-header-internal.njk +2 -1
  94. package/components/header/example-header-multiple-logos.njk +2 -1
  95. package/components/header/{example-header-neutral-for-multicoloured-logo.njk → example-header-neutral.njk} +2 -1
  96. package/components/helpers/grid.njk +17 -16
  97. package/components/hero/_macro.njk +6 -11
  98. package/components/hero/example-hero-dark.njk +2 -1
  99. package/components/hero/example-hero-default.njk +2 -1
  100. package/components/icon/_macro.njk +601 -168
  101. package/components/image/_macro.njk +7 -5
  102. package/components/input/_macro.njk +114 -95
  103. package/components/input/example-input-search-with-character-check.njk +1 -1
  104. package/components/input/example-input-search-with-placeholder.njk +1 -1
  105. package/components/input/example-input-search.njk +1 -1
  106. package/components/label/_macro.njk +32 -26
  107. package/components/language-selector/_macro.njk +11 -2
  108. package/components/list/_list.scss +13 -0
  109. package/components/list/_macro.njk +93 -73
  110. package/components/message/_macro.njk +20 -7
  111. package/components/message-list/_macro.njk +26 -20
  112. package/components/modal/_macro.njk +11 -12
  113. package/components/multiple-input-fields/_macro.njk +30 -28
  114. package/components/mutually-exclusive/_macro.njk +20 -13
  115. package/components/mutually-exclusive/example-mutually-exclusive-checkboxes.njk +6 -4
  116. package/components/mutually-exclusive/example-mutually-exclusive-date.njk +7 -5
  117. package/components/mutually-exclusive/example-mutually-exclusive-duration.njk +44 -40
  118. package/components/mutually-exclusive/example-mutually-exclusive-email.njk +7 -5
  119. package/components/mutually-exclusive/example-mutually-exclusive-multiple-options.njk +6 -4
  120. package/components/mutually-exclusive/example-mutually-exclusive-number.njk +6 -4
  121. package/components/mutually-exclusive/example-mutually-exclusive-textarea.njk +6 -4
  122. package/components/navigation/_macro.njk +133 -67
  123. package/components/navigation/_navigation.scss +0 -9
  124. package/components/pagination/_macro.njk +42 -20
  125. package/components/panel/_macro.njk +27 -16
  126. package/components/panel/example-panel-bare.njk +6 -4
  127. package/components/panel/example-panel-with-announcement.njk +7 -4
  128. package/components/panel/example-panel-with-error-summary.njk +6 -4
  129. package/components/panel/example-panel-with-warning.njk +5 -3
  130. package/components/password/_macro.njk +7 -5
  131. package/components/phase-banner/_macro.njk +3 -3
  132. package/components/phase-banner/example-phase-banner-alpha.njk +2 -1
  133. package/components/phase-banner/example-phase-banner-beta.njk +4 -3
  134. package/components/question/_macro.njk +62 -47
  135. package/components/question/example-question-ccs.njk +40 -35
  136. package/components/question/example-question-fieldset.njk +84 -80
  137. package/components/question/example-question-interviewer-note.njk +27 -24
  138. package/components/question/example-question-no-fieldset.njk +39 -33
  139. package/components/quote/_macro.njk +3 -1
  140. package/components/radios/_macro.njk +54 -36
  141. package/components/radios/_macro.spec.js +21 -0
  142. package/components/radios/example-radios-with-clear-button-expanded.njk +6 -4
  143. package/components/radios/example-radios-with-clear-button.njk +6 -4
  144. package/components/radios/example-radios-with-descriptions.njk +7 -5
  145. package/components/radios/example-radios-with-revealed-select-expanded.njk +6 -4
  146. package/components/radios/example-radios-with-revealed-select.njk +6 -4
  147. package/components/radios/example-radios-with-revealed-text-area-expanded.njk +7 -5
  148. package/components/radios/example-radios-with-revealed-text-area.njk +7 -5
  149. package/components/radios/example-radios-with-revealed-text-input-expanded.njk +7 -5
  150. package/components/radios/example-radios-with-revealed-text-input.njk +7 -5
  151. package/components/radios/example-radios-with-separator.njk +6 -4
  152. package/components/radios/example-radios-with-visible-text-input.njk +7 -5
  153. package/components/radios/example-radios-without-border.njk +0 -1
  154. package/components/radios/example-radios.njk +7 -5
  155. package/components/related-content/_macro.njk +10 -11
  156. package/components/related-content/_section-macro.njk +7 -7
  157. package/components/related-content/example-related-content-general.njk +5 -3
  158. package/components/related-content/example-related-content-multiple-rows-of-links.njk +51 -49
  159. package/components/related-content/example-related-content-social-media.njk +40 -38
  160. package/components/relationships/_macro.njk +10 -8
  161. package/components/relationships/example-relationships-error.njk +176 -168
  162. package/components/relationships/example-relationships-you.njk +169 -163
  163. package/components/relationships/example-relationships.njk +167 -161
  164. package/components/section-navigation/_macro.njk +34 -12
  165. package/components/select/_macro.njk +21 -18
  166. package/components/share-page/_macro.njk +10 -5
  167. package/components/skip-to-content/_macro.njk +1 -1
  168. package/components/skip-to-content/example-skip-to-content.njk +1 -0
  169. package/components/status/_macro.njk +1 -1
  170. package/components/summary/_macro.njk +53 -23
  171. package/components/summary/example-summary-household-no-rows.njk +18 -16
  172. package/components/summary/example-summary-household.njk +75 -73
  173. package/components/summary/example-summary-hub-minimal.njk +74 -72
  174. package/components/summary/example-summary-hub.njk +169 -167
  175. package/components/table/_macro.njk +72 -45
  176. package/components/table-of-contents/_macro.njk +34 -32
  177. package/components/table-of-contents/example-table-of-contents-grouped.njk +1 -1
  178. package/components/table-of-contents/example-table-of-contents-single.njk +1 -1
  179. package/components/table-of-contents/example-table-of-contents-sticky-full-page.njk +79 -38
  180. package/components/table-of-contents/example-table-of-contents-sticky.njk +50 -13
  181. package/components/tabs/_macro.njk +12 -6
  182. package/components/tabs/example-tabs-details.njk +5 -6
  183. package/components/text-indent/_macro.njk +1 -3
  184. package/components/textarea/_macro.njk +49 -46
  185. package/components/textarea/_macro.spec.js +0 -11
  186. package/components/timeline/_macro.njk +4 -6
  187. package/components/timeout-modal/_macro.njk +21 -19
  188. package/components/timeout-modal/example-timeout-modal.njk +16 -14
  189. package/components/timeout-panel/_macro.njk +19 -17
  190. package/components/timeout-panel/example-panel-with-timeout-warning.njk +13 -11
  191. package/components/upload/_macro.njk +20 -16
  192. package/components/video/_macro.njk +16 -2
  193. package/components/video/example-video.njk +2 -2
  194. package/css/main.css +1 -1
  195. package/layout/_dsTemplate.njk +22 -20
  196. package/layout/_template.njk +63 -49
  197. package/package.json +4 -3
  198. package/scripts/main.es5.js +1 -1
  199. package/scripts/main.js +1 -1
  200. package/scss/overrides/hcm.scss +1 -1
  201. package/scss/vars/_colors.scss +1 -1
@@ -1,10 +1,12 @@
1
1
  {% from "components/input/_macro.njk" import onsInput %}
2
2
  {% from "components/question/_macro.njk" import onsQuestion %}
3
3
 
4
- {% call onsQuestion({
5
- "title": "What was your annual income before tax in 2018/19?",
6
- "legendIsQuestionTitle": true
7
- }) %}
4
+ {%
5
+ call onsQuestion({
6
+ "title": "What was your annual income before tax in 2018/19?",
7
+ "legendIsQuestionTitle": true
8
+ })
9
+ %}
8
10
  {{
9
11
  onsInput({
10
12
  "id": "currency",
@@ -1,10 +1,12 @@
1
1
  {% from "components/textarea/_macro.njk" import onsTextarea %}
2
2
  {% from "components/question/_macro.njk" import onsQuestion %}
3
3
 
4
- {% call onsQuestion({
5
- "title": "What do you think of this service?",
6
- "legendIsQuestionTitle": true
7
- }) %}
4
+ {%
5
+ call onsQuestion({
6
+ "title": "What do you think of this service?",
7
+ "legendIsQuestionTitle": true
8
+ })
9
+ %}
8
10
  {{
9
11
  onsTextarea({
10
12
  "id": "feedback",
@@ -1,8 +1,10 @@
1
1
  {% macro onsNavigation(params) %}
2
2
  {% from "components/button/_macro.njk" import onsButton %}
3
3
  {% from "components/autosuggest/_macro.njk" import onsAutosuggest %}
4
- <div class="ons-navigation-wrapper{% if params.variants == 'neutral' %} ons-navigation-wrapper--neutral{% endif %}">
5
- <div 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 }}">
4
+ <div class="ons-navigation-wrapper{{ ' ons-navigation-wrapper--neutral' if params.variants == 'neutral' }}">
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 }}"
7
+ >
6
8
  {% if params.siteSearchAutosuggest %}
7
9
  <div class="ons-navigation-search ons-js-navigation-search">
8
10
  {% set autosuggestClasses = "ons-input-search ons-input-search--icon" %}
@@ -12,43 +14,58 @@
12
14
  {% else %}
13
15
  {% set autosuggestLabelClasses = autosuggestLabelClasses + ' ons-label--white' %}
14
16
  {% endif %}
15
- {{ onsAutosuggest({
16
- "id": "ons-site-search",
17
- "containerClasses": "ons-autosuggest--header",
18
- "input": {
19
- "classes": autosuggestClasses,
20
- "accessiblePlaceholder": true,
21
- "autocomplete": "off",
22
- "label": {
23
- "text": params.siteSearchAutosuggest.label,
24
- "id": "ons-site-search-label",
25
- "classes": autosuggestLabelClasses
26
- }
27
- },
28
- "instructions": params.siteSearchAutosuggest.instructions,
29
- "ariaYouHaveSelected":params.siteSearchAutosuggest.ariaYouHaveSelected,
30
- "minChars": params.siteSearchAutosuggest.minChars,
31
- "ariaMinChars": params.siteSearchAutosuggest.ariaMinChars,
32
- "ariaResultsLabel": params.siteSearchAutosuggest.ariaResultsLabel,
33
- "ariaOneResult": params.siteSearchAutosuggest.ariaOneResult,
34
- "ariaNResults": params.siteSearchAutosuggest.ariaNResults,
35
- "ariaLimitedResults": params.siteSearchAutosuggest.ariaLimitedResults,
36
- "moreResults": params.siteSearchAutosuggest.moreResults,
37
- "resultsTitle": params.siteSearchAutosuggest.resultsTitle,
38
- "autosuggestData": params.siteSearchAutosuggest.autosuggestData,
39
- "noResults": params.siteSearchAutosuggest.noResults,
40
- "typeMore": params.siteSearchAutosuggest.typeMore,
41
- "language": params.siteSearchAutosuggest.language
42
- }) }}
17
+ {{
18
+ onsAutosuggest({
19
+ "id": "ons-site-search",
20
+ "containerClasses": "ons-autosuggest--header",
21
+ "input": {
22
+ "classes": autosuggestClasses,
23
+ "accessiblePlaceholder": true,
24
+ "autocomplete": "off",
25
+ "label": {
26
+ "text": params.siteSearchAutosuggest.label,
27
+ "id": "ons-site-search-label",
28
+ "classes": autosuggestLabelClasses
29
+ }
30
+ },
31
+ "instructions": params.siteSearchAutosuggest.instructions,
32
+ "ariaYouHaveSelected":params.siteSearchAutosuggest.ariaYouHaveSelected,
33
+ "minChars": params.siteSearchAutosuggest.minChars,
34
+ "ariaMinChars": params.siteSearchAutosuggest.ariaMinChars,
35
+ "ariaResultsLabel": params.siteSearchAutosuggest.ariaResultsLabel,
36
+ "ariaOneResult": params.siteSearchAutosuggest.ariaOneResult,
37
+ "ariaNResults": params.siteSearchAutosuggest.ariaNResults,
38
+ "ariaLimitedResults": params.siteSearchAutosuggest.ariaLimitedResults,
39
+ "moreResults": params.siteSearchAutosuggest.moreResults,
40
+ "resultsTitle": params.siteSearchAutosuggest.resultsTitle,
41
+ "autosuggestData": params.siteSearchAutosuggest.autosuggestData,
42
+ "noResults": params.siteSearchAutosuggest.noResults,
43
+ "typeMore": params.siteSearchAutosuggest.typeMore,
44
+ "language": params.siteSearchAutosuggest.language
45
+ })
46
+ }}
43
47
  </div>
44
48
  {% endif %}
45
- <nav class="ons-navigation ons-navigation--main ons-js-navigation" id="{{ params.navigation.id }}" aria-label="{{ params.navigation.ariaLabel | default("Main menu") }}" data-analytics="header-navigation">
49
+ <nav
50
+ class="ons-navigation ons-navigation--main ons-js-navigation"
51
+ id="{{ params.navigation.id }}"
52
+ aria-label="{{ params.navigation.ariaLabel | default("Main menu") }}"
53
+ data-analytics="header-navigation"
54
+ >
46
55
  <ul class="ons-navigation__list">
47
56
  {% for item in params.navigation.itemsList %}
48
- <li class="ons-navigation__item {{ item.classes }}{{ ' ons-navigation__item--active' if (item.url == params.navigation.currentPath) or (params.navigation.currentPath is not string and item.url in params.navigation.currentPath) }}">
49
- <a class="ons-navigation__link" href="{{ item.url }}" {% if item.id %}id="{{ item.id }}" {% endif %}{% if item.ariaLabel %}aria-label="{{ item.ariaLabel }}" {% endif %}>
50
- {% if item.title %}{{ item.title }}
51
- {% elif item.text %}{{ item.text }}
57
+ <li
58
+ class="ons-navigation__item {{ item.classes }}{{ ' ons-navigation__item--active' if (item.url == params.navigation.currentPath) or (params.navigation.currentPath is not string and item.url in params.navigation.currentPath) }}"
59
+ >
60
+ <a
61
+ class="ons-navigation__link"
62
+ href="{{ item.url }}"
63
+ {% if item.id %}id="{{ item.id }}"{% endif %}{% if item.ariaLabel %}{{ ' ' }}aria-label="{{ item.ariaLabel }}"{% endif %}
64
+ >
65
+ {% if item.title %}
66
+ {{ item.title }}
67
+ {% elif item.text %}
68
+ {{ item.text }}
52
69
  {% endif %}
53
70
  </a>
54
71
  </li>
@@ -59,14 +76,30 @@
59
76
  </div>
60
77
  {% if params.navigation.subNavigation %}
61
78
  {% if not params.navigation.subNavigation.removeHorizontalSubNav %}
62
- <nav class="ons-navigation ons-navigation--sub ons-u-d-no@xxs@l{{ ' ' + params.navigation.subNavigation.classes if params.navigation.subNavigation.classes }}" id="{{ params.navigation.subNavigation.id }}" aria-label="{{ params.navigation.subNavigation.ariaLabel | default("Section menu") }}" data-analytics="header-section-navigation">
63
- <div 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 }}">
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 '' }}"
81
+ id="{{ params.navigation.subNavigation.id }}"
82
+ aria-label="{{ params.navigation.subNavigation.ariaLabel | default('Section menu') }}"
83
+ data-analytics="header-section-navigation"
84
+ >
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 }}"
87
+ >
64
88
  <ul class="ons-navigation__list ons-navigation__list">
65
89
  {% for item in params.navigation.subNavigation.itemsList %}
66
- <li class="ons-navigation__item {{ item.classes }}{{ ' ons-navigation__item--active' if (item.url == params.navigation.currentPath) or (params.navigation.currentPath is not string and item.url in params.navigation.currentPath) }}">
67
- <a class="ons-navigation__link ons-navigation__link" href="{{ item.url }}" {% if item.ariaLabel %}aria-label="{{ item.ariaLabel }}" {% endif %} {% if item.id %}id="{{ item.id }}" {% endif %}>
68
- {% if item.title %}{{ item.title }}
69
- {% elif item.text %}{{ item.text }}
90
+ <li
91
+ class="ons-navigation__item{{ ' ' + item.classes if item.classes else '' }}{{ ' ons-navigation__item--active' if (item.url == params.navigation.currentPath) or (params.navigation.currentPath is not string and item.url in params.navigation.currentPath) }}"
92
+ >
93
+ <a
94
+ class="ons-navigation__link ons-navigation__link"
95
+ href="{{ item.url }}"
96
+ {% if item.ariaLabel %}aria-label="{{ item.ariaLabel }}"{% endif %}
97
+ {% if item.id %}id="{{ item.id }}"{% endif %}
98
+ >
99
+ {% if item.title %}
100
+ {{ item.title }}
101
+ {% elif item.text %}
102
+ {{ item.text }}
70
103
  {% endif %}
71
104
  </a>
72
105
  </li>
@@ -75,29 +108,52 @@
75
108
  </div>
76
109
  </nav>
77
110
  {% endif %}
78
- <div class="ons-u-d-no@l{{ ' ' + params.navigation.subNavigation.classes if params.navigation.subNavigation.classes }}">
79
- {{ onsButton({
80
- "text": params.navigation.currentPageTitle,
81
- "classes": "ons-u-d-no ons-js-sub-navigation-button",
82
- "type": "button",
83
- "variants": ["mobile", "dropdown"],
84
- "attributes": {
85
- "aria-label": "Toggle " + params.navigation.currentPageTitle + " menu" if params.navigation.currentPageTitle else "Toggle section menu",
86
- "aria-controls": params.navigation.subNavigation.id,
87
- "aria-expanded": "false"
88
- }
89
- }) }}
90
- <nav class="ons-navigation ons-navigation--sub-mobile ons-u-d-no ons-js-secondary-nav ons-u-mt-xs" id="{{ params.navigation.subNavigation.id }}--mobile" aria-hidden="true" aria-label="{{ params.navigation.subNavigation.ariaLabel | default("Section menu") }}" data-analytics="header-section-navigation">
91
- <div class="ons-container ons-container--gutterless@xxs@l{{ ' ons-container--full-width' if params.navigation.fullWidth }}{{ ' ons-container--wide' if params.navigation.wide }}">
111
+ <div class="ons-u-d-no@l{{ ' ' + params.navigation.subNavigation.classes if params.navigation.subNavigation.classes else '' }}">
112
+ {{
113
+ onsButton({
114
+ "text": params.navigation.currentPageTitle,
115
+ "classes": "ons-u-d-no ons-js-sub-navigation-button",
116
+ "type": "button",
117
+ "variants": ["mobile", "dropdown"],
118
+ "attributes": {
119
+ "aria-label": "Toggle " + params.navigation.currentPageTitle + " menu" if params.navigation.currentPageTitle else "Toggle section menu",
120
+ "aria-controls": params.navigation.subNavigation.id,
121
+ "aria-expanded": "false"
122
+ }
123
+ })
124
+ }}
125
+ <nav
126
+ class="ons-navigation ons-navigation--sub-mobile ons-u-d-no ons-js-secondary-nav ons-u-mt-xs"
127
+ id="{{ params.navigation.subNavigation.id }}--mobile"
128
+ aria-hidden="true"
129
+ aria-label="{{ params.navigation.subNavigation.ariaLabel | default("Section menu") }}"
130
+ data-analytics="header-section-navigation"
131
+ >
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 }}"
134
+ >
92
135
  <ul class="ons-navigation__list ons-navigation__list--parent">
93
- <li class="ons-navigation__item{{ ' ons-navigation__item--active' if (params.navigation.subNavigation.overviewURL == params.navigation.subNavigation.currentPath)}}">
94
- <a class="ons-navigation__link" href="{{ params.navigation.subNavigation.overviewURL }}">{{ params.navigation.subNavigation.overviewText | default('Overview') }}</a>
136
+ <li
137
+ class="ons-navigation__item{{ ' ons-navigation__item--active' if (params.navigation.subNavigation.overviewURL == params.navigation.subNavigation.currentPath) }}"
138
+ >
139
+ <a class="ons-navigation__link" href="{{ params.navigation.subNavigation.overviewURL }}"
140
+ >{{ params.navigation.subNavigation.overviewText | default('Overview') }}</a
141
+ >
95
142
  </li>
96
143
  {% for item in params.navigation.subNavigation.itemsList %}
97
- <li class="ons-navigation__item {{ ' ons-navigation__item--active' if (item.url == params.navigation.subNavigation.currentPath) or (item.url == params.navigation.currentPath) or (params.navigation.currentPath is not string and item.url in params.navigation.currentPath) }}">
98
- <a class="ons-navigation__link" href="{{ item.url }}" {% if item.ariaLabel %}aria-label="{{ item.ariaLabel }}" {% endif %} {% if item.id %}id="{{ item.id }}--mobile" {% endif %}>
99
- {% if item.title %}{{ item.title }}
100
- {% elif item.text %}{{ item.text }}
144
+ <li
145
+ class="ons-navigation__item{{ ' ons-navigation__item--active' if (item.url == params.navigation.subNavigation.currentPath) or (item.url == params.navigation.currentPath) or (params.navigation.currentPath is not string and item.url in params.navigation.currentPath) }}"
146
+ >
147
+ <a
148
+ class="ons-navigation__link"
149
+ href="{{ item.url }}"
150
+ {% if item.ariaLabel %}aria-label="{{ item.ariaLabel }}"{% endif %}
151
+ {% if item.id %}id="{{ item.id }}--mobile"{% endif %}
152
+ >
153
+ {% if item.title %}
154
+ {{ item.title }}
155
+ {% elif item.text %}
156
+ {{ item.text }}
101
157
  {% endif %}
102
158
  </a>
103
159
  {% if item.sections %}
@@ -105,12 +161,23 @@
105
161
  {% if section.sectionTitle %}
106
162
  <h3 class="ons-navigation__list-header">{{ section.sectionTitle }}</h3>
107
163
  {% endif %}
108
- <ul class="ons-navigation__list ons-navigation__list--child ons-list--dashed ons-u-ml-s ons-u-mt-xs">
164
+ <ul
165
+ class="ons-navigation__list ons-navigation__list--child ons-list--dashed ons-u-ml-s ons-u-mt-xs"
166
+ >
109
167
  {% for child in section.children %}
110
- <li class="ons-navigation__item ons-list__item {{ ' ons-navigation__item--active' if (child.url == params.navigation.currentPath) or (params.navigation.currentPath is not string and child.url in params.navigation.currentPath) }}">
111
- <a class="ons-navigation__link ons-navigation__link--section" href="{{ child.url }}" {% if child.ariaLabel %}aria-label="{{ child.ariaLabel }}" {% endif %} {% if child.id %}id="{{ child.id }}" {% endif %}>
112
- {% if child.title %}{{ child.title }}
113
- {% elif child.text %}{{ child.text }}
168
+ <li
169
+ class="ons-navigation__item ons-list__item{{ ' ons-navigation__item--active' if (child.url == params.navigation.currentPath) or (params.navigation.currentPath is not string and child.url in params.navigation.currentPath) }}"
170
+ >
171
+ <a
172
+ class="ons-navigation__link ons-navigation__link--section"
173
+ href="{{ child.url }}"
174
+ {% if child.ariaLabel %}aria-label="{{ child.ariaLabel }}"{% endif %}
175
+ {% if child.id %}id="{{ child.id }}"{% endif %}
176
+ >
177
+ {% if child.title %}
178
+ {{ child.title }}
179
+ {% elif child.text %}
180
+ {{ child.text }}
114
181
  {% endif %}
115
182
  </a>
116
183
  </li>
@@ -125,5 +192,4 @@
125
192
  </nav>
126
193
  </div>
127
194
  {% endif %}
128
-
129
195
  {% endmacro %}
@@ -7,15 +7,6 @@
7
7
 
8
8
  &--neutral {
9
9
  background: var(--ons-color-header-neutral);
10
- .ons-navigation__item {
11
- &--active,
12
- &:hover {
13
- border-color: var(--ons-color-links);
14
- }
15
- .ons-navigation__link {
16
- color: var(--ons-color-header-navigation-links);
17
- }
18
- }
19
10
  }
20
11
  }
21
12
 
@@ -8,24 +8,34 @@
8
8
  {% set prevPageIndex = currentPageIndex - 1 %}
9
9
  {% set nextPageIndex = currentPageIndex + 1 %}
10
10
 
11
- <nav class="ons-pagination {{ params.classes }}{% if params.hideRangeIndicator %} ons-pagination--no-indicator{% endif %}" aria-label="Pagination ({{ position }})">
11
+ <nav
12
+ class="ons-pagination{{ ' ' + params.classes if params.classes else '' }}{{ ' ons-pagination--no-indicator' if params.hideRangeIndicator }}"
13
+ aria-label="Pagination ({{ position }})"
14
+ >
12
15
  <div class="ons-pagination__position">{{ position }}</div>
13
16
  <ul class="ons-pagination__items">
14
17
  {% if currentPageIndex != 1 %}
15
18
  {% set prevPageIndex = currentPageIndex - 2 %}
16
19
  <li class="ons-pagination__item ons-pagination__item--previous">
17
- <a href="{{ params.pages[prevPageIndex].url }}" class="ons-pagination__link ons-pagination__link--no-underline" rel="prev" aria-label="Go to the previous page (Page {{ currentPageIndex - 1 }})">
18
- {{- onsIcon({
19
- "iconType": 'arrow-previous',
20
- "classes": 'ons-u-mr-xs',
21
- "iconSize": 'm'
22
- }) -}}
20
+ <a
21
+ href="{{ params.pages[prevPageIndex].url }}"
22
+ class="ons-pagination__link ons-pagination__link--no-underline"
23
+ rel="prev"
24
+ aria-label="Go to the previous page (Page {{ currentPageIndex - 1 }})"
25
+ >
26
+ {{-
27
+ onsIcon({
28
+ "iconType": 'arrow-previous',
29
+ "classes": 'ons-u-mr-xs',
30
+ "iconSize": 'm'
31
+ })
32
+ -}}
23
33
  <span class="ons-pagination__link-text">{{ params.previous | default("Previous") }}</span>
24
34
  </a>
25
35
  </li>
26
36
  {% endif %}
27
37
  {% if currentPageIndex > 2 %}
28
- <li class="ons-pagination__item{% if (currentPageIndex == 1) %} ons-pagination__item--current{% endif %}">
38
+ <li class="ons-pagination__item{{ ' ons-pagination__item--current' if currentPageIndex == 1 }}">
29
39
  <a href="{{ firstPage.url }}" class="ons-pagination__link" aria-label="Go to the first page (Page 1)">1</a>
30
40
  </li>
31
41
  {% endif %}
@@ -36,13 +46,15 @@
36
46
  {% set showPage = false %}
37
47
  {# Show the current, next and previous page
38
48
  Show page 2 if the current page index is within the first 4 pages
39
- Show the penultimate page if the current page index is within the last 4 pages #}
49
+ Show the penultimate page if the current page index is within the last 4 pages #}
40
50
  {% if (loop.index == currentPageIndex) or (loop.index == currentPageIndex + 1) or (loop.index == currentPageIndex - 1) or (loop.index == 2 and currentPageIndex <= 4) or ((loop.index == totalPages - 1) and (currentPageIndex > totalPages - 4)) %}
41
51
  {% set showPage = true %}
42
52
  {% endif %}
43
53
  {% if showPage == true %}
44
- <li class="ons-pagination__item{% if loop.index == currentPageIndex %} ons-pagination__item--current{% endif %}">
45
- <a href="{{ page.url }}" class="ons-pagination__link"
54
+ <li class="ons-pagination__item{{ ' ons-pagination__item--current' if loop.index == currentPageIndex }}">
55
+ <a
56
+ href="{{ page.url }}"
57
+ class="ons-pagination__link"
46
58
  {%- if loop.index == currentPageIndex -%}
47
59
  aria-current="true" aria-label="Current page ({{ position }})"
48
60
  {%- else -%}
@@ -54,7 +66,8 @@
54
66
  {%- if loop.index == currentPageIndex + 1 -%}
55
67
  rel="next"
56
68
  {%- endif -%}
57
- >{{ loop.index }}</a>
69
+ >{{ loop.index }}</a
70
+ >
58
71
  </li>
59
72
  {% endif %}
60
73
  {% endfor %}
@@ -62,19 +75,28 @@
62
75
  <li class="ons-pagination__item ons-pagination__item--gap">&hellip;</li>
63
76
  {% endif %}
64
77
  {% if currentPageIndex < totalPages - 1 %}
65
- <li class="ons-pagination__item{% if currentPageIndex == totalPages %} ons-pagination__item--current{% endif %}">
66
- <a href="{{ lastPage.url }}" class="ons-pagination__link" aria-label="Go to the last page (Page {{ totalPages }})">{{ totalPages }}</a>
78
+ <li class="ons-pagination__item{{ ' ons-pagination__item--current' if currentPageIndex == totalPages }}">
79
+ <a href="{{ lastPage.url }}" class="ons-pagination__link" aria-label="Go to the last page (Page {{ totalPages }})"
80
+ >{{ totalPages }}</a
81
+ >
67
82
  </li>
68
83
  {% endif %}
69
84
  {% if totalPages > 1 and totalPages != currentPageIndex %}
70
85
  <li class="ons-pagination__item ons-pagination__item--next">
71
- <a href="{{ params.pages[currentPageIndex].url }}" class="ons-pagination__link ons-pagination__link--no-underline" rel="next" aria-label="Go to the next page (Page {{ currentPageIndex + 1 }})">
86
+ <a
87
+ href="{{ params.pages[currentPageIndex].url }}"
88
+ class="ons-pagination__link ons-pagination__link--no-underline"
89
+ rel="next"
90
+ aria-label="Go to the next page (Page {{ currentPageIndex + 1 }})"
91
+ >
72
92
  <span class="ons-pagination__link-text">{{ params.next | default("Next") }}</span>
73
- {{- onsIcon({
74
- "iconType": 'arrow-next',
75
- "classes": 'ons-u-ml-xs',
76
- "iconSize": 'm'
77
- }) -}}
93
+ {{-
94
+ onsIcon({
95
+ "iconType": 'arrow-next',
96
+ "classes": 'ons-u-ml-xs',
97
+ "iconSize": 'm'
98
+ })
99
+ -}}
78
100
  </a>
79
101
  </li>
80
102
  {% endif %}
@@ -26,13 +26,13 @@
26
26
  {% set spaciousClass = ' ons-panel--spacious' %}
27
27
  {% endif %}
28
28
 
29
- {% if params.variant == "warn-branded" or params.variant == "announcement" %}
30
- <div class="{{containerClass}}">
31
- <div class="ons-container">
32
- {% endif %}
33
-
34
- <div {% if (params.variant == 'error' and params.title) or params.variant == 'success' %}aria-labelledby="alert" role="alert" tabindex="-1" {% if not isDesignSystemExample %}autofocus="autofocus" {% endif %}{% endif %}class="ons-panel{{ variantClass }}{{ iconClass }}{{ noTitleClass }}{{ spaciousClass }}{{ classes }}"{% if params and params.attributes %}{% for attribute, value in (params.attributes.items() if params and params.attributes is mapping and params.attributes.items else params.attributes) %}{{attribute}}="{{value}}" {% endfor %}{% endif %}{% if params and params.id %} id="{{params.id}}"{% endif %}>
35
-
29
+ {% set panel %}
30
+ <div
31
+ {% if (params.variant == 'error' and params.title) or params.variant == 'success' %}
32
+ aria-labelledby="alert" role="alert" tabindex="-1" {% if not isDesignSystemExample %}autofocus="autofocus"{% endif %}
33
+ {% endif %}class="ons-panel{{ variantClass }}{{ iconClass }}{{ noTitleClass }}{{ spaciousClass }}{{ classes }}"
34
+ {% if params and params.attributes %}{% for attribute, value in (params.attributes.items() if params and params.attributes is mapping and params.attributes.items else params.attributes) %}{{ ' ' }}{{ attribute }}="{{ value }}"{% endfor %}{% endif %}{% if params and params.id %}id="{{ params.id }}"{% endif %}
35
+ >
36
36
  {% if params.variant == "warn" or params.variant == "warn-branded" %}
37
37
  <span class="ons-panel__icon" aria-hidden="true">!</span>
38
38
  <span class="ons-panel__assistive-text ons-u-vh">{{ params.assistiveTextPrefix | default("Warning: ") }}</span>
@@ -57,21 +57,28 @@
57
57
  {% set defaultTitleTag = "div" %}
58
58
  {% endif %}
59
59
  {% set titleTag = params.titleTag | default(defaultTitleTag) %}
60
+ {% set openingTag = "<" + titleTag %}
61
+ {% set closingTag = "</" + titleTag + ">" %}
60
62
  <div class="ons-panel__header">
61
- <{{ titleTag }} id="alert"{% if params.variant %} data-qa="{{ params.variant }}-header"{% endif %} class="ons-panel__title ons-u-fs-r--b">{{ params.title | safe }}</{{ titleTag }}>
63
+ {{ openingTag | safe }} id="alert"{% if params.variant %}data-qa="{{ params.variant }}-header"{% endif %}
64
+ class="ons-panel__title ons-u-fs-r--b">{{ params.title | safe }}{{ closingTag | safe }}
62
65
  </div>
63
66
  {% else %}
64
67
  {% if not params.variant or params.variant == "branded" or params.variant == "info" or params.variant == "bare" %}
65
- <span class="ons-panel__assistive-text ons-u-vh">{{ params.assistiveTextPrefix | default("Important information: ") }}</span>
66
- {% elif params.variant == 'error' or params.variant == 'success' %}
68
+ <span class="ons-panel__assistive-text ons-u-vh"
69
+ >{{ params.assistiveTextPrefix | default("Important information: ") }}</span
70
+ >
71
+ {% elif params.variant == 'error' or params.variant == 'success' %}
67
72
  {% set defaultText = "Completed" if params.variant == "success" else "Error" %}
68
- <span{% if params.variant == "success" %} id="alert"{% endif %} class="ons-panel__assistive-text ons-u-vh">{{ params.assistiveTextPrefix | default(defaultText ~ ": ") }}</span>
73
+ <span {% if params.variant == "success" %}id="alert"{% endif %}class="ons-panel__assistive-text ons-u-vh"
74
+ >{{ params.assistiveTextPrefix | default(defaultText ~ ": ") }}</span
75
+ >
69
76
  {% endif %}
70
77
  {% endif %}
71
78
 
72
79
  {% if params.iconType %}
73
80
  {% from "components/icon/_macro.njk" import onsIcon %}
74
- <span class= "ons-panel__icon ons-u-fs-{{ params.iconSize | default('r') }}">
81
+ <span class="ons-panel__icon ons-u-fs-{{ params.iconSize | default('r') }}">
75
82
  {{-
76
83
  onsIcon({
77
84
  "iconType": params.iconType,
@@ -81,14 +88,18 @@
81
88
  </span>
82
89
  {% endif %}
83
90
 
84
- <div class="ons-panel__body{% if params.iconSize %} ons-icon-margin--{{ params.iconSize }}{% endif %}">{{ (params.body if params else "") | safe }}
91
+ <div class="ons-panel__body{% if params.iconSize %}{{ ' ' }}ons-icon-margin--{{ params.iconSize }}{% endif %}">
92
+ {{ (params.body if params) | safe }}
85
93
  {{ caller() if caller }}
86
94
  </div>
87
95
  </div>
96
+ {% endset %}
88
97
 
89
- {% if params.variant == "warn-branded" or params.variant == "announcement" %}
90
- </div>
98
+ {% if params.variant == "warn-branded" or params.variant == "announcement" %}
99
+ <div class="{{ containerClass }}">
100
+ <div class="ons-container">{{ panel | safe }}</div>
91
101
  </div>
102
+ {% else %}
103
+ {{ panel | safe }}
92
104
  {% endif %}
93
-
94
105
  {% endmacro %}
@@ -1,8 +1,10 @@
1
1
  {% from "components/panel/_macro.njk" import onsPanel %}
2
2
 
3
- {% call onsPanel({
4
- "variant": 'bare',
5
- "iconType": 'lock'
6
- }) %}
3
+ {%
4
+ call onsPanel({
5
+ "variant": 'bare',
6
+ "iconType": 'lock'
7
+ })
8
+ %}
7
9
  Here is some text with an icon
8
10
  {% endcall %}
@@ -1,11 +1,14 @@
1
1
  ---
2
- "fullWidth": true
2
+ 'fullWidth': true
3
3
  ---
4
+
4
5
  {% from "components/panel/_macro.njk" import onsPanel %}
5
6
 
6
- {% call onsPanel({
7
- "variant": 'announcement'
8
- }) %}
7
+ {%
8
+ call onsPanel({
9
+ "variant": 'announcement'
10
+ })
11
+ %}
9
12
  <p class="ons-u-mb-no">National lockdown: stay at home</p>
10
13
 
11
14
  <div class="ons-u-fs-r">
@@ -1,10 +1,12 @@
1
1
  {% from "components/panel/_macro.njk" import onsPanel %}
2
2
  {% from "components/list/_macro.njk" import onsList %}
3
3
 
4
- {% call onsPanel({
5
- "title": 'There are 2 problems with your answer',
6
- "variant": 'error'
7
- }) %}
4
+ {%
5
+ call onsPanel({
6
+ "title": 'There are 2 problems with your answer',
7
+ "variant": 'error'
8
+ })
9
+ %}
8
10
  {{
9
11
  onsList({
10
12
  "element": 'ol',
@@ -1,7 +1,9 @@
1
1
  {% from "components/panel/_macro.njk" import onsPanel %}
2
2
 
3
- {% call onsPanel({
4
- "variant": 'warn'
5
- }) %}
3
+ {%
4
+ call onsPanel({
5
+ "variant": 'warn'
6
+ })
7
+ %}
6
8
  All of the information about this person will be deleted
7
9
  {% endcall %}
@@ -4,11 +4,13 @@
4
4
  {% from "components/checkboxes/_checkbox-macro.njk" import onsCheckbox %}
5
5
  {% from "components/input/_macro.njk" import onsInput %}
6
6
 
7
- {% call onsField({
8
- "id": params.fieldId,
9
- "classes": "ons-js-password" + (" " + params.fieldClasses if params.fieldClasses else ""),
10
- "error": params.error
11
- }) %}
7
+ {%
8
+ call onsField({
9
+ "id": params.fieldId,
10
+ "classes": "ons-js-password" + (" " + params.fieldClasses if params.fieldClasses else ""),
11
+ "error": params.error
12
+ })
13
+ %}
12
14
  {{
13
15
  onsLabel({
14
16
  "for": params.id,
@@ -3,9 +3,9 @@
3
3
  <div class="ons-container{{ ' ons-container--full-width' if params.fullWidth }}{{ ' ons-container--wide' if params.wide }}">
4
4
  <div class="ons-grid ons-grid--flex ons-grid--gutterless ons-grid--vertical-top ons-grid--no-wrap">
5
5
  {% if not params.hideBadge %}
6
- <div class="ons-grid__col ons-col-auto ons-u-flex-no-grow ons-u-flex-no-shrink">
7
- <strong class="ons-phase-banner__badge">{{ params.badge | default("Beta") }}</strong>
8
- </div>
6
+ <div class="ons-grid__col ons-col-auto ons-u-flex-no-grow ons-u-flex-no-shrink">
7
+ <strong class="ons-phase-banner__badge">{{ params.badge | default("Beta") }}</strong>
8
+ </div>
9
9
  {% endif %}
10
10
  <div class="ons-grid__col ons-col-auto ons-u-flex-shrink">
11
11
  <p class="ons-phase-banner__desc ons-u-fs-s ons-u-mb-no">{{ params.html | safe }}</p>
@@ -1,6 +1,7 @@
1
1
  ---
2
- "fullWidth": true
2
+ 'fullWidth': true
3
3
  ---
4
+
4
5
  {% from "components/phase-banner/_macro.njk" import onsPhaseBanner %}
5
6
  {% from "components/external-link/_macro.njk" import onsExternalLink %}
6
7