UNPKG

@tapie-kr/inspire-react

Version:

React Component Collection for INSPIRE

26 lines (22 loc) 1.34 kB
'use client'; /* eslint-disable */ /* * INSPIRE : Creative Kit * React Component Collection for INSPIRE * * This file is generated automatically. Do not modify it manually * Generated at : 2025. 3. 4. 오후 6:18:13 * @tapie-kr/inspire-react version: 0.2.15 * * (c) 2025 TAPIE. All rights reserved. * MIT License */ 'use strict'; var jsxRuntime = require('react/jsx-runtime'); var styles_css = require('./styles.css.js'); var framerMotion = require('framer-motion'); var transition = require('../../../../utils/motion/transition.js'); var index = require('../Overlay/index.js'); var shared = require('./shared.js'); function Backdrop(props){const{toggler,preventBackdropClick,children}=props;const[isOpen,_,setIsOpen]=toggler;const close=()=>{setIsOpen(false);};return jsxRuntime.jsx(shared.BackdropContext,{value:{isOpen,close},children:jsxRuntime.jsx(framerMotion.AnimatePresence,{children:isOpen&&jsxRuntime.jsx(index.Overlay,{children:jsxRuntime.jsx(framerMotion.motion.div,{className:styles_css.backdrop,variants:shared.variants,initial:"hidden",animate:"visible",exit:"hidden",transition:transition.getTransition({duration:.3}),onClick:preventBackdropClick?undefined:close,children:jsxRuntime.jsx("div",{className:styles_css.content,onClick:e=>e.stopPropagation(),children:children})})})})})} exports.Backdrop = Backdrop;