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

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 (334) hide show
  1. package/README.md +7 -7
  2. package/aria/aria.d.ts +43 -0
  3. package/aria/aria.js +56 -0
  4. package/aria/aria.js.map +1 -0
  5. package/aria/delegate.d.ts +37 -0
  6. package/aria/delegate.js +53 -0
  7. package/aria/delegate.js.map +1 -0
  8. package/badge/badge.d.ts +0 -1
  9. package/badge/badge.js +0 -1
  10. package/badge/badge.js.map +1 -1
  11. package/badge/lib/badge.d.ts +8 -7
  12. package/badge/lib/badge.js +5 -6
  13. package/badge/lib/badge.js.map +1 -1
  14. package/button/lib/_elevation.scss +13 -3
  15. package/button/lib/button.d.ts +1 -12
  16. package/button/lib/button.js +29 -60
  17. package/button/lib/button.js.map +1 -1
  18. package/button/lib/shared-elevation-styles.css.js +1 -1
  19. package/button/lib/shared-elevation-styles.css.js.map +1 -1
  20. package/checkbox/lib/checkbox.d.ts +0 -1
  21. package/checkbox/lib/checkbox.js +33 -43
  22. package/checkbox/lib/checkbox.js.map +1 -1
  23. package/chips/_filter-chip.scss +6 -0
  24. package/chips/filter-chip.d.ts +20 -0
  25. package/chips/filter-chip.js +24 -0
  26. package/chips/filter-chip.js.map +1 -0
  27. package/chips/lib/_filter-chip.scss +141 -0
  28. package/chips/lib/_shared.scss +18 -14
  29. package/chips/lib/assist-styles.css.js +1 -1
  30. package/chips/lib/assist-styles.css.js.map +1 -1
  31. package/chips/lib/chip.d.ts +8 -3
  32. package/chips/lib/chip.js +29 -30
  33. package/chips/lib/chip.js.map +1 -1
  34. package/chips/lib/filter-chip.d.ts +21 -0
  35. package/chips/lib/filter-chip.js +47 -0
  36. package/chips/lib/filter-chip.js.map +1 -0
  37. package/chips/lib/filter-styles.css.js +9 -0
  38. package/chips/lib/filter-styles.css.js.map +1 -0
  39. package/{fab/lib/fab-extended-styles.scss → chips/lib/filter-styles.scss} +3 -3
  40. package/chips/lib/shared-styles.css.js +1 -1
  41. package/chips/lib/shared-styles.css.js.map +1 -1
  42. package/chips/lib/suggestion-styles.css.js +1 -1
  43. package/chips/lib/suggestion-styles.css.js.map +1 -1
  44. package/circularprogress/harness.d.ts +1 -0
  45. package/circularprogress/harness.js +4 -0
  46. package/circularprogress/harness.js.map +1 -1
  47. package/circularprogress/lib/circular-progress.d.ts +0 -1
  48. package/circularprogress/lib/circular-progress.js +16 -19
  49. package/circularprogress/lib/circular-progress.js.map +1 -1
  50. package/dialog/lib/_dialog.scss +8 -8
  51. package/dialog/lib/dialog-styles.css.js +1 -1
  52. package/dialog/lib/dialog-styles.css.js.map +1 -1
  53. package/dialog/lib/dialog.js +25 -49
  54. package/dialog/lib/dialog.js.map +1 -1
  55. package/divider/lib/divider.js +4 -7
  56. package/divider/lib/divider.js.map +1 -1
  57. package/elevation/lib/_elevation.scss +5 -7
  58. package/elevation/lib/elevation-styles.css.js +1 -1
  59. package/elevation/lib/elevation-styles.css.js.map +1 -1
  60. package/fab/_fab.scss +1 -0
  61. package/fab/branded-fab.d.ts +53 -0
  62. package/fab/branded-fab.js +56 -0
  63. package/fab/branded-fab.js.map +1 -0
  64. package/fab/fab.d.ts +25 -5
  65. package/fab/fab.js +27 -10
  66. package/fab/fab.js.map +1 -1
  67. package/fab/harness.d.ts +1 -2
  68. package/fab/harness.js +1 -1
  69. package/fab/harness.js.map +1 -1
  70. package/fab/lib/_fab-branded.scss +27 -0
  71. package/fab/lib/_fab.scss +144 -16
  72. package/fab/lib/_shared.scss +155 -130
  73. package/fab/lib/fab-branded-styles.css.js +9 -0
  74. package/fab/lib/fab-branded-styles.css.js.map +1 -0
  75. package/fab/lib/fab-branded-styles.scss +10 -0
  76. package/fab/lib/fab-styles.css.js +1 -1
  77. package/fab/lib/fab-styles.css.js.map +1 -1
  78. package/fab/lib/fab.d.ts +14 -10
  79. package/fab/lib/fab.js +19 -12
  80. package/fab/lib/fab.js.map +1 -1
  81. package/fab/lib/forced-colors-styles.css.d.ts +1 -0
  82. package/fab/lib/forced-colors-styles.css.js +9 -0
  83. package/fab/lib/forced-colors-styles.css.js.map +1 -0
  84. package/fab/lib/forced-colors-styles.scss +26 -0
  85. package/fab/lib/shared-styles.css.d.ts +1 -0
  86. package/fab/lib/shared-styles.css.js +9 -0
  87. package/fab/lib/shared-styles.css.js.map +1 -0
  88. package/fab/lib/{fab-shared-styles.scss → shared-styles.scss} +1 -1
  89. package/fab/lib/{fab-shared.d.ts → shared.d.ts} +24 -16
  90. package/fab/lib/shared.js +137 -0
  91. package/fab/lib/shared.js.map +1 -0
  92. package/field/lib/field.js +14 -27
  93. package/field/lib/field.js.map +1 -1
  94. package/focus/focus-ring.d.ts +0 -1
  95. package/focus/focus-ring.js +0 -1
  96. package/focus/focus-ring.js.map +1 -1
  97. package/focus/lib/focus-ring.js +2 -3
  98. package/focus/lib/focus-ring.js.map +1 -1
  99. package/focus/strong-focus.js +5 -0
  100. package/focus/strong-focus.js.map +1 -1
  101. package/icon/icon.d.ts +0 -1
  102. package/icon/icon.js +0 -1
  103. package/icon/icon.js.map +1 -1
  104. package/icon/lib/_icon.scss +2 -0
  105. package/icon/lib/icon-styles.css.js +1 -1
  106. package/icon/lib/icon-styles.css.js.map +1 -1
  107. package/icon/lib/icon.d.ts +5 -4
  108. package/icon/lib/icon.js +3 -2
  109. package/icon/lib/icon.js.map +1 -1
  110. package/iconbutton/lib/icon-button.d.ts +0 -4
  111. package/iconbutton/lib/icon-button.js +28 -48
  112. package/iconbutton/lib/icon-button.js.map +1 -1
  113. package/linearprogress/_linear-progress.scss +6 -0
  114. package/linearprogress/harness.d.ts +13 -0
  115. package/linearprogress/harness.js +18 -0
  116. package/linearprogress/harness.js.map +1 -0
  117. package/linearprogress/lib/_linear-progress.scss +380 -0
  118. package/linearprogress/lib/linear-progress-styles.css.d.ts +1 -0
  119. package/linearprogress/lib/linear-progress-styles.css.js +9 -0
  120. package/linearprogress/lib/linear-progress-styles.css.js.map +1 -0
  121. package/linearprogress/lib/linear-progress-styles.scss +8 -0
  122. package/linearprogress/lib/linear-progress.d.ts +35 -0
  123. package/linearprogress/lib/linear-progress.js +127 -0
  124. package/linearprogress/lib/linear-progress.js.map +1 -0
  125. package/linearprogress/linear-progress.d.ts +23 -0
  126. package/linearprogress/linear-progress.js +26 -0
  127. package/linearprogress/linear-progress.js.map +1 -0
  128. package/list/lib/_list.scss +6 -49
  129. package/list/lib/list-styles.css.js +1 -1
  130. package/list/lib/list-styles.css.js.map +1 -1
  131. package/list/lib/list.d.ts +1 -3
  132. package/list/lib/list.js +18 -34
  133. package/list/lib/list.js.map +1 -1
  134. package/list/lib/listitem/_list-item.scss +10 -69
  135. package/list/lib/listitem/forced-colors-styles.css.js +1 -1
  136. package/list/lib/listitem/forced-colors-styles.css.js.map +1 -1
  137. package/list/lib/listitem/list-item-styles.css.js +1 -1
  138. package/list/lib/listitem/list-item-styles.css.js.map +1 -1
  139. package/list/lib/listitem/list-item.d.ts +2 -4
  140. package/list/lib/listitem/list-item.js +24 -53
  141. package/list/lib/listitem/list-item.js.map +1 -1
  142. package/list/lib/listitemlink/list-item-link.js +4 -6
  143. package/list/lib/listitemlink/list-item-link.js.map +1 -1
  144. package/menu/lib/_menu.scss +6 -28
  145. package/menu/lib/menu-styles.css.js +1 -1
  146. package/menu/lib/menu-styles.css.js.map +1 -1
  147. package/menu/lib/menu.d.ts +1 -2
  148. package/menu/lib/menu.js +38 -63
  149. package/menu/lib/menu.js.map +1 -1
  150. package/menu/lib/menuitem/_menu-item.scss +13 -32
  151. package/menu/lib/menuitem/menu-item-styles.css.js +1 -1
  152. package/menu/lib/menuitem/menu-item-styles.css.js.map +1 -1
  153. package/menu/lib/menuitem/menu-item.d.ts +1 -1
  154. package/menu/lib/menuitem/menu-item.js +4 -6
  155. package/menu/lib/menuitem/menu-item.js.map +1 -1
  156. package/menu/lib/menuitemlink/menu-item-link.d.ts +0 -2
  157. package/menu/lib/menuitemlink/menu-item-link.js +3 -6
  158. package/menu/lib/menuitemlink/menu-item-link.js.map +1 -1
  159. package/menu/lib/shared.d.ts +6 -2
  160. package/menu/lib/shared.js.map +1 -1
  161. package/menu/lib/submenuitem/sub-menu-item.d.ts +0 -2
  162. package/menu/lib/submenuitem/sub-menu-item.js +7 -15
  163. package/menu/lib/submenuitem/sub-menu-item.js.map +1 -1
  164. package/navigationbar/lib/_navigation-bar.scss +7 -1
  165. package/navigationbar/lib/navigation-bar-styles.css.js +1 -1
  166. package/navigationbar/lib/navigation-bar-styles.css.js.map +1 -1
  167. package/navigationbar/lib/navigation-bar.d.ts +5 -5
  168. package/navigationbar/lib/navigation-bar.js +17 -18
  169. package/navigationbar/lib/navigation-bar.js.map +1 -1
  170. package/navigationbar/navigation-bar.d.ts +0 -1
  171. package/navigationbar/navigation-bar.js +0 -1
  172. package/navigationbar/navigation-bar.js.map +1 -1
  173. package/navigationdrawer/lib/navigation-drawer-modal.d.ts +5 -10
  174. package/navigationdrawer/lib/navigation-drawer-modal.js +19 -41
  175. package/navigationdrawer/lib/navigation-drawer-modal.js.map +1 -1
  176. package/navigationdrawer/lib/navigation-drawer.d.ts +5 -9
  177. package/navigationdrawer/lib/navigation-drawer.js +17 -38
  178. package/navigationdrawer/lib/navigation-drawer.js.map +1 -1
  179. package/navigationdrawer/navigation-drawer-modal.d.ts +0 -1
  180. package/navigationdrawer/navigation-drawer-modal.js +0 -1
  181. package/navigationdrawer/navigation-drawer-modal.js.map +1 -1
  182. package/navigationdrawer/navigation-drawer.d.ts +0 -1
  183. package/navigationdrawer/navigation-drawer.js +0 -1
  184. package/navigationdrawer/navigation-drawer.js.map +1 -1
  185. package/navigationtab/lib/navigation-tab.d.ts +19 -24
  186. package/navigationtab/lib/navigation-tab.js +48 -68
  187. package/navigationtab/lib/navigation-tab.js.map +1 -1
  188. package/navigationtab/navigation-tab.d.ts +0 -1
  189. package/navigationtab/navigation-tab.js +0 -1
  190. package/navigationtab/navigation-tab.js.map +1 -1
  191. package/package.json +1 -1
  192. package/radio/lib/radio.d.ts +0 -1
  193. package/radio/lib/radio.js +30 -37
  194. package/radio/lib/radio.js.map +1 -1
  195. package/ripple/lib/ripple.js +7 -13
  196. package/ripple/lib/ripple.js.map +1 -1
  197. package/segmentedbutton/lib/outlined-segmented-button.d.ts +16 -7
  198. package/segmentedbutton/lib/outlined-segmented-button.js +3 -3
  199. package/segmentedbutton/lib/outlined-segmented-button.js.map +1 -1
  200. package/segmentedbutton/lib/segmented-button.d.ts +27 -33
  201. package/segmentedbutton/lib/segmented-button.js +42 -75
  202. package/segmentedbutton/lib/segmented-button.js.map +1 -1
  203. package/segmentedbutton/outlined-segmented-button.d.ts +0 -1
  204. package/segmentedbutton/outlined-segmented-button.js +0 -1
  205. package/segmentedbutton/outlined-segmented-button.js.map +1 -1
  206. package/segmentedbuttonset/lib/outlined-segmented-button-set.d.ts +6 -4
  207. package/segmentedbuttonset/lib/outlined-segmented-button-set.js +3 -2
  208. package/segmentedbuttonset/lib/outlined-segmented-button-set.js.map +1 -1
  209. package/segmentedbuttonset/lib/segmented-button-set.d.ts +3 -9
  210. package/segmentedbuttonset/lib/segmented-button-set.js +14 -20
  211. package/segmentedbuttonset/lib/segmented-button-set.js.map +1 -1
  212. package/segmentedbuttonset/outlined-segmented-button-set.d.ts +0 -1
  213. package/segmentedbuttonset/outlined-segmented-button-set.js +0 -1
  214. package/segmentedbuttonset/outlined-segmented-button-set.js.map +1 -1
  215. package/select/_filled-select.scss +6 -0
  216. package/select/_outlined-select.scss +6 -0
  217. package/select/filled-select.d.ts +41 -0
  218. package/select/filled-select.js +46 -0
  219. package/select/filled-select.js.map +1 -0
  220. package/select/harness.d.ts +24 -0
  221. package/select/harness.js +53 -0
  222. package/select/harness.js.map +1 -0
  223. package/select/lib/_filled-select.scss +163 -0
  224. package/select/lib/_outlined-select.scss +146 -0
  225. package/select/lib/_shared.scss +48 -0
  226. package/select/lib/filled-forced-colors-styles.css.d.ts +1 -0
  227. package/select/lib/filled-forced-colors-styles.css.js +9 -0
  228. package/select/lib/filled-forced-colors-styles.css.js.map +1 -0
  229. package/select/lib/filled-forced-colors-styles.scss +29 -0
  230. package/select/lib/filled-select-styles.css.d.ts +1 -0
  231. package/select/lib/filled-select-styles.css.js +9 -0
  232. package/select/lib/filled-select-styles.css.js.map +1 -0
  233. package/select/lib/filled-select-styles.scss +10 -0
  234. package/select/lib/filled-select.d.ts +10 -0
  235. package/select/lib/filled-select.js +16 -0
  236. package/select/lib/filled-select.js.map +1 -0
  237. package/select/lib/outlined-forced-colors-styles.css.d.ts +1 -0
  238. package/select/lib/outlined-forced-colors-styles.css.js +9 -0
  239. package/select/lib/outlined-forced-colors-styles.css.js.map +1 -0
  240. package/select/lib/outlined-forced-colors-styles.scss +29 -0
  241. package/select/lib/outlined-select-styles.css.d.ts +1 -0
  242. package/select/lib/outlined-select-styles.css.js +9 -0
  243. package/select/lib/outlined-select-styles.css.js.map +1 -0
  244. package/select/lib/outlined-select-styles.scss +10 -0
  245. package/select/lib/outlined-select.d.ts +10 -0
  246. package/select/lib/outlined-select.js +16 -0
  247. package/select/lib/outlined-select.js.map +1 -0
  248. package/select/lib/select.d.ts +218 -0
  249. package/select/lib/select.js +587 -0
  250. package/select/lib/select.js.map +1 -0
  251. package/select/lib/selectoption/harness.d.ts +11 -0
  252. package/select/lib/selectoption/harness.js +12 -0
  253. package/select/lib/selectoption/harness.js.map +1 -0
  254. package/select/lib/selectoption/select-option.d.ts +30 -0
  255. package/select/lib/selectoption/select-option.js +71 -0
  256. package/select/lib/selectoption/select-option.js.map +1 -0
  257. package/select/lib/shared-styles.css.d.ts +1 -0
  258. package/select/lib/shared-styles.css.js +9 -0
  259. package/select/lib/shared-styles.css.js.map +1 -0
  260. package/select/lib/shared-styles.scss +10 -0
  261. package/select/lib/shared.d.ts +52 -0
  262. package/select/lib/shared.js +41 -0
  263. package/select/lib/shared.js.map +1 -0
  264. package/select/outlined-select.d.ts +41 -0
  265. package/select/outlined-select.js +46 -0
  266. package/select/outlined-select.js.map +1 -0
  267. package/select/select-option.d.ts +44 -0
  268. package/select/select-option.js +51 -0
  269. package/select/select-option.js.map +1 -0
  270. package/slider/harness.d.ts +1 -0
  271. package/slider/harness.js +5 -0
  272. package/slider/harness.js.map +1 -1
  273. package/slider/lib/_slider.scss +146 -164
  274. package/slider/lib/forced-colors-styles.css.js +1 -1
  275. package/slider/lib/forced-colors-styles.css.js.map +1 -1
  276. package/slider/lib/forced-colors-styles.scss +2 -2
  277. package/slider/lib/slider-styles.css.js +1 -1
  278. package/slider/lib/slider-styles.css.js.map +1 -1
  279. package/slider/lib/slider.d.ts +2 -7
  280. package/slider/lib/slider.js +64 -118
  281. package/slider/lib/slider.js.map +1 -1
  282. package/switch/lib/switch.d.ts +0 -2
  283. package/switch/lib/switch.js +32 -54
  284. package/switch/lib/switch.js.map +1 -1
  285. package/textfield/lib/text-field.d.ts +0 -10
  286. package/textfield/lib/text-field.js +45 -115
  287. package/textfield/lib/text-field.js.map +1 -1
  288. package/tokens/_index.scss +3 -0
  289. package/tokens/_md-comp-assist-chip.scss +25 -20
  290. package/tokens/_md-comp-elevation.scss +0 -4
  291. package/tokens/_md-comp-fab-branded.scss +109 -1
  292. package/tokens/_md-comp-fab.scss +290 -0
  293. package/tokens/_md-comp-filled-select.scss +150 -1
  294. package/tokens/_md-comp-filter-chip.scss +103 -93
  295. package/tokens/_md-comp-input-chip.scss +77 -85
  296. package/tokens/_md-comp-linear-progress-indicator.scss +14 -1
  297. package/tokens/_md-comp-list-item.scss +201 -0
  298. package/tokens/_md-comp-list.scss +107 -26
  299. package/tokens/_md-comp-menu-item.scss +76 -0
  300. package/tokens/_md-comp-menu.scss +52 -2
  301. package/tokens/_md-comp-outlined-select.scss +150 -1
  302. package/tokens/_md-comp-slider.scss +13 -1
  303. package/tokens/_md-comp-suggestion-chip.scss +29 -21
  304. package/tokens/_values.scss +5 -2
  305. package/types/aria.d.ts +61 -1
  306. package/actionelement/action-element.d.ts +0 -79
  307. package/actionelement/action-element.js +0 -97
  308. package/actionelement/action-element.js.map +0 -1
  309. package/button/lib/state.d.ts +0 -10
  310. package/button/lib/state.js +0 -7
  311. package/button/lib/state.js.map +0 -1
  312. package/controller/action-controller.d.ts +0 -147
  313. package/controller/action-controller.js +0 -286
  314. package/controller/action-controller.js.map +0 -1
  315. package/decorators/aria-property.d.ts +0 -32
  316. package/decorators/aria-property.js +0 -99
  317. package/decorators/aria-property.js.map +0 -1
  318. package/fab/_fab-extended.scss +0 -6
  319. package/fab/fab-extended.d.ts +0 -23
  320. package/fab/fab-extended.js +0 -29
  321. package/fab/fab-extended.js.map +0 -1
  322. package/fab/lib/_fab-extended.scss +0 -73
  323. package/fab/lib/fab-extended-styles.css.js +0 -9
  324. package/fab/lib/fab-extended-styles.css.js.map +0 -1
  325. package/fab/lib/fab-extended.d.ts +0 -19
  326. package/fab/lib/fab-extended.js +0 -28
  327. package/fab/lib/fab-extended.js.map +0 -1
  328. package/fab/lib/fab-shared-styles.css.js +0 -9
  329. package/fab/lib/fab-shared-styles.css.js.map +0 -1
  330. package/fab/lib/fab-shared.js +0 -121
  331. package/fab/lib/fab-shared.js.map +0 -1
  332. package/slider/lib/_tokens.scss +0 -65
  333. /package/{fab/lib/fab-extended-styles.css.d.ts → chips/lib/filter-styles.css.d.ts} +0 -0
  334. /package/fab/lib/{fab-shared-styles.css.d.ts → fab-branded-styles.css.d.ts} +0 -0
