desy-html 8.5.0 → 8.7.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 (35) hide show
  1. package/docs/_macro.example-render.njk +1 -1
  2. package/docs/_macro.show-code-from-file.njk +4 -4
  3. package/docs/_macro.show-html-from-file.njk +4 -3
  4. package/docs/ds/_ds.example.layout-escritorio.njk +12 -12
  5. package/docs/ds/_ds.example.layout-movil.njk +4 -4
  6. package/docs/ds/_ds.example.layout-sidebar.njk +1 -1
  7. package/docs/ds/_ds.example.typography.njk +1 -1
  8. package/docs/ds/_ds.macro.code-snippet.njk +2 -2
  9. package/docs/ds/_ds.macro.section-title.njk +1 -1
  10. package/docs/ds/_ds.macro.subsection-title.njk +1 -1
  11. package/docs/ds/_ds.section.espaciado.njk +154 -16
  12. package/docs/ds/_ds.section.textos.njk +216 -142
  13. package/docs/index.html +12 -0
  14. package/package.json +1 -1
  15. package/src/js/aria/MenuHorizontal.js +58 -0
  16. package/src/js/aria/MenuNavigation.js +115 -0
  17. package/src/js/aria/MenubarAction.js +210 -164
  18. package/src/js/aria/tabs.js +4 -4
  19. package/src/js/desy-html.js +20 -0
  20. package/src/js/index.js +4 -0
  21. package/src/templates/components/accordion/_template.accordion.njk +2 -1
  22. package/src/templates/components/accordion-history/_template.accordion-history.njk +2 -1
  23. package/src/templates/components/header/_template.header.header__offcanvas.njk +1 -0
  24. package/src/templates/components/header/_template.header.header__offcanvasButton.njk +1 -0
  25. package/src/templates/components/menu-horizontal/_examples.menu-horizontal.njk +5 -3
  26. package/src/templates/components/menu-horizontal/_template.menu-horizontal.njk +2 -2
  27. package/src/templates/components/menu-navigation/_examples.menu-navigation.njk +90 -63
  28. package/src/templates/components/menu-navigation/_styles.menu-navigation.css +4 -0
  29. package/src/templates/components/menu-navigation/_template.menu-navigation.njk +5 -21
  30. package/src/templates/components/menu-navigation/params.menu-navigation.yaml +4 -0
  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
@@ -106,6 +106,7 @@
106
106
  },
