@redvars/peacock 3.5.0 → 3.5.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (148) hide show
  1. package/dist/BaseButton-DuASuVth.js +219 -0
  2. package/dist/BaseButton-DuASuVth.js.map +1 -0
  3. package/dist/BaseHyperlinkMixin-BNuwbiEf.js +65 -0
  4. package/dist/BaseHyperlinkMixin-BNuwbiEf.js.map +1 -0
  5. package/dist/assets/components.css +1 -1
  6. package/dist/assets/components.css.map +1 -1
  7. package/dist/assets/styles.css +1 -1
  8. package/dist/assets/styles.css.map +1 -1
  9. package/dist/banner.js +12 -27
  10. package/dist/banner.js.map +1 -1
  11. package/dist/{button-DMN1dPAg.js → button-DouvOfEU.js} +77 -251
  12. package/dist/button-DouvOfEU.js.map +1 -0
  13. package/dist/{button-group-CX9CUUXk.js → button-group-CEdMwvJJ.js} +71 -42
  14. package/dist/button-group-CEdMwvJJ.js.map +1 -0
  15. package/dist/button-group.js +5 -5
  16. package/dist/button.js +3 -3
  17. package/dist/card.js +18 -73
  18. package/dist/card.js.map +1 -1
  19. package/dist/chart-bar.js.map +1 -1
  20. package/dist/chart-doughnut.js +2 -2
  21. package/dist/chart-doughnut.js.map +1 -1
  22. package/dist/chart-pie.js +2 -2
  23. package/dist/chart-pie.js.map +1 -1
  24. package/dist/chart-stacked-bar.js.map +1 -1
  25. package/dist/code-highlighter.js +2 -1
  26. package/dist/code-highlighter.js.map +1 -1
  27. package/dist/custom-elements-jsdocs.json +3105 -1494
  28. package/dist/custom-elements.json +9244 -7829
  29. package/dist/fab.js +421 -9
  30. package/dist/fab.js.map +1 -1
  31. package/dist/index.js +6 -6
  32. package/dist/{select-4pl4XBj7.js → navigation-rail-Lxetd5-Z.js} +2214 -1090
  33. package/dist/navigation-rail-Lxetd5-Z.js.map +1 -0
  34. package/dist/notification.js +3 -2
  35. package/dist/notification.js.map +1 -1
  36. package/dist/peacock-loader.js +22 -10
  37. package/dist/peacock-loader.js.map +1 -1
  38. package/dist/search.js +4 -0
  39. package/dist/search.js.map +1 -1
  40. package/dist/src/__mixins/BaseButtonMixin.d.ts +20 -0
  41. package/dist/src/__mixins/BaseHyperlinkMixin.d.ts +18 -0
  42. package/dist/src/__mixins/MixinConstructor.d.ts +1 -0
  43. package/dist/src/banner/banner.d.ts +0 -4
  44. package/dist/src/button/BaseButton.d.ts +4 -47
  45. package/dist/src/button/button/button.d.ts +32 -3
  46. package/dist/src/button/button-group/button-group.d.ts +2 -2
  47. package/dist/src/button/icon-button/icon-button.d.ts +33 -8
  48. package/dist/src/card/card.d.ts +4 -15
  49. package/dist/src/fab/fab.d.ts +4 -35
  50. package/dist/src/focus-ring/focus-ring.d.ts +11 -5
  51. package/dist/src/index.d.ts +3 -1
  52. package/dist/src/link/link.d.ts +1 -1
  53. package/dist/src/navigation-rail/index.d.ts +2 -0
  54. package/dist/src/navigation-rail/navigation-rail-item.d.ts +55 -0
  55. package/dist/src/navigation-rail/navigation-rail.d.ts +71 -0
  56. package/dist/src/sidebar-menu/index.d.ts +3 -0
  57. package/dist/src/sidebar-menu/sidebar-menu-item.d.ts +58 -0
  58. package/dist/src/sidebar-menu/sidebar-menu.d.ts +38 -0
  59. package/dist/src/sidebar-menu/sidebar-sub-menu.d.ts +35 -0
  60. package/dist/src/toolbar/toolbar.d.ts +10 -10
  61. package/dist/src/tooltip/tooltip.d.ts +3 -0
  62. package/dist/src/url-field/index.d.ts +1 -0
  63. package/dist/src/url-field/url-field.d.ts +48 -0
  64. package/dist/test/sidebar-menu.test.d.ts +1 -0
  65. package/dist/toolbar.js +10 -10
  66. package/dist/toolbar.js.map +1 -1
  67. package/dist/tsconfig.tsbuildinfo +1 -1
  68. package/package.json +1 -1
  69. package/readme.md +73 -65
  70. package/scss/mixin.scss +16 -0
  71. package/src/__mixins/BaseButtonMixin.ts +83 -0
  72. package/src/__mixins/BaseHyperlinkMixin.ts +68 -0
  73. package/src/__mixins/MixinConstructor.ts +1 -0
  74. package/src/{__base_element → __mixins}/README.md +2 -2
  75. package/src/banner/banner.scss +18 -22
  76. package/src/banner/banner.ts +1 -7
  77. package/src/button/BaseButton.ts +11 -100
  78. package/src/button/button/button-sizes.scss +4 -2
  79. package/src/button/button/button.ts +76 -23
  80. package/src/button/button-group/button-group.ts +2 -2
  81. package/src/button/icon-button/icon-button.ts +75 -33
  82. package/src/card/card.ts +11 -71
  83. package/src/chart-bar/chart-bar.ts +9 -14
  84. package/src/chart-bar/chart-stacked-bar.ts +12 -18
  85. package/src/chart-doughnut/chart-doughnut.ts +23 -27
  86. package/src/chart-pie/chart-pie.ts +19 -23
  87. package/src/checkbox/checkbox.scss +17 -34
  88. package/src/checkbox/checkbox.ts +3 -1
  89. package/src/code-highlighter/code-highlighter.scss +1 -0
  90. package/src/code-highlighter/code-highlighter.ts +1 -1
  91. package/src/date-picker/date-picker.ts +1 -1
  92. package/src/elevation/elevation.scss +5 -5
  93. package/src/fab/fab.ts +29 -100
  94. package/src/focus-ring/focus-ring.ts +47 -40
  95. package/src/index.ts +3 -1
  96. package/src/input/input.ts +3 -1
  97. package/src/link/link.ts +2 -2
  98. package/src/menu/menu-item/menu-item.ts +3 -1
  99. package/src/navigation-rail/index.ts +2 -0
  100. package/src/navigation-rail/navigation-rail-item.scss +216 -0
  101. package/src/navigation-rail/navigation-rail-item.ts +223 -0
  102. package/src/navigation-rail/navigation-rail.scss +72 -0
  103. package/src/navigation-rail/navigation-rail.ts +149 -0
  104. package/src/notification/notification.ts +3 -2
  105. package/src/number-field/number-field.ts +6 -4
  106. package/src/pagination/pagination.ts +6 -4
  107. package/src/peacock-loader.ts +22 -5
  108. package/src/search/search.ts +4 -0
  109. package/src/sidebar-menu/demo/index.html +68 -0
  110. package/src/sidebar-menu/index.ts +3 -0
  111. package/src/sidebar-menu/sidebar-menu-item.scss +102 -0
  112. package/src/sidebar-menu/sidebar-menu-item.ts +151 -0
  113. package/src/{tree-view/tree-view.scss → sidebar-menu/sidebar-menu.scss} +1 -1
  114. package/src/sidebar-menu/sidebar-menu.ts +182 -0
  115. package/src/sidebar-menu/sidebar-sub-menu.scss +130 -0
  116. package/src/sidebar-menu/sidebar-sub-menu.ts +160 -0
  117. package/src/skeleton/skeleton.scss +18 -24
  118. package/src/snackbar/snackbar.ts +1 -1
  119. package/src/tabs/tab.ts +4 -3
  120. package/src/text/text.css-component.scss +7 -1
  121. package/src/time-picker/time-picker.ts +1 -1
  122. package/src/toolbar/toolbar.ts +10 -10
  123. package/src/tooltip/tooltip.ts +24 -0
  124. package/src/url-field/index.ts +1 -0
  125. package/src/url-field/url-field.scss +50 -0
  126. package/src/url-field/url-field.ts +239 -0
  127. package/dist/button-DMN1dPAg.js.map +0 -1
  128. package/dist/button-group-CX9CUUXk.js.map +0 -1
  129. package/dist/fab-C5Nzxk0E.js +0 -497
  130. package/dist/fab-C5Nzxk0E.js.map +0 -1
  131. package/dist/select-4pl4XBj7.js.map +0 -1
  132. package/dist/spread-B5cgadZl.js +0 -32
  133. package/dist/spread-B5cgadZl.js.map +0 -1
  134. package/dist/src/__base_element/BaseHyperlink.d.ts +0 -20
  135. package/dist/src/tree-view/index.d.ts +0 -2
  136. package/dist/src/tree-view/tree-node.d.ts +0 -69
  137. package/dist/src/tree-view/tree-view.d.ts +0 -40
  138. package/dist/src/tree-view/wc-tree-view.d.ts +0 -6
  139. package/dist/test/tree-view.test.d.ts +0 -1
  140. package/dist/throttle-C7ZAPqtu.js +0 -24
  141. package/dist/throttle-C7ZAPqtu.js.map +0 -1
  142. package/src/__base_element/BaseHyperlink.ts +0 -42
  143. package/src/tree-view/demo/index.html +0 -57
  144. package/src/tree-view/index.ts +0 -2
  145. package/src/tree-view/tree-node.scss +0 -101
  146. package/src/tree-view/tree-node.ts +0 -268
  147. package/src/tree-view/tree-view.ts +0 -182
  148. package/src/tree-view/wc-tree-view.ts +0 -9
@@ -6,13 +6,11 @@ import { e as e$2, o as o$4 } from './unsafe-html-BsGUjx94.js';
6
6
  import { e as e$3 } from './class-map-YU7g0o3B.js';
7
7
  import { o as observerSlotChangesWithCallback } from './observe-slot-change-BGJfgg2E.js';
8
8
  import { a as e, e as e$4 } from './query-QBcUV-L_.js';
9
- import { d as BaseHyperlink } from './button-DMN1dPAg.js';
9
+ import { B as BaseHyperlinkMixin, t as throttle } from './BaseHyperlinkMixin-BNuwbiEf.js';
10
10
  import { o as o$2 } from './style-map-DVmWOuYy.js';
11
11
  import { r as redispatchEvent, i as isActivationClick, d as dispatchActivationClick } from './dispatch-event-utils-CuEqjlPT.js';
12
- import { s as spread } from './spread-B5cgadZl.js';
12
+ import { s as spread, o as o$3 } from './BaseButton-DuASuVth.js';
13
13
  import { B as BaseInput, i as isDarkMode, o as observeThemeChange } from './is-dark-mode-DicqGkCJ.js';
14
- import { o as o$3 } from './fab-C5Nzxk0E.js';
15
- import { t as throttle } from './throttle-C7ZAPqtu.js';
16
14
 
17
15
  /**
18
16
  * @license
@@ -123,7 +121,7 @@ async function fetchIcon(name, provider = 'material-symbols') {
123
121
  return fetchSVG(PROVIDERS[provider](name));
124
122
  }
125
123
 
126
- var css_248z$O = i`* {
124
+ var css_248z$S = i`* {
127
125
  box-sizing: border-box;
128
126
  }
129
127
 
@@ -252,7 +250,7 @@ class Icon extends i$1 {
252
250
  }
253
251
  }
254
252
  }
255
- Icon.styles = [css_248z$O];
253
+ Icon.styles = [css_248z$S];
256
254
  __decorate([
257
255
  n({ type: String, reflect: true })
258
256
  ], Icon.prototype, "name", void 0);
@@ -272,7 +270,7 @@ __decorate([
272
270
  r()
273
271
  ], Icon.prototype, "error", void 0);
274
272
 
275
- var css_248z$N = i`* {
273
+ var css_248z$R = i`* {
276
274
  box-sizing: border-box;
277
275
  }
278
276
 
@@ -363,7 +361,7 @@ class Avatar extends i$1 {
363
361
  return `${first.charAt(0)}${last.charAt(0)}`.toUpperCase();
364
362
  }
365
363
  }
366
- Avatar.styles = [css_248z$N];
364
+ Avatar.styles = [css_248z$R];
367
365
  __decorate([
368
366
  n({ type: String, reflect: true })
369
367
  ], Avatar.prototype, "name", void 0);
@@ -371,7 +369,7 @@ __decorate([
371
369
  n({ type: String, reflect: true })
372
370
  ], Avatar.prototype, "src", void 0);
373
371
 
374
- var css_248z$M = i`* {
372
+ var css_248z$Q = i`* {
375
373
  box-sizing: border-box;
376
374
  }
377
375
 
@@ -443,12 +441,12 @@ class Badge extends i$1 {
443
441
  </div>`;
444
442
  }
445
443
  }
446
- Badge.styles = [css_248z$M];
444
+ Badge.styles = [css_248z$Q];
447
445
  __decorate([
448
446
  n({ type: String })
449
447
  ], Badge.prototype, "value", void 0);
450
448
 
451
- var css_248z$L = i`* {
449
+ var css_248z$P = i`* {
452
450
  box-sizing: border-box;
453
451
  }
454
452
 
@@ -557,7 +555,7 @@ class Divider extends i$1 {
557
555
  </div>`;
558
556
  }
559
557
  }
560
- Divider.styles = [css_248z$L];
558
+ Divider.styles = [css_248z$P];
561
559
  __decorate([
562
560
  n({ type: Boolean, reflect: true })
563
561
  ], Divider.prototype, "vertical", void 0);
@@ -565,7 +563,15 @@ __decorate([
565
563
  r()
566
564
  ], Divider.prototype, "slotHasContent", void 0);
567
565
 
568
- var css_248z$K = i`/**
566
+ var css_248z$O = i`* {
567
+ box-sizing: border-box;
568
+ }
569
+
570
+ .screen-reader-only {
571
+ display: none !important;
572
+ }
573
+
574
+ /**
569
575
  * Derived from Material Design Elevation
570
576
  * https://github.com/material-components/material-web/blob/main/elevation/internal/_elevation.scss
571
577
  */
@@ -638,9 +644,9 @@ class Elevation extends i$1 {
638
644
  return b `<span class="shadow"></span>`;
639
645
  }
640
646
  }
641
- Elevation.styles = [css_248z$K];
647
+ Elevation.styles = [css_248z$O];
642
648
 
643
- var css_248z$J = i`* {
649
+ var css_248z$N = i`* {
644
650
  box-sizing: border-box;
645
651
  }
646
652
 
@@ -893,7 +899,7 @@ class SegmentedButton extends i$1 {
893
899
  `;
894
900
  }
895
901
  }
896
- SegmentedButton.styles = [css_248z$J];
902
+ SegmentedButton.styles = [css_248z$N];
897
903
  __decorate([
898
904
  n({ type: String, reflect: true })
899
905
  ], SegmentedButton.prototype, "value", void 0);
@@ -913,7 +919,7 @@ __decorate([
913
919
  r()
914
920
  ], SegmentedButton.prototype, "isActive", void 0);
915
921
 
916
- var css_248z$I = i`* {
922
+ var css_248z$M = i`* {
917
923
  box-sizing: border-box;
918
924
  }
919
925
 
@@ -1025,7 +1031,7 @@ class SegmentedButtonGroup extends i$1 {
1025
1031
  `;
1026
1032
  }
1027
1033
  }
1028
- SegmentedButtonGroup.styles = [css_248z$I];
1034
+ SegmentedButtonGroup.styles = [css_248z$M];
1029
1035
  SegmentedButtonGroup.SegmentedButton = SegmentedButton;
