desy-html 5.3.0 → 6.2.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 (101) hide show
  1. package/config/tailwind.config.js +11 -21
  2. package/docs/_include.template-header.njk +16 -4
  3. package/docs/_macro.example-render.njk +16 -0
  4. package/docs/componentes.html +12 -0
  5. package/docs/ds/_ds.example.accordion.njk +61 -0
  6. package/docs/ds/_ds.example.footer.njk +7 -128
  7. package/docs/ds/_ds.example.header.njk +118 -0
  8. package/docs/ds/_ds.example.layout.njk +16 -6
  9. package/docs/ds/_ds.example.menu-navigation.njk +494 -0
  10. package/docs/ds/_ds.example.searchbar.njk +39 -0
  11. package/docs/ds/_ds.example.table.njk +432 -0
  12. package/docs/ds/_ds.example.toggle.njk +55 -35
  13. package/docs/ds/_ds.section.layout.njk +12 -12
  14. package/docs/ds/_ds.section.navigation.njk +5 -0
  15. package/docs/ds/_ds.section.textos.njk +27 -0
  16. package/docs/examples-accordion-history.html +5 -0
  17. package/docs/examples-header-2.html +5 -0
  18. package/docs/examples-header-advanced-2.html +5 -0
  19. package/docs/examples-header-advanced.html +5 -0
  20. package/docs/examples-header-mini.html +5 -0
  21. package/docs/examples-menu-navigation.html +5 -0
  22. package/docs/index.html +53 -0
  23. package/gulpfile.js +7 -6
  24. package/package.json +6 -7
  25. package/src/css/base.css +4 -0
  26. package/src/css/styles.css +1 -0
  27. package/src/js/aria/accordion.js +16 -5
  28. package/src/js/aria/disclosureMenu.js +153 -0
  29. package/src/js/desy-html.js +15 -0
  30. package/src/js/index.js +2 -0
  31. package/src/templates/components/accordion/_examples.accordion.njk +70 -2
  32. package/src/templates/components/accordion/_template.accordion.njk +18 -8
  33. package/src/templates/components/accordion/params.accordion.yaml +38 -0
  34. package/src/templates/components/accordion-history/_examples.accordion-history.njk +356 -0
  35. package/src/templates/components/accordion-history/_macro.accordion-history.njk +3 -0
  36. package/src/templates/components/accordion-history/_template.accordion-history.njk +220 -0
  37. package/src/templates/components/accordion-history/params.accordion-history.yaml +125 -0
  38. package/src/templates/components/button/_examples.button.njk +7 -0
  39. package/src/templates/components/button/_styles.button.css +34 -0
  40. package/src/templates/components/button/_template.button.njk +1 -1
  41. package/src/templates/components/button-loader/_styles.button-loader.css +6 -0
  42. package/src/templates/components/button-loader/_template.button-loader.njk +6 -6
  43. package/src/templates/components/checkboxes/_styles.checkboxes.css +7 -0
  44. package/src/templates/components/dropdown/_styles.dropdown.css +12 -4
  45. package/src/templates/components/file-upload/_template.file-upload.njk +1 -1
  46. package/src/templates/components/footer/_examples.footer.njk +46 -136
  47. package/src/templates/components/footer/_template.footer.njk +35 -28
  48. package/src/templates/components/footer/params.footer.yaml +18 -0
  49. package/src/templates/components/header/_examples.header-2.njk +536 -0
  50. package/src/templates/components/header/_examples.header.njk +134 -1
  51. package/src/templates/components/header/_template.header.header__navigation.njk +3 -3
  52. package/src/templates/components/header/_template.header.header__offcanvasButton.njk +1 -1
  53. package/src/templates/components/header/_template.header.header__subnav.njk +2 -2
  54. package/src/templates/components/header/_template.header.njk +8 -9
  55. package/src/templates/components/header/params.header.yaml +24 -0
  56. package/src/templates/components/header-advanced/_examples.header-advanced-2.njk +851 -0
  57. package/src/templates/components/header-advanced/_examples.header-advanced.njk +761 -0
  58. package/src/templates/components/header-advanced/_macro.header-advanced.njk +3 -0
  59. package/src/templates/components/header-advanced/_template.header-advanced.njk +146 -0
  60. package/src/templates/components/header-advanced/params.header-advanced.yaml +298 -0
  61. package/src/templates/components/header-mini/_examples.header-mini.njk +30 -0
  62. package/src/templates/components/header-mini/_macro.header-mini.njk +3 -0
  63. package/src/templates/components/header-mini/_template.header-mini.njk +14 -0
  64. package/src/templates/components/header-mini/params.header-mini.yaml +25 -0
  65. package/src/templates/components/input/_styles.input.css +7 -0
  66. package/src/templates/components/item/_examples.item.njk +26 -1
  67. package/src/templates/components/item/_template.item.njk +4 -4
  68. package/src/templates/components/item/params.item.yaml +4 -0
  69. package/src/templates/components/listbox/_styles.listbox.css +14 -4
  70. package/src/templates/components/menu-horizontal/_examples.menu-horizontal.njk +25 -0
  71. package/src/templates/components/menu-horizontal/_styles.menu-horizontal.css +26 -0
  72. package/src/templates/components/menu-horizontal/_template.menu-horizontal.njk +1 -1
  73. package/src/templates/components/menu-navigation/_examples.menu-navigation.njk +1080 -0
  74. package/src/templates/components/menu-navigation/_macro.menu-navigation.njk +3 -0
  75. package/src/templates/components/menu-navigation/_styles.menu-navigation.css +224 -0
  76. package/src/templates/components/menu-navigation/_template.menu-navigation.njk +116 -0
  77. package/src/templates/components/menu-navigation/params.menu-navigation.yaml +93 -0
  78. package/src/templates/components/menubar/_examples.menubar.njk +1 -1
  79. package/src/templates/components/menubar/_styles.menubar.css +33 -5
  80. package/src/templates/components/modal/_examples.modal.njk +62 -0
  81. package/src/templates/components/modal/_template.modal.njk +21 -4
  82. package/src/templates/components/modal/params.modal.yaml +2 -2
  83. package/src/templates/components/pagination/_examples.pagination.njk +60 -0
  84. package/src/templates/components/pagination/_template.pagination.njk +16 -2
  85. package/src/templates/components/pagination/params.pagination.yaml +49 -0
  86. package/src/templates/components/radios/_styles.radios.css +7 -0
  87. package/src/templates/components/searchbar/_examples.searchbar.njk +12 -1
  88. package/src/templates/components/searchbar/_template.searchbar.njk +9 -9
  89. package/src/templates/components/select/_styles.select.css +8 -0
  90. package/src/templates/components/spinner/_styles.spinner.css +1 -0
  91. package/src/templates/components/spinner/_template.spinner.njk +4 -4
  92. package/src/templates/components/table-advanced/_examples.table-advanced.njk +182 -5
  93. package/src/templates/components/table-advanced/_template.table-advanced.njk +27 -2
  94. package/src/templates/components/table-advanced/params.table-advanced.yaml +5 -0
  95. package/src/templates/components/toggle/_examples.toggle.njk +33 -11
  96. package/src/templates/components/toggle/_template.toggle.njk +3 -1
  97. package/src/templates/components/toggle/params.toggle.yaml +4 -0
  98. package/src/templates/components/tree/_examples.tree.njk +580 -32
  99. package/src/templates/components/tree/_styles.tree.css +8 -0
  100. package/src/templates/components/tree/_template.tree.njk +1 -1
  101. package/config/clean-css.js +0 -25
