@shortfuse/materialdesignweb 0.7.6 → 0.9.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 (412) hide show
  1. package/README.md +87 -90
  2. package/bin/mdw-css.js +1 -1
  3. package/components/Badge.js +14 -7
  4. package/components/Body.js +3 -0
  5. package/components/BottomAppBar.js +4 -13
  6. package/components/BottomSheet.js +424 -0
  7. package/components/Box.js +20 -28
  8. package/components/Button.js +85 -79
  9. package/components/Button.md +9 -9
  10. package/components/Card.js +60 -72
  11. package/components/Checkbox.js +33 -42
  12. package/components/CheckboxIcon.js +11 -29
  13. package/components/Chip.js +13 -11
  14. package/components/Dialog.js +214 -394
  15. package/components/DialogActions.js +2 -2
  16. package/components/Display.js +55 -0
  17. package/components/Divider.js +3 -3
  18. package/components/Fab.js +83 -18
  19. package/components/FabContainer.js +48 -0
  20. package/components/FilterChip.js +35 -33
  21. package/components/Grid.js +176 -0
  22. package/components/Headline.js +5 -28
  23. package/components/Icon.js +61 -76
  24. package/components/IconButton.js +72 -126
  25. package/components/Input.js +859 -1
  26. package/components/InputChip.js +161 -0
  27. package/components/Label.js +3 -0
  28. package/components/List.js +4 -6
  29. package/components/ListItem.js +46 -30
  30. package/components/ListOption.js +86 -53
  31. package/components/Listbox.js +248 -0
  32. package/components/Menu.js +69 -528
  33. package/components/MenuItem.js +33 -36
  34. package/components/NavBar.js +49 -86
  35. package/components/NavDrawer.js +16 -15
  36. package/components/NavDrawerItem.js +4 -5
  37. package/components/NavItem.js +58 -41
  38. package/components/NavRail.js +30 -20
  39. package/components/NavRailItem.js +8 -3
  40. package/components/Page.js +105 -0
  41. package/components/Pane.js +11 -274
  42. package/components/Popup.js +29 -0
  43. package/components/Progress.js +24 -23
  44. package/components/Radio.js +40 -36
  45. package/components/RadioIcon.js +12 -16
  46. package/components/Ripple.js +13 -10
  47. package/components/Root.js +209 -0
  48. package/components/Scrim.js +87 -0
  49. package/components/Search.js +77 -0
  50. package/components/SegmentedButton.js +33 -45
  51. package/components/SegmentedButtonGroup.js +25 -13
  52. package/components/Select.js +10 -11
  53. package/components/Shape.js +5 -65
  54. package/components/SideSheet.js +308 -0
  55. package/components/Slider.js +108 -78
  56. package/components/Snackbar.js +26 -21
  57. package/components/SnackbarContainer.js +42 -0
  58. package/components/Surface.js +17 -12
  59. package/components/Switch.js +45 -24
  60. package/components/SwitchIcon.js +49 -39
  61. package/components/Tab.js +64 -43
  62. package/components/TabContent.js +5 -3
  63. package/components/TabList.js +62 -34
  64. package/components/TabPanel.js +11 -8
  65. package/components/Table.js +116 -0
  66. package/components/TextArea.js +54 -50
  67. package/components/Title.js +4 -9
  68. package/components/Tooltip.js +44 -22
  69. package/components/TopAppBar.js +68 -172
  70. package/constants/shapes.js +36 -0
  71. package/constants/typography.js +127 -0
  72. package/core/Composition.js +1164 -645
  73. package/core/CompositionAdapter.js +314 -0
  74. package/core/CustomElement.js +701 -286
  75. package/core/css.js +121 -15
  76. package/core/customTypes.js +157 -40
  77. package/core/dom.js +17 -11
  78. package/{utils → core}/jsonMergePatch.js +42 -18
  79. package/core/observe.js +343 -244
  80. package/core/optimizations.js +23 -0
  81. package/core/template.js +19 -56
  82. package/core/uid.js +13 -0
  83. package/dist/index.min.js +85 -184
  84. package/dist/index.min.js.map +4 -4
  85. package/dist/meta.json +1 -1
  86. package/dom/HTMLOptionsCollectionProxy.js +106 -0
  87. package/loaders/palette.js +13 -0
  88. package/loaders/theme.js +12 -0
  89. package/mixins/AriaReflectorMixin.js +53 -14
  90. package/mixins/AriaToolbarMixin.js +5 -3
  91. package/mixins/ControlMixin.js +92 -41
  92. package/mixins/DelegatesFocusMixin.js +54 -0
  93. package/mixins/DensityMixin.js +2 -3
  94. package/mixins/ElevationMixin.js +62 -0
  95. package/mixins/FlexableMixin.js +67 -39
  96. package/mixins/FormAssociatedMixin.js +71 -16
  97. package/mixins/HyperlinkMixin.js +66 -0
  98. package/mixins/InputMixin.js +205 -39
  99. package/mixins/KeyboardNavMixin.js +22 -7
  100. package/mixins/NavigationListenerMixin.js +33 -0
  101. package/mixins/PopupMixin.js +725 -0
  102. package/mixins/RTLObserverMixin.js +0 -1
  103. package/mixins/ResizeObserverMixin.js +16 -5
  104. package/mixins/RippleMixin.js +11 -10
  105. package/mixins/ScrollListenerMixin.js +42 -33
  106. package/mixins/SemiStickyMixin.js +97 -0
  107. package/mixins/ShapeMaskedMixin.js +117 -0
  108. package/mixins/ShapeMixin.js +17 -194
  109. package/mixins/StateMixin.js +80 -39
  110. package/mixins/TextFieldMixin.js +139 -183
  111. package/mixins/ThemableMixin.js +71 -161
  112. package/mixins/TooltipTriggerMixin.js +292 -366
  113. package/mixins/TouchTargetMixin.js +5 -4
  114. package/mixins/TypographyMixin.js +121 -0
  115. package/package.json +111 -71
  116. package/services/rtl.js +10 -0
  117. package/services/svgAlias.js +17 -0
  118. package/{theming/index.js → services/theme.js} +25 -175
  119. package/types/bin/mdw-css.d.ts +3 -0
  120. package/types/bin/mdw-css.d.ts.map +1 -0
  121. package/types/components/Badge.d.ts +39 -0
  122. package/types/components/Badge.d.ts.map +1 -0
  123. package/types/components/Body.d.ts +29 -0
  124. package/types/components/Body.d.ts.map +1 -0
  125. package/types/components/BottomAppBar.d.ts +73 -0
  126. package/types/components/BottomAppBar.d.ts.map +1 -0
  127. package/types/components/BottomSheet.d.ts +109 -0
  128. package/types/components/BottomSheet.d.ts.map +1 -0
  129. package/types/components/Box.d.ts +16 -0
  130. package/types/components/Box.d.ts.map +1 -0
  131. package/types/components/Button.d.ts +714 -0
  132. package/types/components/Button.d.ts.map +1 -0
  133. package/types/components/Card.d.ts +412 -0
  134. package/types/components/Card.d.ts.map +1 -0
  135. package/types/components/Checkbox.d.ts +205 -0
  136. package/types/components/Checkbox.d.ts.map +1 -0
  137. package/types/components/CheckboxIcon.d.ts +44 -0
  138. package/types/components/CheckboxIcon.d.ts.map +1 -0
  139. package/types/components/Chip.d.ts +1425 -0
  140. package/types/components/Chip.d.ts.map +1 -0
  141. package/types/components/Dialog.d.ts +286 -0
  142. package/types/components/Dialog.d.ts.map +1 -0
  143. package/types/components/DialogActions.d.ts +4 -0
  144. package/types/components/DialogActions.d.ts.map +1 -0
  145. package/types/components/Display.d.ts +45 -0
  146. package/types/components/Display.d.ts.map +1 -0
  147. package/types/components/Divider.d.ts +10 -0
  148. package/types/components/Divider.d.ts.map +1 -0
  149. package/types/components/Fab.d.ts +741 -0
  150. package/types/components/Fab.d.ts.map +1 -0
  151. package/types/components/FabContainer.d.ts +10 -0
  152. package/types/components/FabContainer.d.ts.map +1 -0
  153. package/types/components/FilterChip.d.ts +4283 -0
  154. package/types/components/FilterChip.d.ts.map +1 -0
  155. package/types/components/Grid.d.ts +37 -0
  156. package/types/components/Grid.d.ts.map +1 -0
  157. package/types/components/Headline.d.ts +47 -0
  158. package/types/components/Headline.d.ts.map +1 -0
  159. package/types/components/Icon.d.ts +103 -0
  160. package/types/components/Icon.d.ts.map +1 -0
  161. package/types/components/IconButton.d.ts +1486 -0
  162. package/types/components/IconButton.d.ts.map +1 -0
  163. package/types/components/Input.d.ts +51288 -0
  164. package/types/components/Input.d.ts.map +1 -0
  165. package/types/components/InputChip.d.ts +243 -0
  166. package/types/components/InputChip.d.ts.map +1 -0
  167. package/types/components/Label.d.ts +29 -0
  168. package/types/components/Label.d.ts.map +1 -0
  169. package/types/components/List.d.ts +31 -0
  170. package/types/components/List.d.ts.map +1 -0
  171. package/types/components/ListItem.d.ts +349 -0
  172. package/types/components/ListItem.d.ts.map +1 -0
  173. package/types/components/ListOption.d.ts +1493 -0
  174. package/types/components/ListOption.d.ts.map +1 -0
  175. package/types/components/Listbox.d.ts +12012 -0
  176. package/types/components/Listbox.d.ts.map +1 -0
  177. package/types/components/Menu.d.ts +119 -0
  178. package/types/components/Menu.d.ts.map +1 -0
  179. package/types/components/MenuItem.d.ts +3109 -0
  180. package/types/components/MenuItem.d.ts.map +1 -0
  181. package/types/components/NavBar.d.ts +18 -0
  182. package/types/components/NavBar.d.ts.map +1 -0
  183. package/types/components/NavBarItem.d.ts +186 -0
  184. package/types/components/NavBarItem.d.ts.map +1 -0
  185. package/types/components/NavDrawer.d.ts +108 -0
  186. package/types/components/NavDrawer.d.ts.map +1 -0
  187. package/types/components/NavDrawerItem.d.ts +186 -0
  188. package/types/components/NavDrawerItem.d.ts.map +1 -0
  189. package/types/components/NavItem.d.ts +190 -0
  190. package/types/components/NavItem.d.ts.map +1 -0
  191. package/types/components/NavRail.d.ts +109 -0
  192. package/types/components/NavRail.d.ts.map +1 -0
  193. package/types/components/NavRailItem.d.ts +186 -0
  194. package/types/components/NavRailItem.d.ts.map +1 -0
  195. package/types/components/Page.d.ts +24 -0
  196. package/types/components/Page.d.ts.map +1 -0
  197. package/types/components/Pane.d.ts +44 -0
  198. package/types/components/Pane.d.ts.map +1 -0
  199. package/types/components/Popup.d.ts +76 -0
  200. package/types/components/Popup.d.ts.map +1 -0
  201. package/types/components/Progress.d.ts +19 -0
  202. package/types/components/Progress.d.ts.map +1 -0
  203. package/types/components/Radio.d.ts +199 -0
  204. package/types/components/Radio.d.ts.map +1 -0
  205. package/types/components/RadioIcon.d.ts +46 -0
  206. package/types/components/RadioIcon.d.ts.map +1 -0
  207. package/types/components/Ripple.d.ts +34 -0
  208. package/types/components/Ripple.d.ts.map +1 -0
  209. package/types/components/Root.d.ts +68 -0
  210. package/types/components/Root.d.ts.map +1 -0
  211. package/types/components/Scrim.d.ts +6 -0
  212. package/types/components/Scrim.d.ts.map +1 -0
  213. package/types/components/Search.d.ts +16 -0
  214. package/types/components/Search.d.ts.map +1 -0
  215. package/types/components/SegmentedButton.d.ts +718 -0
  216. package/types/components/SegmentedButton.d.ts.map +1 -0
  217. package/types/components/SegmentedButtonGroup.d.ts +44 -0
  218. package/types/components/SegmentedButtonGroup.d.ts.map +1 -0
  219. package/types/components/Select.d.ts +1361 -0
  220. package/types/components/Select.d.ts.map +1 -0
  221. package/types/components/Shape.d.ts +10 -0
  222. package/types/components/Shape.d.ts.map +1 -0
  223. package/types/components/SideSheet.d.ts +106 -0
  224. package/types/components/SideSheet.d.ts.map +1 -0
  225. package/types/components/Slider.d.ts +382 -0
  226. package/types/components/Slider.d.ts.map +1 -0
  227. package/types/components/Snackbar.d.ts +65 -0
  228. package/types/components/Snackbar.d.ts.map +1 -0
  229. package/types/components/SnackbarContainer.d.ts +6 -0
  230. package/types/components/SnackbarContainer.d.ts.map +1 -0
  231. package/types/components/Surface.d.ts +45 -0
  232. package/types/components/Surface.d.ts.map +1 -0
  233. package/types/components/Switch.d.ts +183 -0
  234. package/types/components/Switch.d.ts.map +1 -0
  235. package/types/components/SwitchIcon.d.ts +169 -0
  236. package/types/components/SwitchIcon.d.ts.map +1 -0
  237. package/types/components/Tab.d.ts +879 -0
  238. package/types/components/Tab.d.ts.map +1 -0
  239. package/types/components/TabContent.d.ts +122 -0
  240. package/types/components/TabContent.d.ts.map +1 -0
  241. package/types/components/TabList.d.ts +6266 -0
  242. package/types/components/TabList.d.ts.map +1 -0
  243. package/types/components/TabPanel.d.ts +28 -0
  244. package/types/components/TabPanel.d.ts.map +1 -0
  245. package/types/components/Table.d.ts +2 -0
  246. package/types/components/Table.d.ts.map +1 -0
  247. package/types/components/TextArea.d.ts +1394 -0
  248. package/types/components/TextArea.d.ts.map +1 -0
  249. package/types/components/Title.d.ts +47 -0
  250. package/types/components/Title.d.ts.map +1 -0
  251. package/types/components/Tooltip.d.ts +49 -0
  252. package/types/components/Tooltip.d.ts.map +1 -0
  253. package/types/components/TopAppBar.d.ts +130 -0
  254. package/types/components/TopAppBar.d.ts.map +1 -0
  255. package/types/constants/colorKeywords.d.ts +2 -0
  256. package/types/constants/colorKeywords.d.ts.map +1 -0
  257. package/types/constants/shapes.d.ts +38 -0
  258. package/types/constants/shapes.d.ts.map +1 -0
  259. package/types/constants/typography.d.ts +212 -0
  260. package/types/constants/typography.d.ts.map +1 -0
  261. package/types/core/Composition.d.ts +252 -0
  262. package/types/core/Composition.d.ts.map +1 -0
  263. package/types/core/CompositionAdapter.d.ts +92 -0
  264. package/types/core/CompositionAdapter.d.ts.map +1 -0
  265. package/types/core/CustomElement.d.ts +302 -0
  266. package/types/core/CustomElement.d.ts.map +1 -0
  267. package/types/core/css.d.ts +44 -0
  268. package/types/core/css.d.ts.map +1 -0
  269. package/types/core/customTypes.d.ts +26 -0
  270. package/types/core/customTypes.d.ts.map +1 -0
  271. package/types/core/dom.d.ts +32 -0
  272. package/types/core/dom.d.ts.map +1 -0
  273. package/types/core/jsonMergePatch.d.ts +31 -0
  274. package/types/core/jsonMergePatch.d.ts.map +1 -0
  275. package/types/core/observe.d.ts +113 -0
  276. package/types/core/observe.d.ts.map +1 -0
  277. package/types/core/optimizations.d.ts +7 -0
  278. package/types/core/optimizations.d.ts.map +1 -0
  279. package/types/core/template.d.ts +47 -0
  280. package/types/core/template.d.ts.map +1 -0
  281. package/types/core/uid.d.ts +6 -0
  282. package/types/core/uid.d.ts.map +1 -0
  283. package/types/dom/HTMLOptionsCollectionProxy.d.ts +18 -0
  284. package/types/dom/HTMLOptionsCollectionProxy.d.ts.map +1 -0
  285. package/types/index.d.ts +88 -0
  286. package/types/index.d.ts.map +1 -0
  287. package/types/loaders/palette.d.ts +2 -0
  288. package/types/loaders/palette.d.ts.map +1 -0
  289. package/types/loaders/theme.d.ts +2 -0
  290. package/types/loaders/theme.d.ts.map +1 -0
  291. package/types/mixins/AriaReflectorMixin.d.ts +23 -0
  292. package/types/mixins/AriaReflectorMixin.d.ts.map +1 -0
  293. package/types/mixins/AriaToolbarMixin.d.ts +32 -0
  294. package/types/mixins/AriaToolbarMixin.d.ts.map +1 -0
  295. package/types/mixins/ControlMixin.d.ts +124 -0
  296. package/types/mixins/ControlMixin.d.ts.map +1 -0
  297. package/types/mixins/DelegatesFocusMixin.d.ts +5 -0
  298. package/types/mixins/DelegatesFocusMixin.d.ts.map +1 -0
  299. package/types/mixins/DensityMixin.d.ts +5 -0
  300. package/types/mixins/DensityMixin.d.ts.map +1 -0
  301. package/types/mixins/ElevationMixin.d.ts +33 -0
  302. package/types/mixins/ElevationMixin.d.ts.map +1 -0
  303. package/types/mixins/FlexableMixin.d.ts +13 -0
  304. package/types/mixins/FlexableMixin.d.ts.map +1 -0
  305. package/types/mixins/FormAssociatedMixin.d.ts +122 -0
  306. package/types/mixins/FormAssociatedMixin.d.ts.map +1 -0
  307. package/types/mixins/HyperlinkMixin.d.ts +22 -0
  308. package/types/mixins/HyperlinkMixin.d.ts.map +1 -0
  309. package/types/mixins/InputMixin.d.ts +179 -0
  310. package/types/mixins/InputMixin.d.ts.map +1 -0
  311. package/types/mixins/KeyboardNavMixin.d.ts +47 -0
  312. package/types/mixins/KeyboardNavMixin.d.ts.map +1 -0
  313. package/types/mixins/NavigationListenerMixin.d.ts +8 -0
  314. package/types/mixins/NavigationListenerMixin.d.ts.map +1 -0
  315. package/types/mixins/PopupMixin.d.ts +82 -0
  316. package/types/mixins/PopupMixin.d.ts.map +1 -0
  317. package/types/mixins/RTLObserverMixin.d.ts +7 -0
  318. package/types/mixins/RTLObserverMixin.d.ts.map +1 -0
  319. package/types/mixins/ResizeObserverMixin.d.ts +12 -0
  320. package/types/mixins/ResizeObserverMixin.d.ts.map +1 -0
  321. package/types/mixins/RippleMixin.d.ts +92 -0
  322. package/types/mixins/RippleMixin.d.ts.map +1 -0
  323. package/types/mixins/ScrollListenerMixin.d.ts +41 -0
  324. package/types/mixins/ScrollListenerMixin.d.ts.map +1 -0
  325. package/types/mixins/SemiStickyMixin.d.ts +50 -0
  326. package/types/mixins/SemiStickyMixin.d.ts.map +1 -0
  327. package/types/mixins/ShapeMaskedMixin.d.ts +9 -0
  328. package/types/mixins/ShapeMaskedMixin.d.ts.map +1 -0
  329. package/types/mixins/ShapeMixin.d.ts +38 -0
  330. package/types/mixins/ShapeMixin.d.ts.map +1 -0
  331. package/types/mixins/StateMixin.d.ts +27 -0
  332. package/types/mixins/StateMixin.d.ts.map +1 -0
  333. package/types/mixins/TextFieldMixin.d.ts +1354 -0
  334. package/types/mixins/TextFieldMixin.d.ts.map +1 -0
  335. package/types/mixins/ThemableMixin.d.ts +9 -0
  336. package/types/mixins/ThemableMixin.d.ts.map +1 -0
  337. package/types/mixins/TooltipTriggerMixin.d.ts +106 -0
  338. package/types/mixins/TooltipTriggerMixin.d.ts.map +1 -0
  339. package/types/mixins/TouchTargetMixin.d.ts +3 -0
  340. package/types/mixins/TouchTargetMixin.d.ts.map +1 -0
  341. package/types/mixins/TypographyMixin.d.ts +17 -0
  342. package/types/mixins/TypographyMixin.d.ts.map +1 -0
  343. package/types/services/rtl.d.ts +3 -0
  344. package/types/services/rtl.d.ts.map +1 -0
  345. package/types/services/svgAlias.d.ts +13 -0
  346. package/types/services/svgAlias.d.ts.map +1 -0
  347. package/types/services/theme.d.ts +45 -0
  348. package/types/services/theme.d.ts.map +1 -0
  349. package/types/utils/cli.d.ts +3 -0
  350. package/types/utils/cli.d.ts.map +1 -0
  351. package/types/utils/function.d.ts +3 -0
  352. package/types/utils/function.d.ts.map +1 -0
  353. package/types/utils/jsx-runtime.d.ts +20 -0
  354. package/types/utils/jsx-runtime.d.ts.map +1 -0
  355. package/types/utils/material-color/blend.d.ts +34 -0
  356. package/types/utils/material-color/blend.d.ts.map +1 -0
  357. package/types/utils/material-color/hct/Cam16.d.ts +142 -0
  358. package/types/utils/material-color/hct/Cam16.d.ts.map +1 -0
  359. package/types/utils/material-color/hct/Hct.d.ts +93 -0
  360. package/types/utils/material-color/hct/Hct.d.ts.map +1 -0
  361. package/types/utils/material-color/hct/ViewingConditions.d.ts +69 -0
  362. package/types/utils/material-color/hct/ViewingConditions.d.ts.map +1 -0
  363. package/types/utils/material-color/hct/hctSolver.d.ts +30 -0
  364. package/types/utils/material-color/hct/hctSolver.d.ts.map +1 -0
  365. package/types/utils/material-color/helper.d.ts +8 -0
  366. package/types/utils/material-color/helper.d.ts.map +1 -0
  367. package/types/utils/material-color/palettes/CorePalette.d.ts +75 -0
  368. package/types/utils/material-color/palettes/CorePalette.d.ts.map +1 -0
  369. package/types/utils/material-color/palettes/TonalPalette.d.ts +38 -0
  370. package/types/utils/material-color/palettes/TonalPalette.d.ts.map +1 -0
  371. package/types/utils/material-color/scheme/Scheme.d.ts +264 -0
  372. package/types/utils/material-color/scheme/Scheme.d.ts.map +1 -0
  373. package/types/utils/material-color/utils/color.d.ts +172 -0
  374. package/types/utils/material-color/utils/color.d.ts.map +1 -0
  375. package/types/utils/material-color/utils/math.d.ts +94 -0
  376. package/types/utils/material-color/utils/math.d.ts.map +1 -0
  377. package/types/utils/pixelmatch.d.ts +22 -0
  378. package/types/utils/pixelmatch.d.ts.map +1 -0
  379. package/types/utils/popup.d.ts +106 -0
  380. package/types/utils/popup.d.ts.map +1 -0
  381. package/types/utils/searchParams.d.ts +3 -0
  382. package/types/utils/searchParams.d.ts.map +1 -0
  383. package/types/utils/svg.d.ts +7 -0
  384. package/types/utils/svg.d.ts.map +1 -0
  385. package/utils/{hct → material-color}/blend.js +8 -10
  386. package/utils/{hct → material-color/hct}/Cam16.js +196 -69
  387. package/utils/{hct → material-color/hct}/Hct.js +61 -19
  388. package/utils/{hct → material-color/hct}/ViewingConditions.js +3 -3
  389. package/utils/{hct → material-color/hct}/hctSolver.js +9 -16
  390. package/utils/{hct → material-color}/helper.js +11 -18
  391. package/utils/{hct → material-color/palettes}/CorePalette.js +79 -19
  392. package/utils/{hct → material-color/palettes}/TonalPalette.js +12 -4
  393. package/utils/material-color/scheme/Scheme.js +376 -0
  394. package/utils/{hct/colorUtils.js → material-color/utils/color.js} +61 -1
  395. package/utils/pixelmatch.js +360 -0
  396. package/utils/popup.js +127 -30
  397. package/utils/searchParams.js +19 -0
  398. package/components/ExtendedFab.js +0 -36
  399. package/components/Layout.js +0 -35
  400. package/components/ListSelect.js +0 -220
  401. package/components/Nav.js +0 -40
  402. package/components/Option.js +0 -91
  403. package/core/ICustomElement.d.ts +0 -291
  404. package/core/ICustomElement.js +0 -1
  405. package/core/identify.js +0 -40
  406. package/core/typings.d.ts +0 -136
  407. package/core/typings.js +0 -1
  408. package/mixins/SurfaceMixin.js +0 -181
  409. package/theming/loader.js +0 -22
  410. package/utils/hct/Scheme.js +0 -587
  411. /package/{utils/color_keywords.js → constants/colorKeywords.js} +0 -0
  412. /package/utils/{hct/mathUtils.js → material-color/utils/math.js} +0 -0
