{"version":3,"file":"ComparisonTable.CNH6Cnpt.mjs","names":["c"],"sources":["https:/framerusercontent.com/modules/VqEcuU06lI9jB8fdXGfK/NG25Sja4J0YBY0MXuyFR/ComparisonTable.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";/**\n * Comparison Table\n *\n * Responsive table for blog posts. Fits the column on desktop and scrolls\n * sideways on narrow screens, with the first column pinned.\n * Data is one line per row (the first line is the header row), with cells\n * separated by \" | \". Rows can also be separated by \" || \" on one line.\n *\n * @framerIntrinsicWidth 760\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight auto\n */export default function ComparisonTable(props){const{data=\"Product | Feature A | Feature B\\nProduct one | Yes | No\\nProduct two | No | Yes\",minTableWidth=680,headerFill=\"#C2DCE8\",rowFill=\"#FFFFFF\",stripeFill=\"#F7F9FB\",borderColor=\"#D4D4D4\",textColor=\"#32373B\",fontSize=15,scrollHint=\"Scroll sideways to see every column\"}=props;const lines=data.split(/\\r?\\n|\\s*\\|\\|\\s*/).map(line=>line.trim()).filter(line=>line.length>0).map(line=>line.split(\"|\").map(c=>c.trim()));const headers=lines[0]??[];const parsedRows=lines.slice(1);const scope=\"jams-ct\";const cellBase={padding:\"10px 12px\",borderRight:`1px solid ${borderColor}`,borderBottom:`1px solid ${borderColor}`,textAlign:\"left\",verticalAlign:\"top\",overflowWrap:\"normal\",wordBreak:\"normal\",hyphens:\"manual\"};return /*#__PURE__*/_jsxs(\"div\",{className:scope,style:{...props.style,position:\"relative\",width:\"100%\",color:textColor,fontFamily:\"Lato, sans-serif\"},children:[/*#__PURE__*/_jsx(\"style\",{children:`\n                .${scope} { container-type: inline-size; }\n                .${scope} .${scope}-hint { display: none; }\n                @container (max-width: ${minTableWidth-1}px) {\n                    .${scope} .${scope}-hint { display: block; }\n                }\n            `}),/*#__PURE__*/_jsxs(\"div\",{className:`${scope}-hint`,style:{fontSize:13,opacity:.75,marginBottom:8},children:[scrollHint,\" →\"]}),/*#__PURE__*/_jsx(\"div\",{role:\"region\",\"aria-label\":\"Comparison table\",tabIndex:0,style:{width:\"100%\",overflowX:\"auto\",WebkitOverflowScrolling:\"touch\",border:`1px solid ${borderColor}`,borderRadius:8},children:/*#__PURE__*/_jsxs(\"table\",{style:{width:\"100%\",minWidth:minTableWidth,borderCollapse:\"separate\",borderSpacing:0,tableLayout:\"auto\",fontSize,lineHeight:1.45},children:[/*#__PURE__*/_jsx(\"thead\",{children:/*#__PURE__*/_jsx(\"tr\",{children:headers.map((h,i)=>/*#__PURE__*/_jsx(\"th\",{scope:\"col\",style:{...cellBase,fontWeight:700,lineHeight:1.3,background:headerFill,borderRight:i===headers.length-1?\"none\":cellBase.borderRight,...i===0?{position:\"sticky\",left:0,zIndex:2}:{}},children:h},i))})}),/*#__PURE__*/_jsx(\"tbody\",{children:parsedRows.map((cells,r)=>{const fill=r%2===1?stripeFill:rowFill;const last=r===parsedRows.length-1;return /*#__PURE__*/_jsx(\"tr\",{children:cells.map((c,i)=>{const style={...cellBase,background:fill,borderBottom:last?\"none\":cellBase.borderBottom,borderRight:i===cells.length-1?\"none\":cellBase.borderRight};if(i===0){return /*#__PURE__*/_jsx(\"th\",{scope:\"row\",style:{...style,fontWeight:700,position:\"sticky\",left:0,zIndex:1,minWidth:120},children:c},i);}return /*#__PURE__*/_jsx(\"td\",{style:style,children:c},i);})},r);})})]})})]});}addPropertyControls(ComparisonTable,{data:{type:ControlType.String,title:\"Table Data\",description:\"One line per row, header row first. Separate cells with |\",displayTextArea:true,defaultValue:\"Product | Feature A | Feature B\\nProduct one | Yes | No\\nProduct two | No | Yes\"},minTableWidth:{type:ControlType.Number,title:\"Scroll Below\",description:\"The table scrolls sideways when narrower than this.\",defaultValue:680,min:320,max:1400,step:10,unit:\"px\"},headerFill:{type:ControlType.Color,title:\"Header Fill\",defaultValue:\"#C2DCE8\"},rowFill:{type:ControlType.Color,title:\"Row Fill\",defaultValue:\"#FFFFFF\"},stripeFill:{type:ControlType.Color,title:\"Stripe Fill\",defaultValue:\"#F7F9FB\"},borderColor:{type:ControlType.Color,title:\"Border\",defaultValue:\"#D4D4D4\"},textColor:{type:ControlType.Color,title:\"Text\",defaultValue:\"#32373B\"},fontSize:{type:ControlType.Number,title:\"Text Size\",defaultValue:15,min:12,max:20,step:1,unit:\"px\"},scrollHint:{type:ControlType.String,title:\"Scroll Hint\",defaultValue:\"Scroll sideways to see every column\"}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ComparisonTable\",\"slots\":[],\"annotations\":{\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"760\",\"framerSupportedLayoutHeight\":\"auto\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ComparisonTable.map"],"mappings":"8JAYG,SAAwB,EAAgB,EAAM,CAAC,GAAK,CAAC,OAAK;;wBAAkF,gBAAc,IAAI,aAAW,UAAU,UAAQ,UAAU,aAAW,UAAU,cAAY,UAAU,YAAU,UAAU,WAAS,GAAG,aAAW,uCAAuC,EAAY,EAAM,EAAK,MAAM,kBAAkB,CAAC,CAAC,IAAI,GAAM,EAAK,KAAK,CAAC,CAAC,CAAC,OAAO,GAAM,EAAK,OAAO,CAAC,CAAC,CAAC,IAAI,GAAM,EAAK,MAAM,GAAG,CAAC,CAAC,IAAI,GAAG,EAAE,KAAK,CAAC,CAAC,EAAQ,EAAQ,EAAM,IAAI,CAAC,EAAQ,EAAW,EAAM,MAAM,CAAC,EAAQ,EAAM,UAAgB,EAAS,CAAC,QAAQ,YAAY,YAAY,aAAa,IAAc,aAAa,aAAa,IAAc,UAAU,OAAO,cAAc,MAAM,aAAa,SAAS,UAAU,SAAS,QAAQ,QAAQ,EAAE,OAAoB,EAAM,MAAM,CAAC,UAAU,EAAM,MAAM,CAAC,GAAG,EAAM,MAAM,SAAS,WAAW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