desy-html 8.6.0 → 8.8.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 (37) hide show
  1. package/docs/_macro.show-code-from-file.njk +3 -3
  2. package/docs/_macro.show-html-from-file.njk +3 -2
  3. package/docs/ds/_ds.example.layout-escritorio.njk +12 -12
  4. package/docs/ds/_ds.example.layout-movil.njk +4 -4
  5. package/docs/ds/_ds.example.layout-sidebar.njk +1 -1
  6. package/docs/ds/_ds.example.typography.njk +1 -1
  7. package/docs/ds/_ds.macro.code-snippet.njk +1 -1
  8. package/docs/ds/_ds.macro.section-title.njk +1 -1
  9. package/docs/ds/_ds.macro.subsection-title.njk +1 -1
  10. package/docs/ds/_ds.section.espaciado.njk +154 -16
  11. package/docs/ds/_ds.section.textos.njk +216 -142
  12. package/docs/index.html +13 -0
  13. package/package.json +1 -1
  14. package/src/js/aria/MenuHorizontal.js +58 -0
  15. package/src/js/aria/MenubarAction.js +210 -164
  16. package/src/js/aria/accordion.js +46 -2
  17. package/src/js/aria/listbox.js +68 -7
  18. package/src/js/aria/tabs.js +11 -9
  19. package/src/js/desy-html.js +47 -12
  20. package/src/js/index.js +2 -0
  21. package/src/templates/components/accordion/_examples.accordion.njk +10 -4
  22. package/src/templates/components/accordion/_template.accordion.njk +2 -1
  23. package/src/templates/components/accordion-history/_examples.accordion-history.njk +11 -5
  24. package/src/templates/components/accordion-history/_template.accordion-history.njk +2 -1
  25. package/src/templates/components/header/_template.header.header__offcanvas.njk +1 -0
  26. package/src/templates/components/header/_template.header.header__offcanvasButton.njk +1 -0
  27. package/src/templates/components/listbox/_examples.listbox.njk +11 -4
  28. package/src/templates/components/listbox/_template.listbox.njk +2 -2
  29. package/src/templates/components/menu-horizontal/_examples.menu-horizontal.njk +5 -3
  30. package/src/templates/components/menu-horizontal/_template.menu-horizontal.njk +2 -2
  31. package/src/templates/components/menubar/_examples.menubar.njk +156 -3
  32. package/src/templates/components/menubar/_template.menubar.njk +2 -2
  33. package/src/templates/components/modal/_template.modal.njk +1 -1
  34. package/src/templates/components/notification/_template.notification.njk +1 -1
  35. package/src/templates/components/pagination/_template.pagination.njk +12 -6
  36. package/src/templates/components/tabs/_examples.tabs.njk +4 -1
  37. package/src/templates/pages/_template.with-header-advanced.njk +218 -37
@@ -40,7 +40,8 @@
40
40
  "attributes": {
41
41
  "id": id,
42
42
  "aria-current": "page",
43
- "tabindex": "-1"
43
+ "tabindex": "-1",
44
+ "type": "button"
44
45
  }
45
46
  }) | trim | indent(4) }}
46
47
  {% else %}
@@ -49,7 +50,8 @@
49
50
  "href": "#",
50
51
  "classes": "mb-sm mr-sm",
51
52
  "attributes": {
52
- "id": id
53
+ "id": id,
54
+ "type": "button"
53
55
  }
54
56
  }) | trim | indent(4) }}
55
57
  {% endif %}
@@ -81,7 +83,8 @@
81
83
  "disabled": disabledFirst,
82
84
  "classes": "c-button--sm c-button--transparent mr-xs",
83
85
  "attributes": {
84
- "id": params.idPrefix + "-first"
86
+ "id": params.idPrefix + "-first",
87
+ "type": "button"
85
88
  }
86
89
  }) | trim | indent(4) }}
87
90
  {% endif %}
