@usevyre/react 1.2.0 → 1.2.1

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.
@@ -38,6 +38,12 @@
38
38
  * │ badge = string | number │
39
39
  * │ href = string │
40
40
  * │ onClick = () => void │
41
+ * │ │
42
+ * │ SidebarTrigger props (all optional): │
43
+ * │ icon = ReactNode (shown when expanded; │
44
+ * │ default = built-in menu icon) │
45
+ * │ collapsedIcon = ReactNode (shown when collapsed; │
46
+ * │ falls back to icon) │
41
47
  * └──────────────────────────────────────────────────────────────┘
42
48
  *
43
49
  * @example
@@ -130,6 +136,10 @@ export interface AppBarProps {
130
136
  export declare const AppBar: React.ForwardRefExoticComponent<AppBarProps & React.RefAttributes<HTMLElement>>;
131
137
  export interface SidebarTriggerProps {
132
138
  className?: string;
139
+ /** Icon shown when the sidebar is expanded. Defaults to the built-in menu icon. */
140
+ icon?: React.ReactNode;
141
+ /** Icon shown when the sidebar is collapsed. Falls back to `icon`, then the built-in icon. */
142
+ collapsedIcon?: React.ReactNode;
133
143
  }
134
144
  export declare const SidebarTrigger: React.FC<SidebarTriggerProps>;
135
145
  export interface PageContentProps {
package/dist/index.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),s=require("react"),P=require("react-dom");function v(...e){const r=[];for(const a of e)if(a){if(typeof a=="string")r.push(a);else if(Array.isArray(a)){const n=v(...a);n&&r.push(n)}else if(typeof a=="object")for(const[n,o]of Object.entries(a))o&&r.push(n)}return r.join(" ")}const Lr={primary:"vyre-btn--primary",secondary:"vyre-btn--secondary",ghost:"vyre-btn--ghost",accent:"vyre-btn--accent",teal:"vyre-btn--teal",danger:"vyre-btn--danger"},Dr={sm:"vyre-btn--sm",md:"vyre-btn--md",lg:"vyre-btn--lg",icon:"vyre-btn--icon"},we=s.forwardRef(({variant:e="secondary",size:r="md",loading:a=!1,disabled:n,leftIcon:o,rightIcon:i,className:l,children:c,as:d="button",...h},f)=>{const y=n||a;return t.jsxs(d,{ref:f,className:v("vyre-btn",Lr[e],Dr[r],a&&"vyre-btn--loading",l),disabled:d==="button"?y:void 0,"aria-disabled":y,"data-variant":e,"data-size":r,...h,children:[a&&t.jsx("span",{className:"vyre-btn__spinner","aria-hidden":"true",children:t.jsx(Sr,{})}),!a&&o&&t.jsx("span",{className:"vyre-btn__icon vyre-btn__icon--left","aria-hidden":"true",children:o}),c&&t.jsx("span",{className:"vyre-btn__label",children:c}),i&&t.jsx("span",{className:"vyre-btn__icon vyre-btn__icon--right","aria-hidden":"true",children:i})]})});we.displayName="VyreButton";function Sr(){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 ke=s.forwardRef(({variant:e="default",dot:r=!1,className:a,children:n,...o},i)=>t.jsxs("span",{ref:i,className:v("vyre-badge",`vyre-badge--${e}`,a),"data-variant":e,...o,children:[r&&t.jsx("span",{className:"vyre-badge__dot","aria-hidden":"true"}),n]}));ke.displayName="VyreBadge";const de=s.forwardRef(({variant:e="default",hoverable:r=!1,clickable:a=!1,className:n,children:o,...i},l)=>t.jsx("div",{ref:l,className:v("vyre-card",`vyre-card--${e}`,r&&"vyre-card--hoverable",a&&"vyre-card--clickable",n),"data-variant":e,role:a?"button":void 0,tabIndex:a?0:void 0,...i,children:o}));de.displayName="VyreCard";const Ne=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-card__header",e),...a,children:r}));Ne.displayName="VyreCardHeader";const ue=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-card__body",e),...a,children:r}));ue.displayName="VyreCardBody";const Ce=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-card__footer",e),...a,children:r}));Ce.displayName="VyreCardFooter";const Re=s.forwardRef(({label:e,hint:r,state:a="idle",required:n=!1,htmlFor:o,className:i,children:l,...c},d)=>t.jsxs("div",{ref:d,className:v("vyre-field",a!=="idle"&&`vyre-field--${a}`,i),"data-state":a,...c,children:[e&&t.jsxs("label",{className:"vyre-field__label",htmlFor:o,children:[e,n&&t.jsx("span",{className:"vyre-field__required","aria-label":"required",children:"*"})]}),l,r&&t.jsx("span",{className:"vyre-field__hint",role:a==="error"?"alert":void 0,children:r})]}));Re.displayName="VyreField";const Le=s.forwardRef(({required:e=!1,className:r,children:a,...n},o)=>t.jsxs("label",{ref:o,className:v("vyre-field__label",r),...n,children:[a,e&&t.jsx("span",{className:"vyre-field__required","aria-label":"required",children:"*"})]}));Le.displayName="VyreFieldLabel";const De=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("p",{ref:n,className:v("vyre-field__description",e),...a,children:r}));De.displayName="VyreFieldDescription";const Se=s.forwardRef(({className:e,children:r,...a},n)=>r?t.jsx("p",{ref:n,role:"alert",className:v("vyre-field__error",e),...a,children:r}):null);Se.displayName="VyreFieldError";const Me=s.forwardRef(({orientation:e="vertical",className:r,children:a,...n},o)=>t.jsx("div",{ref:o,className:v("vyre-field-group",`vyre-field-group--${e}`,r),...n,children:a}));Me.displayName="VyreFieldGroup";const Ie=s.forwardRef(({legend:e,className:r,children:a,...n},o)=>t.jsxs("fieldset",{ref:o,className:v("vyre-field-set",r),...n,children:[e&&t.jsx("legend",{className:"vyre-field-set__legend",children:e}),a]}));Ie.displayName="VyreFieldSet";const Te=s.forwardRef(({size:e="md",leftElement:r,rightElement:a,className:n,...o},i)=>r||a?t.jsxs("div",{className:v("vyre-input-wrapper",`vyre-input-wrapper--${e}`),children:[r&&t.jsx("span",{className:"vyre-input__element vyre-input__element--left","aria-hidden":"true",children:r}),t.jsx("input",{ref:i,className:v("vyre-input",`vyre-input--${e}`,!!r&&"vyre-input--has-left",!!a&&"vyre-input--has-right",n),...o}),a&&t.jsx("span",{className:"vyre-input__element vyre-input__element--right","aria-hidden":"true",children:a})]}):t.jsx("input",{ref:i,className:v("vyre-input",`vyre-input--${e}`,n),...o}));Te.displayName="VyreInput";const Ee=s.forwardRef(({size:e="md",resize:r="vertical",className:a,style:n,...o},i)=>t.jsx("textarea",{ref:i,className:v("vyre-textarea",`vyre-textarea--${e}`,a),style:{resize:r,...n},...o}));Ee.displayName="VyreTextarea";const Mr=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(","),Ae=s.forwardRef(({open:e,onClose:r,size:a="md",closeOnBackdrop:n=!0,closeOnEsc:o=!0,initialFocus:i,className:l,children:c,"aria-label":d,"aria-labelledby":h,...f},y)=>{const p=s.useRef(null),x=s.useRef(null),u=s.useCallback(g=>{p.current=g,typeof y=="function"?y(g):y&&(y.current=g)},[y]),m=s.useCallback(g=>{if(g.key!=="Tab")return;const N=p.current;if(!N)return;const b=Array.from(N.querySelectorAll(Mr));if(!b.length)return;const L=b[0],w=b[b.length-1];g.shiftKey&&document.activeElement===L?(g.preventDefault(),w.focus()):!g.shiftKey&&document.activeElement===w&&(g.preventDefault(),L.focus())},[]),_=s.useCallback(g=>{g.key==="Escape"&&o&&r()},[o,r]);return s.useEffect(()=>{if(!e)return;document.addEventListener("keydown",_),document.addEventListener("keydown",m);const g=document.body.style.overflow;document.body.style.overflow="hidden";const N=setTimeout(()=>{var b;i!=null&&i.current?i.current.focus():(b=p.current)==null||b.focus()},0);return()=>{document.removeEventListener("keydown",_),document.removeEventListener("keydown",m),document.body.style.overflow=g,clearTimeout(N)}},[e,_,m,i]),e?P.createPortal(t.jsx("div",{ref:x,className:"vyre-modal-backdrop",onClick:g=>{n&&g.target===x.current&&r()},role:"presentation",children:t.jsx("div",{ref:u,className:v("vyre-modal",`vyre-modal--${a}`,l),role:"dialog","aria-modal":"true","aria-label":d,"aria-labelledby":h,tabIndex:-1,...f,children:c})}),document.body):null});Ae.displayName="VyreModal";const Be=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-modal__header",e),...a,children:r}));Be.displayName="VyreModalHeader";const Ve=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-modal__body",e),...a,children:r}));Ve.displayName="VyreModalBody";const $e=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-modal__footer",e),...a,children:r}));$e.displayName="VyreModalFooter";const Fe=s.createContext(null);function Ir(e,r){switch(r.type){case"ADD":return[...e,r.payload];case"REMOVE":return e.filter(a=>a.id!==r.id);default:return e}}let Tr=0;const Er=()=>`vyre-t-${++Tr}`;function Ar({children:e}){const[r,a]=s.useReducer(Ir,[]),n=s.useCallback(i=>{const l=Er();return a({type:"ADD",payload:{...i,id:l}}),l},[]),o=s.useCallback(i=>{a({type:"REMOVE",id:i})},[]);return t.jsxs(Fe.Provider,{value:{toast:n,dismiss:o},children:[e,typeof document<"u"&&P.createPortal(t.jsx("div",{className:"vyre-toast-viewport","aria-live":"polite","aria-atomic":"false","aria-label":"Notifications",children:r.map(i=>t.jsx(Vr,{...i,onDismiss:()=>o(i.id)},i.id))}),document.body)]})}function Br(){const e=s.useContext(Fe);if(!e)throw new Error("useToast must be used inside <ToastProvider>");return e}function Vr({title:e,description:r,variant:a="default",duration:n=4e3,onDismiss:o}){return s.useEffect(()=>{if(n===1/0)return;const i=setTimeout(o,n);return()=>clearTimeout(i)},[n,o]),t.jsxs("div",{className:v("vyre-toast",`vyre-toast--${a}`),role:"alert","data-variant":a,children:[t.jsxs("div",{className:"vyre-toast__content",children:[e&&t.jsx("p",{className:"vyre-toast__title",children:e}),r&&t.jsx("p",{className:"vyre-toast__description",children:r})]}),t.jsx("button",{className:"vyre-toast__close",onClick:o,"aria-label":"Dismiss notification",type:"button",children:t.jsx($r,{})})]})}function $r(){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 We=s.forwardRef(({options:e,value:r,defaultValue:a,onChange:n,placeholder:o="Select an option",disabled:i=!1,size:l="md",className:c,...d},h)=>{const f=r!==void 0,[y,p]=s.useState(a??""),x=f?r:y,[u,m]=s.useState(!1),[_,g]=s.useState(-1),N=s.useRef(null),b=s.useRef(null),w=`${s.useId()}-listbox`,I=e.find(j=>j.value===x),A=e.filter(j=>!j.disabled),T=s.useCallback(()=>{m(!1),g(-1)},[]),M=s.useCallback(j=>{var k;j.disabled||(f||p(j.value),n==null||n(j.value),T(),(k=N.current)==null||k.focus())},[f,n,T]);s.useEffect(()=>{if(!u)return;const j=k=>{const D=h==null?void 0:h.current;D&&!D.contains(k.target)&&T()};return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[u,h,T]),s.useEffect(()=>{var k;if(!u||_<0)return;const j=(k=b.current)==null?void 0:k.children[_];j==null||j.scrollIntoView({block:"nearest"})},[_,u]);const B=j=>{switch(j.key){case"Enter":case" ":case"ArrowDown":{if(j.preventDefault(),!u){m(!0);const k=e.findIndex(D=>D.value===x);g(k>=0?k:0)}break}case"ArrowUp":{j.preventDefault(),u||(m(!0),g(e.length-1));break}case"Escape":{T();break}}},R=j=>{var k;switch(j.key){case"ArrowDown":{j.preventDefault(),g(D=>{let E=D+1;for(;E<e.length&&e[E].disabled;)E++;return E<e.length?E:D});break}case"ArrowUp":{j.preventDefault(),g(D=>{let E=D-1;for(;E>=0&&e[E].disabled;)E--;return E>=0?E:D});break}case"Enter":case" ":{j.preventDefault(),_>=0&&M(e[_]);break}case"Escape":case"Tab":{T(),(k=N.current)==null||k.focus();break}case"Home":{j.preventDefault();const D=e.findIndex(E=>!E.disabled);D>=0&&g(D);break}case"End":{j.preventDefault();const D=[...e].reverse().findIndex(E=>!E.disabled);D>=0&&g(e.length-1-D);break}}};return t.jsxs("div",{ref:h,className:v("vyre-select",`vyre-select--${l}`,c),"data-open":u,...d,children:[t.jsxs("button",{ref:N,type:"button",className:"vyre-select__trigger","aria-haspopup":"listbox","aria-expanded":u,"aria-controls":w,"aria-disabled":i,disabled:i,onClick:()=>{i||m(j=>{if(!j){const k=e.findIndex(D=>D.value===x);g(k>=0?k:0)}return!j})},onKeyDown:B,children:[I?t.jsx("span",{className:"vyre-select__value",children:I.label}):t.jsx("span",{className:"vyre-select__placeholder",children:o}),t.jsx(Fr,{})]}),u&&t.jsxs("ul",{ref:b,id:w,role:"listbox",className:"vyre-select__dropdown","aria-label":"Options",tabIndex:-1,onKeyDown:R,children:[e.map((j,k)=>t.jsxs("li",{role:"option","aria-selected":j.value===x,"aria-disabled":j.disabled,"data-highlighted":k===_,className:"vyre-select__option",onMouseEnter:()=>!j.disabled&&g(k),onMouseDown:D=>{D.preventDefault(),M(j)},children:[j.label,j.value===x&&t.jsx(Wr,{})]},j.value)),A.length===0&&t.jsx("li",{className:"vyre-select__empty",role:"presentation",children:"No options available"})]})]})});We.displayName="VyreSelect";function Fr(){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 Wr(){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 He=s.createContext(null);function Pe(){const e=s.useContext(He);if(!e)throw new Error("Tab components must be used inside <Tabs>");return e}const Oe=s.forwardRef(({defaultValue:e="",value:r,onChange:a,className:n,children:o,...i},l)=>{const c=r!==void 0,[d,h]=s.useState(e),f=c?r:d,y=s.useId(),p=s.useCallback(x=>{c||h(x),a==null||a(x)},[c,a]);return t.jsx(He.Provider,{value:{value:f,onChange:p,baseId:y},children:t.jsx("div",{ref:l,className:v("vyre-tabs",n),...i,children:o})})});Oe.displayName="VyreTabs";const Ge=s.forwardRef(({className:e,children:r,"aria-label":a,...n},o)=>{const i=s.useRef(null),l=c=>{var y;const d=Array.from(((y=i.current)==null?void 0:y.querySelectorAll('[role="tab"]:not([disabled])'))??[]),h=d.findIndex(p=>p===document.activeElement);if(h<0)return;let f=h;if(c.key==="ArrowRight")f=(h+1)%d.length;else if(c.key==="ArrowLeft")f=(h-1+d.length)%d.length;else if(c.key==="Home")f=0;else if(c.key==="End")f=d.length-1;else return;c.preventDefault(),d[f].focus(),d[f].click()};return t.jsx("div",{ref:c=>{i.current=c,typeof o=="function"?o(c):o&&(o.current=c)},role:"tablist",className:v("vyre-tabs__list",e),"aria-label":a,onKeyDown:l,...n,children:r})});Ge.displayName="VyreTabList";const Ye=s.forwardRef(({value:e,disabled:r=!1,className:a,children:n,...o},i)=>{const{value:l,onChange:c,baseId:d}=Pe(),h=e===l;return t.jsx("button",{ref:i,role:"tab",type:"button",id:`${d}-tab-${e}`,"aria-controls":`${d}-panel-${e}`,"aria-selected":h,disabled:r,tabIndex:h?0:-1,className:v("vyre-tabs__tab",h&&"vyre-tabs__tab--active",a),"data-selected":h,onClick:()=>!r&&c(e),...o,children:n})});Ye.displayName="VyreTab";const Ke=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-tabs__panels",e),...a,children:r}));Ke.displayName="VyreTabPanels";const qe=s.forwardRef(({value:e,className:r,children:a,...n},o)=>{const{value:i,baseId:l}=Pe();return e===i?t.jsx("div",{ref:o,role:"tabpanel",id:`${l}-panel-${e}`,"aria-labelledby":`${l}-tab-${e}`,tabIndex:0,className:v("vyre-tabs__panel",r),...n,children:a}):null});qe.displayName="VyreTabPanel";const Hr=120,Ue=({content:e,placement:r="top",delay:a=300,children:n,className:o})=>{const[i,l]=s.useState("hidden"),c=s.useRef(null),d=s.useRef(null),h=s.useId(),f=s.useCallback(()=>{d.current&&(clearTimeout(d.current),d.current=null),c.current=setTimeout(()=>l("visible"),a)},[a]),y=s.useCallback(()=>{c.current&&(clearTimeout(c.current),c.current=null),l("leaving"),d.current=setTimeout(()=>l("hidden"),Hr)},[]),p=s.Children.only(n),x=s.cloneElement(p,{onMouseEnter:u=>{var m,_;f(),(_=(m=p.props).onMouseEnter)==null||_.call(m,u)},onMouseLeave:u=>{var m,_;y(),(_=(m=p.props).onMouseLeave)==null||_.call(m,u)},onFocus:u=>{var m,_;l("visible"),(_=(m=p.props).onFocus)==null||_.call(m,u)},onBlur:u=>{var m,_;y(),(_=(m=p.props).onBlur)==null||_.call(m,u)},"aria-describedby":i!=="hidden"?h:void 0});return t.jsxs("span",{className:v("vyre-tooltip-wrapper",o),children:[x,i!=="hidden"&&t.jsxs("span",{id:h,role:"tooltip",className:v("vyre-tooltip",`vyre-tooltip--${r}`,i==="leaving"&&"vyre-tooltip--leaving"),"data-placement":r,children:[e,t.jsx("span",{className:"vyre-tooltip__arrow","aria-hidden":"true"})]})]})};Ue.displayName="VyreTooltip";const ze=s.createContext(null);function Xe(){const e=s.useContext(ze);if(!e)throw new Error("AccordionItem must be used within Accordion");return e}const Ze=s.forwardRef(({type:e="single",defaultValue:r,value:a,onValueChange:n,className:o,children:i,...l},c)=>{const d=x=>x===void 0?[]:Array.isArray(x)?x:[x],[h,f]=s.useState(d(r)),y=a!==void 0?d(a):h,p=s.useCallback(x=>{let u;e==="single"?u=y.includes(x)?[]:[x]:u=y.includes(x)?y.filter(m=>m!==x):[...y,x],a===void 0&&f(u),n==null||n(e==="single"?u[0]??"":u)},[e,y,a,n]);return t.jsx(ze.Provider,{value:{type:e,value:y,toggle:p},children:t.jsx("div",{ref:c,className:["vyre-accordion",o].filter(Boolean).join(" "),...l,children:i})})});Ze.displayName="Accordion";const me=s.createContext(null),Qe=s.forwardRef(({value:e,className:r,children:a,...n},o)=>{const{value:i}=Xe(),l=i.includes(e);return t.jsx(me.Provider,{value:{itemValue:e,isOpen:l},children:t.jsx("div",{ref:o,"data-state":l?"open":"closed",className:["vyre-accordion__item",r].filter(Boolean).join(" "),...n,children:a})})});Qe.displayName="AccordionItem";const Je=s.forwardRef(({className:e,children:r,...a},n)=>{const{toggle:o}=Xe(),i=s.useContext(me);if(!i)throw new Error("AccordionTrigger must be used within AccordionItem");const{itemValue:l,isOpen:c}=i;return t.jsxs("button",{ref:n,type:"button","aria-expanded":c,"data-state":c?"open":"closed",className:["vyre-accordion__trigger",e].filter(Boolean).join(" "),onClick:()=>o(l),...a,children:[t.jsx("span",{className:"vyre-accordion__trigger-text",children:r}),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"})})]})});Je.displayName="AccordionTrigger";const et=s.forwardRef(({className:e,children:r,...a},n)=>{const o=s.useContext(me);if(!o)throw new Error("AccordionContent must be used within AccordionItem");const{isOpen:i}=o;return t.jsx("div",{ref:n,hidden:!i,"data-state":i?"open":"closed",className:["vyre-accordion__content",e].filter(Boolean).join(" "),...a,children:t.jsx("div",{className:"vyre-accordion__content-inner",children:r})})});et.displayName="AccordionContent";const ve=s.forwardRef(({src:e,alt:r="",fallback:a,size:n="md",status:o,className:i,...l},c)=>{var y;const[d,h]=s.useState(!1),f=e&&!d;return t.jsxs("span",{ref:c,"data-size":n,className:["vyre-avatar",i].filter(Boolean).join(" "),...l,children:[f?t.jsx("img",{src:e,alt:r,className:"vyre-avatar__img",onError:()=>h(!0)}):t.jsx("span",{className:"vyre-avatar__fallback","aria-label":r||a,children:a??((y=r==null?void 0:r.charAt(0))==null?void 0:y.toUpperCase())??"?"}),o&&t.jsx("span",{className:`vyre-avatar__status vyre-avatar__status--${o}`,"aria-label":o})]})});ve.displayName="Avatar";const tt=s.forwardRef(({checked:e,defaultChecked:r,indeterminate:a=!1,onCheckedChange:n,disabled:o,size:i="md",className:l,id:c,...d},h)=>{const f=s.useRef(null),y=h??f;return s.useEffect(()=>{y.current&&(y.current.indeterminate=a)},[a,y]),t.jsxs("span",{className:["vyre-checkbox",`vyre-checkbox--${i}`,l].filter(Boolean).join(" "),"data-disabled":o||void 0,"data-checked":e||void 0,"data-indeterminate":a||void 0,children:[t.jsx("input",{ref:y,type:"checkbox",id:c,checked:e,defaultChecked:r,disabled:o,className:"vyre-checkbox__input",onChange:p=>n==null?void 0:n(p.target.checked),...d}),t.jsx("span",{className:"vyre-checkbox__box","aria-hidden":"true",children:a?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"})})})]})});tt.displayName="Checkbox";const rt=s.createContext(null);let Pr=0;const at=s.forwardRef(({value:e,defaultValue:r,onChange:a,name:n,disabled:o=!1,size:i="md",orientation:l="vertical",options:c,className:d,children:h,...f},y)=>{const[p,x]=s.useState(r),u=e!==void 0,m=u?e:p,_=s.useMemo(()=>n??`vyre-radio-${++Pr}`,[n]),g=s.useCallback(b=>{u||x(b),a==null||a(b)},[u,a]),N={name:_,value:m,onChange:g,groupDisabled:o,size:i};return t.jsx(rt.Provider,{value:N,children:t.jsx("div",{ref:y,role:"radiogroup","aria-orientation":l,className:v("vyre-radio-group",`vyre-radio-group--${l}`,d),"data-disabled":o||void 0,...f,children:c?c.map(b=>t.jsx(fe,{value:b.value,label:b.label,description:b.description,disabled:b.disabled},b.value)):h})})});at.displayName="VyreRadioGroup";const fe=s.forwardRef(({value:e,label:r,description:a,disabled:n,className:o,id:i,...l},c)=>{const d=s.useContext(rt);if(!d)throw new Error("Radio must be used inside a <RadioGroup>.");const h=d.value===e,f=n||d.groupDisabled,y=i??`${d.name}-${e}`.replace(/\s+/g,"-");return t.jsxs("label",{className:v("vyre-radio",`vyre-radio--${d.size}`,f&&"vyre-radio--disabled",o),"data-checked":h||void 0,"data-disabled":f||void 0,htmlFor:y,children:[t.jsx("input",{ref:c,type:"radio",id:y,name:d.name,value:e,checked:h,disabled:f,className:"vyre-radio__input",onChange:()=>{var p;return(p=d.onChange)==null?void 0:p.call(d,e)},...l}),t.jsx("span",{className:"vyre-radio__control","aria-hidden":"true",children:t.jsx("span",{className:"vyre-radio__dot"})}),(r||a)&&t.jsxs("span",{className:"vyre-radio__content",children:[r&&t.jsx("span",{className:"vyre-radio__label",children:r}),a&&t.jsx("span",{className:"vyre-radio__description",children:a})]})]})});fe.displayName="VyreRadio";const Or=["bold","italic","underline","strike","h1","h2","h3","ul","ol","quote","code","link","clear"];function W(e,r){document.execCommand(e,!1,r)}const nt=s.forwardRef(({value:e,onChange:r,placeholder:a="Write something…",disabled:n=!1,readOnly:o=!1,toolbar:i=Or,minHeight:l="10rem",className:c,...d},h)=>{const f=s.useRef(null),y=!n&&!o;s.useEffect(()=>{const m=f.current;m&&m.innerHTML!==e&&(m.innerHTML=e)},[e]);const p=s.useCallback(()=>{f.current&&r(f.current.innerHTML)},[r]),x=s.useCallback(m=>{var _;y&&((_=f.current)==null||_.focus(),m(),p())},[y,p]),u={bold:{label:"Bold",icon:t.jsx("b",{children:"B"}),run:()=>W("bold")},italic:{label:"Italic",icon:t.jsx("i",{children:"I"}),run:()=>W("italic")},underline:{label:"Underline",icon:t.jsx("u",{children:"U"}),run:()=>W("underline")},strike:{label:"Strikethrough",icon:t.jsx("s",{children:"S"}),run:()=>W("strikeThrough")},h1:{label:"Heading 1",icon:t.jsx(t.Fragment,{children:"H1"}),run:()=>W("formatBlock","<h1>")},h2:{label:"Heading 2",icon:t.jsx(t.Fragment,{children:"H2"}),run:()=>W("formatBlock","<h2>")},h3:{label:"Heading 3",icon:t.jsx(t.Fragment,{children:"H3"}),run:()=>W("formatBlock","<h3>")},ul:{label:"Bullet list",icon:t.jsx(t.Fragment,{children:"•≡"}),run:()=>W("insertUnorderedList")},ol:{label:"Numbered list",icon:t.jsx(t.Fragment,{children:"1.≡"}),run:()=>W("insertOrderedList")},quote:{label:"Quote",icon:t.jsx(t.Fragment,{children:"“”"}),run:()=>W("formatBlock","<blockquote>")},code:{label:"Code block",icon:t.jsx(t.Fragment,{children:"</>"}),run:()=>W("formatBlock","<pre>")},link:{label:"Link",icon:t.jsx(t.Fragment,{children:"🔗"}),run:()=>{const m=window.prompt("Link URL");m&&W("createLink",m)}},clear:{label:"Clear formatting",icon:t.jsx(t.Fragment,{children:"⌫"}),run:()=>W("removeFormat")}};return t.jsxs("div",{ref:h,className:v("vyre-rte",n&&"vyre-rte--disabled",o&&"vyre-rte--readonly",c),...d,children:[!o&&t.jsx("div",{className:"vyre-rte__toolbar",role:"toolbar","aria-label":"Formatting",children:i.map(m=>{const _=u[m];return _?t.jsx("button",{type:"button",className:"vyre-rte__tool",title:_.label,"aria-label":_.label,disabled:!y,onMouseDown:g=>g.preventDefault(),onClick:()=>x(_.run),children:_.icon},m):null})}),t.jsx("div",{ref:f,className:"vyre-rte__content",contentEditable:y,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":"true","aria-label":a,"data-placeholder":a,style:{minHeight:l},onInput:p,onBlur:p})]})});nt.displayName="VyreRichTextEditor";const st=s.forwardRef(({checked:e,defaultChecked:r=!1,onCheckedChange:a,disabled:n,size:o="md",className:i,...l},c)=>{const[d,h]=s.useState(r),f=e!==void 0?e:d,y=()=>{if(n)return;const p=!f;e===void 0&&h(p),a==null||a(p)};return t.jsx("button",{ref:c,type:"button",role:"switch","aria-checked":f,disabled:n,"data-checked":f||void 0,"data-size":o,className:["vyre-switch",i].filter(Boolean).join(" "),onClick:y,...l,children:t.jsx("span",{className:"vyre-switch__thumb"})})});st.displayName="Switch";const ot=s.forwardRef(({value:e,defaultValue:r=0,min:a=0,max:n=100,step:o=1,onValueChange:i,disabled:l,size:c="md",className:d,style:h,...f},y)=>{const[p,x]=s.useState(r),u=e!==void 0?e:p,m=(u-a)/(n-a)*100;return t.jsxs("div",{className:["vyre-slider",`vyre-slider--${c}`,d].filter(Boolean).join(" "),"data-disabled":l||void 0,style:{"--vyre-slider-pct":`${m}%`,...h},children:[t.jsx("input",{ref:y,type:"range",min:a,max:n,step:o,value:u,disabled:l,className:"vyre-slider__input",onChange:_=>{const g=Number(_.target.value);e===void 0&&x(g),i==null||i(g)},...f}),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}%`}})]})]})});ot.displayName="Slider";const it=s.forwardRef(({value:e,max:r=100,indeterminate:a=!1,size:n="md",variant:o="default",className:i,...l},c)=>{const d=a?void 0:Math.min(100,Math.max(0,(e??0)/r*100));return t.jsx("div",{ref:c,role:"progressbar","aria-valuemin":0,"aria-valuemax":r,"aria-valuenow":a?void 0:e??0,"data-size":n,"data-variant":o,"data-indeterminate":a||void 0,className:["vyre-progress",i].filter(Boolean).join(" "),...l,children:t.jsx("div",{className:"vyre-progress__bar",style:d!==void 0?{width:`${d}%`}:void 0})})});it.displayName="Progress";const lt=s.forwardRef(({orientation:e="horizontal",decorative:r=!0,className:a,...n},o)=>t.jsx("div",{ref:o,role:r?"none":"separator","aria-orientation":r?void 0:e,"data-orientation":e,className:["vyre-separator",a].filter(Boolean).join(" "),...n}));lt.displayName="Separator";const ct=s.forwardRef(({required:e,disabled:r,className:a,children:n,...o},i)=>t.jsxs("label",{ref:i,"data-required":e||void 0,"data-disabled":r||void 0,className:["vyre-label",a].filter(Boolean).join(" "),...o,children:[n,e&&t.jsx("span",{className:"vyre-label__required","aria-hidden":"true",children:"*"})]}));ct.displayName="Label";const ye=s.forwardRef(({variant:e="rect",width:r,height:a,className:n,style:o,...i},l)=>t.jsx("div",{ref:l,"aria-hidden":"true","data-variant":e,className:["vyre-skeleton",n].filter(Boolean).join(" "),style:{width:typeof r=="number"?`${r}px`:r,height:typeof a=="number"?`${a}px`:a,...o},...i}));ye.displayName="Skeleton";const re=8,Gr=120;function Yr(e){const[r,a]=e.split("-");return{side:r,align:a??"center"}}function Kr(e,r,a,n,o,i){const l=e.width,c=e.height,d=r.width,h=r.height,f=e.left+o,y=e.top+i;let p=0,x=0;switch(a){case"top":p=y-h-re;break;case"bottom":p=y+c+re;break;case"left":x=f-d-re;break;case"right":x=f+l+re;break}if(a==="top"||a==="bottom")switch(n){case"start":x=f;break;case"center":x=f+l/2-d/2;break;case"end":x=f+l-d;break}else switch(n){case"start":p=y;break;case"center":p=y+c/2-h/2;break;case"end":p=y+c-h;break}return{top:p,left:x}}const dt=({trigger:e,children:r,open:a,onOpenChange:n,placement:o="bottom",closeOnOutside:i=!0,className:l})=>{const c=a!==void 0,[d,h]=s.useState(!1),[f,y]=s.useState(!1),[p,x]=s.useState(!1),[u,m]=s.useState({top:0,left:0}),_=c?a:d,g=s.useRef(null),N=s.useRef(null),b=s.useRef(null),L=s.useId(),{side:w,align:I}=Yr(o),A=s.useCallback(R=>{c||h(R),n==null||n(R)},[c,n]),T=s.useCallback(()=>A(!_),[_,A]),M=s.useCallback(()=>{y(!0),b.current=setTimeout(()=>{y(!1),x(!1),A(!1)},Gr)},[A]);s.useEffect(()=>{_?(b.current&&(clearTimeout(b.current),b.current=null),y(!1),x(!0)):p&&!f&&M()},[_]),s.useEffect(()=>{if(!p||!g.current||!N.current)return;const R=g.current.getBoundingClientRect(),j=N.current.getBoundingClientRect(),k=Kr(R,j,w,I,window.scrollX,window.scrollY);m(k)},[p,w,I]),s.useEffect(()=>{if(!p||!i)return;const R=j=>{N.current&&!N.current.contains(j.target)&&g.current&&!g.current.contains(j.target)&&M()};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[p,i,M]),s.useEffect(()=>{if(!p)return;const R=j=>{j.key==="Escape"&&M()};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[p,M]);const B=s.cloneElement(e,{ref:g,onClick:R=>{var j,k;T(),(k=(j=e.props).onClick)==null||k.call(j,R)},"aria-expanded":_,"aria-controls":L,"aria-haspopup":"dialog"});return t.jsxs(t.Fragment,{children:[B,p&&P.createPortal(t.jsx("div",{ref:N,id:L,role:"dialog","aria-modal":"false",className:v("vyre-popover",`vyre-popover--${w}`,f&&"vyre-popover--leaving",l),style:{top:u.top,left:u.left},children:r}),document.body)]})};dt.displayName="VyrePopover";const ae=s.createContext(null),ut=s.createContext(null),qr=120,mt=({trigger:e,children:r,placement:a="bottom-start",className:n})=>{const[o,i]=s.useState(!1),[l,c]=s.useState(!1),[d,h]=s.useState(!1),[f,y]=s.useState({top:0,left:0}),[p,x]=s.useState(-1),u=s.useRef(null),m=s.useRef(null),_=s.useRef(null),g=s.useId(),N=s.useCallback(()=>{var M;return Array.from(((M=m.current)==null?void 0:M.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])"))??[])},[]),b=s.useCallback(()=>{c(!0),_.current=setTimeout(()=>{var M;c(!1),h(!1),i(!1),x(-1),(M=u.current)==null||M.focus({preventScroll:!0})},qr)},[]),L=s.useCallback(()=>{_.current&&(clearTimeout(_.current),_.current=null),c(!1),i(!0),h(!0)},[]),w=s.useCallback(()=>{o?b():L()},[o,L,b]);s.useEffect(()=>{if(!d||!u.current)return;const M=u.current.getBoundingClientRect(),B=4,R=window.scrollX,j=window.scrollY;let k=0,D=0;a.startsWith("bottom")?(k=M.bottom+j+B,D=a==="bottom-start"?M.left+R:M.right+R):(k=M.top+j-B,D=a==="top-start"?M.left+R:M.right+R),y({top:k,left:D}),requestAnimationFrame(()=>{var V;(V=N()[0])==null||V.focus({preventScroll:!0}),x(0)})},[d,a,N]),s.useEffect(()=>{if(!d)return;const M=R=>{m.current&&!m.current.contains(R.target)&&u.current&&!u.current.contains(R.target)&&b()},B=R=>{var j,k,D;if(R.key==="Escape"){b();return}if(R.key==="ArrowDown"||R.key==="ArrowUp"){R.preventDefault();const E=N();if(!E.length)return;const V=R.key==="ArrowDown"?1:-1,X=(p+V+E.length)%E.length;(j=E[X])==null||j.focus({preventScroll:!0}),x(X)}if(R.key==="Home"&&((k=N()[0])==null||k.focus({preventScroll:!0}),x(0)),R.key==="End"){const E=N();(D=E[E.length-1])==null||D.focus({preventScroll:!0}),x(E.length-1)}};return document.addEventListener("mousedown",M),document.addEventListener("keydown",B),()=>{document.removeEventListener("mousedown",M),document.removeEventListener("keydown",B)}},[d,p,b,N]);const I=s.cloneElement(e,{ref:u,onClick:M=>{var B,R;w(),(R=(B=e.props).onClick)==null||R.call(B,M)},"aria-expanded":o,"aria-haspopup":"menu","aria-controls":g}),A=a.endsWith("-end"),T=a.startsWith("top");return t.jsxs(ae.Provider,{value:{close:b},children:[I,d&&P.createPortal(t.jsx("div",{ref:m,id:g,role:"menu","aria-orientation":"vertical",className:v("vyre-dropdown",A&&"vyre-dropdown--end",T&&"vyre-dropdown--top",l&&"vyre-dropdown--leaving",n),style:{top:f.top,left:f.left,transform:A?"translateX(-100%)":void 0},children:r}),document.body)]})};mt.displayName="VyreDropdownMenu";const vt=({children:e,className:r})=>t.jsx("div",{className:v("vyre-dropdown__label",r),children:e});vt.displayName="VyreDropdownLabel";const ft=({children:e,onSelect:r,disabled:a=!1,variant:n="default",icon:o,shortcut:i,className:l})=>{const c=s.useContext(ae);return t.jsxs("button",{role:"menuitem",className:v("vyre-dropdown__item",n==="danger"&&"vyre-dropdown__item--danger",l),"aria-disabled":a||void 0,disabled:a,tabIndex:-1,onClick:()=>{a||(r==null||r(),c==null||c.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})]})};ft.displayName="VyreDropdownItem";const yt=({children:e,checked:r,onCheckedChange:a,disabled:n=!1,shortcut:o,className:i})=>{const l=s.useContext(ae);return t.jsxs("button",{role:"menuitemcheckbox","aria-checked":r,"aria-disabled":n||void 0,disabled:n,tabIndex:-1,className:v("vyre-dropdown__item vyre-dropdown__item--checkbox",i),onClick:()=>{n||(a(!r),l==null||l.close())},children:[t.jsx("span",{className:"vyre-dropdown__item-indicator","aria-hidden":"true",children:r&&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})]})};yt.displayName="VyreDropdownCheckboxItem";const ht=({value:e,onValueChange:r,children:a})=>t.jsx(ut.Provider,{value:{value:e,onValueChange:r},children:t.jsx("div",{role:"group",children:a})});ht.displayName="VyreDropdownRadioGroup";const bt=({children:e,value:r,disabled:a=!1,className:n})=>{const o=s.useContext(ae),i=s.useContext(ut),l=(i==null?void 0:i.value)===r;return t.jsxs("button",{role:"menuitemradio","aria-checked":l,"aria-disabled":a||void 0,disabled:a,tabIndex:-1,className:v("vyre-dropdown__item vyre-dropdown__item--radio",n),onClick:()=>{a||(i==null||i.onValueChange(r),o==null||o.close())},children:[t.jsx("span",{className:"vyre-dropdown__item-indicator","aria-hidden":"true",children:l&&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})]})};bt.displayName="VyreDropdownRadioItem";const pt=({trigger:e,children:r,icon:a,placement:n="right",disabled:o=!1,className:i})=>{const[l,c]=s.useState(!1),[d,h]=s.useState({top:0,left:0}),f=s.useRef(null),y=s.useRef(null),p=s.useCallback(()=>{if(!f.current)return;const m=f.current.getBoundingClientRect(),_=window.scrollX,g=window.scrollY,N=2;h({top:m.top+g,left:n==="right"?m.right+_+N:m.left+_-N}),c(!0)},[n]),x=s.useCallback(()=>c(!1),[]),u=m=>{var g;const _=m.relatedTarget;(g=y.current)!=null&&g.contains(_)||x()};return t.jsxs(t.Fragment,{children:[t.jsxs("button",{ref:f,role:"menuitem","aria-haspopup":"menu","aria-expanded":l,"aria-disabled":o||void 0,disabled:o,tabIndex:-1,className:v("vyre-dropdown__item vyre-dropdown__item--sub",i),onMouseEnter:p,onMouseLeave:u,onFocus:p,children:[a&&t.jsx("span",{className:"vyre-dropdown__item-icon","aria-hidden":"true",children:a}),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:n==="right"?"M4 2l4 4-4 4":"M8 2L4 6l4 4",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),l&&P.createPortal(t.jsx("div",{ref:y,role:"menu",className:v("vyre-dropdown vyre-dropdown--sub",n==="left"&&"vyre-dropdown--sub-left"),style:{position:"absolute",top:d.top,left:n==="right"?d.left:void 0,right:n==="left"?`calc(100vw - ${d.left}px)`:void 0,transform:n==="left"?"translateX(-100%)":void 0},onMouseLeave:m=>{var g;const _=m.relatedTarget;(g=f.current)!=null&&g.contains(_)||x()},children:r}),document.body)]})};pt.displayName="VyreDropdownSub";const xt=({className:e})=>t.jsx("div",{role:"separator",className:v("vyre-dropdown__separator",e)});xt.displayName="VyreDropdownSeparator";const Ur=()=>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"})]}),zr=()=>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"})]}),Xr=()=>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"})]}),Zr=()=>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"})]}),_t={info:Ur,success:zr,warning:Xr,danger:Zr},gt=({variant:e="info",title:r,icon:a,onClose:n,children:o,className:i})=>{const l=_t[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:a??t.jsx(l,{})}),t.jsxs("div",{className:"vyre-alert__body",children:[r&&t.jsx("p",{className:"vyre-alert__title",children:r}),o&&t.jsx("div",{className:"vyre-alert__description",children:o})]}),n&&t.jsx("button",{type:"button",className:"vyre-alert__close","aria-label":"Dismiss",onClick:n,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"})})})]})};gt.displayName="VyreAlert";const Qr=["button:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(","),jt=({open:e,onOpenChange:r,title:a,description:n,variant:o="danger",confirmLabel:i="Confirm",cancelLabel:l="Cancel",onConfirm:c,onCancel:d,className:h})=>{const f=s.useRef(null),y=s.useRef(null),p=s.useRef(null),x=s.useCallback(()=>{d==null||d(),r(!1)},[d,r]),u=s.useCallback(()=>{c==null||c(),r(!1)},[c,r]),m=s.useCallback(g=>{if(g.key!=="Tab")return;const N=f.current;if(!N)return;const b=Array.from(N.querySelectorAll(Qr));if(!b.length)return;const L=b[0],w=b[b.length-1];g.shiftKey&&document.activeElement===L?(g.preventDefault(),w.focus()):!g.shiftKey&&document.activeElement===w&&(g.preventDefault(),L.focus())},[]);if(s.useEffect(()=>{if(!e)return;document.addEventListener("keydown",m);const g=document.body.style.overflow;document.body.style.overflow="hidden";const N=b=>{b.key==="Escape"&&x()};return document.addEventListener("keydown",N),setTimeout(()=>{var b;return(b=p.current)==null?void 0:b.focus()},0),()=>{document.removeEventListener("keydown",m),document.removeEventListener("keydown",N),document.body.style.overflow=g}},[e,m,x]),!e)return null;const _=_t[o];return P.createPortal(t.jsx("div",{ref:y,className:"vyre-alert-dialog-backdrop",onClick:g=>{g.target===y.current&&x()},role:"presentation",children:t.jsxs("div",{ref:f,role:"alertdialog","aria-modal":"true","aria-labelledby":"vyre-ad-title","aria-describedby":n?"vyre-ad-desc":void 0,className:v("vyre-alert-dialog",`vyre-alert-dialog--${o}`,h),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:a}),n&&t.jsx("p",{id:"vyre-ad-desc",className:"vyre-alert-dialog__description",children:n})]}),t.jsxs("div",{className:"vyre-alert-dialog__footer",children:[t.jsx("button",{ref:p,type:"button",className:"vyre-btn vyre-btn--ghost vyre-btn--sm",onClick:x,children:l}),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)};jt.displayName="VyreAlertDialog";const Jr=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(","),wt=s.forwardRef(({open:e,onClose:r,side:a="right",size:n="md",closeOnBackdrop:o=!0,closeOnEsc:i=!0,className:l,children:c,"aria-label":d,"aria-labelledby":h,...f},y)=>{const p=s.useRef(null),x=s.useRef(null),u=s.useCallback(m=>{if(m.key!=="Tab")return;const _=p.current;if(!_)return;const g=Array.from(_.querySelectorAll(Jr));if(!g.length)return;const N=g[0],b=g[g.length-1];m.shiftKey&&document.activeElement===N?(m.preventDefault(),b.focus()):!m.shiftKey&&document.activeElement===b&&(m.preventDefault(),N.focus())},[]);return s.useEffect(()=>{if(!e)return;if(document.addEventListener("keydown",u),i){const _=N=>{N.key==="Escape"&&r()};document.addEventListener("keydown",_);const g=document.body.style.overflow;return document.body.style.overflow="hidden",setTimeout(()=>{var N;return(N=p.current)==null?void 0:N.focus()},0),()=>{document.removeEventListener("keydown",u),document.removeEventListener("keydown",_),document.body.style.overflow=g}}const m=document.body.style.overflow;return document.body.style.overflow="hidden",setTimeout(()=>{var _;return(_=p.current)==null?void 0:_.focus()},0),()=>{document.removeEventListener("keydown",u),document.body.style.overflow=m}},[e,u,i,r]),e?P.createPortal(t.jsx("div",{ref:x,className:"vyre-sheet-backdrop",onClick:m=>{o&&m.target===x.current&&r()},role:"presentation",children:t.jsx("div",{ref:m=>{p.current=m,typeof y=="function"?y(m):y&&(y.current=m)},role:"dialog","aria-modal":"true","aria-label":d,"aria-labelledby":h,tabIndex:-1,className:v("vyre-sheet",`vyre-sheet--${a}`,`vyre-sheet--${n}`,l),...f,children:c})}),document.body):null});wt.displayName="VyreSheet";const kt=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-sheet__header",e),...a,children:r}));kt.displayName="VyreSheetHeader";const Nt=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-sheet__body",e),...a,children:r}));Nt.displayName="VyreSheetBody";const Ct=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-sheet__footer",e),...a,children:r}));Ct.displayName="VyreSheetFooter";const Rt=({children:e,separator:r="/",className:a})=>{const n=s.Children.toArray(e).filter(Boolean);return t.jsx("nav",{"aria-label":"Breadcrumb",className:v("vyre-breadcrumb",a),children:t.jsx("ol",{className:"vyre-breadcrumb__list",children:n.map((o,i)=>t.jsxs("li",{className:"vyre-breadcrumb__item",children:[o,i<n.length-1&&t.jsx("span",{className:"vyre-breadcrumb__separator","aria-hidden":"true",children:r})]},i))})})};Rt.displayName="VyreBreadcrumb";const Lt=({children:e,href:r,current:a=!1,className:n})=>a||!r?t.jsx("span",{className:v("vyre-breadcrumb__link vyre-breadcrumb__link--current",n),"aria-current":a?"page":void 0,children:e}):t.jsx("a",{href:r,className:v("vyre-breadcrumb__link",n),children:e});Lt.displayName="VyreBreadcrumbItem";const Dt=({children:e,href:r,className:a})=>t.jsx("a",{href:r,className:v("vyre-breadcrumb__link",a),children:e});Dt.displayName="VyreBreadcrumbLink";const St=({children:e="/",className:r})=>t.jsx("span",{className:v("vyre-breadcrumb__separator",r),"aria-hidden":"true",children:e});St.displayName="VyreBreadcrumbSeparator";function xe(e,r){return Array.from({length:r-e+1},(a,n)=>e+n)}function ea(e,r,a){const n=a*2+5;if(r<=n)return xe(1,r);const o=Math.max(e-a,2),i=Math.min(e+a,r-1),l=o>2,c=i<r-1,d=[1];return l&&d.push("..."),d.push(...xe(o,i)),c&&d.push("..."),d.push(r),d}const ta=()=>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"})}),ra=()=>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"})}),aa=()=>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"})}),na=()=>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"})}),Mt=({page:e,totalPages:r,onPageChange:a,siblings:n=1,showEdges:o=!0,showInfo:i=!1,totalItems:l,pageSize:c,className:d})=>{const h=ea(e,r,n),f=e>1,y=e<r,p=s.useMemo(()=>{if(!i)return null;if(l!=null&&c!=null){const u=(e-1)*c+1,m=Math.min(e*c,l);return`Showing ${u}–${m} of ${l}`}return`Page ${e} of ${r}`},[i,e,r,l,c]),x=t.jsxs(t.Fragment,{children:[o&&t.jsx("button",{className:"vyre-pagination__nav",onClick:()=>a(1),disabled:!f,"aria-label":"First page",children:t.jsx(aa,{})}),t.jsx("button",{className:"vyre-pagination__nav",onClick:()=>a(e-1),disabled:!f,"aria-label":"Previous page",children:t.jsx(ta,{})}),t.jsx("ol",{className:"vyre-pagination__list",children:h.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:()=>a(u),"aria-label":`Page ${u}`,"aria-current":u===e?"page":void 0,children:u})},u))}),t.jsx("button",{className:"vyre-pagination__nav",onClick:()=>a(e+1),disabled:!y,"aria-label":"Next page",children:t.jsx(ra,{})}),o&&t.jsx("button",{className:"vyre-pagination__nav",onClick:()=>a(r),disabled:!y,"aria-label":"Last page",children:t.jsx(na,{})})]});return i?t.jsxs("div",{className:v("vyre-pagination-row",d),children:[t.jsx("span",{className:"vyre-pagination__info",children:p}),t.jsx("nav",{"aria-label":"Pagination",className:"vyre-pagination",children:x})]}):t.jsx("nav",{"aria-label":"Pagination",className:v("vyre-pagination",d),children:x})};Mt.displayName="VyrePagination";const It=({children:e,striped:r=!1,bordered:a=!1,compact:n=!1,hoverable:o=!0,className:i})=>t.jsx("div",{className:"vyre-table-wrapper",children:t.jsx("table",{className:v("vyre-table",r&&"vyre-table--striped",a&&"vyre-table--bordered",n&&"vyre-table--compact",o&&"vyre-table--hoverable",i),children:e})});It.displayName="VyreTable";const Tt=s.forwardRef(({className:e,...r},a)=>t.jsx("thead",{ref:a,className:v("vyre-table__head",e),...r}));Tt.displayName="VyreTableHead";const Et=s.forwardRef(({className:e,...r},a)=>t.jsx("tbody",{ref:a,className:v("vyre-table__body",e),...r}));Et.displayName="VyreTableBody";const At=s.forwardRef(({className:e,selected:r,...a},n)=>t.jsx("tr",{ref:n,className:v("vyre-table__row",r&&"vyre-table__row--selected",e),"aria-selected":r,...a}));At.displayName="VyreTableRow";const sa=({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})]})}),Bt=s.forwardRef(({className:e,sortable:r,sortDir:a=null,onSort:n,align:o="left",children:i,...l},c)=>r?t.jsx("th",{ref:c,className:v("vyre-table__th vyre-table__th--sortable",`vyre-table__th--${o}`,a&&`vyre-table__th--sort-${a}`,e),"aria-sort":a==="asc"?"ascending":a==="desc"?"descending":"none",...l,children:t.jsxs("button",{className:"vyre-table__sort-btn",onClick:n,type:"button",children:[i,t.jsx(sa,{dir:a})]})}):t.jsx("th",{ref:c,className:v("vyre-table__th",`vyre-table__th--${o}`,e),...l,children:i}));Bt.displayName="VyreTableHeader";const Vt=s.forwardRef(({className:e,align:r="left",...a},n)=>t.jsx("td",{ref:n,className:v("vyre-table__td",`vyre-table__td--${r}`,e),...a}));Vt.displayName="VyreTableCell";const $t=s.forwardRef(({className:e,...r},a)=>t.jsx("caption",{ref:a,className:v("vyre-table__caption",e),...r}));$t.displayName="VyreTableCaption";const Ft=s.createContext(null),ne=()=>{const e=s.useContext(Ft);if(!e)throw new Error("Command components must be used inside <Command>");return e};function oe(e){return e.toLowerCase().replace(/\s+/g," ").trim()}function oa(e,r,a=[]){if(!e)return!0;const n=oe(e);return oe(r).includes(n)||a.some(o=>oe(o).includes(n))}let ia=0;function la(){return`cmd-${++ia}`}const he=s.forwardRef(({value:e,onValueChange:r,className:a,children:n},o)=>{const[i,l]=s.useState(""),[c,d]=s.useState(0),[h,f]=s.useState(0),y=e!==void 0?e:i,p=s.useCallback(b=>{l(b),r==null||r(b),d(0)},[r]),x=s.useRef(new Map),u=s.useRef(new Map),m=s.useCallback((b,L,w)=>{x.current.set(b,{el:L,disabled:w})},[]),_=s.useCallback(b=>{x.current.delete(b),u.current.delete(b)},[]),g=s.useCallback(b=>{var L;(L=u.current.get(b))==null||L()},[]),N=s.useMemo(()=>({search:y,setSearch:p,activeIndex:c,setActiveIndex:d,items:x,registerItem:m,unregisterItem:_,selectItem:g,onSelectRef:u,visibleCount:h,setVisibleCount:f}),[y,p,c,m,_,g,h]);return t.jsx(Ft.Provider,{value:N,children:t.jsx("div",{ref:o,className:v("vyre-command",a),role:"combobox","aria-expanded":"true","aria-haspopup":"listbox",children:n})})});he.displayName="VyreCommand";const Wt=s.forwardRef(({placeholder:e="Search...",className:r},a)=>{const{search:n,setSearch:o}=ne();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:a,className:v("vyre-command__input",r),type:"text",placeholder:e,value:n,onChange:i=>o(i.target.value),autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list","aria-controls":"vyre-command-list"}),n&&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"})})})]})});Wt.displayName="VyreCommandInput";const Ht=s.forwardRef(({className:e,children:r},a)=>{const{activeIndex:n,setActiveIndex:o,items:i,selectItem:l}=ne(),c=s.useCallback(d=>{var f,y;const h=Array.from((i.current??new Map).entries()).filter(([,p])=>!p.disabled&&p.el.closest("[data-cmd-item]")!==null&&!p.el.hasAttribute("data-cmd-hidden"));if(d.key==="ArrowDown")d.preventDefault(),o(Math.min(n+1,h.length-1)),(f=h[Math.min(n+1,h.length-1)])==null||f[1].el.scrollIntoView({block:"nearest"});else if(d.key==="ArrowUp")d.preventDefault(),o(Math.max(n-1,0)),(y=h[Math.max(n-1,0)])==null||y[1].el.scrollIntoView({block:"nearest"});else if(d.key==="Enter"){d.preventDefault();const[p]=h[n]??[];p&&l(p)}},[n,o,i,l]);return t.jsx("div",{ref:a,id:"vyre-command-list",role:"listbox",className:v("vyre-command__list",e),onKeyDown:c,children:r})});Ht.displayName="VyreCommandList";const Pt=({className:e,children:r})=>{const{search:a,visibleCount:n}=ne();return!a||n>0?null:t.jsx("div",{className:v("vyre-command__empty",e),role:"presentation",children:r??"No results found."})};Pt.displayName="VyreCommandEmpty";const Ot=({heading:e,className:r,children:a})=>t.jsxs("div",{className:v("vyre-command__group",r),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:a})]});Ot.displayName="VyreCommandGroup";const Gt=({onSelect:e,disabled:r=!1,keywords:a,className:n,children:o,icon:i,shortcut:l})=>{const{search:c,setActiveIndex:d,registerItem:h,unregisterItem:f,onSelectRef:y,setVisibleCount:p}=ne(),x=s.useMemo(()=>la(),[]),u=s.useRef(null),_=oa(c,typeof o=="string"?o:"",a);return s.useEffect(()=>(p(g=>g+(_?1:0)),()=>{p(g=>g-(_?1:0))}),[_,p]),s.useEffect(()=>{const g=u.current;if(!(!g||!_))return h(x,g,r),()=>f(x)},[x,r,_,h,f]),s.useEffect(()=>{var g;return e&&((g=y.current)==null||g.set(x,e)),()=>{var N;(N=y.current)==null||N.delete(x)}},[x,e,y]),_?t.jsxs("div",{ref:u,"data-cmd-item":!0,role:"option","aria-disabled":r||void 0,className:v("vyre-command__item",r&&"vyre-command__item--disabled",n),onClick:()=>{r||e==null||e()},onMouseEnter:()=>{!r&&u.current&&d(-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}),l&&t.jsx("kbd",{className:"vyre-command__item-shortcut",children:l})]}):null};Gt.displayName="VyreCommandItem";const Yt=({className:e})=>t.jsx("div",{className:v("vyre-command__separator",e),role:"separator","aria-hidden":"true"});Yt.displayName="VyreCommandSeparator";const Kt=({open:e,onOpenChange:r,value:a,onValueChange:n,className:o,children:i})=>{const l=s.useRef(null);return s.useEffect(()=>{var h;if(!e)return;const c=document.activeElement,d=(h=l.current)==null?void 0:h.querySelector(".vyre-command__input");return d==null||d.focus(),()=>{c==null||c.focus({preventScroll:!0})}},[e]),s.useEffect(()=>{if(!e)return;const c=d=>{d.key==="Escape"&&r(!1)};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[e,r]),e?P.createPortal(t.jsx("div",{className:"vyre-command-backdrop",ref:l,onClick:c=>{c.target===c.currentTarget&&r(!1)},role:"dialog","aria-modal":"true","aria-label":"Command palette",children:t.jsx(he,{value:a,onValueChange:n,className:v("vyre-command--dialog",o),children:i})}),document.body):null};Kt.displayName="VyreCommandDialog";const qt=s.forwardRef(({orientation:e="horizontal",attached:r=!1,size:a,className:n,children:o,...i},l)=>t.jsx("div",{ref:l,role:"group",className:v("vyre-btn-group",e==="vertical"&&"vyre-btn-group--vertical",r&&"vyre-btn-group--attached",n),"data-orientation":e,"data-size":a,...i,children:o}));qt.displayName="VyreButtonGroup";const be=s.forwardRef(({variant:e="default",size:r="md",onRemove:a,onClick:n,disabled:o=!1,className:i,children:l,...c},d)=>{const h=!!n&&!o;return t.jsxs("span",{ref:d,className:v("vyre-tag",`vyre-tag--${e}`,`vyre-tag--${r}`,h&&"vyre-tag--clickable",o&&"vyre-tag--disabled",i),"data-variant":e,"data-size":r,role:h?"button":void 0,tabIndex:h?0:void 0,"aria-disabled":o||void 0,onClick:h?n:void 0,onKeyDown:h?f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),n==null||n())}:void 0,...c,children:[t.jsx("span",{className:"vyre-tag__label",children:l}),a&&t.jsx("button",{type:"button",className:"vyre-tag__remove","aria-label":"Remove",disabled:o,onClick:f=>{f.stopPropagation(),a()},children:t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M9 3L3 9M3 3L9 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]})});be.displayName="VyreTag";const Ut=s.forwardRef(({value:e,onChange:r,placeholder:a="Add tag…",disabled:n=!1,max:o,size:i="md",className:l,style:c,"data-testid":d},h)=>{const[f,y]=s.useState(""),p=s.useRef(null),x=o!==void 0&&e.length>=o,u=n||x;function m(b){const L=b.trim();if(!L||e.includes(L)||x){y("");return}r([...e,L]),y("")}function _(b){n||r(e.filter((L,w)=>w!==b))}function g(b){if(b.key==="Enter"||b.key===","){b.preventDefault(),m(f);return}b.key==="Backspace"&&f===""&&e.length>0&&_(e.length-1)}function N(b){const L=b.target.value;if(L.includes(",")){const w=L.split(",");w.slice(0,-1).forEach(A=>m(A)),y(w[w.length-1])}else y(L)}return t.jsxs("div",{ref:h,className:v("vyre-tags-input",`vyre-tags-input--${i}`,n&&"vyre-tags-input--disabled",l),"data-testid":d,style:c,onClick:()=>{var b;return(b=p.current)==null?void 0:b.focus()},children:[e.map((b,L)=>t.jsx(be,{size:i,disabled:n,onRemove:n?void 0:()=>_(L),children:b},`${b}-${L}`)),t.jsx("input",{ref:p,type:"text",className:"vyre-tags-input__field",value:f,onChange:N,onKeyDown:g,placeholder:x?"":a,disabled:u,"aria-label":"Add tag"})]})});Ut.displayName="VyreTagsInput";const zt=s.forwardRef(({options:e,value:r,onChange:a,placeholder:n="Search…",disabled:o=!1,size:i="md",emptyText:l="No results",className:c,...d},h)=>{const[f,y]=s.useState(!1),[p,x]=s.useState(""),[u,m]=s.useState(-1),_=s.useRef(null),g=s.useRef(null),N=s.useRef(null),L=`${s.useId()}-listbox`,w=e.find(k=>k.value===r)??null,I=e.filter(k=>k.label.toLowerCase().includes(p.toLowerCase())),A=s.useCallback(()=>{y(!1),m(-1),x("")},[]),T=s.useCallback(k=>{var D;k.disabled||(a(k.value),A(),(D=_.current)==null||D.blur())},[a,A]);s.useEffect(()=>{if(!f)return;const k=D=>{const E=N.current;E&&!E.contains(D.target)&&A()};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[f,A]),s.useEffect(()=>{var D;if(!f||u<0)return;const k=(D=g.current)==null?void 0:D.children[u];k==null||k.scrollIntoView({block:"nearest"})},[u,f]),s.useEffect(()=>{m(I.length>0?0:-1)},[p]);function M(){o||(y(!0),x(""))}function B(k){x(k.target.value),f||y(!0)}function R(k){var D;switch(k.key){case"ArrowDown":{if(k.preventDefault(),!f){y(!0);return}m(E=>{let V=E+1;for(;V<I.length&&I[V].disabled;)V++;return V<I.length?V:E});break}case"ArrowUp":{if(k.preventDefault(),!f){y(!0);return}m(E=>{let V=E-1;for(;V>=0&&I[V].disabled;)V--;return V>=0?V:E});break}case"Enter":{k.preventDefault(),f&&u>=0&&I[u]&&T(I[u]);break}case"Escape":{A(),(D=_.current)==null||D.blur();break}}}const j=f?p:(w==null?void 0:w.label)??"";return t.jsxs("div",{ref:k=>{N.current=k,typeof h=="function"?h(k):h&&(h.current=k)},className:v("vyre-combobox",`vyre-combobox--${i}`,o&&"vyre-combobox--disabled",c),"data-open":f,...d,children:[t.jsx("input",{ref:_,type:"text",role:"combobox","aria-expanded":f,"aria-haspopup":"listbox","aria-controls":L,"aria-autocomplete":"list","aria-disabled":o,disabled:o,className:"vyre-combobox__input",placeholder:n,value:j,onFocus:M,onChange:B,onKeyDown:R}),t.jsx("span",{className:"vyre-combobox__chevron","aria-hidden":"true",children:t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:t.jsx("path",{d:"M3 5L7 9L11 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),f&&t.jsx("ul",{ref:g,id:L,role:"listbox",className:"vyre-combobox__dropdown","aria-label":"Options",children:I.length>0?I.map((k,D)=>t.jsx("li",{role:"option","aria-selected":k.value===r,"aria-disabled":k.disabled,"data-highlighted":D===u,className:v("vyre-combobox__option",D===u&&"vyre-combobox__option--highlighted",k.value===r&&"vyre-combobox__option--selected"),onMouseEnter:()=>!k.disabled&&m(D),onMouseDown:E=>{E.preventDefault(),T(k)},children:k.label},k.value)):t.jsx("li",{className:"vyre-combobox__empty",role:"presentation",children:l})})]})});zt.displayName="VyreCombobox";function ca({col:e,sortKey:r,sortDir:a}){const o=r===e.key?a:void 0;return t.jsx("span",{className:"vyre-data-grid__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 2v4M3.5 4.5L6 2l2.5 2.5",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",opacity:o==="desc"?.3:1}),t.jsx("path",{d:"M6 10V6M3.5 7.5L6 10l2.5-2.5",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",opacity:o==="asc"?.3:1})]})})}const da=5,Xt=s.forwardRef(({columns:e,rows:r,sortKey:a,sortDir:n,onSort:o,loading:i=!1,emptyText:l="No data",stickyHeader:c=!1,className:d,style:h,"data-testid":f},y)=>{function p(u){if(!u.sortable||!o)return;const m=a===u.key&&n==="asc"?"desc":"asc";o(u.key,m)}function x(u){return a!==u.key?"none":n==="asc"?"ascending":"descending"}return t.jsx("div",{ref:y,className:v("vyre-data-grid",c&&"vyre-data-grid--sticky-header",d),style:h,"data-testid":f,children:t.jsxs("table",{className:"vyre-data-grid__table",children:[t.jsx("thead",{className:"vyre-data-grid__thead",children:t.jsx("tr",{children:e.map(u=>t.jsx("th",{className:v("vyre-data-grid__th",u.sortable&&"vyre-data-grid__th--sortable",a===u.key&&`vyre-data-grid__th--sort-${n}`),style:u.width?{width:u.width}:void 0,"aria-sort":u.sortable?x(u):void 0,children:u.sortable?t.jsxs("button",{type:"button",className:"vyre-data-grid__sort-btn",onClick:()=>p(u),children:[u.label,t.jsx(ca,{col:u,sortKey:a,sortDir:n})]}):u.label},u.key))})}),t.jsx("tbody",{className:"vyre-data-grid__tbody",children:i?Array.from({length:da}).map((u,m)=>t.jsx("tr",{className:"vyre-data-grid__row vyre-data-grid__row--skeleton",children:e.map(_=>t.jsx("td",{className:"vyre-data-grid__td",children:t.jsx(ye,{height:16})},_.key))},`skel-${m}`)):r.length===0?t.jsx("tr",{className:"vyre-data-grid__row vyre-data-grid__row--empty",children:t.jsx("td",{className:"vyre-data-grid__td vyre-data-grid__empty",colSpan:e.length,children:l})}):r.map((u,m)=>t.jsx("tr",{className:"vyre-data-grid__row",children:e.map(_=>t.jsx("td",{className:"vyre-data-grid__td",children:u[_.key]!=null?String(u[_.key]):""},_.key))},m))})]})})});Xt.displayName="VyreDataGrid";const Zt=s.forwardRef(({gap:e="md",wrap:r=!0,className:a,children:n,...o},i)=>t.jsx("div",{ref:i,className:v("vyre-tag-group",`vyre-tag-group--gap-${e}`,!r&&"vyre-tag-group--nowrap",a),role:"list",...o,children:n}));Zt.displayName="VyreTagGroup";function z(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function G(e,r){return e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate()}function Q(e,r){return z(e)<z(r)}function _e(e,r){return z(e)>z(r)}function ua(e,r){return new Date(e,r+1,0).getDate()}function ma(e,r,a){return(new Date(e,r,1).getDay()-a+7)%7}function Y(e,r){return e?new Intl.DateTimeFormat("default",{year:"numeric",month:"short",day:"numeric"}).format(e):""}function va(e){return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`}const ge=Array.from({length:12},(e,r)=>new Intl.DateTimeFormat("default",{month:"long"}).format(new Date(2e3,r,1))),J=12,ee=s.forwardRef((e,r)=>{const{showTime:a=!1,minDate:n,maxDate:o,disabled:i,className:l,weekStartsOn:c=1,defaultMonth:d}=e,h=z(new Date),f=()=>{var C,S;return e.mode==="range"?((C=e.value)==null?void 0:C[0])??d??h:e.mode==="multiple"?((S=e.value)==null?void 0:S[0])??d??h:e.value??d??h},[y,p]=s.useState(()=>(f()??h).getFullYear()),[x,u]=s.useState(()=>(f()??h).getMonth()),[m,_]=s.useState("days"),[g,N]=s.useState(null),[b,L]=s.useState(()=>{const C=e.mode==="single"?e.value:null;return C?C.getHours():0}),[w,I]=s.useState(()=>{const C=e.mode==="single"?e.value:null;return C?C.getMinutes():0}),A=s.useMemo(()=>{const C=ua(y,x),S=ma(y,x,c);return{count:C,offset:S}},[y,x,c]),T=s.useMemo(()=>c===1?["Mo","Tu","We","Th","Fr","Sa","Su"]:["Su","Mo","Tu","We","Th","Fr","Sa"],[c]),M=s.useCallback(C=>{if(e.mode==="single")return!!e.value&&G(C,e.value);if(e.mode==="range"){const[S,$]=e.value??[null,null];return!!S&&G(C,S)||!!$&&G(C,$)}return e.mode==="multiple"?(e.value??[]).some(S=>G(C,S)):!1},[e]),B=s.useCallback(C=>{if(e.mode!=="range")return!1;const[S,$]=e.value??[null,null],F=$??g;if(!S||!F)return!1;const K=Q(S,F)?S:F,q=Q(S,F)?F:S;return _e(C,K)&&Q(C,q)},[e,g]),R=s.useCallback(C=>{if(e.mode!=="range")return!1;const[S]=e.value??[null,null];return!!S&&G(C,S)},[e]),j=s.useCallback(C=>{if(e.mode!=="range")return!1;const[,S]=e.value??[null,null];return!!S&&G(C,S)},[e]),k=s.useCallback(C=>!!(n&&Q(C,n)||o&&_e(C,o)||i!=null&&i(C)),[n,o,i]),D=s.useCallback(C=>{var $,F,K,q,Z,te;const S=new Date(y,x,C,b,w);if(!k(z(S))){if(e.mode==="single"||!e.mode)($=e.onChange)==null||$.call(e,S);else if(e.mode==="range"){const[H,U]=e.value??[null,null];!H||H&&U?(F=e.onChange)==null||F.call(e,[S,null]):Q(S,H)?(K=e.onChange)==null||K.call(e,[S,H]):(q=e.onChange)==null||q.call(e,[H,S])}else if(e.mode==="multiple"){const H=e.value??[],U=H.findIndex(pe=>G(pe,S));U>=0?(Z=e.onChange)==null||Z.call(e,H.filter((pe,Rr)=>Rr!==U)):(te=e.onChange)==null||te.call(e,[...H,S])}}},[y,x,b,w,e,k]),E=()=>{x===0?(u(11),p(C=>C-1)):u(C=>C-1)},V=()=>{x===11?(u(0),p(C=>C+1)):u(C=>C+1)},X=(C,S)=>{var $;if(L(C),I(S),e.mode==="single"&&e.value){const F=new Date(e.value);F.setHours(C,S),($=e.onChange)==null||$.call(e,F)}},Cr=Math.floor(y/J)*J;return t.jsxs("div",{ref:r,className:v("vyre-calendar",l),children:[t.jsxs("div",{className:"vyre-calendar__header",children:[m==="days"&&t.jsx("button",{className:"vyre-calendar__nav",onClick:E,"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"})})}),m==="years"&&t.jsx("button",{className:"vyre-calendar__nav",onClick:()=>p(C=>C-J),"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==="months"?"days":"months"),children:ge[x]}),t.jsx("button",{className:"vyre-calendar__header-btn",onClick:()=>_(m==="years"?"days":"years"),children:y})]}),m==="days"&&t.jsx("button",{className:"vyre-calendar__nav",onClick:V,"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"})})}),m==="years"&&t.jsx("button",{className:"vyre-calendar__nav",onClick:()=>p(C=>C+J),"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"})})})]}),m==="months"&&t.jsx("div",{className:"vyre-calendar__month-grid",children:ge.map((C,S)=>t.jsx("button",{className:v("vyre-calendar__month-cell",S===x&&"vyre-calendar__month-cell--active"),onClick:()=>{u(S),_("days")},children:C.slice(0,3)},C))}),m==="years"&&t.jsx("div",{className:"vyre-calendar__year-grid",children:Array.from({length:J},(C,S)=>Cr+S).map(C=>t.jsx("button",{className:v("vyre-calendar__year-cell",C===y&&"vyre-calendar__year-cell--active"),onClick:()=>{p(C),_("days")},children:C},C))}),m==="days"&&t.jsxs("div",{className:"vyre-calendar__grid",children:[T.map(C=>t.jsx("div",{className:"vyre-calendar__weekday",children:C},C)),Array.from({length:A.offset}).map((C,S)=>t.jsx("div",{},`empty-${S}`)),Array.from({length:A.count},(C,S)=>S+1).map(C=>{const S=new Date(y,x,C),$=M(S),F=B(S),K=R(S),q=j(S),Z=k(S),te=G(S,h);return t.jsx("button",{className:v("vyre-calendar__day",te&&"vyre-calendar__day--today",$&&"vyre-calendar__day--selected",F&&"vyre-calendar__day--in-range",K&&"vyre-calendar__day--range-start",q&&"vyre-calendar__day--range-end",Z&&"vyre-calendar__day--disabled"),onClick:()=>D(C),onMouseEnter:()=>{if(e.mode==="range"){const[H,U]=e.value??[null,null];H&&!U&&N(S)}},onMouseLeave:()=>N(null),disabled:Z,"aria-selected":$,"aria-label":Y(S),children:C},C)})]}),a&&m==="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:b,onChange:C=>X(Number(C.target.value),w),"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:w,onChange:C=>X(b,Number(C.target.value)),"aria-label":"Minutes"})]})]})});ee.displayName="VyreCalendar";function fa(e){if(e.mode==="range"){const[n,o]=e.value??[null,null];return n?o?`${Y(n)} – ${Y(o)}`:Y(n):""}if(e.mode==="multiple"){const n=e.value??[];return n.length===0?"":n.length===1?Y(n[0]):`${n.length} dates selected`}const r=e.value,a=e.showTime;return r?a?`${Y(r)} ${va(r)}`:Y(r):""}const Qt=s.forwardRef(({placeholder:e="Pick a date",inputClassName:r,...a},n)=>{const[o,i]=s.useState(!1),l=s.useRef(null),c=s.useRef(null),[d,h]=s.useState({top:0,left:0,width:0}),f=fa(a),y=s.useCallback(()=>{if(!l.current)return;const u=l.current.getBoundingClientRect();h({top:u.bottom+window.scrollY+6,left:u.left+window.scrollX,width:u.width})},[]);s.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]),s.useEffect(()=>{if(!o)return;const u=_=>{var g,N;!((g=c.current)!=null&&g.contains(_.target))&&!((N=l.current)!=null&&N.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 p=a.mode!=="range"&&a.mode!=="multiple"&&!a.showTime,x=s.useMemo(()=>a.mode==="range"?{...a,onChange:u=>{var m;(m=a.onChange)==null||m.call(a,u),u[0]&&u[1]&&i(!1)}}:a.mode==="multiple"?a:{...a,onChange:u=>{var m;(m=a.onChange)==null||m.call(a,u),p&&i(!1)}},[a,p]);return t.jsxs("div",{ref:n,className:"vyre-datepicker",children:[t.jsxs("button",{ref:l,type:"button",className:v("vyre-datepicker__trigger",!f&&"vyre-datepicker__trigger--placeholder",r),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:f||e}),f&&t.jsx("button",{className:"vyre-datepicker__clear",type:"button","aria-label":"Clear",onClick:u=>{var m,_,g;u.stopPropagation(),a.mode==="range"?(m=a.onChange)==null||m.call(a,[null,null]):a.mode==="multiple"?(_=a.onChange)==null||_.call(a,[]):(g=a.onChange)==null||g.call(a,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&&P.createPortal(t.jsx("div",{ref:c,className:"vyre-datepicker__popover",role:"dialog","aria-label":"Date picker",style:{top:d.top,left:d.left,minWidth:d.width},children:t.jsx(ee,{...x})}),document.body)]})});Qt.displayName="VyreDatePicker";function O(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function ie(e,r){const a=new Date(e);return a.setDate(a.getDate()+r),O(a)}function le(e){return e?new Intl.DateTimeFormat("default",{year:"numeric",month:"short",day:"numeric"}).format(e):""}const ya=[{label:"Today",range:()=>{const e=O(new Date);return{from:e,to:e}}},{label:"Yesterday",range:()=>{const e=ie(new Date,-1);return{from:e,to:e}}},{label:"Last 7 days",range:()=>({from:ie(new Date,-6),to:O(new Date)})},{label:"Last 30 days",range:()=>({from:ie(new Date,-29),to:O(new Date)})},{label:"This month",range:()=>{const e=new Date;return{from:O(new Date(e.getFullYear(),e.getMonth(),1)),to:O(new Date(e.getFullYear(),e.getMonth()+1,0))}}},{label:"Last month",range:()=>{const e=new Date;return{from:O(new Date(e.getFullYear(),e.getMonth()-1,1)),to:O(new Date(e.getFullYear(),e.getMonth(),0))}}}],Jt=s.forwardRef(({value:e,onChange:r,placeholder:a="Pick a date range",numberOfMonths:n=2,presets:o=!1,minDate:i,maxDate:l,disabled:c,weekStartsOn:d=1,className:h,inputClassName:f},y)=>{const[p,x]=s.useState(!1),u=s.useRef(null),m=s.useRef(null),[_,g]=s.useState({top:0,left:0,width:0}),N=(e==null?void 0:e.from)??null,b=(e==null?void 0:e.to)??null,L=s.useMemo(()=>o===!0?ya:Array.isArray(o)?o:[],[o]),w=s.useMemo(()=>N?b?`${le(N)} – ${le(b)}`:le(N):"",[N,b]),I=s.useCallback(()=>{if(!u.current)return;const j=u.current.getBoundingClientRect();g({top:j.bottom+window.scrollY+6,left:j.left+window.scrollX,width:j.width})},[]);s.useEffect(()=>{if(!p)return;I();const j=()=>I(),k=()=>I();return window.addEventListener("scroll",j,!0),window.addEventListener("resize",k),()=>{window.removeEventListener("scroll",j,!0),window.removeEventListener("resize",k)}},[p,I]),s.useEffect(()=>{if(!p)return;const j=D=>{var E,V;!((E=m.current)!=null&&E.contains(D.target))&&!((V=u.current)!=null&&V.contains(D.target))&&x(!1)},k=D=>{D.key==="Escape"&&x(!1)};return document.addEventListener("pointerdown",j),document.addEventListener("keydown",k),()=>{document.removeEventListener("pointerdown",j),document.removeEventListener("keydown",k)}},[p]);const A=s.useCallback(j=>{const k={from:j[0],to:j[1]};r==null||r(k),k.from&&k.to&&x(!1)},[r]),T=s.useCallback(j=>{r==null||r(j.range()),x(!1)},[r]),M=s.useCallback(()=>{r==null||r({from:null,to:null})},[r]),B=s.useMemo(()=>{const j=N??O(new Date);return new Date(j.getFullYear(),j.getMonth()+1,1)},[N]),R=[N,b];return t.jsxs("div",{ref:y,className:v("vyre-date-range-picker",h),children:[t.jsxs("button",{ref:u,type:"button",className:v("vyre-datepicker__trigger",!w&&"vyre-datepicker__trigger--placeholder",f),onClick:()=>{I(),x(j=>!j)},"aria-expanded":p,"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:w||a}),w&&t.jsx("button",{className:"vyre-datepicker__clear",type:"button","aria-label":"Clear",onClick:j=>{j.stopPropagation(),M()},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"})})})]}),p&&P.createPortal(t.jsxs("div",{ref:m,className:"vyre-date-range-picker__popover",role:"dialog","aria-label":"Date range picker",style:{top:_.top,left:_.left},children:[L.length>0&&t.jsx("div",{className:"vyre-date-range-picker__presets",children:L.map(j=>t.jsx("button",{type:"button",className:"vyre-date-range-picker__preset",onClick:()=>T(j),children:j.label},j.label))}),t.jsxs("div",{className:"vyre-date-range-picker__calendars",children:[t.jsx(ee,{mode:"range",value:R,onChange:A,minDate:i,maxDate:l,disabled:c,weekStartsOn:d}),n===2&&t.jsx(ee,{mode:"range",value:R,defaultMonth:B,onChange:A,minDate:i,maxDate:l,disabled:c,weekStartsOn:d},B.toISOString())]})]}),document.body)]})});Jt.displayName="VyreDateRangePicker";const er=s.forwardRef(({variant:e="default",size:r="md",clickable:a=!1,className:n,children:o,...i},l)=>t.jsx("div",{ref:l,className:v("vyre-item",`vyre-item--${e}`,`vyre-item--${r}`,a&&"vyre-item--clickable",n),"data-variant":e,"data-size":r,role:a?"button":void 0,tabIndex:a?0:void 0,...i,children:o}));er.displayName="VyreItem";const tr=s.forwardRef(({separated:e=!1,className:r,children:a,...n},o)=>t.jsx("div",{ref:o,role:"list",className:v("vyre-item-group",e&&"vyre-item-group--separated",r),...n,children:a}));tr.displayName="VyreItemGroup";const rr=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-item__media",e),"aria-hidden":"true",...a,children:r}));rr.displayName="VyreItemMedia";const ar=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-item__content",e),...a,children:r}));ar.displayName="VyreItemContent";const nr=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-item__title",e),...a,children:r}));nr.displayName="VyreItemTitle";const sr=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("p",{ref:n,className:v("vyre-item__description",e),...a,children:r}));sr.displayName="VyreItemDescription";const or=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-item__actions",e),...a,children:r}));or.displayName="VyreItemActions";function ha(e,r,a,n){const o=e.find(l=>l.id===r.fromColumnId);if(!o)return e;const i=o.cards.find(l=>l.id===r.cardId);return i?e.map(l=>{if(l.id===r.fromColumnId&&l.id===a){const c=l.cards.filter(f=>f.id!==r.cardId),d=Math.max(0,Math.min(n,c.length)),h=[...c];return h.splice(d,0,i),{...l,cards:h}}if(l.id===r.fromColumnId)return{...l,cards:l.cards.filter(c=>c.id!==r.cardId)};if(l.id===a){const c=Math.max(0,Math.min(n,l.cards.length)),d=[...l.cards];return d.splice(c,0,i),{...l,cards:d}}return l}):e}const ir=s.forwardRef(({value:e,onChange:r,renderCard:a,onCardClick:n,className:o,...i},l)=>{const c=s.useRef(null),d=s.useRef(!1),[h,f]=s.useState(null),[y,p]=s.useState(null),[x,u]=s.useState(null),m=(b,L)=>{p(w=>w===b?w:b),u(w=>w===L?w:L)},_=(b,L)=>w=>{c.current={cardId:L,fromColumnId:b},d.current=!1,f(L),w.dataTransfer.effectAllowed="move",w.dataTransfer.setData("text/plain",L)},g=()=>{c.current=null,f(null),p(null),u(null)},N=(b,L)=>{const w=c.current;if(!w)return;const I=ha(e,w,b,L);I!==e&&(d.current=!0,r(I))};return t.jsx("div",{ref:l,className:v("vyre-kanban",o),role:"list","aria-label":"Kanban board",...i,children:e.map(b=>{const L=y===b.id,w=b.color&&b.color!=="default"?b.color:void 0,I=L&&c.current&&x!==null?x:null,A=t.jsx("div",{className:"vyre-kanban__placeholder","aria-hidden":"true"});return t.jsxs("div",{role:"listitem","data-color":w,className:v("vyre-kanban__column",L&&"vyre-kanban__column--over"),onDragOver:T=>{c.current&&(T.preventDefault(),T.dataTransfer.dropEffect="move",m(b.id,b.cards.length))},onDragLeave:T=>{T.currentTarget.contains(T.relatedTarget)||(p(M=>M===b.id?null:M),u(null))},onDrop:T=>{T.preventDefault(),N(b.id,x??b.cards.length),g()},children:[t.jsxs("div",{className:"vyre-kanban__column-header",children:[t.jsx("span",{className:"vyre-kanban__column-title",children:b.title}),t.jsx("span",{className:"vyre-kanban__column-count",children:b.cards.length})]}),t.jsxs("div",{className:"vyre-kanban__cards",children:[b.cards.map((T,M)=>{const B=T.color&&T.color!=="default"?T.color:void 0;return t.jsxs(s.Fragment,{children:[I===M&&A,t.jsx(de,{variant:"outlined","data-color":B,className:v("vyre-kanban__card",h===T.id&&"vyre-kanban__card--dragging",n&&"vyre-kanban__card--clickable"),draggable:!0,role:n?"button":void 0,tabIndex:n?0:void 0,onDragStart:_(b.id,T.id),onDragEnd:g,onDragOver:R=>{if(!c.current)return;R.preventDefault(),R.stopPropagation();const j=R.currentTarget.getBoundingClientRect(),k=R.clientY-j.top>j.height/2;m(b.id,k?M+1:M)},onDrop:R=>{R.preventDefault(),R.stopPropagation(),N(b.id,x??M),g()},onClick:()=>{d.current||n==null||n(T,b)},onKeyDown:R=>{n&&(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),n(T,b))},children:t.jsx(ue,{children:a?a(T,b):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"vyre-kanban__card-title",children:T.title}),T.description&&t.jsx("div",{className:"vyre-kanban__card-desc",children:T.description})]})})})]},T.id)}),I===b.cards.length&&A,b.cards.length===0&&I===null&&t.jsx("div",{className:"vyre-kanban__empty",children:"Drop cards here"})]})]},b.id)})})});ir.displayName="VyreKanban";function je(e){if(e==null)return null;const r=e instanceof Date?e:new Date(e);return Number.isNaN(r.getTime())?null:r}function ce(e,r){return e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate()}function ba(e){const r=new Date,a=new Date;return a.setDate(r.getDate()-1),ce(e,r)?"Today":ce(e,a)?"Yesterday":new Intl.DateTimeFormat("default",{month:"short",day:"numeric",year:e.getFullYear()===r.getFullYear()?void 0:"numeric"}).format(e)}function pa(e){return new Intl.DateTimeFormat("default",{hour:"numeric",minute:"2-digit"}).format(e)}const xa={sending:"Sending…",sent:"Sent",delivered:"Delivered",read:"Read"};function _a(){return t.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",children:[t.jsx("path",{d:"M10 2H5a1.5 1.5 0 0 0-1.5 1.5v11A1.5 1.5 0 0 0 5 16h8a1.5 1.5 0 0 0 1.5-1.5V6.5L10 2z",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"}),t.jsx("path",{d:"M10 2v4.5h4.5",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"})]})}function ga({attachment:e}){const{kind:r,url:a,name:n,size:o}=e;return r==="image"?t.jsx("a",{className:"vyre-conversation__att vyre-conversation__att--image",href:a,target:"_blank",rel:"noopener noreferrer",children:t.jsx("img",{src:a,alt:n??"image attachment",loading:"lazy"})}):r==="audio"?t.jsx("audio",{className:"vyre-conversation__att vyre-conversation__att--audio",src:a,controls:!0,preload:"none"}):r==="video"?t.jsx("video",{className:"vyre-conversation__att vyre-conversation__att--video",src:a,controls:!0,preload:"none"}):t.jsxs("a",{className:"vyre-conversation__att vyre-conversation__att--file",href:a,target:"_blank",rel:"noopener noreferrer",download:n,children:[t.jsx("span",{className:"vyre-conversation__att-icon",children:t.jsx(_a,{})}),t.jsxs("span",{className:"vyre-conversation__att-info",children:[t.jsx("span",{className:"vyre-conversation__att-name",children:n??"Attachment"}),o&&t.jsx("span",{className:"vyre-conversation__att-size",children:o})]})]})}const lr=s.forwardRef(({value:e,currentUserId:r,composer:a=!1,onSend:n,placeholder:o="Write a message…",typing:i=!1,allowAttachments:l=!1,accept:c,renderMessage:d,renderComposer:h,className:f,...y},p)=>{const[x,u]=s.useState(""),[m,_]=s.useState([]),g=s.useRef(null),N=()=>{const w=x.trim();!w&&m.length===0||(n==null||n(w,m),u(""),_([]))},b=s.useMemo(()=>e.map((w,I)=>{const A=e[I-1],T=e[I+1],M=je(w.timestamp),B=A?je(A.timestamp):null,R=!!M&&(!B||!ce(M,B)),j=!A||A.authorId!==w.authorId||R,k=!T||T.authorId!==w.authorId,D=w.authorId===r;return{msg:w,date:M,showDaySeparator:R,isGroupStart:j,isGroupEnd:k,outgoing:D}}),[e,r]),L={value:x,setValue:u,files:m,setFiles:_,send:N};return t.jsxs("div",{ref:p,className:v("vyre-conversation",f),...y,children:[t.jsxs("div",{className:"vyre-conversation__thread",role:"log","aria-label":"Conversation","aria-live":"polite",children:[b.map(({msg:w,date:I,showDaySeparator:A,isGroupStart:T,isGroupEnd:M,outgoing:B})=>t.jsxs(s.Fragment,{children:[A&&I&&t.jsx("div",{className:"vyre-conversation__day",role:"separator",children:t.jsx("span",{children:ba(I)})}),t.jsxs("div",{className:v("vyre-conversation__row",B?"vyre-conversation__row--out":"vyre-conversation__row--in",M&&"vyre-conversation__row--group-end"),children:[t.jsx("div",{className:"vyre-conversation__avatar",children:!B&&M&&t.jsx(ve,{size:"sm",src:w.authorAvatar,fallback:(w.authorName??w.authorId).slice(0,1).toUpperCase(),alt:w.authorName??w.authorId})}),t.jsxs("div",{className:"vyre-conversation__stack",children:[!B&&T&&w.authorName&&t.jsx("span",{className:"vyre-conversation__author",children:w.authorName}),t.jsx("div",{className:"vyre-conversation__bubble",children:d?d(w,{outgoing:B,isGroupStart:T,isGroupEnd:M}):t.jsxs(t.Fragment,{children:[w.attachments&&w.attachments.length>0&&t.jsx("div",{className:"vyre-conversation__attachments",children:w.attachments.map((R,j)=>t.jsx(ga,{attachment:R},j))}),w.text]})}),M&&t.jsxs("span",{className:"vyre-conversation__meta",children:[I&&pa(I),B&&w.status&&t.jsxs("span",{className:v("vyre-conversation__status",`vyre-conversation__status--${w.status}`),children:[I?" · ":"",xa[w.status]]})]})]})]})]},w.id)),i&&t.jsxs("div",{className:"vyre-conversation__row vyre-conversation__row--in",children:[t.jsx("div",{className:"vyre-conversation__avatar"}),t.jsx("div",{className:"vyre-conversation__stack",children:t.jsxs("div",{className:"vyre-conversation__bubble vyre-conversation__bubble--typing",children:[t.jsx("span",{className:"vyre-conversation__dot"}),t.jsx("span",{className:"vyre-conversation__dot"}),t.jsx("span",{className:"vyre-conversation__dot"}),typeof i=="string"&&t.jsx("span",{className:"vyre-conversation__typing-label",children:i})]})})]})]}),h?h(L):a&&t.jsxs("form",{className:"vyre-conversation__composer",onSubmit:w=>{w.preventDefault(),N()},children:[l&&m.length>0&&t.jsx("div",{className:"vyre-conversation__staged",children:m.map((w,I)=>t.jsxs("span",{className:"vyre-conversation__chip",children:[t.jsx("span",{className:"vyre-conversation__chip-name",children:w.name}),t.jsx("button",{type:"button",className:"vyre-conversation__chip-remove","aria-label":`Remove ${w.name}`,onClick:()=>_(m.filter((A,T)=>T!==I)),children:t.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M2 2l6 6M8 2l-6 6",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})})]},I))}),t.jsxs("div",{className:"vyre-conversation__composer-row",children:[l&&t.jsxs(t.Fragment,{children:[t.jsx("input",{ref:g,type:"file",multiple:!0,accept:c,className:"vyre-conversation__file-input",onChange:w=>{const I=Array.from(w.target.files??[]);I.length&&_([...m,...I]),w.target.value=""}}),t.jsx("button",{type:"button",className:"vyre-conversation__attach","aria-label":"Attach files",onClick:()=>{var w;return(w=g.current)==null?void 0:w.click()},children:t.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M13.5 6.5l-5.6 5.6a2.5 2.5 0 0 1-3.5-3.5l6-6a3.5 3.5 0 0 1 5 5l-6 6",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),t.jsx("input",{className:"vyre-conversation__input",value:x,onChange:w=>u(w.target.value),placeholder:o,"aria-label":"Message"}),t.jsx("button",{type:"submit",className:"vyre-conversation__send",disabled:!x.trim()&&m.length===0,"aria-label":"Send message",children:t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M2 8l12-5-4.5 12L7 9.5 2 8z",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round"})})})]})]})]})});lr.displayName="VyreConversation";const cr=s.forwardRef(({as:e="p",size:r="md",weight:a,color:n="default",truncate:o,mono:i,className:l,children:c,...d},h)=>t.jsx(e,{ref:h,className:v("vyre-text",r!=="md"&&`vyre-text--${r}`,a&&`vyre-text--${a}`,n!=="default"&&`vyre-text--${n}`,o&&"vyre-text--truncate",i&&"vyre-text--mono",l),...d,children:c}));cr.displayName="VyreText";const dr=s.forwardRef(({as:e="h2",size:r="md",weight:a="bold",color:n="default",truncate:o,className:i,children:l,...c},d)=>t.jsx(e,{ref:d,className:v("vyre-heading",`vyre-heading--${r}`,a!=="bold"&&`vyre-heading--${a}`,n!=="default"&&`vyre-text--${n}`,o&&"vyre-text--truncate",i),...c,children:l}));dr.displayName="VyreHeading";const ur=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("p",{ref:n,className:v("vyre-lead",e),...a,children:r}));ur.displayName="VyreLead";const mr=s.forwardRef(({block:e,className:r,children:a,...n},o)=>e?t.jsx("pre",{className:v("vyre-code-block",r),...n,children:t.jsx("code",{ref:o,children:a})}):t.jsx("code",{ref:o,className:v("vyre-code",r),...n,children:a}));mr.displayName="VyreCode";const vr=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("blockquote",{ref:n,className:v("vyre-blockquote",e),...a,children:r}));vr.displayName="VyreBlockquote";const fr=s.createContext({collapsed:!1,toggleCollapsed:()=>{}}),se=()=>s.useContext(fr),yr=s.forwardRef(({defaultCollapsed:e=!1,collapsed:r,onCollapsedChange:a,className:n,children:o},i)=>{const[l,c]=s.useState(e),d=r!==void 0?r:l,h=s.useCallback(()=>{const f=!d;c(f),a==null||a(f)},[d,a]);return t.jsx(fr.Provider,{value:{collapsed:d,toggleCollapsed:h},children:t.jsx("div",{ref:i,className:v("vyre-app-layout",n),children:o})})});yr.displayName="VyreAppLayout";const hr=s.forwardRef(({variant:e="default",className:r,children:a},n)=>{const{collapsed:o}=se();return t.jsx("aside",{ref:n,className:v("vyre-sidebar",o&&"vyre-sidebar--collapsed",e==="floating"&&"vyre-sidebar--floating",r),"data-collapsed":o||void 0,children:a})});hr.displayName="VyreSidebar";const br=s.forwardRef(({logo:e,title:r,className:a,children:n},o)=>t.jsxs("div",{ref:o,className:v("vyre-sidebar__header",a),children:[e&&t.jsx("span",{className:"vyre-sidebar__logo",children:e}),r&&t.jsx("span",{className:"vyre-sidebar__title",children:r}),n]}));br.displayName="VyreSidebarHeader";const pr=s.forwardRef(({className:e,children:r},a)=>t.jsx("div",{ref:a,className:v("vyre-sidebar__content",e),children:r}));pr.displayName="VyreSidebarContent";const xr=s.forwardRef(({label:e,className:r,children:a},n)=>t.jsxs("div",{ref:n,className:v("vyre-sidebar__section",r),children:[e&&t.jsx("div",{className:"vyre-sidebar__section-label",children:e}),a]}));xr.displayName="VyreSidebarSection";const _r=({active:e,icon:r,badge:a,href:n,onClick:o,className:i,children:l})=>{const{collapsed:c}=se(),d=v("vyre-sidebar__item",e&&"vyre-sidebar__item--active",i),h=t.jsxs(t.Fragment,{children:[r&&t.jsx("span",{className:"vyre-sidebar__item-icon",children:r}),t.jsx("span",{className:"vyre-sidebar__item-label",children:l}),a!==void 0&&t.jsx("span",{className:"vyre-sidebar__item-badge",children:a})]});return n?t.jsx("a",{href:n,className:d,"aria-current":e?"page":void 0,title:c?String(l):void 0,children:h}):t.jsx("button",{type:"button",className:d,onClick:o,"aria-pressed":e,title:c?String(l):void 0,children:h})};_r.displayName="VyreSidebarItem";const gr=s.forwardRef(({className:e,children:r},a)=>t.jsx("div",{ref:a,className:v("vyre-sidebar__footer",e),children:r}));gr.displayName="VyreSidebarFooter";const jr=s.forwardRef(({className:e,children:r},a)=>t.jsx("div",{ref:a,className:v("vyre-app-shell",e),children:r}));jr.displayName="VyreAppShell";const wr=s.forwardRef(({className:e,children:r},a)=>t.jsx("header",{ref:a,className:v("vyre-app-bar",e),children:r}));wr.displayName="VyreAppBar";const kr=({className:e})=>{const{collapsed:r,toggleCollapsed:a}=se();return t.jsx("button",{type:"button",className:v("vyre-sidebar-trigger",e),onClick:a,"aria-label":r?"Expand sidebar":"Collapse sidebar","aria-expanded":!r,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"})]})})};kr.displayName="VyreSidebarTrigger";const Nr=s.forwardRef(({className:e,children:r},a)=>t.jsx("div",{ref:a,className:v("vyre-page-content",e),children:r}));Nr.displayName="VyrePageContent";exports.Accordion=Ze;exports.AccordionContent=et;exports.AccordionItem=Qe;exports.AccordionTrigger=Je;exports.Alert=gt;exports.AlertDialog=jt;exports.AppBar=wr;exports.AppLayout=yr;exports.AppShell=jr;exports.Avatar=ve;exports.Badge=ke;exports.Blockquote=vr;exports.Breadcrumb=Rt;exports.BreadcrumbItem=Lt;exports.BreadcrumbLink=Dt;exports.BreadcrumbSeparator=St;exports.Button=we;exports.ButtonGroup=qt;exports.Calendar=ee;exports.Card=de;exports.CardBody=ue;exports.CardFooter=Ce;exports.CardHeader=Ne;exports.Checkbox=tt;exports.Code=mr;exports.Combobox=zt;exports.Command=he;exports.CommandDialog=Kt;exports.CommandEmpty=Pt;exports.CommandGroup=Ot;exports.CommandInput=Wt;exports.CommandItem=Gt;exports.CommandList=Ht;exports.CommandSeparator=Yt;exports.Conversation=lr;exports.DataGrid=Xt;exports.DatePicker=Qt;exports.DateRangePicker=Jt;exports.DropdownCheckboxItem=yt;exports.DropdownItem=ft;exports.DropdownLabel=vt;exports.DropdownMenu=mt;exports.DropdownRadioGroup=ht;exports.DropdownRadioItem=bt;exports.DropdownSeparator=xt;exports.DropdownSub=pt;exports.Field=Re;exports.FieldDescription=De;exports.FieldError=Se;exports.FieldGroup=Me;exports.FieldLabel=Le;exports.FieldSet=Ie;exports.Heading=dr;exports.Input=Te;exports.Item=er;exports.ItemActions=or;exports.ItemContent=ar;exports.ItemDescription=sr;exports.ItemGroup=tr;exports.ItemMedia=rr;exports.ItemTitle=nr;exports.Kanban=ir;exports.Label=ct;exports.Lead=ur;exports.Modal=Ae;exports.ModalBody=Ve;exports.ModalFooter=$e;exports.ModalHeader=Be;exports.PageContent=Nr;exports.Pagination=Mt;exports.Popover=dt;exports.Progress=it;exports.Radio=fe;exports.RadioGroup=at;exports.RichTextEditor=nt;exports.Select=We;exports.Separator=lt;exports.Sheet=wt;exports.SheetBody=Nt;exports.SheetFooter=Ct;exports.SheetHeader=kt;exports.Sidebar=hr;exports.SidebarContent=pr;exports.SidebarFooter=gr;exports.SidebarHeader=br;exports.SidebarItem=_r;exports.SidebarSection=xr;exports.SidebarTrigger=kr;exports.Skeleton=ye;exports.Slider=ot;exports.Switch=st;exports.Tab=Ye;exports.TabList=Ge;exports.TabPanel=qe;exports.TabPanels=Ke;exports.Table=It;exports.TableBody=Et;exports.TableCaption=$t;exports.TableCell=Vt;exports.TableHead=Tt;exports.TableHeader=Bt;exports.TableRow=At;exports.Tabs=Oe;exports.Tag=be;exports.TagGroup=Zt;exports.TagsInput=Ut;exports.Text=cr;exports.Textarea=Ee;exports.ToastProvider=Ar;exports.Tooltip=Ue;exports.cn=v;exports.useAppLayout=se;exports.useToast=Br;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),s=require("react"),P=require("react-dom");function v(...e){const r=[];for(const a of e)if(a){if(typeof a=="string")r.push(a);else if(Array.isArray(a)){const n=v(...a);n&&r.push(n)}else if(typeof a=="object")for(const[n,o]of Object.entries(a))o&&r.push(n)}return r.join(" ")}const Lr={primary:"vyre-btn--primary",secondary:"vyre-btn--secondary",ghost:"vyre-btn--ghost",accent:"vyre-btn--accent",teal:"vyre-btn--teal",danger:"vyre-btn--danger"},Dr={sm:"vyre-btn--sm",md:"vyre-btn--md",lg:"vyre-btn--lg",icon:"vyre-btn--icon"},we=s.forwardRef(({variant:e="secondary",size:r="md",loading:a=!1,disabled:n,leftIcon:o,rightIcon:i,className:l,children:c,as:d="button",...h},f)=>{const y=n||a;return t.jsxs(d,{ref:f,className:v("vyre-btn",Lr[e],Dr[r],a&&"vyre-btn--loading",l),disabled:d==="button"?y:void 0,"aria-disabled":y,"data-variant":e,"data-size":r,...h,children:[a&&t.jsx("span",{className:"vyre-btn__spinner","aria-hidden":"true",children:t.jsx(Sr,{})}),!a&&o&&t.jsx("span",{className:"vyre-btn__icon vyre-btn__icon--left","aria-hidden":"true",children:o}),c&&t.jsx("span",{className:"vyre-btn__label",children:c}),i&&t.jsx("span",{className:"vyre-btn__icon vyre-btn__icon--right","aria-hidden":"true",children:i})]})});we.displayName="VyreButton";function Sr(){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 ke=s.forwardRef(({variant:e="default",dot:r=!1,className:a,children:n,...o},i)=>t.jsxs("span",{ref:i,className:v("vyre-badge",`vyre-badge--${e}`,a),"data-variant":e,...o,children:[r&&t.jsx("span",{className:"vyre-badge__dot","aria-hidden":"true"}),n]}));ke.displayName="VyreBadge";const de=s.forwardRef(({variant:e="default",hoverable:r=!1,clickable:a=!1,className:n,children:o,...i},l)=>t.jsx("div",{ref:l,className:v("vyre-card",`vyre-card--${e}`,r&&"vyre-card--hoverable",a&&"vyre-card--clickable",n),"data-variant":e,role:a?"button":void 0,tabIndex:a?0:void 0,...i,children:o}));de.displayName="VyreCard";const Ne=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-card__header",e),...a,children:r}));Ne.displayName="VyreCardHeader";const ue=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-card__body",e),...a,children:r}));ue.displayName="VyreCardBody";const Ce=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-card__footer",e),...a,children:r}));Ce.displayName="VyreCardFooter";const Re=s.forwardRef(({label:e,hint:r,state:a="idle",required:n=!1,htmlFor:o,className:i,children:l,...c},d)=>t.jsxs("div",{ref:d,className:v("vyre-field",a!=="idle"&&`vyre-field--${a}`,i),"data-state":a,...c,children:[e&&t.jsxs("label",{className:"vyre-field__label",htmlFor:o,children:[e,n&&t.jsx("span",{className:"vyre-field__required","aria-label":"required",children:"*"})]}),l,r&&t.jsx("span",{className:"vyre-field__hint",role:a==="error"?"alert":void 0,children:r})]}));Re.displayName="VyreField";const Le=s.forwardRef(({required:e=!1,className:r,children:a,...n},o)=>t.jsxs("label",{ref:o,className:v("vyre-field__label",r),...n,children:[a,e&&t.jsx("span",{className:"vyre-field__required","aria-label":"required",children:"*"})]}));Le.displayName="VyreFieldLabel";const De=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("p",{ref:n,className:v("vyre-field__description",e),...a,children:r}));De.displayName="VyreFieldDescription";const Se=s.forwardRef(({className:e,children:r,...a},n)=>r?t.jsx("p",{ref:n,role:"alert",className:v("vyre-field__error",e),...a,children:r}):null);Se.displayName="VyreFieldError";const Me=s.forwardRef(({orientation:e="vertical",className:r,children:a,...n},o)=>t.jsx("div",{ref:o,className:v("vyre-field-group",`vyre-field-group--${e}`,r),...n,children:a}));Me.displayName="VyreFieldGroup";const Ie=s.forwardRef(({legend:e,className:r,children:a,...n},o)=>t.jsxs("fieldset",{ref:o,className:v("vyre-field-set",r),...n,children:[e&&t.jsx("legend",{className:"vyre-field-set__legend",children:e}),a]}));Ie.displayName="VyreFieldSet";const Te=s.forwardRef(({size:e="md",leftElement:r,rightElement:a,className:n,...o},i)=>r||a?t.jsxs("div",{className:v("vyre-input-wrapper",`vyre-input-wrapper--${e}`),children:[r&&t.jsx("span",{className:"vyre-input__element vyre-input__element--left","aria-hidden":"true",children:r}),t.jsx("input",{ref:i,className:v("vyre-input",`vyre-input--${e}`,!!r&&"vyre-input--has-left",!!a&&"vyre-input--has-right",n),...o}),a&&t.jsx("span",{className:"vyre-input__element vyre-input__element--right","aria-hidden":"true",children:a})]}):t.jsx("input",{ref:i,className:v("vyre-input",`vyre-input--${e}`,n),...o}));Te.displayName="VyreInput";const Ee=s.forwardRef(({size:e="md",resize:r="vertical",className:a,style:n,...o},i)=>t.jsx("textarea",{ref:i,className:v("vyre-textarea",`vyre-textarea--${e}`,a),style:{resize:r,...n},...o}));Ee.displayName="VyreTextarea";const Mr=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(","),Ae=s.forwardRef(({open:e,onClose:r,size:a="md",closeOnBackdrop:n=!0,closeOnEsc:o=!0,initialFocus:i,className:l,children:c,"aria-label":d,"aria-labelledby":h,...f},y)=>{const p=s.useRef(null),x=s.useRef(null),u=s.useCallback(g=>{p.current=g,typeof y=="function"?y(g):y&&(y.current=g)},[y]),m=s.useCallback(g=>{if(g.key!=="Tab")return;const N=p.current;if(!N)return;const b=Array.from(N.querySelectorAll(Mr));if(!b.length)return;const L=b[0],w=b[b.length-1];g.shiftKey&&document.activeElement===L?(g.preventDefault(),w.focus()):!g.shiftKey&&document.activeElement===w&&(g.preventDefault(),L.focus())},[]),_=s.useCallback(g=>{g.key==="Escape"&&o&&r()},[o,r]);return s.useEffect(()=>{if(!e)return;document.addEventListener("keydown",_),document.addEventListener("keydown",m);const g=document.body.style.overflow;document.body.style.overflow="hidden";const N=setTimeout(()=>{var b;i!=null&&i.current?i.current.focus():(b=p.current)==null||b.focus()},0);return()=>{document.removeEventListener("keydown",_),document.removeEventListener("keydown",m),document.body.style.overflow=g,clearTimeout(N)}},[e,_,m,i]),e?P.createPortal(t.jsx("div",{ref:x,className:"vyre-modal-backdrop",onClick:g=>{n&&g.target===x.current&&r()},role:"presentation",children:t.jsx("div",{ref:u,className:v("vyre-modal",`vyre-modal--${a}`,l),role:"dialog","aria-modal":"true","aria-label":d,"aria-labelledby":h,tabIndex:-1,...f,children:c})}),document.body):null});Ae.displayName="VyreModal";const Be=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-modal__header",e),...a,children:r}));Be.displayName="VyreModalHeader";const Ve=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-modal__body",e),...a,children:r}));Ve.displayName="VyreModalBody";const $e=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-modal__footer",e),...a,children:r}));$e.displayName="VyreModalFooter";const Fe=s.createContext(null);function Ir(e,r){switch(r.type){case"ADD":return[...e,r.payload];case"REMOVE":return e.filter(a=>a.id!==r.id);default:return e}}let Tr=0;const Er=()=>`vyre-t-${++Tr}`;function Ar({children:e}){const[r,a]=s.useReducer(Ir,[]),n=s.useCallback(i=>{const l=Er();return a({type:"ADD",payload:{...i,id:l}}),l},[]),o=s.useCallback(i=>{a({type:"REMOVE",id:i})},[]);return t.jsxs(Fe.Provider,{value:{toast:n,dismiss:o},children:[e,typeof document<"u"&&P.createPortal(t.jsx("div",{className:"vyre-toast-viewport","aria-live":"polite","aria-atomic":"false","aria-label":"Notifications",children:r.map(i=>t.jsx(Vr,{...i,onDismiss:()=>o(i.id)},i.id))}),document.body)]})}function Br(){const e=s.useContext(Fe);if(!e)throw new Error("useToast must be used inside <ToastProvider>");return e}function Vr({title:e,description:r,variant:a="default",duration:n=4e3,onDismiss:o}){return s.useEffect(()=>{if(n===1/0)return;const i=setTimeout(o,n);return()=>clearTimeout(i)},[n,o]),t.jsxs("div",{className:v("vyre-toast",`vyre-toast--${a}`),role:"alert","data-variant":a,children:[t.jsxs("div",{className:"vyre-toast__content",children:[e&&t.jsx("p",{className:"vyre-toast__title",children:e}),r&&t.jsx("p",{className:"vyre-toast__description",children:r})]}),t.jsx("button",{className:"vyre-toast__close",onClick:o,"aria-label":"Dismiss notification",type:"button",children:t.jsx($r,{})})]})}function $r(){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 We=s.forwardRef(({options:e,value:r,defaultValue:a,onChange:n,placeholder:o="Select an option",disabled:i=!1,size:l="md",className:c,...d},h)=>{const f=r!==void 0,[y,p]=s.useState(a??""),x=f?r:y,[u,m]=s.useState(!1),[_,g]=s.useState(-1),N=s.useRef(null),b=s.useRef(null),w=`${s.useId()}-listbox`,I=e.find(j=>j.value===x),A=e.filter(j=>!j.disabled),T=s.useCallback(()=>{m(!1),g(-1)},[]),M=s.useCallback(j=>{var k;j.disabled||(f||p(j.value),n==null||n(j.value),T(),(k=N.current)==null||k.focus())},[f,n,T]);s.useEffect(()=>{if(!u)return;const j=k=>{const D=h==null?void 0:h.current;D&&!D.contains(k.target)&&T()};return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[u,h,T]),s.useEffect(()=>{var k;if(!u||_<0)return;const j=(k=b.current)==null?void 0:k.children[_];j==null||j.scrollIntoView({block:"nearest"})},[_,u]);const B=j=>{switch(j.key){case"Enter":case" ":case"ArrowDown":{if(j.preventDefault(),!u){m(!0);const k=e.findIndex(D=>D.value===x);g(k>=0?k:0)}break}case"ArrowUp":{j.preventDefault(),u||(m(!0),g(e.length-1));break}case"Escape":{T();break}}},R=j=>{var k;switch(j.key){case"ArrowDown":{j.preventDefault(),g(D=>{let E=D+1;for(;E<e.length&&e[E].disabled;)E++;return E<e.length?E:D});break}case"ArrowUp":{j.preventDefault(),g(D=>{let E=D-1;for(;E>=0&&e[E].disabled;)E--;return E>=0?E:D});break}case"Enter":case" ":{j.preventDefault(),_>=0&&M(e[_]);break}case"Escape":case"Tab":{T(),(k=N.current)==null||k.focus();break}case"Home":{j.preventDefault();const D=e.findIndex(E=>!E.disabled);D>=0&&g(D);break}case"End":{j.preventDefault();const D=[...e].reverse().findIndex(E=>!E.disabled);D>=0&&g(e.length-1-D);break}}};return t.jsxs("div",{ref:h,className:v("vyre-select",`vyre-select--${l}`,c),"data-open":u,...d,children:[t.jsxs("button",{ref:N,type:"button",className:"vyre-select__trigger","aria-haspopup":"listbox","aria-expanded":u,"aria-controls":w,"aria-disabled":i,disabled:i,onClick:()=>{i||m(j=>{if(!j){const k=e.findIndex(D=>D.value===x);g(k>=0?k:0)}return!j})},onKeyDown:B,children:[I?t.jsx("span",{className:"vyre-select__value",children:I.label}):t.jsx("span",{className:"vyre-select__placeholder",children:o}),t.jsx(Fr,{})]}),u&&t.jsxs("ul",{ref:b,id:w,role:"listbox",className:"vyre-select__dropdown","aria-label":"Options",tabIndex:-1,onKeyDown:R,children:[e.map((j,k)=>t.jsxs("li",{role:"option","aria-selected":j.value===x,"aria-disabled":j.disabled,"data-highlighted":k===_,className:"vyre-select__option",onMouseEnter:()=>!j.disabled&&g(k),onMouseDown:D=>{D.preventDefault(),M(j)},children:[j.label,j.value===x&&t.jsx(Wr,{})]},j.value)),A.length===0&&t.jsx("li",{className:"vyre-select__empty",role:"presentation",children:"No options available"})]})]})});We.displayName="VyreSelect";function Fr(){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 Wr(){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 He=s.createContext(null);function Pe(){const e=s.useContext(He);if(!e)throw new Error("Tab components must be used inside <Tabs>");return e}const Oe=s.forwardRef(({defaultValue:e="",value:r,onChange:a,className:n,children:o,...i},l)=>{const c=r!==void 0,[d,h]=s.useState(e),f=c?r:d,y=s.useId(),p=s.useCallback(x=>{c||h(x),a==null||a(x)},[c,a]);return t.jsx(He.Provider,{value:{value:f,onChange:p,baseId:y},children:t.jsx("div",{ref:l,className:v("vyre-tabs",n),...i,children:o})})});Oe.displayName="VyreTabs";const Ge=s.forwardRef(({className:e,children:r,"aria-label":a,...n},o)=>{const i=s.useRef(null),l=c=>{var y;const d=Array.from(((y=i.current)==null?void 0:y.querySelectorAll('[role="tab"]:not([disabled])'))??[]),h=d.findIndex(p=>p===document.activeElement);if(h<0)return;let f=h;if(c.key==="ArrowRight")f=(h+1)%d.length;else if(c.key==="ArrowLeft")f=(h-1+d.length)%d.length;else if(c.key==="Home")f=0;else if(c.key==="End")f=d.length-1;else return;c.preventDefault(),d[f].focus(),d[f].click()};return t.jsx("div",{ref:c=>{i.current=c,typeof o=="function"?o(c):o&&(o.current=c)},role:"tablist",className:v("vyre-tabs__list",e),"aria-label":a,onKeyDown:l,...n,children:r})});Ge.displayName="VyreTabList";const Ye=s.forwardRef(({value:e,disabled:r=!1,className:a,children:n,...o},i)=>{const{value:l,onChange:c,baseId:d}=Pe(),h=e===l;return t.jsx("button",{ref:i,role:"tab",type:"button",id:`${d}-tab-${e}`,"aria-controls":`${d}-panel-${e}`,"aria-selected":h,disabled:r,tabIndex:h?0:-1,className:v("vyre-tabs__tab",h&&"vyre-tabs__tab--active",a),"data-selected":h,onClick:()=>!r&&c(e),...o,children:n})});Ye.displayName="VyreTab";const Ke=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-tabs__panels",e),...a,children:r}));Ke.displayName="VyreTabPanels";const qe=s.forwardRef(({value:e,className:r,children:a,...n},o)=>{const{value:i,baseId:l}=Pe();return e===i?t.jsx("div",{ref:o,role:"tabpanel",id:`${l}-panel-${e}`,"aria-labelledby":`${l}-tab-${e}`,tabIndex:0,className:v("vyre-tabs__panel",r),...n,children:a}):null});qe.displayName="VyreTabPanel";const Hr=120,Ue=({content:e,placement:r="top",delay:a=300,children:n,className:o})=>{const[i,l]=s.useState("hidden"),c=s.useRef(null),d=s.useRef(null),h=s.useId(),f=s.useCallback(()=>{d.current&&(clearTimeout(d.current),d.current=null),c.current=setTimeout(()=>l("visible"),a)},[a]),y=s.useCallback(()=>{c.current&&(clearTimeout(c.current),c.current=null),l("leaving"),d.current=setTimeout(()=>l("hidden"),Hr)},[]),p=s.Children.only(n),x=s.cloneElement(p,{onMouseEnter:u=>{var m,_;f(),(_=(m=p.props).onMouseEnter)==null||_.call(m,u)},onMouseLeave:u=>{var m,_;y(),(_=(m=p.props).onMouseLeave)==null||_.call(m,u)},onFocus:u=>{var m,_;l("visible"),(_=(m=p.props).onFocus)==null||_.call(m,u)},onBlur:u=>{var m,_;y(),(_=(m=p.props).onBlur)==null||_.call(m,u)},"aria-describedby":i!=="hidden"?h:void 0});return t.jsxs("span",{className:v("vyre-tooltip-wrapper",o),children:[x,i!=="hidden"&&t.jsxs("span",{id:h,role:"tooltip",className:v("vyre-tooltip",`vyre-tooltip--${r}`,i==="leaving"&&"vyre-tooltip--leaving"),"data-placement":r,children:[e,t.jsx("span",{className:"vyre-tooltip__arrow","aria-hidden":"true"})]})]})};Ue.displayName="VyreTooltip";const ze=s.createContext(null);function Xe(){const e=s.useContext(ze);if(!e)throw new Error("AccordionItem must be used within Accordion");return e}const Ze=s.forwardRef(({type:e="single",defaultValue:r,value:a,onValueChange:n,className:o,children:i,...l},c)=>{const d=x=>x===void 0?[]:Array.isArray(x)?x:[x],[h,f]=s.useState(d(r)),y=a!==void 0?d(a):h,p=s.useCallback(x=>{let u;e==="single"?u=y.includes(x)?[]:[x]:u=y.includes(x)?y.filter(m=>m!==x):[...y,x],a===void 0&&f(u),n==null||n(e==="single"?u[0]??"":u)},[e,y,a,n]);return t.jsx(ze.Provider,{value:{type:e,value:y,toggle:p},children:t.jsx("div",{ref:c,className:["vyre-accordion",o].filter(Boolean).join(" "),...l,children:i})})});Ze.displayName="Accordion";const me=s.createContext(null),Qe=s.forwardRef(({value:e,className:r,children:a,...n},o)=>{const{value:i}=Xe(),l=i.includes(e);return t.jsx(me.Provider,{value:{itemValue:e,isOpen:l},children:t.jsx("div",{ref:o,"data-state":l?"open":"closed",className:["vyre-accordion__item",r].filter(Boolean).join(" "),...n,children:a})})});Qe.displayName="AccordionItem";const Je=s.forwardRef(({className:e,children:r,...a},n)=>{const{toggle:o}=Xe(),i=s.useContext(me);if(!i)throw new Error("AccordionTrigger must be used within AccordionItem");const{itemValue:l,isOpen:c}=i;return t.jsxs("button",{ref:n,type:"button","aria-expanded":c,"data-state":c?"open":"closed",className:["vyre-accordion__trigger",e].filter(Boolean).join(" "),onClick:()=>o(l),...a,children:[t.jsx("span",{className:"vyre-accordion__trigger-text",children:r}),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"})})]})});Je.displayName="AccordionTrigger";const et=s.forwardRef(({className:e,children:r,...a},n)=>{const o=s.useContext(me);if(!o)throw new Error("AccordionContent must be used within AccordionItem");const{isOpen:i}=o;return t.jsx("div",{ref:n,hidden:!i,"data-state":i?"open":"closed",className:["vyre-accordion__content",e].filter(Boolean).join(" "),...a,children:t.jsx("div",{className:"vyre-accordion__content-inner",children:r})})});et.displayName="AccordionContent";const ve=s.forwardRef(({src:e,alt:r="",fallback:a,size:n="md",status:o,className:i,...l},c)=>{var y;const[d,h]=s.useState(!1),f=e&&!d;return t.jsxs("span",{ref:c,"data-size":n,className:["vyre-avatar",i].filter(Boolean).join(" "),...l,children:[f?t.jsx("img",{src:e,alt:r,className:"vyre-avatar__img",onError:()=>h(!0)}):t.jsx("span",{className:"vyre-avatar__fallback","aria-label":r||a,children:a??((y=r==null?void 0:r.charAt(0))==null?void 0:y.toUpperCase())??"?"}),o&&t.jsx("span",{className:`vyre-avatar__status vyre-avatar__status--${o}`,"aria-label":o})]})});ve.displayName="Avatar";const tt=s.forwardRef(({checked:e,defaultChecked:r,indeterminate:a=!1,onCheckedChange:n,disabled:o,size:i="md",className:l,id:c,...d},h)=>{const f=s.useRef(null),y=h??f;return s.useEffect(()=>{y.current&&(y.current.indeterminate=a)},[a,y]),t.jsxs("span",{className:["vyre-checkbox",`vyre-checkbox--${i}`,l].filter(Boolean).join(" "),"data-disabled":o||void 0,"data-checked":e||void 0,"data-indeterminate":a||void 0,children:[t.jsx("input",{ref:y,type:"checkbox",id:c,checked:e,defaultChecked:r,disabled:o,className:"vyre-checkbox__input",onChange:p=>n==null?void 0:n(p.target.checked),...d}),t.jsx("span",{className:"vyre-checkbox__box","aria-hidden":"true",children:a?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"})})})]})});tt.displayName="Checkbox";const rt=s.createContext(null);let Pr=0;const at=s.forwardRef(({value:e,defaultValue:r,onChange:a,name:n,disabled:o=!1,size:i="md",orientation:l="vertical",options:c,className:d,children:h,...f},y)=>{const[p,x]=s.useState(r),u=e!==void 0,m=u?e:p,_=s.useMemo(()=>n??`vyre-radio-${++Pr}`,[n]),g=s.useCallback(b=>{u||x(b),a==null||a(b)},[u,a]),N={name:_,value:m,onChange:g,groupDisabled:o,size:i};return t.jsx(rt.Provider,{value:N,children:t.jsx("div",{ref:y,role:"radiogroup","aria-orientation":l,className:v("vyre-radio-group",`vyre-radio-group--${l}`,d),"data-disabled":o||void 0,...f,children:c?c.map(b=>t.jsx(fe,{value:b.value,label:b.label,description:b.description,disabled:b.disabled},b.value)):h})})});at.displayName="VyreRadioGroup";const fe=s.forwardRef(({value:e,label:r,description:a,disabled:n,className:o,id:i,...l},c)=>{const d=s.useContext(rt);if(!d)throw new Error("Radio must be used inside a <RadioGroup>.");const h=d.value===e,f=n||d.groupDisabled,y=i??`${d.name}-${e}`.replace(/\s+/g,"-");return t.jsxs("label",{className:v("vyre-radio",`vyre-radio--${d.size}`,f&&"vyre-radio--disabled",o),"data-checked":h||void 0,"data-disabled":f||void 0,htmlFor:y,children:[t.jsx("input",{ref:c,type:"radio",id:y,name:d.name,value:e,checked:h,disabled:f,className:"vyre-radio__input",onChange:()=>{var p;return(p=d.onChange)==null?void 0:p.call(d,e)},...l}),t.jsx("span",{className:"vyre-radio__control","aria-hidden":"true",children:t.jsx("span",{className:"vyre-radio__dot"})}),(r||a)&&t.jsxs("span",{className:"vyre-radio__content",children:[r&&t.jsx("span",{className:"vyre-radio__label",children:r}),a&&t.jsx("span",{className:"vyre-radio__description",children:a})]})]})});fe.displayName="VyreRadio";const Or=["bold","italic","underline","strike","h1","h2","h3","ul","ol","quote","code","link","clear"];function W(e,r){document.execCommand(e,!1,r)}const nt=s.forwardRef(({value:e,onChange:r,placeholder:a="Write something…",disabled:n=!1,readOnly:o=!1,toolbar:i=Or,minHeight:l="10rem",className:c,...d},h)=>{const f=s.useRef(null),y=!n&&!o;s.useEffect(()=>{const m=f.current;m&&m.innerHTML!==e&&(m.innerHTML=e)},[e]);const p=s.useCallback(()=>{f.current&&r(f.current.innerHTML)},[r]),x=s.useCallback(m=>{var _;y&&((_=f.current)==null||_.focus(),m(),p())},[y,p]),u={bold:{label:"Bold",icon:t.jsx("b",{children:"B"}),run:()=>W("bold")},italic:{label:"Italic",icon:t.jsx("i",{children:"I"}),run:()=>W("italic")},underline:{label:"Underline",icon:t.jsx("u",{children:"U"}),run:()=>W("underline")},strike:{label:"Strikethrough",icon:t.jsx("s",{children:"S"}),run:()=>W("strikeThrough")},h1:{label:"Heading 1",icon:t.jsx(t.Fragment,{children:"H1"}),run:()=>W("formatBlock","<h1>")},h2:{label:"Heading 2",icon:t.jsx(t.Fragment,{children:"H2"}),run:()=>W("formatBlock","<h2>")},h3:{label:"Heading 3",icon:t.jsx(t.Fragment,{children:"H3"}),run:()=>W("formatBlock","<h3>")},ul:{label:"Bullet list",icon:t.jsx(t.Fragment,{children:"•≡"}),run:()=>W("insertUnorderedList")},ol:{label:"Numbered list",icon:t.jsx(t.Fragment,{children:"1.≡"}),run:()=>W("insertOrderedList")},quote:{label:"Quote",icon:t.jsx(t.Fragment,{children:"“”"}),run:()=>W("formatBlock","<blockquote>")},code:{label:"Code block",icon:t.jsx(t.Fragment,{children:"</>"}),run:()=>W("formatBlock","<pre>")},link:{label:"Link",icon:t.jsx(t.Fragment,{children:"🔗"}),run:()=>{const m=window.prompt("Link URL");m&&W("createLink",m)}},clear:{label:"Clear formatting",icon:t.jsx(t.Fragment,{children:"⌫"}),run:()=>W("removeFormat")}};return t.jsxs("div",{ref:h,className:v("vyre-rte",n&&"vyre-rte--disabled",o&&"vyre-rte--readonly",c),...d,children:[!o&&t.jsx("div",{className:"vyre-rte__toolbar",role:"toolbar","aria-label":"Formatting",children:i.map(m=>{const _=u[m];return _?t.jsx("button",{type:"button",className:"vyre-rte__tool",title:_.label,"aria-label":_.label,disabled:!y,onMouseDown:g=>g.preventDefault(),onClick:()=>x(_.run),children:_.icon},m):null})}),t.jsx("div",{ref:f,className:"vyre-rte__content",contentEditable:y,suppressContentEditableWarning:!0,role:"textbox","aria-multiline":"true","aria-label":a,"data-placeholder":a,style:{minHeight:l},onInput:p,onBlur:p})]})});nt.displayName="VyreRichTextEditor";const st=s.forwardRef(({checked:e,defaultChecked:r=!1,onCheckedChange:a,disabled:n,size:o="md",className:i,...l},c)=>{const[d,h]=s.useState(r),f=e!==void 0?e:d,y=()=>{if(n)return;const p=!f;e===void 0&&h(p),a==null||a(p)};return t.jsx("button",{ref:c,type:"button",role:"switch","aria-checked":f,disabled:n,"data-checked":f||void 0,"data-size":o,className:["vyre-switch",i].filter(Boolean).join(" "),onClick:y,...l,children:t.jsx("span",{className:"vyre-switch__thumb"})})});st.displayName="Switch";const ot=s.forwardRef(({value:e,defaultValue:r=0,min:a=0,max:n=100,step:o=1,onValueChange:i,disabled:l,size:c="md",className:d,style:h,...f},y)=>{const[p,x]=s.useState(r),u=e!==void 0?e:p,m=(u-a)/(n-a)*100;return t.jsxs("div",{className:["vyre-slider",`vyre-slider--${c}`,d].filter(Boolean).join(" "),"data-disabled":l||void 0,style:{"--vyre-slider-pct":`${m}%`,...h},children:[t.jsx("input",{ref:y,type:"range",min:a,max:n,step:o,value:u,disabled:l,className:"vyre-slider__input",onChange:_=>{const g=Number(_.target.value);e===void 0&&x(g),i==null||i(g)},...f}),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}%`}})]})]})});ot.displayName="Slider";const it=s.forwardRef(({value:e,max:r=100,indeterminate:a=!1,size:n="md",variant:o="default",className:i,...l},c)=>{const d=a?void 0:Math.min(100,Math.max(0,(e??0)/r*100));return t.jsx("div",{ref:c,role:"progressbar","aria-valuemin":0,"aria-valuemax":r,"aria-valuenow":a?void 0:e??0,"data-size":n,"data-variant":o,"data-indeterminate":a||void 0,className:["vyre-progress",i].filter(Boolean).join(" "),...l,children:t.jsx("div",{className:"vyre-progress__bar",style:d!==void 0?{width:`${d}%`}:void 0})})});it.displayName="Progress";const lt=s.forwardRef(({orientation:e="horizontal",decorative:r=!0,className:a,...n},o)=>t.jsx("div",{ref:o,role:r?"none":"separator","aria-orientation":r?void 0:e,"data-orientation":e,className:["vyre-separator",a].filter(Boolean).join(" "),...n}));lt.displayName="Separator";const ct=s.forwardRef(({required:e,disabled:r,className:a,children:n,...o},i)=>t.jsxs("label",{ref:i,"data-required":e||void 0,"data-disabled":r||void 0,className:["vyre-label",a].filter(Boolean).join(" "),...o,children:[n,e&&t.jsx("span",{className:"vyre-label__required","aria-hidden":"true",children:"*"})]}));ct.displayName="Label";const ye=s.forwardRef(({variant:e="rect",width:r,height:a,className:n,style:o,...i},l)=>t.jsx("div",{ref:l,"aria-hidden":"true","data-variant":e,className:["vyre-skeleton",n].filter(Boolean).join(" "),style:{width:typeof r=="number"?`${r}px`:r,height:typeof a=="number"?`${a}px`:a,...o},...i}));ye.displayName="Skeleton";const re=8,Gr=120;function Yr(e){const[r,a]=e.split("-");return{side:r,align:a??"center"}}function Kr(e,r,a,n,o,i){const l=e.width,c=e.height,d=r.width,h=r.height,f=e.left+o,y=e.top+i;let p=0,x=0;switch(a){case"top":p=y-h-re;break;case"bottom":p=y+c+re;break;case"left":x=f-d-re;break;case"right":x=f+l+re;break}if(a==="top"||a==="bottom")switch(n){case"start":x=f;break;case"center":x=f+l/2-d/2;break;case"end":x=f+l-d;break}else switch(n){case"start":p=y;break;case"center":p=y+c/2-h/2;break;case"end":p=y+c-h;break}return{top:p,left:x}}const dt=({trigger:e,children:r,open:a,onOpenChange:n,placement:o="bottom",closeOnOutside:i=!0,className:l})=>{const c=a!==void 0,[d,h]=s.useState(!1),[f,y]=s.useState(!1),[p,x]=s.useState(!1),[u,m]=s.useState({top:0,left:0}),_=c?a:d,g=s.useRef(null),N=s.useRef(null),b=s.useRef(null),L=s.useId(),{side:w,align:I}=Yr(o),A=s.useCallback(R=>{c||h(R),n==null||n(R)},[c,n]),T=s.useCallback(()=>A(!_),[_,A]),M=s.useCallback(()=>{y(!0),b.current=setTimeout(()=>{y(!1),x(!1),A(!1)},Gr)},[A]);s.useEffect(()=>{_?(b.current&&(clearTimeout(b.current),b.current=null),y(!1),x(!0)):p&&!f&&M()},[_]),s.useEffect(()=>{if(!p||!g.current||!N.current)return;const R=g.current.getBoundingClientRect(),j=N.current.getBoundingClientRect(),k=Kr(R,j,w,I,window.scrollX,window.scrollY);m(k)},[p,w,I]),s.useEffect(()=>{if(!p||!i)return;const R=j=>{N.current&&!N.current.contains(j.target)&&g.current&&!g.current.contains(j.target)&&M()};return document.addEventListener("mousedown",R),()=>document.removeEventListener("mousedown",R)},[p,i,M]),s.useEffect(()=>{if(!p)return;const R=j=>{j.key==="Escape"&&M()};return document.addEventListener("keydown",R),()=>document.removeEventListener("keydown",R)},[p,M]);const B=s.cloneElement(e,{ref:g,onClick:R=>{var j,k;T(),(k=(j=e.props).onClick)==null||k.call(j,R)},"aria-expanded":_,"aria-controls":L,"aria-haspopup":"dialog"});return t.jsxs(t.Fragment,{children:[B,p&&P.createPortal(t.jsx("div",{ref:N,id:L,role:"dialog","aria-modal":"false",className:v("vyre-popover",`vyre-popover--${w}`,f&&"vyre-popover--leaving",l),style:{top:u.top,left:u.left},children:r}),document.body)]})};dt.displayName="VyrePopover";const ae=s.createContext(null),ut=s.createContext(null),qr=120,mt=({trigger:e,children:r,placement:a="bottom-start",className:n})=>{const[o,i]=s.useState(!1),[l,c]=s.useState(!1),[d,h]=s.useState(!1),[f,y]=s.useState({top:0,left:0}),[p,x]=s.useState(-1),u=s.useRef(null),m=s.useRef(null),_=s.useRef(null),g=s.useId(),N=s.useCallback(()=>{var M;return Array.from(((M=m.current)==null?void 0:M.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])"))??[])},[]),b=s.useCallback(()=>{c(!0),_.current=setTimeout(()=>{var M;c(!1),h(!1),i(!1),x(-1),(M=u.current)==null||M.focus({preventScroll:!0})},qr)},[]),L=s.useCallback(()=>{_.current&&(clearTimeout(_.current),_.current=null),c(!1),i(!0),h(!0)},[]),w=s.useCallback(()=>{o?b():L()},[o,L,b]);s.useEffect(()=>{if(!d||!u.current)return;const M=u.current.getBoundingClientRect(),B=4,R=window.scrollX,j=window.scrollY;let k=0,D=0;a.startsWith("bottom")?(k=M.bottom+j+B,D=a==="bottom-start"?M.left+R:M.right+R):(k=M.top+j-B,D=a==="top-start"?M.left+R:M.right+R),y({top:k,left:D}),requestAnimationFrame(()=>{var V;(V=N()[0])==null||V.focus({preventScroll:!0}),x(0)})},[d,a,N]),s.useEffect(()=>{if(!d)return;const M=R=>{m.current&&!m.current.contains(R.target)&&u.current&&!u.current.contains(R.target)&&b()},B=R=>{var j,k,D;if(R.key==="Escape"){b();return}if(R.key==="ArrowDown"||R.key==="ArrowUp"){R.preventDefault();const E=N();if(!E.length)return;const V=R.key==="ArrowDown"?1:-1,X=(p+V+E.length)%E.length;(j=E[X])==null||j.focus({preventScroll:!0}),x(X)}if(R.key==="Home"&&((k=N()[0])==null||k.focus({preventScroll:!0}),x(0)),R.key==="End"){const E=N();(D=E[E.length-1])==null||D.focus({preventScroll:!0}),x(E.length-1)}};return document.addEventListener("mousedown",M),document.addEventListener("keydown",B),()=>{document.removeEventListener("mousedown",M),document.removeEventListener("keydown",B)}},[d,p,b,N]);const I=s.cloneElement(e,{ref:u,onClick:M=>{var B,R;w(),(R=(B=e.props).onClick)==null||R.call(B,M)},"aria-expanded":o,"aria-haspopup":"menu","aria-controls":g}),A=a.endsWith("-end"),T=a.startsWith("top");return t.jsxs(ae.Provider,{value:{close:b},children:[I,d&&P.createPortal(t.jsx("div",{ref:m,id:g,role:"menu","aria-orientation":"vertical",className:v("vyre-dropdown",A&&"vyre-dropdown--end",T&&"vyre-dropdown--top",l&&"vyre-dropdown--leaving",n),style:{top:f.top,left:f.left,transform:A?"translateX(-100%)":void 0},children:r}),document.body)]})};mt.displayName="VyreDropdownMenu";const vt=({children:e,className:r})=>t.jsx("div",{className:v("vyre-dropdown__label",r),children:e});vt.displayName="VyreDropdownLabel";const ft=({children:e,onSelect:r,disabled:a=!1,variant:n="default",icon:o,shortcut:i,className:l})=>{const c=s.useContext(ae);return t.jsxs("button",{role:"menuitem",className:v("vyre-dropdown__item",n==="danger"&&"vyre-dropdown__item--danger",l),"aria-disabled":a||void 0,disabled:a,tabIndex:-1,onClick:()=>{a||(r==null||r(),c==null||c.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})]})};ft.displayName="VyreDropdownItem";const yt=({children:e,checked:r,onCheckedChange:a,disabled:n=!1,shortcut:o,className:i})=>{const l=s.useContext(ae);return t.jsxs("button",{role:"menuitemcheckbox","aria-checked":r,"aria-disabled":n||void 0,disabled:n,tabIndex:-1,className:v("vyre-dropdown__item vyre-dropdown__item--checkbox",i),onClick:()=>{n||(a(!r),l==null||l.close())},children:[t.jsx("span",{className:"vyre-dropdown__item-indicator","aria-hidden":"true",children:r&&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})]})};yt.displayName="VyreDropdownCheckboxItem";const ht=({value:e,onValueChange:r,children:a})=>t.jsx(ut.Provider,{value:{value:e,onValueChange:r},children:t.jsx("div",{role:"group",children:a})});ht.displayName="VyreDropdownRadioGroup";const bt=({children:e,value:r,disabled:a=!1,className:n})=>{const o=s.useContext(ae),i=s.useContext(ut),l=(i==null?void 0:i.value)===r;return t.jsxs("button",{role:"menuitemradio","aria-checked":l,"aria-disabled":a||void 0,disabled:a,tabIndex:-1,className:v("vyre-dropdown__item vyre-dropdown__item--radio",n),onClick:()=>{a||(i==null||i.onValueChange(r),o==null||o.close())},children:[t.jsx("span",{className:"vyre-dropdown__item-indicator","aria-hidden":"true",children:l&&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})]})};bt.displayName="VyreDropdownRadioItem";const pt=({trigger:e,children:r,icon:a,placement:n="right",disabled:o=!1,className:i})=>{const[l,c]=s.useState(!1),[d,h]=s.useState({top:0,left:0}),f=s.useRef(null),y=s.useRef(null),p=s.useCallback(()=>{if(!f.current)return;const m=f.current.getBoundingClientRect(),_=window.scrollX,g=window.scrollY,N=2;h({top:m.top+g,left:n==="right"?m.right+_+N:m.left+_-N}),c(!0)},[n]),x=s.useCallback(()=>c(!1),[]),u=m=>{var g;const _=m.relatedTarget;(g=y.current)!=null&&g.contains(_)||x()};return t.jsxs(t.Fragment,{children:[t.jsxs("button",{ref:f,role:"menuitem","aria-haspopup":"menu","aria-expanded":l,"aria-disabled":o||void 0,disabled:o,tabIndex:-1,className:v("vyre-dropdown__item vyre-dropdown__item--sub",i),onMouseEnter:p,onMouseLeave:u,onFocus:p,children:[a&&t.jsx("span",{className:"vyre-dropdown__item-icon","aria-hidden":"true",children:a}),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:n==="right"?"M4 2l4 4-4 4":"M8 2L4 6l4 4",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),l&&P.createPortal(t.jsx("div",{ref:y,role:"menu",className:v("vyre-dropdown vyre-dropdown--sub",n==="left"&&"vyre-dropdown--sub-left"),style:{position:"absolute",top:d.top,left:n==="right"?d.left:void 0,right:n==="left"?`calc(100vw - ${d.left}px)`:void 0,transform:n==="left"?"translateX(-100%)":void 0},onMouseLeave:m=>{var g;const _=m.relatedTarget;(g=f.current)!=null&&g.contains(_)||x()},children:r}),document.body)]})};pt.displayName="VyreDropdownSub";const xt=({className:e})=>t.jsx("div",{role:"separator",className:v("vyre-dropdown__separator",e)});xt.displayName="VyreDropdownSeparator";const Ur=()=>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"})]}),zr=()=>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"})]}),Xr=()=>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"})]}),Zr=()=>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"})]}),_t={info:Ur,success:zr,warning:Xr,danger:Zr},gt=({variant:e="info",title:r,icon:a,onClose:n,children:o,className:i})=>{const l=_t[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:a??t.jsx(l,{})}),t.jsxs("div",{className:"vyre-alert__body",children:[r&&t.jsx("p",{className:"vyre-alert__title",children:r}),o&&t.jsx("div",{className:"vyre-alert__description",children:o})]}),n&&t.jsx("button",{type:"button",className:"vyre-alert__close","aria-label":"Dismiss",onClick:n,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"})})})]})};gt.displayName="VyreAlert";const Qr=["button:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(","),jt=({open:e,onOpenChange:r,title:a,description:n,variant:o="danger",confirmLabel:i="Confirm",cancelLabel:l="Cancel",onConfirm:c,onCancel:d,className:h})=>{const f=s.useRef(null),y=s.useRef(null),p=s.useRef(null),x=s.useCallback(()=>{d==null||d(),r(!1)},[d,r]),u=s.useCallback(()=>{c==null||c(),r(!1)},[c,r]),m=s.useCallback(g=>{if(g.key!=="Tab")return;const N=f.current;if(!N)return;const b=Array.from(N.querySelectorAll(Qr));if(!b.length)return;const L=b[0],w=b[b.length-1];g.shiftKey&&document.activeElement===L?(g.preventDefault(),w.focus()):!g.shiftKey&&document.activeElement===w&&(g.preventDefault(),L.focus())},[]);if(s.useEffect(()=>{if(!e)return;document.addEventListener("keydown",m);const g=document.body.style.overflow;document.body.style.overflow="hidden";const N=b=>{b.key==="Escape"&&x()};return document.addEventListener("keydown",N),setTimeout(()=>{var b;return(b=p.current)==null?void 0:b.focus()},0),()=>{document.removeEventListener("keydown",m),document.removeEventListener("keydown",N),document.body.style.overflow=g}},[e,m,x]),!e)return null;const _=_t[o];return P.createPortal(t.jsx("div",{ref:y,className:"vyre-alert-dialog-backdrop",onClick:g=>{g.target===y.current&&x()},role:"presentation",children:t.jsxs("div",{ref:f,role:"alertdialog","aria-modal":"true","aria-labelledby":"vyre-ad-title","aria-describedby":n?"vyre-ad-desc":void 0,className:v("vyre-alert-dialog",`vyre-alert-dialog--${o}`,h),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:a}),n&&t.jsx("p",{id:"vyre-ad-desc",className:"vyre-alert-dialog__description",children:n})]}),t.jsxs("div",{className:"vyre-alert-dialog__footer",children:[t.jsx("button",{ref:p,type:"button",className:"vyre-btn vyre-btn--ghost vyre-btn--sm",onClick:x,children:l}),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)};jt.displayName="VyreAlertDialog";const Jr=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(","),wt=s.forwardRef(({open:e,onClose:r,side:a="right",size:n="md",closeOnBackdrop:o=!0,closeOnEsc:i=!0,className:l,children:c,"aria-label":d,"aria-labelledby":h,...f},y)=>{const p=s.useRef(null),x=s.useRef(null),u=s.useCallback(m=>{if(m.key!=="Tab")return;const _=p.current;if(!_)return;const g=Array.from(_.querySelectorAll(Jr));if(!g.length)return;const N=g[0],b=g[g.length-1];m.shiftKey&&document.activeElement===N?(m.preventDefault(),b.focus()):!m.shiftKey&&document.activeElement===b&&(m.preventDefault(),N.focus())},[]);return s.useEffect(()=>{if(!e)return;if(document.addEventListener("keydown",u),i){const _=N=>{N.key==="Escape"&&r()};document.addEventListener("keydown",_);const g=document.body.style.overflow;return document.body.style.overflow="hidden",setTimeout(()=>{var N;return(N=p.current)==null?void 0:N.focus()},0),()=>{document.removeEventListener("keydown",u),document.removeEventListener("keydown",_),document.body.style.overflow=g}}const m=document.body.style.overflow;return document.body.style.overflow="hidden",setTimeout(()=>{var _;return(_=p.current)==null?void 0:_.focus()},0),()=>{document.removeEventListener("keydown",u),document.body.style.overflow=m}},[e,u,i,r]),e?P.createPortal(t.jsx("div",{ref:x,className:"vyre-sheet-backdrop",onClick:m=>{o&&m.target===x.current&&r()},role:"presentation",children:t.jsx("div",{ref:m=>{p.current=m,typeof y=="function"?y(m):y&&(y.current=m)},role:"dialog","aria-modal":"true","aria-label":d,"aria-labelledby":h,tabIndex:-1,className:v("vyre-sheet",`vyre-sheet--${a}`,`vyre-sheet--${n}`,l),...f,children:c})}),document.body):null});wt.displayName="VyreSheet";const kt=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-sheet__header",e),...a,children:r}));kt.displayName="VyreSheetHeader";const Nt=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-sheet__body",e),...a,children:r}));Nt.displayName="VyreSheetBody";const Ct=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-sheet__footer",e),...a,children:r}));Ct.displayName="VyreSheetFooter";const Rt=({children:e,separator:r="/",className:a})=>{const n=s.Children.toArray(e).filter(Boolean);return t.jsx("nav",{"aria-label":"Breadcrumb",className:v("vyre-breadcrumb",a),children:t.jsx("ol",{className:"vyre-breadcrumb__list",children:n.map((o,i)=>t.jsxs("li",{className:"vyre-breadcrumb__item",children:[o,i<n.length-1&&t.jsx("span",{className:"vyre-breadcrumb__separator","aria-hidden":"true",children:r})]},i))})})};Rt.displayName="VyreBreadcrumb";const Lt=({children:e,href:r,current:a=!1,className:n})=>a||!r?t.jsx("span",{className:v("vyre-breadcrumb__link vyre-breadcrumb__link--current",n),"aria-current":a?"page":void 0,children:e}):t.jsx("a",{href:r,className:v("vyre-breadcrumb__link",n),children:e});Lt.displayName="VyreBreadcrumbItem";const Dt=({children:e,href:r,className:a})=>t.jsx("a",{href:r,className:v("vyre-breadcrumb__link",a),children:e});Dt.displayName="VyreBreadcrumbLink";const St=({children:e="/",className:r})=>t.jsx("span",{className:v("vyre-breadcrumb__separator",r),"aria-hidden":"true",children:e});St.displayName="VyreBreadcrumbSeparator";function xe(e,r){return Array.from({length:r-e+1},(a,n)=>e+n)}function ea(e,r,a){const n=a*2+5;if(r<=n)return xe(1,r);const o=Math.max(e-a,2),i=Math.min(e+a,r-1),l=o>2,c=i<r-1,d=[1];return l&&d.push("..."),d.push(...xe(o,i)),c&&d.push("..."),d.push(r),d}const ta=()=>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"})}),ra=()=>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"})}),aa=()=>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"})}),na=()=>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"})}),Mt=({page:e,totalPages:r,onPageChange:a,siblings:n=1,showEdges:o=!0,showInfo:i=!1,totalItems:l,pageSize:c,className:d})=>{const h=ea(e,r,n),f=e>1,y=e<r,p=s.useMemo(()=>{if(!i)return null;if(l!=null&&c!=null){const u=(e-1)*c+1,m=Math.min(e*c,l);return`Showing ${u}–${m} of ${l}`}return`Page ${e} of ${r}`},[i,e,r,l,c]),x=t.jsxs(t.Fragment,{children:[o&&t.jsx("button",{className:"vyre-pagination__nav",onClick:()=>a(1),disabled:!f,"aria-label":"First page",children:t.jsx(aa,{})}),t.jsx("button",{className:"vyre-pagination__nav",onClick:()=>a(e-1),disabled:!f,"aria-label":"Previous page",children:t.jsx(ta,{})}),t.jsx("ol",{className:"vyre-pagination__list",children:h.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:()=>a(u),"aria-label":`Page ${u}`,"aria-current":u===e?"page":void 0,children:u})},u))}),t.jsx("button",{className:"vyre-pagination__nav",onClick:()=>a(e+1),disabled:!y,"aria-label":"Next page",children:t.jsx(ra,{})}),o&&t.jsx("button",{className:"vyre-pagination__nav",onClick:()=>a(r),disabled:!y,"aria-label":"Last page",children:t.jsx(na,{})})]});return i?t.jsxs("div",{className:v("vyre-pagination-row",d),children:[t.jsx("span",{className:"vyre-pagination__info",children:p}),t.jsx("nav",{"aria-label":"Pagination",className:"vyre-pagination",children:x})]}):t.jsx("nav",{"aria-label":"Pagination",className:v("vyre-pagination",d),children:x})};Mt.displayName="VyrePagination";const It=({children:e,striped:r=!1,bordered:a=!1,compact:n=!1,hoverable:o=!0,className:i})=>t.jsx("div",{className:"vyre-table-wrapper",children:t.jsx("table",{className:v("vyre-table",r&&"vyre-table--striped",a&&"vyre-table--bordered",n&&"vyre-table--compact",o&&"vyre-table--hoverable",i),children:e})});It.displayName="VyreTable";const Tt=s.forwardRef(({className:e,...r},a)=>t.jsx("thead",{ref:a,className:v("vyre-table__head",e),...r}));Tt.displayName="VyreTableHead";const Et=s.forwardRef(({className:e,...r},a)=>t.jsx("tbody",{ref:a,className:v("vyre-table__body",e),...r}));Et.displayName="VyreTableBody";const At=s.forwardRef(({className:e,selected:r,...a},n)=>t.jsx("tr",{ref:n,className:v("vyre-table__row",r&&"vyre-table__row--selected",e),"aria-selected":r,...a}));At.displayName="VyreTableRow";const sa=({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})]})}),Bt=s.forwardRef(({className:e,sortable:r,sortDir:a=null,onSort:n,align:o="left",children:i,...l},c)=>r?t.jsx("th",{ref:c,className:v("vyre-table__th vyre-table__th--sortable",`vyre-table__th--${o}`,a&&`vyre-table__th--sort-${a}`,e),"aria-sort":a==="asc"?"ascending":a==="desc"?"descending":"none",...l,children:t.jsxs("button",{className:"vyre-table__sort-btn",onClick:n,type:"button",children:[i,t.jsx(sa,{dir:a})]})}):t.jsx("th",{ref:c,className:v("vyre-table__th",`vyre-table__th--${o}`,e),...l,children:i}));Bt.displayName="VyreTableHeader";const Vt=s.forwardRef(({className:e,align:r="left",...a},n)=>t.jsx("td",{ref:n,className:v("vyre-table__td",`vyre-table__td--${r}`,e),...a}));Vt.displayName="VyreTableCell";const $t=s.forwardRef(({className:e,...r},a)=>t.jsx("caption",{ref:a,className:v("vyre-table__caption",e),...r}));$t.displayName="VyreTableCaption";const Ft=s.createContext(null),ne=()=>{const e=s.useContext(Ft);if(!e)throw new Error("Command components must be used inside <Command>");return e};function oe(e){return e.toLowerCase().replace(/\s+/g," ").trim()}function oa(e,r,a=[]){if(!e)return!0;const n=oe(e);return oe(r).includes(n)||a.some(o=>oe(o).includes(n))}let ia=0;function la(){return`cmd-${++ia}`}const he=s.forwardRef(({value:e,onValueChange:r,className:a,children:n},o)=>{const[i,l]=s.useState(""),[c,d]=s.useState(0),[h,f]=s.useState(0),y=e!==void 0?e:i,p=s.useCallback(b=>{l(b),r==null||r(b),d(0)},[r]),x=s.useRef(new Map),u=s.useRef(new Map),m=s.useCallback((b,L,w)=>{x.current.set(b,{el:L,disabled:w})},[]),_=s.useCallback(b=>{x.current.delete(b),u.current.delete(b)},[]),g=s.useCallback(b=>{var L;(L=u.current.get(b))==null||L()},[]),N=s.useMemo(()=>({search:y,setSearch:p,activeIndex:c,setActiveIndex:d,items:x,registerItem:m,unregisterItem:_,selectItem:g,onSelectRef:u,visibleCount:h,setVisibleCount:f}),[y,p,c,m,_,g,h]);return t.jsx(Ft.Provider,{value:N,children:t.jsx("div",{ref:o,className:v("vyre-command",a),role:"combobox","aria-expanded":"true","aria-haspopup":"listbox",children:n})})});he.displayName="VyreCommand";const Wt=s.forwardRef(({placeholder:e="Search...",className:r},a)=>{const{search:n,setSearch:o}=ne();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:a,className:v("vyre-command__input",r),type:"text",placeholder:e,value:n,onChange:i=>o(i.target.value),autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list","aria-controls":"vyre-command-list"}),n&&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"})})})]})});Wt.displayName="VyreCommandInput";const Ht=s.forwardRef(({className:e,children:r},a)=>{const{activeIndex:n,setActiveIndex:o,items:i,selectItem:l}=ne(),c=s.useCallback(d=>{var f,y;const h=Array.from((i.current??new Map).entries()).filter(([,p])=>!p.disabled&&p.el.closest("[data-cmd-item]")!==null&&!p.el.hasAttribute("data-cmd-hidden"));if(d.key==="ArrowDown")d.preventDefault(),o(Math.min(n+1,h.length-1)),(f=h[Math.min(n+1,h.length-1)])==null||f[1].el.scrollIntoView({block:"nearest"});else if(d.key==="ArrowUp")d.preventDefault(),o(Math.max(n-1,0)),(y=h[Math.max(n-1,0)])==null||y[1].el.scrollIntoView({block:"nearest"});else if(d.key==="Enter"){d.preventDefault();const[p]=h[n]??[];p&&l(p)}},[n,o,i,l]);return t.jsx("div",{ref:a,id:"vyre-command-list",role:"listbox",className:v("vyre-command__list",e),onKeyDown:c,children:r})});Ht.displayName="VyreCommandList";const Pt=({className:e,children:r})=>{const{search:a,visibleCount:n}=ne();return!a||n>0?null:t.jsx("div",{className:v("vyre-command__empty",e),role:"presentation",children:r??"No results found."})};Pt.displayName="VyreCommandEmpty";const Ot=({heading:e,className:r,children:a})=>t.jsxs("div",{className:v("vyre-command__group",r),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:a})]});Ot.displayName="VyreCommandGroup";const Gt=({onSelect:e,disabled:r=!1,keywords:a,className:n,children:o,icon:i,shortcut:l})=>{const{search:c,setActiveIndex:d,registerItem:h,unregisterItem:f,onSelectRef:y,setVisibleCount:p}=ne(),x=s.useMemo(()=>la(),[]),u=s.useRef(null),_=oa(c,typeof o=="string"?o:"",a);return s.useEffect(()=>(p(g=>g+(_?1:0)),()=>{p(g=>g-(_?1:0))}),[_,p]),s.useEffect(()=>{const g=u.current;if(!(!g||!_))return h(x,g,r),()=>f(x)},[x,r,_,h,f]),s.useEffect(()=>{var g;return e&&((g=y.current)==null||g.set(x,e)),()=>{var N;(N=y.current)==null||N.delete(x)}},[x,e,y]),_?t.jsxs("div",{ref:u,"data-cmd-item":!0,role:"option","aria-disabled":r||void 0,className:v("vyre-command__item",r&&"vyre-command__item--disabled",n),onClick:()=>{r||e==null||e()},onMouseEnter:()=>{!r&&u.current&&d(-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}),l&&t.jsx("kbd",{className:"vyre-command__item-shortcut",children:l})]}):null};Gt.displayName="VyreCommandItem";const Yt=({className:e})=>t.jsx("div",{className:v("vyre-command__separator",e),role:"separator","aria-hidden":"true"});Yt.displayName="VyreCommandSeparator";const Kt=({open:e,onOpenChange:r,value:a,onValueChange:n,className:o,children:i})=>{const l=s.useRef(null);return s.useEffect(()=>{var h;if(!e)return;const c=document.activeElement,d=(h=l.current)==null?void 0:h.querySelector(".vyre-command__input");return d==null||d.focus(),()=>{c==null||c.focus({preventScroll:!0})}},[e]),s.useEffect(()=>{if(!e)return;const c=d=>{d.key==="Escape"&&r(!1)};return window.addEventListener("keydown",c),()=>window.removeEventListener("keydown",c)},[e,r]),e?P.createPortal(t.jsx("div",{className:"vyre-command-backdrop",ref:l,onClick:c=>{c.target===c.currentTarget&&r(!1)},role:"dialog","aria-modal":"true","aria-label":"Command palette",children:t.jsx(he,{value:a,onValueChange:n,className:v("vyre-command--dialog",o),children:i})}),document.body):null};Kt.displayName="VyreCommandDialog";const qt=s.forwardRef(({orientation:e="horizontal",attached:r=!1,size:a,className:n,children:o,...i},l)=>t.jsx("div",{ref:l,role:"group",className:v("vyre-btn-group",e==="vertical"&&"vyre-btn-group--vertical",r&&"vyre-btn-group--attached",n),"data-orientation":e,"data-size":a,...i,children:o}));qt.displayName="VyreButtonGroup";const be=s.forwardRef(({variant:e="default",size:r="md",onRemove:a,onClick:n,disabled:o=!1,className:i,children:l,...c},d)=>{const h=!!n&&!o;return t.jsxs("span",{ref:d,className:v("vyre-tag",`vyre-tag--${e}`,`vyre-tag--${r}`,h&&"vyre-tag--clickable",o&&"vyre-tag--disabled",i),"data-variant":e,"data-size":r,role:h?"button":void 0,tabIndex:h?0:void 0,"aria-disabled":o||void 0,onClick:h?n:void 0,onKeyDown:h?f=>{(f.key==="Enter"||f.key===" ")&&(f.preventDefault(),n==null||n())}:void 0,...c,children:[t.jsx("span",{className:"vyre-tag__label",children:l}),a&&t.jsx("button",{type:"button",className:"vyre-tag__remove","aria-label":"Remove",disabled:o,onClick:f=>{f.stopPropagation(),a()},children:t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M9 3L3 9M3 3L9 9",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]})});be.displayName="VyreTag";const Ut=s.forwardRef(({value:e,onChange:r,placeholder:a="Add tag…",disabled:n=!1,max:o,size:i="md",className:l,style:c,"data-testid":d},h)=>{const[f,y]=s.useState(""),p=s.useRef(null),x=o!==void 0&&e.length>=o,u=n||x;function m(b){const L=b.trim();if(!L||e.includes(L)||x){y("");return}r([...e,L]),y("")}function _(b){n||r(e.filter((L,w)=>w!==b))}function g(b){if(b.key==="Enter"||b.key===","){b.preventDefault(),m(f);return}b.key==="Backspace"&&f===""&&e.length>0&&_(e.length-1)}function N(b){const L=b.target.value;if(L.includes(",")){const w=L.split(",");w.slice(0,-1).forEach(A=>m(A)),y(w[w.length-1])}else y(L)}return t.jsxs("div",{ref:h,className:v("vyre-tags-input",`vyre-tags-input--${i}`,n&&"vyre-tags-input--disabled",l),"data-testid":d,style:c,onClick:()=>{var b;return(b=p.current)==null?void 0:b.focus()},children:[e.map((b,L)=>t.jsx(be,{size:i,disabled:n,onRemove:n?void 0:()=>_(L),children:b},`${b}-${L}`)),t.jsx("input",{ref:p,type:"text",className:"vyre-tags-input__field",value:f,onChange:N,onKeyDown:g,placeholder:x?"":a,disabled:u,"aria-label":"Add tag"})]})});Ut.displayName="VyreTagsInput";const zt=s.forwardRef(({options:e,value:r,onChange:a,placeholder:n="Search…",disabled:o=!1,size:i="md",emptyText:l="No results",className:c,...d},h)=>{const[f,y]=s.useState(!1),[p,x]=s.useState(""),[u,m]=s.useState(-1),_=s.useRef(null),g=s.useRef(null),N=s.useRef(null),L=`${s.useId()}-listbox`,w=e.find(k=>k.value===r)??null,I=e.filter(k=>k.label.toLowerCase().includes(p.toLowerCase())),A=s.useCallback(()=>{y(!1),m(-1),x("")},[]),T=s.useCallback(k=>{var D;k.disabled||(a(k.value),A(),(D=_.current)==null||D.blur())},[a,A]);s.useEffect(()=>{if(!f)return;const k=D=>{const E=N.current;E&&!E.contains(D.target)&&A()};return document.addEventListener("mousedown",k),()=>document.removeEventListener("mousedown",k)},[f,A]),s.useEffect(()=>{var D;if(!f||u<0)return;const k=(D=g.current)==null?void 0:D.children[u];k==null||k.scrollIntoView({block:"nearest"})},[u,f]),s.useEffect(()=>{m(I.length>0?0:-1)},[p]);function M(){o||(y(!0),x(""))}function B(k){x(k.target.value),f||y(!0)}function R(k){var D;switch(k.key){case"ArrowDown":{if(k.preventDefault(),!f){y(!0);return}m(E=>{let V=E+1;for(;V<I.length&&I[V].disabled;)V++;return V<I.length?V:E});break}case"ArrowUp":{if(k.preventDefault(),!f){y(!0);return}m(E=>{let V=E-1;for(;V>=0&&I[V].disabled;)V--;return V>=0?V:E});break}case"Enter":{k.preventDefault(),f&&u>=0&&I[u]&&T(I[u]);break}case"Escape":{A(),(D=_.current)==null||D.blur();break}}}const j=f?p:(w==null?void 0:w.label)??"";return t.jsxs("div",{ref:k=>{N.current=k,typeof h=="function"?h(k):h&&(h.current=k)},className:v("vyre-combobox",`vyre-combobox--${i}`,o&&"vyre-combobox--disabled",c),"data-open":f,...d,children:[t.jsx("input",{ref:_,type:"text",role:"combobox","aria-expanded":f,"aria-haspopup":"listbox","aria-controls":L,"aria-autocomplete":"list","aria-disabled":o,disabled:o,className:"vyre-combobox__input",placeholder:n,value:j,onFocus:M,onChange:B,onKeyDown:R}),t.jsx("span",{className:"vyre-combobox__chevron","aria-hidden":"true",children:t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:t.jsx("path",{d:"M3 5L7 9L11 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),f&&t.jsx("ul",{ref:g,id:L,role:"listbox",className:"vyre-combobox__dropdown","aria-label":"Options",children:I.length>0?I.map((k,D)=>t.jsx("li",{role:"option","aria-selected":k.value===r,"aria-disabled":k.disabled,"data-highlighted":D===u,className:v("vyre-combobox__option",D===u&&"vyre-combobox__option--highlighted",k.value===r&&"vyre-combobox__option--selected"),onMouseEnter:()=>!k.disabled&&m(D),onMouseDown:E=>{E.preventDefault(),T(k)},children:k.label},k.value)):t.jsx("li",{className:"vyre-combobox__empty",role:"presentation",children:l})})]})});zt.displayName="VyreCombobox";function ca({col:e,sortKey:r,sortDir:a}){const o=r===e.key?a:void 0;return t.jsx("span",{className:"vyre-data-grid__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 2v4M3.5 4.5L6 2l2.5 2.5",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",opacity:o==="desc"?.3:1}),t.jsx("path",{d:"M6 10V6M3.5 7.5L6 10l2.5-2.5",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",opacity:o==="asc"?.3:1})]})})}const da=5,Xt=s.forwardRef(({columns:e,rows:r,sortKey:a,sortDir:n,onSort:o,loading:i=!1,emptyText:l="No data",stickyHeader:c=!1,className:d,style:h,"data-testid":f},y)=>{function p(u){if(!u.sortable||!o)return;const m=a===u.key&&n==="asc"?"desc":"asc";o(u.key,m)}function x(u){return a!==u.key?"none":n==="asc"?"ascending":"descending"}return t.jsx("div",{ref:y,className:v("vyre-data-grid",c&&"vyre-data-grid--sticky-header",d),style:h,"data-testid":f,children:t.jsxs("table",{className:"vyre-data-grid__table",children:[t.jsx("thead",{className:"vyre-data-grid__thead",children:t.jsx("tr",{children:e.map(u=>t.jsx("th",{className:v("vyre-data-grid__th",u.sortable&&"vyre-data-grid__th--sortable",a===u.key&&`vyre-data-grid__th--sort-${n}`),style:u.width?{width:u.width}:void 0,"aria-sort":u.sortable?x(u):void 0,children:u.sortable?t.jsxs("button",{type:"button",className:"vyre-data-grid__sort-btn",onClick:()=>p(u),children:[u.label,t.jsx(ca,{col:u,sortKey:a,sortDir:n})]}):u.label},u.key))})}),t.jsx("tbody",{className:"vyre-data-grid__tbody",children:i?Array.from({length:da}).map((u,m)=>t.jsx("tr",{className:"vyre-data-grid__row vyre-data-grid__row--skeleton",children:e.map(_=>t.jsx("td",{className:"vyre-data-grid__td",children:t.jsx(ye,{height:16})},_.key))},`skel-${m}`)):r.length===0?t.jsx("tr",{className:"vyre-data-grid__row vyre-data-grid__row--empty",children:t.jsx("td",{className:"vyre-data-grid__td vyre-data-grid__empty",colSpan:e.length,children:l})}):r.map((u,m)=>t.jsx("tr",{className:"vyre-data-grid__row",children:e.map(_=>t.jsx("td",{className:"vyre-data-grid__td",children:u[_.key]!=null?String(u[_.key]):""},_.key))},m))})]})})});Xt.displayName="VyreDataGrid";const Zt=s.forwardRef(({gap:e="md",wrap:r=!0,className:a,children:n,...o},i)=>t.jsx("div",{ref:i,className:v("vyre-tag-group",`vyre-tag-group--gap-${e}`,!r&&"vyre-tag-group--nowrap",a),role:"list",...o,children:n}));Zt.displayName="VyreTagGroup";function z(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function G(e,r){return e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate()}function Q(e,r){return z(e)<z(r)}function _e(e,r){return z(e)>z(r)}function ua(e,r){return new Date(e,r+1,0).getDate()}function ma(e,r,a){return(new Date(e,r,1).getDay()-a+7)%7}function Y(e,r){return e?new Intl.DateTimeFormat("default",{year:"numeric",month:"short",day:"numeric"}).format(e):""}function va(e){return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`}const ge=Array.from({length:12},(e,r)=>new Intl.DateTimeFormat("default",{month:"long"}).format(new Date(2e3,r,1))),J=12,ee=s.forwardRef((e,r)=>{const{showTime:a=!1,minDate:n,maxDate:o,disabled:i,className:l,weekStartsOn:c=1,defaultMonth:d}=e,h=z(new Date),f=()=>{var C,S;return e.mode==="range"?((C=e.value)==null?void 0:C[0])??d??h:e.mode==="multiple"?((S=e.value)==null?void 0:S[0])??d??h:e.value??d??h},[y,p]=s.useState(()=>(f()??h).getFullYear()),[x,u]=s.useState(()=>(f()??h).getMonth()),[m,_]=s.useState("days"),[g,N]=s.useState(null),[b,L]=s.useState(()=>{const C=e.mode==="single"?e.value:null;return C?C.getHours():0}),[w,I]=s.useState(()=>{const C=e.mode==="single"?e.value:null;return C?C.getMinutes():0}),A=s.useMemo(()=>{const C=ua(y,x),S=ma(y,x,c);return{count:C,offset:S}},[y,x,c]),T=s.useMemo(()=>c===1?["Mo","Tu","We","Th","Fr","Sa","Su"]:["Su","Mo","Tu","We","Th","Fr","Sa"],[c]),M=s.useCallback(C=>{if(e.mode==="single")return!!e.value&&G(C,e.value);if(e.mode==="range"){const[S,$]=e.value??[null,null];return!!S&&G(C,S)||!!$&&G(C,$)}return e.mode==="multiple"?(e.value??[]).some(S=>G(C,S)):!1},[e]),B=s.useCallback(C=>{if(e.mode!=="range")return!1;const[S,$]=e.value??[null,null],F=$??g;if(!S||!F)return!1;const K=Q(S,F)?S:F,q=Q(S,F)?F:S;return _e(C,K)&&Q(C,q)},[e,g]),R=s.useCallback(C=>{if(e.mode!=="range")return!1;const[S]=e.value??[null,null];return!!S&&G(C,S)},[e]),j=s.useCallback(C=>{if(e.mode!=="range")return!1;const[,S]=e.value??[null,null];return!!S&&G(C,S)},[e]),k=s.useCallback(C=>!!(n&&Q(C,n)||o&&_e(C,o)||i!=null&&i(C)),[n,o,i]),D=s.useCallback(C=>{var $,F,K,q,Z,te;const S=new Date(y,x,C,b,w);if(!k(z(S))){if(e.mode==="single"||!e.mode)($=e.onChange)==null||$.call(e,S);else if(e.mode==="range"){const[H,U]=e.value??[null,null];!H||H&&U?(F=e.onChange)==null||F.call(e,[S,null]):Q(S,H)?(K=e.onChange)==null||K.call(e,[S,H]):(q=e.onChange)==null||q.call(e,[H,S])}else if(e.mode==="multiple"){const H=e.value??[],U=H.findIndex(pe=>G(pe,S));U>=0?(Z=e.onChange)==null||Z.call(e,H.filter((pe,Rr)=>Rr!==U)):(te=e.onChange)==null||te.call(e,[...H,S])}}},[y,x,b,w,e,k]),E=()=>{x===0?(u(11),p(C=>C-1)):u(C=>C-1)},V=()=>{x===11?(u(0),p(C=>C+1)):u(C=>C+1)},X=(C,S)=>{var $;if(L(C),I(S),e.mode==="single"&&e.value){const F=new Date(e.value);F.setHours(C,S),($=e.onChange)==null||$.call(e,F)}},Cr=Math.floor(y/J)*J;return t.jsxs("div",{ref:r,className:v("vyre-calendar",l),children:[t.jsxs("div",{className:"vyre-calendar__header",children:[m==="days"&&t.jsx("button",{className:"vyre-calendar__nav",onClick:E,"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"})})}),m==="years"&&t.jsx("button",{className:"vyre-calendar__nav",onClick:()=>p(C=>C-J),"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==="months"?"days":"months"),children:ge[x]}),t.jsx("button",{className:"vyre-calendar__header-btn",onClick:()=>_(m==="years"?"days":"years"),children:y})]}),m==="days"&&t.jsx("button",{className:"vyre-calendar__nav",onClick:V,"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"})})}),m==="years"&&t.jsx("button",{className:"vyre-calendar__nav",onClick:()=>p(C=>C+J),"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"})})})]}),m==="months"&&t.jsx("div",{className:"vyre-calendar__month-grid",children:ge.map((C,S)=>t.jsx("button",{className:v("vyre-calendar__month-cell",S===x&&"vyre-calendar__month-cell--active"),onClick:()=>{u(S),_("days")},children:C.slice(0,3)},C))}),m==="years"&&t.jsx("div",{className:"vyre-calendar__year-grid",children:Array.from({length:J},(C,S)=>Cr+S).map(C=>t.jsx("button",{className:v("vyre-calendar__year-cell",C===y&&"vyre-calendar__year-cell--active"),onClick:()=>{p(C),_("days")},children:C},C))}),m==="days"&&t.jsxs("div",{className:"vyre-calendar__grid",children:[T.map(C=>t.jsx("div",{className:"vyre-calendar__weekday",children:C},C)),Array.from({length:A.offset}).map((C,S)=>t.jsx("div",{},`empty-${S}`)),Array.from({length:A.count},(C,S)=>S+1).map(C=>{const S=new Date(y,x,C),$=M(S),F=B(S),K=R(S),q=j(S),Z=k(S),te=G(S,h);return t.jsx("button",{className:v("vyre-calendar__day",te&&"vyre-calendar__day--today",$&&"vyre-calendar__day--selected",F&&"vyre-calendar__day--in-range",K&&"vyre-calendar__day--range-start",q&&"vyre-calendar__day--range-end",Z&&"vyre-calendar__day--disabled"),onClick:()=>D(C),onMouseEnter:()=>{if(e.mode==="range"){const[H,U]=e.value??[null,null];H&&!U&&N(S)}},onMouseLeave:()=>N(null),disabled:Z,"aria-selected":$,"aria-label":Y(S),children:C},C)})]}),a&&m==="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:b,onChange:C=>X(Number(C.target.value),w),"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:w,onChange:C=>X(b,Number(C.target.value)),"aria-label":"Minutes"})]})]})});ee.displayName="VyreCalendar";function fa(e){if(e.mode==="range"){const[n,o]=e.value??[null,null];return n?o?`${Y(n)} – ${Y(o)}`:Y(n):""}if(e.mode==="multiple"){const n=e.value??[];return n.length===0?"":n.length===1?Y(n[0]):`${n.length} dates selected`}const r=e.value,a=e.showTime;return r?a?`${Y(r)} ${va(r)}`:Y(r):""}const Qt=s.forwardRef(({placeholder:e="Pick a date",inputClassName:r,...a},n)=>{const[o,i]=s.useState(!1),l=s.useRef(null),c=s.useRef(null),[d,h]=s.useState({top:0,left:0,width:0}),f=fa(a),y=s.useCallback(()=>{if(!l.current)return;const u=l.current.getBoundingClientRect();h({top:u.bottom+window.scrollY+6,left:u.left+window.scrollX,width:u.width})},[]);s.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]),s.useEffect(()=>{if(!o)return;const u=_=>{var g,N;!((g=c.current)!=null&&g.contains(_.target))&&!((N=l.current)!=null&&N.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 p=a.mode!=="range"&&a.mode!=="multiple"&&!a.showTime,x=s.useMemo(()=>a.mode==="range"?{...a,onChange:u=>{var m;(m=a.onChange)==null||m.call(a,u),u[0]&&u[1]&&i(!1)}}:a.mode==="multiple"?a:{...a,onChange:u=>{var m;(m=a.onChange)==null||m.call(a,u),p&&i(!1)}},[a,p]);return t.jsxs("div",{ref:n,className:"vyre-datepicker",children:[t.jsxs("button",{ref:l,type:"button",className:v("vyre-datepicker__trigger",!f&&"vyre-datepicker__trigger--placeholder",r),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:f||e}),f&&t.jsx("button",{className:"vyre-datepicker__clear",type:"button","aria-label":"Clear",onClick:u=>{var m,_,g;u.stopPropagation(),a.mode==="range"?(m=a.onChange)==null||m.call(a,[null,null]):a.mode==="multiple"?(_=a.onChange)==null||_.call(a,[]):(g=a.onChange)==null||g.call(a,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&&P.createPortal(t.jsx("div",{ref:c,className:"vyre-datepicker__popover",role:"dialog","aria-label":"Date picker",style:{top:d.top,left:d.left,minWidth:d.width},children:t.jsx(ee,{...x})}),document.body)]})});Qt.displayName="VyreDatePicker";function O(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function ie(e,r){const a=new Date(e);return a.setDate(a.getDate()+r),O(a)}function le(e){return e?new Intl.DateTimeFormat("default",{year:"numeric",month:"short",day:"numeric"}).format(e):""}const ya=[{label:"Today",range:()=>{const e=O(new Date);return{from:e,to:e}}},{label:"Yesterday",range:()=>{const e=ie(new Date,-1);return{from:e,to:e}}},{label:"Last 7 days",range:()=>({from:ie(new Date,-6),to:O(new Date)})},{label:"Last 30 days",range:()=>({from:ie(new Date,-29),to:O(new Date)})},{label:"This month",range:()=>{const e=new Date;return{from:O(new Date(e.getFullYear(),e.getMonth(),1)),to:O(new Date(e.getFullYear(),e.getMonth()+1,0))}}},{label:"Last month",range:()=>{const e=new Date;return{from:O(new Date(e.getFullYear(),e.getMonth()-1,1)),to:O(new Date(e.getFullYear(),e.getMonth(),0))}}}],Jt=s.forwardRef(({value:e,onChange:r,placeholder:a="Pick a date range",numberOfMonths:n=2,presets:o=!1,minDate:i,maxDate:l,disabled:c,weekStartsOn:d=1,className:h,inputClassName:f},y)=>{const[p,x]=s.useState(!1),u=s.useRef(null),m=s.useRef(null),[_,g]=s.useState({top:0,left:0,width:0}),N=(e==null?void 0:e.from)??null,b=(e==null?void 0:e.to)??null,L=s.useMemo(()=>o===!0?ya:Array.isArray(o)?o:[],[o]),w=s.useMemo(()=>N?b?`${le(N)} – ${le(b)}`:le(N):"",[N,b]),I=s.useCallback(()=>{if(!u.current)return;const j=u.current.getBoundingClientRect();g({top:j.bottom+window.scrollY+6,left:j.left+window.scrollX,width:j.width})},[]);s.useEffect(()=>{if(!p)return;I();const j=()=>I(),k=()=>I();return window.addEventListener("scroll",j,!0),window.addEventListener("resize",k),()=>{window.removeEventListener("scroll",j,!0),window.removeEventListener("resize",k)}},[p,I]),s.useEffect(()=>{if(!p)return;const j=D=>{var E,V;!((E=m.current)!=null&&E.contains(D.target))&&!((V=u.current)!=null&&V.contains(D.target))&&x(!1)},k=D=>{D.key==="Escape"&&x(!1)};return document.addEventListener("pointerdown",j),document.addEventListener("keydown",k),()=>{document.removeEventListener("pointerdown",j),document.removeEventListener("keydown",k)}},[p]);const A=s.useCallback(j=>{const k={from:j[0],to:j[1]};r==null||r(k),k.from&&k.to&&x(!1)},[r]),T=s.useCallback(j=>{r==null||r(j.range()),x(!1)},[r]),M=s.useCallback(()=>{r==null||r({from:null,to:null})},[r]),B=s.useMemo(()=>{const j=N??O(new Date);return new Date(j.getFullYear(),j.getMonth()+1,1)},[N]),R=[N,b];return t.jsxs("div",{ref:y,className:v("vyre-date-range-picker",h),children:[t.jsxs("button",{ref:u,type:"button",className:v("vyre-datepicker__trigger",!w&&"vyre-datepicker__trigger--placeholder",f),onClick:()=>{I(),x(j=>!j)},"aria-expanded":p,"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:w||a}),w&&t.jsx("button",{className:"vyre-datepicker__clear",type:"button","aria-label":"Clear",onClick:j=>{j.stopPropagation(),M()},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"})})})]}),p&&P.createPortal(t.jsxs("div",{ref:m,className:"vyre-date-range-picker__popover",role:"dialog","aria-label":"Date range picker",style:{top:_.top,left:_.left},children:[L.length>0&&t.jsx("div",{className:"vyre-date-range-picker__presets",children:L.map(j=>t.jsx("button",{type:"button",className:"vyre-date-range-picker__preset",onClick:()=>T(j),children:j.label},j.label))}),t.jsxs("div",{className:"vyre-date-range-picker__calendars",children:[t.jsx(ee,{mode:"range",value:R,onChange:A,minDate:i,maxDate:l,disabled:c,weekStartsOn:d}),n===2&&t.jsx(ee,{mode:"range",value:R,defaultMonth:B,onChange:A,minDate:i,maxDate:l,disabled:c,weekStartsOn:d},B.toISOString())]})]}),document.body)]})});Jt.displayName="VyreDateRangePicker";const er=s.forwardRef(({variant:e="default",size:r="md",clickable:a=!1,className:n,children:o,...i},l)=>t.jsx("div",{ref:l,className:v("vyre-item",`vyre-item--${e}`,`vyre-item--${r}`,a&&"vyre-item--clickable",n),"data-variant":e,"data-size":r,role:a?"button":void 0,tabIndex:a?0:void 0,...i,children:o}));er.displayName="VyreItem";const tr=s.forwardRef(({separated:e=!1,className:r,children:a,...n},o)=>t.jsx("div",{ref:o,role:"list",className:v("vyre-item-group",e&&"vyre-item-group--separated",r),...n,children:a}));tr.displayName="VyreItemGroup";const rr=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-item__media",e),"aria-hidden":"true",...a,children:r}));rr.displayName="VyreItemMedia";const ar=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-item__content",e),...a,children:r}));ar.displayName="VyreItemContent";const nr=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-item__title",e),...a,children:r}));nr.displayName="VyreItemTitle";const sr=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("p",{ref:n,className:v("vyre-item__description",e),...a,children:r}));sr.displayName="VyreItemDescription";const or=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("div",{ref:n,className:v("vyre-item__actions",e),...a,children:r}));or.displayName="VyreItemActions";function ha(e,r,a,n){const o=e.find(l=>l.id===r.fromColumnId);if(!o)return e;const i=o.cards.find(l=>l.id===r.cardId);return i?e.map(l=>{if(l.id===r.fromColumnId&&l.id===a){const c=l.cards.filter(f=>f.id!==r.cardId),d=Math.max(0,Math.min(n,c.length)),h=[...c];return h.splice(d,0,i),{...l,cards:h}}if(l.id===r.fromColumnId)return{...l,cards:l.cards.filter(c=>c.id!==r.cardId)};if(l.id===a){const c=Math.max(0,Math.min(n,l.cards.length)),d=[...l.cards];return d.splice(c,0,i),{...l,cards:d}}return l}):e}const ir=s.forwardRef(({value:e,onChange:r,renderCard:a,onCardClick:n,className:o,...i},l)=>{const c=s.useRef(null),d=s.useRef(!1),[h,f]=s.useState(null),[y,p]=s.useState(null),[x,u]=s.useState(null),m=(b,L)=>{p(w=>w===b?w:b),u(w=>w===L?w:L)},_=(b,L)=>w=>{c.current={cardId:L,fromColumnId:b},d.current=!1,f(L),w.dataTransfer.effectAllowed="move",w.dataTransfer.setData("text/plain",L)},g=()=>{c.current=null,f(null),p(null),u(null)},N=(b,L)=>{const w=c.current;if(!w)return;const I=ha(e,w,b,L);I!==e&&(d.current=!0,r(I))};return t.jsx("div",{ref:l,className:v("vyre-kanban",o),role:"list","aria-label":"Kanban board",...i,children:e.map(b=>{const L=y===b.id,w=b.color&&b.color!=="default"?b.color:void 0,I=L&&c.current&&x!==null?x:null,A=t.jsx("div",{className:"vyre-kanban__placeholder","aria-hidden":"true"});return t.jsxs("div",{role:"listitem","data-color":w,className:v("vyre-kanban__column",L&&"vyre-kanban__column--over"),onDragOver:T=>{c.current&&(T.preventDefault(),T.dataTransfer.dropEffect="move",m(b.id,b.cards.length))},onDragLeave:T=>{T.currentTarget.contains(T.relatedTarget)||(p(M=>M===b.id?null:M),u(null))},onDrop:T=>{T.preventDefault(),N(b.id,x??b.cards.length),g()},children:[t.jsxs("div",{className:"vyre-kanban__column-header",children:[t.jsx("span",{className:"vyre-kanban__column-title",children:b.title}),t.jsx("span",{className:"vyre-kanban__column-count",children:b.cards.length})]}),t.jsxs("div",{className:"vyre-kanban__cards",children:[b.cards.map((T,M)=>{const B=T.color&&T.color!=="default"?T.color:void 0;return t.jsxs(s.Fragment,{children:[I===M&&A,t.jsx(de,{variant:"outlined","data-color":B,className:v("vyre-kanban__card",h===T.id&&"vyre-kanban__card--dragging",n&&"vyre-kanban__card--clickable"),draggable:!0,role:n?"button":void 0,tabIndex:n?0:void 0,onDragStart:_(b.id,T.id),onDragEnd:g,onDragOver:R=>{if(!c.current)return;R.preventDefault(),R.stopPropagation();const j=R.currentTarget.getBoundingClientRect(),k=R.clientY-j.top>j.height/2;m(b.id,k?M+1:M)},onDrop:R=>{R.preventDefault(),R.stopPropagation(),N(b.id,x??M),g()},onClick:()=>{d.current||n==null||n(T,b)},onKeyDown:R=>{n&&(R.key==="Enter"||R.key===" ")&&(R.preventDefault(),n(T,b))},children:t.jsx(ue,{children:a?a(T,b):t.jsxs(t.Fragment,{children:[t.jsx("div",{className:"vyre-kanban__card-title",children:T.title}),T.description&&t.jsx("div",{className:"vyre-kanban__card-desc",children:T.description})]})})})]},T.id)}),I===b.cards.length&&A,b.cards.length===0&&I===null&&t.jsx("div",{className:"vyre-kanban__empty",children:"Drop cards here"})]})]},b.id)})})});ir.displayName="VyreKanban";function je(e){if(e==null)return null;const r=e instanceof Date?e:new Date(e);return Number.isNaN(r.getTime())?null:r}function ce(e,r){return e.getFullYear()===r.getFullYear()&&e.getMonth()===r.getMonth()&&e.getDate()===r.getDate()}function ba(e){const r=new Date,a=new Date;return a.setDate(r.getDate()-1),ce(e,r)?"Today":ce(e,a)?"Yesterday":new Intl.DateTimeFormat("default",{month:"short",day:"numeric",year:e.getFullYear()===r.getFullYear()?void 0:"numeric"}).format(e)}function pa(e){return new Intl.DateTimeFormat("default",{hour:"numeric",minute:"2-digit"}).format(e)}const xa={sending:"Sending…",sent:"Sent",delivered:"Delivered",read:"Read"};function _a(){return t.jsxs("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",children:[t.jsx("path",{d:"M10 2H5a1.5 1.5 0 0 0-1.5 1.5v11A1.5 1.5 0 0 0 5 16h8a1.5 1.5 0 0 0 1.5-1.5V6.5L10 2z",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"}),t.jsx("path",{d:"M10 2v4.5h4.5",stroke:"currentColor",strokeWidth:"1.3",strokeLinejoin:"round"})]})}function ga({attachment:e}){const{kind:r,url:a,name:n,size:o}=e;return r==="image"?t.jsx("a",{className:"vyre-conversation__att vyre-conversation__att--image",href:a,target:"_blank",rel:"noopener noreferrer",children:t.jsx("img",{src:a,alt:n??"image attachment",loading:"lazy"})}):r==="audio"?t.jsx("audio",{className:"vyre-conversation__att vyre-conversation__att--audio",src:a,controls:!0,preload:"none"}):r==="video"?t.jsx("video",{className:"vyre-conversation__att vyre-conversation__att--video",src:a,controls:!0,preload:"none"}):t.jsxs("a",{className:"vyre-conversation__att vyre-conversation__att--file",href:a,target:"_blank",rel:"noopener noreferrer",download:n,children:[t.jsx("span",{className:"vyre-conversation__att-icon",children:t.jsx(_a,{})}),t.jsxs("span",{className:"vyre-conversation__att-info",children:[t.jsx("span",{className:"vyre-conversation__att-name",children:n??"Attachment"}),o&&t.jsx("span",{className:"vyre-conversation__att-size",children:o})]})]})}const lr=s.forwardRef(({value:e,currentUserId:r,composer:a=!1,onSend:n,placeholder:o="Write a message…",typing:i=!1,allowAttachments:l=!1,accept:c,renderMessage:d,renderComposer:h,className:f,...y},p)=>{const[x,u]=s.useState(""),[m,_]=s.useState([]),g=s.useRef(null),N=()=>{const w=x.trim();!w&&m.length===0||(n==null||n(w,m),u(""),_([]))},b=s.useMemo(()=>e.map((w,I)=>{const A=e[I-1],T=e[I+1],M=je(w.timestamp),B=A?je(A.timestamp):null,R=!!M&&(!B||!ce(M,B)),j=!A||A.authorId!==w.authorId||R,k=!T||T.authorId!==w.authorId,D=w.authorId===r;return{msg:w,date:M,showDaySeparator:R,isGroupStart:j,isGroupEnd:k,outgoing:D}}),[e,r]),L={value:x,setValue:u,files:m,setFiles:_,send:N};return t.jsxs("div",{ref:p,className:v("vyre-conversation",f),...y,children:[t.jsxs("div",{className:"vyre-conversation__thread",role:"log","aria-label":"Conversation","aria-live":"polite",children:[b.map(({msg:w,date:I,showDaySeparator:A,isGroupStart:T,isGroupEnd:M,outgoing:B})=>t.jsxs(s.Fragment,{children:[A&&I&&t.jsx("div",{className:"vyre-conversation__day",role:"separator",children:t.jsx("span",{children:ba(I)})}),t.jsxs("div",{className:v("vyre-conversation__row",B?"vyre-conversation__row--out":"vyre-conversation__row--in",M&&"vyre-conversation__row--group-end"),children:[t.jsx("div",{className:"vyre-conversation__avatar",children:!B&&M&&t.jsx(ve,{size:"sm",src:w.authorAvatar,fallback:(w.authorName??w.authorId).slice(0,1).toUpperCase(),alt:w.authorName??w.authorId})}),t.jsxs("div",{className:"vyre-conversation__stack",children:[!B&&T&&w.authorName&&t.jsx("span",{className:"vyre-conversation__author",children:w.authorName}),t.jsx("div",{className:"vyre-conversation__bubble",children:d?d(w,{outgoing:B,isGroupStart:T,isGroupEnd:M}):t.jsxs(t.Fragment,{children:[w.attachments&&w.attachments.length>0&&t.jsx("div",{className:"vyre-conversation__attachments",children:w.attachments.map((R,j)=>t.jsx(ga,{attachment:R},j))}),w.text]})}),M&&t.jsxs("span",{className:"vyre-conversation__meta",children:[I&&pa(I),B&&w.status&&t.jsxs("span",{className:v("vyre-conversation__status",`vyre-conversation__status--${w.status}`),children:[I?" · ":"",xa[w.status]]})]})]})]})]},w.id)),i&&t.jsxs("div",{className:"vyre-conversation__row vyre-conversation__row--in",children:[t.jsx("div",{className:"vyre-conversation__avatar"}),t.jsx("div",{className:"vyre-conversation__stack",children:t.jsxs("div",{className:"vyre-conversation__bubble vyre-conversation__bubble--typing",children:[t.jsx("span",{className:"vyre-conversation__dot"}),t.jsx("span",{className:"vyre-conversation__dot"}),t.jsx("span",{className:"vyre-conversation__dot"}),typeof i=="string"&&t.jsx("span",{className:"vyre-conversation__typing-label",children:i})]})})]})]}),h?h(L):a&&t.jsxs("form",{className:"vyre-conversation__composer",onSubmit:w=>{w.preventDefault(),N()},children:[l&&m.length>0&&t.jsx("div",{className:"vyre-conversation__staged",children:m.map((w,I)=>t.jsxs("span",{className:"vyre-conversation__chip",children:[t.jsx("span",{className:"vyre-conversation__chip-name",children:w.name}),t.jsx("button",{type:"button",className:"vyre-conversation__chip-remove","aria-label":`Remove ${w.name}`,onClick:()=>_(m.filter((A,T)=>T!==I)),children:t.jsx("svg",{width:"10",height:"10",viewBox:"0 0 10 10",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M2 2l6 6M8 2l-6 6",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})})]},I))}),t.jsxs("div",{className:"vyre-conversation__composer-row",children:[l&&t.jsxs(t.Fragment,{children:[t.jsx("input",{ref:g,type:"file",multiple:!0,accept:c,className:"vyre-conversation__file-input",onChange:w=>{const I=Array.from(w.target.files??[]);I.length&&_([...m,...I]),w.target.value=""}}),t.jsx("button",{type:"button",className:"vyre-conversation__attach","aria-label":"Attach files",onClick:()=>{var w;return(w=g.current)==null?void 0:w.click()},children:t.jsx("svg",{width:"18",height:"18",viewBox:"0 0 18 18",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M13.5 6.5l-5.6 5.6a2.5 2.5 0 0 1-3.5-3.5l6-6a3.5 3.5 0 0 1 5 5l-6 6",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),t.jsx("input",{className:"vyre-conversation__input",value:x,onChange:w=>u(w.target.value),placeholder:o,"aria-label":"Message"}),t.jsx("button",{type:"submit",className:"vyre-conversation__send",disabled:!x.trim()&&m.length===0,"aria-label":"Send message",children:t.jsx("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M2 8l12-5-4.5 12L7 9.5 2 8z",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round"})})})]})]})]})});lr.displayName="VyreConversation";const cr=s.forwardRef(({as:e="p",size:r="md",weight:a,color:n="default",truncate:o,mono:i,className:l,children:c,...d},h)=>t.jsx(e,{ref:h,className:v("vyre-text",r!=="md"&&`vyre-text--${r}`,a&&`vyre-text--${a}`,n!=="default"&&`vyre-text--${n}`,o&&"vyre-text--truncate",i&&"vyre-text--mono",l),...d,children:c}));cr.displayName="VyreText";const dr=s.forwardRef(({as:e="h2",size:r="md",weight:a="bold",color:n="default",truncate:o,className:i,children:l,...c},d)=>t.jsx(e,{ref:d,className:v("vyre-heading",`vyre-heading--${r}`,a!=="bold"&&`vyre-heading--${a}`,n!=="default"&&`vyre-text--${n}`,o&&"vyre-text--truncate",i),...c,children:l}));dr.displayName="VyreHeading";const ur=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("p",{ref:n,className:v("vyre-lead",e),...a,children:r}));ur.displayName="VyreLead";const mr=s.forwardRef(({block:e,className:r,children:a,...n},o)=>e?t.jsx("pre",{className:v("vyre-code-block",r),...n,children:t.jsx("code",{ref:o,children:a})}):t.jsx("code",{ref:o,className:v("vyre-code",r),...n,children:a}));mr.displayName="VyreCode";const vr=s.forwardRef(({className:e,children:r,...a},n)=>t.jsx("blockquote",{ref:n,className:v("vyre-blockquote",e),...a,children:r}));vr.displayName="VyreBlockquote";const fr=s.createContext({collapsed:!1,toggleCollapsed:()=>{}}),se=()=>s.useContext(fr),yr=s.forwardRef(({defaultCollapsed:e=!1,collapsed:r,onCollapsedChange:a,className:n,children:o},i)=>{const[l,c]=s.useState(e),d=r!==void 0?r:l,h=s.useCallback(()=>{const f=!d;c(f),a==null||a(f)},[d,a]);return t.jsx(fr.Provider,{value:{collapsed:d,toggleCollapsed:h},children:t.jsx("div",{ref:i,className:v("vyre-app-layout",n),children:o})})});yr.displayName="VyreAppLayout";const hr=s.forwardRef(({variant:e="default",className:r,children:a},n)=>{const{collapsed:o}=se();return t.jsx("aside",{ref:n,className:v("vyre-sidebar",o&&"vyre-sidebar--collapsed",e==="floating"&&"vyre-sidebar--floating",r),"data-collapsed":o||void 0,children:a})});hr.displayName="VyreSidebar";const br=s.forwardRef(({logo:e,title:r,className:a,children:n},o)=>t.jsxs("div",{ref:o,className:v("vyre-sidebar__header",a),children:[e&&t.jsx("span",{className:"vyre-sidebar__logo",children:e}),r&&t.jsx("span",{className:"vyre-sidebar__title",children:r}),n]}));br.displayName="VyreSidebarHeader";const pr=s.forwardRef(({className:e,children:r},a)=>t.jsx("div",{ref:a,className:v("vyre-sidebar__content",e),children:r}));pr.displayName="VyreSidebarContent";const xr=s.forwardRef(({label:e,className:r,children:a},n)=>t.jsxs("div",{ref:n,className:v("vyre-sidebar__section",r),children:[e&&t.jsx("div",{className:"vyre-sidebar__section-label",children:e}),a]}));xr.displayName="VyreSidebarSection";const _r=({active:e,icon:r,badge:a,href:n,onClick:o,className:i,children:l})=>{const{collapsed:c}=se(),d=v("vyre-sidebar__item",e&&"vyre-sidebar__item--active",i),h=t.jsxs(t.Fragment,{children:[r&&t.jsx("span",{className:"vyre-sidebar__item-icon",children:r}),t.jsx("span",{className:"vyre-sidebar__item-label",children:l}),a!==void 0&&t.jsx("span",{className:"vyre-sidebar__item-badge",children:a})]});return n?t.jsx("a",{href:n,className:d,"aria-current":e?"page":void 0,title:c?String(l):void 0,children:h}):t.jsx("button",{type:"button",className:d,onClick:o,"aria-pressed":e,title:c?String(l):void 0,children:h})};_r.displayName="VyreSidebarItem";const gr=s.forwardRef(({className:e,children:r},a)=>t.jsx("div",{ref:a,className:v("vyre-sidebar__footer",e),children:r}));gr.displayName="VyreSidebarFooter";const jr=s.forwardRef(({className:e,children:r},a)=>t.jsx("div",{ref:a,className:v("vyre-app-shell",e),children:r}));jr.displayName="VyreAppShell";const wr=s.forwardRef(({className:e,children:r},a)=>t.jsx("header",{ref:a,className:v("vyre-app-bar",e),children:r}));wr.displayName="VyreAppBar";const ja=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"})]}),kr=({className:e,icon:r,collapsedIcon:a})=>{const{collapsed:n,toggleCollapsed:o}=se(),i=r??ja,l=a??i;return t.jsx("button",{type:"button",className:v("vyre-sidebar-trigger",e),onClick:o,"aria-label":n?"Expand sidebar":"Collapse sidebar","aria-expanded":!n,children:n?l:i})};kr.displayName="VyreSidebarTrigger";const Nr=s.forwardRef(({className:e,children:r},a)=>t.jsx("div",{ref:a,className:v("vyre-page-content",e),children:r}));Nr.displayName="VyrePageContent";exports.Accordion=Ze;exports.AccordionContent=et;exports.AccordionItem=Qe;exports.AccordionTrigger=Je;exports.Alert=gt;exports.AlertDialog=jt;exports.AppBar=wr;exports.AppLayout=yr;exports.AppShell=jr;exports.Avatar=ve;exports.Badge=ke;exports.Blockquote=vr;exports.Breadcrumb=Rt;exports.BreadcrumbItem=Lt;exports.BreadcrumbLink=Dt;exports.BreadcrumbSeparator=St;exports.Button=we;exports.ButtonGroup=qt;exports.Calendar=ee;exports.Card=de;exports.CardBody=ue;exports.CardFooter=Ce;exports.CardHeader=Ne;exports.Checkbox=tt;exports.Code=mr;exports.Combobox=zt;exports.Command=he;exports.CommandDialog=Kt;exports.CommandEmpty=Pt;exports.CommandGroup=Ot;exports.CommandInput=Wt;exports.CommandItem=Gt;exports.CommandList=Ht;exports.CommandSeparator=Yt;exports.Conversation=lr;exports.DataGrid=Xt;exports.DatePicker=Qt;exports.DateRangePicker=Jt;exports.DropdownCheckboxItem=yt;exports.DropdownItem=ft;exports.DropdownLabel=vt;exports.DropdownMenu=mt;exports.DropdownRadioGroup=ht;exports.DropdownRadioItem=bt;exports.DropdownSeparator=xt;exports.DropdownSub=pt;exports.Field=Re;exports.FieldDescription=De;exports.FieldError=Se;exports.FieldGroup=Me;exports.FieldLabel=Le;exports.FieldSet=Ie;exports.Heading=dr;exports.Input=Te;exports.Item=er;exports.ItemActions=or;exports.ItemContent=ar;exports.ItemDescription=sr;exports.ItemGroup=tr;exports.ItemMedia=rr;exports.ItemTitle=nr;exports.Kanban=ir;exports.Label=ct;exports.Lead=ur;exports.Modal=Ae;exports.ModalBody=Ve;exports.ModalFooter=$e;exports.ModalHeader=Be;exports.PageContent=Nr;exports.Pagination=Mt;exports.Popover=dt;exports.Progress=it;exports.Radio=fe;exports.RadioGroup=at;exports.RichTextEditor=nt;exports.Select=We;exports.Separator=lt;exports.Sheet=wt;exports.SheetBody=Nt;exports.SheetFooter=Ct;exports.SheetHeader=kt;exports.Sidebar=hr;exports.SidebarContent=pr;exports.SidebarFooter=gr;exports.SidebarHeader=br;exports.SidebarItem=_r;exports.SidebarSection=xr;exports.SidebarTrigger=kr;exports.Skeleton=ye;exports.Slider=ot;exports.Switch=st;exports.Tab=Ye;exports.TabList=Ge;exports.TabPanel=qe;exports.TabPanels=Ke;exports.Table=It;exports.TableBody=Et;exports.TableCaption=$t;exports.TableCell=Vt;exports.TableHead=Tt;exports.TableHeader=Bt;exports.TableRow=At;exports.Tabs=Oe;exports.Tag=be;exports.TagGroup=Zt;exports.TagsInput=Ut;exports.Text=cr;exports.Textarea=Ee;exports.ToastProvider=Ar;exports.Tooltip=Ue;exports.cn=v;exports.useAppLayout=se;exports.useToast=Br;
package/dist/index.js CHANGED
@@ -404,7 +404,7 @@ function vt(e, r) {
404
404
  }
