@redvars/peacock 3.10.0 → 3.11.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 (284) hide show
  1. package/dist/BaseInput-CV0pZgSb.js +58 -0
  2. package/dist/BaseInput-CV0pZgSb.js.map +1 -0
  3. package/dist/app-bar.js +16 -16
  4. package/dist/assets/styles.css +1 -1
  5. package/dist/assets/styles.css.map +1 -1
  6. package/dist/assets/theme.d.ts +66 -0
  7. package/dist/assets/theme.js +134 -0
  8. package/dist/assets/tokens.css +1 -1
  9. package/dist/assets/tokens.css.map +1 -1
  10. package/dist/base-progress-CLZTRveO.js +33 -0
  11. package/dist/base-progress-CLZTRveO.js.map +1 -0
  12. package/dist/bottom-sheet.js +1 -1
  13. package/dist/button-group.js +9 -7
  14. package/dist/button-group.js.map +1 -1
  15. package/dist/button.js +225 -187
  16. package/dist/button.js.map +1 -1
  17. package/dist/{chart-bar-CapLbc2e.js → chart-bar-D5dGFJfK.js} +2 -2
  18. package/dist/{chart-bar-CapLbc2e.js.map → chart-bar-D5dGFJfK.js.map} +1 -1
  19. package/dist/chart-bar.js +1 -1
  20. package/dist/chart-stacked-bar.js +1 -1
  21. package/dist/checkbox.js +78 -53
  22. package/dist/checkbox.js.map +1 -1
  23. package/dist/chip-set.js +52 -0
  24. package/dist/chip-set.js.map +1 -0
  25. package/dist/chip.js +8 -6
  26. package/dist/chip.js.map +1 -1
  27. package/dist/circular-progress.js +177 -0
  28. package/dist/circular-progress.js.map +1 -0
  29. package/dist/code-editor.js +129 -72
  30. package/dist/code-editor.js.map +1 -1
  31. package/dist/code-highlighter.js +2 -38
  32. package/dist/code-highlighter.js.map +1 -1
  33. package/dist/color-field.js +309 -0
  34. package/dist/color-field.js.map +1 -0
  35. package/dist/color-picker.js +26 -15
  36. package/dist/color-picker.js.map +1 -1
  37. package/dist/copy-to-clipboard-upGx-Ueo.js +39 -0
  38. package/dist/copy-to-clipboard-upGx-Ueo.js.map +1 -0
  39. package/dist/custom-elements-jsdocs.json +1044 -382
  40. package/dist/custom-elements.json +8620 -4714
  41. package/dist/date-picker.js +241 -0
  42. package/dist/date-picker.js.map +1 -0
  43. package/dist/{element-internals-2CMts_0M.js → delegate-py-Ets8N.js} +2 -43
  44. package/dist/delegate-py-Ets8N.js.map +1 -0
  45. package/dist/element-internals-QME0yEz4.js +43 -0
  46. package/dist/element-internals-QME0yEz4.js.map +1 -0
  47. package/dist/fab.js +51 -49
  48. package/dist/fab.js.map +1 -1
  49. package/dist/field.js +34 -4
  50. package/dist/field.js.map +1 -1
  51. package/dist/flow.js +5 -5
  52. package/dist/form-associated-Bhwwr6dT.js +162 -0
  53. package/dist/form-associated-Bhwwr6dT.js.map +1 -0
  54. package/dist/{form-associated-BXADnjOB.js → form-submitter-DPI4L6gj.js} +3 -159
  55. package/dist/form-submitter-DPI4L6gj.js.map +1 -0
  56. package/dist/html-editor.js +3 -1
  57. package/dist/html-editor.js.map +1 -1
  58. package/dist/icon-button.js +195 -156
  59. package/dist/icon-button.js.map +1 -1
  60. package/dist/image.js +2 -2
  61. package/dist/index.js +32 -8
  62. package/dist/index.js.map +1 -1
  63. package/dist/input.js +259 -0
  64. package/dist/input.js.map +1 -0
  65. package/dist/item.js +2 -1
  66. package/dist/item.js.map +1 -1
  67. package/dist/linear-progress.js +192 -0
  68. package/dist/linear-progress.js.map +1 -0
  69. package/dist/{list-AdO-PUq_.js → list-item.js} +12 -222
  70. package/dist/list-item.js.map +1 -0
  71. package/dist/list.js +225 -6
  72. package/dist/list.js.map +1 -1
  73. package/dist/loader-full.js +31 -8
  74. package/dist/loader-full.js.map +1 -1
  75. package/dist/loader.js +52 -12
  76. package/dist/loader.js.map +1 -1
  77. package/dist/markdown-editor.js +5 -3
  78. package/dist/markdown-editor.js.map +1 -1
  79. package/dist/menu-item.js +30 -30
  80. package/dist/menu.js +1 -1
  81. package/dist/navigation-bar-item.js +41 -0
  82. package/dist/navigation-bar-item.js.map +1 -0
  83. package/dist/navigation-bar.js +128 -0
  84. package/dist/navigation-bar.js.map +1 -0
  85. package/dist/navigation-drawer-item.js +236 -0
  86. package/dist/navigation-drawer-item.js.map +1 -0
  87. package/dist/navigation-drawer.js +293 -0
  88. package/dist/navigation-drawer.js.map +1 -0
  89. package/dist/navigation-rail.js +1 -1
  90. package/dist/number-field.js +280 -0
  91. package/dist/number-field.js.map +1 -0
  92. package/dist/option.js +17 -0
  93. package/dist/option.js.map +1 -1
  94. package/dist/pagination.js +1 -1
  95. package/dist/radio-group.js +209 -0
  96. package/dist/radio-group.js.map +1 -0
  97. package/dist/radio.js +47 -37
  98. package/dist/radio.js.map +1 -1
  99. package/dist/segmented-button-group.js +12 -0
  100. package/dist/segmented-button-group.js.map +1 -1
  101. package/dist/segmented-button.js +10 -6
  102. package/dist/segmented-button.js.map +1 -1
  103. package/dist/select.js +653 -0
  104. package/dist/select.js.map +1 -0
  105. package/dist/side-sheet.js +1 -1
  106. package/dist/sidebar-menu-item.js +273 -0
  107. package/dist/sidebar-menu-item.js.map +1 -0
  108. package/dist/sidebar-menu.js +193 -0
  109. package/dist/sidebar-menu.js.map +1 -0
  110. package/dist/sidebar-sub-menu.js +301 -0
  111. package/dist/sidebar-sub-menu.js.map +1 -0
  112. package/dist/slider.js +76 -24
  113. package/dist/slider.js.map +1 -1
  114. package/dist/snackbar.js +3 -3
  115. package/dist/snackbar.js.map +1 -1
  116. package/dist/split-button.js +2 -2
  117. package/dist/src/__internal/utils/size.d.ts +9 -0
  118. package/dist/src/button/ButtonTypes.d.ts +1 -1
  119. package/dist/src/checkbox/checkbox.d.ts +28 -22
  120. package/dist/src/chip/chip/chip.d.ts +3 -0
  121. package/dist/src/chip/tag/tag.d.ts +5 -1
  122. package/dist/src/code-editor/code-editor.d.ts +37 -10
  123. package/dist/src/color-field/color-field.d.ts +55 -0
  124. package/dist/src/color-field/index.d.ts +1 -0
  125. package/dist/src/color-picker/color-picker.d.ts +1 -1
  126. package/dist/src/date-picker/date-picker.d.ts +0 -1
  127. package/dist/src/field/field.d.ts +2 -0
  128. package/dist/src/index.d.ts +4 -3
  129. package/dist/src/input/BaseInput.d.ts +21 -3
  130. package/dist/src/input/input.d.ts +15 -7
  131. package/dist/src/navigation-bar/index.d.ts +2 -0
  132. package/dist/src/navigation-bar/navigation-bar-item.d.ts +23 -0
  133. package/dist/src/navigation-bar/navigation-bar.d.ts +44 -0
  134. package/dist/src/navigation-drawer/index.d.ts +2 -0
  135. package/dist/src/navigation-drawer/navigation-drawer-item.d.ts +48 -0
  136. package/dist/src/navigation-drawer/navigation-drawer.d.ts +70 -0
  137. package/dist/src/number-field/number-field.d.ts +0 -1
  138. package/dist/src/radio/index.d.ts +1 -0
  139. package/dist/src/radio/radio-group.d.ts +50 -0
  140. package/dist/src/radio/radio.d.ts +18 -18
  141. package/dist/src/segmented-button/segmented-button-group.d.ts +5 -0
  142. package/dist/src/segmented-button/segmented-button.d.ts +2 -1
  143. package/dist/src/select/select.d.ts +7 -0
  144. package/dist/src/slider/slider.d.ts +14 -5
  145. package/dist/src/switch/switch.d.ts +22 -26
  146. package/dist/src/tabs/tabs.d.ts +3 -0
  147. package/dist/src/textarea/textarea.d.ts +0 -1
  148. package/dist/src/time-picker/time-picker.d.ts +0 -1
  149. package/dist/src/toolbar/toolbar.d.ts +7 -4
  150. package/dist/src/url-field/url-field.d.ts +0 -1
  151. package/dist/svg.js +5 -5
  152. package/dist/switch.js +413 -0
  153. package/dist/switch.js.map +1 -0
  154. package/dist/tab.js +2 -1
  155. package/dist/tab.js.map +1 -1
  156. package/dist/tabs.js +10 -8
  157. package/dist/tabs.js.map +1 -1
  158. package/dist/tag.js +349 -0
  159. package/dist/tag.js.map +1 -0
  160. package/dist/test/code-editor.test.d.ts +1 -0
  161. package/dist/test/color-field.test.d.ts +1 -0
  162. package/dist/test/color-picker.test.d.ts +1 -0
  163. package/dist/test/field.test.d.ts +1 -0
  164. package/dist/test/form-controls.test.d.ts +1 -0
  165. package/dist/test/icon.test.d.ts +1 -1
  166. package/dist/test/input.test.d.ts +1 -0
  167. package/dist/test/navigation.test.d.ts +1 -0
  168. package/dist/test/segmented-button.test.d.ts +1 -0
  169. package/dist/test/select.test.d.ts +1 -0
  170. package/dist/test/slider.test.d.ts +1 -0
  171. package/dist/textarea.js +237 -0
  172. package/dist/textarea.js.map +1 -0
  173. package/dist/time-picker.js +241 -0
  174. package/dist/time-picker.js.map +1 -0
  175. package/dist/toolbar.js +26 -9
  176. package/dist/toolbar.js.map +1 -1
  177. package/dist/tsconfig.tsbuildinfo +1 -1
  178. package/dist/url-field.js +298 -0
  179. package/dist/url-field.js.map +1 -0
  180. package/package.json +29 -8
  181. package/readme.md +2 -2
  182. package/scss/tokens.css +175 -18
  183. package/src/__internal/utils/size.ts +23 -0
  184. package/src/app-bar/app-bar.scss +4 -16
  185. package/src/bottom-sheet/bottom-sheet.scss +1 -1
  186. package/src/button/ButtonTypes.ts +2 -0
  187. package/src/button/button/button-base.scss +84 -84
  188. package/src/button/button/button-colors.scss +14 -2
  189. package/src/button/button/button-layers.scss +71 -71
  190. package/src/button/button/button-shapes.scss +2 -2
  191. package/src/button/button/button-sizes.scss +35 -35
  192. package/src/button/button/button.scss +1 -1
  193. package/src/button/button/button.ts +1 -2
  194. package/src/button/button-group/button-group.scss +5 -5
  195. package/src/button/fab/fab-sizes.scss +15 -15
  196. package/src/button/fab/fab.scss +32 -32
  197. package/src/button/icon-button/icon-button-sizes.scss +7 -7
  198. package/src/chart-bar/chart-bar.scss +1 -1
  199. package/src/checkbox/checkbox.scss +7 -6
  200. package/src/checkbox/checkbox.ts +92 -40
  201. package/src/chip/chip/chip.ts +8 -5
  202. package/src/chip/chip-set/chip-set.ts +2 -0
  203. package/src/chip/tag/tag-colors.scss +1 -1
  204. package/src/chip/tag/tag-sizes.scss +9 -0
  205. package/src/chip/tag/tag.scss +1 -1
  206. package/src/chip/tag/tag.ts +20 -9
  207. package/src/code-editor/code-editor.scss +8 -3
  208. package/src/code-editor/code-editor.ts +148 -79
  209. package/src/code-highlighter/code-highlighter.scss +1 -1
  210. package/src/color-field/color-field.scss +48 -0
  211. package/src/color-field/color-field.ts +239 -0
  212. package/src/color-field/index.ts +1 -0
  213. package/src/color-picker/color-picker.scss +33 -15
  214. package/src/color-picker/color-picker.ts +2 -1
  215. package/src/date-picker/date-picker.ts +2 -3
  216. package/src/field/field.scss +31 -0
  217. package/src/field/field.ts +5 -1
  218. package/src/flow/flow.scss +5 -5
  219. package/src/image/image.scss +2 -2
  220. package/src/index.ts +7 -3
  221. package/src/input/BaseInput.ts +54 -4
  222. package/src/input/input.ts +104 -79
  223. package/src/list/list-item.ts +2 -0
  224. package/src/loader.ts +28 -6
  225. package/src/markdown-editor/markdown-editor.scss +2 -2
  226. package/src/menu/menu/menu.scss +1 -1
  227. package/src/menu/menu-item/menu-item.scss +30 -30
  228. package/src/navigation-bar/index.ts +2 -0
  229. package/src/navigation-bar/navigation-bar-item.ts +25 -0
  230. package/src/navigation-bar/navigation-bar.scss +27 -0
  231. package/src/navigation-bar/navigation-bar.ts +96 -0
  232. package/src/navigation-drawer/index.ts +2 -0
  233. package/src/navigation-drawer/navigation-drawer-item.scss +82 -0
  234. package/src/navigation-drawer/navigation-drawer-item.ts +133 -0
  235. package/src/navigation-drawer/navigation-drawer.scss +99 -0
  236. package/src/navigation-drawer/navigation-drawer.ts +196 -0
  237. package/src/navigation-rail/navigation-rail.scss +1 -1
  238. package/src/number-field/number-field.ts +2 -3
  239. package/src/pagination/pagination.scss +1 -1
  240. package/src/progress/circular-progress/circular-progress.ts +2 -0
  241. package/src/progress/linear-progress/linear-progress.ts +2 -0
  242. package/src/radio/index.ts +1 -0
  243. package/src/radio/radio-group.scss +39 -0
  244. package/src/radio/radio-group.ts +167 -0
  245. package/src/radio/radio.ts +74 -31
  246. package/src/segmented-button/segmented-button-group.ts +12 -0
  247. package/src/segmented-button/segmented-button.ts +12 -6
  248. package/src/select/option.ts +17 -0
  249. package/src/select/select.ts +33 -8
  250. package/src/side-sheet/side-sheet.scss +1 -1
  251. package/src/sidebar-menu/sidebar-menu-item.scss +1 -1
  252. package/src/sidebar-menu/sidebar-menu-item.ts +2 -0
  253. package/src/sidebar-menu/sidebar-menu.ts +2 -0
  254. package/src/sidebar-menu/sidebar-sub-menu.scss +1 -1
  255. package/src/sidebar-menu/sidebar-sub-menu.ts +2 -0
  256. package/src/slider/slider.scss +3 -3
  257. package/src/slider/slider.ts +119 -31
  258. package/src/snackbar/snackbar.ts +3 -3
  259. package/src/split-button/split-button-colors.scss +2 -2
  260. package/src/svg/svg.scss +5 -5
  261. package/src/switch/switch.scss +0 -1
  262. package/src/switch/switch.ts +82 -47
  263. package/src/tabs/tab.scss +2 -1
  264. package/src/tabs/tabs.ts +14 -8
  265. package/src/textarea/textarea.ts +2 -3
  266. package/src/time-picker/time-picker.ts +2 -3
  267. package/src/toolbar/toolbar.scss +4 -4
  268. package/src/toolbar/toolbar.ts +12 -5
  269. package/src/url-field/url-field.ts +2 -3
  270. package/dist/BaseInput-CU1zZYKc.js +0 -27
  271. package/dist/BaseInput-CU1zZYKc.js.map +0 -1
  272. package/dist/brand-loader.js +0 -358
  273. package/dist/brand-loader.js.map +0 -1
  274. package/dist/element-internals-2CMts_0M.js.map +0 -1
  275. package/dist/form-associated-BXADnjOB.js.map +0 -1
  276. package/dist/list-AdO-PUq_.js.map +0 -1
  277. package/dist/select-CnnPbvpQ.js +0 -3955
  278. package/dist/select-CnnPbvpQ.js.map +0 -1
  279. package/dist/src/brand-loader/brand-loader.d.ts +0 -33
  280. package/dist/src/brand-loader/index.d.ts +0 -2
  281. package/src/brand-loader/brand-loader.scss +0 -270
  282. package/src/brand-loader/brand-loader.ts +0 -115
  283. package/src/brand-loader/index.ts +0 -2
  284. /package/dist/test/{brand-loader.test.d.ts → button.test.d.ts} +0 -0
