material 3.8.0 → 3.8.2

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 (462) hide show
  1. package/README.md +2 -2
  2. package/dist/components/badge/badge.d.ts +4 -0
  3. package/dist/components/badge/constants.d.ts +4 -0
  4. package/dist/components/badge/index.d.ts +1 -0
  5. package/dist/components/badge/types.d.ts +102 -0
  6. package/dist/components/bottom-app-bar/bottom-app-bar.d.ts +4 -0
  7. package/dist/components/bottom-app-bar/constants.d.ts +3 -0
  8. package/dist/components/bottom-app-bar/types.d.ts +42 -0
  9. package/dist/components/bottom-sheet/bottom-sheet.d.ts +4 -0
  10. package/dist/components/bottom-sheet/constants.d.ts +9 -0
  11. package/dist/components/bottom-sheet/types.d.ts +52 -0
  12. package/dist/components/button/button.d.ts +4 -0
  13. package/dist/components/button/constants.d.ts +20 -0
  14. package/dist/components/button/index.d.ts +1 -0
  15. package/dist/components/button/types.d.ts +190 -0
  16. package/dist/components/button-group/button-group.d.ts +4 -0
  17. package/dist/components/button-group/constants.d.ts +54 -0
  18. package/dist/components/button-group/index.d.ts +1 -0
  19. package/dist/components/button-group/types.d.ts +125 -0
  20. package/dist/components/card/card.d.ts +4 -0
  21. package/dist/components/card/constants.d.ts +11 -0
  22. package/dist/components/card/content.d.ts +16 -0
  23. package/dist/components/card/index.d.ts +2 -0
  24. package/dist/components/card/types.d.ts +123 -0
  25. package/dist/components/carousel/carousel.d.ts +1 -0
  26. package/dist/components/carousel/constants.d.ts +10 -0
  27. package/dist/components/carousel/features/scroll.js +1 -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/features/controller.js +4 -6
  37. package/dist/components/chips/types.d.ts +140 -0
  38. package/dist/components/datepicker/constants.d.ts +38 -0
  39. package/dist/components/datepicker/datepicker.d.ts +2 -0
  40. package/dist/components/datepicker/types.d.ts +139 -0
  41. package/dist/components/dialog/constants.d.ts +45 -0
  42. package/dist/components/dialog/dialog.d.ts +5 -0
  43. package/dist/components/dialog/index.d.ts +1 -0
  44. package/dist/components/dialog/types.d.ts +196 -0
  45. package/dist/components/divider/config.d.ts +30 -0
  46. package/dist/components/divider/constants.d.ts +15 -0
  47. package/dist/components/divider/divider.d.ts +4 -0
  48. package/dist/components/divider/types.d.ts +27 -0
  49. package/dist/components/drawer/constants.d.ts +39 -0
  50. package/dist/components/drawer/drawer.d.ts +4 -0
  51. package/dist/components/drawer/index.d.ts +1 -0
  52. package/dist/components/drawer/types.d.ts +109 -0
  53. package/dist/components/extended-fab/constants.d.ts +32 -0
  54. package/dist/components/extended-fab/extended-fab.d.ts +4 -0
  55. package/dist/components/extended-fab/types.d.ts +123 -0
  56. package/dist/components/fab/constants.d.ts +26 -0
  57. package/dist/components/fab/fab.d.ts +4 -0
  58. package/dist/components/fab/types.d.ts +100 -0
  59. package/dist/components/fab-menu/constants.d.ts +9 -0
  60. package/dist/components/fab-menu/fab-menu.d.ts +4 -0
  61. package/dist/components/fab-menu/types.d.ts +41 -0
  62. package/dist/components/icon-button/constants.d.ts +34 -0
  63. package/dist/components/icon-button/icon-button.d.ts +4 -0
  64. package/dist/components/icon-button/types.d.ts +157 -0
  65. package/dist/components/index.d.ts +1 -0
  66. package/dist/components/list/constants.d.ts +30 -0
  67. package/dist/components/list/index.d.ts +1 -0
  68. package/dist/components/list/list.d.ts +4 -0
  69. package/dist/components/list/types.d.ts +110 -0
  70. package/dist/components/loading-indicator/constants.d.ts +16 -0
  71. package/dist/components/loading-indicator/features/renderer.d.ts +13 -0
  72. package/dist/components/loading-indicator/loading-indicator.d.ts +4 -0
  73. package/dist/components/loading-indicator/types.d.ts +21 -0
  74. package/dist/components/menu/constants.d.ts +51 -0
  75. package/dist/components/menu/features/controller.js +1 -1
  76. package/dist/components/menu/features/keyboard.js +8 -3
  77. package/dist/components/menu/features/opener.js +2 -16
  78. package/dist/components/menu/index.d.ts +2 -0
  79. package/dist/components/menu/inner.d.ts +2 -0
  80. package/dist/components/menu/menu.d.ts +4 -0
  81. package/dist/components/menu/on-demand.d.ts +9 -0
  82. package/dist/components/menu/types.d.ts +185 -1
  83. package/dist/components/navigation-bar/navigation-bar.d.ts +1 -0
  84. package/dist/components/navigation-bar/types.d.ts +12 -0
  85. package/dist/components/navigation-rail/constants.d.ts +2 -0
  86. package/dist/components/navigation-rail/navigation-rail.d.ts +1 -0
  87. package/dist/components/navigation-rail/types.d.ts +18 -0
  88. package/dist/components/progress/constants.d.ts +37 -0
  89. package/dist/components/progress/progress.d.ts +4 -0
  90. package/dist/components/progress/types.d.ts +136 -0
  91. package/dist/components/radios/constants.d.ts +14 -0
  92. package/dist/components/radios/radios.d.ts +4 -0
  93. package/dist/components/radios/types.d.ts +89 -0
  94. package/dist/components/search/constants.d.ts +34 -0
  95. package/dist/components/search/search.d.ts +4 -0
  96. package/dist/components/search/types.d.ts +109 -0
  97. package/dist/components/select/constants.d.ts +46 -0
  98. package/dist/components/select/features.js +9 -1
  99. package/dist/components/select/index.d.ts +2 -0
  100. package/dist/components/select/select.d.ts +4 -0
  101. package/dist/components/select/types.d.ts +95 -0
  102. package/dist/components/side-sheet/constants.d.ts +9 -0
  103. package/dist/components/side-sheet/side-sheet.d.ts +4 -0
  104. package/dist/components/side-sheet/types.d.ts +51 -0
  105. package/dist/components/slider/constants.d.ts +62 -0
  106. package/dist/components/slider/slider.d.ts +4 -0
  107. package/dist/components/slider/types.d.ts +78 -0
  108. package/dist/components/snackbar/constants.d.ts +37 -0
  109. package/dist/components/snackbar/snackbar.d.ts +5 -0
  110. package/dist/components/snackbar/types.d.ts +67 -0
  111. package/dist/components/split-button/api.js +13 -3
  112. package/dist/components/split-button/constants.d.ts +13 -0
  113. package/dist/components/split-button/split-button.d.ts +4 -0
  114. package/dist/components/split-button/types.d.ts +50 -0
  115. package/dist/components/switch/constants.d.ts +34 -0
  116. package/dist/components/switch/switch.d.ts +4 -0
  117. package/dist/components/switch/types.d.ts +55 -0
  118. package/dist/components/tabs/constants.d.ts +49 -0
  119. package/dist/components/tabs/indicator.d.ts +22 -0
  120. package/dist/components/tabs/responsive.d.ts +17 -0
  121. package/dist/components/tabs/tab.d.ts +5 -0
  122. package/dist/components/tabs/tabs.d.ts +4 -0
  123. package/dist/components/tabs/types.d.ts +170 -0
  124. package/dist/components/tabs/utils.d.ts +24 -0
  125. package/dist/components/text-field/constants.d.ts +61 -0
  126. package/dist/components/text-field/features/trailing-icon.d.ts +25 -0
  127. package/dist/components/text-field/text-field.d.ts +4 -0
  128. package/dist/components/text-field/types.d.ts +84 -0
  129. package/dist/components/timepicker/constants.d.ts +61 -0
  130. package/dist/components/timepicker/types.d.ts +145 -0
  131. package/dist/components/toolbar/constants.d.ts +8 -0
  132. package/dist/components/toolbar/toolbar.d.ts +4 -0
  133. package/dist/components/toolbar/types.d.ts +75 -0
  134. package/dist/components/tooltip/constants.d.ts +43 -0
  135. package/dist/components/tooltip/tooltip.d.ts +4 -0
  136. package/dist/components/tooltip/types.d.ts +78 -0
  137. package/dist/components/top-app-bar/constants.d.ts +29 -0
  138. package/dist/components/top-app-bar/top-app-bar.d.ts +4 -0
  139. package/dist/components/top-app-bar/types.d.ts +55 -0
  140. package/dist/core/canvas/animation.d.ts +6 -0
  141. package/dist/core/canvas/drawing.d.ts +47 -0
  142. package/dist/core/canvas/index.d.ts +1 -0
  143. package/dist/core/canvas/resize.d.ts +7 -0
  144. package/dist/core/canvas/utils.d.ts +39 -0
  145. package/dist/core/compose/base.d.ts +9 -0
  146. package/dist/core/compose/cleanup.d.ts +2 -0
  147. package/dist/core/compose/component.d.ts +13 -0
  148. package/dist/core/compose/features/badge.d.ts +10 -0
  149. package/dist/core/compose/features/checkable.d.ts +13 -0
  150. package/dist/core/compose/features/debounce.d.ts +19 -0
  151. package/dist/core/compose/features/disabled.d.ts +11 -0
  152. package/dist/core/compose/features/events.d.ts +19 -0
  153. package/dist/core/compose/features/icon.d.ts +20 -0
  154. package/dist/core/compose/features/input.d.ts +31 -0
  155. package/dist/core/compose/features/lifecycle.d.ts +16 -0
  156. package/dist/core/compose/features/position.d.ts +13 -0
  157. package/dist/core/compose/features/ripple.d.ts +17 -0
  158. package/dist/core/compose/features/size.d.ts +5 -0
  159. package/dist/core/compose/features/style.d.ts +5 -0
  160. package/dist/core/compose/features/text.d.ts +20 -0
  161. package/dist/core/compose/features/textinput.d.ts +39 -0
  162. package/dist/core/compose/features/textlabel.d.ts +18 -0
  163. package/dist/core/compose/features/throttle.d.ts +18 -0
  164. package/dist/core/compose/features/track.d.ts +12 -0
  165. package/dist/core/compose/features/variant.d.ts +5 -0
  166. package/dist/core/compose/features/withEvents.d.ts +12 -0
  167. package/dist/core/compose/pipe.d.ts +12 -0
  168. package/dist/core/compose/utils/type-guards.d.ts +5 -0
  169. package/dist/core/config/component.d.ts +17 -0
  170. package/dist/core/config/global.d.ts +15 -0
  171. package/dist/core/config.d.ts +34 -0
  172. package/dist/core/dom/attributes.d.ts +25 -0
  173. package/dist/core/dom/classes.d.ts +24 -0
  174. package/dist/core/dom/create.d.ts +47 -0
  175. package/dist/core/dom/events.d.ts +26 -0
  176. package/dist/core/dom/focus.d.ts +11 -0
  177. package/dist/core/dom/html.d.ts +6 -0
  178. package/dist/core/dom/layer.d.ts +36 -0
  179. package/dist/core/dom/roving.d.ts +7 -0
  180. package/dist/core/navigation/destinations.d.ts +10 -0
  181. package/dist/core/shapes/cubic.d.ts +8 -0
  182. package/dist/core/shapes/material.d.ts +45 -0
  183. package/dist/core/shapes/polygon.d.ts +11 -0
  184. package/dist/core/state/emitter.d.ts +19 -0
  185. package/dist/core/state/events.d.ts +17 -0
  186. package/dist/core/state/store.d.ts +40 -0
  187. package/dist/core/theme/shape.d.ts +3 -0
  188. package/dist/core/theme/tokens.d.ts +6 -0
  189. package/dist/core/utils/background.d.ts +7 -0
  190. package/dist/core/utils/color.d.ts +5 -0
  191. package/dist/core/utils/index.d.ts +9 -0
  192. package/dist/core/utils/mobile.d.ts +10 -0
  193. package/dist/core/utils/object.d.ts +9 -0
  194. package/dist/core/utils/performance.d.ts +20 -0
  195. package/dist/core/utils/theme.d.ts +8 -0
  196. package/dist/core/utils/url.d.ts +3 -0
  197. package/dist/elements/adapter.d.ts +24 -0
  198. package/dist/elements/badge.d.ts +4 -0
  199. package/dist/elements/bottom-app-bar.d.ts +4 -0
  200. package/dist/elements/bottom-sheet.d.ts +6 -0
  201. package/dist/elements/button-group.d.ts +8 -0
  202. package/dist/elements/button.d.ts +5 -0
  203. package/dist/elements/card.d.ts +4 -0
  204. package/dist/elements/carousel.d.ts +5 -0
  205. package/dist/elements/checkbox.d.ts +4 -0
  206. package/dist/elements/chips.d.ts +9 -0
  207. package/dist/elements/css/button.css +1 -1
  208. package/dist/elements/css/button.js +1 -1
  209. package/dist/elements/css/carousel.css +1 -1
  210. package/dist/elements/css/carousel.js +1 -1
  211. package/dist/elements/css/chips.css +1 -1
  212. package/dist/elements/css/chips.js +1 -1
  213. package/dist/elements/css/dialog.css +1 -1
  214. package/dist/elements/css/dialog.js +1 -1
  215. package/dist/elements/css/drawer.css +1 -1
  216. package/dist/elements/css/drawer.js +1 -1
  217. package/dist/elements/css/fab-menu.css +1 -1
  218. package/dist/elements/css/fab-menu.js +1 -1
  219. package/dist/elements/css/hosts/badge.css +1 -1
  220. package/dist/elements/css/hosts/bottom-app-bar.css +1 -1
  221. package/dist/elements/css/hosts/bottom-sheet.css +1 -1
  222. package/dist/elements/css/hosts/button-group.css +1 -1
  223. package/dist/elements/css/hosts/button.css +1 -1
  224. package/dist/elements/css/hosts/card.css +1 -1
  225. package/dist/elements/css/hosts/carousel.css +1 -1
  226. package/dist/elements/css/hosts/checkbox.css +1 -1
  227. package/dist/elements/css/hosts/chips.css +1 -1
  228. package/dist/elements/css/hosts/datepicker.css +1 -1
  229. package/dist/elements/css/hosts/dialog.css +1 -1
  230. package/dist/elements/css/hosts/divider.css +1 -1
  231. package/dist/elements/css/hosts/drawer.css +1 -1
  232. package/dist/elements/css/hosts/extended-fab.css +1 -1
  233. package/dist/elements/css/hosts/fab-menu.css +1 -1
  234. package/dist/elements/css/hosts/fab.css +1 -1
  235. package/dist/elements/css/hosts/icon-button.css +1 -1
  236. package/dist/elements/css/hosts/list.css +1 -1
  237. package/dist/elements/css/hosts/loading-indicator.css +1 -1
  238. package/dist/elements/css/hosts/menu.css +1 -1
  239. package/dist/elements/css/hosts/navigation-bar.css +1 -1
  240. package/dist/elements/css/hosts/navigation-rail.css +1 -1
  241. package/dist/elements/css/hosts/progress.css +1 -1
  242. package/dist/elements/css/hosts/radios.css +1 -1
  243. package/dist/elements/css/hosts/search.css +1 -1
  244. package/dist/elements/css/hosts/select.css +1 -1
  245. package/dist/elements/css/hosts/side-sheet.css +1 -1
  246. package/dist/elements/css/hosts/slider.css +1 -1
  247. package/dist/elements/css/hosts/snackbar.css +1 -1
  248. package/dist/elements/css/hosts/split-button.css +1 -1
  249. package/dist/elements/css/hosts/switch.css +1 -1
  250. package/dist/elements/css/hosts/tabs.css +1 -1
  251. package/dist/elements/css/hosts/text-field.css +1 -1
  252. package/dist/elements/css/hosts/timepicker.css +1 -1
  253. package/dist/elements/css/hosts/toolbar.css +1 -1
  254. package/dist/elements/css/hosts/tooltip.css +1 -1
  255. package/dist/elements/css/hosts/top-app-bar.css +1 -1
  256. package/dist/elements/css/icon-button.css +1 -1
  257. package/dist/elements/css/icon-button.js +1 -1
  258. package/dist/elements/css/menu.css +1 -1
  259. package/dist/elements/css/menu.js +1 -1
  260. package/dist/elements/css/navigation-bar.css +1 -1
  261. package/dist/elements/css/navigation-bar.js +1 -1
  262. package/dist/elements/css/navigation-rail.css +1 -1
  263. package/dist/elements/css/navigation-rail.js +1 -1
  264. package/dist/elements/css/search.css +1 -1
  265. package/dist/elements/css/search.js +1 -1
  266. package/dist/elements/css/slider.css +1 -1
  267. package/dist/elements/css/slider.js +1 -1
  268. package/dist/elements/css/text-field.css +1 -1
  269. package/dist/elements/css/text-field.js +1 -1
  270. package/dist/elements/css/timepicker.css +1 -1
  271. package/dist/elements/css/timepicker.js +1 -1
  272. package/dist/elements/datepicker.d.ts +6 -0
  273. package/dist/elements/define.d.ts +48 -0
  274. package/dist/elements/define.js +1 -1
  275. package/dist/elements/dialog.d.ts +5 -0
  276. package/dist/elements/divider.d.ts +4 -0
  277. package/dist/elements/drawer.d.ts +6 -0
  278. package/dist/elements/extended-fab.d.ts +5 -0
  279. package/dist/elements/fab-menu.d.ts +10 -0
  280. package/dist/elements/fab.d.ts +5 -0
  281. package/dist/elements/icon-button.d.ts +6 -0
  282. package/dist/elements/index.d.ts +4 -0
  283. package/dist/elements/list.d.ts +8 -0
  284. package/dist/elements/loading-indicator.d.ts +4 -0
  285. package/dist/elements/menu.d.ts +12 -0
  286. package/dist/elements/navigation-bar.d.ts +6 -0
  287. package/dist/elements/navigation-rail.d.ts +10 -0
  288. package/dist/elements/preupgrade/badge.css +1 -1
  289. package/dist/elements/preupgrade/bottom-app-bar.css +1 -1
  290. package/dist/elements/preupgrade/bottom-sheet.css +1 -1
  291. package/dist/elements/preupgrade/button-group.css +1 -1
  292. package/dist/elements/preupgrade/button.css +1 -1
  293. package/dist/elements/preupgrade/card.css +1 -1
  294. package/dist/elements/preupgrade/carousel.css +1 -1
  295. package/dist/elements/preupgrade/checkbox.css +1 -1
  296. package/dist/elements/preupgrade/chips.css +1 -1
  297. package/dist/elements/preupgrade/datepicker.css +1 -1
  298. package/dist/elements/preupgrade/dialog.css +1 -1
  299. package/dist/elements/preupgrade/divider.css +1 -1
  300. package/dist/elements/preupgrade/drawer.css +1 -1
  301. package/dist/elements/preupgrade/extended-fab.css +1 -1
  302. package/dist/elements/preupgrade/fab-menu.css +1 -1
  303. package/dist/elements/preupgrade/fab.css +1 -1
  304. package/dist/elements/preupgrade/icon-button.css +1 -1
  305. package/dist/elements/preupgrade/list.css +1 -1
  306. package/dist/elements/preupgrade/loading-indicator.css +1 -1
  307. package/dist/elements/preupgrade/menu.css +1 -1
  308. package/dist/elements/preupgrade/navigation-bar.css +1 -1
  309. package/dist/elements/preupgrade/navigation-rail.css +1 -1
  310. package/dist/elements/preupgrade/progress.css +1 -1
  311. package/dist/elements/preupgrade/radios.css +1 -1
  312. package/dist/elements/preupgrade/search.css +1 -1
  313. package/dist/elements/preupgrade/select.css +1 -1
  314. package/dist/elements/preupgrade/side-sheet.css +1 -1
  315. package/dist/elements/preupgrade/slider.css +1 -1
  316. package/dist/elements/preupgrade/snackbar.css +1 -1
  317. package/dist/elements/preupgrade/split-button.css +1 -1
  318. package/dist/elements/preupgrade/switch.css +1 -1
  319. package/dist/elements/preupgrade/tabs.css +1 -1
  320. package/dist/elements/preupgrade/text-field.css +1 -1
  321. package/dist/elements/preupgrade/timepicker.css +1 -1
  322. package/dist/elements/preupgrade/toolbar.css +1 -1
  323. package/dist/elements/preupgrade/tooltip.css +1 -1
  324. package/dist/elements/preupgrade/top-app-bar.css +1 -1
  325. package/dist/elements/preupgrade.css +1 -1
  326. package/dist/elements/progress.d.ts +4 -0
  327. package/dist/elements/radios.d.ts +5 -0
  328. package/dist/elements/search.d.ts +15 -0
  329. package/dist/elements/select.d.ts +6 -0
  330. package/dist/elements/side-sheet.d.ts +5 -0
  331. package/dist/elements/slider.d.ts +7 -0
  332. package/dist/elements/snackbar.d.ts +4 -0
  333. package/dist/elements/split-button.d.ts +8 -0
  334. package/dist/elements/styles.d.ts +11 -0
  335. package/dist/elements/switch.d.ts +5 -0
  336. package/dist/elements/tabs.d.ts +6 -0
  337. package/dist/elements/text-field.d.ts +9 -0
  338. package/dist/elements/timepicker.d.ts +9 -0
  339. package/dist/elements/toolbar.d.ts +4 -0
  340. package/dist/elements/tooltip.d.ts +4 -0
  341. package/dist/elements/top-app-bar.d.ts +4 -0
  342. package/dist/index.d.ts +1 -0
  343. package/dist/react/create.d.ts +15 -0
  344. package/dist/react/index.d.ts +1 -0
  345. package/dist/react/jsx.d.ts +3 -0
  346. package/dist/solid/create.d.ts +16 -0
  347. package/dist/solid/index.d.ts +1 -0
  348. package/dist/solid/jsx.d.ts +4 -0
  349. package/dist/ssr/index.d.ts +3 -0
  350. package/dist/ssr/solid.d.ts +1 -0
  351. package/dist/ssr/svelte.d.ts +1 -0
  352. package/dist/ssr/vue.d.ts +1 -0
  353. package/dist/styles/badge.css +1 -1
  354. package/dist/styles/base-lite.css +2 -2
  355. package/dist/styles/base.css +2 -2
  356. package/dist/styles/bottom-app-bar.css +1 -1
  357. package/dist/styles/bottom-sheet.css +1 -1
  358. package/dist/styles/button-group.css +1 -1
  359. package/dist/styles/button.css +2 -2
  360. package/dist/styles/card.css +1 -1
  361. package/dist/styles/carousel.css +2 -2
  362. package/dist/styles/checkbox.css +1 -1
  363. package/dist/styles/chips.css +2 -2
  364. package/dist/styles/contrast.css +1 -1
  365. package/dist/styles/datepicker.css +1 -1
  366. package/dist/styles/dialog.css +2 -2
  367. package/dist/styles/divider.css +1 -1
  368. package/dist/styles/drawer.css +2 -2
  369. package/dist/styles/extended-fab.css +1 -1
  370. package/dist/styles/fab-menu.css +2 -2
  371. package/dist/styles/fab.css +1 -1
  372. package/dist/styles/icon-button.css +2 -2
  373. package/dist/styles/list.css +1 -1
  374. package/dist/styles/loading-indicator.css +1 -1
  375. package/dist/styles/menu.css +2 -2
  376. package/dist/styles/navigation-bar.css +2 -2
  377. package/dist/styles/navigation-rail.css +2 -2
  378. package/dist/styles/progress.css +1 -1
  379. package/dist/styles/radios.css +1 -1
  380. package/dist/styles/search.css +2 -2
  381. package/dist/styles/select.css +1 -1
  382. package/dist/styles/side-sheet.css +1 -1
  383. package/dist/styles/slider.css +2 -2
  384. package/dist/styles/snackbar.css +1 -1
  385. package/dist/styles/split-button.css +1 -1
  386. package/dist/styles/switch.css +1 -1
  387. package/dist/styles/tabs.css +1 -1
  388. package/dist/styles/text-field.css +2 -2
  389. package/dist/styles/timepicker.css +2 -2
  390. package/dist/styles/toolbar.css +1 -1
  391. package/dist/styles/tooltip.css +1 -1
  392. package/dist/styles/top-app-bar.css +1 -1
  393. package/dist/styles/typography.css +1 -1
  394. package/dist/styles/utilities.css +1 -1
  395. package/dist/styles.css +2 -2
  396. package/dist/svelte/runtime.d.ts +21 -0
  397. package/dist/theme/image.d.ts +2 -0
  398. package/dist/theme/index.d.ts +20 -0
  399. package/dist/theme/variants.d.ts +6 -0
  400. package/dist/theme/vendor/dynamiccolor/color_spec_2021.d.ts +1 -0
  401. package/dist/theme/vendor/dynamiccolor/dynamic_color.d.ts +39 -0
  402. package/dist/theme/vendor/dynamiccolor/dynamic_scheme.d.ts +13 -0
  403. package/dist/theme/vendor/dynamiccolor/material_dynamic_colors.d.ts +1 -0
  404. package/dist/theme/vendor/hct/hct.d.ts +9 -0
  405. package/dist/themes/autumn-contrast.css +1 -1
  406. package/dist/themes/autumn.css +1 -1
  407. package/dist/themes/baseline-contrast.css +1 -1
  408. package/dist/themes/baseline.css +1 -1
  409. package/dist/themes/brownbeige-contrast.css +1 -1
  410. package/dist/themes/brownbeige.css +1 -1
  411. package/dist/themes/content-contrast.css +1 -1
  412. package/dist/themes/content.css +1 -1
  413. package/dist/themes/desert-contrast.css +1 -1
  414. package/dist/themes/desert.css +1 -1
  415. package/dist/themes/expressive-contrast.css +1 -1
  416. package/dist/themes/expressive.css +1 -1
  417. package/dist/themes/fidelity-contrast.css +1 -1
  418. package/dist/themes/fidelity.css +1 -1
  419. package/dist/themes/forest-contrast.css +1 -1
  420. package/dist/themes/forest.css +1 -1
  421. package/dist/themes/fruit-salad-contrast.css +1 -1
  422. package/dist/themes/fruit-salad.css +1 -1
  423. package/dist/themes/highcontrast-contrast.css +1 -1
  424. package/dist/themes/highcontrast.css +1 -1
  425. package/dist/themes/monochrome-contrast.css +1 -1
  426. package/dist/themes/monochrome.css +1 -1
  427. package/dist/themes/neutral-contrast.css +1 -1
  428. package/dist/themes/neutral.css +1 -1
  429. package/dist/themes/ocean-contrast.css +1 -1
  430. package/dist/themes/ocean.css +1 -1
  431. package/dist/themes/rainbow-contrast.css +1 -1
  432. package/dist/themes/rainbow.css +1 -1
  433. package/dist/themes/sageivory-contrast.css +1 -1
  434. package/dist/themes/sageivory.css +1 -1
  435. package/dist/themes/spring-contrast.css +1 -1
  436. package/dist/themes/spring.css +1 -1
  437. package/dist/themes/summer-contrast.css +1 -1
  438. package/dist/themes/summer.css +1 -1
  439. package/dist/themes/sunset-contrast.css +1 -1
  440. package/dist/themes/sunset.css +1 -1
  441. package/dist/themes/tealcaramel-contrast.css +1 -1
  442. package/dist/themes/tealcaramel.css +1 -1
  443. package/dist/themes/vibrant-contrast.css +1 -1
  444. package/dist/themes/vibrant.css +1 -1
  445. package/dist/vue/create.d.ts +18 -0
  446. package/dist/vue/index.d.ts +1 -0
  447. package/package.json +1 -1
  448. package/src/styles/abstract/_mixins.scss +1 -1
  449. package/src/styles/components/_button.scss +1 -0
  450. package/src/styles/components/_carousel.scss +18 -4
  451. package/src/styles/components/_chips.scss +3 -2
  452. package/src/styles/components/_dialog.scss +1 -1
  453. package/src/styles/components/_drawer.scss +6 -3
  454. package/src/styles/components/_fab-menu.scss +1 -1
  455. package/src/styles/components/_icon-button.scss +2 -1
  456. package/src/styles/components/_menu.scss +14 -1
  457. package/src/styles/components/_navigation-bar.scss +6 -1
  458. package/src/styles/components/_navigation-rail.scss +5 -0
  459. package/src/styles/components/_search.scss +13 -0
  460. package/src/styles/components/_slider.scss +16 -39
  461. package/src/styles/components/_text-field.scss +9 -0
  462. package/src/styles/components/_timepicker.scss +1 -1
