@uselets/ui 0.5.0 → 0.6.1

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 (202) hide show
  1. package/README.md +73 -6
  2. package/dist/chunk-CHh1Zzun.js +1 -0
  3. package/dist/cli/uselets.mjs +7 -0
  4. package/dist/cli/uselets.mjs.map +1 -0
  5. package/dist/components/accordion.d.ts +6 -6
  6. package/dist/components/accordion.js +1 -1
  7. package/dist/components/accordion.js.map +1 -1
  8. package/dist/components/alert-dialog.d.ts +14 -14
  9. package/dist/components/alert-dialog.js +1 -1
  10. package/dist/components/alert.d.ts +8 -8
  11. package/dist/components/alert.js +1 -1
  12. package/dist/components/anchor.d.ts +5 -5
  13. package/dist/components/anchor.js +1 -1
  14. package/dist/components/avatar.d.ts +8 -8
  15. package/dist/components/avatar.js +1 -1
  16. package/dist/components/badge.d.ts +5 -5
  17. package/dist/components/badge.js +1 -1
  18. package/dist/components/breadcrumb.d.ts +9 -9
  19. package/dist/components/breadcrumb.js +1 -1
  20. package/dist/components/breadcrumb.js.map +1 -1
  21. package/dist/components/button-group.d.ts +7 -7
  22. package/dist/components/button-group.js +1 -1
  23. package/dist/components/button.d.ts +5 -5
  24. package/dist/components/button.js +1 -1
  25. package/dist/components/calendar.d.ts +6 -5
  26. package/dist/components/calendar.js +1 -1
  27. package/dist/components/calendar.js.map +1 -1
  28. package/dist/components/card.d.ts +9 -9
  29. package/dist/components/card.js +1 -1
  30. package/dist/components/carousel.d.ts +7 -7
  31. package/dist/components/carousel.js +1 -1
  32. package/dist/components/center.d.ts +5 -5
  33. package/dist/components/center.js +1 -1
  34. package/dist/components/chart.d.ts +90 -90
  35. package/dist/components/chart.js +1 -1
  36. package/dist/components/chart.js.map +1 -1
  37. package/dist/components/checkbox.d.ts +5 -5
  38. package/dist/components/checkbox.js +1 -1
  39. package/dist/components/code.d.ts +3 -3
  40. package/dist/components/code.js +1 -1
  41. package/dist/components/collapsible.d.ts +5 -5
  42. package/dist/components/collapsible.js +1 -1
  43. package/dist/components/collapsible.js.map +1 -1
  44. package/dist/components/combobox.d.ts +17 -17
  45. package/dist/components/combobox.js +1 -1
  46. package/dist/components/command.d.ts +11 -11
  47. package/dist/components/command.js +1 -1
  48. package/dist/components/command.js.map +1 -1
  49. package/dist/components/container.d.ts +5 -5
  50. package/dist/components/container.js +1 -1
  51. package/dist/components/dialog.d.ts +14 -14
  52. package/dist/components/dialog.js +1 -1
  53. package/dist/components/drawer.d.ts +14 -14
  54. package/dist/components/drawer.js +1 -1
  55. package/dist/components/dropdown-menu.d.ts +17 -17
  56. package/dist/components/dropdown-menu.js +1 -1
  57. package/dist/components/dropzone.d.ts +3 -3
  58. package/dist/components/dropzone.js +1 -1
  59. package/dist/components/dropzone.js.map +1 -1
  60. package/dist/components/empty.d.ts +10 -10
  61. package/dist/components/empty.js +1 -1
  62. package/dist/components/field.d.ts +14 -14
  63. package/dist/components/field.js +1 -1
  64. package/dist/components/group.d.ts +5 -5
  65. package/dist/components/group.js +1 -1
  66. package/dist/components/heading.d.ts +5 -5
  67. package/dist/components/heading.js +1 -1
  68. package/dist/components/hover-card.d.ts +5 -5
  69. package/dist/components/hover-card.js +1 -1
  70. package/dist/components/hover-card.js.map +1 -1
  71. package/dist/components/input-group.d.ts +11 -11
  72. package/dist/components/input-group.js +1 -1
  73. package/dist/components/input-otp.d.ts +6 -6
  74. package/dist/components/input-otp.js +1 -1
  75. package/dist/components/input-otp.js.map +1 -1
  76. package/dist/components/input.d.ts +3 -3
  77. package/dist/components/input.js +1 -1
  78. package/dist/components/kbd.d.ts +4 -4
  79. package/dist/components/kbd.js +1 -1
  80. package/dist/components/label.d.ts +3 -3
  81. package/dist/components/label.js +1 -1
  82. package/dist/components/list.d.ts +7 -7
  83. package/dist/components/list.js +1 -1
  84. package/dist/components/list.js.map +1 -1
  85. package/dist/components/native-select.d.ts +5 -5
  86. package/dist/components/native-select.js +1 -1
  87. package/dist/components/navigation-menu.d.ts +12 -12
  88. package/dist/components/navigation-menu.js +1 -1
  89. package/dist/components/navigation-menu.js.map +1 -1
  90. package/dist/components/pagination.d.ts +9 -9
  91. package/dist/components/pagination.js +1 -1
  92. package/dist/components/popover.d.ts +9 -9
  93. package/dist/components/popover.js +1 -1
  94. package/dist/components/progress.d.ts +3 -3
  95. package/dist/components/progress.js +1 -1
  96. package/dist/components/radio-group.d.ts +4 -4
  97. package/dist/components/radio-group.js +1 -1
  98. package/dist/components/resizable.d.ts +5 -5
  99. package/dist/components/resizable.js +1 -1
  100. package/dist/components/scroll-area.d.ts +4 -4
  101. package/dist/components/scroll-area.js +1 -1
  102. package/dist/components/select.d.ts +12 -12
  103. package/dist/components/select.js +1 -1
  104. package/dist/components/separator.d.ts +3 -3
  105. package/dist/components/separator.js +1 -1
  106. package/dist/components/sheet.d.ts +12 -12
  107. package/dist/components/sheet.js +1 -1
  108. package/dist/components/sheet.js.map +1 -1
  109. package/dist/components/sidebar.d.ts +27 -27
  110. package/dist/components/sidebar.js +1 -1
  111. package/dist/components/skeleton.d.ts +3 -3
  112. package/dist/components/skeleton.js +1 -1
  113. package/dist/components/slider.d.ts +3 -3
  114. package/dist/components/slider.js +1 -1
  115. package/dist/components/sonner.d.ts +3 -3
  116. package/dist/components/sonner.js +1 -1
  117. package/dist/components/sonner.js.map +1 -1
  118. package/dist/components/spinner.d.ts +5 -5
  119. package/dist/components/spinner.js +1 -1
  120. package/dist/components/stack.d.ts +5 -5
  121. package/dist/components/stack.js +1 -1
  122. package/dist/components/switch.d.ts +3 -3
  123. package/dist/components/switch.js +1 -1
  124. package/dist/components/table.d.ts +10 -10
  125. package/dist/components/table.js +1 -1
  126. package/dist/components/table.js.map +1 -1
  127. package/dist/components/tabs.d.ts +8 -8
  128. package/dist/components/tabs.js +1 -1
  129. package/dist/components/tabs.js.map +1 -1
  130. package/dist/components/text.d.ts +5 -5
  131. package/dist/components/text.js +1 -1
  132. package/dist/components/textarea.d.ts +3 -3
  133. package/dist/components/textarea.js +1 -1
  134. package/dist/components/theme.d.ts +4 -4
  135. package/dist/components/theme.js +1 -1
  136. package/dist/components/timeline.d.ts +5 -5
  137. package/dist/components/timeline.js +1 -1
  138. package/dist/components/timeline.js.map +1 -1
  139. package/dist/components/toggle-group.d.ts +4 -4
  140. package/dist/components/toggle-group.js +1 -1
  141. package/dist/components/toggle.d.ts +5 -5
  142. package/dist/components/toggle.js +1 -1
  143. package/dist/components/tooltip.d.ts +6 -6
  144. package/dist/components/tooltip.js +1 -1
  145. package/dist/hooks/use-disclosure.d.ts +23 -0
  146. package/dist/hooks/use-disclosure.js +2 -0
  147. package/dist/hooks/use-disclosure.js.map +1 -0
  148. package/dist/hooks/use-disclosure.spec.d.ts +1 -0
  149. package/dist/hooks/use-disclosure.spec.js +2 -0
  150. package/dist/hooks/use-disclosure.spec.js.map +1 -0
  151. package/dist/hooks/use-document-visibility.d.ts +7 -0
  152. package/dist/hooks/use-document-visibility.js +2 -0
  153. package/dist/hooks/use-document-visibility.js.map +1 -0
  154. package/dist/hooks/use-document-visibility.spec.d.ts +1 -0
  155. package/dist/hooks/use-document-visibility.spec.js +2 -0
  156. package/dist/hooks/use-document-visibility.spec.js.map +1 -0
  157. package/dist/hooks/use-idle.d.ts +14 -0
  158. package/dist/hooks/use-idle.js +2 -0
  159. package/dist/hooks/use-idle.js.map +1 -0
  160. package/dist/hooks/use-idle.spec.d.ts +1 -0
  161. package/dist/hooks/use-idle.spec.js +2 -0
  162. package/dist/hooks/use-idle.spec.js.map +1 -0
  163. package/dist/hooks/use-interval.d.ts +22 -0
  164. package/dist/hooks/use-interval.js +2 -0
  165. package/dist/hooks/use-interval.js.map +1 -0
  166. package/dist/hooks/use-interval.spec.d.ts +1 -0
  167. package/dist/hooks/use-interval.spec.js +2 -0
  168. package/dist/hooks/use-interval.spec.js.map +1 -0
  169. package/dist/hooks/use-local-storage.d.ts +17 -0
  170. package/dist/hooks/use-local-storage.js +2 -0
  171. package/dist/hooks/use-local-storage.js.map +1 -0
  172. package/dist/hooks/use-local-storage.spec.d.ts +1 -0
  173. package/dist/hooks/use-local-storage.spec.js +2 -0
  174. package/dist/hooks/use-local-storage.spec.js.map +1 -0
  175. package/dist/hooks/use-mobile.d.ts +1 -1
  176. package/dist/hooks/use-mobile.js +1 -1
  177. package/dist/hooks/use-mobile.spec.d.ts +1 -0
  178. package/dist/hooks/use-mobile.spec.js +2 -0
  179. package/dist/hooks/use-mobile.spec.js.map +1 -0
  180. package/dist/index.d.ts +8 -3
  181. package/dist/index.js +1 -1
  182. package/dist/lib/button.d.ts +1 -1
  183. package/dist/lib/utils.d.ts +3 -2
  184. package/dist/lib/utils.js +1 -1
  185. package/dist/lib/utils.js.map +1 -1
  186. package/dist/react.esm-BuxkFT_p.js +59 -0
  187. package/dist/react.esm-BuxkFT_p.js.map +1 -0
  188. package/dist/skills/uselets-ui/SKILL.md +72 -0
  189. package/dist/skills/uselets-ui/agents/openai.yaml +4 -0
  190. package/dist/skills/uselets-ui/references/component-catalog.md +202 -0
  191. package/dist/skills/uselets-ui/references/package-guide.md +264 -0
  192. package/dist/skills/uselets-ui/scripts/print-public-api.mjs +174 -0
  193. package/dist/styles.css +2 -1437
  194. package/dist/themes/gomax.css +2 -0
  195. package/dist/themes/max.css +2 -0
  196. package/package.json +42 -27
  197. package/skills/uselets-ui/SKILL.md +72 -0
  198. package/skills/uselets-ui/agents/openai.yaml +4 -0
  199. package/skills/uselets-ui/references/component-catalog.md +202 -0
  200. package/skills/uselets-ui/references/package-guide.md +264 -0
  201. package/skills/uselets-ui/scripts/print-public-api.mjs +174 -0
  202. package/dist/chunk-IpJEthwI.js +0 -1
@@ -1,6 +1,6 @@
1
- import { t as __name } from "../chunk-IpJEthwI.js";
1
+ import { n as __name } from "../chunk-CHh1Zzun.js";
2
2
  import { ButtonProps } from "./button.js";
3
- import * as react_jsx_runtime0 from "react/jsx-runtime";
3
+ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
4
4
  import * as React from "react";
5
5
  import { Accept, ErrorCode, FileError, useDropzone as useDropzone$1 } from "react-dropzone";
6
6
 
@@ -88,7 +88,7 @@ declare function useDropzone<TUploadResult, TUploadError = string>(props: UseDro
88
88
  declare function Dropzone<TUploadResult, TUploadError>({
89
89
  children,
90
90
  ...dropzone
91
- }: DropzoneProps<TUploadResult, TUploadError>): react_jsx_runtime0.JSX.Element;
91
+ }: DropzoneProps<TUploadResult, TUploadError>): _$react_jsx_runtime0.JSX.Element;
92
92
  declare namespace Dropzone {
93
93
  var displayName: string;
94
94
  }
