@spark-ui/components 13.1.3 → 13.1.5

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 (354) hide show
  1. package/dist/Button-B6rA3-e5.js +2 -0
  2. package/dist/{Button-C3xHNaGl.js.map → Button-B6rA3-e5.js.map} +1 -1
  3. package/dist/{Button-D32Avk2j.mjs → Button-C3C0aixy.mjs} +4 -4
  4. package/dist/{Button-D32Avk2j.mjs.map → Button-C3C0aixy.mjs.map} +1 -1
  5. package/dist/DialogContent.styles-B5pR8ECK.js +2 -0
  6. package/dist/{DialogContent.styles-BrhKaHc_.js.map → DialogContent.styles-B5pR8ECK.js.map} +1 -1
  7. package/dist/{DialogContent.styles-WGWJS9dj.mjs → DialogContent.styles-_lRDsl8c.mjs} +4 -4
  8. package/dist/{DialogContent.styles-WGWJS9dj.mjs.map → DialogContent.styles-_lRDsl8c.mjs.map} +1 -1
  9. package/dist/Icon-CF0W0LKr.js +2 -0
  10. package/dist/{Icon-Bf0XrmiR.js.map → Icon-CF0W0LKr.js.map} +1 -1
  11. package/dist/{Icon-D1RueiPY.mjs → Icon-Ck-dhfLd.mjs} +6 -6
  12. package/dist/{Icon-D1RueiPY.mjs.map → Icon-Ck-dhfLd.mjs.map} +1 -1
  13. package/dist/{IconButton-BY3gYXtU.mjs → IconButton-C62-axzv.mjs} +6 -6
  14. package/dist/{IconButton-BY3gYXtU.mjs.map → IconButton-C62-axzv.mjs.map} +1 -1
  15. package/dist/IconButton-D3g86WpZ.js +2 -0
  16. package/dist/{IconButton-Bf-EDzpI.js.map → IconButton-D3g86WpZ.js.map} +1 -1
  17. package/dist/Slot-D2Bbf8Gw.mjs +14 -0
  18. package/dist/{Slot-C98rL4yy.mjs.map → Slot-D2Bbf8Gw.mjs.map} +1 -1
  19. package/dist/Slot-DQ8z2zsy.js +2 -0
  20. package/dist/{Slot-ghrohQLA.js.map → Slot-DQ8z2zsy.js.map} +1 -1
  21. package/dist/Spinner-_Kffli3B.js +2 -0
  22. package/dist/{Spinner-DK8VEsaR.js.map → Spinner-_Kffli3B.js.map} +1 -1
  23. package/dist/{Spinner-CYL5kyzM.mjs → Spinner-jF3-zoh_.mjs} +3 -3
  24. package/dist/{Spinner-CYL5kyzM.mjs.map → Spinner-jF3-zoh_.mjs.map} +1 -1
  25. package/dist/{TextLink-3MEVs3No.mjs → TextLink-BuzFRWO6.mjs} +3 -3
  26. package/dist/{TextLink-3MEVs3No.mjs.map → TextLink-BuzFRWO6.mjs.map} +1 -1
  27. package/dist/TextLink-C3xDLsbC.js +2 -0
  28. package/dist/{TextLink-DD0VO37q.js.map → TextLink-C3xDLsbC.js.map} +1 -1
  29. package/dist/{VisuallyHidden-AoRh4WRK.js → VisuallyHidden-CB6Nx76j.js} +2 -2
  30. package/dist/{VisuallyHidden-AoRh4WRK.js.map → VisuallyHidden-CB6Nx76j.js.map} +1 -1
  31. package/dist/{VisuallyHidden-ByNP7ZUI.mjs → VisuallyHidden-KH1biLx-.mjs} +2 -2
  32. package/dist/{VisuallyHidden-ByNP7ZUI.mjs.map → VisuallyHidden-KH1biLx-.mjs.map} +1 -1
  33. package/dist/accordion/index.d.mts +15 -0
  34. package/dist/accordion/index.js +1 -1
  35. package/dist/accordion/index.js.map +1 -1
  36. package/dist/accordion/index.mjs +90 -608
  37. package/dist/accordion/index.mjs.map +1 -1
  38. package/dist/alert-dialog/index.d.mts +38 -0
  39. package/dist/alert-dialog/index.js +1 -34
  40. package/dist/alert-dialog/index.js.map +1 -1
  41. package/dist/alert-dialog/index.mjs +130 -2473
  42. package/dist/alert-dialog/index.mjs.map +1 -1
  43. package/dist/avatar/index.d.mts +15 -0
  44. package/dist/avatar/index.js +1 -1
  45. package/dist/avatar/index.js.map +1 -1
  46. package/dist/avatar/index.mjs +4 -4
  47. package/dist/badge/index.d.mts +1 -0
  48. package/dist/badge/index.js +1 -1
  49. package/dist/badge/index.js.map +1 -1
  50. package/dist/badge/index.mjs +6 -6
  51. package/dist/breadcrumb/index.d.mts +12 -0
  52. package/dist/breadcrumb/index.js +1 -1
  53. package/dist/breadcrumb/index.js.map +1 -1
  54. package/dist/breadcrumb/index.mjs +21 -21
  55. package/dist/button/Button.d.ts +1 -1
  56. package/dist/button/index.d.mts +1 -0
  57. package/dist/button/index.js +1 -1
  58. package/dist/button/index.mjs +1 -1
  59. package/dist/button/variants/index.d.mts +5 -0
  60. package/dist/card/index.d.mts +8 -0
  61. package/dist/card/index.js +1 -1
  62. package/dist/card/index.js.map +1 -1
  63. package/dist/card/index.mjs +2 -2
  64. package/dist/carousel/index.d.mts +19 -0
  65. package/dist/carousel/index.js +1 -1
  66. package/dist/carousel/index.js.map +1 -1
  67. package/dist/carousel/index.mjs +3 -3
  68. package/dist/checkbox/index.d.mts +2 -0
  69. package/dist/checkbox/index.js +1 -1
  70. package/dist/checkbox/index.js.map +1 -1
  71. package/dist/checkbox/index.mjs +128 -364
  72. package/dist/checkbox/index.mjs.map +1 -1
  73. package/dist/chip/index.d.mts +15 -0
  74. package/dist/chip/index.js +1 -1
  75. package/dist/chip/index.js.map +1 -1
  76. package/dist/chip/index.mjs +196 -370
  77. package/dist/chip/index.mjs.map +1 -1
  78. package/dist/chip/variants/index.d.mts +3 -0
  79. package/dist/collapsible/index.d.mts +7 -0
  80. package/dist/collapsible/index.js +1 -1
  81. package/dist/collapsible/index.js.map +1 -1
  82. package/dist/collapsible/index.mjs +38 -213
  83. package/dist/collapsible/index.mjs.map +1 -1
  84. package/dist/combobox/index.d.mts +35 -0
  85. package/dist/combobox/index.js +1 -1
  86. package/dist/combobox/index.js.map +1 -1
  87. package/dist/combobox/index.mjs +7 -7
  88. package/dist/combobox/utils/index.d.mts +14 -0
  89. package/dist/dialog/index.d.mts +37 -0
  90. package/dist/dialog/index.js +1 -1
  91. package/dist/dialog/index.js.map +1 -1
  92. package/dist/dialog/index.mjs +120 -120
  93. package/dist/dialog/index.mjs.map +1 -1
  94. package/dist/divider/index.d.mts +6 -0
  95. package/dist/divider/index.js +1 -1
  96. package/dist/divider/index.js.map +1 -1
  97. package/dist/divider/index.mjs +58 -76
  98. package/dist/divider/index.mjs.map +1 -1
  99. package/dist/drawer/index.d.mts +35 -0
  100. package/dist/drawer/index.js +1 -1
  101. package/dist/drawer/index.js.map +1 -1
  102. package/dist/drawer/index.mjs +88 -88
  103. package/dist/drawer/index.mjs.map +1 -1
  104. package/dist/dropdown/index.d.mts +29 -0
  105. package/dist/dropdown/index.js +1 -1
  106. package/dist/dropdown/index.js.map +1 -1
  107. package/dist/dropdown/index.mjs +5 -5
  108. package/dist/file-upload/index.d.mts +22 -0
  109. package/dist/file-upload/index.js +1 -1
  110. package/dist/file-upload/index.js.map +1 -1
  111. package/dist/file-upload/index.mjs +6 -6
  112. package/dist/form-field/index.d.mts +31 -0
  113. package/dist/form-field/index.js +1 -1
  114. package/dist/form-field/index.js.map +1 -1
  115. package/dist/form-field/index.mjs +47 -47
  116. package/dist/icon/index.d.mts +1 -0
  117. package/dist/icon/index.js +1 -1
  118. package/dist/icon/index.mjs +1 -1
  119. package/dist/icon-button/index.d.mts +1 -0
  120. package/dist/icon-button/index.js +1 -1
  121. package/dist/icon-button/index.mjs +1 -1
  122. package/dist/input/index.d.mts +21 -0
  123. package/dist/input/index.js +1 -1
  124. package/dist/input/index.js.map +1 -1
  125. package/dist/input/index.mjs +4 -4
  126. package/dist/input-otp/index.d.mts +14 -0
  127. package/dist/input-otp/index.js +1 -1
  128. package/dist/input-otp/index.js.map +1 -1
  129. package/dist/input-otp/index.mjs +63 -61
  130. package/dist/input-otp/index.mjs.map +1 -1
  131. package/dist/kbd/index.d.mts +1 -0
  132. package/dist/label/index.d.mts +7 -0
  133. package/dist/label/index.js +1 -1
  134. package/dist/label/index.js.map +1 -1
  135. package/dist/label/index.mjs +37 -2
  136. package/dist/label/index.mjs.map +1 -1
  137. package/dist/link-box/index.d.mts +9 -0
  138. package/dist/link-box/index.js +1 -1
  139. package/dist/link-box/index.js.map +1 -1
  140. package/dist/link-box/index.mjs +7 -7
  141. package/dist/pagination/index.d.mts +18 -0
  142. package/dist/pagination/index.js +1 -1
  143. package/dist/pagination/index.js.map +1 -1
  144. package/dist/pagination/index.mjs +126 -784
  145. package/dist/pagination/index.mjs.map +1 -1
  146. package/dist/popover/index.d.mts +17 -0
  147. package/dist/popover/index.js +1 -1
  148. package/dist/popover/index.js.map +1 -1
  149. package/dist/popover/index.mjs +119 -1748
  150. package/dist/popover/index.mjs.map +1 -1
  151. package/dist/portal/index.d.mts +1 -0
  152. package/dist/portal/index.js +1 -1
  153. package/dist/portal/index.js.map +1 -1
  154. package/dist/portal/index.mjs +3 -3
  155. package/dist/portal/index.mjs.map +1 -1
  156. package/dist/progress/index.d.mts +13 -0
  157. package/dist/progress/index.js +1 -6
  158. package/dist/progress/index.js.map +1 -1
  159. package/dist/progress/index.mjs +87 -162
  160. package/dist/progress/index.mjs.map +1 -1
  161. package/dist/progress-tracker/index.d.mts +10 -0
  162. package/dist/progress-tracker/index.js +1 -1
  163. package/dist/progress-tracker/index.js.map +1 -1
  164. package/dist/progress-tracker/index.mjs +14 -14
  165. package/dist/radio-group/index.d.mts +7 -0
  166. package/dist/radio-group/index.js +1 -1
  167. package/dist/radio-group/index.js.map +1 -1
  168. package/dist/radio-group/index.mjs +85 -312
  169. package/dist/radio-group/index.mjs.map +1 -1
  170. package/dist/rating/index.d.mts +1 -0
  171. package/dist/rating/index.js +1 -1
  172. package/dist/rating/index.js.map +1 -1
  173. package/dist/rating/index.mjs +11 -11
  174. package/dist/scrolling-list/index.d.mts +15 -0
  175. package/dist/scrolling-list/index.js +1 -1
  176. package/dist/scrolling-list/index.js.map +1 -1
  177. package/dist/scrolling-list/index.mjs +168 -333
  178. package/dist/scrolling-list/index.mjs.map +1 -1
  179. package/dist/segmented-gauge/index.d.mts +13 -0
  180. package/dist/segmented-gauge/index.js +1 -1
  181. package/dist/segmented-gauge/index.js.map +1 -1
  182. package/dist/segmented-gauge/index.mjs +1 -1
  183. package/dist/select/index.d.mts +21 -0
  184. package/dist/select/index.js +1 -1
  185. package/dist/select/index.js.map +1 -1
  186. package/dist/select/index.mjs +21 -21
  187. package/dist/skeleton/index.d.mts +8 -0
  188. package/dist/skeleton/index.js +1 -1
  189. package/dist/skeleton/index.js.map +1 -1
  190. package/dist/skeleton/index.mjs +2 -2
  191. package/dist/slider/index.d.mts +8 -0
  192. package/dist/slider/index.js +1 -1
  193. package/dist/slider/index.js.map +1 -1
  194. package/dist/slider/index.mjs +62 -486
  195. package/dist/slider/index.mjs.map +1 -1
  196. package/dist/slot/index.d.mts +1 -0
  197. package/dist/slot/index.js +1 -1
  198. package/dist/slot/index.mjs +1 -1
  199. package/dist/snackbar/index.d.mts +13 -0
  200. package/dist/snackbar/index.js +1 -1
  201. package/dist/snackbar/index.js.map +1 -1
  202. package/dist/snackbar/index.mjs +189 -1105
  203. package/dist/snackbar/index.mjs.map +1 -1
  204. package/dist/spinner/index.d.mts +1 -0
  205. package/dist/spinner/index.js +1 -1
  206. package/dist/spinner/index.mjs +1 -1
  207. package/dist/stepper/index.d.mts +9 -0
  208. package/dist/stepper/index.js +1 -7
  209. package/dist/stepper/index.js.map +1 -1
  210. package/dist/stepper/index.mjs +137 -2317
  211. package/dist/stepper/index.mjs.map +1 -1
  212. package/dist/switch/index.d.mts +1 -0
  213. package/dist/switch/index.js +1 -1
  214. package/dist/switch/index.js.map +1 -1
  215. package/dist/switch/index.mjs +85 -208
  216. package/dist/switch/index.mjs.map +1 -1
  217. package/dist/tabs/index.d.mts +13 -0
  218. package/dist/tabs/index.js +1 -1
  219. package/dist/tabs/index.js.map +1 -1
  220. package/dist/tabs/index.mjs +179 -329
  221. package/dist/tabs/index.mjs.map +1 -1
  222. package/dist/tag/index.d.mts +1 -0
  223. package/dist/tag/index.js +1 -1
  224. package/dist/tag/index.js.map +1 -1
  225. package/dist/tag/index.mjs +2 -2
  226. package/dist/tag/variants/index.d.mts +3 -0
  227. package/dist/text-link/index.d.mts +1 -0
  228. package/dist/text-link/index.js +1 -1
  229. package/dist/text-link/index.mjs +1 -1
  230. package/dist/textarea/index.d.mts +14 -0
  231. package/dist/textarea/index.js +1 -1
  232. package/dist/textarea/index.js.map +1 -1
  233. package/dist/textarea/index.mjs +6 -6
  234. package/dist/toast/index.d.mts +20 -0
  235. package/dist/toast/index.js +1 -1
  236. package/dist/toast/index.js.map +1 -1
  237. package/dist/toast/index.mjs +146 -1008
  238. package/dist/toast/index.mjs.map +1 -1
  239. package/dist/visually-hidden/index.d.mts +1 -0
  240. package/dist/visually-hidden/index.js +1 -1
  241. package/dist/visually-hidden/index.mjs +1 -1
  242. package/package.json +5 -4
  243. package/dist/Button-C3xHNaGl.js +0 -2
  244. package/dist/DialogContent.styles-BrhKaHc_.js +0 -2
  245. package/dist/Icon-Bf0XrmiR.js +0 -2
  246. package/dist/IconButton-Bf-EDzpI.js +0 -2
  247. package/dist/Slot-C98rL4yy.mjs +0 -14
  248. package/dist/Slot-ghrohQLA.js +0 -2
  249. package/dist/Spinner-DK8VEsaR.js +0 -2
  250. package/dist/TextLink-DD0VO37q.js +0 -2
  251. package/dist/composite-Br3kM5N9.mjs +0 -40
  252. package/dist/composite-Br3kM5N9.mjs.map +0 -1
  253. package/dist/composite-fJD9R7R0.js +0 -2
  254. package/dist/composite-fJD9R7R0.js.map +0 -1
  255. package/dist/detectBrowser-Bc7rk5fI.mjs +0 -44
  256. package/dist/detectBrowser-Bc7rk5fI.mjs.map +0 -1
  257. package/dist/detectBrowser-DTbs_30X.js +0 -2
  258. package/dist/detectBrowser-DTbs_30X.js.map +0 -1
  259. package/dist/downshift.esm-Ncwetv0s.mjs +0 -3038
  260. package/dist/downshift.esm-Ncwetv0s.mjs.map +0 -1
  261. package/dist/downshift.esm-PfCOUbxq.js +0 -37
  262. package/dist/downshift.esm-PfCOUbxq.js.map +0 -1
  263. package/dist/floating-ui.utils.dom-CCN4I08l.js +0 -2
  264. package/dist/floating-ui.utils.dom-CCN4I08l.js.map +0 -1
  265. package/dist/floating-ui.utils.dom-uiDUZc_y.mjs +0 -136
  266. package/dist/floating-ui.utils.dom-uiDUZc_y.mjs.map +0 -1
  267. package/dist/index-0KYGKeVg.js +0 -2
  268. package/dist/index-0KYGKeVg.js.map +0 -1
  269. package/dist/index-1WIgmEZh.js +0 -2
  270. package/dist/index-1WIgmEZh.js.map +0 -1
  271. package/dist/index-BRi38DTc.mjs +0 -21
  272. package/dist/index-BRi38DTc.mjs.map +0 -1
  273. package/dist/index-BZAtNKwE.mjs +0 -71
  274. package/dist/index-BZAtNKwE.mjs.map +0 -1
  275. package/dist/index-BZPx6jYI.mjs +0 -9
  276. package/dist/index-BZPx6jYI.mjs.map +0 -1
  277. package/dist/index-BlkdpEIe.mjs +0 -55
  278. package/dist/index-BlkdpEIe.mjs.map +0 -1
  279. package/dist/index-BmAFn37q.mjs +0 -49
  280. package/dist/index-BmAFn37q.mjs.map +0 -1
  281. package/dist/index-C-J_tHdS.js +0 -6
  282. package/dist/index-C-J_tHdS.js.map +0 -1
  283. package/dist/index-C1qb0595.mjs +0 -28
  284. package/dist/index-C1qb0595.mjs.map +0 -1
  285. package/dist/index-C34GgsKQ.mjs +0 -54
  286. package/dist/index-C34GgsKQ.mjs.map +0 -1
  287. package/dist/index-CCKe-Mpx.mjs +0 -7
  288. package/dist/index-CCKe-Mpx.mjs.map +0 -1
  289. package/dist/index-CDBBjNXc.js +0 -2
  290. package/dist/index-CDBBjNXc.js.map +0 -1
  291. package/dist/index-CYjGhVvU.mjs +0 -243
  292. package/dist/index-CYjGhVvU.mjs.map +0 -1
  293. package/dist/index-ChLwd62c.js +0 -2
  294. package/dist/index-ChLwd62c.js.map +0 -1
  295. package/dist/index-Cjj_rUPu.js +0 -2
  296. package/dist/index-Cjj_rUPu.js.map +0 -1
  297. package/dist/index-CyMbLkj0.js +0 -2
  298. package/dist/index-CyMbLkj0.js.map +0 -1
  299. package/dist/index-DFZozV_h.mjs +0 -69
  300. package/dist/index-DFZozV_h.mjs.map +0 -1
  301. package/dist/index-DKuHkHFX.js +0 -2
  302. package/dist/index-DKuHkHFX.js.map +0 -1
  303. package/dist/index-DLHLIYPI.mjs +0 -16
  304. package/dist/index-DLHLIYPI.mjs.map +0 -1
  305. package/dist/index-DO-atGp-.js +0 -2
  306. package/dist/index-DO-atGp-.js.map +0 -1
  307. package/dist/index-DWlg8lkk.mjs +0 -179
  308. package/dist/index-DWlg8lkk.mjs.map +0 -1
  309. package/dist/index-DYxWvftI.js +0 -2
  310. package/dist/index-DYxWvftI.js.map +0 -1
  311. package/dist/index-D_lWkK39.mjs +0 -803
  312. package/dist/index-D_lWkK39.mjs.map +0 -1
  313. package/dist/index-DdkVj7D0.js +0 -18
  314. package/dist/index-DdkVj7D0.js.map +0 -1
  315. package/dist/index-De-6atSi.js +0 -2
  316. package/dist/index-De-6atSi.js.map +0 -1
  317. package/dist/index-DhGWNzsz.mjs +0 -83
  318. package/dist/index-DhGWNzsz.mjs.map +0 -1
  319. package/dist/index-Dkj4QRX8.js +0 -2
  320. package/dist/index-Dkj4QRX8.js.map +0 -1
  321. package/dist/index-DlIFg0Eu.mjs +0 -60
  322. package/dist/index-DlIFg0Eu.mjs.map +0 -1
  323. package/dist/index-DnaHaH_0.js +0 -2
  324. package/dist/index-DnaHaH_0.js.map +0 -1
  325. package/dist/index-MHF2-CYX.js +0 -2
  326. package/dist/index-MHF2-CYX.js.map +0 -1
  327. package/dist/index-MQ0c3ZX_.js +0 -2
  328. package/dist/index-MQ0c3ZX_.js.map +0 -1
  329. package/dist/index-MSR-vgWR.mjs +0 -37
  330. package/dist/index-MSR-vgWR.mjs.map +0 -1
  331. package/dist/index-VL0YEmOW.mjs +0 -125
  332. package/dist/index-VL0YEmOW.mjs.map +0 -1
  333. package/dist/index-tXqxYME3.js +0 -42
  334. package/dist/index-tXqxYME3.js.map +0 -1
  335. package/dist/inertValue-Bif5Sqs6.mjs +0 -522
  336. package/dist/inertValue-Bif5Sqs6.mjs.map +0 -1
  337. package/dist/inertValue-ShwihJSN.js +0 -5
  338. package/dist/inertValue-ShwihJSN.js.map +0 -1
  339. package/dist/useCollapsiblePanel-D1dCo0lf.js +0 -4
  340. package/dist/useCollapsiblePanel-D1dCo0lf.js.map +0 -1
  341. package/dist/useCollapsiblePanel-kbMNl4Z4.mjs +0 -287
  342. package/dist/useCollapsiblePanel-kbMNl4Z4.mjs.map +0 -1
  343. package/dist/useFocusWithin-CFNEka2I.js +0 -2
  344. package/dist/useFocusWithin-CFNEka2I.js.map +0 -1
  345. package/dist/useFocusWithin-CoL4390f.mjs +0 -796
  346. package/dist/useFocusWithin-CoL4390f.mjs.map +0 -1
  347. package/dist/useOpenChangeComplete-Dk-u_f2y.js +0 -2
  348. package/dist/useOpenChangeComplete-Dk-u_f2y.js.map +0 -1
  349. package/dist/useOpenChangeComplete-RUbg6RBw.mjs +0 -582
  350. package/dist/useOpenChangeComplete-RUbg6RBw.mjs.map +0 -1
  351. package/dist/useTransitionStatus-CktVVKxz.mjs +0 -46
  352. package/dist/useTransitionStatus-CktVVKxz.mjs.map +0 -1
  353. package/dist/useTransitionStatus-CqbEyvIj.js +0 -2
  354. package/dist/useTransitionStatus-CqbEyvIj.js.map +0 -1
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sources":["../../src/dialog/DialogContext.tsx","../../src/dialog/Dialog.tsx","../../src/dialog/DialogBody.tsx","../../src/dialog/DialogClose.tsx","../../src/dialog/DialogCloseButton.tsx","../../src/dialog/DialogContent.tsx","../../src/dialog/DialogDescription.tsx","../../src/dialog/DialogFooter.tsx","../../src/dialog/DialogHeader.tsx","../../src/dialog/DialogOverlay.tsx","../../src/dialog/DialogPortal.tsx","../../src/dialog/DialogTitle.tsx","../../src/dialog/DialogTrigger.tsx","../../src/dialog/index.ts"],"sourcesContent":["import { createContext, type ReactNode, useContext, useState } from 'react'\n\nexport interface DialogContextState {\n isFullScreen: boolean\n setIsFullScreen: (value: boolean) => void\n withFade: boolean\n}\n\nconst DialogContext = createContext<DialogContextState | null>(null)\n\nexport const DialogProvider = ({\n children: childrenProp,\n withFade = false,\n}: {\n children: ReactNode\n withFade?: boolean\n}) => {\n const [isFullScreen, setIsFullScreen] = useState(false)\n\n return (\n <DialogContext.Provider\n value={{\n isFullScreen,\n setIsFullScreen,\n withFade,\n }}\n >\n {childrenProp}\n </DialogContext.Provider>\n )\n}\n\nexport const useDialog = () => {\n const context = useContext(DialogContext)\n\n if (!context) {\n throw Error('useDialog must be used within a Dialog provider')\n }\n\n return context\n}\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement, useEffect, useRef } from 'react'\n\nimport { DialogProvider } from './DialogContext'\n\nexport interface DialogProps {\n /**\n * Children of the component.\n */\n children?: RadixDialog.DialogProps['children']\n /**\n * Specifies if the dialog is open or not.\n */\n open?: RadixDialog.DialogProps['open']\n /**\n * Default open state.\n */\n defaultOpen?: RadixDialog.DialogProps['defaultOpen']\n /**\n * Handler executen on every dialog open state change.\n */\n onOpenChange?: RadixDialog.DialogProps['onOpenChange']\n /**\n * Specifies if the dialog is a modal.\n */\n modal?: RadixDialog.DialogProps['modal']\n /**\n * Specifies if the dialog should have a fade animation on its body (in case it is scrollable).\n */\n withFade?: boolean\n}\n\nexport const Dialog = ({ children, withFade = false, ...rest }: DialogProps): ReactElement => {\n const open = rest.open\n const activeElementRef = useRef<Element>(null)\n\n /**\n * This function captures the active element when the Dialog is opened\n * and sets focus back to it when the Dialog is closed.\n */\n function handleActiveElementFocus() {\n if (open && document.activeElement) {\n activeElementRef.current = document.activeElement\n }\n\n if (!open) {\n setTimeout(() => {\n if (!(activeElementRef.current instanceof HTMLElement)) return\n activeElementRef.current.focus()\n }, 0)\n }\n }\n\n useEffect(handleActiveElementFocus, [open])\n\n return (\n <DialogProvider withFade={withFade}>\n <RadixDialog.Root {...rest}>{children}</RadixDialog.Root>\n </DialogProvider>\n )\n}\n\nDialog.displayName = 'Dialog.Root'\n","import { useMergeRefs } from '@spark-ui/hooks/use-merge-refs'\nimport { useScrollOverflow } from '@spark-ui/hooks/use-scroll-overflow'\nimport { cx } from 'class-variance-authority'\nimport { type ReactElement, type ReactNode, Ref, useRef } from 'react'\n\nimport { useDialog } from './DialogContext'\n\nexport interface BodyProps {\n children: ReactNode\n className?: string\n tabIndex?: number\n ref?: Ref<HTMLDivElement>\n inset?: boolean\n}\n\nexport const Body = ({\n children,\n className,\n inset = false,\n ref: forwardedRef,\n ...rest\n}: BodyProps): ReactElement => {\n const scrollAreaRef = useRef<HTMLDivElement>(null)\n const ref = useMergeRefs(forwardedRef, scrollAreaRef)\n\n const { withFade } = useDialog()\n\n const { overflow } = useScrollOverflow(scrollAreaRef)\n\n return (\n <div\n data-spark-component=\"dialog-body\"\n ref={ref}\n className={cx(\n 'focus-visible:u-outline relative grow overflow-y-auto outline-hidden',\n 'transition-all duration-300',\n {\n ['px-xl py-lg']: !inset,\n },\n className\n )}\n style={{\n ...(withFade && {\n maskImage:\n 'linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 44px, rgba(0, 0, 0, 1) calc(100% - 44px), rgba(0, 0, 0, 0))',\n maskSize: `100% calc(100% + ${overflow.top ? '0px' : '44px'} + ${overflow.bottom ? '0px' : '44px'})`,\n maskPosition: `0 ${overflow.top ? '0px' : '-44px'}`,\n }),\n }}\n {...rest}\n >\n {children}\n </div>\n )\n}\n\nBody.displayName = 'Dialog.Body'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { Ref } from 'react'\n\nexport type CloseProps = RadixDialog.DialogCloseProps & {\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const Close = (props: CloseProps) => <RadixDialog.Close {...props} />\n\nClose.displayName = 'Dialog.Close'\n","import { Close as CloseSVG } from '@spark-ui/icons/Close'\nimport { cx } from 'class-variance-authority'\n\nimport { Icon } from '../icon'\nimport { IconButton, type IconButtonProps } from '../icon-button'\nimport { Close, CloseProps } from './DialogClose'\n\nexport type CloseButtonProps = CloseProps &\n Pick<IconButtonProps, 'size' | 'intent' | 'design' | 'aria-label'>\n\nconst Root = ({\n 'aria-label': ariaLabel,\n className,\n size = 'md',\n intent = 'neutral',\n design = 'ghost',\n children = <CloseSVG />,\n ref,\n ...rest\n}: CloseButtonProps) => {\n return (\n <Close\n data-spark-component=\"dialog-close-button\"\n data-part=\"close\"\n ref={ref}\n className={cx(['absolute', 'top-md', 'right-xl'], className)}\n asChild\n {...rest}\n >\n <IconButton intent={intent} size={size} design={design} aria-label={ariaLabel}>\n <Icon>{children}</Icon>\n </IconButton>\n </Close>\n )\n}\n\nexport const CloseButton = Object.assign(Root, {\n id: 'CloseButton',\n})\n\nRoot.displayName = 'Dialog.CloseButton'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement, Ref, useEffect } from 'react'\n\nimport { dialogContentStyles, type DialogContentStylesProps } from './DialogContent.styles'\nimport { useDialog } from './DialogContext'\n\nexport interface ContentProps extends RadixDialog.DialogContentProps, DialogContentStylesProps {\n /**\n * When set to true, the content will adjust its width to fit the content rather than taking up the full available width.\n */\n isNarrow?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Content = ({\n children,\n className,\n isNarrow = false,\n size = 'md',\n onInteractOutside,\n ref,\n ...rest\n}: ContentProps): ReactElement => {\n const { setIsFullScreen } = useDialog()\n\n useEffect(() => {\n if (size === 'fullscreen') setIsFullScreen(true)\n\n return () => setIsFullScreen(false)\n }, [setIsFullScreen, size])\n\n return (\n <RadixDialog.Content\n data-spark-component=\"dialog-content\"\n ref={ref}\n className={dialogContentStyles({\n className,\n isNarrow,\n size,\n })}\n onInteractOutside={e => {\n const isForegroundElement = (e.target as HTMLElement).closest('.z-toast, .z-popover')\n\n /**\n * The focus trap of the dialog applies `pointer-events-none` on the body of the page in the background, but\n * some components with an higher z-index have `pointer-events-auto` applied on them to remain interactive and ignore the focust trap (ex: a Snackbar with actions).\n *\n * Clicking on the snackbar will be considered as an \"outside click\" and close the dialog. We want to prevent this.\n */\n if (isForegroundElement) {\n e.preventDefault()\n }\n\n onInteractOutside?.(e)\n }}\n {...rest}\n >\n {children}\n </RadixDialog.Content>\n )\n}\n\nContent.displayName = 'Dialog.Content'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { Ref } from 'react'\n\nexport type DescriptionProps = RadixDialog.DialogDescriptionProps & {\n ref?: Ref<HTMLParagraphElement>\n}\n\nexport const Description = (props: DescriptionProps) => (\n <RadixDialog.Description data-spark-component=\"dialog-description\" {...props} />\n)\n\nDescription.displayName = 'Dialog.Description'\n","import { cx } from 'class-variance-authority'\nimport { type ReactElement, type ReactNode, Ref } from 'react'\n\nexport interface FooterProps {\n children: ReactNode\n className?: string\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Footer = ({ children, className, ref, ...rest }: FooterProps): ReactElement => (\n <footer\n data-spark-component=\"dialog-footer\"\n ref={ref}\n className={cx(className, ['px-xl', 'py-lg'])}\n {...rest}\n >\n {children}\n </footer>\n)\n\nFooter.displayName = 'Dialog.Footer'\n","import { cx } from 'class-variance-authority'\nimport { type ReactElement, type ReactNode, Ref } from 'react'\n\nexport interface HeaderProps {\n children: ReactNode\n className?: string\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Header = ({ children, className, ref, ...rest }: HeaderProps): ReactElement => (\n <header\n data-spark-component=\"dialog-header\"\n ref={ref}\n className={cx(className, ['px-xl', 'py-lg'])}\n {...rest}\n >\n {children}\n </header>\n)\n\nHeader.displayName = 'Dialog.Header'\n","import { cx } from 'class-variance-authority'\nimport { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement, Ref } from 'react'\n\nimport { useDialog } from './DialogContext'\n\nexport type OverlayProps = RadixDialog.DialogOverlayProps & {\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Overlay = ({ className, ref, ...rest }: OverlayProps): ReactElement | null => {\n const { isFullScreen } = useDialog()\n\n return (\n <RadixDialog.Overlay\n data-spark-component=\"dialog-overlay\"\n ref={ref}\n className={cx(\n isFullScreen ? 'hidden' : 'fixed',\n ['top-0', 'left-0', 'w-screen', 'h-screen', 'z-overlay'],\n ['bg-overlay/dim-1'],\n ['data-[state=open]:animate-fade-in'],\n ['data-[state=closed]:animate-fade-out'],\n className\n )}\n {...rest}\n />\n )\n}\n\nOverlay.displayName = 'Dialog.Overlay'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement } from 'react'\n\nexport type PortalProps = RadixDialog.DialogPortalProps\n\nexport const Portal = ({ children, ...rest }: PortalProps): ReactElement => (\n <RadixDialog.Portal {...rest}>{children}</RadixDialog.Portal>\n)\n\nPortal.displayName = 'Dialog.Portal'\n","import { cx } from 'class-variance-authority'\nimport { Dialog as RadixDialog } from 'radix-ui'\nimport { Ref } from 'react'\n\nexport type TitleProps = RadixDialog.DialogTitleProps & {\n ref?: Ref<HTMLHeadingElement>\n}\n\nexport const Title = ({ className, ref, ...others }: TitleProps) => {\n return (\n <RadixDialog.Title\n data-spark-component=\"dialog-title\"\n ref={ref}\n className={cx(\n 'text-headline-1 text-on-surface',\n 'group-has-data-[part=close]:pr-3xl',\n className\n )}\n {...others}\n />\n )\n}\n\nTitle.displayName = 'Dialog.Title'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement, ReactNode, Ref } from 'react'\n\nexport interface TriggerProps {\n /**\n * Children of the component.\n */\n children?: ReactNode\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: RadixDialog.DialogTriggerProps['asChild']\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const Trigger = (props: TriggerProps): ReactElement => (\n <RadixDialog.Trigger data-spark-component=\"dialog-trigger\" {...props} />\n)\n\nTrigger.displayName = 'Dialog.Trigger'\n","import { Dialog as Root } from './Dialog'\nimport { Body } from './DialogBody'\nimport { Close } from './DialogClose'\nimport { CloseButton } from './DialogCloseButton'\nimport { Content } from './DialogContent'\nimport { Description } from './DialogDescription' // aria-describedby\nimport { Footer } from './DialogFooter'\nimport { Header } from './DialogHeader'\nimport { Overlay } from './DialogOverlay'\nimport { Portal } from './DialogPortal'\nimport { Title } from './DialogTitle' // aria-labelledby\nimport { Trigger } from './DialogTrigger'\n\nexport const Dialog: typeof Root & {\n Trigger: typeof Trigger\n Portal: typeof Portal\n Overlay: typeof Overlay\n Content: typeof Content\n Header: typeof Header\n Body: typeof Body\n Footer: typeof Footer\n Close: typeof Close\n CloseButton: typeof CloseButton\n Title: typeof Title\n Description: typeof Description\n} = Object.assign(Root, {\n Trigger,\n Portal,\n Overlay,\n Content,\n Header,\n Body,\n Footer,\n Close,\n CloseButton,\n Title,\n Description,\n})\n\nDialog.displayName = 'Dialog'\nDialog.Trigger.displayName = 'Dialog.Trigger'\nTrigger.displayName = 'Dialog.Trigger'\nPortal.displayName = 'Dialog.Portal'\nOverlay.displayName = 'Dialog.Overlay'\nContent.displayName = 'Dialog.Content'\nHeader.displayName = 'Dialog.Header'\nBody.displayName = 'Dialog.Body'\nFooter.displayName = 'Dialog.Footer'\nCloseButton.displayName = 'Dialog.CloseButton'\nTitle.displayName = 'Dialog.Title'\nDescription.displayName = 'Dialog.Description'\n\nexport { type DialogProps } from './Dialog'\nexport { type ContentProps as DialogContentProps } from './DialogContent'\nexport { type HeaderProps as DialogHeaderProps } from './DialogHeader'\nexport { type BodyProps as DialogBodyProps } from './DialogBody'\nexport { type FooterProps as DialogFooterProps } from './DialogFooter'\nexport { type TriggerProps as DialogTriggerProps } from './DialogTrigger'\nexport { type OverlayProps as DialogOverlayProps } from './DialogOverlay'\nexport { type PortalProps as DialogPortalProps } from './DialogPortal'\nexport { type TitleProps as DialogTitleProps } from './DialogTitle'\nexport { type DescriptionProps as DialogDescriptionProps } from './DialogDescription'\nexport { type CloseProps as DialogCloseProps } from './DialogClose'\nexport { type CloseButtonProps as DialogCloseButtonProps } from './DialogCloseButton'\n"],"names":["DialogContext","createContext","DialogProvider","childrenProp","withFade","isFullScreen","setIsFullScreen","useState","jsx","useDialog","context","useContext","Dialog","children","rest","open","activeElementRef","useRef","handleActiveElementFocus","useEffect","RadixDialog.Root","Body","className","inset","forwardedRef","scrollAreaRef","ref","useMergeRefs","overflow","useScrollOverflow","cx","Close","props","RadixDialog.Close","Root","ariaLabel","size","intent","design","CloseSVG","IconButton","Icon","CloseButton","Content","isNarrow","onInteractOutside","RadixDialog.Content","dialogContentStyles","e","Description","RadixDialog.Description","Footer","Header","Overlay","RadixDialog.Overlay","Portal","RadixDialog.Portal","Title","others","RadixDialog.Title","Trigger","RadixDialog.Trigger"],"mappings":"qcAQMA,EAAgBC,EAAAA,cAAyC,IAAI,EAEtDC,EAAiB,CAAC,CAC7B,SAAUC,EACV,SAAAC,EAAW,EACb,IAGM,CACJ,KAAM,CAACC,EAAcC,CAAe,EAAIC,EAAAA,SAAS,EAAK,EAEtD,OACEC,EAAAA,IAACR,EAAc,SAAd,CACC,MAAO,CACL,aAAAK,EACA,gBAAAC,EACA,SAAAF,CAAA,EAGD,SAAAD,CAAA,CAAA,CAGP,EAEaM,EAAY,IAAM,CAC7B,MAAMC,EAAUC,EAAAA,WAAWX,CAAa,EAExC,GAAI,CAACU,EACH,MAAM,MAAM,iDAAiD,EAG/D,OAAOA,CACT,ECRaE,EAAS,CAAC,CAAE,SAAAC,EAAU,SAAAT,EAAW,GAAO,GAAGU,KAAsC,CAC5F,MAAMC,EAAOD,EAAK,KACZE,EAAmBC,EAAAA,OAAgB,IAAI,EAM7C,SAASC,GAA2B,CAC9BH,GAAQ,SAAS,gBACnBC,EAAiB,QAAU,SAAS,eAGjCD,GACH,WAAW,IAAM,CACTC,EAAiB,mBAAmB,aAC1CA,EAAiB,QAAQ,MAAA,CAC3B,EAAG,CAAC,CAER,CAEAG,OAAAA,YAAUD,EAA0B,CAACH,CAAI,CAAC,EAGxCP,MAACN,EAAA,CAAe,SAAAE,EACd,SAAAI,EAAAA,IAACY,EAAAA,KAAA,CAAkB,GAAGN,EAAO,SAAAD,CAAA,CAAS,CAAA,CACxC,CAEJ,EAEAD,EAAO,YAAc,cC/Cd,MAAMS,EAAO,CAAC,CACnB,SAAAR,EACA,UAAAS,EACA,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c,iBACtBL,EAAO,YAAc,gBACrBF,EAAQ,YAAc,iBACtBV,EAAQ,YAAc,iBACtBS,EAAO,YAAc,gBACrB/B,EAAK,YAAc,cACnB8B,EAAO,YAAc,gBACrBT,EAAY,YAAc,qBAC1Be,EAAM,YAAc,eACpBR,EAAY,YAAc"}
1
+ {"version":3,"file":"index.js","sources":["../../src/dialog/DialogContext.tsx","../../src/dialog/Dialog.tsx","../../src/dialog/DialogBody.tsx","../../src/dialog/DialogClose.tsx","../../src/dialog/DialogCloseButton.tsx","../../src/dialog/DialogContent.tsx","../../src/dialog/DialogDescription.tsx","../../src/dialog/DialogFooter.tsx","../../src/dialog/DialogHeader.tsx","../../src/dialog/DialogOverlay.tsx","../../src/dialog/DialogPortal.tsx","../../src/dialog/DialogTitle.tsx","../../src/dialog/DialogTrigger.tsx","../../src/dialog/index.ts"],"sourcesContent":["import { createContext, type ReactNode, useContext, useState } from 'react'\n\nexport interface DialogContextState {\n isFullScreen: boolean\n setIsFullScreen: (value: boolean) => void\n withFade: boolean\n}\n\nconst DialogContext = createContext<DialogContextState | null>(null)\n\nexport const DialogProvider = ({\n children: childrenProp,\n withFade = false,\n}: {\n children: ReactNode\n withFade?: boolean\n}) => {\n const [isFullScreen, setIsFullScreen] = useState(false)\n\n return (\n <DialogContext.Provider\n value={{\n isFullScreen,\n setIsFullScreen,\n withFade,\n }}\n >\n {childrenProp}\n </DialogContext.Provider>\n )\n}\n\nexport const useDialog = () => {\n const context = useContext(DialogContext)\n\n if (!context) {\n throw Error('useDialog must be used within a Dialog provider')\n }\n\n return context\n}\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement, useEffect, useRef } from 'react'\n\nimport { DialogProvider } from './DialogContext'\n\nexport interface DialogProps {\n /**\n * Children of the component.\n */\n children?: RadixDialog.DialogProps['children']\n /**\n * Specifies if the dialog is open or not.\n */\n open?: RadixDialog.DialogProps['open']\n /**\n * Default open state.\n */\n defaultOpen?: RadixDialog.DialogProps['defaultOpen']\n /**\n * Handler executen on every dialog open state change.\n */\n onOpenChange?: RadixDialog.DialogProps['onOpenChange']\n /**\n * Specifies if the dialog is a modal.\n */\n modal?: RadixDialog.DialogProps['modal']\n /**\n * Specifies if the dialog should have a fade animation on its body (in case it is scrollable).\n */\n withFade?: boolean\n}\n\nexport const Dialog = ({ children, withFade = false, ...rest }: DialogProps): ReactElement => {\n const open = rest.open\n const activeElementRef = useRef<Element>(null)\n\n /**\n * This function captures the active element when the Dialog is opened\n * and sets focus back to it when the Dialog is closed.\n */\n function handleActiveElementFocus() {\n if (open && document.activeElement) {\n activeElementRef.current = document.activeElement\n }\n\n if (!open) {\n setTimeout(() => {\n if (!(activeElementRef.current instanceof HTMLElement)) return\n activeElementRef.current.focus()\n }, 0)\n }\n }\n\n useEffect(handleActiveElementFocus, [open])\n\n return (\n <DialogProvider withFade={withFade}>\n <RadixDialog.Root {...rest}>{children}</RadixDialog.Root>\n </DialogProvider>\n )\n}\n\nDialog.displayName = 'Dialog.Root'\n","import { useMergeRefs } from '@spark-ui/hooks/use-merge-refs'\nimport { useScrollOverflow } from '@spark-ui/hooks/use-scroll-overflow'\nimport { cx } from 'class-variance-authority'\nimport { type ReactElement, type ReactNode, Ref, useRef } from 'react'\n\nimport { useDialog } from './DialogContext'\n\nexport interface BodyProps {\n children: ReactNode\n className?: string\n tabIndex?: number\n ref?: Ref<HTMLDivElement>\n inset?: boolean\n}\n\nexport const Body = ({\n children,\n className,\n inset = false,\n ref: forwardedRef,\n ...rest\n}: BodyProps): ReactElement => {\n const scrollAreaRef = useRef<HTMLDivElement>(null)\n const ref = useMergeRefs(forwardedRef, scrollAreaRef)\n\n const { withFade } = useDialog()\n\n const { overflow } = useScrollOverflow(scrollAreaRef)\n\n return (\n <div\n data-spark-component=\"dialog-body\"\n ref={ref}\n className={cx(\n 'focus-visible:u-outline relative grow overflow-y-auto outline-hidden',\n 'transition-all duration-300',\n {\n ['px-xl py-lg']: !inset,\n },\n className\n )}\n style={{\n ...(withFade && {\n maskImage:\n 'linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 44px, rgba(0, 0, 0, 1) calc(100% - 44px), rgba(0, 0, 0, 0))',\n maskSize: `100% calc(100% + ${overflow.top ? '0px' : '44px'} + ${overflow.bottom ? '0px' : '44px'})`,\n maskPosition: `0 ${overflow.top ? '0px' : '-44px'}`,\n }),\n }}\n {...rest}\n >\n {children}\n </div>\n )\n}\n\nBody.displayName = 'Dialog.Body'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { Ref } from 'react'\n\nexport type CloseProps = RadixDialog.DialogCloseProps & {\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const Close = (props: CloseProps) => <RadixDialog.Close {...props} />\n\nClose.displayName = 'Dialog.Close'\n","import { Close as CloseSVG } from '@spark-ui/icons/Close'\nimport { cx } from 'class-variance-authority'\n\nimport { Icon } from '../icon'\nimport { IconButton, type IconButtonProps } from '../icon-button'\nimport { Close, CloseProps } from './DialogClose'\n\nexport type CloseButtonProps = CloseProps &\n Pick<IconButtonProps, 'size' | 'intent' | 'design' | 'aria-label'>\n\nconst Root = ({\n 'aria-label': ariaLabel,\n className,\n size = 'md',\n intent = 'neutral',\n design = 'ghost',\n children = <CloseSVG />,\n ref,\n ...rest\n}: CloseButtonProps) => {\n return (\n <Close\n data-spark-component=\"dialog-close-button\"\n data-part=\"close\"\n ref={ref}\n className={cx(['absolute', 'top-md', 'right-xl'], className)}\n asChild\n {...rest}\n >\n <IconButton intent={intent} size={size} design={design} aria-label={ariaLabel}>\n <Icon>{children}</Icon>\n </IconButton>\n </Close>\n )\n}\n\nexport const CloseButton = Object.assign(Root, {\n id: 'CloseButton',\n})\n\nRoot.displayName = 'Dialog.CloseButton'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement, Ref, useEffect } from 'react'\n\nimport { dialogContentStyles, type DialogContentStylesProps } from './DialogContent.styles'\nimport { useDialog } from './DialogContext'\n\nexport interface ContentProps extends RadixDialog.DialogContentProps, DialogContentStylesProps {\n /**\n * When set to true, the content will adjust its width to fit the content rather than taking up the full available width.\n */\n isNarrow?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Content = ({\n children,\n className,\n isNarrow = false,\n size = 'md',\n onInteractOutside,\n ref,\n ...rest\n}: ContentProps): ReactElement => {\n const { setIsFullScreen } = useDialog()\n\n useEffect(() => {\n if (size === 'fullscreen') setIsFullScreen(true)\n\n return () => setIsFullScreen(false)\n }, [setIsFullScreen, size])\n\n return (\n <RadixDialog.Content\n data-spark-component=\"dialog-content\"\n ref={ref}\n className={dialogContentStyles({\n className,\n isNarrow,\n size,\n })}\n onInteractOutside={e => {\n const isForegroundElement = (e.target as HTMLElement).closest('.z-toast, .z-popover')\n\n /**\n * The focus trap of the dialog applies `pointer-events-none` on the body of the page in the background, but\n * some components with an higher z-index have `pointer-events-auto` applied on them to remain interactive and ignore the focust trap (ex: a Snackbar with actions).\n *\n * Clicking on the snackbar will be considered as an \"outside click\" and close the dialog. We want to prevent this.\n */\n if (isForegroundElement) {\n e.preventDefault()\n }\n\n onInteractOutside?.(e)\n }}\n {...rest}\n >\n {children}\n </RadixDialog.Content>\n )\n}\n\nContent.displayName = 'Dialog.Content'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { Ref } from 'react'\n\nexport type DescriptionProps = RadixDialog.DialogDescriptionProps & {\n ref?: Ref<HTMLParagraphElement>\n}\n\nexport const Description = (props: DescriptionProps) => (\n <RadixDialog.Description data-spark-component=\"dialog-description\" {...props} />\n)\n\nDescription.displayName = 'Dialog.Description'\n","import { cx } from 'class-variance-authority'\nimport { type ReactElement, type ReactNode, Ref } from 'react'\n\nexport interface FooterProps {\n children: ReactNode\n className?: string\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Footer = ({ children, className, ref, ...rest }: FooterProps): ReactElement => (\n <footer\n data-spark-component=\"dialog-footer\"\n ref={ref}\n className={cx(className, ['px-xl', 'py-lg'])}\n {...rest}\n >\n {children}\n </footer>\n)\n\nFooter.displayName = 'Dialog.Footer'\n","import { cx } from 'class-variance-authority'\nimport { type ReactElement, type ReactNode, Ref } from 'react'\n\nexport interface HeaderProps {\n children: ReactNode\n className?: string\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Header = ({ children, className, ref, ...rest }: HeaderProps): ReactElement => (\n <header\n data-spark-component=\"dialog-header\"\n ref={ref}\n className={cx(className, ['px-xl', 'py-lg'])}\n {...rest}\n >\n {children}\n </header>\n)\n\nHeader.displayName = 'Dialog.Header'\n","import { cx } from 'class-variance-authority'\nimport { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement, Ref } from 'react'\n\nimport { useDialog } from './DialogContext'\n\nexport type OverlayProps = RadixDialog.DialogOverlayProps & {\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Overlay = ({ className, ref, ...rest }: OverlayProps): ReactElement | null => {\n const { isFullScreen } = useDialog()\n\n return (\n <RadixDialog.Overlay\n data-spark-component=\"dialog-overlay\"\n ref={ref}\n className={cx(\n isFullScreen ? 'hidden' : 'fixed',\n ['top-0', 'left-0', 'w-screen', 'h-screen', 'z-overlay'],\n ['bg-overlay/dim-1'],\n ['data-[state=open]:animate-fade-in'],\n ['data-[state=closed]:animate-fade-out'],\n className\n )}\n {...rest}\n />\n )\n}\n\nOverlay.displayName = 'Dialog.Overlay'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement } from 'react'\n\nexport type PortalProps = RadixDialog.DialogPortalProps\n\nexport const Portal = ({ children, ...rest }: PortalProps): ReactElement => (\n <RadixDialog.Portal {...rest}>{children}</RadixDialog.Portal>\n)\n\nPortal.displayName = 'Dialog.Portal'\n","import { cx } from 'class-variance-authority'\nimport { Dialog as RadixDialog } from 'radix-ui'\nimport { Ref } from 'react'\n\nexport type TitleProps = RadixDialog.DialogTitleProps & {\n ref?: Ref<HTMLHeadingElement>\n}\n\nexport const Title = ({ className, ref, ...others }: TitleProps) => {\n return (\n <RadixDialog.Title\n data-spark-component=\"dialog-title\"\n ref={ref}\n className={cx(\n 'text-headline-1 text-on-surface',\n 'group-has-data-[part=close]:pr-3xl',\n className\n )}\n {...others}\n />\n )\n}\n\nTitle.displayName = 'Dialog.Title'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement, ReactNode, Ref } from 'react'\n\nexport interface TriggerProps {\n /**\n * Children of the component.\n */\n children?: ReactNode\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: RadixDialog.DialogTriggerProps['asChild']\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const Trigger = (props: TriggerProps): ReactElement => (\n <RadixDialog.Trigger data-spark-component=\"dialog-trigger\" {...props} />\n)\n\nTrigger.displayName = 'Dialog.Trigger'\n","import { Dialog as Root } from './Dialog'\nimport { Body } from './DialogBody'\nimport { Close } from './DialogClose'\nimport { CloseButton } from './DialogCloseButton'\nimport { Content } from './DialogContent'\nimport { Description } from './DialogDescription' // aria-describedby\nimport { Footer } from './DialogFooter'\nimport { Header } from './DialogHeader'\nimport { Overlay } from './DialogOverlay'\nimport { Portal } from './DialogPortal'\nimport { Title } from './DialogTitle' // aria-labelledby\nimport { Trigger } from './DialogTrigger'\n\nexport const Dialog: typeof Root & {\n Trigger: typeof Trigger\n Portal: typeof Portal\n Overlay: typeof Overlay\n Content: typeof Content\n Header: typeof Header\n Body: typeof Body\n Footer: typeof Footer\n Close: typeof Close\n CloseButton: typeof CloseButton\n Title: typeof Title\n Description: typeof Description\n} = Object.assign(Root, {\n Trigger,\n Portal,\n Overlay,\n Content,\n Header,\n Body,\n Footer,\n Close,\n CloseButton,\n Title,\n Description,\n})\n\nDialog.displayName = 'Dialog'\nDialog.Trigger.displayName = 'Dialog.Trigger'\nTrigger.displayName = 'Dialog.Trigger'\nPortal.displayName = 'Dialog.Portal'\nOverlay.displayName = 'Dialog.Overlay'\nContent.displayName = 'Dialog.Content'\nHeader.displayName = 'Dialog.Header'\nBody.displayName = 'Dialog.Body'\nFooter.displayName = 'Dialog.Footer'\nCloseButton.displayName = 'Dialog.CloseButton'\nTitle.displayName = 'Dialog.Title'\nDescription.displayName = 'Dialog.Description'\n\nexport { type DialogProps } from './Dialog'\nexport { type ContentProps as DialogContentProps } from './DialogContent'\nexport { type HeaderProps as DialogHeaderProps } from './DialogHeader'\nexport { type BodyProps as DialogBodyProps } from './DialogBody'\nexport { type FooterProps as DialogFooterProps } from './DialogFooter'\nexport { type TriggerProps as DialogTriggerProps } from './DialogTrigger'\nexport { type OverlayProps as DialogOverlayProps } from './DialogOverlay'\nexport { type PortalProps as DialogPortalProps } from './DialogPortal'\nexport { type TitleProps as DialogTitleProps } from './DialogTitle'\nexport { type DescriptionProps as DialogDescriptionProps } from './DialogDescription'\nexport { type CloseProps as DialogCloseProps } from './DialogClose'\nexport { type CloseButtonProps as DialogCloseButtonProps } from './DialogCloseButton'\n"],"names":["DialogContext","createContext","DialogProvider","childrenProp","withFade","isFullScreen","setIsFullScreen","useState","jsx","useDialog","context","useContext","Dialog","children","rest","open","activeElementRef","useRef","handleActiveElementFocus","useEffect","RadixDialog","Body","className","inset","forwardedRef","scrollAreaRef","ref","useMergeRefs","overflow","useScrollOverflow","cx","Close","props","Root","ariaLabel","size","intent","design","CloseSVG","IconButton","Icon","CloseButton","Content","isNarrow","onInteractOutside","dialogContentStyles","e","Description","Footer","Header","Overlay","Portal","Title","others","Trigger"],"mappings":"6bAQMA,EAAgBC,EAAAA,cAAyC,IAAI,EAEtDC,EAAiB,CAAC,CAC7B,SAAUC,EACV,SAAAC,EAAW,EACb,IAGM,CACJ,KAAM,CAACC,EAAcC,CAAe,EAAIC,EAAAA,SAAS,EAAK,EAEtD,OACEC,EAAAA,IAACR,EAAc,SAAd,CACC,MAAO,CACL,aAAAK,EACA,gBAAAC,EACA,SAAAF,CAAA,EAGD,SAAAD,CAAA,CAAA,CAGP,EAEaM,EAAY,IAAM,CAC7B,MAAMC,EAAUC,EAAAA,WAAWX,CAAa,EAExC,GAAI,CAACU,EACH,MAAM,M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GAAGN,EAAO,SAAAD,CAAA,CAAS,EAG1CsC,EAAO,YAAc,gBCDd,MAAMC,EAAQ,CAAC,CAAE,UAAA9B,EAAW,IAAAI,EAAK,GAAG2B,KAEvC7C,EAAAA,IAACY,EAAAA,OAAY,MAAZ,CACC,uBAAqB,eACrB,IAAAM,EACA,UAAWI,EAAAA,GACT,kCACA,qCACAR,CAAA,EAED,GAAG+B,CAAA,CAAA,EAKVD,EAAM,YAAc,eCRb,MAAME,EAAWtB,GACtBxB,EAAAA,IAACY,EAAAA,OAAY,QAAZ,CAAoB,uBAAqB,iBAAkB,GAAGY,EAAO,EAGxEsB,EAAQ,YAAc,iBCNf,MAAM1C,EAYT,OAAO,OAAOqB,EAAM,CACtB,QAAAqB,EACA,OAAAH,EACA,QAAAD,EACA,QAAAR,EACA,OAAAO,EACA,KAAA5B,EACA,OAAA2B,EACA,MAAAjB,EACA,YAAAU,EACA,MAAAW,EACA,YAAAL,CACF,CAAC,EAEDnC,EAAO,YAAc,SACrBA,EAAO,QAAQ,YAAc,iBAC7B0C,EAAQ,YAAc,iBACtBH,EAAO,YAAc,gBACrBD,EAAQ,YAAc,iBACtBR,EAAQ,YAAc,iBACtBO,EAAO,YAAc,gBACrB5B,EAAK,YAAc,cACnB2B,EAAO,YAAc,gBACrBP,EAAY,YAAc,qBAC1BW,EAAM,YAAc,eACpBL,EAAY,YAAc"}
@@ -1,166 +1,166 @@
1
1
  import { jsx as l } from "react/jsx-runtime";
