import{j as n}from"./jsx-runtime-CnH95YSl.js";import{w as V,a as h,e as b,u as m}from"./index-BJMTVygn.js";import{r as u}from"./index-NdkWRN8K.js";import{O as L}from"./OdysseyStorybookThemeDecorator-BuDiOG2V.js";import{M as o}from"./Accordion-BNJn0pfW.js";import"./_commonjsHelpers-gnU0ypJ3.js";import"./OdysseyThemeProvider-Bh0Bu-2o.js";import"./index-BJTM6NaI.js";import"./OdysseyProvider-qIn9QVYS.js";import"./Typography-Cz6D417Y.js";import"./Typography-ClQ35Rr-.js";import"./useUniqueId-Bsgqe1tm.js";import"./createUniqueId-ByTaVY63.js";import"./AccordionSummary-BjqT0nEb.js";import"./useSlot-CvpE2t6D.js";import"./resolveComponentProps-DXQ8X87i.js";import"./isHostComponent-DVu5iVWx.js";import"./useIsFocusVisible-DH0qxT5e.js";import"./useControlled-NQulfz4l.js";import"./Collapse-DfdoVIdP.js";import"./utils-kUZVaD1e.js";import"./inheritsLoose-CJ6Ie9dp.js";import"./index-B5xazMy1.js";import"./index-DieBXP3Z.js";import"./TransitionGroupContext-DAL84N7p.js";import"./Paper-D-_O-EjU.js";import"./ButtonBase-BNqa2TMD.js";import"./assertThisInitialized-B9jnkVVz.js";const de={component:o,decorators:[L],argTypes:{children:{control:"text",description:"",table:{type:{summary:"ReactNode"}}},label:{control:"text",description:"",table:{type:{summary:"string"}}},isDisabled:{control:"boolean",description:"",table:{type:{summary:"boolean"}}},isExpanded:{control:"boolean",description:"",table:{type:{summary:"boolean"}}},variant:{control:"select",options:["default","borderless"],description:"Visual style for the accordion",table:{type:{summary:"string"},defaultValue:{summary:"default"}}}},args:{children:"Lorem ipsum dolor sit amet.",isDisabled:!1,isExpanded:void 0,label:"Label",variant:"default"}},s={args:{children:"This is the content of the box."},render:function(e){return n.jsx(o,{isDisabled:e.isDisabled,isExpanded:e.isExpanded,label:e.label,variant:e.variant,children:e.children})}},c={args:{children:"This is the content of the box.",variant:"borderless"},render:function(e){return n.jsx(o,{isDisabled:e.isDisabled,isExpanded:e.isExpanded,label:e.label,variant:e.variant,children:e.children})}},d={args:{children:"This is the content of the box."},render:function(e){return n.jsxs(n.Fragment,{children:[n.jsx(o,{isDisabled:e.isDisabled,isExpanded:e.isExpanded,label:e.label,children:e.children}),n.jsx(o,{label:"Accordion 2",children:"This is the second accordion item."}),n.jsx(o,{label:"Accordion 3",children:"This is the third accordion item."}),n.jsx(o,{label:"Accordion 4",children:"This is the fourth accordion item."}),n.jsx(o,{label:"Accordion 5",children:"This is the fifth accordion item."})]})}},l={args:{children:"This is the content of the box.",isDisabled:!0},render:function(e){return n.jsx(o,{isDisabled:e.isDisabled,label:"Label",children:e.children})}},p={args:{children:"This is the content of the box."},render:function(e){const[t,a]=u.useState(!0),i=u.useCallback((R,k)=>a(k),[]);return n.jsx(o,{isExpanded:t,label:"Label",onChange:i,children:e.children})},play:async({canvasElement:r,step:e})=>{await e("Accordion Expanded",async()=>{const t=V(r),a=t.getByRole("button"),i=t.getByRole("region");await h(()=>{b(i).toBeVisible()}),await m.click(a),await h(()=>{b(i).not.toBeVisible()}),await m.click(a),await h(()=>{b(i).toBeVisible()})})}};var x,f,A;s.parameters={...s.parameters,docs:{...(x=s.parameters)==null?void 0:x.docs,source:{originalSource:`{
  args: {
    children: "This is the content of the box."
  },
  render: function C(props: AccordionProps) {
    return <Accordion isDisabled={props.isDisabled} isExpanded={props.isExpanded} label={props.label} variant={props.variant}>
        {props.children}
      </Accordion>;
  }
}`,...(A=(f=s.parameters)==null?void 0:f.docs)==null?void 0:A.source}}};var g,E,y;c.parameters={...c.parameters,docs:{...(g=c.parameters)==null?void 0:g.docs,source:{originalSource:`{
  args: {
    children: "This is the content of the box.",
    variant: "borderless"
  },
  render: function C(props: AccordionProps) {
    return <Accordion isDisabled={props.isDisabled} isExpanded={props.isExpanded} label={props.label} variant={props.variant}>
        {props.children}
      </Accordion>;
  }
}`,...(y=(E=c.parameters)==null?void 0:E.docs)==null?void 0:y.source}}};var v,D,C;d.parameters={...d.parameters,docs:{...(v=d.parameters)==null?void 0:v.docs,source:{originalSource:`{
  args: {
    children: "This is the content of the box."
  },
  render: function C(props: AccordionProps) {
    return <>
        <Accordion isDisabled={props.isDisabled} isExpanded={props.isExpanded} label={props.label}>
          {props.children}
        </Accordion>
        <Accordion label="Accordion 2">
          This is the second accordion item.
        </Accordion>
        <Accordion label="Accordion 3">
          This is the third accordion item.
        </Accordion>
        <Accordion label="Accordion 4">
          This is the fourth accordion item.
        </Accordion>
        <Accordion label="Accordion 5">
          This is the fifth accordion item.
        </Accordion>
      </>;
  }
}`,...(C=(D=d.parameters)==null?void 0:D.docs)==null?void 0:C.source}}};var w,T,j;l.parameters={...l.parameters,docs:{...(w=l.parameters)==null?void 0:w.docs,source:{originalSource:`{
  args: {
    children: "This is the content of the box.",
    isDisabled: true
  },
  render: function C(props: AccordionProps) {
    return <Accordion isDisabled={props.isDisabled} label="Label">
        {props.children}
      </Accordion>;
  }
}`,...(j=(T=l.parameters)==null?void 0:T.docs)==null?void 0:j.source}}};var B,S,P;p.parameters={...p.parameters,docs:{...(B=p.parameters)==null?void 0:B.docs,source:{originalSource:`{
  args: {
    children: "This is the content of the box."
  },
  render: function C(props: AccordionProps) {
    const [isExpanded, setIsExpanded] = useState(true);
    const onChange = useCallback<NonNullable<AccordionProps["onChange"]>>((_event, expanded) => setIsExpanded(expanded), []);
    return <Accordion isExpanded={isExpanded} label="Label" onChange={onChange}>
        {props.children}
      </Accordion>;
  },
  play: async ({
    canvasElement,
    step
  }: PlaywrightProps<AccordionProps>) => {
    await step("Accordion Expanded", async () => {
      const canvas = within(canvasElement);
      const accordion = canvas.getByRole("button");
      const accordionContent = canvas.getByRole("region");
      await waitFor(() => {
        expect(accordionContent).toBeVisible();
      });
      await userEvent.click(accordion);
      await waitFor(() => {
        expect(accordionContent).not.toBeVisible();
      });
      await userEvent.click(accordion);
      await waitFor(() => {
        expect(accordionContent).toBeVisible();
      });
    });
  }
}`,...(P=(S=p.parameters)==null?void 0:S.docs)==null?void 0:P.source}}};const le=["Single","Borderless","Multi","Disabled","Expanded"];export{c as Borderless,l as Disabled,p as Expanded,d as Multi,s as Single,le as __namedExportsOrder,de as default};