@@ -1,2 +1,2 @@
1
- import"../chunk-IpJEthwI.js";import{cn as e}from"../lib/utils.js";import{Button as t}from"./button.js";import{jsx as n,jsxs as r}from"react/jsx-runtime";import*as i from"react";import{ErrorCode as a,useDropzone as o}from"react-dropzone";const s=[a.FileInvalidType,a.FileTooLarge,a.FileTooSmall,a.TooManyFiles],c=new Set(s),l={pending:`indeterminate`,success:`100%`,error:`error`},u=i.createContext(null),d=i.createContext(null);function fileStatusReducer(e,t){switch(t.type){case`add`:return[...e,{id:t.id,fileName:t.fileName,file:t.file,status:`pending`,tries:1}];case`remove`:return e.filter(e=>e.id!==t.id);case`update-status`:return e.map(e=>e.id===t.id?t.status===`pending`?{...e,status:`pending`,error:void 0,message:void 0,result:void 0,tries:e.tries+1}:t.status===`error`?{...e,status:`error`,error:t.error,message:t.message,result:void 0}:{...e,status:`success`,result:t.result,error:void 0,message:void 0}:e)}}function formatAcceptedTypes(e){if(!e)return;let t=Object.entries(e).flatMap(([e,t])=>t.length>0?t:[e]);return t.length>0?t.join(`, `):void 0}function getDropzoneErrorCodes(e){let t=e.flatMap(e=>e.errors.map(e=>e.code).filter(e=>c.has(e)));return Array.from(new Set(t))}function getRootError(e,t){let n=e.flatMap(e=>{switch(e){case`file-invalid-type`:{let e=formatAcceptedTypes(t.accept);return e?[`only ${e} files are allowed`]:[`this file type is not allowed`]}case`file-too-large`:return t.maxSize?[`max size is ${(t.maxSize/(1024*1024)).toFixed(2)} MB`]:[`this file is too large`];case`file-too-small`:return t.minSize?[`min size is ${(t.minSize/(1024*1024)).toFixed(2)} MB`]:[`this file is too small`];case`too-many-files`:return t.maxFiles?[`max ${t.maxFiles} files`]:[`too many files`];default:return[]}});if(n.length===0)return`Unable to add the selected files`;let[r,...i]=n;return`${r.charAt(0).toUpperCase()}${r.slice(1)}${i.length>0?`, ${i.join(`, `)}`:``}`}function getRejectionMessage(e,t){let n=getDropzoneErrorCodes(e);return n.length>0?getRootError(n,t):e[0]?.errors[0]?.message??`Unable to add the selected files`}function getUploadErrorMessage(e,t){if(t){let n=t(e);if(n!==void 0)return n}if(typeof e==`string`)return e;if(e instanceof Error)return e.message}function setRef(e,t){if(typeof e==`function`){e(t);return}e&&(e.current=t)}function composeRefs(...e){return t=>{e.forEach(e=>{setRef(e,t)})}}function useDropzoneContext(){let e=i.useContext(u);if(!e)throw Error(`Dropzone components must be used within a Dropzone.`);return e}function useDropzoneFileListContext(){let e=i.useContext(d);if(!e)throw Error(`Dropzone file actions must be used within a DropzoneFileListItem.`);return e}function useDropzone(e){let{onDropFile:t,onRemoveFile:n,shapeUploadError:r,onFileUploaded:s,onFileUploadError:c,onAllUploaded:l,onRootError:u,maxRetryCount:d,autoRetry:f=!1,validation:p,shiftOnMaxFiles:m=!1}=e,h=i.useId(),g=`${h}-message`,_=`${h}-description`,[v,y]=i.useState(void 0),b=i.useCallback(e=>{y(e),u?.(e)},[u]),[x,S]=i.useReducer(fileStatusReducer,[]),C=i.useCallback(e=>`${h}-${e}-message`,[h]),w=i.useMemo(()=>v!==void 0||x.some(e=>e.status===`error`),[x,v]),T=i.useCallback(async(e,n,i=0)=>{try{let a=await t(e);if(a.status===`error`){if(f&&i<(d??1/0))return S({type:`update-status`,id:n,status:`pending`}),T(e,n,i+1);S({type:`update-status`,id:n,status:`error`,error:a.error,message:getUploadErrorMessage(a.error,r)}),c?.(a.error);return}S({type:`update-status`,id:n,status:`success`,result:a.result}),s?.(a.result)}catch(e){let t=e;S({type:`update-status`,id:n,status:`error`,error:t,message:getUploadErrorMessage(t,r)}),c?.(t)}},[f,t,d,c,s,r]),E=i.useCallback(async e=>{await n?.(e),S({type:`remove`,id:e})},[n]),D=i.useCallback(e=>{let t=x.find(t=>t.id===e);return t?.status===`error`&&t.tries<=(d??1/0)},[x,d]),O=i.useCallback(async e=>{if(!D(e))return;let t=x.find(t=>t.id===e);!t||t.status!==`error`||(S({type:`update-status`,id:e,status:`pending`}),await T(t.file,e))},[D,x,T]),k=o({accept:p?.accept,minSize:p?.minSize,maxSize:p?.maxSize,maxFiles:p?.maxFiles,noClick:!0,noKeyboard:!0,onDropAccepted:async e=>{b(void 0);let t=e,n=p?.maxFiles??1/0,r=Number.isFinite(n)?Math.max(x.length+e.length-n,0):0;if(r>0)if(m){let n=x.slice(0,Math.min(r,x.length));await Promise.all(n.map(e=>E(e.id)));let i=r-n.length;i>0&&(t=e.slice(i))}else{b(getRootError([a.TooManyFiles],p??{}));let r=Math.max(n-x.length,0);t=e.slice(0,r)}t.length!==0&&(await Promise.all(t.map(async e=>{let t=crypto.randomUUID();S({type:`add`,id:t,fileName:e.name,file:e}),await T(e,t)})),l?.())},onDropRejected:e=>{b(getRejectionMessage(e,p??{}))}});return{getRootProps:k.getRootProps,getInputProps:k.getInputProps,open:k.open,onRemoveFile:E,onRetry:O,canRetry:D,fileStatuses:x,isInvalid:w,isDragActive:k.isDragActive,rootError:v,inputId:h,rootMessageId:g,rootDescriptionId:_,getFileMessageId:C}}function Dropzone({children:e,...t}){return n(u.Provider,{value:t,children:e})}const f=i.forwardRef(({className:t,children:i,...a},o)=>{let s=useDropzoneContext(),c=[s.rootDescriptionId,s.isInvalid?s.rootMessageId:void 0].filter(Boolean).join(` `)||void 0,{ref:l,...u}=s.getRootProps({...a,"data-slot":`dropzone-area`,"aria-describedby":c,"aria-invalid":s.isInvalid||void 0,className:e(`flex min-h-44 flex-col items-center justify-center gap-4 rounded-xl border border-dashed border-input bg-muted/20 px-6 py-8 text-center transition-colors`,s.isDragActive&&`border-primary bg-primary/5`,s.isInvalid&&`border-destructive bg-destructive/5`,t)}),d=s.getInputProps({id:s.inputId,className:`sr-only`,"aria-describedby":c,"aria-invalid":s.isInvalid,tabIndex:-1});return r(`div`,{...u,ref:composeRefs(o,l),children:[n(`input`,{...d}),i]})}),p=i.forwardRef(({className:t,...r},i)=>n(`p`,{ref:i,id:useDropzoneContext().rootDescriptionId,"data-slot":`dropzone-description`,className:e(`text-sm text-muted-foreground`,t),...r})),m=i.forwardRef(({className:t,...r},i)=>(useDropzoneContext(),n(`ol`,{ref:i,"data-slot":`dropzone-file-list`,className:e(`space-y-3`,t),...r}))),h=i.forwardRef(({className:t,file:r,children:a,...o},s)=>{let c=useDropzoneContext(),l=c.getFileMessageId(r.id),u=r.status===`error`,f=c.canRetry(r.id),p=i.useMemo(()=>({onRemoveFile:()=>c.onRemoveFile(r.id),onRetry:()=>c.onRetry(r.id),fileStatus:r,canRetry:f,dropzoneId:c.inputId,messageId:l}),[f,c,r,l]);return n(d.Provider,{value:p,children:n(`li`,{ref:s,"data-slot":`dropzone-file-item`,"data-status":r.status,"aria-describedby":u?l:void 0,className:e(`rounded-xl border bg-card px-4 py-3 shadow-xs`,r.status===`error`&&`border-destructive/50`,t),...o,children:a})})}),g=i.forwardRef(({className:t,children:r,...i},a)=>{let o=useDropzoneFileListContext(),s=o.fileStatus.status===`error`?o.fileStatus.message??String(o.fileStatus.error):r;return n(`p`,{ref:a,id:o.messageId,"data-slot":`dropzone-file-message`,className:e(`min-h-5 text-[0.8rem] font-medium`,o.fileStatus.status===`error`&&`text-destructive`,t),...i,children:s})}),_=i.forwardRef(({className:t,children:r,...i},a)=>{let o=useDropzoneContext(),s=o.rootError??r;return n(`p`,{ref:a,id:o.rootMessageId,"data-slot":`dropzone-message`,className:e(`min-h-5 text-[0.8rem] font-medium text-destructive`,t),...i,children:s})}),v=i.forwardRef(({className:r,onClick:a,size:o=`icon-sm`,type:s=`button`,variant:c=`ghost`,...l},u)=>{let d=useDropzoneFileListContext(),f=i.useCallback(e=>{a?.(e),!e.defaultPrevented&&d.onRemoveFile()},[d,a]);return n(t,{ref:u,"data-slot":`dropzone-remove-file`,className:e(r),onClick:f,size:o,type:s,variant:c,...l})}),y=i.forwardRef(({className:r,disabled:a,onClick:o,size:s=`icon-sm`,type:c=`button`,variant:l=`ghost`,...u},d)=>{let f=useDropzoneFileListContext(),p=a||!f.canRetry,m=i.useCallback(e=>{o?.(e),!(e.defaultPrevented||p)&&f.onRetry()},[f,p,o]);return n(t,{ref:d,"data-slot":`dropzone-retry-file`,className:e(r),disabled:p,onClick:m,size:s,type:c,variant:l,...u})}),b=i.forwardRef(({className:r,onClick:a,size:o=`sm`,type:s=`button`,variant:c=`subtle`,...l},u)=>{let d=useDropzoneContext(),f=[d.rootDescriptionId,d.isInvalid?d.rootMessageId:void 0].filter(Boolean).join(` `)||void 0,p=i.useCallback(e=>{a?.(e),!e.defaultPrevented&&d.open()},[d,a]);return n(t,{ref:u,"aria-controls":d.inputId,"aria-describedby":f,"aria-invalid":d.isInvalid||void 0,"data-slot":`dropzone-trigger`,className:e(r),onClick:p,size:o,type:s,variant:c,...l})}),x=i.forwardRef(({className:t,status:r,...i},a)=>{let o=r===`success`||r===`error`,s=r===`error`;return n(`div`,{ref:a,"aria-valuemax":100,"aria-valuemin":0,"aria-valuetext":l[r],"data-slot":`dropzone-progress`,"data-status":r,role:`progressbar`,className:e(`relative h-2 w-full overflow-hidden rounded-full bg-muted`,t),...i,children:n(`div`,{className:e(`h-full w-full rounded-full bg-primary transition-transform`,o?`translate-x-0`:`animate-infinite-progress`,s&&`bg-destructive`)})})});Dropzone.displayName=`Dropzone`,f.displayName=`DropzoneArea`,p.displayName=`DropzoneDescription`,m.displayName=`DropzoneFileList`,h.displayName=`DropzoneFileListItem`,g.displayName=`DropzoneFileMessage`,_.displayName=`DropzoneMessage`,v.displayName=`DropzoneRemoveFile`,y.displayName=`DropzoneRetryFile`,b.displayName=`DropzoneTrigger`,x.displayName=`InfiniteProgress`;export{Dropzone,f as DropzoneArea,p as DropzoneDescription,m as DropzoneFileList,h as DropzoneFileListItem,g as DropzoneFileMessage,_ as DropzoneMessage,v as DropzoneRemoveFile,y as DropzoneRetryFile,b as DropzoneTrigger,a as ErrorCode,x as InfiniteProgress,useDropzone};
1
+ import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{Button as t}from"./button.js";import{jsx as n,jsxs as r}from"react/jsx-runtime";import*as i from"react";import{ErrorCode as a,useDropzone as o}from"react-dropzone";const s=[a.FileInvalidType,a.FileTooLarge,a.FileTooSmall,a.TooManyFiles],c=new Set(s),l={pending:`indeterminate`,success:`100%`,error:`error`},u=i.createContext(null),d=i.createContext(null);function fileStatusReducer(e,t){switch(t.type){case`add`:return[...e,{id:t.id,fileName:t.fileName,file:t.file,status:`pending`,tries:1}];case`remove`:return e.filter(e=>e.id!==t.id);case`update-status`:return e.map(e=>e.id===t.id?t.status===`pending`?{...e,status:`pending`,error:void 0,message:void 0,result:void 0,tries:e.tries+1}:t.status===`error`?{...e,status:`error`,error:t.error,message:t.message,result:void 0}:{...e,status:`success`,result:t.result,error:void 0,message:void 0}:e)}}function formatAcceptedTypes(e){if(!e)return;let t=Object.entries(e).flatMap(([e,t])=>t.length>0?t:[e]);return t.length>0?t.join(`, `):void 0}function getDropzoneErrorCodes(e){let t=e.flatMap(e=>e.errors.map(e=>e.code).filter(e=>c.has(e)));return Array.from(new Set(t))}function getRootError(e,t){let n=e.flatMap(e=>{switch(e){case`file-invalid-type`:{let e=formatAcceptedTypes(t.accept);return e?[`only ${e} files are allowed`]:[`this file type is not allowed`]}case`file-too-large`:return t.maxSize?[`max size is ${(t.maxSize/(1024*1024)).toFixed(2)} MB`]:[`this file is too large`];case`file-too-small`:return t.minSize?[`min size is ${(t.minSize/(1024*1024)).toFixed(2)} MB`]:[`this file is too small`];case`too-many-files`:return t.maxFiles?[`max ${t.maxFiles} files`]:[`too many files`];default:return[]}});if(n.length===0)return`Unable to add the selected files`;let[r,...i]=n;return`${r.charAt(0).toUpperCase()}${r.slice(1)}${i.length>0?`, ${i.join(`, `)}`:``}`}function getRejectionMessage(e,t){let n=getDropzoneErrorCodes(e);return n.length>0?getRootError(n,t):e[0]?.errors[0]?.message??`Unable to add the selected files`}function getUploadErrorMessage(e,t){if(t){let n=t(e);if(n!==void 0)return n}if(typeof e==`string`)return e;if(e instanceof Error)return e.message}function setRef(e,t){if(typeof e==`function`){e(t);return}e&&(e.current=t)}function composeRefs(...e){return t=>{e.forEach(e=>{setRef(e,t)})}}function useDropzoneContext(){let e=i.useContext(u);if(!e)throw Error(`Dropzone components must be used within a Dropzone.`);return e}function useDropzoneFileListContext(){let e=i.useContext(d);if(!e)throw Error(`Dropzone file actions must be used within a DropzoneFileListItem.`);return e}function useDropzone(e){let{onDropFile:t,onRemoveFile:n,shapeUploadError:r,onFileUploaded:s,onFileUploadError:c,onAllUploaded:l,onRootError:u,maxRetryCount:d,autoRetry:f=!1,validation:p,shiftOnMaxFiles:m=!1}=e,h=i.useId(),g=`${h}-message`,_=`${h}-description`,[v,y]=i.useState(void 0),b=i.useCallback(e=>{y(e),u?.(e)},[u]),[x,S]=i.useReducer(fileStatusReducer,[]),C=i.useCallback(e=>`${h}-${e}-message`,[h]),w=i.useMemo(()=>v!==void 0||x.some(e=>e.status===`error`),[x,v]),T=i.useCallback(async(e,n,i=0)=>{try{let a=await t(e);if(a.status===`error`){if(f&&i<(d??1/0))return S({type:`update-status`,id:n,status:`pending`}),T(e,n,i+1);S({type:`update-status`,id:n,status:`error`,error:a.error,message:getUploadErrorMessage(a.error,r)}),c?.(a.error);return}S({type:`update-status`,id:n,status:`success`,result:a.result}),s?.(a.result)}catch(e){let t=e;S({type:`update-status`,id:n,status:`error`,error:t,message:getUploadErrorMessage(t,r)}),c?.(t)}},[f,t,d,c,s,r]),E=i.useCallback(async e=>{await n?.(e),S({type:`remove`,id:e})},[n]),D=i.useCallback(e=>{let t=x.find(t=>t.id===e);return t?.status===`error`&&t.tries<=(d??1/0)},[x,d]),O=i.useCallback(async e=>{if(!D(e))return;let t=x.find(t=>t.id===e);!t||t.status!==`error`||(S({type:`update-status`,id:e,status:`pending`}),await T(t.file,e))},[D,x,T]),k=o({accept:p?.accept,minSize:p?.minSize,maxSize:p?.maxSize,maxFiles:p?.maxFiles,noClick:!0,noKeyboard:!0,onDropAccepted:async e=>{b(void 0);let t=e,n=p?.maxFiles??1/0,r=Number.isFinite(n)?Math.max(x.length+e.length-n,0):0;if(r>0)if(m){let n=x.slice(0,Math.min(r,x.length));await Promise.all(n.map(e=>E(e.id)));let i=r-n.length;i>0&&(t=e.slice(i))}else{b(getRootError([a.TooManyFiles],p??{}));let r=Math.max(n-x.length,0);t=e.slice(0,r)}t.length!==0&&(await Promise.all(t.map(async e=>{let t=crypto.randomUUID();S({type:`add`,id:t,fileName:e.name,file:e}),await T(e,t)})),l?.())},onDropRejected:e=>{b(getRejectionMessage(e,p??{}))}});return{getRootProps:k.getRootProps,getInputProps:k.getInputProps,open:k.open,onRemoveFile:E,onRetry:O,canRetry:D,fileStatuses:x,isInvalid:w,isDragActive:k.isDragActive,rootError:v,inputId:h,rootMessageId:g,rootDescriptionId:_,getFileMessageId:C}}function Dropzone({children:e,...t}){return n(u.Provider,{value:t,children:e})}const f=i.forwardRef(({className:t,children:i,...a},o)=>{let s=useDropzoneContext(),c=[s.rootDescriptionId,s.isInvalid?s.rootMessageId:void 0].filter(Boolean).join(` `)||void 0,{ref:l,...u}=s.getRootProps({...a,"data-slot":`dropzone-area`,"aria-describedby":c,"aria-invalid":s.isInvalid||void 0,className:e(`flex min-h-44 flex-col items-center justify-center gap-4 rounded-xl border border-dashed border-input bg-muted/20 px-6 py-8 text-center transition-colors`,s.isDragActive&&`border-primary bg-primary/5`,s.isInvalid&&`border-destructive bg-destructive/5`,t)}),d=s.getInputProps({id:s.inputId,className:`sr-only`,"aria-describedby":c,"aria-invalid":s.isInvalid,tabIndex:-1});return r(`div`,{...u,ref:composeRefs(o,l),children:[n(`input`,{...d}),i]})}),p=i.forwardRef(({className:t,...r},i)=>n(`p`,{ref:i,id:useDropzoneContext().rootDescriptionId,"data-slot":`dropzone-description`,className:e(`text-sm text-muted-foreground`,t),...r})),m=i.forwardRef(({className:t,...r},i)=>(useDropzoneContext(),n(`ol`,{ref:i,"data-slot":`dropzone-file-list`,className:e(`space-y-3`,t),...r}))),h=i.forwardRef(({className:t,file:r,children:a,...o},s)=>{let c=useDropzoneContext(),l=c.getFileMessageId(r.id),u=r.status===`error`,f=c.canRetry(r.id),p=i.useMemo(()=>({onRemoveFile:()=>c.onRemoveFile(r.id),onRetry:()=>c.onRetry(r.id),fileStatus:r,canRetry:f,dropzoneId:c.inputId,messageId:l}),[f,c,r,l]);return n(d.Provider,{value:p,children:n(`li`,{ref:s,"data-slot":`dropzone-file-item`,"data-status":r.status,"aria-describedby":u?l:void 0,className:e(`rounded-xl border bg-card px-4 py-3 shadow-xs`,r.status===`error`&&`border-destructive/50`,t),...o,children:a})})}),g=i.forwardRef(({className:t,children:r,...i},a)=>{let o=useDropzoneFileListContext(),s=o.fileStatus.status===`error`?o.fileStatus.message??String(o.fileStatus.error):r;return n(`p`,{ref:a,id:o.messageId,"data-slot":`dropzone-file-message`,className:e(`min-h-5 text-[0.8rem] font-medium`,o.fileStatus.status===`error`&&`text-destructive`,t),...i,children:s})}),_=i.forwardRef(({className:t,children:r,...i},a)=>{let o=useDropzoneContext(),s=o.rootError??r;return n(`p`,{ref:a,id:o.rootMessageId,"data-slot":`dropzone-message`,className:e(`min-h-5 text-[0.8rem] font-medium text-destructive`,t),...i,children:s})}),v=i.forwardRef(({className:r,onClick:a,size:o=`icon-sm`,type:s=`button`,variant:c=`ghost`,...l},u)=>{let d=useDropzoneFileListContext(),f=i.useCallback(e=>{a?.(e),!e.defaultPrevented&&d.onRemoveFile()},[d,a]);return n(t,{ref:u,"data-slot":`dropzone-remove-file`,className:e(r),onClick:f,size:o,type:s,variant:c,...l})}),y=i.forwardRef(({className:r,disabled:a,onClick:o,size:s=`icon-sm`,type:c=`button`,variant:l=`ghost`,...u},d)=>{let f=useDropzoneFileListContext(),p=a||!f.canRetry,m=i.useCallback(e=>{o?.(e),!(e.defaultPrevented||p)&&f.onRetry()},[f,p,o]);return n(t,{ref:d,"data-slot":`dropzone-retry-file`,className:e(r),disabled:p,onClick:m,size:s,type:c,variant:l,...u})}),b=i.forwardRef(({className:r,onClick:a,size:o=`sm`,type:s=`button`,variant:c=`subtle`,...l},u)=>{let d=useDropzoneContext(),f=[d.rootDescriptionId,d.isInvalid?d.rootMessageId:void 0].filter(Boolean).join(` `)||void 0,p=i.useCallback(e=>{a?.(e),!e.defaultPrevented&&d.open()},[d,a]);return n(t,{ref:u,"aria-controls":d.inputId,"aria-describedby":f,"aria-invalid":d.isInvalid||void 0,"data-slot":`dropzone-trigger`,className:e(r),onClick:p,size:o,type:s,variant:c,...l})}),x=i.forwardRef(({className:t,status:r,...i},a)=>{let o=r===`success`||r===`error`,s=r===`error`;return n(`div`,{ref:a,"aria-valuemax":100,"aria-valuemin":0,"aria-valuetext":l[r],"data-slot":`dropzone-progress`,"data-status":r,role:`progressbar`,className:e(`relative h-2 w-full overflow-hidden rounded-full bg-muted`,t),...i,children:n(`div`,{className:e(`h-full w-full rounded-full bg-primary transition-transform`,o?`translate-x-0`:`animate-infinite-progress`,s&&`bg-destructive`)})})});Dropzone.displayName=`Dropzone`,f.displayName=`DropzoneArea`,p.displayName=`DropzoneDescription`,m.displayName=`DropzoneFileList`,h.displayName=`DropzoneFileListItem`,g.displayName=`DropzoneFileMessage`,_.displayName=`DropzoneMessage`,v.displayName=`DropzoneRemoveFile`,y.displayName=`DropzoneRetryFile`,b.displayName=`DropzoneTrigger`,x.displayName=`InfiniteProgress`;export{Dropzone,f as DropzoneArea,p as DropzoneDescription,m as DropzoneFileList,h as DropzoneFileListItem,g as DropzoneFileMessage,_ as DropzoneMessage,v as DropzoneRemoveFile,y as DropzoneRetryFile,b as DropzoneTrigger,a as ErrorCode,x as InfiniteProgress,useDropzone};
2
2
  //# sourceMappingURL=dropzone.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"dropzone.js","names":["useReactDropzone"],"sources":["../../src/components/dropzone.tsx"],"sourcesContent":["import * as React from 'react'\nimport {\n type Accept,\n ErrorCode,\n type FileError,\n type FileRejection,\n useDropzone as useReactDropzone\n} from 'react-dropzone'\n\nimport { cn } from '../lib/utils'\nimport { Button, type ButtonProps } from './button'\n\nconst dropzoneErrorCodes = [\n ErrorCode.FileInvalidType,\n ErrorCode.FileTooLarge,\n ErrorCode.FileTooSmall,\n ErrorCode.TooManyFiles\n]\n\ntype DropzoneAction<TUploadResult, TUploadError> =\n | {\n type: 'add'\n id: string\n fileName: string\n file: File\n }\n | {\n type: 'remove'\n id: string\n }\n | {\n type: 'update-status'\n id: string\n status: 'pending'\n }\n | {\n type: 'update-status'\n id: string\n status: 'error'\n error: TUploadError\n message?: string\n }\n | {\n type: 'update-status'\n id: string\n status: 'success'\n result: TUploadResult\n }\n\nexport type DropzoneUploadResult<TUploadResult, TUploadError> =\n | {\n status: 'error'\n error: TUploadError\n }\n | {\n status: 'success'\n result: TUploadResult\n }\n\nexport type DropzoneFileStatus<TUploadResult, TUploadError> = {\n id: string\n fileName: string\n file: File\n tries: number\n} & (\n | {\n status: 'pending'\n error?: undefined\n message?: undefined\n result?: undefined\n }\n | {\n status: 'error'\n error: TUploadError\n message?: string\n result?: undefined\n }\n | {\n status: 'success'\n result: TUploadResult\n error?: undefined\n message?: undefined\n }\n)\n\nexport type FileStatus<TUploadResult, TUploadError> = DropzoneFileStatus<TUploadResult, TUploadError>\n\nexport type DropzoneValidation = {\n accept?: Accept\n minSize?: number\n maxSize?: number\n maxFiles?: number\n}\n\nexport type UseDropzoneProps<TUploadResult, TUploadError = string> = {\n onDropFile: (file: File) => Promise<DropzoneUploadResult<TUploadResult, TUploadError>>\n onRemoveFile?: (id: string) => void | Promise<void>\n onFileUploaded?: (result: TUploadResult) => void\n onFileUploadError?: (error: TUploadError) => void\n onAllUploaded?: () => void\n onRootError?: (error: string | undefined) => void\n shapeUploadError?: (error: TUploadError) => string | undefined\n maxRetryCount?: number\n autoRetry?: boolean\n validation?: DropzoneValidation\n shiftOnMaxFiles?: boolean\n}\n\nexport interface UseDropzoneReturn<TUploadResult, TUploadError> {\n getRootProps: ReturnType<typeof useReactDropzone>['getRootProps']\n getInputProps: ReturnType<typeof useReactDropzone>['getInputProps']\n open: () => void\n onRemoveFile: (id: string) => Promise<void>\n onRetry: (id: string) => Promise<void>\n canRetry: (id: string) => boolean\n fileStatuses: DropzoneFileStatus<TUploadResult, TUploadError>[]\n isInvalid: boolean\n isDragActive: boolean\n rootError: string | undefined\n inputId: string\n rootMessageId: string\n rootDescriptionId: string\n getFileMessageId: (id: string) => string\n}\n\nexport type DropzoneProps<TUploadResult, TUploadError> = React.PropsWithChildren<\n UseDropzoneReturn<TUploadResult, TUploadError>\n>\n\nexport type DropzoneAreaProps = React.ComponentProps<'div'>\n\nexport type DropzoneDescriptionProps = React.ComponentProps<'p'>\n\nexport type DropzoneFileListProps = React.ComponentProps<'ol'>\n\nexport type DropzoneFileListItemProps<TUploadResult, TUploadError> = React.ComponentProps<'li'> & {\n file: DropzoneFileStatus<TUploadResult, TUploadError>\n}\n\nexport type DropzoneFileMessageProps = React.ComponentProps<'p'>\n\nexport type DropzoneMessageProps = React.ComponentProps<'p'>\n\nexport type DropzoneRemoveFileProps = ButtonProps\n\nexport type DropzoneRetryFileProps = ButtonProps\n\nexport type DropzoneTriggerProps = ButtonProps\n\nexport type InfiniteProgressProps = React.ComponentProps<'div'> & {\n status: 'pending' | 'success' | 'error'\n}\n\ntype DropzoneFileListContextValue<TUploadResult, TUploadError> = {\n onRemoveFile: () => Promise<void>\n onRetry: () => Promise<void>\n fileStatus: DropzoneFileStatus<TUploadResult, TUploadError>\n canRetry: boolean\n dropzoneId: string\n messageId: string\n}\n\nconst dropzoneErrorCodeSet = new Set<ErrorCode>(dropzoneErrorCodes)\n\nconst valueTextMap = {\n pending: 'indeterminate',\n success: '100%',\n error: 'error'\n} as const\n\nconst DropzoneContext = React.createContext<UseDropzoneReturn<unknown, unknown> | null>(null)\n\nconst DropzoneFileListContext = React.createContext<DropzoneFileListContextValue<unknown, unknown> | null>(null)\n\nfunction fileStatusReducer<TUploadResult, TUploadError>(\n state: DropzoneFileStatus<TUploadResult, TUploadError>[],\n action: DropzoneAction<TUploadResult, TUploadError>\n): DropzoneFileStatus<TUploadResult, TUploadError>[] {\n switch (action.type) {\n case 'add':\n return [\n ...state,\n {\n id: action.id,\n fileName: action.fileName,\n file: action.file,\n status: 'pending',\n tries: 1\n }\n ]\n case 'remove':\n return state.filter((fileStatus) => fileStatus.id !== action.id)\n case 'update-status':\n return state.map((fileStatus) => {\n if (fileStatus.id !== action.id) {\n return fileStatus\n }\n\n if (action.status === 'pending') {\n return {\n ...fileStatus,\n status: 'pending',\n error: undefined,\n message: undefined,\n result: undefined,\n tries: fileStatus.tries + 1\n }\n }\n\n if (action.status === 'error') {\n return {\n ...fileStatus,\n status: 'error',\n error: action.error,\n message: action.message,\n result: undefined\n }\n }\n\n return {\n ...fileStatus,\n status: 'success',\n result: action.result,\n error: undefined,\n message: undefined\n }\n })\n }\n}\n\nfunction formatAcceptedTypes(accept?: Accept) {\n if (!accept) {\n return undefined\n }\n\n const acceptedTypes = Object.entries(accept).flatMap(([mimeType, extensions]) => {\n return extensions.length > 0 ? extensions : [mimeType]\n })\n\n return acceptedTypes.length > 0 ? acceptedTypes.join(', ') : undefined\n}\n\nfunction getDropzoneErrorCodes(fileRejections: FileRejection[]) {\n const errorCodes = fileRejections.flatMap((rejection) =>\n rejection.errors.map((error) => error.code as ErrorCode).filter((errorCode) => dropzoneErrorCodeSet.has(errorCode))\n )\n\n return Array.from(new Set(errorCodes))\n}\n\nfunction getRootError(errorCodes: ErrorCode[], limits: DropzoneValidation) {\n const errors = errorCodes.flatMap((errorCode) => {\n switch (errorCode) {\n case 'file-invalid-type': {\n const acceptedTypes = formatAcceptedTypes(limits.accept)\n return acceptedTypes ? [`only ${acceptedTypes} files are allowed`] : ['this file type is not allowed']\n }\n case 'file-too-large': {\n if (!limits.maxSize) {\n return ['this file is too large']\n }\n\n return [`max size is ${(limits.maxSize / (1024 * 1024)).toFixed(2)} MB`]\n }\n case 'file-too-small': {\n if (!limits.minSize) {\n return ['this file is too small']\n }\n\n return [`min size is ${(limits.minSize / (1024 * 1024)).toFixed(2)} MB`]\n }\n case 'too-many-files':\n return limits.maxFiles ? [`max ${limits.maxFiles} files`] : ['too many files']\n default:\n return []\n }\n })\n\n if (errors.length === 0) {\n return 'Unable to add the selected files'\n }\n\n const [firstError, ...restErrors] = errors as [string, ...string[]]\n return `${firstError.charAt(0).toUpperCase()}${firstError.slice(1)}${restErrors.length > 0 ? `, ${restErrors.join(', ')}` : ''}`\n}\n\nfunction getRejectionMessage(fileRejections: FileRejection[], limits: DropzoneValidation) {\n const errorCodes = getDropzoneErrorCodes(fileRejections)\n\n if (errorCodes.length > 0) {\n return getRootError(errorCodes, limits)\n }\n\n return fileRejections[0]?.errors[0]?.message ?? 'Unable to add the selected files'\n}\n\nfunction getUploadErrorMessage<TUploadError>(\n error: TUploadError,\n shapeUploadError?: (error: TUploadError) => string | undefined\n) {\n if (shapeUploadError) {\n const message = shapeUploadError(error)\n if (message !== undefined) {\n return message\n }\n }\n\n if (typeof error === 'string') {\n return error\n }\n\n if (error instanceof Error) {\n return error.message\n }\n\n return undefined\n}\n\nfunction setRef<T>(ref: React.Ref<T> | undefined, value: T | null) {\n if (typeof ref === 'function') {\n ref(value)\n return\n }\n\n if (ref) {\n ref.current = value\n }\n}\n\nfunction composeRefs<T>(...refs: Array<React.Ref<T> | undefined>) {\n return (value: T | null) => {\n refs.forEach((ref) => {\n setRef(ref, value)\n })\n }\n}\n\nfunction useDropzoneContext<TUploadResult, TUploadError>() {\n const context = React.useContext(DropzoneContext)\n\n if (!context) {\n throw new Error('Dropzone components must be used within a Dropzone.')\n }\n\n return context as UseDropzoneReturn<TUploadResult, TUploadError>\n}\n\nfunction useDropzoneFileListContext<TUploadResult, TUploadError>() {\n const context = React.useContext(DropzoneFileListContext)\n\n if (!context) {\n throw new Error('Dropzone file actions must be used within a DropzoneFileListItem.')\n }\n\n return context as DropzoneFileListContextValue<TUploadResult, TUploadError>\n}\n\nfunction useDropzone<TUploadResult, TUploadError = string>(\n props: UseDropzoneProps<TUploadResult, TUploadError>\n): UseDropzoneReturn<TUploadResult, TUploadError> {\n const {\n onDropFile: handleDropFile,\n onRemoveFile: handleRemoveFile,\n shapeUploadError,\n onFileUploaded,\n onFileUploadError,\n onAllUploaded,\n onRootError,\n maxRetryCount,\n autoRetry = false,\n validation,\n shiftOnMaxFiles = false\n } = props\n\n const inputId = React.useId()\n const rootMessageId = `${inputId}-message`\n const rootDescriptionId = `${inputId}-description`\n const [rootError, setRootErrorState] = React.useState<string | undefined>(undefined)\n\n const setRootError = React.useCallback(\n (error: string | undefined) => {\n setRootErrorState(error)\n onRootError?.(error)\n },\n [onRootError]\n )\n\n const [fileStatuses, dispatch] = React.useReducer(\n fileStatusReducer<TUploadResult, TUploadError>,\n [] as DropzoneFileStatus<TUploadResult, TUploadError>[]\n )\n\n const getFileMessageId = React.useCallback((id: string) => `${inputId}-${id}-message`, [inputId])\n\n const isInvalid = React.useMemo(() => {\n return rootError !== undefined || fileStatuses.some((fileStatus) => fileStatus.status === 'error')\n }, [fileStatuses, rootError])\n\n const uploadFile = React.useCallback(\n async (file: File, id: string, retryCount = 0) => {\n try {\n const result = await handleDropFile(file)\n\n if (result.status === 'error') {\n if (autoRetry && retryCount < (maxRetryCount ?? Number.POSITIVE_INFINITY)) {\n dispatch({ type: 'update-status', id, status: 'pending' })\n return uploadFile(file, id, retryCount + 1)\n }\n\n dispatch({\n type: 'update-status',\n id,\n status: 'error',\n error: result.error,\n message: getUploadErrorMessage(result.error, shapeUploadError)\n })\n onFileUploadError?.(result.error)\n return\n }\n\n dispatch({\n type: 'update-status',\n id,\n status: 'success',\n result: result.result\n })\n onFileUploaded?.(result.result)\n } catch (error) {\n const uploadError = error as TUploadError\n\n dispatch({\n type: 'update-status',\n id,\n status: 'error',\n error: uploadError,\n message: getUploadErrorMessage(uploadError, shapeUploadError)\n })\n onFileUploadError?.(uploadError)\n }\n },\n [autoRetry, handleDropFile, maxRetryCount, onFileUploadError, onFileUploaded, shapeUploadError]\n )\n\n const onRemoveFile = React.useCallback(\n async (id: string) => {\n await handleRemoveFile?.(id)\n dispatch({ type: 'remove', id })\n },\n [handleRemoveFile]\n )\n\n const canRetry = React.useCallback(\n (id: string) => {\n const fileStatus = fileStatuses.find((item) => item.id === id)\n\n return fileStatus?.status === 'error' && fileStatus.tries <= (maxRetryCount ?? Number.POSITIVE_INFINITY)\n },\n [fileStatuses, maxRetryCount]\n )\n\n const onRetry = React.useCallback(\n async (id: string) => {\n if (!canRetry(id)) {\n return\n }\n\n const fileStatus = fileStatuses.find((item) => item.id === id)\n\n if (!fileStatus || fileStatus.status !== 'error') {\n return\n }\n\n dispatch({ type: 'update-status', id, status: 'pending' })\n await uploadFile(fileStatus.file, id)\n },\n [canRetry, fileStatuses, uploadFile]\n )\n\n const dropzone = useReactDropzone({\n accept: validation?.accept,\n minSize: validation?.minSize,\n maxSize: validation?.maxSize,\n maxFiles: validation?.maxFiles,\n noClick: true,\n noKeyboard: true,\n onDropAccepted: async (acceptedFiles) => {\n setRootError(undefined)\n\n let nextFiles = acceptedFiles\n const maxFiles = validation?.maxFiles ?? Number.POSITIVE_INFINITY\n const overflow = Number.isFinite(maxFiles)\n ? Math.max(fileStatuses.length + acceptedFiles.length - maxFiles, 0)\n : 0\n\n if (overflow > 0) {\n if (shiftOnMaxFiles) {\n const filesToRemove = fileStatuses.slice(0, Math.min(overflow, fileStatuses.length))\n\n await Promise.all(filesToRemove.map((fileStatus) => onRemoveFile(fileStatus.id)))\n\n const remainingOverflow = overflow - filesToRemove.length\n if (remainingOverflow > 0) {\n nextFiles = acceptedFiles.slice(remainingOverflow)\n }\n } else {\n setRootError(getRootError([ErrorCode.TooManyFiles], validation ?? {}))\n const availableSlots = Math.max(maxFiles - fileStatuses.length, 0)\n nextFiles = acceptedFiles.slice(0, availableSlots)\n }\n }\n\n if (nextFiles.length === 0) {\n return\n }\n\n await Promise.all(\n nextFiles.map(async (file) => {\n const id = crypto.randomUUID()\n dispatch({ type: 'add', id, fileName: file.name, file })\n await uploadFile(file, id)\n })\n )\n\n onAllUploaded?.()\n },\n onDropRejected: (fileRejections) => {\n setRootError(getRejectionMessage(fileRejections, validation ?? {}))\n }\n })\n\n return {\n getRootProps: dropzone.getRootProps,\n getInputProps: dropzone.getInputProps,\n open: dropzone.open,\n onRemoveFile,\n onRetry,\n canRetry,\n fileStatuses,\n isInvalid,\n isDragActive: dropzone.isDragActive,\n rootError,\n inputId,\n rootMessageId,\n rootDescriptionId,\n getFileMessageId\n }\n}\n\nfunction Dropzone<TUploadResult, TUploadError>({ children, ...dropzone }: DropzoneProps<TUploadResult, TUploadError>) {\n return <DropzoneContext.Provider value={dropzone}>{children}</DropzoneContext.Provider>\n}\n\nconst DropzoneArea = React.forwardRef<HTMLDivElement, DropzoneAreaProps>(\n ({ className, children, ...props }, forwardedRef) => {\n const context = useDropzoneContext()\n const describedBy =\n [context.rootDescriptionId, context.isInvalid ? context.rootMessageId : undefined].filter(Boolean).join(' ') ||\n undefined\n\n const { ref: rootRef, ...rootProps } = context.getRootProps({\n ...props,\n 'data-slot': 'dropzone-area',\n 'aria-describedby': describedBy,\n 'aria-invalid': context.isInvalid || undefined,\n className: cn(\n 'flex min-h-44 flex-col items-center justify-center gap-4 rounded-xl border border-dashed border-input bg-muted/20 px-6 py-8 text-center transition-colors',\n context.isDragActive && 'border-primary bg-primary/5',\n context.isInvalid && 'border-destructive bg-destructive/5',\n className\n )\n }) as React.HTMLAttributes<HTMLDivElement> & {\n ref?: React.Ref<HTMLDivElement>\n }\n\n const inputProps = context.getInputProps({\n id: context.inputId,\n className: 'sr-only',\n 'aria-describedby': describedBy,\n 'aria-invalid': context.isInvalid,\n tabIndex: -1\n })\n\n return (\n <div {...rootProps} ref={composeRefs(forwardedRef, rootRef)}>\n <input {...inputProps} />\n {children}\n </div>\n )\n }\n)\n\nconst DropzoneDescription = React.forwardRef<HTMLParagraphElement, DropzoneDescriptionProps>(\n ({ className, ...props }, ref) => {\n const context = useDropzoneContext()\n\n return (\n <p\n ref={ref}\n id={context.rootDescriptionId}\n data-slot=\"dropzone-description\"\n className={cn('text-sm text-muted-foreground', className)}\n {...props}\n />\n )\n }\n)\n\nconst DropzoneFileList = React.forwardRef<HTMLOListElement, DropzoneFileListProps>(({ className, ...props }, ref) => {\n useDropzoneContext()\n\n return <ol ref={ref} data-slot=\"dropzone-file-list\" className={cn('space-y-3', className)} {...props} />\n})\n\nconst DropzoneFileListItem = React.forwardRef<HTMLLIElement, DropzoneFileListItemProps<unknown, unknown>>(\n ({ className, file, children, ...props }, ref) => {\n const context = useDropzoneContext()\n const messageId = context.getFileMessageId(file.id)\n const isInvalid = file.status === 'error'\n const canRetry = context.canRetry(file.id)\n\n const value = React.useMemo<DropzoneFileListContextValue<unknown, unknown>>(\n () => ({\n onRemoveFile: () => context.onRemoveFile(file.id),\n onRetry: () => context.onRetry(file.id),\n fileStatus: file,\n canRetry,\n dropzoneId: context.inputId,\n messageId\n }),\n [canRetry, context, file, messageId]\n )\n\n return (\n <DropzoneFileListContext.Provider value={value}>\n <li\n ref={ref}\n data-slot=\"dropzone-file-item\"\n data-status={file.status}\n aria-describedby={isInvalid ? messageId : undefined}\n className={cn(\n 'rounded-xl border bg-card px-4 py-3 shadow-xs',\n file.status === 'error' && 'border-destructive/50',\n className\n )}\n {...props}\n >\n {children}\n </li>\n </DropzoneFileListContext.Provider>\n )\n }\n)\n\nconst DropzoneFileMessage = React.forwardRef<HTMLParagraphElement, DropzoneFileMessageProps>(\n ({ className, children, ...props }, ref) => {\n const context = useDropzoneFileListContext()\n const body =\n context.fileStatus.status === 'error'\n ? (context.fileStatus.message ?? String(context.fileStatus.error))\n : children\n\n return (\n <p\n ref={ref}\n id={context.messageId}\n data-slot=\"dropzone-file-message\"\n className={cn(\n 'min-h-5 text-[0.8rem] font-medium',\n context.fileStatus.status === 'error' && 'text-destructive',\n className\n )}\n {...props}\n >\n {body}\n </p>\n )\n }\n)\n\nconst DropzoneMessage = React.forwardRef<HTMLParagraphElement, DropzoneMessageProps>(\n ({ className, children, ...props }, ref) => {\n const context = useDropzoneContext()\n const body = context.rootError ?? children\n\n return (\n <p\n ref={ref}\n id={context.rootMessageId}\n data-slot=\"dropzone-message\"\n className={cn('min-h-5 text-[0.8rem] font-medium text-destructive', className)}\n {...props}\n >\n {body}\n </p>\n )\n }\n)\n\nconst DropzoneRemoveFile = React.forwardRef<HTMLButtonElement, DropzoneRemoveFileProps>(\n ({ className, onClick, size = 'icon-sm', type = 'button', variant = 'ghost', ...props }, ref) => {\n const context = useDropzoneFileListContext()\n\n const handleClick = React.useCallback<React.MouseEventHandler<HTMLButtonElement>>(\n (event) => {\n onClick?.(event)\n if (event.defaultPrevented) {\n return\n }\n\n void context.onRemoveFile()\n },\n [context, onClick]\n )\n\n return (\n <Button\n ref={ref}\n data-slot=\"dropzone-remove-file\"\n className={cn(className)}\n onClick={handleClick}\n size={size}\n type={type}\n variant={variant}\n {...props}\n />\n )\n }\n)\n\nconst DropzoneRetryFile = React.forwardRef<HTMLButtonElement, DropzoneRetryFileProps>(\n ({ className, disabled, onClick, size = 'icon-sm', type = 'button', variant = 'ghost', ...props }, ref) => {\n const context = useDropzoneFileListContext()\n const isDisabled = disabled || !context.canRetry\n\n const handleClick = React.useCallback<React.MouseEventHandler<HTMLButtonElement>>(\n (event) => {\n onClick?.(event)\n if (event.defaultPrevented || isDisabled) {\n return\n }\n\n void context.onRetry()\n },\n [context, isDisabled, onClick]\n )\n\n return (\n <Button\n ref={ref}\n data-slot=\"dropzone-retry-file\"\n className={cn(className)}\n disabled={isDisabled}\n onClick={handleClick}\n size={size}\n type={type}\n variant={variant}\n {...props}\n />\n )\n }\n)\n\nconst DropzoneTrigger = React.forwardRef<HTMLButtonElement, DropzoneTriggerProps>(\n ({ className, onClick, size = 'sm', type = 'button', variant = 'subtle', ...props }, ref) => {\n const context = useDropzoneContext()\n const describedBy =\n [context.rootDescriptionId, context.isInvalid ? context.rootMessageId : undefined].filter(Boolean).join(' ') ||\n undefined\n\n const handleClick = React.useCallback<React.MouseEventHandler<HTMLButtonElement>>(\n (event) => {\n onClick?.(event)\n if (event.defaultPrevented) {\n return\n }\n\n context.open()\n },\n [context, onClick]\n )\n\n return (\n <Button\n ref={ref}\n aria-controls={context.inputId}\n aria-describedby={describedBy}\n aria-invalid={context.isInvalid || undefined}\n data-slot=\"dropzone-trigger\"\n className={cn(className)}\n onClick={handleClick}\n size={size}\n type={type}\n variant={variant}\n {...props}\n />\n )\n }\n)\n\nconst InfiniteProgress = React.forwardRef<HTMLDivElement, InfiniteProgressProps>(\n ({ className, status, ...props }, ref) => {\n const done = status === 'success' || status === 'error'\n const isError = status === 'error'\n\n return (\n <div\n ref={ref}\n aria-valuemax={100}\n aria-valuemin={0}\n aria-valuetext={valueTextMap[status]}\n data-slot=\"dropzone-progress\"\n data-status={status}\n role=\"progressbar\"\n className={cn('relative h-2 w-full overflow-hidden rounded-full bg-muted', className)}\n {...props}\n >\n <div\n className={cn(\n 'h-full w-full rounded-full bg-primary transition-transform',\n done ? 'translate-x-0' : 'animate-infinite-progress',\n isError && 'bg-destructive'\n )}\n />\n </div>\n )\n }\n)\n\nDropzone.displayName = 'Dropzone'\nDropzoneArea.displayName = 'DropzoneArea'\nDropzoneDescription.displayName = 'DropzoneDescription'\nDropzoneFileList.displayName = 'DropzoneFileList'\nDropzoneFileListItem.displayName = 'DropzoneFileListItem'\nDropzoneFileMessage.displayName = 'DropzoneFileMessage'\nDropzoneMessage.displayName = 'DropzoneMessage'\nDropzoneRemoveFile.displayName = 'DropzoneRemoveFile'\nDropzoneRetryFile.displayName = 'DropzoneRetryFile'\nDropzoneTrigger.displayName = 'DropzoneTrigger'\nInfiniteProgress.displayName = 'InfiniteProgress'\n\nexport {\n Dropzone,\n DropzoneArea,\n DropzoneDescription,\n DropzoneFileList,\n DropzoneFileListItem,\n DropzoneFileMessage,\n DropzoneMessage,\n DropzoneRemoveFile,\n DropzoneRetryFile,\n DropzoneTrigger,\n ErrorCode,\n InfiniteProgress,\n useDropzone,\n type FileError\n}\n"],"mappings":"6OAYA,MAAM,EAAqB,CACzB,EAAU,gBACV,EAAU,aACV,EAAU,aACV,EAAU,aACX,CAiJK,EAAuB,IAAI,IAAe,EAAmB,CAE7D,EAAe,CACnB,QAAS,gBACT,QAAS,OACT,MAAO,QACR,CAEK,EAAkB,EAAM,cAA0D,KAAK,CAEvF,EAA0B,EAAM,cAAqE,KAAK,CAEhH,SAAS,kBACP,EACA,EACmD,CACnD,OAAQ,EAAO,KAAf,CACE,IAAK,MACH,MAAO,CACL,GAAG,EACH,CACE,GAAI,EAAO,GACX,SAAU,EAAO,SACjB,KAAM,EAAO,KACb,OAAQ,UACR,MAAO,EACR,CACF,CACH,IAAK,SACH,OAAO,EAAM,OAAQ,GAAe,EAAW,KAAO,EAAO,GAAG,CAClE,IAAK,gBACH,OAAO,EAAM,IAAK,GACZ,EAAW,KAAO,EAAO,GAIzB,EAAO,SAAW,UACb,CACL,GAAG,EACH,OAAQ,UACR,MAAO,IAAA,GACP,QAAS,IAAA,GACT,OAAQ,IAAA,GACR,MAAO,EAAW,MAAQ,EAC3B,CAGC,EAAO,SAAW,QACb,CACL,GAAG,EACH,OAAQ,QACR,MAAO,EAAO,MACd,QAAS,EAAO,QAChB,OAAQ,IAAA,GACT,CAGI,CACL,GAAG,EACH,OAAQ,UACR,OAAQ,EAAO,OACf,MAAO,IAAA,GACP,QAAS,IAAA,GACV,CA9BQ,EA+BT,EAIR,SAAS,oBAAoB,EAAiB,CAC5C,GAAI,CAAC,EACH,OAGF,IAAM,EAAgB,OAAO,QAAQ,EAAO,CAAC,SAAS,C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YAAW,SAAQ,GAAG,GAAS,IAAQ,CACxC,IAAM,EAAO,IAAW,WAAa,IAAW,QAC1C,EAAU,IAAW,QAE3B,OACE,EAAC,MAAD,CACO,MACL,gBAAe,IACf,gBAAe,EACf,iBAAgB,EAAa,GAC7B,YAAU,oBACV,cAAa,EACb,KAAK,cACL,UAAW,EAAG,4DAA6D,EAAU,CACrF,GAAI,WAEJ,EAAC,MAAD,CACE,UAAW,EACT,6DACA,EAAO,gBAAkB,4BACzB,GAAW,iBACZ,CACD,CAAA,CACE,CAAA,EAGX,CAED,SAAS,YAAc,WACvB,EAAa,YAAc,eAC3B,EAAoB,YAAc,sBAClC,EAAiB,YAAc,mBAC/B,EAAqB,YAAc,uBACnC,EAAoB,YAAc,sBAClC,EAAgB,YAAc,kBAC9B,EAAmB,YAAc,qBACjC,EAAkB,YAAc,oBAChC,EAAgB,YAAc,kBAC9B,EAAiB,YAAc"}
