@vlrc-fe/components 2.2.0 → 2.3.0
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.
- package/CHANGELOG.md +27 -0
- package/dist/DataTable/DataTable.d.ts.map +1 -1
- package/dist/DataTable/components/DataTableTable.d.ts.map +1 -1
- package/dist/Form/Form.d.ts.map +1 -1
- package/dist/Form/FormDatePicker/FormDatePicker.d.ts.map +1 -1
- package/dist/Form/FormDatePicker/RangeDatePicker.d.ts.map +1 -1
- package/dist/Form/FormDatePicker/SingleDatePicker.d.ts +4 -3
- package/dist/Form/FormDatePicker/SingleDatePicker.d.ts.map +1 -1
- package/dist/Form/FormDatePicker/TimeInput.d.ts +3 -4
- package/dist/Form/FormDatePicker/TimeInput.d.ts.map +1 -1
- package/dist/Form/FormDatePicker/TimePicker.d.ts +3 -3
- package/dist/Form/FormDatePicker/TimePicker.d.ts.map +1 -1
- package/dist/Form/FormDatePicker/types.d.ts +1 -0
- package/dist/Form/FormDatePicker/types.d.ts.map +1 -1
- package/dist/Form/FormDatePicker/useFormDatePicker.d.ts +2 -2
- package/dist/Form/FormDatePicker/useFormDatePicker.d.ts.map +1 -1
- package/dist/Form/FormNumberInput/FormNumberInput.d.ts.map +1 -1
- package/dist/Form/FormNumberInput/StepperControls.d.ts.map +1 -1
- package/dist/Form/FormNumberInput/useFormNumberInput.d.ts.map +1 -1
- package/dist/MultiSelect/MultiSelect.d.ts.map +1 -1
- package/dist/MultiSelect/renderers.d.ts +2 -2
- package/dist/MultiSelect/renderers.d.ts.map +1 -1
- package/dist/assets/stylex.css +450 -0
- package/dist/index.cjs +1 -1
- package/dist/index.js +25 -25
- package/dist/index101.cjs +1 -1
- package/dist/index101.js +120 -91
- package/dist/index103.cjs +1 -1
- package/dist/index103.js +32 -15
- package/dist/index107.cjs +1 -1
- package/dist/index107.js +245 -132
- package/dist/index109.cjs +1 -1
- package/dist/index109.js +319 -138
- package/dist/index113.cjs +1 -1
- package/dist/index113.js +230 -95
- package/dist/index119.cjs +1 -1
- package/dist/index119.js +62 -35
- package/dist/index120.cjs +1 -1
- package/dist/index120.js +71 -32
- package/dist/index121.cjs +1 -1
- package/dist/index121.js +201 -79
- package/dist/index125.cjs +1 -1
- package/dist/index125.js +661 -288
- package/dist/index129.cjs +1 -1
- package/dist/index129.js +6 -5
- package/dist/index144.cjs +1 -1
- package/dist/index144.js +33 -22
- package/dist/index148.cjs +1 -1
- package/dist/index148.js +95 -92
- package/dist/index151.cjs +1 -1
- package/dist/index151.js +56 -56
- package/dist/index152.cjs +1 -1
- package/dist/index152.js +87 -3
- package/dist/index153.cjs +1 -1
- package/dist/index153.js +321 -85
- package/dist/index154.cjs +1 -1
- package/dist/index154.js +160 -287
- package/dist/index155.cjs +1 -1
- package/dist/index155.js +198 -162
- package/dist/index156.cjs +1 -1
- package/dist/index156.js +24 -125
- package/dist/index157.cjs +1 -1
- package/dist/index157.js +8 -25
- package/dist/index158.cjs +1 -1
- package/dist/index158.js +13 -5
- package/dist/index159.cjs +1 -1
- package/dist/index159.js +18 -13
- package/dist/index160.cjs +1 -1
- package/dist/index160.js +12 -16
- package/dist/index161.cjs +1 -1
- package/dist/index161.js +5 -17
- package/dist/index162.cjs +1 -1
- package/dist/index162.js +6 -5
- package/dist/index163.cjs +1 -1
- package/dist/index163.js +6 -5
- package/dist/index164.cjs +1 -1
- package/dist/index164.js +5 -6
- package/dist/index165.cjs +1 -1
- package/dist/index165.js +5 -5
- package/dist/index166.cjs +1 -1
- package/dist/index166.js +7 -5
- package/dist/index167.cjs +1 -1
- package/dist/index167.js +68 -8
- package/dist/index168.cjs +1 -1
- package/dist/index168.js +9 -67
- package/dist/index169.cjs +1 -1
- package/dist/index169.js +201 -10
- package/dist/index170.cjs +1 -1
- package/dist/index170.js +101 -179
- package/dist/index171.cjs +1 -1
- package/dist/index171.js +24 -116
- package/dist/index172.cjs +1 -1
- package/dist/index172.js +18 -30
- package/dist/index173.cjs +1 -1
- package/dist/index173.js +66 -17
- package/dist/index174.cjs +1 -1
- package/dist/index174.js +30 -67
- package/dist/index175.cjs +1 -1
- package/dist/index175.js +10 -31
- package/dist/index176.cjs +1 -1
- package/dist/index176.js +279 -10
- package/dist/index177.cjs +1 -1
- package/dist/index177.js +125 -248
- package/dist/index178.cjs +1 -1
- package/dist/index178.js +18 -155
- package/dist/index179.cjs +1 -1
- package/dist/index179.js +9 -19
- package/dist/index180.cjs +1 -1
- package/dist/index180.js +12 -8
- package/dist/index181.cjs +1 -1
- package/dist/index181.js +6 -12
- package/dist/index182.cjs +1 -1
- package/dist/index182.js +6 -6
- package/dist/index183.cjs +1 -1
- package/dist/index183.js +9 -6
- package/dist/index184.cjs +1 -1
- package/dist/index184.js +8 -9
- package/dist/index185.cjs +1 -1
- package/dist/index185.js +4 -8
- package/dist/index186.cjs +1 -1
- package/dist/index186.js +6 -4
- package/dist/index187.cjs +1 -1
- package/dist/index187.js +6 -6
- package/dist/index188.cjs +1 -1
- package/dist/index188.js +8 -6
- package/dist/index189.cjs +1 -1
- package/dist/index189.js +9 -8
- package/dist/index190.cjs +1 -1
- package/dist/index190.js +12 -8
- package/dist/index191.cjs +1 -1
- package/dist/index191.js +7 -11
- package/dist/index192.cjs +1 -1
- package/dist/index192.js +7 -7
- package/dist/index193.cjs +1 -1
- package/dist/index193.js +4 -9
- package/dist/index194.cjs +1 -1
- package/dist/index194.js +42 -5
- package/dist/index195.cjs +1 -1
- package/dist/index195.js +375 -29
- package/dist/index196.cjs +1 -1
- package/dist/index196.js +35 -386
- package/dist/index197.cjs +1 -1
- package/dist/index197.js +22 -37
- package/dist/index198.cjs +1 -1
- package/dist/index198.js +56 -20
- package/dist/index199.cjs +1 -1
- package/dist/index199.js +36 -54
- package/dist/index200.cjs +1 -1
- package/dist/index200.js +102 -54
- package/dist/index201.cjs +1 -1
- package/dist/index201.js +76 -54
- package/dist/index202.cjs +1 -1
- package/dist/index202.js +68 -66
- package/dist/index203.cjs +1 -1
- package/dist/index203.js +147 -63
- package/dist/index204.cjs +1 -1
- package/dist/index204.js +69 -91
- package/dist/index205.cjs +9 -1
- package/dist/index205.js +585 -62
- package/dist/index206.cjs +1 -9
- package/dist/index206.js +65 -586
- package/dist/index207.cjs +1 -1
- package/dist/index207.js +42 -41
- package/dist/index208.cjs +1 -1
- package/dist/index208.js +64 -46
- package/dist/index209.cjs +1 -1
- package/dist/index209.js +48 -64
- package/dist/index210.cjs +1 -1
- package/dist/index210.js +75 -47
- package/dist/index211.cjs +1 -1
- package/dist/index211.js +173 -69
- package/dist/index212.cjs +1 -1
- package/dist/index212.js +24 -180
- package/dist/index213.cjs +1 -1
- package/dist/index213.js +25 -24
- package/dist/index214.cjs +1 -1
- package/dist/index214.js +61 -24
- package/dist/index215.cjs +1 -1
- package/dist/index215.js +408 -49
- package/dist/index216.cjs +1 -1
- package/dist/index216.js +25 -422
- package/dist/index37.cjs +1 -1
- package/dist/index37.js +123 -65
- package/dist/index42.cjs +1 -1
- package/dist/index42.js +175 -88
- package/dist/index91.cjs +1 -1
- package/dist/index91.js +252 -124
- package/dist/ui/calendar.d.ts +5 -2
- package/dist/ui/calendar.d.ts.map +1 -1
- package/dist/ui/carousel.d.ts +19 -5
- package/dist/ui/carousel.d.ts.map +1 -1
- package/dist/ui/context-menu.d.ts +37 -12
- package/dist/ui/context-menu.d.ts.map +1 -1
- package/dist/ui/form.d.ts +15 -4
- package/dist/ui/form.d.ts.map +1 -1
- package/dist/ui/hover-card.d.ts +5 -1
- package/dist/ui/hover-card.d.ts.map +1 -1
- package/dist/ui/item.d.ts +43 -18
- package/dist/ui/item.d.ts.map +1 -1
- package/dist/ui/menubar.d.ts +45 -14
- package/dist/ui/menubar.d.ts.map +1 -1
- package/dist/ui/navigation-menu.d.ts +34 -10
- package/dist/ui/navigation-menu.d.ts.map +1 -1
- package/dist/ui/resizable.d.ts +9 -3
- package/dist/ui/resizable.d.ts.map +1 -1
- package/dist/ui/scroll-area.d.ts +9 -2
- package/dist/ui/scroll-area.d.ts.map +1 -1
- package/dist/ui/select.d.ts +19 -5
- package/dist/ui/select.d.ts.map +1 -1
- package/dist/ui/sidebar.d.ts +99 -37
- package/dist/ui/sidebar.d.ts.map +1 -1
- package/dist/ui/sonner.d.ts.map +1 -1
- package/package.json +1 -1
- package/dist/index217.cjs +0 -1
- package/dist/index217.js +0 -25
package/dist/index215.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./index2.cjs"),t=require("./
|
|
1
|
+
const e=require("./index2.cjs"),t=require("./index4.cjs"),n=require("./index10.cjs"),r=require("./index25.cjs"),i=require("./index98.cjs"),a=require("./index99.cjs");let o=require("react"),s=e.__toESM(o,1);o=e.__toESM(o);let c=require("@stylexjs/stylex");c=e.__toESM(c,1);let l=require("react/jsx-runtime"),u=require("react/compiler-runtime");var d={avatarDropzone:{kVAEAm:`x1n2onr6`,kzqmXN:`x1eyvef`,kZKoxP:`xw76nk8`,kaIpWk:`x7xypw4`,kMzoRj:`xdh2fpr`,ksu8eU:`xbsl7fq`,kVAM5u:`xb30jbz`,kWkggS:`x1mlyrtw`,kVQacm:`xb3r6kr`,kmVPX3:`x1717udv`,kkrTdU:`x1ypdohk`,k1xSpc:`x78zum5`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,k1ekBW:`xq90yva`,kIyJzY:`x13dflua`,kaVNsj:`x14aqmuz`,$$css:!0},avatarItem:{kVAEAm:`x1n2onr6`,k1xSpc:`x78zum5`,kzqmXN:`xh8yej3`,kZKoxP:`x5yr21d`,kXwgrk:`xdt5ytf`,kaIpWk:`x2u8bby`,kMzoRj:`xc342km`,kmVPX3:`x1717udv`,$$css:!0},avatarPreview:{kzqmXN:`xh8yej3`,kZKoxP:`x5yr21d`,kaIpWk:`x2u8bby`,kMzoRj:`xc342km`,kWkggS:`xjbqb8w`,$$css:!0},avatarImg:{kzqmXN:`xh8yej3`,kZKoxP:`x5yr21d`,kVIFPx:`xl1xv1r`,$$css:!0},compactDropzone:{kVAEAm:`x1n2onr6`,k1xSpc:`x78zum5`,kXwgrk:`x1q0g3np`,kGNEyG:`x6s0dn4`,kOIVth:`x8233eu`,kaIpWk:`x1mr5ieh`,kMzoRj:`xmkeg23`,ksu8eU:`xbsl7fq`,kVAM5u:`xb30jbz`,kWkggS:`x1mlyrtw`,kmVPX3:`x19btat0`,kkrTdU:`x1ypdohk`,k1ekBW:`xq90yva`,kIyJzY:`xx6bhzk`,kaVNsj:`x14aqmuz`,kGzVvX:`x9p52ec`,$$css:!0},clearBtnRow:{k1xSpc:`x78zum5`,kjj79g:`x13a6bvl`,kzqmXN:`xh8yej3`,$$css:!0},clearBtn:{k1xSpc:`x3nfvp2`,kGNEyG:`x6s0dn4`,kOIVth:`xvh977a`,kGuDYH:`xboafo0`,kMwMTN:`xw3nh4a`,kWkggS:`xjbqb8w`,kMzoRj:`xc342km`,kkrTdU:`x1ypdohk`,kmVPX3:`x48ff29`,kaIpWk:`x1q0v2j7`,kGzVvX:`x9p52ec`,kDPRdz:`x1mqvv6a`,$$css:!0},deleteBtn:{k1xSpc:`x3nfvp2`,kGNEyG:`x6s0dn4`,kjj79g:`xl56j7k`,kzqmXN:`xs5h3dt`,kZKoxP:`xettwda`,kaIpWk:`x1q0v2j7`,kMzoRj:`xc342km`,kWkggS:`xjbqb8w`,kMwMTN:`xw3nh4a`,kkrTdU:`x1ypdohk`,kmuXW:`x2lah0s`,k1ekBW:`x1gbuem2`,kIyJzY:`xx6bhzk`,kGzVvX:`x9p52ec`,kDPRdz:`x1mqvv6a`,$$css:!0},whiteText:{kMwMTN:`x1f7m26b`,$$css:!0}};function f(e){let t=(0,u.c)(6),{onChange:n,autoUpload:r,maxFiles:i}=e,o=a.useFileUpload(_),c=s.useRef(null),l=s.useRef(!0),d,f;return t[0]!==r||t[1]!==i||t[2]!==n||t[3]!==o?(d=()=>{if(!n)return;let e=Array.from(o.files.values());if(l.current&&(l.current=!1,e.length===0))return;let t=(()=>{if(r){let t=e.filter(g).map(h).filter(m);return i===1?t.length>0?t[t.length-1]:null:t}let t=e.map(p);return i===1?t.length>0?t[t.length-1]:null:t})(),a=c.current;(r?JSON.stringify(a)===JSON.stringify(t):Array.isArray(t)&&Array.isArray(a)?t.length===a.length&&t.every((e,t)=>e===a[t]):t===a)||(c.current=t,n(t))},f=[o,r,i,n],t[0]=r,t[1]=i,t[2]=n,t[3]=o,t[4]=d,t[5]=f):(d=t[4],f=t[5]),s.useEffect(d,f),null}function p(e){return e.file}function m(e){return!!e}function h(e){return e.file.uploadedUrl}function g(e){return e.status===`success`}function _(e){return e}function v(e,t=``){let n=e.split(`/`).pop()?.split(`?`)[0]||`file`,r=n.split(`.`).pop()?.toLowerCase(),i=r&&{jpg:`image/jpeg`,jpeg:`image/jpeg`,png:`image/png`,gif:`image/gif`,webp:`image/webp`,pdf:`application/pdf`}[r];i||=t.includes(`image`)?`image/jpeg`:`application/octet-stream`;let a=new File([``],n,{type:i});return a.isUploadedUrl=!0,a.uploadedUrl=e,a}function y({showPreview:e,showProgress:n,orientation:i=`vertical`,avatarImgSx:o,deleteBtnSx:s}){let u=a.useFileUpload(e=>Array.from(e.files.values()).map(e=>e.file));return u.length===0?null:(0,l.jsx)(a.FileUploadList,{orientation:i,children:u.map((u,d)=>(0,l.jsxs)(a.FileUploadItem,{value:u,children:[e&&(0,l.jsx)(a.FileUploadItemPreview,{render:(e,t)=>{let n=e.uploadedUrl||(e.type.startsWith(`image/`)&&typeof URL<`u`&&URL.createObjectURL?URL.createObjectURL(e):null);return n&&e.type.startsWith(`image/`)?(0,l.jsx)(`img`,{src:n,alt:e.name,...c.props(o)}):t()}}),(0,l.jsx)(a.FileUploadItemMetadata,{}),n&&(0,l.jsx)(a.FileUploadItemProgress,{variant:`bottom`}),(0,l.jsx)(a.FileUploadItemDelete,{asChild:!0,children:(0,l.jsx)(r.Button,{variant:`ghost`,size:`icon`,"aria-label":`Delete ${u.name}`,sx:s,children:(0,l.jsx)(t.Icons.Trash2,{size:i===`horizontal`?15:16})})})]},`${u.name}-${d}`))})}function b(e){let n=(0,u.c)(10),{clearBtnRowSx:r,clearBtnSx:i}=e;if(a.useFileUpload(x)===0)return null;let o;n[0]===r?o=n[1]:(o=c.props(r),n[0]=r,n[1]=o);let s;n[2]===i?s=n[3]:(s=c.props(i),n[2]=i,n[3]=s);let d;n[4]===Symbol.for(`react.memo_cache_sentinel`)?(d=(0,l.jsx)(t.Icons.Trash2,{size:13}),n[4]=d):d=n[4];let f;n[5]===s?f=n[6]:(f=(0,l.jsx)(a.FileUploadClear,{asChild:!0,children:(0,l.jsxs)(`button`,{type:`button`,...s,children:[d,`Clear all`]})}),n[5]=s,n[6]=f);let p;return n[7]!==o||n[8]!==f?(p=(0,l.jsx)(`div`,{...o,children:f}),n[7]=o,n[8]=f,n[9]=p):p=n[9],p}function x(e){return e.files.size}function S(e){let r=(0,u.c)(8),{showProgress:o,maxSize:s}=e,c=a.useFileUpload(w),f;r[0]!==c||r[1]!==o?(f=(0,l.jsx)(a.FileUploadDropzone,{sx:d.avatarDropzone,children:c?(0,l.jsxs)(a.FileUploadItem,{value:c,sx:d.avatarItem,children:[(0,l.jsx)(a.FileUploadItemPreview,{sx:d.avatarPreview,render:C}),(0,l.jsxs)(`div`,{className:`x10l6tqk x10a8y8t x78zum5 xdt5ytf x6s0dn4 xl56j7k xvh977a xa44r0r x1f7m26b xg01cxk x19991ni x13dflua x1o7uuvo`,children:[(0,l.jsx)(t.Icons.Camera,{size:22}),(0,l.jsx)(n.Text,{size:`xs`,weight:`semibold`,sx:d.whiteText,children:`Change photo`})]}),o&&(0,l.jsx)(a.FileUploadItemProgress,{variant:`fill`,style:{opacity:.5}})]}):(0,l.jsxs)(`div`,{className:`x78zum5 xh8yej3 x5yr21d xdt5ytf x6s0dn4 xl56j7k xvh977a x1jgryid xw3nh4a x15406qy x13dflua`,children:[(0,l.jsx)(t.Icons.Camera,{size:24}),(0,l.jsx)(n.Text,{size:`xs`,weight:`medium`,children:`Upload`})]})}),r[0]=c,r[1]=o,r[2]=f):f=r[2];let p;r[3]===s?p=r[4]:(p=s?(0,l.jsxs)(n.Text,{size:`xs`,type:`muted`,children:[`Max `,i.formatFileSize(s)]}):null,r[3]=s,r[4]=p);let m;return r[5]!==f||r[6]!==p?(m=(0,l.jsxs)(`div`,{className:`x78zum5 xdt5ytf x6s0dn4 x13z6uf9`,children:[f,p]}),r[5]=f,r[6]=p,r[7]=m):m=r[7],m}function C(e){let r=e.uploadedUrl||(e.type.startsWith(`image/`)&&typeof URL<`u`&&URL.createObjectURL?URL.createObjectURL(e):null);return r?(0,l.jsx)(`img`,{src:r,alt:`Avatar`,className:`xh8yej3 x5yr21d xl1xv1r`}):(0,l.jsxs)(`div`,{className:`x78zum5 xh8yej3 x5yr21d xdt5ytf x6s0dn4 xl56j7k xvh977a x1jgryid xw3nh4a x15406qy x13dflua`,children:[(0,l.jsx)(t.Icons.Camera,{size:24}),(0,l.jsx)(n.Text,{size:`xs`,weight:`medium`,children:`Upload`})]})}function w(e){let t=e.files.values().next();return t.done?null:t.value.file}function T({value:e,onChange:o,autoUpload:c=!1,uploadFile:u,apiConfig:p,uploadThingConfig:m,uploadHandler:h,maxFiles:g=1,maxSize:_=5242880,accept:x=`image/*`,multiple:C,disabled:w,className:T,sx:E,variant:D=`default`,dropzoneTitle:O,dropzoneSubtitle:k,icon:A,showFileList:j=!0,showProgress:M=!0,showPreview:N=!0,showClear:P=!1}){let F=s.useRef(new Map),I=s.useMemo(()=>(Array.isArray(e)?e:e?[e]:[]).map(e=>{if(e instanceof File)return e;if(typeof e==`string`){let t=F.current.get(e);return t||(t=v(e,x),F.current.set(e,t)),t}return e}),[e,x]),L=s.useMemo(()=>h||(m?i.createUploadThingUploadHandler(m):p?i.createApiUploadHandler(p):null),[h,m,p]),R=async(e,t)=>{if(!c)e.forEach(e=>t.onSuccess(e));else if(L)try{(await L(e,{onProgress:t.onProgress,onSuccess:(e,n)=>{e.uploadedUrl=n.url,t.onSuccess(e)},onError:(e,n)=>{t.onError(e,n)}})).forEach((t,n)=>{let r=e[n];r&&(r.uploadedUrl=t.url)})}catch{}else u?await Promise.all(e.map(async e=>{let n=e;if(n.isUploadedUrl)t.onSuccess(e);else try{t.onProgress(e,20),n.uploadedUrl=await u(e),t.onProgress(e,100),t.onSuccess(e)}catch(n){t.onError(e,n instanceof Error?n:Error(`Upload failed`))}})):(console.warn(`FileUpload: autoUpload is true but no upload handler or config was provided.`),e.forEach(e=>t.onError(e,Error(`Missing upload configuration`))))},z=`${g>1?`Up to ${g} files`:`1 file max`} ${_?`(Max ${i.formatFileSize(_)})`:``}`,B=D===`avatar`?!1:C??g>1;return(0,l.jsxs)(a.FileUpload,{value:I,maxFiles:D===`avatar`?1:g,maxSize:_,accept:x,multiple:B,disabled:w,onUpload:R,className:T,sx:E,children:[(0,l.jsx)(f,{onChange:o,autoUpload:!!c,maxFiles:D===`avatar`?1:g}),D===`avatar`?(0,l.jsx)(S,{showProgress:M,maxSize:_}):D===`compact`?(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(a.FileUploadDropzone,{sx:d.compactDropzone,children:[(0,l.jsx)(`div`,{className:`x78zum5 x6s0dn4 xl56j7k xs5h3dt xettwda x7xypw4 xmkeg23 x1y0btm7 xb30jbz x1rexohn xw3nh4a x2lah0s`,children:A||(0,l.jsx)(t.Icons.CloudUpload,{size:18})}),(0,l.jsxs)(`div`,{className:`x78zum5 xdt5ytf x98rzlu xeuugli`,children:[(0,l.jsx)(n.Text,{size:`sm`,weight:`medium`,children:O||`Choose or drop files to upload`}),(0,l.jsx)(n.Text,{size:`xs`,type:`muted`,children:k||z})]}),(0,l.jsx)(a.FileUploadTrigger,{asChild:!0,children:(0,l.jsx)(r.Button,{variant:`outline`,size:`sm`,disabled:w,children:`Browse`})})]}),P&&(0,l.jsx)(b,{clearBtnRowSx:d.clearBtnRow,clearBtnSx:d.clearBtn}),j&&(0,l.jsx)(y,{showPreview:N,showProgress:M,orientation:`horizontal`,avatarImgSx:d.avatarImg,deleteBtnSx:d.deleteBtn})]}):(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)(a.FileUploadDropzone,{children:[(0,l.jsx)(`div`,{className:`x78zum5 x6s0dn4 xl56j7k xvm51jw xwaiz5r x7xypw4 xmkeg23 x1y0btm7 xb30jbz x1rexohn xw3nh4a x1hpqcdg`,children:A||(0,l.jsx)(t.Icons.CloudUpload,{size:20})}),(0,l.jsx)(n.Text,{size:`md`,weight:`medium`,children:O||`Drag & drop files here, or click to select`}),(0,l.jsx)(n.Text,{size:`xs`,type:`muted`,children:k||z})]}),P&&(0,l.jsx)(b,{clearBtnRowSx:d.clearBtnRow,clearBtnSx:d.clearBtn}),j&&(0,l.jsx)(y,{showPreview:N,showProgress:M,orientation:`vertical`,avatarImgSx:d.avatarImg,deleteBtnSx:d.deleteBtn})]})]})}exports.FileUpload=T;
|
package/dist/index215.js
CHANGED
|
@@ -1,63 +1,422 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
import {
|
|
4
|
-
import {
|
|
5
|
-
import "
|
|
6
|
-
import
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
1
|
+
import { Icons as e } from "./index4.js";
|
|
2
|
+
import { Text as t } from "./index10.js";
|
|
3
|
+
import { Button as n } from "./index25.js";
|
|
4
|
+
import { createApiUploadHandler as r, createUploadThingUploadHandler as i, formatFileSize as a } from "./index98.js";
|
|
5
|
+
import { FileUpload as o, FileUploadClear as s, FileUploadDropzone as c, FileUploadItem as l, FileUploadItemDelete as u, FileUploadItemMetadata as d, FileUploadItemPreview as f, FileUploadItemProgress as p, FileUploadList as m, FileUploadTrigger as h, useFileUpload as g } from "./index99.js";
|
|
6
|
+
import * as _ from "react";
|
|
7
|
+
import * as v from "@stylexjs/stylex";
|
|
8
|
+
import { Fragment as y, jsx as b, jsxs as x } from "react/jsx-runtime";
|
|
9
|
+
import { c as S } from "react/compiler-runtime";
|
|
10
|
+
// src/Form/FormFileUpload/FileUpload.tsx
|
|
11
|
+
var C = {
|
|
12
|
+
avatarDropzone: {
|
|
13
|
+
kVAEAm: "x1n2onr6",
|
|
14
|
+
kzqmXN: "x1eyvef",
|
|
15
|
+
kZKoxP: "xw76nk8",
|
|
16
|
+
kaIpWk: "x7xypw4",
|
|
17
|
+
kMzoRj: "xdh2fpr",
|
|
18
|
+
ksu8eU: "xbsl7fq",
|
|
19
|
+
kVAM5u: "xb30jbz",
|
|
20
|
+
kWkggS: "x1mlyrtw",
|
|
21
|
+
kVQacm: "xb3r6kr",
|
|
22
|
+
kmVPX3: "x1717udv",
|
|
23
|
+
kkrTdU: "x1ypdohk",
|
|
10
24
|
k1xSpc: "x78zum5",
|
|
25
|
+
kGNEyG: "x6s0dn4",
|
|
26
|
+
kjj79g: "xl56j7k",
|
|
27
|
+
k1ekBW: "xq90yva",
|
|
28
|
+
kIyJzY: "x13dflua",
|
|
29
|
+
kaVNsj: "x14aqmuz",
|
|
30
|
+
$$css: !0
|
|
31
|
+
},
|
|
32
|
+
avatarItem: {
|
|
33
|
+
kVAEAm: "x1n2onr6",
|
|
34
|
+
k1xSpc: "x78zum5",
|
|
35
|
+
kzqmXN: "xh8yej3",
|
|
36
|
+
kZKoxP: "x5yr21d",
|
|
11
37
|
kXwgrk: "xdt5ytf",
|
|
12
|
-
|
|
13
|
-
|
|
38
|
+
kaIpWk: "x2u8bby",
|
|
39
|
+
kMzoRj: "xc342km",
|
|
40
|
+
kmVPX3: "x1717udv",
|
|
14
41
|
$$css: !0
|
|
15
42
|
},
|
|
16
|
-
|
|
43
|
+
avatarPreview: {
|
|
44
|
+
kzqmXN: "xh8yej3",
|
|
45
|
+
kZKoxP: "x5yr21d",
|
|
46
|
+
kaIpWk: "x2u8bby",
|
|
47
|
+
kMzoRj: "xc342km",
|
|
48
|
+
kWkggS: "xjbqb8w",
|
|
49
|
+
$$css: !0
|
|
50
|
+
},
|
|
51
|
+
avatarImg: {
|
|
52
|
+
kzqmXN: "xh8yej3",
|
|
53
|
+
kZKoxP: "x5yr21d",
|
|
54
|
+
kVIFPx: "xl1xv1r",
|
|
55
|
+
$$css: !0
|
|
56
|
+
},
|
|
57
|
+
compactDropzone: {
|
|
58
|
+
kVAEAm: "x1n2onr6",
|
|
59
|
+
k1xSpc: "x78zum5",
|
|
60
|
+
kXwgrk: "x1q0g3np",
|
|
61
|
+
kGNEyG: "x6s0dn4",
|
|
62
|
+
kOIVth: "x8233eu",
|
|
63
|
+
kaIpWk: "x1mr5ieh",
|
|
64
|
+
kMzoRj: "xmkeg23",
|
|
65
|
+
ksu8eU: "xbsl7fq",
|
|
66
|
+
kVAM5u: "xb30jbz",
|
|
67
|
+
kWkggS: "x1mlyrtw",
|
|
68
|
+
kmVPX3: "x19btat0",
|
|
17
69
|
kkrTdU: "x1ypdohk",
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
70
|
+
k1ekBW: "xq90yva",
|
|
71
|
+
kIyJzY: "xx6bhzk",
|
|
72
|
+
kaVNsj: "x14aqmuz",
|
|
73
|
+
kGzVvX: "x9p52ec",
|
|
22
74
|
$$css: !0
|
|
23
75
|
},
|
|
24
|
-
|
|
25
|
-
|
|
76
|
+
clearBtnRow: {
|
|
77
|
+
k1xSpc: "x78zum5",
|
|
78
|
+
kjj79g: "x13a6bvl",
|
|
79
|
+
kzqmXN: "xh8yej3",
|
|
80
|
+
$$css: !0
|
|
81
|
+
},
|
|
82
|
+
clearBtn: {
|
|
83
|
+
k1xSpc: "x3nfvp2",
|
|
84
|
+
kGNEyG: "x6s0dn4",
|
|
85
|
+
kOIVth: "xvh977a",
|
|
86
|
+
kGuDYH: "xboafo0",
|
|
87
|
+
kMwMTN: "xw3nh4a",
|
|
88
|
+
kWkggS: "xjbqb8w",
|
|
89
|
+
kMzoRj: "xc342km",
|
|
90
|
+
kkrTdU: "x1ypdohk",
|
|
91
|
+
kmVPX3: "x48ff29",
|
|
92
|
+
kaIpWk: "x1q0v2j7",
|
|
93
|
+
kGzVvX: "x9p52ec",
|
|
94
|
+
kDPRdz: "x1mqvv6a",
|
|
95
|
+
$$css: !0
|
|
96
|
+
},
|
|
97
|
+
deleteBtn: {
|
|
98
|
+
k1xSpc: "x3nfvp2",
|
|
99
|
+
kGNEyG: "x6s0dn4",
|
|
100
|
+
kjj79g: "xl56j7k",
|
|
101
|
+
kzqmXN: "xs5h3dt",
|
|
102
|
+
kZKoxP: "xettwda",
|
|
103
|
+
kaIpWk: "x1q0v2j7",
|
|
104
|
+
kMzoRj: "xc342km",
|
|
105
|
+
kWkggS: "xjbqb8w",
|
|
106
|
+
kMwMTN: "xw3nh4a",
|
|
107
|
+
kkrTdU: "x1ypdohk",
|
|
108
|
+
kmuXW: "x2lah0s",
|
|
109
|
+
k1ekBW: "x1gbuem2",
|
|
110
|
+
kIyJzY: "xx6bhzk",
|
|
111
|
+
kGzVvX: "x9p52ec",
|
|
112
|
+
kDPRdz: "x1mqvv6a",
|
|
113
|
+
$$css: !0
|
|
114
|
+
},
|
|
115
|
+
whiteText: {
|
|
116
|
+
kMwMTN: "x1f7m26b",
|
|
26
117
|
$$css: !0
|
|
27
118
|
}
|
|
28
119
|
};
|
|
29
|
-
function
|
|
30
|
-
let {
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
120
|
+
function w(e) {
|
|
121
|
+
let t = S(6), { onChange: n, autoUpload: r, maxFiles: i } = e, a = g(k), o = _.useRef(null), s = _.useRef(!0), c, l;
|
|
122
|
+
return t[0] !== r || t[1] !== i || t[2] !== n || t[3] !== a ? (c = () => {
|
|
123
|
+
if (!n) return;
|
|
124
|
+
let e = Array.from(a.files.values());
|
|
125
|
+
if (s.current && (s.current = !1, e.length === 0)) return;
|
|
126
|
+
let t = (() => {
|
|
127
|
+
if (r) {
|
|
128
|
+
let t = e.filter(O).map(D).filter(E);
|
|
129
|
+
return i === 1 ? t.length > 0 ? t[t.length - 1] : null : t;
|
|
130
|
+
}
|
|
131
|
+
let t = e.map(T);
|
|
132
|
+
return i === 1 ? t.length > 0 ? t[t.length - 1] : null : t;
|
|
133
|
+
})(), c = o.current;
|
|
134
|
+
(r ? JSON.stringify(c) === JSON.stringify(t) : Array.isArray(t) && Array.isArray(c) ? t.length === c.length && t.every((e, t) => e === c[t]) : t === c) || (o.current = t, n(t));
|
|
135
|
+
}, l = [
|
|
136
|
+
a,
|
|
137
|
+
r,
|
|
138
|
+
i,
|
|
139
|
+
n
|
|
140
|
+
], t[0] = r, t[1] = i, t[2] = n, t[3] = a, t[4] = c, t[5] = l) : (c = t[4], l = t[5]), _.useEffect(c, l), null;
|
|
141
|
+
}
|
|
142
|
+
function T(e) {
|
|
143
|
+
return e.file;
|
|
144
|
+
}
|
|
145
|
+
function E(e) {
|
|
146
|
+
return !!e;
|
|
147
|
+
}
|
|
148
|
+
function D(e) {
|
|
149
|
+
return e.file.uploadedUrl;
|
|
150
|
+
}
|
|
151
|
+
function O(e) {
|
|
152
|
+
return e.status === "success";
|
|
153
|
+
}
|
|
154
|
+
function k(e) {
|
|
155
|
+
return e;
|
|
156
|
+
}
|
|
157
|
+
function A(e, t = "") {
|
|
158
|
+
let n = e.split("/").pop()?.split("?")[0] || "file", r = n.split(".").pop()?.toLowerCase(), i = r && {
|
|
159
|
+
jpg: "image/jpeg",
|
|
160
|
+
jpeg: "image/jpeg",
|
|
161
|
+
png: "image/png",
|
|
162
|
+
gif: "image/gif",
|
|
163
|
+
webp: "image/webp",
|
|
164
|
+
pdf: "application/pdf"
|
|
165
|
+
}[r];
|
|
166
|
+
i ||= t.includes("image") ? "image/jpeg" : "application/octet-stream";
|
|
167
|
+
let a = new File([""], n, { type: i });
|
|
168
|
+
return a.isUploadedUrl = !0, a.uploadedUrl = e, a;
|
|
169
|
+
}
|
|
170
|
+
function j({ showPreview: t, showProgress: r, orientation: i = "vertical", avatarImgSx: a, deleteBtnSx: o }) {
|
|
171
|
+
let s = g((e) => Array.from(e.files.values()).map((e) => e.file));
|
|
172
|
+
return s.length === 0 ? null : /* @__PURE__ */ b(m, {
|
|
173
|
+
orientation: i,
|
|
174
|
+
children: s.map((s, c) => /* @__PURE__ */ x(l, {
|
|
175
|
+
value: s,
|
|
176
|
+
children: [
|
|
177
|
+
t && /* @__PURE__ */ b(f, { render: (e, t) => {
|
|
178
|
+
let n = e.uploadedUrl || (e.type.startsWith("image/") && typeof URL < "u" && URL.createObjectURL ? URL.createObjectURL(e) : null);
|
|
179
|
+
return n && e.type.startsWith("image/") ? /* @__PURE__ */ b("img", {
|
|
180
|
+
src: n,
|
|
181
|
+
alt: e.name,
|
|
182
|
+
...v.props(a)
|
|
183
|
+
}) : t();
|
|
184
|
+
} }),
|
|
185
|
+
/* @__PURE__ */ b(d, {}),
|
|
186
|
+
r && /* @__PURE__ */ b(p, { variant: "bottom" }),
|
|
187
|
+
/* @__PURE__ */ b(u, {
|
|
188
|
+
asChild: !0,
|
|
189
|
+
children: /* @__PURE__ */ b(n, {
|
|
190
|
+
variant: "ghost",
|
|
191
|
+
size: "icon",
|
|
192
|
+
"aria-label": `Delete ${s.name}`,
|
|
193
|
+
sx: o,
|
|
194
|
+
children: /* @__PURE__ */ b(e.Trash2, { size: i === "horizontal" ? 15 : 16 })
|
|
195
|
+
})
|
|
196
|
+
})
|
|
197
|
+
]
|
|
198
|
+
}, `${s.name}-${c}`))
|
|
35
199
|
});
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
200
|
+
}
|
|
201
|
+
function M(t) {
|
|
202
|
+
let n = S(10), { clearBtnRowSx: r, clearBtnSx: i } = t;
|
|
203
|
+
if (g(N) === 0) return null;
|
|
204
|
+
let a;
|
|
205
|
+
n[0] === r ? a = n[1] : (a = v.props(r), n[0] = r, n[1] = a);
|
|
206
|
+
let o;
|
|
207
|
+
n[2] === i ? o = n[3] : (o = v.props(i), n[2] = i, n[3] = o);
|
|
208
|
+
let c;
|
|
209
|
+
n[4] === Symbol.for("react.memo_cache_sentinel") ? (c = /* @__PURE__ */ b(e.Trash2, { size: 13 }), n[4] = c) : c = n[4];
|
|
210
|
+
let l;
|
|
211
|
+
n[5] === o ? l = n[6] : (l = /* @__PURE__ */ b(s, {
|
|
212
|
+
asChild: !0,
|
|
213
|
+
children: /* @__PURE__ */ x("button", {
|
|
214
|
+
type: "button",
|
|
215
|
+
...o,
|
|
216
|
+
children: [c, "Clear all"]
|
|
217
|
+
})
|
|
218
|
+
}), n[5] = o, n[6] = l);
|
|
219
|
+
let u;
|
|
220
|
+
return n[7] !== a || n[8] !== l ? (u = /* @__PURE__ */ b("div", {
|
|
221
|
+
...a,
|
|
222
|
+
children: l
|
|
223
|
+
}), n[7] = a, n[8] = l, n[9] = u) : u = n[9], u;
|
|
224
|
+
}
|
|
225
|
+
function N(e) {
|
|
226
|
+
return e.files.size;
|
|
227
|
+
}
|
|
228
|
+
function P(n) {
|
|
229
|
+
let r = S(8), { showProgress: i, maxSize: o } = n, s = g(I), u;
|
|
230
|
+
r[0] !== s || r[1] !== i ? (u = /* @__PURE__ */ b(c, {
|
|
231
|
+
sx: C.avatarDropzone,
|
|
232
|
+
children: s ? /* @__PURE__ */ x(l, {
|
|
233
|
+
value: s,
|
|
234
|
+
sx: C.avatarItem,
|
|
235
|
+
children: [
|
|
236
|
+
/* @__PURE__ */ b(f, {
|
|
237
|
+
sx: C.avatarPreview,
|
|
238
|
+
render: F
|
|
239
|
+
}),
|
|
240
|
+
/* @__PURE__ */ x("div", {
|
|
241
|
+
className: "x10l6tqk x10a8y8t x78zum5 xdt5ytf x6s0dn4 xl56j7k xvh977a xa44r0r x1f7m26b xg01cxk x19991ni x13dflua x1o7uuvo",
|
|
242
|
+
children: [/* @__PURE__ */ b(e.Camera, { size: 22 }), /* @__PURE__ */ b(t, {
|
|
243
|
+
size: "xs",
|
|
244
|
+
weight: "semibold",
|
|
245
|
+
sx: C.whiteText,
|
|
246
|
+
children: "Change photo"
|
|
247
|
+
})]
|
|
248
|
+
}),
|
|
249
|
+
i && /* @__PURE__ */ b(p, {
|
|
250
|
+
variant: "fill",
|
|
251
|
+
style: { opacity: .5 }
|
|
252
|
+
})
|
|
253
|
+
]
|
|
254
|
+
}) : /* @__PURE__ */ x("div", {
|
|
255
|
+
className: "x78zum5 xh8yej3 x5yr21d xdt5ytf x6s0dn4 xl56j7k xvh977a x1jgryid xw3nh4a x15406qy x13dflua",
|
|
256
|
+
children: [/* @__PURE__ */ b(e.Camera, { size: 24 }), /* @__PURE__ */ b(t, {
|
|
257
|
+
size: "xs",
|
|
258
|
+
weight: "medium",
|
|
259
|
+
children: "Upload"
|
|
260
|
+
})]
|
|
60
261
|
})
|
|
262
|
+
}), r[0] = s, r[1] = i, r[2] = u) : u = r[2];
|
|
263
|
+
let d;
|
|
264
|
+
r[3] === o ? d = r[4] : (d = o ? /* @__PURE__ */ x(t, {
|
|
265
|
+
size: "xs",
|
|
266
|
+
type: "muted",
|
|
267
|
+
children: ["Max ", a(o)]
|
|
268
|
+
}) : null, r[3] = o, r[4] = d);
|
|
269
|
+
let m;
|
|
270
|
+
return r[5] !== u || r[6] !== d ? (m = /* @__PURE__ */ x("div", {
|
|
271
|
+
className: "x78zum5 xdt5ytf x6s0dn4 x13z6uf9",
|
|
272
|
+
children: [u, d]
|
|
273
|
+
}), r[5] = u, r[6] = d, r[7] = m) : m = r[7], m;
|
|
274
|
+
}
|
|
275
|
+
function F(n) {
|
|
276
|
+
let r = n.uploadedUrl || (n.type.startsWith("image/") && typeof URL < "u" && URL.createObjectURL ? URL.createObjectURL(n) : null);
|
|
277
|
+
return r ? /* @__PURE__ */ b("img", {
|
|
278
|
+
src: r,
|
|
279
|
+
alt: "Avatar",
|
|
280
|
+
className: "xh8yej3 x5yr21d xl1xv1r"
|
|
281
|
+
}) : /* @__PURE__ */ x("div", {
|
|
282
|
+
className: "x78zum5 xh8yej3 x5yr21d xdt5ytf x6s0dn4 xl56j7k xvh977a x1jgryid xw3nh4a x15406qy x13dflua",
|
|
283
|
+
children: [/* @__PURE__ */ b(e.Camera, { size: 24 }), /* @__PURE__ */ b(t, {
|
|
284
|
+
size: "xs",
|
|
285
|
+
weight: "medium",
|
|
286
|
+
children: "Upload"
|
|
287
|
+
})]
|
|
288
|
+
});
|
|
289
|
+
}
|
|
290
|
+
function I(e) {
|
|
291
|
+
let t = e.files.values().next();
|
|
292
|
+
return t.done ? null : t.value.file;
|
|
293
|
+
}
|
|
294
|
+
function L({ value: s, onChange: l, autoUpload: u = !1, uploadFile: d, apiConfig: f, uploadThingConfig: p, uploadHandler: m, maxFiles: g = 1, maxSize: v = 5242880, accept: S = "image/*", multiple: T, disabled: E, className: D, sx: O, variant: k = "default", dropzoneTitle: N, dropzoneSubtitle: F, icon: I, showFileList: L = !0, showProgress: R = !0, showPreview: z = !0, showClear: B = !1 }) {
|
|
295
|
+
let V = _.useRef(/* @__PURE__ */ new Map()), H = _.useMemo(() => (Array.isArray(s) ? s : s ? [s] : []).map((e) => {
|
|
296
|
+
if (e instanceof File) return e;
|
|
297
|
+
if (typeof e == "string") {
|
|
298
|
+
let t = V.current.get(e);
|
|
299
|
+
return t || (t = A(e, S), V.current.set(e, t)), t;
|
|
300
|
+
}
|
|
301
|
+
return e;
|
|
302
|
+
}), [s, S]), U = _.useMemo(() => m || (p ? i(p) : f ? r(f) : null), [
|
|
303
|
+
m,
|
|
304
|
+
p,
|
|
305
|
+
f
|
|
306
|
+
]), W = async (e, t) => {
|
|
307
|
+
if (!u) e.forEach((e) => t.onSuccess(e));
|
|
308
|
+
else if (U) try {
|
|
309
|
+
(await U(e, {
|
|
310
|
+
onProgress: t.onProgress,
|
|
311
|
+
onSuccess: (e, n) => {
|
|
312
|
+
e.uploadedUrl = n.url, t.onSuccess(e);
|
|
313
|
+
},
|
|
314
|
+
onError: (e, n) => {
|
|
315
|
+
t.onError(e, n);
|
|
316
|
+
}
|
|
317
|
+
})).forEach((t, n) => {
|
|
318
|
+
let r = e[n];
|
|
319
|
+
r && (r.uploadedUrl = t.url);
|
|
320
|
+
});
|
|
321
|
+
} catch {}
|
|
322
|
+
else d ? await Promise.all(e.map(async (e) => {
|
|
323
|
+
let n = e;
|
|
324
|
+
if (n.isUploadedUrl) t.onSuccess(e);
|
|
325
|
+
else try {
|
|
326
|
+
t.onProgress(e, 20), n.uploadedUrl = await d(e), t.onProgress(e, 100), t.onSuccess(e);
|
|
327
|
+
} catch (n) {
|
|
328
|
+
t.onError(e, n instanceof Error ? n : /* @__PURE__ */ Error("Upload failed"));
|
|
329
|
+
}
|
|
330
|
+
})) : (console.warn("FileUpload: autoUpload is true but no upload handler or config was provided."), e.forEach((e) => t.onError(e, /* @__PURE__ */ Error("Missing upload configuration"))));
|
|
331
|
+
}, G = `${g > 1 ? `Up to ${g} files` : "1 file max"} ${v ? `(Max ${a(v)})` : ""}`;
|
|
332
|
+
return /* @__PURE__ */ x(o, {
|
|
333
|
+
value: H,
|
|
334
|
+
maxFiles: k === "avatar" ? 1 : g,
|
|
335
|
+
maxSize: v,
|
|
336
|
+
accept: S,
|
|
337
|
+
multiple: k === "avatar" ? !1 : T ?? g > 1,
|
|
338
|
+
disabled: E,
|
|
339
|
+
onUpload: W,
|
|
340
|
+
className: D,
|
|
341
|
+
sx: O,
|
|
342
|
+
children: [/* @__PURE__ */ b(w, {
|
|
343
|
+
onChange: l,
|
|
344
|
+
autoUpload: !!u,
|
|
345
|
+
maxFiles: k === "avatar" ? 1 : g
|
|
346
|
+
}), k === "avatar" ? /* @__PURE__ */ b(P, {
|
|
347
|
+
showProgress: R,
|
|
348
|
+
maxSize: v
|
|
349
|
+
}) : k === "compact" ? /* @__PURE__ */ x(y, { children: [
|
|
350
|
+
/* @__PURE__ */ x(c, {
|
|
351
|
+
sx: C.compactDropzone,
|
|
352
|
+
children: [
|
|
353
|
+
/* @__PURE__ */ b("div", {
|
|
354
|
+
className: "x78zum5 x6s0dn4 xl56j7k xs5h3dt xettwda x7xypw4 xmkeg23 x1y0btm7 xb30jbz x1rexohn xw3nh4a x2lah0s",
|
|
355
|
+
children: I || /* @__PURE__ */ b(e.CloudUpload, { size: 18 })
|
|
356
|
+
}),
|
|
357
|
+
/* @__PURE__ */ x("div", {
|
|
358
|
+
className: "x78zum5 xdt5ytf x98rzlu xeuugli",
|
|
359
|
+
children: [/* @__PURE__ */ b(t, {
|
|
360
|
+
size: "sm",
|
|
361
|
+
weight: "medium",
|
|
362
|
+
children: N || "Choose or drop files to upload"
|
|
363
|
+
}), /* @__PURE__ */ b(t, {
|
|
364
|
+
size: "xs",
|
|
365
|
+
type: "muted",
|
|
366
|
+
children: F || G
|
|
367
|
+
})]
|
|
368
|
+
}),
|
|
369
|
+
/* @__PURE__ */ b(h, {
|
|
370
|
+
asChild: !0,
|
|
371
|
+
children: /* @__PURE__ */ b(n, {
|
|
372
|
+
variant: "outline",
|
|
373
|
+
size: "sm",
|
|
374
|
+
disabled: E,
|
|
375
|
+
children: "Browse"
|
|
376
|
+
})
|
|
377
|
+
})
|
|
378
|
+
]
|
|
379
|
+
}),
|
|
380
|
+
B && /* @__PURE__ */ b(M, {
|
|
381
|
+
clearBtnRowSx: C.clearBtnRow,
|
|
382
|
+
clearBtnSx: C.clearBtn
|
|
383
|
+
}),
|
|
384
|
+
L && /* @__PURE__ */ b(j, {
|
|
385
|
+
showPreview: z,
|
|
386
|
+
showProgress: R,
|
|
387
|
+
orientation: "horizontal",
|
|
388
|
+
avatarImgSx: C.avatarImg,
|
|
389
|
+
deleteBtnSx: C.deleteBtn
|
|
390
|
+
})
|
|
391
|
+
] }) : /* @__PURE__ */ x(y, { children: [
|
|
392
|
+
/* @__PURE__ */ x(c, { children: [
|
|
393
|
+
/* @__PURE__ */ b("div", {
|
|
394
|
+
className: "x78zum5 x6s0dn4 xl56j7k xvm51jw xwaiz5r x7xypw4 xmkeg23 x1y0btm7 xb30jbz x1rexohn xw3nh4a x1hpqcdg",
|
|
395
|
+
children: I || /* @__PURE__ */ b(e.CloudUpload, { size: 20 })
|
|
396
|
+
}),
|
|
397
|
+
/* @__PURE__ */ b(t, {
|
|
398
|
+
size: "md",
|
|
399
|
+
weight: "medium",
|
|
400
|
+
children: N || "Drag & drop files here, or click to select"
|
|
401
|
+
}),
|
|
402
|
+
/* @__PURE__ */ b(t, {
|
|
403
|
+
size: "xs",
|
|
404
|
+
type: "muted",
|
|
405
|
+
children: F || G
|
|
406
|
+
})
|
|
407
|
+
] }),
|
|
408
|
+
B && /* @__PURE__ */ b(M, {
|
|
409
|
+
clearBtnRowSx: C.clearBtnRow,
|
|
410
|
+
clearBtnSx: C.clearBtn
|
|
411
|
+
}),
|
|
412
|
+
L && /* @__PURE__ */ b(j, {
|
|
413
|
+
showPreview: z,
|
|
414
|
+
showProgress: R,
|
|
415
|
+
orientation: "vertical",
|
|
416
|
+
avatarImgSx: C.avatarImg,
|
|
417
|
+
deleteBtnSx: C.deleteBtn
|
|
418
|
+
})
|
|
419
|
+
] })]
|
|
61
420
|
});
|
|
62
421
|
}
|
|
63
|
-
export {
|
|
422
|
+
export { L as FileUpload };
|
package/dist/index216.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
const e=require("./
|
|
1
|
+
const e=require("./index151.cjs"),t=require("./index215.cjs");let n=require("react/jsx-runtime"),r=require("react/compiler-runtime");var i=i=>{let a=(0,r.c)(5),o;a[0]===i?o=a[1]:(o=e=>{let{onChange:r,value:a,disabled:o}=e;return(0,n.jsx)(t.FileUpload,{...i,value:a,onChange:r,disabled:o||i.disabled,className:i.className,sx:i.sx})},a[0]=i,a[1]=o);let s;return a[2]!==i||a[3]!==o?(s=(0,n.jsx)(e.FormBase,{...i,children:o}),a[2]=i,a[3]=o,a[4]=s):s=a[4],s},a=i;exports.FileDropzone=t.FileUpload,exports.FormFileUpload=i,exports.default=i,exports.FormFileUploader=a;
|