@@ -1,39 +1,69 @@
1
+ /** Default list item configuration */
1
2
  export declare const LIST_DEFAULTS: {
3
+ /** Default collection name for API-connected lists */
2
4
  readonly COLLECTION: "items";
5
+ /** Default API base URL */
3
6
  readonly BASE_URL: "http://localhost:4000/api";
7
+ /** Default number of items per page */
4
8
  readonly PAGE_SIZE: 20;
9
+ /** Default number of extra items to render above/below viewport */
5
10
  readonly RENDER_BUFFER_SIZE: 5;
11
+ /** Default item height in pixels */
6
12
  readonly ITEM_HEIGHT: 56;
7
13
  };
14
+ /** List variants (m3.material.io lists) */
8
15
  export declare const LIST_VARIANTS: {
9
16
  readonly STANDARD: "standard";
10
17
  readonly SEGMENTED: "segmented";
11
18
  };
19
+ /** List types for rendering and behavior */
12
20
  export declare const LIST_TYPES: {
21
+ /** Standard list with no selection */
13
22
  readonly DEFAULT: "default";
23
+ /** List with single-select behavior */
14
24
  readonly SINGLE_SELECT: "single-select";
25
+ /** List with multi-select behavior */
15
26
  readonly MULTI_SELECT: "multi-select";
16
27
  };
