@redvars/peacock 4.7.0 → 4.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (300) hide show
  1. package/dist/accordion-item.js +4 -4
  2. package/dist/app-bar.js +1 -1
  3. package/dist/app-shell.js +2 -2
  4. package/dist/assets/styles.css +1 -1
  5. package/dist/assets/styles.css.map +1 -1
  6. package/dist/assets/theme.d.ts +2 -0
  7. package/dist/assets/theme.js +49 -29
  8. package/dist/assets/tokens.css +1 -1
  9. package/dist/assets/tokens.css.map +1 -1
  10. package/dist/bottom-sheet.js +3 -3
  11. package/dist/breadcrumb-item.js +1 -1
  12. package/dist/button-group.js +79 -0
  13. package/dist/button-group.js.map +1 -1
  14. package/dist/button.js +26 -25
  15. package/dist/button.js.map +1 -1
  16. package/dist/calendar-column-view.js +3 -3
  17. package/dist/calendar-month-view.js +3 -3
  18. package/dist/calendar-timeline.js +3 -3
  19. package/dist/card.js +2 -1
  20. package/dist/card.js.map +1 -1
  21. package/dist/carousel.js +182 -7
  22. package/dist/carousel.js.map +1 -1
  23. package/dist/{cartesian-chart-C8qKDXo8.js → cartesian-chart-UW1CYKRS.js} +2 -2
  24. package/dist/{cartesian-chart-C8qKDXo8.js.map → cartesian-chart-UW1CYKRS.js.map} +1 -1
  25. package/dist/cb-group.js +1 -1
  26. package/dist/chart-area.js +2 -2
  27. package/dist/chart-bar.js +2 -2
  28. package/dist/{chart-base-BpQMZZsw.js → chart-base-D5ujPGcl.js} +3 -3
  29. package/dist/{chart-base-BpQMZZsw.js.map → chart-base-D5ujPGcl.js.map} +1 -1
  30. package/dist/chart-doughnut.js +1 -1
  31. package/dist/chart-line.js +2 -2
  32. package/dist/chart-pie.js +2 -2
  33. package/dist/checkbox.js +7 -6
  34. package/dist/checkbox.js.map +1 -1
  35. package/dist/chip.js +34 -8
  36. package/dist/chip.js.map +1 -1
  37. package/dist/circular-progress.js +46 -15
  38. package/dist/circular-progress.js.map +1 -1
  39. package/dist/code-highlighter.js +1 -1
  40. package/dist/color-picker.js +1 -1
  41. package/dist/command-palette.js +2 -2
  42. package/dist/comment-composer.js +5 -5
  43. package/dist/condition-builder.js +1 -1
  44. package/dist/{condition-group-base-NcvOY-Zv.js → condition-group-base-DS76sprm.js} +2 -2
  45. package/dist/{condition-group-base-NcvOY-Zv.js.map → condition-group-base-DS76sprm.js.map} +1 -1
  46. package/dist/confirm-dialog.js +2 -2
  47. package/dist/custom-elements-jsdocs.json +302 -10
  48. package/dist/custom-elements.json +1209 -16
  49. package/dist/date-picker.js +51 -1
  50. package/dist/date-picker.js.map +1 -1
  51. package/dist/dependency-map.js +2 -2
  52. package/dist/{diagram-hv7hCgzx.js → diagram-DFO-X7yq.js} +2 -2
  53. package/dist/{diagram-hv7hCgzx.js.map → diagram-DFO-X7yq.js.map} +1 -1
  54. package/dist/diagram.js +1 -1
  55. package/dist/discussion.js +3 -3
  56. package/dist/{document-editor-CZBlz3ai.js → document-editor-W4pXGCEL.js} +19 -7
  57. package/dist/document-editor-W4pXGCEL.js.map +1 -0
  58. package/dist/document-editor.js +3 -3
  59. package/dist/dropdown-button.js +1 -1
  60. package/dist/erd.js +4 -4
  61. package/dist/fab-menu-item.js +189 -0
  62. package/dist/fab-menu-item.js.map +1 -0
  63. package/dist/fab-menu.js +329 -0
  64. package/dist/fab-menu.js.map +1 -0
  65. package/dist/fab.js +28 -17
  66. package/dist/fab.js.map +1 -1
  67. package/dist/field.js +1 -1
  68. package/dist/file-upload.js +1 -1
  69. package/dist/flow.js +1 -1
  70. package/dist/haptics-CAaQ2E-9.js +29 -0
  71. package/dist/haptics-CAaQ2E-9.js.map +1 -0
  72. package/dist/hover-card.js +5 -3
  73. package/dist/hover-card.js.map +1 -1
  74. package/dist/html-editor.js +4 -4
  75. package/dist/icon-button.js +26 -25
  76. package/dist/icon-button.js.map +1 -1
  77. package/dist/{index-DK3fREuj.js → index-BBxpsqx8.js} +4 -4
  78. package/dist/{index-DK3fREuj.js.map → index-BBxpsqx8.js.map} +1 -1
  79. package/dist/{index-CTEt3LtO.js → index-CDtKB0In.js} +4 -4
  80. package/dist/{index-CTEt3LtO.js.map → index-CDtKB0In.js.map} +1 -1
  81. package/dist/{index-Bag4vtx-.js → index-Tb0ky27z.js} +3 -3
  82. package/dist/{index-Bag4vtx-.js.map → index-Tb0ky27z.js.map} +1 -1
  83. package/dist/index.js +17 -13
  84. package/dist/index.js.map +1 -1
  85. package/dist/{indicator-navigation-item-BG0TrdDE.js → indicator-navigation-item-aZsm-RpR.js} +17 -5
  86. package/dist/{indicator-navigation-item-BG0TrdDE.js.map → indicator-navigation-item-aZsm-RpR.js.map} +1 -1
  87. package/dist/inline-edit.js +1 -1
  88. package/dist/json-viewer.js +1 -1
  89. package/dist/linear-progress.js +51 -4
  90. package/dist/linear-progress.js.map +1 -1
  91. package/dist/link-button.js +26 -25
  92. package/dist/link-button.js.map +1 -1
  93. package/dist/loader-full.js +10 -6
  94. package/dist/loader-full.js.map +1 -1
  95. package/dist/loader.js +19 -6
  96. package/dist/loader.js.map +1 -1
  97. package/dist/loading-indicator.js +301 -0
  98. package/dist/loading-indicator.js.map +1 -0
  99. package/dist/markdown-editor.js +4 -4
  100. package/dist/mention-input.js +1 -1
  101. package/dist/menu.js +8 -6
  102. package/dist/menu.js.map +1 -1
  103. package/dist/{modal-Dds0rXAG.js → modal-ClWCCbxD.js} +7 -5
  104. package/dist/{modal-Dds0rXAG.js.map → modal-ClWCCbxD.js.map} +1 -1
  105. package/dist/modal.js +14 -3
  106. package/dist/modal.js.map +1 -1
  107. package/dist/navigation-bar-item.js +1 -1
  108. package/dist/navigation-bar.js +1 -1
  109. package/dist/navigation-drawer-group.js +1 -1
  110. package/dist/navigation-drawer.js +1 -1
  111. package/dist/navigation-rail-item.js +1 -1
  112. package/dist/navigation-rail.js +1 -1
  113. package/dist/notification-center.js +1 -1
  114. package/dist/number-counter.js +1 -1
  115. package/dist/{overlay-controller-BOk-kfil.js → overlay-controller-iVaiUqos.js} +20 -10
  116. package/dist/{overlay-controller-BOk-kfil.js.map → overlay-controller-iVaiUqos.js.map} +1 -1
  117. package/dist/pagination.js +1 -1
  118. package/dist/popover-content.js +4 -2
  119. package/dist/popover-content.js.map +1 -1
  120. package/dist/popover.js +1 -1
  121. package/dist/{progress-base-BhJK__VP.js → progress-base-BeLu9-Tq.js} +13 -1
  122. package/dist/progress-base-BeLu9-Tq.js.map +1 -0
  123. package/dist/prompt-input.js +5 -5
  124. package/dist/radio.js +6 -4
  125. package/dist/radio.js.map +1 -1
  126. package/dist/resizable-panels.js +1 -1
  127. package/dist/{rich-text-input-base-SrsPvc-j.js → rich-text-input-base-BCmnkpuV.js} +2 -2
  128. package/dist/{rich-text-input-base-SrsPvc-j.js.map → rich-text-input-base-BCmnkpuV.js.map} +1 -1
  129. package/dist/scroll-area.js +1 -1
  130. package/dist/search.js +1 -1
  131. package/dist/segmented-button.js +7 -2
  132. package/dist/segmented-button.js.map +1 -1
  133. package/dist/select.js +1 -1
  134. package/dist/side-sheet.js +3 -3
  135. package/dist/site-header.js +3 -3
  136. package/dist/site-nav-menu.js +1 -1
  137. package/dist/{slash-controller-DwL0nkqv.js → slash-controller-BFhzSjiR.js} +2 -2
  138. package/dist/{slash-controller-DwL0nkqv.js.map → slash-controller-BFhzSjiR.js.map} +1 -1
  139. package/dist/slider.js +169 -69
  140. package/dist/slider.js.map +1 -1
  141. package/dist/snackbar.js +2 -2
  142. package/dist/sparkline.js +2 -2
  143. package/dist/split-button.js +1 -1
  144. package/dist/src/__internal/utils/haptics.d.ts +7 -0
  145. package/dist/src/button/button-group/button-group.d.ts +12 -0
  146. package/dist/src/button/fab/fab.d.ts +1 -0
  147. package/dist/src/carousel/carousel.d.ts +22 -0
  148. package/dist/src/chip/chip/chip.d.ts +4 -0
  149. package/dist/src/date-picker/date-picker.d.ts +6 -1
  150. package/dist/src/document-editor/document-editor.d.ts +2 -0
  151. package/dist/src/fab-menu/fab-menu-item.d.ts +30 -0
  152. package/dist/src/fab-menu/fab-menu.d.ts +64 -0
  153. package/dist/src/fab-menu/index.d.ts +2 -0
  154. package/dist/src/index.d.ts +3 -0
  155. package/dist/src/loading-indicator/index.d.ts +1 -0
  156. package/dist/src/loading-indicator/loading-indicator.d.ts +44 -0
  157. package/dist/src/loading-indicator/shapes.d.ts +29 -0
  158. package/dist/src/modal/modal.d.ts +4 -0
  159. package/dist/src/progress/circular-progress/circular-progress.d.ts +3 -1
  160. package/dist/src/progress/linear-progress/linear-progress.d.ts +2 -1
  161. package/dist/src/progress/progress-base.d.ts +7 -0
  162. package/dist/src/slider/slider.d.ts +23 -3
  163. package/dist/src/toolbar/toolbar.d.ts +20 -0
  164. package/dist/step.js +1 -1
  165. package/dist/switch.js +7 -3
  166. package/dist/switch.js.map +1 -1
  167. package/dist/tab-group.js +13 -2
  168. package/dist/tab-group.js.map +1 -1
  169. package/dist/tab-panel.js +26 -0
  170. package/dist/tab-panel.js.map +1 -1
  171. package/dist/tab.js +23 -5
  172. package/dist/tab.js.map +1 -1
  173. package/dist/table.js +4 -4
  174. package/dist/tag.js +2 -1
  175. package/dist/tag.js.map +1 -1
  176. package/dist/test/button-group-press.test.d.ts +1 -0
  177. package/dist/test/fab-menu.test.d.ts +1 -0
  178. package/dist/test/haptics.test.d.ts +1 -0
  179. package/dist/test/loading-indicator.test.d.ts +1 -0
  180. package/dist/{toggle-base-DP3PSXbf.js → toggle-base-CVO9YntI.js} +3 -1
  181. package/dist/toggle-base-CVO9YntI.js.map +1 -0
  182. package/dist/toolbar.js +102 -0
  183. package/dist/toolbar.js.map +1 -1
  184. package/dist/tooltip.js +5 -2
  185. package/dist/tooltip.js.map +1 -1
  186. package/dist/tour.js +3 -3
  187. package/dist/tree-chart.js +3 -3
  188. package/dist/tree-item.js +1 -1
  189. package/dist/tsconfig.tsbuildinfo +1 -1
  190. package/dist/{video-DgtGGvrk.js → video-DSQ07o3h.js} +2 -2
  191. package/dist/{video-DgtGGvrk.js.map → video-DSQ07o3h.js.map} +1 -1
  192. package/dist/video.js +1 -1
  193. package/dist/workflow.js +5 -5
  194. package/package.json +1 -1
  195. package/scss/tokens.css +364 -0
  196. package/src/__internal/chart/chart-base.scss +4 -2
  197. package/src/__internal/controllers/overlay-controller.ts +19 -9
  198. package/src/__internal/rich-text/editor-chrome.scss +2 -1
  199. package/src/__internal/toggle-base.ts +2 -0
  200. package/src/__internal/utils/haptics.ts +32 -0
  201. package/src/accordion/accordion-item.scss +10 -6
  202. package/src/app-bar/app-bar.scss +2 -1
  203. package/src/app-shell/app-shell.scss +2 -2
  204. package/src/bottom-sheet/bottom-sheet.scss +4 -2
  205. package/src/breadcrumb/breadcrumb-item/breadcrumb-item.scss +4 -2
  206. package/src/button/button/button-base.scss +14 -12
  207. package/src/button/button/button-layers.scss +27 -5
  208. package/src/button/button-group/button-group.scss +6 -0
  209. package/src/button/button-group/button-group.ts +105 -0
  210. package/src/button/fab/fab-sizes.scss +2 -0
  211. package/src/button/fab/fab.scss +32 -17
  212. package/src/button/fab/fab.ts +1 -0
  213. package/src/calendar/calendar-column-view.scss +3 -3
  214. package/src/calendar/calendar-month-view.scss +3 -3
  215. package/src/calendar-timeline/calendar-timeline.scss +6 -3
  216. package/src/card/card.scss +2 -1
  217. package/src/carousel/carousel.scss +71 -2
  218. package/src/carousel/carousel.ts +159 -7
  219. package/src/chart-pie/chart-pie.scss +4 -2
  220. package/src/checkbox/checkbox.scss +13 -7
  221. package/src/chip/chip/chip.scss +41 -8
  222. package/src/chip/chip/chip.ts +4 -0
  223. package/src/chip/tag/tag.scss +2 -1
  224. package/src/code-highlighter/code-highlighter.scss +2 -1
  225. package/src/color-picker/color-picker.scss +1 -1
  226. package/src/comment-composer/comment-composer.scss +2 -1
  227. package/src/components.manifest.json +21 -0
  228. package/src/condition-builder/condition-group-base.scss +1 -1
  229. package/src/date-picker/date-picker.scss +27 -0
  230. package/src/date-picker/date-picker.ts +27 -1
  231. package/src/dependency-map/dependency-map.scss +4 -2
  232. package/src/diagram/diagram.scss +2 -1
  233. package/src/document-editor/document-editor.scss +1 -1
  234. package/src/document-editor/document-editor.ts +17 -0
  235. package/src/dropdown-button/dropdown-button.scss +2 -1
  236. package/src/erd/erd.scss +8 -4
  237. package/src/fab-menu/fab-menu-item.scss +99 -0
  238. package/src/fab-menu/fab-menu-item.ts +58 -0
  239. package/src/fab-menu/fab-menu.scss +119 -0
  240. package/src/fab-menu/fab-menu.ts +195 -0
  241. package/src/fab-menu/index.ts +2 -0
  242. package/src/field/field.scss +1 -1
  243. package/src/file-upload/file-upload.scss +2 -2
  244. package/src/hover-card/hover-card.scss +9 -2
  245. package/src/index.ts +3 -0
  246. package/src/inline-edit/inline-edit.scss +2 -2
  247. package/src/json-viewer/json-viewer.scss +2 -1
  248. package/src/loader.ts +12 -0
  249. package/src/loading-indicator/index.ts +1 -0
  250. package/src/loading-indicator/loading-indicator.scss +52 -0
  251. package/src/loading-indicator/loading-indicator.ts +164 -0
  252. package/src/loading-indicator/shapes.ts +104 -0
  253. package/src/menu/menu/menu.scss +10 -6
  254. package/src/modal/modal.scss +8 -4
  255. package/src/modal/modal.ts +14 -1
  256. package/src/navigation-drawer/navigation-drawer-group.scss +2 -2
  257. package/src/navigation-drawer/navigation-drawer.scss +3 -2
  258. package/src/navigation-rail/navigation-rail-item.scss +27 -5
  259. package/src/number-counter/number-counter.scss +1 -1
  260. package/src/pagination/pagination.scss +2 -1
  261. package/src/popover/popover-content.scss +7 -2
  262. package/src/progress/circular-progress/circular-progress.scss +3 -2
  263. package/src/progress/circular-progress/circular-progress.ts +43 -12
  264. package/src/progress/linear-progress/linear-progress.scss +70 -2
  265. package/src/progress/linear-progress/linear-progress.ts +4 -1
  266. package/src/progress/progress-base.ts +11 -0
  267. package/src/prompt-input/prompt-input.scss +2 -1
  268. package/src/radio/radio.scss +8 -4
  269. package/src/radio/radio.ts +2 -0
  270. package/src/resizable-panels/resizable-panels.scss +2 -1
  271. package/src/scroll-area/scroll-area.scss +2 -1
  272. package/src/search/search.scss +2 -1
  273. package/src/segmented-button/segmented-button.scss +8 -3
  274. package/src/select/select.scss +2 -1
  275. package/src/side-sheet/side-sheet.scss +4 -2
  276. package/src/site-header/site-header.scss +4 -4
  277. package/src/site-header/site-nav-menu.scss +2 -2
  278. package/src/slider/slider.scss +127 -64
  279. package/src/slider/slider.ts +80 -10
  280. package/src/snackbar/snackbar.scss +5 -2
  281. package/src/sparkline/sparkline.scss +6 -3
  282. package/src/split-button/split-button.scss +4 -2
  283. package/src/stepper/step.scss +2 -1
  284. package/src/switch/switch.scss +21 -2
  285. package/src/table/table.scss +8 -4
  286. package/src/tabs/tab-group.ts +12 -2
  287. package/src/tabs/tab-panel.scss +31 -0
  288. package/src/tabs/tab.scss +28 -17
  289. package/src/toolbar/toolbar-colors.scss +11 -0
  290. package/src/toolbar/toolbar.scss +28 -0
  291. package/src/toolbar/toolbar.ts +74 -1
  292. package/src/tooltip/tooltip.scss +9 -3
  293. package/src/tour/tour.scss +2 -2
  294. package/src/tree/tree-item.scss +2 -1
  295. package/src/tree-chart/tree-chart.scss +3 -3
  296. package/src/video/video.scss +2 -1
  297. package/src/workflow/workflow.scss +5 -5
  298. package/dist/document-editor-CZBlz3ai.js.map +0 -1
  299. package/dist/progress-base-BhJK__VP.js.map +0 -1
  300. package/dist/toggle-base-DP3PSXbf.js.map +0 -1
