desy-html 7.1.1 → 7.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 (91) hide show
  1. package/docs/_global.foot.njk +9 -9
  2. package/docs/_global.head.njk +1 -1
  3. package/docs/_macro.example-render.njk +177 -147
  4. package/docs/_macro.render-caller.njk +1 -1
  5. package/docs/ds/_ds.example.border.njk +1 -1
  6. package/docs/ds/_ds.example.color-de-interaccion.njk +5 -5
  7. package/docs/ds/_ds.example.colores-cabecera.njk +7 -7
  8. package/docs/ds/_ds.example.colores-de-soporte.njk +72 -5
  9. package/docs/ds/_ds.example.colores-neutros.njk +12 -12
  10. package/docs/ds/_ds.example.layout.njk +2 -2
  11. package/docs/ds/_ds.example.typography.njk +1 -1
  12. package/docs/ds/_ds.macro.code-snippet.njk +28 -9
  13. package/docs/ds/_ds.section.color.njk +7 -65
  14. package/docs/ds/_ds.section.espaciado.njk +4 -295
  15. package/docs/ds/_ds.section.layout.njk +5 -5
  16. package/docs/ds/_ds.section.textos.njk +40 -50
  17. package/docs/ds/_ds.section.typography.njk +239 -236
  18. package/docs/index.html +12 -0
  19. package/package.json +1 -1
  20. package/src/css/component.text.css +11 -0
  21. package/src/js/aria/dataGrid.js +21 -6
  22. package/src/js/index.js +0 -7
  23. package/src/js/popper.min.js +6 -0
  24. package/src/js/prism/clipboard.min.js +7 -0
  25. package/src/js/prism/prism-copy-to-clipboard.min.js +1 -0
  26. package/src/js/prism/prism-normalize-whitespace.min.js +1 -0
  27. package/src/js/prism/prism-toolbar.min.js +1 -0
  28. package/src/js/prism/prism-twig.min.js +1 -0
  29. package/src/js/prism/prism-yaml.min.js +1 -0
  30. package/src/js/prism/prism.min.js +1 -0
  31. package/src/js/tippy-bundle.umd.min.js +2 -0
  32. package/src/templates/components/accordion/_template.accordion.njk +95 -84
  33. package/src/templates/components/accordion-history/_template.accordion-history.njk +134 -123
  34. package/src/templates/components/alert/_template.alert.njk +6 -6
  35. package/src/templates/components/breadcrumbs/_template.breadcrumbs.njk +15 -30
  36. package/src/templates/components/button/_template.button.njk +4 -0
  37. package/src/templates/components/button-loader/_template.button-loader.njk +11 -7
  38. package/src/templates/components/card/_examples.card.njk +76 -76
  39. package/src/templates/components/card/_template.card.njk +14 -14
  40. package/src/templates/components/character-count/_template.character-count.njk +3 -6
  41. package/src/templates/components/checkboxes/_examples.checkboxes.njk +49 -10
  42. package/src/templates/components/checkboxes/_template.checkboxes.njk +17 -11
  43. package/src/templates/components/collapsible/_template.collapsible.njk +4 -4
  44. package/src/templates/components/date-input/_template.date-input.njk +46 -40
  45. package/src/templates/components/dialog/_template.dialog.njk +2 -2
  46. package/src/templates/components/error-message/_template.error-message.njk +3 -3
  47. package/src/templates/components/error-summary/_template.error-summary.njk +18 -6
  48. package/src/templates/components/fieldset/_examples.fieldset.njk +32 -6
  49. package/src/templates/components/fieldset/_template.fieldset.njk +28 -16
  50. package/src/templates/components/footer/_examples.footer.njk +14 -9
  51. package/src/templates/components/footer/_template.footer.njk +62 -66
  52. package/src/templates/components/footer/params.footer.yaml +4 -26
  53. package/src/templates/components/header/_examples.header.njk +6 -4
  54. package/src/templates/components/header/_template.header.header__dropdown.njk +27 -22
  55. package/src/templates/components/header/_template.header.header__navigation.njk +4 -1
  56. package/src/templates/components/header/_template.header.header__offcanvas.njk +18 -16
  57. package/src/templates/components/header/_template.header.header__offcanvasButton.njk +2 -1
  58. package/src/templates/components/header/_template.header.header__subnav.njk +33 -29
  59. package/src/templates/components/header/_template.header.njk +70 -60
  60. package/src/templates/components/header-advanced/_examples.header-advanced.njk +46 -32
  61. package/src/templates/components/header-advanced/_template.header-advanced.njk +93 -90
  62. package/src/templates/components/header-mini/_examples.header-mini.njk +1 -1
  63. package/src/templates/components/hint/_examples.hint.njk +2 -2
  64. package/src/templates/components/hint/_template.hint.njk +1 -3
  65. package/src/templates/components/input-group/_template.input-group.njk +72 -68
  66. package/src/templates/components/item/_template.item.njk +23 -23
  67. package/src/templates/components/label/_template.label.njk +25 -14
  68. package/src/templates/components/links-list/_examples.links-list.njk +10 -12
  69. package/src/templates/components/links-list/_template.links-list.njk +35 -37
  70. package/src/templates/components/listbox/_template.listbox.njk +11 -11
  71. package/src/templates/components/menu-navigation/_template.menu-navigation.njk +62 -63
  72. package/src/templates/components/menu-vertical/_template.menu-vertical.njk +41 -41
  73. package/src/templates/components/menubar/_template.menubar.njk +91 -91
  74. package/src/templates/components/modal/_template.modal.njk +63 -53
  75. package/src/templates/components/nav/_template.nav.njk +13 -13
  76. package/src/templates/components/notification/_examples.notification.njk +0 -9
  77. package/src/templates/components/notification/_template.notification.njk +54 -44
  78. package/src/templates/components/pagination/_template.pagination.njk +37 -42
  79. package/src/templates/components/radios/_examples.radios.njk +49 -12
  80. package/src/templates/components/radios/_template.radios.njk +90 -84
  81. package/src/templates/components/searchbar/_template.searchbar.njk +6 -6
  82. package/src/templates/components/select/_template.select.njk +12 -12
  83. package/src/templates/components/status-item/_template.status-item.njk +23 -25
  84. package/src/templates/components/table/_template.table.njk +4 -4
  85. package/src/templates/components/table-advanced/_examples.table-advanced.njk +9 -9
  86. package/src/templates/components/table-advanced/_styles.table-advanced.css +3 -3
  87. package/src/templates/components/table-advanced/_template.table-advanced.njk +85 -83
  88. package/src/templates/components/tabs/_template.tabs.njk +39 -39
  89. package/src/templates/components/toggle/_template.toggle.njk +1 -2
  90. package/src/templates/components/tooltip/_template.tooltip.njk +19 -19
  91. package/src/templates/components/tree/_template.tree.njk +46 -42
