desy-html 11.1.2 → 11.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 (38) hide show
  1. package/docs/ds/_ds.example.botones-primary-lg.njk +265 -0
  2. package/docs/ds/_ds.example.dropdowns-variaciones.njk +37 -0
  3. package/docs/ds/_ds.example.listbox-variaciones.njk +137 -0
  4. package/docs/ds/_ds.example.tabs.njk +44 -0
  5. package/docs/ds/_ds.example.textos.njk +5 -0
  6. package/docs/ds/_ds.section.botones.njk +5 -0
  7. package/docs/ds/_ds.section.textos.njk +11 -1
  8. package/docs/index.html +9 -0
  9. package/package.json +2 -2
  10. package/src/css/component.text.css +34 -26
  11. package/src/js/aria/linksList.js +42 -0
  12. package/src/js/aria/treeitem.js +9 -2
  13. package/src/js/desy-html.js +10 -0
  14. package/src/js/index.js +2 -0
  15. package/src/templates/components/button/_examples.button.njk +9 -2
  16. package/src/templates/components/button/_styles.button.css +7 -0
  17. package/src/templates/components/button-loader/_examples.button-loader.njk +8 -1
  18. package/src/templates/components/button-loader/_styles.button-loader.css +6 -0
  19. package/src/templates/components/dropdown/_examples.dropdown.njk +8 -0
  20. package/src/templates/components/dropdown/_styles.dropdown.css +7 -0
  21. package/src/templates/components/links-list/_examples.links-list.njk +28 -5
  22. package/src/templates/components/links-list/_template.links-list.njk +4 -4
  23. package/src/templates/components/listbox/_examples.listbox.njk +36 -1
  24. package/src/templates/components/listbox/_styles.listbox.css +7 -0
  25. package/src/templates/components/listbox/_template.listbox.njk +2 -2
  26. package/src/templates/components/menu-navigation/_examples.menu-navigation.njk +87 -3
  27. package/src/templates/components/menu-navigation/_styles.menu-navigation.css +7 -0
  28. package/src/templates/components/menubar/_examples.menubar.njk +154 -0
  29. package/src/templates/components/menubar/_styles.menubar.css +8 -1
  30. package/src/templates/components/table-advanced/_examples.table-advanced.njk +90 -0
  31. package/src/templates/components/table-advanced/_template.table-advanced.njk +3 -3
  32. package/src/templates/components/table-advanced/params.table-advanced.yaml +4 -0
  33. package/src/templates/components/tabs/_examples.tabs.njk +43 -0
  34. package/src/templates/components/tabs/_styles.tabs.css +30 -7
  35. package/src/templates/components/tabs/_template.tabs.njk +1 -1
  36. package/src/templates/components/tabs/params.tabs.yaml +4 -0
  37. package/src/templates/components/tree/_examples.tree.njk +113 -0
  38. package/src/templates/components/tree/_template.tree.njk +2 -2
@@ -9,43 +9,43 @@
9
9
  @apply font-bold;
10
10
  @apply leading-tight;
11
11
  }
12
-
12
+
13
13
  .c-h1 {
14
14
  @apply mb-lg;
15
15
  @apply text-3xl;
16
16
  @apply font-bold;
17
17
  @apply leading-tight;
18
18
  }
19
-
19
+
20
20
  .c-h2 {
21
21
  @apply mb-base;
22
22
  @apply text-2xl;
23
23
  @apply font-bold;
24
24
  @apply leading-tight;
25
25
  }
26
-
26
+
27
27
  .c-h3 {
28
28
  @apply mb-sm;
29
29
  @apply text-lg;
30
30
  @apply font-bold;
31
31
  @apply leading-tight;
32
32
  }
33
-
33
+
34
34
  .c-h4 {
35
35
  @apply mb-sm;
36
36
  @apply text-base;
37
37
  @apply font-bold;
38
38
  @apply leading-tight;
39
39
  }
40
-
40
+
41
41
  .c-link {
42
42
  @apply text-primary-base;
43
43
  @apply underline;
44
-
44
+
45
45
  &:hover {
46
46
  @apply text-primary-dark;
47
47
  }
48
-
48
+
49
49
  &:focus {
50
50
  @apply bg-warning-base;
51
51
  @apply shadow-outline-focus;
@@ -53,26 +53,26 @@
53
53
  @apply text-black;
54
54
  }
55
55
  }
