1mpacto-react-ui 0.0.122 → 0.0.123
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/assets/style.css +1 -1
- package/dist/index.cjs +1 -1
- package/dist/index.mjs +5 -5
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
@@ -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}),I.jsxs("div",{className:vn["end-icon"],children:[typeof a=="function"&&a(),C.isValidElement(a)&&a]})]}),o&&I.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",ea={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=C.useRef(null),v=t||["image/png","image/jpeg","image/jpg"],[b,y]=C.useState(""),x={internal:b||l,external:l||b},S=F=>{if(F!=null&&F.length){const m=Array.from(F).slice(0,o),w=m==null?void 0:m.filter(R=>!v.includes(R.type)),_=(m==null?void 0:m.reduce((R,P)=>R+P.size,0))/1024/1024;let E="";if(w.length>0?E="Berkas tidak didukung, silahkan pilih file kembali.":_>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 A(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 w="."+m[m.length-1];return{filename:m.slice(0,-1).join("."),extension:w}}return I.jsxs("div",{className:`${ea.container} ${n??""}`,children:[I.jsx(Mn,{...g,...a,className:r??"",onClick:F=>D(F),children:i}),I.jsx(qh,{accept:v==null?void 0:v.join(", "),ref:p,type:"file",onChange:F=>S(F.target.files),error:x[h],multiple:o>1,hidden:!0}),I.jsx("div",{className:ea.files,children:e==null?void 0:e.map((F,m)=>I.jsxs("div",{className:ea.file,onClick:w=>{w.stopPropagation(),typeof d=="function"&&d(F)},children:[I.jsxs("div",{className:ea["file-name-wrapper"],children:[I.jsx("span",{className:ea["file-name"],children:A((F==null?void 0:F.originalName)??(F==null?void 0:F.name)??(F==null?void 0:F.fileName)??"").filename}),I.jsx("span",{className:ea["file-extension"],children:A((F==null?void 0:F.originalName)??(F==null?void 0:F.name)??(F==null?void 0:F.fileName)??"").extension})]}),typeof u=="function"&&I.jsx(I.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 I.jsx(I.Fragment,{children:n?I.jsx("span",{className:`${r.variants[t]} ${e??""}`,children:n}):I.jsx(I.Fragment,{})})},A8="
|
183
|
+
${c.disabled?vn.disabled:""} ${l??""}`,children:o})]})});qh.displayName="InputNative";const E8="_container_1szxn_1",I8="_files_1szxn_4",_8="_file_1szxn_4",ea={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=C.useRef(null),v=t||["image/png","image/jpeg","image/jpg"],[b,y]=C.useState(""),x={internal:b||l,external:l||b},S=F=>{if(F!=null&&F.length){const m=Array.from(F).slice(0,o),w=m==null?void 0:m.filter(R=>!v.includes(R.type)),_=(m==null?void 0:m.reduce((R,P)=>R+P.size,0))/1024/1024;let E="";if(w.length>0?E="Berkas tidak didukung, silahkan pilih file kembali.":_>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 A(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 w="."+m[m.length-1];return{filename:m.slice(0,-1).join("."),extension:w}}return I.jsxs("div",{className:`${ea.container} ${n??""}`,children:[I.jsx(Mn,{...g,...a,className:r??"",onClick:F=>D(F),children:i}),I.jsx(qh,{accept:v==null?void 0:v.join(", "),ref:p,type:"file",onChange:F=>S(F.target.files),error:x[h],multiple:o>1,hidden:!0}),I.jsx("div",{className:ea.files,children:e==null?void 0:e.map((F,m)=>I.jsxs("div",{className:ea.file,onClick:w=>{w.stopPropagation(),typeof d=="function"&&d(F)},children:[I.jsxs("div",{className:ea["file-name-wrapper"],children:[I.jsx("span",{className:ea["file-name"],children:A((F==null?void 0:F.originalName)??(F==null?void 0:F.name)??(F==null?void 0:F.fileName)??"").filename}),I.jsx("span",{className:ea["file-extension"],children:A((F==null?void 0:F.originalName)??(F==null?void 0:F.name)??(F==null?void 0:F.fileName)??"").extension})]}),typeof u=="function"&&I.jsx(I.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 I.jsx(I.Fragment,{children:n?I.jsx("span",{className:`${r.variants[t]} ${e??""}`,children:n}):I.jsx(I.Fragment,{})})},A8="_container_2h4d1_1",F8="_textarea_2h4d1_7",T8="_label_2h4d1_36",P8="_error_2h4d1_44",ur={container:A8,"size-medium":"_size-medium_2h4d1_1","container-textarea":"_container-textarea_2h4d1_4",textarea:F8,"placeholder-shown":"_placeholder-shown_2h4d1_24",label:T8,error:P8,"label-error":"_label-error_2h4d1_61"},cC=C.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:v=20,autoTranslateLabel:b=!1,...y}=e,x=C.useRef(null),S=Yf(x,t),D=C.useRef(null),A={...g??{},maxHeight:f,height:d??h,minHeight:h},[F,m]=C.useState(!1),[w,_]=C.useState(!1),[E,R]=C.useState(v),P={size:{medium:ur["size-medium"]}},$=()=>{var B;["",void 0,null].includes(y.value)||["",void 0,null].includes((B=x.current)==null?void 0:B.value)?(_(!1),b&&setTimeout(()=>{var G,Y;const O=((G=x.current)==null?void 0:G.offsetHeight)??0,V=((Y=D.current)==null?void 0:Y.offsetHeight)??0,j=(O-V)/2;R(j)},100)):_(!0)},M=function(B){var O;m(!0),$(),(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){$();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]),I.jsxs("div",{className:`${ur.container}
|
184
184
|
${P.size[p]}
|
185
185
|
${r??""}`,children:[I.jsxs("div",{className:`${ur["container-textarea"]}`,children:[I.jsx("textarea",{id:l??s,className:`${w?"":ur["placeholder-shown"]} ${c?ur.error:""}
|
186
186
|
${ur.textarea}
|
package/dist/index.mjs
CHANGED
@@ -34880,15 +34880,15 @@ const WB = "_container_1szxn_1", GB = "_files_1szxn_4", zB = "_file_1szxn_4", la
|
|
34880
34880
|
}
|
34881
34881
|
};
|
34882
34882
|
return /* @__PURE__ */ I.jsx(I.Fragment, { children: n ? /* @__PURE__ */ I.jsx("span", { className: `${r.variants[t]} ${e ?? ""}`, children: n }) : /* @__PURE__ */ I.jsx(I.Fragment, {}) });
|
34883
|
-
}, XB = "
|
34883
|
+
}, XB = "_container_2h4d1_1", ZB = "_textarea_2h4d1_7", YB = "_label_2h4d1_36", UB = "_error_2h4d1_44", mr = {
|
34884
34884
|
container: XB,
|
34885
|
-
"size-medium": "_size-
|
34886
|
-
"container-textarea": "_container-
|
34885
|
+
"size-medium": "_size-medium_2h4d1_1",
|
34886
|
+
"container-textarea": "_container-textarea_2h4d1_4",
|
34887
34887
|
textarea: ZB,
|
34888
|
-
"placeholder-shown": "_placeholder-
|
34888
|
+
"placeholder-shown": "_placeholder-shown_2h4d1_24",
|
34889
34889
|
label: YB,
|
34890
34890
|
error: UB,
|
34891
|
-
"label-error": "_label-
|
34891
|
+
"label-error": "_label-error_2h4d1_61"
|
34892
34892
|
}, JB = B.forwardRef((e, t) => {
|
34893
34893
|
const {
|
34894
34894
|
isRequired: n,
|
package/package.json
CHANGED