@material/web 1.0.0-pre.16 → 1.0.0-pre.17

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 (291) hide show
  1. package/README.md +5 -5
  2. package/all.d.ts +4 -2
  3. package/all.js +4 -2
  4. package/all.js.map +1 -1
  5. package/button/internal/_elevation.scss +4 -0
  6. package/button/internal/_shared.scss +5 -1
  7. package/button/internal/elevated-styles.css.js +1 -1
  8. package/button/internal/elevated-styles.css.js.map +1 -1
  9. package/button/internal/filled-styles.css.js +1 -1
  10. package/button/internal/filled-styles.css.js.map +1 -1
  11. package/button/internal/filled-tonal-styles.css.js +1 -1
  12. package/button/internal/filled-tonal-styles.css.js.map +1 -1
  13. package/button/internal/outlined-styles.css.js +1 -1
  14. package/button/internal/outlined-styles.css.js.map +1 -1
  15. package/button/internal/shared-elevation-styles.css.js +1 -1
  16. package/button/internal/shared-elevation-styles.css.js.map +1 -1
  17. package/button/internal/shared-styles.css.js +1 -1
  18. package/button/internal/shared-styles.css.js.map +1 -1
  19. package/button/internal/text-styles.css.js +1 -1
  20. package/button/internal/text-styles.css.js.map +1 -1
  21. package/checkbox/internal/_checkbox.scss +1 -1
  22. package/checkbox/internal/checkbox-styles.css.js +1 -1
  23. package/checkbox/internal/checkbox-styles.css.js.map +1 -1
  24. package/chips/internal/_elevated.scss +0 -4
  25. package/chips/internal/_shared.scss +10 -1
  26. package/chips/internal/assist-chip.d.ts +3 -1
  27. package/chips/internal/assist-chip.js +11 -8
  28. package/chips/internal/assist-chip.js.map +1 -1
  29. package/chips/internal/assist-styles.css.js +1 -1
  30. package/chips/internal/assist-styles.css.js.map +1 -1
  31. package/chips/internal/chip.d.ts +18 -10
  32. package/chips/internal/chip.js +38 -33
  33. package/chips/internal/chip.js.map +1 -1
  34. package/chips/internal/elevated-styles.css.js +1 -1
  35. package/chips/internal/elevated-styles.css.js.map +1 -1
  36. package/chips/internal/filter-chip.d.ts +6 -7
  37. package/chips/internal/filter-chip.js +13 -14
  38. package/chips/internal/filter-chip.js.map +1 -1
  39. package/chips/internal/filter-styles.css.js +1 -1
  40. package/chips/internal/filter-styles.css.js.map +1 -1
  41. package/chips/internal/input-chip.d.ts +4 -2
  42. package/chips/internal/input-chip.js +16 -12
  43. package/chips/internal/input-chip.js.map +1 -1
  44. package/chips/internal/input-styles.css.js +1 -1
  45. package/chips/internal/input-styles.css.js.map +1 -1
  46. package/chips/internal/multi-action-chip.d.ts +2 -3
  47. package/chips/internal/multi-action-chip.js +3 -3
  48. package/chips/internal/multi-action-chip.js.map +1 -1
  49. package/chips/internal/shared-styles.css.js +1 -1
  50. package/chips/internal/shared-styles.css.js.map +1 -1
  51. package/chips/internal/suggestion-styles.css.js +1 -1
  52. package/chips/internal/suggestion-styles.css.js.map +1 -1
  53. package/color/_color.scss +193 -0
  54. package/common.d.ts +2 -2
  55. package/common.js +2 -2
  56. package/common.js.map +1 -1
  57. package/dialog/internal/_dialog.scss +19 -4
  58. package/dialog/internal/dialog-styles.css.js +1 -1
  59. package/dialog/internal/dialog-styles.css.js.map +1 -1
  60. package/dialog/internal/dialog.d.ts +6 -0
  61. package/dialog/internal/dialog.js +36 -4
  62. package/dialog/internal/dialog.js.map +1 -1
  63. package/elevation/internal/elevation.d.ts +1 -0
  64. package/elevation/internal/elevation.js +6 -0
  65. package/elevation/internal/elevation.js.map +1 -1
  66. package/fab/internal/_shared.scss +4 -1
  67. package/fab/internal/fab-branded-styles.css.js +1 -1
  68. package/fab/internal/fab-branded-styles.css.js.map +1 -1
  69. package/fab/internal/fab-styles.css.js +1 -1
  70. package/fab/internal/fab-styles.css.js.map +1 -1
  71. package/fab/internal/shared-styles.css.js +1 -1
  72. package/fab/internal/shared-styles.css.js.map +1 -1
  73. package/field/internal/_content.scss +9 -1
  74. package/field/internal/_filled-field.scss +12 -0
  75. package/field/internal/_label.scss +4 -1
  76. package/field/internal/_outlined-field.scss +33 -0
  77. package/field/internal/_shared.scss +14 -6
  78. package/field/internal/_supporting-text.scss +4 -1
  79. package/field/internal/field.d.ts +2 -0
  80. package/field/internal/field.js +19 -0
  81. package/field/internal/field.js.map +1 -1
  82. package/field/internal/filled-styles.css.js +1 -1
  83. package/field/internal/filled-styles.css.js.map +1 -1
  84. package/field/internal/outlined-styles.css.js +1 -1
  85. package/field/internal/outlined-styles.css.js.map +1 -1
  86. package/field/internal/shared-styles.css.js +1 -1
  87. package/field/internal/shared-styles.css.js.map +1 -1
  88. package/focus/internal/focus-ring.d.ts +3 -1
  89. package/focus/internal/focus-ring.js +9 -0
  90. package/focus/internal/focus-ring.js.map +1 -1
  91. package/icon/internal/icon.js +4 -0
  92. package/icon/internal/icon.js.map +1 -1
  93. package/iconbutton/internal/_icon-button.scss +8 -0
  94. package/iconbutton/internal/icon-button.d.ts +3 -3
  95. package/iconbutton/internal/icon-button.js +4 -4
  96. package/iconbutton/internal/icon-button.js.map +1 -1
  97. package/iconbutton/internal/standard-styles.css.js +1 -1
  98. package/iconbutton/internal/standard-styles.css.js.map +1 -1
  99. package/internal/aria/aria.d.ts +52 -1
  100. package/internal/aria/aria.js +146 -0
  101. package/internal/aria/aria.js.map +1 -1
  102. package/internal/controller/attachable-controller.d.ts +5 -4
  103. package/internal/controller/attachable-controller.js +8 -0
  104. package/internal/controller/attachable-controller.js.map +1 -1
  105. package/labs/badge/internal/_badge.scss +5 -1
  106. package/labs/badge/internal/badge-styles.css.js +1 -1
  107. package/labs/badge/internal/badge-styles.css.js.map +1 -1
  108. package/labs/navigationbar/internal/navigation-bar-styles.css.js +1 -1
  109. package/labs/navigationbar/internal/navigation-bar-styles.css.js.map +1 -1
  110. package/labs/navigationtab/internal/_navigation-tab.scss +4 -1
  111. package/labs/navigationtab/internal/navigation-tab-styles.css.js +1 -1
  112. package/labs/navigationtab/internal/navigation-tab-styles.css.js.map +1 -1
  113. package/labs/segmentedbutton/internal/_shared.scss +4 -1
  114. package/labs/segmentedbutton/internal/outlined-styles.css.js +1 -1
  115. package/labs/segmentedbutton/internal/outlined-styles.css.js.map +1 -1
  116. package/labs/segmentedbutton/internal/shared-styles.css.js +1 -1
  117. package/labs/segmentedbutton/internal/shared-styles.css.js.map +1 -1
  118. package/labs/segmentedbuttonset/internal/outlined-styles.css.js +1 -1
  119. package/labs/segmentedbuttonset/internal/outlined-styles.css.js.map +1 -1
  120. package/list/harness.js +1 -1
  121. package/list/harness.js.map +1 -1
  122. package/list/internal/_list.scss +1 -4
  123. package/list/internal/list-styles.css.js +1 -1
  124. package/list/internal/list-styles.css.js.map +1 -1
  125. package/list/internal/list.d.ts +1 -2
  126. package/list/internal/list.js +4 -6
  127. package/list/internal/list.js.map +1 -1
  128. package/list/internal/listitem/_list-item.scss +17 -5
  129. package/list/internal/listitem/list-item-styles.css.js +1 -1
  130. package/list/internal/listitem/list-item-styles.css.js.map +1 -1
  131. package/menu/harness.d.ts +1 -1
  132. package/menu/harness.js +3 -4
  133. package/menu/harness.js.map +1 -1
  134. package/menu/internal/_menu.scss +32 -26
  135. package/menu/internal/menu-styles.css.js +1 -1
  136. package/menu/internal/menu-styles.css.js.map +1 -1
  137. package/menu/internal/menu.d.ts +15 -4
  138. package/menu/internal/menu.js +27 -4
  139. package/menu/internal/menu.js.map +1 -1
  140. package/menu/internal/menuitem/menu-item.js +1 -1
  141. package/menu/internal/menuitem/menu-item.js.map +1 -1
  142. package/menu/internal/submenuitem/sub-menu-item.d.ts +3 -0
  143. package/menu/internal/submenuitem/sub-menu-item.js +42 -12
  144. package/menu/internal/submenuitem/sub-menu-item.js.map +1 -1
  145. package/menu/internal/typeaheadController.js +2 -1
  146. package/menu/internal/typeaheadController.js.map +1 -1
  147. package/menu/menu.d.ts +12 -5
  148. package/menu/menu.js +12 -5
  149. package/menu/menu.js.map +1 -1
  150. package/menu/sub-menu-item.d.ts +3 -4
  151. package/menu/sub-menu-item.js +3 -4
  152. package/menu/sub-menu-item.js.map +1 -1
  153. package/package.json +10 -2
  154. package/progress/internal/_circular-progress.scss +4 -2
  155. package/progress/internal/_linear-progress.scss +2 -2
  156. package/progress/internal/circular-progress-styles.css.js +1 -1
  157. package/progress/internal/circular-progress-styles.css.js.map +1 -1
  158. package/radio/harness.d.ts +1 -1
  159. package/radio/harness.js +1 -1
  160. package/radio/harness.js.map +1 -1
  161. package/radio/internal/_radio.scss +4 -4
  162. package/radio/internal/radio-styles.css.js +1 -1
  163. package/radio/internal/radio-styles.css.js.map +1 -1
  164. package/radio/internal/radio.d.ts +3 -5
  165. package/radio/internal/radio.js +37 -32
  166. package/radio/internal/radio.js.map +1 -1
  167. package/radio/internal/single-selection-controller.js +4 -3
  168. package/radio/internal/single-selection-controller.js.map +1 -1
  169. package/ripple/internal/ripple.d.ts +3 -1
  170. package/ripple/internal/ripple.js +9 -0
  171. package/ripple/internal/ripple.js.map +1 -1
  172. package/select/harness.d.ts +1 -1
  173. package/select/harness.js +1 -3
  174. package/select/harness.js.map +1 -1
  175. package/select/internal/_filled-select.scss +13 -3
  176. package/select/internal/_outlined-select.scss +13 -3
  177. package/select/internal/filled-select-styles.css.js +1 -1
  178. package/select/internal/filled-select-styles.css.js.map +1 -1
  179. package/select/internal/outlined-select-styles.css.js +1 -1
  180. package/select/internal/outlined-select-styles.css.js.map +1 -1
  181. package/select/internal/select.d.ts +8 -2
  182. package/select/internal/select.js +21 -8
  183. package/select/internal/select.js.map +1 -1
  184. package/slider/internal/_slider.scss +9 -4
  185. package/slider/internal/forced-colors-styles.css.js +1 -1
  186. package/slider/internal/forced-colors-styles.css.js.map +1 -1
  187. package/slider/internal/forced-colors-styles.scss +31 -4
  188. package/slider/internal/slider-styles.css.js +1 -1
  189. package/slider/internal/slider-styles.css.js.map +1 -1
  190. package/switch/harness.d.ts +1 -1
  191. package/switch/harness.js +1 -1
  192. package/switch/harness.js.map +1 -1
  193. package/switch/internal/_handle.scss +22 -21
  194. package/switch/internal/_icon.scss +12 -12
  195. package/switch/internal/_switch.scss +11 -19
  196. package/switch/internal/_track.scss +12 -12
  197. package/switch/internal/forced-colors-styles.css.js +1 -1
  198. package/switch/internal/forced-colors-styles.css.js.map +1 -1
  199. package/switch/internal/forced-colors-styles.scss +1 -0
  200. package/switch/internal/switch-styles.css.js +1 -1
  201. package/switch/internal/switch-styles.css.js.map +1 -1
  202. package/switch/internal/switch.d.ts +72 -2
  203. package/switch/internal/switch.js +144 -30
  204. package/switch/internal/switch.js.map +1 -1
  205. package/tabs/{_tab.scss → _primary-tab.scss} +1 -1
  206. package/tabs/_secondary-tab.scss +6 -0
  207. package/tabs/harness.d.ts +2 -2
  208. package/tabs/harness.js +1 -2
  209. package/tabs/harness.js.map +1 -1
  210. package/tabs/internal/_primary-tab.scss +70 -0
  211. package/tabs/internal/_secondary-tab.scss +61 -0
  212. package/tabs/internal/_tab.scss +8 -157
  213. package/tabs/internal/_tabs.scss +9 -10
  214. package/tabs/internal/primary-tab-styles.css.d.ts +1 -0
  215. package/tabs/internal/primary-tab-styles.css.js +9 -0
  216. package/tabs/internal/primary-tab-styles.css.js.map +1 -0
  217. package/tabs/internal/primary-tab-styles.scss +10 -0
  218. package/tabs/internal/primary-tab.d.ts +20 -0
  219. package/tabs/internal/primary-tab.js +30 -0
  220. package/tabs/internal/primary-tab.js.map +1 -0
  221. package/tabs/internal/secondary-tab-styles.css.d.ts +1 -0
  222. package/tabs/internal/secondary-tab-styles.css.js +9 -0
  223. package/tabs/internal/secondary-tab-styles.css.js.map +1 -0
  224. package/tabs/internal/secondary-tab-styles.scss +10 -0
  225. package/tabs/internal/secondary-tab.d.ts +12 -0
  226. package/tabs/internal/secondary-tab.js +16 -0
  227. package/tabs/internal/secondary-tab.js.map +1 -0
  228. package/tabs/internal/tab-styles.css.js +1 -1
  229. package/tabs/internal/tab-styles.css.js.map +1 -1
  230. package/tabs/internal/tab.d.ts +16 -34
  231. package/tabs/internal/tab.js +81 -80
  232. package/tabs/internal/tab.js.map +1 -1
  233. package/tabs/internal/tabs-styles.css.js +1 -1
  234. package/tabs/internal/tabs-styles.css.js.map +1 -1
  235. package/tabs/internal/tabs.d.ts +6 -20
  236. package/tabs/internal/tabs.js +33 -66
  237. package/tabs/internal/tabs.js.map +1 -1
  238. package/tabs/{tab.d.ts → primary-tab.d.ts} +3 -4
  239. package/tabs/primary-tab.js +23 -0
  240. package/tabs/primary-tab.js.map +1 -0
  241. package/tabs/secondary-tab.d.ts +18 -0
  242. package/tabs/secondary-tab.js +23 -0
  243. package/tabs/secondary-tab.js.map +1 -0
  244. package/tabs/tabs.d.ts +0 -2
  245. package/tabs/tabs.js +0 -2
  246. package/tabs/tabs.js.map +1 -1
  247. package/textfield/internal/_filled-text-field.scss +12 -3
  248. package/textfield/internal/_outlined-text-field.scss +12 -3
  249. package/textfield/internal/filled-styles.css.js +1 -1
  250. package/textfield/internal/filled-styles.css.js.map +1 -1
  251. package/textfield/internal/outlined-styles.css.js +1 -1
  252. package/textfield/internal/outlined-styles.css.js.map +1 -1
  253. package/textfield/internal/text-field.d.ts +19 -0
  254. package/textfield/internal/text-field.js +20 -0
  255. package/textfield/internal/text-field.js.map +1 -1
  256. package/tokens/_index.scss +5 -6
  257. package/tokens/_md-comp-assist-chip.scss +6 -14
  258. package/tokens/_md-comp-badge.scss +1 -14
  259. package/tokens/{_md-comp-circular-progress-indicator.scss → _md-comp-circular-progress.scss} +3 -1
  260. package/tokens/_md-comp-dialog.scss +10 -17
  261. package/tokens/_md-comp-elevated-button.scss +5 -13
  262. package/tokens/_md-comp-fab-branded.scss +9 -10
  263. package/tokens/_md-comp-fab.scss +9 -10
  264. package/tokens/_md-comp-filled-button.scss +5 -13
  265. package/tokens/_md-comp-filled-field.scss +25 -6
  266. package/tokens/_md-comp-filled-select.scss +15 -15
  267. package/tokens/_md-comp-filled-text-field.scss +15 -19
  268. package/tokens/_md-comp-filled-tonal-button.scss +5 -13
  269. package/tokens/_md-comp-filter-chip.scss +5 -13
  270. package/tokens/_md-comp-input-chip.scss +5 -13
  271. package/tokens/_md-comp-list-item.scss +18 -37
  272. package/tokens/_md-comp-outlined-button.scss +5 -13
  273. package/tokens/_md-comp-outlined-field.scss +25 -6
  274. package/tokens/_md-comp-outlined-segmented-button.scss +5 -13
  275. package/tokens/_md-comp-outlined-select.scss +15 -15
  276. package/tokens/_md-comp-outlined-text-field.scss +15 -19
  277. package/tokens/_md-comp-primary-tab.scss +132 -0
  278. package/tokens/_md-comp-secondary-tab.scss +139 -0
  279. package/tokens/_md-comp-slider.scss +16 -16
  280. package/tokens/_md-comp-suggestion-chip.scss +5 -13
  281. package/tokens/_md-comp-test-table.scss +13 -2
  282. package/tokens/_md-comp-text-button.scss +5 -13
  283. package/tokens/_md-ref-palette.scss +101 -1
  284. package/tokens/_md-ref-typeface.scss +3 -0
  285. package/tokens/_md-sys-color.scss +57 -2
  286. package/tokens/_md-sys-typescale.scss +66 -5
  287. package/tabs/tab.js +0 -22
  288. package/tabs/tab.js.map +0 -1
  289. package/tokens/_md-comp-tab.scss +0 -285
  290. /package/tokens/{_md-comp-linear-progress-indicator.scss → _md-comp-linear-progress.scss} +0 -0
  291. /package/tokens/{_md-comp-radio-button.scss → _md-comp-radio.scss} +0 -0