28
+ /** List selection modes */
17
29
  export declare const LIST_SELECTION_MODES: {
30
+ /** No selection allowed */
18
31
  readonly NONE: "none";
32
+ /** Only one item can be selected at a time */
19
33
  readonly SINGLE: "single";
34
+ /** Multiple items can be selected */
20
35
  readonly MULTIPLE: "multiple";
21
36
  };
37
+ /** List events */
22
38
  export declare const LIST_EVENTS: {
39
+ /** Fired when an item is selected */
23
40
  readonly SELECT: "select";
41
+ /** Fired when items are loaded */
24
42
  readonly LOAD: "load";
43
+ /** Fired when the list is scrolled */
25
44
  readonly SCROLL: "scroll";
26
45
  };
46
+ /** Scroll position options for scrollToItem method */
27
47
  export declare const LIST_SCROLL_POSITIONS: {
48
+ /** Align item at the top of viewport */
28
49
  readonly START: "start";
50
+ /** Center item in the viewport */
29
51
  readonly CENTER: "center";
52
+ /** Align item at the bottom of viewport */
30
53
  readonly END: "end";
31
54
  };
55
+ /** CSS classes used in the list component */
32
56
  export declare const LIST_CLASSES: {
57
+ /** Container element */
33
58
  readonly CONTAINER: "list";
59
+ /** List element */
34
60
  readonly LIST: "list";
61
+ /** List item */
35
62
  readonly ITEM: "list__item";
63
+ /** Selected list item */
36
64
  readonly SELECTED: "list__item--selected";
65
+ /** Loading indicator */
37
66
  readonly LOADING: "list--loading";
67
+ /** Empty state */
38
68
  readonly EMPTY: "list--empty";
39
69
  };