405
405
  let mt = 0;
406
406
  const yt = () => `vyre-t-${++mt}`;
407
- function Bn({ children: e }) {
407
+ function Vn({ children: e }) {
408
408
  const [r, n] = Ke(vt, []), a = B((i) => {
409
409
  const s = yt();
410
410
  return n({ type: "ADD", payload: { ...i, id: s } }), s;
@@ -428,7 +428,7 @@ function Bn({ children: e }) {
428
428
  )
429
429
  ] });
430
430
  }
431
- function Vn() {
431
+ function $n() {
432
432
  const e = Q(Ce);
433
433
  if (!e) throw new Error("useToast must be used inside <ToastProvider>");
434
434
  return e;
@@ -4252,29 +4252,33 @@ const Mn = g.forwardRef(
4252
4252
  ({ className: e, children: r }, n) => /* @__PURE__ */ t("header", { ref: n, className: m("vyre-app-bar", e), children: r })
4253
4253
  );
4254
4254
  Mn.displayName = "VyreAppBar";
4255
- const In = ({ className: e }) => {
4256
- const { collapsed: r, toggleCollapsed: n } = ge();
4255
+ const In = /* @__PURE__ */ N("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: [
4256
+ /* @__PURE__ */ t("rect", { x: "2", y: "4", width: "12", height: "1.5", rx: "0.75", fill: "currentColor" }),
4257
+ /* @__PURE__ */ t("rect", { x: "2", y: "7.25", width: "8", height: "1.5", rx: "0.75", fill: "currentColor" }),
4258
+ /* @__PURE__ */ t("rect", { x: "2", y: "10.5", width: "12", height: "1.5", rx: "0.75", fill: "currentColor" })
4259
+ ] }), Tn = ({
4260
+ className: e,
4261
+ icon: r,
4262
+ collapsedIcon: n
4263
+ }) => {
4264
+ const { collapsed: a, toggleCollapsed: o } = ge(), i = r ?? In, s = n ?? i;
4257
4265
  return /* @__PURE__ */ t(
4258
4266
  "button",
4259
4267
  {
4260
4268
  type: "button",
4261
4269
  className: m("vyre-sidebar-trigger", e),
4262
- onClick: n,
4263
- "aria-label": r ? "Expand sidebar" : "Collapse sidebar",
4264
- "aria-expanded": !r,
4265
- children: /* @__PURE__ */ N("svg", { width: "16", height: "16", viewBox: "0 0 16 16", fill: "none", "aria-hidden": "true", children: [
4266
- /* @__PURE__ */ t("rect", { x: "2", y: "4", width: "12", height: "1.5", rx: "0.75", fill: "currentColor" }),
4267
- /* @__PURE__ */ t("rect", { x: "2", y: "7.25", width: "8", height: "1.5", rx: "0.75", fill: "currentColor" }),
4268
- /* @__PURE__ */ t("rect", { x: "2", y: "10.5", width: "12", height: "1.5", rx: "0.75", fill: "currentColor" })
4269
- ] })
4270
+ onClick: o,
4271
+ "aria-label": a ? "Expand sidebar" : "Collapse sidebar",
4272
+ "aria-expanded": !a,
4273
+ children: a ? s : i
4270
4274
  }
4271
4275
  );
4272
4276
  };
4273
- In.displayName = "VyreSidebarTrigger";
4274
- const Tn = g.forwardRef(
4277
+ Tn.displayName = "VyreSidebarTrigger";
4278
+ const En = g.forwardRef(
4275
4279
  ({ className: e, children: r }, n) => /* @__PURE__ */ t("div", { ref: n, className: m("vyre-page-content", e), children: r })
4276
4280
  );
4277
- Tn.displayName = "VyrePageContent";
4281
+ En.displayName = "VyrePageContent";
4278
4282
  export {
4279
4283
  Rt as Accordion,
4280
4284
  It as AccordionContent,
@@ -4344,7 +4348,7 @@ export {
4344
4348
  ct as ModalBody,
4345
4349
  ut as ModalFooter,
4346
4350
  dt as ModalHeader,
4347
- Tn as PageContent,
4351
+ En as PageContent,
4348
4352
  wr as Pagination,
4349
4353
  Yt as Popover,
4350
4354
  Ft as Progress,
@@ -4363,7 +4367,7 @@ export {
4363
4367
  kn as SidebarHeader,
4364
4368
  Dn as SidebarItem,
4365
4369
  Ln as SidebarSection,
4366
- In as SidebarTrigger,
4370
+ Tn as SidebarTrigger,
4367
4371
  Ve as Skeleton,
4368
4372
  $t as Slider,
4369
4373
  Vt as Switch,
@@ -4384,9 +4388,9 @@ export {
4384
4388
  Hr as TagsInput,
4385
4389
  fn as Text,
4386
4390
  it as Textarea,
4387
- Bn as ToastProvider,
4391
+ Vn as ToastProvider,
4388
4392
  Dt as Tooltip,
4389
4393
  m as cn,
4390
4394
  ge as useAppLayout,
4391
- Vn as useToast
4395
+ $n as useToast
4392
4396
  };
@@ -1136,7 +1136,7 @@
1136
1136
  max-width: 20rem;
1137
1137
  background: var(--vyre-color-semantic-surface-overlay);
1138
1138
  border: 1px solid var(--vyre-color-semantic-border);
1139
- border-radius: var(--vyre-radius-lg);
1139
+ border-radius: var(--vyre-border-radius-lg);
1140
1140
  box-shadow: var(--vyre-shadow-lg);
1141
1141
  padding: var(--vyre-spacing-3);
1142
1142
  color: var(--vyre-color-semantic-text-primary);
@@ -1169,7 +1169,7 @@
1169
1169
  min-width: 10rem;
1170
1170
  background: var(--vyre-color-semantic-surface-overlay);
1171
1171
  border: 1px solid var(--vyre-color-semantic-border);
1172
- border-radius: var(--vyre-radius-md);
1172
+ border-radius: var(--vyre-border-radius-md);
1173
1173
  box-shadow: var(--vyre-shadow-lg);
1174
1174
  padding: var(--vyre-spacing-1) 0;
1175
1175
  animation: vyre-dropdown-in var(--vyre-transition-duration-fast) var(--vyre-transition-easing-out) forwards;
@@ -1287,7 +1287,7 @@
1287
1287
  align-items: flex-start;
1288
1288
  gap: var(--vyre-spacing-3);
1289
1289
  padding: var(--vyre-spacing-3) var(--vyre-spacing-4);
1290
- border-radius: var(--vyre-radius-md);
1290
+ border-radius: var(--vyre-border-radius-md);
1291
1291
  border-width: 1px;
1292
1292
  border-style: solid;
1293
1293
  font-size: var(--vyre-typography-font-size-sm);
@@ -1345,7 +1345,7 @@
1345
1345
  flex-shrink: 0;
1346
1346
  background: none;
1347
1347
  border: none;
1348
- border-radius: var(--vyre-radius-sm);
1348
+ border-radius: var(--vyre-border-radius-sm);
1349
1349
  color: var(--vyre-color-semantic-text-muted);
1350
1350
  cursor: pointer;
1351
1351
  padding: 2px;
@@ -1385,7 +1385,7 @@
1385
1385
  max-width: 26rem;
1386
1386
  background: var(--vyre-color-semantic-surface-overlay);
1387
1387
  border: 1px solid var(--vyre-color-semantic-border);
1388
- border-radius: var(--vyre-radius-xl);
1388
+ border-radius: var(--vyre-border-radius-xl);
1389
1389
  box-shadow: var(--vyre-shadow-xl);
1390
1390
  padding: var(--vyre-spacing-6);
1391
1391
  animation: vyre-alert-dialog-in var(--vyre-transition-duration-normal) var(--vyre-transition-easing-spring);
@@ -1571,7 +1571,7 @@
1571
1571
  width: 1.875rem;
1572
1572
  height: 1.875rem;
1573
1573
  border: none;
1574
- border-radius: var(--vyre-radius-md);
1574
+ border-radius: var(--vyre-border-radius-md);
1575
1575
  background: none;
1576
1576
  color: var(--vyre-color-semantic-text-secondary);
1577
1577
  cursor: pointer;
@@ -1601,7 +1601,7 @@
1601
1601
  gap: 1px;
1602
1602
  background: var(--vyre-color-semantic-surface-raised);
1603
1603
  border: 1px solid var(--vyre-color-semantic-border);
1604
- border-radius: var(--vyre-radius-lg);
1604
+ border-radius: var(--vyre-border-radius-lg);
1605
1605
  }
1606
1606
  .vyre-pagination__btn {
1607
1607
  display: inline-flex;
@@ -1611,7 +1611,7 @@
1611
1611
  height: 1.75rem;
1612
1612
  padding: 0 var(--vyre-spacing-1);
1613
1613
  border: none;
1614
- border-radius: calc(var(--vyre-radius-lg) - 3px);
1614
+ border-radius: calc(var(--vyre-border-radius-lg) - 3px);
1615
1615
  background: none;
1616
1616
  color: var(--vyre-color-semantic-text-secondary);
1617
1617
  font-size: var(--vyre-typography-font-size-sm);
@@ -1777,7 +1777,7 @@
1777
1777
  .vyre-command {
1778
1778
  background: var(--vyre-color-semantic-surface);
1779
1779
  border: 1px solid var(--vyre-color-semantic-border);
1780
- border-radius: var(--vyre-radius-xl);
1780
+ border-radius: var(--vyre-border-radius-xl);
1781
1781
  overflow: hidden;
1782
1782
  display: flex;
1783
1783
  flex-direction: column;
@@ -1822,7 +1822,7 @@
1822
1822
  justify-content: center;
1823
1823
  width: 1.25rem;
1824
1824
  height: 1.25rem;
1825
- border-radius: var(--vyre-radius-sm);
1825
+ border-radius: var(--vyre-border-radius-sm);
1826
1826
  border: none;
1827
1827
  background: none;
1828
1828
  color: var(--vyre-color-semantic-text-muted);
@@ -1873,7 +1873,7 @@
1873
1873
  gap: var(--vyre-spacing-2);
1874
1874
  padding: var(--vyre-spacing-2) var(--vyre-spacing-3);
1875
1875
  margin: 1px var(--vyre-spacing-2);
1876
- border-radius: var(--vyre-radius-md);
1876
+ border-radius: var(--vyre-border-radius-md);
1877
1877
  font-size: var(--vyre-typography-font-size-sm);
1878
1878
  color: var(--vyre-color-semantic-text-primary);
1879
1879
  cursor: pointer;
@@ -1911,7 +1911,7 @@
1911
1911
  color: var(--vyre-color-semantic-text-muted);
1912
1912
  background: var(--vyre-color-semantic-surface-raised);
1913
1913
  border: 1px solid var(--vyre-color-semantic-border);
1914
- border-radius: var(--vyre-radius-sm);
1914
+ border-radius: var(--vyre-border-radius-sm);
1915
1915
  padding: 1px 5px;
1916
1916
  flex-shrink: 0;
1917
1917
  }
@@ -1931,7 +1931,7 @@
1931
1931
  padding: var(--vyre-spacing-3);
1932
1932
  background: var(--vyre-color-semantic-surface-raised);
1933
1933
  border: 1px solid var(--vyre-color-semantic-border);
1934
- border-radius: var(--vyre-radius-lg);
1934
+ border-radius: var(--vyre-border-radius-lg);
1935
1935
  width: 280px;
1936
1936
  user-select: none;
1937
1937
  }
@@ -1954,14 +1954,14 @@
1954
1954
  border: none;
1955
1955
  cursor: pointer;
1956
1956
  padding: var(--vyre-spacing-1) var(--vyre-spacing-2);
1957
- border-radius: var(--vyre-radius-sm);
1957
+ border-radius: var(--vyre-border-radius-sm);
1958
1958
  font-size: var(--vyre-typography-font-size-sm);
1959
1959
  font-weight: 600;
1960
- color: var(--vyre-color-semantic-text);
1960
+ color: var(--vyre-color-semantic-text-primary);
1961
1961
  transition: background 120ms;
1962
1962
  }
1963
1963
  .vyre-calendar__header-btn:hover {
1964
- background: var(--vyre-color-semantic-surface-hover);
1964
+ background: var(--vyre-color-semantic-surface-raised);
1965
1965
  }
1966
1966
  .vyre-calendar__nav {
1967
1967
  display: flex;
@@ -1971,15 +1971,15 @@
1971
1971
  height: 28px;
1972
1972
  border: none;
1973
1973
  background: none;
1974
- border-radius: var(--vyre-radius-sm);
1974
+ border-radius: var(--vyre-border-radius-sm);
1975
1975
  cursor: pointer;
1976
1976
  color: var(--vyre-color-semantic-text-muted);
1977
1977
  transition: background 120ms, color 120ms;
1978
1978
  flex-shrink: 0;
1979
1979
  }
1980
1980
  .vyre-calendar__nav:hover {
1981
- background: var(--vyre-color-semantic-surface-hover);
1982
- color: var(--vyre-color-semantic-text);
1981
+ background: var(--vyre-color-semantic-surface-raised);
1982
+ color: var(--vyre-color-semantic-text-primary);
1983
1983
  }
1984
1984
 
1985
1985
  /* Day grid */
@@ -2002,15 +2002,15 @@
2002
2002
  justify-content: center;
2003
2003
  border: none;
2004
2004
  background: none;
2005
- border-radius: var(--vyre-radius-sm);
2005
+ border-radius: var(--vyre-border-radius-sm);
2006
2006
  font-size: var(--vyre-typography-font-size-sm);
2007
- color: var(--vyre-color-semantic-text);
2007
+ color: var(--vyre-color-semantic-text-primary);
2008
2008
  cursor: pointer;
2009
2009
  transition: background 100ms, color 100ms;
2010
2010
  position: relative;
2011
2011
  }
2012
2012
  .vyre-calendar__day:hover:not(:disabled) {
2013
- background: var(--vyre-color-semantic-surface-hover);
2013
+ background: var(--vyre-color-semantic-surface-raised);
2014
2014
  }
2015
2015
  .vyre-calendar__day--today {
2016
2016
  font-weight: 700;
@@ -2031,7 +2031,7 @@
2031
2031
  background: var(--vyre-color-semantic-accent) !important;
2032
2032
  color: var(--vyre-color-semantic-accent-foreground) !important;
2033
2033
  font-weight: 600;
2034
- border-radius: var(--vyre-radius-sm);
2034
+ border-radius: var(--vyre-border-radius-sm);
2035
2035
  }
2036
2036
  .vyre-calendar__day--selected.vyre-calendar__day--today::after {
2037
2037
  background: var(--vyre-color-semantic-accent-foreground);
@@ -2043,12 +2043,12 @@
2043
2043
  .vyre-calendar__day--range-start {
2044
2044
  background: var(--vyre-color-semantic-accent) !important;
2045
2045
  color: var(--vyre-color-semantic-accent-foreground) !important;
2046
- border-radius: var(--vyre-radius-sm) 0 0 var(--vyre-radius-sm);
2046
+ border-radius: var(--vyre-border-radius-sm) 0 0 var(--vyre-border-radius-sm);
2047
2047
  }
2048
2048
  .vyre-calendar__day--range-end {
2049
2049
  background: var(--vyre-color-semantic-accent) !important;
2050
2050
  color: var(--vyre-color-semantic-accent-foreground) !important;
2051
- border-radius: 0 var(--vyre-radius-sm) var(--vyre-radius-sm) 0;
2051
+ border-radius: 0 var(--vyre-border-radius-sm) var(--vyre-border-radius-sm) 0;
2052
2052
  }
2053
2053
  .vyre-calendar__day--disabled {
2054
2054
  color: var(--vyre-color-semantic-text-muted);
@@ -2066,15 +2066,15 @@
2066
2066
  padding: var(--vyre-spacing-2);
2067
2067
  border: none;
2068
2068
  background: none;
2069
- border-radius: var(--vyre-radius-sm);
2069
+ border-radius: var(--vyre-border-radius-sm);
2070
2070
  font-size: var(--vyre-typography-font-size-sm);
2071
- color: var(--vyre-color-semantic-text);
2071
+ color: var(--vyre-color-semantic-text-primary);
2072
2072
  cursor: pointer;
2073
2073
  transition: background 100ms;
2074
2074
  text-align: center;
2075
2075
  }
2076
2076
  .vyre-calendar__month-cell:hover {
2077
- background: var(--vyre-color-semantic-surface-hover);
2077
+ background: var(--vyre-color-semantic-surface-raised);
2078
2078
  }
2079
2079
  .vyre-calendar__month-cell--active {
2080
2080
  background: var(--vyre-color-semantic-accent);
@@ -2092,15 +2092,15 @@
2092
2092
  padding: var(--vyre-spacing-2);
2093
2093
  border: none;
2094
2094
  background: none;
2095
- border-radius: var(--vyre-radius-sm);
2095
+ border-radius: var(--vyre-border-radius-sm);
2096
2096
  font-size: var(--vyre-typography-font-size-sm);
2097
- color: var(--vyre-color-semantic-text);
2097
+ color: var(--vyre-color-semantic-text-primary);
2098
2098
  cursor: pointer;
2099
2099
  transition: background 100ms;
2100
2100
  text-align: center;
2101
2101
  }
2102
2102
  .vyre-calendar__year-cell:hover {
2103
- background: var(--vyre-color-semantic-surface-hover);
2103
+ background: var(--vyre-color-semantic-surface-raised);
2104
2104
  }
2105
2105
  .vyre-calendar__year-cell--active {
2106
2106
  background: var(--vyre-color-semantic-accent);
@@ -2121,9 +2121,9 @@
2121
2121
  width: 44px;
2122
2122
  padding: var(--vyre-spacing-1) var(--vyre-spacing-2);
2123
2123
  border: 1px solid var(--vyre-color-semantic-border);
2124
- border-radius: var(--vyre-radius-sm);
2124
+ border-radius: var(--vyre-border-radius-sm);
2125
2125
  background: var(--vyre-color-semantic-surface);
2126
- color: var(--vyre-color-semantic-text);
2126
+ color: var(--vyre-color-semantic-text-primary);
2127
2127
  font-size: var(--vyre-typography-font-size-sm);
2128
2128
  text-align: center;
2129
2129
  -moz-appearance: textfield;
@@ -2153,8 +2153,8 @@
2153
2153
  padding: var(--vyre-spacing-2) var(--vyre-spacing-3);
2154
2154
  background: var(--vyre-color-semantic-surface);
2155
2155
  border: 1px solid var(--vyre-color-semantic-border);
2156
- border-radius: var(--vyre-radius-md);
2157
- color: var(--vyre-color-semantic-text);
2156
+ border-radius: var(--vyre-border-radius-md);
2157
+ color: var(--vyre-color-semantic-text-primary);
2158
2158
  font-size: var(--vyre-typography-font-size-sm);
2159
2159
  cursor: pointer;
2160
2160
  min-width: 200px;
@@ -2187,11 +2187,11 @@
2187
2187
  cursor: pointer;
2188
2188
  color: var(--vyre-color-semantic-text-muted);
2189
2189
  padding: 2px;
2190
- border-radius: var(--vyre-radius-sm);
2190
+ border-radius: var(--vyre-border-radius-sm);
2191
2191
  flex-shrink: 0;
2192
2192
  }
2193
2193
  .vyre-datepicker__clear:hover {
2194
- color: var(--vyre-color-semantic-text);
2194
+ color: var(--vyre-color-semantic-text-primary);
2195
2195
  }
2196
2196
 
2197
2197
  /* DatePicker popover */
@@ -2199,7 +2199,7 @@
2199
2199
  position: absolute;
2200
2200
  z-index: 1060;
2201
2201
  box-shadow: var(--vyre-shadow-lg);
2202
- border-radius: var(--vyre-radius-lg);
2202
+ border-radius: var(--vyre-border-radius-lg);
2203
2203
  animation: vyre-fade-in 120ms ease;
2204
2204
  }
2205
2205
 
@@ -2209,7 +2209,7 @@
2209
2209
  font-family: var(--vyre-typography-font-family-body);
2210
2210
  font-size: var(--vyre-typography-font-size-sm);
2211
2211
  line-height: var(--vyre-typography-line-height-normal);
2212
- color: var(--vyre-color-semantic-text);
2212
+ color: var(--vyre-color-semantic-text-primary);
2213
2213
  margin: 0;
2214
2214
  }
2215
2215
  .vyre-text--xs { font-size: var(--vyre-typography-font-size-xs); }
@@ -2217,7 +2217,7 @@
2217
2217
  .vyre-text--lg { font-size: var(--vyre-typography-font-size-lg); }
2218
2218
  .vyre-text--xl { font-size: var(--vyre-typography-font-size-xl); }
2219
2219
 
2220
- .vyre-text--normal { font-weight: var(--vyre-typography-font-weight-normal); }
2220
+ .vyre-text--normal { font-weight: var(--vyre-typography-font-weight-regular); }
2221
2221
  .vyre-text--medium { font-weight: var(--vyre-typography-font-weight-medium); }
2222
2222
  .vyre-text--semibold { font-weight: var(--vyre-typography-font-weight-semibold); }
2223
2223
  .vyre-text--bold { font-weight: var(--vyre-typography-font-weight-bold); }
@@ -2242,7 +2242,7 @@
2242
2242
  font-family: var(--vyre-typography-font-family-body);
2243
2243
  font-weight: var(--vyre-typography-font-weight-bold);
2244
2244
  line-height: var(--vyre-typography-line-height-tight);
2245
- color: var(--vyre-color-semantic-text);
2245
+ color: var(--vyre-color-semantic-text-primary);
2246
2246
  margin: 0;
2247
2247
  }
