@ons/design-system 62.2.4 → 64.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 (104) hide show
  1. package/components/access-code/example-access-code-error.njk +1 -1
  2. package/components/accordion/_macro.njk +1 -1
  3. package/components/breadcrumbs/_macro.njk +2 -2
  4. package/components/breadcrumbs/_macro.spec.js +1 -1
  5. package/components/button/_macro.njk +1 -1
  6. package/components/button/_macro.spec.js +6 -6
  7. package/components/card/_macro.njk +1 -1
  8. package/components/card/_macro.spec.js +1 -1
  9. package/components/char-check-limit/_macro.njk +1 -1
  10. package/components/char-check-limit/_macro.spec.js +1 -1
  11. package/components/char-check-limit/character-check.spec.js +16 -16
  12. package/components/checkboxes/_macro.njk +3 -1
  13. package/components/checkboxes/example-checkboxes-with-descriptions.njk +1 -0
  14. package/components/collapsible/_macro.spec.js +1 -1
  15. package/components/content-pagination/_macro.njk +2 -2
  16. package/components/content-pagination/_macro.spec.js +2 -2
  17. package/components/cookies-banner/_macro.njk +2 -2
  18. package/components/cookies-banner/_macro.spec.js +2 -2
  19. package/components/details/_macro.njk +1 -1
  20. package/components/details/_macro.spec.js +1 -1
  21. package/components/document-list/_macro.njk +1 -1
  22. package/components/footer/_macro.njk +2 -2
  23. package/components/footer/_macro.spec.js +7 -7
  24. package/components/header/_macro.njk +3 -3
  25. package/components/header/_macro.spec.js +5 -6
  26. package/components/{icons → icon}/_macro.spec.js +7 -7
  27. package/components/{images → image}/_macro.spec.js +13 -13
  28. package/components/{images/example-images-for-regular-screens.njk → image/example-image-for-regular-screens.njk} +1 -1
  29. package/components/{images/example-images-for-retina-screens.njk → image/example-image-for-retina-screens.njk} +1 -1
  30. package/components/input/_input.scss +6 -0
  31. package/components/input/_macro.njk +20 -13
  32. package/components/input/_macro.spec.js +2 -22
  33. package/components/{search/example-search-with-character-check.njk → input/example-input-search-with-character-check.njk} +1 -2
  34. package/components/{search/example-search-with-placeholder.njk → input/example-input-search-with-placeholder.njk} +1 -2
  35. package/components/{search/example-search.njk → input/example-input-search.njk} +1 -2
  36. package/components/{lists → list}/_macro.njk +3 -3
  37. package/components/{lists → list}/_macro.spec.js +42 -42
  38. package/components/message/_macro.njk +2 -2
  39. package/components/message/_macro.spec.js +0 -1
  40. package/components/metadata/_macro.njk +1 -1
  41. package/components/mutually-exclusive/mutually-exclusive.textarea.spec.js +1 -1
  42. package/components/navigation/_macro.njk +3 -3
  43. package/components/pagination/_macro.njk +65 -69
  44. package/components/pagination/_macro.spec.js +18 -16
  45. package/components/pagination/example-pagination-first.njk +5 -5
  46. package/components/pagination/example-pagination-last.njk +5 -5
  47. package/components/pagination/example-pagination-with-no-range-indicator.njk +11 -11
  48. package/components/pagination/example-pagination.njk +2 -2
  49. package/components/panel/_macro.njk +2 -2
  50. package/components/panel/_macro.spec.js +2 -2
  51. package/components/panel/example-panel-with-error-summary.njk +1 -1
  52. package/components/phase-banner/_phase-banner.scss +2 -1
  53. package/components/question/_macro.njk +1 -1
  54. package/components/question/_macro.spec.js +1 -1
  55. package/components/quote/_macro.njk +1 -1
  56. package/components/quote/_macro.spec.js +1 -1
  57. package/components/related-content/_macro.njk +1 -1
  58. package/components/related-content/_macro.spec.js +1 -1
  59. package/components/related-content/example-related-content-general.njk +1 -1
  60. package/components/relationships/example-relationships-error.njk +1 -1
  61. package/components/section-navigation/_macro.njk +2 -2
  62. package/components/select/_macro.njk +1 -2
  63. package/components/share-page/_macro.njk +1 -1
  64. package/components/share-page/_macro.spec.js +5 -5
  65. package/components/summary/_macro.njk +5 -6
  66. package/components/summary/_macro.spec.js +8 -23
  67. package/components/summary/example-summary-grouped-total.njk +0 -2
  68. package/components/summary/example-summary-grouped-with-errors.njk +0 -4
  69. package/components/summary/example-summary-grouped.njk +0 -19
  70. package/components/summary/example-summary-household.njk +0 -5
  71. package/components/summary/example-summary-hub.njk +0 -8
  72. package/components/summary/example-summary-multiple.njk +0 -4
  73. package/components/summary/example-summary.njk +0 -4
  74. package/components/table/_macro.njk +4 -4
  75. package/components/table/_macro.spec.js +17 -1
  76. package/components/table/example-table-basic.njk +1 -2
  77. package/components/table/example-table-numeric.njk +6 -3
  78. package/components/table-of-contents/_macro.njk +1 -1
  79. package/components/table-of-contents/_macro.spec.js +2 -2
  80. package/components/tabs/_macro.njk +6 -5
  81. package/components/tabs/_macro.spec.js +25 -2
  82. package/components/tabs/_tabs.scss +11 -15
  83. package/components/tabs/example-tabs.njk +6 -6
  84. package/components/tabs/tabs.js +24 -8
  85. package/components/tabs/tabs.spec.js +40 -2
  86. package/components/textarea/_macro.njk +2 -2
  87. package/components/textarea/_macro.spec.js +2 -2
  88. package/components/textarea/textarea.spec.js +6 -10
  89. package/components/timeline/_macro.njk +1 -1
  90. package/components/timeline/_macro.spec.js +1 -1
  91. package/css/main.css +3 -3
  92. package/css/print.css +1 -1
  93. package/package.json +1 -1
  94. package/scripts/main.es5.js +1 -1
  95. package/scripts/main.js +1 -1
  96. package/scss/main.scss +3 -4
  97. package/components/search/_macro.njk +0 -30
  98. package/components/search/_macro.spec.js +0 -69
  99. package/components/search/_search.scss +0 -9
  100. /package/components/{icons/_icons.scss → icon/_icon.scss} +0 -0
  101. /package/components/{icons → icon}/_macro.njk +0 -0
  102. /package/components/{images/_images.scss → image/_image.scss} +0 -0
  103. /package/components/{images → image}/_macro.njk +0 -0
  104. /package/components/{lists → list}/_list.scss +0 -0