@@ -0,0 +1 @@
1
+ {"version":3,"file":"linear-progress-styles.css.js","sourceRoot":"","sources":["linear-progress-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{--_active-indicator-color: var(--md-linear-progress-active-indicator-color, var(--md-sys-color-primary, #6750a4));--_active-indicator-height: var(--md-linear-progress-active-indicator-height, 4px);--_four-color-active-indicator-four-color: var(--md-linear-progress-four-color-active-indicator-four-color, var(--md-sys-color-tertiary-container, #ffd8e4));--_four-color-active-indicator-one-color: var(--md-linear-progress-four-color-active-indicator-one-color, var(--md-sys-color-primary, #6750a4));--_four-color-active-indicator-three-color: var(--md-linear-progress-four-color-active-indicator-three-color, var(--md-sys-color-tertiary, #7d5260));--_four-color-active-indicator-two-color: var(--md-linear-progress-four-color-active-indicator-two-color, var(--md-sys-color-primary-container, #eaddff));--_track-color: var(--md-linear-progress-track-color, var(--md-sys-color-surface-container-highest, #e6e0e9));--_track-height: var(--md-linear-progress-track-height, 4px);--_track-shape: var(--md-linear-progress-track-shape, 0px);display:block;position:relative;min-inline-size:80px;block-size:var(--_track-height);content-visibility:auto;contain:strict}.linear-progress,.track,.buffer-bar,.bar,.bar-inner{position:absolute}.linear-progress{inset:0;outline:rgba(0,0,0,0) solid 1px;border-radius:var(--_track-shape);overflow:hidden;display:flex;align-items:center}.bar{animation:none;inline-size:100%;block-size:var(--_active-indicator-height);transform-origin:left center;will-change:transform;transition:transform 250ms cubic-bezier(0.4, 0, 0.6, 1)}.secondary-bar{display:none}.bar-inner{inset:0;animation:none;background:var(--_active-indicator-color)}.buffer-bar{background:var(--_track-color);inset:0;will-change:transform;transition:transform 250ms cubic-bezier(0.4, 0, 0.6, 1);transform-origin:left center}.track{inset:0;will-change:transform;animation:linear infinite 250ms;animation-name:buffering;background:0/calc(var(--_track-height) / 2 * 5) 100% radial-gradient(circle at calc(var(--_track-height) / 2 * 2), var(--_track-color) 0, var(--_track-color) calc(var(--_track-height) / 2), transparent calc(var(--_track-height) / 2))}.indeterminate .bar{transition:none}.indeterminate .primary-bar{inset-inline-start:-145.167%}.indeterminate .secondary-bar{inset-inline-start:-54.8889%;display:block}.indeterminate .track{display:none}.indeterminate.animation-ready .primary-bar{will-change:transform;animation:linear infinite 2s;animation-name:primary-indeterminate-translate}.indeterminate.animation-ready .primary-bar>.bar-inner{will-change:transform;animation:linear infinite 2s primary-indeterminate-scale}.indeterminate.animation-ready.four-colors .primary-bar>.bar-inner{animation-name:primary-indeterminate-scale,four-colors;animation-duration:2s,4s}.indeterminate.animation-ready .secondary-bar{will-change:transform;animation:linear infinite 2s;animation-name:secondary-indeterminate-translate}.indeterminate.animation-ready .secondary-bar>.bar-inner{will-change:transform;animation:linear infinite 2s secondary-indeterminate-scale}.indeterminate.animation-ready.four-colors .secondary-bar>.bar-inner{animation-name:secondary-indeterminate-scale,four-colors;animation-duration:2s,4s}:host-context([dir=rtl]) .linear-progress .bar{transform-origin:right center}:host-context([dir=rtl]) .linear-progress .buffer-bar{transform-origin:right center}:host-context([dir=rtl]) .linear-progress .track{animation-name:buffering-rtl}:host-context([dir=rtl]) .linear-progress.indeterminate.animation-ready .primary-bar{animation-name:primary-indeterminate-translate-rtl}:host-context([dir=rtl]) .linear-progress.indeterminate.animation-ready .secondary-bar{animation-name:secondary-indeterminate-translate-rtl}:host([dir=rtl]) .linear-progress .bar{transform-origin:right center}:host([dir=rtl]) .linear-progress .buffer-bar{transform-origin:right center}:host([dir=rtl]) .linear-progress .track{animation-name:buffering-rtl}:host([dir=rtl]) .linear-progress.indeterminate.animation-ready .primary-bar{animation-name:primary-indeterminate-translate-rtl}:host([dir=rtl]) .linear-progress.indeterminate.animation-ready .secondary-bar{animation-name:secondary-indeterminate-translate-rtl}.linear-progress:dir(rtl) .bar{transform-origin:right center}.linear-progress:dir(rtl) .buffer-bar{transform-origin:right center}.linear-progress:dir(rtl) .track{animation-name:buffering-rtl}.linear-progress:dir(rtl).indeterminate.animation-ready .primary-bar{animation-name:primary-indeterminate-translate-rtl}.linear-progress:dir(rtl).indeterminate.animation-ready .secondary-bar{animation-name:secondary-indeterminate-translate-rtl}@keyframes primary-indeterminate-scale{0%{transform:scaleX(0.08)}36.65%{animation-timing-function:cubic-bezier(0.334731, 0.12482, 0.785844, 1);transform:scaleX(0.08)}69.15%{animation-timing-function:cubic-bezier(0.06, 0.11, 0.6, 1);transform:scaleX(0.661479)}100%{transform:scaleX(0.08)}}@keyframes secondary-indeterminate-scale{0%{animation-timing-function:cubic-bezier(0.205028, 0.057051, 0.57661, 0.453971);transform:scaleX(0.08)}19.15%{animation-timing-function:cubic-bezier(0.152313, 0.196432, 0.648374, 1.00432);transform:scaleX(0.457104)}44.15%{animation-timing-function:cubic-bezier(0.257759, -0.003163, 0.211762, 1.38179);transform:scaleX(0.72796)}100%{transform:scaleX(0.08)}}@keyframes buffering{0%{transform:translateX(calc(1 * calc(var(--_track-height) / 2 * 5)))}}@keyframes primary-indeterminate-translate{0%{transform:translateX(0px)}20%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(0px)}59.15%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(1 * 83.6714%))}100%{transform:translateX(calc(1 * 200.611%))}}@keyframes secondary-indeterminate-translate{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);transform:translateX(0px)}25%{animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);transform:translateX(calc(1 * 37.6519%))}48.35%{animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);transform:translateX(calc(1 * 84.3862%))}100%{transform:translateX(calc(1 * 160.278%))}}@keyframes buffering-rtl{0%{transform:translateX(calc(-1 * calc(var(--_track-height) / 2 * 5)))}}@keyframes primary-indeterminate-translate-rtl{0%{transform:translateX(0px)}20%{animation-timing-function:cubic-bezier(0.5, 0, 0.701732, 0.495819);transform:translateX(0px)}59.15%{animation-timing-function:cubic-bezier(0.302435, 0.381352, 0.55, 0.956352);transform:translateX(calc(-1 * 83.6714%))}100%{transform:translateX(calc(-1 * 200.611%))}}@keyframes secondary-indeterminate-translate-rtl{0%{animation-timing-function:cubic-bezier(0.15, 0, 0.515058, 0.409685);transform:translateX(0px)}25%{animation-timing-function:cubic-bezier(0.31033, 0.284058, 0.8, 0.733712);transform:translateX(calc(-1 * 37.6519%))}48.35%{animation-timing-function:cubic-bezier(0.4, 0.627035, 0.6, 0.902026);transform:translateX(calc(-1 * 84.3862%))}100%{transform:translateX(calc(-1 * 160.278%))}}@keyframes four-colors{0%{background:var(--_four-color-active-indicator-one-color)}15%{background:var(--_four-color-active-indicator-one-color)}25%{background:var(--_four-color-active-indicator-two-color)}40%{background:var(--_four-color-active-indicator-two-color)}50%{background:var(--_four-color-active-indicator-three-color)}65%{background:var(--_four-color-active-indicator-three-color)}75%{background:var(--_four-color-active-indicator-four-color)}90%{background:var(--_four-color-active-indicator-four-color)}100%{background:var(--_four-color-active-indicator-one-color)}}@media screen and (forced-colors: active){.linear-progress{--_active-indicator-color: canvastext;--_track-color: graytext;border:1px solid canvastext}.indeterminate.linear-progress{--_track-color: canvas}}/*# sourceMappingURL=linear-progress-styles.css.map */\n`;\n "]}
@@ -0,0 +1,8 @@
1
+ //
2
+ // Copyright 2023 Google LLC
3
+ // SPDX-License-Identifier: Apache-2.0
4
+ //
5
+
6
+ @use './linear-progress';
7
+
8
+ @include linear-progress.styles;
@@ -0,0 +1,35 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { LitElement } from 'lit';
7
+ /**
8
+ * LinearProgress component.
9
+ */
10
+ export declare class LinearProgress extends LitElement {
11
+ /**
12
+ * Whether or not to render indeterminate progress in an animated state.
13
+ */
14
+ indeterminate: boolean;
15
+ /**
16
+ * Progress to display, a fraction between 0 and 1.
17
+ */
18
+ progress: number;
19
+ /**
20
+ * Buffer amount to display, a fraction between 0 and 1.
21
+ */
22
+ buffer: number;
23
+ /**
24
+ * Whether or not to render indeterminate mode using 4 colors instead of one.
25
+ *
26
+ */
27
+ fourColors: boolean;
28
+ protected rootEl: HTMLElement;
29
+ protected animationReady: boolean;
30
+ protected resizeObserver: ResizeObserver | null;
31
+ protected render(): import("lit-html").TemplateResult<1>;
32
+ connectedCallback(): Promise<void>;
33
+ disconnectedCallback(): void;
34
+ protected restartAnimation(): Promise<void>;
35
+ }
@@ -0,0 +1,127 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ var _a;
7
+ import { __decorate } from "tslib";
8
+ import { html, LitElement, nothing } from 'lit';
9
+ import { property, query, state } from 'lit/decorators.js';
10
+ import { classMap } from 'lit/directives/class-map.js';
11
+ import { styleMap } from 'lit/directives/style-map.js';
12
+ import { requestUpdateOnAriaChange } from '../../aria/delegate.js';
13
+ /**
14
+ * LinearProgress component.
15
+ */
16
+ export class LinearProgress extends LitElement {
17
+ constructor() {
18
+ super(...arguments);
19
+ /**
20
+ * Whether or not to render indeterminate progress in an animated state.
21
+ */
22
+ this.indeterminate = false;
23
+ /**
24
+ * Progress to display, a fraction between 0 and 1.
25
+ */
26
+ this.progress = 0;
27
+ /**
28
+ * Buffer amount to display, a fraction between 0 and 1.
29
+ */
30
+ this.buffer = 1;
31
+ /**
32
+ * Whether or not to render indeterminate mode using 4 colors instead of one.
33
+ *
34
+ */
35
+ this.fourColors = false;
36
+ this.animationReady = true;
37
+ this.resizeObserver = null;
38
+ }
39
+ // Note, the indeterminate animation is rendered with transform %'s
40
+ // Previously, this was optimized to use px calculated with the resizeObserver
41
+ // due to a now fixed Chrome bug: crbug.com/389359.
42
+ render() {
43
+ const rootClasses = {
44
+ 'indeterminate': this.indeterminate,
45
+ 'animation-ready': this.animationReady,
46
+ 'four-colors': this.fourColors
47
+ };
48
+ const progressStyles = {
49
+ transform: `scaleX(${(this.indeterminate ? 1 : this.progress) * 100}%)`
50
+ };
51
+ const bufferStyles = {
52
+ transform: `scaleX(${(this.indeterminate ? 1 : this.buffer) * 100}%)`
53
+ };
54
+ // Needed for closure conformance
55
+ const { ariaLabel } = this;
56
+ return html `
57
+ <div
58
+ role="progressbar"
59
+ class="linear-progress ${classMap(rootClasses)}"
60
+ aria-label="${ariaLabel || nothing}"
61
+ aria-valuemin="0"
62
+ aria-valuemax="1"
63
+ aria-valuenow="${this.indeterminate ? nothing : this.progress}">
64
+ <div class="track"></div>
65
+ <div class="buffer-bar" style=${styleMap(bufferStyles)}></div>
66
+ <div class="bar primary-bar" style=${styleMap(progressStyles)}>
67
+ <div class="bar-inner"></div>
68
+ </div>
69
+ <div class="bar secondary-bar">
70
+ <div class="bar-inner"></div>
71
+ </div>
72
+ </div>`;
73
+ }
74
+ async connectedCallback() {
75
+ super.connectedCallback();
76
+ // wait for rendering.
77
+ await this.updateComplete;
78
+ if (this.resizeObserver) {
79
+ return;
80
+ }
81
+ this.resizeObserver = new ResizeObserver(() => {
82
+ if (this.indeterminate) {
83
+ this.restartAnimation();
84
+ }
85
+ });
86
+ this.resizeObserver.observe(this.rootEl);
87
+ }
88
+ disconnectedCallback() {
89
+ if (this.resizeObserver) {
90
+ this.resizeObserver.disconnect();
91
+ this.resizeObserver = null;
92
+ }
93
+ super.disconnectedCallback();
94
+ }
95
+ // When size changes, restart the animation
96
+ // to avoid jank.
97
+ async restartAnimation() {
98
+ await this.updateComplete;
99
+ this.animationReady = false;
100
+ await new Promise(requestAnimationFrame);
101
+ this.animationReady = true;
102
+ await this.updateComplete;
103
+ }
104
+ }
105
+ _a = LinearProgress;
106
+ (() => {
107
+ requestUpdateOnAriaChange(_a);
108
+ })();
109
+ __decorate([
110
+ property({ type: Boolean })
111
+ ], LinearProgress.prototype, "indeterminate", void 0);
112
+ __decorate([
113
+ property({ type: Number })
114
+ ], LinearProgress.prototype, "progress", void 0);
115
+ __decorate([
116
+ property({ type: Number })
117
+ ], LinearProgress.prototype, "buffer", void 0);
118
+ __decorate([
119
+ property({ type: Boolean, attribute: 'four-colors' })
120
+ ], LinearProgress.prototype, "fourColors", void 0);
121
+ __decorate([
122
+ query('.linear-progress')
123
+ ], LinearProgress.prototype, "rootEl", void 0);
124
+ __decorate([
125
+ state()
126
+ ], LinearProgress.prototype, "animationReady", void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,CAAC,cAAc,GAAG,IAAI,CAAC;QAC3B,MAAM,IAAI,CAAC,cAAc,CAAC;IAC5B,CAAC;CACF;;AApGC;IACE,yBAAyB,CAAC,EAAI,CAAC,CAAC;AAClC,CAAC,GAAA,CAAA;AAK0B;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;qDAAuB;AAKvB;IAAzB,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;gDAAc;AAKb;IAAzB,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;8CAAY;AAMgB;IAApD,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAE,SAAS,EAAE,aAAa,EAAC,CAAC;kDAAoB;AAE7C;IAA1B,KAAK,CAAC,kBAAkB,CAAC;8CAAgC;AAEjD;IAAR,KAAK,EAAE;sDAAiC","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {html, LitElement, nothing} from 'lit';\nimport {property, query, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {styleMap} from 'lit/directives/style-map.js';\n\nimport {requestUpdateOnAriaChange} from '../../aria/delegate.js';\nimport {ARIAMixinStrict} from '../../types/aria.js';\n\n/**\n * LinearProgress component.\n */\nexport class LinearProgress extends LitElement {\n static {\n requestUpdateOnAriaChange(this);\n }\n\n /**\n * Whether or not to render indeterminate progress in an animated state.\n */\n @property({type: Boolean}) indeterminate = false;\n\n /**\n * Progress to display, a fraction between 0 and 1.\n */\n @property({type: Number}) progress = 0;\n\n /**\n * Buffer amount to display, a fraction between 0 and 1.\n */\n @property({type: Number}) buffer = 1;\n\n /**\n * Whether or not to render indeterminate mode using 4 colors instead of one.\n *\n */\n @property({type: Boolean, attribute: 'four-colors'}) fourColors = false;\n\n @query('.linear-progress') protected rootEl!: HTMLElement;\n\n @state() protected animationReady = true;\n protected resizeObserver: ResizeObserver|null = null;\n\n // Note, the indeterminate animation is rendered with transform %'s\n // Previously, this was optimized to use px calculated with the resizeObserver\n // due to a now fixed Chrome bug: crbug.com/389359.\n protected override render() {\n const rootClasses = {\n 'indeterminate': this.indeterminate,\n 'animation-ready': this.animationReady,\n 'four-colors': this.fourColors\n };\n\n const progressStyles = {\n transform: `scaleX(${(this.indeterminate ? 1 : this.progress) * 100}%)`\n };\n const bufferStyles = {\n transform: `scaleX(${(this.indeterminate ? 1 : this.buffer) * 100}%)`\n };\n\n // Needed for closure conformance\n const {ariaLabel} = this as ARIAMixinStrict;\n return html`\n <div\n role=\"progressbar\"\n class=\"linear-progress ${classMap(rootClasses)}\"\n aria-label=\"${ariaLabel || nothing}\"\n aria-valuemin=\"0\"\n aria-valuemax=\"1\"\n aria-valuenow=\"${this.indeterminate ? nothing : this.progress}\">\n <div class=\"track\"></div>\n <div class=\"buffer-bar\" style=${styleMap(bufferStyles)}></div>\n <div class=\"bar primary-bar\" style=${styleMap(progressStyles)}>\n <div class=\"bar-inner\"></div>\n </div>\n <div class=\"bar secondary-bar\">\n <div class=\"bar-inner\"></div>\n </div>\n </div>`;\n }\n\n override async connectedCallback() {\n super.connectedCallback();\n // wait for rendering.\n await this.updateComplete;\n if (this.resizeObserver) {\n return;\n }\n this.resizeObserver = new ResizeObserver(() => {\n if (this.indeterminate) {\n this.restartAnimation();\n }\n });\n this.resizeObserver.observe(this.rootEl);\n }\n\n override disconnectedCallback() {\n if (this.resizeObserver) {\n this.resizeObserver.disconnect();\n this.resizeObserver = null;\n }\n super.disconnectedCallback();\n }\n\n // When size changes, restart the animation\n // to avoid jank.\n protected async restartAnimation() {\n await this.updateComplete;\n this.animationReady = false;\n await new Promise(requestAnimationFrame);\n this.animationReady = true;\n await this.updateComplete;\n }\n}\n"]}
@@ -0,0 +1,23 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { LinearProgress } from './lib/linear-progress.js';
7
+ declare global {
8
+ interface HTMLElementTagNameMap {
9
+ 'md-linear-progress': MdLinearProgress;
10
+ }
11
+ }
12
+ /**
13
+ * @summary Linear progress indicators display progress by animating along the
14
+ * length of a fixed, visible track.
15
+ *
16
+ * @description
17
+ * Progress indicators inform users about the status of ongoing processes.
18
+ * - Determinate indicators display how long a process will take.
19
+ * - Indeterminate indicators express an unspecified amount of wait time.
20
+ */
21
+ export declare class MdLinearProgress extends LinearProgress {
22
+ static styles: import("lit").CSSResult[];
23
+ }
@@ -0,0 +1,26 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2023 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { __decorate } from "tslib";
7
+ import { customElement } from 'lit/decorators.js';
8
+ import { LinearProgress } from './lib/linear-progress.js';
9
+ import { styles } from './lib/linear-progress-styles.css.js';
10
+ /**
11
+ * @summary Linear progress indicators display progress by animating along the
12
+ * length of a fixed, visible track.
13
+ *
14
+ * @description
15
+ * Progress indicators inform users about the status of ongoing processes.
16
+ * - Determinate indicators display how long a process will take.
17
+ * - Indeterminate indicators express an unspecified amount of wait time.
18
+ */
19
+ let MdLinearProgress = class MdLinearProgress extends LinearProgress {
20
+ };
21
+ MdLinearProgress.styles = [styles];
22
+ MdLinearProgress = __decorate([
23
+ customElement('md-linear-progress')
24
+ ], MdLinearProgress);
25
+ export { MdLinearProgress };
26
+ //# sourceMappingURL=linear-progress.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"linear-progress.js","sourceRoot":"","sources":["linear-progress.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,cAAc,EAAC,MAAM,0BAA0B,CAAC;AACxD,OAAO,EAAC,MAAM,EAAC,MAAM,qCAAqC,CAAC;AAQ3D;;;;;;;;GAQG;AAEI,IAAM,gBAAgB,GAAtB,MAAM,gBAAiB,SAAQ,cAAc;;AAClC,uBAAM,GAAG,CAAC,MAAM,CAAC,CAAC;AADvB,gBAAgB;IAD5B,aAAa,CAAC,oBAAoB,CAAC;GACvB,gBAAgB,CAE5B;SAFY,gBAAgB","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {customElement} from 'lit/decorators.js';\n\nimport {LinearProgress} from './lib/linear-progress.js';\nimport {styles} from './lib/linear-progress-styles.css.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-linear-progress': MdLinearProgress;\n }\n}\n\n/**\n * @summary Linear progress indicators display progress by animating along the\n * length of a fixed, visible track.\n *\n * @description\n * Progress indicators inform users about the status of ongoing processes.\n * - Determinate indicators display how long a process will take.\n * - Indeterminate indicators express an unspecified amount of wait time.\n */\n@customElement('md-linear-progress')\nexport class MdLinearProgress extends LinearProgress {\n static override styles = [styles];\n}\n"]}
@@ -18,18 +18,15 @@
18
18
  // go/keep-sorted end
19
19
 
20
20
  @mixin theme($tokens) {
21
- $reference: tokens.md-comp-list-values();
22
- $reference: resolve-tokens($reference);
23
- $tokens: resolve-tokens($tokens);
24
- $tokens: theme.validate-theme($reference, $tokens);
25
- $tokens: theme.create-theme-vars($tokens, list);
21
+ $tokens: theme.validate-theme(tokens.md-comp-list-values(), $tokens);
26
22
 
27
- @include theme.emit-theme-vars($tokens);
23
+ @each $token, $value in $tokens {
24
+ --md-list-#{$token}: #{$value};
25
+ }
28
26
  }
29
27
 
30
28
  @mixin styles() {
31
- $tokens: resolve-tokens(tokens.md-comp-list-values());
32
- $tokens: theme.create-theme-vars($tokens, list);
29
+ $tokens: tokens.md-comp-list-values();
33
30
 
34
31
  :host {
35
32
  @each $token, $value in $tokens {
@@ -42,6 +39,7 @@
42
39
 
43
40
  .md3-list {
44
41
  background-color: var(--_container-color);
42
+ border-radius: inherit;
45
43
  display: block;
46
44
  list-style-type: none;
47
45
  margin: 0;
@@ -53,44 +51,3 @@
53
51
  position: relative;
54
52
  }
55
53
  }
56
-
57
- /// Resolves the tokens that are specific to list.
58
- ///
59
- /// The tokenset for list include list plus all of list item. We do not want to
60
- /// duplicate tokens and custom properties across md-list and md-list-item.
61
- /// So here we resolve list-items tokens, and resolve the difference between
62
- /// the full set of tokens and the ones specific to list-item.
63
- @function resolve-tokens($tokens) {
64
- // Accept container-color token in the theme() mixin.
65
- $container-color: map.get($tokens, container-color);
66
-
67
- @if not $container-color {
68
- // If not defined, rename the list-item-container-color token. This is
69
- // useful for our styles() mixin where we simply feed this function the comp
70
- // tokens from the compiler and no `container-color` token.
71
- $container-color: map.get($tokens, list-item-container-color);
72
- $tokens: map.set($tokens, container-color, $container-color);
73
- }
74
-
75
- $list-tokens: remove-unused-tokens($tokens);
76
-
77
- @return $list-tokens;
78
- }
79
-
80
- // removes unused tokens
81
- @function remove-unused-tokens($tokens) {
82
- $unused-tokens: ();
83
- @each $token in map-keys($tokens) {
84
- $index: string.index($token, 'list-item');
85
-
86
- @if $index {
87
- $unused-tokens: list.append($unused-tokens, $token);
88
- }
89
- }
90
-
91
- @each $token in $unused-tokens {
92
- $tokens: map.remove($tokens, $token);
93
- }
94
-
95
- @return $tokens;
96
- }
@@ -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-container-color, var(--md-sys-color-surface, #fef7ff));color:unset;min-width:300px}.md3-list{background-color:var(--_container-color);display:block;list-style-type:none;margin:0;min-width:inherit;outline:none;padding:8px 0;position:relative}/*# sourceMappingURL=list-styles.css.map */
7
+ export const styles = css `:host{--_container-color: var(--md-list-container-color, var(--md-sys-color-surface, #fef7ff));color:unset;min-width:300px}.md3-list{background-color:var(--_container-color);border-radius:inherit;display:block;list-style-type:none;margin:0;min-width:inherit;outline:none;padding:8px 0;position:relative}/*# sourceMappingURL=list-styles.css.map */
8
8
  `;
9
9
  //# sourceMappingURL=list-styles.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"list-styles.css.js","sourceRoot":"","sources":["list-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-container-color, var(--md-sys-color-surface, #fef7ff));color:unset;min-width:300px}.md3-list{background-color:var(--_container-color);display:block;list-style-type:none;margin:0;min-width:inherit;outline:none;padding:8px 0;position:relative}/*# sourceMappingURL=list-styles.css.map */\n`;\n "]}
1
+ {"version":3,"file":"list-styles.css.js","sourceRoot":"","sources":["list-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-container-color, var(--md-sys-color-surface, #fef7ff));color:unset;min-width:300px}.md3-list{background-color:var(--_container-color);border-radius:inherit;display:block;list-style-type:none;margin:0;min-width:inherit;outline:none;padding:8px 0;position:relative}/*# sourceMappingURL=list-styles.css.map */\n`;\n "]}
@@ -9,9 +9,7 @@ import { ARIARole } from '../../types/aria.js';
9
9
  import { ListItem } from './listitem/list-item.js';
10
10
  export declare class List extends LitElement {
11
11
  static shadowRootOptions: ShadowRootInit;
12
- ariaLabel: string;
13
- ariaActivedescendant: string;
14
- role: ARIARole;
12
+ type: ARIARole | '';
15
13
  /**
16
14
  * The tabindex of the underlying list.
17
15
  */
package/list/lib/list.js CHANGED
@@ -3,14 +3,12 @@
3
3
  * Copyright 2021 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { __decorate, __metadata } from "tslib";
7
- // Required for @ariaProperty
8
- // tslint:disable:no-new-decorators
9
- import { html, LitElement } from 'lit';
6
+ var _a;
7
+ import { __decorate } from "tslib";
8
+ import { html, LitElement, nothing } from 'lit';
10
9
  import { property, query, queryAssignedElements } from 'lit/decorators.js';
11
10
  import { classMap } from 'lit/directives/class-map.js';
12
- import { ifDefined } from 'lit/directives/if-defined.js';
13
- import { ariaProperty } from '../../decorators/aria-property.js';
11
+ import { requestUpdateOnAriaChange } from '../../aria/delegate.js';
14
12
  import { keydownHandler } from '../../focus/strong-focus.js';
15
13
  const NAVIGABLE_KEYS = {
16
14
  ArrowDown: 'ArrowDown',
@@ -26,8 +24,7 @@ function isNavigableKey(key) {
26
24
  export class List extends LitElement {
27
25
  constructor() {
28
26
  super(...arguments);
29
- // @ts-ignore(b/264292293): Use `override` with TS 4.9+
30
- this.role = 'list';
27
+ this.type = 'list';
31
28
  /**
32
29
  * The tabindex of the underlying list.
33
30
  */
@@ -40,11 +37,13 @@ export class List extends LitElement {
40
37
  * Renders the main list element.
41
38
  */
42
39
  renderList() {
40
+ // Needed for closure conformance
41
+ const { ariaLabel } = this;
43
42
  return html `
44
43
  <ul class="md3-list ${classMap(this.getListClasses())}"
45
- aria-label="${ifDefined(this.ariaLabel)}"
44
+ aria-label=${ariaLabel || nothing}
46
45
  tabindex=${this.listTabIndex}
47
- role=${this.role}
46
+ role=${this.type || nothing}
48
47
  @keydown=${this.handleKeydown}
49
48
  >
50
49
  ${this.renderContent()}
@@ -250,36 +249,21 @@ export class List extends LitElement {
250
249
  return null;
251
250
  }
252
251
  }
252
+ _a = List;
253
+ (() => {
254
+ requestUpdateOnAriaChange(_a);
255
+ })();
253
256
  List.shadowRootOptions = { mode: 'open', delegatesFocus: true };
254
257
  __decorate([
255
- ariaProperty,
256
- property({ type: String, attribute: 'data-aria-label', noAccessor: true }),
257
- __metadata("design:type", String)
258
- ], List.prototype, "ariaLabel", void 0);
258
+ property()
259
+ ], List.prototype, "type", void 0);
259
260
  __decorate([
260
- ariaProperty,
261
- property({ type: String, attribute: 'data-aria-activedescendant', noAccessor: true }),
262
- __metadata("design:type", String)
263
- ], List.prototype, "ariaActivedescendant", void 0);
264
- __decorate([
265
- ariaProperty
266
- // tslint:disable-next-line
267
- ,
268
- property({ type: String, attribute: 'data-role', noAccessor: true })
269
- // @ts-ignore(b/264292293): Use `override` with TS 4.9+
270
- ,
271
- __metadata("design:type", String)
272
- ], List.prototype, "role", void 0);
273
- __decorate([
274
- property({ type: Number }),
275
- __metadata("design:type", Number)
261
+ property({ type: Number })
276
262
  ], List.prototype, "listTabIndex", void 0);
277
263
  __decorate([
278
- query('.md3-list'),
279
- __metadata("design:type", HTMLElement)
264
+ query('.md3-list')
280
265
  ], List.prototype, "listRoot", void 0);
281
266
  __decorate([
282
- queryAssignedElements({ flatten: true, selector: '[md-list-item]' }),
283
- __metadata("design:type", Array)
267
+ queryAssignedElements({ flatten: true, selector: '[md-list-item]' })
284
268
  ], List.prototype, "items", void 0);
285
269
  //# sourceMappingURL=list.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"list.js","sourceRoot":"","sources":["list.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,6BAA6B;AAC7B,mCAAmC;AAEnC,OAAO,EAAC,IAAI,EAAE,UAAU,EAAiB,MAAM,KAAK,CAAC;AACrD,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAC,MAAM,mBAAmB,CAAC;AACzE,OAAO,EAAY,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAC,SAAS,EAAC,MAAM,8BAA8B,CAAC;AAEvD,OAAO,EAAC,YAAY,EAAC,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAC,cAAc,EAAC,MAAM,6BAA6B,CAAC;AAK3D,MAAM,cAAc,GAAG;IACrB,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MA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IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,IAAI,EAAC,CAAC;AAE1D;IAAC,YAAY;IACZ,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,iBAAiB,EAAE,UAAU,EAAE,IAAI,EAAC,CAAC;;uCAC7C;AAE5B;IAAC,YAAY;IACZ,QAAQ,CACL,EAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,4BAA4B,EAAE,UAAU,EAAE,IAAI,EAAC,CAAC;;kDAChD;AAE9B;IAAC,YAAY;IACb,2BAA2B;;IAC1B,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,WAAW,EAAE,UAAU,EAAE,IAAI,EAAC,CAAC;IACnE,uDAAuD;;;kCAC/B;AAKxB;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;;0CAA0B;AAEnD;IAAC,KAAK,CAAC,WAAW,CAAC;8BAAY,WAAW;sCAAC;AAU3C;IAAC,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\n// Required for @ariaProperty\n// tslint:disable:no-new-decorators\n\nimport {html, LitElement, TemplateResult} from 'lit';\nimport {property, query, queryAssignedElements} from 'lit/decorators.js';\nimport {ClassInfo, classMap} from 'lit/directives/class-map.js';\nimport {ifDefined} from 'lit/directives/if-defined.js';\n\nimport {ariaProperty} from '../../decorators/aria-property.js';\nimport {keydownHandler} from '../../focus/strong-focus.js';\nimport {ARIARole} from '../../types/aria.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\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 override shadowRootOptions:\n ShadowRootInit = {mode: 'open', delegatesFocus: true};\n\n @ariaProperty\n @property({type: String, attribute: 'data-aria-label', noAccessor: true})\n override ariaLabel!: string;\n\n @ariaProperty\n @property(\n {type: String, attribute: 'data-aria-activedescendant', noAccessor: true})\n ariaActivedescendant!: string;\n\n @ariaProperty\n // tslint:disable-next-line\n @property({type: String, attribute: 'data-role', noAccessor: true})\n // @ts-ignore(b/264292293): Use `override` with TS 4.9+\n role: ARIARole = 'list';\n\n /**\n * The tabindex of the underlying list.\n */\n @property({type: Number}) listTabIndex: number = 0;\n\n @query('.md3-list') listRoot!: HTMLElement;\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 override render(): TemplateResult {\n return this.renderList();\n }\n\n /**\n * Renders the main list element.\n */\n protected renderList() {\n return html`\n <ul class=\"md3-list ${classMap(this.getListClasses())}\"\n aria-label=\"${ifDefined(this.ariaLabel)}\"\n tabindex=${this.listTabIndex}\n role=${this.role}\n @keydown=${this.handleKeydown}\n >\n ${this.renderContent()}\n </ul>\n `;\n }\n\n /**\n * The classes to be applied to the underlying list.\n */\n protected getListClasses(): ClassInfo {\n return {};\n }\n\n /**\n * The content to be slotted into the list.\n */\n protected renderContent() {\n return html`<span><slot @click=${(e: Event) => {\n e.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 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 keydownHandler(event);\n event.preventDefault();\n\n switch (key) {\n // Activate the next item\n case NAVIGABLE_KEYS.ArrowDown:\n if (activeItemRecord) {\n const next = List.getNextItem(items, activeItemRecord.index);\n\n if (next) next.active = true;\n } else {\n List.activateFirstItem(items);\n }\n break;\n\n // Activate the previous item\n case NAVIGABLE_KEYS.ArrowUp:\n if (activeItemRecord) {\n const prev = List.getPrevItem(items, activeItemRecord.index);\n if (prev) prev.active = true;\n } else {\n items[items.length - 1].active = true;\n }\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 /**\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 */\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 }\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 */\n static activateLastItem<T extends ListItem>(items: T[]) {\n const lastItem = List.getLastActivatableItem(items);\n if (lastItem) {\n lastItem.active = true;\n }\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 * @returns A record of the deleselcted activated item including the item and\n * the index of the item or `null` if none are deactivated.\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 the first activated item of a given array of items.\n *\n * @param items {Array<ListItem>} The items to search.\n * @returns A record of the first activated item including the item and the\n * index of the item or `null` if none are activated.\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 };\n }\n }\n return null;\n }\n\n /**\n * Retrieves the 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 * @returns The first activatable item or `null` if none are activatable.\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 the last non-disabled item of a given array of items.\n *\n * @param items {Array<ListItem>} The items to search.\n * @returns The last activatable item or `null` if none are activatable.\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 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 * @returns The next activatable item or `null` if none are activatable.\n */\n protected 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 return null;\n }\n\n /**\n * Retrieves the 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 * @returns The previous activatable item or `null` if none are activatable.\n */\n protected 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 return null;\n }\n}\n"]}
1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,IAAI,CAAC;aACb;SACF;QACD,OAAO,IAAI,CAAC;IACd,CAAC;IAED;;;;;;OAMG;IACO,MAAM,CAAC,WAAW,CAAqB,KAAU,EAAE,KAAa;QACxE,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;QACD,OAAO,IAAI,CAAC;IACd,CAAC;;;AA1QD;IACE,yBAAyB,CAAC,EAAI,CAAC,CAAC;AAClC,CAAC,GAAA,CAAA;AAEe,sBAAiB,GACZ,EAAC,IAAI,EAAE,MAAM,EAAE,cAAc,EAAE,IAAI,EAAC,CAAC;AAE9C;IAAX,QAAQ,EAAE;kCAA4B;AAKb;IAAzB,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;0CAAkB;AAEvB;IAAnB,KAAK,CAAC,WAAW,CAAC;sCAAwB;AAW3C;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, TemplateResult} from 'lit';\nimport {property, query, queryAssignedElements} from 'lit/decorators.js';\nimport {ClassInfo, classMap} from 'lit/directives/class-map.js';\n\nimport {requestUpdateOnAriaChange} from '../../aria/delegate.js';\nimport {keydownHandler} from '../../focus/strong-focus.js';\nimport {ARIAMixinStrict, ARIARole} from '../../types/aria.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\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(this);\n }\n\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}) listTabIndex = 0;\n\n @query('.md3-list') listRoot!: HTMLElement;\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 override render(): TemplateResult {\n return this.renderList();\n }\n\n /**\n * Renders the main list element.\n */\n protected renderList() {\n // Needed for closure conformance\n const {ariaLabel} = this as ARIAMixinStrict;\n return html`\n <ul class=\"md3-list ${classMap(this.getListClasses())}\"\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 classes to be applied to the underlying list.\n */\n protected getListClasses(): ClassInfo {\n return {};\n }\n\n /**\n * The content to be slotted into the list.\n */\n protected renderContent() {\n return html`<span><slot @click=${(e: Event) => {\n e.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 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 keydownHandler(event);\n event.preventDefault();\n\n switch (key) {\n // Activate the next item\n case NAVIGABLE_KEYS.ArrowDown:\n if (activeItemRecord) {\n const next = List.getNextItem(items, activeItemRecord.index);\n\n if (next) next.active = true;\n } else {\n List.activateFirstItem(items);\n }\n break;\n\n // Activate the previous item\n case NAVIGABLE_KEYS.ArrowUp:\n if (activeItemRecord) {\n const prev = List.getPrevItem(items, activeItemRecord.index);\n if (prev) prev.active = true;\n } else {\n items[items.length - 1].active = true;\n }\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 /**\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 */\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 }\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 */\n static activateLastItem<T extends ListItem>(items: T[]) {\n const lastItem = List.getLastActivatableItem(items);\n if (lastItem) {\n lastItem.active = true;\n }\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 * @returns A record of the deleselcted activated item including the item and\n * the index of the item or `null` if none are deactivated.\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 the first activated item of a given array of items.\n *\n * @param items {Array<ListItem>} The items to search.\n * @returns A record of the first activated item including the item and the\n * index of the item or `null` if none are activated.\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 };\n }\n }\n return null;\n }\n\n /**\n * Retrieves the 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 * @returns The first activatable item or `null` if none are activatable.\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 the last non-disabled item of a given array of items.\n *\n * @param items {Array<ListItem>} The items to search.\n * @returns The last activatable item or `null` if none are activatable.\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 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 * @returns The next activatable item or `null` if none are activatable.\n */\n protected 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 return null;\n }\n\n /**\n * Retrieves the 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 * @returns The previous activatable item or `null` if none are activatable.\n */\n protected 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 return null;\n }\n}\n"]}
@@ -17,18 +17,15 @@
17
17
  // go/keep-sorted end
18
18
 
19
19
  @mixin theme($tokens) {
20
- $tokens: theme.validate-theme(
21
- resolve-tokens(tokens.md-comp-list-values()),
22
- resolve-tokens($tokens)
23
- );
24
- $tokens: theme.create-theme-vars($tokens, 'list');
20
+ $tokens: theme.validate-theme(tokens.md-comp-list-item-values(), $tokens);
25
21
 
26
- @include theme.emit-theme-vars($tokens);
22
+ @each $token, $value in $tokens {
23
+ --md-list-item-#{$token}: #{$value};
24
+ }
27
25
  }
28
26
 
29
27
  @mixin styles() {
30
- $tokens: resolve-tokens(tokens.md-comp-list-values());
31
- $tokens: theme.create-theme-vars($tokens, 'list');
28
+ $tokens: tokens.md-comp-list-item-values();
32
29
 
33
30
  :host {
34
31
  @each $token, $value in $tokens {
@@ -88,6 +85,11 @@
88
85
  .content-wrapper {
89
86
  display: flex;
90
87
  width: 100%;
88
+ border-radius: inherit;
89
+ }
90
+
91
+ md-ripple {
92
+ border-radius: inherit;
91
93
  }
92
94
 
93
95
  .with-one-line {
@@ -417,64 +419,3 @@
417
419
  height: var(--_list-item-large-leading-video-height);
418
420
  }
419
421
  }
420
-
421
- /// Resolves the tokens that are specific to list-item.
422
- ///
423
- /// The tokenset for list include list plus all of list item. We do not want to
424
- /// duplicate tokens and custom properties across md-list and md-list-item.
425
- /// So here we resolve list-items tokens by selecting only tokens that have
426
- /// 'list-item' in its name.
427
- @function resolve-tokens($tokens) {
428
- // Values pulled from b/198759625 spreadsheet
429
- $list-item-tokens: (
430
- 'list-item-leading-space': 16px,
431
- 'list-item-trailing-space': 16px,
432
- 'list-item-leading-element-leading-space': 16px,
433
- 'list-item-leading-video-leading-space': 0px,
434
- // Commented out until the comments in the spreadsheet linked above are
435
- // resolved regarding vertical alignment.
436
- // 'list-item-leading-item-top-space': 8px,
437
- // 'list-item-leading-video-top-space': 0px,
438
- // 'list-item-leading-item-bottom-space': 8px,
439
- // 'list-item-leading-video-bottom-space': 0px,
440
- 'list-item-trailing-element-headline-trailing-element-space': 16px,
441
- );
442
-
443
- @each $token, $value in $tokens {
444
- $index: string.index($token, 'list-item');
445
-
446
- @if $index {
447
- $list-item-tokens: map.set($list-item-tokens, $token, $value);
448
- }
449
- }
450
-
451
- $list-item-tokens: _remove-unused-tokens($list-item-tokens);
452
-
453
- @return $list-item-tokens;
454
- }
455
-
456
- // removes unused tokens
457
- @function _remove-unused-tokens($tokens) {
458
- $unused-tokens: (
459
- 'list-item-container-elevation',
460
- 'list-item-disabled-state-layer-color',
461
- 'list-item-disabled-state-layer-opacity',
462
- 'list-item-dragged-container-elevation',
463
- 'list-item-dragged-label-text-color',
464
- 'list-item-dragged-leading-icon-icon-color',
465
- 'list-item-dragged-state-layer-color',
466
- 'list-item-dragged-state-layer-opacity',
467
- 'list-item-dragged-trailing-icon-icon-color',
468
- 'list-item-overline-color',
469
- 'list-item-overline-type',
470
- 'list-item-selected-trailing-icon',
471
- 'list-item-selected-trailing-icon-color',
472
- 'list-item-unselected-trailing-icon-color'
473
- );
474
-
475
- @each $token in $unused-tokens {
476
- $tokens: map.remove($tokens, $token);
477
- }
478
-
479
- @return $tokens;
480
- }
@@ -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 `@media(forced-colors: active){:host{--md-list-list-item-leading-space:16px;--md-list-list-item-trailing-space:16px;--md-list-list-item-leading-element-leading-space:16px;--md-list-list-item-leading-video-leading-space:0px;--md-list-list-item-trailing-element-headline-trailing-element-space:16px;--md-list-list-item-disabled-label-text-color:GrayText;--md-list-list-item-disabled-label-text-opacity:1;--md-list-list-item-disabled-leading-icon-color:GrayText;--md-list-list-item-disabled-leading-icon-opacity:1;--md-list-list-item-disabled-trailing-icon-color:GrayText;--md-list-list-item-disabled-trailing-icon-opacity:1}}/*# sourceMappingURL=forced-colors-styles.css.map */
7
+ export const styles = css `@media(forced-colors: active){:host{--md-list-item-list-item-disabled-label-text-color: GrayText;--md-list-item-list-item-disabled-label-text-opacity: 1;--md-list-item-list-item-disabled-leading-icon-color: GrayText;--md-list-item-list-item-disabled-leading-icon-opacity: 1;--md-list-item-list-item-disabled-trailing-icon-color: GrayText;--md-list-item-list-item-disabled-trailing-icon-opacity: 1}}/*# sourceMappingURL=forced-colors-styles.css.map */
8
8
  `;
9
9
  //# sourceMappingURL=forced-colors-styles.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"forced-colors-styles.css.js","sourceRoot":"","sources":["forced-colors-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`@media(forced-colors: active){:host{--md-list-list-item-leading-space:16px;--md-list-list-item-trailing-space:16px;--md-list-list-item-leading-element-leading-space:16px;--md-list-list-item-leading-video-leading-space:0px;--md-list-list-item-trailing-element-headline-trailing-element-space:16px;--md-list-list-item-disabled-label-text-color:GrayText;--md-list-list-item-disabled-label-text-opacity:1;--md-list-list-item-disabled-leading-icon-color:GrayText;--md-list-list-item-disabled-leading-icon-opacity:1;--md-list-list-item-disabled-trailing-icon-color:GrayText;--md-list-list-item-disabled-trailing-icon-opacity:1}}/*# sourceMappingURL=forced-colors-styles.css.map */\n`;\n "]}
1
+ {"version":3,"file":"forced-colors-styles.css.js","sourceRoot":"","sources":["forced-colors-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`@media(forced-colors: active){:host{--md-list-item-list-item-disabled-label-text-color: GrayText;--md-list-item-list-item-disabled-label-text-opacity: 1;--md-list-item-list-item-disabled-leading-icon-color: GrayText;--md-list-item-list-item-disabled-leading-icon-opacity: 1;--md-list-item-list-item-disabled-trailing-icon-color: GrayText;--md-list-item-list-item-disabled-trailing-icon-opacity: 1}}/*# sourceMappingURL=forced-colors-styles.css.map */\n`;\n "]}