@@ -16,83 +16,83 @@
16
16
  html: params.skipLink.html if params.skipLink.html,
17
17
  text: params.skipLink.text if params.skipLink.text else "Saltar al contenido principal",
18
18
  href: params.skipLink.href if params.skipLink.href else "#content"
19
- }) }}
19
+ }) | indent(6) }}
20
20
  </nav>
21
21
  {% if params.headerMini %}
22
- {{ componentHeaderMini(params.headerMini) }}
22
+ {{ componentHeaderMini(params.headerMini) | indent(4) }}
23
23
  {% else %}
24
- {{ componentHeaderMini({}) }}
24
+ {{ componentHeaderMini({}) | indent(4) }}
25
25
  {% endif %}
26
26
  {% if params.super %}
27
27
  {% if params.super.customHtml %}
28
- {{ params.super.customHtml }}
28
+ {{ params.super.customHtml }}
29
29
  {% else %}
30
- <div class="{% if params.super.classes %}{{ params.super.classes }}{% else-%} h-32 bg-cover bg-center bg-no-repeat overflow-hidden{% endif %}" style="background-color: {{ params.super.backgroundFullColor }}; {% if params.super.backgroundFullUrl %} background-image: url('{{ params.super.backgroundFullUrl }}'){% endif %}">
31
- <div class="container h-full mx-auto px-base">
32
- <div class="relative h-full bg-cover bg-no-repeat" {% if params.super.backgroundContainerUrl %} style="background-image: url('{{ params.super.backgroundContainerUrl }}')"{% endif %}>
33
- {% if params.super.logo %}
34
- <a href="{{ params.super.logo.href | default('/') }}" class="{% if params.super.logo.classes %}{{ params.super.logo.classes }}{% else-%} absolute top-6 left-0 focus:outline-none focus:ring-4 focus:ring-inset focus:ring-black focus:bg-warning-base{% endif %}">
35
- <img src="{{ params.super.logo.url}}" alt="{{ params.super.logo.alt}}">
36
- </a>
37
- {% endif %}
38
- {{ params.super.customNavigationHtml | safe if params.super.customNavigationHtml }}
39
- </div>
40
- </div>
30
+ <div class="{% if params.super.classes %}{{ params.super.classes }}{% else-%} h-32 bg-cover bg-center bg-no-repeat overflow-hidden{% endif %}" style="background-color: {{ params.super.backgroundFullColor }}; {% if params.super.backgroundFullUrl %} background-image: url('{{ params.super.backgroundFullUrl }}'){% endif %}">
31
+ <div class="container h-full mx-auto px-base">
32
+ <div class="relative h-full bg-cover bg-no-repeat" {% if params.super.backgroundContainerUrl %} style="background-image: url('{{ params.super.backgroundContainerUrl }}')"{% endif %}>
33
+ {% if params.super.logo %}
34
+ <a href="{{ params.super.logo.href | default('/') }}" class="{% if params.super.logo.classes %}{{ params.super.logo.classes }}{% else-%} absolute top-6 left-0 focus:outline-none focus:ring-4 focus:ring-inset focus:ring-black focus:bg-warning-base{% endif %}">
35
+ <img src="{{ params.super.logo.url}}" alt="{{ params.super.logo.alt}}">
36
+ </a>
37
+ {% endif %}
38
+ {{ params.super.customNavigationHtml | safe if params.super.customNavigationHtml }}
41
39
  </div>
