desy-html 8.3.1 → 8.4.1

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 (74) hide show
  1. package/docs/_include.template-header.njk +140 -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 +3 -1
  6. package/docs/examples-accordion.html +3 -1
  7. package/docs/examples-alert.html +3 -1
  8. package/docs/examples-breadcrumbs.html +3 -1
  9. package/docs/examples-button-loader.html +3 -1
  10. package/docs/examples-button.html +3 -1
  11. package/docs/examples-card.html +3 -1
  12. package/docs/examples-character-count.html +3 -1
  13. package/docs/examples-checkboxes.html +3 -1
  14. package/docs/examples-collapsible.html +3 -1
  15. package/docs/examples-date-input.html +3 -1
  16. package/docs/examples-description-list.html +3 -1
  17. package/docs/examples-details.html +3 -1
  18. package/docs/examples-dialog.html +3 -1
  19. package/docs/examples-dropdown.html +3 -1
  20. package/docs/examples-error-message.html +3 -1
  21. package/docs/examples-error-summary.html +3 -1
  22. package/docs/examples-fieldset.html +3 -1
  23. package/docs/examples-file-upload.html +3 -1
  24. package/docs/examples-footer.html +3 -1
  25. package/docs/examples-header-advanced.html +3 -1
  26. package/docs/examples-header-mini.html +3 -1
  27. package/docs/examples-header.html +3 -1
  28. package/docs/examples-hint.html +3 -1
  29. package/docs/examples-input-group.html +3 -1
  30. package/docs/examples-input.html +3 -1
  31. package/docs/examples-item.html +3 -1
  32. package/docs/examples-label.html +3 -1
  33. package/docs/examples-links-list.html +3 -1
  34. package/docs/examples-listbox.html +3 -1
  35. package/docs/examples-media-object.html +3 -1
  36. package/docs/examples-menu-horizontal.html +3 -1
  37. package/docs/examples-menu-navigation.html +3 -1
  38. package/docs/examples-menu-vertical.html +3 -1
  39. package/docs/examples-menubar.html +3 -1
  40. package/docs/examples-modal.html +3 -1
  41. package/docs/examples-nav.html +3 -1
  42. package/docs/examples-notification.html +3 -1
  43. package/docs/examples-pagination.html +3 -1
  44. package/docs/examples-pill.html +3 -1
  45. package/docs/examples-radios.html +3 -1
  46. package/docs/examples-searchbar.html +3 -1
  47. package/docs/examples-select.html +3 -1
  48. package/docs/examples-skip-link.html +3 -1
  49. package/docs/examples-spinner.html +3 -1
  50. package/docs/examples-status-item.html +3 -1
  51. package/docs/examples-status.html +3 -1
  52. package/docs/examples-table-advanced.html +3 -1
  53. package/docs/examples-table.html +3 -1
  54. package/docs/examples-tabs.html +3 -1
  55. package/docs/examples-textarea.html +3 -1
  56. package/docs/examples-toggle.html +3 -1
  57. package/docs/examples-tooltip.html +3 -1
  58. package/docs/examples-tree.html +3 -1
  59. package/docs/index.html +11 -1
  60. package/docs/plantillas.html +1 -1
  61. package/package.json +1 -1
  62. package/src/js/aria/MenuVertical.js +2 -2
  63. package/src/js/aria/Nav.js +55 -0
  64. package/src/js/desy-html.js +37 -51
  65. package/src/js/index.js +3 -1
  66. package/src/templates/components/header/_examples.header.njk +1 -1
  67. package/src/templates/components/header-advanced/_examples.header-advanced.njk +1 -1
  68. package/src/templates/components/links-list/_template.links-list.njk +2 -2
  69. package/src/templates/components/menu-horizontal/_styles.menu-horizontal.css +15 -0
  70. package/src/templates/components/menu-horizontal/_template.menu-horizontal.njk +4 -3
  71. package/src/templates/components/menu-navigation/_template.menu-navigation.njk +3 -3
  72. package/src/templates/components/menu-vertical/_template.menu-vertical.njk +4 -4
  73. package/src/templates/components/nav/_examples.nav.njk +3 -1
  74. package/src/templates/components/nav/_template.nav.njk +7 -9
