{"version":3,"file":"ThemeVariants.CST5lcMv.mjs","names":["useState","mediaQuery"],"sources":["https:/framerusercontent.com/modules/n9cR4gFLy0DjoxfkLrIe/eDj1MxSfupkYrrIeXQ6b/Shared.js","https:/framer.com/m/Shared-8iGD.js@eDj1MxSfupkYrrIeXQ6b","https:/framerusercontent.com/modules/r0I4RUQH1znWwwFQGBd4/2dhDaqByUwIlv4VlsKGo/ThemeVariants.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{ControlType}from\"framer\";import{motion}from\"framer-motion\";export const borderPropertyControl=(hidden=null)=>({type:ControlType.Object,optional:true,hidden,controls:{color:{type:ControlType.Color,defaultValue:\"#222\"},width:{type:ControlType.FusedNumber,defaultValue:1,toggleKey:\"widthIsMixed\",toggleTitles:[\"All\",\"Individual\"],valueKeys:[\"widthTop\",\"widthRight\",\"widthBottom\",\"widthLeft\"],valueLabels:[\"T\",\"R\",\"B\",\"L\"],min:0},style:{type:ControlType.Enum,defaultValue:\"solid\",options:[\"solid\",\"dashed\",\"dotted\",\"double\"],optionTitles:[\"Solid\",\"Dashed\",\"Dotted\",\"Double\"]}}});export function Border({width,widthIsMixed,widthTop,widthRight,widthBottom,widthLeft,style,color,transition}){return /*#__PURE__*/_jsx(motion.div,{animate:{borderColor:color},style:{position:\"absolute\",inset:0,borderWidth:widthIsMixed?`${widthTop}px ${widthRight}px ${widthBottom}px ${widthLeft}px`:`${width}px`,borderStyle:style,borderRadius:\"inherit\",pointerEvents:\"none\"},initial:false,transition:transition});}export function EmptyState({title,subtitle,maxWidth=0}){return /*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",width:\"100%\",height:\"100%\",placeContent:\"center\",placeItems:\"center\",flexDirection:\"column\",gap:16,backgroundColor:\"rgba(136, 85, 255, 0.1)\",borderRadius:6,border:\"1px dashed rgb(136, 85, 255)\",color:\"rgb(136, 85, 255)\",fontSize:16,padding:20,minHeight:200,maxWidth:maxWidth||undefined},children:[/*#__PURE__*/_jsx(\"p\",{style:{margin:0,fontWeight:600,textAlign:\"center\"},children:title}),/*#__PURE__*/_jsx(\"p\",{style:{margin:0,opacity:.7,// maxWidth: 500,\nlineHeight:1.5,textAlign:\"center\"},children:subtitle})]});}EmptyState.displayName=\"Empty State\";\nexport const __FramerMetadata__ = {\"exports\":{\"borderPropertyControl\":{\"type\":\"variable\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"Border\":{\"type\":\"reactComponent\",\"name\":\"Border\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"EmptyState\":{\"type\":\"reactComponent\",\"name\":\"EmptyState\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Shared.map","/*\n * Shared\n *\n * Learn More: https://www.framer.com/asset-urls\n */\n\nexport * from \"https://framerusercontent.com/modules/n9cR4gFLy0DjoxfkLrIe/eDj1MxSfupkYrrIeXQ6b/Shared.js\"\n","import{jsx as _jsx}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useState,useEffect,cloneElement}from\"react\";import{EmptyState}from\"https://framer.com/m/Shared-8iGD.js@eDj1MxSfupkYrrIeXQ6b\";const THEME_ATTRIBUTE=\"framestack-theme\";const SIGNAL_NAME=\"framestack-theme-changed\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function ThemeVariants(props){const[isDarkTheme,setIsDarkTheme]=useState(null);useEffect(()=>{const updateTheme=()=>{// For compatibility with the Theme Toggle component.\n// https://Framestack.co/components/theme-toggle\n// If the site does not have a theme toggle, the device theme will be used.\nconst currentToggleState=document.body.getAttribute(THEME_ATTRIBUTE);// Check if page has the theme toggle attribute.\nif(!currentToggleState||currentToggleState==\"deviceTheme\"){if(document.body.hasAttribute(\"data-framer-theme\")){setIsDarkTheme(document.body.getAttribute(\"data-framer-theme\")==\"dark\");}else{const mediaQuery=window.matchMedia(\"(prefers-color-scheme: dark)\");setIsDarkTheme(mediaQuery.matches);}}else{// Use device theme\nsetIsDarkTheme(currentToggleState==\"dark\")// light or dark\n;}};// Event listener for changes in the device theme\nconst osThemeChange=e=>{setIsDarkTheme(e.matches);};// Update the theme when the page loads\nupdateTheme();// Listen for theme changes made by the theme toggle component\nwindow.addEventListener(SIGNAL_NAME,updateTheme);// Listen for changes in the device theme\nconst mediaQuery=window.matchMedia(\"(prefers-color-scheme: dark)\");mediaQuery.addListener(osThemeChange);// Clean up the event listeners when the theme toggle component unmounts\nreturn()=>{window.removeEventListener(SIGNAL_NAME,updateTheme);mediaQuery.removeListener(osThemeChange);};},[]);// Before the theme has been determined, render nothing.\n// This prevents flashing while the page loads.\nif(isDarkTheme===null){return null;}// Empty state\nif(!props.light?.[0]||!props.dark?.[0]){return /*#__PURE__*/_jsx(EmptyState,{title:\"Add dark and light layers.\",subtitle:\"Use the properties panel on the right side to connect layers for dark and light theme.\"});}let layer=isDarkTheme?props.dark?.[0]:props.light?.[0];if(layer&&(props.style?.width||props.style?.height)){layer=/*#__PURE__*/cloneElement(layer,{style:{...layer.props.style,...props.style}});}if(!layer){return /*#__PURE__*/_jsx(\"div\",{style:{minWidth:100,minHeight:100}});}return layer;}ThemeVariants.displayName=\"Theme Variants\";addPropertyControls(ThemeVariants,{light:{type:ControlType.ComponentInstance,title:\"Light\"},dark:{type:ControlType.ComponentInstance,title:\"Dark\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ThemeVariants\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutHeight\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ThemeVariants.map"],"mappings":"oYAA6hC,SAAgB,EAAW,CAAC,QAAM,WAAS,WAAS,GAAG,CAAC,OAAoB,EAAM,MAAM,CAAC,MAAM,CAAC,QAAQ,OAAO,MAAM,OAAO,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