desy-html 10.2.1 → 11.0.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.
package/docs/index.html CHANGED
@@ -38,6 +38,19 @@
38
38
 
39
39
  <h2>Changelog (English)</h2>
40
40
  <p>What's new in the latest version of desy-html</p>
41
+ <h3>v.11.0.1</h3>
42
+ <ul class="text-sm">
43
+ <li>Minor fixes.</li>
44
+ </ul>
45
+ <h3>v.11.0.0</h3>
46
+ <ul class="text-sm">
47
+ <li>Pagination now uses select instead of listbox and changes in parameters.</li>
48
+ </ul>
49
+ <h3>v.10.2.2</h3>
50
+ <ul class="text-sm">
51
+ <li>Added missing params in Toggle and Notification.</li>
52
+ <li>Accesibility fixes.</li>
53
+ </ul>
41
54
  <h3>v.10.2.1</h3>
42
55
  <ul class="text-sm">
43
56
  <li>Minor fixes in Tabs and Prose styles.</li>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "desy-html",
3
- "version": "10.2.1",
3
+ "version": "11.0.1",
4
4
  "description": "desy-html contains the code you need to start building a user interface for Gobierno de Aragón government webapps.",
5
5
  "type": "module",
6
6
  "author": {
@@ -25,11 +25,23 @@
25
25
  "html": "El documento se ha cargado correctamente"
26
26
  },
27
27
  "description":{
28
- "html": "Documento acreditativo de <em class=\" italic \">registro de alta de la asociación</em> puede verse publicado ya."
28
+ "html": '<p>Documento acreditativo de <em class=\" italic \">registro de alta de la asociación</em> puede verse publicado ya.</p>'
29
29
  },
30
30
  "id": "with-description"
31
31
  }
32
32
  },
33
+ {
34
+ "name": "con content",
35
+ "data": {
36
+ "title":{
37
+ "html": "El documento se ha cargado correctamente"
38
+ },
39
+ "content":{
40
+ "html": '<p>Documento acreditativo de <em class=\" italic \">registro de alta de la asociación</em> puede verse publicado ya.</p>'
41
+ },
42
+ "id": "with-content"
43
+ }
44
+ },
33
45
  {
34
46
  "name": "con items",
35
47
  "data": {
@@ -42,9 +42,13 @@
42
42
  {{ params.title.html | safe if params.title.html else params.title.text }}
43
43
  </p>
44
44
  {% endif %}
45
- {% if params.description %}
45
+ {% if params.description.html %}
46
+ <div {%- if params.description.classes %} class="{{ params.description.classes }}"{% endif %}>
47
+ {{ params.description.html | safe }}
48
+ </div>
49
+ {% elseif params.description.text %}
46
50
  <p {%- if params.description.classes %} class="{{ params.description.classes }}"{% endif %}>
47
- {{ params.description.html | safe if params.description.html else params.description.text }}
51
+ {{ params.description.text }}
48
52
  </p>
49
53
  {% endif %}
50
54
  {% if params.items %}
@@ -60,9 +64,13 @@
60
64
  {% endfor %}
61
65
  </ul>
62
66
  {% endif %}
63
- {% if params.content %}
64
- <p class="text-sm {%- if params.content.classes %} {{ params.content.classes }}{% endif %}">
65
- {{ params.content.html | safe if params.content.html else params.content.text }}
67
+ {% if params.content.html %}
68
+ <div class="{% if params.content.classes %}{{ params.content.classes }}{% else %}text-sm{% endif %}">
69
+ {{ params.content.html | safe }}
70
+ </div>
71
+ {% elseif params.content.text %}
72
+ <p class="{% if params.content.classes %}{{ params.content.classes }}{% else %}text-sm{% endif %}">
73
+ {{ params.content.text }}
66
74
  </p>
67
75
  {% endif %}
68
76
  </div>
@@ -35,6 +35,22 @@ params:
35
35
  type: string
36
36
  required: false
37
37
  description: Classes to add to the notification description.
38
+ - name: content
39
+ type: object
40
+ required: false
41
+ description: This is the optional content under the description and items
42
+ - name: text
43
+ type: string
44
+ required: true
45
+ description: If `html` is set, this is not required. Text to use within the title. If `html` is provided, the `text` argument will be ignored.
46
+ - name: html
47
+ type: string
48
+ required: true
49
+ description: If `text` is set, this is not required. HTML to use within the title. If `html` is provided, the `text` argument will be ignored.
50
+ - name: classes
51
+ type: string
52
+ required: false
53
+ description: Classes to add to the notification content.
38
54
  - name: items
39
55
  type: array
40
56
  required: false
@@ -9,28 +9,28 @@
9
9
  "itemsPerPage": "10",
10
10
  "items": [
11
11
  {
12
- "href": "#",
12
+ "value": "1",
13
13
  "text": 1
14
14
  },
15
15
  {
16
- "href": "#",
16
+ "value": "2",
17
17
  "text": 2,
18
- "active": true
18
+ "selected": true
19
19
  },
20
20
  {
21
- "href": "#",
21
+ "value": "3",
22
22
  "text": 3
23
23
  },
24
24
  {
25
- "href": "#",
25
+ "value": "4",
26
26
  "text": 4
27
27
  },
28
28
  {
29
- "href": "#",
29
+ "value": "5",
30
30
  "text": 5
31
31
  },
32
32
  {
33
- "href": "#",
33
+ "value": "6",
34
34
  "text": 6
35
35
  }
36
36
  ],
@@ -40,70 +40,70 @@
40
40
  }
41
41
  },
