@youcan/celeste 0.6.97 → 0.6.99

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 (977) hide show
  1. package/dist/celeste.css +2034 -2034
  2. package/dist/cjs/alert.cjs +2 -0
  3. package/dist/cjs/alpha-slider.cjs +2 -0
  4. package/dist/cjs/badge.cjs +2 -0
  5. package/dist/cjs/button.cjs +2 -0
  6. package/dist/cjs/checkbox-card.cjs +2 -0
  7. package/dist/cjs/checkbox-label.cjs +2 -0
  8. package/dist/cjs/checkbox.cjs +2 -0
  9. package/dist/cjs/chunks/_plugin-vue_export-helper.cjs +13 -0
  10. package/dist/cjs/chunks/alert.cjs +103 -0
  11. package/dist/cjs/chunks/alpha-slider.cjs +119 -0
  12. package/dist/cjs/chunks/badge.cjs +59 -0
  13. package/dist/cjs/chunks/button.cjs +43 -0
  14. package/dist/cjs/chunks/checkbox-card.cjs +100 -0
  15. package/dist/cjs/chunks/checkbox-label.cjs +94 -0
  16. package/dist/cjs/chunks/checkbox.cjs +40 -0
  17. package/dist/cjs/chunks/clsx.cjs +21 -0
  18. package/dist/cjs/chunks/collapsible-content.cjs +30 -0
  19. package/dist/cjs/chunks/collapsible-trigger.cjs +27 -0
  20. package/dist/cjs/chunks/collapsible.cjs +31 -0
  21. package/dist/cjs/chunks/color-area.cjs +174 -0
  22. package/dist/cjs/chunks/color-picker.cjs +458 -0
  23. package/dist/cjs/chunks/color-swatch.cjs +65 -0
  24. package/dist/cjs/chunks/combobox-anchor.cjs +33 -0
  25. package/dist/cjs/chunks/combobox-empty.cjs +36 -0
  26. package/dist/cjs/chunks/combobox-group.cjs +43 -0
  27. package/dist/cjs/chunks/combobox-input.cjs +72 -0
  28. package/dist/cjs/chunks/combobox-item.cjs +95 -0
  29. package/dist/cjs/chunks/combobox-list.cjs +66 -0
  30. package/dist/cjs/chunks/combobox-root.cjs +50 -0
  31. package/dist/cjs/chunks/combobox-separator.cjs +36 -0
  32. package/dist/cjs/chunks/combobox-trigger.cjs +45 -0
  33. package/dist/cjs/chunks/combobox.cjs +199 -0
  34. package/dist/cjs/chunks/compact-button.cjs +44 -0
  35. package/dist/cjs/chunks/components.cjs +310 -0
  36. package/dist/cjs/chunks/content-divider.cjs +60 -0
  37. package/dist/cjs/chunks/core.cjs +325 -0
  38. package/dist/cjs/chunks/counter-input.cjs +75 -0
  39. package/dist/cjs/chunks/digit-input-group.cjs +34 -0
  40. package/dist/cjs/chunks/digit-input-slot.cjs +33 -0
  41. package/dist/cjs/chunks/digit-input.cjs +54 -0
  42. package/dist/cjs/chunks/dist.cjs +12213 -0
  43. package/dist/cjs/chunks/dist2.cjs +15565 -0
  44. package/dist/cjs/chunks/dropdown-menu-content.cjs +62 -0
  45. package/dist/cjs/chunks/dropdown-menu-group.cjs +30 -0
  46. package/dist/cjs/chunks/dropdown-menu-item.cjs +49 -0
  47. package/dist/cjs/chunks/dropdown-menu-label.cjs +34 -0
  48. package/dist/cjs/chunks/dropdown-menu-separator.cjs +31 -0
  49. package/dist/cjs/chunks/dropdown-menu-sub-content.cjs +59 -0
  50. package/dist/cjs/chunks/dropdown-menu-sub-trigger.cjs +45 -0
  51. package/dist/cjs/chunks/dropdown-menu-sub.cjs +28 -0
  52. package/dist/cjs/chunks/dropdown-menu-trigger.cjs +31 -0
  53. package/dist/cjs/chunks/dropdown-menu.cjs +38 -0
  54. package/dist/cjs/chunks/extra-settings.cjs +134 -0
  55. package/dist/cjs/chunks/fancy-button.cjs +42 -0
  56. package/dist/cjs/chunks/file-upload-area.cjs +139 -0
  57. package/dist/cjs/chunks/hint-text.cjs +38 -0
  58. package/dist/cjs/chunks/hue-slider.cjs +120 -0
  59. package/dist/cjs/chunks/label.cjs +64 -0
  60. package/dist/cjs/chunks/link-bubble.cjs +198 -0
  61. package/dist/cjs/chunks/link-button.cjs +48 -0
  62. package/dist/cjs/chunks/menus.cjs +1173 -0
  63. package/dist/cjs/chunks/modal-body.cjs +25 -0
  64. package/dist/cjs/chunks/modal-close.cjs +27 -0
  65. package/dist/cjs/chunks/modal-content.cjs +53 -0
  66. package/dist/cjs/chunks/modal-footer.cjs +25 -0
  67. package/dist/cjs/chunks/modal-header.cjs +83 -0
  68. package/dist/cjs/chunks/modal-trigger.cjs +27 -0
  69. package/dist/cjs/chunks/modal.cjs +29 -0
  70. package/dist/cjs/chunks/pagination-content.cjs +34 -0
  71. package/dist/cjs/chunks/pagination-ellipsis.cjs +37 -0
  72. package/dist/cjs/chunks/pagination-first.cjs +34 -0
  73. package/dist/cjs/chunks/pagination-item.cjs +37 -0
  74. package/dist/cjs/chunks/pagination-last.cjs +34 -0
  75. package/dist/cjs/chunks/pagination-next.cjs +34 -0
  76. package/dist/cjs/chunks/pagination-previous.cjs +34 -0
  77. package/dist/cjs/chunks/pagination.cjs +60 -0
  78. package/dist/cjs/chunks/popover-content.cjs +113 -0
  79. package/dist/cjs/chunks/popover-trigger.cjs +30 -0
  80. package/dist/cjs/chunks/popover.cjs +29 -0
  81. package/dist/cjs/chunks/progress-bar.cjs +73 -0
  82. package/dist/cjs/chunks/progress-circle.cjs +95 -0
  83. package/dist/cjs/chunks/radio-group-card.cjs +100 -0
  84. package/dist/cjs/chunks/radio-group-item.cjs +36 -0
  85. package/dist/cjs/chunks/radio-group-label.cjs +94 -0
  86. package/dist/cjs/chunks/radio-group.cjs +41 -0
  87. package/dist/cjs/chunks/rich-editor.cjs +5187 -0
  88. package/dist/cjs/chunks/scroll-area.cjs +46 -0
  89. package/dist/cjs/chunks/scroll-bar.cjs +37 -0
  90. package/dist/cjs/chunks/segmented-control-item.cjs +43 -0
  91. package/dist/cjs/chunks/segmented-control.cjs +43 -0
  92. package/dist/cjs/chunks/select-content.cjs +66 -0
  93. package/dist/cjs/chunks/select-group.cjs +27 -0
  94. package/dist/cjs/chunks/select-icon.cjs +27 -0
  95. package/dist/cjs/chunks/select-item.cjs +43 -0
  96. package/dist/cjs/chunks/select-label.cjs +35 -0
  97. package/dist/cjs/chunks/select-separator.cjs +31 -0
  98. package/dist/cjs/chunks/select-trigger.cjs +41 -0
  99. package/dist/cjs/chunks/select-value.cjs +35 -0
  100. package/dist/cjs/chunks/select.cjs +40 -0
  101. package/dist/cjs/chunks/sheet-close.cjs +32 -0
  102. package/dist/cjs/chunks/sheet-content.cjs +65 -0
  103. package/dist/cjs/chunks/sheet-description.cjs +34 -0
  104. package/dist/cjs/chunks/sheet-footer.cjs +25 -0
  105. package/dist/cjs/chunks/sheet-header.cjs +25 -0
  106. package/dist/cjs/chunks/sheet-title.cjs +34 -0
  107. package/dist/cjs/chunks/sheet-trigger.cjs +27 -0
  108. package/dist/cjs/chunks/sheet.cjs +29 -0
  109. package/dist/cjs/chunks/sidebar-content.cjs +25 -0
  110. package/dist/cjs/chunks/sidebar-element.cjs +33 -0
  111. package/dist/cjs/chunks/sidebar-footer.cjs +25 -0
  112. package/dist/cjs/chunks/sidebar-group-content.cjs +28 -0
  113. package/dist/cjs/chunks/sidebar-group-label.cjs +38 -0
  114. package/dist/cjs/chunks/sidebar-group.cjs +25 -0
  115. package/dist/cjs/chunks/sidebar-header.cjs +25 -0
  116. package/dist/cjs/chunks/sidebar-menu-action.cjs +39 -0
  117. package/dist/cjs/chunks/sidebar-menu-badge.cjs +43 -0
  118. package/dist/cjs/chunks/sidebar-menu-button.cjs +44 -0
  119. package/dist/cjs/chunks/sidebar-menu-item.cjs +25 -0
  120. package/dist/cjs/chunks/sidebar-menu-sub-button.cjs +47 -0
  121. package/dist/cjs/chunks/sidebar-menu-sub-item.cjs +25 -0
  122. package/dist/cjs/chunks/sidebar-menu-sub.cjs +25 -0
  123. package/dist/cjs/chunks/sidebar-menu.cjs +25 -0
  124. package/dist/cjs/chunks/sidebar-provider.cjs +73 -0
  125. package/dist/cjs/chunks/sidebar-trigger.cjs +38 -0
  126. package/dist/cjs/chunks/sidebar.cjs +69 -0
  127. package/dist/cjs/chunks/slider.cjs +51 -0
  128. package/dist/cjs/chunks/social-button.cjs +42 -0
  129. package/dist/cjs/chunks/sonner-alert.cjs +42 -0
  130. package/dist/cjs/chunks/sonner.cjs +1222 -0
  131. package/dist/cjs/chunks/status-badge.cjs +50 -0
  132. package/dist/cjs/chunks/switch.cjs +40 -0
  133. package/dist/cjs/chunks/tab-menu-content.cjs +36 -0
  134. package/dist/cjs/chunks/tab-menu-item.cjs +44 -0
  135. package/dist/cjs/chunks/tab-menu-list.cjs +35 -0
  136. package/dist/cjs/chunks/tab-menu.cjs +36 -0
  137. package/dist/cjs/chunks/table-body.cjs +25 -0
  138. package/dist/cjs/chunks/table-caption.cjs +25 -0
  139. package/dist/cjs/chunks/table-cell.cjs +31 -0
  140. package/dist/cjs/chunks/table-footer.cjs +25 -0
  141. package/dist/cjs/chunks/table-head.cjs +31 -0
  142. package/dist/cjs/chunks/table-header.cjs +22 -0
  143. package/dist/cjs/chunks/table-row.cjs +34 -0
  144. package/dist/cjs/chunks/table.cjs +45 -0
  145. package/dist/cjs/chunks/table2.cjs +26 -0
  146. package/dist/cjs/chunks/tag.cjs +58 -0
  147. package/dist/cjs/chunks/text-input-affix.cjs +31 -0
  148. package/dist/cjs/chunks/text-input-button.cjs +39 -0
  149. package/dist/cjs/chunks/text-input.cjs +118 -0
  150. package/dist/cjs/chunks/textarea.cjs +61 -0
  151. package/dist/cjs/chunks/tooltip-content.cjs +108 -0
  152. package/dist/cjs/chunks/tooltip-provider.cjs +31 -0
  153. package/dist/cjs/chunks/tooltip-root.cjs +40 -0
  154. package/dist/cjs/chunks/tooltip-trigger.cjs +27 -0
  155. package/dist/cjs/chunks/tooltip.cjs +99 -0
  156. package/dist/cjs/chunks/use-color-model.cjs +943 -0
  157. package/dist/cjs/collapsible-content.cjs +2 -0
  158. package/dist/cjs/collapsible-trigger.cjs +2 -0
  159. package/dist/cjs/collapsible.cjs +2 -0
  160. package/dist/cjs/color-area.cjs +2 -0
  161. package/dist/cjs/color-picker.cjs +2 -0
  162. package/dist/cjs/color-swatch.cjs +2 -0
  163. package/dist/cjs/color.cjs +104 -0
  164. package/dist/cjs/combobox-anchor.cjs +2 -0
  165. package/dist/cjs/combobox-empty.cjs +2 -0
  166. package/dist/cjs/combobox-group.cjs +2 -0
  167. package/dist/cjs/combobox-input.cjs +2 -0
  168. package/dist/cjs/combobox-item.cjs +2 -0
  169. package/dist/cjs/combobox-list.cjs +2 -0
  170. package/dist/cjs/combobox-root.cjs +2 -0
  171. package/dist/cjs/combobox-separator.cjs +2 -0
  172. package/dist/cjs/combobox-trigger.cjs +2 -0
  173. package/dist/cjs/combobox.cjs +2 -0
  174. package/dist/cjs/command-group.cjs +37 -0
  175. package/dist/cjs/command-input.cjs +42 -0
  176. package/dist/cjs/command-item.cjs +31 -0
  177. package/dist/cjs/command-list.cjs +56 -0
  178. package/dist/cjs/command-root.cjs +51 -0
  179. package/dist/cjs/command-separator.cjs +31 -0
  180. package/dist/cjs/compact-button.cjs +2 -0
  181. package/dist/cjs/config.cjs +301 -0
  182. package/dist/cjs/content-divider.cjs +2 -0
  183. package/dist/cjs/counter-input.cjs +2 -0
  184. package/dist/cjs/crypto.cjs +7 -0
  185. package/dist/cjs/digit-input-group.cjs +2 -0
  186. package/dist/cjs/digit-input-slot.cjs +2 -0
  187. package/dist/cjs/digit-input.cjs +2 -0
  188. package/dist/cjs/dropdown-menu-content.cjs +2 -0
  189. package/dist/cjs/dropdown-menu-group.cjs +2 -0
  190. package/dist/cjs/dropdown-menu-item.cjs +2 -0
  191. package/dist/cjs/dropdown-menu-label.cjs +2 -0
  192. package/dist/cjs/dropdown-menu-separator.cjs +2 -0
  193. package/dist/cjs/dropdown-menu-sub-content.cjs +2 -0
  194. package/dist/cjs/dropdown-menu-sub-trigger.cjs +2 -0
  195. package/dist/cjs/dropdown-menu-sub.cjs +2 -0
  196. package/dist/cjs/dropdown-menu-trigger.cjs +2 -0
  197. package/dist/cjs/dropdown-menu.cjs +2 -0
  198. package/dist/cjs/extra-settings.cjs +2 -0
  199. package/dist/cjs/fancy-button.cjs +2 -0
  200. package/dist/cjs/file-upload-area.cjs +2 -0
  201. package/dist/cjs/hint-text.cjs +2 -0
  202. package/dist/cjs/hue-slider.cjs +2 -0
  203. package/dist/cjs/index.cjs +375 -0
  204. package/dist/cjs/label.cjs +2 -0
  205. package/dist/cjs/link-bubble.cjs +2 -0
  206. package/dist/cjs/link-button.cjs +2 -0
  207. package/dist/cjs/modal-body.cjs +2 -0
  208. package/dist/cjs/modal-close.cjs +2 -0
  209. package/dist/cjs/modal-content.cjs +2 -0
  210. package/dist/cjs/modal-footer.cjs +2 -0
  211. package/dist/cjs/modal-header.cjs +2 -0
  212. package/dist/cjs/modal-trigger.cjs +2 -0
  213. package/dist/cjs/modal.cjs +2 -0
  214. package/dist/cjs/pagination-content.cjs +2 -0
  215. package/dist/cjs/pagination-ellipsis.cjs +2 -0
  216. package/dist/cjs/pagination-first.cjs +2 -0
  217. package/dist/cjs/pagination-item.cjs +2 -0
  218. package/dist/cjs/pagination-last.cjs +2 -0
  219. package/dist/cjs/pagination-next.cjs +2 -0
  220. package/dist/cjs/pagination-previous.cjs +2 -0
  221. package/dist/cjs/pagination.cjs +2 -0
  222. package/dist/cjs/popover-content.cjs +2 -0
  223. package/dist/cjs/popover-trigger.cjs +2 -0
  224. package/dist/cjs/popover.cjs +2 -0
  225. package/dist/cjs/progress-bar.cjs +2 -0
  226. package/dist/cjs/progress-circle.cjs +2 -0
  227. package/dist/cjs/radio-group-card.cjs +2 -0
  228. package/dist/cjs/radio-group-item.cjs +2 -0
  229. package/dist/cjs/radio-group-label.cjs +2 -0
  230. package/dist/cjs/radio-group.cjs +2 -0
  231. package/dist/cjs/rich-editor.cjs +2 -0
  232. package/dist/cjs/scroll-area.cjs +2 -0
  233. package/dist/cjs/scroll-bar.cjs +2 -0
  234. package/dist/cjs/segmented-control-item.cjs +2 -0
  235. package/dist/cjs/segmented-control.cjs +2 -0
  236. package/dist/cjs/select-content.cjs +2 -0
  237. package/dist/cjs/select-group.cjs +2 -0
  238. package/dist/cjs/select-icon.cjs +2 -0
  239. package/dist/cjs/select-item.cjs +2 -0
  240. package/dist/cjs/select-label.cjs +2 -0
  241. package/dist/cjs/select-separator.cjs +2 -0
  242. package/dist/cjs/select-trigger.cjs +2 -0
  243. package/dist/cjs/select-value.cjs +2 -0
  244. package/dist/cjs/select.cjs +2 -0
  245. package/dist/cjs/sheet-close.cjs +2 -0
  246. package/dist/cjs/sheet-content.cjs +2 -0
  247. package/dist/cjs/sheet-description.cjs +2 -0
  248. package/dist/cjs/sheet-footer.cjs +2 -0
  249. package/dist/cjs/sheet-header.cjs +2 -0
  250. package/dist/cjs/sheet-title.cjs +2 -0
  251. package/dist/cjs/sheet-trigger.cjs +2 -0
  252. package/dist/cjs/sheet.cjs +2 -0
  253. package/dist/cjs/shims.cjs +0 -0
  254. package/dist/cjs/sidebar-content.cjs +2 -0
  255. package/dist/cjs/sidebar-element.cjs +2 -0
  256. package/dist/cjs/sidebar-footer.cjs +2 -0
  257. package/dist/cjs/sidebar-group-content.cjs +2 -0
  258. package/dist/cjs/sidebar-group-label.cjs +2 -0
  259. package/dist/cjs/sidebar-group.cjs +2 -0
  260. package/dist/cjs/sidebar-header.cjs +2 -0
  261. package/dist/cjs/sidebar-menu-action.cjs +2 -0
  262. package/dist/cjs/sidebar-menu-badge.cjs +2 -0
  263. package/dist/cjs/sidebar-menu-button.cjs +2 -0
  264. package/dist/cjs/sidebar-menu-item.cjs +2 -0
  265. package/dist/cjs/sidebar-menu-sub-button.cjs +2 -0
  266. package/dist/cjs/sidebar-menu-sub-item.cjs +2 -0
  267. package/dist/cjs/sidebar-menu-sub.cjs +2 -0
  268. package/dist/cjs/sidebar-menu.cjs +2 -0
  269. package/dist/cjs/sidebar-provider.cjs +2 -0
  270. package/dist/cjs/sidebar-separator.cjs +2 -0
  271. package/dist/cjs/sidebar-trigger.cjs +2 -0
  272. package/dist/cjs/sidebar.cjs +2 -0
  273. package/dist/cjs/slider.cjs +2 -0
  274. package/dist/cjs/social-button.cjs +2 -0
  275. package/dist/cjs/sonner-alert.cjs +2 -0
  276. package/dist/cjs/sonner.cjs +2 -0
  277. package/dist/cjs/status-badge.cjs +2 -0
  278. package/dist/cjs/switch.cjs +2 -0
  279. package/dist/cjs/tab-menu-content.cjs +2 -0
  280. package/dist/cjs/tab-menu-item.cjs +2 -0
  281. package/dist/cjs/tab-menu-list.cjs +2 -0
  282. package/dist/cjs/tab-menu.cjs +2 -0
  283. package/dist/cjs/table-body.cjs +2 -0
  284. package/dist/cjs/table-caption.cjs +2 -0
  285. package/dist/cjs/table-cell.cjs +2 -0
  286. package/dist/cjs/table-empty.cjs +2 -0
  287. package/dist/cjs/table-footer.cjs +2 -0
  288. package/dist/cjs/table-head.cjs +2 -0
  289. package/dist/cjs/table-header.cjs +2 -0
  290. package/dist/cjs/table-row.cjs +2 -0
  291. package/dist/cjs/table.cjs +2 -0
  292. package/dist/cjs/tag.cjs +2 -0
  293. package/dist/cjs/text-input-affix.cjs +2 -0
  294. package/dist/cjs/text-input-button.cjs +2 -0
  295. package/dist/cjs/text-input.cjs +2 -0
  296. package/dist/cjs/textarea.cjs +2 -0
  297. package/dist/cjs/tooltip-content.cjs +2 -0
  298. package/dist/cjs/tooltip-provider.cjs +2 -0
  299. package/dist/cjs/tooltip-root.cjs +2 -0
  300. package/dist/cjs/tooltip-trigger.cjs +2 -0
  301. package/dist/cjs/tooltip.cjs +2 -0
  302. package/dist/cjs/types.cjs +0 -0
  303. package/dist/cjs/use-color-model.cjs +4 -0
  304. package/dist/cjs/use-delegated-props.cjs +16 -0
  305. package/dist/cjs/{use-sidebar.js → use-sidebar.cjs} +10 -9
  306. package/dist/cjs/use-user-select.cjs +41 -0
  307. package/dist/components/alert/alert.d.ts +14 -9
  308. package/dist/components/badge/badge.d.ts +4 -3
  309. package/dist/components/badge/status-badge.d.ts +4 -3
  310. package/dist/components/button/button.d.ts +5 -4
  311. package/dist/components/button/compact-button.d.ts +3 -2
  312. package/dist/components/button/fancy-button.d.ts +5 -4
  313. package/dist/components/button/link-button.d.ts +5 -4
  314. package/dist/components/button/social-button.d.ts +3 -2
  315. package/dist/components/checkbox/checkbox-card.d.ts +23 -21
  316. package/dist/components/checkbox/checkbox-label.d.ts +17 -16
  317. package/dist/components/checkbox/checkbox.d.ts +2 -1
  318. package/dist/components/collapsible/collapsible-content.d.ts +5 -4
  319. package/dist/components/collapsible/collapsible-trigger.d.ts +5 -4
  320. package/dist/components/collapsible/collapsible.d.ts +6 -5
  321. package/dist/components/color-picker/alpha-slider.d.ts +4 -5
  322. package/dist/components/color-picker/color-area.d.ts +2 -3
  323. package/dist/components/color-picker/color-picker.d.ts +5 -4
  324. package/dist/components/color-picker/color-swatch.d.ts +4 -3
  325. package/dist/components/color-picker/hue-slider.d.ts +7 -8
  326. package/dist/components/combobox/combobox-anchor.d.ts +7 -11
  327. package/dist/components/combobox/combobox-empty.d.ts +7 -11
  328. package/dist/components/combobox/combobox-group.d.ts +7 -11
  329. package/dist/components/combobox/combobox-input.d.ts +5 -3
  330. package/dist/components/combobox/combobox-item.d.ts +7 -5
  331. package/dist/components/combobox/combobox-list.d.ts +7 -11
  332. package/dist/components/combobox/combobox-root.d.ts +7 -11
  333. package/dist/components/combobox/combobox-separator.d.ts +7 -11
  334. package/dist/components/combobox/combobox-trigger.d.ts +5 -4
  335. package/dist/components/combobox/combobox.d.ts +9 -7
  336. package/dist/components/content-divider/content-divider.d.ts +3 -2
  337. package/dist/components/counter-input/counter-input.d.ts +2 -1
  338. package/dist/components/digit-input/digit-input-group.d.ts +7 -11
  339. package/dist/components/digit-input/digit-input-slot.d.ts +2 -1
  340. package/dist/components/digit-input/digit-input.d.ts +7 -11
  341. package/dist/components/dropdown-menu/dropdown-menu-content.d.ts +7 -11
  342. package/dist/components/dropdown-menu/dropdown-menu-group.d.ts +7 -11
  343. package/dist/components/dropdown-menu/dropdown-menu-item.d.ts +11 -13
  344. package/dist/components/dropdown-menu/dropdown-menu-label.d.ts +7 -11
  345. package/dist/components/dropdown-menu/dropdown-menu-separator.d.ts +2 -1
  346. package/dist/components/dropdown-menu/dropdown-menu-sub-content.d.ts +7 -11
  347. package/dist/components/dropdown-menu/dropdown-menu-sub-trigger.d.ts +9 -12
  348. package/dist/components/dropdown-menu/dropdown-menu-sub.d.ts +7 -11
  349. package/dist/components/dropdown-menu/dropdown-menu-trigger.d.ts +7 -11
  350. package/dist/components/dropdown-menu/dropdown-menu.d.ts +7 -11
  351. package/dist/components/file-upload/file-upload-area.d.ts +8 -9
  352. package/dist/components/hint-text/hint-text.d.ts +4 -3
  353. package/dist/components/label/label.d.ts +11 -14
  354. package/dist/components/modal/modal-body.d.ts +7 -11
  355. package/dist/components/modal/modal-close.d.ts +7 -11
  356. package/dist/components/modal/modal-content.d.ts +7 -11
  357. package/dist/components/modal/modal-footer.d.ts +7 -11
  358. package/dist/components/modal/modal-header.d.ts +3 -2
  359. package/dist/components/modal/modal-trigger.d.ts +7 -11
  360. package/dist/components/modal/modal.d.ts +7 -11
  361. package/dist/components/pagination/pagination-content.d.ts +6 -5
  362. package/dist/components/pagination/pagination-ellipsis.d.ts +5 -4
  363. package/dist/components/pagination/pagination-first.d.ts +5 -4
  364. package/dist/components/pagination/pagination-item.d.ts +5 -4
  365. package/dist/components/pagination/pagination-last.d.ts +5 -4
  366. package/dist/components/pagination/pagination-next.d.ts +5 -4
  367. package/dist/components/pagination/pagination-previous.d.ts +5 -4
  368. package/dist/components/pagination/pagination.d.ts +12 -9
  369. package/dist/components/popover/popover-content.d.ts +7 -5
  370. package/dist/components/popover/popover-trigger.d.ts +7 -11
  371. package/dist/components/popover/popover.d.ts +7 -11
  372. package/dist/components/progress/progress-bar.d.ts +10 -13
  373. package/dist/components/progress/progress-circle.d.ts +7 -11
  374. package/dist/components/radio-group/radio-group-card.d.ts +23 -21
  375. package/dist/components/radio-group/radio-group-item.d.ts +2 -1
  376. package/dist/components/radio-group/radio-group-label.d.ts +17 -16
  377. package/dist/components/radio-group/radio-group.d.ts +7 -11
  378. package/dist/components/rich-editor/extra-settings.d.ts +2 -1
  379. package/dist/components/rich-editor/link-bubble.d.ts +3 -4
  380. package/dist/components/rich-editor/rich-editor.d.ts +2 -1
  381. package/dist/components/scroll-area/scroll-area.d.ts +7 -11
  382. package/dist/components/scroll-area/scroll-bar.d.ts +2 -1
  383. package/dist/components/segmented-control/segmented-control-item.d.ts +7 -11
  384. package/dist/components/segmented-control/segmented-control.d.ts +7 -11
  385. package/dist/components/select/select-content.d.ts +7 -11
  386. package/dist/components/select/select-group.d.ts +7 -11
  387. package/dist/components/select/select-icon.d.ts +7 -11
  388. package/dist/components/select/select-item.d.ts +7 -11
  389. package/dist/components/select/select-label.d.ts +7 -11
  390. package/dist/components/select/select-separator.d.ts +2 -1
  391. package/dist/components/select/select-trigger.d.ts +7 -11
  392. package/dist/components/select/select-value.d.ts +7 -11
  393. package/dist/components/select/select.d.ts +7 -11
  394. package/dist/components/sheet/sheet-close.d.ts +5 -4
  395. package/dist/components/sheet/sheet-content.d.ts +5 -4
  396. package/dist/components/sheet/sheet-description.d.ts +5 -4
  397. package/dist/components/sheet/sheet-footer.d.ts +5 -4
  398. package/dist/components/sheet/sheet-header.d.ts +5 -4
  399. package/dist/components/sheet/sheet-title.d.ts +5 -4
  400. package/dist/components/sheet/sheet-trigger.d.ts +5 -4
  401. package/dist/components/sheet/sheet.d.ts +7 -11
  402. package/dist/components/sidebar/sidebar-content.d.ts +7 -11
  403. package/dist/components/sidebar/sidebar-element.d.ts +5 -4
  404. package/dist/components/sidebar/sidebar-footer.d.ts +5 -4
  405. package/dist/components/sidebar/sidebar-group-content.d.ts +7 -11
  406. package/dist/components/sidebar/sidebar-group-label.d.ts +7 -11
  407. package/dist/components/sidebar/sidebar-group.d.ts +7 -11
  408. package/dist/components/sidebar/sidebar-header.d.ts +5 -4
  409. package/dist/components/sidebar/sidebar-menu-action.d.ts +5 -4
  410. package/dist/components/sidebar/sidebar-menu-badge.d.ts +4 -3
  411. package/dist/components/sidebar/sidebar-menu-button.d.ts +7 -11
  412. package/dist/components/sidebar/sidebar-menu-item.d.ts +7 -11
  413. package/dist/components/sidebar/sidebar-menu-sub-button.d.ts +5 -4
  414. package/dist/components/sidebar/sidebar-menu-sub-item.d.ts +7 -11
  415. package/dist/components/sidebar/sidebar-menu-sub.d.ts +7 -11
  416. package/dist/components/sidebar/sidebar-menu.d.ts +7 -11
  417. package/dist/components/sidebar/sidebar-provider.d.ts +8 -12
  418. package/dist/components/sidebar/sidebar-separator.d.ts +2 -1
  419. package/dist/components/sidebar/sidebar-trigger.d.ts +2 -1
  420. package/dist/components/sidebar/sidebar.d.ts +7 -5
  421. package/dist/components/slider/slider.d.ts +2 -1
  422. package/dist/components/sonner/sonner-alert.d.ts +3 -2
  423. package/dist/components/sonner/sonner.d.ts +2 -1
  424. package/dist/components/switch/switch.d.ts +2 -1
  425. package/dist/components/tab-menu/tab-menu-content.d.ts +7 -11
  426. package/dist/components/tab-menu/tab-menu-item.d.ts +11 -13
  427. package/dist/components/tab-menu/tab-menu-list.d.ts +7 -11
  428. package/dist/components/tab-menu/tab-menu.d.ts +7 -11
  429. package/dist/components/table/table-body.d.ts +5 -4
  430. package/dist/components/table/table-caption.d.ts +5 -4
  431. package/dist/components/table/table-cell.d.ts +6 -5
  432. package/dist/components/table/table-empty.d.ts +5 -4
  433. package/dist/components/table/table-footer.d.ts +5 -4
  434. package/dist/components/table/table-head.d.ts +6 -5
  435. package/dist/components/table/table-header.d.ts +5 -4
  436. package/dist/components/table/table-row.d.ts +5 -4
  437. package/dist/components/table/table.d.ts +5 -4
  438. package/dist/components/tag/tag.d.ts +5 -4
  439. package/dist/components/text-input/text-input-affix.d.ts +7 -11
  440. package/dist/components/text-input/text-input-button.d.ts +7 -11
  441. package/dist/components/text-input/text-input.d.ts +21 -15
  442. package/dist/components/textarea/textarea.d.ts +9 -8
  443. package/dist/components/tooltip/tooltip-content.d.ts +5 -4
  444. package/dist/components/tooltip/tooltip-provider.d.ts +5 -4
  445. package/dist/components/tooltip/tooltip-root.d.ts +5 -4
  446. package/dist/components/tooltip/tooltip-trigger.d.ts +5 -4
  447. package/dist/components/tooltip/tooltip.d.ts +5 -4
  448. package/dist/es/alert.js +2 -113
  449. package/dist/es/alpha-slider.js +2 -4
  450. package/dist/es/badge.js +2 -60
  451. package/dist/es/button.js +2 -41
  452. package/dist/es/checkbox-card.js +2 -112
  453. package/dist/es/checkbox-label.js +2 -111
  454. package/dist/es/checkbox.js +2 -5
  455. package/dist/es/chunks/_plugin-vue_export-helper.js +7 -9
  456. package/dist/es/chunks/alert.js +96 -0
  457. package/dist/es/chunks/alpha-slider.js +102 -117
  458. package/dist/es/chunks/badge.js +52 -0
  459. package/dist/es/chunks/button.js +36 -0
  460. package/dist/es/chunks/checkbox-card.js +94 -0
  461. package/dist/es/chunks/checkbox-label.js +88 -0
  462. package/dist/es/chunks/checkbox.js +33 -37
  463. package/dist/es/chunks/clsx.js +12 -12
  464. package/dist/es/chunks/collapsible-content.js +24 -27
  465. package/dist/es/chunks/collapsible-trigger.js +21 -22
  466. package/dist/es/chunks/collapsible.js +25 -28
  467. package/dist/es/chunks/color-area.js +166 -0
  468. package/dist/es/chunks/color-picker.js +452 -0
  469. package/dist/es/chunks/color-swatch.js +58 -0
  470. package/dist/es/chunks/combobox-anchor.js +27 -31
  471. package/dist/es/chunks/combobox-empty.js +29 -0
  472. package/dist/es/chunks/combobox-group.js +36 -0
  473. package/dist/es/chunks/combobox-input.js +65 -0
  474. package/dist/es/chunks/combobox-item.js +89 -0
  475. package/dist/es/chunks/combobox-list.js +59 -0
  476. package/dist/es/chunks/combobox-root.js +43 -0
  477. package/dist/es/chunks/combobox-separator.js +29 -0
  478. package/dist/es/chunks/combobox-trigger.js +38 -0
  479. package/dist/es/chunks/combobox.js +193 -0
  480. package/dist/es/chunks/compact-button.js +37 -0
  481. package/dist/es/chunks/components.js +299 -0
  482. package/dist/es/chunks/content-divider.js +55 -0
  483. package/dist/es/chunks/core.js +289 -0
  484. package/dist/es/chunks/counter-input.js +68 -69
  485. package/dist/es/chunks/digit-input-group.js +27 -0
  486. package/dist/es/chunks/digit-input-slot.js +26 -0
  487. package/dist/es/chunks/digit-input.js +47 -0
  488. package/dist/es/chunks/dist.js +11525 -0
  489. package/dist/es/chunks/dist2.js +15302 -0
  490. package/dist/es/chunks/dropdown-menu-content.js +55 -0
  491. package/dist/es/chunks/dropdown-menu-group.js +23 -0
  492. package/dist/es/chunks/dropdown-menu-item.js +43 -0
  493. package/dist/es/chunks/dropdown-menu-label.js +27 -0
  494. package/dist/es/chunks/dropdown-menu-separator.js +24 -0
  495. package/dist/es/chunks/dropdown-menu-sub-content.js +52 -0
  496. package/dist/es/chunks/dropdown-menu-sub-trigger.js +39 -0
  497. package/dist/es/chunks/dropdown-menu-sub.js +22 -25
  498. package/dist/es/chunks/dropdown-menu-trigger.js +24 -0
  499. package/dist/es/chunks/dropdown-menu.js +31 -0
  500. package/dist/es/chunks/extra-settings.js +127 -0
  501. package/dist/es/chunks/fancy-button.js +35 -0
  502. package/dist/es/chunks/file-upload-area.js +132 -0
  503. package/dist/es/chunks/hint-text.js +31 -0
  504. package/dist/es/chunks/hue-slider.js +113 -0
  505. package/dist/es/chunks/label.js +58 -0
  506. package/dist/es/chunks/link-bubble.js +191 -0
  507. package/dist/es/chunks/link-button.js +41 -0
  508. package/dist/es/chunks/menus.js +1173 -0
  509. package/dist/es/chunks/modal-body.js +17 -0
  510. package/dist/es/chunks/modal-close.js +21 -22
  511. package/dist/es/chunks/modal-content.js +46 -0
  512. package/dist/es/chunks/modal-footer.js +17 -0
  513. package/dist/es/chunks/modal-header.js +77 -0
  514. package/dist/es/chunks/modal-trigger.js +21 -22
  515. package/dist/es/chunks/modal.js +23 -26
  516. package/dist/es/chunks/pagination-content.js +27 -0
  517. package/dist/es/chunks/pagination-ellipsis.js +30 -0
  518. package/dist/es/chunks/pagination-first.js +28 -32
  519. package/dist/es/chunks/pagination-item.js +31 -32
  520. package/dist/es/chunks/pagination-last.js +28 -32
  521. package/dist/es/chunks/pagination-next.js +28 -32
  522. package/dist/es/chunks/pagination-previous.js +28 -32
  523. package/dist/es/chunks/pagination.js +54 -0
  524. package/dist/es/chunks/popover-content.js +107 -0
  525. package/dist/es/chunks/popover-trigger.js +23 -0
  526. package/dist/es/chunks/popover.js +23 -26
  527. package/dist/es/chunks/progress-bar.js +67 -0
  528. package/dist/es/chunks/progress-circle.js +89 -0
  529. package/dist/es/chunks/radio-group-card.js +94 -0
  530. package/dist/es/chunks/radio-group-item.js +29 -33
  531. package/dist/es/chunks/radio-group-label.js +88 -0
  532. package/dist/es/chunks/radio-group.js +34 -38
  533. package/dist/es/chunks/rich-editor.js +5180 -0
  534. package/dist/es/chunks/scroll-area.js +39 -0
  535. package/dist/es/chunks/scroll-bar.js +30 -0
  536. package/dist/es/chunks/segmented-control-item.js +36 -0
  537. package/dist/es/chunks/segmented-control.js +36 -0
  538. package/dist/es/chunks/select-content.js +59 -0
  539. package/dist/es/chunks/select-group.js +21 -22
  540. package/dist/es/chunks/select-icon.js +19 -0
  541. package/dist/es/chunks/select-item.js +36 -0
  542. package/dist/es/chunks/select-label.js +28 -0
  543. package/dist/es/chunks/select-separator.js +24 -0
  544. package/dist/es/chunks/select-trigger.js +34 -0
  545. package/dist/es/chunks/select-value.js +28 -0
  546. package/dist/es/chunks/select.js +33 -37
  547. package/dist/es/chunks/sheet-close.js +25 -0
  548. package/dist/es/chunks/sheet-content.js +58 -0
  549. package/dist/es/chunks/sheet-description.js +27 -0
  550. package/dist/es/chunks/sheet-footer.js +17 -0
  551. package/dist/es/chunks/sheet-header.js +17 -0
  552. package/dist/es/chunks/sheet-title.js +27 -0
  553. package/dist/es/chunks/sheet-trigger.js +21 -22
  554. package/dist/es/chunks/sheet.js +23 -26
  555. package/dist/es/chunks/sidebar-content.js +18 -21
  556. package/dist/es/chunks/sidebar-element.js +27 -28
  557. package/dist/es/chunks/sidebar-footer.js +18 -21
  558. package/dist/es/chunks/sidebar-group-content.js +20 -0
  559. package/dist/es/chunks/sidebar-group-label.js +32 -29
  560. package/dist/es/chunks/sidebar-group.js +18 -21
  561. package/dist/es/chunks/sidebar-header.js +18 -21
  562. package/dist/es/chunks/sidebar-menu-action.js +33 -34
  563. package/dist/es/chunks/sidebar-menu-badge.js +36 -29
  564. package/dist/es/chunks/sidebar-menu-button.js +38 -39
  565. package/dist/es/chunks/sidebar-menu-item.js +18 -21
  566. package/dist/es/chunks/sidebar-menu-sub-button.js +41 -37
  567. package/dist/es/chunks/sidebar-menu-sub-item.js +18 -21
  568. package/dist/es/chunks/sidebar-menu-sub.js +18 -21
  569. package/dist/es/chunks/sidebar-menu.js +18 -21
  570. package/dist/es/chunks/sidebar-provider.js +67 -0
  571. package/dist/es/chunks/sidebar-trigger.js +30 -0
  572. package/dist/es/chunks/sidebar.js +61 -83
  573. package/dist/es/chunks/slider.js +44 -51
  574. package/dist/es/chunks/social-button.js +36 -0
  575. package/dist/es/chunks/sonner-alert.js +34 -0
  576. package/dist/es/chunks/sonner.js +1163 -1176
  577. package/dist/es/chunks/status-badge.js +43 -0
  578. package/dist/es/chunks/switch.js +33 -37
  579. package/dist/es/chunks/tab-menu-content.js +29 -0
  580. package/dist/es/chunks/tab-menu-item.js +38 -0
  581. package/dist/es/chunks/tab-menu-list.js +28 -0
  582. package/dist/es/chunks/tab-menu.js +29 -0
  583. package/dist/es/chunks/table-body.js +17 -0
  584. package/dist/es/chunks/table-caption.js +17 -0
  585. package/dist/es/chunks/table-cell.js +23 -0
  586. package/dist/es/chunks/table-footer.js +17 -0
  587. package/dist/es/chunks/table-head.js +23 -0
  588. package/dist/es/chunks/table-header.js +15 -20
  589. package/dist/es/chunks/table-row.js +26 -0
  590. package/dist/es/chunks/table.js +38 -0
  591. package/dist/es/chunks/table2.js +19 -0
  592. package/dist/es/chunks/tag.js +52 -0
  593. package/dist/es/chunks/text-input-affix.js +23 -0
  594. package/dist/es/chunks/text-input-button.js +31 -0
  595. package/dist/es/chunks/text-input.js +112 -0
  596. package/dist/es/chunks/textarea.js +54 -0
  597. package/dist/es/chunks/tooltip-content.js +102 -0
  598. package/dist/es/chunks/tooltip-provider.js +25 -26
  599. package/dist/es/chunks/tooltip-root.js +33 -35
  600. package/dist/es/chunks/tooltip-trigger.js +21 -23
  601. package/dist/es/chunks/tooltip.js +92 -83
  602. package/dist/es/chunks/use-color-model.js +925 -0
  603. package/dist/es/collapsible-content.js +2 -5
  604. package/dist/es/collapsible-trigger.js +2 -4
  605. package/dist/es/collapsible.js +2 -4
  606. package/dist/es/color-area.js +2 -177
  607. package/dist/es/color-picker.js +2 -519
  608. package/dist/es/color-swatch.js +2 -62
  609. package/dist/es/color.js +73 -83
  610. package/dist/es/combobox-anchor.js +2 -4
  611. package/dist/es/combobox-empty.js +2 -34
  612. package/dist/es/combobox-group.js +2 -44
  613. package/dist/es/combobox-input.js +2 -66
  614. package/dist/es/combobox-item.js +2 -112
  615. package/dist/es/combobox-list.js +2 -64
  616. package/dist/es/combobox-root.js +2 -43
  617. package/dist/es/combobox-separator.js +2 -34
  618. package/dist/es/combobox-trigger.js +2 -49
  619. package/dist/es/combobox.js +2 -241
  620. package/dist/es/command-group.js +35 -42
  621. package/dist/es/command-input.js +40 -42
  622. package/dist/es/command-item.js +30 -34
  623. package/dist/es/command-list.js +55 -52
  624. package/dist/es/command-root.js +50 -46
  625. package/dist/es/command-separator.js +29 -33
  626. package/dist/es/compact-button.js +2 -44
  627. package/dist/es/config.js +292 -130
  628. package/dist/es/content-divider.js +2 -4
  629. package/dist/es/counter-input.js +2 -5
  630. package/dist/es/crypto.js +4 -6
  631. package/dist/es/digit-input-group.js +2 -33
  632. package/dist/es/digit-input-slot.js +2 -30
  633. package/dist/es/digit-input.js +2 -48
  634. package/dist/es/dropdown-menu-content.js +2 -55
  635. package/dist/es/dropdown-menu-group.js +2 -26
  636. package/dist/es/dropdown-menu-item.js +2 -55
  637. package/dist/es/dropdown-menu-label.js +2 -33
  638. package/dist/es/dropdown-menu-separator.js +2 -27
  639. package/dist/es/dropdown-menu-sub-content.js +2 -52
  640. package/dist/es/dropdown-menu-sub-trigger.js +2 -46
  641. package/dist/es/dropdown-menu-sub.js +2 -4
  642. package/dist/es/dropdown-menu-trigger.js +2 -28
  643. package/dist/es/dropdown-menu.js +2 -37
  644. package/dist/es/extra-settings.js +2 -157
  645. package/dist/es/fancy-button.js +2 -39
  646. package/dist/es/file-upload-area.js +2 -147
  647. package/dist/es/hint-text.js +2 -38
  648. package/dist/es/hue-slider.js +2 -135
  649. package/dist/es/index.js +206 -520
  650. package/dist/es/label.js +2 -60
  651. package/dist/es/link-bubble.js +2 -243
  652. package/dist/es/link-button.js +2 -45
  653. package/dist/es/modal-body.js +2 -24
  654. package/dist/es/modal-close.js +2 -4
  655. package/dist/es/modal-content.js +2 -50
  656. package/dist/es/modal-footer.js +2 -24
  657. package/dist/es/modal-header.js +2 -83
  658. package/dist/es/modal-trigger.js +2 -4
  659. package/dist/es/modal.js +2 -4
  660. package/dist/es/pagination-content.js +2 -32
  661. package/dist/es/pagination-ellipsis.js +2 -36
  662. package/dist/es/pagination-first.js +2 -4
  663. package/dist/es/pagination-item.js +2 -4
  664. package/dist/es/pagination-last.js +2 -4
  665. package/dist/es/pagination-next.js +2 -4
  666. package/dist/es/pagination-previous.js +2 -4
  667. package/dist/es/pagination.js +2 -61
  668. package/dist/es/popover-content.js +2 -107
  669. package/dist/es/popover-trigger.js +2 -26
  670. package/dist/es/popover.js +2 -4
  671. package/dist/es/progress-bar.js +2 -86
  672. package/dist/es/progress-circle.js +2 -94
  673. package/dist/es/radio-group-card.js +2 -112
  674. package/dist/es/radio-group-item.js +2 -5
  675. package/dist/es/radio-group-label.js +2 -111
  676. package/dist/es/radio-group.js +2 -5
  677. package/dist/es/rich-editor.js +2 -431
  678. package/dist/es/scroll-area.js +2 -44
  679. package/dist/es/scroll-bar.js +2 -34
  680. package/dist/es/segmented-control-item.js +2 -41
  681. package/dist/es/segmented-control.js +2 -42
  682. package/dist/es/select-content.js +2 -63
  683. package/dist/es/select-group.js +2 -4
  684. package/dist/es/select-icon.js +2 -26
  685. package/dist/es/select-item.js +2 -46
  686. package/dist/es/select-label.js +2 -33
  687. package/dist/es/select-separator.js +2 -27
  688. package/dist/es/select-trigger.js +2 -42
  689. package/dist/es/select-value.js +2 -33
  690. package/dist/es/select.js +2 -4
  691. package/dist/es/sheet-close.js +2 -30
  692. package/dist/es/sheet-content.js +2 -62
  693. package/dist/es/sheet-description.js +2 -32
  694. package/dist/es/sheet-footer.js +2 -29
  695. package/dist/es/sheet-header.js +2 -24
  696. package/dist/es/sheet-title.js +2 -32
  697. package/dist/es/sheet-trigger.js +2 -4
  698. package/dist/es/sheet.js +2 -4
  699. package/dist/es/shims.js +0 -1
  700. package/dist/es/sidebar-content.js +2 -5
  701. package/dist/es/sidebar-element.js +2 -5
  702. package/dist/es/sidebar-footer.js +2 -5
  703. package/dist/es/sidebar-group-content.js +2 -25
  704. package/dist/es/sidebar-group-label.js +2 -5
  705. package/dist/es/sidebar-group.js +2 -5
  706. package/dist/es/sidebar-header.js +2 -5
  707. package/dist/es/sidebar-menu-action.js +2 -5
  708. package/dist/es/sidebar-menu-badge.js +2 -5
  709. package/dist/es/sidebar-menu-button.js +2 -5
  710. package/dist/es/sidebar-menu-item.js +2 -5
  711. package/dist/es/sidebar-menu-sub-button.js +2 -5
  712. package/dist/es/sidebar-menu-sub-item.js +2 -5
  713. package/dist/es/sidebar-menu-sub.js +2 -5
  714. package/dist/es/sidebar-menu.js +2 -5
  715. package/dist/es/sidebar-provider.js +2 -4
  716. package/dist/es/sidebar-separator.js +2 -4
  717. package/dist/es/sidebar-trigger.js +2 -35
  718. package/dist/es/sidebar.js +2 -5
  719. package/dist/es/slider.js +2 -5
  720. package/dist/es/social-button.js +2 -46
  721. package/dist/es/sonner-alert.js +2 -43
  722. package/dist/es/sonner.js +2 -4
  723. package/dist/es/status-badge.js +2 -51
  724. package/dist/es/switch.js +2 -5
  725. package/dist/es/tab-menu-content.js +2 -34
  726. package/dist/es/tab-menu-item.js +2 -46
  727. package/dist/es/tab-menu-list.js +2 -36
  728. package/dist/es/tab-menu.js +2 -34
  729. package/dist/es/table-body.js +2 -24
  730. package/dist/es/table-caption.js +2 -24
  731. package/dist/es/table-cell.js +2 -27
  732. package/dist/es/table-empty.js +2 -45
  733. package/dist/es/table-footer.js +2 -24
  734. package/dist/es/table-head.js +2 -25
  735. package/dist/es/table-header.js +2 -4
  736. package/dist/es/table-row.js +2 -33
  737. package/dist/es/table.js +2 -27
  738. package/dist/es/tag.js +2 -48
  739. package/dist/es/text-input-affix.js +2 -28
  740. package/dist/es/text-input-button.js +2 -33
  741. package/dist/es/text-input.js +2 -121
  742. package/dist/es/textarea.js +2 -58
  743. package/dist/es/tooltip-content.js +2 -95
  744. package/dist/es/tooltip-provider.js +2 -4
  745. package/dist/es/tooltip-root.js +2 -4
  746. package/dist/es/tooltip-trigger.js +2 -4
  747. package/dist/es/tooltip.js +2 -4
  748. package/dist/es/types.js +0 -1
  749. package/dist/es/use-color-model.js +2 -33
  750. package/dist/es/use-delegated-props.js +11 -11
  751. package/dist/es/use-sidebar.js +11 -18
  752. package/dist/es/use-user-select.js +37 -37
  753. package/package.json +10 -10
  754. package/dist/cjs/alert.js +0 -112
  755. package/dist/cjs/alpha-slider.js +0 -3
  756. package/dist/cjs/badge.js +0 -59
  757. package/dist/cjs/button.js +0 -40
  758. package/dist/cjs/checkbox-card.js +0 -111
  759. package/dist/cjs/checkbox-label.js +0 -110
  760. package/dist/cjs/checkbox.js +0 -4
  761. package/dist/cjs/chunks/_plugin-vue_export-helper.js +0 -9
  762. package/dist/cjs/chunks/alpha-slider.js +0 -127
  763. package/dist/cjs/chunks/checkbox.js +0 -38
  764. package/dist/cjs/chunks/clsx.js +0 -15
  765. package/dist/cjs/chunks/collapsible-content.js +0 -27
  766. package/dist/cjs/chunks/collapsible-trigger.js +0 -22
  767. package/dist/cjs/chunks/collapsible.js +0 -28
  768. package/dist/cjs/chunks/combobox-anchor.js +0 -31
  769. package/dist/cjs/chunks/content-divider.vue_vue_type_style_index_0_lang.js +0 -52
  770. package/dist/cjs/chunks/counter-input.js +0 -70
  771. package/dist/cjs/chunks/dropdown-menu-sub.js +0 -25
  772. package/dist/cjs/chunks/index.js +0 -10879
  773. package/dist/cjs/chunks/index2.js +0 -90
  774. package/dist/cjs/chunks/index3.js +0 -272
  775. package/dist/cjs/chunks/index4.js +0 -1486
  776. package/dist/cjs/chunks/index5.js +0 -17162
  777. package/dist/cjs/chunks/modal-close.js +0 -22
  778. package/dist/cjs/chunks/modal-trigger.js +0 -22
  779. package/dist/cjs/chunks/modal.js +0 -26
  780. package/dist/cjs/chunks/pagination-first.js +0 -32
  781. package/dist/cjs/chunks/pagination-item.js +0 -32
  782. package/dist/cjs/chunks/pagination-last.js +0 -32
  783. package/dist/cjs/chunks/pagination-next.js +0 -32
  784. package/dist/cjs/chunks/pagination-previous.js +0 -32
  785. package/dist/cjs/chunks/popover.js +0 -26
  786. package/dist/cjs/chunks/radio-group-item.js +0 -34
  787. package/dist/cjs/chunks/radio-group.js +0 -39
  788. package/dist/cjs/chunks/rich-editor.vue_vue_type_style_index_0_scoped_4e1c9896_lang.js +0 -5272
  789. package/dist/cjs/chunks/select-group.js +0 -22
  790. package/dist/cjs/chunks/select.js +0 -38
  791. package/dist/cjs/chunks/sheet-trigger.js +0 -22
  792. package/dist/cjs/chunks/sheet.js +0 -26
  793. package/dist/cjs/chunks/sidebar-content.js +0 -21
  794. package/dist/cjs/chunks/sidebar-element.js +0 -28
  795. package/dist/cjs/chunks/sidebar-footer.js +0 -21
  796. package/dist/cjs/chunks/sidebar-group-label.js +0 -29
  797. package/dist/cjs/chunks/sidebar-group.js +0 -21
  798. package/dist/cjs/chunks/sidebar-header.js +0 -21
  799. package/dist/cjs/chunks/sidebar-menu-action.js +0 -34
  800. package/dist/cjs/chunks/sidebar-menu-badge.js +0 -29
  801. package/dist/cjs/chunks/sidebar-menu-button.js +0 -39
  802. package/dist/cjs/chunks/sidebar-menu-item.js +0 -21
  803. package/dist/cjs/chunks/sidebar-menu-sub-button.js +0 -37
  804. package/dist/cjs/chunks/sidebar-menu-sub-item.js +0 -21
  805. package/dist/cjs/chunks/sidebar-menu-sub.js +0 -21
  806. package/dist/cjs/chunks/sidebar-menu.js +0 -21
  807. package/dist/cjs/chunks/sidebar-provider.vue_vue_type_style_index_0_lang.js +0 -63
  808. package/dist/cjs/chunks/sidebar-separator.vue_vue_type_style_index_0_lang.js +0 -137
  809. package/dist/cjs/chunks/sidebar.js +0 -84
  810. package/dist/cjs/chunks/slider.js +0 -52
  811. package/dist/cjs/chunks/sonner.js +0 -1222
  812. package/dist/cjs/chunks/switch.js +0 -38
  813. package/dist/cjs/chunks/table-header.js +0 -20
  814. package/dist/cjs/chunks/tinycolor.js +0 -965
  815. package/dist/cjs/chunks/tooltip-provider.js +0 -26
  816. package/dist/cjs/chunks/tooltip-root.js +0 -36
  817. package/dist/cjs/chunks/tooltip-trigger.js +0 -23
  818. package/dist/cjs/chunks/tooltip.js +0 -84
  819. package/dist/cjs/collapsible-content.js +0 -4
  820. package/dist/cjs/collapsible-trigger.js +0 -3
  821. package/dist/cjs/collapsible.js +0 -3
  822. package/dist/cjs/color-area.js +0 -176
  823. package/dist/cjs/color-picker.js +0 -518
  824. package/dist/cjs/color-swatch.js +0 -61
  825. package/dist/cjs/color.js +0 -102
  826. package/dist/cjs/combobox-anchor.js +0 -3
  827. package/dist/cjs/combobox-empty.js +0 -33
  828. package/dist/cjs/combobox-group.js +0 -43
  829. package/dist/cjs/combobox-input.js +0 -65
  830. package/dist/cjs/combobox-item.js +0 -111
  831. package/dist/cjs/combobox-list.js +0 -63
  832. package/dist/cjs/combobox-root.js +0 -42
  833. package/dist/cjs/combobox-separator.js +0 -33
  834. package/dist/cjs/combobox-trigger.js +0 -48
  835. package/dist/cjs/combobox.js +0 -240
  836. package/dist/cjs/command-group.js +0 -41
  837. package/dist/cjs/command-input.js +0 -42
  838. package/dist/cjs/command-item.js +0 -34
  839. package/dist/cjs/command-list.js +0 -52
  840. package/dist/cjs/command-root.js +0 -46
  841. package/dist/cjs/command-separator.js +0 -32
  842. package/dist/cjs/compact-button.js +0 -43
  843. package/dist/cjs/config.js +0 -136
  844. package/dist/cjs/content-divider.js +0 -3
  845. package/dist/cjs/counter-input.js +0 -4
  846. package/dist/cjs/crypto.js +0 -8
  847. package/dist/cjs/digit-input-group.js +0 -32
  848. package/dist/cjs/digit-input-slot.js +0 -29
  849. package/dist/cjs/digit-input.js +0 -47
  850. package/dist/cjs/dropdown-menu-content.js +0 -54
  851. package/dist/cjs/dropdown-menu-group.js +0 -25
  852. package/dist/cjs/dropdown-menu-item.js +0 -54
  853. package/dist/cjs/dropdown-menu-label.js +0 -32
  854. package/dist/cjs/dropdown-menu-separator.js +0 -26
  855. package/dist/cjs/dropdown-menu-sub-content.js +0 -51
  856. package/dist/cjs/dropdown-menu-sub-trigger.js +0 -45
  857. package/dist/cjs/dropdown-menu-sub.js +0 -3
  858. package/dist/cjs/dropdown-menu-trigger.js +0 -27
  859. package/dist/cjs/dropdown-menu.js +0 -36
  860. package/dist/cjs/extra-settings.js +0 -156
  861. package/dist/cjs/fancy-button.js +0 -38
  862. package/dist/cjs/file-upload-area.js +0 -146
  863. package/dist/cjs/hint-text.js +0 -37
  864. package/dist/cjs/hue-slider.js +0 -134
  865. package/dist/cjs/index.js +0 -526
  866. package/dist/cjs/label.js +0 -59
  867. package/dist/cjs/link-bubble.js +0 -242
  868. package/dist/cjs/link-button.js +0 -44
  869. package/dist/cjs/modal-body.js +0 -23
  870. package/dist/cjs/modal-close.js +0 -3
  871. package/dist/cjs/modal-content.js +0 -49
  872. package/dist/cjs/modal-footer.js +0 -23
  873. package/dist/cjs/modal-header.js +0 -82
  874. package/dist/cjs/modal-trigger.js +0 -3
  875. package/dist/cjs/modal.js +0 -3
  876. package/dist/cjs/pagination-content.js +0 -31
  877. package/dist/cjs/pagination-ellipsis.js +0 -35
  878. package/dist/cjs/pagination-first.js +0 -3
  879. package/dist/cjs/pagination-item.js +0 -3
  880. package/dist/cjs/pagination-last.js +0 -3
  881. package/dist/cjs/pagination-next.js +0 -3
  882. package/dist/cjs/pagination-previous.js +0 -3
  883. package/dist/cjs/pagination.js +0 -60
  884. package/dist/cjs/popover-content.js +0 -106
  885. package/dist/cjs/popover-trigger.js +0 -25
  886. package/dist/cjs/popover.js +0 -3
  887. package/dist/cjs/progress-bar.js +0 -85
  888. package/dist/cjs/progress-circle.js +0 -93
  889. package/dist/cjs/radio-group-card.js +0 -111
  890. package/dist/cjs/radio-group-item.js +0 -4
  891. package/dist/cjs/radio-group-label.js +0 -110
  892. package/dist/cjs/radio-group.js +0 -4
  893. package/dist/cjs/rich-editor.js +0 -430
  894. package/dist/cjs/scroll-area.js +0 -43
  895. package/dist/cjs/scroll-bar.js +0 -33
  896. package/dist/cjs/segmented-control-item.js +0 -40
  897. package/dist/cjs/segmented-control.js +0 -41
  898. package/dist/cjs/select-content.js +0 -62
  899. package/dist/cjs/select-group.js +0 -3
  900. package/dist/cjs/select-icon.js +0 -25
  901. package/dist/cjs/select-item.js +0 -45
  902. package/dist/cjs/select-label.js +0 -32
  903. package/dist/cjs/select-separator.js +0 -26
  904. package/dist/cjs/select-trigger.js +0 -41
  905. package/dist/cjs/select-value.js +0 -32
  906. package/dist/cjs/select.js +0 -3
  907. package/dist/cjs/sheet-close.js +0 -29
  908. package/dist/cjs/sheet-content.js +0 -61
  909. package/dist/cjs/sheet-description.js +0 -31
  910. package/dist/cjs/sheet-footer.js +0 -28
  911. package/dist/cjs/sheet-header.js +0 -23
  912. package/dist/cjs/sheet-title.js +0 -31
  913. package/dist/cjs/sheet-trigger.js +0 -3
  914. package/dist/cjs/sheet.js +0 -3
  915. package/dist/cjs/shims.js +0 -1
  916. package/dist/cjs/sidebar-content.js +0 -4
  917. package/dist/cjs/sidebar-element.js +0 -4
  918. package/dist/cjs/sidebar-footer.js +0 -4
  919. package/dist/cjs/sidebar-group-content.js +0 -24
  920. package/dist/cjs/sidebar-group-label.js +0 -4
  921. package/dist/cjs/sidebar-group.js +0 -4
  922. package/dist/cjs/sidebar-header.js +0 -4
  923. package/dist/cjs/sidebar-menu-action.js +0 -4
  924. package/dist/cjs/sidebar-menu-badge.js +0 -4
  925. package/dist/cjs/sidebar-menu-button.js +0 -4
  926. package/dist/cjs/sidebar-menu-item.js +0 -4
  927. package/dist/cjs/sidebar-menu-sub-button.js +0 -4
  928. package/dist/cjs/sidebar-menu-sub-item.js +0 -4
  929. package/dist/cjs/sidebar-menu-sub.js +0 -4
  930. package/dist/cjs/sidebar-menu.js +0 -4
  931. package/dist/cjs/sidebar-provider.js +0 -3
  932. package/dist/cjs/sidebar-separator.js +0 -3
  933. package/dist/cjs/sidebar-trigger.js +0 -34
  934. package/dist/cjs/sidebar.js +0 -4
  935. package/dist/cjs/slider.js +0 -4
  936. package/dist/cjs/social-button.js +0 -45
  937. package/dist/cjs/sonner-alert.js +0 -42
  938. package/dist/cjs/sonner.js +0 -3
  939. package/dist/cjs/status-badge.js +0 -50
  940. package/dist/cjs/switch.js +0 -4
  941. package/dist/cjs/tab-menu-content.js +0 -33
  942. package/dist/cjs/tab-menu-item.js +0 -45
  943. package/dist/cjs/tab-menu-list.js +0 -35
  944. package/dist/cjs/tab-menu.js +0 -33
  945. package/dist/cjs/table-body.js +0 -23
  946. package/dist/cjs/table-caption.js +0 -23
  947. package/dist/cjs/table-cell.js +0 -26
  948. package/dist/cjs/table-empty.js +0 -44
  949. package/dist/cjs/table-footer.js +0 -23
  950. package/dist/cjs/table-head.js +0 -24
  951. package/dist/cjs/table-header.js +0 -3
  952. package/dist/cjs/table-row.js +0 -32
  953. package/dist/cjs/table.js +0 -26
  954. package/dist/cjs/tag.js +0 -47
  955. package/dist/cjs/text-input-affix.js +0 -27
  956. package/dist/cjs/text-input-button.js +0 -32
  957. package/dist/cjs/text-input.js +0 -120
  958. package/dist/cjs/textarea.js +0 -57
  959. package/dist/cjs/tooltip-content.js +0 -94
  960. package/dist/cjs/tooltip-provider.js +0 -3
  961. package/dist/cjs/tooltip-root.js +0 -3
  962. package/dist/cjs/tooltip-trigger.js +0 -3
  963. package/dist/cjs/tooltip.js +0 -3
  964. package/dist/cjs/types.js +0 -1
  965. package/dist/cjs/use-color-model.js +0 -33
  966. package/dist/cjs/use-delegated-props.js +0 -14
  967. package/dist/cjs/use-user-select.js +0 -39
  968. package/dist/es/chunks/content-divider.vue_vue_type_style_index_0_lang.js +0 -53
  969. package/dist/es/chunks/index.js +0 -10864
  970. package/dist/es/chunks/index2.js +0 -91
  971. package/dist/es/chunks/index3.js +0 -273
  972. package/dist/es/chunks/index4.js +0 -1486
  973. package/dist/es/chunks/index5.js +0 -17163
  974. package/dist/es/chunks/rich-editor.vue_vue_type_style_index_0_scoped_4e1c9896_lang.js +0 -5273
  975. package/dist/es/chunks/sidebar-provider.vue_vue_type_style_index_0_lang.js +0 -64
  976. package/dist/es/chunks/sidebar-separator.vue_vue_type_style_index_0_lang.js +0 -138
  977. package/dist/es/chunks/tinycolor.js +0 -966
