@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
@@ -1,16 +1,27 @@
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
+ /**
10
+ * Menu items represent selectable options within a menu. They can trigger
11
+ * actions, toggle state, or open nested submenus.
12
+ * @see https://m3.material.io/components/menus/specs
13
+ */
14
+ export default ListOption
9
15
  .extend()
10
16
  .mixin(FormAssociatedMixin)
11
17
  .set({
18
+ /** Timeout handle used to schedule submenu cascade. */
12
19
  _cascadeTimeout: null,
20
+
21
+ /** Milliseconds to delay before opening a cascaded submenu. */
13
22
  CASCADE_TIMEOUT: 500,
23
+
24
+ /** Internal flag indicating a cascade is in progress. */
14
25
  _cascading: false,
15
26
  })
16
27
  .define({
@@ -21,9 +32,13 @@ export default class MenuItem extends ListOption
21
32
  },
22
33
  })
23
34
  .observe({
24
- /** ID of menu to cascade */
35
+ /** ID of the submenu to open when this item cascades. */
25
36
  cascades: 'string',
26
- /** Can be null */
37
+
38
+ /**
39
+ * Backing field for the menu item's value attribute. Can be `null` to
40
+ * indicate no explicit value; reflected to the `value` attribute.
41
+ */
27
42
  _defaultValue: {
28
43
  attr: 'value',
29
44
  reflect: true,
@@ -32,7 +47,10 @@ export default class MenuItem extends ListOption
32
47
  },
33
48
  })
