material 3.2.6 → 3.3.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 (577) hide show
  1. package/README.md +1 -1
  2. package/dist/components/badge/badge.d.ts +0 -59
  3. package/dist/components/badge/constants.d.ts +0 -15
  4. package/dist/components/badge/index.d.ts +0 -6
  5. package/dist/components/badge/types.d.ts +0 -244
  6. package/dist/components/bottom-app-bar/bottom-app-bar.d.ts +0 -10
  7. package/dist/components/bottom-app-bar/constants.d.ts +0 -9
  8. package/dist/components/bottom-app-bar/index.d.ts +0 -4
  9. package/dist/components/bottom-app-bar/types.d.ts +0 -76
  10. package/dist/components/bottom-sheet/bottom-sheet.d.ts +0 -21
  11. package/dist/components/bottom-sheet/constants.d.ts +0 -29
  12. package/dist/components/bottom-sheet/types.d.ts +0 -89
  13. package/dist/components/button/button.d.ts +0 -62
  14. package/dist/components/button/constants.d.ts +0 -41
  15. package/dist/components/button/index.d.ts +0 -4
  16. package/dist/components/button/types.d.ts +0 -347
  17. package/dist/components/button-group/button-group.d.ts +0 -51
  18. package/dist/components/button-group/constants.d.ts +0 -83
  19. package/dist/components/button-group/index.d.ts +0 -10
  20. package/dist/components/button-group/types.d.ts +0 -234
  21. package/dist/components/card/card.d.ts +0 -64
  22. package/dist/components/card/constants.d.ts +0 -33
  23. package/dist/components/card/content.d.ts +0 -86
  24. package/dist/components/card/index.d.ts +0 -66
  25. package/dist/components/card/types.d.ts +0 -366
  26. package/dist/components/carousel/carousel.d.ts +0 -22
  27. package/dist/components/carousel/constants.d.ts +0 -16
  28. package/dist/components/carousel/types.d.ts +0 -29
  29. package/dist/components/checkbox/checkbox.d.ts +0 -61
  30. package/dist/components/checkbox/constants.d.ts +0 -33
  31. package/dist/components/checkbox/index.d.ts +0 -25
  32. package/dist/components/checkbox/types.d.ts +0 -206
  33. package/dist/components/chips/chips.d.ts +0 -14
  34. package/dist/components/chips/constants.d.ts +0 -1
  35. package/dist/components/chips/factories.d.ts +0 -4
  36. package/dist/components/chips/types.d.ts +0 -278
  37. package/dist/components/datepicker/constants.d.ts +0 -56
  38. package/dist/components/datepicker/datepicker.d.ts +0 -5
  39. package/dist/components/datepicker/types.d.ts +12 -257
  40. package/dist/components/dialog/constants.d.ts +0 -65
  41. package/dist/components/dialog/dialog.d.ts +0 -86
  42. package/dist/components/dialog/index.d.ts +0 -12
  43. package/dist/components/dialog/types.d.ts +0 -511
  44. package/dist/components/divider/config.d.ts +0 -130
  45. package/dist/components/divider/constants.d.ts +0 -27
  46. package/dist/components/divider/divider.d.ts +0 -36
  47. package/dist/components/divider/index.d.ts +0 -29
  48. package/dist/components/divider/types.d.ts +0 -126
  49. package/dist/components/drawer/constants.d.ts +0 -53
  50. package/dist/components/drawer/drawer.d.ts +0 -56
  51. package/dist/components/drawer/index.d.ts +0 -4
  52. package/dist/components/drawer/types.d.ts +0 -200
  53. package/dist/components/extended-fab/config.js +3 -2
  54. package/dist/components/extended-fab/constants.d.ts +0 -46
  55. package/dist/components/extended-fab/extended-fab.d.ts +0 -58
  56. package/dist/components/extended-fab/index.d.ts +1 -35
  57. package/dist/components/extended-fab/types.d.ts +2 -654
  58. package/dist/components/fab/config.js +3 -2
  59. package/dist/components/fab/constants.d.ts +0 -40
  60. package/dist/components/fab/fab.d.ts +0 -42
  61. package/dist/components/fab/index.d.ts +1 -34
  62. package/dist/components/fab/types.d.ts +2 -543
  63. package/dist/components/fab-menu/constants.d.ts +0 -22
  64. package/dist/components/fab-menu/fab-menu.d.ts +0 -36
  65. package/dist/components/fab-menu/types.d.ts +0 -80
  66. package/dist/components/icon-button/constants.d.ts +0 -90
  67. package/dist/components/icon-button/icon-button.d.ts +0 -83
  68. package/dist/components/icon-button/index.d.ts +0 -44
  69. package/dist/components/icon-button/types.d.ts +0 -314
  70. package/dist/components/index.d.ts +0 -9
  71. package/dist/components/list/constants.d.ts +0 -47
  72. package/dist/components/list/index.d.ts +0 -1
  73. package/dist/components/list/list.d.ts +0 -26
  74. package/dist/components/list/types.d.ts +0 -263
  75. package/dist/components/loading-indicator/constants.d.ts +0 -35
  76. package/dist/components/loading-indicator/features/renderer.d.ts +0 -14
  77. package/dist/components/loading-indicator/loading-indicator.d.ts +0 -6
  78. package/dist/components/loading-indicator/types.d.ts +0 -35
  79. package/dist/components/menu/constants.d.ts +0 -79
  80. package/dist/components/menu/index.d.ts +0 -25
  81. package/dist/components/menu/inner.d.ts +0 -3
  82. package/dist/components/menu/menu.d.ts +0 -26
  83. package/dist/components/menu/types.d.ts +0 -423
  84. package/dist/components/navigation-bar/navigation-bar.d.ts +0 -7
  85. package/dist/components/navigation-bar/types.d.ts +0 -25
  86. package/dist/components/navigation-rail/constants.d.ts +0 -2
  87. package/dist/components/navigation-rail/navigation-rail.d.ts +0 -5
  88. package/dist/components/navigation-rail/types.d.ts +0 -22
  89. package/dist/components/progress/constants.d.ts +24 -56
  90. package/dist/components/progress/progress.d.ts +0 -21
  91. package/dist/components/progress/types.d.ts +0 -251
  92. package/dist/components/radios/constants.d.ts +0 -22
  93. package/dist/components/radios/radios.d.ts +0 -5
  94. package/dist/components/radios/types.d.ts +0 -142
  95. package/dist/components/search/constants.d.ts +0 -59
  96. package/dist/components/search/search.d.ts +0 -32
  97. package/dist/components/search/types.d.ts +0 -159
  98. package/dist/components/select/constants.d.ts +0 -60
  99. package/dist/components/select/index.d.ts +0 -22
  100. package/dist/components/select/select.d.ts +0 -33
  101. package/dist/components/select/types.d.ts +0 -241
  102. package/dist/components/side-sheet/constants.d.ts +0 -28
  103. package/dist/components/side-sheet/side-sheet.d.ts +0 -21
  104. package/dist/components/side-sheet/types.d.ts +0 -82
  105. package/dist/components/slider/constants.d.ts +0 -86
  106. package/dist/components/slider/slider.d.ts +0 -16
  107. package/dist/components/slider/types.d.ts +0 -184
  108. package/dist/components/snackbar/constants.d.ts +0 -73
  109. package/dist/components/snackbar/snackbar.d.ts +0 -13
  110. package/dist/components/snackbar/types.d.ts +0 -147
  111. package/dist/components/split-button/constants.d.ts +0 -33
  112. package/dist/components/split-button/split-button.d.ts +0 -21
  113. package/dist/components/split-button/types.d.ts +0 -81
  114. package/dist/components/switch/constants.d.ts +0 -49
  115. package/dist/components/switch/switch.d.ts +0 -5
  116. package/dist/components/switch/types.d.ts +0 -80
  117. package/dist/components/tabs/constants.d.ts +0 -76
  118. package/dist/components/tabs/indicator.d.ts +0 -27
  119. package/dist/components/tabs/responsive.d.ts +0 -30
  120. package/dist/components/tabs/tab.d.ts +0 -13
  121. package/dist/components/tabs/tabs.d.ts +0 -24
  122. package/dist/components/tabs/types.d.ts +0 -335
  123. package/dist/components/tabs/utils.d.ts +0 -66
  124. package/dist/components/text-field/constants.d.ts +0 -82
  125. package/dist/components/text-field/features/trailing-icon.d.ts +0 -61
  126. package/dist/components/text-field/text-field.d.ts +0 -33
  127. package/dist/components/text-field/types.d.ts +0 -123
  128. package/dist/components/timepicker/constants.d.ts +0 -88
  129. package/dist/components/timepicker/types.d.ts +0 -268
  130. package/dist/components/toolbar/constants.d.ts +0 -27
  131. package/dist/components/toolbar/toolbar.d.ts +0 -25
  132. package/dist/components/toolbar/types.d.ts +0 -102
  133. package/dist/components/tooltip/constants.d.ts +0 -58
  134. package/dist/components/tooltip/tooltip.d.ts +0 -5
  135. package/dist/components/tooltip/types.d.ts +0 -140
  136. package/dist/components/top-app-bar/constants.d.ts +0 -41
  137. package/dist/components/top-app-bar/index.d.ts +0 -4
  138. package/dist/components/top-app-bar/top-app-bar.d.ts +0 -10
  139. package/dist/components/top-app-bar/types.d.ts +0 -94
  140. package/dist/core/canvas/animation.d.ts +0 -13
  141. package/dist/core/canvas/drawing.d.ts +18 -55
  142. package/dist/core/canvas/index.d.ts +0 -4
  143. package/dist/core/canvas/resize.d.ts +0 -13
  144. package/dist/core/canvas/utils.d.ts +0 -62
  145. package/dist/core/compose/base.d.ts +0 -22
  146. package/dist/core/compose/cleanup.d.ts +0 -2
  147. package/dist/core/compose/component.d.ts +0 -31
  148. package/dist/core/compose/features/badge.d.ts +0 -25
  149. package/dist/core/compose/features/checkable.d.ts +0 -36
  150. package/dist/core/compose/features/debounce.d.ts +0 -57
  151. package/dist/core/compose/features/disabled.d.ts +0 -31
  152. package/dist/core/compose/features/events.d.ts +0 -38
  153. package/dist/core/compose/features/icon.d.ts +0 -49
  154. package/dist/core/compose/features/input.d.ts +0 -82
  155. package/dist/core/compose/features/lifecycle.d.ts +0 -36
  156. package/dist/core/compose/features/position.d.ts +0 -27
  157. package/dist/core/compose/features/ripple.d.ts +0 -29
  158. package/dist/core/compose/features/size.d.ts +0 -9
  159. package/dist/core/compose/features/style.d.ts +0 -9
  160. package/dist/core/compose/features/text.d.ts +0 -45
  161. package/dist/core/compose/features/textinput.d.ts +0 -88
  162. package/dist/core/compose/features/textlabel.d.ts +0 -44
  163. package/dist/core/compose/features/throttle.d.ts +0 -54
  164. package/dist/core/compose/features/track.d.ts +0 -34
  165. package/dist/core/compose/features/variant.d.ts +0 -9
  166. package/dist/core/compose/features/withEvents.d.ts +0 -30
  167. package/dist/core/compose/index.d.ts +0 -4
  168. package/dist/core/compose/pipe.d.ts +0 -55
  169. package/dist/core/compose/utils/type-guards.d.ts +0 -15
  170. package/dist/core/config/component.d.ts +0 -45
  171. package/dist/core/config/global.d.ts +0 -43
  172. package/dist/core/config.d.ts +0 -59
  173. package/dist/core/dom/attributes.d.ts +0 -41
  174. package/dist/core/dom/classes.d.ts +0 -49
  175. package/dist/core/dom/create.d.ts +0 -98
  176. package/dist/core/dom/events.d.ts +0 -52
  177. package/dist/core/dom/focus.d.ts +0 -32
  178. package/dist/core/dom/html.d.ts +0 -24
  179. package/dist/core/dom/layer.d.ts +0 -98
  180. package/dist/core/dom/roving.d.ts +0 -19
  181. package/dist/core/index.d.ts +0 -9
  182. package/dist/core/navigation/destinations.d.ts +0 -23
  183. package/dist/core/shapes/cubic.d.ts +24 -19
  184. package/dist/core/shapes/material.d.ts +0 -64
  185. package/dist/core/shapes/polygon.d.ts +6 -16
  186. package/dist/core/state/emitter.d.ts +0 -36
  187. package/dist/core/state/events.d.ts +0 -29
  188. package/dist/core/state/store.d.ts +0 -70
  189. package/dist/core/theme/index.d.ts +0 -3
  190. package/dist/core/theme/shape.d.ts +0 -7
  191. package/dist/core/theme/tokens.d.ts +48 -32
  192. package/dist/core/utils/background.d.ts +0 -29
  193. package/dist/core/utils/color.d.ts +0 -13
  194. package/dist/core/utils/index.d.ts +0 -11
  195. package/dist/core/utils/mobile.d.ts +0 -31
  196. package/dist/core/utils/object.d.ts +0 -11
  197. package/dist/core/utils/performance.d.ts +0 -70
  198. package/dist/core/utils/theme.d.ts +0 -36
  199. package/dist/core/utils/url.d.ts +0 -17
  200. package/dist/elements/adapter.d.ts +13 -62
  201. package/dist/elements/badge.d.ts +0 -17
  202. package/dist/elements/bottom-app-bar.d.ts +7 -17
  203. package/dist/elements/bottom-sheet.d.ts +9 -38
  204. package/dist/elements/button-group.d.ts +0 -31
  205. package/dist/elements/button.d.ts +24 -18
  206. package/dist/elements/button.js +12 -0
  207. package/dist/elements/card.d.ts +12 -24
  208. package/dist/elements/card.js +3 -2
  209. package/dist/elements/carousel.d.ts +5 -29
  210. package/dist/elements/checkbox.d.ts +5 -15
  211. package/dist/elements/chips.d.ts +0 -33
  212. package/dist/elements/css/extended-fab.css +1 -1
  213. package/dist/elements/css/extended-fab.js +1 -1
  214. package/dist/elements/css/fab-menu.css +1 -1
  215. package/dist/elements/css/fab-menu.js +1 -1
  216. package/dist/elements/css/fab.css +1 -1
  217. package/dist/elements/css/fab.js +1 -1
  218. package/dist/elements/css/hosts/extended-fab.css +1 -1
  219. package/dist/elements/css/hosts/fab.css +1 -1
  220. package/dist/elements/datepicker.d.ts +4 -48
  221. package/dist/elements/define.d.ts +3 -161
  222. package/dist/elements/dialog.d.ts +8 -39
  223. package/dist/elements/divider.d.ts +0 -14
  224. package/dist/elements/drawer.d.ts +0 -35
  225. package/dist/elements/extended-fab.d.ts +10 -18
  226. package/dist/elements/extended-fab.js +3 -1
  227. package/dist/elements/fab-menu.d.ts +5 -30
  228. package/dist/elements/fab.d.ts +8 -17
  229. package/dist/elements/fab.js +3 -1
  230. package/dist/elements/floating-placement.js +1 -0
  231. package/dist/elements/icon-button.d.ts +5 -26
  232. package/dist/elements/index.d.ts +0 -16
  233. package/dist/elements/list.d.ts +0 -34
  234. package/dist/elements/loading-indicator.d.ts +4 -13
  235. package/dist/elements/menu.d.ts +5 -51
  236. package/dist/elements/navigation-bar.d.ts +4 -29
  237. package/dist/elements/navigation-rail.d.ts +8 -49
  238. package/dist/elements/preupgrade/badge.css +1 -1
  239. package/dist/elements/preupgrade/bottom-app-bar.css +1 -1
  240. package/dist/elements/preupgrade/bottom-sheet.css +1 -1
  241. package/dist/elements/preupgrade/button-group.css +1 -1
  242. package/dist/elements/preupgrade/button.css +2 -2
  243. package/dist/elements/preupgrade/card.css +2 -2
  244. package/dist/elements/preupgrade/carousel.css +1 -1
  245. package/dist/elements/preupgrade/checkbox.css +1 -1
  246. package/dist/elements/preupgrade/chips.css +1 -1
  247. package/dist/elements/preupgrade/datepicker.css +1 -1
  248. package/dist/elements/preupgrade/dialog.css +1 -1
  249. package/dist/elements/preupgrade/divider.css +1 -1
  250. package/dist/elements/preupgrade/drawer.css +1 -1
  251. package/dist/elements/preupgrade/extended-fab.css +2 -2
  252. package/dist/elements/preupgrade/fab-menu.css +1 -1
  253. package/dist/elements/preupgrade/fab.css +2 -2
  254. package/dist/elements/preupgrade/icon-button.css +1 -1
  255. package/dist/elements/preupgrade/list.css +1 -1
  256. package/dist/elements/preupgrade/loading-indicator.css +1 -1
  257. package/dist/elements/preupgrade/menu.css +1 -1
  258. package/dist/elements/preupgrade/navigation-bar.css +1 -1
  259. package/dist/elements/preupgrade/navigation-rail.css +1 -1
  260. package/dist/elements/preupgrade/progress.css +1 -1
  261. package/dist/elements/preupgrade/radios.css +1 -1
  262. package/dist/elements/preupgrade/search.css +1 -1
  263. package/dist/elements/preupgrade/select.css +1 -1
  264. package/dist/elements/preupgrade/side-sheet.css +1 -1
  265. package/dist/elements/preupgrade/slider.css +1 -1
  266. package/dist/elements/preupgrade/snackbar.css +1 -1
  267. package/dist/elements/preupgrade/split-button.css +1 -1
  268. package/dist/elements/preupgrade/switch.css +1 -1
  269. package/dist/elements/preupgrade/tabs.css +1 -1
  270. package/dist/elements/preupgrade/text-field.css +1 -1
  271. package/dist/elements/preupgrade/timepicker.css +1 -1
  272. package/dist/elements/preupgrade/toolbar.css +1 -1
  273. package/dist/elements/preupgrade/tooltip.css +1 -1
  274. package/dist/elements/preupgrade/top-app-bar.css +1 -1
  275. package/dist/elements/preupgrade.css +2 -2
  276. package/dist/elements/preupgrade.d.ts +0 -1
  277. package/dist/elements/preupgrade.js +1 -1
  278. package/dist/elements/progress.d.ts +0 -15
  279. package/dist/elements/radios.d.ts +0 -22
  280. package/dist/elements/search.d.ts +5 -53
  281. package/dist/elements/select.d.ts +0 -31
  282. package/dist/elements/side-sheet.d.ts +7 -29
  283. package/dist/elements/slider.d.ts +3 -22
  284. package/dist/elements/snackbar.d.ts +4 -28
  285. package/dist/elements/split-button.d.ts +0 -30
  286. package/dist/elements/styles.d.ts +0 -63
  287. package/dist/elements/switch.d.ts +5 -17
  288. package/dist/elements/tabs.d.ts +0 -22
  289. package/dist/elements/text-field.d.ts +4 -38
  290. package/dist/elements/timepicker.d.ts +4 -44
  291. package/dist/elements/toolbar.d.ts +8 -25
  292. package/dist/elements/tooltip.d.ts +4 -30
  293. package/dist/elements/top-app-bar.d.ts +7 -23
  294. package/dist/index.d.ts +0 -11
  295. package/dist/package.json +1 -1
  296. package/dist/react/create.d.ts +0 -42
  297. package/dist/react/index.d.ts +0 -6
  298. package/dist/react/jsx.d.ts +0 -13
  299. package/dist/solid/create.d.ts +0 -48
  300. package/dist/solid/index.d.ts +0 -6
  301. package/dist/solid/jsx.d.ts +1 -10
  302. package/dist/ssr/index.d.ts +0 -49
  303. package/dist/ssr/solid.d.ts +0 -4
  304. package/dist/ssr/svelte.d.ts +0 -4
  305. package/dist/ssr/vue.d.ts +0 -4
  306. package/dist/styles/badge.css +1 -1
  307. package/dist/styles/base.css +1 -1
  308. package/dist/styles/bottom-app-bar.css +1 -1
  309. package/dist/styles/bottom-sheet.css +1 -1
  310. package/dist/styles/button-group.css +1 -1
  311. package/dist/styles/button.css +1 -1
  312. package/dist/styles/card.css +1 -1
  313. package/dist/styles/carousel.css +1 -1
  314. package/dist/styles/checkbox.css +1 -1
  315. package/dist/styles/chips.css +1 -1
  316. package/dist/styles/contrast.css +1 -1
  317. package/dist/styles/datepicker.css +1 -1
  318. package/dist/styles/dialog.css +1 -1
  319. package/dist/styles/divider.css +1 -1
  320. package/dist/styles/drawer.css +1 -1
  321. package/dist/styles/extended-fab.css +2 -2
  322. package/dist/styles/fab-menu.css +2 -2
  323. package/dist/styles/fab.css +2 -2
  324. package/dist/styles/icon-button.css +1 -1
  325. package/dist/styles/list.css +1 -1
  326. package/dist/styles/loading-indicator.css +1 -1
  327. package/dist/styles/menu.css +1 -1
  328. package/dist/styles/navigation-bar.css +1 -1
  329. package/dist/styles/navigation-rail.css +1 -1
  330. package/dist/styles/progress.css +1 -1
  331. package/dist/styles/radios.css +1 -1
  332. package/dist/styles/search.css +1 -1
  333. package/dist/styles/select.css +1 -1
  334. package/dist/styles/side-sheet.css +1 -1
  335. package/dist/styles/slider.css +1 -1
  336. package/dist/styles/snackbar.css +1 -1
  337. package/dist/styles/split-button.css +1 -1
  338. package/dist/styles/switch.css +1 -1
  339. package/dist/styles/tabs.css +1 -1
  340. package/dist/styles/text-field.css +1 -1
  341. package/dist/styles/timepicker.css +1 -1
  342. package/dist/styles/toolbar.css +1 -1
  343. package/dist/styles/tooltip.css +1 -1
  344. package/dist/styles/top-app-bar.css +1 -1
  345. package/dist/styles/typography.css +1 -1
  346. package/dist/styles/utilities.css +1 -1
  347. package/dist/styles.css +2 -2
  348. package/dist/svelte/Button.svelte +5 -4
  349. package/dist/svelte/runtime.d.ts +8 -62
  350. package/dist/themes/autumn-contrast.css +1 -1
  351. package/dist/themes/autumn.css +1 -1
  352. package/dist/themes/baseline-contrast.css +1 -1
  353. package/dist/themes/baseline.css +1 -1
  354. package/dist/themes/brownbeige-contrast.css +1 -1
  355. package/dist/themes/brownbeige.css +1 -1
  356. package/dist/themes/content-contrast.css +1 -1
  357. package/dist/themes/content.css +1 -1
  358. package/dist/themes/desert-contrast.css +1 -1
  359. package/dist/themes/desert.css +1 -1
  360. package/dist/themes/expressive-contrast.css +1 -1
  361. package/dist/themes/expressive.css +1 -1
  362. package/dist/themes/fidelity-contrast.css +1 -1
  363. package/dist/themes/fidelity.css +1 -1
  364. package/dist/themes/forest-contrast.css +1 -1
  365. package/dist/themes/forest.css +1 -1
  366. package/dist/themes/fruit-salad-contrast.css +1 -1
  367. package/dist/themes/fruit-salad.css +1 -1
  368. package/dist/themes/highcontrast-contrast.css +1 -1
  369. package/dist/themes/highcontrast.css +1 -1
  370. package/dist/themes/monochrome-contrast.css +1 -1
  371. package/dist/themes/monochrome.css +1 -1
  372. package/dist/themes/neutral-contrast.css +1 -1
  373. package/dist/themes/neutral.css +1 -1
  374. package/dist/themes/ocean-contrast.css +1 -1
  375. package/dist/themes/ocean.css +1 -1
  376. package/dist/themes/rainbow-contrast.css +1 -1
  377. package/dist/themes/rainbow.css +1 -1
  378. package/dist/themes/sageivory-contrast.css +1 -1
  379. package/dist/themes/sageivory.css +1 -1
  380. package/dist/themes/spring-contrast.css +1 -1
  381. package/dist/themes/spring.css +1 -1
  382. package/dist/themes/summer-contrast.css +1 -1
  383. package/dist/themes/summer.css +1 -1
  384. package/dist/themes/sunset-contrast.css +1 -1
  385. package/dist/themes/sunset.css +1 -1
  386. package/dist/themes/tealcaramel-contrast.css +1 -1
  387. package/dist/themes/tealcaramel.css +1 -1
  388. package/dist/themes/vibrant-contrast.css +1 -1
  389. package/dist/themes/vibrant.css +1 -1
  390. package/dist/vue/create.d.ts +15 -58
  391. package/dist/vue/index.d.ts +0 -6
  392. package/package.json +1 -1
  393. package/src/styles/abstract/_floating-placement.scss +12 -0
  394. package/src/styles/components/_extended-fab.scss +34 -8
  395. package/src/styles/components/_fab-menu.scss +58 -8
  396. package/src/styles/components/_fab.scss +34 -8
  397. package/src/styles/elements/_button.scss +27 -5
  398. package/src/styles/elements/_card.scss +14 -0
  399. package/src/styles/elements/_extended-fab.scss +2 -0
  400. package/src/styles/elements/_fab.scss +2 -0
  401. package/dist/components/badge/api.d.ts +0 -41
  402. package/dist/components/badge/config.d.ts +0 -631
  403. package/dist/components/badge/features.d.ts +0 -38
  404. package/dist/components/bottom-app-bar/config.d.ts +0 -16
  405. package/dist/components/bottom-sheet/api.d.ts +0 -44
  406. package/dist/components/bottom-sheet/config.d.ts +0 -547
  407. package/dist/components/bottom-sheet/features/drag.d.ts +0 -35
  408. package/dist/components/bottom-sheet/features/index.d.ts +0 -3
  409. package/dist/components/bottom-sheet/features/state.d.ts +0 -31
  410. package/dist/components/bottom-sheet/features/structure.d.ts +0 -26
  411. package/dist/components/button/api.d.ts +0 -68
  412. package/dist/components/button/config.d.ts +0 -594
  413. package/dist/components/button/features/progress.d.ts +0 -43
  414. package/dist/components/button/features/toggle.d.ts +0 -43
  415. package/dist/components/button-group/config.d.ts +0 -147
  416. package/dist/components/card/api.d.ts +0 -24
  417. package/dist/components/card/config.d.ts +0 -635
  418. package/dist/components/card/features.d.ts +0 -124
  419. package/dist/components/carousel/api.d.ts +0 -20
  420. package/dist/components/carousel/arrangement.d.ts +0 -23
  421. package/dist/components/carousel/config.d.ts +0 -540
  422. package/dist/components/carousel/features/index.d.ts +0 -2
  423. package/dist/components/carousel/features/scroll.d.ts +0 -20
  424. package/dist/components/carousel/features/slides.d.ts +0 -18
  425. package/dist/components/carousel/keylines.d.ts +0 -68
  426. package/dist/components/carousel/strategy.d.ts +0 -36
  427. package/dist/components/checkbox/api.d.ts +0 -7
  428. package/dist/components/checkbox/config.d.ts +0 -568
  429. package/dist/components/chips/api.d.ts +0 -62
  430. package/dist/components/chips/chip/chip.d.ts +0 -4
  431. package/dist/components/chips/chip/constants.d.ts +0 -38
  432. package/dist/components/chips/chip/index.d.ts +0 -1
  433. package/dist/components/chips/config.d.ts +0 -583
  434. package/dist/components/chips/features/chip-items.d.ts +0 -39
  435. package/dist/components/chips/features/container.d.ts +0 -75
  436. package/dist/components/chips/features/controller.d.ts +0 -61
  437. package/dist/components/chips/features/dom.d.ts +0 -24
  438. package/dist/components/chips/features/index.d.ts +0 -4
  439. package/dist/components/chips/schema.d.ts +0 -35
  440. package/dist/components/datepicker/api.d.ts +0 -7
  441. package/dist/components/datepicker/config.d.ts +0 -542
  442. package/dist/components/datepicker/render.d.ts +0 -3
  443. package/dist/components/datepicker/utils.d.ts +0 -84
  444. package/dist/components/dialog/api.d.ts +0 -66
  445. package/dist/components/dialog/config.d.ts +0 -583
  446. package/dist/components/dialog/features.d.ts +0 -42
  447. package/dist/components/divider/features.d.ts +0 -6
  448. package/dist/components/drawer/api.d.ts +0 -55
  449. package/dist/components/drawer/config.d.ts +0 -620
  450. package/dist/components/drawer/features/headline.d.ts +0 -27
  451. package/dist/components/drawer/features/index.d.ts +0 -3
  452. package/dist/components/drawer/features/items.d.ts +0 -32
  453. package/dist/components/drawer/features/state.d.ts +0 -22
  454. package/dist/components/extended-fab/api.d.ts +0 -96
  455. package/dist/components/extended-fab/config.d.ts +0 -600
  456. package/dist/components/fab/api.d.ts +0 -74
  457. package/dist/components/fab/config.d.ts +0 -596
  458. package/dist/components/fab-menu/config.d.ts +0 -11
  459. package/dist/components/fab-menu/stagger.d.ts +0 -10
  460. package/dist/components/icon-button/api.d.ts +0 -84
  461. package/dist/components/icon-button/config.d.ts +0 -624
  462. package/dist/components/icon-button/features/toggle.d.ts +0 -133
  463. package/dist/components/list/api.d.ts +0 -156
  464. package/dist/components/list/config.d.ts +0 -625
  465. package/dist/components/list/features/anatomy.d.ts +0 -6
  466. package/dist/components/list/features/index.d.ts +0 -2
  467. package/dist/components/list/features/renderer.d.ts +0 -8
  468. package/dist/components/list/features/selection.d.ts +0 -3
  469. package/dist/components/loading-indicator/api.d.ts +0 -14
  470. package/dist/components/loading-indicator/config.d.ts +0 -557
  471. package/dist/components/loading-indicator/features/motion.d.ts +0 -22
  472. package/dist/components/menu/api.d.ts +0 -63
  473. package/dist/components/menu/config.d.ts +0 -576
  474. package/dist/components/menu/features/controller.d.ts +0 -15
  475. package/dist/components/menu/features/index.d.ts +0 -5
  476. package/dist/components/menu/features/keyboard.d.ts +0 -23
  477. package/dist/components/menu/features/layer.d.ts +0 -15
  478. package/dist/components/menu/features/loader.d.ts +0 -35
  479. package/dist/components/menu/features/opener.d.ts +0 -16
  480. package/dist/components/menu/features/position.d.ts +0 -18
  481. package/dist/components/menu/features/registry.d.ts +0 -37
  482. package/dist/components/menu/features/submenu.d.ts +0 -28
  483. package/dist/components/menu/features/tasks.d.ts +0 -9
  484. package/dist/components/navigation-bar/config.d.ts +0 -2
  485. package/dist/components/navigation-rail/config.d.ts +0 -2
  486. package/dist/components/progress/api.d.ts +0 -81
  487. package/dist/components/progress/config.d.ts +0 -620
  488. package/dist/components/progress/features/canvas.d.ts +0 -60
  489. package/dist/components/progress/features/circular.d.ts +0 -19
  490. package/dist/components/progress/features/colors.d.ts +0 -17
  491. package/dist/components/progress/features/index.d.ts +0 -8
  492. package/dist/components/progress/features/linear.d.ts +0 -25
  493. package/dist/components/progress/features/motion.d.ts +0 -43
  494. package/dist/components/progress/features/resize-observer.d.ts +0 -5
  495. package/dist/components/progress/features/state.d.ts +0 -44
  496. package/dist/components/radios/api.d.ts +0 -37
  497. package/dist/components/radios/config.d.ts +0 -568
  498. package/dist/components/radios/radio.d.ts +0 -26
  499. package/dist/components/search/api.d.ts +0 -63
  500. package/dist/components/search/config.d.ts +0 -657
  501. package/dist/components/search/features/index.d.ts +0 -4
  502. package/dist/components/search/features/input.d.ts +0 -93
  503. package/dist/components/search/features/states.d.ts +0 -111
  504. package/dist/components/search/features/structure.d.ts +0 -16
  505. package/dist/components/search/features/suggestions.d.ts +0 -60
  506. package/dist/components/select/api.d.ts +0 -8
  507. package/dist/components/select/config.d.ts +0 -18
  508. package/dist/components/select/features.d.ts +0 -14
  509. package/dist/components/side-sheet/api.d.ts +0 -34
  510. package/dist/components/side-sheet/config.d.ts +0 -547
  511. package/dist/components/side-sheet/features/index.d.ts +0 -2
  512. package/dist/components/side-sheet/features/state.d.ts +0 -28
  513. package/dist/components/side-sheet/features/structure.d.ts +0 -21
  514. package/dist/components/slider/api.d.ts +0 -65
  515. package/dist/components/slider/config.d.ts +0 -605
  516. package/dist/components/slider/features/axis.d.ts +0 -42
  517. package/dist/components/slider/features/controller.d.ts +0 -528
  518. package/dist/components/slider/features/dom.d.ts +0 -22
  519. package/dist/components/slider/features/handlers.d.ts +0 -16
  520. package/dist/components/slider/features/index.d.ts +0 -5
  521. package/dist/components/slider/features/range.d.ts +0 -14
  522. package/dist/components/slider/features/states.d.ts +0 -76
  523. package/dist/components/slider/features/tracks.d.ts +0 -50
  524. package/dist/components/snackbar/api.d.ts +0 -7
  525. package/dist/components/snackbar/config.d.ts +0 -596
  526. package/dist/components/snackbar/features.d.ts +0 -26
  527. package/dist/components/snackbar/layer.d.ts +0 -23
  528. package/dist/components/snackbar/position.d.ts +0 -16
  529. package/dist/components/snackbar/queue.d.ts +0 -15
  530. package/dist/components/split-button/api.d.ts +0 -14
  531. package/dist/components/split-button/config.d.ts +0 -553
  532. package/dist/components/split-button/features/buttons.d.ts +0 -8
  533. package/dist/components/split-button/features/menu.d.ts +0 -10
  534. package/dist/components/switch/api.d.ts +0 -7
  535. package/dist/components/switch/config.d.ts +0 -558
  536. package/dist/components/switch/features.d.ts +0 -63
  537. package/dist/components/tabs/api.d.ts +0 -54
  538. package/dist/components/tabs/config.d.ts +0 -31
  539. package/dist/components/tabs/features.d.ts +0 -131
  540. package/dist/components/tabs/scroll-indicators.d.ts +0 -18
  541. package/dist/components/tabs/state.d.ts +0 -48
  542. package/dist/components/text-field/api.d.ts +0 -29
  543. package/dist/components/text-field/config.d.ts +0 -560
  544. package/dist/components/text-field/features/counter.d.ts +0 -29
  545. package/dist/components/text-field/features/density.d.ts +0 -28
  546. package/dist/components/text-field/features/error.d.ts +0 -55
  547. package/dist/components/text-field/features/field.d.ts +0 -37
  548. package/dist/components/text-field/features/index.d.ts +0 -20
  549. package/dist/components/text-field/features/leading-icon.d.ts +0 -68
  550. package/dist/components/text-field/features/placement.d.ts +0 -30
  551. package/dist/components/text-field/features/prefix-text.d.ts +0 -67
  552. package/dist/components/text-field/features/required.d.ts +0 -33
  553. package/dist/components/text-field/features/suffix-text.d.ts +0 -67
  554. package/dist/components/text-field/features/supporting-text.d.ts +0 -59
  555. package/dist/components/timepicker/api.d.ts +0 -26
  556. package/dist/components/timepicker/config.d.ts +0 -570
  557. package/dist/components/timepicker/dial.d.ts +0 -35
  558. package/dist/components/timepicker/render.d.ts +0 -9
  559. package/dist/components/timepicker/utils.d.ts +0 -55
  560. package/dist/components/toolbar/config.d.ts +0 -19
  561. package/dist/components/tooltip/api.d.ts +0 -18
  562. package/dist/components/tooltip/config.d.ts +0 -563
  563. package/dist/components/top-app-bar/config.d.ts +0 -16
  564. package/dist/core/compose/features/constants.d.ts +0 -8
  565. package/dist/core/dom/direction.d.ts +0 -16
  566. package/dist/core/dom/form-value.d.ts +0 -24
  567. package/dist/core/dom/utils.d.ts +0 -33
  568. package/dist/core/navigation/ripple.d.ts +0 -2
  569. package/dist/core/utils/attributes.d.ts +0 -29
  570. package/dist/core/utils/validate.d.ts +0 -73
  571. package/dist/core/utils/warn.d.ts +0 -16
  572. package/dist/elements/form-button.d.ts +0 -29
  573. package/dist/elements/lifecycle.d.ts +0 -4
  574. package/dist/elements/sheet.d.ts +0 -44
  575. package/dist/react/shadow.d.ts +0 -2
  576. package/dist/solid/shadow.d.ts +0 -3
  577. package/dist/vue/shadow.d.ts +0 -7
