@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
@@ -3,24 +3,23 @@
3
3
  * Copyright 2021 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { __decorate, __metadata } from "tslib";
6
+ var _a;
7
+ import { __decorate } from "tslib";
7
8
  import '../../focus/focus-ring.js';
8
- import { html } from 'lit';
9
- import { property, query, queryAssignedElements, state } from 'lit/decorators.js';
9
+ import '../../ripple/ripple.js';
10
+ import { html, LitElement, nothing } from 'lit';
11
+ import { property, queryAssignedElements, queryAsync, state } from 'lit/decorators.js';
10
12
  import { classMap } from 'lit/directives/class-map.js';
11
- import { ifDefined } from 'lit/directives/if-defined.js';
12
- import { ActionElement } from '../../actionelement/action-element.js';
13
- import { ariaProperty } from '../../decorators/aria-property.js';
14
- import { pointerPress, shouldShowStrongFocus } from '../../focus/strong-focus.js';
15
- import { MdRipple } from '../../ripple/ripple.js';
13
+ import { when } from 'lit/directives/when.js';
14
+ import { requestUpdateOnAriaChange } from '../../aria/delegate.js';
15
+ import { ripple } from '../../ripple/directive.js';
16
16
  /**
17
17
  * SegmentedButton is a web component implementation of the Material Design
18
18
  * segmented button component. It is intended **only** for use as a child of a
19
19
  * `SementedButtonSet` component. It is **not** intended for use in any other
20
20
  * context.
21
- * @soyCompatible
22
21
  */
