mtrl 0.8.0-next.8 → 0.8.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 (871) hide show
  1. package/README.md +112 -283
  2. package/dist/README.md +112 -283
  3. package/dist/components/badge/api.d.ts +1 -1
  4. package/dist/components/badge/api.js +162 -0
  5. package/dist/components/badge/badge.d.ts +1 -1
  6. package/dist/components/badge/badge.js +18 -0
  7. package/dist/components/badge/config.d.ts +1 -1
  8. package/dist/components/badge/config.js +63 -0
  9. package/dist/components/badge/constants.js +20 -0
  10. package/dist/components/badge/features.d.ts +1 -1
  11. package/dist/components/badge/features.js +95 -0
  12. package/dist/components/badge/index.d.ts +2 -2
  13. package/dist/components/badge/index.js +1 -0
  14. package/dist/components/badge/types.js +1 -0
  15. package/dist/components/bottom-app-bar/bottom-app-bar.d.ts +1 -1
  16. package/dist/components/bottom-app-bar/bottom-app-bar.js +91 -0
  17. package/dist/components/bottom-app-bar/config.d.ts +1 -1
  18. package/dist/components/bottom-app-bar/config.js +10 -0
  19. package/dist/components/bottom-app-bar/constants.js +13 -0
  20. package/dist/components/bottom-app-bar/index.d.ts +2 -2
  21. package/dist/components/bottom-app-bar/index.js +3 -0
  22. package/dist/components/bottom-app-bar/types.d.ts +1 -1
  23. package/dist/components/bottom-app-bar/types.js +1 -0
  24. package/dist/components/bottom-sheet/api.d.ts +43 -0
  25. package/dist/components/bottom-sheet/api.js +56 -0
  26. package/dist/components/bottom-sheet/bottom-sheet.d.ts +24 -0
  27. package/dist/components/bottom-sheet/bottom-sheet.js +18 -0
  28. package/dist/components/bottom-sheet/config.d.ts +34 -0
  29. package/dist/components/bottom-sheet/config.js +19 -0
  30. package/dist/components/bottom-sheet/constants.d.ts +65 -0
  31. package/dist/components/bottom-sheet/constants.js +35 -0
  32. package/dist/components/bottom-sheet/features/drag.d.ts +32 -0
  33. package/dist/components/bottom-sheet/features/drag.js +71 -0
  34. package/dist/components/bottom-sheet/features/index.d.ts +3 -0
  35. package/dist/components/bottom-sheet/features/index.js +3 -0
  36. package/dist/components/bottom-sheet/features/state.d.ts +31 -0
  37. package/dist/components/bottom-sheet/features/state.js +82 -0
  38. package/dist/components/bottom-sheet/features/structure.d.ts +26 -0
  39. package/dist/components/bottom-sheet/features/structure.js +88 -0
  40. package/dist/components/bottom-sheet/index.d.ts +2 -0
  41. package/dist/components/bottom-sheet/index.js +1 -0
  42. package/dist/components/bottom-sheet/types.d.ts +116 -0
  43. package/dist/components/bottom-sheet/types.js +1 -0
  44. package/dist/components/button/api.d.ts +2 -2
  45. package/dist/components/button/api.js +265 -0
  46. package/dist/components/button/button.d.ts +1 -1
  47. package/dist/components/button/button.js +25 -0
  48. package/dist/components/button/config.d.ts +1 -1
  49. package/dist/components/button/config.js +51 -0
  50. package/dist/components/button/constants.js +35 -0
  51. package/dist/components/button/features/progress.d.ts +2 -2
  52. package/dist/components/button/features/progress.js +163 -0
  53. package/dist/components/button/features/toggle.d.ts +1 -1
  54. package/dist/components/button/features/toggle.js +33 -0
  55. package/dist/components/button/index.d.ts +3 -3
  56. package/dist/components/button/index.js +1 -0
  57. package/dist/components/button/types.d.ts +3 -3
  58. package/dist/components/button/types.js +1 -0
  59. package/dist/components/button-group/button-group.d.ts +1 -1
  60. package/dist/components/button-group/button-group.js +358 -0
  61. package/dist/components/button-group/config.d.ts +10 -10
  62. package/dist/components/button-group/config.js +123 -0
  63. package/dist/components/button-group/constants.d.ts +8 -0
  64. package/dist/components/button-group/constants.js +94 -0
  65. package/dist/components/button-group/index.d.ts +4 -4
  66. package/dist/components/button-group/index.js +3 -0
  67. package/dist/components/button-group/types.d.ts +1 -1
  68. package/dist/components/button-group/types.js +1 -0
  69. package/dist/components/card/api.d.ts +1 -1
  70. package/dist/components/card/api.js +74 -0
  71. package/dist/components/card/card.d.ts +1 -1
  72. package/dist/components/card/card.js +20 -0
  73. package/dist/components/card/config.d.ts +1 -1
  74. package/dist/components/card/config.js +161 -0
  75. package/dist/components/card/constants.js +55 -0
  76. package/dist/components/card/content.d.ts +1 -1
  77. package/dist/components/card/content.js +195 -0
  78. package/dist/components/card/features.d.ts +1 -1
  79. package/dist/components/card/features.js +225 -0
  80. package/dist/components/card/index.d.ts +5 -5
  81. package/dist/components/card/index.js +4 -0
  82. package/dist/components/card/types.js +1 -0
  83. package/dist/components/carousel/api.d.ts +1 -1
  84. package/dist/components/carousel/api.js +46 -0
  85. package/dist/components/carousel/arrangement.js +61 -0
  86. package/dist/components/carousel/carousel.d.ts +1 -1
  87. package/dist/components/carousel/carousel.js +11 -0
  88. package/dist/components/carousel/config.d.ts +1 -1
  89. package/dist/components/carousel/config.js +40 -0
  90. package/dist/components/carousel/constants.js +23 -0
  91. package/dist/components/carousel/features/index.d.ts +2 -2
  92. package/dist/components/carousel/features/index.js +2 -0
  93. package/dist/components/carousel/features/scroll.d.ts +2 -2
  94. package/dist/components/carousel/features/scroll.js +345 -0
  95. package/dist/components/carousel/features/slides.d.ts +1 -1
  96. package/dist/components/carousel/features/slides.js +127 -0
  97. package/dist/components/carousel/index.d.ts +3 -3
  98. package/dist/components/carousel/index.js +2 -0
  99. package/dist/components/carousel/keylines.js +292 -0
  100. package/dist/components/carousel/strategy.d.ts +1 -1
  101. package/dist/components/carousel/strategy.js +207 -0
  102. package/dist/components/carousel/types.js +1 -0
  103. package/dist/components/checkbox/api.d.ts +1 -1
  104. package/dist/components/checkbox/api.js +82 -0
  105. package/dist/components/checkbox/checkbox.d.ts +1 -1
  106. package/dist/components/checkbox/checkbox.js +29 -0
  107. package/dist/components/checkbox/config.d.ts +1 -1
  108. package/dist/components/checkbox/config.js +44 -0
  109. package/dist/components/checkbox/constants.js +20 -0
  110. package/dist/components/checkbox/index.d.ts +3 -3
  111. package/dist/components/checkbox/index.js +2 -0
  112. package/dist/components/checkbox/types.js +1 -0
  113. package/dist/components/chips/api.d.ts +1 -1
  114. package/dist/components/chips/api.js +153 -0
  115. package/dist/components/chips/chip/api.d.ts +1 -1
  116. package/dist/components/chips/chip/api.js +186 -0
  117. package/dist/components/chips/chip/chip.d.ts +1 -1
  118. package/dist/components/chips/chip/chip.js +78 -0
  119. package/dist/components/chips/chip/config.d.ts +1 -1
  120. package/dist/components/chips/chip/config.js +53 -0
  121. package/dist/components/chips/chip/constants.js +18 -0
  122. package/dist/components/chips/chip/index.d.ts +2 -2
  123. package/dist/components/chips/chip/index.js +2 -0
  124. package/dist/components/chips/chip/types.d.ts +1 -1
  125. package/dist/components/chips/chip/types.js +1 -0
  126. package/dist/components/chips/chips.d.ts +1 -1
  127. package/dist/components/chips/chips.js +32 -0
  128. package/dist/components/chips/config.d.ts +1 -1
  129. package/dist/components/chips/config.js +82 -0
  130. package/dist/components/chips/constants.js +20 -0
  131. package/dist/components/chips/features/chip-items.d.ts +1 -1
  132. package/dist/components/chips/features/chip-items.js +17 -0
  133. package/dist/components/chips/features/container.d.ts +1 -1
  134. package/dist/components/chips/features/container.js +41 -0
  135. package/dist/components/chips/features/controller.d.ts +1 -1
  136. package/dist/components/chips/features/controller.js +309 -0
  137. package/dist/components/chips/features/dom.d.ts +2 -2
  138. package/dist/components/chips/features/dom.js +27 -0
  139. package/dist/components/chips/features/index.d.ts +5 -5
  140. package/dist/components/chips/features/index.js +5 -0
  141. package/dist/components/chips/features/label.d.ts +1 -1
  142. package/dist/components/chips/features/label.js +63 -0
  143. package/dist/components/chips/index.d.ts +3 -3
  144. package/dist/components/chips/index.js +2 -0
  145. package/dist/components/chips/schema.d.ts +1 -1
  146. package/dist/components/chips/schema.js +46 -0
  147. package/dist/components/chips/types.js +11 -0
  148. package/dist/components/datepicker/api.d.ts +1 -1
  149. package/dist/components/datepicker/api.js +180 -0
  150. package/dist/components/datepicker/config.d.ts +1 -1
  151. package/dist/components/datepicker/config.js +89 -0
  152. package/dist/components/datepicker/constants.js +50 -0
  153. package/dist/components/datepicker/datepicker.d.ts +1 -1
  154. package/dist/components/datepicker/datepicker.js +238 -0
  155. package/dist/components/datepicker/index.d.ts +3 -3
  156. package/dist/components/datepicker/index.js +2 -0
  157. package/dist/components/datepicker/render.js +290 -0
  158. package/dist/components/datepicker/types.js +18 -0
  159. package/dist/components/datepicker/utils.d.ts +1 -1
  160. package/dist/components/datepicker/utils.js +156 -0
  161. package/dist/components/dialog/api.d.ts +1 -1
  162. package/dist/components/dialog/api.js +106 -0
  163. package/dist/components/dialog/config.d.ts +2 -6
  164. package/dist/components/dialog/config.js +84 -0
  165. package/dist/components/dialog/constants.js +51 -0
  166. package/dist/components/dialog/dialog.d.ts +1 -1
  167. package/dist/components/dialog/dialog.js +25 -0
  168. package/dist/components/dialog/features.d.ts +1 -6
  169. package/dist/components/dialog/features.js +619 -0
  170. package/dist/components/dialog/index.d.ts +2 -2
  171. package/dist/components/dialog/index.js +1 -0
  172. package/dist/components/dialog/types.d.ts +14 -3
  173. package/dist/components/dialog/types.js +1 -0
  174. package/dist/components/divider/config.js +9 -0
  175. package/dist/components/divider/constants.js +18 -0
  176. package/dist/components/divider/divider.d.ts +3 -3
  177. package/dist/components/divider/divider.js +11 -0
  178. package/dist/components/divider/features.d.ts +3 -3
  179. package/dist/components/divider/features.js +141 -0
  180. package/dist/components/divider/index.d.ts +3 -3
  181. package/dist/components/divider/index.js +2 -0
  182. package/dist/components/divider/types.d.ts +1 -1
  183. package/dist/components/divider/types.js +1 -0
  184. package/dist/components/drawer/api.d.ts +1 -1
  185. package/dist/components/drawer/api.js +73 -0
  186. package/dist/components/drawer/config.d.ts +3 -2
  187. package/dist/components/drawer/config.js +66 -0
  188. package/dist/components/drawer/constants.d.ts +2 -0
  189. package/dist/components/drawer/constants.js +46 -0
  190. package/dist/components/drawer/drawer.d.ts +1 -1
  191. package/dist/components/drawer/drawer.js +42 -0
  192. package/dist/components/drawer/features/headline.d.ts +1 -1
  193. package/dist/components/drawer/features/headline.js +36 -0
  194. package/dist/components/drawer/features/index.d.ts +3 -3
  195. package/dist/components/drawer/features/index.js +3 -0
  196. package/dist/components/drawer/features/items.d.ts +1 -1
  197. package/dist/components/drawer/features/items.js +215 -0
  198. package/dist/components/drawer/features/state.d.ts +2 -10
  199. package/dist/components/drawer/features/state.js +170 -0
  200. package/dist/components/drawer/index.d.ts +2 -2
  201. package/dist/components/drawer/index.js +1 -0
  202. package/dist/components/drawer/types.d.ts +8 -2
  203. package/dist/components/drawer/types.js +1 -0
  204. package/dist/components/extended-fab/api.d.ts +1 -1
  205. package/dist/components/extended-fab/api.js +77 -0
  206. package/dist/components/extended-fab/config.d.ts +1 -1
  207. package/dist/components/extended-fab/config.js +73 -0
  208. package/dist/components/extended-fab/constants.d.ts +16 -4
  209. package/dist/components/extended-fab/constants.js +47 -0
  210. package/dist/components/extended-fab/extended-fab.d.ts +1 -1
  211. package/dist/components/extended-fab/extended-fab.js +59 -0
  212. package/dist/components/extended-fab/index.d.ts +2 -2
  213. package/dist/components/extended-fab/index.js +1 -0
  214. package/dist/components/extended-fab/types.d.ts +13 -6
  215. package/dist/components/extended-fab/types.js +1 -0
  216. package/dist/components/fab/api.d.ts +1 -1
  217. package/dist/components/fab/api.js +52 -0
  218. package/dist/components/fab/config.d.ts +1 -1
  219. package/dist/components/fab/config.js +53 -0
  220. package/dist/components/fab/constants.d.ts +18 -7
  221. package/dist/components/fab/constants.js +43 -0
  222. package/dist/components/fab/fab.d.ts +1 -1
  223. package/dist/components/fab/fab.js +17 -0
  224. package/dist/components/fab/index.d.ts +3 -3
  225. package/dist/components/fab/index.js +1 -0
  226. package/dist/components/fab/types.d.ts +10 -9
  227. package/dist/components/fab/types.js +1 -0
  228. package/dist/components/icon-button/api.d.ts +1 -1
  229. package/dist/components/icon-button/api.js +204 -0
  230. package/dist/components/icon-button/config.d.ts +1 -1
  231. package/dist/components/icon-button/config.js +91 -0
  232. package/dist/components/icon-button/constants.d.ts +21 -21
  233. package/dist/components/icon-button/constants.js +67 -0
  234. package/dist/components/icon-button/features/toggle.d.ts +1 -1
  235. package/dist/components/icon-button/features/toggle.js +122 -0
  236. package/dist/components/icon-button/icon-button.d.ts +1 -1
  237. package/dist/components/icon-button/icon-button.js +24 -0
  238. package/dist/components/icon-button/index.d.ts +4 -4
  239. package/dist/components/icon-button/index.js +2 -0
  240. package/dist/components/icon-button/types.d.ts +2 -2
  241. package/dist/components/icon-button/types.js +1 -0
  242. package/dist/components/index.d.ts +83 -69
  243. package/dist/components/index.js +41 -0
  244. package/dist/components/list/api.js +53 -0
  245. package/dist/components/list/config.d.ts +2 -2
  246. package/dist/components/list/config.js +80 -0
  247. package/dist/components/list/constants.js +35 -0
  248. package/dist/components/list/features/index.d.ts +2 -2
  249. package/dist/components/list/features/index.js +2 -0
  250. package/dist/components/list/features/renderer.js +120 -0
  251. package/dist/components/list/features/selection.js +160 -0
  252. package/dist/components/list/index.d.ts +3 -3
  253. package/dist/components/list/index.js +2 -0
  254. package/dist/components/list/list.js +19 -0
  255. package/dist/components/list/types.js +1 -0
  256. package/dist/components/loading-indicator/api.d.ts +14 -0
  257. package/dist/components/loading-indicator/api.js +122 -0
  258. package/dist/components/loading-indicator/config.d.ts +44 -0
  259. package/dist/components/loading-indicator/config.js +25 -0
  260. package/dist/components/loading-indicator/constants.d.ts +60 -0
  261. package/dist/components/loading-indicator/constants.js +32 -0
  262. package/dist/components/loading-indicator/features/motion.d.ts +22 -0
  263. package/dist/components/loading-indicator/features/motion.js +47 -0
  264. package/dist/components/loading-indicator/features/renderer.d.ts +29 -0
  265. package/dist/components/loading-indicator/features/renderer.js +115 -0
  266. package/dist/components/loading-indicator/index.d.ts +3 -0
  267. package/dist/components/loading-indicator/index.js +2 -0
  268. package/dist/components/loading-indicator/loading-indicator.d.ts +9 -0
  269. package/dist/components/loading-indicator/loading-indicator.js +17 -0
  270. package/dist/components/loading-indicator/types.d.ts +65 -0
  271. package/dist/components/loading-indicator/types.js +1 -0
  272. package/dist/components/menu/api.d.ts +1 -1
  273. package/dist/components/menu/api.js +79 -0
  274. package/dist/components/menu/config.d.ts +1 -1
  275. package/dist/components/menu/config.js +82 -0
  276. package/dist/components/menu/constants.d.ts +32 -0
  277. package/dist/components/menu/constants.js +61 -0
  278. package/dist/components/menu/features/controller.d.ts +1 -1
  279. package/dist/components/menu/features/controller.js +542 -0
  280. package/dist/components/menu/features/index.d.ts +5 -5
  281. package/dist/components/menu/features/index.js +6 -0
  282. package/dist/components/menu/features/keyboard.d.ts +3 -1
  283. package/dist/components/menu/features/keyboard.js +296 -0
  284. package/dist/components/menu/features/opener.d.ts +1 -1
  285. package/dist/components/menu/features/opener.js +300 -0
  286. package/dist/components/menu/features/position.d.ts +1 -1
  287. package/dist/components/menu/features/position.js +276 -0
  288. package/dist/components/menu/features/registry.d.ts +37 -0
  289. package/dist/components/menu/features/registry.js +13 -0
  290. package/dist/components/menu/features/submenu.d.ts +1 -1
  291. package/dist/components/menu/features/submenu.js +386 -0
  292. package/dist/components/menu/features/tasks.d.ts +9 -0
  293. package/dist/components/menu/features/tasks.js +47 -0
  294. package/dist/components/menu/index.d.ts +3 -3
  295. package/dist/components/menu/index.js +2 -0
  296. package/dist/components/menu/menu.d.ts +1 -1
  297. package/dist/components/menu/menu.js +25 -0
  298. package/dist/components/menu/types.d.ts +46 -3
  299. package/dist/components/menu/types.js +14 -0
  300. package/dist/components/navigation/api.d.ts +1 -1
  301. package/dist/components/navigation/api.js +117 -0
  302. package/dist/components/navigation/config.d.ts +1 -1
  303. package/dist/components/navigation/config.js +39 -0
  304. package/dist/components/navigation/constants.js +65 -0
  305. package/dist/components/navigation/features/controller.d.ts +1 -1
  306. package/dist/components/navigation/features/controller.js +173 -0
  307. package/dist/components/navigation/features/items.d.ts +2 -2
  308. package/dist/components/navigation/features/items.js +236 -0
  309. package/dist/components/navigation/index.d.ts +3 -3
  310. package/dist/components/navigation/index.js +2 -0
  311. package/dist/components/navigation/nav-item.d.ts +1 -1
  312. package/dist/components/navigation/nav-item.js +118 -0
  313. package/dist/components/navigation/navigation.d.ts +1 -1
  314. package/dist/components/navigation/navigation.js +52 -0
  315. package/dist/components/navigation/system/core.d.ts +1 -1
  316. package/dist/components/navigation/system/core.js +148 -0
  317. package/dist/components/navigation/system/events.d.ts +1 -1
  318. package/dist/components/navigation/system/events.js +126 -0
  319. package/dist/components/navigation/system/index.d.ts +2 -2
  320. package/dist/components/navigation/system/index.js +92 -0
  321. package/dist/components/navigation/system/mobile.d.ts +1 -1
  322. package/dist/components/navigation/system/mobile.js +139 -0
  323. package/dist/components/navigation/system/state.d.ts +1 -1
  324. package/dist/components/navigation/system/state.js +44 -0
  325. package/dist/components/navigation/system/types.js +1 -0
  326. package/dist/components/navigation/types.js +33 -0
  327. package/dist/components/navigation-rail/config.d.ts +2 -0
  328. package/dist/components/navigation-rail/config.js +15 -0
  329. package/dist/components/navigation-rail/constants.d.ts +14 -0
  330. package/dist/components/navigation-rail/constants.js +12 -0
  331. package/dist/components/navigation-rail/index.d.ts +2 -0
  332. package/dist/components/navigation-rail/index.js +1 -0
  333. package/dist/components/navigation-rail/navigation-rail.d.ts +7 -0
  334. package/dist/components/navigation-rail/navigation-rail.js +341 -0
  335. package/dist/components/navigation-rail/ripple.d.ts +2 -0
  336. package/dist/components/navigation-rail/ripple.js +41 -0
  337. package/dist/components/navigation-rail/types.d.ts +72 -0
  338. package/dist/components/navigation-rail/types.js +1 -0
  339. package/dist/components/progress/api.d.ts +3 -3
  340. package/dist/components/progress/api.js +205 -0
  341. package/dist/components/progress/config.d.ts +1 -1
  342. package/dist/components/progress/config.js +162 -0
  343. package/dist/components/progress/constants.d.ts +103 -84
  344. package/dist/components/progress/constants.js +110 -0
  345. package/dist/components/progress/features/canvas.d.ts +18 -29
  346. package/dist/components/progress/features/canvas.js +300 -0
  347. package/dist/components/progress/features/circular.d.ts +17 -7
  348. package/dist/components/progress/features/circular.js +71 -0
  349. package/dist/components/progress/features/colors.d.ts +16 -0
  350. package/dist/components/progress/features/colors.js +40 -0
  351. package/dist/components/progress/features/index.d.ts +4 -4
  352. package/dist/components/progress/features/index.js +4 -0
  353. package/dist/components/progress/features/linear.d.ts +23 -7
  354. package/dist/components/progress/features/linear.js +104 -0
  355. package/dist/components/progress/features/motion.d.ts +43 -0
  356. package/dist/components/progress/features/motion.js +105 -0
  357. package/dist/components/progress/features/resize-observer.js +40 -0
  358. package/dist/components/progress/features/state.d.ts +1 -1
  359. package/dist/components/progress/features/state.js +37 -0
  360. package/dist/components/progress/index.d.ts +2 -2
  361. package/dist/components/progress/index.js +1 -0
  362. package/dist/components/progress/progress.d.ts +1 -1
  363. package/dist/components/progress/progress.js +21 -0
  364. package/dist/components/progress/types.d.ts +19 -2
  365. package/dist/components/progress/types.js +1 -0
  366. package/dist/components/radios/api.d.ts +1 -1
  367. package/dist/components/radios/api.js +73 -0
  368. package/dist/components/radios/config.d.ts +1 -1
  369. package/dist/components/radios/config.js +28 -0
  370. package/dist/components/radios/constants.js +53 -0
  371. package/dist/components/radios/index.d.ts +3 -3
  372. package/dist/components/radios/index.js +2 -0
  373. package/dist/components/radios/radio.d.ts +1 -1
  374. package/dist/components/radios/radio.js +186 -0
  375. package/dist/components/radios/radios.d.ts +1 -1
  376. package/dist/components/radios/radios.js +21 -0
  377. package/dist/components/radios/types.js +1 -0
  378. package/dist/components/search/api.d.ts +1 -1
  379. package/dist/components/search/api.js +110 -0
  380. package/dist/components/search/config.d.ts +1 -1
  381. package/dist/components/search/config.js +66 -0
  382. package/dist/components/search/constants.js +84 -0
  383. package/dist/components/search/features/index.d.ts +4 -4
  384. package/dist/components/search/features/index.js +4 -0
  385. package/dist/components/search/features/input.d.ts +1 -1
  386. package/dist/components/search/features/input.js +245 -0
  387. package/dist/components/search/features/states.d.ts +1 -1
  388. package/dist/components/search/features/states.js +182 -0
  389. package/dist/components/search/features/structure.d.ts +1 -1
  390. package/dist/components/search/features/structure.js +165 -0
  391. package/dist/components/search/features/suggestions.d.ts +1 -1
  392. package/dist/components/search/features/suggestions.js +223 -0
  393. package/dist/components/search/index.d.ts +2 -2
  394. package/dist/components/search/index.js +1 -0
  395. package/dist/components/search/search.d.ts +1 -1
  396. package/dist/components/search/search.js +27 -0
  397. package/dist/components/search/types.js +1 -0
  398. package/dist/components/segmented-button/config.d.ts +1 -8
  399. package/dist/components/segmented-button/config.js +54 -0
  400. package/dist/components/segmented-button/constants.js +40 -0
  401. package/dist/components/segmented-button/index.d.ts +3 -3
  402. package/dist/components/segmented-button/index.js +2 -0
  403. package/dist/components/segmented-button/segment.d.ts +2 -1
  404. package/dist/components/segmented-button/segment.js +94 -0
  405. package/dist/components/segmented-button/segmented-button.d.ts +12 -1
  406. package/dist/components/segmented-button/segmented-button.js +195 -0
  407. package/dist/components/segmented-button/types.d.ts +11 -11
  408. package/dist/components/segmented-button/types.js +11 -0
  409. package/dist/components/select/api.d.ts +1 -1
  410. package/dist/components/select/api.js +89 -0
  411. package/dist/components/select/config.d.ts +1 -1
  412. package/dist/components/select/config.js +54 -0
  413. package/dist/components/select/constants.js +53 -0
  414. package/dist/components/select/features.d.ts +1 -1
  415. package/dist/components/select/features.js +246 -0
  416. package/dist/components/select/index.d.ts +3 -3
  417. package/dist/components/select/index.js +2 -0
  418. package/dist/components/select/select.d.ts +1 -1
  419. package/dist/components/select/select.js +26 -0
  420. package/dist/components/select/types.d.ts +21 -0
  421. package/dist/components/select/types.js +4 -0
  422. package/dist/components/side-sheet/api.d.ts +33 -0
  423. package/dist/components/side-sheet/api.js +50 -0
  424. package/dist/components/side-sheet/config.d.ts +34 -0
  425. package/dist/components/side-sheet/config.js +20 -0
  426. package/dist/components/side-sheet/constants.d.ts +60 -0
  427. package/dist/components/side-sheet/constants.js +32 -0
  428. package/dist/components/side-sheet/features/index.d.ts +2 -0
  429. package/dist/components/side-sheet/features/index.js +2 -0
  430. package/dist/components/side-sheet/features/state.d.ts +28 -0
  431. package/dist/components/side-sheet/features/state.js +67 -0
  432. package/dist/components/side-sheet/features/structure.d.ts +21 -0
  433. package/dist/components/side-sheet/features/structure.js +97 -0
  434. package/dist/components/side-sheet/index.d.ts +2 -0
  435. package/dist/components/side-sheet/index.js +1 -0
  436. package/dist/components/side-sheet/side-sheet.d.ts +24 -0
  437. package/dist/components/side-sheet/side-sheet.js +17 -0
  438. package/dist/components/side-sheet/types.d.ts +102 -0
  439. package/dist/components/side-sheet/types.js +1 -0
  440. package/dist/components/slider/api.d.ts +2 -2
  441. package/dist/components/slider/api.js +104 -0
  442. package/dist/components/slider/config.d.ts +1 -1
  443. package/dist/components/slider/config.js +106 -0
  444. package/dist/components/slider/constants.js +74 -0
  445. package/dist/components/slider/features/controller.d.ts +1 -1
  446. package/dist/components/slider/features/controller.js +291 -0
  447. package/dist/components/slider/features/dom.d.ts +2 -2
  448. package/dist/components/slider/features/dom.js +113 -0
  449. package/dist/components/slider/features/handlers.d.ts +1 -1
  450. package/dist/components/slider/features/handlers.js +389 -0
  451. package/dist/components/slider/features/index.d.ts +5 -5
  452. package/dist/components/slider/features/index.js +5 -0
  453. package/dist/components/slider/features/range.d.ts +1 -1
  454. package/dist/components/slider/features/range.js +70 -0
  455. package/dist/components/slider/features/states.d.ts +1 -1
  456. package/dist/components/slider/features/states.js +119 -0
  457. package/dist/components/slider/features/tracks.d.ts +13 -0
  458. package/dist/components/slider/features/tracks.js +174 -0
  459. package/dist/components/slider/index.d.ts +2 -2
  460. package/dist/components/slider/index.js +1 -0
  461. package/dist/components/slider/slider.d.ts +2 -2
  462. package/dist/components/slider/slider.js +27 -0
  463. package/dist/components/slider/types.d.ts +4 -3
  464. package/dist/components/slider/types.js +2 -0
  465. package/dist/components/snackbar/api.d.ts +2 -2
  466. package/dist/components/snackbar/api.js +173 -0
  467. package/dist/components/snackbar/config.d.ts +26 -11
  468. package/dist/components/snackbar/config.js +33 -0
  469. package/dist/components/snackbar/constants.d.ts +73 -47
  470. package/dist/components/snackbar/constants.js +60 -0
  471. package/dist/components/snackbar/features.d.ts +17 -4
  472. package/dist/components/snackbar/features.js +125 -0
  473. package/dist/components/snackbar/index.d.ts +4 -4
  474. package/dist/components/snackbar/index.js +3 -0
  475. package/dist/components/snackbar/position.d.ts +3 -2
  476. package/dist/components/snackbar/position.js +24 -0
  477. package/dist/components/snackbar/queue.d.ts +1 -1
  478. package/dist/components/snackbar/queue.js +79 -0
  479. package/dist/components/snackbar/snackbar.d.ts +1 -1
  480. package/dist/components/snackbar/snackbar.js +25 -0
  481. package/dist/components/snackbar/types.d.ts +56 -57
  482. package/dist/components/snackbar/types.js +1 -0
  483. package/dist/components/split-button/api.d.ts +14 -0
  484. package/dist/components/split-button/api.js +122 -0
  485. package/dist/components/split-button/config.d.ts +40 -0
  486. package/dist/components/split-button/config.js +19 -0
  487. package/dist/components/split-button/constants.d.ts +67 -0
  488. package/dist/components/split-button/constants.js +35 -0
  489. package/dist/components/split-button/features/buttons.d.ts +7 -0
  490. package/dist/components/split-button/features/buttons.js +39 -0
  491. package/dist/components/split-button/features/menu.d.ts +7 -0
  492. package/dist/components/split-button/features/menu.js +19 -0
  493. package/dist/components/split-button/index.d.ts +3 -0
  494. package/dist/components/split-button/index.js +2 -0
  495. package/dist/components/split-button/split-button.d.ts +24 -0
  496. package/dist/components/split-button/split-button.js +21 -0
  497. package/dist/components/split-button/types.d.ts +116 -0
  498. package/dist/components/split-button/types.js +1 -0
  499. package/dist/components/switch/api.d.ts +1 -1
  500. package/dist/components/switch/api.js +91 -0
  501. package/dist/components/switch/config.d.ts +1 -1
  502. package/dist/components/switch/config.js +27 -0
  503. package/dist/components/switch/constants.js +39 -0
  504. package/dist/components/switch/features.d.ts +3 -3
  505. package/dist/components/switch/features.js +101 -0
  506. package/dist/components/switch/index.d.ts +5 -4
  507. package/dist/components/switch/index.js +3 -0
  508. package/dist/components/switch/switch.d.ts +1 -1
  509. package/dist/components/switch/switch.js +18 -0
  510. package/dist/components/switch/types.js +4 -0
  511. package/dist/components/tabs/api.d.ts +1 -1
  512. package/dist/components/tabs/api.js +98 -0
  513. package/dist/components/tabs/config.d.ts +2 -2
  514. package/dist/components/tabs/config.js +42 -0
  515. package/dist/components/tabs/constants.js +62 -0
  516. package/dist/components/tabs/features.d.ts +2 -2
  517. package/dist/components/tabs/features.js +179 -0
  518. package/dist/components/tabs/index.d.ts +10 -9
  519. package/dist/components/tabs/index.js +10 -0
  520. package/dist/components/tabs/indicator.d.ts +1 -1
  521. package/dist/components/tabs/indicator.js +134 -0
  522. package/dist/components/tabs/responsive.d.ts +1 -1
  523. package/dist/components/tabs/responsive.js +72 -0
  524. package/dist/components/tabs/scroll-indicators.d.ts +1 -1
  525. package/dist/components/tabs/scroll-indicators.js +83 -0
  526. package/dist/components/tabs/state.d.ts +2 -2
  527. package/dist/components/tabs/state.js +84 -0
  528. package/dist/components/tabs/tab-api.d.ts +2 -2
  529. package/dist/components/tabs/tab-api.js +139 -0
  530. package/dist/components/tabs/tab.d.ts +1 -1
  531. package/dist/components/tabs/tab.js +185 -0
  532. package/dist/components/tabs/tabs.d.ts +1 -1
  533. package/dist/components/tabs/tabs.js +22 -0
  534. package/dist/components/tabs/types.d.ts +2 -2
  535. package/dist/components/tabs/types.js +1 -0
  536. package/dist/components/tabs/utils.d.ts +1 -1
  537. package/dist/components/tabs/utils.js +67 -0
  538. package/dist/components/textfield/api.d.ts +2 -1
  539. package/dist/components/textfield/api.js +190 -0
  540. package/dist/components/textfield/config.d.ts +1 -1
  541. package/dist/components/textfield/config.js +21 -0
  542. package/dist/components/textfield/constants.js +63 -0
  543. package/dist/components/textfield/features/density.d.ts +1 -1
  544. package/dist/components/textfield/features/density.js +38 -0
  545. package/dist/components/textfield/features/error.d.ts +1 -1
  546. package/dist/components/textfield/features/error.js +35 -0
  547. package/dist/components/textfield/features/index.d.ts +14 -14
  548. package/dist/components/textfield/features/index.js +8 -0
  549. package/dist/components/textfield/features/leading-icon.d.ts +1 -1
  550. package/dist/components/textfield/features/leading-icon.js +55 -0
  551. package/dist/components/textfield/features/placement.d.ts +3 -1
  552. package/dist/components/textfield/features/placement.js +184 -0
  553. package/dist/components/textfield/features/prefix-text.d.ts +1 -1
  554. package/dist/components/textfield/features/prefix-text.js +38 -0
  555. package/dist/components/textfield/features/suffix-text.d.ts +1 -1
  556. package/dist/components/textfield/features/suffix-text.js +34 -0
  557. package/dist/components/textfield/features/supporting-text.d.ts +1 -1
  558. package/dist/components/textfield/features/supporting-text.js +58 -0
  559. package/dist/components/textfield/features/trailing-icon.d.ts +1 -1
  560. package/dist/components/textfield/features/trailing-icon.js +40 -0
  561. package/dist/components/textfield/index.d.ts +2 -2
  562. package/dist/components/textfield/index.js +1 -0
  563. package/dist/components/textfield/textfield.d.ts +1 -1
  564. package/dist/components/textfield/textfield.js +18 -0
  565. package/dist/components/textfield/types.js +18 -0
  566. package/dist/components/timepicker/api.d.ts +1 -1
  567. package/dist/components/timepicker/api.js +426 -0
  568. package/dist/components/timepicker/clockdial.d.ts +1 -1
  569. package/dist/components/timepicker/clockdial.js +277 -0
  570. package/dist/components/timepicker/config.d.ts +1 -1
  571. package/dist/components/timepicker/config.js +81 -0
  572. package/dist/components/timepicker/constants.js +135 -0
  573. package/dist/components/timepicker/index.d.ts +4 -4
  574. package/dist/components/timepicker/index.js +3 -0
  575. package/dist/components/timepicker/render.d.ts +1 -1
  576. package/dist/components/timepicker/render.js +476 -0
  577. package/dist/components/timepicker/timepicker.d.ts +1 -1
  578. package/dist/components/timepicker/timepicker.js +68 -0
  579. package/dist/components/timepicker/types.js +20 -0
  580. package/dist/components/timepicker/utils.d.ts +1 -1
  581. package/dist/components/timepicker/utils.js +131 -0
  582. package/dist/components/tooltip/api.d.ts +1 -1
  583. package/dist/components/tooltip/api.js +293 -0
  584. package/dist/components/tooltip/config.d.ts +1 -1
  585. package/dist/components/tooltip/config.js +38 -0
  586. package/dist/components/tooltip/constants.js +49 -0
  587. package/dist/components/tooltip/index.d.ts +3 -3
  588. package/dist/components/tooltip/index.js +2 -0
  589. package/dist/components/tooltip/tooltip.d.ts +1 -1
  590. package/dist/components/tooltip/tooltip.js +31 -0
  591. package/dist/components/tooltip/types.js +23 -0
  592. package/dist/components/top-app-bar/config.d.ts +1 -1
  593. package/dist/components/top-app-bar/config.js +10 -0
  594. package/dist/components/top-app-bar/constants.js +33 -0
  595. package/dist/components/top-app-bar/index.d.ts +3 -3
  596. package/dist/components/top-app-bar/index.js +4 -0
  597. package/dist/components/top-app-bar/top-app-bar.d.ts +2 -2
  598. package/dist/components/top-app-bar/top-app-bar.js +155 -0
  599. package/dist/components/top-app-bar/types.d.ts +1 -1
  600. package/dist/components/top-app-bar/types.js +1 -0
  601. package/dist/core/canvas/animation.js +36 -0
  602. package/dist/core/canvas/drawing.js +62 -0
  603. package/dist/core/canvas/index.d.ts +4 -4
  604. package/dist/core/canvas/index.js +4 -0
  605. package/dist/core/canvas/resize.js +35 -0
  606. package/dist/core/canvas/utils.d.ts +5 -4
  607. package/dist/core/canvas/utils.js +116 -0
  608. package/dist/core/compose/base.js +7 -0
  609. package/dist/core/compose/cleanup.d.ts +14 -0
  610. package/dist/core/compose/cleanup.js +51 -0
  611. package/dist/core/compose/component.d.ts +2 -0
  612. package/dist/core/compose/component.js +144 -0
  613. package/dist/core/compose/features/badge.d.ts +1 -1
  614. package/dist/core/compose/features/badge.js +20 -0
  615. package/dist/core/compose/features/checkable.d.ts +1 -1
  616. package/dist/core/compose/features/checkable.js +55 -0
  617. package/dist/core/compose/features/constants.js +36 -0
  618. package/dist/core/compose/features/debounce.d.ts +1 -1
  619. package/dist/core/compose/features/debounce.js +44 -0
  620. package/dist/core/compose/features/disabled.d.ts +1 -1
  621. package/dist/core/compose/features/disabled.js +63 -0
  622. package/dist/core/compose/features/events.d.ts +1 -1
  623. package/dist/core/compose/features/events.js +23 -0
  624. package/dist/core/compose/features/icon.d.ts +1 -1
  625. package/dist/core/compose/features/icon.js +70 -0
  626. package/dist/core/compose/features/index.d.ts +34 -34
  627. package/dist/core/compose/features/index.js +19 -0
  628. package/dist/core/compose/features/input.d.ts +1 -1
  629. package/dist/core/compose/features/input.js +67 -0
  630. package/dist/core/compose/features/lifecycle.d.ts +1 -1
  631. package/dist/core/compose/features/lifecycle.js +82 -0
  632. package/dist/core/compose/features/position.d.ts +1 -1
  633. package/dist/core/compose/features/position.js +36 -0
  634. package/dist/core/compose/features/ripple.d.ts +8 -8
  635. package/dist/core/compose/features/ripple.js +87 -0
  636. package/dist/core/compose/features/size.d.ts +1 -1
  637. package/dist/core/compose/features/size.js +7 -0
  638. package/dist/core/compose/features/style.d.ts +1 -1
  639. package/dist/core/compose/features/style.js +9 -0
  640. package/dist/core/compose/features/text.d.ts +1 -1
  641. package/dist/core/compose/features/text.js +47 -0
  642. package/dist/core/compose/features/textinput.d.ts +1 -1
  643. package/dist/core/compose/features/textinput.js +162 -0
  644. package/dist/core/compose/features/textlabel.d.ts +1 -1
  645. package/dist/core/compose/features/textlabel.js +44 -0
  646. package/dist/core/compose/features/throttle.d.ts +1 -1
  647. package/dist/core/compose/features/throttle.js +44 -0
  648. package/dist/core/compose/features/track.d.ts +1 -1
  649. package/dist/core/compose/features/track.js +23 -0
  650. package/dist/core/compose/features/variant.d.ts +1 -1
  651. package/dist/core/compose/features/variant.js +7 -0
  652. package/dist/core/compose/features/withEvents.d.ts +1 -1
  653. package/dist/core/compose/features/withEvents.js +46 -0
  654. package/dist/core/compose/index.d.ts +9 -9
  655. package/dist/core/compose/index.js +5 -0
  656. package/dist/core/compose/pipe.js +6 -0
  657. package/dist/core/compose/utils/type-guards.d.ts +1 -1
  658. package/dist/core/compose/utils/type-guards.js +10 -0
  659. package/dist/core/config/component.js +71 -0
  660. package/dist/core/config/global.d.ts +4 -2
  661. package/dist/core/config/global.js +15 -0
  662. package/dist/core/config.js +72 -0
  663. package/dist/core/dom/attributes.js +39 -0
  664. package/dist/core/dom/classes.js +207 -0
  665. package/dist/core/dom/create.js +250 -0
  666. package/dist/core/dom/events.js +82 -0
  667. package/dist/core/dom/index.d.ts +6 -6
  668. package/dist/core/dom/index.js +4 -0
  669. package/dist/core/dom/utils.d.ts +1 -1
  670. package/dist/core/dom/utils.js +45 -0
  671. package/dist/core/index.d.ts +20 -20
  672. package/dist/core/index.js +13 -0
  673. package/dist/core/shapes/cubic.d.ts +30 -0
  674. package/dist/core/shapes/cubic.js +62 -0
  675. package/dist/core/shapes/index.d.ts +6 -0
  676. package/dist/core/shapes/index.js +3 -0
  677. package/dist/core/shapes/material.d.ts +24 -0
  678. package/dist/core/shapes/material.js +119 -0
  679. package/dist/core/shapes/polygon.d.ts +35 -0
  680. package/dist/core/shapes/polygon.js +221 -0
  681. package/dist/core/state/disabled.js +26 -0
  682. package/dist/core/state/emitter.js +24 -0
  683. package/dist/core/state/events.js +32 -0
  684. package/dist/core/state/index.d.ts +10 -10
  685. package/dist/core/state/index.js +5 -0
  686. package/dist/core/state/lifecycle.js +51 -0
  687. package/dist/core/state/store.js +61 -0
  688. package/dist/core/utils/background.js +35 -0
  689. package/dist/core/utils/color.js +23 -0
  690. package/dist/core/utils/index.d.ts +6 -6
  691. package/dist/core/utils/index.js +8 -0
  692. package/dist/core/utils/mobile.js +63 -0
  693. package/dist/core/utils/object.js +21 -0
  694. package/dist/core/utils/performance.d.ts +5 -2
  695. package/dist/core/utils/performance.js +117 -0
  696. package/dist/core/utils/theme.js +78 -0
  697. package/dist/core/utils/validate.js +113 -0
  698. package/dist/index.cjs +12 -18
  699. package/dist/index.d.ts +3 -3
  700. package/dist/index.js +4 -57
  701. package/dist/package.json +40 -11
  702. package/dist/styles/badge.css +2 -0
  703. package/dist/styles/badge.d.ts +1 -0
  704. package/dist/styles/badge.js +2 -0
  705. package/dist/styles/base.css +2 -0
  706. package/dist/styles/base.d.ts +1 -0
  707. package/dist/styles/base.js +2 -0
  708. package/dist/styles/bottom-app-bar.css +2 -0
  709. package/dist/styles/bottom-app-bar.d.ts +1 -0
  710. package/dist/styles/bottom-app-bar.js +2 -0
  711. package/dist/styles/bottom-sheet.css +2 -0
  712. package/dist/styles/bottom-sheet.d.ts +1 -0
  713. package/dist/styles/bottom-sheet.js +2 -0
  714. package/dist/styles/button-group.css +2 -0
  715. package/dist/styles/button-group.d.ts +1 -0
  716. package/dist/styles/button-group.js +3 -0
  717. package/dist/styles/button.css +2 -0
  718. package/dist/styles/button.d.ts +1 -0
  719. package/dist/styles/button.js +2 -0
  720. package/dist/styles/card.css +2 -0
  721. package/dist/styles/card.d.ts +1 -0
  722. package/dist/styles/card.js +2 -0
  723. package/dist/styles/carousel.css +2 -0
  724. package/dist/styles/carousel.d.ts +1 -0
  725. package/dist/styles/carousel.js +2 -0
  726. package/dist/styles/checkbox.css +2 -0
  727. package/dist/styles/checkbox.d.ts +1 -0
  728. package/dist/styles/checkbox.js +2 -0
  729. package/dist/styles/chips.css +2 -0
  730. package/dist/styles/chips.d.ts +1 -0
  731. package/dist/styles/chips.js +2 -0
  732. package/dist/styles/dialog.css +2 -0
  733. package/dist/styles/dialog.d.ts +1 -0
  734. package/dist/styles/dialog.js +3 -0
  735. package/dist/styles/divider.css +2 -0
  736. package/dist/styles/divider.d.ts +1 -0
  737. package/dist/styles/divider.js +2 -0
  738. package/dist/styles/drawer.css +2 -0
  739. package/dist/styles/drawer.d.ts +1 -0
  740. package/dist/styles/drawer.js +2 -0
  741. package/dist/styles/extended-fab.css +2 -0
  742. package/dist/styles/extended-fab.d.ts +1 -0
  743. package/dist/styles/extended-fab.js +2 -0
  744. package/dist/styles/fab.css +2 -0
  745. package/dist/styles/fab.d.ts +1 -0
  746. package/dist/styles/fab.js +2 -0
  747. package/dist/styles/icon-button.css +2 -0
  748. package/dist/styles/icon-button.d.ts +1 -0
  749. package/dist/styles/icon-button.js +2 -0
  750. package/dist/styles/list.css +2 -0
  751. package/dist/styles/list.d.ts +1 -0
  752. package/dist/styles/list.js +2 -0
  753. package/dist/styles/loading-indicator.css +2 -0
  754. package/dist/styles/loading-indicator.d.ts +1 -0
  755. package/dist/styles/loading-indicator.js +2 -0
  756. package/dist/styles/menu.css +2 -0
  757. package/dist/styles/menu.d.ts +1 -0
  758. package/dist/styles/menu.js +2 -0
  759. package/dist/styles/navigation-rail.css +2 -0
  760. package/dist/styles/navigation-rail.d.ts +1 -0
  761. package/dist/styles/navigation-rail.js +2 -0
  762. package/dist/styles/navigation.css +2 -0
  763. package/dist/styles/navigation.d.ts +1 -0
  764. package/dist/styles/navigation.js +2 -0
  765. package/dist/styles/progress.css +2 -0
  766. package/dist/styles/progress.d.ts +1 -0
  767. package/dist/styles/progress.js +2 -0
  768. package/dist/styles/radios.css +2 -0
  769. package/dist/styles/radios.d.ts +1 -0
  770. package/dist/styles/radios.js +2 -0
  771. package/dist/styles/search.css +2 -0
  772. package/dist/styles/search.d.ts +1 -0
  773. package/dist/styles/search.js +2 -0
  774. package/dist/styles/segmented-button.css +2 -0
  775. package/dist/styles/segmented-button.d.ts +1 -0
  776. package/dist/styles/segmented-button.js +2 -0
  777. package/dist/styles/select.css +2 -0
  778. package/dist/styles/select.d.ts +1 -0
  779. package/dist/styles/select.js +3 -0
  780. package/dist/styles/side-sheet.css +2 -0
  781. package/dist/styles/side-sheet.d.ts +1 -0
  782. package/dist/styles/side-sheet.js +2 -0
  783. package/dist/styles/slider.css +2 -0
  784. package/dist/styles/slider.d.ts +1 -0
  785. package/dist/styles/slider.js +2 -0
  786. package/dist/styles/snackbar.css +2 -0
  787. package/dist/styles/snackbar.d.ts +1 -0
  788. package/dist/styles/snackbar.js +3 -0
  789. package/dist/styles/split-button.css +2 -0
  790. package/dist/styles/split-button.d.ts +1 -0
  791. package/dist/styles/split-button.js +3 -0
  792. package/dist/styles/switch.css +2 -0
  793. package/dist/styles/switch.d.ts +1 -0
  794. package/dist/styles/switch.js +2 -0
  795. package/dist/styles/tabs.css +2 -0
  796. package/dist/styles/tabs.d.ts +1 -0
  797. package/dist/styles/tabs.js +3 -0
  798. package/dist/styles/textfield.css +2 -0
  799. package/dist/styles/textfield.d.ts +1 -0
  800. package/dist/styles/textfield.js +2 -0
  801. package/dist/styles/timepicker.css +2 -0
  802. package/dist/styles/timepicker.d.ts +1 -0
  803. package/dist/styles/timepicker.js +2 -0
  804. package/dist/styles/top-app-bar.css +2 -0
  805. package/dist/styles/top-app-bar.d.ts +1 -0
  806. package/dist/styles/top-app-bar.js +2 -0
  807. package/dist/styles/utilities.css +2 -0
  808. package/dist/styles/utilities.d.ts +1 -0
  809. package/dist/styles/utilities.js +2 -0
  810. package/dist/styles.css +2 -7
  811. package/dist/themes/autumn.css +2 -0
  812. package/dist/themes/baseline.css +2 -0
  813. package/dist/themes/brownbeige.css +2 -0
  814. package/dist/themes/browngreen.css +2 -0
  815. package/dist/themes/desert.css +2 -0
  816. package/dist/themes/forest.css +2 -0
  817. package/dist/themes/highcontrast.css +2 -0
  818. package/dist/themes/legacy.css +2 -0
  819. package/dist/themes/material.css +2 -0
  820. package/dist/themes/ocean.css +2 -0
  821. package/dist/themes/sageivory.css +2 -0
  822. package/dist/themes/spring.css +2 -0
  823. package/dist/themes/summer.css +2 -0
  824. package/dist/themes/sunset.css +2 -0
  825. package/dist/themes/tealcaramel.css +2 -0
  826. package/dist/themes/winter.css +2 -0
  827. package/package.json +44 -7
  828. package/src/styles/abstract/_variables.scss +18 -2
  829. package/src/styles/base/_document.scss +54 -0
  830. package/src/styles/components/_bottom-sheet.scss +167 -0
  831. package/src/styles/components/_button-group.scss +58 -38
  832. package/src/styles/components/_button.scss +9 -3
  833. package/src/styles/components/_card.scss +79 -20
  834. package/src/styles/components/_carousel.scss +3 -3
  835. package/src/styles/components/_chips.scss +2 -2
  836. package/src/styles/components/_dialog.scss +86 -22
  837. package/src/styles/components/_drawer.scss +85 -95
  838. package/src/styles/components/_extended-fab.scss +95 -111
  839. package/src/styles/components/_fab.scss +70 -87
  840. package/src/styles/components/_icon-button.scss +115 -104
  841. package/src/styles/components/_list.scss +2 -2
  842. package/src/styles/components/_loading-indicator.scss +41 -0
  843. package/src/styles/components/_menu.scss +324 -16
  844. package/src/styles/components/_navigation-rail.scss +307 -0
  845. package/src/styles/components/_navigation-system.scss +3 -1
  846. package/src/styles/components/_progress.scss +46 -53
  847. package/src/styles/components/_segmented-button.scss +71 -113
  848. package/src/styles/components/_side-sheet.scss +175 -0
  849. package/src/styles/components/_slider.scss +50 -20
  850. package/src/styles/components/_snackbar.scss +153 -167
  851. package/src/styles/components/_split-button.scss +229 -0
  852. package/src/styles/components/_textfield.scss +4 -1
  853. package/src/styles/main.scss +6 -51
  854. package/src/styles/themes/_baseline.scss +8 -0
  855. package/src/styles/utilities/_ripple.scss +12 -3
  856. package/dist/components/sheet/api.d.ts +0 -37
  857. package/dist/components/sheet/config.d.ts +0 -53
  858. package/dist/components/sheet/constants.d.ts +0 -136
  859. package/dist/components/sheet/features/content.d.ts +0 -6
  860. package/dist/components/sheet/features/gestures.d.ts +0 -6
  861. package/dist/components/sheet/features/index.d.ts +0 -5
  862. package/dist/components/sheet/features/position.d.ts +0 -7
  863. package/dist/components/sheet/features/state.d.ts +0 -6
  864. package/dist/components/sheet/features/title.d.ts +0 -6
  865. package/dist/components/sheet/index.d.ts +0 -3
  866. package/dist/components/sheet/sheet.d.ts +0 -8
  867. package/dist/components/sheet/types.d.ts +0 -250
  868. package/dist/components/slider/features/canvas.d.ts +0 -47
  869. package/dist/index.cjs.map +0 -269
  870. package/dist/index.js.map +0 -269
  871. package/src/styles/components/_sheet.scss +0 -236