@@ -1,1223 +1,1210 @@
1
- var __defProp = Object.defineProperty;
2
- var __defNormalProp = (obj, key, value) => key in obj ? __defProp(obj, key, { enumerable: true, configurable: true, writable: true, value }) : obj[key] = value;
3
- var __publicField = (obj, key, value) => __defNormalProp(obj, typeof key !== "symbol" ? key + "" : key, value);
4
- import { isVNode, defineComponent, useAttrs, ref, computed, watchEffect, nextTick, createElementBlock, openBlock, Fragment, createCommentVNode, createElementVNode, unref, renderList, mergeProps, createBlock, normalizeStyle, normalizeClass, withCtx, renderSlot, createVNode, onMounted, onBeforeUnmount, watch, resolveDynamicComponent, normalizeProps, createTextVNode, toDisplayString, guardReactiveProps } from "vue";
5
- let toastsCounter = 1;
1
+ import { Fragment, computed, createBlock, createCommentVNode, createElementBlock, createElementVNode, createTextVNode, createVNode, defineComponent, guardReactiveProps, isVNode, mergeProps, nextTick, normalizeClass, normalizeProps, normalizeStyle, onBeforeUnmount, onMounted, openBlock, ref, renderList, renderSlot, resolveDynamicComponent, toDisplayString, unref, useAttrs, watch, watchEffect, withCtx } from "vue";
2
+ //#region ../../node_modules/.pnpm/vue-sonner@2.0.9/node_modules/vue-sonner/lib/index.js
3
+ var toastsCounter = 1;
6
4
  var Observer = class {
7
- constructor() {
8
- __publicField(this, "subscribers");
9
- __publicField(this, "toasts");
10
- __publicField(this, "dismissedToasts");
11
- __publicField(this, "subscribe", (subscriber) => {
12
- this.subscribers.push(subscriber);
13
- return () => {
14
- const index = this.subscribers.indexOf(subscriber);
15
- this.subscribers.splice(index, 1);
16
- };
17
- });
18
- __publicField(this, "publish", (data) => {
19
- this.subscribers.forEach((subscriber) => subscriber(data));
20
- });
21
- __publicField(this, "addToast", (data) => {
22
- this.publish(data);
23
- this.toasts = [...this.toasts, data];
24
- });
25
- __publicField(this, "create", (data) => {
26
- var _a;
27
- const { message, ...rest } = data;
28
- const id = typeof data.id === "number" || data.id && ((_a = data.id) == null ? void 0 : _a.length) > 0 ? data.id : toastsCounter++;
29
- const alreadyExists = this.toasts.find((toast$1) => {
30
- return toast$1.id === id;
31
- });
32
- const dismissible = data.dismissible === void 0 ? true : data.dismissible;
33
- if (this.dismissedToasts.has(id)) this.dismissedToasts.delete(id);
34
- if (alreadyExists) this.toasts = this.toasts.map((toast$1) => {
35
- if (toast$1.id === id) {
36
- this.publish({
37
- ...toast$1,
38
- ...data,
39
- id,
40
- title: message
41
- });
42
- return {
43
- ...toast$1,
44
- ...data,
45
- id,
46
- dismissible,
47
- title: message
48
- };
49
- }
50
- return toast$1;
51
- });
52
- else this.addToast({
53
- title: message,
54
- ...rest,
55
- dismissible,
56
- id
57
- });
58
- return id;
59
- });
60
- __publicField(this, "dismiss", (id) => {
61
- if (id) {
62
- this.dismissedToasts.add(id);
63
- requestAnimationFrame(() => this.subscribers.forEach((subscriber) => subscriber({
64
- id,
65
- dismiss: true
66
- })));
67
- } else this.toasts.forEach((toast$1) => {
68
- this.subscribers.forEach((subscriber) => subscriber({
69
- id: toast$1.id,
70
- dismiss: true
71
- }));
72
- });
73
- return id;
74
- });
75
- __publicField(this, "message", (message, data) => {
76
- return this.create({
77
- ...data,
78
- message,
79
- type: "default"
80
- });
81
- });
82
- __publicField(this, "error", (message, data) => {
83
- return this.create({
84
- ...data,
85
- type: "error",
86
- message
87
- });
88
- });
89
- __publicField(this, "success", (message, data) => {
90
- return this.create({
91
- ...data,
92
- type: "success",
93
- message
94
- });
95
- });
96
- __publicField(this, "info", (message, data) => {
97
- return this.create({
98
- ...data,
99
- type: "info",
100
- message
101
- });
102
- });
103
- __publicField(this, "warning", (message, data) => {
104
- return this.create({
105
- ...data,
106
- type: "warning",
107
- message
108
- });
109
- });
110
- __publicField(this, "loading", (message, data) => {
111
- return this.create({
112
- ...data,
113
- type: "loading",
114
- message
115
- });
116
- });
117
- __publicField(this, "promise", (promise, data) => {
118
- if (!data) return;
119
- let id;
120
- if (data.loading !== void 0) id = this.create({
121
- ...data,
122
- promise,
123
- type: "loading",
124
- message: data.loading,
125
- description: typeof data.description !== "function" ? data.description : void 0
126
- });
127
- const p = Promise.resolve(promise instanceof Function ? promise() : promise);
128
- let shouldDismiss = id !== void 0;
129
- let result;
130
- const originalPromise = p.then(async (response) => {
131
- result = ["resolve", response];
132
- const isVueComponent = isVNode(response);
133
- if (isVueComponent) {
134
- shouldDismiss = false;
135
- this.create({
136
- id,
137
- type: "default",
138
- message: response
139
- });
140
- } else if (isHttpResponse(response) && !response.ok) {
141
- shouldDismiss = false;
142
- const promiseData = typeof data.error === "function" ? await data.error(`HTTP error! status: ${response.status}`) : data.error;
143
- const description = typeof data.description === "function" ? await data.description(`HTTP error! status: ${response.status}`) : data.description;
144
- const isExtendedResult = typeof promiseData === "object" && !isVNode(promiseData);
145
- const toastSettings = isExtendedResult ? promiseData : {
146
- message: promiseData || "",
147
- id: id || ""
148
- };
149
- this.create({
150
- id,
151
- type: "error",
152
- description,
153
- ...toastSettings
154
- });
155
- } else if (response instanceof Error) {
156
- shouldDismiss = false;
157
- const promiseData = typeof data.error === "function" ? await data.error(response) : data.error;
158
- const description = typeof data.description === "function" ? await data.description(response) : data.description;
159
- const isExtendedResult = typeof promiseData === "object" && !isVNode(promiseData);
160
- const toastSettings = isExtendedResult ? promiseData : {
161
- message: promiseData || "",
162
- id: id || ""
163
- };
164
- this.create({
165
- id,
166
- type: "error",
167
- description,
168
- ...toastSettings
169
- });
170
- } else if (data.success !== void 0) {
171
- shouldDismiss = false;
172
- const promiseData = typeof data.success === "function" ? await data.success(response) : data.success;
173
- const description = typeof data.description === "function" ? await data.description(response) : data.description;
174
- const isExtendedResult = typeof promiseData === "object" && !isVNode(promiseData);
175
- const toastSettings = isExtendedResult ? promiseData : {
176
- message: promiseData || "",
177
- id: id || ""
178
- };
179
- this.create({
180
- id,
181
- type: "success",
182
- description,
183
- ...toastSettings
184
- });
185
- }
186
- }).catch(async (error) => {
187
- result = ["reject", error];
188
- if (data.error !== void 0) {
189
- shouldDismiss = false;
190
- const promiseData = typeof data.error === "function" ? await data.error(error) : data.error;
191
- const description = typeof data.description === "function" ? await data.description(error) : data.description;
192
- const isExtendedResult = typeof promiseData === "object" && !isVNode(promiseData);
193
- const toastSettings = isExtendedResult ? promiseData : {
194
- message: promiseData || "",
195
- id: id || ""
196
- };
197
- this.create({
198
- id,
199
- type: "error",
200
- description,
201
- ...toastSettings
202
- });
203
- }
204
- }).finally(() => {
205
- var _a;
206
- if (shouldDismiss) {
207
- this.dismiss(id);
208
- id = void 0;
209
- }
210
- (_a = data.finally) == null ? void 0 : _a.call(data);
211
- });
212
- const unwrap = () => new Promise((resolve, reject) => originalPromise.then(() => result[0] === "reject" ? reject(result[1]) : resolve(result[1])).catch(reject));
213
- if (typeof id !== "string" && typeof id !== "number") return { unwrap };
214
- else return Object.assign(id, { unwrap });
215
- });
216
- __publicField(this, "custom", (component, data) => {
217
- const id = (data == null ? void 0 : data.id) || toastsCounter++;
218
- const alreadyExists = this.toasts.find((toast$1) => {
219
- return toast$1.id === id;
220
- });
221
- const dismissible = (data == null ? void 0 : data.dismissible) === void 0 ? true : data.dismissible;
222
- if (this.dismissedToasts.has(id)) this.dismissedToasts.delete(id);
223
- if (alreadyExists) this.toasts = this.toasts.map((toast$1) => {
224
- if (toast$1.id === id) {
225
- this.publish({
226
- ...toast$1,
227
- component,
228
- dismissible,
229
- id,
230
- ...data
231
- });
232
- return {
233
- ...toast$1,
234
- component,
235
- dismissible,
236
- id,
237
- ...data
238
- };
239
- }
240
- return toast$1;
241
- });
242
- else this.addToast({
243
- component,
244
- dismissible,
245
- id,
246
- ...data
247
- });
248
- return id;
249
- });
250
- __publicField(this, "getActiveToasts", () => {
251
- return this.toasts.filter((toast$1) => !this.dismissedToasts.has(toast$1.id));
252
- });
253
- this.subscribers = [];
254
- this.toasts = [];
255
- this.dismissedToasts = /* @__PURE__ */ new Set();
256
- }
5
+ subscribers;
6
+ toasts;
7
+ dismissedToasts;
8
+ constructor() {
9
+ this.subscribers = [];
10
+ this.toasts = [];
11
+ this.dismissedToasts = /* @__PURE__ */ new Set();
12
+ }
13
+ subscribe = (subscriber) => {
14
+ this.subscribers.push(subscriber);
15
+ return () => {
16
+ const index = this.subscribers.indexOf(subscriber);
17
+ this.subscribers.splice(index, 1);
18
+ };
19
+ };
20
+ publish = (data) => {
21
+ this.subscribers.forEach((subscriber) => subscriber(data));
22
+ };
23
+ addToast = (data) => {
24
+ this.publish(data);
25
+ this.toasts = [...this.toasts, data];
26
+ };
27
+ create = (data) => {
28
+ const { message, ...rest } = data;
29
+ const id = typeof data.id === "number" || data.id && data.id?.length > 0 ? data.id : toastsCounter++;
30
+ const alreadyExists = this.toasts.find((toast$1) => {
31
+ return toast$1.id === id;
32
+ });
33
+ const dismissible = data.dismissible === void 0 ? true : data.dismissible;
34
+ if (this.dismissedToasts.has(id)) this.dismissedToasts.delete(id);
35
+ if (alreadyExists) this.toasts = this.toasts.map((toast$1) => {
36
+ if (toast$1.id === id) {
37
+ this.publish({
38
+ ...toast$1,
39
+ ...data,
40
+ id,
41
+ title: message
42
+ });
43
+ return {
44
+ ...toast$1,
45
+ ...data,
46
+ id,
47
+ dismissible,
48
+ title: message
49
+ };
50
+ }
51
+ return toast$1;
52
+ });
53
+ else this.addToast({
54
+ title: message,
55
+ ...rest,
56
+ dismissible,
57
+ id
58
+ });
59
+ return id;
60
+ };
61
+ dismiss = (id) => {
62
+ if (id) {
63
+ this.dismissedToasts.add(id);
64
+ requestAnimationFrame(() => this.subscribers.forEach((subscriber) => subscriber({
65
+ id,
66
+ dismiss: true
67
+ })));
68
+ } else this.toasts.forEach((toast$1) => {
69
+ this.subscribers.forEach((subscriber) => subscriber({
70
+ id: toast$1.id,
71
+ dismiss: true
72
+ }));
73
+ });
74
+ return id;
75
+ };
76
+ message = (message, data) => {
77
+ return this.create({
78
+ ...data,
79
+ message,
80
+ type: "default"
81
+ });
82
+ };
83
+ error = (message, data) => {
84
+ return this.create({
85
+ ...data,
86
+ type: "error",
87
+ message
88
+ });
89
+ };
90
+ success = (message, data) => {
91
+ return this.create({
92
+ ...data,
93
+ type: "success",
94
+ message
95
+ });
96
+ };
97
+ info = (message, data) => {
98
+ return this.create({
99
+ ...data,
100
+ type: "info",
101
+ message
102
+ });
103
+ };
104
+ warning = (message, data) => {
105
+ return this.create({
106
+ ...data,
107
+ type: "warning",
108
+ message
109
+ });
110
+ };
111
+ loading = (message, data) => {
112
+ return this.create({
113
+ ...data,
114
+ type: "loading",
115
+ message
116
+ });
117
+ };
118
+ promise = (promise, data) => {
119
+ if (!data) return;
120
+ let id;
121
+ if (data.loading !== void 0) id = this.create({
122
+ ...data,
123
+ promise,
124
+ type: "loading",
125
+ message: data.loading,
126
+ description: typeof data.description !== "function" ? data.description : void 0
127
+ });
128
+ const p = Promise.resolve(promise instanceof Function ? promise() : promise);
129
+ let shouldDismiss = id !== void 0;
130
+ let result;
131
+ const originalPromise = p.then(async (response) => {
132
+ result = ["resolve", response];
133
+ if (isVNode(response)) {
134
+ shouldDismiss = false;
135
+ this.create({
136
+ id,
137
+ type: "default",
138
+ message: response
139
+ });
140
+ } else if (isHttpResponse(response) && !response.ok) {
141
+ shouldDismiss = false;
142
+ const promiseData = typeof data.error === "function" ? await data.error(`HTTP error! status: ${response.status}`) : data.error;
143
+ const description = typeof data.description === "function" ? await data.description(`HTTP error! status: ${response.status}`) : data.description;
144
+ const toastSettings = typeof promiseData === "object" && !isVNode(promiseData) ? promiseData : {
145
+ message: promiseData || "",
146
+ id: id || ""
147
+ };
148
+ this.create({
149
+ id,
150
+ type: "error",
151
+ description,
152
+ ...toastSettings
153
+ });
154
+ } else if (response instanceof Error) {
155
+ shouldDismiss = false;
156
+ const promiseData = typeof data.error === "function" ? await data.error(response) : data.error;
157
+ const description = typeof data.description === "function" ? await data.description(response) : data.description;
158
+ const toastSettings = typeof promiseData === "object" && !isVNode(promiseData) ? promiseData : {
159
+ message: promiseData || "",
160
+ id: id || ""
161
+ };
162
+ this.create({
163
+ id,
164
+ type: "error",
165
+ description,
166
+ ...toastSettings
167
+ });
168
+ } else if (data.success !== void 0) {
169
+ shouldDismiss = false;
170
+ const promiseData = typeof data.success === "function" ? await data.success(response) : data.success;
171
+ const description = typeof data.description === "function" ? await data.description(response) : data.description;
172
+ const toastSettings = typeof promiseData === "object" && !isVNode(promiseData) ? promiseData : {
173
+ message: promiseData || "",
174
+ id: id || ""
175
+ };
176
+ this.create({
177
+ id,
178
+ type: "success",
179
+ description,
180
+ ...toastSettings
181
+ });
182
+ }
183
+ }).catch(async (error) => {
184
+ result = ["reject", error];
185
+ if (data.error !== void 0) {
186
+ shouldDismiss = false;
187
+ const promiseData = typeof data.error === "function" ? await data.error(error) : data.error;
188
+ const description = typeof data.description === "function" ? await data.description(error) : data.description;
189
+ const toastSettings = typeof promiseData === "object" && !isVNode(promiseData) ? promiseData : {
190
+ message: promiseData || "",
191
+ id: id || ""
192
+ };
193
+ this.create({
194
+ id,
195
+ type: "error",
196
+ description,
197
+ ...toastSettings
198
+ });
199
+ }
200
+ }).finally(() => {
201
+ if (shouldDismiss) {
202
+ this.dismiss(id);
203
+ id = void 0;
204
+ }
205
+ data.finally?.();
206
+ });
207
+ const unwrap = () => new Promise((resolve, reject) => originalPromise.then(() => result[0] === "reject" ? reject(result[1]) : resolve(result[1])).catch(reject));
208
+ if (typeof id !== "string" && typeof id !== "number") return { unwrap };
209
+ else return Object.assign(id, { unwrap });
210
+ };
211
+ custom = (component, data) => {
212
+ const id = data?.id || toastsCounter++;
213
+ const alreadyExists = this.toasts.find((toast$1) => {
214
+ return toast$1.id === id;
215
+ });
216
+ const dismissible = data?.dismissible === void 0 ? true : data.dismissible;
217
+ if (this.dismissedToasts.has(id)) this.dismissedToasts.delete(id);
218
+ if (alreadyExists) this.toasts = this.toasts.map((toast$1) => {
219
+ if (toast$1.id === id) {
220
+ this.publish({
221
+ ...toast$1,
222
+ component,
223
+ dismissible,
224
+ id,
225
+ ...data
226
+ });
227
+ return {
228
+ ...toast$1,
229
+ component,
230
+ dismissible,
231
+ id,
232
+ ...data
233
+ };
234
+ }
235
+ return toast$1;
236
+ });
237
+ else this.addToast({
238
+ component,
239
+ dismissible,
240
+ id,
241
+ ...data
242
+ });
243
+ return id;
244
+ };
245
+ getActiveToasts = () => {
246
+ return this.toasts.filter((toast$1) => !this.dismissedToasts.has(toast$1.id));
247
+ };
257
248
  };
