{"version":3,"file":"Table.BkPscpW2.mjs","names":["useMemo"],"sources":["https:/framerusercontent.com/modules/nTMINXjNWG91WnoQr9I3/Qy9u3sxTztlXDj8QOWwu/Table.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{motion}from\"framer-motion\";import{useMemo}from\"react\";/**\n * HTML Table with customizable cells and hover animations\n *\n * @framerIntrinsicWidth 600\n * @framerIntrinsicHeight 400\n *\n * @framerSupportedLayoutWidth any-prefer-fixed\n * @framerSupportedLayoutHeight any-prefer-fixed\n */export default function Table(props){const{headers=[],rows=[],columnCount,rowCount,backgroundColor,headerBackgroundColor,textColor,headerTextColor,borderColor,hoverBackgroundColor,headerFont,cellFont,borderRadius,showBorders,style}=props;// Ensure we have the right number of columns\nconst actualHeaders=useMemo(()=>{const result=[];for(let i=0;i<columnCount;i++){result.push(headers[i]||`Header ${i+1}`);}return result;},[headers,columnCount]);// Parse rows from the cells string (comma-separated values)\nconst actualRows=useMemo(()=>{const result=[];for(let i=0;i<rowCount;i++){const rowData=rows[i];const cells=rowData?.cells||[];const paddedRow=[];for(let j=0;j<columnCount;j++){paddedRow.push(cells[j]||`Cell ${i+1}-${j+1}`);}result.push(paddedRow);}return result;},[rows,rowCount,columnCount]);const tableStyles={width:\"100%\",height:\"100%\",borderCollapse:\"separate\",borderSpacing:0,borderRadius:`${borderRadius}px`,overflow:\"hidden\",backgroundColor,minWidth:`${columnCount*120}px`};const headerCellStyles={padding:\"16px\",textAlign:\"left\",backgroundColor:headerBackgroundColor,color:headerTextColor,borderBottom:showBorders?`1px solid ${borderColor}`:\"none\",...headerFont};const cellStyles={padding:\"14px 16px\",textAlign:\"left\",color:textColor,borderBottom:showBorders?`1px solid ${borderColor}`:\"none\",...cellFont};return /*#__PURE__*/_jsx(\"div\",{style:{width:\"100%\",height:\"100%\",overflow:\"auto\"},children:/*#__PURE__*/_jsxs(\"table\",{style:tableStyles,children:[/*#__PURE__*/_jsx(\"thead\",{children:/*#__PURE__*/_jsx(\"tr\",{children:actualHeaders.map((header,index)=>/*#__PURE__*/_jsx(\"th\",{style:headerCellStyles,children:header},index))})}),/*#__PURE__*/_jsx(\"tbody\",{children:actualRows.map((row,rowIndex)=>/*#__PURE__*/_jsx(motion.tr,{initial:{backgroundColor},whileHover:{backgroundColor:hoverBackgroundColor},transition:{duration:.2,ease:\"easeOut\"},style:{cursor:\"default\"},children:row.map((cell,cellIndex)=>/*#__PURE__*/_jsx(\"td\",{style:cellStyles,children:cell},cellIndex))},rowIndex))})]})});}addPropertyControls(Table,{isDarkMode:{type:ControlType.Boolean,title:\"Dark Mode\",defaultValue:false,enabledTitle:\"On\",disabledTitle:\"Off\"},columnCount:{type:ControlType.Number,title:\"Columns\",defaultValue:3,min:1,max:10,step:1},rowCount:{type:ControlType.Number,title:\"Rows\",defaultValue:6,min:1,max:20,step:1},headers:{type:ControlType.Array,title:\"Headers\",control:{type:ControlType.String,defaultValue:\"Header\"},defaultValue:[\"Name\",\"Role\",\"Status\"]},rows:{type:ControlType.Array,title:\"Rows\",control:{type:ControlType.Object,controls:{cells:{type:ControlType.Array,control:{type:ControlType.String,defaultValue:\"Cell\"},title:\"Cells\"}}},defaultValue:[{cells:[\"John Doe\",\"Designer\",\"Active\"]},{cells:[\"Jane Smith\",\"Developer\",\"Active\"]},{cells:[\"Bob Johnson\",\"Manager\",\"Away\"]},{cells:[\"Alice Brown\",\"Marketing\",\"Active\"]},{cells:[\"Charlie Wilson\",\"Support\",\"Offline\"]},{cells:[\"Diana Lee\",\"Engineer\",\"Active\"]}]},backgroundColor:{type:ControlType.Color,title:\"Background\",defaultValue:\"#FFFFFF\"},headerBackgroundColor:{type:ControlType.Color,title:\"Header BG\",defaultValue:\"#2E2E2E\"},hoverBackgroundColor:{type:ControlType.Color,title:\"Hover BG\",defaultValue:\"#F5F5F5\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000000\"},headerTextColor:{type:ControlType.Color,title:\"Header Text\",defaultValue:\"#F5F4F0\"},borderColor:{type:ControlType.Color,title:\"Border Color\",defaultValue:\"#EEEEEE\"},headerFont:{type:ControlType.Font,title:\"Header Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"14px\",variant:\"Semibold\",letterSpacing:\"-0.01em\",lineHeight:\"1.2em\"}},cellFont:{type:ControlType.Font,title:\"Cell Font\",controls:\"extended\",defaultFontType:\"sans-serif\",defaultValue:{fontSize:\"14px\",variant:\"Medium\",letterSpacing:\"-0.01em\",lineHeight:\"1.2em\"}},borderRadius:{type:ControlType.Number,title:\"Radius\",defaultValue:8,min:0,max:32,unit:\"px\"},showBorders:{type:ControlType.Boolean,title:\"Borders\",defaultValue:true,enabledTitle:\"Show\",disabledTitle:\"Hide\"}});Table.displayName=\"Table\";\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"Table\",\"slots\":[],\"annotations\":{\"framerIntrinsicHeight\":\"400\",\"framerSupportedLayoutHeight\":\"any-prefer-fixed\",\"framerSupportedLayoutWidth\":\"any-prefer-fixed\",\"framerContractVersion\":\"1\",\"framerIntrinsicWidth\":\"600\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./Table.map"],"mappings":"kOAQG,SAAwB,EAAM,EAAM,CAAC,GAAK,CAAC,UAAQ,CAAC,EAAE,OAAK,CAAC,EAAE,cAAY,WAAS,kBAAgB,wBAAsB,YAAU,kBAAgB,cAAY,uBAAqB,aAAW,WAAS,eAAa,cAAY,SAAO,EACrO,EAAcA,MAAY,CAAC,IAAM,EAAO,CAAC,EAAE,IAAI,IAAI,EAAE,EAAE,EAAE,EAAY,IAAK,EAAO,KAAK,EAAQ,IAAI,UAAU,EAAE,GAAG,EAAG,OAAO,CAAO,EAAE,CAAC,EAAQ,CAAW,CAAC,EACzJ,EAAWA,MAAY,CAAC,IAAM,EAAO,CAAC,EAAE,IAAI,IAAI,EAAE,E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