@@ -1,29 +1,4 @@
1
- /**
2
- * Menu component module
3
- *
4
- * The Menu component provides a Material Design 3 compliant dropdown menu
5
- * system with support for nested menus, keyboard navigation, and accessibility.
6
- *
7
- * @module components/menu
8
- * @category Components
9
- */
10
1
  export { default, default as createMenu } from "./menu.js";
11
2
  export type { MenuEvents } from "./types.js";
12
3
  export type { MenuConfig, MenuVariant, MenuComponent, MenuItem, MenuDivider, MenuGap, MenuContent, MenuEvent, MenuSelectEvent, MenuPosition } from "./types.js";
13
- /**
14
- * Constants for menu position values - use these instead of string literals
15
- * for better code completion and type safety.
16
- *
17
- * @example
18
- * import { createMenu, MENU_POSITION } from 'material';
19
- *
20
- * // Create a menu positioned at the bottom-right of its opener
21
- * const menu = createMenu({
22
- * opener: '#dropdown-button',
23
- * items: [...],
24
- * position: MENU_POSITION.BOTTOM_END
25
- * });
26
- *
27
- * @category Components
28
- */
29
4
  export { MENU_POSITION, MENU_DEFAULTS, MENU_INTERACTION_TYPES, MENU_ITEM_TYPES, MENU_EVENTS, MENU_CLASSES } from "./constants.js";
