{"version":3,"file":"Pixel_Button.ilmc_4Fm.mjs","names":["React.useId"],"sources":["https:/framerusercontent.com/modules/j3SJ4KefoGueynug8lMl/QacPGdKffjWGxct6QHDn/Pixel_Button.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import*as React from\"react\";import{motion}from\"framer-motion\";import{addPropertyControls,ControlType,useIsStaticRenderer}from\"framer\";/**\n * @framerDisableUnlink\n *\n * @framerSupportedLayoutWidth auto\n * @framerSupportedLayoutHeight auto\n */// 1. Declare the function by name to avoid anonymous export bugs\nfunction PixelTetrisButton(props){const{text,link,newTab,pixelSize,textPadding,bgColor,textColor,lineColor,font,tapAction,style}=props;const id=React.useId().replace(/:/g,\"\");const className=`pixel-tetris-${id}`;// 2. Check if the component is rendering on the canvas or during export\nconst isStatic=useIsStaticRenderer();const isLink=!!link;// Fall back to standard HTML elements if static, use motion if interactive\nconst Element=isLink?isStatic?\"a\":motion.a:isStatic?\"button\":motion.button;const elementProps=isLink?{href:link,target:newTab?\"_blank\":undefined,rel:newTab?\"noopener noreferrer\":undefined}:{};const containerStyle={...style,...font,\"--pixel-size\":pixelSize,\"--bg-color\":bgColor,\"--text-color\":textColor,\"--line-color\":lineColor,display:\"inline-flex\",alignItems:\"center\",justifyContent:\"center\",height:`${pixelSize*4}px`,width:\"max-content\",padding:`0 calc(${pixelSize*2}px + ${textPadding}px)`,textDecoration:\"none\",cursor:\"pointer\",border:\"none\",background:\"transparent\"};// 3. Conditionally inject CSS transitions and hover states based on isStatic\nconst css=`\n        .${className} .button02_bg {\n            position: absolute;\n            inset: 0;\n            display: flex;\n            z-index: 1;\n            pointer-events: none;\n        }\n\n        .${className} .button02_bg-mid {\n            flex: 1;\n            background: var(--bg-color);\n            height: 100%;\n        }\n\n        .${className} .button02_bg-left,\n        .${className} .button02_bg-right {\n            width: calc(var(--pixel-size) * 2px);\n            height: 100%;\n            display: grid;\n            grid-template-columns: repeat(2, 1fr);\n            grid-template-rows: repeat(4, 1fr);\n        }\n\n        .${className} .button02_bg-pixel {\n            background: var(--bg-color);\n            box-shadow: inset 0 0 0 1px var(--line-color);\n            ${isStatic?\"\":\"transition: opacity 0.15s ease-in-out;\"}\n        }\n\n        /* DEFAULT STATE (Applied immediately if static, or on :not(:hover) if interactive) */\n        .${isStatic?className:`${className}:not(:hover)`} .button02_bg-left .button02_bg-pixel:nth-child(-n+4) {\n            opacity: 0;\n        }\n        .${isStatic?className:`${className}:not(:hover)`} .button02_bg-right .button02_bg-pixel:nth-child(n+5) {\n            opacity: 0;\n        }\n\n        .${className} .button02_inner {\n            position: relative;\n            z-index: 2;\n            display: inline-block;\n            overflow: hidden;\n            height: 1.2em; \n            line-height: 1.2em;\n            color: var(--text-color);\n        }\n\n        .${className} .button02_text {\n            display: inline-block;\n            ${isStatic?\"\":\"transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);\"}\n        }\n\n        .${className} .button02_inner::after {\n            content: attr(data-text);\n            position: absolute;\n            top: 100%;\n            left: 0;\n            width: 100%;\n            height: 100%;\n            text-align: center;\n            ${isStatic?\"\":\"transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);\"}\n        }\n\n        /* Only inject these animation states if we are NOT on the static canvas */\n        ${!isStatic?`\n            .${className}:active {\n                transform: scale(0.97);\n            }\n\n            .${className}:hover .button02_bg-left .button02_bg-pixel:nth-child(n+5) {\n                opacity: 0;\n            }\n            .${className}:hover .button02_bg-right .button02_bg-pixel:nth-child(-n+4) {\n                opacity: 0;\n            }\n\n            .${className}:hover .button02_text,\n            .${className}:hover .button02_inner::after {\n                transform: translateY(-100%);\n            }\n        `:\"\"}\n    `;return /*#__PURE__*/_jsxs(\"div\",{style:{display:\"flex\",justifyContent:\"center\",alignItems:\"center\",width:\"100%\"},children:[/*#__PURE__*/_jsx(\"style\",{children:css}),/*#__PURE__*/_jsxs(Element,{className:className,...elementProps,onClick:tapAction,style:containerStyle,children:[/*#__PURE__*/_jsxs(\"span\",{className:\"button02_bg\",children:[/*#__PURE__*/_jsx(\"span\",{className:\"button02_bg-left\",children:[...Array(8)].map((_,i)=>/*#__PURE__*/_jsx(\"span\",{className:\"button02_bg-pixel\"},`left-${i}`))}),/*#__PURE__*/_jsx(\"span\",{className:\"button02_bg-mid\"}),/*#__PURE__*/_jsx(\"span\",{className:\"button02_bg-right\",children:[...Array(8)].map((_,i)=>/*#__PURE__*/_jsx(\"span\",{className:\"button02_bg-pixel\"},`right-${i}`))})]}),/*#__PURE__*/_jsx(\"span\",{\"data-text\":text,className:\"button02_inner\",children:/*#__PURE__*/_jsx(\"span\",{className:\"button02_text\",children:text})})]})]});}// 4. Export the named identifier\nexport default PixelTetrisButton;// 5. Register Property Controls\naddPropertyControls(PixelTetrisButton,{text:{title:\"Text\",type:ControlType.String,defaultValue:\"PIXEL-TETRIS\"},link:{title:\"Link\",type:ControlType.Link},newTab:{title:\"Open in New Tab\",type:ControlType.Boolean,defaultValue:false,hidden(props){return!props.link;}},pixelSize:{title:\"Pixel Size\",type:ControlType.Number,defaultValue:14,min:4,max:50,displayStepper:true,description:\"Controls the exact pixel grid size. The button height will be exactly 4x this number.\"},textPadding:{title:\"Text Padding\",type:ControlType.Number,defaultValue:24,min:0,max:100,displayStepper:true,description:\"Space between the text and the Tetris blocks.\"},font:{type:ControlType.Font,title:\"Typography\",defaultValue:{fontSize:16,fontWeight:500},displayFontSize:true,controls:\"extended\"},bgColor:{title:\"Background\",type:ControlType.Color,defaultValue:\"#000000\"},textColor:{title:\"Text Color\",type:ControlType.Color,defaultValue:\"#FFFFFF\"},lineColor:{title:\"Grid Lines\",type:ControlType.Color,defaultValue:\"rgba(255, 255, 255, 0.15)\"},tapAction:{title:\"Tap Action\",type:ControlType.EventHandler}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"PixelTetrisButton\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutHeight\":\"auto\",\"framerContractVersion\":\"1\",\"framerDisableUnlink\":\"*\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