desy-html 6.4.1 → 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.
- package/config/tailwind.config.js +32 -2
- package/docs/_global.head.njk +2 -0
- package/docs/_include.template-header.njk +8 -0
- package/docs/_macro.example-render.njk +8 -0
- package/docs/catalogo.html +2 -0
- package/docs/componentes.html +6 -0
- package/docs/ds/_ds.example.card.njk +199 -0
- package/docs/ds/_ds.example.checkboxes.njk +4 -4
- package/docs/ds/_ds.example.header-advanced.njk +0 -75
- package/docs/ds/_ds.example.links-list.njk +171 -0
- package/docs/ds/_ds.example.pills.njk +1 -1
- package/docs/ds/_ds.example.textos.njk +3 -1
- package/docs/ds/_ds.section.informacion.njk +13 -0
- package/docs/ds/_ds.section.navigation.njk +4 -0
- package/docs/ds/_ds.section.textos.njk +44 -20
- package/docs/examples-card.html +5 -0
- package/docs/examples-links-list.html +5 -0
- package/docs/index.html +17 -3
- package/gulpfile.js +3 -2
- package/package.json +6 -3
- package/src/css/component.text.css +14 -0
- package/src/js/aria/tabs.js +3 -1
- package/src/templates/components/button-loader/_template.button-loader.njk +3 -15
- package/src/templates/components/card/_examples.card.njk +277 -0
- package/src/templates/components/card/_macro.card.njk +3 -0
- package/src/templates/components/card/_template.card.njk +35 -0
- package/src/templates/components/card/params.card.yaml +113 -0
- package/src/templates/components/collapsible/_template.collapsible.njk +1 -1
- package/src/templates/components/header/_template.header.njk +1 -1
- package/src/templates/components/header-advanced/_examples.header-advanced.njk +101 -14
- package/src/templates/components/header-advanced/_template.header-advanced.njk +3 -3
- package/src/templates/components/links-list/_examples.links-list.njk +504 -0
- package/src/templates/components/links-list/_macro.links-list.njk +3 -0
- package/src/templates/components/links-list/_template.links-list.njk +92 -0
- package/src/templates/components/links-list/params.links-list.yaml +82 -0
- package/src/templates/components/menu-vertical/params.menu-vertical.yaml +0 -4
- package/src/templates/components/table/_examples.table.njk +4 -48
- package/src/templates/components/table-advanced/_examples.table-advanced.njk +6 -51
- package/docs/examples-header-advanced-2.html +0 -5
- package/src/templates/components/header-advanced/_examples.header-advanced-2.njk +0 -911
|
@@ -27,7 +27,7 @@
|
|
|
27
27
|
{% if params.super.customHtml %}
|
|
28
28
|
{{ params.super.customHtml }}
|
|
29
29
|
{% else %}
|
|
30
|
-
<div class="{% if params.super.classes %}{{ params.super.classes }}{% else-%} h-32 bg-cover bg-no-repeat overflow-hidden{% endif %}" style="background-color: {{ params.super.backgroundFullColor }}; {% if params.super.backgroundFullUrl %} background-image: url('{{ params.super.backgroundFullUrl }}'){% endif %}">
|
|
30
|
+
<div class="{% if params.super.classes %}{{ params.super.classes }}{% else-%} h-32 bg-cover bg-center bg-no-repeat overflow-hidden{% endif %}" style="background-color: {{ params.super.backgroundFullColor }}; {% if params.super.backgroundFullUrl %} background-image: url('{{ params.super.backgroundFullUrl }}'){% endif %}">
|
|
31
31
|
<div class="container h-full mx-auto px-base">
|
|
32
32
|
<div class="relative h-full bg-cover bg-no-repeat" {% if params.super.backgroundContainerUrl %} style="background-image: url('{{ params.super.backgroundContainerUrl }}')"{% endif %}>
|
|
33
33
|
{% if params.super.logo %}
|
|
@@ -78,7 +78,7 @@
|
|
|
78
78
|
</div>
|
|
79
79
|
</div>
|
|
80
80
|
{% endif %}
|
|
81
|
-
<div class="bg-neutral-lighter border-b border-neutral-base"
|
|
81
|
+
<div class="bg-neutral-lighter border-b border-neutral-base">
|
|
82
82
|
<div class="container mx-auto px-base">
|
|
83
83
|
<div class="flex items-center justify-between min-h-14">
|
|
84
84
|
<div class="flex flex-wrap items-center">
|
|
@@ -149,7 +149,7 @@
|
|
|
149
149
|
{% else %}
|
|
150
150
|
<div class="{% if params.sub.classes %}{{ params.sub.classes }}{% else-%} h-32 bg-cover bg-no-repeat overflow-hidden{% endif %}" style="background-color: {{ params.sub.backgroundFullColor }}; {% if params.sub.backgroundFullUrl %} background-image: url('{{ params.sub.backgroundFullUrl }}'){% endif %}">
|
|
151
151
|
<div class="container h-full mx-auto px-base">
|
|
152
|
-
<div class="relative h-full bg-cover bg-no-repeat" {% if params.sub.backgroundContainerUrl %} style="background-image: url('{{ params.sub.backgroundContainerUrl }}')"{% endif %}>
|
|
152
|
+
<div class="relative h-full bg-cover bg-center bg-no-repeat" {% if params.sub.backgroundContainerUrl %} style="background-image: url('{{ params.sub.backgroundContainerUrl }}')"{% endif %}>
|
|
153
153
|
{% if params.sub.logo %}
|
|
154
154
|
<a href="{{ params.sub.logo.href | default('/') }}" class="{% if params.sub.logo.classes %}{{ params.sub.logo.classes }}{% else-%} absolute top-6 left-0 focus:outline-none focus:shadow-outline-black{% endif %}">
|
|
155
155
|
<img src="{{ params.sub.logo.url}}" alt="{{ params.sub.logo.alt}}">
|
|
@@ -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,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 -->
|