@material/web 1.0.0-pre.6 → 1.0.0-pre.8

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 (504) hide show
  1. package/README.md +8 -8
  2. package/aria/aria.d.ts +43 -0
  3. package/aria/aria.js +80 -0
  4. package/aria/aria.js.map +1 -0
  5. package/aria/delegate.d.ts +37 -0
  6. package/aria/delegate.js +53 -0
  7. package/aria/delegate.js.map +1 -0
  8. package/badge/badge.d.ts +0 -1
  9. package/badge/badge.js +0 -1
  10. package/badge/badge.js.map +1 -1
  11. package/badge/lib/badge.d.ts +5 -7
  12. package/badge/lib/badge.js +9 -12
  13. package/badge/lib/badge.js.map +1 -1
  14. package/button/lib/_elevated-button.scss +35 -6
  15. package/button/lib/_elevation.scss +13 -3
  16. package/button/lib/_filled-button.scss +35 -3
  17. package/button/lib/_outlined-button.scss +35 -6
  18. package/button/lib/_shared.scss +4 -2
  19. package/button/lib/_text-button.scss +35 -6
  20. package/button/lib/_tonal-button.scss +34 -7
  21. package/button/lib/button.d.ts +24 -38
  22. package/button/lib/button.js +40 -89
  23. package/button/lib/button.js.map +1 -1
  24. package/button/lib/elevated-button.d.ts +6 -4
  25. package/button/lib/elevated-button.js.map +1 -1
  26. package/button/lib/elevated-styles.css.js +1 -1
  27. package/button/lib/elevated-styles.css.js.map +1 -1
  28. package/button/lib/filled-button.d.ts +6 -4
  29. package/button/lib/filled-button.js.map +1 -1
  30. package/button/lib/filled-styles.css.js +1 -1
  31. package/button/lib/filled-styles.css.js.map +1 -1
  32. package/button/lib/outlined-button.d.ts +6 -4
  33. package/button/lib/outlined-button.js.map +1 -1
  34. package/button/lib/outlined-styles.css.js +1 -1
  35. package/button/lib/outlined-styles.css.js.map +1 -1
  36. package/button/lib/shared-elevation-styles.css.js +1 -1
  37. package/button/lib/shared-elevation-styles.css.js.map +1 -1
  38. package/button/lib/shared-styles.css.js +1 -1
  39. package/button/lib/shared-styles.css.js.map +1 -1
  40. package/button/lib/text-button.d.ts +5 -2
  41. package/button/lib/text-button.js.map +1 -1
  42. package/button/lib/text-styles.css.js +1 -1
  43. package/button/lib/text-styles.css.js.map +1 -1
  44. package/button/lib/tonal-button.d.ts +6 -4
  45. package/button/lib/tonal-button.js.map +1 -1
  46. package/button/lib/tonal-styles.css.js +1 -1
  47. package/button/lib/tonal-styles.css.js.map +1 -1
  48. package/checkbox/lib/_checkbox.scss +48 -47
  49. package/checkbox/lib/checkbox-styles.css.js +1 -1
  50. package/checkbox/lib/checkbox-styles.css.js.map +1 -1
  51. package/checkbox/lib/checkbox.d.ts +2 -7
  52. package/checkbox/lib/checkbox.js +35 -62
  53. package/checkbox/lib/checkbox.js.map +1 -1
  54. package/checkbox/lib/forced-colors-styles.css.js +1 -1
  55. package/checkbox/lib/forced-colors-styles.css.js.map +1 -1
  56. package/chips/_filter-chip.scss +6 -0
  57. package/chips/assist-chip.js +2 -1
  58. package/chips/assist-chip.js.map +1 -1
  59. package/chips/filter-chip.d.ts +20 -0
  60. package/chips/filter-chip.js +25 -0
  61. package/chips/filter-chip.js.map +1 -0
  62. package/chips/lib/_assist-chip.scss +37 -3
  63. package/chips/lib/_elevated.scss +60 -0
  64. package/chips/lib/_filter-chip.scss +175 -0
  65. package/chips/lib/_shared.scss +48 -84
  66. package/chips/lib/_suggestion-chip.scss +36 -5
  67. package/chips/lib/assist-chip.d.ts +12 -0
  68. package/chips/lib/assist-chip.js +64 -0
  69. package/chips/lib/assist-chip.js.map +1 -1
  70. package/chips/lib/assist-styles.css.js +1 -1
  71. package/chips/lib/assist-styles.css.js.map +1 -1
  72. package/chips/lib/chip.d.ts +24 -16
  73. package/chips/lib/chip.js +53 -74
  74. package/chips/lib/chip.js.map +1 -1
  75. package/chips/lib/elevated-styles.css.js +9 -0
  76. package/chips/lib/elevated-styles.css.js.map +1 -0
  77. package/{fab/lib/fab-extended-styles.scss → chips/lib/elevated-styles.scss} +3 -3
  78. package/chips/lib/filter-chip.d.ts +26 -0
  79. package/chips/lib/filter-chip.js +80 -0
  80. package/chips/lib/filter-chip.js.map +1 -0
  81. package/chips/lib/filter-styles.css.js +9 -0
  82. package/chips/lib/filter-styles.css.js.map +1 -0
  83. package/chips/lib/filter-styles.scss +10 -0
  84. package/chips/lib/shared-styles.css.js +1 -1
  85. package/chips/lib/shared-styles.css.js.map +1 -1
  86. package/chips/lib/suggestion-chip.d.ts +2 -2
  87. package/chips/lib/suggestion-chip.js +4 -2
  88. package/chips/lib/suggestion-chip.js.map +1 -1
  89. package/chips/lib/suggestion-styles.css.js +1 -1
  90. package/chips/lib/suggestion-styles.css.js.map +1 -1
  91. package/chips/suggestion-chip.js +2 -1
  92. package/chips/suggestion-chip.js.map +1 -1
  93. package/circularprogress/harness.d.ts +1 -0
  94. package/circularprogress/harness.js +4 -0
  95. package/circularprogress/harness.js.map +1 -1
  96. package/circularprogress/lib/_circular-progress.scss +13 -7
  97. package/circularprogress/lib/circular-progress-styles.css.js +1 -1
  98. package/circularprogress/lib/circular-progress-styles.css.js.map +1 -1
  99. package/circularprogress/lib/circular-progress.d.ts +5 -7
  100. package/circularprogress/lib/circular-progress.js +17 -21
  101. package/circularprogress/lib/circular-progress.js.map +1 -1
  102. package/dialog/lib/_dialog.scss +8 -9
  103. package/dialog/lib/_tokens.scss +0 -1
  104. package/dialog/lib/dialog-styles.css.js +1 -1
  105. package/dialog/lib/dialog-styles.css.js.map +1 -1
  106. package/dialog/lib/dialog.d.ts +10 -10
  107. package/dialog/lib/dialog.js +33 -56
  108. package/dialog/lib/dialog.js.map +1 -1
  109. package/divider/lib/divider.js +4 -7
  110. package/divider/lib/divider.js.map +1 -1
  111. package/elevation/lib/_elevation.scss +5 -7
  112. package/elevation/lib/elevation-styles.css.js +1 -1
  113. package/elevation/lib/elevation-styles.css.js.map +1 -1
  114. package/elevation/lib/elevation.d.ts +1 -1
  115. package/elevation/lib/elevation.js.map +1 -1
  116. package/fab/_fab.scss +1 -0
  117. package/fab/branded-fab.d.ts +56 -0
  118. package/fab/branded-fab.js +56 -0
  119. package/fab/branded-fab.js.map +1 -0
  120. package/fab/fab.d.ts +25 -5
  121. package/fab/fab.js +27 -10
  122. package/fab/fab.js.map +1 -1
  123. package/fab/harness.d.ts +1 -2
  124. package/fab/harness.js +1 -1
  125. package/fab/harness.js.map +1 -1
  126. package/fab/lib/_fab-branded.scss +81 -0
  127. package/fab/lib/_fab.scss +221 -19
  128. package/fab/lib/_shared.scss +161 -131
  129. package/fab/lib/fab-branded-styles.css.d.ts +1 -0
  130. package/fab/lib/fab-branded-styles.css.js +9 -0
  131. package/fab/lib/fab-branded-styles.css.js.map +1 -0
  132. package/fab/lib/fab-branded-styles.scss +10 -0
  133. package/fab/lib/fab-styles.css.js +1 -1
  134. package/fab/lib/fab-styles.css.js.map +1 -1
  135. package/fab/lib/fab.d.ts +18 -10
  136. package/fab/lib/fab.js +19 -12
  137. package/fab/lib/fab.js.map +1 -1
  138. package/fab/lib/forced-colors-styles.css.d.ts +1 -0
  139. package/fab/lib/forced-colors-styles.css.js +9 -0
  140. package/fab/lib/forced-colors-styles.css.js.map +1 -0
  141. package/fab/lib/forced-colors-styles.scss +26 -0
  142. package/fab/lib/shared-styles.css.d.ts +1 -0
  143. package/fab/lib/shared-styles.css.js +9 -0
  144. package/fab/lib/shared-styles.css.js.map +1 -0
  145. package/fab/lib/{fab-shared-styles.scss → shared-styles.scss} +1 -1
  146. package/fab/lib/shared.d.ts +49 -0
  147. package/fab/lib/shared.js +113 -0
  148. package/fab/lib/shared.js.map +1 -0
  149. package/field/lib/_filled-field.scss +47 -12
  150. package/field/lib/_outlined-field.scss +39 -12
  151. package/field/lib/field.js +14 -27
  152. package/field/lib/field.js.map +1 -1
  153. package/field/lib/filled-styles.css.js +1 -1
  154. package/field/lib/filled-styles.css.js.map +1 -1
  155. package/field/lib/outlined-styles.css.js +1 -1
  156. package/field/lib/outlined-styles.css.js.map +1 -1
  157. package/focus/focus-ring.d.ts +2 -1
  158. package/focus/focus-ring.js +2 -1
  159. package/focus/focus-ring.js.map +1 -1
  160. package/focus/lib/_focus-ring.scss +49 -34
  161. package/focus/lib/focus-ring-styles.css.js +1 -1
  162. package/focus/lib/focus-ring-styles.css.js.map +1 -1
  163. package/focus/lib/focus-ring.d.ts +59 -12
  164. package/focus/lib/focus-ring.js +118 -14
  165. package/focus/lib/focus-ring.js.map +1 -1
  166. package/icon/icon.d.ts +0 -1
  167. package/icon/icon.js +0 -1
  168. package/icon/icon.js.map +1 -1
  169. package/icon/lib/_icon.scss +2 -0
  170. package/icon/lib/icon-styles.css.js +1 -1
  171. package/icon/lib/icon-styles.css.js.map +1 -1
  172. package/icon/lib/icon.d.ts +5 -4
  173. package/icon/lib/icon.js +3 -2
  174. package/icon/lib/icon.js.map +1 -1
  175. package/iconbutton/filled-icon-button.d.ts +6 -2
  176. package/iconbutton/filled-icon-button.js.map +1 -1
  177. package/iconbutton/filled-tonal-icon-button.d.ts +6 -2
  178. package/iconbutton/filled-tonal-icon-button.js.map +1 -1
  179. package/iconbutton/harness.d.ts +1 -1
  180. package/iconbutton/harness.js +4 -1
  181. package/iconbutton/harness.js.map +1 -1
  182. package/iconbutton/lib/_filled-icon-button.scss +38 -13
  183. package/iconbutton/lib/_filled-tonal-icon-button.scss +38 -11
  184. package/iconbutton/lib/_outlined-icon-button.scss +38 -13
  185. package/iconbutton/lib/_shared.scss +4 -6
  186. package/iconbutton/lib/_standard-icon-button.scss +14 -14
  187. package/iconbutton/lib/filled-styles.css.js +1 -1
  188. package/iconbutton/lib/filled-styles.css.js.map +1 -1
  189. package/iconbutton/lib/filled-tonal-styles.css.js +1 -1
  190. package/iconbutton/lib/filled-tonal-styles.css.js.map +1 -1
  191. package/iconbutton/lib/icon-button.d.ts +17 -25
  192. package/iconbutton/lib/icon-button.js +37 -73
  193. package/iconbutton/lib/icon-button.js.map +1 -1
  194. package/iconbutton/lib/outlined-styles.css.js +1 -1
  195. package/iconbutton/lib/outlined-styles.css.js.map +1 -1
  196. package/iconbutton/lib/shared-styles.css.js +1 -1
  197. package/iconbutton/lib/shared-styles.css.js.map +1 -1
  198. package/iconbutton/lib/standard-styles.css.js +1 -1
  199. package/iconbutton/lib/standard-styles.css.js.map +1 -1
  200. package/iconbutton/outlined-icon-button.d.ts +5 -2
  201. package/iconbutton/outlined-icon-button.js.map +1 -1
  202. package/iconbutton/standard-icon-button.d.ts +5 -2
  203. package/iconbutton/standard-icon-button.js.map +1 -1
  204. package/linearprogress/_linear-progress.scss +6 -0
  205. package/linearprogress/harness.d.ts +13 -0
  206. package/linearprogress/harness.js +18 -0
  207. package/linearprogress/harness.js.map +1 -0
  208. package/linearprogress/lib/_linear-progress.scss +386 -0
  209. package/linearprogress/lib/linear-progress-styles.css.d.ts +1 -0
  210. package/linearprogress/lib/linear-progress-styles.css.js +9 -0
  211. package/linearprogress/lib/linear-progress-styles.css.js.map +1 -0
  212. package/linearprogress/lib/linear-progress-styles.scss +8 -0
  213. package/linearprogress/lib/linear-progress.d.ts +35 -0
  214. package/linearprogress/lib/linear-progress.js +127 -0
  215. package/linearprogress/lib/linear-progress.js.map +1 -0
  216. package/linearprogress/linear-progress.d.ts +23 -0
  217. package/linearprogress/linear-progress.js +26 -0
  218. package/linearprogress/linear-progress.js.map +1 -0
  219. package/list/lib/_list.scss +9 -50
  220. package/list/lib/list-styles.css.js +1 -1
  221. package/list/lib/list-styles.css.js.map +1 -1
  222. package/list/lib/list.d.ts +8 -15
  223. package/list/lib/list.js +20 -45
  224. package/list/lib/list.js.map +1 -1
  225. package/list/lib/listitem/_list-item.scss +17 -72
  226. package/list/lib/listitem/forced-colors-styles.css.js +1 -1
  227. package/list/lib/listitem/forced-colors-styles.css.js.map +1 -1
  228. package/list/lib/listitem/list-item-styles.css.js +1 -1
  229. package/list/lib/listitem/list-item-styles.css.js.map +1 -1
  230. package/list/lib/listitem/list-item.d.ts +29 -31
  231. package/list/lib/listitem/list-item.js +26 -80
  232. package/list/lib/listitem/list-item.js.map +1 -1
  233. package/list/lib/listitemlink/list-item-link.js +5 -9
  234. package/list/lib/listitemlink/list-item-link.js.map +1 -1
  235. package/menu/lib/_menu.scss +9 -29
  236. package/menu/lib/menu-styles.css.js +1 -1
  237. package/menu/lib/menu-styles.css.js.map +1 -1
  238. package/menu/lib/menu.d.ts +32 -41
  239. package/menu/lib/menu.js +51 -82
  240. package/menu/lib/menu.js.map +1 -1
  241. package/menu/lib/menuitem/_menu-item.scss +16 -33
  242. package/menu/lib/menuitem/menu-item-styles.css.js +1 -1
  243. package/menu/lib/menuitem/menu-item-styles.css.js.map +1 -1
  244. package/menu/lib/menuitem/menu-item.d.ts +1 -1
  245. package/menu/lib/menuitem/menu-item.js +4 -6
  246. package/menu/lib/menuitem/menu-item.js.map +1 -1
  247. package/menu/lib/menuitemlink/menu-item-link.d.ts +0 -2
  248. package/menu/lib/menuitemlink/menu-item-link.js +3 -6
  249. package/menu/lib/menuitemlink/menu-item-link.js.map +1 -1
  250. package/menu/lib/shared.d.ts +20 -2
  251. package/menu/lib/shared.js +18 -0
  252. package/menu/lib/shared.js.map +1 -1
  253. package/menu/lib/submenuitem/sub-menu-item.d.ts +16 -13
  254. package/menu/lib/submenuitem/sub-menu-item.js +27 -18
  255. package/menu/lib/submenuitem/sub-menu-item.js.map +1 -1
  256. package/menu/lib/typeaheadController.d.ts +9 -9
  257. package/menu/lib/typeaheadController.js.map +1 -1
  258. package/navigationbar/lib/_navigation-bar.scss +7 -1
  259. package/navigationbar/lib/navigation-bar-styles.css.js +1 -1
  260. package/navigationbar/lib/navigation-bar-styles.css.js.map +1 -1
  261. package/navigationbar/lib/navigation-bar.d.ts +6 -6
  262. package/navigationbar/lib/navigation-bar.js +17 -18
  263. package/navigationbar/lib/navigation-bar.js.map +1 -1
  264. package/navigationbar/navigation-bar.d.ts +0 -1
  265. package/navigationbar/navigation-bar.js +0 -1
  266. package/navigationbar/navigation-bar.js.map +1 -1
  267. package/navigationdrawer/lib/_navigation-drawer-modal.scss +0 -3
  268. package/navigationdrawer/lib/_navigation-drawer.scss +0 -3
  269. package/navigationdrawer/lib/_shared.scss +1 -4
  270. package/navigationdrawer/lib/navigation-drawer-modal-styles.css.js +1 -1
  271. package/navigationdrawer/lib/navigation-drawer-modal-styles.css.js.map +1 -1
  272. package/navigationdrawer/lib/navigation-drawer-modal.d.ts +7 -12
  273. package/navigationdrawer/lib/navigation-drawer-modal.js +19 -41
  274. package/navigationdrawer/lib/navigation-drawer-modal.js.map +1 -1
  275. package/navigationdrawer/lib/navigation-drawer-styles.css.js +1 -1
  276. package/navigationdrawer/lib/navigation-drawer-styles.css.js.map +1 -1
  277. package/navigationdrawer/lib/navigation-drawer.d.ts +6 -10
  278. package/navigationdrawer/lib/navigation-drawer.js +17 -38
  279. package/navigationdrawer/lib/navigation-drawer.js.map +1 -1
  280. package/navigationdrawer/lib/shared-styles.css.js +1 -1
  281. package/navigationdrawer/lib/shared-styles.css.js.map +1 -1
  282. package/navigationdrawer/navigation-drawer-modal.d.ts +0 -1
  283. package/navigationdrawer/navigation-drawer-modal.js +0 -1
  284. package/navigationdrawer/navigation-drawer-modal.js.map +1 -1
  285. package/navigationdrawer/navigation-drawer.d.ts +0 -1
  286. package/navigationdrawer/navigation-drawer.js +0 -1
  287. package/navigationdrawer/navigation-drawer.js.map +1 -1
  288. package/navigationtab/lib/_navigation-tab.scss +2 -2
  289. package/navigationtab/lib/navigation-tab-styles.css.js +1 -1
  290. package/navigationtab/lib/navigation-tab-styles.css.js.map +1 -1
  291. package/navigationtab/lib/navigation-tab.d.ts +16 -29
  292. package/navigationtab/lib/navigation-tab.js +49 -88
  293. package/navigationtab/lib/navigation-tab.js.map +1 -1
  294. package/navigationtab/lib/state.d.ts +1 -1
  295. package/navigationtab/lib/state.js.map +1 -1
  296. package/navigationtab/navigation-tab.d.ts +0 -1
  297. package/navigationtab/navigation-tab.js +0 -1
  298. package/navigationtab/navigation-tab.js.map +1 -1
  299. package/package.json +1 -1
  300. package/radio/lib/_radio.scss +1 -1
  301. package/radio/lib/radio-styles.css.js +1 -1
  302. package/radio/lib/radio-styles.css.js.map +1 -1
  303. package/radio/lib/radio.d.ts +2 -8
  304. package/radio/lib/radio.js +31 -58
  305. package/radio/lib/radio.js.map +1 -1
  306. package/ripple/lib/ripple.js +11 -13
  307. package/ripple/lib/ripple.js.map +1 -1
  308. package/segmentedbutton/lib/outlined-segmented-button.d.ts +16 -7
  309. package/segmentedbutton/lib/outlined-segmented-button.js +3 -3
  310. package/segmentedbutton/lib/outlined-segmented-button.js.map +1 -1
  311. package/segmentedbutton/lib/segmented-button.d.ts +28 -40
  312. package/segmentedbutton/lib/segmented-button.js +42 -96
  313. package/segmentedbutton/lib/segmented-button.js.map +1 -1
  314. package/segmentedbutton/outlined-segmented-button.d.ts +0 -1
  315. package/segmentedbutton/outlined-segmented-button.js +0 -1
  316. package/segmentedbutton/outlined-segmented-button.js.map +1 -1
  317. package/segmentedbuttonset/lib/_outlined-segmented-button-set.scss +32 -13
  318. package/segmentedbuttonset/lib/outlined-segmented-button-set.d.ts +6 -4
  319. package/segmentedbuttonset/lib/outlined-segmented-button-set.js +3 -2
  320. package/segmentedbuttonset/lib/outlined-segmented-button-set.js.map +1 -1
  321. package/segmentedbuttonset/lib/outlined-styles.css.js +1 -1
  322. package/segmentedbuttonset/lib/outlined-styles.css.js.map +1 -1
  323. package/segmentedbuttonset/lib/segmented-button-set.d.ts +3 -9
  324. package/segmentedbuttonset/lib/segmented-button-set.js +14 -20
  325. package/segmentedbuttonset/lib/segmented-button-set.js.map +1 -1
  326. package/segmentedbuttonset/outlined-segmented-button-set.d.ts +0 -1
  327. package/segmentedbuttonset/outlined-segmented-button-set.js +0 -1
  328. package/segmentedbuttonset/outlined-segmented-button-set.js.map +1 -1
  329. package/select/_filled-select.scss +6 -0
  330. package/select/_outlined-select.scss +6 -0
  331. package/select/filled-select.d.ts +41 -0
  332. package/select/filled-select.js +46 -0
  333. package/select/filled-select.js.map +1 -0
  334. package/select/harness.d.ts +24 -0
  335. package/select/harness.js +53 -0
  336. package/select/harness.js.map +1 -0
  337. package/select/lib/_filled-select.scss +222 -0
  338. package/select/lib/_outlined-select.scss +180 -0
  339. package/select/lib/_shared.scss +48 -0
  340. package/select/lib/filled-forced-colors-styles.css.d.ts +1 -0
  341. package/select/lib/filled-forced-colors-styles.css.js +9 -0
  342. package/select/lib/filled-forced-colors-styles.css.js.map +1 -0
  343. package/select/lib/filled-forced-colors-styles.scss +29 -0
  344. package/select/lib/filled-select-styles.css.d.ts +1 -0
  345. package/select/lib/filled-select-styles.css.js +9 -0
  346. package/select/lib/filled-select-styles.css.js.map +1 -0
  347. package/select/lib/filled-select-styles.scss +10 -0
  348. package/select/lib/filled-select.d.ts +10 -0
  349. package/select/lib/filled-select.js +16 -0
  350. package/select/lib/filled-select.js.map +1 -0
  351. package/select/lib/outlined-forced-colors-styles.css.d.ts +1 -0
  352. package/select/lib/outlined-forced-colors-styles.css.js +9 -0
  353. package/select/lib/outlined-forced-colors-styles.css.js.map +1 -0
  354. package/select/lib/outlined-forced-colors-styles.scss +29 -0
  355. package/select/lib/outlined-select-styles.css.d.ts +1 -0
  356. package/select/lib/outlined-select-styles.css.js +9 -0
  357. package/select/lib/outlined-select-styles.css.js.map +1 -0
  358. package/select/lib/outlined-select-styles.scss +10 -0
  359. package/select/lib/outlined-select.d.ts +10 -0
  360. package/select/lib/outlined-select.js +16 -0
  361. package/select/lib/outlined-select.js.map +1 -0
  362. package/select/lib/select.d.ts +216 -0
  363. package/select/lib/select.js +589 -0
  364. package/select/lib/select.js.map +1 -0
  365. package/select/lib/selectoption/harness.d.ts +11 -0
  366. package/select/lib/selectoption/harness.js +12 -0
  367. package/select/lib/selectoption/harness.js.map +1 -0
  368. package/select/lib/selectoption/select-option.d.ts +30 -0
  369. package/select/lib/selectoption/select-option.js +71 -0
  370. package/select/lib/selectoption/select-option.js.map +1 -0
  371. package/select/lib/shared-styles.css.d.ts +1 -0
  372. package/select/lib/shared-styles.css.js +9 -0
  373. package/select/lib/shared-styles.css.js.map +1 -0
  374. package/select/lib/shared-styles.scss +10 -0
  375. package/select/lib/shared.d.ts +52 -0
  376. package/select/lib/shared.js +41 -0
  377. package/select/lib/shared.js.map +1 -0
  378. package/select/outlined-select.d.ts +41 -0
  379. package/select/outlined-select.js +46 -0
  380. package/select/outlined-select.js.map +1 -0
  381. package/select/select-option.d.ts +44 -0
  382. package/select/select-option.js +51 -0
  383. package/select/select-option.js.map +1 -0
  384. package/slider/harness.d.ts +2 -1
  385. package/slider/harness.js +14 -9
  386. package/slider/harness.js.map +1 -1
  387. package/slider/lib/_slider.scss +149 -167
  388. package/slider/lib/forced-colors-styles.css.js +1 -1
  389. package/slider/lib/forced-colors-styles.css.js.map +1 -1
  390. package/slider/lib/forced-colors-styles.scss +2 -2
  391. package/slider/lib/slider-styles.css.js +1 -1
  392. package/slider/lib/slider-styles.css.js.map +1 -1
  393. package/slider/lib/slider.d.ts +23 -57
  394. package/slider/lib/slider.js +77 -167
  395. package/slider/lib/slider.js.map +1 -1
  396. package/switch/lib/_switch.scss +63 -18
  397. package/switch/lib/switch-styles.css.js +1 -1
  398. package/switch/lib/switch-styles.css.js.map +1 -1
  399. package/switch/lib/switch.d.ts +0 -7
  400. package/switch/lib/switch.js +32 -79
  401. package/switch/lib/switch.js.map +1 -1
  402. package/textfield/harness.d.ts +1 -1
  403. package/textfield/harness.js.map +1 -1
  404. package/textfield/lib/_filled-text-field.scss +70 -14
  405. package/textfield/lib/_outlined-text-field.scss +60 -35
  406. package/textfield/lib/filled-forced-colors-styles.css.js +1 -1
  407. package/textfield/lib/filled-forced-colors-styles.css.js.map +1 -1
  408. package/textfield/lib/filled-styles.css.js +1 -1
  409. package/textfield/lib/filled-styles.css.js.map +1 -1
  410. package/textfield/lib/outlined-forced-colors-styles.css.js +1 -1
  411. package/textfield/lib/outlined-forced-colors-styles.css.js.map +1 -1
  412. package/textfield/lib/outlined-styles.css.js +1 -1
  413. package/textfield/lib/outlined-styles.css.js.map +1 -1
  414. package/textfield/lib/text-field.d.ts +1 -11
  415. package/textfield/lib/text-field.js +45 -115
  416. package/textfield/lib/text-field.js.map +1 -1
  417. package/tokens/_index.scss +5 -18
  418. package/tokens/_md-comp-assist-chip.scss +25 -29
  419. package/tokens/_md-comp-checkbox.scss +78 -1
  420. package/tokens/_md-comp-circular-progress-indicator.scss +39 -13
  421. package/tokens/_md-comp-elevated-button.scss +0 -10
  422. package/tokens/_md-comp-elevation.scss +0 -4
  423. package/tokens/_md-comp-fab-branded.scss +84 -1
  424. package/tokens/_md-comp-fab.scss +249 -0
  425. package/tokens/_md-comp-filled-button.scss +0 -10
  426. package/{field/lib → tokens}/_md-comp-filled-field.scss +91 -9
  427. package/tokens/_md-comp-filled-icon-button.scss +46 -1
  428. package/tokens/_md-comp-filled-select.scss +124 -1
  429. package/tokens/_md-comp-filled-text-field.scss +93 -9
  430. package/tokens/_md-comp-filled-tonal-button.scss +0 -11
  431. package/tokens/_md-comp-filled-tonal-icon-button.scss +45 -3
  432. package/tokens/_md-comp-filter-chip.scss +103 -103
  433. package/tokens/_md-comp-focus-ring.scss +23 -24
  434. package/tokens/_md-comp-icon-button.scss +37 -1
  435. package/tokens/_md-comp-input-chip.scss +77 -95
  436. package/tokens/_md-comp-linear-progress-indicator.scss +31 -3
  437. package/tokens/_md-comp-list-item.scss +174 -0
  438. package/tokens/_md-comp-list.scss +81 -26
  439. package/tokens/_md-comp-menu-item.scss +50 -0
  440. package/tokens/_md-comp-menu.scss +29 -2
  441. package/tokens/_md-comp-outlined-button.scss +0 -10
  442. package/{field/lib → tokens}/_md-comp-outlined-field.scss +85 -9
  443. package/tokens/_md-comp-outlined-icon-button.scss +41 -1
  444. package/tokens/_md-comp-outlined-segmented-button.scss +57 -11
  445. package/tokens/_md-comp-outlined-select.scss +123 -1
  446. package/tokens/_md-comp-outlined-text-field.scss +85 -8
  447. package/tokens/_md-comp-slider.scss +13 -1
  448. package/tokens/_md-comp-suggestion-chip.scss +29 -30
  449. package/tokens/_md-comp-switch.scss +81 -1
  450. package/tokens/_md-comp-text-button.scss +0 -10
  451. package/tokens/_values.scss +2 -4
  452. package/types/aria.d.ts +59 -1
  453. package/actionelement/action-element.d.ts +0 -79
  454. package/actionelement/action-element.js +0 -97
  455. package/actionelement/action-element.js.map +0 -1
  456. package/button/lib/state.d.ts +0 -10
  457. package/button/lib/state.js +0 -7
  458. package/button/lib/state.js.map +0 -1
  459. package/controller/action-controller.d.ts +0 -147
  460. package/controller/action-controller.js +0 -286
  461. package/controller/action-controller.js.map +0 -1
  462. package/decorators/aria-property.d.ts +0 -32
  463. package/decorators/aria-property.js +0 -99
  464. package/decorators/aria-property.js.map +0 -1
  465. package/fab/_fab-extended.scss +0 -6
  466. package/fab/fab-extended.d.ts +0 -23
  467. package/fab/fab-extended.js +0 -29
  468. package/fab/fab-extended.js.map +0 -1
  469. package/fab/lib/_fab-extended.scss +0 -73
  470. package/fab/lib/fab-extended-styles.css.js +0 -9
  471. package/fab/lib/fab-extended-styles.css.js.map +0 -1
  472. package/fab/lib/fab-extended.d.ts +0 -19
  473. package/fab/lib/fab-extended.js +0 -28
  474. package/fab/lib/fab-extended.js.map +0 -1
  475. package/fab/lib/fab-shared-styles.css.js +0 -9
  476. package/fab/lib/fab-shared-styles.css.js.map +0 -1
  477. package/fab/lib/fab-shared.d.ts +0 -44
  478. package/fab/lib/fab-shared.js +0 -121
  479. package/fab/lib/fab-shared.js.map +0 -1
  480. package/focus/strong-focus.d.ts +0 -56
  481. package/focus/strong-focus.js +0 -96
  482. package/focus/strong-focus.js.map +0 -1
  483. package/sass/_shape.scss +0 -154
  484. package/slider/lib/_tokens.scss +0 -65
  485. package/tokens/_md-comp-extended-fab-branded.scss +0 -45
  486. package/tokens/_md-comp-extended-fab-primary.scss +0 -45
  487. package/tokens/_md-comp-extended-fab-secondary.scss +0 -48
  488. package/tokens/_md-comp-extended-fab-surface.scss +0 -45
  489. package/tokens/_md-comp-extended-fab-tertiary.scss +0 -48
  490. package/tokens/_md-comp-fab-branded-large.scss +0 -23
  491. package/tokens/_md-comp-fab-primary-large.scss +0 -23
  492. package/tokens/_md-comp-fab-primary-small.scss +0 -23
  493. package/tokens/_md-comp-fab-primary.scss +0 -23
  494. package/tokens/_md-comp-fab-secondary-large.scss +0 -23
  495. package/tokens/_md-comp-fab-secondary-small.scss +0 -23
  496. package/tokens/_md-comp-fab-secondary.scss +0 -23
  497. package/tokens/_md-comp-fab-surface-large.scss +0 -23
  498. package/tokens/_md-comp-fab-surface-small.scss +0 -23
  499. package/tokens/_md-comp-fab-surface.scss +0 -23
  500. package/tokens/_md-comp-fab-tertiary-large.scss +0 -23
  501. package/tokens/_md-comp-fab-tertiary-small.scss +0 -23
  502. package/tokens/_md-comp-fab-tertiary.scss +0 -23
  503. /package/{fab/lib/fab-extended-styles.css.d.ts → chips/lib/elevated-styles.css.d.ts} +0 -0
  504. /package/{fab/lib/fab-shared-styles.css.d.ts → chips/lib/filter-styles.css.d.ts} +0 -0
