{"version":3,"file":"Chambfer.CBYKCbVG.mjs","names":["_Fragment"],"sources":["https:/framerusercontent.com/modules/rzqtmci0TUd78IqQrEWD/AbPSVIjYJfBpgY1MLZXi/Chambfer.js"],"sourcesContent":["// Save this as ChamferCorners.tsx in your Framer project\n// This file includes both a Component AND Code Overrides for maximum flexibility\nimport{jsx as _jsx,Fragment as _Fragment}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";/**\n * @framerSupportedLayoutWidth any\n * @framerSupportedLayoutHeight any\n */// Helper function to calculate clip-path points for chamfered corners\nfunction calculateClipPath(topLeft=0,topRight=0,bottomRight=0,bottomLeft=0,unit=\"px\"){// Convert values to CSS units\nconst tl=topLeft+unit;const tr=topRight+unit;const br=bottomRight+unit;const bl=bottomLeft+unit;// Build the polygon points clockwise from top-left\nconst points=[];// Top left corner\nif(topLeft>0){points.push(`0 ${tl}`);points.push(`${tl} 0`);}else{points.push(`0 0`);}// Top right corner\nif(topRight>0){points.push(`calc(100% - ${tr}) 0`);points.push(`100% ${tr}`);}else{points.push(`100% 0`);}// Bottom right corner\nif(bottomRight>0){points.push(`100% calc(100% - ${br})`);points.push(`calc(100% - ${br}) 100%`);}else{points.push(`100% 100%`);}// Bottom left corner\nif(bottomLeft>0){points.push(`${bl} 100%`);points.push(`0 calc(100% - ${bl})`);}else{points.push(`0 100%`);}return`polygon(${points.join(\", \")})`;}export default function ChamferCorners(props){const{children,chamferSize=20,topLeft,topRight,bottomRight,bottomLeft,background=\"#ffffff\",borderWidth=0,borderColor=\"#000000\",individualCorners=false,shadowEnabled=false,shadowColor=\"rgba(0,0,0,0.2)\",shadowBlur=10,shadowX=0,shadowY=5,style}=props;// Determine corner values based on individual control toggle\nconst corners=individualCorners?{topLeft:topLeft??chamferSize,topRight:topRight??chamferSize,bottomRight:bottomRight??chamferSize,bottomLeft:bottomLeft??chamferSize}:{topLeft:chamferSize,topRight:chamferSize,bottomRight:chamferSize,bottomLeft:chamferSize};const clipPath=calculateClipPath(corners.topLeft,corners.topRight,corners.bottomRight,corners.bottomLeft);const containerStyle={width:\"100%\",height:\"100%\",position:\"relative\",...style};const outerStyle={width:\"100%\",height:\"100%\",clipPath,background:borderWidth>0?borderColor:background,position:\"relative\",...shadowEnabled&&{filter:`drop-shadow(${shadowX}px ${shadowY}px ${shadowBlur}px ${shadowColor})`}};const innerStyle=borderWidth>0?{position:\"absolute\",top:borderWidth,left:borderWidth,right:borderWidth,bottom:borderWidth,background,clipPath:calculateClipPath(Math.max(0,corners.topLeft-borderWidth),Math.max(0,corners.topRight-borderWidth),Math.max(0,corners.bottomRight-borderWidth),Math.max(0,corners.bottomLeft-borderWidth))}:{};return /*#__PURE__*/_jsx(\"div\",{style:containerStyle,children:/*#__PURE__*/_jsx(\"div\",{style:outerStyle,children:borderWidth>0?/*#__PURE__*/_jsx(_Fragment,{children:/*#__PURE__*/_jsx(\"div\",{style:innerStyle,children:children})}):children})});}// Default props for Framer\nChamferCorners.defaultProps={chamferSize:20,background:\"#ffffff\",borderWidth:0,borderColor:\"#000000\",individualCorners:false,shadowEnabled:false,shadowColor:\"rgba(0,0,0,0.2)\",shadowBlur:10,shadowX:0,shadowY:5};// Property controls for the component\naddPropertyControls(ChamferCorners,{chamferSize:{type:ControlType.Number,title:\"All Corners\",min:0,max:100,step:1,displayStepper:true},individualCorners:{type:ControlType.Boolean,title:\"Individual\",defaultValue:false},topLeft:{type:ControlType.Number,title:\"↖ Top Left\",min:0,max:100,step:1,displayStepper:true,hidden:props=>!props.individualCorners},topRight:{type:ControlType.Number,title:\"↗ Top Right\",min:0,max:100,step:1,displayStepper:true,hidden:props=>!props.individualCorners},bottomRight:{type:ControlType.Number,title:\"↘ Bottom Right\",min:0,max:100,step:1,displayStepper:true,hidden:props=>!props.individualCorners},bottomLeft:{type:ControlType.Number,title:\"↙ Bottom Left\",min:0,max:100,step:1,displayStepper:true,hidden:props=>!props.individualCorners},background:{type:ControlType.Color,title:\"Background\"},borderWidth:{type:ControlType.Number,title:\"Border Width\",min:0,max:20,step:1,displayStepper:true},borderColor:{type:ControlType.Color,title:\"Border Color\",hidden:props=>props.borderWidth===0},shadowEnabled:{type:ControlType.Boolean,title:\"Shadow\",defaultValue:false},shadowColor:{type:ControlType.Color,title:\"Shadow Color\",hidden:props=>!props.shadowEnabled},shadowBlur:{type:ControlType.Number,title:\"Shadow Blur\",min:0,max:50,step:1,hidden:props=>!props.shadowEnabled},shadowX:{type:ControlType.Number,title:\"Shadow X\",min:-50,max:50,step:1,hidden:props=>!props.shadowEnabled},shadowY:{type:ControlType.Number,title:\"Shadow Y\",min:-50,max:50,step:1,hidden:props=>!props.shadowEnabled}});// ===========================================\n// CODE OVERRIDES - Apply to existing elements\n// ===========================================\n// Basic chamfer override - all corners equal\nexport function withChamfer(Component){return props=>{const clipPath=calculateClipPath(20,20,20,20);return /*#__PURE__*/_jsx(Component,{...props,style:{...props.style,clipPath}});};}// Small chamfer\nexport function withSmallChamfer(Component){return props=>{const clipPath=calculateClipPath(10,10,10,10);return /*#__PURE__*/_jsx(Component,{...props,style:{...props.style,clipPath}});};}// evenSmaller chamfer\nexport function withevenSmallerChamfer(Component){return props=>{const clipPath=calculateClipPath(5,5,5,5);return /*#__PURE__*/_jsx(Component,{...props,style:{...props.style,clipPath}});};}// Large chamfer\nexport function withLargeChamfer(Component){return props=>{const clipPath=calculateClipPath(30,30,30,30);return /*#__PURE__*/_jsx(Component,{...props,style:{...props.style,clipPath}});};}// Top corners only\nexport function withTopChamfer(Component){return props=>{const clipPath=calculateClipPath(20,20,0,0);return /*#__PURE__*/_jsx(Component,{...props,style:{...props.style,clipPath}});};}// Bottom corners only\nexport function withBottomChamfer(Component){return props=>{const clipPath=calculateClipPath(0,0,20,20);return /*#__PURE__*/_jsx(Component,{...props,style:{...props.style,clipPath}});};}// Diagonal chamfer (top-left and bottom-right)\nexport function withDiagonalChamfer(Component){return props=>{const clipPath=calculateClipPath(25,0,25,0);return /*#__PURE__*/_jsx(Component,{...props,style:{...props.style,clipPath}});};}// Asymmetric chamfer\nexport function withAsymmetricChamfer(Component){return props=>{const clipPath=calculateClipPath(10,20,30,15);return /*#__PURE__*/_jsx(Component,{...props,style:{...props.style,clipPath}});};}// Custom configurable override with parameters\nexport function createChamferOverride(topLeft=20,topRight=20,bottomRight=20,bottomLeft=20){return function(Component){return props=>{const clipPath=calculateClipPath(topLeft,topRight,bottomRight,bottomLeft);return /*#__PURE__*/_jsx(Component,{...props,style:{...props.style,clipPath}});};};}\nexport const __FramerMetadata__ = {\"exports\":{\"createChamferOverride\":{\"type\":\"reactComponent\",\"name\":\"createChamferOverride\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\"}},\"withDiagonalChamfer\":{\"type\":\"reactHoc\",\"name\":\"withDiagonalChamfer\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withevenSmallerChamfer\":{\"type\":\"reactHoc\",\"name\":\"withevenSmallerChamfer\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withSmallChamfer\":{\"type\":\"reactHoc\",\"name\":\"withSmallChamfer\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withChamfer\":{\"type\":\"reactHoc\",\"name\":\"withChamfer\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withLargeChamfer\":{\"type\":\"reactHoc\",\"name\":\"withLargeChamfer\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"default\":{\"type\":\"reactComponent\",\"name\":\"ChamferCorners\",\"slots\":[\"children\"],\"annotations\":{\"framerContractVersion\":\"1\"}},\"withTopChamfer\":{\"type\":\"reactHoc\",\"name\":\"withTopChamfer\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withBottomChamfer\":{\"type\":\"reactHoc\",\"name\":\"withBottomChamfer\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"withAsymmetricChamfer\":{\"type\":\"reactHoc\",\"name\":\"withAsymmetricChamfer\",\"annotations\":{\"framerContractVersion\":\"1\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingUR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