import { BoxProps, SvgIconProps, DialogProps, IconButtonProps, ChipProps } from '@mui/material'; import { ComponentType, CSSProperties, ElementType } from 'react'; declare module '@mui/material/styles' { interface TypographyVariants { display: CSSProperties; disclaimer: CSSProperties; disclaimer1: CSSProperties; disclaimer2: CSSProperties; caption1: CSSProperties; caption2: CSSProperties; body: CSSProperties; subheadline: CSSProperties; list: CSSProperties; } interface TypographyVariantsOptions { display?: CSSProperties; disclaimer?: CSSProperties; disclaimer1?: CSSProperties; disclaimer2?: CSSProperties; caption1?: CSSProperties; caption2?: CSSProperties; body?: CSSProperties; subheadline?: CSSProperties; list?: CSSProperties; } interface PaletteOptions { brand?: Palette['brand']; brandHover?: Palette['brandHover']; disabled?: Palette['disabled']; transparent?: Palette['transparent']; surface?: Palette['surface']; onSurface?: Palette['onSurface']; semantic?: Palette['semantic']; } interface Palette { brand: BrandColors; brandHover: BrandHoverColors; disabled: DisabledColors; transparent: TransparentColors; surface: SurfaceColors; onSurface: OnSurfaceColors; semantic: SemanticColors; } interface BrandColors { primary: string; secondary: string; tertiary: string; quarternary: string; } interface BrandHoverColors { primary: string; secondary: string; } interface DisabledColors { primary: string; secondary: string; tertiary: string; } interface SurfaceColors { main: string; contrastText: string; primary: string; secondary: string; tertiary: string; quarternary: string; } interface OnSurfaceColors { os0: string; os100: string; os200: string; os300: string; os500: string; os600: string; os700: string; os800: string; os900: string; } interface TransparentColors { primary: string; secondary: string; tertiary: string; quarternary: string; backdrop: string; transparent: string; } interface SemanticColors { alert: { primary: string; secondary: string; tertiary: string; }; warning: { primary: string; secondary: string; tertiary: string; }; info: { primary: string; secondary: string; tertiary: string; }; positive: { primary: string; }; } interface TypeBackground { primary: string; } interface Theme { flowShadows: { xs: string; s: string; m: string; l: string; xl: string; }; } interface ThemeOptions { flowShadows?: { xs?: string; s?: string; m?: string; l?: string; xl?: string; }; } interface ZIndex { hotspotCard: number; carousel: number; } } declare module '@mui/material/Alert' { interface AlertPropsColorOverrides { notification: true; } } declare module '@mui/material/Chip' { interface ChipPropsVariantOverrides { transparent: true; } interface ChipPropsColorOverrides { default: true; primary: true; /** * Restrict colors that are not according to flow brand */ secondary: true; error: true; info: true; success: true; warning: true; } interface ChipOwnProps { /** * Defines if chip is currently selected * @default false */ isSelected?: boolean; /** * Adds elevation style * @default false */ raised?: boolean; } } declare module '@mui/material/Button' { interface ButtonPropsVariantOverrides { navigation: true; shortcut: true; } interface ButtonPropsColorOverrides { primary: true; secondary: true; surface: true; white: true; error: true; inherit: true; /** * Restrict colors that are not according to flow brand */ warning: true; info: true; success: true; } } declare module '@mui/material/SvgIcon' { interface SvgIconPropsSizeOverrides { large: true; medium: true; small: true; extraSmall: true; extraLarge: true; } } declare module '@mui/material/IconButton' { interface IconButtonOwnProps { /** * Adds variant to IconButton that works the same as Button variants */ variant?: 'filled' | 'outlined' | 'standard'; /** * Clear description of button action for the screen reader */ ['aria-label']?: string; } interface IconButtonPropsColorOverrides { inherit: true; surface: true; secondary: true; white: true; error: true; /** * Restrict colors that are not according to flow brand */ default: false; warning: false; info: false; success: false; } interface IconButtonPropsSizeOverrides { small: true; medium: true; standard: true; /** * size not according to flow brand */ large: true; } } declare module '@mui/material/Typography' { interface TypographyPropsVariantOverrides { /** * Add new variants for the flow design system */ display: true; subheadline: true; disclaimer: true; disclaimer1: true; disclaimer2: true; body: true; list: true; caption1: true; caption2: true; } } declare module '@mui/material/Link' { interface LinkOwnProps { /** * Apply visited style * @default false */ visited?: boolean; } } declare module '@mui/material/Skeleton' { interface SkeletonPropsVariantOverrides { display: true; h1: true; h2: true; h3: true; h4: true; subheadline: true; disclaimer: true; disclaimer1: true; disclaimer2: true; body: true; list: true; caption1: true; caption2: true; } } declare module '@mui/material/Fab' { interface FabOwnProps { /** * Provided label as children appears with the mouse hover */ expandable?: boolean; /** * Adds elevation style * @default true */ raised?: boolean; /** * Clear description of button action for the screen reader */ ['aria-label']?: string; } interface FabPropsColorOverrides { primary: true; secondary: true; default: true; /** * Restrict colors that are not according to flow brand */ error: false; info: false; inherit: false; success: false; warning: false; } } declare module '@mui/material/Avatar' { interface AvatarOwnProps { /** * Disabled state * @default false */ disabled?: boolean; /** * Set size of rendered avatar * @default md */ size?: 'sm' | 'md' | 'lg'; /** * Controls show of optional border * @default auto */ border?: 'auto' | 'on' | 'off'; } } declare module '@mui/material/Tabs' { interface TabsOwnProps { /** * Default or rounded buttons variant * @default 'default' */ template?: 'default' | 'underlined' | 'navigation' | 'segmented' | 'buttons'; /** * Compatible property with variant='scrollable' */ fullWidth?: boolean; } } declare module '@mui/material/List' { interface ListOwnProps { /** * With inset={false} items inside are aligned with the rest of the page by providing negative margin * @default true */ inset?: boolean; } } declare module '@mui/material/Tooltip' { /** * Beware, tooltip is passing down the properties into children component */ interface TooltipProps { /** * Setup a size of the tooltip * @default 'small' */ 'data-tooltip-size'?: 'small' | 'large'; /** * Setup behavior on palette change * @default 'normal' */ 'data-tooltip-mode'?: 'normal' | 'reverse' | 'dark' | 'light'; } } declare module '@mui/material/Paper' { /** * Adds the elevation levels defined by Flow Design System */ interface PaperPropsVariantOverrides { /** * Add new variants for the flow design system */ xs: true; s: true; m: true; l: true; xl: true; } } declare module '@mui/material/Card' { interface CardOwnProps { /** * Defines which color should the card be * @default primary */ color?: 'primary' | 'secondary'; /** * Defines if card is currently selected * @default false */ isSelected?: boolean; /** * Show/Hide Flow Card Icon * @default true */ disableIcon?: boolean; /** * Placement of the Icon in the card * @default top-end */ iconPlacement?: 'bottom-end' | 'bottom-start' | 'top-end' | 'top-start'; /** * Used Flow icon nodes based on isSelected and hover status */ iconSlots?: { icon?: ComponentType; selected?: ComponentType; hoverIcon?: ComponentType; hoverSelectedIcon?: ComponentType; }; /** * Props related to Card Icon component */ iconProps?: SvgIconProps; /** * Props related to Card Icon component that appears on hover */ hoverIconProps?: SvgIconProps; /** * Wrapper for absolute positioned Icon component */ iconWrapperProps?: BoxProps; /** * Wrapper of all content inside, adding overflow: 'hidden' while allowing * selected border to overflow outside the card */ contentWrapperProps?: BoxProps; /** * Renders Card disabled * @default false */ disabled?: boolean; } } declare module '@mui/material/FormHelperText' { interface FormHelperTextOwnProps { /** * Should HelperText truncate * @default true */ truncate?: boolean; } } declare module '@mui/material/DialogTitle' { interface DialogTitleOwnProps { /** * Function to handle the close action. By providing this function, close IconButton automatically appears * */ onClose?: DialogProps['onClose']; /** * Properties applied to close IconButton */ closeIconButtonProps?: IconButtonProps; } } declare module '@mui/material/Stepper' { interface StepperOwnProps { /** * Affects component looks * @default medium */ size?: 'small' | 'medium'; } } declare module '@mui/material/LinearProgress' { interface LinearProgressProps { /** * Affects component size * @default medium */ size?: 'small' | 'medium'; } } declare module '@mui/x-date-pickers' { /** * Extend pickers shortcut with chip properties that are applied in code already * https://github.com/mui/mui-x/blob/master/packages/x-date-pickers/src/PickersShortcuts/PickersShortcuts.tsx#L79 */ interface PickersShortcutsItem extends Omit { } } /** * Currently custom *OwnProps properties are passed to DOM elements * and React throws a warning (in case we are not overwriting default component). * The only workaround is to overwrite component. * * Hopefully @mui will provide solution to this in future as it already have * shouldForwardProps for styled() props passing * * https://github.com/mui/material-ui/issues/34831 */