@@ -75,6 +75,10 @@ params:
75
75
  type: string
76
76
  required: false
77
77
  description: Predefined icon types are `document`, `link`, `clipboard`
78
+ - name: containerClasses
79
+ type: string
80
+ required: false
81
+ description: Classes applied to the parent div of icon. Useful to vertical align the icon.
78
82
  - name: isDraggable
79
83
  type: boolean
80
84
  required: false
@@ -80,17 +80,27 @@
80
80
  @apply font-bold;
81
81
 
82
82
  &::before {
83
- content: '✓';
83
+ @apply bg-center bg-no-repeat bg-cover;
84
+ background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 48 48'%3E%3Cg transform='matrix(3.4285714285714284,0,0,3.4285714285714284,0,0)'%3E%3Cpath d='M4,12.5a2,2,0,0,1-1.55-.78L.25,9.23A1,1,0,0,1,.34,7.81a1,1,0,0,1,1.41.1l2.06,2.33a.21.21,0,0,0,.18.09.23.23,0,0,0,.18-.08l8.11-8.44a1,1,0,0,1,1.44,1.38l-8.2,8.63A1.94,1.94,0,0,1,4,12.5Z' style='fill: %23000000'%3E%3C/path%3E%3C/g%3E%3C/svg%3E");
85
+ content: '';
86
+ @apply w-3;
87
+ @apply h-3;
84
88
  @apply absolute;
85
- @apply top-0;
86
- @apply left-0;
87
- @apply p-sm;
89
+ @apply top-3;
90
+ @apply left-2;
88
91
  }
89
92
  }
90
93
  }
91
94
  }
92
95
 
93
96
 
97
+ .c-listbox--base {
98
+ @apply px-3;
99
+ @apply py-2;
100
+ @apply text-base;
101
+ }
102
+
103
+
94
104
  .c-listbox--sm {
95
105
  @apply px-2;
96
106
  @apply py-1;
@@ -161,6 +161,31 @@
161
161
  }
162
162
  }
163
163
  },