2248
2248
  .vyre-heading--xs { font-size: var(--vyre-typography-font-size-sm); }
@@ -2253,7 +2253,7 @@
2253
2253
  .vyre-heading--2xl { font-size: var(--vyre-typography-font-size-3xl); }
2254
2254
  .vyre-heading--3xl { font-size: var(--vyre-typography-font-size-4xl); }
2255
2255
 
2256
- .vyre-heading--normal { font-weight: var(--vyre-typography-font-weight-normal); }
2256
+ .vyre-heading--normal { font-weight: var(--vyre-typography-font-weight-regular); }
2257
2257
  .vyre-heading--medium { font-weight: var(--vyre-typography-font-weight-medium); }
2258
2258
  .vyre-heading--semibold { font-weight: var(--vyre-typography-font-weight-semibold); }
2259
2259
 
@@ -2270,21 +2270,21 @@
2270
2270
  font-size: 0.875em;
2271
2271
  background: var(--vyre-color-semantic-surface-raised);
2272
2272
  border: 1px solid var(--vyre-color-semantic-border-subtle);
2273
- border-radius: var(--vyre-radius-sm);
2273
+ border-radius: var(--vyre-border-radius-sm);
2274
2274
  padding: 1px 6px;
2275
- color: var(--vyre-color-semantic-text);
2275
+ color: var(--vyre-color-semantic-text-primary);
2276
2276
  }
