kwant-ui 3.33.6-alpha.6 → 3.33.6-alpha.7

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/dist/index.es.js CHANGED
@@ -1412,7 +1412,7 @@ import{jsx as e,jsxs as t,Fragment as n}from"react/jsx-runtime";import r,{css as
1412
1412
  position: absolute;
1413
1413
  bottom: ${e=>e.bottomOffset};
1414
1414
  right: ${e=>e.rightOffset};
1415
- `,Kt={xxs:{avatarSize:24,fontSize:10},xs:{avatarSize:32,fontSize:14},sm:{avatarSize:48,fontSize:18},md:{avatarSize:64,fontSize:22},lg:{avatarSize:88,fontSize:26},xl:{avatarSize:128,fontSize:30},xxl:{avatarSize:180,fontSize:60}},qt=n=>{const{src:r,alt:a,size:c="md",fontSize:i,backgroundColor:o="random",fontColor:s="#fff",objectFit:h="cover",avatarButton:v,avatarButtonBottomOffset:u=0,avatarButtonRightOffset:g=0,onClick:m}=n,[d,f]=p(null),[_,w]=p(!1),b=((e="")=>{const t=e?.trim()?.split(" ");if(t.length>1){const[e,...n]=t;return`${e[0]}${n?.pop()?.[0]}`.toUpperCase()}const n=t[0];return n[0]?.toUpperCase()||""})(a),y="random"!==o?o:function(e){let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);let n="#";for(let e=0;e<3;e++)n+=("00"+(t>>8*e&255).toString(16)).substr(-2);return n}(a),x=c in Kt?Kt[c]:{avatarSize:c,fontSize:i},Z=()=>w(!0),O=()=>w(!1);return l((()=>{if(r){const e=new Image;e.src=r,e.onload=Z,e.onerror=O,f(e)}else O()}),[r]),t(Yt,{children:[e(Ut,{background:y,size:ke(x.avatarSize),onClick:()=>{m?.(n)},children:_?e(Wt,{src:d?.currentSrc,alt:a,objectFit:h,loading:"lazy"}):e($t,{fontSize:ke(i||x.fontSize),fontColor:s,children:b})}),e(Xt,{rightOffset:ke(g,"0px"),bottomOffset:ke(u,"0px"),children:v})]})},Gt=n=>{const{label:r="",image:a="",selected:c,avatarProps:i}=n;return t(Ft,{selected:c,children:[e(qt,{src:a,alt:r,size:"xs",...i}),e(Qt,{category:"body2",weight:"medium",color:A.grey.grey900,children:n.label}),c&&e(rt,{icon:"check",width:20,height:20,fill:A.green.green400})]})},Jt=n=>{const{maxHeight:r=350,width:a=350,offsetTop:c="60px",offsetLeft:i,offsetRight:o,offsetBottom:s,zIndex:h,opened:v,onChange:g,onDropdownVisibilityChange:m,data:d=[],onSelect:_,itemComponent:w,showSeparator:b=!0,collapseOnSelect:y=!0,inputLeftSection:x,inputRightSection:Z,searchPlaceholder:O="Search",searchable:M=!0,showScrollbar:E=!0,targetRef:P,onMouseEnter:j,onMouseLeave:V,onClose:C,searchAutofocus:A=!0,addable:L,selectInputValue:B,avatarProps:z,selectedValue:k}=n,[S,R]=p(""),[D,I]=p([]),T=jt(S,400),N=u(null),F=S?D:d,Q=S&&0===D.length,Y=F.some((e=>"image"in e)),U={select:(e,t)=>()=>{_?.(e,t),y&&C?.()},searchQueryChange:e=>{R(e.target.value)}};return l((()=>{const e=S.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&");const t=new RegExp(e,"ig"),n=d?.filter((({label:e,value:n})=>e.match(t)||n?.match(t)));I(n)}),[T,d]),l((()=>{g?.(v),m?.(),R("")}),[v]),e(zt,{opened:v,onClose:C,width:ke(a),offsetTop:c,offsetLeft:i,offsetRight:o,offsetBottom:s,zIndex:h,targetRef:P,onMouseEnter:j,onMouseLeave:V,children:t(kt,{expandedHeight:r,children:[M&&e(St,{children:e(at,{placeholder:O,value:S,onChange:U.searchQueryChange,leftSection:x,rightSection:Z,autoFocus:A})}),Q?e(Tt,{children:e(Oe,{category:"body1",children:"Sorry, no results were found matching your search criteria."})}):t(Rt,{separator:b,showScrollbar:E,ref:N,children:[e(H,{viewportRef:N,items:F,children:(t,n)=>w?e(It,{onMouseDown:U.select(t,n),children:f(w,{...t,label:t.label,value:t.value,index:n,key:`${t.label}${t.value}`})},`${t.label}${t.value}+${n}`):Y?e(It,{onMouseDown:U.select(t,n),children:e(Gt,{...t,avatarProps:z,selected:t.value===k})},`${t.label}${t.value}+${n}`):e(Dt,{onMouseDown:U.select(t,n),role:"button",children:t.label},`${t.label}${t.value}+${n}`)}),L&&0===F.length&&e(Dt,{onClick:U.select({label:B,value:null},0),role:"button",children:t(Nt,{children:[e(Oe,{category:"body1",weight:"semiBold",children:"Add:"}),t(Oe,{children:[" ",B]})]})})]})]})})},en=r.div`
1415
+ `,Kt={xxs:{avatarSize:24,fontSize:10},xs:{avatarSize:32,fontSize:14},sm:{avatarSize:48,fontSize:18},md:{avatarSize:64,fontSize:22},lg:{avatarSize:88,fontSize:26},xl:{avatarSize:128,fontSize:30},xxl:{avatarSize:180,fontSize:60}},qt=n=>{const{src:r,alt:a,size:c="md",fontSize:i,backgroundColor:o="random",fontColor:s="#fff",objectFit:h="cover",avatarButton:v,avatarButtonBottomOffset:u=0,avatarButtonRightOffset:g=0,onClick:m}=n,[d,f]=p(null),[_,w]=p(!1),b=((e="")=>{const t=e?.trim()?.split(" ");if(t.length>1){const[e,...n]=t;return`${e[0]}${n?.pop()?.[0]}`.toUpperCase()}const n=t[0];return n[0]?.toUpperCase()||""})(a),y="random"!==o?o:function(e){let t=0;for(let n=0;n<e.length;n++)t=e.charCodeAt(n)+((t<<5)-t);let n="#";for(let e=0;e<3;e++)n+=("00"+(t>>8*e&255).toString(16)).substr(-2);return n}(a),x=c in Kt?Kt[c]:{avatarSize:c,fontSize:i},Z=()=>w(!0),O=()=>w(!1);return l((()=>{if(r){const e=new Image;e.src=r,e.onload=Z,e.onerror=O,f(e)}else O()}),[r]),t(Yt,{children:[e(Ut,{background:y,size:ke(x.avatarSize),onClick:()=>{m?.(n)},children:_?e(Wt,{src:d?.currentSrc,alt:a,objectFit:h,loading:"lazy"}):e($t,{fontSize:ke(i||x.fontSize),fontColor:s,children:b})}),e(Xt,{rightOffset:ke(g,"0px"),bottomOffset:ke(u,"0px"),children:v})]})},Gt=n=>{const{label:r="",image:a="",selected:c,avatarProps:i}=n;return t(Ft,{selected:c,children:[e(qt,{src:a,alt:r,size:"xs",...i}),e(Qt,{category:"body2",weight:"medium",color:A.grey.grey900,children:n.label}),c&&e(rt,{icon:"check",width:20,height:20,fill:A.green.green400})]})},Jt=n=>{const{maxHeight:r=350,width:a=350,offsetTop:c="60px",offsetLeft:i,offsetRight:o,offsetBottom:s,zIndex:h,opened:v,onChange:g,onDropdownVisibilityChange:m,data:d=[],onSelect:_,itemComponent:w,showSeparator:b=!0,collapseOnSelect:y=!0,inputLeftSection:x,inputRightSection:Z,searchPlaceholder:O="Search",searchable:M=!0,showScrollbar:E=!0,targetRef:P,onMouseEnter:j,onMouseLeave:V,onClose:C,searchAutofocus:A=!0,addable:L,selectInputValue:B,avatarProps:z,selectedValue:k}=n,[S,R]=p(""),[D,I]=p([]),T=jt(S,400),N=u(null),F=S?D:d,Q=S&&0===D.length,Y=F.some((e=>"image"in e)),U={select:(e,t)=>()=>{_?.(e,t),y&&C?.()},searchQueryChange:e=>{R(e.target.value)}};return l((()=>{const e=S.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&");const t=new RegExp(e,"ig"),n=d?.filter((({label:e,value:n})=>e.match(t)||n?.match(t)));I(n)}),[T,d]),l((()=>{g?.(v),m?.(),R("")}),[v]),e(zt,{opened:v,onClose:C,width:ke(a),offsetTop:c,offsetLeft:i,offsetRight:o,offsetBottom:s,zIndex:h,targetRef:P,onMouseEnter:j,onMouseLeave:V,children:t(kt,{expandedHeight:r,children:[M&&e(St,{children:e(at,{placeholder:O,value:S,onChange:U.searchQueryChange,leftSection:x,rightSection:Z,autoFocus:A})}),Q?e(Tt,{children:e(Oe,{category:"body1",children:"Sorry, no results were found matching your search criteria."})}):t(Rt,{separator:b,showScrollbar:E,ref:N,children:[e(H,{viewportRef:N,items:F,children:(t,n)=>w?e(It,{onMouseDown:e=>{},onClick:e=>e.stopPropagation(),children:f(w,{...t,label:t.label,value:t.value,index:n,key:`${t.label}${t.value}`})},`${t.label}${t.value}+${n}`):Y?e(It,{onMouseDown:U.select(t,n),onClick:e=>e.stopPropagation(),children:e(Gt,{...t,avatarProps:z,selected:t.value===k})},`${t.label}${t.value}+${n}`):e(Dt,{onMouseDown:U.select(t,n),onClick:e=>e.stopPropagation(),role:"button",children:t.label},`${t.label}${t.value}+${n}`)}),L&&0===F.length&&e(Dt,{onClick:U.select({label:B,value:null},0),role:"button",children:t(Nt,{children:[e(Oe,{category:"body1",weight:"semiBold",children:"Add:"}),t(Oe,{children:[" ",B]})]})})]})]})})},en=r.div`
1416
1416
  position: relative;
1417
1417
  `,tn=r.div`
1418
1418
  width: 100%;
package/dist/index.js CHANGED
@@ -1412,7 +1412,7 @@
1412
1412
  position: absolute;
1413
1413
  bottom: ${e=>e.bottomOffset};
1414
1414
  right: ${e=>e.rightOffset};
1415
- `,yt={xxs:{avatarSize:24,fontSize:10},xs:{avatarSize:32,fontSize:14},sm:{avatarSize:48,fontSize:18},md:{avatarSize:64,fontSize:22},lg:{avatarSize:88,fontSize:26},xl:{avatarSize:128,fontSize:30},xxl:{avatarSize:180,fontSize:60}},xt=t=>{const{src:n,alt:a,size:c="md",fontSize:i,backgroundColor:o="random",fontColor:s="#fff",objectFit:l="cover",avatarButton:h,avatarButtonBottomOffset:v=0,avatarButtonRightOffset:p=0,onClick:u}=t,[g,m]=r.useState(null),[d,f]=r.useState(!1),_=((e="")=>{const t=e?.trim()?.split(" ");if(t.length>1){const[e,...r]=t;return`${e[0]}${r?.pop()?.[0]}`.toUpperCase()}const r=t[0];return r[0]?.toUpperCase()||""})(a),w="random"!==o?o:function(e){let t=0;for(let r=0;r<e.length;r++)t=e.charCodeAt(r)+((t<<5)-t);let r="#";for(let e=0;e<3;e++)r+=("00"+(t>>8*e&255).toString(16)).substr(-2);return r}(a),b=c in yt?yt[c]:{avatarSize:c,fontSize:i},y=()=>f(!0),x=()=>f(!1);return r.useEffect((()=>{if(n){const e=new Image;e.src=n,e.onload=y,e.onerror=x,m(e)}else x()}),[n]),e.jsxs(dt,{children:[e.jsx(ft,{background:w,size:ue(b.avatarSize),onClick:()=>{u?.(t)},children:d?e.jsx(_t,{src:g?.currentSrc,alt:a,objectFit:l,loading:"lazy"}):e.jsx(wt,{fontSize:ue(i||b.fontSize),fontColor:s,children:_})}),e.jsx(bt,{rightOffset:ue(p,"0px"),bottomOffset:ue(v,"0px"),children:h})]})},Zt=t=>{const{label:r="",image:n="",selected:a,avatarProps:c}=t;return e.jsxs(gt,{selected:a,children:[e.jsx(xt,{src:n,alt:r,size:"xs",...c}),e.jsx(mt,{category:"body2",weight:"medium",color:v.grey.grey900,children:t.label}),a&&e.jsx(Le,{icon:"check",width:20,height:20,fill:v.green.green400})]})},Ot=t=>{const{maxHeight:n=350,width:c=350,offsetTop:i="60px",offsetLeft:o,offsetRight:s,offsetBottom:l,zIndex:h,opened:v,onChange:p,onDropdownVisibilityChange:u,data:g=[],onSelect:m,itemComponent:d,showSeparator:f=!0,collapseOnSelect:_=!0,inputLeftSection:w,inputRightSection:b,searchPlaceholder:y="Search",searchable:x=!0,showScrollbar:Z=!0,targetRef:O,onMouseEnter:M,onMouseLeave:E,onClose:H,searchAutofocus:P=!0,addable:j,selectInputValue:V,avatarProps:C,selectedValue:A}=t,[L,B]=r.useState(""),[z,k]=r.useState([]),S=tt(L,400),R=r.useRef(null),D=L?z:g,I=L&&0===z.length,T=D.some((e=>"image"in e)),N={select:(e,t)=>()=>{m?.(e,t),_&&H?.()},searchQueryChange:e=>{B(e.target.value)}};return r.useEffect((()=>{const e=L.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&");const t=new RegExp(e,"ig"),r=g?.filter((({label:e,value:r})=>e.match(t)||r?.match(t)));k(r)}),[S,g]),r.useEffect((()=>{p?.(v),u?.(),B("")}),[v]),e.jsx(it,{opened:v,onClose:H,width:ue(c),offsetTop:i,offsetLeft:o,offsetRight:s,offsetBottom:l,zIndex:h,targetRef:O,onMouseEnter:M,onMouseLeave:E,children:e.jsxs(ot,{expandedHeight:n,children:[x&&e.jsx(st,{children:e.jsx(Be,{placeholder:y,value:L,onChange:N.searchQueryChange,leftSection:w,rightSection:b,autoFocus:P})}),I?e.jsx(pt,{children:e.jsx(re,{category:"body1",children:"Sorry, no results were found matching your search criteria."})}):e.jsxs(lt,{separator:f,showScrollbar:Z,ref:R,children:[e.jsx(a.ViewportList,{viewportRef:R,items:D,children:(t,n)=>d?e.jsx(vt,{onMouseDown:N.select(t,n),children:r.createElement(d,{...t,label:t.label,value:t.value,index:n,key:`${t.label}${t.value}`})},`${t.label}${t.value}+${n}`):T?e.jsx(vt,{onMouseDown:N.select(t,n),children:e.jsx(Zt,{...t,avatarProps:C,selected:t.value===A})},`${t.label}${t.value}+${n}`):e.jsx(ht,{onMouseDown:N.select(t,n),role:"button",children:t.label},`${t.label}${t.value}+${n}`)}),j&&0===D.length&&e.jsx(ht,{onClick:N.select({label:V,value:null},0),role:"button",children:e.jsxs(ut,{children:[e.jsx(re,{category:"body1",weight:"semiBold",children:"Add:"}),e.jsxs(re,{children:[" ",V]})]})})]})]})})},Mt=t.div`
1415
+ `,yt={xxs:{avatarSize:24,fontSize:10},xs:{avatarSize:32,fontSize:14},sm:{avatarSize:48,fontSize:18},md:{avatarSize:64,fontSize:22},lg:{avatarSize:88,fontSize:26},xl:{avatarSize:128,fontSize:30},xxl:{avatarSize:180,fontSize:60}},xt=t=>{const{src:n,alt:a,size:c="md",fontSize:i,backgroundColor:o="random",fontColor:s="#fff",objectFit:l="cover",avatarButton:h,avatarButtonBottomOffset:v=0,avatarButtonRightOffset:p=0,onClick:u}=t,[g,m]=r.useState(null),[d,f]=r.useState(!1),_=((e="")=>{const t=e?.trim()?.split(" ");if(t.length>1){const[e,...r]=t;return`${e[0]}${r?.pop()?.[0]}`.toUpperCase()}const r=t[0];return r[0]?.toUpperCase()||""})(a),w="random"!==o?o:function(e){let t=0;for(let r=0;r<e.length;r++)t=e.charCodeAt(r)+((t<<5)-t);let r="#";for(let e=0;e<3;e++)r+=("00"+(t>>8*e&255).toString(16)).substr(-2);return r}(a),b=c in yt?yt[c]:{avatarSize:c,fontSize:i},y=()=>f(!0),x=()=>f(!1);return r.useEffect((()=>{if(n){const e=new Image;e.src=n,e.onload=y,e.onerror=x,m(e)}else x()}),[n]),e.jsxs(dt,{children:[e.jsx(ft,{background:w,size:ue(b.avatarSize),onClick:()=>{u?.(t)},children:d?e.jsx(_t,{src:g?.currentSrc,alt:a,objectFit:l,loading:"lazy"}):e.jsx(wt,{fontSize:ue(i||b.fontSize),fontColor:s,children:_})}),e.jsx(bt,{rightOffset:ue(p,"0px"),bottomOffset:ue(v,"0px"),children:h})]})},Zt=t=>{const{label:r="",image:n="",selected:a,avatarProps:c}=t;return e.jsxs(gt,{selected:a,children:[e.jsx(xt,{src:n,alt:r,size:"xs",...c}),e.jsx(mt,{category:"body2",weight:"medium",color:v.grey.grey900,children:t.label}),a&&e.jsx(Le,{icon:"check",width:20,height:20,fill:v.green.green400})]})},Ot=t=>{const{maxHeight:n=350,width:c=350,offsetTop:i="60px",offsetLeft:o,offsetRight:s,offsetBottom:l,zIndex:h,opened:v,onChange:p,onDropdownVisibilityChange:u,data:g=[],onSelect:m,itemComponent:d,showSeparator:f=!0,collapseOnSelect:_=!0,inputLeftSection:w,inputRightSection:b,searchPlaceholder:y="Search",searchable:x=!0,showScrollbar:Z=!0,targetRef:O,onMouseEnter:M,onMouseLeave:E,onClose:H,searchAutofocus:P=!0,addable:j,selectInputValue:V,avatarProps:C,selectedValue:A}=t,[L,B]=r.useState(""),[z,k]=r.useState([]),S=tt(L,400),R=r.useRef(null),D=L?z:g,I=L&&0===z.length,T=D.some((e=>"image"in e)),N={select:(e,t)=>()=>{m?.(e,t),_&&H?.()},searchQueryChange:e=>{B(e.target.value)}};return r.useEffect((()=>{const e=L.replace(/[.*+\-?^${}()|[\]\\]/g,"\\$&");const t=new RegExp(e,"ig"),r=g?.filter((({label:e,value:r})=>e.match(t)||r?.match(t)));k(r)}),[S,g]),r.useEffect((()=>{p?.(v),u?.(),B("")}),[v]),e.jsx(it,{opened:v,onClose:H,width:ue(c),offsetTop:i,offsetLeft:o,offsetRight:s,offsetBottom:l,zIndex:h,targetRef:O,onMouseEnter:M,onMouseLeave:E,children:e.jsxs(ot,{expandedHeight:n,children:[x&&e.jsx(st,{children:e.jsx(Be,{placeholder:y,value:L,onChange:N.searchQueryChange,leftSection:w,rightSection:b,autoFocus:P})}),I?e.jsx(pt,{children:e.jsx(re,{category:"body1",children:"Sorry, no results were found matching your search criteria."})}):e.jsxs(lt,{separator:f,showScrollbar:Z,ref:R,children:[e.jsx(a.ViewportList,{viewportRef:R,items:D,children:(t,n)=>d?e.jsx(vt,{onMouseDown:e=>{},onClick:e=>e.stopPropagation(),children:r.createElement(d,{...t,label:t.label,value:t.value,index:n,key:`${t.label}${t.value}`})},`${t.label}${t.value}+${n}`):T?e.jsx(vt,{onMouseDown:N.select(t,n),onClick:e=>e.stopPropagation(),children:e.jsx(Zt,{...t,avatarProps:C,selected:t.value===A})},`${t.label}${t.value}+${n}`):e.jsx(ht,{onMouseDown:N.select(t,n),onClick:e=>e.stopPropagation(),role:"button",children:t.label},`${t.label}${t.value}+${n}`)}),j&&0===D.length&&e.jsx(ht,{onClick:N.select({label:V,value:null},0),role:"button",children:e.jsxs(ut,{children:[e.jsx(re,{category:"body1",weight:"semiBold",children:"Add:"}),e.jsxs(re,{children:[" ",V]})]})})]})]})})},Mt=t.div`
1416
1416
  position: relative;
1417
1417
  `,Et=t.div`
1418
1418
  width: 100%;
package/dist/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kwant-ui",
3
- "version": "3.33.6-alpha.6",
3
+ "version": "3.33.6-alpha.7",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.es.js",
6
6
  "types": "./dist/index.d.ts",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "kwant-ui",
3
- "version": "3.33.6-alpha.6",
3
+ "version": "3.33.6-alpha.7",
4
4
  "main": "./dist/index.js",
5
5
  "module": "./dist/index.es.js",
6
6
  "types": "./dist/index.d.ts",