@@ -0,0 +1,300 @@
1
+ import { PROGRESS_CLASSES, PROGRESS_VARIANTS, PROGRESS_SHAPES, PROGRESS_MEASUREMENTS, PROGRESS_MOTION, PROGRESS_THICKNESS, PROGRESS_WAVE, } from "../constants.js";
2
+ import { observeCanvasResize } from "../../../core/canvas/resize.js";
3
+ import { createColors } from "./colors.js";
4
+ import { drawCircularProgress } from "./circular.js";
5
+ import { drawLinearProgress } from "./linear.js";
6
+ import { waveAmplitudeAt, waveAmplitudeTarget } from "./motion.js";
7
+ export const getStrokeWidth = (thickness = "thin") => {
8
+ if (typeof thickness === "number")
9
+ return thickness;
10
+ return thickness === "thick" ? PROGRESS_THICKNESS.THICK : PROGRESS_THICKNESS.THIN;
11
+ };
12
+ export const getWaveAmplitude = (isCircular, strokeWidth, size) => isCircular
13
+ ? PROGRESS_WAVE.CIRCULAR.AMPLITUDE * (size / PROGRESS_MEASUREMENTS.CIRCULAR.SIZE)
14
+ : PROGRESS_WAVE.LINEAR.AMPLITUDE * (strokeWidth / PROGRESS_THICKNESS.THIN);
15
+ export const getCircularSize = (config) => {
16
+ const fallback = config.shape === PROGRESS_SHAPES.WAVY
17
+ ? PROGRESS_MEASUREMENTS.CIRCULAR.WAVE_SIZE
18
+ : PROGRESS_MEASUREMENTS.CIRCULAR.SIZE;
19
+ return Math.max(PROGRESS_MEASUREMENTS.CIRCULAR.MIN_SIZE, Math.min(config.size ?? fallback, PROGRESS_MEASUREMENTS.CIRCULAR.MAX_SIZE));
20
+ };
21
+ export const getLinearHeight = (strokeWidth, isWavy) => isWavy ? strokeWidth + 2 * getWaveAmplitude(false, strokeWidth, 0) : strokeWidth;
22
+ export const withCanvas = (config) => (component) => {
23
+ const isCircular = config.variant === PROGRESS_VARIANTS.CIRCULAR;
24
+ const view = component.element.ownerDocument?.defaultView ?? null;
25
+ const canvas = document.createElement("canvas");
26
+ canvas.className = `${component.getClass(PROGRESS_CLASSES.CONTAINER)}-canvas`;
27
+ canvas.setAttribute("aria-hidden", "true");
28
+ component.element.appendChild(canvas);
29
+ let context = null;
30
+ let currentThickness = config.thickness ?? "thin";
31
+ let currentShape = config.shape ?? PROGRESS_SHAPES.FLAT;
32
+ let currentSize = getCircularSize(config);
33
+ let animatedValue = config.value ?? 0;
34
+ let targetValue = animatedValue;
35
+ let valueAnimationId = null;
36
+ let lastSetValueTime = 0;
37
+ let amplitudeFrom = 0;
38
+ let amplitudeTarget = 0;
39
+ let amplitudeStarted = 0;
40
+ let animationId = null;
41
+ let animationTime = 0;
42
+ let animationStart = 0;
43
+ const reducedMotion = view?.matchMedia?.("(prefers-reduced-motion: reduce)") ?? null;
44
+ const isWavy = () => currentShape === PROGRESS_SHAPES.WAVY;
45
+ const strokeWidth = () => getStrokeWidth(currentThickness);
46
+ const max = () => component.state?.max ?? config.max ?? 100;
47
+ const isIndeterminate = () => component.state?.indeterminate ?? config.indeterminate ?? false;
48
+ const colors = createColors(() => draw(animationTime));
49
+ const measure = () => {
50
+ if (!context)
51
+ return;
52
+ const ratio = view?.devicePixelRatio || 1;
53
+ let width;
54
+ let height;
55
+ if (isCircular) {
56
+ width = height = currentSize;
57
+ }
58
+ else {
59
+ const rect = component.element.getBoundingClientRect?.();
60
+ width = Math.max(rect?.width || component.element.offsetWidth || 0, 0);
61
+ height = getLinearHeight(strokeWidth(), isWavy());
62
+ }
63
+ canvas.style.width = `${width}px`;
64
+ canvas.style.height = `${height}px`;
65
+ canvas.width = Math.round(width * ratio);
66
+ canvas.height = Math.round(height * ratio);
67
+ context.width = width;
68
+ context.height = height;
69
+ context.pixelRatio = ratio;
70
+ context.ctx.setTransform(1, 0, 0, 1, 0, 0);
71
+ context.ctx.scale(ratio, ratio);
72
+ };
73
+ const initialize = () => {
74
+ if (typeof canvas.getContext !== "function")
75
+ return false;
76
+ const ctx = canvas.getContext("2d");
77
+ if (!ctx)
78
+ return false;
79
+ context = { canvas, ctx, width: 0, height: 0, pixelRatio: view?.devicePixelRatio || 1 };
80
+ measure();
81
+ component.ctx = ctx;
82
+ return true;
83
+ };
84
+ const currentAmplitude = () => {
85
+ if (!isWavy())
86
+ return 0;
87
+ const full = getWaveAmplitude(isCircular, strokeWidth(), currentSize);
88
+ if (isIndeterminate())
89
+ return full;
90
+ const fraction = waveAmplitudeAt(amplitudeFrom, amplitudeTarget, (view?.performance ?? performance).now() - amplitudeStarted);
91
+ return full * fraction;
92
+ };
93
+ const draw = (time = animationTime) => {
94
+ if (!context || context.width <= 0 || context.height <= 0)
95
+ return;
96
+ const indeterminate = isIndeterminate();
97
+ const value = indeterminate ? 0 : animatedValue / max();
98
+ if (isCircular) {
99
+ drawCircularProgress(context, {
100
+ progress: value,
101
+ indeterminate,
102
+ strokeWidth: strokeWidth(),
103
+ time,
104
+ waveAmplitude: currentAmplitude(),
105
+ colors: colors.get(),
106
+ });
107
+ }
108
+ else {
109
+ const rtl = view?.getComputedStyle?.(component.element)?.direction === "rtl";
110
+ drawLinearProgress(context, {
111
+ progress: value,
112
+ buffer: (component.state?.buffer ?? config.buffer ?? 0) / max(),
113
+ indeterminate,
114
+ strokeWidth: strokeWidth(),
115
+ time,
116
+ waveAmplitude: currentAmplitude(),
117
+ rtl,
118
+ colors: colors.get(),
119
+ showStopIndicator: !indeterminate && config.showStopIndicator !== false,
120
+ });
121
+ }
122
+ };
123
+ const needsAnimation = () => !reducedMotion?.matches && (isIndeterminate() || isWavy());
124
+ const startAnimation = (offset = 0) => {
125
+ stopAnimation();
126
+ if (!needsAnimation()) {
127
+ draw(0);
128
+ return;
129
+ }
130
+ animationStart = 0;
131
+ const step = (timestamp) => {
132
+ if (animationStart === 0)
133
+ animationStart = timestamp - offset;
134
+ animationTime = timestamp - animationStart;
135
+ draw(animationTime);
136
+ animationId = needsAnimation() ? requestAnimationFrame(step) : null;
137
+ };
138
+ animationId = requestAnimationFrame(step);
139
+ };
140
+ const stopAnimation = () => {
141
+ if (animationId !== null) {
142
+ cancelAnimationFrame(animationId);
143
+ animationId = null;
144
+ }
145
+ };
146
+ const stopValueAnimation = () => {
147
+ if (valueAnimationId !== null) {
148
+ cancelAnimationFrame(valueAnimationId);
149
+ valueAnimationId = null;
150
+ }
151
+ };
152
+ const retargetAmplitude = (progress) => {
153
+ const next = waveAmplitudeTarget(progress);
154
+ if (next === amplitudeTarget)
155
+ return;
156
+ amplitudeFrom = waveAmplitudeAt(amplitudeFrom, amplitudeTarget, (view?.performance ?? performance).now() - amplitudeStarted);
157
+ amplitudeTarget = next;
158
+ amplitudeStarted = (view?.performance ?? performance).now();
159
+ };
160
+ const complete = (value) => {
161
+ component.element.dispatchEvent(new CustomEvent("complete", { detail: { value, max: max() } }));
162
+ };
163
+ component.setValue = (value, animate = true) => {
164
+ targetValue = Math.max(0, Math.min(max(), value));
165
+ retargetAmplitude(targetValue / max());
166
+ if (valueAnimationId !== null && animate)
167
+ return;
168
+ stopValueAnimation();
169
+ if (!animate || reducedMotion?.matches) {
170
+ animatedValue = targetValue;
171
+ draw();
172
+ if (targetValue >= max())
173
+ complete(targetValue);
174
+ return;
175
+ }
176
+ const startValue = animatedValue;
177
+ const startTime = (view?.performance ?? performance).now();
178
+ const sinceLast = startTime - lastSetValueTime;
179
+ const duration = lastSetValueTime > 0 && sinceLast < PROGRESS_MOTION.VALUE_DURATION
180
+ ? Math.max(100, sinceLast * 0.9)
181
+ : PROGRESS_MOTION.VALUE_DURATION;
182
+ lastSetValueTime = startTime;
183
+ const step = (now) => {
184
+ const fraction = Math.min((now - startTime) / duration, 1);
185
+ animatedValue = startValue + (targetValue - startValue) * fraction;
186
+ if (animationId === null)
187
+ draw();
188
+ if (fraction < 1) {
189
+ valueAnimationId = requestAnimationFrame(step);
190
+ }
191
+ else {
192
+ valueAnimationId = null;
193
+ animatedValue = targetValue;
194
+ if (animationId === null)
195
+ draw();
196
+ if (targetValue >= max())
197
+ complete(targetValue);
198
+ }
199
+ };
200
+ valueAnimationId = requestAnimationFrame(step);
201
+ };
202
+ component.setIndeterminate = (indeterminate) => {
203
+ if (component.state)
204
+ component.state.indeterminate = indeterminate;
205
+ stopValueAnimation();
206
+ animatedValue = component.state?.value ?? animatedValue;
207
+ if (!indeterminate)
208
+ retargetAmplitude(animatedValue / max());
209
+ startAnimation();
210
+ if (!needsAnimation())
211
+ draw(0);
212
+ };
213
+ component.setThickness = (thickness) => {
214
+ currentThickness = thickness;
215
+ measure();
216
+ draw();
217
+ };
218
+ component.setShape = (shape) => {
219
+ if (currentShape === shape)
220
+ return;
221
+ currentShape = shape;
222
+ component.currentShape = shape;
223
+ if (component.state)
224
+ component.state.shape = shape;
225
+ if (isCircular && config.size === undefined)
226
+ currentSize = getCircularSize({ ...config, shape });
227
+ if (shape === PROGRESS_SHAPES.WAVY) {
228
+ amplitudeFrom = 0;
229
+ amplitudeTarget = 0;
230
+ amplitudeStarted = (view?.performance ?? performance).now();
231
+ retargetAmplitude(animatedValue / max());
232
+ }
233
+ measure();
234
+ startAnimation(animationTime);
235
+ if (!needsAnimation())
236
+ draw(0);
237
+ };
238
+ component.setSize = (size) => {
239
+ if (!isCircular)
240
+ return;
241
+ currentSize = Math.max(PROGRESS_MEASUREMENTS.CIRCULAR.MIN_SIZE, Math.min(size, PROGRESS_MEASUREMENTS.CIRCULAR.MAX_SIZE));
242
+ measure();
243
+ draw();
244
+ };
245
+ component.getSize = () => (isCircular ? currentSize : undefined);
246
+ component.hide = () => {
247
+ component.element.classList.add(component.getClass(PROGRESS_CLASSES.TRANSITION));
248
+ component.element.setAttribute("hidden", "");
249
+ stopAnimation();
250
+ stopValueAnimation();
251
+ return component;
252
+ };
253
+ component.show = () => {
254
+ component.element.classList.add(component.getClass(PROGRESS_CLASSES.TRANSITION));
255
+ component.element.removeAttribute("hidden");
256
+ measure();
257
+ startAnimation(animationTime);
258
+ if (!needsAnimation())
259
+ draw(0);
260
+ return component;
261
+ };
262
+ component.isVisible = () => !component.element.hasAttribute("hidden");
263
+ const resize = () => {
264
+ measure();
265
+ draw();
266
+ };
267
+ if (!initialize()) {
268
+ requestAnimationFrame(() => {
269
+ if (initialize()) {
270
+ startAnimation();
271
+ draw();
272
+ }
273
+ });
274
+ }
275
+ const resizeCleanup = observeCanvasResize(component.element, canvas, resize);
276
+ if (isWavy() && !isIndeterminate()) {
277
+ amplitudeStarted = (view?.performance ?? performance).now();
278
+ retargetAmplitude(animatedValue / max());
279
+ }
280
+ draw();
281
+ startAnimation();
282
+ const originalDestroy = component.lifecycle?.destroy;
283
+ component.lifecycle = {
284
+ ...(component.lifecycle ?? {}),
285
+ destroy: () => {
286
+ resizeCleanup();
287
+ colors.destroy();
288
+ stopAnimation();
289
+ stopValueAnimation();
290
+ originalDestroy?.();
291
+ },
292
+ };
293
+ return {
294
+ ...component,
295
+ canvas,
296
+ ctx: context?.ctx,
297
+ draw,
298
+ resize,
299
+ };
300
+ };
@@ -1,9 +1,19 @@
1
+ import { CanvasContext } from "./canvas.js";
2
+ import { ProgressColors } from "./colors.js";
3
+ /** What a frame of the circular indicator needs */
4
+ export interface CircularFrame {
5
+ /** Progress from 0 to 1; ignored when indeterminate */
6
+ progress: number;
7
+ indeterminate: boolean;
8
+ /** Arc thickness in pixels */
9
+ strokeWidth: number;
10
+ /** Milliseconds since the animation started */
11
+ time: number;
12
+ /** Wave height in pixels; 0 draws a flat arc */
13
+ waveAmplitude: number;
14
+ colors: ProgressColors;
15
+ }
1
16
  /**
2
- * Circular progress drawing functionality
17
+ * Draws one frame of the circular indicator.
3
18
  */