56
-
56
+
57
57
  .c-link--alert {
58
58
  @apply text-alert-base;
59
59
  @apply underline;
60
60
  @apply font-semibold;
61
-
61
+
62
62
  &:hover {
63
63
  @apply text-alert-dark;
64
64
  }
65
65
  }
66
-
66
+
67
67
  .c-link--neutral {
68
68
  @apply text-neutral-dark;
69
69
  @apply underline;
70
-
70
+
71
71
  &:hover {
72
72
  @apply text-black;
73
73
  }
74
74
  }
75
-
75
+
76
76
  .c-link--full {
77
77
  &::after {
78
78
  content:"";
@@ -80,31 +80,40 @@
80
80
  @apply inset-0;
81
81
  }
82
82
  }
83
-
83
+
84
+ .c-link--no-underline {
85
+ @apply text-current;
86
+ @apply no-underline;
87
+
88
+ &:hover {
89
+ @apply underline;
90
+ }
91
+ }
92
+
84
93
  .c-paragraph-lg {
85
94
  @apply mb-lg;
86
95
  @apply text-lg;
87
96
  }
88
-
97
+
89
98
  .c-paragraph-base {
90
99
  @apply mb-base;
91
100
  @apply text-base;
92
101
  }
93
-
102
+
94
103
  .c-paragraph-sm {
95
104
  @apply mb-sm;
96
105
  @apply text-sm;
97
106
  }
98
-
107
+
99
108
  .c-ul {
100
109
  @apply mb-base;
101
110
  @apply list-none;
102
-
111
+
103
112
  li {
104
113
  @apply relative;
105
114
  @apply mb-base;
106
115
  @apply pl-8;
107
-
116
+
108
117
  &::before {
109
118
  content: "";
110
119
  @apply absolute;
@@ -115,32 +124,32 @@
115
124
  @apply bg-black;
116
125
  @apply rounded-full;
117
126
  }
118
-
127
+
119
128
  &:last-of-type {
120
129
  @apply mb-0;
121
130
  }
122
131
  }
123
132
  }
124
-
133
+
125
134
  .c-ul--no-bullets {
126
135
  li {
127
136
  @apply pl-0;
128
-
137
+
129
138
  &::before {
130
139
  @apply hidden;
131
140
  }
132
141
  }
133
142
  }
134
-
143
+
135
144
  .c-ol {
136
145
  @apply mb-base;
137
146
  counter-reset: list-counter;
138
-
147
+
139
148
  li {
140
149
  @apply relative;
141
150
  @apply mb-base;
142
151
  @apply pl-8;
143
-
152
+
144
153
  &::before {
145
154
  counter-increment: list-counter;
146
155
  content: counter(list-counter) ".";
@@ -148,11 +157,10 @@
148
157
  left: .25rem;
149
158
  @apply text-black;
150
159
  }
151
-
160
+
152
161
  &:last-of-type {
153
162
  @apply mb-0;
154
163
  }
155
164
  }
156
165
  }
157
166
  }
158
-
@@ -0,0 +1,42 @@
1
+ export function LinksList(aria) {
2
+
3
+ aria.linksListInit = function (domNode) {
4
+ this.rootEl = domNode;
5
+ };
6
+
7
+ window.activateItemLinksList = function (wrapperId, activeItemId) {
8
+ const activeItem = document.querySelector(`#${wrapperId} #${activeItemId}`);
9
+ if (activeItem) {
10
+ activateElement(wrapperId, activeItemId);
11
+ return [activeItem];
12
+ } else {
13
+ console.log('There is no element with this id in the menu.');
14
+ return null;
15
+ }
16
+ };
17
+
18
+ function activateElement(wrapperId, elementActive) {
19
+ const getWrapper = document.getElementById(wrapperId);
20
+ getWrapper.querySelectorAll('li').forEach((element) => {
21
+ const getLink = element.querySelector('a');
22
+ if (getLink) {
23
+ if (getLink.id === elementActive) {
24
+ wrapActiveElement(getLink);
25
+ } else {
26
+ deactivateElement(getLink);
27
+ }
28
+ }
29
+ });
30
+ };
31
+
32
+ function wrapActiveElement(elementActive) {
33
+ const getText = elementActive.querySelector('div[data-element="c-links-list__text"]');
34
+ getText.innerHTML = `<strong class="font-bold">${elementActive.textContent}</strong>`;
35
+ };
36
+
37
+ function deactivateElement(elementDeactivated) {
38
+ const getText = elementDeactivated.querySelector('div[data-element="c-links-list__text"]');
39
+ const replaceStrong = getText.textContent.replace('<strong class="font-bold">', '').replace('<strong/>', '');
40
+ getText.textContent = `${replaceStrong}`;
41
+ };
42
+ }
@@ -285,9 +285,11 @@ export function Treeitem(aria) {
285
285
  }