@@ -1,9 +1,6 @@
1
1
  import type { MenuComponent } from "./types.js";
2
- /** @internal */
3
2
  export declare const MENU: unique symbol;
4
- /** What an owner of an inner menu carries. @internal */
5
3
  export interface MenuOwner {
6
4
  [MENU]?: MenuComponent;
7
5
  }
8
- /** The menu inside a select or a split button, if it has one. @internal */
9
6
  export declare const innerMenu: (owner: object) => MenuComponent | undefined;
@@ -1,29 +1,3 @@
1
1
  import { MenuConfig, MenuComponent } from "./types.js";
2
- /**
3
- * Creates a new Menu component with the specified configuration.
4
- *
5
- * The Menu component implements the Material Design 3 menu specifications,
6
- * providing a flexible dropdown menu system with support for nested menus,
7
- * keyboard navigation, and ARIA accessibility.
8
- *
9
- * Menus are built using a functional composition pattern, applying various
10
- * features through the pipe function for a modular architecture.
11
- *
12
- * The menu element is not added to the DOM until it's opened, and it's removed
13
- * from the DOM when closed, following best practices for dropdown menus.
14
- *
15
- * @param {MenuConfig} config - Configuration options for the menu
16
- * This must include an opener element or selector, and an array of menu items.
17
- * See {@link MenuConfig} for all available options.
18
- *
19
- * @returns {MenuComponent} A fully configured menu component instance with
20
- * all requested features applied. The returned component has methods for
21
- * menu manipulation, event handling, and lifecycle management.
22
- *
23
- * @throws {Error} Throws an error if menu creation fails or if required
24
- * configuration (like opener) is missing.
25
- *
26
- * @category Components
27
- */
28
2
  declare const createMenu: (config: MenuConfig) => MenuComponent;
