@sorocraft/ui
Advanced tools
Comparing version 1.0.17 to 1.0.18
@@ -11,2 +11,3 @@ export { default as Avatar } from "./components/Avatar"; | ||
export { default as Accordion } from "./components/Accordion"; | ||
export { default as Tooltip } from "./components/Tooltip"; | ||
export * from "./components/SVGIcon/SVGIcon.types"; | ||
@@ -13,0 +14,0 @@ export * from "./components/Input/Input.types"; |
@@ -1,2 +0,2 @@ | ||
import{jsx as e,jsxs as o}from"react/jsx-runtime";import{useState as n,Fragment as t,forwardRef as i,useEffect as l,useRef as d}from"react";import a from"react-dom";var r={avatar:"Avatar-module_avatar__5-kP8",image:"Avatar-module_image__HFFlp",clickable:"Avatar-module_clickable__DD7pl",editable:"Avatar-module_editable__CpXtw",editIcon:"Avatar-module_editIcon__ULUa1",overlay:"Avatar-module_overlay__d95aK",overlayText:"Avatar-module_overlayText__NgsFM",loading:"Avatar-module_loading__9gBDd",xxs:"Avatar-module_xxs__zCCH6",xs:"Avatar-module_xs__1SMBv",sm:"Avatar-module_sm__8TB22",md:"Avatar-module_md__zeW0d",lg:"Avatar-module_lg__MWKN-",xl:"Avatar-module_xl__KCqIL",xxl:"Avatar-module_xxl__ox6gi",xxxl:"Avatar-module_xxxl__9Cc7C",inline:"Avatar-module_inline__H0AhD",flexWide:"Avatar-module_flexWide__GQYaQ",slidein:"Avatar-module_slidein__KV8Ih",fadeInOut:"Avatar-module_fadeInOut__2M9tv",heightAnimation:"Avatar-module_heightAnimation__RCYYu",fadein:"Avatar-module_fadein__lENH2",floatAnimation:"Avatar-module_floatAnimation__PNWhi"},_=function(e,o,n){void 0===n&&(n=[]);var t=[];for(var i in o)o[i]&&t.push(e[i]);return(null==n?void 0:n.length)>0&&(t=t.concat(n)),t.join(" ")},u={container:"SVGIcon-module_container__z2RN5",isLoading:"SVGIcon-module_isLoading__8BhuU",fadeInOut:"SVGIcon-module_fadeInOut__EgbCf",flexWide:"SVGIcon-module_flexWide__IfOOF",slidein:"SVGIcon-module_slidein__RT6-4",heightAnimation:"SVGIcon-module_heightAnimation__CmY-x",fadein:"SVGIcon-module_fadein__Y2P5U",floatAnimation:"SVGIcon-module_floatAnimation__kH3Tr"},c=function(o){var n=o.icon,t=o.size,i=void 0===t?"sm":t,l=o.className,d=void 0===l?"":l,a=o.isLoading,r=void 0!==a&&a,c=function(e){switch(e){case"xxs":return 8;case"xs":return 12;case"sm":default:return 16;case"md":return 24;case"lg":return 32;case"xl":return 48;case"xxl":return 64;case"xxxl":return 128}}(i);return n?e("div",{className:_(u,{container:!0,isLoading:r},[d]),children:e(n,{className:d,width:c,height:c,viewBox:"0 0 24 24",preserveAspectRatio:"xMidYMid meet"})}):null},m=function(){return m=Object.assign||function(e){for(var o,n=1,t=arguments.length;n<t;n++)for(var i in o=arguments[n])Object.prototype.hasOwnProperty.call(o,i)&&(e[i]=o[i]);return e},m.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var s,h=function(n){return o("svg",m({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},n,{children:[e("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M2 8.377c0-.35 0-.525.015-.673a3 3 0 0 1 2.69-2.69C4.851 5 5.035 5 5.404 5c.143 0 .214 0 .274-.004a2 2 0 0 0 1.735-1.25c.023-.056.044-.12.086-.246.042-.127.063-.19.086-.246a2 2 0 0 1 1.735-1.25C9.38 2 9.448 2 9.58 2h4.838c.133 0 .2 0 .26.004a2 2 0 0 1 1.735 1.25c.023.056.044.12.086.246.042.127.063.19.086.246a2 2 0 0 0 1.735 1.25c.06.004.131.004.273.004.37 0 .554 0 .702.015a3 3 0 0 1 2.69 2.69c.014.147.014.322.014.672V16.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2z"}),e("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 16.5a4 4 0 1 0 0-8 4 4 0 0 0 0 8"})]}))},g=function(o){return e("svg",m({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},o,{children:e("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 6 9 17l-5-5"})}))},f=function(o){return e("svg",m({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},o,{children:e("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"m9 18 6-6-6-6"})}))},p=function(o){return e("svg",m({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},o,{children:e("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"m4.272 20.728 6.597-6.597c.396-.396.594-.594.822-.668a1 1 0 0 1 .618 0c.228.074.426.272.822.668l6.553 6.553M14 15l2.869-2.869c.396-.396.594-.594.822-.668a1 1 0 0 1 .618 0c.228.074.426.272.822.668L22 15M10 9a2 2 0 1 1-4 0 2 2 0 0 1 4 0M6.8 21h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 18.72 22 17.88 22 16.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 3 18.88 3 17.2 3H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 5.28 2 6.12 2 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 21 5.12 21 6.8 21"})}))},v=function(o){return e("svg",m({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},o,{children:e("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 12h14"})}))},I=function(o){return e("svg",m({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},o,{children:e("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 5v14m-7-7h14"})}))},A=function(o){return e("svg",m({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},o,{children:e("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"m8 16 4-4m0 0 4 4m-4-4v9m8-4.257A5.5 5.5 0 0 0 16.5 7a.62.62 0 0 1-.534-.302 7.5 7.5 0 1 0-11.78 9.096"})}))},x=function(o){return e("svg",m({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},o,{children:e("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5.316 19.438A4 4 0 0 1 9 17h6a4 4 0 0 1 3.684 2.438M16 9.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0m6 2.5c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10"})}))},L=function(n){var t=n.source,i=void 0===t?null:t,l=n.alt,d=void 0===l?"avatar":l,a=n.size,u=void 0===a?"sm":a,m=n.onClick,s=n.className,g=n.isEditable,f=void 0!==g&&g,p=n.overlayIcon,v=n.inline,I=void 0!==v&&v,L=n.isLoading,k=void 0!==L&&L,D=n.overlayText,w=function(){switch(u){case"xxxl":return 512;case"xxl":return 256;case"xl":return 128;case"lg":return 96;case"md":return 64;case"xs":return 32;case"xxs":return 24;default:return 48}};return o("div",{className:_(r,{avatar:!0,clickable:!!m||f,editable:f,inline:I,loading:k},[r[u],s]),onClick:m,style:{width:w(),height:w()},children:[i?e("img",{src:i,alt:d,className:r.image,width:w(),height:w()}):e(c,{size:u,icon:x}),f&&e("div",{className:r.editIcon,children:e(c,{isLoading:k,icon:k?A:h})}),(!!p||D)&&o("div",{className:r.overlay,children:[!!p&&e(c,{isLoading:k,icon:k?A:p}),!!D&&e("div",{className:r.overlayText,children:D})]})]})},k={container:"Button-module_container__0j8md",confirm:"Button-module_confirm__N5z4A",confirmActions:"Button-module_confirmActions__Xh7kN",button:"Button-module_button__18Bed",label:"Button-module_label__1PsXG",light:"Button-module_light__oUjYe",lightDark:"Button-module_lightDark__vucG6",active:"Button-module_active__UeHD7",lightDanger:"Button-module_lightDanger__aDpy8",lightInfo:"Button-module_lightInfo__oCfFI",lightPrimary:"Button-module_lightPrimary__f7-kQ",lightSecondary:"Button-module_lightSecondary__YK-QR",lightWarning:"Button-module_lightWarning__-Ogcg",lightSuccess:"Button-module_lightSuccess__gSt46",primary:"Button-module_primary__st6yY",secondary:"Button-module_secondary__j-3rj",danger:"Button-module_danger__Hxs5n",dark:"Button-module_dark__T7dl8",info:"Button-module_info__2z1ZG",success:"Button-module_success__CHTsg",warning:"Button-module_warning__1voOb",whiteText:"Button-module_whiteText__12xTM",default:"Button-module_default__TZZU2",borderedPrimary:"Button-module_borderedPrimary__KrZVT",borderedSecondary:"Button-module_borderedSecondary__UPNks",small:"Button-module_small__zfmcP",xsmall:"Button-module_xsmall__QS3d-",fullWidth:"Button-module_fullWidth__AHpSl",flexWide:"Button-module_flexWide__xDrEF",slidein:"Button-module_slidein__ofhlO",fadeInOut:"Button-module_fadeInOut__nAOqm",heightAnimation:"Button-module_heightAnimation__fLFCd",fadein:"Button-module_fadein__pspkB",floatAnimation:"Button-module_floatAnimation__0PYtT"};!function(e){e.PRIMARY="primary",e.SECONDARY="secondary",e.DANGER="danger",e.SUCCESS="success",e.WARNING="warning",e.INFO="info",e.LIGHT="light",e.DEFAULT="default",e.DARK="dark",e.LIGHT_PRIMARY="lightPrimary",e.LIGHT_SUCCESS="lightSuccess",e.LIGHT_WARNING="lightWarning",e.LIGHT_INFO="lightInfo",e.LIGHT_DANGER="lightDanger",e.LIGHT_DARK="lightDark",e.LIGHT_SECONDARY="lightSecondary",e.WHITE_TEXT="whiteText",e.BORDERED_PRIMARY="borderedPrimary",e.BORDERED_SECONDARY="borderedSecondary"}(s||(s={}));var D,w=function(i){var l=i.type,d=void 0===l?s.PRIMARY:l,a=i.onClick,r=i.label,u=i.icon,m=i.fullWidth,h=void 0!==m&&m,g=i.isLoading,f=i.disabled,p=i.className,v=i.needConfirm,I=void 0!==v&&v,A=i.size,x=void 0===A?"standard":A,L=n(!1),D=L[0],y=L[1];return o("div",{className:_(k,{container:!0,fullWidth:h}),children:[e("button",{className:_(k,{button:!0,loading:!!g},[k[d],k[x],p]),onClick:I?function(){return y(!D)}:a,disabled:g||f,children:g?e(t,{children:"Loading..."}):o("div",{className:k.label,children:[u&&e(c,{icon:u}),e("span",{children:r})]})}),D&&o("div",{className:k.confirm,children:[e("div",{className:k.confirmMessage,children:"Are you sure?"}),o("div",{className:k.confirmActions,children:[e(w,{type:s.DANGER,onClick:function(){return y(!1)},label:"No"}),e(w,{type:s.SUCCESS,onClick:function(){y(!1),a()},label:"Yes"})]})]})]})},y={iconButton:"IconButton-module_iconButton__PmpB8",noPadding:"IconButton-module_noPadding__Jd2rK",lg:"IconButton-module_lg__KG7lp",md:"IconButton-module_md__s4q7b",sm:"IconButton-module_sm__are9s",xs:"IconButton-module_xs__qYwZc",confirm:"IconButton-module_confirm__-jXH4",confirmActions:"IconButton-module_confirmActions__j7-Tt",bottom:"IconButton-module_bottom__AEpND",disabled:"IconButton-module_disabled__pLK-t",white:"IconButton-module_white__AzyNN",light:"IconButton-module_light__i3AET",active:"IconButton-module_active__popsF",lightDark:"IconButton-module_lightDark__d7NQy",lightDanger:"IconButton-module_lightDanger__bIg02",lightInfo:"IconButton-module_lightInfo__820It",lightPrimary:"IconButton-module_lightPrimary__SCrg-",lightSecondary:"IconButton-module_lightSecondary__vN-aS",lightWarning:"IconButton-module_lightWarning__z1iaR",lightSuccess:"IconButton-module_lightSuccess__mUSnD",primary:"IconButton-module_primary__qjfR5",secondary:"IconButton-module_secondary__-CufX",danger:"IconButton-module_danger__lz3tP",dark:"IconButton-module_dark__QiBJk",info:"IconButton-module_info__eawU-",success:"IconButton-module_success__xkDzZ",warning:"IconButton-module_warning__DhbfD",whiteText:"IconButton-module_whiteText__111Ju",default:"IconButton-module_default__j2U57",borderedPrimary:"IconButton-module_borderedPrimary__DHXJQ",borderedSecondary:"IconButton-module_borderedSecondary__13GNA",flexWide:"IconButton-module_flexWide__BGOfY",slidein:"IconButton-module_slidein__Rmpl5",fadeInOut:"IconButton-module_fadeInOut__Z2E5a",heightAnimation:"IconButton-module_heightAnimation__JnqnZ",fadein:"IconButton-module_fadein__uX9ut",floatAnimation:"IconButton-module_floatAnimation__N-INw"},B=function(t){var i=t.icon,l=t.onClick,d=t.type,a=void 0===d?s.DEFAULT:d,r=t.needConfirm,u=void 0!==r&&r,m=t.noPadding,h=void 0!==m&&m,g=t.isLoading,f=void 0!==g&&g,p=t.size,v=void 0===p?"sm":p,I=t.confirmPosition,A=void 0===I?"top":I,x=n(!1),L=x[0],k=x[1];return o("div",{className:_(y,{iconButton:!0,noPadding:h},[y[a],y[v]]),onClick:f?void 0:u?function(){return k(!L)}:l,children:[e(c,{isLoading:f,icon:i,size:v}),L&&o("div",{className:"".concat(y.confirm," ").concat(y[A]),children:[e("div",{className:y.confirmMessage,children:"Are you sure?"}),o("div",{className:y.confirmActions,children:[e(w,{type:s.DANGER,onClick:function(){return k(!1)},label:"No",size:"small"}),e(w,{type:s.SUCCESS,onClick:l,label:"Yes",size:"small"})]})]})]})},b={listItem:"ListItem-module_listItem__ljWE5",separator:"ListItem-module_separator__CIXS1",dashedSeparator:"ListItem-module_dashedSeparator__SYWNX",content:"ListItem-module_content__mPC1D",data:"ListItem-module_data__e0N6V",title:"ListItem-module_title__YkOz9",subtitle:"ListItem-module_subtitle__5flJp",indicator:"ListItem-module_indicator__BwMsO",success:"ListItem-module_success__lgO8z",info:"ListItem-module_info__MKMBu",warning:"ListItem-module_warning__8P-nA",danger:"ListItem-module_danger__sWYOu",primary:"ListItem-module_primary__-bA-W",completed:"ListItem-module_completed__ovBl4",flexWide:"ListItem-module_flexWide__-0Q5a",slidein:"ListItem-module_slidein__dGxX-",fadeInOut:"ListItem-module_fadeInOut__Yuwsd",heightAnimation:"ListItem-module_heightAnimation__aVO2o",fadein:"ListItem-module_fadein__GSr23",floatAnimation:"ListItem-module_floatAnimation__efvAy"},N=function(n){var t=n.title,i=n.subtitle,l=n.actionTitle,d=void 0===l?"":l,a=n.action,r=n.completed,u=n.indicator,m=n.hasSeparator,s=void 0!==m&&m,h=n.hasDashedSeparator,f=void 0!==h&&h,p=n.isActionPending,v=void 0!==p&&p;return o("div",{className:_(b,{listItem:!0,separator:s,dashedSeparator:f}),children:[o("div",{className:b.content,children:[u&&e("div",{className:_(b,{indicator:!0},[b[u]])}),o("div",{className:b.data,children:[e("div",{className:b.title,children:t}),i&&e("div",{className:b.subtitle,children:i})]})]}),a&&e(w,{onClick:a,className:b.action,label:d,isLoading:v}),r&&e("div",{className:b.completed,children:e(c,{icon:g})})]})},C={link:"Link-module_link__35Vo1",fullWidth:"Link-module_fullWidth__eg45D",zero:"Link-module_zero__e-EXa",xxs:"Link-module_xxs__DLzl2",xs:"Link-module_xs__K3V8L",s:"Link-module_s__Ojcbu",m:"Link-module_m__KQ9M4",lg:"Link-module_lg__R71ff",xl:"Link-module_xl__q05MB",xxl:"Link-module_xxl__VZVxK",xxxl:"Link-module_xxxl__91qsW",light:"Link-module_light__Ji8kV",active:"Link-module_active__iCkL0",lightDark:"Link-module_lightDark__1fDCG",lightDanger:"Link-module_lightDanger__lB9Tb",lightInfo:"Link-module_lightInfo__h5lfu",lightPrimary:"Link-module_lightPrimary__aZxve",lightSecondary:"Link-module_lightSecondary__QHh0c",lightWarning:"Link-module_lightWarning__iOuMw",lightSuccess:"Link-module_lightSuccess__zDBp0",primary:"Link-module_primary__CE3uj",secondary:"Link-module_secondary__KSolI",danger:"Link-module_danger__ugf9r",dark:"Link-module_dark__ap0Ls",info:"Link-module_info__9skpg",success:"Link-module_success__DwP-V",warning:"Link-module_warning__FhhXi",whiteText:"Link-module_whiteText__t7SOQ",default:"Link-module_default__3TBlr",borderedPrimary:"Link-module_borderedPrimary__RfPen",borderedSecondary:"Link-module_borderedSecondary__xTeGX",flexWide:"Link-module_flexWide__3A6ZB",slidein:"Link-module_slidein__kBzO4",fadeInOut:"Link-module_fadeInOut__zas8c",heightAnimation:"Link-module_heightAnimation__N7y-w",fadein:"Link-module_fadein__WxUdb",floatAnimation:"Link-module_floatAnimation__XrwU5"},S=function(n){var t=n.href,i=n.title,l=n.target,d=void 0===l?"_self":l,a=n.type,r=void 0===a?s.DEFAULT:a,u=n.padding,m=void 0===u?"zero":u,h=n.hasChevron,g=void 0!==h&&h,p=n.fullWidth;return o("a",{href:t,target:d,rel:"noopener noreferrer",className:_(C,{link:!0,fullWidth:void 0!==p&&p},[C[r],C[m]]),children:[e("span",{children:i})," ",g&&e(c,{icon:f})]})},O={input:"Input-module_input__505b7",full:"Input-module_full__h2smD",noMargin:"Input-module_noMargin__ysWuN",container:"Input-module_container__itXJp",colorPicker:"Input-module_colorPicker__Efa-c",required:"Input-module_required__kHc93",addon:"Input-module_addon__1cKdz",pointer:"Input-module_pointer__EsKoB",error:"Input-module_error__38tit",avatar:"Input-module_avatar__GJUWC",autoCompleteContent:"Input-module_autoCompleteContent__4anQc",reversed:"Input-module_reversed__dU1hV",transparent:"Input-module_transparent__ko36m",small:"Input-module_small__5vYiK",xsmall:"Input-module_xsmall__-9hXW",hasAddon:"Input-module_hasAddon__mruPW",flexWide:"Input-module_flexWide__4Wn1k",slidein:"Input-module_slidein__XYim1",fadeInOut:"Input-module_fadeInOut__bnAwc",heightAnimation:"Input-module_heightAnimation__tmt9Z",fadein:"Input-module_fadein__1HtqV",floatAnimation:"Input-module_floatAnimation__sYawG"};!function(e){e.TEXT="text",e.PASSWORD="password",e.EMAIL="email",e.NUMBER="number",e.URL="url",e.TEL="tel",e.DATE="date",e.DATETIME="datetime",e.SELECT="select",e.COLOR_PICKER="color-picker",e.TEXT_AREA="text-area",e.AVATAR_UPLOAD="avatar-upload",e.UPLOAD_IMAGE_ICON="upload-image-icon"}(D||(D={}));var W=i((function(n,i){var l=n.type,d=void 0===l?D.TEXT:l,a=n.label,r=n.placeholder,u=n.value,s=n.required,h=void 0!==s&&s,g=n.addonIcon,f=n.labelAddon,v=n.errorMessage,I=n.options,A=void 0===I?[]:I,x=n.fullWidth,k=n.avatarSize,w=n.source,y=n.autoCompleteContent,B=n.autoCompleteReverse,b=void 0!==B&&B,N=n.noMargin,C=void 0!==N&&N,S=n.isDisabled,W=void 0!==S&&S,E=n.isLoading,T=void 0!==E&&E,P=n.isMultiUpload,R=void 0!==P&&P,M=n.autoFocus,z=void 0!==M&&M,G=n.theme,Y=void 0===G?"oval":G,U=n.size,j=void 0===U?"medium":U,F=n.onBlur,H=n.onFocus,V=n.onChange,K=n.addonAction,X=n.onEnter,Z=n.onEsc,q=n.onFileSelect,Q=n.onFilesSelect,J=function(e,o){var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&o.indexOf(t)<0&&(n[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(t=Object.getOwnPropertySymbols(e);i<t.length;i++)o.indexOf(t[i])<0&&Object.prototype.propertyIsEnumerable.call(e,t[i])&&(n[t[i]]=e[t[i]])}return n}(n,["type","label","placeholder","value","required","addonIcon","labelAddon","errorMessage","options","fullWidth","avatarSize","source","autoCompleteContent","autoCompleteReverse","noMargin","isDisabled","isLoading","isMultiUpload","autoFocus","theme","size","onBlur","onFocus","onChange","addonAction","onEnter","onEsc","onFileSelect","onFilesSelect"]),$=W||T,ee=function(e){switch(e.key){case"Enter":X&&X();break;case"Escape":Z&&Z()}},oe=function(e){var o=e.target.files[0],n=new FileReader;n.onload=function(){q&&q(o,n.result)},n.readAsDataURL(o)},ne=function(e){var o=e.target;Q&&Q(o.files)};return o("div",{className:_(O,{input:!0,full:!!x,noMargin:C,hasAddon:!!g},[O[Y],O[j]]),children:[a&&o("label",{children:[e("span",{className:h?O.required:"",children:a}),!!f&&e("div",{className:O.labelAddon,children:f})]}),e("div",{className:O.container,children:function(){switch(d){case D.SELECT:return o("select",m({className:O.field,value:u,onBlur:F,onFocus:H,onChange:V,ref:i},J,{children:[e("option",{value:"",children:r}),A.map((function(o){var n=o.label,t=o.value;return e("option",{value:t,children:n},t)}))]}));case D.COLOR_PICKER:return e("input",m({className:"".concat(O.field," ").concat(O.colorPicker),type:"color",value:u,placeholder:r,onBlur:F,onFocus:H,onChange:V,disabled:$,ref:i},J));case D.TEXT_AREA:return e("textarea",m({className:O.field,value:u,placeholder:r,onBlur:F,onFocus:H,onChange:V,autoFocus:z,ref:i},J));case D.AVATAR_UPLOAD:return o("label",{htmlFor:"avatar-upload",children:[e(L,{size:k,source:w,isLoading:T,isEditable:!0}),e("input",{type:"file",name:"avatar-upload",id:"avatar-upload",accept:"image/*",onChange:R?ne:oe,ref:i,className:O.avatar,disabled:$,multiple:R})]});case D.UPLOAD_IMAGE_ICON:return o("label",{htmlFor:"upload-image-icon",children:[e(c,{icon:p,isLoading:T,size:"md"}),e("input",{type:"file",name:"upload-image-icon",id:"upload-image-icon",accept:"image/*",onChange:R?ne:oe,ref:i,className:O.avatar,disabled:$,multiple:R})]});default:return o(t,{children:[e("input",m({className:O.field,type:d,placeholder:r,value:u,onBlur:F,onFocus:H,onChange:V,onKeyUp:ee,ref:i,disabled:$,autoFocus:z},J)),g&&e("div",{className:K?"".concat(O.addon," ").concat(O.pointer):O.addon,onClick:K,children:e(c,{icon:g,isLoading:T})})]})}}()}),!!v&&e("div",{className:O.error,children:v}),!!y&&e("div",{className:_(O,{autoCompleteContent:!0,reversed:b}),children:y})]})})),E={menu:"DropDown-module_menu__gRW7p",container:"DropDown-module_container__ms9Bn",action:"DropDown-module_action__D8KuY",light:"DropDown-module_light__6NSjI",active:"DropDown-module_active__rGcA2",lightDark:"DropDown-module_lightDark__Ctspk",lightDanger:"DropDown-module_lightDanger__FaZ6G",lightInfo:"DropDown-module_lightInfo__DMaJO",lightPrimary:"DropDown-module_lightPrimary__sobOp",lightSecondary:"DropDown-module_lightSecondary__PB0m-",lightWarning:"DropDown-module_lightWarning__mkeGN",lightSuccess:"DropDown-module_lightSuccess__QNoVS",primary:"DropDown-module_primary__9-x6Y",secondary:"DropDown-module_secondary__HBses",danger:"DropDown-module_danger__ZbPY6",dark:"DropDown-module_dark__3YhdZ",info:"DropDown-module_info__5qwW6",success:"DropDown-module_success__NbhHj",warning:"DropDown-module_warning__MrYwV",whiteText:"DropDown-module_whiteText__eVLut",default:"DropDown-module_default__D0DNi",borderedPrimary:"DropDown-module_borderedPrimary__oTb-J",borderedSecondary:"DropDown-module_borderedSecondary__GqWsA",xsmall:"DropDown-module_xsmall__Mc6Zx",small:"DropDown-module_small__Goyza",large:"DropDown-module_large__P5F--",flexWide:"DropDown-module_flexWide__ySVZv",slidein:"DropDown-module_slidein__ZYDXA",fadeInOut:"DropDown-module_fadeInOut__hjIWL",heightAnimation:"DropDown-module_heightAnimation__EUum9",fadein:"DropDown-module_fadein__D2VO0",floatAnimation:"DropDown-module_floatAnimation__z5DD5"},T=function(e,o){var n=function(n){e.current&&!e.current.contains(n.target)&&o()};l((function(){return document.addEventListener("click",n),function(){document.removeEventListener("click",n)}}),[])},P=function(o){var t=o.containerRef,i=o.contentRef,d=o.isOpen,r=void 0!==d&&d,_=o.renderChild,u=o.onClose,c={isOpen:!1,top:0,left:0,bottom:0,right:0},s=n(c),h=s[0],g=s[1],f={position:"absolute",top:h.top,left:h.left,bottom:h.bottom,right:h.right,zIndex:111},p=function(){g(c),u()};return T(t,(function(){return p()})),l((function(){if(r)return function(){var e,o,n,l,d,a,r,_=null!==(n=null===(o=null===(e=null==t?void 0:t.current)||void 0===e?void 0:e.getBoundingClientRect)||void 0===o?void 0:o.call(e))&&void 0!==n?n:{top:0,left:0,height:0,width:0},u=_.top,c=_.left,s=_.height,h=_.width,f=window.innerHeight,p=window.innerWidth,v=f-(u+s),I=u,A=c,x=p-(c+h),L=null!==(d=null===(l=null==i?void 0:i.current)||void 0===l?void 0:l.clientHeight)&&void 0!==d?d:200,k=null!==(r=null===(a=null==i?void 0:i.current)||void 0===a?void 0:a.clientWidth)&&void 0!==r?r:200,D="auto",w="auto",y="auto",B="auto";v<L&&I>=L?B=f-u-s+20:w=u+s+5,x<k&&A>=k?y=p-c:D=c,g(m(m({},{top:w,left:D,right:y,bottom:B}),{isOpen:!0}))}();p()}),[r,null==t?void 0:t.current]),h.isOpen?a.createPortal(e("div",{style:f,onClick:function(e){e.stopPropagation()},children:_(h)}),document.getElementById("portals")):null},R=function(o){var n=o.children;return e("div",{className:E.menu,children:n})},M=function(t){var i=t.action,a=t.menu,r=t.type,u=void 0===r?s.DEFAULT:r,c=t.closeRef,m=t.actionSize,h=void 0===m?"medium":m,g=d(null),f=d(null),p=d(null),v=n(!1),I=v[0],A=v[1],x=function(){return A(!1)};return l((function(){(null==c?void 0:c.current)&&(c.current={close:function(){return x()}})}),[c]),o("div",{className:E.container,ref:g,children:[e("div",{className:_(E,{action:!0},[E[u],E[h]]),ref:p,onClick:function(){return A(!I)},children:i}),e(P,{containerRef:g,contentRef:f,isOpen:I,onClose:x,renderChild:function(){return e("div",{className:E.menuContainer,ref:f,children:e(R,{children:a})})}})]})},z={container:"LoadingItem-module_container__ujRaI",fadeInOut:"LoadingItem-module_fadeInOut__HDJT8",square:"LoadingItem-module_square__OucYB",xxs:"LoadingItem-module_xxs__kTYcZ",xs:"LoadingItem-module_xs__sISZM",sm:"LoadingItem-module_sm__hsDHD",md:"LoadingItem-module_md__bU5yA",lg:"LoadingItem-module_lg__9sK4b",xl:"LoadingItem-module_xl__O0kH8",xxl:"LoadingItem-module_xxl__tIjdb",xxxl:"LoadingItem-module_xxxl__h73z5",xxxxl:"LoadingItem-module_xxxxl__XTzwy",flexWide:"LoadingItem-module_flexWide__sIJC3",slidein:"LoadingItem-module_slidein__8J982",heightAnimation:"LoadingItem-module_heightAnimation__cUh26",fadein:"LoadingItem-module_fadein__-CmLg",floatAnimation:"LoadingItem-module_floatAnimation__gQ2jh"},G=function(o){var n=o.shape,t=void 0===n?"square":n,i=o.size,l=void 0===i?"md":i,d=o.width,a=o.height;return e("div",{className:_(z,{container:!0},[z[t],z[l]]),style:{width:d,height:a}})},Y={container:"Accordion-module_container__6rGl0",header:"Accordion-module_header__AYOT5",body:"Accordion-module_body__4IgEa",content:"Accordion-module_content__RyBzl",isOpen:"Accordion-module_isOpen__Bmf-c",flexWide:"Accordion-module_flexWide__Pmyu-",slidein:"Accordion-module_slidein__NIsrY",fadeInOut:"Accordion-module_fadeInOut__Ub-rg",heightAnimation:"Accordion-module_heightAnimation__nT1oQ",fadein:"Accordion-module_fadein__KprHu",floatAnimation:"Accordion-module_floatAnimation__d-fsP"},U=function(t){var i=t.title,l=t.content,d=n(!1),a=d[0],r=d[1];return o("div",{className:_(Y,{container:!0,isOpen:a}),onClick:function(){return r(!a)},children:[o("div",{className:Y.header,children:[e("h3",{children:i}),e(c,{icon:a?v:I,size:"md"})]}),e("div",{className:Y.body,children:e("div",{className:Y.content,children:l})})]})},j=function(e){return null==e||("object"==typeof e?Array.isArray(e)?0===e.length:e instanceof Set||e instanceof Map?0===e.size:0===Object.keys(e).length:"string"==typeof e&&0===e.length)};export{U as Accordion,L as Avatar,w as Button,M as DropDown,B as IconButton,W as Input,D as InputType,S as Link,N as ListItem,G as LoadingItem,c as SVGIcon,s as UIElementType,_ as classNames,j as isEmpty,T as useClickOutside}; | ||
import{jsx as e,jsxs as o}from"react/jsx-runtime";import{useState as n,Fragment as t,forwardRef as i,useEffect as l,useRef as d,useCallback as a}from"react";import r from"react-dom";var _={avatar:"Avatar-module_avatar__5-kP8",image:"Avatar-module_image__HFFlp",clickable:"Avatar-module_clickable__DD7pl",editable:"Avatar-module_editable__CpXtw",editIcon:"Avatar-module_editIcon__ULUa1",overlay:"Avatar-module_overlay__d95aK",overlayText:"Avatar-module_overlayText__NgsFM",loading:"Avatar-module_loading__9gBDd",xxs:"Avatar-module_xxs__zCCH6",xs:"Avatar-module_xs__1SMBv",sm:"Avatar-module_sm__8TB22",md:"Avatar-module_md__zeW0d",lg:"Avatar-module_lg__MWKN-",xl:"Avatar-module_xl__KCqIL",xxl:"Avatar-module_xxl__ox6gi",xxxl:"Avatar-module_xxxl__9Cc7C",inline:"Avatar-module_inline__H0AhD",flexWide:"Avatar-module_flexWide__GQYaQ",slidein:"Avatar-module_slidein__KV8Ih",fadeInOut:"Avatar-module_fadeInOut__2M9tv",heightAnimation:"Avatar-module_heightAnimation__RCYYu",fadein:"Avatar-module_fadein__lENH2",floatAnimation:"Avatar-module_floatAnimation__PNWhi"},u=function(e,o,n){void 0===n&&(n=[]);var t=[];for(var i in o)o[i]&&t.push(e[i]);return(null==n?void 0:n.length)>0&&(t=t.concat(n)),t.join(" ")},c={container:"SVGIcon-module_container__z2RN5",isLoading:"SVGIcon-module_isLoading__8BhuU",fadeInOut:"SVGIcon-module_fadeInOut__EgbCf",flexWide:"SVGIcon-module_flexWide__IfOOF",slidein:"SVGIcon-module_slidein__RT6-4",heightAnimation:"SVGIcon-module_heightAnimation__CmY-x",fadein:"SVGIcon-module_fadein__Y2P5U",floatAnimation:"SVGIcon-module_floatAnimation__kH3Tr"},m=function(o){var n=o.icon,t=o.size,i=void 0===t?"sm":t,l=o.className,d=void 0===l?"":l,a=o.isLoading,r=void 0!==a&&a,_=function(e){switch(e){case"xxs":return 8;case"xs":return 12;case"sm":default:return 16;case"md":return 24;case"lg":return 32;case"xl":return 48;case"xxl":return 64;case"xxxl":return 128}}(i);return n?e("div",{className:u(c,{container:!0,isLoading:r},[d]),children:e(n,{className:d,width:_,height:_,viewBox:"0 0 24 24",preserveAspectRatio:"xMidYMid meet"})}):null},s=function(){return s=Object.assign||function(e){for(var o,n=1,t=arguments.length;n<t;n++)for(var i in o=arguments[n])Object.prototype.hasOwnProperty.call(o,i)&&(e[i]=o[i]);return e},s.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var h,g=function(n){return o("svg",s({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},n,{children:[e("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M2 8.377c0-.35 0-.525.015-.673a3 3 0 0 1 2.69-2.69C4.851 5 5.035 5 5.404 5c.143 0 .214 0 .274-.004a2 2 0 0 0 1.735-1.25c.023-.056.044-.12.086-.246.042-.127.063-.19.086-.246a2 2 0 0 1 1.735-1.25C9.38 2 9.448 2 9.58 2h4.838c.133 0 .2 0 .26.004a2 2 0 0 1 1.735 1.25c.023.056.044.12.086.246.042.127.063.19.086.246a2 2 0 0 0 1.735 1.25c.06.004.131.004.273.004.37 0 .554 0 .702.015a3 3 0 0 1 2.69 2.69c.014.147.014.322.014.672V16.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2z"}),e("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 16.5a4 4 0 1 0 0-8 4 4 0 0 0 0 8"})]}))},f=function(o){return e("svg",s({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},o,{children:e("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 6 9 17l-5-5"})}))},p=function(o){return e("svg",s({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},o,{children:e("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"m9 18 6-6-6-6"})}))},v=function(o){return e("svg",s({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},o,{children:e("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"m4.272 20.728 6.597-6.597c.396-.396.594-.594.822-.668a1 1 0 0 1 .618 0c.228.074.426.272.822.668l6.553 6.553M14 15l2.869-2.869c.396-.396.594-.594.822-.668a1 1 0 0 1 .618 0c.228.074.426.272.822.668L22 15M10 9a2 2 0 1 1-4 0 2 2 0 0 1 4 0M6.8 21h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 18.72 22 17.88 22 16.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 3 18.88 3 17.2 3H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 5.28 2 6.12 2 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 21 5.12 21 6.8 21"})}))},I=function(o){return e("svg",s({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},o,{children:e("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 12h14"})}))},A=function(o){return e("svg",s({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},o,{children:e("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 5v14m-7-7h14"})}))},x=function(o){return e("svg",s({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},o,{children:e("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"m8 16 4-4m0 0 4 4m-4-4v9m8-4.257A5.5 5.5 0 0 0 16.5 7a.62.62 0 0 1-.534-.302 7.5 7.5 0 1 0-11.78 9.096"})}))},L=function(o){return e("svg",s({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},o,{children:e("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5.316 19.438A4 4 0 0 1 9 17h6a4 4 0 0 1 3.684 2.438M16 9.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0m6 2.5c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10"})}))},k=function(n){var t=n.source,i=void 0===t?null:t,l=n.alt,d=void 0===l?"avatar":l,a=n.size,r=void 0===a?"sm":a,c=n.onClick,s=n.className,h=n.isEditable,f=void 0!==h&&h,p=n.overlayIcon,v=n.inline,I=void 0!==v&&v,A=n.isLoading,k=void 0!==A&&A,D=n.overlayText,w=function(){switch(r){case"xxxl":return 512;case"xxl":return 256;case"xl":return 128;case"lg":return 96;case"md":return 64;case"xs":return 32;case"xxs":return 24;default:return 48}};return o("div",{className:u(_,{avatar:!0,clickable:!!c||f,editable:f,inline:I,loading:k},[_[r],s]),onClick:c,style:{width:w(),height:w()},children:[i?e("img",{src:i,alt:d,className:_.image,width:w(),height:w()}):e(m,{size:r,icon:L}),f&&e("div",{className:_.editIcon,children:e(m,{isLoading:k,icon:k?x:g})}),(!!p||D)&&o("div",{className:_.overlay,children:[!!p&&e(m,{isLoading:k,icon:k?x:p}),!!D&&e("div",{className:_.overlayText,children:D})]})]})},D={container:"Button-module_container__0j8md",confirm:"Button-module_confirm__N5z4A",confirmActions:"Button-module_confirmActions__Xh7kN",button:"Button-module_button__18Bed",label:"Button-module_label__1PsXG",light:"Button-module_light__oUjYe",lightDark:"Button-module_lightDark__vucG6",active:"Button-module_active__UeHD7",lightDanger:"Button-module_lightDanger__aDpy8",lightInfo:"Button-module_lightInfo__oCfFI",lightPrimary:"Button-module_lightPrimary__f7-kQ",lightSecondary:"Button-module_lightSecondary__YK-QR",lightWarning:"Button-module_lightWarning__-Ogcg",lightSuccess:"Button-module_lightSuccess__gSt46",primary:"Button-module_primary__st6yY",secondary:"Button-module_secondary__j-3rj",danger:"Button-module_danger__Hxs5n",dark:"Button-module_dark__T7dl8",info:"Button-module_info__2z1ZG",success:"Button-module_success__CHTsg",warning:"Button-module_warning__1voOb",whiteText:"Button-module_whiteText__12xTM",default:"Button-module_default__TZZU2",borderedPrimary:"Button-module_borderedPrimary__KrZVT",borderedSecondary:"Button-module_borderedSecondary__UPNks",small:"Button-module_small__zfmcP",xsmall:"Button-module_xsmall__QS3d-",fullWidth:"Button-module_fullWidth__AHpSl",flexWide:"Button-module_flexWide__xDrEF",slidein:"Button-module_slidein__ofhlO",fadeInOut:"Button-module_fadeInOut__nAOqm",heightAnimation:"Button-module_heightAnimation__fLFCd",fadein:"Button-module_fadein__pspkB",floatAnimation:"Button-module_floatAnimation__0PYtT"};!function(e){e.PRIMARY="primary",e.SECONDARY="secondary",e.DANGER="danger",e.SUCCESS="success",e.WARNING="warning",e.INFO="info",e.LIGHT="light",e.DEFAULT="default",e.DARK="dark",e.LIGHT_PRIMARY="lightPrimary",e.LIGHT_SUCCESS="lightSuccess",e.LIGHT_WARNING="lightWarning",e.LIGHT_INFO="lightInfo",e.LIGHT_DANGER="lightDanger",e.LIGHT_DARK="lightDark",e.LIGHT_SECONDARY="lightSecondary",e.WHITE_TEXT="whiteText",e.BORDERED_PRIMARY="borderedPrimary",e.BORDERED_SECONDARY="borderedSecondary"}(h||(h={}));var w,y=function(i){var l=i.type,d=void 0===l?h.PRIMARY:l,a=i.onClick,r=i.label,_=i.icon,c=i.fullWidth,s=void 0!==c&&c,g=i.isLoading,f=i.disabled,p=i.className,v=i.needConfirm,I=void 0!==v&&v,A=i.size,x=void 0===A?"standard":A,L=n(!1),k=L[0],w=L[1];return o("div",{className:u(D,{container:!0,fullWidth:s}),children:[e("button",{className:u(D,{button:!0,loading:!!g},[D[d],D[x],p]),onClick:I?function(){return w(!k)}:a,disabled:g||f,children:g?e(t,{children:"Loading..."}):o("div",{className:D.label,children:[_&&e(m,{icon:_}),e("span",{children:r})]})}),k&&o("div",{className:D.confirm,children:[e("div",{className:D.confirmMessage,children:"Are you sure?"}),o("div",{className:D.confirmActions,children:[e(y,{type:h.DANGER,onClick:function(){return w(!1)},label:"No"}),e(y,{type:h.SUCCESS,onClick:function(){w(!1),a()},label:"Yes"})]})]})]})},B={iconButton:"IconButton-module_iconButton__PmpB8",noPadding:"IconButton-module_noPadding__Jd2rK",lg:"IconButton-module_lg__KG7lp",md:"IconButton-module_md__s4q7b",sm:"IconButton-module_sm__are9s",xs:"IconButton-module_xs__qYwZc",confirm:"IconButton-module_confirm__-jXH4",confirmActions:"IconButton-module_confirmActions__j7-Tt",bottom:"IconButton-module_bottom__AEpND",disabled:"IconButton-module_disabled__pLK-t",white:"IconButton-module_white__AzyNN",light:"IconButton-module_light__i3AET",active:"IconButton-module_active__popsF",lightDark:"IconButton-module_lightDark__d7NQy",lightDanger:"IconButton-module_lightDanger__bIg02",lightInfo:"IconButton-module_lightInfo__820It",lightPrimary:"IconButton-module_lightPrimary__SCrg-",lightSecondary:"IconButton-module_lightSecondary__vN-aS",lightWarning:"IconButton-module_lightWarning__z1iaR",lightSuccess:"IconButton-module_lightSuccess__mUSnD",primary:"IconButton-module_primary__qjfR5",secondary:"IconButton-module_secondary__-CufX",danger:"IconButton-module_danger__lz3tP",dark:"IconButton-module_dark__QiBJk",info:"IconButton-module_info__eawU-",success:"IconButton-module_success__xkDzZ",warning:"IconButton-module_warning__DhbfD",whiteText:"IconButton-module_whiteText__111Ju",default:"IconButton-module_default__j2U57",borderedPrimary:"IconButton-module_borderedPrimary__DHXJQ",borderedSecondary:"IconButton-module_borderedSecondary__13GNA",flexWide:"IconButton-module_flexWide__BGOfY",slidein:"IconButton-module_slidein__Rmpl5",fadeInOut:"IconButton-module_fadeInOut__Z2E5a",heightAnimation:"IconButton-module_heightAnimation__JnqnZ",fadein:"IconButton-module_fadein__uX9ut",floatAnimation:"IconButton-module_floatAnimation__N-INw"},b=function(t){var i=t.icon,l=t.onClick,d=t.type,a=void 0===d?h.DEFAULT:d,r=t.needConfirm,_=void 0!==r&&r,c=t.noPadding,s=void 0!==c&&c,g=t.isLoading,f=void 0!==g&&g,p=t.size,v=void 0===p?"sm":p,I=t.confirmPosition,A=void 0===I?"top":I,x=n(!1),L=x[0],k=x[1];return o("div",{className:u(B,{iconButton:!0,noPadding:s},[B[a],B[v]]),onClick:f?void 0:_?function(){return k(!L)}:l,children:[e(m,{isLoading:f,icon:i,size:v}),L&&o("div",{className:"".concat(B.confirm," ").concat(B[A]),children:[e("div",{className:B.confirmMessage,children:"Are you sure?"}),o("div",{className:B.confirmActions,children:[e(y,{type:h.DANGER,onClick:function(){return k(!1)},label:"No",size:"small"}),e(y,{type:h.SUCCESS,onClick:l,label:"Yes",size:"small"})]})]})]})},N={listItem:"ListItem-module_listItem__ljWE5",separator:"ListItem-module_separator__CIXS1",dashedSeparator:"ListItem-module_dashedSeparator__SYWNX",content:"ListItem-module_content__mPC1D",data:"ListItem-module_data__e0N6V",title:"ListItem-module_title__YkOz9",subtitle:"ListItem-module_subtitle__5flJp",indicator:"ListItem-module_indicator__BwMsO",success:"ListItem-module_success__lgO8z",info:"ListItem-module_info__MKMBu",warning:"ListItem-module_warning__8P-nA",danger:"ListItem-module_danger__sWYOu",primary:"ListItem-module_primary__-bA-W",completed:"ListItem-module_completed__ovBl4",flexWide:"ListItem-module_flexWide__-0Q5a",slidein:"ListItem-module_slidein__dGxX-",fadeInOut:"ListItem-module_fadeInOut__Yuwsd",heightAnimation:"ListItem-module_heightAnimation__aVO2o",fadein:"ListItem-module_fadein__GSr23",floatAnimation:"ListItem-module_floatAnimation__efvAy"},C=function(n){var t=n.title,i=n.subtitle,l=n.actionTitle,d=void 0===l?"":l,a=n.action,r=n.completed,_=n.indicator,c=n.hasSeparator,s=void 0!==c&&c,h=n.hasDashedSeparator,g=void 0!==h&&h,p=n.isActionPending,v=void 0!==p&&p;return o("div",{className:u(N,{listItem:!0,separator:s,dashedSeparator:g}),children:[o("div",{className:N.content,children:[_&&e("div",{className:u(N,{indicator:!0},[N[_]])}),o("div",{className:N.data,children:[e("div",{className:N.title,children:t}),i&&e("div",{className:N.subtitle,children:i})]})]}),a&&e(y,{onClick:a,className:N.action,label:d,isLoading:v}),r&&e("div",{className:N.completed,children:e(m,{icon:f})})]})},S={link:"Link-module_link__35Vo1",fullWidth:"Link-module_fullWidth__eg45D",zero:"Link-module_zero__e-EXa",xxs:"Link-module_xxs__DLzl2",xs:"Link-module_xs__K3V8L",s:"Link-module_s__Ojcbu",m:"Link-module_m__KQ9M4",lg:"Link-module_lg__R71ff",xl:"Link-module_xl__q05MB",xxl:"Link-module_xxl__VZVxK",xxxl:"Link-module_xxxl__91qsW",light:"Link-module_light__Ji8kV",active:"Link-module_active__iCkL0",lightDark:"Link-module_lightDark__1fDCG",lightDanger:"Link-module_lightDanger__lB9Tb",lightInfo:"Link-module_lightInfo__h5lfu",lightPrimary:"Link-module_lightPrimary__aZxve",lightSecondary:"Link-module_lightSecondary__QHh0c",lightWarning:"Link-module_lightWarning__iOuMw",lightSuccess:"Link-module_lightSuccess__zDBp0",primary:"Link-module_primary__CE3uj",secondary:"Link-module_secondary__KSolI",danger:"Link-module_danger__ugf9r",dark:"Link-module_dark__ap0Ls",info:"Link-module_info__9skpg",success:"Link-module_success__DwP-V",warning:"Link-module_warning__FhhXi",whiteText:"Link-module_whiteText__t7SOQ",default:"Link-module_default__3TBlr",borderedPrimary:"Link-module_borderedPrimary__RfPen",borderedSecondary:"Link-module_borderedSecondary__xTeGX",flexWide:"Link-module_flexWide__3A6ZB",slidein:"Link-module_slidein__kBzO4",fadeInOut:"Link-module_fadeInOut__zas8c",heightAnimation:"Link-module_heightAnimation__N7y-w",fadein:"Link-module_fadein__WxUdb",floatAnimation:"Link-module_floatAnimation__XrwU5"},O=function(n){var t=n.href,i=n.title,l=n.target,d=void 0===l?"_self":l,a=n.type,r=void 0===a?h.DEFAULT:a,_=n.padding,c=void 0===_?"zero":_,s=n.hasChevron,g=void 0!==s&&s,f=n.fullWidth;return o("a",{href:t,target:d,rel:"noopener noreferrer",className:u(S,{link:!0,fullWidth:void 0!==f&&f},[S[r],S[c]]),children:[e("span",{children:i})," ",g&&e(m,{icon:p})]})},T={input:"Input-module_input__505b7",full:"Input-module_full__h2smD",noMargin:"Input-module_noMargin__ysWuN",container:"Input-module_container__itXJp",colorPicker:"Input-module_colorPicker__Efa-c",required:"Input-module_required__kHc93",addon:"Input-module_addon__1cKdz",pointer:"Input-module_pointer__EsKoB",error:"Input-module_error__38tit",avatar:"Input-module_avatar__GJUWC",autoCompleteContent:"Input-module_autoCompleteContent__4anQc",reversed:"Input-module_reversed__dU1hV",transparent:"Input-module_transparent__ko36m",small:"Input-module_small__5vYiK",xsmall:"Input-module_xsmall__-9hXW",hasAddon:"Input-module_hasAddon__mruPW",flexWide:"Input-module_flexWide__4Wn1k",slidein:"Input-module_slidein__XYim1",fadeInOut:"Input-module_fadeInOut__bnAwc",heightAnimation:"Input-module_heightAnimation__tmt9Z",fadein:"Input-module_fadein__1HtqV",floatAnimation:"Input-module_floatAnimation__sYawG"};!function(e){e.TEXT="text",e.PASSWORD="password",e.EMAIL="email",e.NUMBER="number",e.URL="url",e.TEL="tel",e.DATE="date",e.DATETIME="datetime",e.SELECT="select",e.COLOR_PICKER="color-picker",e.TEXT_AREA="text-area",e.AVATAR_UPLOAD="avatar-upload",e.UPLOAD_IMAGE_ICON="upload-image-icon"}(w||(w={}));var W=i((function(n,i){var l=n.type,d=void 0===l?w.TEXT:l,a=n.label,r=n.placeholder,_=n.value,c=n.required,h=void 0!==c&&c,g=n.addonIcon,f=n.labelAddon,p=n.errorMessage,I=n.options,A=void 0===I?[]:I,x=n.fullWidth,L=n.avatarSize,D=n.source,y=n.autoCompleteContent,B=n.autoCompleteReverse,b=void 0!==B&&B,N=n.noMargin,C=void 0!==N&&N,S=n.isDisabled,O=void 0!==S&&S,W=n.isLoading,E=void 0!==W&&W,P=n.isMultiUpload,R=void 0!==P&&P,M=n.autoFocus,z=void 0!==M&&M,G=n.theme,Y=void 0===G?"oval":G,j=n.size,U=void 0===j?"medium":j,F=n.onBlur,H=n.onFocus,V=n.onChange,X=n.addonAction,K=n.onEnter,Z=n.onEsc,q=n.onFileSelect,Q=n.onFilesSelect,J=function(e,o){var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&o.indexOf(t)<0&&(n[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(t=Object.getOwnPropertySymbols(e);i<t.length;i++)o.indexOf(t[i])<0&&Object.prototype.propertyIsEnumerable.call(e,t[i])&&(n[t[i]]=e[t[i]])}return n}(n,["type","label","placeholder","value","required","addonIcon","labelAddon","errorMessage","options","fullWidth","avatarSize","source","autoCompleteContent","autoCompleteReverse","noMargin","isDisabled","isLoading","isMultiUpload","autoFocus","theme","size","onBlur","onFocus","onChange","addonAction","onEnter","onEsc","onFileSelect","onFilesSelect"]),$=O||E,ee=function(e){switch(e.key){case"Enter":K&&K();break;case"Escape":Z&&Z()}},oe=function(e){var o=e.target.files[0],n=new FileReader;n.onload=function(){q&&q(o,n.result)},n.readAsDataURL(o)},ne=function(e){var o=e.target;Q&&Q(o.files)};return o("div",{className:u(T,{input:!0,full:!!x,noMargin:C,hasAddon:!!g},[T[Y],T[U]]),children:[a&&o("label",{children:[e("span",{className:h?T.required:"",children:a}),!!f&&e("div",{className:T.labelAddon,children:f})]}),e("div",{className:T.container,children:function(){switch(d){case w.SELECT:return o("select",s({className:T.field,value:_,onBlur:F,onFocus:H,onChange:V,ref:i},J,{children:[e("option",{value:"",children:r}),A.map((function(o){var n=o.label,t=o.value;return e("option",{value:t,children:n},t)}))]}));case w.COLOR_PICKER:return e("input",s({className:"".concat(T.field," ").concat(T.colorPicker),type:"color",value:_,placeholder:r,onBlur:F,onFocus:H,onChange:V,disabled:$,ref:i},J));case w.TEXT_AREA:return e("textarea",s({className:T.field,value:_,placeholder:r,onBlur:F,onFocus:H,onChange:V,autoFocus:z,ref:i},J));case w.AVATAR_UPLOAD:return o("label",{htmlFor:"avatar-upload",children:[e(k,{size:L,source:D,isLoading:E,isEditable:!0}),e("input",{type:"file",name:"avatar-upload",id:"avatar-upload",accept:"image/*",onChange:R?ne:oe,ref:i,className:T.avatar,disabled:$,multiple:R})]});case w.UPLOAD_IMAGE_ICON:return o("label",{htmlFor:"upload-image-icon",children:[e(m,{icon:v,isLoading:E,size:"md"}),e("input",{type:"file",name:"upload-image-icon",id:"upload-image-icon",accept:"image/*",onChange:R?ne:oe,ref:i,className:T.avatar,disabled:$,multiple:R})]});default:return o(t,{children:[e("input",s({className:T.field,type:d,placeholder:r,value:_,onBlur:F,onFocus:H,onChange:V,onKeyUp:ee,ref:i,disabled:$,autoFocus:z},J)),g&&e("div",{className:X?"".concat(T.addon," ").concat(T.pointer):T.addon,onClick:X,children:e(m,{icon:g,isLoading:E})})]})}}()}),!!p&&e("div",{className:T.error,children:p}),!!y&&e("div",{className:u(T,{autoCompleteContent:!0,reversed:b}),children:y})]})})),E={menu:"DropDown-module_menu__gRW7p",container:"DropDown-module_container__ms9Bn",action:"DropDown-module_action__D8KuY",light:"DropDown-module_light__6NSjI",active:"DropDown-module_active__rGcA2",lightDark:"DropDown-module_lightDark__Ctspk",lightDanger:"DropDown-module_lightDanger__FaZ6G",lightInfo:"DropDown-module_lightInfo__DMaJO",lightPrimary:"DropDown-module_lightPrimary__sobOp",lightSecondary:"DropDown-module_lightSecondary__PB0m-",lightWarning:"DropDown-module_lightWarning__mkeGN",lightSuccess:"DropDown-module_lightSuccess__QNoVS",primary:"DropDown-module_primary__9-x6Y",secondary:"DropDown-module_secondary__HBses",danger:"DropDown-module_danger__ZbPY6",dark:"DropDown-module_dark__3YhdZ",info:"DropDown-module_info__5qwW6",success:"DropDown-module_success__NbhHj",warning:"DropDown-module_warning__MrYwV",whiteText:"DropDown-module_whiteText__eVLut",default:"DropDown-module_default__D0DNi",borderedPrimary:"DropDown-module_borderedPrimary__oTb-J",borderedSecondary:"DropDown-module_borderedSecondary__GqWsA",xsmall:"DropDown-module_xsmall__Mc6Zx",small:"DropDown-module_small__Goyza",large:"DropDown-module_large__P5F--",flexWide:"DropDown-module_flexWide__ySVZv",slidein:"DropDown-module_slidein__ZYDXA",fadeInOut:"DropDown-module_fadeInOut__hjIWL",heightAnimation:"DropDown-module_heightAnimation__EUum9",fadein:"DropDown-module_fadein__D2VO0",floatAnimation:"DropDown-module_floatAnimation__z5DD5"},P=function(e,o){var n=function(n){e.current&&!e.current.contains(n.target)&&o()};l((function(){return document.addEventListener("click",n),function(){document.removeEventListener("click",n)}}),[])},R=function(e){var o=d(null),n=a((function(n){o.current&&!o.current.contains(n.target)&&e()}),[e]);return l((function(){return document.addEventListener("click",n),function(){document.removeEventListener("click",n)}}),[n]),o},M=function(o){var t=o.containerRef,i=o.contentRef,d=o.isOpen,a=void 0!==d&&d,_=o.renderChild,u=o.onClose,c={isOpen:!1,top:0,left:0,bottom:0,right:0},m=n(c),h=m[0],g=m[1],f={position:"absolute",top:h.top,left:h.left,bottom:h.bottom,right:h.right,zIndex:111},p=function(){g(c),u()};return P(t,(function(){return p()})),l((function(){if(a)return function(){var e,o,n,l,d,a,r,_=null!==(n=null===(o=null===(e=null==t?void 0:t.current)||void 0===e?void 0:e.getBoundingClientRect)||void 0===o?void 0:o.call(e))&&void 0!==n?n:{top:0,left:0,height:0,width:0},u=_.top,c=_.left,m=_.height,h=_.width,f=window.innerHeight,p=window.innerWidth,v=f-(u+m),I=u,A=c,x=p-(c+h),L=null!==(d=null===(l=null==i?void 0:i.current)||void 0===l?void 0:l.clientHeight)&&void 0!==d?d:200,k=null!==(r=null===(a=null==i?void 0:i.current)||void 0===a?void 0:a.clientWidth)&&void 0!==r?r:200,D="auto",w="auto",y="auto",B="auto";v<L&&I>=L?B=f-u-m+20:w=u+m+5,x<k&&A>=k?y=p-c:D=c,g(s(s({},{top:w,left:D,right:y,bottom:B}),{isOpen:!0}))}();p()}),[a,null==t?void 0:t.current]),h.isOpen?r.createPortal(e("div",{style:f,onClick:function(e){e.stopPropagation()},children:_(h)}),document.getElementById("portals")):null},z=function(o){var n=o.children;return e("div",{className:E.menu,children:n})},G=function(t){var i=t.action,a=t.menu,r=t.type,_=void 0===r?h.DEFAULT:r,c=t.closeRef,m=t.actionSize,s=void 0===m?"medium":m,g=d(null),f=d(null),p=d(null),v=n(!1),I=v[0],A=v[1],x=function(){return A(!1)};return l((function(){(null==c?void 0:c.current)&&(c.current={close:function(){return x()}})}),[c]),o("div",{className:E.container,ref:g,children:[e("div",{className:u(E,{action:!0},[E[_],E[s]]),ref:p,onClick:function(){return A(!I)},children:i}),e(M,{containerRef:g,contentRef:f,isOpen:I,onClose:x,renderChild:function(){return e("div",{className:E.menuContainer,ref:f,children:e(z,{children:a})})}})]})},Y={container:"LoadingItem-module_container__ujRaI",fadeInOut:"LoadingItem-module_fadeInOut__HDJT8",square:"LoadingItem-module_square__OucYB",xxs:"LoadingItem-module_xxs__kTYcZ",xs:"LoadingItem-module_xs__sISZM",sm:"LoadingItem-module_sm__hsDHD",md:"LoadingItem-module_md__bU5yA",lg:"LoadingItem-module_lg__9sK4b",xl:"LoadingItem-module_xl__O0kH8",xxl:"LoadingItem-module_xxl__tIjdb",xxxl:"LoadingItem-module_xxxl__h73z5",xxxxl:"LoadingItem-module_xxxxl__XTzwy",flexWide:"LoadingItem-module_flexWide__sIJC3",slidein:"LoadingItem-module_slidein__8J982",heightAnimation:"LoadingItem-module_heightAnimation__cUh26",fadein:"LoadingItem-module_fadein__-CmLg",floatAnimation:"LoadingItem-module_floatAnimation__gQ2jh"},j=function(o){var n=o.shape,t=void 0===n?"square":n,i=o.size,l=void 0===i?"md":i,d=o.width,a=o.height;return e("div",{className:u(Y,{container:!0},[Y[t],Y[l]]),style:{width:d,height:a}})},U={container:"Accordion-module_container__6rGl0",header:"Accordion-module_header__AYOT5",body:"Accordion-module_body__4IgEa",content:"Accordion-module_content__RyBzl",isOpen:"Accordion-module_isOpen__Bmf-c",flexWide:"Accordion-module_flexWide__Pmyu-",slidein:"Accordion-module_slidein__NIsrY",fadeInOut:"Accordion-module_fadeInOut__Ub-rg",heightAnimation:"Accordion-module_heightAnimation__nT1oQ",fadein:"Accordion-module_fadein__KprHu",floatAnimation:"Accordion-module_floatAnimation__d-fsP"},F=function(t){var i=t.title,l=t.content,d=n(!1),a=d[0],r=d[1];return o("div",{className:u(U,{container:!0,isOpen:a}),onClick:function(){return r(!a)},children:[o("div",{className:U.header,children:[e("h3",{children:i}),e(m,{icon:a?I:A,size:"md"})]}),e("div",{className:U.body,children:e("div",{className:U.content,children:l})})]})},H={tooltip:"Tooltip-module_tooltip__LjRUX",hint:"Tooltip-module_hint__ZdhCh",top:"Tooltip-module_top__HZqEk",bottom:"Tooltip-module_bottom__hrxCa",right:"Tooltip-module_right__LGQTD",left:"Tooltip-module_left__-LZ0w",flexWide:"Tooltip-module_flexWide__dQnBf",slidein:"Tooltip-module_slidein__Yziit",fadeInOut:"Tooltip-module_fadeInOut__glWW2",heightAnimation:"Tooltip-module_heightAnimation__5cr8-",fadein:"Tooltip-module_fadein__NGjXx",floatAnimation:"Tooltip-module_floatAnimation__R4QxW"},V=function(n){var t=n.hint,i=n.children,l=n.position,d=void 0===l?"top":l;return o("div",{className:H.tooltip,children:[!!t&&e("div",{className:"".concat(H.hint," ").concat(H[d]),children:t}),i]})},X=function(e){return null==e||("object"==typeof e?Array.isArray(e)?0===e.length:e instanceof Set||e instanceof Map?0===e.size:0===Object.keys(e).length:"string"==typeof e&&0===e.length)};export{F as Accordion,k as Avatar,y as Button,G as DropDown,b as IconButton,W as Input,w as InputType,O as Link,C as ListItem,j as LoadingItem,m as SVGIcon,V as Tooltip,h as UIElementType,u as classNames,X as isEmpty,P as useClickOutside,R as useClickOutsideRef}; | ||
//# sourceMappingURL=index.esm.js.map |
@@ -1,2 +0,2 @@ | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),o=require("react");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=n(require("react-dom")),i={avatar:"Avatar-module_avatar__5-kP8",image:"Avatar-module_image__HFFlp",clickable:"Avatar-module_clickable__DD7pl",editable:"Avatar-module_editable__CpXtw",editIcon:"Avatar-module_editIcon__ULUa1",overlay:"Avatar-module_overlay__d95aK",overlayText:"Avatar-module_overlayText__NgsFM",loading:"Avatar-module_loading__9gBDd",xxs:"Avatar-module_xxs__zCCH6",xs:"Avatar-module_xs__1SMBv",sm:"Avatar-module_sm__8TB22",md:"Avatar-module_md__zeW0d",lg:"Avatar-module_lg__MWKN-",xl:"Avatar-module_xl__KCqIL",xxl:"Avatar-module_xxl__ox6gi",xxxl:"Avatar-module_xxxl__9Cc7C",inline:"Avatar-module_inline__H0AhD",flexWide:"Avatar-module_flexWide__GQYaQ",slidein:"Avatar-module_slidein__KV8Ih",fadeInOut:"Avatar-module_fadeInOut__2M9tv",heightAnimation:"Avatar-module_heightAnimation__RCYYu",fadein:"Avatar-module_fadein__lENH2",floatAnimation:"Avatar-module_floatAnimation__PNWhi"},l=function(e,o,n){void 0===n&&(n=[]);var t=[];for(var i in o)o[i]&&t.push(e[i]);return(null==n?void 0:n.length)>0&&(t=t.concat(n)),t.join(" ")},d={container:"SVGIcon-module_container__z2RN5",isLoading:"SVGIcon-module_isLoading__8BhuU",fadeInOut:"SVGIcon-module_fadeInOut__EgbCf",flexWide:"SVGIcon-module_flexWide__IfOOF",slidein:"SVGIcon-module_slidein__RT6-4",heightAnimation:"SVGIcon-module_heightAnimation__CmY-x",fadein:"SVGIcon-module_fadein__Y2P5U",floatAnimation:"SVGIcon-module_floatAnimation__kH3Tr"},a=function(o){var n=o.icon,t=o.size,i=void 0===t?"sm":t,a=o.className,r=void 0===a?"":a,_=o.isLoading,u=void 0!==_&&_,s=function(e){switch(e){case"xxs":return 8;case"xs":return 12;case"sm":default:return 16;case"md":return 24;case"lg":return 32;case"xl":return 48;case"xxl":return 64;case"xxxl":return 128}}(i);return n?e.jsx("div",{className:l(d,{container:!0,isLoading:u},[r]),children:e.jsx(n,{className:r,width:s,height:s,viewBox:"0 0 24 24",preserveAspectRatio:"xMidYMid meet"})}):null},r=function(){return r=Object.assign||function(e){for(var o,n=1,t=arguments.length;n<t;n++)for(var i in o=arguments[n])Object.prototype.hasOwnProperty.call(o,i)&&(e[i]=o[i]);return e},r.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var _,u=function(o){return e.jsxs("svg",r({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},o,{children:[e.jsx("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M2 8.377c0-.35 0-.525.015-.673a3 3 0 0 1 2.69-2.69C4.851 5 5.035 5 5.404 5c.143 0 .214 0 .274-.004a2 2 0 0 0 1.735-1.25c.023-.056.044-.12.086-.246.042-.127.063-.19.086-.246a2 2 0 0 1 1.735-1.25C9.38 2 9.448 2 9.58 2h4.838c.133 0 .2 0 .26.004a2 2 0 0 1 1.735 1.25c.023.056.044.12.086.246.042.127.063.19.086.246a2 2 0 0 0 1.735 1.25c.06.004.131.004.273.004.37 0 .554 0 .702.015a3 3 0 0 1 2.69 2.69c.014.147.014.322.014.672V16.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2z"}),e.jsx("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 16.5a4 4 0 1 0 0-8 4 4 0 0 0 0 8"})]}))},s=function(o){return e.jsx("svg",r({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},o,{children:e.jsx("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 6 9 17l-5-5"})}))},c=function(o){return e.jsx("svg",r({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},o,{children:e.jsx("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"m9 18 6-6-6-6"})}))},m=function(o){return e.jsx("svg",r({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},o,{children:e.jsx("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"m4.272 20.728 6.597-6.597c.396-.396.594-.594.822-.668a1 1 0 0 1 .618 0c.228.074.426.272.822.668l6.553 6.553M14 15l2.869-2.869c.396-.396.594-.594.822-.668a1 1 0 0 1 .618 0c.228.074.426.272.822.668L22 15M10 9a2 2 0 1 1-4 0 2 2 0 0 1 4 0M6.8 21h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 18.72 22 17.88 22 16.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 3 18.88 3 17.2 3H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 5.28 2 6.12 2 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 21 5.12 21 6.8 21"})}))},h=function(o){return e.jsx("svg",r({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},o,{children:e.jsx("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 12h14"})}))},p=function(o){return e.jsx("svg",r({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},o,{children:e.jsx("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 5v14m-7-7h14"})}))},g=function(o){return e.jsx("svg",r({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},o,{children:e.jsx("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"m8 16 4-4m0 0 4 4m-4-4v9m8-4.257A5.5 5.5 0 0 0 16.5 7a.62.62 0 0 1-.534-.302 7.5 7.5 0 1 0-11.78 9.096"})}))},f=function(o){return e.jsx("svg",r({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},o,{children:e.jsx("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5.316 19.438A4 4 0 0 1 9 17h6a4 4 0 0 1 3.684 2.438M16 9.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0m6 2.5c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10"})}))},x=function(o){var n=o.source,t=void 0===n?null:n,d=o.alt,r=void 0===d?"avatar":d,_=o.size,s=void 0===_?"sm":_,c=o.onClick,m=o.className,h=o.isEditable,p=void 0!==h&&h,x=o.overlayIcon,v=o.inline,I=void 0!==v&&v,A=o.isLoading,L=void 0!==A&&A,k=o.overlayText,y=function(){switch(s){case"xxxl":return 512;case"xxl":return 256;case"xl":return 128;case"lg":return 96;case"md":return 64;case"xs":return 32;case"xxs":return 24;default:return 48}};return e.jsxs("div",{className:l(i,{avatar:!0,clickable:!!c||p,editable:p,inline:I,loading:L},[i[s],m]),onClick:c,style:{width:y(),height:y()},children:[t?e.jsx("img",{src:t,alt:r,className:i.image,width:y(),height:y()}):e.jsx(a,{size:s,icon:f}),p&&e.jsx("div",{className:i.editIcon,children:e.jsx(a,{isLoading:L,icon:L?g:u})}),(!!x||k)&&e.jsxs("div",{className:i.overlay,children:[!!x&&e.jsx(a,{isLoading:L,icon:L?g:x}),!!k&&e.jsx("div",{className:i.overlayText,children:k})]})]})},v={container:"Button-module_container__0j8md",confirm:"Button-module_confirm__N5z4A",confirmActions:"Button-module_confirmActions__Xh7kN",button:"Button-module_button__18Bed",label:"Button-module_label__1PsXG",light:"Button-module_light__oUjYe",lightDark:"Button-module_lightDark__vucG6",active:"Button-module_active__UeHD7",lightDanger:"Button-module_lightDanger__aDpy8",lightInfo:"Button-module_lightInfo__oCfFI",lightPrimary:"Button-module_lightPrimary__f7-kQ",lightSecondary:"Button-module_lightSecondary__YK-QR",lightWarning:"Button-module_lightWarning__-Ogcg",lightSuccess:"Button-module_lightSuccess__gSt46",primary:"Button-module_primary__st6yY",secondary:"Button-module_secondary__j-3rj",danger:"Button-module_danger__Hxs5n",dark:"Button-module_dark__T7dl8",info:"Button-module_info__2z1ZG",success:"Button-module_success__CHTsg",warning:"Button-module_warning__1voOb",whiteText:"Button-module_whiteText__12xTM",default:"Button-module_default__TZZU2",borderedPrimary:"Button-module_borderedPrimary__KrZVT",borderedSecondary:"Button-module_borderedSecondary__UPNks",small:"Button-module_small__zfmcP",xsmall:"Button-module_xsmall__QS3d-",fullWidth:"Button-module_fullWidth__AHpSl",flexWide:"Button-module_flexWide__xDrEF",slidein:"Button-module_slidein__ofhlO",fadeInOut:"Button-module_fadeInOut__nAOqm",heightAnimation:"Button-module_heightAnimation__fLFCd",fadein:"Button-module_fadein__pspkB",floatAnimation:"Button-module_floatAnimation__0PYtT"};exports.UIElementType=void 0,(_=exports.UIElementType||(exports.UIElementType={})).PRIMARY="primary",_.SECONDARY="secondary",_.DANGER="danger",_.SUCCESS="success",_.WARNING="warning",_.INFO="info",_.LIGHT="light",_.DEFAULT="default",_.DARK="dark",_.LIGHT_PRIMARY="lightPrimary",_.LIGHT_SUCCESS="lightSuccess",_.LIGHT_WARNING="lightWarning",_.LIGHT_INFO="lightInfo",_.LIGHT_DANGER="lightDanger",_.LIGHT_DARK="lightDark",_.LIGHT_SECONDARY="lightSecondary",_.WHITE_TEXT="whiteText",_.BORDERED_PRIMARY="borderedPrimary",_.BORDERED_SECONDARY="borderedSecondary";var I,A=function(n){var t=n.type,i=void 0===t?exports.UIElementType.PRIMARY:t,d=n.onClick,r=n.label,_=n.icon,u=n.fullWidth,s=void 0!==u&&u,c=n.isLoading,m=n.disabled,h=n.className,p=n.needConfirm,g=void 0!==p&&p,f=n.size,x=void 0===f?"standard":f,I=o.useState(!1),L=I[0],k=I[1];return e.jsxs("div",{className:l(v,{container:!0,fullWidth:s}),children:[e.jsx("button",{className:l(v,{button:!0,loading:!!c},[v[i],v[x],h]),onClick:g?function(){return k(!L)}:d,disabled:c||m,children:c?e.jsx(o.Fragment,{children:"Loading..."}):e.jsxs("div",{className:v.label,children:[_&&e.jsx(a,{icon:_}),e.jsx("span",{children:r})]})}),L&&e.jsxs("div",{className:v.confirm,children:[e.jsx("div",{className:v.confirmMessage,children:"Are you sure?"}),e.jsxs("div",{className:v.confirmActions,children:[e.jsx(A,{type:exports.UIElementType.DANGER,onClick:function(){return k(!1)},label:"No"}),e.jsx(A,{type:exports.UIElementType.SUCCESS,onClick:function(){k(!1),d()},label:"Yes"})]})]})]})},L={iconButton:"IconButton-module_iconButton__PmpB8",noPadding:"IconButton-module_noPadding__Jd2rK",lg:"IconButton-module_lg__KG7lp",md:"IconButton-module_md__s4q7b",sm:"IconButton-module_sm__are9s",xs:"IconButton-module_xs__qYwZc",confirm:"IconButton-module_confirm__-jXH4",confirmActions:"IconButton-module_confirmActions__j7-Tt",bottom:"IconButton-module_bottom__AEpND",disabled:"IconButton-module_disabled__pLK-t",white:"IconButton-module_white__AzyNN",light:"IconButton-module_light__i3AET",active:"IconButton-module_active__popsF",lightDark:"IconButton-module_lightDark__d7NQy",lightDanger:"IconButton-module_lightDanger__bIg02",lightInfo:"IconButton-module_lightInfo__820It",lightPrimary:"IconButton-module_lightPrimary__SCrg-",lightSecondary:"IconButton-module_lightSecondary__vN-aS",lightWarning:"IconButton-module_lightWarning__z1iaR",lightSuccess:"IconButton-module_lightSuccess__mUSnD",primary:"IconButton-module_primary__qjfR5",secondary:"IconButton-module_secondary__-CufX",danger:"IconButton-module_danger__lz3tP",dark:"IconButton-module_dark__QiBJk",info:"IconButton-module_info__eawU-",success:"IconButton-module_success__xkDzZ",warning:"IconButton-module_warning__DhbfD",whiteText:"IconButton-module_whiteText__111Ju",default:"IconButton-module_default__j2U57",borderedPrimary:"IconButton-module_borderedPrimary__DHXJQ",borderedSecondary:"IconButton-module_borderedSecondary__13GNA",flexWide:"IconButton-module_flexWide__BGOfY",slidein:"IconButton-module_slidein__Rmpl5",fadeInOut:"IconButton-module_fadeInOut__Z2E5a",heightAnimation:"IconButton-module_heightAnimation__JnqnZ",fadein:"IconButton-module_fadein__uX9ut",floatAnimation:"IconButton-module_floatAnimation__N-INw"},k={listItem:"ListItem-module_listItem__ljWE5",separator:"ListItem-module_separator__CIXS1",dashedSeparator:"ListItem-module_dashedSeparator__SYWNX",content:"ListItem-module_content__mPC1D",data:"ListItem-module_data__e0N6V",title:"ListItem-module_title__YkOz9",subtitle:"ListItem-module_subtitle__5flJp",indicator:"ListItem-module_indicator__BwMsO",success:"ListItem-module_success__lgO8z",info:"ListItem-module_info__MKMBu",warning:"ListItem-module_warning__8P-nA",danger:"ListItem-module_danger__sWYOu",primary:"ListItem-module_primary__-bA-W",completed:"ListItem-module_completed__ovBl4",flexWide:"ListItem-module_flexWide__-0Q5a",slidein:"ListItem-module_slidein__dGxX-",fadeInOut:"ListItem-module_fadeInOut__Yuwsd",heightAnimation:"ListItem-module_heightAnimation__aVO2o",fadein:"ListItem-module_fadein__GSr23",floatAnimation:"ListItem-module_floatAnimation__efvAy"},y={link:"Link-module_link__35Vo1",fullWidth:"Link-module_fullWidth__eg45D",zero:"Link-module_zero__e-EXa",xxs:"Link-module_xxs__DLzl2",xs:"Link-module_xs__K3V8L",s:"Link-module_s__Ojcbu",m:"Link-module_m__KQ9M4",lg:"Link-module_lg__R71ff",xl:"Link-module_xl__q05MB",xxl:"Link-module_xxl__VZVxK",xxxl:"Link-module_xxxl__91qsW",light:"Link-module_light__Ji8kV",active:"Link-module_active__iCkL0",lightDark:"Link-module_lightDark__1fDCG",lightDanger:"Link-module_lightDanger__lB9Tb",lightInfo:"Link-module_lightInfo__h5lfu",lightPrimary:"Link-module_lightPrimary__aZxve",lightSecondary:"Link-module_lightSecondary__QHh0c",lightWarning:"Link-module_lightWarning__iOuMw",lightSuccess:"Link-module_lightSuccess__zDBp0",primary:"Link-module_primary__CE3uj",secondary:"Link-module_secondary__KSolI",danger:"Link-module_danger__ugf9r",dark:"Link-module_dark__ap0Ls",info:"Link-module_info__9skpg",success:"Link-module_success__DwP-V",warning:"Link-module_warning__FhhXi",whiteText:"Link-module_whiteText__t7SOQ",default:"Link-module_default__3TBlr",borderedPrimary:"Link-module_borderedPrimary__RfPen",borderedSecondary:"Link-module_borderedSecondary__xTeGX",flexWide:"Link-module_flexWide__3A6ZB",slidein:"Link-module_slidein__kBzO4",fadeInOut:"Link-module_fadeInOut__zas8c",heightAnimation:"Link-module_heightAnimation__N7y-w",fadein:"Link-module_fadein__WxUdb",floatAnimation:"Link-module_floatAnimation__XrwU5"},D={input:"Input-module_input__505b7",full:"Input-module_full__h2smD",noMargin:"Input-module_noMargin__ysWuN",container:"Input-module_container__itXJp",colorPicker:"Input-module_colorPicker__Efa-c",required:"Input-module_required__kHc93",addon:"Input-module_addon__1cKdz",pointer:"Input-module_pointer__EsKoB",error:"Input-module_error__38tit",avatar:"Input-module_avatar__GJUWC",autoCompleteContent:"Input-module_autoCompleteContent__4anQc",reversed:"Input-module_reversed__dU1hV",transparent:"Input-module_transparent__ko36m",small:"Input-module_small__5vYiK",xsmall:"Input-module_xsmall__-9hXW",hasAddon:"Input-module_hasAddon__mruPW",flexWide:"Input-module_flexWide__4Wn1k",slidein:"Input-module_slidein__XYim1",fadeInOut:"Input-module_fadeInOut__bnAwc",heightAnimation:"Input-module_heightAnimation__tmt9Z",fadein:"Input-module_fadein__1HtqV",floatAnimation:"Input-module_floatAnimation__sYawG"};exports.InputType=void 0,(I=exports.InputType||(exports.InputType={})).TEXT="text",I.PASSWORD="password",I.EMAIL="email",I.NUMBER="number",I.URL="url",I.TEL="tel",I.DATE="date",I.DATETIME="datetime",I.SELECT="select",I.COLOR_PICKER="color-picker",I.TEXT_AREA="text-area",I.AVATAR_UPLOAD="avatar-upload",I.UPLOAD_IMAGE_ICON="upload-image-icon";var w=o.forwardRef((function(n,t){var i=n.type,d=void 0===i?exports.InputType.TEXT:i,_=n.label,u=n.placeholder,s=n.value,c=n.required,h=void 0!==c&&c,p=n.addonIcon,g=n.labelAddon,f=n.errorMessage,v=n.options,I=void 0===v?[]:v,A=n.fullWidth,L=n.avatarSize,k=n.source,y=n.autoCompleteContent,w=n.autoCompleteReverse,j=void 0!==w&&w,B=n.noMargin,b=void 0!==B&&B,N=n.isDisabled,C=void 0!==N&&N,S=n.isLoading,T=void 0!==S&&S,E=n.isMultiUpload,O=void 0!==E&&E,W=n.autoFocus,P=void 0!==W&&W,R=n.theme,M=void 0===R?"oval":R,U=n.size,z=void 0===U?"medium":U,G=n.onBlur,Y=n.onFocus,F=n.onChange,H=n.addonAction,V=n.onEnter,K=n.onEsc,X=n.onFileSelect,q=n.onFilesSelect,Z=function(e,o){var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&o.indexOf(t)<0&&(n[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(t=Object.getOwnPropertySymbols(e);i<t.length;i++)o.indexOf(t[i])<0&&Object.prototype.propertyIsEnumerable.call(e,t[i])&&(n[t[i]]=e[t[i]])}return n}(n,["type","label","placeholder","value","required","addonIcon","labelAddon","errorMessage","options","fullWidth","avatarSize","source","autoCompleteContent","autoCompleteReverse","noMargin","isDisabled","isLoading","isMultiUpload","autoFocus","theme","size","onBlur","onFocus","onChange","addonAction","onEnter","onEsc","onFileSelect","onFilesSelect"]),Q=C||T,J=function(e){switch(e.key){case"Enter":V&&V();break;case"Escape":K&&K()}},$=function(e){var o=e.target.files[0],n=new FileReader;n.onload=function(){X&&X(o,n.result)},n.readAsDataURL(o)},ee=function(e){var o=e.target;q&&q(o.files)};return e.jsxs("div",{className:l(D,{input:!0,full:!!A,noMargin:b,hasAddon:!!p},[D[M],D[z]]),children:[_&&e.jsxs("label",{children:[e.jsx("span",{className:h?D.required:"",children:_}),!!g&&e.jsx("div",{className:D.labelAddon,children:g})]}),e.jsx("div",{className:D.container,children:function(){switch(d){case exports.InputType.SELECT:return e.jsxs("select",r({className:D.field,value:s,onBlur:G,onFocus:Y,onChange:F,ref:t},Z,{children:[e.jsx("option",{value:"",children:u}),I.map((function(o){var n=o.label,t=o.value;return e.jsx("option",{value:t,children:n},t)}))]}));case exports.InputType.COLOR_PICKER:return e.jsx("input",r({className:"".concat(D.field," ").concat(D.colorPicker),type:"color",value:s,placeholder:u,onBlur:G,onFocus:Y,onChange:F,disabled:Q,ref:t},Z));case exports.InputType.TEXT_AREA:return e.jsx("textarea",r({className:D.field,value:s,placeholder:u,onBlur:G,onFocus:Y,onChange:F,autoFocus:P,ref:t},Z));case exports.InputType.AVATAR_UPLOAD:return e.jsxs("label",{htmlFor:"avatar-upload",children:[e.jsx(x,{size:L,source:k,isLoading:T,isEditable:!0}),e.jsx("input",{type:"file",name:"avatar-upload",id:"avatar-upload",accept:"image/*",onChange:O?ee:$,ref:t,className:D.avatar,disabled:Q,multiple:O})]});case exports.InputType.UPLOAD_IMAGE_ICON:return e.jsxs("label",{htmlFor:"upload-image-icon",children:[e.jsx(a,{icon:m,isLoading:T,size:"md"}),e.jsx("input",{type:"file",name:"upload-image-icon",id:"upload-image-icon",accept:"image/*",onChange:O?ee:$,ref:t,className:D.avatar,disabled:Q,multiple:O})]});default:return e.jsxs(o.Fragment,{children:[e.jsx("input",r({className:D.field,type:d,placeholder:u,value:s,onBlur:G,onFocus:Y,onChange:F,onKeyUp:J,ref:t,disabled:Q,autoFocus:P},Z)),p&&e.jsx("div",{className:H?"".concat(D.addon," ").concat(D.pointer):D.addon,onClick:H,children:e.jsx(a,{icon:p,isLoading:T})})]})}}()}),!!f&&e.jsx("div",{className:D.error,children:f}),!!y&&e.jsx("div",{className:l(D,{autoCompleteContent:!0,reversed:j}),children:y})]})})),j={menu:"DropDown-module_menu__gRW7p",container:"DropDown-module_container__ms9Bn",action:"DropDown-module_action__D8KuY",light:"DropDown-module_light__6NSjI",active:"DropDown-module_active__rGcA2",lightDark:"DropDown-module_lightDark__Ctspk",lightDanger:"DropDown-module_lightDanger__FaZ6G",lightInfo:"DropDown-module_lightInfo__DMaJO",lightPrimary:"DropDown-module_lightPrimary__sobOp",lightSecondary:"DropDown-module_lightSecondary__PB0m-",lightWarning:"DropDown-module_lightWarning__mkeGN",lightSuccess:"DropDown-module_lightSuccess__QNoVS",primary:"DropDown-module_primary__9-x6Y",secondary:"DropDown-module_secondary__HBses",danger:"DropDown-module_danger__ZbPY6",dark:"DropDown-module_dark__3YhdZ",info:"DropDown-module_info__5qwW6",success:"DropDown-module_success__NbhHj",warning:"DropDown-module_warning__MrYwV",whiteText:"DropDown-module_whiteText__eVLut",default:"DropDown-module_default__D0DNi",borderedPrimary:"DropDown-module_borderedPrimary__oTb-J",borderedSecondary:"DropDown-module_borderedSecondary__GqWsA",xsmall:"DropDown-module_xsmall__Mc6Zx",small:"DropDown-module_small__Goyza",large:"DropDown-module_large__P5F--",flexWide:"DropDown-module_flexWide__ySVZv",slidein:"DropDown-module_slidein__ZYDXA",fadeInOut:"DropDown-module_fadeInOut__hjIWL",heightAnimation:"DropDown-module_heightAnimation__EUum9",fadein:"DropDown-module_fadein__D2VO0",floatAnimation:"DropDown-module_floatAnimation__z5DD5"},B=function(e,n){var t=function(o){e.current&&!e.current.contains(o.target)&&n()};o.useEffect((function(){return document.addEventListener("click",t),function(){document.removeEventListener("click",t)}}),[])},b=function(n){var i=n.containerRef,l=n.contentRef,d=n.isOpen,a=void 0!==d&&d,_=n.renderChild,u=n.onClose,s={isOpen:!1,top:0,left:0,bottom:0,right:0},c=o.useState(s),m=c[0],h=c[1],p={position:"absolute",top:m.top,left:m.left,bottom:m.bottom,right:m.right,zIndex:111},g=function(){h(s),u()};return B(i,(function(){return g()})),o.useEffect((function(){if(a)return function(){var e,o,n,t,d,a,_,u=null!==(n=null===(o=null===(e=null==i?void 0:i.current)||void 0===e?void 0:e.getBoundingClientRect)||void 0===o?void 0:o.call(e))&&void 0!==n?n:{top:0,left:0,height:0,width:0},s=u.top,c=u.left,m=u.height,p=u.width,g=window.innerHeight,f=window.innerWidth,x=g-(s+m),v=s,I=c,A=f-(c+p),L=null!==(d=null===(t=null==l?void 0:l.current)||void 0===t?void 0:t.clientHeight)&&void 0!==d?d:200,k=null!==(_=null===(a=null==l?void 0:l.current)||void 0===a?void 0:a.clientWidth)&&void 0!==_?_:200,y="auto",D="auto",w="auto",j="auto";x<L&&v>=L?j=g-s-m+20:D=s+m+5,A<k&&I>=k?w=f-c:y=c,h(r(r({},{top:D,left:y,right:w,bottom:j}),{isOpen:!0}))}();g()}),[a,null==i?void 0:i.current]),m.isOpen?t.default.createPortal(e.jsx("div",{style:p,onClick:function(e){e.stopPropagation()},children:_(m)}),document.getElementById("portals")):null},N=function(o){var n=o.children;return e.jsx("div",{className:j.menu,children:n})},C={container:"LoadingItem-module_container__ujRaI",fadeInOut:"LoadingItem-module_fadeInOut__HDJT8",square:"LoadingItem-module_square__OucYB",xxs:"LoadingItem-module_xxs__kTYcZ",xs:"LoadingItem-module_xs__sISZM",sm:"LoadingItem-module_sm__hsDHD",md:"LoadingItem-module_md__bU5yA",lg:"LoadingItem-module_lg__9sK4b",xl:"LoadingItem-module_xl__O0kH8",xxl:"LoadingItem-module_xxl__tIjdb",xxxl:"LoadingItem-module_xxxl__h73z5",xxxxl:"LoadingItem-module_xxxxl__XTzwy",flexWide:"LoadingItem-module_flexWide__sIJC3",slidein:"LoadingItem-module_slidein__8J982",heightAnimation:"LoadingItem-module_heightAnimation__cUh26",fadein:"LoadingItem-module_fadein__-CmLg",floatAnimation:"LoadingItem-module_floatAnimation__gQ2jh"},S={container:"Accordion-module_container__6rGl0",header:"Accordion-module_header__AYOT5",body:"Accordion-module_body__4IgEa",content:"Accordion-module_content__RyBzl",isOpen:"Accordion-module_isOpen__Bmf-c",flexWide:"Accordion-module_flexWide__Pmyu-",slidein:"Accordion-module_slidein__NIsrY",fadeInOut:"Accordion-module_fadeInOut__Ub-rg",heightAnimation:"Accordion-module_heightAnimation__nT1oQ",fadein:"Accordion-module_fadein__KprHu",floatAnimation:"Accordion-module_floatAnimation__d-fsP"};exports.Accordion=function(n){var t=n.title,i=n.content,d=o.useState(!1),r=d[0],_=d[1];return e.jsxs("div",{className:l(S,{container:!0,isOpen:r}),onClick:function(){return _(!r)},children:[e.jsxs("div",{className:S.header,children:[e.jsx("h3",{children:t}),e.jsx(a,{icon:r?h:p,size:"md"})]}),e.jsx("div",{className:S.body,children:e.jsx("div",{className:S.content,children:i})})]})},exports.Avatar=x,exports.Button=A,exports.DropDown=function(n){var t=n.action,i=n.menu,d=n.type,a=void 0===d?exports.UIElementType.DEFAULT:d,r=n.closeRef,_=n.actionSize,u=void 0===_?"medium":_,s=o.useRef(null),c=o.useRef(null),m=o.useRef(null),h=o.useState(!1),p=h[0],g=h[1],f=function(){return g(!1)};return o.useEffect((function(){(null==r?void 0:r.current)&&(r.current={close:function(){return f()}})}),[r]),e.jsxs("div",{className:j.container,ref:s,children:[e.jsx("div",{className:l(j,{action:!0},[j[a],j[u]]),ref:m,onClick:function(){return g(!p)},children:t}),e.jsx(b,{containerRef:s,contentRef:c,isOpen:p,onClose:f,renderChild:function(){return e.jsx("div",{className:j.menuContainer,ref:c,children:e.jsx(N,{children:i})})}})]})},exports.IconButton=function(n){var t=n.icon,i=n.onClick,d=n.type,r=void 0===d?exports.UIElementType.DEFAULT:d,_=n.needConfirm,u=void 0!==_&&_,s=n.noPadding,c=void 0!==s&&s,m=n.isLoading,h=void 0!==m&&m,p=n.size,g=void 0===p?"sm":p,f=n.confirmPosition,x=void 0===f?"top":f,v=o.useState(!1),I=v[0],k=v[1];return e.jsxs("div",{className:l(L,{iconButton:!0,noPadding:c},[L[r],L[g]]),onClick:h?void 0:u?function(){return k(!I)}:i,children:[e.jsx(a,{isLoading:h,icon:t,size:g}),I&&e.jsxs("div",{className:"".concat(L.confirm," ").concat(L[x]),children:[e.jsx("div",{className:L.confirmMessage,children:"Are you sure?"}),e.jsxs("div",{className:L.confirmActions,children:[e.jsx(A,{type:exports.UIElementType.DANGER,onClick:function(){return k(!1)},label:"No",size:"small"}),e.jsx(A,{type:exports.UIElementType.SUCCESS,onClick:i,label:"Yes",size:"small"})]})]})]})},exports.Input=w,exports.Link=function(o){var n=o.href,t=o.title,i=o.target,d=void 0===i?"_self":i,r=o.type,_=void 0===r?exports.UIElementType.DEFAULT:r,u=o.padding,s=void 0===u?"zero":u,m=o.hasChevron,h=void 0!==m&&m,p=o.fullWidth,g=void 0!==p&&p;return e.jsxs("a",{href:n,target:d,rel:"noopener noreferrer",className:l(y,{link:!0,fullWidth:g},[y[_],y[s]]),children:[e.jsx("span",{children:t})," ",h&&e.jsx(a,{icon:c})]})},exports.ListItem=function(o){var n=o.title,t=o.subtitle,i=o.actionTitle,d=void 0===i?"":i,r=o.action,_=o.completed,u=o.indicator,c=o.hasSeparator,m=void 0!==c&&c,h=o.hasDashedSeparator,p=void 0!==h&&h,g=o.isActionPending,f=void 0!==g&&g;return e.jsxs("div",{className:l(k,{listItem:!0,separator:m,dashedSeparator:p}),children:[e.jsxs("div",{className:k.content,children:[u&&e.jsx("div",{className:l(k,{indicator:!0},[k[u]])}),e.jsxs("div",{className:k.data,children:[e.jsx("div",{className:k.title,children:n}),t&&e.jsx("div",{className:k.subtitle,children:t})]})]}),r&&e.jsx(A,{onClick:r,className:k.action,label:d,isLoading:f}),_&&e.jsx("div",{className:k.completed,children:e.jsx(a,{icon:s})})]})},exports.LoadingItem=function(o){var n=o.shape,t=void 0===n?"square":n,i=o.size,d=void 0===i?"md":i,a=o.width,r=o.height;return e.jsx("div",{className:l(C,{container:!0},[C[t],C[d]]),style:{width:a,height:r}})},exports.SVGIcon=a,exports.classNames=l,exports.isEmpty=function(e){return null==e||("object"==typeof e?Array.isArray(e)?0===e.length:e instanceof Set||e instanceof Map?0===e.size:0===Object.keys(e).length:"string"==typeof e&&0===e.length)},exports.useClickOutside=B; | ||
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e=require("react/jsx-runtime"),o=require("react");function n(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var t=n(require("react-dom")),i={avatar:"Avatar-module_avatar__5-kP8",image:"Avatar-module_image__HFFlp",clickable:"Avatar-module_clickable__DD7pl",editable:"Avatar-module_editable__CpXtw",editIcon:"Avatar-module_editIcon__ULUa1",overlay:"Avatar-module_overlay__d95aK",overlayText:"Avatar-module_overlayText__NgsFM",loading:"Avatar-module_loading__9gBDd",xxs:"Avatar-module_xxs__zCCH6",xs:"Avatar-module_xs__1SMBv",sm:"Avatar-module_sm__8TB22",md:"Avatar-module_md__zeW0d",lg:"Avatar-module_lg__MWKN-",xl:"Avatar-module_xl__KCqIL",xxl:"Avatar-module_xxl__ox6gi",xxxl:"Avatar-module_xxxl__9Cc7C",inline:"Avatar-module_inline__H0AhD",flexWide:"Avatar-module_flexWide__GQYaQ",slidein:"Avatar-module_slidein__KV8Ih",fadeInOut:"Avatar-module_fadeInOut__2M9tv",heightAnimation:"Avatar-module_heightAnimation__RCYYu",fadein:"Avatar-module_fadein__lENH2",floatAnimation:"Avatar-module_floatAnimation__PNWhi"},l=function(e,o,n){void 0===n&&(n=[]);var t=[];for(var i in o)o[i]&&t.push(e[i]);return(null==n?void 0:n.length)>0&&(t=t.concat(n)),t.join(" ")},d={container:"SVGIcon-module_container__z2RN5",isLoading:"SVGIcon-module_isLoading__8BhuU",fadeInOut:"SVGIcon-module_fadeInOut__EgbCf",flexWide:"SVGIcon-module_flexWide__IfOOF",slidein:"SVGIcon-module_slidein__RT6-4",heightAnimation:"SVGIcon-module_heightAnimation__CmY-x",fadein:"SVGIcon-module_fadein__Y2P5U",floatAnimation:"SVGIcon-module_floatAnimation__kH3Tr"},a=function(o){var n=o.icon,t=o.size,i=void 0===t?"sm":t,a=o.className,r=void 0===a?"":a,_=o.isLoading,u=void 0!==_&&_,s=function(e){switch(e){case"xxs":return 8;case"xs":return 12;case"sm":default:return 16;case"md":return 24;case"lg":return 32;case"xl":return 48;case"xxl":return 64;case"xxxl":return 128}}(i);return n?e.jsx("div",{className:l(d,{container:!0,isLoading:u},[r]),children:e.jsx(n,{className:r,width:s,height:s,viewBox:"0 0 24 24",preserveAspectRatio:"xMidYMid meet"})}):null},r=function(){return r=Object.assign||function(e){for(var o,n=1,t=arguments.length;n<t;n++)for(var i in o=arguments[n])Object.prototype.hasOwnProperty.call(o,i)&&(e[i]=o[i]);return e},r.apply(this,arguments)};"function"==typeof SuppressedError&&SuppressedError;var _,u=function(o){return e.jsxs("svg",r({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},o,{children:[e.jsx("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M2 8.377c0-.35 0-.525.015-.673a3 3 0 0 1 2.69-2.69C4.851 5 5.035 5 5.404 5c.143 0 .214 0 .274-.004a2 2 0 0 0 1.735-1.25c.023-.056.044-.12.086-.246.042-.127.063-.19.086-.246a2 2 0 0 1 1.735-1.25C9.38 2 9.448 2 9.58 2h4.838c.133 0 .2 0 .26.004a2 2 0 0 1 1.735 1.25c.023.056.044.12.086.246.042.127.063.19.086.246a2 2 0 0 0 1.735 1.25c.06.004.131.004.273.004.37 0 .554 0 .702.015a3 3 0 0 1 2.69 2.69c.014.147.014.322.014.672V16.2c0 1.68 0 2.52-.327 3.162a3 3 0 0 1-1.311 1.311C19.72 21 18.88 21 17.2 21H6.8c-1.68 0-2.52 0-3.162-.327a3 3 0 0 1-1.311-1.311C2 18.72 2 17.88 2 16.2z"}),e.jsx("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 16.5a4 4 0 1 0 0-8 4 4 0 0 0 0 8"})]}))},s=function(o){return e.jsx("svg",r({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},o,{children:e.jsx("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M20 6 9 17l-5-5"})}))},c=function(o){return e.jsx("svg",r({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},o,{children:e.jsx("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"m9 18 6-6-6-6"})}))},m=function(o){return e.jsx("svg",r({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},o,{children:e.jsx("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"m4.272 20.728 6.597-6.597c.396-.396.594-.594.822-.668a1 1 0 0 1 .618 0c.228.074.426.272.822.668l6.553 6.553M14 15l2.869-2.869c.396-.396.594-.594.822-.668a1 1 0 0 1 .618 0c.228.074.426.272.822.668L22 15M10 9a2 2 0 1 1-4 0 2 2 0 0 1 4 0M6.8 21h10.4c1.68 0 2.52 0 3.162-.327a3 3 0 0 0 1.311-1.311C22 18.72 22 17.88 22 16.2V7.8c0-1.68 0-2.52-.327-3.162a3 3 0 0 0-1.311-1.311C19.72 3 18.88 3 17.2 3H6.8c-1.68 0-2.52 0-3.162.327a3 3 0 0 0-1.311 1.311C2 5.28 2 6.12 2 7.8v8.4c0 1.68 0 2.52.327 3.162a3 3 0 0 0 1.311 1.311C4.28 21 5.12 21 6.8 21"})}))},h=function(o){return e.jsx("svg",r({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},o,{children:e.jsx("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5 12h14"})}))},p=function(o){return e.jsx("svg",r({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},o,{children:e.jsx("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M12 5v14m-7-7h14"})}))},f=function(o){return e.jsx("svg",r({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},o,{children:e.jsx("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"m8 16 4-4m0 0 4 4m-4-4v9m8-4.257A5.5 5.5 0 0 0 16.5 7a.62.62 0 0 1-.534-.302 7.5 7.5 0 1 0-11.78 9.096"})}))},g=function(o){return e.jsx("svg",r({xmlns:"http://www.w3.org/2000/svg",width:24,height:24,fill:"none"},o,{children:e.jsx("path",{stroke:"#000",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:2,d:"M5.316 19.438A4 4 0 0 1 9 17h6a4 4 0 0 1 3.684 2.438M16 9.5a4 4 0 1 1-8 0 4 4 0 0 1 8 0m6 2.5c0 5.523-4.477 10-10 10S2 17.523 2 12 6.477 2 12 2s10 4.477 10 10"})}))},x=function(o){var n=o.source,t=void 0===n?null:n,d=o.alt,r=void 0===d?"avatar":d,_=o.size,s=void 0===_?"sm":_,c=o.onClick,m=o.className,h=o.isEditable,p=void 0!==h&&h,x=o.overlayIcon,v=o.inline,I=void 0!==v&&v,A=o.isLoading,L=void 0!==A&&A,k=o.overlayText,D=function(){switch(s){case"xxxl":return 512;case"xxl":return 256;case"xl":return 128;case"lg":return 96;case"md":return 64;case"xs":return 32;case"xxs":return 24;default:return 48}};return e.jsxs("div",{className:l(i,{avatar:!0,clickable:!!c||p,editable:p,inline:I,loading:L},[i[s],m]),onClick:c,style:{width:D(),height:D()},children:[t?e.jsx("img",{src:t,alt:r,className:i.image,width:D(),height:D()}):e.jsx(a,{size:s,icon:g}),p&&e.jsx("div",{className:i.editIcon,children:e.jsx(a,{isLoading:L,icon:L?f:u})}),(!!x||k)&&e.jsxs("div",{className:i.overlay,children:[!!x&&e.jsx(a,{isLoading:L,icon:L?f:x}),!!k&&e.jsx("div",{className:i.overlayText,children:k})]})]})},v={container:"Button-module_container__0j8md",confirm:"Button-module_confirm__N5z4A",confirmActions:"Button-module_confirmActions__Xh7kN",button:"Button-module_button__18Bed",label:"Button-module_label__1PsXG",light:"Button-module_light__oUjYe",lightDark:"Button-module_lightDark__vucG6",active:"Button-module_active__UeHD7",lightDanger:"Button-module_lightDanger__aDpy8",lightInfo:"Button-module_lightInfo__oCfFI",lightPrimary:"Button-module_lightPrimary__f7-kQ",lightSecondary:"Button-module_lightSecondary__YK-QR",lightWarning:"Button-module_lightWarning__-Ogcg",lightSuccess:"Button-module_lightSuccess__gSt46",primary:"Button-module_primary__st6yY",secondary:"Button-module_secondary__j-3rj",danger:"Button-module_danger__Hxs5n",dark:"Button-module_dark__T7dl8",info:"Button-module_info__2z1ZG",success:"Button-module_success__CHTsg",warning:"Button-module_warning__1voOb",whiteText:"Button-module_whiteText__12xTM",default:"Button-module_default__TZZU2",borderedPrimary:"Button-module_borderedPrimary__KrZVT",borderedSecondary:"Button-module_borderedSecondary__UPNks",small:"Button-module_small__zfmcP",xsmall:"Button-module_xsmall__QS3d-",fullWidth:"Button-module_fullWidth__AHpSl",flexWide:"Button-module_flexWide__xDrEF",slidein:"Button-module_slidein__ofhlO",fadeInOut:"Button-module_fadeInOut__nAOqm",heightAnimation:"Button-module_heightAnimation__fLFCd",fadein:"Button-module_fadein__pspkB",floatAnimation:"Button-module_floatAnimation__0PYtT"};exports.UIElementType=void 0,(_=exports.UIElementType||(exports.UIElementType={})).PRIMARY="primary",_.SECONDARY="secondary",_.DANGER="danger",_.SUCCESS="success",_.WARNING="warning",_.INFO="info",_.LIGHT="light",_.DEFAULT="default",_.DARK="dark",_.LIGHT_PRIMARY="lightPrimary",_.LIGHT_SUCCESS="lightSuccess",_.LIGHT_WARNING="lightWarning",_.LIGHT_INFO="lightInfo",_.LIGHT_DANGER="lightDanger",_.LIGHT_DARK="lightDark",_.LIGHT_SECONDARY="lightSecondary",_.WHITE_TEXT="whiteText",_.BORDERED_PRIMARY="borderedPrimary",_.BORDERED_SECONDARY="borderedSecondary";var I,A=function(n){var t=n.type,i=void 0===t?exports.UIElementType.PRIMARY:t,d=n.onClick,r=n.label,_=n.icon,u=n.fullWidth,s=void 0!==u&&u,c=n.isLoading,m=n.disabled,h=n.className,p=n.needConfirm,f=void 0!==p&&p,g=n.size,x=void 0===g?"standard":g,I=o.useState(!1),L=I[0],k=I[1];return e.jsxs("div",{className:l(v,{container:!0,fullWidth:s}),children:[e.jsx("button",{className:l(v,{button:!0,loading:!!c},[v[i],v[x],h]),onClick:f?function(){return k(!L)}:d,disabled:c||m,children:c?e.jsx(o.Fragment,{children:"Loading..."}):e.jsxs("div",{className:v.label,children:[_&&e.jsx(a,{icon:_}),e.jsx("span",{children:r})]})}),L&&e.jsxs("div",{className:v.confirm,children:[e.jsx("div",{className:v.confirmMessage,children:"Are you sure?"}),e.jsxs("div",{className:v.confirmActions,children:[e.jsx(A,{type:exports.UIElementType.DANGER,onClick:function(){return k(!1)},label:"No"}),e.jsx(A,{type:exports.UIElementType.SUCCESS,onClick:function(){k(!1),d()},label:"Yes"})]})]})]})},L={iconButton:"IconButton-module_iconButton__PmpB8",noPadding:"IconButton-module_noPadding__Jd2rK",lg:"IconButton-module_lg__KG7lp",md:"IconButton-module_md__s4q7b",sm:"IconButton-module_sm__are9s",xs:"IconButton-module_xs__qYwZc",confirm:"IconButton-module_confirm__-jXH4",confirmActions:"IconButton-module_confirmActions__j7-Tt",bottom:"IconButton-module_bottom__AEpND",disabled:"IconButton-module_disabled__pLK-t",white:"IconButton-module_white__AzyNN",light:"IconButton-module_light__i3AET",active:"IconButton-module_active__popsF",lightDark:"IconButton-module_lightDark__d7NQy",lightDanger:"IconButton-module_lightDanger__bIg02",lightInfo:"IconButton-module_lightInfo__820It",lightPrimary:"IconButton-module_lightPrimary__SCrg-",lightSecondary:"IconButton-module_lightSecondary__vN-aS",lightWarning:"IconButton-module_lightWarning__z1iaR",lightSuccess:"IconButton-module_lightSuccess__mUSnD",primary:"IconButton-module_primary__qjfR5",secondary:"IconButton-module_secondary__-CufX",danger:"IconButton-module_danger__lz3tP",dark:"IconButton-module_dark__QiBJk",info:"IconButton-module_info__eawU-",success:"IconButton-module_success__xkDzZ",warning:"IconButton-module_warning__DhbfD",whiteText:"IconButton-module_whiteText__111Ju",default:"IconButton-module_default__j2U57",borderedPrimary:"IconButton-module_borderedPrimary__DHXJQ",borderedSecondary:"IconButton-module_borderedSecondary__13GNA",flexWide:"IconButton-module_flexWide__BGOfY",slidein:"IconButton-module_slidein__Rmpl5",fadeInOut:"IconButton-module_fadeInOut__Z2E5a",heightAnimation:"IconButton-module_heightAnimation__JnqnZ",fadein:"IconButton-module_fadein__uX9ut",floatAnimation:"IconButton-module_floatAnimation__N-INw"},k={listItem:"ListItem-module_listItem__ljWE5",separator:"ListItem-module_separator__CIXS1",dashedSeparator:"ListItem-module_dashedSeparator__SYWNX",content:"ListItem-module_content__mPC1D",data:"ListItem-module_data__e0N6V",title:"ListItem-module_title__YkOz9",subtitle:"ListItem-module_subtitle__5flJp",indicator:"ListItem-module_indicator__BwMsO",success:"ListItem-module_success__lgO8z",info:"ListItem-module_info__MKMBu",warning:"ListItem-module_warning__8P-nA",danger:"ListItem-module_danger__sWYOu",primary:"ListItem-module_primary__-bA-W",completed:"ListItem-module_completed__ovBl4",flexWide:"ListItem-module_flexWide__-0Q5a",slidein:"ListItem-module_slidein__dGxX-",fadeInOut:"ListItem-module_fadeInOut__Yuwsd",heightAnimation:"ListItem-module_heightAnimation__aVO2o",fadein:"ListItem-module_fadein__GSr23",floatAnimation:"ListItem-module_floatAnimation__efvAy"},D={link:"Link-module_link__35Vo1",fullWidth:"Link-module_fullWidth__eg45D",zero:"Link-module_zero__e-EXa",xxs:"Link-module_xxs__DLzl2",xs:"Link-module_xs__K3V8L",s:"Link-module_s__Ojcbu",m:"Link-module_m__KQ9M4",lg:"Link-module_lg__R71ff",xl:"Link-module_xl__q05MB",xxl:"Link-module_xxl__VZVxK",xxxl:"Link-module_xxxl__91qsW",light:"Link-module_light__Ji8kV",active:"Link-module_active__iCkL0",lightDark:"Link-module_lightDark__1fDCG",lightDanger:"Link-module_lightDanger__lB9Tb",lightInfo:"Link-module_lightInfo__h5lfu",lightPrimary:"Link-module_lightPrimary__aZxve",lightSecondary:"Link-module_lightSecondary__QHh0c",lightWarning:"Link-module_lightWarning__iOuMw",lightSuccess:"Link-module_lightSuccess__zDBp0",primary:"Link-module_primary__CE3uj",secondary:"Link-module_secondary__KSolI",danger:"Link-module_danger__ugf9r",dark:"Link-module_dark__ap0Ls",info:"Link-module_info__9skpg",success:"Link-module_success__DwP-V",warning:"Link-module_warning__FhhXi",whiteText:"Link-module_whiteText__t7SOQ",default:"Link-module_default__3TBlr",borderedPrimary:"Link-module_borderedPrimary__RfPen",borderedSecondary:"Link-module_borderedSecondary__xTeGX",flexWide:"Link-module_flexWide__3A6ZB",slidein:"Link-module_slidein__kBzO4",fadeInOut:"Link-module_fadeInOut__zas8c",heightAnimation:"Link-module_heightAnimation__N7y-w",fadein:"Link-module_fadein__WxUdb",floatAnimation:"Link-module_floatAnimation__XrwU5"},y={input:"Input-module_input__505b7",full:"Input-module_full__h2smD",noMargin:"Input-module_noMargin__ysWuN",container:"Input-module_container__itXJp",colorPicker:"Input-module_colorPicker__Efa-c",required:"Input-module_required__kHc93",addon:"Input-module_addon__1cKdz",pointer:"Input-module_pointer__EsKoB",error:"Input-module_error__38tit",avatar:"Input-module_avatar__GJUWC",autoCompleteContent:"Input-module_autoCompleteContent__4anQc",reversed:"Input-module_reversed__dU1hV",transparent:"Input-module_transparent__ko36m",small:"Input-module_small__5vYiK",xsmall:"Input-module_xsmall__-9hXW",hasAddon:"Input-module_hasAddon__mruPW",flexWide:"Input-module_flexWide__4Wn1k",slidein:"Input-module_slidein__XYim1",fadeInOut:"Input-module_fadeInOut__bnAwc",heightAnimation:"Input-module_heightAnimation__tmt9Z",fadein:"Input-module_fadein__1HtqV",floatAnimation:"Input-module_floatAnimation__sYawG"};exports.InputType=void 0,(I=exports.InputType||(exports.InputType={})).TEXT="text",I.PASSWORD="password",I.EMAIL="email",I.NUMBER="number",I.URL="url",I.TEL="tel",I.DATE="date",I.DATETIME="datetime",I.SELECT="select",I.COLOR_PICKER="color-picker",I.TEXT_AREA="text-area",I.AVATAR_UPLOAD="avatar-upload",I.UPLOAD_IMAGE_ICON="upload-image-icon";var j=o.forwardRef((function(n,t){var i=n.type,d=void 0===i?exports.InputType.TEXT:i,_=n.label,u=n.placeholder,s=n.value,c=n.required,h=void 0!==c&&c,p=n.addonIcon,f=n.labelAddon,g=n.errorMessage,v=n.options,I=void 0===v?[]:v,A=n.fullWidth,L=n.avatarSize,k=n.source,D=n.autoCompleteContent,j=n.autoCompleteReverse,w=void 0!==j&&j,B=n.noMargin,b=void 0!==B&&B,C=n.isDisabled,N=void 0!==C&&C,T=n.isLoading,S=void 0!==T&&T,E=n.isMultiUpload,O=void 0!==E&&E,W=n.autoFocus,R=void 0!==W&&W,P=n.theme,M=void 0===P?"oval":P,U=n.size,z=void 0===U?"medium":U,G=n.onBlur,Y=n.onFocus,F=n.onChange,H=n.addonAction,V=n.onEnter,X=n.onEsc,K=n.onFileSelect,q=n.onFilesSelect,Z=function(e,o){var n={};for(var t in e)Object.prototype.hasOwnProperty.call(e,t)&&o.indexOf(t)<0&&(n[t]=e[t]);if(null!=e&&"function"==typeof Object.getOwnPropertySymbols){var i=0;for(t=Object.getOwnPropertySymbols(e);i<t.length;i++)o.indexOf(t[i])<0&&Object.prototype.propertyIsEnumerable.call(e,t[i])&&(n[t[i]]=e[t[i]])}return n}(n,["type","label","placeholder","value","required","addonIcon","labelAddon","errorMessage","options","fullWidth","avatarSize","source","autoCompleteContent","autoCompleteReverse","noMargin","isDisabled","isLoading","isMultiUpload","autoFocus","theme","size","onBlur","onFocus","onChange","addonAction","onEnter","onEsc","onFileSelect","onFilesSelect"]),Q=N||S,J=function(e){switch(e.key){case"Enter":V&&V();break;case"Escape":X&&X()}},$=function(e){var o=e.target.files[0],n=new FileReader;n.onload=function(){K&&K(o,n.result)},n.readAsDataURL(o)},ee=function(e){var o=e.target;q&&q(o.files)};return e.jsxs("div",{className:l(y,{input:!0,full:!!A,noMargin:b,hasAddon:!!p},[y[M],y[z]]),children:[_&&e.jsxs("label",{children:[e.jsx("span",{className:h?y.required:"",children:_}),!!f&&e.jsx("div",{className:y.labelAddon,children:f})]}),e.jsx("div",{className:y.container,children:function(){switch(d){case exports.InputType.SELECT:return e.jsxs("select",r({className:y.field,value:s,onBlur:G,onFocus:Y,onChange:F,ref:t},Z,{children:[e.jsx("option",{value:"",children:u}),I.map((function(o){var n=o.label,t=o.value;return e.jsx("option",{value:t,children:n},t)}))]}));case exports.InputType.COLOR_PICKER:return e.jsx("input",r({className:"".concat(y.field," ").concat(y.colorPicker),type:"color",value:s,placeholder:u,onBlur:G,onFocus:Y,onChange:F,disabled:Q,ref:t},Z));case exports.InputType.TEXT_AREA:return e.jsx("textarea",r({className:y.field,value:s,placeholder:u,onBlur:G,onFocus:Y,onChange:F,autoFocus:R,ref:t},Z));case exports.InputType.AVATAR_UPLOAD:return e.jsxs("label",{htmlFor:"avatar-upload",children:[e.jsx(x,{size:L,source:k,isLoading:S,isEditable:!0}),e.jsx("input",{type:"file",name:"avatar-upload",id:"avatar-upload",accept:"image/*",onChange:O?ee:$,ref:t,className:y.avatar,disabled:Q,multiple:O})]});case exports.InputType.UPLOAD_IMAGE_ICON:return e.jsxs("label",{htmlFor:"upload-image-icon",children:[e.jsx(a,{icon:m,isLoading:S,size:"md"}),e.jsx("input",{type:"file",name:"upload-image-icon",id:"upload-image-icon",accept:"image/*",onChange:O?ee:$,ref:t,className:y.avatar,disabled:Q,multiple:O})]});default:return e.jsxs(o.Fragment,{children:[e.jsx("input",r({className:y.field,type:d,placeholder:u,value:s,onBlur:G,onFocus:Y,onChange:F,onKeyUp:J,ref:t,disabled:Q,autoFocus:R},Z)),p&&e.jsx("div",{className:H?"".concat(y.addon," ").concat(y.pointer):y.addon,onClick:H,children:e.jsx(a,{icon:p,isLoading:S})})]})}}()}),!!g&&e.jsx("div",{className:y.error,children:g}),!!D&&e.jsx("div",{className:l(y,{autoCompleteContent:!0,reversed:w}),children:D})]})})),w={menu:"DropDown-module_menu__gRW7p",container:"DropDown-module_container__ms9Bn",action:"DropDown-module_action__D8KuY",light:"DropDown-module_light__6NSjI",active:"DropDown-module_active__rGcA2",lightDark:"DropDown-module_lightDark__Ctspk",lightDanger:"DropDown-module_lightDanger__FaZ6G",lightInfo:"DropDown-module_lightInfo__DMaJO",lightPrimary:"DropDown-module_lightPrimary__sobOp",lightSecondary:"DropDown-module_lightSecondary__PB0m-",lightWarning:"DropDown-module_lightWarning__mkeGN",lightSuccess:"DropDown-module_lightSuccess__QNoVS",primary:"DropDown-module_primary__9-x6Y",secondary:"DropDown-module_secondary__HBses",danger:"DropDown-module_danger__ZbPY6",dark:"DropDown-module_dark__3YhdZ",info:"DropDown-module_info__5qwW6",success:"DropDown-module_success__NbhHj",warning:"DropDown-module_warning__MrYwV",whiteText:"DropDown-module_whiteText__eVLut",default:"DropDown-module_default__D0DNi",borderedPrimary:"DropDown-module_borderedPrimary__oTb-J",borderedSecondary:"DropDown-module_borderedSecondary__GqWsA",xsmall:"DropDown-module_xsmall__Mc6Zx",small:"DropDown-module_small__Goyza",large:"DropDown-module_large__P5F--",flexWide:"DropDown-module_flexWide__ySVZv",slidein:"DropDown-module_slidein__ZYDXA",fadeInOut:"DropDown-module_fadeInOut__hjIWL",heightAnimation:"DropDown-module_heightAnimation__EUum9",fadein:"DropDown-module_fadein__D2VO0",floatAnimation:"DropDown-module_floatAnimation__z5DD5"},B=function(e,n){var t=function(o){e.current&&!e.current.contains(o.target)&&n()};o.useEffect((function(){return document.addEventListener("click",t),function(){document.removeEventListener("click",t)}}),[])},b=function(n){var i=n.containerRef,l=n.contentRef,d=n.isOpen,a=void 0!==d&&d,_=n.renderChild,u=n.onClose,s={isOpen:!1,top:0,left:0,bottom:0,right:0},c=o.useState(s),m=c[0],h=c[1],p={position:"absolute",top:m.top,left:m.left,bottom:m.bottom,right:m.right,zIndex:111},f=function(){h(s),u()};return B(i,(function(){return f()})),o.useEffect((function(){if(a)return function(){var e,o,n,t,d,a,_,u=null!==(n=null===(o=null===(e=null==i?void 0:i.current)||void 0===e?void 0:e.getBoundingClientRect)||void 0===o?void 0:o.call(e))&&void 0!==n?n:{top:0,left:0,height:0,width:0},s=u.top,c=u.left,m=u.height,p=u.width,f=window.innerHeight,g=window.innerWidth,x=f-(s+m),v=s,I=c,A=g-(c+p),L=null!==(d=null===(t=null==l?void 0:l.current)||void 0===t?void 0:t.clientHeight)&&void 0!==d?d:200,k=null!==(_=null===(a=null==l?void 0:l.current)||void 0===a?void 0:a.clientWidth)&&void 0!==_?_:200,D="auto",y="auto",j="auto",w="auto";x<L&&v>=L?w=f-s-m+20:y=s+m+5,A<k&&I>=k?j=g-c:D=c,h(r(r({},{top:y,left:D,right:j,bottom:w}),{isOpen:!0}))}();f()}),[a,null==i?void 0:i.current]),m.isOpen?t.default.createPortal(e.jsx("div",{style:p,onClick:function(e){e.stopPropagation()},children:_(m)}),document.getElementById("portals")):null},C=function(o){var n=o.children;return e.jsx("div",{className:w.menu,children:n})},N={container:"LoadingItem-module_container__ujRaI",fadeInOut:"LoadingItem-module_fadeInOut__HDJT8",square:"LoadingItem-module_square__OucYB",xxs:"LoadingItem-module_xxs__kTYcZ",xs:"LoadingItem-module_xs__sISZM",sm:"LoadingItem-module_sm__hsDHD",md:"LoadingItem-module_md__bU5yA",lg:"LoadingItem-module_lg__9sK4b",xl:"LoadingItem-module_xl__O0kH8",xxl:"LoadingItem-module_xxl__tIjdb",xxxl:"LoadingItem-module_xxxl__h73z5",xxxxl:"LoadingItem-module_xxxxl__XTzwy",flexWide:"LoadingItem-module_flexWide__sIJC3",slidein:"LoadingItem-module_slidein__8J982",heightAnimation:"LoadingItem-module_heightAnimation__cUh26",fadein:"LoadingItem-module_fadein__-CmLg",floatAnimation:"LoadingItem-module_floatAnimation__gQ2jh"},T={container:"Accordion-module_container__6rGl0",header:"Accordion-module_header__AYOT5",body:"Accordion-module_body__4IgEa",content:"Accordion-module_content__RyBzl",isOpen:"Accordion-module_isOpen__Bmf-c",flexWide:"Accordion-module_flexWide__Pmyu-",slidein:"Accordion-module_slidein__NIsrY",fadeInOut:"Accordion-module_fadeInOut__Ub-rg",heightAnimation:"Accordion-module_heightAnimation__nT1oQ",fadein:"Accordion-module_fadein__KprHu",floatAnimation:"Accordion-module_floatAnimation__d-fsP"},S={tooltip:"Tooltip-module_tooltip__LjRUX",hint:"Tooltip-module_hint__ZdhCh",top:"Tooltip-module_top__HZqEk",bottom:"Tooltip-module_bottom__hrxCa",right:"Tooltip-module_right__LGQTD",left:"Tooltip-module_left__-LZ0w",flexWide:"Tooltip-module_flexWide__dQnBf",slidein:"Tooltip-module_slidein__Yziit",fadeInOut:"Tooltip-module_fadeInOut__glWW2",heightAnimation:"Tooltip-module_heightAnimation__5cr8-",fadein:"Tooltip-module_fadein__NGjXx",floatAnimation:"Tooltip-module_floatAnimation__R4QxW"};exports.Accordion=function(n){var t=n.title,i=n.content,d=o.useState(!1),r=d[0],_=d[1];return e.jsxs("div",{className:l(T,{container:!0,isOpen:r}),onClick:function(){return _(!r)},children:[e.jsxs("div",{className:T.header,children:[e.jsx("h3",{children:t}),e.jsx(a,{icon:r?h:p,size:"md"})]}),e.jsx("div",{className:T.body,children:e.jsx("div",{className:T.content,children:i})})]})},exports.Avatar=x,exports.Button=A,exports.DropDown=function(n){var t=n.action,i=n.menu,d=n.type,a=void 0===d?exports.UIElementType.DEFAULT:d,r=n.closeRef,_=n.actionSize,u=void 0===_?"medium":_,s=o.useRef(null),c=o.useRef(null),m=o.useRef(null),h=o.useState(!1),p=h[0],f=h[1],g=function(){return f(!1)};return o.useEffect((function(){(null==r?void 0:r.current)&&(r.current={close:function(){return g()}})}),[r]),e.jsxs("div",{className:w.container,ref:s,children:[e.jsx("div",{className:l(w,{action:!0},[w[a],w[u]]),ref:m,onClick:function(){return f(!p)},children:t}),e.jsx(b,{containerRef:s,contentRef:c,isOpen:p,onClose:g,renderChild:function(){return e.jsx("div",{className:w.menuContainer,ref:c,children:e.jsx(C,{children:i})})}})]})},exports.IconButton=function(n){var t=n.icon,i=n.onClick,d=n.type,r=void 0===d?exports.UIElementType.DEFAULT:d,_=n.needConfirm,u=void 0!==_&&_,s=n.noPadding,c=void 0!==s&&s,m=n.isLoading,h=void 0!==m&&m,p=n.size,f=void 0===p?"sm":p,g=n.confirmPosition,x=void 0===g?"top":g,v=o.useState(!1),I=v[0],k=v[1];return e.jsxs("div",{className:l(L,{iconButton:!0,noPadding:c},[L[r],L[f]]),onClick:h?void 0:u?function(){return k(!I)}:i,children:[e.jsx(a,{isLoading:h,icon:t,size:f}),I&&e.jsxs("div",{className:"".concat(L.confirm," ").concat(L[x]),children:[e.jsx("div",{className:L.confirmMessage,children:"Are you sure?"}),e.jsxs("div",{className:L.confirmActions,children:[e.jsx(A,{type:exports.UIElementType.DANGER,onClick:function(){return k(!1)},label:"No",size:"small"}),e.jsx(A,{type:exports.UIElementType.SUCCESS,onClick:i,label:"Yes",size:"small"})]})]})]})},exports.Input=j,exports.Link=function(o){var n=o.href,t=o.title,i=o.target,d=void 0===i?"_self":i,r=o.type,_=void 0===r?exports.UIElementType.DEFAULT:r,u=o.padding,s=void 0===u?"zero":u,m=o.hasChevron,h=void 0!==m&&m,p=o.fullWidth,f=void 0!==p&&p;return e.jsxs("a",{href:n,target:d,rel:"noopener noreferrer",className:l(D,{link:!0,fullWidth:f},[D[_],D[s]]),children:[e.jsx("span",{children:t})," ",h&&e.jsx(a,{icon:c})]})},exports.ListItem=function(o){var n=o.title,t=o.subtitle,i=o.actionTitle,d=void 0===i?"":i,r=o.action,_=o.completed,u=o.indicator,c=o.hasSeparator,m=void 0!==c&&c,h=o.hasDashedSeparator,p=void 0!==h&&h,f=o.isActionPending,g=void 0!==f&&f;return e.jsxs("div",{className:l(k,{listItem:!0,separator:m,dashedSeparator:p}),children:[e.jsxs("div",{className:k.content,children:[u&&e.jsx("div",{className:l(k,{indicator:!0},[k[u]])}),e.jsxs("div",{className:k.data,children:[e.jsx("div",{className:k.title,children:n}),t&&e.jsx("div",{className:k.subtitle,children:t})]})]}),r&&e.jsx(A,{onClick:r,className:k.action,label:d,isLoading:g}),_&&e.jsx("div",{className:k.completed,children:e.jsx(a,{icon:s})})]})},exports.LoadingItem=function(o){var n=o.shape,t=void 0===n?"square":n,i=o.size,d=void 0===i?"md":i,a=o.width,r=o.height;return e.jsx("div",{className:l(N,{container:!0},[N[t],N[d]]),style:{width:a,height:r}})},exports.SVGIcon=a,exports.Tooltip=function(o){var n=o.hint,t=o.children,i=o.position,l=void 0===i?"top":i;return e.jsxs("div",{className:S.tooltip,children:[!!n&&e.jsx("div",{className:"".concat(S.hint," ").concat(S[l]),children:n}),t]})},exports.classNames=l,exports.isEmpty=function(e){return null==e||("object"==typeof e?Array.isArray(e)?0===e.length:e instanceof Set||e instanceof Map?0===e.size:0===Object.keys(e).length:"string"==typeof e&&0===e.length)},exports.useClickOutside=B,exports.useClickOutsideRef=function(e){var n=o.useRef(null),t=o.useCallback((function(o){n.current&&!n.current.contains(o.target)&&e()}),[e]);return o.useEffect((function(){return document.addEventListener("click",t),function(){document.removeEventListener("click",t)}}),[t]),n}; | ||
//# sourceMappingURL=index.js.map |
export declare const useClickOutside: (ref: any, callback: () => void) => void; | ||
export declare const useClickOutsideRef: (callback: () => void) => import("react").MutableRefObject<any>; |
{ | ||
"name": "@sorocraft/ui", | ||
"version": "1.0.17", | ||
"version": "1.0.18", | ||
"description": "UI Library by sorocraft.com", | ||
@@ -5,0 +5,0 @@ "main": "dist/index.js", |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
722611
123
1530