material 3.9.0 → 3.10.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (569) hide show
  1. package/README.md +5 -5
  2. package/dist/components/badge/index.d.ts +167 -3
  3. package/dist/components/bottom-app-bar/index.d.ts +141 -4
  4. package/dist/components/bottom-sheet/index.d.ts +114 -2
  5. package/dist/components/button/index.d.ts +10 -5
  6. package/dist/components/button-group/button-group.js +1 -0
  7. package/dist/components/button-group/config.js +9 -6
  8. package/dist/components/button-group/index.d.ts +250 -6
  9. package/dist/components/card/api.js +19 -0
  10. package/dist/components/card/index.d.ts +326 -5
  11. package/dist/components/carousel/features/slides.js +17 -7
  12. package/dist/components/carousel/index.d.ts +102 -3
  13. package/dist/components/checkbox/index.d.ts +217 -5
  14. package/dist/components/chips/chip/chip.js +4 -3
  15. package/dist/components/chips/index.d.ts +343 -3
  16. package/dist/components/datepicker/datepicker.js +62 -84
  17. package/dist/components/datepicker/index.d.ts +313 -2
  18. package/dist/components/datepicker/render.js +22 -18
  19. package/dist/components/datepicker/utils.js +66 -111
  20. package/dist/components/dialog/features.js +1 -1
  21. package/dist/components/dialog/index.d.ts +333 -3
  22. package/dist/components/divider/index.d.ts +99 -3
  23. package/dist/components/drawer/features/items.js +10 -2
  24. package/dist/components/drawer/index.d.ts +196 -3
  25. package/dist/components/extended-fab/index.d.ts +224 -2
  26. package/dist/components/fab/index.d.ts +183 -2
  27. package/dist/components/fab-menu/index.d.ts +106 -6
  28. package/dist/components/icon-button/index.d.ts +11 -4
  29. package/dist/components/list/features/anatomy.js +25 -6
  30. package/dist/components/list/features/selection.js +30 -2
  31. package/dist/components/list/index.d.ts +299 -6
  32. package/dist/components/loading-indicator/index.d.ts +94 -3
  33. package/dist/components/menu/features/controller.js +2 -0
  34. package/dist/components/menu/index.d.ts +10 -6
  35. package/dist/components/menu/types.d.ts +5 -0
  36. package/dist/components/navigation-bar/index.d.ts +70 -2
  37. package/dist/components/navigation-rail/index.d.ts +98 -2
  38. package/dist/components/progress/index.d.ts +9 -2
  39. package/dist/components/radios/index.d.ts +158 -3
  40. package/dist/components/search/features/states.js +3 -3
  41. package/dist/components/search/features/structure.js +24 -4
  42. package/dist/components/search/features/suggestions.js +4 -0
  43. package/dist/components/search/index.d.ts +255 -2
  44. package/dist/components/select/index.d.ts +252 -6
  45. package/dist/components/side-sheet/index.d.ts +104 -2
  46. package/dist/components/slider/index.d.ts +236 -2
  47. package/dist/components/snackbar/api.js +26 -0
  48. package/dist/components/snackbar/constants.d.ts +4 -0
  49. package/dist/components/snackbar/constants.js +3 -1
  50. package/dist/components/snackbar/index.d.ts +215 -4
  51. package/dist/components/split-button/index.d.ts +10 -3
  52. package/dist/components/switch/index.d.ts +190 -3
  53. package/dist/components/tabs/index.d.ts +476 -12
  54. package/dist/components/tabs/index.js +1 -1
  55. package/dist/components/tabs/responsive-legacy.js +65 -0
  56. package/dist/components/tabs/responsive.d.ts +7 -32
  57. package/dist/components/tabs/responsive.js +4 -63
  58. package/dist/components/tabs/tabs.js +1 -0
  59. package/dist/components/text-field/config.js +3 -4
  60. package/dist/components/text-field/features/field.js +61 -0
  61. package/dist/components/text-field/features/leading-icon.js +12 -45
  62. package/dist/components/text-field/features/prefix-text.js +6 -40
  63. package/dist/components/text-field/features/suffix-text.js +6 -40
  64. package/dist/components/text-field/index.d.ts +345 -3
  65. package/dist/components/timepicker/constants.d.ts +4 -4
  66. package/dist/components/timepicker/constants.js +2 -2
  67. package/dist/components/timepicker/index.d.ts +279 -5
  68. package/dist/components/timepicker/render.js +4 -1
  69. package/dist/components/toolbar/index.d.ts +145 -6
  70. package/dist/components/tooltip/index.d.ts +155 -3
  71. package/dist/components/top-app-bar/index.d.ts +92 -5
  72. package/dist/core/canvas/index.d.ts +172 -5
  73. package/dist/core/compose/features/icon-opt-in.js +5 -0
  74. package/dist/core/compose/features/icon-slot.js +100 -0
  75. package/dist/core/compose/features/textinput.js +2 -0
  76. package/dist/core/compose/features/track.js +4 -0
  77. package/dist/core/compose/index.d.ts +744 -8
  78. package/dist/core/dom/index.d.ts +245 -12
  79. package/dist/core/index.d.ts +93 -14
  80. package/dist/core/shapes/index.d.ts +286 -6
  81. package/dist/core/state/index.d.ts +98 -5
  82. package/dist/core/theme/index.d.ts +80 -4
  83. package/dist/core/utils/index.d.ts +98 -9
  84. package/dist/elements/css/bottom-sheet.css +1 -1
  85. package/dist/elements/css/button-group.css +1 -1
  86. package/dist/elements/css/button.css +1 -1
  87. package/dist/elements/css/datepicker.css +1 -1
  88. package/dist/elements/css/dialog.css +1 -1
  89. package/dist/elements/css/drawer.css +1 -1
  90. package/dist/elements/css/icon-button.css +1 -1
  91. package/dist/elements/css/list.css +1 -1
  92. package/dist/elements/css/menu.css +1 -1
  93. package/dist/elements/css/side-sheet.css +1 -1
  94. package/dist/elements/css/snackbar.css +1 -1
  95. package/dist/elements/css/text-field.css +1 -1
  96. package/dist/elements/css/timepicker.css +1 -1
  97. package/dist/elements/css/toolbar.css +1 -1
  98. package/dist/elements/datepicker.js +1 -0
  99. package/dist/elements/define.js +12 -1
  100. package/dist/elements/drawer.js +2 -0
  101. package/dist/elements/index.d.ts +3974 -107
  102. package/dist/elements/preupgrade/badge.css +1 -1
  103. package/dist/elements/preupgrade/bottom-app-bar.css +1 -1
  104. package/dist/elements/preupgrade/bottom-sheet.css +1 -1
  105. package/dist/elements/preupgrade/button-group.css +2 -2
  106. package/dist/elements/preupgrade/button.css +2 -2
  107. package/dist/elements/preupgrade/card.css +1 -1
  108. package/dist/elements/preupgrade/carousel.css +1 -1
  109. package/dist/elements/preupgrade/checkbox.css +1 -1
  110. package/dist/elements/preupgrade/chips.css +1 -1
  111. package/dist/elements/preupgrade/datepicker.css +1 -1
  112. package/dist/elements/preupgrade/dialog.css +1 -1
  113. package/dist/elements/preupgrade/divider.css +1 -1
  114. package/dist/elements/preupgrade/drawer.css +2 -2
  115. package/dist/elements/preupgrade/extended-fab.css +1 -1
  116. package/dist/elements/preupgrade/fab-menu.css +1 -1
  117. package/dist/elements/preupgrade/fab.css +1 -1
  118. package/dist/elements/preupgrade/icon-button.css +2 -2
  119. package/dist/elements/preupgrade/list.css +2 -2
  120. package/dist/elements/preupgrade/loading-indicator.css +1 -1
  121. package/dist/elements/preupgrade/menu.css +1 -1
  122. package/dist/elements/preupgrade/navigation-bar.css +1 -1
  123. package/dist/elements/preupgrade/navigation-rail.css +1 -1
  124. package/dist/elements/preupgrade/progress.css +1 -1
  125. package/dist/elements/preupgrade/radios.css +1 -1
  126. package/dist/elements/preupgrade/search.css +1 -1
  127. package/dist/elements/preupgrade/select.css +2 -2
  128. package/dist/elements/preupgrade/side-sheet.css +1 -1
  129. package/dist/elements/preupgrade/slider.css +1 -1
  130. package/dist/elements/preupgrade/snackbar.css +1 -1
  131. package/dist/elements/preupgrade/split-button.css +1 -1
  132. package/dist/elements/preupgrade/switch.css +1 -1
  133. package/dist/elements/preupgrade/tabs.css +1 -1
  134. package/dist/elements/preupgrade/text-field.css +2 -2
  135. package/dist/elements/preupgrade/timepicker.css +1 -1
  136. package/dist/elements/preupgrade/toolbar.css +1 -1
  137. package/dist/elements/preupgrade/tooltip.css +1 -1
  138. package/dist/elements/preupgrade/top-app-bar.css +1 -1
  139. package/dist/elements/preupgrade.css +2 -2
  140. package/dist/elements/snackbar.js +2 -0
  141. package/dist/elements/styles.js +15 -15
  142. package/dist/elements/text-field.js +2 -0
  143. package/dist/index.d.ts +78 -4
  144. package/dist/react/index.d.ts +106 -52
  145. package/dist/react/jsx.d.ts +49 -49
  146. package/dist/solid/index.d.ts +106 -52
  147. package/dist/solid/jsx.d.ts +51 -50
  148. package/dist/styles/badge.css +1 -1
  149. package/dist/styles/base-lite.css +2 -2
  150. package/dist/styles/base.css +2 -2
  151. package/dist/styles/bottom-app-bar.css +1 -1
  152. package/dist/styles/bottom-sheet.css +2 -2
  153. package/dist/styles/button-group.css +2 -2
  154. package/dist/styles/button.css +2 -2
  155. package/dist/styles/card.css +1 -1
  156. package/dist/styles/carousel.css +1 -1
  157. package/dist/styles/checkbox.css +1 -1
  158. package/dist/styles/chips.css +1 -1
  159. package/dist/styles/contrast.css +1 -1
  160. package/dist/styles/datepicker.css +2 -2
  161. package/dist/styles/dialog.css +2 -2
  162. package/dist/styles/divider.css +1 -1
  163. package/dist/styles/drawer.css +2 -2
  164. package/dist/styles/extended-fab.css +1 -1
  165. package/dist/styles/fab-menu.css +1 -1
  166. package/dist/styles/fab.css +1 -1
  167. package/dist/styles/icon-button.css +2 -2
  168. package/dist/styles/list.css +2 -2
  169. package/dist/styles/loading-indicator.css +1 -1
  170. package/dist/styles/menu.css +2 -2
  171. package/dist/styles/navigation-bar.css +1 -1
  172. package/dist/styles/navigation-rail.css +1 -1
  173. package/dist/styles/progress.css +1 -1
  174. package/dist/styles/radios.css +1 -1
  175. package/dist/styles/search.css +1 -1
  176. package/dist/styles/select.css +1 -1
  177. package/dist/styles/side-sheet.css +2 -2
  178. package/dist/styles/slider.css +1 -1
  179. package/dist/styles/snackbar.css +2 -2
  180. package/dist/styles/split-button.css +1 -1
  181. package/dist/styles/switch.css +1 -1
  182. package/dist/styles/tabs.css +1 -1
  183. package/dist/styles/text-field.css +2 -2
  184. package/dist/styles/timepicker.css +2 -2
  185. package/dist/styles/toolbar.css +2 -2
  186. package/dist/styles/tooltip.css +1 -1
  187. package/dist/styles/top-app-bar.css +1 -1
  188. package/dist/styles/typography.css +1 -1
  189. package/dist/styles/utilities.css +1 -1
  190. package/dist/styles.css +2 -2
  191. package/dist/themes/autumn-contrast.css +1 -1
  192. package/dist/themes/autumn.css +1 -1
  193. package/dist/themes/baseline-contrast.css +1 -1
  194. package/dist/themes/baseline.css +1 -1
  195. package/dist/themes/brownbeige-contrast.css +1 -1
  196. package/dist/themes/brownbeige.css +1 -1
  197. package/dist/themes/content-contrast.css +1 -1
  198. package/dist/themes/content.css +1 -1
  199. package/dist/themes/desert-contrast.css +1 -1
  200. package/dist/themes/desert.css +1 -1
  201. package/dist/themes/expressive-contrast.css +1 -1
  202. package/dist/themes/expressive.css +1 -1
  203. package/dist/themes/fidelity-contrast.css +1 -1
  204. package/dist/themes/fidelity.css +1 -1
  205. package/dist/themes/forest-contrast.css +1 -1
  206. package/dist/themes/forest.css +1 -1
  207. package/dist/themes/fruit-salad-contrast.css +1 -1
  208. package/dist/themes/fruit-salad.css +1 -1
  209. package/dist/themes/highcontrast-contrast.css +1 -1
  210. package/dist/themes/highcontrast.css +1 -1
  211. package/dist/themes/monochrome-contrast.css +1 -1
  212. package/dist/themes/monochrome.css +1 -1
  213. package/dist/themes/neutral-contrast.css +1 -1
  214. package/dist/themes/neutral.css +1 -1
  215. package/dist/themes/ocean-contrast.css +1 -1
  216. package/dist/themes/ocean.css +1 -1
  217. package/dist/themes/rainbow-contrast.css +1 -1
  218. package/dist/themes/rainbow.css +1 -1
  219. package/dist/themes/sageivory-contrast.css +1 -1
  220. package/dist/themes/sageivory.css +1 -1
  221. package/dist/themes/spring-contrast.css +1 -1
  222. package/dist/themes/spring.css +1 -1
  223. package/dist/themes/summer-contrast.css +1 -1
  224. package/dist/themes/summer.css +1 -1
  225. package/dist/themes/sunset-contrast.css +1 -1
  226. package/dist/themes/sunset.css +1 -1
  227. package/dist/themes/tealcaramel-contrast.css +1 -1
  228. package/dist/themes/tealcaramel.css +1 -1
  229. package/dist/themes/vibrant-contrast.css +1 -1
  230. package/dist/themes/vibrant.css +1 -1
  231. package/dist/vue/index.d.ts +192 -53
  232. package/package.json +5 -1
  233. package/src/styles/abstract/_functions.scss +22 -1
  234. package/src/styles/abstract/_variables.scss +0 -2
  235. package/src/styles/base/_tokens.scss +12 -0
  236. package/src/styles/components/_bottom-sheet.scss +1 -0
  237. package/src/styles/components/_button-group.scss +9 -5
  238. package/src/styles/components/_button.scss +9 -12
  239. package/src/styles/components/_datepicker.scss +1 -0
  240. package/src/styles/components/_dialog.scss +1 -0
  241. package/src/styles/components/_drawer.scss +33 -65
  242. package/src/styles/components/_icon-button.scss +32 -33
  243. package/src/styles/components/_list.scss +19 -5
  244. package/src/styles/components/_menu.scss +1 -0
  245. package/src/styles/components/_side-sheet.scss +1 -0
  246. package/src/styles/components/_snackbar.scss +1 -0
  247. package/src/styles/components/_text-field.scss +17 -109
  248. package/src/styles/components/_timepicker.scss +2 -1
  249. package/src/styles/components/_toolbar.scss +4 -4
  250. package/src/styles/elements/_button-group.scss +17 -4
  251. package/src/styles/elements/_button.scss +3 -2
  252. package/src/styles/elements/_drawer.scss +2 -1
  253. package/src/styles/elements/_field.scss +25 -14
  254. package/src/styles/elements/_icon-button.scss +8 -3
  255. package/src/styles/elements/_list.scss +3 -2
  256. package/src/styles/elements/_text-field.scss +71 -47
  257. package/dist/components/badge/badge.d.ts +0 -7
  258. package/dist/components/badge/types.d.ts +0 -152
  259. package/dist/components/bottom-app-bar/bottom-app-bar.d.ts +0 -12
  260. package/dist/components/bottom-app-bar/types.d.ts +0 -124
  261. package/dist/components/bottom-sheet/bottom-sheet.d.ts +0 -7
  262. package/dist/components/bottom-sheet/types.d.ts +0 -100
  263. package/dist/components/button/button.d.ts +0 -7
  264. package/dist/components/button-group/button-group.d.ts +0 -7
  265. package/dist/components/button-group/types.d.ts +0 -227
  266. package/dist/components/card/card.d.ts +0 -7
  267. package/dist/components/card/content.d.ts +0 -22
  268. package/dist/components/card/types.d.ts +0 -272
  269. package/dist/components/carousel/carousel.d.ts +0 -4
  270. package/dist/components/carousel/types.d.ts +0 -81
  271. package/dist/components/checkbox/checkbox.d.ts +0 -8
  272. package/dist/components/checkbox/types.d.ts +0 -199
  273. package/dist/components/chips/chips.d.ts +0 -7
  274. package/dist/components/chips/factories.d.ts +0 -9
  275. package/dist/components/chips/types.d.ts +0 -304
  276. package/dist/components/datepicker/datepicker.d.ts +0 -7
  277. package/dist/components/datepicker/types.d.ts +0 -300
  278. package/dist/components/datepicker/types.js +0 -17
  279. package/dist/components/dialog/dialog.d.ts +0 -8
  280. package/dist/components/dialog/types.d.ts +0 -311
  281. package/dist/components/divider/config.d.ts +0 -43
  282. package/dist/components/divider/divider.d.ts +0 -7
  283. package/dist/components/divider/types.d.ts +0 -43
  284. package/dist/components/drawer/drawer.d.ts +0 -7
  285. package/dist/components/drawer/types.d.ts +0 -179
  286. package/dist/components/extended-fab/extended-fab.d.ts +0 -7
  287. package/dist/components/extended-fab/types.d.ts +0 -208
  288. package/dist/components/fab/fab.d.ts +0 -7
  289. package/dist/components/fab/types.d.ts +0 -168
  290. package/dist/components/fab-menu/fab-menu.d.ts +0 -8
  291. package/dist/components/fab-menu/types.d.ts +0 -91
  292. package/dist/components/icon-button/icon-button.d.ts +0 -7
  293. package/dist/components/index.d.ts +0 -82
  294. package/dist/components/list/features/listbox.d.ts +0 -16
  295. package/dist/components/list/list.d.ts +0 -7
  296. package/dist/components/list/types.d.ts +0 -257
  297. package/dist/components/loading-indicator/features/renderer.d.ts +0 -28
  298. package/dist/components/loading-indicator/loading-indicator.d.ts +0 -7
  299. package/dist/components/loading-indicator/types.d.ts +0 -53
  300. package/dist/components/menu/menu.d.ts +0 -7
  301. package/dist/components/navigation-bar/navigation-bar.d.ts +0 -3
  302. package/dist/components/navigation-bar/types.d.ts +0 -59
  303. package/dist/components/navigation-rail/navigation-rail.d.ts +0 -3
  304. package/dist/components/navigation-rail/types.d.ts +0 -87
  305. package/dist/components/progress/progress.d.ts +0 -7
  306. package/dist/components/radios/radios.d.ts +0 -7
  307. package/dist/components/radios/types.d.ts +0 -144
  308. package/dist/components/search/search.d.ts +0 -7
  309. package/dist/components/search/types.d.ts +0 -235
  310. package/dist/components/select/select.d.ts +0 -7
  311. package/dist/components/select/types.d.ts +0 -232
  312. package/dist/components/side-sheet/side-sheet.d.ts +0 -7
  313. package/dist/components/side-sheet/types.d.ts +0 -91
  314. package/dist/components/slider/slider.d.ts +0 -7
  315. package/dist/components/slider/types.d.ts +0 -218
  316. package/dist/components/snackbar/snackbar.d.ts +0 -9
  317. package/dist/components/snackbar/types.d.ts +0 -180
  318. package/dist/components/split-button/split-button.d.ts +0 -7
  319. package/dist/components/switch/switch.d.ts +0 -7
  320. package/dist/components/switch/types.d.ts +0 -171
  321. package/dist/components/tabs/indicator.d.ts +0 -44
  322. package/dist/components/tabs/tab.d.ts +0 -7
  323. package/dist/components/tabs/tabs.d.ts +0 -7
  324. package/dist/components/tabs/types.d.ts +0 -304
  325. package/dist/components/tabs/utils.d.ts +0 -46
  326. package/dist/components/text-field/features/trailing-icon.d.ts +0 -54
  327. package/dist/components/text-field/text-field.d.ts +0 -7
  328. package/dist/components/text-field/types.d.ts +0 -261
  329. package/dist/components/timepicker/timepicker.d.ts +0 -3
  330. package/dist/components/timepicker/types.d.ts +0 -258
  331. package/dist/components/toolbar/toolbar.d.ts +0 -8
  332. package/dist/components/toolbar/types.d.ts +0 -129
  333. package/dist/components/tooltip/tooltip.d.ts +0 -7
  334. package/dist/components/tooltip/types.d.ts +0 -137
  335. package/dist/components/top-app-bar/top-app-bar.d.ts +0 -7
  336. package/dist/components/top-app-bar/types.d.ts +0 -80
  337. package/dist/core/canvas/animation.d.ts +0 -20
  338. package/dist/core/canvas/drawing.d.ts +0 -67
  339. package/dist/core/canvas/resize.d.ts +0 -8
  340. package/dist/core/canvas/utils.d.ts +0 -62
  341. package/dist/core/compose/base.d.ts +0 -18
  342. package/dist/core/compose/features/badge.d.ts +0 -27
  343. package/dist/core/compose/features/checkable.d.ts +0 -33
  344. package/dist/core/compose/features/debounce.d.ts +0 -45
  345. package/dist/core/compose/features/disabled.d.ts +0 -26
  346. package/dist/core/compose/features/events.d.ts +0 -31
  347. package/dist/core/compose/features/index.d.ts +0 -34
  348. package/dist/core/compose/features/input.d.ts +0 -54
  349. package/dist/core/compose/features/lifecycle.d.ts +0 -41
  350. package/dist/core/compose/features/position.d.ts +0 -36
  351. package/dist/core/compose/features/ripple.d.ts +0 -35
  352. package/dist/core/compose/features/size.d.ts +0 -12
  353. package/dist/core/compose/features/style.d.ts +0 -11
  354. package/dist/core/compose/features/textinput.d.ts +0 -66
  355. package/dist/core/compose/features/textlabel.d.ts +0 -34
  356. package/dist/core/compose/features/throttle.d.ts +0 -38
  357. package/dist/core/compose/features/track.d.ts +0 -24
  358. package/dist/core/compose/features/variant.d.ts +0 -12
  359. package/dist/core/compose/features/withEvents.d.ts +0 -27
  360. package/dist/core/compose/pipe.d.ts +0 -55
  361. package/dist/core/compose/utils/type-guards.d.ts +0 -17
  362. package/dist/core/config.d.ts +0 -72
  363. package/dist/core/dom/attributes.d.ts +0 -34
  364. package/dist/core/dom/classes.d.ts +0 -29
  365. package/dist/core/dom/events.d.ts +0 -43
  366. package/dist/core/dom/focus.d.ts +0 -15
  367. package/dist/core/dom/html.d.ts +0 -16
  368. package/dist/core/dom/layer.d.ts +0 -57
  369. package/dist/core/dom/roving.d.ts +0 -18
  370. package/dist/core/shapes/cubic.d.ts +0 -45
  371. package/dist/core/shapes/material.d.ts +0 -131
  372. package/dist/core/shapes/polygon.d.ts +0 -38
  373. package/dist/core/state/events.d.ts +0 -25
  374. package/dist/core/state/store.d.ts +0 -60
  375. package/dist/core/theme/shape.d.ts +0 -5
  376. package/dist/core/theme/tokens.d.ts +0 -67
  377. package/dist/core/utils/background.d.ts +0 -13
  378. package/dist/core/utils/color.d.ts +0 -6
  379. package/dist/core/utils/object.d.ts +0 -11
  380. package/dist/core/utils/performance.d.ts +0 -32
  381. package/dist/core/utils/theme.d.ts +0 -17
  382. package/dist/core/utils/url.d.ts +0 -6
  383. package/dist/elements/badge.d.ts +0 -57
  384. package/dist/elements/bottom-app-bar.d.ts +0 -66
  385. package/dist/elements/bottom-sheet.d.ts +0 -107
  386. package/dist/elements/button-group.d.ts +0 -142
  387. package/dist/elements/button.d.ts +0 -101
  388. package/dist/elements/card.d.ts +0 -69
  389. package/dist/elements/carousel.d.ts +0 -119
  390. package/dist/elements/checkbox.d.ts +0 -97
  391. package/dist/elements/chips.d.ts +0 -126
  392. package/dist/elements/datepicker.d.ts +0 -131
  393. package/dist/elements/dialog.d.ts +0 -101
  394. package/dist/elements/divider.d.ts +0 -52
  395. package/dist/elements/drawer.d.ts +0 -119
  396. package/dist/elements/extended-fab.d.ts +0 -97
  397. package/dist/elements/fab-menu.d.ts +0 -102
  398. package/dist/elements/fab.d.ts +0 -71
  399. package/dist/elements/list.d.ts +0 -127
  400. package/dist/elements/loading-indicator.d.ts +0 -47
  401. package/dist/elements/menu.d.ts +0 -144
  402. package/dist/elements/navigation-bar.d.ts +0 -104
  403. package/dist/elements/navigation-rail.d.ts +0 -145
  404. package/dist/elements/progress.d.ts +0 -87
  405. package/dist/elements/radios.d.ts +0 -92
  406. package/dist/elements/search.d.ts +0 -202
  407. package/dist/elements/select.d.ts +0 -119
  408. package/dist/elements/side-sheet.d.ts +0 -86
  409. package/dist/elements/slider.d.ts +0 -160
  410. package/dist/elements/snackbar.d.ts +0 -87
  411. package/dist/elements/split-button.d.ts +0 -87
  412. package/dist/elements/switch.d.ts +0 -98
  413. package/dist/elements/tabs.d.ts +0 -76
  414. package/dist/elements/text-field.d.ts +0 -170
  415. package/dist/elements/timepicker.d.ts +0 -148
  416. package/dist/elements/toolbar.d.ts +0 -98
  417. package/dist/elements/tooltip.d.ts +0 -75
  418. package/dist/elements/top-app-bar.d.ts +0 -60
  419. package/dist/react/badge.d.ts +0 -4
  420. package/dist/react/bottom-app-bar.d.ts +0 -5
  421. package/dist/react/bottom-sheet.d.ts +0 -4
  422. package/dist/react/button-group-item.d.ts +0 -3
  423. package/dist/react/button-group.d.ts +0 -7
  424. package/dist/react/button.d.ts +0 -5
  425. package/dist/react/card.d.ts +0 -4
  426. package/dist/react/carousel-item.d.ts +0 -3
  427. package/dist/react/carousel.d.ts +0 -4
  428. package/dist/react/checkbox.d.ts +0 -4
  429. package/dist/react/chip.d.ts +0 -3
  430. package/dist/react/chips.d.ts +0 -4
  431. package/dist/react/datepicker.d.ts +0 -4
  432. package/dist/react/dialog.d.ts +0 -7
  433. package/dist/react/divider.d.ts +0 -4
  434. package/dist/react/drawer-item.d.ts +0 -3
  435. package/dist/react/drawer.d.ts +0 -4
  436. package/dist/react/extended-fab.d.ts +0 -4
  437. package/dist/react/fab-menu-item.d.ts +0 -3
  438. package/dist/react/fab-menu.d.ts +0 -6
  439. package/dist/react/fab.d.ts +0 -4
  440. package/dist/react/icon-button.d.ts +0 -4
  441. package/dist/react/list-item.d.ts +0 -3
  442. package/dist/react/list.d.ts +0 -4
  443. package/dist/react/loading-indicator.d.ts +0 -4
  444. package/dist/react/menu-item.d.ts +0 -3
  445. package/dist/react/menu.d.ts +0 -4
  446. package/dist/react/navigation-bar-item.d.ts +0 -3
  447. package/dist/react/navigation-bar.d.ts +0 -4
  448. package/dist/react/navigation-rail-item.d.ts +0 -3
  449. package/dist/react/navigation-rail.d.ts +0 -4
  450. package/dist/react/progress.d.ts +0 -4
  451. package/dist/react/radio.d.ts +0 -3
  452. package/dist/react/radios.d.ts +0 -4
  453. package/dist/react/search-suggestion.d.ts +0 -3
  454. package/dist/react/search.d.ts +0 -4
  455. package/dist/react/select-option.d.ts +0 -3
  456. package/dist/react/select.d.ts +0 -6
  457. package/dist/react/side-sheet.d.ts +0 -4
  458. package/dist/react/slider.d.ts +0 -4
  459. package/dist/react/snackbar.d.ts +0 -7
  460. package/dist/react/split-button.d.ts +0 -7
  461. package/dist/react/switch.d.ts +0 -4
  462. package/dist/react/tab.d.ts +0 -3
  463. package/dist/react/tabs.d.ts +0 -7
  464. package/dist/react/text-field.d.ts +0 -4
  465. package/dist/react/timepicker.d.ts +0 -4
  466. package/dist/react/toolbar.d.ts +0 -5
  467. package/dist/react/tooltip.d.ts +0 -4
  468. package/dist/react/top-app-bar.d.ts +0 -4
  469. package/dist/solid/badge.d.ts +0 -4
  470. package/dist/solid/bottom-app-bar.d.ts +0 -5
  471. package/dist/solid/bottom-sheet.d.ts +0 -4
  472. package/dist/solid/button-group-item.d.ts +0 -3
  473. package/dist/solid/button-group.d.ts +0 -7
  474. package/dist/solid/button.d.ts +0 -5
  475. package/dist/solid/card.d.ts +0 -4
  476. package/dist/solid/carousel-item.d.ts +0 -3
  477. package/dist/solid/carousel.d.ts +0 -4
  478. package/dist/solid/checkbox.d.ts +0 -4
  479. package/dist/solid/chip.d.ts +0 -3
  480. package/dist/solid/chips.d.ts +0 -4
  481. package/dist/solid/datepicker.d.ts +0 -4
  482. package/dist/solid/dialog.d.ts +0 -7
  483. package/dist/solid/divider.d.ts +0 -4
  484. package/dist/solid/drawer-item.d.ts +0 -3
  485. package/dist/solid/drawer.d.ts +0 -4
  486. package/dist/solid/extended-fab.d.ts +0 -4
  487. package/dist/solid/fab-menu-item.d.ts +0 -3
  488. package/dist/solid/fab-menu.d.ts +0 -6
  489. package/dist/solid/fab.d.ts +0 -4
  490. package/dist/solid/icon-button.d.ts +0 -4
  491. package/dist/solid/list-item.d.ts +0 -3
  492. package/dist/solid/list.d.ts +0 -4
  493. package/dist/solid/loading-indicator.d.ts +0 -4
  494. package/dist/solid/menu-item.d.ts +0 -3
  495. package/dist/solid/menu.d.ts +0 -4
  496. package/dist/solid/navigation-bar-item.d.ts +0 -3
  497. package/dist/solid/navigation-bar.d.ts +0 -4
  498. package/dist/solid/navigation-rail-item.d.ts +0 -3
  499. package/dist/solid/navigation-rail.d.ts +0 -4
  500. package/dist/solid/progress.d.ts +0 -4
  501. package/dist/solid/radio.d.ts +0 -3
  502. package/dist/solid/radios.d.ts +0 -4
  503. package/dist/solid/search-suggestion.d.ts +0 -3
  504. package/dist/solid/search.d.ts +0 -4
  505. package/dist/solid/select-option.d.ts +0 -3
  506. package/dist/solid/select.d.ts +0 -6
  507. package/dist/solid/side-sheet.d.ts +0 -4
  508. package/dist/solid/slider.d.ts +0 -4
  509. package/dist/solid/snackbar.d.ts +0 -7
  510. package/dist/solid/split-button.d.ts +0 -7
  511. package/dist/solid/switch.d.ts +0 -4
  512. package/dist/solid/tab.d.ts +0 -3
  513. package/dist/solid/tabs.d.ts +0 -7
  514. package/dist/solid/text-field.d.ts +0 -4
  515. package/dist/solid/timepicker.d.ts +0 -4
  516. package/dist/solid/toolbar.d.ts +0 -5
  517. package/dist/solid/tooltip.d.ts +0 -4
  518. package/dist/solid/top-app-bar.d.ts +0 -4
  519. package/dist/vue/badge.d.ts +0 -4
  520. package/dist/vue/bottom-app-bar.d.ts +0 -5
  521. package/dist/vue/bottom-sheet.d.ts +0 -4
  522. package/dist/vue/button-group-item.d.ts +0 -3
  523. package/dist/vue/button-group.d.ts +0 -7
  524. package/dist/vue/button.d.ts +0 -5
  525. package/dist/vue/card.d.ts +0 -4
  526. package/dist/vue/carousel-item.d.ts +0 -3
  527. package/dist/vue/carousel.d.ts +0 -4
  528. package/dist/vue/checkbox.d.ts +0 -4
  529. package/dist/vue/chip.d.ts +0 -3
  530. package/dist/vue/chips.d.ts +0 -4
  531. package/dist/vue/create.d.ts +0 -73
  532. package/dist/vue/datepicker.d.ts +0 -4
  533. package/dist/vue/dialog.d.ts +0 -7
  534. package/dist/vue/divider.d.ts +0 -4
  535. package/dist/vue/drawer-item.d.ts +0 -3
  536. package/dist/vue/drawer.d.ts +0 -4
  537. package/dist/vue/extended-fab.d.ts +0 -4
  538. package/dist/vue/fab-menu-item.d.ts +0 -3
  539. package/dist/vue/fab-menu.d.ts +0 -6
  540. package/dist/vue/fab.d.ts +0 -4
  541. package/dist/vue/icon-button.d.ts +0 -4
  542. package/dist/vue/list-item.d.ts +0 -3
  543. package/dist/vue/list.d.ts +0 -4
  544. package/dist/vue/loading-indicator.d.ts +0 -4
  545. package/dist/vue/menu-item.d.ts +0 -3
  546. package/dist/vue/menu.d.ts +0 -4
  547. package/dist/vue/navigation-bar-item.d.ts +0 -3
  548. package/dist/vue/navigation-bar.d.ts +0 -4
  549. package/dist/vue/navigation-rail-item.d.ts +0 -3
  550. package/dist/vue/navigation-rail.d.ts +0 -4
  551. package/dist/vue/progress.d.ts +0 -4
  552. package/dist/vue/radio.d.ts +0 -3
  553. package/dist/vue/radios.d.ts +0 -4
  554. package/dist/vue/search-suggestion.d.ts +0 -3
  555. package/dist/vue/search.d.ts +0 -4
  556. package/dist/vue/select-option.d.ts +0 -3
  557. package/dist/vue/select.d.ts +0 -6
  558. package/dist/vue/side-sheet.d.ts +0 -4
  559. package/dist/vue/slider.d.ts +0 -4
  560. package/dist/vue/snackbar.d.ts +0 -7
  561. package/dist/vue/split-button.d.ts +0 -7
  562. package/dist/vue/switch.d.ts +0 -4
  563. package/dist/vue/tab.d.ts +0 -3
  564. package/dist/vue/tabs.d.ts +0 -7
  565. package/dist/vue/text-field.d.ts +0 -4
  566. package/dist/vue/timepicker.d.ts +0 -4
  567. package/dist/vue/toolbar.d.ts +0 -5
  568. package/dist/vue/tooltip.d.ts +0 -4
  569. package/dist/vue/top-app-bar.d.ts +0 -4
