@customafk/lunas-ui 0.0.11 → 0.0.13

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 (220) hide show
  1. package/dist/{alert-dialog-0KwdjY-6.js → alert-dialog-CQa0TLlF.js} +1 -1
  2. package/dist/{alert-dialog-0KwdjY-6.js.map → alert-dialog-CQa0TLlF.js.map} +1 -1
  3. package/dist/{alert-dialog-BQv-ZvW9.cjs → alert-dialog-D1DFrl-0.cjs} +1 -1
  4. package/dist/{alert-dialog-BQv-ZvW9.cjs.map → alert-dialog-D1DFrl-0.cjs.map} +1 -1
  5. package/dist/{button-DIX2AwtI.d.cts → button-BAqUUT0m.d.cts} +6 -6
  6. package/dist/{button-DnN5aAEv.d.ts → button-O7LPNFsW.d.ts} +6 -6
  7. package/dist/{calendar-5D53vIAn.js → calendar-DaYVxwJx.js} +1 -1
  8. package/dist/{calendar-5D53vIAn.js.map → calendar-DaYVxwJx.js.map} +1 -1
  9. package/dist/{calendar-CPFb8F_s.cjs → calendar-DzAxQqFI.cjs} +1 -1
  10. package/dist/{calendar-CPFb8F_s.cjs.map → calendar-DzAxQqFI.cjs.map} +1 -1
  11. package/dist/cards/simple-card.d.ts +2 -2
  12. package/dist/{command-CS4JXTso.cjs → command-BaCe_FWz.cjs} +2 -2
  13. package/dist/{command-CS4JXTso.cjs.map → command-BaCe_FWz.cjs.map} +1 -1
  14. package/dist/{command-D0wTWahQ.d.ts → command-CzvzZ5v7.d.ts} +12 -12
  15. package/dist/{command-LdK9xFuR.js → command-DCJja1nB.js} +2 -2
  16. package/dist/{command-LdK9xFuR.js.map → command-DCJja1nB.js.map} +1 -1
  17. package/dist/{command-trF9N6ky.d.cts → command-DrdWHvOO.d.cts} +12 -12
  18. package/dist/data-display/statistic.d.cts +2 -2
  19. package/dist/{dialog-Cs7JBaly.js → dialog-C0AcPpDH.js} +1 -1
  20. package/dist/{dialog-Cs7JBaly.js.map → dialog-C0AcPpDH.js.map} +1 -1
  21. package/dist/{dialog-CXZOtc6v.cjs → dialog-CH0Dihp0.cjs} +1 -1
  22. package/dist/{dialog-CXZOtc6v.cjs.map → dialog-CH0Dihp0.cjs.map} +1 -1
  23. package/dist/{dialog-ODkNpSlH.d.ts → dialog-Ch71L6oE.d.ts} +12 -12
  24. package/dist/{dialog-CuqlkOcw.d.cts → dialog-DQY1Cjay.d.cts} +12 -12
  25. package/dist/dialogs/confirm-dialog.cjs +1 -1
  26. package/dist/dialogs/confirm-dialog.js +1 -1
  27. package/dist/dialogs/detail-dialog/index.cjs +1 -1
  28. package/dist/dialogs/detail-dialog/index.js +1 -1
  29. package/dist/dialogs/error-dialog.cjs +1 -1
  30. package/dist/dialogs/error-dialog.js +1 -1
  31. package/dist/dialogs/form-dialog.cjs +1 -1
  32. package/dist/dialogs/form-dialog.d.cts +2 -2
  33. package/dist/dialogs/form-dialog.d.ts +2 -2
  34. package/dist/dialogs/form-dialog.js +1 -1
  35. package/dist/dialogs/loading-dialog.cjs +1 -1
  36. package/dist/dialogs/loading-dialog.js +1 -1
  37. package/dist/{error-dialog-DO0Bb-pi.cjs → error-dialog-BTjeT7x-.cjs} +2 -2
  38. package/dist/{error-dialog-DO0Bb-pi.cjs.map → error-dialog-BTjeT7x-.cjs.map} +1 -1
  39. package/dist/{error-dialog-D_4WL-Hj.js → error-dialog-DlhosP10.js} +2 -2
  40. package/dist/{error-dialog-D_4WL-Hj.js.map → error-dialog-DlhosP10.js.map} +1 -1
  41. package/dist/{form-wrapper-FYiHHas7.cjs → form-wrapper-CCqogufb.cjs} +2 -2
  42. package/dist/{form-wrapper-FYiHHas7.cjs.map → form-wrapper-CCqogufb.cjs.map} +1 -1
  43. package/dist/{form-wrapper-D-2Uz518.js → form-wrapper-YPIbD8rh.js} +2 -2
  44. package/dist/{form-wrapper-D-2Uz518.js.map → form-wrapper-YPIbD8rh.js.map} +1 -1
  45. package/dist/forms/combobox-field.cjs +2 -2
  46. package/dist/forms/combobox-field.d.cts +2 -2
  47. package/dist/forms/combobox-field.d.ts +2 -2
  48. package/dist/forms/combobox-field.js +2 -2
  49. package/dist/forms/date-field.cjs +1 -1
  50. package/dist/forms/date-field.d.cts +2 -2
  51. package/dist/forms/date-field.d.ts +2 -2
  52. package/dist/forms/date-field.js +1 -1
  53. package/dist/forms/form-wrapper.cjs +1 -1
  54. package/dist/forms/form-wrapper.d.cts +2 -2
  55. package/dist/forms/form-wrapper.d.ts +2 -2
  56. package/dist/forms/form-wrapper.js +1 -1
  57. package/dist/forms/multi-select-field.cjs +1 -1
  58. package/dist/forms/multi-select-field.cjs.map +1 -1
  59. package/dist/forms/multi-select-field.d.cts +2 -2
  60. package/dist/forms/multi-select-field.d.ts +2 -2
  61. package/dist/forms/multi-select-field.js +1 -1
  62. package/dist/forms/number-field.d.cts +2 -2
  63. package/dist/forms/number-field.d.ts +2 -2
  64. package/dist/forms/password-field.d.cts +2 -2
  65. package/dist/forms/password-field.d.ts +2 -2
  66. package/dist/forms/select-field.d.cts +2 -2
  67. package/dist/forms/select-field.d.ts +2 -2
  68. package/dist/forms/switch-field.d.cts +2 -2
  69. package/dist/forms/switch-field.d.ts +2 -2
  70. package/dist/forms/text-field.d.cts +2 -2
  71. package/dist/forms/text-field.d.ts +2 -2
  72. package/dist/forms/textarea-field.d.cts +2 -2
  73. package/dist/forms/textarea-field.d.ts +2 -2
  74. package/dist/{input-DIMlgILH.d.cts → input-DhLxB8V-.d.cts} +3 -3
  75. package/dist/{input-DR-TeKen.d.ts → input-cj6Jc1Zj.d.ts} +3 -3
  76. package/dist/layouts/flex.d.cts +3 -3
  77. package/dist/layouts/flex.d.ts +3 -3
  78. package/dist/layouts/main/index.d.cts +4 -4
  79. package/dist/{multi-select-BNh2ezg-.cjs → multi-select-C-r_XSFy.cjs} +2 -2
  80. package/dist/{multi-select-BNh2ezg-.cjs.map → multi-select-C-r_XSFy.cjs.map} +1 -1
  81. package/dist/{multi-select-B_fLji2s.js → multi-select-p5ihXgWH.js} +2 -2
  82. package/dist/{multi-select-B_fLji2s.js.map → multi-select-p5ihXgWH.js.map} +1 -1
  83. package/dist/{popover-CAokgoc_.cjs → popover-Ce0OTSQL.cjs} +1 -1
  84. package/dist/{popover-CAokgoc_.cjs.map → popover-Ce0OTSQL.cjs.map} +1 -1
  85. package/dist/{popover-B8j86VQv.js → popover-tDri6Ded.js} +1 -1
  86. package/dist/{popover-B8j86VQv.js.map → popover-tDri6Ded.js.map} +1 -1
  87. package/dist/{separator-Q6Oe2w6f.d.cts → separator-BsnCT8LX.d.cts} +3 -3
  88. package/dist/{separator-CievW3VI.d.ts → separator-D1cml8sE.d.ts} +3 -3
  89. package/dist/table/index.d.ts +2 -2
  90. package/dist/{toggle-31B39dod.d.cts → toggle-CxXbGIf5.d.ts} +4 -4
  91. package/dist/{toggle-J2Fw-oeH.d.ts → toggle-DfC247hI.d.cts} +5 -5
  92. package/dist/{tooltip-Bg1hHoeI.d.cts → tooltip-CA4xH6Zd.d.cts} +6 -6
  93. package/dist/{tooltip-CeP-zQrX.d.ts → tooltip-DZ2Shzgg.d.ts} +6 -6
  94. package/dist/typography/paragraph.d.cts +2 -2
  95. package/dist/typography/paragraph.d.ts +2 -2
  96. package/dist/typography/title.d.cts +2 -2
  97. package/dist/typography/title.d.ts +2 -2
  98. package/dist/ui/alert-dialog.cjs +1 -1
  99. package/dist/ui/alert-dialog.d.ts +12 -12
  100. package/dist/ui/alert-dialog.js +1 -1
  101. package/dist/ui/alert.d.cts +4 -4
  102. package/dist/ui/alert.d.ts +6 -6
  103. package/dist/ui/aspect-ratio.d.cts +2 -2
  104. package/dist/ui/aspect-ratio.d.ts +2 -2
  105. package/dist/ui/avatar.d.cts +4 -4
  106. package/dist/ui/avatar.d.ts +4 -4
  107. package/dist/ui/badge.d.cts +4 -4
  108. package/dist/ui/badge.d.ts +4 -4
  109. package/dist/ui/breadcrumb.d.cts +8 -8
  110. package/dist/ui/breadcrumb.d.ts +8 -8
  111. package/dist/ui/button.d.cts +1 -1
  112. package/dist/ui/button.d.ts +1 -1
  113. package/dist/ui/buttons/edit.cjs +2 -0
  114. package/dist/ui/buttons/edit.cjs.map +1 -0
  115. package/dist/ui/buttons/edit.d.cts +8 -0
  116. package/dist/ui/buttons/edit.d.ts +8 -0
  117. package/dist/ui/buttons/edit.js +2 -0
  118. package/dist/ui/buttons/edit.js.map +1 -0
  119. package/dist/ui/buttons/trash.cjs +2 -0
  120. package/dist/ui/buttons/trash.cjs.map +1 -0
  121. package/dist/ui/buttons/trash.d.cts +8 -0
  122. package/dist/ui/buttons/trash.d.ts +8 -0
  123. package/dist/ui/buttons/trash.js +2 -0
  124. package/dist/ui/buttons/trash.js.map +1 -0
  125. package/dist/ui/buttons/upload-image.cjs +2 -0
  126. package/dist/ui/buttons/upload-image.cjs.map +1 -0
  127. package/dist/ui/buttons/upload-image.d.cts +11 -0
  128. package/dist/ui/buttons/upload-image.d.ts +11 -0
  129. package/dist/ui/buttons/upload-image.js +2 -0
  130. package/dist/ui/buttons/upload-image.js.map +1 -0
  131. package/dist/ui/calendar.cjs +1 -1
  132. package/dist/ui/calendar.d.cts +4 -4
  133. package/dist/ui/calendar.d.ts +4 -4
  134. package/dist/ui/calendar.js +1 -1
  135. package/dist/ui/card.d.cts +8 -8
  136. package/dist/ui/card.d.ts +8 -8
  137. package/dist/ui/carousel.d.cts +7 -7
  138. package/dist/ui/carousel.d.ts +7 -7
  139. package/dist/ui/collapsible.d.cts +4 -4
  140. package/dist/ui/collapsible.d.ts +4 -4
  141. package/dist/ui/command.cjs +1 -1
  142. package/dist/ui/command.d.cts +2 -2
  143. package/dist/ui/command.d.ts +2 -2
  144. package/dist/ui/command.js +1 -1
  145. package/dist/ui/context-menu.d.cts +16 -16
  146. package/dist/ui/context-menu.d.ts +16 -16
  147. package/dist/ui/dialog.cjs +1 -1
  148. package/dist/ui/dialog.d.cts +1 -1
  149. package/dist/ui/dialog.d.ts +1 -1
  150. package/dist/ui/dialog.js +1 -1
  151. package/dist/ui/dropdown-menu.d.cts +16 -16
  152. package/dist/ui/dropdown-menu.d.ts +16 -16
  153. package/dist/ui/file-uploader.d.cts +2 -2
  154. package/dist/ui/file-uploader.d.ts +2 -2
  155. package/dist/ui/form.d.cts +7 -7
  156. package/dist/ui/form.d.ts +7 -7
  157. package/dist/ui/hover-card.d.cts +4 -4
  158. package/dist/ui/hover-card.d.ts +4 -4
  159. package/dist/ui/input-otp.d.cts +5 -5
  160. package/dist/ui/input-otp.d.ts +5 -5
  161. package/dist/ui/input.d.cts +1 -1
  162. package/dist/ui/input.d.ts +1 -1
  163. package/dist/ui/inputs/search-input.d.cts +1 -1
  164. package/dist/ui/inputs/search-input.d.ts +3 -3
  165. package/dist/ui/label.d.cts +2 -2
  166. package/dist/ui/label.d.ts +2 -2
  167. package/dist/ui/menubar.d.cts +17 -17
  168. package/dist/ui/menubar.d.ts +17 -17
  169. package/dist/ui/multi-select.cjs +1 -1
  170. package/dist/ui/multi-select.d.cts +2 -2
  171. package/dist/ui/multi-select.d.ts +2 -2
  172. package/dist/ui/multi-select.js +1 -1
  173. package/dist/ui/navigation-menu.d.cts +11 -11
  174. package/dist/ui/navigation-menu.d.ts +11 -11
  175. package/dist/ui/pagination.d.cts +9 -9
  176. package/dist/ui/pagination.d.ts +9 -9
  177. package/dist/ui/popover.cjs +1 -1
  178. package/dist/ui/popover.d.cts +5 -5
  179. package/dist/ui/popover.d.ts +5 -5
  180. package/dist/ui/popover.js +1 -1
  181. package/dist/ui/progress.d.cts +2 -2
  182. package/dist/ui/progress.d.ts +2 -2
  183. package/dist/ui/radio-group.d.cts +3 -3
  184. package/dist/ui/radio-group.d.ts +3 -3
  185. package/dist/ui/resizable.d.cts +4 -4
  186. package/dist/ui/resizable.d.ts +4 -4
  187. package/dist/ui/scroll-area.d.cts +3 -3
  188. package/dist/ui/scroll-area.d.ts +3 -3
  189. package/dist/ui/select.d.cts +11 -11
  190. package/dist/ui/select.d.ts +11 -11
  191. package/dist/ui/separator.d.cts +1 -1
  192. package/dist/ui/separator.d.ts +1 -1
  193. package/dist/ui/sheet.d.cts +9 -9
  194. package/dist/ui/sheet.d.ts +9 -9
  195. package/dist/ui/sidebar.d.cts +30 -30
  196. package/dist/ui/sidebar.d.ts +28 -28
  197. package/dist/ui/skeleton.d.cts +2 -2
  198. package/dist/ui/skeleton.d.ts +2 -2
  199. package/dist/ui/slider.d.cts +2 -2
  200. package/dist/ui/slider.d.ts +2 -2
  201. package/dist/ui/sonner.d.cts +2 -2
  202. package/dist/ui/sonner.d.ts +2 -2
  203. package/dist/ui/switch.d.cts +2 -2
  204. package/dist/ui/switch.d.ts +2 -2
  205. package/dist/ui/table.d.cts +9 -9
  206. package/dist/ui/table.d.ts +9 -9
  207. package/dist/ui/tabs.d.cts +5 -5
  208. package/dist/ui/tabs.d.ts +5 -5
  209. package/dist/ui/textarea.d.cts +2 -2
  210. package/dist/ui/textarea.d.ts +2 -2
  211. package/dist/ui/toggle-group.d.cts +4 -4
  212. package/dist/ui/toggle-group.d.ts +4 -4
  213. package/dist/ui/toggle.d.cts +1 -1
  214. package/dist/ui/toggle.d.ts +1 -1
  215. package/dist/ui/tooltip.d.cts +1 -1
  216. package/dist/ui/tooltip.d.ts +1 -1
  217. package/package.json +13 -1
  218. package/packages/components/ui/buttons/edit.tsx +20 -0
  219. package/packages/components/ui/buttons/trash.tsx +20 -0
  220. package/packages/components/ui/buttons/upload-image.tsx +28 -0
