material 3.8.0 → 3.8.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (382) hide show
  1. package/README.md +1 -1
  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/types.d.ts +16 -0
  28. package/dist/components/checkbox/checkbox.d.ts +5 -0
  29. package/dist/components/checkbox/constants.d.ts +13 -0
  30. package/dist/components/checkbox/index.d.ts +2 -0
  31. package/dist/components/checkbox/types.d.ts +94 -0
  32. package/dist/components/chips/chips.d.ts +4 -0
  33. package/dist/components/chips/constants.d.ts +1 -0
  34. package/dist/components/chips/factories.d.ts +4 -0
  35. package/dist/components/chips/types.d.ts +140 -0
  36. package/dist/components/datepicker/constants.d.ts +38 -0
  37. package/dist/components/datepicker/datepicker.d.ts +2 -0
  38. package/dist/components/datepicker/types.d.ts +139 -0
  39. package/dist/components/dialog/constants.d.ts +45 -0
  40. package/dist/components/dialog/dialog.d.ts +5 -0
  41. package/dist/components/dialog/index.d.ts +1 -0
  42. package/dist/components/dialog/types.d.ts +196 -0
  43. package/dist/components/divider/config.d.ts +30 -0
  44. package/dist/components/divider/constants.d.ts +15 -0
  45. package/dist/components/divider/divider.d.ts +4 -0
  46. package/dist/components/divider/types.d.ts +27 -0
  47. package/dist/components/drawer/constants.d.ts +39 -0
  48. package/dist/components/drawer/drawer.d.ts +4 -0
  49. package/dist/components/drawer/index.d.ts +1 -0
  50. package/dist/components/drawer/types.d.ts +109 -0
  51. package/dist/components/extended-fab/constants.d.ts +32 -0
  52. package/dist/components/extended-fab/extended-fab.d.ts +4 -0
  53. package/dist/components/extended-fab/types.d.ts +123 -0
  54. package/dist/components/fab/constants.d.ts +26 -0
  55. package/dist/components/fab/fab.d.ts +4 -0
  56. package/dist/components/fab/types.d.ts +100 -0
  57. package/dist/components/fab-menu/constants.d.ts +9 -0
  58. package/dist/components/fab-menu/fab-menu.d.ts +4 -0
  59. package/dist/components/fab-menu/types.d.ts +41 -0
  60. package/dist/components/icon-button/constants.d.ts +34 -0
  61. package/dist/components/icon-button/icon-button.d.ts +4 -0
  62. package/dist/components/icon-button/types.d.ts +157 -0
  63. package/dist/components/index.d.ts +1 -0
  64. package/dist/components/list/constants.d.ts +30 -0
  65. package/dist/components/list/index.d.ts +1 -0
  66. package/dist/components/list/list.d.ts +4 -0
  67. package/dist/components/list/types.d.ts +110 -0
  68. package/dist/components/loading-indicator/constants.d.ts +16 -0
  69. package/dist/components/loading-indicator/features/renderer.d.ts +13 -0
  70. package/dist/components/loading-indicator/loading-indicator.d.ts +4 -0
  71. package/dist/components/loading-indicator/types.d.ts +21 -0
  72. package/dist/components/menu/constants.d.ts +51 -0
  73. package/dist/components/menu/features/controller.js +1 -1
  74. package/dist/components/menu/features/keyboard.js +8 -3
  75. package/dist/components/menu/features/opener.js +2 -16
  76. package/dist/components/menu/index.d.ts +2 -0
  77. package/dist/components/menu/inner.d.ts +2 -0
  78. package/dist/components/menu/menu.d.ts +4 -0
  79. package/dist/components/menu/on-demand.d.ts +9 -0
  80. package/dist/components/menu/types.d.ts +185 -1
  81. package/dist/components/navigation-bar/navigation-bar.d.ts +1 -0
  82. package/dist/components/navigation-bar/types.d.ts +12 -0
  83. package/dist/components/navigation-rail/constants.d.ts +2 -0
  84. package/dist/components/navigation-rail/navigation-rail.d.ts +1 -0
  85. package/dist/components/navigation-rail/types.d.ts +18 -0
  86. package/dist/components/progress/constants.d.ts +37 -0
  87. package/dist/components/progress/progress.d.ts +4 -0
  88. package/dist/components/progress/types.d.ts +136 -0
  89. package/dist/components/radios/constants.d.ts +14 -0
  90. package/dist/components/radios/radios.d.ts +4 -0
  91. package/dist/components/radios/types.d.ts +89 -0
  92. package/dist/components/search/constants.d.ts +34 -0
  93. package/dist/components/search/search.d.ts +4 -0
  94. package/dist/components/search/types.d.ts +109 -0
  95. package/dist/components/select/constants.d.ts +46 -0
  96. package/dist/components/select/features.js +9 -1
  97. package/dist/components/select/index.d.ts +2 -0
  98. package/dist/components/select/select.d.ts +4 -0
  99. package/dist/components/select/types.d.ts +95 -0
  100. package/dist/components/side-sheet/constants.d.ts +9 -0
  101. package/dist/components/side-sheet/side-sheet.d.ts +4 -0
  102. package/dist/components/side-sheet/types.d.ts +51 -0
  103. package/dist/components/slider/constants.d.ts +62 -0
  104. package/dist/components/slider/slider.d.ts +4 -0
  105. package/dist/components/slider/types.d.ts +78 -0
  106. package/dist/components/snackbar/constants.d.ts +37 -0
  107. package/dist/components/snackbar/snackbar.d.ts +5 -0
  108. package/dist/components/snackbar/types.d.ts +67 -0
  109. package/dist/components/split-button/api.js +13 -3
  110. package/dist/components/split-button/constants.d.ts +13 -0
  111. package/dist/components/split-button/split-button.d.ts +4 -0
  112. package/dist/components/split-button/types.d.ts +50 -0
  113. package/dist/components/switch/constants.d.ts +34 -0
  114. package/dist/components/switch/switch.d.ts +4 -0
  115. package/dist/components/switch/types.d.ts +55 -0
  116. package/dist/components/tabs/constants.d.ts +49 -0
  117. package/dist/components/tabs/indicator.d.ts +22 -0
  118. package/dist/components/tabs/responsive.d.ts +17 -0
  119. package/dist/components/tabs/tab.d.ts +5 -0
  120. package/dist/components/tabs/tabs.d.ts +4 -0
  121. package/dist/components/tabs/types.d.ts +170 -0
  122. package/dist/components/tabs/utils.d.ts +24 -0
  123. package/dist/components/text-field/constants.d.ts +61 -0
  124. package/dist/components/text-field/features/trailing-icon.d.ts +25 -0
  125. package/dist/components/text-field/text-field.d.ts +4 -0
  126. package/dist/components/text-field/types.d.ts +84 -0
  127. package/dist/components/timepicker/constants.d.ts +61 -0
  128. package/dist/components/timepicker/types.d.ts +145 -0
  129. package/dist/components/toolbar/constants.d.ts +8 -0
  130. package/dist/components/toolbar/toolbar.d.ts +4 -0
  131. package/dist/components/toolbar/types.d.ts +75 -0
  132. package/dist/components/tooltip/constants.d.ts +43 -0
  133. package/dist/components/tooltip/tooltip.d.ts +4 -0
  134. package/dist/components/tooltip/types.d.ts +78 -0
  135. package/dist/components/top-app-bar/constants.d.ts +29 -0
  136. package/dist/components/top-app-bar/top-app-bar.d.ts +4 -0
  137. package/dist/components/top-app-bar/types.d.ts +55 -0
  138. package/dist/core/canvas/animation.d.ts +6 -0
  139. package/dist/core/canvas/drawing.d.ts +47 -0
  140. package/dist/core/canvas/index.d.ts +1 -0
  141. package/dist/core/canvas/resize.d.ts +7 -0
  142. package/dist/core/canvas/utils.d.ts +39 -0
  143. package/dist/core/compose/base.d.ts +9 -0
  144. package/dist/core/compose/cleanup.d.ts +2 -0
  145. package/dist/core/compose/component.d.ts +13 -0
  146. package/dist/core/compose/features/badge.d.ts +10 -0
  147. package/dist/core/compose/features/checkable.d.ts +13 -0
  148. package/dist/core/compose/features/debounce.d.ts +19 -0
  149. package/dist/core/compose/features/disabled.d.ts +11 -0
  150. package/dist/core/compose/features/events.d.ts +19 -0
  151. package/dist/core/compose/features/icon.d.ts +20 -0
  152. package/dist/core/compose/features/input.d.ts +31 -0
  153. package/dist/core/compose/features/lifecycle.d.ts +16 -0
  154. package/dist/core/compose/features/position.d.ts +13 -0
  155. package/dist/core/compose/features/ripple.d.ts +17 -0
  156. package/dist/core/compose/features/size.d.ts +5 -0
  157. package/dist/core/compose/features/style.d.ts +5 -0
  158. package/dist/core/compose/features/text.d.ts +20 -0
  159. package/dist/core/compose/features/textinput.d.ts +39 -0
  160. package/dist/core/compose/features/textlabel.d.ts +18 -0
  161. package/dist/core/compose/features/throttle.d.ts +18 -0
  162. package/dist/core/compose/features/track.d.ts +12 -0
  163. package/dist/core/compose/features/variant.d.ts +5 -0
  164. package/dist/core/compose/features/withEvents.d.ts +12 -0
  165. package/dist/core/compose/pipe.d.ts +12 -0
  166. package/dist/core/compose/utils/type-guards.d.ts +5 -0
  167. package/dist/core/config/component.d.ts +17 -0
  168. package/dist/core/config/global.d.ts +15 -0
  169. package/dist/core/config.d.ts +34 -0
  170. package/dist/core/dom/attributes.d.ts +25 -0
  171. package/dist/core/dom/classes.d.ts +24 -0
  172. package/dist/core/dom/create.d.ts +47 -0
  173. package/dist/core/dom/events.d.ts +26 -0
  174. package/dist/core/dom/focus.d.ts +11 -0
  175. package/dist/core/dom/html.d.ts +6 -0
  176. package/dist/core/dom/layer.d.ts +36 -0
  177. package/dist/core/dom/roving.d.ts +7 -0
  178. package/dist/core/navigation/destinations.d.ts +10 -0
  179. package/dist/core/shapes/cubic.d.ts +8 -0
  180. package/dist/core/shapes/material.d.ts +45 -0
  181. package/dist/core/shapes/polygon.d.ts +11 -0
  182. package/dist/core/state/emitter.d.ts +19 -0
  183. package/dist/core/state/events.d.ts +17 -0
  184. package/dist/core/state/store.d.ts +40 -0
  185. package/dist/core/theme/shape.d.ts +3 -0
  186. package/dist/core/theme/tokens.d.ts +6 -0
  187. package/dist/core/utils/background.d.ts +7 -0
  188. package/dist/core/utils/color.d.ts +5 -0
  189. package/dist/core/utils/index.d.ts +9 -0
  190. package/dist/core/utils/mobile.d.ts +10 -0
  191. package/dist/core/utils/object.d.ts +9 -0
  192. package/dist/core/utils/performance.d.ts +20 -0
  193. package/dist/core/utils/theme.d.ts +8 -0
  194. package/dist/core/utils/url.d.ts +3 -0
  195. package/dist/elements/adapter.d.ts +24 -0
  196. package/dist/elements/badge.d.ts +4 -0
  197. package/dist/elements/bottom-app-bar.d.ts +4 -0
  198. package/dist/elements/bottom-sheet.d.ts +6 -0
  199. package/dist/elements/button-group.d.ts +8 -0
  200. package/dist/elements/button.d.ts +5 -0
  201. package/dist/elements/card.d.ts +4 -0
  202. package/dist/elements/carousel.d.ts +5 -0
  203. package/dist/elements/checkbox.d.ts +4 -0
  204. package/dist/elements/chips.d.ts +9 -0
  205. package/dist/elements/css/menu.css +1 -1
  206. package/dist/elements/css/menu.js +1 -1
  207. package/dist/elements/datepicker.d.ts +6 -0
  208. package/dist/elements/define.d.ts +48 -0
  209. package/dist/elements/dialog.d.ts +5 -0
  210. package/dist/elements/divider.d.ts +4 -0
  211. package/dist/elements/drawer.d.ts +6 -0
  212. package/dist/elements/extended-fab.d.ts +5 -0
  213. package/dist/elements/fab-menu.d.ts +10 -0
  214. package/dist/elements/fab.d.ts +5 -0
  215. package/dist/elements/icon-button.d.ts +6 -0
  216. package/dist/elements/index.d.ts +4 -0
  217. package/dist/elements/list.d.ts +8 -0
  218. package/dist/elements/loading-indicator.d.ts +4 -0
  219. package/dist/elements/menu.d.ts +12 -0
  220. package/dist/elements/navigation-bar.d.ts +6 -0
  221. package/dist/elements/navigation-rail.d.ts +10 -0
  222. package/dist/elements/preupgrade/badge.css +1 -1
  223. package/dist/elements/preupgrade/bottom-app-bar.css +1 -1
  224. package/dist/elements/preupgrade/bottom-sheet.css +1 -1
  225. package/dist/elements/preupgrade/button-group.css +1 -1
  226. package/dist/elements/preupgrade/button.css +1 -1
  227. package/dist/elements/preupgrade/card.css +1 -1
  228. package/dist/elements/preupgrade/carousel.css +1 -1
  229. package/dist/elements/preupgrade/checkbox.css +1 -1
  230. package/dist/elements/preupgrade/chips.css +1 -1
  231. package/dist/elements/preupgrade/datepicker.css +1 -1
  232. package/dist/elements/preupgrade/dialog.css +1 -1
  233. package/dist/elements/preupgrade/divider.css +1 -1
  234. package/dist/elements/preupgrade/drawer.css +1 -1
  235. package/dist/elements/preupgrade/extended-fab.css +1 -1
  236. package/dist/elements/preupgrade/fab-menu.css +1 -1
  237. package/dist/elements/preupgrade/fab.css +1 -1
  238. package/dist/elements/preupgrade/icon-button.css +1 -1
  239. package/dist/elements/preupgrade/list.css +1 -1
  240. package/dist/elements/preupgrade/loading-indicator.css +1 -1
  241. package/dist/elements/preupgrade/menu.css +1 -1
  242. package/dist/elements/preupgrade/navigation-bar.css +1 -1
  243. package/dist/elements/preupgrade/navigation-rail.css +1 -1
  244. package/dist/elements/preupgrade/progress.css +1 -1
  245. package/dist/elements/preupgrade/radios.css +1 -1
  246. package/dist/elements/preupgrade/search.css +1 -1
  247. package/dist/elements/preupgrade/select.css +1 -1
  248. package/dist/elements/preupgrade/side-sheet.css +1 -1
  249. package/dist/elements/preupgrade/slider.css +1 -1
  250. package/dist/elements/preupgrade/snackbar.css +1 -1
  251. package/dist/elements/preupgrade/split-button.css +1 -1
  252. package/dist/elements/preupgrade/switch.css +1 -1
  253. package/dist/elements/preupgrade/tabs.css +1 -1
  254. package/dist/elements/preupgrade/text-field.css +1 -1
  255. package/dist/elements/preupgrade/timepicker.css +1 -1
  256. package/dist/elements/preupgrade/toolbar.css +1 -1
  257. package/dist/elements/preupgrade/tooltip.css +1 -1
  258. package/dist/elements/preupgrade/top-app-bar.css +1 -1
  259. package/dist/elements/preupgrade.css +1 -1
  260. package/dist/elements/progress.d.ts +4 -0
  261. package/dist/elements/radios.d.ts +5 -0
  262. package/dist/elements/search.d.ts +15 -0
  263. package/dist/elements/select.d.ts +6 -0
  264. package/dist/elements/side-sheet.d.ts +5 -0
  265. package/dist/elements/slider.d.ts +7 -0
  266. package/dist/elements/snackbar.d.ts +4 -0
  267. package/dist/elements/split-button.d.ts +8 -0
  268. package/dist/elements/styles.d.ts +11 -0
  269. package/dist/elements/switch.d.ts +5 -0
  270. package/dist/elements/tabs.d.ts +6 -0
  271. package/dist/elements/text-field.d.ts +9 -0
  272. package/dist/elements/timepicker.d.ts +9 -0
  273. package/dist/elements/toolbar.d.ts +4 -0
  274. package/dist/elements/tooltip.d.ts +4 -0
  275. package/dist/elements/top-app-bar.d.ts +4 -0
  276. package/dist/index.d.ts +1 -0
  277. package/dist/react/create.d.ts +15 -0
  278. package/dist/react/index.d.ts +1 -0
  279. package/dist/react/jsx.d.ts +3 -0
  280. package/dist/solid/create.d.ts +16 -0
  281. package/dist/solid/index.d.ts +1 -0
  282. package/dist/solid/jsx.d.ts +4 -0
  283. package/dist/ssr/index.d.ts +3 -0
  284. package/dist/ssr/solid.d.ts +1 -0
  285. package/dist/ssr/svelte.d.ts +1 -0
  286. package/dist/ssr/vue.d.ts +1 -0
  287. package/dist/styles/badge.css +1 -1
  288. package/dist/styles/base-lite.css +1 -1
  289. package/dist/styles/base.css +1 -1
  290. package/dist/styles/bottom-app-bar.css +1 -1
  291. package/dist/styles/bottom-sheet.css +1 -1
  292. package/dist/styles/button-group.css +1 -1
  293. package/dist/styles/button.css +1 -1
  294. package/dist/styles/card.css +1 -1
  295. package/dist/styles/carousel.css +1 -1
  296. package/dist/styles/checkbox.css +1 -1
  297. package/dist/styles/chips.css +1 -1
  298. package/dist/styles/contrast.css +1 -1
  299. package/dist/styles/datepicker.css +1 -1
  300. package/dist/styles/dialog.css +1 -1
  301. package/dist/styles/divider.css +1 -1
  302. package/dist/styles/drawer.css +1 -1
  303. package/dist/styles/extended-fab.css +1 -1
  304. package/dist/styles/fab-menu.css +1 -1
  305. package/dist/styles/fab.css +1 -1
  306. package/dist/styles/icon-button.css +1 -1
  307. package/dist/styles/list.css +1 -1
  308. package/dist/styles/loading-indicator.css +1 -1
  309. package/dist/styles/menu.css +2 -2
  310. package/dist/styles/navigation-bar.css +1 -1
  311. package/dist/styles/navigation-rail.css +1 -1
  312. package/dist/styles/progress.css +1 -1
  313. package/dist/styles/radios.css +1 -1
  314. package/dist/styles/search.css +1 -1
  315. package/dist/styles/select.css +1 -1
  316. package/dist/styles/side-sheet.css +1 -1
  317. package/dist/styles/slider.css +1 -1
  318. package/dist/styles/snackbar.css +1 -1
  319. package/dist/styles/split-button.css +1 -1
  320. package/dist/styles/switch.css +1 -1
  321. package/dist/styles/tabs.css +1 -1
  322. package/dist/styles/text-field.css +1 -1
  323. package/dist/styles/timepicker.css +1 -1
  324. package/dist/styles/toolbar.css +1 -1
  325. package/dist/styles/tooltip.css +1 -1
  326. package/dist/styles/top-app-bar.css +1 -1
  327. package/dist/styles/typography.css +1 -1
  328. package/dist/styles/utilities.css +1 -1
  329. package/dist/styles.css +2 -2
  330. package/dist/svelte/runtime.d.ts +21 -0
  331. package/dist/theme/image.d.ts +2 -0
  332. package/dist/theme/index.d.ts +20 -0
  333. package/dist/theme/variants.d.ts +6 -0
  334. package/dist/theme/vendor/dynamiccolor/color_spec_2021.d.ts +1 -0
  335. package/dist/theme/vendor/dynamiccolor/dynamic_color.d.ts +39 -0
  336. package/dist/theme/vendor/dynamiccolor/dynamic_scheme.d.ts +13 -0
  337. package/dist/theme/vendor/dynamiccolor/material_dynamic_colors.d.ts +1 -0
  338. package/dist/theme/vendor/hct/hct.d.ts +9 -0
  339. package/dist/themes/autumn-contrast.css +1 -1
  340. package/dist/themes/autumn.css +1 -1
  341. package/dist/themes/baseline-contrast.css +1 -1
  342. package/dist/themes/baseline.css +1 -1
  343. package/dist/themes/brownbeige-contrast.css +1 -1
  344. package/dist/themes/brownbeige.css +1 -1
  345. package/dist/themes/content-contrast.css +1 -1
  346. package/dist/themes/content.css +1 -1
  347. package/dist/themes/desert-contrast.css +1 -1
  348. package/dist/themes/desert.css +1 -1
  349. package/dist/themes/expressive-contrast.css +1 -1
  350. package/dist/themes/expressive.css +1 -1
  351. package/dist/themes/fidelity-contrast.css +1 -1
  352. package/dist/themes/fidelity.css +1 -1
  353. package/dist/themes/forest-contrast.css +1 -1
  354. package/dist/themes/forest.css +1 -1
  355. package/dist/themes/fruit-salad-contrast.css +1 -1
  356. package/dist/themes/fruit-salad.css +1 -1
  357. package/dist/themes/highcontrast-contrast.css +1 -1
  358. package/dist/themes/highcontrast.css +1 -1
  359. package/dist/themes/monochrome-contrast.css +1 -1
  360. package/dist/themes/monochrome.css +1 -1
  361. package/dist/themes/neutral-contrast.css +1 -1
  362. package/dist/themes/neutral.css +1 -1
  363. package/dist/themes/ocean-contrast.css +1 -1
  364. package/dist/themes/ocean.css +1 -1
  365. package/dist/themes/rainbow-contrast.css +1 -1
  366. package/dist/themes/rainbow.css +1 -1
  367. package/dist/themes/sageivory-contrast.css +1 -1
  368. package/dist/themes/sageivory.css +1 -1
  369. package/dist/themes/spring-contrast.css +1 -1
  370. package/dist/themes/spring.css +1 -1
  371. package/dist/themes/summer-contrast.css +1 -1
  372. package/dist/themes/summer.css +1 -1
  373. package/dist/themes/sunset-contrast.css +1 -1
  374. package/dist/themes/sunset.css +1 -1
  375. package/dist/themes/tealcaramel-contrast.css +1 -1
  376. package/dist/themes/tealcaramel.css +1 -1
  377. package/dist/themes/vibrant-contrast.css +1 -1
  378. package/dist/themes/vibrant.css +1 -1
  379. package/dist/vue/create.d.ts +18 -0
  380. package/dist/vue/index.d.ts +1 -0
  381. package/package.json +1 -1
  382. package/src/styles/components/_menu.scss +14 -1
