@redvars/peacock 3.3.3 → 3.5.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (280) hide show
  1. package/dist/IndividualComponent-DUINtMGK.js +67 -0
  2. package/dist/IndividualComponent-DUINtMGK.js.map +1 -0
  3. package/dist/assets/images/empty-state/no-document.svg +11 -12
  4. package/dist/assets/images/empty-state/page.svg +15 -9
  5. package/dist/assets/styles.css +1 -1
  6. package/dist/assets/styles.css.map +1 -1
  7. package/dist/banner.js +202 -0
  8. package/dist/banner.js.map +1 -0
  9. package/dist/bottom-sheet.js +238 -0
  10. package/dist/bottom-sheet.js.map +1 -0
  11. package/dist/{button-ClzS8JLq.js → button-DMN1dPAg.js} +358 -218
  12. package/dist/button-DMN1dPAg.js.map +1 -0
  13. package/dist/button-group-CX9CUUXk.js +435 -0
  14. package/dist/button-group-CX9CUUXk.js.map +1 -0
  15. package/dist/button-group.js +11 -6
  16. package/dist/button-group.js.map +1 -1
  17. package/dist/button.js +10 -5
  18. package/dist/button.js.map +1 -1
  19. package/dist/card-content.js +29 -0
  20. package/dist/card-content.js.map +1 -0
  21. package/dist/card.js +428 -44
  22. package/dist/card.js.map +1 -1
  23. package/dist/{chart-bar-DbnXQgvS.js → chart-bar-cn6rrna-.js} +2 -2
  24. package/dist/{chart-bar-DbnXQgvS.js.map → chart-bar-cn6rrna-.js.map} +1 -1
  25. package/dist/chart-bar.js +5 -4
  26. package/dist/chart-bar.js.map +1 -1
  27. package/dist/chart-doughnut.js +2 -1
  28. package/dist/chart-doughnut.js.map +1 -1
  29. package/dist/chart-pie.js +2 -1
  30. package/dist/chart-pie.js.map +1 -1
  31. package/dist/chart-stacked-bar.js +5 -4
  32. package/dist/chart-stacked-bar.js.map +1 -1
  33. package/dist/{class-map-59YGWLnx.js → class-map-YU7g0o3B.js} +4 -10
  34. package/dist/class-map-YU7g0o3B.js.map +1 -0
  35. package/dist/clock.js +2 -1
  36. package/dist/clock.js.map +1 -1
  37. package/dist/code-editor.js +8 -6
  38. package/dist/code-editor.js.map +1 -1
  39. package/dist/code-highlighter.js +6 -4
  40. package/dist/code-highlighter.js.map +1 -1
  41. package/dist/custom-elements-jsdocs.json +6270 -5026
  42. package/dist/custom-elements.json +5763 -2049
  43. package/dist/directive-ZPhl09Yt.js +9 -0
  44. package/dist/directive-ZPhl09Yt.js.map +1 -0
  45. package/dist/dispatch-event-utils-CuEqjlPT.js +127 -0
  46. package/dist/dispatch-event-utils-CuEqjlPT.js.map +1 -0
  47. package/dist/fab-C5Nzxk0E.js +497 -0
  48. package/dist/fab-C5Nzxk0E.js.map +1 -0
  49. package/dist/fab.js +11 -0
  50. package/dist/fab.js.map +1 -0
  51. package/dist/index.js +24 -12
  52. package/dist/index.js.map +1 -1
  53. package/dist/{observe-theme-change-pALI5fmV.js → is-dark-mode-DicqGkCJ.js} +8 -3
  54. package/dist/is-dark-mode-DicqGkCJ.js.map +1 -0
  55. package/dist/notification.js +417 -0
  56. package/dist/notification.js.map +1 -0
  57. package/dist/number-counter.js +4 -3
  58. package/dist/number-counter.js.map +1 -1
  59. package/dist/observe-slot-change-BGJfgg2E.js +31 -0
  60. package/dist/observe-slot-change-BGJfgg2E.js.map +1 -0
  61. package/dist/peacock-loader.js +59 -10
  62. package/dist/peacock-loader.js.map +1 -1
  63. package/dist/property-1psGvXOq.js +10 -0
  64. package/dist/property-1psGvXOq.js.map +1 -0
  65. package/dist/search.js +452 -0
  66. package/dist/search.js.map +1 -0
  67. package/dist/{radio-b70_Ie9n.js → select-4pl4XBj7.js} +2439 -521
  68. package/dist/select-4pl4XBj7.js.map +1 -0
  69. package/dist/side-sheet.js +186 -0
  70. package/dist/side-sheet.js.map +1 -0
  71. package/dist/spread-B5cgadZl.js +32 -0
  72. package/dist/spread-B5cgadZl.js.map +1 -0
  73. package/dist/src/__base_element/BaseHyperlink.d.ts +20 -0
  74. package/dist/src/__utils/cache-fetch.d.ts +1 -0
  75. package/dist/src/__utils/is-dark-mode.d.ts +1 -0
  76. package/dist/src/__utils/is-in-viewport.d.ts +1 -0
  77. package/dist/src/__utils/observe-slot-change.d.ts +1 -0
  78. package/dist/src/__utils/sanitize-svg.d.ts +1 -0
  79. package/dist/src/__utils/throttle.d.ts +4 -0
  80. package/dist/src/accordion/accordion-item.d.ts +33 -9
  81. package/dist/src/accordion/accordion.d.ts +21 -5
  82. package/dist/src/banner/banner.d.ts +47 -0
  83. package/dist/src/banner/index.d.ts +1 -0
  84. package/dist/src/bottom-sheet/bottom-sheet.d.ts +42 -0
  85. package/dist/src/bottom-sheet/index.d.ts +1 -0
  86. package/dist/src/button/BaseButton.d.ts +7 -13
  87. package/dist/src/button/button/button.d.ts +4 -0
  88. package/dist/src/button/button-group/button-group.d.ts +32 -3
  89. package/dist/src/button/icon-button/icon-button.d.ts +4 -0
  90. package/dist/src/card/card-content.d.ts +15 -0
  91. package/dist/src/card/card.d.ts +37 -3
  92. package/dist/src/card/index.d.ts +1 -0
  93. package/dist/src/container/container.d.ts +1 -1
  94. package/dist/src/empty-state/empty-state.d.ts +1 -1
  95. package/dist/src/fab/fab.d.ts +111 -0
  96. package/dist/src/fab/index.d.ts +1 -0
  97. package/dist/src/focus-ring/focus-ring.d.ts +4 -1
  98. package/dist/src/index.d.ts +11 -1
  99. package/dist/src/link/link.d.ts +3 -10
  100. package/dist/src/menu/menu/menu.d.ts +4 -2
  101. package/dist/src/menu/menu-item/menu-item.d.ts +0 -1
  102. package/dist/src/menu/sub-menu/sub-menu.d.ts +1 -0
  103. package/dist/src/notification/index.d.ts +1 -0
  104. package/dist/src/notification/notification.d.ts +69 -0
  105. package/dist/src/pagination/pagination.d.ts +8 -1
  106. package/dist/src/ripple/ripple.d.ts +19 -3
  107. package/dist/src/search/index.d.ts +1 -0
  108. package/dist/src/search/search.d.ts +76 -0
  109. package/dist/src/segmented-button/index.d.ts +2 -0
  110. package/dist/src/segmented-button/segmented-button-group.d.ts +46 -0
  111. package/dist/src/segmented-button/segmented-button.d.ts +65 -0
  112. package/dist/src/select/index.d.ts +3 -0
  113. package/dist/src/select/option.d.ts +55 -0
  114. package/dist/src/select/select.d.ts +114 -0
  115. package/dist/src/side-sheet/index.d.ts +1 -0
  116. package/dist/src/side-sheet/side-sheet.d.ts +41 -0
  117. package/dist/src/slider/slider.d.ts +4 -0
  118. package/dist/src/snackbar/snackbar.d.ts +14 -1
  119. package/dist/src/tabs/tab-group.d.ts +0 -1
  120. package/dist/src/tabs/tab.d.ts +8 -2
  121. package/dist/src/tabs/tabs.d.ts +13 -1
  122. package/dist/src/toolbar/index.d.ts +1 -0
  123. package/dist/src/toolbar/toolbar.d.ts +86 -0
  124. package/dist/state-DwbEjqVk.js +10 -0
  125. package/dist/state-DwbEjqVk.js.map +1 -0
  126. package/dist/{style-map-DcB52w-l.js → style-map-DVmWOuYy.js} +3 -3
  127. package/dist/{style-map-DcB52w-l.js.map → style-map-DVmWOuYy.js.map} +1 -1
  128. package/dist/test/search.test.d.ts +1 -0
  129. package/dist/test/toolbar.test.d.ts +1 -0
  130. package/dist/throttle-C7ZAPqtu.js +24 -0
  131. package/dist/throttle-C7ZAPqtu.js.map +1 -0
  132. package/dist/toolbar.js +306 -0
  133. package/dist/toolbar.js.map +1 -0
  134. package/dist/tsconfig.tsbuildinfo +1 -1
  135. package/dist/{unsafe-html-C2r3PyzF.js → unsafe-html-BsGUjx94.js} +3 -3
  136. package/dist/{unsafe-html-C2r3PyzF.js.map → unsafe-html-BsGUjx94.js.map} +1 -1
  137. package/package.json +1 -1
  138. package/readme.md +2 -2
  139. package/scss/styles.scss +4 -0
  140. package/src/__base_element/BaseHyperlink.ts +42 -0
  141. package/src/__base_element/README.md +19 -0
  142. package/src/__utils/cache-fetch.ts +65 -0
  143. package/src/{utils → __utils}/dispatch-event-utils.ts +1 -0
  144. package/src/__utils/is-dark-mode.ts +3 -0
  145. package/src/__utils/is-in-viewport.ts +6 -0
  146. package/src/__utils/observe-slot-change.ts +38 -0
  147. package/src/__utils/sanitize-svg.ts +27 -0
  148. package/src/__utils/throttle.ts +27 -0
  149. package/src/accordion/accordion-item.scss +136 -65
  150. package/src/accordion/accordion-item.ts +117 -44
  151. package/src/accordion/accordion.scss +24 -5
  152. package/src/accordion/accordion.ts +29 -23
  153. package/src/accordion/demo/index.html +74 -35
  154. package/src/banner/banner.scss +87 -0
  155. package/src/banner/banner.ts +107 -0
  156. package/src/banner/index.ts +1 -0
  157. package/src/bottom-sheet/bottom-sheet.scss +88 -0
  158. package/src/bottom-sheet/bottom-sheet.ts +135 -0
  159. package/src/bottom-sheet/index.ts +1 -0
  160. package/src/button/BaseButton.ts +26 -30
  161. package/src/button/button/button-colors.scss +90 -19
  162. package/src/button/button/button-sizes.scss +39 -19
  163. package/src/button/button/button.scss +117 -116
  164. package/src/button/button/button.ts +29 -6
  165. package/src/button/button-group/button-group.scss +25 -22
  166. package/src/button/button-group/button-group.ts +122 -5
  167. package/src/button/icon-button/icon-button-sizes.scss +35 -15
  168. package/src/button/icon-button/icon-button.ts +25 -12
  169. package/src/card/card-colors.scss +10 -0
  170. package/src/card/card-content.ts +26 -0
  171. package/src/card/card.scss +221 -41
  172. package/src/card/card.ts +251 -8
  173. package/src/card/index.ts +1 -0
  174. package/src/chart-bar/chart-bar.ts +1 -1
  175. package/src/chart-bar/chart-stacked-bar.ts +3 -1
  176. package/src/chart-doughnut/chart-doughnut.ts +1 -1
  177. package/src/chart-pie/chart-pie.ts +1 -1
  178. package/src/checkbox/checkbox.ts +1 -1
  179. package/src/clock/clock.ts +1 -1
  180. package/src/code-editor/code-editor.ts +5 -5
  181. package/src/code-highlighter/code-highlighter.ts +2 -2
  182. package/src/container/container.ts +1 -1
  183. package/src/date-picker/date-picker.ts +5 -2
  184. package/src/divider/divider.ts +3 -1
  185. package/src/empty-state/empty-state.scss +9 -3
  186. package/src/empty-state/empty-state.ts +2 -2
  187. package/src/fab/fab-colors.scss +49 -0
  188. package/src/fab/fab-sizes.scss +47 -0
  189. package/src/fab/fab.scss +137 -0
  190. package/src/fab/fab.ts +285 -0
  191. package/src/fab/index.ts +1 -0
  192. package/src/field/field.ts +3 -1
  193. package/src/focus-ring/focus-ring.ts +37 -19
  194. package/src/icon/datasource.ts +1 -1
  195. package/src/icon/icon.ts +3 -1
  196. package/src/image/image.ts +3 -2
  197. package/src/index.ts +12 -1
  198. package/src/input/input.ts +5 -2
  199. package/src/link/link.ts +2 -15
  200. package/src/menu/menu/menu.scss +31 -3
  201. package/src/menu/menu/menu.ts +30 -6
  202. package/src/menu/menu-item/menu-item.scss +1 -0
  203. package/src/menu/menu-item/menu-item.ts +1 -9
  204. package/src/menu/sub-menu/sub-menu.ts +1 -0
  205. package/src/notification/index.ts +1 -0
  206. package/src/notification/notification.scss +201 -0
  207. package/src/notification/notification.ts +206 -0
  208. package/src/number-counter/number-counter.ts +3 -1
  209. package/src/number-field/number-field.ts +4 -2
  210. package/src/pagination/pagination.scss +33 -24
  211. package/src/pagination/pagination.ts +113 -60
  212. package/src/peacock-loader.ts +48 -0
  213. package/src/radio/radio.ts +3 -1
  214. package/src/ripple/ripple.ts +19 -3
  215. package/src/search/index.ts +1 -0
  216. package/src/search/search-colors.scss +14 -0
  217. package/src/search/search.scss +204 -0
  218. package/src/search/search.ts +240 -0
  219. package/src/segmented-button/index.ts +2 -0
  220. package/src/segmented-button/segmented-button-group.scss +21 -0
  221. package/src/segmented-button/segmented-button-group.ts +110 -0
  222. package/src/segmented-button/segmented-button.scss +115 -0
  223. package/src/segmented-button/segmented-button.ts +175 -0
  224. package/src/select/index.ts +3 -0
  225. package/src/select/option.ts +109 -0
  226. package/src/select/select.scss +125 -0
  227. package/src/select/select.ts +520 -0
  228. package/src/side-sheet/index.ts +1 -0
  229. package/src/side-sheet/side-sheet.scss +79 -0
  230. package/src/side-sheet/side-sheet.ts +100 -0
  231. package/src/slider/slider.scss +19 -1
  232. package/src/slider/slider.ts +30 -19
  233. package/src/snackbar/snackbar.scss +62 -31
  234. package/src/snackbar/snackbar.ts +92 -12
  235. package/src/switch/switch.ts +3 -1
  236. package/src/table/table.ts +3 -1
  237. package/src/tabs/demo/index.html +90 -0
  238. package/src/tabs/tab-group.ts +0 -3
  239. package/src/tabs/tab.scss +237 -25
  240. package/src/tabs/tab.ts +91 -14
  241. package/src/tabs/tabs.scss +37 -3
  242. package/src/tabs/tabs.ts +118 -2
  243. package/src/textarea/textarea.ts +4 -2
  244. package/src/time-picker/time-picker.ts +4 -2
  245. package/src/toolbar/index.ts +1 -0
  246. package/src/toolbar/toolbar-colors.scss +16 -0
  247. package/src/toolbar/toolbar.scss +165 -0
  248. package/src/toolbar/toolbar.ts +137 -0
  249. package/dist/IndividualComponent-Dt5xirYG.js +0 -73
  250. package/dist/IndividualComponent-Dt5xirYG.js.map +0 -1
  251. package/dist/button-ClzS8JLq.js.map +0 -1
  252. package/dist/button-group-BMS5WvaF.js +0 -292
  253. package/dist/button-group-BMS5WvaF.js.map +0 -1
  254. package/dist/chart-donut.js +0 -309
  255. package/dist/chart-donut.js.map +0 -1
  256. package/dist/class-map-59YGWLnx.js.map +0 -1
  257. package/dist/directive-Cuw6h7YA.js +0 -9
  258. package/dist/directive-Cuw6h7YA.js.map +0 -1
  259. package/dist/dispatch-event-utils-B4odODQf.js +0 -277
  260. package/dist/dispatch-event-utils-B4odODQf.js.map +0 -1
  261. package/dist/observe-theme-change-pALI5fmV.js.map +0 -1
  262. package/dist/radio-b70_Ie9n.js.map +0 -1
  263. package/dist/src/chart-donut/chart-donut.d.ts +0 -53
  264. package/dist/src/chart-donut/index.d.ts +0 -1
  265. package/dist/src/styleMixins.css.d.ts +0 -9
  266. package/dist/src/utils.d.ts +0 -9
  267. package/src/chart-donut/chart-donut.scss +0 -37
  268. package/src/chart-donut/chart-donut.ts +0 -287
  269. package/src/chart-donut/demo/index.html +0 -51
  270. package/src/chart-donut/index.ts +0 -1
  271. package/src/styleMixins.css.ts +0 -55
  272. package/src/utils.ts +0 -193
  273. /package/dist/src/{spread.d.ts → __directive/spread.d.ts} +0 -0
  274. /package/dist/src/{utils → __utils}/copy-to-clipboard.d.ts +0 -0
  275. /package/dist/src/{utils → __utils}/dispatch-event-utils.d.ts +0 -0
  276. /package/dist/src/{utils → __utils}/observe-theme-change.d.ts +0 -0
  277. /package/dist/test/{card.test.d.ts → banner.test.d.ts} +0 -0
  278. /package/src/{spread.ts → __directive/spread.ts} +0 -0
  279. /package/src/{utils → __utils}/copy-to-clipboard.ts +0 -0
  280. /package/src/{utils → __utils}/observe-theme-change.ts +0 -0
@@ -1,24 +1,108 @@
1
- import { a as i, _ as __decorate, n, i as i$1, b, A, c as __classPrivateFieldGet, w } from './IndividualComponent-Dt5xirYG.js';
2
- import { r, e as e$3 } from './class-map-59YGWLnx.js';
3
- import { e as e$1 } from './directive-Cuw6h7YA.js';
4
- import { e as e$2, o as o$4 } from './unsafe-html-C2r3PyzF.js';
5
- import { c as createCacheFetch, s as sanitizeSvg, o as observerSlotChangesWithCallback, r as redispatchEvent, a as isDarkMode, i as isActivationClick, d as dispatchActivationClick, t as throttle } from './dispatch-event-utils-B4odODQf.js';
1
+ import { a as i, _ as __decorate, i as i$1, b, A, c as __classPrivateFieldGet, w } from './IndividualComponent-DUINtMGK.js';
2
+ import { n } from './property-1psGvXOq.js';
3
+ import { r } from './state-DwbEjqVk.js';
4
+ import { e as e$1 } from './directive-ZPhl09Yt.js';
5
+ import { e as e$2, o as o$4 } from './unsafe-html-BsGUjx94.js';
6
+ import { e as e$3 } from './class-map-YU7g0o3B.js';
7
+ import { o as observerSlotChangesWithCallback } from './observe-slot-change-BGJfgg2E.js';
6
8
  import { a as e, e as e$4 } from './query-QBcUV-L_.js';
7
- import { o as o$3 } from './style-map-DcB52w-l.js';
8
- import { B as BaseInput, o as observeThemeChange } from './observe-theme-change-pALI5fmV.js';
9
- import { s as spread } from './button-ClzS8JLq.js';
9
+ import { d as BaseHyperlink } from './button-DMN1dPAg.js';
10
+ import { o as o$2 } from './style-map-DVmWOuYy.js';
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';
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';
10
16
 
11
17
  /**
12
18
  * @license
13
19
  * Copyright 2021 Google LLC
14
20
  * SPDX-License-Identifier: BSD-3-Clause
15
- */function o$2(o){return (e$1,n)=>{const{slot:r,selector:s}=o??{},c="slot"+(r?`[name=${r}]`:":not([name])");return e(e$1,n,{get(){const t=this.renderRoot?.querySelector(c),e=t?.assignedElements(o)??[];return void 0===s?e:e.filter(t=>t.matches(s))}})}}
21
+ */function o$1(o){return (e$1,n)=>{const{slot:r,selector:s}=o??{},c="slot"+(r?`[name=${r}]`:":not([name])");return e(e$1,n,{get(){const t=this.renderRoot?.querySelector(c),e=t?.assignedElements(o)??[];return void 0===s?e:e.filter(t=>t.matches(s))}})}}
16
22
 
17
23
  /**
18
24
  * @license
19
25
  * Copyright 2017 Google LLC
20
26
  * SPDX-License-Identifier: BSD-3-Clause
21
- */class t extends e$2{}t.directiveName="unsafeSVG",t.resultType=2;const o$1=e$1(t);
27
+ */class t extends e$2{}t.directiveName="unsafeSVG",t.resultType=2;const o=e$1(t);
28
+
29
+ // Basic sanitization: remove <script>, <foreignObject>, event handler attributes (on*), and iframes
30
+ function sanitizeSvg(rawSvg) {
31
+ try {
32
+ const parser = new DOMParser();
33
+ const doc = parser.parseFromString(rawSvg, 'image/svg+xml');
34
+ const scripts = Array.from(doc.querySelectorAll('script'));
35
+ scripts.forEach(n => n.remove());
36
+ const foreigns = Array.from(doc.querySelectorAll('foreignObject, iframe'));
37
+ foreigns.forEach(n => n.remove());
38
+ const all = Array.from(doc.querySelectorAll('*'));
39
+ all.forEach(el => {
40
+ const attrs = Array.from(el.attributes).filter(a => /^on/i.test(a.name));
41
+ attrs.forEach(a => el.removeAttribute(a.name));
42
+ });
43
+ const el = doc.documentElement;
44
+ if (!el)
45
+ return '';
46
+ const serializer = new XMLSerializer();
47
+ return serializer.serializeToString(el);
48
+ }
49
+ catch (e) {
50
+ return '';
51
+ }
52
+ }
53
+
54
+ async function createCacheFetch(name) {
55
+ let cache = null;
56
+ // This map tracks requests currently being processed
57
+ const inFlightRequests = new Map();
58
+ try {
59
+ cache = await window.caches.open(name);
60
+ }
61
+ catch (e) {
62
+ console.warn('window.caches access not allowed');
63
+ }
64
+ return async (url) => {
65
+ if (inFlightRequests.has(url)) {
66
+ return inFlightRequests.get(url);
67
+ }
68
+ const fetchPromise = (async () => {
69
+ const request = new Request(url);
70
+ if (cache) {
71
+ const cachedResponse = await cache.match(request);
72
+ if (cachedResponse) {
73
+ return cachedResponse.text();
74
+ }
75
+ }
76
+ const urlObj = new URL(request.url);
77
+ const isSameOrigin = urlObj.origin === window.location.origin;
78
+ const response = await fetch(request.url, {
79
+ method: 'GET',
80
+ mode: isSameOrigin ? 'no-cors' : 'cors',
81
+ credentials: isSameOrigin ? 'same-origin' : 'omit',
82
+ });
83
+ if (response.status === 404) {
84
+ console.error(`[Fetch Error] Resource not found (404): ${url}`);
85
+ return '';
86
+ }
87
+ const result = await response.text();
88
+ if (cache && response.status === 200) {
89
+ await cache.put(request, new Response(result, {
90
+ status: response.status,
91
+ statusText: response.statusText,
92
+ headers: response.headers,
93
+ }));
94
+ }
95
+ return result;
96
+ })();
97
+ inFlightRequests.set(url, fetchPromise);
98
+ try {
99
+ return await fetchPromise;
100
+ }
101
+ finally {
102
+ inFlightRequests.delete(url);
103
+ }
104
+ };
105
+ }
22
106
 
23
107
  const PROVIDERS = {
24
108
  'material-symbols': (name) => `https://cdn.jsdelivr.net/npm/@material-symbols/svg-500@0.40.1/outlined/${name}.svg`,
@@ -39,7 +123,7 @@ async function fetchIcon(name, provider = 'material-symbols') {
39
123
  return fetchSVG(PROVIDERS[provider](name));
40
124
  }
41
125
 
42
- var css_248z$L = i`* {
126
+ var css_248z$O = i`* {
43
127
  box-sizing: border-box;
44
128
  }
45
129
 
@@ -108,7 +192,7 @@ class Icon extends i$1 {
108
192
  // accessible wrapper; consumers can provide a fallback via <slot name="fallback">.
109
193
  return b ` <div class="icon">
110
194
  ${this.svgContent
111
- ? o$1(this.svgContent)
195
+ ? o(this.svgContent)
112
196
  : b `<slot name="fallback"></slot>`}
113
197
  </div>`;
114
198
  }
@@ -168,7 +252,7 @@ class Icon extends i$1 {
168
252
  }
169
253
  }
170
254
  }
