Skip to content

Commit

Permalink
fix: restore theme types
Browse files Browse the repository at this point in the history
  • Loading branch information
FredrikOseberg committed Jan 25, 2024
1 parent 995553f commit 5ead057
Show file tree
Hide file tree
Showing 2 changed files with 182 additions and 0 deletions.
Empty file added frontend/src/themes/theme
Empty file.
182 changes: 182 additions & 0 deletions frontend/src/themes/themeTypes.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,182 @@
// biome-ignore lint/nursery/noUnusedImports: Needed to not break MUI imports
import { FormHelperTextOwnProps } from '@mui/material/FormHelperText';

declare module '@mui/material/styles' {
interface CustomTheme {
/**
* @deprecated
*/
fontSizes: {
largeHeader: string;
mainHeader: string;
bodySize: string;
smallBody: string;
smallerBody: string;
};
/**
* @deprecated
*/
fontWeight: {
thin: number;
medium: number;
semi: number;
bold: number;
};
/**
* @deprecated
*/
boxShadows: {
main: string;
card: string;
elevated: string;
popup: string;
primaryHeader: string;
separator: string;
};
}

interface CustomPalette {
/**
* Generic neutral palette color
*/
neutral: PaletteColorOptions;

/**
* Sales-related palette color
*/
web: PaletteColorOptions;

/**
* Table colors
*/
table: {
headerBackground: string;
headerHover: string;
divider: string;
rowHover: string;
};

/**
* Colors for event log output
*/
eventLog: {
diffAdd: string;
diffSub: string;
edited: string;
};

/**
* For 'Seen' column on feature toggles list and other
*/
seen: {
unknown: string;
recent: string;
inactive: string;
abandoned: string;
primary: string;
};

/**
* Background color for the API command in the sidebar
*/
codebox: string;

/**
* Gradient for the login page
*/
loginGradient: {
from: string;
to: string;
};

/**
* Text highlight effect color. Used when filtering/searching over content
*/
highlight: string;

/**
* Used for the interactive guide spotlight
*/
spotlight: {
border: string;
outline: string;
pulse: string;
};

/**
* For Links
*/
links: string;

/**
* For Environment Accordion
*/
envAccordion: {
disabled: string;
expanded: string;
};

/**
* Variants, percentage split in strategies
**/
variants: string[];
}

type Theme = CustomTheme;
type ThemeOptions = CustomTheme;

type Palette = CustomPalette;
type PaletteOptions = CustomPalette;

type TypeBackground = CustomTypeBackground;

/* Extend the background object from MUI */
interface CustomTypeBackground {
application: string;
sidebar: string;
alternative: string;
elevation1: string;
elevation2: string;
}

interface PaletteColor {
main: string;
light: string;
dark: string;
border?: string;
contrastText: string;
}
interface PaletteColorOptions {
main?: string;
light?: string;
dark?: string;
border?: string;
contrastText?: string;
}
}

declare module '@mui/system/createTheme/shape' {
interface Shape {
borderRadiusMedium: number;
borderRadiusLarge: number;
borderRadiusExtraLarge: number;
tableRowHeight: number;
tableRowHeightCompact: number;
tableRowHeightDense: number;
}
}
declare module '@mui/material/styles/zIndex' {
interface ZIndex {
sticky: number;
}
}
declare module '@mui/material' {
interface ButtonPropsColorOverrides {
web: true;
}
}
declare module '@mui/material/FormHelperText' {
interface FormHelperTextOwnProps {
'data-testid'?: string;
}
}

0 comments on commit 5ead057

Please sign in to comment.