@shortfuse/materialdesignweb 0.8.0 → 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 (394) hide show
  1. package/README.md +32 -24
  2. package/bin/mdw-css.js +1 -1
  3. package/components/Badge.js +12 -5
  4. package/components/Body.js +3 -0
  5. package/components/BottomAppBar.js +1 -8
  6. package/components/BottomSheet.js +424 -0
  7. package/components/Box.js +11 -49
  8. package/components/Button.js +61 -82
  9. package/components/Card.js +56 -61
  10. package/components/Checkbox.js +7 -25
  11. package/components/CheckboxIcon.js +10 -28
  12. package/components/Chip.js +13 -11
  13. package/components/Dialog.js +49 -98
  14. package/components/Display.js +55 -0
  15. package/components/Fab.js +83 -17
  16. package/components/FabContainer.js +48 -0
  17. package/components/FilterChip.js +34 -32
  18. package/components/Grid.js +176 -0
  19. package/components/Headline.js +5 -28
  20. package/components/Icon.js +54 -69
  21. package/components/IconButton.js +71 -120
  22. package/components/Input.js +669 -83
  23. package/components/InputChip.js +161 -0
  24. package/components/Label.js +3 -0
  25. package/components/List.js +1 -5
  26. package/components/ListItem.js +39 -23
  27. package/components/ListOption.js +79 -62
  28. package/components/Listbox.js +19 -10
  29. package/components/Menu.js +8 -18
  30. package/components/MenuItem.js +25 -26
  31. package/components/NavBar.js +53 -19
  32. package/components/NavDrawer.js +15 -15
  33. package/components/NavDrawerItem.js +2 -4
  34. package/components/NavItem.js +40 -33
  35. package/components/NavRail.js +23 -21
  36. package/components/NavRailItem.js +5 -2
  37. package/components/Page.js +105 -0
  38. package/components/Pane.js +18 -0
  39. package/components/Popup.js +17 -8
  40. package/components/Radio.js +2 -5
  41. package/components/RadioIcon.js +10 -14
  42. package/components/Ripple.js +11 -7
  43. package/components/Root.js +209 -0
  44. package/components/Scrim.js +87 -0
  45. package/components/Search.js +12 -20
  46. package/components/SegmentedButton.js +33 -36
  47. package/components/SegmentedButtonGroup.js +9 -3
  48. package/components/Select.js +6 -7
  49. package/components/Shape.js +5 -65
  50. package/components/SideSheet.js +308 -0
  51. package/components/Slider.js +71 -34
  52. package/components/Snackbar.js +22 -16
  53. package/components/SnackbarContainer.js +42 -0
  54. package/components/Surface.js +15 -10
  55. package/components/Switch.js +3 -16
  56. package/components/SwitchIcon.js +40 -32
  57. package/components/Tab.js +57 -38
  58. package/components/TabContent.js +1 -0
  59. package/components/TabList.js +60 -32
  60. package/components/TabPanel.js +1 -1
  61. package/components/Table.js +116 -0
  62. package/components/TextArea.js +16 -15
  63. package/components/Title.js +4 -9
  64. package/components/Tooltip.js +43 -21
  65. package/components/TopAppBar.js +56 -78
  66. package/constants/shapes.js +36 -0
  67. package/constants/typography.js +127 -0
  68. package/core/Composition.js +354 -192
  69. package/core/CompositionAdapter.js +11 -12
  70. package/core/CustomElement.js +588 -236
  71. package/core/css.js +117 -12
  72. package/core/customTypes.js +120 -25
  73. package/core/dom.js +17 -11
  74. package/core/jsonMergePatch.js +12 -10
  75. package/core/observe.js +298 -253
  76. package/core/optimizations.js +9 -9
  77. package/core/template.js +14 -57
  78. package/dist/index.min.js +85 -115
  79. package/dist/index.min.js.map +4 -4
  80. package/dist/meta.json +1 -1
  81. package/dom/HTMLOptionsCollectionProxy.js +106 -0
  82. package/{theming/themableMixinLoader.js → loaders/palette.js} +4 -3
  83. package/loaders/theme.js +12 -0
  84. package/mixins/AriaReflectorMixin.js +53 -13
  85. package/mixins/AriaToolbarMixin.js +3 -0
  86. package/mixins/ControlMixin.js +76 -33
  87. package/mixins/DelegatesFocusMixin.js +54 -0
  88. package/mixins/DensityMixin.js +2 -2
  89. package/mixins/ElevationMixin.js +62 -0
  90. package/mixins/FlexableMixin.js +66 -37
  91. package/mixins/FormAssociatedMixin.js +60 -8
  92. package/mixins/HyperlinkMixin.js +66 -0
  93. package/mixins/InputMixin.js +205 -32
  94. package/mixins/KeyboardNavMixin.js +8 -6
  95. package/mixins/NavigationListenerMixin.js +33 -0
  96. package/mixins/PopupMixin.js +176 -208
  97. package/mixins/ResizeObserverMixin.js +16 -4
  98. package/mixins/RippleMixin.js +8 -6
  99. package/mixins/ScrollListenerMixin.js +1 -1
  100. package/mixins/SemiStickyMixin.js +44 -98
  101. package/mixins/ShapeMaskedMixin.js +117 -0
  102. package/mixins/ShapeMixin.js +22 -204
  103. package/mixins/StateMixin.js +70 -34
  104. package/mixins/TextFieldMixin.js +107 -143
  105. package/mixins/ThemableMixin.js +44 -56
  106. package/mixins/TooltipTriggerMixin.js +291 -359
  107. package/mixins/TouchTargetMixin.js +1 -1
  108. package/mixins/TypographyMixin.js +121 -0
  109. package/package.json +110 -74
  110. package/services/rtl.js +10 -0
  111. package/services/svgAlias.js +17 -0
  112. package/{theming/index.js → services/theme.js} +24 -174
  113. package/types/bin/mdw-css.d.ts +3 -0
  114. package/types/bin/mdw-css.d.ts.map +1 -0
  115. package/types/components/Badge.d.ts +39 -0
  116. package/types/components/Badge.d.ts.map +1 -0
  117. package/types/components/Body.d.ts +29 -0
  118. package/types/components/Body.d.ts.map +1 -0
  119. package/types/components/BottomAppBar.d.ts +73 -0
  120. package/types/components/BottomAppBar.d.ts.map +1 -0
  121. package/types/components/BottomSheet.d.ts +109 -0
  122. package/types/components/BottomSheet.d.ts.map +1 -0
  123. package/types/components/Box.d.ts +16 -0
  124. package/types/components/Box.d.ts.map +1 -0
  125. package/types/components/Button.d.ts +714 -0
  126. package/types/components/Button.d.ts.map +1 -0
  127. package/types/components/Card.d.ts +412 -0
  128. package/types/components/Card.d.ts.map +1 -0
  129. package/types/components/Checkbox.d.ts +205 -0
  130. package/types/components/Checkbox.d.ts.map +1 -0
  131. package/types/components/CheckboxIcon.d.ts +44 -0
  132. package/types/components/CheckboxIcon.d.ts.map +1 -0
  133. package/types/components/Chip.d.ts +1425 -0
  134. package/types/components/Chip.d.ts.map +1 -0
  135. package/types/components/Dialog.d.ts +286 -0
  136. package/types/components/Dialog.d.ts.map +1 -0
  137. package/types/components/DialogActions.d.ts +4 -0
  138. package/types/components/DialogActions.d.ts.map +1 -0
  139. package/types/components/Display.d.ts +45 -0
  140. package/types/components/Display.d.ts.map +1 -0
  141. package/types/components/Divider.d.ts +10 -0
  142. package/types/components/Divider.d.ts.map +1 -0
  143. package/types/components/Fab.d.ts +741 -0
  144. package/types/components/Fab.d.ts.map +1 -0
  145. package/types/components/FabContainer.d.ts +10 -0
  146. package/types/components/FabContainer.d.ts.map +1 -0
  147. package/types/components/FilterChip.d.ts +4283 -0
  148. package/types/components/FilterChip.d.ts.map +1 -0
  149. package/types/components/Grid.d.ts +37 -0
  150. package/types/components/Grid.d.ts.map +1 -0
  151. package/types/components/Headline.d.ts +47 -0
  152. package/types/components/Headline.d.ts.map +1 -0
  153. package/types/components/Icon.d.ts +103 -0
  154. package/types/components/Icon.d.ts.map +1 -0
  155. package/types/components/IconButton.d.ts +1486 -0
  156. package/types/components/IconButton.d.ts.map +1 -0
  157. package/types/components/Input.d.ts +51288 -0
  158. package/types/components/Input.d.ts.map +1 -0
  159. package/types/components/InputChip.d.ts +243 -0
  160. package/types/components/InputChip.d.ts.map +1 -0
  161. package/types/components/Label.d.ts +29 -0
  162. package/types/components/Label.d.ts.map +1 -0
  163. package/types/components/List.d.ts +31 -0
  164. package/types/components/List.d.ts.map +1 -0
  165. package/types/components/ListItem.d.ts +349 -0
  166. package/types/components/ListItem.d.ts.map +1 -0
  167. package/types/components/ListOption.d.ts +1493 -0
  168. package/types/components/ListOption.d.ts.map +1 -0
  169. package/types/components/Listbox.d.ts +12012 -0
  170. package/types/components/Listbox.d.ts.map +1 -0
  171. package/types/components/Menu.d.ts +119 -0
  172. package/types/components/Menu.d.ts.map +1 -0
  173. package/types/components/MenuItem.d.ts +3109 -0
  174. package/types/components/MenuItem.d.ts.map +1 -0
  175. package/types/components/NavBar.d.ts +18 -0
  176. package/types/components/NavBar.d.ts.map +1 -0
  177. package/types/components/NavBarItem.d.ts +186 -0
  178. package/types/components/NavBarItem.d.ts.map +1 -0
  179. package/types/components/NavDrawer.d.ts +108 -0
  180. package/types/components/NavDrawer.d.ts.map +1 -0
  181. package/types/components/NavDrawerItem.d.ts +186 -0
  182. package/types/components/NavDrawerItem.d.ts.map +1 -0
  183. package/types/components/NavItem.d.ts +190 -0
  184. package/types/components/NavItem.d.ts.map +1 -0
  185. package/types/components/NavRail.d.ts +109 -0
  186. package/types/components/NavRail.d.ts.map +1 -0
  187. package/types/components/NavRailItem.d.ts +186 -0
  188. package/types/components/NavRailItem.d.ts.map +1 -0
  189. package/types/components/Page.d.ts +24 -0
  190. package/types/components/Page.d.ts.map +1 -0
  191. package/types/components/Pane.d.ts +44 -0
  192. package/types/components/Pane.d.ts.map +1 -0
  193. package/types/components/Popup.d.ts +76 -0
  194. package/types/components/Popup.d.ts.map +1 -0
  195. package/types/components/Progress.d.ts +19 -0
  196. package/types/components/Progress.d.ts.map +1 -0
  197. package/types/components/Radio.d.ts +199 -0
  198. package/types/components/Radio.d.ts.map +1 -0
  199. package/types/components/RadioIcon.d.ts +46 -0
  200. package/types/components/RadioIcon.d.ts.map +1 -0
  201. package/types/components/Ripple.d.ts +34 -0
  202. package/types/components/Ripple.d.ts.map +1 -0
  203. package/types/components/Root.d.ts +68 -0
  204. package/types/components/Root.d.ts.map +1 -0
  205. package/types/components/Scrim.d.ts +6 -0
  206. package/types/components/Scrim.d.ts.map +1 -0
  207. package/types/components/Search.d.ts +16 -0
  208. package/types/components/Search.d.ts.map +1 -0
  209. package/types/components/SegmentedButton.d.ts +718 -0
  210. package/types/components/SegmentedButton.d.ts.map +1 -0
  211. package/types/components/SegmentedButtonGroup.d.ts +44 -0
  212. package/types/components/SegmentedButtonGroup.d.ts.map +1 -0
  213. package/types/components/Select.d.ts +1361 -0
  214. package/types/components/Select.d.ts.map +1 -0
  215. package/types/components/Shape.d.ts +10 -0
  216. package/types/components/Shape.d.ts.map +1 -0
  217. package/types/components/SideSheet.d.ts +106 -0
  218. package/types/components/SideSheet.d.ts.map +1 -0
  219. package/types/components/Slider.d.ts +382 -0
  220. package/types/components/Slider.d.ts.map +1 -0
  221. package/types/components/Snackbar.d.ts +65 -0
  222. package/types/components/Snackbar.d.ts.map +1 -0
  223. package/types/components/SnackbarContainer.d.ts +6 -0
  224. package/types/components/SnackbarContainer.d.ts.map +1 -0
  225. package/types/components/Surface.d.ts +45 -0
  226. package/types/components/Surface.d.ts.map +1 -0
  227. package/types/components/Switch.d.ts +183 -0
  228. package/types/components/Switch.d.ts.map +1 -0
  229. package/types/components/SwitchIcon.d.ts +169 -0
  230. package/types/components/SwitchIcon.d.ts.map +1 -0
  231. package/types/components/Tab.d.ts +879 -0
  232. package/types/components/Tab.d.ts.map +1 -0
  233. package/types/components/TabContent.d.ts +122 -0
  234. package/types/components/TabContent.d.ts.map +1 -0
  235. package/types/components/TabList.d.ts +6266 -0
  236. package/types/components/TabList.d.ts.map +1 -0
  237. package/types/components/TabPanel.d.ts +28 -0
  238. package/types/components/TabPanel.d.ts.map +1 -0
  239. package/types/components/Table.d.ts +2 -0
  240. package/types/components/Table.d.ts.map +1 -0
  241. package/types/components/TextArea.d.ts +1394 -0
  242. package/types/components/TextArea.d.ts.map +1 -0
  243. package/types/components/Title.d.ts +47 -0
  244. package/types/components/Title.d.ts.map +1 -0
  245. package/types/components/Tooltip.d.ts +49 -0
  246. package/types/components/Tooltip.d.ts.map +1 -0
  247. package/types/components/TopAppBar.d.ts +130 -0
  248. package/types/components/TopAppBar.d.ts.map +1 -0
  249. package/types/constants/colorKeywords.d.ts +2 -0
  250. package/types/constants/colorKeywords.d.ts.map +1 -0
  251. package/types/constants/shapes.d.ts +38 -0
  252. package/types/constants/shapes.d.ts.map +1 -0
  253. package/types/constants/typography.d.ts +212 -0
  254. package/types/constants/typography.d.ts.map +1 -0
  255. package/types/core/Composition.d.ts +252 -0
  256. package/types/core/Composition.d.ts.map +1 -0
  257. package/types/core/CompositionAdapter.d.ts +92 -0
  258. package/types/core/CompositionAdapter.d.ts.map +1 -0
  259. package/types/core/CustomElement.d.ts +302 -0
  260. package/types/core/CustomElement.d.ts.map +1 -0
  261. package/types/core/css.d.ts +44 -0
  262. package/types/core/css.d.ts.map +1 -0
  263. package/types/core/customTypes.d.ts +26 -0
  264. package/types/core/customTypes.d.ts.map +1 -0
  265. package/types/core/dom.d.ts +32 -0
  266. package/types/core/dom.d.ts.map +1 -0
  267. package/types/core/jsonMergePatch.d.ts +31 -0
  268. package/types/core/jsonMergePatch.d.ts.map +1 -0
  269. package/types/core/observe.d.ts +113 -0
  270. package/types/core/observe.d.ts.map +1 -0
  271. package/types/core/optimizations.d.ts +7 -0
  272. package/types/core/optimizations.d.ts.map +1 -0
  273. package/types/core/template.d.ts +47 -0
  274. package/types/core/template.d.ts.map +1 -0
  275. package/types/core/uid.d.ts +6 -0
  276. package/types/core/uid.d.ts.map +1 -0
  277. package/types/dom/HTMLOptionsCollectionProxy.d.ts +18 -0
  278. package/types/dom/HTMLOptionsCollectionProxy.d.ts.map +1 -0
  279. package/types/index.d.ts +88 -0
  280. package/types/index.d.ts.map +1 -0
  281. package/types/loaders/palette.d.ts +2 -0
  282. package/types/loaders/palette.d.ts.map +1 -0
  283. package/types/loaders/theme.d.ts +2 -0
  284. package/types/loaders/theme.d.ts.map +1 -0
  285. package/types/mixins/AriaReflectorMixin.d.ts +23 -0
  286. package/types/mixins/AriaReflectorMixin.d.ts.map +1 -0
  287. package/types/mixins/AriaToolbarMixin.d.ts +32 -0
  288. package/types/mixins/AriaToolbarMixin.d.ts.map +1 -0
  289. package/types/mixins/ControlMixin.d.ts +124 -0
  290. package/types/mixins/ControlMixin.d.ts.map +1 -0
  291. package/types/mixins/DelegatesFocusMixin.d.ts +5 -0
  292. package/types/mixins/DelegatesFocusMixin.d.ts.map +1 -0
  293. package/types/mixins/DensityMixin.d.ts +5 -0
  294. package/types/mixins/DensityMixin.d.ts.map +1 -0
  295. package/types/mixins/ElevationMixin.d.ts +33 -0
  296. package/types/mixins/ElevationMixin.d.ts.map +1 -0
  297. package/types/mixins/FlexableMixin.d.ts +13 -0
  298. package/types/mixins/FlexableMixin.d.ts.map +1 -0
  299. package/types/mixins/FormAssociatedMixin.d.ts +122 -0
  300. package/types/mixins/FormAssociatedMixin.d.ts.map +1 -0
  301. package/types/mixins/HyperlinkMixin.d.ts +22 -0
  302. package/types/mixins/HyperlinkMixin.d.ts.map +1 -0
  303. package/types/mixins/InputMixin.d.ts +179 -0
  304. package/types/mixins/InputMixin.d.ts.map +1 -0
  305. package/types/mixins/KeyboardNavMixin.d.ts +47 -0
  306. package/types/mixins/KeyboardNavMixin.d.ts.map +1 -0
  307. package/types/mixins/NavigationListenerMixin.d.ts +8 -0
  308. package/types/mixins/NavigationListenerMixin.d.ts.map +1 -0
  309. package/types/mixins/PopupMixin.d.ts +82 -0
  310. package/types/mixins/PopupMixin.d.ts.map +1 -0
  311. package/types/mixins/RTLObserverMixin.d.ts +7 -0
  312. package/types/mixins/RTLObserverMixin.d.ts.map +1 -0
  313. package/types/mixins/ResizeObserverMixin.d.ts +12 -0
  314. package/types/mixins/ResizeObserverMixin.d.ts.map +1 -0
  315. package/types/mixins/RippleMixin.d.ts +92 -0
  316. package/types/mixins/RippleMixin.d.ts.map +1 -0
  317. package/types/mixins/ScrollListenerMixin.d.ts +41 -0
  318. package/types/mixins/ScrollListenerMixin.d.ts.map +1 -0
  319. package/types/mixins/SemiStickyMixin.d.ts +50 -0
  320. package/types/mixins/SemiStickyMixin.d.ts.map +1 -0
  321. package/types/mixins/ShapeMaskedMixin.d.ts +9 -0
  322. package/types/mixins/ShapeMaskedMixin.d.ts.map +1 -0
  323. package/types/mixins/ShapeMixin.d.ts +38 -0
  324. package/types/mixins/ShapeMixin.d.ts.map +1 -0
  325. package/types/mixins/StateMixin.d.ts +27 -0
  326. package/types/mixins/StateMixin.d.ts.map +1 -0
  327. package/types/mixins/TextFieldMixin.d.ts +1354 -0
  328. package/types/mixins/TextFieldMixin.d.ts.map +1 -0
  329. package/types/mixins/ThemableMixin.d.ts +9 -0
  330. package/types/mixins/ThemableMixin.d.ts.map +1 -0
  331. package/types/mixins/TooltipTriggerMixin.d.ts +106 -0
  332. package/types/mixins/TooltipTriggerMixin.d.ts.map +1 -0
  333. package/types/mixins/TouchTargetMixin.d.ts +3 -0
  334. package/types/mixins/TouchTargetMixin.d.ts.map +1 -0
  335. package/types/mixins/TypographyMixin.d.ts +17 -0
  336. package/types/mixins/TypographyMixin.d.ts.map +1 -0
  337. package/types/services/rtl.d.ts +3 -0
  338. package/types/services/rtl.d.ts.map +1 -0
  339. package/types/services/svgAlias.d.ts +13 -0
  340. package/types/services/svgAlias.d.ts.map +1 -0
  341. package/types/services/theme.d.ts +45 -0
  342. package/types/services/theme.d.ts.map +1 -0
  343. package/types/utils/cli.d.ts +3 -0
  344. package/types/utils/cli.d.ts.map +1 -0
  345. package/types/utils/function.d.ts +3 -0
  346. package/types/utils/function.d.ts.map +1 -0
  347. package/types/utils/jsx-runtime.d.ts +20 -0
  348. package/types/utils/jsx-runtime.d.ts.map +1 -0
  349. package/types/utils/material-color/blend.d.ts +34 -0
  350. package/types/utils/material-color/blend.d.ts.map +1 -0
  351. package/types/utils/material-color/hct/Cam16.d.ts +142 -0
  352. package/types/utils/material-color/hct/Cam16.d.ts.map +1 -0
  353. package/types/utils/material-color/hct/Hct.d.ts +93 -0
  354. package/types/utils/material-color/hct/Hct.d.ts.map +1 -0
  355. package/types/utils/material-color/hct/ViewingConditions.d.ts +69 -0
  356. package/types/utils/material-color/hct/ViewingConditions.d.ts.map +1 -0
  357. package/types/utils/material-color/hct/hctSolver.d.ts +30 -0
  358. package/types/utils/material-color/hct/hctSolver.d.ts.map +1 -0
  359. package/types/utils/material-color/helper.d.ts +8 -0
  360. package/types/utils/material-color/helper.d.ts.map +1 -0
  361. package/types/utils/material-color/palettes/CorePalette.d.ts +75 -0
  362. package/types/utils/material-color/palettes/CorePalette.d.ts.map +1 -0
  363. package/types/utils/material-color/palettes/TonalPalette.d.ts +38 -0
  364. package/types/utils/material-color/palettes/TonalPalette.d.ts.map +1 -0
  365. package/types/utils/material-color/scheme/Scheme.d.ts +264 -0
  366. package/types/utils/material-color/scheme/Scheme.d.ts.map +1 -0
  367. package/types/utils/material-color/utils/color.d.ts +172 -0
  368. package/types/utils/material-color/utils/color.d.ts.map +1 -0
  369. package/types/utils/material-color/utils/math.d.ts +94 -0
  370. package/types/utils/material-color/utils/math.d.ts.map +1 -0
  371. package/types/utils/pixelmatch.d.ts +22 -0
  372. package/types/utils/pixelmatch.d.ts.map +1 -0
  373. package/types/utils/popup.d.ts +106 -0
  374. package/types/utils/popup.d.ts.map +1 -0
  375. package/types/utils/searchParams.d.ts +3 -0
  376. package/types/utils/searchParams.d.ts.map +1 -0
  377. package/types/utils/svg.d.ts +7 -0
  378. package/types/utils/svg.d.ts.map +1 -0
  379. package/utils/material-color/scheme/Scheme.js +1 -1
  380. package/utils/pixelmatch.js +360 -0
  381. package/utils/popup.js +86 -10
  382. package/utils/searchParams.js +19 -0
  383. package/components/ExtendedFab.js +0 -32
  384. package/components/Layout.js +0 -504
  385. package/components/Nav.js +0 -38
  386. package/core/DomAdapter.js +0 -586
  387. package/core/ICustomElement.d.ts +0 -291
  388. package/core/ICustomElement.js +0 -1
  389. package/core/test.js +0 -126
  390. package/core/typings.d.ts +0 -142
  391. package/core/typings.js +0 -1
  392. package/mixins/SurfaceMixin.js +0 -127
  393. package/theming/loader.js +0 -22
  394. /package/{utils/color_keywords.js → constants/colorKeywords.js} +0 -0