@@ -1,3 +1,4 @@
1
+ /** Material list anatomy for static data. */
1
2
  export { default, default as createList } from "./list.js";
2
3
  export { LIST_DEFAULTS, LIST_VARIANTS, LIST_TYPES, LIST_SELECTION_MODES, LIST_EVENTS, LIST_SCROLL_POSITIONS, LIST_CLASSES, } from "./constants.js";
3
4
  export type { ListConfig, ListVariant, ListItem, ListSlot, ListComponent, SelectEvent, LoadEvent, } from "./types.js";
@@ -1,3 +1,7 @@
1
1
  import type { ListComponent, ListConfig, ListItem } from "./types.js";
2
+ /**
3
+ * Creates a new List component The List component provides a simple way to render static arrays of data with Material item anatomy and built-in selection capabilities.
4
+ * @param config
5
+ */
2
6
  declare const createList: (config?: Partial<ListConfig<ListItem>>) => ListComponent<ListItem>;
3
7
  export default createList;
@@ -1,37 +1,78 @@
1
1
  import type { ForwardedEventPayload } from "../../core/dom/index.js";
2
+ /** List variant types following Material Design 3 guidelines. */
2
3
  export type ListVariant = 'standard' | 'segmented';
4
+ /** Configuration for the List component */
3
5
  export interface ListConfig<T = unknown> {
6
+ /**
7
+ * The list's visual style.
8
+ * @default 'standard'
9
+ */
4
10
  variant?: ListVariant;
11
+ /** Static array of items to display */
5
12
  items: T[];
13
+ /**
14
+ * Function to render an item
15
+ * @param item
16
+ * @param index
17
+ */
6
18
  renderItem?: (item: T, index: number) => HTMLElement;
19
+ /**
20
+ * Whether to track item selection When true, clicked items will receive a selected class.
21
+ * @default true
22
+ */
7
23
  trackSelection?: boolean;
24
+ /**
25
+ * Whether to allow multiple item selection
26
+ * @default false
27
+ */
8
28
  multiSelect?: boolean;
29
+ /** Initial selection state (array of item IDs) */
9
30
  initialSelection?: (string | number)[];
31
+ /** ARIA label for accessibility */
10
32
  ariaLabel?: string;
33
+ /** Additional CSS classes */
11
34
  class?: string;
35
+ /**
36
+ * Default animation behavior for scroll operations
37
+ * @default false
38
+ */
12
39
  animate?: boolean;
40
+ /**
41
+ * Component name used in CSS class generation
42
+ * @default 'list'
43
+ */
13
44
  componentName?: string;
14
45
  }
