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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (504) hide show
  1. package/README.md +8 -8
  2. package/aria/aria.d.ts +43 -0
  3. package/aria/aria.js +80 -0
  4. package/aria/aria.js.map +1 -0
  5. package/aria/delegate.d.ts +37 -0
  6. package/aria/delegate.js +53 -0
  7. package/aria/delegate.js.map +1 -0
  8. package/badge/badge.d.ts +0 -1
  9. package/badge/badge.js +0 -1
  10. package/badge/badge.js.map +1 -1
  11. package/badge/lib/badge.d.ts +5 -7
  12. package/badge/lib/badge.js +9 -12
  13. package/badge/lib/badge.js.map +1 -1
  14. package/button/lib/_elevated-button.scss +35 -6
  15. package/button/lib/_elevation.scss +13 -3
  16. package/button/lib/_filled-button.scss +35 -3
  17. package/button/lib/_outlined-button.scss +35 -6
  18. package/button/lib/_shared.scss +4 -2
  19. package/button/lib/_text-button.scss +35 -6
  20. package/button/lib/_tonal-button.scss +34 -7
  21. package/button/lib/button.d.ts +24 -38
  22. package/button/lib/button.js +40 -89
  23. package/button/lib/button.js.map +1 -1
  24. package/button/lib/elevated-button.d.ts +6 -4
  25. package/button/lib/elevated-button.js.map +1 -1
  26. package/button/lib/elevated-styles.css.js +1 -1
  27. package/button/lib/elevated-styles.css.js.map +1 -1
  28. package/button/lib/filled-button.d.ts +6 -4
  29. package/button/lib/filled-button.js.map +1 -1
  30. package/button/lib/filled-styles.css.js +1 -1
  31. package/button/lib/filled-styles.css.js.map +1 -1
  32. package/button/lib/outlined-button.d.ts +6 -4
  33. package/button/lib/outlined-button.js.map +1 -1
  34. package/button/lib/outlined-styles.css.js +1 -1
  35. package/button/lib/outlined-styles.css.js.map +1 -1
  36. package/button/lib/shared-elevation-styles.css.js +1 -1
  37. package/button/lib/shared-elevation-styles.css.js.map +1 -1
  38. package/button/lib/shared-styles.css.js +1 -1
  39. package/button/lib/shared-styles.css.js.map +1 -1
  40. package/button/lib/text-button.d.ts +5 -2
  41. package/button/lib/text-button.js.map +1 -1
  42. package/button/lib/text-styles.css.js +1 -1
  43. package/button/lib/text-styles.css.js.map +1 -1
  44. package/button/lib/tonal-button.d.ts +6 -4
  45. package/button/lib/tonal-button.js.map +1 -1
  46. package/button/lib/tonal-styles.css.js +1 -1
  47. package/button/lib/tonal-styles.css.js.map +1 -1
  48. package/checkbox/lib/_checkbox.scss +48 -47
  49. package/checkbox/lib/checkbox-styles.css.js +1 -1
  50. package/checkbox/lib/checkbox-styles.css.js.map +1 -1
  51. package/checkbox/lib/checkbox.d.ts +2 -7
  52. package/checkbox/lib/checkbox.js +35 -62
  53. package/checkbox/lib/checkbox.js.map +1 -1
  54. package/checkbox/lib/forced-colors-styles.css.js +1 -1
  55. package/checkbox/lib/forced-colors-styles.css.js.map +1 -1
  56. package/chips/_filter-chip.scss +6 -0
  57. package/chips/assist-chip.js +2 -1
  58. package/chips/assist-chip.js.map +1 -1
  59. package/chips/filter-chip.d.ts +20 -0
  60. package/chips/filter-chip.js +25 -0
  61. package/chips/filter-chip.js.map +1 -0
  62. package/chips/lib/_assist-chip.scss +37 -3
  63. package/chips/lib/_elevated.scss +60 -0
  64. package/chips/lib/_filter-chip.scss +175 -0
  65. package/chips/lib/_shared.scss +48 -84
  66. package/chips/lib/_suggestion-chip.scss +36 -5
  67. package/chips/lib/assist-chip.d.ts +12 -0
  68. package/chips/lib/assist-chip.js +64 -0
  69. package/chips/lib/assist-chip.js.map +1 -1
  70. package/chips/lib/assist-styles.css.js +1 -1
  71. package/chips/lib/assist-styles.css.js.map +1 -1
  72. package/chips/lib/chip.d.ts +24 -16
  73. package/chips/lib/chip.js +53 -74
  74. package/chips/lib/chip.js.map +1 -1
  75. package/chips/lib/elevated-styles.css.js +9 -0
  76. package/chips/lib/elevated-styles.css.js.map +1 -0
  77. package/{fab/lib/fab-extended-styles.scss → chips/lib/elevated-styles.scss} +3 -3
  78. package/chips/lib/filter-chip.d.ts +26 -0
  79. package/chips/lib/filter-chip.js +80 -0
  80. package/chips/lib/filter-chip.js.map +1 -0
  81. package/chips/lib/filter-styles.css.js +9 -0
  82. package/chips/lib/filter-styles.css.js.map +1 -0
  83. package/chips/lib/filter-styles.scss +10 -0
  84. package/chips/lib/shared-styles.css.js +1 -1
  85. package/chips/lib/shared-styles.css.js.map +1 -1
  86. package/chips/lib/suggestion-chip.d.ts +2 -2
  87. package/chips/lib/suggestion-chip.js +4 -2
  88. package/chips/lib/suggestion-chip.js.map +1 -1
  89. package/chips/lib/suggestion-styles.css.js +1 -1
  90. package/chips/lib/suggestion-styles.css.js.map +1 -1
  91. package/chips/suggestion-chip.js +2 -1
  92. package/chips/suggestion-chip.js.map +1 -1
  93. package/circularprogress/harness.d.ts +1 -0
  94. package/circularprogress/harness.js +4 -0
  95. package/circularprogress/harness.js.map +1 -1
  96. package/circularprogress/lib/_circular-progress.scss +13 -7
  97. package/circularprogress/lib/circular-progress-styles.css.js +1 -1
  98. package/circularprogress/lib/circular-progress-styles.css.js.map +1 -1
  99. package/circularprogress/lib/circular-progress.d.ts +5 -7
  100. package/circularprogress/lib/circular-progress.js +17 -21
  101. package/circularprogress/lib/circular-progress.js.map +1 -1
  102. package/dialog/lib/_dialog.scss +8 -9
  103. package/dialog/lib/_tokens.scss +0 -1
  104. package/dialog/lib/dialog-styles.css.js +1 -1
  105. package/dialog/lib/dialog-styles.css.js.map +1 -1
  106. package/dialog/lib/dialog.d.ts +10 -10
  107. package/dialog/lib/dialog.js +33 -56
  108. package/dialog/lib/dialog.js.map +1 -1
  109. package/divider/lib/divider.js +4 -7
  110. package/divider/lib/divider.js.map +1 -1
  111. package/elevation/lib/_elevation.scss +5 -7
  112. package/elevation/lib/elevation-styles.css.js +1 -1
  113. package/elevation/lib/elevation-styles.css.js.map +1 -1
  114. package/elevation/lib/elevation.d.ts +1 -1
  115. package/elevation/lib/elevation.js.map +1 -1
  116. package/fab/_fab.scss +1 -0
  117. package/fab/branded-fab.d.ts +56 -0
  118. package/fab/branded-fab.js +56 -0
  119. package/fab/branded-fab.js.map +1 -0
  120. package/fab/fab.d.ts +25 -5
  121. package/fab/fab.js +27 -10
  122. package/fab/fab.js.map +1 -1
  123. package/fab/harness.d.ts +1 -2
  124. package/fab/harness.js +1 -1
  125. package/fab/harness.js.map +1 -1
  126. package/fab/lib/_fab-branded.scss +81 -0
  127. package/fab/lib/_fab.scss +221 -19
  128. package/fab/lib/_shared.scss +161 -131
  129. package/fab/lib/fab-branded-styles.css.d.ts +1 -0
  130. package/fab/lib/fab-branded-styles.css.js +9 -0
  131. package/fab/lib/fab-branded-styles.css.js.map +1 -0
  132. package/fab/lib/fab-branded-styles.scss +10 -0
  133. package/fab/lib/fab-styles.css.js +1 -1
  134. package/fab/lib/fab-styles.css.js.map +1 -1
  135. package/fab/lib/fab.d.ts +18 -10
  136. package/fab/lib/fab.js +19 -12
  137. package/fab/lib/fab.js.map +1 -1
  138. package/fab/lib/forced-colors-styles.css.d.ts +1 -0
  139. package/fab/lib/forced-colors-styles.css.js +9 -0
  140. package/fab/lib/forced-colors-styles.css.js.map +1 -0
  141. package/fab/lib/forced-colors-styles.scss +26 -0
  142. package/fab/lib/shared-styles.css.d.ts +1 -0
  143. package/fab/lib/shared-styles.css.js +9 -0
  144. package/fab/lib/shared-styles.css.js.map +1 -0
  145. package/fab/lib/{fab-shared-styles.scss → shared-styles.scss} +1 -1
  146. package/fab/lib/shared.d.ts +49 -0
  147. package/fab/lib/shared.js +113 -0
  148. package/fab/lib/shared.js.map +1 -0
  149. package/field/lib/_filled-field.scss +47 -12
  150. package/field/lib/_outlined-field.scss +39 -12
  151. package/field/lib/field.js +14 -27
  152. package/field/lib/field.js.map +1 -1
  153. package/field/lib/filled-styles.css.js +1 -1
  154. package/field/lib/filled-styles.css.js.map +1 -1
  155. package/field/lib/outlined-styles.css.js +1 -1
  156. package/field/lib/outlined-styles.css.js.map +1 -1
  157. package/focus/focus-ring.d.ts +2 -1
  158. package/focus/focus-ring.js +2 -1
  159. package/focus/focus-ring.js.map +1 -1
  160. package/focus/lib/_focus-ring.scss +49 -34
  161. package/focus/lib/focus-ring-styles.css.js +1 -1
  162. package/focus/lib/focus-ring-styles.css.js.map +1 -1
  163. package/focus/lib/focus-ring.d.ts +59 -12
  164. package/focus/lib/focus-ring.js +118 -14
  165. package/focus/lib/focus-ring.js.map +1 -1
  166. package/icon/icon.d.ts +0 -1
  167. package/icon/icon.js +0 -1
  168. package/icon/icon.js.map +1 -1
  169. package/icon/lib/_icon.scss +2 -0
  170. package/icon/lib/icon-styles.css.js +1 -1
  171. package/icon/lib/icon-styles.css.js.map +1 -1
  172. package/icon/lib/icon.d.ts +5 -4
  173. package/icon/lib/icon.js +3 -2
  174. package/icon/lib/icon.js.map +1 -1
  175. package/iconbutton/filled-icon-button.d.ts +6 -2
  176. package/iconbutton/filled-icon-button.js.map +1 -1
  177. package/iconbutton/filled-tonal-icon-button.d.ts +6 -2
  178. package/iconbutton/filled-tonal-icon-button.js.map +1 -1
  179. package/iconbutton/harness.d.ts +1 -1
  180. package/iconbutton/harness.js +4 -1
  181. package/iconbutton/harness.js.map +1 -1
  182. package/iconbutton/lib/_filled-icon-button.scss +38 -13
  183. package/iconbutton/lib/_filled-tonal-icon-button.scss +38 -11
  184. package/iconbutton/lib/_outlined-icon-button.scss +38 -13
  185. package/iconbutton/lib/_shared.scss +4 -6
  186. package/iconbutton/lib/_standard-icon-button.scss +14 -14
  187. package/iconbutton/lib/filled-styles.css.js +1 -1
  188. package/iconbutton/lib/filled-styles.css.js.map +1 -1
  189. package/iconbutton/lib/filled-tonal-styles.css.js +1 -1
  190. package/iconbutton/lib/filled-tonal-styles.css.js.map +1 -1
  191. package/iconbutton/lib/icon-button.d.ts +17 -25
  192. package/iconbutton/lib/icon-button.js +37 -73
  193. package/iconbutton/lib/icon-button.js.map +1 -1
  194. package/iconbutton/lib/outlined-styles.css.js +1 -1
  195. package/iconbutton/lib/outlined-styles.css.js.map +1 -1
  196. package/iconbutton/lib/shared-styles.css.js +1 -1
  197. package/iconbutton/lib/shared-styles.css.js.map +1 -1
  198. package/iconbutton/lib/standard-styles.css.js +1 -1
  199. package/iconbutton/lib/standard-styles.css.js.map +1 -1
  200. package/iconbutton/outlined-icon-button.d.ts +5 -2
  201. package/iconbutton/outlined-icon-button.js.map +1 -1
  202. package/iconbutton/standard-icon-button.d.ts +5 -2
  203. package/iconbutton/standard-icon-button.js.map +1 -1
  204. package/linearprogress/_linear-progress.scss +6 -0
  205. package/linearprogress/harness.d.ts +13 -0
  206. package/linearprogress/harness.js +18 -0
  207. package/linearprogress/harness.js.map +1 -0
  208. package/linearprogress/lib/_linear-progress.scss +386 -0
  209. package/linearprogress/lib/linear-progress-styles.css.d.ts +1 -0
  210. package/linearprogress/lib/linear-progress-styles.css.js +9 -0
  211. package/linearprogress/lib/linear-progress-styles.css.js.map +1 -0
  212. package/linearprogress/lib/linear-progress-styles.scss +8 -0
  213. package/linearprogress/lib/linear-progress.d.ts +35 -0
  214. package/linearprogress/lib/linear-progress.js +127 -0
  215. package/linearprogress/lib/linear-progress.js.map +1 -0
  216. package/linearprogress/linear-progress.d.ts +23 -0
  217. package/linearprogress/linear-progress.js +26 -0
  218. package/linearprogress/linear-progress.js.map +1 -0
  219. package/list/lib/_list.scss +9 -50
  220. package/list/lib/list-styles.css.js +1 -1
  221. package/list/lib/list-styles.css.js.map +1 -1
  222. package/list/lib/list.d.ts +8 -15
  223. package/list/lib/list.js +20 -45
  224. package/list/lib/list.js.map +1 -1
  225. package/list/lib/listitem/_list-item.scss +17 -72
  226. package/list/lib/listitem/forced-colors-styles.css.js +1 -1
  227. package/list/lib/listitem/forced-colors-styles.css.js.map +1 -1
  228. package/list/lib/listitem/list-item-styles.css.js +1 -1
  229. package/list/lib/listitem/list-item-styles.css.js.map +1 -1
  230. package/list/lib/listitem/list-item.d.ts +29 -31
  231. package/list/lib/listitem/list-item.js +26 -80
  232. package/list/lib/listitem/list-item.js.map +1 -1
  233. package/list/lib/listitemlink/list-item-link.js +5 -9
  234. package/list/lib/listitemlink/list-item-link.js.map +1 -1
  235. package/menu/lib/_menu.scss +9 -29
  236. package/menu/lib/menu-styles.css.js +1 -1
  237. package/menu/lib/menu-styles.css.js.map +1 -1
  238. package/menu/lib/menu.d.ts +32 -41
  239. package/menu/lib/menu.js +51 -82
  240. package/menu/lib/menu.js.map +1 -1
  241. package/menu/lib/menuitem/_menu-item.scss +16 -33
  242. package/menu/lib/menuitem/menu-item-styles.css.js +1 -1
  243. package/menu/lib/menuitem/menu-item-styles.css.js.map +1 -1
  244. package/menu/lib/menuitem/menu-item.d.ts +1 -1
  245. package/menu/lib/menuitem/menu-item.js +4 -6
  246. package/menu/lib/menuitem/menu-item.js.map +1 -1
  247. package/menu/lib/menuitemlink/menu-item-link.d.ts +0 -2
  248. package/menu/lib/menuitemlink/menu-item-link.js +3 -6
  249. package/menu/lib/menuitemlink/menu-item-link.js.map +1 -1
  250. package/menu/lib/shared.d.ts +20 -2
  251. package/menu/lib/shared.js +18 -0
  252. package/menu/lib/shared.js.map +1 -1
  253. package/menu/lib/submenuitem/sub-menu-item.d.ts +16 -13
  254. package/menu/lib/submenuitem/sub-menu-item.js +27 -18
  255. package/menu/lib/submenuitem/sub-menu-item.js.map +1 -1
  256. package/menu/lib/typeaheadController.d.ts +9 -9
  257. package/menu/lib/typeaheadController.js.map +1 -1
  258. package/navigationbar/lib/_navigation-bar.scss +7 -1
  259. package/navigationbar/lib/navigation-bar-styles.css.js +1 -1
  260. package/navigationbar/lib/navigation-bar-styles.css.js.map +1 -1
  261. package/navigationbar/lib/navigation-bar.d.ts +6 -6
  262. package/navigationbar/lib/navigation-bar.js +17 -18
  263. package/navigationbar/lib/navigation-bar.js.map +1 -1
  264. package/navigationbar/navigation-bar.d.ts +0 -1
  265. package/navigationbar/navigation-bar.js +0 -1
  266. package/navigationbar/navigation-bar.js.map +1 -1
  267. package/navigationdrawer/lib/_navigation-drawer-modal.scss +0 -3
  268. package/navigationdrawer/lib/_navigation-drawer.scss +0 -3
  269. package/navigationdrawer/lib/_shared.scss +1 -4
  270. package/navigationdrawer/lib/navigation-drawer-modal-styles.css.js +1 -1
  271. package/navigationdrawer/lib/navigation-drawer-modal-styles.css.js.map +1 -1
  272. package/navigationdrawer/lib/navigation-drawer-modal.d.ts +7 -12
  273. package/navigationdrawer/lib/navigation-drawer-modal.js +19 -41
  274. package/navigationdrawer/lib/navigation-drawer-modal.js.map +1 -1
  275. package/navigationdrawer/lib/navigation-drawer-styles.css.js +1 -1
  276. package/navigationdrawer/lib/navigation-drawer-styles.css.js.map +1 -1
  277. package/navigationdrawer/lib/navigation-drawer.d.ts +6 -10
  278. package/navigationdrawer/lib/navigation-drawer.js +17 -38
  279. package/navigationdrawer/lib/navigation-drawer.js.map +1 -1
  280. package/navigationdrawer/lib/shared-styles.css.js +1 -1
  281. package/navigationdrawer/lib/shared-styles.css.js.map +1 -1
  282. package/navigationdrawer/navigation-drawer-modal.d.ts +0 -1
  283. package/navigationdrawer/navigation-drawer-modal.js +0 -1
  284. package/navigationdrawer/navigation-drawer-modal.js.map +1 -1
  285. package/navigationdrawer/navigation-drawer.d.ts +0 -1
  286. package/navigationdrawer/navigation-drawer.js +0 -1
  287. package/navigationdrawer/navigation-drawer.js.map +1 -1
  288. package/navigationtab/lib/_navigation-tab.scss +2 -2
  289. package/navigationtab/lib/navigation-tab-styles.css.js +1 -1
  290. package/navigationtab/lib/navigation-tab-styles.css.js.map +1 -1
  291. package/navigationtab/lib/navigation-tab.d.ts +16 -29
  292. package/navigationtab/lib/navigation-tab.js +49 -88
  293. package/navigationtab/lib/navigation-tab.js.map +1 -1
  294. package/navigationtab/lib/state.d.ts +1 -1
  295. package/navigationtab/lib/state.js.map +1 -1
  296. package/navigationtab/navigation-tab.d.ts +0 -1
  297. package/navigationtab/navigation-tab.js +0 -1
  298. package/navigationtab/navigation-tab.js.map +1 -1
  299. package/package.json +1 -1
  300. package/radio/lib/_radio.scss +1 -1
  301. package/radio/lib/radio-styles.css.js +1 -1
  302. package/radio/lib/radio-styles.css.js.map +1 -1
  303. package/radio/lib/radio.d.ts +2 -8
  304. package/radio/lib/radio.js +31 -58
  305. package/radio/lib/radio.js.map +1 -1
  306. package/ripple/lib/ripple.js +11 -13
  307. package/ripple/lib/ripple.js.map +1 -1
  308. package/segmentedbutton/lib/outlined-segmented-button.d.ts +16 -7
  309. package/segmentedbutton/lib/outlined-segmented-button.js +3 -3
  310. package/segmentedbutton/lib/outlined-segmented-button.js.map +1 -1
  311. package/segmentedbutton/lib/segmented-button.d.ts +28 -40
  312. package/segmentedbutton/lib/segmented-button.js +42 -96
  313. package/segmentedbutton/lib/segmented-button.js.map +1 -1
  314. package/segmentedbutton/outlined-segmented-button.d.ts +0 -1
  315. package/segmentedbutton/outlined-segmented-button.js +0 -1
  316. package/segmentedbutton/outlined-segmented-button.js.map +1 -1
  317. package/segmentedbuttonset/lib/_outlined-segmented-button-set.scss +32 -13
  318. package/segmentedbuttonset/lib/outlined-segmented-button-set.d.ts +6 -4
  319. package/segmentedbuttonset/lib/outlined-segmented-button-set.js +3 -2
  320. package/segmentedbuttonset/lib/outlined-segmented-button-set.js.map +1 -1
  321. package/segmentedbuttonset/lib/outlined-styles.css.js +1 -1
  322. package/segmentedbuttonset/lib/outlined-styles.css.js.map +1 -1
  323. package/segmentedbuttonset/lib/segmented-button-set.d.ts +3 -9
  324. package/segmentedbuttonset/lib/segmented-button-set.js +14 -20
  325. package/segmentedbuttonset/lib/segmented-button-set.js.map +1 -1
  326. package/segmentedbuttonset/outlined-segmented-button-set.d.ts +0 -1
  327. package/segmentedbuttonset/outlined-segmented-button-set.js +0 -1
  328. package/segmentedbuttonset/outlined-segmented-button-set.js.map +1 -1
  329. package/select/_filled-select.scss +6 -0
  330. package/select/_outlined-select.scss +6 -0
  331. package/select/filled-select.d.ts +41 -0
  332. package/select/filled-select.js +46 -0
  333. package/select/filled-select.js.map +1 -0
  334. package/select/harness.d.ts +24 -0
  335. package/select/harness.js +53 -0
  336. package/select/harness.js.map +1 -0
  337. package/select/lib/_filled-select.scss +222 -0
  338. package/select/lib/_outlined-select.scss +180 -0
  339. package/select/lib/_shared.scss +48 -0
  340. package/select/lib/filled-forced-colors-styles.css.d.ts +1 -0
  341. package/select/lib/filled-forced-colors-styles.css.js +9 -0
  342. package/select/lib/filled-forced-colors-styles.css.js.map +1 -0
  343. package/select/lib/filled-forced-colors-styles.scss +29 -0
  344. package/select/lib/filled-select-styles.css.d.ts +1 -0
  345. package/select/lib/filled-select-styles.css.js +9 -0
  346. package/select/lib/filled-select-styles.css.js.map +1 -0
  347. package/select/lib/filled-select-styles.scss +10 -0
  348. package/select/lib/filled-select.d.ts +10 -0
  349. package/select/lib/filled-select.js +16 -0
  350. package/select/lib/filled-select.js.map +1 -0
  351. package/select/lib/outlined-forced-colors-styles.css.d.ts +1 -0
  352. package/select/lib/outlined-forced-colors-styles.css.js +9 -0
  353. package/select/lib/outlined-forced-colors-styles.css.js.map +1 -0
  354. package/select/lib/outlined-forced-colors-styles.scss +29 -0
  355. package/select/lib/outlined-select-styles.css.d.ts +1 -0
  356. package/select/lib/outlined-select-styles.css.js +9 -0
  357. package/select/lib/outlined-select-styles.css.js.map +1 -0
  358. package/select/lib/outlined-select-styles.scss +10 -0
  359. package/select/lib/outlined-select.d.ts +10 -0
  360. package/select/lib/outlined-select.js +16 -0
  361. package/select/lib/outlined-select.js.map +1 -0
  362. package/select/lib/select.d.ts +216 -0
  363. package/select/lib/select.js +589 -0
  364. package/select/lib/select.js.map +1 -0
  365. package/select/lib/selectoption/harness.d.ts +11 -0
  366. package/select/lib/selectoption/harness.js +12 -0
  367. package/select/lib/selectoption/harness.js.map +1 -0
  368. package/select/lib/selectoption/select-option.d.ts +30 -0
  369. package/select/lib/selectoption/select-option.js +71 -0
  370. package/select/lib/selectoption/select-option.js.map +1 -0
  371. package/select/lib/shared-styles.css.d.ts +1 -0
  372. package/select/lib/shared-styles.css.js +9 -0
  373. package/select/lib/shared-styles.css.js.map +1 -0
  374. package/select/lib/shared-styles.scss +10 -0
  375. package/select/lib/shared.d.ts +52 -0
  376. package/select/lib/shared.js +41 -0
  377. package/select/lib/shared.js.map +1 -0
  378. package/select/outlined-select.d.ts +41 -0
  379. package/select/outlined-select.js +46 -0
  380. package/select/outlined-select.js.map +1 -0
  381. package/select/select-option.d.ts +44 -0
  382. package/select/select-option.js +51 -0
  383. package/select/select-option.js.map +1 -0
  384. package/slider/harness.d.ts +2 -1
  385. package/slider/harness.js +14 -9
  386. package/slider/harness.js.map +1 -1
  387. package/slider/lib/_slider.scss +149 -167
  388. package/slider/lib/forced-colors-styles.css.js +1 -1
  389. package/slider/lib/forced-colors-styles.css.js.map +1 -1
  390. package/slider/lib/forced-colors-styles.scss +2 -2
  391. package/slider/lib/slider-styles.css.js +1 -1
  392. package/slider/lib/slider-styles.css.js.map +1 -1
  393. package/slider/lib/slider.d.ts +23 -57
  394. package/slider/lib/slider.js +77 -167
  395. package/slider/lib/slider.js.map +1 -1
  396. package/switch/lib/_switch.scss +63 -18
  397. package/switch/lib/switch-styles.css.js +1 -1
  398. package/switch/lib/switch-styles.css.js.map +1 -1
  399. package/switch/lib/switch.d.ts +0 -7
  400. package/switch/lib/switch.js +32 -79
  401. package/switch/lib/switch.js.map +1 -1
  402. package/textfield/harness.d.ts +1 -1
  403. package/textfield/harness.js.map +1 -1
  404. package/textfield/lib/_filled-text-field.scss +70 -14
  405. package/textfield/lib/_outlined-text-field.scss +60 -35
  406. package/textfield/lib/filled-forced-colors-styles.css.js +1 -1
  407. package/textfield/lib/filled-forced-colors-styles.css.js.map +1 -1
  408. package/textfield/lib/filled-styles.css.js +1 -1
  409. package/textfield/lib/filled-styles.css.js.map +1 -1
  410. package/textfield/lib/outlined-forced-colors-styles.css.js +1 -1
  411. package/textfield/lib/outlined-forced-colors-styles.css.js.map +1 -1
  412. package/textfield/lib/outlined-styles.css.js +1 -1
  413. package/textfield/lib/outlined-styles.css.js.map +1 -1
  414. package/textfield/lib/text-field.d.ts +1 -11
  415. package/textfield/lib/text-field.js +45 -115
  416. package/textfield/lib/text-field.js.map +1 -1
  417. package/tokens/_index.scss +5 -18
  418. package/tokens/_md-comp-assist-chip.scss +25 -29
  419. package/tokens/_md-comp-checkbox.scss +78 -1
  420. package/tokens/_md-comp-circular-progress-indicator.scss +39 -13
  421. package/tokens/_md-comp-elevated-button.scss +0 -10
  422. package/tokens/_md-comp-elevation.scss +0 -4
  423. package/tokens/_md-comp-fab-branded.scss +84 -1
  424. package/tokens/_md-comp-fab.scss +249 -0
  425. package/tokens/_md-comp-filled-button.scss +0 -10
  426. package/{field/lib → tokens}/_md-comp-filled-field.scss +91 -9
  427. package/tokens/_md-comp-filled-icon-button.scss +46 -1
  428. package/tokens/_md-comp-filled-select.scss +124 -1
  429. package/tokens/_md-comp-filled-text-field.scss +93 -9
  430. package/tokens/_md-comp-filled-tonal-button.scss +0 -11
  431. package/tokens/_md-comp-filled-tonal-icon-button.scss +45 -3
  432. package/tokens/_md-comp-filter-chip.scss +103 -103
  433. package/tokens/_md-comp-focus-ring.scss +23 -24
  434. package/tokens/_md-comp-icon-button.scss +37 -1
  435. package/tokens/_md-comp-input-chip.scss +77 -95
  436. package/tokens/_md-comp-linear-progress-indicator.scss +31 -3
  437. package/tokens/_md-comp-list-item.scss +174 -0
  438. package/tokens/_md-comp-list.scss +81 -26
  439. package/tokens/_md-comp-menu-item.scss +50 -0
  440. package/tokens/_md-comp-menu.scss +29 -2
  441. package/tokens/_md-comp-outlined-button.scss +0 -10
  442. package/{field/lib → tokens}/_md-comp-outlined-field.scss +85 -9
  443. package/tokens/_md-comp-outlined-icon-button.scss +41 -1
  444. package/tokens/_md-comp-outlined-segmented-button.scss +57 -11
  445. package/tokens/_md-comp-outlined-select.scss +123 -1
  446. package/tokens/_md-comp-outlined-text-field.scss +85 -8
  447. package/tokens/_md-comp-slider.scss +13 -1
  448. package/tokens/_md-comp-suggestion-chip.scss +29 -30
  449. package/tokens/_md-comp-switch.scss +81 -1
  450. package/tokens/_md-comp-text-button.scss +0 -10
  451. package/tokens/_values.scss +2 -4
  452. package/types/aria.d.ts +59 -1
  453. package/actionelement/action-element.d.ts +0 -79
  454. package/actionelement/action-element.js +0 -97
  455. package/actionelement/action-element.js.map +0 -1
  456. package/button/lib/state.d.ts +0 -10
  457. package/button/lib/state.js +0 -7
  458. package/button/lib/state.js.map +0 -1
  459. package/controller/action-controller.d.ts +0 -147
  460. package/controller/action-controller.js +0 -286
  461. package/controller/action-controller.js.map +0 -1
  462. package/decorators/aria-property.d.ts +0 -32
  463. package/decorators/aria-property.js +0 -99
  464. package/decorators/aria-property.js.map +0 -1
  465. package/fab/_fab-extended.scss +0 -6
  466. package/fab/fab-extended.d.ts +0 -23
  467. package/fab/fab-extended.js +0 -29
  468. package/fab/fab-extended.js.map +0 -1
  469. package/fab/lib/_fab-extended.scss +0 -73
  470. package/fab/lib/fab-extended-styles.css.js +0 -9
  471. package/fab/lib/fab-extended-styles.css.js.map +0 -1
  472. package/fab/lib/fab-extended.d.ts +0 -19
  473. package/fab/lib/fab-extended.js +0 -28
  474. package/fab/lib/fab-extended.js.map +0 -1
  475. package/fab/lib/fab-shared-styles.css.js +0 -9
  476. package/fab/lib/fab-shared-styles.css.js.map +0 -1
  477. package/fab/lib/fab-shared.d.ts +0 -44
  478. package/fab/lib/fab-shared.js +0 -121
  479. package/fab/lib/fab-shared.js.map +0 -1
  480. package/focus/strong-focus.d.ts +0 -56
  481. package/focus/strong-focus.js +0 -96
  482. package/focus/strong-focus.js.map +0 -1
  483. package/sass/_shape.scss +0 -154
  484. package/slider/lib/_tokens.scss +0 -65
  485. package/tokens/_md-comp-extended-fab-branded.scss +0 -45
  486. package/tokens/_md-comp-extended-fab-primary.scss +0 -45
  487. package/tokens/_md-comp-extended-fab-secondary.scss +0 -48
  488. package/tokens/_md-comp-extended-fab-surface.scss +0 -45
  489. package/tokens/_md-comp-extended-fab-tertiary.scss +0 -48
  490. package/tokens/_md-comp-fab-branded-large.scss +0 -23
  491. package/tokens/_md-comp-fab-primary-large.scss +0 -23
  492. package/tokens/_md-comp-fab-primary-small.scss +0 -23
  493. package/tokens/_md-comp-fab-primary.scss +0 -23
  494. package/tokens/_md-comp-fab-secondary-large.scss +0 -23
  495. package/tokens/_md-comp-fab-secondary-small.scss +0 -23
  496. package/tokens/_md-comp-fab-secondary.scss +0 -23
  497. package/tokens/_md-comp-fab-surface-large.scss +0 -23
  498. package/tokens/_md-comp-fab-surface-small.scss +0 -23
  499. package/tokens/_md-comp-fab-surface.scss +0 -23
  500. package/tokens/_md-comp-fab-tertiary-large.scss +0 -23
  501. package/tokens/_md-comp-fab-tertiary-small.scss +0 -23
  502. package/tokens/_md-comp-fab-tertiary.scss +0 -23
  503. /package/{fab/lib/fab-extended-styles.css.d.ts → chips/lib/elevated-styles.css.d.ts} +0 -0
  504. /package/{fab/lib/fab-shared-styles.css.d.ts → chips/lib/filter-styles.css.d.ts} +0 -0