2277
2277
  .vyre-code-block {
2278
2278
  font-family: var(--vyre-typography-font-family-mono);
2279
2279
  font-size: var(--vyre-typography-font-size-sm);
2280
2280
  background: var(--vyre-color-semantic-surface-raised);
2281
2281
  border: 1px solid var(--vyre-color-semantic-border);
2282
- border-radius: var(--vyre-radius-md);
2282
+ border-radius: var(--vyre-border-radius-md);
2283
2283
  padding: var(--vyre-spacing-4);
2284
2284
  overflow-x: auto;
2285
2285
  margin: 0;
2286
2286
  line-height: var(--vyre-typography-line-height-relaxed);
2287
- color: var(--vyre-color-semantic-text);
2287
+ color: var(--vyre-color-semantic-text-primary);
2288
2288
  }
2289
2289
  .vyre-code-block code {
2290
2290
  background: none;
@@ -2302,7 +2302,7 @@
2302
2302
  font-style: italic;
2303
2303
  line-height: var(--vyre-typography-line-height-relaxed);
2304
2304
  background: color-mix(in srgb, var(--vyre-color-semantic-accent) 6%, transparent);
2305
- border-radius: 0 var(--vyre-radius-sm) var(--vyre-radius-sm) 0;
2305
+ border-radius: 0 var(--vyre-border-radius-sm) var(--vyre-border-radius-sm) 0;
2306
2306
  }
