@material/web 2.5.1-nightly.efaa189.0 → 2.5.1-nightly.fd45953.0

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 (351) hide show
  1. package/button/internal/button.d.ts +10 -0
  2. package/button/internal/button.js +23 -2
  3. package/button/internal/button.js.map +1 -1
  4. package/chips/internal/assist-chip.d.ts +10 -0
  5. package/chips/internal/assist-chip.js +20 -1
  6. package/chips/internal/assist-chip.js.map +1 -1
  7. package/chips/internal/chip.js +3 -1
  8. package/chips/internal/chip.js.map +1 -1
  9. package/chips/internal/input-chip.d.ts +10 -0
  10. package/chips/internal/input-chip.js +20 -1
  11. package/chips/internal/input-chip.js.map +1 -1
  12. package/custom-elements.json +32255 -21722
  13. package/iconbutton/internal/icon-button.d.ts +10 -0
  14. package/iconbutton/internal/icon-button.js +21 -2
  15. package/iconbutton/internal/icon-button.js.map +1 -1
  16. package/internal/directives/safe-href.d.ts +23 -0
  17. package/internal/directives/safe-href.js +44 -0
  18. package/internal/directives/safe-href.js.map +1 -0
  19. package/labs/aria/buttons/keyboard_click_handler.d.ts +25 -0
  20. package/labs/aria/buttons/keyboard_click_handler.js +74 -0
  21. package/labs/aria/buttons/keyboard_click_handler.js.map +1 -0
  22. package/labs/aria/buttons/md-aria-toggle.d.ts +29 -0
  23. package/labs/aria/buttons/md-aria-toggle.js +67 -0
  24. package/labs/aria/buttons/md-aria-toggle.js.map +1 -0
  25. package/labs/aria/buttons/toggle.d.ts +40 -0
  26. package/labs/aria/buttons/toggle.js +100 -0
  27. package/labs/aria/buttons/toggle.js.map +1 -0
  28. package/labs/aria/command.d.ts +18 -0
  29. package/labs/aria/command.js +204 -0
  30. package/labs/aria/command.js.map +1 -0
  31. package/labs/aria/menu/fieldset.d.ts +36 -0
  32. package/labs/aria/menu/fieldset.js +103 -0
  33. package/labs/aria/menu/fieldset.js.map +1 -0
  34. package/labs/aria/menu/internal.d.ts +15 -0
  35. package/labs/aria/menu/internal.js +16 -0
  36. package/labs/aria/menu/internal.js.map +1 -0
  37. package/labs/aria/menu/md-aria-fieldset.d.ts +11 -0
  38. package/labs/aria/menu/md-aria-fieldset.js +8 -0
  39. package/labs/aria/menu/md-aria-fieldset.js.map +1 -0
  40. package/labs/aria/menu/md-aria-menubar.d.ts +11 -0
  41. package/labs/aria/menu/md-aria-menubar.js +8 -0
  42. package/labs/aria/menu/md-aria-menubar.js.map +1 -0
  43. package/labs/aria/menu/md-aria-menuitem.d.ts +11 -0
  44. package/labs/aria/menu/md-aria-menuitem.js +8 -0
  45. package/labs/aria/menu/md-aria-menuitem.js.map +1 -0
  46. package/labs/aria/menu/md-aria-menulist.d.ts +11 -0
  47. package/labs/aria/menu/md-aria-menulist.js +8 -0
  48. package/labs/aria/menu/md-aria-menulist.js.map +1 -0
  49. package/labs/aria/menu/menubar.d.ts +15 -0
  50. package/labs/aria/menu/menubar.js +45 -0
  51. package/labs/aria/menu/menubar.js.map +1 -0
  52. package/labs/aria/menu/menuitem.d.ts +59 -0
  53. package/labs/aria/menu/menuitem.js +237 -0
  54. package/labs/aria/menu/menuitem.js.map +1 -0
  55. package/labs/aria/menu/menulist.d.ts +21 -0
  56. package/labs/aria/menu/menulist.js +104 -0
  57. package/labs/aria/menu/menulist.js.map +1 -0
  58. package/labs/aria/menu/shared-slotted-content.d.ts +10 -0
  59. package/labs/aria/menu/shared-slotted-content.js +51 -0
  60. package/labs/aria/menu/shared-slotted-content.js.map +1 -0
  61. package/labs/aria/pseudo-classes.d.ts +19 -0
  62. package/labs/aria/pseudo-classes.js +22 -0
  63. package/labs/aria/pseudo-classes.js.map +1 -0
  64. package/labs/aria/query-associated.d.ts +23 -0
  65. package/labs/aria/query-associated.js +36 -0
  66. package/labs/aria/query-associated.js.map +1 -0
  67. package/labs/aria/tabs/md-aria-tab.d.ts +11 -0
  68. package/labs/aria/tabs/md-aria-tab.js +8 -0
  69. package/labs/aria/tabs/md-aria-tab.js.map +1 -0
  70. package/labs/aria/tabs/md-aria-tablist.d.ts +11 -0
  71. package/labs/aria/tabs/md-aria-tablist.js +8 -0
  72. package/labs/aria/tabs/md-aria-tablist.js.map +1 -0
  73. package/labs/aria/tabs/md-aria-tabpanel.d.ts +11 -0
  74. package/labs/aria/tabs/md-aria-tabpanel.js +8 -0
  75. package/labs/aria/tabs/md-aria-tabpanel.js.map +1 -0
  76. package/labs/aria/tabs/tab.d.ts +33 -0
  77. package/labs/aria/tabs/tab.js +93 -0
  78. package/labs/aria/tabs/tab.js.map +1 -0
  79. package/labs/aria/tabs/tablist.d.ts +65 -0
  80. package/labs/aria/tabs/tablist.js +206 -0
  81. package/labs/aria/tabs/tablist.js.map +1 -0
  82. package/labs/aria/tabs/tabpanel.d.ts +26 -0
  83. package/labs/aria/tabs/tabpanel.js +53 -0
  84. package/labs/aria/tabs/tabpanel.js.map +1 -0
  85. package/labs/gb/components/all.d.ts +72 -0
  86. package/labs/gb/components/all.js +81 -0
  87. package/labs/gb/components/all.js.map +1 -0
  88. package/labs/gb/components/appbar/app-bar-element.d.ts +1 -0
  89. package/labs/gb/components/appbar/app-bar-element.js +1 -0
  90. package/labs/gb/components/appbar/app-bar-element.js.map +1 -1
  91. package/labs/gb/components/appbar/app-bar.css +1 -1
  92. package/labs/gb/components/appbar/app-bar.css.map +1 -1
  93. package/labs/gb/components/appbar/app-bar.cssresult.js +1 -1
  94. package/labs/gb/components/appbar/app-bar.cssresult.js.map +1 -1
  95. package/labs/gb/components/appbar/app-bar.scss +1 -0
  96. package/labs/gb/components/badge/badge-element.d.ts +1 -0
  97. package/labs/gb/components/badge/badge-element.js +1 -0
  98. package/labs/gb/components/badge/badge-element.js.map +1 -1
  99. package/labs/gb/components/badge/badge.css +1 -1
  100. package/labs/gb/components/badge/badge.css.map +1 -1
  101. package/labs/gb/components/badge/badge.cssresult.js +1 -1
  102. package/labs/gb/components/badge/badge.cssresult.js.map +1 -1
  103. package/labs/gb/components/badge/badge.scss +1 -0
  104. package/labs/gb/components/button/_button-tokens.scss +28 -22
  105. package/labs/gb/components/button/button-element.d.ts +20 -5
  106. package/labs/gb/components/button/button-element.js +43 -8
  107. package/labs/gb/components/button/button-element.js.map +1 -1
  108. package/labs/gb/components/button/button.css +1 -1
  109. package/labs/gb/components/button/button.css.map +1 -1
  110. package/labs/gb/components/button/button.cssresult.js +1 -1
  111. package/labs/gb/components/button/button.cssresult.js.map +1 -1
  112. package/labs/gb/components/button/button.js +1 -1
  113. package/labs/gb/components/button/button.js.map +1 -1
  114. package/labs/gb/components/button/button.scss +5 -6
  115. package/labs/gb/components/buttongroup/_button-group-tokens.scss +123 -0
  116. package/labs/gb/components/buttongroup/button-group-element.d.ts +65 -0
  117. package/labs/gb/components/buttongroup/button-group-element.js +277 -0
  118. package/labs/gb/components/buttongroup/button-group-element.js.map +1 -0
  119. package/labs/gb/components/buttongroup/button-group.css +5 -0
  120. package/labs/gb/components/buttongroup/button-group.css.map +1 -0
  121. package/labs/gb/components/buttongroup/button-group.cssresult.d.ts +3 -0
  122. package/labs/gb/components/buttongroup/button-group.cssresult.js +15 -0
  123. package/labs/gb/components/buttongroup/button-group.cssresult.js.map +1 -0
  124. package/labs/gb/components/buttongroup/button-group.d.ts +96 -0
  125. package/labs/gb/components/buttongroup/button-group.js +105 -0
  126. package/labs/gb/components/buttongroup/button-group.js.map +1 -0
  127. package/labs/gb/components/buttongroup/button-group.scss +282 -0
  128. package/labs/gb/components/buttongroup/md-gb-button-group.d.ts +12 -0
  129. package/labs/gb/components/buttongroup/md-gb-button-group.js +8 -0
  130. package/labs/gb/components/buttongroup/md-gb-button-group.js.map +1 -0
  131. package/labs/gb/components/card/card-element.d.ts +1 -0
  132. package/labs/gb/components/card/card-element.js +1 -0
  133. package/labs/gb/components/card/card-element.js.map +1 -1
  134. package/labs/gb/components/checkbox/checkbox-element.d.ts +1 -0
  135. package/labs/gb/components/checkbox/checkbox-element.js +1 -0
  136. package/labs/gb/components/checkbox/checkbox-element.js.map +1 -1
  137. package/labs/gb/components/chip/chip-element.d.ts +11 -0
  138. package/labs/gb/components/chip/chip-element.js +28 -6
  139. package/labs/gb/components/chip/chip-element.js.map +1 -1
  140. package/labs/gb/components/chip/chip.css +1 -1
  141. package/labs/gb/components/chip/chip.css.map +1 -1
  142. package/labs/gb/components/chip/chip.cssresult.js +1 -1
  143. package/labs/gb/components/chip/chip.cssresult.js.map +1 -1
  144. package/labs/gb/components/chip/chip.js +1 -1
  145. package/labs/gb/components/chip/chip.js.map +1 -1
  146. package/labs/gb/components/chip/chip.scss +3 -0
  147. package/labs/gb/components/divider/divider-element.d.ts +1 -0
  148. package/labs/gb/components/divider/divider-element.js +1 -0
  149. package/labs/gb/components/divider/divider-element.js.map +1 -1
  150. package/labs/gb/components/fab/_fab-tokens.scss +4 -1
  151. package/labs/gb/components/fab/fab-element.d.ts +2 -0
  152. package/labs/gb/components/fab/fab-element.js +2 -0
  153. package/labs/gb/components/fab/fab-element.js.map +1 -1
  154. package/labs/gb/components/fab/fab.css +1 -1
  155. package/labs/gb/components/fab/fab.css.map +1 -1
  156. package/labs/gb/components/fab/fab.cssresult.js +1 -1
  157. package/labs/gb/components/fab/fab.cssresult.js.map +1 -1
  158. package/labs/gb/components/fab/fab.scss +2 -0
  159. package/labs/gb/components/iconbutton/_icon-button-tokens.scss +13 -4
  160. package/labs/gb/components/iconbutton/icon-button-element.d.ts +15 -1
  161. package/labs/gb/components/iconbutton/icon-button-element.js +38 -4
  162. package/labs/gb/components/iconbutton/icon-button-element.js.map +1 -1
  163. package/labs/gb/components/iconbutton/icon-button.css +1 -1
  164. package/labs/gb/components/iconbutton/icon-button.css.map +1 -1
  165. package/labs/gb/components/iconbutton/icon-button.cssresult.js +1 -1
  166. package/labs/gb/components/iconbutton/icon-button.cssresult.js.map +1 -1
  167. package/labs/gb/components/iconbutton/icon-button.js +1 -1
  168. package/labs/gb/components/iconbutton/icon-button.js.map +1 -1
  169. package/labs/gb/components/iconbutton/icon-button.scss +8 -0
  170. package/labs/gb/components/list/_list-tokens.scss +11 -14
  171. package/labs/gb/components/list/list-element.d.ts +1 -0
  172. package/labs/gb/components/list/list-element.js +1 -0
  173. package/labs/gb/components/list/list-element.js.map +1 -1
  174. package/labs/gb/components/list/list-item-element.d.ts +5 -0
  175. package/labs/gb/components/list/list-item-element.js +5 -0
  176. package/labs/gb/components/list/list-item-element.js.map +1 -1
  177. package/labs/gb/components/list/list.css +1 -1
  178. package/labs/gb/components/list/list.css.map +1 -1
  179. package/labs/gb/components/list/list.cssresult.js +1 -1
  180. package/labs/gb/components/list/list.cssresult.js.map +1 -1
  181. package/labs/gb/components/list/list.scss +6 -0
  182. package/labs/gb/components/menu/_menu-tokens.scss +45 -16
  183. package/labs/gb/components/menu/menu-element.d.ts +1 -0
  184. package/labs/gb/components/menu/menu-element.js +1 -0
  185. package/labs/gb/components/menu/menu-element.js.map +1 -1
  186. package/labs/gb/components/menu/menu-group-element.d.ts +1 -0
  187. package/labs/gb/components/menu/menu-group-element.js +1 -0
  188. package/labs/gb/components/menu/menu-group-element.js.map +1 -1
  189. package/labs/gb/components/menu/menu-item-element.d.ts +5 -1
  190. package/labs/gb/components/menu/menu-item-element.js +5 -1
  191. package/labs/gb/components/menu/menu-item-element.js.map +1 -1
  192. package/labs/gb/components/menu/menu.css +1 -1
  193. package/labs/gb/components/menu/menu.css.map +1 -1
  194. package/labs/gb/components/menu/menu.cssresult.js +1 -1
  195. package/labs/gb/components/menu/menu.cssresult.js.map +1 -1
  196. package/labs/gb/components/menu/menu.scss +4 -0
  197. package/labs/gb/components/navbar/_nav-bar-tokens.scss +53 -0
  198. package/labs/gb/components/navbar/md-gb-nav-bar-item.d.ts +12 -0
  199. package/labs/gb/components/navbar/md-gb-nav-bar-item.js +10 -0
  200. package/labs/gb/components/navbar/md-gb-nav-bar-item.js.map +1 -0
  201. package/labs/gb/components/navbar/md-gb-nav-bar.d.ts +12 -0
  202. package/labs/gb/components/navbar/md-gb-nav-bar.js +10 -0
  203. package/labs/gb/components/navbar/md-gb-nav-bar.js.map +1 -0
  204. package/labs/gb/components/navbar/nav-bar-element.d.ts +58 -0
  205. package/labs/gb/components/navbar/nav-bar-element.js +116 -0
  206. package/labs/gb/components/navbar/nav-bar-element.js.map +1 -0
  207. package/labs/gb/components/navbar/nav-bar-item-element.d.ts +41 -0
  208. package/labs/gb/components/navbar/nav-bar-item-element.js +146 -0
  209. package/labs/gb/components/navbar/nav-bar-item-element.js.map +1 -0
  210. package/labs/gb/components/navbar/nav-bar.css +4 -0
  211. package/labs/gb/components/navbar/nav-bar.css.map +1 -0
  212. package/labs/gb/components/navbar/nav-bar.cssresult.d.ts +3 -0
  213. package/labs/gb/components/navbar/nav-bar.cssresult.js +14 -0
  214. package/labs/gb/components/navbar/nav-bar.cssresult.js.map +1 -0
  215. package/labs/gb/components/navbar/nav-bar.d.ts +86 -0
  216. package/labs/gb/components/navbar/nav-bar.js +92 -0
  217. package/labs/gb/components/navbar/nav-bar.js.map +1 -0
  218. package/labs/gb/components/navbar/nav-bar.scss +295 -0
  219. package/labs/gb/components/navrail/_nav-rail-tokens.scss +123 -0
  220. package/labs/gb/components/navrail/md-gb-nav-rail-item.d.ts +12 -0
  221. package/labs/gb/components/navrail/md-gb-nav-rail-item.js +10 -0
  222. package/labs/gb/components/navrail/md-gb-nav-rail-item.js.map +1 -0
  223. package/labs/gb/components/navrail/md-gb-nav-rail.d.ts +12 -0
  224. package/labs/gb/components/navrail/md-gb-nav-rail.js +10 -0
  225. package/labs/gb/components/navrail/md-gb-nav-rail.js.map +1 -0
  226. package/labs/gb/components/navrail/nav-rail-element.d.ts +120 -0
  227. package/labs/gb/components/navrail/nav-rail-element.js +366 -0
  228. package/labs/gb/components/navrail/nav-rail-element.js.map +1 -0
  229. package/labs/gb/components/navrail/nav-rail-item-element.d.ts +44 -0
  230. package/labs/gb/components/navrail/nav-rail-item-element.js +178 -0
  231. package/labs/gb/components/navrail/nav-rail-item-element.js.map +1 -0
  232. package/labs/gb/components/navrail/nav-rail.css +4 -0
  233. package/labs/gb/components/navrail/nav-rail.css.map +1 -0
  234. package/labs/gb/components/navrail/nav-rail.cssresult.d.ts +3 -0
  235. package/labs/gb/components/navrail/nav-rail.cssresult.js +14 -0
  236. package/labs/gb/components/navrail/nav-rail.cssresult.js.map +1 -0
  237. package/labs/gb/components/navrail/nav-rail.d.ts +108 -0
  238. package/labs/gb/components/navrail/nav-rail.js +115 -0
  239. package/labs/gb/components/navrail/nav-rail.js.map +1 -0
  240. package/labs/gb/components/navrail/nav-rail.scss +418 -0
  241. package/labs/gb/components/radio/radio-element.d.ts +1 -0
  242. package/labs/gb/components/radio/radio-element.js +1 -0
  243. package/labs/gb/components/radio/radio-element.js.map +1 -1
  244. package/labs/gb/components/shared/pseudo-classes.d.ts +1 -7
  245. package/labs/gb/components/shared/pseudo-classes.js +1 -9
  246. package/labs/gb/components/shared/pseudo-classes.js.map +1 -1
  247. package/labs/gb/components/shared/update-class-list.d.ts +22 -0
  248. package/labs/gb/components/shared/update-class-list.js +26 -0
  249. package/labs/gb/components/shared/update-class-list.js.map +1 -0
  250. package/labs/gb/components/slider/_slider-tokens.scss +86 -0
  251. package/labs/gb/components/slider/md-gb-slider.d.ts +12 -0
  252. package/labs/gb/components/slider/md-gb-slider.js +8 -0
  253. package/labs/gb/components/slider/md-gb-slider.js.map +1 -0
  254. package/labs/gb/components/slider/slider-element.d.ts +147 -0
  255. package/labs/gb/components/slider/slider-element.js +978 -0
  256. package/labs/gb/components/slider/slider-element.js.map +1 -0
  257. package/labs/gb/components/slider/slider.css +1 -0
  258. package/labs/gb/components/slider/slider.css.map +1 -0
  259. package/labs/gb/components/slider/slider.cssresult.d.ts +3 -0
  260. package/labs/gb/components/slider/slider.cssresult.js +11 -0
  261. package/labs/gb/components/slider/slider.cssresult.js.map +1 -0
  262. package/labs/gb/components/slider/slider.d.ts +173 -0
  263. package/labs/gb/components/slider/slider.js +502 -0
  264. package/labs/gb/components/slider/slider.js.map +1 -0
  265. package/labs/gb/components/slider/slider.scss +688 -0
  266. package/labs/gb/components/snackbar/_snackbar-tokens.scss +86 -0
  267. package/labs/gb/components/snackbar/harness.d.ts +32 -0
  268. package/labs/gb/components/snackbar/harness.js +64 -0
  269. package/labs/gb/components/snackbar/harness.js.map +1 -0
  270. package/labs/gb/components/snackbar/md-gb-snackbar.d.ts +12 -0
  271. package/labs/gb/components/snackbar/md-gb-snackbar.js +8 -0
  272. package/labs/gb/components/snackbar/md-gb-snackbar.js.map +1 -0
  273. package/labs/gb/components/snackbar/snackbar-element.d.ts +123 -0
  274. package/labs/gb/components/snackbar/snackbar-element.js +448 -0
  275. package/labs/gb/components/snackbar/snackbar-element.js.map +1 -0
  276. package/labs/gb/components/snackbar/snackbar.css +5 -0
  277. package/labs/gb/components/snackbar/snackbar.css.map +1 -0
  278. package/labs/gb/components/snackbar/snackbar.cssresult.d.ts +3 -0
  279. package/labs/gb/components/snackbar/snackbar.cssresult.js +15 -0
  280. package/labs/gb/components/snackbar/snackbar.cssresult.js.map +1 -0
  281. package/labs/gb/components/snackbar/snackbar.d.ts +54 -0
  282. package/labs/gb/components/snackbar/snackbar.js +72 -0
  283. package/labs/gb/components/snackbar/snackbar.js.map +1 -0
  284. package/labs/gb/components/snackbar/snackbar.scss +384 -0
  285. package/labs/gb/components/splitbutton/split-button-element.d.ts +1 -0
  286. package/labs/gb/components/splitbutton/split-button-element.js +1 -0
  287. package/labs/gb/components/splitbutton/split-button-element.js.map +1 -1
  288. package/labs/gb/components/switch/switch-element.d.ts +1 -0
  289. package/labs/gb/components/switch/switch-element.js +1 -0
  290. package/labs/gb/components/switch/switch-element.js.map +1 -1
  291. package/labs/gb/components/switch/switch.js +5 -2
  292. package/labs/gb/components/switch/switch.js.map +1 -1
  293. package/labs/gb/components/tabs/_tabs-tokens.scss +177 -0
  294. package/labs/gb/components/tabs/md-gb-tab.d.ts +12 -0
  295. package/labs/gb/components/tabs/md-gb-tab.js +8 -0
  296. package/labs/gb/components/tabs/md-gb-tab.js.map +1 -0
  297. package/labs/gb/components/tabs/md-gb-tabs.d.ts +12 -0
  298. package/labs/gb/components/tabs/md-gb-tabs.js +8 -0
  299. package/labs/gb/components/tabs/md-gb-tabs.js.map +1 -0
  300. package/labs/gb/components/tabs/tab-element.d.ts +42 -0
  301. package/labs/gb/components/tabs/tab-element.js +75 -0
  302. package/labs/gb/components/tabs/tab-element.js.map +1 -0
  303. package/labs/gb/components/tabs/tabs-element.d.ts +37 -0
  304. package/labs/gb/components/tabs/tabs-element.js +67 -0
  305. package/labs/gb/components/tabs/tabs-element.js.map +1 -0
  306. package/labs/gb/components/tabs/tabs.css +4 -0
  307. package/labs/gb/components/tabs/tabs.css.map +1 -0
  308. package/labs/gb/components/tabs/tabs.cssresult.d.ts +3 -0
  309. package/labs/gb/components/tabs/tabs.cssresult.js +14 -0
  310. package/labs/gb/components/tabs/tabs.cssresult.js.map +1 -0
  311. package/labs/gb/components/tabs/tabs.d.ts +98 -0
  312. package/labs/gb/components/tabs/tabs.js +112 -0
  313. package/labs/gb/components/tabs/tabs.js.map +1 -0
  314. package/labs/gb/components/tabs/tabs.scss +301 -0
  315. package/labs/gb/components/toolbar/_toolbar-tokens.scss +70 -0
  316. package/labs/gb/components/toolbar/md-gb-toolbar.d.ts +12 -0
  317. package/labs/gb/components/toolbar/md-gb-toolbar.js +8 -0
  318. package/labs/gb/components/toolbar/md-gb-toolbar.js.map +1 -0
  319. package/labs/gb/components/toolbar/toolbar-element.d.ts +56 -0
  320. package/labs/gb/components/toolbar/toolbar-element.js +120 -0
  321. package/labs/gb/components/toolbar/toolbar-element.js.map +1 -0
  322. package/labs/gb/components/toolbar/toolbar.css +4 -0
  323. package/labs/gb/components/toolbar/toolbar.css.map +1 -0
  324. package/labs/gb/components/toolbar/toolbar.cssresult.d.ts +3 -0
  325. package/labs/gb/components/toolbar/toolbar.cssresult.js +14 -0
  326. package/labs/gb/components/toolbar/toolbar.cssresult.js.map +1 -0
  327. package/labs/gb/components/toolbar/toolbar.d.ts +56 -0
  328. package/labs/gb/components/toolbar/toolbar.js +60 -0
  329. package/labs/gb/components/toolbar/toolbar.js.map +1 -0
  330. package/labs/gb/components/toolbar/toolbar.scss +240 -0
  331. package/labs/gb/styles/icon/icon-element.d.ts +1 -0
  332. package/labs/gb/styles/icon/icon-element.js +1 -0
  333. package/labs/gb/styles/icon/icon-element.js.map +1 -1
  334. package/labs/gb/styles/tailwind.css +1 -1
  335. package/labs/gb/styles/tailwind.css.map +1 -1
  336. package/labs/gb/styles/tailwind.cssresult.js +1 -1
  337. package/labs/gb/styles/tailwind.cssresult.js.map +1 -1
  338. package/labs/gb/styles/tailwind.scss +2 -0
  339. package/list/internal/listitem/list-item.d.ts +10 -0
  340. package/list/internal/listitem/list-item.js +20 -1
  341. package/list/internal/listitem/list-item.js.map +1 -1
  342. package/menu/internal/menuitem/menu-item.d.ts +10 -0
  343. package/menu/internal/menuitem/menu-item.js +20 -1
  344. package/menu/internal/menuitem/menu-item.js.map +1 -1
  345. package/package.json +2 -1
  346. package/radio/internal/single-selection-controller.js +4 -1
  347. package/radio/internal/single-selection-controller.js.map +1 -1
  348. package/testing/harness.js +3 -0
  349. package/testing/harness.js.map +1 -1
  350. package/types/command-event.d.ts +34 -0
  351. package/types/popover.d.ts +25 -0
