globalThis.process??={},globalThis.process.env??={};import{i as e,t}from"./react.DbQyqGaC.js";import{t as n}from"./jsx-runtime.Cwe9agoV.js";import{r,t as i}from"./cva.v6DJ-q0A.js";var a=e(t(),1),o=n(),s=a.createContext(null);function c(){return a.useContext(s)}function l({label:e,htmlFor:t,hint:n,error:r,required:i,children:c}){let l=a.useId(),u=t??l,d=n?`${u}-hint`:void 0,f=r?`${u}-error`:void 0,p=[d,f].filter(Boolean).join(` `)||void 0;return(0,o.jsx)(s.Provider,{value:{id:u,invalid:!!r,required:i,describedBy:p},children:(0,o.jsxs)(`div`,{className:`flex flex-col gap-1`,children:[(0,o.jsxs)(`label`,{htmlFor:u,className:`text-sm font-medium text-fg`,children:[e,i?(0,o.jsx)(`span`,{"aria-hidden":`true`,children:` *`}):null]}),c,n?(0,o.jsx)(`span`,{id:d,className:`text-sm text-fg-muted`,children:n}):null,r?(0,o.jsx)(`span`,{id:f,role:`alert`,className:`text-sm text-danger`,children:r}):null]})})}var u=r(`w-full rounded-md border border-border bg-surface text-fg focus-visible:outline-[var(--mod-focus-ring-width)] focus-visible:outline-[var(--mod-focus-ring-color)] focus-visible:outline-offset-[var(--mod-focus-ring-offset)] disabled:cursor-not-allowed disabled:opacity-[var(--mod-opacity-disabled)] read-only:bg-[var(--mod-color-neutral-2)]`,{variants:{size:{sm:`text-sm px-2 py-1`,md:`text-base px-3 py-2`,lg:`text-lg px-4 py-3`},invalid:{true:`border-[var(--mod-color-danger-9)] aria-invalid:border-[var(--mod-color-danger-9)] aria-invalid:focus-visible:outline-[var(--mod-color-danger-9)]`,false:``}},defaultVariants:{size:`md`,invalid:!1}}),d=a.forwardRef(({className:e,size:t,invalid:n,type:r=`text`,id:a,"aria-invalid":s,"aria-describedby":l,...d},f)=>{let p=c(),m=n??p?.invalid??!1;return(0,o.jsx)(`input`,{ref:f,type:r,id:a??p?.id,"aria-invalid":s??(m?!0:void 0),"aria-describedby":l??p?.describedBy,"aria-required":d.required??p?.required,className:i(u({size:t,invalid:m}),e),...d})});d.displayName=`Input`;export{l as n,c as r,d as t};