@@ -1,16 +1,34 @@
1
1
  import { BaseComponent, ElementComponent } from "../component.js";
2
+ /** Configuration for text label feature */
2
3
  export interface TextLabelConfig {
4
+ /** Label text */
5
+ /** The label: text, or a node placed inside the label element (the web components pass a `<slot>` so the page's content is the label). */
3
6
  label?: string | Node;
7
+ /** Label position ('start' or 'end') */
4
8
  labelPosition?: "start" | "end";
9
+ /** CSS class prefix */
5
10
  prefix?: string;
11
+ /** Component name for class generation */
6
12
  componentName?: string;
7
13
  }
14
+ /** Label manager interface */
8
15
  export interface LabelManager {
16
+ /**
17
+ * Sets the label text
18
+ * @param text
19
+ */
9
20
  setText: (text: string) => LabelManager;
21
+ /** Gets the current label text */
10
22
  getText: () => string;
23
+ /** Gets the label element */
11
24
  getElement: () => HTMLElement;
12
25
  }
26
+ /** Component with label capabilities */
13
27
  export interface LabelComponent extends BaseComponent {
14
28
  label: LabelManager;
15
29
  }
30
+ /**
31
+ * Adds a text label to a component
32
+ * @param config
33
+ */
16
34
  export declare const withTextLabel: <T extends TextLabelConfig & object>(config?: T) => <C extends ElementComponent>(component: C) => C & LabelComponent;
