material 3.7.3 → 3.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 (440) hide show
  1. package/NOTICE +223 -0
  2. package/README.md +6 -4
  3. package/dist/components/badge/badge.d.ts +4 -0
  4. package/dist/components/badge/constants.d.ts +4 -0
  5. package/dist/components/badge/index.d.ts +1 -0
  6. package/dist/components/badge/types.d.ts +102 -0
  7. package/dist/components/bottom-app-bar/bottom-app-bar.d.ts +4 -0
  8. package/dist/components/bottom-app-bar/constants.d.ts +3 -0
  9. package/dist/components/bottom-app-bar/types.d.ts +42 -0
  10. package/dist/components/bottom-sheet/bottom-sheet.d.ts +4 -0
  11. package/dist/components/bottom-sheet/constants.d.ts +9 -0
  12. package/dist/components/bottom-sheet/types.d.ts +52 -0
  13. package/dist/components/button/button.d.ts +4 -0
  14. package/dist/components/button/constants.d.ts +20 -0
  15. package/dist/components/button/index.d.ts +1 -0
  16. package/dist/components/button/types.d.ts +190 -0
  17. package/dist/components/button-group/button-group.d.ts +4 -0
  18. package/dist/components/button-group/constants.d.ts +54 -0
  19. package/dist/components/button-group/index.d.ts +1 -0
  20. package/dist/components/button-group/types.d.ts +125 -0
  21. package/dist/components/card/card.d.ts +4 -0
  22. package/dist/components/card/constants.d.ts +11 -0
  23. package/dist/components/card/content.d.ts +16 -0
  24. package/dist/components/card/index.d.ts +2 -0
  25. package/dist/components/card/types.d.ts +123 -0
  26. package/dist/components/carousel/carousel.d.ts +1 -0
  27. package/dist/components/carousel/constants.d.ts +10 -0
  28. package/dist/components/carousel/types.d.ts +16 -0
  29. package/dist/components/checkbox/checkbox.d.ts +5 -0
  30. package/dist/components/checkbox/constants.d.ts +13 -0
  31. package/dist/components/checkbox/index.d.ts +2 -0
  32. package/dist/components/checkbox/types.d.ts +94 -0
  33. package/dist/components/chips/chips.d.ts +4 -0
  34. package/dist/components/chips/constants.d.ts +1 -0
  35. package/dist/components/chips/factories.d.ts +4 -0
  36. package/dist/components/chips/types.d.ts +140 -0
  37. package/dist/components/datepicker/constants.d.ts +38 -0
  38. package/dist/components/datepicker/datepicker.d.ts +2 -0
  39. package/dist/components/datepicker/types.d.ts +139 -0
  40. package/dist/components/dialog/constants.d.ts +45 -0
  41. package/dist/components/dialog/dialog.d.ts +5 -0
  42. package/dist/components/dialog/index.d.ts +1 -0
  43. package/dist/components/dialog/types.d.ts +196 -0
  44. package/dist/components/divider/config.d.ts +30 -0
  45. package/dist/components/divider/constants.d.ts +15 -0
  46. package/dist/components/divider/divider.d.ts +4 -0
  47. package/dist/components/divider/types.d.ts +27 -0
  48. package/dist/components/drawer/constants.d.ts +39 -0
  49. package/dist/components/drawer/drawer.d.ts +4 -0
  50. package/dist/components/drawer/index.d.ts +1 -0
  51. package/dist/components/drawer/types.d.ts +109 -0
  52. package/dist/components/extended-fab/constants.d.ts +32 -0
  53. package/dist/components/extended-fab/extended-fab.d.ts +4 -0
  54. package/dist/components/extended-fab/types.d.ts +126 -0
  55. package/dist/components/fab/constants.d.ts +26 -0
  56. package/dist/components/fab/fab.d.ts +4 -0
  57. package/dist/components/fab/types.d.ts +103 -0
  58. package/dist/components/fab-menu/constants.d.ts +9 -0
  59. package/dist/components/fab-menu/fab-menu.d.ts +4 -0
  60. package/dist/components/fab-menu/types.d.ts +41 -0
  61. package/dist/components/icon-button/constants.d.ts +34 -0
  62. package/dist/components/icon-button/icon-button.d.ts +4 -0
  63. package/dist/components/icon-button/types.d.ts +157 -0
  64. package/dist/components/index.d.ts +1 -0
  65. package/dist/components/list/constants.d.ts +30 -0
  66. package/dist/components/list/index.d.ts +1 -0
  67. package/dist/components/list/list.d.ts +4 -0
  68. package/dist/components/list/types.d.ts +110 -0
  69. package/dist/components/loading-indicator/constants.d.ts +16 -0
  70. package/dist/components/loading-indicator/features/renderer.d.ts +13 -0
  71. package/dist/components/loading-indicator/loading-indicator.d.ts +4 -0
  72. package/dist/components/loading-indicator/types.d.ts +21 -0
  73. package/dist/components/menu/constants.d.ts +51 -0
  74. package/dist/components/menu/features/controller.js +1 -1
  75. package/dist/components/menu/features/keyboard.js +8 -3
  76. package/dist/components/menu/features/opener.js +2 -16
  77. package/dist/components/menu/index.d.ts +2 -0
  78. package/dist/components/menu/inner.d.ts +2 -0
  79. package/dist/components/menu/menu.d.ts +4 -0
  80. package/dist/components/menu/on-demand.d.ts +9 -0
  81. package/dist/components/menu/types.d.ts +185 -1
  82. package/dist/components/navigation-bar/navigation-bar.d.ts +1 -0
  83. package/dist/components/navigation-bar/types.d.ts +12 -0
  84. package/dist/components/navigation-rail/constants.d.ts +2 -0
  85. package/dist/components/navigation-rail/navigation-rail.d.ts +1 -0
  86. package/dist/components/navigation-rail/types.d.ts +18 -0
  87. package/dist/components/progress/constants.d.ts +37 -0
  88. package/dist/components/progress/progress.d.ts +4 -0
  89. package/dist/components/progress/types.d.ts +136 -0
  90. package/dist/components/radios/constants.d.ts +14 -0
  91. package/dist/components/radios/radios.d.ts +4 -0
  92. package/dist/components/radios/types.d.ts +89 -0
  93. package/dist/components/search/constants.d.ts +34 -0
  94. package/dist/components/search/search.d.ts +4 -0
  95. package/dist/components/search/types.d.ts +109 -0
  96. package/dist/components/select/constants.d.ts +46 -0
  97. package/dist/components/select/features.js +9 -1
  98. package/dist/components/select/index.d.ts +2 -0
  99. package/dist/components/select/select.d.ts +4 -0
  100. package/dist/components/select/types.d.ts +95 -0
  101. package/dist/components/side-sheet/constants.d.ts +9 -0
  102. package/dist/components/side-sheet/side-sheet.d.ts +4 -0
  103. package/dist/components/side-sheet/types.d.ts +51 -0
  104. package/dist/components/slider/constants.d.ts +62 -0
  105. package/dist/components/slider/slider.d.ts +4 -0
  106. package/dist/components/slider/types.d.ts +78 -0
  107. package/dist/components/snackbar/constants.d.ts +37 -0
  108. package/dist/components/snackbar/snackbar.d.ts +5 -0
  109. package/dist/components/snackbar/types.d.ts +67 -0
  110. package/dist/components/split-button/api.js +13 -3
  111. package/dist/components/split-button/constants.d.ts +13 -0
  112. package/dist/components/split-button/split-button.d.ts +4 -0
  113. package/dist/components/split-button/types.d.ts +50 -0
  114. package/dist/components/switch/constants.d.ts +34 -0
  115. package/dist/components/switch/switch.d.ts +4 -0
  116. package/dist/components/switch/types.d.ts +55 -0
  117. package/dist/components/tabs/constants.d.ts +49 -0
  118. package/dist/components/tabs/indicator.d.ts +22 -0
  119. package/dist/components/tabs/responsive.d.ts +17 -0
  120. package/dist/components/tabs/tab.d.ts +5 -0
  121. package/dist/components/tabs/tabs.d.ts +4 -0
  122. package/dist/components/tabs/types.d.ts +170 -0
  123. package/dist/components/tabs/utils.d.ts +24 -0
  124. package/dist/components/text-field/constants.d.ts +61 -0
  125. package/dist/components/text-field/features/trailing-icon.d.ts +25 -0
  126. package/dist/components/text-field/text-field.d.ts +4 -0
  127. package/dist/components/text-field/types.d.ts +84 -0
  128. package/dist/components/timepicker/constants.d.ts +61 -0
  129. package/dist/components/timepicker/types.d.ts +145 -0
  130. package/dist/components/toolbar/constants.d.ts +8 -0
  131. package/dist/components/toolbar/toolbar.d.ts +4 -0
  132. package/dist/components/toolbar/types.d.ts +75 -0
  133. package/dist/components/tooltip/constants.d.ts +43 -0
  134. package/dist/components/tooltip/tooltip.d.ts +4 -0
  135. package/dist/components/tooltip/types.d.ts +78 -0
  136. package/dist/components/top-app-bar/constants.d.ts +29 -0
  137. package/dist/components/top-app-bar/top-app-bar.d.ts +4 -0
  138. package/dist/components/top-app-bar/types.d.ts +55 -0
  139. package/dist/core/canvas/animation.d.ts +6 -0
  140. package/dist/core/canvas/drawing.d.ts +47 -0
  141. package/dist/core/canvas/index.d.ts +1 -0
  142. package/dist/core/canvas/resize.d.ts +7 -0
  143. package/dist/core/canvas/utils.d.ts +39 -0
  144. package/dist/core/compose/base.d.ts +9 -0
  145. package/dist/core/compose/cleanup.d.ts +2 -0
  146. package/dist/core/compose/component.d.ts +13 -0
  147. package/dist/core/compose/features/badge.d.ts +10 -0
  148. package/dist/core/compose/features/checkable.d.ts +13 -0
  149. package/dist/core/compose/features/debounce.d.ts +19 -0
  150. package/dist/core/compose/features/disabled.d.ts +11 -0
  151. package/dist/core/compose/features/events.d.ts +19 -0
  152. package/dist/core/compose/features/icon.d.ts +20 -0
  153. package/dist/core/compose/features/input.d.ts +31 -0
  154. package/dist/core/compose/features/lifecycle.d.ts +16 -0
  155. package/dist/core/compose/features/position.d.ts +13 -0
  156. package/dist/core/compose/features/ripple.d.ts +17 -0
  157. package/dist/core/compose/features/size.d.ts +5 -0
  158. package/dist/core/compose/features/style.d.ts +5 -0
  159. package/dist/core/compose/features/text.d.ts +20 -0
  160. package/dist/core/compose/features/textinput.d.ts +39 -0
  161. package/dist/core/compose/features/textlabel.d.ts +18 -0
  162. package/dist/core/compose/features/throttle.d.ts +18 -0
  163. package/dist/core/compose/features/track.d.ts +12 -0
  164. package/dist/core/compose/features/variant.d.ts +5 -0
  165. package/dist/core/compose/features/withEvents.d.ts +12 -0
  166. package/dist/core/compose/pipe.d.ts +12 -0
  167. package/dist/core/compose/utils/type-guards.d.ts +5 -0
  168. package/dist/core/config/component.d.ts +17 -0
  169. package/dist/core/config/global.d.ts +15 -0
  170. package/dist/core/config.d.ts +34 -0
  171. package/dist/core/dom/attributes.d.ts +25 -0
  172. package/dist/core/dom/classes.d.ts +24 -0
  173. package/dist/core/dom/create.d.ts +47 -0
  174. package/dist/core/dom/events.d.ts +26 -0
  175. package/dist/core/dom/focus.d.ts +11 -0
  176. package/dist/core/dom/html.d.ts +6 -0
  177. package/dist/core/dom/layer.d.ts +36 -0
  178. package/dist/core/dom/roving.d.ts +7 -0
  179. package/dist/core/navigation/destinations.d.ts +10 -0
  180. package/dist/core/shapes/cubic.d.ts +8 -0
  181. package/dist/core/shapes/material.d.ts +45 -0
  182. package/dist/core/shapes/polygon.d.ts +11 -0
  183. package/dist/core/state/emitter.d.ts +19 -0
  184. package/dist/core/state/events.d.ts +17 -0
  185. package/dist/core/state/store.d.ts +40 -0
  186. package/dist/core/theme/shape.d.ts +3 -0
  187. package/dist/core/theme/tokens.d.ts +6 -0
  188. package/dist/core/utils/background.d.ts +7 -0
  189. package/dist/core/utils/color.d.ts +5 -0
  190. package/dist/core/utils/index.d.ts +9 -0
  191. package/dist/core/utils/mobile.d.ts +10 -0
  192. package/dist/core/utils/object.d.ts +9 -0
  193. package/dist/core/utils/performance.d.ts +20 -0
  194. package/dist/core/utils/theme.d.ts +8 -0
  195. package/dist/core/utils/url.d.ts +3 -0
  196. package/dist/elements/adapter.d.ts +24 -0
  197. package/dist/elements/badge.d.ts +4 -0
  198. package/dist/elements/bottom-app-bar.d.ts +4 -0
  199. package/dist/elements/bottom-sheet.d.ts +6 -0
  200. package/dist/elements/button-group.d.ts +8 -0
  201. package/dist/elements/button.d.ts +5 -0
  202. package/dist/elements/card.d.ts +4 -0
  203. package/dist/elements/carousel.d.ts +5 -0
  204. package/dist/elements/checkbox.d.ts +4 -0
  205. package/dist/elements/chips.d.ts +9 -0
  206. package/dist/elements/css/menu.css +1 -1
  207. package/dist/elements/css/menu.js +1 -1
  208. package/dist/elements/datepicker.d.ts +6 -0
  209. package/dist/elements/define.d.ts +48 -0
  210. package/dist/elements/dialog.d.ts +5 -0
  211. package/dist/elements/divider.d.ts +4 -0
  212. package/dist/elements/drawer.d.ts +6 -0
  213. package/dist/elements/extended-fab.d.ts +6 -0
  214. package/dist/elements/fab-menu.d.ts +10 -0
  215. package/dist/elements/fab.d.ts +6 -0
  216. package/dist/elements/icon-button.d.ts +6 -0
  217. package/dist/elements/index.d.ts +4 -0
  218. package/dist/elements/list.d.ts +8 -0
  219. package/dist/elements/loading-indicator.d.ts +4 -0
  220. package/dist/elements/menu.d.ts +12 -0
  221. package/dist/elements/navigation-bar.d.ts +6 -0
  222. package/dist/elements/navigation-rail.d.ts +10 -0
  223. package/dist/elements/preupgrade/badge.css +1 -1
  224. package/dist/elements/preupgrade/bottom-app-bar.css +1 -1
  225. package/dist/elements/preupgrade/bottom-sheet.css +1 -1
  226. package/dist/elements/preupgrade/button-group.css +1 -1
  227. package/dist/elements/preupgrade/button.css +1 -1
  228. package/dist/elements/preupgrade/card.css +1 -1
  229. package/dist/elements/preupgrade/carousel.css +1 -1
  230. package/dist/elements/preupgrade/checkbox.css +1 -1
  231. package/dist/elements/preupgrade/chips.css +1 -1
  232. package/dist/elements/preupgrade/datepicker.css +1 -1
  233. package/dist/elements/preupgrade/dialog.css +1 -1
  234. package/dist/elements/preupgrade/divider.css +1 -1
  235. package/dist/elements/preupgrade/drawer.css +1 -1
  236. package/dist/elements/preupgrade/extended-fab.css +1 -1
  237. package/dist/elements/preupgrade/fab-menu.css +1 -1
  238. package/dist/elements/preupgrade/fab.css +1 -1
  239. package/dist/elements/preupgrade/icon-button.css +1 -1
  240. package/dist/elements/preupgrade/list.css +1 -1
  241. package/dist/elements/preupgrade/loading-indicator.css +1 -1
  242. package/dist/elements/preupgrade/menu.css +1 -1
  243. package/dist/elements/preupgrade/navigation-bar.css +1 -1
  244. package/dist/elements/preupgrade/navigation-rail.css +1 -1
  245. package/dist/elements/preupgrade/progress.css +1 -1
  246. package/dist/elements/preupgrade/radios.css +1 -1
  247. package/dist/elements/preupgrade/search.css +1 -1
  248. package/dist/elements/preupgrade/select.css +1 -1
  249. package/dist/elements/preupgrade/side-sheet.css +1 -1
  250. package/dist/elements/preupgrade/slider.css +1 -1
  251. package/dist/elements/preupgrade/snackbar.css +1 -1
  252. package/dist/elements/preupgrade/split-button.css +1 -1
  253. package/dist/elements/preupgrade/switch.css +1 -1
  254. package/dist/elements/preupgrade/tabs.css +1 -1
  255. package/dist/elements/preupgrade/text-field.css +1 -1
  256. package/dist/elements/preupgrade/timepicker.css +1 -1
  257. package/dist/elements/preupgrade/toolbar.css +1 -1
  258. package/dist/elements/preupgrade/tooltip.css +1 -1
  259. package/dist/elements/preupgrade/top-app-bar.css +1 -1
  260. package/dist/elements/preupgrade.css +1 -1
  261. package/dist/elements/progress.d.ts +4 -0
  262. package/dist/elements/radios.d.ts +5 -0
  263. package/dist/elements/search.d.ts +15 -0
  264. package/dist/elements/select.d.ts +6 -0
  265. package/dist/elements/side-sheet.d.ts +5 -0
  266. package/dist/elements/slider.d.ts +7 -0
  267. package/dist/elements/snackbar.d.ts +4 -0
  268. package/dist/elements/split-button.d.ts +8 -0
  269. package/dist/elements/styles.d.ts +11 -0
  270. package/dist/elements/switch.d.ts +5 -0
  271. package/dist/elements/tabs.d.ts +6 -0
  272. package/dist/elements/text-field.d.ts +9 -0
  273. package/dist/elements/timepicker.d.ts +9 -0
  274. package/dist/elements/toolbar.d.ts +4 -0
  275. package/dist/elements/tooltip.d.ts +4 -0
  276. package/dist/elements/top-app-bar.d.ts +4 -0
  277. package/dist/index.d.ts +1 -0
  278. package/dist/react/create.d.ts +15 -0
  279. package/dist/react/index.d.ts +1 -0
  280. package/dist/react/jsx.d.ts +3 -0
  281. package/dist/solid/create.d.ts +16 -0
  282. package/dist/solid/index.d.ts +1 -0
  283. package/dist/solid/jsx.d.ts +4 -0
  284. package/dist/ssr/index.d.ts +3 -0
  285. package/dist/ssr/solid.d.ts +1 -0
  286. package/dist/ssr/svelte.d.ts +1 -0
  287. package/dist/ssr/vue.d.ts +1 -0
  288. package/dist/styles/badge.css +1 -1
  289. package/dist/styles/base-lite.css +2 -2
  290. package/dist/styles/base.css +2 -2
  291. package/dist/styles/bottom-app-bar.css +1 -1
  292. package/dist/styles/bottom-sheet.css +1 -1
  293. package/dist/styles/button-group.css +1 -1
  294. package/dist/styles/button.css +1 -1
  295. package/dist/styles/card.css +1 -1
  296. package/dist/styles/carousel.css +1 -1
  297. package/dist/styles/checkbox.css +1 -1
  298. package/dist/styles/chips.css +1 -1
  299. package/dist/styles/contrast.css +2 -2
  300. package/dist/styles/datepicker.css +1 -1
  301. package/dist/styles/dialog.css +1 -1
  302. package/dist/styles/divider.css +1 -1
  303. package/dist/styles/drawer.css +1 -1
  304. package/dist/styles/extended-fab.css +1 -1
  305. package/dist/styles/fab-menu.css +1 -1
  306. package/dist/styles/fab.css +1 -1
  307. package/dist/styles/icon-button.css +1 -1
  308. package/dist/styles/list.css +1 -1
  309. package/dist/styles/loading-indicator.css +1 -1
  310. package/dist/styles/menu.css +2 -2
  311. package/dist/styles/navigation-bar.css +1 -1
  312. package/dist/styles/navigation-rail.css +1 -1
  313. package/dist/styles/progress.css +1 -1
  314. package/dist/styles/radios.css +1 -1
  315. package/dist/styles/search.css +1 -1
  316. package/dist/styles/select.css +1 -1
  317. package/dist/styles/side-sheet.css +1 -1
  318. package/dist/styles/slider.css +1 -1
  319. package/dist/styles/snackbar.css +1 -1
  320. package/dist/styles/split-button.css +1 -1
  321. package/dist/styles/switch.css +1 -1
  322. package/dist/styles/tabs.css +1 -1
  323. package/dist/styles/text-field.css +1 -1
  324. package/dist/styles/timepicker.css +1 -1
  325. package/dist/styles/toolbar.css +1 -1
  326. package/dist/styles/tooltip.css +1 -1
  327. package/dist/styles/top-app-bar.css +1 -1
  328. package/dist/styles/typography.css +1 -1
  329. package/dist/styles/utilities.css +1 -1
  330. package/dist/styles.css +2 -2
  331. package/dist/svelte/runtime.d.ts +21 -0
  332. package/dist/theme/image.d.ts +4 -0
  333. package/dist/theme/image.js +5 -0
  334. package/dist/theme/index.d.ts +43 -0
  335. package/dist/theme/index.js +32 -0
  336. package/dist/theme/roles.js +68 -0
  337. package/dist/theme/variants.d.ts +15 -0
  338. package/dist/theme/variants.js +17 -0
  339. package/dist/theme/vendor/contrast/contrast.js +72 -0
  340. package/dist/theme/vendor/dislike/dislike_analyzer.js +31 -0
  341. package/dist/theme/vendor/dynamiccolor/color_spec_2021.d.ts +64 -0
  342. package/dist/theme/vendor/dynamiccolor/color_spec_2021.js +663 -0
  343. package/dist/theme/vendor/dynamiccolor/contrast_curve.js +42 -0
  344. package/dist/theme/vendor/dynamiccolor/dynamic_color.d.ts +63 -0
  345. package/dist/theme/vendor/dynamiccolor/dynamic_color.js +264 -0
  346. package/dist/theme/vendor/dynamiccolor/dynamic_scheme.d.ts +100 -0
  347. package/dist/theme/vendor/dynamiccolor/dynamic_scheme.js +418 -0
  348. package/dist/theme/vendor/dynamiccolor/material_dynamic_colors.d.ts +125 -0
  349. package/dist/theme/vendor/dynamiccolor/material_dynamic_colors.js +311 -0
  350. package/dist/theme/vendor/dynamiccolor/tone_delta_pair.js +27 -0
  351. package/dist/theme/vendor/dynamiccolor/variant.js +28 -0
  352. package/dist/theme/vendor/hct/cam16.js +249 -0
  353. package/dist/theme/vendor/hct/hct.d.ts +32 -0
  354. package/dist/theme/vendor/hct/hct.js +86 -0
  355. package/dist/theme/vendor/hct/hct_solver.js +390 -0
  356. package/dist/theme/vendor/hct/viewing_conditions.js +73 -0
  357. package/dist/theme/vendor/palettes/tonal_palette.js +114 -0
  358. package/dist/theme/vendor/quantize/lab_point_provider.js +31 -0
  359. package/dist/theme/vendor/quantize/quantizer_celebi.js +25 -0
  360. package/dist/theme/vendor/quantize/quantizer_map.js +31 -0
  361. package/dist/theme/vendor/quantize/quantizer_wsmeans.js +178 -0
  362. package/dist/theme/vendor/quantize/quantizer_wu.js +342 -0
  363. package/dist/theme/vendor/scheme/scheme_content.js +30 -0
  364. package/dist/theme/vendor/scheme/scheme_expressive.js +30 -0
  365. package/dist/theme/vendor/scheme/scheme_fidelity.js +30 -0
  366. package/dist/theme/vendor/scheme/scheme_monochrome.js +30 -0
  367. package/dist/theme/vendor/scheme/scheme_neutral.js +30 -0
  368. package/dist/theme/vendor/scheme/scheme_tonal_spot.js +30 -0
  369. package/dist/theme/vendor/scheme/scheme_vibrant.js +30 -0
  370. package/dist/theme/vendor/score/score.js +100 -0
  371. package/dist/theme/vendor/temperature/temperature_cache.js +198 -0
  372. package/dist/theme/vendor/utils/color_utils.js +173 -0
  373. package/dist/theme/vendor/utils/image_utils.js +72 -0
  374. package/dist/theme/vendor/utils/math_utils.js +75 -0
  375. package/dist/theme/vendor/utils/string_utils.js +61 -0
  376. package/dist/themes/autumn-contrast.css +2 -2
  377. package/dist/themes/autumn.css +2 -2
  378. package/dist/themes/baseline-contrast.css +2 -2
  379. package/dist/themes/baseline.css +2 -2
  380. package/dist/themes/brownbeige-contrast.css +2 -2
  381. package/dist/themes/brownbeige.css +2 -2
  382. package/dist/themes/content-contrast.css +2 -2
  383. package/dist/themes/content.css +2 -2
  384. package/dist/themes/desert-contrast.css +2 -2
  385. package/dist/themes/desert.css +2 -2
  386. package/dist/themes/expressive-contrast.css +2 -2
  387. package/dist/themes/expressive.css +2 -2
  388. package/dist/themes/fidelity-contrast.css +2 -2
  389. package/dist/themes/fidelity.css +2 -2
  390. package/dist/themes/forest-contrast.css +2 -2
  391. package/dist/themes/forest.css +2 -2
  392. package/dist/themes/fruit-salad-contrast.css +2 -2
  393. package/dist/themes/fruit-salad.css +2 -2
  394. package/dist/themes/highcontrast-contrast.css +2 -2
  395. package/dist/themes/highcontrast.css +2 -2
  396. package/dist/themes/monochrome-contrast.css +2 -2
  397. package/dist/themes/monochrome.css +2 -2
  398. package/dist/themes/neutral-contrast.css +2 -2
  399. package/dist/themes/neutral.css +2 -2
  400. package/dist/themes/ocean-contrast.css +2 -2
  401. package/dist/themes/ocean.css +2 -2
  402. package/dist/themes/rainbow-contrast.css +2 -2
  403. package/dist/themes/rainbow.css +2 -2
  404. package/dist/themes/sageivory-contrast.css +2 -2
  405. package/dist/themes/sageivory.css +2 -2
  406. package/dist/themes/spring-contrast.css +2 -2
  407. package/dist/themes/spring.css +2 -2
  408. package/dist/themes/summer-contrast.css +2 -2
  409. package/dist/themes/summer.css +2 -2
  410. package/dist/themes/sunset-contrast.css +2 -2
  411. package/dist/themes/sunset.css +2 -2
  412. package/dist/themes/tealcaramel-contrast.css +2 -2
  413. package/dist/themes/tealcaramel.css +2 -2
  414. package/dist/themes/vibrant-contrast.css +2 -2
  415. package/dist/themes/vibrant.css +2 -2
  416. package/dist/vue/create.d.ts +18 -0
  417. package/dist/vue/index.d.ts +1 -0
  418. package/package.json +14 -1
  419. package/src/styles/components/_menu.scss +14 -1
  420. package/src/styles/themes/_autumn.scss +20 -2
  421. package/src/styles/themes/_base-theme.scss +34 -24
  422. package/src/styles/themes/_baseline.scss +18 -0
  423. package/src/styles/themes/_brownbeige.scss +30 -2
  424. package/src/styles/themes/_content.scss +30 -2
  425. package/src/styles/themes/_desert.scss +30 -2
  426. package/src/styles/themes/_expressive.scss +30 -2
  427. package/src/styles/themes/_fidelity.scss +30 -2
  428. package/src/styles/themes/_forest.scss +20 -2
  429. package/src/styles/themes/_fruit-salad.scss +30 -2
  430. package/src/styles/themes/_highcontrast.scss +21 -2
  431. package/src/styles/themes/_monochrome.scss +30 -2
  432. package/src/styles/themes/_neutral.scss +30 -2
  433. package/src/styles/themes/_ocean.scss +20 -2
  434. package/src/styles/themes/_rainbow.scss +30 -2
  435. package/src/styles/themes/_sageivory.scss +30 -2
  436. package/src/styles/themes/_spring.scss +20 -2
  437. package/src/styles/themes/_summer.scss +30 -2
  438. package/src/styles/themes/_sunset.scss +20 -2
  439. package/src/styles/themes/_tealcaramel.scss +30 -2
  440. package/src/styles/themes/_vibrant.scss +30 -2