258
- const ToastState = new Observer();
249
+ var ToastState = new Observer();
259
250
  function toastFunction(message, data) {
260
- const id = (data == null ? void 0 : data.id) || toastsCounter++;
261
- ToastState.create({
262
- message,
263
- id,
264
- type: "default",
265
- ...data
266
- });
267
- return id;
251
+ const id = data?.id || toastsCounter++;
252
+ ToastState.create({
253
+ message,
254
+ id,
255
+ type: "default",
256
+ ...data
257
+ });
258
+ return id;
268
259
  }
269
- const isHttpResponse = (data) => {
270
- return data && typeof data === "object" && "ok" in data && typeof data.ok === "boolean" && "status" in data && typeof data.status === "number";
260
+ var isHttpResponse = (data) => {
261
+ return data && typeof data === "object" && "ok" in data && typeof data.ok === "boolean" && "status" in data && typeof data.status === "number";
271
262
  };
272
- const basicToast = toastFunction;
273
- const getHistory = () => ToastState.toasts;
274
- const getToasts = () => ToastState.getActiveToasts();
275
- const toast = Object.assign(basicToast, {
276
- success: ToastState.success,
277
- info: ToastState.info,
278
- warning: ToastState.warning,
279
- error: ToastState.error,
280
- custom: ToastState.custom,
281
- message: ToastState.message,
282
- promise: ToastState.promise,
283
- dismiss: ToastState.dismiss,
284
- loading: ToastState.loading
263
+ var basicToast = toastFunction;
264
+ var getHistory = () => ToastState.toasts;
265
+ var getToasts = () => ToastState.getActiveToasts();
266
+ var toast = Object.assign(basicToast, {
267
+ success: ToastState.success,
268
+ info: ToastState.info,
269
+ warning: ToastState.warning,
270
+ error: ToastState.error,
271
+ custom: ToastState.custom,
272
+ message: ToastState.message,
273
+ promise: ToastState.promise,
274
+ dismiss: ToastState.dismiss,
275
+ loading: ToastState.loading
285
276
  }, {
286
- getHistory,
287
- getToasts
277
+ getHistory,
278
+ getToasts
288
279
  });
289
280
  function isAction(action) {
290
- return action.label !== void 0;
281
+ return action.label !== void 0;
291
282
  }
292
- const VISIBLE_TOASTS_AMOUNT = 3;
293
- const VIEWPORT_OFFSET = "24px";
294
- const MOBILE_VIEWPORT_OFFSET = "16px";
295
- const TOAST_LIFETIME = 4e3;
296
- const TOAST_WIDTH = 356;
297
- const GAP = 14;
298
- const SWIPE_THRESHOLD = 45;
299
- const TIME_BEFORE_UNMOUNT = 200;
283
+ var VISIBLE_TOASTS_AMOUNT = 3;
284
+ var VIEWPORT_OFFSET = "24px";
285
+ var MOBILE_VIEWPORT_OFFSET = "16px";
286
+ var TOAST_LIFETIME = 4e3;
287
+ var TOAST_WIDTH = 356;
288
+ var GAP = 14;
289
+ var SWIPE_THRESHOLD = 45;
290
+ var TIME_BEFORE_UNMOUNT = 200;
300
291
  function useIsDocumentHidden() {
301
- const isDocumentHidden = ref(false);
302
- watchEffect(() => {
303
- const callback = () => {
304
- isDocumentHidden.value = document.hidden;
305
- };
306
- document.addEventListener("visibilitychange", callback);
307
- return () => window.removeEventListener("visibilitychange", callback);
308
- });
309
- return { isDocumentHidden };
292
+ const isDocumentHidden = ref(false);
293
+ watchEffect(() => {
294
+ const callback = () => {
295
+ isDocumentHidden.value = document.hidden;
296
+ };
297
+ document.addEventListener("visibilitychange", callback);
298
+ return () => window.removeEventListener("visibilitychange", callback);
299
+ });
300
+ return { isDocumentHidden };
310
301
  }
311
302
  function cn(...classes) {
312
- return classes.filter(Boolean).join(" ");
303
+ return classes.filter(Boolean).join(" ");
313
304
  }
314
305
  function getDefaultSwipeDirections(position) {
315
- const [y, x] = position.split("-");
316
- const directions = [];
317
- if (y) directions.push(y);
318
- if (x) directions.push(x);
319
- return directions;
306
+ const [y, x] = position.split("-");
307
+ const directions = [];
308
+ if (y) directions.push(y);
309
+ if (x) directions.push(x);
310
+ return directions;
320
311
  }
321
312
  function assignOffset(defaultOffset, mobileOffset) {
322
- const styles = {};
323
- [defaultOffset, mobileOffset].forEach((offset, index) => {
324
- const isMobile = index === 1;
325
- const prefix = isMobile ? "--mobile-offset" : "--offset";
326
- const defaultValue = isMobile ? MOBILE_VIEWPORT_OFFSET : VIEWPORT_OFFSET;
327
- function assignAll(offset$1) {
328
- [
329
- "top",
330
- "right",
331
- "bottom",
332
- "left"
333
- ].forEach((key) => {
334
- styles[`${prefix}-${key}`] = typeof offset$1 === "number" ? `${offset$1}px` : offset$1;
335
- });
336
- }
337
- if (typeof offset === "number" || typeof offset === "string") assignAll(offset);
338
- else if (typeof offset === "object") [
339
- "top",
340
- "right",
341
- "bottom",
342
- "left"
343
- ].forEach((key) => {
344
- if (offset[key] === void 0) styles[`${prefix}-${key}`] = defaultValue;
345
- else styles[`${prefix}-${key}`] = typeof offset[key] === "number" ? `${offset[key]}px` : offset[key];
346
- });
347
- else assignAll(defaultValue);
348
- });
349
- return styles;
313
+ const styles = {};
314
+ [defaultOffset, mobileOffset].forEach((offset, index) => {
315
+ const isMobile = index === 1;
316
+ const prefix = isMobile ? "--mobile-offset" : "--offset";
317
+ const defaultValue = isMobile ? MOBILE_VIEWPORT_OFFSET : VIEWPORT_OFFSET;
318
+ function assignAll(offset$1) {
319
+ [
320
+ "top",
321
+ "right",
322
+ "bottom",
323
+ "left"
324
+ ].forEach((key) => {
325
+ styles[`${prefix}-${key}`] = typeof offset$1 === "number" ? `${offset$1}px` : offset$1;
326
+ });
327
+ }
328
+ if (typeof offset === "number" || typeof offset === "string") assignAll(offset);
329
+ else if (typeof offset === "object") [
330
+ "top",
331
+ "right",
332
+ "bottom",
333
+ "left"
334
+ ].forEach((key) => {
335
+ if (offset[key] === void 0) styles[`${prefix}-${key}`] = defaultValue;
336
+ else styles[`${prefix}-${key}`] = typeof offset[key] === "number" ? `${offset[key]}px` : offset[key];
337
+ });
338
+ else assignAll(defaultValue);
339
+ });
340
+ return styles;
350
341
  }
351
- const _hoisted_1$7 = [
352
- "data-rich-colors",
353
- "data-styled",
354
- "data-mounted",
355
- "data-promise",
356
- "data-swiped",
357
- "data-removed",
358
- "data-visible",
359
- "data-y-position",
360
- "data-x-position",
361
- "data-index",
362
- "data-front",
363
- "data-swiping",
364
- "data-dismissible",
365
- "data-type",
366
- "data-invert",
367
- "data-swipe-out",
368
- "data-swipe-direction",
369
- "data-expanded",
370
- "data-testid"
342
+ var _hoisted_1$7 = [
343
+ "data-rich-colors",
344
+ "data-styled",
345
+ "data-mounted",
346
+ "data-promise",
347
+ "data-swiped",
348
+ "data-removed",
349
+ "data-visible",
350
+ "data-y-position",
351
+ "data-x-position",
352
+ "data-index",
353
+ "data-front",
354
+ "data-swiping",
355
+ "data-dismissible",
356
+ "data-type",
357
+ "data-invert",
358
+ "data-swipe-out",
359
+ "data-swipe-direction",
360
+ "data-expanded",
361
+ "data-testid"
371
362
  ];
372
- const _hoisted_2$2 = [
373
- "aria-label",
374
- "data-disabled",
375
- "data-close-button-position"
363
+ var _hoisted_2$2 = [
364
+ "aria-label",
365
+ "data-disabled",
366
+ "data-close-button-position"
376
367
  ];
377
- var Toast_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
378
- __name: "Toast",
379
- props: {
380
- toast: {},
381
- toasts: {},
382
- index: {},
383
- swipeDirections: {},
384
- expanded: { type: Boolean },
385
- invert: { type: Boolean },
386
- heights: {},
387
- gap: {},
388
- position: {},
389
- closeButtonPosition: {},
390
- visibleToasts: {},
391
- expandByDefault: { type: Boolean },
392
- closeButton: { type: Boolean },
393
- interacting: { type: Boolean },
394
- style: {},
395
- cancelButtonStyle: {},
396
- actionButtonStyle: {},
397
- duration: {},
398
- class: {},
399
- unstyled: { type: Boolean },
400
- descriptionClass: {},
401
- loadingIcon: {},
402
- classes: {},
403
- icons: {},
404
- closeButtonAriaLabel: {},
405
- defaultRichColors: { type: Boolean }
406
- },
407
- emits: [
408
- "update:heights",
409
- "update:height",
410
- "removeToast"
411
- ],
412
- setup(__props, { emit: __emit }) {
413
- const props = __props;
414
- const emit = __emit;
415
- const swipeDirection = ref(null);
416
- const swipeOutDirection = ref(null);
417
- const mounted = ref(false);
418
- const removed = ref(false);
419
- const swiping = ref(false);
420
- const swipeOut = ref(false);
421
- const swiped = ref(false);
422
- const offsetBeforeRemove = ref(0);
423
- const initialHeight = ref(0);
424
- const remainingTime = ref(props.toast.duration || props.duration || TOAST_LIFETIME);
425
- const dragStartTime = ref(null);
426
- const toastRef = ref(null);
427
- const isFront = computed(() => props.index === 0);
428
- const isVisible = computed(() => props.index + 1 <= props.visibleToasts);
429
- const toastType = computed(() => props.toast.type);
430
- const dismissible = computed(() => props.toast.dismissible !== false);
431
- const toastClass = computed(() => props.toast.class || "");
432
- const toastDescriptionClass = computed(() => props.descriptionClass || "");
433
- const heightIndex = computed(() => {
434
- const currentPosition = props.toast.position || props.position;
435
- const samePositionHeights = props.heights.filter((h) => h.position === currentPosition);
436
- const index = samePositionHeights.findIndex((height) => height.toastId === props.toast.id);
437
- return index >= 0 ? index : 0;
438
- });
439
- const toastsHeightBefore = computed(() => {
440
- const currentPosition = props.toast.position || props.position;
441
- const samePositionHeights = props.heights.filter((h) => h.position === currentPosition);
442
- return samePositionHeights.reduce((prev, curr, reducerIndex) => {
443
- if (reducerIndex >= heightIndex.value) return prev;
444
- return prev + curr.height;
445
- }, 0);
446
- });
447
- const offset = computed(() => heightIndex.value * props.gap + toastsHeightBefore.value || 0);
448
- const closeButton = computed(() => props.toast.closeButton ?? props.closeButton);
449
- const duration = computed(() => props.toast.duration || props.duration || TOAST_LIFETIME);
450
- const closeTimerStartTimeRef = ref(0);
451
- const lastCloseTimerStartTimeRef = ref(0);
452
- const pointerStartRef = ref(null);
453
- const coords = computed(() => props.position.split("-"));
454
- const y = computed(() => coords.value[0]);
455
- const x = computed(() => coords.value[1]);
456
- const isStringOfTitle = computed(() => typeof props.toast.title !== "string");
457
- const isStringOfDescription = computed(() => typeof props.toast.description !== "string");
458
- const { isDocumentHidden } = useIsDocumentHidden();
459
- const disabled = computed(() => toastType.value && toastType.value === "loading");
460
- onMounted(() => {
461
- mounted.value = true;
462
- remainingTime.value = duration.value;
463
- });
464
- watchEffect(async () => {
465
- if (!mounted.value || !toastRef.value) return;
466
- await nextTick();
467
- const toastNode = toastRef.value;
468
- const originalHeight = toastNode.style.height;
469
- toastNode.style.height = "auto";
470
- const newHeight = toastNode.getBoundingClientRect().height;
471
- toastNode.style.height = originalHeight;
472
- initialHeight.value = newHeight;
473
- emit("update:height", {
474
- toastId: props.toast.id,
475
- height: newHeight,
476
- position: props.toast.position || props.position
477
- });
478
- });
479
- function deleteToast() {
480
- removed.value = true;
481
- offsetBeforeRemove.value = offset.value;
482
- setTimeout(() => {
483
- emit("removeToast", props.toast);
484
- }, TIME_BEFORE_UNMOUNT);
485
- }
486
- function handleCloseToast() {
487
- var _a, _b;
488
- if (disabled.value || !dismissible.value) return {};
489
- deleteToast();
490
- (_b = (_a = props.toast).onDismiss) == null ? void 0 : _b.call(_a, props.toast);
491
- }
492
- function onPointerDown(event) {
493
- if (event.button === 2) return;
494
- if (disabled.value || !dismissible.value) return;
495
- dragStartTime.value = /* @__PURE__ */ new Date();
496
- offsetBeforeRemove.value = offset.value;
497
- event.target.setPointerCapture(event.pointerId);
498
- if (event.target.tagName === "BUTTON") return;
499
- swiping.value = true;
500
- pointerStartRef.value = {
501
- x: event.clientX,
502
- y: event.clientY
503
- };
504
- }
505
- function onPointerUp() {
506
- var _a, _b, _c, _d, _e, _f, _g;
507
- if (swipeOut.value || !dismissible.value) return;
508
- pointerStartRef.value = null;
509
- const swipeAmountX = Number(((_a = toastRef.value) == null ? void 0 : _a.style.getPropertyValue("--swipe-amount-x").replace("px", "")) || 0);
510
- const swipeAmountY = Number(((_b = toastRef.value) == null ? void 0 : _b.style.getPropertyValue("--swipe-amount-y").replace("px", "")) || 0);
511
- const timeTaken = (/* @__PURE__ */ new Date()).getTime() - (((_c = dragStartTime.value) == null ? void 0 : _c.getTime()) || 0);
512
- const swipeAmount = swipeDirection.value === "x" ? swipeAmountX : swipeAmountY;
513
- const velocity = Math.abs(swipeAmount) / timeTaken;
514
- if (Math.abs(swipeAmount) >= SWIPE_THRESHOLD || velocity > 0.11) {
515
- offsetBeforeRemove.value = offset.value;
516
- (_e = (_d = props.toast).onDismiss) == null ? void 0 : _e.call(_d, props.toast);
517
- if (swipeDirection.value === "x") swipeOutDirection.value = swipeAmountX > 0 ? "right" : "left";
518
- else swipeOutDirection.value = swipeAmountY > 0 ? "down" : "up";
519
- deleteToast();
520
- swipeOut.value = true;
521
- return;
522
- } else {
523
- (_f = toastRef.value) == null ? void 0 : _f.style.setProperty("--swipe-amount-x", `0px`);
524
- (_g = toastRef.value) == null ? void 0 : _g.style.setProperty("--swipe-amount-y", `0px`);
525
- }
526
- swiped.value = false;
527
- swiping.value = false;
528
- swipeDirection.value = null;
529
- }
530
- function onPointerMove(event) {
531
- var _a, _b, _c, _d;
532
- if (!pointerStartRef.value || !dismissible.value) return;
533
- const isHighlighted = ((_b = (_a = window == null ? void 0 : window.getSelection()) == null ? void 0 : _a.toString()) == null ? void 0 : _b.length) ?? false;
534
- if (isHighlighted) return;
535
- const yDelta = event.clientY - pointerStartRef.value.y;
536
- const xDelta = event.clientX - pointerStartRef.value.x;
537
- const swipeDirections = props.swipeDirections ?? getDefaultSwipeDirections(props.position);
538
- if (!swipeDirection.value && (Math.abs(xDelta) > 1 || Math.abs(yDelta) > 1)) swipeDirection.value = Math.abs(xDelta) > Math.abs(yDelta) ? "x" : "y";
539
- let swipeAmount = {
540
- x: 0,
541
- y: 0
542
- };
543
- const getDampening = (delta) => {
544
- const factor = Math.abs(delta) / 20;
545
- return 1 / (1.5 + factor);
546
- };
547
- if (swipeDirection.value === "y") {
548
- if (swipeDirections.includes("top") || swipeDirections.includes("bottom")) if (swipeDirections.includes("top") && yDelta < 0 || swipeDirections.includes("bottom") && yDelta > 0) swipeAmount.y = yDelta;
549
- else {
550
- const dampenedDelta = yDelta * getDampening(yDelta);
551
- swipeAmount.y = Math.abs(dampenedDelta) < Math.abs(yDelta) ? dampenedDelta : yDelta;
552
- }
553
- } else if (swipeDirection.value === "x") {
554
- if (swipeDirections.includes("left") || swipeDirections.includes("right")) if (swipeDirections.includes("left") && xDelta < 0 || swipeDirections.includes("right") && xDelta > 0) swipeAmount.x = xDelta;
555
- else {
556
- const dampenedDelta = xDelta * getDampening(xDelta);
557
- swipeAmount.x = Math.abs(dampenedDelta) < Math.abs(xDelta) ? dampenedDelta : xDelta;
558
- }
559
- }
560
- if (Math.abs(swipeAmount.x) > 0 || Math.abs(swipeAmount.y) > 0) swiped.value = true;
561
- (_c = toastRef.value) == null ? void 0 : _c.style.setProperty("--swipe-amount-x", `${swipeAmount.x}px`);
562
- (_d = toastRef.value) == null ? void 0 : _d.style.setProperty("--swipe-amount-y", `${swipeAmount.y}px`);
563
- }
564
- onMounted(() => {
565
- mounted.value = true;
566
- if (!toastRef.value) return;
567
- const height = toastRef.value.getBoundingClientRect().height;
568
- initialHeight.value = height;
569
- const newHeights = [{
570
- toastId: props.toast.id,
571
- height,
572
- position: props.toast.position
573
- }, ...props.heights];
574
- emit("update:heights", newHeights);
575
- });
576
- onBeforeUnmount(() => {
577
- if (toastRef.value) emit("removeToast", props.toast);
578
- });
579
- watchEffect((onInvalidate) => {
580
- if (props.toast.promise && toastType.value === "loading" || props.toast.duration === Infinity || props.toast.type === "loading") return;
581
- let timeoutId;
582
- const pauseTimer = () => {
583
- if (lastCloseTimerStartTimeRef.value < closeTimerStartTimeRef.value) {
584
- const elapsedTime = (/* @__PURE__ */ new Date()).getTime() - closeTimerStartTimeRef.value;
585
- remainingTime.value = remainingTime.value - elapsedTime;
586
- }
587
- lastCloseTimerStartTimeRef.value = (/* @__PURE__ */ new Date()).getTime();
588
- };
589
- const startTimer = () => {
590
- if (remainingTime.value === Infinity) return;
591
- closeTimerStartTimeRef.value = (/* @__PURE__ */ new Date()).getTime();
592
- timeoutId = setTimeout(() => {
593
- var _a, _b;
594
- (_b = (_a = props.toast).onAutoClose) == null ? void 0 : _b.call(_a, props.toast);
595
- deleteToast();
596
- }, remainingTime.value);
597
- };
598
- if (props.expanded || props.interacting || isDocumentHidden.value) pauseTimer();
599
- else startTimer();
600
- onInvalidate(() => {
601
- clearTimeout(timeoutId);
602
- });
603
- });
604
- watch(() => props.toast.delete, (value) => {
605
- var _a, _b;
606
- if (value !== void 0 && value) {
607
- deleteToast();
608
- (_b = (_a = props.toast).onDismiss) == null ? void 0 : _b.call(_a, props.toast);
609
- }
610
- }, { deep: true });
611
- function handleDragEnd() {
612
- swiping.value = false;
613
- swipeDirection.value = null;
614
- pointerStartRef.value = null;
615
- }
616
- return (_ctx, _cache) => {
617
- var _a, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k, _l, _m, _n, _o, _p, _q, _r, _s, _t, _u, _v, _w, _x, _y, _z, _A;
618
- return openBlock(), createElementBlock("li", {
619
- tabindex: "0",
620
- ref_key: "toastRef",
621
- ref: toastRef,
622
- class: normalizeClass(unref(cn)(props.class, toastClass.value, (_a = _ctx.classes) == null ? void 0 : _a.toast, (_b = _ctx.toast.classes) == null ? void 0 : _b.toast, (_c = _ctx.classes) == null ? void 0 : _c[toastType.value], (_e = (_d = _ctx.toast) == null ? void 0 : _d.classes) == null ? void 0 : _e[toastType.value])),
623
- "data-sonner-toast": "",
624
- "data-rich-colors": _ctx.toast.richColors ?? _ctx.defaultRichColors,
625
- "data-styled": !Boolean(_ctx.toast.component || ((_f = _ctx.toast) == null ? void 0 : _f.unstyled) || _ctx.unstyled),
626
- "data-mounted": mounted.value,
627
- "data-promise": Boolean(_ctx.toast.promise),
628
- "data-swiped": swiped.value,
629
- "data-removed": removed.value,
630
- "data-visible": isVisible.value,
631
- "data-y-position": y.value,
632
- "data-x-position": x.value,
633
- "data-index": _ctx.index,
634
- "data-front": isFront.value,
635
- "data-swiping": swiping.value,
636
- "data-dismissible": dismissible.value,
637
- "data-type": toastType.value,
638
- "data-invert": _ctx.toast.invert || _ctx.invert,
639
- "data-swipe-out": swipeOut.value,
640
- "data-swipe-direction": swipeOutDirection.value,
641
- "data-expanded": Boolean(_ctx.expanded || _ctx.expandByDefault && mounted.value),
642
- "data-testid": _ctx.toast.testId,
643
- style: normalizeStyle({
644
- "--index": _ctx.index,
645
- "--toasts-before": _ctx.index,
646
- "--z-index": _ctx.toasts.length - _ctx.index,
647
- "--offset": `${removed.value ? offsetBeforeRemove.value : offset.value}px`,
648
- "--initial-height": _ctx.expandByDefault ? "auto" : `${initialHeight.value}px`,
649
- ..._ctx.style,
650
- ...props.toast.style
651
- }),
652
- onDragend: handleDragEnd,
653
- onPointerdown: onPointerDown,
654
- onPointerup: onPointerUp,
655
- onPointermove: onPointerMove
656
- }, [closeButton.value && !_ctx.toast.component && toastType.value !== "loading" ? (openBlock(), createElementBlock("button", {
657
- key: 0,
658
- "aria-label": _ctx.closeButtonAriaLabel || "Close toast",
659
- "data-disabled": disabled.value,
660
- "data-close-button": "true",
661
- "data-close-button-position": _ctx.closeButtonPosition,
662
- class: normalizeClass(unref(cn)((_g = _ctx.classes) == null ? void 0 : _g.closeButton, (_i = (_h = _ctx.toast) == null ? void 0 : _h.classes) == null ? void 0 : _i.closeButton)),
663
- onClick: handleCloseToast
664
- }, [((_j = _ctx.icons) == null ? void 0 : _j.close) ? (openBlock(), createBlock(resolveDynamicComponent((_k = _ctx.icons) == null ? void 0 : _k.close), { key: 0 })) : renderSlot(_ctx.$slots, "close-icon", { key: 1 })], 10, _hoisted_2$2)) : createCommentVNode("v-if", true), _ctx.toast.component ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.toast.component), mergeProps({ key: 1 }, _ctx.toast.componentProps, {
665
- onCloseToast: handleCloseToast,
666
- isPaused: _ctx.$props.expanded || _ctx.$props.interacting || unref(isDocumentHidden)
667
- }), null, 16, ["isPaused"])) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
668
- toastType.value !== "default" || _ctx.toast.icon || _ctx.toast.promise ? (openBlock(), createElementBlock("div", {
669
- key: 0,
670
- "data-icon": "",
671
- class: normalizeClass(unref(cn)((_l = _ctx.classes) == null ? void 0 : _l.icon, (_n = (_m = _ctx.toast) == null ? void 0 : _m.classes) == null ? void 0 : _n.icon))
672
- }, [_ctx.toast.icon ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.toast.icon), { key: 0 })) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [toastType.value === "loading" ? renderSlot(_ctx.$slots, "loading-icon", { key: 0 }) : toastType.value === "success" ? renderSlot(_ctx.$slots, "success-icon", { key: 1 }) : toastType.value === "error" ? renderSlot(_ctx.$slots, "error-icon", { key: 2 }) : toastType.value === "warning" ? renderSlot(_ctx.$slots, "warning-icon", { key: 3 }) : toastType.value === "info" ? renderSlot(_ctx.$slots, "info-icon", { key: 4 }) : createCommentVNode("v-if", true)], 64))], 2)) : createCommentVNode("v-if", true),
673
- createElementVNode("div", {
674
- "data-content": "",
675
- class: normalizeClass(unref(cn)((_o = _ctx.classes) == null ? void 0 : _o.content, (_q = (_p = _ctx.toast) == null ? void 0 : _p.classes) == null ? void 0 : _q.content))
676
- }, [createElementVNode("div", {
677
- "data-title": "",
678
- class: normalizeClass(unref(cn)((_r = _ctx.classes) == null ? void 0 : _r.title, (_s = _ctx.toast.classes) == null ? void 0 : _s.title))
679
- }, [isStringOfTitle.value ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.toast.title), normalizeProps(mergeProps({ key: 0 }, _ctx.toast.componentProps)), null, 16)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(_ctx.toast.title), 1)], 64))], 2), _ctx.toast.description ? (openBlock(), createElementBlock("div", {
680
- key: 0,
681
- "data-description": "",
682
- class: normalizeClass(unref(cn)(_ctx.descriptionClass, toastDescriptionClass.value, (_t = _ctx.classes) == null ? void 0 : _t.description, (_u = _ctx.toast.classes) == null ? void 0 : _u.description))
683
- }, [isStringOfDescription.value ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.toast.description), normalizeProps(mergeProps({ key: 0 }, _ctx.toast.componentProps)), null, 16)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(_ctx.toast.description), 1)], 64))], 2)) : createCommentVNode("v-if", true)], 2),
684
- _ctx.toast.cancel ? (openBlock(), createElementBlock("button", {
685
- key: 1,
686
- style: normalizeStyle(_ctx.toast.cancelButtonStyle || _ctx.cancelButtonStyle),
687
- class: normalizeClass(unref(cn)((_v = _ctx.classes) == null ? void 0 : _v.cancelButton, (_w = _ctx.toast.classes) == null ? void 0 : _w.cancelButton)),
688
- "data-button": "",
689
- "data-cancel": "",
690
- onClick: _cache[0] || (_cache[0] = (event) => {
691
- var _a2, _b2;
692
- if (!unref(isAction)(_ctx.toast.cancel)) return;
693
- if (!dismissible.value) return;
694
- (_b2 = (_a2 = _ctx.toast.cancel).onClick) == null ? void 0 : _b2.call(_a2, event);
695
- deleteToast();
696
- })
697
- }, toDisplayString(unref(isAction)(_ctx.toast.cancel) ? (_x = _ctx.toast.cancel) == null ? void 0 : _x.label : _ctx.toast.cancel), 7)) : createCommentVNode("v-if", true),
698
- _ctx.toast.action ? (openBlock(), createElementBlock("button", {
699
- key: 2,
700
- style: normalizeStyle(_ctx.toast.actionButtonStyle || _ctx.actionButtonStyle),
701
- class: normalizeClass(unref(cn)((_y = _ctx.classes) == null ? void 0 : _y.actionButton, (_z = _ctx.toast.classes) == null ? void 0 : _z.actionButton)),
702
- "data-button": "",
703
- "data-action": "",
704
- onClick: _cache[1] || (_cache[1] = (event) => {
705
- var _a2, _b2;
706
- if (!unref(isAction)(_ctx.toast.action)) return;
707
- (_b2 = (_a2 = _ctx.toast.action).onClick) == null ? void 0 : _b2.call(_a2, event);
708
- if (event.defaultPrevented) return;
709
- deleteToast();
710
- })
711
- }, toDisplayString(unref(isAction)(_ctx.toast.action) ? (_A = _ctx.toast.action) == null ? void 0 : _A.label : _ctx.toast.action), 7)) : createCommentVNode("v-if", true)
712
- ], 64))], 46, _hoisted_1$7);
713
- };
714
- }
368
+ var Toast_default = /* @__PURE__ */ defineComponent({
369
+ __name: "Toast",
370
+ props: {
371
+ toast: {},
372
+ toasts: {},
373
+ index: {},
374
+ swipeDirections: {},
375
+ expanded: { type: Boolean },
376
+ invert: { type: Boolean },
377
+ heights: {},
378
+ gap: {},
379
+ position: {},
380
+ closeButtonPosition: {},
381
+ visibleToasts: {},
382
+ expandByDefault: { type: Boolean },
383
+ closeButton: { type: Boolean },
384
+ interacting: { type: Boolean },
385
+ style: {},
386
+ cancelButtonStyle: {},
387
+ actionButtonStyle: {},
388
+ duration: {},
389
+ class: {},
390
+ unstyled: { type: Boolean },
391
+ descriptionClass: {},
392
+ loadingIcon: {},
393
+ classes: {},
394
+ icons: {},
395
+ closeButtonAriaLabel: {},
396
+ defaultRichColors: { type: Boolean }
397
+ },
398
+ emits: [
399
+ "update:heights",
400
+ "update:height",
401
+ "removeToast"
402
+ ],
403
+ setup(__props, { emit: __emit }) {
404
+ const props = __props;
405
+ const emit = __emit;
406
+ const swipeDirection = ref(null);
407
+ const swipeOutDirection = ref(null);
408
+ const mounted = ref(false);
409
+ const removed = ref(false);
410
+ const swiping = ref(false);
411
+ const swipeOut = ref(false);
412
+ const swiped = ref(false);
413
+ const offsetBeforeRemove = ref(0);
414
+ const initialHeight = ref(0);
415
+ const remainingTime = ref(props.toast.duration || props.duration || TOAST_LIFETIME);
416
+ const dragStartTime = ref(null);
417
+ const toastRef = ref(null);
418
+ const isFront = computed(() => props.index === 0);
419
+ const isVisible = computed(() => props.index + 1 <= props.visibleToasts);
420
+ const toastType = computed(() => props.toast.type);
421
+ const dismissible = computed(() => props.toast.dismissible !== false);
422
+ const toastClass = computed(() => props.toast.class || "");
423
+ const toastDescriptionClass = computed(() => props.descriptionClass || "");
424
+ const heightIndex = computed(() => {
425
+ const currentPosition = props.toast.position || props.position;
426
+ const index = props.heights.filter((h) => h.position === currentPosition).findIndex((height) => height.toastId === props.toast.id);
427
+ return index >= 0 ? index : 0;
428
+ });
429
+ const toastsHeightBefore = computed(() => {
430
+ const currentPosition = props.toast.position || props.position;
431
+ return props.heights.filter((h) => h.position === currentPosition).reduce((prev, curr, reducerIndex) => {
432
+ if (reducerIndex >= heightIndex.value) return prev;
433
+ return prev + curr.height;
434
+ }, 0);
435
+ });
436
+ const offset = computed(() => heightIndex.value * props.gap + toastsHeightBefore.value || 0);
437
+ const closeButton = computed(() => props.toast.closeButton ?? props.closeButton);
438
+ const duration = computed(() => props.toast.duration || props.duration || TOAST_LIFETIME);
439
+ const closeTimerStartTimeRef = ref(0);
440
+ const lastCloseTimerStartTimeRef = ref(0);
441
+ const pointerStartRef = ref(null);
442
+ const coords = computed(() => props.position.split("-"));
443
+ const y = computed(() => coords.value[0]);
444
+ const x = computed(() => coords.value[1]);
445
+ const isStringOfTitle = computed(() => typeof props.toast.title !== "string");
446
+ const isStringOfDescription = computed(() => typeof props.toast.description !== "string");
447
+ const { isDocumentHidden } = useIsDocumentHidden();
448
+ const disabled = computed(() => toastType.value && toastType.value === "loading");
449
+ onMounted(() => {
450
+ mounted.value = true;
451
+ remainingTime.value = duration.value;
452
+ });
453
+ watchEffect(async () => {
454
+ if (!mounted.value || !toastRef.value) return;
455
+ await nextTick();
456
+ const toastNode = toastRef.value;
457
+ const originalHeight = toastNode.style.height;
458
+ toastNode.style.height = "auto";
459
+ const newHeight = toastNode.getBoundingClientRect().height;
460
+ toastNode.style.height = originalHeight;
461
+ initialHeight.value = newHeight;
462
+ emit("update:height", {
463
+ toastId: props.toast.id,
464
+ height: newHeight,
465
+ position: props.toast.position || props.position
466
+ });
467
+ });
468
+ function deleteToast() {
469
+ removed.value = true;
470
+ offsetBeforeRemove.value = offset.value;
471
+ setTimeout(() => {
472
+ emit("removeToast", props.toast);
473
+ }, TIME_BEFORE_UNMOUNT);
474
+ }
475
+ function handleCloseToast() {
476
+ if (disabled.value || !dismissible.value) return {};
477
+ deleteToast();
478
+ props.toast.onDismiss?.(props.toast);
479
+ }
480
+ function onPointerDown(event) {
481
+ if (event.button === 2) return;
482
+ if (disabled.value || !dismissible.value) return;
483
+ dragStartTime.value = /* @__PURE__ */ new Date();
484
+ offsetBeforeRemove.value = offset.value;
485
+ event.target.setPointerCapture(event.pointerId);
486
+ if (event.target.tagName === "BUTTON") return;
487
+ swiping.value = true;
488
+ pointerStartRef.value = {
489
+ x: event.clientX,
490
+ y: event.clientY
491
+ };
492
+ }
493
+ function onPointerUp() {
494
+ if (swipeOut.value || !dismissible.value) return;
495
+ pointerStartRef.value = null;
496
+ const swipeAmountX = Number(toastRef.value?.style.getPropertyValue("--swipe-amount-x").replace("px", "") || 0);
497
+ const swipeAmountY = Number(toastRef.value?.style.getPropertyValue("--swipe-amount-y").replace("px", "") || 0);
498
+ const timeTaken = (/* @__PURE__ */ new Date()).getTime() - (dragStartTime.value?.getTime() || 0);
499
+ const swipeAmount = swipeDirection.value === "x" ? swipeAmountX : swipeAmountY;
500
+ const velocity = Math.abs(swipeAmount) / timeTaken;
501
+ if (Math.abs(swipeAmount) >= SWIPE_THRESHOLD || velocity > .11) {
502
+ offsetBeforeRemove.value = offset.value;
503
+ props.toast.onDismiss?.(props.toast);
504
+ if (swipeDirection.value === "x") swipeOutDirection.value = swipeAmountX > 0 ? "right" : "left";
505
+ else swipeOutDirection.value = swipeAmountY > 0 ? "down" : "up";
506
+ deleteToast();
507
+ swipeOut.value = true;
508
+ return;
509
+ } else {
510
+ toastRef.value?.style.setProperty("--swipe-amount-x", `0px`);
511
+ toastRef.value?.style.setProperty("--swipe-amount-y", `0px`);
512
+ }
513
+ swiped.value = false;
514
+ swiping.value = false;
515
+ swipeDirection.value = null;
516
+ }
517
+ function onPointerMove(event) {
518
+ if (!pointerStartRef.value || !dismissible.value) return;
519
+ if (window?.getSelection()?.toString()?.length ?? false) return;
520
+ const yDelta = event.clientY - pointerStartRef.value.y;
521
+ const xDelta = event.clientX - pointerStartRef.value.x;
522
+ const swipeDirections = props.swipeDirections ?? getDefaultSwipeDirections(props.position);
523
+ if (!swipeDirection.value && (Math.abs(xDelta) > 1 || Math.abs(yDelta) > 1)) swipeDirection.value = Math.abs(xDelta) > Math.abs(yDelta) ? "x" : "y";
524
+ let swipeAmount = {
525
+ x: 0,
526
+ y: 0
527
+ };
528
+ const getDampening = (delta) => {
529
+ return 1 / (1.5 + Math.abs(delta) / 20);
530
+ };
531
+ if (swipeDirection.value === "y") {
532
+ if (swipeDirections.includes("top") || swipeDirections.includes("bottom")) if (swipeDirections.includes("top") && yDelta < 0 || swipeDirections.includes("bottom") && yDelta > 0) swipeAmount.y = yDelta;
533
+ else {
534
+ const dampenedDelta = yDelta * getDampening(yDelta);
535
+ swipeAmount.y = Math.abs(dampenedDelta) < Math.abs(yDelta) ? dampenedDelta : yDelta;
536
+ }
537
+ } else if (swipeDirection.value === "x") {
538
+ if (swipeDirections.includes("left") || swipeDirections.includes("right")) if (swipeDirections.includes("left") && xDelta < 0 || swipeDirections.includes("right") && xDelta > 0) swipeAmount.x = xDelta;
539
+ else {
540
+ const dampenedDelta = xDelta * getDampening(xDelta);
541
+ swipeAmount.x = Math.abs(dampenedDelta) < Math.abs(xDelta) ? dampenedDelta : xDelta;
542
+ }
543
+ }
544
+ if (Math.abs(swipeAmount.x) > 0 || Math.abs(swipeAmount.y) > 0) swiped.value = true;
545
+ toastRef.value?.style.setProperty("--swipe-amount-x", `${swipeAmount.x}px`);
546
+ toastRef.value?.style.setProperty("--swipe-amount-y", `${swipeAmount.y}px`);
547
+ }
548
+ onMounted(() => {
549
+ mounted.value = true;
550
+ if (!toastRef.value) return;
551
+ const height = toastRef.value.getBoundingClientRect().height;
552
+ initialHeight.value = height;
553
+ emit("update:heights", [{
554
+ toastId: props.toast.id,
555
+ height,
556
+ position: props.toast.position
557
+ }, ...props.heights]);
558
+ });
559
+ onBeforeUnmount(() => {
560
+ if (toastRef.value) emit("removeToast", props.toast);
561
+ });
562
+ watchEffect((onInvalidate) => {
563
+ if (props.toast.promise && toastType.value === "loading" || props.toast.duration === Infinity || props.toast.type === "loading") return;
564
+ let timeoutId;
565
+ const pauseTimer = () => {
566
+ if (lastCloseTimerStartTimeRef.value < closeTimerStartTimeRef.value) {
567
+ const elapsedTime = (/* @__PURE__ */ new Date()).getTime() - closeTimerStartTimeRef.value;
568
+ remainingTime.value = remainingTime.value - elapsedTime;
569
+ }
570
+ lastCloseTimerStartTimeRef.value = (/* @__PURE__ */ new Date()).getTime();
571
+ };
572
+ const startTimer = () => {
573
+ if (remainingTime.value === Infinity) return;
574
+ closeTimerStartTimeRef.value = (/* @__PURE__ */ new Date()).getTime();
575
+ timeoutId = setTimeout(() => {
576
+ props.toast.onAutoClose?.(props.toast);
577
+ deleteToast();
578
+ }, remainingTime.value);
579
+ };
580
+ if (props.expanded || props.interacting || isDocumentHidden.value) pauseTimer();
581
+ else startTimer();
582
+ onInvalidate(() => {
583
+ clearTimeout(timeoutId);
584
+ });
585
+ });
586
+ watch(() => props.toast.delete, (value) => {
587
+ if (value !== void 0 && value) {
588
+ deleteToast();
589
+ props.toast.onDismiss?.(props.toast);
590
+ }
591
+ }, { deep: true });
592
+ function handleDragEnd() {
593
+ swiping.value = false;
594
+ swipeDirection.value = null;
595
+ pointerStartRef.value = null;
596
+ }
597
+ return (_ctx, _cache) => {
598
+ return openBlock(), createElementBlock("li", {
599
+ tabindex: "0",
600
+ ref_key: "toastRef",
601
+ ref: toastRef,
602
+ class: normalizeClass(unref(cn)(props.class, toastClass.value, _ctx.classes?.toast, _ctx.toast.classes?.toast, _ctx.classes?.[toastType.value], _ctx.toast?.classes?.[toastType.value])),
603
+ "data-sonner-toast": "",
604
+ "data-rich-colors": _ctx.toast.richColors ?? _ctx.defaultRichColors,
605
+ "data-styled": !Boolean(_ctx.toast.component || _ctx.toast?.unstyled || _ctx.unstyled),
606
+ "data-mounted": mounted.value,
607
+ "data-promise": Boolean(_ctx.toast.promise),
608
+ "data-swiped": swiped.value,
609
+ "data-removed": removed.value,
610
+ "data-visible": isVisible.value,
611
+ "data-y-position": y.value,
612
+ "data-x-position": x.value,
613
+ "data-index": _ctx.index,
614
+ "data-front": isFront.value,
615
+ "data-swiping": swiping.value,
616
+ "data-dismissible": dismissible.value,
617
+ "data-type": toastType.value,
618
+ "data-invert": _ctx.toast.invert || _ctx.invert,
619
+ "data-swipe-out": swipeOut.value,
620
+ "data-swipe-direction": swipeOutDirection.value,
621
+ "data-expanded": Boolean(_ctx.expanded || _ctx.expandByDefault && mounted.value),
622
+ "data-testid": _ctx.toast.testId,
623
+ style: normalizeStyle({
624
+ "--index": _ctx.index,
625
+ "--toasts-before": _ctx.index,
626
+ "--z-index": _ctx.toasts.length - _ctx.index,
627
+ "--offset": `${removed.value ? offsetBeforeRemove.value : offset.value}px`,
628
+ "--initial-height": _ctx.expandByDefault ? "auto" : `${initialHeight.value}px`,
629
+ ..._ctx.style,
630
+ ...props.toast.style
631
+ }),
632
+ onDragend: handleDragEnd,
633
+ onPointerdown: onPointerDown,
634
+ onPointerup: onPointerUp,
635
+ onPointermove: onPointerMove
636
+ }, [closeButton.value && !_ctx.toast.component && toastType.value !== "loading" ? (openBlock(), createElementBlock("button", {
637
+ key: 0,
638
+ "aria-label": _ctx.closeButtonAriaLabel || "Close toast",
639
+ "data-disabled": disabled.value,
640
+ "data-close-button": "true",
641
+ "data-close-button-position": _ctx.closeButtonPosition,
642
+ class: normalizeClass(unref(cn)(_ctx.classes?.closeButton, _ctx.toast?.classes?.closeButton)),
643
+ onClick: handleCloseToast
644
+ }, [_ctx.icons?.close ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.icons?.close), { key: 0 })) : renderSlot(_ctx.$slots, "close-icon", { key: 1 })], 10, _hoisted_2$2)) : createCommentVNode("v-if", true), _ctx.toast.component ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.toast.component), mergeProps({ key: 1 }, _ctx.toast.componentProps, {
645
+ onCloseToast: handleCloseToast,
646
+ isPaused: _ctx.$props.expanded || _ctx.$props.interacting || unref(isDocumentHidden)
647
+ }), null, 16, ["isPaused"])) : (openBlock(), createElementBlock(Fragment, { key: 2 }, [
648
+ toastType.value !== "default" || _ctx.toast.icon || _ctx.toast.promise ? (openBlock(), createElementBlock("div", {
649
+ key: 0,
650
+ "data-icon": "",
651
+ class: normalizeClass(unref(cn)(_ctx.classes?.icon, _ctx.toast?.classes?.icon))
652
+ }, [_ctx.toast.icon ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.toast.icon), { key: 0 })) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [toastType.value === "loading" ? renderSlot(_ctx.$slots, "loading-icon", { key: 0 }) : toastType.value === "success" ? renderSlot(_ctx.$slots, "success-icon", { key: 1 }) : toastType.value === "error" ? renderSlot(_ctx.$slots, "error-icon", { key: 2 }) : toastType.value === "warning" ? renderSlot(_ctx.$slots, "warning-icon", { key: 3 }) : toastType.value === "info" ? renderSlot(_ctx.$slots, "info-icon", { key: 4 }) : createCommentVNode("v-if", true)], 64))], 2)) : createCommentVNode("v-if", true),
653
+ createElementVNode("div", {
654
+ "data-content": "",
655
+ class: normalizeClass(unref(cn)(_ctx.classes?.content, _ctx.toast?.classes?.content))
656
+ }, [createElementVNode("div", {
657
+ "data-title": "",
658
+ class: normalizeClass(unref(cn)(_ctx.classes?.title, _ctx.toast.classes?.title))
659
+ }, [isStringOfTitle.value ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.toast.title), normalizeProps(mergeProps({ key: 0 }, _ctx.toast.componentProps)), null, 16)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(_ctx.toast.title), 1)], 64))], 2), _ctx.toast.description ? (openBlock(), createElementBlock("div", {
660
+ key: 0,
661
+ "data-description": "",
662
+ class: normalizeClass(unref(cn)(_ctx.descriptionClass, toastDescriptionClass.value, _ctx.classes?.description, _ctx.toast.classes?.description))
663
+ }, [isStringOfDescription.value ? (openBlock(), createBlock(resolveDynamicComponent(_ctx.toast.description), normalizeProps(mergeProps({ key: 0 }, _ctx.toast.componentProps)), null, 16)) : (openBlock(), createElementBlock(Fragment, { key: 1 }, [createTextVNode(toDisplayString(_ctx.toast.description), 1)], 64))], 2)) : createCommentVNode("v-if", true)], 2),
664
+ _ctx.toast.cancel ? (openBlock(), createElementBlock("button", {
665
+ key: 1,
666
+ style: normalizeStyle(_ctx.toast.cancelButtonStyle || _ctx.cancelButtonStyle),
667
+ class: normalizeClass(unref(cn)(_ctx.classes?.cancelButton, _ctx.toast.classes?.cancelButton)),
668
+ "data-button": "",
669
+ "data-cancel": "",
670
+ onClick: _cache[0] || (_cache[0] = (event) => {
671
+ if (!unref(isAction)(_ctx.toast.cancel)) return;
672
+ if (!dismissible.value) return;
673
+ _ctx.toast.cancel.onClick?.(event);
674
+ deleteToast();
675
+ })
676
+ }, toDisplayString(unref(isAction)(_ctx.toast.cancel) ? _ctx.toast.cancel?.label : _ctx.toast.cancel), 7)) : createCommentVNode("v-if", true),
677
+ _ctx.toast.action ? (openBlock(), createElementBlock("button", {
678
+ key: 2,
679
+ style: normalizeStyle(_ctx.toast.actionButtonStyle || _ctx.actionButtonStyle),
680
+ class: normalizeClass(unref(cn)(_ctx.classes?.actionButton, _ctx.toast.classes?.actionButton)),
681
+ "data-button": "",
682
+ "data-action": "",
683
+ onClick: _cache[1] || (_cache[1] = (event) => {
684
+ if (!unref(isAction)(_ctx.toast.action)) return;
685
+ _ctx.toast.action.onClick?.(event);
686
+ if (event.defaultPrevented) return;
687
+ deleteToast();
688
+ })
689
+ }, toDisplayString(unref(isAction)(_ctx.toast.action) ? _ctx.toast.action?.label : _ctx.toast.action), 7)) : createCommentVNode("v-if", true)
690
+ ], 64))], 46, _hoisted_1$7);
691
+ };
692
+ }
715
693
  });
