@usevyre/react 1.0.3 → 1.2.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/ButtonGroup/ButtonGroup.d.ts +50 -0
- package/dist/components/Calendar/Calendar.d.ts +12 -11
- package/dist/components/Calendar/DatePicker.d.ts +32 -0
- package/dist/components/Combobox/Combobox.d.ts +66 -0
- package/dist/components/Conversation/Conversation.d.ts +115 -0
- package/dist/components/DataGrid/DataGrid.d.ts +66 -0
- package/dist/components/DateRangePicker/DateRangePicker.d.ts +58 -0
- package/dist/components/Input/Input.d.ts +22 -1
- package/dist/components/Item/Item.d.ts +74 -0
- package/dist/components/Kanban/Kanban.d.ts +76 -0
- package/dist/components/Radio/Radio.d.ts +77 -0
- package/dist/components/RichTextEditor/RichTextEditor.d.ts +44 -0
- package/dist/components/Tag/Tag.d.ts +41 -0
- package/dist/components/Tag/TagGroup.d.ts +34 -0
- package/dist/components/TagsInput/TagsInput.d.ts +51 -0
- package/dist/index.cjs +1 -1
- package/dist/index.d.ts +43 -4
- package/dist/index.js +2909 -1390
- package/dist/styles/components.css +1352 -0
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const t=require("react/jsx-runtime"),n=require("react"),H=require("react-dom");function m(...e){const a=[];for(const r of e)if(r){if(typeof r=="string")a.push(r);else if(Array.isArray(r)){const s=m(...r);s&&a.push(s)}else if(typeof r=="object")for(const[s,o]of Object.entries(r))o&&a.push(s)}return a.join(" ")}const zt={primary:"vyre-btn--primary",secondary:"vyre-btn--secondary",ghost:"vyre-btn--ghost",accent:"vyre-btn--accent",teal:"vyre-btn--teal",danger:"vyre-btn--danger"},Zt={sm:"vyre-btn--sm",md:"vyre-btn--md",lg:"vyre-btn--lg",icon:"vyre-btn--icon"},ue=n.forwardRef(({variant:e="secondary",size:a="md",loading:r=!1,disabled:s,leftIcon:o,rightIcon:i,className:d,children:l,as:c="button",...x},b)=>{const y=s||r;return t.jsxs(c,{ref:b,className:m("vyre-btn",zt[e],Zt[a],r&&"vyre-btn--loading",d),disabled:c==="button"?y:void 0,"aria-disabled":y,"data-variant":e,"data-size":a,...x,children:[r&&t.jsx("span",{className:"vyre-btn__spinner","aria-hidden":"true",children:t.jsx(Jt,{})}),!r&&o&&t.jsx("span",{className:"vyre-btn__icon vyre-btn__icon--left","aria-hidden":"true",children:o}),l&&t.jsx("span",{className:"vyre-btn__label",children:l}),i&&t.jsx("span",{className:"vyre-btn__icon vyre-btn__icon--right","aria-hidden":"true",children:i})]})});ue.displayName="VyreButton";function Jt(){return t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",xmlns:"http://www.w3.org/2000/svg",className:"vyre-spinner","aria-hidden":"true",children:t.jsx("circle",{cx:"7",cy:"7",r:"5.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeDasharray:"28",strokeDashoffset:"10"})})}const me=n.forwardRef(({variant:e="default",dot:a=!1,className:r,children:s,...o},i)=>t.jsxs("span",{ref:i,className:m("vyre-badge",`vyre-badge--${e}`,r),"data-variant":e,...o,children:[a&&t.jsx("span",{className:"vyre-badge__dot","aria-hidden":"true"}),s]}));me.displayName="VyreBadge";const ve=n.forwardRef(({variant:e="default",hoverable:a=!1,clickable:r=!1,className:s,children:o,...i},d)=>t.jsx("div",{ref:d,className:m("vyre-card",`vyre-card--${e}`,a&&"vyre-card--hoverable",r&&"vyre-card--clickable",s),"data-variant":e,role:r?"button":void 0,tabIndex:r?0:void 0,...i,children:o}));ve.displayName="VyreCard";const ye=n.forwardRef(({className:e,children:a,...r},s)=>t.jsx("div",{ref:s,className:m("vyre-card__header",e),...r,children:a}));ye.displayName="VyreCardHeader";const fe=n.forwardRef(({className:e,children:a,...r},s)=>t.jsx("div",{ref:s,className:m("vyre-card__body",e),...r,children:a}));fe.displayName="VyreCardBody";const he=n.forwardRef(({className:e,children:a,...r},s)=>t.jsx("div",{ref:s,className:m("vyre-card__footer",e),...r,children:a}));he.displayName="VyreCardFooter";const be=n.forwardRef(({label:e,hint:a,state:r="idle",required:s=!1,htmlFor:o,className:i,children:d,...l},c)=>t.jsxs("div",{ref:c,className:m("vyre-field",r!=="idle"&&`vyre-field--${r}`,i),"data-state":r,...l,children:[e&&t.jsxs("label",{className:"vyre-field__label",htmlFor:o,children:[e,s&&t.jsx("span",{className:"vyre-field__required","aria-label":"required",children:"*"})]}),d,a&&t.jsx("span",{className:"vyre-field__hint",role:r==="error"?"alert":void 0,children:a})]}));be.displayName="VyreField";const xe=n.forwardRef(({size:e="md",leftElement:a,rightElement:r,className:s,...o},i)=>a||r?t.jsxs("div",{className:m("vyre-input-wrapper",`vyre-input-wrapper--${e}`),children:[a&&t.jsx("span",{className:"vyre-input__element vyre-input__element--left","aria-hidden":"true",children:a}),t.jsx("input",{ref:i,className:m("vyre-input",`vyre-input--${e}`,!!a&&"vyre-input--has-left",!!r&&"vyre-input--has-right",s),...o}),r&&t.jsx("span",{className:"vyre-input__element vyre-input__element--right","aria-hidden":"true",children:r})]}):t.jsx("input",{ref:i,className:m("vyre-input",`vyre-input--${e}`,s),...o}));xe.displayName="VyreInput";const pe=n.forwardRef(({size:e="md",resize:a="vertical",className:r,style:s,...o},i)=>t.jsx("textarea",{ref:i,className:m("vyre-textarea",`vyre-textarea--${e}`,r),style:{resize:a,...s},...o}));pe.displayName="VyreTextarea";const Qt=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(","),_e=n.forwardRef(({open:e,onClose:a,size:r="md",closeOnBackdrop:s=!0,closeOnEsc:o=!0,initialFocus:i,className:d,children:l,"aria-label":c,"aria-labelledby":x,...b},y)=>{const f=n.useRef(null),p=n.useRef(null),u=n.useCallback(h=>{f.current=h,typeof y=="function"?y(h):y&&(y.current=h)},[y]),v=n.useCallback(h=>{if(h.key!=="Tab")return;const g=f.current;if(!g)return;const N=Array.from(g.querySelectorAll(Qt));if(!N.length)return;const T=N[0],E=N[N.length-1];h.shiftKey&&document.activeElement===T?(h.preventDefault(),E.focus()):!h.shiftKey&&document.activeElement===E&&(h.preventDefault(),T.focus())},[]),_=n.useCallback(h=>{h.key==="Escape"&&o&&a()},[o,a]);return n.useEffect(()=>{if(!e)return;document.addEventListener("keydown",_),document.addEventListener("keydown",v);const h=document.body.style.overflow;document.body.style.overflow="hidden";const g=setTimeout(()=>{var N;i!=null&&i.current?i.current.focus():(N=f.current)==null||N.focus()},0);return()=>{document.removeEventListener("keydown",_),document.removeEventListener("keydown",v),document.body.style.overflow=h,clearTimeout(g)}},[e,_,v,i]),e?H.createPortal(t.jsx("div",{ref:p,className:"vyre-modal-backdrop",onClick:h=>{s&&h.target===p.current&&a()},role:"presentation",children:t.jsx("div",{ref:u,className:m("vyre-modal",`vyre-modal--${r}`,d),role:"dialog","aria-modal":"true","aria-label":c,"aria-labelledby":x,tabIndex:-1,...b,children:l})}),document.body):null});_e.displayName="VyreModal";const we=n.forwardRef(({className:e,children:a,...r},s)=>t.jsx("div",{ref:s,className:m("vyre-modal__header",e),...r,children:a}));we.displayName="VyreModalHeader";const je=n.forwardRef(({className:e,children:a,...r},s)=>t.jsx("div",{ref:s,className:m("vyre-modal__body",e),...r,children:a}));je.displayName="VyreModalBody";const ge=n.forwardRef(({className:e,children:a,...r},s)=>t.jsx("div",{ref:s,className:m("vyre-modal__footer",e),...r,children:a}));ge.displayName="VyreModalFooter";const ke=n.createContext(null);function er(e,a){switch(a.type){case"ADD":return[...e,a.payload];case"REMOVE":return e.filter(r=>r.id!==a.id);default:return e}}let tr=0;const rr=()=>`vyre-t-${++tr}`;function ar({children:e}){const[a,r]=n.useReducer(er,[]),s=n.useCallback(i=>{const d=rr();return r({type:"ADD",payload:{...i,id:d}}),d},[]),o=n.useCallback(i=>{r({type:"REMOVE",id:i})},[]);return t.jsxs(ke.Provider,{value:{toast:s,dismiss:o},children:[e,typeof document<"u"&&H.createPortal(t.jsx("div",{className:"vyre-toast-viewport","aria-live":"polite","aria-atomic":"false","aria-label":"Notifications",children:a.map(i=>t.jsx(sr,{...i,onDismiss:()=>o(i.id)},i.id))}),document.body)]})}function nr(){const e=n.useContext(ke);if(!e)throw new Error("useToast must be used inside <ToastProvider>");return e}function sr({title:e,description:a,variant:r="default",duration:s=4e3,onDismiss:o}){return n.useEffect(()=>{if(s===1/0)return;const i=setTimeout(o,s);return()=>clearTimeout(i)},[s,o]),t.jsxs("div",{className:m("vyre-toast",`vyre-toast--${r}`),role:"alert","data-variant":r,children:[t.jsxs("div",{className:"vyre-toast__content",children:[e&&t.jsx("p",{className:"vyre-toast__title",children:e}),a&&t.jsx("p",{className:"vyre-toast__description",children:a})]}),t.jsx("button",{className:"vyre-toast__close",onClick:o,"aria-label":"Dismiss notification",type:"button",children:t.jsx(or,{})})]})}function or(){return t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M10.5 3.5L3.5 10.5M3.5 3.5L10.5 10.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})}const Ne=n.forwardRef(({options:e,value:a,defaultValue:r,onChange:s,placeholder:o="Select an option",disabled:i=!1,size:d="md",className:l,...c},x)=>{const b=a!==void 0,[y,f]=n.useState(r??""),p=b?a:y,[u,v]=n.useState(!1),[_,h]=n.useState(-1),g=n.useRef(null),N=n.useRef(null),E=`${n.useId()}-listbox`,W=e.find(j=>j.value===p),V=e.filter(j=>!j.disabled),B=n.useCallback(()=>{v(!1),h(-1)},[]),L=n.useCallback(j=>{var S;j.disabled||(b||f(j.value),s==null||s(j.value),B(),(S=g.current)==null||S.focus())},[b,s,B]);n.useEffect(()=>{if(!u)return;const j=S=>{const R=x==null?void 0:x.current;R&&!R.contains(S.target)&&B()};return document.addEventListener("mousedown",j),()=>document.removeEventListener("mousedown",j)},[u,x,B]),n.useEffect(()=>{var S;if(!u||_<0)return;const j=(S=N.current)==null?void 0:S.children[_];j==null||j.scrollIntoView({block:"nearest"})},[_,u]);const I=j=>{switch(j.key){case"Enter":case" ":case"ArrowDown":{if(j.preventDefault(),!u){v(!0);const S=e.findIndex(R=>R.value===p);h(S>=0?S:0)}break}case"ArrowUp":{j.preventDefault(),u||(v(!0),h(e.length-1));break}case"Escape":{B();break}}},C=j=>{var S;switch(j.key){case"ArrowDown":{j.preventDefault(),h(R=>{let M=R+1;for(;M<e.length&&e[M].disabled;)M++;return M<e.length?M:R});break}case"ArrowUp":{j.preventDefault(),h(R=>{let M=R-1;for(;M>=0&&e[M].disabled;)M--;return M>=0?M:R});break}case"Enter":case" ":{j.preventDefault(),_>=0&&L(e[_]);break}case"Escape":case"Tab":{B(),(S=g.current)==null||S.focus();break}case"Home":{j.preventDefault();const R=e.findIndex(M=>!M.disabled);R>=0&&h(R);break}case"End":{j.preventDefault();const R=[...e].reverse().findIndex(M=>!M.disabled);R>=0&&h(e.length-1-R);break}}};return t.jsxs("div",{ref:x,className:m("vyre-select",`vyre-select--${d}`,l),"data-open":u,...c,children:[t.jsxs("button",{ref:g,type:"button",className:"vyre-select__trigger","aria-haspopup":"listbox","aria-expanded":u,"aria-controls":E,"aria-disabled":i,disabled:i,onClick:()=>{i||v(j=>{if(!j){const S=e.findIndex(R=>R.value===p);h(S>=0?S:0)}return!j})},onKeyDown:I,children:[W?t.jsx("span",{className:"vyre-select__value",children:W.label}):t.jsx("span",{className:"vyre-select__placeholder",children:o}),t.jsx(ir,{})]}),u&&t.jsxs("ul",{ref:N,id:E,role:"listbox",className:"vyre-select__dropdown","aria-label":"Options",tabIndex:-1,onKeyDown:C,children:[e.map((j,S)=>t.jsxs("li",{role:"option","aria-selected":j.value===p,"aria-disabled":j.disabled,"data-highlighted":S===_,className:"vyre-select__option",onMouseEnter:()=>!j.disabled&&h(S),onMouseDown:R=>{R.preventDefault(),L(j)},children:[j.label,j.value===p&&t.jsx(lr,{})]},j.value)),V.length===0&&t.jsx("li",{className:"vyre-select__empty",role:"presentation",children:"No options available"})]})]})});Ne.displayName="VyreSelect";function ir(){return t.jsx("svg",{className:"vyre-select__chevron",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M3 5L7 9L11 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}function lr(){return t.jsx("svg",{className:"vyre-select__check",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M2.5 7L5.5 10L11.5 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}const Ce=n.createContext(null);function Se(){const e=n.useContext(Ce);if(!e)throw new Error("Tab components must be used inside <Tabs>");return e}const Re=n.forwardRef(({defaultValue:e="",value:a,onChange:r,className:s,children:o,...i},d)=>{const l=a!==void 0,[c,x]=n.useState(e),b=l?a:c,y=n.useId(),f=n.useCallback(p=>{l||x(p),r==null||r(p)},[l,r]);return t.jsx(Ce.Provider,{value:{value:b,onChange:f,baseId:y},children:t.jsx("div",{ref:d,className:m("vyre-tabs",s),...i,children:o})})});Re.displayName="VyreTabs";const Le=n.forwardRef(({className:e,children:a,"aria-label":r,...s},o)=>{const i=n.useRef(null),d=l=>{var y;const c=Array.from(((y=i.current)==null?void 0:y.querySelectorAll('[role="tab"]:not([disabled])'))??[]),x=c.findIndex(f=>f===document.activeElement);if(x<0)return;let b=x;if(l.key==="ArrowRight")b=(x+1)%c.length;else if(l.key==="ArrowLeft")b=(x-1+c.length)%c.length;else if(l.key==="Home")b=0;else if(l.key==="End")b=c.length-1;else return;l.preventDefault(),c[b].focus(),c[b].click()};return t.jsx("div",{ref:l=>{i.current=l,typeof o=="function"?o(l):o&&(o.current=l)},role:"tablist",className:m("vyre-tabs__list",e),"aria-label":r,onKeyDown:d,...s,children:a})});Le.displayName="VyreTabList";const Me=n.forwardRef(({value:e,disabled:a=!1,className:r,children:s,...o},i)=>{const{value:d,onChange:l,baseId:c}=Se(),x=e===d;return t.jsx("button",{ref:i,role:"tab",type:"button",id:`${c}-tab-${e}`,"aria-controls":`${c}-panel-${e}`,"aria-selected":x,disabled:a,tabIndex:x?0:-1,className:m("vyre-tabs__tab",x&&"vyre-tabs__tab--active",r),"data-selected":x,onClick:()=>!a&&l(e),...o,children:s})});Me.displayName="VyreTab";const Te=n.forwardRef(({className:e,children:a,...r},s)=>t.jsx("div",{ref:s,className:m("vyre-tabs__panels",e),...r,children:a}));Te.displayName="VyreTabPanels";const Ee=n.forwardRef(({value:e,className:a,children:r,...s},o)=>{const{value:i,baseId:d}=Se();return e===i?t.jsx("div",{ref:o,role:"tabpanel",id:`${d}-panel-${e}`,"aria-labelledby":`${d}-tab-${e}`,tabIndex:0,className:m("vyre-tabs__panel",a),...s,children:r}):null});Ee.displayName="VyreTabPanel";const cr=120,Ie=({content:e,placement:a="top",delay:r=300,children:s,className:o})=>{const[i,d]=n.useState("hidden"),l=n.useRef(null),c=n.useRef(null),x=n.useId(),b=n.useCallback(()=>{c.current&&(clearTimeout(c.current),c.current=null),l.current=setTimeout(()=>d("visible"),r)},[r]),y=n.useCallback(()=>{l.current&&(clearTimeout(l.current),l.current=null),d("leaving"),c.current=setTimeout(()=>d("hidden"),cr)},[]),f=n.Children.only(s),p=n.cloneElement(f,{onMouseEnter:u=>{var v,_;b(),(_=(v=f.props).onMouseEnter)==null||_.call(v,u)},onMouseLeave:u=>{var v,_;y(),(_=(v=f.props).onMouseLeave)==null||_.call(v,u)},onFocus:u=>{var v,_;d("visible"),(_=(v=f.props).onFocus)==null||_.call(v,u)},onBlur:u=>{var v,_;y(),(_=(v=f.props).onBlur)==null||_.call(v,u)},"aria-describedby":i!=="hidden"?x:void 0});return t.jsxs("span",{className:m("vyre-tooltip-wrapper",o),children:[p,i!=="hidden"&&t.jsxs("span",{id:x,role:"tooltip",className:m("vyre-tooltip",`vyre-tooltip--${a}`,i==="leaving"&&"vyre-tooltip--leaving"),"data-placement":a,children:[e,t.jsx("span",{className:"vyre-tooltip__arrow","aria-hidden":"true"})]})]})};Ie.displayName="VyreTooltip";const De=n.createContext(null);function Ae(){const e=n.useContext(De);if(!e)throw new Error("AccordionItem must be used within Accordion");return e}const Be=n.forwardRef(({type:e="single",defaultValue:a,value:r,onValueChange:s,className:o,children:i,...d},l)=>{const c=p=>p===void 0?[]:Array.isArray(p)?p:[p],[x,b]=n.useState(c(a)),y=r!==void 0?c(r):x,f=n.useCallback(p=>{let u;e==="single"?u=y.includes(p)?[]:[p]:u=y.includes(p)?y.filter(v=>v!==p):[...y,p],r===void 0&&b(u),s==null||s(e==="single"?u[0]??"":u)},[e,y,r,s]);return t.jsx(De.Provider,{value:{type:e,value:y,toggle:f},children:t.jsx("div",{ref:l,className:["vyre-accordion",o].filter(Boolean).join(" "),...d,children:i})})});Be.displayName="Accordion";const ne=n.createContext(null),Ve=n.forwardRef(({value:e,className:a,children:r,...s},o)=>{const{value:i}=Ae(),d=i.includes(e);return t.jsx(ne.Provider,{value:{itemValue:e,isOpen:d},children:t.jsx("div",{ref:o,"data-state":d?"open":"closed",className:["vyre-accordion__item",a].filter(Boolean).join(" "),...s,children:r})})});Ve.displayName="AccordionItem";const $e=n.forwardRef(({className:e,children:a,...r},s)=>{const{toggle:o}=Ae(),i=n.useContext(ne);if(!i)throw new Error("AccordionTrigger must be used within AccordionItem");const{itemValue:d,isOpen:l}=i;return t.jsxs("button",{ref:s,type:"button","aria-expanded":l,"data-state":l?"open":"closed",className:["vyre-accordion__trigger",e].filter(Boolean).join(" "),onClick:()=>o(d),...r,children:[t.jsx("span",{className:"vyre-accordion__trigger-text",children:a}),t.jsx("svg",{className:"vyre-accordion__chevron",width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M4 6l4 4 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})]})});$e.displayName="AccordionTrigger";const We=n.forwardRef(({className:e,children:a,...r},s)=>{const o=n.useContext(ne);if(!o)throw new Error("AccordionContent must be used within AccordionItem");const{isOpen:i}=o;return t.jsx("div",{ref:s,hidden:!i,"data-state":i?"open":"closed",className:["vyre-accordion__content",e].filter(Boolean).join(" "),...r,children:t.jsx("div",{className:"vyre-accordion__content-inner",children:a})})});We.displayName="AccordionContent";const He=n.forwardRef(({src:e,alt:a="",fallback:r,size:s="md",status:o,className:i,...d},l)=>{var y;const[c,x]=n.useState(!1),b=e&&!c;return t.jsxs("span",{ref:l,"data-size":s,className:["vyre-avatar",i].filter(Boolean).join(" "),...d,children:[b?t.jsx("img",{src:e,alt:a,className:"vyre-avatar__img",onError:()=>x(!0)}):t.jsx("span",{className:"vyre-avatar__fallback","aria-label":a||r,children:r??((y=a==null?void 0:a.charAt(0))==null?void 0:y.toUpperCase())??"?"}),o&&t.jsx("span",{className:`vyre-avatar__status vyre-avatar__status--${o}`,"aria-label":o})]})});He.displayName="Avatar";const Fe=n.forwardRef(({checked:e,defaultChecked:a,indeterminate:r=!1,onCheckedChange:s,disabled:o,size:i="md",className:d,id:l,...c},x)=>{const b=n.useRef(null),y=x??b;return n.useEffect(()=>{y.current&&(y.current.indeterminate=r)},[r,y]),t.jsxs("span",{className:["vyre-checkbox",`vyre-checkbox--${i}`,d].filter(Boolean).join(" "),"data-disabled":o||void 0,"data-checked":e||void 0,"data-indeterminate":r||void 0,children:[t.jsx("input",{ref:y,type:"checkbox",id:l,checked:e,defaultChecked:a,disabled:o,className:"vyre-checkbox__input",onChange:f=>s==null?void 0:s(f.target.checked),...c}),t.jsx("span",{className:"vyre-checkbox__box","aria-hidden":"true",children:r?t.jsx("svg",{width:"10",height:"2",viewBox:"0 0 10 2",fill:"none",children:t.jsx("path",{d:"M1 1h8",stroke:"currentColor",strokeWidth:"2",strokeLinecap:"round"})}):t.jsx("svg",{width:"10",height:"8",viewBox:"0 0 10 8",fill:"none",children:t.jsx("path",{d:"M1 4l3 3 5-6",stroke:"currentColor",strokeWidth:"1.75",strokeLinecap:"round",strokeLinejoin:"round"})})})]})});Fe.displayName="Checkbox";const Pe=n.forwardRef(({checked:e,defaultChecked:a=!1,onCheckedChange:r,disabled:s,size:o="md",className:i,...d},l)=>{const[c,x]=n.useState(a),b=e!==void 0?e:c,y=()=>{if(s)return;const f=!b;e===void 0&&x(f),r==null||r(f)};return t.jsx("button",{ref:l,type:"button",role:"switch","aria-checked":b,disabled:s,"data-checked":b||void 0,"data-size":o,className:["vyre-switch",i].filter(Boolean).join(" "),onClick:y,...d,children:t.jsx("span",{className:"vyre-switch__thumb"})})});Pe.displayName="Switch";const qe=n.forwardRef(({value:e,defaultValue:a=0,min:r=0,max:s=100,step:o=1,onValueChange:i,disabled:d,size:l="md",className:c,style:x,...b},y)=>{const[f,p]=n.useState(a),u=e!==void 0?e:f,v=(u-r)/(s-r)*100;return t.jsxs("div",{className:["vyre-slider",`vyre-slider--${l}`,c].filter(Boolean).join(" "),"data-disabled":d||void 0,style:{"--vyre-slider-pct":`${v}%`,...x},children:[t.jsx("input",{ref:y,type:"range",min:r,max:s,step:o,value:u,disabled:d,className:"vyre-slider__input",onChange:_=>{const h=Number(_.target.value);e===void 0&&p(h),i==null||i(h)},...b}),t.jsxs("div",{className:"vyre-slider__track",children:[t.jsx("div",{className:"vyre-slider__fill",style:{width:`${v}%`}}),t.jsx("div",{className:"vyre-slider__thumb",style:{left:`${v}%`}})]})]})});qe.displayName="Slider";const Oe=n.forwardRef(({value:e,max:a=100,indeterminate:r=!1,size:s="md",variant:o="default",className:i,...d},l)=>{const c=r?void 0:Math.min(100,Math.max(0,(e??0)/a*100));return t.jsx("div",{ref:l,role:"progressbar","aria-valuemin":0,"aria-valuemax":a,"aria-valuenow":r?void 0:e??0,"data-size":s,"data-variant":o,"data-indeterminate":r||void 0,className:["vyre-progress",i].filter(Boolean).join(" "),...d,children:t.jsx("div",{className:"vyre-progress__bar",style:c!==void 0?{width:`${c}%`}:void 0})})});Oe.displayName="Progress";const Ke=n.forwardRef(({orientation:e="horizontal",decorative:a=!0,className:r,...s},o)=>t.jsx("div",{ref:o,role:a?"none":"separator","aria-orientation":a?void 0:e,"data-orientation":e,className:["vyre-separator",r].filter(Boolean).join(" "),...s}));Ke.displayName="Separator";const Ye=n.forwardRef(({required:e,disabled:a,className:r,children:s,...o},i)=>t.jsxs("label",{ref:i,"data-required":e||void 0,"data-disabled":a||void 0,className:["vyre-label",r].filter(Boolean).join(" "),...o,children:[s,e&&t.jsx("span",{className:"vyre-label__required","aria-hidden":"true",children:"*"})]}));Ye.displayName="Label";const Ue=n.forwardRef(({variant:e="rect",width:a,height:r,className:s,style:o,...i},d)=>t.jsx("div",{ref:d,"aria-hidden":"true","data-variant":e,className:["vyre-skeleton",s].filter(Boolean).join(" "),style:{width:typeof a=="number"?`${a}px`:a,height:typeof r=="number"?`${r}px`:r,...o},...i}));Ue.displayName="Skeleton";const Q=8,dr=120;function ur(e){const[a,r]=e.split("-");return{side:a,align:r??"center"}}function mr(e,a,r,s,o,i){const d=e.width,l=e.height,c=a.width,x=a.height,b=e.left+o,y=e.top+i;let f=0,p=0;switch(r){case"top":f=y-x-Q;break;case"bottom":f=y+l+Q;break;case"left":p=b-c-Q;break;case"right":p=b+d+Q;break}if(r==="top"||r==="bottom")switch(s){case"start":p=b;break;case"center":p=b+d/2-c/2;break;case"end":p=b+d-c;break}else switch(s){case"start":f=y;break;case"center":f=y+l/2-x/2;break;case"end":f=y+l-x;break}return{top:f,left:p}}const Ge=({trigger:e,children:a,open:r,onOpenChange:s,placement:o="bottom",closeOnOutside:i=!0,className:d})=>{const l=r!==void 0,[c,x]=n.useState(!1),[b,y]=n.useState(!1),[f,p]=n.useState(!1),[u,v]=n.useState({top:0,left:0}),_=l?r:c,h=n.useRef(null),g=n.useRef(null),N=n.useRef(null),T=n.useId(),{side:E,align:W}=ur(o),V=n.useCallback(C=>{l||x(C),s==null||s(C)},[l,s]),B=n.useCallback(()=>V(!_),[_,V]),L=n.useCallback(()=>{y(!0),N.current=setTimeout(()=>{y(!1),p(!1),V(!1)},dr)},[V]);n.useEffect(()=>{_?(N.current&&(clearTimeout(N.current),N.current=null),y(!1),p(!0)):f&&!b&&L()},[_]),n.useEffect(()=>{if(!f||!h.current||!g.current)return;const C=h.current.getBoundingClientRect(),j=g.current.getBoundingClientRect(),S=mr(C,j,E,W,window.scrollX,window.scrollY);v(S)},[f,E,W]),n.useEffect(()=>{if(!f||!i)return;const C=j=>{g.current&&!g.current.contains(j.target)&&h.current&&!h.current.contains(j.target)&&L()};return document.addEventListener("mousedown",C),()=>document.removeEventListener("mousedown",C)},[f,i,L]),n.useEffect(()=>{if(!f)return;const C=j=>{j.key==="Escape"&&L()};return document.addEventListener("keydown",C),()=>document.removeEventListener("keydown",C)},[f,L]);const I=n.cloneElement(e,{ref:h,onClick:C=>{var j,S;B(),(S=(j=e.props).onClick)==null||S.call(j,C)},"aria-expanded":_,"aria-controls":T,"aria-haspopup":"dialog"});return t.jsxs(t.Fragment,{children:[I,f&&H.createPortal(t.jsx("div",{ref:g,id:T,role:"dialog","aria-modal":"false",className:m("vyre-popover",`vyre-popover--${E}`,b&&"vyre-popover--leaving",d),style:{top:u.top,left:u.left},children:a}),document.body)]})};Ge.displayName="VyrePopover";const ee=n.createContext(null),Xe=n.createContext(null),vr=120,ze=({trigger:e,children:a,placement:r="bottom-start",className:s})=>{const[o,i]=n.useState(!1),[d,l]=n.useState(!1),[c,x]=n.useState(!1),[b,y]=n.useState({top:0,left:0}),[f,p]=n.useState(-1),u=n.useRef(null),v=n.useRef(null),_=n.useRef(null),h=n.useId(),g=n.useCallback(()=>{var L;return Array.from(((L=v.current)==null?void 0:L.querySelectorAll("[role=menuitem]:not([aria-disabled=true]):not([disabled]),[role=menuitemcheckbox]:not([aria-disabled=true]):not([disabled]),[role=menuitemradio]:not([aria-disabled=true]):not([disabled])"))??[])},[]),N=n.useCallback(()=>{l(!0),_.current=setTimeout(()=>{var L;l(!1),x(!1),i(!1),p(-1),(L=u.current)==null||L.focus({preventScroll:!0})},vr)},[]),T=n.useCallback(()=>{_.current&&(clearTimeout(_.current),_.current=null),l(!1),i(!0),x(!0)},[]),E=n.useCallback(()=>{o?N():T()},[o,T,N]);n.useEffect(()=>{if(!c||!u.current)return;const L=u.current.getBoundingClientRect(),I=4,C=window.scrollX,j=window.scrollY;let S=0,R=0;r.startsWith("bottom")?(S=L.bottom+j+I,R=r==="bottom-start"?L.left+C:L.right+C):(S=L.top+j-I,R=r==="top-start"?L.left+C:L.right+C),y({top:S,left:R}),requestAnimationFrame(()=>{var P;(P=g()[0])==null||P.focus({preventScroll:!0}),p(0)})},[c,r,g]),n.useEffect(()=>{if(!c)return;const L=C=>{v.current&&!v.current.contains(C.target)&&u.current&&!u.current.contains(C.target)&&N()},I=C=>{var j,S,R;if(C.key==="Escape"){N();return}if(C.key==="ArrowDown"||C.key==="ArrowUp"){C.preventDefault();const M=g();if(!M.length)return;const P=C.key==="ArrowDown"?1:-1,Z=(f+P+M.length)%M.length;(j=M[Z])==null||j.focus({preventScroll:!0}),p(Z)}if(C.key==="Home"&&((S=g()[0])==null||S.focus({preventScroll:!0}),p(0)),C.key==="End"){const M=g();(R=M[M.length-1])==null||R.focus({preventScroll:!0}),p(M.length-1)}};return document.addEventListener("mousedown",L),document.addEventListener("keydown",I),()=>{document.removeEventListener("mousedown",L),document.removeEventListener("keydown",I)}},[c,f,N,g]);const W=n.cloneElement(e,{ref:u,onClick:L=>{var I,C;E(),(C=(I=e.props).onClick)==null||C.call(I,L)},"aria-expanded":o,"aria-haspopup":"menu","aria-controls":h}),V=r.endsWith("-end"),B=r.startsWith("top");return t.jsxs(ee.Provider,{value:{close:N},children:[W,c&&H.createPortal(t.jsx("div",{ref:v,id:h,role:"menu","aria-orientation":"vertical",className:m("vyre-dropdown",V&&"vyre-dropdown--end",B&&"vyre-dropdown--top",d&&"vyre-dropdown--leaving",s),style:{top:b.top,left:b.left,transform:V?"translateX(-100%)":void 0},children:a}),document.body)]})};ze.displayName="VyreDropdownMenu";const Ze=({children:e,className:a})=>t.jsx("div",{className:m("vyre-dropdown__label",a),children:e});Ze.displayName="VyreDropdownLabel";const Je=({children:e,onSelect:a,disabled:r=!1,variant:s="default",icon:o,shortcut:i,className:d})=>{const l=n.useContext(ee);return t.jsxs("button",{role:"menuitem",className:m("vyre-dropdown__item",s==="danger"&&"vyre-dropdown__item--danger",d),"aria-disabled":r||void 0,disabled:r,tabIndex:-1,onClick:()=>{r||(a==null||a(),l==null||l.close())},children:[o&&t.jsx("span",{className:"vyre-dropdown__item-icon","aria-hidden":"true",children:o}),t.jsx("span",{className:"vyre-dropdown__item-label",children:e}),i&&t.jsx("kbd",{className:"vyre-dropdown__item-shortcut",children:i})]})};Je.displayName="VyreDropdownItem";const Qe=({children:e,checked:a,onCheckedChange:r,disabled:s=!1,shortcut:o,className:i})=>{const d=n.useContext(ee);return t.jsxs("button",{role:"menuitemcheckbox","aria-checked":a,"aria-disabled":s||void 0,disabled:s,tabIndex:-1,className:m("vyre-dropdown__item vyre-dropdown__item--checkbox",i),onClick:()=>{s||(r(!a),d==null||d.close())},children:[t.jsx("span",{className:"vyre-dropdown__item-indicator","aria-hidden":"true",children:a&&t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:t.jsx("path",{d:"M2 6l3 3 5-5",stroke:"currentColor",strokeWidth:"1.6",strokeLinecap:"round",strokeLinejoin:"round"})})}),t.jsx("span",{className:"vyre-dropdown__item-label",children:e}),o&&t.jsx("kbd",{className:"vyre-dropdown__item-shortcut",children:o})]})};Qe.displayName="VyreDropdownCheckboxItem";const et=({value:e,onValueChange:a,children:r})=>t.jsx(Xe.Provider,{value:{value:e,onValueChange:a},children:t.jsx("div",{role:"group",children:r})});et.displayName="VyreDropdownRadioGroup";const tt=({children:e,value:a,disabled:r=!1,className:s})=>{const o=n.useContext(ee),i=n.useContext(Xe),d=(i==null?void 0:i.value)===a;return t.jsxs("button",{role:"menuitemradio","aria-checked":d,"aria-disabled":r||void 0,disabled:r,tabIndex:-1,className:m("vyre-dropdown__item vyre-dropdown__item--radio",s),onClick:()=>{r||(i==null||i.onValueChange(a),o==null||o.close())},children:[t.jsx("span",{className:"vyre-dropdown__item-indicator","aria-hidden":"true",children:d&&t.jsx("svg",{width:"8",height:"8",viewBox:"0 0 8 8",children:t.jsx("circle",{cx:"4",cy:"4",r:"3",fill:"currentColor"})})}),t.jsx("span",{className:"vyre-dropdown__item-label",children:e})]})};tt.displayName="VyreDropdownRadioItem";const rt=({trigger:e,children:a,icon:r,placement:s="right",disabled:o=!1,className:i})=>{const[d,l]=n.useState(!1),[c,x]=n.useState({top:0,left:0}),b=n.useRef(null),y=n.useRef(null),f=n.useCallback(()=>{if(!b.current)return;const v=b.current.getBoundingClientRect(),_=window.scrollX,h=window.scrollY,g=2;x({top:v.top+h,left:s==="right"?v.right+_+g:v.left+_-g}),l(!0)},[s]),p=n.useCallback(()=>l(!1),[]),u=v=>{var h;const _=v.relatedTarget;(h=y.current)!=null&&h.contains(_)||p()};return t.jsxs(t.Fragment,{children:[t.jsxs("button",{ref:b,role:"menuitem","aria-haspopup":"menu","aria-expanded":d,"aria-disabled":o||void 0,disabled:o,tabIndex:-1,className:m("vyre-dropdown__item vyre-dropdown__item--sub",i),onMouseEnter:f,onMouseLeave:u,onFocus:f,children:[r&&t.jsx("span",{className:"vyre-dropdown__item-icon","aria-hidden":"true",children:r}),t.jsx("span",{className:"vyre-dropdown__item-label",children:e}),t.jsx("span",{className:"vyre-dropdown__item-chevron","aria-hidden":"true",children:t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:t.jsx("path",{d:s==="right"?"M4 2l4 4-4 4":"M8 2L4 6l4 4",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),d&&H.createPortal(t.jsx("div",{ref:y,role:"menu",className:m("vyre-dropdown vyre-dropdown--sub",s==="left"&&"vyre-dropdown--sub-left"),style:{position:"absolute",top:c.top,left:s==="right"?c.left:void 0,right:s==="left"?`calc(100vw - ${c.left}px)`:void 0,transform:s==="left"?"translateX(-100%)":void 0},onMouseLeave:v=>{var h;const _=v.relatedTarget;(h=b.current)!=null&&h.contains(_)||p()},children:a}),document.body)]})};rt.displayName="VyreDropdownSub";const at=({className:e})=>t.jsx("div",{role:"separator",className:m("vyre-dropdown__separator",e)});at.displayName="VyreDropdownSeparator";const yr=()=>t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.4"}),t.jsx("path",{d:"M8 7v4M8 5v.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),fr=()=>t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.4"}),t.jsx("path",{d:"M5 8l2 2 4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})]}),hr=()=>t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[t.jsx("path",{d:"M8 2L14.5 13H1.5L8 2Z",stroke:"currentColor",strokeWidth:"1.4",strokeLinejoin:"round"}),t.jsx("path",{d:"M8 6v3M8 11v.5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),br=()=>t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"8",cy:"8",r:"7",stroke:"currentColor",strokeWidth:"1.4"}),t.jsx("path",{d:"M6 6l4 4M10 6l-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})]}),nt={info:yr,success:fr,warning:hr,danger:br},st=({variant:e="info",title:a,icon:r,onClose:s,children:o,className:i})=>{const d=nt[e];return t.jsxs("div",{role:"alert",className:m("vyre-alert",`vyre-alert--${e}`,i),children:[t.jsx("span",{className:"vyre-alert__icon","aria-hidden":"true",children:r??t.jsx(d,{})}),t.jsxs("div",{className:"vyre-alert__body",children:[a&&t.jsx("p",{className:"vyre-alert__title",children:a}),o&&t.jsx("div",{className:"vyre-alert__description",children:o})]}),s&&t.jsx("button",{type:"button",className:"vyre-alert__close","aria-label":"Dismiss",onClick:s,children:t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M3 3l8 8M11 3l-8 8",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round"})})})]})};st.displayName="VyreAlert";const xr=["button:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(","),ot=({open:e,onOpenChange:a,title:r,description:s,variant:o="danger",confirmLabel:i="Confirm",cancelLabel:d="Cancel",onConfirm:l,onCancel:c,className:x})=>{const b=n.useRef(null),y=n.useRef(null),f=n.useRef(null),p=n.useCallback(()=>{c==null||c(),a(!1)},[c,a]),u=n.useCallback(()=>{l==null||l(),a(!1)},[l,a]),v=n.useCallback(h=>{if(h.key!=="Tab")return;const g=b.current;if(!g)return;const N=Array.from(g.querySelectorAll(xr));if(!N.length)return;const T=N[0],E=N[N.length-1];h.shiftKey&&document.activeElement===T?(h.preventDefault(),E.focus()):!h.shiftKey&&document.activeElement===E&&(h.preventDefault(),T.focus())},[]);if(n.useEffect(()=>{if(!e)return;document.addEventListener("keydown",v);const h=document.body.style.overflow;document.body.style.overflow="hidden";const g=N=>{N.key==="Escape"&&p()};return document.addEventListener("keydown",g),setTimeout(()=>{var N;return(N=f.current)==null?void 0:N.focus()},0),()=>{document.removeEventListener("keydown",v),document.removeEventListener("keydown",g),document.body.style.overflow=h}},[e,v,p]),!e)return null;const _=nt[o];return H.createPortal(t.jsx("div",{ref:y,className:"vyre-alert-dialog-backdrop",onClick:h=>{h.target===y.current&&p()},role:"presentation",children:t.jsxs("div",{ref:b,role:"alertdialog","aria-modal":"true","aria-labelledby":"vyre-ad-title","aria-describedby":s?"vyre-ad-desc":void 0,className:m("vyre-alert-dialog",`vyre-alert-dialog--${o}`,x),tabIndex:-1,children:[t.jsx("div",{className:"vyre-alert-dialog__icon-wrap",children:t.jsx("span",{className:m("vyre-alert-dialog__icon",`vyre-alert-dialog__icon--${o}`),children:t.jsx(_,{})})}),t.jsxs("div",{className:"vyre-alert-dialog__body",children:[t.jsx("h2",{id:"vyre-ad-title",className:"vyre-alert-dialog__title",children:r}),s&&t.jsx("p",{id:"vyre-ad-desc",className:"vyre-alert-dialog__description",children:s})]}),t.jsxs("div",{className:"vyre-alert-dialog__footer",children:[t.jsx("button",{ref:f,type:"button",className:"vyre-btn vyre-btn--ghost vyre-btn--sm",onClick:p,children:d}),t.jsx("button",{type:"button",className:m("vyre-btn vyre-btn--sm",o==="danger"&&"vyre-btn--danger",o==="warning"&&"vyre-btn--primary",o==="info"&&"vyre-btn--accent"),onClick:u,children:i})]})]})}),document.body)};ot.displayName="VyreAlertDialog";const pr=["a[href]","button:not([disabled])","textarea:not([disabled])","input:not([disabled])","select:not([disabled])",'[tabindex]:not([tabindex="-1"])'].join(","),it=n.forwardRef(({open:e,onClose:a,side:r="right",size:s="md",closeOnBackdrop:o=!0,closeOnEsc:i=!0,className:d,children:l,"aria-label":c,"aria-labelledby":x,...b},y)=>{const f=n.useRef(null),p=n.useRef(null),u=n.useCallback(v=>{if(v.key!=="Tab")return;const _=f.current;if(!_)return;const h=Array.from(_.querySelectorAll(pr));if(!h.length)return;const g=h[0],N=h[h.length-1];v.shiftKey&&document.activeElement===g?(v.preventDefault(),N.focus()):!v.shiftKey&&document.activeElement===N&&(v.preventDefault(),g.focus())},[]);return n.useEffect(()=>{if(!e)return;if(document.addEventListener("keydown",u),i){const _=g=>{g.key==="Escape"&&a()};document.addEventListener("keydown",_);const h=document.body.style.overflow;return document.body.style.overflow="hidden",setTimeout(()=>{var g;return(g=f.current)==null?void 0:g.focus()},0),()=>{document.removeEventListener("keydown",u),document.removeEventListener("keydown",_),document.body.style.overflow=h}}const v=document.body.style.overflow;return document.body.style.overflow="hidden",setTimeout(()=>{var _;return(_=f.current)==null?void 0:_.focus()},0),()=>{document.removeEventListener("keydown",u),document.body.style.overflow=v}},[e,u,i,a]),e?H.createPortal(t.jsx("div",{ref:p,className:"vyre-sheet-backdrop",onClick:v=>{o&&v.target===p.current&&a()},role:"presentation",children:t.jsx("div",{ref:v=>{f.current=v,typeof y=="function"?y(v):y&&(y.current=v)},role:"dialog","aria-modal":"true","aria-label":c,"aria-labelledby":x,tabIndex:-1,className:m("vyre-sheet",`vyre-sheet--${r}`,`vyre-sheet--${s}`,d),...b,children:l})}),document.body):null});it.displayName="VyreSheet";const lt=n.forwardRef(({className:e,children:a,...r},s)=>t.jsx("div",{ref:s,className:m("vyre-sheet__header",e),...r,children:a}));lt.displayName="VyreSheetHeader";const ct=n.forwardRef(({className:e,children:a,...r},s)=>t.jsx("div",{ref:s,className:m("vyre-sheet__body",e),...r,children:a}));ct.displayName="VyreSheetBody";const dt=n.forwardRef(({className:e,children:a,...r},s)=>t.jsx("div",{ref:s,className:m("vyre-sheet__footer",e),...r,children:a}));dt.displayName="VyreSheetFooter";const ut=({children:e,separator:a="/",className:r})=>{const s=n.Children.toArray(e).filter(Boolean);return t.jsx("nav",{"aria-label":"Breadcrumb",className:m("vyre-breadcrumb",r),children:t.jsx("ol",{className:"vyre-breadcrumb__list",children:s.map((o,i)=>t.jsxs("li",{className:"vyre-breadcrumb__item",children:[o,i<s.length-1&&t.jsx("span",{className:"vyre-breadcrumb__separator","aria-hidden":"true",children:a})]},i))})})};ut.displayName="VyreBreadcrumb";const mt=({children:e,href:a,current:r=!1,className:s})=>r||!a?t.jsx("span",{className:m("vyre-breadcrumb__link vyre-breadcrumb__link--current",s),"aria-current":r?"page":void 0,children:e}):t.jsx("a",{href:a,className:m("vyre-breadcrumb__link",s),children:e});mt.displayName="VyreBreadcrumbItem";const vt=({children:e,href:a,className:r})=>t.jsx("a",{href:a,className:m("vyre-breadcrumb__link",r),children:e});vt.displayName="VyreBreadcrumbLink";const yt=({children:e="/",className:a})=>t.jsx("span",{className:m("vyre-breadcrumb__separator",a),"aria-hidden":"true",children:e});yt.displayName="VyreBreadcrumbSeparator";function le(e,a){return Array.from({length:a-e+1},(r,s)=>e+s)}function _r(e,a,r){const s=r*2+5;if(a<=s)return le(1,a);const o=Math.max(e-r,2),i=Math.min(e+r,a-1),d=o>2,l=i<a-1,c=[1];return d&&c.push("..."),c.push(...le(o,i)),l&&c.push("..."),c.push(a),c}const wr=()=>t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M9 2L4 7l5 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),jr=()=>t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M5 2l5 5-5 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),gr=()=>t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M7 2L2 7l5 5M12 2L7 7l5 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),kr=()=>t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M2 2l5 5-5 5M7 2l5 5-5 5",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})}),ft=({page:e,totalPages:a,onPageChange:r,siblings:s=1,showEdges:o=!0,showInfo:i=!1,totalItems:d,pageSize:l,className:c})=>{const x=_r(e,a,s),b=e>1,y=e<a,f=n.useMemo(()=>{if(!i)return null;if(d!=null&&l!=null){const u=(e-1)*l+1,v=Math.min(e*l,d);return`Showing ${u}–${v} of ${d}`}return`Page ${e} of ${a}`},[i,e,a,d,l]),p=t.jsxs(t.Fragment,{children:[o&&t.jsx("button",{className:"vyre-pagination__nav",onClick:()=>r(1),disabled:!b,"aria-label":"First page",children:t.jsx(gr,{})}),t.jsx("button",{className:"vyre-pagination__nav",onClick:()=>r(e-1),disabled:!b,"aria-label":"Previous page",children:t.jsx(wr,{})}),t.jsx("ol",{className:"vyre-pagination__list",children:x.map((u,v)=>u==="..."?t.jsx("li",{children:t.jsx("span",{className:"vyre-pagination__dots","aria-hidden":"true",children:"···"})},`dots-${v}`):t.jsx("li",{children:t.jsx("button",{className:m("vyre-pagination__btn",u===e&&"vyre-pagination__btn--active"),onClick:()=>r(u),"aria-label":`Page ${u}`,"aria-current":u===e?"page":void 0,children:u})},u))}),t.jsx("button",{className:"vyre-pagination__nav",onClick:()=>r(e+1),disabled:!y,"aria-label":"Next page",children:t.jsx(jr,{})}),o&&t.jsx("button",{className:"vyre-pagination__nav",onClick:()=>r(a),disabled:!y,"aria-label":"Last page",children:t.jsx(kr,{})})]});return i?t.jsxs("div",{className:m("vyre-pagination-row",c),children:[t.jsx("span",{className:"vyre-pagination__info",children:f}),t.jsx("nav",{"aria-label":"Pagination",className:"vyre-pagination",children:p})]}):t.jsx("nav",{"aria-label":"Pagination",className:m("vyre-pagination",c),children:p})};ft.displayName="VyrePagination";const ht=({children:e,striped:a=!1,bordered:r=!1,compact:s=!1,hoverable:o=!0,className:i})=>t.jsx("div",{className:"vyre-table-wrapper",children:t.jsx("table",{className:m("vyre-table",a&&"vyre-table--striped",r&&"vyre-table--bordered",s&&"vyre-table--compact",o&&"vyre-table--hoverable",i),children:e})});ht.displayName="VyreTable";const bt=n.forwardRef(({className:e,...a},r)=>t.jsx("thead",{ref:r,className:m("vyre-table__head",e),...a}));bt.displayName="VyreTableHead";const xt=n.forwardRef(({className:e,...a},r)=>t.jsx("tbody",{ref:r,className:m("vyre-table__body",e),...a}));xt.displayName="VyreTableBody";const pt=n.forwardRef(({className:e,selected:a,...r},s)=>t.jsx("tr",{ref:s,className:m("vyre-table__row",a&&"vyre-table__row--selected",e),"aria-selected":a,...r}));pt.displayName="VyreTableRow";const Nr=({dir:e})=>t.jsx("span",{className:"vyre-table__sort-icon","aria-hidden":"true",children:t.jsxs("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none",children:[t.jsx("path",{d:"M6 2v8M3 5l3-3 3 3",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",opacity:e==="desc"?.3:1}),t.jsx("path",{d:"M3 7l3 3 3-3",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round",strokeLinejoin:"round",opacity:e==="asc"?.3:1})]})}),_t=n.forwardRef(({className:e,sortable:a,sortDir:r=null,onSort:s,align:o="left",children:i,...d},l)=>a?t.jsx("th",{ref:l,className:m("vyre-table__th vyre-table__th--sortable",`vyre-table__th--${o}`,r&&`vyre-table__th--sort-${r}`,e),"aria-sort":r==="asc"?"ascending":r==="desc"?"descending":"none",...d,children:t.jsxs("button",{className:"vyre-table__sort-btn",onClick:s,type:"button",children:[i,t.jsx(Nr,{dir:r})]})}):t.jsx("th",{ref:l,className:m("vyre-table__th",`vyre-table__th--${o}`,e),...d,children:i}));_t.displayName="VyreTableHeader";const wt=n.forwardRef(({className:e,align:a="left",...r},s)=>t.jsx("td",{ref:s,className:m("vyre-table__td",`vyre-table__td--${a}`,e),...r}));wt.displayName="VyreTableCell";const jt=n.forwardRef(({className:e,...a},r)=>t.jsx("caption",{ref:r,className:m("vyre-table__caption",e),...a}));jt.displayName="VyreTableCaption";const gt=n.createContext(null),te=()=>{const e=n.useContext(gt);if(!e)throw new Error("Command components must be used inside <Command>");return e};function ae(e){return e.toLowerCase().replace(/\s+/g," ").trim()}function Cr(e,a,r=[]){if(!e)return!0;const s=ae(e);return ae(a).includes(s)||r.some(o=>ae(o).includes(s))}let Sr=0;function Rr(){return`cmd-${++Sr}`}const se=n.forwardRef(({value:e,onValueChange:a,className:r,children:s},o)=>{const[i,d]=n.useState(""),[l,c]=n.useState(0),[x,b]=n.useState(0),y=e!==void 0?e:i,f=n.useCallback(N=>{d(N),a==null||a(N),c(0)},[a]),p=n.useRef(new Map),u=n.useRef(new Map),v=n.useCallback((N,T,E)=>{p.current.set(N,{el:T,disabled:E})},[]),_=n.useCallback(N=>{p.current.delete(N),u.current.delete(N)},[]),h=n.useCallback(N=>{var T;(T=u.current.get(N))==null||T()},[]),g=n.useMemo(()=>({search:y,setSearch:f,activeIndex:l,setActiveIndex:c,items:p,registerItem:v,unregisterItem:_,selectItem:h,onSelectRef:u,visibleCount:x,setVisibleCount:b}),[y,f,l,v,_,h,x]);return t.jsx(gt.Provider,{value:g,children:t.jsx("div",{ref:o,className:m("vyre-command",r),role:"combobox","aria-expanded":"true","aria-haspopup":"listbox",children:s})})});se.displayName="VyreCommand";const kt=n.forwardRef(({placeholder:e="Search...",className:a},r)=>{const{search:s,setSearch:o}=te();return t.jsxs("div",{className:"vyre-command__input-wrapper",children:[t.jsx("svg",{className:"vyre-command__search-icon",width:"15",height:"15",viewBox:"0 0 15 15",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M10 6.5a3.5 3.5 0 1 1-7 0 3.5 3.5 0 0 1 7 0ZM9.5 10.207l3.146 3.147",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})}),t.jsx("input",{ref:r,className:m("vyre-command__input",a),type:"text",placeholder:e,value:s,onChange:i=>o(i.target.value),autoComplete:"off",autoCorrect:"off",spellCheck:!1,"aria-autocomplete":"list","aria-controls":"vyre-command-list"}),s&&t.jsx("button",{className:"vyre-command__clear",type:"button","aria-label":"Clear search",onClick:()=>o(""),children:t.jsx("svg",{width:"13",height:"13",viewBox:"0 0 13 13",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M2 2l9 9M11 2l-9 9",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})})]})});kt.displayName="VyreCommandInput";const Nt=n.forwardRef(({className:e,children:a},r)=>{const{activeIndex:s,setActiveIndex:o,items:i,selectItem:d}=te(),l=n.useCallback(c=>{var b,y;const x=Array.from((i.current??new Map).entries()).filter(([,f])=>!f.disabled&&f.el.closest("[data-cmd-item]")!==null&&!f.el.hasAttribute("data-cmd-hidden"));if(c.key==="ArrowDown")c.preventDefault(),o(Math.min(s+1,x.length-1)),(b=x[Math.min(s+1,x.length-1)])==null||b[1].el.scrollIntoView({block:"nearest"});else if(c.key==="ArrowUp")c.preventDefault(),o(Math.max(s-1,0)),(y=x[Math.max(s-1,0)])==null||y[1].el.scrollIntoView({block:"nearest"});else if(c.key==="Enter"){c.preventDefault();const[f]=x[s]??[];f&&d(f)}},[s,o,i,d]);return t.jsx("div",{ref:r,id:"vyre-command-list",role:"listbox",className:m("vyre-command__list",e),onKeyDown:l,children:a})});Nt.displayName="VyreCommandList";const Ct=({className:e,children:a})=>{const{search:r,visibleCount:s}=te();return!r||s>0?null:t.jsx("div",{className:m("vyre-command__empty",e),role:"presentation",children:a??"No results found."})};Ct.displayName="VyreCommandEmpty";const St=({heading:e,className:a,children:r})=>t.jsxs("div",{className:m("vyre-command__group",a),role:"presentation",children:[e&&t.jsx("div",{className:"vyre-command__group-heading","aria-hidden":"true",children:e}),t.jsx("div",{role:"group","aria-label":e,children:r})]});St.displayName="VyreCommandGroup";const Rt=({onSelect:e,disabled:a=!1,keywords:r,className:s,children:o,icon:i,shortcut:d})=>{const{search:l,setActiveIndex:c,registerItem:x,unregisterItem:b,onSelectRef:y,setVisibleCount:f}=te(),p=n.useMemo(()=>Rr(),[]),u=n.useRef(null),_=Cr(l,typeof o=="string"?o:"",r);return n.useEffect(()=>(f(h=>h+(_?1:0)),()=>{f(h=>h-(_?1:0))}),[_,f]),n.useEffect(()=>{const h=u.current;if(!(!h||!_))return x(p,h,a),()=>b(p)},[p,a,_,x,b]),n.useEffect(()=>{var h;return e&&((h=y.current)==null||h.set(p,e)),()=>{var g;(g=y.current)==null||g.delete(p)}},[p,e,y]),_?t.jsxs("div",{ref:u,"data-cmd-item":!0,role:"option","aria-disabled":a||void 0,className:m("vyre-command__item",a&&"vyre-command__item--disabled",s),onClick:()=>{a||e==null||e()},onMouseEnter:()=>{!a&&u.current&&c(-1)},children:[i&&t.jsx("span",{className:"vyre-command__item-icon","aria-hidden":"true",children:i}),t.jsx("span",{className:"vyre-command__item-label",children:o}),d&&t.jsx("kbd",{className:"vyre-command__item-shortcut",children:d})]}):null};Rt.displayName="VyreCommandItem";const Lt=({className:e})=>t.jsx("div",{className:m("vyre-command__separator",e),role:"separator","aria-hidden":"true"});Lt.displayName="VyreCommandSeparator";const Mt=({open:e,onOpenChange:a,value:r,onValueChange:s,className:o,children:i})=>{const d=n.useRef(null);return n.useEffect(()=>{var x;if(!e)return;const l=document.activeElement,c=(x=d.current)==null?void 0:x.querySelector(".vyre-command__input");return c==null||c.focus(),()=>{l==null||l.focus({preventScroll:!0})}},[e]),n.useEffect(()=>{if(!e)return;const l=c=>{c.key==="Escape"&&a(!1)};return window.addEventListener("keydown",l),()=>window.removeEventListener("keydown",l)},[e,a]),e?H.createPortal(t.jsx("div",{className:"vyre-command-backdrop",ref:d,onClick:l=>{l.target===l.currentTarget&&a(!1)},role:"dialog","aria-modal":"true","aria-label":"Command palette",children:t.jsx(se,{value:r,onValueChange:s,className:m("vyre-command--dialog",o),children:i})}),document.body):null};Mt.displayName="VyreCommandDialog";function U(e){return new Date(e.getFullYear(),e.getMonth(),e.getDate())}function F(e,a){return e.getFullYear()===a.getFullYear()&&e.getMonth()===a.getMonth()&&e.getDate()===a.getDate()}function X(e,a){return U(e)<U(a)}function ce(e,a){return U(e)>U(a)}function Lr(e,a){return new Date(e,a+1,0).getDate()}function Mr(e,a,r){return(new Date(e,a,1).getDay()-r+7)%7}function q(e,a){return e?new Intl.DateTimeFormat("default",{year:"numeric",month:"short",day:"numeric"}).format(e):""}function Tr(e){return`${String(e.getHours()).padStart(2,"0")}:${String(e.getMinutes()).padStart(2,"0")}`}const de=Array.from({length:12},(e,a)=>new Intl.DateTimeFormat("default",{month:"long"}).format(new Date(2e3,a,1))),z=12,oe=n.forwardRef((e,a)=>{const{showTime:r=!1,minDate:s,maxDate:o,disabled:i,className:d,weekStartsOn:l=1}=e,c=U(new Date),x=()=>{var w,k;return e.mode==="range"?((w=e.value)==null?void 0:w[0])??c:e.mode==="multiple"?((k=e.value)==null?void 0:k[0])??c:e.value??c},[b,y]=n.useState(()=>(x()??c).getFullYear()),[f,p]=n.useState(()=>(x()??c).getMonth()),[u,v]=n.useState("days"),[_,h]=n.useState(null),[g,N]=n.useState(()=>{const w=e.mode==="single"?e.value:null;return w?w.getHours():0}),[T,E]=n.useState(()=>{const w=e.mode==="single"?e.value:null;return w?w.getMinutes():0}),W=n.useMemo(()=>{const w=Lr(b,f),k=Mr(b,f,l);return{count:w,offset:k}},[b,f,l]),V=n.useMemo(()=>l===1?["Mo","Tu","We","Th","Fr","Sa","Su"]:["Su","Mo","Tu","We","Th","Fr","Sa"],[l]),B=n.useCallback(w=>{if(e.mode==="single")return!!e.value&&F(w,e.value);if(e.mode==="range"){const[k,D]=e.value??[null,null];return!!k&&F(w,k)||!!D&&F(w,D)}return e.mode==="multiple"?(e.value??[]).some(k=>F(w,k)):!1},[e]),L=n.useCallback(w=>{if(e.mode!=="range")return!1;const[k,D]=e.value??[null,null],A=D??_;if(!k||!A)return!1;const O=X(k,A)?k:A,K=X(k,A)?A:k;return ce(w,O)&&X(w,K)},[e,_]),I=n.useCallback(w=>{if(e.mode!=="range")return!1;const[k]=e.value??[null,null];return!!k&&F(w,k)},[e]),C=n.useCallback(w=>{if(e.mode!=="range")return!1;const[,k]=e.value??[null,null];return!!k&&F(w,k)},[e]),j=n.useCallback(w=>!!(s&&X(w,s)||o&&ce(w,o)||i!=null&&i(w)),[s,o,i]),S=n.useCallback(w=>{var D,A,O,K,G,J;const k=new Date(b,f,w,g,T);if(!j(U(k))){if(e.mode==="single"||!e.mode)(D=e.onChange)==null||D.call(e,k);else if(e.mode==="range"){const[$,Y]=e.value??[null,null];!$||$&&Y?(A=e.onChange)==null||A.call(e,[k,null]):X(k,$)?(O=e.onChange)==null||O.call(e,[k,$]):(K=e.onChange)==null||K.call(e,[$,k])}else if(e.mode==="multiple"){const $=e.value??[],Y=$.findIndex(ie=>F(ie,k));Y>=0?(G=e.onChange)==null||G.call(e,$.filter((ie,Xt)=>Xt!==Y)):(J=e.onChange)==null||J.call(e,[...$,k])}}},[b,f,g,T,e,j]),R=()=>{f===0?(p(11),y(w=>w-1)):p(w=>w-1)},M=()=>{f===11?(p(0),y(w=>w+1)):p(w=>w+1)},P=(w,k)=>{var D;if(N(w),E(k),e.mode==="single"&&e.value){const A=new Date(e.value);A.setHours(w,k),(D=e.onChange)==null||D.call(e,A)}},Z=Math.floor(b/z)*z;return t.jsxs("div",{ref:a,className:m("vyre-calendar",d),children:[t.jsxs("div",{className:"vyre-calendar__header",children:[u==="days"&&t.jsx("button",{className:"vyre-calendar__nav",onClick:R,"aria-label":"Previous month",children:t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:t.jsx("path",{d:"M9 11L5 7l4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),u==="years"&&t.jsx("button",{className:"vyre-calendar__nav",onClick:()=>y(w=>w-z),"aria-label":"Previous years",children:t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:t.jsx("path",{d:"M9 11L5 7l4-4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),t.jsxs("div",{className:"vyre-calendar__header-center",children:[t.jsx("button",{className:"vyre-calendar__header-btn",onClick:()=>v(u==="months"?"days":"months"),children:de[f]}),t.jsx("button",{className:"vyre-calendar__header-btn",onClick:()=>v(u==="years"?"days":"years"),children:b})]}),u==="days"&&t.jsx("button",{className:"vyre-calendar__nav",onClick:M,"aria-label":"Next month",children:t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:t.jsx("path",{d:"M5 3l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})}),u==="years"&&t.jsx("button",{className:"vyre-calendar__nav",onClick:()=>y(w=>w+z),"aria-label":"Next years",children:t.jsx("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none",children:t.jsx("path",{d:"M5 3l4 4-4 4",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]}),u==="months"&&t.jsx("div",{className:"vyre-calendar__month-grid",children:de.map((w,k)=>t.jsx("button",{className:m("vyre-calendar__month-cell",k===f&&"vyre-calendar__month-cell--active"),onClick:()=>{p(k),v("days")},children:w.slice(0,3)},w))}),u==="years"&&t.jsx("div",{className:"vyre-calendar__year-grid",children:Array.from({length:z},(w,k)=>Z+k).map(w=>t.jsx("button",{className:m("vyre-calendar__year-cell",w===b&&"vyre-calendar__year-cell--active"),onClick:()=>{y(w),v("days")},children:w},w))}),u==="days"&&t.jsxs("div",{className:"vyre-calendar__grid",children:[V.map(w=>t.jsx("div",{className:"vyre-calendar__weekday",children:w},w)),Array.from({length:W.offset}).map((w,k)=>t.jsx("div",{},`empty-${k}`)),Array.from({length:W.count},(w,k)=>k+1).map(w=>{const k=new Date(b,f,w),D=B(k),A=L(k),O=I(k),K=C(k),G=j(k),J=F(k,c);return t.jsx("button",{className:m("vyre-calendar__day",J&&"vyre-calendar__day--today",D&&"vyre-calendar__day--selected",A&&"vyre-calendar__day--in-range",O&&"vyre-calendar__day--range-start",K&&"vyre-calendar__day--range-end",G&&"vyre-calendar__day--disabled"),onClick:()=>S(w),onMouseEnter:()=>{if(e.mode==="range"){const[$,Y]=e.value??[null,null];$&&!Y&&h(k)}},onMouseLeave:()=>h(null),disabled:G,"aria-selected":D,"aria-label":q(k),children:w},w)})]}),r&&u==="days"&&t.jsxs("div",{className:"vyre-calendar__time",children:[t.jsxs("svg",{width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:[t.jsx("circle",{cx:"7",cy:"7",r:"5.5",stroke:"currentColor",strokeWidth:"1.3"}),t.jsx("path",{d:"M7 4v3.5l2 1.5",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]}),t.jsx("input",{type:"number",className:"vyre-calendar__time-input",min:0,max:23,value:g,onChange:w=>P(Number(w.target.value),T),"aria-label":"Hours"}),t.jsx("span",{className:"vyre-calendar__time-sep",children:":"}),t.jsx("input",{type:"number",className:"vyre-calendar__time-input",min:0,max:59,value:T,onChange:w=>P(g,Number(w.target.value)),"aria-label":"Minutes"})]})]})});oe.displayName="VyreCalendar";function Er(e){if(e.mode==="range"){const[s,o]=e.value??[null,null];return s?o?`${q(s)} – ${q(o)}`:q(s):""}if(e.mode==="multiple"){const s=e.value??[];return s.length===0?"":s.length===1?q(s[0]):`${s.length} dates selected`}const a=e.value,r=e.showTime;return a?r?`${q(a)} ${Tr(a)}`:q(a):""}const Tt=n.forwardRef(({placeholder:e="Pick a date",inputClassName:a,...r},s)=>{const[o,i]=n.useState(!1),d=n.useRef(null),l=n.useRef(null),[c,x]=n.useState({top:0,left:0,width:0}),b=Er(r),y=n.useCallback(()=>{if(!d.current)return;const u=d.current.getBoundingClientRect();x({top:u.bottom+window.scrollY+6,left:u.left+window.scrollX,width:u.width})},[]);n.useEffect(()=>{if(!o)return;y();const u=()=>y(),v=()=>y();return window.addEventListener("scroll",u,!0),window.addEventListener("resize",v),()=>{window.removeEventListener("scroll",u,!0),window.removeEventListener("resize",v)}},[o,y]),n.useEffect(()=>{if(!o)return;const u=_=>{var h,g;!((h=l.current)!=null&&h.contains(_.target))&&!((g=d.current)!=null&&g.contains(_.target))&&i(!1)},v=_=>{_.key==="Escape"&&i(!1)};return document.addEventListener("pointerdown",u),document.addEventListener("keydown",v),()=>{document.removeEventListener("pointerdown",u),document.removeEventListener("keydown",v)}},[o]);const f=r.mode!=="range"&&r.mode!=="multiple"&&!r.showTime,p=n.useMemo(()=>r.mode==="range"?{...r,onChange:u=>{var v;(v=r.onChange)==null||v.call(r,u),u[0]&&u[1]&&i(!1)}}:r.mode==="multiple"?r:{...r,onChange:u=>{var v;(v=r.onChange)==null||v.call(r,u),f&&i(!1)}},[r,f]);return t.jsxs("div",{ref:s,className:"vyre-datepicker",children:[t.jsxs("button",{ref:d,type:"button",className:m("vyre-datepicker__trigger",!b&&"vyre-datepicker__trigger--placeholder",a),onClick:()=>{y(),i(u=>!u)},"aria-expanded":o,"aria-haspopup":"dialog",children:[t.jsxs("svg",{className:"vyre-datepicker__icon",width:"14",height:"14",viewBox:"0 0 14 14",fill:"none","aria-hidden":"true",children:[t.jsx("rect",{x:"1.5",y:"2.5",width:"11",height:"10",rx:"1.5",stroke:"currentColor",strokeWidth:"1.3"}),t.jsx("path",{d:"M1.5 6h11M4.5 1v3M9.5 1v3",stroke:"currentColor",strokeWidth:"1.3",strokeLinecap:"round"})]}),t.jsx("span",{children:b||e}),b&&t.jsx("button",{className:"vyre-datepicker__clear",type:"button","aria-label":"Clear",onClick:u=>{var v,_,h;u.stopPropagation(),r.mode==="range"?(v=r.onChange)==null||v.call(r,[null,null]):r.mode==="multiple"?(_=r.onChange)==null||_.call(r,[]):(h=r.onChange)==null||h.call(r,null)},children:t.jsx("svg",{width:"12",height:"12",viewBox:"0 0 12 12",fill:"none","aria-hidden":"true",children:t.jsx("path",{d:"M2 2l8 8M10 2l-8 8",stroke:"currentColor",strokeWidth:"1.4",strokeLinecap:"round"})})})]}),o&&H.createPortal(t.jsx("div",{ref:l,className:"vyre-datepicker__popover",role:"dialog","aria-label":"Date picker",style:{top:c.top,left:c.left,minWidth:c.width},children:t.jsx(oe,{...p})}),document.body)]})});Tt.displayName="VyreDatePicker";const Et=n.forwardRef(({as:e="p",size:a="md",weight:r,color:s="default",truncate:o,mono:i,className:d,children:l,...c},x)=>t.jsx(e,{ref:x,className:m("vyre-text",a!=="md"&&`vyre-text--${a}`,r&&`vyre-text--${r}`,s!=="default"&&`vyre-text--${s}`,o&&"vyre-text--truncate",i&&"vyre-text--mono",d),...c,children:l}));Et.displayName="VyreText";const It=n.forwardRef(({as:e="h2",size:a="md",weight:r="bold",color:s="default",truncate:o,className:i,children:d,...l},c)=>t.jsx(e,{ref:c,className:m("vyre-heading",`vyre-heading--${a}`,r!=="bold"&&`vyre-heading--${r}`,s!=="default"&&`vyre-text--${s}`,o&&"vyre-text--truncate",i),...l,children:d}));It.displayName="VyreHeading";const Dt=n.forwardRef(({className:e,children:a,...r},s)=>t.jsx("p",{ref:s,className:m("vyre-lead",e),...r,children:a}));Dt.displayName="VyreLead";const At=n.forwardRef(({block:e,className:a,children:r,...s},o)=>e?t.jsx("pre",{className:m("vyre-code-block",a),...s,children:t.jsx("code",{ref:o,children:r})}):t.jsx("code",{ref:o,className:m("vyre-code",a),...s,children:r}));At.displayName="VyreCode";const Bt=n.forwardRef(({className:e,children:a,...r},s)=>t.jsx("blockquote",{ref:s,className:m("vyre-blockquote",e),...r,children:a}));Bt.displayName="VyreBlockquote";const Vt=n.createContext({collapsed:!1,toggleCollapsed:()=>{}}),re=()=>n.useContext(Vt),$t=n.forwardRef(({defaultCollapsed:e=!1,collapsed:a,onCollapsedChange:r,className:s,children:o},i)=>{const[d,l]=n.useState(e),c=a!==void 0?a:d,x=n.useCallback(()=>{const b=!c;l(b),r==null||r(b)},[c,r]);return t.jsx(Vt.Provider,{value:{collapsed:c,toggleCollapsed:x},children:t.jsx("div",{ref:i,className:m("vyre-app-layout",s),children:o})})});$t.displayName="VyreAppLayout";const Wt=n.forwardRef(({variant:e="default",className:a,children:r},s)=>{const{collapsed:o}=re();return t.jsx("aside",{ref:s,className:m("vyre-sidebar",o&&"vyre-sidebar--collapsed",e==="floating"&&"vyre-sidebar--floating",a),"data-collapsed":o||void 0,children:r})});Wt.displayName="VyreSidebar";const Ht=n.forwardRef(({logo:e,title:a,className:r,children:s},o)=>t.jsxs("div",{ref:o,className:m("vyre-sidebar__header",r),children:[e&&t.jsx("span",{className:"vyre-sidebar__logo",children:e}),a&&t.jsx("span",{className:"vyre-sidebar__title",children:a}),s]}));Ht.displayName="VyreSidebarHeader";const Ft=n.forwardRef(({className:e,children:a},r)=>t.jsx("div",{ref:r,className:m("vyre-sidebar__content",e),children:a}));Ft.displayName="VyreSidebarContent";const Pt=n.forwardRef(({label:e,className:a,children:r},s)=>t.jsxs("div",{ref:s,className:m("vyre-sidebar__section",a),children:[e&&t.jsx("div",{className:"vyre-sidebar__section-label",children:e}),r]}));Pt.displayName="VyreSidebarSection";const qt=({active:e,icon:a,badge:r,href:s,onClick:o,className:i,children:d})=>{const{collapsed:l}=re(),c=m("vyre-sidebar__item",e&&"vyre-sidebar__item--active",i),x=t.jsxs(t.Fragment,{children:[a&&t.jsx("span",{className:"vyre-sidebar__item-icon",children:a}),t.jsx("span",{className:"vyre-sidebar__item-label",children:d}),r!==void 0&&t.jsx("span",{className:"vyre-sidebar__item-badge",children:r})]});return s?t.jsx("a",{href:s,className:c,"aria-current":e?"page":void 0,title:l?String(d):void 0,children:x}):t.jsx("button",{type:"button",className:c,onClick:o,"aria-pressed":e,title:l?String(d):void 0,children:x})};qt.displayName="VyreSidebarItem";const Ot=n.forwardRef(({className:e,children:a},r)=>t.jsx("div",{ref:r,className:m("vyre-sidebar__footer",e),children:a}));Ot.displayName="VyreSidebarFooter";const Kt=n.forwardRef(({className:e,children:a},r)=>t.jsx("div",{ref:r,className:m("vyre-app-shell",e),children:a}));Kt.displayName="VyreAppShell";const Yt=n.forwardRef(({className:e,children:a},r)=>t.jsx("header",{ref:r,className:m("vyre-app-bar",e),children:a}));Yt.displayName="VyreAppBar";const Ut=({className:e})=>{const{collapsed:a,toggleCollapsed:r}=re();return t.jsx("button",{type:"button",className:m("vyre-sidebar-trigger",e),onClick:r,"aria-label":a?"Expand sidebar":"Collapse sidebar","aria-expanded":!a,children:t.jsxs("svg",{width:"16",height:"16",viewBox:"0 0 16 16",fill:"none","aria-hidden":"true",children:[t.jsx("rect",{x:"2",y:"4",width:"12",height:"1.5",rx:"0.75",fill:"currentColor"}),t.jsx("rect",{x:"2",y:"7.25",width:"8",height:"1.5",rx:"0.75",fill:"currentColor"}),t.jsx("rect",{x:"2",y:"10.5",width:"12",height:"1.5",rx:"0.75",fill:"currentColor"})]})})};Ut.displayName="VyreSidebarTrigger";const Gt=n.forwardRef(({className:e,children:a},r)=>t.jsx("div",{ref:r,className:m("vyre-page-content",e),children:a}));Gt.displayName="VyrePageContent";exports.Accordion=Be;exports.AccordionContent=We;exports.AccordionItem=Ve;exports.AccordionTrigger=$e;exports.Alert=st;exports.AlertDialog=ot;exports.AppBar=Yt;exports.AppLayout=$t;exports.AppShell=Kt;exports.Avatar=He;exports.Badge=me;exports.Blockquote=Bt;exports.Breadcrumb=ut;exports.BreadcrumbItem=mt;exports.BreadcrumbLink=vt;exports.BreadcrumbSeparator=yt;exports.Button=ue;exports.Calendar=oe;exports.Card=ve;exports.CardBody=fe;exports.CardFooter=he;exports.CardHeader=ye;exports.Checkbox=Fe;exports.Code=At;exports.Command=se;exports.CommandDialog=Mt;exports.CommandEmpty=Ct;exports.CommandGroup=St;exports.CommandInput=kt;exports.CommandItem=Rt;exports.CommandList=Nt;exports.CommandSeparator=Lt;exports.DatePicker=Tt;exports.DropdownCheckboxItem=Qe;exports.DropdownItem=Je;exports.DropdownLabel=Ze;exports.DropdownMenu=ze;exports.DropdownRadioGroup=et;exports.DropdownRadioItem=tt;exports.DropdownSeparator=at;exports.DropdownSub=rt;exports.Field=be;exports.Heading=It;exports.Input=xe;exports.Label=Ye;exports.Lead=Dt;exports.Modal=_e;exports.ModalBody=je;exports.ModalFooter=ge;exports.ModalHeader=we;exports.PageContent=Gt;exports.Pagination=ft;exports.Popover=Ge;exports.Progress=Oe;exports.Select=Ne;exports.Separator=Ke;exports.Sheet=it;exports.SheetBody=ct;exports.SheetFooter=dt;exports.SheetHeader=lt;exports.Sidebar=Wt;exports.SidebarContent=Ft;exports.SidebarFooter=Ot;exports.SidebarHeader=Ht;exports.SidebarItem=qt;exports.SidebarSection=Pt;exports.SidebarTrigger=Ut;exports.Skeleton=Ue;exports.Slider=qe;exports.Switch=Pe;exports.Tab=Me;exports.TabList=Le;exports.TabPanel=Ee;exports.TabPanels=Te;exports.Table=ht;exports.TableBody=xt;exports.TableCaption=jt;exports.TableCell=wt;exports.TableHead=bt;exports.TableHeader=_t;exports.TableRow=pt;exports.Tabs=Re;exports.Text=Et;exports.Textarea=pe;exports.ToastProvider=ar;exports.Tooltip=Ie;exports.cn=m;exports.useAppLayout=re;exports.useToast=nr;
|
|
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;
|
package/dist/index.d.ts
CHANGED
|
@@ -9,7 +9,7 @@
|
|
|
9
9
|
* - Button — Interactive actions and CTAs
|
|
10
10
|
* - Badge — Status labels and indicators
|
|
11
11
|
* - Card — Content containers (+ CardHeader, CardBody, CardFooter)
|
|
12
|
-
* - Field — Form field wrapper
|
|
12
|
+
* - Field — Form field wrapper (props-based) + composable parts (FieldLabel, FieldDescription, FieldError, FieldGroup, FieldSet)
|
|
13
13
|
* - Input — Text input with optional icons
|
|
14
14
|
* - Textarea — Multi-line text input
|
|
15
15
|
* - Modal — Dialog overlay with focus trap (+ ModalHeader, ModalBody, ModalFooter)
|
|
@@ -21,6 +21,8 @@
|
|
|
21
21
|
* - Accordion — Collapsible sections (+ AccordionItem, AccordionTrigger, AccordionContent)
|
|
22
22
|
* - Avatar — User avatar with image fallback and status dot
|
|
23
23
|
* - Checkbox — Checkbox input with indeterminate state
|
|
24
|
+
* - RadioGroup — Controlled single-choice group (+ Radio); options array or composable children
|
|
25
|
+
* - RichTextEditor — Controlled WYSIWYG editor (HTML value); toolbar bold/italic/heading/list/link; zero deps
|
|
24
26
|
* - Switch — Toggle switch (on/off)
|
|
25
27
|
* - Slider — Range input with custom track
|
|
26
28
|
* - Progress — Linear progress bar with indeterminate mode
|
|
@@ -35,6 +37,18 @@
|
|
|
35
37
|
* - Breadcrumb — Navigation trail (+ BreadcrumbItem)
|
|
36
38
|
* - Pagination — Page navigation control
|
|
37
39
|
* - Table — Data table (+ TableHead, TableBody, TableRow, TableHeader, TableCell, TableCaption)
|
|
40
|
+
* - ButtonGroup — Groups buttons horizontally/vertically with optional border collapse (attached mode)
|
|
41
|
+
* - TagsInput — Multi-tag input: Enter/comma to add, × to remove, Backspace to delete last
|
|
42
|
+
* - Combobox — Searchable select: type to filter options, keyboard navigation, controlled value
|
|
43
|
+
* - DataGrid — Table with built-in column sorting (asc/desc), loading skeletons, empty state
|
|
44
|
+
* - Tag — Standalone display tag/chip: variant, size, onRemove (× button), onClick (interactive)
|
|
45
|
+
* - TagGroup — Read-only container that lays out multiple Tag elements with wrapping + gap
|
|
46
|
+
* - Item — Layout primitive for list/settings rows (+ ItemGroup, ItemMedia, ItemContent, ItemTitle, ItemDescription, ItemActions)
|
|
47
|
+
* - Calendar — Inline date grid; mode single/range/multiple, optional time
|
|
48
|
+
* - DatePicker — Input trigger + popover Calendar (single/range/multiple)
|
|
49
|
+
* - DateRangePicker — Start/end date range picker with dual-month view and preset shortcuts; built on Calendar
|
|
50
|
+
* - Kanban — Controlled board with drag-and-drop cards between columns; native HTML5 DnD, zero deps
|
|
51
|
+
* - Conversation — Controlled chat/inbox thread: grouped bubbles, avatars, day separators, status, optional composer
|
|
38
52
|
*
|
|
39
53
|
* CSS must be imported separately:
|
|
40
54
|
* import "@usevyre/tokens/css"; ← design tokens (required)
|
|
@@ -43,7 +57,7 @@
|
|
|
43
57
|
export { Button } from "./components/Button/Button";
|
|
44
58
|
export { Badge } from "./components/Badge/Badge";
|
|
45
59
|
export { Card, CardHeader, CardBody, CardFooter } from "./components/Card/Card";
|
|
46
|
-
export { Field, Input, Textarea } from "./components/Input/Input";
|
|
60
|
+
export { Field, FieldLabel, FieldDescription, FieldError, FieldGroup, FieldSet, Input, Textarea, } from "./components/Input/Input";
|
|
47
61
|
export { Modal, ModalHeader, ModalBody, ModalFooter } from "./components/Modal/Modal";
|
|
48
62
|
export { ToastProvider, useToast } from "./components/Toast/Toast";
|
|
49
63
|
export { Select } from "./components/Select/Select";
|
|
@@ -52,6 +66,8 @@ export { Tooltip } from "./components/Tooltip/Tooltip";
|
|
|
52
66
|
export { Accordion, AccordionItem, AccordionTrigger, AccordionContent } from "./components/Accordion/Accordion";
|
|
53
67
|
export { Avatar } from "./components/Avatar/Avatar";
|
|
54
68
|
export { Checkbox } from "./components/Checkbox/Checkbox";
|
|
69
|
+
export { RadioGroup, Radio } from "./components/Radio/Radio";
|
|
70
|
+
export { RichTextEditor } from "./components/RichTextEditor/RichTextEditor";
|
|
55
71
|
export { Switch } from "./components/Switch/Switch";
|
|
56
72
|
export { Slider } from "./components/Slider/Slider";
|
|
57
73
|
export { Progress } from "./components/Progress/Progress";
|
|
@@ -66,7 +82,18 @@ export { Breadcrumb, BreadcrumbItem, BreadcrumbLink, BreadcrumbSeparator } from
|
|
|
66
82
|
export { Pagination } from "./components/Pagination/Pagination";
|
|
67
83
|
export { Table, TableHead, TableBody, TableRow, TableHeader, TableCell, TableCaption, } from "./components/Table/Table";
|
|
68
84
|
export { Command, CommandInput, CommandList, CommandEmpty, CommandGroup, CommandItem, CommandSeparator, CommandDialog, } from "./components/Command/Command";
|
|
69
|
-
export {
|
|
85
|
+
export { ButtonGroup } from "./components/ButtonGroup/ButtonGroup";
|
|
86
|
+
export { TagsInput } from "./components/TagsInput/TagsInput";
|
|
87
|
+
export { Combobox } from "./components/Combobox/Combobox";
|
|
88
|
+
export { DataGrid } from "./components/DataGrid/DataGrid";
|
|
89
|
+
export { Tag } from "./components/Tag/Tag";
|
|
90
|
+
export { TagGroup } from "./components/Tag/TagGroup";
|
|
91
|
+
export { Calendar } from "./components/Calendar/Calendar";
|
|
92
|
+
export { DatePicker } from "./components/Calendar/DatePicker";
|
|
93
|
+
export { DateRangePicker } from "./components/DateRangePicker/DateRangePicker";
|
|
94
|
+
export { Item, ItemGroup, ItemMedia, ItemContent, ItemTitle, ItemDescription, ItemActions, } from "./components/Item/Item";
|
|
95
|
+
export { Kanban } from "./components/Kanban/Kanban";
|
|
96
|
+
export { Conversation } from "./components/Conversation/Conversation";
|
|
70
97
|
export type { CalendarProps, CalendarSingleProps, CalendarRangeProps, CalendarMultipleProps, CalendarBaseProps, DatePickerProps, CalendarMode, } from "./components/Calendar/Calendar";
|
|
71
98
|
export { Text, Heading, Lead, Code, Blockquote } from "./components/Typography/Typography";
|
|
72
99
|
export type { TextProps, HeadingProps, LeadProps, CodeProps, BlockquoteProps, } from "./components/Typography/Typography";
|
|
@@ -75,7 +102,7 @@ export type { AppLayoutProps, AppShellProps, AppBarProps, PageContentProps, Side
|
|
|
75
102
|
export type { ButtonProps } from "./components/Button/Button";
|
|
76
103
|
export type { BadgeProps } from "./components/Badge/Badge";
|
|
77
104
|
export type { CardProps, CardSectionProps } from "./components/Card/Card";
|
|
78
|
-
export type { FieldProps, InputProps, TextareaProps } from "./components/Input/Input";
|
|
105
|
+
export type { FieldProps, FieldLabelProps, FieldDescriptionProps, FieldErrorProps, FieldGroupProps, FieldSetProps, InputProps, TextareaProps, } from "./components/Input/Input";
|
|
79
106
|
export type { ModalProps, ModalSectionProps, ModalSize } from "./components/Modal/Modal";
|
|
80
107
|
export type { ToastInput, ToastVariant } from "./components/Toast/Toast";
|
|
81
108
|
export type { SelectProps, SelectOption, SelectSize } from "./components/Select/Select";
|
|
@@ -84,6 +111,8 @@ export type { TooltipProps, TooltipPlacement } from "./components/Tooltip/Toolti
|
|
|
84
111
|
export type { AccordionProps, AccordionItemProps, AccordionTriggerProps, AccordionContentProps } from "./components/Accordion/Accordion";
|
|
85
112
|
export type { AvatarProps } from "./components/Avatar/Avatar";
|
|
86
113
|
export type { CheckboxProps } from "./components/Checkbox/Checkbox";
|
|
114
|
+
export type { RadioGroupProps, RadioProps, RadioOption, } from "./components/Radio/Radio";
|
|
115
|
+
export type { RichTextEditorProps, RichTextTool, } from "./components/RichTextEditor/RichTextEditor";
|
|
87
116
|
export type { SwitchProps } from "./components/Switch/Switch";
|
|
88
117
|
export type { SliderProps } from "./components/Slider/Slider";
|
|
89
118
|
export type { ProgressProps } from "./components/Progress/Progress";
|
|
@@ -97,5 +126,15 @@ export type { SheetProps, SheetSectionProps, SheetSide, SheetSize } from "./comp
|
|
|
97
126
|
export type { BreadcrumbProps, BreadcrumbItemProps, BreadcrumbLinkProps } from "./components/Breadcrumb/Breadcrumb";
|
|
98
127
|
export type { PaginationProps } from "./components/Pagination/Pagination";
|
|
99
128
|
export type { TableProps, TableRowProps, TableHeaderProps, TableCellProps, } from "./components/Table/Table";
|
|
129
|
+
export type { ButtonGroupProps } from "./components/ButtonGroup/ButtonGroup";
|
|
130
|
+
export type { TagsInputProps } from "./components/TagsInput/TagsInput";
|
|
131
|
+
export type { ComboboxProps, ComboboxOption } from "./components/Combobox/Combobox";
|
|
132
|
+
export type { DataGridProps, DataGridColumn } from "./components/DataGrid/DataGrid";
|
|
133
|
+
export type { TagProps, TagVariant, TagSize } from "./components/Tag/Tag";
|
|
134
|
+
export type { TagGroupProps, TagGroupGap } from "./components/Tag/TagGroup";
|
|
135
|
+
export type { ItemProps, ItemGroupProps, ItemSectionProps, } from "./components/Item/Item";
|
|
136
|
+
export type { KanbanProps, KanbanColumn, KanbanCard, } from "./components/Kanban/Kanban";
|
|
137
|
+
export type { ConversationProps, ConversationMessage, ConversationStatus, ConversationMessageMeta, ConversationComposerApi, ConversationAttachment, ConversationAttachmentKind, } from "./components/Conversation/Conversation";
|
|
138
|
+
export type { DateRangePickerProps, DateRange, DateRangePreset, } from "./components/DateRangePicker/DateRangePicker";
|
|
100
139
|
export type { Variant, Size, FieldState, BadgeVariant, BaseProps } from "./types";
|
|
101
140
|
export { cn } from "./utils/cn";
|