@@ -1,25 +1,23 @@
1
1
  // https://www.w3.org/TR/wai-aria-practices/#menu
2
2
 
3
- import './Surface.js';
4
3
  import CustomElement from '../core/CustomElement.js';
5
4
  import { attemptFocus } from '../core/dom.js';
6
5
  import DensityMixin from '../mixins/DensityMixin.js';
6
+ import ElevationMixin from '../mixins/ElevationMixin.js';
7
7
  import KeyboardNavMixin from '../mixins/KeyboardNavMixin.js';
8
8
  import PopupMixin from '../mixins/PopupMixin.js';
9
9
  import ShapeMixin from '../mixins/ShapeMixin.js';
10
- import SurfaceMixin from '../mixins/SurfaceMixin.js';
11
10
  import ThemableMixin from '../mixins/ThemableMixin.js';
12
11
 
13
12
  export default CustomElement
14
13
  .extend()
15
14
  .mixin(ThemableMixin)
16
- .mixin(SurfaceMixin)
15
+ .mixin(ElevationMixin)
17
16
  .mixin(ShapeMixin)
18
17
  .mixin(PopupMixin)
19
18
  .mixin(DensityMixin)
20
19
  .mixin(KeyboardNavMixin)
21
20
  .set({
22
- scrollable: true,
23
21
  flow: 'corner',
24
22
  _useScrim: false,
25
23
  /** @type {WeakRef<HTMLElement>} */
@@ -60,15 +58,9 @@ export default CustomElement
60
58
  },
61
59
  },