40
+ </div>
41
+ </div>
42
42
  {% endif %}
43
43
  {% endif %}
44
44
  {% if params.noTitle != true %}
45
- <div class="{% if params.titleContainer.classes %}{{ params.titleContainer.classes }}{% else -%} bg-heading-base bg-no-repeat bg-cover lg:bg-auto bg-center lg:bg-right bg-general lg:bg-general-lg text-white{% endif %}" {%- if params.titleContainer.backgroundColor %} style="background-color: {{ params.titleContainer.backgroundColor }};"{% endif %}>
46
- <div class="container mx-auto px-base">
47
- <div class="lg:flex lg:flex-wrap py-base lg:py-lg">
48
- {% if params.logo %}
49
- <a href="{{ params.logo.href | default('/') }}" class="{% if params.logo.classes %}{{ params.logo.classes }}{% else-%} focus:outline-none focus:ring-4 focus:ring-inset focus:ring-black focus:bg-warning-base{% endif %}">
50
- <img src="{{ params.logo.url}}" alt="{{ params.logo.alt}}">
51
- </a>
52
- <div class="hidden lg:block mx-lg border-l border-current"></div>
53
- {% endif %}
54
- <div class="flex lg:flex-1">
55
- <div>
56
- {% set headingAttributes %}class="{% if params.title.classes %}{{ params.title.classes }}{% else %} text-2xl lg:text-3xl font-bold{% endif %}"{% endset %}
57
- {% set headingContent %}<a href="{{ params.title.homepageUrl | default('/') }}" class="hover:underline focus:outline-none focus:ring-4 focus:ring-inset focus:ring-black focus:bg-warning-base focus:text-black" title="Ir a la página de inicio">{{ params.title.html | safe if params.title.html else params.title.text }}</a>{% endset %}
58
- {% if params.headingLevel == "1" %}
59
- <h1 {{ headingAttributes | safe }}>{{ headingContent | safe }}</h1>
60
- {% elseif params.headingLevel == "2" %}
61
- <h2 {{ headingAttributes | safe }}>{{ headingContent | safe }}</h2>
62
- {% elseif params.headingLevel == "3" %}
63
- <h3 {{ headingAttributes | safe }}>{{ headingContent | safe }}</h3>
64
- {% elseif params.headingLevel == "4" %}
65
- <h4 {{ headingAttributes | safe }}>{{ headingContent | safe }}</h4>
66
- {% elseif params.headingLevel == "5" %}
67
- <h5 {{ headingAttributes | safe }}>{{ headingContent | safe }}</h5>
68
- {% else %}
69
- <h2 {{ headingAttributes | safe }}>{{ headingContent | safe }}</h2>
70
- {% endif %}
71
- {% if params.subtitle %}
72
- <p class="{% if params.subtitle.classes %}{{ params.subtitle.classes }}{% else -%} text-sm leading-5 lg:text-base lg:leading-6{% endif %}">{{ params.subtitle.html | safe if params.subtitle.html else params.subtitle.text }}</p>
73
- {% endif %}
74
- </div>
75
- {{ params.title.customNavigationHtml | safe if params.title.customNavigationHtml }}
45
+ <div class="{% if params.titleContainer.classes %}{{ params.titleContainer.classes }}{% else -%} bg-heading-base bg-no-repeat bg-cover lg:bg-auto bg-center lg:bg-right bg-general lg:bg-general-lg text-white{% endif %}" {%- if params.titleContainer.backgroundColor %} style="background-color: {{ params.titleContainer.backgroundColor }};"{% endif %}>
46
+ <div class="container mx-auto px-base">
47
+ <div class="lg:flex lg:flex-wrap py-base lg:py-lg">
48
+ {% if params.logo %}
49
+ <a href="{{ params.logo.href | default('/') }}" class="{% if params.logo.classes %}{{ params.logo.classes }}{% else-%} focus:outline-none focus:ring-4 focus:ring-inset focus:ring-black focus:bg-warning-base{% endif %}">
50
+ <img src="{{ params.logo.url}}" alt="{{ params.logo.alt}}">
51
+ </a>
52
+ <div class="hidden lg:block mx-lg border-l border-current"></div>
53
+ {% endif %}
54
+ <div class="flex lg:flex-1">
55
+ <div>
56
+ {% set headingAttributes %}class="{% if params.title.classes %}{{ params.title.classes }}{% else %} text-2xl lg:text-3xl font-bold{% endif %}"{% endset %}
57
+ {% set headingContent %}<a href="{{ params.title.homepageUrl | default('/') }}" class="hover:underline focus:outline-none focus:ring-4 focus:ring-inset focus:ring-black focus:bg-warning-base focus:text-black" title="Ir a la página de inicio">{{ params.title.html | safe if params.title.html else params.title.text }}</a>{% endset %}
58
+ {% if params.headingLevel == "1" %}
59
+ <h1 {{ headingAttributes | safe }}>{{ headingContent | safe }}</h1>
60
+ {% elseif params.headingLevel == "2" %}
61
+ <h2 {{ headingAttributes | safe }}>{{ headingContent | safe }}</h2>
62
+ {% elseif params.headingLevel == "3" %}
63
+ <h3 {{ headingAttributes | safe }}>{{ headingContent | safe }}</h3>
64
+ {% elseif params.headingLevel == "4" %}
65
+ <h4 {{ headingAttributes | safe }}>{{ headingContent | safe }}</h4>
66
+ {% elseif params.headingLevel == "5" %}
67
+ <h5 {{ headingAttributes | safe }}>{{ headingContent | safe }}</h5>
68
+ {% else %}
69
+ <h2 {{ headingAttributes | safe }}>{{ headingContent | safe }}</h2>
70
+ {% endif %}
71
+ {% if params.subtitle %}
72
+ <p class="{% if params.subtitle.classes %}{{ params.subtitle.classes }}{% else -%} text-sm leading-5 lg:text-base lg:leading-6{% endif %}">{{ params.subtitle.html | safe if params.subtitle.html else params.subtitle.text }}</p>
73
+ {% endif %}
76
74
  </div>
