{"version":3,"file":"SelectiveText.C_rorZZZ.mjs","names":["useState"],"sources":["https:/framerusercontent.com/modules/XXNG6fEGzavw9vQ5uCeo/00YQ5ghGzchgnFKrYAGF/SelectiveText.js"],"sourcesContent":["// Text component with selectable visibility - click to toggle between showing all text and dimming unselected portions\nimport{jsx as _jsx}from\"react/jsx-runtime\";import{useState,startTransition,useEffect}from\"react\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */export default function SelectiveText(props){const{segments=[{text:\"This text is visible \",visible:true},{text:\"this is dimmed \",visible:false},{text:\"and this is visible again\",visible:true}],visibleColor=\"#000000\",dimmedColor=\"#000000\",dimmedOpacity=.3,font,style}=props;const[isToggled,setIsToggled]=useState(false);const[isMobile,setIsMobile]=useState(false);useEffect(()=>{if(typeof window!==\"undefined\"){const checkMobile=()=>{startTransition(()=>{setIsMobile(window.innerWidth<768);});};checkMobile();window.addEventListener(\"resize\",checkMobile);return()=>window.removeEventListener(\"resize\",checkMobile);}},[]);const handleClick=()=>{startTransition(()=>{setIsToggled(!isToggled);});};const showDimmedState=isMobile||!isToggled;return /*#__PURE__*/_jsx(\"div\",{onClick:handleClick,style:{...style,cursor:\"pointer\",userSelect:\"none\"},children:/*#__PURE__*/_jsx(\"span\",{style:{...font,display:\"inline\"},children:segments.map((segment,index)=>{const shouldDim=showDimmedState&&!segment.visible;return /*#__PURE__*/_jsx(\"span\",{style:{color:shouldDim?dimmedColor:visibleColor,opacity:shouldDim?dimmedOpacity:1,transition:\"opacity 0.3s ease, color 0.3s ease\"},children:segment.text},index);})})});}addPropertyControls(SelectiveText,{segments:{type:ControlType.Array,title:\"Text Segments\",control:{type:ControlType.Object,controls:{text:{type:ControlType.String,title:\"Text\",defaultValue:\"Sample text\"},visible:{type:ControlType.Boolean,title:\"Keep Visible\",defaultValue:true,enabledTitle:\"Yes\",disabledTitle:\"No\"}}},defaultValue:[{text:\"This text is visible \",visible:true},{text:\"this is dimmed \",visible:false},{text:\"and this is visible again\",visible:true}]},visibleColor:{type:ControlType.Color,title:\"Visible Color\",defaultValue:\"#000000\"},dimmedColor:{type:ControlType.Color,title:\"Dimmed Color\",defaultValue:\"#000000\"},dimmedOpacity:{type:ControlType.Number,title:\"Dimmed Opacity\",defaultValue:.3,min:0,max:1,step:.1},font:{type:ControlType.Font,title:\"Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"15px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.3em\"}}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"SelectiveText\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"any\",\"framerContractVersion\":\"1\",\"framerSupportedLayoutWidth\":\"any\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./SelectiveText.map"],"mappings":"sMAIG,SAAwB,EAAc,EAAM,CAAC,GAAK,CAAC,WAAS,CAAC,CAAC,KAAK,wBAAwB,QAAQ,GAAK,CAAC,CAAC,KAAK,kBAAkB,QAAQ,GAAM,CAAC,CAAC,KAAK,4BAA4B,QAAQ,GAAK,CAAC,CAAC,eAAa,UAAU,cAAY,UAAU,gBAAc,GAAG,OAAK,SAAO,EAAW,CAAC,EAAU,GAAcA,EAAS,GAAM,CAAM,CAAC,EAAS,GAAaA,EAAS,GAAM,CAAC,MAAc,CAAC,GAAU,IAAS,OAAY,CAAC,IAAM,MAAgB,CAAC,MAAoB,CAAC,EAAY,EAAO,WAAW,IAAI,EAAG,EAA+D,OAA5D,GAAa,CAAC,EAAO,iBAAiB,SAAS,EAAY,KAAW,EAAO,oBAAoB,SAAS,EAAY,GAAI,EAAE,CAAC,CAAC,IAAM,MAAgB,CAAC,MAAoB,CAAC,EAAa,CAAC,EAAU,EAAG,EAAS,EAAgB,GAAU,CAAC,EAAU,OAAoB,EAAK,MAAM,CAAC,QAAQ,EAAY,MAAM,CAAC,GAA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