@@ -18,7 +18,6 @@ const EXAMPLE_MESSAGE = {
18
18
  unreadLink: 'https://example.com/message/1',
19
19
  unreadLinkText: 'Unread message',
20
20
  id: 'message1',
21
- name: 'example-message-1',
22
21
  fromId: 'from1',
23
22
  sentId: 'sent1',
24
23
  unreadLinkId: 'unreadLink1',
@@ -1,6 +1,6 @@
1
1
  {% macro onsMetadata(params) %}
2
2
  <dl class="ons-metadata ons-metadata__list ons-grid ons-grid--gutterless ons-u-cf{{ (' ' + params.classes) if params.classes }}"{% if params.id %} id="{{ params.id }}" {% endif %}{% if params.metadataLabel %} title="{{ params.metadataLabel }}" aria-label="{{ params.metadataLabel }}"{% endif %}>
3
- {% for item in (params.itemsList if params.itemsList is iterable else params.itemsList.items()) %}
3
+ {% for item in params.itemsList %}
4
4
  {% if item.term | length %}
5
5
  <dt class="ons-metadata__term ons-grid__col ons-col-{{ params.termCol }}@m">{{ item.term }}</dt>
6
6
  {% endif %}
@@ -63,7 +63,7 @@ describe('script: mutually-exclusive', () => {
63
63
  });
64
64
 
65
65
  it('then the characters remaining readout should be reset', async () => {
66
- const limitText = await page.$eval('#feedback-lim-remaining', node => node.textContent);
66
+ const limitText = await page.$eval('#feedback-lim', node => node.textContent);
67
67
  expect(limitText).toBe('You have 200 characters remaining');
68
68
  });
69
69
 
@@ -40,7 +40,7 @@
40
40
  {% endif %}
41
41
  <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">
42
42
  <ul class="ons-navigation__list">
43
- {% for item in (params.navigation.itemsList if params.navigation.itemsList is iterable else params.navigation.itemsList.items()) %}
43
+ {% for item in params.navigation.itemsList %}
44
44
  <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) }}">