@@ -92,7 +95,8 @@
92
95
  "disabled": disabledPrevious,
93
96
  "classes": "c-button--sm c-button--transparent mr-xs",
94
97
  "attributes": {
95
- "id": params.idPrefix + "-previous"
98
+ "id": params.idPrefix + "-previous",
99
+ "type": "button"
96
100
  }
97
101
  }) | trim | indent(4) }}
98
102
  {% endif %}
@@ -121,7 +125,8 @@
121
125
  "disabled": disabledNext,
122
126
  "classes": "c-button--sm c-button--transparent mr-xs",
123
127
  "attributes": {
124
- "id": params.idPrefix + "-next"
128
+ "id": params.idPrefix + "-next",
129
+ "type": "button"
125
130
  }
126
131
  }) | trim | indent(4) }}
127
132
  {% endif %}
@@ -132,7 +137,8 @@
132
137
  "disabled": disabledLast,
133
138
  "classes": "c-button--sm c-button--transparent mr-xs",
134
139
  "attributes": {
135
- "id": params.idPrefix + "-last"
140
+ "id": params.idPrefix + "-last",
141
+ "type": "button"
136
142
  }
137
143
  }) | trim | indent(4) }}
138
144
  {% endif %}
@@ -366,7 +366,10 @@
366
366
  "html": "<p><strong>Panel 3</strong>. Provident animi dolor veniam, et quas consequuntur. Reiciendis eius in, nostrum porro? Quaerat, temporibus, optio? Lorem ipsum dolor sit, amet, consectetur adipisicing elit. Est quis exercitationem, nesciunt nulla quisquam temporibus. Provident animi dolor veniam, et quas consequuntur.</p>"
367
367
  }
368
368
  }
369
- ]
369
+ ],
370
+ "attributes": {
371
+ "id": "tabs-active-icons"
372
+ }
370
373
  }
371
374
  },
