@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
@@ -0,0 +1,360 @@
1
+ /**
2
+ * @license ISC License
3
+ * Copyright (c) 2019, Mapbox
4
+ *
5
+ * Permission to use, copy, modify, and/or distribute this software for any purpose
6
+ * with or without fee is hereby granted, provided that the above copyright notice
7
+ * and this permission notice appear in all copies.
8
+ *
9
+ * THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
10
+ * REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND
11
+ * FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
12
+ * INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS
13
+ * OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR OTHER
14
+ * TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR PERFORMANCE OF
15
+ * THIS SOFTWARE.
16
+ */
17
+
18
+ /** @enum {Object} */
19
+ const DEFAULT_OPTIONS = {
20
+ /* matching threshold (0 to 1); smaller is more sensitive */
21
+ threshold: 0.1,
22
+ /* whether to skip anti-aliasing detection */
23
+ includeAA: false,
24
+ /** opacity of original image in diff output */
25
+ alpha: 0.1,
26
+ /* color of anti-aliased pixels in diff output */
27
+ aaColor: [255, 255, 0],
28
+ diffColor: [255, 0, 0], // color of different pixels in diff output
29
+ /**
30
+ * whether to detect dark on light differences between img1 and img2 and set
31
+ * an alternative color to differentiate between the two
32
+ * @type {Array<number>}
33
+ */
34
+ diffColorAlt: null,
35
+ /** draw the diff over a transparent background (a mask) */
36
+ diffMask: false,
37
+ };
38
+
39
+ /**
40
+ * @param {ArrayBufferView} arr
41
+ */
42
+ function isPixelData(arr) {
43
+ // work around instanceof Uint8Array not working properly in some Jest environments
44
+ return ArrayBuffer.isView(arr) && arr.constructor.BYTES_PER_ELEMENT === 1;
45
+ }
46
+
47
+ /**
48
+ * Check if a pixel has 3+ adjacent pixels of the same color.
49
+ * @param {Array<number>} img
50
+ * @param {number} x1
51
+ * @param {number} y1
52
+ * @param {number} width
53
+ * @param {number} height
54
+ */
55
+ function hasManySiblings(img, x1, y1, width, height) {
56
+ const x0 = Math.max(x1 - 1, 0);
57
+ const y0 = Math.max(y1 - 1, 0);
58
+ const x2 = Math.min(x1 + 1, width - 1);
59
+ const y2 = Math.min(y1 + 1, height - 1);
60
+ const pos = (y1 * width + x1) * 4;
61
+ let zeroes = x1 === x0 || x1 === x2 || y1 === y0 || y1 === y2 ? 1 : 0;
62
+
63
+ // go through 8 adjacent pixels
64
+ for (let x = x0; x <= x2; x++) {
65
+ for (let y = y0; y <= y2; y++) {
66
+ if (x === x1 && y === y1) continue;
67
+
68
+ const pos2 = 4 * (y * width + x);
69
+ if (img[pos] === img[pos2]
70
+ && img[pos + 1] === img[pos2 + 1]
71
+ && img[pos + 2] === img[pos2 + 2]
72
+ && img[pos + 3] === img[pos2 + 3]) zeroes++;
73
+
74
+ if (zeroes > 2) return true;
75
+ }
76
+ }
77
+
78
+ return false;
79
+ }
80
+
81
+ /**
82
+ * blend semi-transparent color with white
83
+ * @param {number} color
84
+ * @param {number} alpha
85
+ */
86
+ function blend(color, alpha) {
87
+ return 255 + (color - 255) * alpha;
88
+ }
89
+
90
+ /**
91
+ * Returns Y from RGB=>YIQ
92
+ * @param {number} red
93
+ * @param {number} green
94
+ * @param {number} blue
95
+ */
96
+ function yFromRGBToYIQ(red, green, blue) {
97
+ return (0.298_895_31 * red) + (0.586_622_47 * green) + (0.114_482_23 * blue);
98
+ }
99
+
100
+ /**
101
+ * Returns I from RGB=>YIQ
102
+ * @param {number} red
103
+ * @param {number} green
104
+ * @param {number} blue
105
+ */
106
+ function iFromRGBToYIQ(red, green, blue) {
107
+ return (0.595_977_99 * red) + (-0.274_176_1 * green) + (-0.321_801_89 * blue);
108
+ }
109
+
110
+ /**
111
+ * Returns Q from RGB=>YIQ
112
+ * @param {number} red
113
+ * @param {number} green
114
+ * @param {number} blue
115
+ * @return {number}
116
+ */
117
+ function qFromRGBToYIQ(red, green, blue) {
118
+ return (0.211_470_17 * red) + (-0.522_617_11 * green) + (0.311_146_94 * blue);
119
+ }
120
+
121
+ /**
122
+ * Returns YIQ from RGB
123
+ * @param {number} red
124
+ * @param {number} green
125
+ * @param {number} blue
126
+ * @return {{y:number, i:number, q:number}}
127
+ */
128
+ function yiqFromRGB(red, green, blue) {
129
+ return {
130
+ y: yFromRGBToYIQ(red, green, blue),
131
+ i: iFromRGBToYIQ(red, green, blue),
132
+ q: qFromRGBToYIQ(red, green, blue),
133
+ };
134
+ }
135
+
136
+ /**
137
+ * calculate color difference according to the paper "Measuring perceived color
138
+ * difference using YIQ NTSC transmission color space in mobile applications"
139
+ * by Y. Kotsarenko and F. Ramos
140
+ * @param {Array<number>} img1
141
+ * @param {Array<number>} img2
142
+ * @param {number} k
143
+ * @param {number} m
144
+ * @param {boolean} [yOnly]
145
+ * @return {number}
146
+ */
147
+ function colorDelta(img1, img2, k, m, yOnly) {
148
+ let r1 = img1[k + 0];
149
+ let g1 = img1[k + 1];
150
+ let b1 = img1[k + 2];
151
+ let a1 = img1[k + 3];
152
+
153
+ let r2 = img2[m + 0];
154
+ let g2 = img2[m + 1];
155
+ let b2 = img2[m + 2];
156
+ let a2 = img2[m + 3];
157
+
158
+ if (a1 === a2 && r1 === r2 && g1 === g2 && b1 === b2) return 0;
159
+
160
+ if (a1 < 255) {
161
+ a1 /= 255;
162
+ r1 = blend(r1, a1);
163
+ g1 = blend(g1, a1);
164
+ b1 = blend(b1, a1);
165
+ }
166
+
167
+ if (a2 < 255) {
168
+ a2 /= 255;
169
+ r2 = blend(r2, a2);
170
+ g2 = blend(g2, a2);
171
+ b2 = blend(b2, a2);
172
+ }
173
+
174
+ if (yOnly) {
175
+ return yFromRGBToYIQ(r1, g1, b1) - yFromRGBToYIQ(r2, g2, b2);
176
+ }
177
+
178
+ const { y: y1, i: i1, q: q1 } = yiqFromRGB(r1, g1, b1);
179
+ const { y: y2, i: i2, q: q2 } = yiqFromRGB(r2, g2, b2);
180
+
181
+ const y = y1 - y2;
182
+ const i = i1 - i2;
183
+ const q = q1 - q2;
184
+
185
+ const delta = (0.5053 * y * y) + (0.299 * i * i) + (0.1957 * q * q);
186
+
187
+ // encode whether the pixel lightens or darkens in the sign
188
+ return y1 > y2 ? -delta : delta;
189
+ }
190
+
191
+ /**
192
+ * @param {Uint8Array|Uint8ClampedArray} destination
193
+ * @param {number} index
194
+ * @param {number} red
195
+ * @param {number} green
196
+ * @param {number} blue
197
+ * @return {void}
198
+ */
199
+ function drawPixel(destination, index, red, green, blue) {
200
+ destination[index + 0] = red;
201
+ destination[index + 1] = green;
202
+ destination[index + 2] = blue;
203
+ destination[index + 3] = 255;
204
+ }
205
+
206
+ /**
207
+ * @param {Uint8Array|Uint8ClampedArray} source
208
+ * @param {number} index
209
+ * @param {number} alpha
210
+ * @param {Uint8Array|Uint8ClampedArray} destination
211
+ */
212
+ function drawGrayPixel(source, index, alpha, destination) {
213
+ const red = source[index + 0];
214
+ const green = source[index + 1];
215
+ const blue = source[index + 2];
216
+ const val = blend(yFromRGBToYIQ(red, green, blue), (alpha * source[index + 3]) / 255);
217
+ drawPixel(destination, index, val, val, val);
218
+ }
219
+
220
+ /**
221
+ * Check if a pixel is likely a part of anti-aliasing;
222
+ *
223
+ * Based on "Anti-aliased Pixel and Intensity Slope Detector" paper by V.
224
+ * Vysniauskas, 2009
225
+ * @param {Array<number>} img
226
+ * @param {number} x1
227
+ * @param {number} y1
228
+ * @param {number} width
229
+ * @param {number} height
230
+ * @param {Array<number>} img2
231
+ */
232
+ function antialiased(img, x1, y1, width, height, img2) {
233
+ const x0 = Math.max(x1 - 1, 0);
234
+ const y0 = Math.max(y1 - 1, 0);
235
+ const x2 = Math.min(x1 + 1, width - 1);
236
+ const y2 = Math.min(y1 + 1, height - 1);
237
+ const pos = (y1 * width + x1) * 4;
238
+ let zeroes = x1 === x0 || x1 === x2 || y1 === y0 || y1 === y2 ? 1 : 0;
239
+ let min = 0;
240
+ let max = 0;
241
+ let minX; let minY; let maxX; let
242
+ maxY;
243
+
244
+ // go through 8 adjacent pixels
245
+ for (let x = x0; x <= x2; x++) {
246
+ for (let y = y0; y <= y2; y++) {
247
+ if (x === x1 && y === y1) continue;
248
+
249
+ // brightness delta between the center pixel and adjacent one
250
+ const delta = colorDelta(img, img, pos, (y * width + x) * 4, true);
251
+
252
+ // count the number of equal, darker and brighter adjacent pixels
253
+ if (delta === 0) {
254
+ zeroes++;
255
+ // if found more than 2 equal siblings, it's definitely not anti-aliasing
256
+ if (zeroes > 2) return false;
257
+
258
+ // remember the darkest pixel
259
+ } else if (delta < min) {
260
+ min = delta;
261
+ minX = x;
262
+ minY = y;
263
+
264
+ // remember the brightest pixel
265
+ } else if (delta > max) {
266
+ max = delta;
267
+ maxX = x;
268
+ maxY = y;
269
+ }
270
+ }
271
+ }
272
+
273
+ // if there are no both darker and brighter pixels among siblings, it's not anti-aliasing
274
+ if (min === 0 || max === 0) return false;
275
+
276
+ // if either the darkest or the brightest pixel has 3+ equal siblings in both images
277
+ // (definitely not anti-aliased), this pixel is anti-aliased
278
+ return (hasManySiblings(img, minX, minY, width, height)
279
+ && hasManySiblings(img2, minX, minY, width, height))
280
+ || (hasManySiblings(img, maxX, maxY, width, height)
281
+ && hasManySiblings(img2, maxX, maxY, width, height));
282
+ }
283
+
284
+ /**
285
+ * @param {Uint8Array|Uint8ClampedArray} img1
286
+ * @param {Uint8Array|Uint8ClampedArray} img2
287
+ * @param {Uint8Array|Uint8ClampedArray} output
288
+ * @param {number} width
289
+ * @param {number} height
290
+ * @param {typeof DEFAULT_OPTIONS} [options]
291
+ * @return {number}
292
+ */
293
+ export function pixelmatch(img1, img2, output, width, height, options) {
294
+ if (!isPixelData(img1) || !isPixelData(img2) || (output && !isPixelData(output))) {
295
+ throw new Error('Image data: Uint8Array, Uint8ClampedArray or Buffer expected.');
296
+ }
297
+
298
+ if (img1.length !== img2.length || (output && output.length !== img1.length)) {
299
+ // throw new Error('Image sizes do not match.');
300
+ return Number.POSITIVE_INFINITY;
301
+ }
302
+
303
+ if (img1.length !== width * height * 4) {
304
+ // throw new Error('Image data size does not match width/height.');
305
+ return Number.POSITIVE_INFINITY;
306
+ }
307
+ options = { ...DEFAULT_OPTIONS, ...options };
308
+
309
+ // check if images are identical
310
+ const len = width * height;
311
+ const a32 = new Uint32Array(img1.buffer, img1.byteOffset, len);
312
+ const b32 = new Uint32Array(img2.buffer, img2.byteOffset, len);
313
+ let identical = true;
314
+
315
+ for (let i = 0; i < len; i++) {
316
+ if (a32[i] !== b32[i]) { identical = false; break; }
317
+ }
318
+ if (identical) { // fast path if identical
319
+ if (output && !options.diffMask) {
320
+ for (let i = 0; i < len; i++) drawGrayPixel(img1, 4 * i, options.alpha, output);
321
+ }
322
+ return 0;
323
+ }
324
+
325
+ // maximum acceptable square distance between two colors;
326
+ // 35215 is the maximum possible value for the YIQ difference metric
327
+ const maxDelta = 35_215 * options.threshold * options.threshold;
328
+ let diff = 0;
329
+
330
+ // compare each pixel of one image against the other one
331
+ for (let y = 0; y < height; y++) {
332
+ for (let x = 0; x < width; x++) {
333
+ const pos = (y * width + x) * 4;
334
+
335
+ // squared YUV distance between colors at this pixel position, negative if the img2 pixel is darker
336
+ const delta = colorDelta(img1, img2, pos, pos);
337
+
338
+ // the color difference is above the threshold
339
+ if (Math.abs(delta) > maxDelta) {
340
+ // check it's a real rendering difference or just anti-aliasing
341
+ if (!options.includeAA && (antialiased(img1, x, y, width, height, img2)
342
+ || antialiased(img2, x, y, width, height, img1))) {
343
+ // one of the pixels is anti-aliasing; draw as yellow and do not count as difference
344
+ // note that we do not include such pixels in a mask
345
+ if (output && !options.diffMask) drawPixel(output, pos, ...options.aaColor);
346
+ } else {
347
+ // found substantial difference not caused by anti-aliasing; draw it as such
348
+ if (output) {
349
+ drawPixel(output, pos, ...(delta < 0 && (options.diffColorAlt || options.diffColor)));
350
+ }
351
+ diff++;
352
+ }
353
+ } else if (output // pixels are similar; draw background as grayscale image blended with white
354
+ && !options.diffMask) drawGrayPixel(img1, pos, options.alpha, output);
355
+ }
356
+ }
357
+
358
+ // return the number of different pixels
359
+ return diff;
360
+ }
package/utils/popup.js CHANGED
@@ -1,11 +1,21 @@
1
+ /**
2
+ * @typedef {Object} DOMRectLike
3
+ * @prop {number} left
4
+ * @prop {number} right
5
+ * @prop {number} top
6
+ * @prop {number} bottom
7
+ * @prop {number} width
8
+ * @prop {number} height
9
+ */
10
+
1
11
  /**
2
12
  * @typedef {Object} CanAnchorPopUpOptions
3
- * @prop {Element|DOMRect} [anchor]
13
+ * @prop {Element|DOMRectLike} [anchor]
4
14
  * @prop {number|'left'|'center'|'right'} [clientX]
5
15
  * @prop {number|'top'|'center'|'bottom'} [clientY]
6
16
  * @prop {number} [pageX]
7
17
  * @prop {number} [pageY]
8
- * @prop {Element|DOMRect} [popup]
18
+ * @prop {Element|{width:number, height:number}} [popup]
9
19
  * @prop {number} [width]
10
20
  * @prop {number} [height]
11
21
  * @prop {number} [offsetX] Offset from anchor
@@ -19,9 +29,24 @@
19
29
  /** @param {CanAnchorPopUpOptions} options */