286
286
 
287
287
  if(typeof itemsIds !== 'object' && open !== null) {
288
+ const getElement = document.querySelector(`nav #${elementId}`);
289
+ const isTreeNavigation = getElement.hasAttribute('data-tree-navigation');
288
290
  const selectItem = document.querySelector(`#${elementId} #${itemsIds}`)
289
291
  if(selectItem) {
290
- activateElement(selectItem, open)
292
+ activateElement(selectItem, open, isTreeNavigation)
291
293
  } else {
292
294
  returnMessage()
293
295
  }
@@ -306,9 +308,14 @@ export function Treeitem(aria) {
306
308
  }
307
309
  }
308
310
 
309
- function activateElement(item, open) {
311
+ function activateElement(item, open, treeNav = false) {
310
312
  if(open === true) {
311
313
  item.setAttribute('aria-expanded', 'true');
314
+ if(treeNav) {
315
+ const getLink = item.querySelector('a')
316
+ getLink.setAttribute("aria-current", "page");
317
+ getLink.innerHTML = `<strong class="font-bold">${getLink.textContent}</strong>`;
318
+ }
312
319
  recursiveParent(item)
313
320
  } else {
314
321
  item.setAttribute('aria-expanded', 'false');
@@ -8,6 +8,7 @@ import { PopupMenuAction } from './aria/PopupMenuAction.js';
8
8
  import { MenubarItemAction } from './aria/MenubarItemAction.js';
9
9
  import { MenubarAction } from './aria/MenubarAction.js';
10
10
  import { listbox } from './aria/listbox.js';
11
+ import { LinksList } from './aria/linksList.js';
11
12
  import { alert } from './aria/alert.js';
12
13
  import { Treeitem } from './aria/treeitem.js';
13
14
  import { Tree } from './aria/tree.js';
@@ -246,6 +247,15 @@ export function listboxComponent(aria) {
246
247
  }
247
248
  }
248
249
 
250
+ export function linksListComponent(aria) {
251
+ LinksList(aria);
252
+
253
+ const modules = document.querySelectorAll('[data-module="c-links-list"]');
254
+ [...modules].forEach((module) => {
255
+ aria.linksListInit(module);
256
+ });
257
+ }
258
+
249
259
  export function menubarComponent(aria) {
250
260
  PopupMenuItemAction(aria);
251
261
  PopupMenuAction(aria);
package/src/js/index.js CHANGED
@@ -10,6 +10,7 @@ import {
10
10
  dialogComponent,
11
11
  dropdownComponent,
12
12
  listboxComponent,
13
+ linksListComponent,
13
14
  menubarComponent,
14
15
  tableAdvancedComponent,
15
16
  tabsComponent,
@@ -35,6 +36,7 @@ collapsibleComponent(aria);
35
36
  dialogComponent(aria);
36
37
  dropdownComponent(aria);
37
38
  listboxComponent(aria);
39
+ linksListComponent(aria);
38
40
  menubarComponent(aria);
39
41
  tableAdvancedComponent(aria);
40
42
  tabsComponent(aria);
@@ -173,6 +173,13 @@
173
173
  "classes": "w-full justify-center"
174
174
  }
175
175
  },
176
+ {
177
+ "name": "grande y primario",
178
+ "data": {
179
+ "text": "Grande y primario",
180
+ "classes": "c-button--lg c-button--primary"
181
+ }
182
+ },
176
183
  {
177
184
  "name": "peque",
178
185
  "data": {
@@ -253,7 +260,7 @@
253
260
  "href": "/",
254
261
  "classes": "c-button--primary align-bottom"
255
262
  }
256
-
263
+
257
264
  },
258
265
  {
259
266
  "name": "button peque sólo con icono",
@@ -262,7 +269,7 @@
262
269
  "href": "/",
263
270
  "classes": "c-button--primary c-button--sm align-bottom"
264
271
  }
265
-
272
+
266
273
  },
267
274
  {
268
275
  "name": "input",
@@ -81,6 +81,13 @@
81
81
  }
82
82
 
83
83
 
84
+ .c-button--lg {
85
+ @apply px-4;
86
+ @apply py-3;
87
+ @apply text-lg;
88
+ }
89
+
90
+
84
91
  .c-button--primary {
85
92
  @apply bg-primary-base;
86
93
  @apply text-white;
@@ -192,6 +192,13 @@
192
192
  "classes": "c-button-loader--transparent"
193
193
  }
194
194
  },