@@ -1,65 +1,168 @@
1
1
  import type { TouchEvents } from "../../core/utils/mobile.js";
2
2
  import type { IconManager } from "../../core/compose/features/icon.js";
3
3
  import type { ForwardedEventPayload } from "../../core/dom/create.js";
4
+ /** FAB variants following Material Design 3 guidelines Material Design 3 offers different color variants for the FAB to match visual hierarchy and application color schemes. */
4
5
  export type FabVariant = "primary-container" | "secondary-container" | "tertiary-container" | "primary" | "secondary" | "tertiary";
6
+ /** FAB size variants Material Design 3 defines multiple size options for FABs to accommodate different use cases and screen sizes. */
5
7
  export type FabSize = "default" | "medium" | "large";
8
+ /** FAB position options Predefined positions for the FAB when used as a floating element. */
6
9
  export type FabPosition = "top-right" | "top-left" | "bottom-right" | "bottom-left";
10
+ /** Logical viewport corners; start/end follow text direction. */
7
11
  export type FabPlacement = "none" | "top-start" | "top-end" | "bottom-start" | "bottom-end";
12
+ /** Configuration interface for the FAB component Comprehensive options for creating and customizing a Floating Action Button according to Material Design 3 guidelines. */
8
13
  export interface FabConfig {
14
+ /**
15
+ * FAB variant that determines visual styling The color variant affects the FAB's background color, icon color, and elevation.
16
+ * @default 'primary-container'
17
+ */
9
18
  variant?: FabVariant | string;
19
+ /**
20
+ * FAB size variant Controls the diameter of the FAB and the appropriate icon size.
21
+ * @default 'default'
22
+ */
10
23
  size?: FabSize | string;
24
+ /**
25
+ * Whether the FAB is initially disabled When disabled, the FAB will have a visually muted appearance and won't respond to user interactions.
26
+ * @default false
27
+ */
11
28
  disabled?: boolean;
29
+ /** FAB icon HTML content. */
12
30
  icon?: string;
31
+ /** Icon size in pixels or other CSS units Allows customizing the icon size beyond the default size for the selected FAB size. */
13
32
  iconSize?: string;
33
+ /** Additional CSS classes to add to the FAB Custom classes for styling or identifying the FAB. */
14
34
  class?: string;
35
+ /** Button value attribute Sets the HTML value attribute of the button element, useful when using the FAB in a form context. */
15
36
  value?: string;
37
+ /** Position of the FAB on the screen Configures the FAB for floating positioning on the screen. */
38
+ /** @deprecated Use placement. Physical left/right do not mirror in RTL; removal in 4.0. */
16
39
  position?: FabPosition | string;
40
+ /** Logical corner, fixed with 16px margins; none stays in flow. */
17
41
  placement?: FabPlacement;
42
+ /**
43
+ * Button type attribute Sets the HTML type attribute of the button element.
44
+ * @default 'button'
45
+ */
18
46
  type?: "button" | "submit" | "reset";
47
+ /** Accessible label for screen readers Sets the aria-label attribute for accessibility. */
48
+ /** Accessible name. */
19
49
  ariaLabel: string;
50
+ /**
51
+ * Whether to enable ripple effect The ripple effect provides visual feedback when the user interacts with the FAB.
52
+ * @default true
53
+ */
20
54
  ripple?: boolean;
55
+ /**
56
+ * Component prefix for class names The prefix used for BEM-style class names.
57
+ * @default 'mtrl'
58
+ */
21
59
  prefix?: string;
60
+ /** Component name used in class generation */
22
61
  componentName?: string;
62
+ /** Ripple effect configuration Fine-grained control over the ripple effect appearance and behavior. */
23
63
  rippleConfig?: {
64
+ /** How long, in milliseconds, a released wave lingers before it is removed */
24
65
  duration?: number;
25
66
  };
67
+ /**
68
+ * Whether to show the FAB with an entrance animation When true, the FAB will animate into view when added to the DOM.
69
+ * @default false
70
+ */
26
71
  animate?: boolean;
72
+ /** Index signature for additional configuration options */
27
73
  [key: string]: unknown;
28
74
  }
