From a00536f2fe07ae189d54d6fc848dbdbdb48dbc6b Mon Sep 17 00:00:00 2001 From: Marco Schumacher Date: Mon, 17 Apr 2023 20:53:11 +0200 Subject: [PATCH] fix: renamed css to styles --- docs/stories/aIntro.stories.tsx | 2 +- src/components/cell.tsx | 4 ++-- src/components/columnFooter.tsx | 6 +++--- src/components/columnHeader.tsx | 10 +++++----- src/components/row.tsx | 4 ++-- src/components/table.tsx | 18 +++++++++--------- src/hooks/useTheme.ts | 16 ++++++++-------- src/internalState/calcProps.ts | 4 ++-- src/misc/calcClassNames.ts | 8 ++++---- src/theme/tableTheme.tsx | 2 +- src/types.ts | 8 ++++---- 11 files changed, 41 insertions(+), 41 deletions(-) diff --git a/docs/stories/aIntro.stories.tsx b/docs/stories/aIntro.stories.tsx index 596de11..1852db7 100644 --- a/docs/stories/aIntro.stories.tsx +++ b/docs/stories/aIntro.stories.tsx @@ -73,7 +73,7 @@ export const HiddenColumns = { export const StyledCells = { args: { ...Primary.args, - css: { + styles: { evenCell: { backgroundColor: 'rgba(0, 0, 0, 0.05)', }, diff --git a/src/components/cell.tsx b/src/components/cell.tsx index 7b0b0eb..79d5586 100644 --- a/src/components/cell.tsx +++ b/src/components/cell.tsx @@ -39,14 +39,14 @@ export const Cell = memo(function Cell({ itemId, rowIndex }: { itemId: Id; ro useLayoutEffect(() => table.getState().props.debugRender?.('render cell', itemId, columnId)); const className = useTheme((t) => cx(...calcClassNames(t.classes, item, rowIndex))); - const css = useTheme((t) => calcCss(t.css, item, rowIndex)); + const styles = useTheme((t) => calcCss(t.styles, item, rowIndex)); if (!column || !item) return null; const content = column.renderCell(column.value(item.value), item.value); return ( -
+
{wrapCell(content, column.value(item.value), item.value, rowIndex)}
); diff --git a/src/components/columnFooter.tsx b/src/components/columnFooter.tsx index 0038b44..2941e4d 100644 --- a/src/components/columnFooter.tsx +++ b/src/components/columnFooter.tsx @@ -15,9 +15,9 @@ export function ColumnFooter() { ); const classes = useTheme((theme) => theme.classes?.footerCell); const columnCss = table.useState( - (state) => state.activeColumns.find((column) => column.id === columnId)?.css?.footerCell, + (state) => state.activeColumns.find((column) => column.id === columnId)?.styles?.footerCell, ); - const css = useTheme((theme) => theme.css?.footerCell); + const styles = useTheme((theme) => theme.styles?.footerCell); const content = table.useState((state) => { const column = state.activeColumns.find((column) => column.id === columnId); @@ -30,7 +30,7 @@ export function ColumnFooter() { className={cx(classes, columnClasses)} css={[ defaultClasses.footerCell, - css, + styles, columnCss, stickyFooter && defaultClasses.stickyBottom, stickyFooter instanceof Object && stickyFooter, diff --git a/src/components/columnHeader.tsx b/src/components/columnHeader.tsx index b68dfcf..5fc5cca 100644 --- a/src/components/columnHeader.tsx +++ b/src/components/columnHeader.tsx @@ -25,14 +25,14 @@ export function ColumnHeader() { }); const stickyHeader = table.useState((state) => state.props.stickyHeader); const classes = useTheme((theme) => theme.classes?.headerCell); - const css = useTheme((theme) => theme.css?.headerCell); + const styles = useTheme((theme) => theme.styles?.headerCell); - const { header, columnClasses, columnCss } = table.useState((state) => { + const { header, columnClasses, columnStyles } = table.useState((state) => { const column = state.activeColumns.find((column) => column.id === columnId); return { header: column?.header, columnClasses: column?.classes?.headerCell, - columnCss: column?.css?.headerCell, + columnStyles: column?.styles?.headerCell, }; }); @@ -203,8 +203,8 @@ export function ColumnHeader() { userSelect: 'none', }, defaultClasses.headerCell, - css, - columnCss, + styles, + columnStyles, stickyHeader && defaultClasses.sticky, stickyHeader instanceof Object && stickyHeader, ]} diff --git a/src/components/row.tsx b/src/components/row.tsx index cfd5bc9..1cbef8a 100644 --- a/src/components/row.tsx +++ b/src/components/row.tsx @@ -20,7 +20,7 @@ export const Row = memo(function Row({ const divRef = useRef(null); const classes = useTheme((t) => t.classes); - const css = useTheme((t) => t.css); + const styles = useTheme((t) => t.styles); const { className, @@ -36,7 +36,7 @@ export const Row = memo(function Row({ return { className: cx(...calcClassNames(classes, item, rowIndex)), - css_: calcCss(css, item, rowIndex), + css_: calcCss(styles, item, rowIndex), indent: item ? getAncestors(state.activeItemsById, item).size : 0, hasChildren: !!item?.children.length, hasDeferredChildren: item && state.props.hasDeferredChildren?.(item.value), diff --git a/src/components/table.tsx b/src/components/table.tsx index 8a30829..95dbb95 100644 --- a/src/components/table.tsx +++ b/src/components/table.tsx @@ -69,7 +69,7 @@ const TableInner = memo(function TableInner({ hidden }: { hidden: boolean }) id: column.id, width: column.width, classes: column.classes, - css: column.css, + styles: column.styles, })), ); const hasActiveFilters = table.useState((state) => { @@ -83,7 +83,7 @@ const TableInner = memo(function TableInner({ hidden }: { hidden: boolean }) const hasFooter = table.useState((state) => state.activeColumns.some((column) => column.footer)); const classes = useTheme((theme) => theme.classes); - const css = useTheme((theme) => theme.css); + const styles = useTheme((theme) => theme.styles); const stickyHeader = table.useState((state) => state.props.stickyHeader); const stickyFooter = table.useState((state) => state.props.stickyFooter); @@ -101,7 +101,7 @@ const TableInner = memo(function TableInner({ hidden }: { hidden: boolean }) return (