75
+ {{ params.title.customNavigationHtml | safe if params.title.customNavigationHtml }}
77
76
  </div>
78
77
  </div>
79
78
  </div>
79
+ </div>
80
80
  {% endif %}
81
81
  <div class="bg-neutral-lighter border-b border-neutral-base">
82
82
  <div class="container mx-auto px-base">
83
83
  <div class="flex items-center justify-between min-h-14">
84
84
  <div class="flex flex-wrap items-center">
85
85
  {% if params.navigation.items %}
86
- <div class="-ml-base">
87
- {{ componentHeaderNavigation({
88
- classes: params.navigation.classes,
89
- idPrefix: "header-nav-item",
90
- items: params.navigation.items,
91
- attributes: {
92
- "aria-label": "Menú principal"
93
- }
94
- }) | indent(12) }}
95
- </div>
86
+ <div class="-ml-base">
87
+ {{ componentHeaderNavigation({
88
+ classes: params.navigation.classes,
89
+ idPrefix: "header-nav-item",
90
+ items: params.navigation.items,
91
+ attributes: {
92
+ "aria-label": "Menú principal"
93
+ }
94
+ }) | trim | indent(14) }}
95
+ </div>
96
96
  {% endif %}
97
97
  </div>
98
98
  {{ params.customNavigationHtml | safe if params.customNavigationHtml }}
@@ -107,18 +107,18 @@
107
107
  "attributes": params.dropdown.attributes
108
108
  }) %}
109
109
  {% if params.dropdown.contentHtml %}
110
- {{ params.dropdown.contentHtml | safe }}
110
+ {{ params.dropdown.contentHtml | safe }}
111
111
  {% else %}
112
- {{ componentNav({
113
- isMenu: true,
114
- idPrefix: "header-dropdown-nav-item",
115
- items: params.dropdown.items,
116
- classes: "w-max max-w-64",
117
- attributes: {
118
- "id": "id-dropdown-nav",
119
- "aria-label": "Menú de usuario"
120
- }
121
- }) }}
112
+ {{ componentNav({
113
+ isMenu: true,
114
+ idPrefix: "header-dropdown-nav-item",
115
+ items: params.dropdown.items,
116
+ classes: "w-max max-w-64",
117
+ attributes: {
118
+ "id": "id-dropdown-nav",
119
+ "aria-label": "Menú de usuario"
120
+ }
121
+ }) }}
122
122
  {% endif %}
123
123
  {% endcall %}
124
124
  {% endif %}
@@ -126,39 +126,42 @@
126
126
  {{ componentHeaderOffcanvasButton({
127
127
  text: params.offcanvas.text,
128
128
  classes: params.offcanvas.classes
129
- }) | indent(14) }}
129
+ }) | indent(10) }}
130
130
  {% endif %}
131
131
  </div>
132
132
  </div>
133
133
  {% if params.offcanvas %}