1
+ {"version":3,"file":"dropzone.js","names":["useReactDropzone"],"sources":["../../src/components/dropzone.tsx"],"sourcesContent":["import * as React from 'react'\nimport {\n type Accept,\n ErrorCode,\n type FileError,\n type FileRejection,\n useDropzone as useReactDropzone\n} from 'react-dropzone'\n\nimport { cn } from '../lib/utils'\nimport { Button, type ButtonProps } from './button'\n\nconst dropzoneErrorCodes = [\n ErrorCode.FileInvalidType,\n ErrorCode.FileTooLarge,\n ErrorCode.FileTooSmall,\n ErrorCode.TooManyFiles\n]\n\ntype DropzoneAction<TUploadResult, TUploadError> =\n | {\n type: 'add'\n id: string\n fileName: string\n file: File\n }\n | {\n type: 'remove'\n id: string\n }\n | {\n type: 'update-status'\n id: string\n status: 'pending'\n }\n | {\n type: 'update-status'\n id: string\n status: 'error'\n error: TUploadError\n message?: string\n }\n | {\n type: 'update-status'\n id: string\n status: 'success'\n result: TUploadResult\n }\n\nexport type DropzoneUploadResult<TUploadResult, TUploadError> =\n | {\n status: 'error'\n error: TUploadError\n }\n | {\n status: 'success'\n result: TUploadResult\n }\n\nexport type DropzoneFileStatus<TUploadResult, TUploadError> = {\n id: string\n fileName: string\n file: File\n tries: number\n} & (\n | {\n status: 'pending'\n error?: undefined\n message?: undefined\n result?: undefined\n }\n | {\n status: 'error'\n error: TUploadError\n message?: string\n result?: undefined\n }\n | {\n status: 'success'\n result: TUploadResult\n error?: undefined\n message?: undefined\n }\n)\n\nexport type FileStatus<TUploadResult, TUploadError> = DropzoneFileStatus<TUploadResult, TUploadError>\n\nexport type DropzoneValidation = {\n accept?: Accept\n minSize?: number\n maxSize?: number\n maxFiles?: number\n}\n\nexport type UseDropzoneProps<TUploadResult, TUploadError = string> = {\n onDropFile: (file: File) => Promise<DropzoneUploadResult<TUploadResult, TUploadError>>\n onRemoveFile?: (id: string) => void | Promise<void>\n onFileUploaded?: (result: TUploadResult) => void\n onFileUploadError?: (error: TUploadError) => void\n onAllUploaded?: () => void\n onRootError?: (error: string | undefined) => void\n shapeUploadError?: (error: TUploadError) => string | undefined\n maxRetryCount?: number\n autoRetry?: boolean\n validation?: DropzoneValidation\n shiftOnMaxFiles?: boolean\n}\n\nexport interface UseDropzoneReturn<TUploadResult, TUploadError> {\n getRootProps: ReturnType<typeof useReactDropzone>['getRootProps']\n getInputProps: ReturnType<typeof useReactDropzone>['getInputProps']\n open: () => void\n onRemoveFile: (id: string) => Promise<void>\n onRetry: (id: string) => Promise<void>\n canRetry: (id: string) => boolean\n fileStatuses: DropzoneFileStatus<TUploadResult, TUploadError>[]\n isInvalid: boolean\n isDragActive: boolean\n rootError: string | undefined\n inputId: string\n rootMessageId: string\n rootDescriptionId: string\n getFileMessageId: (id: string) => string\n}\n\nexport type DropzoneProps<TUploadResult, TUploadError> = React.PropsWithChildren<\n UseDropzoneReturn<TUploadResult, TUploadError>\n>\n\nexport type DropzoneAreaProps = React.ComponentProps<'div'>\n\nexport type DropzoneDescriptionProps = React.ComponentProps<'p'>\n\nexport type DropzoneFileListProps = React.ComponentProps<'ol'>\n\nexport type DropzoneFileListItemProps<TUploadResult, TUploadError> = React.ComponentProps<'li'> & {\n file: DropzoneFileStatus<TUploadResult, TUploadError>\n}\n\nexport type DropzoneFileMessageProps = React.ComponentProps<'p'>\n\nexport type DropzoneMessageProps = React.ComponentProps<'p'>\n\nexport type DropzoneRemoveFileProps = ButtonProps\n\nexport type DropzoneRetryFileProps = ButtonProps\n\nexport type DropzoneTriggerProps = ButtonProps\n\nexport type InfiniteProgressProps = React.ComponentProps<'div'> & {\n status: 'pending' | 'success' | 'error'\n}\n\ntype DropzoneFileListContextValue<TUploadResult, TUploadError> = {\n onRemoveFile: () => Promise<void>\n onRetry: () => Promise<void>\n fileStatus: DropzoneFileStatus<TUploadResult, TUploadError>\n canRetry: boolean\n dropzoneId: string\n messageId: string\n}\n\nconst dropzoneErrorCodeSet = new Set<ErrorCode>(dropzoneErrorCodes)\n\nconst valueTextMap = {\n pending: 'indeterminate',\n success: '100%',\n error: 'error'\n} as const\n\nconst DropzoneContext = React.createContext<UseDropzoneReturn<unknown, unknown> | null>(null)\n\nconst DropzoneFileListContext = React.createContext<DropzoneFileListContextValue<unknown, unknown> | null>(null)\n\nfunction fileStatusReducer<TUploadResult, TUploadError>(\n state: DropzoneFileStatus<TUploadResult, TUploadError>[],\n action: DropzoneAction<TUploadResult, TUploadError>\n): DropzoneFileStatus<TUploadResult, TUploadError>[] {\n switch (action.type) {\n case 'add':\n return [\n ...state,\n {\n id: action.id,\n fileName: action.fileName,\n file: action.file,\n status: 'pending',\n tries: 1\n }\n ]\n case 'remove':\n return state.filter((fileStatus) => fileStatus.id !== action.id)\n case 'update-status':\n return state.map((fileStatus) => {\n if (fileStatus.id !== action.id) {\n return fileStatus\n }\n\n if (action.status === 'pending') {\n return {\n ...fileStatus,\n status: 'pending',\n error: undefined,\n message: undefined,\n result: undefined,\n tries: fileStatus.tries + 1\n }\n }\n\n if (action.status === 'error') {\n return {\n ...fileStatus,\n status: 'error',\n error: action.error,\n message: action.message,\n result: undefined\n }\n }\n\n return {\n ...fileStatus,\n status: 'success',\n result: action.result,\n error: undefined,\n message: undefined\n }\n })\n }\n}\n\nfunction formatAcceptedTypes(accept?: Accept) {\n if (!accept) {\n return undefined\n }\n\n const acceptedTypes = Object.entries(accept).flatMap(([mimeType, extensions]) => {\n return extensions.length > 0 ? extensions : [mimeType]\n })\n\n return acceptedTypes.length > 0 ? acceptedTypes.join(', ') : undefined\n}\n\nfunction getDropzoneErrorCodes(fileRejections: FileRejection[]) {\n const errorCodes = fileRejections.flatMap((rejection) =>\n rejection.errors.map((error) => error.code as ErrorCode).filter((errorCode) => dropzoneErrorCodeSet.has(errorCode))\n )\n\n return Array.from(new Set(errorCodes))\n}\n\nfunction getRootError(errorCodes: ErrorCode[], limits: DropzoneValidation) {\n const errors = errorCodes.flatMap((errorCode) => {\n switch (errorCode) {\n case 'file-invalid-type': {\n const acceptedTypes = formatAcceptedTypes(limits.accept)\n return acceptedTypes ? [`only ${acceptedTypes} files are allowed`] : ['this file type is not allowed']\n }\n case 'file-too-large': {\n if (!limits.maxSize) {\n return ['this file is too large']\n }\n\n return [`max size is ${(limits.maxSize / (1024 * 1024)).toFixed(2)} MB`]\n }\n case 'file-too-small': {\n if (!limits.minSize) {\n return ['this file is too small']\n }\n\n return [`min size is ${(limits.minSize / (1024 * 1024)).toFixed(2)} MB`]\n }\n case 'too-many-files':\n return limits.maxFiles ? [`max ${limits.maxFiles} files`] : ['too many files']\n default:\n return []\n }\n })\n\n if (errors.length === 0) {\n return 'Unable to add the selected files'\n }\n\n const [firstError, ...restErrors] = errors as [string, ...string[]]\n return `${firstError.charAt(0).toUpperCase()}${firstError.slice(1)}${restErrors.length > 0 ? `, ${restErrors.join(', ')}` : ''}`\n}\n\nfunction getRejectionMessage(fileRejections: FileRejection[], limits: DropzoneValidation) {\n const errorCodes = getDropzoneErrorCodes(fileRejections)\n\n if (errorCodes.length > 0) {\n return getRootError(errorCodes, limits)\n }\n\n return fileRejections[0]?.errors[0]?.message ?? 'Unable to add the selected files'\n}\n\nfunction getUploadErrorMessage<TUploadError>(\n error: TUploadError,\n shapeUploadError?: (error: TUploadError) => string | undefined\n) {\n if (shapeUploadError) {\n const message = shapeUploadError(error)\n if (message !== undefined) {\n return message\n }\n }\n\n if (typeof error === 'string') {\n return error\n }\n\n if (error instanceof Error) {\n return error.message\n }\n\n return undefined\n}\n\nfunction setRef<T>(ref: React.Ref<T> | undefined, value: T | null) {\n if (typeof ref === 'function') {\n ref(value)\n return\n }\n\n if (ref) {\n ref.current = value\n }\n}\n\nfunction composeRefs<T>(...refs: Array<React.Ref<T> | undefined>) {\n return (value: T | null) => {\n refs.forEach((ref) => {\n setRef(ref, value)\n })\n }\n}\n\nfunction useDropzoneContext<TUploadResult, TUploadError>() {\n const context = React.useContext(DropzoneContext)\n\n if (!context) {\n throw new Error('Dropzone components must be used within a Dropzone.')\n }\n\n return context as UseDropzoneReturn<TUploadResult, TUploadError>\n}\n\nfunction useDropzoneFileListContext<TUploadResult, TUploadError>() {\n const context = React.useContext(DropzoneFileListContext)\n\n if (!context) {\n throw new Error('Dropzone file actions must be used within a DropzoneFileListItem.')\n }\n\n return context as DropzoneFileListContextValue<TUploadResult, TUploadError>\n}\n\nfunction useDropzone<TUploadResult, TUploadError = string>(\n props: UseDropzoneProps<TUploadResult, TUploadError>\n): UseDropzoneReturn<TUploadResult, TUploadError> {\n const {\n onDropFile: handleDropFile,\n onRemoveFile: handleRemoveFile,\n shapeUploadError,\n onFileUploaded,\n onFileUploadError,\n onAllUploaded,\n onRootError,\n maxRetryCount,\n autoRetry = false,\n validation,\n shiftOnMaxFiles = false\n } = props\n\n const inputId = React.useId()\n const rootMessageId = `${inputId}-message`\n const rootDescriptionId = `${inputId}-description`\n const [rootError, setRootErrorState] = React.useState<string | undefined>(undefined)\n\n const setRootError = React.useCallback(\n (error: string | undefined) => {\n setRootErrorState(error)\n onRootError?.(error)\n },\n [onRootError]\n )\n\n const [fileStatuses, dispatch] = React.useReducer(\n fileStatusReducer<TUploadResult, TUploadError>,\n [] as DropzoneFileStatus<TUploadResult, TUploadError>[]\n )\n\n const getFileMessageId = React.useCallback((id: string) => `${inputId}-${id}-message`, [inputId])\n\n const isInvalid = React.useMemo(() => {\n return rootError !== undefined || fileStatuses.some((fileStatus) => fileStatus.status === 'error')\n }, [fileStatuses, rootError])\n\n const uploadFile = React.useCallback(\n async (file: File, id: string, retryCount = 0) => {\n try {\n const result = await handleDropFile(file)\n\n if (result.status === 'error') {\n if (autoRetry && retryCount < (maxRetryCount ?? Number.POSITIVE_INFINITY)) {\n dispatch({ type: 'update-status', id, status: 'pending' })\n return uploadFile(file, id, retryCount + 1)\n }\n\n dispatch({\n type: 'update-status',\n id,\n status: 'error',\n error: result.error,\n message: getUploadErrorMessage(result.error, shapeUploadError)\n })\n onFileUploadError?.(result.error)\n return\n }\n\n dispatch({\n type: 'update-status',\n id,\n status: 'success',\n result: result.result\n })\n onFileUploaded?.(result.result)\n } catch (error) {\n const uploadError = error as TUploadError\n\n dispatch({\n type: 'update-status',\n id,\n status: 'error',\n error: uploadError,\n message: getUploadErrorMessage(uploadError, shapeUploadError)\n })\n onFileUploadError?.(uploadError)\n }\n },\n [autoRetry, handleDropFile, maxRetryCount, onFileUploadError, onFileUploaded, shapeUploadError]\n )\n\n const onRemoveFile = React.useCallback(\n async (id: string) => {\n await handleRemoveFile?.(id)\n dispatch({ type: 'remove', id })\n },\n [handleRemoveFile]\n )\n\n const canRetry = React.useCallback(\n (id: string) => {\n const fileStatus = fileStatuses.find((item) => item.id === id)\n\n return fileStatus?.status === 'error' && fileStatus.tries <= (maxRetryCount ?? Number.POSITIVE_INFINITY)\n },\n [fileStatuses, maxRetryCount]\n )\n\n const onRetry = React.useCallback(\n async (id: string) => {\n if (!canRetry(id)) {\n return\n }\n\n const fileStatus = fileStatuses.find((item) => item.id === id)\n\n if (!fileStatus || fileStatus.status !== 'error') {\n return\n }\n\n dispatch({ type: 'update-status', id, status: 'pending' })\n await uploadFile(fileStatus.file, id)\n },\n [canRetry, fileStatuses, uploadFile]\n )\n\n const dropzone = useReactDropzone({\n accept: validation?.accept,\n minSize: validation?.minSize,\n maxSize: validation?.maxSize,\n maxFiles: validation?.maxFiles,\n noClick: true,\n noKeyboard: true,\n onDropAccepted: async (acceptedFiles) => {\n setRootError(undefined)\n\n let nextFiles = acceptedFiles\n const maxFiles = validation?.maxFiles ?? Number.POSITIVE_INFINITY\n const overflow = Number.isFinite(maxFiles)\n ? Math.max(fileStatuses.length + acceptedFiles.length - maxFiles, 0)\n : 0\n\n if (overflow > 0) {\n if (shiftOnMaxFiles) {\n const filesToRemove = fileStatuses.slice(0, Math.min(overflow, fileStatuses.length))\n\n await Promise.all(filesToRemove.map((fileStatus) => onRemoveFile(fileStatus.id)))\n\n const remainingOverflow = overflow - filesToRemove.length\n if (remainingOverflow > 0) {\n nextFiles = acceptedFiles.slice(remainingOverflow)\n }\n } else {\n setRootError(getRootError([ErrorCode.TooManyFiles], validation ?? {}))\n const availableSlots = Math.max(maxFiles - fileStatuses.length, 0)\n nextFiles = acceptedFiles.slice(0, availableSlots)\n }\n }\n\n if (nextFiles.length === 0) {\n return\n }\n\n await Promise.all(\n nextFiles.map(async (file) => {\n const id = crypto.randomUUID()\n dispatch({ type: 'add', id, fileName: file.name, file })\n await uploadFile(file, id)\n })\n )\n\n onAllUploaded?.()\n },\n onDropRejected: (fileRejections) => {\n setRootError(getRejectionMessage(fileRejections, validation ?? {}))\n }\n })\n\n return {\n getRootProps: dropzone.getRootProps,\n getInputProps: dropzone.getInputProps,\n open: dropzone.open,\n onRemoveFile,\n onRetry,\n canRetry,\n fileStatuses,\n isInvalid,\n isDragActive: dropzone.isDragActive,\n rootError,\n inputId,\n rootMessageId,\n rootDescriptionId,\n getFileMessageId\n }\n}\n\nfunction Dropzone<TUploadResult, TUploadError>({ children, ...dropzone }: DropzoneProps<TUploadResult, TUploadError>) {\n return <DropzoneContext.Provider value={dropzone}>{children}</DropzoneContext.Provider>\n}\n\nconst DropzoneArea = React.forwardRef<HTMLDivElement, DropzoneAreaProps>(\n ({ className, children, ...props }, forwardedRef) => {\n const context = useDropzoneContext()\n const describedBy =\n [context.rootDescriptionId, context.isInvalid ? context.rootMessageId : undefined].filter(Boolean).join(' ') ||\n undefined\n\n const { ref: rootRef, ...rootProps } = context.getRootProps({\n ...props,\n 'data-slot': 'dropzone-area',\n 'aria-describedby': describedBy,\n 'aria-invalid': context.isInvalid || undefined,\n className: cn(\n 'flex min-h-44 flex-col items-center justify-center gap-4 rounded-xl border border-dashed border-input bg-muted/20 px-6 py-8 text-center transition-colors',\n context.isDragActive && 'border-primary bg-primary/5',\n context.isInvalid && 'border-destructive bg-destructive/5',\n className\n )\n }) as React.HTMLAttributes<HTMLDivElement> & {\n ref?: React.Ref<HTMLDivElement>\n }\n\n const inputProps = context.getInputProps({\n id: context.inputId,\n className: 'sr-only',\n 'aria-describedby': describedBy,\n 'aria-invalid': context.isInvalid,\n tabIndex: -1\n })\n\n return (\n <div {...rootProps} ref={composeRefs(forwardedRef, rootRef)}>\n <input {...inputProps} />\n {children}\n </div>\n )\n }\n)\n\nconst DropzoneDescription = React.forwardRef<HTMLParagraphElement, DropzoneDescriptionProps>(\n ({ className, ...props }, ref) => {\n const context = useDropzoneContext()\n\n return (\n <p\n ref={ref}\n id={context.rootDescriptionId}\n data-slot=\"dropzone-description\"\n className={cn('text-sm text-muted-foreground', className)}\n {...props}\n />\n )\n }\n)\n\nconst DropzoneFileList = React.forwardRef<HTMLOListElement, DropzoneFileListProps>(({ className, ...props }, ref) => {\n useDropzoneContext()\n\n return <ol ref={ref} data-slot=\"dropzone-file-list\" className={cn('space-y-3', className)} {...props} />\n})\n\nconst DropzoneFileListItem = React.forwardRef<HTMLLIElement, DropzoneFileListItemProps<unknown, unknown>>(\n ({ className, file, children, ...props }, ref) => {\n const context = useDropzoneContext()\n const messageId = context.getFileMessageId(file.id)\n const isInvalid = file.status === 'error'\n const canRetry = context.canRetry(file.id)\n\n const value = React.useMemo<DropzoneFileListContextValue<unknown, unknown>>(\n () => ({\n onRemoveFile: () => context.onRemoveFile(file.id),\n onRetry: () => context.onRetry(file.id),\n fileStatus: file,\n canRetry,\n dropzoneId: context.inputId,\n messageId\n }),\n [canRetry, context, file, messageId]\n )\n\n return (\n <DropzoneFileListContext.Provider value={value}>\n <li\n ref={ref}\n data-slot=\"dropzone-file-item\"\n data-status={file.status}\n aria-describedby={isInvalid ? messageId : undefined}\n className={cn(\n 'rounded-xl border bg-card px-4 py-3 shadow-xs',\n file.status === 'error' && 'border-destructive/50',\n className\n )}\n {...props}\n >\n {children}\n </li>\n </DropzoneFileListContext.Provider>\n )\n }\n)\n\nconst DropzoneFileMessage = React.forwardRef<HTMLParagraphElement, DropzoneFileMessageProps>(\n ({ className, children, ...props }, ref) => {\n const context = useDropzoneFileListContext()\n const body =\n context.fileStatus.status === 'error'\n ? (context.fileStatus.message ?? String(context.fileStatus.error))\n : children\n\n return (\n <p\n ref={ref}\n id={context.messageId}\n data-slot=\"dropzone-file-message\"\n className={cn(\n 'min-h-5 text-[0.8rem] font-medium',\n context.fileStatus.status === 'error' && 'text-destructive',\n className\n )}\n {...props}\n >\n {body}\n </p>\n )\n }\n)\n\nconst DropzoneMessage = React.forwardRef<HTMLParagraphElement, DropzoneMessageProps>(\n ({ className, children, ...props }, ref) => {\n const context = useDropzoneContext()\n const body = context.rootError ?? children\n\n return (\n <p\n ref={ref}\n id={context.rootMessageId}\n data-slot=\"dropzone-message\"\n className={cn('min-h-5 text-[0.8rem] font-medium text-destructive', className)}\n {...props}\n >\n {body}\n </p>\n )\n }\n)\n\nconst DropzoneRemoveFile = React.forwardRef<HTMLButtonElement, DropzoneRemoveFileProps>(\n ({ className, onClick, size = 'icon-sm', type = 'button', variant = 'ghost', ...props }, ref) => {\n const context = useDropzoneFileListContext()\n\n const handleClick = React.useCallback<React.MouseEventHandler<HTMLButtonElement>>(\n (event) => {\n onClick?.(event)\n if (event.defaultPrevented) {\n return\n }\n\n void context.onRemoveFile()\n },\n [context, onClick]\n )\n\n return (\n <Button\n ref={ref}\n data-slot=\"dropzone-remove-file\"\n className={cn(className)}\n onClick={handleClick}\n size={size}\n type={type}\n variant={variant}\n {...props}\n />\n )\n }\n)\n\nconst DropzoneRetryFile = React.forwardRef<HTMLButtonElement, DropzoneRetryFileProps>(\n ({ className, disabled, onClick, size = 'icon-sm', type = 'button', variant = 'ghost', ...props }, ref) => {\n const context = useDropzoneFileListContext()\n const isDisabled = disabled || !context.canRetry\n\n const handleClick = React.useCallback<React.MouseEventHandler<HTMLButtonElement>>(\n (event) => {\n onClick?.(event)\n if (event.defaultPrevented || isDisabled) {\n return\n }\n\n void context.onRetry()\n },\n [context, isDisabled, onClick]\n )\n\n return (\n <Button\n ref={ref}\n data-slot=\"dropzone-retry-file\"\n className={cn(className)}\n disabled={isDisabled}\n onClick={handleClick}\n size={size}\n type={type}\n variant={variant}\n {...props}\n />\n )\n }\n)\n\nconst DropzoneTrigger = React.forwardRef<HTMLButtonElement, DropzoneTriggerProps>(\n ({ className, onClick, size = 'sm', type = 'button', variant = 'subtle', ...props }, ref) => {\n const context = useDropzoneContext()\n const describedBy =\n [context.rootDescriptionId, context.isInvalid ? context.rootMessageId : undefined].filter(Boolean).join(' ') ||\n undefined\n\n const handleClick = React.useCallback<React.MouseEventHandler<HTMLButtonElement>>(\n (event) => {\n onClick?.(event)\n if (event.defaultPrevented) {\n return\n }\n\n context.open()\n },\n [context, onClick]\n )\n\n return (\n <Button\n ref={ref}\n aria-controls={context.inputId}\n aria-describedby={describedBy}\n aria-invalid={context.isInvalid || undefined}\n data-slot=\"dropzone-trigger\"\n className={cn(className)}\n onClick={handleClick}\n size={size}\n type={type}\n variant={variant}\n {...props}\n />\n )\n }\n)\n\nconst InfiniteProgress = React.forwardRef<HTMLDivElement, InfiniteProgressProps>(\n ({ className, status, ...props }, ref) => {\n const done = status === 'success' || status === 'error'\n const isError = status === 'error'\n\n return (\n <div\n ref={ref}\n aria-valuemax={100}\n aria-valuemin={0}\n aria-valuetext={valueTextMap[status]}\n data-slot=\"dropzone-progress\"\n data-status={status}\n role=\"progressbar\"\n className={cn('relative h-2 w-full overflow-hidden rounded-full bg-muted', className)}\n {...props}\n >\n <div\n className={cn(\n 'h-full w-full rounded-full bg-primary transition-transform',\n done ? 'translate-x-0' : 'animate-infinite-progress',\n isError && 'bg-destructive'\n )}\n />\n </div>\n )\n }\n)\n\nDropzone.displayName = 'Dropzone'\nDropzoneArea.displayName = 'DropzoneArea'\nDropzoneDescription.displayName = 'DropzoneDescription'\nDropzoneFileList.displayName = 'DropzoneFileList'\nDropzoneFileListItem.displayName = 'DropzoneFileListItem'\nDropzoneFileMessage.displayName = 'DropzoneFileMessage'\nDropzoneMessage.displayName = 'DropzoneMessage'\nDropzoneRemoveFile.displayName = 'DropzoneRemoveFile'\nDropzoneRetryFile.displayName = 'DropzoneRetryFile'\nDropzoneTrigger.displayName = 'DropzoneTrigger'\nInfiniteProgress.displayName = 'InfiniteProgress'\n\nexport {\n Dropzone,\n DropzoneArea,\n DropzoneDescription,\n DropzoneFileList,\n DropzoneFileListItem,\n DropzoneFileMessage,\n DropzoneMessage,\n DropzoneRemoveFile,\n DropzoneRetryFile,\n DropzoneTrigger,\n ErrorCode,\n type FileError,\n InfiniteProgress,\n useDropzone\n}\n"],"mappings":"6OAYA,MAAM,EAAqB,CACzB,EAAU,gBACV,EAAU,aACV,EAAU,aACV,EAAU,aACX,CAiJK,EAAuB,IAAI,IAAe,EAAmB,CAE7D,EAAe,CACnB,QAAS,gBACT,QAAS,OACT,MAAO,QACR,CAEK,EAAkB,EAAM,cAA0D,KAAK,CAEvF,EAA0B,EAAM,cAAqE,KAAK,CAEhH,SAAS,kBACP,EACA,EACmD,CACnD,OAAQ,EAAO,KAAf,CACE,IAAK,MACH,MAAO,CACL,GAAG,EACH,CACE,GAAI,EAAO,GACX,SAAU,EAAO,SACjB,KAAM,EAAO,KACb,OAAQ,UACR,MAAO,EACR,CACF,CACH,IAAK,SACH,OAAO,EAAM,OAAQ,GAAe,EAAW,KAAO,EAAO,GAA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AAG,GAAS,IAAQ,CAC3F,IAAM,EAAU,oBAAoB,CAC9B,EACJ,CAAC,EAAQ,kBAAmB,EAAQ,UAAY,EAAQ,cAAgB,IAAA,GAAU,CAAC,OAAO,QAAQ,CAAC,KAAK,IAAI,EAC5G,IAAA,GAEI,EAAc,EAAM,YACvB,GAAU,CACT,IAAU,EAAM,CACZ,GAAM,kBAIV,EAAQ,MAAM,EAEhB,CAAC,EAAS,EAAQ,CACnB,CAED,OACE,EAAC,EAAD,CACO,MACL,gBAAe,EAAQ,QACvB,mBAAkB,EAClB,eAAc,EAAQ,WAAa,IAAA,GACnC,YAAU,mBACV,UAAW,EAAG,EAAU,CACxB,QAAS,EACH,OACA,OACG,UACT,GAAI,EACJ,CAAA,EAGP,CAEK,EAAmB,EAAM,YAC5B,CAAE,YAAW,SAAQ,GAAG,GAAS,IAAQ,CACxC,IAAM,EAAO,IAAW,WAAa,IAAW,QAC1C,EAAU,IAAW,QAE3B,OACE,EAAC,MAAD,CACO,MACL,gBAAe,IACf,gBAAe,EACf,iBAAgB,EAAa,GAC7B,YAAU,oBACV,cAAa,EACb,KAAK,cACL,UAAW,EAAG,4DAA6D,EAAU,CACrF,GAAI,WAEJ,EAAC,MAAD,CACE,UAAW,EACT,6DACA,EAAO,gBAAkB,4BACzB,GAAW,iBACZ,CACD,CAAA,CACE,CAAA,EAGX,CAED,SAAS,YAAc,WACvB,EAAa,YAAc,eAC3B,EAAoB,YAAc,sBAClC,EAAiB,YAAc,mBAC/B,EAAqB,YAAc,uBACnC,EAAoB,YAAc,sBAClC,EAAgB,YAAc,kBAC9B,EAAmB,YAAc,qBACjC,EAAkB,YAAc,oBAChC,EAAgB,YAAc,kBAC9B,EAAiB,YAAc"}
@@ -1,7 +1,7 @@
1
- import { t as __name } from "../chunk-IpJEthwI.js";
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
1
+ import { n as __name } from "../chunk-CHh1Zzun.js";
2
+ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
3
3
  import { VariantProps } from "class-variance-authority";