@@ -17,6 +17,10 @@
17
17
  @apply lg:border-b-0;
18
18
  @apply lg:rounded-t;
19
19
  @apply no-underline;
20
+
21
+ strong {
22
+ @apply font-normal;
23
+ }
20
24
  }
21
25
  }
22
26
 
@@ -38,6 +42,10 @@
38
42
  @apply border-b-0;
39
43
  @apply rounded-t;
40
44
  @apply no-underline;
45
+
46
+ strong {
47
+ @apply font-normal;
48
+ }
41
49
  }
42
50
 
43
51
  .c-menu-horizontal__link {
@@ -53,6 +61,13 @@
53
61
  @apply text-black;
54
62
  @apply outline-none;
55
63
  }
64
+
65
+ &.c-menu-horizontal__active {
66
+ @apply no-underline;
67
+ &:hover {
68
+ @apply underline;
69
+ }
70
+ }
56
71
  }
57
72
 
58
73
  .c-menu-horizontal--scroll {
@@ -16,9 +16,10 @@
16
16
  {% endif %}
17
17
  <li>
18
18
  {% if item.active %}
19
- <span {%- if id %} id="{{ id }}"{% endif %} class="c-menu-horizontal__active flex items-center relative py-sm lg:px-lg lg:py-base border border-transparent truncate font-semibold {%- if item.classes %} {{ item.classes }}{% endif -%}" {%- if item.title %} title="{{ item.title }}"{% endif %} aria-current="page" {%- for attribute, value in item.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
20
- <strong>{{ item.html | safe if item.html else item.text }}</strong>
21
- </span>
19
+ <a {%- if id %} id="{{ id }}"{% endif %} href="{{ item.href }}" class="c-menu-horizontal__link c-menu-horizontal__active relative flex items-center py-sm lg:px-lg lg:py-base border border-transparent text-black hover:text-primary-base underline truncate focus:outline-none
20
+ {%- if item.disabled %} no-underline pointer-events-none{% endif -%} {%- if item.classes %} {{ item.classes }}{% 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 %} aria-current="page" {%- for attribute, value in item.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
21
+ <strong class="font-bold">{{ item.html | safe if item.html else item.text }}</strong>
22
+ </a>
22
23
  {% else %}
23
24
  <a {%- if id %} id="{{ id }}"{% endif %} href="{{ item.href }}" class="c-menu-horizontal__link relative flex items-center py-sm lg:px-lg lg:py-base border border-transparent text-black hover:text-primary-base underline truncate focus:outline-none
24
25
  {%- if item.disabled %} no-underline pointer-events-none{% endif -%} {%- if item.classes %} {{ item.classes }}{% 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 -%}>
@@ -51,8 +51,8 @@
51
51
  <li>
52
52
  {% if subitem.href %}
53
53
  {% if subitem.active %}
54
- <span {%- if subitem.id %} id="{{ subId }}"{% endif %} class="flex items-center px-base py-sm text-sm font-semibold {%- if subitem.classes %} {{ subitem.classes }}{% endif -%}" aria-current="page" {{- commonSubItemAttributes | safe }}>
55
- <strong>{{ subitem.html | safe if subitem.html else subitem.text }}</strong>
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
56
  </span>
57
57
  {% else %}
58
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 }}>
@@ -65,7 +65,7 @@
65
65
  {% else %}
66
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
67
  {% if subitem.active %}
68
- <strong>{{ subitem.html | safe if subitem.html else subitem.text }}</strong>
68
+ <strong class="font-bold">{{ subitem.html | safe if subitem.html else subitem.text }}</strong>
69
69
  {% else %}
70
70
  {{ subitem.html | safe if subitem.html else subitem.text }}
71
71
  {% endif %}
@@ -17,7 +17,7 @@
17
17
  {% if item.href %}
18
18
  <a {%- if id %} id="{{ id }}"{% endif %} href="{{ item.href }}" class="block px-xs focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black {%- if params.hasUnderline %} underline{% endif %} {%- if item.classes %} {{ item.classes }}{% endif %} {%- if not item.disabled %} hover:text-primary-base hover:underline{% endif %} {%- if item.disabled %} no-underline pointer-events-none{% endif %}" {%- if item.title %} title="{{ item.title }}"{% endif %}{%- if item.active %} aria-current="page"{% endif %} {% if item.disabled %} aria-disabled="true" tabindex="-1"{% endif %} {% if item.target %} target="{{ item.target }}"{% endif %}{%- for attribute, value in item.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
19
19
  {% if item.active %}
20
- <strong>{{ item.html | safe if item.html else item.text }}</strong>
20
+ <strong class="font-bold">{{ item.html | safe if item.html else item.text }}</strong>
21
21
  {% else %}
22
22
  {{ item.html | safe if item.html else item.text }}
23
23
  {% endif %}
@@ -25,7 +25,7 @@
25
25
  {% else %}
26
26
  <span {%- if id %} id="{{ id }}"{% endif %} class="block px-xs {%- if item.classes %} {{ item.classes }}{% endif %}" {%- if item.title %} title="{{ item.title }}"{% endif %}{%- if item.active %} aria-current="page"{% endif %} {% if item.disabled %} aria-disabled="true" tabindex="-1"{% endif %} {%- for attribute, value in item.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
27
27
  {% if item.active %}
28
- <strong>{{ item.html | safe if item.html else item.text }}</strong>
28
+ <strong class="font-bold">{{ item.html | safe if item.html else item.text }}</strong>
29
29
  {% else %}
30
30
  {{ item.html | safe if item.html else item.text }}
31
31
  {% endif %}
@@ -45,7 +45,7 @@
45
45
  {% if subitem.href %}
46
46
  <a {%- if subId %} id="{{ subId }}"{% endif %} href="{{ subitem.href }}" class="block px-xs hover:text-primary-base hover:underline focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black {%- if params.hasUnderline %} underline{% endif %} {%- if subitem.classes %} {{ subitem.classes }}{% endif %} {%- if subitem.disabled %} no-underline pointer-events-none{% endif %}" {%- if subitem.title %} title="{{ subitem.title }}"{% endif %}{%- if subitem.active %} aria-current="page"{% endif %} {% if subitem.disabled %} aria-disabled="true" tabindex="-1"{% endif %} {% if subitem.target %} target="{{ subitem.target }}"{% endif %}{%- for attribute, value in subitem.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
47
47
  {% if subitem.active %}
48
- <strong>{{ subitem.html | safe if subitem.html else subitem.text }}</strong>
48
+ <strong class="font-bold">{{ subitem.html | safe if subitem.html else subitem.text }}</strong>
49
49
  {% else %}
50
50
  {{ subitem.html | safe if subitem.html else subitem.text }}
51
51
  {% endif %}
@@ -53,7 +53,7 @@
53
53
  {% else %}
54
54
  <span {%- if subId %} id="{{ subId }}"{% endif %} class="block px-xs {%- if subitem.classes %} {{ subitem.classes }}{% 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 -%}>
55
55
  {% if subitem.active %}
56
- <strong>{{ subitem.html | safe if subitem.html else subitem.text }}</strong>
56
+ <strong class="font-bold">{{ subitem.html | safe if subitem.html else subitem.text }}</strong>
57
57
  {% else %}
58
58
  {{ subitem.html | safe if subitem.html else subitem.text }}
59
59
  {% endif %}
@@ -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
- <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 }}>
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 %} {% if item.active %} aria-current="page"{% endif %}{{- commonItemAttributes | safe }}>
23
+ {% if item.active %}
24
+ <strong class="font-bold">{{ 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">