23
- export class SegmentedButton extends ActionElement {
22
+ export class SegmentedButton extends LitElement {
24
23
  constructor() {
25
24
  super(...arguments);
26
25
  this.disabled = false;
@@ -29,7 +28,14 @@ export class SegmentedButton extends ActionElement {
29
28
  this.noCheckmark = false;
30
29
  this.hasIcon = false;
31
30
  this.animState = '';
32
- this.showFocusRing = false;
31
+ this.showRipple = false;
32
+ this.getRipple = () => {
33
+ this.showRipple = true;
34
+ return this.ripple;
35
+ };
36
+ this.renderRipple = () => {
37
+ return html `<md-ripple ?disabled="${this.disabled}" class="md3-segmented-button__ripple"> </md-ripple>`;
38
+ };
33
39
  }
34
40
  update(props) {
35
41
  this.animState = this.nextAnimationState(props);
@@ -53,58 +59,24 @@ export class SegmentedButton extends ActionElement {
53
59
  }
54
60
  return '';
55
61
  }
56
- beginPress({ positionEvent }) {
57
- // TODO(b/261201805): connect to ripple
58
- }
59
- endPress(options) {
60
- // TODO(b/261201805): connect to ripple
61
- super.endPress(options);
62
- if (!options.cancelled) {
63
- const event = new Event('segmented-button-interaction', { bubbles: true, composed: true });
64
- this.dispatchEvent(event);
65
- }
66
- }
67
- handlePointerDown(e) {
68
- super.handlePointerDown(e);
69
- pointerPress();
70
- this.showFocusRing = shouldShowStrongFocus();
71
- }
72
- handlePointerUp(e) {
73
- super.handlePointerUp(e);
74
- }
75
- handlePointerEnter(e) {
76
- this.ripple.handlePointerenter(e);
62
+ handleClick() {
63
+ const event = new Event('segmented-button-interaction', { bubbles: true, composed: true });
64
+ this.dispatchEvent(event);
77
65
  }
78
- handlePointerLeave(e) {
79
- super.handlePointerLeave(e);
80
- this.ripple.handlePointerleave(e);
81
- }
82
- handleFocus() {
83
- this.showFocusRing = shouldShowStrongFocus();
84
- }
85
- handleBlur() {
86
- this.showFocusRing = false;
87
- }
88
- /** @soyTemplate */
89
66
  render() {
67
+ // Needed for closure conformance
68
+ const { ariaLabel } = this;
90
69
  return html `
91
70
  <button
92
71
  tabindex="${this.disabled ? '-1' : '0'}"
93
- aria-label="${ifDefined(this.ariaLabel)}"
72
+ aria-label=${ariaLabel || nothing}
94
73
  aria-pressed=${this.selected}
95
74
  ?disabled=${this.disabled}
96
- @focus="${this.handleFocus}"
97
- @blur="${this.handleBlur}"
98
- @pointerdown="${this.handlePointerDown}"
99
- @pointerup="${this.handlePointerUp}"
100
- @pointercancel="${this.handlePointerCancel}"
101
- @pointerleave="${this.handlePointerLeave}"
102
- @pointerenter="${this.handlePointerEnter}"
103
75
  @click="${this.handleClick}"
104
- @contextmenu="${this.handleContextMenu}"
105
- class="md3-segmented-button ${classMap(this.getRenderClasses())}">
106
- ${this.renderFocusRing()}
107
- ${this.renderRipple()}
76
+ class="md3-segmented-button ${classMap(this.getRenderClasses())}"
77
+ ${ripple(this.getRipple)}>
78
+ <md-focus-ring class="md3-segmented-button__focus-ring"></md-focus-ring>
79
+ ${when(this.showRipple, this.renderRipple)}
108
80
  ${this.renderOutline()}
109
81
  ${this.renderLeading()}
110
82
  ${this.renderLabel()}
@@ -112,7 +84,6 @@ export class SegmentedButton extends ActionElement {
112
84
  </button>
113
85
  `;
114
86
  }
115
- /** @soyTemplate */
116
87
  getRenderClasses() {
117
88
  return {
118
89
  'md3-segmented-button--selected': this.selected,
@@ -126,24 +97,13 @@ export class SegmentedButton extends ActionElement {
126
97
  'md3-segmented-button--deselecting': this.animState === 'deselecting',
127
98
  };
128
99
  }
129
- /** @soyTemplate */
130
- renderFocusRing() {
131
- return html `<md-focus-ring .visible="${this.showFocusRing}" class="md3-segmented-button__focus-ring"></md-focus-ring>`;
132
- }
133
- /** @soyTemplate */
134
- renderRipple() {
135
- return html `<md-ripple ?disabled="${this.disabled}" class="md3-segmented-button__ripple"> </md-ripple>`;
136
- }
137
- /** @soyTemplate */
138
100
  renderOutline() {
139
- return html ``;
101
+ return nothing;
140
102
  }
141
- /** @soyTemplate */
142
103
  renderLeading() {
143
104
  return this.label === '' ? this.renderLeadingWithoutLabel() :
144
105
  this.renderLeadingWithLabel();
145
106
  }
146
- /** @soyTemplate */
147
107
  renderLeadingWithoutLabel() {
148
108
  return html `
149
109
  <span class="md3-segmented-button__leading" aria-hidden="true">
@@ -158,7 +118,6 @@ export class SegmentedButton extends ActionElement {
158
118
  </span>
159
119
  `;
160
120
  }
161
- /** @soyTemplate */
162
121
  renderLeadingWithLabel() {
163
122
  return html `
164
123
  <span class="md3-segmented-button__leading" aria-hidden="true">
@@ -173,57 +132,44 @@ export class SegmentedButton extends ActionElement {
173
132
  </span>
174
133
  `;
175
134
  }
176
- /** @soyTemplate */
177
135
  renderLabel() {
178
136
  return html `
179
137
  <span class="md3-segmented-button__label-text">${this.label}</span>
180
138
  `;
181
139
  }
182
- /** @soyTemplate */
183
140
  renderTouchTarget() {
184
141
  return html `<span class="md3-segmented-button__touch"></span>`;
185
142
  }
186
143
  }
144
+ _a = SegmentedButton;
145
+ (() => {
146
+ requestUpdateOnAriaChange(_a);
147
+ })();
187
148
  __decorate([
188
- property({ type: Boolean }),
189
- __metadata("design:type", Object)
149
+ property({ type: Boolean })
190
150
  ], SegmentedButton.prototype, "disabled", void 0);
191
151
  __decorate([
192
- property({ type: Boolean }),
193
- __metadata("design:type", Object)
152
+ property({ type: Boolean })
194
153
  ], SegmentedButton.prototype, "selected", void 0);
195
154
  __decorate([
196
- property({ type: String }),
197
- __metadata("design:type", Object)
155
+ property()
198
156
  ], SegmentedButton.prototype, "label", void 0);
199
157
  __decorate([
200
- property({ type: Boolean }),
201
- __metadata("design:type", Object)
158
+ property({ type: Boolean })
202
159
  ], SegmentedButton.prototype, "noCheckmark", void 0);
203
160
  __decorate([
204
- property({ type: Boolean }),
205
- __metadata("design:type", Object)
161
+ property({ type: Boolean })
206
162
  ], SegmentedButton.prototype, "hasIcon", void 0);
207
163
  __decorate([
208
- ariaProperty // tslint:disable-line:no-new-decorators
209
- ,
210
- property({ type: String, attribute: 'aria-label' }),
211
- __metadata("design:type", String)
212
- ], SegmentedButton.prototype, "ariaLabel", void 0);
213
- __decorate([
214
- state(),
215
- __metadata("design:type", String)
164
+ state()
216
165
  ], SegmentedButton.prototype, "animState", void 0);
217
166
  __decorate([
218
- state(),
219
- __metadata("design:type", Object)
220
- ], SegmentedButton.prototype, "showFocusRing", void 0);
167
+ state()
168
+ ], SegmentedButton.prototype, "showRipple", void 0);
221
169
  __decorate([
222
- queryAssignedElements({ slot: 'icon', flatten: true }),
223
- __metadata("design:type", Array)
170
+ queryAssignedElements({ slot: 'icon', flatten: true })
224
171
  ], SegmentedButton.prototype, "iconElement", void 0);
225
172
  __decorate([
226
- query('md-ripple'),
227
- __metadata("design:type", MdRipple)
173
+ queryAsync('md-ripple')
228
174
  ], SegmentedButton.prototype, "ripple", void 0);
229
175
  //# sourceMappingURL=segmented-button.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"segmented-button.js","sourceRoot":"","sources":["segmented-button.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,2BAA2B,CAAC;AAEnC,OAAO,EAAC,IAAI,EAAiC,MAAM,KAAK,CAAC;AACzD,OAAO,EAAC,QAAQ,EAAE,KAAK,EAAE,qBAAqB,EAAE,KAAK,EAAC,MAAM,mBAAmB,CAAC;AAChF,OAAO,EAAY,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAC,SAAS,EAAC,MAAM,8BAA8B,CAAC;AAEvD,OAAO,EAAC,aAAa,EAAmC,MAAM,uCAAuC,CAAC;AACtG,OAAO,EAAC,YAAY,EAAC,MAAM,mCAAmC,CAAC;AAC/D,OAAO,EAAC,YAAY,EAAE,qBAAqB,EAAC,MAAM,6BAA6B,CAAC;AAChF,OAAO,EAAC,QAAQ,EAAC,MAAM,wBAAwB,CAAC;AAEhD;;;;;;GAMG;AACH,MAAM,OAAO,eAAgB,SAAQ,aAAa;IAAlD;;QAC6B,aAA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AA;;;;;;;;;;;KAWV,CAAC;IACJ,CAAC;IAED,mBAAmB;IACT,sBAAsB;QAC9B,OAAO,IAAI,CAAA;;;;;;;;;;;KAWV,CAAC;IACJ,CAAC;IAED,mBAAmB;IACT,WAAW;QACnB,OAAO,IAAI,CAAA;uDACwC,IAAI,CAAC,KAAK;KAC5D,CAAC;IACJ,CAAC;IAED,mBAAmB;IACT,iBAAiB;QACzB,OAAO,IAAI,CAAA,mDAAmD,CAAC;IACjE,CAAC;CACF;AAhMC;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;;iDAAkB;AAC5C;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;;iDAAkB;AAC5C;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAC,CAAC;;8CAAY;AACrC;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;;oDAAqB;AAC/C;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;;gDAAiB;AAG3C;IAAC,YAAY,CAAE,wCAAwC;;IACtD,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAC,CAAC;;kDACtB;AAE5B;IAAC,KAAK,EAAE;;kDAAkC;AAC1C;IAAC,KAAK,EAAE;;sDAAiC;AACzC;IAAC,qBAAqB,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;;oDACf;AACtC;IAAC,KAAK,CAAC,WAAW,CAAC;8BAAU,QAAQ;+CAAC","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../focus/focus-ring.js';\n\nimport {html, PropertyValues, TemplateResult} from 'lit';\nimport {property, query, queryAssignedElements, state} from 'lit/decorators.js';\nimport {ClassInfo, classMap} from 'lit/directives/class-map.js';\nimport {ifDefined} from 'lit/directives/if-defined.js';\n\nimport {ActionElement, BeginPressConfig, EndPressConfig} from '../../actionelement/action-element.js';\nimport {ariaProperty} from '../../decorators/aria-property.js';\nimport {pointerPress, shouldShowStrongFocus} from '../../focus/strong-focus.js';\nimport {MdRipple} from '../../ripple/ripple.js';\n\n/**\n * SegmentedButton is a web component implementation of the Material Design\n * segmented button component. It is intended **only** for use as a child of a\n * `SementedButtonSet` component. It is **not** intended for use in any other\n * context.\n * @soyCompatible\n */\nexport class SegmentedButton extends ActionElement {\n @property({type: Boolean}) disabled = false;\n @property({type: Boolean}) selected = false;\n @property({type: String}) label = '';\n @property({type: Boolean}) noCheckmark = false;\n @property({type: Boolean}) hasIcon = false;\n\n /** @soyPrefixAttribute */\n @ariaProperty // tslint:disable-line:no-new-decorators\n @property({type: String, attribute: 'aria-label'})\n override ariaLabel!: string;\n\n @state() protected animState: string = '';\n @state() protected showFocusRing = false;\n @queryAssignedElements({slot: 'icon', flatten: true})\n protected iconElement!: HTMLElement[];\n @query('md-ripple') ripple!: MdRipple;\n\n protected override update(props: PropertyValues<SegmentedButton>) {\n this.animState = this.nextAnimationState(props);\n super.update(props);\n // NOTE: This needs to be set *after* calling super.update() to ensure the\n // appropriate CSS classes are applied.\n this.hasIcon = this.iconElement.length > 0;\n }\n\n private nextAnimationState(changedProps: PropertyValues<SegmentedButton>):\n string {\n const prevSelected = changedProps.get('selected');\n // Early exit for first update.\n if (prevSelected === undefined) return '';\n\n const nextSelected = this.selected;\n const nextHasCheckmark = !this.noCheckmark;\n if (!prevSelected && nextSelected && nextHasCheckmark) {\n return 'selecting';\n }\n if (prevSelected && !nextSelected && nextHasCheckmark) {\n return 'deselecting';\n }\n return '';\n }\n\n override beginPress({positionEvent}: BeginPressConfig) {\n // TODO(b/261201805): connect to ripple\n }\n\n override endPress(options: EndPressConfig) {\n // TODO(b/261201805): connect to ripple\n super.endPress(options);\n if (!options.cancelled) {\n const event = new Event(\n 'segmented-button-interaction', {bubbles: true, composed: true});\n this.dispatchEvent(event);\n }\n }\n\n override handlePointerDown(e: PointerEvent) {\n super.handlePointerDown(e);\n pointerPress();\n this.showFocusRing = shouldShowStrongFocus();\n }\n\n override handlePointerUp(e: PointerEvent) {\n super.handlePointerUp(e);\n }\n\n protected handlePointerEnter(e: PointerEvent) {\n this.ripple.handlePointerenter(e);\n }\n\n override handlePointerLeave(e: PointerEvent) {\n super.handlePointerLeave(e);\n this.ripple.handlePointerleave(e);\n }\n\n protected handleFocus() {\n this.showFocusRing = shouldShowStrongFocus();\n }\n\n protected handleBlur() {\n this.showFocusRing = false;\n }\n\n /** @soyTemplate */\n override render(): TemplateResult {\n return html`\n <button\n tabindex=\"${this.disabled ? '-1' : '0'}\"\n aria-label=\"${ifDefined(this.ariaLabel)}\"\n aria-pressed=${this.selected}\n ?disabled=${this.disabled}\n @focus=\"${this.handleFocus}\"\n @blur=\"${this.handleBlur}\"\n @pointerdown=\"${this.handlePointerDown}\"\n @pointerup=\"${this.handlePointerUp}\"\n @pointercancel=\"${this.handlePointerCancel}\"\n @pointerleave=\"${this.handlePointerLeave}\"\n @pointerenter=\"${this.handlePointerEnter}\"\n @click=\"${this.handleClick}\"\n @contextmenu=\"${this.handleContextMenu}\"\n class=\"md3-segmented-button ${classMap(this.getRenderClasses())}\">\n ${this.renderFocusRing()}\n ${this.renderRipple()}\n ${this.renderOutline()}\n ${this.renderLeading()}\n ${this.renderLabel()}\n ${this.renderTouchTarget()}\n </button>\n `;\n }\n\n /** @soyTemplate */\n protected getRenderClasses(): ClassInfo {\n return {\n 'md3-segmented-button--selected': this.selected,\n 'md3-segmented-button--unselected': !this.selected,\n 'md3-segmented-button--with-label': this.label !== '',\n 'md3-segmented-button--without-label': this.label === '',\n 'md3-segmented-button--with-icon': this.hasIcon,\n 'md3-segmented-button--with-checkmark': !this.noCheckmark,\n 'md3-segmented-button--without-checkmark': this.noCheckmark,\n 'md3-segmented-button--selecting': this.animState === 'selecting',\n 'md3-segmented-button--deselecting': this.animState === 'deselecting',\n };\n }\n\n /** @soyTemplate */\n protected renderFocusRing(): TemplateResult {\n return html`<md-focus-ring .visible=\"${\n this.showFocusRing}\" class=\"md3-segmented-button__focus-ring\"></md-focus-ring>`;\n }\n\n /** @soyTemplate */\n protected renderRipple(): TemplateResult|string {\n return html`<md-ripple ?disabled=\"${\n this.disabled}\" class=\"md3-segmented-button__ripple\"> </md-ripple>`;\n }\n\n /** @soyTemplate */\n protected renderOutline(): TemplateResult {\n return html``;\n }\n\n /** @soyTemplate */\n protected renderLeading(): TemplateResult {\n return this.label === '' ? this.renderLeadingWithoutLabel() :\n this.renderLeadingWithLabel();\n }\n\n /** @soyTemplate */\n protected renderLeadingWithoutLabel(): TemplateResult {\n return html`\n <span class=\"md3-segmented-button__leading\" aria-hidden=\"true\">\n <span class=\"md3-segmented-button__graphic\">\n <svg class=\"md3-segmented-button__checkmark\" viewBox=\"0 0 24 24\">\n <path class=\"md3-segmented-button__checkmark-path\" fill=\"none\" d=\"M1.73,12.91 8.1,19.28 22.79,4.59\"></path>\n </svg>\n </span>\n <span class=\"md3-segmented-button__icon\" aria-hidden=\"true\">\n <slot name=\"icon\"></slot>\n </span>\n </span>\n `;\n }\n\n /** @soyTemplate */\n protected renderLeadingWithLabel(): TemplateResult {\n return html`\n <span class=\"md3-segmented-button__leading\" aria-hidden=\"true\">\n <span class=\"md3-segmented-button__graphic\">\n <svg class=\"md3-segmented-button__checkmark\" viewBox=\"0 0 24 24\">\n <path class=\"md3-segmented-button__checkmark-path\" fill=\"none\" d=\"M1.73,12.91 8.1,19.28 22.79,4.59\"></path>\n </svg>\n <span class=\"md3-segmented-button__icon\" aria-hidden=\"true\">\n <slot name=\"icon\"></slot>\n </span>\n </span>\n </span>\n `;\n }\n\n /** @soyTemplate */\n protected renderLabel(): TemplateResult {\n return html`\n <span class=\"md3-segmented-button__label-text\">${this.label}</span>\n `;\n }\n\n /** @soyTemplate */\n protected renderTouchTarget(): TemplateResult {\n return html`<span class=\"md3-segmented-button__touch\"></span>`;\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E,OAAO,EAAC,CAAC;iDAAkB;AACjB;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;iDAAkB;AAChC;IAAX,QAAQ,EAAE;8CAAY;AACI;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;oDAAqB;AACpB;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;gDAAiB;AAElC;IAAR,KAAK,EAAE;kDAAwB;AACvB;IAAR,KAAK,EAAE;mDAA4B;AAEpC;IADC,qBAAqB,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,OAAO,EAAE,IAAI,EAAC,CAAC;oDACR;AACpB;IAAxB,UAAU,CAAC,WAAW,CAAC;+CAAkD","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport '../../focus/focus-ring.js';\nimport '../../ripple/ripple.js';\n\nimport {html, LitElement, nothing, PropertyValues, TemplateResult} from 'lit';\nimport {property, queryAssignedElements, queryAsync, state} from 'lit/decorators.js';\nimport {classMap} from 'lit/directives/class-map.js';\nimport {when} from 'lit/directives/when.js';\n\nimport {requestUpdateOnAriaChange} from '../../aria/delegate.js';\nimport {ripple} from '../../ripple/directive.js';\nimport {MdRipple} from '../../ripple/ripple.js';\nimport {ARIAMixinStrict} from '../../types/aria.js';\n\n/**\n * SegmentedButton is a web component implementation of the Material Design\n * segmented button component. It is intended **only** for use as a child of a\n * `SementedButtonSet` component. It is **not** intended for use in any other\n * context.\n */\nexport class SegmentedButton extends LitElement {\n static {\n requestUpdateOnAriaChange(this);\n }\n\n @property({type: Boolean}) disabled = false;\n @property({type: Boolean}) selected = false;\n @property() label = '';\n @property({type: Boolean}) noCheckmark = false;\n @property({type: Boolean}) hasIcon = false;\n\n @state() private animState = '';\n @state() private showRipple = false;\n @queryAssignedElements({slot: 'icon', flatten: true})\n private readonly iconElement!: HTMLElement[];\n @queryAsync('md-ripple') private readonly ripple!: Promise<MdRipple|null>;\n\n protected override update(props: PropertyValues<SegmentedButton>) {\n this.animState = this.nextAnimationState(props);\n super.update(props);\n // NOTE: This needs to be set *after* calling super.update() to ensure the\n // appropriate CSS classes are applied.\n this.hasIcon = this.iconElement.length > 0;\n }\n\n private nextAnimationState(changedProps: PropertyValues<SegmentedButton>):\n string {\n const prevSelected = changedProps.get('selected');\n // Early exit for first update.\n if (prevSelected === undefined) return '';\n\n const nextSelected = this.selected;\n const nextHasCheckmark = !this.noCheckmark;\n if (!prevSelected && nextSelected && nextHasCheckmark) {\n return 'selecting';\n }\n if (prevSelected && !nextSelected && nextHasCheckmark) {\n return 'deselecting';\n }\n return '';\n }\n\n private handleClick() {\n const event = new Event(\n 'segmented-button-interaction', {bubbles: true, composed: true});\n this.dispatchEvent(event);\n }\n\n protected override render() {\n // Needed for closure conformance\n const {ariaLabel} = this as ARIAMixinStrict;\n return html`\n <button\n tabindex=\"${this.disabled ? '-1' : '0'}\"\n aria-label=${ariaLabel || nothing}\n aria-pressed=${this.selected}\n ?disabled=${this.disabled}\n @click=\"${this.handleClick}\"\n class=\"md3-segmented-button ${classMap(this.getRenderClasses())}\"\n ${ripple(this.getRipple)}>\n <md-focus-ring class=\"md3-segmented-button__focus-ring\"></md-focus-ring>\n ${when(this.showRipple, this.renderRipple)}\n ${this.renderOutline()}\n ${this.renderLeading()}\n ${this.renderLabel()}\n ${this.renderTouchTarget()}\n </button>\n `;\n }\n\n protected getRenderClasses() {\n return {\n 'md3-segmented-button--selected': this.selected,\n 'md3-segmented-button--unselected': !this.selected,\n 'md3-segmented-button--with-label': this.label !== '',\n 'md3-segmented-button--without-label': this.label === '',\n 'md3-segmented-button--with-icon': this.hasIcon,\n 'md3-segmented-button--with-checkmark': !this.noCheckmark,\n 'md3-segmented-button--without-checkmark': this.noCheckmark,\n 'md3-segmented-button--selecting': this.animState === 'selecting',\n 'md3-segmented-button--deselecting': this.animState === 'deselecting',\n };\n }\n\n private readonly getRipple = () => {\n this.showRipple = true;\n return this.ripple;\n };\n\n private readonly renderRipple = () => {\n return html`<md-ripple ?disabled=\"${\n this.disabled}\" class=\"md3-segmented-button__ripple\"> </md-ripple>`;\n };\n\n protected renderOutline(): TemplateResult|typeof nothing {\n return nothing;\n }\n\n private renderLeading() {\n return this.label === '' ? this.renderLeadingWithoutLabel() :\n this.renderLeadingWithLabel();\n }\n\n private renderLeadingWithoutLabel() {\n return html`\n <span class=\"md3-segmented-button__leading\" aria-hidden=\"true\">\n <span class=\"md3-segmented-button__graphic\">\n <svg class=\"md3-segmented-button__checkmark\" viewBox=\"0 0 24 24\">\n <path class=\"md3-segmented-button__checkmark-path\" fill=\"none\" d=\"M1.73,12.91 8.1,19.28 22.79,4.59\"></path>\n </svg>\n </span>\n <span class=\"md3-segmented-button__icon\" aria-hidden=\"true\">\n <slot name=\"icon\"></slot>\n </span>\n </span>\n `;\n }\n\n private renderLeadingWithLabel() {\n return html`\n <span class=\"md3-segmented-button__leading\" aria-hidden=\"true\">\n <span class=\"md3-segmented-button__graphic\">\n <svg class=\"md3-segmented-button__checkmark\" viewBox=\"0 0 24 24\">\n <path class=\"md3-segmented-button__checkmark-path\" fill=\"none\" d=\"M1.73,12.91 8.1,19.28 22.79,4.59\"></path>\n </svg>\n <span class=\"md3-segmented-button__icon\" aria-hidden=\"true\">\n <slot name=\"icon\"></slot>\n </span>\n </span>\n </span>\n `;\n }\n\n private renderLabel() {\n return html`\n <span class=\"md3-segmented-button__label-text\">${this.label}</span>\n `;\n }\n\n private renderTouchTarget() {\n return html`<span class=\"md3-segmented-button__touch\"></span>`;\n }\n}\n"]}
@@ -12,7 +12,6 @@ declare global {
12
12
  /**
13
13
  * MdOutlinedSegmentedButton is the custom element for the Material
14
14
  * Design outlined segmented button component.
15
- * @soyCompatible
16
15
  * @final
17
16
  * @suppress {visibility}
18
17
  */
@@ -11,7 +11,6 @@ import { styles as sharedStyles } from './lib/shared-styles.css.js';
11
11
  /**
12
12
  * MdOutlinedSegmentedButton is the custom element for the Material
13
13
  * Design outlined segmented button component.
14
- * @soyCompatible
15
14
  * @final
16
15
  * @suppress {visibility}
17
16
  */
@@ -1 +1 @@
1
- {"version":3,"file":"outlined-segmented-button.js","sourceRoot":"","sources":["outlined-segmented-button.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,uBAAuB,EAAC,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAC,MAAM,IAAI,cAAc,EAAC,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAC,MAAM,IAAI,YAAY,EAAC,MAAM,4BAA4B,CAAC;AAQlE;;;;;;GAMG;AAEI,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,uBAAuB;;AACpD,gCAAM,GAAG,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;AAD7C,yBAAyB;IADrC,aAAa,CAAC,8BAA8B,CAAC;GACjC,yBAAyB,CAErC;SAFY,yBAAyB","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {customElement} from 'lit/decorators.js';\n\nimport {OutlinedSegmentedButton} from './lib/outlined-segmented-button.js';\nimport {styles as outlinedStyles} from './lib/outlined-styles.css.js';\nimport {styles as sharedStyles} from './lib/shared-styles.css.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-outlined-segmented-button': MdOutlinedSegmentedButton;\n }\n}\n\n/**\n * MdOutlinedSegmentedButton is the custom element for the Material\n * Design outlined segmented button component.\n * @soyCompatible\n * @final\n * @suppress {visibility}\n */\n@customElement('md-outlined-segmented-button')\nexport class MdOutlinedSegmentedButton extends OutlinedSegmentedButton {\n static override styles = [sharedStyles, outlinedStyles];\n}\n"]}
1
+ {"version":3,"file":"outlined-segmented-button.js","sourceRoot":"","sources":["outlined-segmented-button.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,aAAa,EAAC,MAAM,mBAAmB,CAAC;AAEhD,OAAO,EAAC,uBAAuB,EAAC,MAAM,oCAAoC,CAAC;AAC3E,OAAO,EAAC,MAAM,IAAI,cAAc,EAAC,MAAM,8BAA8B,CAAC;AACtE,OAAO,EAAC,MAAM,IAAI,YAAY,EAAC,MAAM,4BAA4B,CAAC;AAQlE;;;;;GAKG;AAEI,IAAM,yBAAyB,GAA/B,MAAM,yBAA0B,SAAQ,uBAAuB;;AACpD,gCAAM,GAAG,CAAC,YAAY,EAAE,cAAc,CAAC,CAAC;AAD7C,yBAAyB;IADrC,aAAa,CAAC,8BAA8B,CAAC;GACjC,yBAAyB,CAErC;SAFY,yBAAyB","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {customElement} from 'lit/decorators.js';\n\nimport {OutlinedSegmentedButton} from './lib/outlined-segmented-button.js';\nimport {styles as outlinedStyles} from './lib/outlined-styles.css.js';\nimport {styles as sharedStyles} from './lib/shared-styles.css.js';\n\ndeclare global {\n interface HTMLElementTagNameMap {\n 'md-outlined-segmented-button': MdOutlinedSegmentedButton;\n }\n}\n\n/**\n * MdOutlinedSegmentedButton is the custom element for the Material\n * Design outlined segmented button component.\n * @final\n * @suppress {visibility}\n */\n@customElement('md-outlined-segmented-button')\nexport class MdOutlinedSegmentedButton extends OutlinedSegmentedButton {\n static override styles = [sharedStyles, outlinedStyles];\n}\n"]}
@@ -4,31 +4,50 @@
4
4
  //
5
5
 
6
6
  // go/keep-sorted start
7
- @use '../../sass/shape';
8
- @use '../../sass/theme';
9
7
  @use '../../tokens';
10
8
  // go/keep-sorted end
11
9
 
12
- $_custom-property-prefix: 'segmented-button';
13
-
14
10
  @mixin theme($tokens) {
15
- $tokens: theme.validate-theme(
16
- tokens.md-comp-outlined-segmented-button-values(),
17
- $tokens
11
+ $supported-tokens: list.join(
12
+ tokens.$md-comp-outlined-segmented-button-supported-tokens,
13
+ ('shape-start-start', 'shape-start-end', 'shape-end-end', 'shape-end-start')
18
14
  );
19
- $tokens: theme.create-theme-vars($tokens, $_custom-property-prefix);
20
- $tokens: shape.resolve-tokens($tokens, 'shape');
21
- @include theme.emit-theme-vars($tokens);
15
+
16
+ @each $token, $value in $tokens {
17
+ @if list.index($supported-tokens, $token) == null {
18
+ @error 'Token `#{$token}` is not a supported token.';
19
+ }
20
+
21
+ @if $value {
22
+ --md-outlined-segmented-button-#{$token}: #{$value};
23
+ }
24
+ }
22
25
  }
23
26
 
24
27
  @mixin styles() {
25
28
  $tokens: tokens.md-comp-outlined-segmented-button-values();
26
- $tokens: theme.create-theme-vars($tokens, $_custom-property-prefix);
27
- $tokens: shape.resolve-tokens($tokens, 'shape');
28
29
 
29
30
  :host {
30
31
  @each $token, $value in $tokens {
31
- --_#{$token}: #{$value};
32
+ --_#{$token}: var(--md-outlined-segmented-button-#{$token}, #{$value});
32
33
  }
34
+
35
+ // Support logical shape properties
36
+ --_shape-start-start: var(
37
+ --md-outlined-segmented-button-shape-start-start,
38
+ var(--_shape)
39
+ );
40
+ --_shape-start-end: var(
41
+ --md-outlined-segmented-button-shape-start-end,
42
+ var(--_shape)
43
+ );
44
+ --_shape-end-end: var(
45
+ --md-outlined-segmented-button-shape-end-end,
46
+ var(--_shape)
47
+ );
48
+ --_shape-end-start: var(
49
+ --md-outlined-segmented-button-shape-end-start,
50
+ var(--_shape)
51
+ );
33
52
  }
34
53
  }
@@ -3,10 +3,12 @@
3
3
  * Copyright 2022 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { ClassInfo } from 'lit/directives/class-map.js';
7
6
  import { SegmentedButtonSet } from './segmented-button-set.js';
8
- /** @soyCompatible */
7
+ /**
8
+ * TODO(b/265346443): add docs
9
+ */
9
10
  export declare class OutlinedSegmentedButtonSet extends SegmentedButtonSet {
10
- /** @soyTemplate */
11
- protected getRenderClasses(): ClassInfo;
11
+ protected getRenderClasses(): {
12
+ 'md3-segmented-button-set--outlined': boolean;
13
+ };
12
14
  }
@@ -4,9 +4,10 @@
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
6
  import { SegmentedButtonSet } from './segmented-button-set.js';
7
- /** @soyCompatible */
7
+ /**
8
+ * TODO(b/265346443): add docs
9
+ */
8
10
  export class OutlinedSegmentedButtonSet extends SegmentedButtonSet {
9
- /** @soyTemplate */
10
11
  getRenderClasses() {
11
12
  return {
12
13
  ...super.getRenderClasses(),
@@ -1 +1 @@
1
- {"version":3,"file":"outlined-segmented-button-set.js","sourceRoot":"","sources":["outlined-segmented-button-set.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAIH,OAAO,EAAC,kBAAkB,EAAC,MAAM,2BAA2B,CAAC;AAE7D,qBAAqB;AACrB,MAAM,OAAO,0BAA2B,SAAQ,kBAAkB;IAChE,mBAAmB;IACA,gBAAgB;QACjC,OAAO;YACL,GAAG,KAAK,CAAC,gBAAgB,EAAE;YAC3B,oCAAoC,EAAE,IAAI;SAC3C,CAAC;IACJ,CAAC;CACF","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {ClassInfo} from 'lit/directives/class-map.js';\n\nimport {SegmentedButtonSet} from './segmented-button-set.js';\n\n/** @soyCompatible */\nexport class OutlinedSegmentedButtonSet extends SegmentedButtonSet {\n /** @soyTemplate */\n protected override getRenderClasses(): ClassInfo {\n return {\n ...super.getRenderClasses(),\n 'md3-segmented-button-set--outlined': true,\n };\n }\n}"]}
1
+ {"version":3,"file":"outlined-segmented-button-set.js","sourceRoot":"","sources":["outlined-segmented-button-set.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,kBAAkB,EAAC,MAAM,2BAA2B,CAAC;AAE7D;;GAEG;AACH,MAAM,OAAO,0BAA2B,SAAQ,kBAAkB;IAC7C,gBAAgB;QACjC,OAAO;YACL,GAAG,KAAK,CAAC,gBAAgB,EAAE;YAC3B,oCAAoC,EAAE,IAAI;SAC3C,CAAC;IACJ,CAAC;CACF","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {SegmentedButtonSet} from './segmented-button-set.js';\n\n/**\n * TODO(b/265346443): add docs\n */\nexport class OutlinedSegmentedButtonSet extends SegmentedButtonSet {\n protected override getRenderClasses() {\n return {\n ...super.getRenderClasses(),\n 'md3-segmented-button-set--outlined': true,\n };\n }\n}\n"]}
@@ -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{--_shape-start-start: var(--md-segmented-button-shape-start-start, var(--md-segmented-button-shape, 9999px));--_shape-start-end: var(--md-segmented-button-shape-start-end, var(--md-segmented-button-shape, 9999px));--_shape-end-end: var(--md-segmented-button-shape-end-end, var(--md-segmented-button-shape, 9999px));--_shape-end-start: var(--md-segmented-button-shape-end-start, var(--md-segmented-button-shape, 9999px));--_container-height: var(--md-segmented-button-container-height, 40px);--_disabled-icon-color: var(--md-segmented-button-disabled-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-icon-opacity: var(--md-segmented-button-disabled-icon-opacity, 0.38);--_disabled-label-text-color: var(--md-segmented-button-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-segmented-button-disabled-label-text-opacity, 0.38);--_disabled-outline-color: var(--md-segmented-button-disabled-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-outline-opacity: var(--md-segmented-button-disabled-outline-opacity, 0.12);--_focus-state-layer-opacity: var(--md-segmented-button-focus-state-layer-opacity, 0.12);--_hover-state-layer-opacity: var(--md-segmented-button-hover-state-layer-opacity, 0.08);--_label-text-type: var(--md-segmented-button-label-text-type, var(--md-sys-typescale-label-large, 500 0.875rem / 1.25rem var(--md-ref-typeface-plain, Roboto)));--_outline-color: var(--md-segmented-button-outline-color, var(--md-sys-color-outline, #79747e));--_outline-width: var(--md-segmented-button-outline-width, 1px);--_pressed-state-layer-opacity: var(--md-segmented-button-pressed-state-layer-opacity, 0.12);--_selected-container-color: var(--md-segmented-button-selected-container-color, var(--md-sys-color-secondary-container, #e8def8));--_selected-focus-icon-color: var(--md-segmented-button-selected-focus-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-focus-label-text-color: var(--md-segmented-button-selected-focus-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-focus-state-layer-color: var(--md-segmented-button-selected-focus-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-icon-color: var(--md-segmented-button-selected-hover-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-label-text-color: var(--md-segmented-button-selected-hover-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-state-layer-color: var(--md-segmented-button-selected-hover-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-label-text-color: var(--md-segmented-button-selected-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-icon-color: var(--md-segmented-button-selected-pressed-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-label-text-color: var(--md-segmented-button-selected-pressed-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-state-layer-color: var(--md-segmented-button-selected-pressed-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-with-icon-icon-color: var(--md-segmented-button-selected-with-icon-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_unselected-focus-icon-color: var(--md-segmented-button-unselected-focus-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-focus-label-text-color: var(--md-segmented-button-unselected-focus-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-focus-state-layer-color: var(--md-segmented-button-unselected-focus-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-hover-icon-color: var(--md-segmented-button-unselected-hover-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-hover-label-text-color: var(--md-segmented-button-unselected-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-hover-state-layer-color: var(--md-segmented-button-unselected-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-label-text-color: var(--md-segmented-button-unselected-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-pressed-icon-color: var(--md-segmented-button-unselected-pressed-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-pressed-label-text-color: var(--md-segmented-button-unselected-pressed-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-pressed-state-layer-color: var(--md-segmented-button-unselected-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-with-icon-icon-color: var(--md-segmented-button-unselected-with-icon-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_with-icon-icon-size: var(--md-segmented-button-with-icon-icon-size, 18px)}/*# sourceMappingURL=outlined-styles.css.map */
7
+ export const styles = css `:host{--_container-height: var(--md-outlined-segmented-button-container-height, 40px);--_disabled-icon-color: var(--md-outlined-segmented-button-disabled-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-icon-opacity: var(--md-outlined-segmented-button-disabled-icon-opacity, 0.38);--_disabled-label-text-color: var(--md-outlined-segmented-button-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-outlined-segmented-button-disabled-label-text-opacity, 0.38);--_disabled-outline-color: var(--md-outlined-segmented-button-disabled-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-outline-opacity: var(--md-outlined-segmented-button-disabled-outline-opacity, 0.12);--_focus-state-layer-opacity: var(--md-outlined-segmented-button-focus-state-layer-opacity, 0.12);--_hover-state-layer-opacity: var(--md-outlined-segmented-button-hover-state-layer-opacity, 0.08);--_label-text-type: var(--md-outlined-segmented-button-label-text-type, var(--md-sys-typescale-label-large, 500 0.875rem / 1.25rem var(--md-ref-typeface-plain, Roboto)));--_outline-color: var(--md-outlined-segmented-button-outline-color, var(--md-sys-color-outline, #79747e));--_outline-width: var(--md-outlined-segmented-button-outline-width, 1px);--_pressed-state-layer-opacity: var(--md-outlined-segmented-button-pressed-state-layer-opacity, 0.12);--_selected-container-color: var(--md-outlined-segmented-button-selected-container-color, var(--md-sys-color-secondary-container, #e8def8));--_selected-focus-icon-color: var(--md-outlined-segmented-button-selected-focus-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-focus-label-text-color: var(--md-outlined-segmented-button-selected-focus-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-focus-state-layer-color: var(--md-outlined-segmented-button-selected-focus-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-icon-color: var(--md-outlined-segmented-button-selected-hover-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-label-text-color: var(--md-outlined-segmented-button-selected-hover-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-state-layer-color: var(--md-outlined-segmented-button-selected-hover-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-label-text-color: var(--md-outlined-segmented-button-selected-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-icon-color: var(--md-outlined-segmented-button-selected-pressed-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-label-text-color: var(--md-outlined-segmented-button-selected-pressed-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-state-layer-color: var(--md-outlined-segmented-button-selected-pressed-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-with-icon-icon-color: var(--md-outlined-segmented-button-selected-with-icon-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_shape: var(--md-outlined-segmented-button-shape, 9999px);--_unselected-focus-icon-color: var(--md-outlined-segmented-button-unselected-focus-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-focus-label-text-color: var(--md-outlined-segmented-button-unselected-focus-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-focus-state-layer-color: var(--md-outlined-segmented-button-unselected-focus-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-hover-icon-color: var(--md-outlined-segmented-button-unselected-hover-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-hover-label-text-color: var(--md-outlined-segmented-button-unselected-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-hover-state-layer-color: var(--md-outlined-segmented-button-unselected-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-label-text-color: var(--md-outlined-segmented-button-unselected-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-pressed-icon-color: var(--md-outlined-segmented-button-unselected-pressed-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-pressed-label-text-color: var(--md-outlined-segmented-button-unselected-pressed-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-pressed-state-layer-color: var(--md-outlined-segmented-button-unselected-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-with-icon-icon-color: var(--md-outlined-segmented-button-unselected-with-icon-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_with-icon-icon-size: var(--md-outlined-segmented-button-with-icon-icon-size, 18px);--_shape-start-start: var( --md-outlined-segmented-button-shape-start-start, var(--_shape) );--_shape-start-end: var( --md-outlined-segmented-button-shape-start-end, var(--_shape) );--_shape-end-end: var( --md-outlined-segmented-button-shape-end-end, var(--_shape) );--_shape-end-start: var( --md-outlined-segmented-button-shape-end-start, var(--_shape) )}/*# sourceMappingURL=outlined-styles.css.map */
8
8
  `;
9
9
  //# sourceMappingURL=outlined-styles.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"outlined-styles.css.js","sourceRoot":"","sources":["outlined-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{--_shape-start-start: var(--md-segmented-button-shape-start-start, var(--md-segmented-button-shape, 9999px));--_shape-start-end: var(--md-segmented-button-shape-start-end, var(--md-segmented-button-shape, 9999px));--_shape-end-end: var(--md-segmented-button-shape-end-end, var(--md-segmented-button-shape, 9999px));--_shape-end-start: var(--md-segmented-button-shape-end-start, var(--md-segmented-button-shape, 9999px));--_container-height: var(--md-segmented-button-container-height, 40px);--_disabled-icon-color: var(--md-segmented-button-disabled-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-icon-opacity: var(--md-segmented-button-disabled-icon-opacity, 0.38);--_disabled-label-text-color: var(--md-segmented-button-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-segmented-button-disabled-label-text-opacity, 0.38);--_disabled-outline-color: var(--md-segmented-button-disabled-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-outline-opacity: var(--md-segmented-button-disabled-outline-opacity, 0.12);--_focus-state-layer-opacity: var(--md-segmented-button-focus-state-layer-opacity, 0.12);--_hover-state-layer-opacity: var(--md-segmented-button-hover-state-layer-opacity, 0.08);--_label-text-type: var(--md-segmented-button-label-text-type, var(--md-sys-typescale-label-large, 500 0.875rem / 1.25rem var(--md-ref-typeface-plain, Roboto)));--_outline-color: var(--md-segmented-button-outline-color, var(--md-sys-color-outline, #79747e));--_outline-width: var(--md-segmented-button-outline-width, 1px);--_pressed-state-layer-opacity: var(--md-segmented-button-pressed-state-layer-opacity, 0.12);--_selected-container-color: var(--md-segmented-button-selected-container-color, var(--md-sys-color-secondary-container, #e8def8));--_selected-focus-icon-color: var(--md-segmented-button-selected-focus-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-focus-label-text-color: var(--md-segmented-button-selected-focus-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-focus-state-layer-color: var(--md-segmented-button-selected-focus-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-icon-color: var(--md-segmented-button-selected-hover-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-label-text-color: var(--md-segmented-button-selected-hover-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-state-layer-color: var(--md-segmented-button-selected-hover-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-label-text-color: var(--md-segmented-button-selected-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-icon-color: var(--md-segmented-button-selected-pressed-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-label-text-color: var(--md-segmented-button-selected-pressed-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-state-layer-color: var(--md-segmented-button-selected-pressed-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-with-icon-icon-color: var(--md-segmented-button-selected-with-icon-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_unselected-focus-icon-color: var(--md-segmented-button-unselected-focus-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-focus-label-text-color: var(--md-segmented-button-unselected-focus-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-focus-state-layer-color: var(--md-segmented-button-unselected-focus-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-hover-icon-color: var(--md-segmented-button-unselected-hover-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-hover-label-text-color: var(--md-segmented-button-unselected-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-hover-state-layer-color: var(--md-segmented-button-unselected-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-label-text-color: var(--md-segmented-button-unselected-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-pressed-icon-color: var(--md-segmented-button-unselected-pressed-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-pressed-label-text-color: var(--md-segmented-button-unselected-pressed-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-pressed-state-layer-color: var(--md-segmented-button-unselected-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-with-icon-icon-color: var(--md-segmented-button-unselected-with-icon-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_with-icon-icon-size: var(--md-segmented-button-with-icon-icon-size, 18px)}/*# sourceMappingURL=outlined-styles.css.map */\n`;\n "]}
1
+ {"version":3,"file":"outlined-styles.css.js","sourceRoot":"","sources":["outlined-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-height: var(--md-outlined-segmented-button-container-height, 40px);--_disabled-icon-color: var(--md-outlined-segmented-button-disabled-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-icon-opacity: var(--md-outlined-segmented-button-disabled-icon-opacity, 0.38);--_disabled-label-text-color: var(--md-outlined-segmented-button-disabled-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-label-text-opacity: var(--md-outlined-segmented-button-disabled-label-text-opacity, 0.38);--_disabled-outline-color: var(--md-outlined-segmented-button-disabled-outline-color, var(--md-sys-color-on-surface, #1d1b20));--_disabled-outline-opacity: var(--md-outlined-segmented-button-disabled-outline-opacity, 0.12);--_focus-state-layer-opacity: var(--md-outlined-segmented-button-focus-state-layer-opacity, 0.12);--_hover-state-layer-opacity: var(--md-outlined-segmented-button-hover-state-layer-opacity, 0.08);--_label-text-type: var(--md-outlined-segmented-button-label-text-type, var(--md-sys-typescale-label-large, 500 0.875rem / 1.25rem var(--md-ref-typeface-plain, Roboto)));--_outline-color: var(--md-outlined-segmented-button-outline-color, var(--md-sys-color-outline, #79747e));--_outline-width: var(--md-outlined-segmented-button-outline-width, 1px);--_pressed-state-layer-opacity: var(--md-outlined-segmented-button-pressed-state-layer-opacity, 0.12);--_selected-container-color: var(--md-outlined-segmented-button-selected-container-color, var(--md-sys-color-secondary-container, #e8def8));--_selected-focus-icon-color: var(--md-outlined-segmented-button-selected-focus-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-focus-label-text-color: var(--md-outlined-segmented-button-selected-focus-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-focus-state-layer-color: var(--md-outlined-segmented-button-selected-focus-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-icon-color: var(--md-outlined-segmented-button-selected-hover-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-label-text-color: var(--md-outlined-segmented-button-selected-hover-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-hover-state-layer-color: var(--md-outlined-segmented-button-selected-hover-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-label-text-color: var(--md-outlined-segmented-button-selected-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-icon-color: var(--md-outlined-segmented-button-selected-pressed-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-label-text-color: var(--md-outlined-segmented-button-selected-pressed-label-text-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-pressed-state-layer-color: var(--md-outlined-segmented-button-selected-pressed-state-layer-color, var(--md-sys-color-on-secondary-container, #1d192b));--_selected-with-icon-icon-color: var(--md-outlined-segmented-button-selected-with-icon-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_shape: var(--md-outlined-segmented-button-shape, 9999px);--_unselected-focus-icon-color: var(--md-outlined-segmented-button-unselected-focus-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-focus-label-text-color: var(--md-outlined-segmented-button-unselected-focus-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-focus-state-layer-color: var(--md-outlined-segmented-button-unselected-focus-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-hover-icon-color: var(--md-outlined-segmented-button-unselected-hover-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-hover-label-text-color: var(--md-outlined-segmented-button-unselected-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-hover-state-layer-color: var(--md-outlined-segmented-button-unselected-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-label-text-color: var(--md-outlined-segmented-button-unselected-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-pressed-icon-color: var(--md-outlined-segmented-button-unselected-pressed-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-pressed-label-text-color: var(--md-outlined-segmented-button-unselected-pressed-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-pressed-state-layer-color: var(--md-outlined-segmented-button-unselected-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_unselected-with-icon-icon-color: var(--md-outlined-segmented-button-unselected-with-icon-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_with-icon-icon-size: var(--md-outlined-segmented-button-with-icon-icon-size, 18px);--_shape-start-start: var( --md-outlined-segmented-button-shape-start-start, var(--_shape) );--_shape-start-end: var( --md-outlined-segmented-button-shape-start-end, var(--_shape) );--_shape-end-end: var( --md-outlined-segmented-button-shape-end-end, var(--_shape) );--_shape-end-start: var( --md-outlined-segmented-button-shape-end-start, var(--_shape) )}/*# sourceMappingURL=outlined-styles.css.map */\n`;\n "]}
@@ -3,19 +3,15 @@
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 { SegmentedButton } from '../../segmentedbutton/lib/segmented-button.js';
9
8
  /**
10
9
  * SegmentedButtonSet is the parent component for two or more
11
10
  * `SegmentedButton` components. **Only** `SegmentedButton` components may be
12
11
  * used as children.
13
- * @soyCompatible
14
12
  */
15
13
  export declare class SegmentedButtonSet extends LitElement {
16
14
  multiselect: boolean;
17
- /** @soyPrefixAttribute */
18
- ariaLabel: string;
19
15
  buttons: SegmentedButton[];
20
16
  getButtonDisabled(index: number): boolean;
21
17
  setButtonDisabled(index: number, disabled: boolean): void;
@@ -25,8 +21,6 @@ export declare class SegmentedButtonSet extends LitElement {
25
21
  private toggleSelection;
26
22
  private indexOutOfBounds;
27
23
  private emitSelectionEvent;
28
- /** @soyTemplate */
29
- render(): TemplateResult;
30
- /** @soyTemplate */
31
- protected getRenderClasses(): ClassInfo;
24
+ protected render(): import("lit-html").TemplateResult<1>;
25
+ protected getRenderClasses(): {};
32
26
  }
@@ -3,17 +3,15 @@
3
3
  * Copyright 2021 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
- import { __decorate, __metadata } from "tslib";
7
- import { html, LitElement } from 'lit';
6
+ var _a;
7
+ import { __decorate } from "tslib";
8
+ import { html, LitElement, nothing } from 'lit';
8
9
  import { property, queryAssignedElements } from 'lit/decorators.js';
9
- import { classMap } from 'lit/directives/class-map.js';
10
- import { ifDefined } from 'lit/directives/if-defined.js';
11
- import { ariaProperty } from '../../decorators/aria-property.js';
10
+ import { requestUpdateOnAriaChange } from '../../aria/delegate.js';
12
11
  /**
13
12
  * SegmentedButtonSet is the parent component for two or more
14
13
  * `SegmentedButton` components. **Only** `SegmentedButton` components may be
15
14
  * used as children.
16
- * @soyCompatible
17
15
  */
18
16
  export class SegmentedButtonSet extends LitElement {
19
17
  constructor() {
@@ -82,35 +80,31 @@ export class SegmentedButtonSet extends LitElement {
82
80
  composed: true
83
81
  }));
84
82
  }
85
- /** @soyTemplate */
86
83
  render() {
84
+ // Needed for closure conformance
85
+ const { ariaLabel } = this;
87
86
  return html `
88
87
  <span
89
88
  role="group"
90
89
  @segmented-button-interaction="${this.handleSegmentedButtonInteraction}"
91
- aria-label="${ifDefined(this.ariaLabel)}"
92
- class="md3-segmented-button-set ${classMap(this.getRenderClasses())}">
90
+ aria-label=${ariaLabel || nothing}
91
+ class="md3-segmented-button-set">
93
92
  <slot></slot>
94
93
  </span>
95
94
  `;
96
95
  }
97
- /** @soyTemplate */
98
96
  getRenderClasses() {
99
97
  return {};
100
98
  }
101
99
  }
100
+ _a = SegmentedButtonSet;
101
+ (() => {
102
+ requestUpdateOnAriaChange(_a);
103
+ })();
102
104
  __decorate([
103
- property({ type: Boolean }),
104
- __metadata("design:type", Object)
105
+ property({ type: Boolean })
105
106
  ], SegmentedButtonSet.prototype, "multiselect", void 0);
106
107
  __decorate([
107
- ariaProperty // tslint:disable-line:no-new-decorators
108
- ,
109
- property({ type: String, attribute: 'aria-label' }),
110
- __metadata("design:type", String)
111
- ], SegmentedButtonSet.prototype, "ariaLabel", void 0);
112
- __decorate([
113
- queryAssignedElements({ flatten: true }),
114
- __metadata("design:type", Array)
108
+ queryAssignedElements({ flatten: true })
115
109
  ], SegmentedButtonSet.prototype, "buttons", void 0);
116
110
  //# sourceMappingURL=segmented-button-set.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"segmented-button-set.js","sourceRoot":"","sources":["segmented-button-set.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;AAEH,OAAO,EAAC,IAAI,EAAE,UAAU,EAAiB,MAAM,KAAK,CAAC;AACrD,OAAO,EAAC,QAAQ,EAAE,qBAAqB,EAAC,MAAM,mBAAmB,CAAC;AAClE,OAAO,EAAY,QAAQ,EAAC,MAAM,6BAA6B,CAAC;AAChE,OAAO,EAAC,SAAS,EAAC,MAAM,8BAA8B,CAAC;AAEvD,OAAO,EAAC,YAAY,EAAC,MAAM,mCAAmC,CAAC;AAG/D;;;;;GAKG;AACH,MAAM,OAAO,kBAAmB,SAAQ,UAAU;IAAlD;;QAC6B,gBAAW,GA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B;QACxB,OAAO,EAAE,CAAC;IACZ,CAAC;CACF;AA3FC;IAAC,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;;uDAAqB;AAG/C;IAAC,YAAY,CAAE,wCAAwC;;IACtD,QAAQ,CAAC,EAAC,IAAI,EAAE,MAAM,EAAE,SAAS,EAAE,YAAY,EAAC,CAAC;;qDACtB;AAE5B;IAAC,qBAAqB,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;;mDAA6B","sourcesContent":["/**\n * @license\n * Copyright 2021 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {html, LitElement, TemplateResult} from 'lit';\nimport {property, 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 {SegmentedButton} from '../../segmentedbutton/lib/segmented-button.js';\n\n/**\n * SegmentedButtonSet is the parent component for two or more\n * `SegmentedButton` components. **Only** `SegmentedButton` components may be\n * used as children.\n * @soyCompatible\n */\nexport class SegmentedButtonSet extends LitElement {\n @property({type: Boolean}) multiselect = false;\n\n /** @soyPrefixAttribute */\n @ariaProperty // tslint:disable-line:no-new-decorators\n @property({type: String, attribute: 'aria-label'})\n override ariaLabel!: string;\n\n @queryAssignedElements({flatten: true}) buttons!: SegmentedButton[];\n\n getButtonDisabled(index: number): boolean {\n if (this.indexOutOfBounds(index)) return false;\n return this.buttons[index].disabled;\n }\n\n setButtonDisabled(index: number, disabled: boolean) {\n if (this.indexOutOfBounds(index)) return;\n this.buttons[index].disabled = disabled;\n }\n\n getButtonSelected(index: number): boolean {\n if (this.indexOutOfBounds(index)) return false;\n return this.buttons[index].selected;\n }\n\n setButtonSelected(index: number, selected: boolean) {\n // Ignore out-of-index values.\n if (this.indexOutOfBounds(index)) return;\n // Ignore disabled buttons.\n if (this.getButtonDisabled(index)) return;\n\n if (this.multiselect) {\n this.buttons[index].selected = selected;\n this.emitSelectionEvent(index);\n return;\n }\n\n // Single-select segmented buttons are not unselectable.\n if (!selected) return;\n\n this.buttons[index].selected = true;\n this.emitSelectionEvent(index);\n // Deselect all other buttons for single-select.\n for (let i = 0; i < this.buttons.length; i++) {\n if (i === index) continue;\n this.buttons[i].selected = false;\n }\n }\n\n private handleSegmentedButtonInteraction(e: CustomEvent) {\n const index = this.buttons.indexOf(e.target as SegmentedButton);\n this.toggleSelection(index);\n }\n\n private toggleSelection(index: number) {\n if (this.indexOutOfBounds(index)) return;\n this.setButtonSelected(index, !this.buttons[index].selected);\n }\n\n private indexOutOfBounds(index: number): boolean {\n return index < 0 || index >= this.buttons.length;\n }\n\n private emitSelectionEvent(index: number) {\n this.dispatchEvent(new CustomEvent('segmented-button-set-selection', {\n detail: {\n button: this.buttons[index],\n selected: this.buttons[index].selected,\n index,\n },\n bubbles: true,\n composed: true\n }));\n }\n\n /** @soyTemplate */\n override render(): TemplateResult {\n return html`\n <span\n role=\"group\"\n @segmented-button-interaction=\"${this.handleSegmentedButtonInteraction}\"\n aria-label=\"${ifDefined(this.ariaLabel)}\"\n class=\"md3-segmented-button-set ${classMap(this.getRenderClasses())}\">\n <slot></slot>\n </span>\n `;\n }\n\n /** @soyTemplate */\n protected getRenderClasses(): ClassInfo {\n return {};\n }\n}\n"]}
1
+ {"version":3,"file":"segmented-button-set.js","sourceRoot":"","sources":["segmented-button-set.ts"],"names":[],"mappings":"AAAA;;;;GAIG;;;AAEH,OAAO,EAAC,IAAI,EAAE,UAAU,EAAE,OAAO,EAAC,MAAM,KAAK,CAAC;AAC9C,OAAO,EAAC,QAAQ,EAAE,qBAAqB,EAAC,MAAM,mBAAmB,CAAC;AAElE,OAAO,EAAC,yBAAyB,EAAC,MAAM,wBAAwB,CAAC;AAIjE;;;;GAIG;AACH,MAAM,OAAO,kBAAmB,SAAQ,UAAU;IAAlD;;QAK6B,gBAAW,GAAG,KAAK,CAAC;IAsFjD,CAAC;IAlFC,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,CAAC,EAAI,CAAC,CAAC;AAClC,CAAC,GAAA,CAAA;AAE0B;IAA1B,QAAQ,CAAC,EAAC,IAAI,EAAE,OAAO,EAAC,CAAC;uDAAqB;AAEP;IAAvC,qBAAqB,CAAC,EAAC,OAAO,EAAE,IAAI,EAAC,CAAC;mDAA6B","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, queryAssignedElements} from 'lit/decorators.js';\n\nimport {requestUpdateOnAriaChange} from '../../aria/delegate.js';\nimport {SegmentedButton} from '../../segmentedbutton/lib/segmented-button.js';\nimport {ARIAMixinStrict} from '../../types/aria.js';\n\n/**\n * SegmentedButtonSet is the parent component for two or more\n * `SegmentedButton` components. **Only** `SegmentedButton` components may be\n * used as children.\n */\nexport class SegmentedButtonSet extends LitElement {\n static {\n requestUpdateOnAriaChange(this);\n }\n\n @property({type: Boolean}) multiselect = false;\n\n @queryAssignedElements({flatten: true}) buttons!: SegmentedButton[];\n\n getButtonDisabled(index: number): boolean {\n if (this.indexOutOfBounds(index)) return false;\n return this.buttons[index].disabled;\n }\n\n setButtonDisabled(index: number, disabled: boolean) {\n if (this.indexOutOfBounds(index)) return;\n this.buttons[index].disabled = disabled;\n }\n\n getButtonSelected(index: number): boolean {\n if (this.indexOutOfBounds(index)) return false;\n return this.buttons[index].selected;\n }\n\n setButtonSelected(index: number, selected: boolean) {\n // Ignore out-of-index values.\n if (this.indexOutOfBounds(index)) return;\n // Ignore disabled buttons.\n if (this.getButtonDisabled(index)) return;\n\n if (this.multiselect) {\n this.buttons[index].selected = selected;\n this.emitSelectionEvent(index);\n return;\n }\n\n // Single-select segmented buttons are not unselectable.\n if (!selected) return;\n\n this.buttons[index].selected = true;\n this.emitSelectionEvent(index);\n // Deselect all other buttons for single-select.\n for (let i = 0; i < this.buttons.length; i++) {\n if (i === index) continue;\n this.buttons[i].selected = false;\n }\n }\n\n private handleSegmentedButtonInteraction(e: CustomEvent) {\n const index = this.buttons.indexOf(e.target as SegmentedButton);\n this.toggleSelection(index);\n }\n\n private toggleSelection(index: number) {\n if (this.indexOutOfBounds(index)) return;\n this.setButtonSelected(index, !this.buttons[index].selected);\n }\n\n private indexOutOfBounds(index: number): boolean {\n return index < 0 || index >= this.buttons.length;\n }\n\n private emitSelectionEvent(index: number) {\n this.dispatchEvent(new CustomEvent('segmented-button-set-selection', {\n detail: {\n button: this.buttons[index],\n selected: this.buttons[index].selected,\n index,\n },\n bubbles: true,\n composed: true\n }));\n }\n\n protected override render() {\n // Needed for closure conformance\n const {ariaLabel} = this as ARIAMixinStrict;\n return html`\n <span\n role=\"group\"\n @segmented-button-interaction=\"${this.handleSegmentedButtonInteraction}\"\n aria-label=${ariaLabel || nothing}\n class=\"md3-segmented-button-set\">\n <slot></slot>\n </span>\n `;\n }\n\n protected getRenderClasses() {\n return {};\n }\n}\n"]}
@@ -12,7 +12,6 @@ declare global {
12
12
  /**
13
13
  * MdOutlinedSegmentedButtonSet is the custom element for the Material
14
14
  * Design outlined segmented button set component.
15
- * @soyCompatible
16
15
  * @final
17
16
  * @suppress {visibility}
18
17
  */
@@ -11,7 +11,6 @@ import { styles as sharedStyles } from './lib/shared-styles.css.js';
11
11
  /**
12
12
  * MdOutlinedSegmentedButtonSet is the custom element for the Material
13
13
  * Design outlined segmented button set component.
14
- * @soyCompatible
15
14
  * @final
16
15
  * @suppress {visibility}
17
16
  */