171
- Icon.styles = [css_248z$L];
255
+ Icon.styles = [css_248z$O];
172
256
  __decorate([
173
257
  n({ type: String, reflect: true })
174
258
  ], Icon.prototype, "name", void 0);
@@ -188,7 +272,7 @@ __decorate([
188
272
  r()
189
273
  ], Icon.prototype, "error", void 0);
190
274
 
191
- var css_248z$K = i`* {
275
+ var css_248z$N = i`* {
192
276
  box-sizing: border-box;
193
277
  }
194
278
 
@@ -279,7 +363,7 @@ class Avatar extends i$1 {
279
363
  return `${first.charAt(0)}${last.charAt(0)}`.toUpperCase();
280
364
  }
281
365
  }
282
- Avatar.styles = [css_248z$K];
366
+ Avatar.styles = [css_248z$N];
283
367
  __decorate([
284
368
  n({ type: String, reflect: true })
285
369
  ], Avatar.prototype, "name", void 0);
@@ -287,7 +371,7 @@ __decorate([
287
371
  n({ type: String, reflect: true })
288
372
  ], Avatar.prototype, "src", void 0);
289
373
 
290
- var css_248z$J = i`* {
374
+ var css_248z$M = i`* {
291
375
  box-sizing: border-box;
292
376
  }
293
377
 
@@ -359,12 +443,12 @@ class Badge extends i$1 {
359
443
  </div>`;
360
444
  }
361
445
  }
362
- Badge.styles = [css_248z$J];
446
+ Badge.styles = [css_248z$M];
363
447
  __decorate([
364
448
  n({ type: String })
365
449
  ], Badge.prototype, "value", void 0);
366
450
 
367
- var css_248z$I = i`* {
451
+ var css_248z$L = i`* {
368
452
  box-sizing: border-box;
369
453
  }
370
454
 
@@ -473,7 +557,7 @@ class Divider extends i$1 {
473
557
  </div>`;
474
558
  }
475
559
  }
476
- Divider.styles = [css_248z$I];
560
+ Divider.styles = [css_248z$L];
477
561
  __decorate([
478
562
  n({ type: Boolean, reflect: true })
479
563
  ], Divider.prototype, "vertical", void 0);
@@ -481,7 +565,7 @@ __decorate([
481
565
  r()
482
566
  ], Divider.prototype, "slotHasContent", void 0);
483
567
 
484
- var css_248z$H = i`/**
568
+ var css_248z$K = i`/**
485
569
  * Derived from Material Design Elevation
486
570
  * https://github.com/material-components/material-web/blob/main/elevation/internal/_elevation.scss
487
571
  */
@@ -554,9 +638,403 @@ class Elevation extends i$1 {
554
638
  return b `<span class="shadow"></span>`;
555
639
  }
556
640
  }
557
- Elevation.styles = [css_248z$H];
641
+ Elevation.styles = [css_248z$K];
642
+
643
+ var css_248z$J = i`* {
644
+ box-sizing: border-box;
645
+ }
646
+
647
+ .screen-reader-only {
648
+ display: none !important;
649
+ }
650
+
651
+ :host {
652
+ display: contents;
653
+ --_segmented-button-height: 2.5rem;
654
+ --_segmented-button-outline-color: var(--color-outline, #79747e);
655
+ --_segmented-button-selected-container-color: var(--color-secondary-container, #e8def8);
656
+ --_segmented-button-selected-label-text-color: var(--color-on-secondary-container, #1d192b);
657
+ --_segmented-button-unselected-label-text-color: var(--color-on-surface, #1c1b1f);
658
+ --_segmented-button-disabled-opacity: 0.38;
659
+ --_segmented-button-state-layer-color: var(--color-on-surface, #1c1b1f);
660
+ --_segmented-button-selected-state-layer-color: var(--color-on-secondary-container, #1d192b);
661
+ }
662
+
663
+ .segment {
664
+ position: relative;
665
+ display: flex;
666
+ align-items: center;
667
+ justify-content: center;
668
+ height: var(--segmented-button-height, var(--_segmented-button-height));
669
+ padding: 0 1.5rem;
670
+ cursor: pointer;
671
+ flex: 1;
672
+ min-width: 0;
673
+ outline: none;
674
+ user-select: none;
675
+ -webkit-user-select: none;
676
+ background: transparent;
677
+ overflow: hidden;
678
+ transition: background-color 200ms ease, color 200ms ease;
679
+ }
680
+ .segment .content {
681
+ position: relative;
682
+ z-index: 1;
683
+ display: flex;
684
+ align-items: center;
685
+ gap: 0.5rem;
686
+ font-family: var(--typography-label-large-font-family) !important;
687
+ font-size: var(--typography-label-large-font-size) !important;
688
+ font-weight: var(--typography-label-large-font-weight) !important;
689
+ line-height: var(--typography-label-large-line-height) !important;
690
+ letter-spacing: var(--typography-label-large-letter-spacing) !important;
691
+ color: var(--segmented-button-unselected-label-text-color, var(--_segmented-button-unselected-label-text-color));
692
+ }
693
+ .segment .content .check-icon,
694
+ .segment .content .leading-icon {
695
+ --icon-size: 1.125rem;
696
+ --icon-color: currentColor;
697
+ flex-shrink: 0;
698
+ }
699
+ .segment .content .label {
700
+ overflow: hidden;
701
+ text-overflow: ellipsis;
702
+ white-space: nowrap;
703
+ }
704
+ .segment .state-layer {
705
+ position: absolute;
706
+ inset: 0;
707
+ background: var(--_segmented-button-state-layer-color);
708
+ opacity: 0;
709
+ pointer-events: none;
710
+ transition: opacity 200ms ease;
711
+ }
712
+ .segment {
713
+ /* right-side divider between segments */
714
+ }
715
+ .segment .segment-outline {
716
+ position: absolute;
717
+ top: 0;
718
+ right: 0;
719
+ width: 1px;
720
+ height: 100%;
721
+ background: var(--segmented-button-outline-color, var(--_segmented-button-outline-color));
722
+ pointer-events: none;
723
+ }
724
+ .segment:hover:not(.disabled) .state-layer {
725
+ opacity: 0.08;
726
+ }
727
+ .segment.has-focus:not(.disabled) .state-layer {
728
+ opacity: 0.12;
729
+ }
730
+ .segment.active:not(.disabled) .state-layer {
731
+ opacity: 0.16;
732
+ }
733
+ .segment {
734
+ /* Selected state */
735
+ }
736
+ .segment.selected {
737
+ background-color: var(--segmented-button-selected-container-color, var(--_segmented-button-selected-container-color));
738
+ }
739
+ .segment.selected .content {
740
+ color: var(--segmented-button-selected-label-text-color, var(--_segmented-button-selected-label-text-color));
741
+ }
742
+ .segment.selected .state-layer {
743
+ background: var(--_segmented-button-selected-state-layer-color);
744
+ }
745
+ .segment {
746
+ /* Disabled state */
747
+ }
748
+ .segment.disabled {
749
+ cursor: not-allowed;
750
+ opacity: var(--segmented-button-disabled-opacity, var(--_segmented-button-disabled-opacity));
751
+ pointer-events: none;
752
+ }
753
+
754
+ :host(:last-child) .segment-outline {
755
+ display: none;
756
+ }`;
757
+
758
+ /**
759
+ * @label Segmented Button
760
+ * @tag wc-segmented-button
761
+ * @rawTag segmented-button
762
+ * @summary An individual segment within a segmented button group.
763
+ * @parentRawTag segmented-button-group
764
+ * @overview
765
+ * <p>Segmented buttons help people select options, switch views, or sort elements. They are used within a <code>wc-segmented-button-group</code>.</p>
766
+ *
767
+ * @cssprop --segmented-button-height: Height of the segmented button.
768
+ * @cssprop --segmented-button-selected-container-color: Background color when the segment is selected.
769
+ * @cssprop --segmented-button-selected-label-text-color: Text color when the segment is selected.
770
+ * @cssprop --segmented-button-unselected-label-text-color: Text color when the segment is unselected.
771
+ * @cssprop --segmented-button-outline-color: Outline / border color.
772
+ * @cssprop --segmented-button-disabled-opacity: Opacity when the segment is disabled.
773
+ *
774
+ * @fires {CustomEvent} segmented-button--change - Dispatched when the selected state changes.
775
+ *
776
+ * @example
777
+ * ```html
778
+ * <wc-segmented-button-group>
779
+ * <wc-segmented-button value="day">Day</wc-segmented-button>
780
+ * <wc-segmented-button value="week" selected>Week</wc-segmented-button>
781
+ * <wc-segmented-button value="month">Month</wc-segmented-button>
782
+ * </wc-segmented-button-group>
783
+ * ```
784
+ *
785
+ * @tags controls
786
+ */
787
+ class SegmentedButton extends i$1 {
788
+ constructor() {
789
+ super(...arguments);
790
+ /**
791
+ * The value associated with this segment.
792
+ */
793
+ this.value = '';
794
+ /**
795
+ * Whether this segment is currently selected.
796
+ */
797
+ this.selected = false;
798
+ /**
799
+ * If true, the user cannot interact with this segment.
800
+ */
801
+ this.disabled = false;
802
+ this.hasFocus = false;
803
+ this.isActive = false;
804
+ this._windowMouseUp = () => {
805
+ if (this.isActive) {
806
+ this.isActive = false;
807
+ }
808
+ };
809
+ this._mouseDownHandler = () => {
810
+ this.isActive = true;
811
+ };
812
+ this._keyDownHandler = (evt) => {
813
+ if (evt.key === ' ' || evt.key === 'Enter') {
814
+ evt.preventDefault();
815
+ this.isActive = true;
816
+ this._toggle(evt);
817
+ }
818
+ };
819
+ this._clickHandler = (ev) => {
820
+ this._toggle(ev);
821
+ };
822
+ this._blurHandler = (ev) => {
823
+ this.hasFocus = false;
824
+ this.dispatchEvent(new CustomEvent('blur', { detail: ev, bubbles: true, composed: true }));
825
+ };
826
+ this._focusHandler = (ev) => {
827
+ this.hasFocus = true;
828
+ this.dispatchEvent(new CustomEvent('focus', { detail: ev, bubbles: true, composed: true }));
829
+ };
830
+ }
831
+ connectedCallback() {
832
+ super.connectedCallback();
833
+ window.addEventListener('mouseup', this._windowMouseUp);
834
+ }
835
+ disconnectedCallback() {
836
+ super.disconnectedCallback();
837
+ window.removeEventListener('mouseup', this._windowMouseUp);
838
+ }
839
+ _toggle(ev) {
840
+ if (this.disabled)
841
+ return;
842
+ this.dispatchEvent(new CustomEvent('segmented-button--change', {
843
+ detail: {
844
+ value: this.value || this.textContent?.trim(),
845
+ selected: !this.selected,
846
+ originalEvent: ev,
847
+ },
848
+ bubbles: true,
849
+ composed: true,
850
+ }));
851
+ }
852
+ /** Sets focus on the segment. */
853
+ focus() {
854
+ this.renderRoot.querySelector('.segment')?.focus();
855
+ }
856
+ /** Removes focus from the segment. */
857
+ blur() {
858
+ this.renderRoot.querySelector('.segment')?.blur();
859
+ }
860
+ render() {
861
+ const cssClasses = {
862
+ segment: true,
863
+ selected: this.selected,
864
+ disabled: this.disabled,
865
+ 'has-focus': this.hasFocus,
866
+ active: this.isActive,
867
+ 'has-icon': !!this.icon,
868
+ };
869
+ return b `
870
+ <div
871
+ class=${e$3(cssClasses)}
872
+ role="button"
873
+ tabindex=${this.disabled ? -1 : 0}
874
+ aria-pressed=${this.selected}
875
+ aria-disabled=${this.disabled}
876
+ @click=${this._clickHandler}
877
+ @mousedown=${this._mouseDownHandler}
878
+ @keydown=${this._keyDownHandler}
879
+ @blur=${this._blurHandler}
880
+ @focus=${this._focusHandler}
881
+ >
882
+ <div class="state-layer"></div>
883
+ <div class="content">
884
+ ${this.selected
885
+ ? b `<wc-icon class="check-icon" name="check"></wc-icon>`
886
+ : this.icon
887
+ ? b `<wc-icon class="leading-icon" name=${this.icon}></wc-icon>`
888
+ : A}
889
+ <span class="label"><slot></slot></span>
890
+ </div>
891
+ <div class="segment-outline"></div>
892
+ </div>
893
+ `;
894
+ }
895
+ }
896
+ SegmentedButton.styles = [css_248z$J];
897
+ __decorate([
898
+ n({ type: String, reflect: true })
899
+ ], SegmentedButton.prototype, "value", void 0);
900
+ __decorate([
901
+ n({ type: Boolean, reflect: true })
902
+ ], SegmentedButton.prototype, "selected", void 0);
903
+ __decorate([
904
+ n({ type: Boolean, reflect: true })
905
+ ], SegmentedButton.prototype, "disabled", void 0);
906
+ __decorate([
907
+ n({ type: String })
908
+ ], SegmentedButton.prototype, "icon", void 0);
909
+ __decorate([
910
+ r()
911
+ ], SegmentedButton.prototype, "hasFocus", void 0);
912
+ __decorate([
913
+ r()
914
+ ], SegmentedButton.prototype, "isActive", void 0);
915
+
916
+ var css_248z$I = i`* {
917
+ box-sizing: border-box;
918
+ }
919
+
920
+ .screen-reader-only {
921
+ display: none !important;
922
+ }
923
+
924
+ :host {
925
+ display: inline-flex;
926
+ --_segmented-button-group-shape: var(--shape-corner-full, 9999px);
927
+ }
928
+
929
+ .segmented-button-group {
930
+ display: flex;
931
+ align-items: stretch;
932
+ border-radius: var(--segmented-button-group-shape, var(--_segmented-button-group-shape));
933
+ border: 1px solid var(--segmented-button-outline-color, var(--color-outline, #79747e));
934
+ overflow: hidden;
935
+ min-width: max-content;
936
+ }
937
+ .segmented-button-group ::slotted(wc-segmented-button) {
938
+ flex: 1;
939
+ }`;
940
+
941
+ /**
942
+ * @label Segmented Button Group
943
+ * @tag wc-segmented-button-group
944
+ * @rawTag segmented-button-group
945
+ * @summary A container for segmented buttons following Material Design 3.
946
+ * @overview
947
+ * <p>Segmented buttons help people select options, switch views, or sort elements. They follow the Material Design 3 specification.</p>
948
+ * <p>Use <code>multi-select</code> to allow more than one segment to be selected at a time. By default only one segment can be active (single-select).</p>
949
+ *
950
+ * @cssprop --segmented-button-group-shape: Border-radius of the group container.
951
+ *
952
+ * @fires {CustomEvent} change - Dispatched when the selection changes. Detail contains <code>{ value, values }</code>.
953
+ *
954
+ * @example
955
+ * ```html
956
+ * <wc-segmented-button-group>
957
+ * <wc-segmented-button value="day">Day</wc-segmented-button>
958
+ * <wc-segmented-button value="week" selected>Week</wc-segmented-button>
959
+ * <wc-segmented-button value="month">Month</wc-segmented-button>
960
+ * </wc-segmented-button-group>
961
+ * ```
962
+ *
963
+ * @tags controls
964
+ */
965
+ class SegmentedButtonGroup extends i$1 {
966
+ constructor() {
967
+ super(...arguments);
968
+ /**
969
+ * When true, multiple segments can be selected simultaneously.
970
+ * Defaults to single-select mode.
971
+ */
972
+ this.multiSelect = false;
973
+ /**
974
+ * When true, in single-select mode the currently selected segment can be
975
+ * deselected by clicking it again (allowing an empty selection).
976
+ * Defaults to `false`.
977
+ */
978
+ this.nullable = false;
979
+ this._onSegmentChange = (ev) => {
980
+ ev.stopPropagation();
981
+ const target = ev.composedPath()[0];
982
+ const segments = this._getSegments();
983
+ if (this.multiSelect) {
984
+ target.selected = !target.selected;
985
+ }
986
+ else {
987
+ if (target.selected && this.nullable) {
988
+ target.selected = false;
989
+ }
990
+ else {
991
+ segments.forEach(seg => {
992
+ seg.selected = seg === target;
993
+ });
994
+ }
995
+ }
996
+ const selectedValues = segments
997
+ .filter(s => s.selected)
998
+ .map(s => s.value || s.textContent?.trim() || '');
999
+ this.dispatchEvent(new CustomEvent('change', {
1000
+ detail: {
1001
+ value: selectedValues[0] ?? null,
1002
+ values: selectedValues,
1003
+ },
1004
+ bubbles: true,
1005
+ composed: true,
1006
+ }));
1007
+ };
1008
+ }
1009
+ connectedCallback() {
1010
+ super.connectedCallback();
1011
+ this.addEventListener('segmented-button--change', this._onSegmentChange);
1012
+ }
1013
+ disconnectedCallback() {
1014
+ super.disconnectedCallback();
1015
+ this.removeEventListener('segmented-button--change', this._onSegmentChange);
1016
+ }
1017
+ _getSegments() {
1018
+ return Array.from(this.querySelectorAll('wc-segmented-button'));
1019
+ }
1020
+ render() {
1021
+ return b `
1022
+ <div class="segmented-button-group" role="group">
1023
+ <slot></slot>
1024
+ </div>
1025
+ `;
1026
+ }
1027
+ }
1028
+ SegmentedButtonGroup.styles = [css_248z$I];
1029
+ SegmentedButtonGroup.SegmentedButton = SegmentedButton;
1030
+ __decorate([
1031
+ n({ type: Boolean, reflect: true, attribute: 'multi-select' })
1032
+ ], SegmentedButtonGroup.prototype, "multiSelect", void 0);
1033
+ __decorate([
1034
+ n({ type: Boolean, reflect: true })
1035
+ ], SegmentedButtonGroup.prototype, "nullable", void 0);
558
1036
 
559
- var css_248z$G = i`:host {
1037
+ var css_248z$H = i`:host {
560
1038
  display: none;
561
1039
  pointer-events: none;
562
1040
  position: absolute;
@@ -593,7 +1071,7 @@ class FocusRing extends i$1 {
593
1071
  constructor() {
594
1072
  super(...arguments);
595
1073
  this.visible = false;
596
- this.element = '';
1074
+ this.for = '';
597
1075
  }
598
1076
  render() {
599
1077
  return A;
@@ -609,8 +1087,17 @@ class FocusRing extends i$1 {
609
1087
  this.detach();
610
1088
  }
611
1089
  }
612
- connectedCallback() {
613
- super.connectedCallback();
1090
+ set forElement(value) {
1091
+ if (value) {
1092
+ this._focusTarget = value;
1093
+ this.attach();
1094
+ }
1095
+ else {
1096
+ this.detach();
1097
+ }
1098
+ }
1099
+ connectedCallback() {
1100
+ super.connectedCallback();
614
1101
  this.attach();
615
1102
  }
616
1103
  disconnectedCallback() {
@@ -618,8 +1105,8 @@ class FocusRing extends i$1 {
618
1105
  super.disconnectedCallback();
619
1106
  }
620
1107
  __focusin() {
621
- // @ts-ignore
622
- this.visible = this._control[this.element].matches(':focus-visible') ?? false;
1108
+ const focusTarget = this.__getFocusTarget();
1109
+ this.visible = focusTarget?.matches(':focus-visible') ?? false;
623
1110
  }
624
1111
  __focusout() {
625
1112
  this.visible = false;
@@ -627,37 +1114,41 @@ class FocusRing extends i$1 {
627
1114
  __pointerdown() {
628
1115
  this.visible = false;
629
1116
  }
1117
+ __getFocusTarget() {
1118
+ if (this._focusTarget) {
1119
+ return this._focusTarget;
1120
+ }
1121
+ const focusTarget = document.getElementById(this.for);
1122
+ if (focusTarget) {
1123
+ return focusTarget;
1124
+ }
1125
+ return undefined;
1126
+ }
630
1127
  attach() {
631
- // @ts-ignore
632
- if (this._control && this._control[this.element]) {
633
- // @ts-ignore
634
- this._control[this.element].addEventListener('focusin', this.__focusin.bind(this));
635
- // @ts-ignore
636
- this._control[this.element].addEventListener('focusout', this.__focusin.bind(this));
637
- // @ts-ignore
638
- this._control[this.element].addEventListener('pointerdown', this.__focusin.bind(this));
1128
+ const focusTarget = this.__getFocusTarget();
1129
+ 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));
639
1133
  }
640
1134
  }
641
1135
  detach() {
642
- // @ts-ignore
643
- if (this._control && this._control[this.element]) {
644
- // @ts-ignore
645
- this._control[this.element].removeEventListener('focusin', this.__focusin);
646
- // @ts-ignore
647
- this._control[this.element].removeEventListener('focusout', this.__focusout);
648
- // @ts-ignore
649
- this._control[this.element].removeEventListener('pointerdown', this.__pointerdown);
1136
+ const focusTarget = this.__getFocusTarget();
1137
+ 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));
650
1141
  }
651
1142
  this._control = undefined;
652
1143
  }
653
1144
  }
654
- FocusRing.styles = [css_248z$G];
1145
+ FocusRing.styles = [css_248z$H];
655
1146
  __decorate([
656
1147
  n({ type: Boolean, reflect: true })
657
1148
  ], FocusRing.prototype, "visible", void 0);
658
1149
  __decorate([
659
1150
  n({ type: String })
660
- ], FocusRing.prototype, "element", void 0);
1151
+ ], FocusRing.prototype, "for", void 0);
661
1152
 
662
1153
  const PRESS_GROW_MS = 450;
663
1154
  const MINIMUM_PRESS_MS = 225;
@@ -744,10 +1235,26 @@ const FORCED_COLORS = window.matchMedia('(forced-colors: active)');
744
1235
  *
745
1236
  * @example
746
1237
  * ```html
747
- * <button style="position: relative;">
1238
+ * <style>
1239
+ * .ripple-surface {
1240
+ * position: relative;
1241
+ * display: inline-flex;
1242
+ * align-items: center;
1243
+ * justify-content: center;
1244
+ * width: 220px;
1245
+ * height: 64px;
1246
+ * border-radius: 12px;
1247
+ * background: var(--color-surface-container-high);
1248
+ * color: var(--color-on-surface);
1249
+ * overflow: hidden;
1250
+ * cursor: pointer;
1251
+ * user-select: none;
1252
+ * }
1253
+ * </style>
1254
+ * <div class="ripple-surface">
748
1255
  * <wc-ripple></wc-ripple>
749
- * Click me
750
- * </button>
1256
+ * Ripple Effect
1257
+ * </div>
751
1258
  * ```
752
1259
  * @tags display
753
1260
  */
@@ -1112,7 +1619,7 @@ __decorate([
1112
1619
  e$4('.surface')
1113
1620
  ], Ripple.prototype, "mdRoot", void 0);
1114
1621
 
1115
- var css_248z$F = i`* {
1622
+ var css_248z$G = i`* {
1116
1623
  box-sizing: border-box;
1117
1624
  }
1118
1625
 
