@definable/ui 0.1.13 → 0.1.15

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 (300) hide show
  1. package/README.md +0 -7
  2. package/dist/components/alert-dialog.js +55 -2
  3. package/dist/components/alert.js +63 -2
  4. package/dist/components/avatar.js +41 -2
  5. package/dist/components/badge.js +26 -2
  6. package/dist/components/button.d.ts +2 -2
  7. package/dist/components/button.js +49 -2
  8. package/dist/components/calendar.js +86 -2
  9. package/dist/components/card.js +61 -2
  10. package/dist/components/carousel.js +100 -2
  11. package/dist/components/checkbox.js +31 -2
  12. package/dist/components/collapse.js +49 -2
  13. package/dist/components/command-menu.js +89 -2
  14. package/dist/components/command.js +115 -2
  15. package/dist/components/confirmation-modal.js +44 -2
  16. package/dist/components/context-menu.js +185 -2
  17. package/dist/components/dialog.js +121 -2
  18. package/dist/components/dropdown-menu.js +48 -2
  19. package/dist/components/dropzone.js +44 -2
  20. package/dist/components/image-cropper-modal.js +250 -2
  21. package/dist/components/image-cropper.js +130 -2
  22. package/dist/components/input.js +21 -2
  23. package/dist/components/label.js +19 -2
  24. package/dist/components/loader.js +69 -2
  25. package/dist/components/loading-placeholder.js +24 -2
  26. package/dist/components/mention.js +153 -2
  27. package/dist/components/modal.js +135 -2
  28. package/dist/components/notification.js +25 -2
  29. package/dist/components/popover.js +23 -2
  30. package/dist/components/progress.js +34 -2
  31. package/dist/components/radio-group.js +47 -2
  32. package/dist/components/scroll-area.js +46 -2
  33. package/dist/components/select.js +130 -2
  34. package/dist/components/selection-bar.js +53 -2
  35. package/dist/components/separator.js +24 -2
  36. package/dist/components/sheet.js +128 -2
  37. package/dist/components/skeleton.js +17 -2
  38. package/dist/components/slider.js +32 -2
  39. package/dist/components/stepper/index.d.ts +4 -0
  40. package/dist/components/stepper/step-layout.d.ts +8 -0
  41. package/dist/components/stepper/stepper-modal.d.ts +26 -0
  42. package/dist/components/stepper/stepper.d.ts +7 -0
  43. package/dist/components/stepper/types.d.ts +6 -0
  44. package/dist/components/stepper.js +6 -2
  45. package/dist/components/switch.js +35 -2
  46. package/dist/components/table-empty.js +22 -2
  47. package/dist/components/table-mobile.js +91 -2
  48. package/dist/components/table.js +156 -2
  49. package/dist/components/tabs.js +46 -2
  50. package/dist/components/terminal.js +49 -2
  51. package/dist/components/textarea.js +20 -2
  52. package/dist/components/tooltip.js +75 -2
  53. package/dist/components/use-toast.js +64 -2
  54. package/dist/icons/icons.d.ts +8 -0
  55. package/dist/icons/index.d.ts +1 -0
  56. package/dist/icons/providers/anthropic.d.ts +2 -0
  57. package/dist/icons/providers/claude.d.ts +2 -0
  58. package/dist/icons/providers/deepseek.d.ts +2 -0
  59. package/dist/icons/providers/gemini.d.ts +2 -0
  60. package/dist/icons/providers/grok.d.ts +2 -0
  61. package/dist/icons/providers/index.d.ts +6 -0
  62. package/dist/icons/providers/openai.d.ts +2 -0
  63. package/dist/icons/providers/types.d.ts +4 -0
  64. package/dist/index.d.ts +48 -962
  65. package/dist/index.js +444 -2
  66. package/dist/lib/icons.d.ts +14 -0
  67. package/dist/lib/index.d.ts +2 -0
  68. package/dist/lib/utils.js +8 -2
  69. package/dist/{stepper-modal-SYU9mbXs.js → stepper-modal-JXpOXOV2.js} +90 -91
  70. package/dist/styles.css +1 -1
  71. package/package.json +180 -134
  72. package/dist/MonacoEditor-COZcVMEj.cjs +0 -8
  73. package/dist/MonacoEditor-COZcVMEj.cjs.map +0 -1
  74. package/dist/MonacoEditor-D3QSSKa4.js +0 -295
  75. package/dist/MonacoEditor-D3QSSKa4.js.map +0 -1
  76. package/dist/alert-dialog.d.ts +0 -18
  77. package/dist/alert.d.ts +0 -25
  78. package/dist/avatar.d.ts +0 -9
  79. package/dist/badge.d.ts +0 -15
  80. package/dist/button.d.ts +0 -16
  81. package/dist/calendar.d.ts +0 -21
  82. package/dist/card.d.ts +0 -15
  83. package/dist/carousel.d.ts +0 -18
  84. package/dist/charts.d.ts +0 -26
  85. package/dist/checkbox.d.ts +0 -6
  86. package/dist/collapse.d.ts +0 -15
  87. package/dist/command-menu.d.ts +0 -12
  88. package/dist/command.d.ts +0 -89
  89. package/dist/components/alert-dialog.esm.js +0 -59
  90. package/dist/components/alert-dialog.esm.js.map +0 -1
  91. package/dist/components/alert-dialog.js.map +0 -1
  92. package/dist/components/alert.esm.js +0 -64
  93. package/dist/components/alert.esm.js.map +0 -1
  94. package/dist/components/alert.js.map +0 -1
  95. package/dist/components/avatar.esm.js +0 -42
  96. package/dist/components/avatar.esm.js.map +0 -1
  97. package/dist/components/avatar.js.map +0 -1
  98. package/dist/components/badge.esm.js +0 -27
  99. package/dist/components/badge.esm.js.map +0 -1
  100. package/dist/components/badge.js.map +0 -1
  101. package/dist/components/button.esm.js +0 -48
  102. package/dist/components/button.esm.js.map +0 -1
  103. package/dist/components/button.js.map +0 -1
  104. package/dist/components/calendar.esm.js +0 -5562
  105. package/dist/components/calendar.esm.js.map +0 -1
  106. package/dist/components/calendar.js.map +0 -1
  107. package/dist/components/card.esm.js +0 -62
  108. package/dist/components/card.esm.js.map +0 -1
  109. package/dist/components/card.js.map +0 -1
  110. package/dist/components/carousel.esm.js +0 -101
  111. package/dist/components/carousel.esm.js.map +0 -1
  112. package/dist/components/carousel.js.map +0 -1
  113. package/dist/components/charts.d.ts +0 -17
  114. package/dist/components/charts.esm.js +0 -48
  115. package/dist/components/charts.esm.js.map +0 -1
  116. package/dist/components/charts.js +0 -2
  117. package/dist/components/charts.js.map +0 -1
  118. package/dist/components/checkbox.esm.js +0 -32
  119. package/dist/components/checkbox.esm.js.map +0 -1
  120. package/dist/components/checkbox.js.map +0 -1
  121. package/dist/components/collapse.esm.js +0 -50
  122. package/dist/components/collapse.esm.js.map +0 -1
  123. package/dist/components/collapse.js.map +0 -1
  124. package/dist/components/command-menu.esm.js +0 -90
  125. package/dist/components/command-menu.esm.js.map +0 -1
  126. package/dist/components/command-menu.js.map +0 -1
  127. package/dist/components/command.esm.js +0 -425
  128. package/dist/components/command.esm.js.map +0 -1
  129. package/dist/components/command.js.map +0 -1
  130. package/dist/components/confirmation-modal.esm.js +0 -46
  131. package/dist/components/confirmation-modal.esm.js.map +0 -1
  132. package/dist/components/confirmation-modal.js.map +0 -1
  133. package/dist/components/context-menu.esm.js +0 -186
  134. package/dist/components/context-menu.esm.js.map +0 -1
  135. package/dist/components/context-menu.js.map +0 -1
  136. package/dist/components/dialog.esm.js +0 -122
  137. package/dist/components/dialog.esm.js.map +0 -1
  138. package/dist/components/dialog.js.map +0 -1
  139. package/dist/components/dropdown-menu.esm.js +0 -49
  140. package/dist/components/dropdown-menu.esm.js.map +0 -1
  141. package/dist/components/dropdown-menu.js.map +0 -1
  142. package/dist/components/dropzone.esm.js +0 -45
  143. package/dist/components/dropzone.esm.js.map +0 -1
  144. package/dist/components/dropzone.js.map +0 -1
  145. package/dist/components/image-cropper-modal.esm.js +0 -251
  146. package/dist/components/image-cropper-modal.esm.js.map +0 -1
  147. package/dist/components/image-cropper-modal.js.map +0 -1
  148. package/dist/components/image-cropper.esm.js +0 -131
  149. package/dist/components/image-cropper.esm.js.map +0 -1
  150. package/dist/components/image-cropper.js.map +0 -1
  151. package/dist/components/input.esm.js +0 -22
  152. package/dist/components/input.esm.js.map +0 -1
  153. package/dist/components/input.js.map +0 -1
  154. package/dist/components/label.esm.js +0 -20
  155. package/dist/components/label.esm.js.map +0 -1
  156. package/dist/components/label.js.map +0 -1
  157. package/dist/components/loader.esm.js +0 -70
  158. package/dist/components/loader.esm.js.map +0 -1
  159. package/dist/components/loader.js.map +0 -1
  160. package/dist/components/loading-placeholder.esm.js +0 -25
  161. package/dist/components/loading-placeholder.esm.js.map +0 -1
  162. package/dist/components/loading-placeholder.js.map +0 -1
  163. package/dist/components/markdown.d.ts +0 -2
  164. package/dist/components/markdown.esm.js +0 -12066
  165. package/dist/components/markdown.esm.js.map +0 -1
  166. package/dist/components/markdown.js +0 -18
  167. package/dist/components/markdown.js.map +0 -1
  168. package/dist/components/mention.esm.js +0 -154
  169. package/dist/components/mention.esm.js.map +0 -1
  170. package/dist/components/mention.js.map +0 -1
  171. package/dist/components/modal.esm.js +0 -136
  172. package/dist/components/modal.esm.js.map +0 -1
  173. package/dist/components/modal.js.map +0 -1
  174. package/dist/components/monaco-editor.d.ts +0 -2
  175. package/dist/components/monaco-editor.esm.js +0 -9
  176. package/dist/components/monaco-editor.esm.js.map +0 -1
  177. package/dist/components/monaco-editor.js +0 -2
  178. package/dist/components/monaco-editor.js.map +0 -1
  179. package/dist/components/notification.esm.js +0 -26
  180. package/dist/components/notification.esm.js.map +0 -1
  181. package/dist/components/notification.js.map +0 -1
  182. package/dist/components/popover.esm.js +0 -24
  183. package/dist/components/popover.esm.js.map +0 -1
  184. package/dist/components/popover.js.map +0 -1
  185. package/dist/components/progress.esm.js +0 -35
  186. package/dist/components/progress.esm.js.map +0 -1
  187. package/dist/components/progress.js.map +0 -1
  188. package/dist/components/radio-group.esm.js +0 -48
  189. package/dist/components/radio-group.esm.js.map +0 -1
  190. package/dist/components/radio-group.js.map +0 -1
  191. package/dist/components/scroll-area.esm.js +0 -47
  192. package/dist/components/scroll-area.esm.js.map +0 -1
  193. package/dist/components/scroll-area.js.map +0 -1
  194. package/dist/components/select.esm.js +0 -131
  195. package/dist/components/select.esm.js.map +0 -1
  196. package/dist/components/select.js.map +0 -1
  197. package/dist/components/selection-bar.esm.js +0 -54
  198. package/dist/components/selection-bar.esm.js.map +0 -1
  199. package/dist/components/selection-bar.js.map +0 -1
  200. package/dist/components/separator.esm.js +0 -25
  201. package/dist/components/separator.esm.js.map +0 -1
  202. package/dist/components/separator.js.map +0 -1
  203. package/dist/components/sheet.esm.js +0 -129
  204. package/dist/components/sheet.esm.js.map +0 -1
  205. package/dist/components/sheet.js.map +0 -1
  206. package/dist/components/skeleton.esm.js +0 -18
  207. package/dist/components/skeleton.esm.js.map +0 -1
  208. package/dist/components/skeleton.js.map +0 -1
  209. package/dist/components/slider.esm.js +0 -33
  210. package/dist/components/slider.esm.js.map +0 -1
  211. package/dist/components/slider.js.map +0 -1
  212. package/dist/components/stepper.d.ts +0 -2
  213. package/dist/components/stepper.esm.js +0 -7
  214. package/dist/components/stepper.esm.js.map +0 -1
  215. package/dist/components/stepper.js.map +0 -1
  216. package/dist/components/switch.esm.js +0 -36
  217. package/dist/components/switch.esm.js.map +0 -1
  218. package/dist/components/switch.js.map +0 -1
  219. package/dist/components/table-empty.esm.js +0 -23
  220. package/dist/components/table-empty.esm.js.map +0 -1
  221. package/dist/components/table-empty.js.map +0 -1
  222. package/dist/components/table-mobile.esm.js +0 -92
  223. package/dist/components/table-mobile.esm.js.map +0 -1
  224. package/dist/components/table-mobile.js.map +0 -1
  225. package/dist/components/table.esm.js +0 -157
  226. package/dist/components/table.esm.js.map +0 -1
  227. package/dist/components/table.js.map +0 -1
  228. package/dist/components/tabs.esm.js +0 -47
  229. package/dist/components/tabs.esm.js.map +0 -1
  230. package/dist/components/tabs.js.map +0 -1
  231. package/dist/components/terminal.esm.js +0 -50
  232. package/dist/components/terminal.esm.js.map +0 -1
  233. package/dist/components/terminal.js.map +0 -1
  234. package/dist/components/textarea.esm.js +0 -21
  235. package/dist/components/textarea.esm.js.map +0 -1
  236. package/dist/components/textarea.js.map +0 -1
  237. package/dist/components/tooltip.esm.js +0 -76
  238. package/dist/components/tooltip.esm.js.map +0 -1
  239. package/dist/components/tooltip.js.map +0 -1
  240. package/dist/components/use-toast.esm.js +0 -65
  241. package/dist/components/use-toast.esm.js.map +0 -1
  242. package/dist/components/use-toast.js.map +0 -1
  243. package/dist/confirmation-modal.d.ts +0 -16
  244. package/dist/context-menu.d.ts +0 -41
  245. package/dist/dialog.d.ts +0 -33
  246. package/dist/dropdown-menu.d.ts +0 -16
  247. package/dist/dropzone.d.ts +0 -16
  248. package/dist/image-cropper-modal.d.ts +0 -14
  249. package/dist/image-cropper.d.ts +0 -15
  250. package/dist/index-DACAHwoB.js +0 -35
  251. package/dist/index-DACAHwoB.js.map +0 -1
  252. package/dist/index-Deooizx8.cjs +0 -2
  253. package/dist/index-Deooizx8.cjs.map +0 -1
  254. package/dist/index.esm.js +0 -458
  255. package/dist/index.esm.js.map +0 -1
  256. package/dist/index.js.map +0 -1
  257. package/dist/input.d.ts +0 -8
  258. package/dist/jsx-runtime-BYECrxsp.cjs +0 -31
  259. package/dist/jsx-runtime-BYECrxsp.cjs.map +0 -1
  260. package/dist/jsx-runtime-DGlMoOmv.js +0 -631
  261. package/dist/jsx-runtime-DGlMoOmv.js.map +0 -1
  262. package/dist/label.d.ts +0 -6
  263. package/dist/lib/utils.esm.js +0 -5
  264. package/dist/lib/utils.esm.js.map +0 -1
  265. package/dist/lib/utils.js.map +0 -1
  266. package/dist/loader.d.ts +0 -14
  267. package/dist/loading-placeholder.d.ts +0 -12
  268. package/dist/markdown.d.ts +0 -122
  269. package/dist/mention.d.ts +0 -29
  270. package/dist/modal.d.ts +0 -28
  271. package/dist/monaco-editor.d.ts +0 -76
  272. package/dist/notification.d.ts +0 -9
  273. package/dist/popover.d.ts +0 -10
  274. package/dist/progress.d.ts +0 -6
  275. package/dist/radio-group.d.ts +0 -8
  276. package/dist/scroll-area.d.ts +0 -8
  277. package/dist/select.d.ts +0 -31
  278. package/dist/selection-bar.d.ts +0 -15
  279. package/dist/separator.d.ts +0 -6
  280. package/dist/sheet.d.ts +0 -17
  281. package/dist/skeleton.d.ts +0 -5
  282. package/dist/slider.d.ts +0 -6
  283. package/dist/stepper-modal-CPlBpxWy.cjs +0 -2
  284. package/dist/stepper-modal-CPlBpxWy.cjs.map +0 -1
  285. package/dist/stepper-modal-SYU9mbXs.js.map +0 -1
  286. package/dist/stepper.d.ts +0 -75
  287. package/dist/switch.d.ts +0 -6
  288. package/dist/table-empty.d.ts +0 -13
  289. package/dist/table-mobile.d.ts +0 -37
  290. package/dist/table.d.ts +0 -37
  291. package/dist/tabs.d.ts +0 -12
  292. package/dist/terminal.d.ts +0 -47
  293. package/dist/textarea.d.ts +0 -8
  294. package/dist/tooltip.d.ts +0 -12
  295. package/dist/use-toast.d.ts +0 -28
  296. package/dist/utils-DSKoFOjv.cjs +0 -2
  297. package/dist/utils-DSKoFOjv.cjs.map +0 -1
  298. package/dist/utils-qaFjX9_3.js +0 -2279
  299. package/dist/utils-qaFjX9_3.js.map +0 -1
  300. package/dist/utils.d.ts +0 -5