134
- {% call componentOffcanvas({
135
- text: params.offcanvas.textClose,
136
- labelledId: params.offcanvas.labelledId
137
- }) %}
138
- {% if caller %}
139
- {{ caller() }} {#- if statement allows usage of `call` to be optional -#}
140
- {% elseif params.caller %}
141
- {{ params.caller | safe }}
142
- {% endif %}
143
- {% endcall %}
134
+ {% set offcanvasContent %}
135
+ {% call componentOffcanvas({
136
+ text: params.offcanvas.textClose,
137
+ labelledId: params.offcanvas.labelledId
138
+ }) %}
139
+ {% if caller %}
140
+ {{ caller() }} {#- if statement allows usage of `call` to be optional -#}
141
+ {% elseif params.caller %}
142
+ {{ params.caller | safe }}
143
+ {% endif %}
144
+ {% endcall %}
145
+ {% endset %}
146
+ {{ offcanvasContent | safe }}
144
147
  {% endif %}
145
148
  </div>
146
149
  {% if params.sub %}
147
150
  {% if params.sub.customHtml %}
148
- {{ params.sub.customHtml }}
151
+ {{ params.sub.customHtml }}
149
152
  {% else %}
150
- <div class="{% if params.sub.classes %}{{ params.sub.classes }}{% else-%} h-32 bg-cover bg-no-repeat overflow-hidden{% endif %}" style="background-color: {{ params.sub.backgroundFullColor }}; {% if params.sub.backgroundFullUrl %} background-image: url('{{ params.sub.backgroundFullUrl }}'){% endif %}">
151
- <div class="container h-full mx-auto px-base">
152
- <div class="relative h-full bg-cover bg-center bg-no-repeat" {% if params.sub.backgroundContainerUrl %} style="background-image: url('{{ params.sub.backgroundContainerUrl }}')"{% endif %}>
153
- {% if params.sub.logo %}
154
- <a href="{{ params.sub.logo.href | default('/') }}" class="{% if params.sub.logo.classes %}{{ params.sub.logo.classes }}{% else-%} absolute top-6 left-0 focus:outline-none focus:shadow-outline-black{% endif %}">
155
- <img src="{{ params.sub.logo.url}}" alt="{{ params.sub.logo.alt}}">
156
- </a>
157
- {% endif %}
158
- {{ params.sub.customNavigationHtml | safe if params.sub.customNavigationHtml }}
159
- </div>
160
- </div>
153
+ <div class="{% if params.sub.classes %}{{ params.sub.classes }}{% else-%} h-32 bg-cover bg-no-repeat overflow-hidden{% endif %}" style="background-color: {{ params.sub.backgroundFullColor }}; {% if params.sub.backgroundFullUrl %} background-image: url('{{ params.sub.backgroundFullUrl }}'){% endif %}">
154
+ <div class="container h-full mx-auto px-base">
155
+ <div class="relative h-full bg-cover bg-center bg-no-repeat" {% if params.sub.backgroundContainerUrl %} style="background-image: url('{{ params.sub.backgroundContainerUrl }}')"{% endif %}>
156
+ {% if params.sub.logo %}
157
+ <a href="{{ params.sub.logo.href | default('/') }}" class="{% if params.sub.logo.classes %}{{ params.sub.logo.classes }}{% else-%} absolute top-6 left-0 focus:outline-none focus:shadow-outline-black{% endif %}">
158
+ <img src="{{ params.sub.logo.url}}" alt="{{ params.sub.logo.alt}}">
159
+ </a>
160
+ {% endif %}
161
+ {{ params.sub.customNavigationHtml | safe if params.sub.customNavigationHtml }}
161
162
  </div>
163
+ </div>
164
+ </div>
162
165
  {% endif %}
163
166
  {% endif %}
164
167
  </div>
@@ -24,7 +24,7 @@
24
24
  "name": "With custom content after the logo",
25
25
  "description": "Use customNavigationHtml to nest custom content after the logo.",
26
26
  "data": {
27
- "customNavigationHtml": '<div class="flex-1 text-right">' + logoUE | safe +'</div>'
27
+ "customNavigationHtml": '<div class="flex-1 text-right">' + logoUE | trim | safe +'</div>'
28
28
  }
29
29
  }
30
30
  ] %}
@@ -3,13 +3,13 @@
3
3
  {
4
4
  "name": "default",
5
5
  "data": {
6
- "text": "It’s on your DNI, the last letter.\nFor example, ‘A’.\n"
6
+ "text": "It’s on your DNI, the last letter. For example, ‘A’."
7
7
  }
8
8
  },
9
9
  {
10
10
  "name": "with html",
11
11
  "data": {
12
- "html": "It’s on your DNI, <strong class=\" font-bold \">the last letter</strong>.\nFor example, ‘A’.\n"
12
+ "html": "It’s on your DNI, <strong class=\" font-bold \">the last letter</strong>. For example, ‘A’."
13
13
  }
14
14
  }
15
15
  ] %}
@@ -1,6 +1,4 @@
1
1
  <!-- hint -->
2
2
  <p {%- if params.id %} id="{{ params.id }}"{% endif %} class="block text-neutral-dark {%- if params.classes %} {{ params.classes }}{% endif %}"
3
- {%- for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}>
4
- {{ params.html | safe if params.html else params.text }}
5
- </p>
3
+ {%- for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}>{{ params.html | safe if params.html else params.text }}</p>
6
4
  <!-- /hint -->
@@ -13,78 +13,77 @@
13
13
  {% if params.hint %}
14
14
  {% set hintId = params.id + "-hint" %}
15
15
  {% set describedBy = describedBy + " " + hintId if describedBy else hintId %}
16
- {{ componentHint({
17
- id: hintId,
18
- classes: params.hint.classes,
19
- attributes: params.hint.attributes,
20
- html: params.hint.html,
21
- text: params.hint.text
22
- }) | indent(2) | trim }}
16
+ {{ componentHint({
17
+ id: hintId,
18
+ classes: params.hint.classes,
19
+ attributes: params.hint.attributes,
20
+ html: params.hint.html,
21
+ text: params.hint.text
22
+ }) }}
23
23
  {% endif %}
24
24
  {% if params.errorMessage %}
