@ons/design-system 55.1.0 → 55.2.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 (70) hide show
  1. package/components/access-code/_macro.njk +3 -3
  2. package/components/accordion/_macro.njk +1 -1
  3. package/components/address-input/_macro.njk +7 -7
  4. package/components/address-output/_macro.njk +7 -7
  5. package/components/autosuggest/_macro.njk +19 -19
  6. package/components/breadcrumbs/_macro.njk +3 -3
  7. package/components/button/_button.scss +1 -1
  8. package/components/button/_macro.njk +24 -24
  9. package/components/call-to-action/_macro.njk +1 -1
  10. package/components/card/_macro.njk +10 -10
  11. package/components/checkboxes/_checkbox-macro.njk +9 -9
  12. package/components/checkboxes/_macro.njk +10 -10
  13. package/components/checkboxes/checkbox-with-fieldset.js +6 -5
  14. package/components/checkboxes/checkboxes.dom.js +6 -9
  15. package/components/code-highlight/_macro.njk +1 -1
  16. package/components/collapsible/_macro.njk +7 -7
  17. package/components/date-input/_macro.njk +5 -5
  18. package/components/document-list/_macro.njk +29 -29
  19. package/components/duration/_macro.njk +9 -9
  20. package/components/duration/_macro.spec.js +0 -3
  21. package/components/error/_macro.njk +1 -1
  22. package/components/external-link/_macro.njk +1 -1
  23. package/components/feedback/_macro.njk +2 -2
  24. package/components/field/_macro.njk +5 -5
  25. package/components/fieldset/_macro.njk +8 -8
  26. package/components/footer/_macro.njk +17 -17
  27. package/components/header/_macro.njk +33 -33
  28. package/components/hero/_macro.njk +15 -15
  29. package/components/icons/_macro.njk +2 -2
  30. package/components/images/_macro.njk +3 -3
  31. package/components/input/_input-type.scss +4 -0
  32. package/components/input/_macro.njk +40 -34
  33. package/components/input/_macro.spec.js +64 -59
  34. package/components/label/_macro.njk +1 -1
  35. package/components/language-selector/_macro.njk +1 -1
  36. package/components/lists/_macro.njk +22 -22
  37. package/components/message/_macro.njk +6 -6
  38. package/components/message-list/_macro.njk +1 -1
  39. package/components/metadata/_macro.njk +2 -2
  40. package/components/modal/_macro.njk +4 -4
  41. package/components/mutually-exclusive/_macro.njk +1 -1
  42. package/components/mutually-exclusive/mutually-exclusive.js +3 -1
  43. package/components/navigation/_macro.njk +8 -8
  44. package/components/pagination/_macro.njk +3 -3
  45. package/components/panel/_macro.njk +37 -39
  46. package/components/panel/_macro.spec.js +1 -13
  47. package/components/promotional-banner/_macro.njk +2 -2
  48. package/components/question/_macro.njk +18 -18
  49. package/components/quote/_macro.njk +2 -2
  50. package/components/radios/_macro.njk +8 -8
  51. package/components/radios/check-radios.js +5 -1
  52. package/components/related-content/_macro.njk +2 -2
  53. package/components/relationships/_macro.njk +2 -2
  54. package/components/section-navigation/_macro.njk +2 -2
  55. package/components/select/_macro.njk +8 -8
  56. package/components/share-page/_macro.njk +2 -2
  57. package/components/status/_macro.njk +2 -2
  58. package/components/summary/_macro.njk +25 -25
  59. package/components/table/_macro.njk +10 -10
  60. package/components/table-of-contents/_macro.njk +4 -4
  61. package/components/textarea/_macro.njk +8 -8
  62. package/components/timeline/_macro.njk +1 -1
  63. package/components/video/_macro.njk +1 -1
  64. package/css/census.css +1 -1
  65. package/css/ids.css +1 -1
  66. package/css/main.css +1 -1
  67. package/layout/_template.njk +35 -35
  68. package/package.json +1 -1
  69. package/scripts/main.es5.js +1 -1
  70. package/scripts/main.js +1 -1