@@ -37,7 +37,7 @@ export class List extends LitElement {
37
37
  // Needed for closure conformance
38
38
  const { ariaLabel } = this;
39
39
  return html `
40
- <ul class="md3-list"
40
+ <ul class="list"
41
41
  aria-label=${ariaLabel || nothing}
42
42
  tabindex=${this.listTabIndex}
43
43
  role=${this.type || nothing}
@@ -51,9 +51,7 @@ export class List extends LitElement {
51
51
  * The content to be slotted into the list.
52
52
  */
53
53
  renderContent() {
54
- return html `<span><slot @click=${(event) => {
55
- event.stopPropagation();
56
- }}></slot></span>`;
54
+ return html `<span><slot></slot></span>`;
57
55
  }
58
56
  /**
59
57
  * Handles keyboard navigation in the list.
@@ -62,7 +60,7 @@ export class List extends LitElement {
62
60
  */
63
61
  handleKeydown(event) {
64
62
  const key = event.key;
65
- if (!isNavigableKey(key)) {
63
+ if (event.defaultPrevented || !isNavigableKey(key)) {
66
64
  return;
67
65
  }
68
66
  // do not use this.items directly so we don't re-query the DOM unnecessarily
@@ -295,7 +293,7 @@ __decorate([
295
293
  property({ type: Number, attribute: 'list-tabindex' })
296
294
  ], List.prototype, "listTabIndex", void 0);
297
295
  __decorate([
298
- query('.md3-list')
296
+ query('.list')
299
297
  ], List.prototype, "listRoot", void 0);
300
298
  __decorate([
301
299
  queryAssignedElements({ flatten: true, selector: '[md-list-item]' })
@@ -1 +1 @@
1
- {"version":3,"file":"list.js","sourceRoot":"","sources":["list.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAC,MAAM,KAAK,CAAC;AAC9C,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAC,MAAM,mBAAmB,CAAC;AAGzE,OAAO,EAAC,yBAAyB,EAAC,MAAM,iCAAiC,CAAC;AAI1E,MAAM,cAAc,GAAG;IACrB,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;CACF,CAAC;AAaX,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC;AAE/D,SAAS,cAAc,CAAC,GAAW;IACjC,OAAO,eAAe,CAAC,GAAG,CAAC,GAAwB,CAAC,CAAC;AACvD,CAAC;AAED,gEAAgE;AAChE,MAAM,OAAO,IAAK,SAAQ,UAAU;IAApC;;QASc,SAAI,GAAgB,MAAM,CAAC;QAEvC;;WAEG;QACmD,iBAAY,GAAG,CAAC,CAAC;IA4SzE,CAAC;IA7RoB,MAAM;QACvB,OAAO,IAAI,CAAC,UAAU,EAAE,CAAC;IAC3B,CAAC;IAED;;OAEG;IACK,UAAU;QAChB,iCAAiC;QACjC,MAAM,EAAC,SAAS,EAAC,GAAG,IAAuB,CAAC;QAC5C,OAAO,IAAI,CAAA;;qBAEM,SAAS,IAAI,OAAO;mBACtB,IAAI,CAAC,YAA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AC,EAAE,EAAE;YACrC,MAAM,SAAS,GAAG,CAAC,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC;YAC5D,MAAM,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC;YAE9B,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;gBAClB,OAAO,IAAI,CAAC;aACb;SACF;QAED,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC5C,CAAC;;AAxTD;IACE,yBAAyB,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC,GAAA,CAAA;AAED,kBAAkB;AACF,sBAAiB,GACZ,EAAC,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,IAAI,EAAC,CAAC;AAE9C;IAAX,QAAQ,EAAE;kCAA4B;AAKe;IAArD,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAC,CAAC;0CAAkB;AAEnD;IAAnB,KAAK,CAAC,WAAW,CAAC;sCAAqC;AAWxD;IADC,qBAAqB,CAAC,EAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,gBAAgB,EAAC,CAAC;mCAChD","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {html, LitElement, nothing} from 'lit';\nimport {property, query, queryAssignedElements} from 'lit/decorators.js';\n\nimport {ARIAMixinStrict, ARIARole} from '../../internal/aria/aria.js';\nimport {requestUpdateOnAriaChange} from '../../internal/aria/delegate.js';\n\nimport {ListItem} from './listitem/list-item.js';\n\nconst NAVIGABLE_KEYS = {\n ArrowDown: 'ArrowDown',\n ArrowUp: 'ArrowUp',\n Home: 'Home',\n End: 'End',\n} as const;\n\n/**\n * A record that describes a list item in a list with metadata such a reference\n * to the item and its index in the list.\n */\nexport interface ItemRecord {\n item: ListItem;\n index: number;\n}\n\ntype NavigatableValues = typeof NAVIGABLE_KEYS[keyof typeof NAVIGABLE_KEYS];\n\nconst navigableKeySet = new Set(Object.values(NAVIGABLE_KEYS));\n\nfunction isNavigableKey(key: string): key is NavigatableValues {\n return navigableKeySet.has(key as NavigatableValues);\n}\n\n// tslint:disable-next-line:enforce-comments-on-exported-symbols\nexport class List extends LitElement {\n static {\n requestUpdateOnAriaChange(List);\n }\n\n /** @nocollapse */\n static override shadowRootOptions:\n ShadowRootInit = {mode: 'open', delegatesFocus: true};\n\n @property() type: ARIARole|'' = 'list';\n\n /**\n * The tabindex of the underlying list.\n */\n @property({type: Number, attribute: 'list-tabindex'}) listTabIndex = 0;\n\n @query('.md3-list') private listRoot!: HTMLElement|null;\n\n /**\n * An array of activatable and disableable list items. Queries every assigned\n * element that has the `md-list-item` attribute.\n *\n * _NOTE:_ This is a shallow, flattened query via\n * `HTMLSlotElement.queryAssignedElements` and thus will _only_ include direct\n * children / directly slotted elements.\n */\n @queryAssignedElements({flatten: true, selector: '[md-list-item]'})\n items!: ListItem[];\n\n protected override render() {\n return this.renderList();\n }\n\n /**\n * Renders the main list element.\n */\n private renderList() {\n // Needed for closure conformance\n const {ariaLabel} = this as ARIAMixinStrict;\n return html`\n <ul class=\"md3-list\"\n aria-label=${ariaLabel || nothing}\n tabindex=${this.listTabIndex}\n role=${this.type || nothing}\n @keydown=${this.handleKeydown}\n >\n ${this.renderContent()}\n </ul>\n `;\n }\n\n /**\n * The content to be slotted into the list.\n */\n private renderContent() {\n return html`<span><slot @click=${(event: Event) => {\n event.stopPropagation();\n }}></slot></span>`;\n }\n\n /**\n * Handles keyboard navigation in the list.\n *\n * @param event {KeyboardEvent} The keyboard event that triggers this handler.\n */\n private handleKeydown(event: KeyboardEvent) {\n const key = event.key;\n if (!isNavigableKey(key)) {\n return;\n }\n // do not use this.items directly so we don't re-query the DOM unnecessarily\n const items = this.items;\n\n if (!items.length) {\n return;\n }\n\n const activeItemRecord = List.getActiveItem(items);\n\n if (activeItemRecord) {\n activeItemRecord.item.active = false;\n }\n\n event.preventDefault();\n\n switch (key) {\n // Activate the next item\n case NAVIGABLE_KEYS.ArrowDown:\n this.activateNextItemInternal(items, activeItemRecord);\n break;\n\n // Activate the previous item\n case NAVIGABLE_KEYS.ArrowUp:\n this.activatePreviousItemInternal(items, activeItemRecord);\n break;\n\n // Activate the first item\n case NAVIGABLE_KEYS.Home:\n List.activateFirstItem(items);\n break;\n\n // Activate the last item\n case NAVIGABLE_KEYS.End:\n List.activateLastItem(items);\n break;\n\n default:\n break;\n }\n }\n\n private activateNextItemInternal(\n items: ListItem[], activeItemRecord: null|ItemRecord): ListItem|null {\n if (activeItemRecord) {\n const next = List.getNextItem(items, activeItemRecord.index);\n\n if (next) next.active = true;\n\n return next;\n } else {\n return List.activateFirstItem(items);\n }\n }\n\n private activatePreviousItemInternal(\n items: ListItem[], activeItemRecord: null|ItemRecord): ListItem|null {\n if (activeItemRecord) {\n const prev = List.getPrevItem(items, activeItemRecord.index);\n if (prev) prev.active = true;\n return prev;\n } else {\n return List.activateLastItem(items);\n }\n }\n\n /**\n * Activates the next item in the list. If at the end of the list, the first\n * item will be activated.\n *\n * @return The activated list item or `null` if there are no items.\n */\n activateNextItem(): ListItem|null {\n const items = this.items;\n const activeItemRecord = List.getActiveItem(items);\n if (activeItemRecord) {\n activeItemRecord.item.active = false;\n }\n return this.activateNextItemInternal(items, activeItemRecord);\n }\n\n /**\n * Activates the previous item in the list. If at the start of the list, the\n * last item will be activated.\n *\n * @return The activated list item or `null` if there are no items.\n */\n activatePreviousItem(): ListItem|null {\n const items = this.items;\n const activeItemRecord = List.getActiveItem(items);\n if (activeItemRecord) {\n activeItemRecord.item.active = false;\n }\n return this.activatePreviousItemInternal(items, activeItemRecord);\n }\n\n /**\n * Activates the first non-disabled item of a given array of items.\n *\n * @param items {Array<ListItem>} The items from which to activate the\n * first item.\n * @nocollapse\n */\n static activateFirstItem<T extends ListItem>(items: T[]) {\n // NOTE: These selector functions are static and not on the instance such\n // that multiple operations can be chained and we do not have to re-query\n // the DOM\n const firstItem = List.getFirstActivatableItem(items);\n if (firstItem) {\n firstItem.active = true;\n }\n return firstItem;\n }\n\n /**\n * Activates the last non-disabled item of a given array of items.\n *\n * @param items {Array<ListItem>} The items from which to activate the\n * last item.\n * @nocollapse\n */\n static activateLastItem<T extends ListItem>(items: T[]) {\n const lastItem = List.getLastActivatableItem(items);\n if (lastItem) {\n lastItem.active = true;\n }\n return lastItem;\n }\n\n /**\n * Deactivates the currently active item of a given array of items.\n *\n * @param items {Array<ListItem>} The items from which to deactivate the\n * active item.\n * @return A record of the deleselcted activated item including the item and\n * the index of the item or `null` if none are deactivated.\n * @nocollapse\n */\n static deactivateActiveItem<T extends ListItem>(items: T[]) {\n const activeItem = List.getActiveItem(items);\n if (activeItem) {\n activeItem.item.active = false;\n }\n return activeItem;\n }\n\n override focus() {\n this.listRoot?.focus();\n }\n\n /**\n * Retrieves the first activated item of a given array of items.\n *\n * @param items {Array<ListItem>} The items to search.\n * @return A record of the first activated item including the item and the\n * index of the item or `null` if none are activated.\n * @nocollapse\n */\n static getActiveItem<T extends ListItem>(items: T[]) {\n for (let i = 0; i < items.length; i++) {\n const item = items[i];\n if (item.active) {\n return {\n item,\n index: i,\n } as ItemRecord;\n }\n }\n return null;\n }\n\n /**\n * Retrieves the first non-disabled item of a given array of items. This\n * the first item that is not disabled.\n *\n * @param items {Array<ListItem>} The items to search.\n * @return The first activatable item or `null` if none are activatable.\n * @nocollapse\n */\n static getFirstActivatableItem<T extends ListItem>(items: T[]) {\n for (const item of items) {\n if (!item.disabled) {\n return item;\n }\n }\n\n return null;\n }\n\n /**\n * Retrieves the last non-disabled item of a given array of items.\n *\n * @param items {Array<ListItem>} The items to search.\n * @return The last activatable item or `null` if none are activatable.\n * @nocollapse\n */\n static getLastActivatableItem<T extends ListItem>(items: T[]) {\n for (let i = items.length - 1; i >= 0; i--) {\n const item = items[i];\n if (!item.disabled) {\n return item;\n }\n }\n\n return null;\n }\n\n /**\n * Retrieves the next non-disabled item of a given array of items.\n *\n * @param items {Array<ListItem>} The items to search.\n * @param index {{index: number}} The index to search from.\n * @return The next activatable item or `null` if none are activatable.\n */\n private static getNextItem<T extends ListItem>(items: T[], index: number) {\n for (let i = 1; i < items.length; i++) {\n const nextIndex = (i + index) % items.length;\n const item = items[nextIndex];\n if (!item.disabled) {\n return item;\n }\n }\n\n return items[index] ? items[index] : null;\n }\n\n /**\n * Retrieves the previous non-disabled item of a given array of items.\n *\n * @param items {Array<ListItem>} The items to search.\n * @param index {{index: number}} The index to search from.\n * @return The previous activatable item or `null` if none are activatable.\n */\n private static getPrevItem<T extends ListItem>(items: T[], index: number) {\n for (let i = 1; i < items.length; i++) {\n const prevIndex = (index - i + items.length) % items.length;\n const item = items[prevIndex];\n\n if (!item.disabled) {\n return item;\n }\n }\n\n return items[index] ? items[index] : null;\n }\n}\n"]}
1
+ {"version":3,"file":"list.js","sourceRoot":"","sources":["list.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAC,MAAM,KAAK,CAAC;AAC9C,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAC,MAAM,mBAAmB,CAAC;AAGzE,OAAO,EAAC,yBAAyB,EAAC,MAAM,iCAAiC,CAAC;AAI1E,MAAM,cAAc,GAAG;IACrB,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;IACZ,GAAG,EAAE,KAAK;CACF,CAAC;AAaX,MAAM,eAAe,GAAG,IAAI,GAAG,CAAC,MAAM,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC,CAAC;AAE/D,SAAS,cAAc,CAAC,GAAW;IACjC,OAAO,eAAe,CAAC,GAAG,CAAC,GAAwB,CAAC,CAAC;AACvD,CAAC;AAED,gEAAgE;AAChE,MAAM,OAAO,IAAK,SAAQ,UAAU;I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b;SACF;QAED,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC5C,CAAC;IAED;;;;;;OAMG;IACK,MAAM,CAAC,WAAW,CAAqB,KAAU,EAAE,KAAa;QACtE,KAAK,IAAI,CAAC,GAAG,CAAC,EAAE,CAAC,GAAG,KAAK,CAAC,MAAM,EAAE,CAAC,EAAE,EAAE;YACrC,MAAM,SAAS,GAAG,CAAC,KAAK,GAAG,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,KAAK,CAAC,MAAM,CAAC;YAC5D,MAAM,IAAI,GAAG,KAAK,CAAC,SAAS,CAAC,CAAC;YAE9B,IAAI,CAAC,IAAI,CAAC,QAAQ,EAAE;gBAClB,OAAO,IAAI,CAAC;aACb;SACF;QAED,OAAO,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC;IAC5C,CAAC;;AAtTD;IACE,yBAAyB,CAAC,IAAI,CAAC,CAAC;AAClC,CAAC,GAAA,CAAA;AAED,kBAAkB;AACF,sBAAiB,GACZ,EAAC,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,IAAI,EAAC,CAAC;AAE9C;IAAX,QAAQ,EAAE;kCAAqD;AAKV;IAArD,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,eAAe,EAAC,CAAC;0CAAkB;AAEvD;IAAf,KAAK,CAAC,OAAO,CAAC;sCAAqC;AAWpD;IADC,qBAAqB,CAAC,EAAC,OAAO,EAAE,IAAI,EAAE,QAAQ,EAAE,gBAAgB,EAAC,CAAC;mCAChD","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {html, LitElement, nothing} from 'lit';\nimport {property, query, queryAssignedElements} from 'lit/decorators.js';\n\nimport {ARIAMixinStrict} from '../../internal/aria/aria.js';\nimport {requestUpdateOnAriaChange} from '../../internal/aria/delegate.js';\n\nimport {ListItem} from './listitem/list-item.js';\n\nconst NAVIGABLE_KEYS = {\n ArrowDown: 'ArrowDown',\n ArrowUp: 'ArrowUp',\n Home: 'Home',\n End: 'End',\n} as const;\n\n/**\n * A record that describes a list item in a list with metadata such a reference\n * to the item and its index in the list.\n */\nexport interface ItemRecord {\n item: ListItem;\n index: number;\n}\n\ntype NavigatableValues = typeof NAVIGABLE_KEYS[keyof typeof NAVIGABLE_KEYS];\n\nconst navigableKeySet = new Set(Object.values(NAVIGABLE_KEYS));\n\nfunction isNavigableKey(key: string): key is NavigatableValues {\n return navigableKeySet.has(key as NavigatableValues);\n}\n\n// tslint:disable-next-line:enforce-comments-on-exported-symbols\nexport class List extends LitElement {\n static {\n requestUpdateOnAriaChange(List);\n }\n\n /** @nocollapse */\n static override shadowRootOptions:\n ShadowRootInit = {mode: 'open', delegatesFocus: true};\n\n @property() type: 'menu'|'menubar'|'listbox'|'list'|'' = 'list';\n\n /**\n * The tabindex of the underlying list.\n */\n @property({type: Number, attribute: 'list-tabindex'}) listTabIndex = 0;\n\n @query('.list') private listRoot!: HTMLElement|null;\n\n /**\n * An array of activatable and disableable list items. Queries every assigned\n * element that has the `md-list-item` attribute.\n *\n * _NOTE:_ This is a shallow, flattened query via\n * `HTMLSlotElement.queryAssignedElements` and thus will _only_ include direct\n * children / directly slotted elements.\n */\n @queryAssignedElements({flatten: true, selector: '[md-list-item]'})\n items!: ListItem[];\n\n protected override render() {\n return this.renderList();\n }\n\n /**\n * Renders the main list element.\n */\n private renderList() {\n // Needed for closure conformance\n const {ariaLabel} = this as ARIAMixinStrict;\n return html`\n <ul class=\"list\"\n aria-label=${ariaLabel || nothing}\n tabindex=${this.listTabIndex}\n role=${this.type || nothing}\n @keydown=${this.handleKeydown}\n >\n ${this.renderContent()}\n </ul>\n `;\n }\n\n /**\n * The content to be slotted into the list.\n */\n private renderContent() {\n return html`<span><slot></slot></span>`;\n }\n\n /**\n * Handles keyboard navigation in the list.\n *\n * @param event {KeyboardEvent} The keyboard event that triggers this handler.\n */\n private handleKeydown(event: KeyboardEvent) {\n const key = event.key;\n if (event.defaultPrevented || !isNavigableKey(key)) {\n return;\n }\n // do not use this.items directly so we don't re-query the DOM unnecessarily\n const items = this.items;\n\n if (!items.length) {\n return;\n }\n\n const activeItemRecord = List.getActiveItem(items);\n\n if (activeItemRecord) {\n activeItemRecord.item.active = false;\n }\n\n event.preventDefault();\n\n switch (key) {\n // Activate the next item\n case NAVIGABLE_KEYS.ArrowDown:\n this.activateNextItemInternal(items, activeItemRecord);\n break;\n\n // Activate the previous item\n case NAVIGABLE_KEYS.ArrowUp:\n this.activatePreviousItemInternal(items, activeItemRecord);\n break;\n\n // Activate the first item\n case NAVIGABLE_KEYS.Home:\n List.activateFirstItem(items);\n break;\n\n // Activate the last item\n case NAVIGABLE_KEYS.End:\n List.activateLastItem(items);\n break;\n\n default:\n break;\n }\n }\n\n private activateNextItemInternal(\n items: ListItem[], activeItemRecord: null|ItemRecord): ListItem|null {\n if (activeItemRecord) {\n const next = List.getNextItem(items, activeItemRecord.index);\n\n if (next) next.active = true;\n\n return next;\n } else {\n return List.activateFirstItem(items);\n }\n }\n\n private activatePreviousItemInternal(\n items: ListItem[], activeItemRecord: null|ItemRecord): ListItem|null {\n if (activeItemRecord) {\n const prev = List.getPrevItem(items, activeItemRecord.index);\n if (prev) prev.active = true;\n return prev;\n } else {\n return List.activateLastItem(items);\n }\n }\n\n /**\n * Activates the next item in the list. If at the end of the list, the first\n * item will be activated.\n *\n * @return The activated list item or `null` if there are no items.\n */\n activateNextItem(): ListItem|null {\n const items = this.items;\n const activeItemRecord = List.getActiveItem(items);\n if (activeItemRecord) {\n activeItemRecord.item.active = false;\n }\n return this.activateNextItemInternal(items, activeItemRecord);\n }\n\n /**\n * Activates the previous item in the list. If at the start of the list, the\n * last item will be activated.\n *\n * @return The activated list item or `null` if there are no items.\n */\n activatePreviousItem(): ListItem|null {\n const items = this.items;\n const activeItemRecord = List.getActiveItem(items);\n if (activeItemRecord) {\n activeItemRecord.item.active = false;\n }\n return this.activatePreviousItemInternal(items, activeItemRecord);\n }\n\n /**\n * Activates the first non-disabled item of a given array of items.\n *\n * @param items {Array<ListItem>} The items from which to activate the\n * first item.\n * @nocollapse\n */\n static activateFirstItem<T extends ListItem>(items: T[]) {\n // NOTE: These selector functions are static and not on the instance such\n // that multiple operations can be chained and we do not have to re-query\n // the DOM\n const firstItem = List.getFirstActivatableItem(items);\n if (firstItem) {\n firstItem.active = true;\n }\n return firstItem;\n }\n\n /**\n * Activates the last non-disabled item of a given array of items.\n *\n * @param items {Array<ListItem>} The items from which to activate the\n * last item.\n * @nocollapse\n */\n static activateLastItem<T extends ListItem>(items: T[]) {\n const lastItem = List.getLastActivatableItem(items);\n if (lastItem) {\n lastItem.active = true;\n }\n return lastItem;\n }\n\n /**\n * Deactivates the currently active item of a given array of items.\n *\n * @param items {Array<ListItem>} The items from which to deactivate the\n * active item.\n * @return A record of the deleselcted activated item including the item and\n * the index of the item or `null` if none are deactivated.\n * @nocollapse\n */\n static deactivateActiveItem<T extends ListItem>(items: T[]) {\n const activeItem = List.getActiveItem(items);\n if (activeItem) {\n activeItem.item.active = false;\n }\n return activeItem;\n }\n\n override focus() {\n this.listRoot?.focus();\n }\n\n /**\n * Retrieves the first activated item of a given array of items.\n *\n * @param items {Array<ListItem>} The items to search.\n * @return A record of the first activated item including the item and the\n * index of the item or `null` if none are activated.\n * @nocollapse\n */\n static getActiveItem<T extends ListItem>(items: T[]) {\n for (let i = 0; i < items.length; i++) {\n const item = items[i];\n if (item.active) {\n return {\n item,\n index: i,\n } as ItemRecord;\n }\n }\n return null;\n }\n\n /**\n * Retrieves the first non-disabled item of a given array of items. This\n * the first item that is not disabled.\n *\n * @param items {Array<ListItem>} The items to search.\n * @return The first activatable item or `null` if none are activatable.\n * @nocollapse\n */\n static getFirstActivatableItem<T extends ListItem>(items: T[]) {\n for (const item of items) {\n if (!item.disabled) {\n return item;\n }\n }\n\n return null;\n }\n\n /**\n * Retrieves the last non-disabled item of a given array of items.\n *\n * @param items {Array<ListItem>} The items to search.\n * @return The last activatable item or `null` if none are activatable.\n * @nocollapse\n */\n static getLastActivatableItem<T extends ListItem>(items: T[]) {\n for (let i = items.length - 1; i >= 0; i--) {\n const item = items[i];\n if (!item.disabled) {\n return item;\n }\n }\n\n return null;\n }\n\n /**\n * Retrieves the next non-disabled item of a given array of items.\n *\n * @param items {Array<ListItem>} The items to search.\n * @param index {{index: number}} The index to search from.\n * @return The next activatable item or `null` if none are activatable.\n */\n private static getNextItem<T extends ListItem>(items: T[], index: number) {\n for (let i = 1; i < items.length; i++) {\n const nextIndex = (i + index) % items.length;\n const item = items[nextIndex];\n if (!item.disabled) {\n return item;\n }\n }\n\n return items[index] ? items[index] : null;\n }\n\n /**\n * Retrieves the previous non-disabled item of a given array of items.\n *\n * @param items {Array<ListItem>} The items to search.\n * @param index {{index: number}} The index to search from.\n * @return The previous activatable item or `null` if none are activatable.\n */\n private static getPrevItem<T extends ListItem>(items: T[], index: number) {\n for (let i = 1; i < items.length; i++) {\n const prevIndex = (index - i + items.length) % items.length;\n const item = items[prevIndex];\n\n if (!item.disabled) {\n return item;\n }\n }\n\n return items[index] ? items[index] : null;\n }\n}\n"]}
@@ -138,6 +138,7 @@
138
138
  display: inline-flex;
