@usevyre/react 0.1.2 → 0.2.0
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/Breadcrumb/Breadcrumb.d.ts +10 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +2 -2
- package/dist/index.js +333 -324
- package/package.json +2 -2
|
@@ -36,3 +36,13 @@ export interface BreadcrumbItemProps {
|
|
|
36
36
|
}
|
|
37
37
|
export declare const Breadcrumb: React.FC<BreadcrumbProps>;
|
|
38
38
|
export declare const BreadcrumbItem: React.FC<BreadcrumbItemProps>;
|
|
39
|
+
export interface BreadcrumbLinkProps {
|
|
40
|
+
children: React.ReactNode;
|
|
41
|
+
href: string;
|
|
42
|
+
className?: string;
|
|
43
|
+
}
|
|
44
|
+
export declare const BreadcrumbLink: React.FC<BreadcrumbLinkProps>;
|
|
45
|
+
export declare const BreadcrumbSeparator: React.FC<{
|
|
46
|
+
children?: React.ReactNode;
|
|
47
|
+
className?: string;
|
|
48
|
+
}>;
|
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),n=require("react"),H=require("react-dom");function v(...e){const a=[];for(const r of e)if(r){if(typeof r=="string")a.push(r);else if(Array.isArray(r)){const s=v(...r);s&&a.push(s)}else if(typeof r=="object")for(const[s,o]of Object.entries(r))o&&a.push(s)}return a.join(" ")}const Gt={primary:"vyre-btn--primary",secondary:"vyre-btn--secondary",ghost:"vyre-btn--ghost",accent:"vyre-btn--accent",teal:"vyre-btn--teal",danger:"vyre-btn--danger"},Xt={sm:"vyre-btn--sm",md:"vyre-btn--md",lg:"vyre-btn--lg",icon:"vyre-btn--icon"},ue=n.forwardRef(({variant:e="secondary",size:a="md",loading:r=!1,disabled:s,leftIcon:o,rightIcon:i,className:d,children:l,as:c="button",...x},b)=>{const y=s||r;return t.jsxs(c,{ref:b,className:v("vyre-btn",Gt[e],Xt[a],r&&"vyre-btn--loading",d),disabled:c==="button"?y:void 0,"aria-disabled":y,"data-variant":e,"data-size":a,...x,children:[r&&t.jsx("span",{className:"vyre-btn__spinner","aria-hidden":"true",children:t.jsx(zt,{})}),!r&&o&&t.jsx("span",{className:"vyre-btn__icon vyre-btn__icon--left","aria-hidden":"true",children:o}),l&&t.jsx("span",{className:"vyre-btn__label",children:l}),i&&t.jsx("span",{className:"vyre-btn__icon vyre-btn__icon--right","aria-hidden":"true",children:i})]})});ue.displayName="VyreButton";function zt(){return t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"vyre-spinner","aria-hidden":"true",children:t.jsx("circle",{cx:"7",cy:"7",r:"5.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeDasharray:"28",strokeDashoffset:"10"})})}const me=n.forwardRef(({variant:e="default",dot:a=!1,className:r,children:s,...o},i)=>t.jsxs("span",{ref:i,className:v("vyre-badge",`vyre-badge--${e}`,r),"data-variant":e,...o,children:[a&&t.jsx("span",{className:"vyre-badge__dot","aria-hidden":"true"}),s]}));me.displayName="VyreBadge";const ve=n.forwardRef(({variant:e="default",hoverable:a=!1,clickable:r=!1,className:s,children:o,...i},d)=>t.jsx("div",{ref:d,className:v("vyre-card",`vyre-card--${e}`,a&&"vyre-card--hoverable",r&&"vyre-card--clickable",s),"data-variant":e,role:r?"button":void 0,tabIndex:r?0:void 0,...i,children:o}));ve.displayName="VyreCard";const ye=n.forwardRef(({className:e,children:a,...r},s)=>t.jsx("div",{ref:s,className:v("vyre-card__header",e),...r,children:a}));ye.displayName="VyreCardHeader";const fe=n.forwardRef(({className:e,children:a,...r},s)=>t.jsx("div",{ref:s,className:v("vyre-card__body",e),...r,children:a}));fe.displayName="VyreCardBody";const he=n.forwardRef(({className:e,children:a,...r},s)=>t.jsx("div",{ref:s,className:v("vyre-card__footer",e),...r,children:a}));he.displayName="VyreCardFooter";const be=n.forwardRef(({label:e,hint:a,state:r="idle",required:s=!1,htmlFor:o,className:i,children:d,...l},c)=>t.jsxs("div",{ref:c,className:v("vyre-field",r!=="idle"&&`vyre-field--${r}`,i),"data-state":r,...l,children:[e&&t.jsxs("label",{className:"vyre-field__label",htmlFor:o,children:[e,s&&t.jsx("span",{className:"vyre-field__required","aria-label":"required",children:"*"})]}),d,a&&t.jsx("span",{className:"vyre-field__hint",role:r==="error"?"alert":void 0,children:a})]}));be.displayName="VyreField";const xe=n.forwardRef(({size:e="md",leftElement:a,rightElement:r,className:s,...o},i)=>a||r?t.jsxs("div",{className:v("vyre-input-wrapper",`vyre-input-wrapper--${e}`),children:[a&&t.jsx("span",{className:"vyre-input__element vyre-input__element--left","aria-hidden":"true",children:a}),t.jsx("input",{ref:i,className:v("vyre-input",`vyre-input--${e}`,!!a&&"vyre-input--has-left",!!r&&"vyre-input--has-right",s),...o}),r&&t.jsx("span",{className:"vyre-input__element vyre-input__element--right","aria-hidden":"true",children:r})]}):t.jsx("input",{ref:i,className:v("vyre-input",`vyre-input--${e}`,s),...o}));xe.displayName="VyreInput";const pe=n.forwardRef(({size:e="md",resize:a="vertical",className:r,style:s,...o},i)=>t.jsx("textarea",{ref:i,className:v("vyre-textarea",`vyre-textarea--${e}`,r),style:{resize:a,...s},...o}));pe.displayName="VyreTextarea";const Zt=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(","),_e=n.forwardRef(({open:e,onClose:a,size:r="md",closeOnBackdrop:s=!0,closeOnEsc:o=!0,initialFocus:i,className:d,children:l,"aria-label":c,"aria-labelledby":x,...b},y)=>{const f=n.useRef(null),p=n.useRef(null),u=n.useCallback(h=>{f.current=h,typeof y=="function"?y(h):y&&(y.current=h)},[y]),m=n.useCallback(h=>{if(h.key!=="Tab")return;const g=f.current;if(!g)return;const N=Array.from(g.querySelectorAll(Zt));if(!N.length)return;const T=N[0],E=N[N.length-1];h.shiftKey&&document.activeElement===T?(h.preventDefault(),E.focus()):!h.shiftKey&&document.activeElement===E&&(h.preventDefault(),T.focus())},[]),_=n.useCallback(h=>{h.key==="Escape"&&o&&a()},[o,a]);return n.useEffect(()=>{if(!e)return;document.addEventListener("keydown",_),document.addEventListener("keydown",m);const h=document.body.style.overflow;document.body.style.overflow="hidden";const g=setTimeout(()=>{var N;i!=null&&i.current?i.current.focus():(N=f.current)==null||N.focus()},0);return()=>{document.removeEventListener("keydown",_),document.removeEventListener("keydown",m),document.body.style.overflow=h,clearTimeout(g)}},[e,_,m,i]),e?H.createPortal(t.jsx("div",{ref:p,className:"vyre-modal-backdrop",onClick:h=>{s&&h.target===p.current&&a()},role:"presentation",children:t.jsx("div",{ref:u,className:v("vyre-modal",`vyre-modal--${r}`,d),role:"dialog","aria-modal":"true","aria-label":c,"aria-labelledby":x,tabIndex:-1,...b,children:l})}),document.body):null});_e.displayName="VyreModal";const we=n.forwardRef(({className:e,children:a,...r},s)=>t.jsx("div",{ref:s,className:v("vyre-modal__header",e),...r,children:a}));we.displayName="VyreModalHeader";const je=n.forwardRef(({className:e,children:a,...r},s)=>t.jsx("div",{ref:s,className:v("vyre-modal__body",e),...r,children:a}));je.displayName="VyreModalBody";const ge=n.forwardRef(({className:e,children:a,...r},s)=>t.jsx("div",{ref:s,className:v("vyre-modal__footer",e),...r,children:a}));ge.displayName="VyreModalFooter";const ke=n.createContext(null);function Jt(e,a){switch(a.type){case"ADD":return[...e,a.payload];case"REMOVE":return e.filter(r=>r.id!==a.id);default:return e}}let Qt=0;const er=()=>`vyre-t-${++Qt}`;function tr({children:e}){const[a,r]=n.useReducer(Jt,[]),s=n.useCallback(i=>{const d=er();return r({type:"ADD",payload:{...i,id:d}}),d},[]),o=n.useCallback(i=>{r({type:"REMOVE",id:i})},[]);return t.jsxs(ke.Provider,{value:{toast:s,dismiss:o},children:[e,typeof document<"u"&&H.createPortal(t.jsx("div",{className:"vyre-toast-viewport","aria-live":"polite","aria-atomic":"false","aria-label":"Notifications",children:a.map(i=>t.jsx(ar,{...i,onDismiss:()=>o(i.id)},i.id))}),document.body)]})}function rr(){const e=n.useContext(ke);if(!e)throw new Error("useToast must be used inside <ToastProvider>");return e}function ar({title:e,description:a,variant:r="default",duration:s=4e3,onDismiss:o}){return n.useEffect(()=>{if(s===1/0)return;const i=setTimeout(o,s);return()=>clearTimeout(i)},[s,o]),t.jsxs("div",{className:v("vyre-toast",`vyre-toast--${r}`),role:"alert","data-variant":r,children:[t.jsxs("div",{className:"vyre-toast__content",children:[e&&t.jsx("p",{className:"vyre-toast__title",children:e}),a&&t.jsx("p",{className:"vyre-toast__description",children:a})]}),t.jsx("button",{className:"vyre-toast__close",onClick:o,"aria-label":"Dismiss notification",type:"button",children:t.jsx(nr,{})})]})}function nr(){return t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M10.5 3.5L3.5 10.5M3.5 3.5L10.5 10.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}const Ne=n.forwardRef(({options:e,value:a,defaultValue:r,onChange:s,placeholder:o="Select an option",disabled:i=!1,size:d="md",className:l,...c},x)=>{const b=a!==void 0,[y,f]=n.useState(r??""),p=b?a:y,[u,m]=n.useState(!1),[_,h]=n.useState(-1),g=n.useRef(null),N=n.useRef(null),E=`${n.useId()}-listbox`,W=e.find(j=>j.value===p),V=e.filter(j=>!j.disabled),B=n.useCallback(()=>{m(!1),h(-1)},[]),L=n.useCallback(j=>{var S;j.disabled||(b||f(j.value),s==null||s(j.value),B(),(S=g.current)==null||S.focus())},[b,s,B]);n.useEffect(()=>{if(!u)return;const j=S=>{const R=x==null?void 0:x.current;R&&!R.contains(S.target)&&B()};return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[u,x,B]),n.useEffect(()=>{var S;if(!u||_<0)return;const j=(S=N.current)==null?void 0:S.children[_];j==null||j.scrollIntoView({block:"nearest"})},[_,u]);const I=j=>{switch(j.key){case"Enter":case" ":case"ArrowDown":{if(j.preventDefault(),!u){m(!0);const S=e.findIndex(R=>R.value===p);h(S>=0?S:0)}break}case"ArrowUp":{j.preventDefault(),u||(m(!0),h(e.length-1));break}case"Escape":{B();break}}},C=j=>{var S;switch(j.key){case"ArrowDown":{j.preventDefault(),h(R=>{let M=R+1;for(;M<e.length&&e[M].disabled;)M++;return M<e.length?M:R});break}case"ArrowUp":{j.preventDefault(),h(R=>{let M=R-1;for(;M>=0&&e[M].disabled;)M--;return M>=0?M:R});break}case"Enter":case" ":{j.preventDefault(),_>=0&&L(e[_]);break}case"Escape":case"Tab":{B(),(S=g.current)==null||S.focus();break}case"Home":{j.preventDefault();const R=e.findIndex(M=>!M.disabled);R>=0&&h(R);break}case"End":{j.preventDefault();const R=[...e].reverse().findIndex(M=>!M.disabled);R>=0&&h(e.length-1-R);break}}};return t.jsxs("div",{ref:x,className:v("vyre-select",`vyre-select--${d}`,l),"data-open":u,...c,children:[t.jsxs("button",{ref:g,type:"button",className:"vyre-select__trigger","aria-haspopup":"listbox","aria-expanded":u,"aria-controls":E,"aria-disabled":i,disabled:i,onClick:()=>{i||m(j=>{if(!j){const S=e.findIndex(R=>R.value===p);h(S>=0?S:0)}return!j})},onKeyDown:I,children:[W?t.jsx("span",{className:"vyre-select__value",children:W.label}):t.jsx("span",{className:"vyre-select__placeholder",children:o}),t.jsx(sr,{})]}),u&&t.jsxs("ul",{ref:N,id:E,role:"listbox",className:"vyre-select__dropdown","aria-label":"Options",tabIndex:-1,onKeyDown:C,children:[e.map((j,S)=>t.jsxs("li",{role:"option","aria-selected":j.value===p,"aria-disabled":j.disabled,"data-highlighted":S===_,className:"vyre-select__option",onMouseEnter:()=>!j.disabled&&h(S),onMouseDown:R=>{R.preventDefault(),L(j)},children:[j.label,j.value===p&&t.jsx(or,{})]},j.value)),V.length===0&&t.jsx("li",{className:"vyre-select__empty",role:"presentation",children:"No options available"})]})]})});Ne.displayName="VyreSelect";function sr(){return t.jsx("svg",{className:"vyre-select__chevron",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M3 5L7 9L11 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function or(){return t.jsx("svg",{className:"vyre-select__check",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M2.5 7L5.5 10L11.5 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const Ce=n.createContext(null);function Se(){const e=n.useContext(Ce);if(!e)throw new Error("Tab components must be used inside <Tabs>");return e}const Re=n.forwardRef(({defaultValue:e="",value:a,onChange:r,className:s,children:o,...i},d)=>{const l=a!==void 0,[c,x]=n.useState(e),b=l?a:c,y=n.useId(),f=n.useCallback(p=>{l||x(p),r==null||r(p)},[l,r]);return t.jsx(Ce.Provider,{value:{value:b,onChange:f,baseId:y},children:t.jsx("div",{ref:d,className:v("vyre-tabs",s),...i,children:o})})});Re.displayName="VyreTabs";const Le=n.forwardRef(({className:e,children:a,"aria-label":r,...s},o)=>{const i=n.useRef(null),d=l=>{var y;const c=Array.from(((y=i.current)==null?void 0:y.querySelectorAll('[role="tab"]:not([disabled])'))??[]),x=c.findIndex(f=>f===document.activeElement);if(x<0)return;let b=x;if(l.key==="ArrowRight")b=(x+1)%c.length;else if(l.key==="ArrowLeft")b=(x-1+c.length)%c.length;else if(l.key==="Home")b=0;else if(l.key==="End")b=c.length-1;else return;l.preventDefault(),c[b].focus(),c[b].click()};return t.jsx("div",{ref:l=>{i.current=l,typeof o=="function"?o(l):o&&(o.current=l)},role:"tablist",className:v("vyre-tabs__list",e),"aria-label":r,onKeyDown:d,...s,children:a})});Le.displayName="VyreTabList";const Me=n.forwardRef(({value:e,disabled:a=!1,className:r,children:s,...o},i)=>{const{value:d,onChange:l,baseId:c}=Se(),x=e===d;return t.jsx("button",{ref:i,role:"tab",type:"button",id:`${c}-tab-${e}`,"aria-controls":`${c}-panel-${e}`,"aria-selected":x,disabled:a,tabIndex:x?0:-1,className:v("vyre-tabs__tab",x&&"vyre-tabs__tab--active",r),"data-selected":x,onClick:()=>!a&&l(e),...o,children:s})});Me.displayName="VyreTab";const Te=n.forwardRef(({className:e,children:a,...r},s)=>t.jsx("div",{ref:s,className:v("vyre-tabs__panels",e),...r,children:a}));Te.displayName="VyreTabPanels";const Ee=n.forwardRef(({value:e,className:a,children:r,...s},o)=>{const{value:i,baseId:d}=Se();return e===i?t.jsx("div",{ref:o,role:"tabpanel",id:`${d}-panel-${e}`,"aria-labelledby":`${d}-tab-${e}`,tabIndex:0,className:v("vyre-tabs__panel",a),...s,children:r}):null});Ee.displayName="VyreTabPanel";const ir=120,Ie=({content:e,placement:a="top",delay:r=300,children:s,className:o})=>{const[i,d]=n.useState("hidden"),l=n.useRef(null),c=n.useRef(null),x=n.useId(),b=n.useCallback(()=>{c.current&&(clearTimeout(c.current),c.current=null),l.current=setTimeout(()=>d("visible"),r)},[r]),y=n.useCallback(()=>{l.current&&(clearTimeout(l.current),l.current=null),d("leaving"),c.current=setTimeout(()=>d("hidden"),ir)},[]),f=n.Children.only(s),p=n.cloneElement(f,{onMouseEnter:u=>{var m,_;b(),(_=(m=f.props).onMouseEnter)==null||_.call(m,u)},onMouseLeave:u=>{var m,_;y(),(_=(m=f.props).onMouseLeave)==null||_.call(m,u)},onFocus:u=>{var m,_;d("visible"),(_=(m=f.props).onFocus)==null||_.call(m,u)},onBlur:u=>{var m,_;y(),(_=(m=f.props).onBlur)==null||_.call(m,u)},"aria-describedby":i!=="hidden"?x:void 0});return t.jsxs("span",{className:v("vyre-tooltip-wrapper",o),children:[p,i!=="hidden"&&t.jsxs("span",{id:x,role:"tooltip",className:v("vyre-tooltip",`vyre-tooltip--${a}`,i==="leaving"&&"vyre-tooltip--leaving"),"data-placement":a,children:[e,t.jsx("span",{className:"vyre-tooltip__arrow","aria-hidden":"true"})]})]})};Ie.displayName="VyreTooltip";const De=n.createContext(null);function Ae(){const e=n.useContext(De);if(!e)throw new Error("AccordionItem must be used within Accordion");return e}const Be=n.forwardRef(({type:e="single",defaultValue:a,value:r,onValueChange:s,className:o,children:i,...d},l)=>{const c=p=>p===void 0?[]:Array.isArray(p)?p:[p],[x,b]=n.useState(c(a)),y=r!==void 0?c(r):x,f=n.useCallback(p=>{let u;e==="single"?u=y.includes(p)?[]:[p]:u=y.includes(p)?y.filter(m=>m!==p):[...y,p],r===void 0&&b(u),s==null||s(e==="single"?u[0]??"":u)},[e,y,r,s]);return t.jsx(De.Provider,{value:{type:e,value:y,toggle:f},children:t.jsx("div",{ref:l,className:["vyre-accordion",o].filter(Boolean).join(" "),...d,children:i})})});Be.displayName="Accordion";const ne=n.createContext(null),Ve=n.forwardRef(({value:e,className:a,children:r,...s},o)=>{const{value:i}=Ae(),d=i.includes(e);return t.jsx(ne.Provider,{value:{itemValue:e,isOpen:d},children:t.jsx("div",{ref:o,"data-state":d?"open":"closed",className:["vyre-accordion__item",a].filter(Boolean).join(" "),...s,children:r})})});Ve.displayName="AccordionItem";const $e=n.forwardRef(({className:e,children:a,...r},s)=>{const{toggle:o}=Ae(),i=n.useContext(ne);if(!i)throw new Error("AccordionTrigger must be used within AccordionItem");const{itemValue:d,isOpen:l}=i;return t.jsxs("button",{ref:s,type:"button","aria-expanded":l,"data-state":l?"open":"closed",className:["vyre-accordion__trigger",e].filter(Boolean).join(" "),onClick:()=>o(d),...r,children:[t.jsx("span",{className:"vyre-accordion__trigger-text",children:a}),t.jsx("svg",{className:"vyre-accordion__chevron",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M4 6l4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]})});$e.displayName="AccordionTrigger";const We=n.forwardRef(({className:e,children:a,...r},s)=>{const o=n.useContext(ne);if(!o)throw new Error("AccordionContent must be used within AccordionItem");const{isOpen:i}=o;return t.jsx("div",{ref:s,hidden:!i,"data-state":i?"open":"closed",className:["vyre-accordion__content",e].filter(Boolean).join(" "),...r,children:t.jsx("div",{className:"vyre-accordion__content-inner",children:a})})});We.displayName="AccordionContent";const He=n.forwardRef(({src:e,alt:a="",fallback:r,size:s="md",status:o,className:i,...d},l)=>{var y;const[c,x]=n.useState(!1),b=e&&!c;return t.jsxs("span",{ref:l,"data-size":s,className:["vyre-avatar",i].filter(Boolean).join(" "),...d,children:[b?t.jsx("img",{src:e,alt:a,className:"vyre-avatar__img",onError:()=>x(!0)}):t.jsx("span",{className:"vyre-avatar__fallback","aria-label":a||r,children:r??((y=a==null?void 0:a.charAt(0))==null?void 0:y.toUpperCase())??"?"}),o&&t.jsx("span",{className:`vyre-avatar__status vyre-avatar__status--${o}`,"aria-label":o})]})});He.displayName="Avatar";const Fe=n.forwardRef(({checked:e,defaultChecked:a,indeterminate:r=!1,onCheckedChange:s,disabled:o,size:i="md",className:d,id:l,...c},x)=>{const b=n.useRef(null),y=x??b;return n.useEffect(()=>{y.current&&(y.current.indeterminate=r)},[r,y]),t.jsxs("span",{className:["vyre-checkbox",`vyre-checkbox--${i}`,d].filter(Boolean).join(" "),"data-disabled":o||void 0,"data-checked":e||void 0,"data-indeterminate":r||void 0,children:[t.jsx("input",{ref:y,type:"checkbox",id:l,checked:e,defaultChecked:a,disabled:o,className:"vyre-checkbox__input",onChange:f=>s==null?void 0:s(f.target.checked),...c}),t.jsx("span",{className:"vyre-checkbox__box","aria-hidden":"true",children:r?t.jsx("svg",{width:"10",height:"2",viewBox:"0 0 10 2",fill:"none",children:t.jsx("path",{d:"M1 1h8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})}):t.jsx("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",children:t.jsx("path",{d:"M1 4l3 3 5-6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})})]})});Fe.displayName="Checkbox";const Pe=n.forwardRef(({checked:e,defaultChecked:a=!1,onCheckedChange:r,disabled:s,size:o="md",className:i,...d},l)=>{const[c,x]=n.useState(a),b=e!==void 0?e:c,y=()=>{if(s)return;const f=!b;e===void 0&&x(f),r==null||r(f)};return t.jsx("button",{ref:l,type:"button",role:"switch","aria-checked":b,disabled:s,"data-checked":b||void 0,"data-size":o,className:["vyre-switch",i].filter(Boolean).join(" "),onClick:y,...d,children:t.jsx("span",{className:"vyre-switch__thumb"})})});Pe.displayName="Switch";const qe=n.forwardRef(({value:e,defaultValue:a=0,min:r=0,max:s=100,step:o=1,onValueChange:i,disabled:d,size:l="md",className:c,style:x,...b},y)=>{const[f,p]=n.useState(a),u=e!==void 0?e:f,m=(u-r)/(s-r)*100;return t.jsxs("div",{className:["vyre-slider",`vyre-slider--${l}`,c].filter(Boolean).join(" "),"data-disabled":d||void 0,style:{"--vyre-slider-pct":`${m}%`,...x},children:[t.jsx("input",{ref:y,type:"range",min:r,max:s,step:o,value:u,disabled:d,className:"vyre-slider__input",onChange:_=>{const h=Number(_.target.value);e===void 0&&p(h),i==null||i(h)},...b}),t.jsxs("div",{className:"vyre-slider__track",children:[t.jsx("div",{className:"vyre-slider__fill",style:{width:`${m}%`}}),t.jsx("div",{className:"vyre-slider__thumb",style:{left:`${m}%`}})]})]})});qe.displayName="Slider";const Oe=n.forwardRef(({value:e,max:a=100,indeterminate:r=!1,size:s="md",variant:o="default",className:i,...d},l)=>{const c=r?void 0:Math.min(100,Math.max(0,(e??0)/a*100));return t.jsx("div",{ref:l,role:"progressbar","aria-valuemin":0,"aria-valuemax":a,"aria-valuenow":r?void 0:e??0,"data-size":s,"data-variant":o,"data-indeterminate":r||void 0,className:["vyre-progress",i].filter(Boolean).join(" "),...d,children:t.jsx("div",{className:"vyre-progress__bar",style:c!==void 0?{width:`${c}%`}:void 0})})});Oe.displayName="Progress";const Ke=n.forwardRef(({orientation:e="horizontal",decorative:a=!0,className:r,...s},o)=>t.jsx("div",{ref:o,role:a?"none":"separator","aria-orientation":a?void 0:e,"data-orientation":e,className:["vyre-separator",r].filter(Boolean).join(" "),...s}));Ke.displayName="Separator";const Ye=n.forwardRef(({required:e,disabled:a,className:r,children:s,...o},i)=>t.jsxs("label",{ref:i,"data-required":e||void 0,"data-disabled":a||void 0,className:["vyre-label",r].filter(Boolean).join(" "),...o,children:[s,e&&t.jsx("span",{className:"vyre-label__required","aria-hidden":"true",children:"*"})]}));Ye.displayName="Label";const Ue=n.forwardRef(({variant:e="rect",width:a,height:r,className:s,style:o,...i},d)=>t.jsx("div",{ref:d,"aria-hidden":"true","data-variant":e,className:["vyre-skeleton",s].filter(Boolean).join(" "),style:{width:typeof a=="number"?`${a}px`:a,height:typeof r=="number"?`${r}px`:r,...o},...i}));Ue.displayName="Skeleton";const Q=8,lr=120;function cr(e){const[a,r]=e.split("-");return{side:a,align:r??"center"}}function dr(e,a,r,s,o,i){const d=e.width,l=e.height,c=a.width,x=a.height,b=e.left+o,y=e.top+i;let f=0,p=0;switch(r){case"top":f=y-x-Q;break;case"bottom":f=y+l+Q;break;case"left":p=b-c-Q;break;case"right":p=b+d+Q;break}if(r==="top"||r==="bottom")switch(s){case"start":p=b;break;case"center":p=b+d/2-c/2;break;case"end":p=b+d-c;break}else switch(s){case"start":f=y;break;case"center":f=y+l/2-x/2;break;case"end":f=y+l-x;break}return{top:f,left:p}}const Ge=({trigger:e,children:a,open:r,onOpenChange:s,placement:o="bottom",closeOnOutside:i=!0,className:d})=>{const l=r!==void 0,[c,x]=n.useState(!1),[b,y]=n.useState(!1),[f,p]=n.useState(!1),[u,m]=n.useState({top:0,left:0}),_=l?r:c,h=n.useRef(null),g=n.useRef(null),N=n.useRef(null),T=n.useId(),{side:E,align:W}=cr(o),V=n.useCallback(C=>{l||x(C),s==null||s(C)},[l,s]),B=n.useCallback(()=>V(!_),[_,V]),L=n.useCallback(()=>{y(!0),N.current=setTimeout(()=>{y(!1),p(!1),V(!1)},lr)},[V]);n.useEffect(()=>{_?(N.current&&(clearTimeout(N.current),N.current=null),y(!1),p(!0)):f&&!b&&L()},[_]),n.useEffect(()=>{if(!f||!h.current||!g.current)return;const C=h.current.getBoundingClientRect(),j=g.current.getBoundingClientRect(),S=dr(C,j,E,W,window.scrollX,window.scrollY);m(S)},[f,E,W]),n.useEffect(()=>{if(!f||!i)return;const C=j=>{g.current&&!g.current.contains(j.target)&&h.current&&!h.current.contains(j.target)&&L()};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[f,i,L]),n.useEffect(()=>{if(!f)return;const C=j=>{j.key==="Escape"&&L()};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[f,L]);const I=n.cloneElement(e,{ref:h,onClick:C=>{var j,S;B(),(S=(j=e.props).onClick)==null||S.call(j,C)},"aria-expanded":_,"aria-controls":T,"aria-haspopup":"dialog"});return t.jsxs(t.Fragment,{children:[I,f&&H.createPortal(t.jsx("div",{ref:g,id:T,role:"dialog","aria-modal":"false",className:v("vyre-popover",`vyre-popover--${E}`,b&&"vyre-popover--leaving",d),style:{top:u.top,left:u.left},children:a}),document.body)]})};Ge.displayName="VyrePopover";const ee=n.createContext(null),Xe=n.createContext(null),ur=120,ze=({trigger:e,children:a,placement:r="bottom-start",className:s})=>{const[o,i]=n.useState(!1),[d,l]=n.useState(!1),[c,x]=n.useState(!1),[b,y]=n.useState({top:0,left:0}),[f,p]=n.useState(-1),u=n.useRef(null),m=n.useRef(null),_=n.useRef(null),h=n.useId(),g=n.useCallback(()=>{var L;return Array.from(((L=m.current)==null?void 0:L.querySelectorAll("[role=menuitem]:not([aria-disabled=true]):not([disabled]),[role=menuitemcheckbox]:not([aria-disabled=true]):not([disabled]),[role=menuitemradio]:not([aria-disabled=true]):not([disabled])"))??[])},[]),N=n.useCallback(()=>{l(!0),_.current=setTimeout(()=>{var L;l(!1),x(!1),i(!1),p(-1),(L=u.current)==null||L.focus({preventScroll:!0})},ur)},[]),T=n.useCallback(()=>{_.current&&(clearTimeout(_.current),_.current=null),l(!1),i(!0),x(!0)},[]),E=n.useCallback(()=>{o?N():T()},[o,T,N]);n.useEffect(()=>{if(!c||!u.current)return;const L=u.current.getBoundingClientRect(),I=4,C=window.scrollX,j=window.scrollY;let S=0,R=0;r.startsWith("bottom")?(S=L.bottom+j+I,R=r==="bottom-start"?L.left+C:L.right+C):(S=L.top+j-I,R=r==="top-start"?L.left+C:L.right+C),y({top:S,left:R}),requestAnimationFrame(()=>{var P;(P=g()[0])==null||P.focus({preventScroll:!0}),p(0)})},[c,r,g]),n.useEffect(()=>{if(!c)return;const L=C=>{m.current&&!m.current.contains(C.target)&&u.current&&!u.current.contains(C.target)&&N()},I=C=>{var j,S,R;if(C.key==="Escape"){N();return}if(C.key==="ArrowDown"||C.key==="ArrowUp"){C.preventDefault();const M=g();if(!M.length)return;const P=C.key==="ArrowDown"?1:-1,Z=(f+P+M.length)%M.length;(j=M[Z])==null||j.focus({preventScroll:!0}),p(Z)}if(C.key==="Home"&&((S=g()[0])==null||S.focus({preventScroll:!0}),p(0)),C.key==="End"){const M=g();(R=M[M.length-1])==null||R.focus({preventScroll:!0}),p(M.length-1)}};return document.addEventListener("mousedown",L),document.addEventListener("keydown",I),()=>{document.removeEventListener("mousedown",L),document.removeEventListener("keydown",I)}},[c,f,N,g]);const W=n.cloneElement(e,{ref:u,onClick:L=>{var I,C;E(),(C=(I=e.props).onClick)==null||C.call(I,L)},"aria-expanded":o,"aria-haspopup":"menu","aria-controls":h}),V=r.endsWith("-end"),B=r.startsWith("top");return t.jsxs(ee.Provider,{value:{close:N},children:[W,c&&H.createPortal(t.jsx("div",{ref:m,id:h,role:"menu","aria-orientation":"vertical",className:v("vyre-dropdown",V&&"vyre-dropdown--end",B&&"vyre-dropdown--top",d&&"vyre-dropdown--leaving",s),style:{top:b.top,left:b.left,transform:V?"translateX(-100%)":void 0},children:a}),document.body)]})};ze.displayName="VyreDropdownMenu";const Ze=({children:e,className:a})=>t.jsx("div",{className:v("vyre-dropdown__label",a),children:e});Ze.displayName="VyreDropdownLabel";const Je=({children:e,onSelect:a,disabled:r=!1,variant:s="default",icon:o,shortcut:i,className:d})=>{const l=n.useContext(ee);return t.jsxs("button",{role:"menuitem",className:v("vyre-dropdown__item",s==="danger"&&"vyre-dropdown__item--danger",d),"aria-disabled":r||void 0,disabled:r,tabIndex:-1,onClick:()=>{r||(a==null||a(),l==null||l.close())},children:[o&&t.jsx("span",{className:"vyre-dropdown__item-icon","aria-hidden":"true",children:o}),t.jsx("span",{className:"vyre-dropdown__item-label",children:e}),i&&t.jsx("kbd",{className:"vyre-dropdown__item-shortcut",children:i})]})};Je.displayName="VyreDropdownItem";const Qe=({children:e,checked:a,onCheckedChange:r,disabled:s=!1,shortcut:o,className:i})=>{const d=n.useContext(ee);return t.jsxs("button",{role:"menuitemcheckbox","aria-checked":a,"aria-disabled":s||void 0,disabled:s,tabIndex:-1,className:v("vyre-dropdown__item vyre-dropdown__item--checkbox",i),onClick:()=>{s||(r(!a),d==null||d.close())},children:[t.jsx("span",{className:"vyre-dropdown__item-indicator","aria-hidden":"true",children:a&&t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:t.jsx("path",{d:"M2 6l3 3 5-5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}),t.jsx("span",{className:"vyre-dropdown__item-label",children:e}),o&&t.jsx("kbd",{className:"vyre-dropdown__item-shortcut",children:o})]})};Qe.displayName="VyreDropdownCheckboxItem";const et=({value:e,onValueChange:a,children:r})=>t.jsx(Xe.Provider,{value:{value:e,onValueChange:a},children:t.jsx("div",{role:"group",children:r})});et.displayName="VyreDropdownRadioGroup";const tt=({children:e,value:a,disabled:r=!1,className:s})=>{const o=n.useContext(ee),i=n.useContext(Xe),d=(i==null?void 0:i.value)===a;return t.jsxs("button",{role:"menuitemradio","aria-checked":d,"aria-disabled":r||void 0,disabled:r,tabIndex:-1,className:v("vyre-dropdown__item vyre-dropdown__item--radio",s),onClick:()=>{r||(i==null||i.onValueChange(a),o==null||o.close())},children:[t.jsx("span",{className:"vyre-dropdown__item-indicator","aria-hidden":"true",children:d&&t.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",children:t.jsx("circle",{cx:"4",cy:"4",r:"3",fill:"currentColor"})})}),t.jsx("span",{className:"vyre-dropdown__item-label",children:e})]})};tt.displayName="VyreDropdownRadioItem";const rt=({trigger:e,children:a,icon:r,placement:s="right",disabled:o=!1,className:i})=>{const[d,l]=n.useState(!1),[c,x]=n.useState({top:0,left:0}),b=n.useRef(null),y=n.useRef(null),f=n.useCallback(()=>{if(!b.current)return;const m=b.current.getBoundingClientRect(),_=window.scrollX,h=window.scrollY,g=2;x({top:m.top+h,left:s==="right"?m.right+_+g:m.left+_-g}),l(!0)},[s]),p=n.useCallback(()=>l(!1),[]),u=m=>{var h;const _=m.relatedTarget;(h=y.current)!=null&&h.contains(_)||p()};return t.jsxs(t.Fragment,{children:[t.jsxs("button",{ref:b,role:"menuitem","aria-haspopup":"menu","aria-expanded":d,"aria-disabled":o||void 0,disabled:o,tabIndex:-1,className:v("vyre-dropdown__item vyre-dropdown__item--sub",i),onMouseEnter:f,onMouseLeave:u,onFocus:f,children:[r&&t.jsx("span",{className:"vyre-dropdown__item-icon","aria-hidden":"true",children:r}),t.jsx("span",{className:"vyre-dropdown__item-label",children:e}),t.jsx("span",{className:"vyre-dropdown__item-chevron","aria-hidden":"true",children:t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:t.jsx("path",{d:s==="right"?"M4 2l4 4-4 4":"M8 2L4 6l4 4",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),d&&H.createPortal(t.jsx("div",{ref:y,role:"menu",className:v("vyre-dropdown vyre-dropdown--sub",s==="left"&&"vyre-dropdown--sub-left"),style:{position:"absolute",top:c.top,left:s==="right"?c.left:void 0,right:s==="left"?`calc(100vw - ${c.left}px)`:void 0,transform:s==="left"?"translateX(-100%)":void 0},onMouseLeave:m=>{var h;const _=m.relatedTarget;(h=b.current)!=null&&h.contains(_)||p()},children:a}),document.body)]})};rt.displayName="VyreDropdownSub";const at=({className:e})=>t.jsx("div",{role:"separator",className:v("vyre-dropdown__separator",e)});at.displayName="VyreDropdownSeparator";const mr=()=>t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.4"}),t.jsx("path",{d:"M8 7v4M8 5v.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),vr=()=>t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.4"}),t.jsx("path",{d:"M5 8l2 2 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),yr=()=>t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[t.jsx("path",{d:"M8 2L14.5 13H1.5L8 2Z",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round"}),t.jsx("path",{d:"M8 6v3M8 11v.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),fr=()=>t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.4"}),t.jsx("path",{d:"M6 6l4 4M10 6l-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),nt={info:mr,success:vr,warning:yr,danger:fr},st=({variant:e="info",title:a,icon:r,onClose:s,children:o,className:i})=>{const d=nt[e];return t.jsxs("div",{role:"alert",className:v("vyre-alert",`vyre-alert--${e}`,i),children:[t.jsx("span",{className:"vyre-alert__icon","aria-hidden":"true",children:r??t.jsx(d,{})}),t.jsxs("div",{className:"vyre-alert__body",children:[a&&t.jsx("p",{className:"vyre-alert__title",children:a}),o&&t.jsx("div",{className:"vyre-alert__description",children:o})]}),s&&t.jsx("button",{type:"button",className:"vyre-alert__close","aria-label":"Dismiss",onClick:s,children:t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M3 3l8 8M11 3l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]})};st.displayName="VyreAlert";const hr=["button:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(","),ot=({open:e,onOpenChange:a,title:r,description:s,variant:o="danger",confirmLabel:i="Confirm",cancelLabel:d="Cancel",onConfirm:l,onCancel:c,className:x})=>{const b=n.useRef(null),y=n.useRef(null),f=n.useRef(null),p=n.useCallback(()=>{c==null||c(),a(!1)},[c,a]),u=n.useCallback(()=>{l==null||l(),a(!1)},[l,a]),m=n.useCallback(h=>{if(h.key!=="Tab")return;const g=b.current;if(!g)return;const N=Array.from(g.querySelectorAll(hr));if(!N.length)return;const T=N[0],E=N[N.length-1];h.shiftKey&&document.activeElement===T?(h.preventDefault(),E.focus()):!h.shiftKey&&document.activeElement===E&&(h.preventDefault(),T.focus())},[]);if(n.useEffect(()=>{if(!e)return;document.addEventListener("keydown",m);const h=document.body.style.overflow;document.body.style.overflow="hidden";const g=N=>{N.key==="Escape"&&p()};return document.addEventListener("keydown",g),setTimeout(()=>{var N;return(N=f.current)==null?void 0:N.focus()},0),()=>{document.removeEventListener("keydown",m),document.removeEventListener("keydown",g),document.body.style.overflow=h}},[e,m,p]),!e)return null;const _=nt[o];return H.createPortal(t.jsx("div",{ref:y,className:"vyre-alert-dialog-backdrop",onClick:h=>{h.target===y.current&&p()},role:"presentation",children:t.jsxs("div",{ref:b,role:"alertdialog","aria-modal":"true","aria-labelledby":"vyre-ad-title","aria-describedby":s?"vyre-ad-desc":void 0,className:v("vyre-alert-dialog",`vyre-alert-dialog--${o}`,x),tabIndex:-1,children:[t.jsx("div",{className:"vyre-alert-dialog__icon-wrap",children:t.jsx("span",{className:v("vyre-alert-dialog__icon",`vyre-alert-dialog__icon--${o}`),children:t.jsx(_,{})})}),t.jsxs("div",{className:"vyre-alert-dialog__body",children:[t.jsx("h2",{id:"vyre-ad-title",className:"vyre-alert-dialog__title",children:r}),s&&t.jsx("p",{id:"vyre-ad-desc",className:"vyre-alert-dialog__description",children:s})]}),t.jsxs("div",{className:"vyre-alert-dialog__footer",children:[t.jsx("button",{ref:f,type:"button",className:"vyre-btn vyre-btn--ghost vyre-btn--sm",onClick:p,children:d}),t.jsx("button",{type:"button",className:v("vyre-btn vyre-btn--sm",o==="danger"&&"vyre-btn--danger",o==="warning"&&"vyre-btn--primary",o==="info"&&"vyre-btn--accent"),onClick:u,children:i})]})]})}),document.body)};ot.displayName="VyreAlertDialog";const br=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(","),it=n.forwardRef(({open:e,onClose:a,side:r="right",size:s="md",closeOnBackdrop:o=!0,closeOnEsc:i=!0,className:d,children:l,"aria-label":c,"aria-labelledby":x,...b},y)=>{const f=n.useRef(null),p=n.useRef(null),u=n.useCallback(m=>{if(m.key!=="Tab")return;const _=f.current;if(!_)return;const h=Array.from(_.querySelectorAll(br));if(!h.length)return;const g=h[0],N=h[h.length-1];m.shiftKey&&document.activeElement===g?(m.preventDefault(),N.focus()):!m.shiftKey&&document.activeElement===N&&(m.preventDefault(),g.focus())},[]);return n.useEffect(()=>{if(!e)return;if(document.addEventListener("keydown",u),i){const _=g=>{g.key==="Escape"&&a()};document.addEventListener("keydown",_);const h=document.body.style.overflow;return document.body.style.overflow="hidden",setTimeout(()=>{var g;return(g=f.current)==null?void 0:g.focus()},0),()=>{document.removeEventListener("keydown",u),document.removeEventListener("keydown",_),document.body.style.overflow=h}}const m=document.body.style.overflow;return document.body.style.overflow="hidden",setTimeout(()=>{var _;return(_=f.current)==null?void 0:_.focus()},0),()=>{document.removeEventListener("keydown",u),document.body.style.overflow=m}},[e,u,i,a]),e?H.createPortal(t.jsx("div",{ref:p,className:"vyre-sheet-backdrop",onClick:m=>{o&&m.target===p.current&&a()},role:"presentation",children:t.jsx("div",{ref:m=>{f.current=m,typeof y=="function"?y(m):y&&(y.current=m)},role:"dialog","aria-modal":"true","aria-label":c,"aria-labelledby":x,tabIndex:-1,className:v("vyre-sheet",`vyre-sheet--${r}`,`vyre-sheet--${s}`,d),...b,children:l})}),document.body):null});it.displayName="VyreSheet";const lt=n.forwardRef(({className:e,children:a,...r},s)=>t.jsx("div",{ref:s,className:v("vyre-sheet__header",e),...r,children:a}));lt.displayName="VyreSheetHeader";const ct=n.forwardRef(({className:e,children:a,...r},s)=>t.jsx("div",{ref:s,className:v("vyre-sheet__body",e),...r,children:a}));ct.displayName="VyreSheetBody";const dt=n.forwardRef(({className:e,children:a,...r},s)=>t.jsx("div",{ref:s,className:v("vyre-sheet__footer",e),...r,children:a}));dt.displayName="VyreSheetFooter";const ut=({children:e,separator:a="/",className:r})=>{const s=n.Children.toArray(e).filter(Boolean);return t.jsx("nav",{"aria-label":"Breadcrumb",className:v("vyre-breadcrumb",r),children:t.jsx("ol",{className:"vyre-breadcrumb__list",children:s.map((o,i)=>t.jsxs("li",{className:"vyre-breadcrumb__item",children:[o,i<s.length-1&&t.jsx("span",{className:"vyre-breadcrumb__separator","aria-hidden":"true",children:a})]},i))})})};ut.displayName="VyreBreadcrumb";const mt=({children:e,href:a,current:r=!1,className:s})=>r||!a?t.jsx("span",{className:v("vyre-breadcrumb__link vyre-breadcrumb__link--current",s),"aria-current":r?"page":void 0,children:e}):t.jsx("a",{href:a,className:v("vyre-breadcrumb__link",s),children:e});mt.displayName="VyreBreadcrumbItem";function le(e,a){return Array.from({length:a-e+1},(r,s)=>e+s)}function xr(e,a,r){const s=r*2+5;if(a<=s)return le(1,a);const o=Math.max(e-r,2),i=Math.min(e+r,a-1),d=o>2,l=i<a-1,c=[1];return d&&c.push("..."),c.push(...le(o,i)),l&&c.push("..."),c.push(a),c}const pr=()=>t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M9 2L4 7l5 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),_r=()=>t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M5 2l5 5-5 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),wr=()=>t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M7 2L2 7l5 5M12 2L7 7l5 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),jr=()=>t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M2 2l5 5-5 5M7 2l5 5-5 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),vt=({page:e,totalPages:a,onPageChange:r,siblings:s=1,showEdges:o=!0,showInfo:i=!1,totalItems:d,pageSize:l,className:c})=>{const x=xr(e,a,s),b=e>1,y=e<a,f=n.useMemo(()=>{if(!i)return null;if(d!=null&&l!=null){const u=(e-1)*l+1,m=Math.min(e*l,d);return`Showing ${u}–${m} of ${d}`}return`Page ${e} of ${a}`},[i,e,a,d,l]),p=t.jsxs(t.Fragment,{children:[o&&t.jsx("button",{className:"vyre-pagination__nav",onClick:()=>r(1),disabled:!b,"aria-label":"First page",children:t.jsx(wr,{})}),t.jsx("button",{className:"vyre-pagination__nav",onClick:()=>r(e-1),disabled:!b,"aria-label":"Previous page",children:t.jsx(pr,{})}),t.jsx("ol",{className:"vyre-pagination__list",children:x.map((u,m)=>u==="..."?t.jsx("li",{children:t.jsx("span",{className:"vyre-pagination__dots","aria-hidden":"true",children:"···"})},`dots-${m}`):t.jsx("li",{children:t.jsx("button",{className:v("vyre-pagination__btn",u===e&&"vyre-pagination__btn--active"),onClick:()=>r(u),"aria-label":`Page ${u}`,"aria-current":u===e?"page":void 0,children:u})},u))}),t.jsx("button",{className:"vyre-pagination__nav",onClick:()=>r(e+1),disabled:!y,"aria-label":"Next page",children:t.jsx(_r,{})}),o&&t.jsx("button",{className:"vyre-pagination__nav",onClick:()=>r(a),disabled:!y,"aria-label":"Last page",children:t.jsx(jr,{})})]});return i?t.jsxs("div",{className:v("vyre-pagination-row",c),children:[t.jsx("span",{className:"vyre-pagination__info",children:f}),t.jsx("nav",{"aria-label":"Pagination",className:"vyre-pagination",children:p})]}):t.jsx("nav",{"aria-label":"Pagination",className:v("vyre-pagination",c),children:p})};vt.displayName="VyrePagination";const yt=({children:e,striped:a=!1,bordered:r=!1,compact:s=!1,hoverable:o=!0,className:i})=>t.jsx("div",{className:"vyre-table-wrapper",children:t.jsx("table",{className:v("vyre-table",a&&"vyre-table--striped",r&&"vyre-table--bordered",s&&"vyre-table--compact",o&&"vyre-table--hoverable",i),children:e})});yt.displayName="VyreTable";const ft=n.forwardRef(({className:e,...a},r)=>t.jsx("thead",{ref:r,className:v("vyre-table__head",e),...a}));ft.displayName="VyreTableHead";const ht=n.forwardRef(({className:e,...a},r)=>t.jsx("tbody",{ref:r,className:v("vyre-table__body",e),...a}));ht.displayName="VyreTableBody";const bt=n.forwardRef(({className:e,selected:a,...r},s)=>t.jsx("tr",{ref:s,className:v("vyre-table__row",a&&"vyre-table__row--selected",e),"aria-selected":a,...r}));bt.displayName="VyreTableRow";const gr=({dir:e})=>t.jsx("span",{className:"vyre-table__sort-icon","aria-hidden":"true",children:t.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:[t.jsx("path",{d:"M6 2v8M3 5l3-3 3 3",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",opacity:e==="desc"?.3:1}),t.jsx("path",{d:"M3 7l3 3 3-3",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",opacity:e==="asc"?.3:1})]})}),xt=n.forwardRef(({className:e,sortable:a,sortDir:r=null,onSort:s,align:o="left",children:i,...d},l)=>a?t.jsx("th",{ref:l,className:v("vyre-table__th vyre-table__th--sortable",`vyre-table__th--${o}`,r&&`vyre-table__th--sort-${r}`,e),"aria-sort":r==="asc"?"ascending":r==="desc"?"descending":"none",...d,children:t.jsxs("button",{className:"vyre-table__sort-btn",onClick:s,type:"button",children:[i,t.jsx(gr,{dir:r})]})}):t.jsx("th",{ref:l,className:v("vyre-table__th",`vyre-table__th--${o}`,e),...d,children:i}));xt.displayName="VyreTableHeader";const pt=n.forwardRef(({className:e,align:a="left",...r},s)=>t.jsx("td",{ref:s,className:v("vyre-table__td",`vyre-table__td--${a}`,e),...r}));pt.displayName="VyreTableCell";const _t=n.forwardRef(({className:e,...a},r)=>t.jsx("caption",{ref:r,className:v("vyre-table__caption",e),...a}));_t.displayName="VyreTableCaption";const wt=n.createContext(null),te=()=>{const e=n.useContext(wt);if(!e)throw new Error("Command components must be used inside <Command>");return e};function ae(e){return e.toLowerCase().replace(/\s+/g," ").trim()}function kr(e,a,r=[]){if(!e)return!0;const s=ae(e);return ae(a).includes(s)||r.some(o=>ae(o).includes(s))}let Nr=0;function Cr(){return`cmd-${++Nr}`}const se=n.forwardRef(({value:e,onValueChange:a,className:r,children:s},o)=>{const[i,d]=n.useState(""),[l,c]=n.useState(0),[x,b]=n.useState(0),y=e!==void 0?e:i,f=n.useCallback(N=>{d(N),a==null||a(N),c(0)},[a]),p=n.useRef(new Map),u=n.useRef(new Map),m=n.useCallback((N,T,E)=>{p.current.set(N,{el:T,disabled:E})},[]),_=n.useCallback(N=>{p.current.delete(N),u.current.delete(N)},[]),h=n.useCallback(N=>{var T;(T=u.current.get(N))==null||T()},[]),g=n.useMemo(()=>({search:y,setSearch:f,activeIndex:l,setActiveIndex:c,items:p,registerItem:m,unregisterItem:_,selectItem:h,onSelectRef:u,visibleCount:x,setVisibleCount:b}),[y,f,l,m,_,h,x]);return t.jsx(wt.Provider,{value:g,children:t.jsx("div",{ref:o,className:v("vyre-command",r),role:"combobox","aria-expanded":"true","aria-haspopup":"listbox",children:s})})});se.displayName="VyreCommand";const jt=n.forwardRef(({placeholder:e="Search...",className:a},r)=>{const{search:s,setSearch:o}=te();return t.jsxs("div",{className:"vyre-command__input-wrapper",children:[t.jsx("svg",{className:"vyre-command__search-icon",width:"15",height:"15",viewBox:"0 0 15 15",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M10 6.5a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0ZM9.5 10.207l3.146 3.147",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})}),t.jsx("input",{ref:r,className:v("vyre-command__input",a),type:"text",placeholder:e,value:s,onChange:i=>o(i.target.value),autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list","aria-controls":"vyre-command-list"}),s&&t.jsx("button",{className:"vyre-command__clear",type:"button","aria-label":"Clear search",onClick:()=>o(""),children:t.jsx("svg",{width:"13",height:"13",viewBox:"0 0 13 13",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M2 2l9 9M11 2l-9 9",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})})]})});jt.displayName="VyreCommandInput";const gt=n.forwardRef(({className:e,children:a},r)=>{const{activeIndex:s,setActiveIndex:o,items:i,selectItem:d}=te(),l=n.useCallback(c=>{var b,y;const x=Array.from((i.current??new Map).entries()).filter(([,f])=>!f.disabled&&f.el.closest("[data-cmd-item]")!==null&&!f.el.hasAttribute("data-cmd-hidden"));if(c.key==="ArrowDown")c.preventDefault(),o(Math.min(s+1,x.length-1)),(b=x[Math.min(s+1,x.length-1)])==null||b[1].el.scrollIntoView({block:"nearest"});else if(c.key==="ArrowUp")c.preventDefault(),o(Math.max(s-1,0)),(y=x[Math.max(s-1,0)])==null||y[1].el.scrollIntoView({block:"nearest"});else if(c.key==="Enter"){c.preventDefault();const[f]=x[s]??[];f&&d(f)}},[s,o,i,d]);return t.jsx("div",{ref:r,id:"vyre-command-list",role:"listbox",className:v("vyre-command__list",e),onKeyDown:l,children:a})});gt.displayName="VyreCommandList";const kt=({className:e,children:a})=>{const{search:r,visibleCount:s}=te();return!r||s>0?null:t.jsx("div",{className:v("vyre-command__empty",e),role:"presentation",children:a??"No results found."})};kt.displayName="VyreCommandEmpty";const Nt=({heading:e,className:a,children:r})=>t.jsxs("div",{className:v("vyre-command__group",a),role:"presentation",children:[e&&t.jsx("div",{className:"vyre-command__group-heading","aria-hidden":"true",children:e}),t.jsx("div",{role:"group","aria-label":e,children:r})]});Nt.displayName="VyreCommandGroup";const Ct=({onSelect:e,disabled:a=!1,keywords:r,className:s,children:o,icon:i,shortcut:d})=>{const{search:l,setActiveIndex:c,registerItem:x,unregisterItem:b,onSelectRef:y,setVisibleCount:f}=te(),p=n.useMemo(()=>Cr(),[]),u=n.useRef(null),_=kr(l,typeof o=="string"?o:"",r);return n.useEffect(()=>(f(h=>h+(_?1:0)),()=>{f(h=>h-(_?1:0))}),[_,f]),n.useEffect(()=>{const h=u.current;if(!(!h||!_))return x(p,h,a),()=>b(p)},[p,a,_,x,b]),n.useEffect(()=>{var h;return e&&((h=y.current)==null||h.set(p,e)),()=>{var g;(g=y.current)==null||g.delete(p)}},[p,e,y]),_?t.jsxs("div",{ref:u,"data-cmd-item":!0,role:"option","aria-disabled":a||void 0,className:v("vyre-command__item",a&&"vyre-command__item--disabled",s),onClick:()=>{a||e==null||e()},onMouseEnter:()=>{!a&&u.current&&c(-1)},children:[i&&t.jsx("span",{className:"vyre-command__item-icon","aria-hidden":"true",children:i}),t.jsx("span",{className:"vyre-command__item-label",children:o}),d&&t.jsx("kbd",{className:"vyre-command__item-shortcut",children:d})]}):null};Ct.displayName="VyreCommandItem";const St=({className:e})=>t.jsx("div",{className:v("vyre-command__separator",e),role:"separator","aria-hidden":"true"});St.displayName="VyreCommandSeparator";const Rt=({open:e,onOpenChange:a,value:r,onValueChange:s,className:o,children:i})=>{const d=n.useRef(null);return n.useEffect(()=>{var x;if(!e)return;const l=document.activeElement,c=(x=d.current)==null?void 0:x.querySelector(".vyre-command__input");return c==null||c.focus(),()=>{l==null||l.focus({preventScroll:!0})}},[e]),n.useEffect(()=>{if(!e)return;const l=c=>{c.key==="Escape"&&a(!1)};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e,a]),e?H.createPortal(t.jsx("div",{className:"vyre-command-backdrop",ref:d,onClick:l=>{l.target===l.currentTarget&&a(!1)},role:"dialog","aria-modal":"true","aria-label":"Command palette",children:t.jsx(se,{value:r,onValueChange:s,className:v("vyre-command--dialog",o),children:i})}),document.body):null};Rt.displayName="VyreCommandDialog";function U(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function F(e,a){return e.getFullYear()===a.getFullYear()&&e.getMonth()===a.getMonth()&&e.getDate()===a.getDate()}function X(e,a){return U(e)<U(a)}function ce(e,a){return U(e)>U(a)}function Sr(e,a){return new Date(e,a+1,0).getDate()}function Rr(e,a,r){return(new Date(e,a,1).getDay()-r+7)%7}function q(e,a){return e?new Intl.DateTimeFormat("default",{year:"numeric",month:"short",day:"numeric"}).format(e):""}function Lr(e){return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`}const de=Array.from({length:12},(e,a)=>new Intl.DateTimeFormat("default",{month:"long"}).format(new Date(2e3,a,1))),z=12,oe=n.forwardRef((e,a)=>{const{showTime:r=!1,minDate:s,maxDate:o,disabled:i,className:d,weekStartsOn:l=1}=e,c=U(new Date),x=()=>{var w,k;return e.mode==="range"?((w=e.value)==null?void 0:w[0])??c:e.mode==="multiple"?((k=e.value)==null?void 0:k[0])??c:e.value??c},[b,y]=n.useState(()=>(x()??c).getFullYear()),[f,p]=n.useState(()=>(x()??c).getMonth()),[u,m]=n.useState("days"),[_,h]=n.useState(null),[g,N]=n.useState(()=>{const w=e.mode==="single"?e.value:null;return w?w.getHours():0}),[T,E]=n.useState(()=>{const w=e.mode==="single"?e.value:null;return w?w.getMinutes():0}),W=n.useMemo(()=>{const w=Sr(b,f),k=Rr(b,f,l);return{count:w,offset:k}},[b,f,l]),V=n.useMemo(()=>l===1?["Mo","Tu","We","Th","Fr","Sa","Su"]:["Su","Mo","Tu","We","Th","Fr","Sa"],[l]),B=n.useCallback(w=>{if(e.mode==="single")return!!e.value&&F(w,e.value);if(e.mode==="range"){const[k,D]=e.value??[null,null];return!!k&&F(w,k)||!!D&&F(w,D)}return e.mode==="multiple"?(e.value??[]).some(k=>F(w,k)):!1},[e]),L=n.useCallback(w=>{if(e.mode!=="range")return!1;const[k,D]=e.value??[null,null],A=D??_;if(!k||!A)return!1;const O=X(k,A)?k:A,K=X(k,A)?A:k;return ce(w,O)&&X(w,K)},[e,_]),I=n.useCallback(w=>{if(e.mode!=="range")return!1;const[k]=e.value??[null,null];return!!k&&F(w,k)},[e]),C=n.useCallback(w=>{if(e.mode!=="range")return!1;const[,k]=e.value??[null,null];return!!k&&F(w,k)},[e]),j=n.useCallback(w=>!!(s&&X(w,s)||o&&ce(w,o)||i!=null&&i(w)),[s,o,i]),S=n.useCallback(w=>{var D,A,O,K,G,J;const k=new Date(b,f,w,g,T);if(!j(U(k))){if(e.mode==="single"||!e.mode)(D=e.onChange)==null||D.call(e,k);else if(e.mode==="range"){const[$,Y]=e.value??[null,null];!$||$&&Y?(A=e.onChange)==null||A.call(e,[k,null]):X(k,$)?(O=e.onChange)==null||O.call(e,[k,$]):(K=e.onChange)==null||K.call(e,[$,k])}else if(e.mode==="multiple"){const $=e.value??[],Y=$.findIndex(ie=>F(ie,k));Y>=0?(G=e.onChange)==null||G.call(e,$.filter((ie,Ut)=>Ut!==Y)):(J=e.onChange)==null||J.call(e,[...$,k])}}},[b,f,g,T,e,j]),R=()=>{f===0?(p(11),y(w=>w-1)):p(w=>w-1)},M=()=>{f===11?(p(0),y(w=>w+1)):p(w=>w+1)},P=(w,k)=>{var D;if(N(w),E(k),e.mode==="single"&&e.value){const A=new Date(e.value);A.setHours(w,k),(D=e.onChange)==null||D.call(e,A)}},Z=Math.floor(b/z)*z;return t.jsxs("div",{ref:a,className:v("vyre-calendar",d),children:[t.jsxs("div",{className:"vyre-calendar__header",children:[u==="days"&&t.jsx("button",{className:"vyre-calendar__nav",onClick:R,"aria-label":"Previous month",children:t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:t.jsx("path",{d:"M9 11L5 7l4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),u==="years"&&t.jsx("button",{className:"vyre-calendar__nav",onClick:()=>y(w=>w-z),"aria-label":"Previous years",children:t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:t.jsx("path",{d:"M9 11L5 7l4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),t.jsxs("div",{className:"vyre-calendar__header-center",children:[t.jsx("button",{className:"vyre-calendar__header-btn",onClick:()=>m(u==="months"?"days":"months"),children:de[f]}),t.jsx("button",{className:"vyre-calendar__header-btn",onClick:()=>m(u==="years"?"days":"years"),children:b})]}),u==="days"&&t.jsx("button",{className:"vyre-calendar__nav",onClick:M,"aria-label":"Next month",children:t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:t.jsx("path",{d:"M5 3l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),u==="years"&&t.jsx("button",{className:"vyre-calendar__nav",onClick:()=>y(w=>w+z),"aria-label":"Next years",children:t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:t.jsx("path",{d:"M5 3l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),u==="months"&&t.jsx("div",{className:"vyre-calendar__month-grid",children:de.map((w,k)=>t.jsx("button",{className:v("vyre-calendar__month-cell",k===f&&"vyre-calendar__month-cell--active"),onClick:()=>{p(k),m("days")},children:w.slice(0,3)},w))}),u==="years"&&t.jsx("div",{className:"vyre-calendar__year-grid",children:Array.from({length:z},(w,k)=>Z+k).map(w=>t.jsx("button",{className:v("vyre-calendar__year-cell",w===b&&"vyre-calendar__year-cell--active"),onClick:()=>{y(w),m("days")},children:w},w))}),u==="days"&&t.jsxs("div",{className:"vyre-calendar__grid",children:[V.map(w=>t.jsx("div",{className:"vyre-calendar__weekday",children:w},w)),Array.from({length:W.offset}).map((w,k)=>t.jsx("div",{},`empty-${k}`)),Array.from({length:W.count},(w,k)=>k+1).map(w=>{const k=new Date(b,f,w),D=B(k),A=L(k),O=I(k),K=C(k),G=j(k),J=F(k,c);return t.jsx("button",{className:v("vyre-calendar__day",J&&"vyre-calendar__day--today",D&&"vyre-calendar__day--selected",A&&"vyre-calendar__day--in-range",O&&"vyre-calendar__day--range-start",K&&"vyre-calendar__day--range-end",G&&"vyre-calendar__day--disabled"),onClick:()=>S(w),onMouseEnter:()=>{if(e.mode==="range"){const[$,Y]=e.value??[null,null];$&&!Y&&h(k)}},onMouseLeave:()=>h(null),disabled:G,"aria-selected":D,"aria-label":q(k),children:w},w)})]}),r&&u==="days"&&t.jsxs("div",{className:"vyre-calendar__time",children:[t.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"7",cy:"7",r:"5.5",stroke:"currentColor",strokeWidth:"1.3"}),t.jsx("path",{d:"M7 4v3.5l2 1.5",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]}),t.jsx("input",{type:"number",className:"vyre-calendar__time-input",min:0,max:23,value:g,onChange:w=>P(Number(w.target.value),T),"aria-label":"Hours"}),t.jsx("span",{className:"vyre-calendar__time-sep",children:":"}),t.jsx("input",{type:"number",className:"vyre-calendar__time-input",min:0,max:59,value:T,onChange:w=>P(g,Number(w.target.value)),"aria-label":"Minutes"})]})]})});oe.displayName="VyreCalendar";function Mr(e){if(e.mode==="range"){const[s,o]=e.value??[null,null];return s?o?`${q(s)} – ${q(o)}`:q(s):""}if(e.mode==="multiple"){const s=e.value??[];return s.length===0?"":s.length===1?q(s[0]):`${s.length} dates selected`}const a=e.value,r=e.showTime;return a?r?`${q(a)} ${Lr(a)}`:q(a):""}const Lt=n.forwardRef(({placeholder:e="Pick a date",inputClassName:a,...r},s)=>{const[o,i]=n.useState(!1),d=n.useRef(null),l=n.useRef(null),[c,x]=n.useState({top:0,left:0,width:0}),b=Mr(r),y=n.useCallback(()=>{if(!d.current)return;const u=d.current.getBoundingClientRect();x({top:u.bottom+window.scrollY+6,left:u.left+window.scrollX,width:u.width})},[]);n.useEffect(()=>{if(!o)return;y();const u=()=>y(),m=()=>y();return window.addEventListener("scroll",u,!0),window.addEventListener("resize",m),()=>{window.removeEventListener("scroll",u,!0),window.removeEventListener("resize",m)}},[o,y]),n.useEffect(()=>{if(!o)return;const u=_=>{var h,g;!((h=l.current)!=null&&h.contains(_.target))&&!((g=d.current)!=null&&g.contains(_.target))&&i(!1)},m=_=>{_.key==="Escape"&&i(!1)};return document.addEventListener("pointerdown",u),document.addEventListener("keydown",m),()=>{document.removeEventListener("pointerdown",u),document.removeEventListener("keydown",m)}},[o]);const f=r.mode!=="range"&&r.mode!=="multiple"&&!r.showTime,p=n.useMemo(()=>r.mode==="range"?{...r,onChange:u=>{var m;(m=r.onChange)==null||m.call(r,u),u[0]&&u[1]&&i(!1)}}:r.mode==="multiple"?r:{...r,onChange:u=>{var m;(m=r.onChange)==null||m.call(r,u),f&&i(!1)}},[r,f]);return t.jsxs("div",{ref:s,className:"vyre-datepicker",children:[t.jsxs("button",{ref:d,type:"button",className:v("vyre-datepicker__trigger",!b&&"vyre-datepicker__trigger--placeholder",a),onClick:()=>{y(),i(u=>!u)},"aria-expanded":o,"aria-haspopup":"dialog",children:[t.jsxs("svg",{className:"vyre-datepicker__icon",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:[t.jsx("rect",{x:"1.5",y:"2.5",width:"11",height:"10",rx:"1.5",stroke:"currentColor",strokeWidth:"1.3"}),t.jsx("path",{d:"M1.5 6h11M4.5 1v3M9.5 1v3",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]}),t.jsx("span",{children:b||e}),b&&t.jsx("button",{className:"vyre-datepicker__clear",type:"button","aria-label":"Clear",onClick:u=>{var m,_,h;u.stopPropagation(),r.mode==="range"?(m=r.onChange)==null||m.call(r,[null,null]):r.mode==="multiple"?(_=r.onChange)==null||_.call(r,[]):(h=r.onChange)==null||h.call(r,null)},children:t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M2 2l8 8M10 2l-8 8",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})})]}),o&&H.createPortal(t.jsx("div",{ref:l,className:"vyre-datepicker__popover",role:"dialog","aria-label":"Date picker",style:{top:c.top,left:c.left,minWidth:c.width},children:t.jsx(oe,{...p})}),document.body)]})});Lt.displayName="VyreDatePicker";const Mt=n.forwardRef(({as:e="p",size:a="md",weight:r,color:s="default",truncate:o,mono:i,className:d,children:l,...c},x)=>t.jsx(e,{ref:x,className:v("vyre-text",a!=="md"&&`vyre-text--${a}`,r&&`vyre-text--${r}`,s!=="default"&&`vyre-text--${s}`,o&&"vyre-text--truncate",i&&"vyre-text--mono",d),...c,children:l}));Mt.displayName="VyreText";const Tt=n.forwardRef(({as:e="h2",size:a="md",weight:r="bold",color:s="default",truncate:o,className:i,children:d,...l},c)=>t.jsx(e,{ref:c,className:v("vyre-heading",`vyre-heading--${a}`,r!=="bold"&&`vyre-heading--${r}`,s!=="default"&&`vyre-text--${s}`,o&&"vyre-text--truncate",i),...l,children:d}));Tt.displayName="VyreHeading";const Et=n.forwardRef(({className:e,children:a,...r},s)=>t.jsx("p",{ref:s,className:v("vyre-lead",e),...r,children:a}));Et.displayName="VyreLead";const It=n.forwardRef(({block:e,className:a,children:r,...s},o)=>e?t.jsx("pre",{className:v("vyre-code-block",a),...s,children:t.jsx("code",{ref:o,children:r})}):t.jsx("code",{ref:o,className:v("vyre-code",a),...s,children:r}));It.displayName="VyreCode";const Dt=n.forwardRef(({className:e,children:a,...r},s)=>t.jsx("blockquote",{ref:s,className:v("vyre-blockquote",e),...r,children:a}));Dt.displayName="VyreBlockquote";const At=n.createContext({collapsed:!1,toggleCollapsed:()=>{}}),re=()=>n.useContext(At),Bt=n.forwardRef(({defaultCollapsed:e=!1,collapsed:a,onCollapsedChange:r,className:s,children:o},i)=>{const[d,l]=n.useState(e),c=a!==void 0?a:d,x=n.useCallback(()=>{const b=!c;l(b),r==null||r(b)},[c,r]);return t.jsx(At.Provider,{value:{collapsed:c,toggleCollapsed:x},children:t.jsx("div",{ref:i,className:v("vyre-app-layout",s),children:o})})});Bt.displayName="VyreAppLayout";const Vt=n.forwardRef(({variant:e="default",className:a,children:r},s)=>{const{collapsed:o}=re();return t.jsx("aside",{ref:s,className:v("vyre-sidebar",o&&"vyre-sidebar--collapsed",e==="floating"&&"vyre-sidebar--floating",a),"data-collapsed":o||void 0,children:r})});Vt.displayName="VyreSidebar";const $t=n.forwardRef(({logo:e,title:a,className:r,children:s},o)=>t.jsxs("div",{ref:o,className:v("vyre-sidebar__header",r),children:[e&&t.jsx("span",{className:"vyre-sidebar__logo",children:e}),a&&t.jsx("span",{className:"vyre-sidebar__title",children:a}),s]}));$t.displayName="VyreSidebarHeader";const Wt=n.forwardRef(({className:e,children:a},r)=>t.jsx("div",{ref:r,className:v("vyre-sidebar__content",e),children:a}));Wt.displayName="VyreSidebarContent";const Ht=n.forwardRef(({label:e,className:a,children:r},s)=>t.jsxs("div",{ref:s,className:v("vyre-sidebar__section",a),children:[e&&t.jsx("div",{className:"vyre-sidebar__section-label",children:e}),r]}));Ht.displayName="VyreSidebarSection";const Ft=({active:e,icon:a,badge:r,href:s,onClick:o,className:i,children:d})=>{const{collapsed:l}=re(),c=v("vyre-sidebar__item",e&&"vyre-sidebar__item--active",i),x=t.jsxs(t.Fragment,{children:[a&&t.jsx("span",{className:"vyre-sidebar__item-icon",children:a}),t.jsx("span",{className:"vyre-sidebar__item-label",children:d}),r!==void 0&&t.jsx("span",{className:"vyre-sidebar__item-badge",children:r})]});return s?t.jsx("a",{href:s,className:c,"aria-current":e?"page":void 0,title:l?String(d):void 0,children:x}):t.jsx("button",{type:"button",className:c,onClick:o,"aria-pressed":e,title:l?String(d):void 0,children:x})};Ft.displayName="VyreSidebarItem";const Pt=n.forwardRef(({className:e,children:a},r)=>t.jsx("div",{ref:r,className:v("vyre-sidebar__footer",e),children:a}));Pt.displayName="VyreSidebarFooter";const qt=n.forwardRef(({className:e,children:a},r)=>t.jsx("div",{ref:r,className:v("vyre-app-shell",e),children:a}));qt.displayName="VyreAppShell";const Ot=n.forwardRef(({className:e,children:a},r)=>t.jsx("header",{ref:r,className:v("vyre-app-bar",e),children:a}));Ot.displayName="VyreAppBar";const Kt=({className:e})=>{const{collapsed:a,toggleCollapsed:r}=re();return t.jsx("button",{type:"button",className:v("vyre-sidebar-trigger",e),onClick:r,"aria-label":a?"Expand sidebar":"Collapse sidebar","aria-expanded":!a,children:t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[t.jsx("rect",{x:"2",y:"4",width:"12",height:"1.5",rx:"0.75",fill:"currentColor"}),t.jsx("rect",{x:"2",y:"7.25",width:"8",height:"1.5",rx:"0.75",fill:"currentColor"}),t.jsx("rect",{x:"2",y:"10.5",width:"12",height:"1.5",rx:"0.75",fill:"currentColor"})]})})};Kt.displayName="VyreSidebarTrigger";const Yt=n.forwardRef(({className:e,children:a},r)=>t.jsx("div",{ref:r,className:v("vyre-page-content",e),children:a}));Yt.displayName="VyrePageContent";exports.Accordion=Be;exports.AccordionContent=We;exports.AccordionItem=Ve;exports.AccordionTrigger=$e;exports.Alert=st;exports.AlertDialog=ot;exports.AppBar=Ot;exports.AppLayout=Bt;exports.AppShell=qt;exports.Avatar=He;exports.Badge=me;exports.Blockquote=Dt;exports.Breadcrumb=ut;exports.BreadcrumbItem=mt;exports.Button=ue;exports.Calendar=oe;exports.Card=ve;exports.CardBody=fe;exports.CardFooter=he;exports.CardHeader=ye;exports.Checkbox=Fe;exports.Code=It;exports.Command=se;exports.CommandDialog=Rt;exports.CommandEmpty=kt;exports.CommandGroup=Nt;exports.CommandInput=jt;exports.CommandItem=Ct;exports.CommandList=gt;exports.CommandSeparator=St;exports.DatePicker=Lt;exports.DropdownCheckboxItem=Qe;exports.DropdownItem=Je;exports.DropdownLabel=Ze;exports.DropdownMenu=ze;exports.DropdownRadioGroup=et;exports.DropdownRadioItem=tt;exports.DropdownSeparator=at;exports.DropdownSub=rt;exports.Field=be;exports.Heading=Tt;exports.Input=xe;exports.Label=Ye;exports.Lead=Et;exports.Modal=_e;exports.ModalBody=je;exports.ModalFooter=ge;exports.ModalHeader=we;exports.PageContent=Yt;exports.Pagination=vt;exports.Popover=Ge;exports.Progress=Oe;exports.Select=Ne;exports.Separator=Ke;exports.Sheet=it;exports.SheetBody=ct;exports.SheetFooter=dt;exports.SheetHeader=lt;exports.Sidebar=Vt;exports.SidebarContent=Wt;exports.SidebarFooter=Pt;exports.SidebarHeader=$t;exports.SidebarItem=Ft;exports.SidebarSection=Ht;exports.SidebarTrigger=Kt;exports.Skeleton=Ue;exports.Slider=qe;exports.Switch=Pe;exports.Tab=Me;exports.TabList=Le;exports.TabPanel=Ee;exports.TabPanels=Te;exports.Table=yt;exports.TableBody=ht;exports.TableCaption=_t;exports.TableCell=pt;exports.TableHead=ft;exports.TableHeader=xt;exports.TableRow=bt;exports.Tabs=Re;exports.Text=Mt;exports.Textarea=pe;exports.ToastProvider=tr;exports.Tooltip=Ie;exports.cn=v;exports.useAppLayout=re;exports.useToast=rr;
|
|
1
|
+
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),n=require("react"),H=require("react-dom");function m(...e){const a=[];for(const r of e)if(r){if(typeof r=="string")a.push(r);else if(Array.isArray(r)){const s=m(...r);s&&a.push(s)}else if(typeof r=="object")for(const[s,o]of Object.entries(r))o&&a.push(s)}return a.join(" ")}const zt={primary:"vyre-btn--primary",secondary:"vyre-btn--secondary",ghost:"vyre-btn--ghost",accent:"vyre-btn--accent",teal:"vyre-btn--teal",danger:"vyre-btn--danger"},Zt={sm:"vyre-btn--sm",md:"vyre-btn--md",lg:"vyre-btn--lg",icon:"vyre-btn--icon"},ue=n.forwardRef(({variant:e="secondary",size:a="md",loading:r=!1,disabled:s,leftIcon:o,rightIcon:i,className:d,children:l,as:c="button",...x},b)=>{const y=s||r;return t.jsxs(c,{ref:b,className:m("vyre-btn",zt[e],Zt[a],r&&"vyre-btn--loading",d),disabled:c==="button"?y:void 0,"aria-disabled":y,"data-variant":e,"data-size":a,...x,children:[r&&t.jsx("span",{className:"vyre-btn__spinner","aria-hidden":"true",children:t.jsx(Jt,{})}),!r&&o&&t.jsx("span",{className:"vyre-btn__icon vyre-btn__icon--left","aria-hidden":"true",children:o}),l&&t.jsx("span",{className:"vyre-btn__label",children:l}),i&&t.jsx("span",{className:"vyre-btn__icon vyre-btn__icon--right","aria-hidden":"true",children:i})]})});ue.displayName="VyreButton";function Jt(){return t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"vyre-spinner","aria-hidden":"true",children:t.jsx("circle",{cx:"7",cy:"7",r:"5.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeDasharray:"28",strokeDashoffset:"10"})})}const me=n.forwardRef(({variant:e="default",dot:a=!1,className:r,children:s,...o},i)=>t.jsxs("span",{ref:i,className:m("vyre-badge",`vyre-badge--${e}`,r),"data-variant":e,...o,children:[a&&t.jsx("span",{className:"vyre-badge__dot","aria-hidden":"true"}),s]}));me.displayName="VyreBadge";const ve=n.forwardRef(({variant:e="default",hoverable:a=!1,clickable:r=!1,className:s,children:o,...i},d)=>t.jsx("div",{ref:d,className:m("vyre-card",`vyre-card--${e}`,a&&"vyre-card--hoverable",r&&"vyre-card--clickable",s),"data-variant":e,role:r?"button":void 0,tabIndex:r?0:void 0,...i,children:o}));ve.displayName="VyreCard";const ye=n.forwardRef(({className:e,children:a,...r},s)=>t.jsx("div",{ref:s,className:m("vyre-card__header",e),...r,children:a}));ye.displayName="VyreCardHeader";const fe=n.forwardRef(({className:e,children:a,...r},s)=>t.jsx("div",{ref:s,className:m("vyre-card__body",e),...r,children:a}));fe.displayName="VyreCardBody";const he=n.forwardRef(({className:e,children:a,...r},s)=>t.jsx("div",{ref:s,className:m("vyre-card__footer",e),...r,children:a}));he.displayName="VyreCardFooter";const be=n.forwardRef(({label:e,hint:a,state:r="idle",required:s=!1,htmlFor:o,className:i,children:d,...l},c)=>t.jsxs("div",{ref:c,className:m("vyre-field",r!=="idle"&&`vyre-field--${r}`,i),"data-state":r,...l,children:[e&&t.jsxs("label",{className:"vyre-field__label",htmlFor:o,children:[e,s&&t.jsx("span",{className:"vyre-field__required","aria-label":"required",children:"*"})]}),d,a&&t.jsx("span",{className:"vyre-field__hint",role:r==="error"?"alert":void 0,children:a})]}));be.displayName="VyreField";const xe=n.forwardRef(({size:e="md",leftElement:a,rightElement:r,className:s,...o},i)=>a||r?t.jsxs("div",{className:m("vyre-input-wrapper",`vyre-input-wrapper--${e}`),children:[a&&t.jsx("span",{className:"vyre-input__element vyre-input__element--left","aria-hidden":"true",children:a}),t.jsx("input",{ref:i,className:m("vyre-input",`vyre-input--${e}`,!!a&&"vyre-input--has-left",!!r&&"vyre-input--has-right",s),...o}),r&&t.jsx("span",{className:"vyre-input__element vyre-input__element--right","aria-hidden":"true",children:r})]}):t.jsx("input",{ref:i,className:m("vyre-input",`vyre-input--${e}`,s),...o}));xe.displayName="VyreInput";const pe=n.forwardRef(({size:e="md",resize:a="vertical",className:r,style:s,...o},i)=>t.jsx("textarea",{ref:i,className:m("vyre-textarea",`vyre-textarea--${e}`,r),style:{resize:a,...s},...o}));pe.displayName="VyreTextarea";const Qt=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(","),_e=n.forwardRef(({open:e,onClose:a,size:r="md",closeOnBackdrop:s=!0,closeOnEsc:o=!0,initialFocus:i,className:d,children:l,"aria-label":c,"aria-labelledby":x,...b},y)=>{const f=n.useRef(null),p=n.useRef(null),u=n.useCallback(h=>{f.current=h,typeof y=="function"?y(h):y&&(y.current=h)},[y]),v=n.useCallback(h=>{if(h.key!=="Tab")return;const g=f.current;if(!g)return;const N=Array.from(g.querySelectorAll(Qt));if(!N.length)return;const T=N[0],E=N[N.length-1];h.shiftKey&&document.activeElement===T?(h.preventDefault(),E.focus()):!h.shiftKey&&document.activeElement===E&&(h.preventDefault(),T.focus())},[]),_=n.useCallback(h=>{h.key==="Escape"&&o&&a()},[o,a]);return n.useEffect(()=>{if(!e)return;document.addEventListener("keydown",_),document.addEventListener("keydown",v);const h=document.body.style.overflow;document.body.style.overflow="hidden";const g=setTimeout(()=>{var N;i!=null&&i.current?i.current.focus():(N=f.current)==null||N.focus()},0);return()=>{document.removeEventListener("keydown",_),document.removeEventListener("keydown",v),document.body.style.overflow=h,clearTimeout(g)}},[e,_,v,i]),e?H.createPortal(t.jsx("div",{ref:p,className:"vyre-modal-backdrop",onClick:h=>{s&&h.target===p.current&&a()},role:"presentation",children:t.jsx("div",{ref:u,className:m("vyre-modal",`vyre-modal--${r}`,d),role:"dialog","aria-modal":"true","aria-label":c,"aria-labelledby":x,tabIndex:-1,...b,children:l})}),document.body):null});_e.displayName="VyreModal";const we=n.forwardRef(({className:e,children:a,...r},s)=>t.jsx("div",{ref:s,className:m("vyre-modal__header",e),...r,children:a}));we.displayName="VyreModalHeader";const je=n.forwardRef(({className:e,children:a,...r},s)=>t.jsx("div",{ref:s,className:m("vyre-modal__body",e),...r,children:a}));je.displayName="VyreModalBody";const ge=n.forwardRef(({className:e,children:a,...r},s)=>t.jsx("div",{ref:s,className:m("vyre-modal__footer",e),...r,children:a}));ge.displayName="VyreModalFooter";const ke=n.createContext(null);function er(e,a){switch(a.type){case"ADD":return[...e,a.payload];case"REMOVE":return e.filter(r=>r.id!==a.id);default:return e}}let tr=0;const rr=()=>`vyre-t-${++tr}`;function ar({children:e}){const[a,r]=n.useReducer(er,[]),s=n.useCallback(i=>{const d=rr();return r({type:"ADD",payload:{...i,id:d}}),d},[]),o=n.useCallback(i=>{r({type:"REMOVE",id:i})},[]);return t.jsxs(ke.Provider,{value:{toast:s,dismiss:o},children:[e,typeof document<"u"&&H.createPortal(t.jsx("div",{className:"vyre-toast-viewport","aria-live":"polite","aria-atomic":"false","aria-label":"Notifications",children:a.map(i=>t.jsx(sr,{...i,onDismiss:()=>o(i.id)},i.id))}),document.body)]})}function nr(){const e=n.useContext(ke);if(!e)throw new Error("useToast must be used inside <ToastProvider>");return e}function sr({title:e,description:a,variant:r="default",duration:s=4e3,onDismiss:o}){return n.useEffect(()=>{if(s===1/0)return;const i=setTimeout(o,s);return()=>clearTimeout(i)},[s,o]),t.jsxs("div",{className:m("vyre-toast",`vyre-toast--${r}`),role:"alert","data-variant":r,children:[t.jsxs("div",{className:"vyre-toast__content",children:[e&&t.jsx("p",{className:"vyre-toast__title",children:e}),a&&t.jsx("p",{className:"vyre-toast__description",children:a})]}),t.jsx("button",{className:"vyre-toast__close",onClick:o,"aria-label":"Dismiss notification",type:"button",children:t.jsx(or,{})})]})}function or(){return t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M10.5 3.5L3.5 10.5M3.5 3.5L10.5 10.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}const Ne=n.forwardRef(({options:e,value:a,defaultValue:r,onChange:s,placeholder:o="Select an option",disabled:i=!1,size:d="md",className:l,...c},x)=>{const b=a!==void 0,[y,f]=n.useState(r??""),p=b?a:y,[u,v]=n.useState(!1),[_,h]=n.useState(-1),g=n.useRef(null),N=n.useRef(null),E=`${n.useId()}-listbox`,W=e.find(j=>j.value===p),V=e.filter(j=>!j.disabled),B=n.useCallback(()=>{v(!1),h(-1)},[]),L=n.useCallback(j=>{var S;j.disabled||(b||f(j.value),s==null||s(j.value),B(),(S=g.current)==null||S.focus())},[b,s,B]);n.useEffect(()=>{if(!u)return;const j=S=>{const R=x==null?void 0:x.current;R&&!R.contains(S.target)&&B()};return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[u,x,B]),n.useEffect(()=>{var S;if(!u||_<0)return;const j=(S=N.current)==null?void 0:S.children[_];j==null||j.scrollIntoView({block:"nearest"})},[_,u]);const I=j=>{switch(j.key){case"Enter":case" ":case"ArrowDown":{if(j.preventDefault(),!u){v(!0);const S=e.findIndex(R=>R.value===p);h(S>=0?S:0)}break}case"ArrowUp":{j.preventDefault(),u||(v(!0),h(e.length-1));break}case"Escape":{B();break}}},C=j=>{var S;switch(j.key){case"ArrowDown":{j.preventDefault(),h(R=>{let M=R+1;for(;M<e.length&&e[M].disabled;)M++;return M<e.length?M:R});break}case"ArrowUp":{j.preventDefault(),h(R=>{let M=R-1;for(;M>=0&&e[M].disabled;)M--;return M>=0?M:R});break}case"Enter":case" ":{j.preventDefault(),_>=0&&L(e[_]);break}case"Escape":case"Tab":{B(),(S=g.current)==null||S.focus();break}case"Home":{j.preventDefault();const R=e.findIndex(M=>!M.disabled);R>=0&&h(R);break}case"End":{j.preventDefault();const R=[...e].reverse().findIndex(M=>!M.disabled);R>=0&&h(e.length-1-R);break}}};return t.jsxs("div",{ref:x,className:m("vyre-select",`vyre-select--${d}`,l),"data-open":u,...c,children:[t.jsxs("button",{ref:g,type:"button",className:"vyre-select__trigger","aria-haspopup":"listbox","aria-expanded":u,"aria-controls":E,"aria-disabled":i,disabled:i,onClick:()=>{i||v(j=>{if(!j){const S=e.findIndex(R=>R.value===p);h(S>=0?S:0)}return!j})},onKeyDown:I,children:[W?t.jsx("span",{className:"vyre-select__value",children:W.label}):t.jsx("span",{className:"vyre-select__placeholder",children:o}),t.jsx(ir,{})]}),u&&t.jsxs("ul",{ref:N,id:E,role:"listbox",className:"vyre-select__dropdown","aria-label":"Options",tabIndex:-1,onKeyDown:C,children:[e.map((j,S)=>t.jsxs("li",{role:"option","aria-selected":j.value===p,"aria-disabled":j.disabled,"data-highlighted":S===_,className:"vyre-select__option",onMouseEnter:()=>!j.disabled&&h(S),onMouseDown:R=>{R.preventDefault(),L(j)},children:[j.label,j.value===p&&t.jsx(lr,{})]},j.value)),V.length===0&&t.jsx("li",{className:"vyre-select__empty",role:"presentation",children:"No options available"})]})]})});Ne.displayName="VyreSelect";function ir(){return t.jsx("svg",{className:"vyre-select__chevron",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M3 5L7 9L11 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function lr(){return t.jsx("svg",{className:"vyre-select__check",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M2.5 7L5.5 10L11.5 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const Ce=n.createContext(null);function Se(){const e=n.useContext(Ce);if(!e)throw new Error("Tab components must be used inside <Tabs>");return e}const Re=n.forwardRef(({defaultValue:e="",value:a,onChange:r,className:s,children:o,...i},d)=>{const l=a!==void 0,[c,x]=n.useState(e),b=l?a:c,y=n.useId(),f=n.useCallback(p=>{l||x(p),r==null||r(p)},[l,r]);return t.jsx(Ce.Provider,{value:{value:b,onChange:f,baseId:y},children:t.jsx("div",{ref:d,className:m("vyre-tabs",s),...i,children:o})})});Re.displayName="VyreTabs";const Le=n.forwardRef(({className:e,children:a,"aria-label":r,...s},o)=>{const i=n.useRef(null),d=l=>{var y;const c=Array.from(((y=i.current)==null?void 0:y.querySelectorAll('[role="tab"]:not([disabled])'))??[]),x=c.findIndex(f=>f===document.activeElement);if(x<0)return;let b=x;if(l.key==="ArrowRight")b=(x+1)%c.length;else if(l.key==="ArrowLeft")b=(x-1+c.length)%c.length;else if(l.key==="Home")b=0;else if(l.key==="End")b=c.length-1;else return;l.preventDefault(),c[b].focus(),c[b].click()};return t.jsx("div",{ref:l=>{i.current=l,typeof o=="function"?o(l):o&&(o.current=l)},role:"tablist",className:m("vyre-tabs__list",e),"aria-label":r,onKeyDown:d,...s,children:a})});Le.displayName="VyreTabList";const Me=n.forwardRef(({value:e,disabled:a=!1,className:r,children:s,...o},i)=>{const{value:d,onChange:l,baseId:c}=Se(),x=e===d;return t.jsx("button",{ref:i,role:"tab",type:"button",id:`${c}-tab-${e}`,"aria-controls":`${c}-panel-${e}`,"aria-selected":x,disabled:a,tabIndex:x?0:-1,className:m("vyre-tabs__tab",x&&"vyre-tabs__tab--active",r),"data-selected":x,onClick:()=>!a&&l(e),...o,children:s})});Me.displayName="VyreTab";const Te=n.forwardRef(({className:e,children:a,...r},s)=>t.jsx("div",{ref:s,className:m("vyre-tabs__panels",e),...r,children:a}));Te.displayName="VyreTabPanels";const Ee=n.forwardRef(({value:e,className:a,children:r,...s},o)=>{const{value:i,baseId:d}=Se();return e===i?t.jsx("div",{ref:o,role:"tabpanel",id:`${d}-panel-${e}`,"aria-labelledby":`${d}-tab-${e}`,tabIndex:0,className:m("vyre-tabs__panel",a),...s,children:r}):null});Ee.displayName="VyreTabPanel";const cr=120,Ie=({content:e,placement:a="top",delay:r=300,children:s,className:o})=>{const[i,d]=n.useState("hidden"),l=n.useRef(null),c=n.useRef(null),x=n.useId(),b=n.useCallback(()=>{c.current&&(clearTimeout(c.current),c.current=null),l.current=setTimeout(()=>d("visible"),r)},[r]),y=n.useCallback(()=>{l.current&&(clearTimeout(l.current),l.current=null),d("leaving"),c.current=setTimeout(()=>d("hidden"),cr)},[]),f=n.Children.only(s),p=n.cloneElement(f,{onMouseEnter:u=>{var v,_;b(),(_=(v=f.props).onMouseEnter)==null||_.call(v,u)},onMouseLeave:u=>{var v,_;y(),(_=(v=f.props).onMouseLeave)==null||_.call(v,u)},onFocus:u=>{var v,_;d("visible"),(_=(v=f.props).onFocus)==null||_.call(v,u)},onBlur:u=>{var v,_;y(),(_=(v=f.props).onBlur)==null||_.call(v,u)},"aria-describedby":i!=="hidden"?x:void 0});return t.jsxs("span",{className:m("vyre-tooltip-wrapper",o),children:[p,i!=="hidden"&&t.jsxs("span",{id:x,role:"tooltip",className:m("vyre-tooltip",`vyre-tooltip--${a}`,i==="leaving"&&"vyre-tooltip--leaving"),"data-placement":a,children:[e,t.jsx("span",{className:"vyre-tooltip__arrow","aria-hidden":"true"})]})]})};Ie.displayName="VyreTooltip";const De=n.createContext(null);function Ae(){const e=n.useContext(De);if(!e)throw new Error("AccordionItem must be used within Accordion");return e}const Be=n.forwardRef(({type:e="single",defaultValue:a,value:r,onValueChange:s,className:o,children:i,...d},l)=>{const c=p=>p===void 0?[]:Array.isArray(p)?p:[p],[x,b]=n.useState(c(a)),y=r!==void 0?c(r):x,f=n.useCallback(p=>{let u;e==="single"?u=y.includes(p)?[]:[p]:u=y.includes(p)?y.filter(v=>v!==p):[...y,p],r===void 0&&b(u),s==null||s(e==="single"?u[0]??"":u)},[e,y,r,s]);return t.jsx(De.Provider,{value:{type:e,value:y,toggle:f},children:t.jsx("div",{ref:l,className:["vyre-accordion",o].filter(Boolean).join(" "),...d,children:i})})});Be.displayName="Accordion";const ne=n.createContext(null),Ve=n.forwardRef(({value:e,className:a,children:r,...s},o)=>{const{value:i}=Ae(),d=i.includes(e);return t.jsx(ne.Provider,{value:{itemValue:e,isOpen:d},children:t.jsx("div",{ref:o,"data-state":d?"open":"closed",className:["vyre-accordion__item",a].filter(Boolean).join(" "),...s,children:r})})});Ve.displayName="AccordionItem";const $e=n.forwardRef(({className:e,children:a,...r},s)=>{const{toggle:o}=Ae(),i=n.useContext(ne);if(!i)throw new Error("AccordionTrigger must be used within AccordionItem");const{itemValue:d,isOpen:l}=i;return t.jsxs("button",{ref:s,type:"button","aria-expanded":l,"data-state":l?"open":"closed",className:["vyre-accordion__trigger",e].filter(Boolean).join(" "),onClick:()=>o(d),...r,children:[t.jsx("span",{className:"vyre-accordion__trigger-text",children:a}),t.jsx("svg",{className:"vyre-accordion__chevron",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M4 6l4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]})});$e.displayName="AccordionTrigger";const We=n.forwardRef(({className:e,children:a,...r},s)=>{const o=n.useContext(ne);if(!o)throw new Error("AccordionContent must be used within AccordionItem");const{isOpen:i}=o;return t.jsx("div",{ref:s,hidden:!i,"data-state":i?"open":"closed",className:["vyre-accordion__content",e].filter(Boolean).join(" "),...r,children:t.jsx("div",{className:"vyre-accordion__content-inner",children:a})})});We.displayName="AccordionContent";const He=n.forwardRef(({src:e,alt:a="",fallback:r,size:s="md",status:o,className:i,...d},l)=>{var y;const[c,x]=n.useState(!1),b=e&&!c;return t.jsxs("span",{ref:l,"data-size":s,className:["vyre-avatar",i].filter(Boolean).join(" "),...d,children:[b?t.jsx("img",{src:e,alt:a,className:"vyre-avatar__img",onError:()=>x(!0)}):t.jsx("span",{className:"vyre-avatar__fallback","aria-label":a||r,children:r??((y=a==null?void 0:a.charAt(0))==null?void 0:y.toUpperCase())??"?"}),o&&t.jsx("span",{className:`vyre-avatar__status vyre-avatar__status--${o}`,"aria-label":o})]})});He.displayName="Avatar";const Fe=n.forwardRef(({checked:e,defaultChecked:a,indeterminate:r=!1,onCheckedChange:s,disabled:o,size:i="md",className:d,id:l,...c},x)=>{const b=n.useRef(null),y=x??b;return n.useEffect(()=>{y.current&&(y.current.indeterminate=r)},[r,y]),t.jsxs("span",{className:["vyre-checkbox",`vyre-checkbox--${i}`,d].filter(Boolean).join(" "),"data-disabled":o||void 0,"data-checked":e||void 0,"data-indeterminate":r||void 0,children:[t.jsx("input",{ref:y,type:"checkbox",id:l,checked:e,defaultChecked:a,disabled:o,className:"vyre-checkbox__input",onChange:f=>s==null?void 0:s(f.target.checked),...c}),t.jsx("span",{className:"vyre-checkbox__box","aria-hidden":"true",children:r?t.jsx("svg",{width:"10",height:"2",viewBox:"0 0 10 2",fill:"none",children:t.jsx("path",{d:"M1 1h8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})}):t.jsx("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",children:t.jsx("path",{d:"M1 4l3 3 5-6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})})]})});Fe.displayName="Checkbox";const Pe=n.forwardRef(({checked:e,defaultChecked:a=!1,onCheckedChange:r,disabled:s,size:o="md",className:i,...d},l)=>{const[c,x]=n.useState(a),b=e!==void 0?e:c,y=()=>{if(s)return;const f=!b;e===void 0&&x(f),r==null||r(f)};return t.jsx("button",{ref:l,type:"button",role:"switch","aria-checked":b,disabled:s,"data-checked":b||void 0,"data-size":o,className:["vyre-switch",i].filter(Boolean).join(" "),onClick:y,...d,children:t.jsx("span",{className:"vyre-switch__thumb"})})});Pe.displayName="Switch";const qe=n.forwardRef(({value:e,defaultValue:a=0,min:r=0,max:s=100,step:o=1,onValueChange:i,disabled:d,size:l="md",className:c,style:x,...b},y)=>{const[f,p]=n.useState(a),u=e!==void 0?e:f,v=(u-r)/(s-r)*100;return t.jsxs("div",{className:["vyre-slider",`vyre-slider--${l}`,c].filter(Boolean).join(" "),"data-disabled":d||void 0,style:{"--vyre-slider-pct":`${v}%`,...x},children:[t.jsx("input",{ref:y,type:"range",min:r,max:s,step:o,value:u,disabled:d,className:"vyre-slider__input",onChange:_=>{const h=Number(_.target.value);e===void 0&&p(h),i==null||i(h)},...b}),t.jsxs("div",{className:"vyre-slider__track",children:[t.jsx("div",{className:"vyre-slider__fill",style:{width:`${v}%`}}),t.jsx("div",{className:"vyre-slider__thumb",style:{left:`${v}%`}})]})]})});qe.displayName="Slider";const Oe=n.forwardRef(({value:e,max:a=100,indeterminate:r=!1,size:s="md",variant:o="default",className:i,...d},l)=>{const c=r?void 0:Math.min(100,Math.max(0,(e??0)/a*100));return t.jsx("div",{ref:l,role:"progressbar","aria-valuemin":0,"aria-valuemax":a,"aria-valuenow":r?void 0:e??0,"data-size":s,"data-variant":o,"data-indeterminate":r||void 0,className:["vyre-progress",i].filter(Boolean).join(" "),...d,children:t.jsx("div",{className:"vyre-progress__bar",style:c!==void 0?{width:`${c}%`}:void 0})})});Oe.displayName="Progress";const Ke=n.forwardRef(({orientation:e="horizontal",decorative:a=!0,className:r,...s},o)=>t.jsx("div",{ref:o,role:a?"none":"separator","aria-orientation":a?void 0:e,"data-orientation":e,className:["vyre-separator",r].filter(Boolean).join(" "),...s}));Ke.displayName="Separator";const Ye=n.forwardRef(({required:e,disabled:a,className:r,children:s,...o},i)=>t.jsxs("label",{ref:i,"data-required":e||void 0,"data-disabled":a||void 0,className:["vyre-label",r].filter(Boolean).join(" "),...o,children:[s,e&&t.jsx("span",{className:"vyre-label__required","aria-hidden":"true",children:"*"})]}));Ye.displayName="Label";const Ue=n.forwardRef(({variant:e="rect",width:a,height:r,className:s,style:o,...i},d)=>t.jsx("div",{ref:d,"aria-hidden":"true","data-variant":e,className:["vyre-skeleton",s].filter(Boolean).join(" "),style:{width:typeof a=="number"?`${a}px`:a,height:typeof r=="number"?`${r}px`:r,...o},...i}));Ue.displayName="Skeleton";const Q=8,dr=120;function ur(e){const[a,r]=e.split("-");return{side:a,align:r??"center"}}function mr(e,a,r,s,o,i){const d=e.width,l=e.height,c=a.width,x=a.height,b=e.left+o,y=e.top+i;let f=0,p=0;switch(r){case"top":f=y-x-Q;break;case"bottom":f=y+l+Q;break;case"left":p=b-c-Q;break;case"right":p=b+d+Q;break}if(r==="top"||r==="bottom")switch(s){case"start":p=b;break;case"center":p=b+d/2-c/2;break;case"end":p=b+d-c;break}else switch(s){case"start":f=y;break;case"center":f=y+l/2-x/2;break;case"end":f=y+l-x;break}return{top:f,left:p}}const Ge=({trigger:e,children:a,open:r,onOpenChange:s,placement:o="bottom",closeOnOutside:i=!0,className:d})=>{const l=r!==void 0,[c,x]=n.useState(!1),[b,y]=n.useState(!1),[f,p]=n.useState(!1),[u,v]=n.useState({top:0,left:0}),_=l?r:c,h=n.useRef(null),g=n.useRef(null),N=n.useRef(null),T=n.useId(),{side:E,align:W}=ur(o),V=n.useCallback(C=>{l||x(C),s==null||s(C)},[l,s]),B=n.useCallback(()=>V(!_),[_,V]),L=n.useCallback(()=>{y(!0),N.current=setTimeout(()=>{y(!1),p(!1),V(!1)},dr)},[V]);n.useEffect(()=>{_?(N.current&&(clearTimeout(N.current),N.current=null),y(!1),p(!0)):f&&!b&&L()},[_]),n.useEffect(()=>{if(!f||!h.current||!g.current)return;const C=h.current.getBoundingClientRect(),j=g.current.getBoundingClientRect(),S=mr(C,j,E,W,window.scrollX,window.scrollY);v(S)},[f,E,W]),n.useEffect(()=>{if(!f||!i)return;const C=j=>{g.current&&!g.current.contains(j.target)&&h.current&&!h.current.contains(j.target)&&L()};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[f,i,L]),n.useEffect(()=>{if(!f)return;const C=j=>{j.key==="Escape"&&L()};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[f,L]);const I=n.cloneElement(e,{ref:h,onClick:C=>{var j,S;B(),(S=(j=e.props).onClick)==null||S.call(j,C)},"aria-expanded":_,"aria-controls":T,"aria-haspopup":"dialog"});return t.jsxs(t.Fragment,{children:[I,f&&H.createPortal(t.jsx("div",{ref:g,id:T,role:"dialog","aria-modal":"false",className:m("vyre-popover",`vyre-popover--${E}`,b&&"vyre-popover--leaving",d),style:{top:u.top,left:u.left},children:a}),document.body)]})};Ge.displayName="VyrePopover";const ee=n.createContext(null),Xe=n.createContext(null),vr=120,ze=({trigger:e,children:a,placement:r="bottom-start",className:s})=>{const[o,i]=n.useState(!1),[d,l]=n.useState(!1),[c,x]=n.useState(!1),[b,y]=n.useState({top:0,left:0}),[f,p]=n.useState(-1),u=n.useRef(null),v=n.useRef(null),_=n.useRef(null),h=n.useId(),g=n.useCallback(()=>{var L;return Array.from(((L=v.current)==null?void 0:L.querySelectorAll("[role=menuitem]:not([aria-disabled=true]):not([disabled]),[role=menuitemcheckbox]:not([aria-disabled=true]):not([disabled]),[role=menuitemradio]:not([aria-disabled=true]):not([disabled])"))??[])},[]),N=n.useCallback(()=>{l(!0),_.current=setTimeout(()=>{var L;l(!1),x(!1),i(!1),p(-1),(L=u.current)==null||L.focus({preventScroll:!0})},vr)},[]),T=n.useCallback(()=>{_.current&&(clearTimeout(_.current),_.current=null),l(!1),i(!0),x(!0)},[]),E=n.useCallback(()=>{o?N():T()},[o,T,N]);n.useEffect(()=>{if(!c||!u.current)return;const L=u.current.getBoundingClientRect(),I=4,C=window.scrollX,j=window.scrollY;let S=0,R=0;r.startsWith("bottom")?(S=L.bottom+j+I,R=r==="bottom-start"?L.left+C:L.right+C):(S=L.top+j-I,R=r==="top-start"?L.left+C:L.right+C),y({top:S,left:R}),requestAnimationFrame(()=>{var P;(P=g()[0])==null||P.focus({preventScroll:!0}),p(0)})},[c,r,g]),n.useEffect(()=>{if(!c)return;const L=C=>{v.current&&!v.current.contains(C.target)&&u.current&&!u.current.contains(C.target)&&N()},I=C=>{var j,S,R;if(C.key==="Escape"){N();return}if(C.key==="ArrowDown"||C.key==="ArrowUp"){C.preventDefault();const M=g();if(!M.length)return;const P=C.key==="ArrowDown"?1:-1,Z=(f+P+M.length)%M.length;(j=M[Z])==null||j.focus({preventScroll:!0}),p(Z)}if(C.key==="Home"&&((S=g()[0])==null||S.focus({preventScroll:!0}),p(0)),C.key==="End"){const M=g();(R=M[M.length-1])==null||R.focus({preventScroll:!0}),p(M.length-1)}};return document.addEventListener("mousedown",L),document.addEventListener("keydown",I),()=>{document.removeEventListener("mousedown",L),document.removeEventListener("keydown",I)}},[c,f,N,g]);const W=n.cloneElement(e,{ref:u,onClick:L=>{var I,C;E(),(C=(I=e.props).onClick)==null||C.call(I,L)},"aria-expanded":o,"aria-haspopup":"menu","aria-controls":h}),V=r.endsWith("-end"),B=r.startsWith("top");return t.jsxs(ee.Provider,{value:{close:N},children:[W,c&&H.createPortal(t.jsx("div",{ref:v,id:h,role:"menu","aria-orientation":"vertical",className:m("vyre-dropdown",V&&"vyre-dropdown--end",B&&"vyre-dropdown--top",d&&"vyre-dropdown--leaving",s),style:{top:b.top,left:b.left,transform:V?"translateX(-100%)":void 0},children:a}),document.body)]})};ze.displayName="VyreDropdownMenu";const Ze=({children:e,className:a})=>t.jsx("div",{className:m("vyre-dropdown__label",a),children:e});Ze.displayName="VyreDropdownLabel";const Je=({children:e,onSelect:a,disabled:r=!1,variant:s="default",icon:o,shortcut:i,className:d})=>{const l=n.useContext(ee);return t.jsxs("button",{role:"menuitem",className:m("vyre-dropdown__item",s==="danger"&&"vyre-dropdown__item--danger",d),"aria-disabled":r||void 0,disabled:r,tabIndex:-1,onClick:()=>{r||(a==null||a(),l==null||l.close())},children:[o&&t.jsx("span",{className:"vyre-dropdown__item-icon","aria-hidden":"true",children:o}),t.jsx("span",{className:"vyre-dropdown__item-label",children:e}),i&&t.jsx("kbd",{className:"vyre-dropdown__item-shortcut",children:i})]})};Je.displayName="VyreDropdownItem";const Qe=({children:e,checked:a,onCheckedChange:r,disabled:s=!1,shortcut:o,className:i})=>{const d=n.useContext(ee);return t.jsxs("button",{role:"menuitemcheckbox","aria-checked":a,"aria-disabled":s||void 0,disabled:s,tabIndex:-1,className:m("vyre-dropdown__item vyre-dropdown__item--checkbox",i),onClick:()=>{s||(r(!a),d==null||d.close())},children:[t.jsx("span",{className:"vyre-dropdown__item-indicator","aria-hidden":"true",children:a&&t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:t.jsx("path",{d:"M2 6l3 3 5-5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}),t.jsx("span",{className:"vyre-dropdown__item-label",children:e}),o&&t.jsx("kbd",{className:"vyre-dropdown__item-shortcut",children:o})]})};Qe.displayName="VyreDropdownCheckboxItem";const et=({value:e,onValueChange:a,children:r})=>t.jsx(Xe.Provider,{value:{value:e,onValueChange:a},children:t.jsx("div",{role:"group",children:r})});et.displayName="VyreDropdownRadioGroup";const tt=({children:e,value:a,disabled:r=!1,className:s})=>{const o=n.useContext(ee),i=n.useContext(Xe),d=(i==null?void 0:i.value)===a;return t.jsxs("button",{role:"menuitemradio","aria-checked":d,"aria-disabled":r||void 0,disabled:r,tabIndex:-1,className:m("vyre-dropdown__item vyre-dropdown__item--radio",s),onClick:()=>{r||(i==null||i.onValueChange(a),o==null||o.close())},children:[t.jsx("span",{className:"vyre-dropdown__item-indicator","aria-hidden":"true",children:d&&t.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",children:t.jsx("circle",{cx:"4",cy:"4",r:"3",fill:"currentColor"})})}),t.jsx("span",{className:"vyre-dropdown__item-label",children:e})]})};tt.displayName="VyreDropdownRadioItem";const rt=({trigger:e,children:a,icon:r,placement:s="right",disabled:o=!1,className:i})=>{const[d,l]=n.useState(!1),[c,x]=n.useState({top:0,left:0}),b=n.useRef(null),y=n.useRef(null),f=n.useCallback(()=>{if(!b.current)return;const v=b.current.getBoundingClientRect(),_=window.scrollX,h=window.scrollY,g=2;x({top:v.top+h,left:s==="right"?v.right+_+g:v.left+_-g}),l(!0)},[s]),p=n.useCallback(()=>l(!1),[]),u=v=>{var h;const _=v.relatedTarget;(h=y.current)!=null&&h.contains(_)||p()};return t.jsxs(t.Fragment,{children:[t.jsxs("button",{ref:b,role:"menuitem","aria-haspopup":"menu","aria-expanded":d,"aria-disabled":o||void 0,disabled:o,tabIndex:-1,className:m("vyre-dropdown__item vyre-dropdown__item--sub",i),onMouseEnter:f,onMouseLeave:u,onFocus:f,children:[r&&t.jsx("span",{className:"vyre-dropdown__item-icon","aria-hidden":"true",children:r}),t.jsx("span",{className:"vyre-dropdown__item-label",children:e}),t.jsx("span",{className:"vyre-dropdown__item-chevron","aria-hidden":"true",children:t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:t.jsx("path",{d:s==="right"?"M4 2l4 4-4 4":"M8 2L4 6l4 4",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),d&&H.createPortal(t.jsx("div",{ref:y,role:"menu",className:m("vyre-dropdown vyre-dropdown--sub",s==="left"&&"vyre-dropdown--sub-left"),style:{position:"absolute",top:c.top,left:s==="right"?c.left:void 0,right:s==="left"?`calc(100vw - ${c.left}px)`:void 0,transform:s==="left"?"translateX(-100%)":void 0},onMouseLeave:v=>{var h;const _=v.relatedTarget;(h=b.current)!=null&&h.contains(_)||p()},children:a}),document.body)]})};rt.displayName="VyreDropdownSub";const at=({className:e})=>t.jsx("div",{role:"separator",className:m("vyre-dropdown__separator",e)});at.displayName="VyreDropdownSeparator";const yr=()=>t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.4"}),t.jsx("path",{d:"M8 7v4M8 5v.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),fr=()=>t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.4"}),t.jsx("path",{d:"M5 8l2 2 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),hr=()=>t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[t.jsx("path",{d:"M8 2L14.5 13H1.5L8 2Z",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round"}),t.jsx("path",{d:"M8 6v3M8 11v.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),br=()=>t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.4"}),t.jsx("path",{d:"M6 6l4 4M10 6l-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),nt={info:yr,success:fr,warning:hr,danger:br},st=({variant:e="info",title:a,icon:r,onClose:s,children:o,className:i})=>{const d=nt[e];return t.jsxs("div",{role:"alert",className:m("vyre-alert",`vyre-alert--${e}`,i),children:[t.jsx("span",{className:"vyre-alert__icon","aria-hidden":"true",children:r??t.jsx(d,{})}),t.jsxs("div",{className:"vyre-alert__body",children:[a&&t.jsx("p",{className:"vyre-alert__title",children:a}),o&&t.jsx("div",{className:"vyre-alert__description",children:o})]}),s&&t.jsx("button",{type:"button",className:"vyre-alert__close","aria-label":"Dismiss",onClick:s,children:t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M3 3l8 8M11 3l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]})};st.displayName="VyreAlert";const xr=["button:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(","),ot=({open:e,onOpenChange:a,title:r,description:s,variant:o="danger",confirmLabel:i="Confirm",cancelLabel:d="Cancel",onConfirm:l,onCancel:c,className:x})=>{const b=n.useRef(null),y=n.useRef(null),f=n.useRef(null),p=n.useCallback(()=>{c==null||c(),a(!1)},[c,a]),u=n.useCallback(()=>{l==null||l(),a(!1)},[l,a]),v=n.useCallback(h=>{if(h.key!=="Tab")return;const g=b.current;if(!g)return;const N=Array.from(g.querySelectorAll(xr));if(!N.length)return;const T=N[0],E=N[N.length-1];h.shiftKey&&document.activeElement===T?(h.preventDefault(),E.focus()):!h.shiftKey&&document.activeElement===E&&(h.preventDefault(),T.focus())},[]);if(n.useEffect(()=>{if(!e)return;document.addEventListener("keydown",v);const h=document.body.style.overflow;document.body.style.overflow="hidden";const g=N=>{N.key==="Escape"&&p()};return document.addEventListener("keydown",g),setTimeout(()=>{var N;return(N=f.current)==null?void 0:N.focus()},0),()=>{document.removeEventListener("keydown",v),document.removeEventListener("keydown",g),document.body.style.overflow=h}},[e,v,p]),!e)return null;const _=nt[o];return H.createPortal(t.jsx("div",{ref:y,className:"vyre-alert-dialog-backdrop",onClick:h=>{h.target===y.current&&p()},role:"presentation",children:t.jsxs("div",{ref:b,role:"alertdialog","aria-modal":"true","aria-labelledby":"vyre-ad-title","aria-describedby":s?"vyre-ad-desc":void 0,className:m("vyre-alert-dialog",`vyre-alert-dialog--${o}`,x),tabIndex:-1,children:[t.jsx("div",{className:"vyre-alert-dialog__icon-wrap",children:t.jsx("span",{className:m("vyre-alert-dialog__icon",`vyre-alert-dialog__icon--${o}`),children:t.jsx(_,{})})}),t.jsxs("div",{className:"vyre-alert-dialog__body",children:[t.jsx("h2",{id:"vyre-ad-title",className:"vyre-alert-dialog__title",children:r}),s&&t.jsx("p",{id:"vyre-ad-desc",className:"vyre-alert-dialog__description",children:s})]}),t.jsxs("div",{className:"vyre-alert-dialog__footer",children:[t.jsx("button",{ref:f,type:"button",className:"vyre-btn vyre-btn--ghost vyre-btn--sm",onClick:p,children:d}),t.jsx("button",{type:"button",className:m("vyre-btn vyre-btn--sm",o==="danger"&&"vyre-btn--danger",o==="warning"&&"vyre-btn--primary",o==="info"&&"vyre-btn--accent"),onClick:u,children:i})]})]})}),document.body)};ot.displayName="VyreAlertDialog";const pr=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(","),it=n.forwardRef(({open:e,onClose:a,side:r="right",size:s="md",closeOnBackdrop:o=!0,closeOnEsc:i=!0,className:d,children:l,"aria-label":c,"aria-labelledby":x,...b},y)=>{const f=n.useRef(null),p=n.useRef(null),u=n.useCallback(v=>{if(v.key!=="Tab")return;const _=f.current;if(!_)return;const h=Array.from(_.querySelectorAll(pr));if(!h.length)return;const g=h[0],N=h[h.length-1];v.shiftKey&&document.activeElement===g?(v.preventDefault(),N.focus()):!v.shiftKey&&document.activeElement===N&&(v.preventDefault(),g.focus())},[]);return n.useEffect(()=>{if(!e)return;if(document.addEventListener("keydown",u),i){const _=g=>{g.key==="Escape"&&a()};document.addEventListener("keydown",_);const h=document.body.style.overflow;return document.body.style.overflow="hidden",setTimeout(()=>{var g;return(g=f.current)==null?void 0:g.focus()},0),()=>{document.removeEventListener("keydown",u),document.removeEventListener("keydown",_),document.body.style.overflow=h}}const v=document.body.style.overflow;return document.body.style.overflow="hidden",setTimeout(()=>{var _;return(_=f.current)==null?void 0:_.focus()},0),()=>{document.removeEventListener("keydown",u),document.body.style.overflow=v}},[e,u,i,a]),e?H.createPortal(t.jsx("div",{ref:p,className:"vyre-sheet-backdrop",onClick:v=>{o&&v.target===p.current&&a()},role:"presentation",children:t.jsx("div",{ref:v=>{f.current=v,typeof y=="function"?y(v):y&&(y.current=v)},role:"dialog","aria-modal":"true","aria-label":c,"aria-labelledby":x,tabIndex:-1,className:m("vyre-sheet",`vyre-sheet--${r}`,`vyre-sheet--${s}`,d),...b,children:l})}),document.body):null});it.displayName="VyreSheet";const lt=n.forwardRef(({className:e,children:a,...r},s)=>t.jsx("div",{ref:s,className:m("vyre-sheet__header",e),...r,children:a}));lt.displayName="VyreSheetHeader";const ct=n.forwardRef(({className:e,children:a,...r},s)=>t.jsx("div",{ref:s,className:m("vyre-sheet__body",e),...r,children:a}));ct.displayName="VyreSheetBody";const dt=n.forwardRef(({className:e,children:a,...r},s)=>t.jsx("div",{ref:s,className:m("vyre-sheet__footer",e),...r,children:a}));dt.displayName="VyreSheetFooter";const ut=({children:e,separator:a="/",className:r})=>{const s=n.Children.toArray(e).filter(Boolean);return t.jsx("nav",{"aria-label":"Breadcrumb",className:m("vyre-breadcrumb",r),children:t.jsx("ol",{className:"vyre-breadcrumb__list",children:s.map((o,i)=>t.jsxs("li",{className:"vyre-breadcrumb__item",children:[o,i<s.length-1&&t.jsx("span",{className:"vyre-breadcrumb__separator","aria-hidden":"true",children:a})]},i))})})};ut.displayName="VyreBreadcrumb";const mt=({children:e,href:a,current:r=!1,className:s})=>r||!a?t.jsx("span",{className:m("vyre-breadcrumb__link vyre-breadcrumb__link--current",s),"aria-current":r?"page":void 0,children:e}):t.jsx("a",{href:a,className:m("vyre-breadcrumb__link",s),children:e});mt.displayName="VyreBreadcrumbItem";const vt=({children:e,href:a,className:r})=>t.jsx("a",{href:a,className:m("vyre-breadcrumb__link",r),children:e});vt.displayName="VyreBreadcrumbLink";const yt=({children:e="/",className:a})=>t.jsx("span",{className:m("vyre-breadcrumb__separator",a),"aria-hidden":"true",children:e});yt.displayName="VyreBreadcrumbSeparator";function le(e,a){return Array.from({length:a-e+1},(r,s)=>e+s)}function _r(e,a,r){const s=r*2+5;if(a<=s)return le(1,a);const o=Math.max(e-r,2),i=Math.min(e+r,a-1),d=o>2,l=i<a-1,c=[1];return d&&c.push("..."),c.push(...le(o,i)),l&&c.push("..."),c.push(a),c}const wr=()=>t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M9 2L4 7l5 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),jr=()=>t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M5 2l5 5-5 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),gr=()=>t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M7 2L2 7l5 5M12 2L7 7l5 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),kr=()=>t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M2 2l5 5-5 5M7 2l5 5-5 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),ft=({page:e,totalPages:a,onPageChange:r,siblings:s=1,showEdges:o=!0,showInfo:i=!1,totalItems:d,pageSize:l,className:c})=>{const x=_r(e,a,s),b=e>1,y=e<a,f=n.useMemo(()=>{if(!i)return null;if(d!=null&&l!=null){const u=(e-1)*l+1,v=Math.min(e*l,d);return`Showing ${u}–${v} of ${d}`}return`Page ${e} of ${a}`},[i,e,a,d,l]),p=t.jsxs(t.Fragment,{children:[o&&t.jsx("button",{className:"vyre-pagination__nav",onClick:()=>r(1),disabled:!b,"aria-label":"First page",children:t.jsx(gr,{})}),t.jsx("button",{className:"vyre-pagination__nav",onClick:()=>r(e-1),disabled:!b,"aria-label":"Previous page",children:t.jsx(wr,{})}),t.jsx("ol",{className:"vyre-pagination__list",children:x.map((u,v)=>u==="..."?t.jsx("li",{children:t.jsx("span",{className:"vyre-pagination__dots","aria-hidden":"true",children:"···"})},`dots-${v}`):t.jsx("li",{children:t.jsx("button",{className:m("vyre-pagination__btn",u===e&&"vyre-pagination__btn--active"),onClick:()=>r(u),"aria-label":`Page ${u}`,"aria-current":u===e?"page":void 0,children:u})},u))}),t.jsx("button",{className:"vyre-pagination__nav",onClick:()=>r(e+1),disabled:!y,"aria-label":"Next page",children:t.jsx(jr,{})}),o&&t.jsx("button",{className:"vyre-pagination__nav",onClick:()=>r(a),disabled:!y,"aria-label":"Last page",children:t.jsx(kr,{})})]});return i?t.jsxs("div",{className:m("vyre-pagination-row",c),children:[t.jsx("span",{className:"vyre-pagination__info",children:f}),t.jsx("nav",{"aria-label":"Pagination",className:"vyre-pagination",children:p})]}):t.jsx("nav",{"aria-label":"Pagination",className:m("vyre-pagination",c),children:p})};ft.displayName="VyrePagination";const ht=({children:e,striped:a=!1,bordered:r=!1,compact:s=!1,hoverable:o=!0,className:i})=>t.jsx("div",{className:"vyre-table-wrapper",children:t.jsx("table",{className:m("vyre-table",a&&"vyre-table--striped",r&&"vyre-table--bordered",s&&"vyre-table--compact",o&&"vyre-table--hoverable",i),children:e})});ht.displayName="VyreTable";const bt=n.forwardRef(({className:e,...a},r)=>t.jsx("thead",{ref:r,className:m("vyre-table__head",e),...a}));bt.displayName="VyreTableHead";const xt=n.forwardRef(({className:e,...a},r)=>t.jsx("tbody",{ref:r,className:m("vyre-table__body",e),...a}));xt.displayName="VyreTableBody";const pt=n.forwardRef(({className:e,selected:a,...r},s)=>t.jsx("tr",{ref:s,className:m("vyre-table__row",a&&"vyre-table__row--selected",e),"aria-selected":a,...r}));pt.displayName="VyreTableRow";const Nr=({dir:e})=>t.jsx("span",{className:"vyre-table__sort-icon","aria-hidden":"true",children:t.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:[t.jsx("path",{d:"M6 2v8M3 5l3-3 3 3",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",opacity:e==="desc"?.3:1}),t.jsx("path",{d:"M3 7l3 3 3-3",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",opacity:e==="asc"?.3:1})]})}),_t=n.forwardRef(({className:e,sortable:a,sortDir:r=null,onSort:s,align:o="left",children:i,...d},l)=>a?t.jsx("th",{ref:l,className:m("vyre-table__th vyre-table__th--sortable",`vyre-table__th--${o}`,r&&`vyre-table__th--sort-${r}`,e),"aria-sort":r==="asc"?"ascending":r==="desc"?"descending":"none",...d,children:t.jsxs("button",{className:"vyre-table__sort-btn",onClick:s,type:"button",children:[i,t.jsx(Nr,{dir:r})]})}):t.jsx("th",{ref:l,className:m("vyre-table__th",`vyre-table__th--${o}`,e),...d,children:i}));_t.displayName="VyreTableHeader";const wt=n.forwardRef(({className:e,align:a="left",...r},s)=>t.jsx("td",{ref:s,className:m("vyre-table__td",`vyre-table__td--${a}`,e),...r}));wt.displayName="VyreTableCell";const jt=n.forwardRef(({className:e,...a},r)=>t.jsx("caption",{ref:r,className:m("vyre-table__caption",e),...a}));jt.displayName="VyreTableCaption";const gt=n.createContext(null),te=()=>{const e=n.useContext(gt);if(!e)throw new Error("Command components must be used inside <Command>");return e};function ae(e){return e.toLowerCase().replace(/\s+/g," ").trim()}function Cr(e,a,r=[]){if(!e)return!0;const s=ae(e);return ae(a).includes(s)||r.some(o=>ae(o).includes(s))}let Sr=0;function Rr(){return`cmd-${++Sr}`}const se=n.forwardRef(({value:e,onValueChange:a,className:r,children:s},o)=>{const[i,d]=n.useState(""),[l,c]=n.useState(0),[x,b]=n.useState(0),y=e!==void 0?e:i,f=n.useCallback(N=>{d(N),a==null||a(N),c(0)},[a]),p=n.useRef(new Map),u=n.useRef(new Map),v=n.useCallback((N,T,E)=>{p.current.set(N,{el:T,disabled:E})},[]),_=n.useCallback(N=>{p.current.delete(N),u.current.delete(N)},[]),h=n.useCallback(N=>{var T;(T=u.current.get(N))==null||T()},[]),g=n.useMemo(()=>({search:y,setSearch:f,activeIndex:l,setActiveIndex:c,items:p,registerItem:v,unregisterItem:_,selectItem:h,onSelectRef:u,visibleCount:x,setVisibleCount:b}),[y,f,l,v,_,h,x]);return t.jsx(gt.Provider,{value:g,children:t.jsx("div",{ref:o,className:m("vyre-command",r),role:"combobox","aria-expanded":"true","aria-haspopup":"listbox",children:s})})});se.displayName="VyreCommand";const kt=n.forwardRef(({placeholder:e="Search...",className:a},r)=>{const{search:s,setSearch:o}=te();return t.jsxs("div",{className:"vyre-command__input-wrapper",children:[t.jsx("svg",{className:"vyre-command__search-icon",width:"15",height:"15",viewBox:"0 0 15 15",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M10 6.5a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0ZM9.5 10.207l3.146 3.147",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})}),t.jsx("input",{ref:r,className:m("vyre-command__input",a),type:"text",placeholder:e,value:s,onChange:i=>o(i.target.value),autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list","aria-controls":"vyre-command-list"}),s&&t.jsx("button",{className:"vyre-command__clear",type:"button","aria-label":"Clear search",onClick:()=>o(""),children:t.jsx("svg",{width:"13",height:"13",viewBox:"0 0 13 13",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M2 2l9 9M11 2l-9 9",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})})]})});kt.displayName="VyreCommandInput";const Nt=n.forwardRef(({className:e,children:a},r)=>{const{activeIndex:s,setActiveIndex:o,items:i,selectItem:d}=te(),l=n.useCallback(c=>{var b,y;const x=Array.from((i.current??new Map).entries()).filter(([,f])=>!f.disabled&&f.el.closest("[data-cmd-item]")!==null&&!f.el.hasAttribute("data-cmd-hidden"));if(c.key==="ArrowDown")c.preventDefault(),o(Math.min(s+1,x.length-1)),(b=x[Math.min(s+1,x.length-1)])==null||b[1].el.scrollIntoView({block:"nearest"});else if(c.key==="ArrowUp")c.preventDefault(),o(Math.max(s-1,0)),(y=x[Math.max(s-1,0)])==null||y[1].el.scrollIntoView({block:"nearest"});else if(c.key==="Enter"){c.preventDefault();const[f]=x[s]??[];f&&d(f)}},[s,o,i,d]);return t.jsx("div",{ref:r,id:"vyre-command-list",role:"listbox",className:m("vyre-command__list",e),onKeyDown:l,children:a})});Nt.displayName="VyreCommandList";const Ct=({className:e,children:a})=>{const{search:r,visibleCount:s}=te();return!r||s>0?null:t.jsx("div",{className:m("vyre-command__empty",e),role:"presentation",children:a??"No results found."})};Ct.displayName="VyreCommandEmpty";const St=({heading:e,className:a,children:r})=>t.jsxs("div",{className:m("vyre-command__group",a),role:"presentation",children:[e&&t.jsx("div",{className:"vyre-command__group-heading","aria-hidden":"true",children:e}),t.jsx("div",{role:"group","aria-label":e,children:r})]});St.displayName="VyreCommandGroup";const Rt=({onSelect:e,disabled:a=!1,keywords:r,className:s,children:o,icon:i,shortcut:d})=>{const{search:l,setActiveIndex:c,registerItem:x,unregisterItem:b,onSelectRef:y,setVisibleCount:f}=te(),p=n.useMemo(()=>Rr(),[]),u=n.useRef(null),_=Cr(l,typeof o=="string"?o:"",r);return n.useEffect(()=>(f(h=>h+(_?1:0)),()=>{f(h=>h-(_?1:0))}),[_,f]),n.useEffect(()=>{const h=u.current;if(!(!h||!_))return x(p,h,a),()=>b(p)},[p,a,_,x,b]),n.useEffect(()=>{var h;return e&&((h=y.current)==null||h.set(p,e)),()=>{var g;(g=y.current)==null||g.delete(p)}},[p,e,y]),_?t.jsxs("div",{ref:u,"data-cmd-item":!0,role:"option","aria-disabled":a||void 0,className:m("vyre-command__item",a&&"vyre-command__item--disabled",s),onClick:()=>{a||e==null||e()},onMouseEnter:()=>{!a&&u.current&&c(-1)},children:[i&&t.jsx("span",{className:"vyre-command__item-icon","aria-hidden":"true",children:i}),t.jsx("span",{className:"vyre-command__item-label",children:o}),d&&t.jsx("kbd",{className:"vyre-command__item-shortcut",children:d})]}):null};Rt.displayName="VyreCommandItem";const Lt=({className:e})=>t.jsx("div",{className:m("vyre-command__separator",e),role:"separator","aria-hidden":"true"});Lt.displayName="VyreCommandSeparator";const Mt=({open:e,onOpenChange:a,value:r,onValueChange:s,className:o,children:i})=>{const d=n.useRef(null);return n.useEffect(()=>{var x;if(!e)return;const l=document.activeElement,c=(x=d.current)==null?void 0:x.querySelector(".vyre-command__input");return c==null||c.focus(),()=>{l==null||l.focus({preventScroll:!0})}},[e]),n.useEffect(()=>{if(!e)return;const l=c=>{c.key==="Escape"&&a(!1)};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e,a]),e?H.createPortal(t.jsx("div",{className:"vyre-command-backdrop",ref:d,onClick:l=>{l.target===l.currentTarget&&a(!1)},role:"dialog","aria-modal":"true","aria-label":"Command palette",children:t.jsx(se,{value:r,onValueChange:s,className:m("vyre-command--dialog",o),children:i})}),document.body):null};Mt.displayName="VyreCommandDialog";function U(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function F(e,a){return e.getFullYear()===a.getFullYear()&&e.getMonth()===a.getMonth()&&e.getDate()===a.getDate()}function X(e,a){return U(e)<U(a)}function ce(e,a){return U(e)>U(a)}function Lr(e,a){return new Date(e,a+1,0).getDate()}function Mr(e,a,r){return(new Date(e,a,1).getDay()-r+7)%7}function q(e,a){return e?new Intl.DateTimeFormat("default",{year:"numeric",month:"short",day:"numeric"}).format(e):""}function Tr(e){return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`}const de=Array.from({length:12},(e,a)=>new Intl.DateTimeFormat("default",{month:"long"}).format(new Date(2e3,a,1))),z=12,oe=n.forwardRef((e,a)=>{const{showTime:r=!1,minDate:s,maxDate:o,disabled:i,className:d,weekStartsOn:l=1}=e,c=U(new Date),x=()=>{var w,k;return e.mode==="range"?((w=e.value)==null?void 0:w[0])??c:e.mode==="multiple"?((k=e.value)==null?void 0:k[0])??c:e.value??c},[b,y]=n.useState(()=>(x()??c).getFullYear()),[f,p]=n.useState(()=>(x()??c).getMonth()),[u,v]=n.useState("days"),[_,h]=n.useState(null),[g,N]=n.useState(()=>{const w=e.mode==="single"?e.value:null;return w?w.getHours():0}),[T,E]=n.useState(()=>{const w=e.mode==="single"?e.value:null;return w?w.getMinutes():0}),W=n.useMemo(()=>{const w=Lr(b,f),k=Mr(b,f,l);return{count:w,offset:k}},[b,f,l]),V=n.useMemo(()=>l===1?["Mo","Tu","We","Th","Fr","Sa","Su"]:["Su","Mo","Tu","We","Th","Fr","Sa"],[l]),B=n.useCallback(w=>{if(e.mode==="single")return!!e.value&&F(w,e.value);if(e.mode==="range"){const[k,D]=e.value??[null,null];return!!k&&F(w,k)||!!D&&F(w,D)}return e.mode==="multiple"?(e.value??[]).some(k=>F(w,k)):!1},[e]),L=n.useCallback(w=>{if(e.mode!=="range")return!1;const[k,D]=e.value??[null,null],A=D??_;if(!k||!A)return!1;const O=X(k,A)?k:A,K=X(k,A)?A:k;return ce(w,O)&&X(w,K)},[e,_]),I=n.useCallback(w=>{if(e.mode!=="range")return!1;const[k]=e.value??[null,null];return!!k&&F(w,k)},[e]),C=n.useCallback(w=>{if(e.mode!=="range")return!1;const[,k]=e.value??[null,null];return!!k&&F(w,k)},[e]),j=n.useCallback(w=>!!(s&&X(w,s)||o&&ce(w,o)||i!=null&&i(w)),[s,o,i]),S=n.useCallback(w=>{var D,A,O,K,G,J;const k=new Date(b,f,w,g,T);if(!j(U(k))){if(e.mode==="single"||!e.mode)(D=e.onChange)==null||D.call(e,k);else if(e.mode==="range"){const[$,Y]=e.value??[null,null];!$||$&&Y?(A=e.onChange)==null||A.call(e,[k,null]):X(k,$)?(O=e.onChange)==null||O.call(e,[k,$]):(K=e.onChange)==null||K.call(e,[$,k])}else if(e.mode==="multiple"){const $=e.value??[],Y=$.findIndex(ie=>F(ie,k));Y>=0?(G=e.onChange)==null||G.call(e,$.filter((ie,Xt)=>Xt!==Y)):(J=e.onChange)==null||J.call(e,[...$,k])}}},[b,f,g,T,e,j]),R=()=>{f===0?(p(11),y(w=>w-1)):p(w=>w-1)},M=()=>{f===11?(p(0),y(w=>w+1)):p(w=>w+1)},P=(w,k)=>{var D;if(N(w),E(k),e.mode==="single"&&e.value){const A=new Date(e.value);A.setHours(w,k),(D=e.onChange)==null||D.call(e,A)}},Z=Math.floor(b/z)*z;return t.jsxs("div",{ref:a,className:m("vyre-calendar",d),children:[t.jsxs("div",{className:"vyre-calendar__header",children:[u==="days"&&t.jsx("button",{className:"vyre-calendar__nav",onClick:R,"aria-label":"Previous month",children:t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:t.jsx("path",{d:"M9 11L5 7l4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),u==="years"&&t.jsx("button",{className:"vyre-calendar__nav",onClick:()=>y(w=>w-z),"aria-label":"Previous years",children:t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:t.jsx("path",{d:"M9 11L5 7l4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),t.jsxs("div",{className:"vyre-calendar__header-center",children:[t.jsx("button",{className:"vyre-calendar__header-btn",onClick:()=>v(u==="months"?"days":"months"),children:de[f]}),t.jsx("button",{className:"vyre-calendar__header-btn",onClick:()=>v(u==="years"?"days":"years"),children:b})]}),u==="days"&&t.jsx("button",{className:"vyre-calendar__nav",onClick:M,"aria-label":"Next month",children:t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:t.jsx("path",{d:"M5 3l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),u==="years"&&t.jsx("button",{className:"vyre-calendar__nav",onClick:()=>y(w=>w+z),"aria-label":"Next years",children:t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:t.jsx("path",{d:"M5 3l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),u==="months"&&t.jsx("div",{className:"vyre-calendar__month-grid",children:de.map((w,k)=>t.jsx("button",{className:m("vyre-calendar__month-cell",k===f&&"vyre-calendar__month-cell--active"),onClick:()=>{p(k),v("days")},children:w.slice(0,3)},w))}),u==="years"&&t.jsx("div",{className:"vyre-calendar__year-grid",children:Array.from({length:z},(w,k)=>Z+k).map(w=>t.jsx("button",{className:m("vyre-calendar__year-cell",w===b&&"vyre-calendar__year-cell--active"),onClick:()=>{y(w),v("days")},children:w},w))}),u==="days"&&t.jsxs("div",{className:"vyre-calendar__grid",children:[V.map(w=>t.jsx("div",{className:"vyre-calendar__weekday",children:w},w)),Array.from({length:W.offset}).map((w,k)=>t.jsx("div",{},`empty-${k}`)),Array.from({length:W.count},(w,k)=>k+1).map(w=>{const k=new Date(b,f,w),D=B(k),A=L(k),O=I(k),K=C(k),G=j(k),J=F(k,c);return t.jsx("button",{className:m("vyre-calendar__day",J&&"vyre-calendar__day--today",D&&"vyre-calendar__day--selected",A&&"vyre-calendar__day--in-range",O&&"vyre-calendar__day--range-start",K&&"vyre-calendar__day--range-end",G&&"vyre-calendar__day--disabled"),onClick:()=>S(w),onMouseEnter:()=>{if(e.mode==="range"){const[$,Y]=e.value??[null,null];$&&!Y&&h(k)}},onMouseLeave:()=>h(null),disabled:G,"aria-selected":D,"aria-label":q(k),children:w},w)})]}),r&&u==="days"&&t.jsxs("div",{className:"vyre-calendar__time",children:[t.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"7",cy:"7",r:"5.5",stroke:"currentColor",strokeWidth:"1.3"}),t.jsx("path",{d:"M7 4v3.5l2 1.5",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]}),t.jsx("input",{type:"number",className:"vyre-calendar__time-input",min:0,max:23,value:g,onChange:w=>P(Number(w.target.value),T),"aria-label":"Hours"}),t.jsx("span",{className:"vyre-calendar__time-sep",children:":"}),t.jsx("input",{type:"number",className:"vyre-calendar__time-input",min:0,max:59,value:T,onChange:w=>P(g,Number(w.target.value)),"aria-label":"Minutes"})]})]})});oe.displayName="VyreCalendar";function Er(e){if(e.mode==="range"){const[s,o]=e.value??[null,null];return s?o?`${q(s)} – ${q(o)}`:q(s):""}if(e.mode==="multiple"){const s=e.value??[];return s.length===0?"":s.length===1?q(s[0]):`${s.length} dates selected`}const a=e.value,r=e.showTime;return a?r?`${q(a)} ${Tr(a)}`:q(a):""}const Tt=n.forwardRef(({placeholder:e="Pick a date",inputClassName:a,...r},s)=>{const[o,i]=n.useState(!1),d=n.useRef(null),l=n.useRef(null),[c,x]=n.useState({top:0,left:0,width:0}),b=Er(r),y=n.useCallback(()=>{if(!d.current)return;const u=d.current.getBoundingClientRect();x({top:u.bottom+window.scrollY+6,left:u.left+window.scrollX,width:u.width})},[]);n.useEffect(()=>{if(!o)return;y();const u=()=>y(),v=()=>y();return window.addEventListener("scroll",u,!0),window.addEventListener("resize",v),()=>{window.removeEventListener("scroll",u,!0),window.removeEventListener("resize",v)}},[o,y]),n.useEffect(()=>{if(!o)return;const u=_=>{var h,g;!((h=l.current)!=null&&h.contains(_.target))&&!((g=d.current)!=null&&g.contains(_.target))&&i(!1)},v=_=>{_.key==="Escape"&&i(!1)};return document.addEventListener("pointerdown",u),document.addEventListener("keydown",v),()=>{document.removeEventListener("pointerdown",u),document.removeEventListener("keydown",v)}},[o]);const f=r.mode!=="range"&&r.mode!=="multiple"&&!r.showTime,p=n.useMemo(()=>r.mode==="range"?{...r,onChange:u=>{var v;(v=r.onChange)==null||v.call(r,u),u[0]&&u[1]&&i(!1)}}:r.mode==="multiple"?r:{...r,onChange:u=>{var v;(v=r.onChange)==null||v.call(r,u),f&&i(!1)}},[r,f]);return t.jsxs("div",{ref:s,className:"vyre-datepicker",children:[t.jsxs("button",{ref:d,type:"button",className:m("vyre-datepicker__trigger",!b&&"vyre-datepicker__trigger--placeholder",a),onClick:()=>{y(),i(u=>!u)},"aria-expanded":o,"aria-haspopup":"dialog",children:[t.jsxs("svg",{className:"vyre-datepicker__icon",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:[t.jsx("rect",{x:"1.5",y:"2.5",width:"11",height:"10",rx:"1.5",stroke:"currentColor",strokeWidth:"1.3"}),t.jsx("path",{d:"M1.5 6h11M4.5 1v3M9.5 1v3",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]}),t.jsx("span",{children:b||e}),b&&t.jsx("button",{className:"vyre-datepicker__clear",type:"button","aria-label":"Clear",onClick:u=>{var v,_,h;u.stopPropagation(),r.mode==="range"?(v=r.onChange)==null||v.call(r,[null,null]):r.mode==="multiple"?(_=r.onChange)==null||_.call(r,[]):(h=r.onChange)==null||h.call(r,null)},children:t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M2 2l8 8M10 2l-8 8",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})})]}),o&&H.createPortal(t.jsx("div",{ref:l,className:"vyre-datepicker__popover",role:"dialog","aria-label":"Date picker",style:{top:c.top,left:c.left,minWidth:c.width},children:t.jsx(oe,{...p})}),document.body)]})});Tt.displayName="VyreDatePicker";const Et=n.forwardRef(({as:e="p",size:a="md",weight:r,color:s="default",truncate:o,mono:i,className:d,children:l,...c},x)=>t.jsx(e,{ref:x,className:m("vyre-text",a!=="md"&&`vyre-text--${a}`,r&&`vyre-text--${r}`,s!=="default"&&`vyre-text--${s}`,o&&"vyre-text--truncate",i&&"vyre-text--mono",d),...c,children:l}));Et.displayName="VyreText";const It=n.forwardRef(({as:e="h2",size:a="md",weight:r="bold",color:s="default",truncate:o,className:i,children:d,...l},c)=>t.jsx(e,{ref:c,className:m("vyre-heading",`vyre-heading--${a}`,r!=="bold"&&`vyre-heading--${r}`,s!=="default"&&`vyre-text--${s}`,o&&"vyre-text--truncate",i),...l,children:d}));It.displayName="VyreHeading";const Dt=n.forwardRef(({className:e,children:a,...r},s)=>t.jsx("p",{ref:s,className:m("vyre-lead",e),...r,children:a}));Dt.displayName="VyreLead";const At=n.forwardRef(({block:e,className:a,children:r,...s},o)=>e?t.jsx("pre",{className:m("vyre-code-block",a),...s,children:t.jsx("code",{ref:o,children:r})}):t.jsx("code",{ref:o,className:m("vyre-code",a),...s,children:r}));At.displayName="VyreCode";const Bt=n.forwardRef(({className:e,children:a,...r},s)=>t.jsx("blockquote",{ref:s,className:m("vyre-blockquote",e),...r,children:a}));Bt.displayName="VyreBlockquote";const Vt=n.createContext({collapsed:!1,toggleCollapsed:()=>{}}),re=()=>n.useContext(Vt),$t=n.forwardRef(({defaultCollapsed:e=!1,collapsed:a,onCollapsedChange:r,className:s,children:o},i)=>{const[d,l]=n.useState(e),c=a!==void 0?a:d,x=n.useCallback(()=>{const b=!c;l(b),r==null||r(b)},[c,r]);return t.jsx(Vt.Provider,{value:{collapsed:c,toggleCollapsed:x},children:t.jsx("div",{ref:i,className:m("vyre-app-layout",s),children:o})})});$t.displayName="VyreAppLayout";const Wt=n.forwardRef(({variant:e="default",className:a,children:r},s)=>{const{collapsed:o}=re();return t.jsx("aside",{ref:s,className:m("vyre-sidebar",o&&"vyre-sidebar--collapsed",e==="floating"&&"vyre-sidebar--floating",a),"data-collapsed":o||void 0,children:r})});Wt.displayName="VyreSidebar";const Ht=n.forwardRef(({logo:e,title:a,className:r,children:s},o)=>t.jsxs("div",{ref:o,className:m("vyre-sidebar__header",r),children:[e&&t.jsx("span",{className:"vyre-sidebar__logo",children:e}),a&&t.jsx("span",{className:"vyre-sidebar__title",children:a}),s]}));Ht.displayName="VyreSidebarHeader";const Ft=n.forwardRef(({className:e,children:a},r)=>t.jsx("div",{ref:r,className:m("vyre-sidebar__content",e),children:a}));Ft.displayName="VyreSidebarContent";const Pt=n.forwardRef(({label:e,className:a,children:r},s)=>t.jsxs("div",{ref:s,className:m("vyre-sidebar__section",a),children:[e&&t.jsx("div",{className:"vyre-sidebar__section-label",children:e}),r]}));Pt.displayName="VyreSidebarSection";const qt=({active:e,icon:a,badge:r,href:s,onClick:o,className:i,children:d})=>{const{collapsed:l}=re(),c=m("vyre-sidebar__item",e&&"vyre-sidebar__item--active",i),x=t.jsxs(t.Fragment,{children:[a&&t.jsx("span",{className:"vyre-sidebar__item-icon",children:a}),t.jsx("span",{className:"vyre-sidebar__item-label",children:d}),r!==void 0&&t.jsx("span",{className:"vyre-sidebar__item-badge",children:r})]});return s?t.jsx("a",{href:s,className:c,"aria-current":e?"page":void 0,title:l?String(d):void 0,children:x}):t.jsx("button",{type:"button",className:c,onClick:o,"aria-pressed":e,title:l?String(d):void 0,children:x})};qt.displayName="VyreSidebarItem";const Ot=n.forwardRef(({className:e,children:a},r)=>t.jsx("div",{ref:r,className:m("vyre-sidebar__footer",e),children:a}));Ot.displayName="VyreSidebarFooter";const Kt=n.forwardRef(({className:e,children:a},r)=>t.jsx("div",{ref:r,className:m("vyre-app-shell",e),children:a}));Kt.displayName="VyreAppShell";const Yt=n.forwardRef(({className:e,children:a},r)=>t.jsx("header",{ref:r,className:m("vyre-app-bar",e),children:a}));Yt.displayName="VyreAppBar";const Ut=({className:e})=>{const{collapsed:a,toggleCollapsed:r}=re();return t.jsx("button",{type:"button",className:m("vyre-sidebar-trigger",e),onClick:r,"aria-label":a?"Expand sidebar":"Collapse sidebar","aria-expanded":!a,children:t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[t.jsx("rect",{x:"2",y:"4",width:"12",height:"1.5",rx:"0.75",fill:"currentColor"}),t.jsx("rect",{x:"2",y:"7.25",width:"8",height:"1.5",rx:"0.75",fill:"currentColor"}),t.jsx("rect",{x:"2",y:"10.5",width:"12",height:"1.5",rx:"0.75",fill:"currentColor"})]})})};Ut.displayName="VyreSidebarTrigger";const Gt=n.forwardRef(({className:e,children:a},r)=>t.jsx("div",{ref:r,className:m("vyre-page-content",e),children:a}));Gt.displayName="VyrePageContent";exports.Accordion=Be;exports.AccordionContent=We;exports.AccordionItem=Ve;exports.AccordionTrigger=$e;exports.Alert=st;exports.AlertDialog=ot;exports.AppBar=Yt;exports.AppLayout=$t;exports.AppShell=Kt;exports.Avatar=He;exports.Badge=me;exports.Blockquote=Bt;exports.Breadcrumb=ut;exports.BreadcrumbItem=mt;exports.BreadcrumbLink=vt;exports.BreadcrumbSeparator=yt;exports.Button=ue;exports.Calendar=oe;exports.Card=ve;exports.CardBody=fe;exports.CardFooter=he;exports.CardHeader=ye;exports.Checkbox=Fe;exports.Code=At;exports.Command=se;exports.CommandDialog=Mt;exports.CommandEmpty=Ct;exports.CommandGroup=St;exports.CommandInput=kt;exports.CommandItem=Rt;exports.CommandList=Nt;exports.CommandSeparator=Lt;exports.DatePicker=Tt;exports.DropdownCheckboxItem=Qe;exports.DropdownItem=Je;exports.DropdownLabel=Ze;exports.DropdownMenu=ze;exports.DropdownRadioGroup=et;exports.DropdownRadioItem=tt;exports.DropdownSeparator=at;exports.DropdownSub=rt;exports.Field=be;exports.Heading=It;exports.Input=xe;exports.Label=Ye;exports.Lead=Dt;exports.Modal=_e;exports.ModalBody=je;exports.ModalFooter=ge;exports.ModalHeader=we;exports.PageContent=Gt;exports.Pagination=ft;exports.Popover=Ge;exports.Progress=Oe;exports.Select=Ne;exports.Separator=Ke;exports.Sheet=it;exports.SheetBody=ct;exports.SheetFooter=dt;exports.SheetHeader=lt;exports.Sidebar=Wt;exports.SidebarContent=Ft;exports.SidebarFooter=Ot;exports.SidebarHeader=Ht;exports.SidebarItem=qt;exports.SidebarSection=Pt;exports.SidebarTrigger=Ut;exports.Skeleton=Ue;exports.Slider=qe;exports.Switch=Pe;exports.Tab=Me;exports.TabList=Le;exports.TabPanel=Ee;exports.TabPanels=Te;exports.Table=ht;exports.TableBody=xt;exports.TableCaption=jt;exports.TableCell=wt;exports.TableHead=bt;exports.TableHeader=_t;exports.TableRow=pt;exports.Tabs=Re;exports.Text=Et;exports.Textarea=pe;exports.ToastProvider=ar;exports.Tooltip=Ie;exports.cn=m;exports.useAppLayout=re;exports.useToast=nr;
|
package/dist/index.d.ts
CHANGED
|
@@ -62,7 +62,7 @@ export { Popover } from "./components/Popover/Popover";
|
|
|
62
62
|
export { DropdownMenu, DropdownItem, DropdownSeparator, DropdownLabel, DropdownCheckboxItem, DropdownRadioGroup, DropdownRadioItem, DropdownSub, } from "./components/DropdownMenu/DropdownMenu";
|
|
63
63
|
export { Alert, AlertDialog } from "./components/Alert/Alert";
|
|
64
64
|
export { Sheet, SheetHeader, SheetBody, SheetFooter } from "./components/Sheet/Sheet";
|
|
65
|
-
export { Breadcrumb, BreadcrumbItem } from "./components/Breadcrumb/Breadcrumb";
|
|
65
|
+
export { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbSeparator } from "./components/Breadcrumb/Breadcrumb";
|
|
66
66
|
export { Pagination } from "./components/Pagination/Pagination";
|
|
67
67
|
export { Table, TableHead, TableBody, TableRow, TableHeader, TableCell, TableCaption, } from "./components/Table/Table";
|
|
68
68
|
export { Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandSeparator, CommandDialog, } from "./components/Command/Command";
|
|
@@ -94,7 +94,7 @@ export type { PopoverProps, PopoverPlacement, PopoverSide, PopoverAlign } from "
|
|
|
94
94
|
export type { DropdownMenuProps, DropdownItemProps, DropdownPlacement, DropdownCheckboxItemProps, DropdownRadioGroupProps, DropdownRadioItemProps, DropdownSubProps, } from "./components/DropdownMenu/DropdownMenu";
|
|
95
95
|
export type { AlertProps, AlertDialogProps, AlertVariant } from "./components/Alert/Alert";
|
|
96
96
|
export type { SheetProps, SheetSectionProps, SheetSide, SheetSize } from "./components/Sheet/Sheet";
|
|
97
|
-
export type { BreadcrumbProps, BreadcrumbItemProps } from "./components/Breadcrumb/Breadcrumb";
|
|
97
|
+
export type { BreadcrumbProps, BreadcrumbItemProps, BreadcrumbLinkProps } from "./components/Breadcrumb/Breadcrumb";
|
|
98
98
|
export type { PaginationProps } from "./components/Pagination/Pagination";
|
|
99
99
|
export type { TableProps, TableRowProps, TableHeaderProps, TableCellProps, } from "./components/Table/Table";
|
|
100
100
|
export type { Variant, Size, FieldState, BadgeVariant, BaseProps } from "./types";
|