desy-html 8.3.1 → 8.4.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 (66) hide show
  1. package/docs/_include.template-header.njk +138 -66
  2. package/docs/catalogo.html +1 -1
  3. package/docs/componentes.html +1 -1
  4. package/docs/estilos.html +1 -1
  5. package/docs/examples-accordion-history.html +2 -1
  6. package/docs/examples-accordion.html +2 -1
  7. package/docs/examples-alert.html +2 -1
  8. package/docs/examples-breadcrumbs.html +2 -1
  9. package/docs/examples-button-loader.html +2 -1
  10. package/docs/examples-button.html +2 -1
  11. package/docs/examples-card.html +2 -1
  12. package/docs/examples-character-count.html +2 -1
  13. package/docs/examples-checkboxes.html +2 -1
  14. package/docs/examples-collapsible.html +2 -1
  15. package/docs/examples-date-input.html +2 -1
  16. package/docs/examples-description-list.html +2 -1
  17. package/docs/examples-details.html +2 -1
  18. package/docs/examples-dialog.html +2 -1
  19. package/docs/examples-dropdown.html +2 -1
  20. package/docs/examples-error-message.html +2 -1
  21. package/docs/examples-error-summary.html +2 -1
  22. package/docs/examples-fieldset.html +2 -1
  23. package/docs/examples-file-upload.html +2 -1
  24. package/docs/examples-footer.html +2 -1
  25. package/docs/examples-header-advanced.html +2 -1
  26. package/docs/examples-header-mini.html +2 -1
  27. package/docs/examples-header.html +2 -1
  28. package/docs/examples-hint.html +2 -1
  29. package/docs/examples-input-group.html +2 -1
  30. package/docs/examples-input.html +2 -1
  31. package/docs/examples-item.html +2 -1
  32. package/docs/examples-label.html +2 -1
  33. package/docs/examples-links-list.html +2 -1
  34. package/docs/examples-listbox.html +2 -1
  35. package/docs/examples-media-object.html +2 -1
  36. package/docs/examples-menu-horizontal.html +2 -1
  37. package/docs/examples-menu-navigation.html +2 -1
  38. package/docs/examples-menu-vertical.html +2 -1
  39. package/docs/examples-menubar.html +2 -1
  40. package/docs/examples-modal.html +2 -1
  41. package/docs/examples-nav.html +2 -1
  42. package/docs/examples-notification.html +2 -1
  43. package/docs/examples-pagination.html +2 -1
  44. package/docs/examples-pill.html +2 -1
  45. package/docs/examples-radios.html +2 -1
  46. package/docs/examples-searchbar.html +2 -1
  47. package/docs/examples-select.html +2 -1
  48. package/docs/examples-skip-link.html +2 -1
  49. package/docs/examples-spinner.html +2 -1
  50. package/docs/examples-status-item.html +2 -1
  51. package/docs/examples-status.html +2 -1
  52. package/docs/examples-table-advanced.html +2 -1
  53. package/docs/examples-table.html +2 -1
  54. package/docs/examples-tabs.html +2 -1
  55. package/docs/examples-textarea.html +2 -1
  56. package/docs/examples-toggle.html +2 -1
  57. package/docs/examples-tooltip.html +2 -1
  58. package/docs/examples-tree.html +2 -1
  59. package/docs/index.html +6 -1
  60. package/docs/plantillas.html +1 -1
  61. package/package.json +1 -1
  62. package/src/js/aria/Nav.js +55 -0
  63. package/src/js/desy-html.js +14 -0
  64. package/src/js/index.js +3 -1
  65. package/src/templates/components/nav/_examples.nav.njk +3 -1
  66. package/src/templates/components/nav/_template.nav.njk +6 -8