107
107
  {
108
108
  "name": "con item activo",
109
+ "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>activateItemMenuNavigation(elementMenu, idItemSeleccionado)</code> para seleccionar un item de un menú, usando sus ids. Ej: Abre la consola del navegador y escribe <code>activateItemMenuNavigation("mi-menu", "with-active-item-example-3")</code> para desactivar el item actual y activar el tercer item de este ejemplo.',
109
110
  "data": {
110
111
  "idPrefix": "with-active-item-example",
111
112
  "items": [
@@ -124,7 +125,91 @@
124
125
  }
125
126
  ],
126
127
  "attributes": {
127
- "aria-label": "Menu navigation"
128
+ "aria-label": "Menu navigation",
129
+ "id": "mi-menu"
130
+ }
131
+ }
132
+ },
133
+ {
134
+ "name": "con sub-item activo",
135
+ "description": 'Añade <code>active: true</code> a un sub-item para mostrarlo activo inicialmente. También puedes usar con javascript la función global <code>activateSubItemMenuNavigation(elementMenu, idItemSeleccionado)</code> para seleccionar un sub-item de un menú, usando sus ids. Ej: Abre la consola del navegador y escribe <code>activateSubItemMenuNavigation("mi-sub-menu", "sub-active-sub-item-example-2-2")</code> para desactivar el sub-item actual y activar el tercer sub-item de este ejemplo.',
136
+ "data": {
137
+ "idPrefix": "with-active-sub-item-example",
138
+ "items": [
139
+ {
140
+ "text": "Item 1",
141
+ "id": "active-sub-item-example-1",
142
+ "sub": {
143
+ "items": [
144
+ {
145
+ "href": "#",
146
+ "text": "Subitem 1"
147
+ },
148
+ {
149
+ "href": "#",
150
+ "text": "Subitem 2",
151
+ "active": true
152
+ },
153
+ {
154
+ "href": "#",
155
+ "text": "Subitem 3"
156
+ }
157
+ ],
158
+ "attributes": {
159
+ "aria-labelledby": "active-sub-item-example-item-1"
160
+ }
161
+ }
162
+ },
163
+ {
164
+ "text": "Item 2",
165
+ "id": "active-sub-item-example-2",
166
+ "sub": {
167
+ "items": [
168
+ {
169
+ "href": "#",
170
+ "text": "Subitem 1"
171
+ },
172
+ {
173
+ "href": "#",
174
+ "text": "Subitem 2"
175
+ },
176
+ {
177
+ "href": "#",
178
+ "text": "Subitem 3"
179
+ }
180
+ ],
181
+ "attributes": {
182
+ "aria-labelledby": "active-sub-item-example-item-2"
183
+ }
184
+ }
185
+ },
186
+ {
187
+ "text": "Item 3",
188
+ "id": "active-sub-item-example-3",
189
+ "sub": {
190
+ "items": [
191
+ {
192
+ "href": "#",
193
+ "text": "Subitem 1"
194
+ },
195
+ {
196
+ "href": "#",
197
+ "text": "Subitem 2"
198
+ },
199
+ {
200
+ "href": "#",
201
+ "text": "Subitem 3"
202
+ }
203
+ ],
204
+ "attributes": {
205
+ "aria-labelledby": "active-sub-item-example-item-2"
206
+ }
207
+ }
208
+ }
209
+ ],
210
+ "attributes": {
211
+ "aria-label": "Menu navigation",
212
+ "id": "mi-sub-menu"
128
213
  }
129
214
  }
130
215
  },
@@ -598,65 +683,6 @@
598
683
  }
599
684
  }
600
685
  },
601
- {
602
- "name": "con un item hijo activo",
603
- "data": {
604
- "idPrefix": "nav-item-with-children-active",
605
- "items": [
606
- {
607
- "text": "Item 1",
608
- "id": "nav-item-item-1-a",
609
- "sub": {
610
- "items": [
611
- {
612
- "href": "#",
613
- "text": "Subitem 1"
614
- },
615
- {
616
- "href": "#",
617
- "text": "Subitem 2",
618
- "active": true
619
- },
620
- {
621
- "href": "#",
622
- "text": "Subitem 3"
623
- }
624
- ],
625
- "attributes": {
626
- "aria-labelledby": "nav-item-item-1-a"
627
- }
628
- }
629
- },
630
- {
631
- "text": "Item 2",
632
- "id": "nav-item-item-2-a",
633
- "sub": {
634
- "items": [
635
- {
636
- "href": "#",
637
- "text": "Subitem 1"
638
- },
639
- {
640
- "href": "#",
641
- "text": "Subitem 2",
642
- "active": true
643
- },
644
- {
645
- "href": "#",
646
- "text": "Subitem 3"
647
- }
648
- ],
649
- "attributes": {
650
- "aria-labelledby": "nav-item-item-2-a"
651
- }
652
- }
653
- }
654
- ],
655
- "attributes": {
656
- "aria-label": "Menu navigation"
657
- }
658
- }
659
- },
660
686
  {
661
687
  "name": "con deshabilitado o sin href en un padre e hijo",
662
688
  "data": {
@@ -717,7 +743,7 @@
717
743
  },
718
744
  {
719
745
  "name": "con estilos de cabecera",
720
- "description": 'Un Menu navigation puede estar anidado en <code>customNavigationHtml</code> en el componente Header.',
746
+ "description": 'Un Menu navigation puede estar anidado en <code>customNavigationHtml</code> en el componente Header. Añade <code>active: true</code> a un sub-item para mostrarlo activo inicialmente. También puedes usar con javascript la función global <code>activateSubItemMenuNavigation(elementMenu, idItemSeleccionado)</code> para seleccionar un sub-item de un menú, usando sus ids. Ej: Abre la consola del navegador y escribe <code>activateSubItemMenuNavigation("mi-menu-header", "sub-header-custom-nav-item-1-1")</code> para desactivar el sub-item actual y activar el primer sub-item del primer item de este ejemplo.',
721
747
  "data": {
722
748
  "idPrefix": "header-custom-nav",
723
749
  "classes": "bg-neutral-lighter c-menu-navigation--last-right w-full",
@@ -823,7 +849,8 @@
823
849
  }
824
850
  ],
825
851
  "attributes": {
826
- "aria-label": "Menu navigation"
852
+ "aria-label": "Menu navigation",
853
+ "id": "mi-menu-header"
827
854
  }
828
855
  }