716
- var Toast_default = Toast_vue_vue_type_script_setup_true_lang_default;
717
694
  var export_helper_default = (sfc, props) => {
718
- const target = sfc.__vccOpts || sfc;
719
- for (const [key, val] of props) target[key] = val;
720
- return target;
695
+ const target = sfc.__vccOpts || sfc;
696
+ for (const [key, val] of props) target[key] = val;
697
+ return target;
721
698
  };
722
- const _sfc_main$4 = {};
723
- const _hoisted_1$6 = {
724
- xmlns: "http://www.w3.org/2000/svg",
725
- width: "12",
726
- height: "12",
727
- viewBox: "0 0 24 24",
728
- fill: "none",
729
- stroke: "currentColor",
730
- "stoke-width": "1.5",
731
- "stroke-linecap": "round",
732
- "stroke-linejoin": "round"
699
+ var _sfc_main$4 = {};
700
+ var _hoisted_1$6 = {
701
+ xmlns: "http://www.w3.org/2000/svg",
702
+ width: "12",
703
+ height: "12",
704
+ viewBox: "0 0 24 24",
705
+ fill: "none",
706
+ stroke: "currentColor",
707
+ "stoke-width": "1.5",
708
+ "stroke-linecap": "round",
709
+ "stroke-linejoin": "round"
733
710
  };
734
711
  function _sfc_render$4(_ctx, _cache) {
735
- return openBlock(), createElementBlock("svg", _hoisted_1$6, _cache[0] || (_cache[0] = [createElementVNode("line", {
736
- x1: "18",
737
- y1: "6",
738
- x2: "6",
739
- y2: "18"
740
- }, null, -1), createElementVNode("line", {
741
- x1: "6",
742
- y1: "6",
743
- x2: "18",
744
- y2: "18"
745
- }, null, -1)]));
712
+ return openBlock(), createElementBlock("svg", _hoisted_1$6, _cache[0] || (_cache[0] = [createElementVNode("line", {
713
+ x1: "18",
714
+ y1: "6",
715
+ x2: "6",
716
+ y2: "18"
717
+ }, null, -1), createElementVNode("line", {
718
+ x1: "6",
719
+ y1: "6",
720
+ x2: "18",
721
+ y2: "18"
722
+ }, null, -1)]));
746
723
  }
747
724
  var CloseIcon_default = /* @__PURE__ */ export_helper_default(_sfc_main$4, [["render", _sfc_render$4]]);
748
- const _hoisted_1$5 = ["data-visible"];
749
- const _hoisted_2$1 = { class: "sonner-spinner" };
750
- var Loader_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
751
- __name: "Loader",
752
- props: { visible: { type: Boolean } },
753
- setup(__props) {
754
- const bars = Array(12).fill(0);
755
- return (_ctx, _cache) => {
756
- return openBlock(), createElementBlock("div", {
757
- class: "sonner-loading-wrapper",
758
- "data-visible": _ctx.visible
759
- }, [createElementVNode("div", _hoisted_2$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(bars), (bar) => {
760
- return openBlock(), createElementBlock("div", {
761
- key: `spinner-bar-${bar}`,
762
- class: "sonner-loading-bar"
763
- });
764
- }), 128))])], 8, _hoisted_1$5);
765
- };
766
- }
725
+ var _hoisted_1$5 = ["data-visible"];
726
+ var _hoisted_2$1 = { class: "sonner-spinner" };
727
+ var Loader_default = /* @__PURE__ */ defineComponent({
728
+ __name: "Loader",
729
+ props: { visible: { type: Boolean } },
730
+ setup(__props) {
731
+ const bars = Array(12).fill(0);
732
+ return (_ctx, _cache) => {
733
+ return openBlock(), createElementBlock("div", {
734
+ class: "sonner-loading-wrapper",
735
+ "data-visible": _ctx.visible
736
+ }, [createElementVNode("div", _hoisted_2$1, [(openBlock(true), createElementBlock(Fragment, null, renderList(unref(bars), (bar) => {
737
+ return openBlock(), createElementBlock("div", {
738
+ key: `spinner-bar-${bar}`,
739
+ class: "sonner-loading-bar"
740
+ });
741
+ }), 128))])], 8, _hoisted_1$5);
742
+ };
743
+ }
767
744
  });
