@bothub-chat/ui 2.50.1-feat-prompt-queue-3b7fa9ca-ef8d-42e3-98c2-027cff405318 → 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,7 +1,7 @@
1
1
  import React from 'react';
2
2
  export type DropzoneFieldChangeEventHandler = (files: File[]) => void;
3
3
  export type DropzoneFieldProps = {
4
- leftLabel?: string;
4
+ leftLabel?: string | React.ReactNode;
5
5
  rightLabels?: string[] | React.ReactNode[];
6
6
  placeholder?: React.ReactNode;
7
7
  error?: string;
@@ -1 +1 @@
1
- import{__rest as e}from"tslib";import{jsxs as l,jsx as r}from"react/jsx-runtime";import a,{forwardRef as t,useId as i,useState as n,useCallback as d}from"react";import{Typography as o}from"../typography/index.js";import{DropzoneFieldStyled as p,DropzoneFieldLabels as s,DropzoneFieldRightLabelsContainer as c,DropzoneFieldRightLabel as f,DropzoneFieldInput as m,DropzoneFieldPlaceholder as u}from"./styled.js";const h=t((t,h)=>{var{leftLabel:g,rightLabels:v,placeholder:b,files:y,onChange:D,fullWidth:L=!1,disabled:j=!1,multiple:x=!0,accept:C}=t,W=e(t,["leftLabel","rightLabels","placeholder","files","onChange","fullWidth","disabled","multiple","accept"]);const w=i(),[A,M]=n(!1),O=d(e=>{null==D||D(e)},[D]),[T,F]=Array.isArray(y)?[y,O]:n([]),$=d(e=>{var l;const r=[...null!==(l=e.currentTarget.files)&&void 0!==l?l:[]];F(x?[...new Map([...T,...r].map(e=>[e.name,e])).values()]:[...r].slice(0,1))},[T,F,x]),k=d(e=>{var l;e.preventDefault();const r=[...null!==(l=e.dataTransfer.files)&&void 0!==l?l:[]].filter(e=>null==C?void 0:C.includes(e.type));F(x?[...new Map([...T,...r].map(e=>[e.name,e])).values()]:[...r].slice(0,1)),M(!1)},[T,F,x,C]),q=d(e=>{e.preventDefault(),M(!0)},[]),z=d(e=>{e.preventDefault(),M(!1)},[]);return l(p,Object.assign({onDrop:k,onDragOver:q,onDragLeave:z,$fullWidth:L,"data-dragged":A},W,{children:[l(s,{children:[g&&r(o,{variant:"body-m-regular",children:g}),!!v&&r(c,{children:v.map((e,l)=>r(a.Fragment,{children:"string"==typeof e?r(f,{children:e}):e},l))})]}),r(m,{id:w,type:"file",multiple:x,accept:C,onChange:$,disabled:j,ref:h}),!!b&&r(u,{children:b})]}))});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-3b7fa9ca-ef8d-42e3-98c2-027cff405318",
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",