62
60
  })
63
- .on({
64
- composed() {
65
- const { shape, surface, dialog, scrim } = this.refs;
66
- surface.append(shape);
67
- dialog.prepend(surface);
68
- scrim.setAttribute('invisible', '');
69
-
70
- // Wrap slot in scroller
71
- },
61
+ .recompose(({ refs: { scrim } }) => {
62
+ scrim.setAttribute('invisible', '');
63
+ // Wrap slot in scroller
72
64
  })
73
65
  .css`
74
66
  /* https://m3.material.io/components/menus/specs */
@@ -77,17 +69,14 @@ export default CustomElement
77
69
  --mdw-shape__size: var(--mdw-shape__extra-small);
78
70
  --mdw-bg: var(--mdw-color__surface-container);
79
71
  --mdw-ink: var(--mdw-color__on-surface);
80
-
81
- --mdw-surface__shadow__resting: var(--mdw-surface__shadow__2);
82
- --mdw-surface__shadow__raised: var(--mdw-surface__shadow__resting);
83
72
  display: block;
84
73
 
85
74
  inline-size: auto;
86
75
  min-inline-size: calc(var(--mdw-menu__inline-base) * 2);
87
76
  max-inline-size: 100vw;
88
- }
89
77
 
90
- #shape {
78
+ filter: var(--mdw-elevation__drop-shadow__2);
79
+
91
80
  background-color: rgb(var(--mdw-bg));
92
81
  }
93
82
 
@@ -128,6 +117,7 @@ export default CustomElement
128
117
  },
129
118
  'mdw-menu-item:cascader-blur'() {
130
119
  const submenu = this.submenu;
120
+ if (!submenu) return;
131
121
  // Wait for focus event (if mouse focus on sub menu item)
132
122
  queueMicrotask(() => {
133
123
  // Stay open if submenu is focused
@@ -1,11 +1,12 @@
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
+ export default ListOption
9
10
  .extend()
10
11
  .mixin(FormAssociatedMixin)
11
12
  .set({
@@ -121,7 +122,7 @@ export default class MenuItem extends ListOption
121
122
  .events({
122
123
  mouseenter() {
123
124
  if (this.disabledState) return;
124
- if (document.activeElement !== this) {
125
+ if (!isFocused(this)) {
125
126
  this.focus();
126
127
  }
127
128
  if (!this.cascades) return;
@@ -175,33 +176,32 @@ export default class MenuItem extends ListOption
175
176
  this.dispatchEvent(new CustomEvent('mdw-menu-item:cascader-blur', { detail: this.cascades, bubbles: true }));
176
177
  },
177
178
  })
178
- .on({
179
- composed({ inline, html }) {
180
- const { checkbox: checkboxRef, radio: radioRef, anchor, trailing, trailingIcon } = this.refs;
181
- checkboxRef.remove();
182
- radioRef.remove();
179
+ .recompose(({ inline, html, refs: { checkbox: checkboxRef, radio: radioRef, anchor, trailing, trailingIcon } }) => {
180
+ checkboxRef.remove();
181
+ radioRef.remove();
183
182
 
184
- anchor.setAttribute('role', inline(({ checkbox, radio }) => {
185
- if (checkbox != null) return 'menuitemcheckbox';
186
- if (radio != null) return 'menuitemradio';
187
- return 'menuitem';
188
- }));
183
+ anchor.setAttribute('role', inline(({ checkbox, radio }) => {
184
+ if (checkbox != null) return 'menuitemcheckbox';
185
+ if (radio != null) return 'menuitemradio';
186
+ return 'menuitem';
187
+ }));
189
188
 
190
- // MenuItems use checked instead of selected as in list items.
191
- 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'));
192
191
 
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
- `);
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
+ `);
199
198
 
200
- trailing.setAttribute('type-style', 'label-large');
199
+ trailing.setAttribute('type-style', 'label-large');
201
200
 
202
- trailingIcon.setAttribute('mdw-if', '{computeTrailingIcon}');
203
- trailingIcon.textContent = '{computeTrailingIcon}';
204
- },
201
+ trailingIcon.setAttribute('mdw-if', '{computeTrailingIcon}');
202
+ trailingIcon.setAttribute('icon', '{computeTrailingIcon}');
203
+ })
204
+ .on({
205
205
  _formResetChanged(oldValue, newValue) {
206
206
  if (!newValue) return;
207
207
  this._selected = this.defaultSelected;
@@ -262,5 +262,4 @@ export default class MenuItem extends ListOption
262
262
  color: inherit;
263
263
  }
264
264
  `
265
- .autoRegister('mdw-menu-item')
266
- .tsClassFix() {}
265
+ .autoRegister('mdw-menu-item');
@@ -1,29 +1,37 @@
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
+ export default CustomElement
6
8
  .extend()
7
- .mixin(SemiStickyMixin)
9
+ .mixin(DelegatesFocusMixin)
10
+ .mixin(ThemableMixin)
8
11
  .observe({
9
- _semiStickyAnchor: { empty: 'bottom' },
12
+ open: 'boolean',
13
+ autoClose: {
14
+ type: 'float',
15
+ empty: 728,
16
+ },
10
17
  })
18
+ .set({
19
+ color: 'surface-container',
20
+ _ariaRole: 'navigation',
21
+ })
22
+ .html`<slot id=slot></slot>`
11
23
  .css`
12
24
  /* https://m3.material.io/components/navigation-bar/specs */
13
25
 
14
26
  :host {
15
27
  --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 */
28
+ --mdw-ink: var(--mdw-color__on-surface);
29
+ display: none;
20
30
 
21
- display: grid;
22
31
  align-content: flex-start;
23
32
  align-items: flex-start;
24
33
  gap: 8px;
25
34
 
26
- grid-area: nav-bar;
27
35
  grid-auto-columns: minmax(48px, 1fr);
28
36
  grid-auto-flow: column;
29
37
 
@@ -33,20 +41,46 @@ export default Nav
33
41
  min-block-size: 80px;
34
42
  inline-size: 100%;
35
43
 
36
- flex-shrink: 0;
44
+ pointer-events: auto;
45
+
46
+ background-color: rgb(var(--mdw-bg));
37
47
 
38
- transform: translateY(0);
48
+ color: rgb(var(--mdw-ink));
39
49
 
40
- box-shadow: none;
50
+ font: var(--mdw-typescale__label-medium__font);
51
+ letter-spacing: var(--mdw-typescale__label-medium__letter-spacing);
41
52
 
42
53
  text-align: center;
43
-
44
- will-change: transform;
45
54
  }
46
55
 
47
- #slot {
48
- pointer-events: auto;
56
+ :host(:where([open])) {
57
+ display: grid;
49
58
  }
50
-
51
59
  `
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);
75
+ }
76
+ },
77
+ })
78
+ .on({
79
+ constructed() {
80
+ window.addEventListener('resize', this.onWindowResize.bind(this));
81
+ },
82
+ connected() {
83
+ this.onWindowResize();
84
+ },
85
+ })
52
86
  .autoRegister('mdw-nav-bar');
