"use strict";const r=require("react/jsx-runtime"),p=require("react"),$=require("./heading-DLCdW6gx.js"),j=require("./bind-DeUYJ6m9.js"),f=require("./chevron-down.es-BMjgiS3F.js"),q=require("./paragraph-BsI53OR0.js"),C={"purpur-accordion":"_purpur-accordion_mwmy0_1","purpur-accordion__title":"_purpur-accordion__title_mwmy0_4","purpur-accordion--negative":"_purpur-accordion--negative_mwmy0_13"},A={"purpur-accordion-item":"_purpur-accordion-item_1du2l_1","purpur-accordion-item__trigger":"_purpur-accordion-item__trigger_1du2l_4","purpur-accordion-item__header":"_purpur-accordion-item__header_1du2l_10","purpur-accordion-item__trigger__icon":"_purpur-accordion-item__trigger__icon_1du2l_43","purpur-accordion-item__title":"_purpur-accordion-item__title_1du2l_49","purpur-accordion-item__icon":"_purpur-accordion-item__icon_1du2l_50","purpur-accordion-item__rotate":"_purpur-accordion-item__rotate_1du2l_64","purpur-accordion-item__content":"_purpur-accordion-item__content_1du2l_67","purpur-accordion-item__contentText":"_purpur-accordion-item__contentText_1du2l_82","purpur-accordion-item__contentText--limit-width":"_purpur-accordion-item__contentText--limit-width_1du2l_85","purpur-accordion-item--negative":"_purpur-accordion-item--negative_1du2l_107"},i=j.c.bind(A),t="purpur-accordion-item",H=({children:o,className:c,fullWidth:a=!1,title:_,titleTag:l="h3",initialOpen:m=!1,onClick:n,onOpen:u,onClose:d,...y})=>{const N=p.useContext(x),s=p.useId(),[e,b]=p.useState(!m),w=i([t,{[`${t}--negative`]:N},c]);return r.jsxs("div",{className:w,...y,children:[r.jsx($.Heading,{tag:l,variant:"title-100",className:i([`${t}__header`,`${t}__title`]),children:r.jsxs("button",{type:"button","data-state":e?"open":"close",onClick:T=>{n&&n(T),e?u&&u():d&&d(),b(!e)},className:i(`${t}__trigger`,c,{[`${t}__rotate`]:!e}),"aria-expanded":!e,"aria-controls":s,id:s+"button",children:[_,r.jsx(f.l,{size:"md",className:i(`${t}__icon`),"aria-hidden":!0})]})}),r.jsx("div",{className:i(`${t}__content`,c),"aria-hidden":e,id:s,"aria-labelledby":s+"button",role:"region",children:r.jsx("div",{className:i(`${t}__contentText`,{[`${t}__contentText--limit-width`]:!a}),children:typeof o=="string"?r.jsx(q.Paragraph,{variant:"paragraph-200",children:o}):o})})]})},v=j.c.bind(C),g="purpur-accordion",x=p.createContext(!1),h=({children:o,className:c,negative:a=!1,title:_,titleTag:l="h2",titleVariant:m="title-300",schema:n,...u})=>{const d=v([g,{[`${g}--negative`]:a},c]);return r.jsxs("div",{className:d,...u,children:[_&&r.jsx($.Heading,{tag:l,variant:m,className:v(`${g}__title`),children:_}),r.jsx(x.Provider,{value:a,children:o}),n&&r.jsx("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:n}})]})};h.Item=H;h.displayName="Accordion";exports.Accordion=h;exports.NegativeContext=x;
//# sourceMappingURL=accordion-CF2fj2uq.js.map