@@ -0,0 +1,978 @@
1
+ /**
2
+ * @license
3
+ * Copyright 2026 Google LLC
4
+ * SPDX-License-Identifier: Apache-2.0
5
+ */
6
+ import { __decorate } from "tslib";
7
+ import { html, isServer, LitElement, nothing, } from 'lit';
8
+ import { property, query, state } from 'lit/decorators.js';
9
+ import { classMap } from 'lit/directives/class-map.js';
10
+ import { styleMap } from 'lit/directives/style-map.js';
11
+ import { when } from 'lit/directives/when.js';
12
+ import { mixinDelegatesAria } from '../../../../internal/aria/delegate.js';
13
+ import { dispatchActivationClick, isActivationClick, } from '../../../../internal/events/form-label-activation.js';
14
+ import { redispatchEvent } from '../../../../internal/events/redispatch-event.js';
15
+ import { mixinElementInternals } from '../../../behaviors/element-internals.js';
16
+ import { getFormValue, mixinFormAssociated, } from '../../../behaviors/form-associated.js';
17
+ import { computeSliderProperties, formatValueIndicatorLabel, handleClasses, handleNubClasses, sliderClasses, } from './slider.js';
18
+ import focusRingStyles from '../focus/focus-ring.css' with { type: 'css' }; // github-only
19
+ // import focusRingStyles from '../focus/focus-ring.cssresult.js'; // google3-only
20
+ import sliderStyles from './slider.css' with { type: 'css' }; // github-only
21
+ // Separate variable needed for closure.
22
+ const baseClass = mixinDelegatesAria(mixinFormAssociated(mixinElementInternals(LitElement)));
23
+ /**
24
+ * A Material Design slider component.
25
+ *
26
+ * This component does not format numbers; formatting is the application's
27
+ * responsibility via `valueLabel` and `ariaValueText*`.
28
+ * Note: An optional leading inset icon slot (`slot="icon"`) is supported on
29
+ * the standard horizontal slider only (not range, not centered, and not
30
+ * vertical) for sizes `md`, `lg`, and `xl`. Slotted icons should use
31
+ * `<md-gb-icon slot="icon">` (e.g.
32
+ * `<md-gb-icon slot="icon">volume_up</md-gb-icon>`).
33
+ *
34
+ * @fires {InputEvent} input - Fired when the slider value changes from user interaction. --bubbles --composed
35
+ * @fires {Event} change - Fired when the slider value commit changes from user interaction. --bubbles
36
+ * @cssprop --active-track-color
37
+ * @cssprop --inactive-track-color
38
+ * @cssprop --handle-color
39
+ * @cssprop --handle-shape
40
+ * @cssprop --handle-width
41
+ * @cssprop --focus-handle-width
42
+ * @cssprop --handle-height
43
+ * @cssprop --active-handle-leading-space
44
+ * @cssprop --active-track-inner-corner-size
45
+ * @cssprop --stop-indicator-color
46
+ * @cssprop --stop-indicator-color-selected
47
+ * @cssprop --stop-indicator-size
48
+ * @cssprop --stop-indicator-min-spacing
49
+ * @cssprop --track-height
50
+ * @cssprop --track-shape
51
+ * @cssprop --inactive-track-shape-trailing
52
+ * @cssprop --value-indicator-color
53
+ * @cssprop --value-indicator-label-text-color
54
+ * @cssprop --value-indicator-bottom-space
55
+ * @cssprop --value-indicator-width
56
+ * @cssprop --state-layer-size
57
+ * @cssprop --with-overlap-handle-outline-color
58
+ * @cssprop --with-overlap-handle-outline-width
59
+ * @cssprop --icon-size
60
+ * @cssprop --icon-color
61
+ * @cssprop --icon-color-active
62
+ */
63
+ export class SliderElement extends baseClass {
64
+ get isRange() {
65
+ return this.range && this.orientation !== 'vertical';
66
+ }
67
+ get nameStart() {
68
+ return this.getAttribute('name-start') ?? this.name;
69
+ }
70
+ set nameStart(name) {
71
+ this.setAttribute('name-start', name);
72
+ }
73
+ get nameEnd() {
74
+ return this.getAttribute('name-end') ?? this.nameStart;
75
+ }
76
+ set nameEnd(name) {
77
+ this.setAttribute('name-end', name);
78
+ }
79
+ get dragTarget() {
80
+ return this.isPointerDragging
81
+ ? this.action?.target
82
+ : undefined;
83
+ }
84
+ constructor() {
85
+ super();
86
+ this.min = 0;
87
+ this.max = 100;
88
+ this.step = 1;
89
+ this.size = 'xs';
90
+ /**
91
+ * The orientation of the slider.
92
+ *
93
+ * Vertical orientation applies to standard, discrete, and centered variants
94
+ * (range is not supported in vertical orientation).
95
+ */
96
+ this.orientation = 'horizontal';
97
+ this.range = false;
98
+ this.centered = false;
99
+ this.ticks = false;
100
+ this.labeled = false;
101
+ this.disabled = false;
102
+ this.valueLabel = '';
103
+ this.valueLabelStart = '';
104
+ this.valueLabelEnd = '';
105
+ this.ariaLabelStart = '';
106
+ this.ariaLabelEnd = '';
107
+ this.ariaValueTextStart = '';
108
+ this.ariaValueTextEnd = '';
109
+ this.startOnTop = false;
110
+ this.handleStartHover = false;
111
+ this.handleEndHover = false;
112
+ this.startFocusVisible = false;
113
+ this.endFocusVisible = false;
114
+ this.handlesOverlapping = false;
115
+ this.isRedispatchingEvent = false;
116
+ this.pointerDownPending = false;
117
+ this.isPointerDragging = false;
118
+ if (!isServer) {
119
+ this.addEventListener('click', (event) => {
120
+ if (this.disabled || !isActivationClick(event) || !this.inputEnd) {
121
+ return;
122
+ }
123
+ this.focus();
124
+ dispatchActivationClick(this.inputEnd);
125
+ });
126
+ }
127
+ }
128
+ get renderAriaLabelStart() {
129
+ const { ariaLabel } = this;
130
+ return (this.ariaLabelStart ||
131
+ (ariaLabel && `${ariaLabel} start`) ||
132
+ this.valueLabelStart ||
133
+ (this.valueStart !== undefined ? String(this.valueStart) : ''));
134
+ }
135
+ get renderAriaValueTextStart() {
136
+ return (this.ariaValueTextStart ||
137
+ this.valueLabelStart ||
138
+ (this.valueStart !== undefined ? String(this.valueStart) : ''));
139
+ }
140
+ get renderAriaLabelEnd() {
141
+ const { ariaLabel } = this;
142
+ if (this.isRange) {
143
+ return (this.ariaLabelEnd ||
144
+ (ariaLabel && `${ariaLabel} end`) ||
145
+ this.valueLabelEnd ||
146
+ (this.valueEnd !== undefined ? String(this.valueEnd) : ''));
147
+ }
148
+ return (ariaLabel ||
149
+ this.valueLabel ||
150
+ (this.value !== undefined ? String(this.value) : ''));
151
+ }
152
+ get renderAriaValueTextEnd() {
153
+ if (this.isRange) {
154
+ return (this.ariaValueTextEnd ||
155
+ this.valueLabelEnd ||
156
+ (this.valueEnd !== undefined ? String(this.valueEnd) : ''));
157
+ }
158
+ const { ariaValueText } = this;
159
+ return (ariaValueText ||
160
+ this.valueLabel ||
161
+ (this.value !== undefined ? String(this.value) : ''));
162
+ }
163
+ focus() {
164
+ if (this.disabled) {
165
+ return;
166
+ }
167
+ this.inputEnd?.focus();
168
+ }
169
+ connectedCallback() {
170
+ super.connectedCallback();
171
+ this.measureAndObserve();
172
+ }
173
+ disconnectedCallback() {
174
+ this.isPointerDragging = false;
175
+ this.sliderResizeObserver?.disconnect();
176
+ this.sliderResizeObserver = undefined;
177
+ super.disconnectedCallback();
178
+ }
179
+ firstUpdated(changedProperties) {
180
+ super.firstUpdated(changedProperties);
181
+ this.measureAndObserve();
182
+ }
183
+ measureAndObserve() {
184
+ if (isServer || !this.sliderEl)
185
+ return;
186
+ const isVertical = this.orientation === 'vertical';
187
+ const rect = this.sliderEl.getBoundingClientRect();
188
+ const initialLength = Math.round(isVertical ? rect.height : rect.width);
189
+ if (initialLength > 0 && this.trackLength !== initialLength) {
190
+ this.trackLength = initialLength;
191
+ }
192
+ if (!this.sliderResizeObserver) {
193
+ this.sliderResizeObserver = new ResizeObserver((entries) => {
194
+ for (const entry of entries) {
195
+ const isVert = this.orientation === 'vertical';
196
+ const length = Math.round(isVert ? entry.contentRect.height : entry.contentRect.width);
197
+ if (this.trackLength === length)
198
+ continue;
199
+ this.trackLength = length;
200
+ }
201
+ });
202
+ this.sliderResizeObserver.observe(this.sliderEl);
203
+ }
204
+ }
205
+ willUpdate(changed) {
206
+ if (changed.has('disabled') && this.disabled) {
207
+ this.isPointerDragging = false;
208
+ this.pointerDownPending = false;
209
+ this.handleStartHover = false;
210
+ this.handleEndHover = false;
211
+ this.startFocusVisible = false;
212
+ this.endFocusVisible = false;
213
+ this.action = undefined;
214
+ }
215
+ const rangeModeChanged = changed.has('range') || changed.has('orientation');
216
+ this.renderValueStart =
217
+ changed.has('valueStart') || rangeModeChanged
218
+ ? this.valueStart
219
+ : this.inputStart?.valueAsNumber;
220
+ const endValueChanged = (changed.has('valueEnd') && (this.isRange || this.value === undefined)) ||
221
+ changed.has('value') ||
222
+ rangeModeChanged;
223
+ this.renderValueEnd = endValueChanged
224
+ ? this.isRange
225
+ ? this.valueEnd
226
+ : (this.value ?? this.valueEnd)
227
+ : this.inputEnd?.valueAsNumber;
228
+ }
229
+ updated(changed) {
230
+ if (this.isRange && this.inputStart) {
231
+ this.renderValueStart = this.inputStart.valueAsNumber;
232
+ }
233
+ this.renderValueEnd = this.inputEnd.valueAsNumber;
234
+ if (this.isRange && this.inputStart) {
235
+ const segment = (this.max - this.min) / 3;
236
+ if (this.valueStart === undefined) {
237
+ this.inputStart.valueAsNumber = this.min + segment;
238
+ const v = this.inputStart.valueAsNumber;
239
+ this.valueStart = this.renderValueStart = v;
240
+ }
241
+ if (this.valueEnd === undefined) {
242
+ this.inputEnd.valueAsNumber = this.min + 2 * segment;
243
+ const v = this.inputEnd.valueAsNumber;
244
+ this.valueEnd = this.renderValueEnd = v;
245
+ }
246
+ }
247
+ else {
248
+ this.value ??= this.renderValueEnd;
249
+ }
250
+ if (changed.has('range') ||
251
+ changed.has('orientation') ||
252
+ changed.has('renderValueStart') ||
253
+ changed.has('renderValueEnd') ||
254
+ this.isUpdatePending) {
255
+ const startNub = this.handleStart?.querySelector('.slider-handle-nub');
256
+ const endNub = this.handleEnd?.querySelector('.slider-handle-nub');
257
+ this.handlesOverlapping = this.isRange && isOverlapping(startNub, endNub);
258
+ }
259
+ this.performUpdate();
260
+ }
261
+ startAction(event) {
262
+ const target = event.target;
263
+ const fixed = target === this.inputStart ? this.inputEnd : this.inputStart;
264
+ this.action = {
265
+ canFlip: event.type === 'pointerdown',
266
+ flipped: false,
267
+ target,
268
+ fixed,
269
+ values: new Map([
270
+ [target, target.valueAsNumber],
271
+ [fixed, fixed?.valueAsNumber],
272
+ ]),
273
+ };
274
+ this.requestUpdate();
275
+ }
276
+ finishAction() {
277
+ this.action = undefined;
278
+ this.requestUpdate();
279
+ }
280
+ computeFocusVisible(target) {
281
+ return !this.pointerDownPending && target.matches(':focus-visible');
282
+ }
283
+ handleKeydown(event) {
284
+ if (this.disabled || event.key === 'Tab' || event.defaultPrevented) {
285
+ return;
286
+ }
287
+ this.startAction(event);
288
+ const target = event.target;
289
+ const isStart = target === this.inputStart;
290
+ const isFocusVisible = this.computeFocusVisible(target);
291
+ if (isStart) {
292
+ this.startFocusVisible = isFocusVisible;
293
+ }
294
+ else {
295
+ this.endFocusVisible = isFocusVisible;
296
+ }
297
+ const isVertical = this.orientation === 'vertical';
298
+ if (isVertical && !this.disabled) {
299
+ const stepSize = isFinite(Number(this.step)) && Number(this.step) > 0
300
+ ? Number(this.step)
301
+ : (this.max - this.min) / 100 || 1;
302
+ if (event.key === 'ArrowUp' || event.key === 'ArrowRight') {
303
+ event.preventDefault();
304
+ const oldVal = target.valueAsNumber;
305
+ if (this.step === 'any') {
306
+ target.valueAsNumber = Math.min(this.max, target.valueAsNumber + stepSize);
307
+ }
308
+ else {
309
+ target.stepUp();
310
+ }
311
+ if (target.valueAsNumber !== oldVal) {
312
+ target.dispatchEvent(new InputEvent('input', { bubbles: true, composed: true }));
313
+ target.dispatchEvent(new Event('change', { bubbles: true }));
314
+ }
315
+ }
316
+ else if (event.key === 'ArrowDown' || event.key === 'ArrowLeft') {
317
+ event.preventDefault();
318
+ const oldVal = target.valueAsNumber;
319
+ if (this.step === 'any') {
320
+ target.valueAsNumber = Math.max(this.min, target.valueAsNumber - stepSize);
321
+ }
322
+ else {
323
+ target.stepDown();
324
+ }
325
+ if (target.valueAsNumber !== oldVal) {
326
+ target.dispatchEvent(new InputEvent('input', { bubbles: true, composed: true }));
327
+ target.dispatchEvent(new Event('change', { bubbles: true }));
328
+ }
329
+ }
330
+ }
331
+ }
332
+ handleKeyup() {
333
+ this.finishAction();
334
+ }
335
+ handleDown(event) {
336
+ if (this.disabled) {
337
+ return;
338
+ }
339
+ this.pointerDownPending = true;
340
+ this.isPointerDragging = event.isPrimary && event.button === 0;
341
+ try {
342
+ event.target.setPointerCapture?.(event.pointerId);
343
+ }
344
+ catch { }
345
+ this.startAction(event);
346
+ const isStart = event.target === this.inputStart;
347
+ // Since handle moves to pointer on down and there may not be a move,
348
+ // it needs to be considered hovered.
349
+ this.handleStartHover =
350
+ !this.disabled && isStart && Boolean(this.handleStart);
351
+ this.handleEndHover = !this.disabled && !isStart && Boolean(this.handleEnd);
352
+ }
353
+ handleMove(event) {
354
+ if (this.isPointerDragging && event.buttons === 0) {
355
+ this.isPointerDragging = false;
356
+ }
357
+ if (this.disabled) {
358
+ this.handleStartHover = false;
359
+ this.handleEndHover = false;
360
+ return;
361
+ }
362
+ const dragTarget = this.dragTarget;
363
+ if (dragTarget) {
364
+ const isStart = dragTarget === this.inputStart;
365
+ this.handleStartHover = isStart && inBounds(event, this.handleStart);
366
+ this.handleEndHover = !isStart && inBounds(event, this.handleEnd);
367
+ return;
368
+ }
369
+ this.applyNearestHover(event);
370
+ }
371
+ handleEnter(event) {
372
+ this.handleMove(event);
373
+ }
374
+ handleLeave() {
375
+ this.handleStartHover = false;
376
+ this.handleEndHover = false;
377
+ }
378
+ handleCancel() {
379
+ this.isPointerDragging = false;
380
+ this.pointerDownPending = false;
381
+ this.handleLeave();
382
+ this.startOnTop = this.action?.target === this.inputStart;
383
+ this.finishAction();
384
+ }
385
+ handleLostPointerCapture() {
386
+ this.isPointerDragging = false;
387
+ }
388
+ applyNearestHover(event) {
389
+ if (this.disabled) {
390
+ this.handleStartHover = false;
391
+ this.handleEndHover = false;
392
+ return;
393
+ }
394
+ const startInBounds = inBounds(event, this.handleStart);
395
+ const endInBounds = inBounds(event, this.handleEnd);
396
+ if (!this.handleStart || !this.handleEnd) {
397
+ this.handleStartHover = false;
398
+ this.handleEndHover = Boolean(this.handleEnd && endInBounds);
399
+ return;
400
+ }
401
+ if (startInBounds && endInBounds) {
402
+ const distStart = distanceToCenter(event, this.handleStart);
403
+ const distEnd = distanceToCenter(event, this.handleEnd);
404
+ if (Math.abs(distStart - distEnd) < 0.5) {
405
+ const isStart = event.target === this.inputStart;
406
+ this.handleStartHover = isStart;
407
+ this.handleEndHover = !isStart;
408
+ }
409
+ else if (distStart < distEnd) {
410
+ this.handleStartHover = true;
411
+ this.handleEndHover = false;
412
+ }
413
+ else {
414
+ this.handleStartHover = false;
415
+ this.handleEndHover = true;
416
+ }
417
+ }
418
+ else {
419
+ this.handleStartHover = startInBounds;
420
+ this.handleEndHover = endInBounds;
421
+ }
422
+ }
423
+ handleReleaseHover(event) {
424
+ if (event.pointerType === 'touch') {
425
+ this.handleStartHover = false;
426
+ this.handleEndHover = false;
427
+ return;
428
+ }
429
+ this.applyNearestHover(event);
430
+ }
431
+ async handlePointerUp(event) {
432
+ this.isPointerDragging = false;
433
+ await this.handleUp(event);
434
+ this.pointerDownPending = false;
435
+ this.handleReleaseHover(event);
436
+ }
437
+ async handleUp(event) {
438
+ if (!this.action) {
439
+ return;
440
+ }
441
+ const { target, values, flipped } = this.action;
442
+ await new Promise(requestAnimationFrame);
443
+ if (target !== undefined) {
444
+ target.focus();
445
+ if (flipped && target.valueAsNumber !== values.get(target)) {
446
+ target.dispatchEvent(new Event('change', { bubbles: true }));
447
+ }
448
+ }
449
+ this.finishAction();
450
+ }
451
+ updateOnTop(input) {
452
+ this.startOnTop = input.classList.contains('slider-start');
453
+ }
454
+ handleFocus(event) {
455
+ if (this.disabled) {
456
+ this.startFocusVisible = false;
457
+ this.endFocusVisible = false;
458
+ return;
459
+ }
460
+ const target = event.target;
461
+ this.updateOnTop(target);
462
+ const isStart = target === this.inputStart;
463
+ const isFocusVisible = this.computeFocusVisible(target);
464
+ if (isStart) {
465
+ this.startFocusVisible = isFocusVisible;
466
+ }
467
+ else {
468
+ this.endFocusVisible = isFocusVisible;
469
+ }
470
+ }
471
+ handleBlur(event) {
472
+ const isStart = event.target === this.inputStart;
473
+ if (isStart) {
474
+ this.startFocusVisible = false;
475
+ }
476
+ else {
477
+ this.endFocusVisible = false;
478
+ }
479
+ if (!this.isPointerDragging &&
480
+ !this.pointerDownPending &&
481
+ event.target === this.action?.target) {
482
+ this.finishAction();
483
+ }
484
+ }
485
+ needsClamping() {
486
+ if (!this.action) {
487
+ return false;
488
+ }
489
+ const { target, fixed } = this.action;
490
+ const isStart = target === this.inputStart;
491
+ return isStart
492
+ ? target.valueAsNumber > fixed.valueAsNumber
493
+ : target.valueAsNumber < fixed.valueAsNumber;
494
+ }
495
+ isActionFlipped() {
496
+ const { action } = this;
497
+ if (!action) {
498
+ return false;
499
+ }
500
+ const { target, fixed, values } = action;
501
+ if (action.canFlip) {
502
+ action.canFlip = false;
503
+ const coincident = values.get(target) === values.get(fixed);
504
+ if (coincident && this.needsClamping()) {
505
+ action.flipped = true;
506
+ action.target = fixed;
507
+ action.fixed = target;
508
+ }
509
+ }
510
+ return action.flipped;
511
+ }
512
+ flipAction() {
513
+ if (!this.action) {
514
+ return false;
515
+ }
516
+ const { target, fixed, values } = this.action;
517
+ const changed = target.valueAsNumber !== fixed.valueAsNumber;
518
+ target.valueAsNumber = fixed.valueAsNumber;
519
+ fixed.valueAsNumber = values.get(fixed);
520
+ return changed;
521
+ }
522
+ clampAction() {
523
+ if (!this.needsClamping() || !this.action) {
524
+ return false;
525
+ }
526
+ const { target, fixed } = this.action;
527
+ target.valueAsNumber = fixed.valueAsNumber;
528
+ return true;
529
+ }
530
+ handleInput(event) {
531
+ if (this.disabled || this.isRedispatchingEvent) {
532
+ return;
533
+ }
534
+ const target = event.target;
535
+ let stopPropagation = false;
536
+ let redispatch = false;
537
+ if (this.isRange && this.inputStart && this.inputEnd) {
538
+ if (this.action) {
539
+ if (this.isActionFlipped()) {
540
+ stopPropagation = true;
541
+ redispatch = this.flipAction();
542
+ }
543
+ if (this.clampAction()) {
544
+ stopPropagation = true;
545
+ redispatch = false;
546
+ }
547
+ }
548
+ else if (target === this.inputStart &&
549
+ this.inputStart.valueAsNumber > this.inputEnd.valueAsNumber) {
550
+ this.inputStart.valueAsNumber = this.inputEnd.valueAsNumber;
551
+ stopPropagation = true;
552
+ }
553
+ else if (target === this.inputEnd &&
554
+ this.inputEnd.valueAsNumber < this.inputStart.valueAsNumber) {
555
+ this.inputEnd.valueAsNumber = this.inputStart.valueAsNumber;
556
+ stopPropagation = true;
557
+ }
558
+ }
559
+ this.updateOnTop(this.action?.target ?? target);
560
+ if (this.isRange) {
561
+ this.valueStart = this.inputStart.valueAsNumber;
562
+ this.valueEnd = this.inputEnd.valueAsNumber;
563
+ }
564
+ else {
565
+ this.value = this.inputEnd.valueAsNumber;
566
+ }
567
+ if (stopPropagation) {
568
+ event.stopPropagation();
569
+ }
570
+ if (redispatch) {
571
+ this.isRedispatchingEvent = true;
572
+ redispatchEvent(target, event);
573
+ this.isRedispatchingEvent = false;
574
+ }
575
+ }
576
+ handleChange(event) {
577
+ const changeTarget = event.target;
578
+ const { target, values } = this.action ?? {};
579
+ const squelch = target && target.valueAsNumber === values?.get(changeTarget);
580
+ if (!squelch) {
581
+ redispatchEvent(this, event);
582
+ }
583
+ this.finishAction();
584
+ }
585
+ [getFormValue]() {
586
+ if (this.isRange) {
587
+ const data = new FormData();
588
+ data.append(this.nameStart, String(this.valueStart ?? this.renderValueStart ?? this.min));
589
+ data.append(this.nameEnd, String(this.valueEnd ?? this.renderValueEnd ?? this.max));
590
+ return data;
591
+ }
592
+ return String(this.value ?? this.renderValueEnd ?? this.min);
593
+ }
594
+ formResetCallback() {
595
+ if (this.isRange) {
596
+ const valueStart = this.getAttribute('value-start');
597
+ this.valueStart = valueStart !== null ? Number(valueStart) : undefined;
598
+ const valueEnd = this.getAttribute('value-end');
599
+ this.valueEnd = valueEnd !== null ? Number(valueEnd) : undefined;
600
+ return;
601
+ }
602
+ const value = this.getAttribute('value');
603
+ this.value = value !== null ? Number(value) : undefined;
604
+ }
605
+ formStateRestoreCallback(state) {
606
+ if (Array.isArray(state)) {
607
+ const [[, valueStart], [, valueEnd]] = state;
608
+ this.valueStart = Number(valueStart);
609
+ this.valueEnd = Number(valueEnd);
610
+ this.range = true;
611
+ return;
612
+ }
613
+ this.value = Number(state);
614
+ this.range = false;
615
+ }
616
+ render() {
617
+ let minSpacing;
618
+ if (!isServer) {
619
+ const raw = getComputedStyle(this).getPropertyValue('--stop-indicator-min-spacing') ||
620
+ (this.sliderEl
621
+ ? getComputedStyle(this.sliderEl).getPropertyValue('--stop-indicator-min-spacing')
622
+ : '');
623
+ const parsed = Number(raw.replace('px', '').trim());
624
+ if (isFinite(parsed) && parsed > 0) {
625
+ minSpacing = parsed;
626
+ }
627
+ }
628
+ const isVertical = this.orientation === 'vertical';
629
+ const isRange = this.isRange;
630
+ const styles = computeSliderProperties({
631
+ min: this.min,
632
+ max: this.max,
633
+ step: this.step,
634
+ size: this.size,
635
+ range: isRange,
636
+ centered: this.centered,
637
+ vertical: isVertical,
638
+ valueStart: this.renderValueStart,
639
+ valueEnd: this.renderValueEnd,
640
+ value: this.renderValueEnd,
641
+ trackLength: this.trackLength,
642
+ minSpacing,
643
+ });
644
+ const labelStart = this.valueLabelStart || formatValueIndicatorLabel(this.renderValueStart);
645
+ const labelEnd = (isRange ? this.valueLabelEnd : this.valueLabel) ||
646
+ formatValueIndicatorLabel(this.renderValueEnd);
647
+ const dragTarget = this.dragTarget;
648
+ const startOnTop = dragTarget
649
+ ? dragTarget === this.inputStart
650
+ : this.startOnTop;
651
+ const handleStartHover = !this.disabled &&
652
+ this.handleStartHover &&
653
+ (!dragTarget || dragTarget === this.inputStart);
654
+ const handleEndHover = !this.disabled &&
655
+ this.handleEndHover &&
656
+ (!dragTarget || dragTarget === this.inputEnd);
657
+ const isCoincident = isRange &&
658
+ this.renderValueStart !== undefined &&
659
+ this.renderValueStart === this.renderValueEnd;
660
+ const { '--__icon-over-active': _iconOverActive, '--__start-stop-selected': _startStopSelected, '--__end-stop-selected': _endStopSelected, ...cssStyles } = styles;
661
+ return html `
662
+ <div
663
+ class="${classMap(sliderClasses({
664
+ disabled: this.disabled,
665
+ ranged: isRange,
666
+ centered: this.centered,
667
+ vertical: isVertical,
668
+ }))}"
669
+ style=${styleMap(cssStyles)}>
670
+ ${when(isRange, () => html `
671
+ <input
672
+ type="range"
673
+ class="slider-start"
674
+ orient=${isVertical ? 'vertical' : nothing}
675
+ .tabIndex=${1}
676
+ ?disabled=${this.disabled}
677
+ .min=${String(this.min)}
678
+ .max=${String(this.max)}
679
+ .step=${String(this.step)}
680
+ .value=${String(this.renderValueStart)}
681
+ aria-label=${this.renderAriaLabelStart || nothing}
682
+ aria-valuetext=${this.renderAriaValueTextStart || nothing}
683
+ aria-valuemin=${this.min}
684
+ aria-valuemax=${this.valueEnd ?? this.max}
685
+ @keydown=${this.handleKeydown}
686
+ @keyup=${this.handleKeyup}
687
+ @pointerdown=${this.handleDown}
688
+ @pointerup=${this.handlePointerUp}
689
+ @pointercancel=${this.handleCancel}
690
+ @lostpointercapture=${this.handleLostPointerCapture}
691
+ @pointerenter=${this.handleEnter}
692
+ @pointermove=${this.handleMove}
693
+ @pointerleave=${this.handleLeave}
694
+ @input=${this.handleInput}
695
+ @change=${this.handleChange}
696
+ @focus=${this.handleFocus}
697
+ @blur=${this.handleBlur} />
698
+ `)}
699
+ <input
700
+ type="range"
701
+ class="slider-end"
702
+ orient=${isVertical ? 'vertical' : nothing}
703
+ .tabIndex=${0}
704
+ ?disabled=${this.disabled}
705
+ .min=${String(this.min)}
706
+ .max=${String(this.max)}
707
+ .step=${String(this.step)}
708
+ .value=${String(this.renderValueEnd)}
709
+ aria-label=${this.renderAriaLabelEnd || nothing}
710
+ aria-valuetext=${this.renderAriaValueTextEnd || nothing}
711
+ aria-valuemin=${isRange ? (this.valueStart ?? this.min) : this.min}
712
+ aria-valuemax=${this.max}
713
+ @keydown=${this.handleKeydown}
714
+ @keyup=${this.handleKeyup}
715
+ @pointerdown=${this.handleDown}
716
+ @pointerup=${this.handlePointerUp}
717
+ @pointercancel=${this.handleCancel}
718
+ @lostpointercapture=${this.handleLostPointerCapture}
719
+ @pointerenter=${this.handleEnter}
720
+ @pointermove=${this.handleMove}
721
+ @pointerleave=${this.handleLeave}
722
+ @input=${this.handleInput}
723
+ @change=${this.handleChange}
724
+ @focus=${this.handleFocus}
725
+ @blur=${this.handleBlur} />
726
+
727
+ <div class="slider-track">
728
+ <div
729
+ class="slider-inactive-lead slider-track-box ${classMap({
730
+ 'slider-ticks': this.ticks,
731
+ })}"></div>
732
+ <div
733
+ class="slider-active slider-track-box ${classMap({
734
+ 'slider-ticks': this.ticks,
735
+ })}"></div>
736
+ <div
737
+ class="slider-inactive-trail slider-track-box ${classMap({
738
+ 'slider-ticks': this.ticks,
739
+ })}"></div>
740
+ ${when(!this.ticks, () => html `
741
+ ${when(isRange || this.centered, () => html `<div
742
+ class="slider-boundary-stop slider-start ${classMap({
743
+ 'slider-selected': styles['--__start-stop-selected'] === '1',
744
+ })}"></div>`)}
745
+ <div
746
+ class="slider-boundary-stop slider-end ${classMap({
747
+ 'slider-selected': styles['--__end-stop-selected'] === '1',
748
+ })}"></div>
749
+ `)}
750
+ ${when(!isRange &&
751
+ !this.centered &&
752
+ !isVertical &&
753
+ (this.size === 'md' || this.size === 'lg' || this.size === 'xl'), () => html `
754
+ <div
755
+ class="slider-icon ${classMap({
756
+ 'slider-over-active': styles['--__icon-over-active'] === '1',
757
+ })}"
758
+ aria-hidden="true">
759
+ <slot name="icon"></slot>
760
+ </div>
761
+ `)}
762
+ </div>
763
+
764
+ <div class="slider-handles">
765
+ ${when(isRange, () => html `
766
+ <div
767
+ class="${classMap({
768
+ ...handleClasses({
769
+ start: true,
770
+ hover: handleStartHover,
771
+ active: Boolean(!this.disabled && this.action?.target === this.inputStart),
772
+ focusVisible: !this.disabled && this.startFocusVisible,
773
+ disabled: this.disabled,
774
+ onTop: !this.disabled && startOnTop,
775
+ isOverlapping: isRange && this.handlesOverlapping,
776
+ }),
777
+ 'slider-is-coincident': isCoincident,
778
+ })}">
779
+ <div
780
+ class="${classMap(handleNubClasses({
781
+ focusVisible: !this.disabled && this.startFocusVisible,
782
+ }))}"></div>
783
+ ${when(this.labeled, () => html `<div class="slider-label" aria-hidden="true">
784
+ <span class="slider-label-content">${labelStart}</span>
785
+ </div>`)}
786
+ </div>
787
+ `)}
788
+ <div
789
+ class="${classMap({
790
+ ...handleClasses({
791
+ end: true,
792
+ hover: handleEndHover,
793
+ active: Boolean(!this.disabled && this.action?.target === this.inputEnd),
794
+ focusVisible: !this.disabled && this.endFocusVisible,
795
+ disabled: this.disabled,
796
+ onTop: !this.disabled && !startOnTop,
797
+ isOverlapping: isRange && this.handlesOverlapping,
798
+ }),
799
+ 'slider-is-coincident': isCoincident,
800
+ })}">
801
+ <div
802
+ class="${classMap(handleNubClasses({
803
+ focusVisible: !this.disabled && this.endFocusVisible,
804
+ }))}"></div>
805
+ ${when(this.labeled, () => html `<div class="slider-label" aria-hidden="true">
806
+ <span class="slider-label-content">${labelEnd}</span>
807
+ </div>`)}
808
+ </div>
809
+ </div>
810
+ </div>
811
+ `;
812
+ }
813
+ }
814
+ /** @nocollapse */
815
+ SliderElement.shadowRootOptions = {
816
+ mode: 'open',
817
+ delegatesFocus: true,
818
+ };
819
+ /** @nocollapse */
820
+ SliderElement.styles = [focusRingStyles, sliderStyles];
821
+ __decorate([
822
+ property({ type: Number })
823
+ ], SliderElement.prototype, "min", void 0);
824
+ __decorate([
825
+ property({ type: Number })
826
+ ], SliderElement.prototype, "max", void 0);
827
+ __decorate([
828
+ property({ type: Number })
829
+ ], SliderElement.prototype, "value", void 0);
830
+ __decorate([
831
+ property({ type: Number, attribute: 'value-start' })
832
+ ], SliderElement.prototype, "valueStart", void 0);
833
+ __decorate([
834
+ property({ type: Number, attribute: 'value-end' })
835
+ ], SliderElement.prototype, "valueEnd", void 0);
836
+ __decorate([
837
+ property({
838
+ converter: {
839
+ fromAttribute(value) {
840
+ if (value === 'any')
841
+ return 'any';
842
+ if (value === null || value === '')
843
+ return 1;
844
+ const num = Number(value);
845
+ return isNaN(num) || num <= 0 ? 1 : num;
846
+ },
847
+ toAttribute(value) {
848
+ return String(value);
849
+ },
850
+ },
851
+ })
852
+ ], SliderElement.prototype, "step", void 0);
853
+ __decorate([
854
+ property({ type: String, reflect: true })
855
+ ], SliderElement.prototype, "size", void 0);
856
+ __decorate([
857
+ property({ type: String, reflect: true })
858
+ ], SliderElement.prototype, "orientation", void 0);
859
+ __decorate([
860
+ property({ type: Boolean, reflect: true })
861
+ ], SliderElement.prototype, "range", void 0);
862
+ __decorate([
863
+ property({ type: Boolean, reflect: true })
864
+ ], SliderElement.prototype, "centered", void 0);
865
+ __decorate([
866
+ property({ type: Boolean })
867
+ ], SliderElement.prototype, "ticks", void 0);
868
+ __decorate([
869
+ property({ type: Boolean })
870
+ ], SliderElement.prototype, "labeled", void 0);
871
+ __decorate([
872
+ property({ type: Boolean, reflect: true })
873
+ ], SliderElement.prototype, "disabled", void 0);
874
+ __decorate([
875
+ property({ attribute: 'value-label' })
876
+ ], SliderElement.prototype, "valueLabel", void 0);
877
+ __decorate([
878
+ property({ attribute: 'value-label-start' })
879
+ ], SliderElement.prototype, "valueLabelStart", void 0);
880
+ __decorate([
881
+ property({ attribute: 'value-label-end' })
882
+ ], SliderElement.prototype, "valueLabelEnd", void 0);
883
+ __decorate([
884
+ property({ attribute: 'aria-label-start' })
885
+ ], SliderElement.prototype, "ariaLabelStart", void 0);
886
+ __decorate([
887
+ property({ attribute: 'aria-label-end' })
888
+ ], SliderElement.prototype, "ariaLabelEnd", void 0);
889
+ __decorate([
890
+ property({ attribute: 'aria-valuetext-start' })
891
+ ], SliderElement.prototype, "ariaValueTextStart", void 0);
892
+ __decorate([
893
+ property({ attribute: 'aria-valuetext-end' })
894
+ ], SliderElement.prototype, "ariaValueTextEnd", void 0);
895
+ __decorate([
896
+ query('input.slider-start')
897
+ ], SliderElement.prototype, "inputStart", void 0);
898
+ __decorate([
899
+ query('input.slider-end')
900
+ ], SliderElement.prototype, "inputEnd", void 0);
901
+ __decorate([
902
+ query('.slider-handle.slider-start')
903
+ ], SliderElement.prototype, "handleStart", void 0);
904
+ __decorate([
905
+ query('.slider-handle.slider-end')
906
+ ], SliderElement.prototype, "handleEnd", void 0);
907
+ __decorate([
908
+ query('.slider')
909
+ ], SliderElement.prototype, "sliderEl", void 0);
910
+ __decorate([
911
+ state()
912
+ ], SliderElement.prototype, "renderValueStart", void 0);
913
+ __decorate([
914
+ state()
915
+ ], SliderElement.prototype, "renderValueEnd", void 0);
916
+ __decorate([
917
+ state()
918
+ ], SliderElement.prototype, "startOnTop", void 0);
919
+ __decorate([
920
+ state()
921
+ ], SliderElement.prototype, "handleStartHover", void 0);
922
+ __decorate([
923
+ state()
924
+ ], SliderElement.prototype, "handleEndHover", void 0);
925
+ __decorate([
926
+ state()
927
+ ], SliderElement.prototype, "startFocusVisible", void 0);
928
+ __decorate([
929
+ state()
930
+ ], SliderElement.prototype, "endFocusVisible", void 0);
931
+ __decorate([
932
+ state()
933
+ ], SliderElement.prototype, "handlesOverlapping", void 0);
934
+ __decorate([
935
+ state()
936
+ ], SliderElement.prototype, "trackLength", void 0);
937
+ /**
938
+ * Determines whether a pointer event falls within the bounds of a handle element,
939
+ * applying symmetric hit-area inflation based on `--state-layer-size`.
940
+ *
941
+ * Note: Fine pointers (40px state layer with 44px handle height and 4px handle width)
942
+ * produce inflateX = 18px and inflateY = 0px, maintaining bit-for-bit identical behavior
943
+ * to the legacy horizontal-only hit slop. Coarse pointers (48px state layer) intentionally
944
+ * yield inflateY = 2px ((48 - 44) / 2) because the coarse touch target exceeds the 44px
945
+ * handle height. This is a deliberate small vertical hit-area expansion,
946
+ * not a regression.
947
+ */
948
+ function inBounds({ x, y }, element) {
949
+ if (!element) {
950
+ return false;
951
+ }
952
+ const { top, left, bottom, right } = element.getBoundingClientRect();
953
+ const rawSize = getComputedStyle(element).getPropertyValue('--state-layer-size');
954
+ const size = Number(rawSize.replace('px', '').trim()) || 0;
955
+ const inflateX = Math.max(0, (size - (right - left)) / 2);
956
+ const inflateY = Math.max(0, (size - (bottom - top)) / 2);
957
+ return (x >= left - inflateX &&
958
+ x <= right + inflateX &&
959
+ y >= top - inflateY &&
960
+ y <= bottom + inflateY);
961
+ }
962
+ function distanceToCenter({ x, y }, element) {
963
+ const { top, left, bottom, right } = element.getBoundingClientRect();
964
+ const cx = left + (right - left) / 2;
965
+ const cy = top + (bottom - top) / 2;
966
+ return Math.hypot(x - cx, y - cy);
967
+ }
968
+ function isOverlapping(elA, elB) {
969
+ if (!(elA && elB))
970
+ return false;
971
+ const a = elA.getBoundingClientRect();
972
+ const b = elB.getBoundingClientRect();
973
+ return !(a.top > b.bottom ||
974
+ a.right < b.left ||
975
+ a.bottom < b.top ||
976
+ a.left > b.right);
977
+ }
978
+ //# sourceMappingURL=slider-element.js.map