4
- import * as class_variance_authority_types0 from "class-variance-authority/types";
4
+ import * as _$class_variance_authority_types0 from "class-variance-authority/types";
5
5
 
6
6
  //#region src/components/empty.d.ts
7
7
  type EmptyProps = React.ComponentProps<'div'>;
@@ -13,31 +13,31 @@ type EmptyContentProps = React.ComponentProps<'div'>;
13
13
  declare function Empty({
14
14
  className,
15
15
  ...props
16
- }: EmptyProps): react_jsx_runtime0.JSX.Element;
16
+ }: EmptyProps): _$react_jsx_runtime0.JSX.Element;
17
17
  declare function EmptyHeader({
18
18
  className,
19
19
  ...props
20
- }: EmptyHeaderProps): react_jsx_runtime0.JSX.Element;
20
+ }: EmptyHeaderProps): _$react_jsx_runtime0.JSX.Element;
21
21
  declare const emptyMediaVariants: (props?: ({
22
22
  variant?: "default" | "icon" | null | undefined;
23
- } & class_variance_authority_types0.ClassProp) | undefined) => string;
23
+ } & _$class_variance_authority_types0.ClassProp) | undefined) => string;
24
24
  declare function EmptyMedia({
25
25
  className,
26
26
  variant,
27
27
  ...props
28
- }: EmptyMediaProps): react_jsx_runtime0.JSX.Element;
28
+ }: EmptyMediaProps): _$react_jsx_runtime0.JSX.Element;
29
29
  declare function EmptyTitle({
30
30
  className,
31
31
  ...props
32
- }: EmptyTitleProps): react_jsx_runtime0.JSX.Element;
32
+ }: EmptyTitleProps): _$react_jsx_runtime0.JSX.Element;
33
33
  declare function EmptyDescription({
34
34
  className,
35
35
  ...props
36
- }: EmptyDescriptionProps): react_jsx_runtime0.JSX.Element;
36
+ }: EmptyDescriptionProps): _$react_jsx_runtime0.JSX.Element;
37
37
  declare function EmptyContent({
38
38
  className,
39
39
  ...props
40
- }: EmptyContentProps): react_jsx_runtime0.JSX.Element;
40
+ }: EmptyContentProps): _$react_jsx_runtime0.JSX.Element;
41
41
  //#endregion