@@ -1,18 +1,27 @@
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
21
  :host {
14
22
  --mdw-shape__size: var(--mdw-shape__large, 16px);
15
23
  --mdw-shape__size__top-start-size: 0px;
24
+ --mdw-shape__size__bottom-start-size: 0px;
16
25
 
17
26
  --mdw-nav-item__badge__position: static;
18
27
  --mdw-nav-item__badge__transform: none;
@@ -21,25 +30,16 @@ export default NavRail
21
30
  --mdw-nav-item__label__padding-inline: 52px 0;
22
31
  --mdw-nav-item__anchor__display: block;
23
32
  --mdw-nav-item__indicator__grid-area: auto;
24
- --mdw-bg: var(--mdw-color__surface-container-low);
25
33
 
26
- display: grid;
27
- grid-template-columns: 1fr;
34
+ display:inline-block;
28
35
 
29
- min-block-size: 100vh;
30
- max-block-size: 100vh;
31
36
  inline-size: 360px;
32
37
  max-inline-size: calc(100vw - 56px);
33
- padding-inline: 0;
34
-
35
- box-shadow: none;
38
+ padding-inline: 12px;
36
39
  }
37
40
 
38
- #slot {
39
- gap: 0;
40
-
41
- inline-size: auto;
42
- padding-inline: 12px;
41
+ ::slotted(mdw-divider) {
42
+ padding-inline: 16px;
43
43
  }