29
3
  export default createMenu;
@@ -1,511 +1,114 @@
1
1
  import type { EventCallback } from "../../core/state/emitter.js";
2
- /**
3
- * Menu position options
4
- * Controls where the menu will appear relative to its opener element
5
- *
6
- * @category Components
7
- */
8
2
  export declare const MENU_POSITION: {
9
- /** Places menu below the opener, aligned to left edge */
10
3
  readonly BOTTOM_START: "bottom-start";
11
- /** Places menu below the opener, centered */
12
4
  readonly BOTTOM: "bottom";
13
- /** Places menu below the opener, aligned to right edge */
14
5
  readonly BOTTOM_END: "bottom-end";
15
- /** Places menu above the opener, aligned to left edge */
16
6
  readonly TOP_START: "top-start";
17
- /** Places menu above the opener, centered */
18
7
  readonly TOP: "top";
19
- /** Places menu above the opener, aligned to right edge */
20
8
  readonly TOP_END: "top-end";
21
- /** Places menu to the right of the opener, aligned to top edge */
22
9
  readonly RIGHT_START: "right-start";
23
- /** Places menu to the right of the opener, centered */
24
10
  readonly RIGHT: "right";
25
- /** Places menu to the right of the opener, aligned to bottom edge */
26
11
  readonly RIGHT_END: "right-end";
27
- /** Places menu to the left of the opener, aligned to top edge */
28
12
  readonly LEFT_START: "left-start";
29
- /** Places menu to the left of the opener, centered */
30
13
  readonly LEFT: "left";
31
- /** Places menu to the left of the opener, aligned to bottom edge */
32
14
  readonly LEFT_END: "left-end";
33
15
  };
