@redvars/peacock 3.3.1 → 3.3.3

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 (93) hide show
  1. package/dist/{IndividualComponent-tDnXrOLV.js → IndividualComponent-Dt5xirYG.js} +2 -2
  2. package/dist/{IndividualComponent-tDnXrOLV.js.map → IndividualComponent-Dt5xirYG.js.map} +1 -1
  3. package/dist/array-D5vjT2Xm.js +14 -0
  4. package/dist/array-D5vjT2Xm.js.map +1 -0
  5. package/dist/{button-trIfcqC7.js → button-ClzS8JLq.js} +3 -3
  6. package/dist/{button-trIfcqC7.js.map → button-ClzS8JLq.js.map} +1 -1
  7. package/dist/{button-group-DA7xoziD.js → button-group-BMS5WvaF.js} +4 -4
  8. package/dist/{button-group-DA7xoziD.js.map → button-group-BMS5WvaF.js.map} +1 -1
  9. package/dist/button-group.js +4 -4
  10. package/dist/button.js +3 -3
  11. package/dist/card.js +104 -0
  12. package/dist/card.js.map +1 -0
  13. package/dist/chart-bar-DbnXQgvS.js +1121 -0
  14. package/dist/chart-bar-DbnXQgvS.js.map +1 -0
  15. package/dist/chart-bar.js +259 -0
  16. package/dist/chart-bar.js.map +1 -0
  17. package/dist/chart-donut.js +4 -2
  18. package/dist/chart-donut.js.map +1 -1
  19. package/dist/chart-doughnut.js +4 -2
  20. package/dist/chart-doughnut.js.map +1 -1
  21. package/dist/chart-pie.js +4 -2
  22. package/dist/chart-pie.js.map +1 -1
  23. package/dist/chart-stacked-bar.js +401 -0
  24. package/dist/chart-stacked-bar.js.map +1 -0
  25. package/dist/{class-map-hJdvjl-W.js → class-map-59YGWLnx.js} +2 -2
  26. package/dist/{class-map-hJdvjl-W.js.map → class-map-59YGWLnx.js.map} +1 -1
  27. package/dist/clock.js +1 -1
  28. package/dist/code-editor.js +3 -3
  29. package/dist/code-highlighter.js +3 -3
  30. package/dist/custom-elements-jsdocs.json +2308 -766
  31. package/dist/custom-elements.json +3908 -2601
  32. package/dist/index.js +16 -9
  33. package/dist/index.js.map +1 -1
  34. package/dist/number-counter.js +2 -2
  35. package/dist/{observe-theme-change-BISF-Gl5.js → observe-theme-change-pALI5fmV.js} +2 -2
  36. package/dist/{observe-theme-change-BISF-Gl5.js.map → observe-theme-change-pALI5fmV.js.map} +1 -1
  37. package/dist/peacock-loader.js +25 -526
  38. package/dist/peacock-loader.js.map +1 -1
  39. package/dist/pie-Dz0IDiPt.js +537 -0
  40. package/dist/pie-Dz0IDiPt.js.map +1 -0
  41. package/dist/{tree-view-CLolVlU0.js → radio-b70_Ie9n.js} +2216 -901
  42. package/dist/radio-b70_Ie9n.js.map +1 -0
  43. package/dist/src/card/card.d.ts +27 -0
  44. package/dist/src/card/index.d.ts +1 -0
  45. package/dist/src/chart-bar/chart-bar.d.ts +53 -0
  46. package/dist/src/chart-bar/chart-stacked-bar.d.ts +78 -0
  47. package/dist/src/chart-bar/index.d.ts +2 -0
  48. package/dist/src/index.d.ts +6 -0
  49. package/dist/src/menu/menu-item/menu-item.d.ts +1 -1
  50. package/dist/src/radio/index.d.ts +1 -0
  51. package/dist/src/radio/radio.d.ts +73 -0
  52. package/dist/src/snackbar/index.d.ts +1 -0
  53. package/dist/src/snackbar/snackbar.d.ts +40 -0
  54. package/dist/src/tabs/tab-group.d.ts +1 -1
  55. package/dist/src/tabs/tab-panel.d.ts +1 -0
  56. package/dist/src/tabs/tab.d.ts +2 -1
  57. package/dist/{style-map-CfNHEkQp.js → style-map-DcB52w-l.js} +2 -2
  58. package/dist/{style-map-CfNHEkQp.js.map → style-map-DcB52w-l.js.map} +1 -1
  59. package/dist/test/card.test.d.ts +1 -0
  60. package/dist/test/chart-bar.test.d.ts +1 -0
  61. package/dist/test/snackbar.test.d.ts +1 -0
  62. package/dist/{transform-DRuHEvar.js → transform-DSwFSqzD.js} +13 -558
  63. package/dist/transform-DSwFSqzD.js.map +1 -0
  64. package/dist/tsconfig.tsbuildinfo +1 -1
  65. package/dist/{unsafe-html-CV6Je6HL.js → unsafe-html-C2r3PyzF.js} +2 -2
  66. package/dist/{unsafe-html-CV6Je6HL.js.map → unsafe-html-C2r3PyzF.js.map} +1 -1
  67. package/package.json +1 -1
  68. package/readme.md +2 -2
  69. package/src/card/card.scss +61 -0
  70. package/src/card/card.ts +38 -0
  71. package/src/card/index.ts +1 -0
  72. package/src/chart-bar/chart-bar.scss +58 -0
  73. package/src/chart-bar/chart-bar.ts +306 -0
  74. package/src/chart-bar/chart-stacked-bar.ts +402 -0
  75. package/src/chart-bar/index.ts +2 -0
  76. package/src/index.ts +6 -0
  77. package/src/menu/menu-item/menu-item.ts +1 -1
  78. package/src/peacock-loader.ts +18 -0
  79. package/src/radio/index.ts +1 -0
  80. package/src/radio/radio.scss +181 -0
  81. package/src/radio/radio.ts +362 -0
  82. package/src/snackbar/demo/index.html +29 -0
  83. package/src/snackbar/index.ts +1 -0
  84. package/src/snackbar/snackbar.scss +73 -0
  85. package/src/snackbar/snackbar.ts +151 -0
  86. package/src/tabs/tab-group.ts +57 -28
  87. package/src/tabs/tab-panel.scss +3 -3
  88. package/src/tabs/tab-panel.ts +2 -0
  89. package/src/tabs/tab.scss +76 -2
  90. package/src/tabs/tab.ts +29 -7
  91. package/src/tabs/tabs.ts +15 -3
  92. package/dist/transform-DRuHEvar.js.map +0 -1
  93. package/dist/tree-view-CLolVlU0.js.map +0 -1
@@ -1,12 +1,12 @@
1
- import { i, _ as __decorate, n, a as i$1, b, A, c as __classPrivateFieldGet } from './IndividualComponent-tDnXrOLV.js';
2
- import { r, e as e$3 } from './class-map-hJdvjl-W.js';
1
+ import { a as i, _ as __decorate, n, i as i$1, b, A, c as __classPrivateFieldGet, w } from './IndividualComponent-Dt5xirYG.js';
2
+ import { r, e as e$3 } from './class-map-59YGWLnx.js';
3
3
  import { e as e$1 } from './directive-Cuw6h7YA.js';
4
- import { e as e$2, o as o$4 } from './unsafe-html-CV6Je6HL.js';
4
+ import { e as e$2, o as o$4 } from './unsafe-html-C2r3PyzF.js';
5
5
  import { c as createCacheFetch, s as sanitizeSvg, o as observerSlotChangesWithCallback, r as redispatchEvent, a as isDarkMode, i as isActivationClick, d as dispatchActivationClick, t as throttle } from './dispatch-event-utils-B4odODQf.js';
6
6
  import { a as e, e as e$4 } from './query-QBcUV-L_.js';
7
- import { o as o$3 } from './style-map-CfNHEkQp.js';
8
- import { B as BaseInput, o as observeThemeChange } from './observe-theme-change-BISF-Gl5.js';
9
- import { s as spread } from './button-trIfcqC7.js';
7
+ import { o as o$3 } from './style-map-DcB52w-l.js';
8
+ import { B as BaseInput, o as observeThemeChange } from './observe-theme-change-pALI5fmV.js';
9
+ import { s as spread } from './button-ClzS8JLq.js';
10
10
 
11
11
  /**
12
12
  * @license
@@ -39,7 +39,7 @@ async function fetchIcon(name, provider = 'material-symbols') {
39
39
  return fetchSVG(PROVIDERS[provider](name));
40
40
  }
41
41
 
42
- var css_248z$I = i`* {
42
+ var css_248z$L = i`* {
43
43
  box-sizing: border-box;
44
44
  }
45
45
 
@@ -168,7 +168,7 @@ class Icon extends i$1 {
168
168
  }
169
169
  }
170
170
  }
171
- Icon.styles = [css_248z$I];
171
+ Icon.styles = [css_248z$L];
172
172
  __decorate([
173
173
  n({ type: String, reflect: true })
174
174
  ], Icon.prototype, "name", void 0);
@@ -188,7 +188,7 @@ __decorate([
188
188
  r()
189
189
  ], Icon.prototype, "error", void 0);
190
190
 
191
- var css_248z$H = i`* {
191
+ var css_248z$K = i`* {
192
192
  box-sizing: border-box;
193
193
  }
194
194
 
@@ -279,7 +279,7 @@ class Avatar extends i$1 {
279
279
  return `${first.charAt(0)}${last.charAt(0)}`.toUpperCase();
280
280
  }
281
281
  }
282
- Avatar.styles = [css_248z$H];
282
+ Avatar.styles = [css_248z$K];
283
283
  __decorate([
284
284
  n({ type: String, reflect: true })
285
285
  ], Avatar.prototype, "name", void 0);
@@ -287,7 +287,7 @@ __decorate([
287
287
  n({ type: String, reflect: true })
288
288
  ], Avatar.prototype, "src", void 0);
289
289
 
290
- var css_248z$G = i`* {
290
+ var css_248z$J = i`* {
291
291
  box-sizing: border-box;
292
292
  }
293
293
 
@@ -359,12 +359,12 @@ class Badge extends i$1 {
359
359
  </div>`;
360
360
  }
361
361
  }
362
- Badge.styles = [css_248z$G];
362
+ Badge.styles = [css_248z$J];
363
363
  __decorate([
364
364
  n({ type: String })
365
365
  ], Badge.prototype, "value", void 0);
366
366
 
367
- var css_248z$F = i`* {
367
+ var css_248z$I = i`* {
368
368
  box-sizing: border-box;
369
369
  }
370
370
 
@@ -473,7 +473,7 @@ class Divider extends i$1 {
473
473
  </div>`;
474
474
  }
475
475
  }
476
- Divider.styles = [css_248z$F];
476
+ Divider.styles = [css_248z$I];
477
477
  __decorate([
478
478
  n({ type: Boolean, reflect: true })
479
479
  ], Divider.prototype, "vertical", void 0);
@@ -481,7 +481,7 @@ __decorate([
481
481
  r()
482
482
  ], Divider.prototype, "slotHasContent", void 0);
483
483
 
484
- var css_248z$E = i`/**
484
+ var css_248z$H = i`/**
485
485
  * Derived from Material Design Elevation
486
486
  * https://github.com/material-components/material-web/blob/main/elevation/internal/_elevation.scss
487
487
  */
@@ -554,9 +554,9 @@ class Elevation extends i$1 {
554
554
  return b `<span class="shadow"></span>`;
555
555
  }
556
556
  }
557
- Elevation.styles = [css_248z$E];
557
+ Elevation.styles = [css_248z$H];
558
558
 
559
- var css_248z$D = i`:host {
559
+ var css_248z$G = i`:host {
560
560
  display: none;
561
561
  pointer-events: none;
562
562
  position: absolute;
@@ -651,7 +651,7 @@ class FocusRing extends i$1 {
651
651
  this._control = undefined;
652
652
  }
653
653
  }
654
- FocusRing.styles = [css_248z$D];
654
+ FocusRing.styles = [css_248z$G];
655
655
  __decorate([
656
656
  n({ type: Boolean, reflect: true })
657
657
  ], FocusRing.prototype, "visible", void 0);
@@ -1112,7 +1112,7 @@ __decorate([
1112
1112
  e$4('.surface')
1113
1113
  ], Ripple.prototype, "mdRoot", void 0);
1114
1114
 
1115
- var css_248z$C = i`* {
1115
+ var css_248z$F = i`* {
1116
1116
  box-sizing: border-box;
1117
1117
  }
1118
1118
 
@@ -1282,7 +1282,7 @@ class AccordionItem extends i$1 {
1282
1282
  }
1283
1283
  }
1284
1284
  _AccordionItem_id = new WeakMap();
1285
- AccordionItem.styles = [css_248z$C];
1285
+ AccordionItem.styles = [css_248z$F];
1286
1286
  __decorate([
1287
1287
  n({ type: String, reflect: true })
1288
1288
  ], AccordionItem.prototype, "heading", void 0);
@@ -1296,7 +1296,7 @@ __decorate([
1296
1296
  e$4('.accordion-heading')
1297
1297
  ], AccordionItem.prototype, "buttonElement", void 0);
1298
1298
 
1299
- var css_248z$B = i`* {
1299
+ var css_248z$E = i`* {
1300
1300
  box-sizing: border-box;
1301
1301
  }
1302
1302
 
@@ -1415,7 +1415,7 @@ class Accordion extends i$1 {
1415
1415
  return b `<div class="accordion"><slot></slot></div>`;
1416
1416
  }
1417
1417
  }
1418
- Accordion.styles = [css_248z$B];
1418
+ Accordion.styles = [css_248z$E];
1419
1419
  Accordion.Item = AccordionItem;