25
25
  {% set errorId = params.id + "-error" %}
26
26
  {% set describedBy = describedBy + " " + errorId if describedBy else errorId %}
27
- {{ componentErrorMessage({
28
- id: errorId,
29
- classes: params.errorMessage.classes,
30
- attributes: params.errorMessage.attributes,
31
- html: params.errorMessage.html,
32
- text: params.errorMessage.text,
33
- visuallyHiddenText: params.errorMessage.visuallyHiddenText
34
- }) | indent(2) | trim }}
27
+ {{ componentErrorMessage({
28
+ id: errorId,
29
+ classes: params.errorMessage.classes,
30
+ attributes: params.errorMessage.attributes,
31
+ html: params.errorMessage.html,
32
+ text: params.errorMessage.text,
33
+ visuallyHiddenText: params.errorMessage.visuallyHiddenText
34
+ }) }}
35
35
  {% endif %}
36
- <div class="{% if params.classes %}{{ params.classes }}{% else %}flex{% endif %}"
37
- {%- for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}
38
- {%- if params.id %} id="{{ params.id }}"{% endif %}>
39
- {% for item in params.items %}
40
- {% if item.isSelect %}
41
- {% if item.selectItems %}
42
- {{ componentSelect({
43
- label: item.label,
44
- id: item.id if item.id else (params.id + "-" + item.name),
45
- formGroup: item.formGroup,
46
- classes: "mb-0 " + (item.classes if item.classes),
47
- name: (params.namePrefix + "-" + item.name) if params.namePrefix else item.name,
48
- disabled: item.disabled,
49
- attributes: item.attributes,
50
- items: item.selectItems
51
- }) | indent(6) | trim }}
52
- {% endif %}
53
- {% elseif item.divider %}
54
- <div {%- if item.divider.classes %} class="{{ item.divider.classes }}{% endif %}" role="separator">
55
- {% if item.divider.html %}
56
- {{ item.divider.html | safe }}
57
- {% else %}
58
- <p>
59
- {{ item.divider.text }}
60
- </p>
61
- {% endif %}
62
- </div>
63
- {% else %}
64
- {{ componentInput({
65
- label: item.label,
66
- id: item.id if item.id else (params.id + "-" + item.name),
67
- formGroup: item.formGroup,
68
- classes: "mb-0 " + (item.classes if item.classes),
69
- name: (params.namePrefix + "-" + item.name) if params.namePrefix else item.name,
70
- value: item.value,
71
- type: item.type if item.type else "text",
72
- inputmode: item.inputmode,
73
- autocomplete: item.autocomplete,
74
- pattern: item.pattern,
75
- placeholder: item.placeholder,
76
- disabled: item.disabled,
77
- attributes: item.attributes
78
- }) | indent(6) | trim }}
36
+ <div class="{% if params.classes %}{{ params.classes }}{% else %}flex{% endif %}"
37
+ {%- for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}
38
+ {%- if params.id %} id="{{ params.id }}"{% endif %}>
39
+ {% for item in params.items %}
40
+ {% if item.isSelect %}
41
+ {% if item.selectItems %}
42
+ {{ componentSelect({
43
+ label: item.label,
44
+ id: item.id if item.id else (params.id + "-" + item.name),
45
+ formGroup: item.formGroup,
46
+ classes: "mb-0 " + (item.classes if item.classes),
47
+ name: (params.namePrefix + "-" + item.name) if params.namePrefix else item.name,
48
+ disabled: item.disabled,
49
+ attributes: item.attributes,
50
+ items: item.selectItems
51
+ }) | indent(2) }}
79
52
  {% endif %}
80
- {% endfor %}
53
+ {% elseif item.divider %}
54
+ <div {%- if item.divider.classes %} class="{{ item.divider.classes }}{% endif %}" role="separator">
55
+ {% if item.divider.html %}
56
+ {{ item.divider.html | safe }}
57
+ {% else %}
58
+ <p>
59
+ {{ item.divider.text }}
60
+ </p>
61
+ {% endif %}
81
62
  </div>
63
+ {% else %}
64
+ {{ componentInput({
65
+ label: item.label,
66
+ id: item.id if item.id else (params.id + "-" + item.name),
67
+ formGroup: item.formGroup,
68
+ classes: "mb-0 " + (item.classes if item.classes),
69
+ name: (params.namePrefix + "-" + item.name) if params.namePrefix else item.name,
70
+ value: item.value,
71
+ type: item.type if item.type else "text",
72
+ inputmode: item.inputmode,
73
+ autocomplete: item.autocomplete,
74
+ pattern: item.pattern,
75
+ placeholder: item.placeholder,
76
+ disabled: item.disabled,
77
+ attributes: item.attributes
78
+ }) | indent(2) }}
79
+ {% endif %}
80
+ {% endfor %}
81
+ </div>
82
82
  {% endset %}
83
83
 
