{"version":3,"file":"WithOpenToast.CDZUYuSw.mjs","names":["useCallback","useState","_Fragment"],"sources":["https:/framerusercontent.com/modules/Hj20QU19p80mpYsvesiZ/RfHh9MIwqlgi04HKZ3Qo/Clipboard.js","https:/framerusercontent.com/modules/6DRhLcHCkfhW2VqlUwAH/3MtXE33Hla6OO0WJED1m/WithOpenToast.js"],"sourcesContent":["import{jsx as _jsx}from\"react/jsx-runtime\";import{useCallback}from\"react\";import{addPropertyControls,ControlType}from\"framer\";import{motion}from\"framer-motion\";import{defaultEvents,usePadding,useRadius,useFontControls}from\"https://framer.com/m/framer/default-utils.js@^0.45.0\";/**\n * CLIPBOARD\n *\n * @framerIntrinsicWidth 90\n * @framerIntrinsicHeight 50\n *\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */ export default function Clipboard(props){const{label,content,fill,color,style,onClick,font,hoverOptions,...rest}=props;const deprecatedFont=useFontControls({fontWeight:500,...rest});const borderRadius=useRadius(props);const paddingValue=usePadding(props);const handleClick=useCallback(()=>{var ref;(ref=navigator.clipboard)===null||ref===void 0?void 0:ref.writeText(content);onClick===null||onClick===void 0?void 0:onClick();},[onClick,content]);return /*#__PURE__*/ _jsx(motion.button,{style:{border:\"none\",outline:\"none\",resize:\"none\",width:\"max-content\",wordBreak:\"break-word\",overflowWrap:\"break-word\",WebkitTapHighlightColor:\"rgba(0, 0, 0, 0)\",letterSpacing:\"-0.2px\",display:\"flex\",justifyContent:\"center\",alignItems:\"center\",background:fill,borderRadius,cursor:\"pointer\",padding:paddingValue,color,...deprecatedFont,...font,...style},onClick:handleClick,...rest,whileHover:hoverOptions,transition:hoverOptions===null||hoverOptions===void 0?void 0:hoverOptions.transition,children:label});};addPropertyControls(Clipboard,{content:{type:ControlType.String,title:\"Content\",displayTextArea:true,description:\"When clicked, this content will be copied to the clipboard.\"},label:{type:ControlType.String,title:\"Label\",defaultValue:\"Copy to Clipboard\"},fill:{type:ControlType.Color,title:\"Fill\",defaultValue:\"#06F\"},color:{type:ControlType.Color,title:\"Text\",defaultValue:\"#fff\"},font:{// @ts-ignore - Internal\ntype:ControlType.Font,controls:\"extended\",defaultValue:{fontSize:16}},hoverOptions:{type:ControlType.Object,title:\"Hover\",buttonTitle:\"Effect\",optional:true,controls:{scale:{type:ControlType.Number,title:\"Scale\",min:0,max:10,displayStepper:true,step:.01,defaultValue:1.1},backgroundColor:{type:ControlType.Color,title:\"Fill\",defaultValue:\"#0088FF\",optional:true},color:{type:ControlType.Color,title:\"Color\",defaultValue:\"#FFF\",optional:true},transition:{type:ControlType.Transition,title:\"Transition\",defaultValue:{type:\"spring\",stiffness:400,damping:30}}}},padding:{type:ControlType.FusedNumber,toggleKey:\"paddingPerSide\",toggleTitles:[\"Padding\",\"Padding per side\"],valueKeys:[\"paddingTop\",\"paddingRight\",\"paddingBottom\",\"paddingLeft\",],valueLabels:[\"T\",\"R\",\"B\",\"L\"],min:0,title:\"Padding\",defaultValue:10},borderRadius:{title:\"Radius\",type:ControlType.FusedNumber,toggleKey:\"isMixedBorderRadius\",toggleTitles:[\"Radius\",\"Radius per corner\"],valueKeys:[\"topLeftRadius\",\"topRightRadius\",\"bottomRightRadius\",\"bottomLeftRadius\",],valueLabels:[\"TL\",\"TR\",\"BR\",\"BL\"],min:0,defaultValue:50},...defaultEvents});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Clipboard\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerSupportedLayoutWidth\":\"any\",\"framerIntrinsicHeight\":\"50\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"90\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Clipboard.map","import{jsx as _jsx,jsxs as _jsxs,Fragment as _Fragment}from\"react/jsx-runtime\";import{useEffect,useState}from\"react\";const TOAST_DURATION=2e3;export function withOpenToast(Component){return props=>{const[toastVisible,setToastVisible]=useState(false);const showToast=()=>{setToastVisible(true);};const handleClose=()=>{setToastVisible(false);};return /*#__PURE__*/_jsxs(_Fragment,{children:[/*#__PURE__*/_jsx(Component,{...props,onClick:showToast}),/*#__PURE__*/_jsx(Toast,{message:\"URL이 복사되었습니다.\",duration:TOAST_DURATION,visible:toastVisible,onClose:handleClose})]});};}const Toast=({message,duration,visible,onClose})=>{useEffect(()=>{if(visible){const timer=setTimeout(()=>{onClose();},duration);return()=>clearTimeout(timer);}},[visible,duration,onClose]);if(!visible)return null;return /*#__PURE__*/_jsxs(\"div\",{style:{fontSize:\"14px\",lineHeight:\"20px\",color:\"white\",background:\"#383D4F\",display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",padding:\"15px 24px\",borderRadius:\"5px\",position:\"fixed\",top:\"20px\",left:\"50%\",transform:\"translateX(-50%)\",zIndex:1e3,maxWidth:\"calc(100vw - 40px)\",whiteSpace:\"nowrap\",boxShadow:\"0 4px 8px rgba(0,0,0,0.1)\",animation:\"toastAnimation 0.25s ease-in-out\"},children:[message,/*#__PURE__*/_jsx(\"style\",{children:`\n            @keyframes toastAnimation {\n                0% {\n                    opacity: 0;\n                    transform: translateY(10px);\n                }\n                100% {\n                    opacity: 1;\n                    transform: translateY(0);\n                }\n            }\n        `})]});};\nexport const __FramerMetadata__ = {\"exports\":{\"withOpenToast\":{\"type\":\"reactHoc\",\"name\":\"withOpenToast\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./WithOpenToast.map"],"mappings":"2UAQI,SAAwB,EAAU,EAAM,CAAC,GAAK,CAAC,QAAM,UAAQ,OAAK,QAAM,QAAM,UAAQ,OAAK,eAAa,GAAG,GAAM,EAAY,EAAe,EAAgB,CAAC,WAAW,IAAI,GAAG,EAAK,CAAC,CAAO,EAAa,EAAU,EAAM,CAAO,EAAa,EAAW,EAAM,CAAO,EAAYA,MAAgB,CAAC,IAAI,GAAK,EAAI,EAAU,YAAa,MAA0B,EAAI,UA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