2307
2307
 
2308
2308
  /* ── Sidebar ────────────────────────────────────────────────── */
@@ -2311,7 +2311,10 @@
2311
2311
  display: flex;
2312
2312
  flex-direction: column;
2313
2313
  width: 240px;
2314
- height: 100%;
2314
+ /* No explicit height: as a flex child of .vyre-app-layout (which is
2315
+ min-height: 100vh) it stretches to the layout height automatically,
2316
+ so __content (flex: 1) pushes __footer to the bottom. */
2317
+ align-self: stretch;
2315
2318
  background: var(--vyre-color-semantic-surface);
2316
2319
  border-right: 1px solid var(--vyre-color-semantic-border-subtle);
2317
2320
  padding: var(--vyre-spacing-4) 0;
@@ -2322,7 +2325,7 @@
2322
2325
  }
2323
2326
  .vyre-sidebar--floating {
2324
2327
  border: 1px solid var(--vyre-color-semantic-border);
2325
- border-radius: var(--vyre-radius-lg);
2328
+ border-radius: var(--vyre-border-radius-lg);
2326
2329
  box-shadow: var(--vyre-shadow-md);
2327
2330
  min-height: auto;
2328
2331
  }
@@ -2344,7 +2347,7 @@
2344
2347
  .vyre-sidebar__title {
2345
2348
  font-size: var(--vyre-typography-font-size-sm);
2346
2349
  font-weight: var(--vyre-typography-font-weight-semibold);
2347
- color: var(--vyre-color-semantic-text);
2350
+ color: var(--vyre-color-semantic-text-primary);
2348
2351
  overflow: hidden;
2349
2352
  text-overflow: ellipsis;
2350
2353
  white-space: nowrap;
@@ -2352,6 +2355,19 @@
2352
2355
  }
