desy-html 6.5.0 → 6.6.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 (137) hide show
  1. package/config/tailwind.config.js +32 -2
  2. package/docs/_global.head.njk +2 -0
  3. package/docs/_include.template-header.njk +8 -0
  4. package/docs/_macro.example-render.njk +8 -0
  5. package/docs/catalogo.html +2 -0
  6. package/docs/componentes.html +6 -0
  7. package/docs/ds/_ds.example.card.njk +199 -0
  8. package/docs/ds/_ds.example.checkboxes.njk +4 -4
  9. package/docs/ds/_ds.example.header-advanced.njk +0 -75
  10. package/docs/ds/_ds.example.links-list.njk +171 -0
  11. package/docs/ds/_ds.example.pills.njk +1 -1
  12. package/docs/ds/_ds.example.textos.njk +3 -1
  13. package/docs/ds/_ds.section.informacion.njk +13 -0
  14. package/docs/ds/_ds.section.navigation.njk +4 -0
  15. package/docs/ds/_ds.section.textos.njk +44 -20
  16. package/docs/examples-card.html +5 -0
  17. package/docs/examples-links-list.html +5 -0
  18. package/docs/index.html +9 -17
  19. package/package.json +1 -2
  20. package/src/css/component.text.css +14 -0
  21. package/src/js/aria/tabs.js +3 -1
  22. package/src/templates/components/button-loader/_template.button-loader.njk +3 -15
  23. package/src/templates/components/card/_examples.card.njk +277 -0
  24. package/src/templates/components/card/_macro.card.njk +3 -0
  25. package/src/templates/components/card/_template.card.njk +35 -0
  26. package/src/templates/components/card/params.card.yaml +113 -0
  27. package/src/templates/components/collapsible/_template.collapsible.njk +1 -1
  28. package/src/templates/components/header/_template.header.njk +1 -1
  29. package/src/templates/components/header-advanced/_template.header-advanced.njk +1 -1
  30. package/src/templates/components/links-list/_examples.links-list.njk +504 -0
  31. package/src/templates/components/links-list/_macro.links-list.njk +3 -0
  32. package/src/templates/components/links-list/_template.links-list.njk +92 -0
  33. package/src/templates/components/links-list/params.links-list.yaml +82 -0
  34. package/src/templates/components/menu-vertical/params.menu-vertical.yaml +0 -4
  35. package/src/templates/components/table/_examples.table.njk +4 -48
  36. package/src/templates/components/table-advanced/_examples.table-advanced.njk +6 -51
  37. package/test/backstop_config/backstop.config.js +0 -35
  38. package/test/backstop_config/scenarios/components_a.js +0 -31
  39. package/test/backstop_config/scenarios/components_b.js +0 -31
  40. package/test/backstop_config/scenarios/components_c.js +0 -31
  41. package/test/backstop_config/scenarios/components_d.js +0 -49
  42. package/test/backstop_config/scenarios/components_e.js +0 -22
  43. package/test/backstop_config/scenarios/components_f.js +0 -31
  44. package/test/backstop_config/scenarios/components_h.js +0 -40
  45. package/test/backstop_config/scenarios/components_i.js +0 -40
  46. package/test/backstop_config/scenarios/components_l.js +0 -22
  47. package/test/backstop_config/scenarios/components_m.js +0 -58
  48. package/test/backstop_config/scenarios/components_n.js +0 -22
  49. package/test/backstop_config/scenarios/components_p.js +0 -22
  50. package/test/backstop_config/scenarios/components_r.js +0 -13
  51. package/test/backstop_config/scenarios/components_s.js +0 -58
  52. package/test/backstop_config/scenarios/components_t.js +0 -67
  53. package/test/backstop_config/scenarios/home.js +0 -12
  54. package/test/backstop_config/scenarios/styles.js +0 -13
  55. package/test/backstop_config/scenarios.js +0 -39
  56. package/test/backstop_data/bitmaps_reference/Desy_Accordion_0_document_0_desktop.png +0 -0
  57. package/test/backstop_data/bitmaps_reference/Desy_Accordion_history_0_document_0_desktop.png +0 -0
  58. package/test/backstop_data/bitmaps_reference/Desy_Alert_0_document_0_desktop.png +0 -0
  59. package/test/backstop_data/bitmaps_reference/Desy_Breadcrumbs_0_document_0_desktop.png +0 -0
  60. package/test/backstop_data/bitmaps_reference/Desy_Button_0_document_0_desktop.png +0 -0
  61. package/test/backstop_data/bitmaps_reference/Desy_Button_loader_0_document_0_desktop.png +0 -0
  62. package/test/backstop_data/bitmaps_reference/Desy_Character_count_0_document_0_desktop.png +0 -0
  63. package/test/backstop_data/bitmaps_reference/Desy_Checkboxes_0_document_0_desktop.png +0 -0
  64. package/test/backstop_data/bitmaps_reference/Desy_Collapsible_0_document_0_desktop.png +0 -0
  65. package/test/backstop_data/bitmaps_reference/Desy_Date_input_0_document_0_desktop.png +0 -0
  66. package/test/backstop_data/bitmaps_reference/Desy_Description_list_0_document_0_desktop.png +0 -0
  67. package/test/backstop_data/bitmaps_reference/Desy_Details_0_document_0_desktop.png +0 -0
  68. package/test/backstop_data/bitmaps_reference/Desy_Dialog_0_document_0_desktop.png +0 -0
  69. package/test/backstop_data/bitmaps_reference/Desy_Dropdown_0_document_0_desktop.png +0 -0
  70. package/test/backstop_data/bitmaps_reference/Desy_Error_message_0_document_0_desktop.png +0 -0
  71. package/test/backstop_data/bitmaps_reference/Desy_Error_summary_0_document_0_desktop.png +0 -0
  72. package/test/backstop_data/bitmaps_reference/Desy_Fieldset_0_document_0_desktop.png +0 -0
  73. package/test/backstop_data/bitmaps_reference/Desy_File_upload_0_document_0_desktop.png +0 -0
  74. package/test/backstop_data/bitmaps_reference/Desy_Footer_0_document_0_desktop.png +0 -0
  75. package/test/backstop_data/bitmaps_reference/Desy_Header_0_document_0_desktop.png +0 -0
  76. package/test/backstop_data/bitmaps_reference/Desy_Header_advanced_0_document_0_desktop.png +0 -0
  77. package/test/backstop_data/bitmaps_reference/Desy_Header_mini_0_document_0_desktop.png +0 -0
  78. package/test/backstop_data/bitmaps_reference/Desy_Hint_0_document_0_desktop.png +0 -0
  79. package/test/backstop_data/bitmaps_reference/Desy_Home_0_document_0_desktop.png +0 -0
  80. package/test/backstop_data/bitmaps_reference/Desy_Input_0_document_0_desktop.png +0 -0
  81. package/test/backstop_data/bitmaps_reference/Desy_Input_group_0_document_0_desktop.png +0 -0
  82. package/test/backstop_data/bitmaps_reference/Desy_Item_0_document_0_desktop.png +0 -0
  83. package/test/backstop_data/bitmaps_reference/Desy_Label_0_document_0_desktop.png +0 -0
  84. package/test/backstop_data/bitmaps_reference/Desy_Listbox_0_document_0_desktop.png +0 -0
  85. package/test/backstop_data/bitmaps_reference/Desy_Media_object_0_document_0_desktop.png +0 -0
  86. package/test/backstop_data/bitmaps_reference/Desy_Menu_horizontal_0_document_0_desktop.png +0 -0
  87. package/test/backstop_data/bitmaps_reference/Desy_Menu_navigation_0_document_0_desktop.png +0 -0
  88. package/test/backstop_data/bitmaps_reference/Desy_Menu_vertical_0_document_0_desktop.png +0 -0
  89. package/test/backstop_data/bitmaps_reference/Desy_Menubar_0_document_0_desktop.png +0 -0
  90. package/test/backstop_data/bitmaps_reference/Desy_Modal_0_document_0_desktop.png +0 -0
  91. package/test/backstop_data/bitmaps_reference/Desy_Nav_0_document_0_desktop.png +0 -0
  92. package/test/backstop_data/bitmaps_reference/Desy_Notification_0_document_0_desktop.png +0 -0
  93. package/test/backstop_data/bitmaps_reference/Desy_Pagination_0_document_0_desktop.png +0 -0
  94. package/test/backstop_data/bitmaps_reference/Desy_Pill_0_document_0_desktop.png +0 -0
  95. package/test/backstop_data/bitmaps_reference/Desy_Searchbar_0_document_0_desktop.png +0 -0
  96. package/test/backstop_data/bitmaps_reference/Desy_Select_0_document_0_desktop.png +0 -0
  97. package/test/backstop_data/bitmaps_reference/Desy_Skip_link_0_document_0_desktop.png +0 -0
  98. package/test/backstop_data/bitmaps_reference/Desy_Spinner_0_document_0_desktop.png +0 -0
  99. package/test/backstop_data/bitmaps_reference/Desy_Status_0_document_0_desktop.png +0 -0
  100. package/test/backstop_data/bitmaps_reference/Desy_Status_item_0_document_0_desktop.png +0 -0
  101. package/test/backstop_data/bitmaps_reference/Desy_Styles_0_document_0_desktop.png +0 -0
  102. package/test/backstop_data/bitmaps_reference/Desy_Table_0_document_0_desktop.png +0 -0
  103. package/test/backstop_data/bitmaps_reference/Desy_Table_advanced_0_document_0_desktop.png +0 -0
  104. package/test/backstop_data/bitmaps_reference/Desy_Tabs_0_document_0_desktop.png +0 -0
  105. package/test/backstop_data/bitmaps_reference/Desy_Textarea_0_document_0_desktop.png +0 -0
  106. package/test/backstop_data/bitmaps_reference/Desy_Toggle_0_document_0_desktop.png +0 -0
  107. package/test/backstop_data/bitmaps_reference/Desy_Tooltip_0_document_0_desktop.png +0 -0
  108. package/test/backstop_data/bitmaps_reference/Desy_Tree_0_document_0_desktop.png +0 -0
  109. package/test/backstop_data/engine_scripts/cookies.json +0 -14
  110. package/test/backstop_data/engine_scripts/imageStub.jpg +0 -0
  111. package/test/backstop_data/engine_scripts/playwright/clickAndHoverHelper.js +0 -43
  112. package/test/backstop_data/engine_scripts/playwright/interceptImages.js +0 -31
  113. package/test/backstop_data/engine_scripts/playwright/loadCookies.js +0 -16
  114. package/test/backstop_data/engine_scripts/playwright/onBefore.js +0 -5
  115. package/test/backstop_data/engine_scripts/playwright/onReady.js +0 -6
  116. package/test/backstop_data/engine_scripts/playwright/overrideCSS.js +0 -27
  117. package/test/backstop_data/engine_scripts/puppet/clickAndHoverHelper.js +0 -39
  118. package/test/backstop_data/engine_scripts/puppet/ignoreCSP.js +0 -65
  119. package/test/backstop_data/engine_scripts/puppet/interceptImages.js +0 -37
  120. package/test/backstop_data/engine_scripts/puppet/loadCookies.js +0 -33
  121. package/test/backstop_data/engine_scripts/puppet/onBefore.js +0 -3
  122. package/test/backstop_data/engine_scripts/puppet/onReady.js +0 -6
  123. package/test/backstop_data/engine_scripts/puppet/overrideCSS.js +0 -15
  124. package/test/backstop_data/html_report/a96f14595379b7c348d66e115ec65a93.png +0 -0
  125. package/test/backstop_data/html_report/assets/fonts/Lato-Bold.ttf +0 -0
  126. package/test/backstop_data/html_report/assets/fonts/Lato-Regular.ttf +0 -0
  127. package/test/backstop_data/html_report/assets/fonts/lato-bold-webfont.woff +0 -0
  128. package/test/backstop_data/html_report/assets/fonts/lato-bold-webfont.woff2 +0 -0
  129. package/test/backstop_data/html_report/assets/fonts/lato-regular-webfont.woff +0 -0
  130. package/test/backstop_data/html_report/assets/fonts/lato-regular-webfont.woff2 +0 -0
  131. package/test/backstop_data/html_report/b815e28b1e230cff6e9d7b749edcd562.png +0 -0
  132. package/test/backstop_data/html_report/config.js +0 -1335
  133. package/test/backstop_data/html_report/diff.js +0 -1843
  134. package/test/backstop_data/html_report/diverged.js +0 -340
  135. package/test/backstop_data/html_report/divergedWorker.js +0 -6
  136. package/test/backstop_data/html_report/index.html +0 -49
  137. package/test/backstop_data/html_report/index_bundle.js +0 -2