34
- /**
35
- * Position options for the menu
36
- *
37
- * @category Components
38
- */
39
16
  export type MenuPosition = (typeof MENU_POSITION)[keyof typeof MENU_POSITION];
40
- /**
41
- * Configuration interface for a menu item
42
- *
43
- * @category Components
44
- */
45
17
  export interface MenuItem<TData = unknown> {
46
- /**
47
- * Unique ID for the menu item
48
- * Required for accessibility and event handling
49
- */
50
18
  id: string;
51
- /**
52
- * Display text for the menu item
53
- */
54
19
  text: string;
55
- /**
56
- * Optional icon to display before the text.
57
- * Markup (HTML). Not sanitized by default: see Markup and sanitizing.
58
- * Accepts an HTML string (typically SVG).
59
- */
60
20
  icon?: string;
61
- /**
62
- * Optional keyboard shortcut hint to display
63
- * Shown at the end of the menu item
64
- */
65
21
  shortcut?: string;
66
- /**
67
- * A second line under the label, for a short explanation of the item
68
- * (vertical menus only)
69
- */
70
22
  supportingText?: string;
71
- /**
72
- * Whether the menu item is disabled
73
- * Disabled items cannot be clicked but remain visible
74
- */
75
23
  disabled?: boolean;
76
- /**
77
- * Whether this item has a submenu
78
- * If true, the item will show an indicator and can open a nested menu
79
- */
80
24
  hasSubmenu?: boolean;
81
- /**
82
- * Optional array of submenu items
83
- * Only used when hasSubmenu is true
84
- */
85
25
  submenu?: MenuItem<TData>[];
86
- /**
87
- * Additional data to associate with the menu item
88
- * This can be used for custom behavior in click handlers
89
- */
90
26
  data?: TData;
91
27
  }