195
+ {
196
+ "name": "grande",
197
+ "data": {
198
+ "text": "Grande y primario",
199
+ "classes": "c-button-loader--lg c-button-loader--primary"
200
+ }
201
+ },
195
202
  {
196
203
  "name": "peque",
197
204
  "data": {
@@ -235,7 +242,7 @@
235
242
  {
236
243
  "name": "botón con icono a la izquierda",
237
244
  "data": {
238
-
245
+
239
246
  "html": '<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16" height="1em" width="1em" class="self-center mr-2" aria-hidden="true" focusable="false" role="img"><g><path fill="currentcolor" fill-rule="evenodd" d="M6.585782857142856 2.3000685714285716C6.960857142857142 1.9249942857142854 7.469565714285714 1.7142857142857142 8 1.7142857142857142c0.5304342857142856 0 1.0391428571428571 0.2107085714285714 1.4142171428571428 0.5857828571428572 0.2369828571428571 0.2369942857142857 0.4083542857142857 0.5273257142857143 0.5024114285714285 0.8427885714285713h-3.8332571428571427c0.09405714285714285 -0.3154628571428571 0.2654285714285714 -0.6057942857142857 0.5024114285714285 -0.8427885714285713ZM4.3299199999999995 3.142857142857143c0.12042285714285714 -0.7734742857142857 0.48325714285714283 -1.4945485714285713 1.04368 -2.054968C6.070171428571428 0.3913257142857143 7.014914285714285 0 8 0c0.9850857142857142 0 1.9298285714285714 0.3913257142857143 2.6264 1.0878891428571429 0.5604228571428571 0.5604194285714286 0.9233142857142856 1.2814937142857143 1.0436571428571428 2.054968H14.571428571428571c0.47337142857142855 0 0.8571428571428571 0.38375999999999993 0.8571428571428571 0.8571428571428571s-0.38377142857142854 0.8571428571428571 -0.8571428571428571 0.8571428571428571H13.714285714285714v9.428571428571429c0 0.4546285714285714 -0.18057142857142855 0.8907428571428571 -0.5020571428571429 1.2122285714285714S12.454628571428572 16 12 16h-8c-0.45466285714285715 0 -0.8906971428571429 -0.18057142857142855 -1.212182857142857 -0.5020571428571429C2.466331428571429 15.176457142857142 2.2857142857142856 14.740342857142856 2.2857142857142856 14.285714285714285V4.857142857142857h-0.8571428571428571C0.955184 4.857142857142857 0.5714285714285714 4.473382857142857 0.5714285714285714 4s0.3837554285714285 -0.8571428571428571 0.8571428571428571 -0.8571428571428571h2.901348571428571ZM6 6.715954285714285c0.39449142857142855 0 0.7142857142857142 0.3198057142857143 0.7142857142857142 0.7142857142857142V12.003428571428572c0 0.3944 -0.3197942857142857 0.7142857142857142 -0.7142857142857142 0.7142857142857142s-0.7142857142857142 -0.3198857142857143 -0.7142857142857142 -0.7142857142857142V7.4302399999999995c0 -0.39447999999999994 0.3197942857142857 -0.7142857142857142 0.7142857142857142 -0.7142857142857142Zm4.714285714285714 0.7142857142857142c0 -0.39447999999999994 -0.3197942857142857 -0.7142857142857142 -0.7142857142857142 -0.7142857142857142s-0.7142857142857142 0.3198057142857143 -0.7142857142857142 0.7142857142857142V12.003428571428572c0 0.3944 0.3197942857142857 0.7142857142857142 0.7142857142857142 0.7142857142857142s0.7142857142857142 -0.3198857142857143 0.7142857142857142 -0.7142857142857142V7.4302399999999995Z" clip-rule="evenodd" stroke-width="1"></path></g></svg>Botón con icono',
240
247
  "href": "/"
241
248
  }
@@ -83,6 +83,12 @@
83
83
  @apply text-base;
84
84
  }
85
85
 
86
+ .c-button-loader--lg {
87
+ @apply px-3;
88
+ @apply py-2;
89
+ @apply text-lg;
90
+ }
91
+
86
92
 
87
93
  .c-button-loader--sm {
88
94
  @apply px-2;
@@ -59,6 +59,14 @@
59
59
  "caller": "<div class=\" w-48 p-2 \"><div class=\" border-4 border-dashed border-gray-200 rounded-lg h-40 \"></div></div>"
60
60
  }
61
61
  },
62
+ {
63
+ "name": "grande",
64
+ "data": {
65
+ "text": "Grande",
66
+ "classes": "c-dropdown--lg",
67
+ "caller": "<div class=\" w-48 p-2 \"><div class=\" border-4 border-dashed border-gray-200 rounded-lg h-40 \"></div></div>"
68
+ }
69
+ },
62
70
  {
63
71
  "name": "peque",
64
72
  "data": {
@@ -69,6 +69,13 @@
69
69
  }
70
70
 
71
71
 
72
+ .c-dropdown--lg {
73
+ @apply px-4;
74
+ @apply py-3;
75
+ @apply text-lg;
76
+ }
77
+
78
+
72
79
  .c-dropdown--sm {
73
80
  @apply px-2;
74
81
  @apply py-1;
@@ -459,9 +459,6 @@
459
459
  "name": "con atributos",
460
460
  "description": "Muestra el código para ver cómo se aplican los atributos.",
461
461
  "data": {
462
- "attributes": {
463
- "id": "nav-id-example"
464
- },
465
462
  "items": [
466
463
  {
467
464
  "href": "#",
@@ -518,7 +515,8 @@
518
515
  }
519
516
  ],
520
517
  "attributes": {
521
- "aria-label": "Menu destacado"
518
+ "aria-label": "Menu destacado",
519
+ "id": "nav-id-example"
522
520
  }
523
521
  }
524
522
  },
@@ -591,5 +589,30 @@
591
589
  "aria-label": "Menu destacado"
592
590
  }
593
591
  }