46
+ /** What the list reads off an item. */
47
+ /** Slot HTML uses the shared safe HTML sink; HTMLElement content is moved, not cloned. */
15
48
  export interface ListSlot {
16
49
  type: "icon" | "avatar" | "image" | "video" | "text" | "control" | "custom";
50
+ /** For `icon` and `avatar`, a string is markup. */
17
51
  content: string | HTMLElement;
18
52
  }
19
53
  export interface ListItem {
54
+ /** Structural entries are rendered but never selectable. */
20
55
  kind?: "item" | "divider" | "subheader";
56
+ /** Insets a divider to the text column (72px from the leading edge). */
21
57
  inset?: boolean;
58
+ /** One headline line plus optional overline/supporting lines. */
22
59
  lines?: 1 | 2 | 3;
23
60
  overline?: string;
24
61
  supportingText?: string;
25
62
  leading?: ListSlot;
63
+ /** The slot at the row's end: text, an icon, or a control of the app's (a checkbox, a radio, a switch). */
26
64
  trailing?: ListSlot;
65
+ /** Blocks user activation; programmatic selection is still allowed. */
27
66
  disabled?: boolean;
28
67
  id?: string | number;
29
68
  text?: string;
30
69
  title?: string;
31
70
  headline?: string;
32
71
  name?: string;
72
+ /** Selected at creation, which withSelection seeds its set from */
33
73
  selected?: boolean;
34
74
  }
