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

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (381) hide show
  1. package/README.md +26 -21
  2. package/all.d.ts +4 -2
  3. package/all.js +4 -2
  4. package/all.js.map +1 -1
  5. package/button/internal/_elevation.scss +4 -0
  6. package/button/internal/_filled-button.scss +0 -1
  7. package/button/internal/_outlined-button.scss +6 -0
  8. package/button/internal/_shared.scss +12 -2
  9. package/button/internal/button.d.ts +15 -14
  10. package/button/internal/button.js +41 -39
  11. package/button/internal/button.js.map +1 -1
  12. package/button/internal/elevated-styles.css.js +1 -1
  13. package/button/internal/elevated-styles.css.js.map +1 -1
  14. package/button/internal/filled-styles.css.js +1 -1
  15. package/button/internal/filled-styles.css.js.map +1 -1
  16. package/button/internal/filled-tonal-styles.css.js +1 -1
  17. package/button/internal/filled-tonal-styles.css.js.map +1 -1
  18. package/button/internal/outlined-styles.css.js +1 -1
  19. package/button/internal/outlined-styles.css.js.map +1 -1
  20. package/button/internal/shared-elevation-styles.css.js +1 -1
  21. package/button/internal/shared-elevation-styles.css.js.map +1 -1
  22. package/button/internal/shared-styles.css.js +1 -1
  23. package/button/internal/shared-styles.css.js.map +1 -1
  24. package/button/internal/text-styles.css.js +1 -1
  25. package/button/internal/text-styles.css.js.map +1 -1
  26. package/checkbox/internal/_checkbox.scss +2 -1
  27. package/checkbox/internal/checkbox-styles.css.js +1 -1
  28. package/checkbox/internal/checkbox-styles.css.js.map +1 -1
  29. package/checkbox/internal/checkbox.d.ts +2 -2
  30. package/checkbox/internal/checkbox.js +18 -14
  31. package/checkbox/internal/checkbox.js.map +1 -1
  32. package/chips/assist-chip.js +1 -2
  33. package/chips/assist-chip.js.map +1 -1
  34. package/chips/filter-chip.js +1 -3
  35. package/chips/filter-chip.js.map +1 -1
  36. package/chips/input-chip.js +1 -5
  37. package/chips/input-chip.js.map +1 -1
  38. package/chips/internal/_assist-chip.scss +6 -0
  39. package/chips/internal/_elevated.scss +1 -5
  40. package/chips/internal/_filter-chip.scss +6 -0
  41. package/chips/internal/_input-chip.scss +32 -0
  42. package/chips/internal/_selectable.scss +17 -13
  43. package/chips/internal/_shared.scss +27 -11
  44. package/chips/internal/_suggestion-chip.scss +6 -0
  45. package/chips/internal/_trailing-icon.scss +24 -24
  46. package/chips/internal/assist-chip.d.ts +3 -1
  47. package/chips/internal/assist-chip.js +11 -8
  48. package/chips/internal/assist-chip.js.map +1 -1
  49. package/chips/internal/assist-styles.css.js +1 -1
  50. package/chips/internal/assist-styles.css.js.map +1 -1
  51. package/chips/internal/chip.d.ts +18 -10
  52. package/chips/internal/chip.js +38 -33
  53. package/chips/internal/chip.js.map +1 -1
  54. package/chips/internal/elevated-styles.css.js +1 -1
  55. package/chips/internal/elevated-styles.css.js.map +1 -1
  56. package/chips/internal/filter-chip.d.ts +6 -7
  57. package/chips/internal/filter-chip.js +13 -14
  58. package/chips/internal/filter-chip.js.map +1 -1
  59. package/chips/internal/filter-styles.css.js +1 -1
  60. package/chips/internal/filter-styles.css.js.map +1 -1
  61. package/chips/internal/input-chip.d.ts +4 -2
  62. package/chips/internal/input-chip.js +16 -12
  63. package/chips/internal/input-chip.js.map +1 -1
  64. package/chips/internal/input-styles.css.js +1 -1
  65. package/chips/internal/input-styles.css.js.map +1 -1
  66. package/chips/internal/multi-action-chip.d.ts +2 -3
  67. package/chips/internal/multi-action-chip.js +3 -3
  68. package/chips/internal/multi-action-chip.js.map +1 -1
  69. package/chips/internal/selectable-styles.css.js +1 -1
  70. package/chips/internal/selectable-styles.css.js.map +1 -1
  71. package/chips/internal/shared-styles.css.js +1 -1
  72. package/chips/internal/shared-styles.css.js.map +1 -1
  73. package/chips/internal/suggestion-styles.css.js +1 -1
  74. package/chips/internal/suggestion-styles.css.js.map +1 -1
  75. package/chips/internal/trailing-icon-styles.css.js +1 -1
  76. package/chips/internal/trailing-icon-styles.css.js.map +1 -1
  77. package/chips/suggestion-chip.js +1 -2
  78. package/chips/suggestion-chip.js.map +1 -1
  79. package/color/_color.scss +193 -0
  80. package/common.d.ts +2 -2
  81. package/common.js +2 -2
  82. package/common.js.map +1 -1
  83. package/dialog/internal/_dialog.scss +19 -4
  84. package/dialog/internal/dialog-styles.css.js +1 -1
  85. package/dialog/internal/dialog-styles.css.js.map +1 -1
  86. package/dialog/internal/dialog.d.ts +6 -0
  87. package/dialog/internal/dialog.js +36 -4
  88. package/dialog/internal/dialog.js.map +1 -1
  89. package/elevation/internal/_elevation.scss +14 -7
  90. package/elevation/internal/elevation-styles.css.js +1 -1
  91. package/elevation/internal/elevation-styles.css.js.map +1 -1
  92. package/elevation/internal/elevation.d.ts +1 -0
  93. package/elevation/internal/elevation.js +6 -0
  94. package/elevation/internal/elevation.js.map +1 -1
  95. package/fab/branded-fab.d.ts +0 -1
  96. package/fab/internal/_fab.scss +11 -10
  97. package/fab/internal/_shared.scss +8 -2
  98. package/fab/internal/fab-branded-styles.css.js +1 -1
  99. package/fab/internal/fab-branded-styles.css.js.map +1 -1
  100. package/fab/internal/fab-styles.css.js +1 -1
  101. package/fab/internal/fab-styles.css.js.map +1 -1
  102. package/fab/internal/fab.d.ts +0 -1
  103. package/fab/internal/shared-styles.css.js +1 -1
  104. package/fab/internal/shared-styles.css.js.map +1 -1
  105. package/fab/internal/shared.d.ts +0 -9
  106. package/fab/internal/shared.js +2 -18
  107. package/fab/internal/shared.js.map +1 -1
  108. package/field/internal/_content.scss +9 -1
  109. package/field/internal/_filled-field.scss +12 -0
  110. package/field/internal/_label.scss +4 -1
  111. package/field/internal/_outlined-field.scss +33 -0
  112. package/field/internal/_shared.scss +14 -6
  113. package/field/internal/_supporting-text.scss +4 -1
  114. package/field/internal/field.d.ts +2 -0
  115. package/field/internal/field.js +19 -0
  116. package/field/internal/field.js.map +1 -1
  117. package/field/internal/filled-styles.css.js +1 -1
  118. package/field/internal/filled-styles.css.js.map +1 -1
  119. package/field/internal/outlined-styles.css.js +1 -1
  120. package/field/internal/outlined-styles.css.js.map +1 -1
  121. package/field/internal/shared-styles.css.js +1 -1
  122. package/field/internal/shared-styles.css.js.map +1 -1
  123. package/focus/internal/focus-ring.d.ts +3 -1
  124. package/focus/internal/focus-ring.js +9 -0
  125. package/focus/internal/focus-ring.js.map +1 -1
  126. package/icon/internal/_icon.scss +10 -5
  127. package/icon/internal/icon-styles.css.js +1 -1
  128. package/icon/internal/icon-styles.css.js.map +1 -1
  129. package/icon/internal/icon.js +4 -0
  130. package/icon/internal/icon.js.map +1 -1
  131. package/iconbutton/internal/_icon-button.scss +12 -0
  132. package/iconbutton/internal/_shared.scss +9 -0
  133. package/iconbutton/internal/icon-button.d.ts +19 -6
  134. package/iconbutton/internal/icon-button.js +35 -11
  135. package/iconbutton/internal/icon-button.js.map +1 -1
  136. package/iconbutton/internal/shared-styles.css.js +1 -1
  137. package/iconbutton/internal/shared-styles.css.js.map +1 -1
  138. package/iconbutton/internal/standard-styles.css.js +1 -1
  139. package/iconbutton/internal/standard-styles.css.js.map +1 -1
  140. package/internal/aria/aria.d.ts +52 -1
  141. package/internal/aria/aria.js +146 -0
  142. package/internal/aria/aria.js.map +1 -1
  143. package/internal/controller/attachable-controller.d.ts +5 -4
  144. package/internal/controller/attachable-controller.js +8 -0
  145. package/internal/controller/attachable-controller.js.map +1 -1
  146. package/internal/controller/form-submitter.d.ts +12 -0
  147. package/internal/controller/form-submitter.js +3 -1
  148. package/internal/controller/form-submitter.js.map +1 -1
  149. package/labs/badge/internal/_badge.scss +16 -9
  150. package/labs/badge/internal/badge-styles.css.js +1 -1
  151. package/labs/badge/internal/badge-styles.css.js.map +1 -1
  152. package/labs/navigationbar/internal/_navigation-bar.scss +11 -9
  153. package/labs/navigationbar/internal/navigation-bar-styles.css.js +1 -1
  154. package/labs/navigationbar/internal/navigation-bar-styles.css.js.map +1 -1
  155. package/labs/navigationdrawer/internal/_navigation-drawer-modal.scss +11 -8
  156. package/labs/navigationdrawer/internal/_navigation-drawer.scss +11 -8
  157. package/labs/navigationdrawer/internal/navigation-drawer-modal-styles.css.js +1 -1
  158. package/labs/navigationdrawer/internal/navigation-drawer-modal-styles.css.js.map +1 -1
  159. package/labs/navigationdrawer/internal/navigation-drawer-styles.css.js +1 -1
  160. package/labs/navigationdrawer/internal/navigation-drawer-styles.css.js.map +1 -1
  161. package/labs/navigationtab/internal/_navigation-tab.scss +14 -11
  162. package/labs/navigationtab/internal/navigation-tab-styles.css.js +1 -1
  163. package/labs/navigationtab/internal/navigation-tab-styles.css.js.map +1 -1
  164. package/labs/segmentedbutton/internal/_outlined-segmented-button.scss +1 -3
  165. package/labs/segmentedbutton/internal/_shared.scss +4 -1
  166. package/labs/segmentedbutton/internal/outlined-styles.css.js +1 -1
  167. package/labs/segmentedbutton/internal/outlined-styles.css.js.map +1 -1
  168. package/labs/segmentedbutton/internal/shared-styles.css.js +1 -1
  169. package/labs/segmentedbutton/internal/shared-styles.css.js.map +1 -1
  170. package/labs/segmentedbuttonset/internal/outlined-styles.css.js +1 -1
  171. package/labs/segmentedbuttonset/internal/outlined-styles.css.js.map +1 -1
  172. package/list/harness.js +1 -1
  173. package/list/harness.js.map +1 -1
  174. package/list/internal/_list.scss +7 -6
  175. package/list/internal/list-styles.css.js +1 -1
  176. package/list/internal/list-styles.css.js.map +1 -1
  177. package/list/internal/list.d.ts +1 -2
  178. package/list/internal/list.js +4 -6
  179. package/list/internal/list.js.map +1 -1
  180. package/list/internal/listitem/_list-item.scss +96 -94
  181. package/list/internal/listitem/forced-colors-styles.css.js +1 -1
  182. package/list/internal/listitem/forced-colors-styles.css.js.map +1 -1
  183. package/list/internal/listitem/forced-colors-styles.scss +6 -6
  184. package/list/internal/listitem/list-item-styles.css.js +1 -1
  185. package/list/internal/listitem/list-item-styles.css.js.map +1 -1
  186. package/menu/harness.d.ts +1 -1
  187. package/menu/harness.js +3 -4
  188. package/menu/harness.js.map +1 -1
  189. package/menu/internal/_menu.scss +37 -28
  190. package/menu/internal/menu-styles.css.js +1 -1
  191. package/menu/internal/menu-styles.css.js.map +1 -1
  192. package/menu/internal/menu.d.ts +15 -4
  193. package/menu/internal/menu.js +33 -10
  194. package/menu/internal/menu.js.map +1 -1
  195. package/menu/internal/menuitem/_menu-item.scss +7 -4
  196. package/menu/internal/menuitem/menu-item-styles.css.js +1 -1
  197. package/menu/internal/menuitem/menu-item-styles.css.js.map +1 -1
  198. package/menu/internal/menuitem/menu-item.js +1 -1
  199. package/menu/internal/menuitem/menu-item.js.map +1 -1
  200. package/menu/internal/submenuitem/sub-menu-item.d.ts +3 -0
  201. package/menu/internal/submenuitem/sub-menu-item.js +42 -12
  202. package/menu/internal/submenuitem/sub-menu-item.js.map +1 -1
  203. package/menu/internal/typeaheadController.js +2 -1
  204. package/menu/internal/typeaheadController.js.map +1 -1
  205. package/menu/menu.d.ts +12 -5
  206. package/menu/menu.js +12 -5
  207. package/menu/menu.js.map +1 -1
  208. package/menu/sub-menu-item.d.ts +3 -4
  209. package/menu/sub-menu-item.js +3 -4
  210. package/menu/sub-menu-item.js.map +1 -1
  211. package/package.json +10 -2
  212. package/progress/harness.js +2 -4
  213. package/progress/harness.js.map +1 -1
  214. package/progress/internal/_circular-progress.scss +8 -6
  215. package/progress/internal/_linear-progress.scss +95 -134
  216. package/progress/internal/circular-progress-styles.css.js +1 -1
  217. package/progress/internal/circular-progress-styles.css.js.map +1 -1
  218. package/progress/internal/circular-progress.js +1 -1
  219. package/progress/internal/circular-progress.js.map +1 -1
  220. package/progress/internal/linear-progress-styles.css.js +1 -1
  221. package/progress/internal/linear-progress-styles.css.js.map +1 -1
  222. package/progress/internal/linear-progress.d.ts +0 -11
  223. package/progress/internal/linear-progress.js +4 -48
  224. package/progress/internal/linear-progress.js.map +1 -1
  225. package/radio/harness.d.ts +1 -1
  226. package/radio/harness.js +1 -1
  227. package/radio/harness.js.map +1 -1
  228. package/radio/internal/_radio.scss +4 -4
  229. package/radio/internal/radio-styles.css.js +1 -1
  230. package/radio/internal/radio-styles.css.js.map +1 -1
  231. package/radio/internal/radio.d.ts +4 -6
  232. package/radio/internal/radio.js +37 -32
  233. package/radio/internal/radio.js.map +1 -1
  234. package/radio/internal/single-selection-controller.js +4 -3
  235. package/radio/internal/single-selection-controller.js.map +1 -1
  236. package/ripple/internal/_ripple.scss +1 -1
  237. package/ripple/internal/ripple-styles.css.js +1 -1
  238. package/ripple/internal/ripple-styles.css.js.map +1 -1
  239. package/ripple/internal/ripple.d.ts +3 -1
  240. package/ripple/internal/ripple.js +9 -0
  241. package/ripple/internal/ripple.js.map +1 -1
  242. package/select/harness.d.ts +1 -1
  243. package/select/harness.js +1 -3
  244. package/select/harness.js.map +1 -1
  245. package/select/internal/_filled-select.scss +13 -4
  246. package/select/internal/_outlined-select.scss +13 -4
  247. package/select/internal/_shared.scss +0 -1
  248. package/select/internal/filled-select-styles.css.js +1 -1
  249. package/select/internal/filled-select-styles.css.js.map +1 -1
  250. package/select/internal/outlined-select-styles.css.js +1 -1
  251. package/select/internal/outlined-select-styles.css.js.map +1 -1
  252. package/select/internal/select.d.ts +8 -2
  253. package/select/internal/select.js +21 -8
  254. package/select/internal/select.js.map +1 -1
  255. package/slider/internal/_slider.scss +42 -32
  256. package/slider/internal/forced-colors-styles.css.js +1 -1
  257. package/slider/internal/forced-colors-styles.css.js.map +1 -1
  258. package/slider/internal/forced-colors-styles.scss +31 -4
  259. package/slider/internal/slider-styles.css.js +1 -1
  260. package/slider/internal/slider-styles.css.js.map +1 -1
  261. package/slider/internal/slider.d.ts +22 -8
  262. package/slider/internal/slider.js +113 -22
  263. package/slider/internal/slider.js.map +1 -1
  264. package/switch/harness.d.ts +1 -1
  265. package/switch/harness.js +1 -1
  266. package/switch/harness.js.map +1 -1
  267. package/switch/internal/_handle.scss +22 -21
  268. package/switch/internal/_icon.scss +12 -12
  269. package/switch/internal/_switch.scss +17 -17
  270. package/switch/internal/_track.scss +12 -12
  271. package/switch/internal/forced-colors-styles.css.js +1 -1
  272. package/switch/internal/forced-colors-styles.css.js.map +1 -1
  273. package/switch/internal/forced-colors-styles.scss +1 -0
  274. package/switch/internal/switch-styles.css.js +1 -1
  275. package/switch/internal/switch-styles.css.js.map +1 -1
  276. package/switch/internal/switch.d.ts +73 -3
  277. package/switch/internal/switch.js +146 -32
  278. package/switch/internal/switch.js.map +1 -1
  279. package/tabs/{_tab.scss → _primary-tab.scss} +1 -1
  280. package/tabs/_secondary-tab.scss +6 -0
  281. package/tabs/harness.d.ts +2 -2
  282. package/tabs/harness.js +1 -2
  283. package/tabs/harness.js.map +1 -1
  284. package/tabs/internal/_primary-tab.scss +70 -0
  285. package/tabs/internal/_secondary-tab.scss +61 -0
  286. package/tabs/internal/_tab.scss +21 -114
  287. package/tabs/internal/_tabs.scss +9 -10
  288. package/tabs/internal/primary-tab-styles.css.js +9 -0
  289. package/tabs/internal/primary-tab-styles.css.js.map +1 -0
  290. package/tabs/internal/primary-tab-styles.scss +10 -0
  291. package/tabs/internal/primary-tab.d.ts +20 -0
  292. package/tabs/internal/primary-tab.js +30 -0
  293. package/tabs/internal/primary-tab.js.map +1 -0
  294. package/tabs/internal/secondary-tab-styles.css.js +9 -0
  295. package/tabs/internal/secondary-tab-styles.css.js.map +1 -0
  296. package/tabs/internal/secondary-tab-styles.scss +10 -0
  297. package/tabs/internal/secondary-tab.d.ts +12 -0
  298. package/tabs/internal/secondary-tab.js +16 -0
  299. package/tabs/internal/secondary-tab.js.map +1 -0
  300. package/tabs/internal/tab-styles.css.js +1 -1
  301. package/tabs/internal/tab-styles.css.js.map +1 -1
  302. package/tabs/internal/tab.d.ts +16 -34
  303. package/tabs/internal/tab.js +81 -81
  304. package/tabs/internal/tab.js.map +1 -1
  305. package/tabs/internal/tabs-styles.css.js +1 -1
  306. package/tabs/internal/tabs-styles.css.js.map +1 -1
  307. package/tabs/internal/tabs.d.ts +6 -20
  308. package/tabs/internal/tabs.js +33 -66
  309. package/tabs/internal/tabs.js.map +1 -1
  310. package/tabs/{tab.d.ts → primary-tab.d.ts} +3 -4
  311. package/tabs/primary-tab.js +23 -0
  312. package/tabs/primary-tab.js.map +1 -0
  313. package/tabs/secondary-tab.d.ts +18 -0
  314. package/tabs/secondary-tab.js +23 -0
  315. package/tabs/secondary-tab.js.map +1 -0
  316. package/tabs/tabs.d.ts +0 -2
  317. package/tabs/tabs.js +0 -2
  318. package/tabs/tabs.js.map +1 -1
  319. package/textfield/internal/_filled-text-field.scss +12 -3
  320. package/textfield/internal/_outlined-text-field.scss +12 -3
  321. package/textfield/internal/filled-styles.css.js +1 -1
  322. package/textfield/internal/filled-styles.css.js.map +1 -1
  323. package/textfield/internal/outlined-styles.css.js +1 -1
  324. package/textfield/internal/outlined-styles.css.js.map +1 -1
  325. package/textfield/internal/text-field.d.ts +30 -10
  326. package/textfield/internal/text-field.js +80 -32
  327. package/textfield/internal/text-field.js.map +1 -1
  328. package/tokens/_index.scss +5 -6
  329. package/tokens/_md-comp-assist-chip.scss +6 -14
  330. package/tokens/_md-comp-badge.scss +1 -14
  331. package/tokens/{_md-comp-circular-progress-indicator.scss → _md-comp-circular-progress.scss} +3 -1
  332. package/tokens/_md-comp-dialog.scss +10 -17
  333. package/tokens/_md-comp-elevated-button.scss +5 -13
  334. package/tokens/_md-comp-fab-branded.scss +9 -10
  335. package/tokens/_md-comp-fab.scss +9 -10
  336. package/tokens/_md-comp-filled-button.scss +5 -13
  337. package/tokens/_md-comp-filled-field.scss +27 -8
  338. package/tokens/_md-comp-filled-select.scss +18 -15
  339. package/tokens/_md-comp-filled-text-field.scss +17 -19
  340. package/tokens/_md-comp-filled-tonal-button.scss +5 -13
  341. package/tokens/_md-comp-filter-chip.scss +5 -13
  342. package/tokens/_md-comp-input-chip.scss +5 -13
  343. package/tokens/_md-comp-list-item.scss +117 -122
  344. package/tokens/_md-comp-menu-item.scss +3 -3
  345. package/tokens/_md-comp-outlined-button.scss +5 -13
  346. package/tokens/_md-comp-outlined-field.scss +27 -7
  347. package/tokens/_md-comp-outlined-segmented-button.scss +5 -13
  348. package/tokens/_md-comp-outlined-select.scss +23 -15
  349. package/tokens/_md-comp-outlined-text-field.scss +17 -19
  350. package/tokens/_md-comp-primary-tab.scss +132 -0
  351. package/tokens/_md-comp-secondary-tab.scss +139 -0
  352. package/tokens/_md-comp-slider.scss +16 -16
  353. package/tokens/_md-comp-suggestion-chip.scss +5 -13
  354. package/tokens/_md-comp-test-table.scss +13 -2
  355. package/tokens/_md-comp-text-button.scss +5 -13
  356. package/tokens/_md-ref-palette.scss +101 -1
  357. package/tokens/_md-ref-typeface.scss +3 -0
  358. package/tokens/_md-sys-color.scss +57 -2
  359. package/tokens/_md-sys-typescale.scss +66 -5
  360. package/chips/internal/assist-forced-colors-styles.css.js +0 -9
  361. package/chips/internal/assist-forced-colors-styles.css.js.map +0 -1
  362. package/chips/internal/assist-forced-colors-styles.scss +0 -27
  363. package/chips/internal/filter-forced-colors-styles.css.js +0 -9
  364. package/chips/internal/filter-forced-colors-styles.css.js.map +0 -1
  365. package/chips/internal/filter-forced-colors-styles.scss +0 -34
  366. package/chips/internal/input-forced-colors-styles.css.d.ts +0 -1
  367. package/chips/internal/input-forced-colors-styles.css.js +0 -9
  368. package/chips/internal/input-forced-colors-styles.css.js.map +0 -1
  369. package/chips/internal/input-forced-colors-styles.scss +0 -39
  370. package/chips/internal/suggestion-forced-colors-styles.css.d.ts +0 -1
  371. package/chips/internal/suggestion-forced-colors-styles.css.js +0 -9
  372. package/chips/internal/suggestion-forced-colors-styles.css.js.map +0 -1
  373. package/chips/internal/suggestion-forced-colors-styles.scss +0 -27
  374. package/internal/sass/_theme.scss +0 -249
  375. package/tabs/tab.js +0 -22
  376. package/tabs/tab.js.map +0 -1
  377. package/tokens/_md-comp-tab.scss +0 -285
  378. /package/{chips/internal/assist-forced-colors-styles.css.d.ts → tabs/internal/primary-tab-styles.css.d.ts} +0 -0
  379. /package/{chips/internal/filter-forced-colors-styles.css.d.ts → tabs/internal/secondary-tab-styles.css.d.ts} +0 -0
  380. /package/tokens/{_md-comp-linear-progress-indicator.scss → _md-comp-linear-progress.scss} +0 -0
  381. /package/tokens/{_md-comp-radio-button.scss → _md-comp-radio.scss} +0 -0