@@ -0,0 +1,48 @@
1
+ import { LitElement } from 'lit';
2
+ /**
3
+ * @label Navigation Drawer Item
4
+ * @tag wc-navigation-drawer-item
5
+ * @rawTag navigation-drawer-item
6
+ *
7
+ * @summary A destination in a navigation drawer.
8
+ * @overview
9
+ * <p>A full-width row with an optional icon, a label and an optional badge. The active item gets
10
+ * the pill-shaped active indicator. With <code>href</code> it renders a link, otherwise a button.</p>
11
+ *
12
+ * @slot - The label.
13
+ * @slot icon - Leading icon.
14
+ * @slot badge - Trailing content, such as a count. Overrides the `badge` attribute.
15
+ *
16
+ * @example
17
+ * ```html
18
+ * <wc-navigation-drawer-item active badge="24">
19
+ * <wc-icon slot="icon" name="inbox"></wc-icon>
20
+ * Inbox
21
+ * </wc-navigation-drawer-item>
22
+ * ```
23
+ * @tags navigation
24
+ */
25
+ export declare class NavigationDrawerItem extends LitElement {
26
+ static shadowRootOptions: ShadowRootInit;
27
+ static styles: import("lit").CSSResultGroup[];
28
+ /** Whether this item is the current destination. */
29
+ active: boolean;
30
+ /** Whether this item is disabled. */
31
+ disabled: boolean;
32
+ /** If provided, the item renders as a link. */
33
+ href?: string;
34
+ /** Link target. */
35
+ target: string;
36
+ /** Identifies the item in the drawer's `change` event. */
37
+ value?: string;
38
+ /** Short trailing text, such as an unread count. */
39
+ badge?: string;
40
+ /** True when the `icon` slot has content. */
41
+ private hasIcon;
42
+ readonly itemElement: HTMLElement | null;
43
+ focus(): void;
44
+ blur(): void;
45
+ private handleIconSlotChange;
46
+ private renderContent;
47
+ render(): import("lit-html").TemplateResult<1>;
48
+ }
@@ -0,0 +1,70 @@
1
+ import { LitElement, PropertyValues } from 'lit';
2
+ import { NavigationDrawerItem } from './navigation-drawer-item.js';
3
+ /**
4
+ * @label Navigation Drawer
5
+ * @tag wc-navigation-drawer
6
+ * @rawTag navigation-drawer
7
+ *
8
+ * @summary A side panel listing an app's destinations.
9
+ * @overview
10
+ * <p>Navigation drawer holds <code>wc-navigation-drawer-item</code> destinations. Clicking an item makes
11
+ * it the active one and fires <code>change</code>.</p>
12
+ * <ul>
13
+ * <li><code>variant="standard"</code> (default) sits in the page layout, next to the content.</li>
14
+ * <li><code>variant="modal"</code> opens over the page with a scrim. It traps focus, closes on Escape,
15
+ * on a scrim click and after an item is chosen.</li>
16
+ * </ul>
17
+ * <p>Both variants show only while <code>open</code> is set.</p>
18
+ *
19
+ * @slot - The drawer items. Other content, such as `wc-divider` or section titles, works too.
20
+ * @slot header - Content above the items, after the headline.
21
+ *
22
+ * @fires {CustomEvent<{value: string | undefined, index: number, item: NavigationDrawerItem}>} change - Dispatched when the user activates an item.
23
+ * @fires {CustomEvent} open - Dispatched when the drawer opens.
24
+ * @fires {CustomEvent} close - Dispatched when the drawer closes.
25
+ *
26
+ * @cssprop --navigation-drawer-width - Width of the drawer. Defaults to 22.5rem (360dp).
27
+ * @cssprop --navigation-drawer-container-color - Background of the drawer. Defaults to `--color-surface-container-low`.
28
+ *
29
+ * @example
30
+ * ```html
31
+ * <wc-navigation-drawer open headline="Mail">
32
+ * <wc-navigation-drawer-item active badge="24">
33
+ * <wc-icon slot="icon" name="inbox"></wc-icon>
34
+ * Inbox
35
+ * </wc-navigation-drawer-item>
36
+ * <wc-navigation-drawer-item>
37
+ * <wc-icon slot="icon" name="send"></wc-icon>
38
+ * Sent
39
+ * </wc-navigation-drawer-item>
40
+ * </wc-navigation-drawer>
41
+ * ```
42
+ * @tags navigation
43
+ */
44
+ export declare class NavigationDrawer extends LitElement {
45
+ static styles: import("lit").CSSResultGroup[];
46
+ static Item: typeof NavigationDrawerItem;
47
+ /** Whether the drawer is shown. */
48
+ open: boolean;
49
+ /** `"standard"` sits in the layout; `"modal"` opens over the page with a scrim. */
50
+ variant: 'standard' | 'modal';
51
+ /** Title shown at the top of the drawer. */
52
+ headline: string;
53
+ private dialogElement?;
54
+ connectedCallback(): void;
55
+ disconnectedCallback(): void;
56
+ protected updated(changed: PropertyValues<this>): void;
57
+ /** Opens the drawer. */
58
+ show(): void;
59
+ /** Closes the drawer. */
60
+ close(): void;
61
+ private getItems;
62
+ private syncDialog;
63
+ private handleItemClick;
64
+ /** Escape: close through `open` so the property stays the source of truth. */
65
+ private handleCancel;
66
+ /** A click that lands on the dialog itself, not its content, is a scrim click. */
67
+ private handleDialogClick;
68
+ private renderContent;
69
+ render(): import("lit-html").TemplateResult<1>;
70
+ }
@@ -15,7 +15,6 @@ export declare class NumberField extends BaseInput {
15
15
  #private;
16
16
  static styles: import("lit").CSSResultGroup[];
17
17
  value?: number;
18
- name: string;
19
18
  placeholder: string;
20
19
  label: string;
21
20
  inline: boolean;
@@ -1 +1,2 @@
1
1
  export { Radio } from './radio.js';
2
+ export { RadioGroup } from './radio-group.js';
@@ -0,0 +1,50 @@
1
+ import { LitElement, PropertyValues } from 'lit';
2
+ /**
3
+ * @label Radio Group
4
+ * @tag wc-radio-group
5
+ * @rawTag radio-group
6
+ * @summary Groups radios under one label, one name and one value.
7
+ * @overview
8
+ * <p>Radio group gives its <code>wc-radio</code> children a shared <code>name</code> (its own, or a
9
+ * generated one), so only one can be checked. Its <code>value</code> is the value of the checked radio,
10
+ * and setting it checks the matching radio.</p>
11
+ * <p>The radios stay form-associated, so the group submits once, through the checked radio.</p>
12
+ *
13
+ * @fires {CustomEvent<{value: string}>} change - Dispatched when the user checks a different radio. The group swallows the radios' own `change` events.
14
+ *
15
+ * @cssprop --radio-group-gap - Space between radios. Defaults to `--spacing-100`.
16
+ *
17
+ * @example
18
+ * ```html
19
+ * <wc-radio-group label="Size" name="size" value="md">
20
+ * <wc-radio value="sm" label="Small"></wc-radio>
21
+ * <wc-radio value="md" label="Medium"></wc-radio>
22
+ * <wc-radio value="lg" label="Large"></wc-radio>
23
+ * </wc-radio-group>
24
+ * ```
25
+ * @tags input, form
26
+ */
27
+ export declare class RadioGroup extends LitElement {
28
+ static styles: import("lit").CSSResultGroup[];
29
+ /** Name given to every radio in the group, and submitted with forms. Generated when empty. */
30
+ name: string;
31
+ /** Value of the checked radio. Setting it checks the radio with that value. */
32
+ value: string;
33
+ /** Group label, shown above the radios and used as the accessible name. */
34
+ label: string;
35
+ /** Lays the radios out in a column (default) or a row. */
36
+ orientation: 'vertical' | 'horizontal';
37
+ /** Disables every radio in the group. */
38
+ disabled: boolean;
39
+ /** Marks the group as required. */
40
+ required: boolean;
41
+ private readonly generatedName;
42
+ connectedCallback(): void;
43
+ disconnectedCallback(): void;
44
+ protected updated(changed: PropertyValues<this>): void;
45
+ private getRadios;
46
+ /** Pushes the group's name, value and disabled state down to its radios. */
47
+ private syncRadios;
48
+ private handleRadioChange;
49
+ render(): import("lit-html").TemplateResult<1>;
50
+ }
@@ -1,12 +1,10 @@
1
1
  import { LitElement } from 'lit';
2
- export declare class Radio extends LitElement {
2
+ import { type FormRestoreState, type FormValue, getFormState, getFormValue } from '@/__internal/mixins/form-associated.js';
3
+ declare const Radio_base: import("../__internal/mixins/mixin.js").MixinReturn<(abstract new (...args: any[]) => import("@/__internal/mixins/element-internals.js").WithElementInternals) & typeof LitElement & import("@/__internal/mixins/form-associated.js").FormAssociatedConstructor, import("@/__internal/mixins/form-associated.js").FormAssociated>;
4
+ export declare class Radio extends Radio_base {
3
5
  private static readonly DIRECTION_NEXT;
4
6
  private static readonly DIRECTION_PREVIOUS;
5
7
  static styles: import("lit").CSSResultGroup[];
6
- /**
7
- * The input field name for grouping radios.
8
- */
9
- name: string;
10
8
  /**
11
9
  * The submitted value when this radio is selected.
12
10
  */
@@ -27,10 +25,6 @@ export declare class Radio extends LitElement {
27
25
  * If true, the radio is readonly. Defaults to `false`.
28
26
  */
29
27
  readonly: boolean;
30
- /**
31
- * If true, the user cannot interact with the radio. Defaults to `false`.
32
- */
33
- disabled: boolean;
34
28
  /**
35
29
  * Configuration object for aria attributes.
36
30
  */
@@ -44,13 +38,26 @@ export declare class Radio extends LitElement {
44
38
  /** True for the one radio in the group that should receive tab focus (roving tabindex). */
45
39
  private isGroupFocusTarget;
46
40
  private containerElement?;
47
- private nativeElement?;
48
41
  /** Captured `tabindex` attribute value forwarded to the inner container. */
49
42
  private tabindex?;
43
+ /** `checked` when first connected; `form.reset()` returns to it. */
44
+ private defaultChecked?;
50
45
  connectedCallback(): void;
51
46
  disconnectedCallback(): void;
52
47
  firstUpdated(): void;
53
48
  updated(changedProps: Map<string, unknown>): void;
49
+ /**
50
+ * Sets focus on the radio.
51
+ */
52
+ focus(): void;
53
+ /**
54
+ * Removes focus from the radio.
55
+ */
56
+ blur(): void;
57
+ [getFormValue](): FormValue | null;
58
+ [getFormState](): FormValue | null;
59
+ formResetCallback(): void;
60
+ formStateRestoreCallback(state: FormRestoreState | null): void;
54
61
  private handleInitialAttributes;
55
62
  private windowMouseUp;
56
63
  private windowKeyUp;
@@ -66,13 +73,6 @@ export declare class Radio extends LitElement {
66
73
  private isRadioEnabled;
67
74
  private updateGroupFocusTarget;
68
75
  private navigateGroup;
69
- /**
70
- * Sets focus on the radio.
71
- */
72
- focus(): void;
73
- /**
74
- * Removes focus from the radio.
75
- */
76
- blur(): void;
77
76
  render(): import("lit-html").TemplateResult<1>;
78
77
  }
78
+ export {};
@@ -40,6 +40,11 @@ export declare class SegmentedButtonGroup extends LitElement {
40
40
  nullable: boolean;
41
41
  connectedCallback(): void;
42
42
  disconnectedCallback(): void;
43
+ /**
44
+ * Swallows a segment's own `change` on the way down (capture phase), so listeners on the group
45
+ * and above see only the group's `change`, one per selection.
46
+ */
47
+ private _stopSegmentChange;
43
48
  private _getSegments;
44
49
  private _onSegmentChange;
45
50
  render(): import("lit-html").TemplateResult<1>;
@@ -14,7 +14,8 @@ import { LitElement } from 'lit';
14
14
  * @cssprop --segmented-button-outline-color: Outline / border color.
15
15
  * @cssprop --segmented-button-disabled-opacity: Opacity when the segment is disabled.
16
16
  *
17
- * @fires {CustomEvent} segmented-button--change - Dispatched when the selected state changes.
17
+ * @fires {CustomEvent} change - Dispatched when the segment is activated. Detail: `{ value, selected, originalEvent }`, where `selected` is the requested state. Inside a `wc-segmented-button-group` the group swallows it and fires its own `change` instead.
18
+ * @fires {CustomEvent} segmented-button--change - Deprecated alias of `change`, fired alongside it.
18
19
  *
19
20
  * @example
20
21
  * ```html
@@ -1,3 +1,4 @@
1
+ import { type FormValue, getFormValue } from '@/__internal/mixins/form-associated.js';
1
2
  import BaseInput from '../input/BaseInput.js';
2
3
  export interface SelectOption {
3
4
  label: string;
@@ -17,6 +18,10 @@ export interface SelectOption {
17
18
  * - Client-side typeahead with `search="contains"`
18
19
  * - Server-side typeahead with `search="managed"`
19
20
  * - Multi-select chips display
21
+ * - Form-associated: submits the value under `name` (one entry per value with `multiple`)
22
+ *
23
+ * @fires {CustomEvent<{value: string}>} change - Dispatched when the selection changes.
24
+ * @fires {CustomEvent<{value: string}>} select-search - Dispatched as the user types when `search="managed"`.
20
25
  *
21
26
  * @example
22
27
  * ```html
@@ -75,10 +80,12 @@ export declare class Select extends BaseInput {
75
80
  /** True when all options are filtered out by the current search query. */
76
81
  private _noOptionsVisible;
77
82
  private _triggerEl?;
83
+ private _fieldEl?;
78
84
  private get _menu();
79
85
  private _searchInputEl?;
80
86
  focus(): void;
81
87
  blur(): void;
88
+ [getFormValue](): FormValue | null;
82
89
  protected updated(changedProperties: Map<string, unknown>): void;
83
90
  /**
84
91
  * Reconciles the `options` property with auto-generated `<wc-option>` light-DOM
@@ -1,10 +1,15 @@
1
1
  import { LitElement } from 'lit';
2
+ import { type FormRestoreState, type FormValue, getFormValue } from '@/__internal/mixins/form-associated.js';
3
+ declare const Slider_base: import("../__internal/mixins/mixin.js").MixinReturn<(abstract new (...args: any[]) => import("@/__internal/mixins/element-internals.js").WithElementInternals) & typeof LitElement & import("@/__internal/mixins/form-associated.js").FormAssociatedConstructor, import("@/__internal/mixins/form-associated.js").FormAssociated>;
2
4
  /**
3
5
  * @label Slider
4
6
  * @tag wc-slider
5
7
  * @rawTag slider
6
8
  *
7
9
  * @summary Sliders allow users to make selections from a range of values.
10
+ * @overview
11
+ * <p>The slider is form-associated: its <code>value</code> is submitted under its <code>name</code>,
12
+ * and <code>form.reset()</code> restores the starting value.</p>
8
13
  *
9
14
  * @fires {CustomEvent} input - Dispatched when the slider value changes during interaction.
10
15
  * @fires {CustomEvent} change - Dispatched when the slider interaction ends.
@@ -13,8 +18,9 @@ import { LitElement } from 'lit';
13
18
  * ```html
14
19
  * <wc-slider min="0" max="100" value="50"></wc-slider>
15
20
  * ```
21
+ * @tags input, form
16
22
  */
17
- export declare class Slider extends LitElement {
23
+ export declare class Slider extends Slider_base {
18
24
  static styles: import("lit").CSSResultGroup[];
19
25
  /**
20
26
  * The minimum value of the slider.
@@ -32,10 +38,6 @@ export declare class Slider extends LitElement {
32
38
  * The step increment for the slider.
33
39
  */
34
40
  step: number;
35
- /**
36
- * Whether the slider is disabled.
37
- */
38
- disabled: boolean;
39
41
  /**
40
42
  * Whether to show labels on the slider.
41
43
  */
@@ -48,6 +50,12 @@ export declare class Slider extends LitElement {
48
50
  private isDragging;
49
51
  private container;
50
52
  private thumbElement;
53
+ /** `value` when first connected; `form.reset()` returns to it. */
54
+ private defaultValue?;
55
+ connectedCallback(): void;
56
+ [getFormValue](): FormValue | null;
57
+ formResetCallback(): void;
58
+ formStateRestoreCallback(state: FormRestoreState | null): void;
51
59
  private handleInput;
52
60
  private onMouseDown;
53
61
  private onMouseMove;
@@ -55,3 +63,4 @@ export declare class Slider extends LitElement {
55
63
  private handleKeyDown;
56
64
  render(): import("lit-html").TemplateResult<1>;
57
65
  }
66
+ export {};
@@ -1,4 +1,5 @@
1
1
  import { nothing } from 'lit';
2
+ import { type FormRestoreState, type FormValue, getFormState, getFormValue } from '@/__internal/mixins/form-associated.js';
2
3
  import BaseInput from '../input/BaseInput.js';
3
4
  /**
4
5
  * @label Switch
@@ -8,6 +9,7 @@ import BaseInput from '../input/BaseInput.js';
8
9
  * @summary Captures boolean input with an on/off switch interaction.
9
10
  * @overview
10
11
  * <p>Toggles are used to enable or disable a single option. They provide immediate feedback about whether an option is active or inactive.</p>
12
+ * <p>The switch is form-associated: when <code>checked</code>, it submits <code>on</code> under its <code>name</code>.</p>
11
13
  *
12
14
  * @cssprop --switch-track-color: Color of the switch track when checked.
13
15
  * @cssprop --switch-track-off-color: Color of the switch track when unchecked.
@@ -16,23 +18,27 @@ import BaseInput from '../input/BaseInput.js';
16
18
  * @cssprop --switch-handle-radius: Size of the switch handle.
17
19
  * @cssprop --switch-handle-color: Color of the switch handle.
18
20
  *
19
- * @fires {CustomEvent} change - Dispatched when the switch value changes.
21
+ * @fires {CustomEvent} change - Dispatched when the switch is toggled. Detail: `{ checked, value, originalEvent }`.
20
22
  * @fires {CustomEvent} blur - Dispatched when the switch loses focus.
21
23
  * @fires {CustomEvent} focus - Dispatched when the switch receives focus.
22
24
  *
23
25
  * @example
24
26
  * ```html
25
- * <wc-switch value="true"></wc-switch>
27
+ * <wc-switch checked label="Wi-Fi"></wc-switch>
26
28
  * ```
27
29
  * @tags input, form
28
30
  */
29
31
  export declare class Switch extends BaseInput {
30
32
  static styles: import("lit").CSSResultGroup[];
31
- value: boolean;
32
33
  /**
33
- * The input field name.
34
+ * Whether the switch is on.
34
35
  */
35
- name: string;
36
+ checked: boolean;
37
+ /**
38
+ * @deprecated Use `checked`. Kept as an alias of `checked`.
39
+ */
40
+ get value(): boolean;
41
+ set value(value: boolean);
36
42
  /**
37
43
  * The switch label.
38
44
  */
@@ -41,18 +47,6 @@ export declare class Switch extends BaseInput {
41
47
  * If true, the toggle has rounded corners. Defaults to `true`.
42
48
  */
43
49
  rounded: boolean;
44
- /**
45
- * If true, required icon is shown. Defaults to `false`.
46
- */
47
- required: boolean;
48
- /**
49
- * If true, the toggle is readonly. Defaults to `false`.
50
- */
51
- readonly: boolean;
52
- /**
53
- * If true, the user cannot interact with the toggle. Defaults to `false`.
54
- */
55
- disabled: boolean;
56
50
  withIcon: boolean;
57
51
  /**
58
52
  * Configuration object for aria attributes.
@@ -62,11 +56,21 @@ export declare class Switch extends BaseInput {
62
56
  private isActive;
63
57
  private slotHasContent;
64
58
  private trackElement?;
65
- private nativeElement?;
66
59
  private tabindex?;
67
60
  connectedCallback(): void;
68
61
  disconnectedCallback(): void;
69
62
  firstUpdated(): void;
63
+ /**
64
+ * Sets focus on the toggle.
65
+ */
66
+ focus(): void;
67
+ /**
68
+ * Removes focus from the toggle.
69
+ */
70
+ blur(): void;
71
+ [getFormValue](): FormValue | null;
72
+ [getFormState](): FormValue | null;
73
+ formStateRestoreCallback(state: FormRestoreState | null): void;
70
74
  private handleInitialAttributes;
71
75
  private windowMouseUp;
72
76
  private windowKeyUp;
@@ -76,14 +80,6 @@ export declare class Switch extends BaseInput {
76
80
  private blurHandler;
77
81
  private focusHandler;
78
82
  private handleKeyUp;
79
- /**
80
- * Sets focus on the toggle.
81
- */
82
- focus(): void;
83
- /**
84
- * Removes focus from the toggle.
85
- */
86
- blur(): void;
87
83
  __renderIcon(): typeof nothing | import("lit-html").TemplateResult<1>;
88
84
  render(): import("lit-html").TemplateResult<1>;
89
85
  }
@@ -9,6 +9,9 @@ import { Tab } from './tab.js';
9
9
  * @overview
10
10
  * <p>Tabs holds the tab buttons and manages their layout.</p>
11
11
  *
12
+ * @fires {CustomEvent<{index: number, value: string}>} change - Dispatched when the user activates a tab.
13
+ * @fires {CustomEvent<{index: number, value: string}>} tab-click - Deprecated alias of `change`, fired alongside it.
14
+ *
12
15
  * @example
13
16
  * ```html
14
17
  * <wc-tabs>
@@ -14,7 +14,6 @@ import BaseInput from '../input/BaseInput.js';
14
14
  export declare class Textarea extends BaseInput {
15
15
  static styles: import("lit").CSSResultGroup[];
16
16
  value: string;
17
- name: string;
18
17
  placeholder: string;
19
18
  label: string;
20
19
  inline: boolean;
@@ -14,7 +14,6 @@ import BaseInput from '../input/BaseInput.js';
14
14
  export declare class TimePicker extends BaseInput {
15
15
  static styles: import("lit").CSSResultGroup[];
16
16
  value: string;
17
- name: string;
18
17
  placeholder: string;
19
18
  label: string;
20
19
  inline: boolean;
@@ -1,4 +1,5 @@
1
1
  import { LitElement } from 'lit';
2
+ import { type LegacySize, type Size } from '@/__internal/utils/size.js';
2
3
  /**
3
4
  * @label Toolbar
4
5
  * @tag wc-toolbar
@@ -71,11 +72,13 @@ export declare class Toolbar extends LitElement {
71
72
  orientation: 'horizontal' | 'vertical';
72
73
  /**
73
74
  * Size of the docked toolbar.
74
- * - `"small"`: 80dp height (default).
75
- * - `"medium"`: 96dp height.
76
- * - `"large"`: 112dp height.
75
+ * - `"sm"`: 80dp height (default).
76
+ * - `"md"`: 96dp height.
77
+ * - `"lg"`: 112dp height.
78
+ *
79
+ * The long names `"small"`, `"medium"` and `"large"` still work but are deprecated.
77
80
  */
78
- size: 'small' | 'medium' | 'large';
81
+ size: Size | LegacySize;
79
82
  /**
80
83
  * Whether the toolbar is visually elevated (adds a shadow).
81
84
  */
@@ -17,7 +17,6 @@ import BaseInput from '../input/BaseInput.js';
17
17
  export declare class UrlField extends BaseInput {
18
18
  static styles: import("lit").CSSResultGroup[];
19
19
  value: string;
20
- name: string;
21
20
  placeholder: string;
22
21
  label: string;
23
22
  editing: boolean;
package/dist/svg.js CHANGED
@@ -62,7 +62,7 @@ var css_248z = i`* {
62
62
  position: fixed;
63
63
  inset: 0;
64
64
  z-index: 9999;
65
- background: rgba(0, 0, 0, 0.85);
65
+ background: color-mix(in srgb, var(--color-scrim) 85%, transparent);
66
66
  align-items: center;
67
67
  justify-content: center;
68
68
  cursor: zoom-out;
@@ -78,14 +78,14 @@ var css_248z = i`* {
78
78
  right: 1rem;
79
79
  background: transparent;
80
80
  border: none;
81
- color: #fff;
81
+ color: var(--color-white);
82
82
  font-size: 1.5rem;
83
83
  cursor: pointer;
84
84
  line-height: 1;
85
85
  padding: 0.25rem 0.5rem;
86
86
  }
87
87
  .preview-close:focus-visible {
88
- outline: 2px solid #fff;
88
+ outline: 2px solid var(--color-white);
89
89
  outline-offset: 2px;
90
90
  }
91
91
 
@@ -100,8 +100,8 @@ var css_248z = i`* {
100
100
  .preview-content svg {
101
101
  max-width: 90vw;
102
102
  max-height: 90vh;
103
- box-shadow: 0 8px 40px rgba(0, 0, 0, 0.6);
104
- border-radius: 4px;
103
+ box-shadow: 0 8px 40px color-mix(in srgb, var(--color-shadow) 60%, transparent);
104
+ border-radius: var(--shape-corner-extra-small);
105
105
  }`;
106
106
 
107
107
  /**