@shortfuse/materialdesignweb 0.8.0 → 0.9.1

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 (405) hide show
  1. package/README.md +50 -198
  2. package/bin/mdw-css.js +1 -1
  3. package/components/Badge.js +15 -5
  4. package/components/Body.js +7 -0
  5. package/components/BottomAppBar.js +7 -10
  6. package/components/BottomSheet.js +472 -0
  7. package/components/Box.js +11 -49
  8. package/components/Button.js +81 -82
  9. package/components/Card.js +74 -62
  10. package/components/Checkbox.js +15 -25
  11. package/components/CheckboxIcon.js +19 -31
  12. package/components/Chip.js +18 -13
  13. package/components/Dialog.js +70 -100
  14. package/components/DialogActions.js +4 -0
  15. package/components/Display.js +64 -0
  16. package/components/Divider.js +5 -0
  17. package/components/Fab.js +94 -17
  18. package/components/FabContainer.js +57 -0
  19. package/components/FilterChip.js +43 -32
  20. package/components/Grid.js +187 -0
  21. package/components/Headline.js +9 -28
  22. package/components/Icon.js +80 -71
  23. package/components/IconButton.js +77 -120
  24. package/components/Input.js +745 -86
  25. package/components/InputChip.js +193 -0
  26. package/components/Label.js +7 -0
  27. package/components/List.js +11 -5
  28. package/components/ListItem.js +92 -23
  29. package/components/ListOption.js +143 -65
  30. package/components/Listbox.js +57 -17
  31. package/components/Menu.js +39 -27
  32. package/components/MenuItem.js +49 -36
  33. package/components/NavBar.js +66 -21
  34. package/components/NavBarItem.js +5 -0
  35. package/components/NavDrawer.js +33 -16
  36. package/components/NavDrawerItem.js +7 -4
  37. package/components/NavItem.js +61 -34
  38. package/components/NavRail.js +32 -21
  39. package/components/NavRailItem.js +10 -2
  40. package/components/Page.js +119 -0
  41. package/components/Pane.js +24 -0
  42. package/components/Popup.js +23 -8
  43. package/components/Progress.js +25 -5
  44. package/components/Radio.js +8 -7
  45. package/components/RadioIcon.js +24 -15
  46. package/components/Ripple.js +25 -7
  47. package/components/Root.js +225 -0
  48. package/components/Scrim.js +95 -0
  49. package/components/Search.js +30 -25
  50. package/components/SegmentedButton.js +53 -40
  51. package/components/SegmentedButtonGroup.js +15 -12
  52. package/components/Select.js +19 -10
  53. package/components/Shape.js +10 -66
  54. package/components/SideSheet.js +337 -0
  55. package/components/Slider.js +93 -36
  56. package/components/Snackbar.js +52 -20
  57. package/components/SnackbarContainer.js +51 -0
  58. package/components/Surface.js +20 -10
  59. package/components/Switch.js +21 -18
  60. package/components/SwitchIcon.js +62 -33
  61. package/components/Tab.js +78 -38
  62. package/components/TabContent.js +33 -12
  63. package/components/TabList.js +95 -34
  64. package/components/TabPanel.js +10 -1
  65. package/components/Table.js +151 -0
  66. package/components/TextArea.js +48 -16
  67. package/components/Title.js +8 -9
  68. package/components/Tooltip.js +51 -22
  69. package/components/TopAppBar.js +71 -78
  70. package/constants/shapes.js +36 -0
  71. package/constants/typography.js +127 -0
  72. package/core/Composition.js +391 -201
  73. package/core/CompositionAdapter.js +35 -18
  74. package/core/CustomElement.js +634 -254
  75. package/core/css.js +117 -12
  76. package/core/customTypes.js +161 -49
  77. package/core/dom.js +18 -11
  78. package/core/jsonMergePatch.js +27 -11
  79. package/core/observe.js +308 -256
  80. package/core/optimizations.js +9 -9
  81. package/core/template.js +14 -57
  82. package/dist/CustomElement.min.js +2 -0
  83. package/dist/CustomElement.min.js.map +7 -0
  84. package/dist/core/CustomElement.min.js +2 -0
  85. package/dist/core/CustomElement.min.js.map +7 -0
  86. package/dist/index.min.js +85 -115
  87. package/dist/index.min.js.map +4 -4
  88. package/dist/meta.json +1 -1
  89. package/dom/HTMLOptionsCollectionProxy.js +108 -0
  90. package/{theming/themableMixinLoader.js → loaders/palette.js} +4 -3
  91. package/loaders/theme.js +12 -0
  92. package/mixins/AriaReflectorMixin.js +64 -15
  93. package/mixins/AriaToolbarMixin.js +6 -0
  94. package/mixins/ControlMixin.js +79 -33
  95. package/mixins/DelegatesFocusMixin.js +62 -0
  96. package/mixins/DensityMixin.js +7 -3
  97. package/mixins/ElevationMixin.js +61 -0
  98. package/mixins/FlexableMixin.js +87 -39
  99. package/mixins/FormAssociatedMixin.js +76 -10
  100. package/mixins/HyperlinkMixin.js +76 -0
  101. package/mixins/InputMixin.js +227 -32
  102. package/mixins/KeyboardNavMixin.js +11 -7
  103. package/mixins/NavigationListenerMixin.js +33 -0
  104. package/mixins/PopupMixin.js +216 -219
  105. package/mixins/RTLObserverMixin.js +2 -0
  106. package/mixins/ResizeObserverMixin.js +18 -4
  107. package/mixins/RippleMixin.js +11 -7
  108. package/mixins/ScrollListenerMixin.js +14 -2
  109. package/mixins/SemiStickyMixin.js +51 -98
  110. package/mixins/ShapeMaskedMixin.js +125 -0
  111. package/mixins/ShapeMixin.js +30 -203
  112. package/mixins/StateMixin.js +74 -34
  113. package/mixins/TextFieldMixin.js +128 -145
  114. package/mixins/ThemableMixin.js +57 -56
  115. package/mixins/TooltipTriggerMixin.js +305 -359
  116. package/mixins/TouchTargetMixin.js +5 -2
  117. package/mixins/TypographyMixin.js +128 -0
  118. package/package.json +125 -81
  119. package/services/rtl.js +10 -0
  120. package/services/svgAlias.js +17 -0
  121. package/{theming/index.js → services/theme.js} +25 -176
  122. package/types/bin/mdw-css.d.ts +3 -0
  123. package/types/bin/mdw-css.d.ts.map +1 -0
  124. package/types/components/Badge.d.ts +39 -0
  125. package/types/components/Badge.d.ts.map +1 -0
  126. package/types/components/Body.d.ts +29 -0
  127. package/types/components/Body.d.ts.map +1 -0
  128. package/types/components/BottomAppBar.d.ts +72 -0
  129. package/types/components/BottomAppBar.d.ts.map +1 -0
  130. package/types/components/BottomSheet.d.ts +135 -0
  131. package/types/components/BottomSheet.d.ts.map +1 -0
  132. package/types/components/Box.d.ts +16 -0
  133. package/types/components/Box.d.ts.map +1 -0
  134. package/types/components/Button.d.ts +245 -0
  135. package/types/components/Button.d.ts.map +1 -0
  136. package/types/components/Card.d.ts +147 -0
  137. package/types/components/Card.d.ts.map +1 -0
  138. package/types/components/Checkbox.d.ts +207 -0
  139. package/types/components/Checkbox.d.ts.map +1 -0
  140. package/types/components/CheckboxIcon.d.ts +44 -0
  141. package/types/components/CheckboxIcon.d.ts.map +1 -0
  142. package/types/components/Chip.d.ts +248 -0
  143. package/types/components/Chip.d.ts.map +1 -0
  144. package/types/components/Dialog.d.ts +103 -0
  145. package/types/components/Dialog.d.ts.map +1 -0
  146. package/types/components/DialogActions.d.ts +4 -0
  147. package/types/components/DialogActions.d.ts.map +1 -0
  148. package/types/components/Display.d.ts +46 -0
  149. package/types/components/Display.d.ts.map +1 -0
  150. package/types/components/Divider.d.ts +10 -0
  151. package/types/components/Divider.d.ts.map +1 -0
  152. package/types/components/Fab.d.ts +273 -0
  153. package/types/components/Fab.d.ts.map +1 -0
  154. package/types/components/FabContainer.d.ts +10 -0
  155. package/types/components/FabContainer.d.ts.map +1 -0
  156. package/types/components/FilterChip.d.ts +256 -0
  157. package/types/components/FilterChip.d.ts.map +1 -0
  158. package/types/components/Grid.d.ts +38 -0
  159. package/types/components/Grid.d.ts.map +1 -0
  160. package/types/components/Headline.d.ts +46 -0
  161. package/types/components/Headline.d.ts.map +1 -0
  162. package/types/components/Icon.d.ts +55 -0
  163. package/types/components/Icon.d.ts.map +1 -0
  164. package/types/components/IconButton.d.ts +284 -0
  165. package/types/components/IconButton.d.ts.map +1 -0
  166. package/types/components/Input.d.ts +2528 -0
  167. package/types/components/Input.d.ts.map +1 -0
  168. package/types/components/InputChip.d.ts +85 -0
  169. package/types/components/InputChip.d.ts.map +1 -0
  170. package/types/components/Label.d.ts +29 -0
  171. package/types/components/Label.d.ts.map +1 -0
  172. package/types/components/List.d.ts +35 -0
  173. package/types/components/List.d.ts.map +1 -0
  174. package/types/components/ListItem.d.ts +124 -0
  175. package/types/components/ListItem.d.ts.map +1 -0
  176. package/types/components/ListOption.d.ts +158 -0
  177. package/types/components/ListOption.d.ts.map +1 -0
  178. package/types/components/Listbox.d.ts +763 -0
  179. package/types/components/Listbox.d.ts.map +1 -0
  180. package/types/components/Menu.d.ts +130 -0
  181. package/types/components/Menu.d.ts.map +1 -0
  182. package/types/components/MenuItem.d.ts +232 -0
  183. package/types/components/MenuItem.d.ts.map +1 -0
  184. package/types/components/NavBar.d.ts +20 -0
  185. package/types/components/NavBar.d.ts.map +1 -0
  186. package/types/components/NavBarItem.d.ts +97 -0
  187. package/types/components/NavBarItem.d.ts.map +1 -0
  188. package/types/components/NavDrawer.d.ts +107 -0
  189. package/types/components/NavDrawer.d.ts.map +1 -0
  190. package/types/components/NavDrawerItem.d.ts +97 -0
  191. package/types/components/NavDrawerItem.d.ts.map +1 -0
  192. package/types/components/NavItem.d.ts +99 -0
  193. package/types/components/NavItem.d.ts.map +1 -0
  194. package/types/components/NavRail.d.ts +108 -0
  195. package/types/components/NavRail.d.ts.map +1 -0
  196. package/types/components/NavRailItem.d.ts +97 -0
  197. package/types/components/NavRailItem.d.ts.map +1 -0
  198. package/types/components/Page.d.ts +25 -0
  199. package/types/components/Page.d.ts.map +1 -0
  200. package/types/components/Pane.d.ts +44 -0
  201. package/types/components/Pane.d.ts.map +1 -0
  202. package/types/components/Popup.d.ts +78 -0
  203. package/types/components/Popup.d.ts.map +1 -0
  204. package/types/components/Progress.d.ts +21 -0
  205. package/types/components/Progress.d.ts.map +1 -0
  206. package/types/components/Radio.d.ts +201 -0
  207. package/types/components/Radio.d.ts.map +1 -0
  208. package/types/components/RadioIcon.d.ts +46 -0
  209. package/types/components/RadioIcon.d.ts.map +1 -0
  210. package/types/components/Ripple.d.ts +35 -0
  211. package/types/components/Ripple.d.ts.map +1 -0
  212. package/types/components/Root.d.ts +68 -0
  213. package/types/components/Root.d.ts.map +1 -0
  214. package/types/components/Scrim.d.ts +6 -0
  215. package/types/components/Scrim.d.ts.map +1 -0
  216. package/types/components/Search.d.ts +516 -0
  217. package/types/components/Search.d.ts.map +1 -0
  218. package/types/components/SegmentedButton.d.ts +252 -0
  219. package/types/components/SegmentedButton.d.ts.map +1 -0
  220. package/types/components/SegmentedButtonGroup.d.ts +43 -0
  221. package/types/components/SegmentedButtonGroup.d.ts.map +1 -0
  222. package/types/components/Select.d.ts +158 -0
  223. package/types/components/Select.d.ts.map +1 -0
  224. package/types/components/Shape.d.ts +10 -0
  225. package/types/components/Shape.d.ts.map +1 -0
  226. package/types/components/SideSheet.d.ts +111 -0
  227. package/types/components/SideSheet.d.ts.map +1 -0
  228. package/types/components/Slider.d.ts +203 -0
  229. package/types/components/Slider.d.ts.map +1 -0
  230. package/types/components/Snackbar.d.ts +73 -0
  231. package/types/components/Snackbar.d.ts.map +1 -0
  232. package/types/components/SnackbarContainer.d.ts +6 -0
  233. package/types/components/SnackbarContainer.d.ts.map +1 -0
  234. package/types/components/Surface.d.ts +45 -0
  235. package/types/components/Surface.d.ts.map +1 -0
  236. package/types/components/Switch.d.ts +187 -0
  237. package/types/components/Switch.d.ts.map +1 -0
  238. package/types/components/SwitchIcon.d.ts +61 -0
  239. package/types/components/SwitchIcon.d.ts.map +1 -0
  240. package/types/components/Tab.d.ts +139 -0
  241. package/types/components/Tab.d.ts.map +1 -0
  242. package/types/components/TabContent.d.ts +124 -0
  243. package/types/components/TabContent.d.ts.map +1 -0
  244. package/types/components/TabList.d.ts +1111 -0
  245. package/types/components/TabList.d.ts.map +1 -0
  246. package/types/components/TabPanel.d.ts +28 -0
  247. package/types/components/TabPanel.d.ts.map +1 -0
  248. package/types/components/Table.d.ts +25 -0
  249. package/types/components/Table.d.ts.map +1 -0
  250. package/types/components/TextArea.d.ts +201 -0
  251. package/types/components/TextArea.d.ts.map +1 -0
  252. package/types/components/Title.d.ts +46 -0
  253. package/types/components/Title.d.ts.map +1 -0
  254. package/types/components/Tooltip.d.ts +49 -0
  255. package/types/components/Tooltip.d.ts.map +1 -0
  256. package/types/components/TopAppBar.d.ts +129 -0
  257. package/types/components/TopAppBar.d.ts.map +1 -0
  258. package/types/constants/colorKeywords.d.ts +2 -0
  259. package/types/constants/colorKeywords.d.ts.map +1 -0
  260. package/types/constants/shapes.d.ts +38 -0
  261. package/types/constants/shapes.d.ts.map +1 -0
  262. package/types/constants/typography.d.ts +212 -0
  263. package/types/constants/typography.d.ts.map +1 -0
  264. package/types/core/Composition.d.ts +260 -0
  265. package/types/core/Composition.d.ts.map +1 -0
  266. package/types/core/CompositionAdapter.d.ts +114 -0
  267. package/types/core/CompositionAdapter.d.ts.map +1 -0
  268. package/types/core/CustomElement.d.ts +304 -0
  269. package/types/core/CustomElement.d.ts.map +1 -0
  270. package/types/core/css.d.ts +44 -0
  271. package/types/core/css.d.ts.map +1 -0
  272. package/types/core/customTypes.d.ts +22 -0
  273. package/types/core/customTypes.d.ts.map +1 -0
  274. package/types/core/dom.d.ts +32 -0
  275. package/types/core/dom.d.ts.map +1 -0
  276. package/types/core/jsonMergePatch.d.ts +31 -0
  277. package/types/core/jsonMergePatch.d.ts.map +1 -0
  278. package/types/core/observe.d.ts +114 -0
  279. package/types/core/observe.d.ts.map +1 -0
  280. package/types/core/optimizations.d.ts +7 -0
  281. package/types/core/optimizations.d.ts.map +1 -0
  282. package/types/core/template.d.ts +47 -0
  283. package/types/core/template.d.ts.map +1 -0
  284. package/types/core/uid.d.ts +6 -0
  285. package/types/core/uid.d.ts.map +1 -0
  286. package/types/dom/HTMLOptionsCollectionProxy.d.ts +18 -0
  287. package/types/dom/HTMLOptionsCollectionProxy.d.ts.map +1 -0
  288. package/types/index.d.ts +88 -0
  289. package/types/index.d.ts.map +1 -0
  290. package/types/loaders/palette.d.ts +2 -0
  291. package/types/loaders/palette.d.ts.map +1 -0
  292. package/types/loaders/theme.d.ts +2 -0
  293. package/types/loaders/theme.d.ts.map +1 -0
  294. package/types/mixins/AriaReflectorMixin.d.ts +31 -0
  295. package/types/mixins/AriaReflectorMixin.d.ts.map +1 -0
  296. package/types/mixins/AriaToolbarMixin.d.ts +34 -0
  297. package/types/mixins/AriaToolbarMixin.d.ts.map +1 -0
  298. package/types/mixins/ControlMixin.d.ts +124 -0
  299. package/types/mixins/ControlMixin.d.ts.map +1 -0
  300. package/types/mixins/DelegatesFocusMixin.d.ts +13 -0
  301. package/types/mixins/DelegatesFocusMixin.d.ts.map +1 -0
  302. package/types/mixins/DensityMixin.d.ts +8 -0
  303. package/types/mixins/DensityMixin.d.ts.map +1 -0
  304. package/types/mixins/ElevationMixin.d.ts +32 -0
  305. package/types/mixins/ElevationMixin.d.ts.map +1 -0
  306. package/types/mixins/FlexableMixin.d.ts +14 -0
  307. package/types/mixins/FlexableMixin.d.ts.map +1 -0
  308. package/types/mixins/FormAssociatedMixin.d.ts +123 -0
  309. package/types/mixins/FormAssociatedMixin.d.ts.map +1 -0
  310. package/types/mixins/HyperlinkMixin.d.ts +25 -0
  311. package/types/mixins/HyperlinkMixin.d.ts.map +1 -0
  312. package/types/mixins/InputMixin.d.ts +173 -0
  313. package/types/mixins/InputMixin.d.ts.map +1 -0
  314. package/types/mixins/KeyboardNavMixin.d.ts +46 -0
  315. package/types/mixins/KeyboardNavMixin.d.ts.map +1 -0
  316. package/types/mixins/NavigationListenerMixin.d.ts +8 -0
  317. package/types/mixins/NavigationListenerMixin.d.ts.map +1 -0
  318. package/types/mixins/PopupMixin.d.ts +98 -0
  319. package/types/mixins/PopupMixin.d.ts.map +1 -0
  320. package/types/mixins/RTLObserverMixin.d.ts +8 -0
  321. package/types/mixins/RTLObserverMixin.d.ts.map +1 -0
  322. package/types/mixins/ResizeObserverMixin.d.ts +13 -0
  323. package/types/mixins/ResizeObserverMixin.d.ts.map +1 -0
  324. package/types/mixins/RippleMixin.d.ts +94 -0
  325. package/types/mixins/RippleMixin.d.ts.map +1 -0
  326. package/types/mixins/ScrollListenerMixin.d.ts +46 -0
  327. package/types/mixins/ScrollListenerMixin.d.ts.map +1 -0
  328. package/types/mixins/SemiStickyMixin.d.ts +50 -0
  329. package/types/mixins/SemiStickyMixin.d.ts.map +1 -0
  330. package/types/mixins/ShapeMaskedMixin.d.ts +12 -0
  331. package/types/mixins/ShapeMaskedMixin.d.ts.map +1 -0
  332. package/types/mixins/ShapeMixin.d.ts +39 -0
  333. package/types/mixins/ShapeMixin.d.ts.map +1 -0
  334. package/types/mixins/StateMixin.d.ts +29 -0
  335. package/types/mixins/StateMixin.d.ts.map +1 -0
  336. package/types/mixins/TextFieldMixin.d.ts +153 -0
  337. package/types/mixins/TextFieldMixin.d.ts.map +1 -0
  338. package/types/mixins/ThemableMixin.d.ts +10 -0
  339. package/types/mixins/ThemableMixin.d.ts.map +1 -0
  340. package/types/mixins/TooltipTriggerMixin.d.ts +114 -0
  341. package/types/mixins/TooltipTriggerMixin.d.ts.map +1 -0
  342. package/types/mixins/TouchTargetMixin.d.ts +6 -0
  343. package/types/mixins/TouchTargetMixin.d.ts.map +1 -0
  344. package/types/mixins/TypographyMixin.d.ts +20 -0
  345. package/types/mixins/TypographyMixin.d.ts.map +1 -0
  346. package/types/services/rtl.d.ts +3 -0
  347. package/types/services/rtl.d.ts.map +1 -0
  348. package/types/services/svgAlias.d.ts +13 -0
  349. package/types/services/svgAlias.d.ts.map +1 -0
  350. package/types/services/theme.d.ts +45 -0
  351. package/types/services/theme.d.ts.map +1 -0
  352. package/types/utils/cli.d.ts +3 -0
  353. package/types/utils/cli.d.ts.map +1 -0
  354. package/types/utils/function.d.ts +3 -0
  355. package/types/utils/function.d.ts.map +1 -0
  356. package/types/utils/jsx-runtime.d.ts +20 -0
  357. package/types/utils/jsx-runtime.d.ts.map +1 -0
  358. package/types/utils/material-color/blend.d.ts +34 -0
  359. package/types/utils/material-color/blend.d.ts.map +1 -0
  360. package/types/utils/material-color/hct/Cam16.d.ts +142 -0
  361. package/types/utils/material-color/hct/Cam16.d.ts.map +1 -0
  362. package/types/utils/material-color/hct/Hct.d.ts +93 -0
  363. package/types/utils/material-color/hct/Hct.d.ts.map +1 -0
  364. package/types/utils/material-color/hct/ViewingConditions.d.ts +69 -0
  365. package/types/utils/material-color/hct/ViewingConditions.d.ts.map +1 -0
  366. package/types/utils/material-color/hct/hctSolver.d.ts +30 -0
  367. package/types/utils/material-color/hct/hctSolver.d.ts.map +1 -0
  368. package/types/utils/material-color/helper.d.ts +8 -0
  369. package/types/utils/material-color/helper.d.ts.map +1 -0
  370. package/types/utils/material-color/palettes/CorePalette.d.ts +75 -0
  371. package/types/utils/material-color/palettes/CorePalette.d.ts.map +1 -0
  372. package/types/utils/material-color/palettes/TonalPalette.d.ts +38 -0
  373. package/types/utils/material-color/palettes/TonalPalette.d.ts.map +1 -0
  374. package/types/utils/material-color/scheme/Scheme.d.ts +264 -0
  375. package/types/utils/material-color/scheme/Scheme.d.ts.map +1 -0
  376. package/types/utils/material-color/utils/color.d.ts +172 -0
  377. package/types/utils/material-color/utils/color.d.ts.map +1 -0
  378. package/types/utils/material-color/utils/math.d.ts +94 -0
  379. package/types/utils/material-color/utils/math.d.ts.map +1 -0
  380. package/types/utils/pixelmatch.d.ts +22 -0
  381. package/types/utils/pixelmatch.d.ts.map +1 -0
  382. package/types/utils/popup.d.ts +106 -0
  383. package/types/utils/popup.d.ts.map +1 -0
  384. package/types/utils/searchParams.d.ts +3 -0
  385. package/types/utils/searchParams.d.ts.map +1 -0
  386. package/types/utils/svg.d.ts +7 -0
  387. package/types/utils/svg.d.ts.map +1 -0
  388. package/utils/jsx-runtime.js +9 -4
  389. package/utils/material-color/scheme/Scheme.js +1 -1
  390. package/utils/pixelmatch.js +363 -0
  391. package/utils/popup.js +86 -10
  392. package/utils/searchParams.js +22 -0
  393. package/components/Button.md +0 -61
  394. package/components/ExtendedFab.js +0 -32
  395. package/components/Layout.js +0 -504
  396. package/components/Nav.js +0 -38
  397. package/core/DomAdapter.js +0 -586
  398. package/core/ICustomElement.d.ts +0 -291
  399. package/core/ICustomElement.js +0 -1
  400. package/core/test.js +0 -126
  401. package/core/typings.d.ts +0 -142
  402. package/core/typings.js +0 -1
  403. package/mixins/SurfaceMixin.js +0 -127
  404. package/theming/loader.js +0 -22
  405. /package/{utils/color_keywords.js → constants/colorKeywords.js} +0 -0
