@tapie-kr/inspire-react
Version:
React Component Collection for INSPIRE
24 lines (21 loc) • 1.22 kB
JavaScript
'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
*/
import { jsx } from 'react/jsx-runtime';
import { backdrop, content } from './styles.css.js';
import { AnimatePresence, motion } from 'framer-motion';
import { getTransition } from '../../../../utils/motion/transition.js';
import { Overlay } from '../Overlay/index.js';
import { BackdropContext, variants } from './shared.js';
function Backdrop(props){const{toggler,preventBackdropClick,children}=props;const[isOpen,_,setIsOpen]=toggler;const close=()=>{setIsOpen(false);};return jsx(BackdropContext,{value:{isOpen,close},children:jsx(AnimatePresence,{children:isOpen&&jsx(Overlay,{children:jsx(motion.div,{className:backdrop,variants:variants,initial:"hidden",animate:"visible",exit:"hidden",transition:getTransition({duration:.3}),onClick:preventBackdropClick?undefined:close,children:jsx("div",{className:content,onClick:e=>e.stopPropagation(),children:children})})})})})}
export { Backdrop };