45
45
  <a class="ons-navigation__link" href="{{ item.url }}" {% if item.id %}id="{{ item.id }}" {% endif %}{% if item.ariaLabel %}aria-label="{{ item.ariaLabel }}" {% endif %}>{{ item.title }}</a>
46
46
  </li>
@@ -53,7 +53,7 @@
53
53
  <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">
54
54
  <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 }}">
55
55
  <ul class="ons-navigation__list ons-navigation__list">
56
- {% for item in (params.navigation.subNavigation.itemsList if params.navigation.subNavigation.itemsList is iterable else params.navigation.subNavigation.itemsList.items()) %}
56
+ {% for item in params.navigation.subNavigation.itemsList %}
57
57
  <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) }}">
58
58
  <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 %}>{{ item.title }}</a>
59
59
  </li>
@@ -79,7 +79,7 @@
79
79
  <li class="ons-navigation__item">
80
80
  <a class="ons-navigation__link" href="{{ params.navigation.subNavigation.overviewURL }}">{{ params.navigation.subNavigation.overviewText | default('Overview') }}</a>
81
81
  </li>
82
- {% for item in (params.navigation.subNavigation.itemsList if params.navigation.subNavigation.itemsList is iterable else params.navigation.subNavigation.itemsList.items()) %}
82
+ {% for item in params.navigation.subNavigation.itemsList %}
83
83
  <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) }}">
84
84
  <a class="ons-navigation__link" href="{{ item.url }}" {% if item.ariaLabel %}aria-label="{{ item.ariaLabel }}" {% endif %} {% if item.id %}id="{{ item.id }}--mobile" {% endif %}>{{ item.title }}</a>
85
85
  {% if item.sections %}
@@ -1,72 +1,68 @@
1
1
  {% macro onsPagination(params) %}
2
- {% set currentPageIndex = "" %}
3
- {% for page in params.pages %}
4
- {% if page.current %}
5
- {% set currentPageIndex = loop.index %}
6
- {% endif %}
7
- {% endfor %}
2
+ {% set currentPageIndex = params.currentPageNumber|int %}
3
+ {% set totalPages = params.pages | length|int %}
4
+ {% set position = "Page " ~ currentPageIndex ~ " of " ~ totalPages %}
5
+ {% set lastPage = params.pages | last %}
6
+ {% set firstPage = params.pages | first %}
7
+ {% set prevPageIndex = currentPageIndex - 1 %}
8
+ {% set nextPageIndex = currentPageIndex + 1 %}
8
9
 