164
+ {
165
+ "name": "with classes applied: tabs in mobile",
166
+ "description": "Modifier class applied: .c-menu-horizontal--tabs-mobile",
167
+ "data": {
168
+ "classes": "c-menu-horizontal--tabs-mobile",
169
+ "items": [
170
+ {
171
+ "href": "#",
172
+ "html": '<span class="flex flex-col items-center"><span class="block"><svg class="w-6 h-6 mb-xs" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" aria-hidden="true" focusable="false" width="1em" height="1em"><g transform="scale(2)"><circle cx="2.5" cy="4" r="2.5" fill="currentColor"/><path d="M8.5 5H23a1 1 0 0 0 0-2H8.5a1 1 0 0 0 0 2Z" fill="currentColor"/><circle cx="2.5" cy="12" r="2.5" fill="currentColor"/><path d="M23 11H8.5a1 1 0 0 0 0 2H23a1 1 0 0 0 0-2Z" fill="currentColor"/><circle cx="2.5" cy="20" r="2.5" fill="currentColor"/><path d="M23 19H8.5a1 1 0 0 0 0 2H23a1 1 0 0 0 0-2Z" fill="currentColor"/></g></svg></span><span class="block text-sm">Seguimiento</span></span>'
173
+ },
174
+ {
175
+ "href": "#",
176
+ "html": '<span class="flex flex-col items-center"><span class="block"><svg class="w-6 h-6 mb-xs" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" aria-hidden="true" focusable="false" width="1em" height="1em"><path d="M11 8h3.5a1 1 0 0 0 0-2H11a1 1 0 0 0 0 2ZM11 12h7.5a1 1 0 0 0 0-2H11a1 1 0 0 0 0 2Z" fill="currentColor" transform="scale(2)"/><path d="M23.71 5.71 18.29.29a1 1 0 0 0-.7-.29H8a2 2 0 0 0-2 2v11.17c0 .19.1.33.25.33h1.5a.25.25 0 0 0 .25-.25v-11A.25.25 0 0 1 8.25 2h8.82a.31.31 0 0 1 .18.07l4.68 4.68a.31.31 0 0 1 .07.18v12.82a.25.25 0 0 1-.25.25h-6a.25.25 0 0 0-.25.25v1.5a.25.25 0 0 0 .25.25H22a2 2 0 0 0 2-2V6.41a1 1 0 0 0-.29-.7Z" fill="currentColor" transform="scale(2)"/><path d="M13 15H6a1 1 0 0 1-.8-.4l-.9-1.2a1 1 0 0 0-.8-.4H1a1 1 0 0 0-1 1v9a1 1 0 0 0 1 1h12a1 1 0 0 0 1-1v-7a1 1 0 0 0-1-1Z" fill="currentColor" transform="scale(2)"/></svg></span><span class="block text-sm">Documentos</span></span>',
177
+ "active": true
178
+ },
179
+ {
180
+ "href": "#",
181
+ "html": '<span class="flex flex-col items-center"><span class="block"><svg class="w-6 h-6 mb-xs" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 48 48" aria-hidden="true" focusable="false" width="1em" height="1em"><path d="M21.71 5.71 16.29.29a1 1 0 0 0-.7-.29H4a2 2 0 0 0-2 2v20a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2V6.41a1 1 0 0 0-.29-.7ZM19.5 22h-15a.5.5 0 0 1-.5-.5v-19a.5.5 0 0 1 .5-.5h1.75a.25.25 0 0 1 .25.25V13a.5.5 0 0 0 .31.46.47.47 0 0 0 .54-.11l2-2a.27.27 0 0 1 .36 0l2 2a.47.47 0 0 0 .35.15.43.43 0 0 0 .19 0 .5.5 0 0 0 .25-.5V2.25a.25.25 0 0 1 .25-.25H15a.49.49 0 0 1 .36.15l4.53 4.53A.49.49 0 0 1 20 7v14.5a.5.5 0 0 1-.5.5Z" fill="currentColor" transform="scale(2)"/></svg></span><span class="block text-sm">Notificaciones</span></span>'
182
+ }
183
+ ],
184
+ "attributes": {
185
+ "aria-label": "Menu horizontal"
186
+ }
187
+ }
188
+ },
164
189
  {
165
190
  "name": "with idPrefix",
166
191
  "description": "See code to display the idPrefix applied",
@@ -20,6 +20,32 @@
20
20
  }
21
21
  }
22
22
 
23
+ .c-menu-horizontal--tabs-mobile {
24
+ @apply w-full;
25
+ @apply border-b;
26
+ @apply border-neutral-dark;
27
+
28
+ .c-menu-horizontal__list {
29
+ @apply flex;
30
+ @apply -mb-0.5;
31
+ }
32
+
33
+ .c-menu-horizontal__active {
34
+ @apply px-base;
35
+ @apply py-base;
36
+ @apply bg-white;
37
+ @apply border-neutral-base;
38
+ @apply border-b-0;
39
+ @apply rounded-t;
40
+ @apply no-underline;
41
+ }
42
+
43
+ .c-menu-horizontal__link {
44
+ @apply px-base;
45
+ @apply py-base;
46
+ }
47
+ }
48
+
23
49
  .c-menu-horizontal__link {
24
50
  &:focus span{
25
51
  @apply bg-warning-base;
@@ -26,7 +26,7 @@
26
26
  </span>
27
27
  {% else %}
28
28
  <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
29
- {%- if item.disabled %} no-underline pointer-events-none{% 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 -%}>
29
+ {%- 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 -%}>
30
30
  <span class="flex items-center pointer-events-none">
31
31
  {{ item.html | safe if item.html else item.text }}
32
32
  </span>