1030
1036
  __decorate([
1031
1037
  n({ type: Boolean, reflect: true, attribute: 'multi-select' })
@@ -1034,7 +1040,7 @@ __decorate([
1034
1040
  n({ type: Boolean, reflect: true })
1035
1041
  ], SegmentedButtonGroup.prototype, "nullable", void 0);
1036
1042
 
1037
- var css_248z$H = i`:host {
1043
+ var css_248z$L = i`:host {
1038
1044
  display: none;
1039
1045
  pointer-events: none;
1040
1046
  position: absolute;
@@ -1072,30 +1078,13 @@ class FocusRing extends i$1 {
1072
1078
  super(...arguments);
1073
1079
  this.visible = false;
1074
1080
  this.for = '';
1081
+ this.__boundFocusin = this.__focusin.bind(this);
1082
+ this.__boundFocusout = this.__focusout.bind(this);
1083
+ this.__boundPointerdown = this.__pointerdown.bind(this);
1075
1084
  }
1076
1085
  render() {
1077
1086
  return A;
1078
1087
  }
1079
- get control() {
1080
- return this._control || null;
1081
- }
1082
- set control(control) {
1083
- if (control) {
1084
- this._control = control;
1085
- }
1086
- else {
1087
- this.detach();
1088
- }
1089
- }
1090
- set forElement(value) {
1091
- if (value) {
1092
- this._focusTarget = value;
1093
- this.attach();
1094
- }
1095
- else {
1096
- this.detach();
1097
- }
1098
- }
1099
1088
  connectedCallback() {
1100
1089
  super.connectedCallback();
1101
1090
  this.attach();
@@ -1104,6 +1093,21 @@ class FocusRing extends i$1 {
1104
1093
  this.detach();
1105
1094
  super.disconnectedCallback();
1106
1095
  }
1096
+ updated(changed) {
1097
+ if (changed.has('for')) {
1098
+ const prevId = changed.get('for');
1099
+ if (prevId) {
1100
+ const root = this.parentElement?.getRootNode();
1101
+ const prevEl = root?.getElementById(prevId) ?? document.getElementById(prevId);
1102
+ if (prevEl) {
1103
+ prevEl.removeEventListener('focusin', this.__boundFocusin);
1104
+ prevEl.removeEventListener('focusout', this.__boundFocusout);
1105
+ prevEl.removeEventListener('pointerdown', this.__boundPointerdown);
1106
+ }
1107
+ }
1108
+ this.attach();
1109
+ }
1110
+ }
1107
1111
  __focusin() {
1108
1112
  const focusTarget = this.__getFocusTarget();
1109
1113
  this.visible = focusTarget?.matches(':focus-visible') ?? false;
@@ -1114,35 +1118,47 @@ class FocusRing extends i$1 {
1114
1118
  __pointerdown() {
1115
1119
  this.visible = false;
1116
1120
  }
1121
+ /**
1122
+ * Resolves the element that should receive focus-ring event listeners by id.
1123
+ * Prefers lookup from the current control's root node, then falls back to a
1124
+ * document-level lookup.
1125
+ *
1126
+ * @returns The resolved focus target, if one can be found.
1127
+ */
1117
1128
  __getFocusTarget() {
1118
- if (this._focusTarget) {
1119
- return this._focusTarget;
1120
- }
1121
- const focusTarget = document.getElementById(this.for);
1122
- if (focusTarget) {
1123
- return focusTarget;
1129
+ if (this.for) {
1130
+ const root = this.parentElement?.getRootNode();
1131
+ if (root) {
1132
+ const focusTarget = root.getElementById(this.for);
1133
+ if (focusTarget) {
1134
+ return focusTarget;
1135
+ }
1136
+ }
1137
+ const focusTarget = document.getElementById(this.for);
1138
+ if (focusTarget) {
1139
+ return focusTarget;
1140
+ }
1124
1141
  }
1125
1142
  return undefined;
1126
1143
  }
1127
1144
  attach() {
1128
1145
  const focusTarget = this.__getFocusTarget();
1129
1146
  if (focusTarget) {
1130
- focusTarget.addEventListener('focusin', this.__focusin.bind(this));
1131
- focusTarget.addEventListener('focusout', this.__focusout.bind(this));
1132
- focusTarget.addEventListener('pointerdown', this.__pointerdown.bind(this));
1147
+ focusTarget.addEventListener('focusin', this.__boundFocusin);
1148
+ focusTarget.addEventListener('focusout', this.__boundFocusout);
1149
+ focusTarget.addEventListener('pointerdown', this.__boundPointerdown);
1133
1150
  }
1134
1151
  }
1135
1152
  detach() {
1136
1153
  const focusTarget = this.__getFocusTarget();
1137
1154
  if (focusTarget) {
1138
- focusTarget.removeEventListener('focusin', this.__focusin.bind(this));
1139
- focusTarget.removeEventListener('focusout', this.__focusout.bind(this));
1140
- focusTarget.removeEventListener('pointerdown', this.__pointerdown.bind(this));
1155
+ focusTarget.removeEventListener('focusin', this.__boundFocusin);
1156
+ focusTarget.removeEventListener('focusout', this.__boundFocusout);
1157
+ focusTarget.removeEventListener('pointerdown', this.__boundPointerdown);
1141
1158
  }
1142
- this._control = undefined;
1143
1159
  }
1144
1160
  }
1145
- FocusRing.styles = [css_248z$H];
1161
+ FocusRing.styles = [css_248z$L];
1146
1162
  __decorate([
1147
1163
  n({ type: Boolean, reflect: true })
1148
1164
  ], FocusRing.prototype, "visible", void 0);
@@ -1619,7 +1635,7 @@ __decorate([
1619
1635
  e$4('.surface')
1620
1636
  ], Ripple.prototype, "mdRoot", void 0);
1621
1637
 
1622
- var css_248z$G = i`* {
1638
+ var css_248z$K = i`* {
1623
1639
  box-sizing: border-box;
1624
1640
  }
1625
1641
 
@@ -1915,7 +1931,7 @@ class AccordionItem extends i$1 {
1915
1931
  }
1916
1932
  }
1917
1933
  _AccordionItem_id = new WeakMap();
1918
- AccordionItem.styles = [css_248z$G];
1934
+ AccordionItem.styles = [css_248z$K];
1919
1935
  __decorate([
1920
1936
  n({ type: Boolean, reflect: true })
1921
1937
  ], AccordionItem.prototype, "disabled", void 0);
@@ -1938,7 +1954,7 @@ __decorate([
1938
1954
  e$4('.header-button')
1939
1955
  ], AccordionItem.prototype, "buttonElement", void 0);
1940
1956
 
1941
- var css_248z$F = i`* {
1957
+ var css_248z$J = i`* {
1942
1958
  box-sizing: border-box;
1943
1959
  }
1944
1960
 
@@ -2066,7 +2082,7 @@ class Accordion extends i$1 {
2066
2082
  return b `<div class="accordion"><slot></slot></div>`;
2067
2083
  }
2068
2084
  }
2069
- Accordion.styles = [css_248z$F];
2085
+ Accordion.styles = [css_248z$J];
2070
2086
  Accordion.Item = AccordionItem;
2071
2087
  __decorate([
2072
2088
  n({ type: Boolean, reflect: true })
@@ -2078,7 +2094,7 @@ __decorate([
2078
2094
  o$1({ selector: 'wc-accordion-item' })
2079
2095
  ], Accordion.prototype, "items", void 0);
2080
2096
 
2081
- var css_248z$E = i`* {
2097
+ var css_248z$I = i`* {
2082
2098
  box-sizing: border-box;
2083
2099
  }
2084
2100
 
@@ -2128,7 +2144,7 @@ var css_248z$E = i`* {
2128
2144
  * <wc-link href="#">Link</wc-link>
2129
2145
  * ```
2130
2146
  */
2131
- class Link extends BaseHyperlink(i$1) {
2147
+ class Link extends BaseHyperlinkMixin(i$1) {
2132
2148
  render() {
2133
2149
  return b `<a
2134
2150
  class=${e$3({
@@ -2142,9 +2158,9 @@ class Link extends BaseHyperlink(i$1) {
2142
2158
  </a>`;
2143
2159
  }
2144
2160
  }
2145
- Link.styles = [css_248z$E];
2161
+ Link.styles = [css_248z$I];
2146
2162
 
2147
- var css_248z$D = i`* {
2163
+ var css_248z$H = i`* {
2148
2164
  box-sizing: border-box;
2149
2165
  }
2150
2166
 
@@ -2281,7 +2297,7 @@ slot::slotted(*) {
2281
2297
  --_container-state-opacity: 0.08;
2282
2298
  }`;
2283
2299
 
2284
- var css_248z$C = i`:host([color=default]) {
2300
+ var css_248z$G = i`:host([color=default]) {
2285
2301
  --filled-tag-container-color: var(--color-surface);
2286
2302
  --filled-tag-label-text-color: var(--color-on-surface);
2287
2303
  --tonal-tag-container-color: var(--color-surface-container);
@@ -2347,7 +2363,7 @@ var css_248z$C = i`:host([color=default]) {
2347
2363
  --outlined-tag-label-text-color: var(--color-purple);
2348
2364
  }`;
2349
2365
 
2350
- var css_248z$B = i`.tag {
2366
+ var css_248z$F = i`.tag {
2351
2367
  font-family: var(--font-family-sans) !important;
2352
2368
  }
2353
2369
 
@@ -2446,7 +2462,7 @@ class Tag extends i$1 {
2446
2462
  }
2447
2463
  // Define styles (Lit handles Scoping via Shadow DOM by default)
2448
2464
  // You would typically import your tag.scss.js here or use the css tag
2449
- Tag.styles = [css_248z$D, css_248z$C, css_248z$B];
2465
+ Tag.styles = [css_248z$H, css_248z$G, css_248z$F];
2450
2466
  __decorate([
2451
2467
  n({ type: Boolean })
2452
2468
  ], Tag.prototype, "dismissible", void 0);
@@ -2460,7 +2476,7 @@ __decorate([
2460
2476
  n()
2461
2477
  ], Tag.prototype, "size", void 0);
2462
2478
 
2463
- var css_248z$A = i`* {
2479
+ var css_248z$E = i`* {
2464
2480
  box-sizing: border-box;
2465
2481
  }
2466
2482
 
@@ -2572,7 +2588,7 @@ var css_248z$A = i`* {
2572
2588
  color: var(--background);
2573
2589
  }`;
2574
2590
 
2575
- var css_248z$z = i`:host([color=red]) {
2591
+ var css_248z$D = i`:host([color=red]) {
2576
2592
  --chip-container-color: var(--color-red-container);
2577
2593
  --chip-outline-color: var(--color-on-red-container);
2578
2594
  }
@@ -2601,7 +2617,7 @@ var css_248z$z = i`:host([color=red]) {
2601
2617
  --chip-outline-color: var(--color-on-purple-container);
2602
2618
  }`;
2603
2619
 
2604
- var css_248z$y = i`.tag {
2620
+ var css_248z$C = i`.tag {
2605
2621
  font-family: var(--font-family-sans) !important;
2606
2622
  }
2607
2623
 
@@ -2739,7 +2755,7 @@ class Chip extends i$1 {
2739
2755
  }
2740
2756
  // Define styles (Lit handles Scoping via Shadow DOM by default)
2741
2757
  // You would typically import your tag.scss.js here or use the css tag
2742
- Chip.styles = [css_248z$A, css_248z$z, css_248z$y];
2758
+ Chip.styles = [css_248z$E, css_248z$D, css_248z$C];
2743
2759
  __decorate([
2744
2760
  n({ type: Boolean })
2745
2761
  ], Chip.prototype, "dismissible", void 0);
@@ -2756,7 +2772,7 @@ __decorate([
2756
2772
  n({ type: String })
2757
2773
  ], Chip.prototype, "imageSrc", void 0);
2758
2774
 
2759
- var css_248z$x = i`:host {
2775
+ var css_248z$B = i`:host {
2760
2776
  display: block;
2761
2777
  --progress-height: 0.25rem;
2762
2778
  --progress-container-color: var(--color-primary);
@@ -2962,9 +2978,9 @@ class LinearProgress extends BaseProgress {
2962
2978
  }
2963
2979
  }
2964
2980
  // Lit components use static styles for better performance
2965
- LinearProgress.styles = [css_248z$x];
2981
+ LinearProgress.styles = [css_248z$B];
2966
2982
 
2967
- var css_248z$w = i`:host {
2983
+ var css_248z$A = i`:host {
2968
2984
  display: inline-block;
2969
2985
  --progress-height: 1.5rem;
2970
2986
  --progress-line-thickness: 4px;
@@ -3127,47 +3143,47 @@ class CircularProgress extends BaseProgress {
3127
3143
  }
3128
3144
  }
3129
3145
  // Lit components use static styles for better performance
3130
- CircularProgress.styles = [css_248z$w];
3146
+ CircularProgress.styles = [css_248z$A];
3147
+
3148
+ var css_248z$z = i`* {
3149
+ box-sizing: border-box;
3150
+ }
3151
+
3152
+ .screen-reader-only {
3153
+ display: none !important;
3154
+ }
3131
3155
 
3132
- var css_248z$v = i`:host {
3156
+ :host {
3157
+ position: relative;
3158
+ inset: 0;
3133
3159
  --skeleton-container-color: var(--color-surface-container);
3134
3160
  --skeleton-element: var(--color-on-surface);
3135
- display: inline-block;
3136
- height: 3rem;
3137
- width: 10rem;
3161
+ display: flex;
3162
+ pointer-events: none;
3163
+ }
3164
+
3165
+ .skeleton,
3166
+ .skeleton::before {
3167
+ inset: 0;
3168
+ position: absolute;
3169
+ border-start-start-radius: var(--skeleton-container-shape-start-start, var(--skeleton-container-shape));
3170
+ border-start-end-radius: var(--skeleton-container-shape-start-end, var(--skeleton-container-shape));
3171
+ border-end-start-radius: var(--skeleton-container-shape-end-start, var(--skeleton-container-shape));
3172
+ border-end-end-radius: var(--skeleton-container-shape-end-end, var(--skeleton-container-shape));
3173
+ corner-shape: var(--skeleton-container-shape-variant);
3138
3174
  }
3139
3175
 
3140
3176
  .skeleton {
3141
- position: relative;
3142
- padding: 0;
3143
- border: none;
3144
3177
  background: var(--skeleton-container-color);
3145
- box-shadow: none;
3146
3178
  overflow: hidden;
3147
- pointer-events: none;
3148
- width: 100%;
3149
- height: 100%;
3150
- border-start-start-radius: var(--skeleton-container-shape-start-start);
3151
- border-start-end-radius: var(--skeleton-container-shape-start-end);
3152
- border-end-start-radius: var(--skeleton-container-shape-end-start);
3153
- border-end-end-radius: var(--skeleton-container-shape-end-end);
3154
- corner-shape: var(--skeleton-container-shape-variant);
3155
3179
  }
3156
3180
  .skeleton::before {
3157
- position: absolute;
3158
- left: 0;
3159
- top: 0;
3160
3181
  animation: 3s ease-in-out skeleton infinite;
3161
3182
  background: var(--skeleton-element);
3162
3183
  block-size: 100%;
3163
3184
  content: "";
3164
3185
  inline-size: 100%;
3165
3186
  will-change: transform-origin, transform, opacity;
3166
- border-start-start-radius: var(--skeleton-container-shape-start-start);
3167
- border-start-end-radius: var(--skeleton-container-shape-start-end);
3168
- border-end-start-radius: var(--skeleton-container-shape-end-start);
3169
- border-end-end-radius: var(--skeleton-container-shape-end-end);
3170
- corner-shape: var(--skeleton-container-shape-variant);
3171
3187
  }
3172
3188
 
3173
3189
  @keyframes skeleton {
@@ -3233,12 +3249,12 @@ class Skeleton extends i$1 {
3233
3249
  return b ` <div class="skeleton"></div>`;
3234
3250
  }
3235
3251
  }
3236
- Skeleton.styles = [css_248z$v];
3252
+ Skeleton.styles = [css_248z$z];
3237
3253
  __decorate([
3238
3254
  n({ type: Boolean, reflect: true })
3239
3255
  ], Skeleton.prototype, "visible", void 0);
3240
3256
 
3241
- var css_248z$u = i`* {
3257
+ var css_248z$y = i`* {
3242
3258
  box-sizing: border-box;
3243
3259
  }
3244
3260
 
@@ -3396,11 +3412,13 @@ class Input extends BaseInput {
3396
3412
  <wc-icon-button
3397
3413
  class="password-toggle"
3398
3414
  variant="text"
3399
- name=${this.passwordVisible ? 'visibility_off' : 'visibility'}
3400
3415
  @click=${() => {
3401
3416
  this.passwordVisible = !this.passwordVisible;
3402
3417
  }}
3403
3418
  >
3419
+ <wc-icon
3420
+ name=${this.passwordVisible ? 'visibility_off' : 'visibility'}
3421
+ ></wc-icon>
3404
3422
  </wc-icon-button>
3405
3423
  </pc-tooltip>
3406
3424
  `
@@ -3411,7 +3429,7 @@ class Input extends BaseInput {
3411
3429
  `;
3412
3430
  }
3413
3431
  }
3414
- Input.styles = [css_248z$u];
3432
+ Input.styles = [css_248z$y];
3415
3433
  __decorate([
3416
3434
  n({ type: String })
3417
3435
  ], Input.prototype, "value", void 0);
@@ -3470,7 +3488,7 @@ __decorate([
3470
3488
  e$4('.input-element')
3471
3489
  ], Input.prototype, "inputElement", void 0);
3472
3490
 
3473
- var css_248z$t = i`* {
3491
+ var css_248z$x = i`* {
3474
3492
  box-sizing: border-box;
3475
3493
  }
3476
3494
 
@@ -3479,422 +3497,281 @@ var css_248z$t = i`* {
3479
3497
  }
3480
3498
 
3481
3499
  :host {
3482
- --field-height: unset;
3483
- --field-padding-block: unset;
3484
- }
3485
-
3486
- .field {
3487
- position: relative;
3488
- display: flex;
3489
- flex-direction: column;
3490
- --_container-shape-start-start: var(--field-container-shape-start-start, var(--shape-corner-extra-small));
3491
- --_container-shape-start-end: var(--field-container-shape-start-end, var(--shape-corner-extra-small));
3492
- --_container-shape-end-start: var(--field-container-shape-end-start, var(--shape-corner-extra-small));
3493
- --_container-shape-end-end: var(--field-container-shape-end-end, var(--shape-corner-extra-small));
3494
- --_container-color: var(--field-container-color);
3495
- --_outline-width: var(--field-outline-width, 0.0675rem);
3496
- --_outline-color: var(--field-outline-color, var(--color-outline));
3497
- --_input-text-color: var(--field-label-text-color, var(--color-on-surface));
3498
- --_helper-text-color: var(--field-helper-text-color, var(--color-on-surface-variant));
3499
- --_helper-text-opacity: unset;
3500
- --_label-text-color: var(--field-label-text-color, var(--color-primary));
3501
- }
3502
- .field .field-header {
3503
- display: flex;
3504
- align-items: center;
3505
- margin-block-end: var(--spacing-100);
3506
- justify-content: space-between;
3507
- gap: var(--spacing-100);
3508
- }
3509
- .field .field-header .label {
3510
- position: relative;
3511
- font-family: var(--typography-body-small-font-family) !important;
3512
- font-size: var(--typography-body-small-font-size) !important;
3513
- font-weight: var(--typography-body-small-font-weight) !important;
3514
- line-height: var(--typography-body-small-line-height) !important;
3515
- letter-spacing: var(--typography-body-small-letter-spacing) !important;
3516
- color: var(--_label-text-color);
3517
- overflow: hidden;
3518
- white-space: nowrap;
3519
- text-overflow: ellipsis;
3520
- }
3521
- .field .field-header .label .required {
3522
- color: var(--color-error);
3523
- padding-inline-start: var(--spacing-025);
3524
- }
3525
- .field .field-body {
3526
- position: relative;
3527
- display: flex;
3528
- cursor: text;
3529
- }
3530
- .field .field-body .outline {
3531
- position: absolute;
3532
- z-index: 2;
3533
- left: 0;
3500
+ display: block;
3534
3501
  width: 100%;
3535
- height: 100%;
3536
- pointer-events: none;
3537
- border: var(--_outline-width) solid var(--_outline-color);
3538
- opacity: var(--_outline-opacity, 1);
3539
- border-start-start-radius: var(--_container-shape-start-start);
3540
- border-start-end-radius: var(--_container-shape-start-end);
3541
- border-end-start-radius: var(--_container-shape-end-start);
3542
- border-end-end-radius: var(--_container-shape-end-end);
3543
3502
  }
3544
- .field .field-body .background {
3545
- position: absolute;
3546
- z-index: 0;
3547
- left: 0;
3503
+
3504
+ .url-input {
3505
+ flex: 1;
3548
3506
  width: 100%;
3549
- height: 100%;
3550
- pointer-events: none;
3551
- background-color: var(--_container-color);
3552
- opacity: var(--_container-opacity, 1);
3553
- border-start-start-radius: var(--_container-shape-start-start);
3554
- border-start-end-radius: var(--_container-shape-start-end);
3555
- border-end-start-radius: var(--_container-shape-end-start);
3556
- border-end-end-radius: var(--_container-shape-end-end);
3507
+ border: none;
3508
+ outline: none;
3509
+ margin: 0;
3510
+ padding: 0;
3511
+ background: none;
3512
+ cursor: inherit;
3513
+ font: inherit;
3514
+ color: inherit;
3557
3515
  }
3558
- .field .field-body .field-content {
3516
+
3517
+ .url-display {
3518
+ flex: 1;
3559
3519
  display: flex;
3560
3520
  align-items: center;
3561
- flex: 1;
3562
- height: var(--field-height, 3.5rem);
3563
- padding-block: var(--field-padding-block);
3564
- z-index: 1;
3521
+ overflow: hidden;
3565
3522
  }
3566
- .field .field-body .field-content .input-wrapper {
3523
+
3524
+ .url-link {
3567
3525
  flex: 1;
3568
- padding-inline: var(--spacing-200);
3569
- position: relative;
3570
- }
3571
- .field .field-body .field-content .input-wrapper .outlined-label {
3572
- position: absolute;
3573
- top: 0;
3574
- left: 0;
3575
- align-items: center;
3576
- height: 100%;
3577
- width: 100%;
3578
- padding-inline: var(--spacing-200);
3579
- font-family: var(--typography-body-large-font-family) !important;
3580
- font-size: var(--typography-body-large-font-size) !important;
3581
- font-weight: var(--typography-body-large-font-weight) !important;
3582
- line-height: var(--typography-body-large-line-height) !important;
3583
- letter-spacing: var(--typography-body-large-letter-spacing) !important;
3584
- color: var(--_input-text-color);
3585
- background-color: var(--_container-color);
3586
- opacity: var(--_container-opacity, 1);
3587
- }
3588
- .field .field-body .field-content .input-wrapper .outlined-slot-container {
3589
- opacity: 0;
3526
+ overflow: hidden;
3527
+ text-overflow: ellipsis;
3528
+ white-space: nowrap;
3529
+ color: var(--color-primary);
3530
+ text-decoration: none;
3590
3531
  }
3591
- .field .field-body .field-content slot::slotted(*) {
3592
- font-family: var(--typography-body-large-font-family) !important;
3593
- font-size: var(--typography-body-large-font-size) !important;
3594
- font-weight: var(--typography-body-large-font-weight) !important;
3595
- line-height: var(--typography-body-large-line-height) !important;
3596
- letter-spacing: var(--typography-body-large-letter-spacing) !important;
3597
- color: var(--_input-text-color);
3598
- --icon-size: 1.25rem;
3599
- --icon-color: var(--_input-text-color);
3532
+ .url-link:hover {
3533
+ text-decoration: underline;
3600
3534
  }
3601
- .field .field-body .field-content slot::slotted(input::placeholder) {
3535
+
3536
+ .url-placeholder {
3602
3537
  color: var(--color-on-surface-variant);
3603
- }
3604
- .field .field-body .field-content .slot-start-wrapper.has-content {
3605
- margin-inline-start: 0.75rem;
3606
- display: flex;
3607
- align-items: center;
3608
- gap: 0.5rem;
3609
- }
3610
- .field .field-body .field-content .slot-end-wrapper.has-content {
3611
- margin-inline-end: 0.75rem;
3612
- display: flex;
3613
- align-items: center;
3614
- gap: 0.5rem;
3615
- }
3616
- .field .field-footer {
3617
- display: flex;
3618
- align-items: center;
3619
- justify-content: space-between;
3620
- gap: var(--spacing-200);
3621
- margin-block-start: var(--spacing-050);
3622
- padding-inline: var(--spacing-200);
3623
- }
3624
- .field .field-footer .helper, .field .field-footer .text-count {
3625
- position: relative;
3626
- font-family: var(--typography-body-large-font-family) !important;
3627
- font-size: var(--typography-body-large-font-size) !important;
3628
- font-weight: var(--typography-body-large-font-weight) !important;
3629
- line-height: var(--typography-body-large-line-height) !important;
3630
- letter-spacing: var(--typography-body-large-letter-spacing) !important;
3631
- color: var(--_helper-text-color);
3632
- opacity: var(--_helper-text-opacity);
3633
- }
3634
- .field.focused {
3635
- --_outline-color: var(--color-primary);
3636
- --_outline-width: 0.125rem;
3637
- }
3638
- .field.has-error {
3639
- --_label-text-color: var(--color-error);
3640
- --_outline-color: var(--color-error);
3641
- --_helper-text-color: var(--color-error);
3642
- --_input-text-color: var(--color-error);
3643
- }
3644
- .field.has-warning {
3645
- --_label-text-color: var(--color-warning);
3646
- --_outline-color: var(--color-warning);
3647
- --_helper-text-color: var(--color-warning);
3648
- --_input-text-color: var(--color-warning);
3649
- }
3650
- .field.disabled .label {
3651
- opacity: 0.38;
3652
- }
3653
- .field.disabled {
3654
- --_input-text-color: var(--color-on-surface-variant);
3655
- --_outline-opacity: 0.38;
3656
- --_helper-text-opacity: 0.38;
3657
- --_container-color: var(--color-on-surface);
3658
- --_container-opacity: 0.1;
3659
- cursor: not-allowed;
3660
- }
3661
- .field.readonly {
3662
- cursor: initial;
3663
- --_input-text-color: var(--color-on-surface-variant);
3664
- --_outline-opacity: 0.38;
3665
- --_helper-text-opacity: 0.38;
3666
- --_container-color: var(--color-on-surface);
3667
- --_container-opacity: 0.38;
3668
- }
3669
- .field.show-skeleton .skeleton {
3670
- display: block;
3538
+ opacity: 0.6;
3671
3539
  }
3672
3540
 
3673
- .skeleton {
3674
- display: none;
3675
- width: 100%;
3676
- height: 100%;
3677
- z-index: 2;
3678
- position: absolute;
3679
- top: 0;
3680
- left: 0;
3681
- --skeleton-container-shape-start-start: var(--_container-shape-start-start);
3682
- --skeleton-container-shape-start-end: var(--_container-shape-start-end);
3683
- --skeleton-container-shape-end-start: var(--_container-shape-end-start);
3684
- --skeleton-container-shape-end-end: var(--_container-shape-end-end);
3541
+ .edit-button {
3542
+ --button-container-shape: var(--shape-corner-full);
3685
3543
  }`;
3686
3544
 
3687
3545
  /**
3688
- * @label Field
3689
- * @tag wc-field
3690
- * @rawTag field
3546
+ * @label URL Field
3547
+ * @tag wc-url-field
3548
+ * @rawTag url-field
3691
3549
  *
3692
- * @summary Wrapper for form fields with label and help text.
3550
+ * @summary A field for entering and displaying URLs with validation.
3693
3551
  * @overview
3694
- * <p>Field provides consistent styling and behavior for form inputs.</p>
3552
+ * <p>URL Field wraps an input with URL validation, showing a clickable link preview when not in edit mode.</p>
3695
3553
  *
3696
3554
  * @example
3697
3555
  * ```html
3698
- * <wc-field label="Name" required>
3699
- * some text
3700
- * </wc-field>
3556
+ * <wc-url-field label="Website" value="https://example.com"></wc-url-field>
3701
3557
  * ```
3702
3558
  * @tags form
3703
3559
  */
3704
- class Field extends i$1 {
3560
+ class UrlField extends BaseInput {
3705
3561
  constructor() {
3706
3562
  super(...arguments);
3563
+ this.value = '';
3564
+ this.name = '';
3565
+ this.placeholder = '';
3707
3566
  this.label = '';
3708
- this.help = '';
3709
- this.required = false;
3710
- this.disabled = false;
3711
- this.readonly = false;
3712
- this.skeleton = false;
3567
+ this.editing = false;
3568
+ this.debounce = 300;
3569
+ this.size = 'md';
3570
+ this.variant = 'default';
3713
3571
  this.helperText = '';
3714
3572
  this.error = false;
3715
3573
  this.errorText = '';
3716
3574
  this.warning = false;
3717
3575
  this.warningText = '';
3718
- this.textCount = '';
3719
3576
  this.focused = false;
3720
- this.populated = false;
3721
- this.variant = 'default';
3722
- this.slotStartHasContent = false;
3723
- this.slotEndHasContent = false;
3577
+ this.isValid = true;
3724
3578
  }
3725
- firstUpdated() {
3726
- observerSlotChangesWithCallback(this.renderRoot.querySelector('.slot-start-wrapper slot'), hasContent => {
3727
- this.slotStartHasContent = hasContent;
3728
- this.requestUpdate();
3729
- });
3730
- observerSlotChangesWithCallback(this.renderRoot.querySelector('.slot-end-wrapper slot'), hasContent => {
3731
- this.slotEndHasContent = hasContent;
3732
- this.requestUpdate();
3733
- });
3579
+ disconnectedCallback() {
3580
+ super.disconnectedCallback();
3581
+ if (this.debounceTimer) {
3582
+ clearTimeout(this.debounceTimer);
3583
+ }
3734
3584
  }
3735
- __handleClick() {
3736
- // @ts-ignore
3737
- this.host?.focus?.();
3585
+ focus() {
3586
+ if (!this.editing && !this.disabled && !this.readonly) {
3587
+ this.startEditing();
3588
+ return;
3589
+ }
3590
+ this.inputElement?.focus();
3738
3591
  }
3739
- __renderInputSlot() {
3740
- if (this.variant === 'outlined') {
3741
- if (this.populated || this.focused)
3742
- return b `<slot></slot>`;
3743
- return b `
3744
- <label class="outlined-label">${this.label}</label>
3745
- <div class="outlined-slot-container">
3746
- <slot></slot>
3747
- </div>
3748
- `;
3592
+ blur() {
3593
+ this.inputElement?.blur();
3594
+ }
3595
+ startEditing() {
3596
+ if (this.disabled || this.readonly)
3597
+ return;
3598
+ this.editing = true;
3599
+ setTimeout(() => this.inputElement?.focus(), 80);
3600
+ }
3601
+ closeEditing() {
3602
+ this.isValid = this.validateUrl(this.value);
3603
+ this.dispatchEvent(new CustomEvent('input-invalid', {
3604
+ detail: !this.isValid,
3605
+ bubbles: true,
3606
+ composed: true,
3607
+ }));
3608
+ if (this.isValid) {
3609
+ this.editing = false;
3749
3610
  }
3750
- return b `<slot></slot>`;
3751
3611
  }
3752
- __renderFieldHeader() {
3753
- if (!this.label)
3754
- return A;
3755
- if (this.variant === 'outlined' && !this.populated && !this.focused) {
3756
- return A;
3612
+ validateUrl(url) {
3613
+ if (!url)
3614
+ return true;
3615
+ try {
3616
+ new URL(url);
3617
+ return true;
3757
3618
  }
3758
- return b `<div class="field-header">
3759
- <label class="label">
3760
- ${this.label}${this.required
3761
- ? b `<span class="required">*</span>`
3762
- : A}
3763
- <wc-skeleton class="skeleton"></wc-skeleton>
3764
- </label>
3765
- </div>`;
3619
+ catch {
3620
+ return false;
3621
+ }
3622
+ }
3623
+ handleInput(event) {
3624
+ this.value = event.target.value;
3625
+ this.isValid = true;
3626
+ if (this.debounceTimer) {
3627
+ clearTimeout(this.debounceTimer);
3628
+ }
3629
+ this.debounceTimer = setTimeout(() => {
3630
+ this.dispatchEvent(new CustomEvent('value-change', {
3631
+ detail: this.value,
3632
+ bubbles: true,
3633
+ composed: true,
3634
+ }));
3635
+ }, this.debounce);
3636
+ }
3637
+ handleFocusChange() {
3638
+ this.focused = this.inputElement?.matches(':focus') ?? false;
3639
+ }
3640
+ handleBlur() {
3641
+ this.focused = false;
3642
+ this.closeEditing();
3643
+ }
3644
+ handleChange(event) {
3645
+ redispatchEvent(this, event);
3646
+ }
3647
+ renderDisplayValue() {
3648
+ if (!this.value) {
3649
+ return b `<span class="url-placeholder">${this.placeholder}</span>`;
3650
+ }
3651
+ return b `
3652
+ <a
3653
+ class="url-link"
3654
+ href=${this.value}
3655
+ target="_blank"
3656
+ rel="noopener noreferrer"
3657
+ >
3658
+ ${this.value}
3659
+ </a>
3660
+ `;
3766
3661
  }
3767
3662
  render() {
3768
- const classes = {
3769
- field: true,
3770
- required: this.required,
3771
- disabled: this.disabled,
3772
- 'show-skeleton': this.skeleton,
3773
- 'has-error': this.error,
3774
- 'has-warning': this.warning,
3775
- focused: this.focused,
3776
- readonly: this.readonly,
3777
- [`variant-${this.variant}`]: true,
3778
- populated: this.populated,
3779
- };
3663
+ const hasValue = !!this.value;
3664
+ const showInvalidState = this.error || !this.isValid;
3665
+ const resolvedErrorText = !this.isValid
3666
+ ? 'Please enter a valid URL'
3667
+ : this.errorText;
3780
3668
  return b `
3781
- <div class=${e$3(classes)}>
3782
- ${this.__renderFieldHeader()}
3783
-
3784
- <div class="field-body" @click=${this.__handleClick}>
3785
- <div class="outline"></div>
3786
- <div class="background"></div>
3787
- <wc-skeleton class="skeleton"></wc-skeleton>
3788
-
3789
- <div class="field-content">
3790
- <div
3791
- class=${e$3({
3792
- 'slot-start-wrapper': true,
3793
- 'has-content': this.slotStartHasContent,
3794
- })}
3795
- >
3796
- <slot name="field-start"></slot>
3797
- </div>
3798
-
3799
- <div class="input-wrapper">${this.__renderInputSlot()}</div>
3800
-
3801
- <div
3802
- class=${e$3({
3803
- 'slot-end-wrapper': true,
3804
- 'has-content': this.slotEndHasContent,
3805
- })}
3806
- >
3807
- <slot name="field-end"></slot>
3808
- </div>
3809
- </div>
3810
- </div>
3669
+ <wc-field
3670
+ label=${this.label}
3671
+ ?required=${this.required}
3672
+ ?disabled=${this.disabled}
3673
+ ?readonly=${this.readonly}
3674
+ ?skeleton=${this.skeleton}
3675
+ helper-text=${this.helperText}
3676
+ ?error=${showInvalidState}
3677
+ error-text=${resolvedErrorText}
3678
+ ?warning=${this.warning}
3679
+ warning-text=${this.warningText}
3680
+ variant=${this.variant}
3681
+ ?populated=${hasValue || this.editing}
3682
+ ?focused=${this.focused}
3683
+ .host=${this}
3684
+ class="url-field-wrapper"
3685
+ >
3686
+ ${this.editing
3687
+ ? b `
3688
+ <input
3689
+ class="url-input"
3690
+ name=${this.name}
3691
+ type="url"
3692
+ placeholder=${this.placeholder}
3693
+ .value=${this.value}
3694
+ ?readonly=${this.readonly}
3695
+ ?required=${this.required}
3696
+ ?disabled=${this.disabled}
3697
+ @input=${this.handleInput}
3698
+ @change=${this.handleChange}
3699
+ @focus=${this.handleFocusChange}
3700
+ @blur=${this.handleBlur}
3701
+ />
3702
+ `
3703
+ : b `<div class="url-display">${this.renderDisplayValue()}</div>`}
3811
3704
 
3812
- ${this.__renderFieldFooter()}
3813
- </div>
3705
+ ${!this.editing && !this.disabled && !this.readonly
3706
+ ? b `
3707
+ <wc-icon-button
3708
+ class="edit-button"
3709
+ slot="field-end"
3710
+ variant="text"
3711
+ @click=${(event) => {
3712
+ event.stopPropagation();
3713
+ this.startEditing();
3714
+ }}
3715
+ >
3716
+ <wc-icon name="edit"></wc-icon>
3717
+ </wc-icon-button>
3718
+ `
3719
+ : A}
3720
+ </wc-field>
3814
3721
  `;
3815
3722
  }
3816
- __renderFieldFooter() {
3817
- if (!this.textCount &&
3818
- !this.helperText &&
3819
- !this.errorText &&
3820
- !this.warningText)
3821
- return A;
3822
- return b `<div class="field-footer">
3823
- ${this.__renderHelperText()} ${this.__renderWordCount()}
3824
- </div>`;
3825
- }
3826
- __renderHelperText() {
3827
- if (this.error)
3828
- return b `<div class="helper">${this.errorText}</div>`;
3829
- if (this.warning)
3830
- return b `<div class="helper">${this.warningText}</div>`;
3831
- if (this.helperText || this.helperText === '')
3832
- return b `<div class="helper">${this.helperText}</div>`;
3833
- return A;
3834
- }
3835
- __renderWordCount() {
3836
- if (!this.textCount)
3837
- return A;
3838
- return b `<div class="text-count">${this.textCount}</div>`;
3839
- }
3840
3723
  }
3841
- Field.styles = [css_248z$t];
3724
+ UrlField.styles = [css_248z$x];
3842
3725
  __decorate([
3843
3726
  n({ type: String })
3844
- ], Field.prototype, "label", void 0);
3727
+ ], UrlField.prototype, "value", void 0);
3845
3728
  __decorate([
3846
3729
  n({ type: String })
3847
- ], Field.prototype, "help", void 0);
3730
+ ], UrlField.prototype, "name", void 0);
3848
3731
  __decorate([
3849
- n({ type: Boolean })
3850
- ], Field.prototype, "required", void 0);
3732
+ n({ type: String })
3733
+ ], UrlField.prototype, "placeholder", void 0);
3851
3734
  __decorate([
3852
- n({ type: Boolean, reflect: true })
3853
- ], Field.prototype, "disabled", void 0);
3735
+ n({ type: String })
3736
+ ], UrlField.prototype, "label", void 0);
3854
3737
  __decorate([
3855
3738
  n({ type: Boolean, reflect: true })
3856
- ], Field.prototype, "readonly", void 0);
3739
+ ], UrlField.prototype, "editing", void 0);
3857
3740
  __decorate([
3858
- n({ type: Boolean })
3859
- ], Field.prototype, "skeleton", void 0);
3741
+ n({ type: Number })
3742
+ ], UrlField.prototype, "debounce", void 0);
3743
+ __decorate([
3744
+ n({ type: String, reflect: true })
3745
+ ], UrlField.prototype, "size", void 0);
3746
+ __decorate([
3747
+ n({ type: String })
3748
+ ], UrlField.prototype, "variant", void 0);
3860
3749
  __decorate([
3861
3750
  n({ type: String, attribute: 'helper-text' })
3862
- ], Field.prototype, "helperText", void 0);
3751
+ ], UrlField.prototype, "helperText", void 0);
3863
3752
  __decorate([
3864
3753
  n({ type: Boolean })
3865
- ], Field.prototype, "error", void 0);
3754
+ ], UrlField.prototype, "error", void 0);
3866
3755
  __decorate([
3867
3756
  n({ type: String, attribute: 'error-text' })
3868
- ], Field.prototype, "errorText", void 0);
3757
+ ], UrlField.prototype, "errorText", void 0);
3869
3758
  __decorate([
3870
3759
  n({ type: Boolean })
3871
- ], Field.prototype, "warning", void 0);
3760
+ ], UrlField.prototype, "warning", void 0);
3872
3761
  __decorate([
3873
3762
  n({ type: String, attribute: 'warning-text' })
3874
- ], Field.prototype, "warningText", void 0);
3763
+ ], UrlField.prototype, "warningText", void 0);
3875
3764
  __decorate([
3876
- n({ type: String, attribute: 'text-count' })
3877
- ], Field.prototype, "textCount", void 0);
3765
+ r()
3766
+ ], UrlField.prototype, "focused", void 0);
3878
3767
  __decorate([
3879
- n({ type: Boolean })
3880
- ], Field.prototype, "focused", void 0);
3768
+ r()
3769
+ ], UrlField.prototype, "isValid", void 0);
3881
3770
  __decorate([
3882
- n({ type: Boolean })
3883
- ], Field.prototype, "populated", void 0);
3884
- __decorate([
3885
- n({ type: String })
3886
- ], Field.prototype, "variant", void 0);
3887
- __decorate([
3888
- n({ type: Object })
3889
- ], Field.prototype, "host", void 0);
3890
- __decorate([
3891
- r()
3892
- ], Field.prototype, "slotStartHasContent", void 0);
3893
- __decorate([
3894
- r()
3895
- ], Field.prototype, "slotEndHasContent", void 0);
3771
+ e$4('.url-input')
3772
+ ], UrlField.prototype, "inputElement", void 0);
3896
3773
 
3897
- var css_248z$s = i`* {
3774
+ var css_248z$w = i`* {
3898
3775
  box-sizing: border-box;
3899
3776
  }
3900
3777
 
@@ -3903,66 +3780,490 @@ var css_248z$s = i`* {
3903
3780
  }
3904
3781
 
3905
3782
  :host {
3906
- display: block;
3907
- width: 100%;
3783
+ --field-height: unset;
3784
+ --field-padding-block: unset;
3908
3785
  }
3909
3786
 
3910
- .input-element {
3911
- border: none;
3912
- outline: none;
3913
- margin: 0;
3914
- padding: 0;
3787
+ .field {
3788
+ position: relative;
3789
+ display: flex;
3790
+ flex-direction: column;
3791
+ --_container-shape-start-start: var(--field-container-shape-start-start, var(--shape-corner-extra-small));
3792
+ --_container-shape-start-end: var(--field-container-shape-start-end, var(--shape-corner-extra-small));
3793
+ --_container-shape-end-start: var(--field-container-shape-end-start, var(--shape-corner-extra-small));
3794
+ --_container-shape-end-end: var(--field-container-shape-end-end, var(--shape-corner-extra-small));
3795
+ --_container-color: var(--field-container-color);
3796
+ --_outline-width: var(--field-outline-width, 0.0675rem);
3797
+ --_outline-color: var(--field-outline-color, var(--color-outline));
3798
+ --_input-text-color: var(--field-label-text-color, var(--color-on-surface));
3799
+ --_helper-text-color: var(--field-helper-text-color, var(--color-on-surface-variant));
3800
+ --_helper-text-opacity: unset;
3801
+ --_label-text-color: var(--field-label-text-color, var(--color-primary));
3915
3802
  }
3916
-
3917
- .input-wrapper .input {
3803
+ .field .field-header {
3804
+ display: flex;
3805
+ align-items: center;
3806
+ margin-block-end: var(--spacing-100);
3807
+ justify-content: space-between;
3808
+ gap: var(--spacing-100);
3809
+ }
3810
+ .field .field-header .label {
3811
+ position: relative;
3812
+ font-family: var(--typography-body-small-font-family) !important;
3813
+ font-size: var(--typography-body-small-font-size) !important;
3814
+ font-weight: var(--typography-body-small-font-weight) !important;
3815
+ line-height: var(--typography-body-small-line-height) !important;
3816
+ letter-spacing: var(--typography-body-small-letter-spacing) !important;
3817
+ color: var(--_label-text-color);
3818
+ overflow: hidden;
3819
+ white-space: nowrap;
3820
+ text-overflow: ellipsis;
3821
+ }
3822
+ .field .field-header .label .required {
3823
+ color: var(--color-error);
3824
+ padding-inline-start: var(--spacing-025);
3825
+ }
3826
+ .field .field-body {
3827
+ position: relative;
3828
+ display: flex;
3829
+ cursor: text;
3830
+ }
3831
+ .field .field-body .outline {
3832
+ position: absolute;
3833
+ z-index: 2;
3834
+ left: 0;
3835
+ width: 100%;
3836
+ height: 100%;
3837
+ pointer-events: none;
3838
+ border: var(--_outline-width) solid var(--_outline-color);
3839
+ opacity: var(--_outline-opacity, 1);
3840
+ border-start-start-radius: var(--_container-shape-start-start);
3841
+ border-start-end-radius: var(--_container-shape-start-end);
3842
+ border-end-start-radius: var(--_container-shape-end-start);
3843
+ border-end-end-radius: var(--_container-shape-end-end);
3844
+ }
3845
+ .field .field-body .background {
3846
+ position: absolute;
3847
+ z-index: 0;
3848
+ left: 0;
3849
+ width: 100%;
3850
+ height: 100%;
3851
+ pointer-events: none;
3852
+ background-color: var(--_container-color);
3853
+ opacity: var(--_container-opacity, 1);
3854
+ border-start-start-radius: var(--_container-shape-start-start);
3855
+ border-start-end-radius: var(--_container-shape-start-end);
3856
+ border-end-start-radius: var(--_container-shape-end-start);
3857
+ border-end-end-radius: var(--_container-shape-end-end);
3858
+ }
3859
+ .field .field-body .field-content {
3860
+ display: flex;
3861
+ align-items: center;
3862
+ flex: 1;
3863
+ height: var(--field-height, 3.5rem);
3864
+ padding-block: var(--field-padding-block);
3865
+ z-index: 1;
3866
+ }
3867
+ .field .field-body .field-content .input-wrapper {
3918
3868
  flex: 1;
3869
+ padding-inline: var(--spacing-200);
3870
+ position: relative;
3871
+ }
3872
+ .field .field-body .field-content .input-wrapper .outlined-label {
3873
+ position: absolute;
3874
+ top: 0;
3875
+ left: 0;
3876
+ align-items: center;
3877
+ height: 100%;
3919
3878
  width: 100%;
3920
- background: none;
3921
- cursor: inherit;
3879
+ padding-inline: var(--spacing-200);
3880
+ font-family: var(--typography-body-large-font-family) !important;
3881
+ font-size: var(--typography-body-large-font-size) !important;
3882
+ font-weight: var(--typography-body-large-font-weight) !important;
3883
+ line-height: var(--typography-body-large-line-height) !important;
3884
+ letter-spacing: var(--typography-body-large-letter-spacing) !important;
3885
+ color: var(--_input-text-color);
3886
+ background-color: var(--_container-color);
3887
+ opacity: var(--_container-opacity, 1);
3922
3888
  }
3923
- .input-wrapper .password-toggle {
3924
- --button-container-shape: var(--shape-corner-full);
3889
+ .field .field-body .field-content .input-wrapper .outlined-slot-container {
3890
+ opacity: 0;
3925
3891
  }
3926
-
3927
- .stepper {
3928
- /* Chrome, Safari, Edge, Opera */
3892
+ .field .field-body .field-content slot::slotted(*) {
3893
+ font-family: var(--typography-body-large-font-family) !important;
3894
+ font-size: var(--typography-body-large-font-size) !important;
3895
+ font-weight: var(--typography-body-large-font-weight) !important;
3896
+ line-height: var(--typography-body-large-line-height) !important;
3897
+ letter-spacing: var(--typography-body-large-letter-spacing) !important;
3898
+ color: var(--_input-text-color);
3899
+ --icon-size: 1.25rem;
3900
+ --icon-color: var(--_input-text-color);
3929
3901
  }
3930
- .stepper input::-webkit-outer-spin-button,
3931
- .stepper input::-webkit-inner-spin-button {
3932
- -webkit-appearance: none;
3933
- margin: 0;
3902
+ .field .field-body .field-content slot::slotted(input::placeholder) {
3903
+ color: var(--color-on-surface-variant);
3934
3904
  }
3935
- .stepper {
3936
- /* Firefox */
3905
+ .field .field-body .field-content .slot-start-wrapper.has-content {
3906
+ margin-inline-start: 0.75rem;
3907
+ display: flex;
3908
+ align-items: center;
3909
+ gap: 0.5rem;
3937
3910
  }
3938
- .stepper input[type=number] {
3939
- -moz-appearance: textfield;
3911
+ .field .field-body .field-content .slot-end-wrapper.has-content {
3912
+ margin-inline-end: 0.75rem;
3913
+ display: flex;
3914
+ align-items: center;
3915
+ gap: 0.5rem;
3916
+ }
3917
+ .field .field-footer {
3918
+ display: flex;
3919
+ align-items: center;
3920
+ justify-content: space-between;
3921
+ gap: var(--spacing-200);
3922
+ margin-block-start: var(--spacing-050);
3923
+ padding-inline: var(--spacing-200);
3924
+ }
3925
+ .field .field-footer .helper, .field .field-footer .text-count {
3926
+ position: relative;
3927
+ font-family: var(--typography-body-large-font-family) !important;
3928
+ font-size: var(--typography-body-large-font-size) !important;
3929
+ font-weight: var(--typography-body-large-font-weight) !important;
3930
+ line-height: var(--typography-body-large-line-height) !important;
3931
+ letter-spacing: var(--typography-body-large-letter-spacing) !important;
3932
+ color: var(--_helper-text-color);
3933
+ opacity: var(--_helper-text-opacity);
3934
+ }
3935
+ .field.focused {
3936
+ --_outline-color: var(--color-primary);
3937
+ --_outline-width: 0.125rem;
3938
+ }
3939
+ .field.has-error {
3940
+ --_label-text-color: var(--color-error);
3941
+ --_outline-color: var(--color-error);
3942
+ --_helper-text-color: var(--color-error);
3943
+ --_input-text-color: var(--color-error);
3944
+ }
3945
+ .field.has-warning {
3946
+ --_label-text-color: var(--color-warning);
3947
+ --_outline-color: var(--color-warning);
3948
+ --_helper-text-color: var(--color-warning);
3949
+ --_input-text-color: var(--color-warning);
3950
+ }
3951
+ .field.disabled .label {
3952
+ opacity: 0.38;
3953
+ }
3954
+ .field.disabled {
3955
+ --_input-text-color: var(--color-on-surface-variant);
3956
+ --_outline-opacity: 0.38;
3957
+ --_helper-text-opacity: 0.38;
3958
+ --_container-color: var(--color-on-surface);
3959
+ --_container-opacity: 0.1;
3960
+ cursor: not-allowed;
3961
+ }
3962
+ .field.readonly {
3963
+ cursor: initial;
3964
+ --_input-text-color: var(--color-on-surface-variant);
3965
+ --_outline-opacity: 0.38;
3966
+ --_helper-text-opacity: 0.38;
3967
+ --_container-color: var(--color-on-surface);
3968
+ --_container-opacity: 0.38;
3969
+ }
3970
+ .field.show-skeleton .skeleton {
3971
+ display: block;
3972
+ }
3973
+
3974
+ .skeleton {
3975
+ display: none;
3976
+ width: 100%;
3977
+ height: 100%;
3978
+ z-index: 2;
3979
+ position: absolute;
3980
+ top: 0;
3981
+ left: 0;
3982
+ --skeleton-container-shape-start-start: var(--_container-shape-start-start);
3983
+ --skeleton-container-shape-start-end: var(--_container-shape-start-end);
3984
+ --skeleton-container-shape-end-start: var(--_container-shape-end-start);
3985
+ --skeleton-container-shape-end-end: var(--_container-shape-end-end);
3940
3986
  }`;
3941
3987
 
3942
- var _NumberField_id;
3943
3988
  /**
3944
- * @label Number Field
3945
- * @tag number-field
3946
- * @rawTag number
3989
+ * @label Field
3990
+ * @tag wc-field
3991
+ * @rawTag field
3947
3992
  *
3948
- * @summary The Number Field component is used to capture numeric user input.
3993
+ * @summary Wrapper for form fields with label and help text.
3994
+ * @overview
3995
+ * <p>Field provides consistent styling and behavior for form inputs.</p>
3949
3996
  *
3950
3997
  * @example
3951
3998
  * ```html
3952
- * <wc-number-field label="Age" placeholder="Enter your age"></wc-number-field>
3999
+ * <wc-field label="Name" required>
4000
+ * some text
4001
+ * </wc-field>
3953
4002
  * ```
4003
+ * @tags form
3954
4004
  */
3955
- class NumberField extends BaseInput {
4005
+ class Field extends i$1 {
3956
4006
  constructor() {
3957
4007
  super(...arguments);
3958
- _NumberField_id.set(this, crypto.randomUUID());
3959
- this.name = '';
3960
- this.placeholder = '';
3961
4008
  this.label = '';
3962
- this.inline = false;
3963
- this.size = 'md';
3964
- this.autocomplete = 'off';
3965
- this.configAria = {};
4009
+ this.help = '';
4010
+ this.required = false;
4011
+ this.disabled = false;
4012
+ this.readonly = false;
4013
+ this.skeleton = false;
4014
+ this.helperText = '';
4015
+ this.error = false;
4016
+ this.errorText = '';
4017
+ this.warning = false;
4018
+ this.warningText = '';
4019
+ this.textCount = '';
4020
+ this.focused = false;
4021
+ this.populated = false;
4022
+ this.variant = 'default';
4023
+ this.slotStartHasContent = false;
4024
+ this.slotEndHasContent = false;
4025
+ }
4026
+ firstUpdated() {
4027
+ observerSlotChangesWithCallback(this.renderRoot.querySelector('.slot-start-wrapper slot'), hasContent => {
4028
+ this.slotStartHasContent = hasContent;
4029
+ this.requestUpdate();
4030
+ });
4031
+ observerSlotChangesWithCallback(this.renderRoot.querySelector('.slot-end-wrapper slot'), hasContent => {
4032
+ this.slotEndHasContent = hasContent;
4033
+ this.requestUpdate();
4034
+ });
4035
+ }
4036
+ __handleClick() {
4037
+ // @ts-ignore
4038
+ this.host?.focus?.();
4039
+ }
4040
+ __renderInputSlot() {
4041
+ if (this.variant === 'outlined') {
4042
+ if (this.populated || this.focused)
4043
+ return b `<slot></slot>`;
4044
+ return b `
4045
+ <label class="outlined-label">${this.label}</label>
4046
+ <div class="outlined-slot-container">
4047
+ <slot></slot>
4048
+ </div>
4049
+ `;
4050
+ }
4051
+ return b `<slot></slot>`;
4052
+ }
4053
+ __renderFieldHeader() {
4054
+ if (!this.label)
4055
+ return A;
4056
+ if (this.variant === 'outlined' && !this.populated && !this.focused) {
4057
+ return A;
4058
+ }
4059
+ return b `<div class="field-header">
4060
+ <label class="label">
4061
+ ${this.label}${this.required
4062
+ ? b `<span class="required">*</span>`
4063
+ : A}
4064
+ <wc-skeleton class="skeleton"></wc-skeleton>
4065
+ </label>
4066
+ </div>`;
4067
+ }
4068
+ render() {
4069
+ const classes = {
4070
+ field: true,
4071
+ required: this.required,
4072
+ disabled: this.disabled,
4073
+ 'show-skeleton': this.skeleton,
4074
+ 'has-error': this.error,
4075
+ 'has-warning': this.warning,
4076
+ focused: this.focused,
4077
+ readonly: this.readonly,
4078
+ [`variant-${this.variant}`]: true,
4079
+ populated: this.populated,
4080
+ };
4081
+ return b `
4082
+ <div class=${e$3(classes)}>
4083
+ ${this.__renderFieldHeader()}
4084
+
4085
+ <div class="field-body" @click=${this.__handleClick}>
4086
+ <div class="outline"></div>
4087
+ <div class="background"></div>
4088
+ <wc-skeleton class="skeleton"></wc-skeleton>
4089
+
4090
+ <div class="field-content">
4091
+ <div
4092
+ class=${e$3({
4093
+ 'slot-start-wrapper': true,
4094
+ 'has-content': this.slotStartHasContent,
4095
+ })}
4096
+ >
4097
+ <slot name="field-start"></slot>
4098
+ </div>
4099
+
4100
+ <div class="input-wrapper">${this.__renderInputSlot()}</div>
4101
+
4102
+ <div
4103
+ class=${e$3({
4104
+ 'slot-end-wrapper': true,
4105
+ 'has-content': this.slotEndHasContent,
4106
+ })}
4107
+ >
4108
+ <slot name="field-end"></slot>
4109
+ </div>
4110
+ </div>
4111
+ </div>
4112
+
4113
+ ${this.__renderFieldFooter()}
4114
+ </div>
4115
+ `;
4116
+ }
4117
+ __renderFieldFooter() {
4118
+ if (!this.textCount &&
4119
+ !this.helperText &&
4120
+ !this.errorText &&
4121
+ !this.warningText)
4122
+ return A;
4123
+ return b `<div class="field-footer">
4124
+ ${this.__renderHelperText()} ${this.__renderWordCount()}
4125
+ </div>`;
4126
+ }
4127
+ __renderHelperText() {
4128
+ if (this.error)
4129
+ return b `<div class="helper">${this.errorText}</div>`;
4130
+ if (this.warning)
4131
+ return b `<div class="helper">${this.warningText}</div>`;
4132
+ if (this.helperText || this.helperText === '')
4133
+ return b `<div class="helper">${this.helperText}</div>`;
4134
+ return A;
4135
+ }
4136
+ __renderWordCount() {
4137
+ if (!this.textCount)
4138
+ return A;
4139
+ return b `<div class="text-count">${this.textCount}</div>`;
4140
+ }
4141
+ }
4142
+ Field.styles = [css_248z$w];
4143
+ __decorate([
4144
+ n({ type: String })
4145
+ ], Field.prototype, "label", void 0);
4146
+ __decorate([
4147
+ n({ type: String })
4148
+ ], Field.prototype, "help", void 0);
4149
+ __decorate([
4150
+ n({ type: Boolean })
4151
+ ], Field.prototype, "required", void 0);
4152
+ __decorate([
4153
+ n({ type: Boolean, reflect: true })
4154
+ ], Field.prototype, "disabled", void 0);
4155
+ __decorate([
4156
+ n({ type: Boolean, reflect: true })
4157
+ ], Field.prototype, "readonly", void 0);
4158
+ __decorate([
4159
+ n({ type: Boolean })
4160
+ ], Field.prototype, "skeleton", void 0);
4161
+ __decorate([
4162
+ n({ type: String, attribute: 'helper-text' })
4163
+ ], Field.prototype, "helperText", void 0);
4164
+ __decorate([
4165
+ n({ type: Boolean })
4166
+ ], Field.prototype, "error", void 0);
4167
+ __decorate([
4168
+ n({ type: String, attribute: 'error-text' })
4169
+ ], Field.prototype, "errorText", void 0);
4170
+ __decorate([
4171
+ n({ type: Boolean })
4172
+ ], Field.prototype, "warning", void 0);
4173
+ __decorate([
4174
+ n({ type: String, attribute: 'warning-text' })
4175
+ ], Field.prototype, "warningText", void 0);
4176
+ __decorate([
4177
+ n({ type: String, attribute: 'text-count' })
4178
+ ], Field.prototype, "textCount", void 0);
4179
+ __decorate([
4180
+ n({ type: Boolean })
4181
+ ], Field.prototype, "focused", void 0);
4182
+ __decorate([
4183
+ n({ type: Boolean })
4184
+ ], Field.prototype, "populated", void 0);
4185
+ __decorate([
4186
+ n({ type: String })
4187
+ ], Field.prototype, "variant", void 0);
4188
+ __decorate([
4189
+ n({ type: Object })
4190
+ ], Field.prototype, "host", void 0);
4191
+ __decorate([
4192
+ r()
4193
+ ], Field.prototype, "slotStartHasContent", void 0);
4194
+ __decorate([
4195
+ r()
4196
+ ], Field.prototype, "slotEndHasContent", void 0);
4197
+
4198
+ var css_248z$v = i`* {
4199
+ box-sizing: border-box;
4200
+ }
4201
+
4202
+ .screen-reader-only {
4203
+ display: none !important;
4204
+ }
4205
+
4206
+ :host {
4207
+ display: block;
4208
+ width: 100%;
4209
+ }
4210
+
4211
+ .input-element {
4212
+ border: none;
4213
+ outline: none;
4214
+ margin: 0;
4215
+ padding: 0;
4216
+ }
4217
+
4218
+ .input-wrapper .input {
4219
+ flex: 1;
4220
+ width: 100%;
4221
+ background: none;
4222
+ cursor: inherit;
4223
+ }
4224
+ .input-wrapper .password-toggle {
4225
+ --button-container-shape: var(--shape-corner-full);
4226
+ }
4227
+
4228
+ .stepper {
4229
+ /* Chrome, Safari, Edge, Opera */
4230
+ }
4231
+ .stepper input::-webkit-outer-spin-button,
4232
+ .stepper input::-webkit-inner-spin-button {
4233
+ -webkit-appearance: none;
4234
+ margin: 0;
4235
+ }
4236
+ .stepper {
4237
+ /* Firefox */
4238
+ }
4239
+ .stepper input[type=number] {
4240
+ -moz-appearance: textfield;
4241
+ }`;
4242
+
4243
+ var _NumberField_id;
4244
+ /**
4245
+ * @label Number Field
4246
+ * @tag number-field
4247
+ * @rawTag number
4248
+ *
4249
+ * @summary The Number Field component is used to capture numeric user input.
4250
+ *
4251
+ * @example
4252
+ * ```html
4253
+ * <wc-number-field label="Age" placeholder="Enter your age"></wc-number-field>
4254
+ * ```
4255
+ */
4256
+ class NumberField extends BaseInput {
4257
+ constructor() {
4258
+ super(...arguments);
4259
+ _NumberField_id.set(this, crypto.randomUUID());
4260
+ this.name = '';
4261
+ this.placeholder = '';
4262
+ this.label = '';
4263
+ this.inline = false;
4264
+ this.size = 'md';
4265
+ this.autocomplete = 'off';
4266
+ this.configAria = {};
3966
4267
  /**
3967
4268
  * Helper text to display below the input.
3968
4269
  */
@@ -4045,11 +4346,12 @@ class NumberField extends BaseInput {
4045
4346
  ${this.stepper && !this.disabled
4046
4347
  ? b `<wc-icon-button
4047
4348
  class="stepper"
4048
- name="remove"
4049
4349
  variant="text"
4050
4350
  slot="field-start"
4051
4351
  @click=${this.stepDown}
4052
- ></wc-icon-button>`
4352
+ >
4353
+ <wc-icon name="remove"></wc-icon>
4354
+ </wc-icon-button>`
4053
4355
  : A}
4054
4356
 
4055
4357
  <slot name="start" slot="field-start"></slot>
@@ -4081,17 +4383,18 @@ class NumberField extends BaseInput {
4081
4383
  ? b `<wc-icon-button
4082
4384
  class="stepper"
4083
4385
  variant="text"
4084
- name="add"
4085
4386
  slot="field-end"
4086
4387
  @click=${this.stepUp}
4087
- ></wc-icon-button>`
4388
+ >
4389
+ <wc-icon name="add"></wc-icon>
4390
+ </wc-icon-button>`
4088
4391
  : A}
4089
4392
  </wc-field>
4090
4393
  `;
4091
4394
  }
4092
4395
  }
4093
4396
  _NumberField_id = new WeakMap();
4094
- NumberField.styles = [css_248z$s];
4397
+ NumberField.styles = [css_248z$v];
4095
4398
  __decorate([
4096
4399
  n({ type: Number })
4097
4400
  ], NumberField.prototype, "value", void 0);
@@ -4153,7 +4456,7 @@ __decorate([
4153
4456
  e$4('.input-element')
4154
4457
  ], NumberField.prototype, "inputElement", void 0);
4155
4458
 
4156
- var css_248z$r = i`* {
4459
+ var css_248z$u = i`* {
4157
4460
  box-sizing: border-box;
4158
4461
  }
4159
4462
 
@@ -4306,7 +4609,6 @@ class DatePicker extends BaseInput {
4306
4609
  slot="field-end"
4307
4610
  color="secondary"
4308
4611
  variant="text"
4309
- name="calendar_today"
4310
4612
  ?disabled=${this.disabled}
4311
4613
  @click=${() => {
4312
4614
  setTimeout(() => {
@@ -4315,12 +4617,13 @@ class DatePicker extends BaseInput {
4315
4617
  });
4316
4618
  }}
4317
4619
  >
4620
+ <wc-icon name="calendar_today"></wc-icon>
4318
4621
  </wc-icon-button>
4319
4622
  </wc-field>
4320
4623
  `;
4321
4624
  }
4322
4625
  }
4323
- DatePicker.styles = [css_248z$r];
4626
+ DatePicker.styles = [css_248z$u];
4324
4627
  __decorate([
4325
4628
  n({ type: String })
4326
4629
  ], DatePicker.prototype, "value", void 0);
@@ -4376,7 +4679,7 @@ __decorate([
4376
4679
  e$4('.input-element')
4377
4680
  ], DatePicker.prototype, "inputElement", void 0);
4378
4681
 
4379
- var css_248z$q = i`* {
4682
+ var css_248z$t = i`* {
4380
4683
  box-sizing: border-box;
4381
4684
  }
4382
4685
 
@@ -4529,7 +4832,6 @@ class TimePicker extends BaseInput {
4529
4832
  slot="field-end"
4530
4833
  color="secondary"
4531
4834
  variant="text"
4532
- name="calendar_today"
4533
4835
  ?disabled=${this.disabled}
4534
4836
  @click=${() => {
4535
4837
  setTimeout(() => {
@@ -4538,12 +4840,13 @@ class TimePicker extends BaseInput {
4538
4840
  });
4539
4841
  }}
4540
4842
  >
4843
+ <wc-icon name="calendar_today"></wc-icon>
4541
4844
  </wc-icon-button>
4542
4845
  </wc-field>
4543
4846
  `;
4544
4847
  }
4545
4848
  }
4546
- TimePicker.styles = [css_248z$q];
4849
+ TimePicker.styles = [css_248z$t];
4547
4850
  __decorate([
4548
4851
  n({ type: String })
4549
4852
  ], TimePicker.prototype, "value", void 0);
@@ -4599,7 +4902,7 @@ __decorate([
4599
4902
  e$4('.input-element')
4600
4903
  ], TimePicker.prototype, "inputElement", void 0);
4601
4904
 
4602
- var css_248z$p = i`* {
4905
+ var css_248z$s = i`* {
4603
4906
  box-sizing: border-box;
4604
4907
  }
4605
4908
 
@@ -4759,7 +5062,7 @@ class Textarea extends BaseInput {
4759
5062
  `;
4760
5063
  }
4761
5064
  }
4762
- Textarea.styles = [css_248z$p];
5065
+ Textarea.styles = [css_248z$s];
4763
5066
  __decorate([
4764
5067
  n({ type: String })
4765
5068
  ], Textarea.prototype, "value", void 0);
@@ -4818,7 +5121,7 @@ __decorate([
4818
5121
  e$4('.input-element')
4819
5122
  ], Textarea.prototype, "inputElement", void 0);
4820
5123
 
4821
- var css_248z$o = i`* {
5124
+ var css_248z$r = i`* {
4822
5125
  box-sizing: border-box;
4823
5126
  }
4824
5127
 
@@ -5159,7 +5462,7 @@ class Switch extends BaseInput {
5159
5462
  `;
5160
5463
  }
5161
5464
  }
5162
- Switch.styles = [css_248z$o];
5465
+ Switch.styles = [css_248z$r];
5163
5466
  __decorate([
5164
5467
  n({ type: Boolean })
5165
5468
  ], Switch.prototype, "value", void 0);
@@ -5203,7 +5506,7 @@ __decorate([
5203
5506
  e$4('.input-native')
5204
5507
  ], Switch.prototype, "nativeElement", void 0);
5205
5508
 
5206
- var css_248z$n = i`* {
5509
+ var css_248z$q = i`* {
5207
5510
  box-sizing: border-box;
5208
5511
  }
5209
5512
 
@@ -5260,12 +5563,9 @@ var css_248z$n = i`* {
5260
5563
  outline: none;
5261
5564
  flex-shrink: 0;
5262
5565
  }
5263
- .checkbox .state-layer {
5264
- position: absolute;
5265
- inset: 0;
5566
+ .checkbox .ripple {
5266
5567
  border-radius: 50%;
5267
- opacity: 0;
5268
- transition: opacity var(--duration-short2) var(--easing-standard);
5568
+ --ripple-pressed-color: var(--color-on-surface);
5269
5569
  }
5270
5570
  .checkbox .outline {
5271
5571
  position: absolute;
@@ -5312,31 +5612,20 @@ var css_248z$n = i`* {
5312
5612
  color: var(--color-on-surface);
5313
5613
  cursor: inherit;
5314
5614
  }
5315
- .checkbox:hover:not(.disabled):not(.readonly) .state-layer {
5316
- opacity: 0.08;
5317
- background: var(--color-on-surface);
5318
- }
5319
- .checkbox:hover:not(.disabled):not(.readonly).state-checked .state-layer, .checkbox:hover:not(.disabled):not(.readonly).state-indeterminate .state-layer {
5320
- background: var(--checkbox-selected-color);
5321
- }
5322
- .checkbox.has-focus:not(.active):not(.disabled):not(.readonly) .state-layer {
5323
- opacity: 0.12;
5324
- background: var(--color-on-surface);
5325
- }
5326
- .checkbox.has-focus:not(.active):not(.disabled):not(.readonly) .container {
5327
- outline: 3px solid var(--color-primary);
5328
- outline-offset: 2px;
5329
- border-radius: 50%;
5615
+ .checkbox:hover:not(.disabled):not(.readonly).state-checked .ripple, .checkbox:hover:not(.disabled):not(.readonly).state-indeterminate .ripple {
5616
+ --ripple-pressed-color: var(--checkbox-selected-color);
5330
5617
  }
5331
- .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 {
5332
- background: var(--checkbox-selected-color);
5618
+ .checkbox .focus-ring {
5619
+ --focus-ring-container-shape-start-start: 50%;
5620
+ --focus-ring-container-shape-start-end: 50%;
5621
+ --focus-ring-container-shape-end-start: 50%;
5622
+ --focus-ring-container-shape-end-end: 50%;
5333
5623
  }
5334
- .checkbox.active:not(.disabled):not(.readonly) .state-layer {
5335
- opacity: 0.12;
5336
- background: var(--color-on-surface);
5624
+ .checkbox.has-focus:not(.active):not(.disabled):not(.readonly).state-checked .ripple, .checkbox.has-focus:not(.active):not(.disabled):not(.readonly).state-indeterminate .ripple {
5625
+ --ripple-pressed-color: var(--checkbox-selected-color);
5337
5626
  }
5338
- .checkbox.active:not(.disabled):not(.readonly).state-checked .state-layer, .checkbox.active:not(.disabled):not(.readonly).state-indeterminate .state-layer {
5339
- background: var(--checkbox-selected-color);
5627
+ .checkbox.active:not(.disabled):not(.readonly).state-checked .ripple, .checkbox.active:not(.disabled):not(.readonly).state-indeterminate .ripple {
5628
+ --ripple-pressed-color: var(--checkbox-selected-color);
5340
5629
  }
5341
5630
  .checkbox.rounded {
5342
5631
  --checkbox-border-radius: 18px;
@@ -5614,6 +5903,7 @@ class Checkbox extends i$1 {
5614
5903
  return b `
5615
5904
  <label class=${e$3(cssClasses)}>
5616
5905
  <div
5906
+ id="container"
5617
5907
  class="container"
5618
5908
  tabindex=${this.tabindex || 0}
5619
5909
  @keyup=${this.handleKeyUp}
@@ -5631,7 +5921,8 @@ class Checkbox extends i$1 {
5631
5921
  : 'false'}
5632
5922
  ${spread(this.configAria)}
5633
5923
  >
5634
- <div class="state-layer"></div>
5924
+ <wc-ripple class="ripple"></wc-ripple>
5925
+ <wc-focus-ring class="focus-ring" for='container'></wc-focus-ring>
5635
5926
  <div class="outline"></div>
5636
5927
  <div class="background"></div>
5637
5928
  <svg class="icon" viewBox="0 0 12 12">
@@ -5673,7 +5964,7 @@ class Checkbox extends i$1 {
5673
5964
  `;
5674
5965
  }
5675
5966
  }
5676
- Checkbox.styles = [css_248z$n];
5967
+ Checkbox.styles = [css_248z$q];
5677
5968
  __decorate([
5678
5969
  n({ type: String })
5679
5970
  ], Checkbox.prototype, "name", void 0);
@@ -5720,7 +6011,7 @@ __decorate([
5720
6011
  e$4('.input-native')
5721
6012
  ], Checkbox.prototype, "nativeElement", void 0);
5722
6013
 
5723
- var css_248z$m = i`* {
6014
+ var css_248z$p = i`* {
5724
6015
  box-sizing: border-box;
5725
6016
  }
5726
6017
 
@@ -5807,9 +6098,9 @@ class Spinner extends i$1 {
5807
6098
  `;
5808
6099
  }
5809
6100
  }
5810
- Spinner.styles = [css_248z$m];
6101
+ Spinner.styles = [css_248z$p];
5811
6102
 
5812
- var css_248z$l = i`* {
6103
+ var css_248z$o = i`* {
5813
6104
  box-sizing: border-box;
5814
6105
  }
5815
6106
 
@@ -5927,12 +6218,12 @@ class Container extends i$1 {
5927
6218
  `;
5928
6219
  }
5929
6220
  }
5930
- Container.styles = [css_248z$l];
6221
+ Container.styles = [css_248z$o];
5931
6222
  __decorate([
5932
6223
  n({ type: String, reflect: true })
5933
6224
  ], Container.prototype, "size", void 0);
5934
6225
 
5935
- var css_248z$k = i`* {
6226
+ var css_248z$n = i`* {
5936
6227
  box-sizing: border-box;
5937
6228
  }
5938
6229
 
@@ -6095,7 +6386,7 @@ class EmptyState extends i$1 {
6095
6386
  }
6096
6387
  }
6097
6388
  // Lit handles styles in a static property for better performance
6098
- EmptyState.styles = [css_248z$k];
6389
+ EmptyState.styles = [css_248z$n];
6099
6390
  __decorate([
6100
6391
  n({ type: String, reflect: true })
6101
6392
  ], EmptyState.prototype, "illustration", void 0);
@@ -6109,7 +6400,7 @@ __decorate([
6109
6400
  r()
6110
6401
  ], EmptyState.prototype, "vertical", void 0);
6111
6402
 
6112
- var css_248z$j = i`* {
6403
+ var css_248z$m = i`* {
6113
6404
  box-sizing: border-box;
6114
6405
  }
6115
6406
 
@@ -7855,6 +8146,24 @@ class Tooltip extends i$1 {
7855
8146
  this._target.removeEventListener('click', this._onClick);
7856
8147
  this._target = null;
7857
8148
  }
8149
+ set forElement(value) {
8150
+ if (value) {
8151
+ this._focusTarget = value;
8152
+ }
8153
+ else {
8154
+ this._focusTarget = undefined;
8155
+ }
8156
+ }
8157
+ __getFocusTarget() {
8158
+ if (this._focusTarget) {
8159
+ return this._focusTarget;
8160
+ }
8161
+ const focusTarget = document.getElementById(this.for);
8162
+ if (focusTarget) {
8163
+ return focusTarget;
8164
+ }
8165
+ return this.parentElement;
8166
+ }
7858
8167
  attachListeners() {
7859
8168
  this.detachListeners(); // Cleanup old target if it exists
7860
8169
  // Resolve target: ID-based lookup or fallback to parent
@@ -7935,7 +8244,7 @@ class Tooltip extends i$1 {
7935
8244
  `;
7936
8245
  }
7937
8246
  }
7938
- Tooltip.styles = [css_248z$j];
8247
+ Tooltip.styles = [css_248z$m];
7939
8248
  Tooltip.CLOSE_OTHERS_EVENT = 'tooltip--open';
7940
8249
  __decorate([
7941
8250
  n()
@@ -7959,7 +8268,7 @@ __decorate([
7959
8268
  e$4('#tooltip')
7960
8269
  ], Tooltip.prototype, "floatingEl", void 0);
7961
8270
 
7962
- var css_248z$i = i`* {
8271
+ var css_248z$l = i`* {
7963
8272
  box-sizing: border-box;
7964
8273
  }
7965
8274
 
@@ -7995,7 +8304,7 @@ ol {
7995
8304
  pointer-events: none;
7996
8305
  }`;
7997
8306
 
7998
- var css_248z$h = i`* {
8307
+ var css_248z$k = i`* {
7999
8308
  box-sizing: border-box;
8000
8309
  }
8001
8310
 
@@ -8125,7 +8434,7 @@ class BreadcrumbItem extends i$1 {
8125
8434
  `;
8126
8435
  }
8127
8436
  }
8128
- BreadcrumbItem.styles = [css_248z$h];
8437
+ BreadcrumbItem.styles = [css_248z$k];
8129
8438
  __decorate([
8130
8439
  n({ reflect: true })
8131
8440
  ], BreadcrumbItem.prototype, "href", void 0);
@@ -8179,13 +8488,13 @@ class Breadcrumb extends i$1 {
8179
8488
  </nav>`;
8180
8489
  }
8181
8490
  }
8182
- Breadcrumb.styles = [css_248z$i];
8491
+ Breadcrumb.styles = [css_248z$l];
8183
8492
  Breadcrumb.Item = BreadcrumbItem;
8184
8493
  __decorate([
8185
8494
  n({ type: String })
8186
8495
  ], Breadcrumb.prototype, "label", void 0);
8187
8496
 
8188
- var css_248z$g = i`* {
8497
+ var css_248z$j = i`* {
8189
8498
  box-sizing: border-box;
8190
8499
  }
8191
8500
 
@@ -8293,7 +8602,7 @@ var css_248z$g = i`* {
8293
8602
  --_container-color: var(--color-tertiary-container);
8294
8603
  }`;
8295
8604
 
8296
- var css_248z$f = i`* {
8605
+ var css_248z$i = i`* {
8297
8606
  box-sizing: border-box;
8298
8607
  }
8299
8608
 
@@ -8405,7 +8714,7 @@ var css_248z$f = i`* {
8405
8714
  display: none;
8406
8715
  }`;
8407
8716
 
8408
- var css_248z$e = i`:host-context([variant=standard]) {
8717
+ var css_248z$h = i`:host-context([variant=standard]) {
8409
8718
  --menu-item-label-color: var(--color-on-surface-variant);
8410
8719
  --menu-item-label-selected-color: var(--color-on-tertiary-container);
8411
8720
  --menu-item-container-selected-color: var(--color-tertiary-container);
@@ -8529,6 +8838,7 @@ class MenuItem extends i$1 {
8529
8838
  const controls = this.getAttribute('aria-controls');
8530
8839
  if (isLink) {
8531
8840
  return b `<a
8841
+ id="item"
8532
8842
  class=${e$3(cssClasses)}
8533
8843
  href=${this.href}
8534
8844
  target=${this.target}
@@ -8541,6 +8851,7 @@ class MenuItem extends i$1 {
8541
8851
  </a> `;
8542
8852
  }
8543
8853
  return b `<div
8854
+ id="item"
8544
8855
  class=${e$3(cssClasses)}
8545
8856
  aria-disabled=${String(this.disabled)}
8546
8857
  aria-haspopup=${this.hasSubmenu ? 'menu' : A}
@@ -8552,7 +8863,7 @@ class MenuItem extends i$1 {
8552
8863
  }
8553
8864
  renderContent() {
8554
8865
  return b `
8555
- <wc-focus-ring class="focus-ring" .control=${this} .forElement=${this}></wc-focus-ring>
8866
+ <wc-focus-ring class="focus-ring" for='item'></wc-focus-ring>
8556
8867
  <div class="background"></div>
8557
8868
  <wc-ripple class="ripple"></wc-ripple>
8558
8869
 
@@ -8566,7 +8877,7 @@ class MenuItem extends i$1 {
8566
8877
  `;
8567
8878
  }
8568
8879
  }
8569
- MenuItem.styles = [css_248z$f, css_248z$e];
8880
+ MenuItem.styles = [css_248z$i, css_248z$h];
8570
8881
  __decorate([
8571
8882
  n({ type: Boolean, reflect: true })
8572
8883
  ], MenuItem.prototype, "disabled", void 0);
@@ -8983,7 +9294,7 @@ class Menu extends i$1 {
8983
9294
  </div>`;
8984
9295
  }
8985
9296
  }
8986
- Menu.styles = [css_248z$g];
9297
+ Menu.styles = [css_248z$j];
8987
9298
  Menu.Item = MenuItem;
8988
9299
  __decorate([
8989
9300
  n({ type: Boolean, reflect: true })
@@ -9019,7 +9330,7 @@ __decorate([
9019
9330
  e$4('.menu')
9020
9331
  ], Menu.prototype, "menuListElement", void 0);
9021
9332
 
9022
- var css_248z$d = i`* {
9333
+ var css_248z$g = i`* {
9023
9334
  box-sizing: border-box;
9024
9335
  }
9025
9336
 
@@ -9214,7 +9525,7 @@ class SubMenu extends i$1 {
9214
9525
  `;
9215
9526
  }
9216
9527
  }
9217
- SubMenu.styles = [css_248z$d];
9528
+ SubMenu.styles = [css_248z$g];
9218
9529
  __decorate([
9219
9530
  n({ type: Number, attribute: 'hover-open-delay' })
9220
9531
  ], SubMenu.prototype, "hoverOpenDelay", void 0);
@@ -9234,7 +9545,7 @@ __decorate([
9234
9545
  o$1({ slot: 'menu' })
9235
9546
  ], SubMenu.prototype, "_menus", void 0);
9236
9547
 
9237
- var css_248z$c = i`@charset "UTF-8";
9548
+ var css_248z$f = i`@charset "UTF-8";
9238
9549
  :host {
9239
9550
  display: block;
9240
9551
  height: 100%;
@@ -9391,7 +9702,7 @@ class Image extends i$1 {
9391
9702
  `;
9392
9703
  }
9393
9704
  }
9394
- Image.styles = [css_248z$c];
9705
+ Image.styles = [css_248z$f];
9395
9706
  __decorate([
9396
9707
  n({ reflect: true })
9397
9708
  ], Image.prototype, "src", void 0);
@@ -9414,7 +9725,7 @@ __decorate([
9414
9725
  r()
9415
9726
  ], Image.prototype, "_previewOpen", void 0);
9416
9727
 
9417
- var css_248z$b = i`* {
9728
+ var css_248z$e = i`* {
9418
9729
  box-sizing: border-box;
9419
9730
  }
9420
9731
 
@@ -9904,6 +10215,7 @@ class Tab extends i$1 {
9904
10215
  };
9905
10216
  if (!isLink) {
9906
10217
  return b `<button
10218
+ id="button"
9907
10219
  class=${e$3(cssClasses)}
9908
10220
  tabindex="0"
9909
10221
  @mousedown=${this.__handlePress}
@@ -9949,7 +10261,7 @@ class Tab extends i$1 {
9949
10261
  }
9950
10262
  renderPrimaryTabContent() {
9951
10263
  return b `
9952
- <wc-focus-ring class="focus-ring" .control=${this} .forElement=${this.tabElement}></wc-focus-ring>
10264
+ <wc-focus-ring class="focus-ring" for='button'></wc-focus-ring>
9953
10265
  <wc-elevation class="elevation"></wc-elevation>
9954
10266
  <div class="background"></div>
9955
10267
  <div class="outline"></div>
@@ -9974,7 +10286,7 @@ class Tab extends i$1 {
9974
10286
  }
9975
10287
  renderSecondaryTabContent() {
9976
10288
  return b `
9977
- <wc-focus-ring class="focus-ring" .control=${this} .forElement=${this.tabElement}></wc-focus-ring>
10289
+ <wc-focus-ring class="focus-ring" for='button'></wc-focus-ring>
9978
10290
  <wc-elevation class="elevation"></wc-elevation>
9979
10291
  <div class="background"></div>
9980
10292
  <div class="outline"></div>
@@ -10004,7 +10316,7 @@ class Tab extends i$1 {
10004
10316
  }
10005
10317
  renderSegmentedTabContent() {
10006
10318
  return b `
10007
- <wc-focus-ring class="focus-ring" .control=${this} .forElement=${this.tabElement}></wc-focus-ring>
10319
+ <wc-focus-ring class="focus-ring" for='button'></wc-focus-ring>
10008
10320
  <wc-elevation class="elevation"></wc-elevation>
10009
10321
  <div class="background"></div>
10010
10322
  <div class="outline"></div>
@@ -10043,7 +10355,7 @@ class Tab extends i$1 {
10043
10355
  }
10044
10356
  }
10045
10357
  _Tab_id = new WeakMap();
10046
- Tab.styles = [css_248z$b];
10358
+ Tab.styles = [css_248z$e];
10047
10359
  __decorate([
10048
10360
  n({ type: Boolean, reflect: true })
10049
10361
  ], Tab.prototype, "active", void 0);
@@ -10087,7 +10399,7 @@ __decorate([
10087
10399
  e$4('.tab-element')
10088
10400
  ], Tab.prototype, "tabElement", void 0);
10089
10401
 
10090
- var css_248z$a = i`* {
10402
+ var css_248z$d = i`* {
10091
10403
  box-sizing: border-box;
10092
10404
  }
10093
10405
 
@@ -10101,7 +10413,7 @@ var css_248z$a = i`* {
10101
10413
  height: 100%;
10102
10414
  }`;
10103
10415
 
10104
- var css_248z$9 = i`* {
10416
+ var css_248z$c = i`* {
10105
10417
  box-sizing: border-box;
10106
10418
  }
10107
10419
 
@@ -10308,7 +10620,7 @@ class Tabs extends i$1 {
10308
10620
  `;
10309
10621
  }
10310
10622
  }
10311
- Tabs.styles = [css_248z$9];
10623
+ Tabs.styles = [css_248z$c];
10312
10624
  Tabs.Tab = Tab;
10313
10625
  __decorate([
10314
10626
  n({ reflect: true })
@@ -10317,7 +10629,7 @@ __decorate([
10317
10629
  n({ type: Boolean })
10318
10630
  ], Tabs.prototype, "managed", void 0);
10319
10631
 
10320
- var css_248z$8 = i`* {
10632
+ var css_248z$b = i`* {
10321
10633
  box-sizing: border-box;
10322
10634
  }
10323
10635
 
@@ -10359,7 +10671,7 @@ class TabPanel extends i$1 {
10359
10671
  return b `<slot></slot>`;
10360
10672
  }
10361
10673
  }
10362
- TabPanel.styles = [css_248z$8];
10674
+ TabPanel.styles = [css_248z$b];
10363
10675
  __decorate([
10364
10676
  n({ reflect: true })
10365
10677
  ], TabPanel.prototype, "value", void 0);
@@ -10512,11 +10824,11 @@ class TabGroup extends i$1 {
10512
10824
  return b `<slot></slot>`;
10513
10825
  }
10514
10826
  }
10515
- TabGroup.styles = [css_248z$a];
10827
+ TabGroup.styles = [css_248z$d];
10516
10828
  TabGroup.Tabs = Tabs;
10517
10829
  TabGroup.TabPanel = TabPanel;
10518
10830
 
10519
- var css_248z$7 = i`:host {
10831
+ var css_248z$a = i`:host {
10520
10832
  --_track-height: 4px;
10521
10833
  --_thumb-size: 20px;
10522
10834
  --thumb-half: 10px;
@@ -10816,7 +11128,7 @@ class Slider extends i$1 {
10816
11128
  `;
10817
11129
  }
10818
11130
  }
10819
- Slider.styles = [css_248z$7];
11131
+ Slider.styles = [css_248z$a];
10820
11132
  __decorate([
10821
11133
  n({ type: Number })
10822
11134
  ], Slider.prototype, "min", void 0);
@@ -10848,7 +11160,7 @@ __decorate([
10848
11160
  e$4('.thumb')
10849
11161
  ], Slider.prototype, "thumbElement", void 0);
10850
11162
 
10851
- var css_248z$6 = i`* {
11163
+ var css_248z$9 = i`* {
10852
11164
  box-sizing: border-box;
10853
11165
  }
10854
11166
 
@@ -11382,7 +11694,7 @@ class Table extends i$1 {
11382
11694
  `;
11383
11695
  }
11384
11696
  }
11385
- Table.styles = [css_248z$6];
11697
+ Table.styles = [css_248z$9];
11386
11698
  __decorate([
11387
11699
  n({ type: Array })
11388
11700
  ], Table.prototype, "columns", void 0);
@@ -11441,7 +11753,7 @@ __decorate([
11441
11753
  r()
11442
11754
  ], Table.prototype, "isHorizontallyScrolled", void 0);
11443
11755
 
11444
- var css_248z$5 = i`* {
11756
+ var css_248z$8 = i`* {
11445
11757
  box-sizing: border-box;
11446
11758
  }
11447
11759
 
@@ -11648,27 +11960,29 @@ class Pagination extends i$1 {
11648
11960
  color="secondary"
11649
11961
  variant="text"
11650
11962
  size="sm"
11651
- name="keyboard_arrow_left"
11652
11963
  title="Previous page"
11653
11964
  ?disabled=${isFirstPage}
11654
11965
  @click=${this.handlePreviousPage}
11655
- ></wc-icon-button>
11966
+ >
11967
+ <wc-icon name="keyboard_arrow_left"></wc-icon>
11968
+ </wc-icon-button>
11656
11969
  <wc-icon-button
11657
11970
  class="nav-button"
11658
11971
  color="secondary"
11659
11972
  variant="text"
11660
11973
  size="sm"
11661
- name="keyboard_arrow_right"
11662
11974
  title="Next page"
11663
11975
  ?disabled=${isLastPage}
11664
11976
  @click=${this.handleNextPage}
11665
- ></wc-icon-button>
11977
+ >
11978
+ <wc-icon name="keyboard_arrow_right"></wc-icon>
11979
+ </wc-icon-button>
11666
11980
  </div>
11667
11981
  </div>
11668
11982
  `;
11669
11983
  }
11670
11984
  }
11671
- Pagination.styles = [css_248z$5];
11985
+ Pagination.styles = [css_248z$8];
11672
11986
  __decorate([
11673
11987
  n({ type: Number })
11674
11988
  ], Pagination.prototype, "page", void 0);
@@ -11682,7 +11996,7 @@ __decorate([
11682
11996
  n({ type: Array, attribute: 'page-sizes' })
11683
11997
  ], Pagination.prototype, "pageSizes", void 0);
11684
11998
 
11685
- var css_248z$4 = i`* {
11999
+ var css_248z$7 = i`* {
11686
12000
  box-sizing: border-box;
11687
12001
  }
11688
12002
 
@@ -11692,120 +12006,121 @@ var css_248z$4 = i`* {
11692
12006
 
11693
12007
  :host {
11694
12008
  display: block;
11695
- --tree-node-height: 2.5rem;
11696
- --tree-node-icon-size: 1.25rem;
11697
- --tree-node-border-radius: var(--global-shape-corner-full, 9999px);
11698
- --tree-node-label-color: var(--color-on-surface);
11699
- --tree-node-icon-color: var(--color-on-surface-variant);
11700
- --tree-node-selected-background: var(--color-secondary-container);
11701
- --tree-node-selected-color: var(--color-on-secondary-container);
11702
- --tree-node-hover-background: var(--color-inverse-primary);
11703
- --tree-node-focus-ring-color: var(--color-primary);
11704
- }
11705
-
11706
- .tree-node {
11707
- display: block;
11708
- }
11709
-
11710
- .tree-node-content {
12009
+ --sidebar-menu-item-height: 3rem;
12010
+ --sidebar-menu-item-icon-size: 1.25rem;
12011
+ --sidebar-menu-item-border-radius: var(--global-shape-corner-full, 9999px);
12012
+ --sidebar-menu-item-label-color: var(--color-on-surface);
12013
+ --sidebar-menu-item-icon-color: var(--color-on-surface-variant);
12014
+ --sidebar-menu-item-selected-background: var(--color-secondary-container);
12015
+ --sidebar-menu-item-selected-color: var(--color-on-secondary-container);
12016
+ --sidebar-menu-item-focus-ring-color: var(--color-primary);
12017
+ --sidebar-menu-item-transition-duration: 200ms;
12018
+ --sidebar-menu-item-transition-easing: cubic-bezier(0.4, 0, 0.2, 1);
12019
+ }
12020
+
12021
+ .sidebar-menu-item {
12022
+ position: relative;
11711
12023
  display: flex;
11712
12024
  align-items: center;
11713
- gap: 0.25rem;
11714
- height: var(--tree-node-height);
11715
- border-radius: var(--tree-node-border-radius);
11716
- color: var(--tree-node-label-color);
12025
+ min-height: var(--sidebar-menu-item-height);
12026
+ border-radius: var(--sidebar-menu-item-border-radius);
12027
+ color: var(--_label-color);
11717
12028
  cursor: pointer;
11718
12029
  user-select: none;
11719
12030
  text-decoration: none;
11720
12031
  outline: none;
11721
- font-family: var(--typography-body-medium-font-family) !important;
11722
- font-size: var(--typography-body-medium-font-size) !important;
11723
- font-weight: var(--typography-body-medium-font-weight) !important;
11724
- line-height: var(--typography-body-medium-line-height) !important;
11725
- letter-spacing: var(--typography-body-medium-letter-spacing) !important;
12032
+ --_container-color: transparent;
12033
+ --_container-opacity: 1;
12034
+ --_label-color: var(--sidebar-menu-item-label-color);
12035
+ font-family: var(--typography-label-large-font-family) !important;
12036
+ font-size: var(--typography-label-large-font-size) !important;
12037
+ font-weight: var(--typography-label-large-font-weight) !important;
12038
+ line-height: var(--typography-label-large-line-height) !important;
12039
+ letter-spacing: var(--typography-label-large-letter-spacing) !important;
11726
12040
  }
11727
- .tree-node-content:not(.disabled):hover {
11728
- background-color: var(--tree-node-hover-background);
12041
+ .sidebar-menu-item.selected {
12042
+ --_container-color: var(--sidebar-menu-item-selected-background);
12043
+ --_label-color: var(--sidebar-menu-item-selected-color);
11729
12044
  }
11730
- .tree-node-content:focus-visible {
11731
- outline: 2px solid var(--tree-node-focus-ring-color);
12045
+ .sidebar-menu-item.disabled {
12046
+ cursor: not-allowed;
12047
+ opacity: 0.6;
11732
12048
  }
11733
- .tree-node-content.selected {
11734
- background-color: var(--tree-node-selected-background);
11735
- color: var(--tree-node-selected-color);
12049
+ .sidebar-menu-item.disabled .ripple {
12050
+ display: none;
11736
12051
  }
11737
- .tree-node-content.selected .node-icon {
11738
- --icon-color: var(--tree-node-selected-color);
12052
+
12053
+ .sidebar-menu-item-content {
12054
+ display: flex;
12055
+ align-items: center;
12056
+ gap: 0.25rem;
12057
+ flex: 1;
12058
+ min-height: var(--sidebar-menu-item-height);
12059
+ padding-inline: 0.75rem;
12060
+ color: inherit;
12061
+ z-index: 1;
11739
12062
  }
11740
- .tree-node-content.disabled {
11741
- cursor: not-allowed;
11742
- opacity: 0.38;
12063
+
12064
+ .background {
12065
+ position: absolute;
12066
+ inset: 0;
12067
+ background-color: var(--_container-color);
12068
+ opacity: var(--_container-opacity);
12069
+ border-radius: inherit;
11743
12070
  pointer-events: none;
11744
12071
  }
11745
12072
 
11746
- .expand-icon {
11747
- --icon-size: var(--tree-node-icon-size);
11748
- --icon-color: var(--tree-node-icon-color);
11749
- flex-shrink: 0;
11750
- transition: transform var(--duration-short2, 200ms) var(--easing-standard, ease);
11751
- }
11752
- .expand-icon.expanded {
11753
- transform: rotate(90deg);
12073
+ .focus-ring {
12074
+ z-index: 2;
12075
+ --focus-ring-color: var(--sidebar-menu-item-focus-ring-color);
12076
+ --focus-ring-container-shape-start-start: var(--sidebar-menu-item-border-radius);
12077
+ --focus-ring-container-shape-start-end: var(--sidebar-menu-item-border-radius);
12078
+ --focus-ring-container-shape-end-start: var(--sidebar-menu-item-border-radius);
12079
+ --focus-ring-container-shape-end-end: var(--sidebar-menu-item-border-radius);
11754
12080
  }
11755
12081
 
11756
- .icon-space {
11757
- display: inline-block;
11758
- width: var(--tree-node-icon-size);
11759
- height: var(--tree-node-icon-size);
11760
- flex-shrink: 0;
12082
+ .ripple {
12083
+ --ripple-pressed-color: var(--color-on-surface);
12084
+ border-radius: inherit;
11761
12085
  }
11762
12086
 
11763
- .node-icon {
11764
- --icon-size: var(--tree-node-icon-size);
11765
- --icon-color: var(--tree-node-icon-color);
11766
- flex-shrink: 0;
12087
+ .sidebar-menu-item.selected .ripple {
12088
+ --ripple-pressed-color: var(--sidebar-menu-item-selected-color);
11767
12089
  }
11768
12090
 
11769
- .tree-node-label {
12091
+ .sidebar-menu-item-label {
11770
12092
  flex: 1;
11771
12093
  overflow: hidden;
11772
12094
  text-overflow: ellipsis;
11773
12095
  white-space: nowrap;
11774
- }
11775
-
11776
- .node-children {
11777
- display: none;
11778
- }
11779
- .node-children.expanded {
11780
- display: block;
11781
12096
  }`;
11782
12097
 
11783
12098
  /**
11784
- * @label Tree Node
11785
- * @tag wc-tree-node
11786
- * @rawTag tree-node
11787
- * @parentRawTag tree-view
11788
- * @summary A tree node represents a single item in a hierarchical tree structure. It supports nesting, icons, links, and keyboard navigation.
12099
+ * @label Sidebar Menu Item
12100
+ * @tag wc-sidebar-menu-item
12101
+ * @rawTag sidebar-menu-item
12102
+ * @parentRawTag sidebar-menu
12103
+ * @summary A sidebar menu item represents a selectable leaf item in the sidebar navigation tree.
11789
12104
  *
11790
12105
  * @example
11791
12106
  * ```html
11792
- * <wc-tree-view>
11793
- * <wc-tree-node label="Parent">
11794
- * <wc-tree-node label="Child"></wc-tree-node>
11795
- * </wc-tree-node>
11796
- * </wc-tree-view>
12107
+ * <wc-sidebar-menu>
12108
+ * <wc-sidebar-sub-menu label="Parent" expanded>
12109
+ * <wc-sidebar-menu-item label="Child"></wc-sidebar-menu-item>
12110
+ * </wc-sidebar-sub-menu>
12111
+ * </wc-sidebar-menu>
11797
12112
  * ```
11798
12113
  * @tags navigation
11799
12114
  */
11800
- class TreeNode extends i$1 {
12115
+ class SidebarMenuItem extends i$1 {
11801
12116
  constructor() {
11802
12117
  super(...arguments);
11803
12118
  /**
11804
- * The value used to identify this node when selected.
12119
+ * The value used to identify this item when selected.
11805
12120
  */
11806
12121
  this.value = '';
11807
12122
  /**
11808
- * The display label for this node.
12123
+ * The display label for this item.
11809
12124
  */
11810
12125
  this.label = '';
11811
12126
  /**
@@ -11821,21 +12136,26 @@ class TreeNode extends i$1 {
11821
12136
  */
11822
12137
  this.target = '_self';
11823
12138
  /**
11824
- * If true, the user cannot interact with the node.
12139
+ * If true, the user cannot interact with the item.
11825
12140
  */
11826
12141
  this.disabled = false;
11827
12142
  /**
11828
- * Whether the node is currently selected.
12143
+ * Whether the item is currently selected.
11829
12144
  */
11830
12145
  this.selected = false;
11831
12146
  /**
11832
- * Whether child nodes are visible.
11833
- */
11834
- this.expanded = false;
11835
- /**
11836
- * The nesting depth level (set automatically by the parent tree-view).
12147
+ * The nesting depth level (set automatically by the parent sidebar-menu).
11837
12148
  */
11838
12149
  this.level = 0;
12150
+ this._onClick = () => {
12151
+ if (this.disabled)
12152
+ return;
12153
+ this.dispatchEvent(new CustomEvent('sidebar-menu-item:click', {
12154
+ bubbles: true,
12155
+ composed: true,
12156
+ detail: { value: this.value, label: this.label },
12157
+ }));
12158
+ };
11839
12159
  }
11840
12160
  focus() {
11841
12161
  this._nativeElement?.focus();
@@ -11843,193 +12163,88 @@ class TreeNode extends i$1 {
11843
12163
  blur() {
11844
12164
  this._nativeElement?.blur();
11845
12165
  }
11846
- _getChildNodes() {
11847
- return Array.from(this.children).filter(el => el.tagName.toLowerCase() === 'wc-tree-node');
11848
- }
11849
- connectedCallback() {
11850
- super.connectedCallback();
11851
- this._updateChildLevels();
11852
- this.setAttribute('role', 'treeitem');
11853
- this._syncHostAria();
11854
- }
11855
- _syncHostAria() {
11856
- const hasChildren = this._getChildNodes().length > 0;
11857
- if (hasChildren) {
11858
- this.setAttribute('aria-expanded', String(this.expanded));
11859
- }
11860
- else {
11861
- this.removeAttribute('aria-expanded');
11862
- }
11863
- this.setAttribute('aria-selected', String(this.selected));
11864
- this.setAttribute('aria-disabled', String(this.disabled));
11865
- this.setAttribute('aria-level', String(this.level + 1));
11866
- }
11867
- _updateChildLevels() {
11868
- const children = this._getChildNodes();
11869
- children.forEach(child => {
11870
- // eslint-disable-next-line no-param-reassign
11871
- child.level = this.level + 1;
11872
- });
11873
- }
11874
- _handleClick(event) {
11875
- if (this.disabled) {
11876
- event.preventDefault();
11877
- event.stopPropagation();
11878
- return;
11879
- }
11880
- const hasChildren = this._getChildNodes().length > 0;
11881
- if (hasChildren) {
11882
- this.expanded = !this.expanded;
11883
- }
11884
- this.dispatchEvent(new CustomEvent('tree-node:click', {
11885
- bubbles: true,
11886
- composed: true,
11887
- detail: {
11888
- value: this.value || this.label,
11889
- label: this.label,
11890
- expanded: this.expanded,
11891
- },
11892
- }));
11893
- }
11894
- _handleKeyDown(event) {
11895
- if (this.disabled)
11896
- return;
11897
- const hasChildren = this._getChildNodes().length > 0;
11898
- switch (event.key) {
11899
- case ' ':
11900
- case 'Enter':
11901
- event.preventDefault();
11902
- if (hasChildren) {
11903
- this.expanded = !this.expanded;
11904
- }
11905
- this.dispatchEvent(new CustomEvent('tree-node:click', {
11906
- bubbles: true,
11907
- composed: true,
11908
- detail: {
11909
- value: this.value || this.label,
11910
- label: this.label,
11911
- expanded: this.expanded,
11912
- },
11913
- }));
11914
- if (this.href) {
11915
- window.open(this.href, this.target);
11916
- }
11917
- break;
11918
- case 'ArrowLeft':
11919
- event.preventDefault();
11920
- if (this.expanded && hasChildren) {
11921
- this.expanded = false;
11922
- }
11923
- break;
11924
- case 'ArrowRight':
11925
- event.preventDefault();
11926
- if (hasChildren) {
11927
- if (!this.expanded) {
11928
- this.expanded = true;
11929
- }
11930
- else {
11931
- const firstChild = this._getChildNodes()[0];
11932
- firstChild?.focus();
11933
- }
11934
- }
11935
- break;
11936
- }
11937
- }
11938
- updated(changedProps) {
11939
- super.updated(changedProps);
11940
- if (changedProps.has('level')) {
11941
- this._updateChildLevels();
11942
- }
11943
- this._syncHostAria();
11944
- }
11945
- _renderContent(hasChildren) {
11946
- // 0.125rem offset aligns text visually with the expand/icon space
11947
- const indentStyle = o$2({
11948
- paddingInlineStart: `calc(${this.level + 1}rem - 0.125rem)`,
11949
- });
11950
- const contentClasses = e$3({
11951
- 'tree-node-content': true,
11952
- selected: this.selected,
12166
+ render() {
12167
+ const classes = e$3({
12168
+ 'sidebar-menu-item': true,
11953
12169
  disabled: this.disabled,
12170
+ selected: this.selected,
11954
12171
  });
11955
- const innerContent = b `
11956
- ${hasChildren
11957
- ? b `<wc-icon
11958
- class=${e$3({ 'expand-icon': true, expanded: this.expanded })}
11959
- name="arrow_right"
11960
- ></wc-icon>`
11961
- : b `<span class="icon-space"></span>`}
11962
- ${this.icon
11963
- ? b `<wc-icon class="node-icon" name=${this.icon}></wc-icon>`
11964
- : ''}
11965
- <span class="tree-node-label">${this.label}<slot name="label"></slot></span>
12172
+ const content = b `
12173
+ <wc-focus-ring class="focus-ring" for="item"></wc-focus-ring>
12174
+ <div class="background"></div>
12175
+ <wc-ripple class="ripple"></wc-ripple>
12176
+ <div class="sidebar-menu-item-content">
12177
+ ${this.icon ? b `<wc-icon name="${this.icon}"></wc-icon>` : ''}
12178
+ <span class="sidebar-menu-item-label">${this.label}</span>
12179
+ </div>
11966
12180
  `;
11967
12181
  if (this.href) {
11968
- return b `<a
11969
- class=${contentClasses}
11970
- style=${indentStyle}
11971
- href=${this.href}
11972
- target=${this.target}
11973
- tabindex=${this.disabled ? '-1' : '0'}
11974
- @click=${this._handleClick}
11975
- @keydown=${this._handleKeyDown}
11976
- >${innerContent}</a>`;
12182
+ return b `
12183
+ <a
12184
+ id="item"
12185
+ href="${this.href}"
12186
+ target="${this.target}"
12187
+ class="${classes}"
12188
+ aria-disabled="${this.disabled}"
12189
+ tabindex="${this.disabled ? -1 : 0}"
12190
+ @click="${this._onClick}"
12191
+ >
12192
+ ${content}
12193
+ </a>
12194
+ `;
11977
12195
  }
11978
- return b `<div
11979
- class=${contentClasses}
11980
- style=${indentStyle}
11981
- tabindex=${this.disabled ? '-1' : '0'}
11982
- @click=${this._handleClick}
11983
- @keydown=${this._handleKeyDown}
11984
- >${innerContent}</div>`;
11985
- }
11986
- render() {
11987
- const hasChildren = this._getChildNodes().length > 0;
11988
- const nodeSlotClasses = e$3({
11989
- 'node-children': true,
11990
- expanded: this.expanded,
11991
- });
11992
- return b `<div class="tree-node">
11993
- ${this._renderContent(hasChildren)}
11994
- <div class=${nodeSlotClasses}>
11995
- <slot></slot>
12196
+ return b `
12197
+ <div
12198
+ id="item"
12199
+ class="${classes}"
12200
+ role="treeitem"
12201
+ aria-label="${this.label}"
12202
+ aria-selected="${String(this.selected)}"
12203
+ aria-disabled="${this.disabled}"
12204
+ tabindex="${this.disabled ? -1 : 0}"
12205
+ @click="${this._onClick}"
12206
+ @keydown="${(e) => {
12207
+ if (e.key === 'Enter' || e.key === ' ') {
12208
+ e.preventDefault();
12209
+ this._onClick();
12210
+ }
12211
+ }}"
12212
+ >
12213
+ ${content}
11996
12214
  </div>
11997
- </div>`;
12215
+ `;
11998
12216
  }
11999
12217
  }
12000
- TreeNode.styles = [css_248z$4];
12218
+ SidebarMenuItem.styles = [css_248z$7];
12001
12219
  __decorate([
12002
12220
  n({ type: String, reflect: true })
12003
- ], TreeNode.prototype, "value", void 0);
12221
+ ], SidebarMenuItem.prototype, "value", void 0);
12004
12222
  __decorate([
12005
12223
  n({ type: String, reflect: true })
12006
- ], TreeNode.prototype, "label", void 0);
12224
+ ], SidebarMenuItem.prototype, "label", void 0);
12007
12225
  __decorate([
12008
12226
  n({ type: String, reflect: true })
12009
- ], TreeNode.prototype, "icon", void 0);
12227
+ ], SidebarMenuItem.prototype, "icon", void 0);
12010
12228
  __decorate([
12011
12229
  n({ type: String, reflect: true })
12012
- ], TreeNode.prototype, "href", void 0);
12230
+ ], SidebarMenuItem.prototype, "href", void 0);
12013
12231
  __decorate([
12014
12232
  n({ type: String, reflect: true })
12015
- ], TreeNode.prototype, "target", void 0);
12016
- __decorate([
12017
- n({ type: Boolean, reflect: true })
12018
- ], TreeNode.prototype, "disabled", void 0);
12233
+ ], SidebarMenuItem.prototype, "target", void 0);
12019
12234
  __decorate([
12020
12235
  n({ type: Boolean, reflect: true })
12021
- ], TreeNode.prototype, "selected", void 0);
12236
+ ], SidebarMenuItem.prototype, "disabled", void 0);
12022
12237
  __decorate([
12023
12238
  n({ type: Boolean, reflect: true })
12024
- ], TreeNode.prototype, "expanded", void 0);
12239
+ ], SidebarMenuItem.prototype, "selected", void 0);
12025
12240
  __decorate([
12026
12241
  n({ type: Number, reflect: true })
12027
- ], TreeNode.prototype, "level", void 0);
12242
+ ], SidebarMenuItem.prototype, "level", void 0);
12028
12243
  __decorate([
12029
- e$4('.tree-node-content')
12030
- ], TreeNode.prototype, "_nativeElement", void 0);
12244
+ e$4('.sidebar-menu-item-content')
12245
+ ], SidebarMenuItem.prototype, "_nativeElement", void 0);
12031
12246
 
12032
- var css_248z$3 = i`* {
12247
+ var css_248z$6 = i`* {
12033
12248
  box-sizing: border-box;
12034
12249
  }
12035
12250
 
@@ -12039,166 +12254,454 @@ var css_248z$3 = i`* {
12039
12254
 
12040
12255
  :host {
12041
12256
  display: block;
12257
+ --sidebar-menu-item-height: 3rem;
12258
+ --sidebar-menu-item-border-radius: var(--global-shape-corner-full, 9999px);
12259
+ --sidebar-menu-item-label-color: var(--color-on-surface);
12260
+ --sidebar-menu-item-icon-color: var(--color-on-surface-variant);
12261
+ --sidebar-menu-item-selected-background: var(--color-secondary-container);
12262
+ --sidebar-menu-item-selected-color: var(--color-on-secondary-container);
12263
+ --sidebar-menu-item-focus-ring-color: var(--color-primary);
12042
12264
  }
12043
12265
 
12044
- .tree-view {
12266
+ .sidebar-sub-menu {
12045
12267
  display: block;
12046
- padding: var(--spacing-100, 0.5rem) 0;
12047
- }`;
12268
+ }
12048
12269
 
12049
- /**
12050
- * @label Tree View
12051
- * @tag wc-tree-view
12052
- * @rawTag tree-view
12053
- * @summary A tree view is a hierarchical structure that provides nested levels of navigation. It supports keyboard navigation, single/multi select, and expandable nodes.
12054
- *
12055
- * @example
12056
- * ```html
12057
- * <wc-tree-view>
12058
- * <wc-tree-node label="Parent" expanded>
12059
- * <wc-tree-node label="Child 1"></wc-tree-node>
12060
- * <wc-tree-node label="Child 2"></wc-tree-node>
12061
- * </wc-tree-node>
12062
- * </wc-tree-view>
12063
- * ```
12064
- * @tags navigation
12065
- */
12066
- class TreeView extends i$1 {
12067
- constructor() {
12068
- super(...arguments);
12069
- /**
12070
- * The value of the currently selected node.
12071
- */
12072
- this.selectedNode = '';
12073
- this._onNodeClick = (event) => {
12074
- const target = event.target;
12075
- if (target.disabled)
12076
- return;
12077
- const value = event.detail?.value ?? target.value ?? target.label;
12078
- this.selectedNode = value;
12079
- // Update selected state on all nodes
12080
- this._updateSelectedState(value);
12081
- this.dispatchEvent(new CustomEvent('tree-view:change', {
12082
- bubbles: true,
12083
- composed: true,
12084
- detail: { value, node: target },
12085
- }));
12086
- };
12087
- this._onSlotChange = () => {
12088
- this._syncSelectedStateFromProperty();
12089
- };
12090
- this._onKeyDown = (event) => {
12091
- const visibleNodes = this._getAllVisibleNodes().filter(n => !n.disabled);
12092
- if (visibleNodes.length === 0)
12093
- return;
12094
- const focusedIndex = visibleNodes.findIndex(node => {
12095
- const root = node.shadowRoot;
12096
- return root?.activeElement !== null && root?.activeElement !== undefined;
12097
- });
12098
- if (focusedIndex === -1 && event.key !== 'Tab')
12099
- return;
12100
- switch (event.key) {
12101
- case 'ArrowDown': {
12102
- event.preventDefault();
12103
- const nextIndex = (focusedIndex + 1) % visibleNodes.length;
12104
- visibleNodes[nextIndex]?.focus();
12105
- break;
12106
- }
12107
- case 'ArrowUp': {
12108
- event.preventDefault();
12109
- const prevIndex = (focusedIndex - 1 + visibleNodes.length) % visibleNodes.length;
12110
- visibleNodes[prevIndex]?.focus();
12111
- break;
12112
- }
12113
- case 'Home':
12114
- event.preventDefault();
12115
- visibleNodes[0]?.focus();
12116
- break;
12117
- case 'End':
12118
- event.preventDefault();
12119
- visibleNodes[visibleNodes.length - 1]?.focus();
12120
- break;
12270
+ .sidebar-sub-menu-inner {
12271
+ position: relative;
12272
+ display: flex;
12273
+ align-items: center;
12274
+ gap: 0.5rem;
12275
+ min-height: var(--sidebar-menu-item-height);
12276
+ cursor: pointer;
12277
+ border-radius: var(--sidebar-menu-item-border-radius);
12278
+ outline: none;
12279
+ padding-inline-end: 0.75rem;
12280
+ color: var(--_label-color);
12281
+ --_container-color: transparent;
12282
+ --_container-opacity: 1;
12283
+ --_label-color: var(--sidebar-menu-item-label-color);
12284
+ font-family: var(--typography-label-large-font-family) !important;
12285
+ font-size: var(--typography-label-large-font-size) !important;
12286
+ font-weight: var(--typography-label-large-font-weight) !important;
12287
+ line-height: var(--typography-label-large-line-height) !important;
12288
+ letter-spacing: var(--typography-label-large-letter-spacing) !important;
12289
+ }
12290
+ .sidebar-sub-menu-inner.selected {
12291
+ --_container-color: var(--sidebar-menu-item-selected-background);
12292
+ --_label-color: var(--sidebar-menu-item-selected-color);
12293
+ }
12294
+ .sidebar-sub-menu-inner.disabled {
12295
+ cursor: not-allowed;
12296
+ opacity: 0.6;
12297
+ }
12298
+ .sidebar-sub-menu-inner.disabled .ripple {
12299
+ display: none;
12300
+ }
12301
+
12302
+ .sidebar-sub-menu-content {
12303
+ display: flex;
12304
+ align-items: center;
12305
+ gap: 0.25rem;
12306
+ flex: 1;
12307
+ min-height: var(--sidebar-menu-item-height);
12308
+ color: inherit;
12309
+ user-select: none;
12310
+ text-decoration: none;
12311
+ outline: none;
12312
+ padding-inline: 0.75rem;
12313
+ z-index: 1;
12314
+ }
12315
+
12316
+ .background {
12317
+ position: absolute;
12318
+ inset: 0;
12319
+ background-color: var(--_container-color);
12320
+ opacity: var(--_container-opacity);
12321
+ border-radius: inherit;
12322
+ pointer-events: none;
12323
+ }
12324
+
12325
+ .focus-ring {
12326
+ z-index: 2;
12327
+ --focus-ring-color: var(--sidebar-menu-item-focus-ring-color);
12328
+ --focus-ring-container-shape-start-start: var(--sidebar-menu-item-border-radius);
12329
+ --focus-ring-container-shape-start-end: var(--sidebar-menu-item-border-radius);
12330
+ --focus-ring-container-shape-end-start: var(--sidebar-menu-item-border-radius);
12331
+ --focus-ring-container-shape-end-end: var(--sidebar-menu-item-border-radius);
12332
+ }
12333
+
12334
+ .ripple {
12335
+ --ripple-pressed-color: var(--color-on-surface);
12336
+ border-radius: inherit;
12337
+ }
12338
+
12339
+ .sidebar-sub-menu-inner.selected .ripple {
12340
+ --ripple-pressed-color: var(--sidebar-menu-item-selected-color);
12341
+ }
12342
+
12343
+ .sidebar-sub-menu-label {
12344
+ flex: 1;
12345
+ overflow: hidden;
12346
+ text-overflow: ellipsis;
12347
+ white-space: nowrap;
12348
+ }
12349
+
12350
+ .expand-icon {
12351
+ display: flex;
12352
+ align-items: center;
12353
+ justify-content: center;
12354
+ color: var(--sidebar-menu-item-icon-color);
12355
+ flex-shrink: 0;
12356
+ width: var(--sidebar-menu-item-height);
12357
+ height: var(--sidebar-menu-item-height);
12358
+ transition: transform var(--duration-medium1) var(--easing-standard);
12359
+ }
12360
+
12361
+ :host([expanded]) .expand-icon {
12362
+ transform: rotate(180deg);
12363
+ }
12364
+
12365
+ .sidebar-sub-menu-children {
12366
+ display: block;
12367
+ overflow: hidden;
12368
+ margin-left: var(--spacing-200);
12369
+ max-height: 9999px;
12370
+ opacity: 1;
12371
+ transition: max-height var(--duration-medium1) var(--easing-standard), opacity var(--duration-medium1) var(--easing-standard);
12372
+ }
12373
+
12374
+ .sidebar-sub-menu-children.hidden {
12375
+ max-height: 0;
12376
+ opacity: 0;
12377
+ }`;
12378
+
12379
+ /**
12380
+ * @label Sidebar Sub Menu
12381
+ * @tag wc-sidebar-sub-menu
12382
+ * @rawTag sidebar-sub-menu
12383
+ * @parentRawTag sidebar-menu
12384
+ * @summary A sidebar sub menu groups sidebar menu items and handles expand/collapse behavior.
12385
+ *
12386
+ * @example
12387
+ * ```html
12388
+ * <wc-sidebar-sub-menu label="Parent" expanded>
12389
+ * <wc-sidebar-menu-item label="Child"></wc-sidebar-menu-item>
12390
+ * </wc-sidebar-sub-menu>
12391
+ * ```
12392
+ * @tags navigation
12393
+ */
12394
+ class SidebarSubMenu extends i$1 {
12395
+ constructor() {
12396
+ super(...arguments);
12397
+ this.value = '';
12398
+ this.label = '';
12399
+ this.icon = '';
12400
+ this.disabled = false;
12401
+ this.selected = false;
12402
+ this.expanded = false;
12403
+ this.level = 0;
12404
+ this._updateChildLevels = () => {
12405
+ this._getChildNodes().forEach(child => {
12406
+ if ('level' in child) {
12407
+ // eslint-disable-next-line no-param-reassign
12408
+ child.level = this.level + 1;
12409
+ }
12410
+ });
12411
+ };
12412
+ this._onClick = () => {
12413
+ if (this.disabled)
12414
+ return;
12415
+ if (this._getChildNodes().length > 0) {
12416
+ this.expanded = !this.expanded;
12417
+ }
12418
+ this.dispatchEvent(new CustomEvent('sidebar-menu-item:click', {
12419
+ bubbles: true,
12420
+ composed: true,
12421
+ detail: { value: this.value, label: this.label },
12422
+ }));
12423
+ };
12424
+ }
12425
+ focus() {
12426
+ this._nativeElement?.focus();
12427
+ }
12428
+ blur() {
12429
+ this._nativeElement?.blur();
12430
+ }
12431
+ connectedCallback() {
12432
+ super.connectedCallback();
12433
+ this._updateChildLevels();
12434
+ }
12435
+ updated(changedProps) {
12436
+ super.updated(changedProps);
12437
+ if (changedProps.has('expanded')) {
12438
+ this.setAttribute('aria-expanded', String(this.expanded));
12439
+ if (this.expanded) {
12440
+ this.setAttribute('data-expanded', '');
12441
+ }
12442
+ else {
12443
+ this.removeAttribute('data-expanded');
12444
+ }
12445
+ }
12446
+ }
12447
+ _getChildNodes() {
12448
+ return Array.from(this.children).filter(el => {
12449
+ const tag = el.tagName.toLowerCase();
12450
+ return tag === 'wc-sidebar-menu-item' || tag === 'wc-sidebar-sub-menu';
12451
+ });
12452
+ }
12453
+ render() {
12454
+ const hasChildren = this._getChildNodes().length > 0;
12455
+ const wrapperClasses = e$3({
12456
+ 'sidebar-sub-menu': true,
12457
+ });
12458
+ const innerClasses = e$3({
12459
+ 'sidebar-sub-menu-inner': true,
12460
+ disabled: this.disabled,
12461
+ selected: this.selected,
12462
+ });
12463
+ const inlineStyles = o$2({
12464
+ paddingLeft: `calc(var(--sidebar-menu-item-height, 2.5rem) * ${this.level})`,
12465
+ });
12466
+ return b `
12467
+ <div class="${wrapperClasses}" style="${inlineStyles}">
12468
+ <div
12469
+ id="item"
12470
+ class="${innerClasses}"
12471
+ role="treeitem"
12472
+ aria-label="${this.label}"
12473
+ aria-selected="${String(this.selected)}"
12474
+ aria-disabled="${this.disabled}"
12475
+ aria-expanded="${this.expanded}"
12476
+ @click="${this._onClick}"
12477
+ @keydown="${(e) => {
12478
+ if (e.key === 'Enter' || e.key === ' ') {
12479
+ e.preventDefault();
12480
+ this._onClick();
12481
+ }
12482
+ }}"
12483
+ tabindex="${this.disabled ? -1 : 0}"
12484
+ >
12485
+ <wc-focus-ring class="focus-ring" for="item"></wc-focus-ring>
12486
+ <div class="background"></div>
12487
+ <wc-ripple class="ripple"></wc-ripple>
12488
+ <div class="sidebar-sub-menu-content">
12489
+ ${this.icon ? b `<wc-icon name="${this.icon}"></wc-icon>` : ''}
12490
+ <span class="sidebar-sub-menu-label">${this.label}</span>
12491
+ </div>
12492
+ ${hasChildren
12493
+ ? b `
12494
+ <wc-icon class="expand-icon" name="arrow_drop_down" aria-hidden="true"></wc-icon>
12495
+ `
12496
+ : ''}
12497
+ </div>
12498
+ <div class="sidebar-sub-menu-children ${(!hasChildren || !this.expanded) ? 'hidden' : ''}">
12499
+ <slot @slotchange="${this._updateChildLevels}"></slot>
12500
+ </div>
12501
+ </div>
12502
+ `;
12503
+ }
12504
+ }
12505
+ SidebarSubMenu.styles = [css_248z$6];
12506
+ __decorate([
12507
+ n({ type: String, reflect: true })
12508
+ ], SidebarSubMenu.prototype, "value", void 0);
12509
+ __decorate([
12510
+ n({ type: String, reflect: true })
12511
+ ], SidebarSubMenu.prototype, "label", void 0);
12512
+ __decorate([
12513
+ n({ type: String, reflect: true })
12514
+ ], SidebarSubMenu.prototype, "icon", void 0);
12515
+ __decorate([
12516
+ n({ type: Boolean, reflect: true })
12517
+ ], SidebarSubMenu.prototype, "disabled", void 0);
12518
+ __decorate([
12519
+ n({ type: Boolean, reflect: true })
12520
+ ], SidebarSubMenu.prototype, "selected", void 0);
12521
+ __decorate([
12522
+ n({ type: Boolean, reflect: true })
12523
+ ], SidebarSubMenu.prototype, "expanded", void 0);
12524
+ __decorate([
12525
+ n({ type: Number, reflect: true })
12526
+ ], SidebarSubMenu.prototype, "level", void 0);
12527
+ __decorate([
12528
+ e$4('.sidebar-sub-menu-inner')
12529
+ ], SidebarSubMenu.prototype, "_nativeElement", void 0);
12530
+
12531
+ var css_248z$5 = i`* {
12532
+ box-sizing: border-box;
12533
+ }
12534
+
12535
+ .screen-reader-only {
12536
+ display: none !important;
12537
+ }
12538
+
12539
+ :host {
12540
+ display: block;
12541
+ }
12542
+
12543
+ .sidebar-menu {
12544
+ display: block;
12545
+ padding: var(--spacing-100, 0.5rem) 0;
12546
+ }`;
12547
+
12548
+ /**
12549
+ * @label Sidebar Menu
12550
+ * @tag wc-sidebar-menu
12551
+ * @rawTag sidebar-menu
12552
+ * @summary A sidebar menu is a hierarchical structure that provides nested levels of navigation. It supports keyboard navigation, single/multi select, and expandable items.
12553
+ *
12554
+ * @example
12555
+ * ```html
12556
+ * <wc-sidebar-menu>
12557
+ * <wc-sidebar-sub-menu label="Parent" expanded>
12558
+ * <wc-sidebar-menu-item label="Child 1"></wc-sidebar-menu-item>
12559
+ * <wc-sidebar-menu-item label="Child 2"></wc-sidebar-menu-item>
12560
+ * </wc-sidebar-sub-menu>
12561
+ * </wc-sidebar-menu>
12562
+ * ```
12563
+ * @tags navigation
12564
+ */
12565
+ class SidebarMenu extends i$1 {
12566
+ constructor() {
12567
+ super(...arguments);
12568
+ /**
12569
+ * The value of the currently selected item.
12570
+ */
12571
+ this.selectedItem = '';
12572
+ this._onItemClick = (event) => {
12573
+ const item = event.target;
12574
+ if (item.disabled)
12575
+ return;
12576
+ const value = event.detail?.value ?? item.value ?? item.label;
12577
+ this.selectedItem = value;
12578
+ // Update selected state on all items
12579
+ this._updateSelectedState(value);
12580
+ this.dispatchEvent(new CustomEvent('sidebar-menu:change', {
12581
+ bubbles: true,
12582
+ composed: true,
12583
+ detail: { value, item },
12584
+ }));
12585
+ };
12586
+ this._onKeyDown = (event) => {
12587
+ const allVisible = this._getAllVisibleItems();
12588
+ const currentElement = event.composedPath().find(target => target instanceof SidebarMenuItem || target instanceof SidebarSubMenu);
12589
+ if (!currentElement) {
12590
+ return;
12591
+ }
12592
+ if (!allVisible.includes(currentElement)) {
12593
+ return;
12594
+ }
12595
+ const currentIndex = allVisible.indexOf(currentElement);
12596
+ if (event.key === 'ArrowDown') {
12597
+ event.preventDefault();
12598
+ const nextIndex = (currentIndex + 1) % allVisible.length;
12599
+ allVisible[nextIndex].focus();
12600
+ }
12601
+ else if (event.key === 'ArrowUp') {
12602
+ event.preventDefault();
12603
+ const prevIndex = currentIndex === 0 ? allVisible.length - 1 : currentIndex - 1;
12604
+ allVisible[prevIndex].focus();
12605
+ }
12606
+ else if (event.key === 'Enter' || event.key === ' ') {
12607
+ event.preventDefault();
12608
+ currentElement.click();
12609
+ }
12610
+ else if (event.key === 'ArrowRight') {
12611
+ event.preventDefault();
12612
+ if (currentElement instanceof SidebarSubMenu && !currentElement.expanded) {
12613
+ currentElement.expanded = true;
12614
+ }
12615
+ else if (currentElement instanceof SidebarSubMenu) {
12616
+ const children = this._getChildNodes(currentElement);
12617
+ if (children.length > 0) {
12618
+ children[0].focus();
12619
+ }
12620
+ }
12621
+ }
12622
+ else if (event.key === 'ArrowLeft') {
12623
+ event.preventDefault();
12624
+ if (currentElement instanceof SidebarSubMenu && currentElement.expanded) {
12625
+ currentElement.expanded = false;
12626
+ }
12121
12627
  }
12122
12628
  };
12123
12629
  }
12124
12630
  connectedCallback() {
12125
12631
  super.connectedCallback();
12126
- this.addEventListener('tree-node:click', this._onNodeClick);
12632
+ this.addEventListener('sidebar-menu-item:click', this._onItemClick);
12127
12633
  this.addEventListener('keydown', this._onKeyDown);
12128
12634
  this.setAttribute('role', 'tree');
12129
12635
  }
12130
12636
  updated(changedProps) {
12131
12637
  super.updated(changedProps);
12132
- if (changedProps.has('selectedNode')) {
12638
+ if (changedProps.has('selectedItem')) {
12133
12639
  this._syncSelectedStateFromProperty();
12134
12640
  }
12135
12641
  }
12136
12642
  disconnectedCallback() {
12137
12643
  super.disconnectedCallback();
12138
- this.removeEventListener('tree-node:click', this._onNodeClick);
12644
+ this.removeEventListener('sidebar-menu-item:click', this._onItemClick);
12139
12645
  this.removeEventListener('keydown', this._onKeyDown);
12140
12646
  }
12141
- _getTopLevelNodes() {
12142
- return Array.from(this.children).filter(el => el.tagName.toLowerCase() === 'wc-tree-node');
12647
+ _isSidebarNode(element) {
12648
+ const tag = element.tagName.toLowerCase();
12649
+ return tag === 'wc-sidebar-menu-item' || tag === 'wc-sidebar-sub-menu';
12650
+ }
12651
+ _getTopLevelItems() {
12652
+ return Array.from(this.children).filter(el => this._isSidebarNode(el));
12143
12653
  }
12144
- _getAllVisibleNodes() {
12654
+ _getChildNodes(item) {
12655
+ return Array.from(item.children).filter(child => this._isSidebarNode(child));
12656
+ }
12657
+ _getAllVisibleItems() {
12145
12658
  const result = [];
12146
- const collect = (nodes) => {
12147
- nodes.forEach(node => {
12148
- result.push(node);
12149
- if (node.expanded) {
12150
- const children = Array.from(node.children).filter(el => el.tagName.toLowerCase() === 'wc-tree-node');
12151
- collect(children);
12659
+ const collect = (items) => {
12660
+ items.forEach(item => {
12661
+ result.push(item);
12662
+ if (item instanceof SidebarSubMenu && item.expanded) {
12663
+ collect(this._getChildNodes(item));
12152
12664
  }
12153
12665
  });
12154
12666
  };
12155
- collect(this._getTopLevelNodes());
12667
+ collect(this._getTopLevelItems());
12156
12668
  return result;
12157
12669
  }
12158
12670
  _updateSelectedState(selectedValue) {
12159
- const allNodes = this._collectAllNodes(this._getTopLevelNodes());
12160
- allNodes.forEach(node => {
12161
- const nodeValue = node.value || node.label;
12671
+ const allItems = this._collectAllItems(this._getTopLevelItems());
12672
+ allItems.forEach(item => {
12673
+ const itemValue = item.value || item.label;
12162
12674
  // eslint-disable-next-line no-param-reassign
12163
- node.selected = nodeValue === selectedValue;
12675
+ item.selected = itemValue === selectedValue;
12164
12676
  });
12165
12677
  }
12166
- _clearSelectedState() {
12167
- const allNodes = this._collectAllNodes(this._getTopLevelNodes());
12168
- allNodes.forEach(node => {
12169
- // eslint-disable-next-line no-param-reassign
12170
- node.selected = false;
12678
+ _collectAllItems(items) {
12679
+ const result = [];
12680
+ items.forEach(item => {
12681
+ result.push(item);
12682
+ if (item instanceof SidebarSubMenu) {
12683
+ result.push(...this._collectAllItems(this._getChildNodes(item)));
12684
+ }
12171
12685
  });
12686
+ return result;
12172
12687
  }
12173
12688
  _syncSelectedStateFromProperty() {
12174
- if (this.selectedNode) {
12175
- this._updateSelectedState(this.selectedNode);
12176
- return;
12177
- }
12178
- this._clearSelectedState();
12179
- }
12180
- _collectAllNodes(nodes) {
12181
- const result = [];
12182
- nodes.forEach(node => {
12183
- result.push(node);
12184
- const children = Array.from(node.children).filter(el => el.tagName.toLowerCase() === 'wc-tree-node');
12185
- result.push(...this._collectAllNodes(children));
12689
+ const allItems = this._collectAllItems(this._getTopLevelItems());
12690
+ allItems.forEach(item => {
12691
+ const itemValue = item.value || item.label;
12692
+ item.selected = itemValue === this.selectedItem;
12186
12693
  });
12187
- return result;
12188
12694
  }
12189
12695
  render() {
12190
- return b `<div class="tree-view">
12191
- <slot @slotchange=${this._onSlotChange}></slot>
12192
- </div>`;
12696
+ return b ` <div class="sidebar-menu"><slot></slot></div> `;
12193
12697
  }
12194
12698
  }
12195
- TreeView.styles = [css_248z$3];
12196
- TreeView.Node = TreeNode;
12699
+ SidebarMenu.styles = [css_248z$5];
12197
12700
  __decorate([
12198
- n({ type: String, attribute: 'selected-node', reflect: true })
12199
- ], TreeView.prototype, "selectedNode", void 0);
12701
+ n({ type: String, attribute: 'selected-item', reflect: true })
12702
+ ], SidebarMenu.prototype, "selectedItem", void 0);
12200
12703
 
12201
- var css_248z$2 = i`* {
12704
+ var css_248z$4 = i`* {
12202
12705
  box-sizing: border-box;
12203
12706
  }
12204
12707
 
@@ -12469,15 +12972,15 @@ class Snackbar extends i$1 {
12469
12972
  size='small'
12470
12973
  aria-label="Dismiss notification"
12471
12974
  @click=${this.handleCloseClick}
12472
- name="close"
12473
12975
  >
12976
+ <wc-icon name="close"></wc-icon>
12474
12977
  </wc-icon-button>`
12475
12978
  : A}
12476
12979
  </div>
12477
12980
  `;
12478
12981
  }
12479
12982
  }
12480
- Snackbar.styles = [css_248z$2];
12983
+ Snackbar.styles = [css_248z$4];
12481
12984
  Snackbar.GLOBAL_OPEN_EVENT = 'wc-snackbar-will-open';
12482
12985
  Snackbar.EXIT_ANIMATION_MS = 180;
12483
12986
  __decorate([
@@ -12505,7 +13008,7 @@ __decorate([
12505
13008
  r()
12506
13009
  ], Snackbar.prototype, "dismissing", void 0);
12507
13010
 
12508
- var css_248z$1 = i`* {
13011
+ var css_248z$3 = i`* {
12509
13012
  box-sizing: border-box;
12510
13013
  }
12511
13014
 
@@ -12914,7 +13417,7 @@ class Radio extends i$1 {
12914
13417
  }
12915
13418
  Radio.DIRECTION_NEXT = 1;
12916
13419
  Radio.DIRECTION_PREVIOUS = -1;
12917
- Radio.styles = [css_248z$1];
13420
+ Radio.styles = [css_248z$3];
12918
13421
  __decorate([
12919
13422
  n({ type: String })
12920
13423
  ], Radio.prototype, "name", void 0);
@@ -12958,7 +13461,7 @@ __decorate([
12958
13461
  e$4('.input-native')
12959
13462
  ], Radio.prototype, "nativeElement", void 0);
12960
13463
 
12961
- var css_248z = i`@charset "UTF-8";
13464
+ var css_248z$2 = i`@charset "UTF-8";
12962
13465
  * {
12963
13466
  box-sizing: border-box;
12964
13467
  }
@@ -13514,184 +14017,805 @@ class Select extends BaseInput {
13514
14017
  composed: true,
13515
14018
  }));
13516
14019
  }
13517
- _handleSearchInput(event) {
13518
- this._searchQuery = event.target.value;
13519
- if (this.search === 'managed') {
13520
- this.dispatchEvent(new CustomEvent('select-search', {
13521
- detail: { value: this._searchQuery },
13522
- bubbles: true,
13523
- composed: true,
13524
- }));
13525
- }
14020
+ _handleSearchInput(event) {
14021
+ this._searchQuery = event.target.value;
14022
+ if (this.search === 'managed') {
14023
+ this.dispatchEvent(new CustomEvent('select-search', {
14024
+ detail: { value: this._searchQuery },
14025
+ bubbles: true,
14026
+ composed: true,
14027
+ }));
14028
+ }
14029
+ }
14030
+ _handleChipDismiss(event, chipValue) {
14031
+ event.stopPropagation();
14032
+ const values = this._selectedValues.filter(v => v !== chipValue);
14033
+ this.value = values.join(',');
14034
+ this._dispatchChange();
14035
+ }
14036
+ _renderEmptyState() {
14037
+ const hasSearchQuery = this._searchQuery.trim().length > 0;
14038
+ return b `
14039
+ <wc-empty-state
14040
+ class="select-empty-state content-center"
14041
+ illustration="no-document"
14042
+ headline=${hasSearchQuery ? 'No results found' : 'No options available'}
14043
+ description=${hasSearchQuery
14044
+ ? 'Try a different search term.'
14045
+ : 'There is nothing to select right now.'}
14046
+ ></wc-empty-state>
14047
+ `;
14048
+ }
14049
+ // ── Render helpers ─────────────────────────────────────────────────────────
14050
+ _renderTriggerContent() {
14051
+ // Typeahead: when open, show a text input for filtering
14052
+ if (this.search && this._open) {
14053
+ return b `<input
14054
+ class="search-input"
14055
+ .value=${this._searchQuery}
14056
+ placeholder=${this._displayLabel || this.placeholder}
14057
+ @input=${this._handleSearchInput}
14058
+ />`;
14059
+ }
14060
+ // Multi-select: show chips for selected items
14061
+ if (this.multiple && this._selectedValues.length > 0) {
14062
+ return b `<div class="chips-container">
14063
+ ${this._selectedValues.map(val => b `
14064
+ <wc-chip
14065
+ dismissible
14066
+ value=${val}
14067
+ @tag--dismiss=${(e) => this._handleChipDismiss(e, val)}
14068
+ >${this._getLabelForValue(val)}</wc-chip
14069
+ >
14070
+ `)}
14071
+ </div>`;
14072
+ }
14073
+ // Single select: show selected label or placeholder
14074
+ const label = this._displayLabel;
14075
+ if (!label) {
14076
+ return b `<span class="placeholder">${this.placeholder}</span>`;
14077
+ }
14078
+ return b `<span class="display-value">${label}</span>`;
14079
+ }
14080
+ _renderFieldEnd() {
14081
+ return b `
14082
+ <wc-icon
14083
+ class=${e$3({
14084
+ 'dropdown-icon': true,
14085
+ 'dropdown-icon--open': this._open,
14086
+ })}
14087
+ name="arrow_drop_down"
14088
+ ></wc-icon>
14089
+ `;
14090
+ }
14091
+ render() {
14092
+ return b `
14093
+ <wc-field
14094
+ label=${this.label}
14095
+ ?required=${this.required}
14096
+ ?disabled=${this.disabled}
14097
+ ?readonly=${this.readonly}
14098
+ ?skeleton=${this.skeleton}
14099
+ helper-text=${this.helperText}
14100
+ ?error=${this.error}
14101
+ error-text=${this.errorText}
14102
+ ?warning=${this.warning}
14103
+ warning-text=${this.warningText}
14104
+ variant=${this.variant}
14105
+ ?populated=${this._isPopulated || this._open}
14106
+ ?focused=${this._focused}
14107
+ .host=${this}
14108
+ class="select-field"
14109
+ @click=${this._handleFieldClick}
14110
+ >
14111
+ <div
14112
+ class="select-trigger"
14113
+ tabindex=${this.disabled ? -1 : 0}
14114
+ role="combobox"
14115
+ aria-label=${this.label || this.placeholder || 'Select option'}
14116
+ aria-controls=${this._menuId}
14117
+ aria-expanded=${String(this._open)}
14118
+ aria-haspopup="listbox"
14119
+ @click=${this._handleTriggerClick}
14120
+ @keydown=${this._handleTriggerKeyDown}
14121
+ >
14122
+ ${this._renderTriggerContent()}
14123
+ </div>
14124
+
14125
+ <div slot="field-end" class="field-end-wrapper">
14126
+ ${this._renderFieldEnd()}
14127
+ </div>
14128
+ </wc-field>
14129
+
14130
+ <wc-menu
14131
+ id=${this._menuId}
14132
+ placement="bottom-start"
14133
+ aria-label=${this.label || 'Options'}
14134
+ @closed=${this._handleMenuClosed}
14135
+ @menu-item-activate=${(e) => this._handleMenuItemActivate(e)}
14136
+ >
14137
+ <slot></slot>
14138
+ ${this._noOptionsVisible ? this._renderEmptyState() : A}
14139
+ </wc-menu>
14140
+ `;
14141
+ }
14142
+ }
14143
+ Select.styles = [css_248z$2];
14144
+ __decorate([
14145
+ n({ type: Array })
14146
+ ], Select.prototype, "options", void 0);
14147
+ __decorate([
14148
+ n({ type: String, reflect: true })
14149
+ ], Select.prototype, "value", void 0);
14150
+ __decorate([
14151
+ n({ type: Boolean, reflect: true })
14152
+ ], Select.prototype, "multiple", void 0);
14153
+ __decorate([
14154
+ n({ type: String })
14155
+ ], Select.prototype, "search", void 0);
14156
+ __decorate([
14157
+ n({ type: String })
14158
+ ], Select.prototype, "placeholder", void 0);
14159
+ __decorate([
14160
+ n({ type: String })
14161
+ ], Select.prototype, "label", void 0);
14162
+ __decorate([
14163
+ n({ type: String })
14164
+ ], Select.prototype, "variant", void 0);
14165
+ __decorate([
14166
+ n({ type: String, attribute: 'helper-text' })
14167
+ ], Select.prototype, "helperText", void 0);
14168
+ __decorate([
14169
+ n({ type: Boolean })
14170
+ ], Select.prototype, "error", void 0);
14171
+ __decorate([
14172
+ n({ type: String, attribute: 'error-text' })
14173
+ ], Select.prototype, "errorText", void 0);
14174
+ __decorate([
14175
+ n({ type: Boolean })
14176
+ ], Select.prototype, "warning", void 0);
14177
+ __decorate([
14178
+ n({ type: String, attribute: 'warning-text' })
14179
+ ], Select.prototype, "warningText", void 0);
14180
+ __decorate([
14181
+ r()
14182
+ ], Select.prototype, "_open", void 0);
14183
+ __decorate([
14184
+ r()
14185
+ ], Select.prototype, "_focused", void 0);
14186
+ __decorate([
14187
+ r()
14188
+ ], Select.prototype, "_searchQuery", void 0);
14189
+ __decorate([
14190
+ r()
14191
+ ], Select.prototype, "_noOptionsVisible", void 0);
14192
+ __decorate([
14193
+ e$4('.select-trigger')
14194
+ ], Select.prototype, "_triggerEl", void 0);
14195
+ __decorate([
14196
+ e$4('.search-input')
14197
+ ], Select.prototype, "_searchInputEl", void 0);
14198
+
14199
+ var css_248z$1 = i`* {
14200
+ box-sizing: border-box;
14201
+ }
14202
+
14203
+ .screen-reader-only {
14204
+ display: none !important;
14205
+ }
14206
+
14207
+ :host {
14208
+ display: block;
14209
+ height: 100%;
14210
+ width: var(--nav-rail-width, 5rem); /* 80dp */
14211
+ overflow: hidden;
14212
+ }
14213
+
14214
+ .rail {
14215
+ display: flex;
14216
+ flex-direction: column;
14217
+ align-items: center;
14218
+ height: 100%;
14219
+ width: 100%;
14220
+ border-radius: inherit;
14221
+ background-color: var(--nav-rail-container-color, var(--color-surface));
14222
+ padding-block: var(--nav-rail-padding-block, 0.75rem); /* 12dp */
14223
+ box-sizing: border-box;
14224
+ }
14225
+ .rail .header {
14226
+ display: flex;
14227
+ flex-direction: column;
14228
+ align-items: center;
14229
+ width: 100%;
14230
+ flex-shrink: 0;
14231
+ }
14232
+ .rail .header:empty {
14233
+ display: none;
14234
+ }
14235
+ .rail wc-divider {
14236
+ width: calc(100% - 1rem);
14237
+ margin-block: 0.5rem;
14238
+ flex-shrink: 0;
14239
+ }
14240
+ .rail .items {
14241
+ display: flex;
14242
+ flex-direction: column;
14243
+ align-items: center;
14244
+ width: 100%;
14245
+ gap: 0.75rem; /* 12dp between items */
14246
+ flex: 1;
14247
+ }
14248
+ .rail .items ::slotted(wc-navigation-rail-item) {
14249
+ width: 100%;
14250
+ }
14251
+ .rail {
14252
+ /* Alignment variants */
14253
+ }
14254
+ .rail.align-top .items {
14255
+ justify-content: flex-start;
14256
+ }
14257
+ .rail.align-center .items {
14258
+ justify-content: center;
14259
+ }
14260
+ .rail.align-bottom .items {
14261
+ justify-content: flex-end;
14262
+ }`;
14263
+
14264
+ var css_248z = i`* {
14265
+ box-sizing: border-box;
14266
+ }
14267
+
14268
+ .screen-reader-only {
14269
+ display: none !important;
14270
+ }
14271
+
14272
+ :host {
14273
+ display: block;
14274
+ }
14275
+
14276
+ /* Reset native button/link styles */
14277
+ .item-element {
14278
+ background: transparent;
14279
+ border: none;
14280
+ appearance: none;
14281
+ margin: 0;
14282
+ outline: none;
14283
+ text-decoration: none;
14284
+ text-align: unset;
14285
+ color: inherit;
14286
+ }
14287
+
14288
+ .item {
14289
+ position: relative;
14290
+ display: flex;
14291
+ flex-direction: column;
14292
+ align-items: center;
14293
+ justify-content: center;
14294
+ width: 100%;
14295
+ min-height: 3.5rem; /* 56dp */
14296
+ padding-block: 0.25rem; /* 4dp vertical padding */
14297
+ cursor: pointer;
14298
+ gap: 0.25rem; /* 4dp gap between indicator and label */
14299
+ box-sizing: border-box;
14300
+ /* Color tokens */
14301
+ --_inactive-icon-color: var(--nav-rail-inactive-icon-color, var(--color-on-surface-variant));
14302
+ --_active-icon-color: var(--nav-rail-active-icon-color, var(--color-on-secondary-container));
14303
+ --_inactive-label-color: var(--nav-rail-inactive-label-color, var(--color-on-surface-variant));
14304
+ --_active-label-color: var(--nav-rail-active-label-color, var(--color-on-surface));
14305
+ --_indicator-color: var(--nav-rail-indicator-color, var(--color-secondary-container));
14306
+ --_indicator-shape: var(--nav-rail-indicator-shape, var(--shape-corner-full));
14307
+ --_indicator-width: var(--nav-rail-indicator-width, 3.5rem); /* 56dp */
14308
+ --_indicator-height: var(--nav-rail-indicator-height, 2rem); /* 32dp */
14309
+ --_state-color: var(--_inactive-icon-color);
14310
+ /* Focus ring */
14311
+ }
14312
+ .item .focus-ring {
14313
+ z-index: 3;
14314
+ --focus-ring-container-shape-start-start: var(--shape-corner-small);
14315
+ --focus-ring-container-shape-start-end: var(--shape-corner-small);
14316
+ --focus-ring-container-shape-end-start: var(--shape-corner-small);
14317
+ --focus-ring-container-shape-end-end: var(--shape-corner-small);
14318
+ }
14319
+ .item {
14320
+ /* Active indicator (pill behind icon) */
14321
+ }
14322
+ .item .indicator {
14323
+ position: relative;
14324
+ display: flex;
14325
+ align-items: center;
14326
+ justify-content: center;
14327
+ width: var(--_indicator-width);
14328
+ height: var(--_indicator-height);
14329
+ border-radius: var(--_indicator-shape);
14330
+ overflow: hidden;
14331
+ flex-shrink: 0;
14332
+ transition: background-color var(--duration-short4, 200ms) var(--easing-standard, ease);
14333
+ }
14334
+ .item .indicator .icon-container {
14335
+ display: flex;
14336
+ align-items: center;
14337
+ justify-content: center;
14338
+ z-index: 1;
14339
+ position: relative;
14340
+ pointer-events: none;
14341
+ }
14342
+ .item .indicator .icon-container ::slotted(*) {
14343
+ --icon-size: 1.5rem; /* 24dp */
14344
+ --icon-color: var(--_inactive-icon-color);
14345
+ color: var(--_inactive-icon-color);
14346
+ display: flex;
14347
+ }
14348
+ .item {
14349
+ /* State layer for hover/press */
14350
+ }
14351
+ .item .state-layer {
14352
+ position: absolute;
14353
+ top: 0.25rem;
14354
+ left: 50%;
14355
+ transform: translateX(-50%);
14356
+ width: var(--_indicator-width);
14357
+ height: var(--_indicator-height);
14358
+ pointer-events: none;
14359
+ background-color: var(--_state-color);
14360
+ opacity: 0;
14361
+ z-index: 0;
14362
+ border-radius: var(--_indicator-shape);
14363
+ transition: opacity var(--duration-short4, 200ms) var(--easing-standard, ease);
14364
+ }
14365
+ .item .ripple {
14366
+ z-index: 1;
14367
+ --ripple-pressed-color: var(--_state-color);
14368
+ --ripple-state-opacity: 0;
14369
+ border-radius: var(--shape-corner-small, 4px);
14370
+ }
14371
+ .item {
14372
+ /* Label */
14373
+ }
14374
+ .item .label {
14375
+ font-family: var(--typography-label-medium-font-family) !important;
14376
+ font-size: var(--typography-label-medium-font-size) !important;
14377
+ font-weight: var(--typography-label-medium-font-weight) !important;
14378
+ line-height: var(--typography-label-medium-line-height) !important;
14379
+ letter-spacing: var(--typography-label-medium-letter-spacing) !important;
14380
+ color: var(--_inactive-label-color);
14381
+ text-align: center;
14382
+ pointer-events: none;
14383
+ z-index: 1;
14384
+ transition: color var(--duration-short4, 200ms) var(--easing-standard, ease), font-weight var(--duration-short4, 200ms) var(--easing-standard, ease);
14385
+ }
14386
+ .item {
14387
+ /* Active icon slot: hidden by default */
14388
+ }
14389
+ .item .active-icon-slot {
14390
+ display: none;
14391
+ }
14392
+ .item .hidden-slot {
14393
+ display: none;
14394
+ }
14395
+ .item {
14396
+ /* Item content layout */
14397
+ }
14398
+ .item .item-content {
14399
+ display: flex;
14400
+ flex-direction: column;
14401
+ align-items: center;
14402
+ gap: 0.25rem;
14403
+ width: 100%;
14404
+ z-index: 1;
14405
+ }
14406
+ .item {
14407
+ /* Active state */
14408
+ }
14409
+ .item.active {
14410
+ --_state-color: var(--_active-icon-color);
14411
+ }
14412
+ .item.active .indicator {
14413
+ background-color: var(--_indicator-color);
14414
+ }
14415
+ .item.active .indicator .icon-container ::slotted(*) {
14416
+ --icon-color: var(--_active-icon-color);
14417
+ color: var(--_active-icon-color);
14418
+ }
14419
+ .item.active .label {
14420
+ color: var(--_active-label-color);
14421
+ font-weight: var(--typography-label-medium-font-weight-bold, 700);
14422
+ }
14423
+ .item {
14424
+ /* Active icon slot: show when active and slot has content */
14425
+ }
14426
+ .item.active.has-active-icon .active-icon-slot {
14427
+ display: flex;
14428
+ }
14429
+ .item.active.has-active-icon .icon-slot {
14430
+ display: none;
14431
+ }
14432
+ .item {
14433
+ /* Hover state */
14434
+ }
14435
+ .item:hover:not(.disabled) .state-layer {
14436
+ opacity: 0.08;
14437
+ }
14438
+ .item {
14439
+ /* Pressed state */
14440
+ }
14441
+ .item.pressed:not(.disabled) .state-layer {
14442
+ opacity: 0.12;
14443
+ }
14444
+ .item {
14445
+ /* Disabled state */
14446
+ }
14447
+ .item.disabled {
14448
+ cursor: not-allowed;
14449
+ }
14450
+ .item.disabled .indicator .icon-container ::slotted(*) {
14451
+ --icon-color: var(--color-on-surface);
14452
+ color: var(--color-on-surface);
14453
+ opacity: 0.38;
14454
+ }
14455
+ .item.disabled .label {
14456
+ color: var(--color-on-surface);
14457
+ opacity: 0.38;
14458
+ }
14459
+ .item.disabled .ripple {
14460
+ display: none;
14461
+ }
14462
+
14463
+ @media (prefers-reduced-motion: reduce) {
14464
+ .item .indicator,
14465
+ .item .state-layer,
14466
+ .item .label {
14467
+ transition: none;
14468
+ }
14469
+ }`;
14470
+
14471
+ var _NavigationRailItem_id;
14472
+ /**
14473
+ * @label Navigation Rail Item
14474
+ * @tag wc-navigation-rail-item
14475
+ * @rawTag navigation-rail-item
14476
+ * @parentRawTag navigation-rail
14477
+ *
14478
+ * @summary An individual item within a navigation rail.
14479
+ * @overview
14480
+ * <p>Navigation rail items display a destination with an icon and optional label.</p>
14481
+ *
14482
+ * @example
14483
+ * ```html
14484
+ * <wc-navigation-rail-item>
14485
+ * <wc-icon slot="icon">home</wc-icon>
14486
+ * Home
14487
+ * </wc-navigation-rail-item>
14488
+ * ```
14489
+ * @tags navigation
14490
+ */
14491
+ class NavigationRailItem extends i$1 {
14492
+ constructor() {
14493
+ super(...arguments);
14494
+ _NavigationRailItem_id.set(this, crypto.randomUUID());
14495
+ /** Whether this item is currently active/selected. */
14496
+ this.active = false;
14497
+ /** Whether this item is disabled. */
14498
+ this.disabled = false;
14499
+ /** Whether the parent rail is in collapsed mode (labels hidden). */
14500
+ this.collapsed = false;
14501
+ /** Link target. */
14502
+ this.target = '_self';
14503
+ /** Reason the item is disabled (shown to screen readers). */
14504
+ this.disabledReason = '';
14505
+ /** Sets the delay for throttle in milliseconds. Defaults to 200 milliseconds. */
14506
+ this.throttleDelay = 200;
14507
+ this._isPressed = false;
14508
+ this._hasLabel = false;
14509
+ this._hasActiveIcon = false;
14510
+ this.__dispatchClickWithThrottle = event => {
14511
+ this.__dispatchClick(event);
14512
+ };
14513
+ this.__dispatchClick = (event) => {
14514
+ if (this.disabled && this.href) {
14515
+ event.stopImmediatePropagation();
14516
+ event.preventDefault();
14517
+ return;
14518
+ }
14519
+ if (!isActivationClick(event) || !this.itemElement) {
14520
+ return;
14521
+ }
14522
+ this.focus();
14523
+ dispatchActivationClick(this.itemElement);
14524
+ };
14525
+ this.__handlePress = (event) => {
14526
+ if (this.disabled)
14527
+ return;
14528
+ if (event instanceof KeyboardEvent &&
14529
+ event.type === 'keydown' &&
14530
+ (event.key === 'Enter' || event.key === ' ')) {
14531
+ this._isPressed = true;
14532
+ }
14533
+ else if (event.type === 'mousedown') {
14534
+ this._isPressed = true;
14535
+ }
14536
+ else {
14537
+ this._isPressed = false;
14538
+ }
14539
+ };
14540
+ }
14541
+ focus() {
14542
+ this.itemElement?.focus();
14543
+ }
14544
+ blur() {
14545
+ this.itemElement?.blur();
14546
+ }
14547
+ firstUpdated() {
14548
+ this.__dispatchClickWithThrottle = throttle(this.__dispatchClick, this.throttleDelay);
14549
+ observerSlotChangesWithCallback(this.renderRoot.querySelector('slot:not([name])'), hasContent => {
14550
+ this._hasLabel = hasContent;
14551
+ this.requestUpdate();
14552
+ });
14553
+ observerSlotChangesWithCallback(this.renderRoot.querySelector('slot[name="active-icon"]'), hasContent => {
14554
+ this._hasActiveIcon = hasContent;
14555
+ this.requestUpdate();
14556
+ });
13526
14557
  }
13527
- _handleChipDismiss(event, chipValue) {
13528
- event.stopPropagation();
13529
- const values = this._selectedValues.filter(v => v !== chipValue);
13530
- this.value = values.join(',');
13531
- this._dispatchChange();
14558
+ __isLink() {
14559
+ return !!this.href;
13532
14560
  }
13533
- _renderEmptyState() {
13534
- const hasSearchQuery = this._searchQuery.trim().length > 0;
13535
- return b `
13536
- <wc-empty-state
13537
- class="select-empty-state content-center"
13538
- illustration="no-document"
13539
- headline=${hasSearchQuery ? 'No results found' : 'No options available'}
13540
- description=${hasSearchQuery
13541
- ? 'Try a different search term.'
13542
- : 'There is nothing to select right now.'}
13543
- ></wc-empty-state>
13544
- `;
14561
+ __getDisabledReasonID() {
14562
+ return this.disabled && this.disabledReason
14563
+ ? `disabled-reason-${__classPrivateFieldGet(this, _NavigationRailItem_id, "f")}`
14564
+ : A;
13545
14565
  }
13546
- // ── Render helpers ─────────────────────────────────────────────────────────
13547
- _renderTriggerContent() {
13548
- // Typeahead: when open, show a text input for filtering
13549
- if (this.search && this._open) {
13550
- return b `<input
13551
- class="search-input"
13552
- .value=${this._searchQuery}
13553
- placeholder=${this._displayLabel || this.placeholder}
13554
- @input=${this._handleSearchInput}
13555
- />`;
13556
- }
13557
- // Multi-select: show chips for selected items
13558
- if (this.multiple && this._selectedValues.length > 0) {
13559
- return b `<div class="chips-container">
13560
- ${this._selectedValues.map(val => b `
13561
- <wc-chip
13562
- dismissible
13563
- value=${val}
13564
- @tag--dismiss=${(e) => this._handleChipDismiss(e, val)}
13565
- >${this._getLabelForValue(val)}</wc-chip
13566
- >
13567
- `)}
14566
+ __renderDisabledReason() {
14567
+ const disabledReasonID = this.__getDisabledReasonID();
14568
+ if (disabledReasonID)
14569
+ return b `<div
14570
+ id="disabled-reason-${__classPrivateFieldGet(this, _NavigationRailItem_id, "f")}"
14571
+ role="tooltip"
14572
+ aria-label=${this.disabledReason}
14573
+ class="screen-reader-only"
14574
+ >
14575
+ ${this.disabledReason}
13568
14576
  </div>`;
13569
- }
13570
- // Single select: show selected label or placeholder
13571
- const label = this._displayLabel;
13572
- if (!label) {
13573
- return b `<span class="placeholder">${this.placeholder}</span>`;
13574
- }
13575
- return b `<span class="display-value">${label}</span>`;
14577
+ return A;
13576
14578
  }
13577
- _renderFieldEnd() {
14579
+ __renderItemContent() {
13578
14580
  return b `
13579
- <wc-icon
13580
- class=${e$3({
13581
- 'dropdown-icon': true,
13582
- 'dropdown-icon--open': this._open,
13583
- })}
13584
- name="arrow_drop_down"
13585
- ></wc-icon>
14581
+ <wc-focus-ring class="focus-ring" for='item'></wc-focus-ring>
14582
+ <div class="state-layer"></div>
14583
+ <wc-ripple class="ripple"></wc-ripple>
14584
+
14585
+ <div class="item-content">
14586
+ <div class="indicator">
14587
+ <div class="icon-container">
14588
+ <slot name="active-icon" class="active-icon-slot"></slot>
14589
+ <slot name="icon" class="icon-slot"></slot>
14590
+ </div>
14591
+ </div>
14592
+ ${this._hasLabel && !this.collapsed
14593
+ ? b `<div class="label"><slot></slot></div>`
14594
+ : b `<slot class="hidden-slot"></slot>`}
14595
+ </div>
14596
+
14597
+ ${this.__renderDisabledReason()}
13586
14598
  `;
13587
14599
  }
13588
14600
  render() {
13589
- return b `
13590
- <wc-field
13591
- label=${this.label}
13592
- ?required=${this.required}
14601
+ const isLink = this.__isLink();
14602
+ const cssClasses = {
14603
+ item: true,
14604
+ 'item-element': true,
14605
+ active: this.active,
14606
+ disabled: this.disabled,
14607
+ pressed: this._isPressed,
14608
+ 'has-label': this._hasLabel,
14609
+ 'has-active-icon': this._hasActiveIcon,
14610
+ };
14611
+ if (!isLink) {
14612
+ return b `<button
14613
+ id="item"
14614
+ class=${e$3(cssClasses)}
13593
14615
  ?disabled=${this.disabled}
13594
- ?readonly=${this.readonly}
13595
- ?skeleton=${this.skeleton}
13596
- helper-text=${this.helperText}
13597
- ?error=${this.error}
13598
- error-text=${this.errorText}
13599
- ?warning=${this.warning}
13600
- warning-text=${this.warningText}
13601
- variant=${this.variant}
13602
- ?populated=${this._isPopulated || this._open}
13603
- ?focused=${this._focused}
13604
- .host=${this}
13605
- class="select-field"
13606
- @click=${this._handleFieldClick}
13607
- >
13608
- <div
13609
- class="select-trigger"
13610
- tabindex=${this.disabled ? -1 : 0}
13611
- role="combobox"
13612
- aria-label=${this.label || this.placeholder || 'Select option'}
13613
- aria-controls=${this._menuId}
13614
- aria-expanded=${String(this._open)}
13615
- aria-haspopup="listbox"
13616
- @click=${this._handleTriggerClick}
13617
- @keydown=${this._handleTriggerKeyDown}
13618
- >
13619
- ${this._renderTriggerContent()}
13620
- </div>
13621
-
13622
- <div slot="field-end" class="field-end-wrapper">
13623
- ${this._renderFieldEnd()}
13624
- </div>
13625
- </wc-field>
13626
-
13627
- <wc-menu
13628
- id=${this._menuId}
13629
- placement="bottom-start"
13630
- aria-label=${this.label || 'Options'}
13631
- @closed=${this._handleMenuClosed}
13632
- @menu-item-activate=${(e) => this._handleMenuItemActivate(e)}
14616
+ aria-disabled=${`${this.disabled}`}
14617
+ aria-current=${this.active ? 'page' : A}
14618
+ ?aria-describedby=${this.__getDisabledReasonID()}
14619
+ @click=${this.__dispatchClickWithThrottle}
14620
+ @mousedown=${this.__handlePress}
14621
+ @keydown=${this.__handlePress}
14622
+ @keyup=${this.__handlePress}
13633
14623
  >
13634
- <slot></slot>
13635
- ${this._noOptionsVisible ? this._renderEmptyState() : A}
13636
- </wc-menu>
13637
- `;
14624
+ ${this.__renderItemContent()}
14625
+ </button>`;
14626
+ }
14627
+ return b `<a
14628
+ id="item"
14629
+ class=${e$3(cssClasses)}
14630
+ href=${this.href}
14631
+ target=${this.target}
14632
+ aria-current=${this.active ? 'page' : A}
14633
+ aria-disabled=${`${this.disabled}`}
14634
+ ?aria-describedby=${this.__getDisabledReasonID()}
14635
+ @click=${this.__dispatchClickWithThrottle}
14636
+ @mousedown=${this.__handlePress}
14637
+ @keydown=${this.__handlePress}
14638
+ @keyup=${this.__handlePress}
14639
+ >
14640
+ ${this.__renderItemContent()}
14641
+ </a>`;
13638
14642
  }
13639
14643
  }
13640
- Select.styles = [css_248z];
13641
- __decorate([
13642
- n({ type: Array })
13643
- ], Select.prototype, "options", void 0);
13644
- __decorate([
13645
- n({ type: String, reflect: true })
13646
- ], Select.prototype, "value", void 0);
14644
+ _NavigationRailItem_id = new WeakMap();
14645
+ NavigationRailItem.styles = [css_248z];
13647
14646
  __decorate([
13648
14647
  n({ type: Boolean, reflect: true })
13649
- ], Select.prototype, "multiple", void 0);
13650
- __decorate([
13651
- n({ type: String })
13652
- ], Select.prototype, "search", void 0);
13653
- __decorate([
13654
- n({ type: String })
13655
- ], Select.prototype, "placeholder", void 0);
14648
+ ], NavigationRailItem.prototype, "active", void 0);
13656
14649
  __decorate([
13657
- n({ type: String })
13658
- ], Select.prototype, "label", void 0);
14650
+ n({ type: Boolean, reflect: true })
14651
+ ], NavigationRailItem.prototype, "disabled", void 0);
13659
14652
  __decorate([
13660
- n({ type: String })
13661
- ], Select.prototype, "variant", void 0);
14653
+ n({ type: Boolean, reflect: true })
14654
+ ], NavigationRailItem.prototype, "collapsed", void 0);
13662
14655
  __decorate([
13663
- n({ type: String, attribute: 'helper-text' })
13664
- ], Select.prototype, "helperText", void 0);
14656
+ n({ reflect: true })
14657
+ ], NavigationRailItem.prototype, "href", void 0);
13665
14658
  __decorate([
13666
- n({ type: Boolean })
13667
- ], Select.prototype, "error", void 0);
14659
+ n()
14660
+ ], NavigationRailItem.prototype, "target", void 0);
13668
14661
  __decorate([
13669
- n({ type: String, attribute: 'error-text' })
13670
- ], Select.prototype, "errorText", void 0);
14662
+ n({ reflect: true })
14663
+ ], NavigationRailItem.prototype, "value", void 0);
13671
14664
  __decorate([
13672
- n({ type: Boolean })
13673
- ], Select.prototype, "warning", void 0);
14665
+ n({ attribute: 'disabled-reason' })
14666
+ ], NavigationRailItem.prototype, "disabledReason", void 0);
13674
14667
  __decorate([
13675
- n({ type: String, attribute: 'warning-text' })
13676
- ], Select.prototype, "warningText", void 0);
14668
+ n({ type: Number })
14669
+ ], NavigationRailItem.prototype, "throttleDelay", void 0);
13677
14670
  __decorate([
13678
14671
  r()
13679
- ], Select.prototype, "_open", void 0);
14672
+ ], NavigationRailItem.prototype, "_isPressed", void 0);
13680
14673
  __decorate([
13681
14674
  r()
13682
- ], Select.prototype, "_focused", void 0);
14675
+ ], NavigationRailItem.prototype, "_hasLabel", void 0);
13683
14676
  __decorate([
13684
14677
  r()
13685
- ], Select.prototype, "_searchQuery", void 0);
14678
+ ], NavigationRailItem.prototype, "_hasActiveIcon", void 0);
13686
14679
  __decorate([
13687
- r()
13688
- ], Select.prototype, "_noOptionsVisible", void 0);
14680
+ e$4('.item-element')
14681
+ ], NavigationRailItem.prototype, "itemElement", void 0);
14682
+
14683
+ /**
14684
+ * @label Navigation Rail
14685
+ * @tag wc-navigation-rail
14686
+ * @rawTag navigation-rail
14687
+ *
14688
+ * @summary A vertical side navigation for medium-sized screens, following Material Design 3 specs.
14689
+ * @overview
14690
+ * <p>Navigation rail provides access to primary destinations in an app using icons—with or without labels—on a vertical rail.</p>
14691
+ * <p>Use navigation rail on medium-sized screens (tablets) with 3–7 destinations.</p>
14692
+ *
14693
+ * @cssprop --nav-rail-width - Width of the rail container. Defaults to 5rem (80dp).
14694
+ * @cssprop --nav-rail-container-color - Background color of the rail. Defaults to surface color.
14695
+ * @cssprop --nav-rail-indicator-color - Color of the active indicator. Defaults to secondary-container.
14696
+ * @cssprop --nav-rail-indicator-shape - Shape (border-radius) of the active indicator. Defaults to full (pill).
14697
+ * @cssprop --nav-rail-indicator-width - Width of the active indicator. Defaults to 3.5rem (56dp).
14698
+ * @cssprop --nav-rail-indicator-height - Height of the active indicator. Defaults to 2rem (32dp).
14699
+ * @cssprop --nav-rail-inactive-icon-color - Color of inactive icons. Defaults to on-surface-variant.
14700
+ * @cssprop --nav-rail-active-icon-color - Color of active icons. Defaults to on-secondary-container.
14701
+ * @cssprop --nav-rail-inactive-label-color - Color of inactive labels. Defaults to on-surface-variant.
14702
+ * @cssprop --nav-rail-active-label-color - Color of active labels. Defaults to on-surface.
14703
+ *
14704
+ * @example
14705
+ * ```html
14706
+ * <wc-navigation-rail>
14707
+ * <wc-navigation-rail-item active>
14708
+ * <wc-icon slot="icon">home</wc-icon>
14709
+ * Home
14710
+ * </wc-navigation-rail-item>
14711
+ * <wc-navigation-rail-item>
14712
+ * <wc-icon slot="icon">search</wc-icon>
14713
+ * Search
14714
+ * </wc-navigation-rail-item>
14715
+ * <wc-navigation-rail-item>
14716
+ * <wc-icon slot="icon">settings</wc-icon>
14717
+ * Settings
14718
+ * </wc-navigation-rail-item>
14719
+ * </wc-navigation-rail>
14720
+ * ```
14721
+ * @tags navigation
14722
+ */
14723
+ class NavigationRail extends i$1 {
14724
+ constructor() {
14725
+ super(...arguments);
14726
+ /**
14727
+ * Vertical alignment of items within the rail.
14728
+ * - `"top"`: Items align to the top.
14729
+ * - `"center"`: Items are centered (default).
14730
+ * - `"bottom"`: Items align to the bottom.
14731
+ */
14732
+ this.alignment = 'center';
14733
+ /**
14734
+ * Display mode of the navigation rail.
14735
+ * - `"expanded"`: shows labels.
14736
+ * - `"collapsed"`: hides labels.
14737
+ */
14738
+ this.mode = 'expanded';
14739
+ /**
14740
+ * Whether to show a divider between the header and items sections.
14741
+ */
14742
+ this.showDivider = false;
14743
+ this._handleItemClick = (event) => {
14744
+ const target = event.target;
14745
+ const item = target.closest('wc-navigation-rail-item');
14746
+ if (!item || item.disabled)
14747
+ return;
14748
+ // Deactivate all items and activate the clicked one
14749
+ for (const railItem of this._getItems()) {
14750
+ railItem.active = railItem === item;
14751
+ }
14752
+ this.dispatchEvent(new CustomEvent('nav-change', {
14753
+ detail: {
14754
+ value: item.value,
14755
+ item,
14756
+ },
14757
+ bubbles: true,
14758
+ composed: true,
14759
+ }));
14760
+ };
14761
+ this._syncItemMode = () => {
14762
+ const isCollapsed = this.mode === 'collapsed';
14763
+ for (const railItem of this._getItems()) {
14764
+ railItem.collapsed = isCollapsed;
14765
+ }
14766
+ };
14767
+ }
14768
+ connectedCallback() {
14769
+ super.connectedCallback();
14770
+ this.addEventListener('click', this._handleItemClick);
14771
+ this.setAttribute('role', 'navigation');
14772
+ this.setAttribute('aria-label', this.getAttribute('aria-label') ?? 'Main navigation');
14773
+ }
14774
+ disconnectedCallback() {
14775
+ this.removeEventListener('click', this._handleItemClick);
14776
+ super.disconnectedCallback();
14777
+ }
14778
+ firstUpdated() {
14779
+ this._syncItemMode();
14780
+ }
14781
+ updated(changedProperties) {
14782
+ if (changedProperties.has('mode')) {
14783
+ this._syncItemMode();
14784
+ }
14785
+ }
14786
+ _getItems() {
14787
+ return Array.from(this.querySelectorAll('wc-navigation-rail-item'));
14788
+ }
14789
+ render() {
14790
+ const cssClasses = {
14791
+ rail: true,
14792
+ [`align-${this.alignment}`]: true,
14793
+ [`mode-${this.mode}`]: true,
14794
+ };
14795
+ return b `
14796
+ <div class=${e$3(cssClasses)}>
14797
+ <div class="header">
14798
+ <slot name="header"></slot>
14799
+ </div>
14800
+ ${this.showDivider ? b `<wc-divider></wc-divider>` : ''}
14801
+ <nav class="items" role="presentation">
14802
+ <slot @slotchange=${this._syncItemMode}></slot>
14803
+ </nav>
14804
+ </div>
14805
+ `;
14806
+ }
14807
+ }
14808
+ NavigationRail.styles = [css_248z$1];
14809
+ NavigationRail.Item = NavigationRailItem;
13689
14810
  __decorate([
13690
- e$4('.select-trigger')
13691
- ], Select.prototype, "_triggerEl", void 0);
14811
+ n({ reflect: true })
14812
+ ], NavigationRail.prototype, "alignment", void 0);
13692
14813
  __decorate([
13693
- e$4('.search-input')
13694
- ], Select.prototype, "_searchInputEl", void 0);
14814
+ n({ reflect: true })
14815
+ ], NavigationRail.prototype, "mode", void 0);
14816
+ __decorate([
14817
+ n({ type: Boolean, attribute: 'show-divider' })
14818
+ ], NavigationRail.prototype, "showDivider", void 0);
13695
14819
 
13696
- export { Accordion as A, Badge as B, Checkbox as C, DatePicker as D, Elevation as E, Field as F, Tabs as G, Tag as H, Icon as I, Textarea as J, TimePicker as K, LinearProgress as L, Menu as M, NumberField as N, Tooltip as O, Pagination as P, TreeNode as Q, Radio as R, SegmentedButton as S, Tab as T, TreeView as U, 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, SegmentedButtonGroup as o, Select as p, SelectOptionElement as q, Skeleton as r, Slider as s, Snackbar as t, Spinner as u, SubMenu as v, Switch as w, TabGroup as x, TabPanel as y, Table as z };
13697
- //# sourceMappingURL=select-4pl4XBj7.js.map
14820
+ export { Accordion as A, Badge as B, Checkbox as C, DatePicker as D, Elevation as E, Field as F, SubMenu as G, Switch as H, Icon as I, TabGroup as J, TabPanel as K, LinearProgress as L, Menu as M, NavigationRail as N, Table as O, Pagination as P, Tabs as Q, Radio as R, SegmentedButton as S, Tab as T, Tag as U, Textarea as V, TimePicker as W, Tooltip as X, UrlField as Y, 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, NavigationRailItem as n, NumberField as o, Ripple as p, SegmentedButtonGroup as q, Select as r, SelectOptionElement as s, SidebarMenu as t, SidebarMenuItem as u, SidebarSubMenu as v, Skeleton as w, Slider as x, Snackbar as y, Spinner as z };
14821
+ //# sourceMappingURL=navigation-rail-Lxetd5-Z.js.map