9
- {% set totalPages = params.pages | length %}
10
- {% set position = "Page " + currentPageIndex + " of " + totalPages %}
11
- {% set lastPage = params.pages | last %}
12
- {% set firstPage = params.pages | first %}
13
-
14
- <nav class="ons-pagination {{ params.classes }}{% if params.hideRangeIndicator %} ons-pagination--no-indicator{% endif %}" aria-label="Pagination ({{ position }})">
15
- <div class="ons-pagination__position">{{ position }}</div>
16
- <ul class="ons-pagination__items">
17
- {% if currentPageIndex != 1 %}
18
- {% set prevPageIndex = currentPageIndex - 2 %}
19
- <li class="ons-pagination__item ons-pagination__item--previous">
20
- <a href="{{ params.pages[prevPageIndex].url }}" class="ons-pagination__link" rel="prev" aria-label="Go to the previous page (Page {{ currentPageIndex - 1 }})">{{ params.previous }}</a>
21
- </li>
22
- {% endif %}
23
- {% if currentPageIndex > 2 %}
24
- <li class="ons-pagination__item{% if firstPage.current == true %} ons-pagination__item--current{% endif %}">
25
- <a href="{{ firstPage.url }}" class="ons-pagination__link" aria-label="Go to the first page (Page 1)">1</a>
26
- </li>
27
- {% endif %}
28
- {% if currentPageIndex > 4 %}
29
- <li class="ons-pagination__item ons-pagination__item--gap">&hellip;</li>
30
- {% endif %}
31
- {% for page in params.pages %}
32
- {% set showPage = false %}
33
- {# Show the current, next and previous page
34
- Show page 2 if the current page index is within the first 4 pages
35
- Show the penultimate page if the current page index is within the last 4 pages #}
36
- {% 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)) %}
37
- {% set showPage = true %}
38
- {% endif %}
39
- {% if showPage == true %}
40
- <li class="ons-pagination__item{% if page.current == true %} ons-pagination__item--current{% endif %}">
41
- <a href="{{ page.url }}" class="ons-pagination__link"
42
- {%- if page.current -%}
43
- aria-current="true" aria-label="Current page ({{ position }})"
44
- {%- else -%}
45
- aria-label="Go to page {{ loop.index }}"
46
- {%- endif -%}
47
- {%- if loop.index == currentPageIndex - 1 -%}
48
- rel="prev"
49
- {%- endif -%}
50
- {%- if loop.index == currentPageIndex + 1 -%}
51
- rel="next"
52
- {%- endif -%}
53
- >{{ loop.index }}</a>
54
- </li>
55
- {% endif %}
56
- {% endfor %}
57
- {% if currentPageIndex < totalPages - 3 %}
58
- <li class="ons-pagination__item ons-pagination__item--gap">&hellip;</li>
59
- {% endif %}
60
- {% if currentPageIndex < totalPages - 1 %}
61
- <li class="ons-pagination__item{% if lastPage.current == true %} ons-pagination__item--current{% endif %}">
62
- <a href="{{ lastPage.url }}" class="ons-pagination__link" aria-label="Go to the last page (Page {{ totalPages }})">{{ totalPages }}</a>
63
- </li>
64
- {% endif %}
65
- {% if totalPages > 1 and totalPages != currentPageIndex %}
66
- <li class="ons-pagination__item ons-pagination__item--next">
67
- <a href="{{ params.pages[currentPageIndex].url }}" class="ons-pagination__link" rel="next" aria-label="Go to the next page (Page {{ currentPageIndex + 1 }})">{{ params.next }}</a>
68
- </li>
69
- {% endif %}
70
- </ul>
71
- </nav>
10
+ <nav class="ons-pagination {{ params.classes }}{% if params.hideRangeIndicator %} ons-pagination--no-indicator{% endif %}" aria-label="Pagination ({{ position }})">
11
+ <div class="ons-pagination__position">{{ position }}</div>
12
+ <ul class="ons-pagination__items">
13
+ {% if currentPageIndex != 1 %}
14
+ {% set prevPageIndex = currentPageIndex - 2 %}
15
+ <li class="ons-pagination__item ons-pagination__item--previous">
16
+ <a href="{{ params.pages[prevPageIndex].url }}" class="ons-pagination__link" rel="prev" aria-label="Go to the previous page (Page {{ currentPageIndex - 1 }})">{{ params.previous }}</a>
17
+ </li>
18
+ {% endif %}
19
+ {% if currentPageIndex > 2 %}
20
+ <li class="ons-pagination__item{% if (currentPageIndex == 1) %} ons-pagination__item--current{% endif %}">
21
+ <a href="{{ firstPage.url }}" class="ons-pagination__link" aria-label="Go to the first page (Page 1)">1</a>
22
+ </li>
23
+ {% endif %}
24
+ {% if currentPageIndex > 4 %}
25
+ <li class="ons-pagination__item ons-pagination__item--gap">&hellip;</li>
26
+ {% endif %}
27
+ {% for page in params.pages %}
28
+ {% set showPage = false %}
29
+ {# Show the current, next and previous page
30
+ Show page 2 if the current page index is within the first 4 pages
31
+ Show the penultimate page if the current page index is within the last 4 pages #}
32
+ {% 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)) %}
33
+ {% set showPage = true %}
34
+ {% endif %}
35
+ {% if showPage == true %}
36
+ <li class="ons-pagination__item{% if loop.index == currentPageIndex %} ons-pagination__item--current{% endif %}">
37
+ <a href="{{ page.url }}" class="ons-pagination__link"
38
+ {%- if loop.index == currentPageIndex -%}
39
+ aria-current="true" aria-label="Current page ({{ position }})"
40
+ {%- else -%}
41
+ aria-label="Go to page {{ loop.index }}"
42
+ {%- endif -%}
43
+ {%- if loop.index == currentPageIndex - 1 -%}
44
+ rel="prev"
45
+ {%- endif -%}
46
+ {%- if loop.index == currentPageIndex + 1 -%}
47
+ rel="next"
48
+ {%- endif -%}
49
+ >{{ loop.index }}</a>
50
+ </li>
51
+ {% endif %}
52
+ {% endfor %}
53
+ {% if currentPageIndex < totalPages - 3 %}
54
+ <li class="ons-pagination__item ons-pagination__item--gap">&hellip;</li>
55
+ {% endif %}
56
+ {% if currentPageIndex < totalPages - 1 %}
57
+ <li class="ons-pagination__item{% if currentPageIndex == totalPages %} ons-pagination__item--current{% endif %}">
58
+ <a href="{{ lastPage.url }}" class="ons-pagination__link" aria-label="Go to the last page (Page {{ totalPages }})">{{ totalPages }}</a>
59
+ </li>
60
+ {% endif %}
61
+ {% if totalPages > 1 and totalPages != currentPageIndex %}
62
+ <li class="ons-pagination__item ons-pagination__item--next">
63
+ <a href="{{ params.pages[currentPageIndex].url }}" class="ons-pagination__link" rel="next" aria-label="Go to the next page (Page {{ currentPageIndex + 1 }})">{{ params.next }}</a>
64
+ </li>
65
+ {% endif %}
66
+ </ul>
67
+ </nav>
72
68
  {% endmacro %}
