flowbite-react
Version:
Official React components built for Flowbite and Tailwind CSS
1 lines • 3.33 kB
Source Map (JSON)
{"version":3,"file":"TableHeadCell.cjs","sources":["../../../src/components/Table/TableHeadCell.tsx"],"sourcesContent":["\"use client\";\n\nimport { forwardRef, type ComponentPropsWithRef } from \"react\";\nimport { get } from \"../../helpers/get\";\nimport { resolveProps } from \"../../helpers/resolve-props\";\nimport { useResolveTheme } from \"../../helpers/resolve-theme\";\nimport { twMerge } from \"../../helpers/tailwind-merge\";\nimport { useThemeProvider } from \"../../theme/provider\";\nimport type { ThemingProps } from \"../../types\";\nimport { useTableContext } from \"./TableContext\";\nimport { useTableHeadContext } from \"./TableHeadContext\";\nimport { tableTheme } from \"./theme\";\n\nexport interface TableHeadCellTheme {\n base: string;\n}\n\nexport interface TableHeadCellProps extends ComponentPropsWithRef<\"th\">, ThemingProps<TableHeadCellTheme> {}\n\nexport const TableHeadCell = forwardRef<HTMLTableCellElement, TableHeadCellProps>((props, ref) => {\n const { theme: rootTheme, clearTheme: rootClearTheme, applyTheme: rootApplyTheme } = useTableContext();\n const { theme: headTheme, clearTheme: headClearTheme, applyTheme: headApplyTheme } = useTableHeadContext();\n\n const provider = useThemeProvider();\n const theme = useResolveTheme(\n [tableTheme.head.cell, provider.theme?.table?.head?.cell, rootTheme?.head?.cell, headTheme?.cell, props.theme],\n [\n get(provider.clearTheme, \"table.head.cell\"),\n get(rootClearTheme, \"head.cell\"),\n get(headClearTheme, \"cell\"),\n props.clearTheme,\n ],\n [\n get(provider.applyTheme, \"table.head.cell\"),\n get(rootApplyTheme, \"head.cell\"),\n get(headApplyTheme, \"cell\"),\n props.applyTheme,\n ],\n );\n\n const { className, ...restProps } = resolveProps(props, provider.props?.tableHeadCell);\n\n return <th ref={ref} className={twMerge(theme.base, className)} {...restProps} />;\n});\n\nTableHeadCell.displayName = \"TableHeadCell\";\n"],"names":["forwardRef","useTableContext","useTableHeadContext","provider","useThemeProvider","theme","useResolveTheme","tableTheme","get","resolveProps","jsx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