@@ -1,2 +1,250 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../jsx-runtime-BYECrxsp.cjs"),o=require("react"),C=require("./button.js"),B=require("./modal.js"),U=require("./label.js"),k=require("lucide-react");function A({isOpen:x,onClose:j,imageSrc:m,onCrop:D,title:Y="Crop Your Image",outputSize:h=200}){const[t,g]=o.useState({x:0,y:0,size:100}),[y,b]=o.useState(!1),[R,w]=o.useState(!1),[z,I]=o.useState({x:0,y:0}),[r,P]=o.useState({width:0,height:0}),E=o.useRef(null),p=o.useRef(null),q=o.useCallback(()=>{if(p.current){const e=p.current,n=400,l=e.naturalWidth/e.naturalHeight;let a,i;l>1?(a=n,i=n/l):(i=n,a=n*l),P({width:a,height:i});const c=Math.min(a,i)*.6;g({x:(a-c)/2,y:(i-c)/2,size:c})}},[]),f=o.useCallback((e,n)=>{e.preventDefault();const l=e.currentTarget.getBoundingClientRect(),a=e.clientX-l.left,i=e.clientY-l.top;if(n==="resize"){w(!0);const c=t.x+t.size/2,u=t.y+t.size/2,d=Math.sqrt((a-c)**2+(i-u)**2);I({x:d,y:0})}else b(!0),I({x:a-t.x,y:i-t.y})},[t]),$=o.useCallback(e=>{if(!y&&!R)return;const n=e.currentTarget.getBoundingClientRect(),l=e.clientX-n.left,a=e.clientY-n.top;if(R){const i=t.x+t.size/2,c=t.y+t.size/2,u=Math.sqrt((l-i)**2+(a-c)**2),d=Math.max(50,Math.min(Math.min(r.width,r.height),u*2));g({x:Math.max(0,Math.min(r.width-d,i-d/2)),y:Math.max(0,Math.min(r.height-d,c-d/2)),size:d})}else if(y){const i=l-z.x,c=a-z.y,u=r.width-t.size,d=r.height-t.size;g(N=>({...N,x:Math.max(0,Math.min(u,i)),y:Math.max(0,Math.min(d,c))}))}},[y,R,z,r,t]),X=o.useCallback(()=>{b(!1),w(!1)},[]),L=o.useCallback(()=>{if(r.width&&r.height){const e=Math.min(r.width,r.height)*.6;g({x:(r.width-e)/2,y:(r.height-e)/2,size:e})}},[r]),S=o.useCallback(()=>{if(!E.current||!p.current)return;const e=E.current,n=e.getContext("2d");if(!n)return;const l=p.current;e.width=h,e.height=h;const a=l.naturalWidth/r.width,i=l.naturalHeight/r.height,c=t.x*a,u=t.y*i,d=t.size*Math.min(a,i);n.beginPath(),n.arc(h/2,h/2,h/2,0,Math.PI*2),n.clip(),n.drawImage(l,c,u,d,d,0,0,h,h);const N=e.toDataURL("image/png");D(N),j()},[t,r,D,j,h]),v=o.useCallback(()=>{b(!1),w(!1),g({x:0,y:0,size:100}),j()},[j]),M=o.useCallback(e=>{e.key==="Escape"&&x&&(e.stopPropagation(),v())},[x,v]);return o.useEffect(()=>{if(x)return document.addEventListener("keydown",M,!0),()=>document.removeEventListener("keydown",M,!0)},[x,M]),o.useEffect(()=>{x&&m&&(b(!1),w(!1),P({width:0,height:0}))},[x,m]),m?s.jsxRuntimeExports.jsx(B.Modal,{isOpen:x,onClose:v,title:Y,size:"2xl",zIndexClassName:"z-[60]",footer:s.jsxRuntimeExports.jsxs("div",{className:"flex items-center justify-between w-full",children:[s.jsxRuntimeExports.jsxs(C.Button,{variant:"ghost",size:"sm",onClick:L,className:"flex items-center gap-2",children:[s.jsxRuntimeExports.jsx(k.RotateCcw,{className:"h-4 w-4"}),"Reset"]}),s.jsxRuntimeExports.jsxs("div",{className:"flex gap-3",children:[s.jsxRuntimeExports.jsxs(C.Button,{variant:"outline",onClick:v,children:[s.jsxRuntimeExports.jsx(k.X,{className:"h-4 w-4 mr-2"}),"Cancel"]}),s.jsxRuntimeExports.jsxs(C.Button,{onClick:S,children:[s.jsxRuntimeExports.jsx(k.Check,{className:"h-4 w-4 mr-2"}),"Crop Image"]})]})]}),children:s.jsxRuntimeExports.jsxs("div",{className:"p-6",children:[s.jsxRuntimeExports.jsxs("div",{className:"space-y-6",children:[s.jsxRuntimeExports.jsx("div",{className:"text-center",children:s.jsxRuntimeExports.jsx("p",{className:"text-sm text-muted-foreground",children:"Drag the circle to move • Drag corners to resize • Click reset to center"})}),s.jsxRuntimeExports.jsx("div",{className:"flex justify-center",children:s.jsxRuntimeExports.jsxs("div",{className:"relative bg-gray-100 rounded-xl overflow-hidden select-none border",style:{width:r.width,height:r.height},onMouseMove:$,onMouseUp:X,onMouseLeave:X,children:[s.jsxRuntimeExports.jsx("img",{ref:p,src:m,alt:"Crop preview",className:"block",style:{width:r.width,height:r.height},onLoad:q,draggable:!1}),s.jsxRuntimeExports.jsxs("div",{className:"absolute border-2 border-white rounded-full shadow-lg cursor-move",style:{left:t.x,top:t.y,width:t.size,height:t.size},onMouseDown:e=>f(e,"move"),children:[s.jsxRuntimeExports.jsx("div",{className:"w-full h-full rounded-full border-2 border-primary border-dashed"}),s.jsxRuntimeExports.jsx("div",{className:"absolute w-5 h-5 bg-white border-2 border-primary rounded-full shadow-lg cursor-nw-resize -top-2.5 -right-2.5 hover:bg-primary hover:border-white transition-colors flex items-center justify-center",onMouseDown:e=>{e.stopPropagation(),f(e,"resize")},children:s.jsxRuntimeExports.jsx("div",{className:"w-1.5 h-1.5 bg-primary rounded-full hover:bg-white transition-colors"})}),s.jsxRuntimeExports.jsx("div",{className:"absolute w-5 h-5 bg-white border-2 border-primary rounded-full shadow-lg cursor-ne-resize -bottom-2.5 -right-2.5 hover:bg-primary hover:border-white transition-colors flex items-center justify-center",onMouseDown:e=>{e.stopPropagation(),f(e,"resize")},children:s.jsxRuntimeExports.jsx("div",{className:"w-1.5 h-1.5 bg-primary rounded-full hover:bg-white transition-colors"})}),s.jsxRuntimeExports.jsx("div",{className:"absolute w-5 h-5 bg-white border-2 border-primary rounded-full shadow-lg cursor-sw-resize -bottom-2.5 -left-2.5 hover:bg-primary hover:border-white transition-colors flex items-center justify-center",onMouseDown:e=>{e.stopPropagation(),f(e,"resize")},children:s.jsxRuntimeExports.jsx("div",{className:"w-1.5 h-1.5 bg-primary rounded-full hover:bg-white transition-colors"})}),s.jsxRuntimeExports.jsx("div",{className:"absolute w-5 h-5 bg-white border-2 border-primary rounded-full shadow-lg cursor-se-resize -top-2.5 -left-2.5 hover:bg-primary hover:border-white transition-colors flex items-center justify-center",onMouseDown:e=>{e.stopPropagation(),f(e,"resize")},children:s.jsxRuntimeExports.jsx("div",{className:"w-1.5 h-1.5 bg-primary rounded-full hover:bg-white transition-colors"})})]}),s.jsxRuntimeExports.jsx("div",{className:"absolute inset-0 bg-black/50 pointer-events-none",style:{clipPath:`circle(${t.size/2}px at ${t.x+t.size/2}px ${t.y+t.size/2}px)`}})]})}),s.jsxRuntimeExports.jsx("div",{className:"flex justify-center",children:s.jsxRuntimeExports.jsxs("div",{className:"text-center",children:[s.jsxRuntimeExports.jsx(U.Label,{className:"text-xs font-medium text-muted-foreground mb-2 block",children:"Preview"}),s.jsxRuntimeExports.jsx("div",{className:"rounded-full border-2 border-border bg-background overflow-hidden mx-auto",style:{width:80,height:80},children:s.jsxRuntimeExports.jsx("div",{className:"w-full h-full bg-gray-100",style:{backgroundImage:`url(${m})`,backgroundSize:`${r.width/t.size*80}px ${r.height/t.size*80}px`,backgroundPosition:`-${t.x/t.size*80}px -${t.y/t.size*80}px`,backgroundRepeat:"no-repeat"}})})]})})]}),s.jsxRuntimeExports.jsx("canvas",{ref:E,className:"hidden"})]})}):null}exports.ImageCropperModal=A;
2
- //# sourceMappingURL=image-cropper-modal.js.map
1
+ import { jsx as s, jsxs as d } from "react/jsx-runtime";
2
+ import { useState as x, useRef as L, useCallback as m, useEffect as E } from "react";
3
+ import { Button as P } from "./button.js";
4
+ import { Modal as q } from "./modal.js";
5
+ import { Label as T } from "./label.js";
6
+ import { RotateCcw as K, X as F, Check as G } from "lucide-react";
7
+ function O({
8
+ isOpen: g,
9
+ onClose: v,
10
+ imageSrc: f,
11
+ onCrop: j,
12
+ title: U = "Crop Your Image",
13
+ outputSize: h = 200
14
+ }) {
15
+ const [t, w] = x({ x: 0, y: 0, size: 100 }), [N, y] = x(!1), [k, z] = x(!1), [C, X] = x({ x: 0, y: 0 }), [r, Y] = x({ width: 0, height: 0 }), D = L(null), b = L(null), A = m(() => {
16
+ if (b.current) {
17
+ const e = b.current, i = 400, a = e.naturalWidth / e.naturalHeight;
18
+ let n, o;
19
+ a > 1 ? (n = i, o = i / a) : (o = i, n = i * a), Y({ width: n, height: o });
20
+ const l = Math.min(n, o) * 0.6;
21
+ w({
22
+ x: (n - l) / 2,
23
+ y: (o - l) / 2,
24
+ size: l
25
+ });
26
+ }
27
+ }, []), p = m((e, i) => {
28
+ e.preventDefault();
29
+ const a = e.currentTarget.getBoundingClientRect(), n = e.clientX - a.left, o = e.clientY - a.top;
30
+ if (i === "resize") {
31
+ z(!0);
32
+ const l = t.x + t.size / 2, u = t.y + t.size / 2, c = Math.sqrt((n - l) ** 2 + (o - u) ** 2);
33
+ X({ x: c, y: 0 });
34
+ } else
35
+ y(!0), X({ x: n - t.x, y: o - t.y });
36
+ }, [t]), B = m((e) => {
37
+ if (!N && !k) return;
38
+ const i = e.currentTarget.getBoundingClientRect(), a = e.clientX - i.left, n = e.clientY - i.top;
39
+ if (k) {
40
+ const o = t.x + t.size / 2, l = t.y + t.size / 2, u = Math.sqrt((a - o) ** 2 + (n - l) ** 2), c = Math.max(50, Math.min(Math.min(r.width, r.height), u * 2));
41
+ w({
42
+ x: Math.max(0, Math.min(r.width - c, o - c / 2)),
43
+ y: Math.max(0, Math.min(r.height - c, l - c / 2)),
44
+ size: c
45
+ });
46
+ } else if (N) {
47
+ const o = a - C.x, l = n - C.y, u = r.width - t.size, c = r.height - t.size;
48
+ w((R) => ({
49
+ ...R,
50
+ x: Math.max(0, Math.min(u, o)),
51
+ y: Math.max(0, Math.min(c, l))
52
+ }));
53
+ }
54
+ }, [N, k, C, r, t]), $ = m(() => {
55
+ y(!1), z(!1);
56
+ }, []), H = m(() => {
57
+ if (r.width && r.height) {
58
+ const e = Math.min(r.width, r.height) * 0.6;
59
+ w({
60
+ x: (r.width - e) / 2,
61
+ y: (r.height - e) / 2,
62
+ size: e
63
+ });
64
+ }
65
+ }, [r]), W = m(() => {
66
+ if (!D.current || !b.current) return;
67
+ const e = D.current, i = e.getContext("2d");
68
+ if (!i) return;
69
+ const a = b.current;
70
+ e.width = h, e.height = h;
71
+ const n = a.naturalWidth / r.width, o = a.naturalHeight / r.height, l = t.x * n, u = t.y * o, c = t.size * Math.min(n, o);
72
+ i.beginPath(), i.arc(h / 2, h / 2, h / 2, 0, Math.PI * 2), i.clip(), i.drawImage(
73
+ a,
74
+ l,
75
+ u,
76
+ c,
77
+ c,
78
+ 0,
79
+ 0,
80
+ h,
81
+ h
82
+ );
83
+ const R = e.toDataURL("image/png");
84
+ j(R), v();
85
+ }, [t, r, j, v, h]), M = m(() => {
86
+ y(!1), z(!1), w({ x: 0, y: 0, size: 100 }), v();
87
+ }, [v]), I = m((e) => {
88
+ e.key === "Escape" && g && (e.stopPropagation(), M());
89
+ }, [g, M]);
90
+ return E(() => {
91
+ if (g)
92
+ return document.addEventListener("keydown", I, !0), () => document.removeEventListener("keydown", I, !0);
93
+ }, [g, I]), E(() => {
94
+ g && f && (y(!1), z(!1), Y({ width: 0, height: 0 }));
95
+ }, [g, f]), f ? /* @__PURE__ */ s(
96
+ q,
97
+ {
98
+ isOpen: g,
99
+ onClose: M,
100
+ title: U,
101
+ size: "2xl",
102
+ zIndexClassName: "z-[60]",
103
+ footer: /* @__PURE__ */ d("div", { className: "flex items-center justify-between w-full", children: [
104
+ /* @__PURE__ */ d(
105
+ P,
106
+ {
107
+ variant: "ghost",
108
+ size: "sm",
109
+ onClick: H,
110
+ className: "flex items-center gap-2",
111
+ children: [
112
+ /* @__PURE__ */ s(K, { className: "h-4 w-4" }),
113
+ "Reset"
114
+ ]
115
+ }
116
+ ),
117
+ /* @__PURE__ */ d("div", { className: "flex gap-3", children: [
118
+ /* @__PURE__ */ d(P, { variant: "outline", onClick: M, children: [
119
+ /* @__PURE__ */ s(F, { className: "h-4 w-4 mr-2" }),
120
+ "Cancel"
121
+ ] }),
122
+ /* @__PURE__ */ d(P, { onClick: W, children: [
123
+ /* @__PURE__ */ s(G, { className: "h-4 w-4 mr-2" }),
124
+ "Crop Image"
125
+ ] })
126
+ ] })
127
+ ] }),
128
+ children: /* @__PURE__ */ d("div", { className: "p-6", children: [
129
+ /* @__PURE__ */ d("div", { className: "space-y-6", children: [
130
+ /* @__PURE__ */ s("div", { className: "text-center", children: /* @__PURE__ */ s("p", { className: "text-sm text-muted-foreground", children: "Drag the circle to move • Drag corners to resize • Click reset to center" }) }),
131
+ /* @__PURE__ */ s("div", { className: "flex justify-center", children: /* @__PURE__ */ d(
132
+ "div",
133
+ {
134
+ className: "relative bg-gray-100 rounded-xl overflow-hidden select-none border",
135
+ style: { width: r.width, height: r.height },
136
+ onMouseMove: B,
137
+ onMouseUp: $,
138
+ onMouseLeave: $,
139
+ children: [
140
+ /* @__PURE__ */ s(
141
+ "img",
142
+ {
143
+ ref: b,
144
+ src: f,
145
+ alt: "Crop preview",
146
+ className: "block",
147
+ style: { width: r.width, height: r.height },
148
+ onLoad: A,
149
+ draggable: !1
150
+ }
151
+ ),
152
+ /* @__PURE__ */ d(
153
+ "div",
154
+ {
155
+ className: "absolute border-2 border-white rounded-full shadow-lg cursor-move",
156
+ style: {
157
+ left: t.x,
158
+ top: t.y,
159
+ width: t.size,
160
+ height: t.size
161
+ },
162
+ onMouseDown: (e) => p(e, "move"),
163
+ children: [
164
+ /* @__PURE__ */ s("div", { className: "w-full h-full rounded-full border-2 border-primary border-dashed" }),
165
+ /* @__PURE__ */ s(
166
+ "div",
167
+ {
168
+ className: "absolute w-5 h-5 bg-white border-2 border-primary rounded-full shadow-lg cursor-nw-resize -top-2.5 -right-2.5 hover:bg-primary hover:border-white transition-colors flex items-center justify-center",
169
+ onMouseDown: (e) => {
170
+ e.stopPropagation(), p(e, "resize");
171
+ },
172
+ children: /* @__PURE__ */ s("div", { className: "w-1.5 h-1.5 bg-primary rounded-full hover:bg-white transition-colors" })
173
+ }
174
+ ),
175
+ /* @__PURE__ */ s(
176
+ "div",
177
+ {
178
+ className: "absolute w-5 h-5 bg-white border-2 border-primary rounded-full shadow-lg cursor-ne-resize -bottom-2.5 -right-2.5 hover:bg-primary hover:border-white transition-colors flex items-center justify-center",
179
+ onMouseDown: (e) => {
180
+ e.stopPropagation(), p(e, "resize");
181
+ },
182
+ children: /* @__PURE__ */ s("div", { className: "w-1.5 h-1.5 bg-primary rounded-full hover:bg-white transition-colors" })
183
+ }
184
+ ),
185
+ /* @__PURE__ */ s(
186
+ "div",
187
+ {
188
+ className: "absolute w-5 h-5 bg-white border-2 border-primary rounded-full shadow-lg cursor-sw-resize -bottom-2.5 -left-2.5 hover:bg-primary hover:border-white transition-colors flex items-center justify-center",
189
+ onMouseDown: (e) => {
190
+ e.stopPropagation(), p(e, "resize");
191
+ },
192
+ children: /* @__PURE__ */ s("div", { className: "w-1.5 h-1.5 bg-primary rounded-full hover:bg-white transition-colors" })
193
+ }
194
+ ),
195
+ /* @__PURE__ */ s(
196
+ "div",
197
+ {
198
+ className: "absolute w-5 h-5 bg-white border-2 border-primary rounded-full shadow-lg cursor-se-resize -top-2.5 -left-2.5 hover:bg-primary hover:border-white transition-colors flex items-center justify-center",
199
+ onMouseDown: (e) => {
200
+ e.stopPropagation(), p(e, "resize");
201
+ },
202
+ children: /* @__PURE__ */ s("div", { className: "w-1.5 h-1.5 bg-primary rounded-full hover:bg-white transition-colors" })
203
+ }
204
+ )
205
+ ]
206
+ }
207
+ ),
208
+ /* @__PURE__ */ s(
209
+ "div",
210
+ {
211
+ className: "absolute inset-0 bg-black/50 pointer-events-none",
212
+ style: {
213
+ clipPath: `circle(${t.size / 2}px at ${t.x + t.size / 2}px ${t.y + t.size / 2}px)`
214
+ }
215
+ }
216
+ )
217
+ ]
218
+ }
219
+ ) }),
220
+ /* @__PURE__ */ s("div", { className: "flex justify-center", children: /* @__PURE__ */ d("div", { className: "text-center", children: [
221
+ /* @__PURE__ */ s(T, { className: "text-xs font-medium text-muted-foreground mb-2 block", children: "Preview" }),
222
+ /* @__PURE__ */ s(
223
+ "div",
224
+ {
225
+ className: "rounded-full border-2 border-border bg-background overflow-hidden mx-auto",
226
+ style: { width: 80, height: 80 },
227
+ children: /* @__PURE__ */ s(
228
+ "div",
229
+ {
230
+ className: "w-full h-full bg-gray-100",
231
+ style: {
232
+ backgroundImage: `url(${f})`,
233
+ backgroundSize: `${r.width / t.size * 80}px ${r.height / t.size * 80}px`,
234
+ backgroundPosition: `-${t.x / t.size * 80}px -${t.y / t.size * 80}px`,
235
+ backgroundRepeat: "no-repeat"
236
+ }
237
+ }
238
+ )
239
+ }
240
+ )
241
+ ] }) })
242
+ ] }),
243
+ /* @__PURE__ */ s("canvas", { ref: D, className: "hidden" })
244
+ ] })
245
+ }
246
+ ) : null;
247
+ }
248
+ export {
249
+ O as ImageCropperModal
250
+ };
@@ -1,2 +1,130 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../jsx-runtime-BYECrxsp.cjs"),r=require("react"),p=require("./button.js"),i=require("lucide-react"),w=require("./image-cropper-modal.js"),I=require("../utils-DSKoFOjv.cjs");function M({value:c,onChange:n,size:a=120,className:j,placeholder:g="Upload Image",title:h="Crop Your Image",outputSize:R=200}){const[f,u]=r.useState(!1),[b,l]=r.useState(null),o=r.useRef(null),E=r.useCallback(t=>{var m;const s=(m=t.target.files)==null?void 0:m[0];if(s){const x=new FileReader;x.onload=y=>{var d;const k=(d=y.target)==null?void 0:d.result;l(k),u(!0)},x.readAsDataURL(s)}t.target.value=""},[]),C=r.useCallback(t=>{n(t),l(null)},[n]),v=r.useCallback(()=>{u(!1),l(null),o.current&&(o.current.value="")},[]),N=r.useCallback(()=>{n(null)},[n]);return e.jsxRuntimeExports.jsxs(e.jsxRuntimeExports.Fragment,{children:[e.jsxRuntimeExports.jsxs("div",{className:I.cn("space-y-3",j),children:[c?e.jsxRuntimeExports.jsxs("div",{className:"flex flex-col items-center gap-3",children:[e.jsxRuntimeExports.jsx("div",{className:"rounded-full border-2 border-border overflow-hidden bg-background",style:{width:a,height:a},children:e.jsxRuntimeExports.jsx("img",{src:c,alt:"Agent avatar",className:"w-full h-full object-cover"})}),e.jsxRuntimeExports.jsxs("div",{className:"flex gap-2",children:[e.jsxRuntimeExports.jsxs(p.Button,{variant:"outline",size:"sm",onClick:t=>{var s;t.stopPropagation(),(s=o.current)==null||s.click()},children:[e.jsxRuntimeExports.jsx(i.RotateCw,{className:"h-3 w-3 mr-1"}),"Replace"]}),e.jsxRuntimeExports.jsxs(p.Button,{variant:"outline",size:"sm",onClick:N,children:[e.jsxRuntimeExports.jsx(i.X,{className:"h-3 w-3 mr-1"}),"Remove"]})]})]}):e.jsxRuntimeExports.jsxs("button",{onClick:t=>{var s;t.stopPropagation(),(s=o.current)==null||s.click()},className:"w-full border-2 border-dashed border-border/50 rounded-lg p-6 hover:border-primary/50 hover:bg-primary/2 transition-colors group",children:[e.jsxRuntimeExports.jsx("div",{className:"mx-auto rounded-full bg-primary/10 flex items-center justify-center group-hover:bg-primary/15 transition-colors mb-3",style:{width:Math.min(a/2,60),height:Math.min(a/2,60)},children:e.jsxRuntimeExports.jsx(i.Upload,{className:"h-6 w-6 text-primary"})}),e.jsxRuntimeExports.jsx("p",{className:"text-sm font-medium text-foreground mb-1",children:g}),e.jsxRuntimeExports.jsx("p",{className:"text-xs text-muted-foreground",children:"Click to browse"})]}),e.jsxRuntimeExports.jsx("input",{ref:o,type:"file",accept:"image/*",onChange:E,className:"hidden"})]}),e.jsxRuntimeExports.jsx(w.ImageCropperModal,{isOpen:f,onClose:v,imageSrc:b,onCrop:C,title:h,outputSize:R})]})}exports.ImageCropper=M;
2
- //# sourceMappingURL=image-cropper.js.map
1
+ import { jsxs as t, Fragment as j, jsx as e } from "react/jsx-runtime";
2
+ import { useState as f, useRef as S, useCallback as i } from "react";
3
+ import { Button as h } from "./button.js";
4
+ import { RotateCw as F, X as O, Upload as U } from "lucide-react";
5
+ import { ImageCropperModal as A } from "./image-cropper-modal.js";
6
+ import { cn as E } from "../lib/utils.js";
7
+ function Y({
8
+ value: c,
9
+ onChange: a,
10
+ size: n = 120,
11
+ className: g,
12
+ placeholder: b = "Upload Image",
13
+ title: v = "Crop Your Image",
14
+ outputSize: x = 200
15
+ }) {
16
+ const [C, d] = f(!1), [N, s] = f(null), l = S(null), w = i((r) => {
17
+ var m;
18
+ const o = (m = r.target.files) == null ? void 0 : m[0];
19
+ if (o) {
20
+ const p = new FileReader();
21
+ p.onload = (R) => {
22
+ var u;
23
+ const M = (u = R.target) == null ? void 0 : u.result;
24
+ s(M), d(!0);
25
+ }, p.readAsDataURL(o);
26
+ }
27
+ r.target.value = "";
28
+ }, []), y = i((r) => {
29
+ a(r), s(null);
30
+ }, [a]), k = i(() => {
31
+ d(!1), s(null), l.current && (l.current.value = "");
32
+ }, []), I = i(() => {
33
+ a(null);
34
+ }, [a]);
35
+ return /* @__PURE__ */ t(j, { children: [
36
+ /* @__PURE__ */ t("div", { className: E("space-y-3", g), children: [
37
+ c ? /* @__PURE__ */ t("div", { className: "flex flex-col items-center gap-3", children: [
38
+ /* @__PURE__ */ e(
39
+ "div",
40
+ {
41
+ className: "rounded-full border-2 border-border/50 overflow-hidden bg-background",
42
+ style: { width: n, height: n },
43
+ children: /* @__PURE__ */ e(
44
+ "img",
45
+ {
46
+ src: c,
47
+ alt: "Agent avatar",
48
+ className: "w-full h-full object-cover"
49
+ }
50
+ )
51
+ }
52
+ ),
53
+ /* @__PURE__ */ t("div", { className: "flex gap-2", children: [
54
+ /* @__PURE__ */ t(
55
+ h,
56
+ {
57
+ variant: "outline",
58
+ size: "sm",
59
+ onClick: (r) => {
60
+ var o;
61
+ r.stopPropagation(), (o = l.current) == null || o.click();
62
+ },
63
+ children: [
64
+ /* @__PURE__ */ e(F, { className: "h-3 w-3 mr-1" }),
65
+ "Replace"
66
+ ]
67
+ }
68
+ ),
69
+ /* @__PURE__ */ t(
70
+ h,
71
+ {
72
+ variant: "outline",
73
+ size: "sm",
74
+ onClick: I,
75
+ children: [
76
+ /* @__PURE__ */ e(O, { className: "h-3 w-3 mr-1" }),
77
+ "Remove"
78
+ ]
79
+ }
80
+ )
81
+ ] })
82
+ ] }) : /* @__PURE__ */ t(
83
+ "button",
84
+ {
85
+ onClick: (r) => {
86
+ var o;
87
+ r.stopPropagation(), (o = l.current) == null || o.click();
88
+ },
89
+ className: "w-full border-2 border-dashed border-border/50 rounded-lg p-6 hover:border-primary/50 hover:bg-primary/2 transition-colors group",
90
+ children: [
91
+ /* @__PURE__ */ e(
92
+ "div",
93
+ {
94
+ className: "mx-auto rounded-full bg-primary/10 flex items-center justify-center group-hover:bg-primary/15 transition-colors mb-3",
95
+ style: { width: Math.min(n / 2, 60), height: Math.min(n / 2, 60) },
96
+ children: /* @__PURE__ */ e(U, { className: "h-6 w-6 text-primary" })
97
+ }
98
+ ),
99
+ /* @__PURE__ */ e("p", { className: "text-sm font-medium text-foreground mb-1", children: b }),
100
+ /* @__PURE__ */ e("p", { className: "text-xs text-muted-foreground", children: "Click to browse" })
101
+ ]
102
+ }
103
+ ),
104
+ /* @__PURE__ */ e(
105
+ "input",
106
+ {
107
+ ref: l,
108
+ type: "file",
109
+ accept: "image/*",
110
+ onChange: w,
111
+ className: "hidden"
112
+ }
113
+ )
114
+ ] }),
115
+ /* @__PURE__ */ e(
116
+ A,
117
+ {
118
+ isOpen: C,
119
+ onClose: k,
120
+ imageSrc: N,
121
+ onCrop: y,
122
+ title: v,
123
+ outputSize: x
124
+ }
125
+ )
126
+ ] });
127
+ }
128
+ export {
129
+ Y as ImageCropper
130
+ };
@@ -1,2 +1,21 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const i=require("../jsx-runtime-BYECrxsp.cjs"),s=require("react"),u=require("../utils-DSKoFOjv.cjs");function l(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const n=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,n.get?n:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const c=l(s),o=c.forwardRef(({className:e,type:r,...t},n)=>i.jsxRuntimeExports.jsx("input",{type:r,className:u.cn("flex h-10 w-full rounded-md border border-border bg-background px-3 py-2 text-sm ring-offset-background file:border-0 file:bg-transparent file:text-sm file:font-medium placeholder:text-muted-foreground focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 disabled:cursor-not-allowed disabled:opacity-50",e),ref:n,...t}));o.displayName="Input";exports.Input=o;
2
- //# sourceMappingURL=input.js.map
1
+ import { jsx as a } from "react/jsx-runtime";
2
+ import * as d from "react";
3
+ import { cn as i } from "../lib/utils.js";
4
+ const l = d.forwardRef(
5
+ ({ className: r, type: o, ...e }, t) => /* @__PURE__ */ a(
6
+ "input",
7
+ {
8
+ type: o,
9
+ className: i(
10
+ "h-10 w-full rounded-lg border-2 border-gray-300 bg-white px-4 py-2 text-sm outline-none transition-colors placeholder:text-gray-400 focus:border-primary disabled:cursor-not-allowed disabled:opacity-50",
11
+ r
12
+ ),
13
+ ref: t,
14
+ ...e
15
+ }
16
+ )
17
+ );
18
+ l.displayName = "Input";
19
+ export {
20
+ l as Input
21
+ };
@@ -1,2 +1,19 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const s=require("../jsx-runtime-BYECrxsp.cjs"),c=require("react"),l=require("@radix-ui/react-label"),u=require("../utils-DSKoFOjv.cjs");function a(e){const r=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});if(e){for(const t in e)if(t!=="default"){const o=Object.getOwnPropertyDescriptor(e,t);Object.defineProperty(r,t,o.get?o:{enumerable:!0,get:()=>e[t]})}}return r.default=e,Object.freeze(r)}const d=a(c),n=a(l),i=d.forwardRef(({className:e,...r},t)=>s.jsxRuntimeExports.jsx(n.Root,{ref:t,className:u.cn("text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",e),...r}));i.displayName=n.Root.displayName;exports.Label=i;
2
- //# sourceMappingURL=label.js.map
1
+ import { jsx as m } from "react/jsx-runtime";
2
+ import * as t from "react";
3
+ import * as o from "@radix-ui/react-label";
4
+ import { cn as i } from "../lib/utils.js";
5
+ const s = t.forwardRef(({ className: e, ...a }, r) => /* @__PURE__ */ m(
6
+ o.Root,
7
+ {
8
+ ref: r,
9
+ className: i(
10
+ "text-sm font-medium leading-none peer-disabled:cursor-not-allowed peer-disabled:opacity-70",
11
+ e
12
+ ),
13
+ ...a
14
+ }
15
+ ));
16
+ s.displayName = o.Root.displayName;
17
+ export {
18
+ s as Label
19
+ };
@@ -1,2 +1,69 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../jsx-runtime-BYECrxsp.cjs"),s=require("framer-motion");function u({size:n="md",fullScreen:a=!1,center:r=!1,loadingText:o="Initializing App",loadingTextDescription:l="Setting up your workspace...",isDark:c=!1}){const m={sm:"w-1 h-1",md:"w-1.5 h-1.5",lg:"w-2 h-2"},d={sm:"gap-0.5",md:"gap-1",lg:"gap-1.5"},x={hidden:{opacity:0,y:20},visible:t=>({opacity:1,y:0,transition:{delay:t*.1,duration:.5,repeat:1/0,repeatType:"reverse"}})},i=e.jsxRuntimeExports.jsx("div",{className:`flex items-center ${d[n]}`,children:[0,1,2].map(t=>e.jsxRuntimeExports.jsx(s.motion.div,{custom:t,variants:x,initial:"hidden",animate:"visible",className:`${m[n]} rounded-full ${c?"bg-primary/80":"bg-primary/60"}`},t))});return a?e.jsxRuntimeExports.jsx("div",{className:"fixed inset-0 bg-background flex items-center justify-center z-[9999]",children:e.jsxRuntimeExports.jsxs(s.motion.div,{className:"text-center",initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},transition:{duration:.3},children:[e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-center gap-2 mb-6",children:i}),e.jsxRuntimeExports.jsxs(s.motion.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},transition:{delay:.3,duration:.3},children:[e.jsxRuntimeExports.jsx("h2",{className:"text-lg font-medium mb-2",children:o}),e.jsxRuntimeExports.jsx("p",{className:"text-sm text-muted-foreground",children:l})]})]})}):r?e.jsxRuntimeExports.jsx("div",{className:"flex items-center justify-center w-full h-full min-h-[200px]",children:i}):i}exports.Loader=u;
2
- //# sourceMappingURL=loader.js.map
1
+ import { jsx as e, jsxs as r } from "react/jsx-runtime";
2
+ import { motion as a } from "framer-motion";
3
+ function h({
4
+ size: n = "md",
5
+ fullScreen: s = !1,
6
+ center: l = !1,
7
+ loadingText: c = "Initializing App",
8
+ loadingTextDescription: d = "Setting up your workspace...",
9
+ isDark: m = !1
10
+ }) {
11
+ const o = {
12
+ sm: "w-1 h-1",
13
+ md: "w-1.5 h-1.5",
14
+ lg: "w-2 h-2"
15
+ }, p = {
16
+ sm: "gap-0.5",
17
+ md: "gap-1",
18
+ lg: "gap-1.5"
19
+ }, f = {
20
+ hidden: { opacity: 0, y: 20 },
21
+ visible: (i) => ({
22
+ opacity: 1,
23
+ y: 0,
24
+ transition: {
25
+ delay: i * 0.1,
26
+ duration: 0.5,
27
+ repeat: 1 / 0,
28
+ repeatType: "reverse"
29
+ }
30
+ })
31
+ }, t = /* @__PURE__ */ e("div", { className: `flex items-center ${p[n]}`, children: [0, 1, 2].map((i) => /* @__PURE__ */ e(
32
+ a.div,
33
+ {
34
+ custom: i,
35
+ variants: f,
36
+ initial: "hidden",
37
+ animate: "visible",
38
+ className: `${o[n]} rounded-full ${m ? "bg-primary/80" : "bg-primary/60"}`
39
+ },
40
+ i
41
+ )) });
42
+ return s ? /* @__PURE__ */ e("div", { className: "fixed inset-0 bg-background flex items-center justify-center z-[9999]", children: /* @__PURE__ */ r(
43
+ a.div,
44
+ {
45
+ className: "text-center",
46
+ initial: { opacity: 0, scale: 0.9 },
47
+ animate: { opacity: 1, scale: 1 },
48
+ transition: { duration: 0.3 },
49
+ children: [
50
+ /* @__PURE__ */ e("div", { className: "flex items-center justify-center gap-2 mb-6", children: t }),
51
+ /* @__PURE__ */ r(
52
+ a.div,
53
+ {
54
+ initial: { opacity: 0, y: 10 },
55
+ animate: { opacity: 1, y: 0 },
56
+ transition: { delay: 0.3, duration: 0.3 },
57
+ children: [
58
+ /* @__PURE__ */ e("h2", { className: "text-lg font-medium mb-2", children: c }),
59
+ /* @__PURE__ */ e("p", { className: "text-sm text-muted-foreground", children: d })
60
+ ]
61
+ }
62
+ )
63
+ ]
64
+ }
65
+ ) }) : l ? /* @__PURE__ */ e("div", { className: "flex items-center justify-center w-full h-full min-h-[200px]", children: t }) : t;
66
+ }
67
+ export {
68
+ h as Loader
69
+ };
@@ -1,2 +1,24 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("../jsx-runtime-BYECrxsp.cjs"),s=require("../utils-DSKoFOjv.cjs");function a({className:o,count:i=1,animate:r=!0,variant:t="shimmer"}){return e.jsxRuntimeExports.jsx(e.jsxRuntimeExports.Fragment,{children:Array.from({length:i}).map((l,n)=>e.jsxRuntimeExports.jsx("div",{className:s.cn("relative overflow-hidden bg-muted/30 rounded",r&&t==="shimmer"&&"before:absolute before:inset-0 before:-translate-x-full before:animate-[shimmer_2s_infinite] before:bg-gradient-to-r before:from-transparent before:via-white/10 before:to-transparent",r&&t==="pulse"&&"animate-pulse",o)},n))})}exports.LoadingPlaceholder=a;
2
- //# sourceMappingURL=loading-placeholder.js.map
1
+ import { jsx as o, Fragment as a } from "react/jsx-runtime";
2
+ import { cn as m } from "../lib/utils.js";
3
+ function b({
4
+ className: t,
5
+ count: n = 1,
6
+ animate: e = !0,
7
+ variant: r = "shimmer"
8
+ }) {
9
+ return /* @__PURE__ */ o(a, { children: Array.from({ length: n }).map((f, i) => /* @__PURE__ */ o(
10
+ "div",
11
+ {
12
+ className: m(
13
+ "relative overflow-hidden bg-muted/30 rounded",
14
+ e && r === "shimmer" && "before:absolute before:inset-0 before:-translate-x-full before:animate-[shimmer_2s_infinite] before:bg-gradient-to-r before:from-transparent before:via-white/10 before:to-transparent",
15
+ e && r === "pulse" && "animate-pulse",
16
+ t
17
+ )
18
+ },
19
+ i
20
+ )) });
21
+ }
22
+ export {
23
+ b as LoadingPlaceholder
24
+ };