desy-html 8.12.0 → 8.13.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 (36) hide show
  1. package/docs/ds/_ds.example.dropdowns-en-uso.njk +2 -2
  2. package/docs/ds/_ds.example.nav.njk +2 -2
  3. package/docs/ds/_ds.example.textos.njk +1 -1
  4. package/docs/ds/_ds.section.espaciado.njk +1 -1
  5. package/docs/ds/_ds.section.textos.njk +11 -1
  6. package/docs/ds/_ds.section.typography.njk +2 -1
  7. package/docs/index.html +14 -0
  8. package/package.json +3 -4
  9. package/src/js/aria/Nav.js +1 -1
  10. package/src/js/aria/accordion.js +2 -2
  11. package/src/js/aria/collapsible.js +1 -1
  12. package/src/js/aria/dialog.js +9 -4
  13. package/src/js/aria/listbox.js +11 -7
  14. package/src/js/aria/notification.js +1 -1
  15. package/src/js/aria/tabs.js +1 -1
  16. package/src/js/aria/treeitem.js +22 -5
  17. package/src/js/desy-html.js +1 -0
  18. package/src/templates/components/button/_examples.button.njk +8 -5
  19. package/src/templates/components/button-loader/_examples.button-loader.njk +6 -5
  20. package/src/templates/components/dropdown/_examples.dropdown.njk +1 -1
  21. package/src/templates/components/footer/_examples.footer.njk +17 -5
  22. package/src/templates/components/footer/_styles.footer.css +11 -4
  23. package/src/templates/components/footer/_template.footer.njk +18 -12
  24. package/src/templates/components/footer/params.footer.yaml +1 -1
  25. package/src/templates/components/header/_template.header.njk +3 -3
  26. package/src/templates/components/header-advanced/_examples.header-advanced.njk +67 -17
  27. package/src/templates/components/header-advanced/_template.header-advanced.njk +1 -1
  28. package/src/templates/components/listbox/_examples.listbox.njk +1 -1
  29. package/src/templates/components/menu-horizontal/_styles.menu-horizontal.css +11 -0
  30. package/src/templates/components/menu-navigation/_template.menu-navigation.njk +3 -3
  31. package/src/templates/components/menubar/_template.menubar.njk +1 -1
  32. package/src/templates/components/nav/_examples.nav.njk +1 -1
  33. package/src/templates/components/nav/_template.nav.njk +1 -1
  34. package/src/templates/components/pagination/_template.pagination.njk +1 -1
  35. package/src/templates/components/table-advanced/_styles.table-advanced.css +1 -0
  36. package/src/templates/components/toggle/_examples.toggle.njk +4 -4
@@ -113,7 +113,7 @@
113
113
  isMenu: true,
114
114
  idPrefix: "header-dropdown-nav-item",
115
115
  items: params.dropdown.items,
116
- classes: "w-max max-w-64",
116
+ classes: "max-w-64",
117
117
  attributes: {
118
118
  "id": "id-dropdown-nav",
119
119
  "aria-label": "Menú de usuario"
@@ -417,7 +417,7 @@
417
417
  "classes": "font-semibold text-sm"
418
418
  },
419
419
  "classes": "w-full justify-between",