@@ -1 +1 @@
1
- {"version":3,"file":"dialog-Cs7JBaly.js","names":["Dialog","DialogPrimitive"],"sources":["../packages/components/ui/dialog.tsx"],"sourcesContent":["\"use client\";\nimport React from \"react\";\nimport { Dialog as DialogPrimitive } from \"radix-ui\";\nimport { XIcon } from \"lucide-react\";\n\nimport { cn } from \"@/lib/utils\";\n\nfunction Dialog({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />;\n}\n\nfunction DialogTrigger({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nfunction DialogPortal({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\nfunction DialogClose({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nfunction DialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n \"fixed inset-0 z-50 bg-black/50\",\n \"data-[state=open]:animate-in\",\n \"data-[state=open]:fade-in-0\",\n \"data-[state=closed]:animate-out\",\n \"data-[state=closed]:fade-out-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogContent({\n className,\n children,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean;\n}) {\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n <DialogOverlay />\n <div className=\"fixed inset-0 z-50 flex items-center justify-center\">\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n \"bg-background relative dark:border\",\n \"z-50 grid max-h-[85svh] w-full max-w-[calc(100%-2rem)]\",\n \"gap-4 rounded-2xl p-6 shadow-lg duration-200 sm:max-w-lg\",\n \"data-[state=open]:animate-in\",\n \"data-[state=open]:fade-in-0\",\n \"data-[state=open]:zoom-in-80\",\n \"data-[state=closed]:animate-out\",\n \"data-[state=closed]:fade-out-0\",\n \"data-[state=closed]:zoom-out-80\",\n className,\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n tabIndex={-1}\n className={cn(\n \"btnClose\",\n \"absolute top-3 right-3 rounded-full p-2 opacity-70\",\n \"cursor-pointer transition-all\",\n \"outline-0\",\n \"focus:ring-2\",\n \"focus:ring-border\",\n \"hover:opacity-100\",\n \"hover:bg-accent\",\n \"data-[state=open]:bg-accent\",\n \"data-[state=open]:text-muted-foreground\",\n \"disabled:pointer-events-none\",\n \"[&_svg]:text-accent-foreground/60\",\n \"[&_svg]:hover:text-accent-foreground\",\n \"[&_svg]:pointer-events-none\",\n \"[&_svg]:shrink-0\",\n \"[&_svg:not([class*='size-'])]:size-5\",\n )}\n >\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </div>\n </DialogPortal>\n );\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)}\n {...props}\n />\n );\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n \"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn(\"text-lg leading-none font-semibold\", className)}\n {...props}\n />\n );\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n"],"mappings":"uLAOA,SAASA,EAAO,CACd,GAAG,GACiD,CACpD,OAAO,EAACC,EAAgB,KAAA,CAAK,YAAU,SAAS,GAAI,IAGtD,SAAS,EAAc,CACrB,GAAG,GACoD,CACvD,OAAO,EAACA,EAAgB,QAAA,CAAQ,YAAU,iBAAiB,GAAI,IAGjE,SAAS,EAAa,CACpB,GAAG,GACmD,CACtD,OAAO,EAACA,EAAgB,OAAA,CAAO,YAAU,gBAAgB,GAAI,IAG/D,SAAS,EAAY,CACnB,GAAG,GACkD,CACrD,OAAO,EAACA,EAAgB,MAAA,CAAM,YAAU,eAAe,GAAI,IAG7D,SAAS,EAAc,CACrB,YACA,GAAG,GACoD,CACvD,OACE,EAACA,EAAgB,QAAA,CACf,YAAU,iBACV,UAAW,EACT,iCACA,+BACA,8BACA,kCACA,iCACA,GAEF,GAAI,IAKV,SAAS,EAAc,CACrB,YACA,WACA,kBAAkB,GAClB,GAAG,GAGF,CACD,OACE,EAAC,EAAA,CAAa,YAAU,0BACtB,EAAC,EAAA,IACD,EAAC,MAAA,CAAI,UAAU,+DACb,EAACA,EAAgB,QAAA,CACf,YAAU,iBACV,UAAW,EACT,qCACA,yDACA,2DACA,+BACA,8BACA,+BACA,kCACA,iCACA,kCACA,GAEF,GAAI,YAEH,EACA,GACC,EAACA,EAAgB,MAAA,CACf,YAAU,eACV,SAAU,GACV,UAAW,EACT,WACA,qDACA,gCACA,YACA,eACA,oBACA,oBACA,kBACA,8BACA,0CACA,+BACA,oCACA,uCACA,8BACA,mBACA,kDAGF,EAAC,EAAA,IACD,EAAC,OAAA,CAAK,UAAU,mBAAU,qBASxC,SAAS,EAAa,CAAE,YAAW,GAAG,GAAsC,CAC1E,OACE,EAAC,MAAA,CACC,YAAU,gBACV,UAAW,EAAG,+CAAgD,GAC9D,GAAI,IAKV,SAAS,EAAa,CAAE,YAAW,GAAG,GAAsC,CAC1E,OACE,EAAC,MAAA,CACC,YAAU,gBACV,UAAW,EACT,yDACA,GAEF,GAAI,IAKV,SAAS,EAAY,CACnB,YACA,GAAG,GACkD,CACrD,OACE,EAACA,EAAgB,MAAA,CACf,YAAU,eACV,UAAW,EAAG,qCAAsC,GACpD,GAAI,IAKV,SAAS,EAAkB,CACzB,YACA,GAAG,GACwD,CAC3D,OACE,EAACA,EAAgB,YAAA,CACf,YAAU,qBACV,UAAW,EAAG,gCAAiC,GAC/C,GAAI"}
1
+ {"version":3,"file":"dialog-C0AcPpDH.js","names":["Dialog","DialogPrimitive"],"sources":["../packages/components/ui/dialog.tsx"],"sourcesContent":["\"use client\";\nimport React from \"react\";\nimport { Dialog as DialogPrimitive } from \"radix-ui\";\nimport { XIcon } from \"lucide-react\";\n\nimport { cn } from \"@/lib/utils\";\n\nfunction Dialog({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />;\n}\n\nfunction DialogTrigger({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nfunction DialogPortal({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\nfunction DialogClose({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nfunction DialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n \"fixed inset-0 z-50 bg-black/50\",\n \"data-[state=open]:animate-in\",\n \"data-[state=open]:fade-in-0\",\n \"data-[state=closed]:animate-out\",\n \"data-[state=closed]:fade-out-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogContent({\n className,\n children,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean;\n}) {\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n <DialogOverlay />\n <div className=\"fixed inset-0 z-50 flex items-center justify-center\">\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n \"bg-background relative dark:border\",\n \"z-50 grid max-h-[85svh] w-full max-w-[calc(100%-2rem)]\",\n \"gap-4 rounded-2xl p-6 shadow-lg duration-200 sm:max-w-lg\",\n \"data-[state=open]:animate-in\",\n \"data-[state=open]:fade-in-0\",\n \"data-[state=open]:zoom-in-80\",\n \"data-[state=closed]:animate-out\",\n \"data-[state=closed]:fade-out-0\",\n \"data-[state=closed]:zoom-out-80\",\n className,\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n tabIndex={-1}\n className={cn(\n \"btnClose\",\n \"absolute top-3 right-3 rounded-full p-2 opacity-70\",\n \"cursor-pointer transition-all\",\n \"outline-0\",\n \"focus:ring-2\",\n \"focus:ring-border\",\n \"hover:opacity-100\",\n \"hover:bg-accent\",\n \"data-[state=open]:bg-accent\",\n \"data-[state=open]:text-muted-foreground\",\n \"disabled:pointer-events-none\",\n \"[&_svg]:text-accent-foreground/60\",\n \"[&_svg]:hover:text-accent-foreground\",\n \"[&_svg]:pointer-events-none\",\n \"[&_svg]:shrink-0\",\n \"[&_svg:not([class*='size-'])]:size-5\",\n )}\n >\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </div>\n </DialogPortal>\n );\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)}\n {...props}\n />\n );\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n \"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn(\"text-lg leading-none font-semibold\", className)}\n {...props}\n />\n );\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n"],"mappings":"uLAOA,SAASA,EAAO,CACd,GAAG,GACiD,CACpD,OAAO,EAACC,EAAgB,KAAA,CAAK,YAAU,SAAS,GAAI,IAGtD,SAAS,EAAc,CACrB,GAAG,GACoD,CACvD,OAAO,EAACA,EAAgB,QAAA,CAAQ,YAAU,iBAAiB,GAAI,IAGjE,SAAS,EAAa,CACpB,GAAG,GACmD,CACtD,OAAO,EAACA,EAAgB,OAAA,CAAO,YAAU,gBAAgB,GAAI,IAG/D,SAAS,EAAY,CACnB,GAAG,GACkD,CACrD,OAAO,EAACA,EAAgB,MAAA,CAAM,YAAU,eAAe,GAAI,IAG7D,SAAS,EAAc,CACrB,YACA,GAAG,GACoD,CACvD,OACE,EAACA,EAAgB,QAAA,CACf,YAAU,iBACV,UAAW,EACT,iCACA,+BACA,8BACA,kCACA,iCACA,GAEF,GAAI,IAKV,SAAS,EAAc,CACrB,YACA,WACA,kBAAkB,GAClB,GAAG,GAGF,CACD,OACE,EAAC,EAAA,CAAa,YAAU,0BACtB,EAAC,EAAA,IACD,EAAC,MAAA,CAAI,UAAU,+DACb,EAACA,EAAgB,QAAA,CACf,YAAU,iBACV,UAAW,EACT,qCACA,yDACA,2DACA,+BACA,8BACA,+BACA,kCACA,iCACA,kCACA,GAEF,GAAI,YAEH,EACA,GACC,EAACA,EAAgB,MAAA,CACf,YAAU,eACV,SAAU,GACV,UAAW,EACT,WACA,qDACA,gCACA,YACA,eACA,oBACA,oBACA,kBACA,8BACA,0CACA,+BACA,oCACA,uCACA,8BACA,mBACA,kDAGF,EAAC,EAAA,IACD,EAAC,OAAA,CAAK,UAAU,mBAAU,qBASxC,SAAS,EAAa,CAAE,YAAW,GAAG,GAAsC,CAC1E,OACE,EAAC,MAAA,CACC,YAAU,gBACV,UAAW,EAAG,+CAAgD,GAC9D,GAAI,IAKV,SAAS,EAAa,CAAE,YAAW,GAAG,GAAsC,CAC1E,OACE,EAAC,MAAA,CACC,YAAU,gBACV,UAAW,EACT,yDACA,GAEF,GAAI,IAKV,SAAS,EAAY,CACnB,YACA,GAAG,GACkD,CACrD,OACE,EAACA,EAAgB,MAAA,CACf,YAAU,eACV,UAAW,EAAG,qCAAsC,GACpD,GAAI,IAKV,SAAS,EAAkB,CACzB,YACA,GAAG,GACwD,CAC3D,OACE,EAACA,EAAgB,YAAA,CACf,YAAU,qBACV,UAAW,EAAG,gCAAiC,GAC/C,GAAI"}
@@ -1,2 +1,2 @@
1
1
  const e=require(`./chunk-hhQzssFb.cjs`),t=require(`./utils-DaJ1XZgX.cjs`),n=e.__toESM(require(`react`)),r=e.__toESM(require(`react/jsx-runtime`)),i=e.__toESM(require(`radix-ui`)),a=e.__toESM(require(`lucide-react`));function o({...e}){return(0,r.jsx)(i.Dialog.Root,{"data-slot":`dialog`,...e})}function s({...e}){return(0,r.jsx)(i.Dialog.Trigger,{"data-slot":`dialog-trigger`,...e})}function c({...e}){return(0,r.jsx)(i.Dialog.Portal,{"data-slot":`dialog-portal`,...e})}function l({...e}){return(0,r.jsx)(i.Dialog.Close,{"data-slot":`dialog-close`,...e})}function u({className:e,...n}){return(0,r.jsx)(i.Dialog.Overlay,{"data-slot":`dialog-overlay`,className:t.cn(`fixed inset-0 z-50 bg-black/50`,`data-[state=open]:animate-in`,`data-[state=open]:fade-in-0`,`data-[state=closed]:animate-out`,`data-[state=closed]:fade-out-0`,e),...n})}function d({className:e,children:n,showCloseButton:o=!0,...s}){return(0,r.jsxs)(c,{"data-slot":`dialog-portal`,children:[(0,r.jsx)(u,{}),(0,r.jsx)(`div`,{className:`fixed inset-0 z-50 flex items-center justify-center`,children:(0,r.jsxs)(i.Dialog.Content,{"data-slot":`dialog-content`,className:t.cn(`bg-background relative dark:border`,`z-50 grid max-h-[85svh] w-full max-w-[calc(100%-2rem)]`,`gap-4 rounded-2xl p-6 shadow-lg duration-200 sm:max-w-lg`,`data-[state=open]:animate-in`,`data-[state=open]:fade-in-0`,`data-[state=open]:zoom-in-80`,`data-[state=closed]:animate-out`,`data-[state=closed]:fade-out-0`,`data-[state=closed]:zoom-out-80`,e),...s,children:[n,o&&(0,r.jsxs)(i.Dialog.Close,{"data-slot":`dialog-close`,tabIndex:-1,className:t.cn(`btnClose`,`absolute top-3 right-3 rounded-full p-2 opacity-70`,`cursor-pointer transition-all`,`outline-0`,`focus:ring-2`,`focus:ring-border`,`hover:opacity-100`,`hover:bg-accent`,`data-[state=open]:bg-accent`,`data-[state=open]:text-muted-foreground`,`disabled:pointer-events-none`,`[&_svg]:text-accent-foreground/60`,`[&_svg]:hover:text-accent-foreground`,`[&_svg]:pointer-events-none`,`[&_svg]:shrink-0`,`[&_svg:not([class*='size-'])]:size-5`),children:[(0,r.jsx)(a.XIcon,{}),(0,r.jsx)(`span`,{className:`sr-only`,children:`Close`})]})]})})]})}function f({className:e,...n}){return(0,r.jsx)(`div`,{"data-slot":`dialog-header`,className:t.cn(`flex flex-col gap-2 text-center sm:text-left`,e),...n})}function p({className:e,...n}){return(0,r.jsx)(`div`,{"data-slot":`dialog-footer`,className:t.cn(`flex flex-col-reverse gap-2 sm:flex-row sm:justify-end`,e),...n})}function m({className:e,...n}){return(0,r.jsx)(i.Dialog.Title,{"data-slot":`dialog-title`,className:t.cn(`text-lg leading-none font-semibold`,e),...n})}function h({className:e,...n}){return(0,r.jsx)(i.Dialog.Description,{"data-slot":`dialog-description`,className:t.cn(`text-muted-foreground text-sm`,e),...n})}Object.defineProperty(exports,`Dialog`,{enumerable:!0,get:function(){return o}}),Object.defineProperty(exports,`DialogClose`,{enumerable:!0,get:function(){return l}}),Object.defineProperty(exports,`DialogContent`,{enumerable:!0,get:function(){return d}}),Object.defineProperty(exports,`DialogDescription`,{enumerable:!0,get:function(){return h}}),Object.defineProperty(exports,`DialogFooter`,{enumerable:!0,get:function(){return p}}),Object.defineProperty(exports,`DialogHeader`,{enumerable:!0,get:function(){return f}}),Object.defineProperty(exports,`DialogOverlay`,{enumerable:!0,get:function(){return u}}),Object.defineProperty(exports,`DialogPortal`,{enumerable:!0,get:function(){return c}}),Object.defineProperty(exports,`DialogTitle`,{enumerable:!0,get:function(){return m}}),Object.defineProperty(exports,`DialogTrigger`,{enumerable:!0,get:function(){return s}});
2
- //# sourceMappingURL=dialog-CXZOtc6v.cjs.map
2
+ //# sourceMappingURL=dialog-CH0Dihp0.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"dialog-CXZOtc6v.cjs","names":["DialogPrimitive","cn","XIcon"],"sources":["../packages/components/ui/dialog.tsx"],"sourcesContent":["\"use client\";\nimport React from \"react\";\nimport { Dialog as DialogPrimitive } from \"radix-ui\";\nimport { XIcon } from \"lucide-react\";\n\nimport { cn } from \"@/lib/utils\";\n\nfunction Dialog({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />;\n}\n\nfunction DialogTrigger({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nfunction DialogPortal({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\nfunction DialogClose({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nfunction DialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n \"fixed inset-0 z-50 bg-black/50\",\n \"data-[state=open]:animate-in\",\n \"data-[state=open]:fade-in-0\",\n \"data-[state=closed]:animate-out\",\n \"data-[state=closed]:fade-out-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogContent({\n className,\n children,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean;\n}) {\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n <DialogOverlay />\n <div className=\"fixed inset-0 z-50 flex items-center justify-center\">\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n \"bg-background relative dark:border\",\n \"z-50 grid max-h-[85svh] w-full max-w-[calc(100%-2rem)]\",\n \"gap-4 rounded-2xl p-6 shadow-lg duration-200 sm:max-w-lg\",\n \"data-[state=open]:animate-in\",\n \"data-[state=open]:fade-in-0\",\n \"data-[state=open]:zoom-in-80\",\n \"data-[state=closed]:animate-out\",\n \"data-[state=closed]:fade-out-0\",\n \"data-[state=closed]:zoom-out-80\",\n className,\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n tabIndex={-1}\n className={cn(\n \"btnClose\",\n \"absolute top-3 right-3 rounded-full p-2 opacity-70\",\n \"cursor-pointer transition-all\",\n \"outline-0\",\n \"focus:ring-2\",\n \"focus:ring-border\",\n \"hover:opacity-100\",\n \"hover:bg-accent\",\n \"data-[state=open]:bg-accent\",\n \"data-[state=open]:text-muted-foreground\",\n \"disabled:pointer-events-none\",\n \"[&_svg]:text-accent-foreground/60\",\n \"[&_svg]:hover:text-accent-foreground\",\n \"[&_svg]:pointer-events-none\",\n \"[&_svg]:shrink-0\",\n \"[&_svg:not([class*='size-'])]:size-5\",\n )}\n >\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </div>\n </DialogPortal>\n );\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)}\n {...props}\n />\n );\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n \"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn(\"text-lg leading-none font-semibold\", className)}\n {...props}\n />\n );\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n"],"mappings":"wNAOA,SAAS,EAAO,CACd,GAAG,GACiD,CACpD,OAAO,EAAA,EAAA,KAACA,EAAAA,OAAgB,KAAA,CAAK,YAAU,SAAS,GAAI,IAGtD,SAAS,EAAc,CACrB,GAAG,GACoD,CACvD,OAAO,EAAA,EAAA,KAACA,EAAAA,OAAgB,QAAA,CAAQ,YAAU,iBAAiB,GAAI,IAGjE,SAAS,EAAa,CACpB,GAAG,GACmD,CACtD,OAAO,EAAA,EAAA,KAACA,EAAAA,OAAgB,OAAA,CAAO,YAAU,gBAAgB,GAAI,IAG/D,SAAS,EAAY,CACnB,GAAG,GACkD,CACrD,OAAO,EAAA,EAAA,KAACA,EAAAA,OAAgB,MAAA,CAAM,YAAU,eAAe,GAAI,IAG7D,SAAS,EAAc,CACrB,YACA,GAAG,GACoD,CACvD,OACE,EAAA,EAAA,KAACA,EAAAA,OAAgB,QAAA,CACf,YAAU,iBACV,UAAWC,EAAAA,GACT,iCACA,+BACA,8BACA,kCACA,iCACA,GAEF,GAAI,IAKV,SAAS,EAAc,CACrB,YACA,WACA,kBAAkB,GAClB,GAAG,GAGF,CACD,OACE,EAAA,EAAA,MAAC,EAAA,CAAa,YAAU,2BACtB,EAAA,EAAA,KAAC,EAAA,KACD,EAAA,EAAA,KAAC,MAAA,CAAI,UAAU,gEACb,EAAA,EAAA,MAACD,EAAAA,OAAgB,QAAA,CACf,YAAU,iBACV,UAAWC,EAAAA,GACT,qCACA,yDACA,2DACA,+BACA,8BACA,+BACA,kCACA,iCACA,kCACA,GAEF,GAAI,YAEH,EACA,IACC,EAAA,EAAA,MAACD,EAAAA,OAAgB,MAAA,CACf,YAAU,eACV,SAAU,GACV,UAAWC,EAAAA,GACT,WACA,qDACA,gCACA,YACA,eACA,oBACA,oBACA,kBACA,8BACA,0CACA,+BACA,oCACA,uCACA,8BACA,mBACA,mDAGF,EAAA,EAAA,KAACC,EAAAA,MAAAA,KACD,EAAA,EAAA,KAAC,OAAA,CAAK,UAAU,mBAAU,qBASxC,SAAS,EAAa,CAAE,YAAW,GAAG,GAAsC,CAC1E,OACE,EAAA,EAAA,KAAC,MAAA,CACC,YAAU,gBACV,UAAWD,EAAAA,GAAG,+CAAgD,GAC9D,GAAI,IAKV,SAAS,EAAa,CAAE,YAAW,GAAG,GAAsC,CAC1E,OACE,EAAA,EAAA,KAAC,MAAA,CACC,YAAU,gBACV,UAAWA,EAAAA,GACT,yDACA,GAEF,GAAI,IAKV,SAAS,EAAY,CACnB,YACA,GAAG,GACkD,CACrD,OACE,EAAA,EAAA,KAACD,EAAAA,OAAgB,MAAA,CACf,YAAU,eACV,UAAWC,EAAAA,GAAG,qCAAsC,GACpD,GAAI,IAKV,SAAS,EAAkB,CACzB,YACA,GAAG,GACwD,CAC3D,OACE,EAAA,EAAA,KAACD,EAAAA,OAAgB,YAAA,CACf,YAAU,qBACV,UAAWC,EAAAA,GAAG,gCAAiC,GAC/C,GAAI"}
1
+ {"version":3,"file":"dialog-CH0Dihp0.cjs","names":["DialogPrimitive","cn","XIcon"],"sources":["../packages/components/ui/dialog.tsx"],"sourcesContent":["\"use client\";\nimport React from \"react\";\nimport { Dialog as DialogPrimitive } from \"radix-ui\";\nimport { XIcon } from \"lucide-react\";\n\nimport { cn } from \"@/lib/utils\";\n\nfunction Dialog({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Root>) {\n return <DialogPrimitive.Root data-slot=\"dialog\" {...props} />;\n}\n\nfunction DialogTrigger({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Trigger>) {\n return <DialogPrimitive.Trigger data-slot=\"dialog-trigger\" {...props} />;\n}\n\nfunction DialogPortal({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Portal>) {\n return <DialogPrimitive.Portal data-slot=\"dialog-portal\" {...props} />;\n}\n\nfunction DialogClose({\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Close>) {\n return <DialogPrimitive.Close data-slot=\"dialog-close\" {...props} />;\n}\n\nfunction DialogOverlay({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Overlay>) {\n return (\n <DialogPrimitive.Overlay\n data-slot=\"dialog-overlay\"\n className={cn(\n \"fixed inset-0 z-50 bg-black/50\",\n \"data-[state=open]:animate-in\",\n \"data-[state=open]:fade-in-0\",\n \"data-[state=closed]:animate-out\",\n \"data-[state=closed]:fade-out-0\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogContent({\n className,\n children,\n showCloseButton = true,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Content> & {\n showCloseButton?: boolean;\n}) {\n return (\n <DialogPortal data-slot=\"dialog-portal\">\n <DialogOverlay />\n <div className=\"fixed inset-0 z-50 flex items-center justify-center\">\n <DialogPrimitive.Content\n data-slot=\"dialog-content\"\n className={cn(\n \"bg-background relative dark:border\",\n \"z-50 grid max-h-[85svh] w-full max-w-[calc(100%-2rem)]\",\n \"gap-4 rounded-2xl p-6 shadow-lg duration-200 sm:max-w-lg\",\n \"data-[state=open]:animate-in\",\n \"data-[state=open]:fade-in-0\",\n \"data-[state=open]:zoom-in-80\",\n \"data-[state=closed]:animate-out\",\n \"data-[state=closed]:fade-out-0\",\n \"data-[state=closed]:zoom-out-80\",\n className,\n )}\n {...props}\n >\n {children}\n {showCloseButton && (\n <DialogPrimitive.Close\n data-slot=\"dialog-close\"\n tabIndex={-1}\n className={cn(\n \"btnClose\",\n \"absolute top-3 right-3 rounded-full p-2 opacity-70\",\n \"cursor-pointer transition-all\",\n \"outline-0\",\n \"focus:ring-2\",\n \"focus:ring-border\",\n \"hover:opacity-100\",\n \"hover:bg-accent\",\n \"data-[state=open]:bg-accent\",\n \"data-[state=open]:text-muted-foreground\",\n \"disabled:pointer-events-none\",\n \"[&_svg]:text-accent-foreground/60\",\n \"[&_svg]:hover:text-accent-foreground\",\n \"[&_svg]:pointer-events-none\",\n \"[&_svg]:shrink-0\",\n \"[&_svg:not([class*='size-'])]:size-5\",\n )}\n >\n <XIcon />\n <span className=\"sr-only\">Close</span>\n </DialogPrimitive.Close>\n )}\n </DialogPrimitive.Content>\n </div>\n </DialogPortal>\n );\n}\n\nfunction DialogHeader({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-header\"\n className={cn(\"flex flex-col gap-2 text-center sm:text-left\", className)}\n {...props}\n />\n );\n}\n\nfunction DialogFooter({ className, ...props }: React.ComponentProps<\"div\">) {\n return (\n <div\n data-slot=\"dialog-footer\"\n className={cn(\n \"flex flex-col-reverse gap-2 sm:flex-row sm:justify-end\",\n className,\n )}\n {...props}\n />\n );\n}\n\nfunction DialogTitle({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Title>) {\n return (\n <DialogPrimitive.Title\n data-slot=\"dialog-title\"\n className={cn(\"text-lg leading-none font-semibold\", className)}\n {...props}\n />\n );\n}\n\nfunction DialogDescription({\n className,\n ...props\n}: React.ComponentProps<typeof DialogPrimitive.Description>) {\n return (\n <DialogPrimitive.Description\n data-slot=\"dialog-description\"\n className={cn(\"text-muted-foreground text-sm\", className)}\n {...props}\n />\n );\n}\n\nexport {\n Dialog,\n DialogClose,\n DialogContent,\n DialogDescription,\n DialogFooter,\n DialogHeader,\n DialogOverlay,\n DialogPortal,\n DialogTitle,\n DialogTrigger,\n};\n"],"mappings":"wNAOA,SAAS,EAAO,CACd,GAAG,GACiD,CACpD,OAAO,EAAA,EAAA,KAACA,EAAAA,OAAgB,KAAA,CAAK,YAAU,SAAS,GAAI,IAGtD,SAAS,EAAc,CACrB,GAAG,GACoD,CACvD,OAAO,EAAA,EAAA,KAACA,EAAAA,OAAgB,QAAA,CAAQ,YAAU,iBAAiB,GAAI,IAGjE,SAAS,EAAa,CACpB,GAAG,GACmD,CACtD,OAAO,EAAA,EAAA,KAACA,EAAAA,OAAgB,OAAA,CAAO,YAAU,gBAAgB,GAAI,IAG/D,SAAS,EAAY,CACnB,GAAG,GACkD,CACrD,OAAO,EAAA,EAAA,KAACA,EAAAA,OAAgB,MAAA,CAAM,YAAU,eAAe,GAAI,IAG7D,SAAS,EAAc,CACrB,YACA,GAAG,GACoD,CACvD,OACE,EAAA,EAAA,KAACA,EAAAA,OAAgB,QAAA,CACf,YAAU,iBACV,UAAWC,EAAAA,GACT,iCACA,+BACA,8BACA,kCACA,iCACA,GAEF,GAAI,IAKV,SAAS,EAAc,CACrB,YACA,WACA,kBAAkB,GAClB,GAAG,GAGF,CACD,OACE,EAAA,EAAA,MAAC,EAAA,CAAa,YAAU,2BACtB,EAAA,EAAA,KAAC,EAAA,KACD,EAAA,EAAA,KAAC,MAAA,CAAI,UAAU,gEACb,EAAA,EAAA,MAACD,EAAAA,OAAgB,QAAA,CACf,YAAU,iBACV,UAAWC,EAAAA,GACT,qCACA,yDACA,2DACA,+BACA,8BACA,+BACA,kCACA,iCACA,kCACA,GAEF,GAAI,YAEH,EACA,IACC,EAAA,EAAA,MAACD,EAAAA,OAAgB,MAAA,CACf,YAAU,eACV,SAAU,GACV,UAAWC,EAAAA,GACT,WACA,qDACA,gCACA,YACA,eACA,oBACA,oBACA,kBACA,8BACA,0CACA,+BACA,oCACA,uCACA,8BACA,mBACA,mDAGF,EAAA,EAAA,KAACC,EAAAA,MAAAA,KACD,EAAA,EAAA,KAAC,OAAA,CAAK,UAAU,mBAAU,qBASxC,SAAS,EAAa,CAAE,YAAW,GAAG,GAAsC,CAC1E,OACE,EAAA,EAAA,KAAC,MAAA,CACC,YAAU,gBACV,UAAWD,EAAAA,GAAG,+CAAgD,GAC9D,GAAI,IAKV,SAAS,EAAa,CAAE,YAAW,GAAG,GAAsC,CAC1E,OACE,EAAA,EAAA,KAAC,MAAA,CACC,YAAU,gBACV,UAAWA,EAAAA,GACT,yDACA,GAEF,GAAI,IAKV,SAAS,EAAY,CACnB,YACA,GAAG,GACkD,CACrD,OACE,EAAA,EAAA,KAACD,EAAAA,OAAgB,MAAA,CACf,YAAU,eACV,UAAWC,EAAAA,GAAG,qCAAsC,GACpD,GAAI,IAKV,SAAS,EAAkB,CACzB,YACA,GAAG,GACwD,CAC3D,OACE,EAAA,EAAA,KAACD,EAAAA,OAAgB,YAAA,CACf,YAAU,qBACV,UAAWC,EAAAA,GAAG,gCAAiC,GAC/C,GAAI"}
@@ -1,24 +1,24 @@
1
1
  import React from "react";