@@ -1 +1 @@
1
- {"version":3,"file":"list-item.js","sourceRoot":"","sources":["list-item.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,6BAA6B;AAC7B,mCAAmC;AAEnC,OAAO,2BAA2B,CAAC;AACnC,OAAO,8BAA8B,CAAC;AAEtC,OAAO,EAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAiC,MAAM,KAAK,CAAC;AAC9E,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AACrE,OAAO,EAAY,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAEhE,OAAO,EAAC,YAAY,EAAC,MAAM,sCAAsC,CAAC;AAClE,OAAO,EAAC,YAAY,EAAE,qBAAqB,EAAC,MAAM,gCAAgC,CAAC;AACnF,OAAO,EAAC,MAAM,EAAC,MAAM,8BAA8B,CAAC;AAepD,gEAAgE;AAChE,MAAM,OAAO,UAAW,SAAQ,UAAU;IAA1C;;QAIE,uDAAuD;QACvD,SAAI,GAAa,U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AC,CAAC;;gDAAmB;AAO5C;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;;0CAAgB;AAKzD;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;;8CAClD;AAElB;IAAC,UAAU,CAAC,WAAW,CAAC;;0CAA2C;AACnE;IAAC,KAAK,CAAC,YAAY,CAAC;8BAA0B,WAAW;gDAAC;AAE1D;IAAC,KAAK,EAAE;;iDAAiC;AACzC;IAAC,KAAK,EAAE;;8CAA8B","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n// Required for @ariaProperty\n// tslint:disable:no-new-decorators\n\nimport '../../../ripple/ripple.js';\nimport '../../../focus/focus-ring.js';\n\nimport {html, LitElement, nothing, PropertyValues, TemplateResult} from 'lit';\nimport {property, query, queryAsync, state} from 'lit/decorators.js';\nimport {ClassInfo, classMap} from 'lit/directives/class-map.js';\n\nimport {ariaProperty} from '../../../decorators/aria-property.js';\nimport {pointerPress, shouldShowStrongFocus} from '../../../focus/strong-focus.js';\nimport {ripple} from '../../../ripple/directive.js';\nimport {MdRipple} from '../../../ripple/ripple.js';\nimport {ARIARole} from '../../../types/aria.js';\n\ninterface ListItemSelf {\n active: boolean;\n disabled: boolean;\n}\n\n/**\n * The interface of an item that is compatible with md-list. An item that is\n * selectable and disablable.\n */\nexport type ListItem = ListItemSelf&HTMLElement;\n\n// tslint:disable-next-line:enforce-comments-on-exported-symbols\nexport class ListItemEl extends LitElement implements ListItem {\n @ariaProperty\n // tslint:disable-next-line\n @property({type: String, attribute: 'data-role', noAccessor: true})\n // @ts-ignore(b/264292293): Use `override` with TS 4.9+\n role: ARIARole = 'listitem';\n @ariaProperty\n @property({type: String, attribute: 'data-aria-selected', noAccessor: true})\n override ariaSelected!: 'true'|'false';\n @ariaProperty\n @property({type: String, attribute: 'data-aria-checked', noAccessor: true})\n override ariaChecked!: 'true'|'false';\n\n /**\n * The primary, headline text of the list item.\n */\n @property() headline = '';\n\n /**\n * The one-line supporting text below the headline. Set\n * `multiLineSupportingText` to `true` to support multiple lines in the\n * supporting text.\n */\n @property() supportingText = '';\n\n /**\n * Modifies `supportingText` to support multiple lines.\n */\n @property({type: Boolean}) multiLineSupportingText = false;\n\n /**\n * The supporting text placed at the end of the item. Overriden by elements\n * slotted into the `end` slot.\n */\n @property() trailingSupportingText = '';\n\n /**\n * Disables the item and makes it non-selectable and non-interactive.\n */\n @property({type: Boolean}) disabled = false;\n\n /**\n * The tabindex of the underlying item.\n *\n * __NOTE:__ this is overriden by the keyboard behavior of `md-list` and by\n * setting `selected`.\n */\n @property({type: Number}) itemTabIndex = -1;\n\n /**\n * Whether or not the element is actively being interacted with by md-list.\n * When active, tabindex is set to 0, and in some list item variants (like\n * md-list-item), focuses the underlying item.\n */\n @property({type: Boolean, reflect: true}) active = false;\n\n /**\n * READONLY. Sets the `md-list-item` attribute on the element.\n */\n @property({type: Boolean, attribute: 'md-list-item', reflect: true})\n isListItem = true;\n\n @queryAsync('md-ripple') protected ripple!: Promise<MdRipple|null>;\n @query('.list-item') protected listItemRoot!: HTMLElement;\n\n @state() protected showFocusRing = false;\n @state() protected showRipple = false;\n\n /**\n * Only meant to be overriden by subclassing and not by the user. This is\n * so that we have control over focus on specific variants such as disabling\n * focus on <md-autocomplete-item> but enabling it for <md-menu-item>.\n */\n protected focusOnSelection = true;\n\n protected getRipple = () => {\n this.showRipple = true;\n return this.ripple;\n };\n\n private isFirstUpdate = true;\n\n override willUpdate(changed: PropertyValues<this>) {\n if (changed.has('active') && !this.disabled) {\n if (this.active) {\n this.itemTabIndex = 0;\n\n if (this.focusOnSelection) {\n this.showFocusRing = shouldShowStrongFocus();\n }\n\n // Do not reset anything if it's the first render because user could\n // have set `itemTabIndex` manually.\n } else if (!this.isFirstUpdate) {\n this.itemTabIndex = -1;\n }\n }\n }\n\n override render(): TemplateResult {\n return this.renderListItem(html`\n <div class=\"content-wrapper\">\n ${this.renderStart()}\n ${this.renderBody()}\n ${this.renderEnd()}\n ${this.renderRipple()}\n ${this.renderFocusRing()}\n </div>`);\n }\n\n /**\n * Renders the root list item.\n *\n * @param content {unkown} the child content of the list item.\n */\n protected renderListItem(content: unknown) {\n return html`\n <li\n tabindex=${this.disabled ? -1 : this.itemTabIndex}\n role=${this.role}\n aria-selected=${this.ariaSelected || nothing}\n aria-checked=${this.ariaChecked || nothing}\n class=\"list-item ${classMap(this.getRenderClasses())}\"\n @pointerdown=${this.onPointerdown}\n @focus=${this.onFocus}\n @blur=${this.onBlur}\n @click=${this.onClick}\n @pointerenter=${this.onPointerenter}\n @pointerleave=${this.onPointerleave}\n @keydown=${this.onKeydown}\n ${ripple(this.getRipple)}>${content}</li>`;\n }\n\n /**\n * Handles rendering of the ripple element.\n */\n protected renderRipple(): TemplateResult|typeof nothing {\n return this.showRipple ?\n html`<md-ripple ?disabled=\"${this.disabled}\"></md-ripple>` :\n nothing;\n }\n\n /**\n * Handles rendering of the focus ring.\n */\n protected renderFocusRing(): TemplateResult {\n return html`<md-focus-ring class=\"focus-ring\" .visible=\"${\n this.showFocusRing}\"></md-focus-ring>`;\n }\n\n /**\n * Classes applied to the list item root.\n */\n protected getRenderClasses(): ClassInfo {\n return {\n 'with-one-line': this.supportingText === '',\n 'with-two-line':\n this.supportingText !== '' && !this.multiLineSupportingText,\n 'with-three-line':\n this.supportingText !== '' && this.multiLineSupportingText,\n 'disabled': this.disabled\n };\n }\n\n /**\n * The content rendered at the start of the list item.\n */\n protected renderStart(): TemplateResult {\n return html`<div class=\"start\"><slot name=\"start\"></slot></div>`;\n }\n\n /**\n * Handles rendering the headline and supporting text.\n */\n protected renderBody(): TemplateResult {\n const supportingText =\n this.supportingText !== '' ? this.renderSupportingText() : '';\n\n return html`<div class=\"body\"\n ><span class=\"label-text\">${this.headline}</span>${supportingText}</div>`;\n }\n\n /**\n * Renders the one-line supporting text.\n */\n protected renderSupportingText(): TemplateResult {\n return html`<span\n class=\"supporting-text ${classMap(this.getSupportingTextClasses())}\"\n >${this.supportingText}</span>`;\n }\n\n /**\n * Gets the classes for the supporting text node\n */\n protected getSupportingTextClasses(): ClassInfo {\n return {'supporting-text--multi-line': this.multiLineSupportingText};\n }\n\n /**\n * The content rendered at the end of the list item.\n */\n protected renderEnd(): TemplateResult {\n const supportingText = this.trailingSupportingText !== '' ?\n this.renderTrailingSupportingText() :\n '';\n return html`<div class=\"end\"\n ><slot name=\"end\">${supportingText}</slot></div>`;\n }\n\n /**\n * Renders the supporting text at the end of the list item.\n */\n protected renderTrailingSupportingText(): TemplateResult {\n return html`<span class=\"trailing-supporting-text\"\n >${this.trailingSupportingText}</span>`;\n }\n\n protected onPointerdown() {\n pointerPress();\n this.showFocusRing = shouldShowStrongFocus();\n }\n\n protected onFocus() {\n this.showFocusRing = shouldShowStrongFocus();\n }\n\n protected onBlur() {\n this.showFocusRing = false;\n }\n\n // For easier overriding in menu-item\n protected onClick(e: Event) {}\n protected onKeydown(e: KeyboardEvent) {}\n protected onPointerenter(e: Event) {}\n protected onPointerleave(e: Event) {}\n\n override updated(changed: PropertyValues<this>) {\n super.updated(changed);\n\n // will focus the list item root if it is selected but not on the first\n // update or else it may cause the page to jump on first load.\n if (changed.has('active') && !this.isFirstUpdate && this.active &&\n this.focusOnSelection) {\n this.focus();\n }\n\n this.isFirstUpdate = false;\n }\n\n override focus() {\n this.listItemRoot?.focus?.();\n }\n}\n"]}
1
+ {"version":3,"file":"list-item.js","sourceRoot":"","sources":["list-item.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;AAEH,OAAO,2BAA2B,CAAC;AACnC,OAAO,8BAA8B,CAAC;AAEtC,OAAO,EAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAiB,MAAM,KAAK,CAAC;AAC9D,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,UAAU,EAAE,KAAK,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,IAAI,CAAC,aAAa,GAAG,KAAK,CAAC;IAC7B,CAAC;IAEQ,KAAK;QACZ,IAAI,CAAC,YAAY,EAAE,KAAK,EAAE,EAAE,CAAC;IAC/B,CAAC;CACF;;AA9NC;IACE,yBAAyB,CAAC,EAAI,CAAC,CAAC;AAClC,CAAC,GAAA,CAAA;AAKW;IAAX,QAAQ,EAAE;4CAAe;AAOd;IAAX,QAAQ,EAAE;kDAAqB;AAKL;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;2DAAiC;AAM/C;IAAX,QAAQ,EAAE;0DAA6B;AAKb;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;4CAAkB;AAQlB;IAAzB,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;gDAAmB;AAOF;IAAzC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;0CAAgB;AAMzD;IADC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,cAAc,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;8CAClD;AAEO;IAAxB,UAAU,CAAC,WAAW,CAAC;0CAAkD;AACrD;IAApB,KAAK,CAAC,YAAY,CAAC;gDAAoD;AAG/D;IAAR,KAAK,EAAE;8CAA4B","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../../ripple/ripple.js';\nimport '../../../focus/focus-ring.js';\n\nimport {html, LitElement, nothing, PropertyValues} from 'lit';\nimport {property, query, queryAsync, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\n\nimport {requestUpdateOnAriaChange} from '../../../aria/delegate.js';\nimport {ripple} from '../../../ripple/directive.js';\nimport {MdRipple} from '../../../ripple/ripple.js';\nimport {ARIAMixinStrict, ARIARole} from '../../../types/aria.js';\n\ninterface ListItemSelf {\n active: boolean;\n disabled: boolean;\n}\n\n/**\n * The interface of an item that is compatible with md-list. An item that is\n * selectable and disablable.\n */\nexport type ListItem = ListItemSelf&HTMLElement;\n\n// tslint:disable-next-line:enforce-comments-on-exported-symbols\nexport class ListItemEl extends LitElement implements ListItem {\n static {\n requestUpdateOnAriaChange(this);\n }\n\n /**\n * The primary, headline text of the list item.\n */\n @property() headline = '';\n\n /**\n * The one-line supporting text below the headline. Set\n * `multiLineSupportingText` to `true` to support multiple lines in the\n * supporting text.\n */\n @property() supportingText = '';\n\n /**\n * Modifies `supportingText` to support multiple lines.\n */\n @property({type: Boolean}) multiLineSupportingText = false;\n\n /**\n * The supporting text placed at the end of the item. Overriden by elements\n * slotted into the `end` slot.\n */\n @property() trailingSupportingText = '';\n\n /**\n * Disables the item and makes it non-selectable and non-interactive.\n */\n @property({type: Boolean}) disabled = false;\n\n /**\n * The tabindex of the underlying item.\n *\n * __NOTE:__ this is overriden by the keyboard behavior of `md-list` and by\n * setting `selected`.\n */\n @property({type: Number}) itemTabIndex = -1;\n\n /**\n * Whether or not the element is actively being interacted with by md-list.\n * When active, tabindex is set to 0, and in some list item variants (like\n * md-list-item), focuses the underlying item.\n */\n @property({type: Boolean, reflect: true}) active = false;\n\n /**\n * READONLY. Sets the `md-list-item` attribute on the element.\n */\n @property({type: Boolean, attribute: 'md-list-item', reflect: true})\n isListItem = true;\n\n @queryAsync('md-ripple') private readonly ripple!: Promise<MdRipple|null>;\n @query('.list-item') protected readonly listItemRoot!: HTMLElement|null;\n protected readonly listItemRole: ARIARole = 'listitem';\n\n @state() private showRipple = false;\n\n /**\n * Only meant to be overriden by subclassing and not by the user. This is\n * so that we have control over focus on specific variants such as disabling\n * focus on <md-autocomplete-item> but enabling it for <md-menu-item>.\n */\n protected focusOnActivation = true;\n\n protected readonly getRipple = () => {\n this.showRipple = true;\n return this.ripple;\n };\n\n private isFirstUpdate = true;\n\n protected override willUpdate(changed: PropertyValues<this>) {\n if (changed.has('active') && !this.disabled) {\n if (this.active) {\n this.itemTabIndex = 0;\n } else if (!this.isFirstUpdate) {\n // Do not reset anything if it's the first render because user could\n // have set `itemTabIndex` manually.\n this.itemTabIndex = -1;\n }\n }\n }\n\n protected override render() {\n return this.renderListItem(html`\n <div class=\"content-wrapper\">\n ${this.renderStart()}\n ${this.renderBody()}\n ${this.renderEnd()}\n ${this.renderRipple()}\n ${this.renderFocusRing()}\n </div>`);\n }\n\n /**\n * Renders the root list item.\n *\n * @param content {unkown} the child content of the list item.\n */\n protected renderListItem(content: unknown) {\n return html`\n <li\n id=\"item\"\n tabindex=${this.disabled ? -1 : this.itemTabIndex}\n role=${this.listItemRole}\n aria-selected=${(this as ARIAMixinStrict).ariaSelected || nothing}\n aria-checked=${(this as ARIAMixinStrict).ariaChecked || nothing}\n class=\"list-item ${classMap(this.getRenderClasses())}\"\n @click=${this.onClick}\n @pointerenter=${this.onPointerenter}\n @pointerleave=${this.onPointerleave}\n @keydown=${this.onKeydown}\n ${ripple(this.getRipple)}>${content}</li>`;\n }\n\n /**\n * Handles rendering of the ripple element.\n */\n private renderRipple() {\n return this.showRipple ?\n html`<md-ripple ?disabled=\"${this.disabled}\"></md-ripple>` :\n nothing;\n }\n\n /**\n * Handles rendering of the focus ring.\n */\n private renderFocusRing() {\n return html`<md-focus-ring class=\"focus-ring\" for=\"item\"></md-focus-ring>`;\n }\n\n /**\n * Classes applied to the list item root.\n */\n protected getRenderClasses() {\n return {\n 'with-one-line': this.supportingText === '',\n 'with-two-line':\n this.supportingText !== '' && !this.multiLineSupportingText,\n 'with-three-line':\n this.supportingText !== '' && this.multiLineSupportingText,\n 'disabled': this.disabled\n };\n }\n\n /**\n * The content rendered at the start of the list item.\n */\n private renderStart() {\n return html`<div class=\"start\"><slot name=\"start\"></slot></div>`;\n }\n\n /**\n * Handles rendering the headline and supporting text.\n */\n private renderBody() {\n const supportingText =\n this.supportingText !== '' ? this.renderSupportingText() : '';\n\n return html`<div class=\"body\"\n ><span class=\"label-text\">${this.headline}</span>${supportingText}</div>`;\n }\n\n /**\n * Renders the one-line supporting text.\n */\n private renderSupportingText() {\n return html`<span\n class=\"supporting-text ${classMap(this.getSupportingTextClasses())}\"\n >${this.supportingText}</span>`;\n }\n\n /**\n * Gets the classes for the supporting text node\n */\n private getSupportingTextClasses() {\n return {'supporting-text--multi-line': this.multiLineSupportingText};\n }\n\n /**\n * The content rendered at the end of the list item.\n */\n protected renderEnd() {\n const supportingText = this.trailingSupportingText !== '' ?\n this.renderTrailingSupportingText() :\n '';\n return html`<div class=\"end\"\n ><slot name=\"end\">${supportingText}</slot></div>`;\n }\n\n /**\n * Renders the supporting text at the end of the list item.\n */\n private renderTrailingSupportingText() {\n return html`<span class=\"trailing-supporting-text\"\n >${this.trailingSupportingText}</span>`;\n }\n\n // For easier overriding in menu-item\n protected onClick?(event: Event): void;\n protected onKeydown?(event: KeyboardEvent): void;\n protected onPointerenter?(event: Event): void;\n protected onPointerleave?(event: Event): void;\n\n protected override updated(changed: PropertyValues<this>) {\n super.updated(changed);\n\n // will focus the list item root if it is selected but not on the first\n // update or else it may cause the page to jump on first load.\n if (changed.has('active') && !this.isFirstUpdate && this.active &&\n this.focusOnActivation) {\n this.focus();\n }\n\n this.isFirstUpdate = false;\n }\n\n override focus() {\n this.listItemRoot?.focus?.();\n }\n}\n"]}
@@ -3,7 +3,7 @@
3
3
  * Copyright 2022 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { __decorate, __metadata } from "tslib";