420
- "classesTooltip": "w-max max-h-64 overflow-y-auto",
420
+ "classesTooltip": "max-h-64 overflow-y-auto",
421
421
  "items": [
422
422
  {
423
423
  "href": "#",
@@ -8,6 +8,12 @@
8
8
  @apply lg:border-neutral-dark;
9
9
 
10
10
  .c-menu-horizontal__list {
11
+ @apply lg:relative;
12
+ @apply lg:w-full;
13
+ @apply lg:flex;
14
+ @apply lg:flex-nowrap;
15
+ @apply lg:snap-x;
16
+ @apply lg:overflow-x-auto;
11
17
  @apply lg:-mb-0.5;
12
18
  }
13
19
 
@@ -30,7 +36,12 @@
30
36
  @apply border-neutral-dark;
31
37
 
32
38
  .c-menu-horizontal__list {
39
+ @apply relative;
40
+ @apply w-full;
33
41
  @apply flex;
42
+ @apply flex-nowrap;
43
+ @apply snap-x;
44
+ @apply overflow-x-auto;
34
45
  @apply -mb-0.5;
35
46
  }
36
47
 
@@ -30,7 +30,7 @@
30
30
  <span class="inline-flex self-center max-w-xs align-middle truncate pointer-events-none">{{ item.html | safe if item.html else item.text }}</span>
31
31
  </a>
32
32
  {% else %}
33
- <button {%- if item.sub %} aria-expanded="true" aria-controls="{{ id }}-sub-list"{% endif %}
33
+ <button {%- if item.sub %} aria-expanded="true" aria-haspopup="true" aria-controls="{{ id }}-sub-list"{% endif %}
34
34
  {%- if id %} id="{{ id }}"{% endif %} class="c-menu-navigation__button {%- if item.disabled %} c-menu-navigation__button--disabled{% endif %} {%- if item.active %} c-menu-navigation__button--primary{% endif %} {%- if item.active %} c-menu-navigation__button--has-selection{% endif %} {%- if item.classes %} {{ item.classes }}{% endif %}" {%- if item.title %} title="{{ item.title }}"{% endif %} {% if item.disabled %} aria-disabled="true" tabindex="-1"{% endif %} {%- for attribute, value in item.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>{% if item.active %}<span class="sr-only">Item activo: </span>{% endif %}<span class="inline-flex self-center max-w-xs align-middle truncate pointer-events-none">{{ item.html | safe if item.html else item.text }}</span>
35
35
  {# Indentation is intentional to output HTML nicely #}
36
36
  {{- iconHtml | safe | trim if iconHtml -}}
@@ -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="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 -%}>
41
+ <ul id="{{ id }}-sub-list" class="c-menu-navigation__sub--list {% if item.sub.classes %}{{ item.sub.classes }}{% else-%} c-menu-navigation__tooltip 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 -#}
@@ -52,7 +52,7 @@
52
52
  <a {%- if subitem.active %} aria-current="page"{% 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 }}>
53
53
  {{ subitem.html | safe if subitem.html else subitem.text }}
54
54
  {% if subitem.disabled %}
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>
55
+ <svg viewBox="0 0 140 140" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg" class="inline-block align-middle flex-initial 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>
56
56
  {% endif %}
57
57
  </a>
58
58
  </li>
@@ -37,7 +37,7 @@
37
37
  </a>
38
38
  {% endif %}
39
39
  {% if item.sub.items %}
40
- <ul role="menu" class="c-menubar__tooltip w-max max-w-64 hidden border border-neutral-base shadow-md bg-white text-sm {%- if item.sub.classes %} {{ item.sub.classes }}{% endif %}" aria-label="{{ item.ariaLabel }}" {%- for attribute, value in item.sub.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
40
+ <ul role="menu" class="c-menubar__tooltip max-w-64 hidden border border-neutral-base shadow-md bg-white text-sm {%- if item.sub.classes %} {{ item.sub.classes }}{% endif %}" aria-label="{{ item.ariaLabel }}" {%- for attribute, value in item.sub.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
41
41
  {% for subitem in item.sub.items %}
42
42
  {% if subitem %}
43
43
  {#- If the user explicitly sets an id, use this instead of the regular idPrefix -#}
@@ -394,7 +394,7 @@
394
394
  "text": "Clases max-width aplicadas para evitar demasiada anchura dentro de los menus y forzar a saltos de línea"
395
395
  }
396
396
  ],
397
- "classes": "w-max max-w-64",
397
+ "classes": "max-w-64",
398
398
  "attributes": {
399
399
  "aria-label": "Navegación local"
400
400
  }
@@ -26,7 +26,7 @@
26
26
  {{ item.html | safe if item.html else item.text }}
27
27
  {% endif %}
28
28
  {% if item.disabled %}
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>
29
+ <svg viewBox="0 0 140 140" height="1em" width="1em" xmlns="http://www.w3.org/2000/svg" class="inline-block align-middle flex-initial 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>
30
30
  {% endif %}
31
31
  </a>
32
32
  </li>
@@ -155,7 +155,7 @@
155
155
  {{ componentListbox({
156
156
  "id": "items-listbox-" + idPrefix,
157
157
  "text": params.itemsPerPage,
158
- "label": params.itemsListbox.label if params.itemsListbox.label else { "text": "Items por página: ", "classes": "inline-block align-middle mb-[0]" },
158
+ "label": params.itemsListbox.label if params.itemsListbox.label else { "text": "Items por página: ", "classes": "inline-block flex align-middle mb-[0]" },
159
159
  "doesChangeButtonText": true,
160
160
  "classesContainer": "flex flex-wrap items-center gap-xs",
161
161
  "classes": "c-listbox--sm c-listbox--transparent",
@@ -51,6 +51,7 @@
51
51
  @apply bg-warning-base;
52
52
  @apply outline-none;
53
53
  @apply shadow-outline-black;
54
+ @apply text-black;
54
55
  }
55
56
  }
56
57
 
@@ -105,7 +105,7 @@
105
105
  "name": "isSwitch",
106
106
  "description": 'Apariencia de Switch con <code>"isSwitch": true</code>, sin cambio en el texto, sólo cambia su estado visual. Necesita un elemento externo con un <code>id</code> para referenciarlo con su <code>aria-labelledby</code>.',
107
107
  "data": {
108
- "classes": "",
108
+ "classes": "focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black",
109
109
  "isSwitch": true,
110
110
  "offState": {
111
111
  "classes": "",
@@ -124,7 +124,7 @@
124
124
  "name": "isSwitch pressed",
125
125
  "description": 'Usa <code>"pressed": true</code> para activarlo inicialmente.',
126
126
  "data": {
127
- "classes": "",
127
+ "classes": "focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black",
128
128
  "pressed": true,
129
129
  "isSwitch": true,
130
130
  "offState": {
@@ -144,7 +144,7 @@
144
144
  "name": "isSwitch con JavaScript",
145
145
  "description": 'También puedes usar con javascript la función global <code>activateItemToggle(element, toggle)</code>, para modificar el estado del Switch, usando su id, el parámetro <code>toggle</code> admite <code>true</code> o <code>false</code>, si le pasamos true se mostrará activado, y si le pasamos false se mostrará desactivado. Ej: Abre la consola del navegador y escribe <code>activateItemToggle("toggle-switch-js", true)</code> para mostrar el switch activado.',
146
146
  "data": {
147
- "classes": "",
147
+ "classes": "focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black",
148
148
  "id": "toggle-switch-js",
149
149
  "isSwitch": true,
150
150
  "offState": {
@@ -163,7 +163,7 @@
163
163
  {
164
164
  "name": "isSwitch peque",
165
165
  "data": {
166
- "classes": "",
166
+ "classes": "focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black",
167
167
  "isSwitch": true,
168
168
  "offState": {
169
169
  "classes": "",