@@ -12,23 +12,28 @@
12
12
  items: [
13
13
  {
14
14
  text: "Inicio",
15
- href: "index.html"
15
+ href: "index.html",
16
+ id: "page-inicio"
16
17
  },
17
18
  {
18
19
  text: "Estilos",
19
- href: "estilos.html"
20
+ href: "estilos.html",
21
+ id: "page-estilos"
20
22
  },
21
23
  {
22
24
  text: "Catálogo",
23
- href: "catalogo.html"
25
+ href: "catalogo.html",
26
+ id: "page-catalogo"
24
27
  },
25
28
  {
26
29
  text: "Componentes",
27
- href: "componentes.html"
30
+ href: "componentes.html",
31
+ id: "page-componentes"
28
32
  },
29
33
  {
30
34
  text: "Plantillas",
31
- href: "plantillas.html"
35
+ href: "plantillas.html",
36
+ id: "page-plantillas"
32
37
  }],
33
38
  attributes: {
34
39
  "aria-label": "Navegación principal"
@@ -49,25 +54,31 @@
49
54
  items: [
50
55
  {
51
56
  text: "Inicio",
52
- href: "index.html"
57
+ href: "index.html",
58
+ id: "mobile-page-inicio"
53
59
  },
54
60
  {
55
61
  text: "Estilos",
56
- href: "estilos.html"
62
+ href: "estilos.html",
63
+ id: "mobile-page-estilos"
57
64
  },
58
65
  {
59
66
  text: "Catálogo",
60
- href: "catalogo.html"
67
+ href: "catalogo.html",
68
+ id: "mobile-page-catalogo"
61
69
  },
62
70
  {
63
71
  text: "Componentes",
64
- href: "componentes.html"
72
+ href: "componentes.html",
73
+ id: "mobile-page-componentes"
65
74
  },
66
75
  {
67
76
  text: "Plantillas",
68
- href: "plantillas.html"
77
+ href: "plantillas.html",
78
+ id: "mobile-page-plantillas"
69
79
  }],
70
80
  attributes: {
81
+ "id": "navegacion-principal-offcanvas",
71
82
  "aria-label": "Navegación principal"
72
83
  }
73
84
  }) }}