@@ -0,0 +1,151 @@
1
+ import CustomElement from '../core/CustomElement.js';
2
+
3
+ // https://html.spec.whatwg.org/multipage/tables.html#htmltableelement
4
+
5
+ /**
6
+ * @param {Element} parent
7
+ * @param {string} tagName
8
+ * @return {Element?}
9
+ */
10
+ function getByTagName(parent, tagName) {
11
+ for (const element of parent.children) {
12
+ if (element.tagName === tagName) {
13
+ return element;
14
+ }
15
+ }
16
+ return null;
17
+ }
18
+
19
+ /**
20
+ * @param {Element} parent
21
+ * @param {string} tagName
22
+ * @param {Element|null} value
23
+ * @param {string} errorMessage
24
+ * @return {Element?}
25
+ */
26
+ function setByTagName(parent, tagName, value, errorMessage) {
27
+ const current = getByTagName(parent, tagName);
28
+ if (!value) {
29
+ current?.remove();
30
+ return undefined;
31
+ }
32
+ if (value === current) return value;
33
+ if (value instanceof HTMLElement && value.tagName === tagName) {
34
+ if (current) {
35
+ current.replaceWith(value);
36
+ } else {
37
+ this.prepend(value);
38
+ }
39
+ return value;
40
+ }
41
+ throw new TypeError(errorMessage);
42
+ }
43
+
44
+ /**
45
+ * @param {Element} parent
46
+ * @param {string} tagName
47
+ * @return {Element?}
48
+ */
49
+ function createByTagName(parent, tagName) {
50
+ let element = this.getByTagName(parent, tagName);
51
+ if (element) return element;
52
+ element = document.createElement(tagName);
53
+ this.prepend(element);
54
+ return element;
55
+ }
56
+
57
+ /**
58
+ * @param {Element} parent
59
+ * @param {string} tagName
60
+ * @return {void}
61
+ */
62
+ function deleteByTagName(parent, tagName) {
63
+ this.setByTagName(parent, tagName, null);
64
+ }
65
+
66
+ /**
67
+ * Table provides an HTML-like table API using mdw elements for rows and sections.
68
+ * Implements the {@link https://html.spec.whatwg.org/multipage/tables.html#htmltableelement | HTMLTableElement} API
69
+ * using `mdw-` prefixed sections and rows.
70
+ *
71
+ * Legacy. Modern UI does not use tables and no longer part of Material Design Web.
72
+ * Tables are generally not responsive and do not adapt well to different screen sizes.
73
+ */
74
+ export default CustomElement
75
+ .extend()
76
+ .define({
77
+ /**
78
+ * The table caption element (`mdw-caption`) or `null` when not present.
79
+ * Mirrors `HTMLTableElement.caption` semantics.
80
+ */
81
+ caption: {
82
+ get() {
83
+ return getByTagName(this, 'mdw-caption');
84
+ },
85
+ set(value) {
86
+ return setByTagName(this, 'mdw-caption', value, "Failed to set the 'caption' property on 'MDWTableElement': Failed to convert value to 'MDWCaptionElement'.");
87
+ },
88
+ },
89
+ /**
90
+ * The table header section (`mdw-thead`) element or `null` when not present.
91
+ * Mirrors `HTMLTableElement.tHead` semantics.
92
+ */
93
+ tHead: {
94
+ get() {
95
+ return getByTagName(this, 'mdw-thead');
96
+ },
97
+ set(value) {
98
+ return setByTagName(this, 'mdw-thead', value, "Failed to set the 'tHead' property on 'MDWTableElement': Failed to convert value to 'MDWTHeadElement'.");
99
+ },
100
+ },
101
+ /**
102
+ * The table footer section (`mdw-tfoot`) element or `null` when not present.
103
+ */
104
+ tFoot: {
105
+ get() {
106
+ return getByTagName(this, 'mdw-tfoot');
107
+ },
108
+ set(value) {
109
+ return setByTagName(this, 'mdw-tfoot', value, "Failed to set the 'tFoot' property on 'MDWTableElement': Failed to convert value to 'MDWTFootElement'.");
110
+ },
111
+ },
112
+ /**
113
+ * Live `HTMLCollection` of `mdw-tbody` elements contained by the table.
114
+ * Mirrors `HTMLTableElement.tBodies`.
115
+ * @return {HTMLCollectionOf<Element>}
116
+ */
117
+ tBodies() {
118
+ return this.getElementsByTagName('mdw-tbody');
119
+ },
120
+ /**
121
+ * Live `HTMLCollection` of row elements (`mdw-tr`) in the table.
122
+ * Mirrors `HTMLTableElement.rows`.
123
+ * @return {HTMLCollectionOf<Element>}
124
+ */
125
+ rows() {
126
+ return this.getElementsByTagName('mdw-tr');
127
+ },
128
+ })
129
+ .methods({
130
+ /** Create and return a `mdw-caption` element, appending when necessary. */
131
+ createCaption() { return createByTagName(this, 'mdw-caption'); },
132
+ /** Remove the table's caption element when present. */
133
+ deleteCaption() { return deleteByTagName(this, 'mdw-caption'); },
134
+ /** Create and return a `mdw-thead` element for the table. */
135
+ createTHead() { return createByTagName(this, 'mdw-thead'); },
136
+ /** Remove the table's `mdw-thead` element when present. */
137
+ deleteTHead() { return deleteByTagName(this, 'mdw-thead'); },
138
+ /** Create and return a `mdw-tfoot` element for the table. */
139
+ createTFoot() { return createByTagName(this, 'mdw-tfoot'); },
140
+ /** Remove the table's `mdw-tfoot` element when present. */
141
+ deleteTFoot() { return deleteByTagName(this, 'mdw-tfoot'); },
142
+ /** Insert and return a new `mdw-tbody` element before the tFoot (if any). */
143
+ createTBody() { return this.insertBefore(this.tFoot, document.createElement('mdw-tbody')); },
144
+ })
145
+ .html`<slot id=slot></slot>`
146
+ .css`
147
+ :host{
148
+ display:table;
149
+ }
150
+ `
151
+ .autoRegister('mdw-table');
@@ -8,8 +8,11 @@ import ThemableMixin from '../mixins/ThemableMixin.js';
8
8
  const DOMString = { nullParser: String, value: '' };