@@ -8,14 +8,14 @@
8
8
  <div class="ons-table-scrollable ons-table-scrollable--on">
9
9
  <div class="ons-table-scrollable__content" tabindex="0" role="region" aria-label="{{ params.caption }}. {{ params.ariaLabel | default("Scrollable table") }}">
10
10
  {% endif %}
11
- <table {% if params.id is defined and params.id %}id="{{ params.id }}"{% endif %} class="ons-table{% if params.tableClasses is defined and params.tableClasses %} {{ params.tableClasses }}{% endif %}{% if variants is defined and variants %}{% if variants is not string %}{% for variant in variants %} ons-table--{{ variant }}{% endfor %}{% else %} ons-table--{{ variants }}{% endif %}{% endif %}" {% if params.sortBy is defined and params.sortBy and 'sortable' in variants %}data-aria-sort="{{ params.sortBy }}" data-aria-asc="{{ params.ariaAsc }}" data-aria-desc="{{ params.ariaDesc }}"{% endif %}>
12
- {% if params.caption is defined and params.caption %}
11
+ <table {% if params.id %}id="{{ params.id }}"{% endif %} class="ons-table{% if params.tableClasses %} {{ params.tableClasses }}{% endif %}{% if variants %}{% if variants is not string %}{% for variant in variants %} ons-table--{{ variant }}{% endfor %}{% else %} ons-table--{{ variants }}{% endif %}{% endif %}" {% if params.sortBy and 'sortable' in variants %}data-aria-sort="{{ params.sortBy }}" data-aria-asc="{{ params.ariaAsc }}" data-aria-desc="{{ params.ariaDesc }}"{% endif %}>
12
+ {% if params.caption %}
13
13
  <caption class="ons-table__caption{{ " ons-u-vh" if params.hideCaption }}">{{ params.caption }}</caption>
14
14
  {% endif %}
15
15
  <thead class="ons-table__head">
16
16
  <tr class="ons-table__row">
17
17
  {% for th in params.ths %}
18
- <th scope="col" class="ons-table__header{{ ' ' + th.thClasses if th.thClasses is defined and th.thClasses }}{{ " ons-table__header--numeric" if th.numeric is defined and th.numeric }}"{% if 'sortable' in variants %} aria-sort="{{- th.ariaSort | default('none') -}}"{% endif %}>
18
+ <th scope="col" class="ons-table__header{{ ' ' + th.thClasses if th.thClasses }}{{ " ons-table__header--numeric" if th.numeric }}"{% if 'sortable' in variants %} aria-sort="{{- th.ariaSort | default('none') -}}"{% endif %}>
19
19
  <span>{{- th.value -}}</span>
20
20
  {% if 'sortable' in variants %}