2353
2356
  .vyre-sidebar--collapsed .vyre-sidebar__title { display: none; }
2354
2357
 
2358
+ /* Collapsed: center the logo / footer content and trim padding so
2359
+ nothing overflows the 56px rail. */
2360
+ .vyre-sidebar--collapsed .vyre-sidebar__header {
2361
+ justify-content: center;
2362
+ padding-left: 0;
2363
+ padding-right: 0;
2364
+ }
2365
+ .vyre-sidebar--collapsed .vyre-sidebar__footer {
2366
+ padding-left: 0;
2367
+ padding-right: 0;
2368
+ text-align: center;
2369
+ }
2370
+
2355
2371
  .vyre-sidebar__content {
2356
2372
  flex: 1;
2357
2373
  overflow-y: auto;
@@ -2384,7 +2400,7 @@
2384
2400
  align-items: center;
2385
2401
  gap: var(--vyre-spacing-2);
2386
2402
  padding: var(--vyre-spacing-2) var(--vyre-spacing-2);
2387
- border-radius: var(--vyre-radius-md);
2403
+ border-radius: var(--vyre-border-radius-md);
2388
2404
  font-size: var(--vyre-typography-font-size-sm);
2389
2405
  color: var(--vyre-color-semantic-text-muted);
2390
2406
  cursor: pointer;
@@ -2397,8 +2413,8 @@
2397
2413
  position: relative;
2398
2414
  }