139
139
  justify-content: center;
140
140
  flex-direction: column;
141
+ min-width: 0;
141
142
  box-sizing: border-box;
142
143
  flex: 1 0 0;
143
144
  padding-inline-start: var(--_leading-space);
@@ -164,12 +165,14 @@
164
165
  }
165
166
 
166
167
  .label-text {
167
- display: flex;
168
168
  text-overflow: ellipsis;
169
169
  overflow-x: hidden;
170
170
  white-space: nowrap;
171
171
  color: var(--_label-text-color);
172
- font: var(--_label-text-type);
172
+ font-family: var(--_label-text-font);
173
+ font-size: var(--_label-text-size);
174
+ line-height: var(--_label-text-line-height);
175
+ font-weight: var(--_label-text-weight);
173
176
 
174
177
  :hover & {
175
178
  color: var(--_hover-label-text-color);
@@ -195,7 +198,10 @@
195
198
  overflow: hidden;
196
199
  width: 100%;
197
200
  color: var(--_supporting-text-color);
198
- font: var(--_supporting-text-type);
201
+ font-family: var(--_supporting-text-font);
202
+ font-size: var(--_supporting-text-size);
203
+ line-height: var(--_supporting-text-line-height);
204
+ font-weight: var(--_supporting-text-weight);
199
205
 
200
206
  // Box is supposed to be deprecated, but line-clamp is not. It's still on
201
207
  // standards track and can only be applied with display: -webkit-box and
@@ -216,7 +222,10 @@
216
222
  }
217
223
 
218
224
  .trailing-supporting-text {
219
- font: var(--_trailing-supporting-text-type);
225
+ font-family: var(--_trailing-supporting-text-font);
226
+ font-size: var(--_trailing-supporting-text-size);
227
+ line-height: var(--_trailing-supporting-text-line-height);
228
+ font-weight: var(--_trailing-supporting-text-weight);
220
229
 
221
230
  .list-item:not(.disabled) & {
222
231
  color: var(--_trailing-supporting-text-color);
@@ -347,7 +356,10 @@
347
356
  width: var(--_leading-avatar-size);
348
357
  border-radius: var(--_leading-avatar-shape);
349
358
  color: var(--_leading-avatar-label-color);
350
- font: var(--_leading-avatar-label-type);
359
+ font-family: var(--_leading-avatar-label-font);
360
+ font-size: var(--_leading-avatar-label-size);
361
+ line-height: var(--_leading-avatar-label-line-height);
362
+ font-weight: var(--_leading-avatar-label-weight);
351
363
  }
352
364
  }
353
365
 
@@ -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-list-item-container-color, var(--md-sys-color-surface, #fef7ff));--_container-shape: var(--md-list-item-container-shape, 0px);--_disabled-label-text-color: var(--md-list-item-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-list-item-disabled-label-text-opacity, 0.3);--_disabled-leading-icon-color: var(--md-list-item-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-leading-icon-opacity: var(--md-list-item-disabled-leading-icon-opacity, 0.38);--_disabled-trailing-icon-color: var(--md-list-item-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-trailing-icon-opacity: var(--md-list-item-disabled-trailing-icon-opacity, 0.38);--_focus-label-text-color: var(--md-list-item-focus-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_focus-leading-icon-icon-color: var(--md-list-item-focus-leading-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-trailing-icon-icon-color: var(--md-list-item-focus-trailing-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-label-text-color: var(--md-list-item-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-leading-icon-icon-color: var(--md-list-item-hover-leading-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-color: var(--md-list-item-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-state-layer-opacity: var(--md-list-item-hover-state-layer-opacity, 0.08);--_hover-trailing-icon-icon-color: var(--md-list-item-hover-trailing-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-color: var(--md-list-item-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_label-text-line-height: var(--md-list-item-label-text-line-height, 1.5rem);--_label-text-type: var(--md-list-item-label-text-type, var(--md-sys-typescale-body-large, 400 1rem / 1.5rem var(--md-ref-typeface-plain, Roboto)));--_large-leading-video-height: var(--md-list-item-large-leading-video-height, 69px);--_leading-avatar-label-color: var(--md-list-item-leading-avatar-label-color, var(--md-sys-color-on-primary-container, #21005d));--_leading-avatar-label-type: var(--md-list-item-leading-avatar-label-type, var(--md-sys-typescale-title-medium, 500 1rem / 1.5rem var(--md-ref-typeface-plain, Roboto)));--_leading-avatar-color: var(--md-list-item-leading-avatar-color, var(--md-sys-color-primary-container, #eaddff));--_leading-avatar-shape: var(--md-list-item-leading-avatar-shape, 9999px);--_leading-avatar-size: var(--md-list-item-leading-avatar-size, 40px);--_leading-icon-color: var(--md-list-item-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_leading-icon-size: var(--md-list-item-leading-icon-size, 18px);--_leading-image-height: var(--md-list-item-leading-image-height, 56px);--_leading-image-shape: var(--md-list-item-leading-image-shape, 0px);--_leading-image-width: var(--md-list-item-leading-image-width, 56px);--_leading-video-shape: var(--md-list-item-leading-video-shape, 0px);--_leading-video-width: var(--md-list-item-leading-video-width, 100px);--_one-line-container-height: var(--md-list-item-one-line-container-height, 56px);--_pressed-label-text-color: var(--md-list-item-pressed-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_pressed-leading-icon-icon-color: var(--md-list-item-pressed-leading-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_pressed-state-layer-color: var(--md-list-item-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_pressed-state-layer-opacity: var(--md-list-item-pressed-state-layer-opacity, 0.12);--_pressed-trailing-icon-icon-color: var(--md-list-item-pressed-trailing-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_small-leading-video-height: var(--md-list-item-small-leading-video-height, 56px);--_supporting-text-color: var(--md-list-item-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-type: var(--md-list-item-supporting-text-type, var(--md-sys-typescale-body-medium, 400 0.875rem / 1.25rem var(--md-ref-typeface-plain, Roboto)));--_three-line-container-height: var(--md-list-item-three-line-container-height, 88px);--_trailing-icon-color: var(--md-list-item-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_trailing-icon-size: var(--md-list-item-trailing-icon-size, 24px);--_trailing-supporting-text-color: var(--md-list-item-trailing-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_trailing-supporting-text-line-height: var(--md-list-item-trailing-supporting-text-line-height, 1rem);--_trailing-supporting-text-type: var(--md-list-item-trailing-supporting-text-type, var(--md-sys-typescale-label-small, 500 0.688rem / 1rem var(--md-ref-typeface-plain, Roboto)));--_two-line-container-height: var(--md-list-item-two-line-container-height, 72px);--_leading-element-leading-space: var(--md-list-item-leading-element-leading-space, 16px);--_leading-space: var(--md-list-item-leading-space, 16px);--_leading-video-leading-space: var(--md-list-item-leading-video-leading-space, 0px);--_trailing-element-headline-trailing-element-space: var(--md-list-item-trailing-element-headline-trailing-element-space, 16px);--_trailing-space: var(--md-list-item-trailing-space, 24px)}:host{color:unset;--md-ripple-hover-color: var(--_hover-state-layer-color);--md-ripple-hover-opacity: var(--_hover-state-layer-opacity);--md-ripple-pressed-color: var(--_pressed-state-layer-color);--md-ripple-pressed-opacity: var(--_pressed-state-layer-opacity)}md-focus-ring{--md-focus-ring-shape: 8px}.list-item{align-items:center;box-sizing:border-box;display:flex;outline:none;position:relative;width:100%;text-decoration:none;background-color:var(--_container-color);border-radius:var(--_container-shape);-webkit-tap-highlight-color:rgba(0,0,0,0)}.list-item:not(.disabled):not(.noninteractive){cursor:pointer}.list-item.disabled{pointer-events:none}.content-wrapper{display:flex;width:100%;box-sizing:border-box;border-radius:inherit;padding-inline-end:var(--_trailing-space)}md-ripple{border-radius:inherit}.with-one-line{min-height:var(--_one-line-container-height)}.with-two-line{min-height:var(--_two-line-container-height)}.with-three-line{min-height:var(--_three-line-container-height)}.start{display:inline-flex;flex-direction:column;justify-content:center;align-items:center;flex:0 0 auto;z-index:1}.with-three-line .start{justify-content:start}slot[name=start]::slotted([data-variant=icon]),slot[name=start]::slotted([data-variant=image]),slot[name=start]::slotted([data-variant=avatar]){margin-inline-start:var(--_leading-element-leading-space)}.body{display:inline-flex;justify-content:center;flex-direction:column;box-sizing:border-box;flex:1 0 0;padding-inline-start:var(--_leading-space);z-index:1}.end{display:inline-flex;flex-direction:column;justify-content:center;flex:0 0 auto;z-index:1}.with-three-line .end{justify-content:start}slot[name=end]::slotted(*),.trailing-supporting-text{margin-inline-start:var(--_trailing-element-headline-trailing-element-space)}.label-text{display:flex;text-overflow:ellipsis;overflow-x:hidden;white-space:nowrap;color:var(--_label-text-color);font:var(--_label-text-type)}:hover .label-text{color:var(--_hover-label-text-color)}:focus .label-text{color:var(--_focus-label-text-color)}:active .label-text{color:var(--_pressed-label-text-color)}.disabled .label-text{color:var(--_disabled-label-text-color);opacity:var(--_disabled-label-text-opacity)}.supporting-text{text-overflow:ellipsis;white-space:normal;overflow:hidden;width:100%;color:var(--_supporting-text-color);font:var(--_supporting-text-type);-webkit-box-orient:vertical;-webkit-line-clamp:1;display:-webkit-box}.disabled .supporting-text{color:var(--_disabled-label-text-color);opacity:var(--_disabled-label-text-opacity)}.supporting-text--multi-line{-webkit-line-clamp:2}.trailing-supporting-text{font:var(--_trailing-supporting-text-type)}.list-item:not(.disabled) .trailing-supporting-text{color:var(--_trailing-supporting-text-color)}.disabled .trailing-supporting-text{color:var(--_disabled-label-text-color);opacity:var(--_disabled-label-text-opacity)}.with-three-line .trailing-supporting-text{margin-block-start:calc((var(--_label-text-line-height) - var(--_trailing-supporting-text-line-height))/2)}.focus-ring{z-index:1}::slotted([data-variant=image]){display:inline-flex;height:var(--_leading-image-height);width:var(--_leading-image-width);border-radius:var(--_leading-image-shape);margin-block:calc((var(--_two-line-container-height) - var(--_leading-image-height))/2)}.with-three-line ::slotted([data-variant=image]){margin-block:0}::slotted(*){fill:currentColor}slot[name=start]::slotted([data-variant=icon]){font-size:var(--_leading-icon-size);width:var(--_leading-icon-size);height:var(--_leading-icon-size);color:var(--_leading-icon-color)}.with-three-line slot[name=start]::slotted([data-variant=icon]){margin-block-start:calc((var(--_label-text-line-height) - var(--_leading-icon-size))/2)}slot[name=end]::slotted([data-variant=icon]){font-size:var(--_trailing-icon-size);width:var(--_trailing-icon-size);height:var(--_trailing-icon-size);color:var(--_trailing-icon-color)}.with-three-line slot[name=end]::slotted([data-variant=icon]){margin-block-start:calc((var(--_label-text-line-height) - var(--_trailing-icon-size))/2)}:hover slot[name=start]::slotted([data-variant=icon]){color:var(--_hover-leading-icon-icon-color)}:hover slot[name=end]::slotted([data-variant=icon]){color:var(--_hover-trailing-icon-icon-color)}:focus slot[name=start]::slotted([data-variant=icon]){color:var(--_focus-leading-icon-icon-color)}:focus slot[name=end]::slotted([data-variant=icon]){color:var(--_focus-trailing-icon-icon-color)}:active slot[name=start]::slotted([data-variant=icon]){color:var(--_pressed-leading-icon-icon-color)}:active slot[name=end]::slotted([data-variant=icon]){color:var(--_pressed-trailing-icon-icon-color)}.disabled slot[name=start]::slotted([data-variant=icon]){opacity:var(--_disabled-leading-icon-opacity);color:var(--_disabled-leading-icon-color)}.disabled slot[name=end]::slotted([data-variant=icon]){opacity:var(--_disabled-trailing-icon-opacity);color:var(--_disabled-trailing-icon-color)}::slotted([data-variant=avatar]){display:inline-flex;justify-content:center;align-items:center;background-color:var(--_leading-avatar-color);height:var(--_leading-avatar-size);width:var(--_leading-avatar-size);border-radius:var(--_leading-avatar-shape);color:var(--_leading-avatar-label-color);font:var(--_leading-avatar-label-type)}::slotted([data-variant=video]),::slotted([data-variant=video-large]){display:inline-flex;object-fit:cover;height:var(--_small-leading-video-height);width:var(--_leading-video-width);border-radius:var(--_leading-video-shape);margin-inline-start:var(--_leading-video-leading-space);margin-block:calc((var(--_three-line-container-height) - var(--_small-leading-video-height))/2)}.with-three-line ::slotted([data-variant=video]),.with-three-line ::slotted([data-variant=video-large]){margin-block:0}::slotted([data-variant=video-large]){margin-block:calc((var(--_three-line-container-height) - var(--_large-leading-video-height))/2);height:var(--_large-leading-video-height)}/*# sourceMappingURL=list-item-styles.css.map */
7
+ export const styles = css `:host{--_container-color: var(--md-list-item-container-color, var(--md-sys-color-surface, #fef7ff));--_container-shape: var(--md-list-item-container-shape, 0px);--_disabled-label-text-color: var(--md-list-item-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-list-item-disabled-label-text-opacity, 0.3);--_disabled-leading-icon-color: var(--md-list-item-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-leading-icon-opacity: var(--md-list-item-disabled-leading-icon-opacity, 0.38);--_disabled-trailing-icon-color: var(--md-list-item-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-trailing-icon-opacity: var(--md-list-item-disabled-trailing-icon-opacity, 0.38);--_focus-label-text-color: var(--md-list-item-focus-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_focus-leading-icon-icon-color: var(--md-list-item-focus-leading-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-trailing-icon-icon-color: var(--md-list-item-focus-trailing-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-label-text-color: var(--md-list-item-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-leading-icon-icon-color: var(--md-list-item-hover-leading-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-color: var(--md-list-item-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-state-layer-opacity: var(--md-list-item-hover-state-layer-opacity, 0.08);--_hover-trailing-icon-icon-color: var(--md-list-item-hover-trailing-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-color: var(--md-list-item-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_label-text-font: var(--md-list-item-label-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-list-item-label-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));--_label-text-size: var(--md-list-item-label-text-size, var(--md-sys-typescale-body-large-size, 1rem));--_label-text-weight: var(--md-list-item-label-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));--_large-leading-video-height: var(--md-list-item-large-leading-video-height, 69px);--_leading-avatar-label-color: var(--md-list-item-leading-avatar-label-color, var(--md-sys-color-on-primary-container, #21005d));--_leading-avatar-label-font: var(--md-list-item-leading-avatar-label-font, var(--md-sys-typescale-title-medium-font, var(--md-ref-typeface-plain, Roboto)));--_leading-avatar-label-line-height: var(--md-list-item-leading-avatar-label-line-height, var(--md-sys-typescale-title-medium-line-height, 1.5rem));--_leading-avatar-label-size: var(--md-list-item-leading-avatar-label-size, var(--md-sys-typescale-title-medium-size, 1rem));--_leading-avatar-label-weight: var(--md-list-item-leading-avatar-label-weight, var(--md-sys-typescale-title-medium-weight, var(--md-ref-typeface-weight-medium, 500)));--_leading-avatar-color: var(--md-list-item-leading-avatar-color, var(--md-sys-color-primary-container, #eaddff));--_leading-avatar-shape: var(--md-list-item-leading-avatar-shape, 9999px);--_leading-avatar-size: var(--md-list-item-leading-avatar-size, 40px);--_leading-icon-color: var(--md-list-item-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_leading-icon-size: var(--md-list-item-leading-icon-size, 18px);--_leading-image-height: var(--md-list-item-leading-image-height, 56px);--_leading-image-shape: var(--md-list-item-leading-image-shape, 0px);--_leading-image-width: var(--md-list-item-leading-image-width, 56px);--_leading-video-shape: var(--md-list-item-leading-video-shape, 0px);--_leading-video-width: var(--md-list-item-leading-video-width, 100px);--_one-line-container-height: var(--md-list-item-one-line-container-height, 56px);--_pressed-label-text-color: var(--md-list-item-pressed-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_pressed-leading-icon-icon-color: var(--md-list-item-pressed-leading-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_pressed-state-layer-color: var(--md-list-item-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_pressed-state-layer-opacity: var(--md-list-item-pressed-state-layer-opacity, 0.12);--_pressed-trailing-icon-icon-color: var(--md-list-item-pressed-trailing-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_small-leading-video-height: var(--md-list-item-small-leading-video-height, 56px);--_supporting-text-color: var(--md-list-item-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-font: var(--md-list-item-supporting-text-font, var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto)));--_supporting-text-line-height: var(--md-list-item-supporting-text-line-height, var(--md-sys-typescale-body-medium-line-height, 1.25rem));--_supporting-text-size: var(--md-list-item-supporting-text-size, var(--md-sys-typescale-body-medium-size, 0.875rem));--_supporting-text-weight: var(--md-list-item-supporting-text-weight, var(--md-ref-typeface-weight-regular, 400));--_three-line-container-height: var(--md-list-item-three-line-container-height, 88px);--_trailing-icon-color: var(--md-list-item-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_trailing-icon-size: var(--md-list-item-trailing-icon-size, 24px);--_trailing-supporting-text-color: var(--md-list-item-trailing-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_trailing-supporting-text-font: var(--md-list-item-trailing-supporting-text-font, var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto)));--_trailing-supporting-text-line-height: var(--md-list-item-trailing-supporting-text-line-height, var(--md-sys-typescale-label-small-line-height, 1rem));--_trailing-supporting-text-size: var(--md-list-item-trailing-supporting-text-size, var(--md-sys-typescale-label-small-size, 0.688rem));--_trailing-supporting-text-weight: var(--md-list-item-trailing-supporting-text-weight, var(--md-sys-typescale-label-small-weight, var(--md-ref-typeface-weight-medium, 500)));--_two-line-container-height: var(--md-list-item-two-line-container-height, 72px);--_leading-element-leading-space: var(--md-list-item-leading-element-leading-space, 16px);--_leading-space: var(--md-list-item-leading-space, 16px);--_leading-video-leading-space: var(--md-list-item-leading-video-leading-space, 0px);--_trailing-element-headline-trailing-element-space: var(--md-list-item-trailing-element-headline-trailing-element-space, 16px);--_trailing-space: var(--md-list-item-trailing-space, 24px)}:host{color:unset;--md-ripple-hover-color: var(--_hover-state-layer-color);--md-ripple-hover-opacity: var(--_hover-state-layer-opacity);--md-ripple-pressed-color: var(--_pressed-state-layer-color);--md-ripple-pressed-opacity: var(--_pressed-state-layer-opacity)}md-focus-ring{--md-focus-ring-shape: 8px}.list-item{align-items:center;box-sizing:border-box;display:flex;outline:none;position:relative;width:100%;text-decoration:none;background-color:var(--_container-color);border-radius:var(--_container-shape);-webkit-tap-highlight-color:rgba(0,0,0,0)}.list-item:not(.disabled):not(.noninteractive){cursor:pointer}.list-item.disabled{pointer-events:none}.content-wrapper{display:flex;width:100%;box-sizing:border-box;border-radius:inherit;padding-inline-end:var(--_trailing-space)}md-ripple{border-radius:inherit}.with-one-line{min-height:var(--_one-line-container-height)}.with-two-line{min-height:var(--_two-line-container-height)}.with-three-line{min-height:var(--_three-line-container-height)}.start{display:inline-flex;flex-direction:column;justify-content:center;align-items:center;flex:0 0 auto;z-index:1}.with-three-line .start{justify-content:start}slot[name=start]::slotted([data-variant=icon]),slot[name=start]::slotted([data-variant=image]),slot[name=start]::slotted([data-variant=avatar]){margin-inline-start:var(--_leading-element-leading-space)}.body{display:inline-flex;justify-content:center;flex-direction:column;min-width:0;box-sizing:border-box;flex:1 0 0;padding-inline-start:var(--_leading-space);z-index:1}.end{display:inline-flex;flex-direction:column;justify-content:center;flex:0 0 auto;z-index:1}.with-three-line .end{justify-content:start}slot[name=end]::slotted(*),.trailing-supporting-text{margin-inline-start:var(--_trailing-element-headline-trailing-element-space)}.label-text{text-overflow:ellipsis;overflow-x:hidden;white-space:nowrap;color:var(--_label-text-color);font-family:var(--_label-text-font);font-size:var(--_label-text-size);line-height:var(--_label-text-line-height);font-weight:var(--_label-text-weight)}:hover .label-text{color:var(--_hover-label-text-color)}:focus .label-text{color:var(--_focus-label-text-color)}:active .label-text{color:var(--_pressed-label-text-color)}.disabled .label-text{color:var(--_disabled-label-text-color);opacity:var(--_disabled-label-text-opacity)}.supporting-text{text-overflow:ellipsis;white-space:normal;overflow:hidden;width:100%;color:var(--_supporting-text-color);font-family:var(--_supporting-text-font);font-size:var(--_supporting-text-size);line-height:var(--_supporting-text-line-height);font-weight:var(--_supporting-text-weight);-webkit-box-orient:vertical;-webkit-line-clamp:1;display:-webkit-box}.disabled .supporting-text{color:var(--_disabled-label-text-color);opacity:var(--_disabled-label-text-opacity)}.supporting-text--multi-line{-webkit-line-clamp:2}.trailing-supporting-text{font-family:var(--_trailing-supporting-text-font);font-size:var(--_trailing-supporting-text-size);line-height:var(--_trailing-supporting-text-line-height);font-weight:var(--_trailing-supporting-text-weight)}.list-item:not(.disabled) .trailing-supporting-text{color:var(--_trailing-supporting-text-color)}.disabled .trailing-supporting-text{color:var(--_disabled-label-text-color);opacity:var(--_disabled-label-text-opacity)}.with-three-line .trailing-supporting-text{margin-block-start:calc((var(--_label-text-line-height) - var(--_trailing-supporting-text-line-height))/2)}.focus-ring{z-index:1}::slotted([data-variant=image]){display:inline-flex;height:var(--_leading-image-height);width:var(--_leading-image-width);border-radius:var(--_leading-image-shape);margin-block:calc((var(--_two-line-container-height) - var(--_leading-image-height))/2)}.with-three-line ::slotted([data-variant=image]){margin-block:0}::slotted(*){fill:currentColor}slot[name=start]::slotted([data-variant=icon]){font-size:var(--_leading-icon-size);width:var(--_leading-icon-size);height:var(--_leading-icon-size);color:var(--_leading-icon-color)}.with-three-line slot[name=start]::slotted([data-variant=icon]){margin-block-start:calc((var(--_label-text-line-height) - var(--_leading-icon-size))/2)}slot[name=end]::slotted([data-variant=icon]){font-size:var(--_trailing-icon-size);width:var(--_trailing-icon-size);height:var(--_trailing-icon-size);color:var(--_trailing-icon-color)}.with-three-line slot[name=end]::slotted([data-variant=icon]){margin-block-start:calc((var(--_label-text-line-height) - var(--_trailing-icon-size))/2)}:hover slot[name=start]::slotted([data-variant=icon]){color:var(--_hover-leading-icon-icon-color)}:hover slot[name=end]::slotted([data-variant=icon]){color:var(--_hover-trailing-icon-icon-color)}:focus slot[name=start]::slotted([data-variant=icon]){color:var(--_focus-leading-icon-icon-color)}:focus slot[name=end]::slotted([data-variant=icon]){color:var(--_focus-trailing-icon-icon-color)}:active slot[name=start]::slotted([data-variant=icon]){color:var(--_pressed-leading-icon-icon-color)}:active slot[name=end]::slotted([data-variant=icon]){color:var(--_pressed-trailing-icon-icon-color)}.disabled slot[name=start]::slotted([data-variant=icon]){opacity:var(--_disabled-leading-icon-opacity);color:var(--_disabled-leading-icon-color)}.disabled slot[name=end]::slotted([data-variant=icon]){opacity:var(--_disabled-trailing-icon-opacity);color:var(--_disabled-trailing-icon-color)}::slotted([data-variant=avatar]){display:inline-flex;justify-content:center;align-items:center;background-color:var(--_leading-avatar-color);height:var(--_leading-avatar-size);width:var(--_leading-avatar-size);border-radius:var(--_leading-avatar-shape);color:var(--_leading-avatar-label-color);font-family:var(--_leading-avatar-label-font);font-size:var(--_leading-avatar-label-size);line-height:var(--_leading-avatar-label-line-height);font-weight:var(--_leading-avatar-label-weight)}::slotted([data-variant=video]),::slotted([data-variant=video-large]){display:inline-flex;object-fit:cover;height:var(--_small-leading-video-height);width:var(--_leading-video-width);border-radius:var(--_leading-video-shape);margin-inline-start:var(--_leading-video-leading-space);margin-block:calc((var(--_three-line-container-height) - var(--_small-leading-video-height))/2)}.with-three-line ::slotted([data-variant=video]),.with-three-line ::slotted([data-variant=video-large]){margin-block:0}::slotted([data-variant=video-large]){margin-block:calc((var(--_three-line-container-height) - var(--_large-leading-video-height))/2);height:var(--_large-leading-video-height)}/*# sourceMappingURL=list-item-styles.css.map */
8
8
  `;
9
9
  //# sourceMappingURL=list-item-styles.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"list-item-styles.css.js","sourceRoot":"","sources":["list-item-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-list-item-container-color, var(--md-sys-color-surface, #fef7ff));--_container-shape: var(--md-list-item-container-shape, 0px);--_disabled-label-text-color: var(--md-list-item-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-list-item-disabled-label-text-opacity, 0.3);--_disabled-leading-icon-color: var(--md-list-item-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-leading-icon-opacity: var(--md-list-item-disabled-leading-icon-opacity, 0.38);--_disabled-trailing-icon-color: var(--md-list-item-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-trailing-icon-opacity: var(--md-list-item-disabled-trailing-icon-opacity, 0.38);--_focus-label-text-color: var(--md-list-item-focus-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_focus-leading-icon-icon-color: var(--md-list-item-focus-leading-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-trailing-icon-icon-color: var(--md-list-item-focus-trailing-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-label-text-color: var(--md-list-item-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-leading-icon-icon-color: var(--md-list-item-hover-leading-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-color: var(--md-list-item-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-state-layer-opacity: var(--md-list-item-hover-state-layer-opacity, 0.08);--_hover-trailing-icon-icon-color: var(--md-list-item-hover-trailing-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-color: var(--md-list-item-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_label-text-line-height: var(--md-list-item-label-text-line-height, 1.5rem);--_label-text-type: var(--md-list-item-label-text-type, var(--md-sys-typescale-body-large, 400 1rem / 1.5rem var(--md-ref-typeface-plain, Roboto)));--_large-leading-video-height: var(--md-list-item-large-leading-video-height, 69px);--_leading-avatar-label-color: var(--md-list-item-leading-avatar-label-color, var(--md-sys-color-on-primary-container, #21005d));--_leading-avatar-label-type: var(--md-list-item-leading-avatar-label-type, var(--md-sys-typescale-title-medium, 500 1rem / 1.5rem var(--md-ref-typeface-plain, Roboto)));--_leading-avatar-color: var(--md-list-item-leading-avatar-color, var(--md-sys-color-primary-container, #eaddff));--_leading-avatar-shape: var(--md-list-item-leading-avatar-shape, 9999px);--_leading-avatar-size: var(--md-list-item-leading-avatar-size, 40px);--_leading-icon-color: var(--md-list-item-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_leading-icon-size: var(--md-list-item-leading-icon-size, 18px);--_leading-image-height: var(--md-list-item-leading-image-height, 56px);--_leading-image-shape: var(--md-list-item-leading-image-shape, 0px);--_leading-image-width: var(--md-list-item-leading-image-width, 56px);--_leading-video-shape: var(--md-list-item-leading-video-shape, 0px);--_leading-video-width: var(--md-list-item-leading-video-width, 100px);--_one-line-container-height: var(--md-list-item-one-line-container-height, 56px);--_pressed-label-text-color: var(--md-list-item-pressed-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_pressed-leading-icon-icon-color: var(--md-list-item-pressed-leading-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_pressed-state-layer-color: var(--md-list-item-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_pressed-state-layer-opacity: var(--md-list-item-pressed-state-layer-opacity, 0.12);--_pressed-trailing-icon-icon-color: var(--md-list-item-pressed-trailing-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_small-leading-video-height: var(--md-list-item-small-leading-video-height, 56px);--_supporting-text-color: var(--md-list-item-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-type: var(--md-list-item-supporting-text-type, var(--md-sys-typescale-body-medium, 400 0.875rem / 1.25rem var(--md-ref-typeface-plain, Roboto)));--_three-line-container-height: var(--md-list-item-three-line-container-height, 88px);--_trailing-icon-color: var(--md-list-item-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_trailing-icon-size: var(--md-list-item-trailing-icon-size, 24px);--_trailing-supporting-text-color: var(--md-list-item-trailing-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_trailing-supporting-text-line-height: var(--md-list-item-trailing-supporting-text-line-height, 1rem);--_trailing-supporting-text-type: var(--md-list-item-trailing-supporting-text-type, var(--md-sys-typescale-label-small, 500 0.688rem / 1rem var(--md-ref-typeface-plain, Roboto)));--_two-line-container-height: var(--md-list-item-two-line-container-height, 72px);--_leading-element-leading-space: var(--md-list-item-leading-element-leading-space, 16px);--_leading-space: var(--md-list-item-leading-space, 16px);--_leading-video-leading-space: var(--md-list-item-leading-video-leading-space, 0px);--_trailing-element-headline-trailing-element-space: var(--md-list-item-trailing-element-headline-trailing-element-space, 16px);--_trailing-space: var(--md-list-item-trailing-space, 24px)}:host{color:unset;--md-ripple-hover-color: var(--_hover-state-layer-color);--md-ripple-hover-opacity: var(--_hover-state-layer-opacity);--md-ripple-pressed-color: var(--_pressed-state-layer-color);--md-ripple-pressed-opacity: var(--_pressed-state-layer-opacity)}md-focus-ring{--md-focus-ring-shape: 8px}.list-item{align-items:center;box-sizing:border-box;display:flex;outline:none;position:relative;width:100%;text-decoration:none;background-color:var(--_container-color);border-radius:var(--_container-shape);-webkit-tap-highlight-color:rgba(0,0,0,0)}.list-item:not(.disabled):not(.noninteractive){cursor:pointer}.list-item.disabled{pointer-events:none}.content-wrapper{display:flex;width:100%;box-sizing:border-box;border-radius:inherit;padding-inline-end:var(--_trailing-space)}md-ripple{border-radius:inherit}.with-one-line{min-height:var(--_one-line-container-height)}.with-two-line{min-height:var(--_two-line-container-height)}.with-three-line{min-height:var(--_three-line-container-height)}.start{display:inline-flex;flex-direction:column;justify-content:center;align-items:center;flex:0 0 auto;z-index:1}.with-three-line .start{justify-content:start}slot[name=start]::slotted([data-variant=icon]),slot[name=start]::slotted([data-variant=image]),slot[name=start]::slotted([data-variant=avatar]){margin-inline-start:var(--_leading-element-leading-space)}.body{display:inline-flex;justify-content:center;flex-direction:column;box-sizing:border-box;flex:1 0 0;padding-inline-start:var(--_leading-space);z-index:1}.end{display:inline-flex;flex-direction:column;justify-content:center;flex:0 0 auto;z-index:1}.with-three-line .end{justify-content:start}slot[name=end]::slotted(*),.trailing-supporting-text{margin-inline-start:var(--_trailing-element-headline-trailing-element-space)}.label-text{display:flex;text-overflow:ellipsis;overflow-x:hidden;white-space:nowrap;color:var(--_label-text-color);font:var(--_label-text-type)}:hover .label-text{color:var(--_hover-label-text-color)}:focus .label-text{color:var(--_focus-label-text-color)}:active .label-text{color:var(--_pressed-label-text-color)}.disabled .label-text{color:var(--_disabled-label-text-color);opacity:var(--_disabled-label-text-opacity)}.supporting-text{text-overflow:ellipsis;white-space:normal;overflow:hidden;width:100%;color:var(--_supporting-text-color);font:var(--_supporting-text-type);-webkit-box-orient:vertical;-webkit-line-clamp:1;display:-webkit-box}.disabled .supporting-text{color:var(--_disabled-label-text-color);opacity:var(--_disabled-label-text-opacity)}.supporting-text--multi-line{-webkit-line-clamp:2}.trailing-supporting-text{font:var(--_trailing-supporting-text-type)}.list-item:not(.disabled) .trailing-supporting-text{color:var(--_trailing-supporting-text-color)}.disabled .trailing-supporting-text{color:var(--_disabled-label-text-color);opacity:var(--_disabled-label-text-opacity)}.with-three-line .trailing-supporting-text{margin-block-start:calc((var(--_label-text-line-height) - var(--_trailing-supporting-text-line-height))/2)}.focus-ring{z-index:1}::slotted([data-variant=image]){display:inline-flex;height:var(--_leading-image-height);width:var(--_leading-image-width);border-radius:var(--_leading-image-shape);margin-block:calc((var(--_two-line-container-height) - var(--_leading-image-height))/2)}.with-three-line ::slotted([data-variant=image]){margin-block:0}::slotted(*){fill:currentColor}slot[name=start]::slotted([data-variant=icon]){font-size:var(--_leading-icon-size);width:var(--_leading-icon-size);height:var(--_leading-icon-size);color:var(--_leading-icon-color)}.with-three-line slot[name=start]::slotted([data-variant=icon]){margin-block-start:calc((var(--_label-text-line-height) - var(--_leading-icon-size))/2)}slot[name=end]::slotted([data-variant=icon]){font-size:var(--_trailing-icon-size);width:var(--_trailing-icon-size);height:var(--_trailing-icon-size);color:var(--_trailing-icon-color)}.with-three-line slot[name=end]::slotted([data-variant=icon]){margin-block-start:calc((var(--_label-text-line-height) - var(--_trailing-icon-size))/2)}:hover slot[name=start]::slotted([data-variant=icon]){color:var(--_hover-leading-icon-icon-color)}:hover slot[name=end]::slotted([data-variant=icon]){color:var(--_hover-trailing-icon-icon-color)}:focus slot[name=start]::slotted([data-variant=icon]){color:var(--_focus-leading-icon-icon-color)}:focus slot[name=end]::slotted([data-variant=icon]){color:var(--_focus-trailing-icon-icon-color)}:active slot[name=start]::slotted([data-variant=icon]){color:var(--_pressed-leading-icon-icon-color)}:active slot[name=end]::slotted([data-variant=icon]){color:var(--_pressed-trailing-icon-icon-color)}.disabled slot[name=start]::slotted([data-variant=icon]){opacity:var(--_disabled-leading-icon-opacity);color:var(--_disabled-leading-icon-color)}.disabled slot[name=end]::slotted([data-variant=icon]){opacity:var(--_disabled-trailing-icon-opacity);color:var(--_disabled-trailing-icon-color)}::slotted([data-variant=avatar]){display:inline-flex;justify-content:center;align-items:center;background-color:var(--_leading-avatar-color);height:var(--_leading-avatar-size);width:var(--_leading-avatar-size);border-radius:var(--_leading-avatar-shape);color:var(--_leading-avatar-label-color);font:var(--_leading-avatar-label-type)}::slotted([data-variant=video]),::slotted([data-variant=video-large]){display:inline-flex;object-fit:cover;height:var(--_small-leading-video-height);width:var(--_leading-video-width);border-radius:var(--_leading-video-shape);margin-inline-start:var(--_leading-video-leading-space);margin-block:calc((var(--_three-line-container-height) - var(--_small-leading-video-height))/2)}.with-three-line ::slotted([data-variant=video]),.with-three-line ::slotted([data-variant=video-large]){margin-block:0}::slotted([data-variant=video-large]){margin-block:calc((var(--_three-line-container-height) - var(--_large-leading-video-height))/2);height:var(--_large-leading-video-height)}/*# sourceMappingURL=list-item-styles.css.map */\n`;\n "]}
1
+ {"version":3,"file":"list-item-styles.css.js","sourceRoot":"","sources":["list-item-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-list-item-container-color, var(--md-sys-color-surface, #fef7ff));--_container-shape: var(--md-list-item-container-shape, 0px);--_disabled-label-text-color: var(--md-list-item-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-list-item-disabled-label-text-opacity, 0.3);--_disabled-leading-icon-color: var(--md-list-item-disabled-leading-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-leading-icon-opacity: var(--md-list-item-disabled-leading-icon-opacity, 0.38);--_disabled-trailing-icon-color: var(--md-list-item-disabled-trailing-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-trailing-icon-opacity: var(--md-list-item-disabled-trailing-icon-opacity, 0.38);--_focus-label-text-color: var(--md-list-item-focus-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_focus-leading-icon-icon-color: var(--md-list-item-focus-leading-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_focus-trailing-icon-icon-color: var(--md-list-item-focus-trailing-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-label-text-color: var(--md-list-item-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-leading-icon-icon-color: var(--md-list-item-hover-leading-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_hover-state-layer-color: var(--md-list-item-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_hover-state-layer-opacity: var(--md-list-item-hover-state-layer-opacity, 0.08);--_hover-trailing-icon-icon-color: var(--md-list-item-hover-trailing-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_label-text-color: var(--md-list-item-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_label-text-font: var(--md-list-item-label-text-font, var(--md-sys-typescale-body-large-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-list-item-label-text-line-height, var(--md-sys-typescale-body-large-line-height, 1.5rem));--_label-text-size: var(--md-list-item-label-text-size, var(--md-sys-typescale-body-large-size, 1rem));--_label-text-weight: var(--md-list-item-label-text-weight, var(--md-sys-typescale-body-large-weight, var(--md-ref-typeface-weight-regular, 400)));--_large-leading-video-height: var(--md-list-item-large-leading-video-height, 69px);--_leading-avatar-label-color: var(--md-list-item-leading-avatar-label-color, var(--md-sys-color-on-primary-container, #21005d));--_leading-avatar-label-font: var(--md-list-item-leading-avatar-label-font, var(--md-sys-typescale-title-medium-font, var(--md-ref-typeface-plain, Roboto)));--_leading-avatar-label-line-height: var(--md-list-item-leading-avatar-label-line-height, var(--md-sys-typescale-title-medium-line-height, 1.5rem));--_leading-avatar-label-size: var(--md-list-item-leading-avatar-label-size, var(--md-sys-typescale-title-medium-size, 1rem));--_leading-avatar-label-weight: var(--md-list-item-leading-avatar-label-weight, var(--md-sys-typescale-title-medium-weight, var(--md-ref-typeface-weight-medium, 500)));--_leading-avatar-color: var(--md-list-item-leading-avatar-color, var(--md-sys-color-primary-container, #eaddff));--_leading-avatar-shape: var(--md-list-item-leading-avatar-shape, 9999px);--_leading-avatar-size: var(--md-list-item-leading-avatar-size, 40px);--_leading-icon-color: var(--md-list-item-leading-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_leading-icon-size: var(--md-list-item-leading-icon-size, 18px);--_leading-image-height: var(--md-list-item-leading-image-height, 56px);--_leading-image-shape: var(--md-list-item-leading-image-shape, 0px);--_leading-image-width: var(--md-list-item-leading-image-width, 56px);--_leading-video-shape: var(--md-list-item-leading-video-shape, 0px);--_leading-video-width: var(--md-list-item-leading-video-width, 100px);--_one-line-container-height: var(--md-list-item-one-line-container-height, 56px);--_pressed-label-text-color: var(--md-list-item-pressed-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_pressed-leading-icon-icon-color: var(--md-list-item-pressed-leading-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_pressed-state-layer-color: var(--md-list-item-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_pressed-state-layer-opacity: var(--md-list-item-pressed-state-layer-opacity, 0.12);--_pressed-trailing-icon-icon-color: var(--md-list-item-pressed-trailing-icon-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_small-leading-video-height: var(--md-list-item-small-leading-video-height, 56px);--_supporting-text-color: var(--md-list-item-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_supporting-text-font: var(--md-list-item-supporting-text-font, var(--md-sys-typescale-body-medium-font, var(--md-ref-typeface-plain, Roboto)));--_supporting-text-line-height: var(--md-list-item-supporting-text-line-height, var(--md-sys-typescale-body-medium-line-height, 1.25rem));--_supporting-text-size: var(--md-list-item-supporting-text-size, var(--md-sys-typescale-body-medium-size, 0.875rem));--_supporting-text-weight: var(--md-list-item-supporting-text-weight, var(--md-ref-typeface-weight-regular, 400));--_three-line-container-height: var(--md-list-item-three-line-container-height, 88px);--_trailing-icon-color: var(--md-list-item-trailing-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_trailing-icon-size: var(--md-list-item-trailing-icon-size, 24px);--_trailing-supporting-text-color: var(--md-list-item-trailing-supporting-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_trailing-supporting-text-font: var(--md-list-item-trailing-supporting-text-font, var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto)));--_trailing-supporting-text-line-height: var(--md-list-item-trailing-supporting-text-line-height, var(--md-sys-typescale-label-small-line-height, 1rem));--_trailing-supporting-text-size: var(--md-list-item-trailing-supporting-text-size, var(--md-sys-typescale-label-small-size, 0.688rem));--_trailing-supporting-text-weight: var(--md-list-item-trailing-supporting-text-weight, var(--md-sys-typescale-label-small-weight, var(--md-ref-typeface-weight-medium, 500)));--_two-line-container-height: var(--md-list-item-two-line-container-height, 72px);--_leading-element-leading-space: var(--md-list-item-leading-element-leading-space, 16px);--_leading-space: var(--md-list-item-leading-space, 16px);--_leading-video-leading-space: var(--md-list-item-leading-video-leading-space, 0px);--_trailing-element-headline-trailing-element-space: var(--md-list-item-trailing-element-headline-trailing-element-space, 16px);--_trailing-space: var(--md-list-item-trailing-space, 24px)}:host{color:unset;--md-ripple-hover-color: var(--_hover-state-layer-color);--md-ripple-hover-opacity: var(--_hover-state-layer-opacity);--md-ripple-pressed-color: var(--_pressed-state-layer-color);--md-ripple-pressed-opacity: var(--_pressed-state-layer-opacity)}md-focus-ring{--md-focus-ring-shape: 8px}.list-item{align-items:center;box-sizing:border-box;display:flex;outline:none;position:relative;width:100%;text-decoration:none;background-color:var(--_container-color);border-radius:var(--_container-shape);-webkit-tap-highlight-color:rgba(0,0,0,0)}.list-item:not(.disabled):not(.noninteractive){cursor:pointer}.list-item.disabled{pointer-events:none}.content-wrapper{display:flex;width:100%;box-sizing:border-box;border-radius:inherit;padding-inline-end:var(--_trailing-space)}md-ripple{border-radius:inherit}.with-one-line{min-height:var(--_one-line-container-height)}.with-two-line{min-height:var(--_two-line-container-height)}.with-three-line{min-height:var(--_three-line-container-height)}.start{display:inline-flex;flex-direction:column;justify-content:center;align-items:center;flex:0 0 auto;z-index:1}.with-three-line .start{justify-content:start}slot[name=start]::slotted([data-variant=icon]),slot[name=start]::slotted([data-variant=image]),slot[name=start]::slotted([data-variant=avatar]){margin-inline-start:var(--_leading-element-leading-space)}.body{display:inline-flex;justify-content:center;flex-direction:column;min-width:0;box-sizing:border-box;flex:1 0 0;padding-inline-start:var(--_leading-space);z-index:1}.end{display:inline-flex;flex-direction:column;justify-content:center;flex:0 0 auto;z-index:1}.with-three-line .end{justify-content:start}slot[name=end]::slotted(*),.trailing-supporting-text{margin-inline-start:var(--_trailing-element-headline-trailing-element-space)}.label-text{text-overflow:ellipsis;overflow-x:hidden;white-space:nowrap;color:var(--_label-text-color);font-family:var(--_label-text-font);font-size:var(--_label-text-size);line-height:var(--_label-text-line-height);font-weight:var(--_label-text-weight)}:hover .label-text{color:var(--_hover-label-text-color)}:focus .label-text{color:var(--_focus-label-text-color)}:active .label-text{color:var(--_pressed-label-text-color)}.disabled .label-text{color:var(--_disabled-label-text-color);opacity:var(--_disabled-label-text-opacity)}.supporting-text{text-overflow:ellipsis;white-space:normal;overflow:hidden;width:100%;color:var(--_supporting-text-color);font-family:var(--_supporting-text-font);font-size:var(--_supporting-text-size);line-height:var(--_supporting-text-line-height);font-weight:var(--_supporting-text-weight);-webkit-box-orient:vertical;-webkit-line-clamp:1;display:-webkit-box}.disabled .supporting-text{color:var(--_disabled-label-text-color);opacity:var(--_disabled-label-text-opacity)}.supporting-text--multi-line{-webkit-line-clamp:2}.trailing-supporting-text{font-family:var(--_trailing-supporting-text-font);font-size:var(--_trailing-supporting-text-size);line-height:var(--_trailing-supporting-text-line-height);font-weight:var(--_trailing-supporting-text-weight)}.list-item:not(.disabled) .trailing-supporting-text{color:var(--_trailing-supporting-text-color)}.disabled .trailing-supporting-text{color:var(--_disabled-label-text-color);opacity:var(--_disabled-label-text-opacity)}.with-three-line .trailing-supporting-text{margin-block-start:calc((var(--_label-text-line-height) - var(--_trailing-supporting-text-line-height))/2)}.focus-ring{z-index:1}::slotted([data-variant=image]){display:inline-flex;height:var(--_leading-image-height);width:var(--_leading-image-width);border-radius:var(--_leading-image-shape);margin-block:calc((var(--_two-line-container-height) - var(--_leading-image-height))/2)}.with-three-line ::slotted([data-variant=image]){margin-block:0}::slotted(*){fill:currentColor}slot[name=start]::slotted([data-variant=icon]){font-size:var(--_leading-icon-size);width:var(--_leading-icon-size);height:var(--_leading-icon-size);color:var(--_leading-icon-color)}.with-three-line slot[name=start]::slotted([data-variant=icon]){margin-block-start:calc((var(--_label-text-line-height) - var(--_leading-icon-size))/2)}slot[name=end]::slotted([data-variant=icon]){font-size:var(--_trailing-icon-size);width:var(--_trailing-icon-size);height:var(--_trailing-icon-size);color:var(--_trailing-icon-color)}.with-three-line slot[name=end]::slotted([data-variant=icon]){margin-block-start:calc((var(--_label-text-line-height) - var(--_trailing-icon-size))/2)}:hover slot[name=start]::slotted([data-variant=icon]){color:var(--_hover-leading-icon-icon-color)}:hover slot[name=end]::slotted([data-variant=icon]){color:var(--_hover-trailing-icon-icon-color)}:focus slot[name=start]::slotted([data-variant=icon]){color:var(--_focus-leading-icon-icon-color)}:focus slot[name=end]::slotted([data-variant=icon]){color:var(--_focus-trailing-icon-icon-color)}:active slot[name=start]::slotted([data-variant=icon]){color:var(--_pressed-leading-icon-icon-color)}:active slot[name=end]::slotted([data-variant=icon]){color:var(--_pressed-trailing-icon-icon-color)}.disabled slot[name=start]::slotted([data-variant=icon]){opacity:var(--_disabled-leading-icon-opacity);color:var(--_disabled-leading-icon-color)}.disabled slot[name=end]::slotted([data-variant=icon]){opacity:var(--_disabled-trailing-icon-opacity);color:var(--_disabled-trailing-icon-color)}::slotted([data-variant=avatar]){display:inline-flex;justify-content:center;align-items:center;background-color:var(--_leading-avatar-color);height:var(--_leading-avatar-size);width:var(--_leading-avatar-size);border-radius:var(--_leading-avatar-shape);color:var(--_leading-avatar-label-color);font-family:var(--_leading-avatar-label-font);font-size:var(--_leading-avatar-label-size);line-height:var(--_leading-avatar-label-line-height);font-weight:var(--_leading-avatar-label-weight)}::slotted([data-variant=video]),::slotted([data-variant=video-large]){display:inline-flex;object-fit:cover;height:var(--_small-leading-video-height);width:var(--_leading-video-width);border-radius:var(--_leading-video-shape);margin-inline-start:var(--_leading-video-leading-space);margin-block:calc((var(--_three-line-container-height) - var(--_small-leading-video-height))/2)}.with-three-line ::slotted([data-variant=video]),.with-three-line ::slotted([data-variant=video-large]){margin-block:0}::slotted([data-variant=video-large]){margin-block:calc((var(--_three-line-container-height) - var(--_large-leading-video-height))/2);height:var(--_large-leading-video-height)}/*# sourceMappingURL=list-item-styles.css.map */\n`;\n "]}
package/menu/harness.d.ts CHANGED
@@ -17,5 +17,5 @@ export declare class MenuHarness extends Harness<Menu> {
17
17
  protected getInteractiveElement(): Promise<HTMLElement>;
18
18
  /** @return ListItem harnesses for the menu's items. */
19
19
  getItems(): MenuItemHarness[];
20
- show(quick?: boolean): Promise<void>;
20
+ show(): Promise<void>;
21
21
  }
package/menu/harness.js CHANGED
@@ -15,16 +15,15 @@ export class MenuHarness extends Harness {
15
15
  */
16
16
  async getInteractiveElement() {
17
17
  await this.element.updateComplete;
18
- await this.show();
19
- return (await this.getItems())[0].getInteractiveElement();
18
+ return this.element.renderRoot.querySelector('md-list').renderRoot
19
+ .querySelector('.list');
20
20
  }
21
21
  /** @return ListItem harnesses for the menu's items. */
22
22
  getItems() {
23
23
  return this.element.items.map((item) => new MenuItemHarness(item));
24
24
  }
25
- async show(quick = true) {
25
+ async show() {
26
26
  const menu = this.element;
27
- menu.quick = quick;
28
27
  if (menu.open) {
29
28
  return;
30
29
  }
@@ -1 +1 @@
1
- {"version":3,"file":"harness.js","sourceRoot":"","sources":["harness.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAC,OAAO,EAAC,MAAM,uBAAuB,CAAC;AAG9C,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAE/D,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAE/D;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,OAAa;IAC5C;;OAEG;IACgB,KAAK,CAAC,qBAAqB;QAC5C,MAAM,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC;QAClC,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QAClB,OAAO,CAAC,MAAM,IAAI,CAAC,QAAQ,EAAE,CAAC,CAAC,CAAC,CAAC,CAAC,qBAAqB,EAAE,CAAC;IAC5D,CAAC;IAED,uDAAuD;IACvD,QAAQ;QACN,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CACzB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,eAAe,CAAC,IAA8B,CAAC,CAAC,CAAC;IACrE,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,KAAK,GAAG,IAAI;QACrB,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC;QAC1B,IAAI,CAAC,KAAK,GAAG,KAAK,CAAC;QACnB,IAAI,IAAI,CAAC,IAAI,EAAE;YACb,OAAO;SACR;QAED,MAAM,MAAM,GAAG,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YACrC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,GAAG,EAAE;gBACnC,OAAO,CAAC,IAAI,CAAC,CAAC;YAChB,CAAC,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;QACnB,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,IAAI,EAAE,CAAC;QACZ,MAAM,MAAM,CAAC;IACf,CAAC;CACF","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {LitElement} from 'lit';\n\nimport {Harness} from '../testing/harness.js';\n\nimport {Menu} from './internal/menu.js';\nimport {MenuItemHarness} from './internal/menuitem/harness.js';\n\nexport {MenuItemHarness} from './internal/menuitem/harness.js';\n\n/**\n * Test harness for menu.\n */\nexport class MenuHarness extends Harness<Menu> {\n /**\n * Shows the menu and returns the first list item element.\n */\n protected override async getInteractiveElement() {\n await this.element.updateComplete;\n await this.show();\n return (await this.getItems())[0].getInteractiveElement();\n }\n\n /** @return ListItem harnesses for the menu's items. */\n getItems() {\n return this.element.items.map(\n (item) => new MenuItemHarness(item as typeof item&LitElement));\n }\n\n async show(quick = true) {\n const menu = this.element;\n menu.quick = quick;\n if (menu.open) {\n return;\n }\n\n const opened = new Promise((resolve) => {\n menu.addEventListener('opened', () => {\n resolve(true);\n }, {once: true});\n });\n\n menu.show();\n await opened;\n }\n}\n"]}
1
+ {"version":3,"file":"harness.js","sourceRoot":"","sources":["harness.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAC,OAAO,EAAC,MAAM,uBAAuB,CAAC;AAG9C,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAE/D,OAAO,EAAC,eAAe,EAAC,MAAM,gCAAgC,CAAC;AAE/D;;GAEG;AACH,MAAM,OAAO,WAAY,SAAQ,OAAa;IAC5C;;OAEG;IACgB,KAAK,CAAC,qBAAqB;QAC5C,MAAM,IAAI,CAAC,OAAO,CAAC,cAAc,CAAC;QAClC,OAAO,IAAI,CAAC,OAAO,CAAC,UAAU,CAAC,aAAa,CAAC,SAAS,CAAE,CAAC,UAAU;aACvD,aAAa,CAAC,OAAO,CAAgB,CAAC;IACpD,CAAC;IAED,uDAAuD;IACvD,QAAQ;QACN,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,GAAG,CACzB,CAAC,IAAI,EAAE,EAAE,CAAC,IAAI,eAAe,CAAC,IAA8B,CAAC,CAAC,CAAC;IACrE,CAAC;IAED,KAAK,CAAC,IAAI;QACR,MAAM,IAAI,GAAG,IAAI,CAAC,OAAO,CAAC;QAC1B,IAAI,IAAI,CAAC,IAAI,EAAE;YACb,OAAO;SACR;QAED,MAAM,MAAM,GAAG,IAAI,OAAO,CAAC,CAAC,OAAO,EAAE,EAAE;YACrC,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,GAAG,EAAE;gBACnC,OAAO,CAAC,IAAI,CAAC,CAAC;YAChB,CAAC,EAAE,EAAC,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;QACnB,CAAC,CAAC,CAAC;QAEH,IAAI,CAAC,IAAI,EAAE,CAAC;QACZ,MAAM,MAAM,CAAC;IACf,CAAC;CACF","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {LitElement} from 'lit';\n\nimport {Harness} from '../testing/harness.js';\n\nimport {Menu} from './internal/menu.js';\nimport {MenuItemHarness} from './internal/menuitem/harness.js';\n\nexport {MenuItemHarness} from './internal/menuitem/harness.js';\n\n/**\n * Test harness for menu.\n */\nexport class MenuHarness extends Harness<Menu> {\n /**\n * Shows the menu and returns the first list item element.\n */\n protected override async getInteractiveElement() {\n await this.element.updateComplete;\n return this.element.renderRoot.querySelector('md-list')!.renderRoot\n .querySelector('.list') as HTMLElement;\n }\n\n /** @return ListItem harnesses for the menu's items. */\n getItems() {\n return this.element.items.map(\n (item) => new MenuItemHarness(item as typeof item&LitElement));\n }\n\n async show() {\n const menu = this.element;\n if (menu.open) {\n return;\n }\n\n const opened = new Promise((resolve) => {\n menu.addEventListener('opened', () => {\n resolve(true);\n }, {once: true});\n });\n\n menu.show();\n await opened;\n }\n}\n"]}
@@ -72,37 +72,43 @@
72
72
  max-height: inherit;
73
73
  height: inherit;
74
74
  min-width: inherit;
75
+ }
75
76
 
76
- &.fixed {
77
- position: fixed;
78
- }
77
+ .fixed {
78
+ position: fixed;
79
+ }
79
80
 
80
- md-list {
81
- height: inherit;
82
- max-height: inherit;
83
- display: block;
84
- overflow: auto;
85
- min-width: inherit;
86
- border-radius: inherit;
87
- }
81
+ md-list {
82
+ height: inherit;
83
+ max-height: inherit;
84
+ display: block;
85
+ overflow: auto;
86
+ min-width: inherit;
87
+ border-radius: inherit;
88
+ }
88
89
 
89
- &.has-overflow md-list {
90
- overflow: visible;
91
- }
90
+ .has-overflow md-list {
91
+ overflow: visible;
92
+ }
92
93
 
93
- &.animating md-list {
94
- pointer-events: none;
95
- overflow: hidden;
96
- }
94
+ .animating md-list {
95
+ overflow: hidden;
96
+ }
97
97
 
98
- &.animating ::slotted(.md-menu-hidden) {
99
- opacity: 0;
100
- }
98
+ .has-overflow.animating md-list {
99
+ // Often has-overlow is set because there are submenus. Since we need
100
+ // overflow to be hidden to make the animation work, we need to disable
101
+ // submenus opening mid-animation or else it looks completely wrong.
102
+ pointer-events: none;
103
+ }
101
104
 
102
- slot {
103
- display: block;
104
- height: inherit;
105
- max-height: inherit;
106
- }
105
+ .animating ::slotted(.md-menu-hidden) {
106
+ opacity: 0;
107
+ }
108
+
109
+ slot {
110
+ display: block;
111
+ height: inherit;
112
+ max-height: inherit;
107
113
  }
108
114
  }
@@ -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);min-width:300px}md-focus-ring{--md-focus-ring-shape: var(--_container-shape)}.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(.md-menu-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);min-width:300px}md-focus-ring{--md-focus-ring-shape: var(--_container-shape)}.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}.fixed{position:fixed}md-list{height:inherit;max-height:inherit;display:block;overflow:auto;min-width:inherit;border-radius:inherit}.has-overflow md-list{overflow:visible}.animating md-list{overflow:hidden}.has-overflow.animating md-list{pointer-events:none}.animating ::slotted(.md-menu-hidden){opacity:0}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);min-width:300px}md-focus-ring{--md-focus-ring-shape: var(--_container-shape)}.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(.md-menu-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);min-width:300px}md-focus-ring{--md-focus-ring-shape: var(--_container-shape)}.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}.fixed{position:fixed}md-list{height:inherit;max-height:inherit;display:block;overflow:auto;min-width:inherit;border-radius:inherit}.has-overflow md-list{overflow:visible}.animating md-list{overflow:hidden}.has-overflow.animating md-list{pointer-events:none}.animating ::slotted(.md-menu-hidden){opacity:0}slot{display:block;height:inherit;max-height:inherit}/*# sourceMappingURL=menu-styles.css.map */\n`;\n "]}
@@ -7,7 +7,6 @@ import '../../list/list.js';
7
7
  import '../../focus/md-focus-ring.js';
8
8
  import '../../elevation/elevation.js';
9
9
  import { LitElement } from 'lit';
10
- import { ARIARole } from '../../internal/aria/aria.js';
11
10
  import { MenuItem } from './shared.js';
12
11
  import { Corner, SurfacePositionTarget } from './surfacePositionController.js';
13
12
  import { TypeaheadController } from './typeaheadController.js';
@@ -31,9 +30,13 @@ export declare abstract class Menu extends LitElement {
31
30
  private readonly surfaceEl;
32
31
  private readonly slotEl;
33
32
  /**
34
- * The element in which the menu should align to.
33
+ * The ID of the element in the same root node in which the menu should align
34
+ * to. Overrides setting `anchorElement = elementReference`.
35
+ *
36
+ * __NOTE__: anchor or anchorElement must either be an HTMLElement or resolve
37
+ * to an HTMLElement in order for menu to open.
35
38
  */
36
- anchor: HTMLElement & Partial<SurfacePositionTarget> | null;
39
+ anchor: string;
37
40
  /**
38
41
  * Makes the element use `position:fixed` instead of `position:absolute`. In
39
42
  * most cases, the menu should position itself above most other
@@ -84,7 +87,7 @@ export declare abstract class Menu extends LitElement {
84
87
  /**
85
88
  * The role of the underlying list element.
86
89
  */
87
- type: ARIARole;
90
+ type: 'menu' | 'menubar' | 'listbox' | 'list';
88
91
  /**
89
92
  * The max time between the keystrokes of the typeahead menu behavior before
90
93
  * it clears the typeahead buffer.
@@ -138,6 +141,14 @@ export declare abstract class Menu extends LitElement {
138
141
  * Handles typeahead navigation through the menu.
139
142
  */
140
143
  typeaheadController: TypeaheadController;
144
+ private currentAnchorElement;
145
+ /**
146
+ * The element which the menu should align to. If `anchor` is set to a
147
+ * non-empty idref string, then `anchorEl` will resolve to the element with
148
+ * the given id in the same root node. Otherwise, `null`.
149
+ */
150
+ get anchorElement(): HTMLElement & Partial<SurfacePositionTarget> | null;
151
+ set anchorElement(element: HTMLElement & Partial<SurfacePositionTarget> | null);
141
152
  /**
142
153
  * Handles positioning the surface and aligning it to the anchor.
143
154
  */
@@ -48,9 +48,13 @@ export class Menu extends LitElement {
48
48
  constructor() {
49
49
  super(...arguments);
50
50
  /**
51
- * The element in which the menu should align to.
51
+ * The ID of the element in the same root node in which the menu should align
52
+ * to. Overrides setting `anchorElement = elementReference`.
53
+ *
54
+ * __NOTE__: anchor or anchorElement must either be an HTMLElement or resolve
55
+ * to an HTMLElement in order for menu to open.
52
56
  */
53
- this.anchor = null;
57
+ this.anchor = '';
54
58
  /**
55
59
  * Makes the element use `position:fixed` instead of `position:absolute`. In
56
60
  * most cases, the menu should position itself above most other
@@ -156,6 +160,7 @@ export class Menu extends LitElement {
156
160
  active: this.typeaheadActive
157
161
  };
158
162
  });
163
+ this.currentAnchorElement = null;
159
164
  /**
160
165
  * Handles positioning the surface and aligning it to the anchor.
161
166
  */
@@ -164,7 +169,7 @@ export class Menu extends LitElement {
164
169
  anchorCorner: this.anchorCorner,
165
170
  surfaceCorner: this.menuCorner,
166
171
  surfaceEl: this.surfaceEl,
167
- anchorEl: this.anchor,
172
+ anchorEl: this.anchorElement,
168
173
  isTopLayer: this.fixed,
169
174
  isOpen: this.open,
170
175
  xOffset: this.xOffset,
@@ -251,6 +256,22 @@ export class Menu extends LitElement {
251
256
  const menuCornerBlock = this.menuCorner.split('_')[0];
252
257
  return menuCornerBlock === 'START' ? 'DOWN' : 'UP';
253
258
  }
259
+ /**
260
+ * The element which the menu should align to. If `anchor` is set to a
261
+ * non-empty idref string, then `anchorEl` will resolve to the element with
262
+ * the given id in the same root node. Otherwise, `null`.
263
+ */
264
+ get anchorElement() {
265
+ if (this.anchor) {
266
+ return this.getRootNode()
267
+ .querySelector(`#${this.anchor}`);
268
+ }
269
+ return this.currentAnchorElement;
270
+ }
271
+ set anchorElement(element) {
272
+ this.currentAnchorElement = element;
273
+ this.requestUpdate('anchorElement');
274
+ }
254
275
  /**
255
276
  * The menu items associated with this menu. The items must be `MenuItem`s and
256
277
  * have both the `md-menu-item` and `md-list-item` attributes.
@@ -534,6 +555,8 @@ export class Menu extends LitElement {
534
555
  if (!isServer) {
535
556
  window.addEventListener('click', this.onWindowClick, { capture: true });
536
557
  }
558
+ // need to self-identify as an md-menu for submenu ripple identification.
559
+ this.toggleAttribute('md-menu', true);
537
560
  }
538
561
  disconnectedCallback() {
539
562
  super.disconnectedCallback();
@@ -616,7 +639,7 @@ __decorate([
616
639
  query('slot')
617
640
  ], Menu.prototype, "slotEl", void 0);
618
641
  __decorate([
619
- property({ attribute: false })
642
+ property()
620
643
  ], Menu.prototype, "anchor", void 0);
621
644
  __decorate([
622
645
  property({ type: Boolean })