@@ -30,6 +30,8 @@ export interface CarouselChangeDetail {
30
30
  * @csspart controls - The row of buttons under the slides.
31
31
  *
32
32
  * @cssprop --carousel-gap - Space between slides. Defaults to `--spacing-200`.
33
+ * @cssprop --carousel-peek - With `layout="hero"`, how much of the next slide shows. Defaults to 25%.
34
+ * @cssprop --carousel-slide-shape - With `layout="hero"` or `layout="multi-browse"`, the slides' corner radius. Defaults to var(--shape-corner-extra-large).
33
35
  *
34
36
  * @fires {CustomEvent<CarouselChangeDetail>} change - Dispatched when the slides in view change because the person used a control or scrolled, or autoplay moved on.
35
37
  *
@@ -64,6 +66,15 @@ export declare class Carousel extends LitElement {
64
66
  autoplay: boolean;
65
67
  /** How long each page shows while `autoplay` runs, in milliseconds. */
66
68
  interval: number;
69
+ /**
70
+ * `default` lays out `per-view` equal slides. `hero` is the M3 Expressive hero layout: one large
71
+ * slide with the next one peeking in at the end, rounded corners, and slides that grow as they
72
+ * scroll into place. `multi-browse` is the M3 Expressive multi-browse layout: a large slide, then a
73
+ * medium and a small one, and slides grow and shrink as they scroll through those places. Both
74
+ * page one slide at a time and ignore `per-view`. Browsers without scroll-driven animations show
75
+ * `multi-browse` slides at the large size.
76
+ */
77
+ layout: 'default' | 'hero' | 'multi-browse';
67
78
  private slideCount;
68
79
  /** How many slides fit: `per-view`, or fewer when the carousel is narrow. */
69
80
  private visible;
@@ -83,6 +94,10 @@ export declare class Carousel extends LitElement {
83
94
  /** Whether the next scroll to `index` is animated. */
84
95
  private smoothScroll;
85
96
  private timer?;
97
+ /** Holds the multi-browse keyframes, which depend on the carousel's width. */
98
+ private multiBrowseStyle?;
99
+ /** Scroll distance from one multi-browse slide to the next, in pixels. 0 in other layouts. */
100
+ private multiBrowseStep;
86
101
  private settleTimer?;
87
102
  private readonly resizeObserver;
88
103
  private readonly reducedMotion;
@@ -108,6 +123,13 @@ export declare class Carousel extends LitElement {
108
123
  private moveTo;
109
124
  private dispatchChange;
110
125
  private syncVisible;
126
+ /**
127
+ * Lays out `multi-browse`. Every slide is as wide as the large item, and slides overlap so one
128
+ * scroll step is a third (or half) of the carousel. A scroll-driven animation then moves and
129
+ * clips each slide onto the keylines: large at the start, then medium, then small. Neighbours
130
+ * pass between the same pair of keylines at the same time, so they stay a gap apart.
131
+ */
132
+ private syncMultiBrowse;
111
133
  /** Names each slide and makes the ones out of view inert. */
112
134
  private syncSlides;
113
135
  private scrollToIndex;
@@ -26,6 +26,10 @@ declare const Chip_base: import("../../__internal/mixins/mixin.js").MixinReturn<
26
26
  *
27
27
  * @fires {CustomEvent} dismiss - Dispatched when the dismiss button of a `dismissible` chip is clicked.
28
28
  *
29
+ * @cssprop --chip-container-shape - Corner radius at rest. Defaults to var(--shape-corner-small).
30
+ * @cssprop --chip-container-selected-shape - Corner radius while selected. Defaults to var(--shape-corner-medium).
31
+ * @cssprop --chip-container-pressed-shape - Corner radius while pressed. Defaults to var(--shape-corner-extra-small).
32
+ *
29
33
  * @example
30
34
  * ```html
31
35
  * <wc-chip>Chip content</wc-chip>
@@ -73,7 +73,7 @@ export declare class DatePicker extends LitElement {
73
73
  /** Peacock's strings for the navigation and action buttons. */
74
74
  private readonly i18n;
75
75
  protected willUpdate(changed: Map<PropertyKey, unknown>): void;
76
- protected updated(): void;
76
+ protected updated(changed: Map<PropertyKey, unknown>): void;
77
77
  /** Moves focus to the active day (or month or year). */
78
78
  focus(): void;
79
79
  private get resolvedLocale();
@@ -90,6 +90,11 @@ export declare class DatePicker extends LitElement {
90
90
  private emit;
91
91
  private select;
92
92
  private shiftView;
93
+ /**
94
+ * M3 Expressive: when the shown month changes in the day view, the new month slides in from the
95
+ * side it comes from (`data-enter` on `.months`), like a tab panel.
96
+ */
97
+ private slideMonths;
93
98
  private cycleView;
94
99
  private focusActive;
95
100
  private moveActive;
@@ -192,6 +192,8 @@ export declare class DocumentEditor extends LitElement implements RichTextMentio
192
192
  private _produced?;
193
193
  private _inputTimer?;
194
194
  private _paginateFrame?;
195
+ /** A click below a page break is smooth-scrolling the caret into view. */
196
+ private _revealingCaret;
195
197
  private _changed;
196
198
  private _resizeObserver?;
197
199
  /** Watches the canvas's width for the fit-width zoom. */
@@ -0,0 +1,30 @@
1
+ import { LitElement } from 'lit';
2
+ /**
3
+ * @label FAB Menu Item
4
+ * @tag wc-fab-menu-item
5
+ * @rawTag fab-menu-item
6
+ * @summary One action in a `wc-fab-menu`: a pill with an icon and a label.
7
+ * @overview
8
+ * <p>Use inside <code>wc-fab-menu</code>. The default slot holds the label and <code>icon</code>
9
+ * names the leading icon. Listen for <code>click</code> to run the action; the menu closes
10
+ * itself.</p>
11
+ * @tags controls
12
+ *
13
+ * @example
14
+ * ```html
15
+ * <wc-fab-menu-item icon="edit">Note</wc-fab-menu-item>
16
+ * ```
17
+ */
18
+ export declare class FabMenuItem extends LitElement {
19
+ static styles: import("lit").CSSResultGroup[];
20
+ /** @nocollapse */ static shadowRootOptions: ShadowRootInit;
21
+ /** Name of the leading icon. */
22
+ icon?: string;
23
+ /** Disables the item. */
24
+ disabled: boolean;
25
+ /** Set by the menu: whether the item is shown. */
26
+ shown: boolean;
27
+ /** Set by the menu: its color set. */
28
+ color: 'primary' | 'secondary' | 'tertiary';
29
+ render(): import("lit-html").TemplateResult<1>;
30
+ }
@@ -0,0 +1,64 @@
1
+ import { LitElement } from 'lit';
2
+ import { FabMenuItem } from './fab-menu-item.js';
3
+ /**
4
+ * @label FAB Menu
5
+ * @tag wc-fab-menu
6
+ * @rawTag fab-menu
7
+ * @summary A floating action button that opens into a short list of related actions.
8
+ * @overview
9
+ * <p>The M3 Expressive FAB menu. Put two to six <code>wc-fab-menu-item</code> elements inside.
10
+ * Pressing the FAB morphs it into a round close button and springs the items in, nearest first.
11
+ * Choosing an item, pressing Escape or clicking outside closes the menu.</p>
12
+ * <p><code>icon</code> sets the FAB's icon (<code>add</code> by default) and <code>label</code> its
13
+ * accessible name. <code>color</code> picks the color set: <code>primary</code> (default),
14
+ * <code>secondary</code> or <code>tertiary</code>. Items line up at the end of the FAB, or at its
15
+ * start with <code>align="start"</code>.</p>
16
+ * <p>The FAB is a button with <code>aria-expanded</code>. When the menu opens from the keyboard,
17
+ * focus moves to the first item; closing returns it to the FAB.</p>
18
+ * @tags controls
19
+ *
20
+ * @fires {CustomEvent<{open: boolean}>} toggle - Dispatched when the menu opens or closes.
21
+ *
22
+ * @example
23
+ * ```html
24
+ * <wc-fab-menu label="Create">
25
+ * <wc-fab-menu-item icon="edit">Note</wc-fab-menu-item>
26
+ * <wc-fab-menu-item icon="checklist">List</wc-fab-menu-item>
27
+ * <wc-fab-menu-item icon="image">Image</wc-fab-menu-item>
28
+ * </wc-fab-menu>
29
+ * ```
30
+ */
31
+ export declare class FabMenu extends LitElement {
32
+ static styles: import("lit").CSSResultGroup[];
33
+ static Item: typeof FabMenuItem;
34
+ /** Whether the menu is open. */
35
+ open: boolean;
36
+ /** Icon of the closed FAB. */
37
+ icon: string;
38
+ /** Accessible name of the FAB. Defaults to "Open menu". */
39
+ label?: string;
40
+ /** Color set of the FAB and the items. */
41
+ color: 'primary' | 'secondary' | 'tertiary';
42
+ /** Which edge the items line up with. */
43
+ align: 'start' | 'end';
44
+ private _fab?;
45
+ private readonly _i18n;
46
+ private readonly _listId;
47
+ /** Whether the last open came from the keyboard, so focus moves into the list. */
48
+ private _openedByKeyboard;
49
+ disconnectedCallback(): void;
50
+ /** Opens the menu. */
51
+ show(): void;
52
+ /** Closes the menu. */
53
+ hide(): void;
54
+ private _items;
55
+ private _setOpen;
56
+ protected updated(changed: Map<string, unknown>): void;
57
+ /** Tells each item whether it is shown, its stagger delay, and the color set. */
58
+ private _syncItems;
59
+ private _onOutside;
60
+ private _onFabClick;
61
+ private _onKeyDown;
62
+ private _onItemClick;
63
+ render(): import("lit-html").TemplateResult<1>;
64
+ }
@@ -0,0 +1,2 @@
1
+ export { FabMenu } from './fab-menu.js';
2
+ export { FabMenuItem } from './fab-menu-item.js';
@@ -10,6 +10,8 @@ export { default as ButtonGroup } from './button/button-group/button-group.js';
10
10
  export { SegmentedButton } from './segmented-button/segmented-button.js';
11
11
  export { SegmentedButtonGroup } from './segmented-button/segmented-button-group.js';
12
12
  export { SplitButton } from './split-button/split-button.js';
13
+ export { FabMenu } from './fab-menu/fab-menu.js';
14
+ export { FabMenuItem } from './fab-menu/fab-menu-item.js';
13
15
  export { DropdownButton } from './dropdown-button/dropdown-button.js';
14
16
  export { Divider } from './divider/divider.js';
15
17
  export { Elevation } from './elevation/elevation.js';
@@ -29,6 +31,7 @@ export { NotificationManager } from './notification-manager/notification-manager
29
31
  export { Tag } from './chip/tag/tag.js';
30
32
  export { LinearProgress } from './progress/linear-progress/linear-progress.js';
31
33
  export { CircularProgress } from './progress/circular-progress/circular-progress.js';
34
+ export { LoadingIndicator } from './loading-indicator/loading-indicator.js';
32
35
  export { Skeleton } from './skeleton/skeleton.js';
33
36
  export { Field } from './field/field.js';
34
37
  export { Input } from './input/input.js';
@@ -0,0 +1 @@
1
+ export { LoadingIndicator } from './loading-indicator.js';
@@ -0,0 +1,44 @@
1
+ import { LitElement } from 'lit';
2
+ declare const LoadingIndicator_base: import("../__internal/mixins/mixin.js").MixinReturn<typeof LitElement>;
3
+ /**
4
+ * @label Loading Indicator
5
+ * @tag wc-loading-indicator
6
+ * @rawTag loading-indicator
7
+ * @summary An expressive spinner that morphs between rounded shapes while it turns, for short waits of unknown length.
8
+ * @overview
9
+ * <p>Use it for waits of a few seconds whose length is unknown, such as loading a page or
10
+ * refreshing content. For longer work, or when progress is known, use
11
+ * <code>wc-circular-progress</code> or <code>wc-linear-progress</code>.</p>
12
+ * <p><code>contained</code> draws it on a round container, for use over content such as
13
+ * pull-to-refresh. Set the size with <code>--loading-indicator-size</code> (48px by default).</p>
14
+ * <p>It is named "Loading" unless an <code>aria-label</code> on the element names it. With
15
+ * reduced motion it morphs more slowly and turns at a slow, steady speed.</p>
16
+ * @tags display
17
+ *
18
+ * @cssprop --loading-indicator-size - Width and height. Defaults to 3rem.
19
+ * @cssprop --loading-indicator-color - Shape color. Defaults to var(--color-primary), or var(--color-on-primary-container) when contained.
20
+ * @cssprop --loading-indicator-container-color - Container color when `contained`. Defaults to var(--color-primary-container).
21
+ *
22
+ * @example
23
+ * ```html
24
+ * <wc-loading-indicator></wc-loading-indicator>
25
+ * <wc-loading-indicator contained></wc-loading-indicator>
26
+ * ```
27
+ */
28
+ export declare class LoadingIndicator extends LoadingIndicator_base {
29
+ static styles: import("lit").CSSResultGroup[];
30
+ /** Draws the indicator on a round container. */
31
+ contained: boolean;
32
+ private _shape?;
33
+ private readonly _i18n;
34
+ private _frame;
35
+ private _start;
36
+ connectedCallback(): void;
37
+ disconnectedCallback(): void;
38
+ private _tick;
39
+ /** Draws the frame `elapsed` ms after the indicator appeared. */
40
+ private _draw;
41
+ firstUpdated(): void;
42
+ render(): import("lit-html").TemplateResult<1>;
43
+ }
44
+ export {};
@@ -0,0 +1,29 @@
1
+ /**
2
+ * The shapes wc-loading-indicator morphs through, after the M3 Expressive loading indicator:
3
+ * soft burst, 9-sided cookie, pentagon, pill, sunny, 4-sided cookie and oval.
4
+ *
5
+ * Every shape is a polar function sampled at the same angles, so morphing is a per-point blend
6
+ * of radii. Radii are normalised so each shape's furthest point is 1.
7
+ */
8
+ /** Points per shape. Enough to look smooth at large sizes, cheap enough to blend every frame. */
9
+ export declare const SHAPE_POINTS = 180;
10
+ /** Every shape as normalised radii, in the order they morph. */
11
+ export declare const SHAPE_RADII: readonly Float32Array[];
12
+ /**
13
+ * For each shape, the turn (in samples) that best lines the next shape up with it, so matching
14
+ * lobes travel the shortest way during the morph. `PAIR_OFFSETS[i]` is for shape i to shape i + 1.
15
+ */
16
+ export declare const PAIR_OFFSETS: readonly number[];
17
+ /**
18
+ * An SVG path for a shape on its way from `from` to `to`: a per-point blend of radii, so the
19
+ * outline stays a recognisable shape the whole way through.
20
+ *
21
+ * @param from Radii of the shape being left.
22
+ * @param to Radii of the shape being reached.
23
+ * @param progress 0 at `from`, 1 at `to`.
24
+ * @param size Radius in viewBox units of a point whose normalised radius is 1.
25
+ * @param center Centre of the shape in viewBox units.
26
+ * @param offset Samples to turn `to` by before blending (see PAIR_OFFSETS). At 1 the path is
27
+ * `to` turned back by `offset` samples, which the caller makes up with its rotation.
28
+ */
29
+ export declare function blendPath(from: Float32Array, to: Float32Array, progress: number, size: number, center: number, offset?: number): string;
@@ -62,6 +62,8 @@ export declare class Modal extends LitElement {
62
62
  private _panel?;
63
63
  /** Peacock's strings for the close button label. */
64
64
  private readonly i18n;
65
+ /** Whether the current press began on the scrim, so a drag that ends there is not a scrim click. */
66
+ private _pressStartedOnScrim;
65
67
  private readonly overlay;
66
68
  protected updated(changed: PropertyValues<this>): void;
67
69
  /** Opens the modal. */
@@ -78,6 +80,8 @@ export declare class Modal extends LitElement {
78
80
  * the dialog (a popover, menu or select closing; they bubble and are composed) is not ours.
79
81
  */
80
82
  private _handleNativeClose;
83
+ /** Records where a press starts: a drag that begins in the content and ends on the scrim must not close. */
84
+ private _handleDialogPointerDown;
81
85
  /** A click that lands outside the dialog container, not on its content, is a scrim click. */
82
86
  private _handleDialogClick;
83
87
  private _handleCloseClick;
@@ -9,7 +9,9 @@ import { ProgressBase } from '../progress-base.js';
9
9
  * range. The visible <code>label</code> names the indicator through
10
10
  * <code>aria-labelledby</code>; without one, an <code>aria-label</code> on the element names it,
11
11
  * else it is named "Loading". With
12
- * <code>indeterminate</code> it spins, for a wait of unknown length.</p>
12
+ * <code>indeterminate</code> it spins, for a wait of unknown length. <code>wavy</code> draws the
13
+ * indicator as a rippling ring, the M3 Expressive style; for short waits also consider
14
+ * <code>wc-loading-indicator</code>.</p>
13
15
  * @tags display
14
16
  *
15
17
  * @example
@@ -8,7 +8,8 @@ import { ProgressBase } from '../progress-base.js';
8
8
  * <p><code>value</code> runs from 0 to <code>max</code> (default 100) and is clamped into that
9
9
  * range. The visible <code>label</code> names the bar through <code>aria-labelledby</code>; without
10
10
  * one, an <code>aria-label</code> on the element names it, else it is named "Loading". Use <code>indeterminate</code> when the amount of work is not
11
- * known.</p>
11
+ * known. <code>wavy</code> draws the filled part as a moving wave, the M3 Expressive style; it
12
+ * flattens once the task is complete.</p>
12
13
  * @tags display
13
14
  *
14
15
  * @example
@@ -21,6 +21,11 @@ export declare class ProgressBase extends ProgressBase_base {
21
21
  helperText?: string;
22
22
  /** Lays out the label and the indicator on one line instead of stacking them. */
23
23
  inline: boolean;
24
+ /**
25
+ * Draws the active indicator as a wave, the M3 Expressive style. The wave flattens out once the
26
+ * task is complete, and stops moving with reduced motion.
27
+ */
28
+ wavy: boolean;
24
29
  /** Peacock's strings, for the fallback accessible name. */
25
30
  protected readonly i18n: I18nController;
26
31
  /** The bar's name without a visible `label`: the host's `aria-label`, else "Loading". */
@@ -29,6 +34,8 @@ export declare class ProgressBase extends ProgressBase_base {
29
34
  protected get __max(): number;
30
35
  /** `value` clamped into `0`–`max`; 0 when unset. */
31
36
  protected get __clampedValue(): number;
37
+ /** Whether a determinate task has reached `max`. */
38
+ protected get __complete(): boolean;
32
39
  /** The clamped value as a percentage of `max`. */
33
40
  __getPercentageValue(): number;
34
41
  }
@@ -1,5 +1,5 @@
1
1
  import type { FormRestoreState } from '../__internal/mixins/form-associated.js';
2
- import type { Size } from '../__internal/utils/size.js';
2
+ import type { ScaleSize } from '../__internal/utils/size.js';
3
3
  import InputBase, { type ControlValidity } from '../__internal/input-base.js';
4
4
  /** Where the slider shows its value: on the thumb while it is used, after the track, or not. */
5
5
  export type SliderValueLabel = 'thumb' | 'end' | 'none';
@@ -19,6 +19,8 @@ export type SliderValueLabel = 'thumb' | 'end' | 'none';
19
19
  * <code>v =&gt; `${v}%`</code>.</p>
20
20
  * <p><code>required</code> does not apply: a slider always has a value. <code>readonly</code> keeps
21
21
  * it focusable but its value cannot change.</p>
22
+ * <p>The look follows Material 3 Expressive: a thick track split around a slim handle, a stop
23
+ * dot at the end, five <code>size</code>s, and an optional <code>icon</code> inside the track.</p>
22
24
  * <p>Keyboard: the arrows move one step (ten with Shift), Page Up and Page Down move ten steps,
23
25
  * Home and End go to <code>min</code> and <code>max</code>.</p>
24
26
  *
@@ -58,8 +60,16 @@ export declare class Slider extends InputBase {
58
60
  error: boolean;
59
61
  /** Error message shown below the slider while `error` is set; replaces the help text. */
60
62
  errorText: string;
61
- /** Size of the track and thumb: `sm` (default), `md` or `lg`. */
62
- size: Size;
63
+ /**
64
+ * Size of the track and handle, from the M3 Expressive scale: `xs` (16px track, the default),
65
+ * `sm` (24px), `md` (40px), `lg` (56px) or `xl` (96px).
66
+ */
67
+ size: ScaleSize;
68
+ /**
69
+ * Name of an icon shown inside the track, at its start (`md` and larger). It sits on the active
70
+ * part while it fits there, else just after the handle.
71
+ */
72
+ icon?: string;
63
73
  /**
64
74
  * Where the value shows: `thumb` (on the thumb while it is used; the default), `end` (after the
65
75
  * track) or `none`.
@@ -69,6 +79,9 @@ export declare class Slider extends InputBase {
69
79
  valueText?: (value: number) => string;
70
80
  /** True while the user is actively dragging the thumb. */
71
81
  private isDragging;
82
+ /** Width of the track in px, for placing the inset icon. */
83
+ private trackWidth;
84
+ private resizeObserver?;
72
85
  private container;
73
86
  private thumbElement;
74
87
  /** The value set by the consumer or the person; `undefined` means the midpoint. */
@@ -79,6 +92,8 @@ export declare class Slider extends InputBase {
79
92
  /** Peacock's strings for the thumb label. */
80
93
  private readonly i18n;
81
94
  connectedCallback(): void;
95
+ firstUpdated(): void;
96
+ disconnectedCallback(): void;
82
97
  focus(): void;
83
98
  blur(): void;
84
99
  formResetCallback(): void;
@@ -103,5 +118,10 @@ export declare class Slider extends InputBase {
103
118
  private handleKeyDown;
104
119
  /** A suggestion for a slider is a number. */
105
120
  protected writeSuggestionValue(value: unknown): void;
121
+ /**
122
+ * The inset icon: on the active part of the track while it fits there, else on the inactive part
123
+ * just after the handle. Shown from `md` up, where the track is tall enough.
124
+ */
125
+ private renderIcon;
106
126
  render(): import("lit-html").TemplateResult<1>;
107
127
  }
@@ -20,12 +20,17 @@ import { LitElement } from 'lit';
20
20
  * disabled or hidden, the next enabled action (else the previous one) takes it over. Give the
21
21
  * toolbar an <code>aria-label</code>.</p>
22
22
  *
23
+ * <p>With <code>hide-on-scroll</code>, a floating toolbar slides away while the page scrolls down
24
+ * and comes back as soon as it scrolls up, the M3 Expressive behavior for a toolbar docked over
25
+ * long content. It stays while focus is inside it.</p>
26
+ *
23
27
  * @cssprop --toolbar-container-color - Background color of the toolbar.
24
28
  * @cssprop --toolbar-container-shape - Border radius of the floating toolbar.
25
29
  * @cssprop --toolbar-padding - Padding of the floating toolbar.
26
30
  * @cssprop --toolbar-gap - Gap between toolbar actions.
27
31
  * @cssprop --toolbar-icon-color - Color of icons inside the toolbar.
28
32
  * @cssprop --toolbar-content-color - Color of text inside the toolbar.
33
+ * @cssprop --toolbar-hide-distance - How far a `hide-on-scroll` toolbar travels as it slides away. Defaults to 150% of its size; set it to clear a gap below a docked toolbar.
29
34
  * @cssprop --toolbar-wrap - `wrap` lets actions flow onto more lines when the toolbar is narrow. Defaults to `nowrap`.
30
35
  *
31
36
  * @example
@@ -73,10 +78,22 @@ export declare class Toolbar extends LitElement {
73
78
  * (Left/Right for horizontal, Up/Down for vertical).
74
79
  */
75
80
  orientation: 'horizontal' | 'vertical';
81
+ /**
82
+ * Color scheme of a floating toolbar: `standard` (surface container, the default) or `vibrant`
83
+ * (primary container), the M3 Expressive scheme for a toolbar that should stand out.
84
+ */
85
+ color: 'standard' | 'vibrant';
76
86
  /**
77
87
  * Raises the floating toolbar to a higher elevation. Has no effect on the flat variant.
78
88
  */
79
89
  elevated: boolean;
90
+ /**
91
+ * Slides the toolbar away while the page, or any scroll container in it, scrolls down, and back
92
+ * when it scrolls up. A horizontal toolbar moves down, a vertical one towards the end edge.
93
+ */
94
+ hideOnScroll: boolean;
95
+ /** Whether `hide-on-scroll` has slid the toolbar away. */
96
+ private scrolledAway;
80
97
  /** The toolbar's single tab stop, moved with the arrow keys along its orientation. */
81
98
  private readonly roving;
82
99
  /**
@@ -84,6 +101,8 @@ export declare class Toolbar extends LitElement {
84
101
  * to the next enabled action instead of leaving the toolbar out of the Tab order.
85
102
  */
86
103
  private readonly __actionStateObserver;
104
+ /** Last scroll offset seen per scroll container, and where the current run of scrolling began. */
105
+ private readonly __scrollOffsets;
87
106
  connectedCallback(): void;
88
107
  disconnectedCallback(): void;
89
108
  updated(changed: Map<string, unknown>): void;
@@ -93,5 +112,6 @@ export declare class Toolbar extends LitElement {
93
112
  */
94
113
  private __getItems;
95
114
  private __handleSlotChange;
115
+ private __handleScroll;
96
116
  render(): import("lit-html").TemplateResult<1>;
97
117
  }
package/dist/step.js CHANGED
@@ -100,7 +100,7 @@ var css_248z = i`* {
100
100
  background: var(--color-on-surface);
101
101
  opacity: 0;
102
102
  pointer-events: none;
103
- transition: opacity var(--duration-short4) var(--easing-standard);
103
+ transition: opacity var(--motion-spring-fast-effects-duration) var(--motion-spring-fast-effects-easing);
104
104
  }
105
105
  .step.clickable:hover::before {
106
106
  opacity: 0.08;
package/dist/switch.js CHANGED
@@ -4,7 +4,7 @@ import { e } from './class-map-DN-g_e4M.js';
4
4
  import './toggle-surface-CkMdGtyR.js';
5
5
  import { s as spread } from './spread-B5cgadZl.js';
6
6
  import { p as peacockString } from './strings-DeiQWMd9.js';
7
- import { T as ToggleBase } from './toggle-base-DP3PSXbf.js';
7
+ import { T as ToggleBase } from './toggle-base-CVO9YntI.js';
8
8
  import './directive-ZPhl09Yt.js';
9
9
  import './define-element-DwIWgY_Y.js';
10
10
  import './platform-DHfE4Fvo.js';
@@ -17,6 +17,7 @@ import './input-base-u60DF-pm.js';
17
17
  import './suggestion-controller-DhXsD9gH.js';
18
18
  import './ai-controller-DR_Tg0sN.js';
19
19
  import './locale-DEsJZCQG.js';
20
+ import './haptics-CAaQ2E-9.js';
20
21
 
21
22
  var css_248z = i`* {
22
23
  box-sizing: border-box;
@@ -91,7 +92,7 @@ var css_248z = i`* {
91
92
  border-radius: var(--shape-corner-full);
92
93
  cursor: pointer;
93
94
  display: flex;
94
- transition: background-color var(--duration-short2) var(--easing-standard);
95
+ transition: background-color var(--motion-spring-fast-effects-duration) var(--motion-spring-fast-effects-easing), border-color var(--motion-spring-fast-effects-duration) var(--motion-spring-fast-effects-easing);
95
96
  align-items: center;
96
97
  width: var(--_container-width);
97
98
  height: var(--_container-height);
@@ -102,7 +103,7 @@ var css_248z = i`* {
102
103
  align-items: center;
103
104
  justify-content: center;
104
105
  border-radius: var(--shape-corner-full);
105
- transition: all var(--duration-short2) var(--easing-standard);
106
+ transition: margin-inline-start var(--motion-spring-fast-spatial-duration) var(--motion-spring-fast-spatial-easing), width var(--motion-spring-fast-spatial-duration) var(--motion-spring-fast-spatial-easing), height var(--motion-spring-fast-spatial-duration) var(--motion-spring-fast-spatial-easing), background-color var(--motion-spring-fast-effects-duration) var(--motion-spring-fast-effects-easing);
106
107
  height: var(--switch-handle-radius);
107
108
  width: var(--switch-handle-radius);
108
109
  background: var(--switch-handle-color);
@@ -150,6 +151,9 @@ var css_248z = i`* {
150
151
  --switch-handle-radius: 22px;
151
152
  --switch-handle-color: var(--color-surface-container-lowest);
152
153
  }
154
+ .switch.active:not(.disabled, .readonly) {
155
+ --switch-handle-radius: 26px;
156
+ }
153
157
 
154
158
  .switch.readonly {
155
159
  cursor: default;
@@ -1 +1 @@
1
- {"version":3,"file":"switch.js","sources":["../../src/switch/switch.ts"],"sourcesContent":["import { html, nothing } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\n\nimport '@/__internal/agent/toggle-surface.js';\nimport type { AgentToggleChangeEvent } from '@/__internal/agent/toggle-surface.js';\nimport { spread } from '@/__internal/directive/spread.js';\nimport { peacockString } from '@/__internal/i18n/strings.js';\nimport ToggleBase from '@/__internal/toggle-base.js';\n\nimport styles from './switch.scss';\n\n/**\n * @label Switch\n * @tag wc-switch\n * @rawTag switch\n *\n * @summary An on and off switch for a single setting, such as turning notifications on.\n * @overview\n * <p>The switch is form-associated: when <code>checked</code>, it submits its <code>value</code>\n * (<code>on</code> by default) under its <code>name</code>. With <code>required</code> it blocks form\n * submission until it is on.</p>\n *\n * @cssprop --switch-track-color: Color of the switch track when checked.\n * @cssprop --switch-track-off-color: Color of the switch track when unchecked.\n * @cssprop --switch-width: Width of the switch track.\n * @cssprop --switch-height: Height of the switch track.\n * @cssprop --switch-handle-radius: Size of the switch handle.\n * @cssprop --switch-handle-color: Color of the switch handle.\n *\n * @fires {CustomEvent<{checked: boolean, value: string, originalEvent?: Event}>} change - Dispatched when the switch is toggled.\n *\n * @example\n * ```html\n * <wc-switch checked label=\"Wi-Fi\"></wc-switch>\n * ```\n * @tags input, form\n */\nexport class Switch extends ToggleBase {\n // ── Static ───────────────────────────────────────────────────────────────\n\n static styles = [styles];\n\n // ── Properties ───────────────────────────────────────────────────────────\n // `name`, `disabled`, `required`, `readonly`, `label`, `checked`, `value` and `configAria` are\n // inherited.\n\n /**\n * If true, the toggle has rounded corners. Defaults to `true`.\n */\n @property({ type: Boolean })\n rounded: boolean = true;\n\n /** Shows a check icon in the handle when on and a close icon when off. */\n @property({ type: Boolean, reflect: true, attribute: 'with-icon' })\n withIcon: boolean = false;\n\n // ── Protected methods ────────────────────────────────────────────────────\n\n protected override valueMissingText(): string {\n return peacockString('valueMissingCheckbox');\n }\n\n // ── Private methods ──────────────────────────────────────────────────────\n\n private keyDownHandler = (event: KeyboardEvent) => {\n if (event.key === ' ') {\n event.preventDefault();\n this.isActive = true;\n this.toggleChecked(event);\n }\n };\n\n private clickHandler = (event: MouseEvent) => {\n this.toggleChecked(event);\n };\n\n // ── Render helpers ───────────────────────────────────────────────────────\n\n private renderIcon() {\n if (!this.withIcon) return nothing;\n return this.checked\n ? html`<wc-icon name=\"check\" class=\"icon\"></wc-icon>`\n : html`<wc-icon name=\"close\" class=\"icon\"></wc-icon>`;\n }\n\n /** An agent's change, applied as a click would be; disabled and read-only switches refuse it. */\n private _handleAgentChange(event: AgentToggleChangeEvent) {\n event.stopPropagation();\n if (!this.applyAgentChange(event.detail.value)) event.preventDefault();\n }\n\n // ── Render ───────────────────────────────────────────────────────────────\n\n render() {\n const cssClasses = {\n switch: true,\n 'state-checked': this.checked,\n 'has-focus': this.hasFocus,\n active: this.isActive,\n disabled: this.disabled,\n readonly: this.readonly,\n required: this.required,\n rounded: this.rounded,\n 'has-content': this.slotHasContent,\n };\n\n return html`\n <label class=${classMap(cssClasses)}>\n <agent-switch\n .checked=${!!this.checked}\n .disabled=${this.disabled || !this.agentAvailable}\n .readOnly=${this.readonly}\n .required=${this.required}\n @checkedchange=${this._handleAgentChange}\n >\n <div\n class=\"track container\"\n role=\"switch\"\n aria-checked=${String(this.checked)}\n @mousedown=${this.handleMouseDown}\n @keydown=${this.keyDownHandler}\n @focus=${this.handleFocusChange}\n @blur=${this.handleFocusChange}\n ${spread({\n ...this.controlAttributes(),\n // Named for the agent bridge (ADR-030004): its name comes from the label or slotted text.\n 'aria-label': this.label || this.textContent?.trim() || undefined,\n })}\n >\n <div class=\"handle\">${this.renderIcon()}</div>\n </div>\n </agent-switch>\n\n <input\n type=\"checkbox\"\n class=\"input-native\"\n .checked=${this.checked}\n aria-hidden=\"true\"\n tabindex=\"-1\"\n @click=${this.clickHandler}\n />\n\n ${this.renderLabel()}\n </label>\n `;\n }\n}\n"],"names":["nothing","html","classMap","styles","property"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;AACG,MAAO,MAAO,SAAQ,UAAU,CAAA;AAAtC,IAAA,WAAA,GAAA;;;;;;AASE;;AAEG;QAEH,IAAA,CAAA,OAAO,GAAY,IAAI;;QAIvB,IAAA,CAAA,QAAQ,GAAY,KAAK;;AAUjB,QAAA,IAAA,CAAA,cAAc,GAAG,CAAC,KAAoB,KAAI;AAChD,YAAA,IAAI,KAAK,CAAC,GAAG,KAAK,GAAG,EAAE;gBACrB,KAAK,CAAC,cAAc,EAAE;AACtB,gBAAA,IAAI,CAAC,QAAQ,GAAG,IAAI;AACpB,gBAAA,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC;YAC3B;AACF,QAAA,CAAC;AAEO,QAAA,IAAA,CAAA,YAAY,GAAG,CAAC,KAAiB,KAAI;AAC3C,YAAA,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC;AAC3B,QAAA,CAAC;IAwEH;;IAxFqB,gBA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AA,IAAI,CAAC,cAAc;AACrB,mBAAA,EAAA,IAAI,CAAC,iBAAiB;AACvB,kBAAA,EAAA,IAAI,CAAC,iBAAiB;AAC5B,YAAA,EAAA,MAAM,CAAC;YACP,GAAG,IAAI,CAAC,iBAAiB,EAAE;;AAE3B,YAAA,YAAY,EAAE,IAAI,CAAC,KAAK,IAAI,IAAI,CAAC,WAAW,EAAE,IAAI,EAAE,IAAI,SAAS;SAClE,CAAC;;kCAEoB,IAAI,CAAC,UAAU,EAAE,CAAA;;;;;;;AAO9B,mBAAA,EAAA,IAAI,CAAC,OAAO;;;AAGd,iBAAA,EAAA,IAAI,CAAC,YAAY;;;UAG1B,IAAI,CAAC,WAAW,EAAE;;KAEvB;IACH;;AAzGO,MAAA,CAAA,MAAM,GAAG,CAACC,QAAM,CAAC;AAUxB,UAAA,CAAA;AADC,IAAAC,CAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE;AACH,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAIxB,UAAA,CAAA;AADC,IAAAA,CAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE,SAAS,EAAE,WAAW,EAAE;AACxC,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;;;;"}
1
+ {"version":3,"file":"switch.js","sources":["../../src/switch/switch.ts"],"sourcesContent":["import { html, nothing } from 'lit';\nimport { property } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\n\nimport '@/__internal/agent/toggle-surface.js';\nimport type { AgentToggleChangeEvent } from '@/__internal/agent/toggle-surface.js';\nimport { spread } from '@/__internal/directive/spread.js';\nimport { peacockString } from '@/__internal/i18n/strings.js';\nimport ToggleBase from '@/__internal/toggle-base.js';\n\nimport styles from './switch.scss';\n\n/**\n * @label Switch\n * @tag wc-switch\n * @rawTag switch\n *\n * @summary An on and off switch for a single setting, such as turning notifications on.\n * @overview\n * <p>The switch is form-associated: when <code>checked</code>, it submits its <code>value</code>\n * (<code>on</code> by default) under its <code>name</code>. With <code>required</code> it blocks form\n * submission until it is on.</p>\n *\n * @cssprop --switch-track-color: Color of the switch track when checked.\n * @cssprop --switch-track-off-color: Color of the switch track when unchecked.\n * @cssprop --switch-width: Width of the switch track.\n * @cssprop --switch-height: Height of the switch track.\n * @cssprop --switch-handle-radius: Size of the switch handle.\n * @cssprop --switch-handle-color: Color of the switch handle.\n *\n * @fires {CustomEvent<{checked: boolean, value: string, originalEvent?: Event}>} change - Dispatched when the switch is toggled.\n *\n * @example\n * ```html\n * <wc-switch checked label=\"Wi-Fi\"></wc-switch>\n * ```\n * @tags input, form\n */\nexport class Switch extends ToggleBase {\n // ── Static ───────────────────────────────────────────────────────────────\n\n static styles = [styles];\n\n // ── Properties ───────────────────────────────────────────────────────────\n // `name`, `disabled`, `required`, `readonly`, `label`, `checked`, `value` and `configAria` are\n // inherited.\n\n /**\n * If true, the toggle has rounded corners. Defaults to `true`.\n */\n @property({ type: Boolean })\n rounded: boolean = true;\n\n /** Shows a check icon in the handle when on and a close icon when off. */\n @property({ type: Boolean, reflect: true, attribute: 'with-icon' })\n withIcon: boolean = false;\n\n // ── Protected methods ────────────────────────────────────────────────────\n\n protected override valueMissingText(): string {\n return peacockString('valueMissingCheckbox');\n }\n\n // ── Private methods ──────────────────────────────────────────────────────\n\n private keyDownHandler = (event: KeyboardEvent) => {\n if (event.key === ' ') {\n event.preventDefault();\n this.isActive = true;\n this.toggleChecked(event);\n }\n };\n\n private clickHandler = (event: MouseEvent) => {\n this.toggleChecked(event);\n };\n\n // ── Render helpers ───────────────────────────────────────────────────────\n\n private renderIcon() {\n if (!this.withIcon) return nothing;\n return this.checked\n ? html`<wc-icon name=\"check\" class=\"icon\"></wc-icon>`\n : html`<wc-icon name=\"close\" class=\"icon\"></wc-icon>`;\n }\n\n /** An agent's change, applied as a click would be; disabled and read-only switches refuse it. */\n private _handleAgentChange(event: AgentToggleChangeEvent) {\n event.stopPropagation();\n if (!this.applyAgentChange(event.detail.value)) event.preventDefault();\n }\n\n // ── Render ───────────────────────────────────────────────────────────────\n\n render() {\n const cssClasses = {\n switch: true,\n 'state-checked': this.checked,\n 'has-focus': this.hasFocus,\n active: this.isActive,\n disabled: this.disabled,\n readonly: this.readonly,\n required: this.required,\n rounded: this.rounded,\n 'has-content': this.slotHasContent,\n };\n\n return html`\n <label class=${classMap(cssClasses)}>\n <agent-switch\n .checked=${!!this.checked}\n .disabled=${this.disabled || !this.agentAvailable}\n .readOnly=${this.readonly}\n .required=${this.required}\n @checkedchange=${this._handleAgentChange}\n >\n <div\n class=\"track container\"\n role=\"switch\"\n aria-checked=${String(this.checked)}\n @mousedown=${this.handleMouseDown}\n @keydown=${this.keyDownHandler}\n @focus=${this.handleFocusChange}\n @blur=${this.handleFocusChange}\n ${spread({\n ...this.controlAttributes(),\n // Named for the agent bridge (ADR-030004): its name comes from the label or slotted text.\n 'aria-label': this.label || this.textContent?.trim() || undefined,\n })}\n >\n <div class=\"handle\">${this.renderIcon()}</div>\n </div>\n </agent-switch>\n\n <input\n type=\"checkbox\"\n class=\"input-native\"\n .checked=${this.checked}\n aria-hidden=\"true\"\n tabindex=\"-1\"\n @click=${this.clickHandler}\n />\n\n ${this.renderLabel()}\n </label>\n `;\n }\n}\n"],"names":["nothing","html","classMap","styles","property"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAYA;;;;;;;;;;;;;;;;;;;;;;;;;AAyBG;AACG,MAAO,MAAO,SAAQ,UAAU,CAAA;AAAtC,IAAA,WAAA,GAAA;;;;;;AASE;;AAEG;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E,WAAW,EAAE;AACxC,CAAA,EAAA,MAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;;;;"}
package/dist/tab-group.js CHANGED
@@ -182,9 +182,20 @@ class TabGroup extends i$1 {
182
182
  tab.classList.toggle('previous-tab', index >= 0 && i === index - 1);
183
183
  tab.classList.toggle('next-tab', index >= 0 && i === index + 1);
184
184
  });
185
- this.getTabPanels().forEach((panel, i) => {
185
+ const panels = this.getTabPanels();
186
+ const shown = panels.findIndex(panel => panel.active);
187
+ panels.forEach((panel, i) => {
188
+ const active = keyed ? panel.getAttribute('value') === key : i === index;
189
+ // M3 Expressive: a newly shown panel slides in from the side it sits on relative to the
190
+ // panel it replaces. The first panel shown does not move.
191
+ if (active && !panel.active && shown >= 0) {
192
+ panel.setAttribute('data-enter', i > shown ? 'end' : 'start');
193
+ }
194
+ else if (!active) {
195
+ panel.removeAttribute('data-enter');
196
+ }
186
197
  // eslint-disable-next-line no-param-reassign
187
- panel.active = keyed ? panel.getAttribute('value') === key : i === index;
198
+ panel.active = active;
188
199
  });
189
200
  }
190
201
  /** Links each tab and its panel, and makes sure one tab is selected. */