9
9
 
10
10
  /**
11
+ * TextArea is a multi-line text input that auto-resizes and integrates with
12
+ * text-field patterns for labels and validation.
13
+ * implements {HTMLTextAreaElement}
14
+ * @see https://m3.material.io/components/text-fields/specs
11
15
  * @see https://html.spec.whatwg.org/multipage/form-elements.html#the-textarea-element
12
- * -implements {HTMLTextAreaElement}
13
16
  */
14
17
  export default CustomElement
15
18
  .extend()
@@ -19,33 +22,52 @@ export default CustomElement
19
22
  .mixin(TextFieldMixin)
20
23
  .mixin(ResizeObserverMixin)
21
24
  .set({
25
+ /** Whether the UA supports the `lh` CSS unit for line-height. */
22
26
  supportsCSSLineHeightUnit: CSS.supports('height', '1lh'),
27
+ /** The control type used by the component. */
23
28
  type: 'textarea',
29
+ /** Internal flag used while performing auto-resize logic. */
24
30
  _resizing: false,
25
31
  })
26
32
  .overrides({
33
+ /** Tag name used for the native control element. */
27
34
  controlTagName: 'textarea',
35
+ /** Textareas are not void elements. */
28
36
  controlVoidElement: false,
29
37
  })
30
38
  .observe({
39
+ /** When true the textarea is fixed-size and will not auto-resize. */
31
40
  fixed: { type: 'boolean' },
41
+ /** Minimum number of rows to display. Mirrors the `minrows` attribute. */
32
42
  minRows: { attr: 'minrows', type: 'integer', nullable: false },
43
+ /** Maximum number of rows to allow when auto-resizing. */
33
44
  maxRows: { attr: 'maxrows', type: 'integer', nullable: false },
45
+ /** Computed or measured line-height token used for resizing. */
34
46
  _lineHeight: 'string',
47
+ /** Number of columns (characters) for the control (integer). */
35
48
  cols: { type: 'integer', empty: 0 },
49
+ /** The `dirname` attribute value forwarded to the native control. */
36
50
  dirName: { attr: 'dirname', ...DOMString },
51
+ /** Maximum allowed characters for the control. */
37
52
  maxLength: { attr: 'maxlength', type: 'integer', empty: 0 },
53
+ /** Minimum required characters for the control. */
38
54
  minLength: { attr: 'minlength', type: 'integer', empty: 0 },
55
+ /** Placeholder text forwarded to the native control. */
39
56
  placeholder: DOMString,
57
+ /** Number of rows to render; updated when resizing. */
40
58
  rows: { type: 'integer', empty: 1 },
59
+ /** Wrapping behavior token forwarded to the native control. */
41
60
  wrap: DOMString,
42
61
  // Not in spec, but plays nice with HTML linters
62
+ /** Forwards a `value` attribute to the internal `defaultValue`. */
43
63
  defaultValueAttr: { attr: 'value', ...DOMString },
44
64
  })