44
44
 
45
45
  `
@@ -47,9 +47,7 @@ export default NavItem
47
47
  z-index: 1;
48
48
  }
49
49
  `
50
- .on({
51
- composed({ html }) {
52
- this.refs.badge.replaceWith(html`<span id="badge-text">{badge}</span>`);
53
- },
50
+ .recompose(({ html, refs: { badge } }) => {
51
+ badge.replaceWith(html`<span id="badge-text">{badge}</span>`);
54
52
  })
55
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
14
16
  .extend()
15
17
  .mixin(ThemableMixin)
16
18
  .mixin(StateMixin)
17
19
  .mixin(RippleMixin)
18
- .mixin(ShapeMixin)
20
+ .mixin(HyperlinkMixin)
21
+ .mixin(DelegatesFocusMixin)
19
22
  .set({
20
- delegatesFocus: true,
21
23
  stateLayer: true,
22
24
  })
23
25
  .observe({
@@ -25,7 +27,6 @@ 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
  })
@@ -35,29 +36,36 @@ export default class NavItem extends CustomElement
35
36
  this.refs.anchor.focus(...args);
36
37
  },
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;
49
+ },
50
+ })
38
51
  .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>
52
+ <mdw-icon id=icon aria-hidden=true src={src} active={active} icon={icon} variation={iconVariation}></mdw-icon>
47
53
  <slot id=slot active={active} show-label={showLabel} aria-hidden=true></slot>