75
+ /** FAB component interface Provides methods for interacting with and manipulating a Floating Action Button. */
76
+ /** The events a FAB reports, and what each hands its handler. */
29
77
  export interface FabEvents extends TouchEvents {
78
+ /** The FAB was clicked. */
30
79
  click: (payload: ForwardedEventPayload<MouseEvent, HTMLButtonElement>) => void;
80
+ /** The FAB took focus. */
31
81
  focus: (payload: ForwardedEventPayload<FocusEvent, HTMLButtonElement>) => void;
82
+ /** The FAB lost focus. */
32
83
  blur: (payload: ForwardedEventPayload<FocusEvent, HTMLButtonElement>) => void;
33
84
  }
34
85
  export interface FabComponent {
86
+ /** The FAB's DOM element Direct access to the underlying button element for DOM manipulation. */
35
87
  element: HTMLButtonElement;
88
+ /** API for managing FAB icons Access to low-level icon methods and elements. */
36
89
  icon: {
90
+ /** Sets the icon HTML content */
37
91
  setIcon: (html: string) => IconManager;
92
+ /** Gets the current icon HTML content */
38
93
  getIcon: () => string;
94
+ /** Gets the icon DOM element */
39
95
  getElement: () => HTMLElement | null;
40
96
  };
97
+ /** API for managing disabled state Access to low-level disabled state methods. */
41
98
  disabled: {
99
+ /** Enables the FAB */
42
100
  enable: () => void;
101
+ /** Disables the FAB */
43
102
  disable: () => void;
103
+ /** Checks if the FAB is disabled */
44
104
  isDisabled: () => boolean;
45
105
  };
106
+ /** API for managing component lifecycle Access to low-level lifecycle methods. */
46
107
  lifecycle: {
108
+ /** Destroys the component and cleans up resources */
47
109
  destroy: () => void;
48
110
  };
111
+ /**
112
+ * Gets a class name with the component's prefix
113
+ * @param name
114
+ */
49
115
  getClass: (name: string) => string;
116
+ /** Gets the FAB's value attribute */
50
117
  getValue: () => string;
118
+ /**
119
+ * Sets the FAB's value attribute
120
+ * @param value
121
+ */
51
122
  setValue: (value: string) => FabComponent;
123
+ /** Enables the FAB (removes disabled attribute) Makes the FAB interactive and visually enabled. */
52
124
  enable: () => FabComponent;
125
+ /** Disables the FAB (adds disabled attribute) Makes the FAB non-interactive and visually disabled. */
53
126
  disable: () => FabComponent;
127
+ /** Whether the FAB is disabled */
54
128
  isDisabled: () => boolean;
129
+ /**
130
+ * Sets the FAB's icon
131
+ * @param icon
132
+ */
55
133
  setIcon: (icon: string) => FabComponent;
134
+ /** Gets the FAB's icon HTML content */
56
135
  getIcon: () => string;
136
+ /**
137
+ * Sets the FAB's position Positions the FAB in one of the four corners of the viewport.
138
+ * @param position
139
+ */
140
+ /** @deprecated Physical position alias; use the placement option/attribute. Removal in 4.0. */
57
141
  setPosition: (position: string) => FabComponent;
142
+ /** Gets the current position of the FAB */
143
+ /** @deprecated Reads only the physical position alias. Removal in 4.0. */
58
144
  getPosition: () => string | null;
145
+ /** Lowers the FAB (useful for pressed state) Visually lowers the FAB by reducing its elevation, typically used to indicate a pressed or active state. */
59
146
  lower: () => FabComponent;
147
+ /** Raises the FAB back to its default elevation Restores the default elevation after it has been lowered. */
60
148
  raise: () => FabComponent;
149
+ /** Destroys the FAB component and cleans up resources Removes event listeners and prepares the component for garbage collection. */
61
150
  destroy: () => void;
151
+ /**
152
+ * Adds an event listener to the FAB
153
+ * @param event
154
+ * @param handler
155
+ */
62
156
  on: <K extends keyof FabEvents>(event: K, handler: FabEvents[K]) => FabComponent;
157
+ /**
158
+ * Removes an event listener from the FAB
159
+ * @param event
160
+ * @param handler
161
+ */
63
162
  off: <K extends keyof FabEvents>(event: K, handler: FabEvents[K]) => FabComponent;
163
+ /**
164
+ * Adds CSS classes to the FAB element
165
+ * @param classes
166
+ */
64
167
  addClass: (...classes: string[]) => FabComponent;
65
168
  }