@@ -0,0 +1,504 @@
1
+ {% set exampleComponent = "links-list" %}
2
+
3
+ {% set iconSimple %}
4
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="1em" width="1em" class="inline-block align-middle"><path d="M19.71,20H4.29A2.28,2.28,0,0,1,2,17.71V6.29A2.28,2.28,0,0,1,4.29,4H7.72a2,2,0,0,1,1.44.61l1.19,1.24a.51.51,0,0,0,.36.15H20a2,2,0,0,1,2,2v9.71A2.28,2.28,0,0,1,19.71,20ZM4.29,6A.29.29,0,0,0,4,6.29V17.71a.29.29,0,0,0,.29.29H19.71a.29.29,0,0,0,.29-.29V8.5a.5.5,0,0,0-.5-.5h-9a2,2,0,0,1-1.44-.61L7.87,6.15A.55.55,0,0,0,7.51,6Z" fill="currentColor"></path></svg>
5
+ {% endset %}
6
+
7
+ {% set iconComplex %}
8
+ <div class="flex items-center justify-center p-sm -ml-sm bg-neutral-lighter rounded-full text-4xl">
9
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" height="1em" width="1em" class="inline-block align-middle"><path d="M19.71,20H4.29A2.28,2.28,0,0,1,2,17.71V6.29A2.28,2.28,0,0,1,4.29,4H7.72a2,2,0,0,1,1.44.61l1.19,1.24a.51.51,0,0,0,.36.15H20a2,2,0,0,1,2,2v9.71A2.28,2.28,0,0,1,19.71,20ZM4.29,6A.29.29,0,0,0,4,6.29V17.71a.29.29,0,0,0,.29.29H19.71a.29.29,0,0,0,.29-.29V8.5a.5.5,0,0,0-.5-.5h-9a2,2,0,0,1-1.44-.61L7.87,6.15A.55.55,0,0,0,7.51,6Z" fill="currentColor"></path></svg>
10
+ </div>
11
+ {% endset %}
12
+
13
+ {% set examples = [
14
+ {
15
+ "name": "default",
16
+ "data": {
17
+ "idPrefix": "default",
18
+ "items": [
19
+ {
20
+ "href": "#",
21
+ "text": "Item 1"
22
+ },
23
+ {
24
+ "href": "#",
25
+ "text": "Item 2"
26
+ },
27
+ {
28
+ "href": "#",
29
+ "text": "Item 3"
30
+ }
31
+ ],
32
+ "attributes": {
33
+ "aria-label": "Menu destacado"
34
+ }
35
+ }
36
+ },
37
+ {
38
+ "name": "with icon",
39
+ "data": {
40
+ "idPrefix": "with-icon",
41
+ "items": [
42
+ {
43
+ "href": "#",
44
+ "text": "Item 1",
45
+ "icon": {
46
+ "html": iconSimple | safe
47
+ }
48
+ },
49
+ {
50
+ "href": "#",
51
+ "text": "Item 2",
52
+ "icon": {
53
+ "html": iconSimple | safe
54
+ }
55
+ },
56
+ {
57
+ "href": "#",
58
+ "text": "Item 3",
59
+ "icon": {
60
+ "html": iconSimple | safe
61
+ }
62
+ }
63
+ ],
64
+ "attributes": {
65
+ "aria-label": "Menu destacado"
66
+ }
67
+ }
68
+ },
69
+ {
70
+ "name": "with classes applied",
71
+ "data": {
72
+ "idPrefix": "with-classes-applied",
73
+ "items": [
74
+ {
75
+ "href": "#",
76
+ "text": "Item grande con icono",
77
+ "classes": "flex justify-between items-center py-base text-2xl",
78
+ "icon": {
79
+ "html": iconComplex | safe
80
+ }
81
+ },
82
+ {
83
+ "href": "#",
84
+ "text": "Item grande con icono",
85
+ "classes": "flex justify-between items-center py-base text-2xl",
86
+ "icon": {
87
+ "html": iconComplex | safe
88
+ }
89
+ },
90
+ {
91
+ "href": "#",
92
+ "text": "Item grande con icono",
93
+ "classes": "flex justify-between items-center py-base text-2xl",
94
+ "icon": {
95
+ "html": iconComplex | safe
96
+ }
97
+ }
98
+ ],
99
+ "attributes": {
100
+ "aria-label": "Menu destacado"
101
+ }
102
+ }
103
+ },
104
+ {
105
+ "name": "with containerClasses applied",
106
+ "data": {
107
+ "idPrefix": "with-containerclasses",
108
+ "items": [
109
+ {
110
+ "href": "#",
111
+ "text": "Item 1",
112
+ "containerClasses": "px-base border border-neutral-base my-sm",
113
+ "icon": {
114
+ "html": iconSimple | safe
115
+ }
116
+ },
117
+ {
118
+ "href": "#",
119
+ "text": "Item 2",
120
+ "containerClasses": "my-base px-base border border-neutral-base rounded",
121
+ "icon": {
122
+ "html": iconSimple | safe
123
+ }
124
+ },
125
+ {
126
+ "href": "#",
127
+ "text": "Item 3",
128
+ "containerClasses": "px-base border border-neutral-base my-sm",
129
+ "icon": {
130
+ "html": iconSimple | safe
131
+ }
132
+ }
133
+ ],
134
+ "attributes": {
135
+ "aria-label": "Menu destacado"
136
+ }
137
+ }
138
+ },
139
+ {
140
+ "name": "with disabled item",
141
+ "data": {
142
+ "idPrefix": "with-disabled-item",
143
+ "items": [
144
+ {
145
+ "href": "#",
146
+ "text": "Item 1"
147
+ },
148
+ {
149
+ "href": "#",
150
+ "text": "Item 2"
151
+ },
152
+ {
153
+ "href": "#",
154
+ "text": "Item 3",
155
+ "disabled": true
156
+ }
157
+ ],
158
+ "attributes": {
159
+ "aria-label": "Menu destacado"
160
+ }
161
+ }
162
+ },
163
+ {
164
+ "name": "without href",
165
+ "data": {
166
+ "idPrefix": "without-href",
167
+ "items": [
168
+ {
169
+ "href": "#",
170
+ "text": "Item 1"
171
+ },
172
+ {
173
+ "text": "Item 2"
174
+ },
175
+ {
176
+ "href": "#",
177
+ "text": "Item 3"
178
+ }
179
+ ],
180
+ "attributes": {
181
+ "aria-label": "Menu destacado"
182
+ }
183
+ }
184
+ },
185
+ {
186
+ "name": "with active item",
187
+ "data": {
188
+ "idPrefix": "with-active-item",
189
+ "items": [
190
+ {
191
+ "href": "#",
192
+ "text": "Item 1"
193
+ },
194
+ {
195
+ "href": "#",
196
+ "text": "Item 2",
197
+ "active": true
198
+ },
199
+ {
200
+ "href": "#",
201
+ "text": "Item 3"
202
+ }
203
+ ],
204
+ "attributes": {
205
+ "aria-label": "Menu destacado"
206
+ }
207
+ }
208
+ },
209
+ {
210
+ "name": "with target in links",
211
+ "data": {
212
+ "idPrefix": "with-target-in-links",
213
+ "items": [
214
+ {
215
+ "href": "#",
216
+ "text": "Item 1",
217
+ "target": "_blank",
218
+ "attributes": {
219
+ "title": "Se abre en ventana nueva"
220
+ }
221
+ },
222
+ {
223
+ "href": "#",
224
+ "text": "Item 2",
225
+ "target": "_blank",
226
+ "attributes": {
227
+ "title": "Se abre en ventana nueva"
228
+ }
229
+ },
230
+ {
231
+ "href": "#",
232
+ "text": "Item 3",
233
+ "target": "_blank",
234
+ "attributes": {
235
+ "title": "Se abre en ventana nueva"
236
+ }
237
+ }
238
+ ],
239
+ "attributes": {
240
+ "aria-label": "Menu destacado"
241
+ }
242
+ }
243
+ },
244
+ {
245
+ "name": "with very long option text",
246
+ "data": {
247
+ "idPrefix": "with-very-long-option-text",
248
+ "items": [
249
+ {
250
+ "href": "#",
251
+ "text": "No debe haber enlaces de más de 250 caracteres, que es el máximo admitido en accesibilidad, con excepción de nombres de leyes. Nullam id dolor id nibh ultricies vehicula ut id elit. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Maecenas faucibus mollis interdum. Donec id elit non mi porta gravida at eget metus."
252
+ },
253
+ {
254
+ "href": "#",
255
+ "text": "No debe haber enlaces de más de 250 caracteres, que es el máximo admitido en accesibilidad, con excepción de nombres de leyes. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Donec sed odio dui. Duis mollis, est non commodo luctus, nisi erat porttitor ligula, eget lacinia odio sem nec elit. Cum sociis natoque penatibus et magnis dis parturient montes, nascetur ridiculus mus. Aenean eu leo quam. Pellentesque ornare sem lacinia quam venenatis vestibulum. Cras mattis consectetur purus sit amet fermentum."
256
+ },
257
+ {
258
+ "href": "#",
259
+ "text": "No debe haber enlaces de más de 250 caracteres, que es el máximo admitido en accesibilidad, con excepción de nombres de leyes. Fusce dapibus, tellus ac cursus commodo, tortor mauris condimentum nibh, ut fermentum massa justo sit amet risus. Etiam porta sem malesuada magna mollis euismod. Praesent commodo cursus magna, vel scelerisque nisl consectetur et. Etiam porta sem malesuada magna mollis euismod. Etiam porta sem malesuada magna mollis euismod. Donec sed odio dui. Sed posuere consectetur est at lobortis."
260
+ }
261
+ ],
262
+ "attributes": {
263
+ "aria-label": "Menu destacado"
264
+ }
265
+ }
266
+ },
267
+ {
268
+ "name": "with descriptive content",
269
+ "data": {
270
+ "idPrefix": "descriptive-example",
271
+ "items": [
272
+ {
273
+ "href": "#",
274
+ "text": "Item 1",
275
+ "sub": {
276
+ "html": "<p>Este es un párrafo explicativo metido con un sub.html dentro del Item</p>"
277
+ }
278
+ },
279
+ {
280
+ "href": "#",
281
+ "text": "Item 2",
282
+ "sub": {
283
+ "html": "<p>Este es un párrafo explicativo metido con un sub.html dentro del Item</p>"
284
+ }
285
+ },
286
+ {
287
+ "href": "#",
288
+ "text": "Item 3",
289
+ "sub": {
290
+ "html": "<p>Este es un párrafo explicativo metido con un sub.html dentro del Item</p>"
291
+ }
292
+ }
293
+ ],
294
+ "attributes": {
295
+ "aria-label": "Menu destacado"
296
+ }
297
+ }
298
+ },
299
+ {
300
+ "name": "with idPrefix",
301
+ "description": "See code to display the idPrefix applied",
302
+ "data": {
303
+ "idPrefix": "site-menu-item",
304
+ "items": [
305
+ {
306
+ "href": "#",
307
+ "text": "Option 1"
308
+ },
309
+ {
310
+ "href": "#",
311
+ "text": "Option 2"
312
+ },
313
+ {
314
+ "href": "#",
315
+ "text": "Option 3"
316
+ },
317
+ {
318
+ "href": "#",
319
+ "text": "Option 4"
320
+ },
321
+ {
322
+ "href": "#",
323
+ "text": "Option 5"
324
+ }
325
+ ],
326
+ "attributes": {
327
+ "aria-label": "Menu destacado"
328
+ }
329
+ }
330
+ },
331
+ {
332
+ "name": "with individual ids",
333
+ "description": "See code to display the ids applied",
334
+ "data": {
335
+ "items": [
336
+ {
337
+ "href": "#",
338
+ "text": "Option 1",
339
+ "id": "option-A"
340
+ },
341
+ {
342
+ "href": "#",
343
+ "text": "Option 2",
344
+ "id": "option-B"
345
+ },
346
+ {
347
+ "href": "#",
348
+ "text": "Option 3",
349
+ "id": "option-C"
350
+ },
351
+ {
352
+ "href": "#",
353
+ "text": "Option 4",
354
+ "id": "option-D"
355
+ },
356
+ {
357
+ "href": "#",
358
+ "text": "Option 5",
359
+ "id": "option-E"
360
+ }
361
+ ],
362
+ "attributes": {
363
+ "aria-label": "Menu destacado"
364
+ }
365
+ }
366
+ },
367
+ {
368
+ "name": "with attributes",
369
+ "description": "See code to display the attributes applied",
370
+ "data": {
371
+ "attributes": {
372
+ "id": "nav-id-example"
373
+ },
374
+ "items": [
375
+ {
376
+ "href": "#",
377
+ "text": "Option 1",
378
+ "attributes": {
379
+ "data-attribute-1": "value-A",
380
+ "data-attribute-2": "value-B",
381
+ "data-attribute-3": "value-C"
382
+ }
383
+ },
384
+ {
385
+ "href": "#",
386
+ "text": "Option 2",
387
+ "attributes": {
388
+ "data-attribute-1": "value-A",
389
+ "data-attribute-2": "value-B",
390
+ "data-attribute-3": "value-C"
391
+ }
392
+ },
393
+ {
394
+ "href": "#",
395
+ "text": "Option 3",
396
+ "attributes": {
397
+ "data-attribute-1": "value-A",
398
+ "data-attribute-2": "value-B",
399
+ "data-attribute-3": "value-C"
400
+ },
401
+ "sub": {
402
+ "attributes": {
403
+ "data-attribute-1": "value-A",
404
+ "data-attribute-2": "value-B",
405
+ "data-attribute-3": "value-C"
406
+ },
407
+ "html": '<p>Este es un párrafo explicativo metido con un sub.html dentro del Item</p><p>Este es otro párrafo.</p>'
408
+ }
409
+ },
410
+ {
411
+ "href": "#",
412
+ "text": "Option 4",
413
+ "attributes": {
414
+ "data-attribute-1": "value-A",
415
+ "data-attribute-2": "value-B",
416
+ "data-attribute-3": "value-C"
417
+ }
418
+ },
419
+ {
420
+ "href": "#",
421
+ "text": "Option 5",
422
+ "attributes": {
423
+ "data-attribute-1": "value-A",
424
+ "data-attribute-2": "value-B",
425
+ "data-attribute-3": "value-C"
426
+ }
427
+ }
428
+ ],
429
+ "attributes": {
430
+ "aria-label": "Menu destacado"
431
+ }
432
+ }
433
+ },
434
+ {
435
+ "name": "hasNav false",
436
+ "description": "Use this to not wrap the component in a nav tag, assuming the component will be wrapped with a custom nav with it's own aria-label if it's needed.",
437
+ "data": {
438
+ "idPrefix": "hasnav-false",
439
+ "hasNav": false,
440
+ "items": [
441
+ {
442
+ "href": "#",
443
+ "text": "Item 1"
444
+ },
445
+ {
446
+ "href": "#",
447
+ "text": "Item 2"
448
+ },
449
+ {
450
+ "href": "#",
451
+ "text": "Item 3"
452
+ }
453
+ ],
454
+ "attributes": {
455
+ "aria-label": "Menu destacado"
456
+ }
457
+ }
458
+ },
459
+ {
460
+ "name": "mixed example",
461
+ "data": {
462
+ "idPrefix": "mixed-example",
463
+ "items": [
464
+ {
465
+ "href": "#",
466
+ "html": "<strong>Deudas</strong>",
467
+ "classes": "flex justify-between items-center py-base text-lg",
468
+ "sub": {
469
+ "html": '<p class="c-paragraph-base mb-0">Tienes <span class="text-alert-base">deudas fuera de plazo</span></p>'
470
+ }
471
+ },
472
+ {
473
+ "href": "#",
474
+ "html": "<strong>Historial de pagos</strong>",
475
+ "classes": "flex justify-between items-center py-base text-lg"
476
+ },
477
+ {
478
+ "href": "#",
479
+ "html": "<strong>Certificado de corriente de pago</strong>",
480
+ "classes": "flex justify-between items-center py-base text-lg",
481
+ "sub": {
482
+ "html": '<p class="c-paragraph-base mb-0">Tienes <strong>1 certificado disponible</strong>.</p>'
483
+ }
484
+ },
485
+ {
486
+ "href": "#",
487
+ "html": "<strong>Valoraciones de inmuebles</strong>",
488
+ "classes": "flex justify-between items-center py-base text-lg"
489
+ },
490
+ {
491
+ "href": "#",
492
+ "html": "<strong>Aplazamiento y fraccionamiento</strong>",
493
+ "classes": "flex justify-between items-center py-base text-lg",
494
+ "sub": {
495
+ "html": '<p class="c-paragraph-base mb-0">Tienes 1 deuda fraccionada, has pagado <strong>2 fracciones</strong> de 5.</p>'
496
+ }
497
+ }
498
+ ],
499
+ "attributes": {
500
+ "aria-label": "Menu destacado"
501
+ }
502
+ }
503
+ }
504
+ ] %}
@@ -0,0 +1,3 @@
1
+ {% macro componentLinksList(params) %}
2
+ {% include "./_template.links-list.njk" %}
3
+ {% endmacro %}
@@ -0,0 +1,92 @@
1
+ {#- If an id 'prefix' is not passed, fall back to using the name attribute
2
+ instead. -#}
3
+ {% set idPrefix = params.idPrefix if params.idPrefix else "links-list-item" %}
4
+
5
+ {% set arrow %}
6
+ <svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" class="self-center" aria-hidden="true" focusable="false" width="1em" height="1em"><path d="M102.07 27.93l35 35a10 10 0 010 14.14l-35 35a10 10 0 01-14.14-14.14l13.66-13.66A2.5 2.5 0 0099.82 80H10a10 10 0 010-20h89.82a2.5 2.5 0 001.77-4.27L87.93 42.07a10 10 0 0114.14-14.14z" fill="currentColor"></path></svg>
7
+ {% endset %}
8
+
9
+
10
+ {% set innerHtml %}
11
+ <ul>
12
+ {% for item in params.items %}
13
+ {% if item %}
14
+ {#- If the user explicitly sets an id, use this instead of the regular idPrefix -#}
15
+ {%- if item.id -%}
16
+ {%- set id = item.id -%}
17
+ {%- else -%}
18
+ {#- The first id should not have a number suffix so it's easy to link to from the error summary component -#}
19
+ {%- if loop.first -%}
20
+ {%- set id = idPrefix %}
21
+ {% else %}
22
+ {%- set id = idPrefix + "-" + loop.index -%}
23
+ {%- endif -%}
24
+ {%- endif -%}
25
+ {% set subId = "sub-" + id %}
26
+ <li class="{% if item.containerClasses %}{{ item.containerClasses }}{% else %}px-base border-y border-neutral-base -my-px{% endif %}">
27
+ {% if item.href %}
28
+ <a {%- if id %} id="{{ id }}"{% endif %} href="{{ item.href }}" class="c-link {%- if item.classes %} {{ item.classes }}{% else %} flex justify-between items-center gap-base flex-1 py-base{% endif %} {%- if item.disabled %} text-neutral-base no-underline pointer-events-none{% endif %} {%- if item.active %} font-bold{% 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 -%}>
29
+ <div class="flex gap-base justify-between items-center flex-1">
30
+ {% if item.icon %}
31
+ <div class="{% if item.icon.containerClasses %}{{ item.icon.containerClasses }}{% else %}self-center h-full{% endif %}">
32
+ {% if item.icon.html %}
33
+ {{ item.icon.html | safe }}
34
+ {% endif %}
35
+ </div>
36
+ {% endif %}
37
+ <div class="flex-1">
38
+ {% if item.active %}
39
+ <strong>{{ item.html | safe if item.html else item.text }}</strong>
40
+ {% else %}
41
+ {{ item.html | safe if item.html else item.text }}
42
+ {% endif %}
43
+ </div>
44
+ </div>
45
+ {{ arrow | safe }}
46
+ </a>
47
+ {% else %}
48
+ <div {%- if id %} id="{{ id }}"{% endif %} class="{%- if item.classes %} {{ item.classes }}{% else %} flex justify-between items-center gap-base flex-1 py-base{% endif %} {%- if item.disabled %} text-neutral-base no-underline pointer-events-none{% endif %} {%- if item.active %} font-bold{% 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 -%}>
49
+ <div class="flex gap-base justify-between items-center flex-1">
50
+ {% if item.icon %}
51
+ <div class="{% if item.icon.containerClasses %}{{ item.icon.containerClasses }}{% else %}self-center h-full{% endif %}">
52
+ {% if item.icon.html %}
53
+ {{ item.icon.html | safe }}
54
+ {% endif %}
55
+ </div>
56
+ {% endif %}
57
+ <div class="flex-1">
58
+ {% if item.active %}
59
+ <strong>{{ item.html | safe if item.html else item.text }}</strong>
60
+ {% else %}
61
+ {{ item.html | safe if item.html else item.text }}
62
+ {% endif %}
63
+ </div>
64
+ </div>
65
+ </div>
66
+ {% endif %}
67
+ {% if item.sub.html %}
68
+ <div class="{%- if item.sub.classes %} {{ item.sub.classes }}{% else %} c-paragraph-base text-neutral-dark -mt-base mr-lg{% endif %}" id="{{ subId }}">
69
+ {{ item.sub.html | safe }}
70
+ </div>
71
+ {% endif %}
72
+ </li>
73
+ {% endif %}
74
+ {% endfor %}
75
+ </ul>
76
+ {% endset -%}
77
+
78
+ <!-- links-list -->
79
+
80
+
81
+ {% if params.hasNav == false %}
82
+ <div {%- if params.classes %} class="{{ params.classes }}"{% endif %}
83
+ {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
84
+ {{ innerHtml | trim | safe }}
85
+ </div>
86
+ {% else %}
87
+ <nav {%- if params.classes %} class="{{ params.classes }}"{% endif %}
88
+ {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
89
+ {{ innerHtml | trim | safe }}
90
+ </nav>
91
+ {% endif %}
92
+ <!-- /links-list -->
@@ -0,0 +1,82 @@
1
+ params:
2
+ - name: idPrefix
3
+ type: string
4
+ required: false
5
+ description: String to prefix id for each item if no id is specified on each item.
6
+ - name: hasNav
7
+ type: boolean
8
+ required: false
9
+ description: Defaults to `true`. If `false`, there will be no nav assuming the component will be wrapped with a custom nav with it's own aria-label.
10
+ - name: items
11
+ type: array
12
+ required: true
13
+ description: Array of nav items objects.
14
+ params:
15
+ - name: href
16
+ type: string
17
+ required: false
18
+ description: Item link.
19
+ - name: target
20
+ type: string
21
+ required: false
22
+ description: The target where the item should link to.
23
+ - name: text
24
+ type: string
25
+ required: true
26
+ description: If `html` is set, this is not required. Text to use within each nav item label. If `html` is provided, the `text` argument will be ignored.
27
+ - name: html
28
+ type: string
29
+ required: true
30
+ description: If `text` is set, this is not required. HTML to use within each nav item label. If `html` is provided, the `text` argument will be ignored.
31
+ - name: id
32
+ type: string
33
+ required: false
34
+ description: Specific id attribute for the item. If omitted, then idPrefix option will be applied.
35
+ - name: disabled
36
+ type: boolean
37
+ required: false
38
+ description: If true, nav will be disabled.
39
+ - name: sub
40
+ type: boolean
41
+ required: false
42
+ description: If true, content provided will be revealed when the item is expanded.
43
+ - name: html
44
+ type: string
45
+ required: true
46
+ description: Provide content for the sub.
47
+ - name: classes
48
+ type: string
49
+ required: false
50
+ description: Classes to add to the sub container.
51
+ - name: icon
52
+ type: object
53
+ required: false
54
+ description: This is the optional icon at left
55
+ - name: html
56
+ type: string
57
+ required: true
58
+ description: Use this html to insert a custom svg inline icon. If this is set, the type are not used.
59
+ - name: containerClasses
60
+ type: string
61
+ required: false
62
+ description: Classes applied to the parent div of icon. Useful to vertical align the icon.
63
+ - name: containerClasses
64
+ type: string
65
+ required: false
66
+ description: Classes to add to the parent `<li> of the item.
67
+ - name: classes
68
+ type: string
69
+ required: false
70
+ description: Classes to add to the item.
71
+ - name: attributes
72
+ type: object
73
+ required: false
74
+ description: HTML attributes (for example data attributes) to add to the item.
75
+ - name: classes
76
+ type: string
77
+ required: false
78
+ description: Classes to add to the nav container.
79
+ - name: attributes
80
+ type: object
81
+ required: false
82
+ description: HTML attributes (for example data attributes) to add to the nav container.
@@ -37,10 +37,6 @@ params:
37
37
  required: false
38
38
  description: Provide hint to each nav item.
39
39
  isComponent: true
40
- - name: expanded
41
- type: boolean
42
- required: false
43
- description: If true, nav sub will be expanded.
44
40
  - name: divider
45
41
  required: false
46
42
  description: If true, a divider border will be shown after the item.