Skip to content

Commit

Permalink
fix: re-add getprimarycolor and getprimaryshade utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
alessandrojcm committed Sep 27, 2023
1 parent bc24209 commit bd54261
Showing 1 changed file with 12 additions and 0 deletions.
12 changes: 12 additions & 0 deletions packages/mantine-react-table/src/column.utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import {
type MantineTheme,
} from '@mantine/core';
import {
type MantineShade,
type MRT_Column,
type MRT_ColumnDef,
type MRT_ColumnOrderState,
Expand Down Expand Up @@ -390,6 +391,17 @@ export const MRT_DefaultDisplayColumn = {

export const parseCSSVarId = (id: string) => id.replace(/[^a-zA-Z0-9]/g, '_');

export const getPrimaryShade = (theme: MantineTheme): number =>
(theme.colorScheme === 'dark'
? // @ts-ignore
theme.primaryShade?.dark ?? theme.primaryShade
: // @ts-ignore
theme.primaryShade?.light ?? theme.primaryShade) ?? 7;

export const getPrimaryColor = (
theme: MantineTheme,
shade?: MantineShade,
): string => theme.colors[theme.primaryColor][shade ?? getPrimaryShade(theme)];
export const flexRender = _flexRender as (
Comp: Renderable<any>,
props: any,
Expand Down

0 comments on commit bd54261

Please sign in to comment.