@@ -1,34 +1,43 @@
1
+ /** Colour sets (m3.material.io FAB menu specs): the close button takes the role, the items its container role. */
1
2
  export declare const FAB_MENU_COLORS: {
2
3
  readonly PRIMARY: "primary";
3
4
  readonly SECONDARY: "secondary";
4
5
  readonly TERTIARY: "tertiary";
5
6
  };
6
7
  export type FabMenuColor = (typeof FAB_MENU_COLORS)[keyof typeof FAB_MENU_COLORS];
8
+ /** The FAB sizes a menu opens from: not small, not extended. */
7
9
  export declare const FAB_MENU_SIZES: {
8
10
  readonly DEFAULT: "default";
9
11
  readonly MEDIUM: "medium";
10
12
  readonly LARGE: "large";
11
13
  };
12
14
  export type FabMenuSize = (typeof FAB_MENU_SIZES)[keyof typeof FAB_MENU_SIZES];
15
+ /** How the menu presents its items: */
13
16
  export declare const FAB_MENU_PRESENTATIONS: {
14
17
  readonly AUTO: "auto";
15
18
  readonly LIST: "list";
16
19
  readonly MENU: "menu";
17
20
  };
18
21
  export type FabMenuPresentation = (typeof FAB_MENU_PRESENTATIONS)[keyof typeof FAB_MENU_PRESENTATIONS];