@@ -1,5 +1,7 @@
1
1
  import { BaseComponent, ElementComponent } from "../component.js";
2
+ /** Configuration for throttled event handlers */
2
3
  export interface ThrottleConfig {
4
+ /** Event handlers with throttle settings */
3
5
  throttledEvents?: Record<string, {
4
6
  handler: (event: Event) => void;
5
7
  wait: number;
@@ -9,12 +11,28 @@ export interface ThrottleConfig {
9
11
  };
10
12
  }>;
11
13
  }
14
+ /** Component with throttled event capabilities */
12
15
  export interface ThrottleComponent extends BaseComponent {
16
+ /**
17
+ * Adds a throttled event listener
18
+ * @param event
19
+ * @param handler
20
+ * @param wait
21
+ * @param options
22
+ */
13
23
  addThrottledEvent: (event: string, handler: (event: Event) => void, wait: number, options?: {
14
24
  leading?: boolean;
15
25
  trailing?: boolean;
16
26
  }) => ThrottleComponent;
27
+ /**
28
+ * Removes a throttled event listener
29
+ * @param event
30
+ */
17
31
  removeThrottledEvent: (event: string) => ThrottleComponent;
18
32
  }
33
+ /**
34
+ * Adds throttled event handling capabilities to a component
35
+ * @param config
36
+ */
19
37
  export declare const withThrottle: <T extends ThrottleConfig & object>(config?: T) => <C extends ElementComponent>(component: C) => C & ThrottleComponent;