@@ -0,0 +1,9 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2022 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { css } from 'lit';
7
+ 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 */
8
+ `;
9
+ //# sourceMappingURL=linear-progress-styles.css.js.map
@@ -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
+ * A linear progress 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
+ private readonly rootEl;
29
+ private animationReady;
30
+ private resizeObserver;
31
+ protected render(): import("lit-html").TemplateResult<1>;
32
+ connectedCallback(): Promise<void>;
33
+ disconnectedCallback(): void;
34
+ private restartAnimation;
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
+ * A linear progress 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 0);
127
+ //# 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,IAAI,EAAE,UAAU,EAAE,OAAO,EAAC,MAAM,KAAK,CAAC;AAC9C,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AACzD,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AACrD,OAAO,EAAC,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAErD,OAAO,EAAC,yBAAyB,EAAC,MAAM,wBAAwB,CAAC;AAGjE;;GAEG;AACH,MAAM,OAAO,cAAe,SAAQ,UAAU;IAA9C;;QAKE;;WAEG;QACwB,kBAAa,GAAG,KAAK,CAAC;QAEjD;;WAEG;QACuB,aAAQ,GAAG,CAAC,CAAC;QAEvC;;WAEG;QACuB,WAAM,GAAG,CAAC,CAAC;QAErC;;;WAGG;QACkD,eAAU,GAAG,KAAK,CAAC;QAIvD,mBAAc,GAAG,IAAI,CAAC;QAC/B,mBAAc,GAAwB,IAAI,CAAC;IAwErD,CAAC;IAtEC,mEAAmE;IACnE,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,CAAC,IAAI,CAAC,MAAO,CAAC,CAAC;IAC5C,CAAC;IAEQ,oBAAoB;QAC3B,IAAI,IAAI,CAAC,cAAc,EAAE;YACvB,IAAI,CAAC,cAAc,CAAC,UAAU,EAAE,CAAC;YACjC,IAAI,CAAC,cAAc,GAAG,IAAI,CAAC;SAC5B;QACD,KAAK,CAAC,oBAAoB,EAAE,CAAC;IAC/B,CAAC;IAED,2CAA2C;IAC3C,iBAAiB;IACT,KAAK,CAAC,gBAAgB;QAC5B,MAAM,IAAI,CAAC,cAAc,CAAC;QAC1B,IAAI,CAAC,cAAc,GAAG,KAAK,CAAC;QAC5B,MAAM,IAAI,OAAO,CAAC,qBAAqB,CAAC,CAAC;QACzC,IAAI,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;8CAA4C;AAE7D;IAAR,KAAK,EAAE;sDAA+B","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 * A linear progress 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') private readonly rootEl!: HTMLElement|null;\n\n @state() private animationReady = true;\n private 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 private 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,22 +18,21 @@
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
+ @if $value {
25
+ --md-list-#{$token}: #{$value};
26
+ }
27
+ }
28
28
  }
29
29
 
30
30
  @mixin styles() {
31
- $tokens: resolve-tokens(tokens.md-comp-list-values());
32
- $tokens: theme.create-theme-vars($tokens, list);
31
+ $tokens: tokens.md-comp-list-values();
33
32
 
34
33
  :host {
35
34
  @each $token, $value in $tokens {
36
- --_#{$token}: #{$value};
35
+ --_#{$token}: var(--md-list-#{$token}, #{$value});
37
36
  }
38
37
 
39
38
  color: unset;
@@ -42,6 +41,7 @@
42
41
 
43
42
  .md3-list {
44
43
  background-color: var(--_container-color);
44
+ border-radius: inherit;
45
45
  display: block;
46
46
  list-style-type: none;
47
47
  margin: 0;
@@ -53,44 +53,3 @@
53
53
  position: relative;
54
54
  }
55
55
  }
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 "]}
@@ -3,20 +3,17 @@
3
3
  * Copyright 2021 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { LitElement, TemplateResult } from 'lit';
7
- import { ClassInfo } from 'lit/directives/class-map.js';
6
+ import { LitElement } from 'lit';
8
7
  import { ARIARole } from '../../types/aria.js';
9
8
  import { ListItem } from './listitem/list-item.js';
10
9
  export declare class List extends LitElement {
11
10
  static shadowRootOptions: ShadowRootInit;
12
- ariaLabel: string;
13
- ariaActivedescendant: string;
14
- role: ARIARole;
11
+ type: ARIARole | '';
15
12
  /**
16
13
  * The tabindex of the underlying list.
17
14
  */
18
15
  listTabIndex: number;
19
- listRoot: HTMLElement;
16
+ listRoot: HTMLElement | null;
20
17
  /**
21
18
  * An array of activatable and disableable list items. Queries every assigned
22
19
  * element that has the `md-list-item` attribute.
@@ -26,19 +23,15 @@ export declare class List extends LitElement {
26
23
  * children / directly slotted elements.
27
24
  */
28
25
  items: ListItem[];
29
- render(): TemplateResult;
26
+ protected render(): import("lit-html").TemplateResult<1>;
30
27
  /**
31
28
  * Renders the main list element.
32
29
  */
33
- protected renderList(): TemplateResult<1>;
34
- /**
35
- * The classes to be applied to the underlying list.
36
- */
37
- protected getListClasses(): ClassInfo;
30
+ private renderList;
38
31
  /**
39
32
  * The content to be slotted into the list.
40
33
  */
41
- protected renderContent(): TemplateResult<1>;
34
+ private renderContent;
42
35
  /**
43
36
  * Handles keyboard navigation in the list.
44
37
  *
@@ -105,7 +98,7 @@ export declare class List extends LitElement {
105
98
  * @param index {{index: number}} The index to search from.
106
99
  * @returns The next activatable item or `null` if none are activatable.
107
100
  */
108
- protected static getNextItem<T extends ListItem>(items: T[], index: number): T;
101
+ private static getNextItem;
109
102
  /**
110
103
  * Retrieves the the previous non-disabled item of a given array of items.
111
104
  *
@@ -113,5 +106,5 @@ export declare class List extends LitElement {
113
106
  * @param index {{index: number}} The index to search from.
114
107
  * @returns The previous activatable item or `null` if none are activatable.
115
108
  */
116
- protected static getPrevItem<T extends ListItem>(items: T[], index: number): T;
109
+ private static getPrevItem;
117
110
  }
package/list/lib/list.js CHANGED
@@ -3,15 +3,11 @@
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
- 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';
14
- import { keydownHandler } from '../../focus/strong-focus.js';
10
+ import { requestUpdateOnAriaChange } from '../../aria/delegate.js';
15
11
  const NAVIGABLE_KEYS = {
16
12
  ArrowDown: 'ArrowDown',
17
13
  ArrowUp: 'ArrowUp',
@@ -26,8 +22,7 @@ function isNavigableKey(key) {
26
22
  export class List extends LitElement {
27
23
  constructor() {
28
24
  super(...arguments);
29
- // @ts-ignore(b/264292293): Use `override` with TS 4.9+
30
- this.role = 'list';
25
+ this.type = 'list';
31
26
  /**
32
27
  * The tabindex of the underlying list.
33
28
  */
@@ -40,23 +35,19 @@ export class List extends LitElement {
40
35
  * Renders the main list element.
41
36
  */
42
37
  renderList() {
38
+ // Needed for closure conformance
39
+ const { ariaLabel } = this;
43
40
  return html `