92
- /**
93
- * Menu item type for dividers
94
- *
95
- * @category Components
96
- */
97
28
  export interface MenuDivider {
98
- /**
99
- * Type must be 'divider' to differentiate from regular menu items
100
- */
101
29
  type: "divider";
102
- /**
103
- * Optional ID for the divider (for accessibility)
104
- */
105
30
  id?: string;
106
31
  }
107
- /**
108
- * Menu item type for a gap between groups.
109
- *
110
- * The M3 expressive vertical menu separates groups two ways: a divider line,
111
- * or a gap. A gap splits the menu into separate surfaces, each with its own
112
- * rounded container, rather than drawing a line across one surface
113
- * (m3.material.io/components/menus, vertical menus).
114
- *
115
- * A standard menu is a single surface, so a gap there is simply space.
116
- *
117
- * @category Components
118
- */
119
32
  export interface MenuGap {
120
- /**
121
- * Type must be 'gap' to differentiate from regular menu items
122
- */
123
33
  type: "gap";
124
- /**
125
- * Optional ID for the gap (for accessibility)
126
- */
127
34
  id?: string;
128
35
  }
129
- /**
130
- * Combined type for menu content items (regular items, dividers or gaps)
131
- *
132
- * @category Components
133
- */
134
36
  export type MenuContent<TData = unknown> = MenuItem<TData> | MenuDivider | MenuGap;
135
- /**
136
- * Configuration interface for the Menu component
137
- *
138
- * @category Components
139
- */
140
- /** Menu variants */
141
37
  export type MenuVariant = "baseline" | "vertical";
142
- /** Colour mappings for the vertical menu */
143
38
  export type MenuColor = "standard" | "vibrant";
144
39
  export interface MenuConfig {
145
- /**
146
- * Element to which the menu will be openered
147
- * Can be an HTML element, a CSS selector string, or a component with an element property
148
- */
149
40
  opener: HTMLElement | string | {
150
41
  element: HTMLElement;
151
42
  };
152
- /**
153
- * The element the menu is placed against, when it is not the opener's: a
154
- * select's field, so its supporting text row never pushes the menu down
155
- * The opener still opens, closes and gets focus back.
156
- */
157
43
  positionTarget?: HTMLElement;
158
- /**
159
- * Array of menu items and dividers to display
160
- */
161
44
  items: MenuContent[];
162
- /**
163
- * Menu variant. `'vertical'` is the M3 expressive menu: a rounded
164
- * container holding items that sit apart and change shape as they are
165
- * hovered, focused, pressed or selected.
166
- * @default 'baseline'
167
- */
168
45
  variant?: MenuVariant;
169
- /**
170
- * Colour mapping for the vertical variant. `'vibrant'` is tertiary-based
171
- * and more prominent, so it should be used sparingly.
172
- */
173
46
  color?: MenuColor;
174
- /**
175
- * Position of the menu relative to the opener
176
- * @default 'bottom-start'
177
- */
178
47
  position?: MenuPosition;
179
- /**
180
- * Whether the menu should close when an item is clicked
181
- * @default true
182
- */
183
48
  closeOnSelect?: boolean;
184
- /**
185
- * Whether the menu should close when the user clicks outside
186
- * @default true
187
- */
188
49
  closeOnClickOutside?: boolean;
189
- /**
190
- * Whether the menu should close when the escape key is pressed
191
- * @default true
192
- */
193
50
  closeOnEscape?: boolean;
194
- /**
195
- * Whether the menu should close when the window is resized
196
- * @default false
197
- */
198
51
  closeOnResize?: boolean;
199
- /**
200
- * Whether submenus should open on hover
201
- * @default true
202
- */
203
52
  openSubmenuOnHover?: boolean;
204
- /**
205
- * Optional width for the menu (in CSS units)
206
- * If not provided, menu will size to its content
207
- */
208
53
  width?: string;
209
- /**
210
- * Optional maximum height for the menu (in CSS units)
211
- * If content exceeds this height, the menu will scroll
212
- */
213
54
  maxHeight?: string;
214
- /**
215
- * Optional offset from the opener (in pixels)
216
- * @default 0
217
- */
218
55
  offset?: number;
219
- /**
220
- * Whether the menu should automatically flip position to stay in viewport
221
- * @default true
222
- */
223
56
  autoFlip?: boolean;
224
- /**
225
- * Whether the menu is initially visible
226
- * @default false
227
- */
228
57
  visible?: boolean;
229
- /**
230
- * Container element to append the menu to
231
- * If not provided, menu will be appended to document.body
232
- * Use this when the menu needs to stay within a specific container (e.g., inside a dialog)
233
- */
234
58
  container?: HTMLElement | null;
235
- /**
236
- * `"top"` renders the menu in place, next to its opener, and shows it in the
237
- * browser's top layer as a `popover="manual"` element: above every z-index,
238
- * outside any clipping ancestor, and still inside the opener's shadow root,
239
- * so it keeps that root's styles. `container` is then not used. The menu
240
- * positions itself in viewport coordinates and keeps its own dismissal.
241
- * Submenus open in the top layer too.
242
- *
243
- * Where the browser has no popover support, the menu behaves as without it.
244
- * Unset, the menu is appended to `container` or `document.body`.
245
- */
246
59
  layer?: "top";
247
- /**
248
- * When true, the opener is used only for positioning.
249
- * No click, blur, or keyboard handlers are attached to the opener element.
250
- * The consumer is responsible for calling open() / close() manually.
251
- * @default false
252
- */
253
60
  manualOpen?: boolean;
254
- /**
255
- * Renders the menu as the listbox popup of a combobox (WAI-ARIA select-only
256
- * combobox): the list is `role="listbox"` and each item `role="option"` with
257
- * its own id, focus stays with the combobox, which owns the keyboard and
258
- * points at the active option with `aria-activedescendant`, and the opener
259
- * gets no ARIA from the menu. Pair it with `manualOpen`.
260
- * @default false
261
- */
262
61
  listbox?: boolean;
263
- /**
264
- * When true, renders a compact menu with smaller items and tighter spacing.
265
- * Useful in dense UIs like toolbars and action bars where the standard
266
- * 48px item height is too large.
267
- * @default false
268
- */
269
62
  dense?: boolean;
270
- /**
271
- * Additional CSS classes to add to the menu
272
- */
273
63
  class?: string;
274
- /**
275
- * Component prefix for CSS class names
276
- * @default 'mtrl'
277
- */
278
64
  prefix?: string;
279
- /**
280
- * Component name used in CSS class generation
281
- * @default 'menu'
282
- */
283
65
  componentName?: string;
284
- /**
285
- * Event handlers for the menu
286
- */
287
66
  on?: {
288
- /**
289
- * Called when the menu is opened
290
- */
291
67
  open?: (event: MenuEvent) => void;
292
- /**
293
- * Called when the menu is closed
294
- */
295
68
  close?: (event: MenuEvent) => void;
296
- /**
297
- * Called when a menu item is selected
298
- */
299
69
  select?: (event: MenuSelectEvent) => void;
300
70
  };
301
71
  }
