UNPKG

flowbite-react

Version:

Official React components built for Flowbite and Tailwind CSS

1 lines 1.63 kB
{"version":3,"file":"TableCell.cjs","sources":["../../../../src/components/Table/TableCell.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef, type ComponentPropsWithRef } from \"react\";\nimport { twMerge } from \"tailwind-merge\";\nimport { mergeDeep } from \"../../helpers/merge-deep\";\nimport type { DeepPartial } from \"../../types\";\nimport { useTableBodyContext } from \"./TableBodyContext\";\n\nexport interface FlowbiteTableCellTheme {\n base: string;\n}\n\nexport interface TableCellProps extends ComponentPropsWithRef<\"td\"> {\n theme?: DeepPartial<FlowbiteTableCellTheme>;\n}\n\nexport const TableCell = forwardRef<HTMLTableCellElement, TableCellProps>(\n ({ children, className, theme: customTheme = {}, ...props }, ref) => {\n const { theme: bodyTheme } = useTableBodyContext();\n\n const theme = mergeDeep(bodyTheme.cell, customTheme);\n\n return (\n <td className={twMerge(theme.base, className)} ref={ref} {...props}>\n {children}\n </td>\n );\n },\n);\n\nTableCell.displayName = \"Table.Cell\";\n"],"names":["forwardRef","useTableBodyContext","mergeDeep","jsx","twMerge"],"mappings":";;;;;;;;AAOY,MAAC,SAAS,GAAGA,gBAAU;AACnC,EAAE,CAAC,EAAE,QAAQ,EAAE,SAAS,EAAE,KAAK,EAAE,WAAW,GAAG,EAAE,EAAE,GAAG,KAAK,EAAE,EAAE,GAAG,KAAK;AACvE,IAAI,MAAM,EAAE,KAAK,EAAE,SAAS,EAAE,GAAGC,oCAAmB,EAAE,CAAC;AACvD,IAAI,MAAM,KAAK,GAAGC,mBAAS,CAAC,SAAS,CAAC,IAAI,EAAE,WAAW,CAAC,CAAC;AACzD,IAAI,uBAAuBC,cAAG,CAAC,IAAI,EAAE,EAAE,SAAS,EAAEC,qBAAO,CAAC,KAAK,CAAC,IAAI,EAAE,SAAS,CAAC,EAAE,GAAG,EAAE,GAAG,KAAK,EAAE,QAAQ,EAAE,CAAC,CAAC;AAC7G,GAAG;AACH,EAAE;AACF,SAAS,CAAC,WAAW,GAAG,YAAY;;;;"}