84
- <!-- input-group -->
85
- <div class="c-form-group {%- if params.errorMessage %} c-form-group--error{% endif %} {%- if params.formGroup.classes %} {{ params.formGroup.classes }}{% endif %}">
86
- {% if params.fieldset %}
87
- {#- We override the fieldset's role to 'group' because otherwise JAWS does not
84
+ {% set formGroupContent %}
85
+ {% if params.fieldset %}
86
+ {#- We override the fieldset's role to 'group' because otherwise JAWS does not
88
87
  announce the description for a fieldset comprised of text inputs, but
89
88
  adding the role to the fieldset always makes the output overly verbose for
90
89
  radio buttons or checkboxes. -#}
@@ -96,10 +95,15 @@
96
95
  legend: params.fieldset.legend,
97
96
  headingLevel: params.fieldset.headingLevel
98
97
  }) %}
99
- {{ innerHtml | trim | safe }}
100
- {% endcall %}
101
- {% else %}
102
- {{ innerHtml | trim | safe }}
103
- {% endif %}
98
+ {{ innerHtml | safe }}
99
+ {% endcall %}
100
+ {% else %}
101
+ {{ innerHtml | safe }}
102
+ {% endif %}
103
+ {% endset %}
104
+
105
+ <!-- input-group -->
106
+ <div class="c-form-group {%- if params.errorMessage %} c-form-group--error{% endif %} {%- if params.formGroup.classes %} {{ params.formGroup.classes }}{% endif %}">
107
+ {{ formGroupContent | safe | indent(2) }}
104
108
  </div>
105
109
  <!-- /input-group -->
@@ -27,47 +27,47 @@
27
27
  <div class="lg:flex flex-1 self-center">
28
28
  <div class="lg:flex-1 lg:self-center">
29
29
  {% if params.headingLevel == "1" %}
30
- <h1 {%- if params.title.classes %} class="{{ params.title.classes }}"{% endif %} {%- for attribute, value in params.title.attributes %} {{attribute}}="{{value}}"{% endfor %}>{{ params.title.html | safe if params.title.html else params.title.text }}</h1>
30
+ <h1 {%- if params.title.classes %} class="{{ params.title.classes }}"{% endif %} {%- for attribute, value in params.title.attributes %} {{attribute}}="{{value}}"{% endfor %}>{{ params.title.html | safe if params.title.html else params.title.text }}</h1>
31
31
  {% elseif params.headingLevel == "2" %}
32
- <h2 {%- if params.title.classes %} class="{{ params.title.classes }}"{% endif %} {%- for attribute, value in params.title.attributes %} {{attribute}}="{{value}}"{% endfor %}>{{ params.title.html | safe if params.title.html else params.title.text }}</h2>
32
+ <h2 {%- if params.title.classes %} class="{{ params.title.classes }}"{% endif %} {%- for attribute, value in params.title.attributes %} {{attribute}}="{{value}}"{% endfor %}>{{ params.title.html | safe if params.title.html else params.title.text }}</h2>
33
33
  {% elseif params.headingLevel == "3" %}
34
- <h3 {%- if params.title.classes %} class="{{ params.title.classes }}"{% endif %} {%- for attribute, value in params.title.attributes %} {{attribute}}="{{value}}"{% endfor %}>{{ params.title.html | safe if params.title.html else params.title.text }}</h3>
34
+ <h3 {%- if params.title.classes %} class="{{ params.title.classes }}"{% endif %} {%- for attribute, value in params.title.attributes %} {{attribute}}="{{value}}"{% endfor %}>{{ params.title.html | safe if params.title.html else params.title.text }}</h3>
35
35
  {% elseif params.headingLevel == "4" %}
36
- <h4 {%- if params.title.classes %} class="{{ params.title.classes }}"{% endif %} {%- for attribute, value in params.title.attributes %} {{attribute}}="{{value}}"{% endfor %}>{{ params.title.html | safe if params.title.html else params.title.text }}</h4>
36
+ <h4 {%- if params.title.classes %} class="{{ params.title.classes }}"{% endif %} {%- for attribute, value in params.title.attributes %} {{attribute}}="{{value}}"{% endfor %}>{{ params.title.html | safe if params.title.html else params.title.text }}</h4>
37
37
  {% elseif params.headingLevel == "5" %}
38
- <h5 {%- if params.title.classes %} class="{{ params.title.classes }}"{% endif %} {%- for attribute, value in params.title.attributes %} {{attribute}}="{{value}}"{% endfor %}>{{ params.title.html | safe if params.title.html else params.title.text }}</h5>
38
+ <h5 {%- if params.title.classes %} class="{{ params.title.classes }}"{% endif %} {%- for attribute, value in params.title.attributes %} {{attribute}}="{{value}}"{% endfor %}>{{ params.title.html | safe if params.title.html else params.title.text }}</h5>
39
39
  {% else %}
40
- <p {%- if params.title.classes %} class="{{ params.title.classes }}"{% endif %} {%- for attribute, value in params.title.attributes %} {{attribute}}="{{value}}"{% endfor %}>{{ params.title.html | safe if params.title.html else params.title.text }}</p>
40
+ <p {%- if params.title.classes %} class="{{ params.title.classes }}"{% endif %} {%- for attribute, value in params.title.attributes %} {{attribute}}="{{value}}"{% endfor %}>{{ params.title.html | safe if params.title.html else params.title.text }}</p>
41
41
  {% endif %}
