-import{a as n,j as s}from"./tw-merge-4486aaf0.js";import{r as Y}from"./index-f46741a2.js";import{C as e}from"./index-b2a88d73.js";import"./clsx.m-1229b3e0.js";import"./CollapseContent-4c7c3cf3.js";const re={title:"Data Display/Collapse",component:e,args:{className:"bg-base-200"}},g=t=>n(e,{...t,children:[s(e.Title,{className:"text-xl font-medium",children:"Focus me to see content"}),s(e.Content,{children:'tabindex="0" attribute is necessary to make the div focusable'})]}),a=g.bind({});a.args={};const r=t=>n(e,{...t,children:[s(e.Title,{className:"text-xl font-medium",children:"Click me to show/hide content"}),s(e.Content,{children:"hello"})]});r.args={checkbox:!0};const c=g.bind({});c.args={className:"border border-base-300 bg-base-200"};const l=g.bind({});l.args={className:"border border-base-300 bg-base-200",icon:"arrow"};const i=g.bind({});i.args={className:"border border-base-300 bg-base-200",icon:"plus"};const p=t=>n(e,{...t,children:[s(e.Title,{className:"text-xl font-medium",children:"I have collapse-open class"}),s(e.Content,{children:'tabindex="0" attribute is necessary to make the div focusable'})]});p.args={className:"border border-base-300 bg-base-200",open:!0};const d=t=>n(e,{...t,children:[s(e.Title,{className:"text-xl font-medium",children:"I have collapse-close class"}),s(e.Content,{children:'tabindex="0" attribute is necessary to make the div focusable'})]});d.args={className:"border border-base-300 bg-base-200",open:!1};const m=t=>n(e,{...t,className:"group",children:[s(e.Title,{className:"bg-primary text-primary-content group-focus:bg-secondary group-focus:text-secondary-content",children:"Focus me to see content"}),s(e.Content,{className:"bg-primary text-primary-content group-focus:bg-secondary group-focus:text-secondary-content",children:s("p",{children:'tabindex="0" attribute is necessary to make the div focusable'})})]}),u=t=>n(e,{...t,className:"group",checkbox:!0,children:[s(e.Title,{className:"bg-primary text-primary-content peer-checked:bg-secondary peer-checked:text-secondary-content",children:"Click me to show/hide content"}),s(e.Content,{className:"bg-primary text-primary-content peer-checked:bg-secondary peer-checked:text-secondary-content",children:s("p",{children:'tabindex="0" attribute is necessary to make the div focusable'})})]}),h=t=>{const[b,o]=Y.useState(!1);return n("div",{children:[n("span",{children:["Checkbox is ",b?"open":"closed","."]}),n(e,{...t,className:"group",onClose:()=>{o(!1)},onOpen:()=>{o(!0)},onToggle:()=>{console.log("toggled!")},children:[s(e.Title,{className:"bg-primary text-primary-content peer-checked:bg-secondary peer-checked:text-secondary-content",children:"Click me to show/hide content"}),s(e.Content,{className:"bg-primary text-primary-content peer-checked:bg-secondary peer-checked:text-secondary-content",children:s("p",{children:'tabindex="0" attribute is necessary to make the div focusable'})})]})]})},C=t=>{const[b,o]=Y.useState(!1);return n("div",{children:[n("span",{children:["Checkbox is ",b?"open":"closed","."]}),n(e,{...t,className:"group",onClose:()=>{o(!1)},onOpen:()=>{o(!0)},onToggle:()=>{console.log("toggled!")},checkbox:!0,children:[s(e.Title,{className:"bg-primary text-primary-content peer-checked:bg-secondary peer-checked:text-secondary-content",children:"Click me to show/hide content"}),s(e.Content,{className:"bg-primary text-primary-content peer-checked:bg-secondary peer-checked:text-secondary-content",children:s("p",{children:'tabindex="0" attribute is necessary to make the div focusable'})})]})]})};var x,y,k;a.parameters={...a.parameters,docs:{...(x=a.parameters)==null?void 0:x.docs,source:{originalSource:`args => {
0 commit comments