@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,13 +1,14 @@
1
1
  // https://www.w3.org/TR/wai-aria-practices/#menu
2
2
 
3
+ import { isFocused } from '../core/dom.js';
3
4
  import FormAssociatedMixin from '../mixins/FormAssociatedMixin.js';
4
5
 
5
6
  import './Icon.js';
6
7
  import ListOption from './ListOption.js';
7
8
 
8
- export default class MenuItem extends ListOption
9
- .mixin(FormAssociatedMixin)
9
+ export default ListOption
10
10
  .extend()
11
+ .mixin(FormAssociatedMixin)
11
12
  .set({
12
13
  _cascadeTimeout: null,
13
14
  CASCADE_TIMEOUT: 500,
@@ -96,7 +97,9 @@ export default class MenuItem extends ListOption
96
97
  cascade() {
97
98
  this.unscheduleCascade();
98
99
  this._cascading = true;
99
- document.getElementById(this.cascades)?.cascade?.(this);
100
+ // Dispatch event asking for cascade.
101
+ // Captured by parent mdw-menu and used to track current submenu
102
+ this.dispatchEvent(new CustomEvent('mdw-menu-item:cascade', { detail: this.cascades, bubbles: true }));
100
103
  this._cascading = false;
101
104
  },
102
105
  })