@@ -79,231 +90,292 @@
79
90
  items: [
80
91
  {
81
92
  href: "examples-accordion.html",
82
- text: "Accordion"
93
+ text: "Accordion",
94
+ id: "page-examples-accordion"
83
95
  },
84
96
  {
85
97
  href: "examples-accordion-history.html",
86
- text: "Accordion history"
98
+ text: "Accordion history",
99
+ id: "page-examples-accordion-history"
87
100
  },
88
101
  {
89
102
  href: "examples-alert.html",
90
- text: "Alert"
103
+ text: "Alert",
104
+ id: "page-examples-alert"
91
105
  },
92
106
  {
93
107
  href: "examples-breadcrumbs.html",
94
- text: "Breadcrumbs"
108
+ text: "Breadcrumbs",
109
+ id: "page-examples-breadcrumbs"
95
110
  },
96
111
  {
97
112
  href: "examples-button.html",
98
- text: "Button"
113
+ text: "Button",
114
+ id: "page-examples-button"
99
115
  },
100
116
  {
101
117
  href: "examples-button-loader.html",
102
- text: "Button loader"
118
+ text: "Button loader",
119
+ id: "page-examples-button-loader"
103
120
  },
104
121
  {
105
122
  href: "examples-card.html",
106
- text: "Card"
123
+ text: "Card",
124
+ id: "page-examples-card"
107
125
  },
108
126
  {
109
127
  href: "examples-character-count.html",
110
- text: "Character count"
128
+ text: "Character count",
129
+ id: "page-examples-character-count"
111
130
  },
112
131
  {
113
132
  href: "examples-checkboxes.html",
114
- text: "Checkboxes"
133
+ text: "Checkboxes",
134
+ id: "page-examples-checkboxes"
115
135
  },
116
136
  {
117
137
  href: "examples-collapsible.html",
118
- text: "Collapsible"
138
+ text: "Collapsible",
139
+ id: "page-examples-collapsible"
119
140
  },
120
141
  {
121
142
  href: "examples-dialog.html",
122
- text: "Dialog"
143
+ text: "Dialog",
144
+ id: "page-examples-dialog"
123
145
  },
124
146
  {
125
147
  href: "examples-date-input.html",
126
- text: "Date input"
148
+ text: "Date input",
149
+ id: "page-examples-date-input"
127
150
  },
128
151
  {
129
152
  href: "examples-description-list.html",
130
- text: "Description list"
153
+ text: "Description list",
154
+ id: "page-examples-description-list"
131
155
  },
132
156
  {
133
157
  href: "examples-details.html",
134
- text: "Details"
158
+ text: "Details",
159
+ id: "page-examples-details"
135
160
  },
136
161
  {
137
162
  href: "examples-dropdown.html",
138
- text: "Dropdown"
163
+ text: "Dropdown",
164
+ id: "page-examples-dropdown"
139
165
  },
140
166
  {
141
167
  href: "examples-error-message.html",
142
- text: "Error message"
168
+ text: "Error message",
169
+ id: "page-examples-error-message"
143
170
  },
144
171
  {
145
172
  href: "examples-error-summary.html",
146
- text: "Error summary"
173
+ text: "Error summary",
174
+ id: "page-examples-error-summary"
147
175
  },
148
176
  {
149
177
  href: "examples-fieldset.html",
150
- text: "Fieldset"
178
+ text: "Fieldset",
179
+ id: "page-examples-fieldset"
151
180
  },
152
181
  {
153
182
  href: "examples-file-upload.html",
154
- text: "File upload"
183
+ text: "File upload",
184
+ id: "page-examples-file-upload"
155
185
  },
156
186
  {
157
187
  href: "examples-footer.html",
158
- text: "Footer"
188
+ text: "Footer",
189
+ id: "page-examples-footer"
159
190
  },
160
191
  {
161
192
  href: "examples-header.html",
162
- text: "Header"
193
+ text: "Header",
194
+ id: "page-examples-header"
163
195
  },
164
196
  {
165
197
  href: "examples-header-mini.html",
166
- text: "Header mini"
198
+ text: "Header mini",
199
+ id: "page-examples-header-mini"
167
200
  },
168
201
  {
169
202
  href: "examples-header-advanced.html",
170
- text: "Header advanced"
203
+ text: "Header advanced",
204
+ id: "page-examples-header-advanced"
171
205
  },
172
206
  {
173
207
  href: "examples-hint.html",
174
- text: "Hint"
208
+ text: "Hint",
209
+ id: "page-examples-hint"
175
210
  },
176
211
  {
177
212
  href: "examples-input.html",
178
- text: "Input"
213
+ text: "Input",
214
+ id: "page-examples-input"
179
215
  },
180
216
  {
181
217
  href: "examples-input-group.html",
182
- text: "Input group"
218
+ text: "Input group",
219
+ id: "page-examples-input-group"
183
220
  },
184
221
  {
185
222
  href: "examples-item.html",
186
- text: "Item"
223
+ text: "Item",
224
+ id: "page-examples-item"
187
225
  },
188
226
  {
189
227
  href: "examples-label.html",
190
- text: "Label"
228
+ text: "Label",
229
+ id: "page-examples-label"
191
230
  },
192
231
  {
193
232
  href: "examples-links-list.html",
194
- text: "Links list"
233
+ text: "Links list",
234
+ id: "page-examples-links-list"
195
235
  },
196
236
  {
197
237
  href: "examples-listbox.html",
198
- text: "Listbox"
238
+ text: "Listbox",
239
+ id: "page-examples-listbox"
199
240
  },
200
241
  {
201
242
  href: "examples-media-object.html",
202
- text: "Media object"
243
+ text: "Media object",
244
+ id: "page-examples-media-object"
203
245
  },
204
246
  {
205
247
  href: "examples-menu-horizontal.html",
206
- text: "Menu horizontal"
248
+ text: "Menu horizontal",
249
+ id: "page-examples-menu-horizontal"
207
250
  },
208
251
  {
209
252
  href: "examples-menu-navigation.html",
210
- text: "Menu navigation"
253
+ text: "Menu navigation",
254
+ id: "page-examples-menu-navigation"
211
255
  },
212
256
  {
213
257
  href: "examples-menu-vertical.html",
214
- text: "Menu vertical"
258
+ text: "Menu vertical",
259
+ id: "page-examples-menu-vertical"
215
260
  },
216
261
  {
217
262
  href: "examples-menubar.html",
218
- text: "Menubar"
263
+ text: "Menubar",
264
+ id: "page-examples-menubar"
219
265
  },
220
266
  {
221
267
  href: "examples-modal.html",
222
- text: "Modal"
268
+ text: "Modal",
269
+ id: "page-examples-modal"
223
270
  },
224
271
  {
225
272
  href: "examples-nav.html",
226
- text: "Nav"
273
+ text: "Nav",
274
+ id: "page-examples-nav"
227
275
  },
228
276
  {
229
277
  href: "examples-notification.html",
230
- text: "Notification"
278
+ text: "Notification",
279
+ id: "page-examples-notification"
231
280
  },
232
281
  {
233
282
  href: "examples-pagination.html",
234
- text: "Pagination"
283
+ text: "Pagination",
284
+ id: "page-examples-pagination"
235
285
  },
236
286
  {
237
287
  href: "examples-pill.html",
238
- text: "Pill"
288
+ text: "Pill",
289
+ id: "page-examples-pill"
239
290
  },
240
291
  {
241
292
  href: "examples-radios.html",
242
- text: "Radios"
293
+ text: "Radios",
294
+ id: "page-examples-radios"
243
295
  },
244
296
  {
245
297
  href: "examples-searchbar.html",
246
- text: "Searchbar"
298
+ text: "Searchbar",
299
+ id: "page-examples-searchbar"
247
300
  },
248
301
  {
249
302
  href: "examples-select.html",
250
- text: "Select"
303
+ text: "Select",
304
+ id: "page-examples-select"
251
305
  },
252
306
  {
253
307
  href: "examples-skip-link.html",
254
- text: "Skip link"
308
+ text: "Skip link",
309
+ id: "page-examples-skip-link"
255
310
  },
256
311
  {
257
312
  href: "examples-spinner.html",
258
- text: "Spinner"
313
+ text: "Spinner",
314
+ id: "page-examples-spinner"
259
315
  },
260
316
  {
261
317
  href: "examples-status.html",
262
- text: "Status"
318
+ text: "Status",
319
+ id: "page-examples-status"
263
320
  },
264
321
  {
265
322
  href: "examples-status-item.html",
266
- text: "Status item"
323
+ text: "Status item",
324
+ id: "page-examples-status-item"
267
325
  },
268
326
  {
269
327
  href: "examples-table.html",
270
- text: "Table"
328
+ text: "Table",
329
+ id: "page-examples-table"
271
330
  },
272
331
  {
273
332
  href: "examples-table-advanced.html",
274
- text: "Table advanced"
333
+ text: "Table advanced",
334
+ id: "page-examples-table-advanced"
275
335
  },
276
336
  {
277
337
  href: "examples-tabs.html",
278
- text: "Tabs"
338
+ text: "Tabs",
339
+ id: "page-examples-tabs"
279
340
  },
280
341
  {
281
342
  href: "examples-textarea.html",
282
- text: "Textarea"
343
+ text: "Textarea",
344
+ id: "page-examples-textarea"
283
345
  },
284
346
  {
285
347
  href: "examples-toggle.html",
286
- text: "Toggle"
348
+ text: "Toggle",
349
+ id: "page-examples-toggle"
287
350
  },
288
351
  {
289
352
  href: "examples-tooltip.html",
290
- text: "Tooltip"
353
+ text: "Tooltip",
354
+ id: "page-examples-tooltip"
291
355
  },
292
356
  {
293
357
  href: "examples-tree.html",
294
- text: "Tree"
358
+ text: "Tree",
359
+ id: "page-examples-tree"
295
360
  }],