42
42
  export { Empty, EmptyContent, EmptyContentProps, EmptyDescription, EmptyDescriptionProps, EmptyHeader, EmptyHeaderProps, EmptyMedia, EmptyMediaProps, EmptyProps, EmptyTitle, EmptyTitleProps };
43
43
  //# sourceMappingURL=empty.d.ts.map
@@ -1,2 +1,2 @@
1
- import"../chunk-IpJEthwI.js";import{cn as e}from"../lib/utils.js";import{jsx as t}from"react/jsx-runtime";import{cva as n}from"class-variance-authority";function Empty({className:n,...r}){return t(`div`,{"data-slot":`empty`,className:e(`gap-4 rounded-xl border-dashed p-6 flex w-full min-w-0 flex-1 flex-col items-center justify-center text-center text-balance`,n),...r})}function EmptyHeader({className:n,...r}){return t(`div`,{"data-slot":`empty-header`,className:e(`gap-2 flex max-w-sm flex-col items-center`,n),...r})}const r=n(`mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-transparent`,icon:`bg-muted text-foreground flex size-8 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-4`}},defaultVariants:{variant:`default`}});function EmptyMedia({className:n,variant:i=`default`,...a}){return t(`div`,{"data-slot":`empty-icon`,"data-variant":i,className:e(r({variant:i,className:n})),...a})}function EmptyTitle({className:n,...r}){return t(`div`,{"data-slot":`empty-title`,className:e(`text-sm font-medium tracking-tight`,n),...r})}function EmptyDescription({className:n,...r}){return t(`div`,{"data-slot":`empty-description`,className:e(`text-sm/relaxed text-muted-foreground [&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4`,n),...r})}function EmptyContent({className:n,...r}){return t(`div`,{"data-slot":`empty-content`,className:e(`gap-2.5 text-sm flex w-full max-w-sm min-w-0 flex-col items-center text-balance`,n),...r})}export{Empty,EmptyContent,EmptyDescription,EmptyHeader,EmptyMedia,EmptyTitle};
1
+ import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{jsx as t}from"react/jsx-runtime";import{cva as n}from"class-variance-authority";function Empty({className:n,...r}){return t(`div`,{"data-slot":`empty`,className:e(`gap-4 rounded-xl border-dashed p-6 flex w-full min-w-0 flex-1 flex-col items-center justify-center text-center text-balance`,n),...r})}function EmptyHeader({className:n,...r}){return t(`div`,{"data-slot":`empty-header`,className:e(`gap-2 flex max-w-sm flex-col items-center`,n),...r})}const r=n(`mb-2 flex shrink-0 items-center justify-center [&_svg]:pointer-events-none [&_svg]:shrink-0`,{variants:{variant:{default:`bg-transparent`,icon:`bg-muted text-foreground flex size-8 shrink-0 items-center justify-center rounded-lg [&_svg:not([class*='size-'])]:size-4`}},defaultVariants:{variant:`default`}});function EmptyMedia({className:n,variant:i=`default`,...a}){return t(`div`,{"data-slot":`empty-icon`,"data-variant":i,className:e(r({variant:i,className:n})),...a})}function EmptyTitle({className:n,...r}){return t(`div`,{"data-slot":`empty-title`,className:e(`text-sm font-medium tracking-tight`,n),...r})}function EmptyDescription({className:n,...r}){return t(`div`,{"data-slot":`empty-description`,className:e(`text-sm/relaxed text-muted-foreground [&>a:hover]:text-primary [&>a]:underline [&>a]:underline-offset-4`,n),...r})}function EmptyContent({className:n,...r}){return t(`div`,{"data-slot":`empty-content`,className:e(`gap-2.5 text-sm flex w-full max-w-sm min-w-0 flex-col items-center text-balance`,n),...r})}export{Empty,EmptyContent,EmptyDescription,EmptyHeader,EmptyMedia,EmptyTitle};
2
2
  //# sourceMappingURL=empty.js.map