2
- import { createContext as O, useState as w, useContext as B, useRef as C, useEffect as b } from "react";
3
- import { R as I, C as P, a as R, D as S, O as H, P as j, T as z, b as A } from "../index-CYjGhVvU.mjs";
4
- import { useMergeRefs as M } from "@spark-ui/hooks/use-merge-refs";
5
- import { useScrollOverflow as L } from "@spark-ui/hooks/use-scroll-overflow";
6
- import { a as c } from "../index-BmAFn37q.mjs";
7
- import { Close as q } from "@spark-ui/icons/Close";
8
- import { I as G } from "../Icon-D1RueiPY.mjs";
9
- import { I as J } from "../IconButton-BY3gYXtU.mjs";
10
- import { d as K } from "../DialogContent.styles-WGWJS9dj.mjs";
11
- const T = O(null), Q = ({
2
+ import { Dialog as s } from "radix-ui";
3
+ import { createContext as I, useState as O, useContext as S, useRef as b, useEffect as k } from "react";
4
+ import { useMergeRefs as P } from "@spark-ui/hooks/use-merge-refs";
5
+ import { useScrollOverflow as R } from "@spark-ui/hooks/use-scroll-overflow";
6
+ import { cx as d } from "class-variance-authority";
7
+ import { Close as $ } from "@spark-ui/icons/Close";
8
+ import { I as H } from "../Icon-Ck-dhfLd.mjs";
9
+ import { I as j } from "../IconButton-C62-axzv.mjs";
10
+ import { d as z } from "../DialogContent.styles-_lRDsl8c.mjs";
11
+ const T = I(null), A = ({
12
12
  children: e,
13
- withFade: a = !1
13
+ withFade: o = !1
14
14
  }) => {
15
- const [t, o] = w(!1);
15
+ const [t, a] = O(!1);
16
16
  return /* @__PURE__ */ l(
17
17
  T.Provider,
18
18
  {
19
19
  value: {
20
20
  isFullScreen: t,
21
- setIsFullScreen: o,
22
- withFade: a
21
+ setIsFullScreen: a,
22
+ withFade: o
23
23
  },
24
24
  children: e
25
25
  }
26
26
  );
27
- }, p = () => {
28
- const e = B(T);
27
+ }, m = () => {
28
+ const e = S(T);
29
29
  if (!e)
30
30
  throw Error("useDialog must be used within a Dialog provider");
31
31
  return e;
32
- }, $ = ({ children: e, withFade: a = !1, ...t }) => {
33
- const o = t.open, s = C(null);
34
- function r() {
35
- o && document.activeElement && (s.current = document.activeElement), o || setTimeout(() => {
36
- s.current instanceof HTMLElement && s.current.focus();
32
+ }, F = ({ children: e, withFade: o = !1, ...t }) => {
33
+ const a = t.open, r = b(null);
34
+ function i() {
35
+ a && document.activeElement && (r.current = document.activeElement), a || setTimeout(() => {
36
+ r.current instanceof HTMLElement && r.current.focus();
37
37
  }, 0);
38
38
  }
39
- return b(r, [o]), /* @__PURE__ */ l(Q, { withFade: a, children: /* @__PURE__ */ l(I, { ...t, children: e }) });
39
+ return k(i, [a]), /* @__PURE__ */ l(A, { withFade: o, children: /* @__PURE__ */ l(s.Root, { ...t, children: e }) });
40
40
  };
41
- $.displayName = "Dialog.Root";
42
- const m = ({
41
+ F.displayName = "Dialog.Root";
42
+ const g = ({
43
43
  children: e,
44
- className: a,
44
+ className: o,
45
45
  inset: t = !1,
46
- ref: o,
47
- ...s
46
+ ref: a,
47
+ ...r
48
48
  }) => {
49
- const r = C(null), d = M(o, r), { withFade: i } = p(), { overflow: n } = L(r);
49
+ const i = b(null), p = P(a, i), { withFade: n } = m(), { overflow: c } = R(i);
50
50
  return /* @__PURE__ */ l(
51
51
  "div",
52
52
  {
53
53
  "data-spark-component": "dialog-body",
54
- ref: d,
55
- className: c(
54
+ ref: p,
55
+ className: d(
56
56
  "focus-visible:u-outline relative grow overflow-y-auto outline-hidden",
57
57
  "transition-all duration-300",
58
58
  {
59
59
  "px-xl py-lg": !t
60
60
  },
61
- a
61
+ o
62
62
  ),
63
63
  style: {
64
- ...i && {
64
+ ...n && {
65
65
  maskImage: "linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 44px, rgba(0, 0, 0, 1) calc(100% - 44px), rgba(0, 0, 0, 0))",
66
- maskSize: `100% calc(100% + ${n.top ? "0px" : "44px"} + ${n.bottom ? "0px" : "44px"})`,
67
- maskPosition: `0 ${n.top ? "0px" : "-44px"}`
66
+ maskSize: `100% calc(100% + ${c.top ? "0px" : "44px"} + ${c.bottom ? "0px" : "44px"})`,
67
+ maskPosition: `0 ${c.top ? "0px" : "-44px"}`
68
68
  }
69
69
  },
70
- ...s,
70
+ ...r,
71
71
  children: e
72
72
  }
73
73
  );
74
74
  };
75
- m.displayName = "Dialog.Body";
76
- const g = (e) => /* @__PURE__ */ l(P, { ...e });
77
- g.displayName = "Dialog.Close";
78
- const k = ({
75
+ g.displayName = "Dialog.Body";
76
+ const u = (e) => /* @__PURE__ */ l(s.Close, { ...e });
77
+ u.displayName = "Dialog.Close";
78
+ const E = ({
79
79
  "aria-label": e,
80
- className: a,
80
+ className: o,
81
81
  size: t = "md",
82
- intent: o = "neutral",
83
- design: s = "ghost",
84
- children: r = /* @__PURE__ */ l(q, {}),
85
- ref: d,
86
- ...i
82
+ intent: a = "neutral",
83
+ design: r = "ghost",
84
+ children: i = /* @__PURE__ */ l($, {}),
85
+ ref: p,
86
+ ...n
87
87
  }) => /* @__PURE__ */ l(
88
- g,
88
+ u,
89
89
  {
90
90
  "data-spark-component": "dialog-close-button",
91
91
  "data-part": "close",
92
- ref: d,
93
- className: c(["absolute", "top-md", "right-xl"], a),
92
+ ref: p,
93
+ className: d(["absolute", "top-md", "right-xl"], o),
94
94
  asChild: !0,
95
- ...i,
96
- children: /* @__PURE__ */ l(J, { intent: o, size: t, design: s, "aria-label": e, children: /* @__PURE__ */ l(G, { children: r }) })
95
+ ...n,
96
+ children: /* @__PURE__ */ l(j, { intent: a, size: t, design: r, "aria-label": e, children: /* @__PURE__ */ l(H, { children: i }) })
97
97
  }
98
- ), F = Object.assign(k, {
98
+ ), w = Object.assign(E, {
99
99
  id: "CloseButton"
100
100
  });
101
- k.displayName = "Dialog.CloseButton";
102
- const u = ({
101
+ E.displayName = "Dialog.CloseButton";
102
+ const f = ({
103
103
  children: e,
104
- className: a,
104
+ className: o,
105
105
  isNarrow: t = !1,
106
- size: o = "md",
107
- onInteractOutside: s,
108
- ref: r,
109
- ...d
106
+ size: a = "md",
107
+ onInteractOutside: r,
108
+ ref: i,
109
+ ...p
110
110
  }) => {
111
- const { setIsFullScreen: i } = p();
112
- return b(() => (o === "fullscreen" && i(!0), () => i(!1)), [i, o]), /* @__PURE__ */ l(
113
- R,
111
+ const { setIsFullScreen: n } = m();
112
+ return k(() => (a === "fullscreen" && n(!0), () => n(!1)), [n, a]), /* @__PURE__ */ l(
113
+ s.Content,
114
114
  {
115
115
  "data-spark-component": "dialog-content",
116
- ref: r,
117
- className: K({
118
- className: a,
116
+ ref: i,
117
+ className: z({
118
+ className: o,
119
119
  isNarrow: t,
120
- size: o
120
+ size: a
121
121
  }),
122
- onInteractOutside: (n) => {
123
- n.target.closest(".z-toast, .z-popover") && n.preventDefault(), s?.(n);
122
+ onInteractOutside: (c) => {
123
+ c.target.closest(".z-toast, .z-popover") && c.preventDefault(), r?.(c);
124
124
  },
125
- ...d,
125
+ ...p,
126
126
  children: e
127
127
  }
128
128
  );
129
129
  };
130
- u.displayName = "Dialog.Content";
131
- const f = (e) => /* @__PURE__ */ l(S, { "data-spark-component": "dialog-description", ...e });
132
- f.displayName = "Dialog.Description";
133
- const y = ({ children: e, className: a, ref: t, ...o }) => /* @__PURE__ */ l(
130
+ f.displayName = "Dialog.Content";
131
+ const y = (e) => /* @__PURE__ */ l(s.Description, { "data-spark-component": "dialog-description", ...e });
132
+ y.displayName = "Dialog.Description";
133
+ const D = ({ children: e, className: o, ref: t, ...a }) => /* @__PURE__ */ l(
134
134
  "footer",
135
135
  {
136
136
  "data-spark-component": "dialog-footer",
137
137
  ref: t,
138
- className: c(a, ["px-xl", "py-lg"]),
139
- ...o,
138
+ className: d(o, ["px-xl", "py-lg"]),
139
+ ...a,
140
140
  children: e
141
141
  }
142
142
  );
143
- y.displayName = "Dialog.Footer";
144
- const D = ({ children: e, className: a, ref: t, ...o }) => /* @__PURE__ */ l(
143
+ D.displayName = "Dialog.Footer";
144
+ const N = ({ children: e, className: o, ref: t, ...a }) => /* @__PURE__ */ l(
145
145
  "header",
146
146
  {
147
147
  "data-spark-component": "dialog-header",
148
148
  ref: t,
149
- className: c(a, ["px-xl", "py-lg"]),
150
- ...o,
149
+ className: d(o, ["px-xl", "py-lg"]),
150
+ ...a,
151
151
  children: e
152
152
  }
153
153
  );
154
- D.displayName = "Dialog.Header";
155
- const N = ({ className: e, ref: a, ...t }) => {
156
- const { isFullScreen: o } = p();
154
+ N.displayName = "Dialog.Header";
155
+ const x = ({ className: e, ref: o, ...t }) => {
156
+ const { isFullScreen: a } = m();
157
157
  return /* @__PURE__ */ l(
158
- H,
158
+ s.Overlay,
159
159
  {
160
160
  "data-spark-component": "dialog-overlay",
161
- ref: a,
162
- className: c(
163
- o ? "hidden" : "fixed",
161
+ ref: o,
162
+ className: d(
163
+ a ? "hidden" : "fixed",
164
164
  ["top-0", "left-0", "w-screen", "h-screen", "z-overlay"],
165
165
  ["bg-overlay/dim-1"],
166
166
  ["data-[state=open]:animate-fade-in"],
@@ -171,15 +171,15 @@ const N = ({ className: e, ref: a, ...t }) => {
171
171
  }
172
172
  );
173
173
  };
174
- N.displayName = "Dialog.Overlay";
175
- const x = ({ children: e, ...a }) => /* @__PURE__ */ l(j, { ...a, children: e });
176
- x.displayName = "Dialog.Portal";
177
- const v = ({ className: e, ref: a, ...t }) => /* @__PURE__ */ l(
178
- z,
174
+ x.displayName = "Dialog.Overlay";
175
+ const v = ({ children: e, ...o }) => /* @__PURE__ */ l(s.Portal, { ...o, children: e });
176
+ v.displayName = "Dialog.Portal";
177
+ const h = ({ className: e, ref: o, ...t }) => /* @__PURE__ */ l(
178
+ s.Title,
179
179
  {
180
180
  "data-spark-component": "dialog-title",
181
- ref: a,
182
- className: c(
181
+ ref: o,
182
+ className: d(
183
183
  "text-headline-1 text-on-surface",
184
184
  "group-has-data-[part=close]:pr-3xl",
185
185
  e
@@ -187,35 +187,35 @@ const v = ({ className: e, ref: a, ...t }) => /* @__PURE__ */ l(
187
187
  ...t
188
188
  }
189
189
  );
190
- v.displayName = "Dialog.Title";
191
- const h = (e) => /* @__PURE__ */ l(A, { "data-spark-component": "dialog-trigger", ...e });
192
- h.displayName = "Dialog.Trigger";
193
- const E = Object.assign($, {
194
- Trigger: h,
195
- Portal: x,
196
- Overlay: N,
197
- Content: u,
198
- Header: D,
199
- Body: m,
200
- Footer: y,
201
- Close: g,
202
- CloseButton: F,
203
- Title: v,
204
- Description: f
190
+ h.displayName = "Dialog.Title";
191
+ const C = (e) => /* @__PURE__ */ l(s.Trigger, { "data-spark-component": "dialog-trigger", ...e });
192
+ C.displayName = "Dialog.Trigger";
193
+ const B = Object.assign(F, {
194
+ Trigger: C,
195
+ Portal: v,
196
+ Overlay: x,
197
+ Content: f,
198
+ Header: N,
199
+ Body: g,
200
+ Footer: D,
201
+ Close: u,
202
+ CloseButton: w,
203
+ Title: h,
204
+ Description: y
205
205
  });
206
- E.displayName = "Dialog";
207
- E.Trigger.displayName = "Dialog.Trigger";
208
- h.displayName = "Dialog.Trigger";
209
- x.displayName = "Dialog.Portal";
210
- N.displayName = "Dialog.Overlay";
211
- u.displayName = "Dialog.Content";
212
- D.displayName = "Dialog.Header";
213
- m.displayName = "Dialog.Body";
214
- y.displayName = "Dialog.Footer";
215
- F.displayName = "Dialog.CloseButton";
216
- v.displayName = "Dialog.Title";
217
- f.displayName = "Dialog.Description";
206
+ B.displayName = "Dialog";
207
+ B.Trigger.displayName = "Dialog.Trigger";
208
+ C.displayName = "Dialog.Trigger";
209
+ v.displayName = "Dialog.Portal";
210
+ x.displayName = "Dialog.Overlay";
211
+ f.displayName = "Dialog.Content";
212
+ N.displayName = "Dialog.Header";
213
+ g.displayName = "Dialog.Body";
214
+ D.displayName = "Dialog.Footer";
215
+ w.displayName = "Dialog.CloseButton";
216
+ h.displayName = "Dialog.Title";
217
+ y.displayName = "Dialog.Description";
218
218
  export {
219
- E as Dialog
219
+ B as Dialog
220
220
  };
221
221
  //# sourceMappingURL=index.mjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.mjs","sources":["../../src/dialog/DialogContext.tsx","../../src/dialog/Dialog.tsx","../../src/dialog/DialogBody.tsx","../../src/dialog/DialogClose.tsx","../../src/dialog/DialogCloseButton.tsx","../../src/dialog/DialogContent.tsx","../../src/dialog/DialogDescription.tsx","../../src/dialog/DialogFooter.tsx","../../src/dialog/DialogHeader.tsx","../../src/dialog/DialogOverlay.tsx","../../src/dialog/DialogPortal.tsx","../../src/dialog/DialogTitle.tsx","../../src/dialog/DialogTrigger.tsx","../../src/dialog/index.ts"],"sourcesContent":["import { createContext, type ReactNode, useContext, useState } from 'react'\n\nexport interface DialogContextState {\n isFullScreen: boolean\n setIsFullScreen: (value: boolean) => void\n withFade: boolean\n}\n\nconst DialogContext = createContext<DialogContextState | null>(null)\n\nexport const DialogProvider = ({\n children: childrenProp,\n withFade = false,\n}: {\n children: ReactNode\n withFade?: boolean\n}) => {\n const [isFullScreen, setIsFullScreen] = useState(false)\n\n return (\n <DialogContext.Provider\n value={{\n isFullScreen,\n setIsFullScreen,\n withFade,\n }}\n >\n {childrenProp}\n </DialogContext.Provider>\n )\n}\n\nexport const useDialog = () => {\n const context = useContext(DialogContext)\n\n if (!context) {\n throw Error('useDialog must be used within a Dialog provider')\n }\n\n return context\n}\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement, useEffect, useRef } from 'react'\n\nimport { DialogProvider } from './DialogContext'\n\nexport interface DialogProps {\n /**\n * Children of the component.\n */\n children?: RadixDialog.DialogProps['children']\n /**\n * Specifies if the dialog is open or not.\n */\n open?: RadixDialog.DialogProps['open']\n /**\n * Default open state.\n */\n defaultOpen?: RadixDialog.DialogProps['defaultOpen']\n /**\n * Handler executen on every dialog open state change.\n */\n onOpenChange?: RadixDialog.DialogProps['onOpenChange']\n /**\n * Specifies if the dialog is a modal.\n */\n modal?: RadixDialog.DialogProps['modal']\n /**\n * Specifies if the dialog should have a fade animation on its body (in case it is scrollable).\n */\n withFade?: boolean\n}\n\nexport const Dialog = ({ children, withFade = false, ...rest }: DialogProps): ReactElement => {\n const open = rest.open\n const activeElementRef = useRef<Element>(null)\n\n /**\n * This function captures the active element when the Dialog is opened\n * and sets focus back to it when the Dialog is closed.\n */\n function handleActiveElementFocus() {\n if (open && document.activeElement) {\n activeElementRef.current = document.activeElement\n }\n\n if (!open) {\n setTimeout(() => {\n if (!(activeElementRef.current instanceof HTMLElement)) return\n activeElementRef.current.focus()\n }, 0)\n }\n }\n\n useEffect(handleActiveElementFocus, [open])\n\n return (\n <DialogProvider withFade={withFade}>\n <RadixDialog.Root {...rest}>{children}</RadixDialog.Root>\n </DialogProvider>\n )\n}\n\nDialog.displayName = 'Dialog.Root'\n","import { useMergeRefs } from '@spark-ui/hooks/use-merge-refs'\nimport { useScrollOverflow } from '@spark-ui/hooks/use-scroll-overflow'\nimport { cx } from 'class-variance-authority'\nimport { type ReactElement, type ReactNode, Ref, useRef } from 'react'\n\nimport { useDialog } from './DialogContext'\n\nexport interface BodyProps {\n children: ReactNode\n className?: string\n tabIndex?: number\n ref?: Ref<HTMLDivElement>\n inset?: boolean\n}\n\nexport const Body = ({\n children,\n className,\n inset = false,\n ref: forwardedRef,\n ...rest\n}: BodyProps): ReactElement => {\n const scrollAreaRef = useRef<HTMLDivElement>(null)\n const ref = useMergeRefs(forwardedRef, scrollAreaRef)\n\n const { withFade } = useDialog()\n\n const { overflow } = useScrollOverflow(scrollAreaRef)\n\n return (\n <div\n data-spark-component=\"dialog-body\"\n ref={ref}\n className={cx(\n 'focus-visible:u-outline relative grow overflow-y-auto outline-hidden',\n 'transition-all duration-300',\n {\n ['px-xl py-lg']: !inset,\n },\n className\n )}\n style={{\n ...(withFade && {\n maskImage:\n 'linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 44px, rgba(0, 0, 0, 1) calc(100% - 44px), rgba(0, 0, 0, 0))',\n maskSize: `100% calc(100% + ${overflow.top ? '0px' : '44px'} + ${overflow.bottom ? '0px' : '44px'})`,\n maskPosition: `0 ${overflow.top ? '0px' : '-44px'}`,\n }),\n }}\n {...rest}\n >\n {children}\n </div>\n )\n}\n\nBody.displayName = 'Dialog.Body'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { Ref } from 'react'\n\nexport type CloseProps = RadixDialog.DialogCloseProps & {\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const Close = (props: CloseProps) => <RadixDialog.Close {...props} />\n\nClose.displayName = 'Dialog.Close'\n","import { Close as CloseSVG } from '@spark-ui/icons/Close'\nimport { cx } from 'class-variance-authority'\n\nimport { Icon } from '../icon'\nimport { IconButton, type IconButtonProps } from '../icon-button'\nimport { Close, CloseProps } from './DialogClose'\n\nexport type CloseButtonProps = CloseProps &\n Pick<IconButtonProps, 'size' | 'intent' | 'design' | 'aria-label'>\n\nconst Root = ({\n 'aria-label': ariaLabel,\n className,\n size = 'md',\n intent = 'neutral',\n design = 'ghost',\n children = <CloseSVG />,\n ref,\n ...rest\n}: CloseButtonProps) => {\n return (\n <Close\n data-spark-component=\"dialog-close-button\"\n data-part=\"close\"\n ref={ref}\n className={cx(['absolute', 'top-md', 'right-xl'], className)}\n asChild\n {...rest}\n >\n <IconButton intent={intent} size={size} design={design} aria-label={ariaLabel}>\n <Icon>{children}</Icon>\n </IconButton>\n </Close>\n )\n}\n\nexport const CloseButton = Object.assign(Root, {\n id: 'CloseButton',\n})\n\nRoot.displayName = 'Dialog.CloseButton'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement, Ref, useEffect } from 'react'\n\nimport { dialogContentStyles, type DialogContentStylesProps } from './DialogContent.styles'\nimport { useDialog } from './DialogContext'\n\nexport interface ContentProps extends RadixDialog.DialogContentProps, DialogContentStylesProps {\n /**\n * When set to true, the content will adjust its width to fit the content rather than taking up the full available width.\n */\n isNarrow?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Content = ({\n children,\n className,\n isNarrow = false,\n size = 'md',\n onInteractOutside,\n ref,\n ...rest\n}: ContentProps): ReactElement => {\n const { setIsFullScreen } = useDialog()\n\n useEffect(() => {\n if (size === 'fullscreen') setIsFullScreen(true)\n\n return () => setIsFullScreen(false)\n }, [setIsFullScreen, size])\n\n return (\n <RadixDialog.Content\n data-spark-component=\"dialog-content\"\n ref={ref}\n className={dialogContentStyles({\n className,\n isNarrow,\n size,\n })}\n onInteractOutside={e => {\n const isForegroundElement = (e.target as HTMLElement).closest('.z-toast, .z-popover')\n\n /**\n * The focus trap of the dialog applies `pointer-events-none` on the body of the page in the background, but\n * some components with an higher z-index have `pointer-events-auto` applied on them to remain interactive and ignore the focust trap (ex: a Snackbar with actions).\n *\n * Clicking on the snackbar will be considered as an \"outside click\" and close the dialog. We want to prevent this.\n */\n if (isForegroundElement) {\n e.preventDefault()\n }\n\n onInteractOutside?.(e)\n }}\n {...rest}\n >\n {children}\n </RadixDialog.Content>\n )\n}\n\nContent.displayName = 'Dialog.Content'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { Ref } from 'react'\n\nexport type DescriptionProps = RadixDialog.DialogDescriptionProps & {\n ref?: Ref<HTMLParagraphElement>\n}\n\nexport const Description = (props: DescriptionProps) => (\n <RadixDialog.Description data-spark-component=\"dialog-description\" {...props} />\n)\n\nDescription.displayName = 'Dialog.Description'\n","import { cx } from 'class-variance-authority'\nimport { type ReactElement, type ReactNode, Ref } from 'react'\n\nexport interface FooterProps {\n children: ReactNode\n className?: string\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Footer = ({ children, className, ref, ...rest }: FooterProps): ReactElement => (\n <footer\n data-spark-component=\"dialog-footer\"\n ref={ref}\n className={cx(className, ['px-xl', 'py-lg'])}\n {...rest}\n >\n {children}\n </footer>\n)\n\nFooter.displayName = 'Dialog.Footer'\n","import { cx } from 'class-variance-authority'\nimport { type ReactElement, type ReactNode, Ref } from 'react'\n\nexport interface HeaderProps {\n children: ReactNode\n className?: string\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Header = ({ children, className, ref, ...rest }: HeaderProps): ReactElement => (\n <header\n data-spark-component=\"dialog-header\"\n ref={ref}\n className={cx(className, ['px-xl', 'py-lg'])}\n {...rest}\n >\n {children}\n </header>\n)\n\nHeader.displayName = 'Dialog.Header'\n","import { cx } from 'class-variance-authority'\nimport { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement, Ref } from 'react'\n\nimport { useDialog } from './DialogContext'\n\nexport type OverlayProps = RadixDialog.DialogOverlayProps & {\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Overlay = ({ className, ref, ...rest }: OverlayProps): ReactElement | null => {\n const { isFullScreen } = useDialog()\n\n return (\n <RadixDialog.Overlay\n data-spark-component=\"dialog-overlay\"\n ref={ref}\n className={cx(\n isFullScreen ? 'hidden' : 'fixed',\n ['top-0', 'left-0', 'w-screen', 'h-screen', 'z-overlay'],\n ['bg-overlay/dim-1'],\n ['data-[state=open]:animate-fade-in'],\n ['data-[state=closed]:animate-fade-out'],\n className\n )}\n {...rest}\n />\n )\n}\n\nOverlay.displayName = 'Dialog.Overlay'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement } from 'react'\n\nexport type PortalProps = RadixDialog.DialogPortalProps\n\nexport const Portal = ({ children, ...rest }: PortalProps): ReactElement => (\n <RadixDialog.Portal {...rest}>{children}</RadixDialog.Portal>\n)\n\nPortal.displayName = 'Dialog.Portal'\n","import { cx } from 'class-variance-authority'\nimport { Dialog as RadixDialog } from 'radix-ui'\nimport { Ref } from 'react'\n\nexport type TitleProps = RadixDialog.DialogTitleProps & {\n ref?: Ref<HTMLHeadingElement>\n}\n\nexport const Title = ({ className, ref, ...others }: TitleProps) => {\n return (\n <RadixDialog.Title\n data-spark-component=\"dialog-title\"\n ref={ref}\n className={cx(\n 'text-headline-1 text-on-surface',\n 'group-has-data-[part=close]:pr-3xl',\n className\n )}\n {...others}\n />\n )\n}\n\nTitle.displayName = 'Dialog.Title'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement, ReactNode, Ref } from 'react'\n\nexport interface TriggerProps {\n /**\n * Children of the component.\n */\n children?: ReactNode\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: RadixDialog.DialogTriggerProps['asChild']\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const Trigger = (props: TriggerProps): ReactElement => (\n <RadixDialog.Trigger data-spark-component=\"dialog-trigger\" {...props} />\n)\n\nTrigger.displayName = 'Dialog.Trigger'\n","import { Dialog as Root } from './Dialog'\nimport { Body } from './DialogBody'\nimport { Close } from './DialogClose'\nimport { CloseButton } from './DialogCloseButton'\nimport { Content } from './DialogContent'\nimport { Description } from './DialogDescription' // aria-describedby\nimport { Footer } from './DialogFooter'\nimport { Header } from './DialogHeader'\nimport { Overlay } from './DialogOverlay'\nimport { Portal } from './DialogPortal'\nimport { Title } from './DialogTitle' // aria-labelledby\nimport { Trigger } from './DialogTrigger'\n\nexport const Dialog: typeof Root & {\n Trigger: typeof Trigger\n Portal: typeof Portal\n Overlay: typeof Overlay\n Content: typeof Content\n Header: typeof Header\n Body: typeof Body\n Footer: typeof Footer\n Close: typeof Close\n CloseButton: typeof CloseButton\n Title: typeof Title\n Description: typeof Description\n} = Object.assign(Root, {\n Trigger,\n Portal,\n Overlay,\n Content,\n Header,\n Body,\n Footer,\n Close,\n CloseButton,\n Title,\n Description,\n})\n\nDialog.displayName = 'Dialog'\nDialog.Trigger.displayName = 'Dialog.Trigger'\nTrigger.displayName = 'Dialog.Trigger'\nPortal.displayName = 'Dialog.Portal'\nOverlay.displayName = 'Dialog.Overlay'\nContent.displayName = 'Dialog.Content'\nHeader.displayName = 'Dialog.Header'\nBody.displayName = 'Dialog.Body'\nFooter.displayName = 'Dialog.Footer'\nCloseButton.displayName = 'Dialog.CloseButton'\nTitle.displayName = 'Dialog.Title'\nDescription.displayName = 'Dialog.Description'\n\nexport { type DialogProps } from './Dialog'\nexport { type ContentProps as DialogContentProps } from './DialogContent'\nexport { type HeaderProps as DialogHeaderProps } from './DialogHeader'\nexport { type BodyProps as DialogBodyProps } from './DialogBody'\nexport { type FooterProps as DialogFooterProps } from './DialogFooter'\nexport { type TriggerProps as DialogTriggerProps } from './DialogTrigger'\nexport { type OverlayProps as DialogOverlayProps } from './DialogOverlay'\nexport { type PortalProps as DialogPortalProps } from './DialogPortal'\nexport { type TitleProps as DialogTitleProps } from './DialogTitle'\nexport { type DescriptionProps as DialogDescriptionProps } from './DialogDescription'\nexport { type CloseProps as DialogCloseProps } from './DialogClose'\nexport { type CloseButtonProps as DialogCloseButtonProps } from './DialogCloseButton'\n"],"names":["DialogContext","createContext","DialogProvider","childrenProp","withFade","isFullScreen","setIsFullScreen","useState","jsx","useDialog","context","useContext","Dialog","children","rest","open","activeElementRef","useRef","handleActiveElementFocus","useEffect","RadixDialog.Root","Body","className","inset","forwardedRef","scrollAreaRef","ref","useMergeRefs","overflow","useScrollOverflow","cx","Close","props","RadixDialog.Close","Root","ariaLabel","size","intent","design","CloseSVG","IconButton","Icon","CloseButton","Content","isNarrow","onInteractOutside","RadixDialog.Content","dialogContentStyles","e","Description","RadixDialog.Description","Footer","Header","Overlay","RadixDialog.Overlay","Portal","RadixDialog.Portal","Title","others","RadixDialog.Title","Trigger","RadixDialog.Trigger"],"mappings":";;;;;;;;;;AAQA,MAAMA,IAAgBC,EAAyC,IAAI,GAEtDC,IAAiB,CAAC;AAAA,EAC7B,UAAUC;AAAA,EACV,UAAAC,IAAW;AACb,MAGM;AACJ,QAAM,CAACC,GAAcC,CAAe,IAAIC,EAAS,EAAK;AAEtD,SACE,gBAAAC;AAAA,IAACR,EAAc;AAAA,IAAd;AAAA,MACC,OAAO;AAAA,QACL,cAAAK;AAAA,QACA,iBAAAC;AAAA,QACA,UAAAF;AAAA,MAAA;AAAA,MAGD,UAAAD;AAAA,IAAA;AAAA,EAAA;AAGP,GAEaM,IAAY,MAAM;AAC7B,QAAMC,IAAUC,EAAWX,CAAa;AAExC,MAAI,CAACU;AACH,UAAM,MAAM,iDAAiD;AAG/D,SAAOA;AACT,GCRaE,IAAS,CAAC,EAAE,UAAAC,GAAU,UAAAT,IAAW,IAAO,GAAGU,QAAsC;AAC5F,QAAMC,IAAOD,EAAK,MACZE,IAAmBC,EAAgB,IAAI;AAM7C,WAASC,IAA2B;AAClC,IAAIH,KAAQ,SAAS,kBACnBC,EAAiB,UAAU,SAAS,gBAGjCD,KACH,WAAW,MAAM;AACf,MAAMC,EAAiB,mBAAmB,eAC1CA,EAAiB,QAAQ,MAAA;AAAA,IAC3B,GAAG,CAAC;AAAA,EAER;AAEA,SAAAG,EAAUD,GAA0B,CAACH,CAAI,CAAC,GAGxC,gBAAAP,EAACN,GAAA,EAA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,MACpC,gBAAAN,EAACgD,GAAA,EAAoB,GAAG1C,GAAO,UAAAD,GAAS;AAG1C0C,EAAO,cAAc;ACDd,MAAME,IAAQ,CAAC,EAAE,WAAAnC,GAAW,KAAAI,GAAK,GAAGgC,QAEvC,gBAAAlD;AAAA,EAACmD;AAAAA,EAAA;AAAA,IACC,wBAAqB;AAAA,IACrB,KAAAjC;AAAA,IACA,WAAWI;AAAA,MACT;AAAA,MACA;AAAA,MACAR;AAAA,IAAA;AAAA,IAED,GAAGoC;AAAA,EAAA;AAAA;AAKVD,EAAM,cAAc;ACRb,MAAMG,IAAU,CAAC5B,MACtB,gBAAAxB,EAACqD,GAAA,EAAoB,wBAAqB,kBAAkB,GAAG7B,GAAO;AAGxE4B,EAAQ,cAAc;ACNf,MAAMhD,IAYT,OAAO,OAAOsB,GAAM;AAAA,EACtB,SAAA0B;AAAA,EACA,QAAAL;AAAA,EACA,SAAAF;AAAA,EACA,SAAAV;AAAA,EACA,QAAAS;AAAA,EACA,MAAA/B;AAAA,EACA,QAAA8B;AAAA,EACA,OAAApB;AAAA,EACA,aAAAW;AAAA,EACA,OAAAe;AAAA,EACA,aAAAR;AACF,CAAC;AAEDrC,EAAO,cAAc;AACrBA,EAAO,QAAQ,cAAc;AAC7BgD,EAAQ,cAAc;AACtBL,EAAO,cAAc;AACrBF,EAAQ,cAAc;AACtBV,EAAQ,cAAc;AACtBS,EAAO,cAAc;AACrB/B,EAAK,cAAc;AACnB8B,EAAO,cAAc;AACrBT,EAAY,cAAc;AAC1Be,EAAM,cAAc;AACpBR,EAAY,cAAc;"}
1
+ {"version":3,"file":"index.mjs","sources":["../../src/dialog/DialogContext.tsx","../../src/dialog/Dialog.tsx","../../src/dialog/DialogBody.tsx","../../src/dialog/DialogClose.tsx","../../src/dialog/DialogCloseButton.tsx","../../src/dialog/DialogContent.tsx","../../src/dialog/DialogDescription.tsx","../../src/dialog/DialogFooter.tsx","../../src/dialog/DialogHeader.tsx","../../src/dialog/DialogOverlay.tsx","../../src/dialog/DialogPortal.tsx","../../src/dialog/DialogTitle.tsx","../../src/dialog/DialogTrigger.tsx","../../src/dialog/index.ts"],"sourcesContent":["import { createContext, type ReactNode, useContext, useState } from 'react'\n\nexport interface DialogContextState {\n isFullScreen: boolean\n setIsFullScreen: (value: boolean) => void\n withFade: boolean\n}\n\nconst DialogContext = createContext<DialogContextState | null>(null)\n\nexport const DialogProvider = ({\n children: childrenProp,\n withFade = false,\n}: {\n children: ReactNode\n withFade?: boolean\n}) => {\n const [isFullScreen, setIsFullScreen] = useState(false)\n\n return (\n <DialogContext.Provider\n value={{\n isFullScreen,\n setIsFullScreen,\n withFade,\n }}\n >\n {childrenProp}\n </DialogContext.Provider>\n )\n}\n\nexport const useDialog = () => {\n const context = useContext(DialogContext)\n\n if (!context) {\n throw Error('useDialog must be used within a Dialog provider')\n }\n\n return context\n}\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement, useEffect, useRef } from 'react'\n\nimport { DialogProvider } from './DialogContext'\n\nexport interface DialogProps {\n /**\n * Children of the component.\n */\n children?: RadixDialog.DialogProps['children']\n /**\n * Specifies if the dialog is open or not.\n */\n open?: RadixDialog.DialogProps['open']\n /**\n * Default open state.\n */\n defaultOpen?: RadixDialog.DialogProps['defaultOpen']\n /**\n * Handler executen on every dialog open state change.\n */\n onOpenChange?: RadixDialog.DialogProps['onOpenChange']\n /**\n * Specifies if the dialog is a modal.\n */\n modal?: RadixDialog.DialogProps['modal']\n /**\n * Specifies if the dialog should have a fade animation on its body (in case it is scrollable).\n */\n withFade?: boolean\n}\n\nexport const Dialog = ({ children, withFade = false, ...rest }: DialogProps): ReactElement => {\n const open = rest.open\n const activeElementRef = useRef<Element>(null)\n\n /**\n * This function captures the active element when the Dialog is opened\n * and sets focus back to it when the Dialog is closed.\n */\n function handleActiveElementFocus() {\n if (open && document.activeElement) {\n activeElementRef.current = document.activeElement\n }\n\n if (!open) {\n setTimeout(() => {\n if (!(activeElementRef.current instanceof HTMLElement)) return\n activeElementRef.current.focus()\n }, 0)\n }\n }\n\n useEffect(handleActiveElementFocus, [open])\n\n return (\n <DialogProvider withFade={withFade}>\n <RadixDialog.Root {...rest}>{children}</RadixDialog.Root>\n </DialogProvider>\n )\n}\n\nDialog.displayName = 'Dialog.Root'\n","import { useMergeRefs } from '@spark-ui/hooks/use-merge-refs'\nimport { useScrollOverflow } from '@spark-ui/hooks/use-scroll-overflow'\nimport { cx } from 'class-variance-authority'\nimport { type ReactElement, type ReactNode, Ref, useRef } from 'react'\n\nimport { useDialog } from './DialogContext'\n\nexport interface BodyProps {\n children: ReactNode\n className?: string\n tabIndex?: number\n ref?: Ref<HTMLDivElement>\n inset?: boolean\n}\n\nexport const Body = ({\n children,\n className,\n inset = false,\n ref: forwardedRef,\n ...rest\n}: BodyProps): ReactElement => {\n const scrollAreaRef = useRef<HTMLDivElement>(null)\n const ref = useMergeRefs(forwardedRef, scrollAreaRef)\n\n const { withFade } = useDialog()\n\n const { overflow } = useScrollOverflow(scrollAreaRef)\n\n return (\n <div\n data-spark-component=\"dialog-body\"\n ref={ref}\n className={cx(\n 'focus-visible:u-outline relative grow overflow-y-auto outline-hidden',\n 'transition-all duration-300',\n {\n ['px-xl py-lg']: !inset,\n },\n className\n )}\n style={{\n ...(withFade && {\n maskImage:\n 'linear-gradient(to bottom, rgba(0, 0, 0, 0), rgba(0, 0, 0, 1) 44px, rgba(0, 0, 0, 1) calc(100% - 44px), rgba(0, 0, 0, 0))',\n maskSize: `100% calc(100% + ${overflow.top ? '0px' : '44px'} + ${overflow.bottom ? '0px' : '44px'})`,\n maskPosition: `0 ${overflow.top ? '0px' : '-44px'}`,\n }),\n }}\n {...rest}\n >\n {children}\n </div>\n )\n}\n\nBody.displayName = 'Dialog.Body'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { Ref } from 'react'\n\nexport type CloseProps = RadixDialog.DialogCloseProps & {\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const Close = (props: CloseProps) => <RadixDialog.Close {...props} />\n\nClose.displayName = 'Dialog.Close'\n","import { Close as CloseSVG } from '@spark-ui/icons/Close'\nimport { cx } from 'class-variance-authority'\n\nimport { Icon } from '../icon'\nimport { IconButton, type IconButtonProps } from '../icon-button'\nimport { Close, CloseProps } from './DialogClose'\n\nexport type CloseButtonProps = CloseProps &\n Pick<IconButtonProps, 'size' | 'intent' | 'design' | 'aria-label'>\n\nconst Root = ({\n 'aria-label': ariaLabel,\n className,\n size = 'md',\n intent = 'neutral',\n design = 'ghost',\n children = <CloseSVG />,\n ref,\n ...rest\n}: CloseButtonProps) => {\n return (\n <Close\n data-spark-component=\"dialog-close-button\"\n data-part=\"close\"\n ref={ref}\n className={cx(['absolute', 'top-md', 'right-xl'], className)}\n asChild\n {...rest}\n >\n <IconButton intent={intent} size={size} design={design} aria-label={ariaLabel}>\n <Icon>{children}</Icon>\n </IconButton>\n </Close>\n )\n}\n\nexport const CloseButton = Object.assign(Root, {\n id: 'CloseButton',\n})\n\nRoot.displayName = 'Dialog.CloseButton'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement, Ref, useEffect } from 'react'\n\nimport { dialogContentStyles, type DialogContentStylesProps } from './DialogContent.styles'\nimport { useDialog } from './DialogContext'\n\nexport interface ContentProps extends RadixDialog.DialogContentProps, DialogContentStylesProps {\n /**\n * When set to true, the content will adjust its width to fit the content rather than taking up the full available width.\n */\n isNarrow?: boolean\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Content = ({\n children,\n className,\n isNarrow = false,\n size = 'md',\n onInteractOutside,\n ref,\n ...rest\n}: ContentProps): ReactElement => {\n const { setIsFullScreen } = useDialog()\n\n useEffect(() => {\n if (size === 'fullscreen') setIsFullScreen(true)\n\n return () => setIsFullScreen(false)\n }, [setIsFullScreen, size])\n\n return (\n <RadixDialog.Content\n data-spark-component=\"dialog-content\"\n ref={ref}\n className={dialogContentStyles({\n className,\n isNarrow,\n size,\n })}\n onInteractOutside={e => {\n const isForegroundElement = (e.target as HTMLElement).closest('.z-toast, .z-popover')\n\n /**\n * The focus trap of the dialog applies `pointer-events-none` on the body of the page in the background, but\n * some components with an higher z-index have `pointer-events-auto` applied on them to remain interactive and ignore the focust trap (ex: a Snackbar with actions).\n *\n * Clicking on the snackbar will be considered as an \"outside click\" and close the dialog. We want to prevent this.\n */\n if (isForegroundElement) {\n e.preventDefault()\n }\n\n onInteractOutside?.(e)\n }}\n {...rest}\n >\n {children}\n </RadixDialog.Content>\n )\n}\n\nContent.displayName = 'Dialog.Content'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { Ref } from 'react'\n\nexport type DescriptionProps = RadixDialog.DialogDescriptionProps & {\n ref?: Ref<HTMLParagraphElement>\n}\n\nexport const Description = (props: DescriptionProps) => (\n <RadixDialog.Description data-spark-component=\"dialog-description\" {...props} />\n)\n\nDescription.displayName = 'Dialog.Description'\n","import { cx } from 'class-variance-authority'\nimport { type ReactElement, type ReactNode, Ref } from 'react'\n\nexport interface FooterProps {\n children: ReactNode\n className?: string\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Footer = ({ children, className, ref, ...rest }: FooterProps): ReactElement => (\n <footer\n data-spark-component=\"dialog-footer\"\n ref={ref}\n className={cx(className, ['px-xl', 'py-lg'])}\n {...rest}\n >\n {children}\n </footer>\n)\n\nFooter.displayName = 'Dialog.Footer'\n","import { cx } from 'class-variance-authority'\nimport { type ReactElement, type ReactNode, Ref } from 'react'\n\nexport interface HeaderProps {\n children: ReactNode\n className?: string\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Header = ({ children, className, ref, ...rest }: HeaderProps): ReactElement => (\n <header\n data-spark-component=\"dialog-header\"\n ref={ref}\n className={cx(className, ['px-xl', 'py-lg'])}\n {...rest}\n >\n {children}\n </header>\n)\n\nHeader.displayName = 'Dialog.Header'\n","import { cx } from 'class-variance-authority'\nimport { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement, Ref } from 'react'\n\nimport { useDialog } from './DialogContext'\n\nexport type OverlayProps = RadixDialog.DialogOverlayProps & {\n ref?: Ref<HTMLDivElement>\n}\n\nexport const Overlay = ({ className, ref, ...rest }: OverlayProps): ReactElement | null => {\n const { isFullScreen } = useDialog()\n\n return (\n <RadixDialog.Overlay\n data-spark-component=\"dialog-overlay\"\n ref={ref}\n className={cx(\n isFullScreen ? 'hidden' : 'fixed',\n ['top-0', 'left-0', 'w-screen', 'h-screen', 'z-overlay'],\n ['bg-overlay/dim-1'],\n ['data-[state=open]:animate-fade-in'],\n ['data-[state=closed]:animate-fade-out'],\n className\n )}\n {...rest}\n />\n )\n}\n\nOverlay.displayName = 'Dialog.Overlay'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement } from 'react'\n\nexport type PortalProps = RadixDialog.DialogPortalProps\n\nexport const Portal = ({ children, ...rest }: PortalProps): ReactElement => (\n <RadixDialog.Portal {...rest}>{children}</RadixDialog.Portal>\n)\n\nPortal.displayName = 'Dialog.Portal'\n","import { cx } from 'class-variance-authority'\nimport { Dialog as RadixDialog } from 'radix-ui'\nimport { Ref } from 'react'\n\nexport type TitleProps = RadixDialog.DialogTitleProps & {\n ref?: Ref<HTMLHeadingElement>\n}\n\nexport const Title = ({ className, ref, ...others }: TitleProps) => {\n return (\n <RadixDialog.Title\n data-spark-component=\"dialog-title\"\n ref={ref}\n className={cx(\n 'text-headline-1 text-on-surface',\n 'group-has-data-[part=close]:pr-3xl',\n className\n )}\n {...others}\n />\n )\n}\n\nTitle.displayName = 'Dialog.Title'\n","import { Dialog as RadixDialog } from 'radix-ui'\nimport { type ReactElement, ReactNode, Ref } from 'react'\n\nexport interface TriggerProps {\n /**\n * Children of the component.\n */\n children?: ReactNode\n /**\n * Change the component to the HTML tag or custom component of the only child.\n */\n asChild?: RadixDialog.DialogTriggerProps['asChild']\n ref?: Ref<HTMLButtonElement>\n}\n\nexport const Trigger = (props: TriggerProps): ReactElement => (\n <RadixDialog.Trigger data-spark-component=\"dialog-trigger\" {...props} />\n)\n\nTrigger.displayName = 'Dialog.Trigger'\n","import { Dialog as Root } from './Dialog'\nimport { Body } from './DialogBody'\nimport { Close } from './DialogClose'\nimport { CloseButton } from './DialogCloseButton'\nimport { Content } from './DialogContent'\nimport { Description } from './DialogDescription' // aria-describedby\nimport { Footer } from './DialogFooter'\nimport { Header } from './DialogHeader'\nimport { Overlay } from './DialogOverlay'\nimport { Portal } from './DialogPortal'\nimport { Title } from './DialogTitle' // aria-labelledby\nimport { Trigger } from './DialogTrigger'\n\nexport const Dialog: typeof Root & {\n Trigger: typeof Trigger\n Portal: typeof Portal\n Overlay: typeof Overlay\n Content: typeof Content\n Header: typeof Header\n Body: typeof Body\n Footer: typeof Footer\n Close: typeof Close\n CloseButton: typeof CloseButton\n Title: typeof Title\n Description: typeof Description\n} = Object.assign(Root, {\n Trigger,\n Portal,\n Overlay,\n Content,\n Header,\n Body,\n Footer,\n Close,\n CloseButton,\n Title,\n Description,\n})\n\nDialog.displayName = 'Dialog'\nDialog.Trigger.displayName = 'Dialog.Trigger'\nTrigger.displayName = 'Dialog.Trigger'\nPortal.displayName = 'Dialog.Portal'\nOverlay.displayName = 'Dialog.Overlay'\nContent.displayName = 'Dialog.Content'\nHeader.displayName = 'Dialog.Header'\nBody.displayName = 'Dialog.Body'\nFooter.displayName = 'Dialog.Footer'\nCloseButton.displayName = 'Dialog.CloseButton'\nTitle.displayName = 'Dialog.Title'\nDescription.displayName = 'Dialog.Description'\n\nexport { type DialogProps } from './Dialog'\nexport { type ContentProps as DialogContentProps } from './DialogContent'\nexport { type HeaderProps as DialogHeaderProps } from './DialogHeader'\nexport { type BodyProps as DialogBodyProps } from './DialogBody'\nexport { type FooterProps as DialogFooterProps } from './DialogFooter'\nexport { type TriggerProps as DialogTriggerProps } from './DialogTrigger'\nexport { type OverlayProps as DialogOverlayProps } from './DialogOverlay'\nexport { type PortalProps as DialogPortalProps } from './DialogPortal'\nexport { type TitleProps as DialogTitleProps } from './DialogTitle'\nexport { type DescriptionProps as DialogDescriptionProps } from './DialogDescription'\nexport { type CloseProps as DialogCloseProps } from './DialogClose'\nexport { type CloseButtonProps as DialogCloseButtonProps } from './DialogCloseButton'\n"],"names":["DialogContext","createContext","DialogProvider","childrenProp","withFade","isFullScreen","setIsFullScreen","useState","jsx","useDialog","context","useContext","Dialog","children","rest","open","activeElementRef","useRef","handleActiveElementFocus","useEffect","RadixDialog","Body","className","inset","forwardedRef","scrollAreaRef","ref","useMergeRefs","overflow","useScrollOverflow","cx","Close","props","Root","ariaLabel","size","intent","design","CloseSVG","IconButton","Icon","CloseButton","Content","isNarrow","onInteractOutside","dialogContentStyles","e","Description","Footer","Header","Overlay","Portal","Title","others","Trigger"],"mappings":";;;;;;;;;;AAQA,MAAMA,IAAgBC,EAAyC,IAAI,GAEtDC,IAAiB,CAAC;AAAA,EAC7B,UAAUC;AAAA,EACV,UAAAC,IAAW;AACb,MAGM;AACJ,QAAM,CAACC,GAAcC,CAAe,IAAIC,EAAS,EAAK;AAEtD,SACE,gBAAAC;AAAA,IAACR,EAAc;AAAA,IAAd;AAAA,MACC,OAAO;AAAA,QACL,cAAAK;AAAA,QACA,iBAAAC;AAAA,QACA,UAAAF;AAAA,MAAA;AAAA,MAGD,UAAAD;AAAA,IAAA;AAAA,EAAA;AAGP,GAEaM,IAAY,MAAM;AAC7B,QAAMC,IAAUC,EAAWX,CAAa;AAExC,MAAI,CAACU;AACH,UAAM,MAAM,iDAAiD;AAG/D,SAAOA;AACT,GCRaE,IAAS,CAAC,EAAE,UAAAC,GAAU,UAAAT,IAAW,IAAO,GAAGU,QAAsC;AAC5F,QAAMC,IAAOD,EAAK,MACZE,IAAmBC,EAAgB,IAAI;AAM7C,WAASC,IAA2B;AAClC,IAAIH,KAAQ,SAAS,kBACnBC,EAAiB,UAAU,SAAS,gBAGjCD,KACH,WAAW,MAAM;AACf,MAAMC,EAAiB,mBAAmB,eAC1CA,EAAiB,QAAQ,MAAA;AAAA,IAC3B,GAAG,CAAC;AAAA,EAER;AAEA,SAAAG,EAAUD,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;AAEAoC,EAAQ,cAAc;ACzBf,MAAMC,IAAS,CAAC,EAAE,UAAAtC,GAAU,GAAGC,EAAA,MACpC,gBAAAN,EAACY,EAAY,QAAZ,EAAoB,GAAGN,GAAO,UAAAD,EAAA,CAAS;AAG1CsC,EAAO,cAAc;ACDd,MAAMC,IAAQ,CAAC,EAAE,WAAA9B,GAAW,KAAAI,GAAK,GAAG2B,QAEvC,gBAAA7C;AAAA,EAACY,EAAY;AAAA,EAAZ;AAAA,IACC,wBAAqB;AAAA,IACrB,KAAAM;AAAA,IACA,WAAWI;AAAA,MACT;AAAA,MACA;AAAA,MACAR;AAAA,IAAA;AAAA,IAED,GAAG+B;AAAA,EAAA;AAAA;AAKVD,EAAM,cAAc;ACRb,MAAME,IAAU,CAACtB,MACtB,gBAAAxB,EAACY,EAAY,SAAZ,EAAoB,wBAAqB,kBAAkB,GAAGY,GAAO;AAGxEsB,EAAQ,cAAc;ACNf,MAAM1C,IAYT,OAAO,OAAOqB,GAAM;AAAA,EACtB,SAAAqB;AAAA,EACA,QAAAH;AAAA,EACA,SAAAD;AAAA,EACA,SAAAR;AAAA,EACA,QAAAO;AAAA,EACA,MAAA5B;AAAA,EACA,QAAA2B;AAAA,EACA,OAAAjB;AAAA,EACA,aAAAU;AAAA,EACA,OAAAW;AAAA,EACA,aAAAL;AACF,CAAC;AAEDnC,EAAO,cAAc;AACrBA,EAAO,QAAQ,cAAc;AAC7B0C,EAAQ,cAAc;AACtBH,EAAO,cAAc;AACrBD,EAAQ,cAAc;AACtBR,EAAQ,cAAc;AACtBO,EAAO,cAAc;AACrB5B,EAAK,cAAc;AACnB2B,EAAO,cAAc;AACrBP,EAAY,cAAc;AAC1BW,EAAM,cAAc;AACpBL,EAAY,cAAc;"}
@@ -0,0 +1,6 @@
1
+ import { Divider as Root } from './Divider';
2
+ import { DividerContent } from './DividerContent';
3
+ export { type DividerContentProps } from './DividerContent';
4
+ export declare const Divider: typeof Root & {
5
+ Content: typeof DividerContent;
6
+ };
@@ -1,2 +1,2 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const l=require("react/jsx-runtime"),c=require("../index-DnaHaH_0.js"),e=require("@spark-ui/internal-utils"),y=require("react"),z=require("../index-ChLwd62c.js");function E(t){const o=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(t){for(const i in t)if(i!=="default"){const r=Object.getOwnPropertyDescriptor(t,i);Object.defineProperty(o,i,r.get?r:{enumerable:!0,get:()=>t[i]})}}return o.default=t,Object.freeze(o)}const h=E(y);var x="Separator",m="horizontal",O=["horizontal","vertical"],u=h.forwardRef((t,o)=>{const{decorative:i,orientation:r=m,...a}=t,n=N(r)?r:m,s=i?{role:"none"}:{"aria-orientation":n==="vertical"?n:void 0,role:"separator"};return l.jsx(z.Primitive.div,{"data-orientation":n,...s,...a,ref:o})});u.displayName=x;function N(t){return O.includes(t)}var j=u;const D=[{intent:"current",isEmpty:!0,class:e.tw(["border-current"])},{intent:"current",isEmpty:!1,class:e.tw(["before:border-current after:border-current"])},{intent:"outline",isEmpty:!0,class:e.tw(["border-outline"])},{intent:"outline",isEmpty:!1,class:e.tw(["before:border-outline after:border-outline"])}],S=c.cva(["overflow-hidden group"],{variants:{isEmpty:{true:["border-solid"],false:["inline-flex items-center","after:border-solid before:border-solid"]},orientation:{vertical:["w-fit inline-flex"],horizontal:["w-full"]},writingMode:{"horizontal-tb":[],"vertical-lr":[]},alignment:{start:[],end:[],center:[]},intent:{current:[],outline:[]}},defaultVariants:{orientation:"horizontal",writingMode:"horizontal-tb",alignment:"center",intent:"outline"},compoundVariants:[{isEmpty:!0,orientation:"horizontal",class:e.tw(["my-lg border-t-sm"])},{isEmpty:!0,orientation:"vertical",class:e.tw(["mx-lg min-h-sz-24 border-l-sm"])},{isEmpty:!1,orientation:"horizontal",writingMode:"horizontal-tb",class:e.tw(["flex-row my-sm grow-0","before:border-t-sm","after:border-t-sm","*:px-lg"])},{isEmpty:!1,orientation:"vertical",writingMode:"horizontal-tb",class:e.tw(["flex-col mx-sm","before:border-l-sm","after:border-l-sm","*:py-lg"])},{isEmpty:!1,orientation:"vertical",writingMode:"vertical-lr",class:e.tw(["flex-col mx-sm","before:border-l-sm","after:border-l-sm","*:px-lg"])},{isEmpty:!1,orientation:"horizontal",alignment:"end",class:e.tw(["after:w-sz-40 before:grow after:grow-0"])},{isEmpty:!1,orientation:"horizontal",alignment:"start",class:e.tw(["before:w-sz-40 before:grow-0 after:grow"])},{isEmpty:!1,orientation:"horizontal",alignment:"center",class:e.tw(["justify-center before:grow after:grow"])},{isEmpty:!1,orientation:"vertical",alignment:"end",class:e.tw(["after:h-sz-40 before:grow after:grow-0 before:min-h-sz-40"])},{isEmpty:!1,orientation:"vertical",alignment:"start",class:e.tw(["before:h-sz-40 before:grow-0 after:grow after:min-h-sz-40"])},{isEmpty:!1,orientation:"vertical",alignment:"center",class:e.tw(["justify-center before:grow after:grow before:min-h-sz-40 after:min-h-sz-40"])},...D]}),p=({asChild:t,className:o,isDecorative:i=!1,children:r,orientation:a="horizontal",writingMode:n="horizontal-tb",alignment:f="center",intent:s="outline",ref:g,...w})=>{const v=t?!r?.props?.children:!r;return l.jsx(j,{"data-spark-component":"divider",asChild:t,className:c.cx(S({isEmpty:v,orientation:a,alignment:f,intent:s,writingMode:n}),o),orientation:a,ref:g,decorative:i,...w,"data-writing-mode":n,children:r})};p.displayName="Divider";const b=({children:t,ref:o,className:i,...r})=>t?l.jsx("span",{"data-spark-component":"divider-content",ref:o,...r,className:c.cx("group-data-[writing-mode=vertical-lr]:[writing-mode:vertical-lr]",i),children:t}):null;b.displayName="Divider.Content";const d=Object.assign(p,{Content:b});d.displayName="Divider";d.Content.displayName="Divider.Content";exports.Divider=d;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const c=require("react/jsx-runtime"),n=require("class-variance-authority"),p=require("radix-ui"),t=require("@spark-ui/internal-utils"),y=[{intent:"current",isEmpty:!0,class:t.tw(["border-current"])},{intent:"current",isEmpty:!1,class:t.tw(["before:border-current after:border-current"])},{intent:"outline",isEmpty:!0,class:t.tw(["border-outline"])},{intent:"outline",isEmpty:!1,class:t.tw(["before:border-outline after:border-outline"])}],v=n.cva(["overflow-hidden group"],{variants:{isEmpty:{true:["border-solid"],false:["inline-flex items-center","after:border-solid before:border-solid"]},orientation:{vertical:["w-fit inline-flex"],horizontal:["w-full"]},writingMode:{"horizontal-tb":[],"vertical-lr":[]},alignment:{start:[],end:[],center:[]},intent:{current:[],outline:[]}},defaultVariants:{orientation:"horizontal",writingMode:"horizontal-tb",alignment:"center",intent:"outline"},compoundVariants:[{isEmpty:!0,orientation:"horizontal",class:t.tw(["my-lg border-t-sm"])},{isEmpty:!0,orientation:"vertical",class:t.tw(["mx-lg min-h-sz-24 border-l-sm"])},{isEmpty:!1,orientation:"horizontal",writingMode:"horizontal-tb",class:t.tw(["flex-row my-sm grow-0","before:border-t-sm","after:border-t-sm","*:px-lg"])},{isEmpty:!1,orientation:"vertical",writingMode:"horizontal-tb",class:t.tw(["flex-col mx-sm","before:border-l-sm","after:border-l-sm","*:py-lg"])},{isEmpty:!1,orientation:"vertical",writingMode:"vertical-lr",class:t.tw(["flex-col mx-sm","before:border-l-sm","after:border-l-sm","*:px-lg"])},{isEmpty:!1,orientation:"horizontal",alignment:"end",class:t.tw(["after:w-sz-40 before:grow after:grow-0"])},{isEmpty:!1,orientation:"horizontal",alignment:"start",class:t.tw(["before:w-sz-40 before:grow-0 after:grow"])},{isEmpty:!1,orientation:"horizontal",alignment:"center",class:t.tw(["justify-center before:grow after:grow"])},{isEmpty:!1,orientation:"vertical",alignment:"end",class:t.tw(["after:h-sz-40 before:grow after:grow-0 before:min-h-sz-40"])},{isEmpty:!1,orientation:"vertical",alignment:"start",class:t.tw(["before:h-sz-40 before:grow-0 after:grow after:min-h-sz-40"])},{isEmpty:!1,orientation:"vertical",alignment:"center",class:t.tw(["justify-center before:grow after:grow before:min-h-sz-40 after:min-h-sz-40"])},...y]}),m=({asChild:e,className:i,isDecorative:o=!1,children:r,orientation:s="horizontal",writingMode:l="horizontal-tb",alignment:f="center",intent:b="outline",ref:w,...g})=>{const u=e?!r?.props?.children:!r;return c.jsx(p.Separator.Root,{"data-spark-component":"divider",asChild:e,className:n.cx(v({isEmpty:u,orientation:s,alignment:f,intent:b,writingMode:l}),i),orientation:s,ref:w,decorative:o,...g,"data-writing-mode":l,children:r})};m.displayName="Divider";const d=({children:e,ref:i,className:o,...r})=>e?c.jsx("span",{"data-spark-component":"divider-content",ref:i,...r,className:n.cx("group-data-[writing-mode=vertical-lr]:[writing-mode:vertical-lr]",o),children:e}):null;d.displayName="Divider.Content";const a=Object.assign(m,{Content:d});a.displayName="Divider";a.Content.displayName="Divider.Content";exports.Divider=a;
2
2
  //# sourceMappingURL=index.js.map