2
- import * as react_jsx_runtime100 from "react/jsx-runtime";
2
+ import * as react_jsx_runtime197 from "react/jsx-runtime";
3
3
  import { Dialog } from "radix-ui";
4
4
 
5
5
  //#region packages/components/ui/dialog.d.ts
6
6
  declare function Dialog$1({
7
7
  ...props
8
- }: React.ComponentProps<typeof Dialog.Root>): react_jsx_runtime100.JSX.Element;
8
+ }: React.ComponentProps<typeof Dialog.Root>): react_jsx_runtime197.JSX.Element;
9
9
  declare function DialogTrigger({
10
10
  ...props
11
- }: React.ComponentProps<typeof Dialog.Trigger>): react_jsx_runtime100.JSX.Element;
11
+ }: React.ComponentProps<typeof Dialog.Trigger>): react_jsx_runtime197.JSX.Element;
12
12
  declare function DialogPortal({
13
13
  ...props
14
- }: React.ComponentProps<typeof Dialog.Portal>): react_jsx_runtime100.JSX.Element;
14
+ }: React.ComponentProps<typeof Dialog.Portal>): react_jsx_runtime197.JSX.Element;
15
15
  declare function DialogClose({
16
16
  ...props
17
- }: React.ComponentProps<typeof Dialog.Close>): react_jsx_runtime100.JSX.Element;
17
+ }: React.ComponentProps<typeof Dialog.Close>): react_jsx_runtime197.JSX.Element;
18
18
  declare function DialogOverlay({
19
19
  className,
20
20
  ...props
21
- }: React.ComponentProps<typeof Dialog.Overlay>): react_jsx_runtime100.JSX.Element;
21
+ }: React.ComponentProps<typeof Dialog.Overlay>): react_jsx_runtime197.JSX.Element;
22
22
  declare function DialogContent({
23
23
  className,
24
24
  children,
@@ -26,23 +26,23 @@ declare function DialogContent({
26
26
  ...props
27
27
  }: React.ComponentProps<typeof Dialog.Content> & {
28
28
  showCloseButton?: boolean;
29
- }): react_jsx_runtime100.JSX.Element;
29
+ }): react_jsx_runtime197.JSX.Element;
30
30
  declare function DialogHeader({
31
31
  className,
32
32
  ...props
33
- }: React.ComponentProps<"div">): react_jsx_runtime100.JSX.Element;
33
+ }: React.ComponentProps<"div">): react_jsx_runtime197.JSX.Element;
34
34
  declare function DialogFooter({
35
35
  className,
36
36
  ...props
37
- }: React.ComponentProps<"div">): react_jsx_runtime100.JSX.Element;
37
+ }: React.ComponentProps<"div">): react_jsx_runtime197.JSX.Element;
38
38
  declare function DialogTitle({
39
39
  className,
40
40
  ...props
41
- }: React.ComponentProps<typeof Dialog.Title>): react_jsx_runtime100.JSX.Element;
41
+ }: React.ComponentProps<typeof Dialog.Title>): react_jsx_runtime197.JSX.Element;
42
42
  declare function DialogDescription({
43
43
  className,
44
44
  ...props
45
- }: React.ComponentProps<typeof Dialog.Description>): react_jsx_runtime100.JSX.Element;
45
+ }: React.ComponentProps<typeof Dialog.Description>): react_jsx_runtime197.JSX.Element;
46
46
  //#endregion
47
47
  export { Dialog$1 as Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
48
- //# sourceMappingURL=dialog-ODkNpSlH.d.ts.map
48
+ //# sourceMappingURL=dialog-Ch71L6oE.d.ts.map
@@ -1,24 +1,24 @@
1
- import * as react_jsx_runtime56 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime71 from "react/jsx-runtime";
2
2
  import React from "react";
3
3
  import { Dialog } from "radix-ui";
4
4
 
5
5
  //#region packages/components/ui/dialog.d.ts
6
6
  declare function Dialog$1({
7
7
  ...props
8
- }: React.ComponentProps<typeof Dialog.Root>): react_jsx_runtime56.JSX.Element;
8
+ }: React.ComponentProps<typeof Dialog.Root>): react_jsx_runtime71.JSX.Element;
9
9
  declare function DialogTrigger({
10
10
  ...props
11
- }: React.ComponentProps<typeof Dialog.Trigger>): react_jsx_runtime56.JSX.Element;
11
+ }: React.ComponentProps<typeof Dialog.Trigger>): react_jsx_runtime71.JSX.Element;
12
12
  declare function DialogPortal({
13
13
  ...props
14
- }: React.ComponentProps<typeof Dialog.Portal>): react_jsx_runtime56.JSX.Element;
14
+ }: React.ComponentProps<typeof Dialog.Portal>): react_jsx_runtime71.JSX.Element;
15
15
  declare function DialogClose({
16
16
  ...props
17
- }: React.ComponentProps<typeof Dialog.Close>): react_jsx_runtime56.JSX.Element;
17
+ }: React.ComponentProps<typeof Dialog.Close>): react_jsx_runtime71.JSX.Element;
18
18
  declare function DialogOverlay({
19
19
  className,
20
20
  ...props
21
- }: React.ComponentProps<typeof Dialog.Overlay>): react_jsx_runtime56.JSX.Element;
21
+ }: React.ComponentProps<typeof Dialog.Overlay>): react_jsx_runtime71.JSX.Element;
22
22
  declare function DialogContent({
23
23
  className,
24
24
  children,
@@ -26,23 +26,23 @@ declare function DialogContent({
26
26
  ...props
27
27
  }: React.ComponentProps<typeof Dialog.Content> & {
28
28
  showCloseButton?: boolean;
29
- }): react_jsx_runtime56.JSX.Element;
29
+ }): react_jsx_runtime71.JSX.Element;
30
30
  declare function DialogHeader({
31
31
  className,
32
32
  ...props
33
- }: React.ComponentProps<"div">): react_jsx_runtime56.JSX.Element;
33
+ }: React.ComponentProps<"div">): react_jsx_runtime71.JSX.Element;
34
34
  declare function DialogFooter({
35
35
  className,
36
36
  ...props
37
- }: React.ComponentProps<"div">): react_jsx_runtime56.JSX.Element;
37
+ }: React.ComponentProps<"div">): react_jsx_runtime71.JSX.Element;
38
38
  declare function DialogTitle({
39
39
  className,
40
40
  ...props
41
- }: React.ComponentProps<typeof Dialog.Title>): react_jsx_runtime56.JSX.Element;
41
+ }: React.ComponentProps<typeof Dialog.Title>): react_jsx_runtime71.JSX.Element;
42
42
  declare function DialogDescription({
43
43
  className,
44
44
  ...props
45
- }: React.ComponentProps<typeof Dialog.Description>): react_jsx_runtime56.JSX.Element;
45
+ }: React.ComponentProps<typeof Dialog.Description>): react_jsx_runtime71.JSX.Element;
46
46
  //#endregion
47
47
  export { Dialog$1 as Dialog, DialogClose, DialogContent, DialogDescription, DialogFooter, DialogHeader, DialogOverlay, DialogPortal, DialogTitle, DialogTrigger };