package/README.md CHANGED
@@ -94,11 +94,11 @@ What a bundler keeps, minified and gzipped (kB is 1,000 bytes), measured from th
94
94
  | `createButton` from `material`, with code splitting: the initial chunks (the progress indicator loads on demand) | 7.6 kB |
95
95
  | `createButton`, without code splitting (the progress indicator included) | 13.9 kB |
96
96
  | `createButton`, `createTextField` and `createCheckbox`, without code splitting | 20.4 kB |
97
- | Everything the root exports (`export * from 'material'`), without code splitting | 129.3 kB |
98
- | `material/styles/base` | 3.0 kB |
99
- | `material/styles/base-lite` | 1.6 kB |
100
- | `material/styles/base` and `material/styles/button` | 5.3 kB |
101
- | `material/styles`, the full stylesheet | 59.2 kB |
97
+ | Everything the root exports (`export * from 'material'`), without code splitting | 130.5 kB |
98
+ | `material/styles/base` | 3.1 kB |
99
+ | `material/styles/base-lite` | 1.7 kB |
100
+ | `material/styles/base` and `material/styles/button` | 5.4 kB |
101
+ | `material/styles`, the full stylesheet | 59.4 kB |
102
102
  <!-- /sizes -->
103
103
 
104
104
  `material` publishes ESM only, so bundlers drop what you do not import. Each component's page on [md3.io/components](https://md3.io/components/) gives its size.