20
30
  export function canAnchorPopup(options) {
21
31
  let { pageX, pageY, directionX, directionY } = options;
32
+ const pageWidth = document.documentElement.clientWidth;
33
+ const pageHeight = document.documentElement.clientHeight;
22
34
  if (pageX == null || pageY == null) {
23
35
  const { clientX, clientY, anchor } = options;
24
- const rect = anchor instanceof Element ? anchor.getBoundingClientRect() : anchor;
36
+ let rect;
37
+ if (anchor) {
38
+ rect = anchor instanceof Element ? anchor.getBoundingClientRect() : anchor;
39
+ } else {
40
+ rect = {
41
+ left: 0,
42
+ width: pageWidth,
43
+ right: pageWidth,
44
+ top: 0,
45
+ bottom: pageHeight,
46
+ height: pageHeight,
47
+ };
48
+ }
49
+
25
50
  if (pageX == null) {
26
51
  switch (clientX) {
27
52
  case 'left':
@@ -63,6 +88,7 @@ export function canAnchorPopup(options) {
63
88
  }
64
89
  }
65
90
  }
91
+
66
92
  let { width, height } = options;
67
93
  if (width == null || height == null) {
68
94
  const { popup } = options;
@@ -71,47 +97,118 @@ export function canAnchorPopup(options) {
71
97
  height = popup.clientHeight;
72
98
  } else {
73
99
  width = popup.width;
74
- height = popup.width;
100
+ height = popup.height;
75
101
  }
76
102
  }
77
103
 
78
- // eslint-disable-next-line default-case
79
- switch (directionX) {
80
- case 'left':
81
- pageX -= width;
82
- break;
83
- case 'center':
84
- pageX -= width / 2;
104
+ let top;
105
+ let right;
106
+ let bottom;
107
+ let left;
108
+ const margin = options.margin ?? 0;
109
+
110
+ let pageTop = margin;
111
+ let pageBottom = -margin;
112
+ let pageLeft = margin;
113
+ let pageRight = -margin;
114
+
115
+ if (window.visualViewport) {
116
+ pageTop += window.visualViewport.offsetTop;
117
+ pageBottom += window.visualViewport.offsetTop + window.visualViewport.height;
118
+ pageLeft += window.visualViewport.offsetLeft;
119
+ pageRight += window.visualViewport.offsetLeft + window.visualViewport.width;
120
+ } else {
121
+ pageBottom += pageHeight;
122
+ pageRight += pageWidth;
85
123
  }
86
124
 
87
- // eslint-disable-next-line default-case
125
+ const offsetX = options.offsetX ?? 0;
126
+ const offsetY = options.offsetY ?? 0;
127
+ pageX += offsetX;
128
+ pageY += offsetY;
129
+
130
+ let cssTop = 'auto';
131
+ let cssRight = 'auto';
132
+ let cssBottom = 'auto';
133
+ let cssLeft = 'auto';
134
+ let maxHeight = null;
135
+ let maxWidth = null;
136
+
88
137
  switch (directionY) {
89
138
  case 'up':
90
- pageY -= height;
139
+ bottom = Math.min(pageY, pageBottom);
140
+ top = Math.max(bottom - height, pageTop);
141
+ cssBottom = `${pageHeight - bottom}px`;
142
+ if (top === pageTop) {
143
+ maxHeight = `${bottom - pageTop}px`;
144
+ }
91
145
  break;
92
146
  case 'center':
93
- pageY -= height / 2;
147
+ top = Math.max(pageY - height / 2, pageTop);
148
+ bottom = Math.min(pageY + height / 2, pageBottom);
149
+ cssTop = `${top}px`;
150
+ if (bottom === pageBottom) {
151
+ maxHeight = `${pageBottom - pageTop}px`;
152
+ }
153
+ break;
154
+ default:
155
+ top = Math.max(pageY, pageTop);
156
+ bottom = Math.min(top + height, pageBottom);
157
+ cssTop = `${top}px`;
158
+ if (bottom === pageBottom) {
159
+ maxHeight = `${pageBottom - top}px`;
160
+ }
94
161
  }
95
162
 
96
- const offsetX = options.offsetX ?? 0;
97
- const offsetY = options.offsetY ?? 0;
98
- pageX += offsetX;
99
- pageY += offsetY;
100
- const margin = options.margin ?? 0;
101
- if (!options.force) {
102
- if (pageX - margin < 0) return null;
103
- if (pageY - margin < 0) return null;
104
- if (pageX + width > (document.documentElement.clientWidth - margin)) return null;
105
- if (pageY + height > (document.documentElement.clientHeight - margin)) return null;
163
+ switch (directionX) {
164
+ case 'left':
165
+ right = Math.min(pageX, pageRight);
166
+ left = Math.max(right - width, pageLeft);
167
+ cssRight = `${pageWidth - right}px`;
168
+ if (left === pageLeft) {
169
+ maxWidth = `${right - pageLeft}px`;
170
+ }
171
+ break;
172
+ case 'center':
173
+ left = Math.max(pageX - width / 2, pageLeft);
174
+ right = Math.min(pageX + width / 2, pageRight);
175
+ cssLeft = `${left}px`;
176
+ if (right === pageRight) {
177
+ maxWidth = `${pageRight - pageLeft}px`;
178
+ }
179
+ break;
180
+ default:
181
+ left = Math.max(pageX, pageLeft);
182
+ right = Math.min(left + width, pageRight);
183
+ cssLeft = `${left}px`;
184
+ if (right === pageRight) {
185
+ maxWidth = `${pageRight - left}px`;
186
+ }
106
187
  }
107
188
 
189
+ // compute area
190
+ const fullSize = width * height;
191
+ const realSize = (bottom - top) * (right - left);
192
+
193
+ const visibility = realSize / fullSize;
194
+
195
+ const transformOriginX = directionX === 'center' ? 'center' : (directionX === 'left' ? 'right' : 'left');
196
+ const transformOriginY = directionY === 'center' ? 'center' : (directionY === 'up' ? 'bottom' : 'top');
108
197
  return {
109
198
  ...options,
110
- offsetX,
111
- offsetY,
112
- pageX,
113
- pageY,
114
- transformOriginX: directionX === 'center' ? 'center' : (directionX === 'left' ? 'right' : 'left'),
115
- transformOriginY: directionY === 'center' ? 'center' : (directionY === 'up' ? 'bottom' : 'top'),
199
+ top,
200
+ right,
201
+ bottom,
202
+ left,
203
+ visibility,
204
+ styles: {
205
+ top: cssTop,
206
+ bottom: cssBottom,
207
+ left: cssLeft,
208
+ right: cssRight,
209
+ maxWidth,
210
+ maxHeight,
211
+ transformOrigin: `${transformOriginY} ${transformOriginX}`,
212
+ },
116
213
  };
117
214
  }
@@ -0,0 +1,19 @@
1
+ /** @type {URLSearchParams} */
2
+ let currentSearchParams = null;
3
+
4
+ /** @return {URLSearchParams} */
5
+ export function getCurrentSearchParams() {
6
+ if (!currentSearchParams) {
7
+ let url;
8
+ try {
9
+ url = import.meta.url;
10
+ } catch {}
11
+ if (!url) {
12
+ try {
13
+ url = /** @type {HTMLScriptElement} */ (document.currentScript).src;
14
+ } catch {}
15
+ }
16
+ currentSearchParams = new URL(url).searchParams;
17
+ }
18
+ return currentSearchParams;
19
+ }
@@ -1,36 +0,0 @@
1
- import Button from './Button.js';
2
-
3
- export default Button
4
- .extend()
5
- .css`
6
- /* https://m3.material.io/components/extended-fab/specs */
7
-
8
- :host {
9
- --mdw-bg: var(--mdw-color__primary-container);
10
- --mdw-ink: var(--mdw-color__on-primary-container);
11
- --mdw-shape__size: 16px;
12
- --mdw-surface__tint: var(--mdw-surface__tint__3);
13
- --mdw-surface__tint__raised: var(--mdw-surface__tint__4);
14
- --mdw-surface__shadow__resting: var(--mdw-surface__shadow__3);
15
- --mdw-surface__shadow__raised: var(--mdw-surface__shadow__4);
16
- min-inline-size: 48px;
17
- padding: calc(16px + (var(--mdw-density) * 2px));
18
- }
19
-
20
- #icon {
21
- font-size: 24px;
22
- }
23
-
24
- :host([lowered]) {
25
- --mdw-surface__tint: var(--mdw-surface__tint__1);
26
- --mdw-surface__tint__raised: var(--mdw-surface__tint__2);
27
- --mdw-surface__shadow__resting: var(--mdw-surface__shadow__1);
28
- --mdw-surface__shadow__raised: var(--mdw-surface__shadow__2);
29
- }
30
-
31
- `
32
- .observe({
33
- filled: { empty: 'tonal' },
34
- elevated: { type: 'boolean', empty: true },
35
- })
36
- .autoRegister('mdw-extended-fab');
@@ -1,35 +0,0 @@
1
- import CustomElement from '../core/CustomElement.js';
2
-
3
- export default CustomElement
4
- .extend()
5
- .html/* html */`
6
- <slot id=slot-top name=top></slot>
7
- <slot id=slot></slot>
8
- `
9
- .css`
10
- /* https://m3.material.io/foundations/layout/applying-layout/window-size-classes */
11
-
12
- :host {
13
- display: block;
14
-
15
- /* QOL */
16
- font: var(--mdw-typescale__body-large__font);
17
- letter-spacing: var(--mdw-typescale__body-large__letter-spacing);
18
-
19
- }
20
-
21
- /* Pane Slot */
22
- #slot {
23
- display: flex;
24
- gap: 24px;
25
-
26
- justify-content: center;
27
-
28
- padding-inline: 16px;
29
-
30
- transition: padding-inline 100ms;
31
- }
32
-
33
- @media screen and (min-width: 648px) { #slot { padding-inline: 24px; } }
34
- `
35
- .autoRegister('mdw-layout');