296
361
  attributes: {
362
+ "id": "navegacion-ejemplos-offcanvas",
297
363
  "aria-label": "Navegación ejemplos"
298
364
  }
299
365
  }) }}
300
366
  </li>
301
367
  </ul>
302
368
  {% endcall %}
303
- {% if activeSection != undefined %}
369
+ {% if activePage != undefined or activeComponent != undefined %}
304
370
  <script>
305
371
  window.addEventListener("load", function(event) {
306
- activateItemHeaderNavigation("header-nav-item", "{{ activeSection }}");
372
+ {% if activePage %}
373
+ activateItemHeaderNavigation("header-nav-item", "{{ activePage }}");
374
+ activateItemNav("navegacion-principal-offcanvas", "mobile-{{ activePage }}");
375
+ {% endif %}
376
+ {% if activeComponent %}
377
+ activateItemNav("navegacion-ejemplos-offcanvas", "page-examples-{{ activeComponent | filterslugify }}");
378
+ {% endif %}
307
379
  });
308
380
  </script>
309
381
  {% endif %}
@@ -1,5 +1,5 @@
1
1
  {% set title = "Catálogo visual de componentes. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-3" %}
2
+ {% set activePage = "page-catalogo" %}
3
3
  {% extends "_template.default.njk" %}