6
+ import { __decorate } from "tslib";
7
7
  import { html, nothing } from 'lit';
8
8
  import { property } from 'lit/decorators.js';
9
9
  import { classMap } from 'lit/directives/class-map.js';
@@ -14,16 +14,14 @@ export class ListItemLink extends ListItemEl {
14
14
  renderListItem(content) {
15
15
  return html `
16
16
  <a
17
+ id="item"
17
18
  tabindex=${this.disabled ? -1 : this.itemTabIndex}
18
- role=${this.role}
19
+ role=${this.listItemRole}
19
20
  aria-selected=${this.ariaSelected || nothing}
20
21
  aria-checked=${this.ariaChecked || nothing}
21
22
  class="list-item ${classMap(this.getRenderClasses())}"
22
23
  href=${this.href}
23
24
  target=${this.target || nothing}
24
- @pointerdown=${this.onPointerdown}
25
- @focus=${this.onFocus}
26
- @blur=${this.onBlur}
27
25
  @click=${this.onClick}
28
26
  @pointerenter=${this.onPointerenter}
29
27
  @pointerleave=${this.onPointerleave}
@@ -32,11 +30,9 @@ export class ListItemLink extends ListItemEl {
32
30
  }
33
31
  }
34
32
  __decorate([
35
- property(),
36
- __metadata("design:type", String)
33
+ property()
37
34
  ], ListItemLink.prototype, "href", void 0);
38
35
  __decorate([
39
- property(),
40
- __metadata("design:type", String)
36
+ property()
41
37
  ], ListItemLink.prototype, "target", void 0);
42
38
  //# sourceMappingURL=list-item-link.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"list-item-link.js","sourceRoot":"","sources":["list-item-link.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,IAAI,EAAE,OAAO,EAAC,MAAM,KAAK,CAAC;AAClC,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAErD,OAAO,EAAC,MAAM,EAAC,MAAM,8BAA8B,CAAC;AACpD,OAAO,EAAC,UAAU,EAAC,MAAM,0BAA0B,CAAC;AAIpD,gEAAgE;AAChE,MAAM,OAAO,YAAa,SAAQ,UAAU;IAUvB,cAAc,CAAC,OAAgB;QAChD,OAAO,IAAI,CAAA;;qBAEM,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY;iBAC1C,IAAI,CAAC,IAAI;0BACA,IAAI,CAAC,YAAY,IAAI,OAAO;yBAC7B,IAAI,CAAC,WAAW,IAAI,OAAO;6BACvB,QAAQ,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;iBAC7C,IAAI,CAAC,IAAI;mBACP,IAAI,CAAC,MAAoB,IAAI,OAAO;yBAC9B,IAAI,CAAC,aAAa;mBACxB,IAAI,CAAC,OAAO;kBACb,IAAI,CAAC,MAAM;mBACV,IAAI,CAAC,OAAO;0BACL,IAAI,CAAC,cAAc;0BACnB,IAAI,CAAC,cAAc;qBACxB,IAAI,CAAC,SAAS;YACvB,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,OAAO,MAAM,CAAC;IAClD,CAAC;CACF;AAzBC;IAAC,QAAQ,EAAE;;0CAAe;AAK1B;IAAC,QAAQ,EAAE;;4CAAiB","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {html, nothing} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\n\nimport {ripple} from '../../../ripple/directive.js';\nimport {ListItemEl} from '../listitem/list-item.js';\n\ntype LinkTarget = '_blank'|'_parent'|'_self'|'_top';\n\n// tslint:disable-next-line:enforce-comments-on-exported-symbols\nexport class ListItemLink extends ListItemEl {\n /**\n * Sets the underlying `HTMLAnchorElement`'s `href` resource attribute.\n */\n @property() href!: string;\n\n /**\n * Sets the underlying `HTMLAnchorElement`'s `target` attribute.\n */\n @property() target!: string;\n protected override renderListItem(content: unknown) {\n return html`\n <a\n tabindex=${this.disabled ? -1 : this.itemTabIndex}\n role=${this.role}\n aria-selected=${this.ariaSelected || nothing}\n aria-checked=${this.ariaChecked || nothing}\n class=\"list-item ${classMap(this.getRenderClasses())}\"\n href=${this.href}\n target=${this.target as LinkTarget || nothing}\n @pointerdown=${this.onPointerdown}\n @focus=${this.onFocus}\n @blur=${this.onBlur}\n @click=${this.onClick}\n @pointerenter=${this.onPointerenter}\n @pointerleave=${this.onPointerleave}\n @keydown=${this.onKeydown}\n ${ripple(this.getRipple)}>${content}</a>`;\n }\n}"]}