@@ -1122,81 +1629,145 @@ var css_248z$F = i`* {
1122
1629
 
1123
1630
  :host {
1124
1631
  display: block;
1125
- --accordion-item-title-align: start;
1126
1632
  }
1127
1633
 
1128
- .accordion-item .accordion-heading {
1129
- cursor: pointer;
1130
- width: 100%;
1131
- border-radius: 0;
1132
- border: 0;
1133
- padding: 0 var(--spacing-200);
1134
- background: var(--accordion-item-heading-background, transparent);
1634
+ .expansion-panel {
1635
+ border: var(--_accordion-item-border, 1px solid var(--color-outline-variant));
1636
+ border-radius: var(--shape-corner-medium);
1637
+ background-color: var(--_accordion-item-background, var(--color-surface-container-low));
1638
+ overflow: hidden;
1639
+ transition: background-color var(--duration-medium1) var(--easing-standard), border-color var(--duration-medium1) var(--easing-standard);
1640
+ }
1641
+ .expansion-panel .header-button {
1642
+ position: relative;
1135
1643
  display: flex;
1136
- flex-direction: row-reverse;
1137
1644
  align-items: center;
1645
+ width: 100%;
1646
+ min-height: 3rem;
1647
+ padding: 0 var(--spacing-300);
1648
+ gap: var(--spacing-200);
1649
+ border: none;
1650
+ border-radius: 0;
1651
+ background: transparent;
1652
+ cursor: pointer;
1653
+ text-align: start;
1138
1654
  color: var(--color-on-surface);
1139
- justify-content: flex-start;
1140
- gap: 0.5rem;
1141
- font-family: var(--typography-title-medium-font-family) !important;
1142
- font-size: var(--typography-title-medium-font-size) !important;
1143
- font-weight: var(--typography-title-medium-font-weight) !important;
1144
- line-height: var(--typography-title-medium-line-height) !important;
1145
- letter-spacing: var(--typography-title-medium-letter-spacing) !important;
1655
+ overflow: hidden;
1146
1656
  }
1147
- .accordion-item .accordion-heading .accordion-title {
1148
- width: 100%;
1149
- text-align: var(--accordion-item-title-align);
1657
+ .expansion-panel .header-button::before {
1658
+ content: "";
1659
+ position: absolute;
1660
+ inset: 0;
1661
+ background-color: var(--color-on-surface);
1662
+ opacity: 0;
1663
+ pointer-events: none;
1664
+ transition: opacity var(--duration-short4) var(--easing-standard);
1150
1665
  }
1151
- .accordion-item .accordion-heading:focus-visible {
1666
+ .expansion-panel .header-button:not(:disabled):hover::before {
1667
+ opacity: 0.08;
1668
+ }
1669
+ .expansion-panel .header-button:focus-visible {
1670
+ outline: none;
1152
1671
  outline: 2px solid var(--color-black);
1153
1672
  }
1154
- .accordion-item .accordion-heading .accordion-icon {
1673
+ .expansion-panel .header-button:focus-visible::before {
1674
+ opacity: 0.12;
1675
+ }
1676
+ .expansion-panel .header-label {
1677
+ flex: 1;
1678
+ display: flex;
1679
+ flex-direction: column;
1680
+ justify-content: center;
1681
+ gap: 2px;
1682
+ padding: var(--spacing-150) 0;
1683
+ min-width: 0;
1684
+ }
1685
+ .expansion-panel .panel-title {
1686
+ font-family: var(--typography-body-large-font-family) !important;
1687
+ font-size: var(--typography-body-large-font-size) !important;
1688
+ font-weight: var(--typography-body-large-font-weight) !important;
1689
+ line-height: var(--typography-body-large-line-height) !important;
1690
+ letter-spacing: var(--typography-body-large-letter-spacing) !important;
1691
+ color: var(--color-on-surface);
1692
+ white-space: nowrap;
1693
+ overflow: hidden;
1694
+ text-overflow: ellipsis;
1695
+ }
1696
+ .expansion-panel .panel-description {
1697
+ font-family: var(--typography-body-small-font-family) !important;
1698
+ font-size: var(--typography-body-small-font-size) !important;
1699
+ font-weight: var(--typography-body-small-font-weight) !important;
1700
+ line-height: var(--typography-body-small-line-height) !important;
1701
+ letter-spacing: var(--typography-body-small-letter-spacing) !important;
1702
+ color: var(--color-on-surface-variant);
1703
+ white-space: nowrap;
1704
+ overflow: hidden;
1705
+ text-overflow: ellipsis;
1706
+ }
1707
+ .expansion-panel .panel-description[hidden] {
1708
+ display: none;
1709
+ }
1710
+ .expansion-panel ::slotted([slot=header-actions]) {
1711
+ display: flex;
1712
+ align-items: center;
1713
+ flex-shrink: 0;
1714
+ gap: var(--spacing-100);
1715
+ }
1716
+ .expansion-panel .toggle-icon {
1155
1717
  --icon-size: 1.5rem;
1156
- --icon-color: currentColor;
1157
- transition: transform var(--duration-short2) var(--easing-standard);
1718
+ --icon-color: var(--color-on-surface-variant);
1719
+ flex-shrink: 0;
1720
+ transition: transform var(--duration-medium1) var(--easing-standard);
1158
1721
  }
1159
- .accordion-item .item-section {
1160
- height: 0;
1161
- opacity: 0;
1162
- pointer-events: none;
1163
- text-align: start;
1164
- transition: all var(--duration-short2) var(--easing-standard);
1722
+ .expansion-panel .panel-content {
1723
+ display: grid;
1724
+ grid-template-rows: 0fr;
1725
+ transition: grid-template-rows var(--duration-medium1) var(--easing-standard);
1726
+ }
1727
+ .expansion-panel .content-inner {
1728
+ overflow: hidden;
1729
+ min-height: 0;
1730
+ font-family: var(--typography-body-medium-font-family) !important;
1731
+ font-size: var(--typography-body-medium-font-size) !important;
1732
+ font-weight: var(--typography-body-medium-font-weight) !important;
1733
+ line-height: var(--typography-body-medium-line-height) !important;
1734
+ letter-spacing: var(--typography-body-medium-letter-spacing) !important;
1735
+ color: var(--color-on-surface-variant);
1165
1736
  }
1166
- .accordion-item:not(.disabled) .accordion-heading:hover {
1167
- --accordion-item-heading-background: var(--color-inverse-primary);
1737
+ .expansion-panel.disabled {
1738
+ background-color: color-mix(in srgb, var(--color-surface-container-low) 38%, transparent);
1739
+ border-color: color-mix(in srgb, var(--color-outline-variant) 38%, transparent);
1168
1740
  }
1169
- .accordion-item.disabled .accordion-heading {
1741
+ .expansion-panel.disabled .header-button {
1170
1742
  cursor: not-allowed;
1743
+ pointer-events: none;
1171
1744
  opacity: 0.38;
1172
1745
  }
1173
- .accordion-item.open .item-section {
1174
- height: 100%;
1175
- pointer-events: auto;
1176
- opacity: 1;
1177
- padding: var(--spacing-100) var(--spacing-800) var(--spacing-300) var(--spacing-200);
1746
+ .expansion-panel.open {
1747
+ background-color: var(--color-surface-container);
1748
+ border-color: transparent;
1178
1749
  }
1179
- .accordion-item.open .accordion-icon {
1180
- transform: rotate(180deg);
1750
+ .expansion-panel.open .panel-content {
1751
+ grid-template-rows: 1fr;
1752
+ border-block-start: 1px solid var(--color-outline-variant);
1181
1753
  }
1182
-
1183
- /*
1184
- * Sizes
1185
- */
1186
- .accordion-item .accordion-heading {
1187
- height: 2.5rem;
1754
+ .expansion-panel.open .content-inner {
1755
+ padding: 0 var(--spacing-300) var(--spacing-200);
1188
1756
  }
1189
-
1190
- :host-context([size=sm]) .accordion-item .accordion-heading {
1191
- height: 2rem;
1757
+ .expansion-panel.open .toggle-icon {
1758
+ transform: rotate(180deg);
1192
1759
  }
1193
-
1194
- :host-context([size=lg]) .accordion-item .accordion-heading {
1195
- height: 3rem;
1760
+ .expansion-panel.disabled {
1761
+ background-color: color-mix(in srgb, var(--color-surface-container-low) 38%, transparent);
1762
+ border-color: color-mix(in srgb, var(--color-outline-variant) 38%, transparent);
1196
1763
  }
1197
1764
 
1198
- :host-context(p-accordion[align=start]) .accordion-item .accordion-heading {
1199
- flex-direction: row;
1765
+ :host([toggle-position=before]) .header-button {
1766
+ flex-direction: row-reverse;
1767
+ justify-content: flex-end;
1768
+ }
1769
+ :host([toggle-position=before]) .header-label {
1770
+ flex: 1;
1200
1771
  }`;
1201
1772
 
1202
1773
  var _AccordionItem_id;
@@ -1204,13 +1775,27 @@ var _AccordionItem_id;
1204
1775
  * @label Accordion Item
1205
1776
  * @tag wc-accordion-item
1206
1777
  * @rawTag accordion-item
1207
- * @summary An accordion item is single item in an accordion list. It contains a header and a content section that can be expanded or collapsed by the user.
1778
+ * @summary An expansion panel with a header that reveals or hides associated content. Follows Material Design 3 expansion panel guidelines.
1208
1779
  * @parentRawTag accordion
1209
1780
  *
1781
+ * @slot - The body content revealed when the panel is expanded.
1782
+ * @slot heading - The panel title. Renders as `body-large` text.
1783
+ * @slot description - Optional subtitle rendered below the title. Renders as `body-small` text.
1784
+ * @slot header-actions - Actions (e.g. icon buttons) placed at the trailing end of the header, before the toggle icon.
1785
+ *
1786
+ * @part header - The header `<button>` element.
1787
+ * @part title - The title text container.
1788
+ * @part description - The description text container.
1789
+ * @part content - The expandable content region wrapper.
1790
+ *
1791
+ * @fires {CustomEvent<{ open: boolean }>} accordion-item:toggle - Fired when the panel is expanded or collapsed.
1792
+ *
1210
1793
  * @example
1211
1794
  * ```html
1212
1795
  * <wc-accordion-item>
1213
- * Testing
1796
+ * <span slot="heading">Personal information</span>
1797
+ * <span slot="description">Fill in your details</span>
1798
+ * <p>Content goes here.</p>
1214
1799
  * </wc-accordion-item>
1215
1800
  * ```
1216
1801
  * @tags display
@@ -1220,17 +1805,25 @@ class AccordionItem extends i$1 {
1220
1805
  super(...arguments);
1221
1806
  _AccordionItem_id.set(this, crypto.randomUUID());
1222
1807
  /**
1223
- * The menu item value.
1224
- */
1225
- this.heading = '';
1226
- /**
1227
- * If true, the user cannot interact with the button. Defaults to `false`.
1808
+ * Whether the user cannot interact with the panel.
1228
1809
  */
1229
1810
  this.disabled = false;
1230
1811
  /**
1231
- * Menu item selection state.
1812
+ * Whether the panel is expanded.
1232
1813
  */
1233
1814
  this.open = false;
1815
+ /**
1816
+ * Whether to hide the expand/collapse toggle indicator icon.
1817
+ */
1818
+ this.hideToggle = false;
1819
+ /**
1820
+ * Position of the toggle icon relative to the panel title.
1821
+ * `'after'` places it at the trailing end (default, matches M3).
1822
+ * `'before'` places it at the leading start.
1823
+ */
1824
+ this.togglePosition = 'after';
1825
+ this._hasDescriptionSlot = false;
1826
+ this._hasHeadingSlot = false;
1234
1827
  }