42
42
  {% if params.description %}
43
- <p {%- if params.description.classes %} class="{{ params.description.classes }}"{% endif %} {%- for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}>
44
- {{ params.description.html | safe if params.description.html else params.description.text }}
45
- </p>
43
+ <p {%- if params.description.classes %} class="{{ params.description.classes }}"{% endif %} {%- for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}>
44
+ {{ params.description.html | safe if params.description.html else params.description.text }}
45
+ </p>
46
46
  {% endif %}
47
47
  {% if params.items %}
48
- <ul class="-ml-sm lg:divide-x lg:divide-neutral-base">
49
- {% for item in params.items %}
50
- <li class="lg:inline-block px-sm text-sm text-neutral-dark">{{ item.text }}</li>
51
- {% endfor %}
52
- </ul>
48
+ <ul class="-ml-sm lg:divide-x lg:divide-neutral-base">
49
+ {% for item in params.items %}
50
+ <li class="lg:inline-block px-sm text-sm text-neutral-dark">{{ item.text }}</li>
51
+ {% endfor %}
52
+ </ul>
53
53
  {% endif %}
54
54
  {% if params.content %}
55
- <p class="text-sm {%- if params.content.classes %} {{ params.content.classes }}{% endif %}">
56
- {{ params.content.html | safe if params.content.html else params.content.text }}
57
- </p>
55
+ <p class="text-sm {%- if params.content.classes %} {{ params.content.classes }}{% endif %}">
56
+ {{ params.content.html | safe if params.content.html else params.content.text }}
57
+ </p>
58
58
  {% endif %}
59
59
  </div>
60
60
  {% if caller %}
61
61
  {% set myCaller = caller() %}
62
62
  {% if myCaller | string != '' %}
63
- <div class="w-full lg:w-auto lg:text-right mt-base lg:mt-0 lg:ml-base">
64
- {{ myCaller }}
65
- </div>
63
+ <div class="w-full lg:w-auto lg:text-right mt-base lg:mt-0 lg:ml-base">
64
+ {{ myCaller }}
65
+ </div>
66
66
  {% endif %}
67
67
  {% elseif params.caller %}
68
- <div class="w-full lg:w-auto lg:text-right mt-base lg:mt-0 lg:ml-base">
69
- {{ params.caller | safe }}
70
- </div>
68
+ <div class="w-full lg:w-auto lg:text-right mt-base lg:mt-0 lg:ml-base">
69
+ {{ params.caller | safe }}
70
+ </div>
71
71
  {% endif %}
72
72
  </div>
73
73
  </div>
@@ -2,24 +2,35 @@
2
2
  {% set labelHtml %}
3
3
  <label class="block {%- if params.classes %} {{ params.classes }}{% endif %}"
4
4
  {%- for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}
5
- {%- if params.for %} for="{{ params.for }}"{% endif %}>{{ params.html | safe if params.html else params.text }}</label>
6
- {% endset %}
5
+ {%- if params.for %} for="{{ params.for }}"{% endif %}>{{ params.html | safe if params.html else params.text }}</label>{% endset %}
7
6
 
8
7
  <!-- label -->
9
8
  {% if params.isPageHeading %}
10
9
  {% if params.headingLevel == "1" %}
11
- <h1 class="block ">{{ labelHtml | safe | indent(2) }}</h1>
12
- {% elseif params.headingLevel == "2" %}
13
- <h2 class="block ">{{ labelHtml | safe | indent(2) }}</h2>
14
- {% elseif params.headingLevel == "3" %}
15
- <h3 class="block ">{{ labelHtml | safe | indent(2) }}</h3>
16
- {% elseif params.headingLevel == "4" %}
17
- <h4 class="block ">{{ labelHtml | safe | indent(2) }}</h4>
18
- {% elseif params.headingLevel == "5" %}
19
- <h5 class="block ">{{ labelHtml | safe | indent(2) }}</h5>
20
- {% else %}
21
- <h1 class="block ">{{ labelHtml | safe | indent(2) }}</h1>
22
- {% endif %}
10
+ <h1 class="block ">
11
+ {{ labelHtml | safe }}
12
+ </h1>
13
+ {% elseif params.headingLevel == "2" %}
14
+ <h2 class="block ">
15
+ {{ labelHtml | safe }}
16
+ </h2>
17
+ {% elseif params.headingLevel == "3" %}
18
+ <h3 class="block ">
19
+ {{ labelHtml | safe }}
20
+ </h3>
21
+ {% elseif params.headingLevel == "4" %}
22
+ <h4 class="block ">
23
+ {{ labelHtml | safe }}
24
+ </h4>
25
+ {% elseif params.headingLevel == "5" %}
26
+ <h5 class="block ">
27
+ {{ labelHtml | safe }}
28
+ </h5>
29
+ {% else %}
30
+ <h1 class="block ">
31
+ {{ labelHtml | safe }}
32
+ </h1>
33
+ {% endif %}
23
34
  {% else %}
24
35
  {{ labelHtml | safe }}
25
36
  {% endif %}