@syngrisi/syngrisi
Version:
Syngrisi - Visual Testing Tool
3 lines (2 loc) • 4.35 kB
JavaScript
var ds=Object.defineProperty;var i=(o,e)=>ds(o,"name",{value:e,configurable:!0});import{j as s,ac as cs,a6 as ps,ae as us,a1 as hs,a7 as gs,ad as vs,ar as ys,aH as fs,K as bs,aB as L,ak as Ps,az as V,as as ms}from"./http-CC8JzV-G.js";function ws({reveal:o}){return s.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 256 256",style:{width:"var(--psi-icon-size)",height:"var(--psi-icon-size)"},children:o?s.jsxs(s.Fragment,{children:[s.jsx("path",{fill:"none",d:"M0 0h256v256H0z"}),s.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16",d:"M48 40l160 176M154.91 157.6a40 40 0 01-53.82-59.2M135.53 88.71a40 40 0 0132.3 35.53"}),s.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16",d:"M208.61 169.1C230.41 149.58 240 128 240 128s-32-72-112-72a126 126 0 00-20.68 1.68M74 68.6C33.23 89.24 16 128 16 128s32 72 112 72a118.05 118.05 0 0054-12.6"})]}):s.jsxs(s.Fragment,{children:[s.jsx("path",{fill:"none",d:"M0 0h256v256H0z"}),s.jsx("path",{fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16",d:"M128 56c-80 0-112 72-112 72s32 72 112 72 112-72 112-72-32-72-112-72z"}),s.jsx("circle",{cx:"128",cy:"128",r:"40",fill:"none",stroke:"currentColor",strokeLinecap:"round",strokeLinejoin:"round",strokeWidth:"16"})]})})}i(ws,"PasswordToggleIcon");var v={root:"m_f61ca620",input:"m_ccf8da4c",innerInput:"m_f2d85dd2",visibilityToggle:"m_b1072d44"};const xs={visibilityToggleIcon:ws,size:"sm"},W=vs((o,{size:e})=>({root:{"--psi-icon-size":V(e,"psi-icon-size"),"--psi-button-size":V(e,"psi-button-size")}})),y=cs(o=>{const e=ps("PasswordInput",xs,o),{classNames:f,className:B,style:D,styles:b,unstyled:l,vars:E,required:P,error:r,leftSection:m,disabled:c,id:A,variant:w,inputContainer:N,description:x,label:R,size:j,errorProps:I,descriptionProps:k,labelProps:$,withAsterisk:F,inputWrapperOrder:H,wrapperProps:K,radius:S,rightSection:q,rightSectionWidth:O,rightSectionPointerEvents:U,leftSectionWidth:G,visible:J,defaultVisible:Q,onVisibilityChange:X,visibilityToggleIcon:Y,visibilityToggleButtonProps:n,rightSectionProps:Z,leftSectionProps:ss,leftSectionPointerEvents:es,withErrorStyles:ts,mod:os,attributes:p,...is}=e,a=us(A),[d,rs]=hs({value:J,defaultValue:Q,finalValue:!1,onChange:X}),u=i(()=>rs(!d),"toggleVisibility"),h=gs({name:"PasswordInput",classes:v,props:e,className:B,style:D,classNames:f,styles:b,unstyled:l,attributes:p,vars:E,varsResolver:W}),{resolvedClassNames:g,resolvedStyles:_}=ys({classNames:f,styles:b,props:e}),{styleProps:ns,rest:z}=fs(is),C=I?.id||`${a}-error`,T=k?.id||`${a}-description`,M=`${r&&typeof r!="boolean"?C:""} ${x?T:""}`,as=M.trim().length>0?M.trim():void 0,ls=s.jsx(bs,{...h("visibilityToggle"),disabled:c,radius:S,"aria-pressed":d,tabIndex:-1,"aria-label":"Toggle password visibility",...n,variant:n?.variant??"subtle",color:"gray",unstyled:l,onTouchEnd:i(t=>{t.preventDefault(),n?.onTouchEnd?.(t),u()},"onTouchEnd"),onMouseDown:i(t=>{t.preventDefault(),n?.onMouseDown?.(t),u()},"onMouseDown"),onKeyDown:i(t=>{n?.onKeyDown?.(t),t.key===" "&&(t.preventDefault(),u())},"onKeyDown"),children:s.jsx(Y,{reveal:d})});return s.jsx(L.Wrapper,{required:P,id:a,label:R,error:r,description:x,size:j,classNames:g,styles:_,__staticSelector:"PasswordInput",__stylesApiProps:e,unstyled:l,withAsterisk:F,inputWrapperOrder:H,inputContainer:N,variant:w,labelProps:{...$,htmlFor:a},descriptionProps:{...k,id:T},errorProps:{...I,id:C},mod:os,attributes:p,...h("root"),...ns,...K,children:s.jsx(L,{component:"div",error:r,leftSection:m,size:j,classNames:{...g,input:Ps(v.input,g.input)},styles:_,radius:S,disabled:c,__staticSelector:"PasswordInput",__stylesApiProps:e,rightSectionWidth:O,rightSection:q??ls,variant:w,unstyled:l,leftSectionWidth:G,rightSectionPointerEvents:U||"all",rightSectionProps:Z,leftSectionProps:ss,leftSectionPointerEvents:es,withAria:!1,withErrorStyles:ts,attributes:p,children:s.jsx("input",{required:P,"data-invalid":!!r||void 0,"data-with-left-section":!!m||void 0,...h("innerInput"),disabled:c,id:a,...z,"aria-describedby":as,autoComplete:z.autoComplete||"off",type:d?"text":"password"})})})});y.classes={...ms.classes,...v};y.varsResolver=W;y.displayName="@mantine/core/PasswordInput";export{y as P};
//# sourceMappingURL=PasswordInput-DaqYfuPs.js.map