1420
1420
  __decorate([
1421
1421
  n({ type: Boolean, attribute: 'allow-multiple' })
@@ -1424,7 +1424,7 @@ __decorate([
1424
1424
  o$2({ selector: 'p-accordion-item' })
1425
1425
  ], Accordion.prototype, "items", void 0);
1426
1426
 
1427
- var css_248z$A = i`* {
1427
+ var css_248z$D = i`* {
1428
1428
  box-sizing: border-box;
1429
1429
  }
1430
1430
 
@@ -1495,7 +1495,7 @@ class Link extends i$1 {
1495
1495
  </a>`;
1496
1496
  }
1497
1497
  }
1498
- Link.styles = [css_248z$A];
1498
+ Link.styles = [css_248z$D];
1499
1499
  __decorate([
1500
1500
  n({ reflect: true })
1501
1501
  ], Link.prototype, "href", void 0);
@@ -1506,7 +1506,7 @@ __decorate([
1506
1506
  r()
1507
1507
  ], Link.prototype, "tabIndexValue", void 0);
1508
1508
 
1509
- var css_248z$z = i`* {
1509
+ var css_248z$C = i`* {
1510
1510
  box-sizing: border-box;
1511
1511
  }
1512
1512
 
@@ -1643,7 +1643,7 @@ slot::slotted(*) {
1643
1643
  --_container-state-opacity: 0.08;
1644
1644
  }`;
1645
1645
 
1646
- var css_248z$y = i`:host([color=default]) {
1646
+ var css_248z$B = i`:host([color=default]) {
1647
1647
  --filled-tag-container-color: var(--color-surface);
1648
1648
  --filled-tag-label-text-color: var(--color-on-surface);
1649
1649
  --tonal-tag-container-color: var(--color-surface-container);
@@ -1709,7 +1709,7 @@ var css_248z$y = i`:host([color=default]) {
1709
1709
  --outlined-tag-label-text-color: var(--color-purple);
1710
1710
  }`;
1711
1711
 
1712
- var css_248z$x = i`.tag {
1712
+ var css_248z$A = i`.tag {
1713
1713
  font-family: var(--font-family-sans) !important;
1714
1714
  }
1715
1715
 
@@ -1808,7 +1808,7 @@ class Tag extends i$1 {
1808
1808
  }
1809
1809
  // Define styles (Lit handles Scoping via Shadow DOM by default)
1810
1810
  // You would typically import your tag.scss.js here or use the css tag
1811
- Tag.styles = [css_248z$z, css_248z$y, css_248z$x];
1811
+ Tag.styles = [css_248z$C, css_248z$B, css_248z$A];
1812
1812
  __decorate([
1813
1813
  n({ type: Boolean })
1814
1814
  ], Tag.prototype, "dismissible", void 0);
@@ -1822,7 +1822,7 @@ __decorate([
1822
1822
  n()
1823
1823
  ], Tag.prototype, "size", void 0);
1824
1824
 
1825
- var css_248z$w = i`* {
1825
+ var css_248z$z = i`* {
1826
1826
  box-sizing: border-box;
1827
1827
  }
1828
1828
 
@@ -1934,7 +1934,7 @@ var css_248z$w = i`* {
1934
1934
  color: var(--background);
1935
1935
  }`;
1936
1936
 
1937
- var css_248z$v = i`:host([color=red]) {
1937
+ var css_248z$y = i`:host([color=red]) {
1938
1938
  --chip-container-color: var(--color-red-container);
1939
1939
  --chip-outline-color: var(--color-on-red-container);
1940
1940
  }
@@ -1963,7 +1963,7 @@ var css_248z$v = i`:host([color=red]) {
1963
1963
  --chip-outline-color: var(--color-on-purple-container);
1964
1964
  }`;
1965
1965
 
1966
- var css_248z$u = i`.tag {
1966
+ var css_248z$x = i`.tag {
1967
1967
  font-family: var(--font-family-sans) !important;
1968
1968
  }
1969
1969
 
@@ -2101,7 +2101,7 @@ class Chip extends i$1 {
2101
2101
  }
2102
2102
  // Define styles (Lit handles Scoping via Shadow DOM by default)
2103
2103
  // You would typically import your tag.scss.js here or use the css tag
2104
- Chip.styles = [css_248z$w, css_248z$v, css_248z$u];
2104
+ Chip.styles = [css_248z$z, css_248z$y, css_248z$x];
2105
2105
  __decorate([
2106
2106
  n({ type: Boolean })
2107
2107
  ], Chip.prototype, "dismissible", void 0);
@@ -2118,7 +2118,7 @@ __decorate([
2118
2118
  n({ type: String })
2119
2119
  ], Chip.prototype, "imageSrc", void 0);
2120
2120
 
2121
- var css_248z$t = i`:host {
2121
+ var css_248z$w = i`:host {
2122
2122
  display: block;
2123
2123
  --progress-height: 0.25rem;
2124
2124
  --progress-container-color: var(--color-primary);
@@ -2324,9 +2324,9 @@ class LinearProgress extends BaseProgress {
2324
2324
  }
2325
2325
  }
2326
2326
  // Lit components use static styles for better performance
2327
- LinearProgress.styles = [css_248z$t];
2327
+ LinearProgress.styles = [css_248z$w];
2328
2328
 
2329
- var css_248z$s = i`:host {
2329
+ var css_248z$v = i`:host {
2330
2330
  display: inline-block;
2331
2331
  --progress-height: 1.5rem;
2332
2332
  --progress-line-thickness: 4px;
@@ -2489,9 +2489,9 @@ class CircularProgress extends BaseProgress {
2489
2489
  }
2490
2490
  }
2491
2491
  // Lit components use static styles for better performance
2492
- CircularProgress.styles = [css_248z$s];
2492
+ CircularProgress.styles = [css_248z$v];
2493
2493
 
2494
- var css_248z$r = i`:host {
2494
+ var css_248z$u = i`:host {
2495
2495
  --skeleton-container-color: var(--color-surface-container);
2496
2496
  --skeleton-element: var(--color-on-surface);
2497
2497
  display: inline-block;
@@ -2595,12 +2595,12 @@ class Skeleton extends i$1 {
2595
2595
  return b ` <div class="skeleton"></div>`;
2596
2596
  }
2597
2597
  }
2598
- Skeleton.styles = [css_248z$r];
2598
+ Skeleton.styles = [css_248z$u];
2599
2599
  __decorate([
2600
2600
  n({ type: Boolean, reflect: true })
2601
2601
  ], Skeleton.prototype, "visible", void 0);
2602
2602
 
2603
- var css_248z$q = i`* {
2603
+ var css_248z$t = i`* {
2604
2604
  box-sizing: border-box;
2605
2605
  }
2606
2606
 
@@ -2773,7 +2773,7 @@ class Input extends BaseInput {
2773
2773
  `;
2774
2774
  }
2775
2775
  }
2776
- Input.styles = [css_248z$q];
2776
+ Input.styles = [css_248z$t];
2777
2777
  __decorate([
2778
2778
  n({ type: String })
2779
2779
  ], Input.prototype, "value", void 0);
@@ -2832,7 +2832,7 @@ __decorate([
2832
2832
  e$4('.input-element')
2833
2833
  ], Input.prototype, "inputElement", void 0);
2834
2834
 
2835
- var css_248z$p = i`* {
2835
+ var css_248z$s = i`* {
2836
2836
  box-sizing: border-box;
2837
2837
  }
2838
2838
 
@@ -3200,7 +3200,7 @@ class Field extends i$1 {
3200
3200
  return b `<div class="text-count">${this.textCount}</div>`;
3201
3201
  }
3202
3202
  }
3203
- Field.styles = [css_248z$p];
3203
+ Field.styles = [css_248z$s];
3204
3204
  __decorate([
3205
3205
  n({ type: String })
3206
3206
  ], Field.prototype, "label", void 0);
@@ -3256,7 +3256,7 @@ __decorate([
3256
3256
  r()
3257
3257
  ], Field.prototype, "slotEndHasContent", void 0);
3258
3258
 
3259
- var css_248z$o = i`* {
3259
+ var css_248z$r = i`* {
3260
3260
  box-sizing: border-box;
3261
3261
  }
3262
3262
 
@@ -3453,7 +3453,7 @@ class NumberField extends BaseInput {
3453
3453
  }
3454
3454
  }
3455
3455
  _NumberField_id = new WeakMap();
3456
- NumberField.styles = [css_248z$o];
3456
+ NumberField.styles = [css_248z$r];
3457
3457
  __decorate([
3458
3458
  n({ type: Number })
3459
3459
  ], NumberField.prototype, "value", void 0);
@@ -3515,7 +3515,7 @@ __decorate([
3515
3515
  e$4('.input-element')
3516
3516
  ], NumberField.prototype, "inputElement", void 0);
3517
3517
 
3518
- var css_248z$n = i`* {
3518
+ var css_248z$q = i`* {
3519
3519
  box-sizing: border-box;
3520
3520
  }
3521
3521
 
@@ -3682,7 +3682,7 @@ class DatePicker extends BaseInput {
3682
3682
  `;
3683
3683
  }
3684
3684
  }
3685
- DatePicker.styles = [css_248z$n];
3685
+ DatePicker.styles = [css_248z$q];
3686
3686
  __decorate([
3687
3687
  n({ type: String })
3688
3688
  ], DatePicker.prototype, "value", void 0);
@@ -3738,7 +3738,7 @@ __decorate([
3738
3738
  e$4('.input-element')
3739
3739
  ], DatePicker.prototype, "inputElement", void 0);
3740
3740
 
3741
- var css_248z$m = i`* {
3741
+ var css_248z$p = i`* {
3742
3742
  box-sizing: border-box;
3743
3743
  }
3744
3744
 
@@ -3905,7 +3905,7 @@ class TimePicker extends BaseInput {
3905
3905
  `;
3906
3906
  }
3907
3907
  }
3908
- TimePicker.styles = [css_248z$m];
3908
+ TimePicker.styles = [css_248z$p];
3909
3909
  __decorate([
3910
3910
  n({ type: String })
3911
3911
  ], TimePicker.prototype, "value", void 0);
@@ -3961,7 +3961,7 @@ __decorate([
3961
3961
  e$4('.input-element')
3962
3962
  ], TimePicker.prototype, "inputElement", void 0);
3963
3963
 
3964
- var css_248z$l = i`* {
3964
+ var css_248z$o = i`* {
3965
3965
  box-sizing: border-box;
3966
3966
  }
3967
3967
 
@@ -4121,7 +4121,7 @@ class Textarea extends BaseInput {
4121
4121
  `;
4122
4122
  }
4123
4123
  }
4124
- Textarea.styles = [css_248z$l];
4124
+ Textarea.styles = [css_248z$o];
4125
4125
  __decorate([
4126
4126
  n({ type: String })
4127
4127
  ], Textarea.prototype, "value", void 0);
@@ -4180,7 +4180,7 @@ __decorate([
4180
4180
  e$4('.input-element')
4181
4181
  ], Textarea.prototype, "inputElement", void 0);
4182
4182
 
4183
- var css_248z$k = i`* {
4183
+ var css_248z$n = i`* {
4184
4184
  box-sizing: border-box;
4185
4185
  }
4186
4186
 
@@ -4521,7 +4521,7 @@ class Switch extends BaseInput {
4521
4521
  `;
4522
4522
  }
4523
4523
  }
4524
- Switch.styles = [css_248z$k];
4524
+ Switch.styles = [css_248z$n];
4525
4525
  __decorate([
4526
4526
  n({ type: Boolean })
4527
4527
  ], Switch.prototype, "value", void 0);
@@ -4565,7 +4565,7 @@ __decorate([
4565
4565
  e$4('.input-native')
4566
4566
  ], Switch.prototype, "nativeElement", void 0);
4567
4567
 
4568
- var css_248z$j = i`* {
4568
+ var css_248z$m = i`* {
4569
4569
  box-sizing: border-box;
4570
4570
  }
4571
4571
 
@@ -4574,210 +4574,515 @@ var css_248z$j = i`* {
4574
4574
  }
4575
4575
 
4576
4576
  :host {
4577
- display: inline-flex;
4578
- --spinner-track-color: var(--color-primary-container);
4579
- --spinner-shape-color: var(--color-primary);
4580
- --spinner-size: 4rem;
4577
+ display: inline-block;
4578
+ --checkbox-size: 18px;
4579
+ --checkbox-icon-size: 12px;
4580
+ --checkbox-selected-color: var(--color-primary);
4581
+ --checkbox-unselected-color: var(--color-on-surface-variant);
4582
+ --checkbox-checkmark-color: var(--color-on-primary);
4583
+ --checkbox-state-layer-size: 40px;
4584
+ --checkbox-disabled-opacity: 0.38;
4585
+ --checkbox-border-radius: 2px;
4581
4586
  }
4582
4587
 
4583
- .track {
4584
- width: var(--spinner-size);
4585
- height: var(--spinner-size);
4586
- background-color: var(--spinner-track-color);
4587
- border-radius: 50%;
4588
- display: flex;
4589
- justify-content: center;
4588
+ .checkbox {
4589
+ position: relative;
4590
+ display: inline-flex;
4590
4591
  align-items: center;
4592
+ cursor: pointer;
4593
+ user-select: none;
4594
+ vertical-align: middle;
4595
+ font-family: var(--typography-body-medium-font-family) !important;
4596
+ font-size: var(--typography-body-medium-font-size) !important;
4597
+ font-weight: var(--typography-body-medium-font-weight) !important;
4598
+ line-height: var(--typography-body-medium-line-height) !important;
4599
+ letter-spacing: var(--typography-body-medium-letter-spacing) !important;
4600
+ }
4601
+ .checkbox.has-content {
4602
+ gap: 8px;
4603
+ }
4604
+ .checkbox .input-native {
4605
+ position: absolute;
4606
+ width: 1px;
4607
+ height: 1px;
4608
+ padding: 0;
4609
+ margin: -1px;
4591
4610
  overflow: hidden;
4611
+ clip: rect(0, 0, 0, 0);
4612
+ border: 0;
4592
4613
  }
4593
-
4594
- .shape {
4595
- width: 100%;
4596
- height: 100%;
4597
- background-color: var(--spinner-shape-color);
4598
- animation: spinner-aniation 3s var(--easing-standard) infinite;
4614
+ .checkbox .container {
4615
+ position: relative;
4616
+ display: inline-flex;
4617
+ align-items: center;
4618
+ justify-content: center;
4619
+ width: var(--checkbox-state-layer-size);
4620
+ height: var(--checkbox-state-layer-size);
4621
+ cursor: inherit;
4622
+ outline: none;
4623
+ flex-shrink: 0;
4599
4624
  }
4600
-
4601
- @keyframes spinner-aniation {
4602
- 0%, 100% {
4603
- clip-path: inset(0% round 50%);
4604
- transform: rotate(0deg) scale(0.5);
4605
- }
4606
- 10% {
4607
- transform: scale(0.7);
4608
- }
4609
- 20% {
4610
- clip-path: inset(0% round 50%);
4611
- transform: rotate(72deg) scale(0.6, 0.3);
4612
- }
4613
- 30% {
4614
- transform: scale(0.5);
4615
- }
4616
- 40% {
4617
- clip-path: inset(0% round 12px);
4618
- transform: rotate(108deg) scale(0.3, 0.6);
4619
- }
4620
- 60% {
4621
- transform: scale(0.5);
4622
- }
4623
- 80% {
4624
- clip-path: inset(0% round 50%);
4625
- transform: rotate(72deg) scale(0.6, 0.3);
4626
- }
4627
- 90% {
4628
- transform: rotate(324deg) scale(0.4, 0.6);
4629
- }
4630
- }`;
4631
-
4632
- /**
4633
- * @label Spinner
4634
- * @tag wc-spinner
4635
- * @rawTag spinner
4636
- * @summary A spinner component that animates a circular shape.
4637
- * @cssprop --spinner-track-color - The color of the track.
4638
- * @cssprop --spinner-shape-color - The color of the shape.
4639
- * @tags display
4640
- *
4641
- * @example
4642
- * ```html
4643
- * <wc-spinner></wc-spinner>
4644
- * ```
4645
- */
4646
- class Spinner extends i$1 {
4647
- render() {
4648
- return b `
4649
- <div class="spinner track">
4650
- <div class="shape"></div>
4651
- </div>
4652
- `;
4653
- }
4625
+ .checkbox .state-layer {
4626
+ position: absolute;
4627
+ inset: 0;
4628
+ border-radius: 50%;
4629
+ opacity: 0;
4630
+ transition: opacity var(--duration-short2) var(--easing-standard);
4654
4631
  }
4655
- Spinner.styles = [css_248z$j];
4656
-
4657
- var css_248z$i = i`* {
4632
+ .checkbox .outline {
4633
+ position: absolute;
4634
+ width: var(--checkbox-size);
4635
+ height: var(--checkbox-size);
4636
+ border: 2px solid var(--checkbox-unselected-color);
4637
+ border-radius: var(--checkbox-border-radius);
4658
4638
  box-sizing: border-box;
4639
+ transition: border-color var(--duration-short2) var(--easing-standard);
4659
4640
  }
4660
-
4661
- .screen-reader-only {
4662
- display: none !important;
4641
+ .checkbox .background {
4642
+ position: absolute;
4643
+ width: var(--checkbox-size);
4644
+ height: var(--checkbox-size);
4645
+ background: var(--checkbox-selected-color);
4646
+ border-radius: var(--checkbox-border-radius);
4647
+ opacity: 0;
4648
+ transform: scale(0);
4649
+ transition: transform var(--duration-short2) var(--easing-standard), opacity var(--duration-short2) var(--easing-standard);
4663
4650
  }
4664
-
4665
- :host {
4666
- display: block;
4651
+ .checkbox .icon {
4652
+ position: absolute;
4653
+ width: var(--checkbox-icon-size);
4654
+ height: var(--checkbox-icon-size);
4655
+ fill: none;
4656
+ stroke: var(--checkbox-checkmark-color);
4657
+ stroke-width: 2;
4658
+ stroke-linecap: round;
4659
+ stroke-linejoin: round;
4660
+ opacity: 0;
4661
+ transition: opacity var(--duration-short1) var(--easing-standard);
4662
+ }
4663
+ .checkbox .icon .checkmark {
4664
+ stroke-dasharray: 14;
4665
+ stroke-dashoffset: 14;
4666
+ transition: stroke-dashoffset var(--duration-short4) var(--easing-emphasized);
4667
+ }
4668
+ .checkbox .icon .indeterminate {
4669
+ transform-origin: center;
4670
+ opacity: 0;
4671
+ transition: opacity var(--duration-short1) var(--easing-standard);
4672
+ }
4673
+ .checkbox .label {
4674
+ color: var(--color-on-surface);
4675
+ cursor: inherit;
4676
+ }
4677
+ .checkbox:hover:not(.disabled):not(.readonly) .state-layer {
4678
+ opacity: 0.08;
4679
+ background: var(--color-on-surface);
4680
+ }
4681
+ .checkbox:hover:not(.disabled):not(.readonly).state-checked .state-layer, .checkbox:hover:not(.disabled):not(.readonly).state-indeterminate .state-layer {
4682
+ background: var(--checkbox-selected-color);
4683
+ }
4684
+ .checkbox.has-focus:not(.active):not(.disabled):not(.readonly) .state-layer {
4685
+ opacity: 0.12;
4686
+ background: var(--color-on-surface);
4687
+ }
4688
+ .checkbox.has-focus:not(.active):not(.disabled):not(.readonly) .container {
4689
+ outline: 3px solid var(--color-primary);
4690
+ outline-offset: 2px;
4691
+ border-radius: 50%;
4692
+ }
4693
+ .checkbox.has-focus:not(.active):not(.disabled):not(.readonly).state-checked .state-layer, .checkbox.has-focus:not(.active):not(.disabled):not(.readonly).state-indeterminate .state-layer {
4694
+ background: var(--checkbox-selected-color);
4695
+ }
4696
+ .checkbox.active:not(.disabled):not(.readonly) .state-layer {
4697
+ opacity: 0.12;
4698
+ background: var(--color-on-surface);
4699
+ }
4700
+ .checkbox.active:not(.disabled):not(.readonly).state-checked .state-layer, .checkbox.active:not(.disabled):not(.readonly).state-indeterminate .state-layer {
4701
+ background: var(--checkbox-selected-color);
4702
+ }
4703
+ .checkbox.rounded {
4704
+ --checkbox-border-radius: 18px;
4667
4705
  }
4668
4706
 
4669
- .container-wrapper {
4670
- container: containerwrapper/inline-size;
4707
+ .checkbox.state-checked .outline {
4708
+ border-color: transparent;
4671
4709
  }
4672
- .container-wrapper.size-max .container {
4673
- max-width: var(--container-max);
4710
+ .checkbox.state-checked .background {
4711
+ opacity: 1;
4712
+ transform: scale(1);
4674
4713
  }
4675
- .container-wrapper.size-xl .container {
4676
- max-width: var(--container-xl);
4714
+ .checkbox.state-checked .icon {
4715
+ opacity: 1;
4677
4716
  }
4678
- .container-wrapper.size-sm .container {
4679
- max-width: var(--container-sm);
4717
+ .checkbox.state-checked .icon .checkmark {
4718
+ stroke-dashoffset: 0;
4680
4719
  }
4681
- .container-wrapper.size-md .container {
4682
- max-width: var(--container-md);
4720
+
4721
+ .checkbox.state-indeterminate .outline {
4722
+ border-color: transparent;
4683
4723
  }
4684
- .container-wrapper.size-lg .container {
4685
- max-width: var(--container-lg);
4724
+ .checkbox.state-indeterminate .background {
4725
+ opacity: 1;
4726
+ transform: scale(1);
4727
+ }
4728
+ .checkbox.state-indeterminate .icon {
4729
+ opacity: 1;
4730
+ fill: var(--checkbox-checkmark-color);
4731
+ }
4732
+ .checkbox.state-indeterminate .icon .indeterminate {
4733
+ opacity: 1;
4686
4734
  }
4687
4735
 
4688
- .container {
4689
- margin: auto;
4690
- width: 100%;
4736
+ .checkbox.size-sm {
4737
+ --checkbox-size: 16px;
4738
+ --checkbox-icon-size: 10px;
4739
+ --checkbox-state-layer-size: 36px;
4740
+ font-size: var(--font-size-body-small);
4741
+ line-height: var(--line-height-body-small);
4691
4742
  }
4692
- .container .content {
4693
- padding: var(--spacing-200);
4743
+ .checkbox.size-sm .icon {
4744
+ stroke-width: 1.5;
4694
4745
  }
4695
4746
 
4696
- :host(.debug) {
4697
- border-width: 0 1px;
4698
- border-color: var(--color-red);
4699
- border-style: solid;
4700
- background: var(--color-red-50);
4747
+ .checkbox.size-md {
4748
+ --checkbox-size: 18px;
4749
+ --checkbox-icon-size: 12px;
4750
+ --checkbox-state-layer-size: 40px;
4701
4751
  }
4702
- :host(.debug) .container {
4703
- border-width: 0 1px;
4704
- border-color: var(--color-blue);
4705
- border-style: solid;
4706
- background: var(--color-blue-100);
4752
+ .checkbox.size-md .icon {
4753
+ stroke-width: 2;
4707
4754
  }
4708
- :host(.debug) .container .content {
4709
- border-width: 0 1px;
4710
- border-color: var(--color-green);
4711
- border-style: solid;
4712
- background: var(--color-green-100);
4755
+
4756
+ .checkbox.size-lg {
4757
+ --checkbox-size: 24px;
4758
+ --checkbox-icon-size: 16px;
4759
+ --checkbox-state-layer-size: 48px;
4760
+ font-size: var(--font-size-body-large);
4761
+ line-height: var(--line-height-body-large);
4762
+ }
4763
+ .checkbox.size-lg .icon {
4764
+ stroke-width: 2.5;
4713
4765
  }
4714
4766
 
4715
- .content {
4716
- margin-inline: 0;
4767
+ .checkbox.readonly {
4768
+ cursor: default;
4769
+ }
4770
+ .checkbox.readonly .label {
4771
+ color: var(--color-on-surface);
4772
+ }
4773
+ .checkbox.readonly .outline {
4774
+ border-color: var(--color-on-surface-variant);
4775
+ }
4776
+ .checkbox.readonly.state-checked .background, .checkbox.readonly.state-indeterminate .background {
4777
+ background: var(--color-on-surface-variant);
4778
+ }
4779
+ .checkbox.readonly .state-layer {
4780
+ display: none;
4717
4781
  }
4718
4782
 
4719
- @container containerwrapper (min-width: 672px) {
4720
- .content {
4721
- margin-inline: var(--spacing-200);
4722
- }
4783
+ .checkbox.disabled {
4784
+ cursor: not-allowed;
4785
+ opacity: var(--checkbox-disabled-opacity);
4723
4786
  }
4724
- @container containerwrapper (min-width: 1056px) {
4725
- .content {
4726
- margin-inline: var(--spacing-200);
4727
- }
4787
+ .checkbox.disabled .label {
4788
+ color: var(--color-on-surface);
4728
4789
  }
4729
- @container containerwrapper (min-width: 1312px) {
4730
- .content {
4731
- margin-inline: var(--spacing-200);
4732
- }
4790
+ .checkbox.disabled .outline {
4791
+ border-color: var(--color-on-surface);
4733
4792
  }
4734
- @container containerwrapper (min-width: 1584px) {
4735
- .content {
4736
- margin-inline: var(--spacing-300);
4737
- }
4793
+ .checkbox.disabled.state-checked .background, .checkbox.disabled.state-indeterminate .background {
4794
+ background: var(--color-on-surface);
4795
+ }
4796
+ .checkbox.disabled .state-layer {
4797
+ display: none;
4738
4798
  }`;
4739
4799
 
4740
4800
  /**
4741
- * @label Container
4742
- * @tag wc-container
4743
- * @rawTag container
4744
- * @summary A responsive container component for layout.
4745
- * @cssprop --container-max-width - Controls the maximum width of the container.
4746
- * @cssprop --container-padding - Controls the padding of the container.
4747
- * @tags layout
4801
+ * @label Checkbox
4802
+ * @tag wc-checkbox
4803
+ * @rawTag checkbox
4804
+ * @summary Captures boolean input with an optional indeterminate mode.
4805
+ * @overview
4806
+ * <p>Checkboxes allow users to select one or more items from a set. Checkboxes can turn an option on or off.</p>
4807
+ * <p>Material Design 3 checkboxes feature a smooth animation and clear visual states for checked, unchecked, and indeterminate.</p>
4808
+ * @cssprop --checkbox-size: Size of the checkbox container.
4809
+ * @cssprop --checkbox-selected-color: Color of the checkbox when selected.
4810
+ * @cssprop --checkbox-unselected-color: Color of the checkbox border when unselected.
4811
+ * @cssprop --checkbox-checkmark-color: Color of the checkmark icon.
4812
+ * @cssprop --checkbox-state-layer-size: Size of the state layer for touch target.
4813
+ * @fires {CustomEvent} change - Dispatched when the checkbox value changes.
4814
+ * @fires {CustomEvent} blur - Dispatched when the checkbox loses focus.
4815
+ * @fires {CustomEvent} focus - Dispatched when the checkbox receives focus.
4816
+ * @tags input, form
4748
4817
  *
4749
4818
  * @example
4750
4819
  * ```html
4751
- * <wc-container size="lg">Content</wc-container>
4820
+ * <wc-checkbox label="Accept terms"></wc-checkbox>
4752
4821
  * ```
4753
4822
  */
4754
- class Container extends i$1 {
4823
+ class Checkbox extends i$1 {
4755
4824
  constructor() {
4756
4825
  super(...arguments);
4757
- this.size = 'full';
4758
- }
4759
- render() {
4760
- const wrapperClasses = {
4761
- 'container-wrapper': true,
4762
- [`size-${this.size}`]: true,
4763
- };
4764
- return b `
4765
- <div class=${e$3(wrapperClasses)}>
4766
- <div class="container">
4767
- <div class="content">
4768
- <slot></slot>
4769
- </div>
4826
+ /**
4827
+ * The input field name.
4828
+ */
4829
+ this.name = '';
4830
+ /**
4831
+ * The checkbox label.
4832
+ */
4833
+ this.label = '';
4834
+ /**
4835
+ * The input field value (checked state).
4836
+ */
4837
+ this.value = false;
4838
+ /**
4839
+ * If true, displays the checkbox in an indeterminate state.
4840
+ */
4841
+ this.indeterminate = false;
4842
+ /**
4843
+ * If true, the checkbox has rounded corners. Defaults to `false`.
4844
+ */
4845
+ this.rounded = false;
4846
+ /**
4847
+ * The checkbox size.
4848
+ * Possible values are: `"sm"`, `"md"`, `"lg"`. Defaults to `"md"`.
4849
+ */
4850
+ this.size = 'md';
4851
+ /**
4852
+ * If true, required icon is shown. Defaults to `false`.
4853
+ */
4854
+ this.required = false;
4855
+ /**
4856
+ * If true, the checkbox is readonly. Defaults to `false`.
4857
+ */
4858
+ this.readonly = false;
4859
+ /**
4860
+ * If true, the user cannot interact with the checkbox. Defaults to `false`.
4861
+ */
4862
+ this.disabled = false;
4863
+ /**
4864
+ * Configuration object for aria attributes.
4865
+ */
4866
+ this.configAria = {};
4867
+ this.hasFocus = false;
4868
+ this.isActive = false;
4869
+ this.slotHasContent = false;
4870
+ this.windowMouseUp = () => {
4871
+ if (this.isActive) {
4872
+ this.isActive = false;
4873
+ }
4874
+ };
4875
+ this.windowKeyUp = (evt) => {
4876
+ if (this.isActive && evt.key === ' ') {
4877
+ this.isActive = false;
4878
+ }
4879
+ };
4880
+ this.mouseDownHandler = () => {
4881
+ this.isActive = true;
4882
+ };
4883
+ this.keyDownHandler = (evt) => {
4884
+ if (evt.key === ' ') {
4885
+ evt.preventDefault();
4886
+ this.isActive = true;
4887
+ this.clickHandler(evt);
4888
+ }
4889
+ };
4890
+ this.clickHandler = (ev) => {
4891
+ if (!this.disabled && !this.readonly) {
4892
+ this.value = !this.value;
4893
+ this.indeterminate = false;
4894
+ this.dispatchEvent(new CustomEvent('change', {
4895
+ detail: { value: this.value, originalEvent: ev },
4896
+ bubbles: true,
4897
+ composed: true,
4898
+ }));
4899
+ this.containerElement?.focus();
4900
+ }
4901
+ };
4902
+ this.blurHandler = (ev) => {
4903
+ this.hasFocus = false;
4904
+ this.dispatchEvent(new CustomEvent('blur', {
4905
+ detail: ev,
4906
+ bubbles: true,
4907
+ composed: true,
4908
+ }));
4909
+ };
4910
+ this.focusHandler = (ev) => {
4911
+ this.hasFocus = true;
4912
+ this.dispatchEvent(new CustomEvent('focus', {
4913
+ detail: ev,
4914
+ bubbles: true,
4915
+ composed: true,
4916
+ }));
4917
+ };
4918
+ this.handleKeyUp = (evt) => {
4919
+ if (evt.key === 'Enter') {
4920
+ this.clickHandler(evt);
4921
+ }
4922
+ };
4923
+ }
4924
+ connectedCallback() {
4925
+ super.connectedCallback();
4926
+ this.handleInitialAttributes();
4927
+ window.addEventListener('mouseup', this.windowMouseUp);
4928
+ window.addEventListener('keyup', this.windowKeyUp);
4929
+ }
4930
+ disconnectedCallback() {
4931
+ super.disconnectedCallback();
4932
+ window.removeEventListener('mouseup', this.windowMouseUp);
4933
+ window.removeEventListener('keyup', this.windowKeyUp);
4934
+ }
4935
+ firstUpdated() {
4936
+ this.slotHasContent = this.hasChildNodes();
4937
+ }
4938
+ handleInitialAttributes() {
4939
+ if (this.hasAttribute('tabindex')) {
4940
+ this.tabindex = this.getAttribute('tabindex') || undefined;
4941
+ this.removeAttribute('tabindex');
4942
+ }
4943
+ Array.from(this.attributes).forEach(attr => {
4944
+ if (attr.name.startsWith('aria-')) {
4945
+ this.configAria[attr.name] = attr.value;
4946
+ this.removeAttribute(attr.name);
4947
+ }
4948
+ });
4949
+ }
4950
+ /**
4951
+ * Sets focus on the checkbox.
4952
+ */
4953
+ focus() {
4954
+ this.containerElement?.focus();
4955
+ }
4956
+ /**
4957
+ * Removes focus from the checkbox.
4958
+ */
4959
+ blur() {
4960
+ this.containerElement?.blur();
4961
+ }
4962
+ render() {
4963
+ const cssClasses = {
4964
+ checkbox: true,
4965
+ 'state-checked': this.value,
4966
+ 'state-indeterminate': !this.value && this.indeterminate,
4967
+ [`size-${this.size}`]: true,
4968
+ 'has-focus': this.hasFocus,
4969
+ active: this.isActive,
4970
+ disabled: this.disabled,
4971
+ readonly: this.readonly,
4972
+ required: this.required,
4973
+ rounded: this.rounded,
4974
+ 'has-content': this.slotHasContent,
4975
+ };
4976
+ return b `
4977
+ <label class=${e$3(cssClasses)}>
4978
+ <div
4979
+ class="container"
4980
+ tabindex=${this.tabindex || 0}
4981
+ @keyup=${this.handleKeyUp}
4982
+ @mousedown=${this.mouseDownHandler}
4983
+ @keydown=${this.keyDownHandler}
4984
+ @blur=${this.blurHandler}
4985
+ @focus=${this.focusHandler}
4986
+ role="checkbox"
4987
+ aria-disabled=${this.disabled}
4988
+ aria-required=${this.required}
4989
+ aria-checked=${this.value
4990
+ ? 'true'
4991
+ : this.indeterminate
4992
+ ? 'mixed'
4993
+ : 'false'}
4994
+ ${spread(this.configAria)}
4995
+ >
4996
+ <div class="state-layer"></div>
4997
+ <div class="outline"></div>
4998
+ <div class="background"></div>
4999
+ <svg class="icon" viewBox="0 0 12 12">
5000
+ ${this.value
5001
+ ? w `
5002
+ <path
5003
+ class="checkmark"
5004
+ d="M2 6L5 9L10 2"
5005
+ />
5006
+ `
5007
+ : this.indeterminate
5008
+ ? w `<rect
5009
+ class="indeterminate"
5010
+ x="2"
5011
+ y="5"
5012
+ width="8"
5013
+ height="2"
5014
+ />`
5015
+ : ''}
5016
+ </svg>
4770
5017
  </div>
4771
- </div>
5018
+
5019
+ <input
5020
+ type="checkbox"
5021
+ class="input-native"
5022
+ name=${this.name}
5023
+ .checked=${this.value}
5024
+ .indeterminate=${this.indeterminate}
5025
+ aria-hidden="true"
5026
+ ?required=${this.required}
5027
+ tabindex="-1"
5028
+ @click=${this.clickHandler}
5029
+ />
5030
+
5031
+ ${this.label
5032
+ ? b `<div class="label">${this.label}</div>`
5033
+ : b `<div class="label slot-container"><slot></slot></div>`}
5034
+ </label>
4772
5035
  `;
4773
5036
  }
4774
5037
  }
4775
- Container.styles = [css_248z$i];
5038
+ Checkbox.styles = [css_248z$m];
4776
5039
  __decorate([
4777
- n({ type: String, reflect: true })
4778
- ], Container.prototype, "size", void 0);
5040
+ n({ type: String })
5041
+ ], Checkbox.prototype, "name", void 0);
5042
+ __decorate([
5043
+ n({ type: String })
5044
+ ], Checkbox.prototype, "label", void 0);
5045
+ __decorate([
5046
+ n({ type: Boolean, reflect: true })
5047
+ ], Checkbox.prototype, "value", void 0);
5048
+ __decorate([
5049
+ n({ type: Boolean, reflect: true })
5050
+ ], Checkbox.prototype, "indeterminate", void 0);
5051
+ __decorate([
5052
+ n({ type: Boolean })
5053
+ ], Checkbox.prototype, "rounded", void 0);
5054
+ __decorate([
5055
+ n({ type: String })
5056
+ ], Checkbox.prototype, "size", void 0);
5057
+ __decorate([
5058
+ n({ type: Boolean, reflect: true })
5059
+ ], Checkbox.prototype, "required", void 0);
5060
+ __decorate([
5061
+ n({ type: Boolean, reflect: true })
5062
+ ], Checkbox.prototype, "readonly", void 0);
5063
+ __decorate([
5064
+ n({ type: Boolean, reflect: true })
5065
+ ], Checkbox.prototype, "disabled", void 0);
5066
+ __decorate([
5067
+ n({ type: Object })
5068
+ ], Checkbox.prototype, "configAria", void 0);
5069
+ __decorate([
5070
+ r()
5071
+ ], Checkbox.prototype, "hasFocus", void 0);
5072
+ __decorate([
5073
+ r()
5074
+ ], Checkbox.prototype, "isActive", void 0);
5075
+ __decorate([
5076
+ r()
5077
+ ], Checkbox.prototype, "slotHasContent", void 0);
5078
+ __decorate([
5079
+ e$4('.container')
5080
+ ], Checkbox.prototype, "containerElement", void 0);
5081
+ __decorate([
5082
+ e$4('.input-native')
5083
+ ], Checkbox.prototype, "nativeElement", void 0);
4779
5084
 
4780
- var css_248z$h = i`* {
5085
+ var css_248z$l = i`* {
4781
5086
  box-sizing: border-box;
4782
5087
  }
4783
5088
 
@@ -4786,55 +5091,267 @@ var css_248z$h = i`* {
4786
5091
  }
4787
5092
 
4788
5093
  :host {
4789
- display: block;
4790
- }
4791
-
4792
- .empty-state {
4793
- container: emptystate/inline-size;
4794
- padding: var(--spacing-100);
4795
- height: 100%;
4796
- max-width: var(--container-lg);
4797
- margin: auto;
5094
+ display: inline-flex;
5095
+ --spinner-track-color: var(--color-primary-container);
5096
+ --spinner-shape-color: var(--color-primary);
5097
+ --spinner-size: 4rem;
4798
5098
  }
4799
5099
 
4800
- .empty-state-container {
5100
+ .track {
5101
+ width: var(--spinner-size);
5102
+ height: var(--spinner-size);
5103
+ background-color: var(--spinner-track-color);
5104
+ border-radius: 50%;
4801
5105
  display: flex;
4802
- height: 100%;
4803
5106
  justify-content: center;
4804
- gap: var(--spacing-500);
4805
5107
  align-items: center;
5108
+ overflow: hidden;
4806
5109
  }
4807
5110
 
4808
- .illustration {
5111
+ .shape {
5112
+ width: 100%;
4809
5113
  height: 100%;
4810
- display: flex;
4811
- }
4812
- .illustration .illustration-svg {
4813
- --icon-size: 100%;
5114
+ background-color: var(--spinner-shape-color);
5115
+ animation: spinner-aniation 3s var(--easing-standard) infinite;
4814
5116
  }
4815
5117
 
4816
- .content {
4817
- display: flex;
4818
- flex-direction: column;
4819
- justify-content: center;
4820
- }
4821
- .content .title {
4822
- font-family: var(--typography-headline-medium-emphasized-font-family) !important;
4823
- font-size: var(--typography-headline-medium-emphasized-font-size) !important;
4824
- font-weight: var(--typography-headline-medium-emphasized-font-weight) !important;
4825
- line-height: var(--typography-headline-medium-emphasized-line-height) !important;
4826
- letter-spacing: var(--typography-headline-medium-emphasized-letter-spacing) !important;
4827
- margin-bottom: var(--spacing-200);
4828
- color: var(--color-on-surface);
4829
- }
4830
- .content .description {
4831
- font-family: var(--typography-body-medium-font-family) !important;
4832
- font-size: var(--typography-body-medium-font-size) !important;
4833
- font-weight: var(--typography-body-medium-font-weight) !important;
4834
- line-height: var(--typography-body-medium-line-height) !important;
4835
- letter-spacing: var(--typography-body-medium-letter-spacing) !important;
4836
- margin-bottom: var(--spacing-400);
4837
- color: var(--color-on-surface-variant);
5118
+ @keyframes spinner-aniation {
5119
+ 0%, 100% {
5120
+ clip-path: inset(0% round 50%);
5121
+ transform: rotate(0deg) scale(0.5);
5122
+ }
5123
+ 10% {
5124
+ transform: scale(0.7);
5125
+ }
5126
+ 20% {
5127
+ clip-path: inset(0% round 50%);
5128
+ transform: rotate(72deg) scale(0.6, 0.3);
5129
+ }
5130
+ 30% {
5131
+ transform: scale(0.5);
5132
+ }
5133
+ 40% {
5134
+ clip-path: inset(0% round 12px);
5135
+ transform: rotate(108deg) scale(0.3, 0.6);
5136
+ }
5137
+ 60% {
5138
+ transform: scale(0.5);
5139
+ }
5140
+ 80% {
5141
+ clip-path: inset(0% round 50%);
5142
+ transform: rotate(72deg) scale(0.6, 0.3);
5143
+ }
5144
+ 90% {
5145
+ transform: rotate(324deg) scale(0.4, 0.6);
5146
+ }
5147
+ }`;
5148
+
5149
+ /**
5150
+ * @label Spinner
5151
+ * @tag wc-spinner
5152
+ * @rawTag spinner
5153
+ * @summary A spinner component that animates a circular shape.
5154
+ * @cssprop --spinner-track-color - The color of the track.
5155
+ * @cssprop --spinner-shape-color - The color of the shape.
5156
+ * @tags display
5157
+ *
5158
+ * @example
5159
+ * ```html
5160
+ * <wc-spinner></wc-spinner>
5161
+ * ```
5162
+ */
5163
+ class Spinner extends i$1 {
5164
+ render() {
5165
+ return b `
5166
+ <div class="spinner track">
5167
+ <div class="shape"></div>
5168
+ </div>
5169
+ `;
5170
+ }
5171
+ }
5172
+ Spinner.styles = [css_248z$l];
5173
+
5174
+ var css_248z$k = i`* {
5175
+ box-sizing: border-box;
5176
+ }
5177
+
5178
+ .screen-reader-only {
5179
+ display: none !important;
5180
+ }
5181
+
5182
+ :host {
5183
+ display: block;
5184
+ }
5185
+
5186
+ .container-wrapper {
5187
+ container: containerwrapper/inline-size;
5188
+ }
5189
+ .container-wrapper.size-max .container {
5190
+ max-width: var(--container-max);
5191
+ }
5192
+ .container-wrapper.size-xl .container {
5193
+ max-width: var(--container-xl);
5194
+ }
5195
+ .container-wrapper.size-sm .container {
5196
+ max-width: var(--container-sm);
5197
+ }
5198
+ .container-wrapper.size-md .container {
5199
+ max-width: var(--container-md);
5200
+ }
5201
+ .container-wrapper.size-lg .container {
5202
+ max-width: var(--container-lg);
5203
+ }
5204
+
5205
+ .container {
5206
+ margin: auto;
5207
+ width: 100%;
5208
+ }
5209
+ .container .content {
5210
+ padding: var(--spacing-200);
5211
+ }
5212
+
5213
+ :host(.debug) {
5214
+ border-width: 0 1px;
5215
+ border-color: var(--color-red);
5216
+ border-style: solid;
5217
+ background: var(--color-red-50);
5218
+ }
5219
+ :host(.debug) .container {
5220
+ border-width: 0 1px;
5221
+ border-color: var(--color-blue);
5222
+ border-style: solid;
5223
+ background: var(--color-blue-100);
5224
+ }
5225
+ :host(.debug) .container .content {
5226
+ border-width: 0 1px;
5227
+ border-color: var(--color-green);
5228
+ border-style: solid;
5229
+ background: var(--color-green-100);
5230
+ }
5231
+
5232
+ .content {
5233
+ margin-inline: 0;
5234
+ }
5235
+
5236
+ @container containerwrapper (min-width: 672px) {
5237
+ .content {
5238
+ margin-inline: var(--spacing-200);
5239
+ }
5240
+ }
5241
+ @container containerwrapper (min-width: 1056px) {
5242
+ .content {
5243
+ margin-inline: var(--spacing-200);
5244
+ }
5245
+ }
5246
+ @container containerwrapper (min-width: 1312px) {
5247
+ .content {
5248
+ margin-inline: var(--spacing-200);
5249
+ }
5250
+ }
5251
+ @container containerwrapper (min-width: 1584px) {
5252
+ .content {
5253
+ margin-inline: var(--spacing-300);
5254
+ }
5255
+ }`;
5256
+
5257
+ /**
5258
+ * @label Container
5259
+ * @tag wc-container
5260
+ * @rawTag container
5261
+ * @summary A responsive container component for layout.
5262
+ * @cssprop --container-max-width - Controls the maximum width of the container.
5263
+ * @cssprop --container-padding - Controls the padding of the container.
5264
+ * @tags layout
5265
+ *
5266
+ * @example
5267
+ * ```html
5268
+ * <wc-container size="lg">Content</wc-container>
5269
+ * ```
5270
+ */
5271
+ class Container extends i$1 {
5272
+ constructor() {
5273
+ super(...arguments);
5274
+ this.size = 'full';
5275
+ }
5276
+ render() {
5277
+ const wrapperClasses = {
5278
+ 'container-wrapper': true,
5279
+ [`size-${this.size}`]: true,
5280
+ };
5281
+ return b `
5282
+ <div class=${e$3(wrapperClasses)}>
5283
+ <div class="container">
5284
+ <div class="content">
5285
+ <slot></slot>
5286
+ </div>
5287
+ </div>
5288
+ </div>
5289
+ `;
5290
+ }
5291
+ }
5292
+ Container.styles = [css_248z$k];
5293
+ __decorate([
5294
+ n({ type: String, reflect: true })
5295
+ ], Container.prototype, "size", void 0);
5296
+
5297
+ var css_248z$j = i`* {
5298
+ box-sizing: border-box;
5299
+ }
5300
+
5301
+ .screen-reader-only {
5302
+ display: none !important;
5303
+ }
5304
+
5305
+ :host {
5306
+ display: block;
5307
+ }
5308
+
5309
+ .empty-state {
5310
+ container: emptystate/inline-size;
5311
+ padding: var(--spacing-100);
5312
+ height: 100%;
5313
+ max-width: var(--container-lg);
5314
+ margin: auto;
5315
+ }
5316
+
5317
+ .empty-state-container {
5318
+ display: flex;
5319
+ height: 100%;
5320
+ justify-content: center;
5321
+ gap: var(--spacing-500);
5322
+ align-items: center;
5323
+ }
5324
+
5325
+ .illustration {
5326
+ height: 100%;
5327
+ display: flex;
5328
+ }
5329
+ .illustration .illustration-svg {
5330
+ --icon-size: 100%;
5331
+ }
5332
+
5333
+ .content {
5334
+ display: flex;
5335
+ flex-direction: column;
5336
+ justify-content: center;
5337
+ }
5338
+ .content .title {
5339
+ font-family: var(--typography-headline-medium-emphasized-font-family) !important;
5340
+ font-size: var(--typography-headline-medium-emphasized-font-size) !important;
5341
+ font-weight: var(--typography-headline-medium-emphasized-font-weight) !important;
5342
+ line-height: var(--typography-headline-medium-emphasized-line-height) !important;
5343
+ letter-spacing: var(--typography-headline-medium-emphasized-letter-spacing) !important;
5344
+ margin-bottom: var(--spacing-200);
5345
+ color: var(--color-on-surface);
5346
+ }
5347
+ .content .description {
5348
+ font-family: var(--typography-body-medium-font-family) !important;
5349
+ font-size: var(--typography-body-medium-font-size) !important;
5350
+ font-weight: var(--typography-body-medium-font-weight) !important;
5351
+ line-height: var(--typography-body-medium-line-height) !important;
5352
+ letter-spacing: var(--typography-body-medium-letter-spacing) !important;
5353
+ margin-bottom: var(--spacing-400);
5354
+ color: var(--color-on-surface-variant);
4838
5355
  }
4839
5356
 
4840
5357
  :host(.content-center) .content {
@@ -4933,7 +5450,7 @@ class EmptyState extends i$1 {
4933
5450
  }
4934
5451
  }
4935
5452
  // Lit handles styles in a static property for better performance
4936
- EmptyState.styles = [css_248z$h];
5453
+ EmptyState.styles = [css_248z$j];
4937
5454
  __decorate([
4938
5455
  n({ type: String, reflect: true })
4939
5456
  ], EmptyState.prototype, "illustration", void 0);
@@ -4947,7 +5464,7 @@ __decorate([
4947
5464
  r()
4948
5465
  ], EmptyState.prototype, "vertical", void 0);
4949
5466
 
4950
- var css_248z$g = i`* {
5467
+ var css_248z$i = i`* {
4951
5468
  box-sizing: border-box;
4952
5469
  }
4953
5470
 
@@ -6773,7 +7290,7 @@ class Tooltip extends i$1 {
6773
7290
  `;
6774
7291
  }
6775
7292
  }
6776
- Tooltip.styles = [css_248z$g];
7293
+ Tooltip.styles = [css_248z$i];
6777
7294
  Tooltip.CLOSE_OTHERS_EVENT = 'tooltip--open';
6778
7295
  __decorate([
6779
7296
  n()
@@ -6797,7 +7314,7 @@ __decorate([
6797
7314
  e$4('#tooltip')
6798
7315
  ], Tooltip.prototype, "floatingEl", void 0);
6799
7316
 
6800
- var css_248z$f = i`* {
7317
+ var css_248z$h = i`* {
6801
7318
  box-sizing: border-box;
6802
7319
  }
6803
7320
 
@@ -6839,7 +7356,7 @@ ol {
6839
7356
  * SPDX-License-Identifier: BSD-3-Clause
6840
7357
  */const o=o=>o??A;
6841
7358
 
6842
- var css_248z$e = i`* {
7359
+ var css_248z$g = i`* {
6843
7360
  box-sizing: border-box;
6844
7361
  }
6845
7362
 
@@ -6969,7 +7486,7 @@ class BreadcrumbItem extends i$1 {
6969
7486
  `;
6970
7487
  }
6971
7488
  }
6972
- BreadcrumbItem.styles = [css_248z$e];
7489
+ BreadcrumbItem.styles = [css_248z$g];
6973
7490
  __decorate([
6974
7491
  n({ reflect: true })
6975
7492
  ], BreadcrumbItem.prototype, "href", void 0);
@@ -7023,13 +7540,13 @@ class Breadcrumb extends i$1 {
7023
7540
  </nav>`;
7024
7541
  }
7025
7542
  }
7026
- Breadcrumb.styles = [css_248z$f];
7543
+ Breadcrumb.styles = [css_248z$h];
7027
7544
  Breadcrumb.Item = BreadcrumbItem;
7028
7545
  __decorate([
7029
7546
  n({ type: String })
7030
7547
  ], Breadcrumb.prototype, "label", void 0);
7031
7548
 
7032
- var css_248z$d = i`* {
7549
+ var css_248z$f = i`* {
7033
7550
  box-sizing: border-box;
7034
7551
  }
7035
7552
 
@@ -7113,7 +7630,7 @@ var css_248z$d = i`* {
7113
7630
  --_container-color: var(--color-tertiary-container);
7114
7631
  }`;
7115
7632
 
7116
- var css_248z$c = i`* {
7633
+ var css_248z$e = i`* {
7117
7634
  box-sizing: border-box;
7118
7635
  }
7119
7636
 
@@ -7224,7 +7741,7 @@ var css_248z$c = i`* {
7224
7741
  display: none;
7225
7742
  }`;
7226
7743
 
7227
- var css_248z$b = i`:host-context([variant=standard]) {
7744
+ var css_248z$d = i`:host-context([variant=standard]) {
7228
7745
  --menu-item-label-color: var(--color-on-surface-variant);
7229
7746
  --menu-item-label-selected-color: var(--color-on-tertiary-container);
7230
7747
  --menu-item-container-selected-color: var(--color-tertiary-container);
@@ -7240,7 +7757,7 @@ var css_248z$b = i`:host-context([variant=standard]) {
7240
7757
  * @label Menu Item
7241
7758
  * @tag wc-menu-item
7242
7759
  * @rawTag menu-item
7243
- * @parentRawTag menu-list
7760
+ * @parentRawTag menu
7244
7761
  * @summary An item in a menu list.
7245
7762
  * @tags navigation
7246
7763
  *
@@ -7392,7 +7909,7 @@ class MenuItem extends i$1 {
7392
7909
  `;
7393
7910
  }
7394
7911
  }
7395
- MenuItem.styles = [css_248z$c, css_248z$b];
7912
+ MenuItem.styles = [css_248z$e, css_248z$d];
7396
7913
  __decorate([
7397
7914
  n({ type: Boolean, reflect: true })
7398
7915
  ], MenuItem.prototype, "disabled", void 0);
@@ -7792,7 +8309,7 @@ class Menu extends i$1 {
7792
8309
  </div>`;
7793
8310
  }
7794
8311
  }
7795
- Menu.styles = [css_248z$d];
8312
+ Menu.styles = [css_248z$f];
7796
8313
  Menu.Item = MenuItem;
7797
8314
  __decorate([
7798
8315
  n({ type: Boolean, reflect: true })
@@ -7825,7 +8342,7 @@ __decorate([
7825
8342
  e$4('.menu')
7826
8343
  ], Menu.prototype, "menuListElement", void 0);
7827
8344
 
7828
- var css_248z$a = i`* {
8345
+ var css_248z$c = i`* {
7829
8346
  box-sizing: border-box;
7830
8347
  }
7831
8348
 
@@ -8019,7 +8536,7 @@ class SubMenu extends i$1 {
8019
8536
  `;
8020
8537
  }
8021
8538
  }
8022
- SubMenu.styles = [css_248z$a];
8539
+ SubMenu.styles = [css_248z$c];
8023
8540
  __decorate([
8024
8541
  n({ type: Number, attribute: 'hover-open-delay' })
8025
8542
  ], SubMenu.prototype, "hoverOpenDelay", void 0);
@@ -8039,7 +8556,7 @@ __decorate([
8039
8556
  o$2({ slot: 'menu' })
8040
8557
  ], SubMenu.prototype, "_menus", void 0);
8041
8558
 
8042
- var css_248z$9 = i`@charset "UTF-8";
8559
+ var css_248z$b = i`@charset "UTF-8";
8043
8560
  :host {
8044
8561
  display: block;
8045
8562
  height: 100%;
@@ -8196,7 +8713,7 @@ class Image extends i$1 {
8196
8713
  `;
8197
8714
  }
8198
8715
  }
8199
- Image.styles = [css_248z$9];
8716
+ Image.styles = [css_248z$b];
8200
8717
  __decorate([
8201
8718
  n({ reflect: true })
8202
8719
  ], Image.prototype, "src", void 0);
@@ -8219,7 +8736,7 @@ __decorate([
8219
8736
  r()
8220
8737
  ], Image.prototype, "_previewOpen", void 0);
8221
8738
 
8222
- var css_248z$8 = i`* {
8739
+ var css_248z$a = i`* {
8223
8740
  box-sizing: border-box;
8224
8741
  }
8225
8742
 
@@ -8263,7 +8780,7 @@ var css_248z$8 = i`* {
8263
8780
  display: flex;
8264
8781
  align-items: center;
8265
8782
  justify-content: center;
8266
- gap: var(--_tab-icon-label-spacing);
8783
+ gap: 0;
8267
8784
  width: 100%;
8268
8785
  height: 100%;
8269
8786
  z-index: 0;
@@ -8275,13 +8792,27 @@ var css_248z$8 = i`* {
8275
8792
  .tab .tab-content .slot-container {
8276
8793
  display: none;
8277
8794
  }
8278
- .tab .indicator {
8279
- position: absolute;
8280
- pointer-events: none;
8281
- z-index: 1;
8282
- opacity: 0;
8283
- background: var(--_active-indicator-color);
8284
- border-radius: var(--_active-indicator-shape);
8795
+ .tab .tab-content ::slotted([slot=icon]) {
8796
+ flex: none;
8797
+ color: var(--_label-text-color);
8798
+ --icon-size: var(--tab-icon-size, var(--_tab-icon-size));
8799
+ --icon-color: var(--_label-text-color);
8800
+ }
8801
+ .tab .tab-content ::slotted([slot=badge]) {
8802
+ flex: none;
8803
+ margin-inline-start: var(--_tab-badge-label-spacing, 0);
8804
+ --badge-color: var(--_tab-badge-color, var(--color-error));
8805
+ }
8806
+ .tab.has-icon .tab-content {
8807
+ gap: var(--_tab-icon-label-spacing);
8808
+ }
8809
+ .tab .indicator {
8810
+ position: absolute;
8811
+ pointer-events: none;
8812
+ z-index: 1;
8813
+ opacity: 0;
8814
+ background: var(--_active-indicator-color);
8815
+ border-radius: var(--_active-indicator-shape);
8285
8816
  transform-origin: left bottom;
8286
8817
  height: var(--_active-indicator-height);
8287
8818
  inset: auto 0px 0px;
@@ -8330,6 +8861,10 @@ var css_248z$8 = i`* {
8330
8861
  :host-context([variant=line]) .tab {
8331
8862
  --_tab-height: 100%;
8332
8863
  --_container-padding: 1rem;
8864
+ --_tab-icon-size: 1.5rem;
8865
+ --_tab-icon-label-spacing: 0.5rem;
8866
+ --_tab-badge-label-spacing: 0.25rem;
8867
+ --_tab-badge-color: var(--color-error);
8333
8868
  --_label-text-color: var(--color-on-surface);
8334
8869
  --_container-state-color: var(--_label-text-color);
8335
8870
  --_container-shape-start-start: var(--shape-corner-small);
@@ -8338,7 +8873,7 @@ var css_248z$8 = i`* {
8338
8873
  --_container-shape-end-end: var(--shape-corner-small);
8339
8874
  --_active-indicator-color: var(--color-primary);
8340
8875
  --_active-indicator-shape: 3px 3px 0 0;
8341
- --_active-indicator-height: 2px;
8876
+ --_active-indicator-height: 3px;
8342
8877
  }
8343
8878
  :host-context([variant=line]) .tab .focus-ring {
8344
8879
  inset: 3px 3px 4px 3px;
@@ -8361,6 +8896,46 @@ var css_248z$8 = i`* {
8361
8896
  }
8362
8897
  :host-context([variant=line]) .tab.disabled .ripple {
8363
8898
  display: none;
8899
+ }
8900
+
8901
+ :host-context([variant=line-secondary]) .tab {
8902
+ --_tab-height: 100%;
8903
+ --_container-padding: 1rem;
8904
+ --_tab-icon-size: 1.25rem;
8905
+ --_tab-icon-label-spacing: 0.5rem;
8906
+ --_tab-badge-label-spacing: 0.25rem;
8907
+ --_tab-badge-color: var(--color-error);
8908
+ --_label-text-color: var(--color-on-surface);
8909
+ --_container-state-color: var(--_label-text-color);
8910
+ --_container-shape-start-start: var(--shape-corner-small);
8911
+ --_container-shape-start-end: var(--shape-corner-small);
8912
+ --_container-shape-end-start: var(--shape-corner-small);
8913
+ --_container-shape-end-end: var(--shape-corner-small);
8914
+ --_active-indicator-color: var(--color-primary);
8915
+ --_active-indicator-shape: 0;
8916
+ --_active-indicator-height: 2px;
8917
+ }
8918
+ :host-context([variant=line-secondary]) .tab .focus-ring {
8919
+ inset: 3px 3px 4px 3px;
8920
+ }
8921
+ :host-context([variant=line-secondary]) .tab.active .indicator.secondary {
8922
+ opacity: 1;
8923
+ }
8924
+ :host-context([variant=line-secondary]) .tab.active .focus-ring {
8925
+ inset: 3px 3px calc(4px + var(--_active-indicator-height)) 3px;
8926
+ }
8927
+ :host-context([variant=line-secondary]) .tab:hover:not(:where(.disabled)) {
8928
+ --_container-state-opacity: 0.08;
8929
+ }
8930
+ :host-context([variant=line-secondary]) .tab.pressed:not(:where(.disabled)) {
8931
+ --_container-state-opacity: 0.12;
8932
+ }
8933
+ :host-context([variant=line-secondary]) .tab.disabled {
8934
+ --_label-text-color: var(--color-on-surface);
8935
+ --_label-text-opacity: 0.38;
8936
+ }
8937
+ :host-context([variant=line-secondary]) .tab.disabled .ripple {
8938
+ display: none;
8364
8939
  }`;
8365
8940
 
8366
8941
  var _Tab_id;
@@ -8403,6 +8978,8 @@ class Tab extends i$1 {
8403
8978
  this.throttleDelay = 200;
8404
8979
  this.hasFocus = false;
8405
8980
  this.slotHasContent = false;
8981
+ this.slotHasIcon = false;
8982
+ this.slotHasBadge = false;
8406
8983
  /**
8407
8984
  * States
8408
8985
  */
@@ -8445,10 +9022,18 @@ class Tab extends i$1 {
8445
9022
  }
8446
9023
  firstUpdated() {
8447
9024
  this.__dispatchClickWithThrottle = throttle(this.__dispatchClick, this.throttleDelay);
8448
- observerSlotChangesWithCallback(this.renderRoot.querySelector('slot'), hasContent => {
9025
+ observerSlotChangesWithCallback(this.renderRoot.querySelector('slot:not([name])'), hasContent => {
8449
9026
  this.slotHasContent = hasContent;
8450
9027
  this.requestUpdate();
8451
9028
  });
9029
+ observerSlotChangesWithCallback(this.renderRoot.querySelector('slot[name="icon"]'), hasContent => {
9030
+ this.slotHasIcon = hasContent;
9031
+ this.requestUpdate();
9032
+ });
9033
+ observerSlotChangesWithCallback(this.renderRoot.querySelector('slot[name="badge"]'), hasContent => {
9034
+ this.slotHasBadge = hasContent;
9035
+ this.requestUpdate();
9036
+ });
8452
9037
  }
8453
9038
  __isLink() {
8454
9039
  return !!this.href;
@@ -8469,7 +9054,9 @@ class Tab extends i$1 {
8469
9054
  disabled: this.disabled,
8470
9055
  pressed: this.isPressed,
8471
9056
  active: this.active,
8472
- 'has-content': this.slotHasContent
9057
+ 'has-content': this.slotHasContent || !!this.label,
9058
+ 'has-icon': this.slotHasIcon,
9059
+ 'has-badge': this.slotHasBadge,
8473
9060
  };
8474
9061
  if (!isLink) {
8475
9062
  return b `<button
@@ -8512,16 +9099,18 @@ class Tab extends i$1 {
8512
9099
  <wc-ripple class="ripple"></wc-ripple>
8513
9100
 
8514
9101
  <div class="tab-content">
9102
+ <slot name="icon"></slot>
9103
+
8515
9104
  <div class="slot-container">
8516
- <slot></slot>
9105
+ <slot>${this.label || A}</slot>
8517
9106
  </div>
8518
9107
 
8519
- <slot name="icon"></slot>
9108
+ <slot name="badge"></slot>
8520
9109
 
8521
9110
  <div class="indicator"></div>
8522
9111
  </div>
8523
9112
 
8524
- <div class="indicator"></div>
9113
+ <div class="secondary indicator"></div>
8525
9114
 
8526
9115
  ${this.__renderDisabledReason()}
8527
9116
  `;
@@ -8546,7 +9135,7 @@ class Tab extends i$1 {
8546
9135
  }
8547
9136
  }
8548
9137
  _Tab_id = new WeakMap();
8549
- Tab.styles = [css_248z$8];
9138
+ Tab.styles = [css_248z$a];
8550
9139
  __decorate([
8551
9140
  n({ type: Boolean, reflect: true })
8552
9141
  ], Tab.prototype, "active", void 0);
@@ -8556,9 +9145,6 @@ __decorate([
8556
9145
  __decorate([
8557
9146
  n({ type: String })
8558
9147
  ], Tab.prototype, "disabledReason", void 0);
8559
- __decorate([
8560
- n({ type: String })
8561
- ], Tab.prototype, "icon", void 0);
8562
9148
  __decorate([
8563
9149
  n({ type: String })
8564
9150
  ], Tab.prototype, "label", void 0);
@@ -8583,6 +9169,12 @@ __decorate([
8583
9169
  __decorate([
8584
9170
  r()
8585
9171
  ], Tab.prototype, "slotHasContent", void 0);
9172
+ __decorate([
9173
+ r()
9174
+ ], Tab.prototype, "slotHasIcon", void 0);
9175
+ __decorate([
9176
+ r()
9177
+ ], Tab.prototype, "slotHasBadge", void 0);
8586
9178
  __decorate([
8587
9179
  r()
8588
9180
  ], Tab.prototype, "isPressed", void 0);
@@ -8590,7 +9182,7 @@ __decorate([
8590
9182
  e$4('.tab-element')
8591
9183
  ], Tab.prototype, "tabElement", void 0);
8592
9184
 
8593
- var css_248z$7 = i`* {
9185
+ var css_248z$9 = i`* {
8594
9186
  box-sizing: border-box;
8595
9187
  }
8596
9188
 
@@ -8604,7 +9196,7 @@ var css_248z$7 = i`* {
8604
9196
  height: 100%;
8605
9197
  }`;
8606
9198
 
8607
- var css_248z$6 = i`* {
9199
+ var css_248z$8 = i`* {
8608
9200
  box-sizing: border-box;
8609
9201
  }
8610
9202
 
@@ -8656,11 +9248,23 @@ class Tabs extends i$1 {
8656
9248
  const clickedTab = path.find(node => node instanceof Element && node.tagName.toLowerCase() === 'wc-tab');
8657
9249
  if (!clickedTab)
8658
9250
  return;
8659
- const tabs = this.querySelectorAll('wc-tab');
8660
- tabs.forEach(tab => {
9251
+ const tabs = Array.from(this.querySelectorAll('wc-tab'));
9252
+ let clickedIndex = -1;
9253
+ for (let index = 0; index < tabs.length; index += 1) {
9254
+ const tab = tabs[index];
8661
9255
  tab.active = false;
8662
- });
9256
+ if (tab === clickedTab)
9257
+ clickedIndex = index;
9258
+ }
8663
9259
  clickedTab.active = true;
9260
+ this.dispatchEvent(new CustomEvent('tab-click', {
9261
+ bubbles: true,
9262
+ composed: true,
9263
+ detail: {
9264
+ index: clickedIndex,
9265
+ value: clickedTab.value,
9266
+ },
9267
+ }));
8664
9268
  };
8665
9269
  }
8666
9270
  connectedCallback() {
@@ -8679,13 +9283,13 @@ class Tabs extends i$1 {
8679
9283
  `;
8680
9284
  }
8681
9285
  }
8682
- Tabs.styles = [css_248z$6];
9286
+ Tabs.styles = [css_248z$8];
8683
9287
  Tabs.Tab = Tab;
8684
9288
  __decorate([
8685
9289
  n({ type: Boolean })
8686
9290
  ], Tabs.prototype, "managed", void 0);
8687
9291
 
8688
- var css_248z$5 = i`* {
9292
+ var css_248z$7 = i`* {
8689
9293
  box-sizing: border-box;
8690
9294
  }
8691
9295
 
@@ -8694,12 +9298,12 @@ var css_248z$5 = i`* {
8694
9298
  }
8695
9299
 
8696
9300
  :host {
8697
- display: block;
9301
+ display: none;
8698
9302
  flex: 1;
8699
9303
  }
8700
9304
 
8701
- :host([hidden]) {
8702
- display: none;
9305
+ :host([active]) {
9306
+ display: block;
8703
9307
  }`;
8704
9308
 
8705
9309
  /**
@@ -8719,14 +9323,21 @@ var css_248z$5 = i`* {
8719
9323
  * @tags navigation
8720
9324
  */
8721
9325
  class TabPanel extends i$1 {
9326
+ constructor() {
9327
+ super(...arguments);
9328
+ this.active = false;
9329
+ }
8722
9330
  render() {
8723
9331
  return b `<slot></slot>`;
8724
9332
  }
8725
9333
  }
8726
- TabPanel.styles = [css_248z$5];
9334
+ TabPanel.styles = [css_248z$7];
8727
9335
  __decorate([
8728
9336
  n({ reflect: true })
8729
9337
  ], TabPanel.prototype, "value", void 0);
9338
+ __decorate([
9339
+ n({ type: Boolean, reflect: true })
9340
+ ], TabPanel.prototype, "active", void 0);
8730
9341
 
8731
9342
  /**
8732
9343
  * @label Tab Group
@@ -8756,7 +9367,6 @@ class TabGroup extends i$1 {
8756
9367
  constructor() {
8757
9368
  super(...arguments);
8758
9369
  this.variant = 'line';
8759
- this.uid = crypto.randomUUID();
8760
9370
  this.onTabClick = (event) => {
8761
9371
  const custom = event;
8762
9372
  event.stopPropagation();
@@ -8764,6 +9374,9 @@ class TabGroup extends i$1 {
8764
9374
  if (targetValue) {
8765
9375
  this.selectTab(targetValue);
8766
9376
  }
9377
+ else if (typeof custom.detail?.index === 'number') {
9378
+ this.selectTabByIndex(custom.detail.index);
9379
+ }
8767
9380
  };
8768
9381
  }
8769
9382
  connectedCallback() {
@@ -8779,10 +9392,11 @@ class TabGroup extends i$1 {
8779
9392
  }
8780
9393
  selectTab(target) {
8781
9394
  const tabs = this.getTabs();
8782
- tabs.forEach((tab) => {
9395
+ for (const tab of tabs) {
9396
+ tab.active = false;
8783
9397
  tab.selected = false;
8784
9398
  tab.classList.remove('previous-tab', 'next-tab');
8785
- });
9399
+ }
8786
9400
  let selectedIndex = -1;
8787
9401
  tabs.forEach((tab, index) => {
8788
9402
  const t = tab.getAttribute('target') || tab.getAttribute('value');
@@ -8792,6 +9406,7 @@ class TabGroup extends i$1 {
8792
9406
  });
8793
9407
  if (selectedIndex >= 0) {
8794
9408
  const selectedTab = tabs[selectedIndex];
9409
+ selectedTab.active = true;
8795
9410
  selectedTab.selected = true;
8796
9411
  if (tabs[selectedIndex - 1]) {
8797
9412
  tabs[selectedIndex - 1].classList.add('previous-tab');
@@ -8801,59 +9416,83 @@ class TabGroup extends i$1 {
8801
9416
  }
8802
9417
  }
8803
9418
  const panels = this.getTabPanels();
8804
- panels.forEach(panel => {
9419
+ for (const panel of panels) {
8805
9420
  const panelValue = panel.getAttribute('value');
8806
9421
  panel.active = panelValue === target;
8807
- });
9422
+ }
9423
+ }
9424
+ selectTabByIndex(index) {
9425
+ const tabs = this.getTabs();
9426
+ for (const tab of tabs) {
9427
+ tab.active = false;
9428
+ tab.selected = false;
9429
+ tab.classList.remove('previous-tab', 'next-tab');
9430
+ }
9431
+ if (index >= 0 && index < tabs.length) {
9432
+ tabs[index].active = true;
9433
+ tabs[index].selected = true;
9434
+ if (tabs[index - 1])
9435
+ tabs[index - 1].classList.add('previous-tab');
9436
+ if (tabs[index + 1])
9437
+ tabs[index + 1].classList.add('next-tab');
9438
+ }
9439
+ const panels = this.getTabPanels();
9440
+ for (let i = 0; i < panels.length; i += 1) {
9441
+ const panel = panels[i];
9442
+ panel.active = i === index;
9443
+ }
8808
9444
  }
8809
9445
  getTabs() {
8810
- return this.querySelectorAll(':scope > tabs-list wc-tab');
9446
+ return Array.from(this.querySelectorAll(':scope > wc-tabs wc-tab'));
8811
9447
  }
8812
9448
  getTabPanels() {
8813
- return this.querySelectorAll(':scope > wc-tab-panel');
9449
+ return Array.from(this.querySelectorAll(':scope > wc-tab-panel'));
8814
9450
  }
8815
9451
  getTabList() {
8816
- return this.querySelector(':scope > tabs-list');
9452
+ return this.querySelector(':scope > wc-tabs');
8817
9453
  }
8818
9454
  tabsHaveTarget() {
8819
- return !!this.querySelector(':scope > tabs-list wc-tab[target]');
9455
+ return !!this.querySelector(':scope > wc-tabs wc-tab[target]');
8820
9456
  }
8821
9457
  initializeTabs() {
8822
9458
  const tabs = Array.from(this.getTabs());
8823
9459
  if (!this.tabsHaveTarget()) {
8824
- this.getTabPanels().forEach((panel, index) => {
8825
- if (!panel.getAttribute('value')) {
8826
- panel.setAttribute('value', `tab-${this.uid}-${index}`);
8827
- }
8828
- });
8829
- if (tabs.length > 0) {
8830
- const firstTarget = tabs[0].getAttribute('target');
8831
- if (firstTarget) {
8832
- this.selectTab(firstTarget);
8833
- }
8834
- }
9460
+ // No target/value attributes — use index-based activation
9461
+ const selectedIndex = tabs.findIndex(tab => tab.hasAttribute('active') ||
9462
+ tab.active ||
9463
+ tab.hasAttribute('selected') ||
9464
+ tab.selected);
9465
+ this.selectTabByIndex(selectedIndex >= 0 ? selectedIndex : 0);
8835
9466
  }
8836
9467
  else {
8837
- const selectedTab = this.querySelector(':scope > tabs-list wc-tab[selected]');
9468
+ const selectedTab = tabs.find(tab => tab.hasAttribute('active') ||
9469
+ tab.active ||
9470
+ tab.hasAttribute('selected') ||
9471
+ tab.selected);
8838
9472
  if (selectedTab) {
8839
9473
  const selectedTarget = selectedTab.getAttribute('target');
8840
9474
  if (selectedTarget)
8841
9475
  this.selectTab(selectedTarget);
8842
9476
  }
9477
+ else if (tabs.length > 0) {
9478
+ const firstTarget = tabs[0].getAttribute('target');
9479
+ if (firstTarget)
9480
+ this.selectTab(firstTarget);
9481
+ }
8843
9482
  }
8844
9483
  }
8845
9484
  render() {
8846
9485
  return b `<slot></slot>`;
8847
9486
  }
8848
9487
  }
8849
- TabGroup.styles = [css_248z$7];
9488
+ TabGroup.styles = [css_248z$9];
8850
9489
  TabGroup.Tabs = Tabs;
8851
9490
  TabGroup.TabPanel = TabPanel;
8852
9491
  __decorate([
8853
9492
  n({ reflect: true })
8854
9493
  ], TabGroup.prototype, "variant", void 0);
8855
9494
 
8856
- var css_248z$4 = i`:host {
9495
+ var css_248z$6 = i`:host {
8857
9496
  --_track-height: 4px;
8858
9497
  --_thumb-size: 20px;
8859
9498
  --thumb-half: 10px;
@@ -9126,7 +9765,7 @@ class Slider extends i$1 {
9126
9765
  `;
9127
9766
  }
9128
9767
  }
9129
- Slider.styles = [css_248z$4];
9768
+ Slider.styles = [css_248z$6];
9130
9769
  __decorate([
9131
9770
  n({ type: Number })
9132
9771
  ], Slider.prototype, "min", void 0);
@@ -9155,7 +9794,7 @@ __decorate([
9155
9794
  e$4('.thumb')
9156
9795
  ], Slider.prototype, "thumbElement", void 0);
9157
9796
 
9158
- var css_248z$3 = i`* {
9797
+ var css_248z$5 = i`* {
9159
9798
  box-sizing: border-box;
9160
9799
  }
9161
9800
 
@@ -9689,7 +10328,7 @@ class Table extends i$1 {
9689
10328
  `;
9690
10329
  }
9691
10330
  }
9692
- Table.styles = [css_248z$3];
10331
+ Table.styles = [css_248z$5];
9693
10332
  __decorate([
9694
10333
  n({ type: Array })
9695
10334
  ], Table.prototype, "columns", void 0);
@@ -9742,11 +10381,554 @@ __decorate([
9742
10381
  r()
9743
10382
  ], Table.prototype, "isSelectAll", void 0);
9744
10383
  __decorate([
9745
- r()
9746
- ], Table.prototype, "isSelectAllIntermediate", void 0);
10384
+ r()
10385
+ ], Table.prototype, "isSelectAllIntermediate", void 0);
10386
+ __decorate([
10387
+ r()
10388
+ ], Table.prototype, "isHorizontallyScrolled", void 0);
10389
+
10390
+ var css_248z$4 = i`* {
10391
+ box-sizing: border-box;
10392
+ }
10393
+
10394
+ .screen-reader-only {
10395
+ display: none !important;
10396
+ }
10397
+
10398
+ :host {
10399
+ display: block;
10400
+ }
10401
+
10402
+ .pagination {
10403
+ background: var(--color-surface, #fff);
10404
+ display: flex;
10405
+ align-items: center;
10406
+ }
10407
+ .pagination .page-sizes-select {
10408
+ margin-inline-start: var(--spacing-100, 0.5rem);
10409
+ }
10410
+ .pagination .page-size-label {
10411
+ display: flex;
10412
+ align-items: center;
10413
+ gap: var(--spacing-100, 0.5rem);
10414
+ font-family: var(--typography-body-medium-font-family);
10415
+ font-size: var(--typography-body-medium-font-size);
10416
+ font-weight: var(--typography-body-medium-font-weight);
10417
+ line-height: var(--typography-body-medium-line-height);
10418
+ letter-spacing: var(--typography-body-medium-letter-spacing);
10419
+ color: var(--color-on-surface-variant);
10420
+ white-space: nowrap;
10421
+ }
10422
+ .pagination .page-size-select {
10423
+ border: 1px solid var(--color-outline-variant);
10424
+ background: var(--color-surface, #fff);
10425
+ color: var(--color-on-surface);
10426
+ padding: var(--spacing-050, 0.25rem) var(--spacing-100, 0.5rem);
10427
+ cursor: pointer;
10428
+ outline: none;
10429
+ height: 2.5rem;
10430
+ font-family: var(--typography-body-medium-font-family);
10431
+ font-size: var(--typography-body-medium-font-size);
10432
+ font-weight: var(--typography-body-medium-font-weight);
10433
+ line-height: var(--typography-body-medium-line-height);
10434
+ letter-spacing: var(--typography-body-medium-letter-spacing);
10435
+ }
10436
+ .pagination .page-size-select:focus {
10437
+ outline: 2px solid var(--color-primary);
10438
+ }
10439
+ .pagination .pagination-item-count {
10440
+ margin-inline-start: var(--spacing-150, 0.75rem);
10441
+ flex: 1;
10442
+ display: flex;
10443
+ align-items: center;
10444
+ }
10445
+ .pagination .pagination-text {
10446
+ font-family: var(--typography-body-medium-font-family);
10447
+ font-size: var(--typography-body-medium-font-size);
10448
+ font-weight: var(--typography-body-medium-font-weight);
10449
+ line-height: var(--typography-body-medium-line-height);
10450
+ letter-spacing: var(--typography-body-medium-letter-spacing);
10451
+ color: var(--color-on-surface-variant);
10452
+ }
10453
+ .pagination .arrows {
10454
+ --border-radius: 0;
10455
+ --button-height: calc(2.5rem - 2px);
10456
+ }`;
10457
+
10458
+ const DEFAULT_PAGE_SIZES = [10, 25, 50, 100];
10459
+ /**
10460
+ * @label Pagination
10461
+ * @tag wc-pagination
10462
+ * @rawTag pagination
10463
+ * @summary A pagination control with page size selector, item count display, and previous/next navigation.
10464
+ * @overview
10465
+ * <p>The pagination component provides controls for navigating through paged data sets.</p>
10466
+ *
10467
+ * @fires {CustomEvent} page - Dispatched when the page or page size changes. Detail: `{ page, pageSize }`.
10468
+ *
10469
+ * @example
10470
+ * ```html
10471
+ * <wc-pagination page="1" page-size="10" total-items="100"></wc-pagination>
10472
+ * ```
10473
+ * @tags navigation, data
10474
+ */
10475
+ class Pagination extends i$1 {
10476
+ constructor() {
10477
+ super(...arguments);
10478
+ /**
10479
+ * The current page number (1-based). Defaults to `1`.
10480
+ */
10481
+ this.page = 1;
10482
+ /**
10483
+ * The number of rows per page. Defaults to `10`.
10484
+ */
10485
+ this.pageSize = 10;
10486
+ /**
10487
+ * Total number of items.
10488
+ */
10489
+ this.totalItems = 0;
10490
+ /**
10491
+ * Supported page size options.
10492
+ */
10493
+ this.pageSizes = DEFAULT_PAGE_SIZES;
10494
+ }
10495
+ dispatchPageEvent() {
10496
+ this.dispatchEvent(new CustomEvent('page', {
10497
+ detail: { page: this.page, pageSize: this.pageSize },
10498
+ bubbles: true,
10499
+ composed: true,
10500
+ }));
10501
+ }
10502
+ render() {
10503
+ const startItem = this.pageSize * (this.page - 1);
10504
+ const endItem = Math.min(this.pageSize * this.page, this.totalItems);
10505
+ const isFirstPage = this.page === 1;
10506
+ const isLastPage = this.pageSize * this.page >= this.totalItems;
10507
+ return b `
10508
+ <div class="pagination">
10509
+ <div class="page-sizes-select">
10510
+ <label class="page-size-label">
10511
+ Items per page:
10512
+ <select
10513
+ class="page-size-select"
10514
+ .value=${String(this.pageSize)}
10515
+ @change=${(e) => {
10516
+ this.pageSize = parseInt(e.target.value, 10);
10517
+ this.page = 1;
10518
+ this.dispatchPageEvent();
10519
+ }}
10520
+ >
10521
+ ${this.pageSizes.map(size => b `
10522
+ <option value=${size} ?selected=${this.pageSize === size}>
10523
+ ${size}
10524
+ </option>
10525
+ `)}
10526
+ </select>
10527
+ </label>
10528
+ </div>
10529
+ <div class="pagination-item-count">
10530
+ <span class="pagination-text">
10531
+ ${startItem} - ${endItem} of ${this.totalItems} items
10532
+ </span>
10533
+ </div>
10534
+ <div class="pagination-right">
10535
+ <div class="table-footer-right-content">
10536
+ <div class="table-footer-right-content-pagination">
10537
+ <wc-button
10538
+ class="arrows"
10539
+ color="secondary"
10540
+ variant="text"
10541
+ ?disabled=${isFirstPage}
10542
+ @click=${() => {
10543
+ if (!isFirstPage) {
10544
+ this.page -= 1;
10545
+ this.dispatchPageEvent();
10546
+ }
10547
+ }}
10548
+ >
10549
+ <wc-icon slot="icon" name="arrow--left"></wc-icon>
10550
+ </wc-button>
10551
+ <wc-button
10552
+ color="secondary"
10553
+ variant="text"
10554
+ class="arrows"
10555
+ ?disabled=${isLastPage}
10556
+ @click=${() => {
10557
+ if (!isLastPage) {
10558
+ this.page += 1;
10559
+ this.dispatchPageEvent();
10560
+ }
10561
+ }}
10562
+ >
10563
+ <wc-icon slot="icon" name="arrow--right"></wc-icon>
10564
+ </wc-button>
10565
+ </div>
10566
+ </div>
10567
+ </div>
10568
+ </div>
10569
+ `;
10570
+ }
10571
+ }
10572
+ Pagination.styles = [css_248z$4];
10573
+ __decorate([
10574
+ n({ type: Number })
10575
+ ], Pagination.prototype, "page", void 0);
10576
+ __decorate([
10577
+ n({ type: Number, attribute: 'page-size' })
10578
+ ], Pagination.prototype, "pageSize", void 0);
10579
+ __decorate([
10580
+ n({ type: Number, attribute: 'total-items' })
10581
+ ], Pagination.prototype, "totalItems", void 0);
10582
+ __decorate([
10583
+ n({ type: Array, attribute: 'page-sizes' })
10584
+ ], Pagination.prototype, "pageSizes", void 0);
10585
+
10586
+ var css_248z$3 = i`* {
10587
+ box-sizing: border-box;
10588
+ }
10589
+
10590
+ .screen-reader-only {
10591
+ display: none !important;
10592
+ }
10593
+
10594
+ :host {
10595
+ display: block;
10596
+ --tree-node-height: 2.5rem;
10597
+ --tree-node-icon-size: 1.25rem;
10598
+ --tree-node-border-radius: var(--global-shape-corner-full, 9999px);
10599
+ --tree-node-label-color: var(--color-on-surface);
10600
+ --tree-node-icon-color: var(--color-on-surface-variant);
10601
+ --tree-node-selected-background: var(--color-secondary-container);
10602
+ --tree-node-selected-color: var(--color-on-secondary-container);
10603
+ --tree-node-hover-background: var(--color-inverse-primary);
10604
+ --tree-node-focus-ring-color: var(--color-primary);
10605
+ }
10606
+
10607
+ .tree-node {
10608
+ display: block;
10609
+ }
10610
+
10611
+ .tree-node-content {
10612
+ display: flex;
10613
+ align-items: center;
10614
+ gap: 0.25rem;
10615
+ height: var(--tree-node-height);
10616
+ border-radius: var(--tree-node-border-radius);
10617
+ color: var(--tree-node-label-color);
10618
+ cursor: pointer;
10619
+ user-select: none;
10620
+ text-decoration: none;
10621
+ outline: none;
10622
+ font-family: var(--typography-body-medium-font-family) !important;
10623
+ font-size: var(--typography-body-medium-font-size) !important;
10624
+ font-weight: var(--typography-body-medium-font-weight) !important;
10625
+ line-height: var(--typography-body-medium-line-height) !important;
10626
+ letter-spacing: var(--typography-body-medium-letter-spacing) !important;
10627
+ }
10628
+ .tree-node-content:not(.disabled):hover {
10629
+ background-color: var(--tree-node-hover-background);
10630
+ }
10631
+ .tree-node-content:focus-visible {
10632
+ outline: 2px solid var(--tree-node-focus-ring-color);
10633
+ }
10634
+ .tree-node-content.selected {
10635
+ background-color: var(--tree-node-selected-background);
10636
+ color: var(--tree-node-selected-color);
10637
+ }
10638
+ .tree-node-content.selected .node-icon {
10639
+ --icon-color: var(--tree-node-selected-color);
10640
+ }
10641
+ .tree-node-content.disabled {
10642
+ cursor: not-allowed;
10643
+ opacity: 0.38;
10644
+ pointer-events: none;
10645
+ }
10646
+
10647
+ .expand-icon {
10648
+ --icon-size: var(--tree-node-icon-size);
10649
+ --icon-color: var(--tree-node-icon-color);
10650
+ flex-shrink: 0;
10651
+ transition: transform var(--duration-short2, 200ms) var(--easing-standard, ease);
10652
+ }
10653
+ .expand-icon.expanded {
10654
+ transform: rotate(90deg);
10655
+ }
10656
+
10657
+ .icon-space {
10658
+ display: inline-block;
10659
+ width: var(--tree-node-icon-size);
10660
+ height: var(--tree-node-icon-size);
10661
+ flex-shrink: 0;
10662
+ }
10663
+
10664
+ .node-icon {
10665
+ --icon-size: var(--tree-node-icon-size);
10666
+ --icon-color: var(--tree-node-icon-color);
10667
+ flex-shrink: 0;
10668
+ }
10669
+
10670
+ .tree-node-label {
10671
+ flex: 1;
10672
+ overflow: hidden;
10673
+ text-overflow: ellipsis;
10674
+ white-space: nowrap;
10675
+ }
10676
+
10677
+ .node-children {
10678
+ display: none;
10679
+ }
10680
+ .node-children.expanded {
10681
+ display: block;
10682
+ }`;
10683
+
10684
+ /**
10685
+ * @label Tree Node
10686
+ * @tag wc-tree-node
10687
+ * @rawTag tree-node
10688
+ * @parentRawTag tree-view
10689
+ * @summary A tree node represents a single item in a hierarchical tree structure. It supports nesting, icons, links, and keyboard navigation.
10690
+ *
10691
+ * @example
10692
+ * ```html
10693
+ * <wc-tree-view>
10694
+ * <wc-tree-node label="Parent">
10695
+ * <wc-tree-node label="Child"></wc-tree-node>
10696
+ * </wc-tree-node>
10697
+ * </wc-tree-view>
10698
+ * ```
10699
+ * @tags navigation
10700
+ */
10701
+ class TreeNode extends i$1 {
10702
+ constructor() {
10703
+ super(...arguments);
10704
+ /**
10705
+ * The value used to identify this node when selected.
10706
+ */
10707
+ this.value = '';
10708
+ /**
10709
+ * The display label for this node.
10710
+ */
10711
+ this.label = '';
10712
+ /**
10713
+ * Optional icon name to display before the label.
10714
+ */
10715
+ this.icon = '';
10716
+ /**
10717
+ * Optional hyperlink to navigate to on click.
10718
+ */
10719
+ this.href = '';
10720
+ /**
10721
+ * Sets or retrieves the window or frame at which to target content.
10722
+ */
10723
+ this.target = '_self';
10724
+ /**
10725
+ * If true, the user cannot interact with the node.
10726
+ */
10727
+ this.disabled = false;
10728
+ /**
10729
+ * Whether the node is currently selected.
10730
+ */
10731
+ this.selected = false;
10732
+ /**
10733
+ * Whether child nodes are visible.
10734
+ */
10735
+ this.expanded = false;
10736
+ /**
10737
+ * The nesting depth level (set automatically by the parent tree-view).
10738
+ */
10739
+ this.level = 0;
10740
+ }
10741
+ focus() {
10742
+ this._nativeElement?.focus();
10743
+ }
10744
+ blur() {
10745
+ this._nativeElement?.blur();
10746
+ }
10747
+ _getChildNodes() {
10748
+ return Array.from(this.children).filter(el => el.tagName.toLowerCase() === 'wc-tree-node');
10749
+ }
10750
+ connectedCallback() {
10751
+ super.connectedCallback();
10752
+ this._updateChildLevels();
10753
+ this.setAttribute('role', 'treeitem');
10754
+ this._syncHostAria();
10755
+ }
10756
+ _syncHostAria() {
10757
+ const hasChildren = this._getChildNodes().length > 0;
10758
+ if (hasChildren) {
10759
+ this.setAttribute('aria-expanded', String(this.expanded));
10760
+ }
10761
+ else {
10762
+ this.removeAttribute('aria-expanded');
10763
+ }
10764
+ this.setAttribute('aria-selected', String(this.selected));
10765
+ this.setAttribute('aria-disabled', String(this.disabled));
10766
+ this.setAttribute('aria-level', String(this.level + 1));
10767
+ }
10768
+ _updateChildLevels() {
10769
+ const children = this._getChildNodes();
10770
+ children.forEach(child => {
10771
+ // eslint-disable-next-line no-param-reassign
10772
+ child.level = this.level + 1;
10773
+ });
10774
+ }
10775
+ _handleClick(event) {
10776
+ if (this.disabled) {
10777
+ event.preventDefault();
10778
+ event.stopPropagation();
10779
+ return;
10780
+ }
10781
+ const hasChildren = this._getChildNodes().length > 0;
10782
+ if (hasChildren) {
10783
+ this.expanded = !this.expanded;
10784
+ }
10785
+ this.dispatchEvent(new CustomEvent('tree-node:click', {
10786
+ bubbles: true,
10787
+ composed: true,
10788
+ detail: {
10789
+ value: this.value || this.label,
10790
+ label: this.label,
10791
+ expanded: this.expanded,
10792
+ },
10793
+ }));
10794
+ }
10795
+ _handleKeyDown(event) {
10796
+ if (this.disabled)
10797
+ return;
10798
+ const hasChildren = this._getChildNodes().length > 0;
10799
+ switch (event.key) {
10800
+ case ' ':
10801
+ case 'Enter':
10802
+ event.preventDefault();
10803
+ if (hasChildren) {
10804
+ this.expanded = !this.expanded;
10805
+ }
10806
+ this.dispatchEvent(new CustomEvent('tree-node:click', {
10807
+ bubbles: true,
10808
+ composed: true,
10809
+ detail: {
10810
+ value: this.value || this.label,
10811
+ label: this.label,
10812
+ expanded: this.expanded,
10813
+ },
10814
+ }));
10815
+ if (this.href) {
10816
+ window.open(this.href, this.target);
10817
+ }
10818
+ break;
10819
+ case 'ArrowLeft':
10820
+ event.preventDefault();
10821
+ if (this.expanded && hasChildren) {
10822
+ this.expanded = false;
10823
+ }
10824
+ break;
10825
+ case 'ArrowRight':
10826
+ event.preventDefault();
10827
+ if (hasChildren) {
10828
+ if (!this.expanded) {
10829
+ this.expanded = true;
10830
+ }
10831
+ else {
10832
+ const firstChild = this._getChildNodes()[0];
10833
+ firstChild?.focus();
10834
+ }
10835
+ }
10836
+ break;
10837
+ }
10838
+ }
10839
+ updated(changedProps) {
10840
+ super.updated(changedProps);
10841
+ if (changedProps.has('level')) {
10842
+ this._updateChildLevels();
10843
+ }
10844
+ this._syncHostAria();
10845
+ }
10846
+ _renderContent(hasChildren) {
10847
+ // 0.125rem offset aligns text visually with the expand/icon space
10848
+ const indentStyle = o$3({
10849
+ paddingInlineStart: `calc(${this.level + 1}rem - 0.125rem)`,
10850
+ });
10851
+ const contentClasses = e$3({
10852
+ 'tree-node-content': true,
10853
+ selected: this.selected,
10854
+ disabled: this.disabled,
10855
+ });
10856
+ const innerContent = b `
10857
+ ${hasChildren
10858
+ ? b `<wc-icon
10859
+ class=${e$3({ 'expand-icon': true, expanded: this.expanded })}
10860
+ name="arrow_right"
10861
+ ></wc-icon>`
10862
+ : b `<span class="icon-space"></span>`}
10863
+ ${this.icon
10864
+ ? b `<wc-icon class="node-icon" name=${this.icon}></wc-icon>`
10865
+ : ''}
10866
+ <span class="tree-node-label">${this.label}<slot name="label"></slot></span>
10867
+ `;
10868
+ if (this.href) {
10869
+ return b `<a
10870
+ class=${contentClasses}
10871
+ style=${indentStyle}
10872
+ href=${this.href}
10873
+ target=${this.target}
10874
+ tabindex=${this.disabled ? '-1' : '0'}
10875
+ @click=${this._handleClick}
10876
+ @keydown=${this._handleKeyDown}
10877
+ >${innerContent}</a>`;
10878
+ }
10879
+ return b `<div
10880
+ class=${contentClasses}
10881
+ style=${indentStyle}
10882
+ tabindex=${this.disabled ? '-1' : '0'}
10883
+ @click=${this._handleClick}
10884
+ @keydown=${this._handleKeyDown}
10885
+ >${innerContent}</div>`;
10886
+ }
10887
+ render() {
10888
+ const hasChildren = this._getChildNodes().length > 0;
10889
+ const nodeSlotClasses = e$3({
10890
+ 'node-children': true,
10891
+ expanded: this.expanded,
10892
+ });
10893
+ return b `<div class="tree-node">
10894
+ ${this._renderContent(hasChildren)}
10895
+ <div class=${nodeSlotClasses}>
10896
+ <slot></slot>
10897
+ </div>
10898
+ </div>`;
10899
+ }
10900
+ }
10901
+ TreeNode.styles = [css_248z$3];
10902
+ __decorate([
10903
+ n({ type: String, reflect: true })
10904
+ ], TreeNode.prototype, "value", void 0);
10905
+ __decorate([
10906
+ n({ type: String, reflect: true })
10907
+ ], TreeNode.prototype, "label", void 0);
10908
+ __decorate([
10909
+ n({ type: String, reflect: true })
10910
+ ], TreeNode.prototype, "icon", void 0);
10911
+ __decorate([
10912
+ n({ type: String, reflect: true })
10913
+ ], TreeNode.prototype, "href", void 0);
10914
+ __decorate([
10915
+ n({ type: String, reflect: true })
10916
+ ], TreeNode.prototype, "target", void 0);
10917
+ __decorate([
10918
+ n({ type: Boolean, reflect: true })
10919
+ ], TreeNode.prototype, "disabled", void 0);
10920
+ __decorate([
10921
+ n({ type: Boolean, reflect: true })
10922
+ ], TreeNode.prototype, "selected", void 0);
10923
+ __decorate([
10924
+ n({ type: Boolean, reflect: true })
10925
+ ], TreeNode.prototype, "expanded", void 0);
10926
+ __decorate([
10927
+ n({ type: Number, reflect: true })
10928
+ ], TreeNode.prototype, "level", void 0);
9747
10929
  __decorate([
9748
- r()
9749
- ], Table.prototype, "isHorizontallyScrolled", void 0);
10930
+ e$4('.tree-node-content')
10931
+ ], TreeNode.prototype, "_nativeElement", void 0);
9750
10932
 
9751
10933
  var css_248z$2 = i`* {
9752
10934
  box-sizing: border-box;
@@ -9760,189 +10942,162 @@ var css_248z$2 = i`* {
9760
10942
  display: block;
9761
10943
  }
9762
10944
 
9763
- .pagination {
9764
- background: var(--color-surface, #fff);
9765
- display: flex;
9766
- align-items: center;
9767
- }
9768
- .pagination .page-sizes-select {
9769
- margin-inline-start: var(--spacing-100, 0.5rem);
9770
- }
9771
- .pagination .page-size-label {
9772
- display: flex;
9773
- align-items: center;
9774
- gap: var(--spacing-100, 0.5rem);
9775
- font-family: var(--typography-body-medium-font-family);
9776
- font-size: var(--typography-body-medium-font-size);
9777
- font-weight: var(--typography-body-medium-font-weight);
9778
- line-height: var(--typography-body-medium-line-height);
9779
- letter-spacing: var(--typography-body-medium-letter-spacing);
9780
- color: var(--color-on-surface-variant);
9781
- white-space: nowrap;
9782
- }
9783
- .pagination .page-size-select {
9784
- border: 1px solid var(--color-outline-variant);
9785
- background: var(--color-surface, #fff);
9786
- color: var(--color-on-surface);
9787
- padding: var(--spacing-050, 0.25rem) var(--spacing-100, 0.5rem);
9788
- cursor: pointer;
9789
- outline: none;
9790
- height: 2.5rem;
9791
- font-family: var(--typography-body-medium-font-family);
9792
- font-size: var(--typography-body-medium-font-size);
9793
- font-weight: var(--typography-body-medium-font-weight);
9794
- line-height: var(--typography-body-medium-line-height);
9795
- letter-spacing: var(--typography-body-medium-letter-spacing);
9796
- }
9797
- .pagination .page-size-select:focus {
9798
- outline: 2px solid var(--color-primary);
9799
- }
9800
- .pagination .pagination-item-count {
9801
- margin-inline-start: var(--spacing-150, 0.75rem);
9802
- flex: 1;
9803
- display: flex;
9804
- align-items: center;
9805
- }
9806
- .pagination .pagination-text {
9807
- font-family: var(--typography-body-medium-font-family);
9808
- font-size: var(--typography-body-medium-font-size);
9809
- font-weight: var(--typography-body-medium-font-weight);
9810
- line-height: var(--typography-body-medium-line-height);
9811
- letter-spacing: var(--typography-body-medium-letter-spacing);
9812
- color: var(--color-on-surface-variant);
9813
- }
9814
- .pagination .arrows {
9815
- --border-radius: 0;
9816
- --button-height: calc(2.5rem - 2px);
10945
+ .tree-view {
10946
+ display: block;
10947
+ padding: var(--spacing-100, 0.5rem) 0;
9817
10948
  }`;
9818
10949
 
9819
- const DEFAULT_PAGE_SIZES = [10, 25, 50, 100];
9820
10950
  /**
9821
- * @label Pagination
9822
- * @tag wc-pagination
9823
- * @rawTag pagination
9824
- * @summary A pagination control with page size selector, item count display, and previous/next navigation.
9825
- * @overview
9826
- * <p>The pagination component provides controls for navigating through paged data sets.</p>
9827
- *
9828
- * @fires {CustomEvent} page - Dispatched when the page or page size changes. Detail: `{ page, pageSize }`.
10951
+ * @label Tree View
10952
+ * @tag wc-tree-view
10953
+ * @rawTag tree-view
10954
+ * @summary A tree view is a hierarchical structure that provides nested levels of navigation. It supports keyboard navigation, single/multi select, and expandable nodes.
9829
10955
  *
9830
10956
  * @example
9831
10957
  * ```html
9832
- * <wc-pagination page="1" page-size="10" total-items="100"></wc-pagination>
10958
+ * <wc-tree-view>
10959
+ * <wc-tree-node label="Parent" expanded>
10960
+ * <wc-tree-node label="Child 1"></wc-tree-node>
10961
+ * <wc-tree-node label="Child 2"></wc-tree-node>
10962
+ * </wc-tree-node>
10963
+ * </wc-tree-view>
9833
10964
  * ```
9834
- * @tags navigation, data
10965
+ * @tags navigation
9835
10966
  */
9836
- class Pagination extends i$1 {
10967
+ class TreeView extends i$1 {
9837
10968
  constructor() {
9838
10969
  super(...arguments);
9839
10970
  /**
9840
- * The current page number (1-based). Defaults to `1`.
9841
- */
9842
- this.page = 1;
9843
- /**
9844
- * The number of rows per page. Defaults to `10`.
9845
- */
9846
- this.pageSize = 10;
9847
- /**
9848
- * Total number of items.
9849
- */
9850
- this.totalItems = 0;
9851
- /**
9852
- * Supported page size options.
10971
+ * The value of the currently selected node.
9853
10972
  */
9854
- this.pageSizes = DEFAULT_PAGE_SIZES;
10973
+ this.selectedNode = '';
10974
+ this._onNodeClick = (event) => {
10975
+ const target = event.target;
10976
+ if (target.disabled)
10977
+ return;
10978
+ const value = event.detail?.value ?? target.value ?? target.label;
10979
+ this.selectedNode = value;
10980
+ // Update selected state on all nodes
10981
+ this._updateSelectedState(value);
10982
+ this.dispatchEvent(new CustomEvent('tree-view:change', {
10983
+ bubbles: true,
10984
+ composed: true,
10985
+ detail: { value, node: target },
10986
+ }));
10987
+ };
10988
+ this._onSlotChange = () => {
10989
+ this._syncSelectedStateFromProperty();
10990
+ };
10991
+ this._onKeyDown = (event) => {
10992
+ const visibleNodes = this._getAllVisibleNodes().filter(n => !n.disabled);
10993
+ if (visibleNodes.length === 0)
10994
+ return;
10995
+ const focusedIndex = visibleNodes.findIndex(node => {
10996
+ const root = node.shadowRoot;
10997
+ return root?.activeElement !== null && root?.activeElement !== undefined;
10998
+ });
10999
+ if (focusedIndex === -1 && event.key !== 'Tab')
11000
+ return;
11001
+ switch (event.key) {
11002
+ case 'ArrowDown': {
11003
+ event.preventDefault();
11004
+ const nextIndex = (focusedIndex + 1) % visibleNodes.length;
11005
+ visibleNodes[nextIndex]?.focus();
11006
+ break;
11007
+ }
11008
+ case 'ArrowUp': {
11009
+ event.preventDefault();
11010
+ const prevIndex = (focusedIndex - 1 + visibleNodes.length) % visibleNodes.length;
11011
+ visibleNodes[prevIndex]?.focus();
11012
+ break;
11013
+ }
11014
+ case 'Home':
11015
+ event.preventDefault();
11016
+ visibleNodes[0]?.focus();
11017
+ break;
11018
+ case 'End':
11019
+ event.preventDefault();
11020
+ visibleNodes[visibleNodes.length - 1]?.focus();
11021
+ break;
11022
+ }
11023
+ };
9855
11024
  }
9856
- dispatchPageEvent() {
9857
- this.dispatchEvent(new CustomEvent('page', {
9858
- detail: { page: this.page, pageSize: this.pageSize },
9859
- bubbles: true,
9860
- composed: true,
9861
- }));
11025
+ connectedCallback() {
11026
+ super.connectedCallback();
11027
+ this.addEventListener('tree-node:click', this._onNodeClick);
11028
+ this.addEventListener('keydown', this._onKeyDown);
11029
+ this.setAttribute('role', 'tree');
9862
11030
  }
9863
- render() {
9864
- const startItem = this.pageSize * (this.page - 1);
9865
- const endItem = Math.min(this.pageSize * this.page, this.totalItems);
9866
- const isFirstPage = this.page === 1;
9867
- const isLastPage = this.pageSize * this.page >= this.totalItems;
9868
- return b `
9869
- <div class="pagination">
9870
- <div class="page-sizes-select">
9871
- <label class="page-size-label">
9872
- Items per page:
9873
- <select
9874
- class="page-size-select"
9875
- .value=${String(this.pageSize)}
9876
- @change=${(e) => {
9877
- this.pageSize = parseInt(e.target.value, 10);
9878
- this.page = 1;
9879
- this.dispatchPageEvent();
9880
- }}
9881
- >
9882
- ${this.pageSizes.map(size => b `
9883
- <option value=${size} ?selected=${this.pageSize === size}>
9884
- ${size}
9885
- </option>
9886
- `)}
9887
- </select>
9888
- </label>
9889
- </div>
9890
- <div class="pagination-item-count">
9891
- <span class="pagination-text">
9892
- ${startItem} - ${endItem} of ${this.totalItems} items
9893
- </span>
9894
- </div>
9895
- <div class="pagination-right">
9896
- <div class="table-footer-right-content">
9897
- <div class="table-footer-right-content-pagination">
9898
- <wc-button
9899
- class="arrows"
9900
- color="secondary"
9901
- variant="text"
9902
- ?disabled=${isFirstPage}
9903
- @click=${() => {
9904
- if (!isFirstPage) {
9905
- this.page -= 1;
9906
- this.dispatchPageEvent();
9907
- }
9908
- }}
9909
- >
9910
- <wc-icon slot="icon" name="arrow--left"></wc-icon>
9911
- </wc-button>
9912
- <wc-button
9913
- color="secondary"
9914
- variant="text"
9915
- class="arrows"
9916
- ?disabled=${isLastPage}
9917
- @click=${() => {
9918
- if (!isLastPage) {
9919
- this.page += 1;
9920
- this.dispatchPageEvent();
9921
- }
9922
- }}
9923
- >
9924
- <wc-icon slot="icon" name="arrow--right"></wc-icon>
9925
- </wc-button>
9926
- </div>
9927
- </div>
9928
- </div>
9929
- </div>
9930
- `;
11031
+ updated(changedProps) {
11032
+ super.updated(changedProps);
11033
+ if (changedProps.has('selectedNode')) {
11034
+ this._syncSelectedStateFromProperty();
11035
+ }
11036
+ }
11037
+ disconnectedCallback() {
11038
+ super.disconnectedCallback();
11039
+ this.removeEventListener('tree-node:click', this._onNodeClick);
11040
+ this.removeEventListener('keydown', this._onKeyDown);
11041
+ }
11042
+ _getTopLevelNodes() {
11043
+ return Array.from(this.children).filter(el => el.tagName.toLowerCase() === 'wc-tree-node');
11044
+ }
11045
+ _getAllVisibleNodes() {
11046
+ const result = [];
11047
+ const collect = (nodes) => {
11048
+ nodes.forEach(node => {
11049
+ result.push(node);
11050
+ if (node.expanded) {
11051
+ const children = Array.from(node.children).filter(el => el.tagName.toLowerCase() === 'wc-tree-node');
11052
+ collect(children);
11053
+ }
11054
+ });
11055
+ };
11056
+ collect(this._getTopLevelNodes());
11057
+ return result;
11058
+ }
11059
+ _updateSelectedState(selectedValue) {
11060
+ const allNodes = this._collectAllNodes(this._getTopLevelNodes());
11061
+ allNodes.forEach(node => {
11062
+ const nodeValue = node.value || node.label;
11063
+ // eslint-disable-next-line no-param-reassign
11064
+ node.selected = nodeValue === selectedValue;
11065
+ });
11066
+ }
11067
+ _clearSelectedState() {
11068
+ const allNodes = this._collectAllNodes(this._getTopLevelNodes());
11069
+ allNodes.forEach(node => {
11070
+ // eslint-disable-next-line no-param-reassign
11071
+ node.selected = false;
11072
+ });
11073
+ }
11074
+ _syncSelectedStateFromProperty() {
11075
+ if (this.selectedNode) {
11076
+ this._updateSelectedState(this.selectedNode);
11077
+ return;
11078
+ }
11079
+ this._clearSelectedState();
11080
+ }
11081
+ _collectAllNodes(nodes) {
11082
+ const result = [];
11083
+ nodes.forEach(node => {
11084
+ result.push(node);
11085
+ const children = Array.from(node.children).filter(el => el.tagName.toLowerCase() === 'wc-tree-node');
11086
+ result.push(...this._collectAllNodes(children));
11087
+ });
11088
+ return result;
11089
+ }
11090
+ render() {
11091
+ return b `<div class="tree-view">
11092
+ <slot @slotchange=${this._onSlotChange}></slot>
11093
+ </div>`;
9931
11094
  }
9932
11095
  }
9933
- Pagination.styles = [css_248z$2];
9934
- __decorate([
9935
- n({ type: Number })
9936
- ], Pagination.prototype, "page", void 0);
9937
- __decorate([
9938
- n({ type: Number, attribute: 'page-size' })
9939
- ], Pagination.prototype, "pageSize", void 0);
9940
- __decorate([
9941
- n({ type: Number, attribute: 'total-items' })
9942
- ], Pagination.prototype, "totalItems", void 0);
11096
+ TreeView.styles = [css_248z$2];
11097
+ TreeView.Node = TreeNode;
9943
11098
  __decorate([
9944
- n({ type: Array, attribute: 'page-sizes' })
9945
- ], Pagination.prototype, "pageSizes", void 0);
11099
+ n({ type: String, attribute: 'selected-node', reflect: true })
11100
+ ], TreeView.prototype, "selectedNode", void 0);
9946
11101
 
9947
11102
  var css_248z$1 = i`* {
9948
11103
  box-sizing: border-box;
@@ -9953,343 +11108,219 @@ var css_248z$1 = i`* {
9953
11108
  }
9954
11109
 
9955
11110
  :host {
9956
- display: block;
9957
- --tree-node-height: 2.5rem;
9958
- --tree-node-icon-size: 1.25rem;
9959
- --tree-node-border-radius: var(--global-shape-corner-full, 9999px);
9960
- --tree-node-label-color: var(--color-on-surface);
9961
- --tree-node-icon-color: var(--color-on-surface-variant);
9962
- --tree-node-selected-background: var(--color-secondary-container);
9963
- --tree-node-selected-color: var(--color-on-secondary-container);
9964
- --tree-node-hover-background: var(--color-inverse-primary);
9965
- --tree-node-focus-ring-color: var(--color-primary);
9966
- }
9967
-
9968
- .tree-node {
9969
- display: block;
11111
+ display: inline-flex;
11112
+ max-width: 42rem;
11113
+ min-width: 21.5rem;
11114
+ --snackbar-container-color: var(--color-inverse-surface);
11115
+ --snackbar-label-text-color: var(--color-inverse-on-surface);
11116
+ --snackbar-action-text-color: var(--color-inverse-primary);
11117
+ --snackbar-close-icon-color: var(--color-inverse-on-surface);
11118
+ --snackbar-border-radius: var(--shape-corner-extra-small);
9970
11119
  }
9971
11120
 
9972
- .tree-node-content {
9973
- display: flex;
9974
- align-items: center;
9975
- gap: 0.25rem;
9976
- height: var(--tree-node-height);
9977
- border-radius: var(--tree-node-border-radius);
9978
- color: var(--tree-node-label-color);
9979
- cursor: pointer;
9980
- user-select: none;
9981
- text-decoration: none;
9982
- outline: none;
11121
+ .snackbar {
9983
11122
  font-family: var(--typography-body-medium-font-family) !important;
9984
11123
  font-size: var(--typography-body-medium-font-size) !important;
9985
11124
  font-weight: var(--typography-body-medium-font-weight) !important;
9986
11125
  line-height: var(--typography-body-medium-line-height) !important;
9987
11126
  letter-spacing: var(--typography-body-medium-letter-spacing) !important;
9988
- }
9989
- .tree-node-content:not(.disabled):hover {
9990
- background-color: var(--tree-node-hover-background);
9991
- }
9992
- .tree-node-content:focus-visible {
9993
- outline: 2px solid var(--tree-node-focus-ring-color);
9994
- }
9995
- .tree-node-content.selected {
9996
- background-color: var(--tree-node-selected-background);
9997
- color: var(--tree-node-selected-color);
9998
- }
9999
- .tree-node-content.selected .node-icon {
10000
- --icon-color: var(--tree-node-selected-color);
10001
- }
10002
- .tree-node-content.disabled {
10003
- cursor: not-allowed;
10004
- opacity: 0.38;
11127
+ align-items: center;
11128
+ background-color: var(--snackbar-container-color);
11129
+ border-radius: var(--snackbar-border-radius);
11130
+ color: var(--snackbar-label-text-color);
11131
+ display: inline-flex;
11132
+ gap: var(--spacing-100);
11133
+ min-height: 3rem;
11134
+ opacity: 0;
11135
+ padding: var(--spacing-100) var(--spacing-200);
10005
11136
  pointer-events: none;
11137
+ transform: translateY(0.5rem);
11138
+ transition: opacity var(--duration-short2) var(--easing-standard), transform var(--duration-short2) var(--easing-standard);
10006
11139
  }
10007
11140
 
10008
- .expand-icon {
10009
- --icon-size: var(--tree-node-icon-size);
10010
- --icon-color: var(--tree-node-icon-color);
10011
- flex-shrink: 0;
10012
- transition: transform var(--duration-short2, 200ms) var(--easing-standard, ease);
10013
- }
10014
- .expand-icon.expanded {
10015
- transform: rotate(90deg);
11141
+ .snackbar.open {
11142
+ opacity: 1;
11143
+ pointer-events: auto;
11144
+ transform: translateY(0);
10016
11145
  }
10017
11146
 
10018
- .icon-space {
10019
- display: inline-block;
10020
- width: var(--tree-node-icon-size);
10021
- height: var(--tree-node-icon-size);
10022
- flex-shrink: 0;
11147
+ .label {
11148
+ flex: 1 1 auto;
11149
+ color: inherit;
10023
11150
  }
10024
11151
 
10025
- .node-icon {
10026
- --icon-size: var(--tree-node-icon-size);
10027
- --icon-color: var(--tree-node-icon-color);
10028
- flex-shrink: 0;
11152
+ .action,
11153
+ .close {
11154
+ font-family: var(--typography-label-large-font-family) !important;
11155
+ font-size: var(--typography-label-large-font-size) !important;
11156
+ font-weight: var(--typography-label-large-font-weight) !important;
11157
+ line-height: var(--typography-label-large-line-height) !important;
11158
+ letter-spacing: var(--typography-label-large-letter-spacing) !important;
11159
+ align-items: center;
11160
+ background: transparent;
11161
+ border: none;
11162
+ color: var(--snackbar-action-text-color);
11163
+ cursor: pointer;
11164
+ display: inline-flex;
11165
+ justify-content: center;
11166
+ margin: 0;
11167
+ min-height: 2rem;
11168
+ min-width: 2rem;
11169
+ padding: 0 var(--spacing-100);
10029
11170
  }
10030
11171
 
10031
- .tree-node-label {
10032
- flex: 1;
10033
- overflow: hidden;
10034
- text-overflow: ellipsis;
10035
- white-space: nowrap;
11172
+ .close {
11173
+ color: var(--snackbar-close-icon-color);
11174
+ padding: 0;
10036
11175
  }
10037
11176
 
10038
- .node-children {
10039
- display: none;
11177
+ .close wc-icon {
11178
+ --icon-size: 1.125rem;
11179
+ color: inherit;
10040
11180
  }
10041
- .node-children.expanded {
10042
- display: block;
11181
+
11182
+ .snackbar.multiline {
11183
+ align-items: flex-start;
10043
11184
  }`;
10044
11185
 
10045
11186
  /**
10046
- * @label Tree Node
10047
- * @tag wc-tree-node
10048
- * @rawTag tree-node
10049
- * @parentRawTag tree-view
10050
- * @summary A tree node represents a single item in a hierarchical tree structure. It supports nesting, icons, links, and keyboard navigation.
11187
+ * @label Snackbar
11188
+ * @tag wc-snackbar
11189
+ * @rawTag snackbar
11190
+ * @summary Snackbars provide brief messages about app processes at the bottom of the screen.
11191
+ *
11192
+ * @cssprop --snackbar-container-color - Container color for the snackbar.
11193
+ * @cssprop --snackbar-label-text-color - Label text color for the snackbar.
11194
+ * @cssprop --snackbar-action-text-color - Action text color.
11195
+ * @cssprop --snackbar-close-icon-color - Close icon color.
11196
+ * @cssprop --snackbar-border-radius - Border radius of the snackbar surface.
10051
11197
  *
10052
11198
  * @example
10053
11199
  * ```html
10054
- * <wc-tree-view>
10055
- * <wc-tree-node label="Parent">
10056
- * <wc-tree-node label="Child"></wc-tree-node>
10057
- * </wc-tree-node>
10058
- * </wc-tree-view>
11200
+ * <wc-snackbar open message="Message archived" action-label="Undo"></wc-snackbar>
10059
11201
  * ```
10060
- * @tags navigation
11202
+ * @tags display, feedback
10061
11203
  */
10062
- class TreeNode extends i$1 {
11204
+ class Snackbar extends i$1 {
10063
11205
  constructor() {
10064
11206
  super(...arguments);
10065
- /**
10066
- * The value used to identify this node when selected.
10067
- */
10068
- this.value = '';
10069
- /**
10070
- * The display label for this node.
10071
- */
10072
- this.label = '';
10073
- /**
10074
- * Optional icon name to display before the label.
10075
- */
10076
- this.icon = '';
10077
- /**
10078
- * Optional hyperlink to navigate to on click.
10079
- */
10080
- this.href = '';
10081
- /**
10082
- * Sets or retrieves the window or frame at which to target content.
10083
- */
10084
- this.target = '_self';
10085
- /**
10086
- * If true, the user cannot interact with the node.
10087
- */
10088
- this.disabled = false;
10089
- /**
10090
- * Whether the node is currently selected.
10091
- */
10092
- this.selected = false;
10093
- /**
10094
- * Whether child nodes are visible.
10095
- */
10096
- this.expanded = false;
10097
- /**
10098
- * The nesting depth level (set automatically by the parent tree-view).
10099
- */
10100
- this.level = 0;
10101
- }
10102
- focus() {
10103
- this._nativeElement?.focus();
10104
- }
10105
- blur() {
10106
- this._nativeElement?.blur();
10107
- }
10108
- _getChildNodes() {
10109
- return Array.from(this.children).filter(el => el.tagName.toLowerCase() === 'wc-tree-node');
10110
- }
10111
- connectedCallback() {
10112
- super.connectedCallback();
10113
- this._updateChildLevels();
10114
- this.setAttribute('role', 'treeitem');
10115
- this._syncHostAria();
11207
+ this.open = false;
11208
+ this.message = '';
11209
+ this.actionLabel = '';
11210
+ this.showCloseIcon = false;
11211
+ this.duration = 4000;
11212
+ this.multiline = false;
11213
+ this.hideTimer = null;
10116
11214
  }
10117
- _syncHostAria() {
10118
- const hasChildren = this._getChildNodes().length > 0;
10119
- if (hasChildren) {
10120
- this.setAttribute('aria-expanded', String(this.expanded));
10121
- }
10122
- else {
10123
- this.removeAttribute('aria-expanded');
10124
- }
10125
- this.setAttribute('aria-selected', String(this.selected));
10126
- this.setAttribute('aria-disabled', String(this.disabled));
10127
- this.setAttribute('aria-level', String(this.level + 1));
11215
+ show() {
11216
+ this.open = true;
10128
11217
  }
10129
- _updateChildLevels() {
10130
- const children = this._getChildNodes();
10131
- children.forEach(child => {
10132
- // eslint-disable-next-line no-param-reassign
10133
- child.level = this.level + 1;
10134
- });
11218
+ hide() {
11219
+ this.close('programmatic');
10135
11220
  }
10136
- _handleClick(event) {
10137
- if (this.disabled) {
10138
- event.preventDefault();
10139
- event.stopPropagation();
11221
+ close(reason) {
11222
+ if (!this.open) {
10140
11223
  return;
10141
11224
  }
10142
- const hasChildren = this._getChildNodes().length > 0;
10143
- if (hasChildren) {
10144
- this.expanded = !this.expanded;
10145
- }
10146
- this.dispatchEvent(new CustomEvent('tree-node:click', {
11225
+ this.open = false;
11226
+ this.dispatchEvent(new CustomEvent('snackbar-close', {
11227
+ detail: { reason },
11228
+ bubbles: true,
11229
+ composed: true,
11230
+ }));
11231
+ }
11232
+ dispatchActionEvent() {
11233
+ this.dispatchEvent(new CustomEvent('snackbar-action', {
10147
11234
  bubbles: true,
10148
11235
  composed: true,
10149
- detail: {
10150
- value: this.value || this.label,
10151
- label: this.label,
10152
- expanded: this.expanded,
10153
- },
10154
11236
  }));
10155
11237
  }
10156
- _handleKeyDown(event) {
10157
- if (this.disabled)
11238
+ handleActionClick() {
11239
+ this.dispatchActionEvent();
11240
+ this.close('action');
11241
+ }
11242
+ handleCloseClick() {
11243
+ this.close('dismiss');
11244
+ }
11245
+ clearTimer() {
11246
+ if (this.hideTimer !== null) {
11247
+ clearTimeout(this.hideTimer);
11248
+ this.hideTimer = null;
11249
+ }
11250
+ }
11251
+ scheduleAutoHide() {
11252
+ this.clearTimer();
11253
+ if (!this.open || this.duration <= 0) {
10158
11254
  return;
10159
- const hasChildren = this._getChildNodes().length > 0;
10160
- switch (event.key) {
10161
- case ' ':
10162
- case 'Enter':
10163
- event.preventDefault();
10164
- if (hasChildren) {
10165
- this.expanded = !this.expanded;
10166
- }
10167
- this.dispatchEvent(new CustomEvent('tree-node:click', {
10168
- bubbles: true,
10169
- composed: true,
10170
- detail: {
10171
- value: this.value || this.label,
10172
- label: this.label,
10173
- expanded: this.expanded,
10174
- },
10175
- }));
10176
- if (this.href) {
10177
- window.open(this.href, this.target);
10178
- }
10179
- break;
10180
- case 'ArrowLeft':
10181
- event.preventDefault();
10182
- if (this.expanded && hasChildren) {
10183
- this.expanded = false;
10184
- }
10185
- break;
10186
- case 'ArrowRight':
10187
- event.preventDefault();
10188
- if (hasChildren) {
10189
- if (!this.expanded) {
10190
- this.expanded = true;
10191
- }
10192
- else {
10193
- const firstChild = this._getChildNodes()[0];
10194
- firstChild?.focus();
10195
- }
10196
- }
10197
- break;
10198
11255
  }
11256
+ this.hideTimer = setTimeout(() => {
11257
+ this.close('timeout');
11258
+ }, this.duration);
10199
11259
  }
10200
- updated(changedProps) {
10201
- super.updated(changedProps);
10202
- if (changedProps.has('level')) {
10203
- this._updateChildLevels();
11260
+ updated(changedProperties) {
11261
+ if (changedProperties.has('open')) {
11262
+ this.scheduleAutoHide();
10204
11263
  }
10205
- this._syncHostAria();
10206
11264
  }
10207
- _renderContent(hasChildren) {
10208
- // 0.125rem offset aligns text visually with the expand/icon space
10209
- const indentStyle = o$3({
10210
- paddingInlineStart: `calc(${this.level + 1}rem - 0.125rem)`,
10211
- });
10212
- const contentClasses = e$3({
10213
- 'tree-node-content': true,
10214
- selected: this.selected,
10215
- disabled: this.disabled,
10216
- });
10217
- const innerContent = b `
10218
- ${hasChildren
10219
- ? b `<wc-icon
10220
- class=${e$3({ 'expand-icon': true, expanded: this.expanded })}
10221
- name="arrow_right"
10222
- ></wc-icon>`
10223
- : b `<span class="icon-space"></span>`}
10224
- ${this.icon
10225
- ? b `<wc-icon class="node-icon" name=${this.icon}></wc-icon>`
10226
- : ''}
10227
- <span class="tree-node-label">${this.label}<slot name="label"></slot></span>
10228
- `;
10229
- if (this.href) {
10230
- return b `<a
10231
- class=${contentClasses}
10232
- style=${indentStyle}
10233
- href=${this.href}
10234
- target=${this.target}
10235
- tabindex=${this.disabled ? '-1' : '0'}
10236
- @click=${this._handleClick}
10237
- @keydown=${this._handleKeyDown}
10238
- >${innerContent}</a>`;
10239
- }
10240
- return b `<div
10241
- class=${contentClasses}
10242
- style=${indentStyle}
10243
- tabindex=${this.disabled ? '-1' : '0'}
10244
- @click=${this._handleClick}
10245
- @keydown=${this._handleKeyDown}
10246
- >${innerContent}</div>`;
11265
+ disconnectedCallback() {
11266
+ this.clearTimer();
11267
+ super.disconnectedCallback();
10247
11268
  }
10248
11269
  render() {
10249
- const hasChildren = this._getChildNodes().length > 0;
10250
- const nodeSlotClasses = e$3({
10251
- 'node-children': true,
10252
- expanded: this.expanded,
10253
- });
10254
- return b `<div class="tree-node">
10255
- ${this._renderContent(hasChildren)}
10256
- <div class=${nodeSlotClasses}>
10257
- <slot></slot>
11270
+ const liveRole = this.actionLabel || this.showCloseIcon ? 'alert' : 'status';
11271
+ return b `
11272
+ <div
11273
+ class=${e$3({
11274
+ snackbar: true,
11275
+ open: this.open,
11276
+ multiline: this.multiline,
11277
+ })}
11278
+ role=${liveRole}
11279
+ aria-live="polite"
11280
+ >
11281
+ <div class="label">
11282
+ <slot>${this.message}</slot>
11283
+ </div>
11284
+
11285
+ ${this.actionLabel
11286
+ ? b `<button class="action" type="button" @click=${this.handleActionClick}>
11287
+ ${this.actionLabel}
11288
+ </button>`
11289
+ : A}
11290
+
11291
+ ${this.showCloseIcon
11292
+ ? b `<button
11293
+ class="close"
11294
+ type="button"
11295
+ aria-label="Dismiss notification"
11296
+ @click=${this.handleCloseClick}
11297
+ >
11298
+ <wc-icon name="close"></wc-icon>
11299
+ </button>`
11300
+ : A}
10258
11301
  </div>
10259
- </div>`;
11302
+ `;
10260
11303
  }
10261
11304
  }
10262
- TreeNode.styles = [css_248z$1];
10263
- __decorate([
10264
- n({ type: String, reflect: true })
10265
- ], TreeNode.prototype, "value", void 0);
10266
- __decorate([
10267
- n({ type: String, reflect: true })
10268
- ], TreeNode.prototype, "label", void 0);
11305
+ Snackbar.styles = [css_248z$1];
10269
11306
  __decorate([
10270
- n({ type: String, reflect: true })
10271
- ], TreeNode.prototype, "icon", void 0);
11307
+ n({ type: Boolean, reflect: true })
11308
+ ], Snackbar.prototype, "open", void 0);
10272
11309
  __decorate([
10273
- n({ type: String, reflect: true })
10274
- ], TreeNode.prototype, "href", void 0);
11310
+ n({ type: String })
11311
+ ], Snackbar.prototype, "message", void 0);
10275
11312
  __decorate([
10276
- n({ type: String, reflect: true })
10277
- ], TreeNode.prototype, "target", void 0);
11313
+ n({ type: String, attribute: 'action-label' })
11314
+ ], Snackbar.prototype, "actionLabel", void 0);
10278
11315
  __decorate([
10279
- n({ type: Boolean, reflect: true })
10280
- ], TreeNode.prototype, "disabled", void 0);
11316
+ n({ type: Boolean, attribute: 'show-close-icon' })
11317
+ ], Snackbar.prototype, "showCloseIcon", void 0);
10281
11318
  __decorate([
10282
- n({ type: Boolean, reflect: true })
10283
- ], TreeNode.prototype, "selected", void 0);
11319
+ n({ type: Number })
11320
+ ], Snackbar.prototype, "duration", void 0);
10284
11321
  __decorate([
10285
11322
  n({ type: Boolean, reflect: true })
10286
- ], TreeNode.prototype, "expanded", void 0);
10287
- __decorate([
10288
- n({ type: Number, reflect: true })
10289
- ], TreeNode.prototype, "level", void 0);
10290
- __decorate([
10291
- e$4('.tree-node-content')
10292
- ], TreeNode.prototype, "_nativeElement", void 0);
11323
+ ], Snackbar.prototype, "multiline", void 0);
10293
11324
 
10294
11325
  var css_248z = i`* {
10295
11326
  box-sizing: border-box;
@@ -10300,165 +11331,449 @@ var css_248z = i`* {
10300
11331
  }
10301
11332
 
10302
11333
  :host {
10303
- display: block;
11334
+ display: inline-block;
11335
+ --radio-size: 20px;
11336
+ --radio-dot-size: 12px;
11337
+ --radio-selected-color: var(--color-primary);
11338
+ --radio-unselected-color: var(--color-on-surface-variant);
11339
+ --radio-state-layer-size: 40px;
11340
+ --radio-disabled-opacity: 0.38;
10304
11341
  }
10305
11342
 
10306
- .tree-view {
10307
- display: block;
10308
- padding: var(--spacing-100, 0.5rem) 0;
11343
+ .radio {
11344
+ position: relative;
11345
+ display: inline-flex;
11346
+ align-items: center;
11347
+ cursor: pointer;
11348
+ user-select: none;
11349
+ vertical-align: middle;
11350
+ gap: 8px;
11351
+ font-family: var(--typography-body-medium-font-family) !important;
11352
+ font-size: var(--typography-body-medium-font-size) !important;
11353
+ font-weight: var(--typography-body-medium-font-weight) !important;
11354
+ line-height: var(--typography-body-medium-line-height) !important;
11355
+ letter-spacing: var(--typography-body-medium-letter-spacing) !important;
11356
+ }
11357
+ .radio .input-native {
11358
+ position: absolute;
11359
+ width: 1px;
11360
+ height: 1px;
11361
+ padding: 0;
11362
+ margin: -1px;
11363
+ overflow: hidden;
11364
+ clip: rect(0, 0, 0, 0);
11365
+ border: 0;
11366
+ }
11367
+ .radio .container {
11368
+ position: relative;
11369
+ display: inline-flex;
11370
+ align-items: center;
11371
+ justify-content: center;
11372
+ width: var(--radio-state-layer-size);
11373
+ height: var(--radio-state-layer-size);
11374
+ cursor: inherit;
11375
+ outline: none;
11376
+ flex-shrink: 0;
11377
+ }
11378
+ .radio .state-layer {
11379
+ position: absolute;
11380
+ inset: 0;
11381
+ border-radius: 50%;
11382
+ opacity: 0;
11383
+ transition: opacity var(--duration-short2) var(--easing-standard);
11384
+ }
11385
+ .radio .outer-circle {
11386
+ position: absolute;
11387
+ width: var(--radio-size);
11388
+ height: var(--radio-size);
11389
+ border: 2px solid var(--radio-unselected-color);
11390
+ border-radius: 50%;
11391
+ box-sizing: border-box;
11392
+ transition: border-color var(--duration-short2) var(--easing-standard);
11393
+ }
11394
+ .radio .inner-circle {
11395
+ position: absolute;
11396
+ width: var(--radio-dot-size);
11397
+ height: var(--radio-dot-size);
11398
+ background: var(--radio-selected-color);
11399
+ border-radius: 50%;
11400
+ opacity: 0;
11401
+ transform: scale(0.5);
11402
+ transition: transform var(--duration-short2) var(--easing-standard), opacity var(--duration-short2) var(--easing-standard);
11403
+ }
11404
+ .radio .label {
11405
+ color: var(--color-on-surface);
11406
+ cursor: inherit;
11407
+ }
11408
+ .radio:hover:not(.disabled):not(.readonly) .state-layer {
11409
+ opacity: 0.08;
11410
+ background: var(--color-on-surface);
11411
+ }
11412
+ .radio:hover:not(.disabled):not(.readonly).state-checked .state-layer {
11413
+ background: var(--radio-selected-color);
11414
+ }
11415
+ .radio.has-focus:not(.active):not(.disabled):not(.readonly) .state-layer {
11416
+ opacity: 0.12;
11417
+ background: var(--color-on-surface);
11418
+ }
11419
+ .radio.has-focus:not(.active):not(.disabled):not(.readonly) .container {
11420
+ outline: 3px solid var(--color-primary);
11421
+ outline-offset: 2px;
11422
+ border-radius: 50%;
11423
+ }
11424
+ .radio.has-focus:not(.active):not(.disabled):not(.readonly).state-checked .state-layer {
11425
+ background: var(--radio-selected-color);
11426
+ }
11427
+ .radio.active:not(.disabled):not(.readonly) .state-layer {
11428
+ opacity: 0.12;
11429
+ background: var(--color-on-surface);
11430
+ }
11431
+ .radio.active:not(.disabled):not(.readonly).state-checked .state-layer {
11432
+ background: var(--radio-selected-color);
11433
+ }
11434
+
11435
+ .radio.state-checked .outer-circle {
11436
+ border-color: var(--radio-selected-color);
11437
+ }
11438
+ .radio.state-checked .inner-circle {
11439
+ opacity: 1;
11440
+ transform: scale(1);
11441
+ }
11442
+
11443
+ .radio.readonly {
11444
+ cursor: default;
11445
+ }
11446
+ .radio.readonly .state-layer {
11447
+ display: none;
11448
+ }
11449
+ .radio.readonly .outer-circle {
11450
+ border-color: var(--color-on-surface-variant);
11451
+ }
11452
+ .radio.readonly.state-checked .inner-circle {
11453
+ background: var(--color-on-surface-variant);
11454
+ }
11455
+
11456
+ .radio.disabled {
11457
+ cursor: not-allowed;
11458
+ opacity: var(--radio-disabled-opacity);
11459
+ }
11460
+ .radio.disabled .state-layer {
11461
+ display: none;
11462
+ }
11463
+ .radio.disabled .label {
11464
+ color: var(--color-on-surface);
11465
+ }
11466
+ .radio.disabled .outer-circle {
11467
+ border-color: var(--color-on-surface);
11468
+ }
11469
+ .radio.disabled.state-checked .inner-circle {
11470
+ background: var(--color-on-surface);
10309
11471
  }`;
10310
11472
 
10311
- /**
10312
- * @label Tree View
10313
- * @tag wc-tree-view
10314
- * @rawTag tree-view
10315
- * @summary A tree view is a hierarchical structure that provides nested levels of navigation. It supports keyboard navigation, single/multi select, and expandable nodes.
10316
- *
10317
- * @example
10318
- * ```html
10319
- * <wc-tree-view>
10320
- * <wc-tree-node label="Parent" expanded>
10321
- * <wc-tree-node label="Child 1"></wc-tree-node>
10322
- * <wc-tree-node label="Child 2"></wc-tree-node>
10323
- * </wc-tree-node>
10324
- * </wc-tree-view>
10325
- * ```
10326
- * @tags navigation
10327
- */
10328
- class TreeView extends i$1 {
11473
+ class Radio extends i$1 {
10329
11474
  constructor() {
10330
11475
  super(...arguments);
10331
11476
  /**
10332
- * The value of the currently selected node.
11477
+ * The input field name for grouping radios.
11478
+ */
11479
+ this.name = '';
11480
+ /**
11481
+ * The submitted value when this radio is selected.
11482
+ */
11483
+ this.value = '';
11484
+ /**
11485
+ * The radio label.
11486
+ */
11487
+ this.label = '';
11488
+ /**
11489
+ * Whether the radio is selected.
11490
+ */
11491
+ this.checked = false;
11492
+ /**
11493
+ * If true, required icon is shown. Defaults to `false`.
11494
+ */
11495
+ this.required = false;
11496
+ /**
11497
+ * If true, the radio is readonly. Defaults to `false`.
10333
11498
  */
10334
- this.selectedNode = '';
10335
- this._onNodeClick = (event) => {
10336
- const target = event.target;
10337
- if (target.disabled)
10338
- return;
10339
- const value = event.detail?.value ?? target.value ?? target.label;
10340
- this.selectedNode = value;
10341
- // Update selected state on all nodes
10342
- this._updateSelectedState(value);
10343
- this.dispatchEvent(new CustomEvent('tree-view:change', {
11499
+ this.readonly = false;
11500
+ /**
11501
+ * If true, the user cannot interact with the radio. Defaults to `false`.
11502
+ */
11503
+ this.disabled = false;
11504
+ /**
11505
+ * Configuration object for aria attributes.
11506
+ */
11507
+ this.configAria = {};
11508
+ this.hasFocus = false;
11509
+ this.isActive = false;
11510
+ this.slotHasContent = false;
11511
+ this.isGroupFocusTarget = false;
11512
+ this.windowMouseUp = () => {
11513
+ if (this.isActive) {
11514
+ this.isActive = false;
11515
+ }
11516
+ };
11517
+ this.windowKeyUp = (evt) => {
11518
+ if (this.isActive && evt.key === ' ') {
11519
+ evt.preventDefault();
11520
+ this.isActive = false;
11521
+ }
11522
+ };
11523
+ this.mouseDownHandler = () => {
11524
+ this.isActive = true;
11525
+ };
11526
+ this.keyDownHandler = (evt) => {
11527
+ if (evt.key === ' ') {
11528
+ evt.preventDefault();
11529
+ this.isActive = true;
11530
+ this.selectRadio(evt);
11531
+ }
11532
+ else if (evt.key === 'ArrowRight' || evt.key === 'ArrowDown') {
11533
+ evt.preventDefault();
11534
+ this.navigateGroup(Radio.DIRECTION_NEXT);
11535
+ }
11536
+ else if (evt.key === 'ArrowLeft' || evt.key === 'ArrowUp') {
11537
+ evt.preventDefault();
11538
+ this.navigateGroup(Radio.DIRECTION_PREVIOUS);
11539
+ }
11540
+ };
11541
+ this.clickHandler = (ev) => {
11542
+ this.selectRadio(ev);
11543
+ };
11544
+ this.blurHandler = (ev) => {
11545
+ this.hasFocus = false;
11546
+ this.dispatchEvent(new CustomEvent('blur', {
11547
+ detail: ev,
10344
11548
  bubbles: true,
10345
11549
  composed: true,
10346
- detail: { value, node: target },
10347
11550
  }));
10348
11551
  };
10349
- this._onSlotChange = () => {
10350
- this._syncSelectedStateFromProperty();
10351
- };
10352
- this._onKeyDown = (event) => {
10353
- const visibleNodes = this._getAllVisibleNodes().filter(n => !n.disabled);
10354
- if (visibleNodes.length === 0)
10355
- return;
10356
- const focusedIndex = visibleNodes.findIndex(node => {
10357
- const root = node.shadowRoot;
10358
- return root?.activeElement !== null && root?.activeElement !== undefined;
10359
- });
10360
- if (focusedIndex === -1 && event.key !== 'Tab')
10361
- return;
10362
- switch (event.key) {
10363
- case 'ArrowDown': {
10364
- event.preventDefault();
10365
- const nextIndex = (focusedIndex + 1) % visibleNodes.length;
10366
- visibleNodes[nextIndex]?.focus();
10367
- break;
10368
- }
10369
- case 'ArrowUp': {
10370
- event.preventDefault();
10371
- const prevIndex = (focusedIndex - 1 + visibleNodes.length) % visibleNodes.length;
10372
- visibleNodes[prevIndex]?.focus();
10373
- break;
10374
- }
10375
- case 'Home':
10376
- event.preventDefault();
10377
- visibleNodes[0]?.focus();
10378
- break;
10379
- case 'End':
10380
- event.preventDefault();
10381
- visibleNodes[visibleNodes.length - 1]?.focus();
10382
- break;
10383
- }
11552
+ this.focusHandler = (ev) => {
11553
+ this.hasFocus = true;
11554
+ this.dispatchEvent(new CustomEvent('focus', {
11555
+ detail: ev,
11556
+ bubbles: true,
11557
+ composed: true,
11558
+ }));
10384
11559
  };
10385
11560
  }
10386
11561
  connectedCallback() {
10387
11562
  super.connectedCallback();
10388
- this.addEventListener('tree-node:click', this._onNodeClick);
10389
- this.addEventListener('keydown', this._onKeyDown);
10390
- this.setAttribute('role', 'tree');
10391
- }
10392
- updated(changedProps) {
10393
- super.updated(changedProps);
10394
- if (changedProps.has('selectedNode')) {
10395
- this._syncSelectedStateFromProperty();
10396
- }
11563
+ this.handleInitialAttributes();
11564
+ window.addEventListener('mouseup', this.windowMouseUp);
11565
+ window.addEventListener('keyup', this.windowKeyUp);
10397
11566
  }
10398
11567
  disconnectedCallback() {
10399
11568
  super.disconnectedCallback();
10400
- this.removeEventListener('tree-node:click', this._onNodeClick);
10401
- this.removeEventListener('keydown', this._onKeyDown);
11569
+ window.removeEventListener('mouseup', this.windowMouseUp);
11570
+ window.removeEventListener('keyup', this.windowKeyUp);
10402
11571
  }
10403
- _getTopLevelNodes() {
10404
- return Array.from(this.children).filter(el => el.tagName.toLowerCase() === 'wc-tree-node');
11572
+ firstUpdated() {
11573
+ this.slotHasContent = this.hasChildNodes() || !!this.label;
11574
+ this.updateGroupFocusTarget();
10405
11575
  }
10406
- _getAllVisibleNodes() {
10407
- const result = [];
10408
- const collect = (nodes) => {
10409
- nodes.forEach(node => {
10410
- result.push(node);
10411
- if (node.expanded) {
10412
- const children = Array.from(node.children).filter(el => el.tagName.toLowerCase() === 'wc-tree-node');
10413
- collect(children);
10414
- }
10415
- });
10416
- };
10417
- collect(this._getTopLevelNodes());
10418
- return result;
11576
+ updated(changedProps) {
11577
+ if (changedProps.has('label')) {
11578
+ this.slotHasContent = this.hasChildNodes() || !!this.label;
11579
+ }
11580
+ if (changedProps.has('checked') && this.checked) {
11581
+ this.uncheckSiblings();
11582
+ }
11583
+ if (changedProps.has('checked') || changedProps.has('name')) {
11584
+ this.updateGroupFocusTarget();
11585
+ }
10419
11586
  }
10420
- _updateSelectedState(selectedValue) {
10421
- const allNodes = this._collectAllNodes(this._getTopLevelNodes());
10422
- allNodes.forEach(node => {
10423
- const nodeValue = node.value || node.label;
10424
- // eslint-disable-next-line no-param-reassign
10425
- node.selected = nodeValue === selectedValue;
11587
+ handleInitialAttributes() {
11588
+ if (this.hasAttribute('tabindex')) {
11589
+ const attrValue = this.getAttribute('tabindex');
11590
+ if (attrValue !== null) {
11591
+ this.tabindex = parseInt(attrValue, 10);
11592
+ }
11593
+ this.removeAttribute('tabindex');
11594
+ }
11595
+ Array.from(this.attributes).forEach(attr => {
11596
+ if (attr.name.startsWith('aria-')) {
11597
+ this.configAria[attr.name] = attr.value;
11598
+ this.removeAttribute(attr.name);
11599
+ }
10426
11600
  });
10427
11601
  }
10428
- _clearSelectedState() {
10429
- const allNodes = this._collectAllNodes(this._getTopLevelNodes());
10430
- allNodes.forEach(node => {
10431
- // eslint-disable-next-line no-param-reassign
10432
- node.selected = false;
11602
+ selectRadio(ev) {
11603
+ if (this.disabled || this.readonly)
11604
+ return;
11605
+ if (!this.checked) {
11606
+ this.checked = true;
11607
+ this.uncheckSiblings();
11608
+ this.dispatchChange(ev);
11609
+ }
11610
+ this.containerElement?.focus();
11611
+ }
11612
+ dispatchChange(ev) {
11613
+ this.dispatchEvent(new CustomEvent('change', {
11614
+ detail: { value: this.value, checked: this.checked, originalEvent: ev },
11615
+ bubbles: true,
11616
+ composed: true,
11617
+ }));
11618
+ }
11619
+ uncheckSiblings() {
11620
+ if (!this.name || !this.checked)
11621
+ return;
11622
+ const radios = this.getGroupRadios();
11623
+ radios.forEach(radio => {
11624
+ if (radio === this)
11625
+ return;
11626
+ radio.checked = false;
10433
11627
  });
10434
11628
  }
10435
- _syncSelectedStateFromProperty() {
10436
- if (this.selectedNode) {
10437
- this._updateSelectedState(this.selectedNode);
11629
+ getGroupRadios() {
11630
+ if (!this.name)
11631
+ return [this];
11632
+ const scopeRoot = this.closest('form') ?? document;
11633
+ return Array.from(scopeRoot.querySelectorAll(`wc-radio[name="${this.name}"]`));
11634
+ }
11635
+ isRadioEnabled(radio) {
11636
+ return !radio.disabled && !radio.readonly;
11637
+ }
11638
+ updateGroupFocusTarget() {
11639
+ const group = this.getGroupRadios();
11640
+ if (!group.length)
11641
+ return;
11642
+ const enabledGroup = group.filter(radio => this.isRadioEnabled(radio));
11643
+ if (!enabledGroup.length) {
11644
+ group.forEach(radio => {
11645
+ radio.isGroupFocusTarget = false;
11646
+ });
10438
11647
  return;
10439
11648
  }
10440
- this._clearSelectedState();
10441
- }
10442
- _collectAllNodes(nodes) {
10443
- const result = [];
10444
- nodes.forEach(node => {
10445
- result.push(node);
10446
- const children = Array.from(node.children).filter(el => el.tagName.toLowerCase() === 'wc-tree-node');
10447
- result.push(...this._collectAllNodes(children));
11649
+ const target = enabledGroup.find(radio => radio.checked) || enabledGroup[0];
11650
+ group.forEach(radio => {
11651
+ radio.isGroupFocusTarget = radio === target;
10448
11652
  });
10449
- return result;
11653
+ }
11654
+ navigateGroup(direction) {
11655
+ const group = this.getGroupRadios().filter(radio => this.isRadioEnabled(radio));
11656
+ if (!group.length)
11657
+ return;
11658
+ const currentIndex = group.indexOf(this);
11659
+ const startIndex = currentIndex >= 0 ? currentIndex : 0;
11660
+ const nextIndex = (startIndex + direction + group.length) % group.length;
11661
+ const target = group[nextIndex];
11662
+ target.selectRadio();
11663
+ target.containerElement?.focus();
11664
+ }
11665
+ /**
11666
+ * Sets focus on the radio.
11667
+ */
11668
+ focus() {
11669
+ this.containerElement?.focus();
11670
+ }
11671
+ /**
11672
+ * Removes focus from the radio.
11673
+ */
11674
+ blur() {
11675
+ this.containerElement?.blur();
10450
11676
  }
10451
11677
  render() {
10452
- return b `<div class="tree-view">
10453
- <slot @slotchange=${this._onSlotChange}></slot>
10454
- </div>`;
11678
+ const cssClasses = {
11679
+ radio: true,
11680
+ 'state-checked': this.checked,
11681
+ 'has-focus': this.hasFocus,
11682
+ active: this.isActive,
11683
+ disabled: this.disabled,
11684
+ readonly: this.readonly,
11685
+ required: this.required,
11686
+ 'has-content': this.slotHasContent,
11687
+ };
11688
+ return b `
11689
+ <label class=${e$3(cssClasses)}>
11690
+ <div
11691
+ class="container"
11692
+ tabindex=${this.isGroupFocusTarget
11693
+ ? this.tabindex !== undefined
11694
+ ? this.tabindex
11695
+ : 0
11696
+ : -1}
11697
+ role="radio"
11698
+ aria-disabled=${this.disabled}
11699
+ aria-required=${this.required}
11700
+ aria-checked=${this.checked}
11701
+ @click=${this.clickHandler}
11702
+ @mousedown=${this.mouseDownHandler}
11703
+ @keydown=${this.keyDownHandler}
11704
+ @blur=${this.blurHandler}
11705
+ @focus=${this.focusHandler}
11706
+ ${spread(this.configAria)}
11707
+ >
11708
+ <div class="state-layer"></div>
11709
+ <div class="outer-circle"></div>
11710
+ <div class="inner-circle"></div>
11711
+ </div>
11712
+
11713
+ <input
11714
+ type="radio"
11715
+ class="input-native"
11716
+ name=${this.name}
11717
+ .value=${this.value}
11718
+ .checked=${this.checked}
11719
+ aria-hidden="true"
11720
+ ?required=${this.required}
11721
+ ?disabled=${this.disabled}
11722
+ tabindex="-1"
11723
+ />
11724
+
11725
+ ${this.label
11726
+ ? b `<div class="label">${this.label}</div>`
11727
+ : b `<div class="label slot-container"><slot></slot></div>`}
11728
+ </label>
11729
+ `;
10455
11730
  }
10456
11731
  }
10457
- TreeView.styles = [css_248z];
10458
- TreeView.Node = TreeNode;
11732
+ Radio.DIRECTION_NEXT = 1;
11733
+ Radio.DIRECTION_PREVIOUS = -1;
11734
+ Radio.styles = [css_248z];
10459
11735
  __decorate([
10460
- n({ type: String, attribute: 'selected-node', reflect: true })
10461
- ], TreeView.prototype, "selectedNode", void 0);
11736
+ n({ type: String })
11737
+ ], Radio.prototype, "name", void 0);
11738
+ __decorate([
11739
+ n({ type: String })
11740
+ ], Radio.prototype, "value", void 0);
11741
+ __decorate([
11742
+ n({ type: String })
11743
+ ], Radio.prototype, "label", void 0);
11744
+ __decorate([
11745
+ n({ type: Boolean, reflect: true })
11746
+ ], Radio.prototype, "checked", void 0);
11747
+ __decorate([
11748
+ n({ type: Boolean, reflect: true })
11749
+ ], Radio.prototype, "required", void 0);
11750
+ __decorate([
11751
+ n({ type: Boolean, reflect: true })
11752
+ ], Radio.prototype, "readonly", void 0);
11753
+ __decorate([
11754
+ n({ type: Boolean, reflect: true })
11755
+ ], Radio.prototype, "disabled", void 0);
11756
+ __decorate([
11757
+ n({ type: Object })
11758
+ ], Radio.prototype, "configAria", void 0);
11759
+ __decorate([
11760
+ r()
11761
+ ], Radio.prototype, "hasFocus", void 0);
11762
+ __decorate([
11763
+ r()
11764
+ ], Radio.prototype, "isActive", void 0);
11765
+ __decorate([
11766
+ r()
11767
+ ], Radio.prototype, "slotHasContent", void 0);
11768
+ __decorate([
11769
+ r()
11770
+ ], Radio.prototype, "isGroupFocusTarget", void 0);
11771
+ __decorate([
11772
+ e$4('.container')
11773
+ ], Radio.prototype, "containerElement", void 0);
11774
+ __decorate([
11775
+ e$4('.input-native')
11776
+ ], Radio.prototype, "nativeElement", void 0);
10462
11777
 
10463
- export { Accordion as A, Badge as B, Chip as C, DatePicker as D, Elevation as E, Field as F, Icon as I, LinearProgress as L, Menu as M, NumberField as N, Pagination as P, Ripple as R, Skeleton as S, Tab as T, Avatar as a, Breadcrumb as b, BreadcrumbItem as c, CircularProgress as d, Container as e, Divider as f, EmptyState as g, FocusRing as h, Image as i, Input as j, Link as k, MenuItem as l, Slider as m, Spinner as n, SubMenu as o, Switch as p, TabGroup as q, TabPanel as r, Table as s, Tabs as t, Tag as u, Textarea as v, TimePicker as w, Tooltip as x, TreeNode as y, TreeView as z };
10464
- //# sourceMappingURL=tree-view-CLolVlU0.js.map
11778
+ export { Accordion as A, Badge as B, Checkbox as C, DatePicker as D, Elevation as E, Field as F, Tooltip as G, TreeNode as H, Icon as I, TreeView as J, LinearProgress as L, Menu as M, NumberField as N, Pagination as P, Radio as R, Skeleton as S, Tab as T, Avatar as a, Breadcrumb as b, BreadcrumbItem as c, Chip as d, CircularProgress as e, Container as f, Divider as g, EmptyState as h, FocusRing as i, Image as j, Input as k, Link as l, MenuItem as m, Ripple as n, Slider as o, Snackbar as p, Spinner as q, SubMenu as r, Switch as s, TabGroup as t, TabPanel as u, Table as v, Tabs as w, Tag as x, Textarea as y, TimePicker as z };
11779
+ //# sourceMappingURL=radio-b70_Ie9n.js.map