592
+ },
593
+ {
594
+ "name": "Activar un item con Javascript",
595
+ "description": 'Puedes activar un item con Javascript, usa la función global <code>activateItemLinksList(elementWrapper, idItem)</code> para activar un item de la lista, usando sus ids. Ej: Abre la consola del navegador y escribe <code>activateItemLinksList("links-list-js", "links-list-js-3")</code> para activar el último item de la lista.',
596
+ "data": {
597
+ "idPrefix": "links-list-js",
598
+ "items": [
599
+ {
600
+ "href": "#",
601
+ "text": "Item 1"
602
+ },
603
+ {
604
+ "href": "#",
605
+ "text": "Item 2"
606
+ },
607
+ {
608
+ "href": "#",
609
+ "text": "Item 3"
610
+ }
611
+ ],
612
+ "attributes": {
613
+ "aria-label": "Menu destacado",
614
+ "id": "links-list-js"
615
+ }
616
+ }
594
617
  }
595
- ] %}
618
+ ] %}
@@ -33,7 +33,7 @@
33
33
  {% endif %}
34
34
  </div>
35
35
  {% endif %}
36
- <div class="flex-1">
36
+ <div data-element="c-links-list__text" class="flex-1">
37
37
  {% if item.active %}
38
38
  <strong class="font-bold">{{ item.html | safe if item.html else item.text }}</strong>
39
39
  {% else %}
@@ -106,14 +106,14 @@
106
106
 
107
107
  <!-- links-list -->
108
108
  {% if params.hasNav == false %}
109
- <div {%- if params.classes %} class="{{ params.classes }}"{% endif %}
109
+ <div data-module="c-links-list" {%- if params.classes %} class="{{ params.classes }}"{% endif %}
110
110
  {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
111
111
  {{ innerHtml | trim | safe }}
112
112
  </div>
113
113
  {% else %}
114
- <nav {%- if params.classes %} class="{{ params.classes }}"{% endif %}
114
+ <nav data-module="c-links-list" {%- if params.classes %} class="{{ params.classes }}"{% endif %}
115
115
  {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}>
116
116
  {{ innerHtml | trim | safe }}
117
117
  </nav>
118
118
  {% endif %}
119
- <!-- /links-list -->
119
+ <!-- /links-list -->
@@ -270,6 +270,41 @@
270
270
  ]