4
- import { ProgressConfig, ProgressShape } from "../types";
5
- import { CanvasContext } from "./canvas";
6
- /**
7
- * Draws circular progress on canvas
8
- */
9
- export declare const drawCircularProgress: (context: CanvasContext, config: ProgressConfig, value: number, max: number, isIndeterminate: boolean, animationTime?: number, currentShape?: ProgressShape) => void;
19
+ export declare const drawCircularProgress: (context: CanvasContext, frame: CircularFrame) => void;
@@ -0,0 +1,71 @@
1
+ import { circularIndeterminateFrame } from "./motion.js";
2
+ import { PROGRESS_MEASUREMENTS, PROGRESS_WAVE } from "../constants.js";
3
+ const TWO_PI = Math.PI * 2;
4
+ const START_ANGLE = -Math.PI / 2;
5
+ const drawArc = (ctx, centerX, centerY, radius, from, sweep, color, strokeWidth, wave) => {
6
+ if (sweep <= 0 || radius <= 0)
7
+ return;
8
+ ctx.strokeStyle = color;
9
+ ctx.lineWidth = strokeWidth;
10
+ ctx.lineCap = "round";
11
+ ctx.lineJoin = "round";
12
+ ctx.beginPath();
13
+ if (!wave || wave.amplitude <= 0) {
14
+ ctx.arc(centerX, centerY, radius, from, from + sweep);
15
+ ctx.stroke();
16
+ return;
17
+ }
18
+ const arcLength = sweep * radius;
19
+ const steps = Math.max(8, Math.ceil(arcLength / Math.max(1, wave.wavelength / 24)));
20
+ for (let i = 0; i <= steps; i++) {
21
+ const t = i / steps;
22
+ const angle = from + sweep * t;
23
+ const along = t * arcLength;
24
+ const r = radius + wave.amplitude * Math.sin((TWO_PI * (along - wave.phase)) / wave.wavelength);
25
+ const x = centerX + Math.cos(angle) * r;
26
+ const y = centerY + Math.sin(angle) * r;
27
+ if (i === 0)
28
+ ctx.moveTo(x, y);
29
+ else
30
+ ctx.lineTo(x, y);
31
+ }
32
+ ctx.stroke();
33
+ };
34
+ export const drawCircularProgress = (context, frame) => {
35
+ const { ctx, width, height } = context;
36
+ const { strokeWidth, colors, indeterminate, waveAmplitude } = frame;
37
+ if (width <= 0 || height <= 0)
38
+ return;
39
+ const size = Math.min(width, height);
40
+ const centerX = width / 2;
41
+ const centerY = height / 2;
42
+ const radius = size / 2 - strokeWidth / 2 - waveAmplitude;
43
+ if (radius <= 0)
44
+ return;
45
+ ctx.clearRect(0, 0, width, height);
46
+ const scale = size / PROGRESS_MEASUREMENTS.CIRCULAR.SIZE;
47
+ const wavelength = PROGRESS_WAVE.CIRCULAR.WAVELENGTH * scale;
48
+ const wave = waveAmplitude > 0
49
+ ? {
50
+ amplitude: waveAmplitude,
51
+ wavelength,
52
+ phase: ((frame.time / 1000) * PROGRESS_WAVE.SPEED * wavelength) % wavelength,
53
+ }
54
+ : undefined;
55
+ const gapPx = PROGRESS_MEASUREMENTS.CIRCULAR.GAP + strokeWidth;
56
+ const gapSweep = size > 0 ? (gapPx / (Math.PI * size)) * TWO_PI : 0;
57
+ if (indeterminate) {
58
+ const { rotation, sweep } = circularIndeterminateFrame(frame.time);
59
+ const start = (rotation * Math.PI) / 180;
60
+ drawArc(ctx, centerX, centerY, radius, start, sweep * TWO_PI, colors.indicator, strokeWidth, wave);
61
+ return;
62
+ }
63
+ const progress = Math.min(1, Math.max(0, frame.progress));
64
+ const sweep = progress * TWO_PI;
65
+ const gap = Math.min(sweep, gapSweep);
66
+ const trackSweep = TWO_PI - sweep - gap * 2;
67
+ if (trackSweep > 0) {
68
+ drawArc(ctx, centerX, centerY, radius, START_ANGLE + sweep + gap, trackSweep, colors.track, strokeWidth);
69
+ }
70
+ drawArc(ctx, centerX, centerY, radius, START_ANGLE, sweep, colors.indicator, strokeWidth, wave);
71
+ };
@@ -0,0 +1,16 @@
1
+ export interface ProgressColors {
2
+ indicator: string;
3
+ track: string;
4
+ stop: string;
5
+ buffer: string;
6
+ }
7
+ /**
8
+ * Keeps the palette for one indicator, refreshed when the theme changes.
9
+ * @param onChange - called after the colours change, to redraw
10
+ * @returns the palette getter and a cleanup function
11
+ */
12
+ export declare const createColors: (onChange: () => void) => {
13
+ get: () => ProgressColors;
14
+ refresh: () => void;
15
+ destroy: () => void;
16
+ };
@@ -0,0 +1,40 @@
1
+ import { getThemeColor } from "../../../core/utils/index.js";
2
+ import { onThemeChange } from "../../../core/utils/theme.js";
3
+ import { PROGRESS_COLORS } from "../constants.js";
4
+ const FALLBACKS = {
5
+ indicator: "#6750A4",
6
+ track: "#E8DEF8",
7
+ stop: "#6750A4",
8
+ buffer: "#EADDFF",
9
+ };
10
+ const read = () => ({
11
+ indicator: getThemeColor(PROGRESS_COLORS.INDICATOR, { fallback: FALLBACKS.indicator }),
12
+ track: getThemeColor(PROGRESS_COLORS.TRACK, { fallback: FALLBACKS.track }),
13
+ stop: getThemeColor(PROGRESS_COLORS.STOP, { fallback: FALLBACKS.stop }),
14
+ buffer: getThemeColor(PROGRESS_COLORS.BUFFER, { fallback: FALLBACKS.buffer }),
15
+ });
16
+ export const createColors = (onChange) => {
17
+ let colors = FALLBACKS;
18
+ let read_ = false;
19
+ const refresh = () => {
20
+ try {
21
+ colors = read();
22
+ read_ = true;
23
+ }
24
+ catch {
25
+ }
26
+ };
27
+ const offThemeChange = onThemeChange(() => {
28
+ refresh();
29
+ onChange();
30
+ });
31
+ return {
32
+ get: () => {
33
+ if (!read_)
34
+ refresh();
35
+ return colors;
36
+ },
37
+ refresh,
38
+ destroy: offThemeChange,
39
+ };
40
+ };
@@ -2,7 +2,7 @@
2
2
  * Progress component features
