import{r as e,j as a}from"./vendor-react-Dp9pL_Wn.js";import{b as s,d as r,I as o}from"./vendor-ant-cds-bBedrtIN.js";import{ac as t,ad as d,ae as n,af as c,ag as i}from"./vendor-base-ui-DNypCIlh.js";const l=e.createContext({headingLevel:3,flush:!0}),m={"--accordion-px":"var(--cds-pad-md)","--accordion-radius":"var(--cds-radius)"},h={"--cds-outset-x":"var(--accordion-px)"},f=e.forwardRef(({className:r,style:o,multiple:d=!0,headingLevel:n=3,flush:c=!0,...i},h)=>{const f=e.useMemo(()=>({headingLevel:n,flush:c}),[n,c]);return a.jsx(l.Provider,{value:f,children:a.jsx(t,{ref:h,"data-cds":"Accordion",multiple:d,...i,style:"function"==typeof o?e=>({...m,...o(e)}):o?{...m,...o}:m,className:s("font-sans divide-y divide",r)})})});f.displayName="Accordion.Root";const u=e.forwardRef(({className:e,...r},o)=>a.jsx(d,{ref:o,...r,className:s("[&:has(+*:not([data-disabled])>[data-cds=AccordionHeader]:hover)]:border-b-transparent [&[data-closed]:not([data-disabled]):has(>[data-cds=AccordionHeader]:hover)]:border-b-transparent",e)}));u.displayName="Accordion.Item";const x=e.forwardRef(({className:t,children:d,...i},m)=>{const f="comfortable"===r()?"md":"sm",{headingLevel:u,flush:x}=e.useContext(l),p=`h${u}`;return a.jsx(n,{"data-cds":"AccordionHeader",render:a.jsx(p,{}),className:s("flex",x&&"mx-outset w-stretch"),style:x?h:void 0,children:a.jsxs(c,{ref:m,"data-size":"lg",...i,className:s("cds-reset group/acc flex w-full items-center gap-sm h-control rounded-[var(--accordion-radius)] px-[var(--accordion-px)] text-left text-body font-medium text-primary select-none outline-none hover:bg-fill-ghost-hover focus-visible:bg-fill-ghost-hover focus-visible:[box-shadow:inset_0_0_0_1px_var(--cds-fill-accent)] data-[disabled]:opacity-50 data-[disabled]:pointer-events-none",t),children:[a.jsx("span",{className:"min-w-0 flex-1 truncate",children:d}),a.jsx(o,{name:"CaretRight",size:f,className:"shrink-0 text-muted transition-transform group-data-[panel-open]/acc:rotate-90"})]})})});x.displayName="Accordion.Trigger";const p=e.forwardRef(({className:r,children:o,...t},d)=>{const{flush:n}=e.useContext(l);return a.jsx(i,{ref:d,...t,className:s("overflow-hidden text-body text-secondary h-[var(--accordion-panel-height)] transition-[height] duration-150 ease-out data-[starting-style]:h-0 data-[ending-style]:h-0",r),children:a.jsx("div",{className:s("py-md",!n&&"px-[var(--accordion-px)]"),children:o})})});p.displayName="Accordion.Panel";const v={Root:f,Item:u,Trigger:x,Panel:p};export{v as A};