2399
2415
  .vyre-sidebar__item:hover {
2400
- background: var(--vyre-color-semantic-surface-hover);
2401
- color: var(--vyre-color-semantic-text);
2416
+ background: var(--vyre-color-semantic-surface-raised);
2417
+ color: var(--vyre-color-semantic-text-primary);
2402
2418
  }
2403
2419
  .vyre-sidebar__item--active {
2404
2420
  background: color-mix(in srgb, var(--vyre-color-semantic-accent) 12%, transparent);
@@ -2449,15 +2465,15 @@
2449
2465
  height: 28px;
2450
2466
  border: none;
2451
2467
  background: none;
2452
- border-radius: var(--vyre-radius-sm);
2468
+ border-radius: var(--vyre-border-radius-sm);
2453
2469
  cursor: pointer;
2454
2470
  color: var(--vyre-color-semantic-text-muted);
2455
2471
  transition: background 120ms, color 120ms;
2456
2472
  flex-shrink: 0;
2457
2473
  }
2458
2474
  .vyre-sidebar__toggle:hover {
2459
- background: var(--vyre-color-semantic-surface-hover);
2460
- color: var(--vyre-color-semantic-text);
2475
+ background: var(--vyre-color-semantic-surface-raised);
2476
+ color: var(--vyre-color-semantic-text-primary);
2461
2477
  }
2462
2478
 
2463
2479
  .vyre-app-layout {
@@ -2493,15 +2509,15 @@
2493
2509
  height: 32px;
2494
2510
  border: none;
2495
2511
  background: none;
2496
- border-radius: var(--vyre-radius-sm);
2512
+ border-radius: var(--vyre-border-radius-sm);
2497
2513
  cursor: pointer;
2498
2514
  color: var(--vyre-color-semantic-text-muted);
2499
2515
  transition: background 120ms, color 120ms;
2500
2516
  flex-shrink: 0;
2501
2517
  }
2502
2518
  .vyre-sidebar-trigger:hover {
2503
- background: var(--vyre-color-semantic-surface-hover);
2504
- color: var(--vyre-color-semantic-text);
2519
+ background: var(--vyre-color-semantic-surface-raised);
2520
+ color: var(--vyre-color-semantic-text-primary);
2505
2521
  }
2506
2522
 
2507
2523
  .vyre-page-content {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@usevyre/react",
3
- "version": "1.2.0",
3
+ "version": "1.2.1",
4
4
  "description": "useVyre React components — AI-native, accessible, zero-runtime styling",
5
5
  "keywords": [
6
6
  "design-system",