3
3
  * Exports all features used by the progress component
4
4
  */
5
- export { withCanvas } from './canvas';
6
- export { withState } from './state';
7
- export { drawCircularProgress } from './circular';
8
- export { drawLinearProgress } from './linear';
5
+ export { withCanvas } from "./canvas.js";
6
+ export { withState } from "./state.js";
7
+ export { drawCircularProgress } from "./circular.js";
8
+ export { drawLinearProgress } from "./linear.js";
@@ -0,0 +1,4 @@
1
+ export { withCanvas } from "./canvas.js";
2
+ export { withState } from "./state.js";
3
+ export { drawCircularProgress } from "./circular.js";
4
+ export { drawLinearProgress } from "./linear.js";
@@ -1,9 +1,25 @@
1
+ import { CanvasContext } from "./canvas.js";
2
+ import { ProgressColors } from "./colors.js";
3
+ /** What a frame of the linear indicator needs */
4
+ export interface LinearFrame {
5
+ /** Progress from 0 to 1; ignored when indeterminate */
6
+ progress: number;
7
+ /** Buffer from 0 to 1, this library's own extension; 0 for none */
8
+ buffer: number;
9
+ indeterminate: boolean;
10
+ /** Track and indicator thickness in pixels */
11
+ strokeWidth: number;
12
+ /** Milliseconds since the animation started */
13
+ time: number;
14
+ /** Wave height in pixels; 0 draws a flat indicator */
15
+ waveAmplitude: number;
16
+ /** Right to left, in which case the indicator runs from the right */
17
+ rtl: boolean;
18
+ colors: ProgressColors;
19
+ /** Whether to mark the end of the track with a dot */
20
+ showStopIndicator: boolean;
21
+ }
1
22
  /**
2
- * Linear progress drawing functionality
23
+ * Draws one frame of the linear indicator.
3
24
  */
