{"version":3,"file":"CollapsibleList.B3uvBiZP.mjs","names":["useState","useRef"],"sources":["https:/framerusercontent.com/modules/2BdNj9cDGpHKKtTXLBEJ/5WuJ7rFgdM8JW2ygZNsp/CollapsibleList.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState,useRef,useEffect}from\"react\";export default function CollapsibleList(props){const{children,collapsedHeight=400,buttonTextExpand=\"Ver todas las oposiciones\",buttonTextCollapse=\"Ver menos\",buttonColor=\"rgba(255,255,255,0.1)\",buttonTextColor=\"rgb(255,255,255)\",animationDuration=.4,gradientColor=\"rgb(0,0,0)\",style}=props;const[expanded,setExpanded]=useState(false);const[needsCollapse,setNeedsCollapse]=useState(false);const contentRef=useRef(null);useEffect(()=>{if(contentRef.current){setNeedsCollapse(contentRef.current.scrollHeight>collapsedHeight+20);}});return /*#__PURE__*/_jsxs(\"div\",{style:{width:\"100%\",...style},children:[/*#__PURE__*/_jsx(\"div\",{ref:contentRef,style:{overflow:\"hidden\",maxHeight:!needsCollapse||expanded?\"none\":collapsedHeight,transition:`max-height ${animationDuration}s ease-in-out`},children:children}),needsCollapse&&!expanded&&/*#__PURE__*/_jsx(\"div\",{style:{marginTop:-80,height:80,background:`linear-gradient(to bottom, transparent, ${gradientColor})`,pointerEvents:\"none\",position:\"relative\",zIndex:1}}),needsCollapse&&/*#__PURE__*/_jsx(\"div\",{style:{display:\"flex\",justifyContent:\"center\",paddingTop:expanded?16:0,position:\"relative\",zIndex:2},children:/*#__PURE__*/_jsx(\"button\",{onClick:()=>setExpanded(!expanded),style:{background:buttonColor,color:buttonTextColor,border:\"1px solid rgba(255,255,255,0.2)\",borderRadius:40,padding:\"12px 28px\",fontSize:14,fontWeight:500,fontFamily:\"Inter, sans-serif\",cursor:\"pointer\",transition:\"background 0.2s\"},children:expanded?buttonTextCollapse:buttonTextExpand})})]});}addPropertyControls(CollapsibleList,{children:{type:ControlType.ComponentInstance,title:\"Contenido\"},collapsedHeight:{type:ControlType.Number,title:\"Altura colapsado\",defaultValue:400,min:100,max:1e3,step:10,unit:\"px\"},buttonTextExpand:{type:ControlType.String,title:\"Texto expandir\",defaultValue:\"Ver todas las oposiciones\"},buttonTextCollapse:{type:ControlType.String,title:\"Texto colapsar\",defaultValue:\"Ver menos\"},buttonColor:{type:ControlType.Color,title:\"Color boton\",defaultValue:\"rgba(255,255,255,0.1)\"},buttonTextColor:{type:ControlType.Color,title:\"Color texto\",defaultValue:\"rgb(255,255,255)\"},gradientColor:{type:ControlType.Color,title:\"Color gradiente\",defaultValue:\"rgb(0,0,0)\"},animationDuration:{type:ControlType.Number,title:\"Duracion anim.\",defaultValue:.4,min:.1,max:1,step:.1,unit:\"s\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"CollapsibleList\",\"slots\":[\"children\"],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./CollapsibleList.map"],"mappings":"+LAA0J,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,WAAS,kBAAgB,IAAI,mBAAiB,4BAA4B,qBAAmB,YAAY,cAAY,wBAAwB,kBAAgB,mBAAmB,oBAAkB,GAAG,gBAAc,aAAa,SAAO,EAAW,CAAC,EAAS,GAAaA,EAAS,EAAK,EAAO,CAAC,EAAc,GAAkBA,EAAS,EAAK,EAAQ,EAAWC,EAAO,IAAI,EAAiH,OAA/G,MAAc,CAAI,EAAW,SAAS,EAAiB,EAAW,QAAQ,aAAa,EAAgB,EAAE,CAAG,CAAC,EAAsB,EAAM,MAAM,CAAC,MAAM,CAAC,MAAM,OAAO,GAAG,CAAK,EAAE,SAAS,CAAc,EAAK,MAAM,CAAC,IAAI,EAAW,MAAM,CAAC,SAAS,SAAS,UAAU,CAAC,GAAe,EAAS,OAAO,EAAgB,WAAW,cAAc,EAAkB,cAAc,EAAW,UAAQ,CAAC,E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