34
49
  .observe({
35
- /** Never returns null */
50
+ /**
51
+ * Non-null string representation of the default value used for form
52
+ * association. Getter never returns null; setter writes to `_defaultValue`.
53
+ */
36
54
  defaultValue: {
37
55
  reflect: false,
38
56
  get() {
@@ -70,12 +88,7 @@ export default class MenuItem extends ListOption
70
88
  const [name, value] = event.detail;
71
89
  if (this.name !== name) return;
72
90
  if (value === this.value) return;
73
- if (this.value === '1') {
74
- console.log('unchecking', this.name, this.value);
75
- this.selected = false;
76
- } else {
77
- this.selected = false;
78
- }
91
+ this.selected = false;
79
92
  },
80
93
  })
81
94
  .expressions({
@@ -121,7 +134,7 @@ export default class MenuItem extends ListOption
121
134
  .events({
122
135
  mouseenter() {
123
136
  if (this.disabledState) return;
124
- if (document.activeElement !== this) {
137
+ if (!isFocused(this)) {
125
138
  this.focus();
126
139
  }
127
140
  if (!this.cascades) return;
@@ -157,7 +170,9 @@ export default class MenuItem extends ListOption
157
170
  if (!this.cascades) break;
158
171
  if (getComputedStyle(this).direction === 'rtl') {
159
172
  if (event.key === 'ArrowRight') break;
160
- } else if (event.key === 'ArrowLeft') break;
173
+ } else if (event.key === 'ArrowLeft') {
174
+ break;
175
+ }
161
176
  event.stopPropagation();
162
177
  event.preventDefault();
163
178
  this.cascade();
@@ -175,33 +190,32 @@ export default class MenuItem extends ListOption
175
190
  this.dispatchEvent(new CustomEvent('mdw-menu-item:cascader-blur', { detail: this.cascades, bubbles: true }));
176
191
  },
177
192
  })
178
- .on({
179
- composed({ inline, html }) {
180
- const { checkbox: checkboxRef, radio: radioRef, anchor, trailing, trailingIcon } = this.refs;
181
- checkboxRef.remove();
182
- radioRef.remove();
193
+ .recompose(({ inline, html, refs: { checkbox: checkboxRef, radio: radioRef, anchor, trailing, trailingIcon } }) => {
194
+ checkboxRef.remove();
195
+ radioRef.remove();
183
196
 
184
- anchor.setAttribute('role', inline(({ checkbox, radio }) => {
185
- if (checkbox != null) return 'menuitemcheckbox';
186
- if (radio != null) return 'menuitemradio';
187
- return 'menuitem';
188
- }));
197
+ anchor.setAttribute('role', inline(({ checkbox, radio }) => {
198
+ if (checkbox != null) return 'menuitemcheckbox';
199
+ if (radio != null) return 'menuitemradio';
200
+ return 'menuitem';
201
+ }));
189
202
 
190
- // MenuItems use checked instead of selected as in list items.
191
- anchor.setAttribute('ariaChecked', anchor.getAttribute('aria-selected'));
203
+ // MenuItems use checked instead of selected as in list items.
204
+ anchor.setAttribute('ariaChecked', anchor.getAttribute('aria-selected'));
192
205
 
193
- anchor.after(html`
194
- <mdw-icon id=selection
195
- mdw-if=${({ checkbox, radio }) => checkbox ?? radio ?? false}
196
- class=${({ checkbox, radio }) => checkbox || radio || 'leading'}
197
- selected={selected}>check</mdw-icon>
198
- `);
206
+ anchor.after(html`
207
+ <mdw-icon id=selection
208
+ mdw-if=${({ checkbox, radio }) => checkbox ?? radio ?? false}
209
+ class=${({ checkbox, radio }) => checkbox || radio || 'leading'}
210
+ selected={selected} icon=check></mdw-icon>
211
+ `);
199
212
 
200
- trailing.setAttribute('type-style', 'label-large');
213
+ trailing.setAttribute('type-style', 'label-large');
201
214
 
202
- trailingIcon.setAttribute('mdw-if', '{computeTrailingIcon}');
203
- trailingIcon.textContent = '{computeTrailingIcon}';
204
- },
215
+ trailingIcon.setAttribute('mdw-if', '{computeTrailingIcon}');
216
+ trailingIcon.setAttribute('icon', '{computeTrailingIcon}');
217
+ })
218
+ .on({
205
219
  _formResetChanged(oldValue, newValue) {
206
220
  if (!newValue) return;
207
221
  this._selected = this.defaultSelected;
@@ -262,5 +276,4 @@ export default class MenuItem extends ListOption
262
276
  color: inherit;
263
277
  }
264
278
  `
265
- .autoRegister('mdw-menu-item')
266
- .tsClassFix() {}
279
+ .autoRegister('mdw-menu-item');
@@ -1,29 +1,48 @@
1
- import SemiStickyMixin from '../mixins/SemiStickyMixin.js';
1
+ import CustomElement from '../core/CustomElement.js';
2
+ import DelegatesFocusMixin from '../mixins/DelegatesFocusMixin.js';
3
+ import ThemableMixin from '../mixins/ThemableMixin.js';
2
4
 
3
- import Nav from './Nav.js';
5
+ import NavItem from './NavItem.js';
4
6
 
5
- export default Nav
7
+ /**
8
+ * Navigation bars let people switch between UI views on smaller devices
9
+ * @see https://m3.material.io/components/navigation-bar/specs
10
+ */
11
+ export default CustomElement
6
12
  .extend()
7
- .mixin(SemiStickyMixin)
13
+ .mixin(DelegatesFocusMixin)
14
+ .mixin(ThemableMixin)
8
15
  .observe({
9
- _semiStickyAnchor: { empty: 'bottom' },
16
+ /** When true, the navigation bar is expanded and visible on small viewports. */
17
+ open: 'boolean',
18
+
19
+ /**
20
+ * Pixel threshold for auto-closing the nav bar based on viewport width.
21
+ * A value of `-1` disables auto-close. Default: 728.
22
+ */
23
+ autoClose: {
24
+ type: 'float',
25
+ empty: 728,
26
+ },
10
27
  })
11
- .css`
12
- /* https://m3.material.io/components/navigation-bar/specs */
28
+ .set({
29
+ /** Color token used for the nav surface (defaults to `surface-container`). */
30
+ color: 'surface-container',
13
31
 
32
+ /** ARIA role applied to the host element (default: 'navigation'). */
33
+ _ariaRole: 'navigation',
34
+ })
35
+ .html`<slot id=slot></slot>`
36
+ .css`
14
37
  :host {
15
38
  --mdw-bg: var(--mdw-color__surface-container);
16
-
17
- position: sticky;
18
- inset-block-end: 0;
19
- order:1; /* Nav Bars are at top of tab order, but bottom of page */
39
+ --mdw-ink: var(--mdw-color__on-surface);
40
+ display: none;
20
41
 
21
- display: grid;
22
42
  align-content: flex-start;
23
43
  align-items: flex-start;
24
44
  gap: 8px;
25
45
 
26
- grid-area: nav-bar;
27
46
  grid-auto-columns: minmax(48px, 1fr);
28
47
  grid-auto-flow: column;
29
48
 
@@ -33,20 +52,46 @@ export default Nav
33
52
  min-block-size: 80px;
34
53
  inline-size: 100%;
35
54
 
36
- flex-shrink: 0;
55
+ pointer-events: auto;
37
56
 
38
- transform: translateY(0);
57
+ background-color: rgb(var(--mdw-bg));
39
58
 
40
- box-shadow: none;
59
+ color: rgb(var(--mdw-ink));
41
60
 
42
- text-align: center;
61
+ font: var(--mdw-typescale__label-medium__font);
62
+ letter-spacing: var(--mdw-typescale__label-medium__letter-spacing);
43
63
 
44
- will-change: transform;
64
+ text-align: center;
45
65
  }
46
66
 
47
- #slot {
48
- pointer-events: auto;
67
+ :host(:where([open])) {
68
+ display: grid;
49
69
  }
50
-
51
70
  `
71
+ .methods({
72
+ onWindowResize() {
73
+ const { autoClose } = this;
74
+ const containerWidth = window.innerWidth;
75
+ this.open = (autoClose === -1 || containerWidth < autoClose);
76
+ },
77
+ })
78
+ .events({
79
+ '~click'(event) {
80
+ // Abort if not child
81
+ if (event.target === this) return;
82
+ if (event.target instanceof NavItem === false) return;
83
+ for (const el of this.querySelectorAll('*')) {
84
+ if (el instanceof NavItem === false) continue;
85
+ /** @type {InstanceType<typeof NavItem>} */ (el).active = (el === event.target);
86
+ }
87
+ },
88
+ })
89
+ .on({
90
+ constructed() {
91
+ window.addEventListener('resize', this.onWindowResize.bind(this));
92
+ },
93
+ connected() {
94
+ this.onWindowResize();
95
+ },
96
+ })
52
97
  .autoRegister('mdw-nav-bar');
@@ -1,5 +1,10 @@
1
1
  import NavItem from './NavItem.js';
2
2
 
3
+ /**
4
+ * A navigation bar item represents a destination within a navigation bar,
5
+ * providing an icon and optional label to help users move between app sections.
6
+ * @see https://m3.material.io/components/navigation-bar/specs
7
+ */
3
8
  export default NavItem
4
9
  .extend()
5
10
  .css`
@@ -1,18 +1,44 @@
1
- import NavRail from './NavRail.js';
2
-
3
- export default NavRail
1
+ import SideSheet from './SideSheet.js';
2
+
3
+ /**
4
+ * Navigation drawers provide access to destinations and app-level navigation
5
+ * in a side panel. They can be modal, dismissible, or permanent depending on
6
+ * viewport and application needs.
7
+ * @see https://m3.material.io/components/navigation-drawer/specs
8
+ */
9
+ export default SideSheet
4
10
  .extend()
5
11
  .observe({
12
+ /** When true, apply drawer shape at the end edge (RTL-aware). */
6
13
  shapeEnd: {
7
14
  type: 'boolean',
8
15
  empty: true,
9
16
  },
17
+
18
+ /**
19
+ * Viewport width in pixels at or above which the drawer auto-opens.
20
+ * Use `-1` to disable auto-open. Default: 1248.
21
+ */
22
+ autoOpen: {
23
+ type: 'float',
24
+ empty: 1248,
25
+ },
26
+
27
+ /**
28
+ * Fixed layout breakpoint in pixels for permanent/dismissible drawer modes.
29
+ * Default: 1248.
30
+ */
31
+ fixedBreakpoint: {
32
+ type: 'float',
33
+ empty: 1248,
34
+ },
10
35
  })
11
36
  .css`
12
37
  /* https://m3.material.io/components/navigation-drawer/specs */
13
38
  :host {
14
39
  --mdw-shape__size: var(--mdw-shape__large, 16px);
15
40
  --mdw-shape__size__top-start-size: 0px;
41
+ --mdw-shape__size__bottom-start-size: 0px;
16
42
 
17
43
  --mdw-nav-item__badge__position: static;
18
44
  --mdw-nav-item__badge__transform: none;
@@ -21,25 +47,16 @@ export default NavRail
21
47
  --mdw-nav-item__label__padding-inline: 52px 0;
22
48
  --mdw-nav-item__anchor__display: block;
23
49
  --mdw-nav-item__indicator__grid-area: auto;
24
- --mdw-bg: var(--mdw-color__surface-container-low);
25
50
 
26
- display: grid;
27
- grid-template-columns: 1fr;
51
+ display:inline-block;
28
52
 
29
- min-block-size: 100vh;
30
- max-block-size: 100vh;
31
53
  inline-size: 360px;
32
54
  max-inline-size: calc(100vw - 56px);
33
- padding-inline: 0;
34
-
35
- box-shadow: none;
55
+ padding-inline: 12px;
36
56
  }
37
57
 
38
- #slot {
39
- gap: 0;
40
-
41
- inline-size: auto;
42
- padding-inline: 12px;
58
+ ::slotted(mdw-divider) {
59
+ padding-inline: 16px;
43
60
  }
44
61
 
45
62
  `
@@ -1,5 +1,10 @@
1
1
  import NavItem from './NavItem.js';
2
2
 
3
+ /**
4
+ * A navigation drawer item represents a destination inside a navigation drawer,
5
+ * showing an icon, label, and optional badge to help users navigate app sections.
6
+ * @see https://m3.material.io/components/navigation-drawer/specs
7
+ */
3
8
  export default NavItem
4
9
  .extend()
5
10
  .css`
@@ -47,9 +52,7 @@ export default NavItem
47
52
  z-index: 1;
48
53
  }
49
54
  `
50
- .on({
51
- composed({ html }) {
52
- this.refs.badge.replaceWith(html`<span id="badge-text">{badge}</span>`);
53
- },
55
+ .recompose(({ html, refs: { badge } }) => {
56
+ badge.replaceWith(html`<span id="badge-text">{badge}</span>`);
54
57
  })
55
58
  .autoRegister('mdw-nav-drawer-item');
@@ -1,63 +1,86 @@
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
+ /**
16
+ * A navigation item represents a single destination used by navigation bars,
17
+ * navigation drawers, and navigation rails. It provides an icon, optional
18
+ * label, and optional badge to help users move between app sections.
19
+ * @see https://m3.material.io/components/navigation-bar/specs
20
+ * @see https://m3.material.io/components/navigation-drawer/specs
21
+ * @see https://m3.material.io/components/navigation-rail/specs
22
+ */
23
+ export default CustomElement
14
24
  .extend()
15
25
  .mixin(ThemableMixin)
16
26
  .mixin(StateMixin)
17
27
  .mixin(RippleMixin)
18
- .mixin(ShapeMixin)
28
+ .mixin(HyperlinkMixin)
29
+ .mixin(DelegatesFocusMixin)
19
30
  .set({
20
- delegatesFocus: true,
21
31
  stateLayer: true,
22
32
  })
23
33
  .observe({
34
+ /** Whether the label slot is visible. When true the label is shown. */
24
35
  showLabel: 'string',
36
+ /** Whether the item is active/selected; affects styling and aria-current. */
25
37
  active: 'boolean',
38
+ /** Name of the icon to display (e.g. 'home'); ignored when `src` is provided. */
26
39
  icon: 'string',
40
+ /** URL of an icon image; takes precedence over `icon` when present. */
27
41
  src: 'string',
28
- href: 'string',
42
+ /** Badge content to display on the item (e.g. notification count). */
29
43
  badge: 'string',
44
+ /** Accessible label for the anchor; when present it is used instead of the slot text. */
30
45
  ariaLabel: 'string', // watch attribute and emit callback
31
46
  })
32
47
  .methods({
48
+ /** Focus the internal anchor element. */
33
49
  /** @type {HTMLElement['focus']} */
34
50
  focus(...args) {
35
51
  this.refs.anchor.focus(...args);
36
52
  },
37
53
  })
54
+ .expressions({
55
+ _anchorAriaCurrent({ active }) {
56
+ return active ? 'page' : null;
57
+ },
58
+ _anchorAriaLabelledby({ ariaLabel }) {
59
+ return ariaLabel ? null : 'slot';
60
+ },
61
+ _anchorHref({ href }) { return href ?? '#'; },
62
+ iconVariation({ active }) {
63
+ return active ? 'filled' : null;
64
+ },
65
+ })
38
66
  .html`
39
- <mdw-icon id=icon aria-hidden=true src={src} active={active}>{icon}</mdw-icon>
40
- <a id=anchor
41
- aria-current=${({ active }) => (active ? 'page' : null)}
42
- aria-describedby=badge
43
- aria-label={ariaLabel}
44
- aria-labelledby=${({ ariaLabel }) => (ariaLabel ? null : 'slot')}
45
- href=${({ href }) => href ?? '#'}>
46
- </a>
67
+ <mdw-icon id=icon aria-hidden=true src={src} active={active} icon={icon} variation={iconVariation}></mdw-icon>
47
68
  <slot id=slot active={active} show-label={showLabel} aria-hidden=true></slot>
48
69
  <mdw-badge part=badge id=badge badge={badge} show-label={showLabel} aria-hidden=true>{badge}</mdw-badge>
49
70
  `
50
- .on({
51
- composed({ html }) {
52
- const { shape, state, rippleContainer } = this.refs;
53
- shape.append(html`
71
+ .recompose(({ html, refs: { anchor, state, rippleContainer } }) => {
72
+ anchor.setAttribute('aria-current', '{_anchorAriaCurrent}');
73
+ anchor.setAttribute('aria-describedby', 'badge');
74
+ anchor.setAttribute('aria-label', '{ariaLabel}');
75
+ anchor.setAttribute('aria-labelledby', '{_anchorAriaLabelledby}');
76
+ anchor.setAttribute('href', '{_anchorHref}');
77
+ anchor.before(html`
78
+ <mdw-shape id=shape active={active} shape-style=full>
54
79
  <mdw-ripple id=ripple ripple-origin=center keep-alive hold-ripple ripple-state=${({ active }) => ((active) ? null : 'complete')}></mdw-ripple>
55
80
  ${state}
56
81
  ${rippleContainer}
57
- `);
58
- shape.setAttribute('active', '{active}');
59
- shape.removeAttribute('color');
60
- },
82
+ </mdw-shape>
83
+ `);
61
84
  })
62
85
  .css`
63
86
  /* https://m3.material.io/components/navigation-bar/specs */
@@ -86,7 +109,7 @@ export default class NavItem extends CustomElement
86
109
  padding-inline: 0;
87
110
 
88
111
  cursor: pointer;
89
- /* stylelint-disable-next-line plugin/no-unsupported-browser-features */
112
+
90
113
  user-select: none;
91
114
 
92
115
  font: var(--mdw-typescale__label-large__font);
@@ -149,6 +172,8 @@ export default class NavItem extends CustomElement
149
172
  /* stylelint-disable-next-line liberty/use-logical-spec */
150
173
  left: 50%;
151
174
 
175
+ overflow: hidden;
176
+
152
177
  block-size: 100%;
153
178
  inline-size: 100%;
154
179
  max-inline-size: 56px;
@@ -157,7 +182,6 @@ export default class NavItem extends CustomElement
157
182
  grid-row: 1 / 1;
158
183
 
159
184
  transform: translateX(-50%) translateY(-50%) translateY(var(--mdw-nav-item__offset-y));
160
- z-index: 0;
161
185
 
162
186
  background-color: transparent;
163
187
 
@@ -177,7 +201,6 @@ export default class NavItem extends CustomElement
177
201
  color: rgb(var(--mdw-color__on-surface-variant));
178
202
 
179
203
  font-size: 24px;
180
- font-variation-settings: 'FILL' 0;
181
204
 
182
205
  transition: transform 200ms;
183
206
  will-change: transform;
@@ -235,8 +258,6 @@ export default class NavItem extends CustomElement
235
258
 
236
259
  #icon[active] {
237
260
  color: rgb(var(--mdw-ink));
238
-
239
- font-variation-settings: 'FILL' 1;
240
261
  }
241
262
 
242
263
  #slot[active] {
@@ -259,15 +280,21 @@ export default class NavItem extends CustomElement
259
280
  },
260
281
  keydown({ key, repeat }) {
261
282
  if (key !== ' ') return true;
262
- if (!repeat) this.click();
283
+ if (!repeat) {
284
+ this.click();
285
+ }
263
286
  return false;
264
287
  },
265
288
  },
266
289
  })
267
- .autoRegister('mdw-nav-item')
268
- .tsClassFix() {
269
- addRipple(...args) {
270
- if (!this.active) return null;
271
- return super.addRipple(...args);
272
- }
273
- }
290
+ .extend((Base) => class NavItem extends Base {
291
+ /**
292
+ * Add a ripple effect only when the item is active.
293
+ * @type {InstanceType<ReturnType<RippleMixin>>['addRipple']}
294
+ */
295
+ addRipple(...args) {
296
+ if (!this.active) return null;
297
+ return super.addRipple(...args);
298
+ }
299
+ })
300
+ .autoRegister('mdw-nav-item');
@@ -1,39 +1,52 @@
1
- import Nav from './Nav.js';
1
+ import SideSheet from './SideSheet.js';
2
2
 
3
- export default Nav
3
+ /**
4
+ * Navigation rails provide access to app destinations and destinations-level
5
+ * navigation in a vertical rail, suited for larger screens and desktop layouts.
6
+ * @see https://m3.material.io/components/navigation-rail/specs
7
+ */
8
+ export default SideSheet
4
9
  .extend()
5
10
  .observe({
11
+ /** Horizontal alignment for rail content: 'start', 'center', or 'end'. */
6
12
  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}');
13
+ /** Viewport width (pixels) threshold at or above which the rail will auto-open. */
14
+ autoOpen: {
15
+ type: 'float',
16
+ empty: 728,
17
+ },
18
+ /** Viewport width (pixels) threshold at or below which the rail will auto-close. */
19
+ autoClose: {
20
+ type: 'float',
21
+ empty: 1248,
22
+ },
23
+ /** Viewport width (pixels) at which the rail becomes fixed (non-collapsible). */
24
+ fixedBreakpoint: {
25
+ type: 'float',
26
+ empty: 728,
13
27
  },
14
28
  })
29
+ .recompose(({ html, refs: { slot } }) => {
30
+ slot.before(html`<slot id=start name=start></slot>`);
31
+ slot.setAttribute('align', '{align}');
32
+ })
15
33
  .css`
16
34
  /* https://m3.material.io/components/navigation-rail/specs */
17
35
 
18
36
  :host{
19
- position: relative;
20
-
21
- inset-block-start: 0;
22
- inset-inline-start: 0;
23
37
  align-self: flex-start;
24
38
 
25
- display: grid;
39
+ display: inline-grid;
26
40
  align-content: flex-start;
27
41
  flex-direction: column;
28
42
  gap:0;
29
- grid-template-rows: auto minmax(0,1fr);
43
+ grid-template-rows: auto minmax(auto,1fr);
30
44
  grid-template-columns: 100%;
31
45
  justify-items: stretch;
46
+ overscroll-behavior: none;
47
+ overscroll-behavior: contain;
32
48
 
33
- min-block-size: 100vh;
34
- max-block-size: 100vh;
35
- min-inline-size: 80px;
36
- max-inline-size: 80px;
49
+ min-block-size: 0;
37
50
 
38
51
  text-align: center;
39
52
  }
@@ -43,6 +56,7 @@ export default Nav
43
56
  align-items: center;
44
57
  flex-direction: column;
45
58
  gap: 12px;
59
+ justify-content: center;
46
60
  }
47
61
 
48
62
  #slot {
@@ -52,8 +66,6 @@ export default Nav
52
66
  align-items: stretch;
53
67
  flex-direction: column;
54
68
  gap: 12px;
55
- overflow-x: clip;
56
- overflow-y: auto;
57
69
 
58
70
  box-sizing: border-box;
59
71
  max-block-size: 100%;
@@ -68,6 +80,5 @@ export default Nav
68
80
  #slot[align="end"] {
69
81
  align-self: flex-end;
70
82
  }
71
-
72
83
  `
73
84
  .autoRegister('mdw-nav-rail');
@@ -2,6 +2,11 @@
2
2
 
3
3
  import NavItem from './NavItem.js';
4
4
 
5
+ /**
6
+ * A navigation rail item represents a destination within a navigation rail,
7
+ * showing an icon and optional label for vertical navigation on larger screens.
8
+ * @see https://m3.material.io/components/navigation-rail/specs
9
+ */
5
10
  export default NavItem
6
11
  .extend()
7
12
  .css`
@@ -9,11 +14,14 @@ export default NavItem
9
14
  grid-auto-flow: row;
10
15
  grid-auto-rows: minmax(20px, auto);
11
16
  grid-template-rows: [icon] minmax(32px, 1fr);
12
- grid-template-columns: [icon] minmax(56px, 1fr);
17
+ grid-template-columns: [icon] minmax(72px, 1fr);
13
18
 
14
19
  min-block-size: 56px;
15
20
  flex: none;
16
- padding-inline: 12px;
21
+ padding-inline: 4px;
22
+
23
+ font: var(--mdw-typescale__label-medium__font);
24
+ letter-spacing: var(--mdw-typescale__label-medium__letter-spacing);
17
25
  }
18
26
 
19
27
  #slot {