@@ -1,8 +1,8 @@
1
- import { t as __name } from "../chunk-IpJEthwI.js";
1
+ import { n as __name } from "../chunk-CHh1Zzun.js";
2
2
  import { Label } from "./label.js";
3
- import * as react_jsx_runtime0 from "react/jsx-runtime";
3
+ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
4
4
  import { VariantProps } from "class-variance-authority";
5
- import * as class_variance_authority_types0 from "class-variance-authority/types";
5
+ import * as _$class_variance_authority_types0 from "class-variance-authority/types";
6
6
 
7
7
  //#region src/components/field.d.ts
8
8
  type FieldSetProps = React.ComponentProps<'fieldset'>;
@@ -25,52 +25,52 @@ type FieldErrorProps = React.ComponentProps<'div'> & {
25
25
  declare function FieldSet({
26
26
  className,
27
27
  ...props
28
- }: FieldSetProps): react_jsx_runtime0.JSX.Element;
28
+ }: FieldSetProps): _$react_jsx_runtime0.JSX.Element;
29
29
  declare function FieldLegend({
30
30
  className,
31
31
  variant,
32
32
  ...props
33
- }: FieldLegendProps): react_jsx_runtime0.JSX.Element;
33
+ }: FieldLegendProps): _$react_jsx_runtime0.JSX.Element;
34
34
  declare function FieldGroup({
35
35
  className,
36
36
  ...props
37
- }: FieldGroupProps): react_jsx_runtime0.JSX.Element;
37
+ }: FieldGroupProps): _$react_jsx_runtime0.JSX.Element;
38
38
  declare const fieldVariants: (props?: ({
39
39
  orientation?: "horizontal" | "vertical" | "responsive" | null | undefined;
40
- } & class_variance_authority_types0.ClassProp) | undefined) => string;
40
+ } & _$class_variance_authority_types0.ClassProp) | undefined) => string;
41
41
  type FieldProps = React.ComponentProps<'div'> & VariantProps<typeof fieldVariants>;
