@bothub-chat/ui 2.50.1-feat-prompt-queue-c4860bfa-9d72-4f81-a1a2-7203c8663f57 → 2.50.1-feat-prompt-queue-81b9ef74-32fb-44f9-8934-561b25aaaf2d

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.
@@ -1 +1 @@
1
- import{__rest as e}from"tslib";import{jsxs as r,jsx as t}from"react/jsx-runtime";import a,{forwardRef as l,useId as n,useState as i,useRef as o,useCallback as s,useEffect as c}from"react";import{Typography as d}from"../typography/index.js";import{DropzoneFieldStyled as p,DropzoneFieldLabels as u,DropzoneFieldRightLabelsContainer as f,DropzoneFieldRightLabel as m,DropzoneFieldInput as g,DropzoneFieldPlaceholder as A}from"./styled.js";const h=l((l,h)=>{var{leftLabel:y,rightLabels:b,placeholder:v,files:D,onChange:w,fullWidth:L=!1,disabled:j=!1,multiple:C=!0,accept:O}=l,T=e(l,["leftLabel","rightLabels","placeholder","files","onChange","fullWidth","disabled","multiple","accept"]);const x=n(),[I,W]=i(!1),B=o(null);if(!B.current){const e=new Image;e.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",B.current=e}const E=s(e=>{null==w||w(e)},[w]),[M,Q]=Array.isArray(D)?[D,E]:i([]),F=s(e=>{var r;const t=[...null!==(r=e.currentTarget.files)&&void 0!==r?r:[]];Q(C?[...new Map([...M,...t].map(e=>[e.name,e])).values()]:[...t].slice(0,1))},[M,Q,C]),G=s(e=>{var r;e.preventDefault();const t=[...null!==(r=e.dataTransfer.files)&&void 0!==r?r:[]].filter(e=>null==O?void 0:O.includes(e.type));Q(C?[...new Map([...M,...t].map(e=>[e.name,e])).values()]:[...t].slice(0,1)),W(!1)},[M,Q,C,O]),P=s(e=>{e.preventDefault(),W(!0)},[]),R=s(e=>{e.preventDefault(),W(!1)},[]),U=s(e=>{e.preventDefault(),e.dataTransfer.dropEffect="copy";const r=B.current;r&&e.dataTransfer.setDragImage(r,0,0),W(!0)},[]);return c(()=>{if(I){const e=document.body.style.cursor;return document.body.style.cursor="grabbing",()=>{document.body.style.cursor=e}}},[I]),r(p,Object.assign({onDragEnter:U,onDrop:G,onDragOver:P,onDragLeave:R,$fullWidth:L,"data-dragged":I},T,{children:[r(u,{children:[y&&"string"==typeof y?t(d,{variant:"body-m-regular",children:y}):y,!!b&&t(f,{children:b.map((e,r)=>t(a.Fragment,{children:"string"==typeof e?t(m,{children:e}):e},r))})]}),t(g,{id:x,type:"file",multiple:C,accept:O,onChange:F,disabled:j,ref:h}),!!v&&t(A,{children:v})]}))});export{h as DropzoneField};
1
+ import{__rest as e}from"tslib";import{jsxs as r,jsx as t}from"react/jsx-runtime";import a,{forwardRef as l,useId as n,useState as i,useRef as o,useCallback as s,useEffect as c}from"react";import{Typography as d}from"../typography/index.js";import{DropzoneFieldStyled as f,DropzoneFieldLabels as p,DropzoneFieldRightLabelsContainer as u,DropzoneFieldRightLabel as m,DropzoneFieldInput as g,DropzoneFieldPlaceholder as A}from"./styled.js";const h=l((l,h)=>{var{leftLabel:y,rightLabels:b,placeholder:v,files:D,onChange:w,fullWidth:T=!1,disabled:L=!1,multiple:j=!0,accept:C}=l,O=e(l,["leftLabel","rightLabels","placeholder","files","onChange","fullWidth","disabled","multiple","accept"]);const x=n(),[E,I]=i(!1),W=o(null);if(!W.current){const e=new Image;e.src="data:image/gif;base64,R0lGODlhAQABAIAAAAAAAP///ywAAAAAAQABAAACAUwAOw==",W.current=e}const B=s(e=>{null==w||w(e)},[w]),M=e=>{const r=W.current;r&&e.setDragImage(r,0,0)},[Q,F]=Array.isArray(D)?[D,B]:i([]),G=s(e=>{var r;const t=[...null!==(r=e.currentTarget.files)&&void 0!==r?r:[]];F(j?[...new Map([...Q,...t].map(e=>[e.name,e])).values()]:[...t].slice(0,1))},[Q,F,j]),P=s(e=>{var r;e.preventDefault();const t=[...null!==(r=e.dataTransfer.files)&&void 0!==r?r:[]].filter(e=>null==C?void 0:C.includes(e.type));F(j?[...new Map([...Q,...t].map(e=>[e.name,e])).values()]:[...t].slice(0,1)),I(!1)},[Q,F,j,C]),R=s(e=>{e.preventDefault(),e.dataTransfer.dropEffect="copy",M(e.dataTransfer),I(!0)},[]),U=s(e=>{e.preventDefault(),I(!1)},[]),$=s(e=>{e.preventDefault(),e.dataTransfer.dropEffect="copy",M(e.dataTransfer),I(!0)},[]);return c(()=>{if(E){const e=document.body.style.cursor;return document.body.style.cursor="grabbing",()=>{document.body.style.cursor=e}}},[E]),r(f,Object.assign({onDragEnter:$,onDrop:P,onDragOver:R,onDragLeave:U,$fullWidth:T,"data-dragged":E},O,{children:[r(p,{children:[y&&"string"==typeof y?t(d,{variant:"body-m-regular",children:y}):y,!!b&&t(u,{children:b.map((e,r)=>t(a.Fragment,{children:"string"==typeof e?t(m,{children:e}):e},r))})]}),t(g,{id:x,type:"file",multiple:j,accept:C,onChange:G,disabled:L,ref:h}),!!v&&t(A,{children:v})]}))});export{h as DropzoneField};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@bothub-chat/ui",
3
- "version": "2.50.1-feat-prompt-queue-c4860bfa-9d72-4f81-a1a2-7203c8663f57",
3
+ "version": "2.50.1-feat-prompt-queue-81b9ef74-32fb-44f9-8934-561b25aaaf2d",
4
4
  "description": "Bothub UI Components",
5
5
  "keywords": [
6
6
  "bot",