@redvars/peacock 3.10.1 → 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 (276) 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 +8615 -4726
  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 +25 -0
  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/navigation-bar-item.js +41 -0
  81. package/dist/navigation-bar-item.js.map +1 -0
  82. package/dist/navigation-bar.js +128 -0
  83. package/dist/navigation-bar.js.map +1 -0
  84. package/dist/navigation-drawer-item.js +236 -0
  85. package/dist/navigation-drawer-item.js.map +1 -0
  86. package/dist/navigation-drawer.js +293 -0
  87. package/dist/navigation-drawer.js.map +1 -0
  88. package/dist/navigation-rail.js +1 -1
  89. package/dist/number-field.js +280 -0
  90. package/dist/number-field.js.map +1 -0
  91. package/dist/pagination.js +1 -1
  92. package/dist/radio-group.js +209 -0
  93. package/dist/radio-group.js.map +1 -0
  94. package/dist/radio.js +47 -37
  95. package/dist/radio.js.map +1 -1
  96. package/dist/segmented-button-group.js +12 -0
  97. package/dist/segmented-button-group.js.map +1 -1
  98. package/dist/segmented-button.js +10 -6
  99. package/dist/segmented-button.js.map +1 -1
  100. package/dist/select.js +653 -0
  101. package/dist/select.js.map +1 -0
  102. package/dist/side-sheet.js +1 -1
  103. package/dist/sidebar-menu-item.js +273 -0
  104. package/dist/sidebar-menu-item.js.map +1 -0
  105. package/dist/sidebar-menu.js +193 -0
  106. package/dist/sidebar-menu.js.map +1 -0
  107. package/dist/sidebar-sub-menu.js +301 -0
  108. package/dist/sidebar-sub-menu.js.map +1 -0
  109. package/dist/slider.js +76 -24
  110. package/dist/slider.js.map +1 -1
  111. package/dist/snackbar.js +3 -3
  112. package/dist/snackbar.js.map +1 -1
  113. package/dist/split-button.js +2 -2
  114. package/dist/src/__internal/utils/size.d.ts +9 -0
  115. package/dist/src/button/ButtonTypes.d.ts +1 -1
  116. package/dist/src/checkbox/checkbox.d.ts +28 -22
  117. package/dist/src/chip/chip/chip.d.ts +3 -0
  118. package/dist/src/chip/tag/tag.d.ts +5 -1
  119. package/dist/src/code-editor/code-editor.d.ts +37 -10
  120. package/dist/src/color-field/color-field.d.ts +55 -0
  121. package/dist/src/color-field/index.d.ts +1 -0
  122. package/dist/src/color-picker/color-picker.d.ts +1 -1
  123. package/dist/src/date-picker/date-picker.d.ts +0 -1
  124. package/dist/src/index.d.ts +4 -3
  125. package/dist/src/input/BaseInput.d.ts +21 -3
  126. package/dist/src/input/input.d.ts +15 -7
  127. package/dist/src/navigation-bar/index.d.ts +2 -0
  128. package/dist/src/navigation-bar/navigation-bar-item.d.ts +23 -0
  129. package/dist/src/navigation-bar/navigation-bar.d.ts +44 -0
  130. package/dist/src/navigation-drawer/index.d.ts +2 -0
  131. package/dist/src/navigation-drawer/navigation-drawer-item.d.ts +48 -0
  132. package/dist/src/navigation-drawer/navigation-drawer.d.ts +70 -0
  133. package/dist/src/number-field/number-field.d.ts +0 -1
  134. package/dist/src/radio/index.d.ts +1 -0
  135. package/dist/src/radio/radio-group.d.ts +50 -0
  136. package/dist/src/radio/radio.d.ts +18 -18
  137. package/dist/src/segmented-button/segmented-button-group.d.ts +5 -0
  138. package/dist/src/segmented-button/segmented-button.d.ts +2 -1
  139. package/dist/src/select/select.d.ts +6 -0
  140. package/dist/src/slider/slider.d.ts +14 -5
  141. package/dist/src/switch/switch.d.ts +22 -26
  142. package/dist/src/tabs/tabs.d.ts +3 -0
  143. package/dist/src/textarea/textarea.d.ts +0 -1
  144. package/dist/src/time-picker/time-picker.d.ts +0 -1
  145. package/dist/src/toolbar/toolbar.d.ts +7 -4
  146. package/dist/src/url-field/url-field.d.ts +0 -1
  147. package/dist/svg.js +5 -5
  148. package/dist/switch.js +413 -0
  149. package/dist/switch.js.map +1 -0
  150. package/dist/tab.js +2 -1
  151. package/dist/tab.js.map +1 -1
  152. package/dist/tabs.js +10 -8
  153. package/dist/tabs.js.map +1 -1
  154. package/dist/tag.js +349 -0
  155. package/dist/tag.js.map +1 -0
  156. package/dist/test/code-editor.test.d.ts +1 -0
  157. package/dist/test/color-field.test.d.ts +1 -0
  158. package/dist/test/color-picker.test.d.ts +1 -0
  159. package/dist/test/field.test.d.ts +1 -0
  160. package/dist/test/form-controls.test.d.ts +1 -0
  161. package/dist/test/icon.test.d.ts +1 -1
  162. package/dist/test/input.test.d.ts +1 -0
  163. package/dist/test/navigation.test.d.ts +1 -0
  164. package/dist/test/segmented-button.test.d.ts +1 -0
  165. package/dist/test/slider.test.d.ts +1 -0
  166. package/dist/textarea.js +237 -0
  167. package/dist/textarea.js.map +1 -0
  168. package/dist/time-picker.js +241 -0
  169. package/dist/time-picker.js.map +1 -0
  170. package/dist/toolbar.js +26 -9
  171. package/dist/toolbar.js.map +1 -1
  172. package/dist/tsconfig.tsbuildinfo +1 -1
  173. package/dist/url-field.js +298 -0
  174. package/dist/url-field.js.map +1 -0
  175. package/package.json +29 -8
  176. package/readme.md +2 -2
  177. package/scss/tokens.css +175 -18
  178. package/src/__internal/utils/size.ts +23 -0
  179. package/src/app-bar/app-bar.scss +4 -16
  180. package/src/bottom-sheet/bottom-sheet.scss +1 -1
  181. package/src/button/ButtonTypes.ts +2 -0
  182. package/src/button/button/button-base.scss +84 -84
  183. package/src/button/button/button-colors.scss +14 -2
  184. package/src/button/button/button-layers.scss +71 -71
  185. package/src/button/button/button-shapes.scss +2 -2
  186. package/src/button/button/button-sizes.scss +35 -35
  187. package/src/button/button/button.scss +1 -1
  188. package/src/button/button/button.ts +1 -2
  189. package/src/button/button-group/button-group.scss +5 -5
  190. package/src/button/fab/fab-sizes.scss +15 -15
  191. package/src/button/fab/fab.scss +32 -32
  192. package/src/button/icon-button/icon-button-sizes.scss +7 -7
  193. package/src/chart-bar/chart-bar.scss +1 -1
  194. package/src/checkbox/checkbox.scss +7 -6
  195. package/src/checkbox/checkbox.ts +92 -40
  196. package/src/chip/chip/chip.ts +8 -5
  197. package/src/chip/chip-set/chip-set.ts +2 -0
  198. package/src/chip/tag/tag-colors.scss +1 -1
  199. package/src/chip/tag/tag-sizes.scss +9 -0
  200. package/src/chip/tag/tag.scss +1 -1
  201. package/src/chip/tag/tag.ts +20 -9
  202. package/src/code-editor/code-editor.scss +8 -3
  203. package/src/code-editor/code-editor.ts +148 -79
  204. package/src/code-highlighter/code-highlighter.scss +1 -1
  205. package/src/color-field/color-field.scss +48 -0
  206. package/src/color-field/color-field.ts +239 -0
  207. package/src/color-field/index.ts +1 -0
  208. package/src/color-picker/color-picker.scss +33 -15
  209. package/src/color-picker/color-picker.ts +2 -1
  210. package/src/date-picker/date-picker.ts +2 -3
  211. package/src/field/field.scss +31 -0
  212. package/src/flow/flow.scss +5 -5
  213. package/src/image/image.scss +2 -2
  214. package/src/index.ts +7 -3
  215. package/src/input/BaseInput.ts +54 -4
  216. package/src/input/input.ts +104 -79
  217. package/src/list/list-item.ts +2 -0
  218. package/src/loader.ts +28 -6
  219. package/src/markdown-editor/markdown-editor.scss +2 -2
  220. package/src/menu/menu-item/menu-item.scss +30 -30
  221. package/src/navigation-bar/index.ts +2 -0
  222. package/src/navigation-bar/navigation-bar-item.ts +25 -0
  223. package/src/navigation-bar/navigation-bar.scss +27 -0
  224. package/src/navigation-bar/navigation-bar.ts +96 -0
  225. package/src/navigation-drawer/index.ts +2 -0
  226. package/src/navigation-drawer/navigation-drawer-item.scss +82 -0
  227. package/src/navigation-drawer/navigation-drawer-item.ts +133 -0
  228. package/src/navigation-drawer/navigation-drawer.scss +99 -0
  229. package/src/navigation-drawer/navigation-drawer.ts +196 -0
  230. package/src/navigation-rail/navigation-rail.scss +1 -1
  231. package/src/number-field/number-field.ts +2 -3
  232. package/src/pagination/pagination.scss +1 -1
  233. package/src/progress/circular-progress/circular-progress.ts +2 -0
  234. package/src/progress/linear-progress/linear-progress.ts +2 -0
  235. package/src/radio/index.ts +1 -0
  236. package/src/radio/radio-group.scss +39 -0
  237. package/src/radio/radio-group.ts +167 -0
  238. package/src/radio/radio.ts +74 -31
  239. package/src/segmented-button/segmented-button-group.ts +12 -0
  240. package/src/segmented-button/segmented-button.ts +12 -6
  241. package/src/select/select.ts +21 -1
  242. package/src/side-sheet/side-sheet.scss +1 -1
  243. package/src/sidebar-menu/sidebar-menu-item.scss +1 -1
  244. package/src/sidebar-menu/sidebar-menu-item.ts +2 -0
  245. package/src/sidebar-menu/sidebar-menu.ts +2 -0
  246. package/src/sidebar-menu/sidebar-sub-menu.scss +1 -1
  247. package/src/sidebar-menu/sidebar-sub-menu.ts +2 -0
  248. package/src/slider/slider.scss +3 -3
  249. package/src/slider/slider.ts +119 -31
  250. package/src/snackbar/snackbar.ts +3 -3
  251. package/src/split-button/split-button-colors.scss +2 -2
  252. package/src/svg/svg.scss +5 -5
  253. package/src/switch/switch.scss +0 -1
  254. package/src/switch/switch.ts +82 -47
  255. package/src/tabs/tab.scss +2 -1
  256. package/src/tabs/tabs.ts +14 -8
  257. package/src/textarea/textarea.ts +2 -3
  258. package/src/time-picker/time-picker.ts +2 -3
  259. package/src/toolbar/toolbar.scss +4 -4
  260. package/src/toolbar/toolbar.ts +12 -5
  261. package/src/url-field/url-field.ts +2 -3
  262. package/dist/BaseInput-CU1zZYKc.js +0 -27
  263. package/dist/BaseInput-CU1zZYKc.js.map +0 -1
  264. package/dist/brand-loader.js +0 -358
  265. package/dist/brand-loader.js.map +0 -1
  266. package/dist/element-internals-2CMts_0M.js.map +0 -1
  267. package/dist/form-associated-BXADnjOB.js.map +0 -1
  268. package/dist/list-AdO-PUq_.js.map +0 -1
  269. package/dist/select-DkyRqUTI.js +0 -3955
  270. package/dist/select-DkyRqUTI.js.map +0 -1
  271. package/dist/src/brand-loader/brand-loader.d.ts +0 -33
  272. package/dist/src/brand-loader/index.d.ts +0 -2
  273. package/src/brand-loader/brand-loader.scss +0 -270
  274. package/src/brand-loader/brand-loader.ts +0 -115
  275. package/src/brand-loader/index.ts +0 -2
  276. /package/dist/test/{brand-loader.test.d.ts → button.test.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"snackbar.js","sources":["../../src/snackbar/snackbar.ts"],"sourcesContent":["import { LitElement, html, nothing } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport styles from './snackbar.scss';\nimport IndividualComponent from '@/IndividualComponent.js';\n\ntype SnackbarCloseReason = 'timeout' | 'dismiss' | 'action' | 'programmatic';\n\n/**\n * @label Snackbar\n * @tag wc-snackbar\n * @rawTag snackbar\n * @summary Snackbars provide brief messages about app processes at the bottom of the screen.\n *\n * @cssprop --snackbar-container-color - Container color for the snackbar.\n * @cssprop --snackbar-label-text-color - Label text color for the snackbar.\n * @cssprop --snackbar-action-text-color - Action text color.\n * @cssprop --snackbar-close-icon-color - Close icon color.\n * @cssprop --snackbar-border-radius - Border radius of the snackbar surface.\n * @cssprop --snackbar-offset-inline - Inline offset from viewport edges.\n * @cssprop --snackbar-offset-bottom - Bottom offset from viewport edge.\n * @cssprop --snackbar-z-index - Stacking order for the snackbar.\n *\n * @example\n * ```html\n * <wc-snackbar preview message=\"Message archived\" action-label=\"Undo\"></wc-snackbar>\n * ```\n * @tags display, feedback\n */\n@IndividualComponent\nexport class Snackbar extends LitElement {\n static styles = [styles];\n\n private static readonly GLOBAL_OPEN_EVENT = 'wc-snackbar-will-open';\n\n private static readonly EXIT_ANIMATION_MS = 180;\n\n /** Whether the snackbar is currently visible. */\n @property({ type: Boolean, reflect: true }) open = false;\n\n /** The message text to display. Can also be provided via the default slot. */\n @property({ type: String }) message = '';\n\n /** Label for the optional action button. When empty, no action button is rendered. */\n @property({ type: String, attribute: 'action-label' }) actionLabel = '';\n\n /** When true, a dismiss icon button is shown on the trailing end. */\n @property({ type: Boolean, attribute: 'show-close-icon' })\n showCloseIcon = false;\n\n /** Auto-hide duration in milliseconds. Set to `0` to disable auto-hide. */\n @property({ type: Number }) duration = 4000;\n\n /** When true, the snackbar content is allowed to wrap to multiple lines. */\n @property({ type: Boolean, reflect: true }) multiline = false;\n\n /** When true, renders the snackbar in a static preview state (always visible, no animation). */\n @property({ type: Boolean, reflect: true }) preview = false;\n\n /** True while the exit animation is running before the snackbar fully closes. */\n @state() private dismissing = false;\n\n // ── Private fields ────────────────────────────────────────────────────────\n\n /** Timer handle for the auto-hide timeout. */\n private hideTimer: ReturnType<typeof setTimeout> | null = null;\n\n /** Timer handle for the exit animation duration timeout. */\n private exitTimer: ReturnType<typeof setTimeout> | null = null;\n\n private readonly handleGlobalSnackbarOpen = (\n event: Event,\n ) => {\n const { source } = (event as CustomEvent<{ source?: Snackbar }>).detail;\n if (source && source !== this) {\n this.hide();\n }\n };\n\n connectedCallback() {\n super.connectedCallback();\n document.addEventListener(\n Snackbar.GLOBAL_OPEN_EVENT,\n this.handleGlobalSnackbarOpen,\n );\n }\n\n disconnectedCallback() {\n document.removeEventListener(\n Snackbar.GLOBAL_OPEN_EVENT,\n this.handleGlobalSnackbarOpen,\n );\n this.clearExitTimer();\n this.clearTimer();\n super.disconnectedCallback();\n }\n\n protected updated(changedProperties: Map<string, unknown>) {\n if (changedProperties.has('open')) {\n if (this.open) {\n document.dispatchEvent(\n new CustomEvent(Snackbar.GLOBAL_OPEN_EVENT, {\n detail: { source: this },\n }),\n );\n }\n\n this.scheduleAutoHide();\n }\n }\n\n // ── Public methods ────────────────────────────────────────────────────────\n\n show() {\n this.dismissing = false;\n this.clearExitTimer();\n if (!this.open) {\n this.open = true;\n return;\n }\n\n this.scheduleAutoHide();\n }\n\n hide() {\n this.close('programmatic');\n }\n\n private close(reason: SnackbarCloseReason) {\n if (!this.open || this.dismissing) {\n return;\n }\n\n this.clearTimer();\n this.dismissing = true;\n this.clearExitTimer();\n this.exitTimer = setTimeout(() => {\n this.completeDismiss();\n }, Snackbar.EXIT_ANIMATION_MS);\n\n this.dispatchEvent(\n new CustomEvent('snackbar-close', {\n detail: { reason },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private completeDismiss() {\n this.clearExitTimer();\n this.dismissing = false;\n this.open = false;\n }\n\n private dispatchActionEvent() {\n this.dispatchEvent(\n new CustomEvent('snackbar-action', {\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private handleActionClick() {\n this.dispatchActionEvent();\n this.close('action');\n }\n\n private handleCloseClick() {\n this.close('dismiss');\n }\n\n private clearTimer() {\n if (this.hideTimer !== null) {\n clearTimeout(this.hideTimer);\n this.hideTimer = null;\n }\n }\n\n private clearExitTimer() {\n if (this.exitTimer !== null) {\n clearTimeout(this.exitTimer);\n this.exitTimer = null;\n }\n }\n\n private handleAnimationEnd(event: AnimationEvent) {\n if (event.animationName === 'snackbar-exit' && this.dismissing) {\n this.completeDismiss();\n }\n }\n\n private scheduleAutoHide() {\n this.clearTimer();\n if (!this.open || this.duration <= 0) {\n return;\n }\n\n this.hideTimer = setTimeout(() => {\n this.close('timeout');\n }, this.duration);\n }\n\n render() {\n const liveRole =\n this.actionLabel || this.showCloseIcon ? 'alert' : 'status';\n\n return html`\n <div\n class=${classMap({\n snackbar: true,\n open: !this.preview && this.open,\n preview: this.preview,\n dismissing: this.dismissing,\n multiline: this.multiline,\n })}\n role=${liveRole}\n aria-live=\"polite\"\n @animationend=${this.handleAnimationEnd}\n >\n <div class=\"label\">\n <slot>${this.message}</slot>\n </div>\n\n ${this.actionLabel\n ? html`<wc-button class=\"action\" variant='text' size='small' @click=${this.handleActionClick}>\n ${this.actionLabel}\n </wc-button>`\n : nothing}\n\n ${this.showCloseIcon\n ? html`<wc-icon-button\n class=\"close\"\n variant='text' \n size='small'\n aria-label=\"Dismiss notification\"\n @click=${this.handleCloseClick}\n >\n <wc-icon name=\"close\"></wc-icon>\n </wc-icon-button>`\n : nothing}\n </div>\n `;\n }\n}\n"],"names":["LitElement","html","classMap","nothing","styles","property","state"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA;;;;;;;;;;;;;;;;;;;;AAoBG;AAEI,IAAM,QAAQ,GAAA,UAAA,GAAd,MAAM,QAAS,SAAQA,GAAU,CAAA;AAAjC,IAAA,WAAA,GAAA;;;QAQuC,IAAA,CAAA,IAAI,GAAG,KAAK;;QAG5B,IAAA,CAAA,OAAO,GAAG,EAAE;;QAGe,IAAA,CAAA,WAAW,GAAG,EAAE;;QAIvE,IAAA,CAAA,aAAa,GAAG,KAAK;;QAGO,IAAA,CAAA,QA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C,EAAE,IAAI,EAAE,MAAM,EAAE;AAAkB,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,UAAA,EAAA,MAAA,CAAA;AAGA,UAAA,CAAA;IAA3CA,CAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAAoB,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,WAAA,EAAA,MAAA,CAAA;AAGlB,UAAA,CAAA;IAA3CA,CAAQ,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAAkB,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAG3C,UAAA,CAAA;AAAhB,IAAAC,CAAK;AAA8B,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,YAAA,EAAA,MAAA,CAAA;AA9BzB,QAAQ,GAAA,UAAA,GAAA,UAAA,CAAA;IADpB;AACY,CAAA,EAAA,QAAQ,CAuNpB;;;;"}
1
+ {"version":3,"file":"snackbar.js","sources":["../../src/snackbar/snackbar.ts"],"sourcesContent":["import { LitElement, html, nothing } from 'lit';\nimport { property, state } from 'lit/decorators.js';\nimport { classMap } from 'lit/directives/class-map.js';\nimport styles from './snackbar.scss';\nimport IndividualComponent from '@/IndividualComponent.js';\n\ntype SnackbarCloseReason = 'timeout' | 'dismiss' | 'action' | 'programmatic';\n\n/**\n * @label Snackbar\n * @tag wc-snackbar\n * @rawTag snackbar\n * @summary Snackbars provide brief messages about app processes at the bottom of the screen.\n *\n * @cssprop --snackbar-container-color - Container color for the snackbar.\n * @cssprop --snackbar-label-text-color - Label text color for the snackbar.\n * @cssprop --snackbar-action-text-color - Action text color.\n * @cssprop --snackbar-close-icon-color - Close icon color.\n * @cssprop --snackbar-border-radius - Border radius of the snackbar surface.\n * @cssprop --snackbar-offset-inline - Inline offset from viewport edges.\n * @cssprop --snackbar-offset-bottom - Bottom offset from viewport edge.\n * @cssprop --snackbar-z-index - Stacking order for the snackbar.\n *\n * @example\n * ```html\n * <wc-snackbar preview message=\"Message archived\" action-label=\"Undo\"></wc-snackbar>\n * ```\n * @tags display, feedback\n */\n@IndividualComponent\nexport class Snackbar extends LitElement {\n static styles = [styles];\n\n private static readonly GLOBAL_OPEN_EVENT = 'wc-snackbar-will-open';\n\n private static readonly EXIT_ANIMATION_MS = 180;\n\n /** Whether the snackbar is currently visible. */\n @property({ type: Boolean, reflect: true }) open = false;\n\n /** The message text to display. Can also be provided via the default slot. */\n @property({ type: String }) message = '';\n\n /** Label for the optional action button. When empty, no action button is rendered. */\n @property({ type: String, attribute: 'action-label' }) actionLabel = '';\n\n /** When true, a dismiss icon button is shown on the trailing end. */\n @property({ type: Boolean, attribute: 'show-close-icon' })\n showCloseIcon = false;\n\n /** Auto-hide duration in milliseconds. Set to `0` to disable auto-hide. */\n @property({ type: Number }) duration = 4000;\n\n /** When true, the snackbar content is allowed to wrap to multiple lines. */\n @property({ type: Boolean, reflect: true }) multiline = false;\n\n /** When true, renders the snackbar in a static preview state (always visible, no animation). */\n @property({ type: Boolean, reflect: true }) preview = false;\n\n /** True while the exit animation is running before the snackbar fully closes. */\n @state() private dismissing = false;\n\n // ── Private fields ────────────────────────────────────────────────────────\n\n /** Timer handle for the auto-hide timeout. */\n private hideTimer: ReturnType<typeof setTimeout> | null = null;\n\n /** Timer handle for the exit animation duration timeout. */\n private exitTimer: ReturnType<typeof setTimeout> | null = null;\n\n private readonly handleGlobalSnackbarOpen = (\n event: Event,\n ) => {\n const { source } = (event as CustomEvent<{ source?: Snackbar }>).detail;\n if (source && source !== this) {\n this.hide();\n }\n };\n\n connectedCallback() {\n super.connectedCallback();\n document.addEventListener(\n Snackbar.GLOBAL_OPEN_EVENT,\n this.handleGlobalSnackbarOpen,\n );\n }\n\n disconnectedCallback() {\n document.removeEventListener(\n Snackbar.GLOBAL_OPEN_EVENT,\n this.handleGlobalSnackbarOpen,\n );\n this.clearExitTimer();\n this.clearTimer();\n super.disconnectedCallback();\n }\n\n protected updated(changedProperties: Map<string, unknown>) {\n if (changedProperties.has('open')) {\n if (this.open) {\n document.dispatchEvent(\n new CustomEvent(Snackbar.GLOBAL_OPEN_EVENT, {\n detail: { source: this },\n }),\n );\n }\n\n this.scheduleAutoHide();\n }\n }\n\n // ── Public methods ────────────────────────────────────────────────────────\n\n show() {\n this.dismissing = false;\n this.clearExitTimer();\n if (!this.open) {\n this.open = true;\n return;\n }\n\n this.scheduleAutoHide();\n }\n\n hide() {\n this.close('programmatic');\n }\n\n private close(reason: SnackbarCloseReason) {\n if (!this.open || this.dismissing) {\n return;\n }\n\n this.clearTimer();\n this.dismissing = true;\n this.clearExitTimer();\n this.exitTimer = setTimeout(() => {\n this.completeDismiss();\n }, Snackbar.EXIT_ANIMATION_MS);\n\n this.dispatchEvent(\n new CustomEvent('snackbar-close', {\n detail: { reason },\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private completeDismiss() {\n this.clearExitTimer();\n this.dismissing = false;\n this.open = false;\n }\n\n private dispatchActionEvent() {\n this.dispatchEvent(\n new CustomEvent('snackbar-action', {\n bubbles: true,\n composed: true,\n }),\n );\n }\n\n private handleActionClick() {\n this.dispatchActionEvent();\n this.close('action');\n }\n\n private handleCloseClick() {\n this.close('dismiss');\n }\n\n private clearTimer() {\n if (this.hideTimer !== null) {\n clearTimeout(this.hideTimer);\n this.hideTimer = null;\n }\n }\n\n private clearExitTimer() {\n if (this.exitTimer !== null) {\n clearTimeout(this.exitTimer);\n this.exitTimer = null;\n }\n }\n\n private handleAnimationEnd(event: AnimationEvent) {\n if (event.animationName === 'snackbar-exit' && this.dismissing) {\n this.completeDismiss();\n }\n }\n\n private scheduleAutoHide() {\n this.clearTimer();\n if (!this.open || this.duration <= 0) {\n return;\n }\n\n this.hideTimer = setTimeout(() => {\n this.close('timeout');\n }, this.duration);\n }\n\n render() {\n const liveRole =\n this.actionLabel || this.showCloseIcon ? 'alert' : 'status';\n\n return html`\n <div\n class=${classMap({\n snackbar: true,\n open: !this.preview && this.open,\n preview: this.preview,\n dismissing: this.dismissing,\n multiline: this.multiline,\n })}\n role=${liveRole}\n aria-live=\"polite\"\n @animationend=${this.handleAnimationEnd}\n >\n <div class=\"label\">\n <slot>${this.message}</slot>\n </div>\n\n ${this.actionLabel\n ? html`<wc-button class=\"action\" variant='text' size='sm' @click=${this.handleActionClick}>\n ${this.actionLabel}\n </wc-button>`\n : nothing}\n\n ${this.showCloseIcon\n ? html`<wc-icon-button\n class=\"close\"\n variant='text'\n size='sm'\n aria-label=\"Dismiss notification\"\n @click=${this.handleCloseClick}\n >\n <wc-icon name=\"close\"></wc-icon>\n </wc-icon-button>`\n : nothing}\n </div>\n `;\n }\n}\n"],"names":["LitElement","html","classMap","nothing","styles","property","state"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA;;;;;;;;;;;;;;;;;;;;AAoBG;AAEI,IAAM,QAAQ,GAAA,UAAA,GAAd,MAAM,QAAS,SAAQA,GAAU,CAAA;AAAjC,IAAA,WAAA,GAAA;;;QAQuC,IAAA,CAAA,IAAI,GAAG,KAAK;;QAG5B,IAAA,CAAA,OAAO,GAAG,EAAE;;QAGe,IAAA,CAAA,WAAW,GAAG,EAAE;;QAIvE,IAAA,CAAA,aAAa,GAAG,KAAK;;QAGO,IAAA,CAAA,QAAQ,GAAG,IAAI;;QAGC,IAAA,CAAA,SAAS,GAAG,KAAK;;QAGjB,IAAA,CAAA,OAAO,GAAG,KAAK;;QAG1C,IAAA,CAAA,UAAU,GAAG,KAAK;;;QAK3B,IAAA,CAAA,SAAS,GAAyC,IAAI;;QAGtD,IAAA,CAAA,SAAS,GAAyC,IAAI;AAE7C,QAAA,IAAA,CAAA,wBAAwB,GAAG,CAC1C,KAAY,KACV;AACF,YAAA,MAAM,EAAE,MAAM,EAAE,GAAI,K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I,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAE;AAAkB,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,SAAA,EAAA,MAAA,CAAA;AAG3C,UAAA,CAAA;AAAhB,IAAAC,CAAK;AAA8B,CAAA,EAAA,QAAA,CAAA,SAAA,EAAA,YAAA,EAAA,MAAA,CAAA;AA9BzB,QAAQ,GAAA,UAAA,GAAA,UAAA,CAAA;IADpB;AACY,CAAA,EAAA,QAAQ,CAuNpB;;;;"}
@@ -139,7 +139,7 @@ var css_248z$1 = i`:host([color=primary]) {
139
139
  :host([color=on-surface]) {
140
140
  --filled-split-button-container-color: var(--color-on-surface);
141
141
  --filled-split-button-label-text-color: var(--color-surface);
142
- --tonal-split-button-container-color: var(--color-on-surface-container);
142
+ --tonal-split-button-container-color: var(--color-on-surface-variant);
143
143
  --tonal-split-button-label-text-color: var(--color-surface-container-high);
144
144
  --outlined-split-button-outline-color: var(--color-on-surface);
145
145
  --outlined-split-button-label-text-color: var(--color-on-surface);
@@ -149,7 +149,7 @@ var css_248z$1 = i`:host([color=primary]) {
149
149
  --filled-split-button-container-color: var(--color-surface-container-high);
150
150
  --filled-split-button-label-text-color: var(--color-on-surface);
151
151
  --tonal-split-button-container-color: var(--color-surface-container-high);
152
- --tonal-split-button-label-text-color: var(--color-on-surface-container);
152
+ --tonal-split-button-label-text-color: var(--color-on-surface);
153
153
  --outlined-split-button-outline-color: var(--color-on-surface);
154
154
  --outlined-split-button-label-text-color: var(--color-on-surface);
155
155
  }`;
@@ -0,0 +1,9 @@
1
+ /** The size scale components share. Only button-like components add `xs` and `xl`. */
2
+ export type Size = 'sm' | 'md' | 'lg';
3
+ /** Long size names some components accepted before the `sm|md|lg` scale. Deprecated. */
4
+ export type LegacySize = 'small' | 'medium' | 'large';
5
+ /**
6
+ * Maps a size attribute onto the `sm|md|lg` scale, accepting the deprecated long names.
7
+ * Unknown values fall back to `fallback`.
8
+ */
9
+ export declare function normalizeSize(size: string | null | undefined, fallback?: Size): Size;
@@ -2,4 +2,4 @@ export type ButtonSize = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
2
2
  export type ButtonLevel = 'primary' | 'secondary' | 'tertiary' | 'danger';
3
3
  export type ButtonShape = 'round' | 'square';
4
4
  export type ButtonVariant = 'elevated' | 'filled' | 'tonal' | 'outlined' | 'text' | 'neo';
5
- export type ButtonColor = 'primary' | 'success' | 'danger' | 'warning' | 'surface' | 'on-surface';
5
+ export type ButtonColor = 'primary' | 'secondary' | 'tertiary' | 'success' | 'danger' | 'warning' | 'surface' | 'on-surface';
@@ -1,4 +1,6 @@
1
1
  import { LitElement } from 'lit';
2
+ import { type FormRestoreState, type FormValue, getFormState, getFormValue } from '@/__internal/mixins/form-associated.js';
3
+ declare const Checkbox_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 Checkbox
4
6
  * @tag wc-checkbox
@@ -7,35 +9,37 @@ import { LitElement } from 'lit';
7
9
  * @overview
8
10
  * <p>Checkboxes allow users to select one or more items from a set. Checkboxes can turn an option on or off.</p>
9
11
  * <p>checkboxes feature a smooth animation and clear visual states for checked, unchecked, and indeterminate.</p>
12
+ * <p>The checkbox is form-associated: when <code>checked</code>, it submits <code>on</code> under its <code>name</code>.</p>
10
13
  * @cssprop --checkbox-size: Size of the checkbox container.
11
14
  * @cssprop --checkbox-selected-color: Color of the checkbox when selected.
12
15
  * @cssprop --checkbox-unselected-color: Color of the checkbox border when unselected.
13
16
  * @cssprop --checkbox-checkmark-color: Color of the checkmark icon.
14
17
  * @cssprop --checkbox-state-layer-size: Size of the state layer for touch target.
15
- * @fires {CustomEvent} change - Dispatched when the checkbox value changes.
18
+ * @fires {CustomEvent} change - Dispatched when the checkbox is toggled. Detail: `{ checked, value, originalEvent }`.
16
19
  * @fires {CustomEvent} blur - Dispatched when the checkbox loses focus.
17
20
  * @fires {CustomEvent} focus - Dispatched when the checkbox receives focus.
18
21
  * @tags input, form
19
22
  *
20
23
  * @example
21
24
  * ```html
22
- * <wc-checkbox label="Accept terms"></wc-checkbox>
25
+ * <wc-checkbox label="Accept terms" checked></wc-checkbox>
23
26
  * ```
24
27
  */
25
- export declare class Checkbox extends LitElement {
28
+ export declare class Checkbox extends Checkbox_base {
26
29
  static styles: import("lit").CSSResultGroup[];
27
- /**
28
- * The input field name.
29
- */
30
- name: string;
31
30
  /**
32
31
  * The checkbox label.
33
32
  */
34
33
  label: string;
35
34
  /**
36
- * The input field value (checked state).
35
+ * Whether the checkbox is checked.
36
+ */
37
+ checked: boolean;
38
+ /**
39
+ * @deprecated Use `checked`. Kept as an alias of `checked`.
37
40
  */
38
- value: boolean;
41
+ get value(): boolean;
42
+ set value(value: boolean);
39
43
  /**
40
44
  * If true, displays the checkbox in an indeterminate state.
41
45
  */
@@ -57,10 +61,6 @@ export declare class Checkbox extends LitElement {
57
61
  * If true, the checkbox is readonly. Defaults to `false`.
58
62
  */
59
63
  readonly: boolean;
60
- /**
61
- * If true, the user cannot interact with the checkbox. Defaults to `false`.
62
- */
63
- disabled: boolean;
64
64
  /**
65
65
  * Configuration object for aria attributes.
66
66
  */
@@ -72,12 +72,25 @@ export declare class Checkbox extends LitElement {
72
72
  /** True when slotted label content is present. */
73
73
  private slotHasContent;
74
74
  private containerElement?;
75
- private nativeElement?;
76
75
  /** Captured `tabindex` attribute value forwarded to the inner container. */
77
76
  private tabindex?;
77
+ /** `checked` when first connected; `form.reset()` returns to it. */
78
+ private defaultChecked?;
78
79
  connectedCallback(): void;
79
80
  disconnectedCallback(): void;
80
81
  firstUpdated(): void;
82
+ /**
83
+ * Sets focus on the checkbox.
84
+ */
85
+ focus(): void;
86
+ /**
87
+ * Removes focus from the checkbox.
88
+ */
89
+ blur(): void;
90
+ [getFormValue](): FormValue | null;
91
+ [getFormState](): FormValue | null;
92
+ formResetCallback(): void;
93
+ formStateRestoreCallback(state: FormRestoreState | null): void;
81
94
  private handleInitialAttributes;
82
95
  private windowMouseUp;
83
96
  private windowKeyUp;
@@ -87,13 +100,6 @@ export declare class Checkbox extends LitElement {
87
100
  private blurHandler;
88
101
  private focusHandler;
89
102
  private handleKeyUp;
90
- /**
91
- * Sets focus on the checkbox.
92
- */
93
- focus(): void;
94
- /**
95
- * Removes focus from the checkbox.
96
- */
97
- blur(): void;
98
103
  render(): import("lit-html").TemplateResult<1>;
99
104
  }
105
+ export {};
@@ -7,6 +7,9 @@ declare const Chip_base: import("../../__internal/mixins/mixin.js").MixinReturn<
7
7
  * @summary Chip component for displaying compact information with optional actions.
8
8
  * @tags display
9
9
  *
10
+ * @fires {CustomEvent} dismiss - Dispatched when the dismiss button of a `dismissible` chip is clicked.
11
+ * @fires {CustomEvent} tag--dismiss - Deprecated alias of `dismiss`, fired alongside it.
12
+ *
10
13
  * @example
11
14
  * ```html
12
15
  * <wc-chip>Chip content</wc-chip>
@@ -6,6 +6,9 @@ import { LitElement } from 'lit';
6
6
  * @summary Tag component for displaying labels or values with optional dismiss functionality.
7
7
  * @tags display
8
8
  *
9
+ * @fires {CustomEvent} dismiss - Dispatched when the dismiss button is clicked.
10
+ * @fires {CustomEvent} tag--dismiss - Deprecated alias of `dismiss`, fired alongside it.
11
+ *
9
12
  * @example
10
13
  * ```html
11
14
  * <wc-tag color="red">Tag</wc-tag>
@@ -18,7 +21,8 @@ export declare class Tag extends LitElement {
18
21
  variant: 'elevated' | 'filled' | 'tonal' | 'outlined';
19
22
  /** Tag color. */
20
23
  color?: 'default' | 'blue' | 'green' | 'red' | 'yellow';
21
- size?: 'sm' | 'md';
24
+ /** Tag size. Possible values are `"sm"`, `"md"`, `"lg"`. Defaults to `"md"`. */
25
+ size?: 'sm' | 'md' | 'lg';
22
26
  private _dismissClickHandler;
23
27
  private __renderDismissButton;
24
28
  render(): import("lit-html").TemplateResult<1>;
@@ -1,4 +1,6 @@
1
+ import { PropertyValues } from 'lit';
1
2
  import BaseInput from '../input/BaseInput.js';
3
+ export type CodeEditorLanguage = 'javascript' | 'json' | 'html' | 'css' | 'scss';
2
4
  /**
3
5
  * @label Code Editor
4
6
  * @tag wc-code-editor
@@ -7,42 +9,67 @@ import BaseInput from '../input/BaseInput.js';
7
9
  * @summary A Monaco-based code editing component with syntax highlighting and theming.
8
10
  * @overview
9
11
  * - CodeEditor wraps Monaco Editor as a web component.
10
- * - Supports JS/JSON/HTML languages, read-only mode, line numbers, minimap, and dark/light theme.
12
+ * - Supports JavaScript, JSON, HTML, CSS and SCSS, read-only mode, line numbers, minimap, and dark/light theme.
13
+ * - Has a copy button; hide it with `hide-copy`.
11
14
  * - Emits `change` when content is edited and updates value from property changes.
12
15
  *
16
+ * @cssprop --code-editor-height - Height of the editor. Defaults to 300px.
17
+ *
18
+ * @fires {Event} change - Dispatched when the user edits the content.
19
+ * @fires {CustomEvent<{value: string}>} copied - Dispatched after the copy button copies the content.
20
+ *
13
21
  * @example
14
22
  * ```html
15
23
  * <wc-code-editor
16
- * language="javascript"
24
+ * language="css"
25
+ * readonly
17
26
  * style="width: 100%; --code-editor-height: 10rem;"
18
- * value="function hello() { console.log('Hello'); }"
19
- * lineNumbers="on"
20
- * minimap="false">
27
+ * value=":root { --color-primary: #6341d5; }">
21
28
  * </wc-code-editor>
22
29
  * ```
23
30
  * @tags input, editor
24
31
  */
25
32
  export default class CodeEditor extends BaseInput {
26
33
  static styles: import("lit").CSSResultGroup[];
27
- name: string;
34
+ /** The code shown in the editor. Updated as the user types. */
28
35
  value: string;
29
- language: 'javascript' | 'json' | 'html';
36
+ /** Language used for syntax highlighting. Can be changed after the editor loads. */
37
+ language: CodeEditorLanguage;
38
+ /** Extra source loaded as a separate model, e.g. type definitions for completions. */
30
39
  libSource: any;
40
+ /** Whether line numbers show in the gutter. */
31
41
  lineNumbers: 'off' | 'on';
42
+ /** Shows the minimap. Leave the attribute out to hide it. */
32
43
  minimap: boolean;
44
+ /** Hides the copy button. */
45
+ hideCopy: boolean;
46
+ /** Shows a "Read Only" badge while the editor is read-only or disabled. */
47
+ showReadonlyBadge: boolean;
48
+ /** Whether the page is in dark mode; picks the Monaco theme. */
33
49
  private _isDarkMode;
50
+ /** Whether the editor text has focus. */
34
51
  private hasFocus;
52
+ /** Whether the copy button was just used; shows a check for a few seconds. */
53
+ private _copied;
54
+ /** The Monaco editor instance, once loaded. */
35
55
  private editorMonacoInstance?;
36
56
  private editorElement;
57
+ /** The Monaco API returned by modern-monaco's init(). */
37
58
  monaco: any;
59
+ /** Stops listening for theme changes. */
60
+ private __unobserveTheme?;
61
+ /** Resets the copied state of the copy button. */
62
+ private __copiedTimer?;
38
63
  connectedCallback(): void;
39
64
  disconnectedCallback(): void;
40
65
  protected firstUpdated(): void;
41
- protected updated(changedProperties: any): void;
42
- private libSourceChanged;
43
- private getTheme;
66
+ protected updated(changedProperties: PropertyValues<this>): void;
44
67
  initializeMonaco(): Promise<void>;
45
68
  setFocus(): Promise<void>;
46
69
  setBlur(): Promise<void>;
70
+ private libSourceChanged;
71
+ private getTheme;
72
+ private __handleCopyClick;
73
+ private renderToolbar;
47
74
  render(): import("lit-html").TemplateResult<1>;
48
75
  }
@@ -0,0 +1,55 @@
1
+ import BaseInput from '../input/BaseInput.js';
2
+ import type { Popover } from '../popover/popover.js';
3
+ /**
4
+ * @label Color Field
5
+ * @tag wc-color-field
6
+ * @rawTag color-field
7
+ *
8
+ * @summary A text field for a hex color, with a swatch that opens a color picker.
9
+ * @overview
10
+ * <p>Color field shows the current color as a swatch next to its hex value. Type a hex value, or
11
+ * click the swatch to pick one with <code>wc-color-picker</code> in a popover.</p>
12
+ * <p>It is form-associated: the hex value is submitted under its <code>name</code>.</p>
13
+ *
14
+ * @fires {CustomEvent<{value: string}>} input - Dispatched while the color changes in the picker.
15
+ * @fires {CustomEvent<{value: string}>} change - Dispatched when a color is committed, from the picker or the text field.
16
+ *
17
+ * @example
18
+ * ```html
19
+ * <wc-color-field label="Brand color" value="#7c5df0"></wc-color-field>
20
+ * ```
21
+ * @tags input, form
22
+ */
23
+ export declare class ColorField extends BaseInput {
24
+ static styles: import("lit").CSSResultGroup[];
25
+ /** The color as a 6-digit hex string, such as `"#7c5df0"`. */
26
+ value: string;
27
+ /** Label shown above the field. */
28
+ label: string;
29
+ /** Helper text shown below the field. */
30
+ helperText: string;
31
+ /** Visual variant of the field. */
32
+ variant: 'filled' | 'outlined' | 'default';
33
+ /** Where the picker opens, relative to the field. */
34
+ placement: Popover['placement'];
35
+ /** Text in the hex input; differs from `value` while the user is typing. */
36
+ private draft;
37
+ private focused;
38
+ private pickerOpen;
39
+ /** True after the user typed something that is not a hex color. */
40
+ private invalid;
41
+ private popoverElement?;
42
+ private inputElement?;
43
+ protected willUpdate(changed: Map<PropertyKey, unknown>): void;
44
+ focus(): void;
45
+ /** Opens the color picker. */
46
+ showPicker(): void;
47
+ private commit;
48
+ private handleSwatchClick;
49
+ private handleTextInput;
50
+ private handleTextChange;
51
+ private handleTextKeyDown;
52
+ private handlePickerInput;
53
+ private handlePickerChange;
54
+ render(): import("lit-html").TemplateResult<1>;
55
+ }
@@ -0,0 +1 @@
1
+ export { ColorField } from './color-field.js';
@@ -59,7 +59,7 @@ export declare class ColorPicker extends LitElement {
59
59
  /** The last `value` we set ourselves, used to skip redundant re-syncs in `updated`. */
60
60
  private _lastEmittedValue;
61
61
  connectedCallback(): void;
62
- updated(changed: Map<PropertyKey, unknown>): void;
62
+ willUpdate(changed: Map<PropertyKey, unknown>): void;
63
63
  private _syncFromValue;
64
64
  private _computeHex;
65
65
  private _emitValue;
@@ -14,7 +14,6 @@ import BaseInput from '../input/BaseInput.js';
14
14
  export declare class DatePicker 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;
@@ -29,8 +29,6 @@ export { Textarea } from './textarea/index.js';
29
29
  export { Switch } from './switch/index.js';
30
30
  export { Checkbox } from './checkbox/index.js';
31
31
  export { Spinner } from './spinner/index.js';
32
- export { BrandLoader } from './brand-loader/index.js';
33
- export type { BrandLoaderVariant } from './brand-loader/index.js';
34
32
  export { Container } from './container/index.js';
35
33
  export { NumberCounter } from './number-counter/index.js';
36
34
  export { EmptyState } from './empty-state/index.js';
@@ -50,6 +48,7 @@ export { Svg } from './svg/index.js';
50
48
  export { Tab, TabGroup, TabPanel, Tabs } from './tabs/index.js';
51
49
  export { Slider } from './slider/index.js';
52
50
  export { ColorPicker } from './color-picker/index.js';
51
+ export { ColorField } from './color-field/index.js';
53
52
  export { ChartDoughnut } from './chart-doughnut/index.js';
54
53
  export { ChartPie } from './chart-pie/index.js';
55
54
  export { ChartBar, ChartStackedBar } from './chart-bar/index.js';
@@ -61,7 +60,7 @@ export { Alert } from './alert/index.js';
61
60
  export { Notification } from './notification/index.js';
62
61
  export { NotificationManager } from './notification-manager/index.js';
63
62
  export { Snackbar } from './snackbar/index.js';
64
- export { Radio } from './radio/index.js';
63
+ export { Radio, RadioGroup } from './radio/index.js';
65
64
  export { Modal } from './modal/index.js';
66
65
  export { BottomSheet } from './bottom-sheet/index.js';
67
66
  export { SideSheet } from './side-sheet/index.js';
@@ -72,6 +71,8 @@ export { Search } from './search/index.js';
72
71
  export { Toolbar } from './toolbar/index.js';
73
72
  export { AppBar } from './app-bar/index.js';
74
73
  export { NavigationRail, NavigationRailItem } from './navigation-rail/index.js';
74
+ export { NavigationBar, NavigationBarItem } from './navigation-bar/index.js';
75
+ export { NavigationDrawer, NavigationDrawerItem, } from './navigation-drawer/index.js';
75
76
  export { Calendar, CalendarColumnView, CalendarMonthView, } from './calendar/index.js';
76
77
  export type { CalendarViewType, EventType } from './calendar/index.js';
77
78
  export { Flow } from './flow/index.js';
@@ -1,8 +1,26 @@
1
1
  import { LitElement } from 'lit';
2
- export default abstract class BaseInput extends LitElement {
3
- value?: any;
4
- disabled: boolean;
2
+ import { type FormRestoreState, type FormValue, getFormValue } from '@/__internal/mixins/form-associated.js';
3
+ declare const BaseInput_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
+ /**
5
+ * Base class for Peacock's text-like form controls.
6
+ *
7
+ * It is form-associated: `value` is submitted with the surrounding `<form>`, `form.reset()`
8
+ * restores the value the control started with, and a disabled `<fieldset>` disables it.
9
+ * `name` and `disabled` come from `mixinFormAssociated`; they are backed by attributes, so
10
+ * subclasses must not redeclare them.
11
+ */
12
+ export default abstract class BaseInput extends BaseInput_base {
13
+ /** Each control declares its own `value` (a property, or an accessor such as Switch's). */
14
+ abstract value?: any;
5
15
  readonly: boolean;
6
16
  required: boolean;
7
17
  skeleton: boolean;
18
+ /** The value the control had when it was first connected; `form.reset()` returns to it. */
19
+ private __defaultValue;
20
+ private __defaultValueCaptured;
21
+ connectedCallback(): void;
22
+ [getFormValue](): FormValue | null;
23
+ formResetCallback(): void;
24
+ formStateRestoreCallback(state: FormRestoreState | null): void;
8
25
  }
26
+ export {};
@@ -1,28 +1,35 @@
1
- import BaseInput from "./BaseInput.js";
1
+ import BaseInput from './BaseInput.js';
2
2
  /**
3
3
  * @label Input
4
4
  * @tag wc-input
5
5
  * @rawTag input
6
6
  *
7
7
  * @summary The Input component is used to capture user input.
8
+ * @overview
9
+ * <p>Input is form-associated: inside a <code>&lt;form&gt;</code> its <code>value</code> is submitted
10
+ * under its <code>name</code>, and <code>form.reset()</code> restores the starting value.</p>
11
+ *
12
+ * @fires {Event} input - Re-fired from the native input as the user types.
13
+ * @fires {Event} change - Re-fired from the native input when the value is committed.
8
14
  *
9
15
  * @example
10
16
  * ```html
11
17
  * <wc-input label="Name" required placeholder="Enter your name"></wc-input>
12
18
  * ```
19
+ * @tags input, form
13
20
  */
14
21
  export declare class Input extends BaseInput {
15
22
  static styles: import("lit").CSSResultGroup[];
16
23
  value: string;
17
- name: string;
18
24
  placeholder: string;
19
25
  label: string;
20
26
  inline: boolean;
21
- size: "sm" | "md" | "lg";
22
- type: "text" | "password" | "email" | "tel";
23
- autocomplete: "on" | "off";
27
+ /** Field size. Possible values are `"sm"`, `"md"`, `"lg"`. Defaults to `"md"`. */
28
+ size: 'sm' | 'md' | 'lg';
29
+ type: 'text' | 'password' | 'email' | 'tel';
30
+ autocomplete: 'on' | 'off';
24
31
  configAria: Record<string, string>;
25
- variant: "filled" | "outlined" | "default";
32
+ variant: 'filled' | 'outlined' | 'default';
26
33
  /**
27
34
  * Helper text to display below the input.
28
35
  */
@@ -39,11 +46,12 @@ export declare class Input extends BaseInput {
39
46
  */
40
47
  private dirty;
41
48
  private inputElement?;
42
- focus(): Promise<void>;
43
49
  connectedCallback(): void;
50
+ focus(): Promise<void>;
44
51
  private handleInitialAttributes;
45
52
  private __handleInput;
46
53
  private __handleFocusChange;
47
54
  private __redispatchEvent;
55
+ private __renderPasswordToggle;
48
56
  render(): import("lit-html").TemplateResult<1>;
49
57
  }
@@ -0,0 +1,2 @@
1
+ export { NavigationBar } from './navigation-bar.js';
2
+ export { NavigationBarItem } from './navigation-bar-item.js';
@@ -0,0 +1,23 @@
1
+ import { NavigationRailItem } from '../navigation-rail/navigation-rail-item.js';
2
+ /**
3
+ * @label Navigation Bar Item
4
+ * @tag wc-navigation-bar-item
5
+ * @rawTag navigation-bar-item
6
+ *
7
+ * @summary A destination in a navigation bar.
8
+ * @overview
9
+ * <p>Shows an icon inside the active-indicator pill with a label below. It has the same API as
10
+ * <code>wc-navigation-rail-item</code>: <code>active</code>, <code>disabled</code>, <code>href</code>,
11
+ * <code>value</code>, and the <code>icon</code> and <code>active-icon</code> slots.</p>
12
+ *
13
+ * @example
14
+ * ```html
15
+ * <wc-navigation-bar-item active>
16
+ * <wc-icon slot="icon" name="home"></wc-icon>
17
+ * Home
18
+ * </wc-navigation-bar-item>
19
+ * ```
20
+ * @tags navigation
21
+ */
22
+ export declare class NavigationBarItem extends NavigationRailItem {
23
+ }
@@ -0,0 +1,44 @@
1
+ import { LitElement } from 'lit';
2
+ import { NavigationBarItem } from './navigation-bar-item.js';
3
+ /**
4
+ * @label Navigation Bar
5
+ * @tag wc-navigation-bar
6
+ * @rawTag navigation-bar
7
+ *
8
+ * @summary A bottom bar with three to five primary destinations, for small screens.
9
+ * @overview
10
+ * <p>Navigation bar lays its <code>wc-navigation-bar-item</code> children out in a row of equal
11
+ * widths. Clicking an item makes it the active one and fires <code>change</code>.</p>
12
+ * <p>The bar does not position itself: place it at the bottom of your layout, or give it
13
+ * <code>position: fixed; inset-inline: 0; bottom: 0</code>.</p>
14
+ *
15
+ * @fires {CustomEvent<{value: string | undefined, index: number, item: NavigationBarItem}>} change - Dispatched when the user activates an item.
16
+ *
17
+ * @cssprop --navigation-bar-container-color - Background of the bar. Defaults to `--color-surface-container`.
18
+ * @cssprop --navigation-bar-height - Height of the bar. Defaults to 5rem (80dp).
19
+ * @cssprop --navigation-bar-elevation - Shadow of the bar. Defaults to `--elevation-level2`.
20
+ *
21
+ * @example
22
+ * ```html
23
+ * <wc-navigation-bar>
24
+ * <wc-navigation-bar-item active value="home">
25
+ * <wc-icon slot="icon" name="home"></wc-icon>
26
+ * Home
27
+ * </wc-navigation-bar-item>
28
+ * <wc-navigation-bar-item value="search">
29
+ * <wc-icon slot="icon" name="search"></wc-icon>
30
+ * Search
31
+ * </wc-navigation-bar-item>
32
+ * </wc-navigation-bar>
33
+ * ```
34
+ * @tags navigation
35
+ */
36
+ export declare class NavigationBar extends LitElement {
37
+ static styles: import("lit").CSSResultGroup[];
38
+ static Item: typeof NavigationBarItem;
39
+ connectedCallback(): void;
40
+ disconnectedCallback(): void;
41
+ private getItems;
42
+ private handleItemClick;
43
+ render(): import("lit-html").TemplateResult<1>;
44
+ }
@@ -0,0 +1,2 @@
1
+ export { NavigationDrawer } from './navigation-drawer.js';
2
+ export { NavigationDrawerItem } from './navigation-drawer-item.js';