visits-style 2.0.4 → 2.0.6

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.cjs.js CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("clsx"),t=require("react/jsx-runtime"),r=require("react"),f=require("@floating-ui/react"),ne=require("react-dom");function k(e,n){return n?e+" "+n:e}function H({className:e,...n}){const o=r.useMemo(()=>m("leading-none peer-disabled:opacity-70",e),[e]);return t.jsx("label",{className:o,...n})}function re({label:e,children:n,required:o,htmlFor:s,error:l,help:i,helpBefore:a,className:d,innerClass:u,...x}){const p=r.useMemo(()=>m("font-medium",o?'after:content-["*"] after:text-danger after:text-sm after:pl-0.5':""),[o]),g=r.useMemo(()=>k("flex flex-col space-y-2",d),[d]);return t.jsxs("div",{className:g,...x,children:[e?t.jsx(H,{className:p,htmlFor:s,children:e}):null,i&&a?t.jsx("p",{className:"text-xs text-muted pb-2",children:i}):null,t.jsx("div",{className:u,children:oe(n,!!l)}),i&&!a&&!l?t.jsx("p",{className:"text-xs text-muted",children:i}):null,l?t.jsx("p",{className:"text-xs text-danger",children:l}):null]})}function oe(e,n){const o=r.Children.count(e);if(!o)return null;if(o===1)return r.cloneElement(e,{error:n});const s=r.Children.toArray(e);return s[0]=r.cloneElement(s[0],{error:n}),s}function se({error:e,unstyled:n,className:o,...s}){const l=r.useMemo(()=>n?o:k(m("flex rounded-md border bg-background px-3 py-2 w-full [&_input]:placeholder:text-muted","[&_input]:disabled:opacity-50 [&_input]:focus-visible:outline-none",e?"border-danger hover:border-danger-fore":"border-input"),o),[o,e,n]);return t.jsx("div",{className:l,...s})}const W=r.forwardRef(({className:e,type:n,error:o,unstyled:s,...l},i)=>{const a=r.useMemo(()=>s?e:k(m("flex rounded-md border bg-background px-3 py-2 w-full placeholder:text-muted","disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-ring",o?"border-danger hover:border-danger-fore":"border-input not-disabled:hover:border-input-fore",n==="file"?"file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground":null),e),[e,n,o,s]);return t.jsx("input",{ref:i,type:n,className:a,...l})});W.displayName="Input";const X=r.forwardRef(({className:e,error:n,unstyled:o,...s},l)=>{const i=r.useMemo(()=>o?e:k(m("flex rounded-md border bg-background px-3 py-2 w-full","disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-ring",n?"border-danger hover:border-danger-fore":"border-input not-disabled:hover:border-input-fore"),e),[e,n,o]);return t.jsx("textarea",{ref:l,className:i,...s})});X.displayName="Textarea";function D(e){return t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 30 30",...e,children:t.jsx("path",{d:"M11.5 18.5l-3.9-4L6 16l5.6 5.6 11.6-11.5-1.7-1.6z",fill:"currentColor"})})}function ie(){return t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 30 30",children:t.jsx("rect",{width:"20",height:"3",y:"13.5",x:"4.5",fill:"currentColor",stroke:"none",rx:"2"})})}function le({checked:e,indeterminate:n,className:o,id:s,name:l,onChange:i,value:a,...d}){const u=r.useMemo(()=>k(m("inline-flex justify-center items-center border w-4.5 h-4.5 rounded","cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",e||n?"bg-primary text-inverted disabled:text-text disabled:bg-input disabled:border-input":"border-input not-disabled:hover:border-input-fore"),o),[e,n,o]),x=()=>{d.disabled||i?.(!e)};return t.jsxs("button",{type:"button",role:"checkbox",id:s||l,className:u,onClick:x,"aria-checked":e,...d,children:[e?t.jsx(D,{}):null,n&&!e?t.jsx(ie,{}):null,t.jsx("input",{type:"checkbox","aria-hidden":"true",name:l,checked:e,value:a,onChange:x,disabled:d.disabled,style:{position:"absolute",pointerEvents:"none",top:0,left:0,width:1,height:1,opacity:0}})]})}const ae=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",_=ae?r.useLayoutEffect:r.useEffect;function z({children:e,container:n,disabled:o}){const[s,l]=r.useState(null);return _(()=>{if(!n){let i=document.getElementById("visits-style-portals");return i||(i=document.createElement("div"),i.id="visits-style-portals",document.body.appendChild(i)),l(i)}l(n)},[n]),o||!s?null:ne.createPortal(e,s)}function P(e){e&&(e.stopPropagation(),e.preventDefault())}const ce={open:150,close:75},O=r.forwardRef(({position:e,label:n,children:o,color:s="background",disabled:l,offset:i={x:0,y:6},onOpen:a,onClose:d,onManualClose:u,timeout:x=ce,unstyled:p,zIndex:g=9996,role:w,...c},b)=>{const[v,y]=r.useState(!1),I=f.useId(),j=r.useRef(a),A=r.useRef(d),{refs:M,floatingStyles:S,context:F}=f.useFloating({nodeId:I,placement:e,middleware:[f.shift(),f.flip({fallbackAxisSideDirection:"end"}),f.offset({mainAxis:i.y,crossAxis:i.x})],open:v,onOpenChange:C=>{C?j.current?.(M.reference.current,M.floating.current):A.current?.(M.reference.current,M.floating.current),y(C)},whileElementsMounted:f.autoUpdate}),{isMounted:T,styles:E}=f.useTransitionStyles(F,{duration:x,initial({side:C}){let R="";return C==="top"?R="translateY(5%) scale(0.95)":C==="bottom"?R="translateY(-5%) scale(0.95)":C==="left"?R="translateX(5%) scale(0.95)":R="translateX(-5%) scale(0.95)",{opacity:0,transform:R}}}),B=r.useCallback(C=>{if(P(C),u)return u();y(!1),A.current?.(M.reference.current,M.floating.current)},[u]);r.useEffect(()=>{if(l&&v)return y(!1)},[l,v]),r.useImperativeHandle(b,()=>({open:()=>{y(!0),j.current?.(M.reference.current,M.floating.current)},close:()=>{y(!1),A.current?.(M.reference.current,M.floating.current)}}),[]);const{getFloatingProps:h,getReferenceProps:N}=f.useInteractions([f.useClick(F,{enabled:!l})]);return j.current=a,A.current=d,t.jsxs(t.Fragment,{children:[r.cloneElement(r.Children.only(n),N({ref:M.setReference,tabIndex:0,role:"button","aria-expanded":v,disabled:l,onClick:P})),t.jsx(z,{disabled:l||!T,children:t.jsx(f.FloatingOverlay,{"data-testid":"vs-popover-shadow",onClick:B,style:{zIndex:g},autoFocus:!0,children:t.jsx("div",{role:w||"region",ref:M.setFloating,style:S,children:t.jsx(Y,{unstyled:p,styles:E,...h({...c,onClick:P}),children:o})})})})]})});O.displayName="Popover";const Y=r.forwardRef(({className:e,unstyled:n,styles:o,style:s={},...l},i)=>{const a=r.useMemo(()=>m("z-20 w-auto h-auto outline-none transition-transform ease-in-out",n?null:"border border-accent rounded-md shadow-lg p-1 bg-background",e),[e,n]);return t.jsx("div",{ref:i,className:a,style:{...o,...s},...l})});Y.displayName="PopoverContent";function U(e){return t.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[t.jsx("path",{d:"M11.7 14.8 7 9.8a.5.5 0 0 1 0-.7c.2-.2.5-.2.7 0l4.5 5c.2.2.2.6 0 .8-.1.2-.4.2-.6 0Z",fill:"currentColor"}),t.jsx("path",{d:"m16.9 9.9-4.6 5c-.2.2-.4.2-.6 0a.5.5 0 0 1 0-.8l4.5-5c.2-.2.5-.2.7 0 .1.2.1.6 0 .8Z",fill:"currentColor"})]})}function V(e){return t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 30 30",...e,children:t.jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[t.jsx("path",{d:"M26 26l-12.5-12.5L26 1"}),t.jsx("path",{d:"M1 26l12.5-12.5L1 1"})]})})}function ue({className:e,placeholder:n="",options:o=[],error:s,unstyled:l,disabled:i,value:a,maxHeight:d=408,arrow:u,onChange:x,onClear:p,renderItem:g,...w}){const c=r.useRef(null),[b,v]=r.useState(0),y=r.useMemo(()=>l?e:k(m("flex items-center justify-between rounded-md border bg-background px-3 py-2 w-full overflow-hidden cursor-pointer","disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-ring",s?"border-danger hover:border-danger-fore":"border-input not-disabled:hover:border-input-fore"),e),[e,s,l]),I=r.useMemo(()=>Array.isArray(a),[]),j=r.useCallback(h=>{x?.(h),I||c.current?.close()},[x,I]),A=r.useCallback(h=>Array.isArray(a)?a.indexOf(h)>-1:a===h,[a]),M=r.useMemo(()=>{const h={},N=o.filter(C=>typeof C!="string");for(let C=0,R=N.length;C<R;C+=1){const $=N[C];h[`${$.value}`]=$.label}return h},[o]),S=r.useMemo(()=>{if(!a)return n;if(Array.isArray(a)){if(!a.length)return n;const h=[...a].sort(),N=[];for(let C=0,R=h.length;C<R;C+=1)N[C]=M[`${h[C]}`]||"";return N.filter(Boolean).join(",")||n}return M[`${a}`]||n},[n,a,M]),F=S===n,T=r.useMemo(()=>m("overflow-hidden overflow-ellipsis whitespace-nowrap",F?"text-muted":"text-text"),[F]),E=r.useMemo(()=>u||t.jsx(U,{className:"absolute right-0 text-muted size-5"}),[u]),B=r.useCallback((h,N)=>g?typeof h=="string"?g(h,{index:N,selected:!1,onChange:()=>{}}):g(h,{index:N,selected:A(h.value),onChange:()=>j(h.value)}):typeof h=="string"?t.jsx("h5",{className:"font-medium py-1 px-2 text-muted",children:h},`optionheader-${N}`):t.jsx(de,{selected:A(h.value),onChange:j,...h},h.label),[g,j,A]);return t.jsx(O,{label:t.jsxs("button",{type:"button",className:y,disabled:i,...w,children:[t.jsx("span",{className:T,children:S}),t.jsxs("div",{className:"relative flex items-center pl-8 pr-3 space-x-2",children:[p&&!F?t.jsx("div",{tabIndex:-1,role:"button",className:"size-6 p-1.5 rounded hover:bg-accent","aria-label":"clear selected values",onKeyDown:h=>{h.key!=="Enter"&&h.key!=="Space"||p()},onClick:h=>{h.stopPropagation(),p()},children:t.jsx(V,{})}):null,E]})]}),ref:c,onOpen:h=>v(h?.getBoundingClientRect().width||0),disabled:i,children:t.jsx("ul",{className:"overflow-y-auto flex flex-col",role:"listbox",style:{minWidth:b,maxWidth:"calc(100vw - 3rem)",maxHeight:d},children:o.map(B)})})}function de({className:e,value:n,label:o,selected:s,onChange:l}){const i=r.useMemo(()=>m("flex items-center w-full hover:bg-accent rounded p-1",e),[e]);return t.jsxs("button",{type:"button",role:"option",className:i,"aria-selected":s,onClick:()=>l?.(n),children:[s?t.jsx(D,{className:"w-5 h-5 mr-1"}):t.jsx("div",{className:"w-5 h-1 mr-1"}),o]})}function fe({checked:e,className:n,id:o,name:s,onChange:l,value:i,...a}){const d=r.useMemo(()=>m("relative inline-flex justify-center items-center border border-input w-4.5 h-4.5 rounded-full","cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed not-disabled:hover:border-input-fore",e?"[&_i]:bg-primary disabled:[&_i]:bg-text disabled:border-input":"",n),[n,e]),u=()=>{a.disabled||l?.(!e)};return t.jsxs("button",{type:"button",role:"radio",id:o||s,className:d,onClick:u,"aria-checked":e,...a,children:[t.jsx("i",{className:"block w-2.5 h-2.5 rounded-full transition-transform",style:{transform:e?"":"scale(0.8)",opacity:e?1:0}}),t.jsx("input",{type:"radio","aria-hidden":"true",name:s,checked:e,value:i,onChange:u,disabled:a.disabled,style:{position:"absolute",pointerEvents:"none",top:0,left:0,width:1,height:1,opacity:0}})]})}const G=r.forwardRef(({className:e,checked:n,onChange:o,value:s,id:l,name:i,...a},d)=>{const u=r.useMemo(()=>k(m("inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50","w-11",n?"bg-primary":"bg-input"),e),[e,n]),x=r.useMemo(()=>k("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",e),[e]),p=()=>{a.disabled||o?.(!n)};return t.jsxs("button",{type:"button",role:"switch",id:l||i,className:u,onClick:p,"aria-checked":n,...a,children:[t.jsx("span",{className:x,style:{transform:n?"translateX(100%)":""}}),t.jsx("input",{ref:d,type:"checkbox","aria-hidden":"true",name:i,checked:n,value:s,onChange:p,disabled:a.disabled,style:{position:"absolute",pointerEvents:"none",top:0,left:0,width:1,height:1,opacity:0}})]})});G.displayName="Switch";function he({header:e,show:n,children:o,timeout:s=300,...l}){const i=r.useRef(null),a=r.useRef(0),d=r.useRef(0),u=r.useRef(!0);return r.useEffect(()=>{d.current=s},[s]),_(()=>{if(!i.current)return;if(i.current.style.overflow="hidden",i.current.style.opacity="1",u.current){u.current=!1,i.current.style.height=n?"auto":"0px",n?window.requestAnimationFrame(()=>{i.current&&(a.current=i.current.offsetHeight)}):(window.requestAnimationFrame(()=>{i.current&&(i.current.style.height="auto",a.current=i.current.offsetHeight,i.current.style.height="0px")}),i.current.style.opacity="0");return}n||(i.current.style.height=`${a.current}px`);const x=[];x[0]=window.requestAnimationFrame(()=>{x[1]=window.requestAnimationFrame(()=>{i.current&&(i.current.style.height=`${n?a.current:0}px`,i.current.style.opacity=n?"1":"0")})});let p;const g=()=>{i.current&&(n?(i.current.style.height="auto",i.current.style.overflow="",i.current.style.opacity="",window.requestAnimationFrame(()=>{i.current&&(a.current=i.current.offsetHeight)})):i.current.style.height="0px")};return d.current===0?g():p=window.setTimeout(g,d.current),()=>{x.forEach(window.cancelAnimationFrame),p&&window.clearTimeout(p)}},[n]),t.jsxs("div",{...l,children:[e,t.jsx("div",{className:"transition-all ease-in-out overflow-hidden",role:"region","aria-hidden":!n,ref:i,style:{transitionDuration:`${s}ms`},children:o})]})}const xe=r.forwardRef(({children:e,position:n="bottom",label:o,className:s,timeout:l=150,offset:i={x:0,y:6},clientPoint:a=!1,disabled:d},u)=>{const[x,p]=r.useState(!1),g=f.useId(),{refs:w,floatingStyles:c,context:b}=f.useFloating({nodeId:g,open:x,placement:n,middleware:[f.shift(),f.flip(),f.offset({mainAxis:i.y,crossAxis:i.x})],whileElementsMounted:d?void 0:f.autoUpdate,onOpenChange:p}),{getReferenceProps:v,getFloatingProps:y}=f.useInteractions([f.useHover(b,{enabled:!d}),f.useClientPoint(b,{enabled:a})]),{isMounted:I,styles:j}=f.useTransitionStyles(b,{duration:l,initial:{opacity:0,transform:"scale(0.8)"}});r.useImperativeHandle(u,()=>({floating:w.floating,reference:w.reference,open:()=>p(!0),close:()=>p(!1)}));const A=typeof e=="string"?t.jsx("span",{children:e}):e;return t.jsxs(t.Fragment,{children:[r.cloneElement(r.Children.only(A),{ref:w.setReference,...v()}),t.jsx(z,{disabled:d||!I,children:t.jsx("div",{role:"tooltip",className:"z-[9999]",ref:w.setFloating,...y({style:c}),children:t.jsx(pe,{className:s,style:j,children:o})})})]})}),pe=r.forwardRef(({className:e,custom:n,...o},s)=>{const l=r.useMemo(()=>m("relative w-auto h-auto outline-none transition-transform ease-in-out whitespace-pre",n?null:"border border-accent rounded shadow-md px-3 py-1 bg-background",e),[e,n]);return t.jsx("div",{ref:s,className:l,...o})});function ge({variant:e,size:n}){return m("inline-flex items-center justify-center whitespace-nowrap transition-colors rounded-md cursor-pointer","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-auto",{"bg-primary text-inverted hover:bg-primary-fore":!e||e==="primary","bg-info text-inverted hover:bg-info-fore":e==="info","bg-warn text-inverted hover:bg-warn-fore":e==="warn","bg-danger text-inverted hover:bg-danger-fore":e==="danger","hover:bg-accent":e==="ghost","hover:underline":e==="link","border border-input hover:bg-accent":e==="outline"},{"px-2 py-1":!n,"p-1.5":n==="icon"})}function me({size:e,variant:n,className:o,...s}){const l=r.useMemo(()=>m(ge({size:e,variant:n}),o),[e,n,o]);return t.jsx("button",{className:l,type:"button",...s})}function be({open:e,children:n,timeout:o=150,padding:s="0.85rem",verticalAlign:l="center",closeOnOverlay:i,closeOnEsc:a,onExited:d,className:u,onOpenChange:x,size:p,...g}){const w=r.useRef(d),c=r.useRef(!1),b=f.useId(),{refs:v,context:y}=f.useFloating({open:e,onOpenChange:x,nodeId:b}),{getFloatingProps:I}=f.useInteractions([f.useDismiss(y,{enabled:a,escapeKey:a,outsidePress:!1})]),{isMounted:j,styles:A}=f.useTransitionStyles(y,{duration:o,initial:{opacity:0,transform:"scale(0.8)"}});r.useEffect(()=>{c.current!==j&&(c.current=j,!j&&w.current?.())},[j]);const M=r.useCallback(()=>{i&&x?.(!1)},[x,i]);w.current=d;const S=r.useMemo(()=>m("grid bg-backdrop z-40 justify-items-center",{"place-items-start items-start":l==="start","place-items-end":l==="end","place-items-center":l==="center"||!l}),[l]),F=r.useMemo(()=>k("transition ease-in-out",u),[u]);return t.jsx(z,{disabled:!j,children:t.jsx(f.FloatingOverlay,{className:S,"data-testid":"vs-dialog-overlay",onClick:M,style:{padding:s,opacity:A.opacity},lockScroll:!0,children:t.jsx(K,{ref:v.setFloating,className:F,role:"dialog",size:p,...I({...g,style:A,onClick:P}),children:n})})})}const K=r.forwardRef(({size:e,className:n,...o},s)=>{const l=r.useMemo(()=>m(e?"flex flex-col bg-background shadow-lg p-5 rounded":null,{"w-full max-w-sm":e==="small","w-full max-w-lg":e==="medium","w-full max-w-2xl":e==="large"},n),[e,n]);return t.jsx("div",{ref:s,className:l,...o})});K.displayName="DialogContent";const we={open:300,close:150};function ve({open:e,timeout:n=we,onOpenChange:o,position:s="right",overlay:l,...i}){const a=f.useId(),{refs:d,context:u}=f.useFloating({open:e,onOpenChange:o,nodeId:a}),{isMounted:x,styles:p}=f.useTransitionStyles(u,{duration:n,initial(){let w="translateX(75%)";return s==="left"?w="translateX(-75%)":s==="top"?w="translateY(-75%)":s==="bottom"&&(w="translateY(75%)"),{opacity:0,transform:w}}}),g=r.useMemo(()=>m("fixed transition-transform z-30",{"top-0 right-0 h-full max-h-screen":s==="right","top-0 left-0 h-full max-h-screen":s==="left","top-0 left-0 right-0 w-full max-w-screen":s==="top","bottom-0 left-0 right-0 w-full max-w-screen":s==="bottom"}),[s]);return t.jsxs(z,{disabled:!x,children:[l?t.jsx(f.FloatingOverlay,{className:"bg-backdrop",style:{opacity:p.opacity},onClick:()=>o?.(!1)}):null,t.jsx("div",{ref:d.setFloating,className:g,role:"dialog",style:p,children:t.jsx(ye,{...i})})]})}function ye({className:e,unstyled:n,...o}){const s=r.useMemo(()=>n?e:k(m("relative bg-background min-w-full min-h-full border border-input shadow-lg"),e),[n,e]);return t.jsx("div",{className:s,...o})}function J(e){return t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 30 30",...e,children:[t.jsx("path",{d:"M15 29a14 14 0 0 1-9.9-4.1A14 14 0 0 1 1 15a14 14 0 0 1 4.1-9.9A14 14 0 0 1 15 1a14 14 0 0 1 9.9 4.1A14 14 0 0 1 29 15a14 14 0 0 1-4.1 9.9A14 14 0 0 1 15 29z",fill:"none"}),t.jsx("path",{d:"M15 2a13 13 0 0 0-9.2 3.8A13 13 0 0 0 2 15a13 13 0 0 0 3.8 9.2A13 13 0 0 0 15 28a13 13 0 0 0 9.2-3.8A13 13 0 0 0 28 15a13 13 0 0 0-3.8-9.2A13 13 0 0 0 15 2m0-2a15 15 0 1 1 0 30 15 15 0 0 1 0-30z",fill:"currentColor"}),t.jsx("path",{d:"m11.5 18.5-3.9-4L6 16l5.6 5.6L23.2 10l-1.7-1.6z",fill:"currentColor"})]})}function L(e){return t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 32 32",...e,children:[t.jsx("path",{d:"M16 0C7.16 0 0 7.16 0 16C0 24.84 7.16 32 16 32C24.84 32 32 24.84 32 16C32 7.16 24.84 0 16 0ZM16 31C7.73 31 1 24.27 1 16C1 7.73 7.73 1 16 1C24.27 1 31 7.73 31 16C31 24.27 24.27 31 16 31Z",fill:"currentColor"}),t.jsx("path",{d:"M15.5 19.55V8.54999C15.5 8.26999 15.72 8.04999 16 8.04999C16.28 8.04999 16.5 8.26999 16.5 8.54999V19.55C16.5 19.83 16.28 20.05 16 20.05C15.72 20.05 15.5 19.83 15.5 19.55Z",fill:"currentColor"}),t.jsx("path",{d:"M16 23.95C16.5523 23.95 17 23.5023 17 22.95C17 22.3977 16.5523 21.95 16 21.95C15.4477 21.95 15 22.3977 15 22.95C15 23.5023 15.4477 23.95 16 23.95Z",fill:"currentColor"})]})}function Q(e){return t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 52 45",...e,children:t.jsx("path",{d:"M50.6 37.8 29.3 2c-1.5-2.6-5.1-2.8-6.7-.3l-21.2 36c-1.7 2.6.2 6.6 3.4 6.6h42.4c3.1 0 5-4 3.4-6.6Zm-24.7.6a2.7 2.7 0 1 1 0-5.5 2.7 2.7 0 0 1 0 5.5Zm2.9-10.1c0 1.5-1.3 2.7-2.8 2.7a2.8 2.8 0 0 1-2.8-2.7V13.9c0-1.5 1.3-2.7 2.8-2.7 1.5 0 2.8 1.2 2.8 2.7v14.4Z",fill:"currentColor"})})}function ee({size:e=20,label:n="Loading...",...o}){return t.jsxs("div",{role:"status",...o,children:[t.jsxs("svg",{"aria-hidden":"true",className:"text-accent animate-spin fill-primary",width:e,height:e,viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{d:"M100 50.6a50 50 0 1 1-100 0 50 50 0 0 1 100 0Zm-91 0a41 41 0 1 0 82 0 41 41 0 0 0-82 0Z",fill:"currentColor"}),t.jsx("path",{d:"M94 39a4.2 4.2 0 0 0 3-5.4A50 50 0 0 0 41.7 1.3c-2.4.4-3.9 2.9-3.2 5.3a5 5 0 0 0 5.6 3.5A41 41 0 0 1 88 36 5 5 0 0 0 94 39Z",fill:"currentFill"})]}),t.jsx("span",{className:"sr-only",children:n})]})}function te({type:e,label:n,message:o}){return t.jsxs("div",{className:"flex items-center px-4 py-3 w-80 text-sm bg-background border border-input rounded-lg shadow-md m-2",children:[e?t.jsxs("figure",{className:"mr-2",children:[e==="success"?t.jsx(J,{className:"text-primary size-5"}):null,e==="info"?t.jsx(L,{className:"text-info size-5"}):null,e==="error"?t.jsx(L,{className:"text-danger size-5"}):null,e==="warn"?t.jsx(Q,{className:"text-warn size-5"}):null,e==="loading"?t.jsx(ee,{size:20}):null]}):null,t.jsxs("div",{className:"space-y-2",children:[t.jsx("p",{className:"font-medium leading-none",children:n}),o?t.jsx("p",{children:o}):null]})]})}function q(){}class je{notify=q;lastId=0;subscribe=n=>(this.notify=n,()=>{this.notify=q});add=(n,o={})=>{this.lastId+=1;const s=`${this.lastId}`;return this.notify({id:s,type:"add",config:{id:s,label:n,...o}}),s};update=(n,o)=>{this.notify({id:n,type:"update",config:o})};remove=n=>{this.notify({id:n,type:"remove"})};clear=()=>{this.lastId=0}}const Z=new je;function Ce({id:e,type:n,index:o,duration:s,className:l,children:i,inverted:a,timeout:d=250,max:u=3}){const x=r.useRef(!1),[p,g]=r.useState(!1),{context:w,refs:c}=f.useFloating({open:p,onOpenChange:g,nodeId:e}),{isMounted:b,styles:v}=f.useTransitionStyles(w,{duration:d,initial:{opacity:0,transform:`translateY(${a?"":"-"}50%)`}});r.useLayoutEffect(()=>{g(o<=u)},[o,u]),r.useEffect(()=>{x.current!==b&&(b||Z.remove(e),x.current=b)},[b,e]),r.useEffect(()=>{if(!s)return;const j=window.setTimeout(()=>g(!1),s);return()=>window.clearTimeout(j)},[s,e]);const y=r.useCallback(()=>{n!=="loading"&&g(!1)},[n]),I=r.useMemo(()=>m("relative flex w-fit transition-transform ease-in-out cursor-pointer",l),[l]);return b?t.jsx("li",{role:"log",tabIndex:-1,ref:c.setFloating,className:I,style:v,onClick:y,children:i}):null}function Me({className:e,margin:n=16,position:o="top-left",max:s,ListItem:l=te}){const i=r.useMemo(()=>{const c={position:"fixed"};return o.indexOf("top")>-1?c.top=n:o.indexOf("bottom")>-1&&(c.bottom=n),o.indexOf("left")>-1?(c.left=n,c.alignItems="flex-start"):o.indexOf("right")>-1?(c.right=n,c.alignItems="flex-end"):(c.left="50%",c.alignItems="center",c.transform="translateX(-50%)"),c},[n,o]),a=r.useMemo(()=>m("flex flex-col z-40 overflow-hidden",e),[e]),d=r.useMemo(()=>o?.startsWith("bottom")||!1,[o]),u=r.useRef(new Map),[x,p]=r.useState([]),g=r.useState(0)[1];_(()=>Z.subscribe(c=>{r.startTransition(()=>{if(c.type==="add")u.current.set(c.id,c.config),p(b=>[...b,c.id]);else if(c.type==="remove"){if(!u.current.delete(c.id))return;p(v=>{const y=new Set(v);return y.has(c.id)?(y.delete(c.id),Array.from(y)):v})}else if(c.type==="update"){const b=u.current.get(c.id);if(!b)return;u.current.set(c.id,{...b,...c.config}),g(v=>v+1)}})}),[]);const w=x.length;return t.jsx(z,{children:t.jsx("ol",{className:a,style:i,"aria-live":"polite",children:x.map((c,b)=>{const v=u.current.get(c);if(!v)return null;const{className:y,duration:I,...j}=v;return t.jsx(Ce,{id:c,index:w-b,className:y,duration:I,inverted:d,max:s,children:r.createElement(l,j)},c)})})})}function ke({className:e,...n}){const o=r.useMemo(()=>k("inline-block animate-pulse rounded-md bg-accent",e),[e]);return t.jsx("span",{className:o,...n})}function Ae({className:e,...n}){const o=r.useMemo(()=>m("flex items-center justify-center","[&_button]:rounded-none [&_:first-child]:rounded-bl [&_:first-child]:rounded-tl [&_:last-child]:rounded-br [&_:last-child]:rounded-tr","[&_:first-child]:border-r-0 [&_:last-child]:border-l-0",e),[e]);return t.jsx("div",{role:"group",className:o,...n})}function Ie({value:e,max:n,className:o,...s}){const l=r.useMemo(()=>e?Math.round(e/n*100):0,[e,n]),i=r.useMemo(()=>k("relative overflow-hidden rounded-full bg-primary",o),[o]);return t.jsx("div",{role:"progressbar",className:i,"aria-valuemax":n,"aria-valuemin":0,...s,children:t.jsx("div",{className:"h-full w-full flex-1 bg-input transition-all origin-right",style:{transform:`translateX(${l>100?100:l}%)`}})})}function Ne({className:e,orientation:n="horizontal",...o}){const s=r.useMemo(()=>k(m("border-0 p-0 shrink-0 bg-input",n==="horizontal"?"h-[1px] w-full":"w-[1px] h-full"),e),[e,n]);return t.jsx("hr",{className:s,role:"none",...o})}function Re(e){return t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 30 30",...e,children:[t.jsxs("g",{fill:"none",children:[t.jsx("path",{d:"M15 29c-3.74 0-7.255-1.456-9.9-4.1A13.908 13.908 0 011 15c0-3.74 1.456-7.255 4.1-9.9A13.908 13.908 0 0115 1c3.74 0 7.255 1.456 9.9 4.1A13.908 13.908 0 0129 15c0 3.74-1.456 7.255-4.1 9.9A13.908 13.908 0 0115 29z"}),t.jsx("path",{d:"M15 2a12.915 12.915 0 00-9.192 3.808A12.915 12.915 0 002 15c0 3.472 1.352 6.737 3.808 9.192A12.915 12.915 0 0015 28c3.472 0 6.737-1.352 9.192-3.808A12.915 12.915 0 0028 15c0-3.472-1.352-6.737-3.808-9.192A12.915 12.915 0 0015 2m0-2c8.284 0 15 6.716 15 15 0 8.284-6.716 15-15 15-8.284 0-15-6.716-15-15C0 6.716 6.716 0 15 0z",fill:"currentColor"})]}),t.jsx("path",{d:"M18.066 8.5l-7.567 6.731 7.567 6.2",fill:"none",stroke:"currentColor",strokeWidth:"2"})]})}function Fe(e){return t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 30 30",...e,children:[t.jsxs("g",{fill:"none",children:[t.jsx("path",{d:"M15 29c-3.74 0-7.255-1.456-9.9-4.1A13.908 13.908 0 011 15c0-3.74 1.456-7.255 4.1-9.9A13.908 13.908 0 0115 1c3.74 0 7.255 1.456 9.9 4.1A13.908 13.908 0 0129 15c0 3.74-1.456 7.255-4.1 9.9A13.908 13.908 0 0115 29z"}),t.jsx("path",{d:"M15 2a12.915 12.915 0 00-9.192 3.808A12.915 12.915 0 002 15c0 3.472 1.352 6.737 3.808 9.192A12.915 12.915 0 0015 28c3.472 0 6.737-1.352 9.192-3.808A12.915 12.915 0 0028 15c0-3.472-1.352-6.737-3.808-9.192A12.915 12.915 0 0015 2m0-2c8.284 0 15 6.716 15 15 0 8.284-6.716 15-15 15-8.284 0-15-6.716-15-15C0 6.716 6.716 0 15 0z",fill:"currentColor"})]}),t.jsxs("g",{transform:"translate(9 7)",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[t.jsx("rect",{width:"12",height:"16",rx:"1",stroke:"none"}),t.jsx("path",{d:"M1 1h10v14H1z"})]}),t.jsx("path",{fill:"currentColor",d:"M13 11h4v1.3h-4zM13 14h4v1.3h-4zM13 17h4v1.3h-4z"})]})}function Se(e){return t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17.796",height:"17.908",viewBox:"0 0 17.796 17.908",...e,children:t.jsx("path",{d:"M1.254 12.674L.5 17.408l4.726-.8L17.3 4.472 13.281.5zM1.375 12.766l3.851 3.838M10.949 2.959l3.836 3.801",fill:"none",stroke:"currentColor"})})}function ze(e){return t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 30 30",...e,children:[t.jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"2",children:[t.jsx("circle",{cx:"15",cy:"15",r:"15",stroke:"none"}),t.jsx("circle",{cx:"15",cy:"15",r:"14"})]}),t.jsx("path",{d:"M8 23a6.018 6.018 0 016-6h2a6.018 6.018 0 016 6zm2.6-2h8.9a4.033 4.033 0 00-3.5-2h-1.9a4.035 4.035 0 00-3.5 2zm.4-9v-1a4.012 4.012 0 014-4 4.012 4.012 0 014 4v1a4.012 4.012 0 01-4 4 4.012 4.012 0 01-4-4zm2-1v1a2.006 2.006 0 002 2 2.006 2.006 0 002-2v-1a2.006 2.006 0 00-2-2 2.006 2.006 0 00-2 2z",fill:"currentColor"})]})}function Pe(e){return t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 30 30",...e,children:t.jsx("path",{d:"M15.065 0A15.069 15.069 0 00.142 13.105a1.256 1.256 0 102.478.406c0-.027.008-.055.01-.082a12.52 12.52 0 0121.3-7.226l-2.584 2.584 7.532 1.255-1.255-7.532-1.92 1.92A15 15 0 0015.065 0zm13.7 15.589A1.255 1.255 0 0027.5 16.7a12.512 12.512 0 01-21.893 6.569l1.927-1.927L0 20.086l1.255 7.532 2.572-2.572a15.02 15.02 0 0026.16-8.023 1.256 1.256 0 00-1.064-1.423 1.273 1.273 0 00-.16-.011z",fill:"currentColor"})})}function Te(e){return t.jsxs("svg",{width:"30",height:"30",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[t.jsx("rect",{x:"16.5",y:"9",width:"14",height:"1",rx:".5",transform:"rotate(90 16.5 9)",fill:"currentColor"}),t.jsx("rect",{x:"9",y:"15.5",width:"14",height:"1",rx:".5",fill:"currentColor"})]})}exports.clsx=m;exports.Accordion=he;exports.Button=me;exports.ButtonGroup=Ae;exports.Checkbox=le;exports.Dialog=be;exports.Divider=Ne;exports.FormField=re;exports.FormLabel=H;exports.IconAlert=L;exports.IconApproved=J;exports.IconArrowDown=U;exports.IconCaution=Q;exports.IconCheck=D;exports.IconChevronRound=Re;exports.IconClose=V;exports.IconFileRound=Fe;exports.IconPencil=Se;exports.IconPlus=Te;exports.IconRefresh=Pe;exports.IconUser=ze;exports.Input=W;exports.InputField=se;exports.Placeholder=ke;exports.Popover=O;exports.Portal=z;exports.Progress=Ie;exports.Radio=fe;exports.Select=ue;exports.Sheet=ve;exports.Spinner=ee;exports.Switch=G;exports.Textarea=X;exports.Toast=Me;exports.ToastItem=te;exports.Tooltip=xe;exports.merge=k;exports.toast=Z;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const m=require("clsx"),re=require("tailwind-merge"),t=require("react/jsx-runtime"),r=require("react"),f=require("@floating-ui/react"),oe=require("react-dom");function k(e,n){return n?re.twMerge(e,n):e}function H({className:e,...n}){const o=r.useMemo(()=>m("leading-none peer-disabled:opacity-70",e),[e]);return t.jsx("label",{className:o,...n})}function se({label:e,children:n,required:o,htmlFor:s,error:l,help:i,helpBefore:a,className:d,innerClass:u,...x}){const p=r.useMemo(()=>m("font-medium",o?'after:content-["*"] after:text-danger after:text-sm after:pl-0.5':""),[o]),g=r.useMemo(()=>k("flex flex-col space-y-2",d),[d]);return t.jsxs("div",{className:g,...x,children:[e?t.jsx(H,{className:p,htmlFor:s,children:e}):null,i&&a?t.jsx("p",{className:"text-xs text-muted pb-2",children:i}):null,t.jsx("div",{className:u,children:ie(n,!!l)}),i&&!a&&!l?t.jsx("p",{className:"text-xs text-muted",children:i}):null,l?t.jsx("p",{className:"text-xs text-danger",children:l}):null]})}function ie(e,n){const o=r.Children.count(e);if(!o)return null;if(o===1)return r.cloneElement(e,{error:n});const s=r.Children.toArray(e);return s[0]=r.cloneElement(s[0],{error:n}),s}function le({error:e,unstyled:n,className:o,...s}){const l=r.useMemo(()=>n?o:k(m("flex rounded-md border bg-background px-3 py-2 w-full [&_input]:placeholder:text-muted","[&_input]:disabled:opacity-50 [&_input]:focus-visible:outline-none",e?"border-danger hover:border-danger-fore":"border-input"),o),[o,e,n]);return t.jsx("div",{className:l,...s})}const W=r.forwardRef(({className:e,type:n,error:o,unstyled:s,...l},i)=>{const a=r.useMemo(()=>s?e:k(m("flex rounded-md border bg-background px-3 py-2 w-full placeholder:text-muted","disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-ring",o?"border-danger hover:border-danger-fore":"border-input not-disabled:hover:border-input-fore",n==="file"?"file:border-0 file:bg-transparent file:text-sm file:font-medium file:text-foreground":null),e),[e,n,o,s]);return t.jsx("input",{ref:i,type:n,className:a,...l})});W.displayName="Input";const X=r.forwardRef(({className:e,error:n,unstyled:o,...s},l)=>{const i=r.useMemo(()=>o?e:k(m("flex rounded-md border bg-background px-3 py-2 w-full","disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-ring",n?"border-danger hover:border-danger-fore":"border-input not-disabled:hover:border-input-fore"),e),[e,n,o]);return t.jsx("textarea",{ref:l,className:i,...s})});X.displayName="Textarea";function D(e){return t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 30 30",...e,children:t.jsx("path",{d:"M11.5 18.5l-3.9-4L6 16l5.6 5.6 11.6-11.5-1.7-1.6z",fill:"currentColor"})})}function ae(){return t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 30 30",children:t.jsx("rect",{width:"20",height:"3",y:"13.5",x:"4.5",fill:"currentColor",stroke:"none",rx:"2"})})}function ce({checked:e,indeterminate:n,className:o,id:s,name:l,onChange:i,value:a,...d}){const u=r.useMemo(()=>k(m("inline-flex justify-center items-center border w-4.5 h-4.5 rounded","cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",e||n?"bg-primary text-inverted disabled:text-text disabled:bg-input disabled:border-input":"border-input not-disabled:hover:border-input-fore"),o),[e,n,o]),x=()=>{d.disabled||i?.(!e)};return t.jsxs("button",{type:"button",role:"checkbox",id:s||l,className:u,onClick:x,"aria-checked":e,...d,children:[e?t.jsx(D,{}):null,n&&!e?t.jsx(ae,{}):null,t.jsx("input",{type:"checkbox","aria-hidden":"true",name:l,checked:e,value:a,onChange:x,disabled:d.disabled,style:{position:"absolute",pointerEvents:"none",top:0,left:0,width:1,height:1,opacity:0}})]})}const ue=typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",_=ue?r.useLayoutEffect:r.useEffect;function z({children:e,container:n,disabled:o}){const[s,l]=r.useState(null);return _(()=>{if(!n){let i=document.getElementById("visits-style-portals");return i||(i=document.createElement("div"),i.id="visits-style-portals",document.body.appendChild(i)),l(i)}l(n)},[n]),o||!s?null:oe.createPortal(e,s)}function P(e){e&&(e.stopPropagation(),e.preventDefault())}const de={open:150,close:75},O=r.forwardRef(({position:e,label:n,children:o,color:s="background",disabled:l,offset:i={x:0,y:6},onOpen:a,onClose:d,onManualClose:u,timeout:x=de,unstyled:p,zIndex:g=9996,role:w,...c},b)=>{const[v,y]=r.useState(!1),I=f.useId(),j=r.useRef(a),A=r.useRef(d),{refs:M,floatingStyles:S,context:F}=f.useFloating({nodeId:I,placement:e,middleware:[f.shift(),f.flip({fallbackAxisSideDirection:"end"}),f.offset({mainAxis:i.y,crossAxis:i.x})],open:v,onOpenChange:C=>{C?j.current?.(M.reference.current,M.floating.current):A.current?.(M.reference.current,M.floating.current),y(C)},whileElementsMounted:f.autoUpdate}),{isMounted:T,styles:B}=f.useTransitionStyles(F,{duration:x,initial({side:C}){let R="";return C==="top"?R="translateY(5%) scale(0.95)":C==="bottom"?R="translateY(-5%) scale(0.95)":C==="left"?R="translateX(5%) scale(0.95)":R="translateX(-5%) scale(0.95)",{opacity:0,transform:R}}}),E=r.useCallback(C=>{if(P(C),u)return u();y(!1),A.current?.(M.reference.current,M.floating.current)},[u]);r.useEffect(()=>{if(l&&v)return y(!1)},[l,v]),r.useImperativeHandle(b,()=>({open:()=>{y(!0),j.current?.(M.reference.current,M.floating.current)},close:()=>{y(!1),A.current?.(M.reference.current,M.floating.current)}}),[]);const{getFloatingProps:h,getReferenceProps:N}=f.useInteractions([f.useClick(F,{enabled:!l})]);return j.current=a,A.current=d,t.jsxs(t.Fragment,{children:[r.cloneElement(r.Children.only(n),N({ref:M.setReference,tabIndex:0,role:"button","aria-expanded":v,disabled:l,onClick:P})),t.jsx(z,{disabled:l||!T,children:t.jsx(f.FloatingOverlay,{"data-testid":"vs-popover-shadow",onClick:E,style:{zIndex:g},autoFocus:!0,children:t.jsx("div",{role:w||"region",ref:M.setFloating,style:S,children:t.jsx(Y,{unstyled:p,styles:B,...h({...c,onClick:P}),children:o})})})})]})});O.displayName="Popover";const Y=r.forwardRef(({className:e,unstyled:n,styles:o,style:s={},...l},i)=>{const a=r.useMemo(()=>m("z-20 w-auto h-auto outline-none transition-transform ease-in-out",n?null:"border border-accent rounded-md shadow-lg p-1 bg-background",e),[e,n]);return t.jsx("div",{ref:i,className:a,style:{...o,...s},...l})});Y.displayName="PopoverContent";function U(e){return t.jsxs("svg",{width:"24",height:"24",viewBox:"0 0 24 24",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[t.jsx("path",{d:"M11.7 14.8 7 9.8a.5.5 0 0 1 0-.7c.2-.2.5-.2.7 0l4.5 5c.2.2.2.6 0 .8-.1.2-.4.2-.6 0Z",fill:"currentColor"}),t.jsx("path",{d:"m16.9 9.9-4.6 5c-.2.2-.4.2-.6 0a.5.5 0 0 1 0-.8l4.5-5c.2-.2.5-.2.7 0 .1.2.1.6 0 .8Z",fill:"currentColor"})]})}function V(e){return t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",viewBox:"0 0 30 30",...e,children:t.jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round",children:[t.jsx("path",{d:"M26 26l-12.5-12.5L26 1"}),t.jsx("path",{d:"M1 26l12.5-12.5L1 1"})]})})}function fe({className:e,placeholder:n="",options:o=[],error:s,unstyled:l,disabled:i,value:a,maxHeight:d=408,arrow:u,onChange:x,onClear:p,renderItem:g,...w}){const c=r.useRef(null),[b,v]=r.useState(0),y=r.useMemo(()=>l?e:k(m("flex items-center justify-between rounded-md border bg-background px-3 py-2 w-full overflow-hidden cursor-pointer","disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-ring",s?"border-danger hover:border-danger-fore":"border-input not-disabled:hover:border-input-fore"),e),[e,s,l]),I=r.useMemo(()=>Array.isArray(a),[]),j=r.useCallback(h=>{x?.(h),I||c.current?.close()},[x,I]),A=r.useCallback(h=>Array.isArray(a)?a.indexOf(h)>-1:a===h,[a]),M=r.useMemo(()=>{const h={},N=o.filter(C=>typeof C!="string");for(let C=0,R=N.length;C<R;C+=1){const $=N[C];h[`${$.value}`]=$.label}return h},[o]),S=r.useMemo(()=>{if(!a)return n;if(Array.isArray(a)){if(!a.length)return n;const h=[...a].sort(),N=[];for(let C=0,R=h.length;C<R;C+=1)N[C]=M[`${h[C]}`]||"";return N.filter(Boolean).join(",")||n}return M[`${a}`]||n},[n,a,M]),F=S===n,T=r.useMemo(()=>m("overflow-hidden overflow-ellipsis whitespace-nowrap",F?"text-muted":"text-text"),[F]),B=r.useMemo(()=>u||t.jsx(U,{className:"absolute right-0 text-muted size-5"}),[u]),E=r.useCallback((h,N)=>g?typeof h=="string"?g(h,{index:N,selected:!1,onChange:()=>{}}):g(h,{index:N,selected:A(h.value),onChange:()=>j(h.value)}):typeof h=="string"?t.jsx("h5",{className:"font-medium py-1 px-2 text-muted",children:h},`optionheader-${N}`):t.jsx(he,{selected:A(h.value),onChange:j,...h},h.label),[g,j,A]);return t.jsx(O,{label:t.jsxs("button",{type:"button",className:y,disabled:i,...w,children:[t.jsx("span",{className:T,children:S}),t.jsxs("div",{className:"relative flex items-center pl-8 pr-3 space-x-2",children:[p&&!F?t.jsx("div",{tabIndex:-1,role:"button",className:"size-6 p-1.5 rounded hover:bg-accent","aria-label":"clear selected values",onKeyDown:h=>{h.key!=="Enter"&&h.key!=="Space"||p()},onClick:h=>{h.stopPropagation(),p()},children:t.jsx(V,{})}):null,B]})]}),ref:c,onOpen:h=>v(h?.getBoundingClientRect().width||0),disabled:i,children:t.jsx("ul",{className:"overflow-y-auto flex flex-col",role:"listbox",style:{minWidth:b,maxWidth:"calc(100vw - 3rem)",maxHeight:d},children:o.map(E)})})}function he({className:e,value:n,label:o,selected:s,onChange:l}){const i=r.useMemo(()=>m("flex items-center w-full hover:bg-accent rounded p-1",e),[e]);return t.jsxs("button",{type:"button",role:"option",className:i,"aria-selected":s,onClick:()=>l?.(n),children:[s?t.jsx(D,{className:"w-5 h-5 mr-1"}):t.jsx("div",{className:"w-5 h-1 mr-1"}),o]})}function xe({checked:e,className:n,id:o,name:s,onChange:l,value:i,...a}){const d=r.useMemo(()=>m("relative inline-flex justify-center items-center border border-input w-4.5 h-4.5 rounded-full","cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed not-disabled:hover:border-input-fore",e?"[&_i]:bg-primary disabled:[&_i]:bg-text disabled:border-input":"",n),[n,e]),u=()=>{a.disabled||l?.(!e)};return t.jsxs("button",{type:"button",role:"radio",id:o||s,className:d,onClick:u,"aria-checked":e,...a,children:[t.jsx("i",{className:"block w-2.5 h-2.5 rounded-full transition-transform",style:{transform:e?"":"scale(0.8)",opacity:e?1:0}}),t.jsx("input",{type:"radio","aria-hidden":"true",name:s,checked:e,value:i,onChange:u,disabled:a.disabled,style:{position:"absolute",pointerEvents:"none",top:0,left:0,width:1,height:1,opacity:0}})]})}const G=r.forwardRef(({className:e,checked:n,onChange:o,value:s,id:l,name:i,...a},d)=>{const u=r.useMemo(()=>k(m("inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50","w-11",n?"bg-primary":"bg-input"),e),[e,n]),x=r.useMemo(()=>k("pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",e),[e]),p=()=>{a.disabled||o?.(!n)};return t.jsxs("button",{type:"button",role:"switch",id:l||i,className:u,onClick:p,"aria-checked":n,...a,children:[t.jsx("span",{className:x,style:{transform:n?"translateX(100%)":""}}),t.jsx("input",{ref:d,type:"checkbox","aria-hidden":"true",name:i,checked:n,value:s,onChange:p,disabled:a.disabled,style:{position:"absolute",pointerEvents:"none",top:0,left:0,width:1,height:1,opacity:0}})]})});G.displayName="Switch";function pe({header:e,show:n,children:o,timeout:s=300,...l}){const i=r.useRef(null),a=r.useRef(0),d=r.useRef(0),u=r.useRef(!0);return r.useEffect(()=>{d.current=s},[s]),_(()=>{if(!i.current)return;if(i.current.style.overflow="hidden",i.current.style.opacity="1",u.current){u.current=!1,i.current.style.height=n?"auto":"0px",n?window.requestAnimationFrame(()=>{i.current&&(a.current=i.current.offsetHeight)}):(window.requestAnimationFrame(()=>{i.current&&(i.current.style.height="auto",a.current=i.current.offsetHeight,i.current.style.height="0px")}),i.current.style.opacity="0");return}n||(i.current.style.height=`${a.current}px`);const x=[];x[0]=window.requestAnimationFrame(()=>{x[1]=window.requestAnimationFrame(()=>{i.current&&(i.current.style.height=`${n?a.current:0}px`,i.current.style.opacity=n?"1":"0")})});let p;const g=()=>{i.current&&(n?(i.current.style.height="auto",i.current.style.overflow="",i.current.style.opacity="",window.requestAnimationFrame(()=>{i.current&&(a.current=i.current.offsetHeight)})):i.current.style.height="0px")};return d.current===0?g():p=window.setTimeout(g,d.current),()=>{x.forEach(window.cancelAnimationFrame),p&&window.clearTimeout(p)}},[n]),t.jsxs("div",{...l,children:[e,t.jsx("div",{className:"transition-all ease-in-out overflow-hidden",role:"region","aria-hidden":!n,ref:i,style:{transitionDuration:`${s}ms`},children:o})]})}const ge=r.forwardRef(({children:e,position:n="bottom",label:o,className:s,timeout:l=150,offset:i={x:0,y:6},clientPoint:a=!1,disabled:d},u)=>{const[x,p]=r.useState(!1),g=f.useId(),{refs:w,floatingStyles:c,context:b}=f.useFloating({nodeId:g,open:x,placement:n,middleware:[f.shift(),f.flip(),f.offset({mainAxis:i.y,crossAxis:i.x})],whileElementsMounted:d?void 0:f.autoUpdate,onOpenChange:p}),{getReferenceProps:v,getFloatingProps:y}=f.useInteractions([f.useHover(b,{enabled:!d}),f.useClientPoint(b,{enabled:a})]),{isMounted:I,styles:j}=f.useTransitionStyles(b,{duration:l,initial:{opacity:0,transform:"scale(0.8)"}});r.useImperativeHandle(u,()=>({floating:w.floating,reference:w.reference,open:()=>p(!0),close:()=>p(!1)}));const A=typeof e=="string"?t.jsx("span",{children:e}):e;return t.jsxs(t.Fragment,{children:[r.cloneElement(r.Children.only(A),{ref:w.setReference,...v()}),t.jsx(z,{disabled:d||!I,children:t.jsx("div",{role:"tooltip",className:"z-[9999]",ref:w.setFloating,...y({style:c}),children:t.jsx(me,{className:s,style:j,children:o})})})]})}),me=r.forwardRef(({className:e,custom:n,...o},s)=>{const l=r.useMemo(()=>m("relative w-auto h-auto outline-none transition-transform ease-in-out whitespace-pre",n?null:"border border-accent rounded shadow-md px-3 py-1 bg-background",e),[e,n]);return t.jsx("div",{ref:s,className:l,...o})});function K({variant:e,size:n}){return m("inline-flex items-center justify-center whitespace-nowrap transition-colors rounded-md cursor-pointer","focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring","disabled:pointer-events-none disabled:opacity-50 [&_svg]:pointer-events-none [&_svg]:shrink-auto",{"bg-primary text-inverted hover:bg-primary-fore":!e||e==="primary","bg-info text-inverted hover:bg-info-fore":e==="info","bg-warn text-inverted hover:bg-warn-fore":e==="warn","bg-danger text-inverted hover:bg-danger-fore":e==="danger","hover:bg-accent":e==="ghost","hover:underline":e==="link","border border-input hover:bg-accent":e==="outline"},{"px-2 py-1":!n,"p-1.5":n==="icon"})}function be({size:e,variant:n,className:o,...s}){const l=r.useMemo(()=>m(K({size:e,variant:n}),o),[e,n,o]);return t.jsx("button",{className:l,type:"button",...s})}function we({open:e,children:n,timeout:o=150,padding:s="0.85rem",verticalAlign:l="center",closeOnOverlay:i,closeOnEsc:a,onExited:d,className:u,onOpenChange:x,size:p,...g}){const w=r.useRef(d),c=r.useRef(!1),b=f.useId(),{refs:v,context:y}=f.useFloating({open:e,onOpenChange:x,nodeId:b}),{getFloatingProps:I}=f.useInteractions([f.useDismiss(y,{enabled:a,escapeKey:a,outsidePress:!1})]),{isMounted:j,styles:A}=f.useTransitionStyles(y,{duration:o,initial:{opacity:0,transform:"scale(0.8)"}});r.useEffect(()=>{c.current!==j&&(c.current=j,!j&&w.current?.())},[j]);const M=r.useCallback(()=>{i&&x?.(!1)},[x,i]);w.current=d;const S=r.useMemo(()=>m("grid bg-backdrop z-40 justify-items-center",{"place-items-start items-start":l==="start","place-items-end":l==="end","place-items-center":l==="center"||!l}),[l]),F=r.useMemo(()=>k("transition ease-in-out",u),[u]);return t.jsx(z,{disabled:!j,children:t.jsx(f.FloatingOverlay,{className:S,"data-testid":"vs-dialog-overlay",onClick:M,style:{padding:s,opacity:A.opacity},lockScroll:!0,children:t.jsx(J,{ref:v.setFloating,className:F,role:"dialog",size:p,...I({...g,style:A,onClick:P}),children:n})})})}const J=r.forwardRef(({size:e,className:n,...o},s)=>{const l=r.useMemo(()=>m(e?"flex flex-col bg-background shadow-lg p-5 rounded":null,{"w-full max-w-sm":e==="small","w-full max-w-lg":e==="medium","w-full max-w-2xl":e==="large"},n),[e,n]);return t.jsx("div",{ref:s,className:l,...o})});J.displayName="DialogContent";const ve={open:300,close:150};function ye({open:e,timeout:n=ve,onOpenChange:o,position:s="right",overlay:l,...i}){const a=f.useId(),{refs:d,context:u}=f.useFloating({open:e,onOpenChange:o,nodeId:a}),{isMounted:x,styles:p}=f.useTransitionStyles(u,{duration:n,initial(){let w="translateX(75%)";return s==="left"?w="translateX(-75%)":s==="top"?w="translateY(-75%)":s==="bottom"&&(w="translateY(75%)"),{opacity:0,transform:w}}}),g=r.useMemo(()=>m("fixed transition-transform z-30",{"top-0 right-0 h-full max-h-screen":s==="right","top-0 left-0 h-full max-h-screen":s==="left","top-0 left-0 right-0 w-full max-w-screen":s==="top","bottom-0 left-0 right-0 w-full max-w-screen":s==="bottom"}),[s]);return t.jsxs(z,{disabled:!x,children:[l?t.jsx(f.FloatingOverlay,{className:"bg-backdrop",style:{opacity:p.opacity},onClick:()=>o?.(!1)}):null,t.jsx("div",{ref:d.setFloating,className:g,role:"dialog",style:p,children:t.jsx(je,{...i})})]})}function je({className:e,unstyled:n,...o}){const s=r.useMemo(()=>n?e:k(m("relative bg-background min-w-full min-h-full border border-input shadow-lg"),e),[n,e]);return t.jsx("div",{className:s,...o})}function Q(e){return t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 30 30",...e,children:[t.jsx("path",{d:"M15 29a14 14 0 0 1-9.9-4.1A14 14 0 0 1 1 15a14 14 0 0 1 4.1-9.9A14 14 0 0 1 15 1a14 14 0 0 1 9.9 4.1A14 14 0 0 1 29 15a14 14 0 0 1-4.1 9.9A14 14 0 0 1 15 29z",fill:"none"}),t.jsx("path",{d:"M15 2a13 13 0 0 0-9.2 3.8A13 13 0 0 0 2 15a13 13 0 0 0 3.8 9.2A13 13 0 0 0 15 28a13 13 0 0 0 9.2-3.8A13 13 0 0 0 28 15a13 13 0 0 0-3.8-9.2A13 13 0 0 0 15 2m0-2a15 15 0 1 1 0 30 15 15 0 0 1 0-30z",fill:"currentColor"}),t.jsx("path",{d:"m11.5 18.5-3.9-4L6 16l5.6 5.6L23.2 10l-1.7-1.6z",fill:"currentColor"})]})}function L(e){return t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 32 32",...e,children:[t.jsx("path",{d:"M16 0C7.16 0 0 7.16 0 16C0 24.84 7.16 32 16 32C24.84 32 32 24.84 32 16C32 7.16 24.84 0 16 0ZM16 31C7.73 31 1 24.27 1 16C1 7.73 7.73 1 16 1C24.27 1 31 7.73 31 16C31 24.27 24.27 31 16 31Z",fill:"currentColor"}),t.jsx("path",{d:"M15.5 19.55V8.54999C15.5 8.26999 15.72 8.04999 16 8.04999C16.28 8.04999 16.5 8.26999 16.5 8.54999V19.55C16.5 19.83 16.28 20.05 16 20.05C15.72 20.05 15.5 19.83 15.5 19.55Z",fill:"currentColor"}),t.jsx("path",{d:"M16 23.95C16.5523 23.95 17 23.5023 17 22.95C17 22.3977 16.5523 21.95 16 21.95C15.4477 21.95 15 22.3977 15 22.95C15 23.5023 15.4477 23.95 16 23.95Z",fill:"currentColor"})]})}function ee(e){return t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 52 45",...e,children:t.jsx("path",{d:"M50.6 37.8 29.3 2c-1.5-2.6-5.1-2.8-6.7-.3l-21.2 36c-1.7 2.6.2 6.6 3.4 6.6h42.4c3.1 0 5-4 3.4-6.6Zm-24.7.6a2.7 2.7 0 1 1 0-5.5 2.7 2.7 0 0 1 0 5.5Zm2.9-10.1c0 1.5-1.3 2.7-2.8 2.7a2.8 2.8 0 0 1-2.8-2.7V13.9c0-1.5 1.3-2.7 2.8-2.7 1.5 0 2.8 1.2 2.8 2.7v14.4Z",fill:"currentColor"})})}function te({size:e=20,label:n="Loading...",...o}){return t.jsxs("div",{role:"status",...o,children:[t.jsxs("svg",{"aria-hidden":"true",className:"text-accent animate-spin fill-primary",width:e,height:e,viewBox:"0 0 100 101",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:[t.jsx("path",{d:"M100 50.6a50 50 0 1 1-100 0 50 50 0 0 1 100 0Zm-91 0a41 41 0 1 0 82 0 41 41 0 0 0-82 0Z",fill:"currentColor"}),t.jsx("path",{d:"M94 39a4.2 4.2 0 0 0 3-5.4A50 50 0 0 0 41.7 1.3c-2.4.4-3.9 2.9-3.2 5.3a5 5 0 0 0 5.6 3.5A41 41 0 0 1 88 36 5 5 0 0 0 94 39Z",fill:"currentFill"})]}),t.jsx("span",{className:"sr-only",children:n})]})}function ne({type:e,label:n,message:o}){return t.jsxs("div",{className:"flex items-center px-4 py-3 w-80 text-sm bg-background border border-input rounded-lg shadow-md m-2",children:[e?t.jsxs("figure",{className:"mr-2",children:[e==="success"?t.jsx(Q,{className:"text-primary size-5"}):null,e==="info"?t.jsx(L,{className:"text-info size-5"}):null,e==="error"?t.jsx(L,{className:"text-danger size-5"}):null,e==="warn"?t.jsx(ee,{className:"text-warn size-5"}):null,e==="loading"?t.jsx(te,{size:20}):null]}):null,t.jsxs("div",{className:"space-y-2",children:[t.jsx("p",{className:"font-medium leading-none",children:n}),o?t.jsx("p",{children:o}):null]})]})}function q(){}class Ce{notify=q;lastId=0;subscribe=n=>(this.notify=n,()=>{this.notify=q});add=(n,o={})=>{this.lastId+=1;const s=`${this.lastId}`;return this.notify({id:s,type:"add",config:{id:s,label:n,...o}}),s};update=(n,o)=>{this.notify({id:n,type:"update",config:o})};remove=n=>{this.notify({id:n,type:"remove"})};clear=()=>{this.lastId=0}}const Z=new Ce;function Me({id:e,type:n,index:o,duration:s,className:l,children:i,inverted:a,timeout:d=250,max:u=3}){const x=r.useRef(!1),[p,g]=r.useState(!1),{context:w,refs:c}=f.useFloating({open:p,onOpenChange:g,nodeId:e}),{isMounted:b,styles:v}=f.useTransitionStyles(w,{duration:d,initial:{opacity:0,transform:`translateY(${a?"":"-"}50%)`}});r.useLayoutEffect(()=>{g(o<=u)},[o,u]),r.useEffect(()=>{x.current!==b&&(b||Z.remove(e),x.current=b)},[b,e]),r.useEffect(()=>{if(!s)return;const j=window.setTimeout(()=>g(!1),s);return()=>window.clearTimeout(j)},[s,e]);const y=r.useCallback(()=>{n!=="loading"&&g(!1)},[n]),I=r.useMemo(()=>m("relative flex w-fit transition-transform ease-in-out cursor-pointer",l),[l]);return b?t.jsx("li",{role:"log",tabIndex:-1,ref:c.setFloating,className:I,style:v,onClick:y,children:i}):null}function ke({className:e,margin:n=16,position:o="top-left",max:s,ListItem:l=ne}){const i=r.useMemo(()=>{const c={position:"fixed"};return o.indexOf("top")>-1?c.top=n:o.indexOf("bottom")>-1&&(c.bottom=n),o.indexOf("left")>-1?(c.left=n,c.alignItems="flex-start"):o.indexOf("right")>-1?(c.right=n,c.alignItems="flex-end"):(c.left="50%",c.alignItems="center",c.transform="translateX(-50%)"),c},[n,o]),a=r.useMemo(()=>m("flex flex-col z-40 overflow-hidden",e),[e]),d=r.useMemo(()=>o?.startsWith("bottom")||!1,[o]),u=r.useRef(new Map),[x,p]=r.useState([]),g=r.useState(0)[1];_(()=>Z.subscribe(c=>{r.startTransition(()=>{if(c.type==="add")u.current.set(c.id,c.config),p(b=>[...b,c.id]);else if(c.type==="remove"){if(!u.current.delete(c.id))return;p(v=>{const y=new Set(v);return y.has(c.id)?(y.delete(c.id),Array.from(y)):v})}else if(c.type==="update"){const b=u.current.get(c.id);if(!b)return;u.current.set(c.id,{...b,...c.config}),g(v=>v+1)}})}),[]);const w=x.length;return t.jsx(z,{children:t.jsx("ol",{className:a,style:i,"aria-live":"polite",children:x.map((c,b)=>{const v=u.current.get(c);if(!v)return null;const{className:y,duration:I,...j}=v;return t.jsx(Me,{id:c,index:w-b,className:y,duration:I,inverted:d,max:s,children:r.createElement(l,j)},c)})})})}function Ae({className:e,...n}){const o=r.useMemo(()=>k("inline-block animate-pulse rounded-md bg-accent",e),[e]);return t.jsx("span",{className:o,...n})}function Ie({className:e,...n}){const o=r.useMemo(()=>m("flex items-center justify-center","[&_button]:rounded-none [&_:first-child]:rounded-bl [&_:first-child]:rounded-tl [&_:last-child]:rounded-br [&_:last-child]:rounded-tr","[&_:first-child]:border-r-0 [&_:last-child]:border-l-0",e),[e]);return t.jsx("div",{role:"group",className:o,...n})}function Ne({value:e,max:n,className:o,...s}){const l=r.useMemo(()=>e?Math.round(e/n*100):0,[e,n]),i=r.useMemo(()=>k("relative overflow-hidden rounded-full bg-primary",o),[o]);return t.jsx("div",{role:"progressbar",className:i,"aria-valuemax":n,"aria-valuemin":0,...s,children:t.jsx("div",{className:"h-full w-full flex-1 bg-input transition-all origin-right",style:{transform:`translateX(${l>100?100:l}%)`}})})}function Re({className:e,orientation:n="horizontal",...o}){const s=r.useMemo(()=>k(m("border-0 p-0 shrink-0 bg-input",n==="horizontal"?"h-[1px] w-full":"w-[1px] h-full"),e),[e,n]);return t.jsx("hr",{className:s,role:"none",...o})}function Fe(e){return t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 30 30",...e,children:[t.jsxs("g",{fill:"none",children:[t.jsx("path",{d:"M15 29c-3.74 0-7.255-1.456-9.9-4.1A13.908 13.908 0 011 15c0-3.74 1.456-7.255 4.1-9.9A13.908 13.908 0 0115 1c3.74 0 7.255 1.456 9.9 4.1A13.908 13.908 0 0129 15c0 3.74-1.456 7.255-4.1 9.9A13.908 13.908 0 0115 29z"}),t.jsx("path",{d:"M15 2a12.915 12.915 0 00-9.192 3.808A12.915 12.915 0 002 15c0 3.472 1.352 6.737 3.808 9.192A12.915 12.915 0 0015 28c3.472 0 6.737-1.352 9.192-3.808A12.915 12.915 0 0028 15c0-3.472-1.352-6.737-3.808-9.192A12.915 12.915 0 0015 2m0-2c8.284 0 15 6.716 15 15 0 8.284-6.716 15-15 15-8.284 0-15-6.716-15-15C0 6.716 6.716 0 15 0z",fill:"currentColor"})]}),t.jsx("path",{d:"M18.066 8.5l-7.567 6.731 7.567 6.2",fill:"none",stroke:"currentColor",strokeWidth:"2"})]})}function Se(e){return t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 30 30",...e,children:[t.jsxs("g",{fill:"none",children:[t.jsx("path",{d:"M15 29c-3.74 0-7.255-1.456-9.9-4.1A13.908 13.908 0 011 15c0-3.74 1.456-7.255 4.1-9.9A13.908 13.908 0 0115 1c3.74 0 7.255 1.456 9.9 4.1A13.908 13.908 0 0129 15c0 3.74-1.456 7.255-4.1 9.9A13.908 13.908 0 0115 29z"}),t.jsx("path",{d:"M15 2a12.915 12.915 0 00-9.192 3.808A12.915 12.915 0 002 15c0 3.472 1.352 6.737 3.808 9.192A12.915 12.915 0 0015 28c3.472 0 6.737-1.352 9.192-3.808A12.915 12.915 0 0028 15c0-3.472-1.352-6.737-3.808-9.192A12.915 12.915 0 0015 2m0-2c8.284 0 15 6.716 15 15 0 8.284-6.716 15-15 15-8.284 0-15-6.716-15-15C0 6.716 6.716 0 15 0z",fill:"currentColor"})]}),t.jsxs("g",{transform:"translate(9 7)",fill:"none",stroke:"currentColor",strokeWidth:"2",children:[t.jsx("rect",{width:"12",height:"16",rx:"1",stroke:"none"}),t.jsx("path",{d:"M1 1h10v14H1z"})]}),t.jsx("path",{fill:"currentColor",d:"M13 11h4v1.3h-4zM13 14h4v1.3h-4zM13 17h4v1.3h-4z"})]})}function ze(e){return t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"17.796",height:"17.908",viewBox:"0 0 17.796 17.908",...e,children:t.jsx("path",{d:"M1.254 12.674L.5 17.408l4.726-.8L17.3 4.472 13.281.5zM1.375 12.766l3.851 3.838M10.949 2.959l3.836 3.801",fill:"none",stroke:"currentColor"})})}function Pe(e){return t.jsxs("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 30 30",...e,children:[t.jsxs("g",{fill:"none",stroke:"currentColor",strokeWidth:"2",children:[t.jsx("circle",{cx:"15",cy:"15",r:"15",stroke:"none"}),t.jsx("circle",{cx:"15",cy:"15",r:"14"})]}),t.jsx("path",{d:"M8 23a6.018 6.018 0 016-6h2a6.018 6.018 0 016 6zm2.6-2h8.9a4.033 4.033 0 00-3.5-2h-1.9a4.035 4.035 0 00-3.5 2zm.4-9v-1a4.012 4.012 0 014-4 4.012 4.012 0 014 4v1a4.012 4.012 0 01-4 4 4.012 4.012 0 01-4-4zm2-1v1a2.006 2.006 0 002 2 2.006 2.006 0 002-2v-1a2.006 2.006 0 00-2-2 2.006 2.006 0 00-2 2z",fill:"currentColor"})]})}function Te(e){return t.jsx("svg",{xmlns:"http://www.w3.org/2000/svg",width:"30",height:"30",viewBox:"0 0 30 30",...e,children:t.jsx("path",{d:"M15.065 0A15.069 15.069 0 00.142 13.105a1.256 1.256 0 102.478.406c0-.027.008-.055.01-.082a12.52 12.52 0 0121.3-7.226l-2.584 2.584 7.532 1.255-1.255-7.532-1.92 1.92A15 15 0 0015.065 0zm13.7 15.589A1.255 1.255 0 0027.5 16.7a12.512 12.512 0 01-21.893 6.569l1.927-1.927L0 20.086l1.255 7.532 2.572-2.572a15.02 15.02 0 0026.16-8.023 1.256 1.256 0 00-1.064-1.423 1.273 1.273 0 00-.16-.011z",fill:"currentColor"})})}function Be(e){return t.jsxs("svg",{width:"30",height:"30",viewBox:"0 0 32 32",fill:"none",xmlns:"http://www.w3.org/2000/svg",...e,children:[t.jsx("rect",{x:"16.5",y:"9",width:"14",height:"1",rx:".5",transform:"rotate(90 16.5 9)",fill:"currentColor"}),t.jsx("rect",{x:"9",y:"15.5",width:"14",height:"1",rx:".5",fill:"currentColor"})]})}exports.clsx=m;exports.Accordion=pe;exports.Button=be;exports.ButtonGroup=Ie;exports.Checkbox=ce;exports.Dialog=we;exports.Divider=Re;exports.FormField=se;exports.FormLabel=H;exports.IconAlert=L;exports.IconApproved=Q;exports.IconArrowDown=U;exports.IconCaution=ee;exports.IconCheck=D;exports.IconChevronRound=Fe;exports.IconClose=V;exports.IconFileRound=Se;exports.IconPencil=ze;exports.IconPlus=Be;exports.IconRefresh=Te;exports.IconUser=Pe;exports.Input=W;exports.InputField=le;exports.Placeholder=Ae;exports.Popover=O;exports.Portal=z;exports.Progress=Ne;exports.Radio=xe;exports.Select=fe;exports.Sheet=ye;exports.Spinner=te;exports.Switch=G;exports.Textarea=X;exports.Toast=ke;exports.ToastItem=ne;exports.Tooltip=ge;exports.merge=k;exports.toast=Z;exports.varientButton=K;
package/dist/index.d.ts CHANGED
@@ -444,4 +444,6 @@ export declare interface TooltipRef {
444
444
  close: () => void;
445
445
  }