45
65
  .define({
66
+ /** Return the underlying native `HTMLTextAreaElement` control. */
46
67
  _textarea() { return /** @type {HTMLTextAreaElement} */ (this.refs.control); },
47
68
  })
48
69
  .define({
70
+ /** The default value (initial value) of the internal textarea. */
49
71
  defaultValue: {
50
72
  get() { return this._textarea.defaultValue; },
51
73
  set(value) {
@@ -58,7 +80,9 @@ export default CustomElement
58
80
  this.textContent = this._textarea.defaultValue;
59
81
  },
60
82
  },
83
+ /** Number of characters currently in the textarea. */
61
84
  textLength() { return this._textarea.textLength; },
85
+ /** Focus + select helper forwarded to the native control. */
62
86
  select() { return this._textarea.select; },
63
87
 
64
88
  selectionDirection: {
@@ -76,12 +100,18 @@ export default CustomElement
76
100
  set(value) { this._textarea.selectionEnd = value; },
77
101
  },
78
102
 
103
+ /** Convenience passthrough to `HTMLTextAreaElement.setRangeText`. */
79
104
  setRangeText() { return this._textarea.setRangeText; },
80
105
 
106
+ /** Convenience passthrough to `HTMLTextAreaElement.setSelectionRange`. */
81
107
  setSelectionRange() { return this._textarea.setSelectionRange; },
82
108
 
83
109
  })