271
271
  }
272
272
  },
273
+ {
274
+ "name": "grande",
275
+ "description": "Label solo visible para lectores de pantalla.",
276
+ "data": {
277
+ "id": "large",
278
+ "text": "Grande",
279
+ "label": {
280
+ "text": "Esto es un label",
281
+ "classes": "sr-only"
282
+ },
283
+ "classes": "c-listbox--lg",
284
+ "items": [
285
+ {
286
+ "href": "#",
287
+ "text": "Opción 1"
288
+ },
289
+ {
290
+ "href": "#",
291
+ "text": "Opción 2"
292
+ },
293
+ {
294
+ "href": "#",
295
+ "text": "Opción 3"
296
+ },
297
+ {
298
+ "href": "#",
299
+ "text": "Opción 4"
300
+ },
301
+ {
302
+ "href": "#",
303
+ "text": "Opción 5"
304
+ }
305
+ ]
306
+ }
307
+ },
273
308
  {
274
309
  "name": "peque tiene selección",
275
310
  "description": "Un botón con una selección aplicada se muestra con color. Label solo visible para lectores de pantalla.",
@@ -620,7 +655,7 @@
620
655
  "name": "Menú abierto o cerrado con Javascript",
621
656
  "description": 'Podemos abrir o cerrar un menú usando con javascript la función global <code>toggleMenuListbox(elementMenu, open)</code> para abrir o cerrar un menú, usando su id. El parámetro <code>open</code> admite <code>true</code> o <code>false</code>, si le pasamos <code>true</code> abrirá el menú, y si le pasamos <code>false</code> cerrará el menú. Ej: Abre la consola del navegador y escribe <code>toggleMenuListbox("listbox-javascript", true)</code> para abrir el menú de este ejemplo.',
622
657
  "data": {
623
- "id": "with-active-item",
658
+ "id": "with-active-unactive-item",
624
659
  "text": "con item activo",
625
660
  "label": {
626
661
  "text": "Esto es un label"
@@ -107,6 +107,13 @@
107
107
  }
108
108
 
109
109
 
110
+ .c-listbox--lg {
111
+ @apply px-4;
112
+ @apply py-3;
113
+ @apply text-lg;
114
+ }
115
+
116
+
110
117
  .c-listbox--sm {
111
118
  @apply px-2;
112
119
  @apply py-1;
@@ -24,7 +24,7 @@
24
24
 
25
25
  {% set commonTooltipAttributes %} data-module="c-listbox-list" role="listbox" tabindex="-1" class="text-sm outline-none" {%- if params.label %} aria-labelledby="{{ params.id }}-label"{% endif %}
26
26
  {% if params.isMultiselectable %} aria-multiselectable="true"{% endif %}
27
- {%- for attribute, value in params.attributes %} {{ attribute }}="{{ value }}"{% endfor -%}{% endset %}
27
+ {% endset %}
28
28
 
29
29
  {%- set classNames = "c-listbox" -%}
30
30
 
@@ -40,7 +40,7 @@ treat it as an interactive element - without this it will be
40
40
  {% endset %}
41
41
 
42
42
 
43
- {%- set commonAttributes %} id="{{ params.id }}-button" class="{{ classNames }}" data-module="c-listbox-button" aria-haspopup="listbox" {%- if params.doesChangeButtonText %} data-change="change"{% endif %} aria-labelledby="{% if params.label %}{{ params.id }}-label {% endif -%} {{ params.id }}-button" {%- for attribute, value in params.attributes %} {{attribute}}="{{value}}"{% endfor %}{% if params.disabled %} disabled="disabled" aria-disabled="true"{% endif %}{% endset %}
43
+ {%- set commonAttributes %} id="{{ params.id }}-button" class="{{ classNames }}" data-module="c-listbox-button" aria-haspopup="listbox" {%- if params.doesChangeButtonText %} data-change="change"{% endif %} aria-labelledby="{% if params.label %}{{ params.id }}-label {% endif -%} {{ params.id }}-button" {% if params.disabled %} disabled="disabled" aria-disabled="true"{% endif %}{% endset %}
44
44
 
45
45
  {#- Capture the HTML so we can optionally nest it in a fieldset -#}
46
46
  {% set innerHtml %}