42
42
  declare function Field({
43
43
  className,
44
44
  orientation,
45
45
  ...props
46
- }: FieldProps): react_jsx_runtime0.JSX.Element;
46
+ }: FieldProps): _$react_jsx_runtime0.JSX.Element;
47
47
  declare function FieldContent({
48
48
  className,
49
49
  ...props
50
- }: FieldContentProps): react_jsx_runtime0.JSX.Element;
50
+ }: FieldContentProps): _$react_jsx_runtime0.JSX.Element;
51
51
  declare function FieldLabel({
52
52
  className,
53
53
  ...props
54
- }: FieldLabelProps): react_jsx_runtime0.JSX.Element;
54
+ }: FieldLabelProps): _$react_jsx_runtime0.JSX.Element;
55
55
  declare function FieldTitle({
56
56
  className,
57
57
  ...props
58
- }: FieldTitleProps): react_jsx_runtime0.JSX.Element;
58
+ }: FieldTitleProps): _$react_jsx_runtime0.JSX.Element;
59
59
  declare function FieldDescription({
60
60
  className,
61
61
  ...props
62
- }: FieldDescriptionProps): react_jsx_runtime0.JSX.Element;
62
+ }: FieldDescriptionProps): _$react_jsx_runtime0.JSX.Element;
63
63
  declare function FieldSeparator({
64
64
  children,
65
65
  className,
66
66
  ...props
67
- }: FieldSeparatorProps): react_jsx_runtime0.JSX.Element;
67
+ }: FieldSeparatorProps): _$react_jsx_runtime0.JSX.Element;
68
68
  declare function FieldError({
69
69
  className,
70
70
  children,
71
71
  errors,
72
72
  ...props
73
- }: FieldErrorProps): react_jsx_runtime0.JSX.Element | null;
73
+ }: FieldErrorProps): _$react_jsx_runtime0.JSX.Element | null;
74
74
  //#endregion
75
75
  export { Field, FieldContent, FieldContentProps, FieldDescription, FieldDescriptionProps, FieldError, FieldErrorProps, FieldGroup, FieldGroupProps, FieldLabel, FieldLabelProps, FieldLegend, FieldLegendProps, FieldProps, FieldSeparator, FieldSeparatorProps, FieldSet, FieldSetProps, FieldTitle, FieldTitleProps };
76
76
  //# sourceMappingURL=field.d.ts.map
@@ -1,2 +1,2 @@
1
- import"../chunk-IpJEthwI.js";import{cn as e}from"../lib/utils.js";import{Separator as t}from"./separator.js";import{Label as n}from"./label.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";import{cva as a}from"class-variance-authority";import{useMemo as o}from"react";function FieldSet({className:t,...n}){return r(`fieldset`,{"data-slot":`field-set`,className:e(`flex flex-col gap-4`,`has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,t),...n})}function FieldLegend({className:t,variant:n=`legend`,...i}){return r(`legend`,{"data-slot":`field-legend`,"data-variant":n,className:e(`mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base`,t),...i})}function FieldGroup({className:t,...n}){return r(`div`,{"data-slot":`field-group`,className:e(`group/field-group @container/field-group flex w-full flex-col gap-5`,`data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,t),...n})}const s=a(`data-[invalid=true]:text-destructive gap-2 group/field flex w-full`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:*:data-[slot=field-label]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function Field({className:t,orientation:n=`vertical`,...i}){return r(`div`,{"data-slot":`field`,"data-orientation":n,className:e(s({orientation:n}),t),...i})}function FieldContent({className:t,...n}){return r(`div`,{"data-slot":`field-content`,className:e(`gap-0.5 group/field-content flex flex-1 flex-col leading-snug`,t),...n})}function FieldLabel({className:t,...i}){return r(n,{"data-slot":`field-label`,className:e(`group/field-label peer/field-label flex w-fit gap-2 leading-snug`,`has-data-checked:bg-primary/5 has-data-checked:border-primary/30 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5`,`group-data-[disabled=true]/field:opacity-50`,t),...i})}function FieldTitle({className:t,...n}){return r(`div`,{"data-slot":`field-label`,className:e(`gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50 flex w-fit items-center leading-snug`,t),...n})}function FieldDescription({className:t,...n}){return r(`p`,{"data-slot":`field-description`,className:e(`text-muted-foreground text-left text-sm leading-normal font-normal`,`[[data-variant=legend]+&]:-mt-1.5 group-has-data-horizontal/field:text-balance last:mt-0 nth-last-2:-mt-1`,`[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,t),...n})}function FieldSeparator({children:n,className:a,...o}){return i(`div`,{"data-slot":`field-separator`,"data-content":!!n,className:e(`-my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2 relative`,a),...o,children:[r(t,{className:`absolute inset-0 top-1/2`}),n&&r(`span`,{className:`text-muted-foreground px-2 bg-background relative mx-auto block w-fit`,"data-slot":`field-separator-content`,children:n})]})}function FieldError({className:t,children:n,errors:i,...a}){let s=o(()=>{if(n)return n;if(!i?.length)return null;let e=[...new Map(i.map(e=>[e?.message,e])).values()];return e?.length===1?e[0]?.message:r(`ul`,{className:`ml-4 flex list-disc flex-col gap-1`,children:e.map(e=>e?.message&&r(`li`,{children:e.message},e.message))})},[n,i]);return s?r(`div`,{role:`alert`,"data-slot":`field-error`,className:e(`text-destructive text-sm font-normal`,t),...a,children:s}):null}export{Field,FieldContent,FieldDescription,FieldError,FieldGroup,FieldLabel,FieldLegend,FieldSeparator,FieldSet,FieldTitle};
1
+ import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{Separator as t}from"./separator.js";import{Label as n}from"./label.js";import{jsx as r,jsxs as i}from"react/jsx-runtime";import{cva as a}from"class-variance-authority";import{useMemo as o}from"react";function FieldSet({className:t,...n}){return r(`fieldset`,{"data-slot":`field-set`,className:e(`flex flex-col gap-4`,`has-[>[data-slot=checkbox-group]]:gap-3 has-[>[data-slot=radio-group]]:gap-3`,t),...n})}function FieldLegend({className:t,variant:n=`legend`,...i}){return r(`legend`,{"data-slot":`field-legend`,"data-variant":n,className:e(`mb-1.5 font-medium data-[variant=label]:text-sm data-[variant=legend]:text-base`,t),...i})}function FieldGroup({className:t,...n}){return r(`div`,{"data-slot":`field-group`,className:e(`group/field-group @container/field-group flex w-full flex-col gap-5`,`data-[slot=checkbox-group]:gap-3 *:data-[slot=field-group]:gap-4`,t),...n})}const s=a(`data-[invalid=true]:text-destructive gap-2 group/field flex w-full`,{variants:{orientation:{vertical:`flex-col *:w-full [&>.sr-only]:w-auto`,horizontal:`flex-row items-center *:data-[slot=field-label]:flex-auto has-[>[data-slot=field-content]]:items-start has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`,responsive:`flex-col *:w-full [&>.sr-only]:w-auto @md/field-group:flex-row @md/field-group:items-center @md/field-group:*:w-auto @md/field-group:*:data-[slot=field-label]:flex-auto @md/field-group:has-[>[data-slot=field-content]]:items-start @md/field-group:has-[>[data-slot=field-content]]:[&>[role=checkbox],[role=radio]]:mt-px`}},defaultVariants:{orientation:`vertical`}});function Field({className:t,orientation:n=`vertical`,...i}){return r(`div`,{"data-slot":`field`,"data-orientation":n,className:e(s({orientation:n}),t),...i})}function FieldContent({className:t,...n}){return r(`div`,{"data-slot":`field-content`,className:e(`gap-0.5 group/field-content flex flex-1 flex-col leading-snug`,t),...n})}function FieldLabel({className:t,...i}){return r(n,{"data-slot":`field-label`,className:e(`group/field-label peer/field-label flex w-fit gap-2 leading-snug`,`has-data-checked:bg-primary/5 has-data-checked:border-primary/30 dark:has-data-checked:border-primary/20 dark:has-data-checked:bg-primary/10`,`has-[>[data-slot=field]]:w-full has-[>[data-slot=field]]:flex-col has-[>[data-slot=field]]:rounded-lg has-[>[data-slot=field]]:border *:data-[slot=field]:p-2.5`,`group-data-[disabled=true]/field:opacity-50`,t),...i})}function FieldTitle({className:t,...n}){return r(`div`,{"data-slot":`field-label`,className:e(`gap-2 text-sm font-medium group-data-[disabled=true]/field:opacity-50 flex w-fit items-center leading-snug`,t),...n})}function FieldDescription({className:t,...n}){return r(`p`,{"data-slot":`field-description`,className:e(`text-muted-foreground text-left text-sm leading-normal font-normal`,`[[data-variant=legend]+&]:-mt-1.5 group-has-data-horizontal/field:text-balance last:mt-0 nth-last-2:-mt-1`,`[&>a]:underline [&>a]:underline-offset-4 [&>a:hover]:text-primary`,t),...n})}function FieldSeparator({children:n,className:a,...o}){return i(`div`,{"data-slot":`field-separator`,"data-content":!!n,className:e(`-my-2 h-5 text-sm group-data-[variant=outline]/field-group:-mb-2 relative`,a),...o,children:[r(t,{className:`absolute inset-0 top-1/2`}),n&&r(`span`,{className:`text-muted-foreground px-2 bg-background relative mx-auto block w-fit`,"data-slot":`field-separator-content`,children:n})]})}function FieldError({className:t,children:n,errors:i,...a}){let s=o(()=>{if(n)return n;if(!i?.length)return null;let e=[...new Map(i.map(e=>[e?.message,e])).values()];return e?.length===1?e[0]?.message:r(`ul`,{className:`ml-4 flex list-disc flex-col gap-1`,children:e.map(e=>e?.message&&r(`li`,{children:e.message},e.message))})},[n,i]);return s?r(`div`,{role:`alert`,"data-slot":`field-error`,className:e(`text-destructive text-sm font-normal`,t),...a,children:s}):null}export{Field,FieldContent,FieldDescription,FieldError,FieldGroup,FieldLabel,FieldLegend,FieldSeparator,FieldSet,FieldTitle};
2
2
  //# sourceMappingURL=field.js.map
@@ -1,21 +1,21 @@
1
- import { t as __name } from "../chunk-IpJEthwI.js";
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
1
+ import { n as __name } from "../chunk-CHh1Zzun.js";
2
+ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
3
3
  import { VariantProps } from "class-variance-authority";
4
4
  import * as React from "react";
5
- import * as class_variance_authority_types0 from "class-variance-authority/types";
5
+ import * as _$class_variance_authority_types0 from "class-variance-authority/types";
6
6
 
7
7
  //#region src/components/group.d.ts
8
8
  declare const groupVariants: (props?: ({
9
9
  size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
10
10
  wrap?: boolean | null | undefined;
11
- } & class_variance_authority_types0.ClassProp) | undefined) => string;
11
+ } & _$class_variance_authority_types0.ClassProp) | undefined) => string;
12
12
  type GroupProps = React.ComponentProps<'div'> & VariantProps<typeof groupVariants>;
13
13
  declare function Group({
14
14
  className,
15
15
  size,
16
16
  wrap,
17
17
  ...props
18
- }: GroupProps): react_jsx_runtime0.JSX.Element;
18
+ }: GroupProps): _$react_jsx_runtime0.JSX.Element;
19
19
  //#endregion
20
20
  export { Group, GroupProps, groupVariants };
21
21
  //# sourceMappingURL=group.d.ts.map
@@ -1,2 +1,2 @@
1
- import"../chunk-IpJEthwI.js";import{cn as e}from"../lib/utils.js";import{jsx as t}from"react/jsx-runtime";import{cva as n}from"class-variance-authority";const r=n(`flex flex-row items-center`,{variants:{size:{xs:`gap-1`,sm:`gap-2`,md:`gap-3`,lg:`gap-4`,xl:`gap-6`},wrap:{true:`flex-wrap`,false:`flex-nowrap`}},defaultVariants:{size:`md`,wrap:!1}});function Group({className:n,size:i=`md`,wrap:a=!1,...o}){return t(`div`,{"data-slot":`group`,"data-size":i,"data-wrap":a?`true`:`false`,className:e(r({size:i,wrap:a}),n),...o})}export{Group,r as groupVariants};
1
+ import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{jsx as t}from"react/jsx-runtime";import{cva as n}from"class-variance-authority";const r=n(`flex flex-row items-center`,{variants:{size:{xs:`gap-1`,sm:`gap-2`,md:`gap-3`,lg:`gap-4`,xl:`gap-6`},wrap:{true:`flex-wrap`,false:`flex-nowrap`}},defaultVariants:{size:`md`,wrap:!1}});function Group({className:n,size:i=`md`,wrap:a=!1,...o}){return t(`div`,{"data-slot":`group`,"data-size":i,"data-wrap":a?`true`:`false`,className:e(r({size:i,wrap:a}),n),...o})}export{Group,r as groupVariants};
2
2
  //# sourceMappingURL=group.js.map
@@ -1,13 +1,13 @@
1
- import { t as __name } from "../chunk-IpJEthwI.js";
2
- import * as react_jsx_runtime0 from "react/jsx-runtime";
1
+ import { n as __name } from "../chunk-CHh1Zzun.js";
2
+ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
3
3
  import { VariantProps } from "class-variance-authority";
4
4
  import * as React from "react";
5
- import * as class_variance_authority_types0 from "class-variance-authority/types";
5
+ import * as _$class_variance_authority_types0 from "class-variance-authority/types";
6
6
 
7
7
  //#region src/components/heading.d.ts
8
8
  declare const headingVariants: (props?: ({
9
9
  size?: "xs" | "sm" | "md" | "lg" | "xl" | null | undefined;
10
- } & class_variance_authority_types0.ClassProp) | undefined) => string;
10
+ } & _$class_variance_authority_types0.ClassProp) | undefined) => string;
11
11
  type HeadingProps = React.ComponentProps<'h2'> & VariantProps<typeof headingVariants> & {
12
12
  asChild?: boolean;
13
13
  };
@@ -16,7 +16,7 @@ declare function Heading({
16
16
  size,
17
17
  asChild,
18
18
  ...props
19
- }: HeadingProps): react_jsx_runtime0.JSX.Element;
19
+ }: HeadingProps): _$react_jsx_runtime0.JSX.Element;
20
20
  //#endregion
21
21
  export { Heading, HeadingProps, headingVariants };
22
22
  //# sourceMappingURL=heading.d.ts.map
@@ -1,2 +1,2 @@
1
- import"../chunk-IpJEthwI.js";import{cn as e}from"../lib/utils.js";import{Slot as t}from"radix-ui";import{jsx as n}from"react/jsx-runtime";import{cva as r}from"class-variance-authority";const i=r(`text-foreground font-semibold tracking-tight`,{variants:{size:{xs:`text-lg leading-7`,sm:`text-xl leading-8`,md:`text-2xl leading-tight`,lg:`text-3xl leading-tight`,xl:`text-4xl leading-none`}},defaultVariants:{size:`md`}});function Heading({className:r,size:a=`md`,asChild:o=!1,...s}){return n(o?t.Root:`h2`,{"data-slot":`heading`,"data-size":a,className:e(i({size:a}),r),...s})}export{Heading,i as headingVariants};
1
+ import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{Slot as t}from"radix-ui";import{jsx as n}from"react/jsx-runtime";import{cva as r}from"class-variance-authority";const i=r(`text-foreground font-semibold tracking-tight`,{variants:{size:{xs:`text-lg leading-7`,sm:`text-xl leading-8`,md:`text-2xl leading-tight`,lg:`text-3xl leading-tight`,xl:`text-4xl leading-none`}},defaultVariants:{size:`md`}});function Heading({className:r,size:a=`md`,asChild:o=!1,...s}){return n(o?t.Root:`h2`,{"data-slot":`heading`,"data-size":a,className:e(i({size:a}),r),...s})}export{Heading,i as headingVariants};
2
2
  //# sourceMappingURL=heading.js.map
@@ -1,6 +1,6 @@
1
- import { t as __name } from "../chunk-IpJEthwI.js";
1
+ import { n as __name } from "../chunk-CHh1Zzun.js";
2
2
  import { HoverCard as HoverCard$1 } from "radix-ui";
3
- import * as react_jsx_runtime0 from "react/jsx-runtime";
3
+ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
4
4
  import * as React from "react";
5
5
 
6
6
  //#region src/components/hover-card.d.ts
@@ -9,16 +9,16 @@ type HoverCardTriggerProps = React.ComponentProps<typeof HoverCard$1.Trigger>;
9
9
  type HoverCardContentProps = React.ComponentProps<typeof HoverCard$1.Content>;
10
10
  declare function HoverCard({
11
11
  ...props
12
- }: HoverCardProps): react_jsx_runtime0.JSX.Element;
12
+ }: HoverCardProps): _$react_jsx_runtime0.JSX.Element;
13
13
  declare function HoverCardTrigger({
14
14
  ...props
15
- }: HoverCardTriggerProps): react_jsx_runtime0.JSX.Element;
15
+ }: HoverCardTriggerProps): _$react_jsx_runtime0.JSX.Element;
16
16
  declare function HoverCardContent({
17
17
  className,
18
18
  align,
19
19
  sideOffset,
20
20
  ...props
21
- }: HoverCardContentProps): react_jsx_runtime0.JSX.Element;
21
+ }: HoverCardContentProps): _$react_jsx_runtime0.JSX.Element;
22
22
  //#endregion
23
23
  export { HoverCard, HoverCardContent, HoverCardContentProps, HoverCardProps, HoverCardTrigger, HoverCardTriggerProps };
24
24
  //# sourceMappingURL=hover-card.d.ts.map
@@ -1,2 +1,2 @@
1
- import"../chunk-IpJEthwI.js";import{cn as e}from"../lib/utils.js";import{HoverCard as t}from"radix-ui";import{jsx as n}from"react/jsx-runtime";function HoverCard({...e}){return n(t.Root,{"data-slot":`hover-card`,...e})}function HoverCardTrigger({...e}){return n(t.Trigger,{"data-slot":`hover-card-trigger`,...e})}function HoverCardContent({className:r,align:i=`center`,sideOffset:a=4,...o}){return n(t.Portal,{"data-slot":`hover-card-portal`,children:n(t.Content,{"data-slot":`hover-card-content`,align:i,sideOffset:a,className:e(`z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,r),...o})})}export{HoverCard,HoverCardContent,HoverCardTrigger};
1
+ import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{HoverCard as t}from"radix-ui";import{jsx as n}from"react/jsx-runtime";function HoverCard({...e}){return n(t.Root,{"data-slot":`hover-card`,...e})}function HoverCardTrigger({...e}){return n(t.Trigger,{"data-slot":`hover-card-trigger`,...e})}function HoverCardContent({className:r,align:i=`center`,sideOffset:a=4,...o}){return n(t.Portal,{"data-slot":`hover-card-portal`,children:n(t.Content,{"data-slot":`hover-card-content`,align:i,sideOffset:a,className:e(`z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95`,r),...o})})}export{HoverCard,HoverCardContent,HoverCardTrigger};
2
2
  //# sourceMappingURL=hover-card.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"hover-card.js","names":["HoverCardPrimitive"],"sources":["../../src/components/hover-card.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { HoverCard as HoverCardPrimitive } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\n\nexport type HoverCardProps = React.ComponentProps<typeof HoverCardPrimitive.Root>\n\nexport type HoverCardTriggerProps = React.ComponentProps<typeof HoverCardPrimitive.Trigger>\n\nexport type HoverCardContentProps = React.ComponentProps<typeof HoverCardPrimitive.Content>\n\nfunction HoverCard({ ...props }: HoverCardProps) {\n return <HoverCardPrimitive.Root data-slot=\"hover-card\" {...props} />\n}\n\nfunction HoverCardTrigger({ ...props }: HoverCardTriggerProps) {\n return <HoverCardPrimitive.Trigger data-slot=\"hover-card-trigger\" {...props} />\n}\n\nfunction HoverCardContent({ className, align = 'center', sideOffset = 4, ...props }: HoverCardContentProps) {\n return (\n <HoverCardPrimitive.Portal data-slot=\"hover-card-portal\">\n <HoverCardPrimitive.Content\n data-slot=\"hover-card-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n className\n )}\n {...props}\n />\n </HoverCardPrimitive.Portal>\n )\n}\n\nexport { HoverCard, HoverCardTrigger, HoverCardContent }\n"],"mappings":"+IAYA,SAAS,UAAU,CAAE,GAAG,GAAyB,CAC/C,OAAO,EAACA,EAAmB,KAApB,CAAyB,YAAU,aAAa,GAAI,EAAS,CAAA,CAGtE,SAAS,iBAAiB,CAAE,GAAG,GAAgC,CAC7D,OAAO,EAACA,EAAmB,QAApB,CAA4B,YAAU,qBAAqB,GAAI,EAAS,CAAA,CAGjF,SAAS,iBAAiB,CAAE,YAAW,QAAQ,SAAU,aAAa,EAAG,GAAG,GAAgC,CAC1G,OACE,EAACA,EAAmB,OAApB,CAA2B,YAAU,6BACnC,EAACA,EAAmB,QAApB,CACE,YAAU,qBACH,QACK,aACZ,UAAW,EACT,8dACA,EACD,CACD,GAAI,EACJ,CAAA,CACwB,CAAA"}