@@ -1,3 +1,5 @@
1
+ /* https://m3.material.io/components/radio/specs */
2
+
1
3
  import './RadioIcon.js';
2
4
 
3
5
  import CustomElement from '../core/CustomElement.js';
@@ -8,34 +10,38 @@ import ThemableMixin from '../mixins/ThemableMixin.js';
8
10
  import TouchTargetMixin from '../mixins/TouchTargetMixin.js';
9
11
 
10
12
  export default CustomElement
13
+ .extend()
11
14
  .mixin(ThemableMixin)
12
15
  .mixin(StateMixin)
13
16
  .mixin(RippleMixin)
14
17
  .mixin(InputMixin)
15
18
  .mixin(TouchTargetMixin)
16
- .extend()
17
19
  .set({
18
20
  type: 'radio',
19
21
  stateLayer: true,
20
22
  })
21
- .on({
22
- composed({ html }) {
23
- const { label, rippleContainer, state, control, touchTarget } = this.refs;
24
- label.append(html`
25
- ${touchTarget}
26
- ${control}
27
- <div id=radio errored={erroredState} selected={checked}>
28
- <mdw-radio-icon id=icon errored={erroredState} disabled={disabledState}
29
- selected={checked} focused={focusedState} hovered={hoveredState}></mdw-radio-icon>
30
- ${state}
31
- ${rippleContainer}
32
- </div>
33
- <slot id=slot></slot>
34
- `);
23
+ .html`
24
+ <div id=radio errored={erroredState} selected={checked}>
25
+ <mdw-radio-icon id=icon errored={erroredState} disabled={disabledState}
26
+ selected={checked} focused={focusedState} hovered={hoveredState}></mdw-radio-icon>
27
+ </div>
28
+ <slot id=slot></slot>
29
+ `
30
+ .rootEvents({
31
+ click(event) {
32
+ const { control } = this.refs;
33
+ if (event.target !== control) {
34
+ // Label-like click
35
+ event.stopPropagation();
36
+ control.click();
37
+ }
35
38
  },
36
39
  })
40
+ .recompose(({ refs: { radio, rippleContainer, state } }) => {
41
+ radio.append(state, rippleContainer);
42
+ })
37
43
  .css`
38
- /* https://m3.material.io/components/radio/specs */
44
+ /* stylelint-disable liberty/use-logical-spec */
39
45
 
40
46
  :host {
41
47
  --mdw-ink: var(--mdw-color__primary);
@@ -53,38 +59,38 @@ export default CustomElement
53
59
  transition: none 100ms cubic-bezier(0.4, 0.0, 1, 1);
54
60
  }
55
61
 
62
+ :host(:disabled) {
63
+ cursor: not-allowed;
64
+
65
+ opacity: 0.38;
66
+ }
67
+
68
+ :host([internals-disabled]) {
69
+ cursor: not-allowed;
70
+
71
+ opacity: 0.38;
72
+ }
73
+
56
74
  :host(:empty) {
57
75
  vertical-align: -11.5%;
58
76
 
59
77
  line-height: 20px;
60
78
  }
61
79
 
62
- :host(:empty) #radio {
63
- transform: none;
64
- }
65
-
66
80
  #control {
67
81
  grid-column: 1/1;
68
82
 
69
83
  cursor: inherit;
70
84
  }
71
85
 
72
- #label {
73
- cursor: inherit;
74
- }
75
-
76
- #label[disabled] {
77
- cursor: not-allowed;
78
- }
79
-
80
86
  #state {
81
87
  pointer-events: auto;
82
88
  }
83
89
 
84
90
  #state,
85
91
  #ripple-container {
86
- inset-block-start: 50%;
87
- inset-inline-start: 50%;
92
+ top: 50%;
93
+ left: 50%;
88
94
 
89
95
  block-size: 40px;
90
96
  inline-size: 40px;
@@ -94,12 +100,6 @@ export default CustomElement
94
100
  border-radius: 50%;
95
101
  }
96
102
 
97
- :host([disabled]) {
98
- cursor: not-allowed;
99
-
100
- opacity: 0.38;
101
- }
102
-
103
103
  #radio {
104
104
  position: relative;
105
105
 
@@ -126,6 +126,10 @@ export default CustomElement
126
126
  color: rgb(var(--mdw-color__error));
127
127
  }
128
128
 
129
+ :host(:empty) #radio {
130
+ transform: none;
131
+ }
132
+
129
133
  #icon {
130
134
  --mdw-ink: inherit;
131
135
  --disabled-opacity: 1;
@@ -1,11 +1,13 @@
1
+ import './Shape.js';
2
+
1
3
  import CustomElement from '../core/CustomElement.js';
2
4
  import ShapeMixin from '../mixins/ShapeMixin.js';
3
5
  import ThemableMixin from '../mixins/ThemableMixin.js';
4
6
 
5
7
  export default CustomElement
8
+ .extend()
6
9
  .mixin(ThemableMixin)
7
10
  .mixin(ShapeMixin)
8
- .extend()
9
11
  .observe({
10
12
  selected: 'boolean',
11
13
  icon: 'string',
@@ -21,14 +23,12 @@ export default CustomElement
21
23
  set(value) { this.selected = value; },
22
24
  },
23
25
  })
24
- .html/* html */`
25
- <div id=inner-shape class=shape selected={selected}></div>
26
- `.on({
27
- composed() {
28
- const { outline } = this.refs;
29
- outline.removeAttribute('_if');
30
- outline.setAttribute('selected', '{selected}');
31
- },
26
+ .html`
27
+ <mdw-shape id=inner-shape selected={selected}></div>
28
+ `
29
+ .recompose(({ refs: { outline } }) => {
30
+ outline.removeAttribute('mdw-if');
31
+ outline.setAttribute('selected', '{selected}');
32
32
  })
33
33
  .css`
34
34
  /* https://m3.material.io/components/radio-button/specs */
@@ -52,16 +52,11 @@ export default CustomElement
52
52
  }
53
53
 
54
54
  #outline {
55
- filter:
56
- drop-shadow(1px 0px 0px var(--color))
57
- drop-shadow(0px 1px 0px var(--color))
58
- drop-shadow(-1px 0px 0px var(--color))
59
- drop-shadow(0px -1px 0px var(--color))
60
- ;
55
+ border-width: 2px;
61
56
 
62
57
  color: var(--color);
63
58
 
64
- will-change: filter, color;
59
+ will-change: color;
65
60
  }
66
61
 
67
62
  #inner-shape {
@@ -71,6 +66,7 @@ export default CustomElement
71
66
  transform: scale(0);
72
67
 
73
68
  background-color: var(--color);
69
+ border-radius: inherit;
74
70
 
75
71
  transition: transform 200ms, background-color 100ms;
76
72
  }
