import{r as e,j as a}from"./vendor-react-Dp9pL_Wn.js";import{b as s,d as r,I as t}from"./vendor-ant-cds-BLsR_p72.js";import{ac as d,ad as o,ae as n,af as c,ag as i}from"./vendor-base-ui-N1VQ4ctE.js";const l=e.createContext({headingLevel:3,flush:!0}),h={"--accordion-px":"var(--cds-pad-md)","--accordion-radius":"var(--cds-radius)"},f={"--cds-outset-x":"var(--accordion-px)"},m=e.forwardRef(({className:r,style:t,multiple:o=!0,headingLevel:n=3,flush:c=!0,...i},f)=>{const m=e.useMemo(()=>({headingLevel:n,flush:c}),[n,c]);return a.jsx(l.Provider,{value:m,children:a.jsx(d,{ref:f,"data-cds":"Accordion",multiple:o,...i,style:"function"==typeof t?e=>({...h,...t(e)}):t?{...h,...t}:h,className:s("font-sans divide-y divide",r)})})}),u=e.forwardRef(({className:e,...r},t)=>a.jsx(o,{ref:t,...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)})),x=e.forwardRef(({className:d,children:o,...i},h)=>{const m="comfortable"===r()?"md":"sm",{headingLevel:u,flush:x}=e.useContext(l),v=`h${u}`;return a.jsx(n,{"data-cds":"AccordionHeader",render:a.jsx(v,{}),className:s("flex",x&&"mx-outset w-stretch"),style:x?f:void 0,children:a.jsxs(c,{ref:h,"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",d),children:[a.jsx("span",{className:"min-w-0 flex-1 truncate",children:o}),a.jsx(t,{name:"CaretRight",size:m,className:"shrink-0 text-muted transition-transform group-data-[panel-open]/acc:rotate-90"})]})})}),v={Root:m,Item:u,Trigger:x,Panel:e.forwardRef(({className:r,children:t,...d},o)=>{const{flush:n}=e.useContext(l);return a.jsx(i,{ref:o,...d,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:t})})})};export{v as A};