48
54
  <mdw-badge part=badge id=badge badge={badge} show-label={showLabel} aria-hidden=true>{badge}</mdw-badge>
49
55
  `
50
- .on({
51
- composed({ html }) {
52
- const { shape, state, rippleContainer } = this.refs;
53
- 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>
54
64
  <mdw-ripple id=ripple ripple-origin=center keep-alive hold-ripple ripple-state=${({ active }) => ((active) ? null : 'complete')}></mdw-ripple>
55
65
  ${state}
56
66
  ${rippleContainer}
57
- `);
58
- shape.setAttribute('active', '{active}');
59
- shape.removeAttribute('color');
60
- },
67
+ </mdw-shape>
68
+ `);
61
69
  })
62
70
  .css`
63
71
  /* https://m3.material.io/components/navigation-bar/specs */
@@ -86,7 +94,7 @@ export default class NavItem extends CustomElement
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);
@@ -149,6 +157,8 @@ export default class NavItem extends CustomElement
149
157
  /* stylelint-disable-next-line liberty/use-logical-spec */
150
158
  left: 50%;
151
159
 
160
+ overflow: hidden;
161
+
152
162
  block-size: 100%;
153
163
  inline-size: 100%;
154
164
  max-inline-size: 56px;
@@ -157,7 +167,6 @@ export default class NavItem extends CustomElement
157
167
  grid-row: 1 / 1;