@@ -12,7 +12,8 @@ const PAGINATION_PREV_NEXT_LABELS = {
12
12
 
13
13
  const EXAMPLE_PAGINATION_MINIMAL = {
14
14
  ...PAGINATION_PREV_NEXT_LABELS,
15
- pages: [{ url: '/page/1', current: true }],
15
+ currentPageNumber: 1,
16
+ pages: [{ url: '/page/1' }],
16
17
  };
17
18
 
18
19
  describe('macro: pagination', () => {
@@ -54,7 +55,8 @@ describe('macro: pagination', () => {
54
55
  const $ = cheerio.load(
55
56
  renderComponent('pagination', {
56
57
  ...PAGINATION_PREV_NEXT_LABELS,
57
- pages: [{ url: '/page/1', current: true }],
58
+ currentPageNumber: 1,
59
+ pages: [{ url: '/page/1' }],
58
60
  }),
59
61
  );
60
62
 
@@ -85,7 +87,8 @@ describe('macro: pagination', () => {
85
87
  const $ = cheerio.load(
86
88
  renderComponent('pagination', {
87
89
  ...PAGINATION_PREV_NEXT_LABELS,
88
- pages: [{ url: '/page/1', current: true }, { url: '/page/2' }],
90
+ currentPageNumber: 1,
91
+ pages: [{ url: '/page/1' }, { url: '/page/2' }],
89
92
  }),
90
93
  );
91
94
 
@@ -118,7 +121,8 @@ describe('macro: pagination', () => {
118
121
  const $ = cheerio.load(
119
122
  renderComponent('pagination', {
120
123
  ...PAGINATION_PREV_NEXT_LABELS,
121
- pages: [{ url: '/page/1' }, { url: '/page/2', current: true }],
124
+ currentPageNumber: 2,
125
+ pages: [{ url: '/page/1' }, { url: '/page/2' }],
122
126
  }),
123
127
  );
124
128
 
@@ -151,7 +155,8 @@ describe('macro: pagination', () => {
151
155
  const $ = cheerio.load(
152
156
  renderComponent('pagination', {
153
157
  ...PAGINATION_PREV_NEXT_LABELS,
154
- pages: [{ url: '/page/1' }, { url: '/page/2', current: true }, { url: '/page/3' }],
158
+ currentPageNumber: 2,
159
+ pages: [{ url: '/page/1' }, { url: '/page/2' }, { url: '/page/3' }],
155
160
  }),
156
161
  );
157
162
 
@@ -186,7 +191,8 @@ describe('macro: pagination', () => {
186
191
  const $ = cheerio.load(
187
192
  renderComponent('pagination', {
188
193
  ...PAGINATION_PREV_NEXT_LABELS,
189
- pages: [{ url: '/page/1' }, { url: '/page/2', current: true }, { url: '/page/3' }, { url: '/page/4' }, { url: '/page/5' }],
194
+ currentPageNumber: 2,
195
+ pages: [{ url: '/page/1' }, { url: '/page/2' }, { url: '/page/3' }, { url: '/page/4' }, { url: '/page/5' }],
190
196
  }),
191
197
  );
192
198
 
@@ -223,14 +229,8 @@ describe('macro: pagination', () => {
223
229
  const $ = cheerio.load(
224
230
  renderComponent('pagination', {
225
231
  ...PAGINATION_PREV_NEXT_LABELS,
226
- pages: [
227
- { url: '/page/1' },
228
- { url: '/page/2', current: true },
229
- { url: '/page/3' },
230
- { url: '/page/4' },
231
- { url: '/page/5' },
232
- { url: '/page/6' },
233
- ],
232
+ currentPageNumber: 2,
233
+ pages: [{ url: '/page/1' }, { url: '/page/2' }, { url: '/page/3' }, { url: '/page/4' }, { url: '/page/5' }, { url: '/page/6' }],
234
234
  }),
235
235
  );
236
236
 
@@ -267,12 +267,13 @@ describe('macro: pagination', () => {
267
267
  const $ = cheerio.load(
268
268
  renderComponent('pagination', {
269
269
  ...PAGINATION_PREV_NEXT_LABELS,
270
+ currentPageNumber: 5,
270
271
  pages: [
271
272
  { url: '/page/1' },
272
273
  { url: '/page/2' },
273
274
  { url: '/page/3' },
274
275
  { url: '/page/4' },
275
- { url: '/page/5', current: true },
276
+ { url: '/page/5' },
276
277
  { url: '/page/6' },
277
278
  { url: '/page/7' },
278
279
  { url: '/page/8' },
@@ -318,6 +319,7 @@ describe('macro: pagination', () => {
318
319
  const $ = cheerio.load(
319
320
  renderComponent('pagination', {
320
321
  ...PAGINATION_PREV_NEXT_LABELS,
322
+ currentPageNumber: 10,
321
323
  pages: [
322
324
  { url: '/page/1' },
323
325
  { url: '/page/2' },
@@ -328,7 +330,7 @@ describe('macro: pagination', () => {
328
330
  { url: '/page/7' },
329
331
  { url: '/page/8' },
330
332
  { url: '/page/9' },
331
- { url: '/page/10', current: true },
333
+ { url: '/page/10' },
332
334
  { url: '/page/11' },
333
335
  ],
334
336
  }),
@@ -5,19 +5,19 @@
5
5
  "previous": "Previous",
6
6
  "next": "Next",
7
7
  "hideRangeIndicator": true,
8
+ "currentPageNumber": 1,
8
9
  "pages": [
9
10
  {
10
- "url": "#page1",
11
- "current": true
11
+ "url": "#0"
12
12
  },
13
13
  {
14
- "url": "#page2"
14
+ "url": "#0"
15
15
  },
16
16
  {
17
- "url": "#page3"
17
+ "url": "#0"
18
18
  },
19
19
  {
20
- "url": "#page4"
20
+ "url": "#0"
21
21
  }
22
22
  ]
23
23
  })
@@ -5,19 +5,19 @@
5
5
  "previous": "Previous",
6
6
  "next": "Next",
7
7
  "hideRangeIndicator": true,
8
+ "currentPageNumber": 4,
8
9
  "pages": [
9
10
  {
10
- "url": "#page1"
11
+ "url": "#0"
11
12
  },
12
13
  {
13
- "url": "#page2"
14
+ "url": "#0"
14
15
  },
15
16
  {
16
- "url": "#page3"
17
+ "url": "#0"
17
18
  },
18
19
  {
19
- "url": "#page4",
20
- "current": true
20
+ "url": "#0"
21
21
  }
22
22
  ]
23
23
  })
@@ -5,37 +5,37 @@
5
5
  "previous": "Previous",
6
6
  "next": "Next",
7
7
  "hideRangeIndicator": true,
8
+ "currentPageNumber": 5,
8
9
  "pages": [
9
10
  {
10
- "url": "#page1"
11
+ "url": "#0"
11
12
  },
12
13
  {
13
- "url": "#page2"
14
+ "url": "#0"
14
15
  },
15
16
  {
16
- "url": "#page3"
17
+ "url": "#0"
17
18
  },
18
19
  {
19
- "url": "#page4"
20
+ "url": "#0"
20
21
  },
21
22
  {
22
- "url": "#page5",
23
- "current": true
23
+ "url": "#0"
24
24
  },
25
25
  {
26
- "url": "#page6"
26
+ "url": "#0"
27
27
  },
28
28
  {
29
- "url": "#page7"
29
+ "url": "#0"
30
30
  },
31
31
  {
32
- "url": "#page8"
32
+ "url": "#0"
33
33
  },
34
34
  {
35
- "url": "#page9"
35
+ "url": "#0"
36
36
  },
37
37
  {
38
- "url": "#page10"
38
+ "url": "#0"
39
39
  }
40
40
  ]
41
41
  })
@@ -4,6 +4,7 @@
4
4
  onsPagination({
5
5
  "previous": "Previous",
6
6
  "next": "Next",
7
+ "currentPageNumber": 5,
7
8
  "pages": [
8
9
  {
9
10
  "url": "#0"
@@ -18,8 +19,7 @@
18
19
  "url": "#0"
19
20
  },
20
21
  {
21
- "url": "#0",
22
- "current": true
22
+ "url": "#0"
23
23
  },
24
24
  {
25
25
  "url": "#0"
@@ -39,7 +39,7 @@
39
39
  {% endif %}
40
40
 
41
41
  {% if params.type == "announcement" %}
42
- {% from "components/icons/_macro.njk" import onsIcon %}
42
+ {% from "components/icon/_macro.njk" import onsIcon %}
43
43
  <span class="ons-panel__icon" aria-hidden="true">
44
44
  {{
45
45
  onsIcon({
@@ -70,7 +70,7 @@
70
70
  {% endif %}
71
71
 
72
72
  {% if params.iconType %}
73
- {% from "components/icons/_macro.njk" import onsIcon %}
73
+ {% from "components/icon/_macro.njk" import onsIcon %}
74
74
  <span class= "ons-panel__icon ons-u-fs-{{ params.iconSize | default('r') }}">
75
75
  {{
76
76
  onsIcon({
@@ -313,7 +313,7 @@ describe('macro: panel', () => {
313
313
 
314
314
  it('has `arrow-forward` icon', () => {
315
315
  const faker = templateFaker();
316
- const iconsSpy = faker.spy('icons');
316
+ const iconsSpy = faker.spy('icon');
317
317
 
318
318
  faker.renderComponent('panel', {
319
319
  ...EXAMPLE_PANEL_BASIC,
@@ -385,7 +385,7 @@ describe('macro: panel', () => {
385
385
 
386
386
  it('has a custom icon `iconType`', () => {
387
387
  const faker = templateFaker();
388
- const iconsSpy = faker.spy('icons');
388
+ const iconsSpy = faker.spy('icon');
389
389
 
390
390
  faker.renderComponent('panel', {
391
391
  ...EXAMPLE_PANEL_BASIC,
@@ -1,5 +1,5 @@
1
1
  {% from "components/panel/_macro.njk" import onsPanel %}
2
- {% from "components/lists/_macro.njk" import onsList %}
2
+ {% from "components/list/_macro.njk" import onsList %}
3
3
 
4
4
  {% call onsPanel({
5
5
  "title": 'There are 2 problems with your answer',
@@ -1,5 +1,6 @@
1
1
  .ons-phase-banner {
2
- background: var(--ons-color-grey-5);
2
+ background: var(--ons-color-white);
3
+ border-bottom: 1px solid var(--ons-color-borders);
3
4
  padding: 0.5rem 0;
4
5
 
5
6
  &__badge {
@@ -52,7 +52,7 @@
52
52
  {% if item.listLeadingLine %}
53
53
  <p class="ons-question-guidance__list-leading-line">{{ item.listLeadingLine }}</p>
54
54
  {% endif %}
55
- {% from "components/lists/_macro.njk" import onsList %}
55
+ {% from "components/list/_macro.njk" import onsList %}
56
56
  {{
57
57
  onsList({
58
58
  "itemsList": item.itemsList
@@ -239,7 +239,7 @@ describe('macro: question', () => {
239
239
 
240
240
  it('outputs the expected list', () => {
241
241
  const faker = templateFaker();
242
- const listSpy = faker.spy('lists');
242
+ const listSpy = faker.spy('list');
243
243
 
244
244
  faker.renderComponent('question', EXAMPLE_QUESTION_GUIDANCE);
245
245
 
@@ -1,6 +1,6 @@
1
1
  {% macro onsQuote(params) %}
2
2
  <blockquote class="ons-quote">
3
- {% from "components/icons/_macro.njk" import onsIcon %}
3
+ {% from "components/icon/_macro.njk" import onsIcon %}
4
4
  {{
5
5
  onsIcon({
6
6
  "iconType": 'quote'
@@ -70,7 +70,7 @@ describe('macro: quote', () => {
70
70
 
71
71
  it('has `quote` icon', () => {
72
72
  const faker = templateFaker();
73
- const iconsSpy = faker.spy('icons');
73
+ const iconsSpy = faker.spy('icon');
74
74
 
75
75
  faker.renderComponent('quote', {
76
76
  text: 'Example quote text.',
@@ -15,7 +15,7 @@
15
15
  }
16
16
  ) %}
17
17
  <nav class="ons-related-content__navigation" aria-labelledby="{{ row.id }}">
18
- {% from "components/lists/_macro.njk" import onsList %}
18
+ {% from "components/list/_macro.njk" import onsList %}
19
19
  {{
20
20
  onsList({
21
21
  "variants": 'bare',
@@ -111,7 +111,7 @@ describe('macro: related-content', () => {
111
111
 
112
112
  it('renders the expected list items using the list macro', () => {
113
113
  const faker = templateFaker();
114
- const listsSpy = faker.spy('lists');
114
+ const listsSpy = faker.spy('list');
115
115
 
116
116
  faker.renderComponent('related-content', EXAMPLE_RELATED_CONTENT_LINKS);
117
117
 
@@ -1,6 +1,6 @@
1
1
  {% from "components/related-content/_macro.njk" import onsRelatedContent %}
2
2
  {% from "components/related-content/_section-macro.njk" import onsRelatedContentSection %}
3
- {% from "components/lists/_macro.njk" import onsList %}
3
+ {% from "components/list/_macro.njk" import onsList %}
4
4
 
5
5
  {% call onsRelatedContent({
6
6
  "ariaLabel": 'Related content'
@@ -6,7 +6,7 @@ layout: ~
6
6
  {% from "components/question/_macro.njk" import onsQuestion %}
7
7
  {% from "components/relationships/_macro.njk" import onsRelationships %}
8
8
  {% from "components/panel/_macro.njk" import onsPanel %}
9
- {% from "components/lists/_macro.njk" import onsList %}
9
+ {% from "components/list/_macro.njk" import onsList %}
10
10
 
11
11
  {% set pageConfig = {
12
12
  "header": {
@@ -6,7 +6,7 @@
6
6
  {% if section.title %}
7
7
  <h3 class="ons-u-fs-r--b ons-u-mb-s">{{ section.title }}</h3>{% endif %}
8
8
  <ul class="ons-section-nav__list">
9
- {% for item in (section.itemsList if section.itemsList is iterable else section.itemsList.items()) %}
9
+ {% for item in section.itemsList %}
10
10
  {% if (params.currentPath and item.url == params.currentPath) or (params.tabQuery and params.tabQuery == item.title|lower) %}
11
11
  {% set isCurrent = true %}
12
12
  {% else %}
@@ -33,7 +33,7 @@
33
33
  <h3 class="ons-u-fs-r--b ons-u-mb-s">{{ params.title }}</h3>
34
34
  {% endif %}
35
35
  <ul class="ons-section-nav__list">
36
- {% for item in (params.itemsList if params.itemsList is iterable else params.itemsList.items()) %}
36
+ {% for item in params.itemsList %}
37
37
  {% if (params.currentPath and item.url == params.currentPath) or (params.tabQuery and params.tabQuery == item.title|lower) %}
38
38
  {% set isCurrent = true %}
39
39
  {% else %}
@@ -22,7 +22,6 @@
22
22
  id="{{ params.id }}"
23
23
  name="{{ params.name }}"
24
24
  class="ons-input ons-input--select{% if params.classes %} {{ params.classes }}{% endif %}{% if params.error %} ons-input--error{% endif %}"
25
- {% if params.value %}value="{{ params.value}}" {% endif %}
26
25
  {% if params.attributes %}{% for attribute, value in (params.attributes.items() if params.attributes is mapping and params.attributes.items else params.attributes) %}{{ attribute }}{% if value %}="{{ value }}"{% endif %} {% endfor %}{% endif %}
27
26
  >
28
27
  {% for option in params.options %}
@@ -30,7 +29,7 @@
30
29
  {% if option.id %}id="{{ option.id }}" {% endif %}
31
30
  {% if option.selected %}selected {% endif %}
32
31
  {% if option.disabled %}disabled {% endif %}
33
- {% if params.attributes %}{% for attribute, value in option.attributes %}{{ attribute }}="{{ value }}"{% endfor %}{% endif %}
32
+ {% if option.attributes %}{% for attribute, value in option.attributes %}{{ attribute }}="{{ value }}"{% endfor %}{% endif %}
34
33
  >
35
34
  {{- option.text -}}
36
35
  </option>
@@ -1,5 +1,5 @@
1
1
  {% macro onsSharePage(params) %}
2
- {% from "components/lists/_macro.njk" import onsList %}
2
+ {% from "components/list/_macro.njk" import onsList %}
3
3
 
4
4
  {% if params.title %}
5
5
  {% set titleTag = params.titleTag | default("h2") %}