21
21
  {{
@@ -32,10 +32,10 @@
32
32
  </thead>
33
33
  <tbody class="ons-table__body">
34
34
  {% for tr in params.trs %}
35
- <tr class="ons-table__row{{ " ons-table__row--highlight" if tr.highlight }}" {% if tr.name is defined and tr.name %} name="{{ tr.name }}"{% endif %} {% if tr.id is defined and tr.id %} id="{{ tr.id }}"{% endif %}>
35
+ <tr class="ons-table__row{{ " ons-table__row--highlight" if tr.highlight }}" {% if tr.name %} name="{{ tr.name }}"{% endif %} {% if tr.id %} id="{{ tr.id }}"{% endif %}>
36
36
  {% for td in tr.tds %}
37
- <td class="ons-table__cell{{ ' ' + td.tdClasses if td.tdClasses is defined and td.tdClasses }}{{ " ons-table__cell--numeric" if td.numeric is defined and td.numeric }}" {% if td.id is defined and td.id %} id="{{ td.id }}"{% endif %} {% if td.name is defined and td.name %} name="{{ td.name }}"{% endif %} {% if td.data is defined and td.data %} data-th="{{ td.data }}"{% endif %} {% if td.dataSort is defined and td.dataSort %} data-sort-value="{{ td.dataSort }}"{% endif %}>
38
- {% if td.form is defined and td.form %}
37
+ <td class="ons-table__cell{{ ' ' + td.tdClasses if td.tdClasses }}{{ " ons-table__cell--numeric" if td.numeric }}" {% if td.id %} id="{{ td.id }}"{% endif %} {% if td.name %} name="{{ td.name }}"{% endif %} {% if td.data %} data-th="{{ td.data }}"{% endif %} {% if td.dataSort %} data-sort-value="{{ td.dataSort }}"{% endif %}>
38
+ {% if td.form %}
39
39
  <form action="{{ td.form.action }}" method="{{ td.form.method | default('POST')}}">
40
40
  {{
41
41
  onsButton({
@@ -47,14 +47,14 @@
47
47
  "name": td.form.button.name if td.form.button.name
48
48
  })
49
49
  }}
50
- {% if td.form.hiddenFormField is defined and td.form.hiddenFormField %}
50
+ {% if td.form.hiddenFormField %}
51
51
  {% for hiddenField in td.form.hiddenFormField %}
52
- <input type="hidden" {% if hiddenField.name is defined and hiddenField.name %} name="{{ hiddenField.name }}"{% endif %} {% if hiddenField.value is defined and hiddenField.value %} value="{{ hiddenField.value }}"{% endif %} />
52
+ <input type="hidden" {% if hiddenField.name %} name="{{ hiddenField.name }}"{% endif %} {% if hiddenField.value %} value="{{ hiddenField.value }}"{% endif %} />
53
53
  {% endfor %}
54
54
  {% endif %}
55
55
  </form>
56
56
  {% endif %}
57
- {% if td.value is defined and td.value %}
57
+ {% if td.value %}
58
58
  {{ td.value | safe }}
59
59
  {% endif %}
60
60
  </td>
@@ -62,7 +62,7 @@
62
62
  </tr>
63
63
  {% endfor %}
64
64
  </tbody>
65
- {% if params.tfoot is defined and params.tfoot %}
65
+ {% if params.tfoot %}
66
66
  <tfoot class="ons-table__foot">
67
67
  <tr class="ons-table__row">
68
68
  {% for tfootCell in params.tfoot %}
@@ -3,7 +3,7 @@
3
3
  {% from "components/skip-to-content/_macro.njk" import onsSkipToContent %}
4
4
 
5
5
  <aside class="ons-toc-container" role="complementary">
6
- {% if params.skipLink is defined and params.skipLink %}
6
+ {% if params.skipLink %}
7
7
  {{
8
8
  onsSkipToContent({
9
9
  "url": params.skipLink.url,
@@ -14,9 +14,9 @@
14
14
 
15
15
  <nav class="ons-toc" aria-label="{{ params.ariaLabel | default('Table of contents') }}">
16
16
  <h2 class="ons-toc__title ons-u-fs-r--b ons-u-mb-s">{{ params.title }}</h2>
17
- {% if params.lists is defined and params.lists %}
17
+ {% if params.lists %}
18
18
  {% for list in params.lists %}
19
- {% if list.listHeading is defined and list.listHeading %}
19
+ {% if list.listHeading %}
20
20
  <h3 class="ons-u-fs-r ons-u-mb-xs">{{ list.listHeading }}<span class="ons-u-vh"> {{ list.listHeadingHidden }}</span>:</h3>
21
21
  {% endif %}
22
22
  {{
@@ -28,7 +28,7 @@
28
28
  })
29
29
  }}
30
30
  {% endfor %}
31
- {% elif params.itemsList is defined and params.itemsList %}
31
+ {% elif params.itemsList %}
32
32
  {{
33
33
  onsList({
34
34
  "element": 'ol',
@@ -8,7 +8,7 @@
8
8
  {% set field %}
9
9
  {% set textareaExclusiveClass = " ons-js-exclusive-group-item" if params.mutuallyExclusive else "" %}
10
10
 
11
- {% if params.label is defined and params.label %}
11
+ {% if params.label %}
12
12
  {{ onsLabel({
13
13
  "for": params.id,
14
14
  "text": params.label.text,
@@ -19,20 +19,20 @@
19
19
 
20
20
  <textarea
21
21
  id="{{ params.id }}"
22
- class="ons-input ons-input--textarea {% if params.error is defined and params.error %} ons-input--error {% endif %}{% if params.charCheckLimit is defined and params.charCheckLimit and params.charCheckLimit.limit is defined and params.charCheckLimit.limit %} ons-js-char-limit-input{% endif %}{{ textareaExclusiveClass }} {{ params.classes if params.classes is defined and params.classes }} {% if params.width is defined and params.width %}ons-input--w-{{ params.width }}{% endif %}"
23
- {% if params.name is defined and params.name %}
22
+ class="ons-input ons-input--textarea {% if params.error %} ons-input--error {% endif %}{% if params.charCheckLimit and params.charCheckLimit.limit %} ons-js-char-limit-input{% endif %}{{ textareaExclusiveClass }} {{ params.classes if params.classes }} {% if params.width %}ons-input--w-{{ params.width }}{% endif %}"
23
+ {% if params.name %}
24
24
  name="{{ params.name }}"
25
25
  {% endif %}
26
26
  rows="{{ params.rows | default(8) }}"
27
- {% if params.charCheckLimit is defined and params.charCheckLimit and params.charCheckLimit.limit is defined and params.charCheckLimit.limit %}
27
+ {% if params.charCheckLimit and params.charCheckLimit.limit %}
28
28
  maxlength="{{ params.charCheckLimit.limit }}"
29
29
  data-char-limit-ref="{{ params.id }}-lim-remaining"
30
30
  aria-describedby="{{ params.id }}-lim-remaining"
31
31
  {% endif %}
32
- {% if params.attributes is defined and params.attributes %}{% for attribute, value in (params.attributes.items() if params.attributes is mapping and params.attributes.items else params.attributes) %}{{ attribute }}{% if value is defined and value %}="{{ value }}"{% endif %} {% endfor %}{% endif %}
33
- >{{ params.value if params.value is defined and params.value }}</textarea>
32
+ {% 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 %}
33
+ >{{ params.value if params.value }}</textarea>
34
34
 
35
- {% if params.charCheckLimit is defined and params.charCheckLimit and params.charCheckLimit.limit is defined and params.charCheckLimit.limit %}
35
+ {% if params.charCheckLimit and params.charCheckLimit.limit %}
36
36
  {% call onsCharLimit({
37
37
  "id": params.id ~ "-lim",
38
38
  "limit": params.charCheckLimit.limit,
@@ -43,7 +43,7 @@
43
43
  {% endif %}
44
44
  {% endset %}
45
45
 
46
- {% if params.mutuallyExclusive is defined and params.mutuallyExclusive %}
46
+ {% if params.mutuallyExclusive %}
47
47
  {% call onsMutuallyExclusive({
48
48
  "id": params.fieldId,
49
49
  "classes": params.fieldClasses,
@@ -9,7 +9,7 @@
9
9
 
10
10
  <h2 class="ons-timeline__heading">{{ item.heading }}</h2>
11
11
 
12
- {% if item.itemsList is defined and item.itemsList %}
12
+ {% if item.itemsList %}
13
13
 
14
14
  {{
15
15
  onsList({
@@ -1,6 +1,6 @@
1
1
  {%- macro onsVideo(params) -%}
2
2
  <div class="ons-video">
3
- {% if params.youtubeUrl is defined and params.youtubeUrl %}
3
+ {% if params.youtubeUrl %}
4
4
  <iframe title="{{ params.title }}" class="ons-video__iframe" src="{{ params.youtubeUrl }}" frameborder="0" allow="accelerometer; encrypted-media; gyroscope; picture-in-picture" allowfullscreen></iframe>
5
5
  {% endif %}
6
6
  </div>