1235
1828
  focus() {
1236
1829
  this.buttonElement?.focus();
@@ -1238,54 +1831,91 @@ class AccordionItem extends i$1 {
1238
1831
  blur() {
1239
1832
  this.buttonElement?.blur();
1240
1833
  }
1241
- __handleToggle() {
1834
+ _handleToggle() {
1242
1835
  if (this.disabled)
1243
1836
  return;
1244
1837
  this.open = !this.open;
1245
- this.dispatchEvent(new CustomEvent('accordion-item--toggle', {
1838
+ this.dispatchEvent(new CustomEvent('accordion-item:toggle', {
1246
1839
  bubbles: true,
1247
1840
  composed: true,
1248
- detail: { open: this.open, id: __classPrivateFieldGet(this, _AccordionItem_id, "f") },
1841
+ detail: { open: this.open },
1249
1842
  }));
1250
1843
  }
1844
+ static _onSlotChange(e, setter) {
1845
+ const slot = e.target;
1846
+ const nodes = slot.assignedNodes({ flatten: true });
1847
+ setter(nodes.some(n => n.nodeType === Node.TEXT_NODE
1848
+ ? (n.textContent?.trim() ?? '') !== ''
1849
+ : true));
1850
+ }
1851
+ _renderToggleIcon() {
1852
+ if (this.hideToggle)
1853
+ return A;
1854
+ return b `<wc-icon
1855
+ class="toggle-icon"
1856
+ name="keyboard_arrow_down"
1857
+ aria-hidden="true"
1858
+ ></wc-icon>`;
1859
+ }
1251
1860
  render() {
1252
- return b `<div
1253
- class=${e$3({
1254
- 'accordion-item': true,
1861
+ return b `
1862
+ <div
1863
+ class=${e$3({
1864
+ 'expansion-panel': true,
1255
1865
  open: this.open,
1256
1866
  disabled: this.disabled,
1257
1867
  })}
1258
- >
1259
- <button
1260
- id=${`accordion-heading-${__classPrivateFieldGet(this, _AccordionItem_id, "f")}`}
1261
- tabindex="0"
1262
- aria-controls=${`accordion-control-${__classPrivateFieldGet(this, _AccordionItem_id, "f")}`}
1263
- class="accordion-heading"
1264
- aria-disabled=${this.disabled}
1265
- @click=${this.__handleToggle}
1266
- aria-expanded=${this.open}
1267
1868
  >
1268
- <wc-icon class="accordion-icon" name="keyboard_arrow_down"></wc-icon>
1269
- <div part="title" class="accordion-title">
1270
- <slot name="heading">${this.heading}</slot>
1869
+ <button
1870
+ id=${`panel-header-${__classPrivateFieldGet(this, _AccordionItem_id, "f")}`}
1871
+ part="header"
1872
+ class="header-button"
1873
+ tabindex=${this.disabled ? '-1' : '0'}
1874
+ aria-controls=${`panel-content-${__classPrivateFieldGet(this, _AccordionItem_id, "f")}`}
1875
+ aria-disabled=${this.disabled}
1876
+ aria-expanded=${this.open}
1877
+ ?disabled=${this.disabled}
1878
+ @click=${this._handleToggle}
1879
+ >
1880
+ ${this.togglePosition === 'before' ? this._renderToggleIcon() : A}
1881
+ <span class="header-label">
1882
+ <span part="title" class="panel-title">
1883
+ <slot
1884
+ name="heading"
1885
+ @slotchange=${(e) => AccordionItem._onSlotChange(e, v => { this._hasHeadingSlot = v; })}
1886
+ ></slot>
1887
+ </span>
1888
+ <span
1889
+ part="description"
1890
+ class="panel-description"
1891
+ ?hidden=${!this._hasDescriptionSlot}
1892
+ >
1893
+ <slot
1894
+ name="description"
1895
+ @slotchange=${(e) => AccordionItem._onSlotChange(e, v => { this._hasDescriptionSlot = v; })}
1896
+ ></slot>
1897
+ </span>
1898
+ </span>
1899
+ <slot name="header-actions" class="header-actions"></slot>
1900
+ ${this.togglePosition === 'after' ? this._renderToggleIcon() : A}
1901
+ </button>
1902
+ <div
1903
+ id=${`panel-content-${__classPrivateFieldGet(this, _AccordionItem_id, "f")}`}
1904
+ part="content"
1905
+ class="panel-content"
1906
+ role="region"
1907
+ aria-labelledby=${`panel-header-${__classPrivateFieldGet(this, _AccordionItem_id, "f")}`}
1908
+ >
1909
+ <div class="content-inner">
1910
+ <slot></slot>
1911
+ </div>
1271
1912
  </div>
1272
- </button>
1273
- <div
1274
- class="item-section slot-main"
1275
- id=${`accordion-control-${__classPrivateFieldGet(this, _AccordionItem_id, "f")}`}
1276
- aria-labelledby=${`accordion-heading-${__classPrivateFieldGet(this, _AccordionItem_id, "f")}`}
1277
- role="region"
1278
- >
1279
- <slot></slot>
1280
1913
  </div>
1281
- </div>`;
1914
+ `;
1282
1915
  }
1283
1916
  }
1284
1917
  _AccordionItem_id = new WeakMap();
1285
- AccordionItem.styles = [css_248z$F];
1286
- __decorate([
1287
- n({ type: String, reflect: true })
1288
- ], AccordionItem.prototype, "heading", void 0);
1918
+ AccordionItem.styles = [css_248z$G];
1289
1919
  __decorate([
1290
1920
  n({ type: Boolean, reflect: true })
1291
1921
  ], AccordionItem.prototype, "disabled", void 0);
@@ -1293,10 +1923,22 @@ __decorate([
1293
1923
  n({ type: Boolean, reflect: true })
1294
1924
  ], AccordionItem.prototype, "open", void 0);
1295
1925
  __decorate([
1296
- e$4('.accordion-heading')
1926
+ n({ type: Boolean, reflect: true, attribute: 'hide-toggle' })
1927
+ ], AccordionItem.prototype, "hideToggle", void 0);
1928
+ __decorate([
1929
+ n({ type: String, reflect: true, attribute: 'toggle-position' })
1930
+ ], AccordionItem.prototype, "togglePosition", void 0);
1931
+ __decorate([
1932
+ r()
1933
+ ], AccordionItem.prototype, "_hasDescriptionSlot", void 0);
1934
+ __decorate([
1935
+ r()
1936
+ ], AccordionItem.prototype, "_hasHeadingSlot", void 0);
1937
+ __decorate([
1938
+ e$4('.header-button')
1297
1939
  ], AccordionItem.prototype, "buttonElement", void 0);
1298
1940
 
1299
- var css_248z$E = i`* {
1941
+ var css_248z$F = i`* {
1300
1942
  box-sizing: border-box;
1301
1943
  }
1302
1944
 
@@ -1308,27 +1950,38 @@ var css_248z$E = i`* {
1308
1950
  display: block;
1309
1951
  }
1310
1952
 
1311
- slot::slotted(:not(:last-child)) {
1312
- border-block-start: 1px solid var(--color-outline);
1953
+ .accordion {
1954
+ display: flex;
1955
+ flex-direction: column;
1956
+ gap: var(--spacing-100);
1313
1957
  }
1314
1958
 
1315
- slot::slotted(:last-child) {
1316
- border-block-start: 1px solid var(--color-outline);
1317
- border-block-end: 1px solid var(--color-outline);
1959
+ :host([display-mode=flat]) .accordion {
1960
+ gap: 0;
1961
+ }
1962
+ :host([display-mode=flat]) slot::slotted(wc-accordion-item) {
1963
+ --_accordion-item-border: none;
1964
+ --_accordion-item-background: transparent;
1318
1965
  }`;
1319
1966
 
1320
1967
  /**
1321
1968
  * @label Accordion
1322
1969
  * @tag wc-accordion
1323
1970
  * @rawTag accordion
1324
- * @summary An accordion is a vertically stacked list of headers that reveal or hide associated sections of content.
1971
+ * @summary A vertically stacked set of expansion panels. Follows Material Design 3 expansion panel guidelines.
1325
1972
  *
1326
1973
  * @example
1327
1974
  * ```html
1328
1975
  * <wc-accordion>
1329
- * <wc-accordion-item heading="Accordion">
1330
- * Content
1331
- * </wc-accordion-item>
1976
+ * <wc-accordion-item>
1977
+ * <span slot="heading">Panel 1</span>
1978
+ * <span slot="description">Summary text</span>
1979
+ * Content
1980
+ * </wc-accordion-item>
1981
+ * <wc-accordion-item>
1982
+ * <span slot="heading">Panel 2</span>
1983
+ * Content
1984
+ * </wc-accordion-item>
1332
1985
  * </wc-accordion>
1333
1986
  * ```
1334
1987
  * @tags display
@@ -1336,7 +1989,17 @@ slot::slotted(:last-child) {
1336
1989
  class Accordion extends i$1 {
1337
1990
  constructor() {
1338
1991
  super(...arguments);
1339
- this.allowMultiple = false;
1992
+ /**
1993
+ * Whether multiple panels can be expanded simultaneously.
1994
+ * When `false` (default), expanding one panel collapses all others.
1995
+ */
1996
+ this.multi = false;
1997
+ /**
1998
+ * Display mode for the accordion.
1999
+ * `'default'` renders panels with a subtle background on expand and dividers between items.
2000
+ * `'flat'` renders panels without borders or background changes — suitable for use inside cards.
2001
+ */
2002
+ this.displayMode = 'default';
1340
2003
  }
1341
2004
  connectedCallback() {
1342
2005
  super.connectedCallback();
@@ -1348,17 +2011,15 @@ class Accordion extends i$1 {
1348
2011
  disconnectedCallback() {
1349
2012
  super.disconnectedCallback();
1350
2013
  // @ts-ignore
1351
- // eslint-disable-next-line no-undef
1352
2014
  this.removeEventListener('accordion-item:toggle', this._onItemToggle);
1353
2015
  this.removeEventListener('keydown', this._onKeyDown);
1354
2016
  }
1355
2017
  _onItemToggle(e) {
1356
2018
  const targetItem = e.target;
1357
- // Stop event bubbling if it came from a nested accordion
1358
- // We check if the target item is a direct child of *this* accordion
2019
+ // Ignore events from nested accordions only handle direct children
1359
2020
  if (targetItem.parentElement !== this)
1360
2021
  return;
1361
- if (!this.allowMultiple && targetItem.open) {
2022
+ if (!this.multi && targetItem.open) {
1362
2023
  this.items.forEach(item => {
1363
2024
  if (item !== targetItem && item.open) {
1364
2025
  // eslint-disable-next-line no-param-reassign
@@ -1368,16 +2029,10 @@ class Accordion extends i$1 {
1368
2029
  }
1369
2030
  }
1370
2031
  _onKeyDown(e) {
1371
- // 1. Find which item currently has its HEADER focused.
1372
- // We check the shadowRoot of each item to see if the internal <button> is the active element.
1373
2032
  const focusedItemIndex = this.items.findIndex(item => {
1374
- // Access the Shadow DOM of the item
1375
2033
  const root = item.shadowRoot;
1376
- // Check if the focused element inside that shadow DOM is the toggle button
1377
- return root?.activeElement?.classList.contains('accordion-heading');
2034
+ return root?.activeElement?.classList.contains('header-button');
1378
2035
  });
1379
- // 2. If no header is focused (e.g., focus is on body content or outside), do nothing.
1380
- // This prevents stealing focus when the user is typing in a form inside the accordion.
1381
2036
  if (focusedItemIndex === -1)
1382
2037
  return;
1383
2038
  let nextIndex = -1;
@@ -1385,12 +2040,10 @@ class Accordion extends i$1 {
1385
2040
  switch (e.key) {
1386
2041
  case 'ArrowDown':
1387
2042
  e.preventDefault();
1388
- // Cycle next
1389
2043
  nextIndex = (focusedItemIndex + 1) % this.items.length;
1390
2044
  break;
1391
2045
  case 'ArrowUp':
1392
2046
  e.preventDefault();
1393
- // Cycle previous
1394
2047
  nextIndex =
1395
2048
  (focusedItemIndex - 1 + this.items.length) % this.items.length;
1396
2049
  break;
@@ -1403,11 +2056,9 @@ class Accordion extends i$1 {
1403
2056
  nextIndex = this.items.length - 1;
1404
2057
  break;
1405
2058
  }
1406
- // 3. Apply Focus
1407
2059
  if (nextIndex !== -1) {
1408
2060
  const itemToFocus = this.items[nextIndex];
1409
- // Select the button inside the Shadow DOM of the target item
1410
- const button = itemToFocus.shadowRoot?.querySelector('.accordion-heading');
2061
+ const button = itemToFocus.shadowRoot?.querySelector('.header-button');
1411
2062
  button?.focus();
1412
2063
  }
1413
2064
  }
@@ -1415,16 +2066,19 @@ class Accordion extends i$1 {
1415
2066
  return b `<div class="accordion"><slot></slot></div>`;
1416
2067
  }
1417
2068
  }
1418
- Accordion.styles = [css_248z$E];
2069
+ Accordion.styles = [css_248z$F];
1419
2070
  Accordion.Item = AccordionItem;
1420
2071
  __decorate([
1421
- n({ type: Boolean, attribute: 'allow-multiple' })
1422
- ], Accordion.prototype, "allowMultiple", void 0);
2072
+ n({ type: Boolean, reflect: true })
2073
+ ], Accordion.prototype, "multi", void 0);
2074
+ __decorate([
2075
+ n({ type: String, reflect: true, attribute: 'display-mode' })
2076
+ ], Accordion.prototype, "displayMode", void 0);
1423
2077
  __decorate([
1424
- o$2({ selector: 'p-accordion-item' })
2078
+ o$1({ selector: 'wc-accordion-item' })
1425
2079
  ], Accordion.prototype, "items", void 0);
1426
2080
 
1427
- var css_248z$D = i`* {
2081
+ var css_248z$E = i`* {
1428
2082
  box-sizing: border-box;
1429
2083
  }
1430
2084
 
@@ -1474,14 +2128,7 @@ var css_248z$D = i`* {
1474
2128
  * <wc-link href="#">Link</wc-link>
1475
2129
  * ```
1476
2130
  */
1477
- class Link extends i$1 {
1478
- constructor() {
1479
- super(...arguments);
1480
- /**
1481
- * Sets or retrieves the window or frame at which to target content.
1482
- */
1483
- this.target = '_self';
1484
- }
2131
+ class Link extends BaseHyperlink(i$1) {
1485
2132
  render() {
1486
2133
  return b `<a
1487
2134
  class=${e$3({
@@ -1495,18 +2142,9 @@ class Link extends i$1 {
1495
2142
  </a>`;
1496
2143
  }
1497
2144
  }
1498
- Link.styles = [css_248z$D];
1499
- __decorate([
1500
- n({ reflect: true })
1501
- ], Link.prototype, "href", void 0);
1502
- __decorate([
1503
- n()
1504
- ], Link.prototype, "target", void 0);
1505
- __decorate([
1506
- r()
1507
- ], Link.prototype, "tabIndexValue", void 0);
2145
+ Link.styles = [css_248z$E];
1508
2146
 
1509
- var css_248z$C = i`* {
2147
+ var css_248z$D = i`* {
1510
2148
  box-sizing: border-box;
1511
2149
  }
1512
2150
 
@@ -1643,7 +2281,7 @@ slot::slotted(*) {
1643
2281
  --_container-state-opacity: 0.08;
1644
2282
  }`;
1645
2283
 
1646
- var css_248z$B = i`:host([color=default]) {
2284
+ var css_248z$C = i`:host([color=default]) {
1647
2285
  --filled-tag-container-color: var(--color-surface);
1648
2286
  --filled-tag-label-text-color: var(--color-on-surface);
1649
2287
  --tonal-tag-container-color: var(--color-surface-container);
@@ -1709,7 +2347,7 @@ var css_248z$B = i`:host([color=default]) {
1709
2347
  --outlined-tag-label-text-color: var(--color-purple);
1710
2348
  }`;
1711
2349
 
1712
- var css_248z$A = i`.tag {
2350
+ var css_248z$B = i`.tag {
1713
2351
  font-family: var(--font-family-sans) !important;
1714
2352
  }
1715
2353
 
@@ -1808,7 +2446,7 @@ class Tag extends i$1 {
1808
2446
  }
1809
2447
  // Define styles (Lit handles Scoping via Shadow DOM by default)
1810
2448
  // You would typically import your tag.scss.js here or use the css tag
1811
- Tag.styles = [css_248z$C, css_248z$B, css_248z$A];
2449
+ Tag.styles = [css_248z$D, css_248z$C, css_248z$B];
1812
2450
  __decorate([
1813
2451
  n({ type: Boolean })
1814
2452
  ], Tag.prototype, "dismissible", void 0);
@@ -1822,7 +2460,7 @@ __decorate([
1822
2460
  n()
1823
2461
  ], Tag.prototype, "size", void 0);
1824
2462
 
1825
- var css_248z$z = i`* {
2463
+ var css_248z$A = i`* {
1826
2464
  box-sizing: border-box;
1827
2465
  }
1828
2466
 
@@ -1934,7 +2572,7 @@ var css_248z$z = i`* {
1934
2572
  color: var(--background);
1935
2573
  }`;
1936
2574
 
1937
- var css_248z$y = i`:host([color=red]) {
2575
+ var css_248z$z = i`:host([color=red]) {
1938
2576
  --chip-container-color: var(--color-red-container);
1939
2577
  --chip-outline-color: var(--color-on-red-container);
1940
2578
  }
@@ -1963,7 +2601,7 @@ var css_248z$y = i`:host([color=red]) {
1963
2601
  --chip-outline-color: var(--color-on-purple-container);
1964
2602
  }`;
1965
2603
 
1966
- var css_248z$x = i`.tag {
2604
+ var css_248z$y = i`.tag {
1967
2605
  font-family: var(--font-family-sans) !important;
1968
2606
  }
1969
2607
 
@@ -2101,7 +2739,7 @@ class Chip extends i$1 {
2101
2739
  }
2102
2740
  // Define styles (Lit handles Scoping via Shadow DOM by default)
2103
2741
  // You would typically import your tag.scss.js here or use the css tag
2104
- Chip.styles = [css_248z$z, css_248z$y, css_248z$x];
2742
+ Chip.styles = [css_248z$A, css_248z$z, css_248z$y];
2105
2743
  __decorate([
2106
2744
  n({ type: Boolean })
2107
2745
  ], Chip.prototype, "dismissible", void 0);
@@ -2118,7 +2756,7 @@ __decorate([
2118
2756
  n({ type: String })
2119
2757
  ], Chip.prototype, "imageSrc", void 0);
2120
2758
 
2121
- var css_248z$w = i`:host {
2759
+ var css_248z$x = i`:host {
2122
2760
  display: block;
2123
2761
  --progress-height: 0.25rem;
2124
2762
  --progress-container-color: var(--color-primary);
@@ -2308,7 +2946,7 @@ class LinearProgress extends BaseProgress {
2308
2946
  <div class="track track-start"></div>
2309
2947
  <div
2310
2948
  class="active-indicator"
2311
- style="${o$3({
2949
+ style="${o$2({
2312
2950
  width: `${this.__getPercentageValue()}%`,
2313
2951
  })}"
2314
2952
  ></div>
@@ -2324,9 +2962,9 @@ class LinearProgress extends BaseProgress {
2324
2962
  }
2325
2963
  }
2326
2964
  // Lit components use static styles for better performance
2327
- LinearProgress.styles = [css_248z$w];
2965
+ LinearProgress.styles = [css_248z$x];
2328
2966
 
2329
- var css_248z$v = i`:host {
2967
+ var css_248z$w = i`:host {
2330
2968
  display: inline-block;
2331
2969
  --progress-height: 1.5rem;
2332
2970
  --progress-line-thickness: 4px;
@@ -2468,7 +3106,7 @@ class CircularProgress extends BaseProgress {
2468
3106
  cx="8"
2469
3107
  cy="8"
2470
3108
  r="6"
2471
- style="${o$3({
3109
+ style="${o$2({
2472
3110
  strokeDasharray: `${circumference}`,
2473
3111
  strokeDashoffset: this.indeterminate ? undefined : `${offset}`,
2474
3112
  })}"
@@ -2489,9 +3127,9 @@ class CircularProgress extends BaseProgress {
2489
3127
  }
2490
3128
  }
2491
3129
  // Lit components use static styles for better performance
2492
- CircularProgress.styles = [css_248z$v];
3130
+ CircularProgress.styles = [css_248z$w];
2493
3131
 
2494
- var css_248z$u = i`:host {
3132
+ var css_248z$v = i`:host {
2495
3133
  --skeleton-container-color: var(--color-surface-container);
2496
3134
  --skeleton-element: var(--color-on-surface);
2497
3135
  display: inline-block;
@@ -2595,12 +3233,12 @@ class Skeleton extends i$1 {
2595
3233
  return b ` <div class="skeleton"></div>`;
2596
3234
  }
2597
3235
  }
2598
- Skeleton.styles = [css_248z$u];
3236
+ Skeleton.styles = [css_248z$v];
2599
3237
  __decorate([
2600
3238
  n({ type: Boolean, reflect: true })
2601
3239
  ], Skeleton.prototype, "visible", void 0);
2602
3240
 
2603
- var css_248z$t = i`* {
3241
+ var css_248z$u = i`* {
2604
3242
  box-sizing: border-box;
2605
3243
  }
2606
3244
 
@@ -2773,7 +3411,7 @@ class Input extends BaseInput {
2773
3411
  `;
2774
3412
  }
2775
3413
  }
2776
- Input.styles = [css_248z$t];
3414
+ Input.styles = [css_248z$u];
2777
3415
  __decorate([
2778
3416
  n({ type: String })
2779
3417
  ], Input.prototype, "value", void 0);
@@ -2832,7 +3470,7 @@ __decorate([
2832
3470
  e$4('.input-element')
2833
3471
  ], Input.prototype, "inputElement", void 0);
2834
3472
 
2835
- var css_248z$s = i`* {
3473
+ var css_248z$t = i`* {
2836
3474
  box-sizing: border-box;
2837
3475
  }
2838
3476
 
@@ -3200,7 +3838,7 @@ class Field extends i$1 {
3200
3838
  return b `<div class="text-count">${this.textCount}</div>`;
3201
3839
  }
3202
3840
  }
3203
- Field.styles = [css_248z$s];
3841
+ Field.styles = [css_248z$t];
3204
3842
  __decorate([
3205
3843
  n({ type: String })
3206
3844
  ], Field.prototype, "label", void 0);
@@ -3256,7 +3894,7 @@ __decorate([
3256
3894
  r()
3257
3895
  ], Field.prototype, "slotEndHasContent", void 0);
3258
3896
 
3259
- var css_248z$r = i`* {
3897
+ var css_248z$s = i`* {
3260
3898
  box-sizing: border-box;
3261
3899
  }
3262
3900
 
@@ -3453,7 +4091,7 @@ class NumberField extends BaseInput {
3453
4091
  }
3454
4092
  }
3455
4093
  _NumberField_id = new WeakMap();
3456
- NumberField.styles = [css_248z$r];
4094
+ NumberField.styles = [css_248z$s];
3457
4095
  __decorate([
3458
4096
  n({ type: Number })
3459
4097
  ], NumberField.prototype, "value", void 0);
@@ -3515,7 +4153,7 @@ __decorate([
3515
4153
  e$4('.input-element')
3516
4154
  ], NumberField.prototype, "inputElement", void 0);
3517
4155
 
3518
- var css_248z$q = i`* {
4156
+ var css_248z$r = i`* {
3519
4157
  box-sizing: border-box;
3520
4158
  }
3521
4159
 
@@ -3682,7 +4320,7 @@ class DatePicker extends BaseInput {
3682
4320
  `;
3683
4321
  }
3684
4322
  }
3685
- DatePicker.styles = [css_248z$q];
4323
+ DatePicker.styles = [css_248z$r];
3686
4324
  __decorate([
3687
4325
  n({ type: String })
3688
4326
  ], DatePicker.prototype, "value", void 0);
@@ -3738,7 +4376,7 @@ __decorate([
3738
4376
  e$4('.input-element')
3739
4377
  ], DatePicker.prototype, "inputElement", void 0);
3740
4378
 
3741
- var css_248z$p = i`* {
4379
+ var css_248z$q = i`* {
3742
4380
  box-sizing: border-box;
3743
4381
  }
3744
4382
 
@@ -3905,7 +4543,7 @@ class TimePicker extends BaseInput {
3905
4543
  `;
3906
4544
  }
3907
4545
  }
3908
- TimePicker.styles = [css_248z$p];
4546
+ TimePicker.styles = [css_248z$q];
3909
4547
  __decorate([
3910
4548
  n({ type: String })
3911
4549
  ], TimePicker.prototype, "value", void 0);
@@ -3961,7 +4599,7 @@ __decorate([
3961
4599
  e$4('.input-element')
3962
4600
  ], TimePicker.prototype, "inputElement", void 0);
3963
4601
 
3964
- var css_248z$o = i`* {
4602
+ var css_248z$p = i`* {
3965
4603
  box-sizing: border-box;
3966
4604
  }
3967
4605
 
@@ -4121,7 +4759,7 @@ class Textarea extends BaseInput {
4121
4759
  `;
4122
4760
  }
4123
4761
  }
4124
- Textarea.styles = [css_248z$o];
4762
+ Textarea.styles = [css_248z$p];
4125
4763
  __decorate([
4126
4764
  n({ type: String })
4127
4765
  ], Textarea.prototype, "value", void 0);
@@ -4180,7 +4818,7 @@ __decorate([
4180
4818
  e$4('.input-element')
4181
4819
  ], Textarea.prototype, "inputElement", void 0);
4182
4820
 
4183
- var css_248z$n = i`* {
4821
+ var css_248z$o = i`* {
4184
4822
  box-sizing: border-box;
4185
4823
  }
4186
4824
 
@@ -4521,7 +5159,7 @@ class Switch extends BaseInput {
4521
5159
  `;
4522
5160
  }
4523
5161
  }
4524
- Switch.styles = [css_248z$n];
5162
+ Switch.styles = [css_248z$o];
4525
5163
  __decorate([
4526
5164
  n({ type: Boolean })
4527
5165
  ], Switch.prototype, "value", void 0);
@@ -4565,7 +5203,7 @@ __decorate([
4565
5203
  e$4('.input-native')
4566
5204
  ], Switch.prototype, "nativeElement", void 0);
4567
5205
 
4568
- var css_248z$m = i`* {
5206
+ var css_248z$n = i`* {
4569
5207
  box-sizing: border-box;
4570
5208
  }
4571
5209
 
@@ -5035,7 +5673,7 @@ class Checkbox extends i$1 {
5035
5673
  `;
5036
5674
  }
5037
5675
  }
5038
- Checkbox.styles = [css_248z$m];
5676
+ Checkbox.styles = [css_248z$n];
5039
5677
  __decorate([
5040
5678
  n({ type: String })
5041
5679
  ], Checkbox.prototype, "name", void 0);
@@ -5082,7 +5720,7 @@ __decorate([
5082
5720
  e$4('.input-native')
5083
5721
  ], Checkbox.prototype, "nativeElement", void 0);
5084
5722
 
5085
- var css_248z$l = i`* {
5723
+ var css_248z$m = i`* {
5086
5724
  box-sizing: border-box;
5087
5725
  }
5088
5726
 
@@ -5169,9 +5807,9 @@ class Spinner extends i$1 {
5169
5807
  `;
5170
5808
  }
5171
5809
  }
5172
- Spinner.styles = [css_248z$l];
5810
+ Spinner.styles = [css_248z$m];
5173
5811
 
5174
- var css_248z$k = i`* {
5812
+ var css_248z$l = i`* {
5175
5813
  box-sizing: border-box;
5176
5814
  }
5177
5815
 
@@ -5265,7 +5903,7 @@ var css_248z$k = i`* {
5265
5903
  *
5266
5904
  * @example
5267
5905
  * ```html
5268
- * <wc-container size="lg">Content</wc-container>
5906
+ * <wc-container style="width: 80%; border: 1px dotted black;" size="md">Content</wc-container>
5269
5907
  * ```
5270
5908
  */
5271
5909
  class Container extends i$1 {
@@ -5289,12 +5927,12 @@ class Container extends i$1 {
5289
5927
  `;
5290
5928
  }
5291
5929
  }
5292
- Container.styles = [css_248z$k];
5930
+ Container.styles = [css_248z$l];
5293
5931
  __decorate([
5294
5932
  n({ type: String, reflect: true })
5295
5933
  ], Container.prototype, "size", void 0);
5296
5934
 
5297
- var css_248z$j = i`* {
5935
+ var css_248z$k = i`* {
5298
5936
  box-sizing: border-box;
5299
5937
  }
5300
5938
 
@@ -5335,12 +5973,12 @@ var css_248z$j = i`* {
5335
5973
  flex-direction: column;
5336
5974
  justify-content: center;
5337
5975
  }
5338
- .content .title {
5339
- font-family: var(--typography-headline-medium-emphasized-font-family) !important;
5340
- font-size: var(--typography-headline-medium-emphasized-font-size) !important;
5341
- font-weight: var(--typography-headline-medium-emphasized-font-weight) !important;
5342
- line-height: var(--typography-headline-medium-emphasized-line-height) !important;
5343
- letter-spacing: var(--typography-headline-medium-emphasized-letter-spacing) !important;
5976
+ .content .headline {
5977
+ font-family: var(--typography-headline-medium-font-family) !important;
5978
+ font-size: var(--typography-headline-medium-font-size) !important;
5979
+ font-weight: var(--typography-headline-medium-font-weight) !important;
5980
+ line-height: var(--typography-headline-medium-line-height) !important;
5981
+ letter-spacing: var(--typography-headline-medium-letter-spacing) !important;
5344
5982
  margin-bottom: var(--spacing-200);
5345
5983
  color: var(--color-on-surface);
5346
5984
  }
@@ -5369,13 +6007,20 @@ var css_248z$j = i`* {
5369
6007
  @container emptystate (max-width: 671px) {
5370
6008
  .empty-state .empty-state-container {
5371
6009
  flex-direction: column;
5372
- gap: var(--spacing-200);
6010
+ gap: var(--spacing-150);
5373
6011
  }
5374
6012
  .empty-state .empty-state-container .illustration {
5375
6013
  height: auto;
5376
6014
  width: 100%;
5377
6015
  justify-content: center;
5378
6016
  }
6017
+ .empty-state .content .headline {
6018
+ font-family: var(--typography-headline-small-font-family) !important;
6019
+ font-size: var(--typography-headline-small-font-size) !important;
6020
+ font-weight: var(--typography-headline-small-font-weight) !important;
6021
+ line-height: var(--typography-headline-small-line-height) !important;
6022
+ letter-spacing: var(--typography-headline-small-letter-spacing) !important;
6023
+ }
5379
6024
  }`;
5380
6025
 
5381
6026
  /**
@@ -5387,7 +6032,7 @@ var css_248z$j = i`* {
5387
6032
  *
5388
6033
  * @example
5389
6034
  * ```html
5390
- * <wc-empty-state headline="No items found"></wc-empty-state>
6035
+ * <wc-empty-state style="width:100%" headline="No items found"></wc-empty-state>
5391
6036
  * ```
5392
6037
  */
5393
6038
  class EmptyState extends i$1 {
@@ -5417,7 +6062,7 @@ class EmptyState extends i$1 {
5417
6062
  __renderTitle() {
5418
6063
  if (!this.headline)
5419
6064
  return A;
5420
- return b `<div class="title">${this.headline}</div>`;
6065
+ return b `<div class="headline">${this.headline}</div>`;
5421
6066
  }
5422
6067
  __renderDescription() {
5423
6068
  if (!this.description)
@@ -5450,7 +6095,7 @@ class EmptyState extends i$1 {
5450
6095
  }
5451
6096
  }
5452
6097
  // Lit handles styles in a static property for better performance
5453
- EmptyState.styles = [css_248z$j];
6098
+ EmptyState.styles = [css_248z$k];
5454
6099
  __decorate([
5455
6100
  n({ type: String, reflect: true })
5456
6101
  ], EmptyState.prototype, "illustration", void 0);
@@ -5464,7 +6109,7 @@ __decorate([
5464
6109
  r()
5465
6110
  ], EmptyState.prototype, "vertical", void 0);
5466
6111
 
5467
- var css_248z$i = i`* {
6112
+ var css_248z$j = i`* {
5468
6113
  box-sizing: border-box;
5469
6114
  }
5470
6115
 
@@ -7290,7 +7935,7 @@ class Tooltip extends i$1 {
7290
7935
  `;
7291
7936
  }
7292
7937
  }
7293
- Tooltip.styles = [css_248z$i];
7938
+ Tooltip.styles = [css_248z$j];
7294
7939
  Tooltip.CLOSE_OTHERS_EVENT = 'tooltip--open';
7295
7940
  __decorate([
7296
7941
  n()
@@ -7314,7 +7959,7 @@ __decorate([
7314
7959
  e$4('#tooltip')
7315
7960
  ], Tooltip.prototype, "floatingEl", void 0);
7316
7961
 
7317
- var css_248z$h = i`* {
7962
+ var css_248z$i = i`* {
7318
7963
  box-sizing: border-box;
7319
7964
  }
7320
7965
 
@@ -7350,13 +7995,7 @@ ol {
7350
7995
  pointer-events: none;
7351
7996
  }`;
7352
7997
 
7353
- /**
7354
- * @license
7355
- * Copyright 2018 Google LLC
7356
- * SPDX-License-Identifier: BSD-3-Clause
7357
- */const o=o=>o??A;
7358
-
7359
- var css_248z$g = i`* {
7998
+ var css_248z$h = i`* {
7360
7999
  box-sizing: border-box;
7361
8000
  }
7362
8001
 
@@ -7465,8 +8104,8 @@ class BreadcrumbItem extends i$1 {
7465
8104
  <a
7466
8105
  class="breadcrumb-link"
7467
8106
  itemprop="item"
7468
- href=${o(this.href)}
7469
- target=${o(this.target)}
8107
+ href=${o$3(this.href)}
8108
+ target=${o$3(this.target)}
7470
8109
  ${this.target === '_blank'
7471
8110
  ? b `rel="noopener noreferrer"`
7472
8111
  : A}
@@ -7486,7 +8125,7 @@ class BreadcrumbItem extends i$1 {
7486
8125
  `;
7487
8126
  }
7488
8127
  }
7489
- BreadcrumbItem.styles = [css_248z$g];
8128
+ BreadcrumbItem.styles = [css_248z$h];
7490
8129
  __decorate([
7491
8130
  n({ reflect: true })
7492
8131
  ], BreadcrumbItem.prototype, "href", void 0);
@@ -7540,13 +8179,13 @@ class Breadcrumb extends i$1 {
7540
8179
  </nav>`;
7541
8180
  }
7542
8181
  }
7543
- Breadcrumb.styles = [css_248z$h];
8182
+ Breadcrumb.styles = [css_248z$i];
7544
8183
  Breadcrumb.Item = BreadcrumbItem;
7545
8184
  __decorate([
7546
8185
  n({ type: String })
7547
8186
  ], Breadcrumb.prototype, "label", void 0);
7548
8187
 
7549
- var css_248z$f = i`* {
8188
+ var css_248z$g = i`* {
7550
8189
  box-sizing: border-box;
7551
8190
  }
7552
8191
 
@@ -7556,22 +8195,40 @@ var css_248z$f = i`* {
7556
8195
 
7557
8196
  .menu {
7558
8197
  display: flex;
7559
- position: relative;
8198
+ position: fixed;
7560
8199
  z-index: var(--menu-z-index, 1000);
8200
+ width: var(--menu-width, max-content);
8201
+ max-width: 100vw;
7561
8202
  min-width: 112px;
7562
8203
  padding-block: var(--spacing-050);
8204
+ transform-origin: top center;
8205
+ --_menu-enter-duration: var(--duration-medium1, 250ms);
8206
+ --_menu-exit-duration: var(--duration-short4, 200ms);
8207
+ --_menu-enter-easing: cubic-bezier(0.05, 0.7, 0.1, 1);
8208
+ --_menu-exit-easing: cubic-bezier(0.3, 0, 0.8, 0.15);
8209
+ transition-property: opacity, transform, visibility;
8210
+ transition-duration: var(--_menu-exit-duration), var(--_menu-exit-duration), 0ms;
8211
+ transition-delay: 0ms, 0ms, var(--_menu-exit-duration);
8212
+ transition-timing-function: var(--_menu-exit-easing), var(--_menu-exit-easing), linear;
7563
8213
  }
7564
8214
  .menu.closed {
7565
- display: none;
7566
8215
  opacity: 0;
7567
8216
  visibility: hidden;
7568
8217
  pointer-events: none;
8218
+ transform: translateY(-4px) scale(0.97);
7569
8219
  }
7570
8220
  .menu.open {
7571
- display: flex;
7572
8221
  opacity: 1;
7573
8222
  visibility: visible;
7574
8223
  pointer-events: auto;
8224
+ transform: translateY(0) scale(1);
8225
+ transition-duration: var(--_menu-enter-duration), var(--_menu-enter-duration), 0ms;
8226
+ transition-delay: 0ms, 0ms, 0ms;
8227
+ transition-timing-function: var(--_menu-enter-easing), var(--_menu-enter-easing), linear;
8228
+ }
8229
+ .menu.preview {
8230
+ position: relative;
8231
+ pointer-events: auto;
7575
8232
  }
7576
8233
  .menu .menu-content {
7577
8234
  display: flex;
@@ -7617,6 +8274,12 @@ var css_248z$f = i`* {
7617
8274
  --elevation-container-shape-variant: var(--_container-corner-shape-variant);
7618
8275
  }
7619
8276
 
8277
+ @media (prefers-reduced-motion: reduce) {
8278
+ .menu {
8279
+ transition: none;
8280
+ transform: none;
8281
+ }
8282
+ }
7620
8283
  .menu {
7621
8284
  --_container-shape-start-start: var(--shape-corner-large);
7622
8285
  --_container-shape-start-end: var(--shape-corner-large);
@@ -7630,7 +8293,7 @@ var css_248z$f = i`* {
7630
8293
  --_container-color: var(--color-tertiary-container);
7631
8294
  }`;
7632
8295
 
7633
- var css_248z$e = i`* {
8296
+ var css_248z$f = i`* {
7634
8297
  box-sizing: border-box;
7635
8298
  }
7636
8299
 
@@ -7640,6 +8303,7 @@ var css_248z$e = i`* {
7640
8303
 
7641
8304
  :host {
7642
8305
  padding-inline: var(--spacing-050);
8306
+ outline: none;
7643
8307
  }
7644
8308
 
7645
8309
  .menu-item {
@@ -7741,7 +8405,7 @@ var css_248z$e = i`* {
7741
8405
  display: none;
7742
8406
  }`;
7743
8407
 
7744
- var css_248z$d = i`:host-context([variant=standard]) {
8408
+ var css_248z$e = i`:host-context([variant=standard]) {
7745
8409
  --menu-item-label-color: var(--color-on-surface-variant);
7746
8410
  --menu-item-label-selected-color: var(--color-on-tertiary-container);
7747
8411
  --menu-item-container-selected-color: var(--color-tertiary-container);
@@ -7855,9 +8519,6 @@ class MenuItem extends i$1 {
7855
8519
  __isLink() {
7856
8520
  return !!this.href;
7857
8521
  }
7858
- get focusTarget() {
7859
- return this;
7860
- }
7861
8522
  render() {
7862
8523
  const isLink = this.__isLink();
7863
8524
  const cssClasses = {
@@ -7891,11 +8552,7 @@ class MenuItem extends i$1 {
7891
8552
  }
7892
8553
  renderContent() {
7893
8554
  return b `
7894
- <wc-focus-ring
7895
- class="focus-ring"
7896
- .control=${this}
7897
- element="focusTarget"
7898
- ></wc-focus-ring>
8555
+ <wc-focus-ring class="focus-ring" .control=${this} .forElement=${this}></wc-focus-ring>
7899
8556
  <div class="background"></div>
7900
8557
  <wc-ripple class="ripple"></wc-ripple>
7901
8558
 
@@ -7909,7 +8566,7 @@ class MenuItem extends i$1 {
7909
8566
  `;
7910
8567
  }
7911
8568
  }
7912
- MenuItem.styles = [css_248z$e, css_248z$d];
8569
+ MenuItem.styles = [css_248z$f, css_248z$e];
7913
8570
  __decorate([
7914
8571
  n({ type: Boolean, reflect: true })
7915
8572
  ], MenuItem.prototype, "disabled", void 0);
@@ -7981,9 +8638,9 @@ class MenuSurfaceController {
7981
8638
  *
7982
8639
  * @example
7983
8640
  * ```html
7984
- * <wc-menu>
8641
+ * <wc-menu preview>
7985
8642
  * <wc-menu-item>Item 1</wc-menu-item>
7986
- * <wc-menu-item>Item 2</wc-menu-item>
8643
+ * <wc-menu-item selected>Item 2</wc-menu-item>
7987
8644
  * </wc-menu>
7988
8645
  * ```
7989
8646
  */
@@ -7993,6 +8650,7 @@ class Menu extends i$1 {
7993
8650
  this.open = false;
7994
8651
  this.variant = 'standard';
7995
8652
  this.anchor = '';
8653
+ this.preview = false;
7996
8654
  this.stayOpenOnOutsideClick = false;
7997
8655
  this.stayOpenOnFocusout = false;
7998
8656
  this.isSubmenu = false;
@@ -8005,8 +8663,13 @@ class Menu extends i$1 {
8005
8663
  this._closeReason = { kind: 'programmatic' };
8006
8664
  this._onItemActivate = (event) => {
8007
8665
  const customEvent = event;
8666
+ const { item } = customEvent.detail;
8667
+ const ownedItems = this.items;
8668
+ if (!ownedItems.includes(item)) {
8669
+ return;
8670
+ }
8008
8671
  const enabledItems = this._enabledItems();
8009
- const nextIndex = enabledItems.indexOf(customEvent.detail.item);
8672
+ const nextIndex = enabledItems.indexOf(item);
8010
8673
  if (nextIndex >= 0) {
8011
8674
  this.activeIndex = nextIndex;
8012
8675
  this._syncRovingTabIndex();
@@ -8014,6 +8677,9 @@ class Menu extends i$1 {
8014
8677
  };
8015
8678
  this._onItemRequestClose = (event) => {
8016
8679
  const customEvent = event;
8680
+ if (!this.items.includes(customEvent.detail.item)) {
8681
+ return;
8682
+ }
8017
8683
  if (customEvent.defaultPrevented) {
8018
8684
  return;
8019
8685
  }
@@ -8027,6 +8693,9 @@ class Menu extends i$1 {
8027
8693
  if (!this.open) {
8028
8694
  return;
8029
8695
  }
8696
+ if (!this._ownsKeyboardEvent(event)) {
8697
+ return;
8698
+ }
8030
8699
  switch (event.key) {
8031
8700
  case 'ArrowDown':
8032
8701
  event.preventDefault();
@@ -8175,7 +8844,6 @@ class Menu extends i$1 {
8175
8844
  for (let index = 0; index < enabledItems.length; index += 1) {
8176
8845
  const currentItem = enabledItems[index];
8177
8846
  currentItem.tabIndex = index === this.activeIndex ? 0 : -1;
8178
- currentItem.selected = index === this.activeIndex;
8179
8847
  }
8180
8848
  }
8181
8849
  _setActiveByOffset(offset) {
@@ -8212,6 +8880,11 @@ class Menu extends i$1 {
8212
8880
  _getFirstEnabledItem() {
8213
8881
  return this._enabledItems()[0] ?? null;
8214
8882
  }
8883
+ _ownsKeyboardEvent(event) {
8884
+ const path = event.composedPath();
8885
+ const ownedItems = this.items;
8886
+ return path.some(target => target instanceof MenuItem && ownedItems.includes(target));
8887
+ }
8215
8888
  _isWithinMenuTree(node) {
8216
8889
  if (!node) {
8217
8890
  return false;
@@ -8294,8 +8967,9 @@ class Menu extends i$1 {
8294
8967
  return b `<div
8295
8968
  class=${e$3({
8296
8969
  'menu': true,
8297
- open: this.open,
8298
- closed: !this.open,
8970
+ open: !this.preview && this.open,
8971
+ closed: !this.preview && !this.open,
8972
+ preview: this.preview,
8299
8973
  [`variant-${this.variant}`]: true,
8300
8974
  })}
8301
8975
  aria-hidden=${String(!this.open)}
@@ -8309,7 +8983,7 @@ class Menu extends i$1 {
8309
8983
  </div>`;
8310
8984
  }
8311
8985
  }
8312
- Menu.styles = [css_248z$f];
8986
+ Menu.styles = [css_248z$g];
8313
8987
  Menu.Item = MenuItem;
8314
8988
  __decorate([
8315
8989
  n({ type: Boolean, reflect: true })
@@ -8320,6 +8994,9 @@ __decorate([
8320
8994
  __decorate([
8321
8995
  n({ type: String })
8322
8996
  ], Menu.prototype, "anchor", void 0);
8997
+ __decorate([
8998
+ n({ type: Boolean, reflect: true })
8999
+ ], Menu.prototype, "preview", void 0);
8323
9000
  __decorate([
8324
9001
  n({ type: Boolean, attribute: 'stay-open-on-outside-click' })
8325
9002
  ], Menu.prototype, "stayOpenOnOutsideClick", void 0);
@@ -8342,7 +9019,7 @@ __decorate([
8342
9019
  e$4('.menu')
8343
9020
  ], Menu.prototype, "menuListElement", void 0);
8344
9021
 
8345
- var css_248z$c = i`* {
9022
+ var css_248z$d = i`* {
8346
9023
  box-sizing: border-box;
8347
9024
  }
8348
9025
 
@@ -8359,6 +9036,7 @@ let subMenuIdCounter = 0;
8359
9036
  * @label Sub Menu
8360
9037
  * @tag wc-sub-menu
8361
9038
  * @rawTag sub-menu
9039
+ * @parentRawTag menu
8362
9040
  * @summary Connects a menu item to a nested menu.
8363
9041
  */
8364
9042
  class SubMenu extends i$1 {
@@ -8536,7 +9214,7 @@ class SubMenu extends i$1 {
8536
9214
  `;
8537
9215
  }
8538
9216
  }
8539
- SubMenu.styles = [css_248z$c];
9217
+ SubMenu.styles = [css_248z$d];
8540
9218
  __decorate([
8541
9219
  n({ type: Number, attribute: 'hover-open-delay' })
8542
9220
  ], SubMenu.prototype, "hoverOpenDelay", void 0);
@@ -8550,13 +9228,13 @@ __decorate([
8550
9228
  n({ type: String, attribute: 'menu-corner' })
8551
9229
  ], SubMenu.prototype, "menuCorner", void 0);
8552
9230
  __decorate([
8553
- o$2({ slot: 'item' })
9231
+ o$1({ slot: 'item' })
8554
9232
  ], SubMenu.prototype, "_items", void 0);
8555
9233
  __decorate([
8556
- o$2({ slot: 'menu' })
9234
+ o$1({ slot: 'menu' })
8557
9235
  ], SubMenu.prototype, "_menus", void 0);
8558
9236
 
8559
- var css_248z$b = i`@charset "UTF-8";
9237
+ var css_248z$c = i`@charset "UTF-8";
8560
9238
  :host {
8561
9239
  display: block;
8562
9240
  height: 100%;
@@ -8713,7 +9391,7 @@ class Image extends i$1 {
8713
9391
  `;
8714
9392
  }
8715
9393
  }
8716
- Image.styles = [css_248z$b];
9394
+ Image.styles = [css_248z$c];
8717
9395
  __decorate([
8718
9396
  n({ reflect: true })
8719
9397
  ], Image.prototype, "src", void 0);
@@ -8736,7 +9414,7 @@ __decorate([
8736
9414
  r()
8737
9415
  ], Image.prototype, "_previewOpen", void 0);
8738
9416
 
8739
- var css_248z$a = i`* {
9417
+ var css_248z$b = i`* {
8740
9418
  box-sizing: border-box;
8741
9419
  }
8742
9420
 
@@ -8765,7 +9443,7 @@ var css_248z$a = i`* {
8765
9443
  flex-direction: column;
8766
9444
  align-items: center;
8767
9445
  justify-content: center;
8768
- height: var(--_tab-height);
9446
+ height: 100%;
8769
9447
  padding: 0 var(--_container-padding);
8770
9448
  width: 100%;
8771
9449
  cursor: pointer;
@@ -8780,48 +9458,52 @@ var css_248z$a = i`* {
8780
9458
  display: flex;
8781
9459
  align-items: center;
8782
9460
  justify-content: center;
8783
- gap: 0;
8784
9461
  width: 100%;
8785
9462
  height: 100%;
8786
9463
  z-index: 0;
8787
9464
  color: var(--_label-text-color);
8788
9465
  opacity: var(--_label-text-opacity, 1);
9466
+ transition: color var(--duration-short4) var(--easing-standard), opacity var(--duration-short4) var(--easing-standard);
8789
9467
  --icon-size: var(--tab-icon-size, var(--_tab-icon-size));
8790
9468
  --icon-color: var(--_label-text-color);
8791
9469
  }
8792
- .tab .tab-content .slot-container {
8793
- display: none;
8794
- }
8795
9470
  .tab .tab-content ::slotted([slot=icon]) {
8796
- flex: none;
8797
9471
  color: var(--_label-text-color);
8798
9472
  --icon-size: var(--tab-icon-size, var(--_tab-icon-size));
8799
9473
  --icon-color: var(--_label-text-color);
8800
9474
  }
8801
9475
  .tab .tab-content ::slotted([slot=badge]) {
8802
- flex: none;
8803
- margin-inline-start: var(--_tab-badge-label-spacing, 0);
8804
9476
  --badge-color: var(--_tab-badge-color, var(--color-error));
8805
9477
  }
8806
- .tab.has-icon .tab-content {
8807
- gap: var(--_tab-icon-label-spacing);
8808
- }
8809
9478
  .tab .indicator {
8810
9479
  position: absolute;
8811
9480
  pointer-events: none;
8812
9481
  z-index: 1;
8813
- opacity: 0;
8814
9482
  background: var(--_active-indicator-color);
8815
9483
  border-radius: var(--_active-indicator-shape);
8816
- transform-origin: left bottom;
9484
+ transform: scaleX(0.6);
9485
+ transform-origin: center bottom;
8817
9486
  height: var(--_active-indicator-height);
8818
9487
  inset: auto 0px 0px;
8819
9488
  opacity: 0;
9489
+ transition: transform var(--duration-medium2) var(--easing-standard), opacity var(--duration-short4) var(--easing-standard);
9490
+ will-change: transform, opacity;
8820
9491
  }
8821
- .tab.has-content .slot-container {
8822
- display: flex;
8823
- flex: none;
8824
- justify-content: center;
9492
+ .tab .background {
9493
+ position: absolute;
9494
+ inset: 0;
9495
+ pointer-events: none;
9496
+ z-index: 0;
9497
+ opacity: 0;
9498
+ transform: scaleX(0.6);
9499
+ transform-origin: center center;
9500
+ transition: transform var(--duration-medium2) var(--easing-standard), opacity var(--duration-short4) var(--easing-standard), background-color var(--duration-short4) var(--easing-standard);
9501
+ will-change: transform, opacity;
9502
+ }
9503
+ .tab.has-content .slot-container {
9504
+ display: flex;
9505
+ flex: none;
9506
+ justify-content: center;
8825
9507
  }
8826
9508
  .tab.disabled {
8827
9509
  cursor: not-allowed;
@@ -8858,8 +9540,7 @@ var css_248z$a = i`* {
8858
9540
  border-end-end-radius: var(--_container-shape-end-end);
8859
9541
  }
8860
9542
 
8861
- :host-context([variant=line]) .tab {
8862
- --_tab-height: 100%;
9543
+ :host-context([variant=primary]) .tab {
8863
9544
  --_container-padding: 1rem;
8864
9545
  --_tab-icon-size: 1.5rem;
8865
9546
  --_tab-icon-label-spacing: 0.5rem;
@@ -8873,33 +9554,49 @@ var css_248z$a = i`* {
8873
9554
  --_container-shape-end-end: var(--shape-corner-small);
8874
9555
  --_active-indicator-color: var(--color-primary);
8875
9556
  --_active-indicator-shape: 3px 3px 0 0;
8876
- --_active-indicator-height: 3px;
9557
+ --_active-indicator-height: 2px;
8877
9558
  }
8878
- :host-context([variant=line]) .tab .focus-ring {
9559
+ :host-context([variant=primary]) .tab .focus-ring {
8879
9560
  inset: 3px 3px 4px 3px;
8880
9561
  }
8881
- :host-context([variant=line]) .tab.active .tab-content .indicator {
9562
+ :host-context([variant=primary]) .tab .tab-content {
9563
+ flex-direction: column;
9564
+ }
9565
+ :host-context([variant=primary]) .tab .tab-content .icon-section {
9566
+ position: relative;
9567
+ }
9568
+ :host-context([variant=primary]) .tab .tab-content .icon-section ::slotted([slot=badge]) {
9569
+ position: absolute;
9570
+ top: 0;
9571
+ left: calc(100% - 3px);
9572
+ }
9573
+ :host-context([variant=primary]) .tab .tab-content .icon-section ::slotted([slot=badge][value]) {
9574
+ position: absolute;
9575
+ top: 0;
9576
+ left: calc(100% - 6px);
9577
+ }
9578
+ :host-context([variant=primary]) .tab.active .indicator {
8882
9579
  opacity: 1;
9580
+ transform: scaleX(1);
8883
9581
  }
8884
- :host-context([variant=line]) .tab.active .focus-ring {
9582
+ :host-context([variant=primary]) .tab.active .focus-ring {
8885
9583
  inset: 3px 3px calc(4px + var(--_active-indicator-height)) 3px;
8886
9584
  }
8887
- :host-context([variant=line]) .tab:hover:not(:where(.disabled)) {
9585
+ :host-context([variant=primary]) .tab:hover:not(:where(.disabled)) {
8888
9586
  --_container-state-opacity: 0.08;
8889
9587
  }
8890
- :host-context([variant=line]) .tab.pressed:not(:where(.disabled)) {
9588
+ :host-context([variant=primary]) .tab.pressed:not(:where(.disabled)) {
8891
9589
  --_container-state-opacity: 0.12;
8892
9590
  }
8893
- :host-context([variant=line]) .tab.disabled {
9591
+ :host-context([variant=primary]) .tab.disabled {
8894
9592
  --_label-text-color: var(--color-on-surface);
8895
9593
  --_label-text-opacity: 0.38;
8896
9594
  }
8897
- :host-context([variant=line]) .tab.disabled .ripple {
9595
+ :host-context([variant=primary]) .tab.disabled .ripple {
8898
9596
  display: none;
8899
9597
  }
8900
9598
 
8901
- :host-context([variant=line-secondary]) .tab {
8902
- --_tab-height: 100%;
9599
+ :host-context([variant=secondary]) .tab {
8903
9600
  --_container-padding: 1rem;
8904
9601
  --_tab-icon-size: 1.25rem;
8905
9602
  --_tab-icon-label-spacing: 0.5rem;
@@ -8915,27 +9612,169 @@ var css_248z$a = i`* {
8915
9612
  --_active-indicator-shape: 0;
8916
9613
  --_active-indicator-height: 2px;
8917
9614
  }
8918
- :host-context([variant=line-secondary]) .tab .focus-ring {
9615
+ :host-context([variant=secondary]) .tab .focus-ring {
8919
9616
  inset: 3px 3px 4px 3px;
8920
9617
  }
8921
- :host-context([variant=line-secondary]) .tab.active .indicator.secondary {
9618
+ :host-context([variant=secondary]) .tab .tab-content ::slotted([slot=icon]) {
9619
+ margin-inline-end: var(--_tab-icon-label-spacing);
9620
+ }
9621
+ :host-context([variant=secondary]) .tab .tab-content ::slotted([slot=badge]) {
9622
+ margin-inline-start: var(--_tab-badge-label-spacing);
9623
+ }
9624
+ :host-context([variant=secondary]) .tab.active .indicator {
8922
9625
  opacity: 1;
9626
+ transform: scaleX(1);
8923
9627
  }
8924
- :host-context([variant=line-secondary]) .tab.active .focus-ring {
9628
+ :host-context([variant=secondary]) .tab.active .focus-ring {
8925
9629
  inset: 3px 3px calc(4px + var(--_active-indicator-height)) 3px;
8926
9630
  }
8927
- :host-context([variant=line-secondary]) .tab:hover:not(:where(.disabled)) {
9631
+ :host-context([variant=secondary]) .tab:hover:not(:where(.disabled)) {
9632
+ --_container-state-opacity: 0.08;
9633
+ }
9634
+ :host-context([variant=secondary]) .tab.pressed:not(:where(.disabled)) {
9635
+ --_container-state-opacity: 0.12;
9636
+ }
9637
+ :host-context([variant=secondary]) .tab.disabled {
9638
+ --_label-text-color: var(--color-on-surface);
9639
+ --_label-text-opacity: 0.38;
9640
+ }
9641
+ :host-context([variant=secondary]) .tab.disabled .ripple {
9642
+ display: none;
9643
+ }
9644
+
9645
+ :host-context([variant=filled]) .tab {
9646
+ --_container-padding: 1rem;
9647
+ --_tab-icon-size: 1.25rem;
9648
+ --_tab-icon-label-spacing: 0.5rem;
9649
+ --_tab-badge-label-spacing: 0.25rem;
9650
+ --_tab-badge-color: var(--color-error);
9651
+ --_label-text-color: var(--color-on-surface-variant);
9652
+ --_container-state-color: var(--color-on-surface);
9653
+ --_container-shape-start-start: var(--shape-corner-medium);
9654
+ --_container-shape-start-end: var(--shape-corner-medium);
9655
+ --_container-shape-end-start: var(--shape-corner-medium);
9656
+ --_container-shape-end-end: var(--shape-corner-medium);
9657
+ --_container-corner-shape-variant: squircle;
9658
+ --_active-surface-color: var(--color-surface);
9659
+ }
9660
+ :host-context([variant=filled]) .tab .focus-ring {
9661
+ inset: 2px;
9662
+ }
9663
+ :host-context([variant=filled]) .tab .tab-content ::slotted([slot=icon]) {
9664
+ margin-inline-end: var(--_tab-icon-label-spacing);
9665
+ }
9666
+ :host-context([variant=filled]) .tab .tab-content ::slotted([slot=badge]) {
9667
+ margin-inline-start: var(--_tab-badge-label-spacing);
9668
+ }
9669
+ :host-context([variant=filled]) .tab .indicator {
9670
+ display: none;
9671
+ }
9672
+ :host-context([variant=filled]) .tab .ripple {
9673
+ border-start-start-radius: var(--_container-shape-start-start);
9674
+ border-start-end-radius: var(--_container-shape-start-end);
9675
+ border-end-start-radius: var(--_container-shape-end-start);
9676
+ border-end-end-radius: var(--_container-shape-end-end);
9677
+ }
9678
+ :host-context([variant=filled]) .tab .background {
9679
+ corner-shape: var(--_container-corner-shape-variant);
9680
+ border-start-start-radius: var(--_container-shape-start-start);
9681
+ border-start-end-radius: var(--_container-shape-start-end);
9682
+ border-end-start-radius: var(--_container-shape-end-start);
9683
+ border-end-end-radius: var(--_container-shape-end-end);
9684
+ background: var(--_active-surface-color);
9685
+ }
9686
+ :host-context([variant=filled]) .tab.active {
9687
+ --_label-text-color: var(--color-on-surface);
9688
+ }
9689
+ :host-context([variant=filled]) .tab.active .background {
9690
+ opacity: 1;
9691
+ transform: scaleX(1);
9692
+ }
9693
+ :host-context([variant=filled]) .tab.active .ripple {
9694
+ display: none;
9695
+ }
9696
+ :host-context([variant=filled]) .tab:hover:not(:where(.disabled)) {
9697
+ --_container-state-opacity: 0.08;
9698
+ }
9699
+ :host-context([variant=filled]) .tab.pressed:not(:where(.disabled)) {
9700
+ --_container-state-opacity: 0.12;
9701
+ }
9702
+ :host-context([variant=filled]) .tab.disabled {
9703
+ --_label-text-color: var(--color-on-surface);
9704
+ --_label-text-opacity: 0.38;
9705
+ }
9706
+ :host-context([variant=filled]) .tab.disabled .ripple {
9707
+ display: none;
9708
+ }
9709
+
9710
+ :host-context([variant=contained]) .tab {
9711
+ --_container-padding: 1rem;
9712
+ --_tab-icon-size: 1.25rem;
9713
+ --_tab-icon-label-spacing: 0.5rem;
9714
+ --_tab-badge-label-spacing: 0.25rem;
9715
+ --_tab-badge-color: var(--color-error);
9716
+ --_label-text-color: var(--color-on-surface);
9717
+ --_container-state-color: var(--color-primary);
9718
+ --_container-shape-start-start: var(--shape-corner-small);
9719
+ --_container-shape-start-end: var(--shape-corner-small);
9720
+ --_container-shape-end-start: var(--shape-corner-small);
9721
+ --_container-shape-end-end: var(--shape-corner-small);
9722
+ --_container-corner-shape-variant: squircle;
9723
+ --_active-surface-color: var(--color-secondary-container);
9724
+ }
9725
+ :host-context([variant=contained]) .tab .focus-ring {
9726
+ inset: 2px;
9727
+ }
9728
+ :host-context([variant=contained]) .tab .tab-content ::slotted([slot=icon]) {
9729
+ margin-inline-end: var(--_tab-icon-label-spacing);
9730
+ }
9731
+ :host-context([variant=contained]) .tab .tab-content ::slotted([slot=badge]) {
9732
+ margin-inline-start: var(--_tab-badge-label-spacing);
9733
+ }
9734
+ :host-context([variant=contained]) .tab .indicator {
9735
+ display: none;
9736
+ }
9737
+ :host-context([variant=contained]) .tab .ripple {
9738
+ border-start-start-radius: var(--_container-shape-start-start);
9739
+ border-start-end-radius: var(--_container-shape-start-end);
9740
+ border-end-start-radius: var(--_container-shape-end-start);
9741
+ border-end-end-radius: var(--_container-shape-end-end);
9742
+ }
9743
+ :host-context([variant=contained]) .tab .background {
9744
+ corner-shape: var(--_container-corner-shape-variant);
9745
+ border-start-start-radius: var(--_container-shape-start-start);
9746
+ border-start-end-radius: var(--_container-shape-start-end);
9747
+ border-end-start-radius: var(--_container-shape-end-start);
9748
+ border-end-end-radius: var(--_container-shape-end-end);
9749
+ background: var(--_active-surface-color);
9750
+ }
9751
+ :host-context([variant=contained]) .tab.active {
9752
+ --_label-text-color: var(--color-on-secondary-container);
9753
+ }
9754
+ :host-context([variant=contained]) .tab.active .background {
9755
+ opacity: 1;
9756
+ transform: scaleX(1);
9757
+ }
9758
+ :host-context([variant=contained]) .tab:hover:not(:where(.disabled)) {
8928
9759
  --_container-state-opacity: 0.08;
8929
9760
  }
8930
- :host-context([variant=line-secondary]) .tab.pressed:not(:where(.disabled)) {
9761
+ :host-context([variant=contained]) .tab.pressed:not(:where(.disabled)) {
8931
9762
  --_container-state-opacity: 0.12;
8932
9763
  }
8933
- :host-context([variant=line-secondary]) .tab.disabled {
9764
+ :host-context([variant=contained]) .tab.disabled {
8934
9765
  --_label-text-color: var(--color-on-surface);
8935
9766
  --_label-text-opacity: 0.38;
8936
9767
  }
8937
- :host-context([variant=line-secondary]) .tab.disabled .ripple {
9768
+ :host-context([variant=contained]) .tab.disabled .ripple {
8938
9769
  display: none;
9770
+ }
9771
+
9772
+ @media (prefers-reduced-motion: reduce) {
9773
+ .tab .tab-content,
9774
+ .tab .indicator,
9775
+ .tab .background {
9776
+ transition: none;
9777
+ }
8939
9778
  }`;
8940
9779
 
8941
9780
  var _Tab_id;
@@ -9038,6 +9877,9 @@ class Tab extends i$1 {
9038
9877
  __isLink() {
9039
9878
  return !!this.href;
9040
9879
  }
9880
+ __getParentTabsVariant() {
9881
+ return this.closest('wc-tabs')?.variant ?? 'primary';
9882
+ }
9041
9883
  // private handleKeyDown(evt: KeyboardEvent) {
9042
9884
  // if (this.disabled || this.showLoader) return;
9043
9885
  // if (evt.key === 'Enter' || evt.key === ' ') {
@@ -9048,13 +9890,15 @@ class Tab extends i$1 {
9048
9890
  // }
9049
9891
  render() {
9050
9892
  const isLink = this.__isLink();
9893
+ const variant = this.__getParentTabsVariant();
9051
9894
  const cssClasses = {
9052
9895
  tab: true,
9053
9896
  'tab-element': true,
9054
9897
  disabled: this.disabled,
9055
9898
  pressed: this.isPressed,
9056
9899
  active: this.active,
9057
- 'has-content': this.slotHasContent || !!this.label,
9900
+ [`variant-${variant}`]: true,
9901
+ 'has-content': this.slotHasContent,
9058
9902
  'has-icon': this.slotHasIcon,
9059
9903
  'has-badge': this.slotHasBadge,
9060
9904
  };
@@ -9070,7 +9914,7 @@ class Tab extends i$1 {
9070
9914
  ?disabled=${this.disabled}
9071
9915
  ${spread(this.configAria)}
9072
9916
  >
9073
- ${this.renderTabContent()}
9917
+ ${this.renderTabContent(variant)}
9074
9918
  </button>`;
9075
9919
  }
9076
9920
  return b `<a
@@ -9087,30 +9931,94 @@ class Tab extends i$1 {
9087
9931
  aria-disabled=${`${this.disabled}`}
9088
9932
  ${spread(this.configAria)}
9089
9933
  >
9090
- ${this.renderTabContent()}
9934
+ ${this.renderTabContent(variant)}
9091
9935
  </a>`;
9092
9936
  }
9093
- renderTabContent() {
9937
+ renderTabContent(variant) {
9938
+ switch (variant) {
9939
+ case 'secondary':
9940
+ return this.renderSecondaryTabContent();
9941
+ case 'contained':
9942
+ return this.renderContainedTabContent();
9943
+ case 'filled':
9944
+ return this.renderFilledTabContent();
9945
+ case 'primary':
9946
+ default:
9947
+ return this.renderPrimaryTabContent();
9948
+ }
9949
+ }
9950
+ renderPrimaryTabContent() {
9951
+ return b `
9952
+ <wc-focus-ring class="focus-ring" .control=${this} .forElement=${this.tabElement}></wc-focus-ring>
9953
+ <wc-elevation class="elevation"></wc-elevation>
9954
+ <div class="background"></div>
9955
+ <div class="outline"></div>
9956
+ <wc-ripple class="ripple"></wc-ripple>
9957
+
9958
+ <div class="tab-content">
9959
+
9960
+ <div class="icon-section">
9961
+ <slot name="badge"></slot>
9962
+ <slot name="icon"></slot>
9963
+ </div>
9964
+ <div class="slot-container">
9965
+ <slot></slot>
9966
+ </div>
9967
+
9968
+ <div class="indicator"></div>
9969
+
9970
+ </div>
9971
+
9972
+ ${this.__renderDisabledReason()}
9973
+ `;
9974
+ }
9975
+ renderSecondaryTabContent() {
9094
9976
  return b `
9095
- <wc-focus-ring class="focus-ring" .control=${this} element="tabElement"></wc-focus-ring>
9977
+ <wc-focus-ring class="focus-ring" .control=${this} .forElement=${this.tabElement}></wc-focus-ring>
9096
9978
  <wc-elevation class="elevation"></wc-elevation>
9097
9979
  <div class="background"></div>
9098
9980
  <div class="outline"></div>
9099
9981
  <wc-ripple class="ripple"></wc-ripple>
9100
9982
 
9101
9983
  <div class="tab-content">
9984
+
9102
9985
  <slot name="icon"></slot>
9103
9986
 
9104
9987
  <div class="slot-container">
9105
- <slot>${this.label || A}</slot>
9988
+ <slot></slot>
9106
9989
  </div>
9107
9990
 
9108
9991
  <slot name="badge"></slot>
9109
-
9110
- <div class="indicator"></div>
9111
9992
  </div>
9112
9993
 
9113
- <div class="secondary indicator"></div>
9994
+ <div class="indicator"></div>
9995
+
9996
+ ${this.__renderDisabledReason()}
9997
+ `;
9998
+ }
9999
+ renderContainedTabContent() {
10000
+ return this.renderSegmentedTabContent();
10001
+ }
10002
+ renderFilledTabContent() {
10003
+ return this.renderSegmentedTabContent();
10004
+ }
10005
+ renderSegmentedTabContent() {
10006
+ return b `
10007
+ <wc-focus-ring class="focus-ring" .control=${this} .forElement=${this.tabElement}></wc-focus-ring>
10008
+ <wc-elevation class="elevation"></wc-elevation>
10009
+ <div class="background"></div>
10010
+ <div class="outline"></div>
10011
+ <wc-ripple class="ripple"></wc-ripple>
10012
+
10013
+ <div class="tab-content">
10014
+ <slot name="icon"></slot>
10015
+
10016
+ <div class="slot-container">
10017
+ <slot></slot>
10018
+ </div>
10019
+
10020
+ <slot name="badge"></slot>
10021
+ </div>
9114
10022
 
9115
10023
  ${this.__renderDisabledReason()}
9116
10024
  `;
@@ -9135,7 +10043,7 @@ class Tab extends i$1 {
9135
10043
  }
9136
10044
  }
9137
10045
  _Tab_id = new WeakMap();
9138
- Tab.styles = [css_248z$a];
10046
+ Tab.styles = [css_248z$b];
9139
10047
  __decorate([
9140
10048
  n({ type: Boolean, reflect: true })
9141
10049
  ], Tab.prototype, "active", void 0);
@@ -9145,9 +10053,6 @@ __decorate([
9145
10053
  __decorate([
9146
10054
  n({ type: String })
9147
10055
  ], Tab.prototype, "disabledReason", void 0);
9148
- __decorate([
9149
- n({ type: String })
9150
- ], Tab.prototype, "label", void 0);
9151
10056
  __decorate([
9152
10057
  n({ type: String })
9153
10058
  ], Tab.prototype, "value", void 0);
@@ -9182,7 +10087,7 @@ __decorate([
9182
10087
  e$4('.tab-element')
9183
10088
  ], Tab.prototype, "tabElement", void 0);
9184
10089
 
9185
- var css_248z$9 = i`* {
10090
+ var css_248z$a = i`* {
9186
10091
  box-sizing: border-box;
9187
10092
  }
9188
10093
 
@@ -9196,7 +10101,7 @@ var css_248z$9 = i`* {
9196
10101
  height: 100%;
9197
10102
  }`;
9198
10103
 
9199
- var css_248z$8 = i`* {
10104
+ var css_248z$9 = i`* {
9200
10105
  box-sizing: border-box;
9201
10106
  }
9202
10107
 
@@ -9208,14 +10113,44 @@ var css_248z$8 = i`* {
9208
10113
  display: flex;
9209
10114
  position: relative;
9210
10115
  width: 100%;
10116
+ height: var(--tabs-height);
10117
+ }
10118
+
10119
+ :host([variant=primary]) {
10120
+ --tabs-height: 4rem;
10121
+ }
10122
+ :host([variant=primary]) .tabs {
10123
+ border-bottom: 1px solid var(--color-surface-variant);
9211
10124
  }
9212
10125
 
9213
- :host-context([variant=line]), :host([variant=line]) {
10126
+ :host([variant=secondary]) {
9214
10127
  --tabs-height: 3rem;
9215
10128
  }
9216
- :host-context([variant=line]) .tabs, :host([variant=line]) .tabs {
9217
- height: var(--tabs-height);
10129
+ :host([variant=secondary]) .tabs {
9218
10130
  border-bottom: 1px solid var(--color-surface-variant);
10131
+ }
10132
+
10133
+ :host([variant=filled]) {
10134
+ --tabs-height: 3rem;
10135
+ }
10136
+ :host([variant=filled]) .tabs {
10137
+ align-items: stretch;
10138
+ gap: 0.25rem;
10139
+ padding: 0.25rem;
10140
+ border-radius: var(--shape-corner-small);
10141
+ background: var(--color-surface-container-high);
10142
+ }
10143
+
10144
+ :host([variant=contained]) {
10145
+ --tabs-height: 3rem;
10146
+ }
10147
+ :host([variant=contained]) .tabs {
10148
+ align-items: stretch;
10149
+ gap: 0.25rem;
10150
+ padding: 0.25rem;
10151
+ border-radius: var(--shape-corner-extra-small);
10152
+ border: 1px solid var(--color-outline-variant);
10153
+ background: var(--color-surface);
9219
10154
  }`;
9220
10155
 
9221
10156
  /**
@@ -9230,7 +10165,7 @@ var css_248z$8 = i`* {
9230
10165
  * @example
9231
10166
  * ```html
9232
10167
  * <wc-tabs>
9233
- * <wc-tab>Tab 1</wc-tab>
10168
+ * <wc-tab active>Tab 1</wc-tab>
9234
10169
  * <wc-tab>Tab 2</wc-tab>
9235
10170
  * </wc-tabs>
9236
10171
  * ```
@@ -9239,6 +10174,7 @@ var css_248z$8 = i`* {
9239
10174
  class Tabs extends i$1 {
9240
10175
  constructor() {
9241
10176
  super(...arguments);
10177
+ this.variant = 'primary';
9242
10178
  this.managed = false;
9243
10179
  this.__handleTabClick = (event) => {
9244
10180
  if (this.managed)
@@ -9248,7 +10184,8 @@ class Tabs extends i$1 {
9248
10184
  const clickedTab = path.find(node => node instanceof Element && node.tagName.toLowerCase() === 'wc-tab');
9249
10185
  if (!clickedTab)
9250
10186
  return;
9251
- const tabs = Array.from(this.querySelectorAll('wc-tab'));
10187
+ const previousActiveTab = this.__getActiveTab();
10188
+ const tabs = this.__getTabs();
9252
10189
  let clickedIndex = -1;
9253
10190
  for (let index = 0; index < tabs.length; index += 1) {
9254
10191
  const tab = tabs[index];
@@ -9257,6 +10194,8 @@ class Tabs extends i$1 {
9257
10194
  clickedIndex = index;
9258
10195
  }
9259
10196
  clickedTab.active = true;
10197
+ this.__animateIndicatorTransition(previousActiveTab, clickedTab);
10198
+ this.__lastActiveTab = clickedTab;
9260
10199
  this.dispatchEvent(new CustomEvent('tab-click', {
9261
10200
  bubbles: true,
9262
10201
  composed: true,
@@ -9271,10 +10210,96 @@ class Tabs extends i$1 {
9271
10210
  super.connectedCallback();
9272
10211
  this.addEventListener('click', this.__handleTabClick);
9273
10212
  }
10213
+ firstUpdated() {
10214
+ this.__mutationObserver = new MutationObserver(() => {
10215
+ this.__syncIndicatorsFromActiveState();
10216
+ });
10217
+ this.__mutationObserver.observe(this, {
10218
+ subtree: true,
10219
+ childList: true,
10220
+ attributes: true,
10221
+ attributeFilter: ['active', 'disabled'],
10222
+ });
10223
+ this.__lastActiveTab = this.__getActiveTab();
10224
+ }
10225
+ updated(changedProperties) {
10226
+ if (changedProperties.has('variant')) {
10227
+ this.__lastActiveTab = this.__getActiveTab();
10228
+ }
10229
+ }
9274
10230
  disconnectedCallback() {
10231
+ this.__mutationObserver?.disconnect();
9275
10232
  this.removeEventListener('click', this.__handleTabClick);
9276
10233
  super.disconnectedCallback();
9277
10234
  }
10235
+ __getTabs() {
10236
+ return Array.from(this.querySelectorAll('wc-tab'));
10237
+ }
10238
+ __getActiveTab() {
10239
+ return this.__getTabs().find(tab => tab.active && !tab.disabled);
10240
+ }
10241
+ static __getTabIndicator(tab) {
10242
+ if (!tab?.shadowRoot)
10243
+ return undefined;
10244
+ return tab.shadowRoot.querySelector('.indicator');
10245
+ }
10246
+ static __getTabBackground(tab) {
10247
+ if (!tab?.shadowRoot)
10248
+ return undefined;
10249
+ return tab.shadowRoot.querySelector('.background');
10250
+ }
10251
+ __getAnimationElements(previousTab, nextTab) {
10252
+ if (this.variant === 'primary' || this.variant === 'secondary') {
10253
+ return {
10254
+ previous: Tabs.__getTabIndicator(previousTab),
10255
+ next: Tabs.__getTabIndicator(nextTab),
10256
+ };
10257
+ }
10258
+ if (this.variant === 'filled' || this.variant === 'contained') {
10259
+ return {
10260
+ previous: Tabs.__getTabBackground(previousTab),
10261
+ next: Tabs.__getTabBackground(nextTab),
10262
+ };
10263
+ }
10264
+ return {
10265
+ previous: undefined,
10266
+ next: undefined,
10267
+ };
10268
+ }
10269
+ __animateIndicatorTransition(previousTab, nextTab) {
10270
+ if (!previousTab || !nextTab || previousTab === nextTab)
10271
+ return;
10272
+ const { previous: previousAnimationElement, next: nextAnimationElement } = this.__getAnimationElements(previousTab, nextTab);
10273
+ if (!previousAnimationElement || !nextAnimationElement)
10274
+ return;
10275
+ const previousRect = previousTab.getBoundingClientRect();
10276
+ const nextRect = nextTab.getBoundingClientRect();
10277
+ const incomingOffset = previousRect.left - nextRect.left;
10278
+ const outgoingOffset = nextRect.left - previousRect.left;
10279
+ const incomingScale = previousRect.width / nextRect.width;
10280
+ const outgoingScale = nextRect.width / previousRect.width;
10281
+ nextAnimationElement.style.transition = 'none';
10282
+ nextAnimationElement.style.opacity = '0';
10283
+ nextAnimationElement.style.transform = `translateX(${incomingOffset}px) scaleX(${incomingScale})`;
10284
+ previousAnimationElement.style.transition = 'none';
10285
+ previousAnimationElement.style.opacity = '1';
10286
+ previousAnimationElement.style.transform = 'translateX(0) scaleX(1)';
10287
+ requestAnimationFrame(() => {
10288
+ nextAnimationElement.style.transition = '';
10289
+ previousAnimationElement.style.transition = '';
10290
+ nextAnimationElement.style.opacity = '1';
10291
+ nextAnimationElement.style.transform = 'translateX(0) scaleX(1)';
10292
+ previousAnimationElement.style.opacity = '0';
10293
+ previousAnimationElement.style.transform = `translateX(${outgoingOffset}px) scaleX(${outgoingScale})`;
10294
+ });
10295
+ }
10296
+ __syncIndicatorsFromActiveState() {
10297
+ const activeTab = this.__getActiveTab();
10298
+ if (this.__lastActiveTab && activeTab && this.__lastActiveTab !== activeTab) {
10299
+ this.__animateIndicatorTransition(this.__lastActiveTab, activeTab);
10300
+ }
10301
+ this.__lastActiveTab = activeTab;
10302
+ }
9278
10303
  render() {
9279
10304
  return b `
9280
10305
  <div class="tabs">
@@ -9283,13 +10308,16 @@ class Tabs extends i$1 {
9283
10308
  `;
9284
10309
  }
9285
10310
  }
9286
- Tabs.styles = [css_248z$8];
10311
+ Tabs.styles = [css_248z$9];
9287
10312
  Tabs.Tab = Tab;
10313
+ __decorate([
10314
+ n({ reflect: true })
10315
+ ], Tabs.prototype, "variant", void 0);
9288
10316
  __decorate([
9289
10317
  n({ type: Boolean })
9290
10318
  ], Tabs.prototype, "managed", void 0);
9291
10319
 
9292
- var css_248z$7 = i`* {
10320
+ var css_248z$8 = i`* {
9293
10321
  box-sizing: border-box;
9294
10322
  }
9295
10323
 
@@ -9331,7 +10359,7 @@ class TabPanel extends i$1 {
9331
10359
  return b `<slot></slot>`;
9332
10360
  }
9333
10361
  }
9334
- TabPanel.styles = [css_248z$7];
10362
+ TabPanel.styles = [css_248z$8];
9335
10363
  __decorate([
9336
10364
  n({ reflect: true })
9337
10365
  ], TabPanel.prototype, "value", void 0);
@@ -9366,7 +10394,6 @@ __decorate([
9366
10394
  class TabGroup extends i$1 {
9367
10395
  constructor() {
9368
10396
  super(...arguments);
9369
- this.variant = 'line';
9370
10397
  this.onTabClick = (event) => {
9371
10398
  const custom = event;
9372
10399
  event.stopPropagation();
@@ -9485,14 +10512,11 @@ class TabGroup extends i$1 {
9485
10512
  return b `<slot></slot>`;
9486
10513
  }
9487
10514
  }
9488
- TabGroup.styles = [css_248z$9];
10515
+ TabGroup.styles = [css_248z$a];
9489
10516
  TabGroup.Tabs = Tabs;
9490
10517
  TabGroup.TabPanel = TabPanel;
9491
- __decorate([
9492
- n({ reflect: true })
9493
- ], TabGroup.prototype, "variant", void 0);
9494
10518
 
9495
- var css_248z$6 = i`:host {
10519
+ var css_248z$7 = i`:host {
9496
10520
  --_track-height: 4px;
9497
10521
  --_thumb-size: 20px;
9498
10522
  --thumb-half: 10px;
@@ -9508,6 +10532,17 @@ var css_248z$6 = i`:host {
9508
10532
  touch-action: none;
9509
10533
  }
9510
10534
 
10535
+ .slider {
10536
+ display: flex;
10537
+ align-items: center;
10538
+ gap: var(--spacing-100, 0.5rem);
10539
+ width: 100%;
10540
+ }
10541
+
10542
+ .slider.with-value .slider-container {
10543
+ flex: 1;
10544
+ }
10545
+
9511
10546
  .slider-container {
9512
10547
  position: relative;
9513
10548
  display: flex;
@@ -9521,6 +10556,14 @@ var css_248z$6 = i`:host {
9521
10556
  opacity: 0.38;
9522
10557
  }
9523
10558
 
10559
+ .value-display {
10560
+ min-width: 2.25rem;
10561
+ text-align: end;
10562
+ color: var(--color-on-surface-variant);
10563
+ font-size: 0.875rem;
10564
+ font-weight: 500;
10565
+ }
10566
+
9524
10567
  .track {
9525
10568
  position: absolute;
9526
10569
  width: 100%;
@@ -9534,7 +10577,6 @@ var css_248z$6 = i`:host {
9534
10577
  position: absolute;
9535
10578
  height: 100%;
9536
10579
  background-color: var(--_active-track-color);
9537
- transition: width 0.1s ease-out;
9538
10580
  will-change: width;
9539
10581
  }
9540
10582
 
@@ -9657,6 +10699,10 @@ class Slider extends i$1 {
9657
10699
  * Whether to show labels on the slider.
9658
10700
  */
9659
10701
  this.labeled = true;
10702
+ /**
10703
+ * Whether to show the current value beside the slider.
10704
+ */
10705
+ this.showValue = false;
9660
10706
  this.isDragging = false;
9661
10707
  this.onMouseMove = (e) => {
9662
10708
  if (this.isDragging) {
@@ -9739,33 +10785,38 @@ class Slider extends i$1 {
9739
10785
  render() {
9740
10786
  const percentage = ((this.value - this.min) / (this.max - this.min)) * 100;
9741
10787
  return b `
9742
- <div
9743
- class="slider-container ${this.disabled ? 'disabled' : ''}"
9744
- @mousedown=${this.onMouseDown}
9745
- @touchstart=${this.onMouseDown}
9746
- >
9747
- <div class="track">
9748
- <div class="track-active" style=${o$3({ width: `${percentage}%` })}></div>
9749
- </div>
9750
-
10788
+ <div class="slider ${this.showValue ? 'with-value' : ''}">
9751
10789
  <div
9752
- class="thumb"
9753
- role="slider"
9754
- tabindex="${this.disabled ? -1 : 0}"
9755
- aria-valuemin=${this.min}
9756
- aria-valuemax=${this.max}
9757
- aria-valuenow=${this.value}
9758
- aria-disabled=${this.disabled}
9759
- style=${o$3({ left: `calc(${percentage}% - var(--thumb-half))` })}
9760
- @keydown=${this.handleKeyDown}
10790
+ class="slider-container ${this.disabled ? 'disabled' : ''}"
10791
+ @mousedown=${this.onMouseDown}
10792
+ @touchstart=${this.onMouseDown}
9761
10793
  >
9762
- ${this.labeled ? b `<div class="value-label">${this.value}</div>` : ''}
10794
+ <div class="track">
10795
+ <div class="track-active" style=${o$2({ width: `${percentage}%` })}></div>
10796
+ </div>
10797
+
10798
+ <div
10799
+ class="thumb"
10800
+ role="slider"
10801
+ aria-label="Slider"
10802
+ tabindex="${this.disabled ? -1 : 0}"
10803
+ aria-valuemin=${this.min}
10804
+ aria-valuemax=${this.max}
10805
+ aria-valuenow=${this.value}
10806
+ aria-disabled=${this.disabled}
10807
+ style=${o$2({ left: `calc(${percentage}% - var(--thumb-half))` })}
10808
+ @keydown=${this.handleKeyDown}
10809
+ >
10810
+ ${this.labeled ? b `<div class="value-label">${this.value}</div>` : ''}
10811
+ </div>
9763
10812
  </div>
10813
+
10814
+ ${this.showValue ? b `<output class="value-display" aria-live="polite">${this.value}</output>` : ''}
9764
10815
  </div>
9765
10816
  `;
9766
10817
  }
9767
10818
  }
9768
- Slider.styles = [css_248z$6];
10819
+ Slider.styles = [css_248z$7];
9769
10820
  __decorate([
9770
10821
  n({ type: Number })
9771
10822
  ], Slider.prototype, "min", void 0);
@@ -9784,6 +10835,9 @@ __decorate([
9784
10835
  __decorate([
9785
10836
  n({ type: Boolean })
9786
10837
  ], Slider.prototype, "labeled", void 0);
10838
+ __decorate([
10839
+ n({ type: Boolean, attribute: 'show-value' })
10840
+ ], Slider.prototype, "showValue", void 0);
9787
10841
  __decorate([
9788
10842
  r()
9789
10843
  ], Slider.prototype, "isDragging", void 0);
@@ -9794,7 +10848,7 @@ __decorate([
9794
10848
  e$4('.thumb')
9795
10849
  ], Slider.prototype, "thumbElement", void 0);
9796
10850
 
9797
- var css_248z$5 = i`* {
10851
+ var css_248z$6 = i`* {
9798
10852
  box-sizing: border-box;
9799
10853
  }
9800
10854
 
@@ -10328,7 +11382,7 @@ class Table extends i$1 {
10328
11382
  `;
10329
11383
  }
10330
11384
  }
10331
- Table.styles = [css_248z$5];
11385
+ Table.styles = [css_248z$6];
10332
11386
  __decorate([
10333
11387
  n({ type: Array })
10334
11388
  ], Table.prototype, "columns", void 0);
@@ -10387,7 +11441,7 @@ __decorate([
10387
11441
  r()
10388
11442
  ], Table.prototype, "isHorizontallyScrolled", void 0);
10389
11443
 
10390
- var css_248z$4 = i`* {
11444
+ var css_248z$5 = i`* {
10391
11445
  box-sizing: border-box;
10392
11446
  }
10393
11447
 
@@ -10400,59 +11454,67 @@ var css_248z$4 = i`* {
10400
11454
  }
10401
11455
 
10402
11456
  .pagination {
10403
- background: var(--color-surface, #fff);
10404
11457
  display: flex;
10405
11458
  align-items: center;
11459
+ justify-content: flex-end;
11460
+ gap: var(--spacing-200, 1rem);
11461
+ background: var(--color-surface, #fff);
11462
+ padding: var(--spacing-150, 0.75rem) var(--spacing-200, 1rem);
11463
+ }
11464
+ @media (max-width: 48rem) {
11465
+ .pagination {
11466
+ flex-wrap: wrap;
11467
+ justify-content: space-between;
11468
+ row-gap: var(--spacing-100, 0.5rem);
11469
+ }
10406
11470
  }
10407
- .pagination .page-sizes-select {
10408
- margin-inline-start: var(--spacing-100, 0.5rem);
11471
+ .pagination .page-size {
11472
+ display: inline-flex;
11473
+ align-items: center;
11474
+ gap: var(--spacing-100, 0.5rem);
11475
+ min-inline-size: max-content;
10409
11476
  }
10410
11477
  .pagination .page-size-label {
11478
+ font-family: var(--typography-body-small-font-family);
11479
+ font-size: var(--typography-body-small-font-size);
11480
+ font-weight: var(--typography-body-small-font-weight);
11481
+ line-height: var(--typography-body-small-line-height);
11482
+ letter-spacing: var(--typography-body-small-letter-spacing);
11483
+ color: var(--color-on-surface-variant);
11484
+ white-space: nowrap;
11485
+ }
11486
+ .pagination .page-size-select {
11487
+ inline-size: 5.5rem;
11488
+ min-inline-size: 5.5rem;
11489
+ --field-container-height: 2.5rem;
11490
+ }
11491
+ .pagination .pagination-item-count {
11492
+ margin-inline-start: auto;
10411
11493
  display: flex;
10412
11494
  align-items: center;
10413
- gap: var(--spacing-100, 0.5rem);
11495
+ }
11496
+ @media (max-width: 48rem) {
11497
+ .pagination .pagination-item-count {
11498
+ order: 3;
11499
+ margin-inline-start: 0;
11500
+ inline-size: 100%;
11501
+ }
11502
+ }
11503
+ .pagination .pagination-text {
10414
11504
  font-family: var(--typography-body-medium-font-family);
10415
11505
  font-size: var(--typography-body-medium-font-size);
10416
11506
  font-weight: var(--typography-body-medium-font-weight);
10417
11507
  line-height: var(--typography-body-medium-line-height);
10418
11508
  letter-spacing: var(--typography-body-medium-letter-spacing);
10419
11509
  color: var(--color-on-surface-variant);
10420
- white-space: nowrap;
10421
11510
  }
10422
- .pagination .page-size-select {
10423
- border: 1px solid var(--color-outline-variant);
10424
- background: var(--color-surface, #fff);
10425
- color: var(--color-on-surface);
10426
- padding: var(--spacing-050, 0.25rem) var(--spacing-100, 0.5rem);
10427
- cursor: pointer;
10428
- outline: none;
10429
- height: 2.5rem;
10430
- font-family: var(--typography-body-medium-font-family);
10431
- font-size: var(--typography-body-medium-font-size);
10432
- font-weight: var(--typography-body-medium-font-weight);
10433
- line-height: var(--typography-body-medium-line-height);
10434
- letter-spacing: var(--typography-body-medium-letter-spacing);
10435
- }
10436
- .pagination .page-size-select:focus {
10437
- outline: 2px solid var(--color-primary);
10438
- }
10439
- .pagination .pagination-item-count {
10440
- margin-inline-start: var(--spacing-150, 0.75rem);
10441
- flex: 1;
10442
- display: flex;
11511
+ .pagination .pagination-actions {
11512
+ display: inline-flex;
10443
11513
  align-items: center;
11514
+ gap: var(--spacing-025, 0.125rem);
10444
11515
  }
10445
- .pagination .pagination-text {
10446
- font-family: var(--typography-body-medium-font-family);
10447
- font-size: var(--typography-body-medium-font-size);
10448
- font-weight: var(--typography-body-medium-font-weight);
10449
- line-height: var(--typography-body-medium-line-height);
10450
- letter-spacing: var(--typography-body-medium-letter-spacing);
10451
- color: var(--color-on-surface-variant);
10452
- }
10453
- .pagination .arrows {
10454
- --border-radius: 0;
10455
- --button-height: calc(2.5rem - 2px);
11516
+ .pagination .nav-button {
11517
+ --button-container-shape: 999px;
10456
11518
  }`;
10457
11519
 
10458
11520
  const DEFAULT_PAGE_SIZES = [10, 25, 50, 100];
@@ -10468,7 +11530,7 @@ const DEFAULT_PAGE_SIZES = [10, 25, 50, 100];
10468
11530
  *
10469
11531
  * @example
10470
11532
  * ```html
10471
- * <wc-pagination page="1" page-size="10" total-items="100"></wc-pagination>
11533
+ * <wc-pagination style="width: 100%;" page="1" page-size="10" total-items="100"></wc-pagination>
10472
11534
  * ```
10473
11535
  * @tags navigation, data
10474
11536
  */
@@ -10491,6 +11553,62 @@ class Pagination extends i$1 {
10491
11553
  * Supported page size options.
10492
11554
  */
10493
11555
  this.pageSizes = DEFAULT_PAGE_SIZES;
11556
+ this.handlePreviousPage = () => {
11557
+ this.setPage(this.page - 1);
11558
+ };
11559
+ this.handleNextPage = () => {
11560
+ this.setPage(this.page + 1);
11561
+ };
11562
+ }
11563
+ willUpdate(changedProperties) {
11564
+ // Normalize page-size options so the select always has valid numeric values.
11565
+ const normalizedPageSizes = [...new Set(this.pageSizes
11566
+ .map(size => Number(size))
11567
+ .filter(size => Number.isFinite(size) && size > 0)
11568
+ .map(size => Math.trunc(size)))];
11569
+ if (!normalizedPageSizes.length) {
11570
+ normalizedPageSizes.push(...DEFAULT_PAGE_SIZES);
11571
+ }
11572
+ if (changedProperties.has('pageSizes') &&
11573
+ (this.pageSizes.length !== normalizedPageSizes.length ||
11574
+ this.pageSizes.some((size, index) => size !== normalizedPageSizes[index]))) {
11575
+ this.pageSizes = normalizedPageSizes;
11576
+ }
11577
+ if (!this.pageSizes.includes(this.pageSize)) {
11578
+ this.pageSize = this.pageSizes[0] ?? DEFAULT_PAGE_SIZES[0];
11579
+ }
11580
+ if (!Number.isFinite(this.totalItems) || this.totalItems < 0) {
11581
+ this.totalItems = 0;
11582
+ }
11583
+ if (!Number.isFinite(this.page) || this.page < 1) {
11584
+ this.page = 1;
11585
+ }
11586
+ const maxPage = this.getTotalPages();
11587
+ if (this.page > maxPage) {
11588
+ this.page = maxPage;
11589
+ }
11590
+ }
11591
+ getTotalPages() {
11592
+ if (this.totalItems <= 0)
11593
+ return 1;
11594
+ return Math.max(1, Math.ceil(this.totalItems / this.pageSize));
11595
+ }
11596
+ setPage(nextPage) {
11597
+ const clampedPage = Math.min(Math.max(1, nextPage), this.getTotalPages());
11598
+ if (clampedPage === this.page)
11599
+ return;
11600
+ this.page = clampedPage;
11601
+ this.dispatchPageEvent();
11602
+ }
11603
+ handlePageSizeChange(event) {
11604
+ const rawValue = event.detail?.value;
11605
+ const parsedPageSize = Number.parseInt(rawValue ?? '', 10);
11606
+ if (!Number.isFinite(parsedPageSize) || parsedPageSize <= 0) {
11607
+ return;
11608
+ }
11609
+ this.pageSize = parsedPageSize;
11610
+ this.page = 1;
11611
+ this.dispatchPageEvent();
10494
11612
  }
10495
11613
  dispatchPageEvent() {
10496
11614
  this.dispatchEvent(new CustomEvent('page', {
@@ -10500,76 +11618,57 @@ class Pagination extends i$1 {
10500
11618
  }));
10501
11619
  }
10502
11620
  render() {
10503
- const startItem = this.pageSize * (this.page - 1);
11621
+ const startItem = this.totalItems === 0 ? 0 : this.pageSize * (this.page - 1) + 1;
10504
11622
  const endItem = Math.min(this.pageSize * this.page, this.totalItems);
10505
11623
  const isFirstPage = this.page === 1;
10506
11624
  const isLastPage = this.pageSize * this.page >= this.totalItems;
10507
11625
  return b `
10508
11626
  <div class="pagination">
10509
- <div class="page-sizes-select">
10510
- <label class="page-size-label">
10511
- Items per page:
10512
- <select
10513
- class="page-size-select"
10514
- .value=${String(this.pageSize)}
10515
- @change=${(e) => {
10516
- this.pageSize = parseInt(e.target.value, 10);
10517
- this.page = 1;
10518
- this.dispatchPageEvent();
10519
- }}
10520
- >
10521
- ${this.pageSizes.map(size => b `
10522
- <option value=${size} ?selected=${this.pageSize === size}>
10523
- ${size}
10524
- </option>
10525
- `)}
10526
- </select>
10527
- </label>
11627
+ <div class="page-size">
11628
+ <span class="page-size-label">Items per page:</span>
11629
+ <wc-select
11630
+ class="page-size-select"
11631
+ .value=${String(this.pageSize)}
11632
+ aria-label="Items per page"
11633
+ @change=${this.handlePageSizeChange}
11634
+ >
11635
+ ${this.pageSizes.map(size => b `<wc-option value=${String(size)}>${size}</wc-option>`)}
11636
+ </wc-select>
10528
11637
  </div>
11638
+
10529
11639
  <div class="pagination-item-count">
10530
11640
  <span class="pagination-text">
10531
- ${startItem} - ${endItem} of ${this.totalItems} items
11641
+ ${startItem} - ${endItem} of ${this.totalItems}
10532
11642
  </span>
10533
11643
  </div>
10534
- <div class="pagination-right">
10535
- <div class="table-footer-right-content">
10536
- <div class="table-footer-right-content-pagination">
10537
- <wc-button
10538
- class="arrows"
10539
- color="secondary"
10540
- variant="text"
10541
- ?disabled=${isFirstPage}
10542
- @click=${() => {
10543
- if (!isFirstPage) {
10544
- this.page -= 1;
10545
- this.dispatchPageEvent();
10546
- }
10547
- }}
10548
- >
10549
- <wc-icon slot="icon" name="arrow--left"></wc-icon>
10550
- </wc-button>
10551
- <wc-button
10552
- color="secondary"
10553
- variant="text"
10554
- class="arrows"
10555
- ?disabled=${isLastPage}
10556
- @click=${() => {
10557
- if (!isLastPage) {
10558
- this.page += 1;
10559
- this.dispatchPageEvent();
10560
- }
10561
- }}
10562
- >
10563
- <wc-icon slot="icon" name="arrow--right"></wc-icon>
10564
- </wc-button>
10565
- </div>
10566
- </div>
11644
+
11645
+ <div class="pagination-actions">
11646
+ <wc-icon-button
11647
+ class="nav-button"
11648
+ color="secondary"
11649
+ variant="text"
11650
+ size="sm"
11651
+ name="keyboard_arrow_left"
11652
+ title="Previous page"
11653
+ ?disabled=${isFirstPage}
11654
+ @click=${this.handlePreviousPage}
11655
+ ></wc-icon-button>
11656
+ <wc-icon-button
11657
+ class="nav-button"
11658
+ color="secondary"
11659
+ variant="text"
11660
+ size="sm"
11661
+ name="keyboard_arrow_right"
11662
+ title="Next page"
11663
+ ?disabled=${isLastPage}
11664
+ @click=${this.handleNextPage}
11665
+ ></wc-icon-button>
10567
11666
  </div>
10568
11667
  </div>
10569
11668
  `;
10570
11669
  }
10571
11670
  }
10572
- Pagination.styles = [css_248z$4];
11671
+ Pagination.styles = [css_248z$5];
10573
11672
  __decorate([
10574
11673
  n({ type: Number })
10575
11674
  ], Pagination.prototype, "page", void 0);
@@ -10583,7 +11682,7 @@ __decorate([
10583
11682
  n({ type: Array, attribute: 'page-sizes' })
10584
11683
  ], Pagination.prototype, "pageSizes", void 0);
10585
11684
 
10586
- var css_248z$3 = i`* {
11685
+ var css_248z$4 = i`* {
10587
11686
  box-sizing: border-box;
10588
11687
  }
10589
11688
 
@@ -10845,7 +11944,7 @@ class TreeNode extends i$1 {
10845
11944
  }
10846
11945
  _renderContent(hasChildren) {
10847
11946
  // 0.125rem offset aligns text visually with the expand/icon space
10848
- const indentStyle = o$3({
11947
+ const indentStyle = o$2({
10849
11948
  paddingInlineStart: `calc(${this.level + 1}rem - 0.125rem)`,
10850
11949
  });
10851
11950
  const contentClasses = e$3({
@@ -10898,7 +11997,7 @@ class TreeNode extends i$1 {
10898
11997
  </div>`;
10899
11998
  }
10900
11999
  }
10901
- TreeNode.styles = [css_248z$3];
12000
+ TreeNode.styles = [css_248z$4];
10902
12001
  __decorate([
10903
12002
  n({ type: String, reflect: true })
10904
12003
  ], TreeNode.prototype, "value", void 0);
@@ -10930,7 +12029,7 @@ __decorate([
10930
12029
  e$4('.tree-node-content')
10931
12030
  ], TreeNode.prototype, "_nativeElement", void 0);
10932
12031
 
10933
- var css_248z$2 = i`* {
12032
+ var css_248z$3 = i`* {
10934
12033
  box-sizing: border-box;
10935
12034
  }
10936
12035
 
@@ -11093,13 +12192,13 @@ class TreeView extends i$1 {
11093
12192
  </div>`;
11094
12193
  }
11095
12194
  }
11096
- TreeView.styles = [css_248z$2];
12195
+ TreeView.styles = [css_248z$3];
11097
12196
  TreeView.Node = TreeNode;
11098
12197
  __decorate([
11099
12198
  n({ type: String, attribute: 'selected-node', reflect: true })
11100
12199
  ], TreeView.prototype, "selectedNode", void 0);
11101
12200
 
11102
- var css_248z$1 = i`* {
12201
+ var css_248z$2 = i`* {
11103
12202
  box-sizing: border-box;
11104
12203
  }
11105
12204
 
@@ -11107,10 +12206,34 @@ var css_248z$1 = i`* {
11107
12206
  display: none !important;
11108
12207
  }
11109
12208
 
12209
+ @keyframes snackbar-enter {
12210
+ from {
12211
+ opacity: 0;
12212
+ transform: translateY(0.5rem);
12213
+ }
12214
+ to {
12215
+ opacity: 1;
12216
+ transform: translateY(0);
12217
+ }
12218
+ }
12219
+ @keyframes snackbar-exit {
12220
+ from {
12221
+ opacity: 1;
12222
+ transform: translateY(0);
12223
+ }
12224
+ to {
12225
+ opacity: 0;
12226
+ transform: translateY(0.5rem);
12227
+ }
12228
+ }
11110
12229
  :host {
11111
- display: inline-flex;
11112
- max-width: 42rem;
11113
- min-width: 21.5rem;
12230
+ display: flex;
12231
+ inset-block-end: calc(var(--snackbar-offset-bottom, 1rem) + env(safe-area-inset-bottom, 0px));
12232
+ inset-inline: var(--snackbar-offset-inline, 1rem);
12233
+ justify-content: center;
12234
+ pointer-events: none;
12235
+ position: fixed;
12236
+ z-index: var(--snackbar-z-index, 1000);
11114
12237
  --snackbar-container-color: var(--color-inverse-surface);
11115
12238
  --snackbar-label-text-color: var(--color-inverse-on-surface);
11116
12239
  --snackbar-action-text-color: var(--color-inverse-primary);
@@ -11128,59 +12251,57 @@ var css_248z$1 = i`* {
11128
12251
  background-color: var(--snackbar-container-color);
11129
12252
  border-radius: var(--snackbar-border-radius);
11130
12253
  color: var(--snackbar-label-text-color);
11131
- display: inline-flex;
12254
+ display: none;
11132
12255
  gap: var(--spacing-100);
12256
+ max-width: min(42rem, 100%);
12257
+ min-width: min(21.5rem, 100%);
11133
12258
  min-height: 3rem;
11134
- opacity: 0;
11135
12259
  padding: var(--spacing-100) var(--spacing-200);
11136
12260
  pointer-events: none;
11137
- transform: translateY(0.5rem);
11138
- transition: opacity var(--duration-short2) var(--easing-standard), transform var(--duration-short2) var(--easing-standard);
11139
12261
  }
11140
12262
 
11141
12263
  .snackbar.open {
11142
- opacity: 1;
12264
+ animation: snackbar-enter var(--duration-medium1, 300ms) var(--easing-standard, cubic-bezier(0.2, 0, 0, 1)) both;
12265
+ display: inline-flex;
11143
12266
  pointer-events: auto;
11144
- transform: translateY(0);
12267
+ }
12268
+
12269
+ .snackbar.open.dismissing {
12270
+ animation: snackbar-exit var(--duration-short2, 150ms) var(--easing-standard, cubic-bezier(0.2, 0, 0, 1)) forwards;
12271
+ pointer-events: none;
11145
12272
  }
11146
12273
 
11147
12274
  .label {
11148
12275
  flex: 1 1 auto;
11149
12276
  color: inherit;
11150
- }
11151
-
11152
- .action,
11153
- .close {
11154
- font-family: var(--typography-label-large-font-family) !important;
11155
- font-size: var(--typography-label-large-font-size) !important;
11156
- font-weight: var(--typography-label-large-font-weight) !important;
11157
- line-height: var(--typography-label-large-line-height) !important;
11158
- letter-spacing: var(--typography-label-large-letter-spacing) !important;
12277
+ min-height: 32px;
11159
12278
  align-items: center;
11160
- background: transparent;
11161
- border: none;
11162
- color: var(--snackbar-action-text-color);
11163
- cursor: pointer;
11164
- display: inline-flex;
11165
- justify-content: center;
11166
- margin: 0;
11167
- min-height: 2rem;
11168
- min-width: 2rem;
11169
- padding: 0 var(--spacing-100);
12279
+ display: flex;
11170
12280
  }
11171
12281
 
11172
- .close {
11173
- color: var(--snackbar-close-icon-color);
11174
- padding: 0;
12282
+ .action {
12283
+ --text-button-label-text-color: var(--snackbar-action-text-color);
11175
12284
  }
11176
12285
 
11177
- .close wc-icon {
11178
- --icon-size: 1.125rem;
11179
- color: inherit;
12286
+ .close {
12287
+ --text-button-label-text-color: var(--snackbar-close-icon-color);
11180
12288
  }
11181
12289
 
11182
12290
  .snackbar.multiline {
11183
12291
  align-items: flex-start;
12292
+ }
12293
+ .snackbar.multiline .label {
12294
+ height: 100%;
12295
+ }
12296
+
12297
+ :host([preview]) {
12298
+ position: relative;
12299
+ inset-inline: unset;
12300
+ inset-block-end: unset;
12301
+ }
12302
+ :host([preview]) .snackbar {
12303
+ display: inline-flex;
12304
+ pointer-events: auto;
11184
12305
  }`;
11185
12306
 
11186
12307
  /**
@@ -11194,10 +12315,13 @@ var css_248z$1 = i`* {
11194
12315
  * @cssprop --snackbar-action-text-color - Action text color.
11195
12316
  * @cssprop --snackbar-close-icon-color - Close icon color.
11196
12317
  * @cssprop --snackbar-border-radius - Border radius of the snackbar surface.
12318
+ * @cssprop --snackbar-offset-inline - Inline offset from viewport edges.
12319
+ * @cssprop --snackbar-offset-bottom - Bottom offset from viewport edge.
12320
+ * @cssprop --snackbar-z-index - Stacking order for the snackbar.
11197
12321
  *
11198
12322
  * @example
11199
12323
  * ```html
11200
- * <wc-snackbar open message="Message archived" action-label="Undo"></wc-snackbar>
12324
+ * <wc-snackbar preview message="Message archived" action-label="Undo"></wc-snackbar>
11201
12325
  * ```
11202
12326
  * @tags display, feedback
11203
12327
  */
@@ -11210,25 +12334,54 @@ class Snackbar extends i$1 {
11210
12334
  this.showCloseIcon = false;
11211
12335
  this.duration = 4000;
11212
12336
  this.multiline = false;
12337
+ this.preview = false;
12338
+ this.dismissing = false;
11213
12339
  this.hideTimer = null;
12340
+ this.exitTimer = null;
12341
+ this.handleGlobalSnackbarOpen = (event) => {
12342
+ const { source } = event.detail;
12343
+ if (source && source !== this) {
12344
+ this.hide();
12345
+ }
12346
+ };
12347
+ }
12348
+ connectedCallback() {
12349
+ super.connectedCallback();
12350
+ document.addEventListener(Snackbar.GLOBAL_OPEN_EVENT, this.handleGlobalSnackbarOpen);
11214
12351
  }
11215
12352
  show() {
11216
- this.open = true;
12353
+ this.dismissing = false;
12354
+ this.clearExitTimer();
12355
+ if (!this.open) {
12356
+ this.open = true;
12357
+ return;
12358
+ }
12359
+ this.scheduleAutoHide();
11217
12360
  }
11218
12361
  hide() {
11219
12362
  this.close('programmatic');
11220
12363
  }
11221
12364
  close(reason) {
11222
- if (!this.open) {
12365
+ if (!this.open || this.dismissing) {
11223
12366
  return;
11224
12367
  }
11225
- this.open = false;
12368
+ this.clearTimer();
12369
+ this.dismissing = true;
12370
+ this.clearExitTimer();
12371
+ this.exitTimer = setTimeout(() => {
12372
+ this.completeDismiss();
12373
+ }, Snackbar.EXIT_ANIMATION_MS);
11226
12374
  this.dispatchEvent(new CustomEvent('snackbar-close', {
11227
12375
  detail: { reason },
11228
12376
  bubbles: true,
11229
12377
  composed: true,
11230
12378
  }));
11231
12379
  }
12380
+ completeDismiss() {
12381
+ this.clearExitTimer();
12382
+ this.dismissing = false;
12383
+ this.open = false;
12384
+ }
11232
12385
  dispatchActionEvent() {
11233
12386
  this.dispatchEvent(new CustomEvent('snackbar-action', {
11234
12387
  bubbles: true,
@@ -11248,6 +12401,17 @@ class Snackbar extends i$1 {
11248
12401
  this.hideTimer = null;
11249
12402
  }
11250
12403
  }
12404
+ clearExitTimer() {
12405
+ if (this.exitTimer !== null) {
12406
+ clearTimeout(this.exitTimer);
12407
+ this.exitTimer = null;
12408
+ }
12409
+ }
12410
+ handleAnimationEnd(event) {
12411
+ if (event.animationName === 'snackbar-exit' && this.dismissing) {
12412
+ this.completeDismiss();
12413
+ }
12414
+ }
11251
12415
  scheduleAutoHide() {
11252
12416
  this.clearTimer();
11253
12417
  if (!this.open || this.duration <= 0) {
@@ -11259,10 +12423,17 @@ class Snackbar extends i$1 {
11259
12423
  }
11260
12424
  updated(changedProperties) {
11261
12425
  if (changedProperties.has('open')) {
12426
+ if (this.open) {
12427
+ document.dispatchEvent(new CustomEvent(Snackbar.GLOBAL_OPEN_EVENT, {
12428
+ detail: { source: this },
12429
+ }));
12430
+ }
11262
12431
  this.scheduleAutoHide();
11263
12432
  }
11264
12433
  }
11265
12434
  disconnectedCallback() {
12435
+ document.removeEventListener(Snackbar.GLOBAL_OPEN_EVENT, this.handleGlobalSnackbarOpen);
12436
+ this.clearExitTimer();
11266
12437
  this.clearTimer();
11267
12438
  super.disconnectedCallback();
11268
12439
  }
@@ -11272,37 +12443,43 @@ class Snackbar extends i$1 {
11272
12443
  <div
11273
12444
  class=${e$3({
11274
12445
  snackbar: true,
11275
- open: this.open,
12446
+ open: !this.preview && this.open,
12447
+ preview: this.preview,
12448
+ dismissing: this.dismissing,
11276
12449
  multiline: this.multiline,
11277
12450
  })}
11278
12451
  role=${liveRole}
11279
12452
  aria-live="polite"
12453
+ @animationend=${this.handleAnimationEnd}
11280
12454
  >
11281
12455
  <div class="label">
11282
12456
  <slot>${this.message}</slot>
11283
12457
  </div>
11284
12458
 
11285
12459
  ${this.actionLabel
11286
- ? b `<button class="action" type="button" @click=${this.handleActionClick}>
12460
+ ? b `<wc-button class="action" variant='text' size='small' @click=${this.handleActionClick}>
11287
12461
  ${this.actionLabel}
11288
- </button>`
12462
+ </wc-button>`
11289
12463
  : A}
11290
12464
 
11291
12465
  ${this.showCloseIcon
11292
- ? b `<button
12466
+ ? b `<wc-icon-button
11293
12467
  class="close"
11294
- type="button"
12468
+ variant='text'
12469
+ size='small'
11295
12470
  aria-label="Dismiss notification"
11296
12471
  @click=${this.handleCloseClick}
12472
+ name="close"
11297
12473
  >
11298
- <wc-icon name="close"></wc-icon>
11299
- </button>`
12474
+ </wc-icon-button>`
11300
12475
  : A}
11301
12476
  </div>
11302
12477
  `;
11303
12478
  }
11304
12479
  }
11305
- Snackbar.styles = [css_248z$1];
12480
+ Snackbar.styles = [css_248z$2];
12481
+ Snackbar.GLOBAL_OPEN_EVENT = 'wc-snackbar-will-open';
12482
+ Snackbar.EXIT_ANIMATION_MS = 180;
11306
12483
  __decorate([
11307
12484
  n({ type: Boolean, reflect: true })
11308
12485
  ], Snackbar.prototype, "open", void 0);
@@ -11321,8 +12498,14 @@ __decorate([
11321
12498
  __decorate([
11322
12499
  n({ type: Boolean, reflect: true })
11323
12500
  ], Snackbar.prototype, "multiline", void 0);
12501
+ __decorate([
12502
+ n({ type: Boolean, reflect: true })
12503
+ ], Snackbar.prototype, "preview", void 0);
12504
+ __decorate([
12505
+ r()
12506
+ ], Snackbar.prototype, "dismissing", void 0);
11324
12507
 
11325
- var css_248z = i`* {
12508
+ var css_248z$1 = i`* {
11326
12509
  box-sizing: border-box;
11327
12510
  }
11328
12511
 
@@ -11731,7 +12914,7 @@ class Radio extends i$1 {
11731
12914
  }
11732
12915
  Radio.DIRECTION_NEXT = 1;
11733
12916
  Radio.DIRECTION_PREVIOUS = -1;
11734
- Radio.styles = [css_248z];
12917
+ Radio.styles = [css_248z$1];
11735
12918
  __decorate([
11736
12919
  n({ type: String })
11737
12920
  ], Radio.prototype, "name", void 0);
@@ -11775,5 +12958,740 @@ __decorate([
11775
12958
  e$4('.input-native')
11776
12959
  ], Radio.prototype, "nativeElement", void 0);
11777
12960
 
11778
- export { Accordion as A, Badge as B, Checkbox as C, DatePicker as D, Elevation as E, Field as F, Tooltip as G, TreeNode as H, Icon as I, TreeView as J, LinearProgress as L, Menu as M, NumberField as N, Pagination as P, Radio as R, Skeleton as S, Tab as T, Avatar as a, Breadcrumb as b, BreadcrumbItem as c, Chip as d, CircularProgress as e, Container as f, Divider as g, EmptyState as h, FocusRing as i, Image as j, Input as k, Link as l, MenuItem as m, Ripple as n, Slider as o, Snackbar as p, Spinner as q, SubMenu as r, Switch as s, TabGroup as t, TabPanel as u, Table as v, Tabs as w, Tag as x, Textarea as y, TimePicker as z };
11779
- //# sourceMappingURL=radio-b70_Ie9n.js.map
12961
+ var css_248z = i`@charset "UTF-8";
12962
+ * {
12963
+ box-sizing: border-box;
12964
+ }
12965
+
12966
+ .screen-reader-only {
12967
+ display: none !important;
12968
+ }
12969
+
12970
+ :host {
12971
+ display: block;
12972
+ width: 100%;
12973
+ }
12974
+
12975
+ /* Make the field wrapper behave as a select (pointer cursor) */
12976
+ .select-field {
12977
+ cursor: pointer;
12978
+ }
12979
+
12980
+ .select-trigger {
12981
+ flex: 1;
12982
+ display: flex;
12983
+ align-items: center;
12984
+ min-height: 1.5rem;
12985
+ outline: none;
12986
+ cursor: pointer;
12987
+ user-select: none;
12988
+ overflow: hidden;
12989
+ min-width: 0;
12990
+ }
12991
+ .select-trigger:focus-visible {
12992
+ outline: none;
12993
+ }
12994
+
12995
+ .display-value {
12996
+ font-family: var(--typography-body-large-font-family) !important;
12997
+ font-size: var(--typography-body-large-font-size) !important;
12998
+ font-weight: var(--typography-body-large-font-weight) !important;
12999
+ line-height: var(--typography-body-large-line-height) !important;
13000
+ letter-spacing: var(--typography-body-large-letter-spacing) !important;
13001
+ color: var(--color-on-surface);
13002
+ overflow: hidden;
13003
+ text-overflow: ellipsis;
13004
+ white-space: nowrap;
13005
+ }
13006
+
13007
+ .placeholder {
13008
+ font-family: var(--typography-body-large-font-family) !important;
13009
+ font-size: var(--typography-body-large-font-size) !important;
13010
+ font-weight: var(--typography-body-large-font-weight) !important;
13011
+ line-height: var(--typography-body-large-line-height) !important;
13012
+ letter-spacing: var(--typography-body-large-letter-spacing) !important;
13013
+ color: var(--color-on-surface-variant);
13014
+ overflow: hidden;
13015
+ text-overflow: ellipsis;
13016
+ white-space: nowrap;
13017
+ }
13018
+
13019
+ /* Typeahead search input */
13020
+ .search-input {
13021
+ flex: 1;
13022
+ width: 100%;
13023
+ border: none;
13024
+ outline: none;
13025
+ background: transparent;
13026
+ margin: 0;
13027
+ padding: 0;
13028
+ font-family: var(--typography-body-large-font-family) !important;
13029
+ font-size: var(--typography-body-large-font-size) !important;
13030
+ font-weight: var(--typography-body-large-font-weight) !important;
13031
+ line-height: var(--typography-body-large-line-height) !important;
13032
+ letter-spacing: var(--typography-body-large-letter-spacing) !important;
13033
+ color: var(--color-on-surface);
13034
+ cursor: pointer;
13035
+ }
13036
+ .search-input::placeholder {
13037
+ color: var(--color-on-surface-variant);
13038
+ }
13039
+ .search-input:focus {
13040
+ cursor: text;
13041
+ }
13042
+
13043
+ /* Field end slot wrapper */
13044
+ .field-end-wrapper {
13045
+ display: flex;
13046
+ align-items: center;
13047
+ gap: var(--spacing-050);
13048
+ }
13049
+
13050
+ .select-empty-state {
13051
+ display: block;
13052
+ inline-size: min(22rem, 100%);
13053
+ }
13054
+
13055
+ /* Dropdown chevron icon */
13056
+ .dropdown-icon {
13057
+ --icon-size: 1.5rem;
13058
+ --icon-color: var(--color-on-surface-variant);
13059
+ transition: transform 200ms ease;
13060
+ flex-shrink: 0;
13061
+ }
13062
+ .dropdown-icon.dropdown-icon--open {
13063
+ transform: rotate(180deg);
13064
+ }
13065
+
13066
+ /* Clear button */
13067
+ .clear-btn {
13068
+ --button-container-shape: var(--shape-corner-full);
13069
+ }
13070
+
13071
+ /* Multi-select chips area — single scrollable row, no vertical growth */
13072
+ .chips-container {
13073
+ display: flex;
13074
+ flex-wrap: nowrap;
13075
+ overflow-x: auto;
13076
+ scrollbar-width: none;
13077
+ gap: var(--spacing-050);
13078
+ padding-block: var(--spacing-050);
13079
+ align-items: center;
13080
+ flex: 1;
13081
+ min-width: 0;
13082
+ }
13083
+ .chips-container::-webkit-scrollbar {
13084
+ display: none;
13085
+ }
13086
+
13087
+ /* Disabled state */
13088
+ :host([disabled]) .select-trigger,
13089
+ :host([disabled]) .select-field {
13090
+ cursor: not-allowed;
13091
+ }
13092
+
13093
+ /* Readonly state */
13094
+ :host([readonly]) .select-trigger,
13095
+ :host([readonly]) .select-field {
13096
+ cursor: default;
13097
+ }`;
13098
+
13099
+ /**
13100
+ * @label Select Option
13101
+ * @tag wc-option
13102
+ * @rawTag option
13103
+ * @parentRawTag select
13104
+ *
13105
+ * @summary A declarative option element for use inside wc-select.
13106
+ *
13107
+ * @example
13108
+ * ```html
13109
+ * <wc-select label="Fruit">
13110
+ * <wc-option value="apple">Apple</wc-option>
13111
+ * <wc-option value="banana">Banana</wc-option>
13112
+ * </wc-select>
13113
+ * ```
13114
+ */
13115
+ class SelectOptionElement extends i$1 {
13116
+ constructor() {
13117
+ super(...arguments);
13118
+ /**
13119
+ * The option's submitted value.
13120
+ */
13121
+ this.value = '';
13122
+ /**
13123
+ * Optional Material Symbol icon name shown before the label.
13124
+ */
13125
+ this.icon = '';
13126
+ /**
13127
+ * Disables the option so it cannot be selected.
13128
+ */
13129
+ this.disabled = false;
13130
+ // ── Managed by wc-select ──────────────────────────────────────────────────
13131
+ /** Reflects whether this option is currently selected. Set by wc-select. */
13132
+ this.selected = false;
13133
+ /**
13134
+ * When true the menu stays open after selection (used for multi-select).
13135
+ * Set by wc-select.
13136
+ */
13137
+ this.keepOpen = false;
13138
+ /**
13139
+ * When true the option is hidden and excluded from keyboard navigation
13140
+ * because it does not match the current typeahead search query.
13141
+ * Set by wc-select.
13142
+ */
13143
+ this.filtered = false;
13144
+ }
13145
+ /**
13146
+ * Returns the inner `wc-menu-item` element.
13147
+ * `wc-menu` discovers this via its `items` getter which checks `el.item`
13148
+ * as a `MenuItem` proxy, so keyboard navigation and activation work
13149
+ * without `wc-option` extending `MenuItem` directly.
13150
+ */
13151
+ get item() {
13152
+ const el = this._menuItemEl;
13153
+ // Narrow to MenuItem — the shadow DOM only ever contains a wc-menu-item
13154
+ // (a MenuItem subclass), so this cast is safe by construction.
13155
+ return el != null ? el : null;
13156
+ }
13157
+ render() {
13158
+ return b `
13159
+ <wc-menu-item
13160
+ value=${this.value}
13161
+ ?disabled=${this.disabled || this.filtered}
13162
+ ?selected=${this.selected}
13163
+ ?keep-open=${this.keepOpen}
13164
+ >
13165
+ ${this.icon
13166
+ ? b `<wc-icon name=${this.icon} slot="leading-icon"></wc-icon>`
13167
+ : A}
13168
+ <slot>${this.value === '' ? 'None' : ''}</slot>
13169
+ ${this.selected && this.keepOpen
13170
+ ? b `<wc-icon
13171
+ name="check"
13172
+ slot="trailing-supporting-text"
13173
+ ></wc-icon>`
13174
+ : A}
13175
+ </wc-menu-item>
13176
+ `;
13177
+ }
13178
+ }
13179
+ SelectOptionElement.styles = [
13180
+ i `
13181
+ :host {
13182
+ display: contents;
13183
+ }
13184
+ :host([filtered]) {
13185
+ display: none;
13186
+ }
13187
+ `,
13188
+ ];
13189
+ __decorate([
13190
+ n({ type: String, reflect: true })
13191
+ ], SelectOptionElement.prototype, "value", void 0);
13192
+ __decorate([
13193
+ n({ type: String, reflect: true })
13194
+ ], SelectOptionElement.prototype, "icon", void 0);
13195
+ __decorate([
13196
+ n({ type: Boolean, reflect: true })
13197
+ ], SelectOptionElement.prototype, "disabled", void 0);
13198
+ __decorate([
13199
+ n({ type: Boolean, reflect: true })
13200
+ ], SelectOptionElement.prototype, "selected", void 0);
13201
+ __decorate([
13202
+ n({ type: Boolean, attribute: 'keep-open' })
13203
+ ], SelectOptionElement.prototype, "keepOpen", void 0);
13204
+ __decorate([
13205
+ n({ type: Boolean, reflect: true })
13206
+ ], SelectOptionElement.prototype, "filtered", void 0);
13207
+ __decorate([
13208
+ e$4('wc-menu-item')
13209
+ ], SelectOptionElement.prototype, "_menuItemEl", void 0);
13210
+
13211
+ /**
13212
+ * @label Select
13213
+ * @tag wc-select
13214
+ * @rawTag select
13215
+ *
13216
+ * @summary A dropdown select component supporting single and multi-select with optional typeahead search.
13217
+ * @overview
13218
+ * Select builds on wc-field and wc-menu to provide a fully-featured dropdown picker.
13219
+ *
13220
+ * - Single and multi-select modes
13221
+ * - Client-side typeahead with `search="contains"`
13222
+ * - Server-side typeahead with `search="managed"`
13223
+ * - Multi-select chips display
13224
+ *
13225
+ * @example
13226
+ * ```html
13227
+ * <wc-select label="Fruit" placeholder="Pick a fruit...">
13228
+ * <wc-option value="apple">Apple</wc-option>
13229
+ * <wc-option value="banana">Banana</wc-option>
13230
+ * </wc-select>
13231
+ * ```
13232
+ * @tags form
13233
+ */
13234
+ class Select extends BaseInput {
13235
+ constructor() {
13236
+ super(...arguments);
13237
+ this._menuId = `wc-select-menu-${Math.random().toString(36).slice(2, 9)}`;
13238
+ /**
13239
+ * Array of options to display in the dropdown.
13240
+ * Setting this property creates matching `<wc-option>` children automatically.
13241
+ */
13242
+ this.options = [];
13243
+ /**
13244
+ * The selected value. For multi-select, a comma-separated list of values.
13245
+ */
13246
+ this.value = '';
13247
+ /**
13248
+ * Enable multi-select mode.
13249
+ */
13250
+ this.multiple = false;
13251
+ /**
13252
+ * Enable typeahead search.
13253
+ * - `'contains'`: filters options client-side.
13254
+ * - `'managed'`: emits a `select-search` event for server-controlled filtering.
13255
+ */
13256
+ this.search = '';
13257
+ /**
13258
+ * Placeholder text shown when no value is selected.
13259
+ */
13260
+ this.placeholder = '';
13261
+ /**
13262
+ * Label displayed above the field.
13263
+ */
13264
+ this.label = '';
13265
+ /**
13266
+ * Visual variant of the field.
13267
+ */
13268
+ this.variant = 'default';
13269
+ /**
13270
+ * Helper text displayed below the field.
13271
+ */
13272
+ this.helperText = '';
13273
+ this.error = false;
13274
+ this.errorText = '';
13275
+ this.warning = false;
13276
+ this.warningText = '';
13277
+ this._open = false;
13278
+ this._focused = false;
13279
+ this._searchQuery = '';
13280
+ /** True when all options are filtered out by the current search query. */
13281
+ this._noOptionsVisible = false;
13282
+ }
13283
+ get _menu() {
13284
+ return this.renderRoot?.querySelector('wc-menu') ?? null;
13285
+ }
13286
+ focus() {
13287
+ this._triggerEl?.focus();
13288
+ }
13289
+ blur() {
13290
+ this._triggerEl?.blur();
13291
+ }
13292
+ // ── Lifecycle ─────────────────────────────────────────────────────────────
13293
+ updated(changedProperties) {
13294
+ if (changedProperties.has('options')) {
13295
+ this._syncProgrammaticOptions();
13296
+ }
13297
+ this._syncOptionStates();
13298
+ }
13299
+ // ── Programmatic options ───────────────────────────────────────────────────
13300
+ /**
13301
+ * Reconciles the `options` property with auto-generated `<wc-option>` light-DOM
13302
+ * children (marked `data-generated`). Declarative children placed by the
13303
+ * consumer are left untouched.
13304
+ */
13305
+ _syncProgrammaticOptions() {
13306
+ this.querySelectorAll('wc-option[data-generated]').forEach(el => el.remove());
13307
+ for (const opt of this.options) {
13308
+ const el = new SelectOptionElement();
13309
+ el.value = opt.value;
13310
+ if (opt.icon)
13311
+ el.icon = opt.icon;
13312
+ el.textContent = opt.label || (opt.value === '' ? 'None' : '');
13313
+ el.dataset.generated = '';
13314
+ this.appendChild(el);
13315
+ }
13316
+ }
13317
+ // ── Option state sync ──────────────────────────────────────────────────────
13318
+ /**
13319
+ * Pushes `selected`, `keepOpen`, and `filtered` state onto every `<wc-option>`
13320
+ * child element so each one can render itself correctly.
13321
+ */
13322
+ _syncOptionStates() {
13323
+ const optEls = Array.from(this.querySelectorAll('wc-option'));
13324
+ let visibleCount = 0;
13325
+ for (const opt of optEls) {
13326
+ opt.selected = this._isSelected(opt.value);
13327
+ opt.keepOpen = this.multiple;
13328
+ if (this.search && this.search !== 'managed' && this._searchQuery) {
13329
+ const q = this._searchQuery.toLowerCase();
13330
+ const label = opt.textContent?.trim() ?? '';
13331
+ opt.filtered = !label.toLowerCase().includes(q);
13332
+ if (!opt.filtered)
13333
+ visibleCount += 1;
13334
+ }
13335
+ else {
13336
+ opt.filtered = false;
13337
+ visibleCount += 1;
13338
+ }
13339
+ }
13340
+ this._noOptionsVisible = visibleCount === 0;
13341
+ }
13342
+ // ── Helpers ────────────────────────────────────────────────────────────────
13343
+ get _selectedValues() {
13344
+ if (!this.value)
13345
+ return [];
13346
+ return this.value
13347
+ .split(',')
13348
+ .map(v => v.trim())
13349
+ .filter(Boolean);
13350
+ }
13351
+ _isSelected(value) {
13352
+ if (!this.multiple) {
13353
+ return this.value === value;
13354
+ }
13355
+ return this._selectedValues.includes(value);
13356
+ }
13357
+ /** Returns the display label for a given option value. */
13358
+ _getLabelForValue(val) {
13359
+ for (const opt of this.querySelectorAll('wc-option')) {
13360
+ if (opt.value === val) {
13361
+ const label = opt.textContent?.trim();
13362
+ if (label)
13363
+ return label;
13364
+ return val === '' ? 'None' : val;
13365
+ }
13366
+ }
13367
+ // Fallback to options array (before wc-option children are created)
13368
+ const programmaticLabel = this.options.find(o => o.value === val)?.label;
13369
+ if (programmaticLabel)
13370
+ return programmaticLabel;
13371
+ return val === '' ? 'None' : val;
13372
+ }
13373
+ get _displayLabel() {
13374
+ if (!this.value)
13375
+ return '';
13376
+ const firstValue = this._selectedValues[0];
13377
+ if (!firstValue)
13378
+ return '';
13379
+ return this._getLabelForValue(firstValue);
13380
+ }
13381
+ get _isPopulated() {
13382
+ return !!this.value;
13383
+ }
13384
+ // ── Menu open/close ────────────────────────────────────────────────────────
13385
+ _openMenu() {
13386
+ if (this.disabled || this.readonly)
13387
+ return;
13388
+ this._open = true;
13389
+ this._focused = true;
13390
+ this._triggerEl?.focus();
13391
+ const menu = this._menu;
13392
+ if (menu && this._triggerEl) {
13393
+ menu.anchorElement = this._triggerEl;
13394
+ const triggerWidth = this._triggerEl.getBoundingClientRect().width;
13395
+ if (triggerWidth < 240) {
13396
+ menu.style.setProperty('--menu-width', '240px');
13397
+ }
13398
+ else {
13399
+ menu.style.setProperty('--menu-width', `${Math.ceil(triggerWidth)}px`);
13400
+ }
13401
+ menu.show();
13402
+ }
13403
+ if (this.search) {
13404
+ this._searchQuery = '';
13405
+ // Use rAF so that the search input receives focus *after* wc-menu has
13406
+ // finished showing and potentially focused a menu item.
13407
+ this.updateComplete.then(() => {
13408
+ requestAnimationFrame(() => {
13409
+ this._searchInputEl?.focus();
13410
+ });
13411
+ });
13412
+ }
13413
+ }
13414
+ _closeMenu() {
13415
+ if (!this._open)
13416
+ return;
13417
+ this._open = false;
13418
+ this._focused = false;
13419
+ this._searchQuery = '';
13420
+ this._menu?.close();
13421
+ }
13422
+ // ── Event handlers ─────────────────────────────────────────────────────────
13423
+ _handleTriggerClick(event) {
13424
+ event.stopPropagation();
13425
+ // Ignore clicks that originated inside the search input — those should not
13426
+ // toggle the menu (the input needs to stay open so the user can type).
13427
+ if (event.target instanceof HTMLInputElement) {
13428
+ return;
13429
+ }
13430
+ if (this._open) {
13431
+ this._closeMenu();
13432
+ }
13433
+ else {
13434
+ this._openMenu();
13435
+ }
13436
+ }
13437
+ _handleFieldClick(event) {
13438
+ const eventPath = event.composedPath();
13439
+ if (eventPath.includes(this._triggerEl) ||
13440
+ eventPath.some(target => target instanceof HTMLInputElement ||
13441
+ (target instanceof HTMLElement &&
13442
+ (target.closest('.clear-btn') != null ||
13443
+ target.matches('wc-icon-button'))))) {
13444
+ return;
13445
+ }
13446
+ if (this._open) {
13447
+ this._closeMenu();
13448
+ }
13449
+ else {
13450
+ this._openMenu();
13451
+ }
13452
+ }
13453
+ _handleTriggerKeyDown(event) {
13454
+ // When the typeahead search input is active, let the input handle its own
13455
+ // keys (Space, Enter, etc.). Only intercept Escape to close the menu.
13456
+ if (event.target instanceof HTMLInputElement) {
13457
+ if (event.key === 'Escape') {
13458
+ event.preventDefault();
13459
+ this._closeMenu();
13460
+ }
13461
+ return;
13462
+ }
13463
+ switch (event.key) {
13464
+ case 'Enter':
13465
+ case ' ':
13466
+ case 'ArrowDown':
13467
+ event.preventDefault();
13468
+ if (!this._open)
13469
+ this._openMenu();
13470
+ break;
13471
+ case 'Escape':
13472
+ if (this._open) {
13473
+ event.preventDefault();
13474
+ this._closeMenu();
13475
+ }
13476
+ break;
13477
+ }
13478
+ }
13479
+ _handleMenuClosed() {
13480
+ this._open = false;
13481
+ this._focused = false;
13482
+ this._searchQuery = '';
13483
+ }
13484
+ _handleMenuItemActivate(event) {
13485
+ const item = event.detail?.item;
13486
+ if (!item)
13487
+ return;
13488
+ const val = item.value;
13489
+ if (val === undefined)
13490
+ return;
13491
+ if (this.multiple) {
13492
+ if (val === '')
13493
+ return;
13494
+ const values = this._selectedValues;
13495
+ const idx = values.indexOf(val);
13496
+ if (idx >= 0) {
13497
+ values.splice(idx, 1);
13498
+ }
13499
+ else {
13500
+ values.push(val);
13501
+ }
13502
+ this.value = values.join(',');
13503
+ }
13504
+ else {
13505
+ this.value = val;
13506
+ this._closeMenu();
13507
+ }
13508
+ this._dispatchChange();
13509
+ }
13510
+ _dispatchChange() {
13511
+ this.dispatchEvent(new CustomEvent('change', {
13512
+ detail: { value: this.value },
13513
+ bubbles: true,
13514
+ composed: true,
13515
+ }));
13516
+ }
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
+ }
13526
+ }
13527
+ _handleChipDismiss(event, chipValue) {
13528
+ event.stopPropagation();
13529
+ const values = this._selectedValues.filter(v => v !== chipValue);
13530
+ this.value = values.join(',');
13531
+ this._dispatchChange();
13532
+ }
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
+ `;
13545
+ }
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
+ `)}
13568
+ </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>`;
13576
+ }
13577
+ _renderFieldEnd() {
13578
+ 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>
13586
+ `;
13587
+ }
13588
+ render() {
13589
+ return b `
13590
+ <wc-field
13591
+ label=${this.label}
13592
+ ?required=${this.required}
13593
+ ?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)}
13633
+ >
13634
+ <slot></slot>
13635
+ ${this._noOptionsVisible ? this._renderEmptyState() : A}
13636
+ </wc-menu>
13637
+ `;
13638
+ }
13639
+ }
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);
13647
+ __decorate([
13648
+ 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);
13656
+ __decorate([
13657
+ n({ type: String })
13658
+ ], Select.prototype, "label", void 0);
13659
+ __decorate([
13660
+ n({ type: String })
13661
+ ], Select.prototype, "variant", void 0);
13662
+ __decorate([
13663
+ n({ type: String, attribute: 'helper-text' })
13664
+ ], Select.prototype, "helperText", void 0);
13665
+ __decorate([
13666
+ n({ type: Boolean })
13667
+ ], Select.prototype, "error", void 0);
13668
+ __decorate([
13669
+ n({ type: String, attribute: 'error-text' })
13670
+ ], Select.prototype, "errorText", void 0);
13671
+ __decorate([
13672
+ n({ type: Boolean })
13673
+ ], Select.prototype, "warning", void 0);
13674
+ __decorate([
13675
+ n({ type: String, attribute: 'warning-text' })
13676
+ ], Select.prototype, "warningText", void 0);
13677
+ __decorate([
13678
+ r()
13679
+ ], Select.prototype, "_open", void 0);
13680
+ __decorate([
13681
+ r()
13682
+ ], Select.prototype, "_focused", void 0);
13683
+ __decorate([
13684
+ r()
13685
+ ], Select.prototype, "_searchQuery", void 0);
13686
+ __decorate([
13687
+ r()
13688
+ ], Select.prototype, "_noOptionsVisible", void 0);
13689
+ __decorate([
13690
+ e$4('.select-trigger')
13691
+ ], Select.prototype, "_triggerEl", void 0);
13692
+ __decorate([
13693
+ e$4('.search-input')
13694
+ ], Select.prototype, "_searchInputEl", void 0);
13695
+
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