1
+ {"version":3,"file":"hover-card.js","names":["HoverCardPrimitive"],"sources":["../../src/components/hover-card.tsx"],"sourcesContent":["import type * as React from 'react'\n\nimport { HoverCard as HoverCardPrimitive } from 'radix-ui'\n\nimport { cn } from '../lib/utils'\n\nexport type HoverCardProps = React.ComponentProps<typeof HoverCardPrimitive.Root>\n\nexport type HoverCardTriggerProps = React.ComponentProps<typeof HoverCardPrimitive.Trigger>\n\nexport type HoverCardContentProps = React.ComponentProps<typeof HoverCardPrimitive.Content>\n\nfunction HoverCard({ ...props }: HoverCardProps) {\n return <HoverCardPrimitive.Root data-slot=\"hover-card\" {...props} />\n}\n\nfunction HoverCardTrigger({ ...props }: HoverCardTriggerProps) {\n return <HoverCardPrimitive.Trigger data-slot=\"hover-card-trigger\" {...props} />\n}\n\nfunction HoverCardContent({ className, align = 'center', sideOffset = 4, ...props }: HoverCardContentProps) {\n return (\n <HoverCardPrimitive.Portal data-slot=\"hover-card-portal\">\n <HoverCardPrimitive.Content\n data-slot=\"hover-card-content\"\n align={align}\n sideOffset={sideOffset}\n className={cn(\n 'z-50 w-64 origin-(--radix-hover-card-content-transform-origin) rounded-lg bg-popover p-2.5 text-sm text-popover-foreground shadow-md ring-1 ring-foreground/10 outline-hidden duration-100 data-[side=bottom]:slide-in-from-top-2 data-[side=left]:slide-in-from-right-2 data-[side=right]:slide-in-from-left-2 data-[side=top]:slide-in-from-bottom-2 data-open:animate-in data-open:fade-in-0 data-open:zoom-in-95 data-closed:animate-out data-closed:fade-out-0 data-closed:zoom-out-95',\n className\n )}\n {...props}\n />\n </HoverCardPrimitive.Portal>\n )\n}\n\nexport { HoverCard, HoverCardContent, HoverCardTrigger }\n"],"mappings":"+IAYA,SAAS,UAAU,CAAE,GAAG,GAAyB,CAC/C,OAAO,EAACA,EAAmB,KAApB,CAAyB,YAAU,aAAa,GAAI,EAAS,CAAA,CAGtE,SAAS,iBAAiB,CAAE,GAAG,GAAgC,CAC7D,OAAO,EAACA,EAAmB,QAApB,CAA4B,YAAU,qBAAqB,GAAI,EAAS,CAAA,CAGjF,SAAS,iBAAiB,CAAE,YAAW,QAAQ,SAAU,aAAa,EAAG,GAAG,GAAgC,CAC1G,OACE,EAACA,EAAmB,OAApB,CAA2B,YAAU,6BACnC,EAACA,EAAmB,QAApB,CACE,YAAU,qBACH,QACK,aACZ,UAAW,EACT,8dACA,EACD,CACD,GAAI,EACJ,CAAA,CACwB,CAAA"}
@@ -1,9 +1,9 @@
1
- import { t as __name } from "../chunk-IpJEthwI.js";
1
+ import { n as __name } from "../chunk-CHh1Zzun.js";
2
2
  import { Button } from "./button.js";
3
- import * as react_jsx_runtime0 from "react/jsx-runtime";
3
+ import * as _$react_jsx_runtime0 from "react/jsx-runtime";
4
4
  import { VariantProps } from "class-variance-authority";
5
5
  import * as React from "react";
6
- import * as class_variance_authority_types0 from "class-variance-authority/types";
6
+ import * as _$class_variance_authority_types0 from "class-variance-authority/types";
7
7
 
8
8
  //#region src/components/input-group.d.ts
9
9
  type InputGroupProps = React.ComponentProps<'div'>;
@@ -15,18 +15,18 @@ type InputGroupTextareaProps = React.ComponentProps<'textarea'>;
15
15
  declare function InputGroup({
16
16
  className,
17
17
  ...props
18
- }: InputGroupProps): react_jsx_runtime0.JSX.Element;
18
+ }: InputGroupProps): _$react_jsx_runtime0.JSX.Element;
19
19
  declare const inputGroupAddonVariants: (props?: ({
20
20
  align?: "inline-start" | "inline-end" | "block-start" | "block-end" | null | undefined;
21
- } & class_variance_authority_types0.ClassProp) | undefined) => string;
21
+ } & _$class_variance_authority_types0.ClassProp) | undefined) => string;
22
22
  declare function InputGroupAddon({
23
23
  className,
24
24
  align,
25
25
  ...props
26
- }: InputGroupAddonProps): react_jsx_runtime0.JSX.Element;
26
+ }: InputGroupAddonProps): _$react_jsx_runtime0.JSX.Element;
27
27
  declare const inputGroupButtonVariants: (props?: ({
28
28
  size?: "xs" | "sm" | "icon-xs" | "icon-sm" | null | undefined;
29
- } & class_variance_authority_types0.ClassProp) | undefined) => string;
29
+ } & _$class_variance_authority_types0.ClassProp) | undefined) => string;
30
30
  declare function InputGroupButton({
31
31
  className,
32
32
  type,
@@ -34,19 +34,19 @@ declare function InputGroupButton({
34
34
  size,
35
35
  color,
36
36
  ...props
37
- }: InputGroupButtonProps): react_jsx_runtime0.JSX.Element;
37
+ }: InputGroupButtonProps): _$react_jsx_runtime0.JSX.Element;
38
38
  declare function InputGroupText({
39
39
  className,
40
40
  ...props
41
- }: InputGroupTextProps): react_jsx_runtime0.JSX.Element;
41
+ }: InputGroupTextProps): _$react_jsx_runtime0.JSX.Element;
42
42
  declare function InputGroupInput({
43
43
  className,
44
44
  ...props
45
- }: InputGroupInputProps): react_jsx_runtime0.JSX.Element;
45
+ }: InputGroupInputProps): _$react_jsx_runtime0.JSX.Element;
46
46
  declare function InputGroupTextarea({
47
47
  className,
48
48
  ...props
49
- }: InputGroupTextareaProps): react_jsx_runtime0.JSX.Element;
49
+ }: InputGroupTextareaProps): _$react_jsx_runtime0.JSX.Element;
50
50
  //#endregion
51
51
  export { InputGroup, InputGroupAddon, InputGroupAddonProps, InputGroupButton, InputGroupButtonProps, InputGroupInput, InputGroupInputProps, InputGroupProps, InputGroupText, InputGroupTextProps, InputGroupTextarea, InputGroupTextareaProps };
52
52
  //# sourceMappingURL=input-group.d.ts.map
@@ -1,2 +1,2 @@
1
- import"../chunk-IpJEthwI.js";import{cn as e}from"../lib/utils.js";import{Button as t}from"./button.js";import{Input as n}from"./input.js";import{Textarea as r}from"./textarea.js";import{jsx as i}from"react/jsx-runtime";import{cva as a}from"class-variance-authority";function InputGroup({className:t,...n}){return i(`div`,{"data-slot":`input-group`,className:e(`group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,t),...n})}const o=a(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function InputGroupAddon({className:t,align:n=`inline-start`,...r}){return i(`div`,{"data-slot":`input-group-addon`,"data-align":n,className:e(o({align:n}),t),...r})}const s=a(`flex items-center gap-2 text-sm shadow-none`,{variants:{size:{xs:`h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5`,sm:``,"icon-xs":`size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function InputGroupButton({className:n,type:r=`button`,variant:a=`ghost`,size:o=`xs`,color:c=`zinc`,...l}){return i(t,{type:r,"data-size":o,variant:a,color:c,className:e(s({size:o}),n),...l})}function InputGroupText({className:t,...n}){return i(`span`,{className:e(`flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,t),...n})}function InputGroupInput({className:t,...r}){return i(n,{"data-slot":`input-group-control`,className:e(`flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent`,t),...r})}function InputGroupTextarea({className:t,...n}){return i(r,{"data-slot":`input-group-control`,className:e(`flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent`,t),...n})}export{InputGroup,InputGroupAddon,InputGroupButton,InputGroupInput,InputGroupText,InputGroupTextarea};
1
+ import"../chunk-CHh1Zzun.js";import{cn as e}from"../lib/utils.js";import{Button as t}from"./button.js";import{Input as n}from"./input.js";import{Textarea as r}from"./textarea.js";import{jsx as i}from"react/jsx-runtime";import{cva as a}from"class-variance-authority";function InputGroup({className:t,...n}){return i(`div`,{"data-slot":`input-group`,className:e(`group/input-group relative flex h-8 w-full min-w-0 items-center rounded-lg border border-input transition-colors outline-none in-data-[slot=combobox-content]:focus-within:border-inherit in-data-[slot=combobox-content]:focus-within:ring-0 has-disabled:bg-input/50 has-disabled:opacity-50 has-[[data-slot=input-group-control]:focus-visible]:border-ring has-[[data-slot=input-group-control]:focus-visible]:ring-3 has-[[data-slot=input-group-control]:focus-visible]:ring-ring/50 has-[[data-slot][aria-invalid=true]]:border-destructive has-[[data-slot][aria-invalid=true]]:ring-3 has-[[data-slot][aria-invalid=true]]:ring-destructive/20 has-[>[data-align=block-end]]:h-auto has-[>[data-align=block-end]]:flex-col has-[>[data-align=block-start]]:h-auto has-[>[data-align=block-start]]:flex-col has-[>textarea]:h-auto dark:bg-input/30 dark:has-disabled:bg-input/80 dark:has-[[data-slot][aria-invalid=true]]:ring-destructive/40 has-[>[data-align=block-end]]:[&>input]:pt-3 has-[>[data-align=block-start]]:[&>input]:pb-3 has-[>[data-align=inline-end]]:[&>input]:pr-1.5 has-[>[data-align=inline-start]]:[&>input]:pl-1.5`,t),...n})}const o=a(`flex h-auto cursor-text items-center justify-center gap-2 py-1.5 text-sm font-medium text-muted-foreground select-none group-data-[disabled=true]/input-group:opacity-50 [&>kbd]:rounded-[calc(var(--radius)-5px)] [&>svg:not([class*='size-'])]:size-4`,{variants:{align:{"inline-start":`order-first pl-2 has-[>button]:ml-[-0.3rem] has-[>kbd]:ml-[-0.15rem]`,"inline-end":`order-last pr-2 has-[>button]:mr-[-0.3rem] has-[>kbd]:mr-[-0.15rem]`,"block-start":`order-first w-full justify-start px-2.5 pt-2 group-has-[>input]/input-group:pt-2 [.border-b]:pb-2`,"block-end":`order-last w-full justify-start px-2.5 pb-2 group-has-[>input]/input-group:pb-2 [.border-t]:pt-2`}},defaultVariants:{align:`inline-start`}});function InputGroupAddon({className:t,align:n=`inline-start`,...r}){return i(`div`,{"data-slot":`input-group-addon`,"data-align":n,className:e(o({align:n}),t),...r})}const s=a(`flex items-center gap-2 text-sm shadow-none`,{variants:{size:{xs:`h-6 gap-1 rounded-[calc(var(--radius)-3px)] px-1.5 [&>svg:not([class*='size-'])]:size-3.5`,sm:``,"icon-xs":`size-6 rounded-[calc(var(--radius)-3px)] p-0 has-[>svg]:p-0`,"icon-sm":`size-8 p-0 has-[>svg]:p-0`}},defaultVariants:{size:`xs`}});function InputGroupButton({className:n,type:r=`button`,variant:a=`ghost`,size:o=`xs`,color:c=`zinc`,...l}){return i(t,{type:r,"data-size":o,variant:a,color:c,className:e(s({size:o}),n),...l})}function InputGroupText({className:t,...n}){return i(`span`,{className:e(`flex items-center gap-2 text-sm text-muted-foreground [&_svg]:pointer-events-none [&_svg:not([class*='size-'])]:size-4`,t),...n})}function InputGroupInput({className:t,...r}){return i(n,{"data-slot":`input-group-control`,className:e(`flex-1 rounded-none border-0 bg-transparent shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent`,t),...r})}function InputGroupTextarea({className:t,...n}){return i(r,{"data-slot":`input-group-control`,className:e(`flex-1 resize-none rounded-none border-0 bg-transparent py-2 shadow-none ring-0 focus-visible:ring-0 disabled:bg-transparent aria-invalid:ring-0 dark:bg-transparent dark:disabled:bg-transparent`,t),...n})}export{InputGroup,InputGroupAddon,InputGroupButton,InputGroupInput,InputGroupText,InputGroupTextarea};
2
2
  //# sourceMappingURL=input-group.js.map