372
375
  {
@@ -1,6 +1,8 @@
1
1
  {% include "pages/_page.head.njk" %}
2
2
 
3
3
  {% from "components/header-advanced/_macro.header-advanced.njk" import componentHeaderAdvanced %}
4
+ {% from "components/menu-vertical/_macro.menu-vertical.njk" import componentMenuVertical %}
5
+ {% from "components/menu-navigation/_macro.menu-navigation.njk" import componentMenuNavigation %}
4
6
  {% from "components/nav/_macro.nav.njk" import componentNav %}
5
7
  {% from "components/details/_macro.details.njk" import componentDetails %}
6
8
 
@@ -13,6 +15,132 @@
13
15
  <!-- /pageSpinnerBlock -->
14
16
  <!-- headerBlock -->
15
17
  {% block headerBlock %}
18
+ {% set menuCustom %}
19
+ <div class="hidden lg:flex lg:flex-wrap lg:flex-1 lg:gap-base">
20
+ {{ componentMenuNavigation({
21
+ "idPrefix": "header-custom-nav",
22
+ "classes": "bg-neutral-lighter c-menu-navigation--last-right w-full",
23
+ "items": [
24
+ {
25
+ "text": "Inicio",
26
+ "active": true,
27
+ "id": "header-custom-nav-item-0",
28
+ "classes": "c-menu-navigation__button--header -mr-base",
29
+ "href": "#"
30
+ },
31
+ {
32
+ "text": "Gestiones",
33
+ "id": "header-custom-nav-item-1",
34
+ "classes": "c-menu-navigation__button--header -mr-base",
35
+ "sub": {
36
+ "items": [
37
+ {
38
+ "href": "#",
39
+ "text": "Subitem 1"
40
+ },
41
+ {
42
+ "href": "#",
43
+ "text": "Subitem 2"
44
+ },
45
+ {
46
+ "href": "#",
47
+ "text": "Subitem 3"
48
+ }
49
+ ],
50
+ "attributes": {
51
+ "aria-labelledby": "header-custom-nav-item-1"
52
+ }
53
+ }
54
+ },
55
+ {
56
+ "text": "Centros sanitarios",
57
+ "id": "header-custom-nav-item-2",
58
+ "classes": "c-menu-navigation__button--header -mr-base",
59
+ "sub": {
60
+ "items": [
61
+ {
62
+ "href": "#",
63
+ "text": "Subitem 1"
64
+ },
65
+ {
66
+ "href": "#",
67
+ "text": "Subitem 2",
68
+ "active": true
69
+ },
70
+ {
71
+ "href": "#",
72
+ "text": "Subitem 3"
73
+ }
74
+ ],
75
+ "attributes": {
76
+ "aria-labelledby": "header-custom-nav-item-2"
77
+ }
78
+ }
79
+ },
80
+ {
81
+ "text": "Cuida tu salud",
82
+ "id": "header-custom-nav-item-3",
83
+ "classes": "c-menu-navigation__button--header -mr-base",
84
+ "sub": {
85
+ "items": [
86
+ {
87
+ "href": "#",
88
+ "text": "Subitem 1"
89
+ },
90
+ {
91
+ "href": "#",
92
+ "text": "Subitem 2"
93
+ },
94
+ {
95
+ "href": "#",
96
+ "text": "Subitem 3"
97
+ }
98
+ ],
99
+ "attributes": {
100
+ "aria-labelledby": "header-custom-nav-item-3"
101
+ }
102
+ }
103
+ },
104
+ {
105
+ "text": "Participación",
106
+ "id": "header-custom-nav-item-4",
107
+ "classes": "c-menu-navigation__button--header -mr-base",
108
+ "href": "#"
109
+ },
110
+ {
111
+ "text": "Contacto",
112
+ "id": "header-custom-nav-item-5",
113
+ "classes": "c-menu-navigation__button--header -mr-base",
114
+ "href": "#"
115
+ },
116
+ {
117
+ "text": "Hola, Marta",
118
+ "id": "header-custom-nav-item-6",
119
+ "classes": "c-menu-navigation__button--header",
120
+ "sub": {
121
+ "items": [
122
+ {
123
+ "href": "#",
124
+ "text": "Perfil"
125
+ },
126
+ {
127
+ "href": "#",
128
+ "text": "Cerrar sesión"
129
+ }
130
+ ],
131
+ "attributes": {
132
+ "aria-labelledby": "header-custom-nav-item-6"
133
+ }
134
+ }
135
+ }
136
+ ],
137
+ "attributes": {
138
+ "aria-label": "Menu de navegación principal",
139
+ "id": "mi-menu-header"
140
+ }
141
+ }) }}
142
+ </div>
143
+ {% endset %}
16
144
  {% call componentHeaderAdvanced({
17
145
  "skipLink": {
18
146
  "href": "#content"
@@ -21,35 +149,7 @@
21
149
  "homepageUrl": "index.html",
22
150
  "text": "Portal de Salud"
23
151
  },
24
- "navigation": {
25
- "items": [
26
- {
27
- "href": "#",
28
- "text": "Inicio",
29
- "active": true
30
- },
31
- {
32
- "href": "#",
33
- "text": "Gestiones"
34
- },
35
- {
36
- "href": "#",
37
- "text": "Centros sanitarios"
38
- },
39
- {
40
- "href": "#",
41
- "text": "Cuida tu salud"
42
- },
43
- {
44
- "href": "#",
45
- "text": "Participación"
46
- },
47
- {
48
- "href": "#",
49
- "text": "Contacto"
50
- }
51
- ]
52
- },
152
+ "customNavigationHtml": menuCustom | safe,
53
153
  "offcanvas": {
54
154
  "text": "Menú",
55
155
  "textClose": "Cerrar menú"
@@ -59,39 +159,120 @@
59
159
  <nav class="w-full p-2" aria-labelledby="menu-movil-title">
60
160
  <h2 id="menu-movil-title" class="sr-only">Menú principal</h2>
61
161
  <h3 class="p-base text-base font-bold">Portal de Salud</h3>
62
- {{ componentNav({
63
- "idPrefix": "nav-mobile-pages",
64
- "hasNav": false,
162
+ {{ componentMenuVertical({
163
+ "idPrefix": "menu-mobile",
65
164
  "items": [
66
165
  {
67
166
  "href": "#",
68
167
  "text": "Inicio",
168
+ "id": "menu-mobile-item-0",
69
169
  "active": true
70
170
  },
71
171
  {
72
172
  "href": "#",
73
- "text": "Gestiones"
173
+ "text": "Gestiones",
174
+ "id": "menu-mobile-item-1",
175
+ "sub": {
176
+ "items": [
177
+ {
178
+ "href": "#",
179
+ "text": "Subitem 1"
180
+ },
181
+ {
182
+ "href": "#",
183
+ "text": "Subitem 2"
184
+ },
185
+ {
186
+ "href": "#",
187
+ "text": "Subitem 3"
188
+ }
189
+ ],
190
+ "attributes": {
191
+ "aria-labelledby": "menu-mobile-item-1"
192
+ }
193
+ }
74
194
  },
75
195
  {
76
196
  "href": "#",
77
- "text": "Centros sanitarios"
197
+ "text": "Centros sanitarios",
198
+ "id": "menu-mobile-item-2",
199
+ "sub": {
200
+ "items": [
201
+ {
202
+ "href": "#",
203
+ "text": "Subitem 1"
204
+ },
205
+ {
206
+ "href": "#",
207
+ "text": "Subitem 2"
208
+ },
209
+ {
210
+ "href": "#",
211
+ "text": "Subitem 3"
212
+ }
213
+ ],
214
+ "attributes": {
215
+ "aria-labelledby": "menu-mobile-item-2"
216
+ }
217
+ }
78
218
  },
79
219
  {
80
220
  "href": "#",
81
- "text": "Cuida tu salud"
221
+ "text": "Cuida tu salud",
222
+ "id": "menu-mobile-item-3",
223
+ "sub": {
224
+ "items": [
225
+ {
226
+ "href": "#",
227
+ "text": "Subitem 1"
228
+ },
229
+ {
230
+ "href": "#",
231
+ "text": "Subitem 2"
232
+ },
233
+ {
234
+ "href": "#",
235
+ "text": "Subitem 3"
236
+ }
237
+ ],
238
+ "attributes": {
239
+ "aria-labelledby": "menu-mobile-item-3"
240
+ }
241
+ }
82
242
  },
83
243
  {
84
244
  "href": "#",
85
- "text": "Participación"
245
+ "text": "Participación",
246
+ "id": "menu-mobile-item-4"
86
247
  },
87
248
  {
88
249
  "href": "#",
89
- "text": "Contacto"
250
+ "text": "Contacto",
251
+ "id": "menu-mobile-item-5"
90
252
  }
91
253
  ],
92
254
  "attributes": {
93
255
  "aria-label": "Lista de páginas"
94
256
  }
257
+ }) }}
258
+ <hr class="mt-lg mb-base border-b border-neutral-base">
259
+ <h3 class="p-base text-base font-bold">Usuario/a: Ana Pérez</h3>
260
+ {{ componentNav({
261
+ "idPrefix": "nav-mobile-user",
262
+ "hasNav": false,
263
+ "items": [
264
+ {
265
+ "href": "#",
266
+ "text": "Perfil"
267
+ },
268
+ {
269
+ "href": "#",
270
+ "text": "Cerrar sesión"
271
+ }
272
+ ],
273
+ "attributes": {
274
+ "aria-label": "Lista de acciones de usuario"
275
+ }
95
276
  }) }}
96
277
  </nav>
97
278
  {% endcall %}