{"version":3,"file":"Drawer_Prod.D_9ZdDbq.mjs","names":["useState","Drawer"],"sources":["https:/framerusercontent.com/modules/arssV9DesJ6YisqyPbEz/ylzf60TDcMCMnvcpcRzP/Drawer_Prod.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{ControlType,addPropertyControls,RenderTarget}from\"framer\";import{cloneElement,useEffect,useState}from\"react\";// import { Drawer } from \"vaul\";\nimport{Drawer}from\"https://framerusercontent.com/modules/MkKM4qnzfL0r00jXWUFq/o46J0VU6XIkQBQN9PAHj/Bundle.js\";import{ComponentMessage}from\"https://framer.com/m/Utils-FINc.js\";// ------------------------------------------------------------ //\n// PROPERTY CONTROLS\n// ------------------------------------------------------------ //\naddPropertyControls(DrawerFramer,{trigger:{type:ControlType.ComponentInstance},triggerConfig:{type:ControlType.Object,title:\" \",controls:{width:{type:ControlType.Enum,options:[\"default\",\"fill\"],optionTitles:[\"Default\",\"Fill\"],defaultValue:\"default\",displaySegmentedControl:true,segmentedControlDirection:\"vertical\"},height:{type:ControlType.Enum,options:[\"default\",\"fill\"],optionTitles:[\"Default\",\"Fill\"],defaultValue:\"default\",displaySegmentedControl:true,segmentedControlDirection:\"vertical\"}}},content:{type:ControlType.ComponentInstance},contentConfig:{type:ControlType.Object,title:\" \",controls:{canvasPreview:{type:ControlType.Boolean,title:\"Preview\",defaultValue:false},width:{type:ControlType.Enum,options:[\"default\",\"fill\"],optionTitles:[\"Default\",\"Fill\"],defaultValue:\"default\",displaySegmentedControl:true,segmentedControlDirection:\"vertical\"},overlayColor:{type:ControlType.Color,title:\"Overlay Color\",defaultValue:\"rgba(0, 0, 0, 0.4)\"},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"rgb(255,255,255)\"},padding:{// @ts-expect-error - Padding is not in this NPM version\ntype:ControlType.Padding,title:\"Padding\",defaultValue:\"16px\"},radius:{// @ts-expect-error - BorderRadius is not in this NPM version\ntype:ControlType.BorderRadius,title:\"Radius\",defaultValue:\"16px 16px 0px 0px\"},handle:{type:ControlType.Object,controls:{color:{type:ControlType.Color,title:\"Color\",defaultValue:\"rgb(100,100,100)\"},width:{type:ControlType.Number,title:\"Width\",defaultValue:48,unit:\"px\"},height:{type:ControlType.Number,title:\"Height\",defaultValue:6,unit:\"px\"},radius:{// @ts-expect-error - BorderRadius is not in this NPM version\ntype:ControlType.BorderRadius,defaultValue:\"9999px\",title:\"Radius\"},offsetY:{type:ControlType.Number,title:\"Offset Y\",defaultValue:0,min:-100,max:100,unit:\"px\"}}}},description:\"More components at [Framer University](https://frameruni.link/cc).\"}});// ------------------------------------------------------------ //\n// DEFAULT PROPS\n// ------------------------------------------------------------ //\nDrawerFramer.defaultProps={triggerConfig:{width:\"default\",height:\"default\"},contentConfig:{width:\"default\",canvasPreview:false,overlayColor:\"rgba(0, 0, 0, 0.4)\",backgroundColor:\"rgb(255,255,255)\",padding:\"16px\",radius:\"16px 16px 0px 0px\",handle:{color:\"rgb(100,100,100)\",width:48,height:6,radius:\"9999px\",offsetY:0}}};// ------------------------------------------------------------ //\n// MAIN COMPONENT\n// ------------------------------------------------------------ //\n/**\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n * @framerIntrinsicWidth 400\n * @framerIntrinsicHeight 200\n * @framerDisableUnlink\n */export default function DrawerFramer(props){const isOnFramerCanvas=RenderTarget.hasRestrictions();const haveContent=props.content!==undefined&&props.content?.length>0;const haveTrigger=props.trigger!==undefined&&props.trigger?.length>0;// ------------------------------------------------------------ //\n// Resolve portal container so that Framer elements keep their\n// scoped CSS (Framer scoping relies on being a descendant of the\n// element that has the `data-framer-root` attribute).\n// ------------------------------------------------------------ //\nconst[portalContainer,setPortalContainer]=useState(undefined);useEffect(()=>{if(typeof window!==\"undefined\"&&!isOnFramerCanvas){setPortalContainer(document.querySelector(\"[data-framer-root]\")||document.getElementById(\"main\")||undefined);}},[]);if(!haveContent||!haveTrigger){return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\"},children:/*#__PURE__*/_jsx(ComponentMessage,{title:\"Drawer\",subtitle:\"Set up the component by connecting trigger and content to the component or selecting the trigger and content from the component properties.\"})});}// clone the content and set the style hight to 500px\nconst content=/*#__PURE__*/cloneElement(props.content[0],{// @ts-expect-error - This is a Framer component\nstyle:{// @ts-expect-error - This is a Framer component\n...props.content[0].props.style,// @ts-expect-error - This is a Framer component\nheight:props.content[0]?.props.height,width:props.contentConfig.width===\"default\"?props.content[0]?.props.width:\"100%\"}});const trigger=/*#__PURE__*/cloneElement(props.trigger[0],{// @ts-expect-error - This is a Framer component\nstyle:{// @ts-expect-error - This is a Framer component\n...props.trigger[0].props.style,width:props.triggerConfig.width===\"default\"?props.trigger[0].props.width:\"100%\",height:props.triggerConfig.height===\"default\"?props.trigger[0].props.height:\"100%\"}});return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\"},children:/*#__PURE__*/_jsxs(Drawer.Root,{open:isOnFramerCanvas&&props.contentConfig.canvasPreview?true:undefined,container:portalContainer,children:[/*#__PURE__*/_jsx(Drawer.Trigger,{asChild:true,style:{width:props.triggerConfig.width===\"default\"?\"fit-content\":\"100%\",height:props.triggerConfig.height===\"default\"?props.trigger[0].props.height:\"100%\"},children:trigger}),/*#__PURE__*/_jsxs(Drawer.Portal,{children:[/*#__PURE__*/_jsx(Drawer.Overlay,{// @ts-expect-error - Custom bundle don't have proper types\nstyle:{position:\"fixed\",inset:0,zIndex:1e5,backgroundColor:props.contentConfig.overlayColor}}),/*#__PURE__*/_jsx(Drawer.Content,{style:{height:\"fit-content\",width:\"100%\",position:\"fixed\",zIndex:1e5,bottom:0,left:isOnFramerCanvas?300:0,right:isOnFramerCanvas?300:0,outline:\"none\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\"},asChild:true,children:/*#__PURE__*/_jsxs(\"div\",{style:{padding:props.contentConfig.padding,backgroundColor:props.contentConfig.backgroundColor,height:\"fit-content\",width:isOnFramerCanvas?\"60%\":\"100%\",display:\"flex\",flexDirection:\"column\",alignItems:\"center\",justifyContent:\"center\",borderRadius:props.contentConfig.radius},children:[/*#__PURE__*/_jsx(\"div\",{\"aria-hidden\":true,style:{margin:\"0 auto\",width:props.contentConfig.handle.width,height:props.contentConfig.handle.height,flexShrink:0,borderRadius:props.contentConfig.handle.radius,backgroundColor:props.contentConfig.handle.color,transform:`translateY(${props.contentConfig.handle.offsetY}px)`,zIndex:99999}}),content]})})]})]})});}DrawerFramer.displayName=\"Drawer\";\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"DrawerFramer\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"200\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"400\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerDisableUnlink\":\"\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Drawer_Prod.map"],"mappings":"sRAmBG,SAAwB,EAAa,EAAM,CAAC,IAAM,EAAiB,EAAa,iBAAiB,CAAO,EAAY,EAAM,UAAU,IAAA,IAAW,EAAM,SAAS,OAAO,EAAQ,EAAY,EAAM,UAAU,IAAA,IAAW,EAAM,SAAS,OAAO,EAKxO,CAAC,EAAgB,GAAoBA,EAAS,IAAA,GAAU,CAAuL,GAAtL,MAAc,CAAW,IAAS,QAAa,CAAC,GAAkB,EAAmB,SAAS,cAAc,qBAAqB,EAAE,SAAS,eAAe,OAAO,EAAE,IAAA,GAAU,EAAI,EAAE,CAAC,CAAI,CAAC,GAAa,CAAC,EAAa,OAAoB,EAAK,MAAM,CAAC,MAAM,CAAC,MAAM,OAAO,OAAO,OAAO,CAAC,SAAsB,EAAK,EAAiB,CAAC,MAAM,SAAS,SAAS,8IAA8I,CAAC,CAAC,CAAC,CAC5iB,IAAM,EAAqB,EAAa,EAAM,QAAQ,GAAG,CACzD,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