4
4
  {% block contentBlock %}
5
5
  <div class="pb-lg"></div>
@@ -1,5 +1,5 @@
1
1
  {% set title = "Lista de componentes. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+ {% set activePage = "page-componentes" %}
3
3
  {% extends "_template.default.njk" %}
4
4
 
5
5
  {% from "components/menu-vertical/_macro.menu-vertical.njk" import componentMenuVertical %}
package/docs/estilos.html CHANGED
@@ -1,5 +1,5 @@
1
1
  {% set title = "Estilos: colores, espaciado, retícula y tipografía. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-2" %}
2
+ {% set activePage = "page-estilos" %}
3
3
  {% extends "_template.default.njk" %}
4
4
 
5
5
  {% block contentBlock %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Accordion history. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Accordion history" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/accordion-history/_examples.accordion-history.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Accordion. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Accordion" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/accordion/_examples.accordion.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Alert. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Alert" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/alert/_examples.alert.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Breadcrumbs. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Breadcrumbs" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/breadcrumbs/_examples.breadcrumbs.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Button loader. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Button loader" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/button-loader/_examples.button-loader.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Button. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Button" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/button/_examples.button.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Card. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Card" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/card/_examples.card.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Character count. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Character count" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/character-count/_examples.character-count.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Checkboxes. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Checkboxes" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/checkboxes/_examples.checkboxes.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Collapsible. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Collapsible" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/collapsible/_examples.collapsible.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Date input. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Date input" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/date-input/_examples.date-input.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Description list. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Description list" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/description-list/_examples.description-list.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Details. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Details" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/details/_examples.details.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Dialog. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Dialog" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/dialog/_examples.dialog.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Dropdown. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Dropdown" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/dropdown/_examples.dropdown.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Error message. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Error message" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/error-message/_examples.error-message.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Error summary. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Error summary" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/error-summary/_examples.error-summary.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Fieldset. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Fieldset" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/fieldset/_examples.fieldset.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "File upload. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "File upload" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/file-upload/_examples.file-upload.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Footer. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Footer" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/footer/_examples.footer.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Header advanced. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Header advanced" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/header-advanced/_examples.header-advanced.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Header mini. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Header mini" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/header-mini/_examples.header-mini.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Header. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Header" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/header/_examples.header.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Hint. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Hint" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/hint/_examples.hint.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Input group. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Input group" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/input-group/_examples.input-group.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Input. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Input" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/input/_examples.input.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Item. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Item" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/item/_examples.item.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Label. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Label" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/label/_examples.label.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Links list. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Links list" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/links-list/_examples.links-list.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Listbox. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Listbox" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/listbox/_examples.listbox.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Media object. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Media object" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/media-object/_examples.media-object.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Menu horizontal. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Menu horizontal" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/menu-horizontal/_examples.menu-horizontal.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Menu navigation. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Menu navigation" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/menu-navigation/_examples.menu-navigation.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Menu vertical. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Menu vertical" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/menu-vertical/_examples.menu-vertical.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Menubar. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Menubar" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/menubar/_examples.menubar.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Modal. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Modal" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/modal/_examples.modal.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Nav. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Nav" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/nav/_examples.nav.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Notification. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Notification" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/notification/_examples.notification.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Pagination. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Pagination" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/pagination/_examples.pagination.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Pill. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Pill" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/pill/_examples.pill.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Radios. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Radios" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/radios/_examples.radios.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Searchbar. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Searchbar" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/searchbar/_examples.searchbar.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Select. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Select" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/select/_examples.select.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Skip link. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Skip link" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/skip-link/_examples.skip-link.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Spinner. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Spinner" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/spinner/_examples.spinner.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Status item. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Status item" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/status-item/_examples.status-item.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Status. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Status" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/status/_examples.status.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Table advanced. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Table advanced" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/table-advanced/_examples.table-advanced.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Table. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Table" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/table/_examples.table.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Tabs. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Tabs" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/tabs/_examples.tabs.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Textarea. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Textarea" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/textarea/_examples.textarea.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Toggle. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Toggle" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/toggle/_examples.toggle.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Tooltip. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Tooltip" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/tooltip/_examples.tooltip.njk" as exampleData %}
@@ -1,5 +1,6 @@
1
1
  {% set title = "Tree. Componente, parámetros y ejemplos. Documentación de desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-4" %}
2
+
3
+ {% set activeComponent = "Tree" %}
3
4
  {% extends "_template.examples.njk" %}
4
5
  {% block contentBlock %}
5
6
  {% import "components/tree/_examples.tree.njk" as exampleData %}
package/docs/index.html CHANGED
@@ -1,6 +1,6 @@
1
1
  {% set title = "Desy. Sistema de diseño para aplicaciones web. Gobierno de Aragón" %}
2
2
  {% set description = "Documentación y librería desy-html para implementarlo en HTML, CSS y Javascript con un paquete NPM." %}
3
- {% set activeSection = "header-nav-item-1" %}
3
+ {% set activePage = "page-inicio" %}
4
4
  {% extends "_template.default.njk" %}
5
5
  {% block contentBlock %}
6
6
 
@@ -38,6 +38,11 @@
38
38
 
39
39
  <h2>Changelog (English)</h2>
40
40
  <p>What's new in the latest version of desy-html</p>
41
+ <h3>v.8.4.0</h3>
42
+ <ul class="text-sm">
43
+ <li>Added global function to select an item in Nav.</li>
44
+ <li>Docs now show the active section in offcanvas menus.</li>
45
+ </ul>
41
46
  <h3>v.8.3.1</h3>
42
47
  <ul class="text-sm">
43
48
  <li>Minor fixes.</li>
@@ -1,5 +1,5 @@
1
1
  {% set title = "Plantillas para desy-html. Gobierno de Aragón" %}
2
- {% set activeSection = "header-nav-item-5" %}
2
+ {% set activePage = "page-plantillas" %}
3
3
  {% extends "_template.default.njk" %}
4
4
 
5
5
  {% block contentBlock %}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "desy-html",
3
- "version": "8.3.1",
3
+ "version": "8.4.0",
4
4
  "description": "desy-html contains the code you need to start building a user interface for Gobierno de Aragón government webapps.",
5
5
  "author": {
6
6
  "name": "Desy (SDA Servicios Digitales de Aragón)",
@@ -0,0 +1,55 @@
1
+ export function Nav(aria) {
2
+ (function () {
3
+ aria.Nav = function (domNode) {
4
+ this.domNode = domNode;
5
+ };
6
+
7
+ aria.Nav.prototype.init = function () {
8
+ this.valueActive = this.domNode.dataset.menuActive;
9
+ if (this.valueActive) {
10
+ this.activateElement(this.valueActive);
11
+ }
12
+ };
13
+
14
+ aria.Nav.prototype.activateElement = function (elementActive) {
15
+ this.domNode.querySelectorAll('li').forEach((element) => {
16
+ const getLink = element.querySelector('a') || element.querySelector('span');
17
+ if (getLink) {
18
+ if (getLink.id === elementActive) {
19
+ this.wrapActiveElement(getLink);
20
+ } else {
21
+ this.deactivateElement(getLink);
22
+ }
23
+ }
24
+ });
25
+ };
26
+
27
+ aria.Nav.prototype.wrapActiveElement = function (elementActive) {
28
+ elementActive.setAttribute('aria-current', 'true');
29
+ elementActive.innerHTML = `<strong>${elementActive.textContent}</strong>`;
30
+ };
31
+
32
+ aria.Nav.prototype.deactivateElement = function (elementDeactivated) {
33
+ elementDeactivated.removeAttribute('aria-current');
34
+ elementDeactivated.innerHTML = elementDeactivated.textContent;
35
+ };
36
+
37
+ window.activateItemNav = function (menuId, activeItemId) {
38
+ const menu = document.getElementById(menuId);
39
+ if (menu) {
40
+ const activeItem = document.querySelector(`#${menuId} #${activeItemId}`);
41
+ if (activeItem) {
42
+ const menuInstance = new aria.Nav(menu);
43
+ menuInstance.activateElement(activeItemId);
44
+ return [menu, activeItem];
45
+ } else {
46
+ console.log('There is no element with this id in the menu.');
47
+ return null;
48
+ }
49
+ } else {
50
+ console.log('There is no menu with this id in the document.');
51
+ return null;
52
+ }
53
+ };
54
+ }());
55
+ }
@@ -19,6 +19,7 @@ import { RadioButton } from './aria/radioButton.js';
19
19
  import { CheckBox } from './aria/checkBoxes.js';
20
20
  import { MenuVertical } from './aria/MenuVertical.js';
21
21
  import { HeaderNavigation } from './aria/HeaderNavigation.js';
22
+ import { Nav } from './aria/Nav.js';
22
23
 
23
24
 
24
25
  export function accordionComponent(aria) {
@@ -405,3 +406,16 @@ export function HeaderNavigationComponent(aria) {
405
406
  }
406
407
  }
407
408
  }
409
+
410
+ export function NavComponent(aria) {
411
+ Nav(aria);
412
+ const modules = document.querySelectorAll('[data-module]');
413
+ for (const item in modules) if (modules.hasOwnProperty(item)) {
414
+ const moduleValue = modules[item].getAttribute('data-module');
415
+
416
+ if (moduleValue == 'c-nav'){
417
+ const nav = new aria.Nav(modules[item]);
418
+ nav.init(null);
419
+ }
420
+ }
421
+ }
package/src/js/index.js CHANGED
@@ -21,7 +21,8 @@ import {
21
21
  radioButtonComponent,
22
22
  checkBoxComponent,
23
23
  MenuVerticalComponent,
24
- HeaderNavigationComponent
24
+ HeaderNavigationComponent,
25
+ NavComponent
25
26
  } from './desy-html.js';
26
27
 
27
28
  var aria = aria || {};
@@ -44,6 +45,7 @@ radioButtonComponent(aria);
44
45
  checkBoxComponent(aria);
45
46
  MenuVerticalComponent(aria);
46
47
  HeaderNavigationComponent(aria);
48
+ NavComponent(aria);
47
49
 
48
50
  //Using the browser API to copy code to the clipboard
49
51
  const copyButtons = document.querySelectorAll('[data-module = "c-button-copy"]');
@@ -65,6 +65,7 @@
65
65
  },