158
168
 
159
169
  transform: translateX(-50%) translateY(-50%) translateY(var(--mdw-nav-item__offset-y));
160
- z-index: 0;
161
170
 
162
171
  background-color: transparent;
163
172
 
@@ -177,7 +186,6 @@ export default class NavItem extends CustomElement
177
186
  color: rgb(var(--mdw-color__on-surface-variant));
178
187
 
179
188
  font-size: 24px;
180
- font-variation-settings: 'FILL' 0;
181
189
 
182
190
  transition: transform 200ms;
183
191
  will-change: transform;
@@ -235,8 +243,6 @@ export default class NavItem extends CustomElement
235
243
 
236
244
  #icon[active] {
237
245
  color: rgb(var(--mdw-ink));
238
-
239
- font-variation-settings: 'FILL' 1;
240
246
  }
241
247
 
242
248
  #slot[active] {
@@ -264,10 +270,11 @@ export default class NavItem extends CustomElement
264
270
  },
265
271
  },
266
272
  })
267
- .autoRegister('mdw-nav-item')
268
- .tsClassFix() {
269
- addRipple(...args) {
270
- if (!this.active) return null;
271
- return super.addRipple(...args);
272
- }
273
- }
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,39 +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
- position: relative;
20
-
21
- inset-block-start: 0;
22
- inset-inline-start: 0;
23
28
  align-self: flex-start;