@@ -119,7 +122,7 @@ export default class MenuItem extends ListOption
119
122
  .events({
120
123
  mouseenter() {
121
124
  if (this.disabledState) return;
122
- if (document.activeElement !== this) {
125
+ if (!isFocused(this)) {
123
126
  this.focus();
124
127
  }
125
128
  if (!this.cascades) return;
@@ -170,38 +173,38 @@ export default class MenuItem extends ListOption
170
173
  blur() {
171
174
  if (!this.cascades) return;
172
175
  if (this._cascading) return;
173
- const submenuElement = document.getElementById(this.cascades);
174
- if (submenuElement.matches(':focus-within')) return;
175
- console.debug('closing submenu via cascader blur');
176
- submenuElement.close(false);
176
+ this.dispatchEvent(new CustomEvent('mdw-menu-item:cascader-blur', { detail: this.cascades, bubbles: true }));
177
177
  },
178
178
  })
179
- .on({
180
- composed({ inline, html }) {
181
- const { checkbox: checkboxRef, radio: radioRef, anchor, trailing, trailingIcon } = this.refs;
182
- checkboxRef.remove();
183
- radioRef.remove();
179
+ .recompose(({ inline, html, refs: { checkbox: checkboxRef, radio: radioRef, anchor, trailing, trailingIcon } }) => {
180
+ checkboxRef.remove();
181
+ radioRef.remove();
184
182
 
185
- anchor.setAttribute('role', inline(({ checkbox, radio }) => {
186
- if (checkbox != null) return 'menuitemcheckbox';
187
- if (radio != null) return 'menuitemradio';
188
- return 'menuitem';
189
- }));
183
+ anchor.setAttribute('role', inline(({ checkbox, radio }) => {
184
+ if (checkbox != null) return 'menuitemcheckbox';
185
+ if (radio != null) return 'menuitemradio';
186
+ return 'menuitem';
187
+ }));
190
188
 
191
- // MenuItems use checked instead of selected as in list items.
192
- anchor.setAttribute('ariaChecked', anchor.getAttribute('aria-selected'));
189
+ // MenuItems use checked instead of selected as in list items.
190
+ anchor.setAttribute('ariaChecked', anchor.getAttribute('aria-selected'));
193
191
 
194
- anchor.after(html`
195
- <mdw-icon id=selection
196
- _if=${({ checkbox, radio }) => checkbox ?? radio ?? false}
197
- class=${({ checkbox, radio }) => checkbox || radio || 'leading'}
198
- selected={selected}>check</mdw-icon>
199
- `);
192
+ anchor.after(html`
193
+ <mdw-icon id=selection
194
+ mdw-if=${({ checkbox, radio }) => checkbox ?? radio ?? false}
195
+ class=${({ checkbox, radio }) => checkbox || radio || 'leading'}
196
+ selected={selected} icon=check></mdw-icon>
197
+ `);
200
198
 
201
- trailing.setAttribute('type-style', 'label-large');
199
+ trailing.setAttribute('type-style', 'label-large');
202
200
 
203
- trailingIcon.setAttribute('_if', '{computeTrailingIcon}');
204
- trailingIcon.textContent = '{computeTrailingIcon}';
201
+ trailingIcon.setAttribute('mdw-if', '{computeTrailingIcon}');
202
+ trailingIcon.setAttribute('icon', '{computeTrailingIcon}');
203
+ })
204
+ .on({
205
+ _formResetChanged(oldValue, newValue) {
206
+ if (!newValue) return;
207
+ this._selected = this.defaultSelected;
205
208
  },
206
209
  })
207
210
  .css`
@@ -259,10 +262,4 @@ export default class MenuItem extends ListOption
259
262
  color: inherit;
260
263
  }
261
264
  `
262
- .autoRegister('mdw-menu-item')
263
- .tsClassFix() {
264
- formResetCallback() {
265
- this._selected = this.defaultSelected;
266
- super.formResetCallback();
267
- }
268
- }
265
+ .autoRegister('mdw-menu-item');
@@ -1,66 +1,37 @@
1
- import { ELEMENT_STYLER_TYPE } from '../core/customTypes.js';
2
- import ScrollListenerMixin from '../mixins/ScrollListenerMixin.js';
1
+ import CustomElement from '../core/CustomElement.js';
2
+ import DelegatesFocusMixin from '../mixins/DelegatesFocusMixin.js';
3
+ import ThemableMixin from '../mixins/ThemableMixin.js';
3
4
 
4
- import Nav from './Nav.js';
5
+ import NavItem from './NavItem.js';
5
6
 
6
- export default Nav
7
- .mixin(ScrollListenerMixin)
7
+ export default CustomElement
8
+ .extend()
9
+ .mixin(DelegatesFocusMixin)
10
+ .mixin(ThemableMixin)
8
11
  .observe({
9
- hideOnScroll: 'boolean',
10
- _translateY: { type: 'float', empty: 0 },
11
- _transition: { empty: 'none' },
12
- })
13
- .observe({
14
- _positioningStyle: {
15
- ...ELEMENT_STYLER_TYPE,
16
- get({ _translateY, _transition }) {
17
- return {
18
- styles: {
19
- transform: `translateY(${_translateY}px)`,
20
- transition: _transition,
21
- },
22
- };
23
- },
12
+ open: 'boolean',
13
+ autoClose: {
14
+ type: 'float',
15
+ empty: 728,
24
16
  },
25
17
  })
26
- .methods({
27
- onScrollerResize() {
28
- console.log('onScrollerResize');
29
- // Chrome Bug: When window resizes bottom sticky needs to be recomputed
30
- // Force style recalculation
31
- this.style.setProperty('bottom', 'auto');
32
- // eslint-disable-next-line no-unused-expressions
33
- this.clientHeight;
34
- this.style.removeProperty('bottom');
35
- this.propChangedCallback('scrollListenerPositionY', this.scrollListenerPositionY, this.scrollListenerPositionY);
36
- },
37
- onScrollIdle() {
38
- const max = this.scrollHeight;
39
- const visibility = (max - this._translateY) / max;
40
- if (visibility <= 0) return;
41
- if (visibility >= 1) return;
42
- if (visibility >= 0.5) {
43
- // Reveal all
44
- this._translateY = 0;
45
- this._transition = 'transform 250ms ease-in';
46
- } else {
47
- this._translateY = max;
48
- this._transition = 'transform 200ms ease-out';
49
- }
50
- },
18
+ .set({
19
+ color: 'surface-container',
20
+ _ariaRole: 'navigation',
51
21
  })
22
+ .html`<slot id=slot></slot>`
52
23
  .css`
53
24
  /* https://m3.material.io/components/navigation-bar/specs */
54
25
 
55
26
  :host {
56
- position: sticky;
57
- inset-block-end: 0;
58
- order:1; /* Nav Bars are at top of tab order, but bottom of page */
27
+ --mdw-bg: var(--mdw-color__surface-container);
28
+ --mdw-ink: var(--mdw-color__on-surface);
29
+ display: none;
59
30
 
60
- display: grid;
61
31
  align-content: flex-start;
62
32
  align-items: flex-start;
63
33
  gap: 8px;
34
+
64
35
  grid-auto-columns: minmax(48px, 1fr);
65
36
  grid-auto-flow: column;
66
37
 
@@ -70,54 +41,46 @@ export default Nav
70
41
  min-block-size: 80px;
71
42
  inline-size: 100%;
72
43
 
73
- flex-shrink: 0;
44
+ pointer-events: auto;
45
+
46
+ background-color: rgb(var(--mdw-bg));
74
47
 
75
- transform: translateY(0);
48
+ color: rgb(var(--mdw-ink));
76
49
 
77
- box-shadow: none;
50
+ font: var(--mdw-typescale__label-medium__font);
51
+ letter-spacing: var(--mdw-typescale__label-medium__letter-spacing);
78
52
 
79
53
  text-align: center;
80
-
81
- will-change: transform;
82
54
  }
83
55
 
84
- #slot {
85
- pointer-events: auto;
56
+ :host(:where([open])) {
57
+ display: grid;
86
58
  }
87
-
88
59
  `
89
- .on({
90
- connected() {
91
- if (this.hideOnScroll) {
92
- if (this.offsetParent) {
93
- this.startScrollListener(this.offsetParent ?? window);
94
- } else {
95
- const resizeObserver = new ResizeObserver(() => {
96
- this.startScrollListener(this.offsetParent ?? window);
97
- resizeObserver.disconnect();
98
- });
99
- resizeObserver.observe(this);
100
- }
60
+ .methods({
61
+ onWindowResize() {
62
+ const { autoClose } = this;
63
+ const containerWidth = window.innerWidth;
64
+ this.open = (autoClose === -1 || containerWidth < autoClose);
65
+ },
66
+ })
67
+ .events({
68
+ '~click'(event) {
69
+ // Abort if not child
70
+ if (event.target === this) return;
71
+ if (event.target instanceof NavItem === false) return;
72
+ for (const el of this.querySelectorAll('*')) {
73
+ if (el instanceof NavItem === false) continue;
74
+ el.active = (el === event.target);
101
75
  }
102
76
  },
103
- disconnected() {
104
- this.clearScrollListener();
77
+ })
78
+ .on({
79
+ constructed() {
80
+ window.addEventListener('resize', this.onWindowResize.bind(this));
105
81
  },
106
- scrollListenerPositionYChanged(oldValue, newValue) {
107
- if (!this.hideOnScroll) return;
108
- const delta = newValue - oldValue;
109
- const rate = 1;
110
- const shift = rate * delta;
111
-
112
- const bottom = this.getScrollingElementScrollHeight() - this.getScrollingElementClientHeight();
113
- const breakpoint = bottom - this.scrollHeight;
114
- let max = this.scrollHeight;
115
- if (newValue >= breakpoint) {
116
- // Scrolling to bottom always shows Nav Bar (ensures content isn't occluded)
117
- max -= (newValue - breakpoint);
118
- }
119
- this._transition = 'none';
120
- this._translateY = Math.max(0, Math.min(this._translateY + shift, max));
82
+ connected() {
83
+ this.onWindowResize();
121
84
  },
122
85
  })
123
86
  .autoRegister('mdw-nav-bar');
@@ -1,19 +1,24 @@
1
- import NavRail from './NavRail.js';
1
+ import SideSheet from './SideSheet.js';
2
2
 
3
- export default NavRail
3
+ export default SideSheet
4
4
  .extend()
5
5
  .observe({
6
6
  shapeEnd: {
7
7
  type: 'boolean',
8
8
  empty: true,
9
9
  },
10
+ autoOpen: {
11
+ type: 'float',
12
+ empty: 1248,
13
+ },
14
+ fixedBreakpoint: {
15
+ type: 'float',
16
+ empty: 1248,
17
+ },
10
18
  })
11
19
  .css`
12
20
  /* https://m3.material.io/components/navigation-drawer/specs */
13
-
14
- :host([open]) {
15
- --mdw-surface__tint: var(--mdw-surface__tint__0);
16
- --mdw-surface__tint__raised: var(--mdw-surface__tint__1);
21
+ :host {
17
22
  --mdw-shape__size: var(--mdw-shape__large, 16px);
18
23
  --mdw-shape__size__top-start-size: 0px;
19
24
  --mdw-shape__size__bottom-start-size: 0px;
@@ -26,19 +31,15 @@ export default NavRail
26
31
  --mdw-nav-item__anchor__display: block;
27
32
  --mdw-nav-item__indicator__grid-area: auto;
28
33
 
29
- display: block;
30
- grid-template-rows: min-content;
31
- grid-template-columns: minmax(360px, min-content);
34
+ display:inline-block;
32
35
 
33
- min-inline-size: 360px;
36
+ inline-size: 360px;
37
+ max-inline-size: calc(100vw - 56px);
34
38
  padding-inline: 12px;
35
-
36
- box-shadow: none;
37
-
38
39
  }
39
40
 
40
- #slot {
41
- gap: 0;
41
+ ::slotted(mdw-divider) {
42
+ padding-inline: 16px;
42
43
  }
43
44
 
44
45
  `
@@ -10,7 +10,6 @@ export default NavItem
10
10
  :host {
11
11
  align-self: stretch;
12
12
 
13
- display: grid;
14
13
  display: flex;
15
14
  align-items: center;
16
15
  gap: 12px;
@@ -19,6 +18,8 @@ export default NavItem
19
18
  / 24px 1fr minmax(0, min-content);
20
19
  justify-items: flex-start;
21
20
 
21
+ min-block-size: 56px;
22
+
22
23
  padding-inline: 16px 24px;
23
24
  }
24
25
 
@@ -46,9 +47,7 @@ export default NavItem
46
47
  z-index: 1;
47
48
  }
48
49
  `
49
- .on({
50
- composed({ html }) {
51
- this.refs.badge.replaceWith(html`<span id="badge-text">{badge}</span>`);
52
- },
50
+ .recompose(({ html, refs: { badge } }) => {
51
+ badge.replaceWith(html`<span id="badge-text">{badge}</span>`);
53
52
  })
54
53
  .autoRegister('mdw-nav-drawer-item');
@@ -1,23 +1,25 @@
1
1
  import './Icon.js';
2
2
  import './Ripple.js';
3
3
  import './Badge.js';
4
+ import './Shape.js';
4
5
 
5
6
  import CustomElement from '../core/CustomElement.js';
7
+ import DelegatesFocusMixin from '../mixins/DelegatesFocusMixin.js';
8
+ import HyperlinkMixin from '../mixins/HyperlinkMixin.js';
6
9
  import RippleMixin from '../mixins/RippleMixin.js';
7
- import ShapeMixin from '../mixins/ShapeMixin.js';
8
10
  import StateMixin from '../mixins/StateMixin.js';
9
11
  import ThemableMixin from '../mixins/ThemableMixin.js';
10
12
 
11
13
  /** @typedef {'charset'|'coords'|'name'|'shape'} DeprecatedHTMLAnchorElementProperties */
12
14
 
13
- export default class NavItem extends CustomElement
15
+ export default CustomElement
16
+ .extend()
14
17
  .mixin(ThemableMixin)
15
18
  .mixin(StateMixin)
16
19
  .mixin(RippleMixin)
17
- .mixin(ShapeMixin)
18
- .extend()
20
+ .mixin(HyperlinkMixin)
21
+ .mixin(DelegatesFocusMixin)
19
22
  .set({
20
- delegatesFocus: true,
21
23
  stateLayer: true,
22
24
  })
23
25
  .observe({
@@ -25,38 +27,45 @@ export default class NavItem extends CustomElement
25
27
  active: 'boolean',
26
28
  icon: 'string',
27
29
  src: 'string',
28
- href: 'string',
29
30
  badge: 'string',
30
31
  ariaLabel: 'string', // watch attribute and emit callback
31
32
  })
32
33
  .methods({
33
- focus(options) {
34
- this.refs.anchor.focus(options);
34
+ /** @type {HTMLElement['focus']} */
35
+ focus(...args) {
36
+ this.refs.anchor.focus(...args);
37
+ },
38
+ })
39
+ .expressions({
40
+ _anchorAriaCurrent({ active }) {
41
+ return active ? 'page' : null;
42
+ },
43
+ _anchorAriaLabelledby({ ariaLabel }) {
44
+ return ariaLabel ? null : 'slot';
45
+ },
46
+ _anchorHref({ href }) { return href ?? '#'; },
47
+ iconVariation({ active }) {
48
+ return active ? 'filled' : null;
35
49
  },
36
50
  })
37
- .html/* html */`
38
- <mdw-icon id=icon aria-hidden=true src={src} active={active}>{icon}</mdw-icon>
39
- <a id=anchor
40
- aria-current=${({ active }) => (active ? 'page' : null)}
41
- aria-describedby=badge
42
- aria-label={ariaLabel}
43
- aria-labelledby=${({ ariaLabel }) => (ariaLabel ? null : 'slot')}
44
- href=${({ href }) => href ?? '#'}>
45
- </a>
51
+ .html`
52
+ <mdw-icon id=icon aria-hidden=true src={src} active={active} icon={icon} variation={iconVariation}></mdw-icon>
46
53
  <slot id=slot active={active} show-label={showLabel} aria-hidden=true></slot>
47
54
  <mdw-badge part=badge id=badge badge={badge} show-label={showLabel} aria-hidden=true>{badge}</mdw-badge>
48
55
  `
49
- .on({
50
- composed({ html }) {
51
- const { shape, state, rippleContainer } = this.refs;
52
- shape.append(html`
56
+ .recompose(({ html, refs: { anchor, state, rippleContainer } }) => {
57
+ anchor.setAttribute('aria-current', '{_anchorAriaCurrent}');
58
+ anchor.setAttribute('aria-describedby', 'badge');
59
+ anchor.setAttribute('aria-label', '{ariaLabel}');
60
+ anchor.setAttribute('aria-labelledby', '{_anchorAriaLabelledby}');
61
+ anchor.setAttribute('href', '{_anchorHref}');
62
+ anchor.before(html`
63
+ <mdw-shape id=shape active={active} shape-style=full>
53
64
  <mdw-ripple id=ripple ripple-origin=center keep-alive hold-ripple ripple-state=${({ active }) => ((active) ? null : 'complete')}></mdw-ripple>
54
65
  ${state}
55
66
  ${rippleContainer}
56
- `);
57
- shape.setAttribute('active', '{active}');
58
- shape.removeAttribute('color');
59
- },
67
+ </mdw-shape>
68
+ `);
60
69
  })
61
70
  .css`
62
71
  /* https://m3.material.io/components/navigation-bar/specs */
@@ -71,7 +80,7 @@ export default class NavItem extends CustomElement
71
80
 
72
81
  display: grid;
73
82
  align-content: center;
74
- align-items: center;
83
+ align-items: flex-start;
75
84
  grid-auto-flow: row;
76
85
  grid-auto-rows: minmax(20px, min-content);
77
86
  grid-template-rows: [icon] minmax(32px, 1fr);
@@ -81,12 +90,11 @@ export default class NavItem extends CustomElement
81
90
  row-gap: 4px;
82
91
 
83
92
  box-sizing: border-box;
84
- min-block-size: 56px;
85
93
 
86
94
  padding-inline: 0;
87
95
 
88
96
  cursor: pointer;
89
- /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
97
+
90
98
  user-select: none;
91
99
 
92
100
  font: var(--mdw-typescale__label-large__font);
@@ -132,6 +140,10 @@ export default class NavItem extends CustomElement
132
140
  #anchor {
133
141
  position: absolute;
134
142
  inset: 0;
143
+
144
+ outline: none;
145
+
146
+ z-index: 5;
135
147
  }
136
148
 
137
149
  #shape {
@@ -139,8 +151,14 @@ export default class NavItem extends CustomElement
139
151
  /* stylelint-disable-next-line liberty/use-logical-spec */
140
152
  top: 50%;
141
153
  /* stylelint-disable-next-line liberty/use-logical-spec */
154
+ right: auto;
155
+ /* stylelint-disable-next-line liberty/use-logical-spec */
156
+ bottom: auto;
157
+ /* stylelint-disable-next-line liberty/use-logical-spec */
142
158
  left: 50%;
143
159
 
160
+ overflow: hidden;
161
+
144
162
  block-size: 100%;
145
163
  inline-size: 100%;
146
164
  max-inline-size: 56px;
@@ -149,7 +167,6 @@ export default class NavItem extends CustomElement
149
167
  grid-row: 1 / 1;
150
168
 
151
169
  transform: translateX(-50%) translateY(-50%) translateY(var(--mdw-nav-item__offset-y));
152
- z-index: 0;
153
170
 
154
171
  background-color: transparent;
155
172
 
@@ -169,7 +186,6 @@ export default class NavItem extends CustomElement
169
186
  color: rgb(var(--mdw-color__on-surface-variant));
170
187
 
171
188
  font-size: 24px;
172
- font-variation-settings: 'FILL' 0;
173
189
 
174
190
  transition: transform 200ms;
175
191
  will-change: transform;
@@ -182,8 +198,10 @@ export default class NavItem extends CustomElement
182
198
  #badge {
183
199
  --mdw-badge__scale: 0;
184
200
  position: absolute;
185
- inset-block-start: 50%;
186
- inset-inline-start: 50%;
201
+ /* stylelint-disable-next-line liberty/use-logical-spec */
202
+ top: 50%;
203
+ /* stylelint-disable-next-line liberty/use-logical-spec */
204
+ left: 50%;
187
205
 
188
206
  overflow: hidden;
189
207
 
@@ -225,8 +243,6 @@ export default class NavItem extends CustomElement
225
243
 
226
244
  #icon[active] {
227
245
  color: rgb(var(--mdw-ink));
228
-
229
- font-variation-settings: 'FILL' 1;
230
246
  }
231
247
 
232
248
  #slot[active] {
@@ -254,10 +270,11 @@ export default class NavItem extends CustomElement
254
270
  },
255
271
  },
256
272
  })
257
- .autoRegister('mdw-nav-item')
258
- .tsClassFix() {
259
- addRipple(...args) {
260
- if (!this.active) return null;
261
- return super.addRipple(...args);
262
- }
263
- }
273
+ .extend((Base) => class NavItem extends Base {
274
+ /** @type {InstanceType<ReturnType<RippleMixin>>['addRipple']} */
275
+ addRipple(...args) {
276
+ if (!this.active) return null;
277
+ return super.addRipple(...args);
278
+ }
279
+ })
280
+ .autoRegister('mdw-nav-item');
@@ -1,27 +1,43 @@
1
- import Nav from './Nav.js';
1
+ import SideSheet from './SideSheet.js';
2
2
 
3
- export default Nav
3
+ export default SideSheet
4
4
  .extend()
5
5
  .observe({
6
6
  align: { value: /** @type {'start'|'center'|'end'} */ (null) },
7
- })
8
- .on({
9
- composed({ html }) {
10
- const { slot } = this.refs;
11
- slot.before(html`<slot id=start name=start></slot>`);
12
- slot.setAttribute('align', '{align}');
7
+ autoOpen: {
8
+ type: 'float',
9
+ empty: 728,
10
+ },
11
+ autoClose: {
12
+ type: 'float',
13
+ empty: 1248,
14
+ },
15
+ fixedBreakpoint: {
16
+ type: 'float',
17
+ empty: 728,
13
18
  },
14
19
  })
20
+ .recompose(({ html, refs: { slot } }) => {
21
+ slot.before(html`<slot id=start name=start></slot>`);
22
+ slot.setAttribute('align', '{align}');
23
+ })
15
24
  .css`
16
25
  /* https://m3.material.io/components/navigation-rail/specs */
17
26
 
18
27
  :host{
19
- display: grid;
28
+ align-self: flex-start;
29
+
30
+ display: inline-grid;
20
31
  align-content: flex-start;
21
32
  flex-direction: column;
22
- grid-template-rows: auto minmax(0,1fr);
23
- grid-template-columns: 80px;
33
+ gap:0;
34
+ grid-template-rows: auto minmax(auto,1fr);
35
+ grid-template-columns: 100%;
24
36
  justify-items: stretch;
37
+ overscroll-behavior: none;
38
+ overscroll-behavior: contain;
39
+
40
+ min-block-size: 0;
25
41
 
26
42
  text-align: center;
27
43
  }
@@ -31,9 +47,7 @@ export default Nav
31
47
  align-items: center;
32
48
  flex-direction: column;
33
49
  gap: 12px;
34
-
35
- padding-block-start: 12px;
36
-
50
+ justify-content: center;
37
51
  }
38
52
 
39
53
  #slot {
@@ -43,14 +57,11 @@ export default Nav
43
57
  align-items: stretch;
44
58
  flex-direction: column;
45
59
  gap: 12px;
46
- overflow-x: clip;
47
- overflow-y: auto;
48
60
 
49
61
  box-sizing: border-box;
62
+ max-block-size: 100%;
63
+ inline-size: min-content;
50
64
 
51
- inline-size: 100%;
52
-
53
- padding-block: 12px;
54
65
  }
55
66
 
56
67
  #slot[align="start"] {
@@ -60,6 +71,5 @@ export default Nav
60
71
  #slot[align="end"] {
61
72
  align-self: flex-end;
62
73
  }
63
-
64
74
  `
65
75
  .autoRegister('mdw-nav-rail');
@@ -7,11 +7,16 @@ export default NavItem
7
7
  .css`
8
8
  :host {
9
9
  grid-auto-flow: row;
10
- grid-auto-rows: minmax(20px, min-content);
10
+ grid-auto-rows: minmax(20px, auto);
11
11
  grid-template-rows: [icon] minmax(32px, 1fr);
12
- grid-template-columns: [icon] minmax(56px, 1fr);
12
+ grid-template-columns: [icon] minmax(72px, 1fr);
13
13
 
14
- padding-inline: 12px;
14
+ min-block-size: 56px;
15
+ flex: none;
16
+ padding-inline: 4px;
17
+
18
+ font: var(--mdw-typescale__label-medium__font);
19
+ letter-spacing: var(--mdw-typescale__label-medium__letter-spacing);
15
20
  }
16
21
 
17
22
  #slot {