@youcan/celeste 0.6.97 → 0.6.98

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