829
856
  },
@@ -1076,4 +1103,4 @@
1076
1103
  }
1077
1104
  }
1078
1105
  }
1079
- ] %}
1106
+ ] %}
@@ -78,6 +78,10 @@
78
78
  @apply cursor-not-allowed;
79
79
  @apply pointer-events-none;
80
80
  }
81
+
82
+ &[aria-expanded="true"] + .c-menu-navigation__sub {
83
+ @apply z-40;
84
+ }
81
85
  }
82
86
 
83
87
 
@@ -14,7 +14,7 @@
14
14
 
15
15
  {#- Capture the HTML so we can optionally nest it in a fieldset -#}
16
16
  {% set innerHtml %}
17
- <ul data-module="c-menu-navigation" class="flex flex-wrap gap-base">
17
+ <ul class="flex flex-wrap gap-base c-menu-navigation__list">
18
18
  {% for item in params.items %}
19
19
  {% if item %}
20
20
  {#- If the user explicitly sets an id, use this instead of the regular idPrefix -#}
@@ -38,7 +38,7 @@
38
38
  {% endif %}
39
39
  {% if item.sub.items %}
40
40
  <div class="c-menu-navigation__sub absolute bottom-0 left-0">
41
- <ul id="{{ id }}-sub-list" class="{% if item.sub.classes %}{{ item.sub.classes }}{% else-%} c-menu-navigation__tooltip w-max max-w-64 border border-neutral-base shadow-md bg-white text-sm{% endif %}" {%- for attribute, value in item.sub.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
41
+ <ul id="{{ id }}-sub-list" class="c-menu-navigation__sub--list {% if item.sub.classes %}{{ item.sub.classes }}{% else-%} c-menu-navigation__tooltip w-max max-w-64 border border-neutral-base shadow-md bg-white text-sm{% endif %}" {%- for attribute, value in item.sub.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
42
42
  {% for subitem in item.sub.items %}
43
43
  {% if subitem %}
44
44
  {#- If the user explicitly sets an id, use this instead of the regular idPrefix -#}
@@ -49,28 +49,12 @@
49
49
  {%- endif %}
50
50
  {% set commonSubItemAttributes %}{% if subId %} id="{{ subId }}"{% endif %} {%- if subitem.title %} title="{{ subitem.title }}"{% endif %} {%- for attribute, value in subitem.attributes %} {{ attribute }}="{{ value }}"{% endfor %}{% endset %}
51
51
  <li>
52
- {% if subitem.href %}
53
- {% if subitem.active %}
54
- <span {%- if subitem.id %} id="{{ subId }}"{% endif %} class="flex items-center px-base py-sm text-sm {%- if subitem.classes %} {{ subitem.classes }}{% endif -%}" aria-current="page" {{- commonSubItemAttributes | safe }}>
55
- <strong class="font-bold">{{ subitem.html | safe if subitem.html else subitem.text }}</strong>
56
- </span>
57
- {% else %}
58
- <a {%- if subitem.id %} id="{{ subId }}"{% endif %} href="{{ subitem.href }}" class="flex items-center px-base py-sm text-sm hover:bg-primary-base hover:text-white focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black{%- if subitem.classes %} {{ subitem.classes }}{% endif -%} {%- if subitem.disabled %} pointer-events-none{% endif -%}" {%- if subitem.disabled %} tabindex="-1"{% endif -%} {%- if subitem.target %} target="{{ subitem.target }}"{% endif %} {{- commonSubItemAttributes | safe }}>
52
+ <a aria-current="{%- if subitem.active %}true{% else %}false{% endif -%}" {%- if subitem.id %} id="{{ subId }}"{% endif %} href="{{ subitem.href }}" class="flex items-center px-base py-sm text-sm hover:bg-primary-base hover:text-white focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black{%- if subitem.classes %} {{ subitem.classes }}{% endif -%} {%- if subitem.disabled %} pointer-events-none{% endif -%}" {%- if subitem.disabled %} tabindex="-1"{% endif -%} {%- if subitem.target %} target="{{ subitem.target }}"{% endif %} {{- commonSubItemAttributes | safe }}>
59
53
  {{ subitem.html | safe if subitem.html else subitem.text }}
60
54
  {% if subitem.disabled %}
61
55
  <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>
62
56
  {% endif %}
63
57
  </a>
64
- {% endif %}
65
- {% else %}
66
- <span {%- if subitem.id %} id="{{ subId }}"{% endif %} class="flex items-center px-base py-sm text-sm {%- if subitem.classes %} {{ subitem.classes }}{% endif %} {%- if subitem.active %} font-bold{% endif %} {%- if subitem.active %} font-bold{% endif %}" {%- if subitem.title %} title="{{ subitem.title }}"{% endif %} {%- if subitem.active %} aria-current="page"{% endif %} {%- if subitem.disabled %} aria-disabled="true" tabindex="-1"{% endif %} {%- for attribute, value in subitem.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
67
- {% if subitem.active %}
68
- <strong class="font-bold">{{ subitem.html | safe if subitem.html else subitem.text }}</strong>
69
- {% else %}
70
- {{ subitem.html | safe if subitem.html else subitem.text }}
71
- {% endif %}
72
- </span>
73
- {% endif %}
74
58
  </li>
75
59
  {% if subitem.divider %}
76
60
  <li class="my-sm border-b border-neutral-base">
@@ -98,8 +82,8 @@
98
82
  {% endset -%}
99
83
 
100
84
  <!-- menu-navigation -->
101
- <nav {%- if params.classes %} class="{{ params.classes }}"{% endif %}
85
+ <nav data-module="c-menu-navigation" {%- if params.classes %} class="{{ params.classes }}"{% endif %}
102
86
  {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
103
87
  {{ innerHtml | trim | safe }}
104
88
  </nav>
105
- <!-- /menu-navigation -->
89
+ <!-- /menu-navigation -->
@@ -76,3 +76,7 @@ params:
76
76
  type: object
77
77
  required: false
78
78
  description: HTML attributes (for example data attributes) to add to the nav container.
79
+ - name: active
80
+ type: boolean
81
+ required: false
82
+ description: If true, item will be active.
@@ -2,7 +2,7 @@
2
2
  {% set examples = [
3
3
  {
4
4
  "name": "Por defecto",
5
- "description": "El menubar se usa para interactuar con él y realizar cambios en otra parte de la página, no como menú de navegación. Si necesitas una navegación con enlaces, debes usas el componente Menu navigation en vez de este Menubar. Este ejmplo muestra parámetros mixtos.",
5
+ "description": "El menubar se usa para interactuar con él y realizar cambios en otra parte de la página, no como menú de navegación. Si necesitas una navegación con enlaces, debes usas el componente Menu navigation en vez de este Menubar. Este ejemplo muestra parámetros mixtos.",
6
6
  "data": {
7
7
  "id": "with-all-parent-items-1",
8
8
  "idPrefix": "parent-example",
@@ -154,7 +154,7 @@
154
154
  },
155
155
  {
156
156
  "name": "Tiene selección en items padres",
157
- "description": "Cuando se ha seleccionado algún elemento hijo, el padre se muestra con color.",
157
+ "description": "Cuando se ha seleccionado algún elemento hijo, si se desea, el padre se puede mostrar con color usando la clase <code>.c-menubar__button--has-selection</code>.",
158
158
  "data": {
159
159
  "id": "with-all-parent-items-2",
160
160
  "idPrefix": "parent-example",
@@ -306,6 +306,159 @@
306
306
  ]
307
307
  }
308
308
  },
309
+ {
310
+ "name": "Con sub-item activo",
311
+ "description": "Cuando se ha seleccionado algún elemento hijo, el padre se muestra con color. Añade <code>active: true</code> a un sub-item para mostrarlo activo inicialmente. También puedes usar con javascript la función global <code>activateItemMenuBarAction(elementMenu, idItemSeleccionado)</code> para seleccionar un sub-item o varios sub-items de un menú, usando sus ids. Ej: Abre la consola del navegador y escribe <code>activateItemMenuBarAction('mi-menubar', 'sub-sub-menuitems-example-item-3-2-1-1')</code> para desactivar el sub-item actual y activar el primer sub-item del tercer menú de este ejemplo. Si quieres activar varios sub-items, abre la consola del navegador y escribe <code>activateItemMenuBarAction('mi-menubar', ['sub-menuitems-example-item-2-2-1', 'sub-menuitems-example-item-2-2-2', 'sub-menuitems-example-item-2-2-3'])</code>.",
312
+ "data": {
313
+ "id": "mi-menubar",
314
+ "idPrefix": "parent-example",
315
+ "ariaLabel":"Menubar descrición",
316
+ "items": [
317
+ {
318
+ "text": "Menuitem",
319
+ "ariaLabel": "Menuitem",
320
+ "id": "menuitems-example-item-1-2",
321
+ "sub": {
322
+ "items": [
323
+ {
324
+ "role": "menuitem",
325
+ "text": "Subitem 1"
326
+ },
327
+ {
328
+ "role": "menuitem",
329
+ "text": "Subitem 2"
330
+ },
331
+ {
332
+ "role": "menuitem",
333
+ "text": "Subitem 3"
334
+ }
335
+ ]
336
+ },
337
+ "classes": "mb-base mr-base"
338
+ },
339
+ {
340
+ "text": "Menuitemcheckbox",
341
+ "ariaLabel": "Menuitemcheckbox",
342
+ "id": "menuitems-example-item-2-2",
343
+ "classes": "mb-base mr-base",
344
+ "sub": {
345
+ "items": [
346
+ {
347
+ "role": "menuitemcheckbox",
348
+ "text": "Subitem 1"
349
+ },
350
+ {
351
+ "role": "menuitemcheckbox",
352
+ "text": "Subitem 2",
353
+ "active": true
354
+ },
355
+ {
356
+ "role": "menuitemcheckbox",
357
+ "text": "Subitem 3"
358
+ }
359
+ ]
360
+ }
361
+ },
362
+ {
363
+ "text": "Menuitemradio",
364
+ "ariaLabel": "Menuitemradio",
365
+ "id": "menuitems-example-item-3-2",
366
+ "sub": {
367
+ "items": [
368
+ {
369
+ "role": "group",
370
+ "ariaLabel": "group label",
371
+ "items": [
372
+ {
373
+ "role": "menuitemradio",
374
+ "text": "Radio 1"
375
+ },
376
+ {
377
+ "role": "menuitemradio",
378
+ "text": "Radio 2"
379
+ },
380
+ {
381
+ "role": "menuitemradio",
382
+ "text": "Radio 3"
383
+ }
384
+ ]
385
+ }
386
+ ]
387
+ },
388
+ "classes": "mb-base mr-base"
389
+ },
390
+ {
391
+ "text": "Items mixtos",
392
+ "ariaLabel": "Items mixtos",
393
+ "id": "menuitems-example-item-4-2",
394
+ "sub": {
395
+ "items": [
396
+ {
397
+ "role": "group",
398
+ "ariaLabel": "Tamaño de letra",
399
+ "items": [
400
+ {
401
+ "role": "menuitem",
402
+ "text": "Tamaño mayor"
403
+ },
404
+ {
405
+ "role": "menuitem",
406
+ "text": "Tamaño menor"
407
+ }
408
+ ]
409
+ },
410
+ {
411
+ "role": "separator"
412
+ },
413
+ {
414
+ "role": "group",
415
+ "ariaLabel": "Estilo de letra",
416
+ "items": [
417
+ {
418
+ "role": "menuitemcheckbox",
419
+ "text": "Negritas"
420
+ },
421
+ {
422
+ "role": "menuitemcheckbox",
423
+ "text": "Itálicas"
424
+ }
425
+ ]
426
+ },
427
+ {
428
+ "role": "separator"
429
+ },
430
+ {
431
+ "role": "group",
432
+ "ariaLabel": "Estilo de texto",
433
+ "items": [
434
+ {
435
+ "role": "menuitemradio",
436
+ "text": "Ninguno"
437
+ },
438
+ {
439
+ "role": "menuitemradio",
440
+ "text": "Tachado"
441
+ },
442
+ {
443
+ "role": "menuitemradio",
444
+ "text": "Subrayado"
445
+ }
446
+ ]
447
+ }
448
+ ]
449
+ },
450
+ "classes": "mb-base mr-base"
451
+ },
452
+ {
453
+ "text": "Menuitem solo",
454
+ "ariaLabel": "Menuitem solo",
455
+ "id": "menuitems-example-item-6-2",
456
+ "classes": "c-menubar__button--transparent mb-base mr-base",
457
+ "href": "#"
458
+ }
459
+ ]
460
+ }
461
+ },
309
462
  {
310
463
  "name": "con un item padre deshabilitado",
311
464
  "data": {
@@ -1467,4 +1620,4 @@
1467
1620
  ]
1468
1621
  }
1469
1622
  }
1470
- ] %}
1623
+ ] %}
@@ -23,7 +23,7 @@
23
23
  {% set subId = "sub-" + id %}
24
24
  <li class="relative" role="none">
25
25
  {% if item.sub %}
26
- <a href="#" role="menuitem" aria-haspopup="true" aria-expanded="false" class="c-menubar__button {%- if item.classes %} {{ item.classes }}{% endif %} {%- if item.disabled %} c-menubar__button--disabled{% endif %} {%- if item.active %} c-menubar__button--primary{% endif %}" {%- if item.title %} title="{{ item.title }}"{% endif %} {% if item.disabled %} aria-disabled="true" tabindex="-1"{% endif %} id="{{ id }}"
26
+ <a href="#" role="menuitem" aria-haspopup="true" aria-expanded="false" class="c-menubar__button {%- if item.classes %} {{ item.classes }}{% endif %} {%- if item.disabled %} c-menubar__button--disabled{% endif %} {%- if item.active %} c-menu-navigation__button--has-selection{% endif %}" {%- if item.title %} title="{{ item.title }}"{% endif %} {% if item.disabled %} aria-disabled="true" tabindex="-1"{% endif %} id="{{ id }}"
27
27
  {%- if item.sub.html %} data-aria-controls="{{ subId }}"{% endif %}
28
28
  {%- for attribute, value in item.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
29
29
  <span class="inline-flex self-center max-w-xs align-middle truncate">{{ item.html | safe if item.html else item.text }}</span>
@@ -32,7 +32,7 @@
32
32
  </a>
33
33
  {% endif %}
34
34
  {% if item.href and not item.sub %}
35
- <a role="menuitem" {%- if id %} id="{{ id }}"{% endif %} {%- if item.href %} href="{{ item.href }}"{% endif %} class="c-menubar__button {%- if item.classes %} {{ item.classes }}{% endif %} {%- if item.disabled %} c-menubar__button--disabled{% endif %} {%- if item.active %} c-menubar__button--primary{% endif %}" {%- if item.title %} title="{{ item.title }}"{% endif %} {% if item.disabled %} disabled="disabled" aria-disabled="true" tabindex="-1"{% endif %} {% if item.target %} target="{{ item.target }}"{% endif %}{%- for attribute, value in item.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
35
+ <a role="menuitem" {%- if id %} id="{{ id }}"{% endif %} {%- if item.href %} href="{{ item.href }}"{% endif %} class="c-menubar__button {%- if item.classes %} {{ item.classes }}{% endif %} {%- if item.disabled %} c-menubar__button--disabled{% endif %} {%- if item.active %} c-menu-navigation__button--has-selection{% endif %}" {%- if item.title %} title="{{ item.title }}"{% endif %} {% if item.disabled %} disabled="disabled" aria-disabled="true" tabindex="-1"{% endif %} {% if item.target %} target="{{ item.target }}"{% endif %}{%- for attribute, value in item.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
36
36
  {{ item.html | safe if item.html else item.text }}
37
37
  </a>
38
38
  {% endif %}
@@ -120,7 +120,7 @@
120
120
  </div>
121
121
  {% if params.isDismissible %}
122
122
  <div class="absolute top-0 right-0 p-sm lg:p-base">
123
- <button onclick="closeDialog(this)" class="p-sm focus:bg-warning-base focus:border-warning-base focus:shadow-outline-black focus:text-black focus:outline-none" aria-label="X: Cerrar la ventana emergente">
123
+ <button onclick="closeDialog(this)" class="p-sm focus:bg-warning-base focus:border-warning-base focus:shadow-outline-black focus:text-black focus:outline-none" aria-label="X: Cerrar la ventana emergente" type="button">
124
124
  <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" width="1em" height="1em" class="w-4 h-4" aria-hidden="true" role="presentation"><path d="M85.91 71.77a2.5 2.5 0 010-3.54l46.16-46.16a10 10 0 10-14.14-14.14L71.77 54.09a2.5 2.5 0 01-3.54 0L22.07 7.93A10 10 0 007.93 22.07l46.16 46.16a2.5 2.5 0 010 3.54L7.93 117.93a10 10 0 0014.14 14.14l46.16-46.16a2.5 2.5 0 013.54 0l46.16 46.16a10 10 0 0014.14-14.14z" fill="currentColor"/></svg>
125
125
  </button>
126
126
  </div>
@@ -68,7 +68,7 @@
68
68
  </div>
69
69
  {% if params.isDismissible %}
70
70
  <div class="absolute top-0 right-0 p-sm">
71
- <button class="c-notification-button__close p-sm focus:bg-warning-base focus:border-warning-base focus:shadow-outline-black focus:text-black focus:outline-none" aria-label="X: Cerrar notificación">
71
+ <button type="button" class="c-notification-button__close p-sm focus:bg-warning-base focus:border-warning-base focus:shadow-outline-black focus:text-black focus:outline-none" aria-label="X: Cerrar notificación">
72
72
  <svg class="w-4 h-4 pointer-events-none" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" width="1em" height="1em" aria-hidden="true" role="presentation"><path d="M85.91 71.77a2.5 2.5 0 010-3.54l46.16-46.16a10 10 0 10-14.14-14.14L71.77 54.09a2.5 2.5 0 01-3.54 0L22.07 7.93A10 10 0 007.93 22.07l46.16 46.16a2.5 2.5 0 010 3.54L7.93 117.93a10 10 0 0014.14 14.14l46.16-46.16a2.5 2.5 0 013.54 0l46.16 46.16a10 10 0 0014.14-14.14z" fill="currentColor"/></svg>
73
73
  </button>
74
74
  </div>
@@ -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 %}