20
38
  export default withThrottle;
@@ -1,12 +1,24 @@
1
1
  import { BaseComponent, ElementComponent } from "../component.js";
2
+ /** Configuration for track feature */
2
3
  export interface TrackConfig {
4
+ /** CSS class prefix */
3
5
  prefix: string;
6
+ /** Component name for class generation */
4
7
  componentName: string;
8
+ /** Custom icon HTML or 'none' */
5
9
  icon?: string;
10
+ /** Icon HTML shown in the unselected handle, which then grows to 24dp: M3's "icon on selected and unselected switch" configuration. */
6
11
  unselectedIcon?: string;
7
12
  }
13
+ /** Component with track and thumb elements */
8
14
  export interface TrackComponent extends BaseComponent {
15
+ /** Track element */
9
16
  track: HTMLElement;
17
+ /** Thumb element */
10
18
  thumb: HTMLElement;
11
19
  }
20
+ /**
21
+ * Adds track and thumb elements to a component
22
+ * @param config
23
+ */
12
24
  export declare const withTrack: <T extends TrackConfig>(config: T) => <C extends ElementComponent>(component: C) => C & TrackComponent;
@@ -1,7 +1,12 @@
1
1
  import { ElementComponent } from "../component.js";
2
+ /** Configuration for variant feature */
2
3
  export interface VariantConfig {
3
4
  variant?: string;
4
5
  prefix?: string;
5
6
  componentName?: string;
6
7
  }
