@expressivecss/expressive 0.15.0 → 0.17.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 (609) hide show
  1. package/CHANGELOG.md +1807 -1
  2. package/README.md +9 -8
  3. package/dist/css/expressive.css +19176 -11958
  4. package/dist/css/expressive.css.map +1 -1
  5. package/dist/css/expressive.min.css +1 -1
  6. package/dist/css/expressive.min.css.map +1 -1
  7. package/dist/fonts/LICENSE-noto-sans-arabic +93 -0
  8. package/dist/fonts/LICENSE-noto-sans-hebrew +93 -0
  9. package/dist/fonts/LICENSE-noto-sans-thai +93 -0
  10. package/dist/fonts/material-symbols-outlined.woff2 +0 -0
  11. package/dist/fonts/material-symbols-rounded.woff2 +0 -0
  12. package/dist/fonts/material-symbols-sharp.woff2 +0 -0
  13. package/dist/fonts/noto-sans-arabic-arabic-400.woff2 +0 -0
  14. package/dist/fonts/noto-sans-arabic-arabic-500.woff2 +0 -0
  15. package/dist/fonts/noto-sans-arabic-arabic-700.woff2 +0 -0
  16. package/dist/fonts/noto-sans-cyrillic-400.woff2 +0 -0
  17. package/dist/fonts/noto-sans-cyrillic-500.woff2 +0 -0
  18. package/dist/fonts/noto-sans-cyrillic-700.woff2 +0 -0
  19. package/dist/fonts/noto-sans-cyrillic-ext-400.woff2 +0 -0
  20. package/dist/fonts/noto-sans-cyrillic-ext-500.woff2 +0 -0
  21. package/dist/fonts/noto-sans-cyrillic-ext-700.woff2 +0 -0
  22. package/dist/fonts/noto-sans-devanagari-400.woff2 +0 -0
  23. package/dist/fonts/noto-sans-devanagari-500.woff2 +0 -0
  24. package/dist/fonts/noto-sans-devanagari-700.woff2 +0 -0
  25. package/dist/fonts/noto-sans-greek-400.woff2 +0 -0
  26. package/dist/fonts/noto-sans-greek-500.woff2 +0 -0
  27. package/dist/fonts/noto-sans-greek-700.woff2 +0 -0
  28. package/dist/fonts/noto-sans-greek-ext-400.woff2 +0 -0
  29. package/dist/fonts/noto-sans-greek-ext-500.woff2 +0 -0
  30. package/dist/fonts/noto-sans-greek-ext-700.woff2 +0 -0
  31. package/dist/fonts/noto-sans-hebrew-hebrew-400.woff2 +0 -0
  32. package/dist/fonts/noto-sans-hebrew-hebrew-500.woff2 +0 -0
  33. package/dist/fonts/noto-sans-hebrew-hebrew-700.woff2 +0 -0
  34. package/dist/fonts/noto-sans-latin-700.woff2 +0 -0
  35. package/dist/fonts/noto-sans-latin-ext-400.woff2 +0 -0
  36. package/dist/fonts/noto-sans-latin-ext-500.woff2 +0 -0
  37. package/dist/fonts/noto-sans-latin-ext-700.woff2 +0 -0
  38. package/dist/fonts/noto-sans-thai-thai-400.woff2 +0 -0
  39. package/dist/fonts/noto-sans-thai-thai-500.woff2 +0 -0
  40. package/dist/fonts/noto-sans-thai-thai-700.woff2 +0 -0
  41. package/dist/fonts/noto-sans-vietnamese-400.woff2 +0 -0
  42. package/dist/fonts/noto-sans-vietnamese-500.woff2 +0 -0
  43. package/dist/fonts/noto-sans-vietnamese-700.woff2 +0 -0
  44. package/dist/fonts/roboto-cyrillic-400.woff2 +0 -0
  45. package/dist/fonts/roboto-cyrillic-500.woff2 +0 -0
  46. package/dist/fonts/roboto-cyrillic-700.woff2 +0 -0
  47. package/dist/fonts/roboto-cyrillic-ext-400.woff2 +0 -0
  48. package/dist/fonts/roboto-cyrillic-ext-500.woff2 +0 -0
  49. package/dist/fonts/roboto-cyrillic-ext-700.woff2 +0 -0
  50. package/dist/fonts/roboto-greek-400.woff2 +0 -0
  51. package/dist/fonts/roboto-greek-500.woff2 +0 -0
  52. package/dist/fonts/roboto-greek-700.woff2 +0 -0
  53. package/dist/fonts/roboto-greek-ext-400.woff2 +0 -0
  54. package/dist/fonts/roboto-greek-ext-500.woff2 +0 -0
  55. package/dist/fonts/roboto-greek-ext-700.woff2 +0 -0
  56. package/dist/fonts/roboto-latin-700.woff2 +0 -0
  57. package/dist/fonts/roboto-latin-ext-400.woff2 +0 -0
  58. package/dist/fonts/roboto-latin-ext-500.woff2 +0 -0
  59. package/dist/fonts/roboto-latin-ext-700.woff2 +0 -0
  60. package/dist/fonts/roboto-vietnamese-400.woff2 +0 -0
  61. package/dist/fonts/roboto-vietnamese-500.woff2 +0 -0
  62. package/dist/fonts/roboto-vietnamese-700.woff2 +0 -0
  63. package/dist/js/chunks/chunk-26VUH75M.mjs +102 -0
  64. package/dist/js/chunks/chunk-26VUH75M.mjs.map +7 -0
  65. package/dist/js/chunks/chunk-2LFCOGC3.mjs +233 -0
  66. package/dist/js/chunks/chunk-2LFCOGC3.mjs.map +7 -0
  67. package/dist/js/chunks/{chunk-DXGRXYYL.mjs → chunk-36GELQGX.mjs} +29 -46
  68. package/dist/js/chunks/chunk-36GELQGX.mjs.map +7 -0
  69. package/dist/js/chunks/{chunk-74MXKKLN.mjs → chunk-3FKWIRHW.mjs} +15 -29
  70. package/dist/js/chunks/chunk-3FKWIRHW.mjs.map +7 -0
  71. package/dist/js/chunks/chunk-3KF65KGL.mjs +209 -0
  72. package/dist/js/chunks/chunk-3KF65KGL.mjs.map +7 -0
  73. package/dist/js/chunks/{chunk-KVJAVDBC.mjs → chunk-3KLZRQZI.mjs} +88 -116
  74. package/dist/js/chunks/chunk-3KLZRQZI.mjs.map +7 -0
  75. package/dist/js/chunks/{chunk-CK2XCICY.mjs → chunk-3XORNED5.mjs} +3 -11
  76. package/dist/js/chunks/chunk-3XORNED5.mjs.map +7 -0
  77. package/dist/js/chunks/chunk-4WBGAQN3.mjs +113 -0
  78. package/dist/js/chunks/chunk-4WBGAQN3.mjs.map +7 -0
  79. package/dist/js/chunks/{chunk-FM5CZOUB.mjs → chunk-5F4URJHL.mjs} +19 -30
  80. package/dist/js/chunks/chunk-5F4URJHL.mjs.map +7 -0
  81. package/dist/js/chunks/chunk-67UNY7RH.mjs +299 -0
  82. package/dist/js/chunks/chunk-67UNY7RH.mjs.map +7 -0
  83. package/dist/js/chunks/chunk-7CXNATJS.mjs +97 -0
  84. package/dist/js/chunks/chunk-7CXNATJS.mjs.map +7 -0
  85. package/dist/js/chunks/{chunk-UETTGDLI.mjs → chunk-7X44MKEQ.mjs} +43 -48
  86. package/dist/js/chunks/chunk-7X44MKEQ.mjs.map +7 -0
  87. package/dist/js/chunks/chunk-7ZAMOMGY.mjs +440 -0
  88. package/dist/js/chunks/chunk-7ZAMOMGY.mjs.map +7 -0
  89. package/dist/js/chunks/chunk-AEG6LOAJ.mjs +54 -0
  90. package/dist/js/chunks/chunk-AEG6LOAJ.mjs.map +7 -0
  91. package/dist/js/chunks/chunk-AQNFCJJ5.mjs +135 -0
  92. package/dist/js/chunks/chunk-AQNFCJJ5.mjs.map +7 -0
  93. package/dist/js/chunks/chunk-B55LWKBM.mjs +75 -0
  94. package/dist/js/chunks/chunk-B55LWKBM.mjs.map +7 -0
  95. package/dist/js/chunks/chunk-BB5VXYXT.mjs +28 -0
  96. package/dist/js/chunks/chunk-BB5VXYXT.mjs.map +7 -0
  97. package/dist/js/chunks/chunk-BDATLH3H.mjs +108 -0
  98. package/dist/js/chunks/chunk-BDATLH3H.mjs.map +7 -0
  99. package/dist/js/chunks/chunk-CWMQOT4O.mjs +232 -0
  100. package/dist/js/chunks/chunk-CWMQOT4O.mjs.map +7 -0
  101. package/dist/js/chunks/chunk-CY2CTOVM.mjs +81 -0
  102. package/dist/js/chunks/chunk-CY2CTOVM.mjs.map +7 -0
  103. package/dist/js/chunks/{chunk-NUHMOAOY.mjs → chunk-DWA5UYLJ.mjs} +363 -218
  104. package/dist/js/chunks/chunk-DWA5UYLJ.mjs.map +7 -0
  105. package/dist/js/chunks/chunk-EB2V4OKL.mjs +79 -0
  106. package/dist/js/chunks/chunk-EB2V4OKL.mjs.map +7 -0
  107. package/dist/js/chunks/chunk-EWO662ZC.mjs +188 -0
  108. package/dist/js/chunks/chunk-EWO662ZC.mjs.map +7 -0
  109. package/dist/js/chunks/{chunk-ZX6M7SWO.mjs → chunk-F7LAKFMX.mjs} +320 -141
  110. package/dist/js/chunks/chunk-F7LAKFMX.mjs.map +7 -0
  111. package/dist/js/chunks/{chunk-L27Q6ZMI.mjs → chunk-FNIIH2LU.mjs} +20 -33
  112. package/dist/js/chunks/chunk-FNIIH2LU.mjs.map +7 -0
  113. package/dist/js/chunks/chunk-GE3YMFS6.mjs +15 -0
  114. package/dist/js/chunks/chunk-GE3YMFS6.mjs.map +7 -0
  115. package/dist/js/chunks/chunk-GFWYMWYN.mjs +125 -0
  116. package/dist/js/chunks/chunk-GFWYMWYN.mjs.map +7 -0
  117. package/dist/js/chunks/chunk-GNRSYMVH.mjs +1 -0
  118. package/dist/js/chunks/chunk-H5ISU45X.mjs +87 -0
  119. package/dist/js/chunks/chunk-H5ISU45X.mjs.map +7 -0
  120. package/dist/js/chunks/{chunk-GJL6GCIU.mjs → chunk-H6YIKFAQ.mjs} +311 -186
  121. package/dist/js/chunks/chunk-H6YIKFAQ.mjs.map +7 -0
  122. package/dist/js/chunks/{chunk-BGZLF6JZ.mjs → chunk-HEH7E3KO.mjs} +155 -35
  123. package/dist/js/chunks/chunk-HEH7E3KO.mjs.map +7 -0
  124. package/dist/js/chunks/chunk-HQRLBTNM.mjs +152 -0
  125. package/dist/js/chunks/chunk-HQRLBTNM.mjs.map +7 -0
  126. package/dist/js/chunks/chunk-I2F7MLUU.mjs +137 -0
  127. package/dist/js/chunks/chunk-I2F7MLUU.mjs.map +7 -0
  128. package/dist/js/chunks/chunk-IQOTGGHX.mjs +797 -0
  129. package/dist/js/chunks/chunk-IQOTGGHX.mjs.map +7 -0
  130. package/dist/js/chunks/chunk-JH3YWKA6.mjs +225 -0
  131. package/dist/js/chunks/chunk-JH3YWKA6.mjs.map +7 -0
  132. package/dist/js/chunks/chunk-JOLJAYIJ.mjs +7 -0
  133. package/dist/js/chunks/chunk-JOLJAYIJ.mjs.map +7 -0
  134. package/dist/js/chunks/{chunk-VGNYF6FB.mjs → chunk-KOTGMCMI.mjs} +116 -24
  135. package/dist/js/chunks/chunk-KOTGMCMI.mjs.map +7 -0
  136. package/dist/js/chunks/{chunk-LQWUDNHZ.mjs → chunk-LC4O5LFS.mjs} +21 -45
  137. package/dist/js/chunks/chunk-LC4O5LFS.mjs.map +7 -0
  138. package/dist/js/chunks/chunk-LEF33SCP.mjs +127 -0
  139. package/dist/js/chunks/chunk-LEF33SCP.mjs.map +7 -0
  140. package/dist/js/chunks/{chunk-PDG64UHF.mjs → chunk-LFORZRPH.mjs} +21 -23
  141. package/dist/js/chunks/chunk-LFORZRPH.mjs.map +7 -0
  142. package/dist/js/chunks/chunk-LWLNV5EC.mjs +451 -0
  143. package/dist/js/chunks/chunk-LWLNV5EC.mjs.map +7 -0
  144. package/dist/js/chunks/chunk-LXRHUQAX.mjs +491 -0
  145. package/dist/js/chunks/chunk-LXRHUQAX.mjs.map +7 -0
  146. package/dist/js/chunks/{chunk-SFI2U4YW.mjs → chunk-MA2SZZFB.mjs} +82 -111
  147. package/dist/js/chunks/chunk-MA2SZZFB.mjs.map +7 -0
  148. package/dist/js/chunks/chunk-MDBZAMIV.mjs +121 -0
  149. package/dist/js/chunks/chunk-MDBZAMIV.mjs.map +7 -0
  150. package/dist/js/chunks/chunk-NODZ5VAD.mjs +75 -0
  151. package/dist/js/chunks/chunk-NODZ5VAD.mjs.map +7 -0
  152. package/dist/js/chunks/chunk-O2WJB6TH.mjs +365 -0
  153. package/dist/js/chunks/chunk-O2WJB6TH.mjs.map +7 -0
  154. package/dist/js/chunks/chunk-PCABY5BN.mjs +35 -0
  155. package/dist/js/chunks/chunk-PCABY5BN.mjs.map +7 -0
  156. package/dist/js/chunks/chunk-PWKYVMND.mjs +120 -0
  157. package/dist/js/chunks/chunk-PWKYVMND.mjs.map +7 -0
  158. package/dist/js/chunks/{chunk-SMY7GJSS.mjs → chunk-QHZZT7YO.mjs} +66 -38
  159. package/dist/js/chunks/chunk-QHZZT7YO.mjs.map +7 -0
  160. package/dist/js/chunks/chunk-QND56EW2.mjs +439 -0
  161. package/dist/js/chunks/chunk-QND56EW2.mjs.map +7 -0
  162. package/dist/js/chunks/chunk-QNODAANY.mjs +376 -0
  163. package/dist/js/chunks/chunk-QNODAANY.mjs.map +7 -0
  164. package/dist/js/chunks/{chunk-KHXZ2A4K.mjs → chunk-QRO5FV3I.mjs} +156 -73
  165. package/dist/js/chunks/chunk-QRO5FV3I.mjs.map +7 -0
  166. package/dist/js/chunks/chunk-R7A7JRC5.mjs +440 -0
  167. package/dist/js/chunks/chunk-R7A7JRC5.mjs.map +7 -0
  168. package/dist/js/chunks/chunk-RKG2CBFE.mjs +74 -0
  169. package/dist/js/chunks/chunk-RKG2CBFE.mjs.map +7 -0
  170. package/dist/js/chunks/{chunk-XAEAEHIX.mjs → chunk-RSNS5OYS.mjs} +38 -25
  171. package/dist/js/chunks/chunk-RSNS5OYS.mjs.map +7 -0
  172. package/dist/js/chunks/{chunk-X4ISMKE2.mjs → chunk-RUDYMEJ3.mjs} +7 -6
  173. package/dist/js/chunks/chunk-RUDYMEJ3.mjs.map +7 -0
  174. package/dist/js/chunks/chunk-STJR62SU.mjs +161 -0
  175. package/dist/js/chunks/chunk-STJR62SU.mjs.map +7 -0
  176. package/dist/js/chunks/chunk-SUSD4UTN.mjs +220 -0
  177. package/dist/js/chunks/chunk-SUSD4UTN.mjs.map +7 -0
  178. package/dist/js/chunks/{chunk-5CEAOLUA.mjs → chunk-SYBOA5HC.mjs} +26 -48
  179. package/dist/js/chunks/chunk-SYBOA5HC.mjs.map +7 -0
  180. package/dist/js/chunks/chunk-T4MOBP3J.mjs +108 -0
  181. package/dist/js/chunks/chunk-T4MOBP3J.mjs.map +7 -0
  182. package/dist/js/chunks/chunk-TM7HPGTV.mjs +342 -0
  183. package/dist/js/chunks/chunk-TM7HPGTV.mjs.map +7 -0
  184. package/dist/js/chunks/{chunk-C6CHEWYP.mjs → chunk-TMQDZSDC.mjs} +71 -35
  185. package/dist/js/chunks/chunk-TMQDZSDC.mjs.map +7 -0
  186. package/dist/js/chunks/chunk-TVSX5YA2.mjs +48 -0
  187. package/dist/js/chunks/chunk-TVSX5YA2.mjs.map +7 -0
  188. package/dist/js/chunks/chunk-UHO5CV6K.mjs +80 -0
  189. package/dist/js/chunks/chunk-UHO5CV6K.mjs.map +7 -0
  190. package/dist/js/chunks/chunk-UKCNELUN.mjs +223 -0
  191. package/dist/js/chunks/chunk-UKCNELUN.mjs.map +7 -0
  192. package/dist/js/chunks/chunk-UKQK5GWR.mjs +167 -0
  193. package/dist/js/chunks/chunk-UKQK5GWR.mjs.map +7 -0
  194. package/dist/js/chunks/{chunk-TSZYSW7F.mjs → chunk-UTSLYQ65.mjs} +21 -48
  195. package/dist/js/chunks/chunk-UTSLYQ65.mjs.map +7 -0
  196. package/dist/js/chunks/chunk-VS5OJBOD.mjs +108 -0
  197. package/dist/js/chunks/chunk-VS5OJBOD.mjs.map +7 -0
  198. package/dist/js/chunks/chunk-VZMROW5A.mjs +759 -0
  199. package/dist/js/chunks/chunk-VZMROW5A.mjs.map +7 -0
  200. package/dist/js/chunks/chunk-W6FAL3TI.mjs +38 -0
  201. package/dist/js/chunks/chunk-W6FAL3TI.mjs.map +7 -0
  202. package/dist/js/chunks/chunk-XB6Y7P5W.mjs +69 -0
  203. package/dist/js/chunks/chunk-XB6Y7P5W.mjs.map +7 -0
  204. package/dist/js/chunks/chunk-XDAMOMVD.mjs +226 -0
  205. package/dist/js/chunks/chunk-XDAMOMVD.mjs.map +7 -0
  206. package/dist/js/chunks/{chunk-WDK4T63U.mjs → chunk-XJPMW5SP.mjs} +247 -172
  207. package/dist/js/chunks/chunk-XJPMW5SP.mjs.map +7 -0
  208. package/dist/js/chunks/{chunk-KUFHW3DS.mjs → chunk-YKANQILZ.mjs} +16 -21
  209. package/dist/js/chunks/chunk-YKANQILZ.mjs.map +7 -0
  210. package/dist/js/chunks/chunk-YLZOJLDI.mjs +175 -0
  211. package/dist/js/chunks/chunk-YLZOJLDI.mjs.map +7 -0
  212. package/dist/js/chunks/chunk-ZK7YY322.mjs +514 -0
  213. package/dist/js/chunks/chunk-ZK7YY322.mjs.map +7 -0
  214. package/dist/js/expressive.cjs +10266 -3628
  215. package/dist/js/expressive.cjs.map +4 -4
  216. package/dist/js/expressive.js +10266 -3628
  217. package/dist/js/expressive.js.map +4 -4
  218. package/dist/js/expressive.min.js +23 -22
  219. package/dist/js/expressive.min.js.map +4 -4
  220. package/dist/js/expressive.mjs +181 -69
  221. package/dist/js/expressive.mjs.map +2 -2
  222. package/dist/js/internal/behaviors/bottomSheets.mjs +4 -3
  223. package/dist/js/internal/behaviors/copy.mjs +9 -0
  224. package/dist/js/internal/behaviors/copy.mjs.map +7 -0
  225. package/dist/js/internal/behaviors/dataTables.mjs +8 -0
  226. package/dist/js/internal/behaviors/dataTables.mjs.map +7 -0
  227. package/dist/js/internal/behaviors/dialogs.mjs +2 -2
  228. package/dist/js/internal/behaviors/forms.mjs +2 -2
  229. package/dist/js/internal/behaviors/imageCompare.mjs +8 -0
  230. package/dist/js/internal/behaviors/imageCompare.mjs.map +7 -0
  231. package/dist/js/internal/behaviors/lists.mjs +8 -0
  232. package/dist/js/internal/behaviors/lists.mjs.map +7 -0
  233. package/dist/js/internal/behaviors/paneResize.mjs +8 -0
  234. package/dist/js/internal/behaviors/paneResize.mjs.map +7 -0
  235. package/dist/js/internal/behaviors/sheetDrag.mjs +7 -2
  236. package/dist/js/internal/behaviors/sideSheets.mjs +4 -3
  237. package/dist/js/internal/behaviors/sortable.mjs +8 -0
  238. package/dist/js/internal/behaviors/sortable.mjs.map +7 -0
  239. package/dist/js/internal/behaviors/theme.mjs +8 -0
  240. package/dist/js/internal/behaviors/theme.mjs.map +7 -0
  241. package/dist/js/internal/behaviors/tour.mjs +8 -0
  242. package/dist/js/internal/behaviors/tour.mjs.map +7 -0
  243. package/dist/js/internal/behaviors/transferList.mjs +8 -0
  244. package/dist/js/internal/behaviors/transferList.mjs.map +7 -0
  245. package/dist/js/internal/components/appBar.mjs +3 -2
  246. package/dist/js/internal/components/autocomplete.mjs +5 -4
  247. package/dist/js/internal/components/backToTop.mjs +9 -0
  248. package/dist/js/internal/components/backToTop.mjs.map +7 -0
  249. package/dist/js/internal/components/barChart.mjs +5 -4
  250. package/dist/js/internal/components/buttonGroup.mjs +3 -2
  251. package/dist/js/internal/components/buttons.mjs +3 -3
  252. package/dist/js/internal/components/cards.mjs +3 -3
  253. package/dist/js/internal/components/carousel.mjs +3 -3
  254. package/dist/js/internal/components/cascader.mjs +10 -0
  255. package/dist/js/internal/components/cascader.mjs.map +7 -0
  256. package/dist/js/internal/components/characterCounter.mjs +3 -2
  257. package/dist/js/internal/components/chips.mjs +7 -5
  258. package/dist/js/internal/components/colorPicker.mjs +9 -0
  259. package/dist/js/internal/components/colorPicker.mjs.map +7 -0
  260. package/dist/js/internal/components/columnChart.mjs +4 -3
  261. package/dist/js/internal/components/commandPalette.mjs +3 -3
  262. package/dist/js/internal/components/confetti.mjs +3 -2
  263. package/dist/js/internal/components/currencyInput.mjs +9 -0
  264. package/dist/js/internal/components/currencyInput.mjs.map +7 -0
  265. package/dist/js/internal/components/datepicker.mjs +12 -8
  266. package/dist/js/internal/components/expandingCard.mjs +3 -3
  267. package/dist/js/internal/components/funnelChart.mjs +10 -0
  268. package/dist/js/internal/components/funnelChart.mjs.map +7 -0
  269. package/dist/js/internal/components/heatmapChart.mjs +4 -3
  270. package/dist/js/internal/components/hoverCard.mjs +9 -0
  271. package/dist/js/internal/components/hoverCard.mjs.map +7 -0
  272. package/dist/js/internal/components/index.mjs +131 -65
  273. package/dist/js/internal/components/inputMask.mjs +9 -0
  274. package/dist/js/internal/components/inputMask.mjs.map +7 -0
  275. package/dist/js/internal/components/keypad.mjs +3 -3
  276. package/dist/js/internal/components/lightbox.mjs +3 -3
  277. package/dist/js/internal/components/lineChart.mjs +41 -4
  278. package/dist/js/internal/components/loadingOverlay.mjs +9 -0
  279. package/dist/js/internal/components/loadingOverlay.mjs.map +7 -0
  280. package/dist/js/internal/components/mapView.mjs +3 -3
  281. package/dist/js/internal/components/menu.mjs +3 -3
  282. package/dist/js/internal/components/menubar.mjs +10 -0
  283. package/dist/js/internal/components/menubar.mjs.map +7 -0
  284. package/dist/js/internal/components/messageScroller.mjs +3 -3
  285. package/dist/js/internal/components/mixedChart.mjs +5 -4
  286. package/dist/js/internal/components/navigationRail.mjs +3 -2
  287. package/dist/js/internal/components/particles.mjs +3 -2
  288. package/dist/js/internal/components/pieChart.mjs +4 -3
  289. package/dist/js/internal/components/pullToRefresh.mjs +9 -0
  290. package/dist/js/internal/components/pullToRefresh.mjs.map +7 -0
  291. package/dist/js/internal/components/questionnaire.mjs +3 -3
  292. package/dist/js/internal/components/radarChart.mjs +4 -3
  293. package/dist/js/internal/components/radialChart.mjs +4 -3
  294. package/dist/js/internal/components/registry.mjs +60 -41
  295. package/dist/js/internal/components/richTextEditor.mjs +3 -3
  296. package/dist/js/internal/components/sankeyChart.mjs +10 -0
  297. package/dist/js/internal/components/sankeyChart.mjs.map +7 -0
  298. package/dist/js/internal/components/scatterChart.mjs +10 -0
  299. package/dist/js/internal/components/scatterChart.mjs.map +7 -0
  300. package/dist/js/internal/components/scrollspy.mjs +3 -2
  301. package/dist/js/internal/components/select.mjs +5 -4
  302. package/dist/js/internal/components/showMore.mjs +9 -0
  303. package/dist/js/internal/components/showMore.mjs.map +7 -0
  304. package/dist/js/internal/components/slider.mjs +3 -3
  305. package/dist/js/internal/components/snackbar.mjs +2 -2
  306. package/dist/js/internal/components/swipeActions.mjs +9 -0
  307. package/dist/js/internal/components/swipeActions.mjs.map +7 -0
  308. package/dist/js/internal/components/tabs.mjs +3 -4
  309. package/dist/js/internal/components/timepicker.mjs +5 -4
  310. package/dist/js/internal/components/tooltip.mjs +3 -3
  311. package/dist/js/internal/components/treeSelect.mjs +14 -0
  312. package/dist/js/internal/components/treeSelect.mjs.map +7 -0
  313. package/dist/js/internal/components/treemapChart.mjs +10 -0
  314. package/dist/js/internal/components/treemapChart.mjs.map +7 -0
  315. package/dist/js/internal/core/component.mjs +6 -3
  316. package/dist/js/internal/core/formControl.mjs +12 -0
  317. package/dist/js/internal/core/formControl.mjs.map +7 -0
  318. package/dist/js/internal/core/imageURL.mjs +7 -0
  319. package/dist/js/internal/core/imageURL.mjs.map +7 -0
  320. package/dist/js/internal/core/spring.mjs +11 -0
  321. package/dist/js/internal/core/spring.mjs.map +7 -0
  322. package/dist/js/internal/core/utils.mjs +21 -3
  323. package/dist/js/internal/plugins/dockedDisplayPlugin.mjs +2 -2
  324. package/dist/js/internal/plugins/modalDisplayPlugin.mjs +13 -0
  325. package/dist/js/internal/plugins/modalDisplayPlugin.mjs.map +7 -0
  326. package/dist/js/modular.mjs +172 -69
  327. package/dist/types/behaviors/bottomSheets.d.ts +23 -5
  328. package/dist/types/behaviors/copy.d.ts +18 -0
  329. package/dist/types/behaviors/dataTables.d.ts +125 -0
  330. package/dist/types/behaviors/dialogs.d.ts +27 -1
  331. package/dist/types/behaviors/forms.d.ts +70 -4
  332. package/dist/types/behaviors/imageCompare.d.ts +13 -0
  333. package/dist/types/behaviors/lists.d.ts +12 -0
  334. package/dist/types/behaviors/paneResize.d.ts +29 -0
  335. package/dist/types/behaviors/sheetDrag.d.ts +18 -0
  336. package/dist/types/behaviors/sideSheets.d.ts +1 -1
  337. package/dist/types/behaviors/sortable.d.ts +28 -0
  338. package/dist/types/behaviors/theme.d.ts +22 -0
  339. package/dist/types/behaviors/tour.d.ts +36 -0
  340. package/dist/types/behaviors/transferList.d.ts +53 -0
  341. package/dist/types/components/appBar.d.ts +5 -6
  342. package/dist/types/components/autocomplete.d.ts +105 -20
  343. package/dist/types/components/backToTop.d.ts +36 -0
  344. package/dist/types/components/barChart.d.ts +3 -6
  345. package/dist/types/components/buttonGroup.d.ts +2 -4
  346. package/dist/types/components/buttons.d.ts +5 -5
  347. package/dist/types/components/cards.d.ts +3 -16
  348. package/dist/types/components/carousel.d.ts +16 -15
  349. package/dist/types/components/cascader.d.ts +130 -0
  350. package/dist/types/components/characterCounter.d.ts +2 -15
  351. package/dist/types/components/chips.d.ts +80 -19
  352. package/dist/types/components/colorPicker.d.ts +56 -0
  353. package/dist/types/components/columnChart.d.ts +23 -10
  354. package/dist/types/components/commandPalette.d.ts +11 -16
  355. package/dist/types/components/confetti.d.ts +2 -4
  356. package/dist/types/components/currencyInput.d.ts +60 -0
  357. package/dist/types/components/datepicker.d.ts +107 -56
  358. package/dist/types/components/expandingCard.d.ts +4 -6
  359. package/dist/types/components/funnelChart.d.ts +35 -0
  360. package/dist/types/components/heatmapChart.d.ts +42 -8
  361. package/dist/types/components/hoverCard.d.ts +59 -0
  362. package/dist/types/components/index.d.ts +16 -1
  363. package/dist/types/components/inputMask.d.ts +28 -0
  364. package/dist/types/components/keypad.d.ts +38 -6
  365. package/dist/types/components/lightbox.d.ts +14 -20
  366. package/dist/types/components/lineChart.d.ts +212 -12
  367. package/dist/types/components/loadingOverlay.d.ts +42 -0
  368. package/dist/types/components/mapView.d.ts +138 -27
  369. package/dist/types/components/menu.d.ts +74 -22
  370. package/dist/types/components/menubar.d.ts +37 -0
  371. package/dist/types/components/messageScroller.d.ts +2 -14
  372. package/dist/types/components/mixedChart.d.ts +15 -6
  373. package/dist/types/components/navigationRail.d.ts +16 -5
  374. package/dist/types/components/particles.d.ts +22 -5
  375. package/dist/types/components/pieChart.d.ts +33 -9
  376. package/dist/types/components/pullToRefresh.d.ts +80 -0
  377. package/dist/types/components/questionnaire.d.ts +58 -16
  378. package/dist/types/components/radarChart.d.ts +10 -6
  379. package/dist/types/components/radialChart.d.ts +58 -7
  380. package/dist/types/components/registry.d.ts +73 -3
  381. package/dist/types/components/richTextEditor.d.ts +45 -22
  382. package/dist/types/components/sankeyChart.d.ts +72 -0
  383. package/dist/types/components/scatterChart.d.ts +102 -0
  384. package/dist/types/components/scrollspy.d.ts +3 -5
  385. package/dist/types/components/select.d.ts +44 -33
  386. package/dist/types/components/showMore.d.ts +53 -0
  387. package/dist/types/components/slider.d.ts +2 -15
  388. package/dist/types/components/snackbar.d.ts +68 -1
  389. package/dist/types/components/swipeActions.d.ts +81 -0
  390. package/dist/types/components/tabs.d.ts +92 -30
  391. package/dist/types/components/timepicker.d.ts +128 -27
  392. package/dist/types/components/tooltip.d.ts +57 -21
  393. package/dist/types/components/treeSelect.d.ts +106 -0
  394. package/dist/types/components/treemapChart.d.ts +56 -0
  395. package/dist/types/core/component.d.ts +49 -25
  396. package/dist/types/core/formControl.d.ts +21 -0
  397. package/dist/types/core/imageURL.d.ts +2 -0
  398. package/dist/types/core/spring.d.ts +20 -0
  399. package/dist/types/core/utils.d.ts +123 -72
  400. package/dist/types/modular.d.ts +33 -1
  401. package/dist/types/plugins/dockedDisplayPlugin.d.ts +10 -8
  402. package/dist/types/plugins/modalDisplayPlugin.d.ts +39 -0
  403. package/package.json +17 -13
  404. package/src/sass/README.md +27 -18
  405. package/src/sass/abstracts/_elevation.scss +13 -7
  406. package/src/sass/abstracts/_index.scss +1 -0
  407. package/src/sass/abstracts/_mixins.scss +864 -78
  408. package/src/sass/abstracts/_spring.scss +63 -0
  409. package/src/sass/abstracts/_variables.scss +64 -21
  410. package/src/sass/base/_fonts.scss +61 -48
  411. package/src/sass/base/_global.scss +104 -24
  412. package/src/sass/base/_index.scss +2 -0
  413. package/src/sass/base/_normalize.scss +59 -114
  414. package/src/sass/base/_print.scss +21 -0
  415. package/src/sass/base/_prose.scss +68 -0
  416. package/src/sass/base/_typography.scss +9 -5
  417. package/src/sass/components/_accordion.scss +10 -19
  418. package/src/sass/components/_alert.scss +102 -0
  419. package/src/sass/components/_aura.scss +9 -3
  420. package/src/sass/components/_avatar.scss +3 -3
  421. package/src/sass/components/_back-to-top.scss +38 -0
  422. package/src/sass/components/_badges.scss +6 -5
  423. package/src/sass/components/_bar-chart.scss +31 -90
  424. package/src/sass/components/_bottom-sheet.scss +51 -16
  425. package/src/sass/components/_breadcrumb.scss +8 -7
  426. package/src/sass/components/_button-groups.scss +30 -63
  427. package/src/sass/components/_buttons.scss +137 -94
  428. package/src/sass/components/_calendar.scss +244 -0
  429. package/src/sass/components/_cards.scss +36 -44
  430. package/src/sass/components/_carousel.scss +37 -113
  431. package/src/sass/components/_cascader.scss +131 -0
  432. package/src/sass/components/_chips.scss +36 -46
  433. package/src/sass/components/_column-chart.scss +15 -26
  434. package/src/sass/components/_command-palette.scss +4 -7
  435. package/src/sass/components/_confetti.scss +1 -4
  436. package/src/sass/components/_countdown.scss +1 -1
  437. package/src/sass/components/_data-table.scss +172 -25
  438. package/src/sass/components/_datepicker.scss +54 -40
  439. package/src/sass/components/_description-list.scss +85 -0
  440. package/src/sass/components/_dialog.scss +48 -55
  441. package/src/sass/components/_docked-display.scss +1 -3
  442. package/src/sass/components/_drag-handle.scss +16 -20
  443. package/src/sass/components/_expanding-card.scss +21 -14
  444. package/src/sass/components/_fab-menu.scss +43 -39
  445. package/src/sass/components/_funnel-chart.scss +63 -0
  446. package/src/sass/components/_heatmap-chart.scss +114 -29
  447. package/src/sass/components/_icon-buttons.scss +8 -11
  448. package/src/sass/components/_icons-material-design.scss +2 -2
  449. package/src/sass/components/_image-compare.scss +108 -0
  450. package/src/sass/components/_index.scss +20 -0
  451. package/src/sass/components/_keypad.scss +39 -19
  452. package/src/sass/components/_kpi.scss +6 -11
  453. package/src/sass/components/_lightbox.scss +24 -13
  454. package/src/sass/components/_line-chart.scss +9 -63
  455. package/src/sass/components/_list.scss +59 -14
  456. package/src/sass/components/_loading-indicator.scss +1 -0
  457. package/src/sass/components/_loading-overlay.scss +105 -0
  458. package/src/sass/components/_map.scss +37 -11
  459. package/src/sass/components/_marquee.scss +4 -3
  460. package/src/sass/components/_mega-menu.scss +128 -0
  461. package/src/sass/components/_menu.scss +146 -127
  462. package/src/sass/components/_menubar.scss +47 -0
  463. package/src/sass/components/_message-scroller.scss +2 -2
  464. package/src/sass/components/_message.scss +3 -3
  465. package/src/sass/components/_mixed-chart.scss +27 -35
  466. package/src/sass/components/_modal-display.scss +21 -0
  467. package/src/sass/components/_navbar.scss +45 -36
  468. package/src/sass/components/_navigation-bar.scss +12 -77
  469. package/src/sass/components/_navigation-rail.scss +161 -92
  470. package/src/sass/components/_org-chart.scss +192 -0
  471. package/src/sass/components/_page-footer.scss +2 -4
  472. package/src/sass/components/_pagination.scss +9 -27
  473. package/src/sass/components/_panes.scss +35 -42
  474. package/src/sass/components/_particles.scss +1 -4
  475. package/src/sass/components/_pie-chart.scss +86 -68
  476. package/src/sass/components/_popover.scss +18 -5
  477. package/src/sass/components/_progress.scss +183 -44
  478. package/src/sass/components/_pull-to-refresh.scss +90 -0
  479. package/src/sass/components/_questionnaire.scss +74 -3
  480. package/src/sass/components/_radar-chart.scss +40 -42
  481. package/src/sass/components/_radial-chart.scss +108 -46
  482. package/src/sass/components/_rich-text-editor.scss +2 -2
  483. package/src/sass/components/_sankey-chart.scss +91 -0
  484. package/src/sass/components/_scatter-chart.scss +144 -0
  485. package/src/sass/components/_scrim.scss +0 -2
  486. package/src/sass/components/_scrollspy.scss +0 -2
  487. package/src/sass/components/_search.scss +27 -26
  488. package/src/sass/components/_show-more.scss +8 -0
  489. package/src/sass/components/_side-sheet.scss +32 -51
  490. package/src/sass/components/_skeleton.scss +26 -19
  491. package/src/sass/components/_snackbar.scss +25 -21
  492. package/src/sass/components/_split-button.scss +5 -5
  493. package/src/sass/components/_stat.scss +3 -8
  494. package/src/sass/components/_stepper.scss +1 -1
  495. package/src/sass/components/_swipe-actions.scss +71 -0
  496. package/src/sass/components/_table_of_contents.scss +1 -3
  497. package/src/sass/components/_tabs.scss +49 -46
  498. package/src/sass/components/_timeline.scss +12 -12
  499. package/src/sass/components/_timepicker.scss +111 -79
  500. package/src/sass/components/_toolbar.scss +36 -47
  501. package/src/sass/components/_tooltip.scss +25 -12
  502. package/src/sass/components/_tour.scss +89 -0
  503. package/src/sass/components/_transfer-list.scss +73 -0
  504. package/src/sass/components/_transitions.scss +4 -4
  505. package/src/sass/components/_tree.scss +7 -32
  506. package/src/sass/components/_treemap-chart.scss +98 -0
  507. package/src/sass/components/forms/_checkboxes.scss +107 -44
  508. package/src/sass/components/forms/_color-picker.scss +135 -0
  509. package/src/sass/components/forms/_color-swatches.scss +85 -0
  510. package/src/sass/components/forms/_drop-zone.scss +16 -13
  511. package/src/sass/components/forms/_fieldset.scss +4 -7
  512. package/src/sass/components/forms/_file-input.scss +12 -8
  513. package/src/sass/components/forms/_index.scss +3 -1
  514. package/src/sass/components/forms/_input-fields.scss +271 -90
  515. package/src/sass/components/forms/_radio-buttons.scss +34 -117
  516. package/src/sass/components/forms/_rating.scss +2 -32
  517. package/src/sass/components/forms/_select.scss +198 -20
  518. package/src/sass/components/forms/_slider.scss +92 -98
  519. package/src/sass/components/forms/_switches.scss +62 -180
  520. package/src/sass/custom.scss +10 -1
  521. package/src/sass/expressive.scss +3 -63
  522. package/src/sass/tokens/_contrast.scss +94 -0
  523. package/src/sass/tokens/_elevation.scss +16 -0
  524. package/src/sass/tokens/_index.scss +5 -0
  525. package/src/sass/tokens/_motion.scss +109 -0
  526. package/src/sass/tokens/_reference.scss +72 -141
  527. package/src/sass/tokens/_shape.scss +38 -0
  528. package/src/sass/tokens/_stacking.scss +27 -0
  529. package/src/sass/tokens/_state.scss +0 -2
  530. package/src/sass/tokens/_theme.scss +10 -1
  531. package/src/sass/tokens/_vibrant.scss +2 -5
  532. package/src/sass/utilities/_defer-render.scss +17 -0
  533. package/src/sass/utilities/_helpers.scss +184 -27
  534. package/src/sass/utilities/_index.scss +1 -0
  535. package/src/sass/utilities/_scroll-area.scss +0 -2
  536. package/src/sass/utilities/_spacing.scss +52 -34
  537. package/src/sass/utilities/_typescale.scss +8 -1
  538. package/src/sass/utilities/_visibility.scss +46 -77
  539. package/src/sass/utilities/_z-depth.scss +7 -4
  540. package/dist/js/chunks/chunk-33QVDDGR.mjs +0 -270
  541. package/dist/js/chunks/chunk-33QVDDGR.mjs.map +0 -7
  542. package/dist/js/chunks/chunk-45FER6RI.mjs +0 -59
  543. package/dist/js/chunks/chunk-45FER6RI.mjs.map +0 -7
  544. package/dist/js/chunks/chunk-5CEAOLUA.mjs.map +0 -7
  545. package/dist/js/chunks/chunk-6VATUZC6.mjs +0 -295
  546. package/dist/js/chunks/chunk-6VATUZC6.mjs.map +0 -7
  547. package/dist/js/chunks/chunk-74MXKKLN.mjs.map +0 -7
  548. package/dist/js/chunks/chunk-AIURVCG6.mjs +0 -55
  549. package/dist/js/chunks/chunk-AIURVCG6.mjs.map +0 -7
  550. package/dist/js/chunks/chunk-BGZLF6JZ.mjs.map +0 -7
  551. package/dist/js/chunks/chunk-C6CHEWYP.mjs.map +0 -7
  552. package/dist/js/chunks/chunk-CK2XCICY.mjs.map +0 -7
  553. package/dist/js/chunks/chunk-CXXM2L4F.mjs +0 -344
  554. package/dist/js/chunks/chunk-CXXM2L4F.mjs.map +0 -7
  555. package/dist/js/chunks/chunk-DXGRXYYL.mjs.map +0 -7
  556. package/dist/js/chunks/chunk-FM5CZOUB.mjs.map +0 -7
  557. package/dist/js/chunks/chunk-GJL6GCIU.mjs.map +0 -7
  558. package/dist/js/chunks/chunk-K3HZMFMD.mjs +0 -135
  559. package/dist/js/chunks/chunk-K3HZMFMD.mjs.map +0 -7
  560. package/dist/js/chunks/chunk-KHXZ2A4K.mjs.map +0 -7
  561. package/dist/js/chunks/chunk-KQACNQ22.mjs +0 -7
  562. package/dist/js/chunks/chunk-KQACNQ22.mjs.map +0 -7
  563. package/dist/js/chunks/chunk-KUFHW3DS.mjs.map +0 -7
  564. package/dist/js/chunks/chunk-KVJAVDBC.mjs.map +0 -7
  565. package/dist/js/chunks/chunk-L27Q6ZMI.mjs.map +0 -7
  566. package/dist/js/chunks/chunk-LQWUDNHZ.mjs.map +0 -7
  567. package/dist/js/chunks/chunk-M372EDXD.mjs +0 -322
  568. package/dist/js/chunks/chunk-M372EDXD.mjs.map +0 -7
  569. package/dist/js/chunks/chunk-M3MURWMB.mjs +0 -82
  570. package/dist/js/chunks/chunk-M3MURWMB.mjs.map +0 -7
  571. package/dist/js/chunks/chunk-NUHMOAOY.mjs.map +0 -7
  572. package/dist/js/chunks/chunk-OWG3LMUL.mjs +0 -169
  573. package/dist/js/chunks/chunk-OWG3LMUL.mjs.map +0 -7
  574. package/dist/js/chunks/chunk-PD6HYHAE.mjs +0 -48
  575. package/dist/js/chunks/chunk-PD6HYHAE.mjs.map +0 -7
  576. package/dist/js/chunks/chunk-PDG64UHF.mjs.map +0 -7
  577. package/dist/js/chunks/chunk-PO3AXVR3.mjs +0 -546
  578. package/dist/js/chunks/chunk-PO3AXVR3.mjs.map +0 -7
  579. package/dist/js/chunks/chunk-QYGK36OG.mjs +0 -181
  580. package/dist/js/chunks/chunk-QYGK36OG.mjs.map +0 -7
  581. package/dist/js/chunks/chunk-SFI2U4YW.mjs.map +0 -7
  582. package/dist/js/chunks/chunk-SMY7GJSS.mjs.map +0 -7
  583. package/dist/js/chunks/chunk-TCCA2HDG.mjs +0 -414
  584. package/dist/js/chunks/chunk-TCCA2HDG.mjs.map +0 -7
  585. package/dist/js/chunks/chunk-TSZYSW7F.mjs.map +0 -7
  586. package/dist/js/chunks/chunk-UAZSDUVP.mjs +0 -90
  587. package/dist/js/chunks/chunk-UAZSDUVP.mjs.map +0 -7
  588. package/dist/js/chunks/chunk-UBRZZWRA.mjs +0 -127
  589. package/dist/js/chunks/chunk-UBRZZWRA.mjs.map +0 -7
  590. package/dist/js/chunks/chunk-UCOE7ZDL.mjs +0 -287
  591. package/dist/js/chunks/chunk-UCOE7ZDL.mjs.map +0 -7
  592. package/dist/js/chunks/chunk-UETTGDLI.mjs.map +0 -7
  593. package/dist/js/chunks/chunk-UNCRDLP6.mjs +0 -136
  594. package/dist/js/chunks/chunk-UNCRDLP6.mjs.map +0 -7
  595. package/dist/js/chunks/chunk-VGNYF6FB.mjs.map +0 -7
  596. package/dist/js/chunks/chunk-VGPGBNGL.mjs +0 -68
  597. package/dist/js/chunks/chunk-VGPGBNGL.mjs.map +0 -7
  598. package/dist/js/chunks/chunk-VKAUVTQY.mjs +0 -1
  599. package/dist/js/chunks/chunk-VM4FTS7L.mjs +0 -48
  600. package/dist/js/chunks/chunk-VM4FTS7L.mjs.map +0 -7
  601. package/dist/js/chunks/chunk-WDK4T63U.mjs.map +0 -7
  602. package/dist/js/chunks/chunk-WOCCTVUF.mjs +0 -185
  603. package/dist/js/chunks/chunk-WOCCTVUF.mjs.map +0 -7
  604. package/dist/js/chunks/chunk-WQYN5L4E.mjs +0 -107
  605. package/dist/js/chunks/chunk-WQYN5L4E.mjs.map +0 -7
  606. package/dist/js/chunks/chunk-X4ISMKE2.mjs.map +0 -7
  607. package/dist/js/chunks/chunk-XAEAEHIX.mjs.map +0 -7
  608. package/dist/js/chunks/chunk-ZX6M7SWO.mjs.map +0 -7
  609. /package/dist/js/chunks/{chunk-VKAUVTQY.mjs.map → chunk-GNRSYMVH.mjs.map} +0 -0
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/ts/components/snackbar.ts"],
4
+ "sourcesContent": ["import { BaseOptions } from '../core/component';\nimport { Utils, controllerFor, deepActiveElement, restoreAttribute } from '../core/utils';\n\nexport interface SnackbarOptions extends BaseOptions {\n /**\n * The content of the Snackbar.\n * @default \"\"\n */\n text: string;\n /**\n * Optional action label. Rendered as a trailing text button.\n * @default \"\"\n */\n action: string;\n /**\n * Called when the action button is pressed. The snackbar still dismisses.\n * @default null\n */\n onAction: () => void;\n /**\n * Show a trailing close icon button.\n * Defaults to true when action is set, otherwise false.\n */\n dismissible: boolean;\n /**\n * Element id of a `<template>` (or another element) used as the snackbar body.\n * @default \"\"\n */\n snackbarId?: string;\n /**\n * Length in ms the Snackbar stays before dismissal.\n * `Infinity` keeps it on screen until the user acts.\n * When `action` is set and this is omitted, the default is Infinity.\n * @default 4000\n */\n displayLength: number;\n /**\n * Transition in duration in milliseconds.\n * @default 300\n */\n inDuration: number;\n /**\n * Transition out duration in milliseconds.\n * @default 375\n */\n outDuration: number;\n /**\n * Classes to be added to the snackbar element.\n * @default \"\"\n */\n classes: string;\n /**\n * Callback function called when the snackbar is dismissed.\n * @default null\n */\n completeCallback: () => void;\n /**\n * The percentage of the snackbar's width it takes for a drag\n * to dismiss a Snackbar.\n * @default 0.8\n */\n activationPercent: number;\n /**\n * Any element in the tree the snackbar should render into. A Snackbar has no\n * originating element to infer this from, so pass one when the page lives in\n * a shadow root \u2014 the container is appended to that root instead of to\n * `document.body`, where a root-scoped stylesheet could not reach it.\n * @default null\n */\n root: HTMLElement;\n /**\n * Show at once, dismissing the snackbar on screen without its exit\n * animation, instead of waiting in the queue behind it.\n * @default false\n */\n replace: boolean;\n}\n\nconst _defaults: SnackbarOptions = {\n text: '',\n action: '',\n onAction: null,\n dismissible: false,\n displayLength: 4000,\n inDuration: 300,\n outDuration: 375,\n classes: '',\n completeCallback: null,\n activationPercent: 0.8,\n root: null,\n replace: false\n};\n\nexport class Snackbar {\n /** The snackbar element. */\n el: HTMLElement;\n /**\n * The remaining amount of time in ms that the snackbar\n * will stay before dismissal.\n */\n timeRemaining: number;\n /**\n * Describes the current pan state of the Snackbar.\n */\n panning: boolean;\n options: SnackbarOptions;\n message: string;\n counterTimeout: ReturnType<typeof setTimeout>;\n /** Wall-clock time the snackbar is due to dismiss, for pause/resume. */\n private _deadline: number;\n wasSwiped: boolean;\n startingXPos: number;\n xPos: number;\n time: number;\n deltaX: number;\n velocityX: number;\n /** Swipe distance that dismisses, measured once when the drag starts. */\n private _activationDistance: number;\n private _dismissed = false;\n private _returnFocus: HTMLElement | null = null;\n /** The document body or shadow root the snackbar renders into. */\n private _portal: HTMLElement | ShadowRoot;\n private _events: AbortController;\n private _restoreElement: (() => void) | null = null;\n private _transitionTimer: ReturnType<typeof setTimeout>;\n private _dismissTimer: ReturnType<typeof setTimeout>;\n private _focusTimer: ReturnType<typeof setTimeout>;\n\n /** The snackbar on screen, kept until its exit animation finishes. */\n static _snackbars: Snackbar[];\n /** Snackbars waiting for the one on screen to leave, oldest first. */\n static _queue: Snackbar[];\n /** Set while a replacement clears the screen; the queue waits for it. */\n private static _replacing = false;\n static _container: HTMLElement;\n static _draggedSnackbar: Snackbar;\n /** Which pointer owns the drag in flight; a second finger is ignored. */\n static _dragPointerId: number | null = null;\n\n /**\n * Whether a bar gets its close button when the page does not say. One with\n * an action waits for it, and one that never times out waits for the\n * reader; either way, swiping must not be the only way to send it off.\n */\n private static _needsClose(options: SnackbarOptions): boolean {\n return !!options.action || options.displayLength === Infinity;\n }\n\n constructor(options: Partial<SnackbarOptions> = {}) {\n this.options = {\n ...Snackbar.defaults,\n ...options\n };\n if (options.displayLength === undefined && this.options.action) {\n this.options.displayLength = Infinity;\n }\n if (options.dismissible === undefined) this.options.dismissible = Snackbar._needsClose(this.options);\n this.message = this.options.text;\n this.panning = false;\n this.timeRemaining = this.options.displayLength;\n // Worked out now: `root` may be inside the snackbar this one replaces,\n // and gone by the time it shows.\n this._portal = Utils.portalRoot(this.options.root ?? document.body);\n // First, so an authored body a re-render orphaned is back in its place.\n Snackbar._dropDetached();\n // An authored body is taken when the snackbar shows: one waiting in the\n // queue must not claim the element the snackbar on screen is using.\n if (this.options.snackbarId) this._requireBody();\n else this._build();\n // One snackbar at a time, as Material asks. Everything goes through the\n // queue, so arrivals show in order; a replacement goes to its front once\n // the screen is cleared.\n if (this.options.replace) Snackbar._replaceShown(this);\n else Snackbar._queue.push(this);\n Snackbar._advance();\n }\n\n /**\n * Lets go of snackbars a re-render took out of the page. A persistent one\n * would otherwise hold the queue for good.\n */\n private static _dropDetached() {\n for (const snackbar of Snackbar._snackbars.filter((shown) => !shown.el.isConnected)) {\n snackbar._dismissed = true;\n snackbar._remove(false);\n snackbar.options.completeCallback?.();\n }\n }\n\n /**\n * Ends a snackbar a replacement cuts short, at once, with the events and\n * callback a dismissal has: they used to be skipped, so code waiting on\n * completeCallback never heard. One already dismissing has fired `close`.\n */\n private _evict() {\n if (!this._dismissed) Utils.emit(this.el, 'close');\n this._dismissed = true;\n // While the snackbar is still in the page, so the event reaches the document.\n Utils.emit(this.el, 'closed');\n this._restoreFocus(true);\n this.options.completeCallback?.();\n }\n\n /** Throws now, rather than when the snackbar shows, if `snackbarId` names nothing. */\n private _requireBody() {\n if (!this._hasBody()) throw new Error('Snackbar body not found');\n }\n\n /** Whether the body a snackbar shows is still there: its own, or `snackbarId`'s. */\n private _hasBody(): boolean {\n return !this.options.snackbarId || !!Utils.getElementById(this._portal, this.options.snackbarId);\n }\n\n private _build() {\n this.el = this._createSnackbar();\n Reflect.set(this.el, 'Expressive_Snackbar', this);\n }\n\n /**\n * Takes the snackbar on screen down at once, without starting the queue.\n * Restoring focus can open another, which goes too.\n */\n private static _replaceShown(replacement: Snackbar) {\n // A snackbar opened by the focus restore below must not start the queue,\n // or the next waiting one would show only to be cut short here.\n Snackbar._replacing = true;\n try {\n while (Snackbar._snackbars.length) {\n for (const snackbar of Snackbar._snackbars.splice(0)) snackbar._evict();\n }\n } finally {\n Snackbar._replacing = false;\n }\n Snackbar._queue.unshift(replacement);\n }\n\n /** Puts the snackbar on screen and starts its countdown. */\n private _show() {\n if (!this.el) this._build();\n this._returnFocus = Snackbar._focused();\n Snackbar._containerIn(this._portal).appendChild(this.el);\n Snackbar._snackbars.push(this);\n this._animateIn();\n this._setTimer();\n Utils.emit(this.el, 'open');\n }\n\n /** The focused element, looking inside open shadow roots. */\n private static _focused(): HTMLElement | null {\n const focused = deepActiveElement(document);\n return focused instanceof HTMLElement ? focused : null;\n }\n\n /**\n * One container serves every snackbar, and only one snackbar shows at a\n * time \u2014 so it is moved rather than duplicated when the root changes.\n */\n private static _containerIn(root: HTMLElement | ShadowRoot): HTMLElement {\n const container = Snackbar._container;\n if (container?.isConnected && container.parentNode === root) return container;\n Snackbar._removeContainer();\n Snackbar._createContainer(root);\n return Snackbar._container;\n }\n\n static get defaults(): SnackbarOptions {\n return _defaults;\n }\n\n static getInstance(el: Element): Snackbar | undefined {\n return Reflect.get(el, 'Expressive_Snackbar');\n }\n\n static _createContainer(root: HTMLElement | ShadowRoot = document.body) {\n const container = document.createElement('div');\n container.setAttribute('id', 'snackbar-container');\n // One listener per stage. These used to be a touch trio on the container\n // plus a mouse trio split across the container and the document, with a\n // helper picking `targetTouches[0].clientX` or `clientX` apart afterwards.\n // Move and up stay on the document so a drag that leaves the container\n // still completes.\n container.addEventListener('pointerdown', Snackbar._onDragStart);\n document.addEventListener('pointermove', Snackbar._onDragMove);\n document.addEventListener('pointerup', Snackbar._onDragEnd);\n document.addEventListener('pointercancel', Snackbar._onDragCancel);\n root.appendChild(container);\n Snackbar._container = container;\n }\n\n static _removeContainer() {\n document.removeEventListener('pointermove', Snackbar._onDragMove);\n document.removeEventListener('pointerup', Snackbar._onDragEnd);\n document.removeEventListener('pointercancel', Snackbar._onDragCancel);\n Snackbar._container?.remove();\n Snackbar._container = null;\n }\n\n static _onDragStart(e: PointerEvent) {\n if (!e.isPrimary) return;\n if (e.pointerType === 'mouse' && e.button !== 0) return;\n const target = e.target as HTMLElement | null;\n // Don't start a swipe from the action or close \u2014 those are buttons.\n if (target && !target.closest('button, a') && target.closest('.snackbar')) {\n const snackbarElem = target.closest('.snackbar') as HTMLElement;\n const snackbar = Snackbar.getInstance(snackbarElem);\n if (!snackbar) return;\n snackbar.panning = true;\n snackbar._pauseTimer();\n Snackbar._draggedSnackbar = snackbar;\n snackbar.el.classList.add('panning');\n snackbar.el.style.transition = '';\n Snackbar._dragPointerId = e.pointerId;\n snackbar.startingXPos = e.clientX;\n snackbar.velocityX = 0;\n snackbar.time = Date.now();\n snackbar.xPos = e.clientX;\n // A translateX does not change the width, so one read covers the drag.\n snackbar._activationDistance = snackbar.el.offsetWidth * snackbar.options.activationPercent;\n }\n }\n\n static _onDragMove(e: PointerEvent) {\n if (Snackbar._dragPointerId !== e.pointerId) return;\n if (!!Snackbar._draggedSnackbar) {\n e.preventDefault();\n const snackbar = Snackbar._draggedSnackbar;\n snackbar.deltaX = Math.abs(snackbar.xPos - e.clientX);\n snackbar.xPos = e.clientX;\n // Two moves in the same millisecond would divide by zero, and an\n // infinite velocity dismisses on release.\n snackbar.velocityX = snackbar.deltaX / Math.max(1, Date.now() - snackbar.time);\n snackbar.time = Date.now();\n\n const totalDeltaX = snackbar.xPos - snackbar.startingXPos;\n const activationDistance = snackbar._activationDistance;\n snackbar.el.style.transform = `translateX(${totalDeltaX}px)`;\n snackbar.el.style.opacity = (1 - Math.abs(totalDeltaX / activationDistance)).toString();\n }\n }\n\n static _onDragEnd(e: PointerEvent) {\n if (Snackbar._dragPointerId !== e.pointerId) return;\n Snackbar._dragPointerId = null;\n if (!!Snackbar._draggedSnackbar) {\n const snackbar = Snackbar._draggedSnackbar;\n snackbar.panning = false;\n snackbar.el.classList.remove('panning');\n\n const totalDeltaX = snackbar.xPos - snackbar.startingXPos;\n const activationDistance = snackbar._activationDistance;\n const velocity = Date.now() - snackbar.time < 100 ? snackbar.velocityX : 0;\n const shouldBeDismissed = Math.abs(totalDeltaX) > activationDistance || velocity > 1;\n\n // Remove snackbar\n if (shouldBeDismissed) {\n snackbar.wasSwiped = true;\n snackbar.dismiss();\n // Animate snackbar back to original position\n } else {\n snackbar._snapBack();\n }\n Snackbar._draggedSnackbar = null;\n }\n }\n\n /**\n * A cancelled pointer is not a short swipe. Snap back and resume the timer\n * without consulting the distance travelled - the browser took the gesture\n * over, so the movement so far says nothing about what the user wanted.\n */\n static _onDragCancel(e: PointerEvent) {\n if (Snackbar._dragPointerId !== e.pointerId) return;\n Snackbar._dragPointerId = null;\n const snackbar = Snackbar._draggedSnackbar;\n if (!snackbar) return;\n snackbar.panning = false;\n snackbar.el.classList.remove('panning');\n snackbar._snapBack();\n Snackbar._draggedSnackbar = null;\n }\n\n private _snapBack() {\n this.el.style.transition = 'transform .2s, opacity .2s';\n this.el.style.transform = '';\n this.el.style.opacity = '';\n this._resumeTimer();\n }\n\n /**\n * dismiss all snackbars.\n */\n static dismissAll() {\n // The queue first, so the one on screen does not hand over to it. Copy\n // first: dismiss() splices the lists it is iterating.\n for (const snackbar of [...Snackbar._queue, ...Snackbar._snackbars]) {\n snackbar.dismiss();\n }\n }\n\n /**\n * Whether dismiss() is done already: the snackbar was dismissed before, or\n * never showed and is dropped from the queue. A dropped one reports through\n * completeCallback but fires no events, never having been in the page.\n */\n private _leaveQueue(): boolean {\n if (this._dismissed) return true;\n const index = Snackbar._queue.indexOf(this);\n if (index < 0) return false;\n Snackbar._queue.splice(index, 1);\n this._drop();\n return true;\n }\n\n private _drop() {\n this._dismissed = true;\n // An authored body was never taken, so there is nothing to give back.\n if (this.el) this._remove(false);\n this.options.completeCallback?.();\n }\n\n _createSnackbar() {\n let snackbar: HTMLElement = this.options.snackbarId\n ? Utils.getElementById(this._portal, this.options.snackbarId)\n : document.createElement('div');\n if (snackbar instanceof HTMLTemplateElement) {\n const node = snackbar.content.cloneNode(true);\n snackbar = (node as HTMLElement).firstElementChild as HTMLElement;\n } else if (snackbar && this.options.snackbarId) {\n const placeholder = document.createComment('');\n snackbar.before(placeholder);\n const children = [...snackbar.childNodes];\n const attributes = ['class', 'style', 'role', 'aria-live', 'aria-atomic', 'inert']\n .map(name => [name, snackbar.getAttribute(name)]);\n this._restoreElement = () => {\n snackbar.replaceChildren(...children);\n for (const [name, value] of attributes) restoreAttribute(snackbar, name, value);\n placeholder.replaceWith(snackbar);\n };\n }\n if (!snackbar) throw new Error('Snackbar body not found');\n this._events = controllerFor(snackbar);\n const listenerOptions = { signal: this._events.signal };\n snackbar.classList.add('snackbar');\n snackbar.setAttribute('role', 'status');\n snackbar.setAttribute('aria-live', 'polite');\n snackbar.setAttribute('aria-atomic', 'true');\n snackbar.inert = false;\n snackbar.addEventListener('focusin', (e) => {\n if (e.relatedTarget instanceof HTMLElement && !snackbar.contains(e.relatedTarget)) {\n this._returnFocus = e.relatedTarget;\n }\n this._pauseTimer();\n }, listenerOptions);\n snackbar.addEventListener('keydown', (e) => {\n if (e.key !== 'Escape' || e.defaultPrevented || this._dismissed) return;\n e.preventDefault();\n e.stopPropagation();\n this.dismiss();\n }, listenerOptions);\n snackbar.addEventListener('focusout', () => {\n clearTimeout(this._focusTimer);\n this._focusTimer = setTimeout(() => this._resumeTimer(), 0);\n }, listenerOptions);\n snackbar.addEventListener('pointerenter', () => this._pauseTimer(), listenerOptions);\n snackbar.addEventListener('pointerleave', () => this._resumeTimer(), listenerOptions);\n // Add custom classes onto snackbar\n if (this.options.classes.length > 0) {\n snackbar.classList.add(...this.options.classes.split(' ').filter(Boolean));\n }\n if (this.message) {\n const text = document.createElement('p');\n text.textContent = this.message;\n snackbar.replaceChildren(text);\n }\n if (this.options.action) {\n const action = document.createElement('button');\n action.type = 'button';\n action.textContent = this.options.action;\n action.addEventListener('click', (e) => {\n e.stopPropagation();\n if (this._dismissed) return;\n try {\n if (typeof this.options.onAction === 'function') this.options.onAction();\n Utils.emit(this.el, 'action');\n } finally {\n this.dismiss();\n }\n }, listenerOptions);\n snackbar.appendChild(action);\n }\n if (this.options.dismissible) {\n const close = document.createElement('button');\n close.type = 'button';\n close.className = 'circle';\n close.setAttribute('aria-label', 'Dismiss');\n const icon = document.createElement('span');\n icon.className = 'material-symbols';\n icon.setAttribute('aria-hidden', 'true');\n icon.textContent = 'close';\n close.appendChild(icon);\n close.addEventListener('click', (e) => {\n e.stopPropagation();\n this.dismiss();\n }, listenerOptions);\n snackbar.appendChild(close);\n }\n return snackbar;\n }\n\n private _remove(advance = true) {\n if (this._events.signal.aborted) return;\n this._events.abort();\n clearTimeout(this.counterTimeout);\n clearTimeout(this._transitionTimer);\n clearTimeout(this._dismissTimer);\n clearTimeout(this._focusTimer);\n this.counterTimeout = null;\n if (Snackbar._draggedSnackbar === this) {\n Snackbar._draggedSnackbar = null;\n Snackbar._dragPointerId = null;\n }\n Reflect.set(this.el, 'Expressive_Snackbar', undefined);\n if (this._restoreElement) this._restoreElement();\n else this.el.remove();\n const index = Snackbar._snackbars.indexOf(this);\n if (index >= 0) Snackbar._snackbars.splice(index, 1);\n if (advance) Snackbar._advance();\n }\n\n /** Shows the next queued snackbar once the screen is clear, or tidies up. */\n private static _advance() {\n while (!Snackbar._replacing && !Snackbar._snackbars.length) {\n const next = Snackbar._queue.shift();\n if (!next) return Snackbar._tidy();\n Snackbar._showOrDrop(next);\n }\n }\n\n /**\n * A queued snackbar completes without showing when the page it was for has\n * gone: its `root`, such as a removed shadow host, or its authored body.\n * Shown there, nothing could reach it to dismiss it, and the queue would stall.\n */\n private static _showOrDrop(next: Snackbar) {\n if (Snackbar._canShow(next)) next._show();\n else next._drop();\n }\n\n private static _canShow(next: Snackbar): boolean {\n if (!next._portal.isConnected) return false;\n return !!next.el || next._hasBody();\n }\n\n /** Removes the container once nothing is left in it. */\n private static _tidy() {\n if (Snackbar._container?.childElementCount === 0) Snackbar._removeContainer();\n }\n\n _animateIn() {\n this.el.style.display = '';\n this.el.style.opacity = '0';\n this.el.style.transform = 'translateY(24px)';\n this.el.style.transition = `\n transform ${this.options.inDuration}ms ease,\n opacity ${this.options.inDuration}ms ease\n `;\n this._transitionTimer = setTimeout(() => {\n this.el.style.transform = '';\n this.el.style.opacity = '1';\n }, 1);\n }\n\n /**\n * Arm the dismissal timer.\n *\n * One timeout, not a 20ms interval ticking a counter down: the old form woke\n * the page up 50 times a second per snackbar purely to subtract 20 from a\n * number. Dragging pauses the countdown via _pauseTimer/_resumeTimer instead.\n */\n _setTimer() {\n if (this.timeRemaining === Infinity) return;\n this._deadline = Date.now() + this.timeRemaining;\n this.counterTimeout = setTimeout(() => this.dismiss(), this.timeRemaining);\n }\n\n /** Stop the countdown, banking the time that was left on it. */\n _pauseTimer() {\n if (this.counterTimeout == null) return;\n clearTimeout(this.counterTimeout);\n this.counterTimeout = null;\n this.timeRemaining = Math.max(0, this._deadline - Date.now());\n }\n\n /** Restart a countdown stopped by {@link _pauseTimer}. */\n _resumeTimer() {\n if (this._dismissed || this.panning || this.el.matches(':hover, :focus-within') || this.counterTimeout != null) return;\n this._setTimer();\n }\n\n private _restoreFocus(remove = false) {\n const focused = (this.el.getRootNode() as Document | ShadowRoot).activeElement;\n const returnFocus = focused && this.el.contains(focused) ? this._returnFocus : null;\n this.el.inert = true;\n if (remove) this._remove(false);\n if (returnFocus?.isConnected) returnFocus.focus({ preventScroll: true });\n }\n\n /**\n * Dismiss snackbar with animation.\n */\n dismiss() {\n if (this._leaveQueue()) return;\n this._dismissed = true;\n clearTimeout(this.counterTimeout);\n this.counterTimeout = null;\n this._restoreFocus();\n if (this._events.signal.aborted) return;\n Utils.emit(this.el, 'close');\n const duration = this.options.outDuration;\n const transitions = [`margin ${duration}ms ease`, `opacity ${duration}ms ease`];\n\n if (this.wasSwiped) {\n // Carry on off the side the user swiped toward, from where they let go.\n const direction = this.xPos < this.startingXPos ? -1 : 1;\n this.el.style.transform = `translateX(${direction * this.el.offsetWidth}px)`;\n this.el.style.opacity = '0';\n transitions.push(`transform ${duration}ms ease`);\n }\n\n this.el.style.transition = transitions.join(', ');\n\n clearTimeout(this._transitionTimer);\n this._transitionTimer = setTimeout(() => {\n this.el.style.opacity = '0';\n this.el.style.marginTop = '-40px';\n }, 1);\n\n this._dismissTimer = setTimeout(() => {\n // While the snackbar is still in the page, so the event reaches the document.\n Utils.emit(this.el, 'closed');\n this._remove();\n // Call the optional callback\n if (typeof this.options.completeCallback === 'function') {\n this.options.completeCallback();\n }\n }, this.options.outDuration);\n }\n\n static {\n Snackbar._snackbars = [];\n Snackbar._queue = [];\n Snackbar._container = null;\n Snackbar._draggedSnackbar = null;\n }\n}\n"],
5
+ "mappings": ";;;;;;;;AA8EA,IAAM,YAA6B;AAAA,EACjC,MAAM;AAAA,EACN,QAAQ;AAAA,EACR,UAAU;AAAA,EACV,aAAa;AAAA,EACb,eAAe;AAAA,EACf,YAAY;AAAA,EACZ,aAAa;AAAA,EACb,SAAS;AAAA,EACT,kBAAkB;AAAA,EAClB,mBAAmB;AAAA,EACnB,MAAM;AAAA,EACN,SAAS;AACX;AAEO,IAAM,YAAN,MAAM,UAAS;AAAA,EAuDpB,YAAY,UAAoC,CAAC,GAAG;AA9BpD,SAAQ,aAAa;AACrB,SAAQ,eAAmC;AAI3C,SAAQ,kBAAuC;AA0B7C,SAAK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,OAAO,KAAK,eAAe,KAAK;AACvD,WAAK,GAAG,MAAM,YAAY,cAAc,YAAY,KAAK,GAAG,WAAW;AACvE,WAAK,GAAG,MAAM,UAAU;AACxB,kBAAY,KAAK,aAAa,QAAQ,SAAS;AAAA,IACjD;AAEA,SAAK,GAAG,MAAM,aAAa,YAAY,KAAK,IAAI;AAEhD,iBAAa,KAAK,gBAAgB;AAClC,SAAK,mBAAmB,WAAW,MAAM;AACvC,WAAK,GAAG,MAAM,UAAU;AACxB,WAAK,GAAG,MAAM,YAAY;AAAA,IAC5B,GAAG,CAAC;AAEJ,SAAK,gBAAgB,WAAW,MAAM;AAEpC,YAAM,KAAK,KAAK,IAAI,QAAQ;AAC5B,WAAK,QAAQ;AAEb,UAAI,OAAO,KAAK,QAAQ,qBAAqB,YAAY;AACvD,aAAK,QAAQ,iBAAiB;AAAA,MAChC;AAAA,IACF,GAAG,KAAK,QAAQ,WAAW;AAAA,EAC7B;AAQF;AAAA;AAjjBa,UAwCI,aAAa;AAAA;AAxCjB,UA4CJ,iBAAgC;AAggBrC,UAAS,aAAa,CAAC;AACvB,UAAS,SAAS,CAAC;AACnB,UAAS,aAAa;AACtB,UAAS,mBAAmB;AA/iBzB,IAAM,WAAN;",
6
+ "names": []
7
+ }
@@ -0,0 +1,152 @@
1
+ import {
2
+ Component
3
+ } from "./chunk-EB2V4OKL.mjs";
4
+ import {
5
+ Utils
6
+ } from "./chunk-67UNY7RH.mjs";
7
+
8
+ // src/ts/components/pullToRefresh.ts
9
+ var _defaults = {
10
+ threshold: 64,
11
+ onRefresh: null,
12
+ i18n: {
13
+ refreshing: "Refreshing",
14
+ refreshed: "Refreshed"
15
+ }
16
+ };
17
+ var SLOP = 4;
18
+ var SCROLLING = /* @__PURE__ */ new Set(["auto", "scroll"]);
19
+ var stopsAt = (node, el) => SCROLLING.has(getComputedStyle(node).overflowY) && (node.scrollTop > 0 || node.contains(el));
20
+ var _PullToRefresh = class _PullToRefresh extends Component {
21
+ constructor(el, options) {
22
+ super(el, options);
23
+ /** Where the finger went down and on what, while it may still become a pull. */
24
+ this._start = null;
25
+ this._pulling = false;
26
+ this._travel = 0;
27
+ /** The running refresh. A new object each time, so a promise from an earlier one cannot end it. */
28
+ this._refresh = null;
29
+ this._onStart = (event) => {
30
+ if (this._refresh) return;
31
+ if (event.touches.length !== 1) {
32
+ this._endPull();
33
+ return;
34
+ }
35
+ const { clientX, clientY } = event.touches[0];
36
+ this._start = { x: clientX, y: clientY, target: Utils.eventTarget(event) };
37
+ };
38
+ this._onMove = (event) => {
39
+ if (!this._start) return;
40
+ const { clientX, clientY } = event.touches[0];
41
+ const dx = clientX - this._start.x;
42
+ const dy = clientY - this._start.y;
43
+ if (!this._pulling) this._decide(dx, dy, this._start.target);
44
+ if (this._pulling) this._drag(event, dy);
45
+ };
46
+ this._onEnd = () => {
47
+ const ready = this._pulling && this._travel >= this.options.threshold;
48
+ this._endPull();
49
+ if (ready) this.refresh();
50
+ };
51
+ this._endPull = () => {
52
+ this._start = null;
53
+ this._pulling = false;
54
+ this._travel = 0;
55
+ this.el.classList.remove("pulling");
56
+ this.el.style.removeProperty("--pull-to-refresh-offset");
57
+ this.el.style.removeProperty("--pull-to-refresh-progress");
58
+ };
59
+ this._onClick = (event) => {
60
+ const button = Utils.eventTarget(event)?.closest("[data-refresh]");
61
+ if (button && this.el.contains(button)) this.refresh();
62
+ };
63
+ if (!(this.options.threshold > 0)) this.options.threshold = _defaults.threshold;
64
+ this._status = el.ownerDocument.createElement("span");
65
+ this._status.className = "pull-to-refresh-status";
66
+ this._status.setAttribute("role", "status");
67
+ el.append(this._status);
68
+ const signal = this._events.signal;
69
+ el.addEventListener("touchstart", this._onStart, { passive: true, signal });
70
+ el.addEventListener("touchmove", this._onMove, { passive: false, signal });
71
+ el.addEventListener("touchend", this._onEnd, { signal });
72
+ el.addEventListener("touchcancel", this._endPull, { signal });
73
+ el.addEventListener("click", this._onClick, { signal });
74
+ }
75
+ static get defaults() {
76
+ return _defaults;
77
+ }
78
+ /** Starts a refresh, as a pull or the refresh button does. Does nothing while one runs. */
79
+ refresh() {
80
+ if (this._refresh || _PullToRefresh.getInstance(this.el) !== this) return;
81
+ const run = { pending: 0 };
82
+ this._refresh = run;
83
+ this.el.setAttribute("aria-busy", "true");
84
+ this._status.textContent = this.options.i18n.refreshing;
85
+ const settle = () => {
86
+ if (--run.pending === 0 && this._refresh === run) this.complete();
87
+ };
88
+ const detail = {
89
+ waitUntil: (promise) => {
90
+ run.pending++;
91
+ Promise.resolve(promise).finally(settle);
92
+ }
93
+ };
94
+ this._fireRefresh(run, detail);
95
+ }
96
+ /** Ends the running refresh: the indicator hides, `aria-busy` goes and the finish is announced. */
97
+ complete() {
98
+ if (this._refresh) this._status.textContent = this.options.i18n.refreshed;
99
+ this._refresh = null;
100
+ this.el.removeAttribute("aria-busy");
101
+ }
102
+ destroy() {
103
+ this._endPull();
104
+ this.complete();
105
+ this._status.remove();
106
+ super.destroy();
107
+ }
108
+ /**
109
+ * Runs `onRefresh` and fires the event. A callback that throws ends the
110
+ * refresh it started, so later pulls still work, and the error still reaches the page.
111
+ */
112
+ _fireRefresh(run, detail) {
113
+ try {
114
+ this._notify("refresh", this.options.onRefresh, { args: [detail], detail });
115
+ } catch (error) {
116
+ if (this._refresh === run) this.complete();
117
+ throw error;
118
+ }
119
+ }
120
+ /**
121
+ * Whether a downward drag from `target` would scroll something instead: a
122
+ * scrolled-down scroller inside the container, the container itself, or
123
+ * the scroller it sits in, which is the page when no ancestor scrolls.
124
+ */
125
+ _canScrollUp(target) {
126
+ let node = target;
127
+ while (node && !stopsAt(node, this.el)) node = node.parentElement;
128
+ return (node ?? this.el.ownerDocument.scrollingElement).scrollTop > 0;
129
+ }
130
+ /** Pulls once the finger moves down, or leaves the touch to scrolling when it moves another way first. */
131
+ _decide(dx, dy, target) {
132
+ if (Math.max(Math.abs(dx), Math.abs(dy)) <= SLOP) return;
133
+ if (dy > Math.abs(dx) && !this._canScrollUp(target)) this._pulling = true;
134
+ else this._start = null;
135
+ }
136
+ /** Moves the indicator down with the finger, at half its travel, and fades it in toward the threshold. */
137
+ _drag(event, dy) {
138
+ if (event.cancelable) event.preventDefault();
139
+ const { threshold } = this.options;
140
+ this._travel = Math.max(dy, 0);
141
+ this.el.classList.add("pulling");
142
+ this.el.style.setProperty("--pull-to-refresh-offset", `${Math.min(this._travel, threshold * 2) / 2}px`);
143
+ this.el.style.setProperty("--pull-to-refresh-progress", `${Math.min(this._travel / threshold, 1)}`);
144
+ }
145
+ };
146
+ _PullToRefresh.key = "Expressive_PullToRefresh";
147
+ var PullToRefresh = _PullToRefresh;
148
+
149
+ export {
150
+ PullToRefresh
151
+ };
152
+ //# sourceMappingURL=chunk-HQRLBTNM.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/ts/components/pullToRefresh.ts"],
4
+ "sourcesContent": ["import { Component, BaseOptions } from '../core/component';\nimport { Utils } from '../core/utils';\n\n/** What `expressive:refresh` carries, and what `onRefresh` receives. */\nexport interface PullToRefreshDetail {\n /** Keeps the refresh running until the promise settles, fulfilled or rejected. */\n waitUntil(promise: PromiseLike<unknown>): void;\n}\n\n/** What the container's status region announces. */\nexport interface PullToRefreshI18nOptions {\n /** Announced when a refresh starts. */\n refreshing: string;\n /** Announced when it finishes. */\n refreshed: string;\n}\n\nexport interface PullToRefreshOptions extends BaseOptions {\n /**\n * How far a finger must pull down, in pixels, for the release to refresh.\n * A value that is not a positive number falls back to the default.\n * @default 64\n */\n threshold: number;\n /**\n * Called when a refresh starts, with the event's detail.\n * @default null\n */\n onRefresh: ((detail: PullToRefreshDetail) => void) | null;\n /** What the status region announces when a refresh starts and finishes. */\n i18n: Partial<PullToRefreshI18nOptions>;\n}\n\nconst _defaults: PullToRefreshOptions = {\n threshold: 64,\n onRefresh: null,\n i18n: {\n refreshing: 'Refreshing',\n refreshed: 'Refreshed'\n }\n};\n\n/** One refresh, with how many `waitUntil()` promises it still waits for. */\ntype Run = { pending: number };\n\n/** Past this the finger was moving, not resting. Hand jitter, in pixels. */\nconst SLOP = 4;\n/** `overflow-y` values that make an element a scroll container. */\nconst SCROLLING = new Set(['auto', 'scroll']);\n\n/**\n * Whether the walk up from a touch stops at `node`: a scroll container that\n * is scrolled down, so a downward drag scrolls it, or the one that holds the\n * pull-to-refresh container, which decides on its own.\n */\nconst stopsAt = (node: Element, el: Element) =>\n SCROLLING.has(getComputedStyle(node).overflowY) && (node.scrollTop > 0 || node.contains(el));\n\n/**\n * Pull-to-refresh. A touch pull down from the top of the container, or a\n * `[data-refresh]` button inside it, starts a refresh. The refresh runs until\n * every promise passed to `waitUntil()` settles or the page calls `complete()`.\n *\n * Touch events rather than pointer events: a pointer drag the browser takes\n * for a pan ends in `pointercancel`, and Safari has no directional\n * `touch-action` to keep a downward pull from it. A mouse never fires touch\n * events; a stylus does where the browser reports it as touch, as Safari on\n * iPadOS does.\n */\nexport class PullToRefresh extends Component<PullToRefreshOptions> {\n static key = 'Expressive_PullToRefresh';\n /** Where the finger went down and on what, while it may still become a pull. */\n private _start: { x: number; y: number; target: Element | null } | null = null;\n private _pulling = false;\n private _travel = 0;\n /** The running refresh. A new object each time, so a promise from an earlier one cannot end it. */\n private _refresh: Run | null = null;\n /**\n * Announces the start and the finish. The author's indicator cannot: it is\n * hidden once the refresh ends, which would drop the finish.\n */\n private _status: HTMLElement;\n\n constructor(el: HTMLElement, options: Partial<PullToRefreshOptions>) {\n super(el, options);\n // Markup options are untrusted; zero or less would refresh on any pull.\n if (!(this.options.threshold > 0)) this.options.threshold = _defaults.threshold;\n this._status = el.ownerDocument.createElement('span');\n this._status.className = 'pull-to-refresh-status';\n this._status.setAttribute('role', 'status');\n el.append(this._status);\n const signal = this._events.signal;\n el.addEventListener('touchstart', this._onStart, { passive: true, signal });\n // Not passive: a pull cancels the move so the container does not also scroll.\n el.addEventListener('touchmove', this._onMove, { passive: false, signal });\n el.addEventListener('touchend', this._onEnd, { signal });\n el.addEventListener('touchcancel', this._endPull, { signal });\n el.addEventListener('click', this._onClick, { signal });\n }\n\n static get defaults(): PullToRefreshOptions {\n return _defaults;\n }\n\n /** Starts a refresh, as a pull or the refresh button does. Does nothing while one runs. */\n refresh() {\n if (this._refresh || PullToRefresh.getInstance(this.el) !== this) return;\n const run: Run = { pending: 0 };\n this._refresh = run;\n this.el.setAttribute('aria-busy', 'true');\n this._status.textContent = this.options.i18n.refreshing;\n const settle = () => {\n if (--run.pending === 0 && this._refresh === run) this.complete();\n };\n const detail: PullToRefreshDetail = {\n waitUntil: (promise) => {\n run.pending++;\n // finally() passes a rejection on, so a failure the page does not\n // catch still reaches unhandledrejection.\n Promise.resolve(promise).finally(settle);\n }\n };\n this._fireRefresh(run, detail);\n }\n\n /** Ends the running refresh: the indicator hides, `aria-busy` goes and the finish is announced. */\n complete() {\n if (this._refresh) this._status.textContent = this.options.i18n.refreshed;\n this._refresh = null;\n this.el.removeAttribute('aria-busy');\n }\n\n destroy() {\n this._endPull();\n this.complete();\n this._status.remove();\n super.destroy();\n }\n\n /**\n * Runs `onRefresh` and fires the event. A callback that throws ends the\n * refresh it started, so later pulls still work, and the error still reaches the page.\n */\n private _fireRefresh(run: Run, detail: PullToRefreshDetail) {\n try {\n this._notify('refresh', this.options.onRefresh, { args: [detail], detail });\n } catch (error) {\n if (this._refresh === run) this.complete();\n throw error;\n }\n }\n\n /**\n * Whether a downward drag from `target` would scroll something instead: a\n * scrolled-down scroller inside the container, the container itself, or\n * the scroller it sits in, which is the page when no ancestor scrolls.\n */\n private _canScrollUp(target: Element | null) {\n let node = target;\n while (node && !stopsAt(node, this.el)) node = node.parentElement;\n return (node ?? this.el.ownerDocument.scrollingElement!).scrollTop > 0;\n }\n\n private _onStart = (event: TouchEvent) => {\n if (this._refresh) return;\n // A second finger is a pinch or a mistake, not a pull.\n if (event.touches.length !== 1) {\n this._endPull();\n return;\n }\n const { clientX, clientY } = event.touches[0];\n this._start = { x: clientX, y: clientY, target: Utils.eventTarget(event) };\n };\n\n private _onMove = (event: TouchEvent) => {\n if (!this._start) return;\n const { clientX, clientY } = event.touches[0];\n const dx = clientX - this._start.x;\n const dy = clientY - this._start.y;\n if (!this._pulling) this._decide(dx, dy, this._start.target);\n if (this._pulling) this._drag(event, dy);\n };\n\n /** Pulls once the finger moves down, or leaves the touch to scrolling when it moves another way first. */\n private _decide(dx: number, dy: number, target: Element | null) {\n if (Math.max(Math.abs(dx), Math.abs(dy)) <= SLOP) return;\n if (dy > Math.abs(dx) && !this._canScrollUp(target)) this._pulling = true;\n else this._start = null;\n }\n\n /** Moves the indicator down with the finger, at half its travel, and fades it in toward the threshold. */\n private _drag(event: TouchEvent, dy: number) {\n if (event.cancelable) event.preventDefault();\n const { threshold } = this.options;\n this._travel = Math.max(dy, 0);\n this.el.classList.add('pulling');\n this.el.style.setProperty('--pull-to-refresh-offset', `${Math.min(this._travel, threshold * 2) / 2}px`);\n this.el.style.setProperty('--pull-to-refresh-progress', `${Math.min(this._travel / threshold, 1)}`);\n }\n\n private _onEnd = () => {\n const ready = this._pulling && this._travel >= this.options.threshold;\n this._endPull();\n if (ready) this.refresh();\n };\n\n private _endPull = () => {\n this._start = null;\n this._pulling = false;\n this._travel = 0;\n this.el.classList.remove('pulling');\n this.el.style.removeProperty('--pull-to-refresh-offset');\n this.el.style.removeProperty('--pull-to-refresh-progress');\n };\n\n private _onClick = (event: MouseEvent) => {\n const button = Utils.eventTarget(event)?.closest('[data-refresh]');\n if (button && this.el.contains(button)) this.refresh();\n };\n}\n"],
5
+ "mappings": ";;;;;;;;AAiCA,IAAM,YAAkC;AAAA,EACtC,WAAW;AAAA,EACX,WAAW;AAAA,EACX,MAAM;AAAA,IACJ,YAAY;AAAA,IACZ,WAAW;AAAA,EACb;AACF;AAMA,IAAM,OAAO;AAEb,IAAM,YAAY,oBAAI,IAAI,CAAC,QAAQ,QAAQ,CAAC;AAO5C,IAAM,UAAU,CAAC,MAAe,OAC9B,UAAU,IAAI,iBAAiB,IAAI,EAAE,SAAS,M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,YAAY,CAAC,IAAI,CAAC,IAAI;AACtG,SAAK,GAAG,MAAM,YAAY,8BAA8B,GAAG,KAAK,IAAI,KAAK,UAAU,WAAW,CAAC,CAAC,EAAE;AAAA,EACpG;AAqBF;AAtJa,eACJ,MAAM;AADR,IAAM,gBAAN;",
6
+ "names": []
7
+ }
@@ -0,0 +1,137 @@
1
+ import {
2
+ Utils
3
+ } from "./chunk-67UNY7RH.mjs";
4
+
5
+ // src/ts/behaviors/tour.ts
6
+ var states = /* @__PURE__ */ new WeakMap();
7
+ var anchor = "--tour-target";
8
+ var _Tour = class _Tour {
9
+ static Init() {
10
+ if (_Tour._initialized || typeof document === "undefined") return;
11
+ _Tour._initialized = true;
12
+ document.addEventListener("click", _Tour._onClick);
13
+ document.addEventListener("keydown", (e) => {
14
+ const tour = Utils.closestInPath(e, ".tour");
15
+ if (e.key === "Escape" && tour instanceof HTMLElement && states.has(tour)) _Tour.end(tour);
16
+ });
17
+ document.addEventListener(
18
+ "toggle",
19
+ (e) => {
20
+ const tour = e.target;
21
+ if (e.newState === "closed" && states.has(tour)) _Tour.end(tour);
22
+ },
23
+ true
24
+ );
25
+ }
26
+ /** Opens the tour at a step. Does nothing when no step has a visible target. */
27
+ static start(tour, index = 0) {
28
+ const steps = [...tour.querySelectorAll(":scope > section[data-tour-target]")].filter(
29
+ (step) => _Tour._target(step)?.checkVisibility()
30
+ );
31
+ if (!steps.length) return;
32
+ const previous = states.get(tour);
33
+ if (previous) _Tour._release(previous.steps[previous.index]);
34
+ const state = { steps, index: 0, opener: _Tour._opener(tour, previous) };
35
+ states.set(tour, state);
36
+ _Tour._show(tour, !previous);
37
+ if (states.get(tour) === state) _Tour.go(tour, index);
38
+ }
39
+ /** Where focus returns at the end: the first start's focus, kept across restarts. */
40
+ static _opener(tour, previous) {
41
+ if (previous?.opener) return previous.opener;
42
+ const active = tour.getRootNode().activeElement;
43
+ return active instanceof HTMLElement ? active : null;
44
+ }
45
+ /** Shows the card, and reports the start of a tour that was not running. */
46
+ static _show(tour, opening) {
47
+ if (!tour.matches(":popover-open")) tour.showPopover();
48
+ if (opening) Utils.emit(tour, "open");
49
+ }
50
+ /** Shows step `index` of a running tour. */
51
+ static go(tour, index) {
52
+ const state = states.get(tour);
53
+ if (!state) return;
54
+ _Tour._release(state.steps[state.index]);
55
+ index = Math.min(Math.max(index, 0), state.steps.length - 1);
56
+ const travel = index < state.index ? -1 : 1;
57
+ while (state.steps[index] && !_Tour._target(state.steps[index])) index += travel;
58
+ const step = state.steps[index];
59
+ if (!step) {
60
+ _Tour.end(tour);
61
+ return;
62
+ }
63
+ state.index = index;
64
+ const last = state.index === state.steps.length - 1;
65
+ tour.querySelectorAll(":scope > section[data-tour-target]").forEach((section) => {
66
+ section.hidden = section !== step;
67
+ });
68
+ const heading = step.querySelector("h1, h2, h3, h4, h5, h6");
69
+ if (heading) {
70
+ if (!heading.id) heading.id = `tour-${Utils.guid()}`;
71
+ tour.setAttribute("aria-labelledby", heading.id);
72
+ }
73
+ const progress = tour.querySelector(".tour-progress");
74
+ if (progress) {
75
+ progress.textContent = _Tour.i18n.progress.replace("{current}", String(state.index + 1)).replace("{total}", String(state.steps.length));
76
+ }
77
+ const toggle = (selector, show) => tour.querySelectorAll(selector).forEach((button) => button.hidden = !show);
78
+ toggle("[data-tour-back]", state.index > 0);
79
+ toggle("[data-tour-next]", !last);
80
+ toggle("[data-tour-done]", last);
81
+ const target = _Tour._target(step);
82
+ target.classList.add("tour-target");
83
+ Utils.setAnchorName(target, anchor, true);
84
+ const smooth = !matchMedia("(prefers-reduced-motion: reduce)").matches;
85
+ target.scrollIntoView({ block: "center", behavior: smooth ? "smooth" : "auto" });
86
+ if (!tour.hasAttribute("tabindex")) tour.tabIndex = -1;
87
+ tour.focus({ preventScroll: true });
88
+ Utils.emit(tour, "change", { step, index: state.index });
89
+ }
90
+ /**
91
+ * Ends a running tour and returns focus to where it was. `completed` says
92
+ * the user finished it, as the done button does, rather than dismissed it.
93
+ */
94
+ static end(tour, completed = false) {
95
+ const state = states.get(tour);
96
+ if (!state) return;
97
+ _Tour._release(state.steps[state.index]);
98
+ states.delete(tour);
99
+ if (tour.matches(":popover-open")) tour.hidePopover();
100
+ state.opener?.focus();
101
+ Utils.emit(tour, "close", { completed });
102
+ }
103
+ static _target(step) {
104
+ return Utils.getElementById(step, step.getAttribute("data-tour-target") ?? "");
105
+ }
106
+ static _release(step) {
107
+ const target = step && _Tour._target(step);
108
+ target?.classList.remove("tour-target");
109
+ if (target) Utils.setAnchorName(target, anchor, false);
110
+ }
111
+ static _onClick(e) {
112
+ const control = Utils.closestInPath(
113
+ e,
114
+ "[data-tour-start], [data-tour-back], [data-tour-next], [data-tour-done], [data-tour-close]"
115
+ );
116
+ if (!control) return;
117
+ if (control.hasAttribute("data-tour-start")) {
118
+ const tour2 = Utils.getElementById(control, control.getAttribute("data-tour-start"));
119
+ if (tour2?.matches(".tour")) _Tour.start(tour2);
120
+ return;
121
+ }
122
+ const tour = control.closest(".tour");
123
+ const state = tour && states.get(tour);
124
+ if (!state) return;
125
+ if (control.hasAttribute("data-tour-back")) _Tour.go(tour, state.index - 1);
126
+ else if (control.hasAttribute("data-tour-next")) _Tour.go(tour, state.index + 1);
127
+ else _Tour.end(tour, control.hasAttribute("data-tour-done"));
128
+ }
129
+ };
130
+ _Tour.i18n = { progress: "Step {current} of {total}" };
131
+ _Tour._initialized = false;
132
+ var Tour = _Tour;
133
+
134
+ export {
135
+ Tour
136
+ };
137
+ //# sourceMappingURL=chunk-I2F7MLUU.mjs.map
@@ -0,0 +1,7 @@
1
+ {
2
+ "version": 3,
3
+ "sources": ["../../../src/ts/behaviors/tour.ts"],
4
+ "sourcesContent": ["import { Utils } from '../core/utils';\n\ninterface TourState {\n steps: HTMLElement[];\n index: number;\n opener: HTMLElement | null;\n}\n\nconst states = new WeakMap<HTMLElement, TourState>();\nconst anchor = '--tour-target';\n\n/**\n * Product tour. A `.tour` is a `popover=\"manual\"` card holding one `<section>`\n * per step; each section's `data-tour-target` names the id of the element it\n * explains. The card shows one step at a time beside its target, which gets a\n * highlight ring and scrolls into view. Steps whose target is missing or\n * hidden are skipped.\n *\n * `[data-tour-start=\"tour-id\"]` starts a tour; inside it, `[data-tour-back]`,\n * `[data-tour-next]`, `[data-tour-done]` and `[data-tour-close]` move through\n * it or end it, and Escape ends it. Back hides on the first step, Next on the\n * last, Done everywhere else. Ending hides the card (its `toggle` event says\n * so) and returns focus to whatever had it before the tour.\n */\nexport class Tour {\n static i18n = { progress: 'Step {current} of {total}' };\n private static _initialized = false;\n\n static Init() {\n if (Tour._initialized || typeof document === 'undefined') return;\n Tour._initialized = true;\n document.addEventListener('click', Tour._onClick);\n document.addEventListener('keydown', (e) => {\n const tour = Utils.closestInPath(e, '.tour');\n if (e.key === 'Escape' && tour instanceof HTMLElement && states.has(tour)) Tour.end(tour);\n });\n // A page that hides the card itself still gets the target released.\n // `toggle` does not bubble, so this listens in the capture phase.\n document.addEventListener(\n 'toggle',\n (e: ToggleEvent) => {\n const tour = e.target as HTMLElement;\n if (e.newState === 'closed' && states.has(tour)) Tour.end(tour);\n },\n true\n );\n }\n\n /** Opens the tour at a step. Does nothing when no step has a visible target. */\n static start(tour: HTMLElement, index = 0) {\n const steps = [...tour.querySelectorAll<HTMLElement>(':scope > section[data-tour-target]')].filter((step) =>\n Tour._target(step)?.checkVisibility()\n );\n if (!steps.length) return;\n const previous = states.get(tour);\n // Restarting a running tour: let go of the step it was showing, or two\n // targets carry the highlight and the card's anchor name.\n if (previous) Tour._release(previous.steps[previous.index]);\n const state: TourState = { steps, index: 0, opener: Tour._opener(tour, previous) };\n states.set(tour, state);\n Tour._show(tour, !previous);\n // An open listener may have ended or restarted the tour.\n if (states.get(tour) === state) Tour.go(tour, index);\n }\n\n /** Where focus returns at the end: the first start's focus, kept across restarts. */\n private static _opener(tour: HTMLElement, previous: TourState | undefined): HTMLElement | null {\n if (previous?.opener) return previous.opener;\n const active = (tour.getRootNode() as Document | ShadowRoot).activeElement;\n return active instanceof HTMLElement ? active : null;\n }\n\n /** Shows the card, and reports the start of a tour that was not running. */\n private static _show(tour: HTMLElement, opening: boolean) {\n if (!tour.matches(':popover-open')) tour.showPopover();\n if (opening) Utils.emit(tour, 'open');\n }\n\n /** Shows step `index` of a running tour. */\n static go(tour: HTMLElement, index: number) {\n const state = states.get(tour);\n if (!state) return;\n Tour._release(state.steps[state.index]);\n index = Math.min(Math.max(index, 0), state.steps.length - 1);\n // A target removed since start() is passed over in the direction of\n // travel; with none left that way the tour ends.\n const travel = index < state.index ? -1 : 1;\n while (state.steps[index] && !Tour._target(state.steps[index])) index += travel;\n const step = state.steps[index];\n if (!step) {\n Tour.end(tour);\n return;\n }\n state.index = index;\n const last = state.index === state.steps.length - 1;\n tour.querySelectorAll<HTMLElement>(':scope > section[data-tour-target]').forEach((section) => {\n section.hidden = section !== step;\n });\n const heading = step.querySelector<HTMLElement>('h1, h2, h3, h4, h5, h6');\n if (heading) {\n if (!heading.id) heading.id = `tour-${Utils.guid()}`;\n tour.setAttribute('aria-labelledby', heading.id);\n }\n const progress = tour.querySelector('.tour-progress');\n if (progress) {\n progress.textContent = Tour.i18n.progress\n .replace('{current}', String(state.index + 1))\n .replace('{total}', String(state.steps.length));\n }\n const toggle = (selector: string, show: boolean) =>\n tour.querySelectorAll<HTMLElement>(selector).forEach((button) => (button.hidden = !show));\n toggle('[data-tour-back]', state.index > 0);\n toggle('[data-tour-next]', !last);\n toggle('[data-tour-done]', last);\n\n const target = Tour._target(step);\n target.classList.add('tour-target');\n Utils.setAnchorName(target, anchor, true);\n const smooth = !matchMedia('(prefers-reduced-motion: reduce)').matches;\n target.scrollIntoView({ block: 'center', behavior: smooth ? 'smooth' : 'auto' });\n if (!tour.hasAttribute('tabindex')) tour.tabIndex = -1;\n tour.focus({ preventScroll: true });\n Utils.emit(tour, 'change', { step, index: state.index });\n }\n\n /**\n * Ends a running tour and returns focus to where it was. `completed` says\n * the user finished it, as the done button does, rather than dismissed it.\n */\n static end(tour: HTMLElement, completed = false) {\n const state = states.get(tour);\n if (!state) return;\n Tour._release(state.steps[state.index]);\n states.delete(tour);\n if (tour.matches(':popover-open')) tour.hidePopover();\n state.opener?.focus();\n Utils.emit(tour, 'close', { completed });\n }\n\n private static _target(step: HTMLElement): HTMLElement | null {\n return Utils.getElementById(step, step.getAttribute('data-tour-target') ?? '');\n }\n\n private static _release(step: HTMLElement | undefined) {\n const target = step && Tour._target(step);\n target?.classList.remove('tour-target');\n if (target) Utils.setAnchorName(target, anchor, false);\n }\n\n private static _onClick(e: MouseEvent) {\n const control = Utils.closestInPath(\n e,\n '[data-tour-start], [data-tour-back], [data-tour-next], [data-tour-done], [data-tour-close]'\n );\n if (!control) return;\n if (control.hasAttribute('data-tour-start')) {\n const tour = Utils.getElementById(control, control.getAttribute('data-tour-start'));\n if (tour?.matches('.tour')) Tour.start(tour);\n return;\n }\n const tour = control.closest<HTMLElement>('.tour');\n const state = tour && states.get(tour);\n if (!state) return;\n if (control.hasAttribute('data-tour-back')) Tour.go(tour, state.index - 1);\n else if (control.hasAttribute('data-tour-next')) Tour.go(tour, state.index + 1);\n else Tour.end(tour, control.hasAttribute('data-tour-done'));\n }\n}\n"],
5
+ "mappings": ";;;;;AAQA,IAAM,SAAS,oBAAI,QAAgC;AACnD,IAAM,SAAS;AAeR,IAAM,QAAN,MAAM,MAAK;AAAA,EAIhB,OAAO,OAAO;AACZ,QAAI,MAAK,gBAAgB,OAAO,aAAa,YAAa;AAC1D,UAAK,eAAe;AACpB,aAAS,iBAAiB,SAAS,MAAK,QAAQ;AAChD,aAAS,iBAAiB,WAAW,CAAC,MAAM;AAC1C,YAAM,OAAO,MAAM,cAAc,GAAG,OAAO;AAC3C,UAAI,EAAE,QAAQ,YAAY,gBAAgB,eAAe,OAAO,IAAI,IAAI,EAAG,OAAK,IAAI,IAAI;AAAA,IAC1F,CAAC;AAGD,aAAS;AAAA,MACP;AAAA,MACA,CAAC,MAAmB;AAClB,cAAM,OAAO,EAAE;AACf,YAAI,E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