4
- import { ProgressConfig, ProgressShape } from "../types";
5
- import { CanvasContext } from "./canvas";
6
- /**
7
- * Draws linear progress on canvas with shape support
8
- */
9
- export declare const drawLinearProgress: (context: CanvasContext, config: ProgressConfig, value: number, max: number, buffer: number, isIndeterminate: boolean, animationTime?: number, showStopIndicator?: boolean, currentShape?: ProgressShape) => void;
25
+ export declare const drawLinearProgress: (context: CanvasContext, frame: LinearFrame) => void;
@@ -0,0 +1,104 @@
1
+ import { linearIndeterminateFrame } from "./motion.js";
2
+ import { PROGRESS_MEASUREMENTS, PROGRESS_WAVE } from "../constants.js";
3
+ const drawBar = (ctx, width, centerY, strokeWidth, from, to, color, rtl, wave) => {
4
+ const start = Math.min(from, to);
5
+ const end = Math.max(from, to);
6
+ if (end - start <= 0)
7
+ return;
8
+ const cap = strokeWidth / 2;
9
+ const toX = (fraction) => {
10
+ const f = rtl ? 1 - fraction : fraction;
11
+ return Math.min(Math.max(f * width, cap), width - cap);
12
+ };
13
+ const x0 = toX(start);
14
+ const x1 = toX(end);
15
+ if (Math.abs(x1 - x0) < 1e-6 && start !== end)
16
+ return;
17
+ ctx.strokeStyle = color;
18
+ ctx.lineWidth = strokeWidth;
19
+ ctx.lineCap = "round";
20
+ ctx.lineJoin = "round";
21
+ ctx.beginPath();
22
+ if (!wave || wave.amplitude <= 0) {
23
+ ctx.moveTo(Math.min(x0, x1), centerY);
24
+ ctx.lineTo(Math.max(x0, x1), centerY);
25
+ ctx.stroke();
26
+ return;
27
+ }
28
+ const left = Math.min(x0, x1);
29
+ const right = Math.max(x0, x1);
30
+ const step = Math.max(1, wave.wavelength / 24);
31
+ for (let x = left; x <= right; x += step) {
32
+ const y = centerY + wave.amplitude * Math.sin((2 * Math.PI * (x - wave.phase)) / wave.wavelength);
33
+ if (x === left)
34
+ ctx.moveTo(x, y);
35
+ else
36
+ ctx.lineTo(x, y);
37
+ }
38
+ const endY = centerY + wave.amplitude * Math.sin((2 * Math.PI * (right - wave.phase)) / wave.wavelength);
39
+ ctx.lineTo(right, endY);
40
+ ctx.stroke();
41
+ };
42
+ const drawStopIndicator = (ctx, width, height, color, rtl) => {
43
+ const size = Math.min(PROGRESS_MEASUREMENTS.LINEAR.STOP_INDICATOR, height);
44
+ const offset = Math.min((height - size) / 2, PROGRESS_MEASUREMENTS.LINEAR.STOP_TRAILING_SPACE);
45
+ const x = rtl ? size / 2 + offset : width - size / 2 - offset;
46
+ ctx.fillStyle = color;
47
+ ctx.beginPath();
48
+ ctx.arc(x, height / 2, size / 2, 0, 2 * Math.PI);
49
+ ctx.fill();
50
+ };
51
+ export const drawLinearProgress = (context, frame) => {
52
+ const { ctx, width, height } = context;
53
+ const { strokeWidth, colors, rtl, indeterminate, waveAmplitude } = frame;
54
+ if (width <= 0 || height <= 0)
55
+ return;
56
+ const centerY = height / 2;
57
+ ctx.clearRect(0, 0, width, height);
58
+ const gapPx = PROGRESS_MEASUREMENTS.LINEAR.GAP + strokeWidth;
59
+ const gap = width > 0 ? gapPx / width : 0;
60
+ const wavelength = indeterminate
61
+ ? PROGRESS_WAVE.LINEAR.INDETERMINATE_WAVELENGTH
62
+ : PROGRESS_WAVE.LINEAR.WAVELENGTH;
63
+ const wave = waveAmplitude > 0
64
+ ? {
65
+ amplitude: waveAmplitude,
66
+ wavelength,
67
+ phase: ((frame.time / 1000) * PROGRESS_WAVE.SPEED * wavelength) % wavelength,
68
+ }
69
+ : undefined;
70
+ const bar = (from, to, color, wavy = false) => drawBar(ctx, width, centerY, strokeWidth, from, to, color, rtl, wavy ? wave : undefined);
71
+ if (indeterminate) {
72
+ const { firstHead, firstTail, secondHead, secondTail } = linearIndeterminateFrame(frame.time);
73
+ if (firstHead < 1 - gap) {
74
+ bar(firstHead > 0 ? firstHead + gap : 0, 1, colors.track);
75
+ }
76
+ if (firstHead - firstTail > 0) {
77
+ bar(firstTail, firstHead, colors.indicator, true);
78
+ }
79
+ if (firstTail > gap) {
80
+ bar(secondHead > 0 ? secondHead + gap : 0, firstTail < 1 ? firstTail - gap : 1, colors.track);
81
+ }
82
+ if (secondHead - secondTail > 0) {
83
+ bar(secondTail, secondHead, colors.indicator, true);
84
+ }
85
+ if (secondTail > gap) {
86
+ bar(0, secondTail - gap, colors.track);
87
+ }
88
+ return;
89
+ }
90
+ const progress = Math.min(1, Math.max(0, frame.progress));
91
+ const trackStart = progress + Math.min(progress, gap);
92
+ if (trackStart <= 1) {
93
+ bar(trackStart, 1, colors.track);
94
+ }
95
+ if (frame.buffer > progress) {
96
+ const bufferEnd = Math.min(1, frame.buffer);
97
+ if (bufferEnd > trackStart)
98
+ bar(trackStart, bufferEnd, colors.buffer);
99
+ }
100
+ bar(0, progress, colors.indicator, true);
101
+ if (frame.showStopIndicator) {
102
+ drawStopIndicator(ctx, width, height, colors.stop, rtl);
103
+ }
104
+ };
@@ -0,0 +1,43 @@
1
+ /**
2
+ * A cubic Bézier easing, as CSS and Compose define it: the curve through
3
+ * (0,0), (x1,y1), (x2,y2), (1,1), solved for y at a given x.
4
+ */
5
+ export declare const cubicBezier: (x1: number, y1: number, x2: number, y2: number) => ((t: number) => number);
6
+ export declare const emphasizedAccelerate: (t: number) => number;
7
+ export declare const emphasizedDecelerate: (t: number) => number;
8
+ export declare const standardEasing: (t: number) => number;
9
+ /** Where the two indeterminate bars are, as fractions of the track */
10
+ export interface LinearIndeterminateFrame {
11
+ firstHead: number;
12
+ firstTail: number;
13
+ secondHead: number;
14
+ secondTail: number;
15
+ }
16
+ /**
17
+ * The linear indeterminate frame at `elapsed` milliseconds: two bars, each
18
+ * from its tail to its head, on the Compose keyframes over a 1750ms cycle.
19
+ */
20
+ export declare const linearIndeterminateFrame: (elapsed: number) => LinearIndeterminateFrame;
21
+ /** How far round the arc has turned, and how much of the circle it covers */
22
+ export interface CircularIndeterminateFrame {
23
+ /** Rotation of the arc's start, in degrees clockwise from 3 o'clock */
24
+ rotation: number;
25
+ /** Length of the arc as a fraction of the circle */
26
+ sweep: number;
27
+ }
28
+ /**
29
+ * The circular indeterminate frame at `elapsed` milliseconds: a 1080 degree
30
+ * linear turn over the 6 second cycle, four 90 degree kicks on top of it, and
31
+ * an arc that grows to 87% by half way and shrinks back to 10%.
32
+ */
33
+ export declare const circularIndeterminateFrame: (elapsed: number) => CircularIndeterminateFrame;
34
+ /**
35
+ * How tall the wave is for a determinate value: flat at both ends of the
36
+ * range, full in between (WavyProgressIndicatorDefaults.indicatorAmplitude).
37
+ */
38
+ export declare const waveAmplitudeTarget: (progress: number) => number;
39
+ /**
40
+ * The wave's height part way through a change: standard easing on the way in,
41
+ * emphasized accelerate on the way out, over 500ms either way.
42
+ */
43
+ export declare const waveAmplitudeAt: (from: number, target: number, elapsed: number) => number;