75
+ /** What withRenderer installs at `component.list`. */
35
76
  export interface ListRenderer<T = ListItem> {
36
77
  getRows: () => ListRow<T>[];
37
78
  onRender: (handler: () => void) => () => void;
@@ -78,7 +119,9 @@ export interface ListRow<T = ListItem> {
78
119
  element: HTMLElement;
79
120
  action?: HTMLButtonElement;
80
121
  }
122
+ /** Where a scrolled-to item lands in the viewport */
81
123
  export type ScrollPosition = "start" | "center" | "end";
124
+ /** What withSelection installs. */
82
125
  export interface ListSelection<T = ListItem> {
83
126
  getSelectedItems: () => T[];
84
127
  getSelectedItemIds: () => string[];
@@ -88,6 +131,7 @@ export interface ListSelection<T = ListItem> {
88
131
  clearSelection(): this;
89
132
  setSelection(itemIds: (string | number)[]): this;
90
133
  }
134
+ /** What a list feature needs from the component it is handed. */
91
135
  export interface ListFeatureHost {
92
136
  element: HTMLElement;
93
137
  getClass: (name: string) => string;
@@ -101,44 +145,110 @@ export interface ListFeatureHost {
101
145
  };
102
146
  list?: ListRenderer;
103
147
  }
148
+ /** Selection event data */
104
149
  export interface SelectEvent<T = unknown> {
150
+ /** Selected item data */
105
151
  item: T;
152
+ /** The item's id as a string, the `value` of the `<m-list>` element's */
106
153
  value: string;
154
+ /** DOM element for the selected item */
107
155
  element: HTMLElement;
156
+ /** Original DOM event */
108
157
  originalEvent: Event;
158
+ /** Component instance */
109
159
  component: ListComponent<T>;
160
+ /** Prevent default behavior */
110
161
  preventDefault: () => void;
162
+ /** Whether default was prevented */
111
163
  defaultPrevented: boolean;
112
164
  }
165
+ /** Load event data */
113
166
  export interface LoadEvent<T = unknown> {
167
+ /** Loaded items */
114
168
  items: T[];
169
+ /** Whether the list is currently loading */
115
170
  loading: boolean;
171
+ /** Whether there are more items to load */
116
172
  hasNext: boolean;
173
+ /** Whether there are previous items */
117
174
  hasPrev: boolean;
175
+ /** Component instance */
118
176
  component: ListComponent<T>;
177
+ /** Prevent default behavior */
119
178
  preventDefault?: () => void;
179
+ /** Whether default was prevented */
120
180
  defaultPrevented?: boolean;
121
181
  }
182
+ /** List component interface */
122
183
  export interface ListComponent<T = unknown> {
184
+ /** Component's root DOM element */
123
185
  element: HTMLElement;
186
+ /** Refreshes the list display */
124
187
  refresh: () => Promise<ListComponent<T>>;
188
+ /** Gets all items in the list */
125
189
  getAllItems: () => T[];
190
+ /** Gets all visible items (same as getAllItems for rendered lists) */
126
191
  getVisibleItems: () => T[];
192
+ /**
193
+ * Scrolls to a specific item by ID
194
+ * @param itemId
195
+ * @param position
196
+ * @param animate
197
+ */
127
198
  scrollToItem: (itemId: string | number, position?: "start" | "center" | "end", animate?: boolean) => ListComponent<T>;
199
+ /**
200
+ * Scroll to a specific index in the list
201
+ * @param index
202
+ * @param position
203
+ * @param animate
204
+ */
128
205
  scrollToIndex: (index: number, position?: "start" | "center" | "end", animate?: boolean) => Promise<ListComponent<T>>;
206
+ /** Checks if the list is currently loading (always false for rendered lists) */
129
207
  isLoading: () => boolean;
208
+ /** Checks if the list has more items to load (always false for rendered lists) */
130
209
  hasNextPage: () => boolean;
210
+ /** Gets the currently selected items */
131
211
  getSelectedItems: () => T[];
212
+ /** Gets the IDs of currently selected items */
132
213
  getSelectedItemIds: () => string[];
214
+ /**
215
+ * Checks if an item is selected
216
+ * @param itemId
217
+ */
133
218
  isItemSelected: (itemId: string | number) => boolean;
219
+ /**
220
+ * Selects an item
221
+ * @param itemId
222
+ */
134
223
  selectItem: (itemId: string | number) => ListComponent<T>;
224
+ /**
225
+ * Deselects an item
226
+ * @param itemId
227
+ */
135
228
  deselectItem: (itemId: string | number) => ListComponent<T>;
229
+ /** Clears all selections */
136
230
  clearSelection: () => ListComponent<T>;
231
+ /**
232
+ * Sets the selection to the specified item IDs
233
+ * @param itemIds
234
+ */
137
235
  setSelection: (itemIds: (string | number)[]) => ListComponent<T>;
236
+ /**
237
+ * Adds an event listener to the list
238
+ * @param event
239
+ * @param handler
240
+ */
138
241
  on: <K extends keyof ListEvents<T>>(event: K, handler: ListEvents<T>[K]) => ListComponent<T>;
242
+ /**
243
+ * Removes an event listener from the list
244
+ * @param event
245
+ * @param handler
246
+ */
139
247
  off: <K extends keyof ListEvents<T>>(event: K, handler: ListEvents<T>[K]) => ListComponent<T>;
248
+ /** Destroys the component and cleans up resources */
140
249
  destroy: () => void;
141
250
  }
251
+ /** Event handlers for List */
142
252
  export interface ListEvents<T = unknown> {
143
253
  select: (event: SelectEvent<T>) => void;
144
254
  load: (event: LoadEvent<T>) => void;
@@ -1,25 +1,41 @@
1
1
  import type { MaterialShapeName } from "../../core/shapes/index.js";
2
+ /** Loading indicator measurements and timing (Compose Material 3 */
2
3
  export declare const LOADING_INDICATOR_DEFAULTS: {
4
+ /** Container width and height */
3
5
  readonly SIZE: 48;
6
+ /** The active indicator's diameter within a 48dp container */
4
7
  readonly INDICATOR_SIZE: 38;
8
+ /** Smallest size the guidelines allow */
5
9
  readonly MIN_SIZE: 24;
10
+ /** Largest size the guidelines allow */
6
11
  readonly MAX_SIZE: 240;
12
+ /** Milliseconds between two shape morphs */
7
13
  readonly MORPH_INTERVAL: 650;
14
+ /** Milliseconds for one full turn of the slow global rotation */
8
15
  readonly ROTATION_DURATION: 4666;
16
+ /** Degrees each morph turns the shape */
9
17
  readonly MORPH_ROTATION: 90;
18
+ /** Accessible name when none is given */
10
19
  readonly LABEL: "Loading";
20
+ /** Outline samples per shape */
11
21
  readonly SAMPLES: 360;
12
22
  };
23
+ /** The morph spring (Compose: `spring(dampingRatio = 0.6f, stiffness = 200f, */
13
24
  export declare const LOADING_INDICATOR_SPRING: {
14
25
  readonly DAMPING: 0.6;
15
26
  readonly STIFFNESS: 200;
16
27
  readonly THRESHOLD: 0.1;
17
28
  };
29
+ /** The shapes the indeterminate indicator morphs through, in order */
18
30
  export declare const LOADING_INDICATOR_SHAPES: readonly MaterialShapeName[];
31
+ /** The shapes the determinate indicator morphs between as the value grows */
19
32
  export declare const LOADING_INDICATOR_DETERMINATE_SHAPES: readonly MaterialShapeName[];
33
+ /** CSS class names used by the loading indicator, without the prefix */
20
34
  export declare const LOADING_INDICATOR_CLASSES: {
21
35
  readonly ROOT: "loading-indicator";
36
+ /** Drawn on a primary-container circle */
22
37
  readonly CONTAINED: "loading-indicator--contained";
38
+ /** Shows a value rather than looping */
23
39
  readonly DETERMINATE: "loading-indicator--determinate";
24
40
  readonly CANVAS: "loading-indicator__canvas";
25
41
  };
@@ -1,15 +1,28 @@
1
1
  import { RadialProfile, MaterialShapeName } from "../../../core/shapes/index.js";
2
2
  import { BaseComponent, LoadingIndicatorConfig } from "../types.js";
3
+ /** A frame: which morph, how far along it, and the rotation in degrees */
3
4
  export interface Frame {
5
+ /** Index of the shape the morph starts from */
4
6
  index: number;
7
+ /** 0 at the shape, 1 at the next; may overshoot */
5
8
  progress: number;
9
+ /** Clockwise rotation in degrees */
6
10
  rotation: number;
7
11
  }
8
12
  export interface Renderer {
13
+ /** Draws one frame with the given shape sequence */
9
14
  draw: (shapes: readonly RadialProfile[], frame: Frame) => void;
15
+ /** Resizes the canvas to the element's size */
10
16
  resize: (size: number) => void;
17
+ /** Re-reads the indicator colour from the element's computed style */
11
18
  refreshColor: () => void;
19
+ /** The last frame drawn, redrawn on resize and theme change */
12
20
  redraw: () => void;
21
+ /** Profiles for a shape sequence, cached per name */
13
22
  profiles: (names: readonly MaterialShapeName[]) => RadialProfile[];
14
23
  }
24
+ /**
25
+ * Adds the canvas and the drawing routine
26
+ * @param config
27
+ */
15
28
  export declare const withRenderer: (config: LoadingIndicatorConfig) => (component: BaseComponent) => BaseComponent;
@@ -1,3 +1,7 @@
1
1
  import { LoadingIndicatorConfig, LoadingIndicatorComponent } from "./types.js";
2
+ /**
3
+ * Creates a loading indicator: the Material 3 expressive shape morph for waits under about five seconds.
4
+ * @param config
5
+ */
2
6
  declare const createLoadingIndicator: (config?: LoadingIndicatorConfig) => LoadingIndicatorComponent;
3
7
  export default createLoadingIndicator;
@@ -1,26 +1,47 @@
1
1
  import type { Renderer } from "./features/renderer.js";
2
+ /** Configuration options for the loading indicator */
2
3
  export interface LoadingIndicatorConfig {
4
+ /** Width and height in pixels, 24 to 240 (default 48) */
3
5
  size?: number;
6
+ /** Draws the indicator on a primary-container circle, for use over other */
4
7
  contained?: boolean;
8
+ /** A value from 0 to 1 makes the indicator determinate: the shape morphs with the value instead of looping. */
5
9
  value?: number | null;
10
+ /** Accessible name: what is loading (default "Loading") */
6
11
  ariaLabel?: string;
12
+ /** Additional CSS classes */
7
13
  class?: string;
14
+ /** Component prefix for CSS classes */
8
15
  prefix?: string;
16
+ /** Component name for CSS classes */
9
17
  componentName?: string;
10
18
  }
19
+ /** Loading indicator public API */
11
20
  export interface LoadingIndicatorComponent {
21
+ /** The root element */
12
22
  element: HTMLElement;
23
+ /** The canvas the shapes are drawn on */
13
24
  canvas: HTMLCanvasElement;
25
+ /** Sets a value from 0 to 1 (determinate) or null (indeterminate) */
14
26
  setValue: (value: number | null) => LoadingIndicatorComponent;
27
+ /** The current value, or null when indeterminate */
15
28
  getValue: () => number | null;
29
+ /** Sets the size in pixels, clamped to 24–240 */
16
30
  setSize: (size: number) => LoadingIndicatorComponent;
31
+ /** The size in pixels */
17
32
  getSize: () => number;
33
+ /** Sets the accessible name */
18
34
  setLabel: (label: string) => LoadingIndicatorComponent;
35
+ /** Runs the indeterminate animation (it runs from creation) */
19
36
  start: () => LoadingIndicatorComponent;
37
+ /** Freezes the indicator on its current frame */
20
38
  stop: () => LoadingIndicatorComponent;
39
+ /** Whether the animation is running */
21
40
  isRunning: () => boolean;
41
+ /** Stops the animation and removes the element */
22
42
  destroy: () => void;
23
43
  }
44
+ /** The component as it passes through the enhancers */
24
45
  export interface BaseComponent {
25
46
  element: HTMLElement;
26
47
  getClass?: (name: string) => string;
@@ -1,61 +1,112 @@
1
+ /** Menu position options for alignment relative to opener element */
2
+ /** Menu variants The baseline menu is the original M3 design: square-ish corners, a surface-container container, and items that fill the width. */
1
3
  export declare const MENU_VARIANTS: {
4
+ /** The original M3 menu (default, for compatibility) */
2
5
  readonly BASELINE: "baseline";
6
+ /** The M3 expressive vertical menu */
3
7
  readonly VERTICAL: "vertical";
4
8
  };
9
+ /** Colour mappings for the vertical menu Standard is surface-based and carries lower emphasis; vibrant is tertiary-based, is more prominent, and should be used sparingly (m3.material.io menu guidelines, "Color options"). */
5
10
  export declare const MENU_COLORS: {
6
11
  readonly STANDARD: "standard";
7
12
  readonly VIBRANT: "vibrant";
8
13
  };
9
14
  export declare const MENU_POSITION: {
15
+ /** Places menu below the opener, aligned to left edge */
10
16
  readonly BOTTOM_START: "bottom-start";
17
+ /** Places menu below the opener, centered */
11
18
  readonly BOTTOM: "bottom";
19
+ /** Places menu below the opener, aligned to right edge */
12
20
  readonly BOTTOM_END: "bottom-end";
21
+ /** Places menu above the opener, aligned to left edge */
13
22
  readonly TOP_START: "top-start";
23
+ /** Places menu above the opener, centered */
14
24
  readonly TOP: "top";
25
+ /** Places menu above the opener, aligned to right edge */
15
26
  readonly TOP_END: "top-end";
27
+ /** Places menu to the right of the opener, aligned to top edge */
16
28
  readonly RIGHT_START: "right-start";
29
+ /** Places menu to the right of the opener, centered */
17
30
  readonly RIGHT: "right";
31
+ /** Places menu to the right of the opener, aligned to bottom edge */
18
32
  readonly RIGHT_END: "right-end";
33
+ /** Places menu to the left of the opener, aligned to top edge */
19
34
  readonly LEFT_START: "left-start";
35
+ /** Places menu to the left of the opener, centered */
20
36
  readonly LEFT: "left";
37
+ /** Places menu to the left of the opener, aligned to bottom edge */
21
38
  readonly LEFT_END: "left-end";
22
39
  };
40
+ /** Default configuration values for menus */
23
41
  export declare const MENU_DEFAULTS: {
42
+ /** Default variant; the baseline menu, so existing menus are untouched */
24
43
  readonly VARIANT: "baseline";
44
+ /** Default colour mapping for the vertical variant */
25
45
  readonly COLOR: "standard";
46
+ /** Default menu position */
26
47
  readonly POSITION: "bottom-start";
48
+ /** Default offset from the opener (in pixels) */
27
49
  readonly OFFSET: 0;
50
+ /** Close menu when an item is selected */
28
51
  readonly CLOSE_ON_SELECT: true;
52
+ /** Close menu when clicking outside */
29
53
  readonly CLOSE_ON_CLICK_OUTSIDE: true;
54
+ /** Close menu when escape key is pressed */
30
55
  readonly CLOSE_ON_ESCAPE: true;
56
+ /** Open submenus on hover */
31
57
  readonly OPEN_SUBMENU_ON_HOVER: true;
58
+ /** Automatically flip menu position to stay in viewport */
32
59
  readonly AUTO_FLIP: true;
33
60
  };
61
+ /** Interaction types for menu opening/closing */
34
62
  export declare const MENU_INTERACTION_TYPES: {
63
+ /** Interaction via mouse or touch */
35
64
  readonly MOUSE: "mouse";
65
+ /** Interaction via keyboard */
36
66
  readonly KEYBOARD: "keyboard";
37
67
  };
68
+ /** Menu item types */
38
69
  export declare const MENU_ITEM_TYPES: {
70
+ /** Standard interactive menu item */
39
71
  readonly ITEM: "item";
72
+ /** Non-interactive dividing line */
40
73
  readonly DIVIDER: "divider";
41
74
  };
75
+ /** Menu event names */
42
76
  export declare const MENU_EVENTS: {
77
+ /** Fired when the menu is opened */
43
78
  readonly OPEN: "open";
79
+ /** Fired when the menu is closed */
44
80
  readonly CLOSE: "close";
81
+ /** Fired when a menu item is selected */
45
82
  readonly SELECT: "select";
46
83
  };
84
+ /** CSS classes for menu elements */
47
85
  export declare const MENU_CLASSES: {
86
+ /** Menu container */
48
87
  readonly CONTAINER: "menu";
88
+ /** Visible menu */
49
89
  readonly VISIBLE: "menu--visible";
90
+ /** Menu inner container */
50
91
  readonly INNER: "menu__inner";
92
+ /** Individual menu item */
51
93
  readonly ITEM: "menu__item";
94
+ /** Disabled menu item */
52
95
  readonly ITEM_DISABLED: "menu__item--disabled";
96
+ /** Selected menu item */
53
97
  readonly ITEM_SELECTED: "menu__item--selected";
98
+ /** Menu item with submenu */
54
99
  readonly ITEM_HAS_SUBMENU: "menu__item--has-submenu";
100
+ /** Divider */
55
101
  readonly DIVIDER: "menu__divider";
102
+ /** Item icon */
56
103
  readonly ITEM_ICON: "menu__item-icon";
104
+ /** Item text */
57
105
  readonly ITEM_TEXT: "menu__item-text";
106
+ /** Item keyboard shortcut */
58
107
  readonly ITEM_SHORTCUT: "menu__item-shortcut";
108
+ /** Submenu indicator */
59
109
  readonly SUBMENU_INDICATOR: "menu__submenu-indicator";
110
+ /** Dense/compact variant */
60
111
  readonly DENSE: "menu--dense";
61
112
  };
@@ -283,7 +283,7 @@ void component.element.getBoundingClientRect();
283
283
  component.element.classList.add(`${component.getClass("menu--visible")}`);
284
284
  if (!listbox)
285
285
  focusTimer = tasks.setTimeout(() => {
286
- component.keyboard?.handleInitialFocus(component.element, interactionType);
286
+ component.keyboard?.handleInitialFocus(component.element, interactionType, event);
287
287
  }, 100);
288
288
  window.addEventListener("resize", handleWindowResize, {
289
289
  passive: true,
@@ -55,17 +55,22 @@ tasks.clearTimeout(typeaheadTimeout);
55
55
  typeaheadTimeout = null;
56
56
  }
57
57
  };
58
- const handleInitialFocus = (menuElement, interactionType) => {
58
+ const handleInitialFocus = (menuElement, interactionType, openingEvent) => {
59
59
  resetTypeahead();
60
60
  const items = menuItems(menuElement);
61
+ const last = openingEvent instanceof KeyboardEvent &&
62
+ (openingEvent.key === "ArrowUp" || openingEvent.key === "Up");
63
+ const target = last
64
+ ? [...items].reverse().find((item) => !item.classList.contains(component.getClass("menu__item--disabled"))) ?? items[items.length - 1]
65
+ : items[0];
61
66
  items.forEach((item) => item.setAttribute("tabindex", "-1"));
62
- items[0]?.setAttribute("tabindex", "0");
67
+ target?.setAttribute("tabindex", "0");
63
68
  const focused = activeElementOf(menuElement);
64
69
  if (focused !== menuElement && menuElement.contains(focused) ||
65
70
  focused?.closest(`.${component.getClass("menu--submenu")}`)?.getAttribute("data-owner") === menuElement.id)
66
71
  return;
67
72
  if (interactionType === "keyboard" && items.length > 0) {
68
- items[0].focus();
73
+ target.focus();
69
74
  return;
70
75
  }
71
76
  menuElement.setAttribute("tabindex", "-1");
@@ -162,6 +162,8 @@ case "Enter":
162
162
  case " ":
163
163
  case "ArrowDown":
164
164
  case "Down":
165
+ case "ArrowUp":
166
+ case "Up":
165
167
  e.preventDefault();
166
168
  if (!isOpen) {
167
169
  component.menu.open(e, "keyboard");
@@ -173,22 +175,6 @@ e.preventDefault();
173
175
  component.menu.close(e);
174
176
  }
175
177
  break;
176
- case "ArrowUp":
177
- case "Up":
178
- e.preventDefault();
179
- if (!isOpen) {
180
- component.menu.open(e, "keyboard");
181
- tasks.setTimeout(() => {
182
- const items = component.element.querySelectorAll(`.${component.getClass("menu__item")}:not(.${component.getClass("menu__item--disabled")})`);
183
- if (items.length > 0) {
184
- items.forEach((item) => item.setAttribute("tabindex", "-1"));
185
- const lastItem = items[items.length - 1];
186
- lastItem.setAttribute("tabindex", "0");
187
- lastItem.focus();
188
- }
189
- }, 100);
190
- }
191
- break;
192
178
  }
193
179
  };
194
180
  const handleOpenerBlur = (e) => {
@@ -1,4 +1,6 @@
1
+ /** Menu component module The Menu component provides a Material Design 3 compliant dropdown menu system with support for nested menus, keyboard navigation, and accessibility. */
1
2
  export { default, default as createMenu } from "./menu.js";
2
3
  export type { MenuEvents } from "./types.js";
3
4
  export type { MenuConfig, MenuVariant, MenuComponent, MenuItem, MenuDivider, MenuGap, MenuContent, MenuEvent, MenuSelectEvent, MenuPosition } from "./types.js";
5
+ /** Constants for menu position values - use these instead of string literals for better code completion and type safety. */
4
6
  export { MENU_POSITION, MENU_DEFAULTS, MENU_INTERACTION_TYPES, MENU_ITEM_TYPES, MENU_EVENTS, MENU_CLASSES } from "./constants.js";
@@ -1,6 +1,8 @@
1
1
  import type { OnDemandMenu } from "./on-demand.js";
2
2
  export declare const MENU: unique symbol;
3
+ /** What an owner of an inner menu carries. */
3
4
  export interface MenuOwner {
4
5
  [MENU]?: OnDemandMenu;
5
6
  }
7
+ /** The menu inside a select or a split button, if it has one. */
6
8
  export declare const innerMenu: (owner: object) => OnDemandMenu | undefined;
@@ -1,3 +1,7 @@
1
1
  import { MenuConfig, MenuComponent } from "./types.js";
2
+ /**
3
+ * Creates a new Menu component with the specified configuration.
4
+ * @param config
5
+ */
2
6
  declare const createMenu: (config: MenuConfig) => MenuComponent;
3
7
  export default createMenu;
@@ -1,9 +1,13 @@
1
1
  import type { EventCallback } from "../../core/state/emitter.js";
2
2
  import type { MenuConfig, MenuContent, MenuEvents, MenuPosition } from "./types.js";
3
+ /** createMenu's configuration, except the items, which setItems may replace. */
3
4
  type MenuSettings = Omit<MenuConfig, "items">;
5
+ /** The menu a select or a split button holds before the chunk arrives: the operations the two components reach on their own inner menu. */
4
6
  export interface OnDemandMenu {
5
7
  readonly element: HTMLElement;
8
+ /** Starts the load without opening the menu, from the intent to open it. */
6
9
  preload(): void;
10
+ /** Runs once the real menu exists, after an open that waited for it. */
7
11
  whenReady(callback: () => void): void;
8
12
  open(event?: Event, interactionType?: "mouse" | "keyboard"): OnDemandMenu;
9
13
  close(event?: Event, restoreFocus?: boolean, skipAnimation?: boolean): OnDemandMenu;
@@ -17,5 +21,10 @@ export interface OnDemandMenu {
17
21
  on(event: string, handler: EventCallback): OnDemandMenu;
18
22
  destroy(): void;
19
23
  }
24
+ /**
25
+ * A stand-in for the menu, replaced by it when the chunk lands
26
+ * @param settings
27
+ * @param items
28
+ */
20
29
  export declare const createOnDemandMenu: (settings: MenuSettings, items: MenuContent[]) => OnDemandMenu;
21
30
  export {};