44
- <ul class="md3-list ${classMap(this.getListClasses())}"
45
- aria-label="${ifDefined(this.ariaLabel)}"
41
+ <ul class="md3-list"
42
+ aria-label=${ariaLabel || nothing}
46
43
  tabindex=${this.listTabIndex}
47
- role=${this.role}
44
+ role=${this.type || nothing}
48
45
  @keydown=${this.handleKeydown}
49
46
  >
50
47
  ${this.renderContent()}
51
48
  </ul>
52
49
  `;
53
50
  }
54
- /**
55
- * The classes to be applied to the underlying list.
56
- */
57
- getListClasses() {
58
- return {};
59
- }
60
51
  /**
61
52
  * The content to be slotted into the list.
62
53
  */
@@ -84,7 +75,6 @@ export class List extends LitElement {
84
75
  if (activeItemRecord) {
85
76
  activeItemRecord.item.active = false;
86
77
  }
87
- keydownHandler(event);
88
78
  event.preventDefault();
89
79
  switch (key) {
90
80
  // Activate the next item
@@ -164,7 +154,7 @@ export class List extends LitElement {
164
154
  return activeItem;
165
155
  }
166
156
  focus() {
167
- this.listRoot.focus();
157
+ this.listRoot?.focus();
168
158
  }
169
159
  /**
170
160
  * Retrieves the the first activated item of a given array of items.
@@ -250,36 +240,21 @@ export class List extends LitElement {
250
240
  return null;
251
241
  }
252
242
  }
243
+ _a = List;
244
+ (() => {
245
+ requestUpdateOnAriaChange(_a);
246
+ })();
253
247
  List.shadowRootOptions = { mode: 'open', delegatesFocus: true };
254
248
  __decorate([
255
- ariaProperty,
256
- property({ type: String, attribute: 'data-aria-label', noAccessor: true }),
257
- __metadata("design:type", String)
258
- ], List.prototype, "ariaLabel", void 0);
259
- __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);
249
+ property()
250
+ ], List.prototype, "type", void 0);
273
251
  __decorate([
274
- property({ type: Number }),
275
- __metadata("design:type", Number)
252
+ property({ type: Number })
276
253
  ], List.prototype, "listTabIndex", void 0);
277
254
  __decorate([
278
- query('.md3-list'),
279
- __metadata("design:type", HTMLElement)
255
+ query('.md3-list')
280
256
  ], List.prototype, "listRoot", void 0);
281
257
  __decorate([
282
- queryAssignedElements({ flatten: true, selector: '[md-list-item]' }),
283
- __metadata("design:type", Array)
258
+ queryAssignedElements({ flatten: true, selector: '[md-list-item]' })
284
259
  ], List.prototype, "items", void 0);
285
260
  //# 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,MAAM;IACZ,GAAG,EAAE,KAAK;CACF,CAAC;AAIX,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;;QAgBE,uDAAuD;QACvD,SAAI,GAAa,MAAM,CAAC;QAExB;;WAEG;QACuB,iBAAY,GAAW,CAAC,CAAC;IA6PrD,CA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,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
+ {"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;AAEzE,OAAO,EAAC,yBAAyB,EAAC,MAAM,wBAAwB,CAAC;AAKjE,MAAM,cAAc,GAAG;IACrB,SAAS,EAAE,WAAW;IACtB,OAAO,EAAE,SAAS;IAClB,IAAI,EAAE,MAAM;IACZ,GA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AI,EAAC,CAAC;AAE9C;IAAX,QAAQ,EAAE;kCAA4B;AAKb;IAAzB,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;0CAAkB;AAEvB;IAAnB,KAAK,CAAC,WAAW,CAAC;sCAA6B;AAWhD;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 {requestUpdateOnAriaChange} from '../../aria/delegate.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|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=${(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 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 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 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 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 return null;\n }\n}\n"]}