84
110
  .methods({
111
+ /**
112
+ * Resize the textarea to fit content up to `maxRows` and not below
113
+ * `minRows`. This updates the `rows` property and internal layout state.
114
+ */
85
115
  resize() {
86
116
  if (this._resizing) return;
87
117
  this._resizing = true;
@@ -135,9 +165,8 @@ export default CustomElement
135
165
  this._resizing = false;
136
166
  // if (this.placeholder) textarea.setAttribute('placeholder', this.placeholder);
137
167
  },
138
-
139
- /** @param {ResizeObserverEntry} entry */
140
- onResizeObserved(entry) {
168
+ /** Called by the ResizeObserver mixin; triggers a resize unless active. */
169
+ onResizeObserved() {
141
170
  if (this.matches(':active')) return;
142
171
  this.resize();
143
172
  },
@@ -167,19 +196,18 @@ export default CustomElement
167
196
  },
168
197
  },
169
198
  })
199
+ .recompose(({ refs: { control } }) => {
200
+ // Spec
201
+ control.removeAttribute('placeholder');
202
+ control.setAttribute('rows', '{rows}');
203
+
204
+ // Custom
205
+ control.setAttribute('input-prefix', '{inputPrefix}');
206
+ control.setAttribute('input-suffix', '{inputSuffix}');
207
+ control.setAttribute('fixed', '{fixed}');
208
+ control.setAttribute('icon', '{icon}');
209
+ })
170
210
  .on({
171
- composed() {
172
- const { control } = this.refs;
173
- // Spec
174
- control.removeAttribute('placeholder');
175
- control.setAttribute('rows', '{rows}');
176
-
177
- // Custom
178
- control.setAttribute('input-prefix', '{inputPrefix}');
179
- control.setAttribute('input-suffix', '{inputSuffix}');
180
- control.setAttribute('fixed', '{fixed}');
181
- control.setAttribute('icon', '{icon}');
182
- },
183
211
  defaultValueAttrChanged(oldValue, newValue) {
184
212
  this.defaultValue = newValue;
185
213
  },
@@ -286,6 +314,10 @@ export default CustomElement
286
314
  max-block-size: calc((var(--max-rows) * var(--line-height)));
287
315
  }
288
316
 
317
+ #icon {
318
+ margin-inline-end: 16px;
319
+ }
320
+
289
321
  #control[icon] {