1
+ {"version":3,"file":"list-item-link.js","sourceRoot":"","sources":["list-item-link.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,IAAI,EAAE,OAAO,EAAC,MAAM,KAAK,CAAC;AAClC,OAAO,EAAC,QAAQ,EAAC,MAAM,mBAAmB,CAAC;AAC3C,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAErD,OAAO,EAAC,MAAM,EAAC,MAAM,8BAA8B,CAAC;AAEpD,OAAO,EAAC,UAAU,EAAC,MAAM,0BAA0B,CAAC;AAIpD,gEAAgE;AAChE,MAAM,OAAO,YAAa,SAAQ,UAAU;IAUvB,cAAc,CAAC,OAAgB;QAChD,OAAO,IAAI,CAAA;;;qBAGM,IAAI,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,YAAY;iBAC1C,IAAI,CAAC,YAAY;0BACP,IAAwB,CAAC,YAAY,IAAI,OAAO;yBACjD,IAAwB,CAAC,WAAW,IAAI,OAAO;6BAC5C,QAAQ,CAAC,IAAI,CAAC,gBAAgB,EAAE,CAAC;iBAC7C,IAAI,CAAC,IAAI;mBACP,IAAI,CAAC,MAAoB,IAAI,OAAO;mBACpC,IAAI,CAAC,OAAO;0BACL,IAAI,CAAC,cAAc;0BACnB,IAAI,CAAC,cAAc;qBACxB,IAAI,CAAC,SAAS;YACvB,MAAM,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,OAAO,MAAM,CAAC;IAClD,CAAC;CACF;AAvBa;IAAX,QAAQ,EAAE;0CAAe;AAKd;IAAX,QAAQ,EAAE;4CAAiB","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {html, nothing} from 'lit';\nimport {property} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\n\nimport {ripple} from '../../../ripple/directive.js';\nimport {ARIAMixinStrict} from '../../../types/aria.js';\nimport {ListItemEl} from '../listitem/list-item.js';\n\ntype LinkTarget = '_blank'|'_parent'|'_self'|'_top';\n\n// tslint:disable-next-line:enforce-comments-on-exported-symbols\nexport class ListItemLink extends ListItemEl {\n /**\n * Sets the underlying `HTMLAnchorElement`'s `href` resource attribute.\n */\n @property() href!: string;\n\n /**\n * Sets the underlying `HTMLAnchorElement`'s `target` attribute.\n */\n @property() target!: string;\n protected override renderListItem(content: unknown) {\n return html`\n <a\n id=\"item\"\n tabindex=${this.disabled ? -1 : this.itemTabIndex}\n role=${this.listItemRole}\n aria-selected=${(this as ARIAMixinStrict).ariaSelected || nothing}\n aria-checked=${(this as ARIAMixinStrict).ariaChecked || nothing}\n class=\"list-item ${classMap(this.getRenderClasses())}\"\n href=${this.href}\n target=${this.target as LinkTarget || nothing}\n @click=${this.onClick}\n @pointerenter=${this.onPointerenter}\n @pointerleave=${this.onPointerleave}\n @keydown=${this.onKeydown}\n ${ripple(this.getRipple)}>${content}</a>`;\n }\n}\n"]}
@@ -17,29 +17,27 @@
17
17
  @use '../../tokens';
