mtrl 0.10.0-next.0 → 0.10.0-next.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (428) hide show
  1. package/README.md +55 -1
  2. package/dist/README.md +55 -1
  3. package/dist/components/button/constants.d.ts +2 -2
  4. package/dist/components/button/constants.js +2 -2
  5. package/dist/components/button/types.d.ts +6 -5
  6. package/dist/components/button-group/types.d.ts +3 -3
  7. package/dist/components/card/api.js +8 -8
  8. package/dist/components/card/card.d.ts +1 -1
  9. package/dist/components/card/config.js +1 -1
  10. package/dist/components/card/constants.d.ts +18 -15
  11. package/dist/components/card/constants.js +15 -15
  12. package/dist/components/card/content.js +20 -20
  13. package/dist/components/card/features.js +14 -13
  14. package/dist/components/card/index.d.ts +1 -1
  15. package/dist/components/card/types.d.ts +4 -4
  16. package/dist/components/carousel/api.d.ts +4 -3
  17. package/dist/components/carousel/index.d.ts +1 -1
  18. package/dist/components/carousel/types.d.ts +13 -2
  19. package/dist/components/checkbox/api.d.ts +1 -1
  20. package/dist/components/checkbox/api.js +4 -0
  21. package/dist/components/checkbox/checkbox.d.ts +1 -2
  22. package/dist/components/checkbox/checkbox.js +9 -0
  23. package/dist/components/checkbox/config.d.ts +2 -2
  24. package/dist/components/checkbox/config.js +1 -1
  25. package/dist/components/checkbox/constants.d.ts +2 -5
  26. package/dist/components/checkbox/index.d.ts +4 -4
  27. package/dist/components/checkbox/types.d.ts +44 -9
  28. package/dist/components/chips/api.d.ts +3 -2
  29. package/dist/components/chips/chip/chip.d.ts +2 -6
  30. package/dist/components/chips/chip/chip.js +253 -68
  31. package/dist/components/chips/chip/index.d.ts +0 -1
  32. package/dist/components/chips/chip/index.js +0 -1
  33. package/dist/components/chips/config.d.ts +5 -12
  34. package/dist/components/chips/config.js +9 -10
  35. package/dist/components/chips/constants.d.ts +15 -41
  36. package/dist/components/chips/constants.js +4 -17
  37. package/dist/components/chips/factories.d.ts +9 -0
  38. package/dist/components/chips/factories.js +5 -0
  39. package/dist/components/chips/features/controller.d.ts +7 -6
  40. package/dist/components/chips/features/controller.js +96 -105
  41. package/dist/components/chips/features/dom.d.ts +10 -1
  42. package/dist/components/chips/features/dom.js +39 -10
  43. package/dist/components/chips/features/index.d.ts +0 -1
  44. package/dist/components/chips/features/index.js +0 -1
  45. package/dist/components/chips/index.d.ts +2 -2
  46. package/dist/components/chips/index.js +1 -1
  47. package/dist/components/chips/types.d.ts +120 -238
  48. package/dist/components/chips/types.js +1 -11
  49. package/dist/components/datepicker/api.d.ts +7 -18
  50. package/dist/components/datepicker/api.js +6 -179
  51. package/dist/components/datepicker/config.d.ts +5 -1129
  52. package/dist/components/datepicker/config.js +6 -84
  53. package/dist/components/datepicker/constants.d.ts +22 -14
  54. package/dist/components/datepicker/constants.js +21 -14
  55. package/dist/components/datepicker/datepicker.d.ts +2 -6
  56. package/dist/components/datepicker/datepicker.js +624 -235
  57. package/dist/components/datepicker/index.d.ts +1 -1
  58. package/dist/components/datepicker/render.d.ts +3 -51
  59. package/dist/components/datepicker/render.js +150 -280
  60. package/dist/components/datepicker/types.d.ts +64 -80
  61. package/dist/components/datepicker/types.js +6 -6
  62. package/dist/components/datepicker/utils.d.ts +2 -7
  63. package/dist/components/datepicker/utils.js +46 -20
  64. package/dist/components/dialog/api.d.ts +3 -2
  65. package/dist/components/dialog/config.d.ts +3 -2
  66. package/dist/components/dialog/dialog.js +1 -1
  67. package/dist/components/dialog/features.d.ts +4 -4
  68. package/dist/components/dialog/features.js +13 -13
  69. package/dist/components/dialog/types.d.ts +2 -1
  70. package/dist/components/drawer/api.d.ts +4 -3
  71. package/dist/components/drawer/config.d.ts +1 -1
  72. package/dist/components/drawer/index.d.ts +1 -1
  73. package/dist/components/drawer/types.d.ts +12 -2
  74. package/dist/components/extended-fab/api.d.ts +3 -2
  75. package/dist/components/extended-fab/config.js +1 -1
  76. package/dist/components/extended-fab/index.d.ts +1 -1
  77. package/dist/components/extended-fab/types.d.ts +27 -14
  78. package/dist/components/fab/api.d.ts +3 -2
  79. package/dist/components/fab/index.d.ts +1 -1
  80. package/dist/components/fab/types.d.ts +27 -8
  81. package/dist/components/icon-button/api.d.ts +5 -4
  82. package/dist/components/icon-button/api.js +2 -12
  83. package/dist/components/icon-button/index.d.ts +3 -3
  84. package/dist/components/icon-button/types.d.ts +20 -7
  85. package/dist/components/index.d.ts +3 -3
  86. package/dist/components/index.js +1 -1
  87. package/dist/components/list/api.d.ts +15 -860
  88. package/dist/components/list/api.js +57 -52
  89. package/dist/components/list/config.js +2 -20
  90. package/dist/components/list/constants.d.ts +4 -4
  91. package/dist/components/list/constants.js +4 -4
  92. package/dist/components/list/features/anatomy.d.ts +6 -0
  93. package/dist/components/list/features/anatomy.js +48 -0
  94. package/dist/components/list/features/renderer.d.ts +3 -7
  95. package/dist/components/list/features/renderer.js +96 -70
  96. package/dist/components/list/features/selection.d.ts +0 -7
  97. package/dist/components/list/features/selection.js +104 -151
  98. package/dist/components/list/index.d.ts +2 -10
  99. package/dist/components/list/list.d.ts +1 -2
  100. package/dist/components/list/types.d.ts +38 -5
  101. package/dist/components/menu/features/controller.d.ts +2 -1
  102. package/dist/components/menu/features/controller.js +2 -2
  103. package/dist/components/menu/features/opener.js +1 -1
  104. package/dist/components/menu/menu.js +1 -1
  105. package/dist/components/progress/features/state.d.ts +2 -2
  106. package/dist/components/radios/api.d.ts +4 -3
  107. package/dist/components/radios/constants.d.ts +10 -6
  108. package/dist/components/radios/index.d.ts +1 -1
  109. package/dist/components/radios/types.d.ts +21 -7
  110. package/dist/components/search/api.d.ts +3 -2
  111. package/dist/components/search/config.d.ts +5 -4
  112. package/dist/components/search/features/input.d.ts +6 -5
  113. package/dist/components/search/features/input.js +2 -2
  114. package/dist/components/search/features/states.d.ts +2 -1
  115. package/dist/components/search/features/states.js +3 -3
  116. package/dist/components/search/features/suggestions.d.ts +1 -1
  117. package/dist/components/search/search.js +1 -1
  118. package/dist/components/segmented-button/config.js +1 -1
  119. package/dist/components/segmented-button/segment.js +2 -2
  120. package/dist/components/segmented-button/types.d.ts +3 -3
  121. package/dist/components/select/features.d.ts +2 -2
  122. package/dist/components/select/features.js +5 -5
  123. package/dist/components/select/select.js +1 -1
  124. package/dist/components/slider/api.d.ts +4 -1
  125. package/dist/components/slider/api.js +4 -0
  126. package/dist/components/slider/config.d.ts +7 -1
  127. package/dist/components/slider/config.js +8 -5
  128. package/dist/components/slider/constants.d.ts +6 -6
  129. package/dist/components/slider/features/axis.d.ts +37 -0
  130. package/dist/components/slider/features/axis.js +17 -0
  131. package/dist/components/slider/features/controller.d.ts +2 -1
  132. package/dist/components/slider/features/controller.js +69 -29
  133. package/dist/components/slider/features/dom.js +2 -2
  134. package/dist/components/slider/features/handlers.js +75 -94
  135. package/dist/components/slider/features/range.js +1 -1
  136. package/dist/components/slider/features/states.d.ts +0 -3
  137. package/dist/components/slider/features/states.js +2 -15
  138. package/dist/components/slider/features/tracks.d.ts +19 -1
  139. package/dist/components/slider/features/tracks.js +135 -50
  140. package/dist/components/slider/slider.js +1 -1
  141. package/dist/components/slider/types.d.ts +27 -2
  142. package/dist/components/switch/api.d.ts +1 -1
  143. package/dist/components/switch/constants.d.ts +3 -3
  144. package/dist/components/switch/features.js +30 -8
  145. package/dist/components/switch/index.d.ts +1 -1
  146. package/dist/components/switch/switch.js +4 -0
  147. package/dist/components/switch/types.d.ts +34 -8
  148. package/dist/components/tabs/api.d.ts +2 -0
  149. package/dist/components/tabs/api.js +2 -1
  150. package/dist/components/tabs/constants.d.ts +15 -9
  151. package/dist/components/tabs/constants.js +5 -5
  152. package/dist/components/tabs/features.d.ts +6 -3
  153. package/dist/components/tabs/features.js +8 -5
  154. package/dist/components/tabs/indicator.js +19 -17
  155. package/dist/components/tabs/responsive.d.ts +19 -4
  156. package/dist/components/tabs/responsive.js +40 -48
  157. package/dist/components/tabs/state.d.ts +0 -5
  158. package/dist/components/tabs/state.js +0 -40
  159. package/dist/components/tabs/tab.js +4 -8
  160. package/dist/components/tabs/tabs.js +4 -4
  161. package/dist/components/tabs/types.d.ts +24 -6
  162. package/dist/components/tabs/utils.d.ts +11 -2
  163. package/dist/components/tabs/utils.js +9 -1
  164. package/dist/components/textfield/api.d.ts +1 -1
  165. package/dist/components/textfield/constants.d.ts +22 -12
  166. package/dist/components/textfield/constants.js +11 -6
  167. package/dist/components/textfield/features/leading-icon.js +2 -2
  168. package/dist/components/textfield/features/placement.js +45 -82
  169. package/dist/components/textfield/features/trailing-icon.js +2 -2
  170. package/dist/components/textfield/index.d.ts +1 -1
  171. package/dist/components/textfield/textfield.d.ts +2 -2
  172. package/dist/components/textfield/types.d.ts +23 -5
  173. package/dist/components/timepicker/api.d.ts +3 -2
  174. package/dist/components/timepicker/api.js +65 -275
  175. package/dist/components/timepicker/config.js +5 -10
  176. package/dist/components/timepicker/constants.d.ts +54 -54
  177. package/dist/components/timepicker/constants.js +54 -54
  178. package/dist/components/timepicker/dial.d.ts +30 -0
  179. package/dist/components/timepicker/dial.js +169 -0
  180. package/dist/components/timepicker/index.d.ts +1 -1
  181. package/dist/components/timepicker/render.js +225 -299
  182. package/dist/components/timepicker/timepicker.d.ts +0 -5
  183. package/dist/components/timepicker/timepicker.js +9 -26
  184. package/dist/components/timepicker/types.d.ts +34 -6
  185. package/dist/components/tooltip/constants.d.ts +4 -4
  186. package/dist/components/tooltip/constants.js +2 -2
  187. package/dist/core/compose/features/checkable.d.ts +2 -1
  188. package/dist/core/compose/features/icon.d.ts +1 -1
  189. package/dist/core/compose/features/icon.js +1 -1
  190. package/dist/core/compose/features/input.d.ts +6 -1
  191. package/dist/core/compose/features/input.js +3 -3
  192. package/dist/core/compose/features/ripple.d.ts +5 -8
  193. package/dist/core/compose/features/ripple.js +8 -11
  194. package/dist/core/compose/features/text.d.ts +4 -2
  195. package/dist/core/compose/features/text.js +8 -2
  196. package/dist/core/compose/features/textinput.js +1 -1
  197. package/dist/core/compose/features/textlabel.d.ts +5 -1
  198. package/dist/core/compose/features/textlabel.js +4 -1
  199. package/dist/core/compose/features/track.d.ts +5 -0
  200. package/dist/core/compose/features/track.js +8 -1
  201. package/dist/core/dom/create.d.ts +24 -5
  202. package/dist/core/dom/index.d.ts +1 -1
  203. package/dist/elements/adapter.d.ts +96 -0
  204. package/dist/elements/adapter.js +69 -0
  205. package/dist/elements/badge.d.ts +62 -0
  206. package/dist/elements/badge.js +33 -0
  207. package/dist/elements/button.d.ts +69 -0
  208. package/dist/elements/button.js +27 -0
  209. package/dist/elements/checkbox.d.ts +92 -0
  210. package/dist/elements/checkbox.js +49 -0
  211. package/dist/elements/css/badge.js +3 -0
  212. package/dist/elements/css/button.d.ts +1 -0
  213. package/dist/elements/css/button.js +4 -0
  214. package/dist/elements/css/checkbox.d.ts +1 -0
  215. package/dist/elements/css/checkbox.js +3 -0
  216. package/dist/elements/css/divider.d.ts +1 -0
  217. package/dist/elements/css/divider.js +3 -0
  218. package/dist/elements/css/extended-fab.d.ts +1 -0
  219. package/dist/elements/css/extended-fab.js +3 -0
  220. package/dist/elements/css/fab.d.ts +1 -0
  221. package/dist/elements/css/fab.js +3 -0
  222. package/dist/elements/css/icon-button.d.ts +1 -0
  223. package/dist/elements/css/icon-button.js +3 -0
  224. package/dist/elements/css/index.d.ts +1 -0
  225. package/dist/elements/css/index.js +14 -0
  226. package/dist/elements/css/loading-indicator.d.ts +1 -0
  227. package/dist/elements/css/loading-indicator.js +3 -0
  228. package/dist/elements/css/progress.d.ts +1 -0
  229. package/dist/elements/css/progress.js +3 -0
  230. package/dist/elements/css/radios.d.ts +1 -0
  231. package/dist/elements/css/radios.js +3 -0
  232. package/dist/elements/css/ripple.d.ts +1 -0
  233. package/dist/elements/css/ripple.js +3 -0
  234. package/dist/elements/css/slider.d.ts +1 -0
  235. package/dist/elements/css/slider.js +3 -0
  236. package/dist/elements/css/switch.d.ts +1 -0
  237. package/dist/elements/css/switch.js +3 -0
  238. package/dist/elements/css/tabs.d.ts +1 -0
  239. package/dist/elements/css/tabs.js +5 -0
  240. package/dist/elements/css/textfield.d.ts +1 -0
  241. package/dist/elements/css/textfield.js +3 -0
  242. package/dist/elements/define.d.ts +191 -0
  243. package/dist/elements/define.js +406 -0
  244. package/dist/elements/divider.d.ts +54 -0
  245. package/dist/elements/divider.js +23 -0
  246. package/dist/elements/extended-fab.d.ts +82 -0
  247. package/dist/elements/extended-fab.js +32 -0
  248. package/dist/elements/fab.d.ts +65 -0
  249. package/dist/elements/fab.js +24 -0
  250. package/dist/elements/form-button.d.ts +29 -0
  251. package/dist/elements/form-button.js +19 -0
  252. package/dist/elements/icon-button.d.ts +104 -0
  253. package/dist/elements/icon-button.js +56 -0
  254. package/dist/elements/index.d.ts +103 -0
  255. package/dist/elements/index.js +67 -0
  256. package/dist/elements/loading-indicator.d.ts +44 -0
  257. package/dist/elements/loading-indicator.js +26 -0
  258. package/dist/elements/progress.d.ts +90 -0
  259. package/dist/elements/progress.js +40 -0
  260. package/dist/elements/radios.d.ts +99 -0
  261. package/dist/elements/radios.js +126 -0
  262. package/dist/elements/slider.d.ts +160 -0
  263. package/dist/elements/slider.js +136 -0
  264. package/dist/elements/styles.d.ts +22 -0
  265. package/dist/elements/styles.js +34 -0
  266. package/dist/elements/switch.d.ts +87 -0
  267. package/dist/elements/switch.js +48 -0
  268. package/dist/elements/tabs.d.ts +77 -0
  269. package/dist/elements/tabs.js +108 -0
  270. package/dist/elements/textfield.d.ts +160 -0
  271. package/dist/elements/textfield.js +107 -0
  272. package/dist/index.cjs +0 -0
  273. package/dist/package.json +52 -2
  274. package/dist/react/create.d.ts +45 -0
  275. package/dist/react/create.js +104 -0
  276. package/dist/react/index.d.ts +40 -0
  277. package/dist/react/index.js +34 -0
  278. package/dist/solid/create.d.ts +44 -0
  279. package/dist/solid/create.js +82 -0
  280. package/dist/solid/index.d.ts +40 -0
  281. package/dist/solid/index.js +33 -0
  282. package/dist/styles/badge.css +2 -2
  283. package/dist/styles/base.css +2 -2
  284. package/dist/styles/bottom-app-bar.css +2 -2
  285. package/dist/styles/bottom-sheet.css +2 -2
  286. package/dist/styles/button-group.css +2 -2
  287. package/dist/styles/button.css +2 -2
  288. package/dist/styles/card.css +2 -2
  289. package/dist/styles/carousel.css +2 -2
  290. package/dist/styles/checkbox.css +2 -2
  291. package/dist/styles/chips.css +2 -2
  292. package/dist/styles/datepicker.css +2 -0
  293. package/dist/styles/datepicker.d.ts +1 -0
  294. package/dist/styles/datepicker.js +2 -0
  295. package/dist/styles/dialog.css +2 -2
  296. package/dist/styles/divider.css +2 -2
  297. package/dist/styles/drawer.css +2 -2
  298. package/dist/styles/extended-fab.css +2 -2
  299. package/dist/styles/fab.css +2 -2
  300. package/dist/styles/icon-button.css +2 -2
  301. package/dist/styles/list.css +2 -2
  302. package/dist/styles/loading-indicator.css +2 -2
  303. package/dist/styles/menu.css +2 -2
  304. package/dist/styles/navigation-rail.css +2 -2
  305. package/dist/styles/progress.css +2 -2
  306. package/dist/styles/radios.css +2 -2
  307. package/dist/styles/search.css +2 -2
  308. package/dist/styles/segmented-button.css +2 -2
  309. package/dist/styles/select.css +2 -2
  310. package/dist/styles/side-sheet.css +2 -2
  311. package/dist/styles/slider.css +2 -2
  312. package/dist/styles/snackbar.css +2 -2
  313. package/dist/styles/split-button.css +2 -2
  314. package/dist/styles/switch.css +2 -2
  315. package/dist/styles/tabs.css +2 -2
  316. package/dist/styles/textfield.css +2 -2
  317. package/dist/styles/timepicker.css +2 -2
  318. package/dist/styles/tooltip.css +2 -2
  319. package/dist/styles/top-app-bar.css +2 -2
  320. package/dist/styles/utilities.css +2 -2
  321. package/dist/styles.css +2 -2
  322. package/dist/svelte/Badge.svelte +20 -0
  323. package/dist/svelte/Badge.svelte.d.ts +5 -0
  324. package/dist/svelte/Button.svelte +19 -0
  325. package/dist/svelte/Button.svelte.d.ts +5 -0
  326. package/dist/svelte/Checkbox.svelte +21 -0
  327. package/dist/svelte/Checkbox.svelte.d.ts +5 -0
  328. package/dist/svelte/Divider.svelte +19 -0
  329. package/dist/svelte/Divider.svelte.d.ts +5 -0
  330. package/dist/svelte/ExtendedFab.svelte +19 -0
  331. package/dist/svelte/ExtendedFab.svelte.d.ts +5 -0
  332. package/dist/svelte/Fab.svelte +19 -0
  333. package/dist/svelte/Fab.svelte.d.ts +5 -0
  334. package/dist/svelte/IconButton.svelte +20 -0
  335. package/dist/svelte/IconButton.svelte.d.ts +5 -0
  336. package/dist/svelte/LoadingIndicator.svelte +19 -0
  337. package/dist/svelte/LoadingIndicator.svelte.d.ts +5 -0
  338. package/dist/svelte/Progress.svelte +21 -0
  339. package/dist/svelte/Progress.svelte.d.ts +5 -0
  340. package/dist/svelte/Radio.svelte +11 -0
  341. package/dist/svelte/Radio.svelte.d.ts +5 -0
  342. package/dist/svelte/Radios.svelte +20 -0
  343. package/dist/svelte/Radios.svelte.d.ts +5 -0
  344. package/dist/svelte/Slider.svelte +21 -0
  345. package/dist/svelte/Slider.svelte.d.ts +5 -0
  346. package/dist/svelte/Switch.svelte +20 -0
  347. package/dist/svelte/Switch.svelte.d.ts +5 -0
  348. package/dist/svelte/Tab.svelte +11 -0
  349. package/dist/svelte/Tab.svelte.d.ts +5 -0
  350. package/dist/svelte/Tabs.svelte +20 -0
  351. package/dist/svelte/Tabs.svelte.d.ts +5 -0
  352. package/dist/svelte/Textfield.svelte +20 -0
  353. package/dist/svelte/Textfield.svelte.d.ts +5 -0
  354. package/dist/svelte/index.d.ts +18 -0
  355. package/dist/svelte/index.js +32 -0
  356. package/dist/svelte/runtime.d.ts +60 -0
  357. package/dist/svelte/runtime.js +76 -0
  358. package/dist/themes/autumn.css +2 -2
  359. package/dist/themes/baseline.css +2 -2
  360. package/dist/themes/brownbeige.css +2 -2
  361. package/dist/themes/browngreen.css +2 -2
  362. package/dist/themes/desert.css +2 -2
  363. package/dist/themes/forest.css +2 -2
  364. package/dist/themes/highcontrast.css +2 -2
  365. package/dist/themes/legacy.css +2 -2
  366. package/dist/themes/material.css +2 -2
  367. package/dist/themes/ocean.css +2 -2
  368. package/dist/themes/sageivory.css +2 -2
  369. package/dist/themes/spring.css +2 -2
  370. package/dist/themes/summer.css +2 -2
  371. package/dist/themes/sunset.css +2 -2
  372. package/dist/themes/tealcaramel.css +2 -2
  373. package/dist/themes/winter.css +2 -2
  374. package/dist/vue/create.d.ts +53 -0
  375. package/dist/vue/create.js +86 -0
  376. package/dist/vue/index.d.ts +40 -0
  377. package/dist/vue/index.js +33 -0
  378. package/package.json +74 -4
  379. package/src/styles/abstract/_mixins.scss +15 -1
  380. package/src/styles/abstract/_variables.scss +1 -3
  381. package/src/styles/abstract/chips/_assist.scss +7 -0
  382. package/src/styles/abstract/chips/_filter.scss +7 -0
  383. package/src/styles/abstract/chips/_input.scss +7 -0
  384. package/src/styles/abstract/chips/_suggestion.scss +7 -0
  385. package/src/styles/components/_card.scss +11 -11
  386. package/src/styles/components/_checkbox.scss +94 -99
  387. package/src/styles/components/_chips.scss +174 -508
  388. package/src/styles/components/_datepicker.scss +143 -353
  389. package/src/styles/components/_drawer.scss +2 -1
  390. package/src/styles/components/_icon-button.scss +2 -2
  391. package/src/styles/components/_list.scss +84 -760
  392. package/src/styles/components/_radios.scss +60 -51
  393. package/src/styles/components/_slider.scss +153 -62
  394. package/src/styles/components/_switch.scss +80 -85
  395. package/src/styles/components/_tabs.scss +68 -39
  396. package/src/styles/components/_textfield.scss +122 -70
  397. package/src/styles/components/_timepicker.scss +191 -102
  398. package/src/styles/themes/_autumn.scss +10 -0
  399. package/src/styles/themes/_baseline.scss +12 -0
  400. package/src/styles/themes/_bluekhaki.scss +10 -0
  401. package/src/styles/themes/_brownbeige.scss +10 -0
  402. package/src/styles/themes/_browngreen.scss +10 -0
  403. package/src/styles/themes/_desert.scss +10 -0
  404. package/src/styles/themes/_forest.scss +10 -0
  405. package/src/styles/themes/_greenbeige.scss +10 -0
  406. package/src/styles/themes/_highcontrast.scss +10 -0
  407. package/src/styles/themes/_legacy.scss +10 -0
  408. package/src/styles/themes/_material.scss +10 -0
  409. package/src/styles/themes/_ocean.scss +10 -0
  410. package/src/styles/themes/_sageivory.scss +10 -0
  411. package/src/styles/themes/_spring.scss +10 -0
  412. package/src/styles/themes/_summer.scss +10 -0
  413. package/src/styles/themes/_sunset.scss +10 -0
  414. package/src/styles/themes/_tealcaramel.scss +10 -0
  415. package/src/styles/themes/_winter.scss +10 -0
  416. package/src/styles/utilities/_ripple.scss +2 -1
  417. package/dist/components/chips/chip/api.d.ts +0 -23
  418. package/dist/components/chips/chip/api.js +0 -187
  419. package/dist/components/chips/chip/config.d.ts +0 -581
  420. package/dist/components/chips/chip/config.js +0 -53
  421. package/dist/components/chips/chip/types.d.ts +0 -11
  422. package/dist/components/chips/features/label.d.ts +0 -76
  423. package/dist/components/chips/features/label.js +0 -63
  424. package/dist/components/tabs/tab-api.d.ts +0 -49
  425. package/dist/components/tabs/tab-api.js +0 -139
  426. package/dist/components/timepicker/clockdial.d.ts +0 -34
  427. package/dist/components/timepicker/clockdial.js +0 -276
  428. /package/dist/{components/chips/chip/types.js → elements/css/badge.d.ts} +0 -0
