{"version":3,"file":"ResponsiveTable.cvTa01IL.mjs","names":["useRef"],"sources":["https:/framerusercontent.com/modules/RYadhM6FbFGoR6YbZ3r4/owf2X5OyP2LmPkdJnKZf/ResponsiveTable.js"],"sourcesContent":["import{jsx as _jsx,jsxs as _jsxs}from\"react/jsx-runtime\";import{addPropertyControls,ControlType}from\"framer\";import{useRef}from\"react\";// @framerIntrinsicWidth 800\n// @framerIntrinsicHeight 400\n/**\n * ResponsiveTable - A flexible table component that adapts to mobile layouts\n * Features:\n * - Dynamic column configuration with custom background colors and border radius\n * - Custom icon support for each column\n * - Manual mobile layout toggle\n * - Customizable typography and styling\n * - Rounded corners for columns with custom backgrounds\n * - Footer support for enhanced styling\n * - Framer-optimized with inline styles\n */export default function ResponsiveTable(props){// ===== REFS =====\nconst containerRef=useRef(null);// ===== PROPS DESTRUCTURING =====\nconst{columns,headerFont,cellFont,borderColor,forceMobileView,style,...rest}=props;// ===== DATA PROCESSING =====\n// Calculate the maximum number of rows from all columns\nconst maxRows=Math.max(...columns.map(col=>col.data.length),0);// Determine if mobile layout should be applied\nconst isMobile=forceMobileView;// ===== STYLING OBJECTS =====\n// Base table styles with mobile overrides\nconst tableStyles={width:\"100%\",borderCollapse:\"collapse\",...isMobile&&{border:0},...style};// Row styles with mobile responsive behavior\nconst rowStyles={...isMobile&&{borderBottom:`1px solid ${borderColor}`,display:\"block\"}};// Base cell styles with enhanced mobile spacing and layout\nconst cellStyles={padding:\"0.75em\",textAlign:\"left\",borderBottom:`1px solid ${borderColor}`,...isMobile&&{position:\"relative\",border:\"none\",padding:\"1em\",marginBottom:\"1em\",display:\"flex\",flexDirection:\"column\"}};// Cell content wrapper for horizontal icon and text layout\nconst cellWrapper={display:\"flex\",textAlign:\"left\",flexDirection:\"row\",gap:\"0.35rem\",...cellFont,...isMobile&&{paddingTop:\"0.35rem\"}};// Icon container with fixed dimensions and overflow handling\nconst iconStyles={overflow:\"hidden\",margin:0,padding:0,minWidth:\"1.5rem\",width:\"1.5rem\",minHeight:\"1.5rem\",height:\"1.5rem\"};// Image styles for proper scaling within icon container\nconst imageStyles={width:\"100%\",height:\"100%\",objectFit:\"contain\"};// Header styles with custom background and border radius support\nconst headerStyles={...cellStyles,// Mobile styles removed as headers are now hidden via display: none\n...headerFont};// ===== RENDER =====\nreturn /*#__PURE__*/_jsx(\"section\",{...rest,ref:containerRef,children:/*#__PURE__*/_jsxs(\"table\",{className:\"responsive-table\",style:tableStyles,children:[/*#__PURE__*/_jsx(\"thead\",{style:isMobile?{display:\"none\"}:{},children:/*#__PURE__*/_jsx(\"tr\",{style:{...rowStyles},children:columns.map((headerColumn,index)=>/*#__PURE__*/_jsx(\"th\",{style:{...headerStyles,// Apply custom background and configurable top rounded corners\n    ...headerColumn.customBackgroundColor&&{backgroundColor:headerColumn.backgroundColor,borderTopRightRadius:headerColumn.backgroundBorderRadius,borderTopLeftRadius:headerColumn.backgroundBorderRadius}},children:headerColumn.label},index))})}),/*#__PURE__*/_jsx(\"tbody\",{children:Array.from({length:maxRows},(_,rowIndex)=>/*#__PURE__*/_jsx(\"tr\",{style:rowStyles,children:columns.map((column,columnIndex)=>/*#__PURE__*/_jsxs(\"td\",{style:{...cellStyles,// Apply custom background color if enabled\n        ...column.customBackgroundColor&&{backgroundColor:column.backgroundColor},// Apply border radius in mobile view for custom backgrounds\n        ...column.customBackgroundColor&&isMobile&&{borderRadius:column.backgroundBorderRadius}},children:[isMobile&&/*#__PURE__*/_jsx(\"span\",{style:{width:\"100%\"},children:/*#__PURE__*/_jsx(\"strong\",{children:column.label})}),/*#__PURE__*/_jsxs(\"span\",{style:cellWrapper,children:[column.customIcon&&column.customIconImage&&/*#__PURE__*/_jsx(\"figure\",{style:iconStyles,\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(\"img\",{style:imageStyles,src:column.customIconImage,alt:\"\"})}),column.textBold?/*#__PURE__*/_jsx(\"strong\",{children:column.data[rowIndex]||\"\"}):column.data[rowIndex]||\"\"]})]},columnIndex))},rowIndex))}),/*#__PURE__*/_jsx(\"tfoot\",{style:isMobile?{display:\"none\"}:{},\"aria-hidden\":\"true\",children:/*#__PURE__*/_jsx(\"tr\",{style:{...rowStyles},children:columns.map((headerColumn,index)=>/*#__PURE__*/_jsx(\"th\",{style:{...headerStyles,border:\"none\",// Apply custom background and configurable bottom rounded corners\n    ...headerColumn.customBackgroundColor&&{backgroundColor:headerColumn.backgroundColor,borderBottomRightRadius:headerColumn.backgroundBorderRadius,borderBottomLeftRadius:headerColumn.backgroundBorderRadius}}},index))})})]})});}// ===== PROPERTY CONTROLS =====\naddPropertyControls(ResponsiveTable,{// Column Configuration\ncolumns:{type:ControlType.Array,control:{type:ControlType.Object,controls:{// Basic column settings\nlabel:{type:ControlType.String,defaultValue:\"Column\"},textColor:{type:ControlType.Color,title:\"Text Color\",defaultValue:\"#000\"},textBold:{type:ControlType.Boolean,title:\"Text Bold\",defaultValue:false},// Icon settings\ncustomIcon:{type:ControlType.Boolean,title:\"Custom Icon in front of the text?\",defaultValue:false},customIconImage:{type:ControlType.Image,hidden(props){return props.customIcon===false;}},// Background styling\ncustomBackgroundColor:{type:ControlType.Boolean,title:\"Custom Background Color\",defaultValue:false},backgroundColor:{type:ControlType.Color,title:\"Background Color\",defaultValue:\"#fff\",hidden(props){return props.customBackgroundColor===false;}},backgroundBorderRadius:{title:\"Border Radius\",type:ControlType.Number,defaultValue:0,min:0,max:200,hidden(props){return props.customBackgroundColor===false;}},// Column data\ndata:{type:ControlType.Array,control:{type:ControlType.String,defaultValue:\"Cell\"}}}},defaultValue:[{label:\"Name\",textColor:\"#000\",textBold:false,customBackgroundColor:false,data:[\"John Doe\",\"Jane Smith\",\"Bob Johnson\"]},{label:\"Info\",textColor:\"#000\",textBold:false,customBackgroundColor:false,customIcon:true,customIconImage:\"https://fastly.picsum.photos/id/439/200/300.jpg?hmac=-995cverChuR_nKZFItxOP38htc5deVMd6ZrKiME55g\",data:[\"Pariatur enim duis proident est aute Lorem et nulla nostrud mollit anim. Tempor ipsum mollit ullamco laborum occaecat amet veniam magna veniam dolore qui deserunt incididunt voluptate. Veniam nisi consequat ea voluptate proident nulla deserunt consequat. Lorem adipisicing cupidatat id ut sunt nostrud sint mollit id eiusmod sunt in adipisicing officia eiusmod. Sunt in Lorem labore. Excepteur exercitation mollit elit amet cupidatat deserunt occaecat veniam excepteur culpa dolore commodo quis cupidatat. Velit quis nisi culpa. Est non cupidatat nulla non enim deserunt ut anim consectetur.\",\"Pariatur enim duis proident est aute Lorem et nulla nostrud mollit anim. Tempor ipsum mollit ullamco laborum occaecat amet veniam magna veniam dolore qui deserunt incididunt voluptate. Veniam nisi consequat ea voluptate proident nulla deserunt consequat. Lorem adipisicing cupidatat id ut sunt nostrud sint mollit id eiusmod sunt in adipisicing officia eiusmod. Sunt in Lorem labore. Excepteur exercitation mollit elit amet cupidatat deserunt occaecat veniam excepteur culpa dolore commodo quis cupidatat. Velit quis nisi culpa. Est non cupidatat nulla non enim deserunt ut anim consectetur.\",\"Pariatur enim duis proident est aute Lorem et nulla nostrud mollit anim. Tempor ipsum mollit ullamco laborum occaecat amet veniam magna veniam dolore qui deserunt incididunt voluptate. Veniam nisi consequat ea voluptate proident nulla deserunt consequat. Lorem adipisicing cupidatat id ut sunt nostrud sint mollit id eiusmod sunt in adipisicing officia eiusmod. Sunt in Lorem labore. Excepteur exercitation mollit elit amet cupidatat deserunt occaecat veniam excepteur culpa dolore commodo quis cupidatat. Velit quis nisi culpa. Est non cupidatat nulla non enim deserunt ut anim consectetur.\"]},{label:\"City\",textColor:\"#000\",textBold:false,customBackgroundColor:true,backgroundColor:\"#ff00ff\",backgroundBorderRadius:10,data:[\"New York\",\"Los Angeles\",\"Chicago\"]}]},// Typography Controls\nheaderFont:{type:ControlType.Font,controls:\"extended\"},cellFont:{type:ControlType.Font,controls:\"extended\"},// Visual Styling\nborderColor:{type:ControlType.Color,defaultValue:\"#ddd\"},// Responsive Behavior\nforceMobileView:{type:ControlType.Boolean,title:\"Force Mobile Layout\",defaultValue:true}});\nexport const __FramerMetadata__ = {\"exports\":{\"default\":{\"type\":\"reactComponent\",\"name\":\"ResponsiveTable\",\"slots\":[],\"annotations\":{\"framerContractVersion\":\"1\",\"framerIntrinsicHeight\":\"\",\"framerIntrinsicWidth\":\"\"}},\"__FramerMetadata__\":{\"type\":\"variable\"}}}\n//# sourceMappingURL=./ResponsiveTable.map"],"mappings":"kLAYG,SAAwB,EAAgB,EAAM,CACjD,IAAM,EAAaA,EAAO,KAAK,CAC1B,CAAC,UAAQ,aAAW,WAAS,cAAY,kBAAgB,QAAM,GAAG,GAAM,EAEvE,EAAQ,KAAK,IAAI,GAAG,EAAQ,IAAI,GAAK,EAAI,KAAK,OAAO,CAAC,EAAE,CACxD,EAAS,EAET,EAAY,CAAC,MAAM,OAAO,eAAe,WAAW,GAAG,GAAU,CAAC,OAAO,EAAE,CAAC,GAAG,EAAM,CACrF,EAAU,CAAC,GAAG,GAAU,CAAC,aAAa,aAAa,IAAc,QAAQ,QAAQ,CAAC,CAClF,EAAW,CAAC,QAAQ,SAAS,UAAU,OAAO,aAAa,aAAa,IAAc,GAAG,GAAU,CAAC,SAAS,WAAW,OAAO,OAAO,QAAQ,MAAM,aAAa,MAAM,QAAQ,OAAO,cAAc,SAAS,CAAC,CAC9M,EAAY,CAAC,QAAQ,OAAO,UAAU,OAAO,cAAc,MAAM,IAAI,UAAU,GAAG,EAAS,GAAG,GAAU,CAAC,WAAW,UAAU,CAAC,CAC/H,EAAW,CAAC,SAAS,SAAS,OAAO,EAAE,QAAQ,EAAE,SAAS,SAAS,MAAM,SAAS,UAAU,SAAS,OAAO,SAAS,CACrH,EAAY,CAAC,MAAM,OAAO,OAAO,OAAO,UAAU,UAAU,CAC5D,EAAa,CAAC,GAAG,EACvB,GAAG,EAAW,CACd,OAAoB,EAAK,UAAU,CAAC,GAAG,EAAK,IAAI,EAAa,SAAsB,EAAM,QAAQ,CAAC,UAAU,mBAAmB,MAAM,EAAY,SAAS,CAAc,EAAK,QAAQ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