24
29
 
25
- display: grid;
30
+ display: inline-grid;
26
31
  align-content: flex-start;
27
32
  flex-direction: column;
28
33
  gap:0;
29
- grid-template-rows: auto minmax(0,1fr);
34
+ grid-template-rows: auto minmax(auto,1fr);
30
35
  grid-template-columns: 100%;
31
36
  justify-items: stretch;
37
+ overscroll-behavior: none;
38
+ overscroll-behavior: contain;
32
39
 
33
- min-block-size: 100vh;
34
- max-block-size: 100vh;
35
- min-inline-size: 80px;
36
- max-inline-size: 80px;
40
+ min-block-size: 0;
37
41
 
38
42
  text-align: center;
39
43
  }
@@ -43,6 +47,7 @@ export default Nav
43
47
  align-items: center;
44
48
  flex-direction: column;
45
49
  gap: 12px;
50
+ justify-content: center;
46
51
  }
47
52
 
48
53
  #slot {
@@ -52,8 +57,6 @@ export default Nav
52
57
  align-items: stretch;
53
58
  flex-direction: column;
54
59
  gap: 12px;
55
- overflow-x: clip;
56
- overflow-y: auto;
57
60
 
58
61
  box-sizing: border-box;
59
62
  max-block-size: 100%;
@@ -68,6 +71,5 @@ export default Nav
68
71
  #slot[align="end"] {
69
72
  align-self: flex-end;
70
73
  }
71
-
72
74
  `
73
75
  .autoRegister('mdw-nav-rail');
@@ -9,11 +9,14 @@ export default NavItem
9
9
  grid-auto-flow: row;
10
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
14
  min-block-size: 56px;
15
15
  flex: none;
16
- padding-inline: 12px;
16
+ padding-inline: 4px;
17
+
18
+ font: var(--mdw-typescale__label-medium__font);
19
+ letter-spacing: var(--mdw-typescale__label-medium__letter-spacing);
17
20
  }
18
21
 
19
22
  #slot {