302
- /**
303
- * What `open` and `close` carry. Neither can be cancelled: the menu is
304
- * already open, or closed, when its listener runs.
305
- *
306
- * @category Components
307
- */
308
72
  export interface MenuEvent {
309
- /** The menu component that triggered the event */
310
73
  menu: MenuComponent;
311
- /** Original DOM event if available */
312
74
  originalEvent?: Event;
313
75
  }
314
- /**
315
- * Menu selection event interface
316
- *
317
- * @category Components
318
- */
319
76
  export interface MenuSelectEvent<TData = unknown> extends MenuEvent {
320
- /** The selected menu item */
321
77
  item: MenuItem<TData>;
322
- /** ID of the selected menu item */
323
78
  itemId: string;
324
- /** The item's id again, as the `value` of the `<m-menu>` element's `select` */
325
79
  value: string;
326
- /** Data associated with the menu item (if any) */
327
80
  itemData?: TData;
328
- /** Keeps the menu open: a `closeOnSelect` menu does not close for this selection */
329
81
  preventDefault: () => void;
330
- /** Whether a listener has called `preventDefault()` */
331
82
  defaultPrevented: boolean;
332
83
  }
333
- /**
334
- * Menu component interface
335
- *
336
- * @category Components
337
- */
338
84
  export interface MenuComponent {
339
- /** The menu's root DOM element */
340
85
  element: HTMLElement;
341
- /**
342
- * Opens the menu.
343
- *
344
- * When it returns, `isOpen()` is true and `open` has been emitted. The
345
- * surface is placed and shown, and focus moves in, after that. On an open
346
- * menu it does nothing and emits nothing.
347
- *
348
- * From then on a click outside and Escape close it (`closeOnClickOutside`,
349
- * `closeOnEscape`). The event that opened it never does: the click or the
350
- * key press whose dispatch had begun when `open()` ran is ignored, and only
351
- * that one.
352
- * @param event - Optional event that triggered the open
353
- * @param interactionType - The type of interaction that triggered the open ('mouse' or 'keyboard')
354
- * @returns The menu component for chaining
355
- */
356
86
  open: (event?: Event, interactionType?: "mouse" | "keyboard") => MenuComponent;
357
- /**
358
- * Closes the menu.
359
- *
360
- * When it returns, `isOpen()` is false and `close` has been emitted. The
361
- * surface fades after that and then leaves the document. On a closed menu
362
- * it does nothing and emits nothing.
363
- *
364
- * `close()` then `open()` at once ends open, and `open()` then `close()`
365
- * ends closed: the later call wins, and what the earlier one still had to
366
- * do (showing the surface, or removing it) is dropped.
367
- * @param event - Optional event that triggered the close
368
- * @param restoreFocus - Whether focus returns to the opener (default true)
369
- * @param skipAnimation - Whether to close without the exit animation
370
- * @returns The menu component for chaining
371
- */
372
87
  close: (event?: Event, restoreFocus?: boolean, skipAnimation?: boolean) => MenuComponent;
373
- /**
374
- * Toggles the menu's open state
375
- * @param event - Optional event that triggered the toggle
376
- * @returns The menu component for chaining
377
- */
378
88
  toggle: (event?: Event) => MenuComponent;
379
- /**
380
- * Checks if the menu is currently open. It changes inside `open()` and
381
- * `close()`, before their events, and does not wait for the animation.
382
- * @returns True if the menu is open
383
- */
384
89
  isOpen: () => boolean;
385
- /**
386
- * Updates the menu items
387
- * @param items - New array of menu items and dividers
388
- * @returns The menu component for chaining
389
- */
390
90
  setItems: (items: MenuContent[]) => MenuComponent;
391
- /**
392
- * Gets the current menu items
393
- * @returns Array of current menu items and dividers
394
- */
395
91
  getItems: () => MenuContent[];
396
- /**
397
- * Updates the menu's opener element
398
- * @param opener - New opener element or selector
399
- * @returns The menu component for chaining
400
- */
401
92
  setOpener: (opener: HTMLElement | string) => MenuComponent;
402
- /**
403
- * Gets the current opener element
404
- * @returns Current opener element
405
- */
406
93
  getOpener: () => HTMLElement;
407
- /**
408
- * Updates the menu's position
409
- * @param position - New position value
410
- * @returns The menu component for chaining
411
- */
412
94
  setPosition: (position: MenuPosition) => MenuComponent;
413
- /**
414
- * Gets the current menu position
415
- * @returns Current position
416
- */
417
95
  getPosition: () => MenuPosition;
418
- /**
419
- * Sets the selected menu item
420
- * @param itemId - ID of the menu item to mark as selected
421
- * @returns The menu component for chaining
422
- */
423
96
  setSelected: (itemId: string | null) => MenuComponent;
424
- /**
425
- * Gets the currently selected menu item's ID
426
- * @returns ID of the selected menu item or null if none is selected
427
- */
428
97
  getSelected: () => string | null;
429
- /**
430
- * Adds an event listener to the menu
431
- * @param event - Event name ('open', 'close', 'select')
432
- * @param handler - Event handler function
433
- * @returns The menu component for chaining
434
- */
435
98
  on<T extends keyof MenuEvents>(event: T, handler: MenuEvents[T]): MenuComponent;
436
- /**
437
- * Adds an event listener for any event the menu emits, such as
438
- * 'submenu-opened', 'submenu-closed', 'all-submenus-closed' or 'menu-closing'
439
- * @param event - Event name
440
- * @param handler - Event handler function
441
- * @returns The menu component for chaining
442
- */
443
99
  on(event: string, handler: EventCallback): MenuComponent;
444
- /**
445
- * Removes an event listener from the menu
446
- * @param event - Event name
447
- * @param handler - Event handler function
448
- * @returns The menu component for chaining
449
- */
450
100
  off<T extends keyof MenuEvents>(event: T, handler: MenuEvents[T]): MenuComponent;
451
- /**
452
- * Removes an event listener for any event the menu emits
453
- * @param event - Event name
454
- * @param handler - Event handler function
455
- * @returns The menu component for chaining
456
- */
457
101
  off(event: string, handler: EventCallback): MenuComponent;
458
- /**
459
- * Destroys the menu component and cleans up resources
460
- */
461
102
  destroy: () => void;
462
103
  }