22
+ /** Where the menu sits in its positioned container, or in the flow. */
19
23
  export declare const FAB_MENU_PLACEMENTS: {
20
24
  readonly NONE: "none";
21
25
  readonly BOTTOM_END: "bottom-end";
22
26
  readonly BOTTOM_START: "bottom-start";
23
27
  };
24
28
  export type FabMenuPlacement = (typeof FAB_MENU_PLACEMENTS)[keyof typeof FAB_MENU_PLACEMENTS];
29
+ /** The window width, in px, from which `auto` presents the baseline menu (medium windows). */
25
30
  export declare const FAB_MENU_MENU_FROM = 600;
31
+ /** The spec's item count: a menu of 2 to 6 related actions. */
26
32
  export declare const FAB_MENU_ITEMS: {
27
33
  readonly MIN: 2;
28
34
  readonly MAX: 6;
29
35
  };
36
+ /** The space between the list and the close button (FabMenuBaselineTokens.CloseButtonBetweenSpace). */
30
37
  export declare const FAB_MENU_LIST_GAP = 8;
38
+ /** The gap between the FAB and a baseline menu (m3.material.io FAB menu specs, web). */
31
39
  export declare const FAB_MENU_MENU_GAP = 4;
40
+ /** How long the items take to leave after the last one starts: FastSpatial, the longest of an item's transitions. */
32
41
  export declare const FAB_MENU_ITEM_EXIT = 425;