@@ -3,6 +3,7 @@
3
3
  * Copyright 2023 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
+ import { ReactiveElement } from 'lit';
6
7
  /**
7
8
  * Accessibility Object Model reflective aria property name types.
8
9
  */
@@ -18,7 +19,7 @@ export type ARIAAttribute = ARIAPropertyToAttribute<ARIAProperty>;
18
19
  /**
19
20
  * Accessibility Object Model aria attributes.
20
21
  */
21
- export declare const ARIA_ATTRIBUTES: ("aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-current" | "aria-disabled" | "aria-expanded" | "aria-haspopup" | "aria-hidden" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext")[];
22
+ export declare const ARIA_ATTRIBUTES: ("aria-hidden" | "aria-atomic" | "aria-autocomplete" | "aria-busy" | "aria-checked" | "aria-colcount" | "aria-colindex" | "aria-colindextext" | "aria-colspan" | "aria-current" | "aria-disabled" | "aria-expanded" | "aria-haspopup" | "aria-invalid" | "aria-keyshortcuts" | "aria-label" | "aria-level" | "aria-live" | "aria-modal" | "aria-multiline" | "aria-multiselectable" | "aria-orientation" | "aria-placeholder" | "aria-posinset" | "aria-pressed" | "aria-readonly" | "aria-required" | "aria-roledescription" | "aria-rowcount" | "aria-rowindex" | "aria-rowindextext" | "aria-rowspan" | "aria-selected" | "aria-setsize" | "aria-sort" | "aria-valuemax" | "aria-valuemin" | "aria-valuenow" | "aria-valuetext")[];
22
23
  /**
23
24
  * Checks if an attribute is one of the AOM aria attributes.
24
25
  *
@@ -100,4 +101,54 @@ export interface ARIAMixinStrict extends ARIAMixin {
100
101
  * Valid values for `role`.
101
102
  */
102
103
  export type ARIARole = 'alert' | 'alertdialog' | 'button' | 'checkbox' | 'dialog' | 'gridcell' | 'link' | 'log' | 'marquee' | 'menuitem' | 'menuitemcheckbox' | 'menuitemradio' | 'option' | 'progressbar' | 'radio' | 'scrollbar' | 'searchbox' | 'slider' | 'spinbutton' | 'status' | 'switch' | 'tab' | 'tabpanel' | 'textbox' | 'timer' | 'tooltip' | 'treeitem' | 'combobox' | 'grid' | 'listbox' | 'menu' | 'menubar' | 'radiogroup' | 'tablist' | 'tree' | 'treegrid' | 'application' | 'article' | 'cell' | 'columnheader' | 'definition' | 'directory' | 'document' | 'feed' | 'figure' | 'group' | 'heading' | 'img' | 'list' | 'listitem' | 'math' | 'none' | 'note' | 'presentation' | 'region' | 'row' | 'rowgroup' | 'rowheader' | 'separator' | 'table' | 'term' | 'text' | 'toolbar' | 'banner' | 'complementary' | 'contentinfo' | 'form' | 'main' | 'navigation' | 'region' | 'search' | 'doc-abstract' | 'doc-acknowledgments' | 'doc-afterword' | 'doc-appendix' | 'doc-backlink' | 'doc-biblioentry' | 'doc-bibliography' | 'doc-biblioref' | 'doc-chapter' | 'doc-colophon' | 'doc-conclusion' | 'doc-cover' | 'doc-credit' | 'doc-credits' | 'doc-dedication' | 'doc-endnote' | 'doc-endnotes' | 'doc-epigraph' | 'doc-epilogue' | 'doc-errata' | 'doc-example' | 'doc-footnote' | 'doc-foreword' | 'doc-glossary' | 'doc-glossref' | 'doc-index' | 'doc-introduction' | 'doc-noteref' | 'doc-notice' | 'doc-pagebreak' | 'doc-pagelist' | 'doc-part' | 'doc-preface' | 'doc-prologue' | 'doc-pullquote' | 'doc-qna' | 'doc-subtitle' | 'doc-tip' | 'doc-toc';
104
+ /**
105
+ * Enables a host custom element to be the target for aria roles and attributes.
106
+ * Components should set the `elementInternals.role` property.
107
+ *
108
+ * By default, aria components are tab focusable. Provide a `focusable: false`
109
+ * option for components that should not be tab focusable, such as
110
+ * `role="listbox"`.
111
+ *
112
+ * This function will also polyfill aria `ElementInternals` properties for
113
+ * Firefox.
114
+ *
115
+ * @param ctor The `ReactiveElement` constructor to set up.
116
+ * @param options Options to configure the element's host aria.
117
+ */
118
+ export declare function setupHostAria(ctor: typeof ReactiveElement, { focusable }?: SetupHostAriaOptions): void;
119
+ /**
120
+ * Options for setting up a host element as an aria target.
121
+ */
122
+ export interface SetupHostAriaOptions {
123
+ /**
124
+ * Whether or not the element can be focused with the tab key. Defaults to
125
+ * true.
126
+ *
127
+ * Set this to false for aria roles that should not be tab focusable, such as
128
+ * `role="listbox"`.
129
+ */
130
+ focusable?: boolean;
131
+ }
132
+ /**
133
+ * Polyfills an element and its `ElementInternals` to support `ARIAMixin`
134
+ * properties on internals. This is needed for Firefox.
135
+ *
136
+ * `setupHostAria()` must be called for the element class.
137
+ *
138
+ * @example
139
+ * class XButton extends LitElement {
140
+ * static {
141
+ * setupHostAria(XButton);
142
+ * }
143
+ *
144
+ * private internals =
145
+ * polyfillElementInternalsAria(this, this.attachInternals());
146
+ *
147
+ * constructor() {
148
+ * super();
149
+ * this.internals.role = 'button';
150
+ * }
151
+ * }
152
+ */
153
+ export declare function polyfillElementInternalsAria(host: ReactiveElement, internals: ElementInternals): ElementInternals;
103
154
  export {};
@@ -3,6 +3,7 @@
3
3
  * Copyright 2023 Google LLC
4
4
  * SPDX-License-Identifier: Apache-2.0
5
5
  */
6
+ import { isServer } from 'lit';
6
7
  /**
7
8
  * Accessibility Object Model reflective aria properties.
8
9
  */
@@ -77,4 +78,149 @@ export function ariaPropertyToAttribute(property) {
77
78
  .replace(/Elements?/g, '')
78
79
  .toLowerCase();
79
80
  }
81
+ /**
82
+ * Enables a host custom element to be the target for aria roles and attributes.
83
+ * Components should set the `elementInternals.role` property.
84
+ *
85
+ * By default, aria components are tab focusable. Provide a `focusable: false`
86
+ * option for components that should not be tab focusable, such as
87
+ * `role="listbox"`.
88
+ *
89
+ * This function will also polyfill aria `ElementInternals` properties for
90
+ * Firefox.
91
+ *
92
+ * @param ctor The `ReactiveElement` constructor to set up.
93
+ * @param options Options to configure the element's host aria.
94
+ */
95
+ export function setupHostAria(ctor, { focusable } = {}) {
96
+ if (focusable !== false) {
97
+ ctor.addInitializer(host => {
98
+ host.addController({
99
+ hostConnected() {
100
+ if (host.hasAttribute('tabindex')) {
101
+ return;
102
+ }
103
+ host.tabIndex = 0;
104
+ }
105
+ });
106
+ });
107
+ }
108
+ if (isServer || 'role' in Element.prototype) {
109
+ return;
110
+ }
111
+ // Polyfill reflective aria properties for Firefox
112
+ for (const ariaProperty of ARIA_PROPERTIES) {
113
+ ctor.createProperty(ariaProperty, {
114
+ attribute: ariaPropertyToAttribute(ariaProperty),
115
+ reflect: true,
116
+ });
117
+ }
118
+ ctor.createProperty('role', { reflect: true });
119
+ }
120
+ /**
121
+ * Polyfills an element and its `ElementInternals` to support `ARIAMixin`
122
+ * properties on internals. This is needed for Firefox.
123
+ *
124
+ * `setupHostAria()` must be called for the element class.
125
+ *
126
+ * @example
127
+ * class XButton extends LitElement {
128
+ * static {
129
+ * setupHostAria(XButton);
130
+ * }
131
+ *
132
+ * private internals =
133
+ * polyfillElementInternalsAria(this, this.attachInternals());
134
+ *
135
+ * constructor() {
136
+ * super();
137
+ * this.internals.role = 'button';
138
+ * }
139
+ * }
140
+ */
141
+ export function polyfillElementInternalsAria(host, internals) {
142
+ if (checkIfElementInternalsSupportsAria(internals)) {
143
+ return internals;
144
+ }
145
+ if (!('role' in host)) {
146
+ throw new Error('Missing setupHostAria()');
147
+ }
148
+ let firstConnectedCallbacks = [];
149
+ let hasBeenConnected = false;
150
+ // Add support for Firefox, which has not yet implement ElementInternals aria
151
+ for (const ariaProperty of ARIA_PROPERTIES) {
152
+ let ariaValueBeforeConnected = null;
153
+ Object.defineProperty(internals, ariaProperty, {
154
+ enumerable: true,
155
+ configurable: true,
156
+ get() {
157
+ if (!hasBeenConnected) {
158
+ return ariaValueBeforeConnected;
159
+ }
160
+ // Dynamic lookup rather than hardcoding all properties.
161
+ // tslint:disable-next-line:no-dict-access-on-struct-type
162
+ return host[ariaProperty];
163
+ },
164
+ set(value) {
165
+ const setValue = () => {
166
+ // Dynamic lookup rather than hardcoding all properties.
167
+ // tslint:disable-next-line:no-dict-access-on-struct-type
168
+ host[ariaProperty] = value;
169
+ };
170
+ if (!hasBeenConnected) {
171
+ ariaValueBeforeConnected = value;
172
+ firstConnectedCallbacks.push(setValue);
173
+ return;
174
+ }
175
+ setValue();
176
+ },
177
+ });
178
+ }
179
+ let roleValueBeforeConnected = null;
180
+ Object.defineProperty(internals, 'role', {
181
+ enumerable: true,
182
+ configurable: true,
183
+ get() {
184
+ if (!hasBeenConnected) {
185
+ return roleValueBeforeConnected;
186
+ }
187
+ return host.getAttribute('role');
188
+ },
189
+ set(value) {
190
+ const setRole = () => {
191
+ if (value === null) {
192
+ host.removeAttribute('role');
193
+ }
194
+ else {
195
+ host.setAttribute('role', value);
196
+ }
197
+ };
198
+ if (!hasBeenConnected) {
199
+ roleValueBeforeConnected = value;
200
+ firstConnectedCallbacks.push(setRole);
201
+ return;
202
+ }
203
+ setRole();
204
+ },
205
+ });
206
+ host.addController({
207
+ hostConnected() {
208
+ if (hasBeenConnected) {
209
+ return;
210
+ }
211
+ hasBeenConnected = true;
212
+ for (const callback of firstConnectedCallbacks) {
213
+ callback();
214
+ }
215
+ // Remove strong callback references
216
+ firstConnectedCallbacks = [];
217
+ }
218
+ });
219
+ return internals;
220
+ }
221
+ // Separate function so that typescript doesn't complain about internals being
222
+ // "never".
223
+ function checkIfElementInternalsSupportsAria(internals) {
224
+ return 'role' in internals;
225
+ }
80
226
  //# sourceMappingURL=aria.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"aria.js","sourceRoot":"","sources":["aria.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAOH;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAmB;IAC7C,YAAY;IACZ,kBAAkB;IAClB,UAAU;IACV,aAAa;IACb,cAAc;IACd,cAAc;IACd,aAAa;IACb,aAAa;IACb,cAAc;IACd,cAAc;IACd,cAAc;IACd,YAAY;IACZ,aAAa;IACb,kBAAkB;IAClB,WAAW;IACX,WAAW;IACX,UAAU;IACV,WAAW;IACX,eAAe;IACf,qBAAqB;IACrB,iBAAiB;IACjB,iBAAiB;IACjB,cAAc;IACd,aAAa;IACb,cAAc;IACd,cAAc;IACd,qBAAqB;IACrB,cAAc;IACd,cAAc;IACd,aAAa;IACb,cAAc;IACd,aAAa;IACb,UAAU;IACV,cAAc;IACd,cAAc;IACd,cAAc;IACd,eAAe;CAChB,CAAC;AAOF;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAG,eAAe,CAAC,GAAG,CAAC,uBAAuB,CAAC,CAAC;AAE5E;;;;;;;;GAQG;AACH,MAAM,UAAU,eAAe,CAAC,SAAiB;IAC/C,OAAO,SAAS,CAAC,UAAU,CAAC,OAAO,CAAC,CAAC;AACvC,CAAC;AAED;;;;;;;;GAQG;AACH,MAAM,UAAU,uBAAuB,CACnC,QAAW;IACb,OAAO,QAAQ;SACH,OAAO,CAAC,MAAM,EAAE,OAAO,CAAC;QACzB,kEAAkE;SACjE,OAAO,CAAC,YAAY,EAAE,EAAE,CAAC;SACzB,WAAW,EAAgC,CAAC;AAC1D,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\n/**\n * Accessibility Object Model reflective aria property name types.\n */\nexport type ARIAProperty = Exclude<keyof ARIAMixin, 'role'>;\n\n/**\n * Accessibility Object Model reflective aria properties.\n */\nexport const ARIA_PROPERTIES: ARIAProperty[] = [\n 'ariaAtomic',\n 'ariaAutoComplete',\n 'ariaBusy',\n 'ariaChecked',\n 'ariaColCount',\n 'ariaColIndex',\n 'ariaColSpan',\n 'ariaCurrent',\n 'ariaDisabled',\n 'ariaExpanded',\n 'ariaHasPopup',\n 'ariaHidden',\n 'ariaInvalid',\n 'ariaKeyShortcuts',\n 'ariaLabel',\n 'ariaLevel',\n 'ariaLive',\n 'ariaModal',\n 'ariaMultiLine',\n 'ariaMultiSelectable',\n 'ariaOrientation',\n 'ariaPlaceholder',\n 'ariaPosInSet',\n 'ariaPressed',\n 'ariaReadOnly',\n 'ariaRequired',\n 'ariaRoleDescription',\n 'ariaRowCount',\n 'ariaRowIndex',\n 'ariaRowSpan',\n 'ariaSelected',\n 'ariaSetSize',\n 'ariaSort',\n 'ariaValueMax',\n 'ariaValueMin',\n 'ariaValueNow',\n 'ariaValueText',\n];\n\n/**\n * Accessibility Object Model aria attribute name types.\n */\nexport type ARIAAttribute = ARIAPropertyToAttribute<ARIAProperty>;\n\n/**\n * Accessibility Object Model aria attributes.\n */\nexport const ARIA_ATTRIBUTES = ARIA_PROPERTIES.map(ariaPropertyToAttribute);\n\n/**\n * Checks if an attribute is one of the AOM aria attributes.\n *\n * @example\n * isAriaAttribute('aria-label'); // true\n *\n * @param attribute The attribute to check.\n * @return True if the attribute is an aria attribute, or false if not.\n */\nexport function isAriaAttribute(attribute: string): attribute is ARIAAttribute {\n return attribute.startsWith('aria-');\n}\n\n/**\n * Converts an AOM aria property into its corresponding attribute.\n *\n * @example\n * ariaPropertyToAttribute('ariaLabel'); // 'aria-label'\n *\n * @param property The aria property.\n * @return The aria attribute.\n */\nexport function ariaPropertyToAttribute<K extends ARIAProperty|'role'>(\n property: K) {\n return property\n .replace('aria', 'aria-')\n // IDREF attributes also include an \"Element\" or \"Elements\" suffix\n .replace(/Elements?/g, '')\n .toLowerCase() as ARIAPropertyToAttribute<K>;\n}\n\n// Converts an `ariaFoo` string type to an `aria-foo` string type.\ntype ARIAPropertyToAttribute<K extends string> =\n K extends `aria${infer Suffix}Element${infer OptS}` ?\n `aria-${Lowercase < Suffix >}` :\n K extends `aria${infer Suffix}` ? `aria-${Lowercase < Suffix >}` : K;\n\n/**\n * An extension of `ARIAMixin` that enforces strict value types for aria\n * properties.\n *\n * This is needed for correct typing in render functions with lit analyzer.\n *\n * @example\n * render() {\n * const {ariaLabel} = this as ARIAMixinStrict;\n * return html`\n * <button aria-label=${ariaLabel || nothing}>\n * <slot></slot>\n * </button>\n * `;\n * }\n */\nexport interface ARIAMixinStrict extends ARIAMixin {\n ariaAtomic: 'true'|'false'|null;\n ariaAutoComplete: 'none'|'inline'|'list'|'both'|null;\n ariaBusy: 'true'|'false'|null;\n ariaChecked: 'true'|'false'|null;\n ariaColCount: `${number}`|null;\n ariaColIndex: `${number}`|null;\n ariaColSpan: `${number}`|null;\n ariaCurrent: 'page'|'step'|'location'|'date'|'time'|'true'|'false'|null;\n ariaDisabled: 'true'|'false'|null;\n ariaExpanded: 'true'|'false'|null;\n ariaHasPopup: 'false'|'true'|'menu'|'listbox'|'tree'|'grid'|'dialog'|null;\n ariaHidden: 'true'|'false'|null;\n ariaInvalid: 'true'|'false'|null;\n ariaKeyShortcuts: string|null;\n ariaLabel: string|null;\n ariaLevel: `${number}`|null;\n ariaLive: 'assertive'|'off'|'polite'|null;\n ariaModal: 'true'|'false'|null;\n ariaMultiLine: 'true'|'false'|null;\n ariaMultiSelectable: 'true'|'false'|null;\n ariaOrientation: 'horizontal'|'vertical'|'undefined'|null;\n ariaPlaceholder: string|null;\n ariaPosInSet: `${number}`|null;\n ariaPressed: 'true'|'false'|null;\n ariaReadOnly: 'true'|'false'|null;\n ariaRequired: 'true'|'false'|null;\n ariaRoleDescription: string|null;\n ariaRowCount: `${number}`|null;\n ariaRowIndex: `${number}`|null;\n ariaRowSpan: `${number}`|null;\n ariaSelected: 'true'|'false'|null;\n ariaSetSize: `${number}`|null;\n ariaSort: 'ascending'|'descending'|'none'|'other'|null;\n ariaValueMax: `${number}`|null;\n ariaValueMin: `${number}`|null;\n ariaValueNow: `${number}`|null;\n ariaValueText: string|null;\n role: ARIARole|null;\n}\n\n/**\n * Valid values for `role`.\n */\nexport type ARIARole =\n 'alert'|'alertdialog'|'button'|'checkbox'|'dialog'|'gridcell'|'link'|'log'|\n 'marquee'|'menuitem'|'menuitemcheckbox'|'menuitemradio'|'option'|\n 'progressbar'|'radio'|'scrollbar'|'searchbox'|'slider'|'spinbutton'|\n 'status'|'switch'|'tab'|'tabpanel'|'textbox'|'timer'|'tooltip'|'treeitem'|\n 'combobox'|'grid'|'listbox'|'menu'|'menubar'|'radiogroup'|'tablist'|'tree'|\n 'treegrid'|'application'|'article'|'cell'|'columnheader'|'definition'|\n 'directory'|'document'|'feed'|'figure'|'group'|'heading'|'img'|'list'|\n 'listitem'|'math'|'none'|'note'|'presentation'|'region'|'row'|'rowgroup'|\n 'rowheader'|'separator'|'table'|'term'|'text'|'toolbar'|'banner'|\n 'complementary'|'contentinfo'|'form'|'main'|'navigation'|'region'|'search'|\n 'doc-abstract'|'doc-acknowledgments'|'doc-afterword'|'doc-appendix'|\n 'doc-backlink'|'doc-biblioentry'|'doc-bibliography'|'doc-biblioref'|\n 'doc-chapter'|'doc-colophon'|'doc-conclusion'|'doc-cover'|'doc-credit'|\n 'doc-credits'|'doc-dedication'|'doc-endnote'|'doc-endnotes'|'doc-epigraph'|\n 'doc-epilogue'|'doc-errata'|'doc-example'|'doc-footnote'|'doc-foreword'|\n 'doc-glossary'|'doc-glossref'|'doc-index'|'doc-introduction'|'doc-noteref'|\n 'doc-notice'|'doc-pagebreak'|'doc-pagelist'|'doc-part'|'doc-preface'|\n 'doc-prologue'|'doc-pullquote'|'doc-qna'|'doc-subtitle'|'doc-tip'|'doc-toc';\n"]}
1
+ {"version":3,"file":"aria.js","sourceRoot":"","sources":["aria.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,QAAQ,EAAkB,MAAM,KAAK,CAAC;AAO9C;;GAEG;AACH,MAAM,CAAC,MAAM,eAAe,GAAmB;IAC7C,YAAY;IACZ,kBAAkB;IAClB,UAAU;IAC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AAGD,8EAA8E;AAC9E,WAAW;AACX,SAAS,mCAAmC,CAAC,SAA2B;IACtE,OAAO,MAAM,IAAI,SAAS,CAAC;AAC7B,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {isServer, ReactiveElement} from 'lit';\n\n/**\n * Accessibility Object Model reflective aria property name types.\n */\nexport type ARIAProperty = Exclude<keyof ARIAMixin, 'role'>;\n\n/**\n * Accessibility Object Model reflective aria properties.\n */\nexport const ARIA_PROPERTIES: ARIAProperty[] = [\n 'ariaAtomic',\n 'ariaAutoComplete',\n 'ariaBusy',\n 'ariaChecked',\n 'ariaColCount',\n 'ariaColIndex',\n 'ariaColSpan',\n 'ariaCurrent',\n 'ariaDisabled',\n 'ariaExpanded',\n 'ariaHasPopup',\n 'ariaHidden',\n 'ariaInvalid',\n 'ariaKeyShortcuts',\n 'ariaLabel',\n 'ariaLevel',\n 'ariaLive',\n 'ariaModal',\n 'ariaMultiLine',\n 'ariaMultiSelectable',\n 'ariaOrientation',\n 'ariaPlaceholder',\n 'ariaPosInSet',\n 'ariaPressed',\n 'ariaReadOnly',\n 'ariaRequired',\n 'ariaRoleDescription',\n 'ariaRowCount',\n 'ariaRowIndex',\n 'ariaRowSpan',\n 'ariaSelected',\n 'ariaSetSize',\n 'ariaSort',\n 'ariaValueMax',\n 'ariaValueMin',\n 'ariaValueNow',\n 'ariaValueText',\n];\n\n/**\n * Accessibility Object Model aria attribute name types.\n */\nexport type ARIAAttribute = ARIAPropertyToAttribute<ARIAProperty>;\n\n/**\n * Accessibility Object Model aria attributes.\n */\nexport const ARIA_ATTRIBUTES = ARIA_PROPERTIES.map(ariaPropertyToAttribute);\n\n/**\n * Checks if an attribute is one of the AOM aria attributes.\n *\n * @example\n * isAriaAttribute('aria-label'); // true\n *\n * @param attribute The attribute to check.\n * @return True if the attribute is an aria attribute, or false if not.\n */\nexport function isAriaAttribute(attribute: string): attribute is ARIAAttribute {\n return attribute.startsWith('aria-');\n}\n\n/**\n * Converts an AOM aria property into its corresponding attribute.\n *\n * @example\n * ariaPropertyToAttribute('ariaLabel'); // 'aria-label'\n *\n * @param property The aria property.\n * @return The aria attribute.\n */\nexport function ariaPropertyToAttribute<K extends ARIAProperty|'role'>(\n property: K) {\n return property\n .replace('aria', 'aria-')\n // IDREF attributes also include an \"Element\" or \"Elements\" suffix\n .replace(/Elements?/g, '')\n .toLowerCase() as ARIAPropertyToAttribute<K>;\n}\n\n// Converts an `ariaFoo` string type to an `aria-foo` string type.\ntype ARIAPropertyToAttribute<K extends string> =\n K extends `aria${infer Suffix}Element${infer OptS}` ?\n `aria-${Lowercase < Suffix >}` :\n K extends `aria${infer Suffix}` ? `aria-${Lowercase < Suffix >}` : K;\n\n/**\n * An extension of `ARIAMixin` that enforces strict value types for aria\n * properties.\n *\n * This is needed for correct typing in render functions with lit analyzer.\n *\n * @example\n * render() {\n * const {ariaLabel} = this as ARIAMixinStrict;\n * return html`\n * <button aria-label=${ariaLabel || nothing}>\n * <slot></slot>\n * </button>\n * `;\n * }\n */\nexport interface ARIAMixinStrict extends ARIAMixin {\n ariaAtomic: 'true'|'false'|null;\n ariaAutoComplete: 'none'|'inline'|'list'|'both'|null;\n ariaBusy: 'true'|'false'|null;\n ariaChecked: 'true'|'false'|null;\n ariaColCount: `${number}`|null;\n ariaColIndex: `${number}`|null;\n ariaColSpan: `${number}`|null;\n ariaCurrent: 'page'|'step'|'location'|'date'|'time'|'true'|'false'|null;\n ariaDisabled: 'true'|'false'|null;\n ariaExpanded: 'true'|'false'|null;\n ariaHasPopup: 'false'|'true'|'menu'|'listbox'|'tree'|'grid'|'dialog'|null;\n ariaHidden: 'true'|'false'|null;\n ariaInvalid: 'true'|'false'|null;\n ariaKeyShortcuts: string|null;\n ariaLabel: string|null;\n ariaLevel: `${number}`|null;\n ariaLive: 'assertive'|'off'|'polite'|null;\n ariaModal: 'true'|'false'|null;\n ariaMultiLine: 'true'|'false'|null;\n ariaMultiSelectable: 'true'|'false'|null;\n ariaOrientation: 'horizontal'|'vertical'|'undefined'|null;\n ariaPlaceholder: string|null;\n ariaPosInSet: `${number}`|null;\n ariaPressed: 'true'|'false'|null;\n ariaReadOnly: 'true'|'false'|null;\n ariaRequired: 'true'|'false'|null;\n ariaRoleDescription: string|null;\n ariaRowCount: `${number}`|null;\n ariaRowIndex: `${number}`|null;\n ariaRowSpan: `${number}`|null;\n ariaSelected: 'true'|'false'|null;\n ariaSetSize: `${number}`|null;\n ariaSort: 'ascending'|'descending'|'none'|'other'|null;\n ariaValueMax: `${number}`|null;\n ariaValueMin: `${number}`|null;\n ariaValueNow: `${number}`|null;\n ariaValueText: string|null;\n role: ARIARole|null;\n}\n\n/**\n * Valid values for `role`.\n */\nexport type ARIARole =\n 'alert'|'alertdialog'|'button'|'checkbox'|'dialog'|'gridcell'|'link'|'log'|\n 'marquee'|'menuitem'|'menuitemcheckbox'|'menuitemradio'|'option'|\n 'progressbar'|'radio'|'scrollbar'|'searchbox'|'slider'|'spinbutton'|\n 'status'|'switch'|'tab'|'tabpanel'|'textbox'|'timer'|'tooltip'|'treeitem'|\n 'combobox'|'grid'|'listbox'|'menu'|'menubar'|'radiogroup'|'tablist'|'tree'|\n 'treegrid'|'application'|'article'|'cell'|'columnheader'|'definition'|\n 'directory'|'document'|'feed'|'figure'|'group'|'heading'|'img'|'list'|\n 'listitem'|'math'|'none'|'note'|'presentation'|'region'|'row'|'rowgroup'|\n 'rowheader'|'separator'|'table'|'term'|'text'|'toolbar'|'banner'|\n 'complementary'|'contentinfo'|'form'|'main'|'navigation'|'region'|'search'|\n 'doc-abstract'|'doc-acknowledgments'|'doc-afterword'|'doc-appendix'|\n 'doc-backlink'|'doc-biblioentry'|'doc-bibliography'|'doc-biblioref'|\n 'doc-chapter'|'doc-colophon'|'doc-conclusion'|'doc-cover'|'doc-credit'|\n 'doc-credits'|'doc-dedication'|'doc-endnote'|'doc-endnotes'|'doc-epigraph'|\n 'doc-epilogue'|'doc-errata'|'doc-example'|'doc-footnote'|'doc-foreword'|\n 'doc-glossary'|'doc-glossref'|'doc-index'|'doc-introduction'|'doc-noteref'|\n 'doc-notice'|'doc-pagebreak'|'doc-pagelist'|'doc-part'|'doc-preface'|\n 'doc-prologue'|'doc-pullquote'|'doc-qna'|'doc-subtitle'|'doc-tip'|'doc-toc';\n\n/**\n * Enables a host custom element to be the target for aria roles and attributes.\n * Components should set the `elementInternals.role` property.\n *\n * By default, aria components are tab focusable. Provide a `focusable: false`\n * option for components that should not be tab focusable, such as\n * `role=\"listbox\"`.\n *\n * This function will also polyfill aria `ElementInternals` properties for\n * Firefox.\n *\n * @param ctor The `ReactiveElement` constructor to set up.\n * @param options Options to configure the element's host aria.\n */\nexport function setupHostAria(\n ctor: typeof ReactiveElement, {focusable}: SetupHostAriaOptions = {}) {\n if (focusable !== false) {\n ctor.addInitializer(host => {\n host.addController({\n hostConnected() {\n if (host.hasAttribute('tabindex')) {\n return;\n }\n\n host.tabIndex = 0;\n }\n });\n });\n }\n\n if (isServer || 'role' in Element.prototype) {\n return;\n }\n\n // Polyfill reflective aria properties for Firefox\n for (const ariaProperty of ARIA_PROPERTIES) {\n ctor.createProperty(ariaProperty, {\n attribute: ariaPropertyToAttribute(ariaProperty),\n reflect: true,\n });\n }\n\n ctor.createProperty('role', {reflect: true});\n}\n\n/**\n * Options for setting up a host element as an aria target.\n */\nexport interface SetupHostAriaOptions {\n /**\n * Whether or not the element can be focused with the tab key. Defaults to\n * true.\n *\n * Set this to false for aria roles that should not be tab focusable, such as\n * `role=\"listbox\"`.\n */\n focusable?: boolean;\n}\n\n/**\n * Polyfills an element and its `ElementInternals` to support `ARIAMixin`\n * properties on internals. This is needed for Firefox.\n *\n * `setupHostAria()` must be called for the element class.\n *\n * @example\n * class XButton extends LitElement {\n * static {\n * setupHostAria(XButton);\n * }\n *\n * private internals =\n * polyfillElementInternalsAria(this, this.attachInternals());\n *\n * constructor() {\n * super();\n * this.internals.role = 'button';\n * }\n * }\n */\nexport function polyfillElementInternalsAria(\n host: ReactiveElement, internals: ElementInternals) {\n if (checkIfElementInternalsSupportsAria(internals)) {\n return internals;\n }\n\n if (!('role' in host)) {\n throw new Error('Missing setupHostAria()');\n }\n\n let firstConnectedCallbacks: Array<() => void> = [];\n let hasBeenConnected = false;\n\n // Add support for Firefox, which has not yet implement ElementInternals aria\n for (const ariaProperty of ARIA_PROPERTIES) {\n let ariaValueBeforeConnected: string|null = null;\n Object.defineProperty(internals, ariaProperty, {\n enumerable: true,\n configurable: true,\n get() {\n if (!hasBeenConnected) {\n return ariaValueBeforeConnected;\n }\n\n // Dynamic lookup rather than hardcoding all properties.\n // tslint:disable-next-line:no-dict-access-on-struct-type\n return host[ariaProperty];\n },\n set(value: string|null) {\n const setValue = () => {\n // Dynamic lookup rather than hardcoding all properties.\n // tslint:disable-next-line:no-dict-access-on-struct-type\n host[ariaProperty] = value;\n };\n\n if (!hasBeenConnected) {\n ariaValueBeforeConnected = value;\n firstConnectedCallbacks.push(setValue);\n return;\n }\n\n setValue();\n },\n });\n }\n\n let roleValueBeforeConnected: string|null = null;\n Object.defineProperty(internals, 'role', {\n enumerable: true,\n configurable: true,\n get() {\n if (!hasBeenConnected) {\n return roleValueBeforeConnected;\n }\n\n return host.getAttribute('role');\n },\n set(value: string|null) {\n const setRole = () => {\n if (value === null) {\n host.removeAttribute('role');\n } else {\n host.setAttribute('role', value);\n }\n };\n\n if (!hasBeenConnected) {\n roleValueBeforeConnected = value;\n firstConnectedCallbacks.push(setRole);\n return;\n }\n\n setRole();\n },\n });\n\n host.addController({\n hostConnected() {\n if (hasBeenConnected) {\n return;\n }\n\n hasBeenConnected = true;\n for (const callback of firstConnectedCallbacks) {\n callback();\n }\n\n // Remove strong callback references\n firstConnectedCallbacks = [];\n }\n });\n\n return internals;\n}\n\n\n// Separate function so that typescript doesn't complain about internals being\n// \"never\".\nfunction checkIfElementInternalsSupportsAria(internals: ElementInternals) {\n return 'role' in internals;\n}\n"]}
@@ -33,15 +33,15 @@ export interface Attachable {
33
33
  */
34
34
  htmlFor: string | null;
35
35
  /**
36
- * The element that controls the visibility of the attachable element. It is
37
- * one of:
36
+ * Gets or sets the element that controls the visibility of the attachable
37
+ * element. It is one of:
38
38
  *
39
39
  * - The control referenced by the `for` attribute.
40
40
  * - The control provided to `element.attach(control)`
41
41
  * - The element's parent.
42
42
  * - `null` if the element is not controlled.
43
43
  */
44
- readonly control: HTMLElement | null;
44
+ control: HTMLElement | null;
45
45
  /**
46
46
  * Attaches the element to an interactive control.
47
47
  *
@@ -91,7 +91,8 @@ export declare class AttachableController implements ReactiveController, Attacha
91
91
  private readonly onControlChange;
92
92
  get htmlFor(): string | null;
93
93
  set htmlFor(htmlFor: string | null);
94
- get control(): HTMLElement;
94
+ get control(): HTMLElement | null;
95
+ set control(control: HTMLElement | null);
95
96
  private currentControl;
96
97
  /**
97
98
  * Creates a new controller for an `Attachable` element.
@@ -68,6 +68,14 @@ export class AttachableController {
68
68
  }
69
69
  return this.currentControl || this.host.parentElement;
70
70
  }
71
+ set control(control) {
72
+ if (control) {
73
+ this.attach(control);
74
+ }
75
+ else {
76
+ this.detach();
77
+ }
78
+ }
71
79
  /**
72
80
  * Creates a new controller for an `Attachable` element.
73
81
  *
@@ -1 +1 @@
1
- {"version":3,"file":"attachable-controller.js","sourceRoot":"","sources":["attachable-controller.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAA6C,QAAQ,EAAC,MAAM,KAAK,CAAC;AAuDzE;;;GAGG;AACH,MAAM,qBAAqB,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC;AAU7D,IAAI,sBAAkD,CAAC;AAEvD,IAAI,CAAC,QAAQ,EAAE;IACb;;;;OAIG;IACH,sBAAsB,GAAG,IAAI,gBAAgB,CAAC,OAAO,CAAC,EAAE;QACtD,KAAK,MAAM,MAAM,IAAI,OAAO,EAAE;YAC5B,uDAAuD;YACvD,qDAAqD;YACpD,MAAM,CAAC,MAAmC,CAAC,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AM,CAAC,OAAoB;QACzB,IAAI,OAAO,KAAK,IAAI,CAAC,cAAc,EAAE;YACnC,OAAO;SACR;QAED,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAChC,6DAA6D;QAC7D,iEAAiE;QACjE,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAC7B,0EAA0E;QAC1E,gEAAgE;QAChE,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACpC,CAAC;IAED,eAAe;IACf,aAAa;QACX,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;IAED,eAAe;IACf,gBAAgB;QACd,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IAEO,iBAAiB,CAAC,OAAyB;QACjD,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;QACnD,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC;IAChC,CAAC;CACF","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {ReactiveController, ReactiveControllerHost, isServer} from 'lit';\n\n/**\n * An element that can be attached to an associated controlling element.\n */\nexport interface Attachable {\n /**\n * Reflects the value of the `for` attribute, which is the ID of the element's\n * associated control.\n *\n * Use this when the elements's associated control is not its parent.\n *\n * To manually control an element, set its `for` attribute to `\"\"`.\n *\n * @example\n * ```html\n * <div class=\"container\">\n * <md-attachable for=\"interactive\"></md-attachable>\n * <button id=\"interactive\">Action</button>\n * </div>\n * ```\n *\n * @example\n * ```html\n * <button class=\"manually-controlled\">\n * <md-attachable for=\"\"></md-attachable>\n * </button>\n * ```\n */\n htmlFor: string|null;\n\n /**\n * The element that controls the visibility of the attachable element. It is\n * one of:\n *\n * - The control referenced by the `for` attribute.\n * - The control provided to `element.attach(control)`\n * - The element's parent.\n * - `null` if the element is not controlled.\n */\n readonly control: HTMLElement|null;\n\n /**\n * Attaches the element to an interactive control.\n *\n * @param control The element that controls the attachable element.\n */\n attach(control: HTMLElement): void;\n\n /**\n * Detaches the element from its current control.\n */\n detach(): void;\n}\n\n/**\n * A key to retrieve an `Attachable` element's `AttachableController` from a\n * global `MutationObserver`.\n */\nconst ATTACHABLE_CONTROLLER = Symbol('attachableController');\n\n/**\n * The host of an `AttachableController`. The controller will add itself to\n * the host so it can be retrieved in a global `MutationObserver`.\n */\ninterface AttachableControllerHost extends ReactiveControllerHost, HTMLElement {\n [ATTACHABLE_CONTROLLER]?: AttachableController;\n}\n\nlet FOR_ATTRIBUTE_OBSERVER: MutationObserver|undefined;\n\nif (!isServer) {\n /**\n * A global `MutationObserver` that reacts to `for` attribute changes on\n * `Attachable` elements. If the `for` attribute changes, the controller will\n * re-attach to the new referenced element.\n */\n FOR_ATTRIBUTE_OBSERVER = new MutationObserver(records => {\n for (const record of records) {\n // When a control's `for` attribute changes, inform its\n // `AttachableController` to update to a new control.\n (record.target as AttachableControllerHost)[ATTACHABLE_CONTROLLER]\n ?.hostConnected();\n }\n });\n}\n\n/**\n * A controller that provides an implementation for `Attachable` elements.\n *\n * @example\n * ```ts\n * class MyElement extends LitElement implements Attachable {\n * get control() { return this.attachableController.control; }\n *\n * private readonly attachableController = new AttachableController(\n * this,\n * (previousControl, newControl) => {\n * previousControl?.removeEventListener('click', this.handleClick);\n * newControl?.addEventListener('click', this.handleClick);\n * }\n * );\n *\n * // Implement remaining `Attachable` properties/methods that call the\n * // controller's properties/methods.\n * }\n * ```\n */\nexport class AttachableController implements ReactiveController, Attachable {\n get htmlFor() {\n return this.host.getAttribute('for');\n }\n\n set htmlFor(htmlFor: string|null) {\n if (htmlFor === null) {\n this.host.removeAttribute('for');\n } else {\n this.host.setAttribute('for', htmlFor);\n }\n }\n\n get control() {\n if (this.host.hasAttribute('for')) {\n if (!this.htmlFor || !this.host.isConnected) {\n return null;\n }\n\n return (this.host.getRootNode() as Document | ShadowRoot)\n .querySelector<HTMLElement>(`#${this.htmlFor}`);\n }\n\n return this.currentControl || this.host.parentElement;\n }\n\n private currentControl: HTMLElement|null = null;\n\n /**\n * Creates a new controller for an `Attachable` element.\n *\n * @param host The `Attachable` element.\n * @param onControlChange A callback with two parameters for the previous and\n * next control. An `Attachable` element may perform setup or teardown\n * logic whenever the control changes.\n */\n constructor(\n private readonly host: AttachableControllerHost,\n private readonly onControlChange:\n (prev: HTMLElement|null, next: HTMLElement|null) => void) {\n host.addController(this);\n host[ATTACHABLE_CONTROLLER] = this;\n FOR_ATTRIBUTE_OBSERVER?.observe(host, {attributeFilter: ['for']});\n }\n\n attach(control: HTMLElement) {\n if (control === this.currentControl) {\n return;\n }\n\n this.setCurrentControl(control);\n // When imperatively attaching, remove the `for` attribute so\n // that the attached control is used instead of a referenced one.\n this.host.removeAttribute('for');\n }\n\n detach() {\n this.setCurrentControl(null);\n // When imperatively detaching, add an empty `for=\"\"` attribute. This will\n // ensure the control is `null` rather than the `parentElement`.\n this.host.setAttribute('for', '');\n }\n\n /** @private */\n hostConnected() {\n this.setCurrentControl(this.control);\n }\n\n /** @private */\n hostDisconnected() {\n this.setCurrentControl(null);\n }\n\n private setCurrentControl(control: HTMLElement|null) {\n this.onControlChange(this.currentControl, control);\n this.currentControl = control;\n }\n}\n"]}
1
+ {"version":3,"file":"attachable-controller.js","sourceRoot":"","sources":["attachable-controller.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,QAAQ,EAA6C,MAAM,KAAK,CAAC;AAuDzE;;;GAGG;AACH,MAAM,qBAAqB,GAAG,MAAM,CAAC,sBAAsB,CAAC,CAAC;AAU7D,IAAI,sBAAkD,CAAC;AAEvD,IAAI,CAAC,QAAQ,EAAE;IACb;;;;OAIG;IACH,sBAAsB,GAAG,IAAI,gBAAgB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CAA0B;QAC9B,oBAAe,GAAf,eAAe,CAC4B;QAbxD,mBAAc,GAAqB,IAAI,CAAC;QAc9C,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC;QACzB,IAAI,CAAC,qBAAqB,CAAC,GAAG,IAAI,CAAC;QACnC,sBAAsB,EAAE,OAAO,CAAC,IAAI,EAAE,EAAC,eAAe,EAAE,CAAC,KAAK,CAAC,EAAC,CAAC,CAAC;IACpE,CAAC;IAED,MAAM,CAAC,OAAoB;QACzB,IAAI,OAAO,KAAK,IAAI,CAAC,cAAc,EAAE;YACnC,OAAO;SACR;QAED,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC,CAAC;QAChC,6DAA6D;QAC7D,iEAAiE;QACjE,IAAI,CAAC,IAAI,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC;IACnC,CAAC;IAED,MAAM;QACJ,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;QAC7B,0EAA0E;QAC1E,gEAAgE;QAChE,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,KAAK,EAAE,EAAE,CAAC,CAAC;IACpC,CAAC;IAED,eAAe;IACf,aAAa;QACX,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,OAAO,CAAC,CAAC;IACvC,CAAC;IAED,eAAe;IACf,gBAAgB;QACd,IAAI,CAAC,iBAAiB,CAAC,IAAI,CAAC,CAAC;IAC/B,CAAC;IAEO,iBAAiB,CAAC,OAAyB;QACjD,IAAI,CAAC,eAAe,CAAC,IAAI,CAAC,cAAc,EAAE,OAAO,CAAC,CAAC;QACnD,IAAI,CAAC,cAAc,GAAG,OAAO,CAAC;IAChC,CAAC;CACF","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {isServer, ReactiveController, ReactiveControllerHost} from 'lit';\n\n/**\n * An element that can be attached to an associated controlling element.\n */\nexport interface Attachable {\n /**\n * Reflects the value of the `for` attribute, which is the ID of the element's\n * associated control.\n *\n * Use this when the elements's associated control is not its parent.\n *\n * To manually control an element, set its `for` attribute to `\"\"`.\n *\n * @example\n * ```html\n * <div class=\"container\">\n * <md-attachable for=\"interactive\"></md-attachable>\n * <button id=\"interactive\">Action</button>\n * </div>\n * ```\n *\n * @example\n * ```html\n * <button class=\"manually-controlled\">\n * <md-attachable for=\"\"></md-attachable>\n * </button>\n * ```\n */\n htmlFor: string|null;\n\n /**\n * Gets or sets the element that controls the visibility of the attachable\n * element. It is one of:\n *\n * - The control referenced by the `for` attribute.\n * - The control provided to `element.attach(control)`\n * - The element's parent.\n * - `null` if the element is not controlled.\n */\n control: HTMLElement|null;\n\n /**\n * Attaches the element to an interactive control.\n *\n * @param control The element that controls the attachable element.\n */\n attach(control: HTMLElement): void;\n\n /**\n * Detaches the element from its current control.\n */\n detach(): void;\n}\n\n/**\n * A key to retrieve an `Attachable` element's `AttachableController` from a\n * global `MutationObserver`.\n */\nconst ATTACHABLE_CONTROLLER = Symbol('attachableController');\n\n/**\n * The host of an `AttachableController`. The controller will add itself to\n * the host so it can be retrieved in a global `MutationObserver`.\n */\ninterface AttachableControllerHost extends ReactiveControllerHost, HTMLElement {\n [ATTACHABLE_CONTROLLER]?: AttachableController;\n}\n\nlet FOR_ATTRIBUTE_OBSERVER: MutationObserver|undefined;\n\nif (!isServer) {\n /**\n * A global `MutationObserver` that reacts to `for` attribute changes on\n * `Attachable` elements. If the `for` attribute changes, the controller will\n * re-attach to the new referenced element.\n */\n FOR_ATTRIBUTE_OBSERVER = new MutationObserver(records => {\n for (const record of records) {\n // When a control's `for` attribute changes, inform its\n // `AttachableController` to update to a new control.\n (record.target as AttachableControllerHost)[ATTACHABLE_CONTROLLER]\n ?.hostConnected();\n }\n });\n}\n\n/**\n * A controller that provides an implementation for `Attachable` elements.\n *\n * @example\n * ```ts\n * class MyElement extends LitElement implements Attachable {\n * get control() { return this.attachableController.control; }\n *\n * private readonly attachableController = new AttachableController(\n * this,\n * (previousControl, newControl) => {\n * previousControl?.removeEventListener('click', this.handleClick);\n * newControl?.addEventListener('click', this.handleClick);\n * }\n * );\n *\n * // Implement remaining `Attachable` properties/methods that call the\n * // controller's properties/methods.\n * }\n * ```\n */\nexport class AttachableController implements ReactiveController, Attachable {\n get htmlFor() {\n return this.host.getAttribute('for');\n }\n\n set htmlFor(htmlFor: string|null) {\n if (htmlFor === null) {\n this.host.removeAttribute('for');\n } else {\n this.host.setAttribute('for', htmlFor);\n }\n }\n\n get control() {\n if (this.host.hasAttribute('for')) {\n if (!this.htmlFor || !this.host.isConnected) {\n return null;\n }\n\n return (this.host.getRootNode() as Document | ShadowRoot)\n .querySelector<HTMLElement>(`#${this.htmlFor}`);\n }\n\n return this.currentControl || this.host.parentElement;\n }\n set control(control: HTMLElement|null) {\n if (control) {\n this.attach(control);\n } else {\n this.detach();\n }\n }\n\n private currentControl: HTMLElement|null = null;\n\n /**\n * Creates a new controller for an `Attachable` element.\n *\n * @param host The `Attachable` element.\n * @param onControlChange A callback with two parameters for the previous and\n * next control. An `Attachable` element may perform setup or teardown\n * logic whenever the control changes.\n */\n constructor(\n private readonly host: AttachableControllerHost,\n private readonly onControlChange:\n (prev: HTMLElement|null, next: HTMLElement|null) => void) {\n host.addController(this);\n host[ATTACHABLE_CONTROLLER] = this;\n FOR_ATTRIBUTE_OBSERVER?.observe(host, {attributeFilter: ['for']});\n }\n\n attach(control: HTMLElement) {\n if (control === this.currentControl) {\n return;\n }\n\n this.setCurrentControl(control);\n // When imperatively attaching, remove the `for` attribute so\n // that the attached control is used instead of a referenced one.\n this.host.removeAttribute('for');\n }\n\n detach() {\n this.setCurrentControl(null);\n // When imperatively detaching, add an empty `for=\"\"` attribute. This will\n // ensure the control is `null` rather than the `parentElement`.\n this.host.setAttribute('for', '');\n }\n\n /** @private */\n hostConnected() {\n this.setCurrentControl(this.control);\n }\n\n /** @private */\n hostDisconnected() {\n this.setCurrentControl(null);\n }\n\n private setCurrentControl(control: HTMLElement|null) {\n this.onControlChange(this.currentControl, control);\n this.currentControl = control;\n }\n}\n"]}
@@ -30,6 +30,18 @@ export interface FormSubmitter extends ReactiveElement, WithInternals {
30
30
  * - button: The element does nothing.
31
31
  */
32
32
  type: FormSubmitterType;
33
+ /**
34
+ * The HTML name to use in form submission. When combined with a `value`, the
35
+ * submitting button's name/value will be added to the form.
36
+ *
37
+ * Names must reflect to a `name` attribute for form integration.
38
+ */
39
+ name: string;
40
+ /**
41
+ * The value of the button. When combined with a `name`, the submitting
42
+ * button's name/value will be added to the form.
43
+ */
44
+ value: string;
33
45
  }
34
46
  type FormSubmitterConstructor = (new () => FormSubmitter) | (abstract new () => FormSubmitter);
35
47
  /**
@@ -36,7 +36,8 @@ export function setupFormSubmitter(ctor) {
36
36
  ctor.addInitializer(instance => {
37
37
  const submitter = instance;
38
38
  submitter.addEventListener('click', async (event) => {
39
- const { type, [internals]: { form } } = submitter;
39
+ const { type, [internals]: elementInternals } = submitter;
40
+ const { form } = elementInternals;
40
41
  if (!form || type === 'button') {
41
42
  return;
42
43
  }
@@ -62,6 +63,7 @@ export function setupFormSubmitter(ctor) {
62
63
  get: () => submitter,
63
64
  });
64
65
  }, { capture: true, once: true });
66
+ elementInternals.setFormValue(submitter.value);
65
67
  form.requestSubmit();
66
68
  });
67
69
  });
@@ -1 +1 @@
1
- {"version":3,"file":"form-submitter.js","sourceRoot":"","sources":["form-submitter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,OAAO,EAAC,QAAQ,EAAkB,MAAM,KAAK,CAAC;AAE9C,OAAO,EAAC,SAAS,EAAgB,MAAM,wBAAwB,CAAC;AAiChE;;;;;;;;;;;;;;;;;;;;;;;GAuBG;AACH,MAAM,UAAU,kBAAkB,CAAC,IAA8B;IAC/D,IAAI,QAAQ,EAAE;QACZ,OAAO;KACR;IAEA,IAA0C,CAAC,cAAc,CAAC,QAAQ,CAAC,EAAE;QACpE,MAAM,SAAS,GAAG,QAAyB,CAAC;QAC5C,SAAS,CAAC,gBAAgB,CAAC,OAAO,EAAE,KAAK,EAAC,KAAK,EAAC,EAAE;YAChD,MAAM,EAAC,IAAI,EAAE,CAAC,SAAS,CAAC,EAAE,EAAC,IAAI,EAAC,EAAC,GAAG,SAAS,CAAC;YAC9C,IAAI,CAAC,IAAI,IAAI,IAAI,KAAK,QAAQ,EAAE;gBAC9B,OAAO;aACR;YAED,mDAAmD;YACnD,MAAM,IAAI,OAAO,CAAO,OAAO,CAAC,EAAE;gBAChC,OAAO,EAAE,CAAC;YACZ,CAAC,CAAC,CAAC;YAEH,IAAI,KAAK,CAAC,gBAAgB,EAAE;gBAC1B,OAAO;aACR;YAED,IAAI,IAAI,KAAK,OAAO,EAAE;gBACpB,IAAI,CAAC,KAAK,EAAE,CAAC;gBACb,OAAO;aACR;YAED,0EAA0E;YAC1E,wEAAwE;YACxE,eAAe;YACf,uDAAuD;YACvD,IAAI,CAAC,gBAAgB,CAAC,QAAQ,EAAE,WAAW,CAAC,EAAE;gBAC5C,MAAM,CAAC,cAAc,CAAC,WAAW,EAAE,WAAW,EAAE;oBAC9C,YAAY,EAAE,IAAI;oBAClB,UAAU,EAAE,IAAI;oBAChB,GAAG,EAAE,GAAG,EAAE,CAAC,SAAS;iBACrB,CAAC,CAAC;YACL,CAAC,EAAE,EAAC,OAAO,EAAE,IAAI,EAAE,IAAI,EAAE,IAAI,EAAC,CAAC,CAAC;YAEhC,IAAI,CAAC,aAAa,EAAE,CAAC;QACvB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {isServer, ReactiveElement} from 'lit';\n\nimport {internals, WithInternals} from './element-internals.js';\n\n/**\n * A string indicating the form submission behavior of the element.\n *\n * - submit: The element submits the form. This is the default value if the\n * attribute is not specified, or if it is dynamically changed to an empty or\n * invalid value.\n * - reset: The element resets the form.\n * - button: The element does nothing.\n */\nexport type FormSubmitterType = 'button'|'submit'|'reset';\n\n/**\n * An element that can submit or reset a `<form>`, similar to\n * `<button type=\"submit\">`.\n */\nexport interface FormSubmitter extends ReactiveElement, WithInternals {\n /**\n * A string indicating the form submission behavior of the element.\n *\n * - submit: The element submits the form. This is the default value if the\n * attribute is not specified, or if it is dynamically changed to an empty or\n * invalid value.\n * - reset: The element resets the form.\n * - button: The element does nothing.\n */\n type: FormSubmitterType;\n}\n\ntype FormSubmitterConstructor =\n (new () => FormSubmitter)|(abstract new () => FormSubmitter);\n\n/**\n * Sets up an element's constructor to enable form submission. The element\n * instance should be form associated and have a `type` property.\n *\n * A click listener is added to each element instance. If the click is not\n * default prevented, it will submit the element's form, if any.\n *\n * @example\n * ```ts\n * class MyElement extends LitElement {\n * static {\n * setupFormSubmitter(MyElement);\n * }\n *\n * static formAssociated = true;\n *\n * type: FormSubmitterType = 'submit';\n *\n * [internals] = this.attachInternals();\n * }\n * ```\n *\n * @param ctor The form submitter element's constructor.\n */\nexport function setupFormSubmitter(ctor: FormSubmitterConstructor) {\n if (isServer) {\n return;\n }\n\n (ctor as unknown as typeof ReactiveElement).addInitializer(instance => {\n const submitter = instance as FormSubmitter;\n submitter.addEventListener('click', async event => {\n const {type, [internals]: {form}} = submitter;\n if (!form || type === 'button') {\n return;\n }\n\n // Wait a microtask for event bubbling to complete.\n await new Promise<void>(resolve => {\n resolve();\n });\n\n if (event.defaultPrevented) {\n return;\n }\n\n if (type === 'reset') {\n form.reset();\n return;\n }\n\n // form.requestSubmit(submitter) does not work with form associated custom\n // elements. This patches the dispatched submit event to add the correct\n // `submitter`.\n // See https://github.com/WICG/webcomponents/issues/814\n form.addEventListener('submit', submitEvent => {\n Object.defineProperty(submitEvent, 'submitter', {\n configurable: true,\n enumerable: true,\n get: () => submitter,\n });\n }, {capture: true, once: true});\n\n form.requestSubmit();\n });\n });\n}\n"]}
1
+ {"version":3,"file":"form-submitter.js","sourceRoot":"","sources":["form-submitter.ts"],"names":[],"mappings":"AAAA;;;;GAIG;AAEH,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,gBAAgB,CAAC,YAAY,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC;YAC/C,IAAI,CAAC,aAAa,EAAE,CAAC;QACvB,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2023 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n\nimport {isServer, ReactiveElement} from 'lit';\n\nimport {internals, WithInternals} from './element-internals.js';\n\n/**\n * A string indicating the form submission behavior of the element.\n *\n * - submit: The element submits the form. This is the default value if the\n * attribute is not specified, or if it is dynamically changed to an empty or\n * invalid value.\n * - reset: The element resets the form.\n * - button: The element does nothing.\n */\nexport type FormSubmitterType = 'button'|'submit'|'reset';\n\n/**\n * An element that can submit or reset a `<form>`, similar to\n * `<button type=\"submit\">`.\n */\nexport interface FormSubmitter extends ReactiveElement, WithInternals {\n /**\n * A string indicating the form submission behavior of the element.\n *\n * - submit: The element submits the form. This is the default value if the\n * attribute is not specified, or if it is dynamically changed to an empty or\n * invalid value.\n * - reset: The element resets the form.\n * - button: The element does nothing.\n */\n type: FormSubmitterType;\n\n /**\n * The HTML name to use in form submission. When combined with a `value`, the\n * submitting button's name/value will be added to the form.\n *\n * Names must reflect to a `name` attribute for form integration.\n */\n name: string;\n\n /**\n * The value of the button. When combined with a `name`, the submitting\n * button's name/value will be added to the form.\n */\n value: string;\n}\n\ntype FormSubmitterConstructor =\n (new () => FormSubmitter)|(abstract new () => FormSubmitter);\n\n/**\n * Sets up an element's constructor to enable form submission. The element\n * instance should be form associated and have a `type` property.\n *\n * A click listener is added to each element instance. If the click is not\n * default prevented, it will submit the element's form, if any.\n *\n * @example\n * ```ts\n * class MyElement extends LitElement {\n * static {\n * setupFormSubmitter(MyElement);\n * }\n *\n * static formAssociated = true;\n *\n * type: FormSubmitterType = 'submit';\n *\n * [internals] = this.attachInternals();\n * }\n * ```\n *\n * @param ctor The form submitter element's constructor.\n */\nexport function setupFormSubmitter(ctor: FormSubmitterConstructor) {\n if (isServer) {\n return;\n }\n\n (ctor as unknown as typeof ReactiveElement).addInitializer(instance => {\n const submitter = instance as FormSubmitter;\n submitter.addEventListener('click', async event => {\n const {type, [internals]: elementInternals} = submitter;\n const {form} = elementInternals;\n if (!form || type === 'button') {\n return;\n }\n\n // Wait a microtask for event bubbling to complete.\n await new Promise<void>(resolve => {\n resolve();\n });\n\n if (event.defaultPrevented) {\n return;\n }\n\n if (type === 'reset') {\n form.reset();\n return;\n }\n\n // form.requestSubmit(submitter) does not work with form associated custom\n // elements. This patches the dispatched submit event to add the correct\n // `submitter`.\n // See https://github.com/WICG/webcomponents/issues/814\n form.addEventListener('submit', submitEvent => {\n Object.defineProperty(submitEvent, 'submitter', {\n configurable: true,\n enumerable: true,\n get: () => submitter,\n });\n }, {capture: true, once: true});\n\n elementInternals.setFormValue(submitter.value);\n form.requestSubmit();\n });\n });\n}\n"]}
@@ -7,26 +7,29 @@
7
7
  // Selector '.md3-*' should only be used in this project.
8
8
 
9
9
  // go/keep-sorted start
10
- @use '../../../internal/sass/theme';
11
10
  @use '../../../tokens';
12
11
  // go/keep-sorted end
13
12
 
14
- $_custom-property-prefix: 'badge';
15
-
16
13
  @mixin theme($tokens) {
17
- $tokens: theme.validate-theme(tokens.md-comp-badge-values(), $tokens);
18
- $tokens: theme.create-theme-vars($tokens, $_custom-property-prefix);
14
+ // $supported-tokens: tokens.$md-comp-badge-supported-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
+ // }
19
20
 
20
- @include theme.emit-theme-vars($tokens);
21
+ @if $value {
22
+ --md-badge-#{$token}: #{$value};
23
+ }
24
+ }
21
25
  }
22
26
 
23
27
  @mixin styles() {
24
28
  $tokens: tokens.md-comp-badge-values();
25
- $tokens: theme.create-theme-vars($tokens, $_custom-property-prefix);
26
29
 
27
30
  :host {
28
31
  @each $token, $value in $tokens {
29
- --_#{$token}: #{$value};
32
+ --_#{$token}: var(--md-badge-#{$token}, #{$value});
30
33
  }
31
34
  }
32
35
 
@@ -59,11 +62,15 @@ $_custom-property-prefix: 'badge';
59
62
 
60
63
  .md3-badge__value {
61
64
  padding: 0px 4px;
65
+ text-align: center;
62
66
  }
63
67
  }
64
68
  }
65
69
 
66
70
  .md3-badge__value {
67
- font: var(--_large-label-text-type);
71
+ font-family: var(--_large-label-text-font);
72
+ font-size: var(--_large-label-text-size);
73
+ line-height: var(--_large-label-text-line-height);
74
+ font-weight: var(--_large-label-text-weight);
68
75
  }
69
76
  }
@@ -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{--_color: var(--md-badge-color, var(--md-sys-color-error, #b3261e));--_large-color: var(--md-badge-large-color, var(--md-sys-color-error, #b3261e));--_large-label-text-color: var(--md-badge-large-label-text-color, var(--md-sys-color-on-error, #fff));--_large-label-text-type: var(--md-badge-large-label-text-type, var(--md-sys-typescale-label-small, 500 0.688rem / 1rem var(--md-ref-typeface-plain, Roboto)));--_large-shape: var(--md-badge-large-shape, 9999px);--_large-size: var(--md-badge-large-size, 16px);--_shape: var(--md-badge-shape, 9999px);--_size: var(--md-badge-size, 6px)}.md3-badge{inset-inline-start:50%;margin-inline-start:6px;margin-block-start:4px;position:absolute;inset-block-start:0px;background-color:var(--_color);border-radius:var(--_shape);height:var(--_size)}.md3-badge:not(.md3-badge--large){width:var(--_size)}.md3-badge.md3-badge--large{display:flex;flex-direction:column;justify-content:center;margin-inline-start:2px;margin-block-start:1px;background-color:var(--_large-color);border-radius:var(--_large-shape);height:var(--_large-size);min-width:var(--_large-size);color:var(--_large-label-text-color)}.md3-badge.md3-badge--large .md3-badge__value{padding:0px 4px}.md3-badge__value{font:var(--_large-label-text-type)}/*# sourceMappingURL=badge-styles.css.map */
7
+ export const styles = css `:host{--_color: var(--md-badge-color, var(--md-sys-color-error, #b3261e));--_large-color: var(--md-badge-large-color, var(--md-sys-color-error, #b3261e));--_large-label-text-color: var(--md-badge-large-label-text-color, var(--md-sys-color-on-error, #fff));--_large-label-text-font: var(--md-badge-large-label-text-font, var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto)));--_large-label-text-line-height: var(--md-badge-large-label-text-line-height, var(--md-sys-typescale-label-small-line-height, 1rem));--_large-label-text-size: var(--md-badge-large-label-text-size, var(--md-sys-typescale-label-small-size, 0.688rem));--_large-label-text-weight: var(--md-badge-large-label-text-weight, var(--md-sys-typescale-label-small-weight, var(--md-ref-typeface-weight-medium, 500)));--_large-shape: var(--md-badge-large-shape, 9999px);--_large-size: var(--md-badge-large-size, 16px);--_shape: var(--md-badge-shape, 9999px);--_size: var(--md-badge-size, 6px)}.md3-badge{inset-inline-start:50%;margin-inline-start:6px;margin-block-start:4px;position:absolute;inset-block-start:0px;background-color:var(--_color);border-radius:var(--_shape);height:var(--_size)}.md3-badge:not(.md3-badge--large){width:var(--_size)}.md3-badge.md3-badge--large{display:flex;flex-direction:column;justify-content:center;margin-inline-start:2px;margin-block-start:1px;background-color:var(--_large-color);border-radius:var(--_large-shape);height:var(--_large-size);min-width:var(--_large-size);color:var(--_large-label-text-color)}.md3-badge.md3-badge--large .md3-badge__value{padding:0px 4px;text-align:center}.md3-badge__value{font-family:var(--_large-label-text-font);font-size:var(--_large-label-text-size);line-height:var(--_large-label-text-line-height);font-weight:var(--_large-label-text-weight)}/*# sourceMappingURL=badge-styles.css.map */
8
8
  `;
9
9
  //# sourceMappingURL=badge-styles.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"badge-styles.css.js","sourceRoot":"","sources":["badge-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{--_color: var(--md-badge-color, var(--md-sys-color-error, #b3261e));--_large-color: var(--md-badge-large-color, var(--md-sys-color-error, #b3261e));--_large-label-text-color: var(--md-badge-large-label-text-color, var(--md-sys-color-on-error, #fff));--_large-label-text-type: var(--md-badge-large-label-text-type, var(--md-sys-typescale-label-small, 500 0.688rem / 1rem var(--md-ref-typeface-plain, Roboto)));--_large-shape: var(--md-badge-large-shape, 9999px);--_large-size: var(--md-badge-large-size, 16px);--_shape: var(--md-badge-shape, 9999px);--_size: var(--md-badge-size, 6px)}.md3-badge{inset-inline-start:50%;margin-inline-start:6px;margin-block-start:4px;position:absolute;inset-block-start:0px;background-color:var(--_color);border-radius:var(--_shape);height:var(--_size)}.md3-badge:not(.md3-badge--large){width:var(--_size)}.md3-badge.md3-badge--large{display:flex;flex-direction:column;justify-content:center;margin-inline-start:2px;margin-block-start:1px;background-color:var(--_large-color);border-radius:var(--_large-shape);height:var(--_large-size);min-width:var(--_large-size);color:var(--_large-label-text-color)}.md3-badge.md3-badge--large .md3-badge__value{padding:0px 4px}.md3-badge__value{font:var(--_large-label-text-type)}/*# sourceMappingURL=badge-styles.css.map */\n`;\n "]}
1
+ {"version":3,"file":"badge-styles.css.js","sourceRoot":"","sources":["badge-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{--_color: var(--md-badge-color, var(--md-sys-color-error, #b3261e));--_large-color: var(--md-badge-large-color, var(--md-sys-color-error, #b3261e));--_large-label-text-color: var(--md-badge-large-label-text-color, var(--md-sys-color-on-error, #fff));--_large-label-text-font: var(--md-badge-large-label-text-font, var(--md-sys-typescale-label-small-font, var(--md-ref-typeface-plain, Roboto)));--_large-label-text-line-height: var(--md-badge-large-label-text-line-height, var(--md-sys-typescale-label-small-line-height, 1rem));--_large-label-text-size: var(--md-badge-large-label-text-size, var(--md-sys-typescale-label-small-size, 0.688rem));--_large-label-text-weight: var(--md-badge-large-label-text-weight, var(--md-sys-typescale-label-small-weight, var(--md-ref-typeface-weight-medium, 500)));--_large-shape: var(--md-badge-large-shape, 9999px);--_large-size: var(--md-badge-large-size, 16px);--_shape: var(--md-badge-shape, 9999px);--_size: var(--md-badge-size, 6px)}.md3-badge{inset-inline-start:50%;margin-inline-start:6px;margin-block-start:4px;position:absolute;inset-block-start:0px;background-color:var(--_color);border-radius:var(--_shape);height:var(--_size)}.md3-badge:not(.md3-badge--large){width:var(--_size)}.md3-badge.md3-badge--large{display:flex;flex-direction:column;justify-content:center;margin-inline-start:2px;margin-block-start:1px;background-color:var(--_large-color);border-radius:var(--_large-shape);height:var(--_large-size);min-width:var(--_large-size);color:var(--_large-label-text-color)}.md3-badge.md3-badge--large .md3-badge__value{padding:0px 4px;text-align:center}.md3-badge__value{font-family:var(--_large-label-text-font);font-size:var(--_large-label-text-size);line-height:var(--_large-label-text-line-height);font-weight:var(--_large-label-text-weight)}/*# sourceMappingURL=badge-styles.css.map */\n`;\n "]}
@@ -11,29 +11,31 @@
11
11
  // go/keep-sorted end
12
12
  // go/keep-sorted start
13
13
  @use '../../../elevation/elevation';
14
- @use '../../../internal/sass/theme';
15
14
  @use '../../../tokens';
16
15
  // go/keep-sorted end
17
16
 
18
17
  $_md-sys-motion: tokens.md-sys-motion-values();
19
18
 
20
19
  @mixin theme($tokens) {
21
- $tokens: theme.validate-theme(
22
- tokens.md-comp-navigation-bar-values(),
23
- $tokens
24
- );
25
- $tokens: theme.create-theme-vars($tokens, 'navigation-bar');
20
+ // $supported-tokens: tokens.$md-comp-navigation-bar-supported-tokens;
26
21
 
27
- @include theme.emit-theme-vars($tokens);
22
+ @each $token, $value in $tokens {
23
+ // @if list.index($supported-tokens, $token) == null {
24
+ // @error 'Token `#{$token}` is not a supported token.';
25
+ // }
26
+
27
+ @if $value {
28
+ --md-navigation-bar-#{$token}: #{$value};
29
+ }
30
+ }
28
31
  }
29
32
 
30
33
  @mixin styles() {
31
34
  $tokens: tokens.md-comp-navigation-bar-values();
32
- $tokens: theme.create-theme-vars($tokens, 'navigation-bar');
33
35
 
34
36
  :host {
35
37
  @each $token, $value in $tokens {
36
- --_#{$token}: #{$value};
38
+ --_#{$token}: var(--md-navigation-bar-#{$token}, #{$value});
37
39
  }
38
40
 
39
41
  @include elevation.theme(
@@ -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{--_active-indicator-color: var(--md-navigation-bar-active-indicator-color, var(--md-sys-color-secondary-container, #e8def8));--_active-indicator-height: var(--md-navigation-bar-active-indicator-height, 32px);--_active-indicator-shape: var(--md-navigation-bar-active-indicator-shape, 9999px);--_active-indicator-width: var(--md-navigation-bar-active-indicator-width, 64px);--_active-focus-icon-color: var(--md-navigation-bar-active-focus-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_active-focus-label-text-color: var(--md-navigation-bar-active-focus-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_active-focus-state-layer-color: var(--md-navigation-bar-active-focus-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_active-hover-icon-color: var(--md-navigation-bar-active-hover-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_active-hover-label-text-color: var(--md-navigation-bar-active-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_active-hover-state-layer-color: var(--md-navigation-bar-active-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_active-icon-color: var(--md-navigation-bar-active-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_active-label-text-color: var(--md-navigation-bar-active-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_active-label-text-weight: var(--md-navigation-bar-active-label-text-weight, 700);--_active-pressed-icon-color: var(--md-navigation-bar-active-pressed-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_active-pressed-label-text-color: var(--md-navigation-bar-active-pressed-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_active-pressed-state-layer-color: var(--md-navigation-bar-active-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_container-color: var(--md-navigation-bar-container-color, var(--md-sys-color-surface-container, #f3edf7));--_container-elevation: var(--md-navigation-bar-container-elevation, 2);--_container-height: var(--md-navigation-bar-container-height, 80px);--_container-shape: var(--md-navigation-bar-container-shape, 0px);--_focus-state-layer-opacity: var(--md-navigation-bar-focus-state-layer-opacity, 0.12);--_hover-state-layer-opacity: var(--md-navigation-bar-hover-state-layer-opacity, 0.08);--_icon-size: var(--md-navigation-bar-icon-size, 24px);--_inactive-focus-icon-color: var(--md-navigation-bar-inactive-focus-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-focus-label-text-color: var(--md-navigation-bar-inactive-focus-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-focus-state-layer-color: var(--md-navigation-bar-inactive-focus-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-hover-icon-color: var(--md-navigation-bar-inactive-hover-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-hover-label-text-color: var(--md-navigation-bar-inactive-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-hover-state-layer-color: var(--md-navigation-bar-inactive-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-icon-color: var(--md-navigation-bar-inactive-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_inactive-label-text-color: var(--md-navigation-bar-inactive-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_inactive-pressed-icon-color: var(--md-navigation-bar-inactive-pressed-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-pressed-label-text-color: var(--md-navigation-bar-inactive-pressed-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-pressed-state-layer-color: var(--md-navigation-bar-inactive-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_label-text-font: var(--md-navigation-bar-label-text-font, var(--md-ref-typeface-plain, Roboto));--_label-text-line-height: var(--md-navigation-bar-label-text-line-height, 1rem);--_label-text-size: var(--md-navigation-bar-label-text-size, 0.75rem);--_label-text-tracking: var(--md-navigation-bar-label-text-tracking, 0.031rem);--_label-text-type: var(--md-navigation-bar-label-text-type, 500 0.75rem / 1rem var(--md-ref-typeface-plain, Roboto));--_label-text-weight: var(--md-navigation-bar-label-text-weight, 500);--_pressed-state-layer-opacity: var(--md-navigation-bar-pressed-state-layer-opacity, 0.12);--md-elevation-level:var(--_container-elevation);--md-elevation-shadow-color:var(--_container-shadow-color);width:100%}.md3-navigation-bar{display:flex;position:relative;width:100%;background-color:var(--_container-color);border-radius:var(--_container-shape);height:var(--_container-height)}.md3-navigation-bar .md3-navigation-bar__tabs-slot-container{display:inherit;width:inherit}md-elevation{transition-duration:280ms;z-index:0}/*# sourceMappingURL=navigation-bar-styles.css.map */
7
+ export const styles = css `:host{--_active-indicator-color: var(--md-navigation-bar-active-indicator-color, var(--md-sys-color-secondary-container, #e8def8));--_active-indicator-height: var(--md-navigation-bar-active-indicator-height, 32px);--_active-indicator-shape: var(--md-navigation-bar-active-indicator-shape, 9999px);--_active-indicator-width: var(--md-navigation-bar-active-indicator-width, 64px);--_active-focus-icon-color: var(--md-navigation-bar-active-focus-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_active-focus-label-text-color: var(--md-navigation-bar-active-focus-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_active-focus-state-layer-color: var(--md-navigation-bar-active-focus-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_active-hover-icon-color: var(--md-navigation-bar-active-hover-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_active-hover-label-text-color: var(--md-navigation-bar-active-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_active-hover-state-layer-color: var(--md-navigation-bar-active-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_active-icon-color: var(--md-navigation-bar-active-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_active-label-text-color: var(--md-navigation-bar-active-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_active-label-text-weight: var(--md-navigation-bar-active-label-text-weight, var(--md-ref-typeface-weight-bold, 700));--_active-pressed-icon-color: var(--md-navigation-bar-active-pressed-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_active-pressed-label-text-color: var(--md-navigation-bar-active-pressed-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_active-pressed-state-layer-color: var(--md-navigation-bar-active-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_container-color: var(--md-navigation-bar-container-color, var(--md-sys-color-surface-container, #f3edf7));--_container-elevation: var(--md-navigation-bar-container-elevation, 2);--_container-height: var(--md-navigation-bar-container-height, 80px);--_container-shape: var(--md-navigation-bar-container-shape, 0px);--_focus-state-layer-opacity: var(--md-navigation-bar-focus-state-layer-opacity, 0.12);--_hover-state-layer-opacity: var(--md-navigation-bar-hover-state-layer-opacity, 0.08);--_icon-size: var(--md-navigation-bar-icon-size, 24px);--_inactive-focus-icon-color: var(--md-navigation-bar-inactive-focus-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-focus-label-text-color: var(--md-navigation-bar-inactive-focus-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-focus-state-layer-color: var(--md-navigation-bar-inactive-focus-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-hover-icon-color: var(--md-navigation-bar-inactive-hover-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-hover-label-text-color: var(--md-navigation-bar-inactive-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-hover-state-layer-color: var(--md-navigation-bar-inactive-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-icon-color: var(--md-navigation-bar-inactive-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_inactive-label-text-color: var(--md-navigation-bar-inactive-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_inactive-pressed-icon-color: var(--md-navigation-bar-inactive-pressed-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-pressed-label-text-color: var(--md-navigation-bar-inactive-pressed-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-pressed-state-layer-color: var(--md-navigation-bar-inactive-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_label-text-font: var(--md-navigation-bar-label-text-font, var(--md-sys-typescale-label-medium-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-navigation-bar-label-text-line-height, var(--md-sys-typescale-label-medium-line-height, 1rem));--_label-text-size: var(--md-navigation-bar-label-text-size, var(--md-sys-typescale-label-medium-size, 0.75rem));--_label-text-tracking: var(--md-navigation-bar-label-text-tracking, 0.031rem);--_label-text-type: var(--md-navigation-bar-label-text-type, var(--md-sys-typescale-label-medium-weight, var(--md-ref-typeface-weight-medium, 500)) var(--md-sys-typescale-label-medium-size, 0.75rem) / var(--md-sys-typescale-label-medium-line-height, 1rem) var(--md-sys-typescale-label-medium-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-weight: var(--md-navigation-bar-label-text-weight, var(--md-sys-typescale-label-medium-weight, var(--md-ref-typeface-weight-medium, 500)));--_pressed-state-layer-opacity: var(--md-navigation-bar-pressed-state-layer-opacity, 0.12);--md-elevation-level: var(--_container-elevation);--md-elevation-shadow-color: var(--_container-shadow-color);width:100%}.md3-navigation-bar{display:flex;position:relative;width:100%;background-color:var(--_container-color);border-radius:var(--_container-shape);height:var(--_container-height)}.md3-navigation-bar .md3-navigation-bar__tabs-slot-container{display:inherit;width:inherit}md-elevation{transition-duration:280ms;z-index:0}/*# sourceMappingURL=navigation-bar-styles.css.map */
8
8
  `;
9
9
  //# sourceMappingURL=navigation-bar-styles.css.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"navigation-bar-styles.css.js","sourceRoot":"","sources":["navigation-bar-styles.css.ts"],"names":[],"mappings":"AAAA;;;;IAII;AACH,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;CACzB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n import {css} from 'lit';\n export const styles = css`:host{--_active-indicator-color: var(--md-navigation-bar-active-indicator-color, var(--md-sys-color-secondary-container, #e8def8));--_active-indicator-height: var(--md-navigation-bar-active-indicator-height, 32px);--_active-indicator-shape: var(--md-navigation-bar-active-indicator-shape, 9999px);--_active-indicator-width: var(--md-navigation-bar-active-indicator-width, 64px);--_active-focus-icon-color: var(--md-navigation-bar-active-focus-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_active-focus-label-text-color: var(--md-navigation-bar-active-focus-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_active-focus-state-layer-color: var(--md-navigation-bar-active-focus-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_active-hover-icon-color: var(--md-navigation-bar-active-hover-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_active-hover-label-text-color: var(--md-navigation-bar-active-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_active-hover-state-layer-color: var(--md-navigation-bar-active-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_active-icon-color: var(--md-navigation-bar-active-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_active-label-text-color: var(--md-navigation-bar-active-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_active-label-text-weight: var(--md-navigation-bar-active-label-text-weight, 700);--_active-pressed-icon-color: var(--md-navigation-bar-active-pressed-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_active-pressed-label-text-color: var(--md-navigation-bar-active-pressed-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_active-pressed-state-layer-color: var(--md-navigation-bar-active-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_container-color: var(--md-navigation-bar-container-color, var(--md-sys-color-surface-container, #f3edf7));--_container-elevation: var(--md-navigation-bar-container-elevation, 2);--_container-height: var(--md-navigation-bar-container-height, 80px);--_container-shape: var(--md-navigation-bar-container-shape, 0px);--_focus-state-layer-opacity: var(--md-navigation-bar-focus-state-layer-opacity, 0.12);--_hover-state-layer-opacity: var(--md-navigation-bar-hover-state-layer-opacity, 0.08);--_icon-size: var(--md-navigation-bar-icon-size, 24px);--_inactive-focus-icon-color: var(--md-navigation-bar-inactive-focus-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-focus-label-text-color: var(--md-navigation-bar-inactive-focus-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-focus-state-layer-color: var(--md-navigation-bar-inactive-focus-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-hover-icon-color: var(--md-navigation-bar-inactive-hover-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-hover-label-text-color: var(--md-navigation-bar-inactive-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-hover-state-layer-color: var(--md-navigation-bar-inactive-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-icon-color: var(--md-navigation-bar-inactive-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_inactive-label-text-color: var(--md-navigation-bar-inactive-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_inactive-pressed-icon-color: var(--md-navigation-bar-inactive-pressed-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-pressed-label-text-color: var(--md-navigation-bar-inactive-pressed-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-pressed-state-layer-color: var(--md-navigation-bar-inactive-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_label-text-font: var(--md-navigation-bar-label-text-font, var(--md-ref-typeface-plain, Roboto));--_label-text-line-height: var(--md-navigation-bar-label-text-line-height, 1rem);--_label-text-size: var(--md-navigation-bar-label-text-size, 0.75rem);--_label-text-tracking: var(--md-navigation-bar-label-text-tracking, 0.031rem);--_label-text-type: var(--md-navigation-bar-label-text-type, 500 0.75rem / 1rem var(--md-ref-typeface-plain, Roboto));--_label-text-weight: var(--md-navigation-bar-label-text-weight, 500);--_pressed-state-layer-opacity: var(--md-navigation-bar-pressed-state-layer-opacity, 0.12);--md-elevation-level:var(--_container-elevation);--md-elevation-shadow-color:var(--_container-shadow-color);width:100%}.md3-navigation-bar{display:flex;position:relative;width:100%;background-color:var(--_container-color);border-radius:var(--_container-shape);height:var(--_container-height)}.md3-navigation-bar .md3-navigation-bar__tabs-slot-container{display:inherit;width:inherit}md-elevation{transition-duration:280ms;z-index:0}/*# sourceMappingURL=navigation-bar-styles.css.map */\n`;\n "]}
1
+ {"version":3,"file":"navigation-bar-styles.css.js","sourceRoot":"","sources":["navigation-bar-styles.css.ts"],"names":[],"mappings":"AAAA;;;;IAII;AACH,OAAO,EAAC,GAAG,EAAC,MAAM,KAAK,CAAC;AACxB,MAAM,CAAC,MAAM,MAAM,GAAG,GAAG,CAAA;CACzB,CAAC","sourcesContent":["/**\n * @license\n * Copyright 2022 Google LLC\n * SPDX-License-Identifier: Apache-2.0\n */\n import {css} from 'lit';\n export const styles = css`:host{--_active-indicator-color: var(--md-navigation-bar-active-indicator-color, var(--md-sys-color-secondary-container, #e8def8));--_active-indicator-height: var(--md-navigation-bar-active-indicator-height, 32px);--_active-indicator-shape: var(--md-navigation-bar-active-indicator-shape, 9999px);--_active-indicator-width: var(--md-navigation-bar-active-indicator-width, 64px);--_active-focus-icon-color: var(--md-navigation-bar-active-focus-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_active-focus-label-text-color: var(--md-navigation-bar-active-focus-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_active-focus-state-layer-color: var(--md-navigation-bar-active-focus-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_active-hover-icon-color: var(--md-navigation-bar-active-hover-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_active-hover-label-text-color: var(--md-navigation-bar-active-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_active-hover-state-layer-color: var(--md-navigation-bar-active-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_active-icon-color: var(--md-navigation-bar-active-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_active-label-text-color: var(--md-navigation-bar-active-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_active-label-text-weight: var(--md-navigation-bar-active-label-text-weight, var(--md-ref-typeface-weight-bold, 700));--_active-pressed-icon-color: var(--md-navigation-bar-active-pressed-icon-color, var(--md-sys-color-on-secondary-container, #1d192b));--_active-pressed-label-text-color: var(--md-navigation-bar-active-pressed-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_active-pressed-state-layer-color: var(--md-navigation-bar-active-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_container-color: var(--md-navigation-bar-container-color, var(--md-sys-color-surface-container, #f3edf7));--_container-elevation: var(--md-navigation-bar-container-elevation, 2);--_container-height: var(--md-navigation-bar-container-height, 80px);--_container-shape: var(--md-navigation-bar-container-shape, 0px);--_focus-state-layer-opacity: var(--md-navigation-bar-focus-state-layer-opacity, 0.12);--_hover-state-layer-opacity: var(--md-navigation-bar-hover-state-layer-opacity, 0.08);--_icon-size: var(--md-navigation-bar-icon-size, 24px);--_inactive-focus-icon-color: var(--md-navigation-bar-inactive-focus-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-focus-label-text-color: var(--md-navigation-bar-inactive-focus-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-focus-state-layer-color: var(--md-navigation-bar-inactive-focus-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-hover-icon-color: var(--md-navigation-bar-inactive-hover-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-hover-label-text-color: var(--md-navigation-bar-inactive-hover-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-hover-state-layer-color: var(--md-navigation-bar-inactive-hover-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-icon-color: var(--md-navigation-bar-inactive-icon-color, var(--md-sys-color-on-surface-variant, #49454f));--_inactive-label-text-color: var(--md-navigation-bar-inactive-label-text-color, var(--md-sys-color-on-surface-variant, #49454f));--_inactive-pressed-icon-color: var(--md-navigation-bar-inactive-pressed-icon-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-pressed-label-text-color: var(--md-navigation-bar-inactive-pressed-label-text-color, var(--md-sys-color-on-surface, #1d1b20));--_inactive-pressed-state-layer-color: var(--md-navigation-bar-inactive-pressed-state-layer-color, var(--md-sys-color-on-surface, #1d1b20));--_label-text-font: var(--md-navigation-bar-label-text-font, var(--md-sys-typescale-label-medium-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-line-height: var(--md-navigation-bar-label-text-line-height, var(--md-sys-typescale-label-medium-line-height, 1rem));--_label-text-size: var(--md-navigation-bar-label-text-size, var(--md-sys-typescale-label-medium-size, 0.75rem));--_label-text-tracking: var(--md-navigation-bar-label-text-tracking, 0.031rem);--_label-text-type: var(--md-navigation-bar-label-text-type, var(--md-sys-typescale-label-medium-weight, var(--md-ref-typeface-weight-medium, 500)) var(--md-sys-typescale-label-medium-size, 0.75rem) / var(--md-sys-typescale-label-medium-line-height, 1rem) var(--md-sys-typescale-label-medium-font, var(--md-ref-typeface-plain, Roboto)));--_label-text-weight: var(--md-navigation-bar-label-text-weight, var(--md-sys-typescale-label-medium-weight, var(--md-ref-typeface-weight-medium, 500)));--_pressed-state-layer-opacity: var(--md-navigation-bar-pressed-state-layer-opacity, 0.12);--md-elevation-level: var(--_container-elevation);--md-elevation-shadow-color: var(--_container-shadow-color);width:100%}.md3-navigation-bar{display:flex;position:relative;width:100%;background-color:var(--_container-color);border-radius:var(--_container-shape);height:var(--_container-height)}.md3-navigation-bar .md3-navigation-bar__tabs-slot-container{display:inherit;width:inherit}md-elevation{transition-duration:280ms;z-index:0}/*# sourceMappingURL=navigation-bar-styles.css.map */\n`;\n "]}