@compa11y/web 0.1.2 → 0.1.5

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 (44) hide show
  1. package/dist/compa11y.iife.js +207 -89
  2. package/dist/compa11y.js +1253 -994
  3. package/dist/components/button.d.ts +0 -1
  4. package/dist/components/checkbox.d.ts +0 -1
  5. package/dist/components/combobox.d.ts +0 -1
  6. package/dist/components/dialog.d.ts +0 -1
  7. package/dist/components/dialog.test.d.ts +0 -1
  8. package/dist/components/input.d.ts +0 -1
  9. package/dist/components/listbox.d.ts +3 -4
  10. package/dist/components/menu.d.ts +3 -1
  11. package/dist/components/menu.test.d.ts +0 -1
  12. package/dist/components/radio-group.d.ts +0 -1
  13. package/dist/components/select.d.ts +0 -1
  14. package/dist/components/switch.d.ts +0 -1
  15. package/dist/components/tabs.d.ts +5 -1
  16. package/dist/components/tabs.test.d.ts +0 -1
  17. package/dist/components/textarea.d.ts +0 -1
  18. package/dist/components/toast.d.ts +48 -0
  19. package/dist/index.d.ts +2 -2
  20. package/dist/utils/base-element.d.ts +0 -1
  21. package/dist/utils/styles.d.ts +5 -2
  22. package/package.json +2 -2
  23. package/dist/compa11y.iife.js.map +0 -1
  24. package/dist/compa11y.js.map +0 -1
  25. package/dist/compa11y.umd.cjs +0 -1633
  26. package/dist/compa11y.umd.cjs.map +0 -1
  27. package/dist/components/button.d.ts.map +0 -1
  28. package/dist/components/checkbox.d.ts.map +0 -1
  29. package/dist/components/combobox.d.ts.map +0 -1
  30. package/dist/components/dialog.d.ts.map +0 -1
  31. package/dist/components/dialog.test.d.ts.map +0 -1
  32. package/dist/components/input.d.ts.map +0 -1
  33. package/dist/components/listbox.d.ts.map +0 -1
  34. package/dist/components/menu.d.ts.map +0 -1
  35. package/dist/components/menu.test.d.ts.map +0 -1
  36. package/dist/components/radio-group.d.ts.map +0 -1
  37. package/dist/components/select.d.ts.map +0 -1
  38. package/dist/components/switch.d.ts.map +0 -1
  39. package/dist/components/tabs.d.ts.map +0 -1
  40. package/dist/components/tabs.test.d.ts.map +0 -1
  41. package/dist/components/textarea.d.ts.map +0 -1
  42. package/dist/index.d.ts.map +0 -1
  43. package/dist/utils/base-element.d.ts.map +0 -1
  44. package/dist/utils/styles.d.ts.map +0 -1