66
66
  {
67
67
  "name": "con item activo",
68
+ "description": 'Añade <code>active: true</code> a un item para mostrarlo activo inicialmente. También puedes usar con javascript la función global <code>activateItemNav(elementMenu, idItemSeleccionado)</code> para seleccionar un item de un menú, usando sus ids. Ej: Abre la consola del navegador y escribe <code>activateItemNav("mi-menu", "nav-with-active-item-3")</code> para desactivar el item actual y activar el tercer item de este ejemplo.',
68
69
  "data": {
69
70
  "idPrefix": "nav-with-active-item",
70
71
  "items": [
@@ -82,7 +83,7 @@
82
83
  },
83
84
  {
84
85
  "href": "#",
85
- "text": "Opción 4 activa",
86
+ "text": "Opción 4",
86
87
  "active": true
87
88
  },
88
89
  {
@@ -91,6 +92,7 @@
91
92
  }
92
93
  ],
93
94
  "attributes": {
95
+ "id": "mi-menu",
94
96
  "aria-label": "Navegación local"
95
97
  }
96
98
  }
@@ -2,7 +2,7 @@
2
2
  instead -#}
3
3
  {% set idPrefix = params.idPrefix if params.idPrefix else "nav-item" %}
4
4
 
5
- {% set commonAttributes %} class="text-sm{%- if params.classes %} {{ params.classes }}{% endif %}"
5
+ {% set commonAttributes %} data-module="c-nav" class="text-sm{%- if params.classes %} {{ params.classes }}{% endif %}"
6
6
  {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}{% endset %}
