polpo 0.1.8 → 0.1.9
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/components.cjs +1 -29
- package/dist/components.cjs.map +1 -1
- package/dist/components.css +2 -0
- package/dist/components.css.map +1 -0
- package/dist/components.js +1 -29
- package/dist/components.js.map +1 -1
- package/dist/layouts.cjs +1 -2
- package/dist/layouts.cjs.map +1 -1
- package/dist/layouts.css +2 -0
- package/dist/layouts.css.map +1 -0
- package/dist/layouts.js +1 -2
- package/dist/layouts.js.map +1 -1
- package/package.json +3 -3
package/dist/components.js
CHANGED
|
@@ -1,31 +1,3 @@
|
|
|
1
1
|
"use client";
|
|
2
|
-
import{createContext as gr,useCallback as br,useContext as yr,useMemo as vr,useState as Cr}from"react";import{useMemo as zt}from"react";var h=e=>zt(()=>Object.entries(e).reduce((o,[t,r])=>r?[...o,t]:o,[]).join(" "),[e]);import{useEffect as Ht,useLayoutEffect as Bt,useRef as $t}from"react";function L(e,o,t,r){let a=$t(o);Ht(()=>{a.current=o},[o]),Bt(()=>{let n=t?.current??window;if(!(n&&n.addEventListener))return;let i=s=>a.current(s);return n.addEventListener(e,i,r),()=>{n.removeEventListener(e,i,r)}},[e,t,r])}var Gt=(e,o)=>e.current&&!e.current.contains(o),Je=(e,o)=>{L("keydown",t=>{t.key==="Escape"&&o()}),L("mousedown",t=>{let r=t.target;if(!r?.isConnected)return;(Array.isArray(e)?e:[e]).every(n=>Gt(n,r))&&o()})};import{useEffect as Ut,useState as Vt}from"react";var eo=(e,o=500)=>{let[t,r]=Vt(e);return Ut(()=>{let a=setTimeout(()=>r(e),o);return()=>{clearTimeout(a)}},[e,o]),t};import{useEffect as jt}from"react";var Z=(e,o)=>{jt(()=>{let t=Array.isArray(e)?e:[e],r=new ResizeObserver(o);return t.forEach(a=>a.current&&r.observe(a.current)),()=>{r.disconnect()}},[e,o])};import{useEffect as Yt,useState as _t}from"react";var oo=e=>{let o=document.getElementById(e);return o===null&&(o=document.createElement("div"),o.setAttribute("id",e),document.body.appendChild(o)),o},to=e=>{let[o,t]=_t(()=>oo(e));return Yt(()=>{let r=document.getElementById(e);if(o===null||r===null){let a=oo(e);t(a)}return()=>{o&&o.parentNode&&process.env.NODE_ENV==="production"&&document.body.removeChild(o)}},[o,e]),o};var re=(e,o=2)=>{if(e===0)return"0 Bytes";let t=1e3,r=o<0?0:o,a=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],n=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,n)).toFixed(r))+" "+a[n]};var ro=({c:e,m:o,offset:t,position:r})=>{let a=e.y+e.h+t,n=e.x-(o.w-e.w)*(50/100);switch(r){case"top":case"top center":a=e.y-o.h-t,n=e.x-(o.w-e.w)/2;break;case"top left":a=e.y-o.h-t,n=e.x-o.w+e.w;break;case"top right":a=e.y-o.h-t,n=e.x;break;case"bottom":case"bottom center":a=e.y+e.h+t,n=e.x-(o.w-e.w)/2;break;case"bottom left":a=e.y+e.h+t,n=e.x-o.w+e.w;break;case"bottom right":a=e.y+e.h+t,n=e.x;break;case"left":case"left center":a=e.y-(o.h-e.h)/2,n=e.x-o.w-t;break;case"left top":a=e.y-o.h+e.h,n=e.x-o.w-t;break;case"left bottom":a=e.y,n=e.x-o.w-t;break;case"right":case"right center":a=e.y-(o.h-e.h)/2,n=e.x+e.w+t;break;case"right top":a=e.y-o.h+e.h,n=e.x+e.w+t;break;case"right bottom":a=e.y,n=e.x+e.w+t;break}return{left:Math.round(n),top:Math.round(a)}},Wt=({top:e,left:o},t,r,a)=>{let n=t.split(" "),i=[],s=o+a.w+r-window.innerWidth,l=e+a.h+r-window.innerHeight;for(let c of n)c==="top"&&e<r?i.push("bottom"):c==="left"&&o<r?i.push("right"):c==="bottom"&&l>0?i.push("top"):c==="right"&&s>0?i.push("left"):i.push(c);return i.join(" ")},Xt=({top:e,left:o},t,r)=>{let a=o+t.w+r-window.innerWidth,n=e+t.h+r-window.innerHeight;return o=a>0?o-a:o,e=n>0?e-n:e,o=o<r?r:o,e=e<r?r:e,{top:e,left:o}},no=({c:e,m:o,offset:t,windowOffset:r,position:a})=>{let n={c:e,m:o,offset:t,position:a},i=ro(n),s=Wt(i,a,r,o);s!==a&&(i=ro({...n,position:s}));let l=Xt(i,o,r);return{left:`${l.left}px`,top:`${l.top}px`}};var ao=({position:e,windowOffset:o})=>{switch(e){case"center":return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case"top":case"top center":return{top:`${o}px`,left:"50%",transform:"translateX(-50%)"};case"top left":case"left top":return{top:`${o}px`,left:`${o}px`};case"top right":case"right top":return{top:`${o}px`,right:`${o}px`};case"bottom":case"bottom center":return{bottom:`${o}px`,left:"50%",transform:"translateX(-50%)"};case"left bottom":case"bottom left":return{bottom:`${o}px`,left:`${o}px`};case"right bottom":case"bottom right":return{bottom:`${o}px`,right:`${o}px`};case"left":case"left center":return{top:"50%",left:`${o}px`,transform:"translateY(-50%)"};case"right":case"right center":return{top:"50%",right:`${o}px`,transform:"translateY(-50%)"}}return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"}};import{useRef as Zt,useState as Kt}from"react";import{useEffect as Qt}from"react";var io=(e,o,t={})=>{Qt(()=>{let r=Array.isArray(e)?e:[e],a=new IntersectionObserver(o,t);return r.forEach(n=>n.current&&a.observe(n.current)),()=>{a.disconnect()}},[o,t,e])};var so=(e={})=>{let[o,t]=Kt(!1),r=Zt(null);return io(r,([a])=>{t(a.isIntersecting)},e),{ref:r,inView:o}};import{useCallback as Ee,useState as qt}from"react";var S=({onBlur:e,onFocus:o,onChange:t}={})=>{let[r,a]=qt(!1),n=Ee(l=>{a(!0),o&&o(l)},[o]),i=Ee(l=>{a(!1),e&&e(l)},[e]),s=Ee(l=>{t&&t(l)},[t]);return{isFocus:r,handlers:{onFocus:n,onBlur:i,onChange:s}}};import{useEffect as Jt,useState as er}from"react";var fe=e=>{let[o,t]=er(!1);return Jt(()=>{let r=window.matchMedia(e);r.matches!==o&&t(r.matches);let a=()=>{t(r.matches)};return r.addEventListener("change",a),()=>{r.removeEventListener("change",a)}},[o,e]),o};import{useRef as or,useState as tr}from"react";var lo=()=>{let e=or(null),[o,t]=tr(!1);return{containerRef:e,isOpen:o,openModal:()=>{t(!0)},closeModal:()=>{t(!1)}}};import{useCallback as co,useLayoutEffect as rr,useRef as nr}from"react";var po=e=>({x:e.x,y:e.y,w:e.width,h:e.height,top:e.top,left:e.left}),mo=({offset:e=0,windowOffset:o=0,position:t="bottom",modalRef:r,containerRef:a,isOpen:n})=>{let i=nr(null),s=co((c,m)=>{let p=c.current?.getClientRects()[0],d=m.current?.getClientRects()[0];if(!p)return;let u=d?no({c:po(d),m:po(p),offset:e,windowOffset:o,position:t}):ao({position:t,windowOffset:o});Object.keys(u).forEach(g=>{c.current?.style.setProperty(g,u[g])})},[t,o,e]),l=co(()=>{n&&s(r,a??i)},[s,n,a,r]);rr(l,[l]),Z(a??i,l),Z(r,l),L("resize",l),L("scroll",l,r)};import ar,{useCallback as uo,useEffect as ir,useLayoutEffect as sr,useMemo as lr}from"react";var fo=({transitionDuration:e=0,isOpen:o})=>{let[t,r]=ar.useState("CLOSED"),a=lr(()=>t!=="CLOSED",[t]);ir(()=>{document.documentElement.style.overflow=a?"hidden":"auto"},[a]);let n=uo(()=>{["OPENING","OPEN"].includes(t)&&(e>0?(r("CLOSING"),setTimeout(()=>{r("CLOSED")},e)):r("CLOSED"))},[t,e]),i=uo(()=>{["CLOSING","CLOSED"].includes(t)&&(e>0?(r("OPENING"),setTimeout(()=>{r("OPEN")},e)):r("OPEN"))},[t,e]);return sr(()=>{t==="CLOSED"&&o?i():t==="OPEN"&&!o&&n()},[o,i,n,t]),{isVisible:a,modalState:t}};import{useRef as cr,useState as pr}from"react";var ho=(e,o)=>{let{left:t,top:r}=e,a=t+window.scrollX,n=r+window.scrollY,i=o.pageX-a,s=o.pageY-n;return{x:o.pageX,y:o.pageY,elementX:i,elementY:s,elementPositionX:a,elementPositionY:n}},go=e=>{let o=cr(null),[t,r]=pr({x:null,y:null,elementX:null,elementY:null,elementPositionX:null,elementPositionY:null});return L("mousemove",n=>{let{clientX:i,clientY:s}=n;if(r(l=>({...l,x:i,y:s})),e?.current instanceof Element){let l=ho(e.current.getBoundingClientRect(),n);r(c=>({...c,...l}))}else if(o.current instanceof Element){let l=ho(o.current.getBoundingClientRect(),n);r(c=>({...c,...l}))}}),{...t,ref:o}};import{useCallback as dr,useState as mr}from"react";var bo=(e,o=0)=>{let[t,r]=mr(o),a=dr(n=>{r(n!==void 0?n:i=>(i+1)%e.length)},[e.length]);return[e[t],a]};function b(e,{insertAt:o}={}){if(!e||typeof document>"u")return;let t=document.head||document.getElementsByTagName("head")[0],r=document.createElement("style");r.type="text/css",o==="top"&&t.firstChild?t.insertBefore(r,t.firstChild):t.appendChild(r),r.styleSheet?r.styleSheet.cssText=e:r.appendChild(document.createTextNode(e))}b(`.custom-line{--color: attr(data-color, "currentColor");--size: attr(data-size, 1px);--spacing: attr(data-spacing, 1px);--dashSize: attr(data-dash-size, 1px);&.horizontal,&.vertical{background:var(--color);display:inline-block;border-radius:100px}&.horizontal{width:100%;height:var(--size);&.dotted{background:radial-gradient(calc(var(--size) / 2) calc(var(--size) / 2),var(--color) 100%,transparent) 0 0 / calc(var(--spacing) + var(--size)) 100%}&.dashed{background:repeating-linear-gradient(90deg,var(--color),var(--color) var(--dashSize),transparent var(--dashSize),transparent calc(var(--spacing) + var(--dashSize)))}}&.vertical{height:100%;width:var(--size);&.dotted{background:radial-gradient(calc(var(--size) / 2) calc(var(--size) / 2),var(--color) 100%,transparent) 0 0 / 100% calc(var(--spacing) + var(--size))}&.dashed{background:repeating-linear-gradient(0deg,var(--color),var(--color) var(--dashSize),transparent var(--dashSize),transparent calc(var(--spacing) + var(--dashSize)))}}}
|
|
3
|
-
`);import{jsx as hr}from"react/jsx-runtime";var ur=(t=>(t.VERTICAL="vertical",t.HORIZONTAL="horizontal",t))(ur||{}),fr=(r=>(r.SOLID="solid",r.DOTTED="dotted",r.DASHED="dashed",r))(fr||{}),he=({orientation:e="horizontal",className:o="",style:t={},color:r="currentColor",size:a=1,lineStyle:n="solid",dashedSize:i=1,spacing:s=1})=>{let l=h({"custom-line":!0,[e]:!0,[o]:!!o,[n]:!0});return hr("span",{className:l,style:{...t,"--color":r,"--size":`${a}px`,"--spacing":`${s}px`,"--dashSize":`${i}px`}})};b(`.accordion{display:grid}.accordion-item{display:grid;position:relative;.accordion-header{display:grid;grid-template-columns:1fr auto;align-items:center;gap:20px;cursor:pointer;position:sticky;top:0;padding:20px 0;&.has-start-content{grid-template-columns:auto 1fr auto}}.accordion-header-content{display:grid}.accordion-toggle-icon{transition:all .3s ease;&.isOpen{transform:rotate(-90deg)}}.accordion-body{padding:10px 0 20px}}
|
|
4
|
-
`);import{jsx as Me}from"react/jsx-runtime";var yo=gr(null),vo=e=>{let o=yr(yo);if(!o)throw new Error("You cant use this component out off an Accordion component");let{toggleItem:t,openedItems:r}=o,a=()=>t(e);return[r.includes(e),a]},Ui=({children:e,className:o="",noSeparators:t,multiple:r,style:a={},defaultOpened:n=[]})=>{let[i,s]=Cr(()=>(Array.isArray(n)?n:[n]).reduce((p,d)=>typeof d=="string"?{...p,[d]:!0}:p,{})),l=br(p=>{s(d=>({...r?d:{},[p]:!d[p]}))},[r]),c=vr(()=>Object.keys(i).filter(p=>i[p]),[i]),m=h({accordion:!0,[o]:!!o});return Me(yo.Provider,{value:{toggleItem:l,openedItems:c},children:Me("section",{className:m,style:a,children:(Array.isArray(e)?e:[e]).flatMap((p,d)=>d===0?p:[t?null:Me(he,{orientation:"horizontal"},`${d}.5`),p])})})};import{useMemo as Rr}from"react";import{FaCaretLeft as wr}from"react-icons/fa";import{jsx as xr}from"react/jsx-runtime";var Co=({children:e,isOpen:o,className:t="",style:r={}})=>xr("section",{className:t,style:{overflow:"hidden",height:o?"auto":0,transition:"height 300ms ease",interpolateSize:"allow-keywords",...r},children:e});import{useMemo as xo}from"react";b(`.flip-card{--cardZIndex: attr(data-zIndex);--flipSpeed: attr(data-flipSpeed, .5s);--frontRotate: attr(data-frontRotate);--backRotate: attr(data-backRotate);perspective:1000px;z-index:var(--cardZIndex);.flipper{height:100%;position:relative;width:100%;transform-style:preserve-3d}.front,.back{-webkit-backface-visibility:hidden;backface-visibility:hidden;transform-style:preserve-3d;transition:var(--flipSpeed);height:100%;left:0;top:0;width:100%}.front{position:relative;transform:var(--frontRotate);z-index:2}.back{position:absolute;transform:var(--backRotate)}.is-flipped{.front{position:absolute}.back{position:relative}}}
|
|
5
|
-
`);import{jsx as Ie,jsxs as Tr}from"react/jsx-runtime";var qi=({cardZIndex:e="auto",flipDirection:o="vertical",flipSpeed:t=500,isFlipped:r=!1,children:a})=>{let n=c=>{if(a.length!==2)throw new Error("Component FlipCard requires 2 children");return a[c]},i=xo(()=>`rotate${o==="horizontal"?"Y":"X"}(${r?180:0}deg)`,[o,r]),s=xo(()=>`rotate${o==="horizontal"?"Y":"X"}(${r?0:-180}deg)`,[o,r]),l=h({"flip-card":!0,"is-flipped":r});return Ie("section",{className:l,style:{"--cardZIndex":e,"--flipSpeed":`${t}ms`,"--frontRotate":i,"--backRotate":s},children:Tr("section",{className:"flipper",children:[Ie("section",{className:"front",children:n(0)}),Ie("section",{className:"back",children:n(1)})]})})};import{useCallback as To,useRef as Po}from"react";b(`.hover-card{display:inline-block;transition:all .3s ease;.card-hover-layer{transition:all .1s ease;width:100%;height:100%;display:grid}}
|
|
6
|
-
`);import{jsx as ko}from"react/jsx-runtime";var ss=({children:e,threshold:o=5,translationZ:t=25,width:r="fit-content",className:a=""})=>{let n=Po(null),i=Po(null),s=To(m=>{let p=n.current,d=i.current;if(!p||!d)return;let{clientX:u,clientY:g,currentTarget:v}=m,{clientWidth:f,clientHeight:y}=v,{top:C,left:P}=p.getBoundingClientRect(),T=(u-P)/f,x=(g-C)/y,w=T*2-1,F=((x*2-1)*o).toFixed(2),A=(w*o).toFixed(2);d.style.transform=`perspective(${f}px) rotateX(${-F}deg) rotateY(${A}deg)`,p.style.transform=`perspective(${f}px) translateZ(${t}px)`},[o,t]),l=To(m=>{let p=n.current,d=i.current;!p||!d||(d.style.transform=`perspective(${m.currentTarget.clientWidth}px) rotateX(0) rotateY(0)`,p.style.transform=`perspective(${m.currentTarget.clientWidth}px) translateZ(0)`)},[]);L("mousemove",s,n),L("mouseleave",l,n);let c=h({"hover-card":!0,[a]:!!a});return ko("span",{ref:n,style:{width:r},className:c,children:ko("span",{className:"card-hover-layer",ref:i,children:e})})};import{createElement as Pr,useMemo as kr}from"react";var Se={hero:"h1",header1:"h1",header2:"h2",header3:"h3",header4:"h4",body:"p",label:"span","label-form":"label",small:"small"},Ne={hero:"hero",header1:"header1",header2:"header2",header3:"header3",header4:"header4",body:"body",label:"label","label-form":"label",small:"small"};b(`.typography{margin:0;padding:.5em 0 .4em;&.primary{color:var(--primary-500)}&.secondary{color:var(--secondary-500)}&.tertiary{color:var(--tertiary-500)}&.active{color:var(--active-500)}&.alert{color:var(--alert-500)}&.warning{color:var(--warning-500)}&.info{color:var(--info-500)}&.recommended-width{max-width:70ch}&.code-family{font-family:monospace}&.no-padding{padding:0}&.nowrap{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}&.nowrap-max-lines{overflow:hidden;display:-webkit-box;-webkit-box-orient:vertical}&.nowrap-max-lines-2{-webkit-line-clamp:2;line-clamp:2}&.nowrap-max-lines-3{-webkit-line-clamp:3;line-clamp:3}&.nowrap-max-lines-4{-webkit-line-clamp:4;line-clamp:4}&.nowrap-max-lines-5{-webkit-line-clamp:5;line-clamp:5}&.hero{font-size:var(--typography-size-hero);line-height:var(--typography-line-height-header);font-weight:700}&.header1{font-size:var(--typography-size-header1);line-height:var(--typography-line-height-header);font-weight:700}&.header2{font-size:var(--typography-size-header2);line-height:var(--typography-line-height-header);font-weight:700}&.header3{font-size:var(--typography-size-header3);line-height:var(--typography-line-height-header);font-weight:700}&.header4{font-size:var(--typography-size-header4);line-height:var(--typography-line-height-header);font-weight:700}&.body{font-size:var(--typography-size-body);line-height:var(--typography-line-height-common);font-weight:400}&.label{font-size:var(--typography-size-label);line-height:var(--typography-line-height-common);font-weight:400}&.small{font-size:var(--typography-size-small);line-height:var(--typography-line-height-common);font-weight:400}&.bold{font-weight:700}&.regular{font-weight:400}&.light{font-weight:300}}
|
|
7
|
-
`);var R=({variant:e="body",nowrap:o=!1,className:t="",style:r={},children:a,as:n,weight:i,family:s="primary",noPadding:l=!1,align:c,color:m,htmlFor:p,recommendedWidth:d=!1,...u})=>{let g=h({typography:!0,[Ne[e]]:Ne[e]!==void 0,[t]:!!t,[i??""]:!!i,[m??""]:!!m,"no-padding":l,"code-family":s==="code","recommended-width":d,"nowrap-max-lines":typeof o=="number","nowrap-max-lines-2":o===2,"nowrap-max-lines-3":o===3,"nowrap-max-lines-4":o===4,"nowrap-max-lines-5":o===5,nowrap:o===!0}),v=kr(()=>Se[e]??Se.body,[e]);return Pr(n??v,{...u,className:g,htmlFor:p,style:{textAlign:c,...r}},a)};import{jsx as ae,jsxs as Oe}from"react/jsx-runtime";var ne=(e,o)=>typeof e=="function"?e(o):e,Ms=({title:e,subtitle:o,children:t,icon:r=wr,startContent:a,content:n,endContent:i,classNames:s={},className:l="",style:c={}})=>{let m=Rr(()=>crypto.randomUUID(),[]),[p,d]=vo(m),u=h({"accordion-header":!0,"has-start-content":!!a,[s?.header??""]:!!s?.header,"is-open":p}),g=h({"accordion-header-content":!0,[s?.headerContent??""]:!!s?.headerContent}),v=h({"accordion-toggle-icon":!0,isOpen:p,[s?.toggleIcon??""]:!!s?.toggleIcon}),f=h({"accordion-body":!0,[s?.body??""]:!!s?.body}),y=ne(e,p),C=ne(o,p),P=ne(a,p),T=ne(n,p)??Oe("section",{className:g,children:[ae(R,{className:s?.title,variant:"body",noPadding:!0,weight:"bold",children:y}),ae(R,{className:s?.subtitle,variant:"label",noPadding:!0,weight:"light",children:C})]}),x=ne(i,p)??ae(r,{className:v}),w=h({"accordion-item":!0,[l]:!!l});return Oe("section",{className:w,style:c,children:[Oe("section",{className:u,onClick:d,children:[P,T,x]}),ae(Co,{isOpen:p,children:ae("section",{className:f,children:t})})]})};import{useEffect as Er,useRef as Mr}from"react";b(`.ripple{position:absolute;display:block;inset:0;overflow:hidden;border-radius:inherit;z-index:1;.ripple-effect{position:absolute;transform:translate(-50%,-50%);border-radius:50%;width:0;height:0;pointer-events:none;animation:ripple-effect infinite;opacity:.4}}@keyframes ripple-effect{to{width:300px;height:300px;opacity:0;filter:blur(5px)}}
|
|
8
|
-
`);import{jsx as Ir}from"react/jsx-runtime";var ee=({color:e,duration:o=1e3,timingFunction:t="ease-out",times:r=1,className:a="",style:n={},zIndex:i=1})=>{let s=Mr(null);return Er(()=>{if(!s.current?.parentElement)return;let c=getComputedStyle(s.current.parentElement).position;["absolute","fixed","sticky","relative"].includes(c)||(s.current.parentElement.style.position="relative")},[]),Ir("span",{ref:s,onMouseDown:c=>{let{pageX:m,pageY:p,currentTarget:d}=c,u=d.getBoundingClientRect(),g=(m-u.left)*100/u.width,v=(p-u.top)*100/u.height,f=document.createElement("span");f.classList.add("ripple-effect"),f.style.animationDuration=`${o}ms`,f.style.animationTimingFunction=t,f.style.left=`${g}%`,f.style.top=`${v}%`,e&&(f.style.background=e),d.appendChild(f),setTimeout(()=>{f.remove()},Math.max(o,500)*Math.max(r,1))},className:`ripple ${a}`,style:{...n,zIndex:i}})};b(`.button{--button-blur: 2px;--color: var(--neutral-800);--solid-background: var(--neutral-900);--solid-text: var(--neutral-50);--solid-hover-background: var(--neutral-800);--solid-active-background: var(--neutral-900);--flat-background: hsl(from var(--neutral-100) h s l / 80%);--flat-hover-background: var(--neutral-50);--flat-active-background: var(--neutral-100);--outlined-hover-background: hsl(from var(--neutral-100) h s l / 20%);--outlined-active-background: hsl(from var(--neutral-100) h s l / 50%);--text-hover-background: hsl(from var(--neutral-100) h s l / 20%);--text-active-background: hsl(from var(--neutral-100) h s l / 50%);--shadow-color: hsl(from var(--neutral-800) h s l / 20%);--focus-background: hsl(from var(--neutral-100) h s l / 20%);display:flex;flex-direction:row;justify-content:center;align-items:center;padding:.625em 2.1875em;gap:.625em;width:auto;border-radius:.5em;font-weight:700;font-size:var(--typography-size-label);cursor:pointer;outline:none;transition:all .15s ease;user-select:none;&.icon{padding:.625em}&.full{width:100%}&.no-wrap{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}&.size-small{font-size:var(--typography-size-small)}&.size-regular{font-size:var(--typography-size-label)}&.size-large{font-size:var(--typography-size-body)}&.radius-none{border-radius:0}&.radius-small{border-radius:.25em}&.radius-medium{border-radius:.5em}&.radius-large{border-radius:1em}&.radius-full{border-radius:100rem}&:not(:disabled){&:hover,&:active,&:focus-visible{backdrop-filter:blur(var(--button-blur))}&:hover{transform:scale(1.01);box-shadow:0 1.4em .5em -1em hsl(from var(--black) h s l / 20%),0 .7em 1em -.5em hsl(from var(--black) h s l / 20%)}&:active{transform:scale(.98);box-shadow:0 .3em .4em -.2em hsl(from var(--black) h s l / 20%),0 .2em .8em -.1em hsl(from var(--black) h s l / 20%)}}color:var(--color);.ripple-effect{background:var(--color)}&.solid{background:var(--solid-background);color:var(--solid-text);backdrop-filter:blur(var(--button-blur));.ripple-effect{background:var(--solid-text)}&:focus-visible{box-shadow:0 0 0 .3125em var(--shadow-color);background:var(--solid-background)}&:hover{background:var(--solid-hover-background)}&:active{background:var(--solid-active-background)}}&.flat{background:var(--flat-background);backdrop-filter:blur(var(--button-blur));&:hover{background:var(--flat-hover-background)}&:active{background:var(--flat-active-background)}}&.outlined{background:transparent;border:1px solid;&:hover{background:var(--outlined-hover-background)}&:active{background:var(--outlined-active-background)}}&.text{background:transparent;&:hover{background:var(--text-hover-background)}&:active{background:var(--text-active-background)}}&:focus-visible{box-shadow:0 0 0 .3125em var(--shadow-color);background:var(--focus-background)}&.primary{--color: var(--primary-500);--solid-background: var(--primary-500);--solid-text: var(--primary-50);--solid-hover-background: var(--primary-400);--solid-active-background: var(--primary-600);--flat-background: hsl(from var(--primary-100) h s l / 80%);--flat-hover-background: var(--primary-50);--flat-active-background: var(--primary-100);--outlined-hover-background: hsl(from var(--primary-100) h s l / 20%);--outlined-active-background: hsl(from var(--primary-100) h s l / 50%);--text-hover-background: hsl(from var(--primary-100) h s l / 20%);--text-active-background: hsl(from var(--primary-100) h s l / 50%);--shadow-color: hsl(from var(--primary-500) h s l / 20%);--focus-background: hsl(from var(--primary-100) h s l / 20%)}&.secondary{--color: var(--secondary-500);--solid-background: var(--secondary-500);--solid-text: var(--secondary-50);--solid-hover-background: var(--secondary-400);--solid-active-background: var(--secondary-600);--flat-background: hsl(from var(--secondary-100) h s l / 80%);--flat-hover-background: var(--secondary-50);--flat-active-background: var(--secondary-100);--outlined-hover-background: hsl(from var(--secondary-100) h s l / 20%);--outlined-active-background: hsl(from var(--secondary-100) h s l / 50%);--text-hover-background: hsl(from var(--secondary-100) h s l / 20%);--text-active-background: hsl(from var(--secondary-100) h s l / 50%);--shadow-color: hsl(from var(--secondary-500) h s l / 20%);--focus-background: hsl(from var(--secondary-100) h s l / 20%)}&.tertiary{--color: var(--tertiary-500);--solid-background: var(--tertiary-500);--solid-text: var(--tertiary-50);--solid-hover-background: var(--tertiary-400);--solid-active-background: var(--tertiary-600);--flat-background: hsl(from var(--tertiary-100) h s l / 80%);--flat-hover-background: var(--tertiary-50);--flat-active-background: var(--tertiary-100);--outlined-hover-background: hsl(from var(--tertiary-100) h s l / 20%);--outlined-active-background: hsl(from var(--tertiary-100) h s l / 50%);--text-hover-background: hsl(from var(--tertiary-100) h s l / 20%);--text-active-background: hsl(from var(--tertiary-100) h s l / 50%);--shadow-color: hsl(from var(--tertiary-500) h s l / 20%);--focus-background: hsl(from var(--tertiary-100) h s l / 20%)}&.active{--color: var(--active-500);--solid-background: var(--active-500);--solid-text: var(--active-50);--solid-hover-background: var(--active-400);--solid-active-background: var(--active-600);--flat-background: hsl(from var(--active-100) h s l / 80%);--flat-hover-background: var(--active-50);--flat-active-background: var(--active-100);--outlined-hover-background: hsl(from var(--active-100) h s l / 20%);--outlined-active-background: hsl(from var(--active-100) h s l / 50%);--text-hover-background: hsl(from var(--active-100) h s l / 20%);--text-active-background: hsl(from var(--active-100) h s l / 50%);--shadow-color: hsl(from var(--active-500) h s l / 20%);--focus-background: hsl(from var(--active-100) h s l / 20%)}&.warning{--color: var(--warning-500);--solid-background: var(--warning-500);--solid-text: var(--warning-50);--solid-hover-background: var(--warning-400);--solid-active-background: var(--warning-600);--flat-background: hsl(from var(--warning-100) h s l / 80%);--flat-hover-background: var(--warning-50);--flat-active-background: var(--warning-100);--outlined-hover-background: hsl(from var(--warning-100) h s l / 20%);--outlined-active-background: hsl(from var(--warning-100) h s l / 50%);--text-hover-background: hsl(from var(--warning-100) h s l / 20%);--text-active-background: hsl(from var(--warning-100) h s l / 50%);--shadow-color: hsl(from var(--warning-500) h s l / 20%);--focus-background: hsl(from var(--warning-100) h s l / 20%)}&.alert{--color: var(--alert-500);--solid-background: var(--alert-500);--solid-text: var(--alert-50);--solid-hover-background: var(--alert-400);--solid-active-background: var(--alert-600);--flat-background: hsl(from var(--alert-100) h s l / 80%);--flat-hover-background: var(--alert-50);--flat-active-background: var(--alert-100);--outlined-hover-background: hsl(from var(--alert-100) h s l / 20%);--outlined-active-background: hsl(from var(--alert-100) h s l / 50%);--text-hover-background: hsl(from var(--alert-100) h s l / 20%);--text-active-background: hsl(from var(--alert-100) h s l / 50%);--shadow-color: hsl(from var(--alert-500) h s l / 20%);--focus-background: hsl(from var(--alert-100) h s l / 20%)}&.info{--color: var(--info-500);--solid-background: var(--info-500);--solid-text: var(--info-50);--solid-hover-background: var(--info-400);--solid-active-background: var(--info-600);--flat-background: hsl(from var(--info-100) h s l / 80%);--flat-hover-background: var(--info-50);--flat-active-background: var(--info-100);--outlined-hover-background: hsl(from var(--info-100) h s l / 20%);--outlined-active-background: hsl(from var(--info-100) h s l / 50%);--text-hover-background: hsl(from var(--info-100) h s l / 20%);--text-active-background: hsl(from var(--info-100) h s l / 50%);--shadow-color: hsl(from var(--info-500) h s l / 20%);--focus-background: hsl(from var(--info-100) h s l / 20%)}&:disabled{color:var(--neutral-200);pointer-events:none}&.solid:disabled{background:var(--neutral-200);color:var(--neutral-50)}&.flat:disabled{background:hsl(from var(--neutral-50) h s l / 80%)}&.outlined:disabled,&.text:disabled{background:transparent}}
|
|
9
|
-
`);import{jsx as Sr,jsxs as Nr}from"react/jsx-runtime";var Ro=({children:e,color:o="default",variant:t="solid",radius:r="medium",size:a="regular",noWrap:n=!1,forIcon:i=!1,className:s="",...l})=>{let c=h({button:!0,[o]:!!o,[t]:!!t,[`radius-${r}`]:!!r,[`size-${a}`]:!!a,"no-wrap":n,icon:i,[s]:!!s});return Nr("button",{...l,className:c,children:[e,Sr(ee,{})]})};import{useEffect as Or,useState as Lr}from"react";b(`.cursor-overlay{position:fixed;top:0;left:0;width:100%;height:100%;cursor:none;pointer-events:none}.cursor{position:fixed;border-radius:50%;z-index:99999999;pointer-events:none;transform:translateZ(0);@media(any-pointer:coarse){display:none}&.outer-circle{margin-left:-15px;margin-top:-15px;width:30px;height:30px;border:2px solid var(--primary-500);box-sizing:border-box;z-index:99999999;opacity:.5;transition:all .08s ease-out,width .3s ease-in-out,height .3s ease-in-out,margin .3s ease-in-out,opacity .3s ease-in-out;&.cursor-hover{margin-left:-40px;margin-top:-40px;width:80px;height:80px;background-color:var(--primary-500);opacity:.3}&.cursor-text{margin-left:-2px;margin-top:-40px;width:4px;height:80px;background-color:var(--primary-500);opacity:.3}}&.inner-circle{margin-left:-3px;margin-top:-3px;width:6px;height:6px;z-index:99999999;background-color:var(--primary-500);transition:opacity .3s ease-in-out;opacity:1;&.cursor-hover{opacity:0}}}
|
|
10
|
-
`);import{jsx as wo,jsxs as Fr}from"react/jsx-runtime";var Ws=()=>{let{x:e,y:o,elementX:t,elementY:r,ref:a}=go(),[n,i]=Lr(!1);if(L("mouseover",l=>{let c=getComputedStyle(l.target).cursor;i(c==="pointer")}),Or(()=>("ontouchstart"in window||navigator.maxTouchPoints||(document.body.style.cursor="none"),()=>{document.body.style.cursor="auto"}),[]),e===null||o===null||"ontouchstart"in window||navigator.maxTouchPoints)return null;let s=`translate3d(${t}px, ${r}px, 0)`;return Fr("section",{className:"cursor-overlay",ref:a,children:[wo("span",{className:`cursor outer-circle ${n?"cursor-hover":""}`,style:{transform:s}}),wo("span",{className:`cursor inner-circle ${n?"cursor-hover":""}`,style:{transform:s}})]})};import{useMemo as zr}from"react";import{IoCheckmarkOutline as Hr}from"react-icons/io5";import{Controller as Ar,useFormContext as Dr}from"react-hook-form";import{jsx as Eo}from"react/jsx-runtime";var I=({Component:e,inputProps:o,defaultValue:t,rules:r})=>{let{control:a,setValue:n}=Dr(),{name:i,defaultValue:s}=o;return Eo(Ar,{name:i,control:a,rules:r,defaultValue:s??t,render:({field:{onBlur:l,value:c},fieldState:m})=>Eo(e,{value:c,error:m.error?.message,invalid:m.invalid,isTouched:m.isTouched,isDirty:m.isDirty,setValue:p=>n(i,p),onBlur:l,...o})})};b(`.checkbox{border-radius:40%;background:var(--background-paper);transition:all .3s ease;width:1em;height:1em;margin:2px;outline:1px solid;display:flex;position:relative;.checkbox-input{position:absolute;top:0;left:0;width:100%;height:100%;cursor:pointer;opacity:0;z-index:2}&.size-small{font-size:1em}&.size-regular{font-size:1.2em}&.size-large{font-size:1.4em}}.checkbox-fill{transition:all .2s ease-out;border-radius:inherit;margin:auto;width:0;height:0;overflow:hidden;position:relative;display:grid;place-content:center;place-items:center;.checkbox-icon{font-size:.7em;z-index:1;opacity:0;transition:opacity .3s ease}}.checkbox-container{--color: var(--neutral-800);--color-icon: var(--neutral-50);--color-hover: hsl(from var(--neutral-800) h s l / 50%);display:grid;grid-auto-flow:column;grid-auto-columns:auto 1fr;align-items:center;gap:.5em;width:fit-content;.checkbox-label{cursor:pointer;user-select:none;width:100%}.checkbox{color:var(--color);&.is-checked{.checkbox-fill{width:100%;height:100%;background:var(--color);color:var(--color-icon)}.checkbox-icon{opacity:1}}}.checkbox:hover,&:has(.checkbox-label:hover) .checkbox{box-shadow:0 0 0 .3em var(--color-hover);.checkbox-fill{width:20%;height:20%;border-radius:20%;background:var(--color-hover);color:var(--color-icon)}&:is(.is-checked){.checkbox-fill{width:100%;height:100%;border-radius:inherit;background:var(--color)}}}.checkbox:focus,&:has(.checkbox-input:focus) .checkbox,&:has(.checkbox-label:focus) .checkbox{box-shadow:0 0 0 .3em var(--color-hover)}&.color-primary{--color: var(--primary-500);--color-icon: var(--primary-50);--color-hover: hsl(from var(--primary-500) h s l / 50%)}&.color-secondary{--color: var(--secondary-500);--color-icon: var(--secondary-50);--color-hover: hsl(from var(--secondary-500) h s l / 50%)}&.color-tertiary{--color: var(--tertiary-500);--color-icon: var(--tertiary-50);--color-hover: hsl(from var(--tertiary-500) h s l / 50%)}&.color-active{--color: var(--active-500);--color-icon: var(--active-50);--color-hover: hsl(from var(--active-500) h s l / 50%)}&.color-warning{--color: var(--warning-500);--color-icon: var(--warning-50);--color-hover: hsl(from var(--warning-500) h s l / 50%)}&.color-alert{--color: var(--alert-500);--color-icon: var(--alert-50);--color-hover: hsl(from var(--alert-500) h s l / 50%)}&.color-info{--color: var(--info-500);--color-icon: var(--info-50);--color-hover: hsl(from var(--info-500) h s l / 50%)}}
|
|
11
|
-
`);import{jsx as ie,jsxs as Mo}from"react/jsx-runtime";var oe=({name:e,value:o,setValue:t,onBlur:r,onFocus:a,className:n="",style:i={},autoFocus:s=!1,readOnly:l=!1,disabled:c=!1,autoComplete:m="off",icon:p=Hr,label:d,color:u="primary",size:g="regular"})=>{let v=zr(()=>crypto.randomUUID(),[]),{handlers:f}=S({onChange:P=>t(P.target.checked),onBlur:r,onFocus:a}),y=h({"checkbox-container":!0,[n]:!!n,[`color-${u}`]:!!u}),C=h({checkbox:!0,"is-checked":o,[`size-${g}`]:!!g});return Mo("section",{className:y,style:i,onClick:P=>P.stopPropagation(),children:[Mo("section",{className:C,children:[ie("section",{className:"checkbox-fill",children:ie(p,{size:"1.3em",className:"checkbox-icon"})}),ie("input",{id:v,type:"checkbox",name:e,className:"checkbox-input",checked:o,autoFocus:s,autoComplete:m,disabled:c||l,...f})]}),d?ie(R,{variant:"label-form",htmlFor:v,className:"checkbox-label",children:d}):null]})},Br=({rules:e,...o})=>ie(I,{Component:oe,defaultValue:!1,inputProps:o,rules:e});oe.Controller=Br;import{useMemo as Vr}from"react";import{ImCross as Ur}from"react-icons/im";b(`.form-field{display:grid;grid-auto-columns:auto;gap:.5em;transition:all .2s ease;.field-content{display:grid;grid-template-columns:auto 1fr auto;align-items:center}.field-left-icon,.field-right-icon{font-size:1em}.field-left-icon{margin-right:1em}.field-right-icon{margin-left:1em}.field-message{display:grid;grid-auto-flow:column;gap:5px;align-items:center;justify-content:start}&.variant-content-border{.field-content{border:1px solid var(--border);border-radius:4px;padding:1em;background:var(--background)}}&.variant-content-line{.field-content{border-bottom:1px solid;padding:.5em 0}}&.variant-full-border{border:1px solid var(--border);border-radius:4px;padding:.5em 0;background:var(--background);.field-label,.field-content,.field-message{padding:0 1em}}&.variant-inline{grid-auto-flow:column;padding:.5em 0;align-items:center;.field-label{width:auto}}&.error{color:var(--alert-500);border-color:var(--alert-500)}&.focus{color:var(--info-500);border-color:var(--info-500)}&.error,&.focus{.field-left-icon,.field-right-icon,.field-children{color:var(--foreground);border-color:var(--foreground)}}.field-children>*{width:100%}}
|
|
12
|
-
`);var $r=(r=>(r.FULL_BORDER="full-border",r.CONTENT_BORDER="content-border",r.CONTENT_LINE="line",r))($r||{}),Gr=(t=>(t.HORIZONTAL="horizontal",t.VERTICAL="vertical",t))(Gr||{});import{jsx as K,jsxs as Le}from"react/jsx-runtime";var Io=({icon:e,className:o,onClick:t})=>e?K(e,{className:o,onClick:t}):K("span",{}),H=({id:e,label:o,leftIcon:t,rightIcon:r,errorIcon:a=Ur,error:n,onClickLeftIcon:i,onClickRightIcon:s,fieldOrientation:l="vertical",children:c,isFocus:m=!1,variant:p,ref:d})=>{let u=h({"form-field":!0,focus:m,error:!!n,"variant-content-border":p==="content-border","variant-content-line":p==="line","variant-full-border":p==="full-border","variant-inline":l==="horizontal"}),g=v=>f=>{f.stopPropagation();let y=document.getElementById(e);y?.focus(),y?.click(),v&&v()};return Le("section",{className:u,ref:d,children:[o?K(R,{className:"field-label",noPadding:!0,variant:"label-form",htmlFor:e,children:o}):null,Le("section",{className:"field-content",children:[Io({className:"field-left-icon",icon:t,onClick:g(i)}),K("section",{className:"field-children",children:c}),Io({className:"field-right-icon",icon:r,onClick:g(s)})]}),!!n&&Le("section",{className:"field-message",children:[a?K(a,{size:10}):K("span",{}),K(R,{noPadding:!0,variant:"small",children:n})]})]})};import{jsx as Fe}from"react/jsx-runtime";var So=({name:e,value:o,setValue:t,onBlur:r,onFocus:a,type:n="date",className:i="",style:s={},autoFocus:l=!1,readOnly:c=!1,disabled:m=!1,placeholder:p="",autoComplete:d="off",isDirty:u=!1,isTouched:g=!1,invalid:v=!1,error:f,...y})=>{let C=Vr(()=>crypto.randomUUID(),[]),{isFocus:P,handlers:T}=S({onBlur:r,onChange:x=>t(x.target.value),onFocus:a});return Fe(H,{id:C,error:f,isFocus:P,...y,children:Fe("input",{id:C,type:n,name:e,className:i,style:s,value:o,autoFocus:l,autoComplete:d,placeholder:p,disabled:m,readOnly:c,...T})})},jr=({rules:e,...o})=>Fe(I,{Component:So,defaultValue:"",inputProps:o,rules:e});So.Controller=jr;import{useMemo as Yr}from"react";import{jsx as Ae}from"react/jsx-runtime";var No=({name:e,value:o,setValue:t,onBlur:r,onFocus:a,pattern:n,type:i="text",className:s="",style:l={},autoFocus:c=!1,readOnly:m=!1,disabled:p=!1,placeholder:d="",autoComplete:u="off",isDirty:g=!1,isTouched:v=!1,invalid:f=!1,error:y,min:C,max:P,...T})=>{let x=Yr(()=>crypto.randomUUID(),[]),{handlers:w,isFocus:E}=S({onChange:F=>t(F.target.value),onBlur:r,onFocus:a});return Ae(H,{id:x,error:y,isFocus:E,...T,children:Ae("input",{id:x,type:i,name:e,className:s,style:l,value:o,pattern:n,autoFocus:c,autoComplete:u,placeholder:d,disabled:p,readOnly:m,min:C,max:P,...w})})},_r=({rules:e,...o})=>Ae(I,{Component:No,defaultValue:"",inputProps:o,rules:e});No.Controller=_r;import{useMemo as Oo}from"react";import{FiEye as Wr,FiEyeOff as Xr}from"react-icons/fi";import{IoIosWarning as Qr}from"react-icons/io";import{jsx as De}from"react/jsx-runtime";var Lo=({name:e,value:o,setValue:t,onBlur:r,onFocus:a,className:n="",style:i={},autoFocus:s=!1,readOnly:l=!1,disabled:c=!1,placeholder:m="",autoComplete:p="off",isDirty:d=!1,isTouched:u=!1,invalid:g=!1,error:v,...f})=>{let y=Oo(()=>crypto.randomUUID(),[]),[C,P]=bo(["password","text"]),{isFocus:T,handlers:x}=S({onBlur:r,onChange:E=>t(E.target.value),onFocus:a}),w=Oo(()=>C==="password"?Wr:C==="text"?Xr:Qr,[C]);return De(H,{id:y,error:v,isFocus:T,...f,rightIcon:w,onClickRightIcon:()=>P(),children:De("input",{id:y,type:C,name:e,className:n,style:i,value:o,autoFocus:s,autoComplete:p,placeholder:m,disabled:c,readOnly:l,...x})})},Zr=({rules:e,...o})=>De(I,{Component:Lo,defaultValue:"",inputProps:o,rules:e});Lo.Controller=Zr;import xn from"color";import{useCallback as Tn,useEffect as Pn,useMemo as Uo,useRef as kn,useState as Vo}from"react";import{HexAlphaColorPicker as Rn,HexColorInput as wn}from"react-colorful";import{FaEyeDropper as En}from"react-icons/fa6";import Mn from"use-eye-dropper";import{createContext as an,useCallback as Do,useContext as sn,useRef as ln,useState as zo}from"react";import{ImCross as cn}from"react-icons/im";import{useMemo as tn,useRef as rn}from"react";import{createPortal as Kr}from"react-dom";var Fo=({children:e,id:o})=>{let t=to(o);return t===null?null:Kr(e,t)};import{useMemo as Jr}from"react";import{jsx as on}from"react/jsx-runtime";var en=(a=>(a.OPAQUE="opaque",a.TRANSPARENT="transparent",a.BLUR="blur",a.NONE="none",a))(en||{}),Ao=({opacity:e=.6,backdrop:o="blur",zIndex:t,backdropOnClick:r,modalState:a})=>{let n=h({"modal-backdrop":!0,"backdrop-close":a==="CLOSING"||a==="CLOSED"}),i=Jr(()=>({opaque:{background:`hsl(from var(--background-paper) h s l / ${e*100}%)`},transparent:{background:"transparent"},blur:{background:`hsl(from var(--background-paper) h s l / ${e*100}%)`,backdropFilter:"blur(5px)"},none:{display:"none"}})[o]??{},[o,e]);return o==="none"?null:on("section",{tabIndex:-1,onClick:r,className:n,style:{zIndex:t,...i}})};b(`.modal{position:fixed;z-index:1001;pointer-events:none}.modal-content{background:var(--background-paper);pointer-events:initial;&.animation-fade-down{animation:fadeInDown .2s ease;&.modal-close{animation:fadeOutUp .2s ease;transform:translateY(-10px);opacity:0}}&.animation-bounce{animation:bounceIn .5s ease;&.modal-close{animation:bounceOut .5s ease;transform:scale3d(.3,.3,.3);opacity:0}}}.modal-backdrop{position:fixed;width:100%;height:100%;top:0;left:0;z-index:1000;animation:backdropOpen .5s cubic-bezier(.215,.61,.355,1);&.backdrop-close{animation:backdropClose .5s cubic-bezier(.215,.61,.355,1);opacity:0;transform:translateY(-10px)}}@keyframes backdropOpen{0%{opacity:0;transform:translateY(-10px)}to{opacity:1;transform:translateY(0)}}@keyframes backdropClose{0%{opacity:1;transform:translateY(0)}to{opacity:0;transform:translateY(-10px)}}
|
|
13
|
-
`);import{jsx as ze,jsxs as nn}from"react/jsx-runtime";var V=({id:e,children:o,isOpen:t,onClose:r,className:a="",style:n={},rootStyle:i={},animation:s="fade-down",closeAnimationClassName:l="modal-close",modalRef:c,closeOnClickOutside:m=!0,transitionDuration:p=300,windowOffset:d=10,offset:u=20,position:g,containerRef:v,zIndex:f=1e3,...y})=>{let C=tn(()=>crypto.randomUUID(),[]),P=rn(null),{modalState:T,isVisible:x}=fo({transitionDuration:p,isOpen:t});mo({modalRef:c??P,containerRef:v,offset:u,windowOffset:d,position:g,isOpen:x}),Je(c??P,()=>{t&&m&&r()});let w=h({"modal-content":!0,[a]:!!a,[`animation-${s}`]:!!s&&s!=="none",[l]:T==="CLOSING"||T==="CLOSED"});return x?nn(Fo,{id:`modal-${e}-${C}`,children:[ze(Ao,{...y,modalState:T,zIndex:f}),ze("section",{className:"modal",ref:c??P,style:{maxWidth:`calc(100dvw - ${d*2}px)`,maxHeight:`calc(100dvh - ${d*2}px)`,...i,zIndex:+f+1},children:ze("section",{style:{...n,animationDuration:`${p}ms`},className:w,children:o})})]}):null};b(`.action-modal{background:transparent;.modal-content{&.shake-animation{animation:headShake .6s linear}}}.action-modal-content{position:relative;.action-modal-body{box-shadow:0 0 10px -5px;border-radius:10px;overflow:hidden;display:grid}.action-modal-content{background:var(--background);padding:3em 4em 2em;display:grid;gap:1em}&.no-padding .action-modal-content{padding:2em 0 0}&:has(.action-modal-icon) .action-modal-content{padding-top:4em}&.back-card{&:before{content:"";position:absolute;width:90%;height:100%;top:8px;left:50%;transform:translate(-50%);z-index:-1;background:var(--primary-500);border-radius:10px;display:block;transition:top .3s cubic-bezier(.81,-.52,.42,2.5)}}.action-modal-icon{position:absolute;top:0;left:50%;transform:translate(-50%,-50%);background:var(--primary-500);color:var(--primary-50);padding:0;border-radius:50%;width:2em;height:2em;display:grid;place-content:center;transition:box-shadow .3s cubic-bezier(.81,-.52,.42,2.5);z-index:1;box-shadow:0 0 hsl(from var(--primary-500) h s l / 53%),0 0 hsl(from var(--primary-500) h s l / 40%),0 0 hsl(from var(--primary-500) h s l / 27%),0 0 hsl(from var(--primary-500) h s l / 14%)}.close-modal-button{width:1em;height:1em;border-radius:50%;cursor:pointer;background:var(--background);position:absolute;top:10px;right:5px;font-size:var(--typography-size-label);opacity:0;transition:opacity .3s ease;z-index:1}&.line-on-top{.action-modal-content{border-top:5px solid var(--primary-500)}}&:hover{.action-modal-icon{box-shadow:0 0 0 7px hsl(from var(--primary-500) h s l / 53%),0 0 0 14px hsl(from var(--primary-500) h s l / 40%),0 0 0 21px hsl(from var(--primary-500) h s l / 27%),0 0 0 28px hsl(from var(--primary-500) h s l / 14%)}.close-modal-button{opacity:1}&:before{top:15px}}}
|
|
14
|
-
`);import{jsx as j,jsxs as mn}from"react/jsx-runtime";var Ho=an(null),pn=()=>{let e=sn(Ho);if(!e)throw new Error("useActionModalContext must be used within a ActionModal");return e},se=({children:e,isOpen:o,onClose:t,actionRequired:r,icon:a,noCloseButton:n,lineOnTop:i=!1,backCard:s=!1,noPadding:l=!1,className:c="",style:m={},...p})=>{let[d,u]=zo(!1),g=ln(null),v=Do(()=>{g.current?.classList.add("shake-animation"),setTimeout(()=>{g.current?.classList.remove("shake-animation")},500)},[]),f=h({"action-modal-content":!0,"back-card":s,"line-on-top":i,"no-padding":l});return j(Ho.Provider,{value:{onClose:t,isActionInProgress:d,setIsActionInProgress:u},children:j(V,{className:"action-modal",id:"action-modal",animation:"bounce",opacity:.8,isOpen:o,onClose:t,...p,backdropOnClick:r?v:t,position:"center",children:j("section",{ref:g,className:"modal-content",children:mn("section",{className:f,children:[!n&&!r&&j("section",{className:"close-modal-button",onClick:()=>t(),children:j(cn,{})}),a?j(R,{variant:"header4",className:"action-modal-icon",children:j(a,{})}):null,j("section",{className:"action-modal-body",children:j("section",{className:`action-modal-content ${c}`,style:m,children:e})})]})})})})},dn=({onClick:e,children:o,isLoading:t,...r})=>{let{onClose:a,isActionInProgress:n,setIsActionInProgress:i}=pn(),[s,l]=zo(!1),c=Do(()=>{l(!0),i(!0);let m=e();m instanceof Promise?m.then(()=>{a(),l(!1),i(!1)}):(a(),l(!1),i(!1))},[e,a,i]);return!s&&n?null:j(Ro,{...r,onClick:c,isLoading:t||s,children:o})};se.ActionButton=dn;import{useMemo as un}from"react";import{ImCross as fn}from"react-icons/im";b(`.aside-modal{color:var(--foreground);overflow:auto;height:100%;.aside-modal-content{padding:2em}.close-modal-button{border-radius:50%;cursor:pointer;display:grid;place-content:center;background:var(--background);border:4px solid var(--primary-500);position:absolute;padding:.5em}&.left{border-right:4px solid var(--primary-500);animation:slideIn-left .3s ease;&.modal-close{animation:slideOut-left .3s ease;transform:translate(-100%)}.close-modal-button{top:2em;left:100%;transform:translate(calc(-50% + 2px))}}&.right{border-left:4px solid var(--primary-500);animation:slideIn-right .3s ease;&.modal-close{animation:slideOut-right .3s ease;transform:translate(100%)}.close-modal-button{top:2em;right:100%;transform:translate(calc(50% - 2px))}}&.top{border-bottom:4px solid var(--primary-500);animation:slideIn-top .3s ease;&.modal-close{animation:slideOut-top .3s ease;transform:translateY(-100%)}.close-modal-button{bottom:0;right:2em;transform:translateY(calc(50% - 2px))}}&.bottom{border-top:4px solid var(--primary-500);animation:slideIn-bottom .3s ease;&.modal-close{animation:slideOut-bottom .3s ease;transform:translateY(100%)}.close-modal-button{top:0;right:2em;transform:translateY(calc(-50% + 2px))}}}
|
|
15
|
-
`);import{jsx as He,jsxs as hn}from"react/jsx-runtime";var wc=({children:e,isOpen:o,onClose:t,position:r="left",size:a,className:n="",...i})=>{let s=un(()=>({top:{height:a,width:"100%"},left:{height:"100%",width:a},right:{height:"100%",width:a},bottom:{height:a,width:"100%"}})[r],[r,a]);return hn(V,{id:"aside",isOpen:o,onClose:t,opacity:.6,windowOffset:0,animation:"none",className:`aside-modal ${n} ${r}`,rootStyle:s,backdropOnClick:t,position:r,...i,children:[He("span",{className:"close-modal-button",onClick:t,children:He(fn,{})}),He("section",{className:"aside-modal-content",children:e})]})};b(`.confirmation-modal{display:grid;max-width:450px;gap:1em;place-content:center;justify-items:center;text-align:center;.confirmation-modal-actions{display:grid;grid-auto-flow:column;justify-content:center;gap:1em}}
|
|
16
|
-
`);import{jsx as le,jsxs as Bo}from"react/jsx-runtime";var Fc=({title:e,onAccept:o,onReject:t=()=>null,acceptText:r,rejectText:a,children:n,isLoading:i,...s})=>le(se,{...s,backCard:!0,children:Bo("section",{className:"confirmation-modal",children:[le(R,{variant:"header4",children:e}),le("section",{children:n}),Bo("section",{className:"confirmation-modal-actions",children:[!i&&le(se.ActionButton,{variant:"flat",onClick:t,children:a}),le(se.ActionButton,{isLoading:i,onClick:o,children:r})]})]})});import{useCallback as gn,useMemo as bn}from"react";b(`.menu-modal{border-radius:.5em;border:1px solid var(--border);background:var(--background);box-shadow:0 0 25px var(--background-paper);user-select:none;position:relative;overflow-y:auto;.menu-content{display:grid;gap:.2em;padding:0;margin:0;list-style:none;align-content:start;height:100%;position:relative;overflow-y:auto}.divider{margin:.4em 0;color:var(--border)}}.menu-label{background:var(--background);color:var(--foreground);font-weight:lighter;padding:.5em 1.2em;position:sticky;top:0;z-index:10;pointer-events:none}.menu-option{padding:.2em 1em;border-radius:.3em;transition:all .3s ease;cursor:pointer;display:flex;align-items:center;outline:0;margin:0 .2em;position:relative;.ripple-effect{background:hsl(from var(--foreground) h s l / 31%)}&:first-child{margin-top:5px}.option-icon{margin-right:.5em}.menu-checkbox{width:100%}&.is-disabled{opacity:.4;pointer-events:none;cursor:default}&:focus,&:hover{background:hsl(from var(--background-paper) h s l / 25%)}&.is-selected{background:var(--background-paper);&:focus,&:hover{background:hsl(from var(--background-paper) h s l / 75%)}}}.menu-group{position:relative;.menu-group-content{display:grid;gap:.2em;padding:0;margin:0;list-style:none;align-content:start;position:relative}}
|
|
17
|
-
`);import{Fragment as $o,jsx as G,jsxs as ge}from"react/jsx-runtime";var Y=({children:e,isOpen:o,onClose:t,id:r,menuContentRef:a,contentClassName:n="",contentStyle:i={},className:s="",...l})=>{let c=h({"menu-modal":!0,[s]:!!s});return G(V,{className:c,...l,id:`menu-${r}`,isOpen:o,onClose:t,children:G("ul",{className:`menu-content ${n}`,role:"listbox",style:i,ref:a,children:e})})},yn=({children:e,label:o="",asCheckbox:t,icon:r,id:a,disabled:n=!1,selected:i=!1,className:s="",style:l={},onClick:c=()=>null,...m})=>{let p=h({"menu-option":!0,[s]:!0,"is-disabled":n,"is-selected":i}),d=gn(g=>{g.stopPropagation(),n||c(!i)},[n,c,i]),u=bn(()=>e||(t?G(oe,{className:"menu-checkbox",disabled:n,value:i,setValue:g=>c(g),name:"option",style:{pointerEvents:"none"},size:"small",label:ge($o,{children:[r!==void 0&&G(r,{className:"option-icon"}),G(R,{variant:"label",children:o})]})}):ge($o,{children:[r!==void 0&&G(r,{className:"option-icon"}),typeof o=="string"?G(R,{variant:"label",children:o}):o]})),[t,e,n,r,o,c,i]);return ge("li",{...m,id:a,role:"option",tabIndex:-1,"aria-selected":i,"aria-disabled":n,onClick:d,className:p,style:l,children:[G(ee,{zIndex:10}),u]})},vn=()=>G("li",{children:G(he,{className:"divider"})}),Go=({children:e,className:o="",...t})=>G("li",{tabIndex:-1,className:"menu-label",children:G(R,{...t,variant:"small",className:`menu-group-label ${o}`,children:e})}),Cn=({children:e,label:o,className:t="",style:r={},contentClassName:a="",contentStyle:n={},...i})=>{let s=h({"menu-group":!0,[t]:!!t});return ge("li",{tabIndex:-1,...i,className:s,style:r,children:[o&&G(Go,{children:o}),G("ul",{className:`menu-group-content ${a}`,role:"listbox",style:n,children:e})]})};Y.Option=yn;Y.Divider=vn;Y.GroupLabel=Go;Y.Group=Cn;b(`.input-color{display:grid;grid-auto-flow:column;align-items:center;justify-content:start;gap:.5em;.input-color-value{margin-left:10px}.color-input{padding-right:1em;border-radius:inherit;width:100%;font-size:var(--typography-size-label);font-family:var(--typography-family-main) sans-serif}}.input-color-box{background:#fff;border-radius:5px;border:2px solid;width:25px;height:25px;position:relative;cursor:pointer;&:before{content:"";position:absolute;border-radius:inherit;top:0;left:0;width:100%;height:100%;background:repeating-conic-gradient(#ccc 0% 25%,#fff 0% 50%) 50% / 8px 8px;z-index:-1}}.input-color-selector{display:grid;gap:10px;background:var(--background);color:var(--foreground);padding:10px;border-radius:0 18px 18px;border:1px solid;box-shadow:0 5px 30px -5px var(--neutral-900);.react-colorful__pointer{width:1em;height:1em;border-radius:50%}.react-colorful__hue-pointer,.react-colorful__alpha-pointer{width:8px;height:100%;border-radius:4px;border-width:2px}.color-input-container{display:grid;grid-template-columns:16px 1fr 16px;align-items:center;gap:10px;border:1px solid;border-radius:8px;padding:.5em;width:100%;max-width:200px}.color-input{padding:0;border-radius:inherit;background:var(--background);color:var(--foreground);width:100%;font-size:var(--typography-size-label);font-family:var(--typography-family-main) sans-serif;letter-spacing:2px;text-align:center}}
|
|
18
|
-
`);import{jsx as Q,jsxs as be}from"react/jsx-runtime";var jo=({name:e,value:o,setValue:t,onBlur:r,onFocus:a,showValueText:n=!1,className:i="",style:s={},autoFocus:l=!1,readOnly:c=!1,disabled:m=!1,placeholder:p="",autoComplete:d="off",isDirty:u=!1,isTouched:g=!1,invalid:v=!1,error:f,...y})=>{let{open:C,isSupported:P}=Mn(),[T,x]=Vo(o),w=Uo(()=>crypto.randomUUID(),[]),E=kn(null),[F,A]=Vo(!1),{handlers:$,isFocus:B}=S({onChange:O=>x(O.target.value),onBlur:O=>{z(),r&&r(O)},onFocus:O=>{z(),a&&a(O)}}),k=Uo(()=>{let O=xn(o===""?"#000000":o);return O.isLight()||O.alpha()<.5?"#000000":"#FFFFFF"},[o]),M=async()=>{let{sRGBHex:O}=await C();t(O)};Pn(()=>{x(o)},[o]);let z=Tn(()=>{T.match(/^#(?:(?:[\da-f]{3}){1,2}|(?:[\da-f]{4}){1,2})$/i)?t(T):x(o)},[T,t,o]),W=h({"input-color-box":!0,[i]:!!i});return be(H,{id:w,error:f,isFocus:B,...y,children:[be("section",{className:"input-color",onClick:O=>{O.stopPropagation(),A(!0)},ref:E,children:[Q("section",{className:W,style:{borderColor:k,background:o,color:o,...s}}),n?Q("input",{id:w,name:e,value:T,placeholder:p,readOnly:c,autoFocus:l,disabled:m,autoComplete:d,className:"color-input",...$}):null]}),be(V,{id:"input-color",isOpen:F,onClose:()=>A(!1),position:"bottom right",offset:5,backdrop:"transparent",containerRef:E,className:"input-color-selector",children:[Q(Rn,{id:w,color:o,onChange:t}),be("section",{className:"color-input-container",children:[P()?Q(En,{onClick:()=>{M()}}):Q("span",{}),Q(wn,{className:"color-input",id:w,name:e,color:o,placeholder:"Type a color",prefixed:!0,alpha:!0,onChange:t}),Q("span",{})]})]})]})},In=({rules:e,...o})=>Q(I,{Component:jo,defaultValue:"#147EFB",inputProps:o,rules:e});jo.Controller=In;import{useCallback as Nn,useEffect as On,useMemo as Yo,useState as Ln}from"react";import{FaMagnifyingGlass as Fn,FaRegTrashCan as _o}from"react-icons/fa6";import{IoIosWarning as An}from"react-icons/io";import{PiFilePdfFill as Dn,PiFilePngFill as zn}from"react-icons/pi";import{createElement as Sn}from"react";b(`.grida{display:grid}
|
|
19
|
-
`);var ce=({tag:e="section",children:o,className:t,style:r,flow:a,columnSize:n,rowSize:i,column:s,row:l,pc:c,pi:m,ps:p,jc:d,ji:u,js:g,ac:v,ai:f,as:y,gtc:C,gtr:P,gta:T,gt:x,gap:w,...E})=>Sn(e,{className:t,...E,style:{...r,...a?{gridAutoFlow:a}:{},...n?{gridAutoColumns:n}:{},...i?{gridAutoRows:i}:{},...s?{gridColumn:s}:{},...l?{gridRow:l}:{},...c?{placeContent:c}:{},...m?{placeItems:m}:{},...p?{placeSelf:p}:{},...d?{justifyContent:d}:{},...u?{justifyItems:u}:{},...g?{justifySelf:g}:{},...v?{alignContent:v}:{},...f?{alignItems:f}:{},...y?{alignSelf:y}:{},...C?{gridTemplateColumns:C}:{},...P?{gridTemplateRows:P}:{},...T?{gridTemplateAreas:T}:{},...x?{gridTemplate:x}:{},...w?{gap:w}:{},display:"grid"}},o);b(`.input-file-container{display:grid;gap:10px;.input-file--box{border:1px solid;border-radius:5px;position:relative;transition:all .3s ease;display:grid;grid-template-columns:32px 1fr;padding:10px;gap:10px;background:var(--secondary-500);color:var(--secondary-50);align-items:center;.input-file--box--icon{width:32px;height:32px;border-radius:5px;background:var(--primary-50);color:var(--primary-500);display:grid;place-content:center}input{position:absolute;top:0;left:0;width:100%;height:100%;cursor:copy;opacity:0}&:hover{background:var(--primary-50);color:var(--primary-500);.input-file--box--icon{background:var(--primary-500);color:var(--primary-50)}}}.input-file--files{max-height:280px;overflow-y:auto;border:1px solid;border-radius:5px;.input-file--files--content{display:grid}}.error{color:tomato}.total-info{font-size:1em;display:grid;grid-auto-flow:column;justify-content:end;align-items:center;gap:.5em;.total-info--delete{display:grid;place-content:center;height:100%;background:transparent;cursor:pointer;transition:all .3s ease;aspect-ratio:1 / 1;border-radius:50%;width:2em;font-size:.8em;&:hover{background:var(--primary-500);color:var(--primary-50)}}}}.input-file-card{display:grid;grid-template-columns:35px 1fr 35px;gap:1em;align-items:center;padding:10px;background:var(--background);&:not(:last-child){border-bottom:1px dashed}&:hover{.file-card--delete{color:var(--primary-500)}}.file-card--image{background:var(--primary-500);color:var(--primary-50);width:32px;height:32px;border-radius:5px;display:grid;place-content:center;border:1px solid}.file-card--data{display:grid;font-size:.7em;justify-content:start}.file-card--delete{border-radius:5px;display:grid;place-content:center;width:32px;height:32px;cursor:pointer;transition:all .3s ease;&:hover{background:var(--primary-500);color:var(--primary-50)}}}
|
|
20
|
-
`);import{Fragment as Bn,jsx as D,jsxs as _}from"react/jsx-runtime";var Wo=({name:e,value:o={},setValue:t,onBlur:r,onFocus:a,className:n="",style:i={},autoFocus:s=!1,readOnly:l=!1,disabled:c=!1,placeholder:m="Click to upload or drag and drop",autoComplete:p="off",accept:d,multiple:u=!1,limitSize:g=5e6,errorTimeout:v=3e3,label:f})=>{let[y,C]=Ln(null),P=Yo(()=>crypto.randomUUID(),[]),{handlers:T}=S({onBlur:r,onFocus:a,onChange:k=>{let{files:M}=k.target;M&&x(M)}});On(()=>{let k=null;return y!==null&&(k=setTimeout(()=>{C(null)},v)),()=>{k!==null&&clearTimeout(k)}},[y,v]);let x=k=>{let M=u?{...o}:{},z=u?k.length:1;for(let W=0;W<z;W++){let O=k.item(W);O&&(O.size<g?M[O.name]=O:C(`File '${O.name}' size is larger than ${re(g)}`))}t(M)},w=k=>{k.preventDefault(),k.stopPropagation(),k.dataTransfer.files&&k.dataTransfer.files.length&&x(k.dataTransfer.files)},E=Nn(k=>({"image/png":zn,"application/pdf":Dn})[k]??An,[]),F=k=>{let M={...o};delete M[k.name],t(M)},A=()=>{t({})},$=Yo(()=>Object.values(o).reduce((k,{size:M})=>k+M,0),[o]),B=(k,M)=>{let z=E(k.type);return _("section",{className:"input-file-card",children:[D("section",{className:"file-card--image",children:D(z,{})}),_(ce,{children:[D(R,{variant:"label",noPadding:!0,nowrap:!0,children:k.name}),D(R,{noPadding:!0,variant:"small",children:re(k.size)})]}),D("section",{className:"file-card--delete",onClick:()=>F(k),children:D(_o,{})})]},M)};return _("section",{className:"input-file-container",children:[!!f&&D(R,{variant:"label-form",htmlFor:P,noPadding:!0,children:f}),_("section",{className:"input-file--box",onDrop:w,children:[D("section",{className:"input-file--box--icon",children:D(Fn,{})}),_(ce,{children:[D(R,{variant:"label-form",htmlFor:P,noPadding:!0,weight:"bold",children:m}),_(R,{variant:"small",noPadding:!0,children:["Max size (",re(g),")"]})]}),D("input",{id:P,type:"file",name:e,value:"",placeholder:m,readOnly:l,autoFocus:s,disabled:c,autoComplete:p,className:n,style:i,accept:d,multiple:u,title:"",...T})]}),y!==null&&D(R,{variant:"small",noPadding:!0,className:"error",children:y}),Object.keys(o).length>0&&_(Bn,{children:[u&&_("span",{className:"total-info",children:[_(R,{variant:"small",noPadding:!0,children:[Object.keys(o).length," files - ",re($)]}),D("span",{className:"total-info--delete",onClick:A,children:D(_o,{})})]}),D("section",{className:"input-file--files",children:D("section",{className:"input-file--files--content",children:Object.values(o).map(B)})})]})]})},Hn=({rules:e,...o})=>D(I,{Component:Wo,defaultValue:{},inputProps:o,rules:e});Wo.Controller=Hn;import{useEffect as $n,useMemo as Xo,useState as Gn}from"react";import{jsx as Be}from"react/jsx-runtime";var Qo={comma:/(?!^-)[^0-9,]/g,dot:/(?!^-)[^0-9.]/g},Zo=(e,o=".")=>{let t=o==="."?Qo.dot:Qo.comma,r=e.replace(t,"").replace(",",".");return r||""},ye=(e,o)=>!e||Number.isNaN(e)?o(0):o(e),Ko=({name:e,value:o,setValue:t,onBlur:r,onFocus:a,pattern:n,className:i="",style:s={},autoFocus:l=!1,readOnly:c=!1,disabled:m=!1,placeholder:p="",autoComplete:d="off",isDirty:u=!1,isTouched:g=!1,invalid:v=!1,error:f,min:y,max:C,decimalSeparator:P,format:T={locales:"en-US",style:"decimal",minimumFractionDigits:0,maximumFractionDigits:2},...x})=>{let w=Xo(()=>crypto.randomUUID(),[]),E=Xo(()=>{if(typeof T=="function")return T;let{locales:k,...M}=T;return Intl.NumberFormat(k,M).format},[T]),[F,A]=Gn(ye(o,E)),{handlers:$,isFocus:B}=S({onChange:k=>{let M=Zo(k.target.value,P);M.endsWith(".")?A(k.target.value):(A(ye(Number(M),E)),t(Number(M)))},onBlur:k=>{let M=Zo(k.target.value,P);A(ye(Number(M),E)),t(Number(M)),r&&r(k)},onFocus:a});return $n(()=>{let k=ye(o,E);F!==k&&A(k)},[E,F,o]),Be(H,{id:w,error:f,isFocus:B,...x,children:Be("input",{id:w,type:"text",name:e,className:i,style:s,value:F,pattern:n,autoFocus:l,autoComplete:d,placeholder:p,disabled:m,readOnly:c,min:y,max:C,...$})})},Un=({rules:e,...o})=>Be(I,{Component:Ko,defaultValue:0,inputProps:o,rules:e});Ko.Controller=Un;import{useMemo as Vn}from"react";b(`.radio{border-radius:50%;background:var(--background-paper);transition:all .3s ease;width:1em;height:1em;outline:2px solid;display:flex;position:relative;padding:2px;.radio-input{position:absolute;top:0;left:0;width:100%;height:100%;cursor:pointer;opacity:0;z-index:1}&.size-small{font-size:1em}&.size-regular{font-size:1.2em}&.size-large{font-size:1.4em}}.radio-fill{transition:all .2s ease-out;border-radius:inherit;margin:auto;width:0;height:0}.radio-container{--color: var(--neutral-800);display:flex;align-items:center;gap:1em;width:fit-content;.radio-label{cursor:pointer;user-select:none}.radio{color:var(--color);&.is-checked{.radio-fill{width:100%;height:100%;background:var(--color)}}}.radio:hover,&:has(.radio-label:hover) .radio{box-shadow:0 0 0 .4em hsl(from var(--color) h s l / 50%);.radio-fill{width:20%;height:20%;background:hsl(from var(--color) h s l / 50%)}&:is(.is-checked){.radio-fill{width:80%;height:80%;background:var(--color)}}}&.color-primary{--color: var(--primary-500)}&.color-secondary{--color: var(--secondary-500)}&.color-tertiary{--color: var(--tertiary-500)}&.color-active{--color: var(--active-500)}&.color-warning{--color: var(--warning-500)}&.color-alert{--color: var(--alert-500)}&.color-info{--color: var(--info-500)}}
|
|
21
|
-
`);import{jsx as ve,jsxs as qo}from"react/jsx-runtime";var Jo=({name:e,value:o,setValue:t,onBlur:r,onFocus:a,className:n="",style:i={},autoFocus:s=!1,readOnly:l=!1,disabled:c=!1,autoComplete:m="off",radioValue:p,label:d,color:u="primary",size:g="regular"})=>{let v=Vn(()=>crypto.randomUUID(),[]),{handlers:f}=S({onChange:P=>t(P.target.value),onBlur:r,onFocus:a}),y=h({"radio-container":!0,[n]:!!n,[`color-${u}`]:!!u}),C=h({radio:!0,"is-checked":p===o,[`size-${g}`]:!!g});return qo("section",{className:y,style:i,children:[qo("section",{className:C,children:[ve("section",{className:"radio-fill"}),ve("input",{id:v,type:"radio",name:e,className:`radio-input ${n}`,style:i,value:p,checked:p===o,autoFocus:s,autoComplete:m,disabled:c||l,...f})]}),d?ve(R,{variant:"label-form",htmlFor:v,className:"radio-label",children:d}):null]})},jn=({rules:e,...o})=>ve(I,{Component:Jo,defaultValue:"",inputProps:o,rules:e});Jo.Controller=jn;import{createContext as Qn,useCallback as st,useContext as Zn,useMemo as xe,useRef as lt,useState as Kn}from"react";import{ImCross as qn}from"react-icons/im";import{PiCaretDown as Jn}from"react-icons/pi";import{useEffect as Yn}from"react";b(`.infinity-scroll{display:grid;place-content:start center;place-items:start center;.loading{width:100%;height:30px;display:grid;place-content:center;.loading--icon{animation:spin .5s linear infinite;font-size:20px}}.empty-message{font-size:.8em;text-align:center;color:#a6a6a6}}
|
|
22
|
-
`);import{Fragment as _n,jsx as $e,jsxs as et}from"react/jsx-runtime";var ot=({isLoading:e=!1,hasNextPage:o=!1,loadMore:t,customLoadMoreElement:r,emptyMessage:a,children:n})=>{let{ref:i,inView:s}=so(),l=eo(e,100);Yn(()=>{o&&s&&!l&&t()},[o,l,t,s]);let c=Array.isArray(n)?n.length>0:!!n;return et(_n,{children:[n,et("section",{className:"infinity-scroll",children:[!!a&&!c&&!l&&$e("p",{className:"empty-message",children:a}),(o||l)&&(r?r(i):$e("section",{ref:i,className:"loading",children:l&&$e("span",{className:"loading--icon",children:":D"})}))]})]})};import{useCallback as Ge,useMemo as tt}from"react";import{jsx as rt}from"react/jsx-runtime";var nt=({children:e,value:o})=>{let{multiselect:t,isEqualComparator:r,maxOptions:a,selectedValue:n,setValue:i,setIsOpen:s}=at(),l=Ge((u,g)=>["number","string"].includes(typeof u)?u===g:!!r&&r(u,g),[r]),c=Ge(u=>{if(u)if(t){if(a&&Array.isArray(n)&&n.length>=a)return;i([...n,o])}else i(o),s(!1);else t?i(n.filter(g=>!l(g,o))):(i(null),s(!1))},[t,a,n,i,o,s,l]),m=tt(()=>n===""||n===null?!1:Array.isArray(n)?["number","string"].includes(typeof o)?n.includes(o):n.some(u=>!!r&&r(o,u)):l(o,n),[l,r,n,o]),p=Ge(u=>{["Enter"," "].includes(u.key)&&(u.preventDefault(),c(!(m&&t)))},[c,m,t]),d=tt(()=>typeof e=="string"?rt(R,{"data-value":o,variant:"label",nowrap:!0,children:e}):e,[e,o]);return rt(Y.Option,{label:d,onKeyDown:p,asCheckbox:t,selected:m,onClick:u=>c(t?u:!0)})};import{useCallback as Ve,useEffect as je,useRef as Ue,useState as Ye}from"react";import{jsx as Ce,jsxs as Xn}from"react/jsx-runtime";var Wn=({height:e,minHeight:o,containerRef:t,offset:r,windowOffset:a})=>{let[n,i]=Ye(void 0),s=Ve(()=>{let l=t.current?.getBoundingClientRect().bottom??0,c=window.innerHeight-l-a-r-5,m=window.innerHeight-a*3,p=c<o?m:c,d=Math.min(p,e),u=Math.max(d,o);i(`${Math.round(u)}px`)},[t,a,r,o,e]);return je(()=>{s()},[s]),Z(t,s),L("resize",s),{h:n}},it=({children:e,searchQueryValue:o,searchQueryPlaceholder:t="Search option",searchQueryClassName:r="",searchQueryStyle:a={},onSearchQuery:n,containerRef:i,height:s=300})=>{let l=Ue(null),c=Ue(null),[m,p]=Ye(""),d=Ue(null),u=fe("(max-width: 480px)");L("keydown",T=>{if(["ArrowDown","ArrowUp"].includes(T.code)){T.preventDefault();let x=document.activeElement;if(x?.tagName==="LI")switch(T.code){case"ArrowDown":x?.nextSibling?.focus();break;case"ArrowUp":x?.previousElementSibling?.focus();break}}});let g=Ve(T=>{let{value:x}=T.target;n&&n(x),p(x)},[n]);je(()=>{d.current&&d.current.focus()},[]);let{h:v}=Wn({height:s,minHeight:150,containerRef:i,offset:5,windowOffset:10}),[f,y]=Ye(!1),C=Ve(()=>{let T=Math.round(l.current?.getBoundingClientRect().height??0)+2,x=Math.round(c.current?.scrollHeight??0);y(T>=x)},[]);je(C,[C]),Z(l,C),Z(c,C),L("resize",C);let P=h({"select-options-header":!0,[r]:!!r});return Xn("section",{className:`select-options ${n?"with-search-query":""}`,style:u?{maxHeight:window.innerHeight-100,width:window.innerWidth-100}:{height:f?"auto":v,maxHeight:s,width:i.current?.offsetWidth??"auto"},children:[n&&Ce("section",{className:P,style:a,children:Ce("input",{name:"query",className:"input-search",value:o??m,onChange:g,placeholder:t,onClick:T=>T.stopPropagation(),ref:d,autoFocus:!0})}),Ce("section",{className:"select-options-list-container",ref:l,children:Ce("ul",{className:"select-options-list",ref:c,children:e})})]})};b(`.select{cursor:pointer;.icon-close{display:grid;place-content:center;align-self:center;border-radius:100%;cursor:pointer;font-size:.6em;padding:.5em;&:hover{background:hsl(from var(--foreground) h s l / 33%)}}.select-container{display:grid;grid-template-columns:1fr auto;gap:.5em;align-items:center;grid-auto-rows:auto;position:relative;cursor:pointer;user-select:none;&.three-columns{grid-template-columns:1fr auto auto}}.input-button{appearance:none;-webkit-appearance:none;-moz-appearance:none;white-space:nowrap;text-overflow:ellipsis;overflow:hidden;display:grid;min-width:0;width:100%;border:0;margin:0;border-radius:0;background:transparent;color:currentColor;text-align:left;-webkit-tap-highlight-color:transparent;padding:0;grid-template-columns:1fr auto;&.placeholder{color:#919191}}.select-caret-icon{transition:transform .2s ease;&.is-select-open{transform:rotate(180deg)}}}.select-options-menu{.select-menu-content{gap:0;display:block;height:auto;overflow:initial}}.select-options{gap:0;display:grid;grid-template-rows:1fr;height:100%;overflow:auto;&.with-search-query{grid-template-rows:auto 1fr}.select-options-list-container{height:100%;overflow:auto}.select-options-list{display:grid;gap:.2em;padding:0;margin:0;list-style:none;align-content:start}}.select-options-header{background:var(--background);padding:2px 5px;border-bottom:1px solid var(--border);.input-search{outline:none;padding:.8em 5px;font-size:var(--typography-size-label);width:100%}}
|
|
23
|
-
`);import{jsx as N,jsxs as ct}from"react/jsx-runtime";var pt=Qn(null),at=()=>{let e=Zn(pt);if(!e)throw new Error("useSelectContext must be used within a Select component");return e},ea=({children:e})=>{let o=xe(()=>typeof e=="string"?N(R,{noPadding:!0,variant:"label",nowrap:!0,children:e}):e,[e]);return N(Y.GroupLabel,{children:o})},oa=({value:e})=>N(R,{variant:"label",nowrap:!0,children:typeof e=="string"||typeof e=="number"?e:JSON.stringify(e)}),ta=({value:e,multiselect:o})=>o?N(R,{noPadding:!0,nowrap:!0,variant:"label",children:`${e.length} item${e.length===1?"":"s"} selected`}):e===null?null:N(R,{noPadding:!0,variant:"label",nowrap:!0,children:typeof e=="string"||typeof e=="number"?e:JSON.stringify(e)}),q=({options:e,isEqualComparator:o,searchQueryValue:t,searchQueryPlaceholder:r,onSearchQuery:a,loadMore:n=()=>null,isLoading:i=!1,hasNextPage:s=!1,emptyMessage:l="No options to select",multiselect:c,optionComponent:m=oa,valueComponent:p=ta,maxOptions:d,children:u,name:g,value:v,setValue:f,onBlur:y,onFocus:C,className:P="",style:T={},showClearOption:x=!1,height:w,searchQueryStyle:E,searchQueryClassName:F,autoFocus:A=!1,readOnly:$=!1,disabled:B=!1,placeholder:k="",autoComplete:M="off",isDirty:z=!1,isTouched:W=!1,invalid:O=!1,error:Pe,...Ot})=>{let Lt=lt(null),me=fe("(max-width: 480px)"),Ke=xe(()=>crypto.randomUUID(),[]),ke=lt(null),[ue,qe]=Kn(!1),Re=st(X=>{qe(X&&!B)},[B]),Ft=st(X=>{X.stopPropagation(),f(c?[]:null)},[c,f]),we=xe(()=>c?v.length>0:!!v,[c,v]),At=xe(()=>u||e.map((X,Dt)=>N(q.Option,{value:X,children:N(m,{value:X})},Dt)),[m,u,e]);return N(pt.Provider,{value:{selectedValue:v,setValue:f,multiselect:c??!1,isEqualComparator:o,maxOptions:d??null,setIsOpen:qe},children:N(H,{id:Ke,error:Pe,isFocus:ue,ref:ke,...Ot,children:ct("section",{id:g,style:T,onBlur:y,className:`select ${B?"disabled":""} ${P}`,children:[ct("section",{id:Ke,className:`select-container ${we&&x?"three-columns":""}`,onClick:()=>Re(!0),children:[N("button",{type:"button",className:`input-button ${(Array.isArray(v)?v.length>0:v)?"":"placeholder"}`,"aria-haspopup":"listbox","aria-expanded":ue,onFocus:X=>{Re(!0),C&&C(X)},children:we?N(p,{...c?{value:v,multiselect:c}:{value:v}}):N(R,{variant:"label",noPadding:!0,nowrap:!0,children:k})}),we&&x&&N("section",{className:"icon-close",onClick:Ft,children:N(qn,{})}),N(Jn,{className:`select-caret-icon ${ue&&"is-select-open"}`})]}),N(Y,{id:"form-select",isOpen:ue,onClose:()=>Re(!1),backdrop:me?"blur":"transparent",opacity:me?.8:.4,position:me?"center":"bottom",offset:5,modalRef:Lt,windowOffset:10,transitionDuration:200,containerRef:me?void 0:ke,contentClassName:"select-menu-content",className:"select-options-menu",children:N(it,{containerRef:ke,onSearchQuery:a,searchQueryValue:t,searchQueryPlaceholder:r,searchQueryClassName:F,searchQueryStyle:E,height:w,children:N(ot,{isLoading:i,hasNextPage:s,loadMore:n,emptyMessage:l,children:At})})})]})})})},ra=({rules:e,...o})=>N(I,{Component:q,defaultValue:[],inputProps:{...o,multiselect:!0},rules:e}),na=({rules:e,...o})=>N(I,{Component:q,defaultValue:null,inputProps:{...o,multiselect:!1},rules:e}),aa=e=>{let{multiselect:o}=e;return o?N(ra,{...e,multiselect:!0}):N(na,{...e,multiselect:!1})};q.Controller=aa;q.Option=nt;q.OptionLabel=ea;import{useMemo as ia}from"react";b(`.input-slider{display:grid;grid-template-columns:1fr 50px;align-items:center;gap:10px;.slider{appearance:none;-webkit-appearance:none;-moz-appearance:none;display:grid;align-items:center;&:focus{outline:none}&::-webkit-slider-thumb{-webkit-appearance:none;width:20px;height:20px;border-radius:1em;background:var(--primary-500);box-shadow:0 0 0 0 var(--neutral-500);margin-top:-8px;transition:all .3s ease;cursor:pointer}&::-webkit-slider-runnable-track{height:4px;border-radius:1em;background:hsl(from var(--primary-200) h s l / 50%);transition:all .3s ease}&:focus,&:hover{&::-webkit-slider-thumb{background:var(--primary-500);box-shadow:0 0 0 6px hsl(from var(--primary-500) h s l / 50%);cursor:grab}}&:active{&::-webkit-slider-thumb{box-shadow:0 0 0 12px hsl(from var(--primary-500) h s l / 31%);cursor:grabbing}}&:focus{&::-webkit-slider-runnable-track{background:var(--primary-300)}}}&:has(.slider-number:focus) .slider::-webkit-slider-thumb,&:has(.slider-number:hover) .slider::-webkit-slider-thumb{background:var(--primary-500);box-shadow:0 0 0 6px hsl(from var(--primary-500) h s l / 31%)}.slider-number{transition:all .3s ease;border:1px solid;border-radius:5px;text-align:center;font-size:var(--typography-size-label);appearance:none;-webkit-appearance:none;-moz-appearance:none;width:100%;padding:4px 8px;font-weight:700;color:inherit;&::-webkit-outer-spin-button,&::-webkit-inner-spin-button{-webkit-appearance:none;margin:0}}&.is-focus{.slider-number{color:var(--primary-500)}}}
|
|
24
|
-
`);import{jsx as Te,jsxs as la}from"react/jsx-runtime";var dt=({name:e,value:o,setValue:t,onBlur:r,onFocus:a,min:n,max:i,step:s,onlySlider:l=!1,className:c="",style:m={},autoFocus:p=!1,readOnly:d=!1,disabled:u=!1,placeholder:g="",autoComplete:v="off",isDirty:f=!1,isTouched:y=!1,invalid:C=!1,error:P,...T})=>{let x=ia(()=>crypto.randomUUID(),[]),w=$=>{r&&r($);let B=parseInt(`${o}`);n!==void 0&&B<n&&t(n),i!==void 0&&B>i&&t(i),t(B)},{isFocus:E,handlers:F}=S({onBlur:w,onChange:$=>t(+$.target.value),onFocus:a}),A=h({"input-slider":!0,"is-focus":E});return Te(H,{id:x,error:P,isFocus:E,...T,children:la("section",{className:A,children:[Te("input",{id:x,type:"range",name:e,className:`slider ${c}`,style:m,value:o,autoFocus:p,autoComplete:v,placeholder:g,disabled:u,readOnly:d,min:n,max:i,step:s,...F}),!l&&Te("input",{id:x,type:"number",name:e,className:`slider-number ${c}`,style:m,value:o,autoComplete:v,disabled:u,readOnly:d,min:n,max:i,step:s,...F})]})})},sa=({rules:e,...o})=>Te(I,{Component:dt,defaultValue:0,inputProps:o,rules:e});dt.Controller=sa;import{useMemo as ca}from"react";b(`.textarea{border:0;outline:0;field-sizing:content}
|
|
25
|
-
`);import{jsx as _e}from"react/jsx-runtime";var mt=({name:e,value:o,setValue:t,onBlur:r,onFocus:a,rows:n=4,resize:i="vertical",className:s="",style:l={},autoFocus:c=!1,readOnly:m=!1,disabled:p=!1,placeholder:d="",autoComplete:u="off",isDirty:g=!1,isTouched:v=!1,invalid:f=!1,error:y,...C})=>{let P=ca(()=>crypto.randomUUID(),[]),{handlers:T,isFocus:x}=S({onBlur:r,onChange:E=>t(E.target.value),onFocus:a}),w=h({textarea:!0,[s]:!!s});return _e(H,{id:P,error:y,isFocus:x,...C,children:_e("textarea",{id:P,name:e,className:w,style:{resize:i,...l},value:o,rows:n,...T,autoFocus:c,autoComplete:u,placeholder:d,disabled:p,readOnly:m})})},pa=({rules:e,...o})=>_e(I,{Component:mt,defaultValue:"",inputProps:o,rules:e});mt.Controller=pa;import{useMemo as ha}from"react";import{useState as fa}from"react";import{cloneElement as da}from"react";b(`.tooltip{color:var(--foreground);font-size:var(--typography-size-small);line-height:1em;border-radius:5px;padding:.5em 1em;display:block;border:1px solid;pointer-events:none;&:before{content:"";display:block;background:var(--background-paper);position:absolute;z-index:1;width:10px;height:10px;border-left:1px solid transparent;border-top:1px solid transparent;border-right:1px solid var(--foreground);border-bottom:1px solid var(--foreground);border-radius:0 0 3px}&.left{animation:fadeInRight .25s ease-out;&.close-animation{animation:fadeOutLeft .25s ease-out;transform:translate(-10px);opacity:0}&:before{top:50%;left:100%;transform:translate(-50%,-50%) rotate(-45deg)}}&.right{animation:fadeInLeft .25s ease-out;&.close-animation{animation:fadeOutRight .25s ease-out;transform:translate(10px);opacity:0}&:before{top:50%;right:100%;transform:translate(50%,-50%) rotate(135deg)}}&.top{animation:fadeInDown .25s ease-out;&.close-animation{animation:fadeOutUp .25s ease-out;transform:translateY(-10px);opacity:0}&:before{top:100%;left:50%;transform:translate(-50%,-50%) rotate(45deg)}}&.bottom{animation:fadeInUp .25s ease-out;&.close-animation{animation:fadeOutDown .25s ease-out;transform:translateY(10px);opacity:0}&:before{left:50%;bottom:100%;transform:translate(-50%,50%) rotate(-135deg)}}}
|
|
26
|
-
`);import{Fragment as ma,jsx as ut,jsxs as ua}from"react/jsx-runtime";var pe=({position:e="top",children:o,content:t,offset:r=5,disabled:a=!1})=>{let{containerRef:n,openModal:i,closeModal:s,isOpen:l}=lo(),c=h({tooltip:!0,[e]:!0});return L("mouseenter",()=>i(),n),L("mouseleave",()=>s(),n),a?o:ua(ma,{children:[da(o,{ref:n}),ut(V,{backdrop:"none",id:"tooltip",isOpen:l,containerRef:n,onClose:s,position:e,className:c,closeOnClickOutside:!1,offset:6+ +r,windowOffset:10,transitionDuration:100,closeAnimationClassName:"close-animation",children:ut("span",{className:"tooltip-content",children:t})})]})};import{jsx as ft}from"react/jsx-runtime";var am=({children:e,value:o,position:t,offset:r,tooltipText:a,tooltipCopiedText:n,copiedTextTimeout:i=500})=>{let[s,l]=fa(!1);return ft(pe,{content:s&&n?n:a,position:t,offset:r,children:ft("span",{onClick:()=>{l(!0),navigator.clipboard.writeText(o),setTimeout(()=>l(!1),i)},children:e})})};b(`.switch-container{--width: attr(data-width);--dot-size: attr(data-dot-size);--dot-hover-size: attr(data-dot-hover-size);--padding: attr(data-padding);--color: var(--neutral-500);--color-dark: var(--neutral-800);--color-contrast: var(--neutral-50);display:flex;align-items:center;gap:.5em;width:fit-content;.switch{width:calc(var(--width) + var(--padding) * 2);border-radius:100em;background:var(--background-paper);padding:var(--padding);transition:all .3s ease;position:relative;.switch-dot{width:var(--dot-size);height:var(--dot-size);border-radius:100em;background:var(--color);display:block;transition:all .3s ease;margin-left:0;position:relative;z-index:1}.switch-icon{cursor:pointer;display:block}.switch-internal-left-icon,.switch-internal-right-icon{width:var(--dot-size);height:var(--dot-size);position:absolute;top:var(--padding);display:grid;place-content:center;color:var(--color-contrast);transition:all .3s ease}.switch-internal-left-icon{left:var(--padding)}.switch-internal-right-icon{right:var(--padding)}&.is-checked{background:var(--color);.switch-dot{margin-left:calc(var(--width) - var(--dot-size));background:color-mix(in hsl,var(--color),var(--color-contrast) 75%)}}&:not(.is-readonly):has(input:disabled){background:var(--background-disabled);.switch-dot{background:var(--foreground-disabled)}.switch-internal-left-icon,.switch-internal-right-icon{color:var(--foreground-disabled)}&.is-checked{background:var(--color-dark)}}.switch-checkbox{position:absolute;top:0;left:0;width:100%;height:100%;cursor:pointer;opacity:0;z-index:3}}.switch-label{cursor:pointer;user-select:none;padding:0 .5em}.switch:not(:has(.is-readonly,input:disabled)):hover .switch-dot,&:has(.switch-icon:hover) .switch:not(:has(.is-readonly,input:disabled)) .switch-dot,&:has(.switch-label:hover) .switch:not(:has(.is-readonly,input:disabled)) .switch-dot{box-shadow:0 0 0 calc(.3 * var(--dot-size)) color-mix(in hsl,var(--color) 50%,var(--color-contrast))}.switch:not(:has(.is-readonly,input:disabled)):active .switch-dot,&:has(.switch-icon:active) .switch:not(:has(.is-readonly,input:disabled)) .switch-dot,&:has(.switch-label:active) .switch:not(:has(.is-readonly,input:disabled)) .switch-dot{width:var(--dot-hover-size)}.switch:not(:has(.is-readonly,input:disabled)).is-checked:active .switch-dot,&:has(.switch-icon:active) .switch:not(:has(.is-readonly,input:disabled)).is-checked .switch-dot,&:has(.switch-label:active) .switch:not(:has(.is-readonly,input:disabled)).is-checked .switch-dot{margin-left:calc(var(--width) - var(--dot-hover-size))}&.color-primary{--color: var(--primary-500);--color-dark: var(--primary-700);--color-contrast: var(--primary-50)}&.color-secondary{--color: var(--secondary-500);--color-dark: var(--secondary-700);--color-contrast: var(--secondary-50)}&.color-tertiary{--color: var(--tertiary-500);--color-dark: var(--tertiary-700);--color-contrast: var(--tertiary-50)}&.color-active{--color: var(--active-500);--color-dark: var(--active-700);--color-contrast: var(--active-50)}&.color-warning{--color: var(--warning-500);--color-dark: var(--warning-700);--color-contrast: var(--warning-50)}&.color-alert{--color: var(--alert-500);--color-dark: var(--alert-700);--color-contrast: var(--alert-50)}&.color-info{--color: var(--info-500);--color-dark: var(--info-700);--color-contrast: var(--info-50)}}
|
|
27
|
-
`);import{jsx as U,jsxs as bt}from"react/jsx-runtime";var ht={small:1,regular:1.2,large:1.4},gt={small:2,regular:2.5,large:3},yt=({name:e,value:o,setValue:t,onBlur:r,onFocus:a,className:n="",style:i={},autoFocus:s=!1,readOnly:l=!1,disabled:c=!1,placeholder:m="",autoComplete:p="off",label:d,leftLabel:u,rightLabel:g,width:v="regular",size:f="regular",dotHoverSize:y=1.3,padding:C=.25,leftIcon:P,rightIcon:T,internalLeftIcon:x,internalRightIcon:w,leftIconTooltip:E,rightIconTooltip:F,color:A})=>{let $=ha(()=>crypto.randomUUID(),[]),{handlers:B}=S({onChange:Pe=>t(Pe.target.checked),onBlur:r,onFocus:a}),k=h({"switch-container":!0,[n]:!!n,[`color-${A}`]:!!A}),M=h({switch:!0,"is-checked":o,"is-readonly":!c&&l}),z=ht[f]??ht.regular,W=(gt[v]??gt.regular)*z,O=Math.min(C,z);return bt("section",{className:k,style:{...i,"--width":`${W}em`,"--dot-size":`${z}em`,"--dot-hover-size":`${z*Math.min(Math.max(y,1),2)}em`,"--padding":`${O}em`},children:[u?U(R,{variant:"label-form",className:"switch-label",htmlFor:$,children:u}):null,P!==void 0&&U(pe,{content:E,disabled:!E,offset:10,children:U(P,{size:`${z*.7}em`,className:"switch-icon",onClick:()=>t(!o)})}),bt("section",{className:M,children:[x!==void 0&&U("span",{className:"switch-internal-left-icon",children:U(x,{size:`${z*.7}em`})}),w!==void 0&&U("span",{className:"switch-internal-right-icon",children:U(w,{size:`${z*.7}em`})}),U("span",{className:"switch-dot"}),U("input",{id:$,type:"checkbox",name:e,className:`switch-checkbox ${n}`,style:i,checked:o,autoFocus:s,autoComplete:p,placeholder:m,disabled:c||l,...B})]}),T!==void 0&&U(pe,{content:F,disabled:!F,offset:10,children:U(T,{size:`${z*.7}em`,className:"switch-icon",onClick:()=>t(!o)})}),d||g?U(R,{variant:"label-form",className:"switch-label",htmlFor:$,children:d||g}):null]})},ga=({rules:e,...o})=>U(I,{Component:yt,defaultValue:!1,inputProps:o,rules:e});yt.Controller=ga;import{jsx as ba}from"react/jsx-runtime";var bm=({alt:e="",loading:o="eager",...t})=>ba("img",{loading:o,alt:e,...t,width:"100%"});import{useMemo as Rt,useState as Ra}from"react";import{useMemo as ya}from"react";import{MdArrowDownward as va,MdArrowUpward as Ca}from"react-icons/md";import{jsx as te,jsxs as vt}from"react/jsx-runtime";var Ct=({header:e,sortBy:o,icon:t,width:r,field:a,toggleSortField:n,sortField:i,orderField:s,hidden:l})=>{let c=o!==void 0?o:a,m=h({"sort-on-click":!!c}),p=c?()=>n(c):void 0,d=ya(()=>c?te("span",{className:"sort-icon",children:!!i&&i===c&&(s==="asc"?te(Ca,{}):te(va,{}))}):null,[c,i,s]);return l?null:vt("th",{style:{width:r},className:m,onClick:p,children:[vt(ce,{flow:"column",gap:"0.5em",jc:"space-between",ai:"center",children:[t?te(t,{}):null,te(R,{variant:"label",noPadding:!0,children:e}),d]}),te(ee,{color:"var(--primary-700)"})]})};import{jsx as We}from"react/jsx-runtime";var xa=(e,{field:o,render:t,Component:r},a)=>{if(o&&e[o])return We(R,{noPadding:!0,nowrap:!0,children:e[o]});if(t)return t(e,a);if(r)return We(r,{data:e,rowKey:a})},xt=(e,o,t)=>o.map((r,a)=>r.hidden?null:We("td",{children:xa(e,r,t)},a)),Tt=(e,o,t)=>o?e.toSorted((r,a)=>{let n=r[o],i=a[o];return["number","boolean","string"].includes(typeof n)&&["number","boolean","string"].includes(typeof i)?n===i?0:t==="asc"?n>i?1:-1:n>i?-1:1:0}):e;import{useCallback as Ta,useState as Pa}from"react";var Pt=()=>{let[[e,o],t]=Pa([null,null]),r=Ta(a=>{t(([n,i])=>a!==n?[a,"asc"]:i==="asc"?[a,"desc"]:[null,null])},[]);return{sortBy:e,order:o,toggleSortField:r}};import{jsx as ka}from"react/jsx-runtime";var kt=({data:e,columns:o,isSelected:t=!1,selectable:r=!1,rowKey:a})=>{let n=h({"row-selected":r&&t});return ka("tr",{className:n,children:xt(e,o,a)})};b(`.smart-table-container{border:0 solid var(--primary-500);border-radius:5px;overflow:auto;height:100%;width:100%;margin:auto}.smart-table{border-collapse:collapse;position:relative;width:100%;&.layout-fixed{table-layout:fixed}&.layout-scrollable{table-layout:auto}thead{position:sticky;z-index:10;top:0;box-shadow:0 3px 5px #0003,0 1px 10px #0000001f;tr{background:var(--primary-500);color:var(--primary-50);transition:all .3s ease}}tbody{tr{box-shadow:inset 0 0 0 0 var(--primary-500);transition:box-shadow .3s ease;&.row-selected,&:hover{background:var(--background-paper)}&.row-selected{box-shadow:inset 10px 0 0 -5px var(--primary-500)}&:not(:last-child){border-bottom:1px solid var(--border)}}}th{padding:.8em 1.2em;user-select:none;&.sort-on-click{cursor:pointer}.sort-icon{width:1em;display:block}svg{animation:fadeIn .3s ease}path{transition:all .3s ease}&:first-child{padding-left:2em}&:last-child{padding-right:2em}}td{transition:all .3s ease;padding:.6em 1em;&:first-child{padding-left:2em}&:last-child{padding-right:2em}}}
|
|
28
|
-
`);import{jsx as J,jsxs as wa}from"react/jsx-runtime";var _m=({columns:e,data:o,width:t,selectable:r=!1,rowId:a,className:n="",tableClassName:i=""})=>{let[s,l]=Ra({}),c=h({"smart-table":!0,[i]:!!i,"layout-fixed":t==="content","layout-scrollable":t==="scroll"}),m=h({"smart-table-container":!0,[n]:!!n}),{sortBy:p,order:d,toggleSortField:u}=Pt(),g=Rt(()=>{let f=[...e];return r&&(f=[{header:`${Object.values(s).length}`,render:(y,C)=>J(oe,{name:`selected-${C}`,value:`${C}`in s,setValue:P=>{l(T=>{let x={...T};return P?x[`${C}`]=y:delete x[`${C}`],x})}})},...f]),f},[e,r,s]),v=Rt(()=>Tt(o,p,d),[o,p,d]);return J("section",{className:m,children:wa("table",{className:c,children:[J("thead",{children:J("tr",{children:g.map((f,y)=>J(Ct,{toggleSortField:u,sortField:p,orderField:d,...f},y))})}),J("tbody",{children:v.map(f=>J(kt,{rowKey:f[a],data:f,columns:g,isSelected:`${f[a]}`in s,selectable:r},f[a]))})]})})};import{createContext as Ia,useContext as St,useEffect as Sa,useState as Na}from"react";import{useEffect as Ea,useRef as wt,useState as Et}from"react";import{jsx as Mt,jsxs as Ma}from"react/jsx-runtime";var Xe={top:0,left:0,width:0,height:0};var It=({tabs:e=[],variant:o="solid",radius:t="full",direction:r="horizontal",color:a,children:n,openTab:i,size:s="medium",className:l="",style:c={}})=>{let m=wt(null),p=wt(null),[d,u]=Et(!1),[g,v]=Et(Xe),f=h({"tab-list":!0,[`variant-${o}`]:!!o,[`size-${s}`]:!!s,[`radius-${t}`]:!!t,[`color-${a}`]:!!a,"vertical-direction":r==="vertical",[l]:!!l});return Ea(()=>{let y=p.current?.getBoundingClientRect()??Xe,C=m.current?.getBoundingClientRect()??Xe,P=y.width,T=o==="line"?2:y.height,x=y.left-C.left,w=o==="line"?y.top+y.height-C.top:y.top-C.top;v({left:x,top:w,width:P,height:T}),d||setTimeout(()=>{u(!0)},100)},[d,o,i]),Ma("section",{className:f,ref:m,style:c,children:[!!o&&Mt("span",{className:`tabs-selector ${d?"active":""}`,style:g}),e.map(({id:y,label:C})=>Mt(de.Tab,{id:y,ref:y===i?p:void 0,children:C},y)),n]})};b(`.tab{cursor:pointer;user-select:none;transition:all .3s ease}.tab-list{--color: var(--neutral-900);--color-contrast: var(--neutral-50);--inner-radius: 0;--outer-radius: 0;display:grid;grid-auto-flow:column;gap:1em;align-items:center;position:relative;font-size:var(--typography-size-label);border-radius:var(--outer-radius);.tab,.tabs-selector{border-radius:var(--inner-radius)}&.size-small{font-size:var(--typography-size-small)}&.size-medium{font-size:var(--typography-size-label)}&.size-large{font-size:var(--typography-size-body)}.tabs-selector{position:absolute;background:var(--color);color:var(--color-contrast);border-radius:1.5em;&.active{transition:all .3s ease}}.tab{border-radius:1.5em;padding:.5em 1em;z-index:1;text-align:center;&.is-open{color:var(--color-contrast)}&:not(.is-open):hover{color:var(--neutral-900)}}&.radius-none{--outer-radius: 0;--inner-radius: 0}&.radius-small{--outer-radius: .5em;--inner-radius: .5em}&.radius-medium{--outer-radius: 1em;--inner-radius: .8em}&.radius-large{--outer-radius: 1.5em;--inner-radius: 1.3em}&.radius-full{--outer-radius: 1.8em;--inner-radius: 1.6em}&.vertical-direction{grid-auto-flow:row;align-items:unset;align-content:start}&.variant-solid{background:var(--background-paper);color:var(--foreground);padding:.5em}&.variant-ghost{border:1px solid var(--color);padding:.5em}&.variant-line{border-radius:0;&:not(.vertical-direction){border-bottom:2px solid var(--border)}.tabs-selector{border-radius:0}.tab{border-radius:0;&.is-open{color:var(--color)}}}&.color-primary{--color: var(--primary-500);--color-contrast: var(--primary-50)}&.color-secondary{--color: var(--secondary-500);--color-contrast: var(--secondary-50)}&.color-tertiary{--color: var(--tertiary-500);--color-contrast: var(--tertiary-50)}&.color-active{--color: var(--active-500);--color-contrast: var(--active-50)}&.color-warning{--color: var(--warning-500);--color-contrast: var(--warning-50)}&.color-alert{--color: var(--alert-500);--color-contrast: var(--alert-50)}&.color-info{--color: var(--info-500);--color-contrast: var(--info-50)}}
|
|
29
|
-
`);import{jsx as Ze}from"react/jsx-runtime";var Qe=Ia(null),Nt=e=>{let o=St(Qe);if(!o)throw new Error("You cant use this component out off an Tabs component");let{openTab:t,changeOpenTab:r}=o;return[t===e,()=>r(e)]},Oa=()=>{let e=St(Qe);if(!e)throw new Error("You cant use this component out off an Tabs component");return e},de=({children:e,defaultOpenTab:o,onChange:t})=>{let[r,a]=Na(o);return Sa(()=>{t&&t(r)},[r,t]),Ze(Qe.Provider,{value:{openTab:r,changeOpenTab:n=>a(n)},children:e})},La=({id:e,children:o,className:t="",style:r={},onClick:a,ref:n})=>{let[i,s]=Nt(e),l=h({tab:!0,[t]:!!t,"is-open":i});return Ze("span",{className:l,style:r,onClick:m=>{s(),a&&a(m)},ref:n,children:o})},Fa=({id:e,children:o})=>{let[t]=Nt(e);return t?o:null},Aa=({children:e,...o})=>{let{openTab:t}=Oa();return Ze(It,{...o,openTab:t,children:e})};de.Tab=La;de.TabPanel=Fa;de.TabList=Aa;b(`.tag{--background: attr(data-background, var(--primary-500));--text: attr(data-text, var(--primary-50));--background-selected: attr(data-background-selected, var(--primary-700));--text-selected: attr(data-text-selected, var(--primary-50));padding:.4em .8em;border-radius:.3em;border:1px solid;background:var(--background);color:var(--text);transition:all .3s ease;display:inline-block;font-size:var(--typography-size-label);user-select:none;&.no-wrap{white-space:nowrap;overflow:hidden;text-overflow:ellipsis}&.rounded-none{border-radius:0}&.rounded-small{border-radius:.25em}&.rounded-medium{border-radius:.5em}&.rounded-large{border-radius:1em}&.rounded-full{border-radius:100rem}&:hover,&.is-selected{background:var(--background-selected);color:var(--text-selected)}}
|
|
30
|
-
`);import{jsx as za}from"react/jsx-runtime";var Da=(n=>(n.NONE="none",n.SMALL="small",n.MEDIUM="medium",n.LARGE="large",n.FULL="full",n))(Da||{}),uu=({children:e,rounded:o="medium",selected:t=!1,noWrap:r=!1,ref:a})=>{let n=h({tag:!0,[`rounded-${o}`]:!!o,"is-selected":t,"no-wrap":r});return za("span",{className:n,ref:a,children:e})};export{Ui as Accordion,Ms as AccordionItem,se as ActionModal,wc as AsideModal,Ao as Backdrop,Ro as Button,oe as Checkbox,am as ClickToCopy,Fc as ConfirmationModal,Ws as Cursor,So as DatePicker,H as Field,Gr as FieldOrientation,$r as FieldVariant,qi as FlipCard,ss as HoverCard,bm as Image,ot as InfinityScroll,No as Input,jo as InputColor,Wo as InputFile,Ko as InputNumber,Lo as InputPassword,he as Line,ur as LineOrientation,fr as LineStyle,Y as Menu,V as Modal,en as ModalBackdrop,Fo as Portal,Jo as Radio,ee as Ripple,q as Select,Co as SlideCard,dt as Slider,_m as SmartTable,yt as Switch,de as Tabs,uu as Tag,Da as TagRounded,mt as Textarea,pe as Tooltip,R as Typography,vo as useAccordionItem};
|
|
2
|
+
import{createContext as hr,useCallback as gr,useContext as br,useMemo as yr,useState as vr}from"react";import{useMemo as Dt}from"react";var h=e=>Dt(()=>Object.entries(e).reduce((o,[t,r])=>r?[...o,t]:o,[]).join(" "),[e]);import{useEffect as zt,useLayoutEffect as Ht,useRef as Bt}from"react";function O(e,o,t,r){let a=Bt(o);zt(()=>{a.current=o},[o]),Ht(()=>{let n=t?.current??window;if(!(n&&n.addEventListener))return;let i=s=>a.current(s);return n.addEventListener(e,i,r),()=>{n.removeEventListener(e,i,r)}},[e,t,r])}var $t=(e,o)=>e.current&&!e.current.contains(o),qe=(e,o)=>{O("keydown",t=>{t.key==="Escape"&&o()}),O("mousedown",t=>{let r=t.target;if(!r?.isConnected)return;(Array.isArray(e)?e:[e]).every(n=>$t(n,r))&&o()})};import{useEffect as Gt,useState as Ut}from"react";var Je=(e,o=500)=>{let[t,r]=Ut(e);return Gt(()=>{let a=setTimeout(()=>r(e),o);return()=>{clearTimeout(a)}},[e,o]),t};import{useEffect as Vt}from"react";var Q=(e,o)=>{Vt(()=>{let t=Array.isArray(e)?e:[e],r=new ResizeObserver(o);return t.forEach(a=>a.current&&r.observe(a.current)),()=>{r.disconnect()}},[e,o])};import{useEffect as _t,useState as Yt}from"react";var eo=e=>{let o=document.getElementById(e);return o===null&&(o=document.createElement("div"),o.setAttribute("id",e),document.body.appendChild(o)),o},oo=e=>{let[o,t]=Yt(()=>eo(e));return _t(()=>{let r=document.getElementById(e);if(o===null||r===null){let a=eo(e);t(a)}return()=>{o&&o.parentNode&&process.env.NODE_ENV==="production"&&document.body.removeChild(o)}},[o,e]),o};var te=(e,o=2)=>{if(e===0)return"0 Bytes";let t=1e3,r=o<0?0:o,a=["Bytes","KB","MB","GB","TB","PB","EB","ZB","YB"],n=Math.floor(Math.log(e)/Math.log(t));return parseFloat((e/Math.pow(t,n)).toFixed(r))+" "+a[n]};var to=({c:e,m:o,offset:t,position:r})=>{let a=e.y+e.h+t,n=e.x-(o.w-e.w)*(50/100);switch(r){case"top":case"top center":a=e.y-o.h-t,n=e.x-(o.w-e.w)/2;break;case"top left":a=e.y-o.h-t,n=e.x-o.w+e.w;break;case"top right":a=e.y-o.h-t,n=e.x;break;case"bottom":case"bottom center":a=e.y+e.h+t,n=e.x-(o.w-e.w)/2;break;case"bottom left":a=e.y+e.h+t,n=e.x-o.w+e.w;break;case"bottom right":a=e.y+e.h+t,n=e.x;break;case"left":case"left center":a=e.y-(o.h-e.h)/2,n=e.x-o.w-t;break;case"left top":a=e.y-o.h+e.h,n=e.x-o.w-t;break;case"left bottom":a=e.y,n=e.x-o.w-t;break;case"right":case"right center":a=e.y-(o.h-e.h)/2,n=e.x+e.w+t;break;case"right top":a=e.y-o.h+e.h,n=e.x+e.w+t;break;case"right bottom":a=e.y,n=e.x+e.w+t;break}return{left:Math.round(n),top:Math.round(a)}},jt=({top:e,left:o},t,r,a)=>{let n=t.split(" "),i=[],s=o+a.w+r-window.innerWidth,l=e+a.h+r-window.innerHeight;for(let c of n)c==="top"&&e<r?i.push("bottom"):c==="left"&&o<r?i.push("right"):c==="bottom"&&l>0?i.push("top"):c==="right"&&s>0?i.push("left"):i.push(c);return i.join(" ")},Xt=({top:e,left:o},t,r)=>{let a=o+t.w+r-window.innerWidth,n=e+t.h+r-window.innerHeight;return o=a>0?o-a:o,e=n>0?e-n:e,o=o<r?r:o,e=e<r?r:e,{top:e,left:o}},ro=({c:e,m:o,offset:t,windowOffset:r,position:a})=>{let n={c:e,m:o,offset:t,position:a},i=to(n),s=jt(i,a,r,o);s!==a&&(i=to({...n,position:s}));let l=Xt(i,o,r);return{left:`${l.left}px`,top:`${l.top}px`}};var no=({position:e,windowOffset:o})=>{switch(e){case"center":return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"};case"top":case"top center":return{top:`${o}px`,left:"50%",transform:"translateX(-50%)"};case"top left":case"left top":return{top:`${o}px`,left:`${o}px`};case"top right":case"right top":return{top:`${o}px`,right:`${o}px`};case"bottom":case"bottom center":return{bottom:`${o}px`,left:"50%",transform:"translateX(-50%)"};case"left bottom":case"bottom left":return{bottom:`${o}px`,left:`${o}px`};case"right bottom":case"bottom right":return{bottom:`${o}px`,right:`${o}px`};case"left":case"left center":return{top:"50%",left:`${o}px`,transform:"translateY(-50%)"};case"right":case"right center":return{top:"50%",right:`${o}px`,transform:"translateY(-50%)"}}return{top:"50%",left:"50%",transform:"translate(-50%, -50%)"}};import{useRef as Qt,useState as Zt}from"react";import{useEffect as Wt}from"react";var ao=(e,o,t={})=>{Wt(()=>{let r=Array.isArray(e)?e:[e],a=new IntersectionObserver(o,t);return r.forEach(n=>n.current&&a.observe(n.current)),()=>{a.disconnect()}},[o,t,e])};var io=(e={})=>{let[o,t]=Zt(!1),r=Qt(null);return ao(r,([a])=>{t(a.isIntersecting)},e),{ref:r,inView:o}};import{useCallback as we,useState as Kt}from"react";var S=({onBlur:e,onFocus:o,onChange:t}={})=>{let[r,a]=Kt(!1),n=we(l=>{a(!0),o&&o(l)},[o]),i=we(l=>{a(!1),e&&e(l)},[e]),s=we(l=>{t&&t(l)},[t]);return{isFocus:r,handlers:{onFocus:n,onBlur:i,onChange:s}}};import{useEffect as qt,useState as Jt}from"react";var ue=e=>{let[o,t]=Jt(!1);return qt(()=>{let r=window.matchMedia(e);r.matches!==o&&t(r.matches);let a=()=>{t(r.matches)};return r.addEventListener("change",a),()=>{r.removeEventListener("change",a)}},[o,e]),o};import{useRef as er,useState as or}from"react";var so=()=>{let e=er(null),[o,t]=or(!1);return{containerRef:e,isOpen:o,openModal:()=>{t(!0)},closeModal:()=>{t(!1)}}};import{useCallback as lo,useLayoutEffect as tr,useRef as rr}from"react";var co=e=>({x:e.x,y:e.y,w:e.width,h:e.height,top:e.top,left:e.left}),po=({offset:e=0,windowOffset:o=0,position:t="bottom",modalRef:r,containerRef:a,isOpen:n})=>{let i=rr(null),s=lo((c,m)=>{let d=c.current?.getClientRects()[0],p=m.current?.getClientRects()[0];if(!d)return;let u=p?ro({c:co(p),m:co(d),offset:e,windowOffset:o,position:t}):no({position:t,windowOffset:o});Object.keys(u).forEach(g=>{c.current?.style.setProperty(g,u[g])})},[t,o,e]),l=lo(()=>{n&&s(r,a??i)},[s,n,a,r]);tr(l,[l]),Q(a??i,l),Q(r,l),O("resize",l),O("scroll",l,r)};import nr,{useCallback as mo,useEffect as ar,useLayoutEffect as ir,useMemo as sr}from"react";var uo=({transitionDuration:e=0,isOpen:o})=>{let[t,r]=nr.useState("CLOSED"),a=sr(()=>t!=="CLOSED",[t]);ar(()=>{document.documentElement.style.overflow=a?"hidden":"auto"},[a]);let n=mo(()=>{["OPENING","OPEN"].includes(t)&&(e>0?(r("CLOSING"),setTimeout(()=>{r("CLOSED")},e)):r("CLOSED"))},[t,e]),i=mo(()=>{["CLOSING","CLOSED"].includes(t)&&(e>0?(r("OPENING"),setTimeout(()=>{r("OPEN")},e)):r("OPEN"))},[t,e]);return ir(()=>{t==="CLOSED"&&o?i():t==="OPEN"&&!o&&n()},[o,i,n,t]),{isVisible:a,modalState:t}};import{useRef as lr,useState as cr}from"react";var fo=(e,o)=>{let{left:t,top:r}=e,a=t+window.scrollX,n=r+window.scrollY,i=o.pageX-a,s=o.pageY-n;return{x:o.pageX,y:o.pageY,elementX:i,elementY:s,elementPositionX:a,elementPositionY:n}},ho=e=>{let o=lr(null),[t,r]=cr({x:null,y:null,elementX:null,elementY:null,elementPositionX:null,elementPositionY:null});return O("mousemove",n=>{let{clientX:i,clientY:s}=n;if(r(l=>({...l,x:i,y:s})),e?.current instanceof Element){let l=fo(e.current.getBoundingClientRect(),n);r(c=>({...c,...l}))}else if(o.current instanceof Element){let l=fo(o.current.getBoundingClientRect(),n);r(c=>({...c,...l}))}}),{...t,ref:o}};import{useCallback as dr,useState as pr}from"react";var go=(e,o=0)=>{let[t,r]=pr(o),a=dr(n=>{r(n!==void 0?n:i=>(i+1)%e.length)},[e.length]);return[e[t],a]};import{jsx as fr}from"react/jsx-runtime";var mr=(t=>(t.VERTICAL="vertical",t.HORIZONTAL="horizontal",t))(mr||{}),ur=(r=>(r.SOLID="solid",r.DOTTED="dotted",r.DASHED="dashed",r))(ur||{}),fe=({orientation:e="horizontal",className:o="",style:t={},color:r="currentColor",size:a=1,lineStyle:n="solid",dashedSize:i=1,spacing:s=1})=>{let l=h({"custom-line":!0,[e]:!0,[o]:!!o,[n]:!0});return fr("span",{className:l,style:{...t,"--color":r,"--size":`${a}px`,"--spacing":`${s}px`,"--dashSize":`${i}px`}})};import{jsx as Ee}from"react/jsx-runtime";var bo=hr(null),yo=e=>{let o=br(bo);if(!o)throw new Error("You cant use this component out off an Accordion component");let{toggleItem:t,openedItems:r}=o,a=()=>t(e);return[r.includes(e),a]},Ui=({children:e,className:o="",noSeparators:t,multiple:r,style:a={},defaultOpened:n=[]})=>{let[i,s]=vr(()=>(Array.isArray(n)?n:[n]).reduce((d,p)=>typeof p=="string"?{...d,[p]:!0}:d,{})),l=gr(d=>{s(p=>({...r?p:{},[d]:!p[d]}))},[r]),c=yr(()=>Object.keys(i).filter(d=>i[d]),[i]),m=h({accordion:!0,[o]:!!o});return Ee(bo.Provider,{value:{toggleItem:l,openedItems:c},children:Ee("section",{className:m,style:a,children:(Array.isArray(e)?e:[e]).flatMap((d,p)=>p===0?d:[t?null:Ee(fe,{orientation:"horizontal"},`${p}.5`),d])})})};import{useMemo as kr}from"react";import{FaCaretLeft as Rr}from"react-icons/fa";import{jsx as Cr}from"react/jsx-runtime";var vo=({children:e,isOpen:o,className:t="",style:r={}})=>Cr("section",{className:t,style:{overflow:"hidden",height:o?"auto":0,transition:"height 300ms ease",interpolateSize:"allow-keywords",...r},children:e});import{useMemo as Co}from"react";import{jsx as Me,jsxs as xr}from"react/jsx-runtime";var Ji=({cardZIndex:e="auto",flipDirection:o="vertical",flipSpeed:t=500,isFlipped:r=!1,children:a})=>{let n=c=>{if(a.length!==2)throw new Error("Component FlipCard requires 2 children");return a[c]},i=Co(()=>`rotate${o==="horizontal"?"Y":"X"}(${r?180:0}deg)`,[o,r]),s=Co(()=>`rotate${o==="horizontal"?"Y":"X"}(${r?0:-180}deg)`,[o,r]),l=h({"flip-card":!0,"is-flipped":r});return Me("section",{className:l,style:{"--cardZIndex":e,"--flipSpeed":`${t}ms`,"--frontRotate":i,"--backRotate":s},children:xr("section",{className:"flipper",children:[Me("section",{className:"front",children:n(0)}),Me("section",{className:"back",children:n(1)})]})})};import{useCallback as xo,useRef as To}from"react";import{jsx as Po}from"react/jsx-runtime";var cs=({children:e,threshold:o=5,translationZ:t=25,width:r="fit-content",className:a=""})=>{let n=To(null),i=To(null),s=xo(m=>{let d=n.current,p=i.current;if(!d||!p)return;let{clientX:u,clientY:g,currentTarget:y}=m,{clientWidth:f,clientHeight:b}=y,{top:v,left:T}=d.getBoundingClientRect(),x=(u-T)/f,C=(g-v)/b,R=x*2-1,L=((C*2-1)*o).toFixed(2),F=(R*o).toFixed(2);p.style.transform=`perspective(${f}px) rotateX(${-L}deg) rotateY(${F}deg)`,d.style.transform=`perspective(${f}px) translateZ(${t}px)`},[o,t]),l=xo(m=>{let d=n.current,p=i.current;!d||!p||(p.style.transform=`perspective(${m.currentTarget.clientWidth}px) rotateX(0) rotateY(0)`,d.style.transform=`perspective(${m.currentTarget.clientWidth}px) translateZ(0)`)},[]);O("mousemove",s,n),O("mouseleave",l,n);let c=h({"hover-card":!0,[a]:!!a});return Po("span",{ref:n,style:{width:r},className:c,children:Po("span",{className:"card-hover-layer",ref:i,children:e})})};import{createElement as Tr,useMemo as Pr}from"react";var Se={hero:"h1",header1:"h1",header2:"h2",header3:"h3",header4:"h4",body:"p",label:"span","label-form":"label",small:"small"},Ne={hero:"hero",header1:"header1",header2:"header2",header3:"header3",header4:"header4",body:"body",label:"label","label-form":"label",small:"small"};var k=({variant:e="body",nowrap:o=!1,className:t="",style:r={},children:a,as:n,weight:i,family:s="primary",noPadding:l=!1,align:c,color:m,htmlFor:d,recommendedWidth:p=!1,...u})=>{let g=h({typography:!0,[Ne[e]]:Ne[e]!==void 0,[t]:!!t,[i??""]:!!i,[m??""]:!!m,"no-padding":l,"code-family":s==="code","recommended-width":p,"nowrap-max-lines":typeof o=="number","nowrap-max-lines-2":o===2,"nowrap-max-lines-3":o===3,"nowrap-max-lines-4":o===4,"nowrap-max-lines-5":o===5,nowrap:o===!0}),y=Pr(()=>Se[e]??Se.body,[e]);return Tr(n??y,{...u,className:g,htmlFor:d,style:{textAlign:c,...r}},a)};import{jsx as ne,jsxs as Ie}from"react/jsx-runtime";var re=(e,o)=>typeof e=="function"?e(o):e,Is=({title:e,subtitle:o,children:t,icon:r=Rr,startContent:a,content:n,endContent:i,classNames:s={},className:l="",style:c={}})=>{let m=kr(()=>crypto.randomUUID(),[]),[d,p]=yo(m),u=h({"accordion-header":!0,"has-start-content":!!a,[s?.header??""]:!!s?.header,"is-open":d}),g=h({"accordion-header-content":!0,[s?.headerContent??""]:!!s?.headerContent}),y=h({"accordion-toggle-icon":!0,isOpen:d,[s?.toggleIcon??""]:!!s?.toggleIcon}),f=h({"accordion-body":!0,[s?.body??""]:!!s?.body}),b=re(e,d),v=re(o,d),T=re(a,d),x=re(n,d)??Ie("section",{className:g,children:[ne(k,{className:s?.title,variant:"body",noPadding:!0,weight:"bold",children:b}),ne(k,{className:s?.subtitle,variant:"label",noPadding:!0,weight:"light",children:v})]}),C=re(i,d)??ne(r,{className:y}),R=h({"accordion-item":!0,[l]:!!l});return Ie("section",{className:R,style:c,children:[Ie("section",{className:u,onClick:p,children:[T,x,C]}),ne(vo,{isOpen:d,children:ne("section",{className:f,children:t})})]})};import{useEffect as wr,useRef as Er}from"react";import{jsx as Mr}from"react/jsx-runtime";var J=({color:e,duration:o=1e3,timingFunction:t="ease-out",times:r=1,className:a="",style:n={},zIndex:i=1})=>{let s=Er(null);return wr(()=>{if(!s.current?.parentElement)return;let c=getComputedStyle(s.current.parentElement).position;["absolute","fixed","sticky","relative"].includes(c)||(s.current.parentElement.style.position="relative")},[]),Mr("span",{ref:s,onMouseDown:c=>{let{pageX:m,pageY:d,currentTarget:p}=c,u=p.getBoundingClientRect(),g=(m-u.left)*100/u.width,y=(d-u.top)*100/u.height,f=document.createElement("span");f.classList.add("ripple-effect"),f.style.animationDuration=`${o}ms`,f.style.animationTimingFunction=t,f.style.left=`${g}%`,f.style.top=`${y}%`,e&&(f.style.background=e),p.appendChild(f),setTimeout(()=>{f.remove()},Math.max(o,500)*Math.max(r,1))},className:`ripple ${a}`,style:{...n,zIndex:i}})};import{jsx as Sr,jsxs as Nr}from"react/jsx-runtime";var ko=({children:e,color:o="default",variant:t="solid",radius:r="medium",size:a="regular",noWrap:n=!1,forIcon:i=!1,className:s="",...l})=>{let c=h({button:!0,[o]:!!o,[t]:!!t,[`radius-${r}`]:!!r,[`size-${a}`]:!!a,"no-wrap":n,icon:i,[s]:!!s});return Nr("button",{...l,className:c,children:[e,Sr(J,{})]})};import{useEffect as Ir,useState as Or}from"react";import{jsx as Ro,jsxs as Lr}from"react/jsx-runtime";var Js=()=>{let{x:e,y:o,elementX:t,elementY:r,ref:a}=ho(),[n,i]=Or(!1);if(O("mouseover",l=>{let c=getComputedStyle(l.target).cursor;i(c==="pointer")}),Ir(()=>("ontouchstart"in window||navigator.maxTouchPoints||(document.body.style.cursor="none"),()=>{document.body.style.cursor="auto"}),[]),e===null||o===null||"ontouchstart"in window||navigator.maxTouchPoints)return null;let s=`translate3d(${t}px, ${r}px, 0)`;return Lr("section",{className:"cursor-overlay",ref:a,children:[Ro("span",{className:`cursor outer-circle ${n?"cursor-hover":""}`,style:{transform:s}}),Ro("span",{className:`cursor inner-circle ${n?"cursor-hover":""}`,style:{transform:s}})]})};import{useMemo as Dr}from"react";import{IoCheckmarkOutline as zr}from"react-icons/io5";import{Controller as Fr,useFormContext as Ar}from"react-hook-form";import{jsx as wo}from"react/jsx-runtime";var M=({Component:e,inputProps:o,defaultValue:t,rules:r})=>{let{control:a,setValue:n}=Ar(),{name:i,defaultValue:s}=o;return wo(Fr,{name:i,control:a,rules:r,defaultValue:s??t,render:({field:{onBlur:l,value:c},fieldState:m})=>wo(e,{value:c,error:m.error?.message,invalid:m.invalid,isTouched:m.isTouched,isDirty:m.isDirty,setValue:d=>n(i,d),onBlur:l,...o})})};import{jsx as ae,jsxs as Eo}from"react/jsx-runtime";var ee=({name:e,value:o,setValue:t,onBlur:r,onFocus:a,className:n="",style:i={},autoFocus:s=!1,readOnly:l=!1,disabled:c=!1,autoComplete:m="off",icon:d=zr,label:p,color:u="primary",size:g="regular"})=>{let y=Dr(()=>crypto.randomUUID(),[]),{handlers:f}=S({onChange:T=>t(T.target.checked),onBlur:r,onFocus:a}),b=h({"checkbox-container":!0,[n]:!!n,[`color-${u}`]:!!u}),v=h({checkbox:!0,"is-checked":o,[`size-${g}`]:!!g});return Eo("section",{className:b,style:i,onClick:T=>T.stopPropagation(),children:[Eo("section",{className:v,children:[ae("section",{className:"checkbox-fill",children:ae(d,{size:"1.3em",className:"checkbox-icon"})}),ae("input",{id:y,type:"checkbox",name:e,className:"checkbox-input",checked:o,autoFocus:s,autoComplete:m,disabled:c||l,...f})]}),p?ae(k,{variant:"label-form",htmlFor:y,className:"checkbox-label",children:p}):null]})},Hr=({rules:e,...o})=>ae(M,{Component:ee,defaultValue:!1,inputProps:o,rules:e});ee.Controller=Hr;import{useMemo as Ur}from"react";import{ImCross as Gr}from"react-icons/im";var Br=(r=>(r.FULL_BORDER="full-border",r.CONTENT_BORDER="content-border",r.CONTENT_LINE="line",r))(Br||{}),$r=(t=>(t.HORIZONTAL="horizontal",t.VERTICAL="vertical",t))($r||{});import{jsx as Z,jsxs as Oe}from"react/jsx-runtime";var Mo=({icon:e,className:o,onClick:t})=>e?Z(e,{className:o,onClick:t}):Z("span",{}),z=({id:e,label:o,leftIcon:t,rightIcon:r,errorIcon:a=Gr,error:n,onClickLeftIcon:i,onClickRightIcon:s,fieldOrientation:l="vertical",children:c,isFocus:m=!1,variant:d,ref:p})=>{let u=h({"form-field":!0,focus:m,error:!!n,"variant-content-border":d==="content-border","variant-content-line":d==="line","variant-full-border":d==="full-border","variant-inline":l==="horizontal"}),g=y=>f=>{f.stopPropagation();let b=document.getElementById(e);b?.focus(),b?.click(),y&&y()};return Oe("section",{className:u,ref:p,children:[o?Z(k,{className:"field-label",noPadding:!0,variant:"label-form",htmlFor:e,children:o}):null,Oe("section",{className:"field-content",children:[Mo({className:"field-left-icon",icon:t,onClick:g(i)}),Z("section",{className:"field-children",children:c}),Mo({className:"field-right-icon",icon:r,onClick:g(s)})]}),!!n&&Oe("section",{className:"field-message",children:[a?Z(a,{size:10}):Z("span",{}),Z(k,{noPadding:!0,variant:"small",children:n})]})]})};import{jsx as Le}from"react/jsx-runtime";var So=({name:e,value:o,setValue:t,onBlur:r,onFocus:a,type:n="date",className:i="",style:s={},autoFocus:l=!1,readOnly:c=!1,disabled:m=!1,placeholder:d="",autoComplete:p="off",isDirty:u=!1,isTouched:g=!1,invalid:y=!1,error:f,...b})=>{let v=Ur(()=>crypto.randomUUID(),[]),{isFocus:T,handlers:x}=S({onBlur:r,onChange:C=>t(C.target.value),onFocus:a});return Le(z,{id:v,error:f,isFocus:T,...b,children:Le("input",{id:v,type:n,name:e,className:i,style:s,value:o,autoFocus:l,autoComplete:p,placeholder:d,disabled:m,readOnly:c,...x})})},Vr=({rules:e,...o})=>Le(M,{Component:So,defaultValue:"",inputProps:o,rules:e});So.Controller=Vr;import{useMemo as _r}from"react";import{jsx as Fe}from"react/jsx-runtime";var No=({name:e,value:o,setValue:t,onBlur:r,onFocus:a,pattern:n,type:i="text",className:s="",style:l={},autoFocus:c=!1,readOnly:m=!1,disabled:d=!1,placeholder:p="",autoComplete:u="off",isDirty:g=!1,isTouched:y=!1,invalid:f=!1,error:b,min:v,max:T,...x})=>{let C=_r(()=>crypto.randomUUID(),[]),{handlers:R,isFocus:w}=S({onChange:L=>t(L.target.value),onBlur:r,onFocus:a});return Fe(z,{id:C,error:b,isFocus:w,...x,children:Fe("input",{id:C,type:i,name:e,className:s,style:l,value:o,pattern:n,autoFocus:c,autoComplete:u,placeholder:p,disabled:d,readOnly:m,min:v,max:T,...R})})},Yr=({rules:e,...o})=>Fe(M,{Component:No,defaultValue:"",inputProps:o,rules:e});No.Controller=Yr;import{useMemo as Io}from"react";import{FiEye as jr,FiEyeOff as Xr}from"react-icons/fi";import{IoIosWarning as Wr}from"react-icons/io";import{jsx as Ae}from"react/jsx-runtime";var Oo=({name:e,value:o,setValue:t,onBlur:r,onFocus:a,className:n="",style:i={},autoFocus:s=!1,readOnly:l=!1,disabled:c=!1,placeholder:m="",autoComplete:d="off",isDirty:p=!1,isTouched:u=!1,invalid:g=!1,error:y,...f})=>{let b=Io(()=>crypto.randomUUID(),[]),[v,T]=go(["password","text"]),{isFocus:x,handlers:C}=S({onBlur:r,onChange:w=>t(w.target.value),onFocus:a}),R=Io(()=>v==="password"?jr:v==="text"?Xr:Wr,[v]);return Ae(z,{id:b,error:y,isFocus:x,...f,rightIcon:R,onClickRightIcon:()=>T(),children:Ae("input",{id:b,type:v,name:e,className:n,style:i,value:o,autoFocus:s,autoComplete:d,placeholder:m,disabled:c,readOnly:l,...C})})},Qr=({rules:e,...o})=>Ae(M,{Component:Oo,defaultValue:"",inputProps:o,rules:e});Oo.Controller=Qr;import Cn from"color";import{useCallback as xn,useEffect as Tn,useMemo as Go,useRef as Pn,useState as Uo}from"react";import{HexAlphaColorPicker as kn,HexColorInput as Rn}from"react-colorful";import{FaEyeDropper as wn}from"react-icons/fa6";import En from"use-eye-dropper";import{createContext as nn,useCallback as Ao,useContext as an,useRef as sn,useState as Do}from"react";import{ImCross as ln}from"react-icons/im";import{useMemo as on,useRef as tn}from"react";import{createPortal as Zr}from"react-dom";var Lo=({children:e,id:o})=>{let t=oo(o);return t===null?null:Zr(e,t)};import{useMemo as qr}from"react";import{jsx as en}from"react/jsx-runtime";var Jr=(a=>(a.OPAQUE="opaque",a.TRANSPARENT="transparent",a.BLUR="blur",a.NONE="none",a))(Jr||{}),Fo=({opacity:e=.6,backdrop:o="blur",zIndex:t,backdropOnClick:r,modalState:a})=>{let n=h({"modal-backdrop":!0,"backdrop-close":a==="CLOSING"||a==="CLOSED"}),i=qr(()=>({opaque:{background:`hsl(from var(--background-paper) h s l / ${e*100}%)`},transparent:{background:"transparent"},blur:{background:`hsl(from var(--background-paper) h s l / ${e*100}%)`,backdropFilter:"blur(5px)"},none:{display:"none"}})[o]??{},[o,e]);return o==="none"?null:en("section",{tabIndex:-1,onClick:r,className:n,style:{zIndex:t,...i}})};import{jsx as De,jsxs as rn}from"react/jsx-runtime";var U=({id:e,children:o,isOpen:t,onClose:r,className:a="",style:n={},rootStyle:i={},animation:s="fade-down",closeAnimationClassName:l="modal-close",modalRef:c,closeOnClickOutside:m=!0,transitionDuration:d=300,windowOffset:p=10,offset:u=20,position:g,containerRef:y,zIndex:f=1e3,...b})=>{let v=on(()=>crypto.randomUUID(),[]),T=tn(null),{modalState:x,isVisible:C}=uo({transitionDuration:d,isOpen:t});po({modalRef:c??T,containerRef:y,offset:u,windowOffset:p,position:g,isOpen:C}),qe(c??T,()=>{t&&m&&r()});let R=h({"modal-content":!0,[a]:!!a,[`animation-${s}`]:!!s&&s!=="none",[l]:x==="CLOSING"||x==="CLOSED"});return C?rn(Lo,{id:`modal-${e}-${v}`,children:[De(Fo,{...b,modalState:x,zIndex:f}),De("section",{className:"modal",ref:c??T,style:{maxWidth:`calc(100dvw - ${p*2}px)`,maxHeight:`calc(100dvh - ${p*2}px)`,...i,zIndex:+f+1},children:De("section",{style:{...n,animationDuration:`${d}ms`},className:R,children:o})})]}):null};import{jsx as V,jsxs as pn}from"react/jsx-runtime";var zo=nn(null),cn=()=>{let e=an(zo);if(!e)throw new Error("useActionModalContext must be used within a ActionModal");return e},ie=({children:e,isOpen:o,onClose:t,actionRequired:r,icon:a,noCloseButton:n,lineOnTop:i=!1,backCard:s=!1,noPadding:l=!1,className:c="",style:m={},...d})=>{let[p,u]=Do(!1),g=sn(null),y=Ao(()=>{g.current?.classList.add("shake-animation"),setTimeout(()=>{g.current?.classList.remove("shake-animation")},500)},[]),f=h({"action-modal-content":!0,"back-card":s,"line-on-top":i,"no-padding":l});return V(zo.Provider,{value:{onClose:t,isActionInProgress:p,setIsActionInProgress:u},children:V(U,{className:"action-modal",id:"action-modal",animation:"bounce",opacity:.8,isOpen:o,onClose:t,...d,backdropOnClick:r?y:t,position:"center",children:V("section",{ref:g,className:"modal-content",children:pn("section",{className:f,children:[!n&&!r&&V("section",{className:"close-modal-button",onClick:()=>t(),children:V(ln,{})}),a?V(k,{variant:"header4",className:"action-modal-icon",children:V(a,{})}):null,V("section",{className:"action-modal-body",children:V("section",{className:`action-modal-content ${c}`,style:m,children:e})})]})})})})},dn=({onClick:e,children:o,isLoading:t,...r})=>{let{onClose:a,isActionInProgress:n,setIsActionInProgress:i}=cn(),[s,l]=Do(!1),c=Ao(()=>{l(!0),i(!0);let m=e();m instanceof Promise?m.then(()=>{a(),l(!1),i(!1)}):(a(),l(!1),i(!1))},[e,a,i]);return!s&&n?null:V(ko,{...r,onClick:c,isLoading:t||s,children:o})};ie.ActionButton=dn;import{useMemo as mn}from"react";import{ImCross as un}from"react-icons/im";import{jsx as ze,jsxs as fn}from"react/jsx-runtime";var zc=({children:e,isOpen:o,onClose:t,position:r="left",size:a,className:n="",...i})=>{let s=mn(()=>({top:{height:a,width:"100%"},left:{height:"100%",width:a},right:{height:"100%",width:a},bottom:{height:a,width:"100%"}})[r],[r,a]);return fn(U,{id:"aside",isOpen:o,onClose:t,opacity:.6,windowOffset:0,animation:"none",className:`aside-modal ${n} ${r}`,rootStyle:s,backdropOnClick:t,position:r,...i,children:[ze("span",{className:"close-modal-button",onClick:t,children:ze(un,{})}),ze("section",{className:"aside-modal-content",children:e})]})};import{jsx as se,jsxs as Ho}from"react/jsx-runtime";var jc=({title:e,onAccept:o,onReject:t=()=>null,acceptText:r,rejectText:a,children:n,isLoading:i,...s})=>se(ie,{...s,backCard:!0,children:Ho("section",{className:"confirmation-modal",children:[se(k,{variant:"header4",children:e}),se("section",{children:n}),Ho("section",{className:"confirmation-modal-actions",children:[!i&&se(ie.ActionButton,{variant:"flat",onClick:t,children:a}),se(ie.ActionButton,{isLoading:i,onClick:o,children:r})]})]})});import{useCallback as hn,useMemo as gn}from"react";import{Fragment as Bo,jsx as $,jsxs as he}from"react/jsx-runtime";var _=({children:e,isOpen:o,onClose:t,id:r,menuContentRef:a,contentClassName:n="",contentStyle:i={},className:s="",...l})=>{let c=h({"menu-modal":!0,[s]:!!s});return $(U,{className:c,...l,id:`menu-${r}`,isOpen:o,onClose:t,children:$("ul",{className:`menu-content ${n}`,role:"listbox",style:i,ref:a,children:e})})},bn=({children:e,label:o="",asCheckbox:t,icon:r,id:a,disabled:n=!1,selected:i=!1,className:s="",style:l={},onClick:c=()=>null,...m})=>{let d=h({"menu-option":!0,[s]:!0,"is-disabled":n,"is-selected":i}),p=hn(g=>{g.stopPropagation(),n||c(!i)},[n,c,i]),u=gn(()=>e||(t?$(ee,{className:"menu-checkbox",disabled:n,value:i,setValue:g=>c(g),name:"option",style:{pointerEvents:"none"},size:"small",label:he(Bo,{children:[r!==void 0&&$(r,{className:"option-icon"}),$(k,{variant:"label",children:o})]})}):he(Bo,{children:[r!==void 0&&$(r,{className:"option-icon"}),typeof o=="string"?$(k,{variant:"label",children:o}):o]})),[t,e,n,r,o,c,i]);return he("li",{...m,id:a,role:"option",tabIndex:-1,"aria-selected":i,"aria-disabled":n,onClick:p,className:d,style:l,children:[$(J,{zIndex:10}),u]})},yn=()=>$("li",{children:$(fe,{className:"divider"})}),$o=({children:e,className:o="",...t})=>$("li",{tabIndex:-1,className:"menu-label",children:$(k,{...t,variant:"small",className:`menu-group-label ${o}`,children:e})}),vn=({children:e,label:o,className:t="",style:r={},contentClassName:a="",contentStyle:n={},...i})=>{let s=h({"menu-group":!0,[t]:!!t});return he("li",{tabIndex:-1,...i,className:s,style:r,children:[o&&$($o,{children:o}),$("ul",{className:`menu-group-content ${a}`,role:"listbox",style:n,children:e})]})};_.Option=bn;_.Divider=yn;_.GroupLabel=$o;_.Group=vn;import{jsx as W,jsxs as ge}from"react/jsx-runtime";var Vo=({name:e,value:o,setValue:t,onBlur:r,onFocus:a,showValueText:n=!1,className:i="",style:s={},autoFocus:l=!1,readOnly:c=!1,disabled:m=!1,placeholder:d="",autoComplete:p="off",isDirty:u=!1,isTouched:g=!1,invalid:y=!1,error:f,...b})=>{let{open:v,isSupported:T}=En(),[x,C]=Uo(o),R=Go(()=>crypto.randomUUID(),[]),w=Pn(null),[L,F]=Uo(!1),{handlers:B,isFocus:H}=S({onChange:I=>C(I.target.value),onBlur:I=>{D(),r&&r(I)},onFocus:I=>{D(),a&&a(I)}}),P=Go(()=>{let I=Cn(o===""?"#000000":o);return I.isLight()||I.alpha()<.5?"#000000":"#FFFFFF"},[o]),E=async()=>{let{sRGBHex:I}=await v();t(I)};Tn(()=>{C(o)},[o]);let D=xn(()=>{x.match(/^#(?:(?:[\da-f]{3}){1,2}|(?:[\da-f]{4}){1,2})$/i)?t(x):C(o)},[x,t,o]),j=h({"input-color-box":!0,[i]:!!i});return ge(z,{id:R,error:f,isFocus:H,...b,children:[ge("section",{className:"input-color",onClick:I=>{I.stopPropagation(),F(!0)},ref:w,children:[W("section",{className:j,style:{borderColor:P,background:o,color:o,...s}}),n?W("input",{id:R,name:e,value:x,placeholder:d,readOnly:c,autoFocus:l,disabled:m,autoComplete:p,className:"color-input",...B}):null]}),ge(U,{id:"input-color",isOpen:L,onClose:()=>F(!1),position:"bottom right",offset:5,backdrop:"transparent",containerRef:w,className:"input-color-selector",children:[W(kn,{id:R,color:o,onChange:t}),ge("section",{className:"color-input-container",children:[T()?W(wn,{onClick:()=>{E()}}):W("span",{}),W(Rn,{className:"color-input",id:R,name:e,color:o,placeholder:"Type a color",prefixed:!0,alpha:!0,onChange:t}),W("span",{})]})]})]})},Mn=({rules:e,...o})=>W(M,{Component:Vo,defaultValue:"#147EFB",inputProps:o,rules:e});Vo.Controller=Mn;import{useCallback as Nn,useEffect as In,useMemo as _o,useState as On}from"react";import{FaMagnifyingGlass as Ln,FaRegTrashCan as Yo}from"react-icons/fa6";import{IoIosWarning as Fn}from"react-icons/io";import{PiFilePdfFill as An,PiFilePngFill as Dn}from"react-icons/pi";import{createElement as Sn}from"react";var le=({tag:e="section",children:o,className:t,style:r,flow:a,columnSize:n,rowSize:i,column:s,row:l,pc:c,pi:m,ps:d,jc:p,ji:u,js:g,ac:y,ai:f,as:b,gtc:v,gtr:T,gta:x,gt:C,gap:R,...w})=>Sn(e,{className:t,...w,style:{...r,...a?{gridAutoFlow:a}:{},...n?{gridAutoColumns:n}:{},...i?{gridAutoRows:i}:{},...s?{gridColumn:s}:{},...l?{gridRow:l}:{},...c?{placeContent:c}:{},...m?{placeItems:m}:{},...d?{placeSelf:d}:{},...p?{justifyContent:p}:{},...u?{justifyItems:u}:{},...g?{justifySelf:g}:{},...y?{alignContent:y}:{},...f?{alignItems:f}:{},...b?{alignSelf:b}:{},...v?{gridTemplateColumns:v}:{},...T?{gridTemplateRows:T}:{},...x?{gridTemplateAreas:x}:{},...C?{gridTemplate:C}:{},...R?{gap:R}:{},display:"grid"}},o);import{Fragment as Hn,jsx as A,jsxs as Y}from"react/jsx-runtime";var jo=({name:e,value:o={},setValue:t,onBlur:r,onFocus:a,className:n="",style:i={},autoFocus:s=!1,readOnly:l=!1,disabled:c=!1,placeholder:m="Click to upload or drag and drop",autoComplete:d="off",accept:p,multiple:u=!1,limitSize:g=5e6,errorTimeout:y=3e3,label:f})=>{let[b,v]=On(null),T=_o(()=>crypto.randomUUID(),[]),{handlers:x}=S({onBlur:r,onFocus:a,onChange:P=>{let{files:E}=P.target;E&&C(E)}});In(()=>{let P=null;return b!==null&&(P=setTimeout(()=>{v(null)},y)),()=>{P!==null&&clearTimeout(P)}},[b,y]);let C=P=>{let E=u?{...o}:{},D=u?P.length:1;for(let j=0;j<D;j++){let I=P.item(j);I&&(I.size<g?E[I.name]=I:v(`File '${I.name}' size is larger than ${te(g)}`))}t(E)},R=P=>{P.preventDefault(),P.stopPropagation(),P.dataTransfer.files&&P.dataTransfer.files.length&&C(P.dataTransfer.files)},w=Nn(P=>({"image/png":Dn,"application/pdf":An})[P]??Fn,[]),L=P=>{let E={...o};delete E[P.name],t(E)},F=()=>{t({})},B=_o(()=>Object.values(o).reduce((P,{size:E})=>P+E,0),[o]),H=(P,E)=>{let D=w(P.type);return Y("section",{className:"input-file-card",children:[A("section",{className:"file-card--image",children:A(D,{})}),Y(le,{children:[A(k,{variant:"label",noPadding:!0,nowrap:!0,children:P.name}),A(k,{noPadding:!0,variant:"small",children:te(P.size)})]}),A("section",{className:"file-card--delete",onClick:()=>L(P),children:A(Yo,{})})]},E)};return Y("section",{className:"input-file-container",children:[!!f&&A(k,{variant:"label-form",htmlFor:T,noPadding:!0,children:f}),Y("section",{className:"input-file--box",onDrop:R,children:[A("section",{className:"input-file--box--icon",children:A(Ln,{})}),Y(le,{children:[A(k,{variant:"label-form",htmlFor:T,noPadding:!0,weight:"bold",children:m}),Y(k,{variant:"small",noPadding:!0,children:["Max size (",te(g),")"]})]}),A("input",{id:T,type:"file",name:e,value:"",placeholder:m,readOnly:l,autoFocus:s,disabled:c,autoComplete:d,className:n,style:i,accept:p,multiple:u,title:"",...x})]}),b!==null&&A(k,{variant:"small",noPadding:!0,className:"error",children:b}),Object.keys(o).length>0&&Y(Hn,{children:[u&&Y("span",{className:"total-info",children:[Y(k,{variant:"small",noPadding:!0,children:[Object.keys(o).length," files - ",te(B)]}),A("span",{className:"total-info--delete",onClick:F,children:A(Yo,{})})]}),A("section",{className:"input-file--files",children:A("section",{className:"input-file--files--content",children:Object.values(o).map(H)})})]})]})},zn=({rules:e,...o})=>A(M,{Component:jo,defaultValue:{},inputProps:o,rules:e});jo.Controller=zn;import{useEffect as Bn,useMemo as Xo,useState as $n}from"react";import{jsx as He}from"react/jsx-runtime";var Wo={comma:/(?!^-)[^0-9,]/g,dot:/(?!^-)[^0-9.]/g},Qo=(e,o=".")=>{let t=o==="."?Wo.dot:Wo.comma,r=e.replace(t,"").replace(",",".");return r||""},be=(e,o)=>!e||Number.isNaN(e)?o(0):o(e),Zo=({name:e,value:o,setValue:t,onBlur:r,onFocus:a,pattern:n,className:i="",style:s={},autoFocus:l=!1,readOnly:c=!1,disabled:m=!1,placeholder:d="",autoComplete:p="off",isDirty:u=!1,isTouched:g=!1,invalid:y=!1,error:f,min:b,max:v,decimalSeparator:T,format:x={locales:"en-US",style:"decimal",minimumFractionDigits:0,maximumFractionDigits:2},...C})=>{let R=Xo(()=>crypto.randomUUID(),[]),w=Xo(()=>{if(typeof x=="function")return x;let{locales:P,...E}=x;return Intl.NumberFormat(P,E).format},[x]),[L,F]=$n(be(o,w)),{handlers:B,isFocus:H}=S({onChange:P=>{let E=Qo(P.target.value,T);E.endsWith(".")?F(P.target.value):(F(be(Number(E),w)),t(Number(E)))},onBlur:P=>{let E=Qo(P.target.value,T);F(be(Number(E),w)),t(Number(E)),r&&r(P)},onFocus:a});return Bn(()=>{let P=be(o,w);L!==P&&F(P)},[w,L,o]),He(z,{id:R,error:f,isFocus:H,...C,children:He("input",{id:R,type:"text",name:e,className:i,style:s,value:L,pattern:n,autoFocus:l,autoComplete:p,placeholder:d,disabled:m,readOnly:c,min:b,max:v,...B})})},Gn=({rules:e,...o})=>He(M,{Component:Zo,defaultValue:0,inputProps:o,rules:e});Zo.Controller=Gn;import{useMemo as Un}from"react";import{jsx as ye,jsxs as Ko}from"react/jsx-runtime";var qo=({name:e,value:o,setValue:t,onBlur:r,onFocus:a,className:n="",style:i={},autoFocus:s=!1,readOnly:l=!1,disabled:c=!1,autoComplete:m="off",radioValue:d,label:p,color:u="primary",size:g="regular"})=>{let y=Un(()=>crypto.randomUUID(),[]),{handlers:f}=S({onChange:T=>t(T.target.value),onBlur:r,onFocus:a}),b=h({"radio-container":!0,[n]:!!n,[`color-${u}`]:!!u}),v=h({radio:!0,"is-checked":d===o,[`size-${g}`]:!!g});return Ko("section",{className:b,style:i,children:[Ko("section",{className:v,children:[ye("section",{className:"radio-fill"}),ye("input",{id:y,type:"radio",name:e,className:`radio-input ${n}`,style:i,value:d,checked:d===o,autoFocus:s,autoComplete:m,disabled:c||l,...f})]}),p?ye(k,{variant:"label-form",htmlFor:y,className:"radio-label",children:p}):null]})},Vn=({rules:e,...o})=>ye(M,{Component:qo,defaultValue:"",inputProps:o,rules:e});qo.Controller=Vn;import{createContext as Wn,useCallback as it,useContext as Qn,useMemo as Ce,useRef as st,useState as Zn}from"react";import{ImCross as Kn}from"react-icons/im";import{PiCaretDown as qn}from"react-icons/pi";import{useEffect as _n}from"react";import{Fragment as Yn,jsx as Be,jsxs as Jo}from"react/jsx-runtime";var et=({isLoading:e=!1,hasNextPage:o=!1,loadMore:t,customLoadMoreElement:r,emptyMessage:a,children:n})=>{let{ref:i,inView:s}=io(),l=Je(e,100);_n(()=>{o&&s&&!l&&t()},[o,l,t,s]);let c=Array.isArray(n)?n.length>0:!!n;return Jo(Yn,{children:[n,Jo("section",{className:"infinity-scroll",children:[!!a&&!c&&!l&&Be("p",{className:"empty-message",children:a}),(o||l)&&(r?r(i):Be("section",{ref:i,className:"loading",children:l&&Be("span",{className:"loading--icon",children:":D"})}))]})]})};import{useCallback as $e,useMemo as ot}from"react";import{jsx as tt}from"react/jsx-runtime";var rt=({children:e,value:o})=>{let{multiselect:t,isEqualComparator:r,maxOptions:a,selectedValue:n,setValue:i,setIsOpen:s}=nt(),l=$e((u,g)=>["number","string"].includes(typeof u)?u===g:!!r&&r(u,g),[r]),c=$e(u=>{if(u)if(t){if(a&&Array.isArray(n)&&n.length>=a)return;i([...n,o])}else i(o),s(!1);else t?i(n.filter(g=>!l(g,o))):(i(null),s(!1))},[t,a,n,i,o,s,l]),m=ot(()=>n===""||n===null?!1:Array.isArray(n)?["number","string"].includes(typeof o)?n.includes(o):n.some(u=>!!r&&r(o,u)):l(o,n),[l,r,n,o]),d=$e(u=>{["Enter"," "].includes(u.key)&&(u.preventDefault(),c(!(m&&t)))},[c,m,t]),p=ot(()=>typeof e=="string"?tt(k,{"data-value":o,variant:"label",nowrap:!0,children:e}):e,[e,o]);return tt(_.Option,{label:p,onKeyDown:d,asCheckbox:t,selected:m,onClick:u=>c(t?u:!0)})};import{useCallback as Ue,useEffect as Ve,useRef as Ge,useState as _e}from"react";import{jsx as ve,jsxs as Xn}from"react/jsx-runtime";var jn=({height:e,minHeight:o,containerRef:t,offset:r,windowOffset:a})=>{let[n,i]=_e(void 0),s=Ue(()=>{let l=t.current?.getBoundingClientRect().bottom??0,c=window.innerHeight-l-a-r-5,m=window.innerHeight-a*3,d=c<o?m:c,p=Math.min(d,e),u=Math.max(p,o);i(`${Math.round(u)}px`)},[t,a,r,o,e]);return Ve(()=>{s()},[s]),Q(t,s),O("resize",s),{h:n}},at=({children:e,searchQueryValue:o,searchQueryPlaceholder:t="Search option",searchQueryClassName:r="",searchQueryStyle:a={},onSearchQuery:n,containerRef:i,height:s=300})=>{let l=Ge(null),c=Ge(null),[m,d]=_e(""),p=Ge(null),u=ue("(max-width: 480px)");O("keydown",x=>{if(["ArrowDown","ArrowUp"].includes(x.code)){x.preventDefault();let C=document.activeElement;if(C?.tagName==="LI")switch(x.code){case"ArrowDown":C?.nextSibling?.focus();break;case"ArrowUp":C?.previousElementSibling?.focus();break}}});let g=Ue(x=>{let{value:C}=x.target;n&&n(C),d(C)},[n]);Ve(()=>{p.current&&p.current.focus()},[]);let{h:y}=jn({height:s,minHeight:150,containerRef:i,offset:5,windowOffset:10}),[f,b]=_e(!1),v=Ue(()=>{let x=Math.round(l.current?.getBoundingClientRect().height??0)+2,C=Math.round(c.current?.scrollHeight??0);b(x>=C)},[]);Ve(v,[v]),Q(l,v),Q(c,v),O("resize",v);let T=h({"select-options-header":!0,[r]:!!r});return Xn("section",{className:`select-options ${n?"with-search-query":""}`,style:u?{maxHeight:window.innerHeight-100,width:window.innerWidth-100}:{height:f?"auto":y,maxHeight:s,width:i.current?.offsetWidth??"auto"},children:[n&&ve("section",{className:T,style:a,children:ve("input",{name:"query",className:"input-search",value:o??m,onChange:g,placeholder:t,onClick:x=>x.stopPropagation(),ref:p,autoFocus:!0})}),ve("section",{className:"select-options-list-container",ref:l,children:ve("ul",{className:"select-options-list",ref:c,children:e})})]})};import{jsx as N,jsxs as lt}from"react/jsx-runtime";var ct=Wn(null),nt=()=>{let e=Qn(ct);if(!e)throw new Error("useSelectContext must be used within a Select component");return e},Jn=({children:e})=>{let o=Ce(()=>typeof e=="string"?N(k,{noPadding:!0,variant:"label",nowrap:!0,children:e}):e,[e]);return N(_.GroupLabel,{children:o})},ea=({value:e})=>N(k,{variant:"label",nowrap:!0,children:typeof e=="string"||typeof e=="number"?e:JSON.stringify(e)}),oa=({value:e,multiselect:o})=>o?N(k,{noPadding:!0,nowrap:!0,variant:"label",children:`${e.length} item${e.length===1?"":"s"} selected`}):e===null?null:N(k,{noPadding:!0,variant:"label",nowrap:!0,children:typeof e=="string"||typeof e=="number"?e:JSON.stringify(e)}),K=({options:e,isEqualComparator:o,searchQueryValue:t,searchQueryPlaceholder:r,onSearchQuery:a,loadMore:n=()=>null,isLoading:i=!1,hasNextPage:s=!1,emptyMessage:l="No options to select",multiselect:c,optionComponent:m=ea,valueComponent:d=oa,maxOptions:p,children:u,name:g,value:y,setValue:f,onBlur:b,onFocus:v,className:T="",style:x={},showClearOption:C=!1,height:R,searchQueryStyle:w,searchQueryClassName:L,autoFocus:F=!1,readOnly:B=!1,disabled:H=!1,placeholder:P="",autoComplete:E="off",isDirty:D=!1,isTouched:j=!1,invalid:I=!1,error:Te,...It})=>{let Ot=st(null),pe=ue("(max-width: 480px)"),Ze=Ce(()=>crypto.randomUUID(),[]),Pe=st(null),[me,Ke]=Zn(!1),ke=it(X=>{Ke(X&&!H)},[H]),Lt=it(X=>{X.stopPropagation(),f(c?[]:null)},[c,f]),Re=Ce(()=>c?y.length>0:!!y,[c,y]),Ft=Ce(()=>u||e.map((X,At)=>N(K.Option,{value:X,children:N(m,{value:X})},At)),[m,u,e]);return N(ct.Provider,{value:{selectedValue:y,setValue:f,multiselect:c??!1,isEqualComparator:o,maxOptions:p??null,setIsOpen:Ke},children:N(z,{id:Ze,error:Te,isFocus:me,ref:Pe,...It,children:lt("section",{id:g,style:x,onBlur:b,className:`select ${H?"disabled":""} ${T}`,children:[lt("section",{id:Ze,className:`select-container ${Re&&C?"three-columns":""}`,onClick:()=>ke(!0),children:[N("button",{type:"button",className:`input-button ${(Array.isArray(y)?y.length>0:y)?"":"placeholder"}`,"aria-haspopup":"listbox","aria-expanded":me,onFocus:X=>{ke(!0),v&&v(X)},children:Re?N(d,{...c?{value:y,multiselect:c}:{value:y}}):N(k,{variant:"label",noPadding:!0,nowrap:!0,children:P})}),Re&&C&&N("section",{className:"icon-close",onClick:Lt,children:N(Kn,{})}),N(qn,{className:`select-caret-icon ${me&&"is-select-open"}`})]}),N(_,{id:"form-select",isOpen:me,onClose:()=>ke(!1),backdrop:pe?"blur":"transparent",opacity:pe?.8:.4,position:pe?"center":"bottom",offset:5,modalRef:Ot,windowOffset:10,transitionDuration:200,containerRef:pe?void 0:Pe,contentClassName:"select-menu-content",className:"select-options-menu",children:N(at,{containerRef:Pe,onSearchQuery:a,searchQueryValue:t,searchQueryPlaceholder:r,searchQueryClassName:L,searchQueryStyle:w,height:R,children:N(et,{isLoading:i,hasNextPage:s,loadMore:n,emptyMessage:l,children:Ft})})})]})})})},ta=({rules:e,...o})=>N(M,{Component:K,defaultValue:[],inputProps:{...o,multiselect:!0},rules:e}),ra=({rules:e,...o})=>N(M,{Component:K,defaultValue:null,inputProps:{...o,multiselect:!1},rules:e}),na=e=>{let{multiselect:o}=e;return o?N(ta,{...e,multiselect:!0}):N(ra,{...e,multiselect:!1})};K.Controller=na;K.Option=rt;K.OptionLabel=Jn;import{useMemo as aa}from"react";import{jsx as xe,jsxs as sa}from"react/jsx-runtime";var dt=({name:e,value:o,setValue:t,onBlur:r,onFocus:a,min:n,max:i,step:s,onlySlider:l=!1,className:c="",style:m={},autoFocus:d=!1,readOnly:p=!1,disabled:u=!1,placeholder:g="",autoComplete:y="off",isDirty:f=!1,isTouched:b=!1,invalid:v=!1,error:T,...x})=>{let C=aa(()=>crypto.randomUUID(),[]),R=B=>{r&&r(B);let H=parseInt(`${o}`);n!==void 0&&H<n&&t(n),i!==void 0&&H>i&&t(i),t(H)},{isFocus:w,handlers:L}=S({onBlur:R,onChange:B=>t(+B.target.value),onFocus:a}),F=h({"input-slider":!0,"is-focus":w});return xe(z,{id:C,error:T,isFocus:w,...x,children:sa("section",{className:F,children:[xe("input",{id:C,type:"range",name:e,className:`slider ${c}`,style:m,value:o,autoFocus:d,autoComplete:y,placeholder:g,disabled:u,readOnly:p,min:n,max:i,step:s,...L}),!l&&xe("input",{id:C,type:"number",name:e,className:`slider-number ${c}`,style:m,value:o,autoComplete:y,disabled:u,readOnly:p,min:n,max:i,step:s,...L})]})})},ia=({rules:e,...o})=>xe(M,{Component:dt,defaultValue:0,inputProps:o,rules:e});dt.Controller=ia;import{useMemo as la}from"react";import{jsx as Ye}from"react/jsx-runtime";var pt=({name:e,value:o,setValue:t,onBlur:r,onFocus:a,rows:n=4,resize:i="vertical",className:s="",style:l={},autoFocus:c=!1,readOnly:m=!1,disabled:d=!1,placeholder:p="",autoComplete:u="off",isDirty:g=!1,isTouched:y=!1,invalid:f=!1,error:b,...v})=>{let T=la(()=>crypto.randomUUID(),[]),{handlers:x,isFocus:C}=S({onBlur:r,onChange:w=>t(w.target.value),onFocus:a}),R=h({textarea:!0,[s]:!!s});return Ye(z,{id:T,error:b,isFocus:C,...v,children:Ye("textarea",{id:T,name:e,className:R,style:{resize:i,...l},value:o,rows:n,...x,autoFocus:c,autoComplete:u,placeholder:p,disabled:d,readOnly:m})})},ca=({rules:e,...o})=>Ye(M,{Component:pt,defaultValue:"",inputProps:o,rules:e});pt.Controller=ca;import{useMemo as fa}from"react";import{useState as ua}from"react";import{cloneElement as da}from"react";import{Fragment as pa,jsx as mt,jsxs as ma}from"react/jsx-runtime";var ce=({position:e="top",children:o,content:t,offset:r=5,disabled:a=!1})=>{let{containerRef:n,openModal:i,closeModal:s,isOpen:l}=so(),c=h({tooltip:!0,[e]:!0});return O("mouseenter",()=>i(),n),O("mouseleave",()=>s(),n),a?o:ma(pa,{children:[da(o,{ref:n}),mt(U,{backdrop:"none",id:"tooltip",isOpen:l,containerRef:n,onClose:s,position:e,className:c,closeOnClickOutside:!1,offset:6+ +r,windowOffset:10,transitionDuration:100,closeAnimationClassName:"close-animation",children:mt("span",{className:"tooltip-content",children:t})})]})};import{jsx as ut}from"react/jsx-runtime";var Em=({children:e,value:o,position:t,offset:r,tooltipText:a,tooltipCopiedText:n,copiedTextTimeout:i=500})=>{let[s,l]=ua(!1);return ut(ce,{content:s&&n?n:a,position:t,offset:r,children:ut("span",{onClick:()=>{l(!0),navigator.clipboard.writeText(o),setTimeout(()=>l(!1),i)},children:e})})};import{jsx as G,jsxs as gt}from"react/jsx-runtime";var ft={small:1,regular:1.2,large:1.4},ht={small:2,regular:2.5,large:3},bt=({name:e,value:o,setValue:t,onBlur:r,onFocus:a,className:n="",style:i={},autoFocus:s=!1,readOnly:l=!1,disabled:c=!1,placeholder:m="",autoComplete:d="off",label:p,leftLabel:u,rightLabel:g,width:y="regular",size:f="regular",dotHoverSize:b=1.3,padding:v=.25,leftIcon:T,rightIcon:x,internalLeftIcon:C,internalRightIcon:R,leftIconTooltip:w,rightIconTooltip:L,color:F})=>{let B=fa(()=>crypto.randomUUID(),[]),{handlers:H}=S({onChange:Te=>t(Te.target.checked),onBlur:r,onFocus:a}),P=h({"switch-container":!0,[n]:!!n,[`color-${F}`]:!!F}),E=h({switch:!0,"is-checked":o,"is-readonly":!c&&l}),D=ft[f]??ft.regular,j=(ht[y]??ht.regular)*D,I=Math.min(v,D);return gt("section",{className:P,style:{...i,"--width":`${j}em`,"--dot-size":`${D}em`,"--dot-hover-size":`${D*Math.min(Math.max(b,1),2)}em`,"--padding":`${I}em`},children:[u?G(k,{variant:"label-form",className:"switch-label",htmlFor:B,children:u}):null,T!==void 0&&G(ce,{content:w,disabled:!w,offset:10,children:G(T,{size:`${D*.7}em`,className:"switch-icon",onClick:()=>t(!o)})}),gt("section",{className:E,children:[C!==void 0&&G("span",{className:"switch-internal-left-icon",children:G(C,{size:`${D*.7}em`})}),R!==void 0&&G("span",{className:"switch-internal-right-icon",children:G(R,{size:`${D*.7}em`})}),G("span",{className:"switch-dot"}),G("input",{id:B,type:"checkbox",name:e,className:`switch-checkbox ${n}`,style:i,checked:o,autoFocus:s,autoComplete:d,placeholder:m,disabled:c||l,...H})]}),x!==void 0&&G(ce,{content:L,disabled:!L,offset:10,children:G(x,{size:`${D*.7}em`,className:"switch-icon",onClick:()=>t(!o)})}),p||g?G(k,{variant:"label-form",className:"switch-label",htmlFor:B,children:p||g}):null]})},ha=({rules:e,...o})=>G(M,{Component:bt,defaultValue:!1,inputProps:o,rules:e});bt.Controller=ha;import{jsx as ga}from"react/jsx-runtime";var $m=({alt:e="",loading:o="eager",...t})=>ga("img",{loading:o,alt:e,...t,width:"100%"});import{useMemo as kt,useState as ka}from"react";import{useMemo as ba}from"react";import{MdArrowDownward as ya,MdArrowUpward as va}from"react-icons/md";import{jsx as oe,jsxs as yt}from"react/jsx-runtime";var vt=({header:e,sortBy:o,icon:t,width:r,field:a,toggleSortField:n,sortField:i,orderField:s,hidden:l})=>{let c=o!==void 0?o:a,m=h({"sort-on-click":!!c}),d=c?()=>n(c):void 0,p=ba(()=>c?oe("span",{className:"sort-icon",children:!!i&&i===c&&(s==="asc"?oe(va,{}):oe(ya,{}))}):null,[c,i,s]);return l?null:yt("th",{style:{width:r},className:m,onClick:d,children:[yt(le,{flow:"column",gap:"0.5em",jc:"space-between",ai:"center",children:[t?oe(t,{}):null,oe(k,{variant:"label",noPadding:!0,children:e}),p]}),oe(J,{color:"var(--primary-700)"})]})};import{jsx as je}from"react/jsx-runtime";var Ca=(e,{field:o,render:t,Component:r},a)=>{if(o&&e[o])return je(k,{noPadding:!0,nowrap:!0,children:e[o]});if(t)return t(e,a);if(r)return je(r,{data:e,rowKey:a})},Ct=(e,o,t)=>o.map((r,a)=>r.hidden?null:je("td",{children:Ca(e,r,t)},a)),xt=(e,o,t)=>o?e.toSorted((r,a)=>{let n=r[o],i=a[o];return["number","boolean","string"].includes(typeof n)&&["number","boolean","string"].includes(typeof i)?n===i?0:t==="asc"?n>i?1:-1:n>i?-1:1:0}):e;import{useCallback as xa,useState as Ta}from"react";var Tt=()=>{let[[e,o],t]=Ta([null,null]),r=xa(a=>{t(([n,i])=>a!==n?[a,"asc"]:i==="asc"?[a,"desc"]:[null,null])},[]);return{sortBy:e,order:o,toggleSortField:r}};import{jsx as Pa}from"react/jsx-runtime";var Pt=({data:e,columns:o,isSelected:t=!1,selectable:r=!1,rowKey:a})=>{let n=h({"row-selected":r&&t});return Pa("tr",{className:n,children:Ct(e,o,a)})};import{jsx as q,jsxs as Ra}from"react/jsx-runtime";var gu=({columns:e,data:o,width:t,selectable:r=!1,rowId:a,className:n="",tableClassName:i=""})=>{let[s,l]=ka({}),c=h({"smart-table":!0,[i]:!!i,"layout-fixed":t==="content","layout-scrollable":t==="scroll"}),m=h({"smart-table-container":!0,[n]:!!n}),{sortBy:d,order:p,toggleSortField:u}=Tt(),g=kt(()=>{let f=[...e];return r&&(f=[{header:`${Object.values(s).length}`,render:(b,v)=>q(ee,{name:`selected-${v}`,value:`${v}`in s,setValue:T=>{l(x=>{let C={...x};return T?C[`${v}`]=b:delete C[`${v}`],C})}})},...f]),f},[e,r,s]),y=kt(()=>xt(o,d,p),[o,d,p]);return q("section",{className:m,children:Ra("table",{className:c,children:[q("thead",{children:q("tr",{children:g.map((f,b)=>q(vt,{toggleSortField:u,sortField:d,orderField:p,...f},b))})}),q("tbody",{children:y.map(f=>q(Pt,{rowKey:f[a],data:f,columns:g,isSelected:`${f[a]}`in s,selectable:r},f[a]))})]})})};import{createContext as Ma,useContext as St,useEffect as Sa,useState as Na}from"react";import{useEffect as wa,useRef as Rt,useState as wt}from"react";import{jsx as Et,jsxs as Ea}from"react/jsx-runtime";var Xe={top:0,left:0,width:0,height:0};var Mt=({tabs:e=[],variant:o="solid",radius:t="full",direction:r="horizontal",color:a,children:n,openTab:i,size:s="medium",className:l="",style:c={}})=>{let m=Rt(null),d=Rt(null),[p,u]=wt(!1),[g,y]=wt(Xe),f=h({"tab-list":!0,[`variant-${o}`]:!!o,[`size-${s}`]:!!s,[`radius-${t}`]:!!t,[`color-${a}`]:!!a,"vertical-direction":r==="vertical",[l]:!!l});return wa(()=>{let b=d.current?.getBoundingClientRect()??Xe,v=m.current?.getBoundingClientRect()??Xe,T=b.width,x=o==="line"?2:b.height,C=b.left-v.left,R=o==="line"?b.top+b.height-v.top:b.top-v.top;y({left:C,top:R,width:T,height:x}),p||setTimeout(()=>{u(!0)},100)},[p,o,i]),Ea("section",{className:f,ref:m,style:c,children:[!!o&&Et("span",{className:`tabs-selector ${p?"active":""}`,style:g}),e.map(({id:b,label:v})=>Et(de.Tab,{id:b,ref:b===i?d:void 0,children:v},b)),n]})};import{jsx as Qe}from"react/jsx-runtime";var We=Ma(null),Nt=e=>{let o=St(We);if(!o)throw new Error("You cant use this component out off an Tabs component");let{openTab:t,changeOpenTab:r}=o;return[t===e,()=>r(e)]},Ia=()=>{let e=St(We);if(!e)throw new Error("You cant use this component out off an Tabs component");return e},de=({children:e,defaultOpenTab:o,onChange:t})=>{let[r,a]=Na(o);return Sa(()=>{t&&t(r)},[r,t]),Qe(We.Provider,{value:{openTab:r,changeOpenTab:n=>a(n)},children:e})},Oa=({id:e,children:o,className:t="",style:r={},onClick:a,ref:n})=>{let[i,s]=Nt(e),l=h({tab:!0,[t]:!!t,"is-open":i});return Qe("span",{className:l,style:r,onClick:m=>{s(),a&&a(m)},ref:n,children:o})},La=({id:e,children:o})=>{let[t]=Nt(e);return t?o:null},Fa=({children:e,...o})=>{let{openTab:t}=Ia();return Qe(Mt,{...o,openTab:t,children:e})};de.Tab=Oa;de.TabPanel=La;de.TabList=Fa;import{jsx as Da}from"react/jsx-runtime";var Aa=(n=>(n.NONE="none",n.SMALL="small",n.MEDIUM="medium",n.LARGE="large",n.FULL="full",n))(Aa||{}),Bu=({children:e,rounded:o="medium",selected:t=!1,noWrap:r=!1,ref:a})=>{let n=h({tag:!0,[`rounded-${o}`]:!!o,"is-selected":t,"no-wrap":r});return Da("span",{className:n,ref:a,children:e})};export{Ui as Accordion,Is as AccordionItem,ie as ActionModal,zc as AsideModal,Fo as Backdrop,ko as Button,ee as Checkbox,Em as ClickToCopy,jc as ConfirmationModal,Js as Cursor,So as DatePicker,z as Field,$r as FieldOrientation,Br as FieldVariant,Ji as FlipCard,cs as HoverCard,$m as Image,et as InfinityScroll,No as Input,Vo as InputColor,jo as InputFile,Zo as InputNumber,Oo as InputPassword,fe as Line,mr as LineOrientation,ur as LineStyle,_ as Menu,U as Modal,Jr as ModalBackdrop,Lo as Portal,qo as Radio,J as Ripple,K as Select,vo as SlideCard,dt as Slider,gu as SmartTable,bt as Switch,de as Tabs,Bu as Tag,Aa as TagRounded,pt as Textarea,ce as Tooltip,k as Typography,yo as useAccordionItem};
|
|
31
3
|
//# sourceMappingURL=components.js.map
|