768
- var Loader_default = Loader_vue_vue_type_script_setup_true_lang_default;
769
- const _sfc_main$3 = {};
770
- const _hoisted_1$4 = {
771
- xmlns: "http://www.w3.org/2000/svg",
772
- viewBox: "0 0 20 20",
773
- fill: "currentColor",
774
- height: "20",
775
- width: "20"
745
+ var _sfc_main$3 = {};
746
+ var _hoisted_1$4 = {
747
+ xmlns: "http://www.w3.org/2000/svg",
748
+ viewBox: "0 0 20 20",
749
+ fill: "currentColor",
750
+ height: "20",
751
+ width: "20"
776
752
  };
777
753
  function _sfc_render$3(_ctx, _cache) {
778
- return openBlock(), createElementBlock("svg", _hoisted_1$4, _cache[0] || (_cache[0] = [createElementVNode("path", {
779
- "fill-rule": "evenodd",
780
- d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",
781
- "clip-rule": "evenodd"
782
- }, null, -1)]));
754
+ return openBlock(), createElementBlock("svg", _hoisted_1$4, _cache[0] || (_cache[0] = [createElementVNode("path", {
755
+ "fill-rule": "evenodd",
756
+ d: "M10 18a8 8 0 100-16 8 8 0 000 16zm3.857-9.809a.75.75 0 00-1.214-.882l-3.483 4.79-1.88-1.88a.75.75 0 10-1.06 1.061l2.5 2.5a.75.75 0 001.137-.089l4-5.5z",
757
+ "clip-rule": "evenodd"
758
+ }, null, -1)]));
783
759
  }
784
760
  var SuccessIcon_default = /* @__PURE__ */ export_helper_default(_sfc_main$3, [["render", _sfc_render$3]]);
785
- const _sfc_main$2 = {};
786
- const _hoisted_1$3 = {
787
- xmlns: "http://www.w3.org/2000/svg",
788
- viewBox: "0 0 20 20",
789
- fill: "currentColor",
790
- height: "20",
791
- width: "20"
761
+ var _sfc_main$2 = {};
762
+ var _hoisted_1$3 = {
763
+ xmlns: "http://www.w3.org/2000/svg",
764
+ viewBox: "0 0 20 20",
765
+ fill: "currentColor",
766
+ height: "20",
767
+ width: "20"
792
768
  };
793
769
  function _sfc_render$2(_ctx, _cache) {
794
- return openBlock(), createElementBlock("svg", _hoisted_1$3, _cache[0] || (_cache[0] = [createElementVNode("path", {
795
- "fill-rule": "evenodd",
796
- d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",
797
- "clip-rule": "evenodd"
798
- }, null, -1)]));
770
+ return openBlock(), createElementBlock("svg", _hoisted_1$3, _cache[0] || (_cache[0] = [createElementVNode("path", {
771
+ "fill-rule": "evenodd",
772
+ d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-7-4a1 1 0 11-2 0 1 1 0 012 0zM9 9a.75.75 0 000 1.5h.253a.25.25 0 01.244.304l-.459 2.066A1.75 1.75 0 0010.747 15H11a.75.75 0 000-1.5h-.253a.25.25 0 01-.244-.304l.459-2.066A1.75 1.75 0 009.253 9H9z",
773
+ "clip-rule": "evenodd"
774
+ }, null, -1)]));
799
775
  }
800
776
  var InfoIcon_default = /* @__PURE__ */ export_helper_default(_sfc_main$2, [["render", _sfc_render$2]]);
801
- const _sfc_main$1 = {};
802
- const _hoisted_1$2 = {
803
- xmlns: "http://www.w3.org/2000/svg",
804
- viewBox: "0 0 24 24",
805
- fill: "currentColor",
806
- height: "20",
807
- width: "20"
777
+ var _sfc_main$1 = {};
778
+ var _hoisted_1$2 = {
779
+ xmlns: "http://www.w3.org/2000/svg",
780
+ viewBox: "0 0 24 24",
781
+ fill: "currentColor",
782
+ height: "20",
783
+ width: "20"
808
784
  };
809
785
  function _sfc_render$1(_ctx, _cache) {
810
- return openBlock(), createElementBlock("svg", _hoisted_1$2, _cache[0] || (_cache[0] = [createElementVNode("path", {
811
- "fill-rule": "evenodd",
812
- d: "M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",
813
- "clip-rule": "evenodd"
814
- }, null, -1)]));
786
+ return openBlock(), createElementBlock("svg", _hoisted_1$2, _cache[0] || (_cache[0] = [createElementVNode("path", {
787
+ "fill-rule": "evenodd",
788
+ d: "M9.401 3.003c1.155-2 4.043-2 5.197 0l7.355 12.748c1.154 2-.29 4.5-2.599 4.5H4.645c-2.309 0-3.752-2.5-2.598-4.5L9.4 3.003zM12 8.25a.75.75 0 01.75.75v3.75a.75.75 0 01-1.5 0V9a.75.75 0 01.75-.75zm0 8.25a.75.75 0 100-1.5.75.75 0 000 1.5z",
789
+ "clip-rule": "evenodd"
790
+ }, null, -1)]));
815
791
  }
816
792
  var WarningIcon_default = /* @__PURE__ */ export_helper_default(_sfc_main$1, [["render", _sfc_render$1]]);
817
- const _sfc_main$5 = {};
818
- const _hoisted_1$1 = {
819
- xmlns: "http://www.w3.org/2000/svg",
820
- viewBox: "0 0 20 20",
821
- fill: "currentColor",
822
- height: "20",
823
- width: "20"
793
+ var _sfc_main = {};
794
+ var _hoisted_1$1 = {
795
+ xmlns: "http://www.w3.org/2000/svg",
796
+ viewBox: "0 0 20 20",
797
+ fill: "currentColor",
798
+ height: "20",
799
+ width: "20"
824
800
  };
825
801
  function _sfc_render(_ctx, _cache) {
826
- return openBlock(), createElementBlock("svg", _hoisted_1$1, _cache[0] || (_cache[0] = [createElementVNode("path", {
827
- "fill-rule": "evenodd",
828
- d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",
829
- "clip-rule": "evenodd"
830
- }, null, -1)]));
802
+ return openBlock(), createElementBlock("svg", _hoisted_1$1, _cache[0] || (_cache[0] = [createElementVNode("path", {
803
+ "fill-rule": "evenodd",
804
+ d: "M18 10a8 8 0 11-16 0 8 8 0 0116 0zm-8-5a.75.75 0 01.75.75v4.5a.75.75 0 01-1.5 0v-4.5A.75.75 0 0110 5zm0 10a1 1 0 100-2 1 1 0 000 2z",
805
+ "clip-rule": "evenodd"
806
+ }, null, -1)]));
831
807
  }
832
- var ErrorIcon_default = /* @__PURE__ */ export_helper_default(_sfc_main$5, [["render", _sfc_render]]);
833
- const _hoisted_1 = ["aria-label"];
834
- const _hoisted_2 = [
835
- "data-sonner-theme",
836
- "dir",
837
- "data-theme",
838
- "data-rich-colors",
839
- "data-y-position",
840
- "data-x-position"
808
+ var ErrorIcon_default = /* @__PURE__ */ export_helper_default(_sfc_main, [["render", _sfc_render]]);
809
+ var _hoisted_1 = ["aria-label"];
810
+ var _hoisted_2 = [
811
+ "data-sonner-theme",
812
+ "dir",
813
+ "data-theme",
814
+ "data-rich-colors",
815
+ "data-y-position",
816
+ "data-x-position"
841
817
  ];
842
- const isClient = typeof window !== "undefined" && typeof document !== "undefined";
818
+ var isClient = typeof window !== "undefined" && typeof document !== "undefined";
843
819
  function getDocumentDirection() {
844
- if (typeof window === "undefined") return "ltr";
845
- if (typeof document === "undefined") return "ltr";
846
- const dirAttribute = document.documentElement.getAttribute("dir");
847
- if (dirAttribute === "auto" || !dirAttribute) return window.getComputedStyle(document.documentElement).direction;
848
- return dirAttribute;
820
+ if (typeof window === "undefined") return "ltr";
821
+ if (typeof document === "undefined") return "ltr";
822
+ const dirAttribute = document.documentElement.getAttribute("dir");
823
+ if (dirAttribute === "auto" || !dirAttribute) return window.getComputedStyle(document.documentElement).direction;
824
+ return dirAttribute;
849
825
  }
850
- var Toaster_vue_vue_type_script_setup_true_lang_default = /* @__PURE__ */ defineComponent({
851
- name: "Toaster",
852
- inheritAttrs: false,
853
- __name: "Toaster",
854
- props: {
855
- id: {},
856
- invert: {
857
- type: Boolean,
858
- default: false
859
- },
860
- theme: { default: "light" },
861
- position: { default: "bottom-right" },
862
- closeButtonPosition: { default: "top-left" },
863
- hotkey: { default: () => ["altKey", "KeyT"] },
864
- richColors: {
865
- type: Boolean,
866
- default: false
867
- },
868
- expand: {
869
- type: Boolean,
870
- default: false
871
- },
872
- duration: {},
873
- gap: { default: GAP },
874
- visibleToasts: { default: VISIBLE_TOASTS_AMOUNT },
875
- closeButton: {
876
- type: Boolean,
877
- default: false
878
- },
879
- toastOptions: { default: () => ({}) },
880
- class: { default: "" },
881
- style: {},
882
- offset: { default: VIEWPORT_OFFSET },
883
- mobileOffset: { default: MOBILE_VIEWPORT_OFFSET },
884
- dir: { default: "auto" },
885
- swipeDirections: {},
886
- icons: {},
887
- containerAriaLabel: { default: "Notifications" }
888
- },
889
- setup(__props) {
890
- const props = __props;
891
- const attrs = useAttrs();
892
- const toasts = ref([]);
893
- const filteredToastsById = computed(() => {
894
- if (props.id) return toasts.value.filter((toast$1) => toast$1.toasterId === props.id);
895
- return toasts.value.filter((toast$1) => !toast$1.toasterId);
896
- });
897
- function filteredToasts(pos, index) {
898
- return filteredToastsById.value.filter((toast$1) => !toast$1.position && index === 0 || toast$1.position === pos);
899
- }
900
- const possiblePositions = computed(() => {
901
- const posList = filteredToastsById.value.filter((toast$1) => toast$1.position).map((toast$1) => toast$1.position);
902
- return posList.length > 0 ? Array.from(new Set([props.position].concat(posList))) : [props.position];
903
- });
904
- const toastsByPosition = computed(() => {
905
- const result = {};
906
- possiblePositions.value.forEach((pos) => {
907
- result[pos] = toasts.value.filter((t) => t.position === pos);
908
- });
909
- return result;
910
- });
911
- const heights = ref([]);
912
- const expanded = ref({});
913
- const interacting = ref(false);
914
- watchEffect(() => {
915
- possiblePositions.value.forEach((pos) => {
916
- if (!(pos in expanded.value)) expanded.value[pos] = false;
917
- });
918
- });
919
- const actualTheme = ref(props.theme !== "system" ? props.theme : typeof window !== "undefined" ? window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : "light");
920
- const listRef = ref(null);
921
- const lastFocusedElementRef = ref(null);
922
- const isFocusWithinRef = ref(false);
923
- const hotkeyLabel = props.hotkey.join("+").replace(/Key/g, "").replace(/Digit/g, "");
924
- function removeToast(toastToRemove) {
925
- var _a;
926
- if (!((_a = toasts.value.find((toast$1) => toast$1.id === toastToRemove.id)) == null ? void 0 : _a.delete)) ToastState.dismiss(toastToRemove.id);
927
- toasts.value = toasts.value.filter(({ id }) => id !== toastToRemove.id);
928
- setTimeout(() => {
929
- if (!toasts.value.find((t) => t.id === toastToRemove.id)) heights.value = heights.value.filter((h) => h.toastId !== toastToRemove.id);
930
- }, TIME_BEFORE_UNMOUNT + 50);
931
- }
932
- function onBlur(event) {
933
- var _a, _b;
934
- if (isFocusWithinRef.value && !((_b = (_a = event.currentTarget) == null ? void 0 : _a.contains) == null ? void 0 : _b.call(_a, event.relatedTarget))) {
935
- isFocusWithinRef.value = false;
936
- if (lastFocusedElementRef.value) {
937
- lastFocusedElementRef.value.focus({ preventScroll: true });
938
- lastFocusedElementRef.value = null;
939
- }
940
- }
941
- }
942
- function onFocus(event) {
943
- const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === "false";
944
- if (isNotDismissible) return;
945
- if (!isFocusWithinRef.value) {
946
- isFocusWithinRef.value = true;
947
- lastFocusedElementRef.value = event.relatedTarget;
948
- }
949
- }
950
- function onPointerDown(event) {
951
- if (event.target) {
952
- const isNotDismissible = event.target instanceof HTMLElement && event.target.dataset.dismissible === "false";
953
- if (isNotDismissible) return;
954
- }
955
- interacting.value = true;
956
- }
957
- watchEffect((onInvalidate) => {
958
- const unsubscribe = ToastState.subscribe((toast$1) => {
959
- if (toast$1.dismiss) {
960
- requestAnimationFrame(() => {
961
- toasts.value = toasts.value.map((t) => t.id === toast$1.id ? {
962
- ...t,
963
- delete: true
964
- } : t);
965
- });
966
- return;
967
- }
968
- nextTick(() => {
969
- const indexOfExistingToast = toasts.value.findIndex((t) => t.id === toast$1.id);
970
- if (indexOfExistingToast !== -1) toasts.value = [
971
- ...toasts.value.slice(0, indexOfExistingToast),
972
- {
973
- ...toasts.value[indexOfExistingToast],
974
- ...toast$1
975
- },
976
- ...toasts.value.slice(indexOfExistingToast + 1)
977
- ];
978
- else toasts.value = [toast$1, ...toasts.value];
979
- });
980
- });
981
- onInvalidate(unsubscribe);
982
- });
983
- watchEffect((onInvalidate) => {
984
- if (typeof window === "undefined") return;
985
- if (props.theme !== "system") {
986
- actualTheme.value = props.theme;
987
- return;
988
- }
989
- const darkMediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
990
- const updateTheme = (matches) => {
991
- actualTheme.value = matches ? "dark" : "light";
992
- };
993
- updateTheme(darkMediaQuery.matches);
994
- const handler = (event) => {
995
- updateTheme(event.matches);
996
- };
997
- try {
998
- darkMediaQuery.addEventListener("change", handler);
999
- } catch {
1000
- darkMediaQuery.addListener(handler);
1001
- }
1002
- onInvalidate(() => {
1003
- try {
1004
- darkMediaQuery.removeEventListener("change", handler);
1005
- } catch {
1006
- darkMediaQuery.removeListener(handler);
1007
- }
1008
- });
1009
- });
1010
- watchEffect(() => {
1011
- if (listRef.value && lastFocusedElementRef.value) {
1012
- lastFocusedElementRef.value.focus({ preventScroll: true });
1013
- lastFocusedElementRef.value = null;
1014
- isFocusWithinRef.value = false;
1015
- }
1016
- });
1017
- watchEffect(() => {
1018
- if (toasts.value.length <= 1) Object.keys(expanded.value).forEach((pos) => {
1019
- expanded.value[pos] = false;
1020
- });
1021
- });
1022
- watchEffect((onInvalidate) => {
1023
- function handleKeyDown(event) {
1024
- const isHotkeyPressed = props.hotkey.every((key) => event[key] || event.code === key);
1025
- const listRefItem = Array.isArray(listRef.value) ? listRef.value[0] : listRef.value;
1026
- if (isHotkeyPressed) {
1027
- possiblePositions.value.forEach((pos) => {
1028
- expanded.value[pos] = true;
1029
- });
1030
- listRefItem == null ? void 0 : listRefItem.focus();
1031
- }
1032
- const isItemActive = document.activeElement === listRef.value || (listRefItem == null ? void 0 : listRefItem.contains(document.activeElement));
1033
- if (event.code === "Escape" && isItemActive) possiblePositions.value.forEach((pos) => {
1034
- expanded.value[pos] = false;
1035
- });
1036
- }
1037
- if (!isClient) return;
1038
- document.addEventListener("keydown", handleKeyDown);
1039
- onInvalidate(() => {
1040
- document.removeEventListener("keydown", handleKeyDown);
1041
- });
1042
- });
1043
- function handleMouseEnter(event) {
1044
- const target = event.currentTarget;
1045
- const position = target.getAttribute("data-y-position") + "-" + target.getAttribute("data-x-position");
1046
- expanded.value[position] = true;
1047
- }
1048
- function handleMouseLeave(event) {
1049
- if (!interacting.value) {
1050
- const target = event.currentTarget;
1051
- const position = target.getAttribute("data-y-position") + "-" + target.getAttribute("data-x-position");
1052
- expanded.value[position] = false;
1053
- }
1054
- }
1055
- function handleDragEnd() {
1056
- Object.keys(expanded.value).forEach((pos) => {
1057
- expanded.value[pos] = false;
1058
- });
1059
- }
1060
- function handlePointerUp() {
1061
- interacting.value = false;
1062
- }
1063
- function updateHeights(h) {
1064
- heights.value = h;
1065
- }
1066
- function updateHeight(h) {
1067
- const index = heights.value.findIndex((item) => item.toastId === h.toastId);
1068
- if (index !== -1) heights.value[index] = h;
1069
- else {
1070
- const samePositionIndex = heights.value.findIndex((item) => item.position === h.position);
1071
- if (samePositionIndex !== -1) heights.value.splice(samePositionIndex, 0, h);
1072
- else heights.value.unshift(h);
1073
- }
1074
- }
1075
- return (_ctx, _cache) => {
1076
- return openBlock(), createElementBlock(Fragment, null, [createCommentVNode(" Remove item from normal navigation flow, only available via hotkey "), createElementVNode("section", {
1077
- "aria-label": `${_ctx.containerAriaLabel} ${unref(hotkeyLabel)}`,
1078
- tabIndex: -1,
1079
- "aria-live": "polite",
1080
- "aria-relevant": "additions text",
1081
- "aria-atomic": "false"
1082
- }, [(openBlock(true), createElementBlock(Fragment, null, renderList(possiblePositions.value, (pos, index) => {
1083
- var _a;
1084
- return openBlock(), createElementBlock("ol", mergeProps({
1085
- key: pos,
1086
- ref_for: true,
1087
- ref_key: "listRef",
1088
- ref: listRef,
1089
- "data-sonner-toaster": "",
1090
- "data-sonner-theme": actualTheme.value,
1091
- class: props.class,
1092
- dir: _ctx.dir === "auto" ? getDocumentDirection() : _ctx.dir,
1093
- tabIndex: -1,
1094
- "data-theme": _ctx.theme,
1095
- "data-rich-colors": _ctx.richColors,
1096
- "data-y-position": pos.split("-")[0],
1097
- "data-x-position": pos.split("-")[1],
1098
- style: {
1099
- "--front-toast-height": `${((_a = heights.value[0]) == null ? void 0 : _a.height) || 0}px`,
1100
- "--width": `${unref(TOAST_WIDTH)}px`,
1101
- "--gap": `${_ctx.gap}px`,
1102
- ..._ctx.style,
1103
- ...unref(attrs).style,
1104
- ...unref(assignOffset)(_ctx.offset, _ctx.mobileOffset)
1105
- }
1106
- }, { ref_for: true }, _ctx.$attrs, {
1107
- onBlur,
1108
- onFocus,
1109
- onMouseenter: handleMouseEnter,
1110
- onMousemove: handleMouseEnter,
1111
- onMouseleave: handleMouseLeave,
1112
- onDragend: handleDragEnd,
1113
- onPointerdown: onPointerDown,
1114
- onPointerup: handlePointerUp
1115
- }), [(openBlock(true), createElementBlock(Fragment, null, renderList(filteredToasts(pos, index), (toast$1, idx) => {
1116
- var _a2, _b, _c, _d, _e, _f, _g, _h, _i, _j, _k;
1117
- return openBlock(), createBlock(Toast_default, {
1118
- key: toast$1.id,
1119
- heights: heights.value,
1120
- icons: _ctx.icons,
1121
- index: idx,
1122
- toast: toast$1,
1123
- defaultRichColors: _ctx.richColors,
1124
- duration: ((_a2 = _ctx.toastOptions) == null ? void 0 : _a2.duration) ?? _ctx.duration,
1125
- class: normalizeClass(((_b = _ctx.toastOptions) == null ? void 0 : _b.class) ?? ""),
1126
- descriptionClass: (_c = _ctx.toastOptions) == null ? void 0 : _c.descriptionClass,
1127
- invert: _ctx.invert,
1128
- visibleToasts: _ctx.visibleToasts,
1129
- closeButton: ((_d = _ctx.toastOptions) == null ? void 0 : _d.closeButton) ?? _ctx.closeButton,
1130
- interacting: interacting.value,
1131
- position: pos,
1132
- closeButtonPosition: ((_e = _ctx.toastOptions) == null ? void 0 : _e.closeButtonPosition) ?? _ctx.closeButtonPosition,
1133
- style: normalizeStyle((_f = _ctx.toastOptions) == null ? void 0 : _f.style),
1134
- unstyled: (_g = _ctx.toastOptions) == null ? void 0 : _g.unstyled,
1135
- classes: (_h = _ctx.toastOptions) == null ? void 0 : _h.classes,
1136
- cancelButtonStyle: (_i = _ctx.toastOptions) == null ? void 0 : _i.cancelButtonStyle,
1137
- actionButtonStyle: (_j = _ctx.toastOptions) == null ? void 0 : _j.actionButtonStyle,
1138
- "close-button-aria-label": (_k = _ctx.toastOptions) == null ? void 0 : _k.closeButtonAriaLabel,
1139
- toasts: toastsByPosition.value[pos],
1140
- expandByDefault: _ctx.expand,
1141
- gap: _ctx.gap,
1142
- expanded: expanded.value[pos] || false,
1143
- swipeDirections: props.swipeDirections,
1144
- "onUpdate:heights": updateHeights,
1145
- "onUpdate:height": updateHeight,
1146
- onRemoveToast: removeToast
1147
- }, {
1148
- "close-icon": withCtx(() => [renderSlot(_ctx.$slots, "close-icon", {}, () => [createVNode(CloseIcon_default)])]),
1149
- "loading-icon": withCtx(() => [renderSlot(_ctx.$slots, "loading-icon", {}, () => [createVNode(Loader_default, { visible: toast$1.type === "loading" }, null, 8, ["visible"])])]),
1150
- "success-icon": withCtx(() => [renderSlot(_ctx.$slots, "success-icon", {}, () => [createVNode(SuccessIcon_default)])]),
1151
- "error-icon": withCtx(() => [renderSlot(_ctx.$slots, "error-icon", {}, () => [createVNode(ErrorIcon_default)])]),
1152
- "warning-icon": withCtx(() => [renderSlot(_ctx.$slots, "warning-icon", {}, () => [createVNode(WarningIcon_default)])]),
1153
- "info-icon": withCtx(() => [renderSlot(_ctx.$slots, "info-icon", {}, () => [createVNode(InfoIcon_default)])]),
1154
- _: 2
1155
- }, 1032, [
1156
- "heights",
1157
- "icons",
1158
- "index",
1159
- "toast",
1160
- "defaultRichColors",
1161
- "duration",
1162
- "class",
1163
- "descriptionClass",
1164
- "invert",
1165
- "visibleToasts",
1166
- "closeButton",
1167
- "interacting",
1168
- "position",
1169
- "closeButtonPosition",
1170
- "style",
1171
- "unstyled",
1172
- "classes",
1173
- "cancelButtonStyle",
1174
- "actionButtonStyle",
1175
- "close-button-aria-label",
1176
- "toasts",
1177
- "expandByDefault",
1178
- "gap",
1179
- "expanded",
1180
- "swipeDirections"
1181
- ]);
1182
- }), 128))], 16, _hoisted_2);
1183
- }), 128))], 8, _hoisted_1)], 2112);
1184
- };
1185
- }
826
+ var Toaster_default = /* @__PURE__ */ defineComponent({
827
+ name: "Toaster",
828
+ inheritAttrs: false,
829
+ __name: "Toaster",
830
+ props: {
831
+ id: {},
832
+ invert: {
833
+ type: Boolean,
834
+ default: false
835
+ },
836
+ theme: { default: "light" },
837
+ position: { default: "bottom-right" },
838
+ closeButtonPosition: { default: "top-left" },
839
+ hotkey: { default: () => ["altKey", "KeyT"] },
840
+ richColors: {
841
+ type: Boolean,
842
+ default: false
843
+ },
844
+ expand: {
845
+ type: Boolean,
846
+ default: false
847
+ },
848
+ duration: {},
849
+ gap: { default: GAP },
850
+ visibleToasts: { default: VISIBLE_TOASTS_AMOUNT },
851
+ closeButton: {
852
+ type: Boolean,
853
+ default: false
854
+ },
855
+ toastOptions: { default: () => ({}) },
856
+ class: { default: "" },
857
+ style: {},
858
+ offset: { default: VIEWPORT_OFFSET },
859
+ mobileOffset: { default: MOBILE_VIEWPORT_OFFSET },
860
+ dir: { default: "auto" },
861
+ swipeDirections: {},
862
+ icons: {},
863
+ containerAriaLabel: { default: "Notifications" }
864
+ },
865
+ setup(__props) {
866
+ const props = __props;
867
+ const attrs = useAttrs();
868
+ const toasts = ref([]);
869
+ const filteredToastsById = computed(() => {
870
+ if (props.id) return toasts.value.filter((toast$1) => toast$1.toasterId === props.id);
871
+ return toasts.value.filter((toast$1) => !toast$1.toasterId);
872
+ });
873
+ function filteredToasts(pos, index) {
874
+ return filteredToastsById.value.filter((toast$1) => !toast$1.position && index === 0 || toast$1.position === pos);
875
+ }
876
+ const possiblePositions = computed(() => {
877
+ const posList = filteredToastsById.value.filter((toast$1) => toast$1.position).map((toast$1) => toast$1.position);
878
+ return posList.length > 0 ? Array.from(new Set([props.position].concat(posList))) : [props.position];
879
+ });
880
+ const toastsByPosition = computed(() => {
881
+ const result = {};
882
+ possiblePositions.value.forEach((pos) => {
883
+ result[pos] = toasts.value.filter((t) => t.position === pos);
884
+ });
885
+ return result;
886
+ });
887
+ const heights = ref([]);
888
+ const expanded = ref({});
889
+ const interacting = ref(false);
890
+ watchEffect(() => {
891
+ possiblePositions.value.forEach((pos) => {
892
+ if (!(pos in expanded.value)) expanded.value[pos] = false;
893
+ });
894
+ });
895
+ const actualTheme = ref(props.theme !== "system" ? props.theme : typeof window !== "undefined" ? window.matchMedia && window.matchMedia("(prefers-color-scheme: dark)").matches ? "dark" : "light" : "light");
896
+ const listRef = ref(null);
897
+ const lastFocusedElementRef = ref(null);
898
+ const isFocusWithinRef = ref(false);
899
+ const hotkeyLabel = props.hotkey.join("+").replace(/Key/g, "").replace(/Digit/g, "");
900
+ function removeToast(toastToRemove) {
901
+ if (!toasts.value.find((toast$1) => toast$1.id === toastToRemove.id)?.delete) ToastState.dismiss(toastToRemove.id);
902
+ toasts.value = toasts.value.filter(({ id }) => id !== toastToRemove.id);
903
+ setTimeout(() => {
904
+ if (!toasts.value.find((t) => t.id === toastToRemove.id)) heights.value = heights.value.filter((h) => h.toastId !== toastToRemove.id);
905
+ }, TIME_BEFORE_UNMOUNT + 50);
906
+ }
907
+ function onBlur(event) {
908
+ if (isFocusWithinRef.value && !event.currentTarget?.contains?.(event.relatedTarget)) {
909
+ isFocusWithinRef.value = false;
910
+ if (lastFocusedElementRef.value) {
911
+ lastFocusedElementRef.value.focus({ preventScroll: true });
912
+ lastFocusedElementRef.value = null;
913
+ }
914
+ }
915
+ }
916
+ function onFocus(event) {
917
+ if (event.target instanceof HTMLElement && event.target.dataset.dismissible === "false") return;
918
+ if (!isFocusWithinRef.value) {
919
+ isFocusWithinRef.value = true;
920
+ lastFocusedElementRef.value = event.relatedTarget;
921
+ }
922
+ }
923
+ function onPointerDown(event) {
924
+ if (event.target) {
925
+ if (event.target instanceof HTMLElement && event.target.dataset.dismissible === "false") return;
926
+ }
927
+ interacting.value = true;
928
+ }
929
+ watchEffect((onInvalidate) => {
930
+ onInvalidate(ToastState.subscribe((toast$1) => {
931
+ if (toast$1.dismiss) {
932
+ requestAnimationFrame(() => {
933
+ toasts.value = toasts.value.map((t) => t.id === toast$1.id ? {
934
+ ...t,
935
+ delete: true
936
+ } : t);
937
+ });
938
+ return;
939
+ }
940
+ nextTick(() => {
941
+ const indexOfExistingToast = toasts.value.findIndex((t) => t.id === toast$1.id);
942
+ if (indexOfExistingToast !== -1) toasts.value = [
943
+ ...toasts.value.slice(0, indexOfExistingToast),
944
+ {
945
+ ...toasts.value[indexOfExistingToast],
946
+ ...toast$1
947
+ },
948
+ ...toasts.value.slice(indexOfExistingToast + 1)
949
+ ];
950
+ else toasts.value = [toast$1, ...toasts.value];
951
+ });
952
+ }));
953
+ });
954
+ watchEffect((onInvalidate) => {
955
+ if (typeof window === "undefined") return;
956
+ /**
957
+ * If the theme prop is explicitly set (e.g., 'light' or 'dark'),
958
+ * use it directly and stop watching for system preference.
959
+ */
960
+ if (props.theme !== "system") {
961
+ actualTheme.value = props.theme;
962
+ return;
963
+ }
964
+ /**
965
+ * Handle "system" theme:
966
+ * Watch the user's OS-level color scheme preference and
967
+ * apply 'dark' or 'light' accordingly.
968
+ */
969
+ const darkMediaQuery = window.matchMedia("(prefers-color-scheme: dark)");
970
+ /**
971
+ * Helper function to update the actualTheme value
972
+ * based on current media query match.
973
+ *
974
+ * @param {boolean} matches - true if dark mode is preferred
975
+ */
976
+ const updateTheme = (matches) => {
977
+ actualTheme.value = matches ? "dark" : "light";
978
+ };
979
+ updateTheme(darkMediaQuery.matches);
980
+ /**
981
+ * Media query listener for changes to system preference
982
+ * Compatible with modern browsers and legacy Safari.
983
+ */
984
+ const handler = (event) => {
985
+ updateTheme(event.matches);
986
+ };
987
+ try {
988
+ darkMediaQuery.addEventListener("change", handler);
989
+ } catch {
990
+ darkMediaQuery.addListener(handler);
991
+ }
992
+ onInvalidate(() => {
993
+ try {
994
+ darkMediaQuery.removeEventListener("change", handler);
995
+ } catch {
996
+ darkMediaQuery.removeListener(handler);
997
+ }
998
+ });
999
+ });
1000
+ watchEffect(() => {
1001
+ if (listRef.value && lastFocusedElementRef.value) {
1002
+ lastFocusedElementRef.value.focus({ preventScroll: true });
1003
+ lastFocusedElementRef.value = null;
1004
+ isFocusWithinRef.value = false;
1005
+ }
1006
+ });
1007
+ watchEffect(() => {
1008
+ if (toasts.value.length <= 1) Object.keys(expanded.value).forEach((pos) => {
1009
+ expanded.value[pos] = false;
1010
+ });
1011
+ });
1012
+ watchEffect((onInvalidate) => {
1013
+ function handleKeyDown(event) {
1014
+ const isHotkeyPressed = props.hotkey.every((key) => event[key] || event.code === key);
1015
+ const listRefItem = Array.isArray(listRef.value) ? listRef.value[0] : listRef.value;
1016
+ if (isHotkeyPressed) {
1017
+ possiblePositions.value.forEach((pos) => {
1018
+ expanded.value[pos] = true;
1019
+ });
1020
+ listRefItem?.focus();
1021
+ }
1022
+ const isItemActive = document.activeElement === listRef.value || listRefItem?.contains(document.activeElement);
1023
+ if (event.code === "Escape" && isItemActive) possiblePositions.value.forEach((pos) => {
1024
+ expanded.value[pos] = false;
1025
+ });
1026
+ }
1027
+ if (!isClient) return;
1028
+ document.addEventListener("keydown", handleKeyDown);
1029
+ onInvalidate(() => {
1030
+ document.removeEventListener("keydown", handleKeyDown);
1031
+ });
1032
+ });
1033
+ function handleMouseEnter(event) {
1034
+ const target = event.currentTarget;
1035
+ const position = target.getAttribute("data-y-position") + "-" + target.getAttribute("data-x-position");
1036
+ expanded.value[position] = true;
1037
+ }
1038
+ function handleMouseLeave(event) {
1039
+ if (!interacting.value) {
1040
+ const target = event.currentTarget;
1041
+ const position = target.getAttribute("data-y-position") + "-" + target.getAttribute("data-x-position");
1042
+ expanded.value[position] = false;
1043
+ }
1044
+ }
1045
+ function handleDragEnd() {
1046
+ Object.keys(expanded.value).forEach((pos) => {
1047
+ expanded.value[pos] = false;
1048
+ });
1049
+ }
1050
+ function handlePointerUp() {
1051
+ interacting.value = false;
1052
+ }
1053
+ function updateHeights(h) {
1054
+ heights.value = h;
1055
+ }
1056
+ function updateHeight(h) {
1057
+ const index = heights.value.findIndex((item) => item.toastId === h.toastId);
1058
+ if (index !== -1) heights.value[index] = h;
1059
+ else {
1060
+ const samePositionIndex = heights.value.findIndex((item) => item.position === h.position);
1061
+ if (samePositionIndex !== -1) heights.value.splice(samePositionIndex, 0, h);
1062
+ else heights.value.unshift(h);
1063
+ }
1064
+ }
1065
+ return (_ctx, _cache) => {
1066
+ return openBlock(), createElementBlock(Fragment, null, [createCommentVNode(" Remove item from normal navigation flow, only available via hotkey "), createElementVNode("section", {
1067
+ "aria-label": `${_ctx.containerAriaLabel} ${unref(hotkeyLabel)}`,
1068
+ tabIndex: -1,
1069
+ "aria-live": "polite",
1070
+ "aria-relevant": "additions text",
1071
+ "aria-atomic": "false"
1072
+ }, [(openBlock(true), createElementBlock(Fragment, null, renderList(possiblePositions.value, (pos, index) => {
1073
+ return openBlock(), createElementBlock("ol", mergeProps({
1074
+ key: pos,
1075
+ ref_for: true,
1076
+ ref_key: "listRef",
1077
+ ref: listRef,
1078
+ "data-sonner-toaster": "",
1079
+ "data-sonner-theme": actualTheme.value,
1080
+ class: props.class,
1081
+ dir: _ctx.dir === "auto" ? getDocumentDirection() : _ctx.dir,
1082
+ tabIndex: -1,
1083
+ "data-theme": _ctx.theme,
1084
+ "data-rich-colors": _ctx.richColors,
1085
+ "data-y-position": pos.split("-")[0],
1086
+ "data-x-position": pos.split("-")[1],
1087
+ style: {
1088
+ "--front-toast-height": `${heights.value[0]?.height || 0}px`,
1089
+ "--width": `${unref(TOAST_WIDTH)}px`,
1090
+ "--gap": `${_ctx.gap}px`,
1091
+ ..._ctx.style,
1092
+ ...unref(attrs).style,
1093
+ ...unref(assignOffset)(_ctx.offset, _ctx.mobileOffset)
1094
+ }
1095
+ }, { ref_for: true }, _ctx.$attrs, {
1096
+ onBlur,
1097
+ onFocus,
1098
+ onMouseenter: handleMouseEnter,
1099
+ onMousemove: handleMouseEnter,
1100
+ onMouseleave: handleMouseLeave,
1101
+ onDragend: handleDragEnd,
1102
+ onPointerdown: onPointerDown,
1103
+ onPointerup: handlePointerUp
1104
+ }), [(openBlock(true), createElementBlock(Fragment, null, renderList(filteredToasts(pos, index), (toast$1, idx) => {
1105
+ return openBlock(), createBlock(Toast_default, {
1106
+ key: toast$1.id,
1107
+ heights: heights.value,
1108
+ icons: _ctx.icons,
1109
+ index: idx,
1110
+ toast: toast$1,
1111
+ defaultRichColors: _ctx.richColors,
1112
+ duration: _ctx.toastOptions?.duration ?? _ctx.duration,
1113
+ class: normalizeClass(_ctx.toastOptions?.class ?? ""),
1114
+ descriptionClass: _ctx.toastOptions?.descriptionClass,
1115
+ invert: _ctx.invert,
1116
+ visibleToasts: _ctx.visibleToasts,
1117
+ closeButton: _ctx.toastOptions?.closeButton ?? _ctx.closeButton,
1118
+ interacting: interacting.value,
1119
+ position: pos,
1120
+ closeButtonPosition: _ctx.toastOptions?.closeButtonPosition ?? _ctx.closeButtonPosition,
1121
+ style: normalizeStyle(_ctx.toastOptions?.style),
1122
+ unstyled: _ctx.toastOptions?.unstyled,
1123
+ classes: _ctx.toastOptions?.classes,
1124
+ cancelButtonStyle: _ctx.toastOptions?.cancelButtonStyle,
1125
+ actionButtonStyle: _ctx.toastOptions?.actionButtonStyle,
1126
+ "close-button-aria-label": _ctx.toastOptions?.closeButtonAriaLabel,
1127
+ toasts: toastsByPosition.value[pos],
1128
+ expandByDefault: _ctx.expand,
1129
+ gap: _ctx.gap,
1130
+ expanded: expanded.value[pos] || false,
1131
+ swipeDirections: props.swipeDirections,
1132
+ "onUpdate:heights": updateHeights,
1133
+ "onUpdate:height": updateHeight,
1134
+ onRemoveToast: removeToast
1135
+ }, {
1136
+ "close-icon": withCtx(() => [renderSlot(_ctx.$slots, "close-icon", {}, () => [createVNode(CloseIcon_default)])]),
1137
+ "loading-icon": withCtx(() => [renderSlot(_ctx.$slots, "loading-icon", {}, () => [createVNode(Loader_default, { visible: toast$1.type === "loading" }, null, 8, ["visible"])])]),
1138
+ "success-icon": withCtx(() => [renderSlot(_ctx.$slots, "success-icon", {}, () => [createVNode(SuccessIcon_default)])]),
1139
+ "error-icon": withCtx(() => [renderSlot(_ctx.$slots, "error-icon", {}, () => [createVNode(ErrorIcon_default)])]),
1140
+ "warning-icon": withCtx(() => [renderSlot(_ctx.$slots, "warning-icon", {}, () => [createVNode(WarningIcon_default)])]),
1141
+ "info-icon": withCtx(() => [renderSlot(_ctx.$slots, "info-icon", {}, () => [createVNode(InfoIcon_default)])]),
1142
+ _: 2
1143
+ }, 1032, [
1144
+ "heights",
1145
+ "icons",
1146
+ "index",
1147
+ "toast",
1148
+ "defaultRichColors",
1149
+ "duration",
1150
+ "class",
1151
+ "descriptionClass",
1152
+ "invert",
1153
+ "visibleToasts",
1154
+ "closeButton",
1155
+ "interacting",
1156
+ "position",
1157
+ "closeButtonPosition",
1158
+ "style",
1159
+ "unstyled",
1160
+ "classes",
1161
+ "cancelButtonStyle",
1162
+ "actionButtonStyle",
1163
+ "close-button-aria-label",
1164
+ "toasts",
1165
+ "expandByDefault",
1166
+ "gap",
1167
+ "expanded",
1168
+ "swipeDirections"
1169
+ ]);
1170
+ }), 128))], 16, _hoisted_2);
1171
+ }), 128))], 8, _hoisted_1)], 2112);
1172
+ };
1173
+ }
1186
1174
  });
1187
- var Toaster_default = Toaster_vue_vue_type_script_setup_true_lang_default;
1188
- const _sfc_main = /* @__PURE__ */ defineComponent({
1189
- __name: "sonner",
1190
- props: {
1191
- id: {},
1192
- invert: { type: Boolean },
1193
- theme: {},
1194
- position: {},
1195
- closeButtonPosition: {},
1196
- hotkey: {},
1197
- richColors: { type: Boolean },
1198
- expand: { type: Boolean },
1199
- duration: {},
1200
- gap: {},
1201
- visibleToasts: {},
1202
- closeButton: { type: Boolean },
1203
- toastOptions: {},
1204
- class: {},
1205
- style: {},
1206
- offset: {},
1207
- mobileOffset: {},
1208
- dir: {},
1209
- swipeDirections: {},
1210
- icons: {},
1211
- containerAriaLabel: {}
1212
- },
1213
- setup(__props) {
1214
- const props = __props;
1215
- return (_ctx, _cache) => {
1216
- return openBlock(), createBlock(unref(Toaster_default), normalizeProps(guardReactiveProps(props)), null, 16);
1217
- };
1218
- }
1175
+ //#endregion
1176
+ //#region src/components/sonner/sonner.vue
1177
+ var sonner_default = /* @__PURE__ */ defineComponent({
1178
+ __name: "sonner",
1179
+ props: {
1180
+ id: {},
1181
+ invert: { type: Boolean },
1182
+ theme: {},
1183
+ position: {},
1184
+ closeButtonPosition: {},
1185
+ hotkey: {},
1186
+ richColors: { type: Boolean },
1187
+ expand: { type: Boolean },
1188
+ duration: {},
1189
+ gap: {},
1190
+ visibleToasts: {},
1191
+ closeButton: { type: Boolean },
1192
+ toastOptions: {},
1193
+ class: {},
1194
+ style: {},
1195
+ offset: {},
1196
+ mobileOffset: {},
1197
+ dir: {},
1198
+ swipeDirections: {},
1199
+ icons: {},
1200
+ containerAriaLabel: {}
1201
+ },
1202
+ setup(__props) {
1203
+ const props = __props;
1204
+ return (_ctx, _cache) => {
1205
+ return openBlock(), createBlock(unref(Toaster_default), normalizeProps(guardReactiveProps(props)), null, 16);
1206
+ };
1207
+ }
1219
1208
  });
1220
- export {
1221
- _sfc_main as _,
1222
- toast as t
1223
- };
1209
+ //#endregion
1210
+ export { toast as n, sonner_default as t };