1mpacto-react-ui 0.0.118 → 0.0.119

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs CHANGED
@@ -142,7 +142,7 @@ You should wrap it with \`css\` like this:
142
142
  Prefix can't start with '-' when allowNegative is true.
143
143
  prefix: `+i+`
144
144
  allowNegative: `+a+`
145
- `),a=!1),Object.assign(Object.assign({},e),{allowNegative:a})}function GT(e){e=zT(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,i=e.onKeyDown;i===void 0&&(i=mr);var a=e.onBlur;a===void 0&&(a=mr);var o=e.thousandSeparator,s=e.decimalScale,l=e.fixedDecimalScale,u=e.prefix;u===void 0&&(u="");var c=e.defaultValue,d=e.value,h=e.valueIsNumericString,f=e.onValueChange,g=Ph(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),p=Wu(e),b=p.decimalSeparator,v=p.allowedDecimalSeparators,y=function(k){return B0(k,e)},x=function(k,T){return jT(k,T,e)},S=Si(d)?c:d,D=h??HT(S,u,t);Si(d)?Si(c)||(D=D||typeof c=="number"):D=D||typeof d=="number";var $=function(k){return c3(k)?k:(typeof k=="number"&&(k=h3(k)),D&&typeof s=="number"?M0(k,s,!!l):k)},F=b3($(d),$(c),!!D,y,x,f),m=F[0],C=m.numAsString,I=m.formattedValue,E=F[1],R=function(k){var T=k.target,B=k.key,O=T.selectionStart,L=T.selectionEnd,j=T.value;if(j===void 0&&(j=""),(B==="Backspace"||B==="Delete")&&L<u.length){k.preventDefault();return}if(O!==L){i(k);return}B==="Backspace"&&j[0]==="-"&&O===u.length+1&&n&&Or(T,1),s&&l&&(B==="Backspace"&&j[O-1]===b?(Or(T,O-1),k.preventDefault()):B==="Delete"&&j[O]===b&&k.preventDefault()),v!=null&&v.includes(B)&&j[O]===b&&Or(T,O+1);var z=o===!0?",":o;B==="Backspace"&&j[O-1]===z&&Or(T,O-1),B==="Delete"&&j[O]===z&&Or(T,O+1),i(k)},P=function(k){var T=C;if(T.match(/\d/g)||(T=""),r||(T=AT(T)),l&&s&&(T=M0(T,s,l)),T!==C){var B=B0(T,e);E({formattedValue:B,value:T,floatValue:parseFloat(T)},{event:k,source:Xo.event})}a(k)},A=function(k){return k===b?!0:Ti(k)},M=function(k){var T=k.currentValue,B=k.lastValue,O=k.formattedValue,L=k.currentValueIndex,j=k.formattedValueIndex,z=T[L],Y=O[j],G=g3(B,T),H=G.to;return L>=H.start&&L<H.end&&v&&v.includes(z)&&Y===b?!0:z===Y};return Object.assign(Object.assign({},g),{value:I,valueIsNumericString:!1,isValidInputCharacter:A,isCharacterSame:M,onValueChange:E,format:y,removeFormatting:x,getCaretBoundary:function(k){return WT(k,e)},onKeyDown:R,onBlur:P})}function XT(e){var t=GT(e);return w.createElement(v3,Object.assign({},t))}function ZT(e,t){var n=t.format,r=t.allowEmptyFormatting,i=t.mask,a=t.patternChar;if(a===void 0&&(a="#"),e===""&&!r)return"";for(var o=0,s=n.split(""),l=0,u=n.length;l<u;l++)n[l]===a&&(s[l]=e[o]||p3(i,o),o+=1);return s.join("")}function YT(e,t,n){t===void 0&&(t=m3(e));var r=n.format,i=n.patternChar;i===void 0&&(i="#");var a=t.from,o=t.to,s=t.lastValue;s===void 0&&(s="");var l=function(b){return r[b]===i},u=function(b,v){for(var y="",x=0;x<b.length;x++)l(v+x)&&Ti(b[x])&&(y+=b[x]);return y},c=function(b){return b.replace(/[^0-9]/g,"")};if(!r.match(/\d/))return c(e);if((s===""||a.end-a.start===s.length)&&e.length===r.length){for(var d="",h=0;h<e.length;h++)if(l(h))Ti(e[h])&&(d+=e[h]);else if(e[h]!==r[h])return c(e);return d}var f=s.substring(0,a.start),g=e.substring(o.start,o.end),p=s.substring(a.end);return""+u(f,0)+c(g)+u(p,a.end)}function UT(e,t){var n=t.format,r=t.mask,i=t.patternChar;i===void 0&&(i="#");var a=Array.from({length:e.length+1}).map(function(){return!0}),o=0,s=-1,l={};n.split("").forEach(function(h,f){var g=void 0;h===i&&(o++,g=p3(r,o-1),s===-1&&e[f]===g&&(s=f)),l[f]=g});for(var u=function(h){return n[h]===i&&e[h]!==l[h]},c=0,d=a.length;c<d;c++)a[c]=c===s||u(c)||u(c-1);return a[n.indexOf(i)]=!0,a}function JT(e){var t=e.mask;if(t){var n=t==="string"?t:t.toString();if(n.match(/\d/g))throw new Error("Mask "+t+" should not contain numeric character;")}}function KT(e,t){return e===""?!0:!(t!=null&&t.match(/\d/))&&typeof e=="string"&&(!!e.match(/^\d+$/)||e==="")}function qT(e){e.mask,e.allowEmptyFormatting;var t=e.format,n=e.inputMode;n===void 0&&(n="numeric");var r=e.onKeyDown;r===void 0&&(r=mr);var i=e.patternChar;i===void 0&&(i="#");var a=e.value,o=e.defaultValue,s=e.valueIsNumericString,l=Ph(e,["mask","allowEmptyFormatting","format","inputMode","onKeyDown","patternChar","value","defaultValue","valueIsNumericString"]);JT(e);var u=function(g){return UT(g,e)},c=function(g){var p=g.key,b=g.target,v=b.selectionStart,y=b.selectionEnd,x=b.value;if(v!==y){r(g);return}var S=v;if(p==="Backspace"||p==="Delete"){var D="right";if(p==="Backspace"){for(;S>0&&t[S-1]!==i;)S--;D="left"}else{for(var $=t.length;S<$&&t[S]!==i;)S++;D="right"}S=au(x,S,u(x),D)}else t[S]!==i&&p!=="ArrowLeft"&&p!=="ArrowRight"&&(S=au(x,S+1,u(x),"right"));S!==v&&Or(b,S),r(g)},d=Si(a)?o:a,h=s??KT(d,t),f=Object.assign(Object.assign({},e),{valueIsNumericString:h});return Object.assign(Object.assign({},l),{value:a,defaultValue:o,valueIsNumericString:h,inputMode:n,format:function(g){return ZT(g,f)},removeFormatting:function(g,p){return YT(g,p,f)},getCaretBoundary:u,onKeyDown:c})}function QT(e){var t=qT(e);return w.createElement(v3,Object.assign({},t))}const eP=({max:e,min:t,selectedText:n="Rp0",onChange:r,onFocusInput:i,...a})=>_.jsx(XT,{isAllowed:o=>e!==void 0&&Qn(e)&&nt(o.value).isGreaterThan(e)?(typeof r=="function"&&r({target:{value:nt(e).toString()}}),!1):t!==void 0&&Qn(t)&&nt(o.value).isLessThan(t)?(typeof r=="function"&&r({target:{value:nt(t).toString()}}),!1):!0,onValueChange:(o,{source:s})=>{typeof r=="function"&&s.includes("event")&&r({target:{value:o.value}})},decimalSeparator:",",thousandSeparator:".",decimalScale:2,valueIsNumericString:!0,thousandsGroupStyle:"thousand",onFocus:o=>{var s;((s=o==null?void 0:o.target)==null?void 0:s.value)===n&&(typeof i=="function"?i(""):typeof r=="function"&&r({target:{value:""}}))},...a}),tP=({children:e,containerId:t="portal-root"})=>{const[n,r]=w.useState(null);return w.useEffect(()=>{let i=document.getElementById(t),a=!1;return i||(i=document.createElement("div"),i.id=t,document.body.appendChild(i),a=!0),r(i),()=>{a&&i&&document.body.removeChild(i)}},[t]),n?ts.createPortal(e,n):null},nP={"button-remove":"_button-remove_1o2yg_1"},rP=()=>_.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:_.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.19544 6.19126C6.32045 6.06628 6.48999 5.99607 6.66677 5.99607C6.84354 5.99607 7.01308 6.06628 7.1381 6.19126L10.0001 9.05326L12.8621 6.19126C12.9236 6.12758 12.9972 6.0768 13.0785 6.04186C13.1598 6.00692 13.2473 5.98853 13.3358 5.98776C13.4244 5.98699 13.5121 6.00386 13.5941 6.03738C13.676 6.0709 13.7504 6.1204 13.813 6.18299C13.8756 6.24559 13.9251 6.32002 13.9587 6.40195C13.9922 6.48389 14.009 6.57167 14.0083 6.66019C14.0075 6.74871 13.9891 6.83619 13.9542 6.91753C13.9192 6.99886 13.8684 7.07243 13.8048 7.13392L10.9428 9.99592L13.8048 12.8579C13.9262 12.9837 13.9934 13.1521 13.9919 13.3269C13.9904 13.5017 13.9203 13.6689 13.7966 13.7925C13.673 13.9161 13.5058 13.9862 13.331 13.9877C13.1562 13.9892 12.9878 13.922 12.8621 13.8006L10.0001 10.9386L7.1381 13.8006C7.01237 13.922 6.84397 13.9892 6.66917 13.9877C6.49437 13.9862 6.32716 13.9161 6.20356 13.7925C6.07995 13.6689 6.00984 13.5017 6.00832 13.3269C6.0068 13.1521 6.074 12.9837 6.19544 12.8579L9.05744 9.99592L6.19544 7.13392C6.07045 7.00891 6.00024 6.83937 6.00024 6.66259C6.00024 6.48581 6.07045 6.31628 6.19544 6.19126Z",fill:"#212121"})}),iP=()=>_.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:_.jsx("path",{d:"M2 11.3334V4.66671C2 4.31309 2.14048 3.97395 2.39052 3.7239C2.64057 3.47385 2.97971 3.33337 3.33333 3.33337H7.33333L8.66667 4.66671H12.6667C13.0203 4.66671 13.3594 4.80718 13.6095 5.05723C13.8595 5.30728 14 5.64642 14 6.00004V11.3334C14 11.687 13.8595 12.0261 13.6095 12.2762C13.3594 12.5262 13.0203 12.6667 12.6667 12.6667H3.33333C2.97971 12.6667 2.64057 12.5262 2.39052 12.2762C2.14048 12.0261 2 11.687 2 11.3334Z",stroke:"#9E9E9E",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),y3=e=>{const t=w.useRef(null),{fileName:n,onChange:r,maxFile:i,maxSize:a=2,validateFile:o,error:s,label:l,inputProps:u,priorityError:c="external",eventError:d}=e,h=o||["image/png","image/jpeg","image/jpg"],[f,g]=w.useState(""),p={internal:f||s,external:s||f},b=x=>{if(x!=null&&x.length){const S=x[0],D=S.size/1024/1024;let $="";if(h.some(F=>{var m;return(m=x[0].type)==null?void 0:m.includes(F)})?D>a?$=`${x.length>1?"Jumlah u":"U"}kuran berkas tidak boleh melebihi ${a}MB.`:r(S):$="Berkas tidak didukung, silahkan pilih file kembali.",g($),d==null||d($),!(t!=null&&t.current))return;t.current.value=""}},v=x=>{var S;x.preventDefault(),t!=null&&t.current&&((S=t.current)==null||S.click())},y=x=>{x.preventDefault(),t!=null&&t.current&&(r(null),t.current.value="")};return _.jsxs(_.Fragment,{children:[_.jsx("input",{accept:h==null?void 0:h.join(", "),ref:t,hidden:!0,type:"file",max:i,onChange:x=>{b(x.target.files)}}),_.jsx(Ef,{sizeInput:"medium",placeholder:"Pilih Berkas",label:l,value:n,readOnly:!0,onClick:x=>v(x),startIcon:_.jsx(iP,{}),endIcon:n&&_.jsx("div",{className:nP["button-remove"],onClick:x=>y(x),children:_.jsx(rP,{})}),error:p[c],...u})]})};y3.displayName="UploadFile";const aP=({children:e,initialVisibleCount:t,maxWidth:n,moreElement:r,style:i={},className:a,gap:o=0,gapStyle:s,...l})=>{const[u,c]=w.useState(e),[d,h]=w.useState(0),f=w.useRef(new Array(t).fill(null)),g=w.useRef(null),p=w.useCallback(()=>{var D;const y=((D=g.current)==null?void 0:D.offsetWidth)??0;let x=0,S=0;f.current.forEach(($,F)=>{$&&(x+=$.offsetWidth,F>0&&(x+=o),x<=y&&S++)}),c(w.Children.toArray(e).slice(0,S)),h(w.Children.count(e)-S)},[e,o]);w.useEffect(()=>(p(),window.addEventListener("resize",p),()=>{window.removeEventListener("resize",p)}),[p]);const b=w.useMemo(()=>w.Children.map(u,(y,x)=>w.cloneElement(y,{ref:S=>f.current[x]=S,key:`child-${x}`})),[u]),v={overflow:"hidden",display:"flex",flexWrap:"nowrap",gap:s??0,...i};return n&&(v.maxWidth=n),_.jsxs(_.Fragment,{children:[_.jsx("div",{ref:g,style:v,className:a??"",...l,children:b}),d>0&&_.jsx(_.Fragment,{children:r(d)})]})},oP="_container_1wopr_1",sP="_image_1wopr_5",sr={container:oP,"image-content":"_image-content_1wopr_5",image:sP,"text-desc":"_text-desc_1wopr_13","action-content":"_action-content_1wopr_20","button-content":"_button-content_1wopr_24","text-error":"_text-error_1wopr_31"},lP=({className:e})=>_.jsx("svg",{viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",className:`1ru-h-5 1ru-w-5 1ru-text-red-600 ${e??""}`,fill:"currentColor",children:_.jsx("g",{id:"x",children:_.jsx("path",{id:"Vector",fillRule:"evenodd",clipRule:"evenodd",d:`M6.19544 6.19126C6.32045 6.06628 6.48999 5.99607 6.66677 5.99607C6.84354 5.99607 7.01308 6.06628 7.1381 \r
145
+ `),a=!1),Object.assign(Object.assign({},e),{allowNegative:a})}function GT(e){e=zT(e),e.decimalSeparator,e.allowedDecimalSeparators,e.thousandsGroupStyle;var t=e.suffix,n=e.allowNegative,r=e.allowLeadingZeros,i=e.onKeyDown;i===void 0&&(i=mr);var a=e.onBlur;a===void 0&&(a=mr);var o=e.thousandSeparator,s=e.decimalScale,l=e.fixedDecimalScale,u=e.prefix;u===void 0&&(u="");var c=e.defaultValue,d=e.value,h=e.valueIsNumericString,f=e.onValueChange,g=Ph(e,["decimalSeparator","allowedDecimalSeparators","thousandsGroupStyle","suffix","allowNegative","allowLeadingZeros","onKeyDown","onBlur","thousandSeparator","decimalScale","fixedDecimalScale","prefix","defaultValue","value","valueIsNumericString","onValueChange"]),p=Wu(e),b=p.decimalSeparator,v=p.allowedDecimalSeparators,y=function(k){return B0(k,e)},x=function(k,T){return jT(k,T,e)},S=Si(d)?c:d,D=h??HT(S,u,t);Si(d)?Si(c)||(D=D||typeof c=="number"):D=D||typeof d=="number";var $=function(k){return c3(k)?k:(typeof k=="number"&&(k=h3(k)),D&&typeof s=="number"?M0(k,s,!!l):k)},F=b3($(d),$(c),!!D,y,x,f),m=F[0],C=m.numAsString,I=m.formattedValue,E=F[1],R=function(k){var T=k.target,B=k.key,O=T.selectionStart,L=T.selectionEnd,j=T.value;if(j===void 0&&(j=""),(B==="Backspace"||B==="Delete")&&L<u.length){k.preventDefault();return}if(O!==L){i(k);return}B==="Backspace"&&j[0]==="-"&&O===u.length+1&&n&&Or(T,1),s&&l&&(B==="Backspace"&&j[O-1]===b?(Or(T,O-1),k.preventDefault()):B==="Delete"&&j[O]===b&&k.preventDefault()),v!=null&&v.includes(B)&&j[O]===b&&Or(T,O+1);var z=o===!0?",":o;B==="Backspace"&&j[O-1]===z&&Or(T,O-1),B==="Delete"&&j[O]===z&&Or(T,O+1),i(k)},P=function(k){var T=C;if(T.match(/\d/g)||(T=""),r||(T=AT(T)),l&&s&&(T=M0(T,s,l)),T!==C){var B=B0(T,e);E({formattedValue:B,value:T,floatValue:parseFloat(T)},{event:k,source:Xo.event})}a(k)},A=function(k){return k===b?!0:Ti(k)},M=function(k){var T=k.currentValue,B=k.lastValue,O=k.formattedValue,L=k.currentValueIndex,j=k.formattedValueIndex,z=T[L],Y=O[j],G=g3(B,T),H=G.to;return L>=H.start&&L<H.end&&v&&v.includes(z)&&Y===b?!0:z===Y};return Object.assign(Object.assign({},g),{value:I,valueIsNumericString:!1,isValidInputCharacter:A,isCharacterSame:M,onValueChange:E,format:y,removeFormatting:x,getCaretBoundary:function(k){return WT(k,e)},onKeyDown:R,onBlur:P})}function XT(e){var t=GT(e);return w.createElement(v3,Object.assign({},t))}function ZT(e,t){var n=t.format,r=t.allowEmptyFormatting,i=t.mask,a=t.patternChar;if(a===void 0&&(a="#"),e===""&&!r)return"";for(var o=0,s=n.split(""),l=0,u=n.length;l<u;l++)n[l]===a&&(s[l]=e[o]||p3(i,o),o+=1);return s.join("")}function YT(e,t,n){t===void 0&&(t=m3(e));var r=n.format,i=n.patternChar;i===void 0&&(i="#");var a=t.from,o=t.to,s=t.lastValue;s===void 0&&(s="");var l=function(b){return r[b]===i},u=function(b,v){for(var y="",x=0;x<b.length;x++)l(v+x)&&Ti(b[x])&&(y+=b[x]);return y},c=function(b){return b.replace(/[^0-9]/g,"")};if(!r.match(/\d/))return c(e);if((s===""||a.end-a.start===s.length)&&e.length===r.length){for(var d="",h=0;h<e.length;h++)if(l(h))Ti(e[h])&&(d+=e[h]);else if(e[h]!==r[h])return c(e);return d}var f=s.substring(0,a.start),g=e.substring(o.start,o.end),p=s.substring(a.end);return""+u(f,0)+c(g)+u(p,a.end)}function UT(e,t){var n=t.format,r=t.mask,i=t.patternChar;i===void 0&&(i="#");var a=Array.from({length:e.length+1}).map(function(){return!0}),o=0,s=-1,l={};n.split("").forEach(function(h,f){var g=void 0;h===i&&(o++,g=p3(r,o-1),s===-1&&e[f]===g&&(s=f)),l[f]=g});for(var u=function(h){return n[h]===i&&e[h]!==l[h]},c=0,d=a.length;c<d;c++)a[c]=c===s||u(c)||u(c-1);return a[n.indexOf(i)]=!0,a}function JT(e){var t=e.mask;if(t){var n=t==="string"?t:t.toString();if(n.match(/\d/g))throw new Error("Mask "+t+" should not contain numeric character;")}}function KT(e,t){return e===""?!0:!(t!=null&&t.match(/\d/))&&typeof e=="string"&&(!!e.match(/^\d+$/)||e==="")}function qT(e){e.mask,e.allowEmptyFormatting;var t=e.format,n=e.inputMode;n===void 0&&(n="numeric");var r=e.onKeyDown;r===void 0&&(r=mr);var i=e.patternChar;i===void 0&&(i="#");var a=e.value,o=e.defaultValue,s=e.valueIsNumericString,l=Ph(e,["mask","allowEmptyFormatting","format","inputMode","onKeyDown","patternChar","value","defaultValue","valueIsNumericString"]);JT(e);var u=function(g){return UT(g,e)},c=function(g){var p=g.key,b=g.target,v=b.selectionStart,y=b.selectionEnd,x=b.value;if(v!==y){r(g);return}var S=v;if(p==="Backspace"||p==="Delete"){var D="right";if(p==="Backspace"){for(;S>0&&t[S-1]!==i;)S--;D="left"}else{for(var $=t.length;S<$&&t[S]!==i;)S++;D="right"}S=au(x,S,u(x),D)}else t[S]!==i&&p!=="ArrowLeft"&&p!=="ArrowRight"&&(S=au(x,S+1,u(x),"right"));S!==v&&Or(b,S),r(g)},d=Si(a)?o:a,h=s??KT(d,t),f=Object.assign(Object.assign({},e),{valueIsNumericString:h});return Object.assign(Object.assign({},l),{value:a,defaultValue:o,valueIsNumericString:h,inputMode:n,format:function(g){return ZT(g,f)},removeFormatting:function(g,p){return YT(g,p,f)},getCaretBoundary:u,onKeyDown:c})}function QT(e){var t=qT(e);return w.createElement(v3,Object.assign({},t))}const eP=({max:e,min:t,selectedText:n="Rp0",onChange:r,onFocusInput:i,...a})=>_.jsx(XT,{isAllowed:o=>e!==void 0&&Qn(e)&&nt(o.value).isGreaterThan(e)?(typeof r=="function"&&r({target:{value:nt(e).toString()}}),!1):t!==void 0&&Qn(t)&&nt(o.value).isLessThan(t)?(typeof r=="function"&&r({target:{value:nt(t).toString()}}),!1):!0,onValueChange:(o,{source:s})=>{typeof r=="function"&&s.includes("event")&&r({target:{value:o.value}})},decimalSeparator:",",thousandSeparator:".",decimalScale:2,valueIsNumericString:!0,thousandsGroupStyle:"thousand",onFocus:o=>{var s;((s=o==null?void 0:o.target)==null?void 0:s.value)===n&&(typeof i=="function"?i(""):typeof r=="function"&&r({target:{value:""}}))},...a}),tP=({children:e,containerId:t="portal-root"})=>{const[n,r]=w.useState(null);return w.useEffect(()=>{let i=document.getElementById(t),a=!1;return i||(i=document.createElement("div"),i.id=t,document.body.appendChild(i),a=!0),r(i),()=>{a&&i&&document.body.removeChild(i)}},[t]),n?ts.createPortal(e,n):null},nP={"button-remove":"_button-remove_1o2yg_1"},rP=()=>_.jsx("svg",{width:"20",height:"20",viewBox:"0 0 20 20",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:_.jsx("path",{fillRule:"evenodd",clipRule:"evenodd",d:"M6.19544 6.19126C6.32045 6.06628 6.48999 5.99607 6.66677 5.99607C6.84354 5.99607 7.01308 6.06628 7.1381 6.19126L10.0001 9.05326L12.8621 6.19126C12.9236 6.12758 12.9972 6.0768 13.0785 6.04186C13.1598 6.00692 13.2473 5.98853 13.3358 5.98776C13.4244 5.98699 13.5121 6.00386 13.5941 6.03738C13.676 6.0709 13.7504 6.1204 13.813 6.18299C13.8756 6.24559 13.9251 6.32002 13.9587 6.40195C13.9922 6.48389 14.009 6.57167 14.0083 6.66019C14.0075 6.74871 13.9891 6.83619 13.9542 6.91753C13.9192 6.99886 13.8684 7.07243 13.8048 7.13392L10.9428 9.99592L13.8048 12.8579C13.9262 12.9837 13.9934 13.1521 13.9919 13.3269C13.9904 13.5017 13.9203 13.6689 13.7966 13.7925C13.673 13.9161 13.5058 13.9862 13.331 13.9877C13.1562 13.9892 12.9878 13.922 12.8621 13.8006L10.0001 10.9386L7.1381 13.8006C7.01237 13.922 6.84397 13.9892 6.66917 13.9877C6.49437 13.9862 6.32716 13.9161 6.20356 13.7925C6.07995 13.6689 6.00984 13.5017 6.00832 13.3269C6.0068 13.1521 6.074 12.9837 6.19544 12.8579L9.05744 9.99592L6.19544 7.13392C6.07045 7.00891 6.00024 6.83937 6.00024 6.66259C6.00024 6.48581 6.07045 6.31628 6.19544 6.19126Z",fill:"#212121"})}),iP=()=>_.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none",children:_.jsx("path",{d:"M2 11.3334V4.66671C2 4.31309 2.14048 3.97395 2.39052 3.7239C2.64057 3.47385 2.97971 3.33337 3.33333 3.33337H7.33333L8.66667 4.66671H12.6667C13.0203 4.66671 13.3594 4.80718 13.6095 5.05723C13.8595 5.30728 14 5.64642 14 6.00004V11.3334C14 11.687 13.8595 12.0261 13.6095 12.2762C13.3594 12.5262 13.0203 12.6667 12.6667 12.6667H3.33333C2.97971 12.6667 2.64057 12.5262 2.39052 12.2762C2.14048 12.0261 2 11.687 2 11.3334Z",stroke:"#9E9E9E",strokeWidth:"2",strokeLinecap:"round",strokeLinejoin:"round"})}),y3=e=>{const t=w.useRef(null),{fileName:n,onChange:r,maxFile:i,maxSize:a=2,validateFile:o,error:s,label:l,inputProps:u,priorityError:c="external",eventError:d}=e,h=o||["image/png","image/jpeg","image/jpg"],[f,g]=w.useState(""),p={internal:f||s,external:s||f},b=x=>{if(x!=null&&x.length){const S=x[0],D=S.size/1024/1024;let $="";if(h.some(F=>{var m;return(m=x[0].type)==null?void 0:m.includes(F)})?D>a?$=`${x.length>1?"Jumlah u":"U"}kuran berkas tidak boleh melebihi ${a}MB.`:r(S):$="Berkas tidak didukung, silahkan pilih file kembali.",g($),d==null||d($),!(t!=null&&t.current))return;t.current.value=""}},v=x=>{var S;x.preventDefault(),t!=null&&t.current&&((S=t.current)==null||S.click())},y=x=>{x.preventDefault(),t!=null&&t.current&&(r(null),t.current.value="")};return _.jsxs(_.Fragment,{children:[_.jsx("input",{accept:h==null?void 0:h.join(", "),ref:t,hidden:!0,type:"file",max:i,onChange:x=>{b(x.target.files)}}),_.jsx(Ef,{sizeInput:"medium",placeholder:"Pilih Berkas",label:l,value:n,readOnly:!0,onClick:x=>v(x),startIcon:_.jsx(iP,{}),endIcon:n&&_.jsx("div",{className:nP["button-remove"],onClick:x=>y(x),children:_.jsx(rP,{})}),error:p[c],...u})]})};y3.displayName="UploadFile";const aP=({children:e,initialVisibleCount:t,maxWidth:n,moreElement:r,style:i={},className:a,gap:o=0,gapStyle:s,watchChildren:l=!1,...u})=>{const[c,d]=w.useState(l?[]:e),[h,f]=w.useState(0),g=w.useRef(new Array(t).fill(null)),p=w.useRef(null),b=w.useCallback(()=>{var $;const x=(($=p.current)==null?void 0:$.offsetWidth)??0;let S=0,D=0;g.current.forEach((F,m)=>{F&&(S+=F.offsetWidth,m>0&&(S+=o),S<=x&&D++)}),d(w.Children.toArray(e).slice(0,D)),f(w.Children.count(e)-D)},[c,o]);w.useEffect(()=>(b(),window.addEventListener("resize",b),()=>{window.removeEventListener("resize",b)}),[b]);const v=w.useMemo(()=>w.Children.map(c,(x,S)=>w.cloneElement(x,{ref:D=>g.current[S]=D,key:`child-${S}`})),[c]);w.useEffect(()=>{l&&d(e)},[e]);const y={overflow:"hidden",display:"flex",flexWrap:"nowrap",gap:s??0,...i};return n&&(y.maxWidth=n),_.jsxs(_.Fragment,{children:[_.jsx("div",{ref:p,style:y,className:a??"",...u,children:v}),h>0&&_.jsx(_.Fragment,{children:r(h)})]})},oP="_container_1wopr_1",sP="_image_1wopr_5",sr={container:oP,"image-content":"_image-content_1wopr_5",image:sP,"text-desc":"_text-desc_1wopr_13","action-content":"_action-content_1wopr_20","button-content":"_button-content_1wopr_24","text-error":"_text-error_1wopr_31"},lP=({className:e})=>_.jsx("svg",{viewBox:"0 0 20 20",xmlns:"http://www.w3.org/2000/svg",className:`1ru-h-5 1ru-w-5 1ru-text-red-600 ${e??""}`,fill:"currentColor",children:_.jsx("g",{id:"x",children:_.jsx("path",{id:"Vector",fillRule:"evenodd",clipRule:"evenodd",d:`M6.19544 6.19126C6.32045 6.06628 6.48999 5.99607 6.66677 5.99607C6.84354 5.99607 7.01308 6.06628 7.1381 \r
146
146
  6.19126L10.0001 9.05326L12.8621 6.19126C12.9236 6.12758 12.9972 6.0768 13.0785 6.04186C13.1598 6.00692 13.2473 \r
147
147
  5.98853 13.3358 5.98776C13.4244 5.98699 13.5121 6.00386 13.5941 6.03738C13.676 6.0709 13.7504 6.1204 13.813 \r
148
148
  6.18299C13.8756 6.24559 13.9251 6.32002 13.9587 6.40195C13.9922 6.48389 14.009 6.57167 14.0083 6.66019C14.0075 \r
@@ -180,7 +180,7 @@ You should wrap it with \`css\` like this:
180
180
  ${f()?vn["isset-left-icon"]:""}
181
181
  ${g()?vn["isset-right-icon"]:""}
182
182
  ${u??""}`,ref:d,type:r,...c}),_.jsxs("div",{className:vn["end-icon"],children:[typeof a=="function"&&a(),w.isValidElement(a)&&a]})]}),o&&_.jsx("label",{className:`${vn["label-error"]}
183
- ${c.disabled?vn.disabled:""} ${l??""}`,children:o})]})});qh.displayName="InputNative";const E8="_container_1szxn_1",I8="_files_1szxn_4",_8="_file_1szxn_4",Qi={container:E8,files:I8,file:_8,"file-name-wrapper":"_file-name-wrapper_1szxn_10","file-name":"_file-name_1szxn_10","file-extension":"_file-extension_1szxn_13"},$8=({value:e,validateFile:t,classNameContainer:n,classNameButton:r,textUpload:i="Unggah Lampiran",buttonProps:a={},maxFile:o=1,maxSize:s=1,error:l,removeElement:u,onChange:c,handlerDownload:d,priorityError:h="external",eventError:f})=>{const g={variants:"ghost-laba-blue-10",size:"small"},p=w.useRef(null),b=t||["image/png","image/jpeg","image/jpg"],[v,y]=w.useState(""),x={internal:v||l,external:l||v},S=F=>{if(F!=null&&F.length){const m=Array.from(F).slice(0,o),C=m==null?void 0:m.filter(R=>!b.includes(R.type)),I=(m==null?void 0:m.reduce((R,P)=>R+P.size,0))/1024/1024;let E="";if(C.length>0?E="Berkas tidak didukung, silahkan pilih file kembali.":I>s?E=`${F.length>1?"Jumlah u":"U"}kuran berkas tidak boleh melebihi ${s}MB.`:typeof c=="function"&&c(m),y(E),f==null||f(E),!(p!=null&&p.current))return;p.current.value=""}},D=F=>{var m;F.preventDefault(),p!=null&&p.current&&((m=p.current)==null||m.click())};function $(F){if(typeof F!="string")throw new Error("Input harus berupa string");const m=F.split(".");if(m.length===1)return{filename:F,extension:""};const C="."+m[m.length-1];return{filename:m.slice(0,-1).join("."),extension:C}}return _.jsxs("div",{className:`${Qi.container} ${n??""}`,children:[_.jsx(Mn,{...g,...a,className:r??"",onClick:F=>D(F),children:i}),_.jsx(qh,{accept:b==null?void 0:b.join(", "),ref:p,type:"file",onChange:F=>S(F.target.files),error:x[h],multiple:o>1,hidden:!0}),_.jsx("div",{className:Qi.files,children:e==null?void 0:e.map((F,m)=>_.jsxs("div",{className:Qi.file,onClick:C=>{C.stopPropagation(),typeof d=="function"&&d(F)},children:[_.jsxs("div",{className:Qi["file-name-wrapper"],children:[_.jsx("span",{className:Qi["file-name"],children:$((F==null?void 0:F.originalName)??(F==null?void 0:F.name)??(F==null?void 0:F.fileName)??"").filename}),_.jsx("span",{className:Qi["file-extension"],children:$((F==null?void 0:F.originalName)??(F==null?void 0:F.name)??(F==null?void 0:F.fileName)??"").extension})]}),typeof u=="function"&&_.jsx(_.Fragment,{children:u(F)})]},m))})]})},qp={"error-payhere":"_error-payhere_1hkqz_1","error-laba":"_error-laba_1hkqz_5"},R8=({className:e,variants:t="laba",error:n})=>{const r={variants:{laba:qp["error-laba"],payhere:qp["error-payhere"]}};return _.jsx(_.Fragment,{children:n?_.jsx("span",{className:`${r.variants[t]} ${e??""}`,children:n}):_.jsx(_.Fragment,{})})},A8="_container_5yc5a_1",F8="_textarea_5yc5a_7",T8="_label_5yc5a_36",P8="_error_5yc5a_44",ur={container:A8,"size-medium":"_size-medium_5yc5a_1","container-textarea":"_container-textarea_5yc5a_4",textarea:F8,"placeholder-shown":"_placeholder-shown_5yc5a_24",label:T8,error:P8,"label-error":"_label-error_5yc5a_60"},cC=w.forwardRef((e,t)=>{const{isRequired:n,classNameContainer:r,className:i,classNameLabel:a,classNameLabelError:o,name:s,id:l,label:u,error:c,height:d,minHeight:h=94,maxHeight:f=150,style:g,sizeInput:p="medium",translateLabel:b=20,autoTranslateLabel:v=!1,...y}=e,x=w.useRef(null),S=Yf(x,t),D=w.useRef(null),$={...g??{},maxHeight:f,height:d??h,minHeight:h},[F,m]=w.useState(!1),[C,I]=w.useState(!1),[E,R]=w.useState(b),P={size:{medium:ur["size-medium"]}},A=()=>{var B;y.value===""||((B=x.current)==null?void 0:B.value)===""?(I(!1),v&&setTimeout(()=>{var z,Y;const O=((z=x.current)==null?void 0:z.offsetHeight)??0,L=((Y=D.current)==null?void 0:Y.offsetHeight)??0,j=(O-L)/2;R(j)},100)):I(!0)},M=function(B){var O;m(!0),A(),(O=e.onFocus)==null||O.call(e,B)},k=function(B){var O;m(!1),(O=e.onBlur)==null||O.call(e,B)},T=function(B){A();const O=(B==null?void 0:B.target)??x.current;O.style.height="0px",O.style.height=O.scrollHeight+"px"};return Zf(()=>(F&&x.current?x.current.addEventListener("input",T):T(),()=>{var B;(B=x.current)==null||B.removeEventListener("input",T)}),[F]),_.jsxs("div",{className:`${ur.container}
183
+ ${c.disabled?vn.disabled:""} ${l??""}`,children:o})]})});qh.displayName="InputNative";const E8="_container_1szxn_1",I8="_files_1szxn_4",_8="_file_1szxn_4",Qi={container:E8,files:I8,file:_8,"file-name-wrapper":"_file-name-wrapper_1szxn_10","file-name":"_file-name_1szxn_10","file-extension":"_file-extension_1szxn_13"},$8=({value:e,validateFile:t,classNameContainer:n,classNameButton:r,textUpload:i="Unggah Lampiran",buttonProps:a={},maxFile:o=1,maxSize:s=1,error:l,removeElement:u,onChange:c,handlerDownload:d,priorityError:h="external",eventError:f})=>{const g={variants:"ghost-laba-blue-10",size:"small"},p=w.useRef(null),b=t||["image/png","image/jpeg","image/jpg"],[v,y]=w.useState(""),x={internal:v||l,external:l||v},S=F=>{if(F!=null&&F.length){const m=Array.from(F).slice(0,o),C=m==null?void 0:m.filter(R=>!b.includes(R.type)),I=(m==null?void 0:m.reduce((R,P)=>R+P.size,0))/1024/1024;let E="";if(C.length>0?E="Berkas tidak didukung, silahkan pilih file kembali.":I>s?E=`${F.length>1?"Jumlah u":"U"}kuran berkas tidak boleh melebihi ${s}MB.`:typeof c=="function"&&c(m),y(E),f==null||f(E),!(p!=null&&p.current))return;p.current.value=""}},D=F=>{var m;F.preventDefault(),p!=null&&p.current&&((m=p.current)==null||m.click())};function $(F){if(typeof F!="string")throw new Error("Input harus berupa string");const m=F.split(".");if(m.length===1)return{filename:F,extension:""};const C="."+m[m.length-1];return{filename:m.slice(0,-1).join("."),extension:C}}return _.jsxs("div",{className:`${Qi.container} ${n??""}`,children:[_.jsx(Mn,{...g,...a,className:r??"",onClick:F=>D(F),children:i}),_.jsx(qh,{accept:b==null?void 0:b.join(", "),ref:p,type:"file",onChange:F=>S(F.target.files),error:x[h],multiple:o>1,hidden:!0}),_.jsx("div",{className:Qi.files,children:e==null?void 0:e.map((F,m)=>_.jsxs("div",{className:Qi.file,onClick:C=>{C.stopPropagation(),typeof d=="function"&&d(F)},children:[_.jsxs("div",{className:Qi["file-name-wrapper"],children:[_.jsx("span",{className:Qi["file-name"],children:$((F==null?void 0:F.originalName)??(F==null?void 0:F.name)??(F==null?void 0:F.fileName)??"").filename}),_.jsx("span",{className:Qi["file-extension"],children:$((F==null?void 0:F.originalName)??(F==null?void 0:F.name)??(F==null?void 0:F.fileName)??"").extension})]}),typeof u=="function"&&_.jsx(_.Fragment,{children:u(F)})]},m))})]})},qp={"error-payhere":"_error-payhere_1hkqz_1","error-laba":"_error-laba_1hkqz_5"},R8=({className:e,variants:t="laba",error:n})=>{const r={variants:{laba:qp["error-laba"],payhere:qp["error-payhere"]}};return _.jsx(_.Fragment,{children:n?_.jsx("span",{className:`${r.variants[t]} ${e??""}`,children:n}):_.jsx(_.Fragment,{})})},A8="_container_5yc5a_1",F8="_textarea_5yc5a_7",T8="_label_5yc5a_36",P8="_error_5yc5a_44",ur={container:A8,"size-medium":"_size-medium_5yc5a_1","container-textarea":"_container-textarea_5yc5a_4",textarea:F8,"placeholder-shown":"_placeholder-shown_5yc5a_24",label:T8,error:P8,"label-error":"_label-error_5yc5a_60"},cC=w.forwardRef((e,t)=>{const{isRequired:n,classNameContainer:r,className:i,classNameLabel:a,classNameLabelError:o,name:s,id:l,label:u,error:c,height:d,minHeight:h=94,maxHeight:f=150,style:g,sizeInput:p="medium",translateLabel:b=20,autoTranslateLabel:v=!1,...y}=e,x=w.useRef(null),S=Yf(x,t),D=w.useRef(null),$={...g??{},maxHeight:f,height:d??h,minHeight:h},[F,m]=w.useState(!1),[C,I]=w.useState(!1),[E,R]=w.useState(b),P={size:{medium:ur["size-medium"]}},A=()=>{var B;["",void 0,null].includes(y.value)||["",void 0,null].includes((B=x.current)==null?void 0:B.value)?(I(!1),v&&setTimeout(()=>{var z,Y;const O=((z=x.current)==null?void 0:z.offsetHeight)??0,L=((Y=D.current)==null?void 0:Y.offsetHeight)??0,j=(O-L)/2;R(j)},100)):I(!0)},M=function(B){var O;m(!0),A(),(O=e.onFocus)==null||O.call(e,B)},k=function(B){var O;m(!1),(O=e.onBlur)==null||O.call(e,B)},T=function(B){A();const O=(B==null?void 0:B.target)??x.current;O.style.height="0px",O.style.height=O.scrollHeight+"px"};return Zf(()=>(F&&x.current?x.current.addEventListener("input",T):T(),()=>{var B;(B=x.current)==null||B.removeEventListener("input",T)}),[F]),_.jsxs("div",{className:`${ur.container}
184
184
  ${P.size[p]}
185
185
  ${r??""}`,children:[_.jsxs("div",{className:`${ur["container-textarea"]}`,children:[_.jsx("textarea",{id:l??s,className:`${C?"":ur["placeholder-shown"]} ${c?ur.error:""}
186
186
  ${ur.textarea}