7
7
 
8
8
 
@@ -17,20 +17,18 @@
17
17
  {% else %}
18
18
  {% set id = idPrefix + "-" + loop.index %}
19
19
  {% endif %}
20
- {% set commonItemAttributes %}{% if id %} id="{{ id }}"{% endif %} {%- if item.title %} title="{{ item.title }}"{% endif %} {%- for attribute, value in item.attributes %} {{ attribute }}="{{ value }}"{% endfor %}{% endset %}
20
+ {% set commonItemAttributes %} {% if id %} id="{{ id }}"{% endif %} {%- if item.title %} title="{{ item.title }}"{% endif %} {%- for attribute, value in item.attributes %} {{ attribute }}="{{ value }}"{% endfor %}{% endset %}
21
21
  <li>
22
- {% if item.active %}
23
- <span class="flex items-center px-base py-sm font-semibold {%- if item.classes %} {{ item.classes }}{% endif -%}" {% if params.isMenu %} aria-current="true" {% else %} aria-current="page" {% endif %} {{- commonItemAttributes | safe }}>
24
- <strong>{{ item.html | safe if item.html else item.text }}</strong>
25
- </span>
26
- {% else %}
27
22
  <a href="{{ item.href }}" class="flex items-center px-base py-sm hover:bg-primary-base hover:text-white focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black{%- if item.classes %} {{ item.classes }}{% endif -%} {%- if item.disabled %} pointer-events-none{% endif -%}" {%- if item.disabled %} aria-disabled="true" tabindex="-1"{% endif -%} {%- if item.target %} target="{{ item.target }}"{% endif %} {{- commonItemAttributes | safe }}>
23
+ {% if item.active %}
24
+ <strong>{{ item.html | safe if item.html else item.text }}</strong>
25
+ {% else %}
28
26
  {{ item.html | safe if item.html else item.text }}
27
+ {% endif %}
29
28
  {% if item.disabled %}
30
29
  <svg viewBox="0 0 140 140" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg" class="inline-block align-middle ml-sm text-neutral-base fill-current" aria-hidden="true" focusable="false" ><path d="M70 0a70 70 0 1070 70A70.08 70.08 0 0070 0zM20 70a50 50 0 0174.8-43.4 2.51 2.51 0 011.23 1.84 2.48 2.48 0 01-.71 2.1L30.54 95.32a2.51 2.51 0 01-3.94-.52A49.63 49.63 0 0120 70zm100 0a50 50 0 01-74.8 43.4 2.51 2.51 0 01-1.23-1.84 2.48 2.48 0 01.71-2.1l64.78-64.78a2.51 2.51 0 013.94.52A49.63 49.63 0 01120 70z"/></svg>
31
30
  {% endif %}
32
31
  </a>
33
- {% endif %}
34
32
  </li>
35
33
  {% if item.divider %}
36
34
  <li class="my-sm border-b border-neutral-base" aria-hidden="true">