42
42
  {
43
- "name": "Estilo Listbox",
44
- "description": 'Usa el parámetro <code>"hasSelect": true</code> para mostrar la paginación como un Listbox en vez de botones.',
43
+ "name": "Estilo Select",
44
+ "description": 'Usa el parámetro <code>"hasSelect": true</code> para mostrar la paginación como un Select en vez de botones.',
45
45
  "data": {
46
- "id": "listbox-style",
46
+ "id": "select-style",
47
47
  "hasSelect": true,
48
48
  "idPrefix": "pagination-has-select",
49
49
  "totalItems": "64",
50
50
  "itemsPerPage": "10",
51
51
  "items": [
52
52
  {
53
- "href": "#",
53
+ "value": "1",
54
54
  "text": 1
55
55
  },
56
56
  {
57
- "href": "#",
57
+ "value": "2",
58
58
  "text": 2,
59
- "active": true
59
+ "selected": true
60
60
  },
61
61
  {
62
- "href": "#",
62
+ "value": "3",
63
63
  "text": 3
64
64
  },
65
65
  {
66
- "href": "#",
66
+ "value": "4",
67
67
  "text": 4
68
68
  },
69
69
  {
70
- "href": "#",
70
+ "value": "5",
71
71
  "text": 5
72
72
  },
73
73
  {
74
- "href": "#",
74
+ "value": "6",
75
75
  "text": 6
76
76
  },
77
77
  {
78
- "href": "#",
78
+ "value": "7",
79
79
  "text": 7
80
80
  },
81
81
  {
82
- "href": "#",
82
+ "value": "8",
83
83
  "text": 8
84
84
  },
85
85
  {
86
- "href": "#",
86
+ "value": "9",
87
87
  "text": 9
88
88
  },
89
89
  {
90
- "href": "#",
90
+ "value": "10",
91
91
  "text": 10
92
92
  },
93
93
  {
94
- "href": "#",
94
+ "value": "11",
95
95
  "text": 11
96
96
  },
97
97
  {
98
- "href": "#",
98
+ "value": "12",
99
99
  "text": 12
100
100
  },
101
101
  {
102
- "href": "#",
102
+ "value": "13",
103
103
  "text": 13
104
104
  },
105
105
  {
106
- "href": "#",
106
+ "value": "14",
107
107
  "text": 14
108
108
  }
109
109
  ],
@@ -120,33 +120,33 @@
120
120
  "data": {
121
121
  "id": "with-previous-page-disabled",
122
122
  "hasSelect": true,
123
- "idPrefix": "pagination-without-prev",
123
+ "idPrefix": "pagination-with-previous-page-disabled",
124
124
  "totalItems": "64",
125
125
  "itemsPerPage": "10",
126
126
  "items": [
127
127
  {
128
- "href": "#",
128
+ "value": "1",
129
129
  "text": 1,
130
- "active": true
130
+ "selected": true
131
131
  },
132
132
  {
133
- "href": "#",
133
+ "value": "2",
134
134
  "text": 2
135
135
  },
136
136
  {
137
- "href": "#",
137
+ "value": "3",
138
138
  "text": 3
139
139
  },
140
140
  {
141
- "href": "#",
141
+ "value": "4",
142
142
  "text": 4
143
143
  },
144
144
  {
145
- "href": "#",
145
+ "value": "5",
146
146
  "text": 5
147
147
  },
148
148
  {
149
- "href": "#",
149
+ "value": "6",
150
150
  "text": 6
151
151
  }
152
152
  ],
@@ -164,33 +164,33 @@
164
164
  "data": {
165
165
  "id": "without-previous-page",
166
166
  "hasSelect": true,
167
- "idPrefix": "pagination-without-prev",
167
+ "idPrefix": "pagination-without-previous-page",
168
168
  "totalItems": "64",
169
169
  "itemsPerPage": "10",
170
170
  "items": [
171
171
  {
172
- "href": "#",
172
+ "value": "1",
173
173
  "text": 1,
174
- "active": true
174
+ "selected": true
175
175
  },
176
176
  {
177
- "href": "#",
177
+ "value": "2",
178
178
  "text": 2
179
179
  },
180
180
  {
181
- "href": "#",
181
+ "value": "3",
182
182
  "text": 3
183
183
  },
184
184
  {
185
- "href": "#",
185
+ "value": "4",
186
186
  "text": 4
187
187
  },
188
188
  {
189
- "href": "#",
189
+ "value": "5",
190
190
  "text": 5
191
191
  },
192
192
  {
193
- "href": "#",
193
+ "value": "6",
194
194
  "text": 6
195
195
  }
196
196
  ],
@@ -208,33 +208,33 @@
208
208
  "data": {
209
209
  "id": "without-previous-page-disabled",
210
210
  "hasSelect": true,
211
- "idPrefix": "pagination-without-prev",
211
+ "idPrefix": "pagination-without-previous-page-disabled",
212
212
  "totalItems": "64",
213
213
  "itemsPerPage": "10",
214
214
  "items": [
215
215
  {
216
- "href": "#",
216
+ "value": "1",
217
217
  "text": 1
218
218
  },
219
219
  {
220
- "href": "#",
220
+ "value": "2",
221
221
  "text": 2,
222
- "active": true
222
+ "selected": true
223
223
  },
224
224
  {
225
- "href": "#",
225
+ "value": "3",
226
226
  "text": 3
227
227
  },
228
228
  {
229
- "href": "#",
229
+ "value": "4",
230
230
  "text": 4
231
231
  },
232
232
  {
233
- "href": "#",
233
+ "value": "5",
234
234
  "text": 5
235
235
  },
236
236
  {
237
- "href": "#",
237
+ "value": "6",
238
238
  "text": 6
239
239
  }
240
240
  ],
@@ -253,67 +253,67 @@
253
253
  "name": "Con página primera deshabilitada y última",
254
254
  "description": 'En este ejemplo <code>"hasSelect": true</code>, <code>"hasPrevious": false</code>, <code>"showFirst": true</code> y <code>"hasFirst": false</code>',
255
255
  "data": {
256
- "id": "listbox-style",
256
+ "id": "select-style-2",
257
257
  "hasSelect": true,
258
- "idPrefix": "pagination-has-select",
258
+ "idPrefix": "pagination-has-select-2",
259
259
  "totalItems": "64",
260
260
  "itemsPerPage": "10",
261
261
  "items": [
262
262
  {
263
- "href": "#",
263
+ "value": "1",
264
264
  "text": 1,
265
- "active": true
265
+ "selected": true
266
266
  },
267
267
  {
268
- "href": "#",
268
+ "value": "2",
269
269
  "text": 2
270
270
  },
271
271
  {
272
- "href": "#",
272
+ "value": "3",
273
273
  "text": 3
274
274
  },
275
275
  {
276
- "href": "#",
276
+ "value": "4",
277
277
  "text": 4
278
278
  },
279
279
  {
280
- "href": "#",
280
+ "value": "5",
281
281
  "text": 5
282
282
  },
283
283
  {
284
- "href": "#",
284
+ "value": "6",
285
285
  "text": 6
286
286
  },
287
287
  {
288
- "href": "#",
288
+ "value": "7",
289
289
  "text": 7
290
290
  },
291
291
  {
292
- "href": "#",
292
+ "value": "8",
293
293
  "text": 8
294
294
  },
295
295
  {
296
- "href": "#",
296
+ "value": "9",
297
297
  "text": 9
298
298
  },
299
299
  {
300
- "href": "#",
300
+ "value": "10",
301
301
  "text": 10
302
302
  },
303
303
  {
304
- "href": "#",
304
+ "value": "11",
305
305
  "text": 11
306
306
  },
307
307
  {
308
- "href": "#",
308
+ "value": "12",
309
309
  "text": 12
310
310
  },
311
311
  {
312
- "href": "#",
312
+ "value": "13",
313
313
  "text": 13
314
314
  },
315
315
  {
316
- "href": "#",
316
+ "value": "14",
317
317
  "text": 14
318
318
  }
319
319
  ],
@@ -331,58 +331,63 @@
331
331
  }
332
332
  },
333
333
  {
334
- "name": "con itemsListbox",
335
- "description": 'Usa el parámetro <code>itemsListbox</code> para mostrar un listbox que permite elegir el ´numero de items por página, a la derecha.',
334
+ "name": "con itemsPerPageSelector",
335
+ "description": 'Usa el parámetro <code>itemsPerPageSelector</code> para mostrar un select que permite elegir el número de items por página, a la derecha.',
336
336
  "data": {
337
- "id": "with-items-listbox",
338
- "idPrefix": "with-items-listbox",
337
+ "id": "with-items-per-page-selector",
338
+ "idPrefix": "with-items-per-page-selector",
339
339
  "totalItems": "64",
340
340
  "itemsPerPage": "10",
341
341
  "hasSelect": true,
342
- "itemsListbox": {
342
+ "itemsPerPageSelector": {
343
343
  "items": [
344
344
  {
345
+ "value": "10",
345
346
  "text": "10",
346
- "active": true
347
+ "selected": true
347
348
  },
348
349
  {
350
+ "value": "25",
349
351
  "text": "25"
350
352
  },
351
353
  {
354
+ "value": "50",
352
355
  "text": "50"
353
356
  },
354
357
  {
358
+ "value": "75",
355
359
  "text": "75"
356
360
  },
357
361
  {
362
+ "value": "100",
358
363
  "text": "100"
359
364
  }
360
365
  ]
361
366
  },
362
367
  "items": [
363
368
  {
364
- "href": "#",
369
+ "value": "1",
365
370
  "text": 1
366
371
  },
367
372
  {
368
- "href": "#",
373
+ "value": "2",
369
374
  "text": 2,
370
- "active": true
375
+ "selected": true
371
376
  },
372
377
  {
373
- "href": "#",
378
+ "value": "3",
374
379
  "text": 3
375
380
  },
376
381
  {
377
- "href": "#",
382
+ "value": "4",
378
383
  "text": 4
379
384
  },
380
385
  {
381
- "href": "#",
386
+ "value": "5",
382
387
  "text": 5
383
388
  },
384
389
  {
385
- "href": "#",
390
+ "value": "6",
386
391
  "text": 6
387
392
  }
388
393
  ],
@@ -1,5 +1,5 @@
1
1
  {% from "../button/_macro.button.njk" import componentButton %}
2
- {% from "components/listbox/_macro.listbox.njk" import componentListbox %}
2
+ {% from "components/select/_macro.select.njk" import componentSelect %}
3
3
 
4
4
 
5
5
  {#- If an id 'prefix' is not passed, fall back to using a default one
@@ -8,7 +8,7 @@
8
8
 
9
9
  {% set activePosition = "1" %}
10
10
  {% for item in params.items %}
11
- {% if item.active %}
11
+ {% if item.selected %}
12
12
  {% set activePosition = loop.index0 %}
13
13
  {% endif %}
14
14
  {% endfor %}
@@ -31,27 +31,23 @@
31
31
  <li>
32
32
  {% set prefix %}<span class="sr-only">Página&nbsp;</span>{% endset %}
33
33
  {% set suffix %}<span class="sr-only">&nbsp;(resultados del {{ loop.index | int * params.itemsPerPage | int }} al {% if ((loop.index | int + 1) * params.itemsPerPage | int) > ( params.totalItems | int ) %}{{ params.totalItems }}{% else %}{{ (loop.index | int + 1) * params.itemsPerPage | int }}{% endif %})</span>{% endset %}
34
- {% if item.active %}
34
+ {% if item.selected %}
35
35
  {{ componentButton({
36
36
  "html": '<strong>' + prefix | trim + loop.index + suffix | trim + '</strong>',
37
- "href": "#",
38
37
  "classes": "c-button--primary c-button--disabled mb-sm mr-sm",
39
38
  "disabled": true,
40
39
  "attributes": {
41
40
  "id": id,
42
41
  "aria-current": "page",
43
- "tabindex": "-1",
44
- "type": "button"
42
+ "tabindex": "-1"
45
43
  }
46
44
  }) | trim | indent(4) }}
47
45
  {% else %}
48
46
  {{ componentButton({
49
47
  "html": prefix + loop.index + suffix,
50
- "href": "#",
51
48
  "classes": "mb-sm mr-sm",
52
49
  "attributes": {
53
- "id": id,
54
- "type": "button"
50
+ "id": id
55
51
  }
56
52
  }) | trim | indent(4) }}
57
53
  {% endif %}
@@ -72,31 +68,27 @@
72
68
  {% endset %}
73
69
  <div id="{{ params.id }}" class="lg:flex lg:flex-wrap lg:items-center lg:gap-base{%- if params.containerClasses %} {{ params.containerClasses }}{% endif %}">
74
70
  {% if params.hasSelect %}
75
- <p class="w-full mb-xs text-sm text-neutral-dark">
76
- Selecciona una página para cargar datos
71
+ <p id="{{ params.id }}-label" class="w-full mb-xs text-sm text-neutral-dark">
72
+ Selecciona para cargar datos automáticamente
77
73
  </p>
78
74
  <nav {{- commonAttributes | safe }}>
79
75
  {% if params.showFirst %}
80
76
  {{ componentButton({
81
77
  "html": '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" class="self-center h-2.5 w-2.5 mr-2" aria-hidden="true" focusable="false"><g><path d="M10.42,12a2.64,2.64,0,0,1,.77-1.88L20.73.58a1.77,1.77,0,0,1,2.5,2.5l-8.74,8.74a.27.27,0,0,0,0,.36l8.74,8.74a1.77,1.77,0,0,1-2.5,2.5l-9.54-9.54A2.64,2.64,0,0,1,10.42,12Z" fill="currentColor"></path><path d="M.25,12A2.65,2.65,0,0,1,1,10.12L10.57.58a1.77,1.77,0,0,1,2.5,2.5L4.33,11.82a.25.25,0,0,0,0,.36l8.74,8.74a1.77,1.77,0,0,1-2.5,2.5L1,13.88A2.65,2.65,0,0,1,.25,12Z" fill="currentColor"></path></g></svg>' + prefix + params.firstText + previousSuffix,
82
- "href": "#",
83
78
  "disabled": disabledFirst,
84
79
  "classes": "c-button--sm c-button--transparent mr-xs",
85
80
  "attributes": {
86
- "id": params.idPrefix + "-first",
87
- "type": "button"
81
+ "id": params.idPrefix + "-first"
88
82
  }
89
83
  }) | trim | indent(4) }}
90
84
  {% endif %}
91
85
  {% if params.showPrevious != false %}
92
86
  {{ componentButton({
93
87
  "html": '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" width="1em" height="1em" class="self-center h-2.5 w-2.5 mr-2" aria-hidden="true" focusable="false"><path d="M54.87 71.77a2.5 2.5 0 010-3.54L106 17.07A10 10 0 1091.89 2.93L35.43 59.39a15 15 0 000 21.22l56.46 56.46A10 10 0 10106 122.93z" fill="currentColor" /></svg>' + prefix + params.previousText + previousSuffix,
94
- "href": "#",
95
88
  "disabled": disabledPrevious,
96
89
  "classes": "c-button--sm c-button--transparent mr-xs",
97
90
  "attributes": {
98
- "id": params.idPrefix + "-previous",
99
- "type": "button"
91
+ "id": params.idPrefix + "-previous"
100
92
  }
101
93
  }) | trim | indent(4) }}
102
94
  {% endif %}
@@ -104,41 +96,35 @@
104
96
  {% if params.showFirst or params.showLast %}
105
97
  <p class="lg:hidden mr-xs text-sm text-neutral-dark">Página actual:</p>
106
98
  {% endif %}
107
- {{ componentListbox({
99
+ {{ componentSelect({
108
100
  "id": params.id + "-listbox",
109
- "idPrefix": params.idPrefix,
101
+ "name": params.id + "-listbox",
110
102
  "text": "Página " + params.items[activePosition].text,
111
- "classes": "c-listbox--sm c-listbox--transparent mr-xs",
112
- "classesTooltip": "max-h-52 overflow-y-auto",
113
- "doesChangeButtonText": true,
114
- "label": {
115
- "text": "Selecciona una página para cargar datos",
116
- "classes": "sr-only"
103
+ "classes": "c-select--sm c-select--transparent",
104
+ "formGroup": {
105
+ "classes": "-mt-sm mb-0 mr-xs"
117
106
  },
118
- "items": params.items
107
+ "items": params.items,
108
+ "describedBy": params.id + "-label"
119
109
  }) | trim | indent(4) }}
120
110
  </div>
121
111
  {% if params.showNext != false %}
122
112
  {{ componentButton({
123
113
  "html": prefix + params.nextText + nextSuffix + '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 140 140" width="1em" height="1em" class="self-center h-2.5 w-2.5 ml-2" aria-hidden="true" focusable="false"><path d="M34 137.07a10 10 0 010-14.14l51.13-51.16a2.5 2.5 0 000-3.54L34 17.07A10 10 0 0148.11 2.93l56.46 56.46a15 15 0 010 21.22l-56.46 56.46a10 10 0 01-14.11 0z" fill="currentColor" /></svg>',
124
- "href": "#",
125
114
  "disabled": disabledNext,
126
115
  "classes": "c-button--sm c-button--transparent mr-xs",
127
116
  "attributes": {
128
- "id": params.idPrefix + "-next",
129
- "type": "button"
117
+ "id": params.idPrefix + "-next"
130
118
  }
131
119
  }) | trim | indent(4) }}
132
120
  {% endif %}
133
121
  {% if params.showLast %}
134
122
  {{ componentButton({
135
123
  "html": prefix + params.lastText + nextSuffix + '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" width="1em" height="1em" class="self-center h-2.5 w-2.5 ml-2" aria-hidden="true" focusable="false"><g><path d="M13.58,12a2.64,2.64,0,0,1-.77,1.88L3.27,23.42a1.77,1.77,0,0,1-2.5-2.5l8.74-8.74a.27.27,0,0,0,0-.36L.77,3.08A1.77,1.77,0,0,1,3.27.58l9.54,9.54A2.64,2.64,0,0,1,13.58,12Z" fill="currentColor"></path><path d="M23.75,12A2.65,2.65,0,0,1,23,13.88l-9.54,9.54a1.77,1.77,0,0,1-2.5-2.5l8.74-8.74a.25.25,0,0,0,0-.36L10.93,3.08a1.77,1.77,0,0,1,2.5-2.5L23,10.12A2.65,2.65,0,0,1,23.75,12Z" fill="currentColor"></path></g></svg>',
136
- "href": "#",
137
124
  "disabled": disabledLast,
138
125
  "classes": "c-button--sm c-button--transparent mr-xs",
139
126
  "attributes": {
140
- "id": params.idPrefix + "-last",
141
- "type": "button"
127
+ "id": params.idPrefix + "-last"
142
128
  }
143
129
  }) | trim | indent(4) }}
144
130
  {% endif %}
@@ -150,16 +136,19 @@
150
136
  </ul>
151
137
  </nav>
152
138
  {% endif %}
153
- {% if params.itemsListbox %}
139
+ {% if params.itemsPerPageSelector %}
154
140
  <div class="block relative -top-xs lg:ml-auto text-sm text-neutral-dark">
155
- {{ componentListbox({
141
+ {{ componentSelect({
156
142
  "id": "items-listbox-" + idPrefix,
143
+ "name": "items-listbox-" + idPrefix,
157
144
  "text": params.itemsPerPage,
158
- "label": params.itemsListbox.label if params.itemsListbox.label else { "text": "Items por página: ", "classes": "inline-block flex align-middle mb-[0]" },
159
- "doesChangeButtonText": true,
160
- "classesContainer": "flex flex-wrap items-center gap-xs",
161
- "classes": "c-listbox--sm c-listbox--transparent",
162
- "items": params.itemsListbox.items
145
+ "label": params.itemsPerPageSelector.label if params.itemsPerPageSelector.label else { "text": "Items por página: ", "classes": "inline-block flex align-middle mb-[0]" },
146
+ "classes": "c-select--sm c-select--transparent",
147
+ "formGroup": {
148
+ "classes": "flex flex-wrap place-items-baseline gap-xs -mt-sm mb-0 mr-xs"
149
+ },
150
+ "items": params.itemsPerPageSelector.items,
151
+ "describedBy": params.id + "-label"
163
152
  }) | indent(4) }}
164
153
  </div>
165
154
  {% endif %}
@@ -71,10 +71,10 @@ params:
71
71
  type: string
72
72
  required: false
73
73
  description: Text for the last button. Defaults to "Última".
74
- - name: itemsListbox
74
+ - name: itemsPerPageSelector
75
75
  type: object
76
76
  required: false
77
- description: Options for a listbox component to choose number of items per page.
77
+ description: Options for a select component to choose number of items per page.
78
78
  - name: label
79
79
  type: object
80
80
  required: true
@@ -4,6 +4,7 @@
4
4
  "name": "por defecto",
5
5
  "description": 'Apariencia de botón, sin cambio en el texto del botón, sólo cambia su estado visual. Necesita un elemento externo con un <code>id</code> para referenciarlo con su <code>aria-controls</code> para mostrar/ocultar ese elemento externo.',
6
6
  "data": {
7
+ "id": "toggle-default",
7
8
  "classes": "c-button",
8
9
  "offState": {
9
10
  "classes": "",
@@ -38,6 +39,7 @@
38
39
  "name": "2 iconos",
39
40
  "description": 'Apariencia de botón, sin cambio en el texto del botón, sólo cambian sus iconos. Necesita un elemento externo con un <code>id</code> para referenciarlo con su <code>aria-controls</code> para mostrar/ocultar ese elemento externo.',
40
41
  "data": {
42
+ "id": "toggle-2-icons",
41
43
  "classes": "c-button c-button--sm",
42
44
  "offState": {
43
45
  "classes": "",
@@ -56,6 +58,7 @@
56
58
  "name": "no expandible",
57
59
  "description": 'Usa <code>"isExpandible": false</code>. En lugar de usar <code>aria-expanded</code> usará <code>aria-pressed</code>.',
58
60
  "data": {
61
+ "id": "toggle-not-expandible",
59
62
  "isExpandible": false,
60
63
  "classes": "c-button",
61
64
  "offState": {
@@ -89,6 +92,7 @@
89
92
  "name": "Pressed",
90
93
  "description": 'Usa <code>"pressed": true</code> para activarlo inicialmente.',
91
94
  "data": {
95
+ "id": "toggle-pressed",
92
96
  "pressed": true,
93
97
  "classes": "c-button",
94
98
  "offState": {
@@ -105,6 +109,7 @@
105
109
  "name": "isSwitch",
106
110
  "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
111
  "data": {
112
+ "id": "toggle-isswitch",
108
113
  "classes": "focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black",
109
114
  "isSwitch": true,
110
115
  "offState": {
@@ -124,6 +129,7 @@
124
129
  "name": "isSwitch pressed",
125
130
  "description": 'Usa <code>"pressed": true</code> para activarlo inicialmente.',
126
131
  "data": {
132
+ "id": "toggle-isswitch-pressed",
127
133
  "classes": "focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black",
128
134
  "pressed": true,
129
135
  "isSwitch": true,
@@ -163,6 +169,7 @@
163
169
  {
164
170
  "name": "isSwitch peque",
165
171
  "data": {
172
+ "id": "toggle-small",
166
173
  "classes": "focus:bg-warning-base focus:outline-none focus:shadow-outline-focus focus:text-black",
167
174
  "isSwitch": true,
168
175
  "offState": {
@@ -1,4 +1,8 @@
1
1
  params:
2
+ - name: id
3
+ type: string
4
+ required: true
5
+ description: Required id attribute to add to the button for activation.
2
6
  - name: isExpandible
3
7
  type: boolean
4
8
  required: false