33
42
  export declare const FAB_MENU_EVENTS: {
34
43
  readonly OPEN: "open";
@@ -1,4 +1,8 @@
1
1
  import type { FabMenuConfig, FabMenuComponent } from "./types.js";
2
+ /**
3
+ * Creates a FAB menu: M3 Expressive's FAB that opens a list of related actions.
4
+ * @param config
5
+ */
2
6
  declare const createFabMenu: (config: FabMenuConfig) => FabMenuComponent;
3
7
  export default createFabMenu;
4
8
  export { createFabMenu };
@@ -1,11 +1,16 @@
1
1
  import type { ElementComponent } from "../../core/compose/index.js";
2
2
  import type { BaseComponentConfig } from "../../core/config/component.js";
3
3
  import type { FabMenuColor, FabMenuSize, FabMenuPresentation, FabMenuPlacement } from "./constants.js";
4
+ /** An action of the menu */
4
5
  export interface FabMenuItem {
6
+ /** Identifies the item in `select` */
5
7
  id: string;
8
+ /** The label: always shown (m3.material.io FAB menu guidelines) */
6
9
  text: string;
10
+ /** Icon HTML, 24dp. */
7
11
  icon?: string;
8
12
  }
13
+ /** What the menu presentation needs from a menu: the baseline menu (createMenu), or one the app brings. */
9
14
  export interface FabMenuMenu {
10
15
  open(event?: Event, interactionType?: "mouse" | "keyboard"): unknown;
11
16
  close(event?: Event, restoreFocus?: boolean): unknown;
@@ -16,35 +21,71 @@ export interface FabMenuMenu {
16
21
  destroy(): void;
17
22
  element: HTMLElement;
18
23
  }
24
+ /** Configuration of a FAB menu */
19
25
  export interface FabMenuConfig extends BaseComponentConfig {
26
+ /** The FAB's icon HTML. */
20
27
  icon: string;
28
+ /** The FAB's accessible name: it describes the menu the FAB opens */
21
29
  ariaLabel: string;
30
+ /** The actions, 2 to 6 (m3.material.io FAB menu guidelines). */
22
31
  items: FabMenuItem[];
32
+ /**
33
+ * Colour set: the FAB is the role's container, the close button the role,
34
+ * @default 'primary'
35
+ */
23
36
  color?: FabMenuColor | string;
37
+ /**
38
+ * The size of the FAB the menu opens from
39
+ * @default 'default'
40
+ */
24
41
  size?: FabMenuSize | string;
42
+ /**
43
+ * The expressive list (compact windows), the baseline menu (the site's rule
44
+ * @default 'auto'
45
+ */
25
46
  presentation?: FabMenuPresentation | string;
47
+ /**
48
+ * Where the FAB sits in its positioned container: 16dp from the window edges, 24dp in large windows.
49
+ * @default 'none'
50
+ */
26
51
  placement?: FabMenuPlacement | string;
52
+ /** The icon of the close button, 20dp. */
27
53
  closeIcon?: string;
54
+ /** A menu of the app's own for the menu presentation, in place of the baseline menu the FAB menu loads when it needs one. */
28
55
  menu?: (opener: HTMLElement, items: FabMenuItem[]) => FabMenuMenu;
56
+ /** Additional CSS classes */
29
57
  class?: string;
30
58
  }
59
+ /** Events of a FAB menu */
31
60
  export interface FabMenuEvents {
61
+ /** The menu opened */
32
62
  open: () => void;
63
+ /** The menu closed */
33
64
  close: () => void;
65
+ /** An item was chosen; the menu closes. */
34
66
  select: (event: {
35
67
  id: string;
36
68
  value: string;
37
69
  }) => void;
38
70
  }
71
+ /** A FAB menu */
39
72
  export interface FabMenuComponent extends ElementComponent {
73
+ /** The FAB, which becomes the close button of the list */
40
74
  fab: HTMLElement;
75
+ /** The list of the list presentation: `role="menu"` */
41
76
  list: HTMLElement;
77
+ /** Opens the menu. */
42
78
  open(event?: Event): this;
79
+ /** Closes the menu. */
43
80
  close(): this;
81
+ /** Opens or closes the menu */
44
82
  toggle(event?: Event): this;
83
+ /** Whether the menu is open */
45
84
  isOpen(): boolean;
85
+ /** The presentation in use: 'list' or 'menu' */
46
86
  getPresentation(): "list" | "menu";
47
87
  on<K extends keyof FabMenuEvents>(event: K, handler: FabMenuEvents[K]): this;
48
88
  off<K extends keyof FabMenuEvents>(event: K, handler: FabMenuEvents[K]): this;
89
+ /** Removes the FAB menu, its listeners and its menu */
49
90
  destroy(): void;
50
91
  }
@@ -1,44 +1,75 @@
1
+ /** IconButton variants following Material Design 3 guidelines */
1
2
  export declare const ICON_BUTTON_VARIANTS: {
3
+ /** Primary action button with solid background (highest emphasis) */
2
4
  readonly FILLED: "filled";
5
+ /** Secondary action button with tonal background (high emphasis) */
3
6
  readonly TONAL: "tonal";
7
+ /** Button with outline border and transparent background (medium emphasis) */
4
8
  readonly OUTLINED: "outlined";
9
+ /** Button with no background, just icon (lowest emphasis) */
5
10
  readonly STANDARD: "standard";
6
11
  };
12
+ /** IconButton variant type */
7
13
  export type IconButtonVariant = typeof ICON_BUTTON_VARIANTS[keyof typeof ICON_BUTTON_VARIANTS];
14
+ /** IconButton sizes following Material Design 3 specifications */
8
15
  export declare const ICON_BUTTON_SIZES: {
16
+ /** Extra small - 32px container, 20px icon */
9
17
  readonly XS: "xs";
18
+ /** Small - 40px container, 24px icon (default) */
10
19
  readonly S: "s";
20
+ /** Medium - 56px container, 24px icon */
11
21
  readonly M: "m";
22
+ /** Large - 96px container, 32px icon */
12
23
  readonly L: "l";
24
+ /** Extra large - 136px container, 40px icon */
13
25
  readonly XL: "xl";
14
26
  };
27
+ /** IconButton size type */
15
28
  export type IconButtonSize = typeof ICON_BUTTON_SIZES[keyof typeof ICON_BUTTON_SIZES];
29
+ /** IconButton shapes following Material Design 3 specifications */
16
30
  export declare const ICON_BUTTON_SHAPES: {
31
+ /** Round shape - full corner radius (default) */
17
32
  readonly ROUND: "round";
33
+ /** Square shape - fixed corner radius based on size */
18
34
  readonly SQUARE: "square";
19
35
  };
36
+ /** IconButton shape type */
20
37
  export type IconButtonShape = typeof ICON_BUTTON_SHAPES[keyof typeof ICON_BUTTON_SHAPES];
38
+ /** IconButton width variants following Material Design 3 specifications */
21
39
  export declare const ICON_BUTTON_WIDTHS: {
40
+ /** Narrow width */
22
41
  readonly NARROW: "narrow";
42
+ /** Default width */
23
43
  readonly DEFAULT: "default";
44
+ /** Wide width */
24
45
  readonly WIDE: "wide";
25
46
  };
47
+ /** IconButton width type */
26
48
  export type IconButtonWidth = typeof ICON_BUTTON_WIDTHS[keyof typeof ICON_BUTTON_WIDTHS];
49
+ /** Button types for IconButton */
27
50
  export declare const ICON_BUTTON_TYPES: {
28
51
  readonly BUTTON: "button";
29
52
  readonly SUBMIT: "submit";
30
53
  readonly RESET: "reset";
31
54
  };
55
+ /** CSS classes used by the IconButton component */
32
56
  export declare const ICON_BUTTON_CLASSES: {
57
+ /** Root element class */
33
58
  readonly ROOT: "icon-button";
59
+ /** Class for the icon container */
34
60
  readonly ICON: "icon-button__icon";
61
+ /** Applied when button is selected (toggle state) */
35
62
  readonly SELECTED: "icon-button--selected";
63
+ /** Applied when button is disabled */
36
64
  readonly DISABLED: "icon-button--disabled";
65
+ /** Applied when button is pressed (for shape morph) */
37
66
  readonly PRESSED: "icon-button--pressed";
38
67
  };
68
+ /** Default ripple effect configuration for IconButton */
39
69
  export declare const DEFAULT_RIPPLE_CONFIG: {
40
70
  readonly DURATION: 450;
41
71
  };
72
+ /** Corner radius values for square shape per size (in dp) */
42
73
  export declare const ICON_BUTTON_CORNER_RADIUS: {
43
74
  readonly XS: {
44
75
  readonly square: 12;
@@ -61,6 +92,7 @@ export declare const ICON_BUTTON_CORNER_RADIUS: {
61
92
  readonly pressed: 16;
62
93
  };
63
94
  };
95
+ /** Icon sizes per button size (in dp) */
64
96
  export declare const ICON_BUTTON_ICON_SIZES: {
65
97
  readonly XS: 20;
66
98
  readonly S: 24;
@@ -68,6 +100,7 @@ export declare const ICON_BUTTON_ICON_SIZES: {
68
100
  readonly L: 32;
69
101
  readonly XL: 40;
70
102
  };
103
+ /** Container sizes per button size (in dp) */
71
104
  export declare const ICON_BUTTON_CONTAINER_SIZES: {
72
105
  readonly XS: 32;
73
106
  readonly S: 40;
@@ -75,6 +108,7 @@ export declare const ICON_BUTTON_CONTAINER_SIZES: {
75
108
  readonly L: 96;
76
109
  readonly XL: 136;
77
110
  };
111
+ /** Width values per size and width variant (in dp) */
78
112
  export declare const ICON_BUTTON_WIDTH_VALUES: {
79
113
  readonly XS: {
80
114
  readonly narrow: 28;
@@ -1,3 +1,7 @@
1
1
  import { IconButtonConfig, IconButtonComponent } from "./types.js";
2
+ /**
3
+ * Creates a new IconButton component with the specified configuration.
4
+ * @param config
5
+ */
2
6
  declare const createIconButton: (config: IconButtonConfig) => IconButtonComponent;
3
7
  export default createIconButton;
@@ -2,88 +2,245 @@ import type { TouchEvents } from "../../core/utils/mobile.js";
2
2
  import type { ForwardedEventPayload } from "../../core/dom/index.js";
3
3
  import { BaseComponentConfig } from "../../core/config/component.js";
4
4
  import { IconButtonVariant, IconButtonSize, IconButtonShape, IconButtonWidth } from "./constants.js";
5
+ /** Configuration interface for the IconButton component IconButtons display actions in a compact form using icons. */
5
6
  export interface IconButtonConfig extends BaseComponentConfig {
7
+ /**
8
+ * IconButton variant that determines visual styling
9
+ * @default 'standard'
10
+ */
6
11
  variant?: IconButtonVariant | string;
12
+ /**
13
+ * IconButton size variant
14
+ * @default 's'
15
+ */
7
16
  size?: IconButtonSize | string;
17
+ /**
18
+ * IconButton shape variant
19
+ * @default 'round'
20
+ */
8
21
  shape?: IconButtonShape | string;
22
+ /**
23
+ * IconButton width variant
24
+ * @default 'default'
25
+ */
9
26
  width?: IconButtonWidth | string;
27
+ /**
28
+ * Whether the IconButton is initially disabled
29
+ * @default false
30
+ */
10
31
  disabled?: boolean;
32
+ /** Icon HTML content (required for icon buttons). */
11
33
  icon?: string;
34
+ /** Selected state icon HTML content (for toggle buttons). */
12
35
  selectedIcon?: string;
36
+ /**
37
+ * Whether the IconButton supports toggle (selection) behavior
38
+ * @default false
39
+ */
13
40
  toggle?: boolean;
41
+ /**
42
+ * Initial selected state (only applies when toggle is true)
43
+ * @default false
44
+ */
14
45
  selected?: boolean;
46
+ /**
47
+ * Whether a click flips the selected state of a toggle button.
48
+ * @default true
49
+ */
15
50
  toggleOnClick?: boolean;
51
+ /** Additional CSS classes to add to the IconButton */
16
52
  class?: string;
53
+ /** Button value attribute */
17
54
  value?: string;
55
+ /**
56
+ * Button type attribute
57
+ * @default 'button'
58
+ */
18
59
  type?: 'button' | 'submit' | 'reset';
60
+ /**
61
+ * Whether to enable ripple effect
62
+ * @default true
63
+ */
19
64
  ripple?: boolean;
65
+ /**
66
+ * Component prefix for class names
67
+ * @default 'mtrl'
68
+ */
20
69
  prefix?: string;
70
+ /** Component name used in class generation */
21
71
  componentName?: string;
72
+ /** Ripple effect configuration */
22
73
  rippleConfig?: {
74
+ /** How long, in milliseconds, a released wave lingers before it is removed */
23
75
  duration?: number;
24
76
  };
77
+ /** Accessible name for the IconButton (aria-label) */
78
+ /** Accessible name. */
25
79
  ariaLabel: string;
80
+ /**
81
+ * Whether to show tooltip on hover
82
+ * @default true
83
+ */
26
84
  tooltip?: boolean;
27
85
  }
86
+ /** Icon API interface for managing IconButton icons */
28
87
  export interface IconAPI {
88
+ /**
89
+ * Sets the icon HTML content
90
+ * @param html
91
+ */
29
92
  setIcon: (html: string) => IconAPI;
93
+ /** Gets the current icon HTML content */
30
94
  getIcon: () => string;
95
+ /** Gets the icon DOM element */
31
96
  getElement: () => HTMLElement | null;
32
97
  }
98
+ /** Toggle state manager interface for IconButton */
33
99
  export interface ToggleManager {
100
+ /** Selects the IconButton (toggle on) */
34
101
  select: () => ToggleManager;
102
+ /** Deselects the IconButton (toggle off) */
35
103
  deselect: () => ToggleManager;
104
+ /** Toggles the selection state */
36
105
  toggle: () => ToggleManager;
106
+ /** Checks if the IconButton is currently selected */
37
107
  isSelected: () => boolean;
38
108
  }
109
+ /** A toggle icon button's `change`. */
39
110
  export interface IconButtonChangePayload {
111
+ /** Whether the button is now selected */
40
112
  selected: boolean;
113
+ /** The button's value, as `getValue()` returns it */
41
114
  value: string;
42
115
  }
116
+ /** The icon button's events: native ones forwarded through its emitter, and a toggle button's `change`. */
43
117
  export interface IconButtonEvents extends TouchEvents {
118
+ /** A toggle button's selected state changed on a click. */
44
119
  change: (payload: IconButtonChangePayload) => void;
120
+ /** Clicks are not forwarded while the button is disabled. */
45
121
  click: (payload: ForwardedEventPayload<MouseEvent, HTMLButtonElement>) => void;
122
+ /** The button took focus. */
46
123
  focus: (payload: ForwardedEventPayload<FocusEvent, HTMLButtonElement>) => void;
124
+ /** The button lost focus. */
47
125
  blur: (payload: ForwardedEventPayload<FocusEvent, HTMLButtonElement>) => void;
48
126
  }
127
+ /** IconButton component interface */
49
128
  export interface IconButtonComponent {
129
+ /** The IconButton's DOM element */
50
130
  element: HTMLButtonElement;
131
+ /** API for managing IconButton icons */
51
132
  icon: IconAPI;
133
+ /** API for managing disabled state */
52
134
  disabled: {
135
+ /** Enables the IconButton */
53
136
  enable: () => void;
137
+ /** Disables the IconButton */
54
138
  disable: () => void;
139
+ /** Checks if the IconButton is disabled */
55
140
  isDisabled: () => boolean;
56
141
  };
142
+ /** API for managing component lifecycle */
57
143
  lifecycle: {
144
+ /** Destroys the component and cleans up resources */
58
145
  destroy: () => void;
59
146
  };
147
+ /**
148
+ * Gets a class name with the component's prefix
149
+ * @param name
150
+ */
60
151
  getClass: (name: string) => string;
152
+ /** Gets the IconButton's value attribute */
61
153
  getValue: () => string;
154
+ /**
155
+ * Sets the IconButton's value attribute
156
+ * @param value
157
+ */
62
158
  setValue: (value: string) => IconButtonComponent;
159
+ /** Gets the IconButton's current variant */
63
160
  getVariant: () => IconButtonVariant | string;
161
+ /**
162
+ * Sets the IconButton's variant
163
+ * @param variant
164
+ */
64
165
  setVariant: (variant: IconButtonVariant | string) => IconButtonComponent;
166
+ /** Gets the IconButton's current size */
65
167
  getSize: () => IconButtonSize | string;
168
+ /**
169
+ * Sets the IconButton's size
170
+ * @param size
171
+ */
66
172
  setSize: (size: IconButtonSize | string) => IconButtonComponent;
173
+ /** Gets the IconButton's current shape */
67
174
  getShape: () => IconButtonShape | string;
175
+ /**
176
+ * Sets the IconButton's shape
177
+ * @param shape
178
+ */
68
179
  setShape: (shape: IconButtonShape | string) => IconButtonComponent;
180
+ /** Gets the IconButton's current width */
69
181
  getWidth: () => IconButtonWidth | string;
182
+ /**
183
+ * Sets the IconButton's width
184
+ * @param width
185
+ */
70
186
  setWidth: (width: IconButtonWidth | string) => IconButtonComponent;
187
+ /** Enables the IconButton */
71
188
  enable: () => IconButtonComponent;
189
+ /** Disables the IconButton */
72
190
  disable: () => IconButtonComponent;
191
+ /** Whether the icon button is disabled */
73
192
  isDisabled: () => boolean;
193
+ /**
194
+ * Sets the IconButton's icon
195
+ * @param icon
196
+ */
74
197
  setIcon: (icon: string) => IconButtonComponent;
198
+ /** Gets the IconButton's icon HTML content */
75
199
  getIcon: () => string;
200
+ /**
201
+ * Sets the selected state icon (for toggle buttons)
202
+ * @param icon
203
+ */
76
204
  setSelectedIcon: (icon: string) => IconButtonComponent;
205
+ /** Gets the selected state icon HTML content */
77
206
  getSelectedIcon: () => string;
207
+ /** Checks if the IconButton is in toggle mode */
78
208
  isToggle: () => boolean;
209
+ /** Selects the IconButton (for toggle buttons) */
79
210
  select: () => IconButtonComponent;
211
+ /** Deselects the IconButton (for toggle buttons) */
80
212
  deselect: () => IconButtonComponent;
213
+ /** Toggles the selection state (for toggle buttons) */
81
214
  toggleSelected: () => IconButtonComponent;
215
+ /** Checks if the IconButton is selected */
82
216
  isSelected: () => boolean;
217
+ /**
218
+ * Sets the aria-label attribute for accessibility
219
+ * @param label
220
+ */
83
221
  setAriaLabel: (label: string) => IconButtonComponent;
222
+ /** Destroys the IconButton component and cleans up resources */
84
223
  destroy: () => void;
224
+ /**
225
+ * Adds an event listener to the IconButton
226
+ * @param event
227
+ * @param handler
228
+ */
85
229
  on: <K extends keyof IconButtonEvents>(event: K, handler: IconButtonEvents[K]) => IconButtonComponent;
230
+ /**
231
+ * Removes an event listener from the IconButton
232
+ * @param event
233
+ * @param handler
234
+ */
86
235
  off: <K extends keyof IconButtonEvents>(event: K, handler: IconButtonEvents[K]) => IconButtonComponent;
236
+ /**
237
+ * Adds CSS classes to the IconButton element
238
+ * @param classes
239
+ */
87
240
  addClass: (...classes: string[]) => IconButtonComponent;
241
+ /**
242
+ * Removes CSS classes from the IconButton element
243
+ * @param classes
244
+ */
88
245
  removeClass: (...classes: string[]) => IconButtonComponent;
89
246
  }
@@ -1,3 +1,4 @@
1
+ /** Component library exports This file exports all component creators and their types. */
1
2
  export { default as createBadge } from "./badge/index.js";
2
3
  export { default as createBottomAppBar } from "./bottom-app-bar/index.js";
3
4
  export { default as createBottomSheet } from "./bottom-sheet/index.js";