8
+ /**
9
+ * Adds a variant class to a component
10
+ * @param config
11
+ */
7
12
  export declare const withVariant: <T extends VariantConfig & object>(config: T) => <C extends ElementComponent>(component: C) => C;
@@ -1,15 +1,27 @@
1
1
  import { BaseComponent, ElementComponent } from "../component.js";
2
+ /** Event manager interface */
2
3
  export interface EnhancedEventManager {
4
+ /** Add an event listener */
3
5
  on: (event: string, handler: Function) => EnhancedEventManager;
6
+ /** Remove an event listener */
4
7
  off: (event: string, handler: Function) => EnhancedEventManager;
8
+ /** Add multiple event listeners at once */
5
9
  addListeners: (listeners: Record<string, Function>) => EnhancedEventManager;
10
+ /** Remove multiple event listeners at once */
6
11
  removeListeners: (listeners: Record<string, Function>) => EnhancedEventManager;
12
+ /** One-time event handler */
7
13
  once: (event: string, handler: Function) => EnhancedEventManager;
14
+ /** Clean up all event listeners */
8
15
  destroy: () => void;
9
16
  }
17
+ /** Component with enhanced event capabilities */
10
18
  export interface EnhancedEventComponent extends BaseComponent {
11
19
  events: EnhancedEventManager;
12
20
  on(event: string, handler: Function): this;
13
21
  off(event: string, handler: Function): this;
14
22
  }
23
+ /**
24
+ * Adds enhanced event handling capabilities to a component
25
+ * @param target
26
+ */
15
27
  export declare const withEvents: (target?: HTMLElement) => <C extends ElementComponent>(component: C) => C & EnhancedEventComponent;
@@ -1,3 +1,7 @@
1
+ /**
2
+ * Performs left-to-right function composition.
3
+ * @param fns
4
+ */
1
5
  export declare function pipe<A, B>(f1: (arg: A) => B): (x: A) => B;
2
6
  export declare function pipe<A, B, C>(f1: (arg: A) => B, f2: (arg: B) => C): (x: A) => C;
3
7
  export declare function pipe<A, B, C, D>(f1: (arg: A) => B, f2: (arg: B) => C, f3: (arg: C) => D): (x: A) => D;
@@ -19,6 +23,10 @@ export declare function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q,
19
23
  export declare function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T>(f1: (arg: A) => B, f2: (arg: B) => C, f3: (arg: C) => D, f4: (arg: D) => E, f5: (arg: E) => F, f6: (arg: F) => G, f7: (arg: G) => H, f8: (arg: H) => I, f9: (arg: I) => J, f10: (arg: J) => K, f11: (arg: K) => L, f12: (arg: L) => M, f13: (arg: M) => N, f14: (arg: N) => O, f15: (arg: O) => P, f16: (arg: P) => Q, f17: (arg: Q) => R, f18: (arg: R) => S, f19: (arg: S) => T): (x: A) => T;
20
24
  export declare function pipe<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U>(f1: (arg: A) => B, f2: (arg: B) => C, f3: (arg: C) => D, f4: (arg: D) => E, f5: (arg: E) => F, f6: (arg: F) => G, f7: (arg: G) => H, f8: (arg: H) => I, f9: (arg: I) => J, f10: (arg: J) => K, f11: (arg: K) => L, f12: (arg: L) => M, f13: (arg: M) => N, f14: (arg: N) => O, f15: (arg: O) => P, f16: (arg: P) => Q, f17: (arg: Q) => R, f18: (arg: R) => S, f19: (arg: S) => T, f20: (arg: T) => U): (x: A) => U;
21
25
  export declare function pipe<T>(...fns: Array<(arg: T) => T>): (x: T) => T;
26
+ /**
27
+ * Performs right-to-left function composition.
28
+ * @param fns
29
+ */
22
30
  export declare function compose<A, B>(f1: (arg: A) => B): (x: A) => B;
23
31
  export declare function compose<A, B, C>(f2: (arg: B) => C, f1: (arg: A) => B): (x: A) => C;
24
32
  export declare function compose<A, B, C, D>(f3: (arg: C) => D, f2: (arg: B) => C, f1: (arg: A) => B): (x: A) => D;
@@ -40,4 +48,8 @@ export declare function compose<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P,
40
48
  export declare function compose<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T>(f19: (arg: S) => T, f18: (arg: R) => S, f17: (arg: Q) => R, f16: (arg: P) => Q, f15: (arg: O) => P, f14: (arg: N) => O, f13: (arg: M) => N, f12: (arg: L) => M, f11: (arg: K) => L, f10: (arg: J) => K, f9: (arg: I) => J, f8: (arg: H) => I, f7: (arg: G) => H, f6: (arg: F) => G, f5: (arg: E) => F, f4: (arg: D) => E, f3: (arg: C) => D, f2: (arg: B) => C, f1: (arg: A) => B): (x: A) => T;
41
49
  export declare function compose<A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U>(f20: (arg: T) => U, f19: (arg: S) => T, f18: (arg: R) => S, f17: (arg: Q) => R, f16: (arg: P) => Q, f15: (arg: O) => P, f14: (arg: N) => O, f13: (arg: M) => N, f12: (arg: L) => M, f11: (arg: K) => L, f10: (arg: J) => K, f9: (arg: I) => J, f8: (arg: H) => I, f7: (arg: G) => H, f6: (arg: F) => G, f5: (arg: E) => F, f4: (arg: D) => E, f3: (arg: C) => D, f2: (arg: B) => C, f1: (arg: A) => B): (x: A) => U;
42
50
  export declare function compose<T>(...fns: Array<(arg: T) => T>): (x: T) => T;
51
+ /**
52
+ * Creates a function that applies transformations to an object with shared context.
53
+ * @param transformers
54
+ */
43
55
  export declare const transform: <T, C = Record<string, unknown>>(...transformers: Array<(obj: T, context: C) => Partial<T>>) => (obj: T, context?: C) => T;
@@ -1,12 +1,17 @@
1
+ /** Utility functions for type checking component capabilities */
1
2
  import { ElementComponent } from "../component.js";
3
+ /** Interface for components with lifecycle */
2
4
  export interface ComponentWithLifecycle extends ElementComponent {
3
5
  lifecycle: {
4
6
  destroy: () => void;
5
7
  [key: string]: unknown;
6
8
  };
7
9
  }
10
+ /** Interface for components with emit method */
8
11
  export interface ComponentWithEmit extends ElementComponent {
9
12
  emit: (event: string, data: unknown) => unknown;
10
13
  }
14
+ /** Type guard to check if component has lifecycle */
11
15
  export declare function hasLifecycle(component: object): component is ComponentWithLifecycle;