18
18
  // go/keep-sorted end
19
19
 
20
- $_custom-property-prefix: 'menu';
20
+ @mixin theme($tokens) {
21
+ $tokens: theme.validate-theme(tokens.md-comp-menu-values(), $tokens);
21
22
 
22
- @mixin theme($theme) {
23
- $theme: theme.validate-theme(tokens.md-comp-menu-values(), $theme);
24
- $theme: _resolve-tokens($theme);
25
- $theme: theme.create-theme-vars($theme, $_custom-property-prefix);
26
-
27
- @include theme.emit-theme-vars($theme);
23
+ @each $token, $value in $tokens {
24
+ @if $value {
25
+ --md-menu-#{$token}: #{$value};
26
+ }
27
+ }
28
28
  }
29
29
 
30
30
  @mixin styles() {
31
31
  $tokens: tokens.md-comp-menu-values();
32
- $tokens: _resolve-tokens($tokens);
33
- $tokens: theme.create-theme-vars($tokens, $_custom-property-prefix);
34
32
 
35
33
  :host {
36
34
  @each $token, $value in $tokens {
37
- --_#{$token}: #{$value};
35
+ --_#{$token}: var(--md-menu-#{$token}, #{$value});
38
36
  }
39
37
 
40
38
  @include md-list.theme(
41
39
  (
42
- 'list-item-container-color': var(--_container-color),
40
+ 'container-color': var(--_container-color),
43
41
  )
44
42
  );
45
43
 
@@ -103,21 +101,3 @@ $_custom-property-prefix: 'menu';
103
101
  }
104
102
  }
105
103
  }
