diditui 1.0.13 → 1.0.14
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/diditui.cjs +1 -1
- package/dist/diditui.d.ts +2 -1
- package/dist/diditui.js +106 -87
- package/package.json +1 -1
package/dist/diditui.cjs
CHANGED
|
@@ -84,4 +84,4 @@ Make sure your charset is UTF-8`);r=(r>>>8&255)*192+(r&255),e.put(r,13)}};var zl
|
|
|
84
84
|
The chosen QR Code version cannot contain this amount of data.
|
|
85
85
|
Minimum version required to store current data is: `+a+`.
|
|
86
86
|
`);const i=a1(t,r,o),s=At.getSymbolSize(t),l=new Yl(s);return e1(l,t),t1(l),r1(l,t),Qt(l,r,0),t>=7&&n1(l,t),o1(l,i),isNaN(n)&&(n=fr.getBestMask(l,Qt.bind(null,l,r))),fr.applyMask(n,l),Qt(l,r,n),{modules:l,version:t,errorCorrectionLevel:r,maskPattern:n,segments:o}}Bn.create=function(t,r){if(typeof t>"u"||t==="")throw new Error("No input text");let n=Kt.M,o,a;return typeof r<"u"&&(n=Kt.from(r.errorCorrectionLevel,Kt.M),o=Tt.from(r.version),a=fr.from(r.maskPattern),r.toSJISFunc&&At.setToSJISFunction(r.toSJISFunc)),i1(t,o,n,a)};var Kn={},xr={};(function(e){function t(r){if(typeof r=="number"&&(r=r.toString()),typeof r!="string")throw new Error("Color should be defined as hex string");let n=r.slice().replace("#","").split("");if(n.length<3||n.length===5||n.length>8)throw new Error("Invalid hex color: "+r);(n.length===3||n.length===4)&&(n=Array.prototype.concat.apply([],n.map(function(a){return[a,a]}))),n.length===6&&n.push("F","F");const o=parseInt(n.join(""),16);return{r:o>>24&255,g:o>>16&255,b:o>>8&255,a:o&255,hex:"#"+n.slice(0,6).join("")}}e.getOptions=function(n){n||(n={}),n.color||(n.color={});const o=typeof n.margin>"u"||n.margin===null||n.margin<0?4:n.margin,a=n.width&&n.width>=21?n.width:void 0,i=n.scale||4;return{width:a,scale:a?4:i,margin:o,color:{dark:t(n.color.dark||"#000000ff"),light:t(n.color.light||"#ffffffff")},type:n.type,rendererOpts:n.rendererOpts||{}}},e.getScale=function(n,o){return o.width&&o.width>=n+o.margin*2?o.width/(n+o.margin*2):o.scale},e.getImageWidth=function(n,o){const a=e.getScale(n,o);return Math.floor((n+o.margin*2)*a)},e.qrToImageData=function(n,o,a){const i=o.modules.size,s=o.modules.data,l=e.getScale(i,a),d=Math.floor((i+a.margin*2)*l),f=a.margin*l,h=[a.color.light,a.color.dark];for(let p=0;p<d;p++)for(let g=0;g<d;g++){let y=(p*d+g)*4,v=a.color.light;if(p>=f&&g>=f&&p<d-f&&g<d-f){const w=Math.floor((p-f)/l),b=Math.floor((g-f)/l);v=h[s[w*i+b]?1:0]}n[y++]=v.r,n[y++]=v.g,n[y++]=v.b,n[y]=v.a}}})(xr);(function(e){const t=xr;function r(o,a,i){o.clearRect(0,0,a.width,a.height),a.style||(a.style={}),a.height=i,a.width=i,a.style.height=i+"px",a.style.width=i+"px"}function n(){try{return document.createElement("canvas")}catch{throw new Error("You need to specify a canvas element")}}e.render=function(a,i,s){let l=s,d=i;typeof l>"u"&&(!i||!i.getContext)&&(l=i,i=void 0),i||(d=n()),l=t.getOptions(l);const f=t.getImageWidth(a.modules.size,l),h=d.getContext("2d"),p=h.createImageData(f,f);return t.qrToImageData(p.data,a,l),r(h,d,f),h.putImageData(p,0,0),d},e.renderToDataURL=function(a,i,s){let l=s;typeof l>"u"&&(!i||!i.getContext)&&(l=i,i=void 0),l||(l={});const d=e.render(a,i,l),f=l.type||"image/png",h=l.rendererOpts||{};return d.toDataURL(f,h.quality)}})(Kn);var Jn={};const l1=xr;function un(e,t){const r=e.a/255,n=t+'="'+e.hex+'"';return r<1?n+" "+t+'-opacity="'+r.toFixed(2).slice(1)+'"':n}function Xt(e,t,r){let n=e+t;return typeof r<"u"&&(n+=" "+r),n}function c1(e,t,r){let n="",o=0,a=!1,i=0;for(let s=0;s<e.length;s++){const l=Math.floor(s%t),d=Math.floor(s/t);!l&&!a&&(a=!0),e[s]?(i++,s>0&&l>0&&e[s-1]||(n+=a?Xt("M",l+r,.5+d+r):Xt("m",o,0),o=0,a=!1),l+1<t&&e[s+1]||(n+=Xt("h",i),i=0)):o++}return n}Jn.render=function(t,r,n){const o=l1.getOptions(r),a=t.modules.size,i=t.modules.data,s=a+o.margin*2,l=o.color.light.a?"<path "+un(o.color.light,"fill")+' d="M0 0h'+s+"v"+s+'H0z"/>':"",d="<path "+un(o.color.dark,"stroke")+' d="'+c1(i,a,o.margin)+'"/>',f='viewBox="0 0 '+s+" "+s+'"',p='<svg xmlns="http://www.w3.org/2000/svg" '+(o.width?'width="'+o.width+'" height="'+o.width+'" ':"")+f+' shape-rendering="crispEdges">'+l+d+`</svg>
|
|
87
|
-
`;return typeof n=="function"&&n(null,p),p};const u1=Sl,hr=Bn,Qn=Kn,d1=Jn;function kr(e,t,r,n,o){const a=[].slice.call(arguments,1),i=a.length,s=typeof a[i-1]=="function";if(!s&&!u1())throw new Error("Callback required as last argument");if(s){if(i<2)throw new Error("Too few arguments provided");i===2?(o=r,r=t,t=n=void 0):i===3&&(t.getContext&&typeof o>"u"?(o=n,n=void 0):(o=n,n=r,r=t,t=void 0))}else{if(i<1)throw new Error("Too few arguments provided");return i===1?(r=t,t=n=void 0):i===2&&!t.getContext&&(n=r,r=t,t=void 0),new Promise(function(l,d){try{const f=hr.create(r,n);l(e(f,t,n))}catch(f){d(f)}})}try{const l=hr.create(r,n);o(null,e(l,t,n))}catch(l){o(l)}}vt.create=hr.create;vt.toCanvas=kr.bind(null,Qn.render);vt.toDataURL=kr.bind(null,Qn.renderToDataURL);vt.toString=kr.bind(null,function(e,t,r){return d1.render(e,r)});const f1=.1,dn=2.5,_e=7;function er(e,t,r){return e===t?!1:(e-t<0?t-e:e-t)<=r+f1}function p1(e,t){const r=Array.prototype.slice.call(vt.create(e,{errorCorrectionLevel:t}).modules.data,0),n=Math.sqrt(r.length);return r.reduce((o,a,i)=>(i%n===0?o.push([a]):o[o.length-1].push(a))&&o,[])}const h1={generate(e,t,r,n="#141414"){const o="transparent",i=p1(e,"Q"),s=t/i.length,l=[{x:0,y:0},{x:1,y:0},{x:0,y:1}],d=[];l.forEach(({x:v,y:w})=>{const b=(i.length-_e)*s*v,E=(i.length-_e)*s*w,L=.3;for(let x=0;x<l.length;x+=1){const C=s*(_e-x*2);d.push(S.jsx("rect",{fill:x===2?n:o,width:x===0?C-5:C,rx:x===0?(C-5)*L:C*L,ry:x===0?(C-5)*L:C*L,stroke:n,strokeWidth:x===0?5:0,height:x===0?C-5:C,x:x===0?E+s*x+5/2:E+s*x,y:x===0?b+s*x+5/2:b+s*x},`${v}-${w}-${x}`))}});const f=Math.floor((r+25)/s),h=i.length/2-f/2,p=i.length/2+f/2-1,g=[];i.forEach((v,w)=>{v.forEach((b,E)=>{if(i[w][E]&&!(w<_e&&E<_e||w>i.length-(_e+1)&&E<_e||w<_e&&E>i.length-(_e+1))&&!(w>h&&w<p&&E>h&&E<p)){const L=w*s+s/2,x=E*s+s/2;g.push([L,x])}})});const y={};return g.forEach(([v,w])=>{var b;y[v]?(b=y[v])==null||b.push(w):y[v]=[w]}),Object.entries(y).map(([v,w])=>{const b=w.filter(E=>w.every(L=>!er(E,L,s)));return[Number(v),b]}).forEach(([v,w])=>{w.forEach(b=>{d.push(S.jsx("circle",{cx:v,cy:b,fill:n,r:s/dn}))})}),Object.entries(y).filter(([v,w])=>w.length>1).map(([v,w])=>{const b=w.filter(E=>w.some(L=>er(E,L,s)));return[Number(v),b]}).map(([v,w])=>{w.sort((E,L)=>E<L?-1:1);const b=[];for(const E of w){const L=b.find(x=>x.some(C=>er(E,C,s)));L?L.push(E):b.push([E])}return[v,b.map(E=>[E[0],E[E.length-1]])]}).forEach(([v,w])=>{w.forEach(([b,E])=>{d.push(S.jsx("line",{x1:v,x2:v,y1:b,y2:E,stroke:n,strokeWidth:s/(dn/2),strokeLinecap:"round"},`${v}-${b}-${E}`))})}),d}},m1={sm:120,md:200,lg:256,xl:320};function g1({uri:e,size:t="md",color:r,iconName:n="didit",className:o,...a}){const i=typeof t=="number"?t:m1[t],s=_.useMemo(()=>h1.generate(e,i,i/4,r),[e,i,r]),l=D(["size-fit","flex items-center justify-center","relative overflow-hidden aspect-square"],o),d=D(["size-full absolute top-1/2 left-1/2","transform -translate-x-1/2 -translate-y-1/2 scale-[0.25]","text-primary rounded-3xl overflow-hidden"]);return S.jsxs("div",{className:l,...a,children:[S.jsx(Ee,{type:n,className:d}),S.jsx("svg",{width:i,height:i,children:s})]})}function v1({label:e,placeholder:t,value:r,disabled:n,className:o,error:a,onValueChange:i=()=>{},...s}){const l=_.useRef(null),[d,f]=_.useState(!1),h=D(["w-full overflow-hidden min-h-[68px] py-2 pr-2 cursor-pointer","flex items-center gap-2 border-b-[1.5px] border-transparent","focus:bg-transparent focus:border-foreground transition-all duration-300"],{"opacity-80":n,"border-foreground":d,"border-error":a},o),p=D([" placeholder:text-sm placeholder:font-normal placeholder:leading-[140%]","placeholder:text-surface-mdlo text-sm font-normal leading-[140%]","placeholder:tracking-tight tracking-tight","focus:ring-0 active:border-none bg-transparent border-none transition-all duration-300","p-0 m-0"]),g=D(["flex justify-center align-items-center hover:opacity-80 p-[2px]"],{invisible:!r}),y=D(["rounded-full bg-surface-ulo p-[9px] opacity-70","cursor-pointer hover:opacity-100"],{"opacity-100":d,"bg-error/5":a&&d});return S.jsxs("div",{className:"w-full overflow-hidden",children:[S.jsxs("div",{className:h,onClick:()=>{var v;return(v=l.current)==null?void 0:v.focus()},children:[S.jsx("div",{className:y,children:S.jsx(Ee,{type:"search",size:"sm"})}),S.jsxs("div",{className:"flex flex-col gap-[6px] grow overflow-hidden min-w-0",children:[S.jsx(fe,{variant:"StyledLabel",as:"label",className:"text-surface-md cursor-pointer truncate",children:e}),S.jsx("input",{ref:l,onFocus:()=>f(!0),onBlur:()=>f(!1),className:p,value:r,type:"text",onChange:v=>i(v.target.value),placeholder:t,disabled:n,...s})]}),S.jsx("button",{className:g,onClick:()=>i(""),children:S.jsx(Ee,{type:"closeCircleBold",size:"sm",className:"text-surface-mdlo"})})]}),S.jsx(fe,{variant:"P3",as:"span",className:"text-error mt-1",children:a})]})}var C1="Expected a function",fn=NaN,b1="[object Symbol]",y1=/^\s+|\s+$/g,w1=/^[-+]0x[0-9a-f]+$/i,E1=/^0b[01]+$/i,x1=/^0o[0-7]+$/i,k1=parseInt,S1=typeof We.commonjsGlobal=="object"&&We.commonjsGlobal&&We.commonjsGlobal.Object===Object&&We.commonjsGlobal,L1=typeof self=="object"&&self&&self.Object===Object&&self,R1=S1||L1||Function("return this")(),M1=Object.prototype,_1=M1.toString,T1=Math.max,O1=Math.min,tr=function(){return R1.Date.now()};function N1(e,t,r){var n,o,a,i,s,l,d=0,f=!1,h=!1,p=!0;if(typeof e!="function")throw new TypeError(C1);t=pn(t)||0,mr(r)&&(f=!!r.leading,h="maxWait"in r,a=h?T1(pn(r.maxWait)||0,t):a,p="trailing"in r?!!r.trailing:p);function g(j){var z=n,re=o;return n=o=void 0,d=j,i=e.apply(re,z),i}function y(j){return d=j,s=setTimeout(b,t),f?g(j):i}function v(j){var z=j-l,re=j-d,Y=t-z;return h?O1(Y,a-re):Y}function w(j){var z=j-l,re=j-d;return l===void 0||z>=t||z<0||h&&re>=a}function b(){var j=tr();if(w(j))return E(j);s=setTimeout(b,v(j))}function E(j){return s=void 0,p&&n?g(j):(n=o=void 0,i)}function L(){s!==void 0&&clearTimeout(s),d=0,n=l=o=s=void 0}function x(){return s===void 0?i:E(tr())}function C(){var j=tr(),z=w(j);if(n=arguments,o=this,l=j,z){if(s===void 0)return y(l);if(h)return s=setTimeout(b,t),g(l)}return s===void 0&&(s=setTimeout(b,t)),i}return C.cancel=L,C.flush=x,C}function mr(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function j1(e){return!!e&&typeof e=="object"}function P1(e){return typeof e=="symbol"||j1(e)&&_1.call(e)==b1}function pn(e){if(typeof e=="number")return e;if(P1(e))return fn;if(mr(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=mr(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(y1,"");var r=E1.test(e);return r||x1.test(e)?k1(e.slice(2),r?2:8):w1.test(e)?fn:+e}var A1=N1;const hn=We.getDefaultExportFromCjs(A1);var F1=typeof window<"u"?_.useLayoutEffect:_.useEffect;function B1(e,t,r,n){const o=_.useRef(t);F1(()=>{o.current=t},[t]),_.useEffect(()=>{const a=window;if(!(a&&a.addEventListener))return;const i=s=>{o.current(s)};return a.addEventListener(e,i,n),()=>{a.removeEventListener(e,i,n)}},[e,r,n])}function I1(e){const t=_.useRef(e);t.current=e,_.useEffect(()=>()=>{t.current()},[])}function W1(e,t=500,r){const n=_.useRef();I1(()=>{n.current&&n.current.cancel()});const o=_.useMemo(()=>{const a=hn(e,t,r),i=(...s)=>a(...s);return i.cancel=()=>{a.cancel()},i.isPending=()=>!!n.current,i.flush=()=>a.flush(),i},[e,t,r]);return _.useEffect(()=>{n.current=hn(e,t,r)},[e,t,r]),o}const D1=500;function Xn({id:e,className:t,disabled:r,placeholder:n,immediateFocus:o,value:a,onChange:i}){const s=_.useRef(null),[l,d]=_.useState(!1),f=W1(i,D1);_.useEffect(()=>{var y;o&&((y=s==null?void 0:s.current)==null||y.focus())},[]);const h=D("flex w-full items-center gap-3 px-4 py-3","border-b border-surface-ulo text-surface-hi",t),p=D("text-xs remove-arrow :focus:shadow-none grow shrink-0 truncate","placeholder:body-text placeholder:text-surface-md","border-none bg-transparent p-0 !shadow-none outline-none ring-0 ring-offset-0","focus:border-none focus:outline-none focus:ring-0","disabled:opacity-25"),g=D("shrink-0",{"opacity-25 transition-opacity duration-300":!l});return S.jsxs("div",{className:h,id:e,children:[S.jsx("div",{className:g,children:S.jsx(Ee,{size:"sm",type:"search"})}),S.jsx("input",{disabled:r,ref:s,className:p,placeholder:n,type:"text",defaultValue:a,onBlur:()=>d(!1),onChange:y=>f(y.target.value),onFocus:()=>d(!0)})]})}const V1=typeof window<"u"?_.useLayoutEffect:_.useEffect,H1=typeof window>"u";function at(e,{defaultValue:t=!1,initializeWithValue:r=!0}={}){function n(s){return H1?t:window.matchMedia(s).matches}const[o,a]=_.useState(()=>r?n(e):t);function i(){a(n(e))}return V1(()=>{const s=window.matchMedia(e);return i(),s.addListener?s.addListener(i):s.addEventListener("change",i),()=>{s.removeListener?s.removeListener(i):s.removeEventListener("change",i)}},[e]),o}function $1(e={}){return at(`(min-width: ${tt.SM}px)`,e)}function U1(e={}){return at(`(min-width: ${tt.MD}px)`,e)}function z1(e={}){return at(`(min-width: ${tt.LG}px)`,e)}function Z1(e={}){return at(`(min-width: ${tt.XL}px)`,e)}function q1(e={}){return at(`(min-width: ${tt.XXL}px)`,e)}function eo(e,t,r,n="mousedown"){B1(n,o=>{const a=e==null?void 0:e.current,i=t==null?void 0:t.current;!a||a.contains(o.target)||!i||i.contains(o.target)||r(o)})}function to(e,t){const r=_.useCallback(n=>{n.key===e&&t()},[e,t]);_.useEffect(()=>(window.addEventListener("keydown",r),()=>{window.removeEventListener("keydown",r)}),[r])}function Y1({label:e,value:t,Icon:r=null,id:n="",dataTestId:o="",className:a="",onClick:i=()=>{}}){const s=_.useCallback(()=>{i(t)},[t,i]),l=kt("flex w-full items-center gap-2 px-4 py-3 text-surface-hi","hover:bg-surface-ulo/60 border-b border-surface-ulo","transition-all duration-300",a);return S.jsx("li",{children:S.jsxs("button",{className:l,"data-testid":o,id:n,type:"button",onClick:s,children:[r&&S.jsx("span",{children:S.jsx(r,{})}),S.jsx(fe,{variant:"P3",as:"span",children:e})]})})}function G1({id:e="",className:t="",label:r,placeholder:n,selectedOption:o={label:"",value:"",Icon:null},disabled:a=!1,isDropdownOpen:i=!1,buttonRef:s=void 0,hasError:l=!1,onClick:d}){const f=D("w-full min-h-[68px] py-4 px-5 rounded-3xl","flex items-center gap-2 bg-surface-lo hover:bg-surface-ulo","transition-all duration-300 border border-transparent",{"opacity-80":a,"border-error bg-error/5":l,"bg-transparent border-foreground hover:bg-transparent":i,"border-error":i&&l},t),h=D("truncate w-fit",{"text-surface-background":o.value,"text-surface-md":!o.value}),p=D(["transition-all duration-300",{"-rotate-180":i}]);return S.jsxs("button",{id:e,className:f,ref:s,onClick:d,type:"button",children:[S.jsxs("div",{className:"flex flex-col gap-[6px] grow overflow-hidden min-w-0",children:[S.jsx(fe,{variant:"StyledLabel",as:"label",className:"text-surface-md truncate w-fit",children:r}),S.jsx(fe,{as:"span",variant:"P2",className:h,children:o.label||n})]}),S.jsx("div",{className:p,children:S.jsx(Ee,{type:"chevronDown",size:"sm"})})]})}function K1({id:e="",className:t="",dataTestId:r="",label:n="",placeholder:o="",value:a=void 0,options:i,disabled:s=!1,withSearch:l=!1,errorMessage:d="",dropdownClassName:f="",onChange:h=g=>{},onClick:p=()=>{}}){const g=_.useRef(null),y=_.useRef(null),[v,w]=_.useState(!1),[b,E]=_.useState(""),L=_.useMemo(()=>b?i.filter(Y=>Y.label.toLowerCase().startsWith(b.toLowerCase())):i,[b,i]),x=_.useMemo(()=>i.find(Y=>Y.value===a),[i,a]);to("Escape",()=>w(!1)),eo(g,y,()=>w(!1));const C=_.useCallback(Y=>{h(Y),w(!1)},[h]),j=_.useCallback(()=>{p()},[p]),z=D("w-full min-w-[230px]",t),re=D("absolute righ-0 top-[calc(100%+8px)] w-full bg-background rounded-2xl p-2","shadow-card z-50 transition-all duration-300 overflow-hidden overflow-y-auto","scrollbar-none max-h-[240px]",{"cursor-pointer":!!p,"pt-0":l},f);return S.jsxs("div",{className:z,"data-testid":r,onClick:j,children:[S.jsxs("div",{className:"relative",children:[S.jsx(G1,{label:n,buttonRef:g,hasError:!!d,id:e,disabled:s,isDropdownOpen:v,placeholder:o,selectedOption:x,onClick:()=>w(!v)}),v&&S.jsxs("div",{ref:y,className:re,children:[S.jsx("div",{className:D("sticky top-0 left-0 w-full bg-background",{hidden:!l}),children:S.jsx(Xn,{immediateFocus:!0,placeholder:"Search",value:b,onChange:E})}),S.jsx("ul",{className:"[&>*:last-child]:border-none",children:L.length?L.map((Y,ce)=>S.jsx(Y1,{dataTestId:`${r}-option-${Y.value}`,Icon:Y.Icon,label:Y.label,value:Y.value,onClick:C},`${Y.value}-${ce}`)):S.jsx(fe,{as:"p",variant:"P2",className:"truncate p-4 text-center",children:"No options"})})]})]}),S.jsx(fe,{variant:"P3",as:"span",className:D("text-error mt-1 pl-1",{invisible:v}),children:d})]})}const J1=Te(["border border-foreground","rounded-3xl","p-2","bg-transparent","flex items-center justify-center"],{variants:{variant:{primary:"bg-primary/10 border-primary/20 text-primary",accent:"bg-accent/10 border-accent/20 text-accent",success:"bg-success/10 border-success/20 text-success",warning:"bg-warning/10 border-warning/20 text-warning",error:"bg-error/10 border-error/20 text-error"}},defaultVariants:{variant:"primary"}});function Q1({label:e,variant:t,className:r,...n}){return S.jsx("div",{className:D(J1({variant:t,className:r})),...n,children:S.jsx(fe,{className:"text-inherit text-[9px]",variant:"StyledLabel",as:"span",children:e})})}function X1({id:e,className:t,label:r,checked:n,disabled:o,onToggle:a=()=>{}}){const i=D(["inline-flex items-center gap-4 cursor-pointer"],t),s=_.useCallback(l=>{a(l.target.checked)},[a]);return S.jsxs("label",{className:i,children:[S.jsx("input",{type:"checkbox",checked:n,onChange:s,id:e,className:"sr-only peer",disabled:o}),S.jsx("div",{className:"relative w-11 h-6 bg-surface-lo peer-focus:outline-none rounded-full peer peer-checked:after:translate-x-full rtl:peer-checked:after:-translate-x-full peer-checked:after:border-background after:content-[''] after:absolute after:top-[2px] after:start-[2px] after:bg-background after:border-background after:border after:rounded-full after:h-5 after:w-5 after:transition-all peer-checked:bg-primary"}),r&&S.jsx(fe,{as:"span",variant:"P3",className:"text-inheret",children:r})]})}function ec({name:e,label:t,avatar:r,radius:n="full",className:o,...a}){const i=D("w-[36px] h-[36px] overflow-hidden",{"rounded-none":n==="none","rounded-full":n==="full","rounded-md":n==="md","rounded-sm":n==="sm"});return S.jsxs("div",{className:D("flex items-center gap-3",o),...a,children:[S.jsx("div",{className:i,children:r?S.jsx("img",{src:r,alt:"avatar",className:"size-full object-cover"}):S.jsx(Ee,{type:"didit",className:"size-full object-cover"})}),S.jsxs("div",{className:"flex flex-col gap-1",children:[S.jsx(fe,{className:"text-foreground",as:"h6",variant:"H6",children:e}),t&&S.jsx(fe,{className:"text-surface-md",as:"span",variant:"Label3",children:t})]})]})}exports.Button=Qs;exports.Card=ei;exports.CheckBox=ri;exports.CopyValue=oi;exports.DiditAnimatedLogo=si;exports.Icon=Ee;exports.IconButton=kn;exports.Input=li;exports.MediaQuery=tt;exports.Modal=kl;exports.QrCode=g1;exports.SearchInput=v1;exports.SearchMini=Xn;exports.SelectDropdown=K1;exports.Spinner=xn;exports.StatusLabel=Q1;exports.Text=fe;exports.Toggle=X1;exports.Tooltip=St;exports.UserCard=ec;exports.cn=D;exports.svgOptions=En;exports.useKeyPress=to;exports.useLgMediaQuery=z1;exports.useMdMediaQuery=U1;exports.useMediaQuery=at;exports.useOnClickOutside=eo;exports.useSmMediaQuery=$1;exports.useXlMediaQuery=Z1;exports.useXxlMediaQuery=q1;
|
|
87
|
+
`;return typeof n=="function"&&n(null,p),p};const u1=Sl,hr=Bn,Qn=Kn,d1=Jn;function kr(e,t,r,n,o){const a=[].slice.call(arguments,1),i=a.length,s=typeof a[i-1]=="function";if(!s&&!u1())throw new Error("Callback required as last argument");if(s){if(i<2)throw new Error("Too few arguments provided");i===2?(o=r,r=t,t=n=void 0):i===3&&(t.getContext&&typeof o>"u"?(o=n,n=void 0):(o=n,n=r,r=t,t=void 0))}else{if(i<1)throw new Error("Too few arguments provided");return i===1?(r=t,t=n=void 0):i===2&&!t.getContext&&(n=r,r=t,t=void 0),new Promise(function(l,d){try{const f=hr.create(r,n);l(e(f,t,n))}catch(f){d(f)}})}try{const l=hr.create(r,n);o(null,e(l,t,n))}catch(l){o(l)}}vt.create=hr.create;vt.toCanvas=kr.bind(null,Qn.render);vt.toDataURL=kr.bind(null,Qn.renderToDataURL);vt.toString=kr.bind(null,function(e,t,r){return d1.render(e,r)});const f1=.1,dn=2.5,_e=7;function er(e,t,r){return e===t?!1:(e-t<0?t-e:e-t)<=r+f1}function p1(e,t){const r=Array.prototype.slice.call(vt.create(e,{errorCorrectionLevel:t}).modules.data,0),n=Math.sqrt(r.length);return r.reduce((o,a,i)=>(i%n===0?o.push([a]):o[o.length-1].push(a))&&o,[])}const h1={generate(e,t,r,n="#141414"){const o="transparent",i=p1(e,"Q"),s=t/i.length,l=[{x:0,y:0},{x:1,y:0},{x:0,y:1}],d=[];l.forEach(({x:v,y:w})=>{const b=(i.length-_e)*s*v,E=(i.length-_e)*s*w,L=.3;for(let x=0;x<l.length;x+=1){const C=s*(_e-x*2);d.push(S.jsx("rect",{fill:x===2?n:o,width:x===0?C-5:C,rx:x===0?(C-5)*L:C*L,ry:x===0?(C-5)*L:C*L,stroke:n,strokeWidth:x===0?5:0,height:x===0?C-5:C,x:x===0?E+s*x+5/2:E+s*x,y:x===0?b+s*x+5/2:b+s*x},`${v}-${w}-${x}`))}});const f=Math.floor((r+25)/s),h=i.length/2-f/2,p=i.length/2+f/2-1,g=[];i.forEach((v,w)=>{v.forEach((b,E)=>{if(i[w][E]&&!(w<_e&&E<_e||w>i.length-(_e+1)&&E<_e||w<_e&&E>i.length-(_e+1))&&!(w>h&&w<p&&E>h&&E<p)){const L=w*s+s/2,x=E*s+s/2;g.push([L,x])}})});const y={};return g.forEach(([v,w])=>{var b;y[v]?(b=y[v])==null||b.push(w):y[v]=[w]}),Object.entries(y).map(([v,w])=>{const b=w.filter(E=>w.every(L=>!er(E,L,s)));return[Number(v),b]}).forEach(([v,w])=>{w.forEach(b=>{d.push(S.jsx("circle",{cx:v,cy:b,fill:n,r:s/dn}))})}),Object.entries(y).filter(([v,w])=>w.length>1).map(([v,w])=>{const b=w.filter(E=>w.some(L=>er(E,L,s)));return[Number(v),b]}).map(([v,w])=>{w.sort((E,L)=>E<L?-1:1);const b=[];for(const E of w){const L=b.find(x=>x.some(C=>er(E,C,s)));L?L.push(E):b.push([E])}return[v,b.map(E=>[E[0],E[E.length-1]])]}).forEach(([v,w])=>{w.forEach(([b,E])=>{d.push(S.jsx("line",{x1:v,x2:v,y1:b,y2:E,stroke:n,strokeWidth:s/(dn/2),strokeLinecap:"round"},`${v}-${b}-${E}`))})}),d}},m1={sm:120,md:200,lg:256,xl:320};function g1({uri:e,size:t="md",color:r,iconName:n="didit",className:o,...a}){const i=typeof t=="number"?t:m1[t],s=_.useMemo(()=>h1.generate(e,i,i/4,r),[e,i,r]),l=D(["size-fit","flex items-center justify-center","relative overflow-hidden aspect-square"],o),d=D(["size-full absolute top-1/2 left-1/2","transform -translate-x-1/2 -translate-y-1/2 scale-[0.25]","text-primary rounded-3xl overflow-hidden"]);return S.jsxs("div",{className:l,...a,children:[S.jsx(Ee,{type:n,className:d}),S.jsx("svg",{width:i,height:i,children:s})]})}function v1({label:e,placeholder:t,value:r,disabled:n,className:o,error:a,onValueChange:i=()=>{},...s}){const l=_.useRef(null),[d,f]=_.useState(!1),h=D(["w-full overflow-hidden min-h-[68px] py-2 pr-2 cursor-pointer","flex items-center gap-2 border-b-[1.5px] border-transparent","focus:bg-transparent focus:border-foreground transition-all duration-300"],{"opacity-80":n,"border-foreground":d,"border-error":a},o),p=D([" placeholder:text-sm placeholder:font-normal placeholder:leading-[140%]","placeholder:text-surface-mdlo text-sm font-normal leading-[140%]","placeholder:tracking-tight tracking-tight","focus:ring-0 active:border-none bg-transparent border-none transition-all duration-300","p-0 m-0"]),g=D(["flex justify-center align-items-center hover:opacity-80 p-[2px]"],{invisible:!r}),y=D(["rounded-full bg-surface-ulo p-[9px] opacity-70","cursor-pointer hover:opacity-100"],{"opacity-100":d,"bg-error/5":a&&d});return S.jsxs("div",{className:"w-full overflow-hidden",children:[S.jsxs("div",{className:h,onClick:()=>{var v;return(v=l.current)==null?void 0:v.focus()},children:[S.jsx("div",{className:y,children:S.jsx(Ee,{type:"search",size:"sm"})}),S.jsxs("div",{className:"flex flex-col gap-[6px] grow overflow-hidden min-w-0",children:[S.jsx(fe,{variant:"StyledLabel",as:"label",className:"text-surface-md cursor-pointer truncate",children:e}),S.jsx("input",{ref:l,onFocus:()=>f(!0),onBlur:()=>f(!1),className:p,value:r,type:"text",onChange:v=>i(v.target.value),placeholder:t,disabled:n,...s})]}),S.jsx("button",{className:g,onClick:()=>i(""),children:S.jsx(Ee,{type:"closeCircleBold",size:"sm",className:"text-surface-mdlo"})})]}),S.jsx(fe,{variant:"P3",as:"span",className:"text-error mt-1",children:a})]})}var C1="Expected a function",fn=NaN,b1="[object Symbol]",y1=/^\s+|\s+$/g,w1=/^[-+]0x[0-9a-f]+$/i,E1=/^0b[01]+$/i,x1=/^0o[0-7]+$/i,k1=parseInt,S1=typeof We.commonjsGlobal=="object"&&We.commonjsGlobal&&We.commonjsGlobal.Object===Object&&We.commonjsGlobal,L1=typeof self=="object"&&self&&self.Object===Object&&self,R1=S1||L1||Function("return this")(),M1=Object.prototype,_1=M1.toString,T1=Math.max,O1=Math.min,tr=function(){return R1.Date.now()};function N1(e,t,r){var n,o,a,i,s,l,d=0,f=!1,h=!1,p=!0;if(typeof e!="function")throw new TypeError(C1);t=pn(t)||0,mr(r)&&(f=!!r.leading,h="maxWait"in r,a=h?T1(pn(r.maxWait)||0,t):a,p="trailing"in r?!!r.trailing:p);function g(j){var z=n,re=o;return n=o=void 0,d=j,i=e.apply(re,z),i}function y(j){return d=j,s=setTimeout(b,t),f?g(j):i}function v(j){var z=j-l,re=j-d,Y=t-z;return h?O1(Y,a-re):Y}function w(j){var z=j-l,re=j-d;return l===void 0||z>=t||z<0||h&&re>=a}function b(){var j=tr();if(w(j))return E(j);s=setTimeout(b,v(j))}function E(j){return s=void 0,p&&n?g(j):(n=o=void 0,i)}function L(){s!==void 0&&clearTimeout(s),d=0,n=l=o=s=void 0}function x(){return s===void 0?i:E(tr())}function C(){var j=tr(),z=w(j);if(n=arguments,o=this,l=j,z){if(s===void 0)return y(l);if(h)return s=setTimeout(b,t),g(l)}return s===void 0&&(s=setTimeout(b,t)),i}return C.cancel=L,C.flush=x,C}function mr(e){var t=typeof e;return!!e&&(t=="object"||t=="function")}function j1(e){return!!e&&typeof e=="object"}function P1(e){return typeof e=="symbol"||j1(e)&&_1.call(e)==b1}function pn(e){if(typeof e=="number")return e;if(P1(e))return fn;if(mr(e)){var t=typeof e.valueOf=="function"?e.valueOf():e;e=mr(t)?t+"":t}if(typeof e!="string")return e===0?e:+e;e=e.replace(y1,"");var r=E1.test(e);return r||x1.test(e)?k1(e.slice(2),r?2:8):w1.test(e)?fn:+e}var A1=N1;const hn=We.getDefaultExportFromCjs(A1);var F1=typeof window<"u"?_.useLayoutEffect:_.useEffect;function B1(e,t,r,n){const o=_.useRef(t);F1(()=>{o.current=t},[t]),_.useEffect(()=>{const a=window;if(!(a&&a.addEventListener))return;const i=s=>{o.current(s)};return a.addEventListener(e,i,n),()=>{a.removeEventListener(e,i,n)}},[e,r,n])}function I1(e){const t=_.useRef(e);t.current=e,_.useEffect(()=>()=>{t.current()},[])}function W1(e,t=500,r){const n=_.useRef();I1(()=>{n.current&&n.current.cancel()});const o=_.useMemo(()=>{const a=hn(e,t,r),i=(...s)=>a(...s);return i.cancel=()=>{a.cancel()},i.isPending=()=>!!n.current,i.flush=()=>a.flush(),i},[e,t,r]);return _.useEffect(()=>{n.current=hn(e,t,r)},[e,t,r]),o}const D1=500;function Xn({id:e,className:t,disabled:r,placeholder:n,immediateFocus:o,value:a,onChange:i}){const s=_.useRef(null),[l,d]=_.useState(!1),f=W1(i,D1);_.useEffect(()=>{var y;o&&((y=s==null?void 0:s.current)==null||y.focus())},[]);const h=D("flex w-full items-center gap-3 px-4 py-3","border-b border-surface-ulo text-surface-hi",t),p=D("text-xs remove-arrow :focus:shadow-none grow shrink-0 truncate","placeholder:body-text placeholder:text-surface-md","border-none bg-transparent p-0 !shadow-none outline-none ring-0 ring-offset-0","focus:border-none focus:outline-none focus:ring-0","disabled:opacity-25"),g=D("shrink-0",{"opacity-25 transition-opacity duration-300":!l});return S.jsxs("div",{className:h,id:e,children:[S.jsx("div",{className:g,children:S.jsx(Ee,{size:"sm",type:"search"})}),S.jsx("input",{disabled:r,ref:s,className:p,placeholder:n,type:"text",defaultValue:a,onBlur:()=>d(!1),onChange:y=>f(y.target.value),onFocus:()=>d(!0)})]})}const V1=typeof window<"u"?_.useLayoutEffect:_.useEffect,H1=typeof window>"u";function at(e,{defaultValue:t=!1,initializeWithValue:r=!0}={}){function n(s){return H1?t:window.matchMedia(s).matches}const[o,a]=_.useState(()=>r?n(e):t);function i(){a(n(e))}return V1(()=>{const s=window.matchMedia(e);return i(),s.addListener?s.addListener(i):s.addEventListener("change",i),()=>{s.removeListener?s.removeListener(i):s.removeEventListener("change",i)}},[e]),o}function $1(e={}){return at(`(min-width: ${tt.SM}px)`,e)}function U1(e={}){return at(`(min-width: ${tt.MD}px)`,e)}function z1(e={}){return at(`(min-width: ${tt.LG}px)`,e)}function Z1(e={}){return at(`(min-width: ${tt.XL}px)`,e)}function q1(e={}){return at(`(min-width: ${tt.XXL}px)`,e)}function eo(e,t,r,n="mousedown"){B1(n,o=>{const a=e==null?void 0:e.current,i=t==null?void 0:t.current;!a||a.contains(o.target)||!i||i.contains(o.target)||r(o)})}function to(e,t){const r=_.useCallback(n=>{n.key===e&&t()},[e,t]);_.useEffect(()=>(window.addEventListener("keydown",r),()=>{window.removeEventListener("keydown",r)}),[r])}function Y1({label:e,value:t,Icon:r=null,id:n="",dataTestId:o="",className:a="",onClick:i=()=>{}}){const s=_.useCallback(()=>{i(t)},[t,i]),l=kt("flex w-full items-center gap-2 px-4 py-3 text-surface-hi","hover:bg-surface-ulo/60 border-b border-surface-ulo","transition-all duration-300",a);return S.jsx("li",{children:S.jsxs("button",{className:l,"data-testid":o,id:n,type:"button",onClick:s,children:[r&&S.jsx("span",{children:S.jsx(r,{})}),S.jsx(fe,{variant:"P3",as:"span",children:e})]})})}function G1({id:e="",className:t="",label:r,placeholder:n,selectedOption:o={label:"",value:"",Icon:null},disabled:a=!1,isDropdownOpen:i=!1,buttonRef:s=void 0,hasError:l=!1,onClick:d}){const f=D("w-full min-h-[68px] py-4 px-5 rounded-3xl","flex items-center gap-2 bg-surface-lo hover:bg-surface-ulo","transition-all duration-300 border border-transparent",{"opacity-80":a,"border-error bg-error/5":l,"bg-transparent border-foreground hover:bg-transparent":i,"border-error":i&&l},t),h=D("truncate w-fit",{"text-surface-background":o.value,"text-surface-md":!o.value}),p=D(["transition-all duration-300",{"-rotate-180":i}]);return S.jsxs("button",{id:e,className:f,ref:s,onClick:d,type:"button",children:[S.jsxs("div",{className:"flex flex-col gap-[6px] grow overflow-hidden min-w-0",children:[S.jsx(fe,{variant:"StyledLabel",as:"label",className:"text-surface-md truncate w-fit",children:r}),S.jsx(fe,{as:"span",variant:"P2",className:h,children:o.label||n})]}),S.jsx("div",{className:p,children:S.jsx(Ee,{type:"chevronDown",size:"sm"})})]})}function K1({id:e="",className:t="",dataTestId:r="",label:n="",placeholder:o="",value:a=void 0,options:i,disabled:s=!1,withSearch:l=!1,errorMessage:d="",dropdownClassName:f="",onChange:h=g=>{},onClick:p=()=>{}}){const g=_.useRef(null),y=_.useRef(null),[v,w]=_.useState(!1),[b,E]=_.useState(""),L=_.useMemo(()=>b?i.filter(Y=>Y.label.toLowerCase().startsWith(b.toLowerCase())):i,[b,i]),x=_.useMemo(()=>i.find(Y=>Y.value===a),[i,a]);to("Escape",()=>w(!1)),eo(g,y,()=>w(!1));const C=_.useCallback(Y=>{h(Y),w(!1)},[h]),j=_.useCallback(()=>{p()},[p]),z=D("w-full min-w-[230px]",t),re=D("absolute righ-0 top-[calc(100%+8px)] w-full bg-background rounded-2xl p-2","shadow-card z-50 transition-all duration-300 overflow-hidden overflow-y-auto","scrollbar-none max-h-[240px]",{"cursor-pointer":!!p,"pt-0":l},f);return S.jsxs("div",{className:z,"data-testid":r,onClick:j,children:[S.jsxs("div",{className:"relative",children:[S.jsx(G1,{label:n,buttonRef:g,hasError:!!d,id:e,disabled:s,isDropdownOpen:v,placeholder:o,selectedOption:x,onClick:()=>w(!v)}),v&&S.jsxs("div",{ref:y,className:re,children:[S.jsx("div",{className:D("sticky top-0 left-0 w-full bg-background",{hidden:!l}),children:S.jsx(Xn,{immediateFocus:!0,placeholder:"Search",value:b,onChange:E})}),S.jsx("ul",{className:"[&>*:last-child]:border-none",children:L.length?L.map((Y,ce)=>S.jsx(Y1,{dataTestId:`${r}-option-${Y.value}`,Icon:Y.Icon,label:Y.label,value:Y.value,onClick:C},`${Y.value}-${ce}`)):S.jsx(fe,{as:"p",variant:"P2",className:"truncate p-4 text-center",children:"No options"})})]})]}),S.jsx(fe,{variant:"P3",as:"span",className:D("text-error mt-1 pl-1",{invisible:v}),children:d})]})}const J1=Te(["border border-foreground","rounded-3xl","p-2","bg-transparent","flex items-center justify-center"],{variants:{variant:{primary:"bg-primary/10 border-primary/20 text-primary",accent:"bg-accent/10 border-accent/20 text-accent",success:"bg-success/10 border-success/20 text-success",warning:"bg-warning/10 border-warning/20 text-warning",error:"bg-error/10 border-error/20 text-error"}},defaultVariants:{variant:"primary"}});function Q1({label:e,variant:t,className:r,...n}){return S.jsx("div",{className:D(J1({variant:t,className:r})),...n,children:S.jsx(fe,{className:"text-inherit text-[9px]",variant:"StyledLabel",as:"span",children:e})})}function X1({id:e,className:t,label:r,checked:n,disabled:o,onToggle:a=()=>{},size:i="md"}){const s=_.useCallback(f=>{a(f.target.checked)},[a]),l=D("inline-flex items-center gap-4 cursor-pointer",t),d=D(["relative bg-surface-lo peer-focus:outline-none","rounded-full peer peer-checked:after:translate-x-full ","rtl:peer-checked:after:-translate-x-full peer-checked:after:border-background","after:content-[''] after:absolute","after:bg-background after:border-background after:border after:rounded-full","after:transition-all peer-checked:bg-primary",{"w-11 h-6 after:h-5 after:w-5 after:top-[2px] after:start-[2px]":i==="md","w-[30px] h-4 after:h-[14px] after:w-[14px] after:top-[1px] after:start-[1px]":i==="sm"}]);return S.jsxs("label",{className:l,children:[S.jsx("input",{type:"checkbox",checked:n,onChange:s,id:e,className:"sr-only peer",disabled:o}),S.jsx("div",{className:d}),r&&S.jsx(fe,{as:"span",variant:"P3",className:"text-inheret",children:r})]})}function ec({name:e,label:t,avatar:r,radius:n="full",className:o,...a}){const i=D("w-[36px] h-[36px] overflow-hidden",{"rounded-none":n==="none","rounded-full":n==="full","rounded-md":n==="md","rounded-sm":n==="sm"});return S.jsxs("div",{className:D("flex items-center gap-3",o),...a,children:[S.jsx("div",{className:i,children:r?S.jsx("img",{src:r,alt:"avatar",className:"size-full object-cover"}):S.jsx(Ee,{type:"didit",className:"size-full object-cover"})}),S.jsxs("div",{className:"flex flex-col gap-1",children:[S.jsx(fe,{className:"text-foreground",as:"h6",variant:"H6",children:e}),t&&S.jsx(fe,{className:"text-surface-md",as:"span",variant:"Label3",children:t})]})]})}exports.Button=Qs;exports.Card=ei;exports.CheckBox=ri;exports.CopyValue=oi;exports.DiditAnimatedLogo=si;exports.Icon=Ee;exports.IconButton=kn;exports.Input=li;exports.MediaQuery=tt;exports.Modal=kl;exports.QrCode=g1;exports.SearchInput=v1;exports.SearchMini=Xn;exports.SelectDropdown=K1;exports.Spinner=xn;exports.StatusLabel=Q1;exports.Text=fe;exports.Toggle=X1;exports.Tooltip=St;exports.UserCard=ec;exports.cn=D;exports.svgOptions=En;exports.useKeyPress=to;exports.useLgMediaQuery=z1;exports.useMdMediaQuery=U1;exports.useMediaQuery=at;exports.useOnClickOutside=eo;exports.useSmMediaQuery=$1;exports.useXlMediaQuery=Z1;exports.useXxlMediaQuery=q1;
|
package/dist/diditui.d.ts
CHANGED
|
@@ -268,7 +268,7 @@ declare const textStyles: (props?: ({
|
|
|
268
268
|
underline?: boolean | null | undefined;
|
|
269
269
|
} & ClassProp) | undefined) => string;
|
|
270
270
|
|
|
271
|
-
export declare function Toggle({ id, className, label, checked, disabled, onToggle }: ToggleProps): JSX_2.Element;
|
|
271
|
+
export declare function Toggle({ id, className, label, checked, disabled, onToggle, size }: ToggleProps): JSX_2.Element;
|
|
272
272
|
|
|
273
273
|
declare interface ToggleProps {
|
|
274
274
|
id?: string;
|
|
@@ -276,6 +276,7 @@ declare interface ToggleProps {
|
|
|
276
276
|
checked?: boolean;
|
|
277
277
|
disabled?: boolean;
|
|
278
278
|
label?: string;
|
|
279
|
+
size?: 'sm' | 'md';
|
|
279
280
|
onToggle?: (checked: boolean) => void;
|
|
280
281
|
}
|
|
281
282
|
|
package/dist/diditui.js
CHANGED
|
@@ -2895,7 +2895,7 @@ const le = (e) => {
|
|
|
2895
2895
|
XL: fa,
|
|
2896
2896
|
XXL: pa
|
|
2897
2897
|
};
|
|
2898
|
-
function
|
|
2898
|
+
function D(...e) {
|
|
2899
2899
|
return la(Rt(e));
|
|
2900
2900
|
}
|
|
2901
2901
|
function Rn(e) {
|
|
@@ -3183,7 +3183,7 @@ const Yr = (e) => typeof e == "boolean" ? "".concat(e) : e === 0 ? "0" : e, Gr =
|
|
|
3183
3183
|
});
|
|
3184
3184
|
function ke({ type: e = "scan", size: t, className: r, ...n }) {
|
|
3185
3185
|
const o = Ji[e] || null;
|
|
3186
|
-
return /* @__PURE__ */ L.jsx("span", { className:
|
|
3186
|
+
return /* @__PURE__ */ L.jsx("span", { className: D(Qi({ size: t, className: r })), ...n, children: /* @__PURE__ */ L.jsx(o, { className: "size-full text-current" }) });
|
|
3187
3187
|
}
|
|
3188
3188
|
const Xi = Ne(["flex items-center justify-center animate-spin"], {
|
|
3189
3189
|
variants: {
|
|
@@ -3221,7 +3221,7 @@ function es({ size: e, variant: t = "default", className: r, ...n }) {
|
|
|
3221
3221
|
"stroke-accent": t === "accent",
|
|
3222
3222
|
"stroke-error": t === "error"
|
|
3223
3223
|
});
|
|
3224
|
-
return /* @__PURE__ */ L.jsx("span", { className:
|
|
3224
|
+
return /* @__PURE__ */ L.jsx("span", { className: D(Xi({ size: e, className: r })), ...n, children: /* @__PURE__ */ L.jsxs(
|
|
3225
3225
|
"svg",
|
|
3226
3226
|
{
|
|
3227
3227
|
className: "size-full",
|
|
@@ -3313,7 +3313,7 @@ function Y1({
|
|
|
3313
3313
|
children: i,
|
|
3314
3314
|
...l
|
|
3315
3315
|
}) {
|
|
3316
|
-
const d =
|
|
3316
|
+
const d = D([
|
|
3317
3317
|
"absolute right-2 p-[7px] rounded-full z-20 flex justify-end items-center",
|
|
3318
3318
|
"transition-color duration-300",
|
|
3319
3319
|
{
|
|
@@ -3324,7 +3324,7 @@ function Y1({
|
|
|
3324
3324
|
"bg-background text-error": t === "error",
|
|
3325
3325
|
"bg-transparent text-surface-mdlo": a
|
|
3326
3326
|
}
|
|
3327
|
-
]), f =
|
|
3327
|
+
]), f = D([
|
|
3328
3328
|
"hidden absolute right-2 size-7",
|
|
3329
3329
|
"bg-background rounded-full z-10 transition-all duration-300",
|
|
3330
3330
|
"group-hover:w-[calc(100%-4px)] group-hover:right-[2px] group-hover:h-[calc(100%-4px)]",
|
|
@@ -3341,7 +3341,7 @@ function Y1({
|
|
|
3341
3341
|
return /* @__PURE__ */ L.jsxs(
|
|
3342
3342
|
"button",
|
|
3343
3343
|
{
|
|
3344
|
-
className:
|
|
3344
|
+
className: D(ts({ variant: t, size: e, isLoading: n, disabled: a, animate: o, className: s })),
|
|
3345
3345
|
...l,
|
|
3346
3346
|
children: [
|
|
3347
3347
|
/* @__PURE__ */ L.jsx("span", { className: "text-sm font-medium leading-[90%] tracking-tight w-full text-center z-30 text-inherit", children: i }),
|
|
@@ -3370,7 +3370,7 @@ const rs = Ne(["w-full rounded-[32px] overflow-hidden bg-background"], {
|
|
|
3370
3370
|
}
|
|
3371
3371
|
});
|
|
3372
3372
|
function G1({ className: e, padding: t, shadow: r, children: n, ...o }) {
|
|
3373
|
-
return /* @__PURE__ */ L.jsx("div", { className:
|
|
3373
|
+
return /* @__PURE__ */ L.jsx("div", { className: D(rs({ shadow: r, padding: t, className: e })), ...o, children: n });
|
|
3374
3374
|
}
|
|
3375
3375
|
const ns = Ne("font-inter", {
|
|
3376
3376
|
variants: {
|
|
@@ -3416,7 +3416,7 @@ const ns = Ne("font-inter", {
|
|
|
3416
3416
|
l,
|
|
3417
3417
|
{
|
|
3418
3418
|
ref: i,
|
|
3419
|
-
className:
|
|
3419
|
+
className: D(
|
|
3420
3420
|
ns({
|
|
3421
3421
|
variant: t,
|
|
3422
3422
|
italic: n,
|
|
@@ -3440,7 +3440,7 @@ function K1({
|
|
|
3440
3440
|
onToggle: s = () => {
|
|
3441
3441
|
}
|
|
3442
3442
|
}) {
|
|
3443
|
-
const i =
|
|
3443
|
+
const i = D(["inline-flex items-center gap-4"], t), l = D([
|
|
3444
3444
|
"w-5 h-5 text-primary hover:bg-surface-lo border border-surface-mdlo rounded",
|
|
3445
3445
|
"focus:ring-transparent focus:ring-0 focus:outline-none",
|
|
3446
3446
|
n === "sm" && "w-4 h-4",
|
|
@@ -3481,13 +3481,13 @@ function cr({ label: e, children: t, direction: r = "top", className: n }) {
|
|
|
3481
3481
|
i.current.style.top = `${h}px`, i.current.style.left = `${p}px`;
|
|
3482
3482
|
}
|
|
3483
3483
|
}, [l]);
|
|
3484
|
-
const d =
|
|
3484
|
+
const d = D(
|
|
3485
3485
|
"absolute z-10 px-3 py-2",
|
|
3486
3486
|
"bg-surface-hi rounded-xl shadow-sm",
|
|
3487
3487
|
"transition-opacity duration-300",
|
|
3488
3488
|
"text-background text-sm",
|
|
3489
3489
|
{ hidden: !o }
|
|
3490
|
-
), f =
|
|
3490
|
+
), f = D([
|
|
3491
3491
|
"absolute w-3 h-3 bg-surface-hi",
|
|
3492
3492
|
"transform rotate-45",
|
|
3493
3493
|
{
|
|
@@ -3501,7 +3501,7 @@ function cr({ label: e, children: t, direction: r = "top", className: n }) {
|
|
|
3501
3501
|
return /* @__PURE__ */ L.jsxs(
|
|
3502
3502
|
"div",
|
|
3503
3503
|
{
|
|
3504
|
-
className:
|
|
3504
|
+
className: D("relative inline-flex", n),
|
|
3505
3505
|
ref: s,
|
|
3506
3506
|
onMouseEnter: () => a(!0),
|
|
3507
3507
|
onMouseLeave: () => a(!1),
|
|
@@ -3534,10 +3534,10 @@ const os = Ne(
|
|
|
3534
3534
|
function J1({ label: e, value: t, isSecret: r, className: n, onCopy: o, ...a }) {
|
|
3535
3535
|
const [s, i] = Ie(r), l = Be(() => {
|
|
3536
3536
|
navigator.clipboard.writeText(t), o == null || o();
|
|
3537
|
-
}, [t, o]), d =
|
|
3537
|
+
}, [t, o]), d = D("text-inherit group-hover:text-foreground truncate", {
|
|
3538
3538
|
blur: s
|
|
3539
3539
|
});
|
|
3540
|
-
return /* @__PURE__ */ L.jsxs("div", { className:
|
|
3540
|
+
return /* @__PURE__ */ L.jsxs("div", { className: D(os({ isSecret: r, className: n })), ...a, children: [
|
|
3541
3541
|
e && /* @__PURE__ */ L.jsx(pe, { className: "text-inherit text-nowrap", variant: "StyledLabel", as: "span", children: e }),
|
|
3542
3542
|
/* @__PURE__ */ L.jsx(pe, { className: d, variant: "P3", as: "p", children: t }),
|
|
3543
3543
|
r && /* @__PURE__ */ L.jsx(cr, { label: s ? "Show" : "Hide", children: /* @__PURE__ */ L.jsx("button", { onClick: () => i((f) => !f), children: /* @__PURE__ */ L.jsx(
|
|
@@ -3570,7 +3570,7 @@ const as = Ne(
|
|
|
3570
3570
|
}
|
|
3571
3571
|
);
|
|
3572
3572
|
function Q1({ size: e, animate: t = !0, backgroundClassName: r }) {
|
|
3573
|
-
const n =
|
|
3573
|
+
const n = D(
|
|
3574
3574
|
"p-3.5 w-[150%] h-[120%] absolute -top-[10%] -left-1/4",
|
|
3575
3575
|
"bg-gradient-to-bl from-[#493dd1] via-[#2a57f6] to-[#9ecffb] from-10% via-30% to-70%",
|
|
3576
3576
|
{ "animate-spin": t }
|
|
@@ -3580,7 +3580,7 @@ function Q1({ size: e, animate: t = !0, backgroundClassName: r }) {
|
|
|
3580
3580
|
/* @__PURE__ */ L.jsx(
|
|
3581
3581
|
"div",
|
|
3582
3582
|
{
|
|
3583
|
-
className:
|
|
3583
|
+
className: D(
|
|
3584
3584
|
"relative z-20 aspect-[0.70] w-3/4 rounded-full bg-background",
|
|
3585
3585
|
r
|
|
3586
3586
|
)
|
|
@@ -3627,7 +3627,7 @@ function ss({
|
|
|
3627
3627
|
className: a,
|
|
3628
3628
|
...s
|
|
3629
3629
|
}) {
|
|
3630
|
-
const i =
|
|
3630
|
+
const i = D(
|
|
3631
3631
|
[
|
|
3632
3632
|
"flex flex-col items-center justify-center gap-[6px] text-surface-hi",
|
|
3633
3633
|
"opacity-70 hover:opacity-100 transition-opacity duration-300",
|
|
@@ -3639,7 +3639,7 @@ function ss({
|
|
|
3639
3639
|
}
|
|
3640
3640
|
);
|
|
3641
3641
|
return /* @__PURE__ */ L.jsxs("button", { className: i, ...s, children: [
|
|
3642
|
-
/* @__PURE__ */ L.jsx("div", { className:
|
|
3642
|
+
/* @__PURE__ */ L.jsx("div", { className: D(is({ size: r, variant: n, withBorder: o })), children: /* @__PURE__ */ L.jsx(ke, { className: "text-inherit", type: e, size: r }) }),
|
|
3643
3643
|
t && /* @__PURE__ */ L.jsx(pe, { className: "text-inherit", variant: "P3", children: t })
|
|
3644
3644
|
] });
|
|
3645
3645
|
}
|
|
@@ -3658,7 +3658,7 @@ function X1({
|
|
|
3658
3658
|
onCopyClick: f,
|
|
3659
3659
|
...h
|
|
3660
3660
|
}) {
|
|
3661
|
-
const p = Me(null), [g, y] = Ie(!1), v = s && r && !i, w = i && r, b =
|
|
3661
|
+
const p = Me(null), [g, y] = Ie(!1), v = s && r && !i, w = i && r, b = D(
|
|
3662
3662
|
"w-full min-h-[68px] py-4 px-5 cursor-text rounded-3xl",
|
|
3663
3663
|
"flex items-center gap-2 bg-surface-lo hover:bg-surface-ulo",
|
|
3664
3664
|
"transition-all duration-300 border border-transparent",
|
|
@@ -3668,13 +3668,13 @@ function X1({
|
|
|
3668
3668
|
"bg-transparent border-foreground hover:bg-transparent": g,
|
|
3669
3669
|
"border-error": g && a
|
|
3670
3670
|
}
|
|
3671
|
-
), E =
|
|
3671
|
+
), E = D(
|
|
3672
3672
|
"text-sm font-normal leading-[140%] tracking-tight p-0 bg-transparent",
|
|
3673
3673
|
"placeholder:text-sm placeholder:font-normal border-transparent",
|
|
3674
3674
|
"placeholder:leading-[140%] placeholder:tracking-tight",
|
|
3675
3675
|
"placeholder:text-surface-mdlo",
|
|
3676
3676
|
"focus:ring-0 focus:border-transparent"
|
|
3677
|
-
), S =
|
|
3677
|
+
), S = D([
|
|
3678
3678
|
"size-8 flex justify-center align-items-center hover:opacity-80",
|
|
3679
3679
|
"text-surface-md",
|
|
3680
3680
|
{ invisible: !v && !w }
|
|
@@ -5143,7 +5143,7 @@ var ln = Object.assign || function(e) {
|
|
|
5143
5143
|
return function(t, r, n) {
|
|
5144
5144
|
return r && e(t.prototype, r), n && e(t, n), t;
|
|
5145
5145
|
};
|
|
5146
|
-
}(), Vn = At, Ot = Ct(Vn), dl = _o, Nt = Ct(dl), fl = Nn,
|
|
5146
|
+
}(), Vn = At, Ot = Ct(Vn), dl = _o, Nt = Ct(dl), fl = Nn, V = Ct(fl), pl = il, cn = Ct(pl), hl = Se, ml = vl(hl), Ae = xe, un = Ct(Ae), gl = cl;
|
|
5147
5147
|
function vl(e) {
|
|
5148
5148
|
if (e && e.__esModule)
|
|
5149
5149
|
return e;
|
|
@@ -5251,44 +5251,44 @@ var it = function(e) {
|
|
|
5251
5251
|
}]), t;
|
|
5252
5252
|
}(Vn.Component);
|
|
5253
5253
|
it.propTypes = {
|
|
5254
|
-
isOpen:
|
|
5255
|
-
style:
|
|
5256
|
-
content:
|
|
5257
|
-
overlay:
|
|
5254
|
+
isOpen: V.default.bool.isRequired,
|
|
5255
|
+
style: V.default.shape({
|
|
5256
|
+
content: V.default.object,
|
|
5257
|
+
overlay: V.default.object
|
|
5258
5258
|
}),
|
|
5259
|
-
portalClassName:
|
|
5260
|
-
bodyOpenClassName:
|
|
5261
|
-
htmlOpenClassName:
|
|
5262
|
-
className:
|
|
5263
|
-
base:
|
|
5264
|
-
afterOpen:
|
|
5265
|
-
beforeClose:
|
|
5259
|
+
portalClassName: V.default.string,
|
|
5260
|
+
bodyOpenClassName: V.default.string,
|
|
5261
|
+
htmlOpenClassName: V.default.string,
|
|
5262
|
+
className: V.default.oneOfType([V.default.string, V.default.shape({
|
|
5263
|
+
base: V.default.string.isRequired,
|
|
5264
|
+
afterOpen: V.default.string.isRequired,
|
|
5265
|
+
beforeClose: V.default.string.isRequired
|
|
5266
5266
|
})]),
|
|
5267
|
-
overlayClassName:
|
|
5268
|
-
base:
|
|
5269
|
-
afterOpen:
|
|
5270
|
-
beforeClose:
|
|
5267
|
+
overlayClassName: V.default.oneOfType([V.default.string, V.default.shape({
|
|
5268
|
+
base: V.default.string.isRequired,
|
|
5269
|
+
afterOpen: V.default.string.isRequired,
|
|
5270
|
+
beforeClose: V.default.string.isRequired
|
|
5271
5271
|
})]),
|
|
5272
|
-
appElement:
|
|
5273
|
-
onAfterOpen:
|
|
5274
|
-
onRequestClose:
|
|
5275
|
-
closeTimeoutMS:
|
|
5276
|
-
ariaHideApp:
|
|
5277
|
-
shouldFocusAfterRender:
|
|
5278
|
-
shouldCloseOnOverlayClick:
|
|
5279
|
-
shouldReturnFocusAfterClose:
|
|
5280
|
-
preventScroll:
|
|
5281
|
-
parentSelector:
|
|
5282
|
-
aria:
|
|
5283
|
-
data:
|
|
5284
|
-
role:
|
|
5285
|
-
contentLabel:
|
|
5286
|
-
shouldCloseOnEsc:
|
|
5287
|
-
overlayRef:
|
|
5288
|
-
contentRef:
|
|
5289
|
-
id:
|
|
5290
|
-
overlayElement:
|
|
5291
|
-
contentElement:
|
|
5272
|
+
appElement: V.default.oneOfType([V.default.instanceOf(un.default), V.default.instanceOf(Ae.SafeHTMLCollection), V.default.instanceOf(Ae.SafeNodeList), V.default.arrayOf(V.default.instanceOf(un.default))]),
|
|
5273
|
+
onAfterOpen: V.default.func,
|
|
5274
|
+
onRequestClose: V.default.func,
|
|
5275
|
+
closeTimeoutMS: V.default.number,
|
|
5276
|
+
ariaHideApp: V.default.bool,
|
|
5277
|
+
shouldFocusAfterRender: V.default.bool,
|
|
5278
|
+
shouldCloseOnOverlayClick: V.default.bool,
|
|
5279
|
+
shouldReturnFocusAfterClose: V.default.bool,
|
|
5280
|
+
preventScroll: V.default.bool,
|
|
5281
|
+
parentSelector: V.default.func,
|
|
5282
|
+
aria: V.default.object,
|
|
5283
|
+
data: V.default.object,
|
|
5284
|
+
role: V.default.string,
|
|
5285
|
+
contentLabel: V.default.string,
|
|
5286
|
+
shouldCloseOnEsc: V.default.bool,
|
|
5287
|
+
overlayRef: V.default.func,
|
|
5288
|
+
contentRef: V.default.func,
|
|
5289
|
+
id: V.default.string,
|
|
5290
|
+
overlayElement: V.default.func,
|
|
5291
|
+
contentElement: V.default.func
|
|
5292
5292
|
};
|
|
5293
5293
|
it.defaultProps = {
|
|
5294
5294
|
isOpen: !1,
|
|
@@ -5374,13 +5374,13 @@ function ec({
|
|
|
5374
5374
|
Oe(() => {
|
|
5375
5375
|
typeof window < "u" && pn.setAppElement(a);
|
|
5376
5376
|
}, [a]);
|
|
5377
|
-
const l =
|
|
5377
|
+
const l = D([
|
|
5378
5378
|
"fixed right-0 left-0 bottom-0 z-[1000] h-screen overflow-y-auto",
|
|
5379
5379
|
"overflow-x-hidden md:inset-0 md:h-full bg-foreground/5 backdrop-blur-md",
|
|
5380
5380
|
r
|
|
5381
|
-
]), d =
|
|
5381
|
+
]), d = D([
|
|
5382
5382
|
"font-inter size-full flex items-end justify-center md:items-center overflow-visible"
|
|
5383
|
-
]), f =
|
|
5383
|
+
]), f = D([
|
|
5384
5384
|
"relative max-h-[90%] overflow-hidden rounded-t-[32px]",
|
|
5385
5385
|
"bg-background animate-slide-in shadow-card opacity-0 pt-6",
|
|
5386
5386
|
"md:rounded-[32px] md:max-w-[90%]",
|
|
@@ -6969,10 +6969,10 @@ function tc({ uri: e, size: t = "md", color: r, iconName: n = "didit", className
|
|
|
6969
6969
|
const s = typeof t == "number" ? t : p1[t], i = _t(
|
|
6970
6970
|
() => f1.generate(e, s, s / 4, r),
|
|
6971
6971
|
[e, s, r]
|
|
6972
|
-
), l =
|
|
6972
|
+
), l = D(
|
|
6973
6973
|
["size-fit", "flex items-center justify-center", "relative overflow-hidden aspect-square"],
|
|
6974
6974
|
o
|
|
6975
|
-
), d =
|
|
6975
|
+
), d = D([
|
|
6976
6976
|
"size-full absolute top-1/2 left-1/2",
|
|
6977
6977
|
"transform -translate-x-1/2 -translate-y-1/2 scale-[0.25]",
|
|
6978
6978
|
"text-primary rounded-3xl overflow-hidden"
|
|
@@ -6993,7 +6993,7 @@ function rc({
|
|
|
6993
6993
|
},
|
|
6994
6994
|
...i
|
|
6995
6995
|
}) {
|
|
6996
|
-
const l = Me(null), [d, f] = Ie(!1), h =
|
|
6996
|
+
const l = Me(null), [d, f] = Ie(!1), h = D(
|
|
6997
6997
|
[
|
|
6998
6998
|
"w-full overflow-hidden min-h-[68px] py-2 pr-2 cursor-pointer",
|
|
6999
6999
|
"flex items-center gap-2 border-b-[1.5px] border-transparent",
|
|
@@ -7005,18 +7005,18 @@ function rc({
|
|
|
7005
7005
|
"border-error": a
|
|
7006
7006
|
},
|
|
7007
7007
|
o
|
|
7008
|
-
), p =
|
|
7008
|
+
), p = D([
|
|
7009
7009
|
" placeholder:text-sm placeholder:font-normal placeholder:leading-[140%]",
|
|
7010
7010
|
"placeholder:text-surface-mdlo text-sm font-normal leading-[140%]",
|
|
7011
7011
|
"placeholder:tracking-tight tracking-tight",
|
|
7012
7012
|
"focus:ring-0 active:border-none bg-transparent border-none transition-all duration-300",
|
|
7013
7013
|
"p-0 m-0"
|
|
7014
|
-
]), g =
|
|
7014
|
+
]), g = D(
|
|
7015
7015
|
["flex justify-center align-items-center hover:opacity-80 p-[2px]"],
|
|
7016
7016
|
{
|
|
7017
7017
|
invisible: !r
|
|
7018
7018
|
}
|
|
7019
|
-
), y =
|
|
7019
|
+
), y = D(
|
|
7020
7020
|
["rounded-full bg-surface-ulo p-[9px] opacity-70", "cursor-pointer hover:opacity-100"],
|
|
7021
7021
|
{
|
|
7022
7022
|
"opacity-100": d,
|
|
@@ -7193,17 +7193,17 @@ function B1({
|
|
|
7193
7193
|
var y;
|
|
7194
7194
|
o && ((y = i == null ? void 0 : i.current) == null || y.focus());
|
|
7195
7195
|
}, []);
|
|
7196
|
-
const h =
|
|
7196
|
+
const h = D(
|
|
7197
7197
|
"flex w-full items-center gap-3 px-4 py-3",
|
|
7198
7198
|
"border-b border-surface-ulo text-surface-hi",
|
|
7199
7199
|
t
|
|
7200
|
-
), p =
|
|
7200
|
+
), p = D(
|
|
7201
7201
|
"text-xs remove-arrow :focus:shadow-none grow shrink-0 truncate",
|
|
7202
7202
|
"placeholder:body-text placeholder:text-surface-md",
|
|
7203
7203
|
"border-none bg-transparent p-0 !shadow-none outline-none ring-0 ring-offset-0",
|
|
7204
7204
|
"focus:border-none focus:outline-none focus:ring-0",
|
|
7205
7205
|
"disabled:opacity-25"
|
|
7206
|
-
), g =
|
|
7206
|
+
), g = D("shrink-0", { "opacity-25 transition-opacity duration-300": !l });
|
|
7207
7207
|
return /* @__PURE__ */ L.jsxs("div", { className: h, id: e, children: [
|
|
7208
7208
|
/* @__PURE__ */ L.jsx("div", { className: g, children: /* @__PURE__ */ L.jsx(ke, { size: "sm", type: "search" }) }),
|
|
7209
7209
|
/* @__PURE__ */ L.jsx(
|
|
@@ -7315,7 +7315,7 @@ function $1({
|
|
|
7315
7315
|
hasError: l = !1,
|
|
7316
7316
|
onClick: d
|
|
7317
7317
|
}) {
|
|
7318
|
-
const f =
|
|
7318
|
+
const f = D(
|
|
7319
7319
|
"w-full min-h-[68px] py-4 px-5 rounded-3xl",
|
|
7320
7320
|
"flex items-center gap-2 bg-surface-lo hover:bg-surface-ulo",
|
|
7321
7321
|
"transition-all duration-300 border border-transparent",
|
|
@@ -7326,10 +7326,10 @@ function $1({
|
|
|
7326
7326
|
"border-error": s && l
|
|
7327
7327
|
},
|
|
7328
7328
|
t
|
|
7329
|
-
), h =
|
|
7329
|
+
), h = D("truncate w-fit", {
|
|
7330
7330
|
"text-surface-background": o.value,
|
|
7331
7331
|
"text-surface-md": !o.value
|
|
7332
|
-
}), p =
|
|
7332
|
+
}), p = D([
|
|
7333
7333
|
"transition-all duration-300",
|
|
7334
7334
|
{
|
|
7335
7335
|
"-rotate-180": s
|
|
@@ -7372,7 +7372,7 @@ function lc({
|
|
|
7372
7372
|
[h]
|
|
7373
7373
|
), N = Be(() => {
|
|
7374
7374
|
p();
|
|
7375
|
-
}, [p]), z =
|
|
7375
|
+
}, [p]), z = D("w-full min-w-[230px]", t), re = D(
|
|
7376
7376
|
"absolute righ-0 top-[calc(100%+8px)] w-full bg-background rounded-2xl p-2",
|
|
7377
7377
|
"shadow-card z-50 transition-all duration-300 overflow-hidden overflow-y-auto",
|
|
7378
7378
|
"scrollbar-none max-h-[240px]",
|
|
@@ -7402,7 +7402,7 @@ function lc({
|
|
|
7402
7402
|
/* @__PURE__ */ L.jsx(
|
|
7403
7403
|
"div",
|
|
7404
7404
|
{
|
|
7405
|
-
className:
|
|
7405
|
+
className: D("sticky top-0 left-0 w-full bg-background", {
|
|
7406
7406
|
hidden: !l
|
|
7407
7407
|
}),
|
|
7408
7408
|
children: /* @__PURE__ */ L.jsx(
|
|
@@ -7434,7 +7434,7 @@ function lc({
|
|
|
7434
7434
|
{
|
|
7435
7435
|
variant: "P3",
|
|
7436
7436
|
as: "span",
|
|
7437
|
-
className:
|
|
7437
|
+
className: D("text-error mt-1 pl-1", { invisible: v }),
|
|
7438
7438
|
children: d
|
|
7439
7439
|
}
|
|
7440
7440
|
)
|
|
@@ -7464,17 +7464,36 @@ const U1 = Ne(
|
|
|
7464
7464
|
}
|
|
7465
7465
|
);
|
|
7466
7466
|
function cc({ label: e, variant: t, className: r, ...n }) {
|
|
7467
|
-
return /* @__PURE__ */ L.jsx("div", { className:
|
|
7467
|
+
return /* @__PURE__ */ L.jsx("div", { className: D(U1({ variant: t, className: r })), ...n, children: /* @__PURE__ */ L.jsx(pe, { className: "text-inherit text-[9px]", variant: "StyledLabel", as: "span", children: e }) });
|
|
7468
7468
|
}
|
|
7469
|
-
function uc({
|
|
7470
|
-
|
|
7471
|
-
|
|
7472
|
-
|
|
7473
|
-
|
|
7469
|
+
function uc({
|
|
7470
|
+
id: e,
|
|
7471
|
+
className: t,
|
|
7472
|
+
label: r,
|
|
7473
|
+
checked: n,
|
|
7474
|
+
disabled: o,
|
|
7475
|
+
onToggle: a = () => {
|
|
7476
|
+
},
|
|
7477
|
+
size: s = "md"
|
|
7478
|
+
}) {
|
|
7479
|
+
const i = Be(
|
|
7480
|
+
(f) => {
|
|
7481
|
+
a(f.target.checked);
|
|
7474
7482
|
},
|
|
7475
7483
|
[a]
|
|
7476
|
-
)
|
|
7477
|
-
|
|
7484
|
+
), l = D("inline-flex items-center gap-4 cursor-pointer", t), d = D([
|
|
7485
|
+
"relative bg-surface-lo peer-focus:outline-none",
|
|
7486
|
+
"rounded-full peer peer-checked:after:translate-x-full ",
|
|
7487
|
+
"rtl:peer-checked:after:-translate-x-full peer-checked:after:border-background",
|
|
7488
|
+
"after:content-[''] after:absolute",
|
|
7489
|
+
"after:bg-background after:border-background after:border after:rounded-full",
|
|
7490
|
+
"after:transition-all peer-checked:bg-primary",
|
|
7491
|
+
{
|
|
7492
|
+
"w-11 h-6 after:h-5 after:w-5 after:top-[2px] after:start-[2px]": s === "md",
|
|
7493
|
+
"w-[30px] h-4 after:h-[14px] after:w-[14px] after:top-[1px] after:start-[1px]": s === "sm"
|
|
7494
|
+
}
|
|
7495
|
+
]);
|
|
7496
|
+
return /* @__PURE__ */ L.jsxs("label", { className: l, children: [
|
|
7478
7497
|
/* @__PURE__ */ L.jsx(
|
|
7479
7498
|
"input",
|
|
7480
7499
|
{
|
|
@@ -7486,18 +7505,18 @@ function uc({ id: e, className: t, label: r, checked: n, disabled: o, onToggle:
|
|
|
7486
7505
|
disabled: o
|
|
7487
7506
|
}
|
|
7488
7507
|
),
|
|
7489
|
-
/* @__PURE__ */ L.jsx("div", { className:
|
|
7508
|
+
/* @__PURE__ */ L.jsx("div", { className: d }),
|
|
7490
7509
|
r && /* @__PURE__ */ L.jsx(pe, { as: "span", variant: "P3", className: "text-inheret", children: r })
|
|
7491
7510
|
] });
|
|
7492
7511
|
}
|
|
7493
7512
|
function dc({ name: e, label: t, avatar: r, radius: n = "full", className: o, ...a }) {
|
|
7494
|
-
const s =
|
|
7513
|
+
const s = D("w-[36px] h-[36px] overflow-hidden", {
|
|
7495
7514
|
"rounded-none": n === "none",
|
|
7496
7515
|
"rounded-full": n === "full",
|
|
7497
7516
|
"rounded-md": n === "md",
|
|
7498
7517
|
"rounded-sm": n === "sm"
|
|
7499
7518
|
});
|
|
7500
|
-
return /* @__PURE__ */ L.jsxs("div", { className:
|
|
7519
|
+
return /* @__PURE__ */ L.jsxs("div", { className: D("flex items-center gap-3", o), ...a, children: [
|
|
7501
7520
|
/* @__PURE__ */ L.jsx("div", { className: s, children: r ? /* @__PURE__ */ L.jsx("img", { src: r, alt: "avatar", className: "size-full object-cover" }) : /* @__PURE__ */ L.jsx(ke, { type: "didit", className: "size-full object-cover" }) }),
|
|
7502
7521
|
/* @__PURE__ */ L.jsxs("div", { className: "flex flex-col gap-1", children: [
|
|
7503
7522
|
/* @__PURE__ */ L.jsx(pe, { className: "text-foreground", as: "h6", variant: "H6", children: e }),
|
|
@@ -7526,7 +7545,7 @@ export {
|
|
|
7526
7545
|
uc as Toggle,
|
|
7527
7546
|
cr as Tooltip,
|
|
7528
7547
|
dc as UserCard,
|
|
7529
|
-
|
|
7548
|
+
D as cn,
|
|
7530
7549
|
Ji as svgOptions,
|
|
7531
7550
|
V1 as useKeyPress,
|
|
7532
7551
|
ac as useLgMediaQuery,
|