@@ -1,3 +1,167 @@
1
- /** Badge component module */
2
- export { default, default as createBadge } from "./badge.js";
3
- export type { BadgeConfig, BadgeComponent, BadgeVariant, BadgeColor, BadgePosition, } from "./types.js";
1
+ import { ElementComponent } from "../../core/compose/component.js";
2
+
3
+ /** Badge variant types - determines the badge size and appearance */
4
+ type BadgeVariant = 'small' | 'large';
5
+
6
+ /** Badge color types - determines the badge's background color */
7
+ type BadgeColor = 'error' | 'primary' | 'secondary' | 'tertiary' | 'success' | 'warning' | 'info';
8
+
9
+ /** Badge position types - determines where the badge appears relative to its target */
10
+ type BadgePosition = 'top-right' | 'top-left' | 'bottom-right' | 'bottom-left';
11
+
12
+ /** Configuration interface for the Badge component */
13
+ interface BadgeConfig {
14
+ /**
15
+ * Badge variant (small dot or large numbered)
16
+ * @default 'large'
17
+ */
18
+ variant?: BadgeVariant | string;
19
+ /**
20
+ * Badge color (follows Material Design 3 color system)
21
+ * @default 'error'
22
+ */
23
+ color?: BadgeColor | string;
24
+ /**
25
+ * Badge position relative to its container element
26
+ * @default 'top-right'
27
+ */
28
+ position?: BadgePosition | string;
29
+ /** Text label inside the badge (for large badges) Up to 4 characters, numbers exceeding max will show "{max}+" For a small dot, nonnumeric text supplies its accessible announcement; otherwise it announces "New notification" without rendering text. */
30
+ label?: string | number;
31
+ /** Maximum value to display (shows "{max}+" if label exceeds max) */
32
+ max?: number;
33
+ /**
34
+ * Whether the badge should be initially visible
35
+ * @default true
36
+ */
37
+ visible?: boolean;
38
+ /** Target element to which badge will be attached */
39
+ target?: HTMLElement;
40
+ /** Additional CSS classes to apply to the badge element */
41
+ class?: string;
42
+ /**
43
+ * CSS class prefix for all badge classes
44
+ * @default "mtrl"
45
+ */
46
+ prefix?: string;
47
+ /**
48
+ * Component name used in CSS class generation
49
+ * @default "badge"
50
+ */
51
+ componentName?: string;
52
+ }
53
+
54
+ /** The visibility control withVisibility installs on a badge. */
55
+ interface BadgeVisibility {
56
+ /** Shows the badge */
57
+ show: () => void;
58
+ /** Hides the badge */
59
+ hide: () => void;
60
+ /** Toggles badge visibility, or forces it when given a flag */
61
+ toggle: (visible?: boolean) => void;
62
+ /** Whether the badge is currently visible */
63
+ isVisible: () => boolean;
64
+ }
65
+
66
+ /** What a badge feature enhancer needs from the component it is handed. */
67
+ interface BadgeFeatureHost extends ElementComponent {
68
+ config: BadgeConfig & Record<string, unknown>;
69
+ wrapper?: HTMLElement;
70
+ }
71
+
72
+ /** Badge component interface */
73
+ interface BadgeComponent {
74
+ /** The badge's root DOM element */
75
+ element: HTMLElement;
76
+ /** Badge wrapper element (if badge is attached to target) */
77
+ wrapper?: HTMLElement;
78
+ /**
79
+ * Sets the badge's text label
80
+ * @param label
81
+ */
82
+ setLabel: (label: string | number) => BadgeComponent;
83
+ /** Gets the badge's current text label */
84
+ getLabel: () => string;
85
+ /**
86
+ * Sets the badge's content (alias for setLabel)
87
+ * @param content
88
+ */
89
+ setContent: (content: string | number) => BadgeComponent;
90
+ /** Gets the badge's current content (alias for getLabel) */
91
+ getContent: () => string;
92
+ /** Shows the badge (makes it visible) */
93
+ show: () => BadgeComponent;
94
+ /** Hides the badge (makes it invisible) */
95
+ hide: () => BadgeComponent;
96
+ /**
97
+ * Toggles badge visibility
98
+ * @param visible
99
+ */
100
+ toggle: (visible?: boolean) => BadgeComponent;
101
+ /** Checks if the badge is currently visible */
102
+ isVisible: () => boolean;
103
+ /**
104
+ * Sets maximum value (after which badge shows max+)
105
+ * @param max
106
+ */
107
+ setMax: (max: number) => BadgeComponent;
108
+ /**
109
+ * Sets badge color
110
+ * @param color
111
+ */
112
+ setColor: (color: BadgeColor | string) => BadgeComponent;
113
+ /**
114
+ * Sets badge variant (size style)
115
+ * @param variant
116
+ */
117
+ setVariant: (variant: BadgeVariant | string) => BadgeComponent;
118
+ /**
119
+ * Sets badge position relative to target
120
+ * @param position
121
+ */
122
+ setPosition: (position: BadgePosition | string) => BadgeComponent;
123
+ /**
124
+ * Attaches badge to a target element
125
+ * @param target
126
+ */
127
+ attachTo: (target: HTMLElement) => BadgeComponent;
128
+ /** Makes badge standalone (removes from wrapper) */
129
+ detach: () => BadgeComponent;
130
+ /** Destroys the badge component and cleans up resources */
131
+ destroy: () => void;
132
+ /**
133
+ * Gets a class name with the component's prefix
134
+ * @param name
135
+ */
136
+ getClass: (name: string) => string;
137
+ /**
138
+ * Adds CSS classes to the badge element
139
+ * @param classes
140
+ */
141
+ addClass: (...classes: string[]) => BadgeComponent;
142
+ /**
143
+ * Removes CSS classes from the badge element
144
+ * @param classes
145
+ */
146
+ removeClass: (...classes: string[]) => BadgeComponent;
147
+ /**
148
+ * Adds an event listener to the badge
149
+ * @param event
150
+ * @param handler
151
+ */
152
+ on: (event: string, handler: Function) => BadgeComponent;
153
+ /**
154
+ * Removes an event listener from the badge
155
+ * @param event
156
+ * @param handler
157
+ */
158
+ off: (event: string, handler: Function) => BadgeComponent;
159
+ }
160
+
161
+ /**
162
+ * Creates a new Badge component following Material Design 3 guidelines.
163
+ * @param config
164
+ */
165
+ declare const createBadge: (config?: BadgeConfig) => BadgeComponent;
166
+ export type { BadgeColor, BadgeComponent, BadgeConfig, BadgePosition, BadgeVariant };
167
+ export { createBadge, createBadge as default };
@@ -1,4 +1,141 @@
1
- import { createBottomAppBar } from "./bottom-app-bar.js";
2
- export default createBottomAppBar;
3
- export { createBottomAppBar };
4
- export type { BottomAppBarConfig, BottomAppBarComponent, } from "./types.js";
1
+ import { ElementComponent } from "../../core/compose/index.js";
2
+
3
+ /**
4
+ * Creates a bottom app bar component
5
+ * @deprecated Material Design 3 Expressive replaces the bottom app bar with
6
+ * the docked toolbar. Use createToolbar with
7
+ * { variant: 'docked', placement: 'bottom' } from material/components/toolbar
8
+ * instead. A centred FAB, adding a FAB after creation, a custom
9
+ * transitionDuration and a custom tag are not yet available on the docked
10
+ * toolbar. Removal is parked until Material Design v4.
11
+ * @param config
12
+ */
13
+ declare const createBottomAppBar: (config?: BottomAppBarConfig) => BottomAppBarComponent;
14
+
15
+ /**
16
+ * FAB position type for Bottom App Bar
17
+ * @deprecated Material Design 3 Expressive replaces the bottom app bar with
18
+ * the docked toolbar. Use the toolbar's fabPosition: 'start' or 'end'. A
19
+ * centred FAB is not yet available on the docked toolbar.
20
+ */
21
+ type FabPosition = 'center' | 'end';
22
+
23
+ /**
24
+ * Configuration options for Bottom App Bar component
25
+ * @deprecated Material Design 3 Expressive replaces the bottom app bar with
26
+ * the docked toolbar. Use ToolbarConfig with
27
+ * { variant: 'docked', placement: 'bottom' }; each option here names its
28
+ * toolbar replacement. A centred FAB, adding a FAB after creation, a custom
29
+ * transition duration and a custom tag are not yet available on the docked
30
+ * toolbar. Removal is parked until Material Design v4.
31
+ */
32
+ interface BottomAppBarConfig {
33
+ /**
34
+ * Element to use for the container
35
+ * @default 'div'
36
+ * @deprecated The docked toolbar renders a div; a custom tag is not yet
37
+ * available on the docked toolbar.
38
+ */
39
+ tag?: string;
40
+ /**
41
+ * Whether to show FAB in the bottom bar
42
+ * @default false
43
+ * @deprecated Pass the FAB as fab to createToolbar, or use slot="fab" on
44
+ * m-toolbar.
45
+ */
46
+ hasFab?: boolean;
47
+ /**
48
+ * FAB position in bottom bar
49
+ * @default 'end'
50
+ * @deprecated Use the toolbar's fabPosition: 'start' or 'end'. A centred
51
+ * FAB ('center') is not yet available on the docked toolbar.
52
+ */
53
+ fabPosition?: FabPosition;
54
+ /**
55
+ * Additional CSS classes to apply
56
+ * @deprecated Use the toolbar's class option; the classes it applies are
57
+ * its own.
58
+ */
59
+ class?: string;
60
+ /**
61
+ * Whether to enable auto-hide on scroll
62
+ * @default false
63
+ * @deprecated Use scrollBehavior: 'exit' on createToolbar. Its threshold is
64
+ * set with scrollThreshold (default 40; the bottom app bar used 10), and a
65
+ * hidden toolbar is also inert.
66
+ */
67
+ autoHide?: boolean;
68
+ /**
69
+ * Transition duration for show/hide in ms
70
+ * @default 300
71
+ * @deprecated The docked toolbar transitions with the motion tokens; a
72
+ * custom transition duration is not yet available on the docked toolbar.
73
+ */
74
+ transitionDuration?: number;
75
+ /**
76
+ * Called with the new visibility when it changes.
77
+ * @deprecated Listen for the toolbar's show and hide events with
78
+ * toolbar.on('show', handler) and toolbar.on('hide', handler).
79
+ */
80
+ onVisibilityChange?: (visible: boolean) => void;
81
+ /**
82
+ * Component prefix for class names
83
+ * @default 'mtrl'
84
+ * @deprecated Never took effect: the prefix is fixed at build time. The
85
+ * docked toolbar has no per-instance prefix option either.
86
+ */
87
+ prefix?: string;
88
+ /**
89
+ * Component name for class generation
90
+ * @deprecated Never took effect: the component name is fixed per component.
91
+ * The docked toolbar's name is fixed too.
92
+ */
93
+ componentName?: string;
94
+ }
95
+
96
+ /**
97
+ * Bottom App Bar component interface
98
+ * @deprecated Material Design 3 Expressive replaces the bottom app bar with
99
+ * the docked toolbar. Use ToolbarComponent from createToolbar with
100
+ * { variant: 'docked', placement: 'bottom' }; each method names its toolbar
101
+ * replacement. Removal is parked until Material Design v4.
102
+ */
103
+ interface BottomAppBarComponent extends ElementComponent {
104
+ /**
105
+ * Adds an action button to the bottom bar
106
+ * @param button
107
+ * @deprecated Use toolbar.add(item), which returns the item's element.
108
+ */
109
+ addAction(button: HTMLElement): this;
110
+ /**
111
+ * Adds a floating action button to the bottom bar
112
+ * @param fab
113
+ * @deprecated Pass fab to createToolbar's config. Adding a FAB after
114
+ * creation is not yet available on the docked toolbar.
115
+ */
116
+ addFab(fab: HTMLElement): this;
117
+ /**
118
+ * Shows the bottom bar
119
+ * @deprecated Use toolbar.show().
120
+ */
121
+ show(): this;
122
+ /**
123
+ * Hides the bottom bar
124
+ * @deprecated Use toolbar.hide(), which also takes the toolbar out of the
125
+ * focus order with inert.
126
+ */
127
+ hide(): this;
128
+ /**
129
+ * Checks if the bottom bar is visible
130
+ * @deprecated Use toolbar.isVisible().
131
+ */
132
+ isVisible: () => boolean;
133
+ /**
134
+ * Get the actions container element
135
+ * @deprecated Use toolbar.bar (the element with the toolbar role) or
136
+ * toolbar.getItems().
137
+ */
138
+ getActionsContainer: () => HTMLElement;
139
+ }
140
+ export type { BottomAppBarComponent, BottomAppBarConfig };
141
+ export { createBottomAppBar, createBottomAppBar as default };
@@ -1,2 +1,114 @@
1
- export { default as createBottomSheet, default } from "./bottom-sheet.js";
2
- export type { BottomSheetConfig, BottomSheetComponent, BottomSheetVariant, BottomSheetState, BottomSheetStateEvent, BottomSheetEventHandlers, } from "./types.js";
1
+ import { BOTTOM_SHEET_STATES, BOTTOM_SHEET_VARIANTS } from "./constants.js";
2
+
3
+ /** Standard or modal */
4
+ type BottomSheetVariant = (typeof BOTTOM_SHEET_VARIANTS)[keyof typeof BOTTOM_SHEET_VARIANTS];
5
+
6
+ /** How far the sheet is open */
7
+ type BottomSheetState = (typeof BOTTOM_SHEET_STATES)[keyof typeof BOTTOM_SHEET_STATES];
8
+
9
+ /** What a state change reports */
10
+ interface BottomSheetStateEvent {
11
+ /** The state the sheet has moved to */
12
+ state: BottomSheetState;
13
+ /** The state it came from */
14
+ previous: BottomSheetState;
15
+ }
16
+
17
+ /** Handlers accepted at creation, one per event name */
18
+ interface BottomSheetEventHandlers {
19
+ open?: () => void;
20
+ close?: () => void;
21
+ stateChange?: (event: BottomSheetStateEvent) => void;
22
+ dragStart?: () => void;
23
+ dragEnd?: (event: BottomSheetStateEvent) => void;
24
+ }
25
+
26
+ /** Configuration for the bottom sheet. */
27
+ interface BottomSheetConfig {
28
+ /**
29
+ * Standard sheets leave the page usable; modal sheets cover it with a scrim and take focus.
30
+ * @default 'modal'
31
+ */
32
+ variant?: BottomSheetVariant;
33
+ /** Headline shown above the content. */
34
+ title?: string;
35
+ /** Accessible label for assistive technology when no visible `title` headline is provided. */
36
+ ariaLabel?: string;
37
+ /** Body of the sheet, as markup or an element */
38
+ content?: string | HTMLElement;
39
+ /**
40
+ * The 32x4dp bar at the top edge, which says the sheet can be dragged.
41
+ * @default true
42
+ */
43
+ dragHandle?: boolean;
44
+ /** Height of the partially expanded state, in pixels: a sheet with more content shows this much of it until it is expanded. */
45
+ peekHeight?: number;
46
+ /**
47
+ * The sheet stops growing at this width and centres itself, so it does not stretch across a desktop window.
48
+ * @default 640
49
+ */
50
+ maxWidth?: number;
51
+ /**
52
+ * State to start in.
53
+ * @default 'hidden'
54
+ */
55
+ initialState?: BottomSheetState;
56
+ /**
57
+ * Whether a click on the scrim closes a modal sheet.
58
+ * @default true
59
+ */
60
+ closeOnScrimClick?: boolean;
61
+ /**
62
+ * Whether Escape closes a modal sheet.
63
+ * @default true
64
+ */
65
+ closeOnEscape?: boolean;
66
+ /** Where to mount the sheet. */
67
+ container?: HTMLElement;
68
+ /** `"top"` makes a modal sheet's root a `<dialog>` element, rendered in `container` like any sheet, and opens it with `showModal()`: in the browser's top layer, above every z-index and outside any clipping ancestor, with the rest of the page inert. */
69
+ layer?: "top";
70
+ /** Handlers registered at creation, equivalent to calling `on` for each */
71
+ on?: BottomSheetEventHandlers;
72
+ /** Extra classes for the root element */
73
+ class?: string;
74
+ prefix?: string;
75
+ componentName?: string;
76
+ }
77
+
78
+ /** A bottom sheet instance. */
79
+ interface BottomSheetComponent {
80
+ /** The root element, which holds the scrim and the container */
81
+ element: HTMLElement;
82
+ /** Opens the sheet, partially expanded */
83
+ open: () => BottomSheetComponent;
84
+ /** Closes the sheet */
85
+ close: () => BottomSheetComponent;
86
+ /** Opens the sheet to its full height */
87
+ expand: () => BottomSheetComponent;
88
+ /** Returns the sheet to the peek height */
89
+ collapse: () => BottomSheetComponent;
90
+ /** Whether the sheet is showing at all */
91
+ isOpen: () => boolean;
92
+ /** How far the sheet is open */
93
+ getState: () => BottomSheetState;
94
+ /** Replaces the body of the sheet */
95
+ setContent: (content: string | HTMLElement) => BottomSheetComponent;
96
+ /** Replaces the headline */
97
+ setTitle: (title: string) => BottomSheetComponent;
98
+ /** Adds an event listener */
99
+ on: <T extends keyof BottomSheetEventHandlers>(event: T, handler: NonNullable<BottomSheetEventHandlers[T]>) => BottomSheetComponent;
100
+ /** Removes an event listener */
101
+ off: <T extends keyof BottomSheetEventHandlers>(event: T, handler: NonNullable<BottomSheetEventHandlers[T]>) => BottomSheetComponent;
102
+ /** Removes the sheet from the page and releases its listeners */
103
+ destroy: () => void;
104
+ /** Prefixes a class name, for styling hooks */
105
+ getClass: (name: string) => string;
106
+ }
107
+
108
+ /**
109
+ * Creates a bottom sheet: a surface anchored to the bottom edge holding content secondary to the page.
110
+ * @param config
111
+ */
112
+ declare const createBottomSheet: (config?: BottomSheetConfig) => BottomSheetComponent;
113
+ export type { BottomSheetComponent, BottomSheetConfig, BottomSheetEventHandlers, BottomSheetState, BottomSheetStateEvent, BottomSheetVariant };
114
+ export { createBottomSheet, createBottomSheet as default };
@@ -1,5 +1,10 @@
1
- /** Button component module */
2
- export { default, default as createButton } from "./button.js";
3
- export type { ButtonConfig, ButtonComponent, ButtonVariant, ButtonChangePayload } from "./types.js";
4
- export type { ButtonEvents } from "./types.js";
5
- export type { ButtonSize, ButtonShape } from "./constants.js";
1
+ import { ButtonComponent, ButtonConfig } from "./types.js";
2
+
3
+ /**
4
+ * Creates a new Button component with the specified configuration.
5
+ * @param config
6
+ */
7
+ declare const createButton: (config?: ButtonConfig) => ButtonComponent;
8
+ export { createButton, createButton as default };
9
+ export type { ButtonChangePayload, ButtonComponent, ButtonConfig, ButtonEvents, ButtonVariant } from "./types.js";
10
+ export type { ButtonShape, ButtonSize } from "./constants.js";
@@ -20,6 +20,7 @@ const selectedValues = new Set();
20
20
  try {
21
21
  const component = pipe(createBase, withEvents(), withElement(getContainerConfig(baseConfig)), withLifecycle())(baseConfig);
22
22
  const applySizeStyles = (density) => {
23
+ component.element.style.removeProperty(`--${baseConfig.prefix}-density`);
23
24
  Object.entries(getSizeStyles(baseConfig.prefix, baseConfig.size, kind, density)).forEach(([prop, value]) => {
24
25
  component.element.style.setProperty(prop, value);
25
26
  });
@@ -1,6 +1,6 @@
1
1
  import { createComponentConfig, processClassNames } from "../../core/config/component.js";
2
2
  import { cornerToken } from "../../core/theme/shape.js";
3
- import { BUTTON_GROUP_DEFAULTS, BUTTON_GROUP_DENSITY, BUTTON_GROUP_SIZE_TOKENS, BUTTON_GROUP_CONNECTED_GAP, BUTTON_GROUP_CONNECTED_PRESSED_CORNER, BUTTON_GROUP_DENSITY_STEP } from "./constants.js";
3
+ import { BUTTON_GROUP_DEFAULTS, BUTTON_GROUP_DENSITY, BUTTON_GROUP_SIZE_TOKENS, BUTTON_GROUP_CONNECTED_GAP, BUTTON_GROUP_CONNECTED_PRESSED_CORNER } from "./constants.js";
4
4
  export const DEFAULT_CONFIG = {
5
5
  kind: BUTTON_GROUP_DEFAULTS.KIND,
6
6
  selection: BUTTON_GROUP_DEFAULTS.SELECTION,
@@ -66,15 +66,18 @@ const DENSITY_STEPS = {
66
66
  export const getSizeStyles = (prefix, size, kind, density = BUTTON_GROUP_DENSITY.DEFAULT) => {
67
67
  const tokens = BUTTON_GROUP_SIZE_TOKENS[size || BUTTON_GROUP_DEFAULTS.SIZE] || BUTTON_GROUP_SIZE_TOKENS.s;
68
68
  const gap = kind === 'connected' ? BUTTON_GROUP_CONNECTED_GAP : tokens.standardGap;
69
- const height = tokens.height - BUTTON_GROUP_DENSITY_STEP * (DENSITY_STEPS[density] ?? 0);
70
- return {
71
- [`--${prefix}-button-group-height`]: `${height}px`,
69
+ const steps = DENSITY_STEPS[density] ?? 0;
70
+ const styles = {
71
+ [`--${prefix}-button-group-height`]: `${tokens.height}px`,
72
72
  [`--${prefix}-button-group-icon`]: `${tokens.icon}px`,
73
73
  [`--${prefix}-button-group-gap`]: `${gap}px`,
74
74
  [`--${prefix}-button-group-inner-corner`]: cornerToken(tokens.connectedStep, tokens.connectedCorner, prefix),
75
- [`--${prefix}-button-group-pressed-corner`]: cornerToken("extra-small", BUTTON_GROUP_CONNECTED_PRESSED_CORNER, prefix),
76
- [`--${prefix}-button-group-radius`]: `${height / 2}px`
75
+ [`--${prefix}-button-group-pressed-corner`]: cornerToken("extra-small", BUTTON_GROUP_CONNECTED_PRESSED_CORNER, prefix)
77
76
  };
77
+ if (steps > 0) {
78
+ styles[`--${prefix}-density`] = `${-steps}`;
79
+ }
80
+ return styles;
78
81
  };
79
82
  export const getButtonConfig = (buttonConfig, index, total, groupConfig) => {
80
83
  const isFirst = index === 0;