106
-
107
- @function _resolve-tokens($tokens) {
108
- // removes unused tokens
109
- $unused-tokens: ();
110
- @each $token in map-keys($tokens) {
111
- $index: string.index($token, 'list-item');
112
-
113
- @if $index {
114
- $unused-tokens: list.append($unused-tokens, $token);
115
- }
116
- }
117
-
118
- @each $token in $unused-tokens {
119
- $tokens: map.remove($tokens, $token);
120
- }
121
-
122
- @return $tokens;
123
- }
@@ -4,6 +4,6 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import { css } from 'lit';
7
- export const styles = css `:host{--_container-color: var(--md-menu-container-color, var(--md-sys-color-surface-container, #f3edf7));--_container-elevation: var(--md-menu-container-elevation, 2);--_container-shadow-color: var(--md-menu-container-shadow-color, var(--md-sys-color-shadow, #000));--_container-shape: var(--md-menu-container-shape, 4px);--md-list-container-color:var(--_container-color);--md-elevation-level:var(--_container-elevation);--md-elevation-shadow-color:var(--_container-shadow-color);--md-focus-ring-shape-start-start:var(--md-focus-ring-shape, var(--_container-shape));--md-focus-ring-shape-start-end:var(--md-focus-ring-shape, var(--_container-shape));--md-focus-ring-shape-end-end:var(--md-focus-ring-shape, var(--_container-shape));--md-focus-ring-shape-end-start:var(--md-focus-ring-shape, var(--_container-shape));min-width:300px}.menu{border-radius:var(--_container-shape);display:none;opacity:0;z-index:20;position:absolute;user-select:none;max-height:inherit;height:inherit;min-width:inherit}.menu.fixed{position:fixed}.menu md-list{height:inherit;max-height:inherit;display:block;overflow:auto;min-width:inherit;border-radius:inherit}.menu.has-overflow md-list{overflow:visible}.menu.animating md-list{pointer-events:none;overflow:hidden}.menu.animating ::slotted(.hidden){opacity:0}.menu slot{display:block;height:inherit;max-height:inherit}/*# sourceMappingURL=menu-styles.css.map */
7
+ export const styles = css `:host{--_container-color: var(--md-menu-container-color, var(--md-sys-color-surface-container, #f3edf7));--_container-elevation: var(--md-menu-container-elevation, 2);--_container-shadow-color: var(--md-menu-container-shadow-color, var(--md-sys-color-shadow, #000));--_container-shape: var(--md-menu-container-shape, 4px);--md-list-container-color: var(--_container-color);--md-elevation-level:var(--_container-elevation);--md-elevation-shadow-color:var(--_container-shadow-color);--md-focus-ring-shape: var(--_container-shape);min-width:300px}.menu{border-radius:var(--_container-shape);display:none;opacity:0;z-index:20;position:absolute;user-select:none;max-height:inherit;height:inherit;min-width:inherit}.menu.fixed{position:fixed}.menu md-list{height:inherit;max-height:inherit;display:block;overflow:auto;min-width:inherit;border-radius:inherit}.menu.has-overflow md-list{overflow:visible}.menu.animating md-list{pointer-events:none;overflow:hidden}.menu.animating ::slotted(.hidden){opacity:0}.menu slot{display:block;height:inherit;max-height:inherit}/*# sourceMappingURL=menu-styles.css.map */
8
8
  `;
9
9
  //# sourceMappingURL=menu-styles.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"menu-styles.css.js","sourceRoot":"","sources":["menu-styles.css.ts"],"names":[],"mappings":"AAAA;;;;IAII;AACH,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;CACzB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n import {css} from 'lit';\n export const styles = css`:host{--_container-color: var(--md-menu-container-color, var(--md-sys-color-surface-container, #f3edf7));--_container-elevation: var(--md-menu-container-elevation, 2);--_container-shadow-color: var(--md-menu-container-shadow-color, var(--md-sys-color-shadow, #000));--_container-shape: var(--md-menu-container-shape, 4px);--md-list-container-color:var(--_container-color);--md-elevation-level:var(--_container-elevation);--md-elevation-shadow-color:var(--_container-shadow-color);--md-focus-ring-shape-start-start:var(--md-focus-ring-shape, var(--_container-shape));--md-focus-ring-shape-start-end:var(--md-focus-ring-shape, var(--_container-shape));--md-focus-ring-shape-end-end:var(--md-focus-ring-shape, var(--_container-shape));--md-focus-ring-shape-end-start:var(--md-focus-ring-shape, var(--_container-shape));min-width:300px}.menu{border-radius:var(--_container-shape);display:none;opacity:0;z-index:20;position:absolute;user-select:none;max-height:inherit;height:inherit;min-width:inherit}.menu.fixed{position:fixed}.menu md-list{height:inherit;max-height:inherit;display:block;overflow:auto;min-width:inherit;border-radius:inherit}.menu.has-overflow md-list{overflow:visible}.menu.animating md-list{pointer-events:none;overflow:hidden}.menu.animating ::slotted(.hidden){opacity:0}.menu slot{display:block;height:inherit;max-height:inherit}/*# sourceMappingURL=menu-styles.css.map */\n`;\n "]}
1
+ {"version":3,"file":"menu-styles.css.js","sourceRoot":"","sources":["menu-styles.css.ts"],"names":[],"mappings":"AAAA;;;;IAII;AACH,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;CACzB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n import {css} from 'lit';\n export const styles = css`:host{--_container-color: var(--md-menu-container-color, var(--md-sys-color-surface-container, #f3edf7));--_container-elevation: var(--md-menu-container-elevation, 2);--_container-shadow-color: var(--md-menu-container-shadow-color, var(--md-sys-color-shadow, #000));--_container-shape: var(--md-menu-container-shape, 4px);--md-list-container-color: var(--_container-color);--md-elevation-level:var(--_container-elevation);--md-elevation-shadow-color:var(--_container-shadow-color);--md-focus-ring-shape: var(--_container-shape);min-width:300px}.menu{border-radius:var(--_container-shape);display:none;opacity:0;z-index:20;position:absolute;user-select:none;max-height:inherit;height:inherit;min-width:inherit}.menu.fixed{position:fixed}.menu md-list{height:inherit;max-height:inherit;display:block;overflow:auto;min-width:inherit;border-radius:inherit}.menu.has-overflow md-list{overflow:visible}.menu.animating md-list{pointer-events:none;overflow:hidden}.menu.animating ::slotted(.hidden){opacity:0}.menu slot{display:block;height:inherit;max-height:inherit}/*# sourceMappingURL=menu-styles.css.map */\n`;\n "]}
@@ -7,11 +7,9 @@ import '../../list/list.js';
7
7
  import '../../focus/focus-ring.js';
8
8
  import '../../elevation/elevation.js';
9
9
  import { LitElement } from 'lit';
10
- import { MdFocusRing } from '../../focus/focus-ring.js';
11
- import { List } from '../../list/lib/list.js';
12
10
  import { ARIARole } from '../../types/aria.js';
13
- import { ActivateTypeaheadEvent, DeactivateTypeaheadEvent, MenuItem } from './shared.js';
14
- import { Corner, SurfacePositionController, SurfacePositionTarget } from './surfacePositionController.js';
11
+ import { MenuItem } from './shared.js';
12
+ import { Corner, SurfacePositionTarget } from './surfacePositionController.js';
15
13
  import { TypeaheadController } from './typeaheadController.js';
16
14
  export { Corner } from './surfacePositionController.js';
17
15
  /**
@@ -29,11 +27,9 @@ export type DefaultFocusState = 'NONE' | 'LIST_ROOT' | 'FIRST_ITEM' | 'LAST_ITEM
29
27
  * @fires closed Fired once the menu is closed, after any animations
30
28
  */
31
29
  export declare abstract class Menu extends LitElement {
32
- protected readonly listElement: List | null;
33
- protected readonly surfaceEl: HTMLElement | null;
34
- protected readonly slotEl: HTMLSlotElement | null;
35
- protected readonly focusRing: MdFocusRing;
36
- ariaLabel: string;
30
+ private readonly listElement;
31
+ private readonly surfaceEl;
32
+ private readonly slotEl;
37
33
  /**
38
34
  * The element in which the menu should align to.
39
35
  */
@@ -88,7 +84,7 @@ export declare abstract class Menu extends LitElement {
88
84
  /**
89
85
  * The role of the underlying list element.
90
86
  */
91
- role: ARIARole;
87
+ type: ARIARole;
92
88
  /**
93
89
  * The max time between the keystrokes of the typeahead menu behavior before
94
90
  * it clears the typeahead buffer.
@@ -127,17 +123,17 @@ export declare abstract class Menu extends LitElement {
127
123
  * The element that should be focused by default once opened.
128
124
  */
129
125
  defaultFocus: DefaultFocusState;
130
- protected typeaheadActive: boolean;
131
- protected openCloseAnimationSignal: import("../../motion/animation.js").AnimationSignal;
126
+ private typeaheadActive;
127
+ private readonly openCloseAnimationSignal;
132
128
  /**
133
129
  * Whether the menu is animating upwards or downwards when opening. This is
134
130
  * helpful for calculating some animation calculations.
135
131
  */
136
- protected get openDirection(): 'UP' | 'DOWN';
132
+ private get openDirection();
137
133
  /**
138
134
  * The element that was focused before the menu opened.
139
135
  */
140
- protected lastFocusedElement: HTMLElement | null;
136
+ private lastFocusedElement;
141
137
  /**
142
138
  * Handles typeahead navigation through the menu.
143
139
  */
@@ -145,75 +141,70 @@ export declare abstract class Menu extends LitElement {
145
141
  /**
146
142
  * Handles positioning the surface and aligning it to the anchor.
147
143
  */
148
- protected menuPositionController: SurfacePositionController;
144
+ private readonly menuPositionController;
149
145
  /**
150
146
  * The menu items associated with this menu. The items must be `MenuItem`s and
151
147
  * have both the `md-menu-item` and `md-list-item` attributes.
152
148
  */
153
149
  get items(): MenuItem[];
154
- render(): import("lit-html").TemplateResult<1>;
150
+ protected render(): import("lit-html").TemplateResult<1>;
155
151
  /**
156
152
  * Renders the positionable surface element and its contents.
157
153
  */
158
- protected renderSurface(): import("lit-html").TemplateResult<1>;
154
+ private renderSurface;
159
155
  /**
160
156
  * Renders the List element and its items
161
157
  */
162
- protected renderList(): import("lit-html").TemplateResult<1>;
158
+ private renderList;
163
159
  /**
164
160
  * Renders the menu items' slot
165
161
  */
166
- protected renderMenuItems(): import("lit-html").TemplateResult<1>;
162
+ private renderMenuItems;
167
163
  /**
168
164
  * Renders the elevation component.
169
165
  */
170
- protected renderElevation(): import("lit-html").TemplateResult<1>;
166
+ private renderElevation;
171
167
  /**
172
168
  * Renders the focus ring component.
173
169
  */
174
- protected renderFocusRing(): import("lit-html").TemplateResult<1>;
175
- protected getSurfaceClasses(): {
176
- open: boolean;
177
- fixed: boolean;
178
- 'has-overflow': boolean;
179
- };
180
- protected handleFocusout(e: FocusEvent): Promise<void>;
181
- protected handleListFocus(): void;
182
- protected handleListClick(): void;
183
- protected handleListKeydown(e: KeyboardEvent): void;
184
- protected handleListBlur(): void;
170
+ private renderFocusRing;
171
+ private getSurfaceClasses;
172
+ private handleFocusout;
173
+ private handleListKeydown;
185
174
  /**
186
175
  * Saves the last focused element focuses the new element based on
187
176
  * `defaultFocus`, and animates open.
188
177
  */
189
- protected onOpened: () => void;
178
+ private readonly onOpened;
190
179
  /**
191
180
  * Animates closed.
192
181
  */
193
- protected beforeClose: () => Promise<void>;
182
+ private readonly beforeClose;
194
183
  /**
195
184
  * Focuses the last focused element.
196
185
  */
197
- protected onClosed: () => void;
186
+ private readonly onClosed;
198
187
  /**
199
188
  * Performs the opening animation:
200
189
  *
201
190
  * https://direct.googleplex.com/#/spec/295000003+271060003
202
191
  */
203
- protected animateOpen(): void;
192
+ private animateOpen;
204
193
  /**
205
194
  * Performs the closing animation:
206
195
  *
207
196
  * https://direct.googleplex.com/#/spec/295000003+271060003
208
197
  */
209
- protected animateClose(): Promise<unknown>;
198
+ private animateClose;
210
199
  connectedCallback(): void;
211
200
  disconnectedCallback(): void;
212
- protected onWindowClick: (e: MouseEvent) => void;
213
- protected onCloseMenu(e: Event): void;
214
- protected onDeactivateItems(e: Event): void;
215
- protected handleDeactivateTypeahead(e: DeactivateTypeaheadEvent): void;
216
- protected handleActivateTypeahead(e: ActivateTypeaheadEvent): void;
201
+ private readonly onWindowClick;
202
+ private onCloseMenu;
203
+ private onDeactivateItems;
204
+ private handleDeactivateTypeahead;
205
+ private handleActivateTypeahead;
206
+ private handleStayOpenOnFocusout;
207
+ private handleCloseOnFocusout;
217
208
  focus(): void;
218
209
  close(): void;
219
210
  show(): void;
package/menu/lib/menu.js CHANGED
@@ -3,19 +3,16 @@
3
3
  * Copyright 2022 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { __decorate, __metadata } from "tslib";
7
- // Required for @ariaProperty
8
- // tslint:disable:no-new-decorators
6
+ var _a;
7
+ import { __decorate } from "tslib";
9
8
  import '../../list/list.js';
10
9
  import '../../focus/focus-ring.js';
11
10
  import '../../elevation/elevation.js';
12
- import { html, isServer, LitElement } from 'lit';
11
+ import { html, isServer, LitElement, nothing } from 'lit';
13
12
  import { eventOptions, property, query, state } from 'lit/decorators.js';
14
13
  import { classMap } from 'lit/directives/class-map.js';
15
14
  import { styleMap } from 'lit/directives/style-map.js';
16
- import { ariaProperty } from '../../decorators/aria-property.js';
17
- import { MdFocusRing } from '../../focus/focus-ring.js';
18
- import { pointerPress, shouldShowStrongFocus } from '../../focus/strong-focus.js';
15
+ import { requestUpdateOnAriaChange } from '../../aria/delegate.js';
19
16
  import { List } from '../../list/lib/list.js';
20
17
  import { createAnimationSignal, EASING } from '../../motion/animation.js';
21
18
  import { isElementInSubtree } from './shared.js';
@@ -105,7 +102,7 @@ export class Menu extends LitElement {
105
102
  /**
106
103
  * The role of the underlying list element.
107
104
  */
108
- this.role = 'list';
105
+ this.type = 'menu';
109
106
  /**
110
107
  * The max time between the keystrokes of the typeahead menu behavior before
111
108
  * it clears the typeahead buffer.
@@ -280,8 +277,8 @@ export class Menu extends LitElement {
280
277
  class="menu ${classMap(this.getSurfaceClasses())}"
281
278
  style=${styleMap(this.menuPositionController.surfaceStyles)}
282
279
  @focusout=${this.handleFocusout}>
283
- ${this.renderList()}
284
280
  ${this.renderElevation()}
281
+ ${this.renderList()}
285
282
  ${this.renderFocusRing()}
286
283
  </div>
287
284
  `;
@@ -290,14 +287,14 @@ export class Menu extends LitElement {
290
287
  * Renders the List element and its items
291
288
  */
292
289
  renderList() {
290
+ // Needed for closure conformance
291
+ const { ariaLabel } = this;
293
292
  return html `
294
293
  <md-list
295
- .ariaLabel=${this.ariaLabel}
296
- .role=${this.role}
294
+ id="list"
295
+ aria-label=${ariaLabel || nothing}
296
+ type=${this.type}
297
297
  listTabIndex=${this.listTabIndex}
298
- @focus=${this.handleListFocus}
299
- @blur=${this.handleListBlur}
300
- @click=${this.handleListClick}
301
298
  @keydown=${this.handleListKeydown}>
302
299
  ${this.renderMenuItems()}
303
300
  </md-list>`;
@@ -310,7 +307,9 @@ export class Menu extends LitElement {
310
307
  @close-menu=${this.onCloseMenu}
311
308
  @deactivate-items=${this.onDeactivateItems}
312
309
  @deactivate-typeahead=${this.handleDeactivateTypeahead}
313
- @activate-typeahead=${this.handleActivateTypeahead}></slot>`;
310
+ @activate-typeahead=${this.handleActivateTypeahead}
311
+ @stay-open-on-focusout=${this.handleStayOpenOnFocusout}
312
+ @close-on-focusout=${this.handleCloseOnFocusout}></slot>`;
314
313
  }
315
314
  /**
316
315
  * Renders the elevation component.
@@ -322,7 +321,7 @@ export class Menu extends LitElement {
322
321
  * Renders the focus ring component.
323
322
  */
324
323
  renderFocusRing() {
325
- return html `<md-focus-ring></md-focus-ring>`;
324
+ return html `<md-focus-ring for="list"></md-focus-ring>`;
326
325
  }
327
326
  getSurfaceClasses() {
328
327
  return {
@@ -353,22 +352,12 @@ export class Menu extends LitElement {
353
352
  // return to previous behavior
354
353
  this.skipRestoreFocus = oldRestoreFocus;
355
354
  }
356
- handleListFocus() {
357
- this.focusRing.visible = shouldShowStrongFocus();
358
- }
359
- handleListClick() {
360
- pointerPress();
361
- this.focusRing.visible = shouldShowStrongFocus();
362
- }
363
355
  // Capture so that we can grab the event before it reaches the list item
364
356
  // istelf. Specifically useful for the case where typeahead encounters a space
365
357
  // and we don't want the menu item to close the menu.
366
358
  handleListKeydown(e) {
367
359
  this.typeaheadController.onKeydown(e);
368
360
  }
369
- handleListBlur() {
370
- this.focusRing.visible = false;
371
- }
372
361
  /**
373
362
  * Performs the opening animation:
374
363
  *
@@ -547,7 +536,7 @@ export class Menu extends LitElement {
547
536
  window.removeEventListener('click', this.onWindowClick, { capture: true });
548
537
  }
549
538
  }
550
- onCloseMenu(e) {
539
+ onCloseMenu() {
551
540
  this.close();
552
541
  }
553
542
  onDeactivateItems(e) {
@@ -555,6 +544,7 @@ export class Menu extends LitElement {
555
544
  const items = this.items;
556
545
  for (const item of items) {
557
546
  item.active = false;
547
+ item.selected = false;
558
548
  }
559
549
  }
560
550
  handleDeactivateTypeahead(e) {
@@ -569,6 +559,14 @@ export class Menu extends LitElement {
569
559
  e.stopPropagation();
570
560
  this.typeaheadActive = true;
571
561
  }
562
+ handleStayOpenOnFocusout(e) {
563
+ e.stopPropagation();
564
+ this.stayOpenOnFocusout = true;
565
+ }
566
+ handleCloseOnFocusout(e) {
567
+ e.stopPropagation();
568
+ this.stayOpenOnFocusout = false;
569
+ }
572
570
  focus() {
573
571
  this.listElement?.focus();
574
572
  }
@@ -582,100 +580,71 @@ export class Menu extends LitElement {
582
580
  this.open = true;
583
581
  }
584
582
  }
583
+ _a = Menu;
584
+ (() => {
585
+ requestUpdateOnAriaChange(_a);
586
+ })();
585
587
  __decorate([
586
- query('md-list'),
587
- __metadata("design:type", List)
588
+ query('md-list')
588
589
  ], Menu.prototype, "listElement", void 0);
589
590
  __decorate([
590
- query('.menu'),
591
- __metadata("design:type", HTMLElement)
591
+ query('.menu')
592
592
  ], Menu.prototype, "surfaceEl", void 0);
593
593
  __decorate([
594
- query('slot'),
595
- __metadata("design:type", HTMLSlotElement)
594
+ query('slot')
596
595
  ], Menu.prototype, "slotEl", void 0);
597
596
  __decorate([
598
- query('md-focus-ring'),
599
- __metadata("design:type", MdFocusRing)
600
- ], Menu.prototype, "focusRing", void 0);
601
- __decorate([
602
- ariaProperty,
603
- property({ type: String, attribute: 'data-aria-label', noAccessor: true }),
604
- __metadata("design:type", String)
605
- ], Menu.prototype, "ariaLabel", void 0);
606
- __decorate([
607
- property({ attribute: false }),
608
- __metadata("design:type", Object)
597
+ property({ attribute: false })
609
598
  ], Menu.prototype, "anchor", void 0);
610
599
  __decorate([
611
- property({ type: Boolean }),
612
- __metadata("design:type", Object)
600
+ property({ type: Boolean })
613
601
  ], Menu.prototype, "fixed", void 0);
614
602
  __decorate([
615
- property({ type: Boolean }),
616
- __metadata("design:type", Object)
603
+ property({ type: Boolean })
617
604
  ], Menu.prototype, "quick", void 0);
618
605
  __decorate([
619
- property({ type: Boolean, attribute: 'has-overflow' }),
620
- __metadata("design:type", Object)
606
+ property({ type: Boolean, attribute: 'has-overflow' })
621
607
  ], Menu.prototype, "hasOverflow", void 0);
622
608
  __decorate([
623
- property({ type: Boolean, reflect: true }),
624
- __metadata("design:type", Object)
609
+ property({ type: Boolean, reflect: true })
625
610
  ], Menu.prototype, "open", void 0);
626
611
  __decorate([
627
- property({ type: Number, attribute: 'x-offset' }),
628
- __metadata("design:type", Object)
612
+ property({ type: Number, attribute: 'x-offset' })
629
613
  ], Menu.prototype, "xOffset", void 0);
630
614
  __decorate([
631
- property({ type: Number, attribute: 'y-offset' }),
632
- __metadata("design:type", Object)
615
+ property({ type: Number, attribute: 'y-offset' })
633
616
  ], Menu.prototype, "yOffset", void 0);
634
617
  __decorate([
635
- property({ type: Number, attribute: 'list-tab-index' }),
636
- __metadata("design:type", Object)
618
+ property({ type: Number, attribute: 'list-tab-index' })
637
619
  ], Menu.prototype, "listTabIndex", void 0);
638
620
  __decorate([
639
- ariaProperty,
640
- property({ type: String, attribute: 'data-role', noAccessor: true }),
641
- __metadata("design:type", String)
642
- ], Menu.prototype, "role", void 0);
621
+ property()
622
+ ], Menu.prototype, "type", void 0);
643
623
  __decorate([
644
- property({ type: Number, attribute: 'typeahead-delay' }),
645
- __metadata("design:type", Object)
624
+ property({ type: Number, attribute: 'typeahead-delay' })
646
625
  ], Menu.prototype, "typeaheadBufferTime", void 0);
647
626
  __decorate([
648
- property({ type: String, attribute: 'anchor-corner' }),
649
- __metadata("design:type", String)
627
+ property({ attribute: 'anchor-corner' })
650
628
  ], Menu.prototype, "anchorCorner", void 0);
651
629
  __decorate([
652
- property({ type: String, attribute: 'menu-corner' }),
653
- __metadata("design:type", String)
630
+ property({ attribute: 'menu-corner' })
654
631
  ], Menu.prototype, "menuCorner", void 0);
655
632
  __decorate([
656
- property({ type: Boolean, attribute: 'stay-open-on-outside-click' }),
657
- __metadata("design:type", Object)
633
+ property({ type: Boolean, attribute: 'stay-open-on-outside-click' })
658
634
  ], Menu.prototype, "stayOpenOnOutsideClick", void 0);
659
635
  __decorate([
660
- property({ type: Boolean, attribute: 'stay-open-on-focusout' }),
661
- __metadata("design:type", Object)
636
+ property({ type: Boolean, attribute: 'stay-open-on-focusout' })
662
637
  ], Menu.prototype, "stayOpenOnFocusout", void 0);
663
638
  __decorate([
664
- property({ type: Boolean, attribute: 'skip-restore-focus' }),
665
- __metadata("design:type", Object)
639
+ property({ type: Boolean, attribute: 'skip-restore-focus' })
666
640
  ], Menu.prototype, "skipRestoreFocus", void 0);
667
641
  __decorate([
668
- property({ type: String, attribute: 'default-focus' }),
669
- __metadata("design:type", String)
642
+ property({ attribute: 'default-focus' })
670
643
  ], Menu.prototype, "defaultFocus", void 0);
671
644
  __decorate([
672
- state(),
673
- __metadata("design:type", Object)
645
+ state()
674
646
  ], Menu.prototype, "typeaheadActive", void 0);
675
647
  __decorate([
676
- eventOptions({ capture: true }),
677
- __metadata("design:type", Function),
678
- __metadata("design:paramtypes", [KeyboardEvent]),
679
- __metadata("design:returntype", void 0)
648
+ eventOptions({ capture: true })
680
649
  ], Menu.prototype, "handleListKeydown", null);
681
650
  //# sourceMappingURL=menu.js.map