@@ -1,5 +1,5 @@
1
1
  import CustomElement from '../core/CustomElement.js';
2
- import { ELEMENT_STYLER_TYPE } from '../core/customTypes.js';
2
+ import { ELEMENT_ANIMATION_TYPE } from '../core/customTypes.js';
3
3
 
4
4
  export default CustomElement
5
5
  .extend()
@@ -27,15 +27,17 @@ export default CustomElement
27
27
  })
28
28
  .observe({
29
29
  _positionStyle: {
30
- ...ELEMENT_STYLER_TYPE,
30
+ ...ELEMENT_ANIMATION_TYPE,
31
31
  get({ _positionX, _positionY, _radius }) {
32
+ // Skip if not measured
33
+ if (_radius == null) return null;
32
34
  return {
33
35
  styles: {
34
- minBlockSize: `${_radius}px`,
35
- minInlineSize: `${_radius}px`,
36
+ minHeight: `${_radius}px`,
37
+ minWidth: `${_radius}px`,
36
38
  boxShadow: `0 0 calc(0.10 * ${_radius}px) calc(0.10 * ${_radius}px) currentColor`,
37
- left: `calc(50% + ${_positionX}px)`,
38
39
  top: `calc(50% + ${_positionY}px)`,
40
+ left: `calc(50% + ${_positionX}px)`,
39
41
  },
40
42
  };
41
43
  },
@@ -53,14 +55,16 @@ export default CustomElement
53
55
  // Use offset to calculate parent size;
54
56
 
55
57
  let hypotenuse = size;
56
- const { clientWidth: parentWidth, clientHeight: parentHeight } = this.offsetParent;
58
+ const { offsetParent } = this;
59
+ if (!offsetParent) return;
60
+ const { clientWidth: parentWidth, clientHeight: parentHeight } = offsetParent;
57
61
 
58
62
  x ??= parentWidth / 2;
59
63
  y ??= parentHeight / 2;
60
64
  if (!hypotenuse) {
61
65
  const width = (x >= parentWidth / 2) ? x : (parentWidth - x);
62
66
  const height = (y >= parentHeight / 2) ? y : (parentHeight - y);
63
- hypotenuse = 2 * Math.sqrt((width * width) + (height * height));
67
+ hypotenuse = 2 * Math.hypot(width, height);
64
68
  }
65
69
 
66
70
  // const expandDuration = Math.min(
@@ -99,7 +103,7 @@ export default CustomElement
99
103
  animationend({ animationName }) {
100
104
  switch (animationName) {
101
105
  case 'ripple-fade-in':
102
- this.setAttribute('ripple-state', 'filled');
106
+ this.rippleState = 'filled';
103
107
  break;
104
108
  case 'ripple-fade-out':
105
109
  this.handleRippleComplete();
@@ -109,6 +113,7 @@ export default CustomElement
109
113
  },
110
114
  })
111
115
  .css`
116
+ /* stylelint-disable liberty/use-logical-spec */
112
117
  :host {
113
118
  --enter-delay: 80ms;
114
119
  --touch-down-acceleration: 1024;
@@ -121,9 +126,7 @@ export default CustomElement
121
126
 
122
127
  --size: 0;
123
128
  position: absolute;
124
- /* stylelint-disable-next-line liberty/use-logical-spec */
125
129
  top: 50%;
126
- /* stylelint-disable-next-line liberty/use-logical-spec */
127
130
  left: 50%;
128
131
 
129
132
  display: block;
@@ -0,0 +1,209 @@
1
+ /* https://m3.material.io/foundations/layout/applying-layout/window-size-classes */
2
+
3
+ import CustomElement from '../core/CustomElement.js';
4
+ import { ELEMENT_ANIMATION_TYPE } from '../core/customTypes.js';
5
+ import DelegatesFocusMixin from '../mixins/DelegatesFocusMixin.js';
6
+ import ScrollListenerMixin from '../mixins/ScrollListenerMixin.js';
7
+
8
+ export default CustomElement
9
+ .extend()
10
+ .mixin(ScrollListenerMixin)
11
+ .mixin(DelegatesFocusMixin)
12
+ .set({
13
+ /** @type {ResizeObserver} */
14
+ _bottomResizeObserver: null,
15
+ })
16
+ .html`
17
+ <slot id=start name=start></slot>
18
+ <div id=bottom>
19
+ <slot id=bottom-slot name=bottom></slot>
20
+ </div>
21
+ <div id=bottom-fixed>
22
+ <slot id=bottom-fixed-slot name=bottom-fixed></slot>
23
+ </div>
24
+ <slot id=slot></slot>
25
+ <slot id=end name=end></slot>
26
+ `
27
+ .observe({
28
+ _bottomHeight: { type: 'float', empty: 0 },
29
+ _bottomOffsetY: { type: 'float', empty: 0 },
30
+ _bottomDuration: { type: 'float', empty: 0 },
31
+ _bottomEasing: { empty: 'ease-in' },
32
+ })
33
+ .observe({
34
+ _sharedBottomStyle({ _bottomOffsetY, _bottomDuration, _bottomEasing, _bottomHeight }) {
35
+ if (!_bottomHeight) return null;
36
+ return {
37
+ styles: {
38
+ transform: `translateY(${_bottomOffsetY}px)`,
39
+ },
40
+ timing: {
41
+ duration: _bottomDuration,
42
+ easing: _bottomEasing,
43
+ },
44
+ };
45
+ },
46
+ })
47
+ .observe({
48
+ _bottomSlotStyle: {
49
+ ...ELEMENT_ANIMATION_TYPE,
50
+ get({ _sharedBottomStyle }) {
51
+ if (!_sharedBottomStyle) return null;
52
+ return {
53
+ target: 'bottom-slot',
54
+ ..._sharedBottomStyle,
55
+ };
56
+ },
57
+ },
58
+ _bottomFixedSlotStyle: {
59
+ ...ELEMENT_ANIMATION_TYPE,
60
+ get({ _sharedBottomStyle }) {
61
+ if (!_sharedBottomStyle) return null;
62
+ return {
63
+ target: 'bottom-fixed-slot',
64
+ ..._sharedBottomStyle,
65
+ };
66
+ },
67
+ },
68
+ })
69
+ .on({
70
+ _scrollListenerPositionYChanged(oldValue, newValue) {
71
+ const delta = newValue - oldValue;
72
+
73
+ this._bottomDuration = 0;
74
+ // 0 if disabled or has scrolled upto element
75
+ // Valid range : 0 > x > (100% - required)
76
+ const bottomStartsAt = (document.documentElement.scrollHeight - window.innerHeight - 1);
77
+ const distanceFromBottom = bottomStartsAt - newValue;
78
+ const scrollVisible = this._bottomHeight - distanceFromBottom;
79
+ let mustIncludeSpace = 0;
80
+ if (scrollVisible > 0) {
81
+ mustIncludeSpace = scrollVisible;
82
+ }
83
+
84
+ this._bottomOffsetY = (newValue === 0 || distanceFromBottom < 0)
85
+ ? 0
86
+ : Math.max(0, Math.min(
87
+ this._bottomOffsetY + delta,
88
+ this._bottomHeight - mustIncludeSpace,
89
+ ));
90
+ },
91
+ _scrollListenerLastIdleChanged() {
92
+ const { _bottomHeight, _bottomOffsetY } = this;
93
+ const visibility = (_bottomHeight - _bottomOffsetY) / _bottomHeight;
94
+ if (visibility <= 0) return;
95
+ if (visibility >= 1) return;
96
+ if (visibility < 0.5) {
97
+ const bottomStartsAt = (document.documentElement.scrollHeight - window.innerHeight - 1);
98
+ const { _scrollListenerPositionY } = this;
99
+ const distanceFromBottom = bottomStartsAt - _scrollListenerPositionY;
100
+ const scrollVisible = _bottomHeight - distanceFromBottom;
101
+
102
+ if (_scrollListenerPositionY !== 0 && distanceFromBottom >= 0 && scrollVisible <= 0) {
103
+ this._bottomDuration = 200;
104
+ this._bottomEasing = 'ease-out';
105
+ this._bottomOffsetY = _bottomHeight;
106
+ return;
107
+ }
108
+ }
109
+
110
+ // Reveal all
111
+ this._bottomDuration = 250;
112
+ this._bottomEasing = 'ease-in';
113
+ this._bottomOffsetY = 0;
114
+ },
115
+ connected() {
116
+ // eslint-disable-next-line no-multi-assign
117
+ const observer = (this._bottomResizeObserver ??= new ResizeObserver((entries) => {
118
+ for (const { borderBoxSize } of entries) {
119
+ this._bottomHeight = borderBoxSize[0].blockSize;
120
+ }
121
+ }));
122
+ observer.observe(this.refs.bottom);
123
+ this.startScrollListener(window);
124
+ },
125
+ disconnected() {
126
+ this._scrollListenerClear();
127
+ this._bottomResizeObserver.unobserve(this.refs.bottom);
128
+ },
129
+ })
130
+ .css`
131
+ :host {
132
+ position: relative;
133
+
134
+ display: grid;
135
+ grid-template:
136
+ "start top end" auto
137
+ "start content end" minmax(auto, 1fr)
138
+ "start bottom end" auto
139
+ / minmax(0px, auto) minmax(0px, 100%) minmax(0px, auto);
140
+
141
+ min-block-size: 100vh;
142
+ min-block-size: 100dvh;
143
+
144
+ font: var(--mdw-typescale__body-large__font);
145
+ letter-spacing: var(--mdw-typescale__body-large__letter-spacing);
146
+ }
147
+
148
+ #start {
149
+ display: flex;
150
+ grid-area: start;
151
+ }
152
+
153
+ #slot {
154
+ display: block;
155
+ grid-area: content;
156
+ overflow-x: clip;
157
+
158
+ }
159
+
160
+ #end {
161
+ display: none;
162
+
163
+ grid-area: end;
164
+
165
+ block-size: 0;
166
+ }
167
+
168
+ #bottom {
169
+ position: sticky;
170
+ inset-block-end: 0;
171
+
172
+ display: block;
173
+ grid-area: bottom;
174
+ overflow-y: hidden;
175
+
176
+ pointer-events: none;
177
+
178
+ z-index: 1;
179
+ }
180
+
181
+ #bottom-slot {
182
+ position: sticky;
183
+ inset-block-end: 0;
184
+
185
+ display: flex;
186
+ /* Tab order flows from bottom-up */
187
+ flex-direction: column-reverse;
188
+ }
189
+
190
+ #bottom-fixed {
191
+ position: sticky;
192
+ inset-block-end: 0;
193
+
194
+ display: block;
195
+ grid-area: bottom; /* Takes but does not dictate size of bottom area */
196
+
197
+ pointer-events: none;
198
+
199
+ z-index: 2;
200
+ }
201
+
202
+ #bottom-fixed-slot {
203
+ position: absolute;
204
+ inset-block-end: 100%;
205
+
206
+ display: block;
207
+ }
208
+ `
209
+ .autoRegister('mdw-root');
@@ -0,0 +1,87 @@
1
+ import CustomElement from '../core/CustomElement.js';
2
+
3
+ export default CustomElement
4
+ .extend()
5
+ .observe({
6
+ hidden: 'boolean',
7
+ })
8
+ .html`<div id=scroll-blocker></div>`
9
+ .css`
10
+ :host {
11
+ position: fixed;
12
+ inset: 0;
13
+
14
+ display: block;
15
+ overflow: overlay;
16
+
17
+ overscroll-behavior: none;
18
+ overscroll-behavior: contain;
19
+ scrollbar-color: transparent transparent;
20
+ scrollbar-width: none;
21
+
22
+ cursor:pointer;
23
+
24
+ outline: none; /* Older Chromium Builds */
25
+
26
+ -webkit-tap-highlight-color: transparent;
27
+
28
+ opacity: 0;
29
+
30
+ z-index: 23;
31
+
32
+ background-color: rgb(var(--mdw-color__scrim));
33
+
34
+ animation: fade-in 200ms forwards ease-out;
35
+ will-change: opacity;
36
+ }
37
+
38
+ :host::-webkit-scrollbar {
39
+ display: none;
40
+ }
41
+
42
+ :host([hidden]) {
43
+ animation-name: fade-out;
44
+ animation-timing-function: ease-in;
45
+ }
46
+
47
+ :host([invisible]) {
48
+ background: transparent;
49
+ }
50
+
51
+ #scroll-blocker {
52
+ position: absolute;
53
+ inset-block-start: 0;
54
+ inset-inline-start: 0;
55
+
56
+ display: block;
57
+
58
+ block-size: 200%;
59
+ inline-size: 200%;
60
+ }
61
+
62
+ @keyframes fade-in {
63
+ from {
64
+ opacity: 0;
65
+ }
66
+
67
+ to {
68
+ opacity: 0.38;
69
+ }
70
+ }
71
+
72
+ @keyframes fade-out {
73
+ from {
74
+ opacity: 0.38;
75
+ }
76
+
77
+ to {
78
+ opacity: 0;
79
+ }
80
+ }
81
+ `
82
+ .events({
83
+ animationend() {
84
+ if (this.hidden) this.remove();
85
+ },
86
+ })
87
+ .autoRegister('mdw-scrim');
@@ -0,0 +1,77 @@
1
+ import TopAppBar from './TopAppBar.js';
2
+
3
+ /* @implements {HTMLSelectElement} */
4
+ export default TopAppBar
5
+ .extend()
6
+ .undefine('headline')
7
+ // .undefine('_headlineOpacity')
8
+ .undefine('size')
9
+ .undefine('_headlineStyle')
10
+ .observe({
11
+ placeholder: { type: 'string', empty: 'Search' },
12
+ color: { empty: 'surface-container-high' },
13
+ shapeStyle: { empty: 'full' },
14
+ kbdNav: { empty: 'false' },
15
+ })
16
+ .define({
17
+ /** @return {HTMLInputElement} */
18
+ input() { return this.refs.input; },
19
+ value: {
20
+ get() { return this.refs.input.value; },
21
+ set(value) {
22
+ this.refs.input.value = value;
23
+ },
24
+ },
25
+ })
26
+ .html`
27
+ <mdw-input id=input placeholder={placeholder} aria-label={placeholder}></mdw-input>
28
+ `
29
+ .css`
30
+ :host {
31
+ --mdw-bg: var(--mdw-color__surface-container-high);
32
+ --mdw-shape__size: var(--mdw-shape__full);
33
+ inset-block-start: 8px;
34
+
35
+ display: flex;
36
+ align-items: center;
37
+ gap: 16px;
38
+
39
+ margin-block: 16px;
40
+
41
+ padding-inline: 16px;
42
+
43
+ background-color: rgb(var(--mdw-bg));
44
+ }
45
+
46
+ #leading:not([slotted]),
47
+ #trailing:not([slotted]) {
48
+ display: none;
49
+ }
50
+
51
+ #input {
52
+ --mdw-state__hovered-opacity: 0;
53
+ flex: 1;
54
+ }
55
+ `
56
+ .methods({
57
+ /** @param {{currentTarget:HTMLSlotElement}} event */
58
+ onSlotChange({ currentTarget }) {
59
+ currentTarget.toggleAttribute('slotted', currentTarget.assignedNodes().length >= 0);
60
+ },
61
+ })
62
+ .childEvents({
63
+ leading: { slotchange: 'onSlotChange' },
64
+ trailing: { slotchange: 'onSlotChange' },
65
+ input: {
66
+ change(event) {
67
+ // Change events are not composed. Rethrow.
68
+ event.stopPropagation();
69
+ this.dispatchEvent(new Event('change', { bubbles: true }));
70
+ },
71
+ },
72
+ })
73
+ .recompose(({ refs: { companion, headline, input } }) => {
74
+ companion.remove();
75
+ headline.replaceWith(input);
76
+ })
77
+ .autoRegister('mdw-search');