48
- //# sourceMappingURL=dialog-CuqlkOcw.d.cts.map
48
+ //# sourceMappingURL=dialog-DQY1Cjay.d.cts.map
@@ -1,2 +1,2 @@
1
- const e=require(`../chunk-hhQzssFb.cjs`);require(`../utils-DaJ1XZgX.cjs`),require(`../button-CycE0WzB.cjs`);const t=require(`../alert-dialog-BQv-ZvW9.cjs`),n=e.__toESM(require(`react/jsx-runtime`)),r=({open:e,isLoading:r=!1,title:i,description:a,onOpenChange:o,onConfirm:s})=>(0,n.jsx)(t.AlertDialog,{open:e,onOpenChange:o,children:(0,n.jsxs)(t.AlertDialogContent,{children:[(0,n.jsxs)(t.AlertDialogHeader,{className:`gap-0`,children:[(0,n.jsx)(t.AlertDialogTitle,{children:i}),(0,n.jsx)(t.AlertDialogDescription,{children:a})]}),(0,n.jsxs)(t.AlertDialogFooter,{children:[(0,n.jsx)(t.AlertDialogCancel,{children:`Cancel`}),(0,n.jsx)(t.AlertDialogAction,{className:`w-24`,onClick:s,children:r?(0,n.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center`,children:(0,n.jsx)(`div`,{className:`loader-spinner text-muted-foreground`})}):`Confirm`})]})]})});exports.ConfirmDialog=r;
1
+ const e=require(`../chunk-hhQzssFb.cjs`);require(`../utils-DaJ1XZgX.cjs`),require(`../button-CycE0WzB.cjs`);const t=require(`../alert-dialog-D1DFrl-0.cjs`),n=e.__toESM(require(`react/jsx-runtime`)),r=({open:e,isLoading:r=!1,title:i,description:a,onOpenChange:o,onConfirm:s})=>(0,n.jsx)(t.AlertDialog,{open:e,onOpenChange:o,children:(0,n.jsxs)(t.AlertDialogContent,{children:[(0,n.jsxs)(t.AlertDialogHeader,{className:`gap-0`,children:[(0,n.jsx)(t.AlertDialogTitle,{children:i}),(0,n.jsx)(t.AlertDialogDescription,{children:a})]}),(0,n.jsxs)(t.AlertDialogFooter,{children:[(0,n.jsx)(t.AlertDialogCancel,{children:`Cancel`}),(0,n.jsx)(t.AlertDialogAction,{className:`w-24`,onClick:s,children:r?(0,n.jsx)(`div`,{className:`absolute inset-0 flex items-center justify-center`,children:(0,n.jsx)(`div`,{className:`loader-spinner text-muted-foreground`})}):`Confirm`})]})]})});exports.ConfirmDialog=r;
2
2
  //# sourceMappingURL=confirm-dialog.cjs.map
@@ -1,2 +1,2 @@
1
- import"../utils-D9AH0PUV.js";import"../button-Bku3bKv9.js";import{AlertDialog as e,AlertDialogAction as t,AlertDialogCancel as n,AlertDialogContent as r,AlertDialogDescription as i,AlertDialogFooter as a,AlertDialogHeader as o,AlertDialogTitle as s}from"../alert-dialog-0KwdjY-6.js";import{jsx as c,jsxs as l}from"react/jsx-runtime";const u=({open:u,isLoading:d=!1,title:f,description:p,onOpenChange:m,onConfirm:h})=>c(e,{open:u,onOpenChange:m,children:l(r,{children:[l(o,{className:`gap-0`,children:[c(s,{children:f}),c(i,{children:p})]}),l(a,{children:[c(n,{children:`Cancel`}),c(t,{className:`w-24`,onClick:h,children:d?c(`div`,{className:`absolute inset-0 flex items-center justify-center`,children:c(`div`,{className:`loader-spinner text-muted-foreground`})}):`Confirm`})]})]})});export{u as ConfirmDialog};
1
+ import"../utils-D9AH0PUV.js";import"../button-Bku3bKv9.js";import{AlertDialog as e,AlertDialogAction as t,AlertDialogCancel as n,AlertDialogContent as r,AlertDialogDescription as i,AlertDialogFooter as a,AlertDialogHeader as o,AlertDialogTitle as s}from"../alert-dialog-CQa0TLlF.js";import{jsx as c,jsxs as l}from"react/jsx-runtime";const u=({open:u,isLoading:d=!1,title:f,description:p,onOpenChange:m,onConfirm:h})=>c(e,{open:u,onOpenChange:m,children:l(r,{children:[l(o,{className:`gap-0`,children:[c(s,{children:f}),c(i,{children:p})]}),l(a,{children:[c(n,{children:`Cancel`}),c(t,{className:`w-24`,onClick:h,children:d?c(`div`,{className:`absolute inset-0 flex items-center justify-center`,children:c(`div`,{className:`loader-spinner text-muted-foreground`})}):`Confirm`})]})]})});export{u as ConfirmDialog};
2
2
  //# sourceMappingURL=confirm-dialog.js.map
@@ -1,2 +1,2 @@
1
- const e=require(`../../chunk-hhQzssFb.cjs`),t=require(`../../utils-DaJ1XZgX.cjs`),n=require(`../../flex-yTyoLpgH.cjs`),r=require(`../../date-ByLOGsKl.cjs`),i=require(`../../tooltip-BFeC0iub.cjs`),a=require(`../../button-CycE0WzB.cjs`),o=require(`../../dialog-CXZOtc6v.cjs`);require(`../../input-C8Sebaue.cjs`);const s=require(`../../title-CIQdEGOd.cjs`);require(`../../separator-D4iTmsID.cjs`),require(`../../skeleton-BTQm_mtV.cjs`);const c=e.__toESM(require(`react`)),l=e.__toESM(require(`react/jsx-runtime`)),u=e.__toESM(require(`class-variance-authority`)),d=e.__toESM(require(`radix-ui`)),f=e.__toESM(require(`lucide-react`)),p=()=>(0,l.jsxs)(o.DialogHeader,{className:`sr-only`,children:[(0,l.jsx)(o.DialogTitle,{className:`sr-only`}),(0,l.jsx)(o.DialogDescription,{className:`sr-only`})]}),m=`detai_dialog_sidebar_state`,h=3600*24*7,g=`16rem`,_=`3rem`,v=`p`,y=c.default.createContext(null);function b(){let e=c.default.useContext(y);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function x({defaultOpen:e=!0,open:n,onOpenChange:r,className:a,style:o,children:s,...u}){let[d,f]=c.default.useState(!1),[p,m]=c.default.useState(e),h=n??p,g=c.default.useCallback(e=>{let t=typeof e==`function`?e(h):e;r?r(t):m(t),document.cookie=`detai_dialog_sidebar_state=${t}; path=/; max-age=604800`},[r,h]),_=c.default.useCallback(()=>g(e=>!e),[g]);c.default.useEffect(()=>{let e=e=>{e.key===`p`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),_())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[_]);let v=h?`expanded`:`collapsed`,b=c.default.useMemo(()=>({state:v,open:h,setOpen:g,openMobile:d,setOpenMobile:f,toggleSidebar:_}),[v,h,g,d,f,_]);return(0,l.jsx)(y.Provider,{value:b,children:(0,l.jsx)(i.TooltipProvider,{delayDuration:0,children:(0,l.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":`16rem`,"--sidebar-width-icon":`3rem`,...o},className:t.cn(`group/sidebar-wrapper`,`has-data-[variant=inset]:bg-sidebar`,`flex min-h-svh w-full`,a),...u,children:s})})})}function S({side:e=`left`,variant:n=`sidebar`,collapsible:r=`offcanvas`,className:i,children:a,...o}){let{state:s}=b();return r===`none`?(0,l.jsx)(`div`,{"data-slot":`sidebar`,className:t.cn(`bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col`,i),...o,children:a}):(0,l.jsxs)(`div`,{className:`group peer text-sidebar-foreground hidden md:block`,"data-state":s,"data-collapsible":s===`collapsed`?r:``,"data-variant":n,"data-side":e,"data-slot":`sidebar`,children:[(0,l.jsx)(`div`,{"data-slot":`sidebar-gap`,className:t.cn(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,n===`floating`||n===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),(0,l.jsx)(`div`,{"data-slot":`sidebar-container`,className:t.cn(`absolute inset-y-0 z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex`,e===`left`?`left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]`:`right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,n===`floating`||n===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,i),...o,children:(0,l.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:t.cn(`flex h-full w-full flex-col`,`group-data-[variant=floating]:border-sidebar-border`,`group-data-[variant=floating]:rounded-lg`,`group-data-[variant=floating]:border`,`group-data-[variant=floating]:shadow-sm`),children:a})})]})}function C({className:e,onClick:n,...r}){let{toggleSidebar:i}=b();return(0,l.jsxs)(a.Button,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,size:`icon`,className:t.cn(`size-10 rounded-full [&_svg]:!size-6`,e),onClick:e=>{n?.(e),i()},...r,children:[(0,l.jsx)(f.MenuIcon,{}),(0,l.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function w({className:e,...n}){return(0,l.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:t.cn(`flex flex-col gap-2 p-2`,e),...n})}function T({className:e,...n}){return(0,l.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:t.cn(`flex flex-col gap-2 p-2`,e),...n})}function E({className:e,...n}){return(0,l.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:t.cn(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto`,`group-data-[collapsible=icon]:overflow-hidden`,e),...n})}function D({className:e,...n}){return(0,l.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:t.cn(`relative flex w-full min-w-0 flex-col p-2`,e),...n})}function O({className:e,...n}){return(0,l.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:t.cn(`flex w-full min-w-0 flex-col gap-1`,e),...n})}function k({className:e,...n}){return(0,l.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:t.cn(`group/menu-item relative`,e),...n})}const A=(0,u.cva)(`peer/menu-button cursor-pointer flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background border shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function j({asChild:e=!1,isActive:n=!1,variant:r=`default`,size:a=`default`,tooltip:o,className:s,...c}){let u=e?d.Slot.Slot:`button`,{state:f}=b(),p=(0,l.jsx)(u,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":a,"data-active":n,className:t.cn(A({variant:r,size:a}),s),...c});return o?(typeof o==`string`&&(o={children:o}),(0,l.jsxs)(i.Tooltip,{children:[(0,l.jsx)(i.TooltipTrigger,{asChild:!0,children:p}),(0,l.jsx)(i.TooltipContent,{side:`right`,align:`center`,hidden:f!==`collapsed`,...o})]})):p}const M=({children:e})=>(0,l.jsx)(`main`,{className:`relative flex h-full flex-1 flex-col`,children:(0,l.jsx)(`div`,{className:`absolute inset-0 flex size-full flex-col`,children:e})}),N=({title:e,createdAt:t})=>(0,l.jsxs)(`header`,{className:`relative flex items-start gap-x-2.5 border-b px-2 py-2.5`,children:[(0,l.jsx)(C,{}),(0,l.jsxs)(n.Flex,{vertical:!0,align:`start`,padding:`none`,className:`flex-1`,children:[(0,l.jsx)(s.Title,{level:5,children:e||`Detail Dialog`}),(0,l.jsxs)(n.Flex,{padding:`none`,className:`text-muted-foreground`,children:[(0,l.jsx)(f.CalendarIcon,{size:12}),!!t&&(0,l.jsx)(r.DateDisplay,{showTime:!0,showHoliday:!0,date:t,format:`full`})]})]})]}),P=({children:e})=>(0,l.jsx)(o.DialogContent,{className:`relative h-full max-h-[90svh] overflow-hidden rounded-lg border-none p-0 sm:max-w-[calc(100svw-2rem)]`,onInteractOutside:e=>{e.preventDefault(),e.stopPropagation()},children:e}),F=({title:e,sidebarFooter:t,children:n})=>(0,l.jsxs)(S,{collapsible:`icon`,className:`hidden border-r md:flex`,children:[(0,l.jsx)(w,{children:(0,l.jsx)(O,{children:(0,l.jsx)(k,{children:(0,l.jsxs)(j,{size:`lg`,tabIndex:-1,children:[(0,l.jsx)(`div`,{className:`bg-sidebar-primary text-sidebar-primary-foreground flex aspect-square size-8 items-center justify-center rounded-lg`,children:(0,l.jsx)(f.CatIcon,{size:16})}),(0,l.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[(0,l.jsx)(`span`,{className:`truncate font-medium`,children:e||`Detail Dialog`}),(0,l.jsx)(`span`,{className:`truncate text-xs`,children:`Lunas Enterprise`})]})]})})})}),(0,l.jsx)(E,{children:(0,l.jsx)(D,{children:n})}),t&&(0,l.jsx)(T,{children:t})]}),I=({open:e,isLoading:t=!1,sidebarTitle:r,sidebar:i,sidebarFooter:a,title:s,createdAt:c,onOpenChange:u,children:d})=>(0,l.jsx)(o.Dialog,{open:e,onOpenChange:u,children:(0,l.jsxs)(P,{children:[(0,l.jsx)(p,{}),(0,l.jsxs)(x,{className:`h-full min-h-[85svh] items-start`,children:[(0,l.jsx)(F,{title:r,sidebarFooter:a,children:i}),(0,l.jsxs)(M,{children:[(0,l.jsx)(N,{title:s,createdAt:c}),t?(0,l.jsx)(n.Flex,{justify:`center`,className:`bg-muted/50 size-full`,children:(0,l.jsx)(`div`,{className:`loader`})}):(0,l.jsx)(`section`,{className:`bg-muted/50 relative flex-1 overflow-y-auto inset-shadow-sm`,children:d})]})]})]})});exports.DetailDialog=I;
1
+ const e=require(`../../chunk-hhQzssFb.cjs`),t=require(`../../utils-DaJ1XZgX.cjs`),n=require(`../../flex-yTyoLpgH.cjs`),r=require(`../../date-ByLOGsKl.cjs`),i=require(`../../tooltip-BFeC0iub.cjs`),a=require(`../../button-CycE0WzB.cjs`),o=require(`../../dialog-CH0Dihp0.cjs`);require(`../../input-C8Sebaue.cjs`);const s=require(`../../title-CIQdEGOd.cjs`);require(`../../separator-D4iTmsID.cjs`),require(`../../skeleton-BTQm_mtV.cjs`);const c=e.__toESM(require(`react`)),l=e.__toESM(require(`react/jsx-runtime`)),u=e.__toESM(require(`class-variance-authority`)),d=e.__toESM(require(`radix-ui`)),f=e.__toESM(require(`lucide-react`)),p=()=>(0,l.jsxs)(o.DialogHeader,{className:`sr-only`,children:[(0,l.jsx)(o.DialogTitle,{className:`sr-only`}),(0,l.jsx)(o.DialogDescription,{className:`sr-only`})]}),m=`detai_dialog_sidebar_state`,h=3600*24*7,g=`16rem`,_=`3rem`,v=`p`,y=c.default.createContext(null);function b(){let e=c.default.useContext(y);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function x({defaultOpen:e=!0,open:n,onOpenChange:r,className:a,style:o,children:s,...u}){let[d,f]=c.default.useState(!1),[p,m]=c.default.useState(e),h=n??p,g=c.default.useCallback(e=>{let t=typeof e==`function`?e(h):e;r?r(t):m(t),document.cookie=`detai_dialog_sidebar_state=${t}; path=/; max-age=604800`},[r,h]),_=c.default.useCallback(()=>g(e=>!e),[g]);c.default.useEffect(()=>{let e=e=>{e.key===`p`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),_())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[_]);let v=h?`expanded`:`collapsed`,b=c.default.useMemo(()=>({state:v,open:h,setOpen:g,openMobile:d,setOpenMobile:f,toggleSidebar:_}),[v,h,g,d,f,_]);return(0,l.jsx)(y.Provider,{value:b,children:(0,l.jsx)(i.TooltipProvider,{delayDuration:0,children:(0,l.jsx)(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":`16rem`,"--sidebar-width-icon":`3rem`,...o},className:t.cn(`group/sidebar-wrapper`,`has-data-[variant=inset]:bg-sidebar`,`flex min-h-svh w-full`,a),...u,children:s})})})}function S({side:e=`left`,variant:n=`sidebar`,collapsible:r=`offcanvas`,className:i,children:a,...o}){let{state:s}=b();return r===`none`?(0,l.jsx)(`div`,{"data-slot":`sidebar`,className:t.cn(`bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col`,i),...o,children:a}):(0,l.jsxs)(`div`,{className:`group peer text-sidebar-foreground hidden md:block`,"data-state":s,"data-collapsible":s===`collapsed`?r:``,"data-variant":n,"data-side":e,"data-slot":`sidebar`,children:[(0,l.jsx)(`div`,{"data-slot":`sidebar-gap`,className:t.cn(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,n===`floating`||n===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),(0,l.jsx)(`div`,{"data-slot":`sidebar-container`,className:t.cn(`absolute inset-y-0 z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex`,e===`left`?`left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]`:`right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,n===`floating`||n===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,i),...o,children:(0,l.jsx)(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:t.cn(`flex h-full w-full flex-col`,`group-data-[variant=floating]:border-sidebar-border`,`group-data-[variant=floating]:rounded-lg`,`group-data-[variant=floating]:border`,`group-data-[variant=floating]:shadow-sm`),children:a})})]})}function C({className:e,onClick:n,...r}){let{toggleSidebar:i}=b();return(0,l.jsxs)(a.Button,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,size:`icon`,className:t.cn(`size-10 rounded-full [&_svg]:!size-6`,e),onClick:e=>{n?.(e),i()},...r,children:[(0,l.jsx)(f.MenuIcon,{}),(0,l.jsx)(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function w({className:e,...n}){return(0,l.jsx)(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:t.cn(`flex flex-col gap-2 p-2`,e),...n})}function T({className:e,...n}){return(0,l.jsx)(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:t.cn(`flex flex-col gap-2 p-2`,e),...n})}function E({className:e,...n}){return(0,l.jsx)(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:t.cn(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto`,`group-data-[collapsible=icon]:overflow-hidden`,e),...n})}function D({className:e,...n}){return(0,l.jsx)(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:t.cn(`relative flex w-full min-w-0 flex-col p-2`,e),...n})}function O({className:e,...n}){return(0,l.jsx)(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:t.cn(`flex w-full min-w-0 flex-col gap-1`,e),...n})}function k({className:e,...n}){return(0,l.jsx)(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:t.cn(`group/menu-item relative`,e),...n})}const A=(0,u.cva)(`peer/menu-button cursor-pointer flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background border shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function j({asChild:e=!1,isActive:n=!1,variant:r=`default`,size:a=`default`,tooltip:o,className:s,...c}){let u=e?d.Slot.Slot:`button`,{state:f}=b(),p=(0,l.jsx)(u,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":a,"data-active":n,className:t.cn(A({variant:r,size:a}),s),...c});return o?(typeof o==`string`&&(o={children:o}),(0,l.jsxs)(i.Tooltip,{children:[(0,l.jsx)(i.TooltipTrigger,{asChild:!0,children:p}),(0,l.jsx)(i.TooltipContent,{side:`right`,align:`center`,hidden:f!==`collapsed`,...o})]})):p}const M=({children:e})=>(0,l.jsx)(`main`,{className:`relative flex h-full flex-1 flex-col`,children:(0,l.jsx)(`div`,{className:`absolute inset-0 flex size-full flex-col`,children:e})}),N=({title:e,createdAt:t})=>(0,l.jsxs)(`header`,{className:`relative flex items-start gap-x-2.5 border-b px-2 py-2.5`,children:[(0,l.jsx)(C,{}),(0,l.jsxs)(n.Flex,{vertical:!0,align:`start`,padding:`none`,className:`flex-1`,children:[(0,l.jsx)(s.Title,{level:5,children:e||`Detail Dialog`}),(0,l.jsxs)(n.Flex,{padding:`none`,className:`text-muted-foreground`,children:[(0,l.jsx)(f.CalendarIcon,{size:12}),!!t&&(0,l.jsx)(r.DateDisplay,{showTime:!0,showHoliday:!0,date:t,format:`full`})]})]})]}),P=({children:e})=>(0,l.jsx)(o.DialogContent,{className:`relative h-full max-h-[90svh] overflow-hidden rounded-lg border-none p-0 sm:max-w-[calc(100svw-2rem)]`,onInteractOutside:e=>{e.preventDefault(),e.stopPropagation()},children:e}),F=({title:e,sidebarFooter:t,children:n})=>(0,l.jsxs)(S,{collapsible:`icon`,className:`hidden border-r md:flex`,children:[(0,l.jsx)(w,{children:(0,l.jsx)(O,{children:(0,l.jsx)(k,{children:(0,l.jsxs)(j,{size:`lg`,tabIndex:-1,children:[(0,l.jsx)(`div`,{className:`bg-sidebar-primary text-sidebar-primary-foreground flex aspect-square size-8 items-center justify-center rounded-lg`,children:(0,l.jsx)(f.CatIcon,{size:16})}),(0,l.jsxs)(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[(0,l.jsx)(`span`,{className:`truncate font-medium`,children:e||`Detail Dialog`}),(0,l.jsx)(`span`,{className:`truncate text-xs`,children:`Lunas Enterprise`})]})]})})})}),(0,l.jsx)(E,{children:(0,l.jsx)(D,{children:n})}),t&&(0,l.jsx)(T,{children:t})]}),I=({open:e,isLoading:t=!1,sidebarTitle:r,sidebar:i,sidebarFooter:a,title:s,createdAt:c,onOpenChange:u,children:d})=>(0,l.jsx)(o.Dialog,{open:e,onOpenChange:u,children:(0,l.jsxs)(P,{children:[(0,l.jsx)(p,{}),(0,l.jsxs)(x,{className:`h-full min-h-[85svh] items-start`,children:[(0,l.jsx)(F,{title:r,sidebarFooter:a,children:i}),(0,l.jsxs)(M,{children:[(0,l.jsx)(N,{title:s,createdAt:c}),t?(0,l.jsx)(n.Flex,{justify:`center`,className:`bg-muted/50 size-full`,children:(0,l.jsx)(`div`,{className:`loader`})}):(0,l.jsx)(`section`,{className:`bg-muted/50 relative flex-1 overflow-y-auto inset-shadow-sm`,children:d})]})]})]})});exports.DetailDialog=I;
2
2
  //# sourceMappingURL=index.cjs.map
@@ -1,2 +1,2 @@
1
- import{cn as e}from"../../utils-D9AH0PUV.js";import{Flex as t}from"../../flex-ILvQrYMJ.js";import{DateDisplay as n}from"../../date-BMq_DNsv.js";import{Tooltip as r,TooltipContent as i,TooltipProvider as a,TooltipTrigger as o}from"../../tooltip-mqfVQzkp.js";import{Button as s}from"../../button-Bku3bKv9.js";import{Dialog as c,DialogContent as l,DialogDescription as u,DialogHeader as d,DialogTitle as f}from"../../dialog-Cs7JBaly.js";import"../../input-Dmaq3fzf.js";import{Title as p}from"../../title-CA6PvqiD.js";import"../../separator-DMdqEz29.js";import"../../skeleton-D1_Brnl9.js";import m from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";import{cva as _}from"class-variance-authority";import{Slot as v}from"radix-ui";import{CalendarIcon as y,CatIcon as b,MenuIcon as x}from"lucide-react";const S=()=>g(d,{className:`sr-only`,children:[h(f,{className:`sr-only`}),h(u,{className:`sr-only`})]}),C=m.createContext(null);function w(){let e=m.useContext(C);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function T({defaultOpen:t=!0,open:n,onOpenChange:r,className:i,style:o,children:s,...c}){let[l,u]=m.useState(!1),[d,f]=m.useState(t),p=n??d,g=m.useCallback(e=>{let t=typeof e==`function`?e(p):e;r?r(t):f(t),document.cookie=`detai_dialog_sidebar_state=${t}; path=/; max-age=604800`},[r,p]),_=m.useCallback(()=>g(e=>!e),[g]);m.useEffect(()=>{let e=e=>{e.key===`p`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),_())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[_]);let v=p?`expanded`:`collapsed`,y=m.useMemo(()=>({state:v,open:p,setOpen:g,openMobile:l,setOpenMobile:u,toggleSidebar:_}),[v,p,g,l,u,_]);return h(C.Provider,{value:y,children:h(a,{delayDuration:0,children:h(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":`16rem`,"--sidebar-width-icon":`3rem`,...o},className:e(`group/sidebar-wrapper`,`has-data-[variant=inset]:bg-sidebar`,`flex min-h-svh w-full`,i),...c,children:s})})})}function E({side:t=`left`,variant:n=`sidebar`,collapsible:r=`offcanvas`,className:i,children:a,...o}){let{state:s}=w();return r===`none`?h(`div`,{"data-slot":`sidebar`,className:e(`bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col`,i),...o,children:a}):g(`div`,{className:`group peer text-sidebar-foreground hidden md:block`,"data-state":s,"data-collapsible":s===`collapsed`?r:``,"data-variant":n,"data-side":t,"data-slot":`sidebar`,children:[h(`div`,{"data-slot":`sidebar-gap`,className:e(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,n===`floating`||n===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),h(`div`,{"data-slot":`sidebar-container`,className:e(`absolute inset-y-0 z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex`,t===`left`?`left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]`:`right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,n===`floating`||n===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,i),...o,children:h(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:e(`flex h-full w-full flex-col`,`group-data-[variant=floating]:border-sidebar-border`,`group-data-[variant=floating]:rounded-lg`,`group-data-[variant=floating]:border`,`group-data-[variant=floating]:shadow-sm`),children:a})})]})}function D({className:t,onClick:n,...r}){let{toggleSidebar:i}=w();return g(s,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,size:`icon`,className:e(`size-10 rounded-full [&_svg]:!size-6`,t),onClick:e=>{n?.(e),i()},...r,children:[h(x,{}),h(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function O({className:t,...n}){return h(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:e(`flex flex-col gap-2 p-2`,t),...n})}function k({className:t,...n}){return h(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:e(`flex flex-col gap-2 p-2`,t),...n})}function A({className:t,...n}){return h(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:e(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto`,`group-data-[collapsible=icon]:overflow-hidden`,t),...n})}function j({className:t,...n}){return h(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:e(`relative flex w-full min-w-0 flex-col p-2`,t),...n})}function M({className:t,...n}){return h(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:e(`flex w-full min-w-0 flex-col gap-1`,t),...n})}function N({className:t,...n}){return h(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:e(`group/menu-item relative`,t),...n})}const P=_(`peer/menu-button cursor-pointer flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background border shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function F({asChild:t=!1,isActive:n=!1,variant:a=`default`,size:s=`default`,tooltip:c,className:l,...u}){let d=t?v.Slot:`button`,{state:f}=w(),p=h(d,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":s,"data-active":n,className:e(P({variant:a,size:s}),l),...u});return c?(typeof c==`string`&&(c={children:c}),g(r,{children:[h(o,{asChild:!0,children:p}),h(i,{side:`right`,align:`center`,hidden:f!==`collapsed`,...c})]})):p}const I=({children:e})=>h(`main`,{className:`relative flex h-full flex-1 flex-col`,children:h(`div`,{className:`absolute inset-0 flex size-full flex-col`,children:e})}),L=({title:e,createdAt:r})=>g(`header`,{className:`relative flex items-start gap-x-2.5 border-b px-2 py-2.5`,children:[h(D,{}),g(t,{vertical:!0,align:`start`,padding:`none`,className:`flex-1`,children:[h(p,{level:5,children:e||`Detail Dialog`}),g(t,{padding:`none`,className:`text-muted-foreground`,children:[h(y,{size:12}),!!r&&h(n,{showTime:!0,showHoliday:!0,date:r,format:`full`})]})]})]}),R=({children:e})=>h(l,{className:`relative h-full max-h-[90svh] overflow-hidden rounded-lg border-none p-0 sm:max-w-[calc(100svw-2rem)]`,onInteractOutside:e=>{e.preventDefault(),e.stopPropagation()},children:e}),z=({title:e,sidebarFooter:t,children:n})=>g(E,{collapsible:`icon`,className:`hidden border-r md:flex`,children:[h(O,{children:h(M,{children:h(N,{children:g(F,{size:`lg`,tabIndex:-1,children:[h(`div`,{className:`bg-sidebar-primary text-sidebar-primary-foreground flex aspect-square size-8 items-center justify-center rounded-lg`,children:h(b,{size:16})}),g(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[h(`span`,{className:`truncate font-medium`,children:e||`Detail Dialog`}),h(`span`,{className:`truncate text-xs`,children:`Lunas Enterprise`})]})]})})})}),h(A,{children:h(j,{children:n})}),t&&h(k,{children:t})]}),B=({open:e,isLoading:n=!1,sidebarTitle:r,sidebar:i,sidebarFooter:a,title:o,createdAt:s,onOpenChange:l,children:u})=>h(c,{open:e,onOpenChange:l,children:g(R,{children:[h(S,{}),g(T,{className:`h-full min-h-[85svh] items-start`,children:[h(z,{title:r,sidebarFooter:a,children:i}),g(I,{children:[h(L,{title:o,createdAt:s}),n?h(t,{justify:`center`,className:`bg-muted/50 size-full`,children:h(`div`,{className:`loader`})}):h(`section`,{className:`bg-muted/50 relative flex-1 overflow-y-auto inset-shadow-sm`,children:u})]})]})]})});export{B as DetailDialog};
1
+ import{cn as e}from"../../utils-D9AH0PUV.js";import{Flex as t}from"../../flex-ILvQrYMJ.js";import{DateDisplay as n}from"../../date-BMq_DNsv.js";import{Tooltip as r,TooltipContent as i,TooltipProvider as a,TooltipTrigger as o}from"../../tooltip-mqfVQzkp.js";import{Button as s}from"../../button-Bku3bKv9.js";import{Dialog as c,DialogContent as l,DialogDescription as u,DialogHeader as d,DialogTitle as f}from"../../dialog-C0AcPpDH.js";import"../../input-Dmaq3fzf.js";import{Title as p}from"../../title-CA6PvqiD.js";import"../../separator-DMdqEz29.js";import"../../skeleton-D1_Brnl9.js";import m from"react";import{jsx as h,jsxs as g}from"react/jsx-runtime";import{cva as _}from"class-variance-authority";import{Slot as v}from"radix-ui";import{CalendarIcon as y,CatIcon as b,MenuIcon as x}from"lucide-react";const S=()=>g(d,{className:`sr-only`,children:[h(f,{className:`sr-only`}),h(u,{className:`sr-only`})]}),C=m.createContext(null);function w(){let e=m.useContext(C);if(!e)throw Error(`useSidebar must be used within a SidebarProvider.`);return e}function T({defaultOpen:t=!0,open:n,onOpenChange:r,className:i,style:o,children:s,...c}){let[l,u]=m.useState(!1),[d,f]=m.useState(t),p=n??d,g=m.useCallback(e=>{let t=typeof e==`function`?e(p):e;r?r(t):f(t),document.cookie=`detai_dialog_sidebar_state=${t}; path=/; max-age=604800`},[r,p]),_=m.useCallback(()=>g(e=>!e),[g]);m.useEffect(()=>{let e=e=>{e.key===`p`&&(e.metaKey||e.ctrlKey)&&(e.preventDefault(),_())};return window.addEventListener(`keydown`,e),()=>window.removeEventListener(`keydown`,e)},[_]);let v=p?`expanded`:`collapsed`,y=m.useMemo(()=>({state:v,open:p,setOpen:g,openMobile:l,setOpenMobile:u,toggleSidebar:_}),[v,p,g,l,u,_]);return h(C.Provider,{value:y,children:h(a,{delayDuration:0,children:h(`div`,{"data-slot":`sidebar-wrapper`,style:{"--sidebar-width":`16rem`,"--sidebar-width-icon":`3rem`,...o},className:e(`group/sidebar-wrapper`,`has-data-[variant=inset]:bg-sidebar`,`flex min-h-svh w-full`,i),...c,children:s})})})}function E({side:t=`left`,variant:n=`sidebar`,collapsible:r=`offcanvas`,className:i,children:a,...o}){let{state:s}=w();return r===`none`?h(`div`,{"data-slot":`sidebar`,className:e(`bg-sidebar text-sidebar-foreground flex h-full w-(--sidebar-width) flex-col`,i),...o,children:a}):g(`div`,{className:`group peer text-sidebar-foreground hidden md:block`,"data-state":s,"data-collapsible":s===`collapsed`?r:``,"data-variant":n,"data-side":t,"data-slot":`sidebar`,children:[h(`div`,{"data-slot":`sidebar-gap`,className:e(`relative w-(--sidebar-width) bg-transparent transition-[width] duration-200 ease-linear`,`group-data-[collapsible=offcanvas]:w-0`,`group-data-[side=right]:rotate-180`,n===`floating`||n===`inset`?`group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4)))]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon)`)}),h(`div`,{"data-slot":`sidebar-container`,className:e(`absolute inset-y-0 z-10 hidden w-(--sidebar-width) transition-[left,right,width] duration-200 ease-linear md:flex`,t===`left`?`left-0 group-data-[collapsible=offcanvas]:left-[calc(var(--sidebar-width)*-1)]`:`right-0 group-data-[collapsible=offcanvas]:right-[calc(var(--sidebar-width)*-1)]`,n===`floating`||n===`inset`?`p-2 group-data-[collapsible=icon]:w-[calc(var(--sidebar-width-icon)+(--spacing(4))+2px)]`:`group-data-[collapsible=icon]:w-(--sidebar-width-icon) group-data-[side=left]:border-r group-data-[side=right]:border-l`,i),...o,children:h(`div`,{"data-sidebar":`sidebar`,"data-slot":`sidebar-inner`,className:e(`flex h-full w-full flex-col`,`group-data-[variant=floating]:border-sidebar-border`,`group-data-[variant=floating]:rounded-lg`,`group-data-[variant=floating]:border`,`group-data-[variant=floating]:shadow-sm`),children:a})})]})}function D({className:t,onClick:n,...r}){let{toggleSidebar:i}=w();return g(s,{"data-sidebar":`trigger`,"data-slot":`sidebar-trigger`,variant:`ghost`,size:`icon`,className:e(`size-10 rounded-full [&_svg]:!size-6`,t),onClick:e=>{n?.(e),i()},...r,children:[h(x,{}),h(`span`,{className:`sr-only`,children:`Toggle Sidebar`})]})}function O({className:t,...n}){return h(`div`,{"data-slot":`sidebar-header`,"data-sidebar":`header`,className:e(`flex flex-col gap-2 p-2`,t),...n})}function k({className:t,...n}){return h(`div`,{"data-slot":`sidebar-footer`,"data-sidebar":`footer`,className:e(`flex flex-col gap-2 p-2`,t),...n})}function A({className:t,...n}){return h(`div`,{"data-slot":`sidebar-content`,"data-sidebar":`content`,className:e(`flex min-h-0 flex-1 flex-col gap-2 overflow-auto`,`group-data-[collapsible=icon]:overflow-hidden`,t),...n})}function j({className:t,...n}){return h(`div`,{"data-slot":`sidebar-group`,"data-sidebar":`group`,className:e(`relative flex w-full min-w-0 flex-col p-2`,t),...n})}function M({className:t,...n}){return h(`ul`,{"data-slot":`sidebar-menu`,"data-sidebar":`menu`,className:e(`flex w-full min-w-0 flex-col gap-1`,t),...n})}function N({className:t,...n}){return h(`li`,{"data-slot":`sidebar-menu-item`,"data-sidebar":`menu-item`,className:e(`group/menu-item relative`,t),...n})}const P=_(`peer/menu-button cursor-pointer flex w-full items-center gap-2 overflow-hidden rounded-md p-2 text-left text-sm outline-hidden ring-sidebar-ring transition-[width,height,padding] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground focus-visible:ring-2 active:bg-sidebar-accent active:text-sidebar-accent-foreground disabled:pointer-events-none disabled:opacity-50 group-has-data-[sidebar=menu-action]/menu-item:pr-8 aria-disabled:pointer-events-none aria-disabled:opacity-50 data-[active=true]:bg-sidebar-accent data-[active=true]:font-medium data-[active=true]:text-sidebar-accent-foreground data-[state=open]:hover:bg-sidebar-accent data-[state=open]:hover:text-sidebar-accent-foreground group-data-[collapsible=icon]:size-8! group-data-[collapsible=icon]:p-2! [&>span:last-child]:truncate [&>svg]:size-4 [&>svg]:shrink-0`,{variants:{variant:{default:`hover:bg-sidebar-accent hover:text-sidebar-accent-foreground`,outline:`bg-background border shadow-[0_0_0_1px_hsl(var(--sidebar-border))] hover:bg-sidebar-accent hover:text-sidebar-accent-foreground hover:shadow-[0_0_0_1px_hsl(var(--sidebar-accent))]`},size:{default:`h-8 text-sm`,sm:`h-7 text-xs`,lg:`h-12 text-sm group-data-[collapsible=icon]:p-0!`}},defaultVariants:{variant:`default`,size:`default`}});function F({asChild:t=!1,isActive:n=!1,variant:a=`default`,size:s=`default`,tooltip:c,className:l,...u}){let d=t?v.Slot:`button`,{state:f}=w(),p=h(d,{"data-slot":`sidebar-menu-button`,"data-sidebar":`menu-button`,"data-size":s,"data-active":n,className:e(P({variant:a,size:s}),l),...u});return c?(typeof c==`string`&&(c={children:c}),g(r,{children:[h(o,{asChild:!0,children:p}),h(i,{side:`right`,align:`center`,hidden:f!==`collapsed`,...c})]})):p}const I=({children:e})=>h(`main`,{className:`relative flex h-full flex-1 flex-col`,children:h(`div`,{className:`absolute inset-0 flex size-full flex-col`,children:e})}),L=({title:e,createdAt:r})=>g(`header`,{className:`relative flex items-start gap-x-2.5 border-b px-2 py-2.5`,children:[h(D,{}),g(t,{vertical:!0,align:`start`,padding:`none`,className:`flex-1`,children:[h(p,{level:5,children:e||`Detail Dialog`}),g(t,{padding:`none`,className:`text-muted-foreground`,children:[h(y,{size:12}),!!r&&h(n,{showTime:!0,showHoliday:!0,date:r,format:`full`})]})]})]}),R=({children:e})=>h(l,{className:`relative h-full max-h-[90svh] overflow-hidden rounded-lg border-none p-0 sm:max-w-[calc(100svw-2rem)]`,onInteractOutside:e=>{e.preventDefault(),e.stopPropagation()},children:e}),z=({title:e,sidebarFooter:t,children:n})=>g(E,{collapsible:`icon`,className:`hidden border-r md:flex`,children:[h(O,{children:h(M,{children:h(N,{children:g(F,{size:`lg`,tabIndex:-1,children:[h(`div`,{className:`bg-sidebar-primary text-sidebar-primary-foreground flex aspect-square size-8 items-center justify-center rounded-lg`,children:h(b,{size:16})}),g(`div`,{className:`grid flex-1 text-left text-sm leading-tight`,children:[h(`span`,{className:`truncate font-medium`,children:e||`Detail Dialog`}),h(`span`,{className:`truncate text-xs`,children:`Lunas Enterprise`})]})]})})})}),h(A,{children:h(j,{children:n})}),t&&h(k,{children:t})]}),B=({open:e,isLoading:n=!1,sidebarTitle:r,sidebar:i,sidebarFooter:a,title:o,createdAt:s,onOpenChange:l,children:u})=>h(c,{open:e,onOpenChange:l,children:g(R,{children:[h(S,{}),g(T,{className:`h-full min-h-[85svh] items-start`,children:[h(z,{title:r,sidebarFooter:a,children:i}),g(I,{children:[h(L,{title:o,createdAt:s}),n?h(t,{justify:`center`,className:`bg-muted/50 size-full`,children:h(`div`,{className:`loader`})}):h(`section`,{className:`bg-muted/50 relative flex-1 overflow-y-auto inset-shadow-sm`,children:u})]})]})]})});export{B as DetailDialog};
2
2
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- const e=require(`../chunk-hhQzssFb.cjs`);require(`../utils-DaJ1XZgX.cjs`),require(`../button-CycE0WzB.cjs`),require(`../alert-dialog-BQv-ZvW9.cjs`);const t=require(`../error-dialog-DO0Bb-pi.cjs`);exports.ErrorDialog=t.ErrorDialog;
1
+ const e=require(`../chunk-hhQzssFb.cjs`);require(`../utils-DaJ1XZgX.cjs`),require(`../button-CycE0WzB.cjs`),require(`../alert-dialog-D1DFrl-0.cjs`);const t=require(`../error-dialog-BTjeT7x-.cjs`);exports.ErrorDialog=t.ErrorDialog;
@@ -1 +1 @@
1
- import"../utils-D9AH0PUV.js";import"../button-Bku3bKv9.js";import"../alert-dialog-0KwdjY-6.js";import{ErrorDialog as e}from"../error-dialog-D_4WL-Hj.js";export{e as ErrorDialog};
1
+ import"../utils-D9AH0PUV.js";import"../button-Bku3bKv9.js";import"../alert-dialog-CQa0TLlF.js";import{ErrorDialog as e}from"../error-dialog-DlhosP10.js";export{e as ErrorDialog};
@@ -1,2 +1,2 @@
1
- const e=require(`../chunk-hhQzssFb.cjs`),t=require(`../utils-DaJ1XZgX.cjs`),n=require(`../button-CycE0WzB.cjs`);require(`../alert-dialog-BQv-ZvW9.cjs`),require(`../error-dialog-DO0Bb-pi.cjs`),require(`../label-i858Jr98.cjs`),require(`../form-C_PCHrpx.cjs`);const r=require(`../form-wrapper-FYiHHas7.cjs`),i=require(`../dialog-CXZOtc6v.cjs`),a=e.__toESM(require(`react/jsx-runtime`)),o=({form:e,open:o,isSubmitting:s=!1,isResetAfterSubmit:c=!0,disableSubmit:l=!1,title:u,description:d,className:f,onOpenChange:p,onSubmit:m,onError:h,onReset:g,children:_})=>(0,a.jsx)(i.Dialog,{open:o,onOpenChange:p,children:(0,a.jsxs)(i.DialogContent,{className:t.cn(`flex flex-col gap-0 border-none p-0`,f),onInteractOutside:e=>{e.preventDefault(),e.stopPropagation()},children:[(0,a.jsxs)(i.DialogHeader,{className:`flex-0 gap-2 border-b px-6 pt-6 pb-4`,children:[(0,a.jsx)(i.DialogTitle,{children:u||`Form Dialog`}),(0,a.jsx)(i.DialogDescription,{children:d||`This is a form dialog where you can add your form elements.`})]}),(0,a.jsxs)(r.FormWrapper,{form:e,isResetAfterSubmit:c,className:`flex flex-1 flex-col overflow-y-auto pt-4`,onSubmit:m,onError:h,children:[(0,a.jsx)(`main`,{className:`flex-1 overflow-y-auto px-6`,children:_}),(0,a.jsxs)(i.DialogFooter,{className:`border-t px-6 pt-4 pb-6`,children:[(0,a.jsx)(n.Button,{tabIndex:-1,type:`button`,variant:`outline`,className:`w-30 rounded-full`,onClick:g,children:`Reset`}),(0,a.jsx)(n.Button,{autoFocus:!0,tabIndex:0,type:`submit`,isLoading:s,disabled:l,className:`w-30 rounded-full`,children:`Xác nhận`})]})]})]})});exports.FormDialog=o;
1
+ const e=require(`../chunk-hhQzssFb.cjs`),t=require(`../utils-DaJ1XZgX.cjs`),n=require(`../button-CycE0WzB.cjs`),r=require(`../dialog-CH0Dihp0.cjs`);require(`../label-i858Jr98.cjs`),require(`../form-C_PCHrpx.cjs`),require(`../alert-dialog-D1DFrl-0.cjs`),require(`../error-dialog-BTjeT7x-.cjs`);const i=require(`../form-wrapper-CCqogufb.cjs`),a=e.__toESM(require(`react/jsx-runtime`)),o=({form:e,open:o,isSubmitting:s=!1,isResetAfterSubmit:c=!0,disableSubmit:l=!1,title:u,description:d,className:f,onOpenChange:p,onSubmit:m,onError:h,onReset:g,children:_})=>(0,a.jsx)(r.Dialog,{open:o,onOpenChange:p,children:(0,a.jsxs)(r.DialogContent,{className:t.cn(`flex flex-col gap-0 border-none p-0`,f),onInteractOutside:e=>{e.preventDefault(),e.stopPropagation()},children:[(0,a.jsxs)(r.DialogHeader,{className:`flex-0 gap-2 border-b px-6 pt-6 pb-4`,children:[(0,a.jsx)(r.DialogTitle,{children:u||`Form Dialog`}),(0,a.jsx)(r.DialogDescription,{children:d||`This is a form dialog where you can add your form elements.`})]}),(0,a.jsxs)(i.FormWrapper,{form:e,isResetAfterSubmit:c,className:`flex flex-1 flex-col overflow-y-auto pt-4`,onSubmit:m,onError:h,children:[(0,a.jsx)(`main`,{className:`flex-1 overflow-y-auto px-6`,children:_}),(0,a.jsxs)(r.DialogFooter,{className:`border-t px-6 pt-4 pb-6`,children:[(0,a.jsx)(n.Button,{tabIndex:-1,type:`button`,variant:`outline`,className:`w-30 rounded-full`,onClick:g,children:`Reset`}),(0,a.jsx)(n.Button,{autoFocus:!0,tabIndex:0,type:`submit`,isLoading:s,disabled:l,className:`w-30 rounded-full`,children:`Xác nhận`})]})]})]})});exports.FormDialog=o;
2
2
  //# sourceMappingURL=form-dialog.cjs.map
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime1 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime12 from "react/jsx-runtime";
2
2
  import { FieldValues, FormState, SubmitErrorHandler, UseFormProps } from "react-hook-form";
3
3
 
4
4
  //#region packages/components/dialogs/form-dialog.d.ts
@@ -30,7 +30,7 @@ declare const FormDialog: <TFieldValues extends FieldValues = FieldValues>({
30
30
  onError,
31
31
  onReset,
32
32
  children
33
- }: React.PropsWithChildren<Props<TFieldValues>>) => react_jsx_runtime1.JSX.Element;
33
+ }: React.PropsWithChildren<Props<TFieldValues>>) => react_jsx_runtime12.JSX.Element;
34
34
  //#endregion
35
35
  export { FormDialog };
36
36
  //# sourceMappingURL=form-dialog.d.cts.map
@@ -1,4 +1,4 @@
1
- import * as react_jsx_runtime2 from "react/jsx-runtime";
1
+ import * as react_jsx_runtime36 from "react/jsx-runtime";
2
2
  import { FieldValues, FormState, SubmitErrorHandler, UseFormProps } from "react-hook-form";
3
3
 
4
4
  //#region packages/components/dialogs/form-dialog.d.ts
@@ -30,7 +30,7 @@ declare const FormDialog: <TFieldValues extends FieldValues = FieldValues>({
30
30
  onError,
31
31
  onReset,
32
32
  children
33
- }: React.PropsWithChildren<Props<TFieldValues>>) => react_jsx_runtime2.JSX.Element;
33
+ }: React.PropsWithChildren<Props<TFieldValues>>) => react_jsx_runtime36.JSX.Element;
34
34
  //#endregion
35
35
  export { FormDialog };
36
36
  //# sourceMappingURL=form-dialog.d.ts.map
@@ -1,2 +1,2 @@
1
- import{cn as e}from"../utils-D9AH0PUV.js";import{Button as t}from"../button-Bku3bKv9.js";import"../alert-dialog-0KwdjY-6.js";import"../error-dialog-D_4WL-Hj.js";import"../label-Cxbctr6x.js";import"../form-CA4hhSV5.js";import{FormWrapper as n}from"../form-wrapper-D-2Uz518.js";import{Dialog as r,DialogContent as i,DialogDescription as a,DialogFooter as o,DialogHeader as s,DialogTitle as c}from"../dialog-Cs7JBaly.js";import{jsx as l,jsxs as u}from"react/jsx-runtime";const d=({form:d,open:f,isSubmitting:p=!1,isResetAfterSubmit:m=!0,disableSubmit:h=!1,title:g,description:_,className:v,onOpenChange:y,onSubmit:b,onError:x,onReset:S,children:C})=>l(r,{open:f,onOpenChange:y,children:u(i,{className:e(`flex flex-col gap-0 border-none p-0`,v),onInteractOutside:e=>{e.preventDefault(),e.stopPropagation()},children:[u(s,{className:`flex-0 gap-2 border-b px-6 pt-6 pb-4`,children:[l(c,{children:g||`Form Dialog`}),l(a,{children:_||`This is a form dialog where you can add your form elements.`})]}),u(n,{form:d,isResetAfterSubmit:m,className:`flex flex-1 flex-col overflow-y-auto pt-4`,onSubmit:b,onError:x,children:[l(`main`,{className:`flex-1 overflow-y-auto px-6`,children:C}),u(o,{className:`border-t px-6 pt-4 pb-6`,children:[l(t,{tabIndex:-1,type:`button`,variant:`outline`,className:`w-30 rounded-full`,onClick:S,children:`Reset`}),l(t,{autoFocus:!0,tabIndex:0,type:`submit`,isLoading:p,disabled:h,className:`w-30 rounded-full`,children:`Xác nhận`})]})]})]})});export{d as FormDialog};
1
+ import{cn as e}from"../utils-D9AH0PUV.js";import{Button as t}from"../button-Bku3bKv9.js";import{Dialog as n,DialogContent as r,DialogDescription as i,DialogFooter as a,DialogHeader as o,DialogTitle as s}from"../dialog-C0AcPpDH.js";import"../label-Cxbctr6x.js";import"../form-CA4hhSV5.js";import"../alert-dialog-CQa0TLlF.js";import"../error-dialog-DlhosP10.js";import{FormWrapper as c}from"../form-wrapper-YPIbD8rh.js";import{jsx as l,jsxs as u}from"react/jsx-runtime";const d=({form:d,open:f,isSubmitting:p=!1,isResetAfterSubmit:m=!0,disableSubmit:h=!1,title:g,description:_,className:v,onOpenChange:y,onSubmit:b,onError:x,onReset:S,children:C})=>l(n,{open:f,onOpenChange:y,children:u(r,{className:e(`flex flex-col gap-0 border-none p-0`,v),onInteractOutside:e=>{e.preventDefault(),e.stopPropagation()},children:[u(o,{className:`flex-0 gap-2 border-b px-6 pt-6 pb-4`,children:[l(s,{children:g||`Form Dialog`}),l(i,{children:_||`This is a form dialog where you can add your form elements.`})]}),u(c,{form:d,isResetAfterSubmit:m,className:`flex flex-1 flex-col overflow-y-auto pt-4`,onSubmit:b,onError:x,children:[l(`main`,{className:`flex-1 overflow-y-auto px-6`,children:C}),u(a,{className:`border-t px-6 pt-4 pb-6`,children:[l(t,{tabIndex:-1,type:`button`,variant:`outline`,className:`w-30 rounded-full`,onClick:S,children:`Reset`}),l(t,{autoFocus:!0,tabIndex:0,type:`submit`,isLoading:p,disabled:h,className:`w-30 rounded-full`,children:`Xác nhận`})]})]})]})});export{d as FormDialog};
2
2
  //# sourceMappingURL=form-dialog.js.map
@@ -1,2 +1,2 @@
1
- const e=require(`../chunk-hhQzssFb.cjs`);require(`../utils-DaJ1XZgX.cjs`);const t=require(`../dialog-CXZOtc6v.cjs`),n=e.__toESM(require(`react`)),r=e.__toESM(require(`react/jsx-runtime`)),i=({open:e,onOpenChange:n})=>(0,r.jsx)(t.Dialog,{open:e,onOpenChange:n,children:(0,r.jsxs)(t.DialogContent,{showCloseButton:!1,className:`pointer-events-none border-none bg-transparent shadow-none outline-0 [&>div]:bg-transparent`,children:[(0,r.jsx)(t.DialogTitle,{}),(0,r.jsx)(`div`,{className:`flex items-center justify-center`,children:(0,r.jsx)(`div`,{className:`loader opacity-60`})})]})});exports.LoadingDialog=i;
1
+ const e=require(`../chunk-hhQzssFb.cjs`);require(`../utils-DaJ1XZgX.cjs`);const t=require(`../dialog-CH0Dihp0.cjs`),n=e.__toESM(require(`react`)),r=e.__toESM(require(`react/jsx-runtime`)),i=({open:e,onOpenChange:n})=>(0,r.jsx)(t.Dialog,{open:e,onOpenChange:n,children:(0,r.jsxs)(t.DialogContent,{showCloseButton:!1,className:`pointer-events-none border-none bg-transparent shadow-none outline-0 [&>div]:bg-transparent`,children:[(0,r.jsx)(t.DialogTitle,{}),(0,r.jsx)(`div`,{className:`flex items-center justify-center`,children:(0,r.jsx)(`div`,{className:`loader opacity-60`})})]})});exports.LoadingDialog=i;
2
2
  //# sourceMappingURL=loading-dialog.cjs.map
@@ -1,2 +1,2 @@
1
- import"../utils-D9AH0PUV.js";import{Dialog as e,DialogContent as t,DialogTitle as n}from"../dialog-Cs7JBaly.js";import r from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";const o=({open:r,onOpenChange:o})=>i(e,{open:r,onOpenChange:o,children:a(t,{showCloseButton:!1,className:`pointer-events-none border-none bg-transparent shadow-none outline-0 [&>div]:bg-transparent`,children:[i(n,{}),i(`div`,{className:`flex items-center justify-center`,children:i(`div`,{className:`loader opacity-60`})})]})});export{o as LoadingDialog};
1
+ import"../utils-D9AH0PUV.js";import{Dialog as e,DialogContent as t,DialogTitle as n}from"../dialog-C0AcPpDH.js";import r from"react";import{jsx as i,jsxs as a}from"react/jsx-runtime";const o=({open:r,onOpenChange:o})=>i(e,{open:r,onOpenChange:o,children:a(t,{showCloseButton:!1,className:`pointer-events-none border-none bg-transparent shadow-none outline-0 [&>div]:bg-transparent`,children:[i(n,{}),i(`div`,{className:`flex items-center justify-center`,children:i(`div`,{className:`loader opacity-60`})})]})});export{o as LoadingDialog};
2
2
  //# sourceMappingURL=loading-dialog.js.map
@@ -1,2 +1,2 @@
1
- const e=require(`./chunk-hhQzssFb.cjs`),t=require(`./alert-dialog-BQv-ZvW9.cjs`),n=e.__toESM(require(`react`)),r=e.__toESM(require(`react/jsx-runtime`)),i=e.__toESM(require(`lucide-react`)),a=({open:e,title:a,children:o,onOpenChange:s})=>{let c=n.default.useCallback(()=>{s?.(!1)},[s]);return(0,r.jsx)(t.AlertDialog,{open:e,onOpenChange:s,children:(0,r.jsxs)(t.AlertDialogContent,{className:`gap-8 p-4 sm:max-w-md`,children:[(0,r.jsx)(t.AlertDialogHeader,{children:(0,r.jsxs)(`div`,{className:`text-destructive flex flex-col items-center`,children:[(0,r.jsx)(i.AlertTriangleIcon,{size:42}),(0,r.jsx)(t.AlertDialogTitle,{className:`text-xl font-medium`,children:a||`An error occurred`})]})}),o,(0,r.jsx)(t.AlertDialogFooter,{children:(0,r.jsx)(t.AlertDialogAction,{className:`w-28`,onClick:c,children:`Đóng`})})]})})};Object.defineProperty(exports,`ErrorDialog`,{enumerable:!0,get:function(){return a}});
2
- //# sourceMappingURL=error-dialog-DO0Bb-pi.cjs.map
1
+ const e=require(`./chunk-hhQzssFb.cjs`),t=require(`./alert-dialog-D1DFrl-0.cjs`),n=e.__toESM(require(`react`)),r=e.__toESM(require(`react/jsx-runtime`)),i=e.__toESM(require(`lucide-react`)),a=({open:e,title:a,children:o,onOpenChange:s})=>{let c=n.default.useCallback(()=>{s?.(!1)},[s]);return(0,r.jsx)(t.AlertDialog,{open:e,onOpenChange:s,children:(0,r.jsxs)(t.AlertDialogContent,{className:`gap-8 p-4 sm:max-w-md`,children:[(0,r.jsx)(t.AlertDialogHeader,{children:(0,r.jsxs)(`div`,{className:`text-destructive flex flex-col items-center`,children:[(0,r.jsx)(i.AlertTriangleIcon,{size:42}),(0,r.jsx)(t.AlertDialogTitle,{className:`text-xl font-medium`,children:a||`An error occurred`})]})}),o,(0,r.jsx)(t.AlertDialogFooter,{children:(0,r.jsx)(t.AlertDialogAction,{className:`w-28`,onClick:c,children:`Đóng`})})]})})};Object.defineProperty(exports,`ErrorDialog`,{enumerable:!0,get:function(){return a}});
2
+ //# sourceMappingURL=error-dialog-BTjeT7x-.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"error-dialog-DO0Bb-pi.cjs","names":["ErrorDialog: React.FC<React.PropsWithChildren<Props>>","React","AlertDialog","AlertDialogContent","AlertDialogHeader","AlertTriangleIcon","AlertDialogTitle","AlertDialogFooter","AlertDialogAction"],"sources":["../packages/components/dialogs/error-dialog.tsx"],"sourcesContent":["import React from \"react\";\nimport { AlertTriangleIcon } from \"lucide-react\";\n\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogContent,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n} from \"../ui/alert-dialog\";\n\ntype Props = {\n open?: boolean;\n title?: string;\n description?: string;\n onOpenChange?: (open: boolean) => void;\n};\nexport const ErrorDialog: React.FC<React.PropsWithChildren<Props>> = ({\n open,\n title,\n children,\n onOpenChange,\n}) => {\n const handleClose = React.useCallback(() => {\n onOpenChange?.(false);\n }, [onOpenChange]);\n return (\n <AlertDialog open={open} onOpenChange={onOpenChange}>\n <AlertDialogContent className=\"gap-8 p-4 sm:max-w-md\">\n <AlertDialogHeader>\n <div className=\"text-destructive flex flex-col items-center\">\n <AlertTriangleIcon size={42} />\n <AlertDialogTitle className=\"text-xl font-medium\">\n {title || \"An error occurred\"}\n </AlertDialogTitle>\n </div>\n </AlertDialogHeader>\n {children}\n <AlertDialogFooter>\n <AlertDialogAction className=\"w-28\" onClick={handleClose}>\n Đóng\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n );\n};\n"],"mappings":"8LAkBaA,GAAyD,CACpE,OACA,QACA,WACA,kBACI,CACJ,IAAM,EAAcC,EAAAA,QAAM,gBAAkB,CAC1C,IAAe,KACd,CAAC,IACJ,OACE,EAAA,EAAA,KAACC,EAAAA,YAAAA,CAAkB,OAAoB,yBACrC,EAAA,EAAA,MAACC,EAAAA,mBAAAA,CAAmB,UAAU,mCAC5B,EAAA,EAAA,KAACC,EAAAA,kBAAAA,CAAAA,UACC,EAAA,EAAA,MAAC,MAAA,CAAI,UAAU,yDACb,EAAA,EAAA,KAACC,EAAAA,kBAAAA,CAAkB,KAAM,MACzB,EAAA,EAAA,KAACC,EAAAA,iBAAAA,CAAiB,UAAU,+BACzB,GAAS,2BAIf,GACD,EAAA,EAAA,KAACC,EAAAA,kBAAAA,CAAAA,UACC,EAAA,EAAA,KAACC,EAAAA,kBAAAA,CAAkB,UAAU,OAAO,QAAS,WAAa"}
1
+ {"version":3,"file":"error-dialog-BTjeT7x-.cjs","names":["ErrorDialog: React.FC<React.PropsWithChildren<Props>>","React","AlertDialog","AlertDialogContent","AlertDialogHeader","AlertTriangleIcon","AlertDialogTitle","AlertDialogFooter","AlertDialogAction"],"sources":["../packages/components/dialogs/error-dialog.tsx"],"sourcesContent":["import React from \"react\";\nimport { AlertTriangleIcon } from \"lucide-react\";\n\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogContent,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n} from \"../ui/alert-dialog\";\n\ntype Props = {\n open?: boolean;\n title?: string;\n description?: string;\n onOpenChange?: (open: boolean) => void;\n};\nexport const ErrorDialog: React.FC<React.PropsWithChildren<Props>> = ({\n open,\n title,\n children,\n onOpenChange,\n}) => {\n const handleClose = React.useCallback(() => {\n onOpenChange?.(false);\n }, [onOpenChange]);\n return (\n <AlertDialog open={open} onOpenChange={onOpenChange}>\n <AlertDialogContent className=\"gap-8 p-4 sm:max-w-md\">\n <AlertDialogHeader>\n <div className=\"text-destructive flex flex-col items-center\">\n <AlertTriangleIcon size={42} />\n <AlertDialogTitle className=\"text-xl font-medium\">\n {title || \"An error occurred\"}\n </AlertDialogTitle>\n </div>\n </AlertDialogHeader>\n {children}\n <AlertDialogFooter>\n <AlertDialogAction className=\"w-28\" onClick={handleClose}>\n Đóng\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n );\n};\n"],"mappings":"8LAkBaA,GAAyD,CACpE,OACA,QACA,WACA,kBACI,CACJ,IAAM,EAAcC,EAAAA,QAAM,gBAAkB,CAC1C,IAAe,KACd,CAAC,IACJ,OACE,EAAA,EAAA,KAACC,EAAAA,YAAAA,CAAkB,OAAoB,yBACrC,EAAA,EAAA,MAACC,EAAAA,mBAAAA,CAAmB,UAAU,mCAC5B,EAAA,EAAA,KAACC,EAAAA,kBAAAA,CAAAA,UACC,EAAA,EAAA,MAAC,MAAA,CAAI,UAAU,yDACb,EAAA,EAAA,KAACC,EAAAA,kBAAAA,CAAkB,KAAM,MACzB,EAAA,EAAA,KAACC,EAAAA,iBAAAA,CAAiB,UAAU,+BACzB,GAAS,2BAIf,GACD,EAAA,EAAA,KAACC,EAAAA,kBAAAA,CAAAA,UACC,EAAA,EAAA,KAACC,EAAAA,kBAAAA,CAAkB,UAAU,OAAO,QAAS,WAAa"}
@@ -1,2 +1,2 @@
1
- import{AlertDialog as e,AlertDialogAction as t,AlertDialogContent as n,AlertDialogFooter as r,AlertDialogHeader as i,AlertDialogTitle as a}from"./alert-dialog-0KwdjY-6.js";import o from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import{AlertTriangleIcon as l}from"lucide-react";const u=({open:u,title:d,children:f,onOpenChange:p})=>{let m=o.useCallback(()=>{p?.(!1)},[p]);return s(e,{open:u,onOpenChange:p,children:c(n,{className:`gap-8 p-4 sm:max-w-md`,children:[s(i,{children:c(`div`,{className:`text-destructive flex flex-col items-center`,children:[s(l,{size:42}),s(a,{className:`text-xl font-medium`,children:d||`An error occurred`})]})}),f,s(r,{children:s(t,{className:`w-28`,onClick:m,children:`Đóng`})})]})})};export{u as ErrorDialog};
2
- //# sourceMappingURL=error-dialog-D_4WL-Hj.js.map
1
+ import{AlertDialog as e,AlertDialogAction as t,AlertDialogContent as n,AlertDialogFooter as r,AlertDialogHeader as i,AlertDialogTitle as a}from"./alert-dialog-CQa0TLlF.js";import o from"react";import{jsx as s,jsxs as c}from"react/jsx-runtime";import{AlertTriangleIcon as l}from"lucide-react";const u=({open:u,title:d,children:f,onOpenChange:p})=>{let m=o.useCallback(()=>{p?.(!1)},[p]);return s(e,{open:u,onOpenChange:p,children:c(n,{className:`gap-8 p-4 sm:max-w-md`,children:[s(i,{children:c(`div`,{className:`text-destructive flex flex-col items-center`,children:[s(l,{size:42}),s(a,{className:`text-xl font-medium`,children:d||`An error occurred`})]})}),f,s(r,{children:s(t,{className:`w-28`,onClick:m,children:`Đóng`})})]})})};export{u as ErrorDialog};
2
+ //# sourceMappingURL=error-dialog-DlhosP10.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"error-dialog-D_4WL-Hj.js","names":["ErrorDialog: React.FC<React.PropsWithChildren<Props>>"],"sources":["../packages/components/dialogs/error-dialog.tsx"],"sourcesContent":["import React from \"react\";\nimport { AlertTriangleIcon } from \"lucide-react\";\n\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogContent,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n} from \"../ui/alert-dialog\";\n\ntype Props = {\n open?: boolean;\n title?: string;\n description?: string;\n onOpenChange?: (open: boolean) => void;\n};\nexport const ErrorDialog: React.FC<React.PropsWithChildren<Props>> = ({\n open,\n title,\n children,\n onOpenChange,\n}) => {\n const handleClose = React.useCallback(() => {\n onOpenChange?.(false);\n }, [onOpenChange]);\n return (\n <AlertDialog open={open} onOpenChange={onOpenChange}>\n <AlertDialogContent className=\"gap-8 p-4 sm:max-w-md\">\n <AlertDialogHeader>\n <div className=\"text-destructive flex flex-col items-center\">\n <AlertTriangleIcon size={42} />\n <AlertDialogTitle className=\"text-xl font-medium\">\n {title || \"An error occurred\"}\n </AlertDialogTitle>\n </div>\n </AlertDialogHeader>\n {children}\n <AlertDialogFooter>\n <AlertDialogAction className=\"w-28\" onClick={handleClose}>\n Đóng\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n );\n};\n"],"mappings":"oSAkBA,MAAaA,GAAyD,CACpE,OACA,QACA,WACA,kBACI,CACJ,IAAM,EAAc,EAAM,gBAAkB,CAC1C,IAAe,KACd,CAAC,IACJ,OACE,EAAC,EAAA,CAAkB,OAAoB,wBACrC,EAAC,EAAA,CAAmB,UAAU,kCAC5B,EAAC,EAAA,CAAA,SACC,EAAC,MAAA,CAAI,UAAU,wDACb,EAAC,EAAA,CAAkB,KAAM,KACzB,EAAC,EAAA,CAAiB,UAAU,+BACzB,GAAS,2BAIf,EACD,EAAC,EAAA,CAAA,SACC,EAAC,EAAA,CAAkB,UAAU,OAAO,QAAS,WAAa"}
1
+ {"version":3,"file":"error-dialog-DlhosP10.js","names":["ErrorDialog: React.FC<React.PropsWithChildren<Props>>"],"sources":["../packages/components/dialogs/error-dialog.tsx"],"sourcesContent":["import React from \"react\";\nimport { AlertTriangleIcon } from \"lucide-react\";\n\nimport {\n AlertDialog,\n AlertDialogAction,\n AlertDialogContent,\n AlertDialogFooter,\n AlertDialogHeader,\n AlertDialogTitle,\n} from \"../ui/alert-dialog\";\n\ntype Props = {\n open?: boolean;\n title?: string;\n description?: string;\n onOpenChange?: (open: boolean) => void;\n};\nexport const ErrorDialog: React.FC<React.PropsWithChildren<Props>> = ({\n open,\n title,\n children,\n onOpenChange,\n}) => {\n const handleClose = React.useCallback(() => {\n onOpenChange?.(false);\n }, [onOpenChange]);\n return (\n <AlertDialog open={open} onOpenChange={onOpenChange}>\n <AlertDialogContent className=\"gap-8 p-4 sm:max-w-md\">\n <AlertDialogHeader>\n <div className=\"text-destructive flex flex-col items-center\">\n <AlertTriangleIcon size={42} />\n <AlertDialogTitle className=\"text-xl font-medium\">\n {title || \"An error occurred\"}\n </AlertDialogTitle>\n </div>\n </AlertDialogHeader>\n {children}\n <AlertDialogFooter>\n <AlertDialogAction className=\"w-28\" onClick={handleClose}>\n Đóng\n </AlertDialogAction>\n </AlertDialogFooter>\n </AlertDialogContent>\n </AlertDialog>\n );\n};\n"],"mappings":"oSAkBA,MAAaA,GAAyD,CACpE,OACA,QACA,WACA,kBACI,CACJ,IAAM,EAAc,EAAM,gBAAkB,CAC1C,IAAe,KACd,CAAC,IACJ,OACE,EAAC,EAAA,CAAkB,OAAoB,wBACrC,EAAC,EAAA,CAAmB,UAAU,kCAC5B,EAAC,EAAA,CAAA,SACC,EAAC,MAAA,CAAI,UAAU,wDACb,EAAC,EAAA,CAAkB,KAAM,KACzB,EAAC,EAAA,CAAiB,UAAU,+BACzB,GAAS,2BAIf,EACD,EAAC,EAAA,CAAA,SACC,EAAC,EAAA,CAAkB,UAAU,OAAO,QAAS,WAAa"}
@@ -1,2 +1,2 @@
1
- const e=require(`./chunk-hhQzssFb.cjs`),t=require(`./error-dialog-DO0Bb-pi.cjs`),n=require(`./form-C_PCHrpx.cjs`),r=e.__toESM(require(`react`)),i=e.__toESM(require(`react/jsx-runtime`)),a=e.__toESM(require(`lucide-react`)),o=e.__toESM(require(`react-hook-form`)),s=e.__toESM(require(`@hookform/error-message`)),c=({form:e,isResetAfterSubmit:c=!0,className:l,onSubmit:u,onError:d,onSubcribe:f,children:p})=>{let m=(0,o.useForm)({...e,criteriaMode:`all`}),{formState:h,reset:g,handleSubmit:_,subscribe:v}=m,{dirtyFields:y}=h,[b,x]=r.default.useState(!1),S=r.default.useCallback(e=>{u(e,h,y),c&&g()},[y,h,c,u,g]),C=r.default.useCallback(e=>{let t=Object.keys(e);t.length!==0&&(d?.(e),x(!0))},[d]);return r.default.useEffect(()=>{if(!f)return;let e=v({formState:{values:!0},callback:({values:e})=>{f(e)}});return()=>e()},[f,v]),(0,i.jsxs)(n.Form,{...m,children:[(0,i.jsx)(`form`,{className:l,onSubmit:_(S,C),children:p}),(0,i.jsx)(t.ErrorDialog,{open:b,title:`Lỗi nhập dữ liệu`,description:`An unexpected error has occurred. Please check the errors below and try again.`,onOpenChange:x,children:b&&(0,i.jsx)(i.Fragment,{children:Object.keys(h.errors).length>0?(0,i.jsxs)(`div`,{className:`flex max-w-100 flex-col gap-2 px-4`,children:[(0,i.jsx)(`p`,{className:`text-muted-foreground text-sm font-semibold`,children:`Cảnh báo: Vui lòng kiểm tra các lỗi sau:`}),(0,i.jsx)(`div`,{className:`flex flex-col space-y-1`,children:Object.entries(h.errors).map(([e])=>(0,i.jsx)(s.ErrorMessage,{errors:h.errors,name:e,render:({messages:e})=>(0,i.jsx)(i.Fragment,{children:e?Object.entries(e).map(([e,t])=>(0,i.jsxs)(`div`,{className:`text-accent-foreground flex items-start gap-x-1 truncate text-sm font-normal`,children:[(0,i.jsx)(a.AlertCircleIcon,{size:16,className:`text-destructive mt-0.5 min-w-4 flex-0`}),(0,i.jsx)(`p`,{className:`line-clamp-2 flex-1 text-wrap`,children:t})]},e)):null})},e))})]}):(0,i.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`No errors found.`})})})]})};Object.defineProperty(exports,`FormWrapper`,{enumerable:!0,get:function(){return c}});
2
- //# sourceMappingURL=form-wrapper-FYiHHas7.cjs.map
1
+ const e=require(`./chunk-hhQzssFb.cjs`),t=require(`./form-C_PCHrpx.cjs`),n=require(`./error-dialog-BTjeT7x-.cjs`),r=e.__toESM(require(`react`)),i=e.__toESM(require(`react/jsx-runtime`)),a=e.__toESM(require(`lucide-react`)),o=e.__toESM(require(`react-hook-form`)),s=e.__toESM(require(`@hookform/error-message`)),c=({form:e,isResetAfterSubmit:c=!0,className:l,onSubmit:u,onError:d,onSubcribe:f,children:p})=>{let m=(0,o.useForm)({...e,criteriaMode:`all`}),{formState:h,reset:g,handleSubmit:_,subscribe:v}=m,{dirtyFields:y}=h,[b,x]=r.default.useState(!1),S=r.default.useCallback(e=>{u(e,h,y),c&&g()},[y,h,c,u,g]),C=r.default.useCallback(e=>{let t=Object.keys(e);t.length!==0&&(d?.(e),x(!0))},[d]);return r.default.useEffect(()=>{if(!f)return;let e=v({formState:{values:!0},callback:({values:e})=>{f(e)}});return()=>e()},[f,v]),(0,i.jsxs)(t.Form,{...m,children:[(0,i.jsx)(`form`,{className:l,onSubmit:_(S,C),children:p}),(0,i.jsx)(n.ErrorDialog,{open:b,title:`Lỗi nhập dữ liệu`,description:`An unexpected error has occurred. Please check the errors below and try again.`,onOpenChange:x,children:b&&(0,i.jsx)(i.Fragment,{children:Object.keys(h.errors).length>0?(0,i.jsxs)(`div`,{className:`flex max-w-100 flex-col gap-2 px-4`,children:[(0,i.jsx)(`p`,{className:`text-muted-foreground text-sm font-semibold`,children:`Cảnh báo: Vui lòng kiểm tra các lỗi sau:`}),(0,i.jsx)(`div`,{className:`flex flex-col space-y-1`,children:Object.entries(h.errors).map(([e])=>(0,i.jsx)(s.ErrorMessage,{errors:h.errors,name:e,render:({messages:e})=>(0,i.jsx)(i.Fragment,{children:e?Object.entries(e).map(([e,t])=>(0,i.jsxs)(`div`,{className:`text-accent-foreground flex items-start gap-x-1 truncate text-sm font-normal`,children:[(0,i.jsx)(a.AlertCircleIcon,{size:16,className:`text-destructive mt-0.5 min-w-4 flex-0`}),(0,i.jsx)(`p`,{className:`line-clamp-2 flex-1 text-wrap`,children:t})]},e)):null})},e))})]}):(0,i.jsx)(`p`,{className:`text-muted-foreground text-sm`,children:`No errors found.`})})})]})};Object.defineProperty(exports,`FormWrapper`,{enumerable:!0,get:function(){return c}});
2
+ //# sourceMappingURL=form-wrapper-CCqogufb.cjs.map
@@ -1 +1 @@
1
- {"version":3,"file":"form-wrapper-FYiHHas7.cjs","names":["React","Form","ErrorDialog","ErrorMessage","AlertCircleIcon"],"sources":["../packages/components/forms/form-wrapper.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n type FieldValues,\n type FormState,\n type SubmitErrorHandler,\n type SubmitHandler,\n useForm,\n type UseFormProps,\n} from \"react-hook-form\";\nimport { AlertCircleIcon } from \"lucide-react\";\n\nimport type { AnyEntity } from \"@/types\";\nimport { ErrorMessage } from \"@hookform/error-message\";\n\nimport { ErrorDialog } from \"../dialogs/error-dialog\";\nimport { Form } from \"../ui/form\";\n\ntype Props<TFieldValues extends FieldValues = FieldValues> = {\n form: UseFormProps<TFieldValues>;\n isResetAfterSubmit?: boolean;\n className?: string;\n onSubmit: (\n data: TFieldValues,\n formState: FormState<FieldValues>,\n dirtyFields: FormState<FieldValues>[\"dirtyFields\"],\n ) => void | Promise<void>;\n onError?: SubmitErrorHandler<TFieldValues>;\n onSubcribe?: (values: TFieldValues) => void;\n};\n\nexport const FormWrapper = <TFieldValues extends FieldValues = FieldValues>({\n form: FormConfig,\n isResetAfterSubmit = true,\n className,\n onSubmit,\n onError,\n onSubcribe,\n children,\n}: React.PropsWithChildren<Props<TFieldValues>>) => {\n const form = useForm({\n ...FormConfig,\n criteriaMode: \"all\",\n });\n\n const { formState, reset, handleSubmit, subscribe } = form;\n const { dirtyFields } = formState;\n\n const [errorOpen, setErrorOpen] = React.useState<boolean>(false);\n\n const handleFormSubmit = React.useCallback<SubmitHandler<TFieldValues>>(\n (data) => {\n onSubmit(data, formState, dirtyFields);\n if (isResetAfterSubmit) {\n reset();\n }\n },\n [dirtyFields, formState, isResetAfterSubmit, onSubmit, reset],\n );\n\n const handleFormError = React.useCallback<SubmitErrorHandler<TFieldValues>>(\n (errors) => {\n const errorKeys = Object.keys(errors);\n if (errorKeys.length === 0) return;\n onError?.(errors);\n setErrorOpen(true);\n },\n [onError],\n );\n\n React.useEffect(() => {\n if (!onSubcribe) return;\n const callback = subscribe({\n formState: { values: true },\n callback: ({ values }) => {\n onSubcribe(values);\n },\n });\n return () => callback();\n }, [onSubcribe, subscribe]);\n\n return (\n <Form {...form}>\n <form\n className={className}\n onSubmit={handleSubmit(handleFormSubmit, handleFormError)}\n >\n {children}\n </form>\n <ErrorDialog\n open={errorOpen}\n title=\"Lỗi nhập dữ liệu\"\n description=\"An unexpected error has occurred. Please check the errors below and try again.\"\n onOpenChange={setErrorOpen}\n >\n {errorOpen && (\n <>\n {Object.keys(formState.errors).length > 0 ? (\n <div className=\"flex max-w-100 flex-col gap-2 px-4\">\n <p className=\"text-muted-foreground text-sm font-semibold\">\n Cảnh báo: Vui lòng kiểm tra các lỗi sau:\n </p>\n <div className=\"flex flex-col space-y-1\">\n {Object.entries(formState.errors).map(([key]) => (\n <ErrorMessage\n key={key}\n errors={formState.errors}\n name={key as AnyEntity}\n render={({ messages }) => {\n return (\n <>\n {messages\n ? Object.entries(messages).map(\n ([type, message]) => {\n return (\n <div\n key={type}\n className=\"text-accent-foreground flex items-start gap-x-1 truncate text-sm font-normal\"\n >\n <AlertCircleIcon\n size={16}\n className=\"text-destructive mt-0.5 min-w-4 flex-0\"\n />\n <p className=\"line-clamp-2 flex-1 text-wrap\">\n {message}\n </p>\n </div>\n );\n },\n )\n : null}\n </>\n );\n }}\n />\n ))}\n </div>\n </div>\n ) : (\n <p className=\"text-muted-foreground text-sm\">No errors found.</p>\n )}\n </>\n )}\n </ErrorDialog>\n </Form>\n );\n};\n"],"mappings":"uTA8Ba,GAA+D,CAC1E,KAAM,EACN,qBAAqB,GACrB,YACA,WACA,UACA,aACA,cACkD,CAClD,IAAM,GAAA,EAAA,EAAA,SAAe,CACnB,GAAG,EACH,aAAc,QAGV,CAAE,YAAW,QAAO,eAAc,aAAc,EAChD,CAAE,eAAgB,EAElB,CAAC,EAAW,GAAgBA,EAAAA,QAAM,SAAkB,IAEpD,EAAmBA,EAAAA,QAAM,YAC5B,GAAS,CACR,EAAS,EAAM,EAAW,GACtB,GACF,KAGJ,CAAC,EAAa,EAAW,EAAoB,EAAU,IAGnD,EAAkBA,EAAAA,QAAM,YAC3B,GAAW,CACV,IAAM,EAAY,OAAO,KAAK,GAC1B,EAAU,SAAW,IACzB,IAAU,GACV,EAAa,MAEf,CAAC,IAcH,OAXA,EAAA,QAAM,cAAgB,CACpB,GAAI,CAAC,EAAY,OACjB,IAAM,EAAW,EAAU,CACzB,UAAW,CAAE,OAAQ,IACrB,UAAW,CAAE,YAAa,CACxB,EAAW,MAGf,UAAa,KACZ,CAAC,EAAY,KAGd,EAAA,EAAA,MAACC,EAAAA,KAAAA,CAAK,GAAI,aACR,EAAA,EAAA,KAAC,OAAA,CACY,YACX,SAAU,EAAa,EAAkB,GAExC,cAEH,EAAA,EAAA,KAACC,EAAAA,YAAAA,CACC,KAAM,EACN,MAAM,mBACN,YAAY,iFACZ,aAAc,WAEb,IACC,EAAA,EAAA,KAAA,EAAA,SAAA,CAAA,SACG,OAAO,KAAK,EAAU,QAAQ,OAAS,GACtC,EAAA,EAAA,MAAC,MAAA,CAAI,UAAU,gDACb,EAAA,EAAA,KAAC,IAAA,CAAE,UAAU,uDAA8C,8CAG3D,EAAA,EAAA,KAAC,MAAA,CAAI,UAAU,mCACZ,OAAO,QAAQ,EAAU,QAAQ,KAAK,CAAC,MACtC,EAAA,EAAA,KAACC,EAAAA,aAAAA,CAEC,OAAQ,EAAU,OAClB,KAAM,EACN,QAAS,CAAE,eAEP,EAAA,EAAA,KAAA,EAAA,SAAA,CAAA,SACG,EACG,OAAO,QAAQ,GAAU,KACtB,CAAC,EAAM,MAEJ,EAAA,EAAA,MAAC,MAAA,CAEC,UAAU,0FAEV,EAAA,EAAA,KAACC,EAAAA,gBAAAA,CACC,KAAM,GACN,UAAU,4CAEZ,EAAA,EAAA,KAAC,IAAA,CAAE,UAAU,yCACV,MARE,IAcb,QAzBL,UAkCb,EAAA,EAAA,KAAC,IAAA,CAAE,UAAU,yCAAgC"}
1
+ {"version":3,"file":"form-wrapper-CCqogufb.cjs","names":["React","Form","ErrorDialog","ErrorMessage","AlertCircleIcon"],"sources":["../packages/components/forms/form-wrapper.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n type FieldValues,\n type FormState,\n type SubmitErrorHandler,\n type SubmitHandler,\n useForm,\n type UseFormProps,\n} from \"react-hook-form\";\nimport { AlertCircleIcon } from \"lucide-react\";\n\nimport type { AnyEntity } from \"@/types\";\nimport { ErrorMessage } from \"@hookform/error-message\";\n\nimport { ErrorDialog } from \"../dialogs/error-dialog\";\nimport { Form } from \"../ui/form\";\n\ntype Props<TFieldValues extends FieldValues = FieldValues> = {\n form: UseFormProps<TFieldValues>;\n isResetAfterSubmit?: boolean;\n className?: string;\n onSubmit: (\n data: TFieldValues,\n formState: FormState<FieldValues>,\n dirtyFields: FormState<FieldValues>[\"dirtyFields\"],\n ) => void | Promise<void>;\n onError?: SubmitErrorHandler<TFieldValues>;\n onSubcribe?: (values: TFieldValues) => void;\n};\n\nexport const FormWrapper = <TFieldValues extends FieldValues = FieldValues>({\n form: FormConfig,\n isResetAfterSubmit = true,\n className,\n onSubmit,\n onError,\n onSubcribe,\n children,\n}: React.PropsWithChildren<Props<TFieldValues>>) => {\n const form = useForm({\n ...FormConfig,\n criteriaMode: \"all\",\n });\n\n const { formState, reset, handleSubmit, subscribe } = form;\n const { dirtyFields } = formState;\n\n const [errorOpen, setErrorOpen] = React.useState<boolean>(false);\n\n const handleFormSubmit = React.useCallback<SubmitHandler<TFieldValues>>(\n (data) => {\n onSubmit(data, formState, dirtyFields);\n if (isResetAfterSubmit) {\n reset();\n }\n },\n [dirtyFields, formState, isResetAfterSubmit, onSubmit, reset],\n );\n\n const handleFormError = React.useCallback<SubmitErrorHandler<TFieldValues>>(\n (errors) => {\n const errorKeys = Object.keys(errors);\n if (errorKeys.length === 0) return;\n onError?.(errors);\n setErrorOpen(true);\n },\n [onError],\n );\n\n React.useEffect(() => {\n if (!onSubcribe) return;\n const callback = subscribe({\n formState: { values: true },\n callback: ({ values }) => {\n onSubcribe(values);\n },\n });\n return () => callback();\n }, [onSubcribe, subscribe]);\n\n return (\n <Form {...form}>\n <form\n className={className}\n onSubmit={handleSubmit(handleFormSubmit, handleFormError)}\n >\n {children}\n </form>\n <ErrorDialog\n open={errorOpen}\n title=\"Lỗi nhập dữ liệu\"\n description=\"An unexpected error has occurred. Please check the errors below and try again.\"\n onOpenChange={setErrorOpen}\n >\n {errorOpen && (\n <>\n {Object.keys(formState.errors).length > 0 ? (\n <div className=\"flex max-w-100 flex-col gap-2 px-4\">\n <p className=\"text-muted-foreground text-sm font-semibold\">\n Cảnh báo: Vui lòng kiểm tra các lỗi sau:\n </p>\n <div className=\"flex flex-col space-y-1\">\n {Object.entries(formState.errors).map(([key]) => (\n <ErrorMessage\n key={key}\n errors={formState.errors}\n name={key as AnyEntity}\n render={({ messages }) => {\n return (\n <>\n {messages\n ? Object.entries(messages).map(\n ([type, message]) => {\n return (\n <div\n key={type}\n className=\"text-accent-foreground flex items-start gap-x-1 truncate text-sm font-normal\"\n >\n <AlertCircleIcon\n size={16}\n className=\"text-destructive mt-0.5 min-w-4 flex-0\"\n />\n <p className=\"line-clamp-2 flex-1 text-wrap\">\n {message}\n </p>\n </div>\n );\n },\n )\n : null}\n </>\n );\n }}\n />\n ))}\n </div>\n </div>\n ) : (\n <p className=\"text-muted-foreground text-sm\">No errors found.</p>\n )}\n </>\n )}\n </ErrorDialog>\n </Form>\n );\n};\n"],"mappings":"uTA8Ba,GAA+D,CAC1E,KAAM,EACN,qBAAqB,GACrB,YACA,WACA,UACA,aACA,cACkD,CAClD,IAAM,GAAA,EAAA,EAAA,SAAe,CACnB,GAAG,EACH,aAAc,QAGV,CAAE,YAAW,QAAO,eAAc,aAAc,EAChD,CAAE,eAAgB,EAElB,CAAC,EAAW,GAAgBA,EAAAA,QAAM,SAAkB,IAEpD,EAAmBA,EAAAA,QAAM,YAC5B,GAAS,CACR,EAAS,EAAM,EAAW,GACtB,GACF,KAGJ,CAAC,EAAa,EAAW,EAAoB,EAAU,IAGnD,EAAkBA,EAAAA,QAAM,YAC3B,GAAW,CACV,IAAM,EAAY,OAAO,KAAK,GAC1B,EAAU,SAAW,IACzB,IAAU,GACV,EAAa,MAEf,CAAC,IAcH,OAXA,EAAA,QAAM,cAAgB,CACpB,GAAI,CAAC,EAAY,OACjB,IAAM,EAAW,EAAU,CACzB,UAAW,CAAE,OAAQ,IACrB,UAAW,CAAE,YAAa,CACxB,EAAW,MAGf,UAAa,KACZ,CAAC,EAAY,KAGd,EAAA,EAAA,MAACC,EAAAA,KAAAA,CAAK,GAAI,aACR,EAAA,EAAA,KAAC,OAAA,CACY,YACX,SAAU,EAAa,EAAkB,GAExC,cAEH,EAAA,EAAA,KAACC,EAAAA,YAAAA,CACC,KAAM,EACN,MAAM,mBACN,YAAY,iFACZ,aAAc,WAEb,IACC,EAAA,EAAA,KAAA,EAAA,SAAA,CAAA,SACG,OAAO,KAAK,EAAU,QAAQ,OAAS,GACtC,EAAA,EAAA,MAAC,MAAA,CAAI,UAAU,gDACb,EAAA,EAAA,KAAC,IAAA,CAAE,UAAU,uDAA8C,8CAG3D,EAAA,EAAA,KAAC,MAAA,CAAI,UAAU,mCACZ,OAAO,QAAQ,EAAU,QAAQ,KAAK,CAAC,MACtC,EAAA,EAAA,KAACC,EAAAA,aAAAA,CAEC,OAAQ,EAAU,OAClB,KAAM,EACN,QAAS,CAAE,eAEP,EAAA,EAAA,KAAA,EAAA,SAAA,CAAA,SACG,EACG,OAAO,QAAQ,GAAU,KACtB,CAAC,EAAM,MAEJ,EAAA,EAAA,MAAC,MAAA,CAEC,UAAU,0FAEV,EAAA,EAAA,KAACC,EAAAA,gBAAAA,CACC,KAAM,GACN,UAAU,4CAEZ,EAAA,EAAA,KAAC,IAAA,CAAE,UAAU,yCACV,MARE,IAcb,QAzBL,UAkCb,EAAA,EAAA,KAAC,IAAA,CAAE,UAAU,yCAAgC"}
@@ -1,2 +1,2 @@
1
- import{ErrorDialog as e}from"./error-dialog-D_4WL-Hj.js";import{Form as t}from"./form-CA4hhSV5.js";import n from"react";import{Fragment as r,jsx as i,jsxs as a}from"react/jsx-runtime";import{AlertCircleIcon as o}from"lucide-react";import{useForm as s}from"react-hook-form";import{ErrorMessage as c}from"@hookform/error-message";const l=({form:l,isResetAfterSubmit:u=!0,className:d,onSubmit:f,onError:p,onSubcribe:m,children:h})=>{let g=s({...l,criteriaMode:`all`}),{formState:_,reset:v,handleSubmit:y,subscribe:b}=g,{dirtyFields:x}=_,[S,C]=n.useState(!1),w=n.useCallback(e=>{f(e,_,x),u&&v()},[x,_,u,f,v]),T=n.useCallback(e=>{let t=Object.keys(e);t.length!==0&&(p?.(e),C(!0))},[p]);return n.useEffect(()=>{if(!m)return;let e=b({formState:{values:!0},callback:({values:e})=>{m(e)}});return()=>e()},[m,b]),a(t,{...g,children:[i(`form`,{className:d,onSubmit:y(w,T),children:h}),i(e,{open:S,title:`Lỗi nhập dữ liệu`,description:`An unexpected error has occurred. Please check the errors below and try again.`,onOpenChange:C,children:S&&i(r,{children:Object.keys(_.errors).length>0?a(`div`,{className:`flex max-w-100 flex-col gap-2 px-4`,children:[i(`p`,{className:`text-muted-foreground text-sm font-semibold`,children:`Cảnh báo: Vui lòng kiểm tra các lỗi sau:`}),i(`div`,{className:`flex flex-col space-y-1`,children:Object.entries(_.errors).map(([e])=>i(c,{errors:_.errors,name:e,render:({messages:e})=>i(r,{children:e?Object.entries(e).map(([e,t])=>a(`div`,{className:`text-accent-foreground flex items-start gap-x-1 truncate text-sm font-normal`,children:[i(o,{size:16,className:`text-destructive mt-0.5 min-w-4 flex-0`}),i(`p`,{className:`line-clamp-2 flex-1 text-wrap`,children:t})]},e)):null})},e))})]}):i(`p`,{className:`text-muted-foreground text-sm`,children:`No errors found.`})})})]})};export{l as FormWrapper};
2
- //# sourceMappingURL=form-wrapper-D-2Uz518.js.map
1
+ import{Form as e}from"./form-CA4hhSV5.js";import{ErrorDialog as t}from"./error-dialog-DlhosP10.js";import n from"react";import{Fragment as r,jsx as i,jsxs as a}from"react/jsx-runtime";import{AlertCircleIcon as o}from"lucide-react";import{useForm as s}from"react-hook-form";import{ErrorMessage as c}from"@hookform/error-message";const l=({form:l,isResetAfterSubmit:u=!0,className:d,onSubmit:f,onError:p,onSubcribe:m,children:h})=>{let g=s({...l,criteriaMode:`all`}),{formState:_,reset:v,handleSubmit:y,subscribe:b}=g,{dirtyFields:x}=_,[S,C]=n.useState(!1),w=n.useCallback(e=>{f(e,_,x),u&&v()},[x,_,u,f,v]),T=n.useCallback(e=>{let t=Object.keys(e);t.length!==0&&(p?.(e),C(!0))},[p]);return n.useEffect(()=>{if(!m)return;let e=b({formState:{values:!0},callback:({values:e})=>{m(e)}});return()=>e()},[m,b]),a(e,{...g,children:[i(`form`,{className:d,onSubmit:y(w,T),children:h}),i(t,{open:S,title:`Lỗi nhập dữ liệu`,description:`An unexpected error has occurred. Please check the errors below and try again.`,onOpenChange:C,children:S&&i(r,{children:Object.keys(_.errors).length>0?a(`div`,{className:`flex max-w-100 flex-col gap-2 px-4`,children:[i(`p`,{className:`text-muted-foreground text-sm font-semibold`,children:`Cảnh báo: Vui lòng kiểm tra các lỗi sau:`}),i(`div`,{className:`flex flex-col space-y-1`,children:Object.entries(_.errors).map(([e])=>i(c,{errors:_.errors,name:e,render:({messages:e})=>i(r,{children:e?Object.entries(e).map(([e,t])=>a(`div`,{className:`text-accent-foreground flex items-start gap-x-1 truncate text-sm font-normal`,children:[i(o,{size:16,className:`text-destructive mt-0.5 min-w-4 flex-0`}),i(`p`,{className:`line-clamp-2 flex-1 text-wrap`,children:t})]},e)):null})},e))})]}):i(`p`,{className:`text-muted-foreground text-sm`,children:`No errors found.`})})})]})};export{l as FormWrapper};
2
+ //# sourceMappingURL=form-wrapper-YPIbD8rh.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"form-wrapper-D-2Uz518.js","names":[],"sources":["../packages/components/forms/form-wrapper.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n type FieldValues,\n type FormState,\n type SubmitErrorHandler,\n type SubmitHandler,\n useForm,\n type UseFormProps,\n} from \"react-hook-form\";\nimport { AlertCircleIcon } from \"lucide-react\";\n\nimport type { AnyEntity } from \"@/types\";\nimport { ErrorMessage } from \"@hookform/error-message\";\n\nimport { ErrorDialog } from \"../dialogs/error-dialog\";\nimport { Form } from \"../ui/form\";\n\ntype Props<TFieldValues extends FieldValues = FieldValues> = {\n form: UseFormProps<TFieldValues>;\n isResetAfterSubmit?: boolean;\n className?: string;\n onSubmit: (\n data: TFieldValues,\n formState: FormState<FieldValues>,\n dirtyFields: FormState<FieldValues>[\"dirtyFields\"],\n ) => void | Promise<void>;\n onError?: SubmitErrorHandler<TFieldValues>;\n onSubcribe?: (values: TFieldValues) => void;\n};\n\nexport const FormWrapper = <TFieldValues extends FieldValues = FieldValues>({\n form: FormConfig,\n isResetAfterSubmit = true,\n className,\n onSubmit,\n onError,\n onSubcribe,\n children,\n}: React.PropsWithChildren<Props<TFieldValues>>) => {\n const form = useForm({\n ...FormConfig,\n criteriaMode: \"all\",\n });\n\n const { formState, reset, handleSubmit, subscribe } = form;\n const { dirtyFields } = formState;\n\n const [errorOpen, setErrorOpen] = React.useState<boolean>(false);\n\n const handleFormSubmit = React.useCallback<SubmitHandler<TFieldValues>>(\n (data) => {\n onSubmit(data, formState, dirtyFields);\n if (isResetAfterSubmit) {\n reset();\n }\n },\n [dirtyFields, formState, isResetAfterSubmit, onSubmit, reset],\n );\n\n const handleFormError = React.useCallback<SubmitErrorHandler<TFieldValues>>(\n (errors) => {\n const errorKeys = Object.keys(errors);\n if (errorKeys.length === 0) return;\n onError?.(errors);\n setErrorOpen(true);\n },\n [onError],\n );\n\n React.useEffect(() => {\n if (!onSubcribe) return;\n const callback = subscribe({\n formState: { values: true },\n callback: ({ values }) => {\n onSubcribe(values);\n },\n });\n return () => callback();\n }, [onSubcribe, subscribe]);\n\n return (\n <Form {...form}>\n <form\n className={className}\n onSubmit={handleSubmit(handleFormSubmit, handleFormError)}\n >\n {children}\n </form>\n <ErrorDialog\n open={errorOpen}\n title=\"Lỗi nhập dữ liệu\"\n description=\"An unexpected error has occurred. Please check the errors below and try again.\"\n onOpenChange={setErrorOpen}\n >\n {errorOpen && (\n <>\n {Object.keys(formState.errors).length > 0 ? (\n <div className=\"flex max-w-100 flex-col gap-2 px-4\">\n <p className=\"text-muted-foreground text-sm font-semibold\">\n Cảnh báo: Vui lòng kiểm tra các lỗi sau:\n </p>\n <div className=\"flex flex-col space-y-1\">\n {Object.entries(formState.errors).map(([key]) => (\n <ErrorMessage\n key={key}\n errors={formState.errors}\n name={key as AnyEntity}\n render={({ messages }) => {\n return (\n <>\n {messages\n ? Object.entries(messages).map(\n ([type, message]) => {\n return (\n <div\n key={type}\n className=\"text-accent-foreground flex items-start gap-x-1 truncate text-sm font-normal\"\n >\n <AlertCircleIcon\n size={16}\n className=\"text-destructive mt-0.5 min-w-4 flex-0\"\n />\n <p className=\"line-clamp-2 flex-1 text-wrap\">\n {message}\n </p>\n </div>\n );\n },\n )\n : null}\n </>\n );\n }}\n />\n ))}\n </div>\n </div>\n ) : (\n <p className=\"text-muted-foreground text-sm\">No errors found.</p>\n )}\n </>\n )}\n </ErrorDialog>\n </Form>\n );\n};\n"],"mappings":"wUA8BA,MAAa,GAA+D,CAC1E,KAAM,EACN,qBAAqB,GACrB,YACA,WACA,UACA,aACA,cACkD,CAClD,IAAM,EAAO,EAAQ,CACnB,GAAG,EACH,aAAc,QAGV,CAAE,YAAW,QAAO,eAAc,aAAc,EAChD,CAAE,eAAgB,EAElB,CAAC,EAAW,GAAgB,EAAM,SAAkB,IAEpD,EAAmB,EAAM,YAC5B,GAAS,CACR,EAAS,EAAM,EAAW,GACtB,GACF,KAGJ,CAAC,EAAa,EAAW,EAAoB,EAAU,IAGnD,EAAkB,EAAM,YAC3B,GAAW,CACV,IAAM,EAAY,OAAO,KAAK,GAC1B,EAAU,SAAW,IACzB,IAAU,GACV,EAAa,MAEf,CAAC,IAcH,OAXA,EAAM,cAAgB,CACpB,GAAI,CAAC,EAAY,OACjB,IAAM,EAAW,EAAU,CACzB,UAAW,CAAE,OAAQ,IACrB,UAAW,CAAE,YAAa,CACxB,EAAW,MAGf,UAAa,KACZ,CAAC,EAAY,IAGd,EAAC,EAAA,CAAK,GAAI,YACR,EAAC,OAAA,CACY,YACX,SAAU,EAAa,EAAkB,GAExC,aAEH,EAAC,EAAA,CACC,KAAM,EACN,MAAM,mBACN,YAAY,iFACZ,aAAc,WAEb,GACC,EAAA,EAAA,CAAA,SACG,OAAO,KAAK,EAAU,QAAQ,OAAS,EACtC,EAAC,MAAA,CAAI,UAAU,+CACb,EAAC,IAAA,CAAE,UAAU,uDAA8C,6CAG3D,EAAC,MAAA,CAAI,UAAU,mCACZ,OAAO,QAAQ,EAAU,QAAQ,KAAK,CAAC,KACtC,EAAC,EAAA,CAEC,OAAQ,EAAU,OAClB,KAAM,EACN,QAAS,CAAE,cAEP,EAAA,EAAA,CAAA,SACG,EACG,OAAO,QAAQ,GAAU,KACtB,CAAC,EAAM,KAEJ,EAAC,MAAA,CAEC,UAAU,yFAEV,EAAC,EAAA,CACC,KAAM,GACN,UAAU,2CAEZ,EAAC,IAAA,CAAE,UAAU,yCACV,MARE,IAcb,QAzBL,SAkCb,EAAC,IAAA,CAAE,UAAU,yCAAgC"}
1
+ {"version":3,"file":"form-wrapper-YPIbD8rh.js","names":[],"sources":["../packages/components/forms/form-wrapper.tsx"],"sourcesContent":["import React from \"react\";\nimport {\n type FieldValues,\n type FormState,\n type SubmitErrorHandler,\n type SubmitHandler,\n useForm,\n type UseFormProps,\n} from \"react-hook-form\";\nimport { AlertCircleIcon } from \"lucide-react\";\n\nimport type { AnyEntity } from \"@/types\";\nimport { ErrorMessage } from \"@hookform/error-message\";\n\nimport { ErrorDialog } from \"../dialogs/error-dialog\";\nimport { Form } from \"../ui/form\";\n\ntype Props<TFieldValues extends FieldValues = FieldValues> = {\n form: UseFormProps<TFieldValues>;\n isResetAfterSubmit?: boolean;\n className?: string;\n onSubmit: (\n data: TFieldValues,\n formState: FormState<FieldValues>,\n dirtyFields: FormState<FieldValues>[\"dirtyFields\"],\n ) => void | Promise<void>;\n onError?: SubmitErrorHandler<TFieldValues>;\n onSubcribe?: (values: TFieldValues) => void;\n};\n\nexport const FormWrapper = <TFieldValues extends FieldValues = FieldValues>({\n form: FormConfig,\n isResetAfterSubmit = true,\n className,\n onSubmit,\n onError,\n onSubcribe,\n children,\n}: React.PropsWithChildren<Props<TFieldValues>>) => {\n const form = useForm({\n ...FormConfig,\n criteriaMode: \"all\",\n });\n\n const { formState, reset, handleSubmit, subscribe } = form;\n const { dirtyFields } = formState;\n\n const [errorOpen, setErrorOpen] = React.useState<boolean>(false);\n\n const handleFormSubmit = React.useCallback<SubmitHandler<TFieldValues>>(\n (data) => {\n onSubmit(data, formState, dirtyFields);\n if (isResetAfterSubmit) {\n reset();\n }\n },\n [dirtyFields, formState, isResetAfterSubmit, onSubmit, reset],\n );\n\n const handleFormError = React.useCallback<SubmitErrorHandler<TFieldValues>>(\n (errors) => {\n const errorKeys = Object.keys(errors);\n if (errorKeys.length === 0) return;\n onError?.(errors);\n setErrorOpen(true);\n },\n [onError],\n );\n\n React.useEffect(() => {\n if (!onSubcribe) return;\n const callback = subscribe({\n formState: { values: true },\n callback: ({ values }) => {\n onSubcribe(values);\n },\n });\n return () => callback();\n }, [onSubcribe, subscribe]);\n\n return (\n <Form {...form}>\n <form\n className={className}\n onSubmit={handleSubmit(handleFormSubmit, handleFormError)}\n >\n {children}\n </form>\n <ErrorDialog\n open={errorOpen}\n title=\"Lỗi nhập dữ liệu\"\n description=\"An unexpected error has occurred. Please check the errors below and try again.\"\n onOpenChange={setErrorOpen}\n >\n {errorOpen && (\n <>\n {Object.keys(formState.errors).length > 0 ? (\n <div className=\"flex max-w-100 flex-col gap-2 px-4\">\n <p className=\"text-muted-foreground text-sm font-semibold\">\n Cảnh báo: Vui lòng kiểm tra các lỗi sau:\n </p>\n <div className=\"flex flex-col space-y-1\">\n {Object.entries(formState.errors).map(([key]) => (\n <ErrorMessage\n key={key}\n errors={formState.errors}\n name={key as AnyEntity}\n render={({ messages }) => {\n return (\n <>\n {messages\n ? Object.entries(messages).map(\n ([type, message]) => {\n return (\n <div\n key={type}\n className=\"text-accent-foreground flex items-start gap-x-1 truncate text-sm font-normal\"\n >\n <AlertCircleIcon\n size={16}\n className=\"text-destructive mt-0.5 min-w-4 flex-0\"\n />\n <p className=\"line-clamp-2 flex-1 text-wrap\">\n {message}\n </p>\n </div>\n );\n },\n )\n : null}\n </>\n );\n }}\n />\n ))}\n </div>\n </div>\n ) : (\n <p className=\"text-muted-foreground text-sm\">No errors found.</p>\n )}\n </>\n )}\n </ErrorDialog>\n </Form>\n );\n};\n"],"mappings":"wUA8BA,MAAa,GAA+D,CAC1E,KAAM,EACN,qBAAqB,GACrB,YACA,WACA,UACA,aACA,cACkD,CAClD,IAAM,EAAO,EAAQ,CACnB,GAAG,EACH,aAAc,QAGV,CAAE,YAAW,QAAO,eAAc,aAAc,EAChD,CAAE,eAAgB,EAElB,CAAC,EAAW,GAAgB,EAAM,SAAkB,IAEpD,EAAmB,EAAM,YAC5B,GAAS,CACR,EAAS,EAAM,EAAW,GACtB,GACF,KAGJ,CAAC,EAAa,EAAW,EAAoB,EAAU,IAGnD,EAAkB,EAAM,YAC3B,GAAW,CACV,IAAM,EAAY,OAAO,KAAK,GAC1B,EAAU,SAAW,IACzB,IAAU,GACV,EAAa,MAEf,CAAC,IAcH,OAXA,EAAM,cAAgB,CACpB,GAAI,CAAC,EAAY,OACjB,IAAM,EAAW,EAAU,CACzB,UAAW,CAAE,OAAQ,IACrB,UAAW,CAAE,YAAa,CACxB,EAAW,MAGf,UAAa,KACZ,CAAC,EAAY,IAGd,EAAC,EAAA,CAAK,GAAI,YACR,EAAC,OAAA,CACY,YACX,SAAU,EAAa,EAAkB,GAExC,aAEH,EAAC,EAAA,CACC,KAAM,EACN,MAAM,mBACN,YAAY,iFACZ,aAAc,WAEb,GACC,EAAA,EAAA,CAAA,SACG,OAAO,KAAK,EAAU,QAAQ,OAAS,EACtC,EAAC,MAAA,CAAI,UAAU,+CACb,EAAC,IAAA,CAAE,UAAU,uDAA8C,6CAG3D,EAAC,MAAA,CAAI,UAAU,mCACZ,OAAO,QAAQ,EAAU,QAAQ,KAAK,CAAC,KACtC,EAAC,EAAA,CAEC,OAAQ,EAAU,OAClB,KAAM,EACN,QAAS,CAAE,cAEP,EAAA,EAAA,CAAA,SACG,EACG,OAAO,QAAQ,GAAU,KACtB,CAAC,EAAM,KAEJ,EAAC,MAAA,CAEC,UAAU,yFAEV,EAAC,EAAA,CACC,KAAM,GACN,UAAU,2CAEZ,EAAC,IAAA,CAAE,UAAU,yCACV,MARE,IAcb,QAzBL,SAkCb,EAAC,IAAA,CAAE,UAAU,yCAAgC"}