290
322
  padding-inline-start: 0;
291
323
  }
@@ -1,14 +1,13 @@
1
- import Headline from './Headline.js';
1
+ import Display from './Display.js';
2
2
 
3
- export default Headline
3
+ /**
4
+ * Material Design Type scale: Title.
5
+ * @see https://m3.material.io/styles/typography/type-scale-tokens
6
+ */
7
+ export default Display
4
8
  .extend()
5
- .expressions({
6
- computeAriaLevel({ ariaLevel, size }) {
7
- if (ariaLevel) return ariaLevel;
8
- if (size === 'medium') return '5';
9
- if (size === 'small') return '6';
10
- return '4';
11
- },
9
+ .set({
10
+ _baseAriaLevel: 7,
12
11
  })
13
12
  .css`
14
13
  :host {
@@ -1,62 +1,91 @@
1
+ import CustomElement from '../core/CustomElement.js';
1
2
  import AriaReflectorMixin from '../mixins/AriaReflectorMixin.js';
3
+ import ShapeMixin from '../mixins/ShapeMixin.js';
4
+ import ThemableMixin from '../mixins/ThemableMixin.js';
2
5
 
3
- import Surface from './Surface.js';
4
-
5
- export default Surface
6
+ /**
7
+ * Tooltip displays brief helper text when hovering or focusing an element.
8
+ * @see https://m3.material.io/components/tooltips/specs
9
+ */
10
+ export default CustomElement
6
11
  .extend()
12
+ .mixin(ThemableMixin)
13
+ .mixin(ShapeMixin)
7
14
  .mixin(AriaReflectorMixin)
8
15
  .set({
16
+ /** ARIA role applied by the AriaReflectorMixin (defaults to `tooltip`). */
9
17
  _ariaRole: 'tooltip',
10
18
  })
11
19
  .observe({
20
+ /**
21
+ * When true the tooltip is visible/open. This also updates ARIA
22
+ * `aria-hidden` for accessibility.
23
+ */
12
24
  open: {
13
25
  type: 'boolean',
14
26
  changedCallback(oldValue, newValue) {
15
27
  this.updateAriaProperty('ariaHidden', newValue ? 'true' : 'false');
16
28
  },
17
29
  },
18
- touch: 'boolean',
19
30
  })
31
+ .html`
32
+ <div id=hover-target></div>
33
+ <slot id=slot></slot>
34
+ `
20
35
  .css`
21
- /* https://m2.material.io/components/tooltips */
22
-
23
36
  :host {
24
37
  --mdw-shape__size: var(--mdw-shape__extra-small);
25
- --mdw-ink: var(--mdw-color__on-surface-variant);
26
- --mdw-shape__bg: rgb(var(--mdw-color__surface-container));
38
+ --mdw-ink: var(--mdw-color__inverse-on-surface);
39
+ --mdw-bg: var(--mdw-color__inverse-surface);
27
40
  display: block;
28
- vertical-align: middle;
29
41
 
30
42
  box-sizing: border-box;
31
- /* stylelint-disable-next-line declaration-property-value-disallowed-list */
32
- margin-inline: auto;
33
- padding-block: 4px;
43
+
44
+ /* Ensure 24px min-height while keeping display:block */
45
+ padding-block: calc(12px - var(--mdw-typescale__body-small__line-height) / 2);
34
46
  padding-inline: 8px;
35
47
 
36
48
  pointer-events: none;
37
49
 
38
50
  opacity: 0;
39
51
  transform: scale(0);
40
- z-index: 24;
52
+ z-index: 28;
41
53
 
42
- font: var(--mdw-typescale__label-medium__font);
43
- letter-spacing: var(--mdw-typescale__label-medium__letter-spacing);
54
+ background-color: rgb(var(--mdw-bg));
55
+ color: rgb(var(--mdw-ink));
44
56
 
45
- transition: transform 200ms, opacity 200ms;
57
+ font: var(--mdw-typescale__body-small__font);
58
+ letter-spacing: var(--mdw-typescale__body-small__letter-spacing);
46
59
 
60
+ transition: transform 200ms, opacity 200ms;
47
61
  }
48
62
 
49
- :host([touch]) {
50
- padding-block: 6px;
51
- padding-inline: 16px;
52
-
53
- font: var(--mdw-typescale__label-large__font);
54
- letter-spacing: var(--mdw-typescale__label-large__letter-spacing);
63
+ @supports(width: 1lh) {
64
+ :host {
65
+ padding-block: calc(12px - 0.5lh);
66
+ }
55
67
  }
56
68
 
57
69
  :host([open]) {
70
+ pointer-events: auto;
71
+
58
72
  opacity: 1;
59
73
  transform: scale(1);
60
74
  }
75
+
76
+ #hover-target {
77
+ position: absolute;
78
+ inset-block-start: 50%;
79
+ inset-inline-start: 50%;
80
+
81
+ box-sizing: content-box;
82
+ block-size: 100%;
83
+ inline-size: 100%;
84
+ padding: 8px;
85
+
86
+ transform: translateX(-50%) translateY(-50%);
87
+ z-index: -1;
88
+
89
+ }
61
90
  `
62
91
  .autoRegister('mdw-tooltip');
@@ -1,36 +1,62 @@
1
1
  import CustomElement from '../core/CustomElement.js';
2
- import { ELEMENT_STYLER_TYPE } from '../core/customTypes.js';
2
+ import { ELEMENT_ANIMATION_TYPE, ELEMENT_STYLE_TYPE } from '../core/customTypes.js';
3
3
  import AriaToolbarMixin from '../mixins/AriaToolbarMixin.js';
4
+ import DelegatesFocusMixin from '../mixins/DelegatesFocusMixin.js';
4
5
  import SemiStickyMixin from '../mixins/SemiStickyMixin.js';
5
6
  import ShapeMixin from '../mixins/ShapeMixin.js';
6
- import SurfaceMixin from '../mixins/SurfaceMixin.js';
7
7
  import ThemableMixin from '../mixins/ThemableMixin.js';
8
8
 
9
+ /**
10
+ * Top App Bars should have a background-color that is identical to
11
+ * `transparent`, though an explicit value allows updating the environment's
12
+ * to match the app bar (eg: color system bar).
13
+ *
14
+ * Top corners are shaped when not scrolling to allow matching with pane, but
15
+ * removed when raised
16
+ */
17
+
18
+ /**
19
+ * Top app bar provides a consistent place for navigation and actions at the
20
+ * top of the screen. It supports small, medium, and large variants.
21
+ * @see https://m3.material.io/components/top-app-bar/specs
22
+ */
9
23
  export default CustomElement
10
24
  .extend()
11
25
  .mixin(ThemableMixin)
12
- .mixin(SurfaceMixin)
13
26
  .mixin(ShapeMixin)
14
27
  .mixin(AriaToolbarMixin)
15
28
  .mixin(SemiStickyMixin)
16
- .set({
17
- elevated: true,
18
- })
29
+ .mixin(DelegatesFocusMixin)
19
30
  .observe({
31
+ /** Whether the bar is currently raised/elevated (scrolled). */
20
32
  _raised: 'boolean',
33
+ /** Headline opacity used when companion region is visible (0..1). */
21
34
  _headlineOpacity: { type: 'float', default: 0 },
35
+ /** Headline text displayed in the center area. */
22
36
  headline: 'string',
37
+ /** Size variant: 'small' | 'medium' | 'large' or `null` to auto-select. */
23
38
  size: { value: /** @type {'small'|'medium'|'large'|null} */ (null) },
24
- /** Convert native to observable */
25
- ariaLabel: 'string',
26
- color: { empty: 'surface' },
27
- })
28
- .overrides({
29
- _getSemiStickyElement() { return this.refs.surface; },
39
+ /** Color token name used for ink/background. */
40
+ color: 'string',
41
+ /** Color token to use when the bar is raised. */
42
+ raisedColor: 'string',
30
43
  })
31
44
  .observe({
45
+ /** Computed style tokens injected for raised-background when `raisedColor` is set. */
46
+ _styles: {
47
+ ...ELEMENT_STYLE_TYPE,
48
+ get({ raisedColor }) {
49
+ if (raisedColor) {
50
+ return '#raised-background:where([raised])'
51
+ + `{background-color:rgb(var(--mdw-color__${raisedColor}))`
52
+ + '}';
53
+ }
54
+ return null;
55
+ },
56
+ },
57
+ /** Animation config for the headline element when companion is visible. */
32
58
  _headlineStyle: {
33
- ...ELEMENT_STYLER_TYPE,
59
+ ...ELEMENT_ANIMATION_TYPE,
34
60
  get({ size, _headlineOpacity }) {
35
61
  if (size !== 'medium' && size !== 'large') return null;
36
62
  return {
@@ -45,32 +71,25 @@ export default CustomElement
45
71
  },
46
72
  },
47
73
  })
74
+ .expressions({
75
+ /** True when the companion region should be rendered (medium/large). */
76
+ _companionIf({ size }) {
77
+ return size === 'medium' || size === 'large';
78
+ },
79
+ })
48
80
  .html`
81
+ <div id=raised-background raised={_raised}></div>
49
82
  <slot id=leading name=leading on-slotchange={refreshTabIndexes}></slot>
50
83
  <div id=headline ink={ink} color={color} type-style={typeStyle} on-slotchange={refreshTabIndexes}>
51
84
  {headline}
52
85
  <slot id=headline-slot></slot>
53
86
  </div>
54
87
  <slot id=trailing name=trailing on-slotchange={refreshTabIndexes}></slot>
55
- <div mdw-if=${({ size }) => size === 'medium' || size === 'large'} id=companion aria-hidden=true size={size} color={color} raised={_raised}>
88
+ <div mdw-if={_companionIf} id=companion aria-hidden=true size={size} color={color} raised={_raised}>
56
89
  <slot id=companion-slot name=companion size={size}>{headline}</span>
57
90
  </div>
58
91
  `
59
92
  .on({
60
- composed({ inline }) {
61
- const { surface, shape, leading, headline, trailing } = this.refs;
62
- shape.append(leading, headline, trailing);
63
- surface.append(shape);
64
- surface.setAttribute('size', '{size}');
65
- surface.setAttribute('role', 'toolbar');
66
- surface.setAttribute('aria-label', '{ariaLabel}');
67
- surface.setAttribute(
68
- 'aria-labelledby',
69
- inline(({ ariaLabel }) => (ariaLabel ? null : 'headline')),
70
- );
71
- surface.setAttribute('raised', '{_raised}');
72
- shape.setAttribute('raised', '{_raised}');
73
- },
74
93
  _scrollListenerPositionYChanged(oldValue, newValue) {
75
94
  this._raised = (newValue > this._semiStickyOffsetY);
76
95
  if (this.size === 'medium' || this.size === 'large') {
@@ -91,60 +110,20 @@ export default CustomElement
91
110
  }
92
111
  },
93
112
  })
94
- .define({
95
- ariaActiveDescendantElement: {
96
- get() {
97
- // @ts-ignore Accessibility Object Model
98
- return this.refs.surface.ariaActiveDescendantElement;
99
- },
100
- set(value) {
101
- // @ts-ignore Accessibility Object Model
102
- this.refs.surface.ariaActiveDescendantElement = value;
103
- },
104
- },
105
- })
106
113
  .css`
107
114
  /* https://m3.material.io/components/bottom-app-bar/specs */
108
-
109
115
  :host {
110
116
  --mdw-bg: var(--mdw-color__surface);
111
117
  --mdw-ink: var(--mdw-color__on-surface);
112
- display: contents;
113
118
 
114
- z-index:2;
115
- }
116
-
117
- #surface {
118
119
  position: sticky;
119
- inset-block-end: auto;
120
-
121
- grid-area: app-bar;
122
-
123
- margin: inherit; /** Pass through */
124
-
125
- padding: inherit; /** Pass through */
126
-
127
- filter: none; /* Never receive shadow */
128
-
129
- transform: translateY(0);
130
-
131
- z-index: 5;
132
-
133
- background-color: rgb(var(--mdw-bg));
134
-
135
- transition: grid-template-columns 100ms, background-color 100ms;
136
-
137
- will-change: transform;
138
- }
139
-
140
- #shape{
141
- position: initial;
142
- inset: initial;
120
+ inset-block-start: 0;
143
121
 
144
122
  display: grid;
145
123
 
146
124
  align-items: center;
147
125
  gap: 12px;
126
+
148
127
  grid-auto-flow: row;
149
128
  grid-template-rows: minmax(64px,min-content);
150
129
  grid-template-columns: minmax(auto,1fr) minmax(0,auto) minmax(auto,1fr);
@@ -152,8 +131,6 @@ export default CustomElement
152
131
  overflow-y: visible;
153
132
 
154
133
  box-sizing: border-box;
155
- max-inline-size: calc(var(--mdw-content__max-width, 100%) + (2 * var(--mdw-content__padding, 16px) - 4px));
156
- margin-inline: auto;
157
134
 
158
135
  /* 16px from icon */
159
136
  /* inset = (button.width / 2) - (icon.width / 2) */
@@ -161,15 +138,33 @@ export default CustomElement
161
138
  /* paddingInlineStart = 16px - ((48px / 2) - (24px / 2)) */
162
139
  /* paddingInlineEnd = 16px - ((48px / 2) - (30px / 2)) */
163
140
 
164
- padding-inline: calc(var(--mdw-content__padding, 16px) - 8px);
141
+ padding-inline: var(--mdw-pane__padding-inline, 16px);
165
142
 
166
143
  pointer-events: auto;
167
144
 
168
- z-index: initial;
145
+ transform: translateY(0);
146
+ z-index: 5;
147
+
148
+ background-color: rgb(var(--mdw-bg));
149
+ color: rgb(var(--mdw-ink));
150
+
151
+ transition: grid-template-columns 100ms;
152
+ will-change: transform;
153
+ }
154
+
155
+ #raised-background {
156
+ position: absolute;
157
+ inset: 0;
158
+
159
+ z-index: -1;
169
160
 
170
161
  background-color: transparent;
171
162
 
172
- color: rgb(var(--mdw-ink));
163
+ transition: background-color 200ms;
164
+ }
165
+
166
+ #raised-background:where([raised]) {
167
+ background-color: rgb(var(--mdw-color__surface-container));
173
168
  }
174
169
 
175
170
  #leading {
@@ -314,15 +309,13 @@ export default CustomElement
314
309
  will-change: opacity;
315
310
  }
316
311
 
317
- #surface:where([color="none"], [color="transparent"]),
312
+ :host(:where([color="none"], [color="transparent"])),
318
313
  #companion:where([color="none"], [color="transparent"]) {
319
314
  background-color: transparent;
320
315
  }
321
316
 
322
- #surface[raised]:where([color="surface"],[color="none"],[color="transparent"]),
323
317
  #companion[raised]:where([color="surface"],[color="none"],[color="transparent"]) {
324
318
  background-color: rgb(var(--mdw-color__surface-container));
325
319
  }
326
-
327
320
  `
328
321
  .autoRegister('mdw-top-app-bar');