"use strict";const o=require("react/jsx-runtime"),t=require("react"),d=require("@chakra-ui/react"),P=require("./useObjectRef-4v2MxSjQ.cjs.js"),h=require("./Button-DLCecw8f.cjs.js"),S=require("@chakra-ui/react/styled-system"),j=require("./extract-style-props-B4hqila-.cjs.js"),q=require("./mergeProps-CxnHrnow.cjs.js"),C=require("./useDisclosureState-mIvoKolL.cjs.js"),x=t.createContext(void 0);function M(){const e=t.useContext(x);if(e===void 0)throw new Error("useCollapsibleMotionContext must be used within a CollapsibleMotion.Root component");return e}const{withProvider:y,withContext:R}=d.createSlotRecipeContext({key:"collapsibleMotion"}),w=y("div","root"),v=R("button","trigger"),E=R("div","content"),u=t.forwardRef(({children:e,defaultExpanded:r=!1,isExpanded:i,onExpandedChange:l,isDisabled:n=!1,...a},s)=>{const c=C.$bf996d45f4a36925$export$3fcbf6e4407997e0({defaultExpanded:r,isExpanded:i,onExpandedChange:l}),p=t.useRef(null),{buttonProps:$,panelProps:g}=C.$5e910fae8e128ead$export$6e3e27031a30522f({isDisabled:n},c,p),m={isDisabled:n,isExpanded:c.isExpanded,buttonProps:$,panelProps:g,panelRef:p};return o.jsx(x.Provider,{value:m,children:o.jsx(w,{ref:s,...a,children:e})})});u.displayName="CollapsibleMotion.Root";const f=t.forwardRef(({children:e,asChild:r,...i},l)=>{const{buttonProps:n,isDisabled:a}=M(),s=q.$3ef42575df84b30b$export$9d1611c77c2fe928(i,n,{disabled:a});if(r)return o.jsx(S.chakra.button,{asChild:!0,...s,children:e});const[c,p]=j.extractStyleProps(s);return o.jsx(v,{ref:l,...c,asChild:!0,children:o.jsx(h.$d2b4bc8c273e7be6$export$353f5b6fc5456de1,{...p,children:e})})});f.displayName="CollapsibleMotion.Trigger";const b=t.forwardRef(({children:e,...r},i)=>{const{panelProps:l,isExpanded:n}=M(),a=t.useRef(null),s=P.$df56164dff5785e2$export$4338b53315abf666(d.mergeRefs(a,i));return o.jsx(E,{ref:s,...r,...l,asChild:!0,children:o.jsx(d.Presence,{present:n,animationName:{_open:"slide-from-top, fade-in",_closed:"slide-to-top, fade-out"},animationDuration:"fast",children:e})})});b.displayName="CollapsibleMotion.Content";const T={Root:u,Trigger:f,Content:b};exports.CollapsibleMotion=T;exports.CollapsibleMotionContent=b;exports.CollapsibleMotionRoot=u;exports.CollapsibleMotionTrigger=f;
//# sourceMappingURL=collapsible-motion-Biq0QGUr.cjs.js.map
