@mui/system 7.0.0-alpha.2 → 7.0.0-beta.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +42 -0
- package/Grid/createGrid.js +4 -0
- package/Grid/deleteLegacyGridProps.js +47 -0
- package/esm/Grid/createGrid.js +4 -0
- package/esm/Grid/deleteLegacyGridProps.d.ts +11 -0
- package/esm/Grid/deleteLegacyGridProps.js +41 -0
- package/esm/index.js +1 -1
- package/esm/version/index.js +2 -2
- package/index.js +1 -1
- package/modern/Grid/createGrid.js +4 -0
- package/modern/Grid/deleteLegacyGridProps.js +41 -0
- package/modern/index.js +1 -1
- package/modern/version/index.js +2 -2
- package/package.json +5 -6
- package/tsconfig.build.tsbuildinfo +1 -1
- package/version/index.js +2 -2
- package/Box/Box.d.ts +0 -72
- package/Box/boxClasses.d.ts +0 -7
- package/Box/index.d.ts +0 -4
- package/CSSProperties.d.ts +0 -7
- package/Container/Container.d.ts +0 -13
- package/Container/ContainerProps.d.ts +0 -40
- package/Container/containerClasses.d.ts +0 -22
- package/Container/createContainer.d.ts +0 -18
- package/Container/index.d.ts +0 -4
- package/DefaultPropsProvider/DefaultPropsProvider.d.ts +0 -18
- package/DefaultPropsProvider/index.d.ts +0 -1
- package/GlobalStyles/GlobalStyles.d.ts +0 -17
- package/GlobalStyles/index.d.ts +0 -2
- package/Grid/Grid.d.ts +0 -13
- package/Grid/GridProps.d.ts +0 -103
- package/Grid/createGrid.d.ts +0 -13
- package/Grid/gridClasses.d.ts +0 -20
- package/Grid/gridGenerator.d.ts +0 -42
- package/Grid/index.d.ts +0 -7
- package/Grid/traverseBreakpoints.d.ts +0 -7
- package/InitColorSchemeScript/InitColorSchemeScript.d.ts +0 -51
- package/InitColorSchemeScript/index.d.ts +0 -2
- package/RtlProvider/index.d.ts +0 -8
- package/Stack/Stack.d.ts +0 -14
- package/Stack/StackProps.d.ts +0 -53
- package/Stack/createStack.d.ts +0 -24
- package/Stack/index.d.ts +0 -5
- package/Stack/stackClasses.d.ts +0 -8
- package/ThemeProvider/ThemeProvider.d.ts +0 -24
- package/ThemeProvider/index.d.ts +0 -2
- package/borders/borders.d.ts +0 -13
- package/borders/index.d.ts +0 -2
- package/breakpoints/breakpoints.d.ts +0 -19
- package/breakpoints/index.d.ts +0 -2
- package/colorManipulator/colorManipulator.d.ts +0 -25
- package/colorManipulator/index.d.ts +0 -1
- package/compose/compose.d.ts +0 -2
- package/compose/index.d.ts +0 -1
- package/createBox/createBox.d.ts +0 -9
- package/createBox/index.d.ts +0 -1
- package/createBreakpoints/createBreakpoints.d.ts +0 -78
- package/createBreakpoints/index.d.ts +0 -3
- package/createStyled/createStyled.d.ts +0 -27
- package/createStyled/index.d.ts +0 -2
- package/createTheme/applyStyles.d.ts +0 -67
- package/createTheme/createSpacing.d.ts +0 -10
- package/createTheme/createTheme.d.ts +0 -54
- package/createTheme/index.d.ts +0 -4
- package/createTheme/shape.d.ts +0 -6
- package/cssContainerQueries/cssContainerQueries.d.ts +0 -23
- package/cssContainerQueries/index.d.ts +0 -3
- package/cssGrid/cssGrid.d.ts +0 -2
- package/cssGrid/index.d.ts +0 -2
- package/cssVars/createCssVarsProvider.d.ts +0 -129
- package/cssVars/createCssVarsTheme.d.ts +0 -15
- package/cssVars/createGetCssVar.d.ts +0 -5
- package/cssVars/cssVarsParser.d.ts +0 -64
- package/cssVars/getColorSchemeSelector.d.ts +0 -1
- package/cssVars/index.d.ts +0 -7
- package/cssVars/prepareCssVars.d.ts +0 -16
- package/cssVars/prepareTypographyVars.d.ts +0 -4
- package/cssVars/useCurrentColorScheme.d.ts +0 -54
- package/display/display.d.ts +0 -2
- package/display/index.d.ts +0 -2
- package/flexbox/flexbox.d.ts +0 -2
- package/flexbox/index.d.ts +0 -2
- package/getThemeValue/getThemeValue.d.ts +0 -1
- package/getThemeValue/index.d.ts +0 -2
- package/index.d.ts +0 -79
- package/memoTheme.d.ts +0 -12
- package/memoize/index.d.ts +0 -1
- package/memoize/memoize.d.ts +0 -1
- package/merge/index.d.ts +0 -1
- package/merge/merge.d.ts +0 -1
- package/modern/Box/Box.d.ts +0 -72
- package/modern/Box/boxClasses.d.ts +0 -7
- package/modern/Box/index.d.ts +0 -4
- package/modern/CSSProperties.d.ts +0 -7
- package/modern/Container/Container.d.ts +0 -13
- package/modern/Container/ContainerProps.d.ts +0 -40
- package/modern/Container/containerClasses.d.ts +0 -22
- package/modern/Container/createContainer.d.ts +0 -18
- package/modern/Container/index.d.ts +0 -4
- package/modern/DefaultPropsProvider/DefaultPropsProvider.d.ts +0 -18
- package/modern/DefaultPropsProvider/index.d.ts +0 -1
- package/modern/GlobalStyles/GlobalStyles.d.ts +0 -17
- package/modern/GlobalStyles/index.d.ts +0 -2
- package/modern/Grid/Grid.d.ts +0 -13
- package/modern/Grid/GridProps.d.ts +0 -103
- package/modern/Grid/createGrid.d.ts +0 -13
- package/modern/Grid/gridClasses.d.ts +0 -20
- package/modern/Grid/gridGenerator.d.ts +0 -42
- package/modern/Grid/index.d.ts +0 -7
- package/modern/Grid/traverseBreakpoints.d.ts +0 -7
- package/modern/InitColorSchemeScript/InitColorSchemeScript.d.ts +0 -51
- package/modern/InitColorSchemeScript/index.d.ts +0 -2
- package/modern/RtlProvider/index.d.ts +0 -8
- package/modern/Stack/Stack.d.ts +0 -14
- package/modern/Stack/StackProps.d.ts +0 -53
- package/modern/Stack/createStack.d.ts +0 -24
- package/modern/Stack/index.d.ts +0 -5
- package/modern/Stack/stackClasses.d.ts +0 -8
- package/modern/ThemeProvider/ThemeProvider.d.ts +0 -24
- package/modern/ThemeProvider/index.d.ts +0 -2
- package/modern/borders/borders.d.ts +0 -13
- package/modern/borders/index.d.ts +0 -2
- package/modern/breakpoints/breakpoints.d.ts +0 -19
- package/modern/breakpoints/index.d.ts +0 -2
- package/modern/colorManipulator/colorManipulator.d.ts +0 -25
- package/modern/colorManipulator/index.d.ts +0 -1
- package/modern/compose/compose.d.ts +0 -2
- package/modern/compose/index.d.ts +0 -1
- package/modern/createBox/createBox.d.ts +0 -9
- package/modern/createBox/index.d.ts +0 -1
- package/modern/createBreakpoints/createBreakpoints.d.ts +0 -78
- package/modern/createBreakpoints/index.d.ts +0 -3
- package/modern/createStyled/createStyled.d.ts +0 -27
- package/modern/createStyled/index.d.ts +0 -2
- package/modern/createTheme/applyStyles.d.ts +0 -67
- package/modern/createTheme/createSpacing.d.ts +0 -10
- package/modern/createTheme/createTheme.d.ts +0 -54
- package/modern/createTheme/index.d.ts +0 -4
- package/modern/createTheme/shape.d.ts +0 -6
- package/modern/cssContainerQueries/cssContainerQueries.d.ts +0 -23
- package/modern/cssContainerQueries/index.d.ts +0 -3
- package/modern/cssGrid/cssGrid.d.ts +0 -2
- package/modern/cssGrid/index.d.ts +0 -2
- package/modern/cssVars/createCssVarsProvider.d.ts +0 -129
- package/modern/cssVars/createCssVarsTheme.d.ts +0 -15
- package/modern/cssVars/createGetCssVar.d.ts +0 -5
- package/modern/cssVars/cssVarsParser.d.ts +0 -64
- package/modern/cssVars/getColorSchemeSelector.d.ts +0 -1
- package/modern/cssVars/index.d.ts +0 -7
- package/modern/cssVars/prepareCssVars.d.ts +0 -16
- package/modern/cssVars/prepareTypographyVars.d.ts +0 -4
- package/modern/cssVars/useCurrentColorScheme.d.ts +0 -54
- package/modern/display/display.d.ts +0 -2
- package/modern/display/index.d.ts +0 -2
- package/modern/flexbox/flexbox.d.ts +0 -2
- package/modern/flexbox/index.d.ts +0 -2
- package/modern/getThemeValue/getThemeValue.d.ts +0 -1
- package/modern/getThemeValue/index.d.ts +0 -2
- package/modern/index.d.ts +0 -79
- package/modern/memoTheme.d.ts +0 -12
- package/modern/memoize/index.d.ts +0 -1
- package/modern/memoize/memoize.d.ts +0 -1
- package/modern/merge/index.d.ts +0 -1
- package/modern/merge/merge.d.ts +0 -1
- package/modern/palette/index.d.ts +0 -2
- package/modern/palette/palette.d.ts +0 -4
- package/modern/positions/index.d.ts +0 -2
- package/modern/positions/positions.d.ts +0 -2
- package/modern/preprocessStyles.d.ts +0 -5
- package/modern/propsToClassKey/index.d.ts +0 -1
- package/modern/propsToClassKey/propsToClassKey.d.ts +0 -1
- package/modern/responsivePropType/index.d.ts +0 -1
- package/modern/responsivePropType/responsivePropType.d.ts +0 -2
- package/modern/shadows/index.d.ts +0 -1
- package/modern/shadows/shadows.d.ts +0 -2
- package/modern/sizing/index.d.ts +0 -2
- package/modern/sizing/sizing.d.ts +0 -11
- package/modern/spacing/index.d.ts +0 -2
- package/modern/spacing/spacing.d.ts +0 -18
- package/modern/style/index.d.ts +0 -2
- package/modern/style/style.d.ts +0 -19
- package/modern/styleFunctionSx/AliasesCSSProperties.d.ts +0 -269
- package/modern/styleFunctionSx/OverwriteCSSProperties.d.ts +0 -54
- package/modern/styleFunctionSx/StandardCssProperties.d.ts +0 -2
- package/modern/styleFunctionSx/defaultSxConfig.d.ts +0 -15
- package/modern/styleFunctionSx/extendSxProp.d.ts +0 -4
- package/modern/styleFunctionSx/index.d.ts +0 -9
- package/modern/styleFunctionSx/styleFunctionSx.d.ts +0 -62
- package/modern/styled/index.d.ts +0 -1
- package/modern/styled/styled.d.ts +0 -3
- package/modern/typography/index.d.ts +0 -2
- package/modern/typography/typography.d.ts +0 -11
- package/modern/useMediaQuery/index.d.ts +0 -2
- package/modern/useMediaQuery/useMediaQuery.d.ts +0 -32
- package/modern/useTheme/index.d.ts +0 -2
- package/modern/useTheme/useTheme.d.ts +0 -2
- package/modern/useThemeProps/getThemeProps.d.ts +0 -16
- package/modern/useThemeProps/index.d.ts +0 -3
- package/modern/useThemeProps/useThemeProps.d.ts +0 -14
- package/modern/useThemeWithoutDefault/index.d.ts +0 -1
- package/modern/useThemeWithoutDefault/useThemeWithoutDefault.d.ts +0 -1
- package/modern/version/index.d.ts +0 -6
- package/palette/index.d.ts +0 -2
- package/palette/palette.d.ts +0 -4
- package/positions/index.d.ts +0 -2
- package/positions/positions.d.ts +0 -2
- package/preprocessStyles.d.ts +0 -5
- package/propsToClassKey/index.d.ts +0 -1
- package/propsToClassKey/propsToClassKey.d.ts +0 -1
- package/responsivePropType/index.d.ts +0 -1
- package/responsivePropType/responsivePropType.d.ts +0 -2
- package/shadows/index.d.ts +0 -1
- package/shadows/shadows.d.ts +0 -2
- package/sizing/index.d.ts +0 -2
- package/sizing/sizing.d.ts +0 -11
- package/spacing/index.d.ts +0 -2
- package/spacing/spacing.d.ts +0 -18
- package/style/index.d.ts +0 -2
- package/style/style.d.ts +0 -19
- package/styleFunctionSx/AliasesCSSProperties.d.ts +0 -269
- package/styleFunctionSx/OverwriteCSSProperties.d.ts +0 -54
- package/styleFunctionSx/StandardCssProperties.d.ts +0 -2
- package/styleFunctionSx/defaultSxConfig.d.ts +0 -15
- package/styleFunctionSx/extendSxProp.d.ts +0 -4
- package/styleFunctionSx/index.d.ts +0 -9
- package/styleFunctionSx/styleFunctionSx.d.ts +0 -62
- package/styled/index.d.ts +0 -1
- package/styled/styled.d.ts +0 -3
- package/typography/index.d.ts +0 -2
- package/typography/typography.d.ts +0 -11
- package/useMediaQuery/index.d.ts +0 -2
- package/useMediaQuery/useMediaQuery.d.ts +0 -32
- package/useTheme/index.d.ts +0 -2
- package/useTheme/useTheme.d.ts +0 -2
- package/useThemeProps/getThemeProps.d.ts +0 -16
- package/useThemeProps/index.d.ts +0 -3
- package/useThemeProps/useThemeProps.d.ts +0 -14
- package/useThemeWithoutDefault/index.d.ts +0 -1
- package/useThemeWithoutDefault/useThemeWithoutDefault.d.ts +0 -1
- package/version/index.d.ts +0 -6
|
@@ -1,24 +0,0 @@
|
|
|
1
|
-
import { DefaultTheme } from '@mui/private-theming';
|
|
2
|
-
export interface ThemeProviderProps<Theme = DefaultTheme> {
|
|
3
|
-
/**
|
|
4
|
-
* Your component tree.
|
|
5
|
-
*/
|
|
6
|
-
children?: React.ReactNode;
|
|
7
|
-
/**
|
|
8
|
-
* The design system's unique id for getting the corresponded theme when there are multiple design systems.
|
|
9
|
-
*/
|
|
10
|
-
themeId?: string;
|
|
11
|
-
/**
|
|
12
|
-
* A theme object. You can provide a function to extend the outer theme.
|
|
13
|
-
*/
|
|
14
|
-
theme: Partial<Theme> | ((outerTheme: Theme) => Theme);
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
/**
|
|
18
|
-
* This component makes the `theme` available down the React tree.
|
|
19
|
-
* It should preferably be used at **the root of your component tree**.
|
|
20
|
-
* API:
|
|
21
|
-
*
|
|
22
|
-
* - [ThemeProvider API](https://mui.com/material-ui/customization/theming/#themeprovider)
|
|
23
|
-
*/
|
|
24
|
-
export default function ThemeProvider<T = DefaultTheme>(props: ThemeProviderProps<T>): React.ReactElement<ThemeProviderProps<T>>;
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
import { PropsFor, SimpleStyleFunction, borders } from "../Box/index.js";
|
|
2
|
-
export const border: SimpleStyleFunction<'border'>;
|
|
3
|
-
export const borderTop: SimpleStyleFunction<'borderTop'>;
|
|
4
|
-
export const borderRight: SimpleStyleFunction<'borderRight'>;
|
|
5
|
-
export const borderBottom: SimpleStyleFunction<'borderBottom'>;
|
|
6
|
-
export const borderLeft: SimpleStyleFunction<'borderLeft'>;
|
|
7
|
-
export const borderColor: SimpleStyleFunction<'borderColor'>;
|
|
8
|
-
export const borderTopColor: SimpleStyleFunction<'borderTopColor'>;
|
|
9
|
-
export const borderRightColor: SimpleStyleFunction<'borderRightColor'>;
|
|
10
|
-
export const borderBottomColor: SimpleStyleFunction<'borderBottomColor'>;
|
|
11
|
-
export const borderLeftColor: SimpleStyleFunction<'borderLeftColor'>;
|
|
12
|
-
export const borderRadius: SimpleStyleFunction<'borderRadius'>;
|
|
13
|
-
export type BordersProps = PropsFor<typeof borders>;
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { CSSObject } from '@mui/styled-engine';
|
|
2
|
-
import { Breakpoints } from "../createBreakpoints/createBreakpoints.js";
|
|
3
|
-
import type { Breakpoint } from "../createTheme/index.js";
|
|
4
|
-
import { ResponsiveStyleValue } from "../styleFunctionSx/index.js";
|
|
5
|
-
import { StyleFunction } from "../Box/index.js";
|
|
6
|
-
export interface ResolveBreakpointValuesOptions<T> {
|
|
7
|
-
values: ResponsiveStyleValue<T>;
|
|
8
|
-
breakpoints?: Breakpoints['values'];
|
|
9
|
-
base?: Record<string, boolean>;
|
|
10
|
-
}
|
|
11
|
-
export function resolveBreakpointValues<T>(options: ResolveBreakpointValuesOptions<T>): Record<string, T>;
|
|
12
|
-
export function mergeBreakpointsInOrder(breakpoints: Breakpoints, styles: CSSObject[]): CSSObject;
|
|
13
|
-
export function handleBreakpoints<Props>(props: Props, propValue: any, styleFromPropValue: (value: any, breakpoint?: Breakpoint) => any): any;
|
|
14
|
-
type DefaultBreakPoints = 'xs' | 'sm' | 'md' | 'lg' | 'xl';
|
|
15
|
-
|
|
16
|
-
/**
|
|
17
|
-
* @returns An enhanced stylefunction that considers breakpoints
|
|
18
|
-
*/
|
|
19
|
-
export default function breakpoints<Props, Breakpoints extends string = DefaultBreakPoints>(styleFunction: StyleFunction<Props>): StyleFunction<Partial<Record<Breakpoints, Props>> & Props>;
|
|
@@ -1,25 +0,0 @@
|
|
|
1
|
-
/* eslint-disable @typescript-eslint/naming-convention */
|
|
2
|
-
export type ColorFormat = 'rgb' | 'rgba' | 'hsl' | 'hsla' | 'color';
|
|
3
|
-
export interface ColorObject {
|
|
4
|
-
type: ColorFormat;
|
|
5
|
-
values: [number, number, number] | [number, number, number, number];
|
|
6
|
-
colorSpace?: 'srgb' | 'display-p3' | 'a98-rgb' | 'prophoto-rgb' | 'rec-2020';
|
|
7
|
-
}
|
|
8
|
-
export function hexToRgb(hex: string): string;
|
|
9
|
-
export function rgbToHex(color: string): string;
|
|
10
|
-
export function hslToRgb(color: string): string;
|
|
11
|
-
export function decomposeColor(color: string): ColorObject;
|
|
12
|
-
export function colorChannel(color: string): string;
|
|
13
|
-
export function private_safeColorChannel(color: string, warning?: string): string;
|
|
14
|
-
export function recomposeColor(color: ColorObject): string;
|
|
15
|
-
export function getContrastRatio(foreground: string, background: string): number;
|
|
16
|
-
export function getLuminance(color: string): number;
|
|
17
|
-
export function emphasize(color: string, coefficient?: number): string;
|
|
18
|
-
export function private_safeEmphasize(color: string, coefficient?: number, warning?: string): string;
|
|
19
|
-
export function alpha(color: string, value: number): string;
|
|
20
|
-
export function private_safeAlpha(color: string, value: number, warning?: string): string;
|
|
21
|
-
export function darken(color: string, coefficient: number): string;
|
|
22
|
-
export function private_safeDarken(color: string, coefficient: number, warning?: string): string;
|
|
23
|
-
export function lighten(color: string, coefficient: number): string;
|
|
24
|
-
export function private_safeLighten(color: string, coefficient: number, warning?: string): string;
|
|
25
|
-
export function blend(background: string, overlay: string, opacity: number, gamma?: number): string;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export * from "./colorManipulator.js";
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./compose.js";
|
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
import { OverridableComponent } from '@mui/types';
|
|
2
|
-
import { BoxTypeMap } from "../Box/index.js";
|
|
3
|
-
import { Theme as SystemTheme } from "../createTheme/index.js";
|
|
4
|
-
export default function createBox<T extends object = SystemTheme, AdditionalProps extends Record<string, unknown> = {}>(options?: {
|
|
5
|
-
themeId?: string;
|
|
6
|
-
defaultTheme: T;
|
|
7
|
-
defaultClassName?: string;
|
|
8
|
-
generateClassName?: (componentName: string) => string;
|
|
9
|
-
}): OverridableComponent<BoxTypeMap<AdditionalProps, 'div', T>>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export { default } from "./createBox.js";
|
|
@@ -1,78 +0,0 @@
|
|
|
1
|
-
import { OverridableStringUnion } from '@mui/types';
|
|
2
|
-
export interface BreakpointOverrides {}
|
|
3
|
-
export type Breakpoint = OverridableStringUnion<'xs' | 'sm' | 'md' | 'lg' | 'xl', BreakpointOverrides>;
|
|
4
|
-
export const keys: Breakpoint[];
|
|
5
|
-
|
|
6
|
-
// Keep in sync with docs/src/pages/customization/breakpoints/breakpoints.md
|
|
7
|
-
// #host-reference
|
|
8
|
-
export interface Breakpoints {
|
|
9
|
-
keys: Breakpoint[];
|
|
10
|
-
/**
|
|
11
|
-
* Each breakpoint (a key) matches with a fixed screen width (a value).
|
|
12
|
-
* @default {
|
|
13
|
-
* // extra-small
|
|
14
|
-
* xs: 0,
|
|
15
|
-
* // small
|
|
16
|
-
* sm: 600,
|
|
17
|
-
* // medium
|
|
18
|
-
* md: 900,
|
|
19
|
-
* // large
|
|
20
|
-
* lg: 1200,
|
|
21
|
-
* // extra-large
|
|
22
|
-
* xl: 1536,
|
|
23
|
-
* }
|
|
24
|
-
*/
|
|
25
|
-
values: { [key in Breakpoint]: number };
|
|
26
|
-
/**
|
|
27
|
-
* @param key - A breakpoint key (`xs`, `sm`, etc.) or a screen width number in px.
|
|
28
|
-
* @returns A media query string ready to be used with most styling solutions, which matches screen widths greater than the screen size given by the breakpoint key (inclusive).
|
|
29
|
-
* @see [API documentation](https://next.mui.com/material-ui/customization/breakpoints/#theme-breakpoints-up-key-media-query)
|
|
30
|
-
*/
|
|
31
|
-
up: (key: Breakpoint | number) => string;
|
|
32
|
-
/**
|
|
33
|
-
* @param key - A breakpoint key (`xs`, `sm`, etc.) or a screen width number in px.
|
|
34
|
-
* @returns A media query string ready to be used with most styling solutions, which matches screen widths less than the screen size given by the breakpoint key (exclusive).
|
|
35
|
-
* @see [API documentation](https://next.mui.com/material-ui/customization/breakpoints/#theme-breakpoints-down-key-media-query)
|
|
36
|
-
*/
|
|
37
|
-
down: (key: Breakpoint | number) => string;
|
|
38
|
-
/**
|
|
39
|
-
* @param start - A breakpoint key (`xs`, `sm`, etc.) or a screen width number in px.
|
|
40
|
-
* @param end - A breakpoint key (`xs`, `sm`, etc.) or a screen width number in px.
|
|
41
|
-
* @returns A media query string ready to be used with most styling solutions, which matches screen widths greater than
|
|
42
|
-
* the screen size given by the breakpoint key in the first argument (inclusive) and less than the screen size given by the breakpoint key in the second argument (exclusive).
|
|
43
|
-
* @see [API documentation](https://next.mui.com/material-ui/customization/breakpoints/#theme-breakpoints-between-start-end-media-query)
|
|
44
|
-
*/
|
|
45
|
-
between: (start: Breakpoint | number, end: Breakpoint | number) => string;
|
|
46
|
-
/**
|
|
47
|
-
* @param key - A breakpoint key (`xs`, `sm`, etc.) or a screen width number in px.
|
|
48
|
-
* @returns A media query string ready to be used with most styling solutions, which matches screen widths starting from
|
|
49
|
-
* the screen size given by the breakpoint key (inclusive) and stopping at the screen size given by the next breakpoint key (exclusive).
|
|
50
|
-
* @see [API documentation](https://next.mui.com/material-ui/customization/breakpoints/#theme-breakpoints-only-key-media-query)
|
|
51
|
-
*/
|
|
52
|
-
only: (key: Breakpoint) => string;
|
|
53
|
-
/**
|
|
54
|
-
* @param key - A breakpoint key (`xs`, `sm`, etc.).
|
|
55
|
-
* @returns A media query string ready to be used with most styling solutions, which matches screen widths stopping at
|
|
56
|
-
* the screen size given by the breakpoint key (exclusive) and starting at the screen size given by the next breakpoint key (inclusive).
|
|
57
|
-
*/
|
|
58
|
-
not: (key: Breakpoint) => string;
|
|
59
|
-
/**
|
|
60
|
-
* The unit used for the breakpoint's values.
|
|
61
|
-
* @default 'px'
|
|
62
|
-
*/
|
|
63
|
-
unit?: string | undefined;
|
|
64
|
-
}
|
|
65
|
-
export interface BreakpointsOptions extends Partial<Breakpoints> {
|
|
66
|
-
/**
|
|
67
|
-
* The increment divided by 100 used to implement exclusive breakpoints.
|
|
68
|
-
* For example, `step: 5` means that `down(500)` will result in `'(max-width: 499.95px)'`.
|
|
69
|
-
* @default 5
|
|
70
|
-
*/
|
|
71
|
-
step?: number | undefined;
|
|
72
|
-
/**
|
|
73
|
-
* The unit used for the breakpoint's values.
|
|
74
|
-
* @default 'px'
|
|
75
|
-
*/
|
|
76
|
-
unit?: string | undefined;
|
|
77
|
-
}
|
|
78
|
-
export default function createBreakpoints(options: BreakpointsOptions): Breakpoints;
|
|
@@ -1,27 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import { CreateMUIStyled as CreateMUIStyledStyledEngine, CSSInterpolation } from '@mui/styled-engine';
|
|
3
|
-
import styleFunctionSx, { SxProps } from "../styleFunctionSx/index.js";
|
|
4
|
-
import { Theme as DefaultTheme } from "../createTheme/index.js";
|
|
5
|
-
export function shouldForwardProp(propName: PropertyKey): boolean;
|
|
6
|
-
export interface MUIStyledCommonProps<Theme extends object = DefaultTheme> {
|
|
7
|
-
theme?: Theme;
|
|
8
|
-
as?: React.ElementType;
|
|
9
|
-
sx?: SxProps<Theme>;
|
|
10
|
-
}
|
|
11
|
-
export interface MuiStyledOptions {
|
|
12
|
-
name?: string;
|
|
13
|
-
slot?: string;
|
|
14
|
-
// The difference between Interpolation and CSSInterpolation is that the former supports functions based on props
|
|
15
|
-
// If we want to support props in the overrides, we will need to change the CSSInterpolation to Interpolation<Props>
|
|
16
|
-
overridesResolver?: (props: any, styles: Record<string, CSSInterpolation>) => CSSInterpolation;
|
|
17
|
-
skipVariantsResolver?: boolean;
|
|
18
|
-
skipSx?: boolean;
|
|
19
|
-
}
|
|
20
|
-
export type CreateMUIStyled<Theme extends object = DefaultTheme> = CreateMUIStyledStyledEngine<MUIStyledCommonProps<Theme>, MuiStyledOptions, Theme>;
|
|
21
|
-
export default function createStyled<Theme extends object = DefaultTheme>(options?: {
|
|
22
|
-
themeId?: string;
|
|
23
|
-
defaultTheme?: Theme;
|
|
24
|
-
rootShouldForwardProp?: (prop: PropertyKey) => boolean;
|
|
25
|
-
slotShouldForwardProp?: (prop: PropertyKey) => boolean;
|
|
26
|
-
styleFunctionSx?: typeof styleFunctionSx;
|
|
27
|
-
}): CreateMUIStyled<Theme>;
|
|
@@ -1,67 +0,0 @@
|
|
|
1
|
-
import { CSSObject } from '@mui/styled-engine';
|
|
2
|
-
export interface ApplyStyles<K extends string> {
|
|
3
|
-
(key: K, styles: CSSObject): CSSObject;
|
|
4
|
-
}
|
|
5
|
-
/**
|
|
6
|
-
* A universal utility to style components with multiple color modes. Always use it from the theme object.
|
|
7
|
-
* It works with:
|
|
8
|
-
* - [Basic theme](https://mui.com/material-ui/customization/dark-mode/)
|
|
9
|
-
* - [CSS theme variables](https://mui.com/material-ui/customization/css-theme-variables/overview/)
|
|
10
|
-
* - Zero-runtime engine
|
|
11
|
-
*
|
|
12
|
-
* Tips: Use an array over object spread and place `theme.applyStyles()` last.
|
|
13
|
-
*
|
|
14
|
-
* With the styled function:
|
|
15
|
-
* ✅ [{ background: '#e5e5e5' }, theme.applyStyles('dark', { background: '#1c1c1c' })]
|
|
16
|
-
* 🚫 { background: '#e5e5e5', ...theme.applyStyles('dark', { background: '#1c1c1c' })}
|
|
17
|
-
*
|
|
18
|
-
* With the sx prop:
|
|
19
|
-
* ✅ [{ background: '#e5e5e5' }, theme => theme.applyStyles('dark', { background: '#1c1c1c' })]
|
|
20
|
-
* 🚫 { background: '#e5e5e5', ...theme => theme.applyStyles('dark', { background: '#1c1c1c' })}
|
|
21
|
-
*
|
|
22
|
-
* @example
|
|
23
|
-
* 1. using with `styled`:
|
|
24
|
-
* ```jsx
|
|
25
|
-
* const Component = styled('div')(({ theme }) => [
|
|
26
|
-
* { background: '#e5e5e5' },
|
|
27
|
-
* theme.applyStyles('dark', {
|
|
28
|
-
* background: '#1c1c1c',
|
|
29
|
-
* color: '#fff',
|
|
30
|
-
* }),
|
|
31
|
-
* ]);
|
|
32
|
-
* ```
|
|
33
|
-
*
|
|
34
|
-
* @example
|
|
35
|
-
* 2. using with `sx` prop:
|
|
36
|
-
* ```jsx
|
|
37
|
-
* <Box sx={[
|
|
38
|
-
* { background: '#e5e5e5' },
|
|
39
|
-
* theme => theme.applyStyles('dark', {
|
|
40
|
-
* background: '#1c1c1c',
|
|
41
|
-
* color: '#fff',
|
|
42
|
-
* }),
|
|
43
|
-
* ]}
|
|
44
|
-
* />
|
|
45
|
-
* ```
|
|
46
|
-
*
|
|
47
|
-
* @example
|
|
48
|
-
* 3. theming a component:
|
|
49
|
-
* ```jsx
|
|
50
|
-
* extendTheme({
|
|
51
|
-
* components: {
|
|
52
|
-
* MuiButton: {
|
|
53
|
-
* styleOverrides: {
|
|
54
|
-
* root: ({ theme }) => [
|
|
55
|
-
* { background: '#e5e5e5' },
|
|
56
|
-
* theme.applyStyles('dark', {
|
|
57
|
-
* background: '#1c1c1c',
|
|
58
|
-
* color: '#fff',
|
|
59
|
-
* }),
|
|
60
|
-
* ],
|
|
61
|
-
* },
|
|
62
|
-
* }
|
|
63
|
-
* }
|
|
64
|
-
* })
|
|
65
|
-
*```
|
|
66
|
-
*/
|
|
67
|
-
export default function applyStyles<K extends string>(key: K, styles: CSSObject): CSSObject;
|
|
@@ -1,10 +0,0 @@
|
|
|
1
|
-
export type SpacingOptions = number | string | Spacing | ((abs: number) => number | string) | ((abs: number | string) => number | string) | ReadonlyArray<string | number>;
|
|
2
|
-
export type SpacingArgument = number | string;
|
|
3
|
-
export interface Spacing {
|
|
4
|
-
(): string;
|
|
5
|
-
(value: SpacingArgument): string;
|
|
6
|
-
(topBottom: SpacingArgument, rightLeft: SpacingArgument): string;
|
|
7
|
-
(top: SpacingArgument, rightLeft: SpacingArgument, bottom: SpacingArgument): string;
|
|
8
|
-
(top: SpacingArgument, right: SpacingArgument, bottom: SpacingArgument, left: SpacingArgument): string;
|
|
9
|
-
}
|
|
10
|
-
export default function createSpacing(spacingInput?: SpacingOptions, transform?: Spacing | (() => undefined) | ((abs: number | string) => number | number)): Spacing;
|
|
@@ -1,54 +0,0 @@
|
|
|
1
|
-
import { CSSObject } from '@mui/styled-engine';
|
|
2
|
-
import { Breakpoints, BreakpointsOptions } from "../createBreakpoints/createBreakpoints.js";
|
|
3
|
-
import { Shape, ShapeOptions } from "./shape.js";
|
|
4
|
-
import { Spacing, SpacingOptions } from "./createSpacing.js";
|
|
5
|
-
import { SxConfig, SxProps } from "../styleFunctionSx/index.js";
|
|
6
|
-
import { ApplyStyles } from "./applyStyles.js";
|
|
7
|
-
import { CssContainerQueries } from "../cssContainerQueries/index.js";
|
|
8
|
-
export { Breakpoint, Breakpoints, BreakpointOverrides } from "../createBreakpoints/createBreakpoints.js";
|
|
9
|
-
export type Direction = 'ltr' | 'rtl';
|
|
10
|
-
export interface Typography {}
|
|
11
|
-
export interface Mixins {}
|
|
12
|
-
export interface Shadows {}
|
|
13
|
-
export interface Transitions {}
|
|
14
|
-
export interface ZIndex {}
|
|
15
|
-
export interface ThemeOptions {
|
|
16
|
-
shape?: ShapeOptions;
|
|
17
|
-
breakpoints?: BreakpointsOptions;
|
|
18
|
-
direction?: Direction;
|
|
19
|
-
mixins?: Mixins;
|
|
20
|
-
palette?: Record<string, any>;
|
|
21
|
-
shadows?: Shadows;
|
|
22
|
-
spacing?: SpacingOptions;
|
|
23
|
-
transitions?: Transitions;
|
|
24
|
-
components?: Record<string, any>;
|
|
25
|
-
typography?: Typography;
|
|
26
|
-
zIndex?: ZIndex;
|
|
27
|
-
unstable_sxConfig?: SxConfig;
|
|
28
|
-
}
|
|
29
|
-
export interface Theme extends CssContainerQueries {
|
|
30
|
-
shape: Shape;
|
|
31
|
-
breakpoints: Breakpoints;
|
|
32
|
-
direction: Direction;
|
|
33
|
-
palette: Record<string, any> & {
|
|
34
|
-
mode: 'light' | 'dark';
|
|
35
|
-
};
|
|
36
|
-
shadows?: Shadows;
|
|
37
|
-
spacing: Spacing;
|
|
38
|
-
transitions?: Transitions;
|
|
39
|
-
components?: Record<string, any>;
|
|
40
|
-
mixins?: Mixins;
|
|
41
|
-
typography?: Typography;
|
|
42
|
-
zIndex?: ZIndex;
|
|
43
|
-
applyStyles: ApplyStyles<'light' | 'dark'>;
|
|
44
|
-
unstable_sxConfig: SxConfig;
|
|
45
|
-
unstable_sx: (props: SxProps<Theme>) => CSSObject;
|
|
46
|
-
}
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Generate a theme base on the options received.
|
|
50
|
-
* @param options Takes an incomplete theme object and adds the missing parts.
|
|
51
|
-
* @param args Deep merge the arguments with the about to be returned theme.
|
|
52
|
-
* @returns A complete, ready-to-use theme object.
|
|
53
|
-
*/
|
|
54
|
-
export default function createTheme(options?: ThemeOptions, ...args: object[]): Theme;
|
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { Breakpoints } from "../createBreakpoints/createBreakpoints.js";
|
|
2
|
-
export interface ContainerQueries {
|
|
3
|
-
up: Breakpoints['up'];
|
|
4
|
-
down: Breakpoints['down'];
|
|
5
|
-
between: Breakpoints['between'];
|
|
6
|
-
only: Breakpoints['only'];
|
|
7
|
-
not: Breakpoints['not'];
|
|
8
|
-
}
|
|
9
|
-
export interface CssContainerQueries {
|
|
10
|
-
containerQueries: ((name: string) => ContainerQueries) & ContainerQueries;
|
|
11
|
-
}
|
|
12
|
-
/**
|
|
13
|
-
* For using in `sx` prop to sort the breakpoint from low to high.
|
|
14
|
-
* Note: this function does not work and will not support multiple units.
|
|
15
|
-
* e.g. input: { '@container (min-width:300px)': '1rem', '@container (min-width:40rem)': '2rem' }
|
|
16
|
-
* output: { '@container (min-width:40rem)': '2rem', '@container (min-width:300px)': '1rem' } // since 40 < 300 eventhough 40rem > 300px
|
|
17
|
-
*/
|
|
18
|
-
export declare function sortContainerQueries(theme: Partial<CssContainerQueries>, css: Record<string, any>): Record<string, any>;
|
|
19
|
-
export declare function isCqShorthand(breakpointKeys: string[], value: string): boolean;
|
|
20
|
-
export declare function getContainerQuery(theme: CssContainerQueries, shorthand: string): string | null;
|
|
21
|
-
export default function cssContainerQueries<T extends {
|
|
22
|
-
breakpoints: Breakpoints;
|
|
23
|
-
}>(themeInput: T): T & CssContainerQueries;
|
|
@@ -1,129 +0,0 @@
|
|
|
1
|
-
import * as React from 'react';
|
|
2
|
-
import InitColorSchemeScript from "../InitColorSchemeScript/index.js";
|
|
3
|
-
import { Result } from "./useCurrentColorScheme.js";
|
|
4
|
-
export interface ColorSchemeContextValue<SupportedColorScheme extends string> extends Result<SupportedColorScheme> {
|
|
5
|
-
allColorSchemes: SupportedColorScheme[];
|
|
6
|
-
}
|
|
7
|
-
export interface CssVarsProviderConfig<ColorScheme extends string> {
|
|
8
|
-
/**
|
|
9
|
-
* DOM attribute for applying color scheme
|
|
10
|
-
* @default 'data-color-scheme'
|
|
11
|
-
*/
|
|
12
|
-
attribute?: string;
|
|
13
|
-
/**
|
|
14
|
-
* localStorage key used to store application `mode`
|
|
15
|
-
* @default 'mode'
|
|
16
|
-
*/
|
|
17
|
-
modeStorageKey?: string;
|
|
18
|
-
/**
|
|
19
|
-
* localStorage key used to store `colorScheme`
|
|
20
|
-
* @default 'color-scheme'
|
|
21
|
-
*/
|
|
22
|
-
colorSchemeStorageKey?: string;
|
|
23
|
-
/**
|
|
24
|
-
* Design system default color scheme.
|
|
25
|
-
* - provides string if the design system has one default color scheme (either light or dark)
|
|
26
|
-
* - provides object if the design system has default light & dark color schemes
|
|
27
|
-
*/
|
|
28
|
-
defaultColorScheme: ColorScheme | {
|
|
29
|
-
light: ColorScheme;
|
|
30
|
-
dark: ColorScheme;
|
|
31
|
-
};
|
|
32
|
-
/**
|
|
33
|
-
* Disable CSS transitions when switching between modes or color schemes
|
|
34
|
-
* @default false
|
|
35
|
-
*/
|
|
36
|
-
disableTransitionOnChange?: boolean;
|
|
37
|
-
}
|
|
38
|
-
type Identify<I extends string | undefined, T> = I extends string ? T | { [k in I]: T } : T;
|
|
39
|
-
export interface CreateCssVarsProviderResult<ColorScheme extends string, Identifier extends string | undefined = undefined> {
|
|
40
|
-
CssVarsProvider: (props: React.PropsWithChildren<Partial<CssVarsProviderConfig<ColorScheme>> & {
|
|
41
|
-
theme?: Identify<Identifier, {
|
|
42
|
-
cssVariables?: false;
|
|
43
|
-
cssVarPrefix?: string;
|
|
44
|
-
colorSchemes: Partial<Record<ColorScheme, any>>;
|
|
45
|
-
colorSchemeSelector?: 'media' | 'class' | 'data' | string;
|
|
46
|
-
}>;
|
|
47
|
-
/**
|
|
48
|
-
* The default mode when the storage is empty,
|
|
49
|
-
* require the theme to have `colorSchemes` with light and dark.
|
|
50
|
-
* @default 'system'
|
|
51
|
-
*/
|
|
52
|
-
defaultMode?: 'light' | 'dark' | 'system';
|
|
53
|
-
/**
|
|
54
|
-
* The document used to perform `disableTransitionOnChange` feature
|
|
55
|
-
* @default document
|
|
56
|
-
*/
|
|
57
|
-
documentNode?: Document | null;
|
|
58
|
-
/**
|
|
59
|
-
* The node used to attach the color-scheme attribute
|
|
60
|
-
* @default document
|
|
61
|
-
*/
|
|
62
|
-
colorSchemeNode?: Element | null;
|
|
63
|
-
/**
|
|
64
|
-
* The window that attaches the 'storage' event listener
|
|
65
|
-
* @default window
|
|
66
|
-
*/
|
|
67
|
-
storageWindow?: Window | null;
|
|
68
|
-
/**
|
|
69
|
-
* If `true`, the provider creates its own context and generate stylesheet as if it is a root `CssVarsProvider`.
|
|
70
|
-
*/
|
|
71
|
-
disableNestedContext?: boolean;
|
|
72
|
-
/**
|
|
73
|
-
* If `true`, the style sheet won't be generated.
|
|
74
|
-
*
|
|
75
|
-
* This is useful for controlling nested CssVarsProvider behavior.
|
|
76
|
-
* @default false
|
|
77
|
-
*/
|
|
78
|
-
disableStyleSheetGeneration?: boolean;
|
|
79
|
-
}>) => React.JSX.Element;
|
|
80
|
-
useColorScheme: () => ColorSchemeContextValue<ColorScheme>;
|
|
81
|
-
getInitColorSchemeScript: typeof InitColorSchemeScript;
|
|
82
|
-
}
|
|
83
|
-
export default function createCssVarsProvider<ColorScheme extends string, Identifier extends string | undefined = undefined>(options: CssVarsProviderConfig<ColorScheme> & {
|
|
84
|
-
/**
|
|
85
|
-
* The design system's unique id for getting the corresponded theme when there are multiple design systems.
|
|
86
|
-
*/
|
|
87
|
-
themeId?: Identifier;
|
|
88
|
-
/**
|
|
89
|
-
* Design system default theme
|
|
90
|
-
*
|
|
91
|
-
* - The structure inside `theme.colorSchemes[colorScheme]` should be exactly the same in all color schemes because
|
|
92
|
-
* those object of the color scheme will be used when the color scheme is active.
|
|
93
|
-
*
|
|
94
|
-
* {
|
|
95
|
-
* colorSchemes: {
|
|
96
|
-
* light: { ...lightColorSchemeValues },
|
|
97
|
-
* dark: { ...darkColorSchemeValues }
|
|
98
|
-
* }
|
|
99
|
-
* }
|
|
100
|
-
*
|
|
101
|
-
* - If colorScheme is 'light', the `lightColorSchemeValues` will be merged to theme as `{ ...theme, ...lightColorSchemeValues }`
|
|
102
|
-
* likewise, if colorScheme is 'dark', the `darkColorSchemeValues` will be merged to theme as `{ ...theme, ...darkColorSchemeValues }`
|
|
103
|
-
*
|
|
104
|
-
* - If the theme contains the same keys as the color scheme, their values will be merged.
|
|
105
|
-
* Ex. {
|
|
106
|
-
* colorSchemes: {
|
|
107
|
-
* light: { palette: { primary: { ... } } },
|
|
108
|
-
* dark: { palette: { primary: { ...} } }
|
|
109
|
-
* },
|
|
110
|
-
* palette: { shared: { ... } }
|
|
111
|
-
* }
|
|
112
|
-
*
|
|
113
|
-
* becomes: {
|
|
114
|
-
* colorSchemes: { ... },
|
|
115
|
-
* palette: { shared: { ... }, primary: { ... } }
|
|
116
|
-
* }
|
|
117
|
-
*/
|
|
118
|
-
theme: any;
|
|
119
|
-
/**
|
|
120
|
-
* A function to be called after the CSS variables are attached. The result of this function will be the final theme pass to ThemeProvider.
|
|
121
|
-
*
|
|
122
|
-
* The example usage is the variant generation in Joy. We need to combine the token from user-input and the default theme first, then generate
|
|
123
|
-
* variants from those tokens.
|
|
124
|
-
*/
|
|
125
|
-
resolveTheme?: (theme: any) => any; // the type is any because it depends on the design system.
|
|
126
|
-
}): CreateCssVarsProviderResult<ColorScheme, Identifier>;
|
|
127
|
-
|
|
128
|
-
// disable automatic export
|
|
129
|
-
export {};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
import { DefaultCssVarsTheme } from "./prepareCssVars.js";
|
|
2
|
-
interface Theme extends DefaultCssVarsTheme {
|
|
3
|
-
cssVarPrefix?: string;
|
|
4
|
-
colorSchemeSelector?: 'media' | string;
|
|
5
|
-
shouldSkipGeneratingVar?: (objectPathKeys: Array<string>, value: string | number) => boolean;
|
|
6
|
-
}
|
|
7
|
-
declare function createCssVarsTheme<T extends Theme, ThemeVars extends Record<string, any>>({
|
|
8
|
-
colorSchemeSelector,
|
|
9
|
-
...theme
|
|
10
|
-
}: T): T & {
|
|
11
|
-
vars: ThemeVars;
|
|
12
|
-
generateThemeVars: () => ThemeVars;
|
|
13
|
-
generateStyleSheets: () => Record<string, any>[];
|
|
14
|
-
};
|
|
15
|
-
export default createCssVarsTheme;
|
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* The benefit of this function is to help developers get CSS var from theme without specifying the whole variable
|
|
3
|
-
* and they does not need to remember the prefix (defined once).
|
|
4
|
-
*/
|
|
5
|
-
export default function createGetCssVar<T extends string = string>(prefix?: string): <AdditionalVars extends string = never>(field: T | AdditionalVars, ...fallbacks: (T | AdditionalVars)[]) => string;
|
|
@@ -1,64 +0,0 @@
|
|
|
1
|
-
type NestedRecord<V = any> = {
|
|
2
|
-
[k: string | number]: NestedRecord<V> | V;
|
|
3
|
-
};
|
|
4
|
-
/**
|
|
5
|
-
* This function create an object from keys, value and then assign to target
|
|
6
|
-
*
|
|
7
|
-
* @param {Object} obj : the target object to be assigned
|
|
8
|
-
* @param {string[]} keys
|
|
9
|
-
* @param {string | number} value
|
|
10
|
-
*
|
|
11
|
-
* @example
|
|
12
|
-
* const source = {}
|
|
13
|
-
* assignNestedKeys(source, ['palette', 'primary'], 'var(--palette-primary)')
|
|
14
|
-
* console.log(source) // { palette: { primary: 'var(--palette-primary)' } }
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* const source = { palette: { primary: 'var(--palette-primary)' } }
|
|
18
|
-
* assignNestedKeys(source, ['palette', 'secondary'], 'var(--palette-secondary)')
|
|
19
|
-
* console.log(source) // { palette: { primary: 'var(--palette-primary)', secondary: 'var(--palette-secondary)' } }
|
|
20
|
-
*/
|
|
21
|
-
export declare const assignNestedKeys: <T extends Record<string, any> | null | undefined | string = NestedRecord<any>, Value = any>(obj: T, keys: Array<string>, value: Value, arrayKeys?: Array<string>) => void;
|
|
22
|
-
/**
|
|
23
|
-
*
|
|
24
|
-
* @param {Object} obj : source object
|
|
25
|
-
* @param {Function} callback : a function that will be called when
|
|
26
|
-
* - the deepest key in source object is reached
|
|
27
|
-
* - the value of the deepest key is NOT `undefined` | `null`
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* walkObjectDeep({ palette: { primary: { main: '#000000' } } }, console.log)
|
|
31
|
-
* // ['palette', 'primary', 'main'] '#000000'
|
|
32
|
-
*/
|
|
33
|
-
export declare const walkObjectDeep: <Value, T = Record<string, any>>(obj: T, callback: (keys: Array<string>, value: Value, arrayKeys: Array<string>) => void, shouldSkipPaths?: (keys: Array<string>) => boolean) => void;
|
|
34
|
-
/**
|
|
35
|
-
* a function that parse theme and return { css, vars }
|
|
36
|
-
*
|
|
37
|
-
* @param {Object} theme
|
|
38
|
-
* @param {{
|
|
39
|
-
* prefix?: string,
|
|
40
|
-
* shouldSkipGeneratingVar?: (objectPathKeys: Array<string>, value: string | number) => boolean
|
|
41
|
-
* }} options.
|
|
42
|
-
* `prefix`: The prefix of the generated CSS variables. This function does not change the value.
|
|
43
|
-
*
|
|
44
|
-
* @returns {{ css: Object, vars: Object }} `css` is the stylesheet, `vars` is an object to get css variable (same structure as theme).
|
|
45
|
-
*
|
|
46
|
-
* @example
|
|
47
|
-
* const { css, vars } = parser({
|
|
48
|
-
* fontSize: 12,
|
|
49
|
-
* lineHeight: 1.2,
|
|
50
|
-
* palette: { primary: { 500: 'var(--color)' } }
|
|
51
|
-
* }, { prefix: 'foo' })
|
|
52
|
-
*
|
|
53
|
-
* console.log(css) // { '--foo-fontSize': '12px', '--foo-lineHeight': 1.2, '--foo-palette-primary-500': 'var(--color)' }
|
|
54
|
-
* console.log(vars) // { fontSize: 'var(--foo-fontSize)', lineHeight: 'var(--foo-lineHeight)', palette: { primary: { 500: 'var(--foo-palette-primary-500)' } } }
|
|
55
|
-
*/
|
|
56
|
-
export default function cssVarsParser<T extends Record<string, any>>(theme: Record<string, any>, options?: {
|
|
57
|
-
prefix?: string;
|
|
58
|
-
shouldSkipGeneratingVar?: (objectPathKeys: Array<string>, value: string | number) => boolean;
|
|
59
|
-
}): {
|
|
60
|
-
css: Record<string, string | number>;
|
|
61
|
-
vars: T;
|
|
62
|
-
varsWithDefaults: {};
|
|
63
|
-
};
|
|
64
|
-
export {};
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
export declare function createGetColorSchemeSelector<T extends string>(selector: 'media' | 'class' | 'data' | string): (colorScheme: T) => string;
|