16
+ /** Type guard to check if component has emit method */
12
17
  export declare function hasEmit(component: object): component is ComponentWithEmit;
@@ -1,4 +1,5 @@
1
1
  import type { EventCondition } from "../dom/create.js";
2
+ /** Base component configuration interface */
2
3
  export interface BaseComponentConfig {
3
4
  componentName?: string;
4
5
  class?: string | string[];
@@ -16,15 +17,31 @@ export interface BaseComponentConfig {
16
17
  ariaLabelledBy?: string;
17
18
  ariaHidden?: boolean;
18
19
  }
20
+ /**
21
+ * Creates a base configuration for any component
22
+ * @param defaults
23
+ * @param userConfig
24
+ * @param componentName
25
+ */
19
26
  export declare const createComponentConfig: <T extends BaseComponentConfig & object>(defaults: T, userConfig: Partial<T> | undefined, componentName: string) => T & {
20
27
  componentName: string;
21
28
  prefix: string;
22
29
  };
30
+ /**
31
+ * Processes class names for an element, handling arrays, nulls and conditional classes
32
+ * @param classNames
33
+ */
23
34
  export declare const processClassNames: (classNames: string | string[] | null) => string;
35
+ /**
36
+ * Creates a configuration object for withElement HOC
37
+ * @param config
38
+ * @param options
39
+ */
24
40
  export declare const createElementConfig: (config: BaseComponentConfig, options: {
25
41
  tag: string;
26
42
  attributes?: Record<string, unknown>;
27
43
  className?: string | (string | null | undefined)[] | null;
44
+ /** Styles the component computes for itself, as properties. */
28
45
  style?: Partial<CSSStyleDeclaration>;
29
46
  html?: string;
30
47
  text?: string;
@@ -1,6 +1,21 @@
1
+ /** Lightweight Global Configuration System for mtrl This system allows setting default configurations for all components without adding complexity or performance overhead. */
1
2
  export interface ComponentConfigMap {
2
3
  }
4
+ /**
5
+ * Sets global defaults for a specific component
6
+ * @param component
7
+ * @param config
8
+ */
3
9
  export declare function setComponentDefaults<K extends keyof ComponentConfigMap>(component: K, config: ComponentConfigMap[K]): void;
10
+ /**
11
+ * Gets global defaults for a component
12
+ * @param component
13
+ */
4
14
  export declare function getComponentDefaults<K extends keyof ComponentConfigMap>(component: K): ComponentConfigMap[K];
15
+ /**
16
+ * Sets global defaults for multiple components at once
17
+ * @param configs
18
+ */
5
19
  export declare function setGlobalDefaults(configs: Partial<ComponentConfigMap>): void;
20
+ /** Clears all global defaults */
6
21
  export declare function clearGlobalDefaults(): void;
@@ -1,12 +1,32 @@
1
+ /** Library prefix used for all components */
1
2
  export declare const PREFIX = "mtrl";
3
+ /**
4
+ * Gets a prefixed component class name
5
+ * @param type
6
+ */
2
7
  export declare const getComponentClass: (type: string) => string;
8
+ /**
9
+ * Gets a BEM modifier class name
10
+ * @param baseClass
11
+ * @param modifier
12
+ */
3
13
  export declare const getModifierClass: (baseClass: string, modifier: string) => string;
14
+ /**
15
+ * Gets a BEM element class name
16
+ * @param baseClass
17
+ * @param element
18
+ */
4
19
  export declare const getElementClass: (baseClass: string, element: string) => string;
20
+ /** Theme configuration interface */
5
21
  export interface ThemeConfig {
22
+ /** Theme name */
6
23
  name: string;
24
+ /** Theme CSS variables */
7
25
  variables: Record<string, string>;
26
+ /** Theme variants */
8
27
  variants: Record<string, unknown>;
9
28
  }
29
+ /** Component configuration interface */
10
30
  export interface ComponentConfig {
11
31
  prefix: string;
12
32
  type: string;
@@ -18,21 +38,35 @@ export interface ComponentConfig {
18
38
  withVariants: (...variants: string[]) => VariantComponentConfig;
19
39
  withStates: (...states: string[]) => StateComponentConfig;
20
40
  }
41
+ /** Themed component configuration interface */
21
42
  export interface ThemedComponentConfig extends ComponentConfig {
22
43
  theme: string;
23
44
  getThemeClass: (variant: string) => string;
24
45
  getCssVariables: () => Record<string, string>;
25
46
  }
47
+ /** Variant component configuration interface */
26
48
  export interface VariantComponentConfig extends ComponentConfig {
27
49
  variants: string[];
28
50
  hasVariant: (variant: string) => boolean;
29
51
  getVariantClass: (variant: string) => string | null;
30
52
  }
53
+ /** State component configuration interface */
31
54
  export interface StateComponentConfig extends ComponentConfig {
32
55
  states: string[];
33
56
  getStateClass: (state: string) => string | null;
34
57
  }
58
+ /** CSS class generation utilities */
35
59
  export declare const classNames: {
60
+ /**
61
+ * Creates a BEM-style class name
62
+ * @param block
63
+ * @param element
64
+ * @param modifier
65
+ */
36
66
  bem: (block: string, element?: string, modifier?: string) => string;
67
+ /**
68
+ * Joins class names, filtering out falsy values
69
+ * @param classes
70
+ */
37
71
  join: (...classes: (string | undefined | null | false)[]) => string;
38
72
  };
@@ -1,9 +1,34 @@
1
+ /**
2
+ * Set attributes on an element with performance optimizations
3
+ * @param element
4
+ * @param attributes
5
+ */
1
6
  export declare const setAttributes: <E extends HTMLElement | SVGElement>(element: E, attributes?: object) => E;
7
+ /**
8
+ * Remove attributes from an element
9
+ * @param element
10
+ * @param attributes
11
+ */
2
12
  export declare const removeAttributes: (element: HTMLElement, attributes?: string[]) => HTMLElement;
13
+ /**
14
+ * Batch attribute operations for better performance when setting many attributes
15
+ * @param element
16
+ */
3
17
  export declare const batchAttributes: (element: HTMLElement, operations: Array<{
4
18
  action: "set" | "remove";
5
19
  key: string;
6
20
  value?: unknown;
7
21
  }>) => HTMLElement;
22
+ /**
23
+ * Check if element has attribute
24
+ * @param element
25
+ * @param attribute
26
+ */
8
27
  export declare const hasAttribute: (element: HTMLElement, attribute: string) => boolean;
28
+ /**
29
+ * Get attribute value with default
30
+ * @param element
31
+ * @param attribute
32
+ * @param defaultValue
33
+ */
9
34
  export declare const getAttribute: (element: HTMLElement, attribute: string, defaultValue?: string) => string;
@@ -1,5 +1,29 @@
1
+ /**
2
+ * Normalize classes to array of unique strings with optimization and caching
3
+ * @param classes
4
+ */
1
5
  export declare const normalizeClasses: (...classes: (string | string[])[]) => string[];
6
+ /**
7
+ * Add prefixed classes to element with optimizations
8
+ * @param element
9
+ * @param classes
10
+ */
2
11
  export declare const addClass: (element: HTMLElement, ...classes: (string | string[])[]) => HTMLElement;
12
+ /**
13
+ * Remove prefixed classes from element with optimizations
14
+ * @param element
15
+ * @param classes
16
+ */
3
17
  export declare const removeClass: (element: HTMLElement, ...classes: (string | string[])[]) => HTMLElement;
18
+ /**
19
+ * Toggle prefixed classes on element with optimizations
20
+ * @param element
21
+ * @param classes
22
+ */
4
23
  export declare const toggleClass: (element: HTMLElement, ...classes: (string | string[])[]) => HTMLElement;
24
+ /**
25
+ * Check if element has all specified prefixed classes with optimizations
26
+ * @param element
27
+ * @param classes
28
+ */
5
29
  export declare const hasClass: (element: HTMLElement, ...classes: (string | string[])[]) => boolean;
@@ -1,51 +1,98 @@
1
+ /** Event handler function type */
1
2
  export type EventHandler = (event: Event) => void;
3
+ /** Element type that can be either HTMLElement or SVGElement */
2
4
  export type DOMElement = HTMLElement | SVGElement;
5
+ /** Component context passed to created elements for event forwarding */
3
6
  export interface ElementContext {
7
+ /** Emits forwarded events */
4
8
  emit?(event: string, data: ForwardedEventPayload): void;
9
+ /** Subscribes to events */
5
10
  on?(event: string, handler: (...args: unknown[]) => void): unknown;
6
11
  }
12
+ /** Event condition type */
7
13
  export type EventCondition = boolean | {
8
14
  condition(context: ElementContext & {
9
15
  element: DOMElement;
10
16
  }, event: Event): boolean;
11
17
  }["condition"];
18
+ /** Options for element creation with comprehensive configuration */
12
19
  export interface CreateElementOptions {
20
+ /** HTML tag name */
13
21
  tag?: string;
22
+ /** Container to append element to */
14
23
  container?: HTMLElement | null;
24
+ /** Inner HTML content */
15
25
  html?: string;
26
+ /** Text content */
16
27
  text?: string;
28
+ /** Element ID */
17
29
  id?: string;
30
+ /** Form element name */
18
31
  name?: string;
32
+ /** Element title (native browser tooltip on hover) */
19
33
  title?: string;
34
+ /** Keyboard navigation order (-1 to remove from tab order, 0+ for custom order) */
20
35
  tabIndex?: number;
36
+ /** Inline styles (string or object) */
37
+ /** Inline styles. */
21
38
  style?: Partial<CSSStyleDeclaration>;
39
+ /** Dataset attributes (e.g., { name: 'value' } → data-name="value") */
22
40
  data?: Record<string, string>;
41
+ /** ARIA role (e.g., 'button', 'menuitem', 'dialog') */
23
42
  role?: string;
43
+ /** Accessible label for screen readers */
24
44
  ariaLabel?: string;
45
+ /** ID of element that describes this element */
25
46
  ariaDescribedBy?: string;
47
+ /** ID of element that labels this element */
26
48
  ariaLabelledBy?: string;
49
+ /** Hide from screen readers */
27
50
  ariaHidden?: boolean;
51
+ /** CSS classes (will be automatically prefixed with 'mtrl-') - alias for className */
28
52
  class?: string | string[];
53
+ /** CSS classes (will be automatically prefixed with 'mtrl-') - alias for class */
29
54
  className?: string | string[];
55
+ /** HTML attributes */
30
56
  attributes?: object;
57
+ /** Events to forward when component has emit method */
31
58
  forwardEvents?: Record<string, EventCondition>;
59
+ /** Callback after element creation */
32
60
  onCreate?(element: HTMLElement, context?: ElementContext): void;
61
+ /** Component context */
33
62
  context?: ElementContext & object;
34
63
  }
64
+ /** Options for SVG element creation */
35
65
  export interface CreateSVGElementOptions extends Omit<CreateElementOptions, "container" | "onCreate"> {
36
66
  container?: DOMElement | null;
37
67
  onCreate?(element: SVGElement, context?: ElementContext): void;
38
68
  }
69
+ /** Event handler storage */
39
70
  export interface EventHandlerStorage {
40
71
  [eventName: string]: EventHandler;
41
72
  }
73
+ /** What `forwardEvents` hands the component's emitter. */
42
74
  export interface ForwardedEventPayload<E extends Event = Event, TElement extends DOMElement = DOMElement> {
75
+ /** The DOM event that triggered the forward. */
43
76
  event: E;
77
+ /** The element the listener is attached to, which is the component root. */
44
78
  element: TElement;
79
+ /** The same DOM event as `event`. */
45
80
  originalEvent: E;
46
81
  }
82
+ /**
83
+ * Create an HTML element with comprehensive options and optimizations
84
+ * @param options
85
+ */
47
86
  export declare const createElement: (options?: CreateElementOptions) => HTMLElement;
87
+ /**
88
+ * Create an SVG element
89
+ * @param options
90
+ */
48
91
  export declare const createSVGElement: (options?: CreateSVGElementOptions) => SVGElement;
92
+ /**
93
+ * Remove event handlers from an element
94
+ * @param element
95
+ */
49
96
  export declare const removeEventHandlers: (element: HTMLElement | SVGElement) => void;
50
97
  declare global {
51
98
  interface HTMLElement {
@@ -1,17 +1,43 @@
1
+ /** Event manager interface for handling DOM events */
1
2
  export interface EventManager {
3
+ /**
4
+ * Add an event listener with options
5
+ * @param event
6
+ * @param handler
7
+ * @param options
8
+ */
2
9
  on: <T extends Event>(event: string, handler: (e: T) => void, options?: AddEventListenerOptions) => EventManager;
10
+ /**
11
+ * Remove an event listener
12
+ * @param event
13
+ * @param handler
14
+ */
3
15
  off: <T extends Event>(event: string, handler: (e: T) => void) => EventManager;
16
+ /** Temporarily disable all event listeners */
4
17
  pause: () => EventManager;
18
+ /** Re-enable all event listeners */
5
19
  resume: () => EventManager;
20
+ /** Remove all event listeners and clean up */
6
21
  destroy: () => void;
22
+ /** Get all active handlers */
7
23
  getHandlers: () => Map<string, HandlerInfo>;
24
+ /**
25
+ * Check if a specific handler exists
26
+ * @param event
27
+ * @param handler
28
+ */
8
29
  hasHandler: <T extends Event>(event: string, handler: (e: T) => void) => boolean;
9
30
  }
31
+ /** Handler information */
10
32
  interface HandlerInfo {
11
33
  original: EventListener;
12
34
  enhanced: EventListener;
13
35
  event: string;
14
36
  options: AddEventListenerOptions;
15
37
  }
38
+ /**
39
+ * Creates an event manager to handle DOM events with enhanced functionality.
40
+ * @param element
41
+ */
16
42
  export declare const createEventManager: (element: HTMLElement) => EventManager;
17
43
  export {};
@@ -1,4 +1,15 @@
1
+ /**
2
+ * The focused element as seen from a node's own root: the shadow root it lives in, or the document.
3
+ * @param node
4
+ */
1
5
  export declare const activeElementOf: (node: Node) => Element | null;
6
+ /** The element that really has focus, looked for through open shadow roots: where focus goes back to after an overlay closes, when the overlay may sit in another root than whatever opened it. */
2
7
  export declare const deepActiveElement: () => Element | null;
8
+ /** The tab stops in a container, in the order Tab reaches them: through slots to what is assigned to them and into shadow roots, which is where the content of a web component sits. */
3
9
  export declare const tabStops: (container: Element) => HTMLElement[];
10
+ /**
11
+ * Keeps Tab inside a modal: from its last tab stop to its first, and Shift+Tab from the first (or the modal itself) to the last.
12
+ * @param container
13
+ * @param event
14
+ */
4
15
  export declare const wrapTab: (container: HTMLElement, event: KeyboardEvent) => void;
@@ -1,10 +1,16 @@
1
+ /** A value the browser's Trusted Types API accepts for innerHTML. */
1
2
  export interface TrustedHTMLLike {
2
3
  toString(): string;
3
4
  }
5
+ /** Markup a component accepts: a string, or a TrustedHTML from a policy. */
4
6
  export type HTMLInput = string | TrustedHTMLLike;
5
7
  export interface HTMLPolicy {
8
+ /** Called with every markup string before it is written. */
6
9
  sanitize: (html: string) => HTMLInput;
7
10
  }
11
+ /** Sets the policy every component's markup goes through, or clears it with null. */
8
12
  export declare const configureHTML: (next: HTMLPolicy | null) => void;
13
+ /** The policy in force, if any. */
9
14
  export declare const getHTMLPolicy: () => HTMLPolicy | null;
15
+ /** Writes markup into an element, through the policy when one is set. */
10
16
  export declare const setHTML: (element: Element, html: HTMLInput | null | undefined) => void;
@@ -1,21 +1,57 @@
1
+ /** How an element is promoted to the browser's top layer: */
1
2
  export type TopLayerKind = "popover-auto" | "popover-manual" | "modal";
2
3
  export interface TopLayerOptions {
3
4
  kind: TopLayerKind;
4
5
  }
5
6
  type Layered = Omit<HTMLElement, "showPopover"> & Partial<Pick<HTMLDialogElement & HTMLElement, "showModal" | "close" | "open" | "showPopover">>;
7
+ /**
8
+ * Whether the browser can show an element of this kind in the top layer: `showPopover` for the popovers, `HTMLDialogElement.prototype.showModal` for a modal.
9
+ * @param kind
10
+ */
6
11
  export declare const supportsTopLayer: (kind: TopLayerKind) => boolean;
12
+ /**
13
+ * Shows an element in the top layer, above everything else on the page whatever its z-index and whatever clips or transforms its ancestors.
14
+ * @param element
15
+ * @param options
16
+ */
7
17
  export declare const showInTopLayer: (element: Layered, { kind }: TopLayerOptions) => boolean;
18
+ /**
19
+ * Takes an element out of the top layer.
20
+ * @param element
21
+ */
8
22
  export declare const hideFromTopLayer: (element: Layered) => void;
23
+ /**
24
+ * Reports the closes the browser makes on its own: a light dismiss or Escape for `popover="auto"` (a `toggle` event to `closed`), Escape or a form for a modal dialog (its `close` event, which follows an uncanceled `cancel`).
25
+ * @param element
26
+ * @param callback
27
+ */
9
28
  export declare const onTopLayerClose: (element: HTMLElement, callback: () => void) => (() => void);
29
+ /** A modal outside the top layer: makes everything but `keep` inert, as showModal() does for a top-layer dialog. */
10
30
  export declare const inertOutside: (keep: Element) => (() => void);
31
+ /** What eventsFrom returns: see there. */
11
32
  export interface EventsFrom {
33
+ /** Whether the event's dispatch began after the call */
12
34
  after: (event: Event) => boolean;
35
+ /** Releases the marker. */
13
36
  stop: () => void;
14
37
  }
38
+ /**
39
+ * Tells the events that came after this call from the one that was already on its way: "the event that opened an overlay never dismisses it".
40
+ * @param element
41
+ */
15
42
  export declare const eventsFrom: (element: HTMLElement) => EventsFrom;
43
+ /** A modal's place in the Escape stack: see onModalEscape. */
16
44
  export interface ModalEscape {
45
+ /** True for the rest of the task the modal opened in, for the one event the marker cannot number: the `cancel` the browser sends the topmost modal `<dialog>` for the key press that opened it, when the page stopped that key press before it reached the window. */
17
46
  opening: boolean;
47
+ /** Takes the modal off the stack. */
18
48
  stop: () => void;
19
49
  }
50
+ /**
51
+ * Escape for a modal, handled as a key press.
52
+ * @param element
53
+ * @param escape
54
+ * @param d
55
+ */
20
56
  export declare const onModalEscape: (element: HTMLElement, escape: () => void, d?: (() => unknown) | false) => ModalEscape;
21
57
  export {};
@@ -1,11 +1,18 @@
1
+ /** Whether the arrow keys, Home and End belong to an element: a text input, a textarea or editable content, where they move the caret. */
1
2
  export declare const isTextEditable: (element: EventTarget | null | undefined) => boolean;
2
3
  export interface RovingOptions {
4
+ /** The composite: it receives the key and focus listeners. */
3
5
  container: HTMLElement;
6
+ /** The focus targets in order. */
4
7
  targets: () => HTMLElement[];
8
+ /** Whether Up and Down move focus instead of Left and Right. */
5
9
  vertical?: () => boolean;
6
10
  }
7
11
  export interface Roving {
12
+ /** Puts the one tab stop back on the current target, or the first enabled one. */
8
13
  sync(): void;
14
+ /** Removes the listeners. */
9
15
  destroy(): void;
10
16
  }
17
+ /** A roving tab index over a composite's focus targets (the WAI-ARIA toolbar pattern): one tab stop, kept on the target focused last; the arrow keys along the layout, Left and Right following the reading direction; Home and End to the ends. */
11
18
  export declare const createRoving: ({ container, targets, vertical }: RovingOptions) => Roving;