@theroutingcompany/components 0.0.35-alpha.0 → 0.0.35-alpha.2

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.
@@ -2227,7 +2227,7 @@ Valid keys: `+JSON.stringify(Object.keys(z),null," "));var Q=se(q,re,H,ie,le+".
2227
2227
  left: 0;
2228
2228
  right: 0;
2229
2229
  }
2230
- `,EN=new Intl.ListFormat("en",{style:"long",type:"conjunction"}),_w=s.forwardRef((e,t)=>{const{file:r,onAddFile:n,onDeleteFile:o,fileTypes:a=[{name:"CSV",mime:"text/csv"}]}=e,i=yt(t),l=s.useId(),{dropProps:c,isDropTarget:d}=vN({ref:i,onDrop:async f=>{const m=f.items.find(h=>h.kind==="file");if(m&&m.kind==="file"){const h=await m.getFile();n(h)}}}),u=f=>{var m;(m=f.target.files)!=null&&m[0]&&n(f.target.files[0])};return w(yN,{...c,role:"button",tabIndex:0,ref:i,"data-state":d?"dropping":"",children:r?ee(xN,{children:[w(It,{size:"large",children:r.name}),ee(qm,{children:[w(Zm,{asChild:!0,children:w(zo,{label:"Remove file",size:"small",variant:"danger",children:w($e.Delete,{})})}),ee(Bb,{children:[w(It,{children:"Are you sure you want to remove this file?"}),ee(DN,{children:[w(Ac,{asChild:!0,children:w(Hr,{variant:"secondary",size:"small",children:"Cancel"})}),w(Ac,{asChild:!0,children:w(Hr,{variant:"danger",size:"small",onClick:()=>o==null?void 0:o(),children:"Confirm"})})]})]})]})]}):ee(_N,{children:[w($N,{children:w($e.CloudUpload,{})}),ee(wN,{children:[ee(It,{children:["Drag and drop to upload, or"," ",w(SN,{htmlFor:l,children:"browse files"})]}),ee(It,{weak:!0,size:"small",children:["Supported formats:"," ",EN.format(a.map(f=>f.name))]})]}),w("input",{onChange:u,type:"file",hidden:!0,id:l,accept:a.map(f=>f.mime).join(",")})]})})});_w.displayName="FileUpload";const xw=(e,t,r,n=[])=>{var i;console.log(e.target,(i=e.target)==null?void 0:i.toString());let o=!1,a=e.target;for(;a;){if(a.classList&&Array.from(a.classList).some(c=>n.includes(c))){o=!0;break}a=a.parentElement}o||t.current&&!t.current.contains(e.target)&&r()},ww=E(Hr)`
2230
+ `,EN=new Intl.ListFormat("en",{style:"long",type:"conjunction"}),_w=s.forwardRef((e,t)=>{const{file:r,onAddFile:n,onDeleteFile:o,fileTypes:a=[{name:"CSV",mime:"text/csv"}]}=e,i=yt(t),l=s.useId(),{dropProps:c,isDropTarget:d}=vN({ref:i,onDrop:async f=>{const m=f.items.find(h=>h.kind==="file");if(m&&m.kind==="file"){const h=await m.getFile();n(h)}}}),u=f=>{var m;(m=f.target.files)!=null&&m[0]&&n(f.target.files[0])};return w(yN,{...c,role:"button",tabIndex:0,ref:i,"data-state":d?"dropping":"",children:r?ee(xN,{children:[w(It,{size:"large",children:r.name}),ee(qm,{children:[w(Zm,{asChild:!0,children:w(zo,{label:"Remove file",size:"small",variant:"danger",children:w($e.Delete,{})})}),ee(Bb,{children:[w(It,{children:"Are you sure you want to remove this file?"}),ee(DN,{children:[w(Ac,{asChild:!0,children:w(Hr,{variant:"secondary",size:"small",children:"Cancel"})}),w(Ac,{asChild:!0,children:w(Hr,{variant:"danger",size:"small",onClick:()=>o==null?void 0:o(),children:"Confirm"})})]})]})]})]}):ee(_N,{children:[w($N,{children:w($e.CloudUpload,{})}),ee(wN,{children:[ee(It,{children:["Drag and drop to upload, or"," ",w(SN,{htmlFor:l,children:"browse files"})]}),ee(It,{weak:!0,size:"small",children:["Supported formats:"," ",EN.format(a.map(f=>f.name))]})]}),w("input",{onChange:u,type:"file",hidden:!0,id:l,accept:a.map(f=>f.mime).join(",")})]})})});_w.displayName="FileUpload";const xw=(e,t,r,n=[])=>{let o=!1,a=e.target;for(;a;){if(a.classList&&Array.from(a.classList).some(l=>n.includes(l))){o=!0;break}a=a.parentElement}o||t.current&&!t.current.contains(e.target)&&r()},ww=E(Hr)`
2231
2231
  width: 32px;
2232
2232
  height: 32px;
2233
2233
  padding: 0;