package/dist/compa11y.js CHANGED
@@ -1,8 +1,8 @@
1
- import { generateId as te, announce as v, announcePolite as p, createTypeAhead as q, announceAssertive as D, prefersDarkMode as ie, prefersHighContrast as se, prefersReducedMotion as ae, isBrowser as re, hasAccessibleName as oe, buildAriaProps as le, aria as ne, KeyboardPatterns as he, createKeyboardManager as de, createRovingTabindex as ce, createFocusScope as ue, createFocusTrap as be, initFocusVisible as T, announceError as pe, announceStatus as ge, initAnnouncer as R } from "@compa11y/core";
2
- import { KeyboardPatterns as He, announce as Me, announceAssertive as Ke, announceError as Fe, announcePolite as Ne, announceStatus as Pe, aria as je, buildAriaProps as Ue, createFocusScope as Ye, createFocusTrap as Ge, createKeyboardManager as Xe, createRovingTabindex as Ve, createTypeAhead as We, hasAccessibleName as Je, initAnnouncer as Qe, initFocusVisible as Ze, isBrowser as et, prefersDarkMode as tt, prefersHighContrast as it, prefersReducedMotion as st } from "@compa11y/core";
3
- class c extends HTMLElement {
1
+ import { generateId as at, announce as v, announcePolite as p, createTypeAhead as q, announceAssertive as O, prefersDarkMode as rt, prefersHighContrast as ot, prefersReducedMotion as lt, isBrowser as nt, hasAccessibleName as ht, buildAriaProps as dt, aria as ct, KeyboardPatterns as ut, createKeyboardManager as bt, createRovingTabindex as pt, createFocusScope as mt, createFocusTrap as gt, initFocusVisible as H, announceError as vt, announceStatus as ft, initAnnouncer as B } from "@compa11y/core";
2
+ import { KeyboardPatterns as jt, announce as Ut, announceAssertive as Yt, announceError as Gt, announcePolite as Vt, announceStatus as Xt, aria as Wt, buildAriaProps as Jt, createFocusScope as Qt, createFocusTrap as Zt, createKeyboardManager as te, createRovingTabindex as ee, createTypeAhead as ie, hasAccessibleName as se, initAnnouncer as ae, initFocusVisible as re, isBrowser as oe, prefersDarkMode as le, prefersHighContrast as ne, prefersReducedMotion as he } from "@compa11y/core";
3
+ class d extends HTMLElement {
4
4
  constructor() {
5
- super(), this._internals = null, this._id = te(this.tagName.toLowerCase().replace("a11y-", "")), "attachInternals" in this && (this._internals = this.attachInternals());
5
+ super(), this._internals = null, this._id = at(this.tagName.toLowerCase().replace("a11y-", "")), "attachInternals" in this && (this._internals = this.attachInternals());
6
6
  }
7
7
  /**
8
8
  * Standard observed attributes
@@ -25,8 +25,8 @@ class c extends HTMLElement {
25
25
  /**
26
26
  * Called when observed attributes change
27
27
  */
28
- attributeChangedCallback(e, t, i) {
29
- t !== i && this.onAttributeChange(e, t, i);
28
+ attributeChangedCallback(t, e, i) {
29
+ e !== i && this.onAttributeChange(t, e, i);
30
30
  }
31
31
  /**
32
32
  * Set up event listeners
@@ -41,15 +41,15 @@ class c extends HTMLElement {
41
41
  /**
42
42
  * Handle attribute changes
43
43
  */
44
- onAttributeChange(e, t, i) {
44
+ onAttributeChange(t, e, i) {
45
45
  }
46
46
  /**
47
47
  * Emit a custom event
48
48
  */
49
- emit(e, t) {
49
+ emit(t, e) {
50
50
  return this.dispatchEvent(
51
- new CustomEvent(e, {
52
- detail: t,
51
+ new CustomEvent(t, {
52
+ detail: e,
53
53
  bubbles: !0,
54
54
  composed: !0,
55
55
  cancelable: !0
@@ -59,25 +59,25 @@ class c extends HTMLElement {
59
59
  /**
60
60
  * Query a slot
61
61
  */
62
- getSlot(e) {
63
- var t;
64
- return ((t = this.shadowRoot) == null ? void 0 : t.querySelector(`slot[name="${e}"]`)) ?? null;
62
+ getSlot(t) {
63
+ var e;
64
+ return ((e = this.shadowRoot) == null ? void 0 : e.querySelector(`slot[name="${t}"]`)) ?? null;
65
65
  }
66
66
  /**
67
67
  * Get slotted elements
68
68
  */
69
- getSlottedElements(e) {
69
+ getSlottedElements(t) {
70
70
  var s;
71
- const t = e ? `slot[name="${e}"]` : "slot:not([name])", i = (s = this.shadowRoot) == null ? void 0 : s.querySelector(
72
- t
71
+ const e = t ? `slot[name="${t}"]` : "slot:not([name])", i = (s = this.shadowRoot) == null ? void 0 : s.querySelector(
72
+ e
73
73
  );
74
74
  return (i == null ? void 0 : i.assignedElements()) ?? [];
75
75
  }
76
76
  }
77
- function u(n, e) {
78
- customElements.get(n) || customElements.define(n, e);
77
+ function c(n, t) {
78
+ customElements.get(n) || customElements.define(n, t);
79
79
  }
80
- const H = `
80
+ const T = `
81
81
  appearance: none;
82
82
  background: none;
83
83
  border: none;
@@ -86,13 +86,13 @@ const H = `
86
86
  font: inherit;
87
87
  color: inherit;
88
88
  cursor: pointer;
89
- `, me = `
89
+ `, _t = `
90
90
  :host(:focus-visible),
91
91
  :focus-visible {
92
92
  outline: 2px solid var(--compa11y-focus-color, #0066cc);
93
93
  outline-offset: 2px;
94
94
  }
95
- `, b = `
95
+ `, u = `
96
96
  :host {
97
97
  display: block;
98
98
  box-sizing: border-box;
@@ -108,9 +108,9 @@ const H = `
108
108
  box-sizing: inherit;
109
109
  }
110
110
 
111
- ${me}
112
- `, ve = `
113
- ${b}
111
+ ${_t}
112
+ `, yt = `
113
+ ${u}
114
114
 
115
115
  :host {
116
116
  position: fixed;
@@ -148,8 +148,8 @@ const H = `
148
148
  margin: 0 0 1rem 0;
149
149
  color: var(--compa11y-dialog-description-color, #666);
150
150
  }
151
- `, fe = `
152
- ${b}
151
+ `, xt = `
152
+ ${u}
153
153
 
154
154
  :host {
155
155
  position: relative;
@@ -200,8 +200,8 @@ const H = `
200
200
  margin: 0.25rem 0;
201
201
  background: var(--compa11y-menu-separator-color, #e0e0e0);
202
202
  }
203
- `, _e = `
204
- ${b}
203
+ `, Et = `
204
+ ${u}
205
205
 
206
206
  .tablist {
207
207
  display: flex;
@@ -216,7 +216,7 @@ const H = `
216
216
  }
217
217
 
218
218
  ::slotted([role="tab"]) {
219
- ${H}
219
+ ${T}
220
220
  padding: var(--compa11y-tab-padding, 0.75rem 1rem);
221
221
  border-bottom: 2px solid transparent;
222
222
  margin-bottom: -1px;
@@ -246,8 +246,8 @@ const H = `
246
246
  ::slotted([role="tabpanel"][hidden]) {
247
247
  display: none;
248
248
  }
249
- `, ye = `
250
- ${b}
249
+ `, At = `
250
+ ${u}
251
251
 
252
252
  :host {
253
253
  display: inline-block;
@@ -305,7 +305,7 @@ const H = `
305
305
  }
306
306
 
307
307
  .clear-button {
308
- ${H}
308
+ ${T}
309
309
  position: absolute;
310
310
  right: 1.5rem;
311
311
  width: 1.25rem;
@@ -387,8 +387,8 @@ const H = `
387
387
  .options-source {
388
388
  display: none;
389
389
  }
390
- `, xe = `
391
- ${b}
390
+ `, kt = `
391
+ ${u}
392
392
 
393
393
  :host {
394
394
  display: inline-block;
@@ -517,8 +517,8 @@ const H = `
517
517
  .options-source {
518
518
  display: none;
519
519
  }
520
- `, Ae = `
521
- ${b}
520
+ `, wt = `
521
+ ${u}
522
522
 
523
523
  :host {
524
524
  display: inline-block;
@@ -621,8 +621,8 @@ const H = `
621
621
  opacity: 0.5;
622
622
  cursor: not-allowed;
623
623
  }
624
- `, Ee = `
625
- ${b}
624
+ `, $t = `
625
+ ${u}
626
626
 
627
627
  :host {
628
628
  display: block;
@@ -700,8 +700,8 @@ const H = `
700
700
  color: var(--compa11y-input-error-color, #ef4444);
701
701
  font-size: var(--compa11y-input-error-size, 0.8125rem);
702
702
  }
703
- `, ke = `
704
- ${b}
703
+ `, Lt = `
704
+ ${u}
705
705
 
706
706
  :host {
707
707
  display: block;
@@ -781,8 +781,8 @@ const H = `
781
781
  color: var(--compa11y-textarea-error-color, #ef4444);
782
782
  font-size: var(--compa11y-textarea-error-size, 0.8125rem);
783
783
  }
784
- `, we = `
785
- ${b}
784
+ `, St = `
785
+ ${u}
786
786
 
787
787
  :host {
788
788
  display: inline-block;
@@ -896,8 +896,8 @@ const H = `
896
896
  border-radius: 50%;
897
897
  animation: compa11y-spin 0.6s linear infinite;
898
898
  }
899
- `, $e = `
900
- ${b}
899
+ `, It = `
900
+ ${u}
901
901
 
902
902
  :host {
903
903
  display: block;
@@ -918,9 +918,10 @@ const H = `
918
918
  cursor: not-allowed;
919
919
  }
920
920
 
921
+ /* Focus indicator lives on the active option (via data-focused),
922
+ not on the container, to avoid a double focus ring. */
921
923
  :host(:focus-visible) .listbox-wrapper {
922
- outline: 2px solid var(--compa11y-focus-color, #0066cc);
923
- outline-offset: 2px;
924
+ outline: none;
924
925
  }
925
926
 
926
927
  :host([orientation="horizontal"]) .listbox-wrapper {
@@ -929,8 +930,8 @@ const H = `
929
930
  max-height: none;
930
931
  overflow-y: visible;
931
932
  }
932
- `, Le = `
933
- ${b}
933
+ `, Ct = `
934
+ ${u}
934
935
 
935
936
  :host {
936
937
  display: block;
@@ -978,8 +979,8 @@ const H = `
978
979
  :host([aria-selected="true"]) .check-mark {
979
980
  visibility: visible;
980
981
  }
981
- `, Se = `
982
- ${b}
982
+ `, Tt = `
983
+ ${u}
983
984
 
984
985
  :host {
985
986
  display: block;
@@ -997,8 +998,8 @@ const H = `
997
998
  :host([disabled]) {
998
999
  opacity: 0.5;
999
1000
  }
1000
- `, Ie = `
1001
- ${b}
1001
+ `, zt = `
1002
+ ${u}
1002
1003
 
1003
1004
  :host {
1004
1005
  display: inline-block;
@@ -1160,8 +1161,8 @@ const H = `
1160
1161
  color: HighlightText;
1161
1162
  }
1162
1163
  }
1163
- `, Ce = `
1164
- ${b}
1164
+ `, Dt = `
1165
+ ${u}
1165
1166
 
1166
1167
  :host {
1167
1168
  display: block;
@@ -1202,8 +1203,8 @@ const H = `
1202
1203
  :host([disabled]) {
1203
1204
  opacity: 0.5;
1204
1205
  }
1205
- `, ze = `
1206
- ${b}
1206
+ `, qt = `
1207
+ ${u}
1207
1208
 
1208
1209
  :host {
1209
1210
  display: block;
@@ -1255,8 +1256,8 @@ const H = `
1255
1256
  :host([disabled]) {
1256
1257
  opacity: 0.5;
1257
1258
  }
1258
- `, qe = `
1259
- ${b}
1259
+ `, Ot = `
1260
+ ${u}
1260
1261
 
1261
1262
  :host {
1262
1263
  display: inline-block;
@@ -1375,31 +1376,147 @@ const H = `
1375
1376
  background: HighlightText;
1376
1377
  }
1377
1378
  }
1378
- `, B = 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
1379
- class M extends c {
1379
+ `, Rt = `
1380
+ ${u}
1381
+
1382
+ :host {
1383
+ position: fixed;
1384
+ z-index: var(--compa11y-toast-z-index, 9999);
1385
+ padding: var(--compa11y-toast-viewport-padding, 1rem);
1386
+ display: flex;
1387
+ flex-direction: column;
1388
+ gap: var(--compa11y-toast-gap, 0.5rem);
1389
+ pointer-events: none;
1390
+ }
1391
+
1392
+ /* Position variants */
1393
+ :host([position="top-left"]) { top: 0; left: 0; }
1394
+ :host([position="top-center"]) { top: 0; left: 50%; transform: translateX(-50%); }
1395
+ :host([position="top-right"]) { top: 0; right: 0; }
1396
+ :host([position="bottom-left"]) { bottom: 0; left: 0; }
1397
+ :host(:not([position])),
1398
+ :host([position="bottom-right"]) { bottom: 0; right: 0; }
1399
+ :host([position="bottom-center"]) { bottom: 0; left: 50%; transform: translateX(-50%); }
1400
+
1401
+ .toast {
1402
+ pointer-events: auto;
1403
+ display: flex;
1404
+ align-items: flex-start;
1405
+ gap: 0.75rem;
1406
+ padding: var(--compa11y-toast-padding, 0.75rem 1rem);
1407
+ background: var(--compa11y-toast-bg, white);
1408
+ border: var(--compa11y-toast-border, 1px solid #e0e0e0);
1409
+ border-radius: var(--compa11y-toast-radius, 6px);
1410
+ box-shadow: var(--compa11y-toast-shadow, 0 4px 12px rgba(0, 0, 0, 0.15));
1411
+ min-width: var(--compa11y-toast-min-width, 250px);
1412
+ max-width: var(--compa11y-toast-max-width, 420px);
1413
+ }
1414
+
1415
+ .toast[data-type="error"] {
1416
+ border-left: 4px solid var(--compa11y-toast-error-color, #ef4444);
1417
+ }
1418
+
1419
+ .toast[data-type="warning"] {
1420
+ border-left: 4px solid var(--compa11y-toast-warning-color, #f59e0b);
1421
+ }
1422
+
1423
+ .toast[data-type="success"] {
1424
+ border-left: 4px solid var(--compa11y-toast-success-color, #22c55e);
1425
+ }
1426
+
1427
+ .toast[data-type="info"] {
1428
+ border-left: 4px solid var(--compa11y-toast-info-color, #3b82f6);
1429
+ }
1430
+
1431
+ .toast-content {
1432
+ flex: 1;
1433
+ min-width: 0;
1434
+ }
1435
+
1436
+ .toast-title {
1437
+ font-weight: var(--compa11y-toast-title-weight, 600);
1438
+ font-size: var(--compa11y-toast-title-size, 0.875rem);
1439
+ }
1440
+
1441
+ .toast-description {
1442
+ color: var(--compa11y-toast-description-color, #666);
1443
+ font-size: var(--compa11y-toast-description-size, 0.8125rem);
1444
+ margin-top: 0.125rem;
1445
+ }
1446
+
1447
+ .toast-close {
1448
+ ${T}
1449
+ flex-shrink: 0;
1450
+ width: 1.5rem;
1451
+ height: 1.5rem;
1452
+ display: flex;
1453
+ align-items: center;
1454
+ justify-content: center;
1455
+ border-radius: var(--compa11y-toast-close-radius, 4px);
1456
+ color: var(--compa11y-toast-close-color, #999);
1457
+ font-size: 1.125rem;
1458
+ line-height: 1;
1459
+ }
1460
+
1461
+ .toast-close:hover {
1462
+ background: var(--compa11y-toast-close-hover-bg, rgba(0, 0, 0, 0.05));
1463
+ color: var(--compa11y-toast-close-hover-color, #333);
1464
+ }
1465
+
1466
+ .toast-close:focus-visible {
1467
+ outline: 2px solid var(--compa11y-focus-color, #0066cc);
1468
+ outline-offset: 2px;
1469
+ }
1470
+
1471
+ .toast-action {
1472
+ ${T}
1473
+ margin-top: 0.375rem;
1474
+ font-size: var(--compa11y-toast-action-size, 0.8125rem);
1475
+ font-weight: 500;
1476
+ color: var(--compa11y-toast-action-color, #0066cc);
1477
+ text-decoration: underline;
1478
+ }
1479
+
1480
+ .toast-action:hover {
1481
+ color: var(--compa11y-toast-action-hover-color, #0052a3);
1482
+ }
1483
+
1484
+ .toast-action:focus-visible {
1485
+ outline: 2px solid var(--compa11y-focus-color, #0066cc);
1486
+ outline-offset: 2px;
1487
+ }
1488
+ `, M = 'button:not([disabled]), [href], input:not([disabled]), select:not([disabled]), textarea:not([disabled]), [tabindex]:not([tabindex="-1"])';
1489
+ let L = 0, K = "";
1490
+ function Ht() {
1491
+ L === 0 && (K = document.body.style.overflow, document.body.style.overflow = "hidden"), L++;
1492
+ }
1493
+ function Bt() {
1494
+ L--, L <= 0 && (L = 0, document.body.style.overflow = K);
1495
+ }
1496
+ class N extends d {
1380
1497
  constructor() {
1381
1498
  super(...arguments), this._open = !1, this._previouslyFocused = null, this._triggerElement = null, this.handleTriggerClick = () => {
1382
1499
  this.open = !0;
1383
1500
  }, this.handleClose = () => {
1384
1501
  this.open = !1;
1385
- }, this.handleKeyDown = (e) => {
1386
- var t;
1502
+ }, this.handleKeyDown = (t) => {
1503
+ var e;
1387
1504
  if (this._open) {
1388
- if (e.key === "Escape") {
1389
- this.getAttribute("close-on-escape") !== "false" && (e.preventDefault(), this.handleClose());
1505
+ if (t.key === "Escape") {
1506
+ this.getAttribute("close-on-escape") !== "false" && (t.preventDefault(), this.handleClose());
1390
1507
  return;
1391
1508
  }
1392
- if (e.key === "Tab") {
1393
- e.preventDefault();
1509
+ if (t.key === "Tab") {
1510
+ t.preventDefault();
1394
1511
  const i = this.getFocusableElements();
1395
1512
  if (i.length === 0) return;
1396
- const s = ((t = this.shadowRoot) == null ? void 0 : t.activeElement) || document.activeElement;
1513
+ const s = ((e = this.shadowRoot) == null ? void 0 : e.activeElement) || document.activeElement;
1397
1514
  let a = i.findIndex(
1398
1515
  (o) => o === s
1399
1516
  );
1400
- a === -1 && (a = e.shiftKey ? 0 : i.length - 1);
1517
+ a === -1 && (a = t.shiftKey ? 0 : i.length - 1);
1401
1518
  let r;
1402
- e.shiftKey ? r = a === 0 ? i.length - 1 : a - 1 : r = a === i.length - 1 ? 0 : a + 1;
1519
+ t.shiftKey ? r = a === 0 ? i.length - 1 : a - 1 : r = a === i.length - 1 ? 0 : a + 1;
1403
1520
  const l = i[r];
1404
1521
  l && l.focus();
1405
1522
  }
@@ -1412,26 +1529,26 @@ class M extends c {
1412
1529
  get open() {
1413
1530
  return this._open;
1414
1531
  }
1415
- set open(e) {
1416
- const t = this._open;
1417
- this._open = e, e !== t && (e ? this.showDialog() : this.hideDialog()), this.toggleAttribute("open", e);
1532
+ set open(t) {
1533
+ const e = this._open;
1534
+ this._open = t, t !== e && (t ? this.showDialog() : this.hideDialog()), this.toggleAttribute("open", t);
1418
1535
  }
1419
1536
  setupAccessibility() {
1420
1537
  }
1421
1538
  render() {
1422
- const e = this.attachShadow({ mode: "open" }), t = `${this._id}-title`, i = `${this._id}-desc`;
1423
- e.innerHTML = `
1424
- <style>${ve}</style>
1539
+ const t = this.attachShadow({ mode: "open" }), e = `${this._id}-title`, i = `${this._id}-desc`;
1540
+ t.innerHTML = `
1541
+ <style>${yt}</style>
1425
1542
  <div class="overlay" part="overlay"></div>
1426
1543
  <div
1427
1544
  class="dialog"
1428
1545
  role="dialog"
1429
1546
  aria-modal="true"
1430
- aria-labelledby="${t}"
1547
+ aria-labelledby="${e}"
1431
1548
  aria-describedby="${i}"
1432
1549
  part="dialog"
1433
1550
  >
1434
- <div id="${t}" part="title">
1551
+ <div id="${e}" part="title">
1435
1552
  <slot name="title"></slot>
1436
1553
  </div>
1437
1554
  <div id="${i}" part="description">
@@ -1448,10 +1565,10 @@ class M extends c {
1448
1565
  }
1449
1566
  setupEventListeners() {
1450
1567
  var i;
1451
- const e = this.getAttribute("trigger");
1452
- if (e) {
1568
+ const t = this.getAttribute("trigger");
1569
+ if (t) {
1453
1570
  const s = () => {
1454
- this._triggerElement = document.querySelector(e), this._triggerElement && (this._triggerElement.addEventListener(
1571
+ this._triggerElement = document.querySelector(t), this._triggerElement && (this._triggerElement.addEventListener(
1455
1572
  "click",
1456
1573
  this.handleTriggerClick
1457
1574
  ), this._triggerElement.hasAttribute("tabindex") || this._triggerElement.setAttribute("tabindex", "0"));
@@ -1460,15 +1577,15 @@ class M extends c {
1460
1577
  s(), this._triggerElement || setTimeout(s, 0);
1461
1578
  });
1462
1579
  }
1463
- const t = (i = this.shadowRoot) == null ? void 0 : i.querySelector(".overlay");
1464
- this.getAttribute("close-on-outside-click") !== "false" && (t == null || t.addEventListener("click", this.handleClose)), this.addEventListener("keydown", this.handleKeyDown);
1580
+ const e = (i = this.shadowRoot) == null ? void 0 : i.querySelector(".overlay");
1581
+ this.getAttribute("close-on-outside-click") !== "false" && (e == null || e.addEventListener("click", this.handleClose)), this.addEventListener("keydown", this.handleKeyDown);
1465
1582
  }
1466
1583
  cleanupEventListeners() {
1467
- var e;
1468
- (e = this._triggerElement) == null || e.removeEventListener("click", this.handleTriggerClick), this.removeEventListener("keydown", this.handleKeyDown);
1584
+ var t;
1585
+ (t = this._triggerElement) == null || t.removeEventListener("click", this.handleTriggerClick), this.removeEventListener("keydown", this.handleKeyDown);
1469
1586
  }
1470
- onAttributeChange(e, t, i) {
1471
- e === "open" && (this.open = i !== null);
1587
+ onAttributeChange(t, e, i) {
1588
+ t === "open" && (this.open = i !== null);
1472
1589
  }
1473
1590
  /**
1474
1591
  * Get all focusable elements in the dialog (light DOM first, then shadow DOM)
@@ -1476,20 +1593,20 @@ class M extends c {
1476
1593
  * close button should be last in tab order
1477
1594
  */
1478
1595
  getFocusableElements() {
1479
- const e = [];
1480
- return this.querySelectorAll(B).forEach((i) => e.push(i)), this.shadowRoot && this.shadowRoot.querySelectorAll(B).forEach((s) => {
1481
- s.classList.contains("overlay") || e.push(s);
1482
- }), e;
1596
+ const t = [];
1597
+ return this.querySelectorAll(M).forEach((i) => t.push(i)), this.shadowRoot && this.shadowRoot.querySelectorAll(M).forEach((s) => {
1598
+ s.classList.contains("overlay") || t.push(s);
1599
+ }), t;
1483
1600
  }
1484
1601
  showDialog() {
1485
1602
  this._previouslyFocused = document.activeElement, this.style.display = "flex", requestAnimationFrame(() => {
1486
- const t = this.getFocusableElements()[0];
1487
- t && t.focus();
1488
- }), document.body.style.overflow = "hidden", v("Dialog opened", { politeness: "polite" }), this.emit("a11y-dialog-open");
1603
+ const e = this.getFocusableElements()[0];
1604
+ e && e.focus();
1605
+ }), Ht(), v("Dialog opened", { politeness: "polite" }), this.emit("a11y-dialog-open");
1489
1606
  }
1490
1607
  hideDialog() {
1491
- var e;
1492
- this.style.display = "none", document.body.style.overflow = "", (e = this._previouslyFocused) == null || e.focus(), this._previouslyFocused = null, v("Dialog closed", { politeness: "polite" }), this.emit("a11y-dialog-close");
1608
+ var t;
1609
+ this.style.display = "none", Bt(), (t = this._previouslyFocused) == null || t.focus(), this._previouslyFocused = null, v("Dialog closed", { politeness: "polite" }), this.emit("a11y-dialog-close");
1493
1610
  }
1494
1611
  /**
1495
1612
  * Programmatic open
@@ -1504,78 +1621,78 @@ class M extends c {
1504
1621
  this.open = !1;
1505
1622
  }
1506
1623
  }
1507
- u("a11y-dialog", M);
1508
- class K extends c {
1624
+ c("a11y-dialog", N);
1625
+ class F extends d {
1509
1626
  constructor() {
1510
- super(...arguments), this._open = !1, this._highlightedIndex = -1, this._menuItems = [], this.updateMenuItems = () => {
1627
+ super(...arguments), this._open = !1, this._highlightedIndex = -1, this._menuItems = [], this._triggerEl = null, this._triggerSlotEl = null, this._defaultSlotEl = null, this.updateMenuItems = () => {
1511
1628
  this._menuItems = Array.from(
1512
1629
  this.querySelectorAll('[role="menuitem"]:not([aria-disabled="true"])')
1513
- ), this._menuItems.forEach((e, t) => {
1514
- e.id = e.id || `${this._id}-item-${t}`, e.setAttribute("tabindex", "-1");
1630
+ ), this._menuItems.forEach((t, e) => {
1631
+ t.id = t.id || `${this._id}-item-${e}`, t.setAttribute("tabindex", "-1");
1515
1632
  });
1516
1633
  }, this._lastClickTime = 0, this.handleTriggerClick = () => {
1517
- const e = Date.now();
1518
- e - this._lastClickTime < 50 || (this._lastClickTime = e, this.toggle());
1519
- }, this.handleTriggerKeyDown = (e) => {
1520
- switch (e.key) {
1634
+ const t = Date.now();
1635
+ t - this._lastClickTime < 50 || (this._lastClickTime = t, this.toggle());
1636
+ }, this.handleTriggerKeyDown = (t) => {
1637
+ switch (t.key) {
1521
1638
  case "Enter":
1522
1639
  case " ":
1523
- e.preventDefault(), this.toggle(), this._open && this.highlightItem(0);
1640
+ t.preventDefault(), this.toggle(), this._open && this.highlightItem(0);
1524
1641
  break;
1525
1642
  case "ArrowDown":
1526
- e.preventDefault(), this._open || this.show(), this.highlightItem(0);
1643
+ t.preventDefault(), this._open || this.show(), this.highlightItem(0);
1527
1644
  break;
1528
1645
  case "ArrowUp":
1529
- e.preventDefault(), this._open || this.show(), this.highlightItem(this._menuItems.length - 1);
1646
+ t.preventDefault(), this._open || this.show(), this.highlightItem(this._menuItems.length - 1);
1530
1647
  break;
1531
1648
  }
1532
- }, this.handleMenuKeyDown = (e) => {
1649
+ }, this.handleMenuKeyDown = (t) => {
1533
1650
  if (!this._open) return;
1534
- const t = e.target;
1535
- if (!(!t.hasAttribute("role") || t.getAttribute("role") !== "menuitem"))
1536
- switch (e.key) {
1651
+ const e = t.target;
1652
+ if (!(!e.hasAttribute("role") || e.getAttribute("role") !== "menuitem"))
1653
+ switch (t.key) {
1537
1654
  case "ArrowDown":
1538
- e.preventDefault(), this.highlightItem(
1655
+ t.preventDefault(), this.highlightItem(
1539
1656
  (this._highlightedIndex + 1) % this._menuItems.length
1540
1657
  );
1541
1658
  break;
1542
1659
  case "ArrowUp":
1543
- e.preventDefault(), this.highlightItem(
1660
+ t.preventDefault(), this.highlightItem(
1544
1661
  (this._highlightedIndex - 1 + this._menuItems.length) % this._menuItems.length
1545
1662
  );
1546
1663
  break;
1547
1664
  case "Home":
1548
- e.preventDefault(), this.highlightItem(0);
1665
+ t.preventDefault(), this.highlightItem(0);
1549
1666
  break;
1550
1667
  case "End":
1551
- e.preventDefault(), this.highlightItem(this._menuItems.length - 1);
1668
+ t.preventDefault(), this.highlightItem(this._menuItems.length - 1);
1552
1669
  break;
1553
1670
  case "Enter":
1554
1671
  case " ":
1555
- e.preventDefault(), this.selectItem(this._highlightedIndex);
1672
+ t.preventDefault(), this.selectItem(this._highlightedIndex);
1556
1673
  break;
1557
1674
  case "Escape":
1558
- e.preventDefault(), this.close();
1675
+ t.preventDefault(), this.close();
1559
1676
  break;
1560
1677
  case "Tab":
1561
1678
  this.close();
1562
1679
  break;
1563
1680
  }
1564
- }, this.handleItemClick = (e) => {
1565
- const t = e.target;
1566
- if (t.getAttribute("role") === "menuitem" && t.getAttribute("aria-disabled") !== "true") {
1567
- const i = this._menuItems.indexOf(t);
1681
+ }, this.handleItemClick = (t) => {
1682
+ const e = t.target;
1683
+ if (e.getAttribute("role") === "menuitem" && e.getAttribute("aria-disabled") !== "true") {
1684
+ const i = this._menuItems.indexOf(e);
1568
1685
  this.selectItem(i);
1569
1686
  }
1570
- }, this.handleMouseOver = (e) => {
1571
- const t = e.target;
1572
- if (t.getAttribute("role") === "menuitem") {
1573
- const i = this._menuItems.indexOf(t);
1687
+ }, this.handleMouseOver = (t) => {
1688
+ const e = t.target;
1689
+ if (e.getAttribute("role") === "menuitem") {
1690
+ const i = this._menuItems.indexOf(e);
1574
1691
  i !== -1 && this.highlightItem(i, !1);
1575
1692
  }
1576
- }, this.handleOutsideClick = (e) => {
1693
+ }, this.handleOutsideClick = (t) => {
1577
1694
  if (!this._open) return;
1578
- e.composedPath().includes(this) || this.close();
1695
+ t.composedPath().includes(this) || this.close();
1579
1696
  };
1580
1697
  }
1581
1698
  static get observedAttributes() {
@@ -1584,18 +1701,18 @@ class K extends c {
1584
1701
  get open() {
1585
1702
  return this._open;
1586
1703
  }
1587
- set open(e) {
1588
- const t = this._open;
1589
- this._open = e, e !== t && this.updateMenuVisibility(), this.toggleAttribute("open", e);
1704
+ set open(t) {
1705
+ const e = this._open;
1706
+ this._open = t, t !== e && this.updateMenuVisibility(), this.toggleAttribute("open", t);
1590
1707
  }
1591
1708
  setupAccessibility() {
1592
- const e = this.querySelector('[slot="trigger"]');
1593
- e && (e.setAttribute("aria-haspopup", "menu"), e.setAttribute("aria-expanded", String(this._open)), e.id = e.id || `${this._id}-trigger`, e.hasAttribute("tabindex") || e.setAttribute("tabindex", "0"));
1709
+ const t = this.querySelector('[slot="trigger"]');
1710
+ t && (t.setAttribute("aria-haspopup", "menu"), t.setAttribute("aria-expanded", String(this._open)), t.id = t.id || `${this._id}-trigger`, t.hasAttribute("tabindex") || t.setAttribute("tabindex", "0"));
1594
1711
  }
1595
1712
  render() {
1596
- const e = this.attachShadow({ mode: "open" });
1597
- e.innerHTML = `
1598
- <style>${fe}</style>
1713
+ const t = this.attachShadow({ mode: "open" });
1714
+ t.innerHTML = `
1715
+ <style>${xt}</style>
1599
1716
  <slot name="trigger"></slot>
1600
1717
  <div
1601
1718
  class="menu-content"
@@ -1610,47 +1727,46 @@ class K extends c {
1610
1727
  `;
1611
1728
  }
1612
1729
  setupEventListeners() {
1613
- var s, a;
1614
- const e = this.querySelector('[slot="trigger"]');
1615
- e == null || e.addEventListener("click", this.handleTriggerClick), e == null || e.addEventListener(
1730
+ var t, e, i, s, a, r;
1731
+ this._triggerEl = this.querySelector('[slot="trigger"]'), (t = this._triggerEl) == null || t.addEventListener("click", this.handleTriggerClick), (e = this._triggerEl) == null || e.addEventListener(
1616
1732
  "keydown",
1617
1733
  this.handleTriggerKeyDown
1618
- );
1619
- const t = (s = this.shadowRoot) == null ? void 0 : s.querySelector('slot[name="trigger"]');
1620
- t == null || t.addEventListener("click", this.handleTriggerClick), this.addEventListener("click", this.handleItemClick), this.addEventListener("keydown", this.handleMenuKeyDown), this.addEventListener("mouseover", this.handleMouseOver), document.addEventListener("mousedown", this.handleOutsideClick);
1621
- const i = (a = this.shadowRoot) == null ? void 0 : a.querySelector("slot:not([name])");
1622
- i == null || i.addEventListener("slotchange", this.updateMenuItems), this.updateMenuItems();
1734
+ ), this._triggerSlotEl = ((i = this.shadowRoot) == null ? void 0 : i.querySelector('slot[name="trigger"]')) ?? null, (s = this._triggerSlotEl) == null || s.addEventListener("click", this.handleTriggerClick), this.addEventListener("click", this.handleItemClick), this.addEventListener("keydown", this.handleMenuKeyDown), this.addEventListener("mouseover", this.handleMouseOver), document.addEventListener("mousedown", this.handleOutsideClick), this._defaultSlotEl = ((a = this.shadowRoot) == null ? void 0 : a.querySelector("slot:not([name])")) ?? null, (r = this._defaultSlotEl) == null || r.addEventListener("slotchange", this.updateMenuItems), this.updateMenuItems();
1623
1735
  }
1624
1736
  cleanupEventListeners() {
1625
- document.removeEventListener("mousedown", this.handleOutsideClick);
1737
+ var t, e, i, s;
1738
+ (t = this._triggerEl) == null || t.removeEventListener("click", this.handleTriggerClick), (e = this._triggerEl) == null || e.removeEventListener(
1739
+ "keydown",
1740
+ this.handleTriggerKeyDown
1741
+ ), (i = this._triggerSlotEl) == null || i.removeEventListener("click", this.handleTriggerClick), this.removeEventListener("click", this.handleItemClick), this.removeEventListener("keydown", this.handleMenuKeyDown), this.removeEventListener("mouseover", this.handleMouseOver), document.removeEventListener("mousedown", this.handleOutsideClick), (s = this._defaultSlotEl) == null || s.removeEventListener("slotchange", this.updateMenuItems);
1626
1742
  }
1627
- onAttributeChange(e, t, i) {
1628
- e === "open" && (this.open = i !== null);
1743
+ onAttributeChange(t, e, i) {
1744
+ t === "open" && (this.open = i !== null);
1629
1745
  }
1630
- highlightItem(e, t = !0) {
1746
+ highlightItem(t, e = !0) {
1631
1747
  var s;
1632
1748
  if (this._highlightedIndex >= 0) {
1633
1749
  const a = this._menuItems[this._highlightedIndex];
1634
1750
  a == null || a.removeAttribute("data-highlighted");
1635
1751
  }
1636
- this._highlightedIndex = e;
1637
- const i = this._menuItems[e];
1752
+ this._highlightedIndex = t;
1753
+ const i = this._menuItems[t];
1638
1754
  if (i) {
1639
- i.setAttribute("data-highlighted", "true"), t && i.focus();
1755
+ i.setAttribute("data-highlighted", "true"), e && i.focus();
1640
1756
  const a = (s = this.shadowRoot) == null ? void 0 : s.querySelector('[role="menu"]');
1641
1757
  a == null || a.setAttribute("aria-activedescendant", i.id);
1642
1758
  }
1643
1759
  }
1644
- selectItem(e) {
1645
- const t = this._menuItems[e];
1646
- t && (this.emit("a11y-menu-select", { item: t, index: e }), t.click()), this.close();
1760
+ selectItem(t) {
1761
+ const e = this._menuItems[t];
1762
+ e && (this.emit("a11y-menu-select", { item: e, index: t }), e.click()), this.close();
1647
1763
  }
1648
1764
  updateMenuVisibility() {
1649
1765
  var i;
1650
- const e = (i = this.shadowRoot) == null ? void 0 : i.querySelector(".menu-content"), t = this.querySelector('[slot="trigger"]');
1651
- this._open ? (e == null || e.removeAttribute("hidden"), t == null || t.setAttribute("aria-expanded", "true"), this.updateMenuItems(), this.emit("a11y-menu-open")) : (e == null || e.setAttribute("hidden", ""), t == null || t.setAttribute("aria-expanded", "false"), this._highlightedIndex = -1, this._menuItems.forEach((s) => {
1766
+ const t = (i = this.shadowRoot) == null ? void 0 : i.querySelector(".menu-content"), e = this.querySelector('[slot="trigger"]');
1767
+ this._open ? (t == null || t.removeAttribute("hidden"), e == null || e.setAttribute("aria-expanded", "true"), this.updateMenuItems(), this.emit("a11y-menu-open")) : (t == null || t.setAttribute("hidden", ""), e == null || e.setAttribute("aria-expanded", "false"), this._highlightedIndex = -1, this._menuItems.forEach((s) => {
1652
1768
  s.removeAttribute("data-highlighted");
1653
- }), t == null || t.focus(), this.emit("a11y-menu-close"));
1769
+ }), e == null || e.focus(), this.emit("a11y-menu-close"));
1654
1770
  }
1655
1771
  /**
1656
1772
  * Show the menu
@@ -1671,46 +1787,50 @@ class K extends c {
1671
1787
  this.open = !this._open;
1672
1788
  }
1673
1789
  }
1674
- u("a11y-menu", K);
1675
- class F extends c {
1790
+ c("a11y-menu", F);
1791
+ class P extends d {
1676
1792
  constructor() {
1677
- super(...arguments), this._tabs = [], this._panels = [], this._selectedIndex = 0, this.updateTabsAndPanels = () => {
1793
+ super(...arguments), this._tabs = [], this._panels = [], this._selectedIndex = 0, this._focusedIndex = 0, this._tabSlotEl = null, this._panelSlotEl = null, this._defaultSlotEl = null, this.updateTabsAndPanels = () => {
1678
1794
  this._tabs = Array.from(
1679
1795
  this.querySelectorAll('[role="tab"]')
1680
1796
  ), this._panels = Array.from(
1681
1797
  this.querySelectorAll('[role="tabpanel"]')
1682
- ), this._tabs.forEach((e, t) => {
1683
- const i = this._panels[t], s = e.id || `${this._id}-tab-${t}`, a = (i == null ? void 0 : i.id) || `${this._id}-panel-${t}`;
1684
- e.id = s, e.setAttribute("aria-controls", a), e.setAttribute("tabindex", t === this._selectedIndex ? "0" : "-1"), e.setAttribute("aria-selected", String(t === this._selectedIndex)), e.hasAttribute("slot") || e.setAttribute("slot", "tab"), i && (i.id = a, i.setAttribute("aria-labelledby", s), i.setAttribute("tabindex", "0"), i.hidden = t !== this._selectedIndex, i.hasAttribute("slot") || i.setAttribute("slot", "panel"));
1798
+ ), this._tabs.forEach((t, e) => {
1799
+ const i = this._panels[e], s = t.id || `${this._id}-tab-${e}`, a = (i == null ? void 0 : i.id) || `${this._id}-panel-${e}`;
1800
+ t.id = s, t.setAttribute("aria-controls", a), t.setAttribute("tabindex", e === this._selectedIndex ? "0" : "-1"), t.setAttribute("aria-selected", String(e === this._selectedIndex)), t.hasAttribute("slot") || t.setAttribute("slot", "tab"), i && (i.id = a, i.setAttribute("aria-labelledby", s), i.setAttribute("tabindex", "0"), i.hidden = e !== this._selectedIndex, i.hasAttribute("slot") || i.setAttribute("slot", "panel"));
1685
1801
  }), this.updateSelection();
1686
- }, this.handleClick = (e) => {
1687
- const t = e.target;
1688
- if (t.getAttribute("role") === "tab") {
1689
- const i = this._tabs.indexOf(t);
1690
- i !== -1 && t.getAttribute("aria-disabled") !== "true" && this.selectTab(i);
1802
+ }, this.handleClick = (t) => {
1803
+ const e = t.target;
1804
+ if (e.getAttribute("role") === "tab") {
1805
+ const i = this._tabs.indexOf(e);
1806
+ i !== -1 && e.getAttribute("aria-disabled") !== "true" && (this._focusedIndex = i, this.selectTab(i));
1691
1807
  }
1692
- }, this.handleKeyDown = (e) => {
1808
+ }, this.handleKeyDown = (t) => {
1693
1809
  var l;
1694
- if (e.target.getAttribute("role") !== "tab") return;
1810
+ if (t.target.getAttribute("role") !== "tab") return;
1695
1811
  const i = this.orientation === "horizontal", s = i ? "ArrowRight" : "ArrowDown", a = i ? "ArrowLeft" : "ArrowUp";
1696
- let r = this._selectedIndex;
1697
- switch (e.key) {
1812
+ let r = this._focusedIndex;
1813
+ switch (t.key) {
1698
1814
  case s:
1699
- e.preventDefault(), r = (this._selectedIndex + 1) % this._tabs.length;
1815
+ t.preventDefault(), r = (this._focusedIndex + 1) % this._tabs.length;
1700
1816
  break;
1701
1817
  case a:
1702
- e.preventDefault(), r = (this._selectedIndex - 1 + this._tabs.length) % this._tabs.length;
1818
+ t.preventDefault(), r = (this._focusedIndex - 1 + this._tabs.length) % this._tabs.length;
1703
1819
  break;
1704
1820
  case "Home":
1705
- e.preventDefault(), r = 0;
1821
+ t.preventDefault(), r = 0;
1706
1822
  break;
1707
1823
  case "End":
1708
- e.preventDefault(), r = this._tabs.length - 1;
1824
+ t.preventDefault(), r = this._tabs.length - 1;
1709
1825
  break;
1826
+ case "Enter":
1827
+ case " ":
1828
+ t.preventDefault(), this.selectTab(this._focusedIndex);
1829
+ return;
1710
1830
  default:
1711
1831
  return;
1712
1832
  }
1713
- (l = this._tabs[r]) == null || l.focus(), this.activationMode === "automatic" && this.selectTab(r);
1833
+ this._focusedIndex = r, (l = this._tabs[r]) == null || l.focus(), this.activationMode === "automatic" && this.selectTab(r);
1714
1834
  };
1715
1835
  }
1716
1836
  static get observedAttributes() {
@@ -1719,8 +1839,8 @@ class F extends c {
1719
1839
  get selectedIndex() {
1720
1840
  return this._selectedIndex;
1721
1841
  }
1722
- set selectedIndex(e) {
1723
- e >= 0 && e < this._tabs.length && (this._selectedIndex = e, this.updateSelection());
1842
+ set selectedIndex(t) {
1843
+ t >= 0 && t < this._tabs.length && (this._selectedIndex = t, this.updateSelection());
1724
1844
  }
1725
1845
  get orientation() {
1726
1846
  return this.getAttribute("orientation") || "horizontal";
@@ -1732,9 +1852,9 @@ class F extends c {
1732
1852
  this.updateTabsAndPanels();
1733
1853
  }
1734
1854
  render() {
1735
- const e = this.attachShadow({ mode: "open" });
1736
- e.innerHTML = `
1737
- <style>${_e}</style>
1855
+ const t = this.attachShadow({ mode: "open" });
1856
+ t.innerHTML = `
1857
+ <style>${Et}</style>
1738
1858
  <div class="tablist" role="tablist" aria-orientation="${this.orientation}" part="tablist">
1739
1859
  <slot name="tab"></slot>
1740
1860
  </div>
@@ -1745,43 +1865,45 @@ class F extends c {
1745
1865
  `;
1746
1866
  }
1747
1867
  setupEventListeners() {
1748
- var s, a, r;
1749
- this.addEventListener("click", this.handleClick), this.addEventListener("keydown", this.handleKeyDown);
1750
- const e = (s = this.shadowRoot) == null ? void 0 : s.querySelector('slot[name="tab"]'), t = (a = this.shadowRoot) == null ? void 0 : a.querySelector('slot[name="panel"]'), i = (r = this.shadowRoot) == null ? void 0 : r.querySelector("slot:not([name])");
1751
- e == null || e.addEventListener("slotchange", this.updateTabsAndPanels), t == null || t.addEventListener("slotchange", this.updateTabsAndPanels), i == null || i.addEventListener("slotchange", this.updateTabsAndPanels);
1868
+ var t, e, i, s, a, r;
1869
+ this.addEventListener("click", this.handleClick), this.addEventListener("keydown", this.handleKeyDown), this._tabSlotEl = ((t = this.shadowRoot) == null ? void 0 : t.querySelector('slot[name="tab"]')) ?? null, this._panelSlotEl = ((e = this.shadowRoot) == null ? void 0 : e.querySelector('slot[name="panel"]')) ?? null, this._defaultSlotEl = ((i = this.shadowRoot) == null ? void 0 : i.querySelector("slot:not([name])")) ?? null, (s = this._tabSlotEl) == null || s.addEventListener("slotchange", this.updateTabsAndPanels), (a = this._panelSlotEl) == null || a.addEventListener("slotchange", this.updateTabsAndPanels), (r = this._defaultSlotEl) == null || r.addEventListener("slotchange", this.updateTabsAndPanels);
1752
1870
  }
1753
- onAttributeChange(e, t, i) {
1871
+ cleanupEventListeners() {
1872
+ var t, e, i;
1873
+ this.removeEventListener("click", this.handleClick), this.removeEventListener("keydown", this.handleKeyDown), (t = this._tabSlotEl) == null || t.removeEventListener("slotchange", this.updateTabsAndPanels), (e = this._panelSlotEl) == null || e.removeEventListener("slotchange", this.updateTabsAndPanels), (i = this._defaultSlotEl) == null || i.removeEventListener("slotchange", this.updateTabsAndPanels);
1874
+ }
1875
+ onAttributeChange(t, e, i) {
1754
1876
  var s;
1755
- if (e === "orientation") {
1877
+ if (t === "orientation") {
1756
1878
  const a = (s = this.shadowRoot) == null ? void 0 : s.querySelector('[role="tablist"]');
1757
1879
  a == null || a.setAttribute("aria-orientation", i || "horizontal");
1758
1880
  }
1759
- e === "selected-index" && i && (this.selectedIndex = parseInt(i, 10));
1881
+ t === "selected-index" && i && (this.selectedIndex = parseInt(i, 10));
1760
1882
  }
1761
- selectTab(e) {
1762
- const t = this._selectedIndex;
1763
- if (this._selectedIndex = e, this.updateSelection(), t !== e) {
1764
- const i = this._tabs[e];
1883
+ selectTab(t) {
1884
+ const e = this._selectedIndex;
1885
+ if (this._selectedIndex = t, this._focusedIndex = t, this.updateSelection(), e !== t) {
1886
+ const i = this._tabs[t];
1765
1887
  v(`${(i == null ? void 0 : i.textContent) || "Tab"} selected`), this.emit("a11y-tabs-change", {
1766
- index: e,
1767
- tab: this._tabs[e],
1768
- panel: this._panels[e]
1888
+ index: t,
1889
+ tab: this._tabs[t],
1890
+ panel: this._panels[t]
1769
1891
  });
1770
1892
  }
1771
1893
  }
1772
1894
  updateSelection() {
1773
- this._tabs.forEach((e, t) => {
1774
- const i = t === this._selectedIndex;
1775
- e.setAttribute("aria-selected", String(i)), e.setAttribute("tabindex", i ? "0" : "-1");
1776
- }), this._panels.forEach((e, t) => {
1777
- e.hidden = t !== this._selectedIndex;
1895
+ this._tabs.forEach((t, e) => {
1896
+ const i = e === this._selectedIndex;
1897
+ t.setAttribute("aria-selected", String(i)), t.setAttribute("tabindex", i ? "0" : "-1");
1898
+ }), this._panels.forEach((t, e) => {
1899
+ t.hidden = e !== this._selectedIndex;
1778
1900
  });
1779
1901
  }
1780
1902
  /**
1781
1903
  * Select a tab by index
1782
1904
  */
1783
- select(e) {
1784
- this.selectTab(e);
1905
+ select(t) {
1906
+ this.selectTab(t);
1785
1907
  }
1786
1908
  /**
1787
1909
  * Select next tab
@@ -1798,20 +1920,20 @@ class F extends c {
1798
1920
  );
1799
1921
  }
1800
1922
  }
1801
- u("a11y-tabs", F);
1802
- class N extends c {
1923
+ c("a11y-tabs", P);
1924
+ class j extends d {
1803
1925
  constructor() {
1804
1926
  super(...arguments), this._open = !1, this._highlightedIndex = -1, this._options = [], this._filteredOptions = [], this._inputValue = "", this._selectedValue = null, this._inputElement = null, this._listboxElement = null, this.updateOptions = () => {
1805
- const e = Array.from(this.querySelectorAll("option"));
1806
- this._options = e.map((t) => ({
1807
- value: t.getAttribute("value") || t.textContent || "",
1808
- label: t.textContent || "",
1809
- disabled: t.hasAttribute("disabled"),
1810
- element: t
1927
+ const t = Array.from(this.querySelectorAll("option"));
1928
+ this._options = t.map((e) => ({
1929
+ value: e.getAttribute("value") || e.textContent || "",
1930
+ label: e.textContent || "",
1931
+ disabled: e.hasAttribute("disabled"),
1932
+ element: e
1811
1933
  })), this._filteredOptions = [...this._options], this.renderOptions();
1812
- }, this.handleInput = (e) => {
1813
- const t = e.target;
1814
- this._inputValue = t.value;
1934
+ }, this.handleInput = (t) => {
1935
+ const e = t.target;
1936
+ this._inputValue = e.value;
1815
1937
  const i = this._inputValue.toLowerCase();
1816
1938
  this._filteredOptions = i ? this._options.filter((a) => a.label.toLowerCase().includes(i)) : [...this._options], this.renderOptions(), this.open = !0, this._highlightedIndex = 0, this.updateHighlight(), this.updateClearButton();
1817
1939
  const s = this._filteredOptions.length;
@@ -1822,50 +1944,50 @@ class N extends c {
1822
1944
  this.open = !0;
1823
1945
  }, this.handleBlur = () => {
1824
1946
  setTimeout(() => {
1825
- var e;
1826
- (e = this.shadowRoot) != null && e.activeElement || (this.open = !1);
1947
+ var t;
1948
+ (t = this.shadowRoot) != null && t.activeElement || (this.open = !1);
1827
1949
  }, 150);
1828
- }, this.handleKeyDown = (e) => {
1829
- switch (e.key) {
1950
+ }, this.handleKeyDown = (t) => {
1951
+ switch (t.key) {
1830
1952
  case "ArrowDown":
1831
- e.preventDefault(), this._open ? this._highlightedIndex = Math.min(
1953
+ t.preventDefault(), this._open ? this._highlightedIndex = Math.min(
1832
1954
  this._highlightedIndex + 1,
1833
1955
  this._filteredOptions.length - 1
1834
1956
  ) : (this.open = !0, this._highlightedIndex = 0), this.updateHighlight();
1835
1957
  break;
1836
1958
  case "ArrowUp":
1837
- e.preventDefault(), this._open ? this._highlightedIndex = Math.max(this._highlightedIndex - 1, 0) : (this.open = !0, this._highlightedIndex = this._filteredOptions.length - 1), this.updateHighlight();
1959
+ t.preventDefault(), this._open ? this._highlightedIndex = Math.max(this._highlightedIndex - 1, 0) : (this.open = !0, this._highlightedIndex = this._filteredOptions.length - 1), this.updateHighlight();
1838
1960
  break;
1839
1961
  case "Enter":
1840
- if (e.preventDefault(), this._open && this._highlightedIndex >= 0) {
1841
- const t = this._filteredOptions[this._highlightedIndex];
1842
- t && !t.disabled && this.selectOption(t);
1962
+ if (t.preventDefault(), this._open && this._highlightedIndex >= 0) {
1963
+ const e = this._filteredOptions[this._highlightedIndex];
1964
+ e && !e.disabled && this.selectOption(e);
1843
1965
  }
1844
1966
  break;
1845
1967
  case "Escape":
1846
- e.preventDefault(), this.open = !1, this._highlightedIndex = -1;
1968
+ t.preventDefault(), this.open = !1, this._highlightedIndex = -1;
1847
1969
  break;
1848
1970
  case "Home":
1849
- this._open && (e.preventDefault(), this._highlightedIndex = 0, this.updateHighlight());
1971
+ this._open && (t.preventDefault(), this._highlightedIndex = 0, this.updateHighlight());
1850
1972
  break;
1851
1973
  case "End":
1852
- this._open && (e.preventDefault(), this._highlightedIndex = this._filteredOptions.length - 1, this.updateHighlight());
1974
+ this._open && (t.preventDefault(), this._highlightedIndex = this._filteredOptions.length - 1, this.updateHighlight());
1853
1975
  break;
1854
1976
  case "Tab":
1855
1977
  this._open && (this.open = !1, this._highlightedIndex = -1);
1856
1978
  break;
1857
1979
  }
1858
- }, this.handleOptionClick = (e) => {
1859
- const t = e.currentTarget, i = parseInt(t.dataset.index || "0", 10), s = this._filteredOptions[i];
1980
+ }, this.handleOptionClick = (t) => {
1981
+ const e = t.currentTarget, i = parseInt(e.dataset.index || "0", 10), s = this._filteredOptions[i];
1860
1982
  s && !s.disabled && this.selectOption(s);
1861
- }, this.handleOptionHover = (e) => {
1862
- const t = e.currentTarget, i = parseInt(t.dataset.index || "0", 10), s = this._filteredOptions[i];
1983
+ }, this.handleOptionHover = (t) => {
1984
+ const e = t.currentTarget, i = parseInt(e.dataset.index || "0", 10), s = this._filteredOptions[i];
1863
1985
  s && !s.disabled && (this._highlightedIndex = i, this.updateHighlight());
1864
1986
  }, this.handleClear = () => {
1865
1987
  this._inputValue = "", this._selectedValue = null, this._inputElement && (this._inputElement.value = "", this._inputElement.focus()), this._filteredOptions = [...this._options], this.renderOptions(), this.updateClearButton(), this.emit("a11y-combobox-clear"), this.emit("a11y-combobox-change", { value: null, label: null });
1866
- }, this.handleOutsideClick = (e) => {
1988
+ }, this.handleOutsideClick = (t) => {
1867
1989
  if (!this._open) return;
1868
- e.composedPath().includes(this) || (this.open = !1);
1990
+ t.composedPath().includes(this) || (this.open = !1);
1869
1991
  };
1870
1992
  }
1871
1993
  static get observedAttributes() {
@@ -1874,28 +1996,28 @@ class N extends c {
1874
1996
  get open() {
1875
1997
  return this._open;
1876
1998
  }
1877
- set open(e) {
1878
- const t = this._open;
1879
- this._open = e, e !== t && this.updateListboxVisibility(), this.toggleAttribute("open", e);
1999
+ set open(t) {
2000
+ const e = this._open;
2001
+ this._open = t, t !== e && this.updateListboxVisibility(), this.toggleAttribute("open", t);
1880
2002
  }
1881
2003
  get value() {
1882
2004
  return this._selectedValue;
1883
2005
  }
1884
- set value(e) {
1885
- this._selectedValue = e;
1886
- const t = this._options.find((i) => i.value === e);
1887
- t && (this._inputValue = t.label, this._inputElement && (this._inputElement.value = t.label)), this.setAttribute("value", e || "");
2006
+ set value(t) {
2007
+ this._selectedValue = t;
2008
+ const e = this._options.find((i) => i.value === t);
2009
+ e && (this._inputValue = e.label, this._inputElement && (this._inputElement.value = e.label)), this.setAttribute("value", t || "");
1888
2010
  }
1889
2011
  setupAccessibility() {
1890
2012
  }
1891
2013
  render() {
1892
- const e = this.attachShadow({ mode: "open" }), t = `${this._id}-input`, i = `${this._id}-listbox`, s = this.getAttribute("placeholder") || "Search...", a = this.hasAttribute("clearable");
1893
- e.innerHTML = `
1894
- <style>${ye}</style>
2014
+ const t = this.attachShadow({ mode: "open" }), e = `${this._id}-input`, i = `${this._id}-listbox`, s = this.getAttribute("placeholder") || "Search...", a = this.hasAttribute("clearable");
2015
+ t.innerHTML = `
2016
+ <style>${At}</style>
1895
2017
  <div class="combobox-wrapper" part="wrapper">
1896
2018
  <div class="input-wrapper" part="input-wrapper">
1897
2019
  <input
1898
- id="${t}"
2020
+ id="${e}"
1899
2021
  type="text"
1900
2022
  role="combobox"
1901
2023
  autocomplete="off"
@@ -1921,7 +2043,7 @@ class N extends c {
1921
2043
  <ul
1922
2044
  id="${i}"
1923
2045
  role="listbox"
1924
- aria-labelledby="${t}"
2046
+ aria-labelledby="${e}"
1925
2047
  class="listbox"
1926
2048
  tabindex="-1"
1927
2049
  hidden
@@ -1931,56 +2053,56 @@ class N extends c {
1931
2053
  <div class="options-source" hidden>
1932
2054
  <slot></slot>
1933
2055
  </div>
1934
- `, this._inputElement = e.querySelector("input"), this._listboxElement = e.querySelector(".listbox");
2056
+ `, this._inputElement = t.querySelector("input"), this._listboxElement = t.querySelector(".listbox");
1935
2057
  }
1936
2058
  setupEventListeners() {
1937
2059
  var i, s, a, r, l, o;
1938
2060
  (i = this._inputElement) == null || i.addEventListener("input", this.handleInput), (s = this._inputElement) == null || s.addEventListener("focus", this.handleFocus), (a = this._inputElement) == null || a.addEventListener("blur", this.handleBlur), (r = this._inputElement) == null || r.addEventListener("keydown", this.handleKeyDown);
1939
- const e = (l = this.shadowRoot) == null ? void 0 : l.querySelector(".clear-button");
1940
- e == null || e.addEventListener("click", this.handleClear), document.addEventListener("mousedown", this.handleOutsideClick);
1941
- const t = (o = this.shadowRoot) == null ? void 0 : o.querySelector("slot");
1942
- t == null || t.addEventListener("slotchange", this.updateOptions), this.updateOptions();
2061
+ const t = (l = this.shadowRoot) == null ? void 0 : l.querySelector(".clear-button");
2062
+ t == null || t.addEventListener("click", this.handleClear), document.addEventListener("mousedown", this.handleOutsideClick);
2063
+ const e = (o = this.shadowRoot) == null ? void 0 : o.querySelector("slot");
2064
+ e == null || e.addEventListener("slotchange", this.updateOptions), this.updateOptions();
1943
2065
  }
1944
2066
  cleanupEventListeners() {
1945
2067
  document.removeEventListener("mousedown", this.handleOutsideClick);
1946
2068
  }
1947
- onAttributeChange(e, t, i) {
1948
- e === "open" && (this.open = i !== null), e === "value" && (this.value = i), e === "disabled" && this._inputElement && (this._inputElement.disabled = i !== null), e === "placeholder" && this._inputElement && (this._inputElement.placeholder = i || "Search...");
2069
+ onAttributeChange(t, e, i) {
2070
+ t === "open" && (this.open = i !== null), t === "value" && (this.value = i), t === "disabled" && this._inputElement && (this._inputElement.disabled = i !== null), t === "placeholder" && this._inputElement && (this._inputElement.placeholder = i || "Search...");
1949
2071
  }
1950
2072
  renderOptions() {
1951
2073
  this._listboxElement && (this._listboxElement.innerHTML = this._filteredOptions.length === 0 ? '<li role="presentation" class="empty-message" part="empty">No results found</li>' : this._filteredOptions.map(
1952
- (e, t) => `
2074
+ (t, e) => `
1953
2075
  <li
1954
- id="${this._id}-option-${t}"
2076
+ id="${this._id}-option-${e}"
1955
2077
  role="option"
1956
- aria-selected="${this._selectedValue === e.value}"
1957
- aria-disabled="${e.disabled}"
1958
- data-value="${e.value}"
1959
- data-index="${t}"
2078
+ aria-selected="${this._selectedValue === t.value}"
2079
+ aria-disabled="${t.disabled}"
2080
+ data-value="${t.value}"
2081
+ data-index="${e}"
1960
2082
  part="option"
1961
- ${e.disabled ? 'class="disabled"' : ""}
1962
- >${e.label}</li>
2083
+ ${t.disabled ? 'class="disabled"' : ""}
2084
+ >${t.label}</li>
1963
2085
  `
1964
- ).join(""), this._listboxElement.querySelectorAll('[role="option"]').forEach((e) => {
1965
- e.addEventListener("click", this.handleOptionClick), e.addEventListener("mouseenter", this.handleOptionHover);
2086
+ ).join(""), this._listboxElement.querySelectorAll('[role="option"]').forEach((t) => {
2087
+ t.addEventListener("click", this.handleOptionClick), t.addEventListener("mouseenter", this.handleOptionHover);
1966
2088
  }));
1967
2089
  }
1968
- selectOption(e) {
1969
- this._selectedValue = e.value, this._inputValue = e.label, this._inputElement && (this._inputElement.value = e.label), this.open = !1, this._highlightedIndex = -1, this.renderOptions(), this.updateClearButton(), v(`${e.label} selected`), this.emit("a11y-combobox-select", {
1970
- value: e.value,
1971
- label: e.label
2090
+ selectOption(t) {
2091
+ this._selectedValue = t.value, this._inputValue = t.label, this._inputElement && (this._inputElement.value = t.label), this.open = !1, this._highlightedIndex = -1, this.renderOptions(), this.updateClearButton(), v(`${t.label} selected`), this.emit("a11y-combobox-select", {
2092
+ value: t.value,
2093
+ label: t.label
1972
2094
  }), this.emit("a11y-combobox-change", {
1973
- value: e.value,
1974
- label: e.label
2095
+ value: t.value,
2096
+ label: t.label
1975
2097
  });
1976
2098
  }
1977
2099
  updateHighlight() {
1978
- var e, t, i, s;
1979
- if ((e = this._listboxElement) == null || e.querySelectorAll('[role="option"]').forEach((a, r) => {
2100
+ var t, e, i, s;
2101
+ if ((t = this._listboxElement) == null || t.querySelectorAll('[role="option"]').forEach((a, r) => {
1980
2102
  a.classList.toggle("highlighted", r === this._highlightedIndex);
1981
2103
  }), this._highlightedIndex >= 0) {
1982
2104
  const a = `${this._id}-option-${this._highlightedIndex}`;
1983
- (t = this._inputElement) == null || t.setAttribute("aria-activedescendant", a);
2105
+ (e = this._inputElement) == null || e.setAttribute("aria-activedescendant", a);
1984
2106
  const r = (i = this._listboxElement) == null ? void 0 : i.querySelector(`#${a}`);
1985
2107
  r == null || r.scrollIntoView({ block: "nearest", behavior: "smooth" });
1986
2108
  } else
@@ -1991,19 +2113,19 @@ class N extends c {
1991
2113
  }
1992
2114
  updateListboxPosition() {
1993
2115
  if (!this._listboxElement || !this._inputElement) return;
1994
- const e = this._inputElement.getBoundingClientRect(), t = window.innerHeight, i = Math.min(
2116
+ const t = this._inputElement.getBoundingClientRect(), e = window.innerHeight, i = Math.min(
1995
2117
  this._listboxElement.scrollHeight,
1996
2118
  200
1997
2119
  // max-height from CSS
1998
- ), s = t - e.bottom, a = e.top;
2120
+ ), s = e - t.bottom, a = t.top;
1999
2121
  s < i + 8 && a > s ? (this._listboxElement.style.top = "auto", this._listboxElement.style.bottom = "100%", this._listboxElement.style.marginTop = "0", this._listboxElement.style.marginBottom = "4px", this.setAttribute("data-position", "top")) : (this._listboxElement.style.top = "100%", this._listboxElement.style.bottom = "auto", this._listboxElement.style.marginTop = "4px", this._listboxElement.style.marginBottom = "0", this.setAttribute("data-position", "bottom"));
2000
2122
  }
2001
2123
  updateClearButton() {
2002
- var t;
2003
- const e = (t = this.shadowRoot) == null ? void 0 : t.querySelector(
2124
+ var e;
2125
+ const t = (e = this.shadowRoot) == null ? void 0 : e.querySelector(
2004
2126
  ".clear-button"
2005
2127
  );
2006
- e && (e.hidden = !this._inputValue);
2128
+ t && (t.hidden = !this._inputValue);
2007
2129
  }
2008
2130
  /**
2009
2131
  * Programmatic open
@@ -2024,16 +2146,16 @@ class N extends c {
2024
2146
  this.handleClear();
2025
2147
  }
2026
2148
  }
2027
- u("a11y-combobox", N);
2028
- class P extends c {
2149
+ c("a11y-combobox", j);
2150
+ class U extends d {
2029
2151
  constructor() {
2030
2152
  super(...arguments), this._checked = !1, this._button = null, this._label = null, this.handleClick = () => {
2031
2153
  this.toggle();
2032
- }, this.handleKeyDown = (e) => {
2033
- this.disabled || (e.key === " " || e.key === "Enter") && (e.preventDefault(), this.toggle());
2154
+ }, this.handleKeyDown = (t) => {
2155
+ this.disabled || (t.key === " " || t.key === "Enter") && (t.preventDefault(), this.toggle());
2034
2156
  }, this.handleLabelClick = () => {
2035
- var e;
2036
- this.disabled || (this.toggle(), (e = this._button) == null || e.focus());
2157
+ var t;
2158
+ this.disabled || (this.toggle(), (t = this._button) == null || t.focus());
2037
2159
  };
2038
2160
  }
2039
2161
  static get observedAttributes() {
@@ -2045,9 +2167,9 @@ class P extends c {
2045
2167
  get checked() {
2046
2168
  return this._checked;
2047
2169
  }
2048
- set checked(e) {
2049
- const t = this._checked;
2050
- this._checked = e, this.toggleAttribute("checked", e), e !== t && (this.updateVisualState(), this.emit("change", { checked: e }));
2170
+ set checked(t) {
2171
+ const e = this._checked;
2172
+ this._checked = t, this.toggleAttribute("checked", t), t !== e && (this.updateVisualState(), this.emit("change", { checked: t }));
2051
2173
  }
2052
2174
  /**
2053
2175
  * Get/set the disabled state
@@ -2055,8 +2177,8 @@ class P extends c {
2055
2177
  get disabled() {
2056
2178
  return this.hasAttribute("disabled");
2057
2179
  }
2058
- set disabled(e) {
2059
- this.toggleAttribute("disabled", e), this.updateDisabledState();
2180
+ set disabled(t) {
2181
+ this.toggleAttribute("disabled", t), this.updateDisabledState();
2060
2182
  }
2061
2183
  /**
2062
2184
  * Get/set the visible label
@@ -2064,30 +2186,30 @@ class P extends c {
2064
2186
  get label() {
2065
2187
  return this.getAttribute("label") || "";
2066
2188
  }
2067
- set label(e) {
2068
- e ? this.setAttribute("label", e) : this.removeAttribute("label");
2189
+ set label(t) {
2190
+ t ? this.setAttribute("label", t) : this.removeAttribute("label");
2069
2191
  }
2070
2192
  /**
2071
2193
  * Get/set the size variant
2072
2194
  */
2073
2195
  get size() {
2074
- const e = this.getAttribute("size");
2075
- return e === "sm" || e === "lg" ? e : "md";
2196
+ const t = this.getAttribute("size");
2197
+ return t === "sm" || t === "lg" ? t : "md";
2076
2198
  }
2077
- set size(e) {
2078
- this.setAttribute("size", e);
2199
+ set size(t) {
2200
+ this.setAttribute("size", t);
2079
2201
  }
2080
2202
  setupAccessibility() {
2081
- var e;
2082
- this.getAttribute("role"), typeof process < "u" && ((e = process.env) == null ? void 0 : e.NODE_ENV) !== "production" && !this.label && !this.getAttribute("aria-label") && console.warn(
2203
+ var t;
2204
+ this.getAttribute("role"), typeof process < "u" && ((t = process.env) == null ? void 0 : t.NODE_ENV) !== "production" && !this.label && !this.getAttribute("aria-label") && console.warn(
2083
2205
  `[compa11y/Switch] Switch has no accessible label. Add label="..." or aria-label="..." attribute.
2084
2206
  💡 Suggestion: <a11y-switch label="Enable feature"></a11y-switch>`
2085
2207
  );
2086
2208
  }
2087
2209
  render() {
2088
- const e = this.attachShadow({ mode: "open" }), t = `${this._id}-label`, i = !!this.label, s = this.getAttribute("aria-label"), a = i ? "" : s ? `aria-label="${s}"` : "", r = i ? `aria-labelledby="${t}"` : "";
2089
- e.innerHTML = `
2090
- <style>${Ae}</style>
2210
+ const t = this.attachShadow({ mode: "open" }), e = `${this._id}-label`, i = !!this.label, s = this.getAttribute("aria-label"), a = i ? "" : s ? `aria-label="${s}"` : "", r = i ? `aria-labelledby="${e}"` : "";
2211
+ t.innerHTML = `
2212
+ <style>${wt}</style>
2091
2213
  <div class="switch-wrapper size-${this.size}" part="wrapper">
2092
2214
  <button
2093
2215
  type="button"
@@ -2102,20 +2224,20 @@ class P extends c {
2102
2224
  >
2103
2225
  <span class="switch-thumb" part="thumb" aria-hidden="true"></span>
2104
2226
  </button>
2105
- ${i ? `<label id="${t}" class="switch-label ${this.disabled ? "disabled" : ""}" part="label">${this.label}</label>` : ""}
2227
+ ${i ? `<label id="${e}" class="switch-label ${this.disabled ? "disabled" : ""}" part="label">${this.label}</label>` : ""}
2106
2228
  </div>
2107
- `, this._button = e.querySelector("button"), this._label = e.querySelector("label");
2229
+ `, this._button = t.querySelector("button"), this._label = t.querySelector("label");
2108
2230
  }
2109
2231
  setupEventListeners() {
2110
- var e, t, i;
2111
- (e = this._button) == null || e.addEventListener("click", this.handleClick), (t = this._button) == null || t.addEventListener("keydown", this.handleKeyDown), (i = this._label) == null || i.addEventListener("click", this.handleLabelClick);
2232
+ var t, e, i;
2233
+ (t = this._button) == null || t.addEventListener("click", this.handleClick), (e = this._button) == null || e.addEventListener("keydown", this.handleKeyDown), (i = this._label) == null || i.addEventListener("click", this.handleLabelClick);
2112
2234
  }
2113
2235
  cleanupEventListeners() {
2114
- var e, t, i;
2115
- (e = this._button) == null || e.removeEventListener("click", this.handleClick), (t = this._button) == null || t.removeEventListener("keydown", this.handleKeyDown), (i = this._label) == null || i.removeEventListener("click", this.handleLabelClick);
2236
+ var t, e, i;
2237
+ (t = this._button) == null || t.removeEventListener("click", this.handleClick), (e = this._button) == null || e.removeEventListener("keydown", this.handleKeyDown), (i = this._label) == null || i.removeEventListener("click", this.handleLabelClick);
2116
2238
  }
2117
- onAttributeChange(e, t, i) {
2118
- switch (e) {
2239
+ onAttributeChange(t, e, i) {
2240
+ switch (t) {
2119
2241
  case "checked":
2120
2242
  this._checked = i !== null, this.updateVisualState();
2121
2243
  break;
@@ -2147,9 +2269,9 @@ class P extends c {
2147
2269
  * Update the size class
2148
2270
  */
2149
2271
  updateSizeClass() {
2150
- var t;
2151
- const e = (t = this.shadowRoot) == null ? void 0 : t.querySelector(".switch-wrapper");
2152
- e && (e.classList.remove("size-sm", "size-md", "size-lg"), e.classList.add(`size-${this.size}`));
2272
+ var e;
2273
+ const t = (e = this.shadowRoot) == null ? void 0 : e.querySelector(".switch-wrapper");
2274
+ t && (t.classList.remove("size-sm", "size-md", "size-lg"), t.classList.add(`size-${this.size}`));
2153
2275
  }
2154
2276
  /**
2155
2277
  * Public method to toggle the switch programmatically
@@ -2157,69 +2279,69 @@ class P extends c {
2157
2279
  toggle() {
2158
2280
  if (this.disabled) return;
2159
2281
  this.checked = !this.checked;
2160
- const e = this.label || this.getAttribute("aria-label") || "Switch";
2161
- p(`${e} ${this.checked ? "on" : "off"}`);
2282
+ const t = this.label || this.getAttribute("aria-label") || "Switch";
2283
+ p(`${t} ${this.checked ? "on" : "off"}`);
2162
2284
  }
2163
2285
  /**
2164
2286
  * Public method to open/close programmatically
2165
2287
  */
2166
- setChecked(e) {
2167
- this.checked = e;
2288
+ setChecked(t) {
2289
+ this.checked = t;
2168
2290
  }
2169
2291
  }
2170
- u("a11y-switch", P);
2171
- class j extends c {
2292
+ c("a11y-switch", U);
2293
+ class Y extends d {
2172
2294
  constructor() {
2173
2295
  super(...arguments), this._open = !1, this._highlightedIndex = -1, this._options = [], this._selectedValue = null, this._triggerElement = null, this._listboxElement = null, this._typeAhead = null, this.updateOptions = () => {
2174
- const e = Array.from(this.querySelectorAll("option"));
2175
- this._options = e.map((t) => ({
2176
- value: t.getAttribute("value") || t.textContent || "",
2177
- label: t.textContent || "",
2178
- disabled: t.hasAttribute("disabled"),
2179
- element: t
2296
+ const t = Array.from(this.querySelectorAll("option"));
2297
+ this._options = t.map((e) => ({
2298
+ value: e.getAttribute("value") || e.textContent || "",
2299
+ label: e.textContent || "",
2300
+ disabled: e.hasAttribute("disabled"),
2301
+ element: e
2180
2302
  })), this._typeAhead = q(
2181
- this._options.map((t) => t.label),
2303
+ this._options.map((e) => e.label),
2182
2304
  { timeout: 500 }
2183
2305
  ), this.renderOptions(), this.updateTriggerText();
2184
2306
  }, this.handleTriggerClick = () => {
2185
- var e;
2186
- (e = this._triggerElement) != null && e.disabled || (this._open ? (this.open = !1, this._highlightedIndex = -1) : this.openAndHighlight());
2187
- }, this.handleKeyDown = (e) => {
2188
2307
  var t;
2189
- switch (e.key) {
2308
+ (t = this._triggerElement) != null && t.disabled || (this._open ? (this.open = !1, this._highlightedIndex = -1) : this.openAndHighlight());
2309
+ }, this.handleKeyDown = (t) => {
2310
+ var e;
2311
+ switch (t.key) {
2190
2312
  case "ArrowDown":
2191
- e.preventDefault(), this._open ? this.highlightNext() : this.openAndHighlight();
2313
+ t.preventDefault(), this._open ? this.highlightNext() : this.openAndHighlight();
2192
2314
  break;
2193
2315
  case "ArrowUp":
2194
- e.preventDefault(), this._open ? this.highlightPrevious() : this.openAndHighlight(!0);
2316
+ t.preventDefault(), this._open ? this.highlightPrevious() : this.openAndHighlight(!0);
2195
2317
  break;
2196
2318
  case "Enter":
2197
- if (e.preventDefault(), this._open && this._highlightedIndex >= 0) {
2319
+ if (t.preventDefault(), this._open && this._highlightedIndex >= 0) {
2198
2320
  const i = this._options[this._highlightedIndex];
2199
2321
  i && !i.disabled && this.selectOption(i);
2200
2322
  } else this._open || this.openAndHighlight();
2201
2323
  break;
2202
2324
  case " ":
2203
- if (e.preventDefault(), this._open && this._highlightedIndex >= 0) {
2325
+ if (t.preventDefault(), this._open && this._highlightedIndex >= 0) {
2204
2326
  const i = this._options[this._highlightedIndex];
2205
2327
  i && !i.disabled && this.selectOption(i);
2206
2328
  } else this._open || this.openAndHighlight();
2207
2329
  break;
2208
2330
  case "Escape":
2209
- e.preventDefault(), this._open && (this.open = !1, this._highlightedIndex = -1);
2331
+ t.preventDefault(), this._open && (this.open = !1, this._highlightedIndex = -1);
2210
2332
  break;
2211
2333
  case "Home":
2212
- this._open && (e.preventDefault(), this._highlightedIndex = this.findFirstEnabled(), this.updateHighlight());
2334
+ this._open && (t.preventDefault(), this._highlightedIndex = this.findFirstEnabled(), this.updateHighlight());
2213
2335
  break;
2214
2336
  case "End":
2215
- this._open && (e.preventDefault(), this._highlightedIndex = this.findLastEnabled(), this.updateHighlight());
2337
+ this._open && (t.preventDefault(), this._highlightedIndex = this.findLastEnabled(), this.updateHighlight());
2216
2338
  break;
2217
2339
  case "Tab":
2218
2340
  this._open && (this.open = !1, this._highlightedIndex = -1);
2219
2341
  break;
2220
2342
  default:
2221
- if (e.key.length === 1 && !e.ctrlKey && !e.altKey && !e.metaKey) {
2222
- const i = (t = this._typeAhead) == null ? void 0 : t.type(e.key);
2343
+ if (t.key.length === 1 && !t.ctrlKey && !t.altKey && !t.metaKey) {
2344
+ const i = (e = this._typeAhead) == null ? void 0 : e.type(t.key);
2223
2345
  if (i) {
2224
2346
  const s = this._options.findIndex(
2225
2347
  (a) => a.label === i && !a.disabled
@@ -2231,20 +2353,20 @@ class j extends c {
2231
2353
  }
2232
2354
  }, this.handleBlur = () => {
2233
2355
  setTimeout(() => {
2234
- var e;
2235
- (e = this.shadowRoot) != null && e.activeElement || (this.open = !1, this._highlightedIndex = -1);
2356
+ var t;
2357
+ (t = this.shadowRoot) != null && t.activeElement || (this.open = !1, this._highlightedIndex = -1);
2236
2358
  }, 150);
2237
- }, this.handleListboxMouseDown = (e) => {
2238
- e.preventDefault();
2239
- }, this.handleOptionClick = (e) => {
2240
- const t = e.currentTarget, i = parseInt(t.dataset.index || "0", 10), s = this._options[i];
2359
+ }, this.handleListboxMouseDown = (t) => {
2360
+ t.preventDefault();
2361
+ }, this.handleOptionClick = (t) => {
2362
+ const e = t.currentTarget, i = parseInt(e.dataset.index || "0", 10), s = this._options[i];
2241
2363
  s && !s.disabled && this.selectOption(s);
2242
- }, this.handleOptionHover = (e) => {
2243
- const t = e.currentTarget, i = parseInt(t.dataset.index || "0", 10), s = this._options[i];
2364
+ }, this.handleOptionHover = (t) => {
2365
+ const e = t.currentTarget, i = parseInt(e.dataset.index || "0", 10), s = this._options[i];
2244
2366
  s && !s.disabled && (this._highlightedIndex = i, this.updateHighlight());
2245
- }, this.handleOutsideClick = (e) => {
2367
+ }, this.handleOutsideClick = (t) => {
2246
2368
  if (!this._open) return;
2247
- e.composedPath().includes(this) || (this.open = !1, this._highlightedIndex = -1);
2369
+ t.composedPath().includes(this) || (this.open = !1, this._highlightedIndex = -1);
2248
2370
  };
2249
2371
  }
2250
2372
  static get observedAttributes() {
@@ -2253,25 +2375,25 @@ class j extends c {
2253
2375
  get open() {
2254
2376
  return this._open;
2255
2377
  }
2256
- set open(e) {
2257
- const t = this._open;
2258
- this._open = e, e !== t && this.updateListboxVisibility(), this.toggleAttribute("open", e);
2378
+ set open(t) {
2379
+ const e = this._open;
2380
+ this._open = t, t !== e && this.updateListboxVisibility(), this.toggleAttribute("open", t);
2259
2381
  }
2260
2382
  get value() {
2261
2383
  return this._selectedValue;
2262
2384
  }
2263
- set value(e) {
2264
- this._selectedValue = e, this.updateTriggerText(), this.setAttribute("value", e || "");
2385
+ set value(t) {
2386
+ this._selectedValue = t, this.updateTriggerText(), this.setAttribute("value", t || "");
2265
2387
  }
2266
2388
  setupAccessibility() {
2267
2389
  }
2268
2390
  render() {
2269
- const e = this.attachShadow({ mode: "open" }), t = `${this._id}-trigger`, i = `${this._id}-listbox`, s = this.getAttribute("placeholder") || "Select an option...", a = this.getAttribute("aria-label") || "", r = this.getAttribute("aria-labelledby") || "";
2270
- e.innerHTML = `
2271
- <style>${xe}</style>
2391
+ const t = this.attachShadow({ mode: "open" }), e = `${this._id}-trigger`, i = `${this._id}-listbox`, s = this.getAttribute("placeholder") || "Select an option...", a = this.getAttribute("aria-label") || "", r = this.getAttribute("aria-labelledby") || "";
2392
+ t.innerHTML = `
2393
+ <style>${kt}</style>
2272
2394
  <div class="select-wrapper" part="wrapper">
2273
2395
  <button
2274
- id="${t}"
2396
+ id="${e}"
2275
2397
  type="button"
2276
2398
  role="combobox"
2277
2399
  aria-expanded="false"
@@ -2288,7 +2410,7 @@ class j extends c {
2288
2410
  <ul
2289
2411
  id="${i}"
2290
2412
  role="listbox"
2291
- aria-labelledby="${t}"
2413
+ aria-labelledby="${e}"
2292
2414
  class="listbox"
2293
2415
  tabindex="-1"
2294
2416
  hidden
@@ -2298,105 +2420,105 @@ class j extends c {
2298
2420
  <div class="options-source" hidden>
2299
2421
  <slot></slot>
2300
2422
  </div>
2301
- `, this._triggerElement = e.querySelector(".select-trigger"), this._listboxElement = e.querySelector(".listbox");
2423
+ `, this._triggerElement = t.querySelector(".select-trigger"), this._listboxElement = t.querySelector(".listbox");
2302
2424
  }
2303
2425
  setupEventListeners() {
2304
- var t, i, s, a, r;
2305
- (t = this._triggerElement) == null || t.addEventListener("click", this.handleTriggerClick), (i = this._triggerElement) == null || i.addEventListener("keydown", this.handleKeyDown), (s = this._triggerElement) == null || s.addEventListener("blur", this.handleBlur), (a = this._listboxElement) == null || a.addEventListener(
2426
+ var e, i, s, a, r;
2427
+ (e = this._triggerElement) == null || e.addEventListener("click", this.handleTriggerClick), (i = this._triggerElement) == null || i.addEventListener("keydown", this.handleKeyDown), (s = this._triggerElement) == null || s.addEventListener("blur", this.handleBlur), (a = this._listboxElement) == null || a.addEventListener(
2306
2428
  "mousedown",
2307
2429
  this.handleListboxMouseDown
2308
2430
  ), document.addEventListener("mousedown", this.handleOutsideClick);
2309
- const e = (r = this.shadowRoot) == null ? void 0 : r.querySelector("slot");
2310
- e == null || e.addEventListener("slotchange", this.updateOptions), this.updateOptions();
2431
+ const t = (r = this.shadowRoot) == null ? void 0 : r.querySelector("slot");
2432
+ t == null || t.addEventListener("slotchange", this.updateOptions), this.updateOptions();
2311
2433
  }
2312
2434
  cleanupEventListeners() {
2313
2435
  document.removeEventListener("mousedown", this.handleOutsideClick);
2314
2436
  }
2315
- onAttributeChange(e, t, i) {
2316
- e === "open" && (this.open = i !== null), e === "value" && (this.value = i), e === "disabled" && this._triggerElement && (this._triggerElement.disabled = i !== null), e === "placeholder" && this.updateTriggerText();
2437
+ onAttributeChange(t, e, i) {
2438
+ t === "open" && (this.open = i !== null), t === "value" && (this.value = i), t === "disabled" && this._triggerElement && (this._triggerElement.disabled = i !== null), t === "placeholder" && this.updateTriggerText();
2317
2439
  }
2318
2440
  renderOptions() {
2319
2441
  this._listboxElement && (this._listboxElement.innerHTML = this._options.map(
2320
- (e, t) => `
2442
+ (t, e) => `
2321
2443
  <li
2322
- id="${this._id}-option-${t}"
2444
+ id="${this._id}-option-${e}"
2323
2445
  role="option"
2324
- aria-selected="${this._selectedValue === e.value}"
2325
- aria-disabled="${e.disabled}"
2326
- data-value="${e.value}"
2327
- data-index="${t}"
2446
+ aria-selected="${this._selectedValue === t.value}"
2447
+ aria-disabled="${t.disabled}"
2448
+ data-value="${t.value}"
2449
+ data-index="${e}"
2328
2450
  part="option"
2329
- ${e.disabled ? 'class="disabled"' : ""}
2451
+ ${t.disabled ? 'class="disabled"' : ""}
2330
2452
  >
2331
- <span class="option-text">${e.label}</span>
2332
- ${this._selectedValue === e.value ? '<span class="check-mark" aria-hidden="true">&#10003;</span>' : ""}
2453
+ <span class="option-text">${t.label}</span>
2454
+ ${this._selectedValue === t.value ? '<span class="check-mark" aria-hidden="true">&#10003;</span>' : ""}
2333
2455
  </li>
2334
2456
  `
2335
- ).join(""), this._listboxElement.querySelectorAll('[role="option"]').forEach((e) => {
2336
- e.addEventListener("click", this.handleOptionClick), e.addEventListener("mouseenter", this.handleOptionHover);
2457
+ ).join(""), this._listboxElement.querySelectorAll('[role="option"]').forEach((t) => {
2458
+ t.addEventListener("click", this.handleOptionClick), t.addEventListener("mouseenter", this.handleOptionHover);
2337
2459
  }));
2338
2460
  }
2339
- openAndHighlight(e = !1) {
2461
+ openAndHighlight(t = !1) {
2340
2462
  this.open = !0;
2341
- const t = this._options.findIndex(
2463
+ const e = this._options.findIndex(
2342
2464
  (i) => i.value === this._selectedValue
2343
2465
  );
2344
- t >= 0 ? this._highlightedIndex = t : this._highlightedIndex = e ? this.findLastEnabled() : this.findFirstEnabled(), this.updateHighlight(), v(
2466
+ e >= 0 ? this._highlightedIndex = e : this._highlightedIndex = t ? this.findLastEnabled() : this.findFirstEnabled(), this.updateHighlight(), v(
2345
2467
  `${this._options.length} option${this._options.length === 1 ? "" : "s"} available`
2346
2468
  );
2347
2469
  }
2348
- selectOption(e) {
2349
- this._selectedValue = e.value, this.updateTriggerText(), this.open = !1, this._highlightedIndex = -1, this.renderOptions(), v(`${e.label} selected`), this.emit("a11y-select-change", {
2350
- value: e.value,
2351
- label: e.label
2470
+ selectOption(t) {
2471
+ this._selectedValue = t.value, this.updateTriggerText(), this.open = !1, this._highlightedIndex = -1, this.renderOptions(), v(`${t.label} selected`), this.emit("a11y-select-change", {
2472
+ value: t.value,
2473
+ label: t.label
2352
2474
  }), this.emit("change", {
2353
- value: e.value,
2354
- label: e.label
2475
+ value: t.value,
2476
+ label: t.label
2355
2477
  });
2356
2478
  }
2357
2479
  updateTriggerText() {
2358
2480
  var s;
2359
- const e = (s = this.shadowRoot) == null ? void 0 : s.querySelector(".select-value");
2360
- if (!e) return;
2361
- const t = this._options.find(
2481
+ const t = (s = this.shadowRoot) == null ? void 0 : s.querySelector(".select-value");
2482
+ if (!t) return;
2483
+ const e = this._options.find(
2362
2484
  (a) => a.value === this._selectedValue
2363
2485
  ), i = this.getAttribute("placeholder") || "Select an option...";
2364
- t ? (e.textContent = t.label, e.classList.remove("placeholder")) : (e.textContent = i, e.classList.add("placeholder"));
2486
+ e ? (t.textContent = e.label, t.classList.remove("placeholder")) : (t.textContent = i, t.classList.add("placeholder"));
2365
2487
  }
2366
2488
  highlightNext() {
2367
- const e = this.findNextEnabled(this._highlightedIndex, 1);
2368
- e >= 0 && (this._highlightedIndex = e, this.updateHighlight());
2489
+ const t = this.findNextEnabled(this._highlightedIndex, 1);
2490
+ t >= 0 && (this._highlightedIndex = t, this.updateHighlight());
2369
2491
  }
2370
2492
  highlightPrevious() {
2371
- const e = this.findNextEnabled(this._highlightedIndex, -1);
2372
- e >= 0 && (this._highlightedIndex = e, this.updateHighlight());
2493
+ const t = this.findNextEnabled(this._highlightedIndex, -1);
2494
+ t >= 0 && (this._highlightedIndex = t, this.updateHighlight());
2373
2495
  }
2374
- findNextEnabled(e, t) {
2496
+ findNextEnabled(t, e) {
2375
2497
  var r;
2376
2498
  const i = this._options.length;
2377
- let s = e + t;
2499
+ let s = t + e;
2378
2500
  s < 0 && (s = i - 1), s >= i && (s = 0);
2379
2501
  const a = s;
2380
2502
  for (; (r = this._options[s]) != null && r.disabled; )
2381
- if (s += t, s < 0 && (s = i - 1), s >= i && (s = 0), s === a) return -1;
2503
+ if (s += e, s < 0 && (s = i - 1), s >= i && (s = 0), s === a) return -1;
2382
2504
  return s;
2383
2505
  }
2384
2506
  findFirstEnabled() {
2385
- return this._options.findIndex((e) => !e.disabled);
2507
+ return this._options.findIndex((t) => !t.disabled);
2386
2508
  }
2387
2509
  findLastEnabled() {
2388
- var e;
2389
- for (let t = this._options.length - 1; t >= 0; t--)
2390
- if (!((e = this._options[t]) != null && e.disabled)) return t;
2510
+ var t;
2511
+ for (let e = this._options.length - 1; e >= 0; e--)
2512
+ if (!((t = this._options[e]) != null && t.disabled)) return e;
2391
2513
  return -1;
2392
2514
  }
2393
2515
  updateHighlight() {
2394
- var e, t, i, s;
2395
- if ((e = this._listboxElement) == null || e.querySelectorAll('[role="option"]').forEach((a, r) => {
2516
+ var t, e, i, s;
2517
+ if ((t = this._listboxElement) == null || t.querySelectorAll('[role="option"]').forEach((a, r) => {
2396
2518
  a.classList.toggle("highlighted", r === this._highlightedIndex);
2397
2519
  }), this._highlightedIndex >= 0) {
2398
2520
  const a = `${this._id}-option-${this._highlightedIndex}`;
2399
- (t = this._triggerElement) == null || t.setAttribute("aria-activedescendant", a);
2521
+ (e = this._triggerElement) == null || e.setAttribute("aria-activedescendant", a);
2400
2522
  const r = (i = this._listboxElement) == null ? void 0 : i.querySelector(`#${a}`);
2401
2523
  r == null || r.scrollIntoView({ block: "nearest", behavior: "smooth" });
2402
2524
  } else
@@ -2407,7 +2529,7 @@ class j extends c {
2407
2529
  }
2408
2530
  updateListboxPosition() {
2409
2531
  if (!this._listboxElement || !this._triggerElement) return;
2410
- const e = this._triggerElement.getBoundingClientRect(), t = window.innerHeight, i = Math.min(this._listboxElement.scrollHeight, 200), s = t - e.bottom, a = e.top;
2532
+ const t = this._triggerElement.getBoundingClientRect(), e = window.innerHeight, i = Math.min(this._listboxElement.scrollHeight, 200), s = e - t.bottom, a = t.top;
2411
2533
  s < i + 8 && a > s ? (this._listboxElement.style.top = "auto", this._listboxElement.style.bottom = "100%", this._listboxElement.style.marginTop = "0", this._listboxElement.style.marginBottom = "4px", this.setAttribute("data-position", "top")) : (this._listboxElement.style.top = "100%", this._listboxElement.style.bottom = "auto", this._listboxElement.style.marginTop = "4px", this._listboxElement.style.marginBottom = "0", this.setAttribute("data-position", "bottom"));
2412
2534
  }
2413
2535
  /** Programmatic open */
@@ -2419,15 +2541,15 @@ class j extends c {
2419
2541
  this.open = !1;
2420
2542
  }
2421
2543
  }
2422
- u("a11y-select", j);
2423
- class U extends c {
2544
+ c("a11y-select", Y);
2545
+ class G extends d {
2424
2546
  constructor() {
2425
- super(...arguments), this._value = "", this._inputEl = null, this._labelEl = null, this._hintEl = null, this._errorEl = null, this.handleInput = (e) => {
2426
- const t = e.target;
2427
- this._value = t.value, this.emit("input", { value: this._value });
2428
- }, this.handleChange = (e) => {
2429
- const t = e.target;
2430
- this._value = t.value, this.emit("change", { value: this._value });
2547
+ super(...arguments), this._value = "", this._inputEl = null, this._labelEl = null, this._hintEl = null, this._errorEl = null, this.handleInput = (t) => {
2548
+ const e = t.target;
2549
+ this._value = e.value, this.emit("input", { value: this._value });
2550
+ }, this.handleChange = (t) => {
2551
+ const e = t.target;
2552
+ this._value = e.value, this.emit("change", { value: this._value });
2431
2553
  }, this.handleFocus = () => {
2432
2554
  this.emit("a11y-input-focus");
2433
2555
  }, this.handleBlur = () => {
@@ -2461,91 +2583,91 @@ class U extends c {
2461
2583
  get value() {
2462
2584
  return this._value;
2463
2585
  }
2464
- set value(e) {
2465
- const t = this._value;
2466
- this._value = e, this._inputEl && this._inputEl.value !== e && (this._inputEl.value = e), e !== t && this.setAttribute("value", e);
2586
+ set value(t) {
2587
+ const e = this._value;
2588
+ this._value = t, this._inputEl && this._inputEl.value !== t && (this._inputEl.value = t), t !== e && this.setAttribute("value", t);
2467
2589
  }
2468
2590
  get disabled() {
2469
2591
  return this.hasAttribute("disabled");
2470
2592
  }
2471
- set disabled(e) {
2472
- this.toggleAttribute("disabled", e);
2593
+ set disabled(t) {
2594
+ this.toggleAttribute("disabled", t);
2473
2595
  }
2474
2596
  get readOnly() {
2475
2597
  return this.hasAttribute("readonly");
2476
2598
  }
2477
- set readOnly(e) {
2478
- this.toggleAttribute("readonly", e);
2599
+ set readOnly(t) {
2600
+ this.toggleAttribute("readonly", t);
2479
2601
  }
2480
2602
  get required() {
2481
2603
  return this.hasAttribute("required");
2482
2604
  }
2483
- set required(e) {
2484
- this.toggleAttribute("required", e);
2605
+ set required(t) {
2606
+ this.toggleAttribute("required", t);
2485
2607
  }
2486
2608
  get error() {
2487
2609
  return this.getAttribute("error") || "";
2488
2610
  }
2489
- set error(e) {
2490
- e ? this.setAttribute("error", e) : this.removeAttribute("error");
2611
+ set error(t) {
2612
+ t ? this.setAttribute("error", t) : this.removeAttribute("error");
2491
2613
  }
2492
2614
  // =========================================================================
2493
2615
  // Lifecycle
2494
2616
  // =========================================================================
2495
2617
  setupAccessibility() {
2496
- var e;
2497
- typeof process < "u" && ((e = process.env) == null ? void 0 : e.NODE_ENV) !== "production" && (this.hasAttribute("label") || this.hasAttribute("aria-label") || this.hasAttribute("aria-labelledby") || console.warn(
2618
+ var t;
2619
+ typeof process < "u" && ((t = process.env) == null ? void 0 : t.NODE_ENV) !== "production" && (this.hasAttribute("label") || this.hasAttribute("aria-label") || this.hasAttribute("aria-labelledby") || console.warn(
2498
2620
  `[compa11y/Input] Input has no accessible label. Add label="...", aria-label="...", or aria-labelledby="..." attribute.
2499
2621
  💡 Suggestion: <a11y-input label="Full Name"></a11y-input>`
2500
2622
  ));
2501
2623
  }
2502
2624
  render() {
2503
- const e = this.attachShadow({ mode: "open" }), t = `${this._id}-field`, i = `${this._id}-label`, s = `${this._id}-hint`, a = `${this._id}-error`, r = this.getAttribute("label") || "", l = this.getAttribute("hint") || "", o = this.getAttribute("error") || "", d = this.getAttribute("type") || "text", h = this.getAttribute("placeholder") || "", g = this.getAttribute("name") || "", m = this.getAttribute("autocomplete") || "", f = this.getAttribute("maxlength"), _ = this.getAttribute("minlength"), k = this.getAttribute("pattern"), w = this.getAttribute("inputmode"), L = this.getAttribute("aria-label") || "", S = this.getAttribute("aria-labelledby") || "", I = this.disabled, x = this.readOnly, y = this.required, A = !!o, E = [];
2504
- l && E.push(s), A && E.push(a);
2505
- const C = E.length ? `aria-describedby="${E.join(" ")}"` : "", $ = !r && L ? `aria-label="${L}"` : "", ee = !r && S ? `aria-labelledby="${S}"` : r ? `aria-labelledby="${i}"` : "";
2506
- this.setAttribute("data-error", A ? "true" : "false"), e.innerHTML = `
2507
- <style>${Ee}</style>
2625
+ const t = this.attachShadow({ mode: "open" }), e = `${this._id}-field`, i = `${this._id}-label`, s = `${this._id}-hint`, a = `${this._id}-error`, r = this.getAttribute("label") || "", l = this.getAttribute("hint") || "", o = this.getAttribute("error") || "", b = this.getAttribute("type") || "text", h = this.getAttribute("placeholder") || "", m = this.getAttribute("name") || "", g = this.getAttribute("autocomplete") || "", f = this.getAttribute("maxlength"), _ = this.getAttribute("minlength"), k = this.getAttribute("pattern"), w = this.getAttribute("inputmode"), S = this.getAttribute("aria-label") || "", I = this.getAttribute("aria-labelledby") || "", C = this.disabled, x = this.readOnly, y = this.required, E = !!o, A = [];
2626
+ l && A.push(s), E && A.push(a);
2627
+ const z = A.length ? `aria-describedby="${A.join(" ")}"` : "", $ = !r && S ? `aria-label="${S}"` : "", st = !r && I ? `aria-labelledby="${I}"` : r ? `aria-labelledby="${i}"` : "";
2628
+ this.setAttribute("data-error", E ? "true" : "false"), t.innerHTML = `
2629
+ <style>${$t}</style>
2508
2630
  <div class="input-wrapper" part="wrapper">
2509
- ${r ? `<label id="${i}" for="${t}" class="input-label" part="label">
2631
+ ${r ? `<label id="${i}" for="${e}" class="input-label" part="label">
2510
2632
  ${r}${y ? '<span class="input-required" aria-hidden="true" part="required">*</span>' : ""}
2511
2633
  </label>` : ""}
2512
2634
  <input
2513
- id="${t}"
2514
- type="${d}"
2635
+ id="${e}"
2636
+ type="${b}"
2515
2637
  value="${this._value}"
2516
2638
  ${h ? `placeholder="${h}"` : ""}
2517
- ${g ? `name="${g}"` : ""}
2518
- ${m ? `autocomplete="${m}"` : ""}
2639
+ ${m ? `name="${m}"` : ""}
2640
+ ${g ? `autocomplete="${g}"` : ""}
2519
2641
  ${f ? `maxlength="${f}"` : ""}
2520
2642
  ${_ ? `minlength="${_}"` : ""}
2521
2643
  ${k ? `pattern="${k}"` : ""}
2522
2644
  ${w ? `inputmode="${w}"` : ""}
2523
2645
  ${$}
2524
- ${ee}
2525
- ${C}
2526
- ${A ? 'aria-invalid="true"' : ""}
2646
+ ${st}
2647
+ ${z}
2648
+ ${E ? 'aria-invalid="true"' : ""}
2527
2649
  ${y ? 'aria-required="true"' : ""}
2528
- ${I ? "disabled" : ""}
2650
+ ${C ? "disabled" : ""}
2529
2651
  ${x ? "readonly" : ""}
2530
2652
  part="field"
2531
2653
  />
2532
2654
  ${l ? `<div id="${s}" class="input-hint" part="hint">${l}</div>` : ""}
2533
- ${A ? `<div id="${a}" class="input-error" role="alert" part="error">${o}</div>` : ""}
2655
+ ${E ? `<div id="${a}" class="input-error" role="alert" part="error">${o}</div>` : ""}
2534
2656
  </div>
2535
- `, this._inputEl = e.querySelector("input"), this._labelEl = e.querySelector("label"), this._hintEl = e.querySelector(".input-hint"), this._errorEl = e.querySelector(".input-error");
2536
- const z = this.getAttribute("value");
2537
- z && this._inputEl && (this._value = z, this._inputEl.value = z);
2657
+ `, this._inputEl = t.querySelector("input"), this._labelEl = t.querySelector("label"), this._hintEl = t.querySelector(".input-hint"), this._errorEl = t.querySelector(".input-error");
2658
+ const D = this.getAttribute("value");
2659
+ D && this._inputEl && (this._value = D, this._inputEl.value = D);
2538
2660
  }
2539
2661
  setupEventListeners() {
2540
- var e, t, i, s;
2541
- (e = this._inputEl) == null || e.addEventListener("input", this.handleInput), (t = this._inputEl) == null || t.addEventListener("change", this.handleChange), (i = this._inputEl) == null || i.addEventListener("focus", this.handleFocus), (s = this._inputEl) == null || s.addEventListener("blur", this.handleBlur);
2662
+ var t, e, i, s;
2663
+ (t = this._inputEl) == null || t.addEventListener("input", this.handleInput), (e = this._inputEl) == null || e.addEventListener("change", this.handleChange), (i = this._inputEl) == null || i.addEventListener("focus", this.handleFocus), (s = this._inputEl) == null || s.addEventListener("blur", this.handleBlur);
2542
2664
  }
2543
2665
  cleanupEventListeners() {
2544
- var e, t, i, s;
2545
- (e = this._inputEl) == null || e.removeEventListener("input", this.handleInput), (t = this._inputEl) == null || t.removeEventListener("change", this.handleChange), (i = this._inputEl) == null || i.removeEventListener("focus", this.handleFocus), (s = this._inputEl) == null || s.removeEventListener("blur", this.handleBlur);
2666
+ var t, e, i, s;
2667
+ (t = this._inputEl) == null || t.removeEventListener("input", this.handleInput), (e = this._inputEl) == null || e.removeEventListener("change", this.handleChange), (i = this._inputEl) == null || i.removeEventListener("focus", this.handleFocus), (s = this._inputEl) == null || s.removeEventListener("blur", this.handleBlur);
2546
2668
  }
2547
- onAttributeChange(e, t, i) {
2548
- switch (e) {
2669
+ onAttributeChange(t, e, i) {
2670
+ switch (t) {
2549
2671
  case "value":
2550
2672
  this._value = i || "", this._inputEl && this._inputEl.value !== this._value && (this._inputEl.value = this._value);
2551
2673
  break;
@@ -2598,31 +2720,31 @@ class U extends c {
2598
2720
  // =========================================================================
2599
2721
  // DOM update helpers
2600
2722
  // =========================================================================
2601
- updateError(e) {
2723
+ updateError(t) {
2602
2724
  var i;
2603
- const t = !!e;
2604
- if (this.setAttribute("data-error", t ? "true" : "false"), this._inputEl && (t ? this._inputEl.setAttribute("aria-invalid", "true") : this._inputEl.removeAttribute("aria-invalid")), t) {
2725
+ const e = !!t;
2726
+ if (this.setAttribute("data-error", e ? "true" : "false"), this._inputEl && (e ? this._inputEl.setAttribute("aria-invalid", "true") : this._inputEl.removeAttribute("aria-invalid")), e) {
2605
2727
  if (this._errorEl)
2606
- this._errorEl.textContent = e;
2728
+ this._errorEl.textContent = t;
2607
2729
  else {
2608
2730
  const s = `${this._id}-error`, a = document.createElement("div");
2609
- a.id = s, a.className = "input-error", a.setAttribute("role", "alert"), a.setAttribute("part", "error"), a.textContent = e;
2731
+ a.id = s, a.className = "input-error", a.setAttribute("role", "alert"), a.setAttribute("part", "error"), a.textContent = t;
2610
2732
  const r = (i = this.shadowRoot) == null ? void 0 : i.querySelector(".input-wrapper");
2611
- r == null || r.appendChild(a), this._errorEl = a, D(e);
2733
+ r == null || r.appendChild(a), this._errorEl = a, O(t);
2612
2734
  }
2613
2735
  this.updateAriaDescribedBy();
2614
2736
  } else
2615
2737
  this._errorEl && (this._errorEl.remove(), this._errorEl = null), this.updateAriaDescribedBy();
2616
2738
  }
2617
- updateHint(e) {
2618
- var t;
2619
- if (e)
2739
+ updateHint(t) {
2740
+ var e;
2741
+ if (t)
2620
2742
  if (this._hintEl)
2621
- this._hintEl.textContent = e;
2743
+ this._hintEl.textContent = t;
2622
2744
  else {
2623
2745
  const i = `${this._id}-hint`, s = document.createElement("div");
2624
- s.id = i, s.className = "input-hint", s.setAttribute("part", "hint"), s.textContent = e;
2625
- const a = (t = this.shadowRoot) == null ? void 0 : t.querySelector(".input-wrapper");
2746
+ s.id = i, s.className = "input-hint", s.setAttribute("part", "hint"), s.textContent = t;
2747
+ const a = (e = this.shadowRoot) == null ? void 0 : e.querySelector(".input-wrapper");
2626
2748
  this._errorEl ? a == null || a.insertBefore(s, this._errorEl) : a == null || a.appendChild(s), this._hintEl = s;
2627
2749
  }
2628
2750
  else
@@ -2631,45 +2753,45 @@ class U extends c {
2631
2753
  }
2632
2754
  updateAriaDescribedBy() {
2633
2755
  if (!this._inputEl) return;
2634
- const e = [];
2635
- this._hintEl && e.push(this._hintEl.id), this._errorEl && e.push(this._errorEl.id), e.length > 0 ? this._inputEl.setAttribute("aria-describedby", e.join(" ")) : this._inputEl.removeAttribute("aria-describedby");
2756
+ const t = [];
2757
+ this._hintEl && t.push(this._hintEl.id), this._errorEl && t.push(this._errorEl.id), t.length > 0 ? this._inputEl.setAttribute("aria-describedby", t.join(" ")) : this._inputEl.removeAttribute("aria-describedby");
2636
2758
  }
2637
- updateRequiredIndicator(e) {
2759
+ updateRequiredIndicator(t) {
2638
2760
  if (!this._labelEl) return;
2639
- const t = this._labelEl.querySelector(".input-required");
2640
- if (e && !t) {
2761
+ const e = this._labelEl.querySelector(".input-required");
2762
+ if (t && !e) {
2641
2763
  const i = document.createElement("span");
2642
2764
  i.className = "input-required", i.setAttribute("aria-hidden", "true"), i.setAttribute("part", "required"), i.textContent = "*", this._labelEl.appendChild(i);
2643
- } else !e && t && t.remove();
2765
+ } else !t && e && e.remove();
2644
2766
  }
2645
2767
  // =========================================================================
2646
2768
  // Public methods
2647
2769
  // =========================================================================
2648
2770
  /** Focus the input element */
2649
2771
  focus() {
2650
- var e;
2651
- (e = this._inputEl) == null || e.focus();
2772
+ var t;
2773
+ (t = this._inputEl) == null || t.focus();
2652
2774
  }
2653
2775
  /** Blur the input element */
2654
2776
  blur() {
2655
- var e;
2656
- (e = this._inputEl) == null || e.blur();
2777
+ var t;
2778
+ (t = this._inputEl) == null || t.blur();
2657
2779
  }
2658
2780
  /** Select all text in the input */
2659
2781
  select() {
2660
- var e;
2661
- (e = this._inputEl) == null || e.select();
2782
+ var t;
2783
+ (t = this._inputEl) == null || t.select();
2662
2784
  }
2663
2785
  }
2664
- u("a11y-input", U);
2665
- class Y extends c {
2786
+ c("a11y-input", G);
2787
+ class V extends d {
2666
2788
  constructor() {
2667
- super(...arguments), this._value = "", this._textareaEl = null, this._labelEl = null, this._hintEl = null, this._errorEl = null, this.handleInput = (e) => {
2668
- const t = e.target;
2669
- this._value = t.value, this.emit("input", { value: this._value });
2670
- }, this.handleChange = (e) => {
2671
- const t = e.target;
2672
- this._value = t.value, this.emit("change", { value: this._value });
2789
+ super(...arguments), this._value = "", this._textareaEl = null, this._labelEl = null, this._hintEl = null, this._errorEl = null, this.handleInput = (t) => {
2790
+ const e = t.target;
2791
+ this._value = e.value, this.emit("input", { value: this._value });
2792
+ }, this.handleChange = (t) => {
2793
+ const e = t.target;
2794
+ this._value = e.value, this.emit("change", { value: this._value });
2673
2795
  }, this.handleFocus = () => {
2674
2796
  this.emit("a11y-textarea-focus");
2675
2797
  }, this.handleBlur = () => {
@@ -2702,88 +2824,88 @@ class Y extends c {
2702
2824
  get value() {
2703
2825
  return this._value;
2704
2826
  }
2705
- set value(e) {
2706
- const t = this._value;
2707
- this._value = e, this._textareaEl && this._textareaEl.value !== e && (this._textareaEl.value = e), e !== t && this.setAttribute("value", e);
2827
+ set value(t) {
2828
+ const e = this._value;
2829
+ this._value = t, this._textareaEl && this._textareaEl.value !== t && (this._textareaEl.value = t), t !== e && this.setAttribute("value", t);
2708
2830
  }
2709
2831
  get disabled() {
2710
2832
  return this.hasAttribute("disabled");
2711
2833
  }
2712
- set disabled(e) {
2713
- this.toggleAttribute("disabled", e);
2834
+ set disabled(t) {
2835
+ this.toggleAttribute("disabled", t);
2714
2836
  }
2715
2837
  get readOnly() {
2716
2838
  return this.hasAttribute("readonly");
2717
2839
  }
2718
- set readOnly(e) {
2719
- this.toggleAttribute("readonly", e);
2840
+ set readOnly(t) {
2841
+ this.toggleAttribute("readonly", t);
2720
2842
  }
2721
2843
  get required() {
2722
2844
  return this.hasAttribute("required");
2723
2845
  }
2724
- set required(e) {
2725
- this.toggleAttribute("required", e);
2846
+ set required(t) {
2847
+ this.toggleAttribute("required", t);
2726
2848
  }
2727
2849
  get error() {
2728
2850
  return this.getAttribute("error") || "";
2729
2851
  }
2730
- set error(e) {
2731
- e ? this.setAttribute("error", e) : this.removeAttribute("error");
2852
+ set error(t) {
2853
+ t ? this.setAttribute("error", t) : this.removeAttribute("error");
2732
2854
  }
2733
2855
  // =========================================================================
2734
2856
  // Lifecycle
2735
2857
  // =========================================================================
2736
2858
  setupAccessibility() {
2737
- var e;
2738
- typeof process < "u" && ((e = process.env) == null ? void 0 : e.NODE_ENV) !== "production" && (this.hasAttribute("label") || this.hasAttribute("aria-label") || this.hasAttribute("aria-labelledby") || console.warn(
2859
+ var t;
2860
+ typeof process < "u" && ((t = process.env) == null ? void 0 : t.NODE_ENV) !== "production" && (this.hasAttribute("label") || this.hasAttribute("aria-label") || this.hasAttribute("aria-labelledby") || console.warn(
2739
2861
  `[compa11y/Textarea] Textarea has no accessible label. Add label="...", aria-label="...", or aria-labelledby="..." attribute.
2740
2862
  💡 Suggestion: <a11y-textarea label="Description"></a11y-textarea>`
2741
2863
  ));
2742
2864
  }
2743
2865
  render() {
2744
- const e = this.attachShadow({ mode: "open" }), t = `${this._id}-field`, i = `${this._id}-label`, s = `${this._id}-hint`, a = `${this._id}-error`, r = this.getAttribute("label") || "", l = this.getAttribute("hint") || "", o = this.getAttribute("error") || "", d = this.getAttribute("rows") || "3", h = this.getAttribute("placeholder") || "", g = this.getAttribute("name") || "", m = this.getAttribute("autocomplete") || "", f = this.getAttribute("maxlength"), _ = this.getAttribute("minlength"), k = this.getAttribute("aria-label") || "", w = this.getAttribute("aria-labelledby") || "", L = this.disabled, S = this.readOnly, I = this.required, x = !!o, y = [];
2866
+ const t = this.attachShadow({ mode: "open" }), e = `${this._id}-field`, i = `${this._id}-label`, s = `${this._id}-hint`, a = `${this._id}-error`, r = this.getAttribute("label") || "", l = this.getAttribute("hint") || "", o = this.getAttribute("error") || "", b = this.getAttribute("rows") || "3", h = this.getAttribute("placeholder") || "", m = this.getAttribute("name") || "", g = this.getAttribute("autocomplete") || "", f = this.getAttribute("maxlength"), _ = this.getAttribute("minlength"), k = this.getAttribute("aria-label") || "", w = this.getAttribute("aria-labelledby") || "", S = this.disabled, I = this.readOnly, C = this.required, x = !!o, y = [];
2745
2867
  l && y.push(s), x && y.push(a);
2746
- const A = y.length ? `aria-describedby="${y.join(" ")}"` : "", E = !r && k ? `aria-label="${k}"` : "", C = !r && w ? `aria-labelledby="${w}"` : r ? `aria-labelledby="${i}"` : "";
2747
- this.setAttribute("data-error", x ? "true" : "false"), e.innerHTML = `
2748
- <style>${ke}</style>
2868
+ const E = y.length ? `aria-describedby="${y.join(" ")}"` : "", A = !r && k ? `aria-label="${k}"` : "", z = !r && w ? `aria-labelledby="${w}"` : r ? `aria-labelledby="${i}"` : "";
2869
+ this.setAttribute("data-error", x ? "true" : "false"), t.innerHTML = `
2870
+ <style>${Lt}</style>
2749
2871
  <div class="textarea-wrapper" part="wrapper">
2750
- ${r ? `<label id="${i}" for="${t}" class="textarea-label" part="label">
2751
- ${r}${I ? '<span class="textarea-required" aria-hidden="true" part="required">*</span>' : ""}
2872
+ ${r ? `<label id="${i}" for="${e}" class="textarea-label" part="label">
2873
+ ${r}${C ? '<span class="textarea-required" aria-hidden="true" part="required">*</span>' : ""}
2752
2874
  </label>` : ""}
2753
2875
  <textarea
2754
- id="${t}"
2755
- rows="${d}"
2876
+ id="${e}"
2877
+ rows="${b}"
2756
2878
  ${h ? `placeholder="${h}"` : ""}
2757
- ${g ? `name="${g}"` : ""}
2758
- ${m ? `autocomplete="${m}"` : ""}
2879
+ ${m ? `name="${m}"` : ""}
2880
+ ${g ? `autocomplete="${g}"` : ""}
2759
2881
  ${f ? `maxlength="${f}"` : ""}
2760
2882
  ${_ ? `minlength="${_}"` : ""}
2761
- ${E}
2762
- ${C}
2763
2883
  ${A}
2884
+ ${z}
2885
+ ${E}
2764
2886
  ${x ? 'aria-invalid="true"' : ""}
2765
- ${I ? 'aria-required="true"' : ""}
2766
- ${L ? "disabled" : ""}
2767
- ${S ? "readonly" : ""}
2887
+ ${C ? 'aria-required="true"' : ""}
2888
+ ${S ? "disabled" : ""}
2889
+ ${I ? "readonly" : ""}
2768
2890
  part="field"
2769
2891
  >${this._value}</textarea>
2770
2892
  ${l ? `<div id="${s}" class="textarea-hint" part="hint">${l}</div>` : ""}
2771
2893
  ${x ? `<div id="${a}" class="textarea-error" role="alert" part="error">${o}</div>` : ""}
2772
2894
  </div>
2773
- `, this._textareaEl = e.querySelector("textarea"), this._labelEl = e.querySelector("label"), this._hintEl = e.querySelector(".textarea-hint"), this._errorEl = e.querySelector(".textarea-error");
2895
+ `, this._textareaEl = t.querySelector("textarea"), this._labelEl = t.querySelector("label"), this._hintEl = t.querySelector(".textarea-hint"), this._errorEl = t.querySelector(".textarea-error");
2774
2896
  const $ = this.getAttribute("value");
2775
2897
  $ && this._textareaEl && (this._value = $, this._textareaEl.value = $);
2776
2898
  }
2777
2899
  setupEventListeners() {
2778
- var e, t, i, s;
2779
- (e = this._textareaEl) == null || e.addEventListener("input", this.handleInput), (t = this._textareaEl) == null || t.addEventListener("change", this.handleChange), (i = this._textareaEl) == null || i.addEventListener("focus", this.handleFocus), (s = this._textareaEl) == null || s.addEventListener("blur", this.handleBlur);
2900
+ var t, e, i, s;
2901
+ (t = this._textareaEl) == null || t.addEventListener("input", this.handleInput), (e = this._textareaEl) == null || e.addEventListener("change", this.handleChange), (i = this._textareaEl) == null || i.addEventListener("focus", this.handleFocus), (s = this._textareaEl) == null || s.addEventListener("blur", this.handleBlur);
2780
2902
  }
2781
2903
  cleanupEventListeners() {
2782
- var e, t, i, s;
2783
- (e = this._textareaEl) == null || e.removeEventListener("input", this.handleInput), (t = this._textareaEl) == null || t.removeEventListener("change", this.handleChange), (i = this._textareaEl) == null || i.removeEventListener("focus", this.handleFocus), (s = this._textareaEl) == null || s.removeEventListener("blur", this.handleBlur);
2904
+ var t, e, i, s;
2905
+ (t = this._textareaEl) == null || t.removeEventListener("input", this.handleInput), (e = this._textareaEl) == null || e.removeEventListener("change", this.handleChange), (i = this._textareaEl) == null || i.removeEventListener("focus", this.handleFocus), (s = this._textareaEl) == null || s.removeEventListener("blur", this.handleBlur);
2784
2906
  }
2785
- onAttributeChange(e, t, i) {
2786
- switch (e) {
2907
+ onAttributeChange(t, e, i) {
2908
+ switch (t) {
2787
2909
  case "value":
2788
2910
  this._value = i || "", this._textareaEl && this._textareaEl.value !== this._value && (this._textareaEl.value = this._value);
2789
2911
  break;
@@ -2833,31 +2955,31 @@ class Y extends c {
2833
2955
  // =========================================================================
2834
2956
  // DOM update helpers
2835
2957
  // =========================================================================
2836
- updateError(e) {
2958
+ updateError(t) {
2837
2959
  var i;
2838
- const t = !!e;
2839
- if (this.setAttribute("data-error", t ? "true" : "false"), this._textareaEl && (t ? this._textareaEl.setAttribute("aria-invalid", "true") : this._textareaEl.removeAttribute("aria-invalid")), t) {
2960
+ const e = !!t;
2961
+ if (this.setAttribute("data-error", e ? "true" : "false"), this._textareaEl && (e ? this._textareaEl.setAttribute("aria-invalid", "true") : this._textareaEl.removeAttribute("aria-invalid")), e) {
2840
2962
  if (this._errorEl)
2841
- this._errorEl.textContent = e;
2963
+ this._errorEl.textContent = t;
2842
2964
  else {
2843
2965
  const s = `${this._id}-error`, a = document.createElement("div");
2844
- a.id = s, a.className = "textarea-error", a.setAttribute("role", "alert"), a.setAttribute("part", "error"), a.textContent = e;
2966
+ a.id = s, a.className = "textarea-error", a.setAttribute("role", "alert"), a.setAttribute("part", "error"), a.textContent = t;
2845
2967
  const r = (i = this.shadowRoot) == null ? void 0 : i.querySelector(".textarea-wrapper");
2846
- r == null || r.appendChild(a), this._errorEl = a, D(e);
2968
+ r == null || r.appendChild(a), this._errorEl = a, O(t);
2847
2969
  }
2848
2970
  this.updateAriaDescribedBy();
2849
2971
  } else
2850
2972
  this._errorEl && (this._errorEl.remove(), this._errorEl = null), this.updateAriaDescribedBy();
2851
2973
  }
2852
- updateHint(e) {
2853
- var t;
2854
- if (e)
2974
+ updateHint(t) {
2975
+ var e;
2976
+ if (t)
2855
2977
  if (this._hintEl)
2856
- this._hintEl.textContent = e;
2978
+ this._hintEl.textContent = t;
2857
2979
  else {
2858
2980
  const i = `${this._id}-hint`, s = document.createElement("div");
2859
- s.id = i, s.className = "textarea-hint", s.setAttribute("part", "hint"), s.textContent = e;
2860
- const a = (t = this.shadowRoot) == null ? void 0 : t.querySelector(".textarea-wrapper");
2981
+ s.id = i, s.className = "textarea-hint", s.setAttribute("part", "hint"), s.textContent = t;
2982
+ const a = (e = this.shadowRoot) == null ? void 0 : e.querySelector(".textarea-wrapper");
2861
2983
  this._errorEl ? a == null || a.insertBefore(s, this._errorEl) : a == null || a.appendChild(s), this._hintEl = s;
2862
2984
  }
2863
2985
  else
@@ -2866,42 +2988,42 @@ class Y extends c {
2866
2988
  }
2867
2989
  updateAriaDescribedBy() {
2868
2990
  if (!this._textareaEl) return;
2869
- const e = [];
2870
- this._hintEl && e.push(this._hintEl.id), this._errorEl && e.push(this._errorEl.id), e.length > 0 ? this._textareaEl.setAttribute("aria-describedby", e.join(" ")) : this._textareaEl.removeAttribute("aria-describedby");
2991
+ const t = [];
2992
+ this._hintEl && t.push(this._hintEl.id), this._errorEl && t.push(this._errorEl.id), t.length > 0 ? this._textareaEl.setAttribute("aria-describedby", t.join(" ")) : this._textareaEl.removeAttribute("aria-describedby");
2871
2993
  }
2872
- updateRequiredIndicator(e) {
2994
+ updateRequiredIndicator(t) {
2873
2995
  if (!this._labelEl) return;
2874
- const t = this._labelEl.querySelector(".textarea-required");
2875
- if (e && !t) {
2996
+ const e = this._labelEl.querySelector(".textarea-required");
2997
+ if (t && !e) {
2876
2998
  const i = document.createElement("span");
2877
2999
  i.className = "textarea-required", i.setAttribute("aria-hidden", "true"), i.setAttribute("part", "required"), i.textContent = "*", this._labelEl.appendChild(i);
2878
- } else !e && t && t.remove();
3000
+ } else !t && e && e.remove();
2879
3001
  }
2880
3002
  // =========================================================================
2881
3003
  // Public methods
2882
3004
  // =========================================================================
2883
3005
  /** Focus the textarea element */
2884
3006
  focus() {
2885
- var e;
2886
- (e = this._textareaEl) == null || e.focus();
3007
+ var t;
3008
+ (t = this._textareaEl) == null || t.focus();
2887
3009
  }
2888
3010
  /** Blur the textarea element */
2889
3011
  blur() {
2890
- var e;
2891
- (e = this._textareaEl) == null || e.blur();
3012
+ var t;
3013
+ (t = this._textareaEl) == null || t.blur();
2892
3014
  }
2893
3015
  /** Select all text in the textarea */
2894
3016
  select() {
2895
- var e;
2896
- (e = this._textareaEl) == null || e.select();
3017
+ var t;
3018
+ (t = this._textareaEl) == null || t.select();
2897
3019
  }
2898
3020
  }
2899
- u("a11y-textarea", Y);
2900
- class G extends c {
3021
+ c("a11y-textarea", V);
3022
+ class X extends d {
2901
3023
  constructor() {
2902
- super(...arguments), this._buttonEl = null, this.handleClick = (e) => {
3024
+ super(...arguments), this._buttonEl = null, this.handleClick = (t) => {
2903
3025
  if (this.disabled || this.loading) {
2904
- e.preventDefault(), e.stopPropagation();
3026
+ t.preventDefault(), t.stopPropagation();
2905
3027
  return;
2906
3028
  }
2907
3029
  this.emit("a11y-button-click");
@@ -2924,68 +3046,68 @@ class G extends c {
2924
3046
  get disabled() {
2925
3047
  return this.hasAttribute("disabled");
2926
3048
  }
2927
- set disabled(e) {
2928
- this.toggleAttribute("disabled", e);
3049
+ set disabled(t) {
3050
+ this.toggleAttribute("disabled", t);
2929
3051
  }
2930
3052
  get discoverable() {
2931
3053
  return this.hasAttribute("discoverable");
2932
3054
  }
2933
- set discoverable(e) {
2934
- this.toggleAttribute("discoverable", e);
3055
+ set discoverable(t) {
3056
+ this.toggleAttribute("discoverable", t);
2935
3057
  }
2936
3058
  get loading() {
2937
3059
  return this.hasAttribute("loading");
2938
3060
  }
2939
- set loading(e) {
2940
- this.toggleAttribute("loading", e);
3061
+ set loading(t) {
3062
+ this.toggleAttribute("loading", t);
2941
3063
  }
2942
3064
  get variant() {
2943
3065
  return this.getAttribute("variant") || "secondary";
2944
3066
  }
2945
- set variant(e) {
2946
- this.setAttribute("variant", e);
3067
+ set variant(t) {
3068
+ this.setAttribute("variant", t);
2947
3069
  }
2948
3070
  get size() {
2949
3071
  return this.getAttribute("size") || "md";
2950
3072
  }
2951
- set size(e) {
2952
- this.setAttribute("size", e);
3073
+ set size(t) {
3074
+ this.setAttribute("size", t);
2953
3075
  }
2954
3076
  // =========================================================================
2955
3077
  // Lifecycle
2956
3078
  // =========================================================================
2957
3079
  setupAccessibility() {
2958
- var e, t;
2959
- typeof process < "u" && ((e = process.env) == null ? void 0 : e.NODE_ENV) !== "production" && ((t = this.textContent) != null && t.trim() || this.hasAttribute("aria-label") || this.hasAttribute("aria-labelledby") || console.warn(
3080
+ var t, e;
3081
+ typeof process < "u" && ((t = process.env) == null ? void 0 : t.NODE_ENV) !== "production" && ((e = this.textContent) != null && e.trim() || this.hasAttribute("aria-label") || this.hasAttribute("aria-labelledby") || console.warn(
2960
3082
  `[compa11y/Button] Button has no accessible label. Add text content, aria-label="...", or aria-labelledby="..." attribute.
2961
3083
  💡 Suggestion: <a11y-button>Click me</a11y-button>`
2962
3084
  ));
2963
3085
  }
2964
3086
  render() {
2965
- const e = this.attachShadow({ mode: "open" }), t = this.variant, i = this.size, s = this.getAttribute("type") || "button", a = this.getAttribute("aria-label") || "", r = this.disabled, l = this.discoverable, o = this.loading, d = r || o, h = r && !l;
2966
- e.innerHTML = `
2967
- <style>${we}</style>
3087
+ const t = this.attachShadow({ mode: "open" }), e = this.variant, i = this.size, s = this.getAttribute("type") || "button", a = this.getAttribute("aria-label") || "", r = this.disabled, l = this.discoverable, o = this.loading, b = r || o, h = r && !l;
3088
+ t.innerHTML = `
3089
+ <style>${St}</style>
2968
3090
  <button
2969
- class="variant-${t} size-${i}"
3091
+ class="variant-${e} size-${i}"
2970
3092
  type="${s}"
2971
3093
  ${h ? "disabled" : ""}
2972
- ${d ? 'aria-disabled="true"' : ""}
3094
+ ${b ? 'aria-disabled="true"' : ""}
2973
3095
  ${o ? 'aria-busy="true"' : ""}
2974
3096
  ${a ? `aria-label="${a}"` : ""}
2975
3097
  part="button"
2976
3098
  >${o ? '<span class="button-spinner" aria-hidden="true" part="spinner"></span>' : ""}<slot></slot></button>
2977
- `, this._buttonEl = e.querySelector("button");
3099
+ `, this._buttonEl = t.querySelector("button");
2978
3100
  }
2979
3101
  setupEventListeners() {
2980
- var e;
2981
- (e = this._buttonEl) == null || e.addEventListener("click", this.handleClick);
3102
+ var t;
3103
+ (t = this._buttonEl) == null || t.addEventListener("click", this.handleClick);
2982
3104
  }
2983
3105
  cleanupEventListeners() {
2984
- var e;
2985
- (e = this._buttonEl) == null || e.removeEventListener("click", this.handleClick);
3106
+ var t;
3107
+ (t = this._buttonEl) == null || t.removeEventListener("click", this.handleClick);
2986
3108
  }
2987
- onAttributeChange(e, t, i) {
2988
- switch (e) {
3109
+ onAttributeChange(t, e, i) {
3110
+ switch (t) {
2989
3111
  case "variant": {
2990
3112
  if (!this._buttonEl) break;
2991
3113
  const a = this._buttonEl.className.split(" ").filter((r) => !r.startsWith("variant-"));
@@ -3018,20 +3140,20 @@ class G extends c {
3018
3140
  // =========================================================================
3019
3141
  updateDisabledState() {
3020
3142
  if (!this._buttonEl) return;
3021
- const e = this.disabled, t = this.discoverable, i = this.loading, s = e && !t, a = e || i;
3143
+ const t = this.disabled, e = this.discoverable, i = this.loading, s = t && !e, a = t || i;
3022
3144
  s ? this._buttonEl.setAttribute("disabled", "") : this._buttonEl.removeAttribute("disabled"), a ? this._buttonEl.setAttribute("aria-disabled", "true") : this._buttonEl.removeAttribute("aria-disabled");
3023
3145
  }
3024
3146
  updateLoadingState() {
3025
3147
  if (!this._buttonEl) return;
3026
3148
  if (this.loading) {
3027
3149
  if (this._buttonEl.setAttribute("aria-busy", "true"), this._buttonEl.setAttribute("aria-disabled", "true"), !this._buttonEl.querySelector(".button-spinner")) {
3028
- const t = document.createElement("span");
3029
- t.className = "button-spinner", t.setAttribute("aria-hidden", "true"), t.setAttribute("part", "spinner"), this._buttonEl.insertBefore(t, this._buttonEl.firstChild);
3150
+ const e = document.createElement("span");
3151
+ e.className = "button-spinner", e.setAttribute("aria-hidden", "true"), e.setAttribute("part", "spinner"), this._buttonEl.insertBefore(e, this._buttonEl.firstChild);
3030
3152
  }
3031
3153
  } else {
3032
3154
  this._buttonEl.removeAttribute("aria-busy");
3033
- const t = this._buttonEl.querySelector(".button-spinner");
3034
- t == null || t.remove(), this.updateDisabledState();
3155
+ const e = this._buttonEl.querySelector(".button-spinner");
3156
+ e == null || e.remove(), this.updateDisabledState();
3035
3157
  }
3036
3158
  }
3037
3159
  // =========================================================================
@@ -3039,22 +3161,22 @@ class G extends c {
3039
3161
  // =========================================================================
3040
3162
  /** Focus the button element */
3041
3163
  focus() {
3042
- var e;
3043
- (e = this._buttonEl) == null || e.focus();
3164
+ var t;
3165
+ (t = this._buttonEl) == null || t.focus();
3044
3166
  }
3045
3167
  /** Blur the button element */
3046
3168
  blur() {
3047
- var e;
3048
- (e = this._buttonEl) == null || e.blur();
3169
+ var t;
3170
+ (t = this._buttonEl) == null || t.blur();
3049
3171
  }
3050
3172
  /** Programmatically click the button */
3051
3173
  click() {
3052
- var e;
3053
- (e = this._buttonEl) == null || e.click();
3174
+ var t;
3175
+ (t = this._buttonEl) == null || t.click();
3054
3176
  }
3055
3177
  }
3056
- u("a11y-button", G);
3057
- class X extends c {
3178
+ c("a11y-button", X);
3179
+ class W extends d {
3058
3180
  constructor() {
3059
3181
  super(...arguments), this._label = "", this._disabled = !1;
3060
3182
  }
@@ -3064,60 +3186,59 @@ class X extends c {
3064
3186
  get label() {
3065
3187
  return this._label;
3066
3188
  }
3067
- set label(e) {
3068
- this._label = e, this.setAttribute("label", e), this.updateLabel();
3189
+ set label(t) {
3190
+ this._label = t, this.setAttribute("label", t), this.updateLabel();
3069
3191
  }
3070
3192
  get disabled() {
3071
3193
  return this._disabled;
3072
3194
  }
3073
- set disabled(e) {
3074
- const t = !!e;
3075
- this._disabled !== t && (this._disabled = t, t ? (this.setAttribute("disabled", ""), this.setAttribute("aria-disabled", "true")) : (this.removeAttribute("disabled"), this.removeAttribute("aria-disabled")));
3195
+ set disabled(t) {
3196
+ const e = !!t;
3197
+ this._disabled !== e && (this._disabled = e, e ? (this.setAttribute("disabled", ""), this.setAttribute("aria-disabled", "true")) : (this.removeAttribute("disabled"), this.removeAttribute("aria-disabled")));
3076
3198
  }
3077
3199
  setupAccessibility() {
3078
3200
  this.setAttribute("role", "group"), this._label = this.getAttribute("label") || "", this._disabled = this.hasAttribute("disabled"), this._disabled && this.setAttribute("aria-disabled", "true");
3079
3201
  }
3080
3202
  render() {
3081
3203
  this.shadowRoot || this.attachShadow({ mode: "open" });
3082
- const e = `${this._id}-label`;
3204
+ const t = `${this._id}-label`;
3083
3205
  this.shadowRoot.innerHTML = `
3084
- <style>${Se}</style>
3206
+ <style>${Tt}</style>
3085
3207
  <div class="optgroup-wrapper" part="group">
3086
- <div class="optgroup-label" part="label" id="${e}" role="presentation">
3208
+ <div class="optgroup-label" part="label" id="${t}" role="presentation">
3087
3209
  ${this._label}
3088
3210
  </div>
3089
3211
  <div class="optgroup-options" part="options" role="none">
3090
3212
  <slot></slot>
3091
3213
  </div>
3092
3214
  </div>
3093
- `, this.setAttribute("aria-labelledby", e);
3215
+ `, this.setAttribute("aria-labelledby", t);
3094
3216
  }
3095
3217
  setupEventListeners() {
3096
3218
  }
3097
3219
  cleanupEventListeners() {
3098
3220
  }
3099
3221
  updateLabel() {
3100
- var t;
3101
- const e = (t = this.shadowRoot) == null ? void 0 : t.querySelector(".optgroup-label");
3102
- e && (e.textContent = this._label);
3222
+ var e;
3223
+ const t = (e = this.shadowRoot) == null ? void 0 : e.querySelector(".optgroup-label");
3224
+ t && (t.textContent = this._label);
3103
3225
  }
3104
- attributeChangedCallback(e, t, i) {
3105
- if (t !== i)
3106
- switch (e) {
3107
- case "label":
3108
- this._label = i || "", this.updateLabel();
3109
- break;
3110
- case "disabled":
3111
- this._disabled = i !== null, this._disabled ? this.setAttribute("aria-disabled", "true") : this.removeAttribute("aria-disabled");
3112
- break;
3113
- }
3226
+ onAttributeChange(t, e, i) {
3227
+ switch (t) {
3228
+ case "label":
3229
+ this._label = i || "", this.updateLabel();
3230
+ break;
3231
+ case "disabled":
3232
+ this._disabled = i !== null, this._disabled ? this.setAttribute("aria-disabled", "true") : this.removeAttribute("aria-disabled");
3233
+ break;
3234
+ }
3114
3235
  }
3115
3236
  }
3116
- class V extends c {
3237
+ class J extends d {
3117
3238
  constructor() {
3118
- super(...arguments), this._value = "", this._disabled = !1, this._selected = !1, this._discoverable = !0, this.handleClick = (e) => {
3239
+ super(...arguments), this._value = "", this._disabled = !1, this._selected = !1, this._discoverable = !0, this.handleClick = (t) => {
3119
3240
  if (this.effectivelyDisabled) {
3120
- e.preventDefault();
3241
+ t.preventDefault();
3121
3242
  return;
3122
3243
  }
3123
3244
  this.dispatchEvent(
@@ -3135,45 +3256,45 @@ class V extends c {
3135
3256
  get value() {
3136
3257
  return this._value;
3137
3258
  }
3138
- set value(e) {
3139
- this._value = e, this.setAttribute("value", e);
3259
+ set value(t) {
3260
+ this._value = t, this.setAttribute("value", t);
3140
3261
  }
3141
3262
  get disabled() {
3142
3263
  return this._disabled;
3143
3264
  }
3144
- set disabled(e) {
3145
- const t = !!e;
3146
- this._disabled !== t && (this._disabled = t, t ? (this.setAttribute("disabled", ""), this.setAttribute("aria-disabled", "true")) : (this.removeAttribute("disabled"), this.removeAttribute("aria-disabled")));
3265
+ set disabled(t) {
3266
+ const e = !!t;
3267
+ this._disabled !== e && (this._disabled = e, e ? (this.setAttribute("disabled", ""), this.setAttribute("aria-disabled", "true")) : (this.removeAttribute("disabled"), this.removeAttribute("aria-disabled")));
3147
3268
  }
3148
3269
  get selected() {
3149
3270
  return this._selected;
3150
3271
  }
3151
- set selected(e) {
3152
- const t = !!e;
3153
- this._selected !== t && (this._selected = t, this.setAttribute("aria-selected", String(t)));
3272
+ set selected(t) {
3273
+ const e = !!t;
3274
+ this._selected !== e && (this._selected = e, this.setAttribute("aria-selected", String(e)));
3154
3275
  }
3155
3276
  get discoverable() {
3156
3277
  return this._discoverable;
3157
3278
  }
3158
- set discoverable(e) {
3159
- this._discoverable = !!e;
3279
+ set discoverable(t) {
3280
+ this._discoverable = !!t;
3160
3281
  }
3161
3282
  /**
3162
3283
  * Whether this option is effectively disabled (own disabled or group disabled)
3163
3284
  */
3164
3285
  get effectivelyDisabled() {
3165
3286
  if (this._disabled) return !0;
3166
- const e = this.closest("a11y-optgroup");
3167
- return (e == null ? void 0 : e.disabled) ?? !1;
3287
+ const t = this.closest("a11y-optgroup");
3288
+ return (t == null ? void 0 : t.disabled) ?? !1;
3168
3289
  }
3169
3290
  setupAccessibility() {
3170
3291
  this.setAttribute("role", "option"), this.setAttribute("aria-selected", "false"), this._value = this.getAttribute("value") || "", this._disabled = this.hasAttribute("disabled"), this._disabled && this.setAttribute("aria-disabled", "true");
3171
- const e = this.getAttribute("discoverable");
3172
- (e === "false" || e === "0") && (this._discoverable = !1);
3292
+ const t = this.getAttribute("discoverable");
3293
+ (t === "false" || t === "0") && (this._discoverable = !1);
3173
3294
  }
3174
3295
  render() {
3175
3296
  this.shadowRoot || this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = `
3176
- <style>${Le}</style>
3297
+ <style>${Ct}</style>
3177
3298
  <div class="option-wrapper" part="option">
3178
3299
  <span class="option-content" part="content"><slot></slot></span>
3179
3300
  <span class="check-mark" part="check" aria-hidden="true">&#10003;</span>
@@ -3186,92 +3307,91 @@ class V extends c {
3186
3307
  cleanupEventListeners() {
3187
3308
  this.removeEventListener("click", this.handleClick);
3188
3309
  }
3189
- attributeChangedCallback(e, t, i) {
3190
- if (t !== i)
3191
- switch (e) {
3192
- case "value":
3193
- this._value = i || "";
3194
- break;
3195
- case "disabled":
3196
- this._disabled = i !== null, this._disabled ? this.setAttribute("aria-disabled", "true") : this.removeAttribute("aria-disabled");
3197
- break;
3198
- case "discoverable":
3199
- i === null ? this._discoverable = !0 : i === "false" || i === "0" ? this._discoverable = !1 : this._discoverable = !0;
3200
- break;
3201
- }
3310
+ onAttributeChange(t, e, i) {
3311
+ switch (t) {
3312
+ case "value":
3313
+ this._value = i || "";
3314
+ break;
3315
+ case "disabled":
3316
+ this._disabled = i !== null, this._disabled ? this.setAttribute("aria-disabled", "true") : this.removeAttribute("aria-disabled");
3317
+ break;
3318
+ case "discoverable":
3319
+ i === null ? this._discoverable = !0 : i === "false" || i === "0" ? this._discoverable = !1 : this._discoverable = !0;
3320
+ break;
3321
+ }
3202
3322
  }
3203
3323
  }
3204
- class W extends c {
3324
+ class Q extends d {
3205
3325
  constructor() {
3206
3326
  super(...arguments), this._value = null, this._values = /* @__PURE__ */ new Set(), this._multiple = !1, this._disabled = !1, this._discoverable = !0, this._orientation = "vertical", this._focusedIndex = -1, this._typeAhead = null, this.handleFocus = () => {
3207
3327
  if (this._focusedIndex >= 0) return;
3208
- const e = this.getAllOptions();
3328
+ const t = this.getAllOptions();
3209
3329
  if (!this._multiple && this._value) {
3210
- const t = e.findIndex((i) => i.value === this._value);
3211
- if (t >= 0) {
3212
- this._focusedIndex = t, this.updateFocusHighlight();
3330
+ const e = t.findIndex((i) => i.value === this._value);
3331
+ if (e >= 0) {
3332
+ this._focusedIndex = e, this.updateFocusHighlight();
3213
3333
  return;
3214
3334
  }
3215
3335
  } else if (this._multiple && this._values.size > 0) {
3216
- const t = e.findIndex((i) => this._values.has(i.value));
3217
- if (t >= 0) {
3218
- this._focusedIndex = t, this.updateFocusHighlight();
3336
+ const e = t.findIndex((i) => this._values.has(i.value));
3337
+ if (e >= 0) {
3338
+ this._focusedIndex = e, this.updateFocusHighlight();
3219
3339
  return;
3220
3340
  }
3221
3341
  }
3222
3342
  this._focusedIndex = this.findFirstEnabled(), this.updateFocusHighlight();
3223
- }, this.handleOptionSelect = (e) => {
3343
+ }, this.handleOptionSelect = (t) => {
3224
3344
  var r;
3225
3345
  if (this._disabled) return;
3226
- const t = (r = e.detail) == null ? void 0 : r.value;
3227
- if (t === void 0) return;
3228
- const i = this.getAllOptions(), s = i.find((l) => l.value === t);
3346
+ const e = (r = t.detail) == null ? void 0 : r.value;
3347
+ if (e === void 0) return;
3348
+ const i = this.getAllOptions(), s = i.find((l) => l.value === e);
3229
3349
  if (!s) return;
3230
3350
  const a = i.indexOf(s);
3231
3351
  this._focusedIndex = a, this.updateFocusHighlight(), this.selectOption(s), this.focus();
3232
- }, this.handleKeyDown = (e) => {
3352
+ }, this.handleKeyDown = (t) => {
3233
3353
  var a, r, l;
3234
3354
  if (this._disabled && !this._discoverable) return;
3235
- const t = this.getAllOptions();
3236
- if (t.length === 0) return;
3355
+ const e = this.getAllOptions();
3356
+ if (e.length === 0) return;
3237
3357
  let i = null, s = !1;
3238
3358
  if (this._multiple)
3239
- switch (e.key) {
3359
+ switch (t.key) {
3240
3360
  case "ArrowDown":
3241
- e.shiftKey ? (i = this.findNextEnabled(this._focusedIndex, 1), i >= 0 && this.toggleOptionSelection(t[i])) : i = this.findNextEnabled(this._focusedIndex, 1), s = !0;
3361
+ t.shiftKey ? (i = this.findNextEnabled(this._focusedIndex, 1), i >= 0 && this.toggleOptionSelection(e[i])) : i = this.findNextEnabled(this._focusedIndex, 1), s = !0;
3242
3362
  break;
3243
3363
  case "ArrowUp":
3244
- e.shiftKey ? (i = this.findNextEnabled(this._focusedIndex, -1), i >= 0 && this.toggleOptionSelection(t[i])) : i = this.findNextEnabled(this._focusedIndex, -1), s = !0;
3364
+ t.shiftKey ? (i = this.findNextEnabled(this._focusedIndex, -1), i >= 0 && this.toggleOptionSelection(e[i])) : i = this.findNextEnabled(this._focusedIndex, -1), s = !0;
3245
3365
  break;
3246
3366
  case " ":
3247
- this._focusedIndex >= 0 && t[this._focusedIndex] != null && this.toggleOptionSelection(t[this._focusedIndex]), s = !0;
3367
+ this._focusedIndex >= 0 && e[this._focusedIndex] != null && this.toggleOptionSelection(e[this._focusedIndex]), s = !0;
3248
3368
  break;
3249
3369
  case "Home":
3250
- e.ctrlKey && e.shiftKey ? (this.selectRange(this.findFirstEnabled(), this._focusedIndex), i = this.findFirstEnabled()) : i = this.findFirstEnabled(), s = !0;
3370
+ t.ctrlKey && t.shiftKey ? (this.selectRange(this.findFirstEnabled(), this._focusedIndex), i = this.findFirstEnabled()) : i = this.findFirstEnabled(), s = !0;
3251
3371
  break;
3252
3372
  case "End":
3253
- e.ctrlKey && e.shiftKey ? (this.selectRange(this._focusedIndex, this.findLastEnabled()), i = this.findLastEnabled()) : i = this.findLastEnabled(), s = !0;
3373
+ t.ctrlKey && t.shiftKey ? (this.selectRange(this._focusedIndex, this.findLastEnabled()), i = this.findLastEnabled()) : i = this.findLastEnabled(), s = !0;
3254
3374
  break;
3255
3375
  case "a":
3256
- (e.ctrlKey || e.metaKey) && (this.toggleSelectAll(), s = !0);
3376
+ (t.ctrlKey || t.metaKey) && (this.toggleSelectAll(), s = !0);
3257
3377
  break;
3258
3378
  default:
3259
- if (e.key.length === 1 && !e.ctrlKey && !e.altKey && !e.metaKey) {
3260
- const o = (a = this._typeAhead) == null ? void 0 : a.type(e.key);
3379
+ if (t.key.length === 1 && !t.ctrlKey && !t.altKey && !t.metaKey) {
3380
+ const o = (a = this._typeAhead) == null ? void 0 : a.type(t.key);
3261
3381
  if (o) {
3262
- const d = t.findIndex(
3382
+ const b = e.findIndex(
3263
3383
  (h) => {
3264
- var g;
3265
- return (((g = h.textContent) == null ? void 0 : g.trim()) || "") === o && !h.effectivelyDisabled;
3384
+ var m;
3385
+ return (((m = h.textContent) == null ? void 0 : m.trim()) || "") === o && !h.effectivelyDisabled;
3266
3386
  }
3267
3387
  );
3268
- d >= 0 && (i = d, s = !0);
3388
+ b >= 0 && (i = b, s = !0);
3269
3389
  }
3270
3390
  }
3271
3391
  break;
3272
3392
  }
3273
3393
  else
3274
- switch (e.key) {
3394
+ switch (t.key) {
3275
3395
  case "ArrowDown":
3276
3396
  i = this.findNextEnabled(this._focusedIndex, 1), s = !0;
3277
3397
  break;
@@ -3285,28 +3405,28 @@ class W extends c {
3285
3405
  i = this.findLastEnabled(), s = !0;
3286
3406
  break;
3287
3407
  default:
3288
- if (e.key.length === 1 && !e.ctrlKey && !e.altKey && !e.metaKey) {
3289
- const o = (r = this._typeAhead) == null ? void 0 : r.type(e.key);
3408
+ if (t.key.length === 1 && !t.ctrlKey && !t.altKey && !t.metaKey) {
3409
+ const o = (r = this._typeAhead) == null ? void 0 : r.type(t.key);
3290
3410
  if (o) {
3291
- const d = t.findIndex(
3411
+ const b = e.findIndex(
3292
3412
  (h) => {
3293
- var g;
3294
- return (((g = h.textContent) == null ? void 0 : g.trim()) || "") === o && !h.effectivelyDisabled;
3413
+ var m;
3414
+ return (((m = h.textContent) == null ? void 0 : m.trim()) || "") === o && !h.effectivelyDisabled;
3295
3415
  }
3296
3416
  );
3297
- d >= 0 && (i = d, s = !0);
3417
+ b >= 0 && (i = b, s = !0);
3298
3418
  }
3299
3419
  }
3300
3420
  break;
3301
3421
  }
3302
- if (s && (e.preventDefault(), e.stopPropagation()), i !== null && i >= 0) {
3422
+ if (s && (t.preventDefault(), t.stopPropagation()), i !== null && i >= 0) {
3303
3423
  this._focusedIndex = i, this.updateFocusHighlight();
3304
- const o = t[i];
3424
+ const o = e[i];
3305
3425
  if (!this._multiple && o)
3306
3426
  this.selectSingle(o);
3307
3427
  else if (o) {
3308
- const d = ((l = o.textContent) == null ? void 0 : l.trim()) || o.value, h = this._values.has(o.value);
3309
- p(`${d}${h ? ", selected" : ""}`);
3428
+ const b = ((l = o.textContent) == null ? void 0 : l.trim()) || o.value, h = this._values.has(o.value);
3429
+ p(`${b}${h ? ", selected" : ""}`);
3310
3430
  }
3311
3431
  }
3312
3432
  };
@@ -3326,49 +3446,49 @@ class W extends c {
3326
3446
  get value() {
3327
3447
  return this._multiple ? Array.from(this._values) : this._value || "";
3328
3448
  }
3329
- set value(e) {
3449
+ set value(t) {
3330
3450
  if (this._multiple) {
3331
- const t = Array.isArray(e) ? e : String(e).split(",").filter(Boolean);
3332
- this._values = new Set(t), this.setAttribute("value", t.join(","));
3451
+ const e = Array.isArray(t) ? t : String(t).split(",").filter(Boolean);
3452
+ this._values = new Set(e), this.setAttribute("value", e.join(","));
3333
3453
  } else {
3334
- const t = Array.isArray(e) ? e[0] || "" : String(e);
3335
- this._value = t, this.setAttribute("value", t);
3454
+ const e = Array.isArray(t) ? t[0] || "" : String(t);
3455
+ this._value = e, this.setAttribute("value", e);
3336
3456
  }
3337
3457
  this.syncOptionStates();
3338
3458
  }
3339
3459
  get multiple() {
3340
3460
  return this._multiple;
3341
3461
  }
3342
- set multiple(e) {
3343
- const t = !!e;
3344
- this._multiple !== t && (this._multiple = t, t ? (this.setAttribute("multiple", ""), this.setAttribute("aria-multiselectable", "true")) : (this.removeAttribute("multiple"), this.removeAttribute("aria-multiselectable")));
3462
+ set multiple(t) {
3463
+ const e = !!t;
3464
+ this._multiple !== e && (this._multiple = e, e ? (this.setAttribute("multiple", ""), this.setAttribute("aria-multiselectable", "true")) : (this.removeAttribute("multiple"), this.removeAttribute("aria-multiselectable")));
3345
3465
  }
3346
3466
  get disabled() {
3347
3467
  return this._disabled;
3348
3468
  }
3349
- set disabled(e) {
3350
- const t = !!e;
3351
- this._disabled !== t && (this._disabled = t, t ? (this.setAttribute("disabled", ""), this.setAttribute("aria-disabled", "true")) : (this.removeAttribute("disabled"), this.removeAttribute("aria-disabled")));
3469
+ set disabled(t) {
3470
+ const e = !!t;
3471
+ this._disabled !== e && (this._disabled = e, e ? (this.setAttribute("disabled", ""), this.setAttribute("aria-disabled", "true")) : (this.removeAttribute("disabled"), this.removeAttribute("aria-disabled")));
3352
3472
  }
3353
3473
  get discoverable() {
3354
3474
  return this._discoverable;
3355
3475
  }
3356
- set discoverable(e) {
3357
- this._discoverable = !!e;
3476
+ set discoverable(t) {
3477
+ this._discoverable = !!t;
3358
3478
  }
3359
3479
  get orientation() {
3360
3480
  return this._orientation;
3361
3481
  }
3362
- set orientation(e) {
3363
- this._orientation = e, this.setAttribute("orientation", e), this.setAttribute("aria-orientation", e);
3482
+ set orientation(t) {
3483
+ this._orientation = t, this.setAttribute("orientation", t), this.setAttribute("aria-orientation", t);
3364
3484
  }
3365
3485
  // ===== Lifecycle =====
3366
3486
  setupAccessibility() {
3367
3487
  this.setAttribute("role", "listbox"), this.setAttribute("aria-orientation", this._orientation), !(this.hasAttribute("aria-label") || this.hasAttribute("aria-labelledby")) && process.env.NODE_ENV !== "production" && console.warn(
3368
3488
  "[Compa11y Listbox]: Listbox has no accessible label. Use aria-label or aria-labelledby."
3369
3489
  ), this._multiple = this.hasAttribute("multiple"), this._multiple && this.setAttribute("aria-multiselectable", "true"), this._disabled = this.hasAttribute("disabled"), this._disabled && this.setAttribute("aria-disabled", "true");
3370
- const t = this.getAttribute("orientation");
3371
- (t === "horizontal" || t === "vertical") && (this._orientation = t);
3490
+ const e = this.getAttribute("orientation");
3491
+ (e === "horizontal" || e === "vertical") && (this._orientation = e);
3372
3492
  const i = this.getAttribute("discoverable");
3373
3493
  (i === "false" || i === "0") && (this._discoverable = !1);
3374
3494
  const s = this.getAttribute("value");
@@ -3376,17 +3496,17 @@ class W extends c {
3376
3496
  }
3377
3497
  render() {
3378
3498
  this.shadowRoot || this.attachShadow({ mode: "open" }), this.shadowRoot.innerHTML = `
3379
- <style>${$e}</style>
3499
+ <style>${It}</style>
3380
3500
  <div class="listbox-wrapper" part="wrapper">
3381
3501
  <slot></slot>
3382
3502
  </div>
3383
3503
  `;
3384
3504
  }
3385
3505
  setupEventListeners() {
3386
- var t;
3506
+ var e;
3387
3507
  this.addEventListener("keydown", this.handleKeyDown), this.addEventListener("focus", this.handleFocus), this.addEventListener("option-select", this.handleOptionSelect);
3388
- const e = (t = this.shadowRoot) == null ? void 0 : t.querySelector("slot");
3389
- e && e.addEventListener("slotchange", () => {
3508
+ const t = (e = this.shadowRoot) == null ? void 0 : e.querySelector("slot");
3509
+ t && t.addEventListener("slotchange", () => {
3390
3510
  this.rebuildTypeAhead(), this.syncOptionStates();
3391
3511
  }), this.rebuildTypeAhead(), this.syncOptionStates();
3392
3512
  }
@@ -3398,68 +3518,68 @@ class W extends c {
3398
3518
  return Array.from(this.querySelectorAll("a11y-option"));
3399
3519
  }
3400
3520
  getEnabledOptions() {
3401
- return this.getAllOptions().filter((e) => !e.effectivelyDisabled);
3521
+ return this.getAllOptions().filter((t) => !t.effectivelyDisabled);
3402
3522
  }
3403
3523
  getEnabledIndices() {
3404
- const e = this.getAllOptions(), t = [];
3405
- return e.forEach((i, s) => {
3406
- i.effectivelyDisabled || t.push(s);
3407
- }), t;
3524
+ const t = this.getAllOptions(), e = [];
3525
+ return t.forEach((i, s) => {
3526
+ i.effectivelyDisabled || e.push(s);
3527
+ }), e;
3408
3528
  }
3409
3529
  // ===== State Sync =====
3410
3530
  syncOptionStates() {
3411
- this.getAllOptions().forEach((t) => {
3412
- this._multiple ? t.selected = this._values.has(t.value) : t.selected = t.value === this._value;
3531
+ this.getAllOptions().forEach((e) => {
3532
+ this._multiple ? e.selected = this._values.has(e.value) : e.selected = e.value === this._value;
3413
3533
  });
3414
3534
  }
3415
3535
  updateFocusHighlight() {
3416
- const e = this.getAllOptions();
3417
- e.forEach((i, s) => {
3536
+ const t = this.getAllOptions();
3537
+ t.forEach((i, s) => {
3418
3538
  s === this._focusedIndex ? i.toggleAttribute("data-focused", !0) : i.removeAttribute("data-focused");
3419
3539
  });
3420
- const t = this._focusedIndex >= 0 ? e[this._focusedIndex] : void 0;
3421
- t ? (this.setAttribute("aria-activedescendant", t.id), t.scrollIntoView({ block: "nearest" })) : this.removeAttribute("aria-activedescendant");
3540
+ const e = this._focusedIndex >= 0 ? t[this._focusedIndex] : void 0;
3541
+ e ? (this.setAttribute("aria-activedescendant", e.id), e.scrollIntoView({ block: "nearest" })) : this.removeAttribute("aria-activedescendant");
3422
3542
  }
3423
3543
  // ===== Navigation Helpers =====
3424
- findNextEnabled(e, t) {
3544
+ findNextEnabled(t, e) {
3425
3545
  const i = this.getEnabledIndices();
3426
3546
  if (i.length === 0) return -1;
3427
- const s = i.indexOf(e);
3547
+ const s = i.indexOf(t);
3428
3548
  if (s === -1)
3429
- return t === 1 ? i[0] : i[i.length - 1];
3430
- const a = s + t;
3549
+ return e === 1 ? i[0] : i[i.length - 1];
3550
+ const a = s + e;
3431
3551
  return a < 0 || a >= i.length ? -1 : i[a];
3432
3552
  }
3433
3553
  findFirstEnabled() {
3434
- const e = this.getEnabledIndices();
3435
- return e.length > 0 ? e[0] : -1;
3554
+ const t = this.getEnabledIndices();
3555
+ return t.length > 0 ? t[0] : -1;
3436
3556
  }
3437
3557
  findLastEnabled() {
3438
- const e = this.getEnabledIndices();
3439
- return e.length > 0 ? e[e.length - 1] : -1;
3558
+ const t = this.getEnabledIndices();
3559
+ return t.length > 0 ? t[t.length - 1] : -1;
3440
3560
  }
3441
3561
  // ===== Selection =====
3442
- selectOption(e) {
3443
- e.effectivelyDisabled || this._disabled || (this._multiple ? this.toggleOptionSelection(e) : this.selectSingle(e));
3562
+ selectOption(t) {
3563
+ t.effectivelyDisabled || this._disabled || (this._multiple ? this.toggleOptionSelection(t) : this.selectSingle(t));
3444
3564
  }
3445
- selectSingle(e) {
3565
+ selectSingle(t) {
3446
3566
  var i;
3447
- const t = this._value;
3448
- if (this._value = e.value, this.setAttribute("value", e.value), this.syncOptionStates(), t !== this._value) {
3449
- const s = ((i = e.textContent) == null ? void 0 : i.trim()) || e.value;
3567
+ const e = this._value;
3568
+ if (this._value = t.value, this.setAttribute("value", t.value), this.syncOptionStates(), e !== this._value) {
3569
+ const s = ((i = t.textContent) == null ? void 0 : i.trim()) || t.value;
3450
3570
  this.emit("change", { value: this._value, label: s }), this.emit("a11y-listbox-change", { value: this._value, label: s }), p(`${s} selected`);
3451
3571
  }
3452
3572
  }
3453
- toggleOptionSelection(e) {
3573
+ toggleOptionSelection(t) {
3454
3574
  var s;
3455
- if (e.effectivelyDisabled || this._disabled) return;
3456
- const t = ((s = e.textContent) == null ? void 0 : s.trim()) || e.value;
3457
- this._values.has(e.value) ? (this._values.delete(e.value), e.selected = !1, p(`${t} deselected`)) : (this._values.add(e.value), e.selected = !0, p(`${t} selected`));
3575
+ if (t.effectivelyDisabled || this._disabled) return;
3576
+ const e = ((s = t.textContent) == null ? void 0 : s.trim()) || t.value;
3577
+ this._values.has(t.value) ? (this._values.delete(t.value), t.selected = !1, p(`${e} deselected`)) : (this._values.add(t.value), t.selected = !0, p(`${e} selected`));
3458
3578
  const i = Array.from(this._values);
3459
3579
  this.setAttribute("value", i.join(",")), this.emit("change", { value: i }), this.emit("a11y-listbox-change", { value: i });
3460
3580
  }
3461
- selectRange(e, t) {
3462
- const i = this.getAllOptions(), s = Math.min(e, t), a = Math.max(e, t);
3581
+ selectRange(t, e) {
3582
+ const i = this.getAllOptions(), s = Math.min(t, e), a = Math.max(t, e);
3463
3583
  for (let l = s; l <= a; l++) {
3464
3584
  const o = i[l];
3465
3585
  o && !o.effectivelyDisabled && (this._values.add(o.value), o.selected = !0);
@@ -3468,8 +3588,8 @@ class W extends c {
3468
3588
  this.setAttribute("value", r.join(",")), this.emit("change", { value: r }), this.emit("a11y-listbox-change", { value: r }), p(`${a - s + 1} items selected`);
3469
3589
  }
3470
3590
  toggleSelectAll() {
3471
- const e = this.getEnabledOptions();
3472
- e.every((s) => this._values.has(s.value)) ? (this._values.clear(), this.getAllOptions().forEach((s) => s.selected = !1), p("All deselected")) : (e.forEach((s) => {
3591
+ const t = this.getEnabledOptions();
3592
+ t.every((s) => this._values.has(s.value)) ? (this._values.clear(), this.getAllOptions().forEach((s) => s.selected = !1), p("All deselected")) : (t.forEach((s) => {
3473
3593
  this._values.add(s.value), s.selected = !0;
3474
3594
  }), p("All selected"));
3475
3595
  const i = Array.from(this._values);
@@ -3477,53 +3597,52 @@ class W extends c {
3477
3597
  }
3478
3598
  // ===== Type-ahead =====
3479
3599
  rebuildTypeAhead() {
3480
- const e = this.getAllOptions().map(
3481
- (t) => {
3600
+ const t = this.getAllOptions().map(
3601
+ (e) => {
3482
3602
  var i;
3483
- return ((i = t.textContent) == null ? void 0 : i.trim()) || "";
3603
+ return ((i = e.textContent) == null ? void 0 : i.trim()) || "";
3484
3604
  }
3485
3605
  );
3486
- this._typeAhead = q(e, { timeout: 500 });
3606
+ this._typeAhead = q(t, { timeout: 500 });
3487
3607
  }
3488
3608
  // ===== Attribute Changes =====
3489
- attributeChangedCallback(e, t, i) {
3490
- if (t !== i)
3491
- switch (e) {
3492
- case "value":
3493
- this._multiple ? this._values = new Set(
3494
- (i || "").split(",").filter(Boolean)
3495
- ) : this._value = i || null, this.syncOptionStates();
3496
- break;
3497
- case "multiple":
3498
- this._multiple = i !== null, this._multiple ? (this.setAttribute("aria-multiselectable", "true"), this._value && (this._values = /* @__PURE__ */ new Set([this._value]), this._value = null)) : (this.removeAttribute("aria-multiselectable"), this._values.size > 0 && (this._value = Array.from(this._values)[0] ?? null, this._values.clear())), this.syncOptionStates();
3499
- break;
3500
- case "disabled":
3501
- this._disabled = i !== null, this._disabled ? (this.setAttribute("aria-disabled", "true"), this._discoverable || this.setAttribute("tabindex", "-1")) : (this.removeAttribute("aria-disabled"), this.setAttribute("tabindex", "0"));
3502
- break;
3503
- case "discoverable":
3504
- i === null ? this._discoverable = !0 : i === "false" || i === "0" ? this._discoverable = !1 : this._discoverable = !0;
3505
- break;
3506
- case "orientation":
3507
- (i === "horizontal" || i === "vertical") && (this._orientation = i, this.setAttribute("aria-orientation", i));
3508
- break;
3509
- }
3609
+ onAttributeChange(t, e, i) {
3610
+ switch (t) {
3611
+ case "value":
3612
+ this._multiple ? this._values = new Set(
3613
+ (i || "").split(",").filter(Boolean)
3614
+ ) : this._value = i || null, this.syncOptionStates();
3615
+ break;
3616
+ case "multiple":
3617
+ this._multiple = i !== null, this._multiple ? (this.setAttribute("aria-multiselectable", "true"), this._value && (this._values = /* @__PURE__ */ new Set([this._value]), this._value = null)) : (this.removeAttribute("aria-multiselectable"), this._values.size > 0 && (this._value = Array.from(this._values)[0] ?? null, this._values.clear())), this.syncOptionStates();
3618
+ break;
3619
+ case "disabled":
3620
+ this._disabled = i !== null, this._disabled ? (this.setAttribute("aria-disabled", "true"), this._discoverable || this.setAttribute("tabindex", "-1")) : (this.removeAttribute("aria-disabled"), this.setAttribute("tabindex", "0"));
3621
+ break;
3622
+ case "discoverable":
3623
+ i === null ? this._discoverable = !0 : i === "false" || i === "0" ? this._discoverable = !1 : this._discoverable = !0;
3624
+ break;
3625
+ case "orientation":
3626
+ (i === "horizontal" || i === "vertical") && (this._orientation = i, this.setAttribute("aria-orientation", i));
3627
+ break;
3628
+ }
3510
3629
  }
3511
3630
  }
3512
- u("a11y-optgroup", X);
3513
- u("a11y-option", V);
3514
- u("a11y-listbox", W);
3515
- const De = `<svg class="checkbox-check" width="12" height="12" viewBox="0 0 12 12" fill="none" aria-hidden="true">
3631
+ c("a11y-optgroup", W);
3632
+ c("a11y-option", J);
3633
+ c("a11y-listbox", Q);
3634
+ const Mt = `<svg class="checkbox-check" width="12" height="12" viewBox="0 0 12 12" fill="none" aria-hidden="true">
3516
3635
  <path d="M2.5 6L5 8.5L9.5 3.5" stroke="currentColor" stroke-width="2" stroke-linecap="round" stroke-linejoin="round"/>
3517
- </svg>`, Oe = `<svg class="checkbox-dash" width="12" height="12" viewBox="0 0 12 12" fill="none" aria-hidden="true">
3636
+ </svg>`, Kt = `<svg class="checkbox-dash" width="12" height="12" viewBox="0 0 12 12" fill="none" aria-hidden="true">
3518
3637
  <path d="M3 6H9" stroke="currentColor" stroke-width="2" stroke-linecap="round"/>
3519
3638
  </svg>`;
3520
- class O extends c {
3639
+ class R extends d {
3521
3640
  constructor() {
3522
3641
  super(...arguments), this._checked = !1, this._indeterminate = !1, this._input = null, this.handleChange = () => {
3523
3642
  if (!this._input) return;
3524
3643
  this._checked = this._input.checked, this.toggleAttribute("checked", this._checked), this._indeterminate && (this._indeterminate = !1, this.removeAttribute("indeterminate"), this._input.indeterminate = !1), this.updateVisualState(), this.emit("change", { checked: this._checked, value: this.value });
3525
- const e = this.label || this.getAttribute("aria-label") || "Checkbox";
3526
- p(`${e} ${this._checked ? "checked" : "unchecked"}`);
3644
+ const t = this.label || this.getAttribute("aria-label") || "Checkbox";
3645
+ p(`${t} ${this._checked ? "checked" : "unchecked"}`);
3527
3646
  };
3528
3647
  }
3529
3648
  static get observedAttributes() {
@@ -3548,9 +3667,9 @@ class O extends c {
3548
3667
  get checked() {
3549
3668
  return this._checked;
3550
3669
  }
3551
- set checked(e) {
3552
- const t = this._checked;
3553
- this._checked = e, this.toggleAttribute("checked", e), e !== t && (this.updateVisualState(), this.emit("change", { checked: e, value: this.value }));
3670
+ set checked(t) {
3671
+ const e = this._checked;
3672
+ this._checked = t, this.toggleAttribute("checked", t), t !== e && (this.updateVisualState(), this.emit("change", { checked: t, value: this.value }));
3554
3673
  }
3555
3674
  /**
3556
3675
  * Get/set the indeterminate state
@@ -3558,9 +3677,9 @@ class O extends c {
3558
3677
  get indeterminate() {
3559
3678
  return this._indeterminate;
3560
3679
  }
3561
- set indeterminate(e) {
3562
- const t = this._indeterminate;
3563
- this._indeterminate = e, this.toggleAttribute("indeterminate", e), e !== t && this.updateVisualState();
3680
+ set indeterminate(t) {
3681
+ const e = this._indeterminate;
3682
+ this._indeterminate = t, this.toggleAttribute("indeterminate", t), t !== e && this.updateVisualState();
3564
3683
  }
3565
3684
  /**
3566
3685
  * Get/set the disabled state
@@ -3568,8 +3687,8 @@ class O extends c {
3568
3687
  get disabled() {
3569
3688
  return this.hasAttribute("disabled");
3570
3689
  }
3571
- set disabled(e) {
3572
- this.toggleAttribute("disabled", e), this.updateDisabledState();
3690
+ set disabled(t) {
3691
+ this.toggleAttribute("disabled", t), this.updateDisabledState();
3573
3692
  }
3574
3693
  /**
3575
3694
  * Get/set the value
@@ -3577,8 +3696,8 @@ class O extends c {
3577
3696
  get value() {
3578
3697
  return this.getAttribute("value") || "";
3579
3698
  }
3580
- set value(e) {
3581
- e ? this.setAttribute("value", e) : this.removeAttribute("value");
3699
+ set value(t) {
3700
+ t ? this.setAttribute("value", t) : this.removeAttribute("value");
3582
3701
  }
3583
3702
  /**
3584
3703
  * Get/set the visible label
@@ -3586,8 +3705,8 @@ class O extends c {
3586
3705
  get label() {
3587
3706
  return this.getAttribute("label") || "";
3588
3707
  }
3589
- set label(e) {
3590
- e ? this.setAttribute("label", e) : this.removeAttribute("label");
3708
+ set label(t) {
3709
+ t ? this.setAttribute("label", t) : this.removeAttribute("label");
3591
3710
  }
3592
3711
  /**
3593
3712
  * Get/set the hint text
@@ -3595,8 +3714,8 @@ class O extends c {
3595
3714
  get hint() {
3596
3715
  return this.getAttribute("hint") || "";
3597
3716
  }
3598
- set hint(e) {
3599
- e ? this.setAttribute("hint", e) : this.removeAttribute("hint");
3717
+ set hint(t) {
3718
+ t ? this.setAttribute("hint", t) : this.removeAttribute("hint");
3600
3719
  }
3601
3720
  /**
3602
3721
  * Get/set the error message
@@ -3604,18 +3723,18 @@ class O extends c {
3604
3723
  get error() {
3605
3724
  return this.getAttribute("error") || "";
3606
3725
  }
3607
- set error(e) {
3608
- e ? this.setAttribute("error", e) : this.removeAttribute("error");
3726
+ set error(t) {
3727
+ t ? this.setAttribute("error", t) : this.removeAttribute("error");
3609
3728
  }
3610
3729
  /**
3611
3730
  * Get/set the size variant
3612
3731
  */
3613
3732
  get size() {
3614
- const e = this.getAttribute("size");
3615
- return e === "sm" || e === "lg" ? e : "md";
3733
+ const t = this.getAttribute("size");
3734
+ return t === "sm" || t === "lg" ? t : "md";
3616
3735
  }
3617
- set size(e) {
3618
- this.setAttribute("size", e);
3736
+ set size(t) {
3737
+ this.setAttribute("size", t);
3619
3738
  }
3620
3739
  /**
3621
3740
  * Get/set required state
@@ -3623,28 +3742,28 @@ class O extends c {
3623
3742
  get required() {
3624
3743
  return this.hasAttribute("required");
3625
3744
  }
3626
- set required(e) {
3627
- this.toggleAttribute("required", e);
3745
+ set required(t) {
3746
+ this.toggleAttribute("required", t);
3628
3747
  }
3629
3748
  setupAccessibility() {
3630
- var e;
3631
- this._checked = this.hasAttribute("checked"), this._indeterminate = this.hasAttribute("indeterminate"), typeof process < "u" && ((e = process.env) == null ? void 0 : e.NODE_ENV) !== "production" && !this.label && !this.getAttribute("aria-label") && console.warn(
3749
+ var t;
3750
+ this._checked = this.hasAttribute("checked"), this._indeterminate = this.hasAttribute("indeterminate"), typeof process < "u" && ((t = process.env) == null ? void 0 : t.NODE_ENV) !== "production" && !this.label && !this.getAttribute("aria-label") && console.warn(
3632
3751
  `[compa11y/Checkbox] Checkbox has no accessible label. Add label="..." or aria-label="..." attribute.
3633
3752
  💡 Suggestion: <a11y-checkbox label="Accept terms"></a11y-checkbox>`
3634
3753
  );
3635
3754
  }
3636
3755
  render() {
3637
- const e = this.attachShadow({ mode: "open" }), t = `${this._id}-input`, i = `${this._id}-label`, s = `${this._id}-hint`, a = `${this._id}-error`, r = !!this.label, l = !!this.hint, o = !!this.error, d = this.getAttribute("aria-label"), h = this.getAttribute("name") || "", g = this.getAttribute("aria-describedby") || "", m = [];
3638
- g && m.push(g), l && m.push(s), o && m.push(a);
3639
- const f = m.length ? `aria-describedby="${m.join(" ")}"` : "", _ = !r && d ? `aria-label="${d}"` : "";
3640
- e.innerHTML = `
3641
- <style>${Ie}</style>
3756
+ const t = this.attachShadow({ mode: "open" }), e = `${this._id}-input`, i = `${this._id}-label`, s = `${this._id}-hint`, a = `${this._id}-error`, r = !!this.label, l = !!this.hint, o = !!this.error, b = this.getAttribute("aria-label"), h = this.getAttribute("name") || "", m = this.getAttribute("aria-describedby") || "", g = [];
3757
+ m && g.push(m), l && g.push(s), o && g.push(a);
3758
+ const f = g.length ? `aria-describedby="${g.join(" ")}"` : "", _ = !r && b ? `aria-label="${b}"` : "";
3759
+ t.innerHTML = `
3760
+ <style>${zt}</style>
3642
3761
  <div class="checkbox-wrapper size-${this.size}" part="wrapper">
3643
3762
  <div class="checkbox-control">
3644
3763
  <input
3645
3764
  type="checkbox"
3646
3765
  class="checkbox-input"
3647
- id="${t}"
3766
+ id="${e}"
3648
3767
  ${h ? `name="${h}"` : ""}
3649
3768
  ${this.value ? `value="${this.value}"` : ""}
3650
3769
  ${this._checked ? "checked" : ""}
@@ -3656,28 +3775,28 @@ class O extends c {
3656
3775
  part="input"
3657
3776
  />
3658
3777
  <div class="checkbox-indicator" part="indicator" aria-hidden="true">
3659
- ${De}
3660
- ${Oe}
3778
+ ${Mt}
3779
+ ${Kt}
3661
3780
  </div>
3662
3781
  </div>
3663
3782
  ${r || l || o ? `<div class="checkbox-content">
3664
- ${r ? `<label for="${t}" id="${i}" class="checkbox-label" part="label">${this.label}${this.required ? '<span class="checkbox-required" aria-hidden="true">*</span>' : ""}</label>` : ""}
3783
+ ${r ? `<label for="${e}" id="${i}" class="checkbox-label" part="label">${this.label}${this.required ? '<span class="checkbox-required" aria-hidden="true">*</span>' : ""}</label>` : ""}
3665
3784
  ${l ? `<div id="${s}" class="checkbox-hint" part="hint">${this.hint}</div>` : ""}
3666
3785
  ${o ? `<div id="${a}" class="checkbox-error" role="alert" part="error">${this.error}</div>` : ""}
3667
3786
  </div>` : ""}
3668
3787
  </div>
3669
- `, this._input = e.querySelector("input"), this._input && this._indeterminate && (this._input.indeterminate = !0);
3788
+ `, this._input = t.querySelector("input"), this._input && this._indeterminate && (this._input.indeterminate = !0);
3670
3789
  }
3671
3790
  setupEventListeners() {
3672
- var e;
3673
- (e = this._input) == null || e.addEventListener("change", this.handleChange);
3791
+ var t;
3792
+ (t = this._input) == null || t.addEventListener("change", this.handleChange);
3674
3793
  }
3675
3794
  cleanupEventListeners() {
3676
- var e;
3677
- (e = this._input) == null || e.removeEventListener("change", this.handleChange);
3795
+ var t;
3796
+ (t = this._input) == null || t.removeEventListener("change", this.handleChange);
3678
3797
  }
3679
- onAttributeChange(e, t, i) {
3680
- switch (e) {
3798
+ onAttributeChange(t, e, i) {
3799
+ switch (t) {
3681
3800
  case "checked":
3682
3801
  this._checked = i !== null, this.updateVisualState();
3683
3802
  break;
@@ -3717,9 +3836,9 @@ class O extends c {
3717
3836
  * Update size class
3718
3837
  */
3719
3838
  updateSizeClass() {
3720
- var t;
3721
- const e = (t = this.shadowRoot) == null ? void 0 : t.querySelector(".checkbox-wrapper");
3722
- e && (e.classList.remove("size-sm", "size-md", "size-lg"), e.classList.add(`size-${this.size}`));
3839
+ var e;
3840
+ const t = (e = this.shadowRoot) == null ? void 0 : e.querySelector(".checkbox-wrapper");
3841
+ t && (t.classList.remove("size-sm", "size-md", "size-lg"), t.classList.add(`size-${this.size}`));
3723
3842
  }
3724
3843
  /**
3725
3844
  * Toggle the checkbox programmatically
@@ -3727,23 +3846,23 @@ class O extends c {
3727
3846
  toggle() {
3728
3847
  if (this.disabled) return;
3729
3848
  this._indeterminate ? (this.indeterminate = !1, this.checked = !0) : this.checked = !this.checked;
3730
- const e = this.label || this.getAttribute("aria-label") || "Checkbox";
3731
- p(`${e} ${this.checked ? "checked" : "unchecked"}`);
3849
+ const t = this.label || this.getAttribute("aria-label") || "Checkbox";
3850
+ p(`${t} ${this.checked ? "checked" : "unchecked"}`);
3732
3851
  }
3733
3852
  /**
3734
3853
  * Set checked state programmatically
3735
3854
  */
3736
- setChecked(e) {
3737
- this.checked = e;
3855
+ setChecked(t) {
3856
+ this.checked = t;
3738
3857
  }
3739
3858
  }
3740
- class J extends c {
3859
+ class Z extends d {
3741
3860
  constructor() {
3742
- super(...arguments), this._value = [], this.handleChildChange = (e) => {
3743
- const t = e.target;
3744
- if (!(t instanceof O) || t === this) return;
3745
- const i = t.value;
3746
- i && (t.checked ? this._value.includes(i) || (this._value = [...this._value, i]) : this._value = this._value.filter((s) => s !== i), this.emit("change", { value: this._value }));
3861
+ super(...arguments), this._value = [], this.handleChildChange = (t) => {
3862
+ const e = t.target;
3863
+ if (!(e instanceof R) || e === this) return;
3864
+ const i = e.value;
3865
+ i && (e.checked ? this._value.includes(i) || (this._value = [...this._value, i]) : this._value = this._value.filter((s) => s !== i), this.emit("change", { value: this._value }));
3747
3866
  };
3748
3867
  }
3749
3868
  static get observedAttributes() {
@@ -3762,8 +3881,8 @@ class J extends c {
3762
3881
  get value() {
3763
3882
  return [...this._value];
3764
3883
  }
3765
- set value(e) {
3766
- this._value = [...e], this.syncCheckboxStates();
3884
+ set value(t) {
3885
+ this._value = [...t], this.syncCheckboxStates();
3767
3886
  }
3768
3887
  /**
3769
3888
  * Get/set the disabled state
@@ -3771,8 +3890,8 @@ class J extends c {
3771
3890
  get disabled() {
3772
3891
  return this.hasAttribute("disabled");
3773
3892
  }
3774
- set disabled(e) {
3775
- this.toggleAttribute("disabled", e), this.syncDisabledState();
3893
+ set disabled(t) {
3894
+ this.toggleAttribute("disabled", t), this.syncDisabledState();
3776
3895
  }
3777
3896
  /**
3778
3897
  * Get/set the legend text
@@ -3780,8 +3899,8 @@ class J extends c {
3780
3899
  get legend() {
3781
3900
  return this.getAttribute("legend") || "";
3782
3901
  }
3783
- set legend(e) {
3784
- e ? this.setAttribute("legend", e) : this.removeAttribute("legend");
3902
+ set legend(t) {
3903
+ t ? this.setAttribute("legend", t) : this.removeAttribute("legend");
3785
3904
  }
3786
3905
  /**
3787
3906
  * Get/set the error message
@@ -3789,8 +3908,8 @@ class J extends c {
3789
3908
  get error() {
3790
3909
  return this.getAttribute("error") || "";
3791
3910
  }
3792
- set error(e) {
3793
- e ? this.setAttribute("error", e) : this.removeAttribute("error");
3911
+ set error(t) {
3912
+ t ? this.setAttribute("error", t) : this.removeAttribute("error");
3794
3913
  }
3795
3914
  /**
3796
3915
  * Get/set the orientation
@@ -3798,32 +3917,32 @@ class J extends c {
3798
3917
  get orientation() {
3799
3918
  return this.getAttribute("orientation") === "horizontal" ? "horizontal" : "vertical";
3800
3919
  }
3801
- set orientation(e) {
3802
- this.setAttribute("orientation", e);
3920
+ set orientation(t) {
3921
+ this.setAttribute("orientation", t);
3803
3922
  }
3804
3923
  setupAccessibility() {
3805
- var e;
3806
- typeof process < "u" && ((e = process.env) == null ? void 0 : e.NODE_ENV) !== "production" && !this.legend && !this.getAttribute("aria-label") && !this.getAttribute("aria-labelledby") && console.warn(
3924
+ var t;
3925
+ typeof process < "u" && ((t = process.env) == null ? void 0 : t.NODE_ENV) !== "production" && !this.legend && !this.getAttribute("aria-label") && !this.getAttribute("aria-labelledby") && console.warn(
3807
3926
  `[compa11y/CheckboxGroup] CheckboxGroup has no accessible label. Add legend="..." or aria-label="..." attribute.
3808
3927
  💡 Suggestion: <a11y-checkbox-group legend="Select options"></a11y-checkbox-group>`
3809
3928
  ), this.initValueFromChildren();
3810
3929
  }
3811
3930
  render() {
3812
- const e = this.attachShadow({ mode: "open" }), t = `${this._id}-error`, i = !!this.legend, s = !!this.error, a = this.getAttribute("aria-label"), r = this.getAttribute("aria-labelledby");
3813
- e.innerHTML = `
3814
- <style>${Ce}</style>
3931
+ const t = this.attachShadow({ mode: "open" }), e = `${this._id}-error`, i = !!this.legend, s = !!this.error, a = this.getAttribute("aria-label"), r = this.getAttribute("aria-labelledby");
3932
+ t.innerHTML = `
3933
+ <style>${Dt}</style>
3815
3934
  <fieldset
3816
3935
  part="fieldset"
3817
3936
  ${a ? `aria-label="${a}"` : ""}
3818
3937
  ${r ? `aria-labelledby="${r}"` : ""}
3819
- ${s ? `aria-describedby="${t}"` : ""}
3938
+ ${s ? `aria-describedby="${e}"` : ""}
3820
3939
  ${this.disabled ? "disabled" : ""}
3821
3940
  >
3822
3941
  ${i ? `<legend part="legend">${this.legend}</legend>` : ""}
3823
3942
  <div class="checkbox-group-items" part="items">
3824
3943
  <slot></slot>
3825
3944
  </div>
3826
- ${s ? `<div id="${t}" class="checkbox-group-error" role="alert" part="error">${this.error}</div>` : ""}
3945
+ ${s ? `<div id="${e}" class="checkbox-group-error" role="alert" part="error">${this.error}</div>` : ""}
3827
3946
  </fieldset>
3828
3947
  `;
3829
3948
  }
@@ -3833,8 +3952,8 @@ class J extends c {
3833
3952
  cleanupEventListeners() {
3834
3953
  this.removeEventListener("change", this.handleChildChange);
3835
3954
  }
3836
- onAttributeChange(e, t, i) {
3837
- switch (e) {
3955
+ onAttributeChange(t, e, i) {
3956
+ switch (t) {
3838
3957
  case "disabled":
3839
3958
  this.syncDisabledState();
3840
3959
  break;
@@ -3851,10 +3970,10 @@ class J extends c {
3851
3970
  */
3852
3971
  initValueFromChildren() {
3853
3972
  requestAnimationFrame(() => {
3854
- const e = this.querySelectorAll("a11y-checkbox"), t = [];
3855
- e.forEach((i) => {
3856
- i.hasAttribute("checked") && i.getAttribute("value") && t.push(i.getAttribute("value"));
3857
- }), this._value = t;
3973
+ const t = this.querySelectorAll("a11y-checkbox"), e = [];
3974
+ t.forEach((i) => {
3975
+ i.hasAttribute("checked") && i.getAttribute("value") && e.push(i.getAttribute("value"));
3976
+ }), this._value = e;
3858
3977
  });
3859
3978
  }
3860
3979
  /**
@@ -3863,56 +3982,56 @@ class J extends c {
3863
3982
  syncCheckboxStates() {
3864
3983
  this.querySelectorAll(
3865
3984
  "a11y-checkbox"
3866
- ).forEach((t) => {
3867
- const i = t.value;
3868
- i && (t.checked = this._value.includes(i));
3985
+ ).forEach((e) => {
3986
+ const i = e.value;
3987
+ i && (e.checked = this._value.includes(i));
3869
3988
  });
3870
3989
  }
3871
3990
  /**
3872
3991
  * Sync disabled state to children
3873
3992
  */
3874
3993
  syncDisabledState() {
3875
- var t;
3876
- const e = (t = this.shadowRoot) == null ? void 0 : t.querySelector("fieldset");
3877
- e && (this.disabled ? e.setAttribute("disabled", "") : e.removeAttribute("disabled"));
3994
+ var e;
3995
+ const t = (e = this.shadowRoot) == null ? void 0 : e.querySelector("fieldset");
3996
+ t && (this.disabled ? t.setAttribute("disabled", "") : t.removeAttribute("disabled"));
3878
3997
  }
3879
3998
  }
3880
- u("a11y-checkbox", O);
3881
- u("a11y-checkbox-group", J);
3882
- class Q extends c {
3999
+ c("a11y-checkbox", R);
4000
+ c("a11y-checkbox-group", Z);
4001
+ class tt extends d {
3883
4002
  constructor() {
3884
- super(...arguments), this._value = "", this._disabled = !1, this._discoverable = !0, this._orientation = "vertical", this._required = !1, this._name = "", this.handleRadioSelect = (e) => {
4003
+ super(...arguments), this._value = "", this._disabled = !1, this._discoverable = !0, this._orientation = "vertical", this._required = !1, this._name = "", this.handleRadioSelect = (t) => {
3885
4004
  var i;
3886
4005
  if (this._disabled) return;
3887
- const t = (i = e.detail) == null ? void 0 : i.value;
3888
- t !== void 0 && this.selectRadio(t);
3889
- }, this.handleKeyDown = (e) => {
4006
+ const e = (i = t.detail) == null ? void 0 : i.value;
4007
+ e !== void 0 && this.selectRadio(e);
4008
+ }, this.handleKeyDown = (t) => {
3890
4009
  if (this._disabled) return;
3891
- const t = this.getEnabledRadios();
3892
- if (t.length === 0) return;
3893
- const i = t.findIndex(
4010
+ const e = this.getEnabledRadios();
4011
+ if (e.length === 0) return;
4012
+ const i = e.findIndex(
3894
4013
  (a) => a.value === this._value
3895
4014
  );
3896
4015
  let s = null;
3897
- switch (e.key) {
4016
+ switch (t.key) {
3898
4017
  case "ArrowDown":
3899
4018
  case "ArrowRight":
3900
- s = i < 0 ? 0 : (i + 1) % t.length;
4019
+ s = i < 0 ? 0 : (i + 1) % e.length;
3901
4020
  break;
3902
4021
  case "ArrowUp":
3903
4022
  case "ArrowLeft":
3904
- s = i < 0 ? t.length - 1 : (i - 1 + t.length) % t.length;
4023
+ s = i < 0 ? e.length - 1 : (i - 1 + e.length) % e.length;
3905
4024
  break;
3906
4025
  case "Home":
3907
4026
  s = 0;
3908
4027
  break;
3909
4028
  case "End":
3910
- s = t.length - 1;
4029
+ s = e.length - 1;
3911
4030
  break;
3912
4031
  case " ":
3913
- e.preventDefault(), e.stopPropagation();
4032
+ t.preventDefault(), t.stopPropagation();
3914
4033
  {
3915
- const a = t.find(
4034
+ const a = e.find(
3916
4035
  (r) => r === document.activeElement || r.contains(document.activeElement)
3917
4036
  );
3918
4037
  if (a && a.value !== this._value) {
@@ -3926,8 +4045,8 @@ class Q extends c {
3926
4045
  return;
3927
4046
  }
3928
4047
  if (s !== null) {
3929
- e.preventDefault(), e.stopPropagation();
3930
- const a = t[s];
4048
+ t.preventDefault(), t.stopPropagation();
4049
+ const a = e[s];
3931
4050
  if (a) {
3932
4051
  this.selectRadio(a.value), a.focus();
3933
4052
  const r = a.getAttribute("label") || a.value;
@@ -3955,47 +4074,47 @@ class Q extends c {
3955
4074
  get value() {
3956
4075
  return this._value;
3957
4076
  }
3958
- set value(e) {
3959
- this._value !== e && (this._value = e, this.setAttribute("value", e), this.syncRadioStates());
4077
+ set value(t) {
4078
+ this._value !== t && (this._value = t, this.setAttribute("value", t), this.syncRadioStates());
3960
4079
  }
3961
4080
  get disabled() {
3962
4081
  return this._disabled;
3963
4082
  }
3964
- set disabled(e) {
3965
- const t = !!e;
3966
- this._disabled !== t && (this._disabled = t, t ? (this.setAttribute("disabled", ""), this.setAttribute("aria-disabled", "true")) : (this.removeAttribute("disabled"), this.removeAttribute("aria-disabled")), this.syncRadioStates());
4083
+ set disabled(t) {
4084
+ const e = !!t;
4085
+ this._disabled !== e && (this._disabled = e, e ? (this.setAttribute("disabled", ""), this.setAttribute("aria-disabled", "true")) : (this.removeAttribute("disabled"), this.removeAttribute("aria-disabled")), this.syncRadioStates());
3967
4086
  }
3968
4087
  get discoverable() {
3969
4088
  return this._discoverable;
3970
4089
  }
3971
- set discoverable(e) {
3972
- this._discoverable = !!e;
4090
+ set discoverable(t) {
4091
+ this._discoverable = !!t;
3973
4092
  }
3974
4093
  get required() {
3975
4094
  return this._required;
3976
4095
  }
3977
- set required(e) {
3978
- this._required = !!e, this._required ? this.setAttribute("aria-required", "true") : this.removeAttribute("aria-required");
4096
+ set required(t) {
4097
+ this._required = !!t, this._required ? this.setAttribute("aria-required", "true") : this.removeAttribute("aria-required");
3979
4098
  }
3980
4099
  get name() {
3981
4100
  return this._name;
3982
4101
  }
3983
- set name(e) {
3984
- this._name = e, this.setAttribute("name", e);
4102
+ set name(t) {
4103
+ this._name = t, this.setAttribute("name", t);
3985
4104
  }
3986
4105
  get orientation() {
3987
4106
  return this._orientation;
3988
4107
  }
3989
- set orientation(e) {
3990
- this._orientation = e, this.setAttribute("orientation", e), this.setAttribute("aria-orientation", e);
4108
+ set orientation(t) {
4109
+ this._orientation = t, this.setAttribute("orientation", t), this.setAttribute("aria-orientation", t);
3991
4110
  }
3992
4111
  // ===== Lifecycle =====
3993
4112
  setupAccessibility() {
3994
4113
  this.setAttribute("role", "radiogroup"), this.setAttribute("aria-orientation", this._orientation), !(this.hasAttribute("aria-label") || this.hasAttribute("aria-labelledby") || this.hasAttribute("legend")) && process.env.NODE_ENV !== "production" && console.warn(
3995
4114
  "[Compa11y RadioGroup]: RadioGroup has no accessible label. Use legend, aria-label, or aria-labelledby."
3996
4115
  );
3997
- const t = this.getAttribute("value");
3998
- t && (this._value = t), this._disabled = this.hasAttribute("disabled"), this._disabled && this.setAttribute("aria-disabled", "true");
4116
+ const e = this.getAttribute("value");
4117
+ e && (this._value = e), this._disabled = this.hasAttribute("disabled"), this._disabled && this.setAttribute("aria-disabled", "true");
3999
4118
  const i = this.getAttribute("orientation");
4000
4119
  (i === "horizontal" || i === "vertical") && (this._orientation = i), this._required = this.hasAttribute("required"), this._required && this.setAttribute("aria-required", "true"), this._name = this.getAttribute("name") || this._id;
4001
4120
  const s = this.getAttribute("discoverable");
@@ -4003,11 +4122,11 @@ class Q extends c {
4003
4122
  }
4004
4123
  render() {
4005
4124
  this.shadowRoot || this.attachShadow({ mode: "open" });
4006
- const e = this.shadowRoot, t = this.getAttribute("legend") || "", i = this.getAttribute("hint") || "", s = this.getAttribute("error") || "", a = i ? `${this._id}-hint` : "", r = s ? `${this._id}-error` : "", l = [a, r].filter(Boolean).join(" ");
4007
- l ? this.setAttribute("aria-describedby", l) : this.removeAttribute("aria-describedby"), e.innerHTML = `
4008
- <style>${ze}</style>
4125
+ const t = this.shadowRoot, e = this.getAttribute("legend") || "", i = this.getAttribute("hint") || "", s = this.getAttribute("error") || "", a = i ? `${this._id}-hint` : "", r = s ? `${this._id}-error` : "", l = [a, r].filter(Boolean).join(" ");
4126
+ l ? this.setAttribute("aria-describedby", l) : this.removeAttribute("aria-describedby"), t.innerHTML = `
4127
+ <style>${qt}</style>
4009
4128
  <fieldset part="fieldset">
4010
- ${t ? `<legend part="legend">${t}${this._required ? '<span class="radio-group-required" aria-hidden="true"> *</span>' : ""}</legend>` : ""}
4129
+ ${e ? `<legend part="legend">${e}${this._required ? '<span class="radio-group-required" aria-hidden="true"> *</span>' : ""}</legend>` : ""}
4011
4130
  <div class="radio-group-items" part="items">
4012
4131
  <slot></slot>
4013
4132
  </div>
@@ -4017,13 +4136,13 @@ class Q extends c {
4017
4136
  `;
4018
4137
  }
4019
4138
  setupEventListeners() {
4020
- var t;
4139
+ var e;
4021
4140
  this.addEventListener("keydown", this.handleKeyDown), this.addEventListener(
4022
4141
  "radio-select",
4023
4142
  this.handleRadioSelect
4024
4143
  );
4025
- const e = (t = this.shadowRoot) == null ? void 0 : t.querySelector("slot");
4026
- e && e.addEventListener("slotchange", () => {
4144
+ const t = (e = this.shadowRoot) == null ? void 0 : e.querySelector("slot");
4145
+ t && t.addEventListener("slotchange", () => {
4027
4146
  this.syncRadioStates();
4028
4147
  });
4029
4148
  }
@@ -4039,23 +4158,23 @@ class Q extends c {
4039
4158
  }
4040
4159
  getEnabledRadios() {
4041
4160
  return this.getRadios().filter(
4042
- (e) => !e.disabled && !this._disabled
4161
+ (t) => !t.disabled && !this._disabled
4043
4162
  );
4044
4163
  }
4045
4164
  syncRadioStates() {
4046
- const e = this.getRadios(), t = this.getEnabledRadios();
4047
- e.forEach((i) => {
4165
+ const t = this.getRadios(), e = this.getEnabledRadios();
4166
+ t.forEach((i) => {
4048
4167
  const s = i.value === this._value;
4049
- i.checked = s, s || !this._value && t[0] === i ? i.setAttribute("tabindex", "0") : i.setAttribute("tabindex", "-1");
4168
+ i.checked = s, s || !this._value && e[0] === i ? i.setAttribute("tabindex", "0") : i.setAttribute("tabindex", "-1");
4050
4169
  });
4051
4170
  }
4052
- selectRadio(e) {
4053
- this._disabled || (this._value = e, this.setAttribute("value", e), this.syncRadioStates(), this.hasAttribute("aria-invalid") && this.removeAttribute("aria-invalid"), this.emit("change", { value: e }), this.emit("a11y-radiogroup-change", { value: e }));
4171
+ selectRadio(t) {
4172
+ this._disabled || (this._value = t, this.setAttribute("value", t), this.syncRadioStates(), this.hasAttribute("aria-invalid") && this.removeAttribute("aria-invalid"), this.emit("change", { value: t }), this.emit("a11y-radiogroup-change", { value: t }));
4054
4173
  }
4055
4174
  // ===== Attribute Changes =====
4056
- attributeChangedCallback(e, t, i) {
4057
- if (t !== i)
4058
- switch (e) {
4175
+ attributeChangedCallback(t, e, i) {
4176
+ if (e !== i)
4177
+ switch (t) {
4059
4178
  case "value":
4060
4179
  this._value = i || "", this.syncRadioStates();
4061
4180
  break;
@@ -4084,11 +4203,11 @@ class Q extends c {
4084
4203
  }
4085
4204
  }
4086
4205
  }
4087
- class Z extends c {
4206
+ class et extends d {
4088
4207
  constructor() {
4089
- super(...arguments), this._value = "", this._checked = !1, this._disabled = !1, this._discoverable = !0, this.handleClick = (e) => {
4208
+ super(...arguments), this._value = "", this._checked = !1, this._disabled = !1, this._discoverable = !0, this.handleClick = (t) => {
4090
4209
  if (this._disabled) {
4091
- e.preventDefault();
4210
+ t.preventDefault();
4092
4211
  return;
4093
4212
  }
4094
4213
  this.dispatchEvent(
@@ -4098,19 +4217,19 @@ class Z extends c {
4098
4217
  composed: !0
4099
4218
  })
4100
4219
  );
4101
- const t = this.getAttribute("label") || this._value;
4102
- p(`${t} selected`);
4103
- }, this.handleKeyDown = (e) => {
4104
- if (!this._disabled && e.key === "Enter") {
4105
- e.preventDefault(), this.dispatchEvent(
4220
+ const e = this.getAttribute("label") || this._value;
4221
+ p(`${e} selected`);
4222
+ }, this.handleKeyDown = (t) => {
4223
+ if (!this._disabled && t.key === "Enter") {
4224
+ t.preventDefault(), this.dispatchEvent(
4106
4225
  new CustomEvent("radio-select", {
4107
4226
  detail: { value: this._value },
4108
4227
  bubbles: !0,
4109
4228
  composed: !0
4110
4229
  })
4111
4230
  );
4112
- const t = this.getAttribute("label") || this._value;
4113
- p(`${t} selected`);
4231
+ const e = this.getAttribute("label") || this._value;
4232
+ p(`${e} selected`);
4114
4233
  }
4115
4234
  };
4116
4235
  }
@@ -4121,41 +4240,41 @@ class Z extends c {
4121
4240
  get value() {
4122
4241
  return this._value;
4123
4242
  }
4124
- set value(e) {
4125
- this._value = e, this.setAttribute("value", e);
4243
+ set value(t) {
4244
+ this._value = t, this.setAttribute("value", t);
4126
4245
  }
4127
4246
  get checked() {
4128
4247
  return this._checked;
4129
4248
  }
4130
- set checked(e) {
4131
- const t = !!e;
4132
- this._checked !== t && (this._checked = t, t ? this.setAttribute("checked", "") : this.removeAttribute("checked"), this.setAttribute("aria-checked", String(t)), this.updateVisual());
4249
+ set checked(t) {
4250
+ const e = !!t;
4251
+ this._checked !== e && (this._checked = e, e ? this.setAttribute("checked", "") : this.removeAttribute("checked"), this.setAttribute("aria-checked", String(e)), this.updateVisual());
4133
4252
  }
4134
4253
  get disabled() {
4135
4254
  return this._disabled;
4136
4255
  }
4137
- set disabled(e) {
4138
- const t = !!e;
4139
- this._disabled !== t && (this._disabled = t, t ? (this.setAttribute("disabled", ""), this.setAttribute("aria-disabled", "true")) : (this.removeAttribute("disabled"), this.removeAttribute("aria-disabled")));
4256
+ set disabled(t) {
4257
+ const e = !!t;
4258
+ this._disabled !== e && (this._disabled = e, e ? (this.setAttribute("disabled", ""), this.setAttribute("aria-disabled", "true")) : (this.removeAttribute("disabled"), this.removeAttribute("aria-disabled")));
4140
4259
  }
4141
4260
  get discoverable() {
4142
4261
  return this._discoverable;
4143
4262
  }
4144
- set discoverable(e) {
4145
- let t;
4146
- typeof e == "string" ? t = e !== "false" && e !== "0" : t = !!e, this._discoverable !== t && (this._discoverable = t, t ? this.setAttribute("discoverable", "") : this.removeAttribute("discoverable"));
4263
+ set discoverable(t) {
4264
+ let e;
4265
+ typeof t == "string" ? e = t !== "false" && t !== "0" : e = !!t, this._discoverable !== e && (this._discoverable = e, e ? this.setAttribute("discoverable", "") : this.removeAttribute("discoverable"));
4147
4266
  }
4148
4267
  // ===== Lifecycle =====
4149
4268
  setupAccessibility() {
4150
4269
  this.setAttribute("role", "radio"), this.setAttribute("aria-checked", "false"), this._value = this.getAttribute("value") || "", this._checked = this.hasAttribute("checked"), this._disabled = this.hasAttribute("disabled"), this._checked && this.setAttribute("aria-checked", "true"), this._disabled && this.setAttribute("aria-disabled", "true");
4151
- const e = this.getAttribute("discoverable");
4152
- (e === "false" || e === "0") && (this._discoverable = !1), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "-1");
4270
+ const t = this.getAttribute("discoverable");
4271
+ (t === "false" || t === "0") && (this._discoverable = !1), this.hasAttribute("tabindex") || this.setAttribute("tabindex", "-1");
4153
4272
  }
4154
4273
  render() {
4155
4274
  this.shadowRoot || this.attachShadow({ mode: "open" });
4156
- const e = this.shadowRoot, t = this.getAttribute("label") || "", i = this.getAttribute("hint") || "", s = t ? `${this._id}-label` : "", a = i ? `${this._id}-hint` : "";
4157
- s && this.setAttribute("aria-labelledby", s), a && this.setAttribute("aria-describedby", a), e.innerHTML = `
4158
- <style>${qe}</style>
4275
+ const t = this.shadowRoot, e = this.getAttribute("label") || "", i = this.getAttribute("hint") || "", s = e ? `${this._id}-label` : "", a = i ? `${this._id}-hint` : "";
4276
+ s && this.setAttribute("aria-labelledby", s), a && this.setAttribute("aria-describedby", a), t.innerHTML = `
4277
+ <style>${Ot}</style>
4159
4278
  <div class="radio-wrapper" part="wrapper">
4160
4279
  <div class="radio-control" part="control">
4161
4280
  <input
@@ -4169,8 +4288,8 @@ class Z extends c {
4169
4288
  <div class="radio-dot" part="dot" aria-hidden="true"></div>
4170
4289
  </div>
4171
4290
  </div>
4172
- ${t || i ? `<div class="radio-content">
4173
- ${t ? `<span class="radio-label" id="${s}" part="label">${t}</span>` : ""}
4291
+ ${e || i ? `<div class="radio-content">
4292
+ ${e ? `<span class="radio-label" id="${s}" part="label">${e}</span>` : ""}
4174
4293
  ${i ? `<span class="radio-hint" id="${a}" part="hint">${i}</span>` : ""}
4175
4294
  </div>` : ""}
4176
4295
  <slot></slot>
@@ -4186,17 +4305,17 @@ class Z extends c {
4186
4305
  // ===== Visual Update =====
4187
4306
  updateVisual() {
4188
4307
  if (!this.shadowRoot) return;
4189
- const e = this.shadowRoot.querySelector(".radio-dot");
4190
- e && (e.style.opacity = this._checked ? "1" : "0", e.style.transform = this._checked ? "scale(1)" : "scale(0)");
4191
- const t = this.shadowRoot.querySelector(
4308
+ const t = this.shadowRoot.querySelector(".radio-dot");
4309
+ t && (t.style.opacity = this._checked ? "1" : "0", t.style.transform = this._checked ? "scale(1)" : "scale(0)");
4310
+ const e = this.shadowRoot.querySelector(
4192
4311
  ".radio-circle"
4193
4312
  );
4194
- t && (this._checked ? (t.style.background = "var(--compa11y-radio-checked-bg, #0066cc)", t.style.borderColor = "var(--compa11y-radio-checked-border, #0066cc)") : (t.style.background = "var(--compa11y-radio-bg, white)", t.style.borderColor = ""));
4313
+ e && (this._checked ? (e.style.background = "var(--compa11y-radio-checked-bg, #0066cc)", e.style.borderColor = "var(--compa11y-radio-checked-border, #0066cc)") : (e.style.background = "var(--compa11y-radio-bg, white)", e.style.borderColor = ""));
4195
4314
  }
4196
4315
  // ===== Attribute Changes =====
4197
- attributeChangedCallback(e, t, i) {
4198
- if (t !== i)
4199
- switch (e) {
4316
+ attributeChangedCallback(t, e, i) {
4317
+ if (e !== i)
4318
+ switch (t) {
4200
4319
  case "value":
4201
4320
  this._value = i || "";
4202
4321
  break;
@@ -4216,93 +4335,233 @@ class Z extends c {
4216
4335
  }
4217
4336
  }
4218
4337
  }
4219
- u("a11y-radio-group", Q);
4220
- u("a11y-radio", Z);
4338
+ c("a11y-radio-group", tt);
4339
+ c("a11y-radio", et);
4340
+ class it extends d {
4341
+ constructor() {
4342
+ super(...arguments), this._toasts = [], this._counter = 0, this._containerEl = null, this._maxToasts = 5, this._handleClick = (t) => {
4343
+ var a;
4344
+ const e = t.target, i = e.getAttribute("data-close-id");
4345
+ if (i) {
4346
+ this.remove(i);
4347
+ return;
4348
+ }
4349
+ const s = e.getAttribute("data-action-id");
4350
+ if (s) {
4351
+ const r = this._toasts.find((l) => l.id === s);
4352
+ (a = r == null ? void 0 : r.action) == null || a.onClick(), this.remove(s);
4353
+ }
4354
+ };
4355
+ }
4356
+ static get observedAttributes() {
4357
+ return ["position", "duration", "max-toasts", "label"];
4358
+ }
4359
+ get position() {
4360
+ return this.getAttribute("position") || "bottom-right";
4361
+ }
4362
+ get duration() {
4363
+ const t = this.getAttribute("duration");
4364
+ return t ? parseInt(t, 10) : 5e3;
4365
+ }
4366
+ get maxToasts() {
4367
+ const t = this.getAttribute("max-toasts");
4368
+ return t ? parseInt(t, 10) : 5;
4369
+ }
4370
+ get label() {
4371
+ return this.getAttribute("label") || "Notifications";
4372
+ }
4373
+ setupAccessibility() {
4374
+ }
4375
+ render() {
4376
+ const t = this.attachShadow({ mode: "open" });
4377
+ t.innerHTML = `
4378
+ <style>${Rt}</style>
4379
+ <div
4380
+ class="toast-container"
4381
+ role="region"
4382
+ aria-label="${this.label}"
4383
+ aria-live="polite"
4384
+ aria-relevant="additions removals"
4385
+ ></div>
4386
+ `, this._containerEl = t.querySelector(".toast-container");
4387
+ }
4388
+ setupEventListeners() {
4389
+ var t;
4390
+ (t = this._containerEl) == null || t.addEventListener("click", this._handleClick);
4391
+ }
4392
+ cleanupEventListeners() {
4393
+ var t;
4394
+ (t = this._containerEl) == null || t.removeEventListener("click", this._handleClick);
4395
+ for (const e of this._toasts)
4396
+ e.timerId && clearTimeout(e.timerId);
4397
+ this._toasts = [];
4398
+ }
4399
+ onAttributeChange(t, e, i) {
4400
+ t === "max-toasts" && i && (this._maxToasts = parseInt(i, 10)), t === "label" && this._containerEl && this._containerEl.setAttribute("aria-label", i || "Notifications");
4401
+ }
4402
+ // ---------------------------------------------------------------------------
4403
+ // Public API
4404
+ // ---------------------------------------------------------------------------
4405
+ /**
4406
+ * Add a toast notification. Returns the toast ID.
4407
+ */
4408
+ add(t) {
4409
+ const e = `toast-${++this._counter}`, i = t.duration ?? this.duration, s = {
4410
+ id: e,
4411
+ type: t.type || "info",
4412
+ title: t.title,
4413
+ description: t.description,
4414
+ duration: i,
4415
+ action: t.action,
4416
+ timerId: null,
4417
+ remaining: i,
4418
+ startTime: Date.now()
4419
+ };
4420
+ for (this._toasts.push(s); this._toasts.length > this._maxToasts; ) {
4421
+ const a = this._toasts.shift();
4422
+ a && (a.timerId && clearTimeout(a.timerId), this._removeElement(a.id));
4423
+ }
4424
+ return this._renderToast(s), this._startTimer(s), this.emit("a11y-toast-add", { id: e, ...t }), e;
4425
+ }
4426
+ /**
4427
+ * Remove a toast by ID.
4428
+ */
4429
+ remove(t) {
4430
+ const e = this._toasts.findIndex((s) => s.id === t);
4431
+ if (e === -1) return;
4432
+ const i = this._toasts[e];
4433
+ i.timerId && clearTimeout(i.timerId), this._toasts.splice(e, 1), this._removeElement(t), this.emit("a11y-toast-remove", { id: t });
4434
+ }
4435
+ /**
4436
+ * Remove all toasts.
4437
+ */
4438
+ clear() {
4439
+ for (const t of this._toasts)
4440
+ t.timerId && clearTimeout(t.timerId);
4441
+ this._toasts = [], this._containerEl && (this._containerEl.innerHTML = "");
4442
+ }
4443
+ // ---------------------------------------------------------------------------
4444
+ // Internal
4445
+ // ---------------------------------------------------------------------------
4446
+ _renderToast(t) {
4447
+ if (!this._containerEl) return;
4448
+ const e = t.type === "error" || t.type === "warning", i = document.createElement("div");
4449
+ i.className = "toast", i.setAttribute("data-toast-id", t.id), i.setAttribute("data-type", t.type), i.setAttribute("role", e ? "alert" : "status"), i.setAttribute("aria-atomic", "true"), i.setAttribute("tabindex", "0");
4450
+ let s = '<div class="toast-content">';
4451
+ t.title && (s += `<div class="toast-title">${this._escapeHtml(t.title)}</div>`), t.description && (s += `<div class="toast-description">${this._escapeHtml(t.description)}</div>`), t.action && (s += `<button type="button" class="toast-action" data-action-id="${t.id}" tabindex="0">${this._escapeHtml(t.action.label)}</button>`), s += "</div>", s += `<button type="button" class="toast-close" aria-label="Dismiss" data-close-id="${t.id}" tabindex="0">×</button>`, i.innerHTML = s, i.addEventListener("mouseenter", () => this._pauseTimer(t)), i.addEventListener("mouseleave", () => this._resumeTimer(t)), i.addEventListener("keydown", (a) => {
4452
+ a.key === "Escape" && this.remove(t.id);
4453
+ }), this._containerEl.appendChild(i);
4454
+ }
4455
+ _removeElement(t) {
4456
+ var i;
4457
+ const e = (i = this._containerEl) == null ? void 0 : i.querySelector(
4458
+ `[data-toast-id="${t}"]`
4459
+ );
4460
+ e == null || e.remove();
4461
+ }
4462
+ _startTimer(t) {
4463
+ t.duration !== 0 && (t.startTime = Date.now(), t.timerId = setTimeout(() => {
4464
+ this.remove(t.id);
4465
+ }, t.remaining));
4466
+ }
4467
+ _pauseTimer(t) {
4468
+ t.timerId && (clearTimeout(t.timerId), t.timerId = null, t.remaining -= Date.now() - t.startTime);
4469
+ }
4470
+ _resumeTimer(t) {
4471
+ this._startTimer(t);
4472
+ }
4473
+ _escapeHtml(t) {
4474
+ const e = document.createElement("div");
4475
+ return e.textContent = t, e.innerHTML;
4476
+ }
4477
+ }
4478
+ c("a11y-toast", it);
4221
4479
  if (typeof window < "u") {
4222
4480
  const n = () => {
4223
- R(), T();
4481
+ B(), H();
4224
4482
  };
4225
4483
  document.readyState === "loading" ? document.addEventListener("DOMContentLoaded", n) : n(), window.compa11y = {
4226
4484
  // Components (classes)
4227
- A11yDialog: M,
4228
- A11yMenu: K,
4229
- A11yTabs: F,
4230
- A11yCombobox: N,
4231
- A11ySwitch: P,
4232
- A11ySelect: j,
4233
- A11yInput: U,
4234
- A11yTextarea: Y,
4235
- A11yButton: G,
4236
- A11yListbox: W,
4237
- A11yOption: V,
4238
- A11yOptgroup: X,
4239
- A11yCheckbox: O,
4240
- A11yCheckboxGroup: J,
4241
- A11yRadioGroup: Q,
4242
- A11yRadio: Z,
4485
+ A11yDialog: N,
4486
+ A11yMenu: F,
4487
+ A11yTabs: P,
4488
+ A11yCombobox: j,
4489
+ A11ySwitch: U,
4490
+ A11ySelect: Y,
4491
+ A11yInput: G,
4492
+ A11yTextarea: V,
4493
+ A11yButton: X,
4494
+ A11yListbox: Q,
4495
+ A11yOption: J,
4496
+ A11yOptgroup: W,
4497
+ A11yCheckbox: R,
4498
+ A11yCheckboxGroup: Z,
4499
+ A11yRadioGroup: tt,
4500
+ A11yRadio: et,
4501
+ A11yToast: it,
4243
4502
  // Announcer utilities
4244
- initAnnouncer: R,
4503
+ initAnnouncer: B,
4245
4504
  announce: v,
4246
4505
  announcePolite: p,
4247
- announceAssertive: D,
4248
- announceStatus: ge,
4249
- announceError: pe,
4506
+ announceAssertive: O,
4507
+ announceStatus: ft,
4508
+ announceError: vt,
4250
4509
  // Focus utilities
4251
- initFocusVisible: T,
4252
- createFocusTrap: be,
4253
- createFocusScope: ue,
4254
- createRovingTabindex: ce,
4510
+ initFocusVisible: H,
4511
+ createFocusTrap: gt,
4512
+ createFocusScope: mt,
4513
+ createRovingTabindex: pt,
4255
4514
  // Keyboard utilities
4256
- createKeyboardManager: de,
4257
- KeyboardPatterns: he,
4515
+ createKeyboardManager: bt,
4516
+ KeyboardPatterns: ut,
4258
4517
  createTypeAhead: q,
4259
4518
  // ARIA utilities
4260
- aria: ne,
4261
- buildAriaProps: le,
4262
- hasAccessibleName: oe,
4519
+ aria: ct,
4520
+ buildAriaProps: dt,
4521
+ hasAccessibleName: ht,
4263
4522
  // Platform detection
4264
- isBrowser: re,
4265
- prefersReducedMotion: ae,
4266
- prefersHighContrast: se,
4267
- prefersDarkMode: ie
4523
+ isBrowser: nt,
4524
+ prefersReducedMotion: lt,
4525
+ prefersHighContrast: ot,
4526
+ prefersDarkMode: rt
4268
4527
  };
4269
4528
  }
4270
4529
  export {
4271
- G as A11yButton,
4272
- O as A11yCheckbox,
4273
- J as A11yCheckboxGroup,
4274
- N as A11yCombobox,
4275
- M as A11yDialog,
4276
- U as A11yInput,
4277
- W as A11yListbox,
4278
- K as A11yMenu,
4279
- X as A11yOptgroup,
4280
- V as A11yOption,
4281
- Z as A11yRadio,
4282
- Q as A11yRadioGroup,
4283
- j as A11ySelect,
4284
- P as A11ySwitch,
4285
- F as A11yTabs,
4286
- Y as A11yTextarea,
4287
- He as KeyboardPatterns,
4288
- Me as announce,
4289
- Ke as announceAssertive,
4290
- Fe as announceError,
4291
- Ne as announcePolite,
4292
- Pe as announceStatus,
4293
- je as aria,
4294
- Ue as buildAriaProps,
4295
- Ye as createFocusScope,
4296
- Ge as createFocusTrap,
4297
- Xe as createKeyboardManager,
4298
- Ve as createRovingTabindex,
4299
- We as createTypeAhead,
4300
- Je as hasAccessibleName,
4301
- Qe as initAnnouncer,
4302
- Ze as initFocusVisible,
4303
- et as isBrowser,
4304
- tt as prefersDarkMode,
4305
- it as prefersHighContrast,
4306
- st as prefersReducedMotion
4530
+ X as A11yButton,
4531
+ R as A11yCheckbox,
4532
+ Z as A11yCheckboxGroup,
4533
+ j as A11yCombobox,
4534
+ N as A11yDialog,
4535
+ G as A11yInput,
4536
+ Q as A11yListbox,
4537
+ F as A11yMenu,
4538
+ W as A11yOptgroup,
4539
+ J as A11yOption,
4540
+ et as A11yRadio,
4541
+ tt as A11yRadioGroup,
4542
+ Y as A11ySelect,
4543
+ U as A11ySwitch,
4544
+ P as A11yTabs,
4545
+ V as A11yTextarea,
4546
+ it as A11yToast,
4547
+ jt as KeyboardPatterns,
4548
+ Ut as announce,
4549
+ Yt as announceAssertive,
4550
+ Gt as announceError,
4551
+ Vt as announcePolite,
4552
+ Xt as announceStatus,
4553
+ Wt as aria,
4554
+ Jt as buildAriaProps,
4555
+ Qt as createFocusScope,
4556
+ Zt as createFocusTrap,
4557
+ te as createKeyboardManager,
4558
+ ee as createRovingTabindex,
4559
+ ie as createTypeAhead,
4560
+ se as hasAccessibleName,
4561
+ ae as initAnnouncer,
4562
+ re as initFocusVisible,
4563
+ oe as isBrowser,
4564
+ le as prefersDarkMode,
4565
+ ne as prefersHighContrast,
4566
+ he as prefersReducedMotion
4307
4567
  };
4308
- //# sourceMappingURL=compa11y.js.map