463
- /**
464
- * Menu events interface for type-checking
465
- *
466
- * @category Components
467
- * @internal
468
- */
469
104
  export interface MenuEvents {
470
105
  open: (event: MenuEvent) => void;
471
106
  close: (event: MenuEvent) => void;
472
107
  select: (event: MenuSelectEvent) => void;
473
108
  }
474
- /**
475
- * The menu as its own features see it, part-way through the pipe.
476
- *
477
- * One shared shape rather than five near-identical ones, because the features
478
- * enhance the same object in sequence. `element`, `getClass` and `lifecycle`
479
- * are required: withElement and withLifecycle run before any of them. The
480
- * rest are optional because they are installed by siblings, and which have
481
- * run depends on where in the pipe you are.
482
- *
483
- * @category Components
484
- * @internal
485
- */
486
- /**
487
- * What withController installs at `component.menu`.
488
- *
489
- * The commands return the component they were handed, which is the
490
- * pre-controller one; nothing reads it and the API layer discards it. Declared
491
- * void for the same reason as MenuOpenerApi -- so the feature's generic does
492
- * not appear in its own return type, which is what stopped the pipe binding C
493
- * at that stage.
494
- *
495
- * @category Components
496
- * @internal
497
- */
498
- /**
499
- * Menu state the keyboard handlers read.
500
- *
501
- * Declared here rather than in features/keyboard.ts so the host below can
502
- * name it: a host that types its manager methods needs their parameter types
503
- * in scope.
504
- */
505
109
  export interface KeyboardMenuState {
506
110
  items: MenuContent[];
507
111
  }
508
- /** Menu actions the keyboard handlers call. */
509
112
  export interface KeyboardActions {
510
113
  closeMenu: (event: Event, restoreFocus?: boolean) => void;
511
114
  findItemById: (id: string) => MenuItem | null;
@@ -525,14 +128,6 @@ export interface MenuControllerApi {
525
128
  getPosition: () => MenuPosition;
526
129
  setPosition: (position: MenuPosition) => void;
527
130
  }
528
- /**
529
- * A component that can act as a menu's opener: anything that exposes an
530
- * element through `element`, `getElement()` or `input`, and follows the menu's
531
- * open state when it can.
532
- *
533
- * @category Components
534
- * @internal
535
- */
536
131
  export interface OpenerComponent {
537
132
  element?: HTMLElement;
538
133
  getElement?: () => HTMLElement;
@@ -542,25 +137,7 @@ export interface OpenerComponent {
542
137
  focus?: () => void;
543
138
  blur?: () => void;
544
139
  }
545
- /**
546
- * What a menu opener can be given as: a selector, an element or a component
547
- *
548
- * @category Components
549
- * @internal
550
- */
551
140
  export type OpenerTarget = string | HTMLElement | OpenerComponent;
552
- /**
553
- * What withOpener installs at `component.opener`.
554
- *
555
- * The three setters return the component they were handed, which is the
556
- * pre-opener one and so not useful for chaining; nothing reads it, and the API
557
- * layer discards it. Declared `void` so the value is not promised, and so the
558
- * feature's generic does not appear in its own return type -- which is what
559
- * stopped the pipe binding C at that stage.
560
- *
561
- * @category Components
562
- * @internal
563
- */
564
141
  export interface MenuOpenerApi {
565
142
  setOpener: (opener: OpenerTarget) => void;
566
143
  getOpener: () => HTMLElement | null;
@@ -1,9 +1,2 @@
1
1
  import type { NavigationBarComponent, NavigationBarConfig } from "./types.js";
2
- /**
3
- * Creates an M3 Expressive navigation bar: three to five destinations along
4
- * the bottom of a compact or medium window (Compose `ShortNavigationBar`).
5
- * Import its styles separately with `material/styles/navigation-bar`. Links keep
6
- * native browser navigation; `onSelect` can `preventDefault()` for a router.
7
- * Don't show it together with a toolbar (m3.material.io).
8
- */
9
2
  export default function createNavigationBar(config?: NavigationBarConfig): NavigationBarComponent;
@@ -1,48 +1,26 @@
1
1
  import type { DestinationConfig } from "../../core/navigation/destinations.js";
2
- /** One destination of the bar: a link (`href`) or a button. */
3
2
  export type NavigationBarItemConfig = DestinationConfig;
4
- /** What `select` and `onSelect` carry: the destination chosen by click or keyboard. */
5
3
  export interface NavigationBarSelectEvent {
6
4
  id: string;
7
- /** The id, as `<m-navigation-bar>`'s `change` carries it */
8
5
  value: string;
9
6
  index: number;
10
7
  originalEvent: MouseEvent;
11
8
  }
12
9
  export interface NavigationBarEvents {
13
10
  select: NavigationBarSelectEvent;
14
- /** The bar was hidden (`hidden: true`) or shown again, by scroll or by `hide()`/`show()` */
15
11
  visibility: {
16
12
  hidden: boolean;
17
13
  };
18
14
  }
19
- /**
20
- * Where an item puts its icon. `'vertical'`: above the label, the compact bar.
21
- * `'horizontal'`: beside it, M3 Expressive's medium-width bar, with the items
22
- * centred. `'auto'` (the default) is vertical, and horizontal while the bar
23
- * itself is at least 600px wide: a CSS container query on the bar, so a bar in
24
- * a narrow pane stays vertical in a wide window. Compose leaves the choice to
25
- * the caller; MDC-Android puts the threshold at 600dp.
26
- */
27
15
  export type NavigationBarItemLayout = 'auto' | 'vertical' | 'horizontal';
28
16
  export interface NavigationBarConfig {
29
- /** Three to five destinations (M3) */
30
17
  items?: NavigationBarItemConfig[];
31
18
  itemLayout?: NavigationBarItemLayout;
32
- /**
33
- * Hides the bar while the page scrolls down and shows it when it scrolls
34
- * up, as the bottom app bar's `autoHide`. `true` follows the window; pass an
35
- * element to follow its scroll instead. Off by default: M3's guidelines
36
- * advise against hiding navigation while a screen reader is in use, which a
37
- * page can't detect. Focus inside the bar always shows it.
38
- */
39
19
  hideOnScroll?: boolean | {
40
20
  target?: HTMLElement | Window;
41
21
  };
42
- /** The landmark's name; default "Primary navigation" */
43
22
  ariaLabel?: string;
44
23
  ripple?: boolean;
45
- /** `select` listener registered at creation. */
46
24
  onSelect?: (event: NavigationBarEvents["select"]) => void;
47
25
  class?: string;
48
26
  prefix?: string;
@@ -55,14 +33,11 @@ export interface NavigationBarComponent {
55
33
  destroy: () => void;
56
34
  };
57
35
  getActive: () => string | null;
58
- /** The active destination's id, as getActive(): the value getter every component has */
59
36
  getValue: () => string | null;
60
- /** Marks a destination active, silently (no `select`); `null` clears it */
61
37
  setActive: (id: string | null) => NavigationBarComponent;
62
38
  getItems: () => NavigationBarItemConfig[];
63
39
  setItems: (items: NavigationBarItemConfig[]) => NavigationBarComponent;
64
40
  setBadge: (id: string, badge: NavigationBarItemConfig['badge'], label?: string) => NavigationBarComponent;
65
- /** Slides the bar out of view (without the slide under reduced motion) */
66
41
  hide: () => NavigationBarComponent;
67
42
  show: () => NavigationBarComponent;
68
43
  isHidden: () => boolean;