446
446
 
447
+ export declare function varientButton({ variant, size }: InnerButtonProps): string;
448
+
447
449
  export { }
package/dist/index.es.js CHANGED
@@ -1,17 +1,18 @@
1
1
  import w from "clsx";
2
- import { default as ht } from "clsx";
2
+ import { default as gt } from "clsx";
3
+ import { twMerge as ue } from "tailwind-merge";
3
4
  import { jsx as n, jsxs as g, Fragment as Q } from "react/jsx-runtime";
4
- import { useMemo as d, Children as j, cloneElement as $, forwardRef as R, useLayoutEffect as ee, useEffect as E, useState as S, useRef as F, useCallback as L, useImperativeHandle as te, startTransition as ue, createElement as fe } from "react";
5
- import { useId as W, useFloating as _, shift as ne, flip as re, offset as oe, autoUpdate as ie, useTransitionStyles as D, useInteractions as q, useClick as he, FloatingOverlay as U, useHover as pe, useClientPoint as ge, useDismiss as me } from "@floating-ui/react";
6
- import { createPortal as be } from "react-dom";
7
- function M(e, t) {
8
- return t ? e + " " + t : e;
5
+ import { useMemo as d, Children as j, cloneElement as $, forwardRef as R, useLayoutEffect as ee, useEffect as E, useState as S, useRef as F, useCallback as L, useImperativeHandle as te, startTransition as fe, createElement as he } from "react";
6
+ import { useId as W, useFloating as _, shift as ne, flip as re, offset as oe, autoUpdate as ie, useTransitionStyles as D, useInteractions as q, useClick as pe, FloatingOverlay as U, useHover as ge, useClientPoint as me, useDismiss as be } from "@floating-ui/react";
7
+ import { createPortal as we } from "react-dom";
8
+ function N(e, t) {
9
+ return t ? ue(e, t) : e;
9
10
  }
10
- function we({ className: e, ...t }) {
11
+ function xe({ className: e, ...t }) {
11
12
  const r = d(() => w("leading-none peer-disabled:opacity-70", e), [e]);
12
13
  return /* @__PURE__ */ n("label", { className: r, ...t });
13
14
  }
14
- function He({
15
+ function Ye({
15
16
  label: e,
16
17
  children: t,
17
18
  required: r,
@@ -26,16 +27,16 @@ function He({
26
27
  const p = d(() => w(
27
28
  "font-medium",
28
29
  r ? 'after:content-["*"] after:text-danger after:text-sm after:pl-0.5' : ""
29
- ), [r]), m = d(() => M("flex flex-col space-y-2", u), [u]);
30
+ ), [r]), m = d(() => N("flex flex-col space-y-2", u), [u]);
30
31
  return /* @__PURE__ */ g("div", { className: m, ...h, children: [
31
- e ? /* @__PURE__ */ n(we, { className: p, htmlFor: o, children: e }) : null,
32
+ e ? /* @__PURE__ */ n(xe, { className: p, htmlFor: o, children: e }) : null,
32
33
  i && s ? /* @__PURE__ */ n("p", { className: "text-xs text-muted pb-2", children: i }) : null,
33
- /* @__PURE__ */ n("div", { className: c, children: xe(t, !!l) }),
34
+ /* @__PURE__ */ n("div", { className: c, children: ve(t, !!l) }),
34
35
  i && !s && !l ? /* @__PURE__ */ n("p", { className: "text-xs text-muted", children: i }) : null,
35
36
  l ? /* @__PURE__ */ n("p", { className: "text-xs text-danger", children: l }) : null
36
37
  ] });
37
38
  }
38
- function xe(e, t) {
39
+ function ve(e, t) {
39
40
  const r = j.count(e);
40
41
  if (!r) return null;
41
42
  if (r === 1)
@@ -43,22 +44,22 @@ function xe(e, t) {
43
44
  const o = j.toArray(e);
44
45
  return o[0] = $(o[0], { error: t }), o;
45
46
  }
46
- function Xe({ error: e, unstyled: t, className: r, ...o }) {
47
- const l = d(() => t ? r : M(w(
47
+ function qe({ error: e, unstyled: t, className: r, ...o }) {
48
+ const l = d(() => t ? r : N(w(
48
49
  "flex rounded-md border bg-background px-3 py-2 w-full [&_input]:placeholder:text-muted",
49
50
  "[&_input]:disabled:opacity-50 [&_input]:focus-visible:outline-none",
50
51
  e ? "border-danger hover:border-danger-fore" : "border-input"
51
52
  ), r), [r, e, t]);
52
53
  return /* @__PURE__ */ n("div", { className: l, ...o });
53
54
  }
54
- const ve = R(({
55
+ const ye = R(({
55
56
  className: e,
56
57
  type: t,
57
58
  error: r,
58
59
  unstyled: o,
59
60
  ...l
60
61
  }, i) => {
61
- const s = d(() => o ? e : M(w(
62
+ const s = d(() => o ? e : N(w(
62
63
  "flex rounded-md border bg-background px-3 py-2 w-full placeholder:text-muted",
63
64
  "disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-ring",
64
65
  r ? "border-danger hover:border-danger-fore" : "border-input not-disabled:hover:border-input-fore",
@@ -66,28 +67,28 @@ const ve = R(({
66
67
  ), e), [e, t, r, o]);
67
68
  return /* @__PURE__ */ n("input", { ref: i, type: t, className: s, ...l });
68
69
  });
69
- ve.displayName = "Input";
70
- const ye = R(({
70
+ ye.displayName = "Input";
71
+ const Ce = R(({
71
72
  className: e,
72
73
  error: t,
73
74
  unstyled: r,
74
75
  ...o
75
76
  }, l) => {
76
- const i = d(() => r ? e : M(w(
77
+ const i = d(() => r ? e : N(w(
77
78
  "flex rounded-md border bg-background px-3 py-2 w-full",
78
79
  "disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-ring",
79
80
  t ? "border-danger hover:border-danger-fore" : "border-input not-disabled:hover:border-input-fore"
80
81
  ), e), [e, t, r]);
81
82
  return /* @__PURE__ */ n("textarea", { ref: l, className: i, ...o });
82
83
  });
83
- ye.displayName = "Textarea";
84
+ Ce.displayName = "Textarea";
84
85
  function le(e) {
85
86
  return /* @__PURE__ */ n("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", viewBox: "0 0 30 30", ...e, children: /* @__PURE__ */ n("path", { d: "M11.5 18.5l-3.9-4L6 16l5.6 5.6 11.6-11.5-1.7-1.6z", fill: "currentColor" }) });
86
87
  }
87
- function Ce() {
88
+ function Ae() {
88
89
  return /* @__PURE__ */ n("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", viewBox: "0 0 30 30", children: /* @__PURE__ */ n("rect", { width: "20", height: "3", y: "13.5", x: "4.5", fill: "currentColor", stroke: "none", rx: "2" }) });
89
90
  }
90
- function Ye({
91
+ function Ue({
91
92
  checked: e,
92
93
  indeterminate: t,
93
94
  className: r,
@@ -97,7 +98,7 @@ function Ye({
97
98
  value: s,
98
99
  ...u
99
100
  }) {
100
- const c = d(() => M(w(
101
+ const c = d(() => N(w(
101
102
  "inline-flex justify-center items-center border w-4.5 h-4.5 rounded",
102
103
  "cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed",
103
104
  e || t ? "bg-primary text-inverted disabled:text-text disabled:bg-input disabled:border-input" : "border-input not-disabled:hover:border-input-fore"
@@ -116,7 +117,7 @@ function Ye({
116
117
  ...u,
117
118
  children: [
118
119
  e ? /* @__PURE__ */ n(le, {}) : null,
119
- t && !e ? /* @__PURE__ */ n(Ce, {}) : null,
120
+ t && !e ? /* @__PURE__ */ n(Ae, {}) : null,
120
121
  /* @__PURE__ */ n(
121
122
  "input",
122
123
  {
@@ -134,7 +135,7 @@ function Ye({
134
135
  }
135
136
  );
136
137
  }
137
- const Ae = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", V = Ae ? ee : E;
138
+ const ke = typeof window < "u" && typeof window.document < "u" && typeof window.document.createElement < "u", V = ke ? ee : E;
138
139
  function Z({ children: e, container: t, disabled: r }) {
139
140
  const [o, l] = S(null);
140
141
  return V(() => {
@@ -143,12 +144,12 @@ function Z({ children: e, container: t, disabled: r }) {
143
144
  return i || (i = document.createElement("div"), i.id = "visits-style-portals", document.body.appendChild(i)), l(i);
144
145
  }
145
146
  l(t);
146
- }, [t]), r || !o ? null : be(e, o);
147
+ }, [t]), r || !o ? null : we(e, o);
147
148
  }
148
149
  function O(e) {
149
150
  e && (e.stopPropagation(), e.preventDefault());
150
151
  }
151
- const ke = { open: 150, close: 75 }, se = R(({
152
+ const Me = { open: 150, close: 75 }, se = R(({
152
153
  position: e,
153
154
  label: t,
154
155
  children: r,
@@ -158,13 +159,13 @@ const ke = { open: 150, close: 75 }, se = R(({
158
159
  onOpen: s,
159
160
  onClose: u,
160
161
  onManualClose: c,
161
- timeout: h = ke,
162
+ timeout: h = Me,
162
163
  unstyled: p,
163
164
  zIndex: m = 9996,
164
165
  role: x,
165
166
  ...a
166
167
  }, b) => {
167
- const [v, y] = S(!1), I = W(), C = F(s), N = F(u), { refs: k, floatingStyles: T, context: B } = _({
168
+ const [v, y] = S(!1), I = W(), C = F(s), M = F(u), { refs: k, floatingStyles: T, context: B } = _({
168
169
  nodeId: I,
169
170
  placement: e,
170
171
  middleware: [
@@ -174,7 +175,7 @@ const ke = { open: 150, close: 75 }, se = R(({
174
175
  ],
175
176
  open: v,
176
177
  onOpenChange: (A) => {
177
- A ? C.current?.(k.reference.current, k.floating.current) : N.current?.(k.reference.current, k.floating.current), y(A);
178
+ A ? C.current?.(k.reference.current, k.floating.current) : M.current?.(k.reference.current, k.floating.current), y(A);
178
179
  },
179
180
  whileElementsMounted: ie
180
181
  }), { isMounted: H, styles: X } = D(B, {
@@ -185,7 +186,7 @@ const ke = { open: 150, close: 75 }, se = R(({
185
186
  }
186
187
  }), Y = L((A) => {
187
188
  if (O(A), c) return c();
188
- y(!1), N.current?.(k.reference.current, k.floating.current);
189
+ y(!1), M.current?.(k.reference.current, k.floating.current);
189
190
  }, [c]);
190
191
  E(() => {
191
192
  if (l && v) return y(!1);
@@ -194,14 +195,14 @@ const ke = { open: 150, close: 75 }, se = R(({
194
195
  y(!0), C.current?.(k.reference.current, k.floating.current);
195
196
  },
196
197
  close: () => {
197
- y(!1), N.current?.(k.reference.current, k.floating.current);
198
+ y(!1), M.current?.(k.reference.current, k.floating.current);
198
199
  }
199
200
  // eslint-disable-next-line react-hooks/exhaustive-deps
200
201
  }), []);
201
202
  const { getFloatingProps: f, getReferenceProps: z } = q([
202
- he(B, { enabled: !l })
203
+ pe(B, { enabled: !l })
203
204
  ]);
204
- return C.current = s, N.current = u, /* @__PURE__ */ g(Q, { children: [
205
+ return C.current = s, M.current = u, /* @__PURE__ */ g(Q, { children: [
205
206
  $(j.only(t), z({
206
207
  ref: k.setReference,
207
208
  tabIndex: 0,
@@ -243,13 +244,13 @@ function Ne(e) {
243
244
  /* @__PURE__ */ n("path", { d: "m16.9 9.9-4.6 5c-.2.2-.4.2-.6 0a.5.5 0 0 1 0-.8l4.5-5c.2-.2.5-.2.7 0 .1.2.1.6 0 .8Z", fill: "currentColor" })
244
245
  ] });
245
246
  }
246
- function Me(e) {
247
+ function Ie(e) {
247
248
  return /* @__PURE__ */ n("svg", { xmlns: "http://www.w3.org/2000/svg", viewBox: "0 0 30 30", ...e, children: /* @__PURE__ */ g("g", { fill: "none", stroke: "currentColor", strokeWidth: "2", strokeLinecap: "round", children: [
248
249
  /* @__PURE__ */ n("path", { d: "M26 26l-12.5-12.5L26 1" }),
249
250
  /* @__PURE__ */ n("path", { d: "M1 26l12.5-12.5L1 1" })
250
251
  ] }) });
251
252
  }
252
- function qe({
253
+ function Ve({
253
254
  className: e,
254
255
  placeholder: t = "",
255
256
  options: r = [],
@@ -264,13 +265,13 @@ function qe({
264
265
  renderItem: m,
265
266
  ...x
266
267
  }) {
267
- const a = F(null), [b, v] = S(0), y = d(() => l ? e : M(w(
268
+ const a = F(null), [b, v] = S(0), y = d(() => l ? e : N(w(
268
269
  "flex items-center justify-between rounded-md border bg-background px-3 py-2 w-full overflow-hidden cursor-pointer",
269
270
  "disabled:cursor-not-allowed disabled:opacity-50 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-offset-2 focus-visible:ring-ring",
270
271
  o ? "border-danger hover:border-danger-fore" : "border-input not-disabled:hover:border-input-fore"
271
272
  ), e), [e, o, l]), I = d(() => Array.isArray(s), []), C = L((f) => {
272
273
  h?.(f), I || a.current?.close();
273
- }, [h, I]), N = L((f) => Array.isArray(s) ? s.indexOf(f) > -1 : s === f, [s]), k = d(() => {
274
+ }, [h, I]), M = L((f) => Array.isArray(s) ? s.indexOf(f) > -1 : s === f, [s]), k = d(() => {
274
275
  const f = {}, z = r.filter((A) => typeof A != "string");
275
276
  for (let A = 0, P = z.length; A < P; A += 1) {
276
277
  const K = z[A];
@@ -293,17 +294,17 @@ function qe({
293
294
  ), [B]), X = d(() => c || /* @__PURE__ */ n(Ne, { className: "absolute right-0 text-muted size-5" }), [c]), Y = L((f, z) => m ? typeof f == "string" ? m(f, { index: z, selected: !1, onChange: () => {
294
295
  } }) : m(f, {
295
296
  index: z,
296
- selected: N(f.value),
297
+ selected: M(f.value),
297
298
  onChange: () => C(f.value)
298
299
  }) : typeof f == "string" ? /* @__PURE__ */ n("h5", { className: "font-medium py-1 px-2 text-muted", children: f }, `optionheader-${z}`) : /* @__PURE__ */ n(
299
- Ie,
300
+ ze,
300
301
  {
301
- selected: N(f.value),
302
+ selected: M(f.value),
302
303
  onChange: C,
303
304
  ...f
304
305
  },
305
306
  f.label
306
- ), [m, C, N]);
307
+ ), [m, C, M]);
307
308
  return /* @__PURE__ */ n(
308
309
  se,
309
310
  {
@@ -323,7 +324,7 @@ function qe({
323
324
  onClick: (f) => {
324
325
  f.stopPropagation(), p();
325
326
  },
326
- children: /* @__PURE__ */ n(Me, {})
327
+ children: /* @__PURE__ */ n(Ie, {})
327
328
  }
328
329
  ) : null,
329
330
  X
@@ -344,7 +345,7 @@ function qe({
344
345
  }
345
346
  );
346
347
  }
347
- function Ie({ className: e, value: t, label: r, selected: o, onChange: l }) {
348
+ function ze({ className: e, value: t, label: r, selected: o, onChange: l }) {
348
349
  const i = d(() => w(
349
350
  "flex items-center w-full hover:bg-accent rounded p-1",
350
351
  e
@@ -364,7 +365,7 @@ function Ie({ className: e, value: t, label: r, selected: o, onChange: l }) {
364
365
  }
365
366
  );
366
367
  }
367
- function Ue({ checked: e, className: t, id: r, name: o, onChange: l, value: i, ...s }) {
368
+ function Ke({ checked: e, className: t, id: r, name: o, onChange: l, value: i, ...s }) {
368
369
  const u = d(() => w(
369
370
  "relative inline-flex justify-center items-center border border-input w-4.5 h-4.5 rounded-full",
370
371
  "cursor-pointer disabled:opacity-50 disabled:cursor-not-allowed not-disabled:hover:border-input-fore",
@@ -408,7 +409,7 @@ function Ue({ checked: e, className: t, id: r, name: o, onChange: l, value: i, .
408
409
  }
409
410
  );
410
411
  }
411
- const ze = R(({
412
+ const Fe = R(({
412
413
  className: e,
413
414
  checked: t,
414
415
  onChange: r,
@@ -417,12 +418,12 @@ const ze = R(({
417
418
  name: i,
418
419
  ...s
419
420
  }, u) => {
420
- const c = d(() => M(w(
421
+ const c = d(() => N(w(
421
422
  "inline-flex shrink-0 cursor-pointer items-center rounded-full border-2 border-transparent transition-colors",
422
423
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring focus-visible:ring-offset-2 focus-visible:ring-offset-background disabled:cursor-not-allowed disabled:opacity-50",
423
424
  "w-11",
424
425
  t ? "bg-primary" : "bg-input"
425
- ), e), [e, t]), h = d(() => M(
426
+ ), e), [e, t]), h = d(() => N(
426
427
  "pointer-events-none block h-5 w-5 rounded-full bg-background shadow-lg ring-0 transition-transform",
427
428
  e
428
429
  ), [e]), p = () => {
@@ -458,8 +459,8 @@ const ze = R(({
458
459
  }
459
460
  );
460
461
  });
461
- ze.displayName = "Switch";
462
- function Ve({ header: e, show: t, children: r, timeout: o = 300, ...l }) {
462
+ Fe.displayName = "Switch";
463
+ function Ge({ header: e, show: t, children: r, timeout: o = 300, ...l }) {
463
464
  const i = F(null), s = F(0), u = F(0), c = F(!0);
464
465
  return E(() => {
465
466
  u.current = o;
@@ -504,7 +505,7 @@ function Ve({ header: e, show: t, children: r, timeout: o = 300, ...l }) {
504
505
  )
505
506
  ] });
506
507
  }
507
- const Ke = R(({
508
+ const Je = R(({
508
509
  children: e,
509
510
  position: t = "bottom",
510
511
  label: r,
@@ -526,8 +527,8 @@ const Ke = R(({
526
527
  whileElementsMounted: u ? void 0 : ie,
527
528
  onOpenChange: p
528
529
  }), { getReferenceProps: v, getFloatingProps: y } = q([
529
- pe(b, { enabled: !u }),
530
- ge(b, { enabled: s })
530
+ ge(b, { enabled: !u }),
531
+ me(b, { enabled: s })
531
532
  ]), { isMounted: I, styles: C } = D(b, {
532
533
  duration: l,
533
534
  initial: { opacity: 0, transform: "scale(0.8)" }
@@ -538,15 +539,15 @@ const Ke = R(({
538
539
  open: () => p(!0),
539
540
  close: () => p(!1)
540
541
  }));
541
- const N = typeof e == "string" ? /* @__PURE__ */ n("span", { children: e }) : e;
542
+ const M = typeof e == "string" ? /* @__PURE__ */ n("span", { children: e }) : e;
542
543
  return /* @__PURE__ */ g(Q, { children: [
543
- $(j.only(N), {
544
+ $(j.only(M), {
544
545
  ref: x.setReference,
545
546
  ...v()
546
547
  }),
547
- /* @__PURE__ */ n(Z, { disabled: u || !I, children: /* @__PURE__ */ n("div", { role: "tooltip", className: "z-[9999]", ref: x.setFloating, ...y({ style: a }), children: /* @__PURE__ */ n(Fe, { className: o, style: C, children: r }) }) })
548
+ /* @__PURE__ */ n(Z, { disabled: u || !I, children: /* @__PURE__ */ n("div", { role: "tooltip", className: "z-[9999]", ref: x.setFloating, ...y({ style: a }), children: /* @__PURE__ */ n(Pe, { className: o, style: C, children: r }) }) })
548
549
  ] });
549
- }), Fe = R(({
550
+ }), Pe = R(({
550
551
  className: e,
551
552
  custom: t,
552
553
  ...r
@@ -558,7 +559,7 @@ const Ke = R(({
558
559
  ), [e, t]);
559
560
  return /* @__PURE__ */ n("div", { ref: o, className: l, ...r });
560
561
  });
561
- function Pe({ variant: e, size: t }) {
562
+ function Be({ variant: e, size: t }) {
562
563
  return w(
563
564
  "inline-flex items-center justify-center whitespace-nowrap transition-colors rounded-md cursor-pointer",
564
565
  "focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-ring",
@@ -578,11 +579,11 @@ function Pe({ variant: e, size: t }) {
578
579
  }
579
580
  );
580
581
  }
581
- function Ge({ size: e, variant: t, className: r, ...o }) {
582
- const l = d(() => w(Pe({ size: e, variant: t }), r), [e, t, r]);
582
+ function Qe({ size: e, variant: t, className: r, ...o }) {
583
+ const l = d(() => w(Be({ size: e, variant: t }), r), [e, t, r]);
583
584
  return /* @__PURE__ */ n("button", { className: l, type: "button", ...o });
584
585
  }
585
- function Je({
586
+ function et({
586
587
  open: e,
587
588
  children: t,
588
589
  timeout: r = 150,
@@ -597,12 +598,12 @@ function Je({
597
598
  ...m
598
599
  }) {
599
600
  const x = F(u), a = F(!1), b = W(), { refs: v, context: y } = _({ open: e, onOpenChange: h, nodeId: b }), { getFloatingProps: I } = q([
600
- me(y, {
601
+ be(y, {
601
602
  enabled: s,
602
603
  escapeKey: s,
603
604
  outsidePress: !1
604
605
  })
605
- ]), { isMounted: C, styles: N } = D(y, {
606
+ ]), { isMounted: C, styles: M } = D(y, {
606
607
  duration: r,
607
608
  initial: { opacity: 0, transform: "scale(0.8)" }
608
609
  });
@@ -617,14 +618,14 @@ function Je({
617
618
  "place-items-start items-start": l === "start",
618
619
  "place-items-end": l === "end",
619
620
  "place-items-center": l === "center" || !l
620
- }), [l]), B = d(() => M("transition ease-in-out", c), [c]);
621
+ }), [l]), B = d(() => N("transition ease-in-out", c), [c]);
621
622
  return /* @__PURE__ */ n(Z, { disabled: !C, children: /* @__PURE__ */ n(
622
623
  U,
623
624
  {
624
625
  className: T,
625
626
  "data-testid": "vs-dialog-overlay",
626
627
  onClick: k,
627
- style: { padding: o, opacity: N.opacity },
628
+ style: { padding: o, opacity: M.opacity },
628
629
  lockScroll: !0,
629
630
  children: /* @__PURE__ */ n(
630
631
  ce,
@@ -633,7 +634,7 @@ function Je({
633
634
  className: B,
634
635
  role: "dialog",
635
636
  size: p,
636
- ...I({ ...m, style: N, onClick: O }),
637
+ ...I({ ...m, style: M, onClick: O }),
637
638
  children: t
638
639
  }
639
640
  )
@@ -657,8 +658,8 @@ const ce = R(({
657
658
  return /* @__PURE__ */ n("div", { ref: o, className: l, ...r });
658
659
  });
659
660
  ce.displayName = "DialogContent";
660
- const Be = { open: 300, close: 150 };
661
- function Qe({ open: e, timeout: t = Be, onOpenChange: r, position: o = "right", overlay: l, ...i }) {
661
+ const Re = { open: 300, close: 150 };
662
+ function tt({ open: e, timeout: t = Re, onOpenChange: r, position: o = "right", overlay: l, ...i }) {
662
663
  const s = W(), { refs: u, context: c } = _({ open: e, onOpenChange: r, nodeId: s }), { isMounted: h, styles: p } = D(c, {
663
664
  duration: t,
664
665
  initial() {
@@ -690,18 +691,18 @@ function Qe({ open: e, timeout: t = Be, onOpenChange: r, position: o = "right",
690
691
  className: m,
691
692
  role: "dialog",
692
693
  style: p,
693
- children: /* @__PURE__ */ n(Re, { ...i })
694
+ children: /* @__PURE__ */ n(Se, { ...i })
694
695
  }
695
696
  )
696
697
  ] });
697
698
  }
698
- function Re({ className: e, unstyled: t, ...r }) {
699
- const o = d(() => t ? e : M(w(
699
+ function Se({ className: e, unstyled: t, ...r }) {
700
+ const o = d(() => t ? e : N(w(
700
701
  "relative bg-background min-w-full min-h-full border border-input shadow-lg"
701
702
  ), e), [t, e]);
702
703
  return /* @__PURE__ */ n("div", { className: o, ...r });
703
704
  }
704
- function Se(e) {
705
+ function Te(e) {
705
706
  return /* @__PURE__ */ g("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", viewBox: "0 0 30 30", ...e, children: [
706
707
  /* @__PURE__ */ n("path", { d: "M15 29a14 14 0 0 1-9.9-4.1A14 14 0 0 1 1 15a14 14 0 0 1 4.1-9.9A14 14 0 0 1 15 1a14 14 0 0 1 9.9 4.1A14 14 0 0 1 29 15a14 14 0 0 1-4.1 9.9A14 14 0 0 1 15 29z", fill: "none" }),
707
708
  /* @__PURE__ */ n("path", { d: "M15 2a13 13 0 0 0-9.2 3.8A13 13 0 0 0 2 15a13 13 0 0 0 3.8 9.2A13 13 0 0 0 15 28a13 13 0 0 0 9.2-3.8A13 13 0 0 0 28 15a13 13 0 0 0-3.8-9.2A13 13 0 0 0 15 2m0-2a15 15 0 1 1 0 30 15 15 0 0 1 0-30z", fill: "currentColor" }),
@@ -715,10 +716,10 @@ function G(e) {
715
716
  /* @__PURE__ */ n("path", { d: "M16 23.95C16.5523 23.95 17 23.5023 17 22.95C17 22.3977 16.5523 21.95 16 21.95C15.4477 21.95 15 22.3977 15 22.95C15 23.5023 15.4477 23.95 16 23.95Z", fill: "currentColor" })
716
717
  ] });
717
718
  }
718
- function Te(e) {
719
+ function Le(e) {
719
720
  return /* @__PURE__ */ n("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", viewBox: "0 0 52 45", ...e, children: /* @__PURE__ */ n("path", { d: "M50.6 37.8 29.3 2c-1.5-2.6-5.1-2.8-6.7-.3l-21.2 36c-1.7 2.6.2 6.6 3.4 6.6h42.4c3.1 0 5-4 3.4-6.6Zm-24.7.6a2.7 2.7 0 1 1 0-5.5 2.7 2.7 0 0 1 0 5.5Zm2.9-10.1c0 1.5-1.3 2.7-2.8 2.7a2.8 2.8 0 0 1-2.8-2.7V13.9c0-1.5 1.3-2.7 2.8-2.7 1.5 0 2.8 1.2 2.8 2.7v14.4Z", fill: "currentColor" }) });
720
721
  }
721
- function Le({ size: e = 20, label: t = "Loading...", ...r }) {
722
+ function Ee({ size: e = 20, label: t = "Loading...", ...r }) {
722
723
  return /* @__PURE__ */ g("div", { role: "status", ...r, children: [
723
724
  /* @__PURE__ */ g("svg", { "aria-hidden": "true", className: "text-accent animate-spin fill-primary", width: e, height: e, viewBox: "0 0 100 101", fill: "none", xmlns: "http://www.w3.org/2000/svg", children: [
724
725
  /* @__PURE__ */ n("path", { d: "M100 50.6a50 50 0 1 1-100 0 50 50 0 0 1 100 0Zm-91 0a41 41 0 1 0 82 0 41 41 0 0 0-82 0Z", fill: "currentColor" }),
@@ -727,14 +728,14 @@ function Le({ size: e = 20, label: t = "Loading...", ...r }) {
727
728
  /* @__PURE__ */ n("span", { className: "sr-only", children: t })
728
729
  ] });
729
730
  }
730
- function Ee({ type: e, label: t, message: r }) {
731
+ function _e({ type: e, label: t, message: r }) {
731
732
  return /* @__PURE__ */ g("div", { className: "flex items-center px-4 py-3 w-80 text-sm bg-background border border-input rounded-lg shadow-md m-2", children: [
732
733
  e ? /* @__PURE__ */ g("figure", { className: "mr-2", children: [
733
- e === "success" ? /* @__PURE__ */ n(Se, { className: "text-primary size-5" }) : null,
734
+ e === "success" ? /* @__PURE__ */ n(Te, { className: "text-primary size-5" }) : null,
734
735
  e === "info" ? /* @__PURE__ */ n(G, { className: "text-info size-5" }) : null,
735
736
  e === "error" ? /* @__PURE__ */ n(G, { className: "text-danger size-5" }) : null,
736
- e === "warn" ? /* @__PURE__ */ n(Te, { className: "text-warn size-5" }) : null,
737
- e === "loading" ? /* @__PURE__ */ n(Le, { size: 20 }) : null
737
+ e === "warn" ? /* @__PURE__ */ n(Le, { className: "text-warn size-5" }) : null,
738
+ e === "loading" ? /* @__PURE__ */ n(Ee, { size: 20 }) : null
738
739
  ] }) : null,
739
740
  /* @__PURE__ */ g("div", { className: "space-y-2", children: [
740
741
  /* @__PURE__ */ n("p", { className: "font-medium leading-none", children: t }),
@@ -744,7 +745,7 @@ function Ee({ type: e, label: t, message: r }) {
744
745
  }
745
746
  function J() {
746
747
  }
747
- class _e {
748
+ class De {
748
749
  /** システムで1つしか存在しない前提とする */
749
750
  notify = J;
750
751
  lastId = 0;
@@ -768,8 +769,8 @@ class _e {
768
769
  this.lastId = 0;
769
770
  };
770
771
  }
771
- const de = new _e();
772
- function De({
772
+ const de = new De();
773
+ function Ze({
773
774
  id: e,
774
775
  type: t,
775
776
  index: r,
@@ -812,12 +813,12 @@ function De({
812
813
  }
813
814
  ) : null;
814
815
  }
815
- function et({
816
+ function nt({
816
817
  className: e,
817
818
  margin: t = 16,
818
819
  position: r = "top-left",
819
820
  max: o,
820
- ListItem: l = Ee
821
+ ListItem: l = _e
821
822
  }) {
822
823
  const i = d(() => {
823
824
  const a = { position: "fixed" };
@@ -827,7 +828,7 @@ function et({
827
828
  e
828
829
  ), [e]), u = d(() => r?.startsWith("bottom") || !1, [r]), c = F(/* @__PURE__ */ new Map()), [h, p] = S([]), m = S(0)[1];
829
830
  V(() => de.subscribe((a) => {
830
- ue(() => {
831
+ fe(() => {
831
832
  if (a.type === "add")
832
833
  c.current.set(a.id, a.config), p((b) => [...b, a.id]);
833
834
  else if (a.type === "remove") {
@@ -849,7 +850,7 @@ function et({
849
850
  if (!v) return null;
850
851
  const { className: y, duration: I, ...C } = v;
851
852
  return /* @__PURE__ */ n(
852
- De,
853
+ Ze,
853
854
  {
854
855
  id: a,
855
856
  index: x - b,
@@ -857,20 +858,20 @@ function et({
857
858
  duration: I,
858
859
  inverted: u,
859
860
  max: o,
860
- children: fe(l, C)
861
+ children: he(l, C)
861
862
  },
862
863
  a
863
864
  );
864
865
  }) }) });
865
866
  }
866
- function tt({ className: e, ...t }) {
867
- const r = d(() => M(
867
+ function rt({ className: e, ...t }) {
868
+ const r = d(() => N(
868
869
  "inline-block animate-pulse rounded-md bg-accent",
869
870
  e
870
871
  ), [e]);
871
872
  return /* @__PURE__ */ n("span", { className: r, ...t });
872
873
  }
873
- function nt({ className: e, ...t }) {
874
+ function ot({ className: e, ...t }) {
874
875
  const r = d(() => w(
875
876
  "flex items-center justify-center",
876
877
  "[&_button]:rounded-none [&_:first-child]:rounded-bl [&_:first-child]:rounded-tl [&_:last-child]:rounded-br [&_:last-child]:rounded-tr",
@@ -879,8 +880,8 @@ function nt({ className: e, ...t }) {
879
880
  ), [e]);
880
881
  return /* @__PURE__ */ n("div", { role: "group", className: r, ...t });
881
882
  }
882
- function rt({ value: e, max: t, className: r, ...o }) {
883
- const l = d(() => e ? Math.round(e / t * 100) : 0, [e, t]), i = d(() => M("relative overflow-hidden rounded-full bg-primary", r), [r]);
883
+ function it({ value: e, max: t, className: r, ...o }) {
884
+ const l = d(() => e ? Math.round(e / t * 100) : 0, [e, t]), i = d(() => N("relative overflow-hidden rounded-full bg-primary", r), [r]);
884
885
  return /* @__PURE__ */ n("div", { role: "progressbar", className: i, "aria-valuemax": t, "aria-valuemin": 0, ...o, children: /* @__PURE__ */ n(
885
886
  "div",
886
887
  {
@@ -889,14 +890,14 @@ function rt({ value: e, max: t, className: r, ...o }) {
889
890
  }
890
891
  ) });
891
892
  }
892
- function ot({ className: e, orientation: t = "horizontal", ...r }) {
893
- const o = d(() => M(w(
893
+ function lt({ className: e, orientation: t = "horizontal", ...r }) {
894
+ const o = d(() => N(w(
894
895
  "border-0 p-0 shrink-0 bg-input",
895
896
  t === "horizontal" ? "h-[1px] w-full" : "w-[1px] h-full"
896
897
  ), e), [e, t]);
897
898
  return /* @__PURE__ */ n("hr", { className: o, role: "none", ...r });
898
899
  }
899
- function it(e) {
900
+ function st(e) {
900
901
  return /* @__PURE__ */ g("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", viewBox: "0 0 30 30", ...e, children: [
901
902
  /* @__PURE__ */ g("g", { fill: "none", children: [
902
903
  /* @__PURE__ */ n("path", { d: "M15 29c-3.74 0-7.255-1.456-9.9-4.1A13.908 13.908 0 011 15c0-3.74 1.456-7.255 4.1-9.9A13.908 13.908 0 0115 1c3.74 0 7.255 1.456 9.9 4.1A13.908 13.908 0 0129 15c0 3.74-1.456 7.255-4.1 9.9A13.908 13.908 0 0115 29z" }),
@@ -919,7 +920,7 @@ function it(e) {
919
920
  )
920
921
  ] });
921
922
  }
922
- function lt(e) {
923
+ function at(e) {
923
924
  return /* @__PURE__ */ g("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", viewBox: "0 0 30 30", ...e, children: [
924
925
  /* @__PURE__ */ g("g", { fill: "none", children: [
925
926
  /* @__PURE__ */ n("path", { d: "M15 29c-3.74 0-7.255-1.456-9.9-4.1A13.908 13.908 0 011 15c0-3.74 1.456-7.255 4.1-9.9A13.908 13.908 0 0115 1c3.74 0 7.255 1.456 9.9 4.1A13.908 13.908 0 0129 15c0 3.74-1.456 7.255-4.1 9.9A13.908 13.908 0 0115 29z" }),
@@ -944,7 +945,7 @@ function lt(e) {
944
945
  )
945
946
  ] });
946
947
  }
947
- function st(e) {
948
+ function ct(e) {
948
949
  return /* @__PURE__ */ n("svg", { xmlns: "http://www.w3.org/2000/svg", width: "17.796", height: "17.908", viewBox: "0 0 17.796 17.908", ...e, children: /* @__PURE__ */ n(
949
950
  "path",
950
951
  {
@@ -954,7 +955,7 @@ function st(e) {
954
955
  }
955
956
  ) });
956
957
  }
957
- function at(e) {
958
+ function dt(e) {
958
959
  return /* @__PURE__ */ g("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", viewBox: "0 0 30 30", ...e, children: [
959
960
  /* @__PURE__ */ g("g", { fill: "none", stroke: "currentColor", strokeWidth: "2", children: [
960
961
  /* @__PURE__ */ n("circle", { cx: "15", cy: "15", r: "15", stroke: "none" }),
@@ -969,7 +970,7 @@ function at(e) {
969
970
  )
970
971
  ] });
971
972
  }
972
- function ct(e) {
973
+ function ut(e) {
973
974
  return /* @__PURE__ */ n("svg", { xmlns: "http://www.w3.org/2000/svg", width: "30", height: "30", viewBox: "0 0 30 30", ...e, children: /* @__PURE__ */ n(
974
975
  "path",
975
976
  {
@@ -978,49 +979,50 @@ function ct(e) {
978
979
  }
979
980
  ) });
980
981
  }
981
- function dt(e) {
982
+ function ft(e) {
982
983
  return /* @__PURE__ */ g("svg", { width: "30", height: "30", viewBox: "0 0 32 32", fill: "none", xmlns: "http://www.w3.org/2000/svg", ...e, children: [
983
984
  /* @__PURE__ */ n("rect", { x: "16.5", y: "9", width: "14", height: "1", rx: ".5", transform: "rotate(90 16.5 9)", fill: "currentColor" }),
984
985
  /* @__PURE__ */ n("rect", { x: "9", y: "15.5", width: "14", height: "1", rx: ".5", fill: "currentColor" })
985
986
  ] });
986
987
  }
987
988
  export {
988
- Ve as Accordion,
989
- Ge as Button,
990
- nt as ButtonGroup,
991
- Ye as Checkbox,
992
- Je as Dialog,
993
- ot as Divider,
994
- He as FormField,
995
- we as FormLabel,
989
+ Ge as Accordion,
990
+ Qe as Button,
991
+ ot as ButtonGroup,
992
+ Ue as Checkbox,
993
+ et as Dialog,
994
+ lt as Divider,
995
+ Ye as FormField,
996
+ xe as FormLabel,
996
997
  G as IconAlert,
997
- Se as IconApproved,
998
+ Te as IconApproved,
998
999
  Ne as IconArrowDown,
999
- Te as IconCaution,
1000
+ Le as IconCaution,
1000
1001
  le as IconCheck,
1001
- it as IconChevronRound,
1002
- Me as IconClose,
1003
- lt as IconFileRound,
1004
- st as IconPencil,
1005
- dt as IconPlus,
1006
- ct as IconRefresh,
1007
- at as IconUser,
1008
- ve as Input,
1009
- Xe as InputField,
1010
- tt as Placeholder,
1002
+ st as IconChevronRound,
1003
+ Ie as IconClose,
1004
+ at as IconFileRound,
1005
+ ct as IconPencil,
1006
+ ft as IconPlus,
1007
+ ut as IconRefresh,
1008
+ dt as IconUser,
1009
+ ye as Input,
1010
+ qe as InputField,
1011
+ rt as Placeholder,
1011
1012
  se as Popover,
1012
1013
  Z as Portal,
1013
- rt as Progress,
1014
- Ue as Radio,
1015
- qe as Select,
1016
- Qe as Sheet,
1017
- Le as Spinner,
1018
- ze as Switch,
1019
- ye as Textarea,
1020
- et as Toast,
1021
- Ee as ToastItem,
1022
- Ke as Tooltip,
1023
- ht as clsx,
1024
- M as merge,
1025
- de as toast
1014
+ it as Progress,
1015
+ Ke as Radio,
1016
+ Ve as Select,
1017
+ tt as Sheet,
1018
+ Ee as Spinner,
1019
+ Fe as Switch,
1020
+ Ce as Textarea,
1021
+ nt as Toast,
1022
+ _e as ToastItem,
1023
+ Je as Tooltip,
1024
+ gt as clsx,
1025
+ N as merge,
1026
+ de as toast,
1027
+ Be as varientButton
1026
1028
  };
package/package.json CHANGED
@@ -2,7 +2,7 @@
2
2
  "name": "visits-style",
3
3
  "repository": "https://github.com/visits-works/visits-style",
4
4
  "homepage": "https://github.com/visits-works/visits-style",
5
- "version": "2.0.4",
5
+ "version": "2.0.6",
6
6
  "description": "VISITS Technologiesのreactデザインコンポーネント",
7
7
  "type": "module",
8
8
  "main": "./dist/index.cjs.js",
@@ -28,6 +28,7 @@
28
28
  },
29
29
  "dependencies": {
30
30
  "@floating-ui/react": "^0.27.4",
31
- "clsx": "^2.1.1"
31
+ "clsx": "^2.1.1",
32
+ "tailwind-merge": "^3.0.2"
32
33
  }
33
34
  }