package/README.md CHANGED
@@ -134,6 +134,60 @@ const button = createButton({
134
134
 
135
135
  Button progress and card actions load on demand; enable code splitting in your build to keep them out of the initial chunk.
136
136
 
137
+ ## Web components and frameworks (experimental)
138
+
139
+ From the 0.10.0 prereleases (`npm install mtrl@next`), components also ship as custom elements, with thin adapters for React, Vue, Svelte and Solid. The API may still change.
140
+
141
+ | Element | Framework component (Vue: `M` prefix, e.g. `MTextfield`) | Kind |
142
+ |---------|---------------------|------|
143
+ | `<m-button>` | `Button` | action, submits or resets its form |
144
+ | `<m-icon-button>` | `IconButton` | action or toggle (`selected`) |
145
+ | `<m-fab>`, `<m-extended-fab>` | `Fab`, `ExtendedFab` | action |
146
+ | `<m-checkbox>` | `Checkbox` | form control (`checked`, `indeterminate`) |
147
+ | `<m-switch>` | `Switch` | form control (`checked`) |
148
+ | `<m-radios>` with `<m-radio>` | `Radios`, `Radio` | form control (`value`) |
149
+ | `<m-slider>` | `Slider` | form control (`value`, `secondValue` with `range`) |
150
+ | `<m-textfield>` | `Textfield` | form control (`value`) |
151
+ | `<m-tabs>` with `<m-tab>` | `Tabs`, `Tab` | selection (`value`) |
152
+ | `<m-progress>`, `<m-loading-indicator>` | `Progress`, `LoadingIndicator` | indicator |
153
+ | `<m-badge>`, `<m-divider>` | `Badge`, `Divider` | display |
154
+
155
+ More components follow through 0.10.x; the others are available as factories today.
156
+
157
+ ```html
158
+ <script type="module">
159
+ import 'mtrl/elements/css'; // the elements' styles
160
+ import { defineAll } from 'mtrl/elements';
161
+ defineAll(); // registers every element (<m-button>, <m-switch>, …)
162
+ </script>
163
+
164
+ <form>
165
+ <m-textfield name="email" type="email" label="Email" required></m-textfield>
166
+ <m-radios name="plan" value="free" aria-label="Plan">
167
+ <m-radio value="free">Free</m-radio>
168
+ <m-radio value="pro">Pro</m-radio>
169
+ </m-radios>
170
+ <m-switch name="news" checked>Newsletter</m-switch>
171
+ <m-button type="submit">Sign up</m-button>
172
+ </form>
173
+
174
+ <m-tabs value="songs">
175
+ <m-tab value="songs">Songs</m-tab>
176
+ <m-tab value="albums">Albums</m-tab>
177
+ </m-tabs>
178
+ ```
179
+
180
+ The page still loads mtrl's base styles and a theme (see [Styles](#styles)); the elements render in shadow DOM and pick up the theme's tokens. Attributes are defaults and properties the live state, as on native controls: a `checked` or `value` attribute sets the state until the user or a script changes it, and `form.reset()` goes back to it. Form controls take part in forms (their host's `name`), reset, validation and back-navigation restore.
181
+
182
+ | Framework | Import | Two-way binding |
183
+ |-----------|--------|-----------------|
184
+ | React 18 and 19 | `import { Switch } from 'mtrl/react'` | `checked` + `onChange`, or `defaultChecked` |
185
+ | Vue 3 | `import { MSwitch } from 'mtrl/vue'` | `v-model` |
186
+ | Svelte 5 | `import { Switch } from 'mtrl/svelte'` | `bind:checked` |
187
+ | Solid | `import { Switch } from 'mtrl/solid'` | `checked` + `onChange` |
188
+
189
+ Each framework is an optional peer dependency; mtrl installs none of them. All adapters render on the server and hydrate. Angular apps use the elements directly, with `CUSTOM_ELEMENTS_SCHEMA`.
190
+
137
191
  ## Building your own components
138
192
 
139
193
  Components are composed from small features with `pipe`. The same building blocks are public:
@@ -198,7 +252,7 @@ The policy sees every string, the library's own icons included; a `TrustedHTML`
198
252
  - `title-large` uses weight 400, as M3 specifies.
199
253
  - The slider draws with DOM and CSS; styles for `.mtrl-slider-canvas` no longer apply.
200
254
 
201
- The full list, with every renamed property, is in [changelog.txt](changelog.txt).
255
+ The full list, with every renamed property, is in the [0.8.0 changelog](CHANGELOG.md#080---2026-09-15).
202
256
 
203
257
  ## Browser support
204
258
 
package/dist/README.md CHANGED
@@ -134,6 +134,60 @@ const button = createButton({
134
134
 
135
135
  Button progress and card actions load on demand; enable code splitting in your build to keep them out of the initial chunk.
136
136
 
137
+ ## Web components and frameworks (experimental)
138
+
139
+ From the 0.10.0 prereleases (`npm install mtrl@next`), components also ship as custom elements, with thin adapters for React, Vue, Svelte and Solid. The API may still change.
140
+
141
+ | Element | Framework component (Vue: `M` prefix, e.g. `MTextfield`) | Kind |
142
+ |---------|---------------------|------|
143
+ | `<m-button>` | `Button` | action, submits or resets its form |
144
+ | `<m-icon-button>` | `IconButton` | action or toggle (`selected`) |
145
+ | `<m-fab>`, `<m-extended-fab>` | `Fab`, `ExtendedFab` | action |
146
+ | `<m-checkbox>` | `Checkbox` | form control (`checked`, `indeterminate`) |
147
+ | `<m-switch>` | `Switch` | form control (`checked`) |
148
+ | `<m-radios>` with `<m-radio>` | `Radios`, `Radio` | form control (`value`) |
149
+ | `<m-slider>` | `Slider` | form control (`value`, `secondValue` with `range`) |
150
+ | `<m-textfield>` | `Textfield` | form control (`value`) |
151
+ | `<m-tabs>` with `<m-tab>` | `Tabs`, `Tab` | selection (`value`) |
152
+ | `<m-progress>`, `<m-loading-indicator>` | `Progress`, `LoadingIndicator` | indicator |
153
+ | `<m-badge>`, `<m-divider>` | `Badge`, `Divider` | display |
154
+
155
+ More components follow through 0.10.x; the others are available as factories today.
156
+
157
+ ```html
158
+ <script type="module">
159
+ import 'mtrl/elements/css'; // the elements' styles
160
+ import { defineAll } from 'mtrl/elements';
161
+ defineAll(); // registers every element (<m-button>, <m-switch>, …)
162
+ </script>
163
+
164
+ <form>
165
+ <m-textfield name="email" type="email" label="Email" required></m-textfield>
166
+ <m-radios name="plan" value="free" aria-label="Plan">
167
+ <m-radio value="free">Free</m-radio>
168
+ <m-radio value="pro">Pro</m-radio>
169
+ </m-radios>
170
+ <m-switch name="news" checked>Newsletter</m-switch>
171
+ <m-button type="submit">Sign up</m-button>
172
+ </form>
173
+
174
+ <m-tabs value="songs">
175
+ <m-tab value="songs">Songs</m-tab>
176
+ <m-tab value="albums">Albums</m-tab>
177
+ </m-tabs>
178
+ ```
179
+
180
+ The page still loads mtrl's base styles and a theme (see [Styles](#styles)); the elements render in shadow DOM and pick up the theme's tokens. Attributes are defaults and properties the live state, as on native controls: a `checked` or `value` attribute sets the state until the user or a script changes it, and `form.reset()` goes back to it. Form controls take part in forms (their host's `name`), reset, validation and back-navigation restore.
181
+
182
+ | Framework | Import | Two-way binding |
183
+ |-----------|--------|-----------------|
184
+ | React 18 and 19 | `import { Switch } from 'mtrl/react'` | `checked` + `onChange`, or `defaultChecked` |
185
+ | Vue 3 | `import { MSwitch } from 'mtrl/vue'` | `v-model` |
186
+ | Svelte 5 | `import { Switch } from 'mtrl/svelte'` | `bind:checked` |
187
+ | Solid | `import { Switch } from 'mtrl/solid'` | `checked` + `onChange` |
188
+
189
+ Each framework is an optional peer dependency; mtrl installs none of them. All adapters render on the server and hydrate. Angular apps use the elements directly, with `CUSTOM_ELEMENTS_SCHEMA`.
190
+
137
191
  ## Building your own components
138
192
 
139
193
  Components are composed from small features with `pipe`. The same building blocks are public:
@@ -198,7 +252,7 @@ The policy sees every string, the library's own icons included; a `TrustedHTML`
198
252
  - `title-large` uses weight 400, as M3 specifies.
199
253
  - The slider draws with DOM and CSS; styles for `.mtrl-slider-canvas` no longer apply.
200
254
 
201
- The full list, with every renamed property, is in [changelog.txt](changelog.txt).
255
+ The full list, with every renamed property, is in the [0.8.0 changelog](CHANGELOG.md#080---2026-09-15).
202
256
 
203
257
  ## Browser support
204
258
 
@@ -64,8 +64,8 @@ export declare const BUTTON_CLASSES: {
64
64
  readonly ROOT: "button";
65
65
  readonly ICON: "button__icon";
66
66
  readonly TEXT: "button__text";
67
- readonly ACTIVE: "button-active";
68
- readonly DISABLED: "button-disabled";
67
+ readonly ACTIVE: "button--active";
68
+ readonly DISABLED: "button--disabled";
69
69
  };
70
70
  /**
71
71
  * Default ripple effect configuration
@@ -25,8 +25,8 @@ export const BUTTON_CLASSES = {
25
25
  ROOT: "button",
26
26
  ICON: "button__icon",
27
27
  TEXT: "button__text",
28
- ACTIVE: "button-active",
29
- DISABLED: "button-disabled",
28
+ ACTIVE: "button--active",
29
+ DISABLED: "button--disabled",
30
30
  };
31
31
  export const DEFAULT_RIPPLE_CONFIG = {
32
32
  DURATION: 450,
@@ -38,10 +38,11 @@ export interface ButtonConfig extends BaseComponentConfig {
38
38
  */
39
39
  disabled?: boolean;
40
40
  /**
41
- * Initial button text content
41
+ * Initial button text content, or a node placed where the text goes (the
42
+ * web component passes a `<slot>` so the page's content is the label)
42
43
  * @example 'Submit'
43
44
  */
44
- text?: string;
45
+ text?: string | Node;
45
46
  /**
46
47
  * Initial button icon HTML content
47
48
  * @example '<svg>...</svg>'
@@ -84,11 +85,11 @@ export interface ButtonConfig extends BaseComponentConfig {
84
85
  * Ripple effect configuration
85
86
  */
86
87
  rippleConfig?: {
87
- /** Duration of the ripple animation in milliseconds */
88
+ /** How long, in milliseconds, a released wave lingers before it is removed */
88
89
  duration?: number;
89
- /** Timing function for the ripple animation */
90
+ /** @deprecated Not applied: the ripple's motion comes from the stylesheet (FLO-268). */
90
91
  timing?: string;
91
- /** Opacity values for ripple start and end [start, end] */
92
+ /** @deprecated Not applied: the wave is the 0.10 pressed state layer, drawn by the stylesheet (FLO-268). */
92
93
  opacity?: [string, string];
93
94
  };
94
95
  /**
@@ -199,11 +199,11 @@ export interface ButtonGroupConfig {
199
199
  * Ripple effect configuration
200
200
  */
201
201
  rippleConfig?: {
202
- /** Duration of the ripple animation in milliseconds */
202
+ /** How long, in milliseconds, a released wave lingers before it is removed */
203
203
  duration?: number;
204
- /** Timing function for the ripple animation */
204
+ /** @deprecated Not applied: the ripple's motion comes from the stylesheet (FLO-268). */
205
205
  timing?: string;
206
- /** Opacity values for ripple start and end [start, end] */
206
+ /** @deprecated Not applied: the wave is the 0.10 pressed state layer, drawn by the stylesheet (FLO-268). */
207
207
  opacity?: [string, string];
208
208
  };
209
209
  /**
@@ -3,16 +3,16 @@ export const withAPI = ({ lifecycle, config }) => (component) => ({
3
3
  element: component.element,
4
4
  config,
5
5
  addContent(contentElement) {
6
- if (contentElement && contentElement.classList.contains(`${component.getClass('card')}-content`)) {
6
+ if (contentElement && contentElement.classList.contains(`${component.getClass('card')}__content`)) {
7
7
  component.element.appendChild(contentElement);
8
8
  }
9
9
  return this;
10
10
  },
11
11
  setHeader(headerElement) {
12
12
  const card = component.getClass('card');
13
- if (headerElement && headerElement.classList.contains(`${card}-header`)) {
14
- const title = (header) => header?.querySelector(`.${card}-header-title`)?.id || null;
15
- const existingHeader = component.element.querySelector(`.${card}-header`);
13
+ if (headerElement && headerElement.classList.contains(`${card}__header`)) {
14
+ const title = (header) => header?.querySelector(`.${card}__header-title`)?.id || null;
15
+ const existingHeader = component.element.querySelector(`.${card}__header`);
16
16
  if (existingHeader) {
17
17
  const previous = title(existingHeader);
18
18
  if (previous && component.element.getAttribute('aria-labelledby') === previous) {
@@ -21,7 +21,7 @@ export const withAPI = ({ lifecycle, config }) => (component) => ({
21
21
  existingHeader.remove();
22
22
  }
23
23
  let before = component.element.firstElementChild;
24
- while (before && before.classList.contains(`${card}-media`)) {
24
+ while (before && before.classList.contains(`${card}__media`)) {
25
25
  before = before.nextElementSibling;
26
26
  }
27
27
  component.element.insertBefore(headerElement, before);
@@ -35,7 +35,7 @@ export const withAPI = ({ lifecycle, config }) => (component) => ({
35
35
  return this;
36
36
  },
37
37
  addMedia(mediaElement, position = 'top') {
38
- if (mediaElement && mediaElement.classList.contains(`${component.getClass('card')}-media`)) {
38
+ if (mediaElement && mediaElement.classList.contains(`${component.getClass('card')}__media`)) {
39
39
  if (position === 'top') {
40
40
  component.element.insertBefore(mediaElement, component.element.firstChild);
41
41
  }
@@ -46,8 +46,8 @@ export const withAPI = ({ lifecycle, config }) => (component) => ({
46
46
  return this;
47
47
  },
48
48
  setActions(actionsElement) {
49
- if (actionsElement && actionsElement.classList.contains(`${component.getClass('card')}-actions`)) {
50
- const existingActions = component.element.querySelector(`.${component.getClass('card')}-actions`);
49
+ if (actionsElement && actionsElement.classList.contains(`${component.getClass('card')}__actions`)) {
50
+ const existingActions = component.element.querySelector(`.${component.getClass('card')}__actions`);
51
51
  if (existingActions) {
52
52
  existingActions.remove();
53
53
  }
@@ -57,7 +57,7 @@ import { CardComponent, CardSchema } from "./types.js";
57
57
  * // Using API methods
58
58
  * const card = createCard();
59
59
  * const content = document.createElement('div');
60
- * content.className = 'mtrl-card-content';
60
+ * content.className = 'mtrl-card__content';
61
61
  * content.textContent = 'Added programmatically';
62
62
  * card.addContent(content);
63
63
  * card.makeDraggable();
@@ -145,7 +145,7 @@ export const withInteractiveBehavior = (comp) => {
145
145
  comp.element.classList.add(`${comp.getClass("card")}--dragging`);
146
146
  comp.emit?.("dragstart", { event: e });
147
147
  if (e.dataTransfer) {
148
- const cardTitle = comp.element.querySelector(`.${comp.getClass("card")}-header-title`)
148
+ const cardTitle = comp.element.querySelector(`.${comp.getClass("card")}__header-title`)
149
149
  ?.textContent || "Card";
150
150
  e.dataTransfer.setData("text/plain", cardTitle);
151
151
  }
@@ -67,19 +67,22 @@ export declare const CARD_MEDIA_POSITION: {
67
67
  */
68
68
  export declare const CARD_CLASSES: {
69
69
  readonly ROOT: "card";
70
- readonly HEADER: "card-header";
71
- readonly TITLE: "card-title";
72
- readonly SUBTITLE: "card-subtitle";
73
- readonly AVATAR: "card-avatar";
74
- readonly HEADER_ACTION: "card-header-action";
75
- readonly CONTENT: "card-content";
76
- readonly MEDIA: "card-media";
77
- readonly ACTIONS: "card-actions";
78
- readonly DRAGGABLE: "card-draggable";
79
- readonly INTERACTIVE: "card-interactive";
80
- readonly FULL_WIDTH: "card-full-width";
81
- readonly CLICKABLE: "card-clickable";
82
- readonly LOADING: "card-loading";
83
- readonly EXPANDED: "card-expanded";
84
- readonly ELEVATION_PREFIX: "card-elevation-";
70
+ readonly HEADER: "card__header";
71
+ readonly TITLE: "card__header-title";
72
+ readonly SUBTITLE: "card__header-subtitle";
73
+ readonly AVATAR: "card__header-avatar";
74
+ readonly HEADER_ACTION: "card__header-action";
75
+ readonly CONTENT: "card__content";
76
+ readonly MEDIA: "card__media";
77
+ readonly ACTIONS: "card__actions";
78
+ /** Reserved modifier; draggable currently uses the native attribute. */
79
+ readonly DRAGGABLE: "card--draggable";
80
+ readonly INTERACTIVE: "card--interactive";
81
+ readonly FULL_WIDTH: "card--full-width";
82
+ /** Reserved modifier; clickable currently uses INTERACTIVE. */
83
+ readonly CLICKABLE: "card--clickable";
84
+ readonly LOADING: "card--state-loading";
85
+ readonly EXPANDED: "card--expanded";
86
+ /** Reserved modifier prefix; elevation currently uses styles. */
87
+ readonly ELEVATION_PREFIX: "card--elevation-";
85
88
  };
@@ -37,19 +37,19 @@ export const CARD_MEDIA_POSITION = {
37
37
  };
38
38
  export const CARD_CLASSES = {
39
39
  ROOT: 'card',
40
- HEADER: 'card-header',
41
- TITLE: 'card-title',
42
- SUBTITLE: 'card-subtitle',
43
- AVATAR: 'card-avatar',
44
- HEADER_ACTION: 'card-header-action',
45
- CONTENT: 'card-content',
46
- MEDIA: 'card-media',
47
- ACTIONS: 'card-actions',
48
- DRAGGABLE: 'card-draggable',
49
- INTERACTIVE: 'card-interactive',
50
- FULL_WIDTH: 'card-full-width',
51
- CLICKABLE: 'card-clickable',
52
- LOADING: 'card-loading',
53
- EXPANDED: 'card-expanded',
54
- ELEVATION_PREFIX: 'card-elevation-'
40
+ HEADER: 'card__header',
41
+ TITLE: 'card__header-title',
42
+ SUBTITLE: 'card__header-subtitle',
43
+ AVATAR: 'card__header-avatar',
44
+ HEADER_ACTION: 'card__header-action',
45
+ CONTENT: 'card__content',
46
+ MEDIA: 'card__media',
47
+ ACTIONS: 'card__actions',
48
+ DRAGGABLE: 'card--draggable',
49
+ INTERACTIVE: 'card--interactive',
50
+ FULL_WIDTH: 'card--full-width',
51
+ CLICKABLE: 'card--clickable',
52
+ LOADING: 'card--state-loading',
53
+ EXPANDED: 'card--expanded',
54
+ ELEVATION_PREFIX: 'card--elevation-'
55
55
  };
@@ -9,16 +9,16 @@ let headerCount = 0;
9
9
  export const createCardContent = (config = {}) => {
10
10
  const baseConfig = {
11
11
  ...config,
12
- componentName: 'card-content',
12
+ componentName: 'card__content',
13
13
  prefix: PREFIX
14
14
  };
15
15
  try {
16
16
  const content = pipe(createBase, withElement({
17
17
  tag: 'div',
18
- componentName: 'card-content',
18
+ componentName: 'card__content',
19
19
  className: [
20
20
  config.class,
21
- config.padding === false ? `${PREFIX}-card-content--no-padding` : null
21
+ config.padding === false ? `${PREFIX}-card__content--no-padding` : null
22
22
  ].filter((name) => Boolean(name)),
23
23
  attributes: {
24
24
  'role': 'region',
@@ -50,13 +50,13 @@ export const createCardContent = (config = {}) => {
50
50
  export const createCardHeader = (config = {}) => {
51
51
  const baseConfig = {
52
52
  ...config,
53
- componentName: 'card-header',
53
+ componentName: 'card__header',
54
54
  prefix: PREFIX
55
55
  };
56
56
  try {
57
57
  const header = pipe(createBase, withElement({
58
58
  tag: 'div',
59
- componentName: 'card-header',
59
+ componentName: 'card__header',
60
60
  className: config.class,
61
61
  attributes: {
62
62
  'role': 'heading',
@@ -65,13 +65,13 @@ export const createCardHeader = (config = {}) => {
65
65
  }))(baseConfig);
66
66
  const textContainer = createElement({
67
67
  tag: 'div',
68
- className: `${PREFIX}-card-header-text`,
68
+ className: `${PREFIX}-card__header-text`,
69
69
  container: header.element
70
70
  });
71
71
  if (config.title) {
72
72
  createElement({
73
73
  tag: 'h3',
74
- className: `${PREFIX}-card-header-title`,
74
+ className: `${PREFIX}-card__header-title`,
75
75
  text: config.title,
76
76
  container: textContainer,
77
77
  attributes: {
@@ -82,7 +82,7 @@ export const createCardHeader = (config = {}) => {
82
82
  if (config.subtitle) {
83
83
  createElement({
84
84
  tag: 'h4',
85
- className: `${PREFIX}-card-header-subtitle`,
85
+ className: `${PREFIX}-card__header-subtitle`,
86
86
  text: config.subtitle,
87
87
  container: textContainer
88
88
  });
@@ -91,7 +91,7 @@ export const createCardHeader = (config = {}) => {
91
91
  const avatarElement = typeof config.avatar === 'string'
92
92
  ? createElement({
93
93
  tag: 'div',
94
- className: `${PREFIX}-card-header-avatar`,
94
+ className: `${PREFIX}-card__header-avatar`,
95
95
  html: config.avatar
96
96
  })
97
97
  : config.avatar;
@@ -106,7 +106,7 @@ export const createCardHeader = (config = {}) => {
106
106
  const actionElement = typeof config.action === 'string'
107
107
  ? createElement({
108
108
  tag: 'div',
109
- className: `${PREFIX}-card-header-action`,
109
+ className: `${PREFIX}-card__header-action`,
110
110
  html: config.action
111
111
  })
112
112
  : config.action;
@@ -122,18 +122,18 @@ export const createCardHeader = (config = {}) => {
122
122
  export const createCardActions = (config = {}) => {
123
123
  const baseConfig = {
124
124
  ...config,
125
- componentName: 'card-actions',
125
+ componentName: 'card__actions',
126
126
  prefix: PREFIX
127
127
  };
128
128
  try {
129
129
  const actions = pipe(createBase, withElement({
130
130
  tag: 'div',
131
- componentName: 'card-actions',
131
+ componentName: 'card__actions',
132
132
  className: [
133
133
  config.class,
134
- config.fullBleed ? `${PREFIX}-card-actions--full-bleed` : null,
135
- config.vertical ? `${PREFIX}-card-actions--vertical` : null,
136
- config.align ? `${PREFIX}-card-actions--${config.align}` : null
134
+ config.fullBleed ? `${PREFIX}-card__actions--full-bleed` : null,
135
+ config.vertical ? `${PREFIX}-card__actions--vertical` : null,
136
+ config.align ? `${PREFIX}-card__actions--${config.align}` : null
137
137
  ].filter((name) => Boolean(name)),
138
138
  attributes: {
139
139
  'role': 'group'
@@ -161,17 +161,17 @@ export const createCardActions = (config = {}) => {
161
161
  export const createCardMedia = (config = {}) => {
162
162
  const baseConfig = {
163
163
  ...config,
164
- componentName: 'card-media',
164
+ componentName: 'card__media',
165
165
  prefix: PREFIX
166
166
  };
167
167
  try {
168
168
  const media = pipe(createBase, withElement({
169
169
  tag: 'div',
170
- componentName: 'card-media',
170
+ componentName: 'card__media',
171
171
  className: [
172
172
  config.class,
173
- config.aspectRatio ? `${PREFIX}-card-media--${config.aspectRatio.replace(':', '-')}` : null,
174
- config.contain ? `${PREFIX}-card-media--contain` : null
173
+ config.aspectRatio ? `${PREFIX}-card__media--${config.aspectRatio.replace(':', '-')}` : null,
174
+ config.contain ? `${PREFIX}-card__media--contain` : null
175
175
  ].filter((name) => Boolean(name))
176
176
  }))(baseConfig);
177
177
  if (config.element instanceof HTMLElement) {
@@ -180,7 +180,7 @@ export const createCardMedia = (config = {}) => {
180
180
  else if (config.src) {
181
181
  const img = document.createElement('img');
182
182
  img.src = safeUrl(config.src);
183
- img.className = `${PREFIX}-card-media-img`;
183
+ img.className = `${PREFIX}-card__media-img`;
184
184
  img.alt = config.alt || '';
185
185
  if (!config.alt) {
186
186
  img.setAttribute('aria-hidden', 'true');
@@ -16,7 +16,7 @@ export const withLoading = (config = {}) => (component) => {
16
16
  if (loading && !loadingElement) {
17
17
  loadingElement = createElement({
18
18
  tag: "div",
19
- className: `${PREFIX}-card-loading-overlay`,
19
+ className: `${PREFIX}-card__loading-overlay`,
20
20
  container: component.element,
21
21
  attributes: {
22
22
  role: "progressbar",
@@ -26,7 +26,7 @@ export const withLoading = (config = {}) => (component) => {
26
26
  });
27
27
  createElement({
28
28
  tag: "div",
29
- className: `${PREFIX}-card-loading-spinner`,
29
+ className: `${PREFIX}-card__loading-spinner`,
30
30
  container: loadingElement,
31
31
  });
32
32
  component.element.classList.add(`${PREFIX}-card--state-loading`);
@@ -66,7 +66,7 @@ export const withExpandable = (config = {}) => (component) => {
66
66
  const expandableContent = config.expandableContent;
67
67
  const expandButton = createElement({
68
68
  tag: "button",
69
- className: `${PREFIX}-card-expand-button`,
69
+ className: `${PREFIX}-card__expand-button`,
70
70
  attributes: {
71
71
  "aria-expanded": isExpanded ? "true" : "false",
72
72
  "aria-label": isExpanded ? "Collapse content" : "Expand content",
@@ -74,14 +74,14 @@ export const withExpandable = (config = {}) => (component) => {
74
74
  `${component.element.id || "card"}-expandable-content`,
75
75
  },
76
76
  });
77
- const actionsContainer = component.element.querySelector(`.${PREFIX}-card-actions`);
77
+ const actionsContainer = component.element.querySelector(`.${PREFIX}-card__actions`);
78
78
  if (actionsContainer) {
79
79
  actionsContainer.appendChild(expandButton);
80
80
  }
81
81
  else {
82
82
  const newActionsContainer = createElement({
83
83
  tag: "div",
84
- className: `${PREFIX}-card-actions`,
84
+ className: `${PREFIX}-card__actions`,
85
85
  container: component.element,
86
86
  attributes: {
87
87
  role: "group",
@@ -90,7 +90,7 @@ export const withExpandable = (config = {}) => (component) => {
90
90
  newActionsContainer.appendChild(expandButton);
91
91
  }
92
92
  if (expandableContent) {
93
- expandableContent.classList.add(`${PREFIX}-card-expandable-content`);
93
+ expandableContent.classList.add(`${PREFIX}-card__expandable-content`);
94
94
  if (!expandableContent.id) {
95
95
  expandableContent.id = `${component.element.id || "card"}-expandable-content`;
96
96
  }
@@ -148,7 +148,7 @@ export const withSwipeable = (config = {}) => (component) => {
148
148
  component.element.setAttribute("aria-description", "Swipeable card. Swipe left or right to perform actions.");
149
149
  const leftActionButton = createElement({
150
150
  tag: "button",
151
- className: `${PREFIX}-card-swipe-left-action`,
151
+ className: `${PREFIX}-card__swipe-left-action`,
152
152
  text: "Swipe Left Action",
153
153
  container: component.element,
154
154
  attributes: { "aria-label": "Perform swipe left action" },
@@ -156,7 +156,7 @@ export const withSwipeable = (config = {}) => (component) => {
156
156
  });
157
157
  const rightActionButton = createElement({
158
158
  tag: "button",
159
- className: `${PREFIX}-card-swipe-right-action`,
159
+ className: `${PREFIX}-card__swipe-right-action`,
160
160
  text: "Swipe Right Action",
161
161
  container: component.element,
162
162
  attributes: { "aria-label": "Perform swipe right action" },
@@ -166,14 +166,14 @@ export const withSwipeable = (config = {}) => (component) => {
166
166
  if (config.onSwipeLeft) {
167
167
  component.element.style.transform = "translateX(-100%)";
168
168
  component.element.style.transition = "transform 0.3s ease";
169
- config.onSwipeLeft(component);
169
+ config.onSwipeLeft(card);
170
170
  }
171
171
  });
172
172
  rightActionButton.addEventListener("click", () => {
173
173
  if (config.onSwipeRight) {
174
174
  component.element.style.transform = "translateX(100%)";
175
175
  component.element.style.transition = "transform 0.3s ease";
176
- config.onSwipeRight(component);
176
+ config.onSwipeRight(card);
177
177
  }
178
178
  });
179
179
  function handleTouchStart(e) {
@@ -195,11 +195,11 @@ export const withSwipeable = (config = {}) => (component) => {
195
195
  if (Math.abs(diffX) >= threshold) {
196
196
  if (diffX > 0 && config.onSwipeRight) {
197
197
  component.element.style.transform = "translateX(100%)";
198
- config.onSwipeRight(component);
198
+ config.onSwipeRight(card);
199
199
  }
200
200
  else if (diffX < 0 && config.onSwipeLeft) {
201
201
  component.element.style.transform = "translateX(-100%)";
202
- config.onSwipeLeft(component);
202
+ config.onSwipeLeft(card);
203
203
  }
204
204
  else {
205
205
  component.element.style.transform = "translateX(0)";
@@ -215,7 +215,7 @@ export const withSwipeable = (config = {}) => (component) => {
215
215
  component.element.addEventListener("touchmove", handleTouchMove, { passive: true });
216
216
  component.element.addEventListener("touchend", handleTouchEnd);
217
217
  component.element.classList.add(`${PREFIX}-card--swipeable`);
218
- return {
218
+ const card = {
219
219
  ...component,
220
220
  swipeable: {
221
221
  reset: () => {
@@ -224,4 +224,5 @@ export const withSwipeable = (config = {}) => (component) => {
224
224
  },
225
225
  },
226
226
  };
227
+ return card;
227
228
  };
@@ -44,7 +44,7 @@
44
44
  *
45
45
  * // Modify card programmatically using API methods
46
46
  * const image = document.createElement('div');
47
- * image.className = 'mtrl-card-media';
47
+ * image.className = 'mtrl-card__media';
48
48
  * image.style.backgroundImage = 'url(path/to/image.jpg)';
49
49
  *
50
50
  * card.addMedia(image, 'top')
@@ -209,7 +209,7 @@ export interface BaseComponent {
209
209
  /** The DOM element */
210
210
  element: HTMLElement;
211
211
  /** Get class name with prefix */
212
- getClass: (name?: string) => string;
212
+ getClass: (name: string) => string;
213
213
  /** Get modifier class */
214
214
  getModifierClass: (base: string, modifier: string) => string;
215
215
  /** Get element class */
@@ -295,7 +295,7 @@ export interface CardComponent extends BaseComponent {
295
295
  * @example
296
296
  * ```typescript
297
297
  * const content = document.createElement('div');
298
- * content.className = 'mtrl-card-content';
298
+ * content.className = 'mtrl-card__content';
299
299
  * content.textContent = 'Card content goes here';
300
300
  * card.addContent(content);
301
301
  * ```
@@ -327,7 +327,7 @@ export interface CardComponent extends BaseComponent {
327
327
  * ```typescript
328
328
  * // Creating media element
329
329
  * const media = document.createElement('div');
330
- * media.className = 'mtrl-card-media';
330
+ * media.className = 'mtrl-card__media';
331
331
  *
332
332
  * // Adding at the top (default)
333
333
  * card.addMedia(media);
@@ -349,7 +349,7 @@ export interface CardComponent extends BaseComponent {
349
349
  * ```typescript
350
350
  * // Create actions container
351
351
  * const actions = document.createElement('div');
352
- * actions.className = 'mtrl-card-actions';
352
+ * actions.className = 'mtrl-card__actions';
353
353
  *
354
354
  * // Add buttons to actions
355
355
  * const button = document.createElement('button');