@mui/system 7.0.2 → 7.1.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.
Files changed (162) hide show
  1. package/Box/Box.d.ts +12 -31
  2. package/CHANGELOG.md +97 -0
  3. package/Grid/createGrid.js +1 -2
  4. package/InitColorSchemeScript/InitColorSchemeScript.js +1 -1
  5. package/Stack/createStack.js +1 -2
  6. package/borders/borders.d.ts +2 -1
  7. package/breakpoints/breakpoints.d.ts +1 -1
  8. package/compose/compose.d.ts +14 -1
  9. package/compose/index.d.ts +1 -1
  10. package/cssGrid/cssGrid.d.ts +2 -1
  11. package/display/display.d.ts +2 -1
  12. package/esm/Box/Box.d.ts +12 -31
  13. package/esm/Grid/createGrid.js +1 -2
  14. package/esm/InitColorSchemeScript/InitColorSchemeScript.js +1 -1
  15. package/esm/Stack/createStack.js +1 -2
  16. package/esm/borders/borders.d.ts +2 -1
  17. package/esm/breakpoints/breakpoints.d.ts +1 -1
  18. package/esm/compose/compose.d.ts +14 -1
  19. package/esm/compose/index.d.ts +1 -1
  20. package/esm/cssGrid/cssGrid.d.ts +2 -1
  21. package/esm/display/display.d.ts +2 -1
  22. package/esm/flexbox/flexbox.d.ts +15 -1
  23. package/esm/index.d.ts +10 -0
  24. package/esm/index.js +1 -1
  25. package/esm/palette/palette.d.ts +2 -1
  26. package/esm/positions/positions.d.ts +2 -1
  27. package/esm/shadows/shadows.d.ts +2 -1
  28. package/esm/sizing/sizing.d.ts +2 -1
  29. package/esm/spacing/spacing.d.ts +2 -1
  30. package/esm/style/style.d.ts +5 -1
  31. package/esm/styleFunctionSx/defaultSxConfig.d.ts +1 -2
  32. package/esm/typography/typography.d.ts +2 -1
  33. package/esm/useMediaQuery/useMediaQuery.js +3 -0
  34. package/esm/version/index.js +3 -3
  35. package/flexbox/flexbox.d.ts +15 -1
  36. package/index.d.ts +10 -0
  37. package/index.js +1 -1
  38. package/package.json +7 -7
  39. package/palette/palette.d.ts +2 -1
  40. package/positions/positions.d.ts +2 -1
  41. package/shadows/shadows.d.ts +2 -1
  42. package/sizing/sizing.d.ts +2 -1
  43. package/spacing/spacing.d.ts +2 -1
  44. package/style/style.d.ts +5 -1
  45. package/styleFunctionSx/defaultSxConfig.d.ts +1 -2
  46. package/typography/typography.d.ts +2 -1
  47. package/useMediaQuery/useMediaQuery.js +3 -0
  48. package/version/index.js +3 -3
  49. package/modern/Box/Box.d.ts +0 -72
  50. package/modern/Box/boxClasses.d.ts +0 -7
  51. package/modern/Box/index.d.ts +0 -4
  52. package/modern/CSSProperties.d.ts +0 -7
  53. package/modern/Container/Container.d.ts +0 -13
  54. package/modern/Container/ContainerProps.d.ts +0 -40
  55. package/modern/Container/containerClasses.d.ts +0 -22
  56. package/modern/Container/createContainer.d.ts +0 -18
  57. package/modern/Container/index.d.ts +0 -4
  58. package/modern/DefaultPropsProvider/DefaultPropsProvider.d.ts +0 -18
  59. package/modern/DefaultPropsProvider/index.d.ts +0 -1
  60. package/modern/GlobalStyles/GlobalStyles.d.ts +0 -17
  61. package/modern/GlobalStyles/index.d.ts +0 -2
  62. package/modern/Grid/Grid.d.ts +0 -13
  63. package/modern/Grid/GridProps.d.ts +0 -103
  64. package/modern/Grid/createGrid.d.ts +0 -13
  65. package/modern/Grid/deleteLegacyGridProps.d.ts +0 -11
  66. package/modern/Grid/gridClasses.d.ts +0 -20
  67. package/modern/Grid/gridGenerator.d.ts +0 -42
  68. package/modern/Grid/index.d.ts +0 -7
  69. package/modern/Grid/traverseBreakpoints.d.ts +0 -7
  70. package/modern/InitColorSchemeScript/InitColorSchemeScript.d.ts +0 -51
  71. package/modern/InitColorSchemeScript/index.d.ts +0 -2
  72. package/modern/RtlProvider/index.d.ts +0 -8
  73. package/modern/Stack/Stack.d.ts +0 -14
  74. package/modern/Stack/StackProps.d.ts +0 -53
  75. package/modern/Stack/createStack.d.ts +0 -24
  76. package/modern/Stack/index.d.ts +0 -5
  77. package/modern/Stack/stackClasses.d.ts +0 -8
  78. package/modern/ThemeProvider/ThemeProvider.d.ts +0 -24
  79. package/modern/ThemeProvider/index.d.ts +0 -2
  80. package/modern/borders/borders.d.ts +0 -14
  81. package/modern/borders/index.d.ts +0 -2
  82. package/modern/breakpoints/breakpoints.d.ts +0 -19
  83. package/modern/breakpoints/index.d.ts +0 -2
  84. package/modern/colorManipulator/colorManipulator.d.ts +0 -25
  85. package/modern/colorManipulator/index.d.ts +0 -1
  86. package/modern/compose/compose.d.ts +0 -2
  87. package/modern/compose/index.d.ts +0 -1
  88. package/modern/createBox/createBox.d.ts +0 -9
  89. package/modern/createBox/index.d.ts +0 -1
  90. package/modern/createBreakpoints/createBreakpoints.d.ts +0 -78
  91. package/modern/createBreakpoints/index.d.ts +0 -3
  92. package/modern/createStyled/createStyled.d.ts +0 -27
  93. package/modern/createStyled/index.d.ts +0 -2
  94. package/modern/createTheme/applyStyles.d.ts +0 -67
  95. package/modern/createTheme/createSpacing.d.ts +0 -10
  96. package/modern/createTheme/createTheme.d.ts +0 -54
  97. package/modern/createTheme/index.d.ts +0 -4
  98. package/modern/createTheme/shape.d.ts +0 -6
  99. package/modern/cssContainerQueries/cssContainerQueries.d.ts +0 -23
  100. package/modern/cssContainerQueries/index.d.ts +0 -3
  101. package/modern/cssGrid/cssGrid.d.ts +0 -15
  102. package/modern/cssGrid/index.d.ts +0 -2
  103. package/modern/cssVars/createCssVarsProvider.d.ts +0 -141
  104. package/modern/cssVars/createCssVarsTheme.d.ts +0 -15
  105. package/modern/cssVars/createGetCssVar.d.ts +0 -5
  106. package/modern/cssVars/cssVarsParser.d.ts +0 -64
  107. package/modern/cssVars/getColorSchemeSelector.d.ts +0 -1
  108. package/modern/cssVars/index.d.ts +0 -8
  109. package/modern/cssVars/localStorageManager.d.ts +0 -34
  110. package/modern/cssVars/prepareCssVars.d.ts +0 -16
  111. package/modern/cssVars/prepareTypographyVars.d.ts +0 -4
  112. package/modern/cssVars/useCurrentColorScheme.d.ts +0 -56
  113. package/modern/display/display.d.ts +0 -3
  114. package/modern/display/index.d.ts +0 -2
  115. package/modern/flexbox/flexbox.d.ts +0 -3
  116. package/modern/flexbox/index.d.ts +0 -2
  117. package/modern/getThemeValue/getThemeValue.d.ts +0 -1
  118. package/modern/getThemeValue/index.d.ts +0 -2
  119. package/modern/index.d.ts +0 -80
  120. package/modern/memoTheme.d.ts +0 -12
  121. package/modern/memoize/index.d.ts +0 -1
  122. package/modern/memoize/memoize.d.ts +0 -1
  123. package/modern/merge/index.d.ts +0 -1
  124. package/modern/merge/merge.d.ts +0 -1
  125. package/modern/palette/index.d.ts +0 -2
  126. package/modern/palette/palette.d.ts +0 -5
  127. package/modern/positions/index.d.ts +0 -2
  128. package/modern/positions/positions.d.ts +0 -3
  129. package/modern/preprocessStyles.d.ts +0 -5
  130. package/modern/propsToClassKey/index.d.ts +0 -1
  131. package/modern/propsToClassKey/propsToClassKey.d.ts +0 -1
  132. package/modern/responsivePropType/index.d.ts +0 -1
  133. package/modern/responsivePropType/responsivePropType.d.ts +0 -2
  134. package/modern/shadows/index.d.ts +0 -1
  135. package/modern/shadows/shadows.d.ts +0 -3
  136. package/modern/sizing/index.d.ts +0 -2
  137. package/modern/sizing/sizing.d.ts +0 -12
  138. package/modern/spacing/index.d.ts +0 -2
  139. package/modern/spacing/spacing.d.ts +0 -19
  140. package/modern/style/index.d.ts +0 -2
  141. package/modern/style/style.d.ts +0 -19
  142. package/modern/styleFunctionSx/AliasesCSSProperties.d.ts +0 -269
  143. package/modern/styleFunctionSx/OverwriteCSSProperties.d.ts +0 -54
  144. package/modern/styleFunctionSx/StandardCssProperties.d.ts +0 -2
  145. package/modern/styleFunctionSx/defaultSxConfig.d.ts +0 -15
  146. package/modern/styleFunctionSx/extendSxProp.d.ts +0 -4
  147. package/modern/styleFunctionSx/index.d.ts +0 -9
  148. package/modern/styleFunctionSx/styleFunctionSx.d.ts +0 -62
  149. package/modern/styled/index.d.ts +0 -1
  150. package/modern/styled/styled.d.ts +0 -3
  151. package/modern/typography/index.d.ts +0 -2
  152. package/modern/typography/typography.d.ts +0 -12
  153. package/modern/useMediaQuery/index.d.ts +0 -2
  154. package/modern/useMediaQuery/useMediaQuery.d.ts +0 -32
  155. package/modern/useTheme/index.d.ts +0 -2
  156. package/modern/useTheme/useTheme.d.ts +0 -2
  157. package/modern/useThemeProps/getThemeProps.d.ts +0 -11
  158. package/modern/useThemeProps/index.d.ts +0 -3
  159. package/modern/useThemeProps/useThemeProps.d.ts +0 -14
  160. package/modern/useThemeWithoutDefault/index.d.ts +0 -1
  161. package/modern/useThemeWithoutDefault/useThemeWithoutDefault.d.ts +0 -1
  162. package/modern/version/index.d.ts +0 -6
@@ -1,42 +0,0 @@
1
- import { Breakpoints } from "../createBreakpoints/createBreakpoints.js";
2
- import { Spacing } from "../createTheme/createSpacing.js";
3
- import { ResponsiveStyleValue } from "../styleFunctionSx/index.js";
4
- import { GridDirection, GridOwnerState } from "./GridProps.js";
5
- interface Props {
6
- theme: {
7
- breakpoints: Breakpoints;
8
- spacing?: Spacing;
9
- };
10
- ownerState: GridOwnerState;
11
- }
12
- export declare const generateGridSizeStyles: ({
13
- theme,
14
- ownerState
15
- }: Props) => {};
16
- export declare const generateGridOffsetStyles: ({
17
- theme,
18
- ownerState
19
- }: Props) => {};
20
- export declare const generateGridColumnsStyles: ({
21
- theme,
22
- ownerState
23
- }: Props) => {};
24
- export declare const generateGridRowSpacingStyles: ({
25
- theme,
26
- ownerState
27
- }: Props) => {};
28
- export declare const generateGridColumnSpacingStyles: ({
29
- theme,
30
- ownerState
31
- }: Props) => {};
32
- export declare const generateGridDirectionStyles: ({
33
- theme,
34
- ownerState
35
- }: Props) => {};
36
- export declare const generateGridStyles: ({
37
- ownerState
38
- }: Props) => {};
39
- export declare const generateSizeClassNames: (size: GridOwnerState["size"]) => string[];
40
- export declare const generateSpacingClassNames: (spacing: GridOwnerState["spacing"], smallestBreakpoint?: string) => string[];
41
- export declare const generateDirectionClasses: (direction: ResponsiveStyleValue<GridDirection> | undefined) => string[];
42
- export {};
@@ -1,7 +0,0 @@
1
- export { default } from "./Grid.js";
2
- export { default as createGrid } from "./createGrid.js";
3
- export * from "./GridProps.js";
4
- export { default as gridClasses } from "./gridClasses.js";
5
- export * from "./gridClasses.js";
6
- export { traverseBreakpoints as unstable_traverseBreakpoints } from "./traverseBreakpoints.js";
7
- export { generateDirectionClasses as unstable_generateDirectionClasses, generateSizeClassNames as unstable_generateSizeClassNames, generateSpacingClassNames as unstable_generateSpacingClassNames } from "./gridGenerator.js";
@@ -1,7 +0,0 @@
1
- import { Breakpoints, Breakpoint } from "../createBreakpoints/createBreakpoints.js";
2
- export declare const filterBreakpointKeys: (breakpointsKeys: Breakpoint[], responsiveKeys: string[]) => Breakpoint[];
3
- interface Iterator<T> {
4
- (appendStyle: (responsiveStyles: Record<string, any>, style: object) => void, value: T): void;
5
- }
6
- export declare const traverseBreakpoints: <T = unknown>(breakpoints: Breakpoints, responsive: T | T[] | Record<string, any> | undefined, iterator: Iterator<T>) => void;
7
- export {};
@@ -1,51 +0,0 @@
1
- /**
2
- * Split this component for RSC import
3
- */
4
- import * as React from 'react';
5
- export declare const DEFAULT_MODE_STORAGE_KEY = "mode";
6
- export declare const DEFAULT_COLOR_SCHEME_STORAGE_KEY = "color-scheme";
7
- export declare const DEFAULT_ATTRIBUTE = "data-color-scheme";
8
- export interface InitColorSchemeScriptProps {
9
- /**
10
- * The default mode when the storage is empty (user's first visit).
11
- * @default 'system'
12
- */
13
- defaultMode?: 'system' | 'light' | 'dark';
14
- /**
15
- * The default color scheme to be used on the light mode.
16
- * @default 'light'
17
- */
18
- defaultLightColorScheme?: string;
19
- /**
20
- * The default color scheme to be used on the dark mode.
21
- * * @default 'dark'
22
- */
23
- defaultDarkColorScheme?: string;
24
- /**
25
- * The node (provided as string) used to attach the color-scheme attribute.
26
- * @default 'document.documentElement'
27
- */
28
- colorSchemeNode?: string;
29
- /**
30
- * localStorage key used to store `mode`.
31
- * @default 'mode'
32
- */
33
- modeStorageKey?: string;
34
- /**
35
- * localStorage key used to store `colorScheme`.
36
- * @default 'color-scheme'
37
- */
38
- colorSchemeStorageKey?: string;
39
- /**
40
- * DOM attribute for applying color scheme.
41
- * @default 'data-color-scheme'
42
- * @example '.mode-%s' // for class based color scheme
43
- * @example '[data-mode-%s]' // for data-attribute without '='
44
- */
45
- attribute?: 'class' | 'data' | string;
46
- /**
47
- * Nonce string to pass to the inline script for CSP headers.
48
- */
49
- nonce?: string | undefined;
50
- }
51
- export default function InitColorSchemeScript(options?: InitColorSchemeScriptProps): React.JSX.Element;
@@ -1,2 +0,0 @@
1
- export { default } from "./InitColorSchemeScript.js";
2
- export type { InitColorSchemeScriptProps } from "./InitColorSchemeScript.js";
@@ -1,8 +0,0 @@
1
- import * as React from 'react';
2
- interface RtlProviderProps {
3
- children?: React.ReactNode;
4
- value?: boolean;
5
- }
6
- declare const RtlProvider: React.FC<RtlProviderProps>;
7
- export const useRtl: () => boolean;
8
- export default RtlProvider;
@@ -1,14 +0,0 @@
1
- /**
2
- *
3
- * Demos:
4
- *
5
- * - [Stack (Joy UI)](https://mui.com/joy-ui/react-stack/)
6
- * - [Stack (Material UI)](https://mui.com/material-ui/react-stack/)
7
- * - [Stack (MUI System)](https://mui.com/system/react-stack/)
8
- *
9
- * API:
10
- *
11
- * - [Stack API](https://mui.com/system/api/stack/)
12
- */
13
- declare const Stack: import("@mui/types").OverridableComponent<import("./StackProps.js").StackTypeMap<{}, "div">>;
14
- export default Stack;
@@ -1,53 +0,0 @@
1
- import * as React from 'react';
2
- import { OverrideProps } from '@mui/types';
3
- import { ResponsiveStyleValue, SxProps } from "../styleFunctionSx/index.js";
4
- import { SystemProps } from "../Box/index.js";
5
- import { Theme } from "../createTheme/index.js";
6
- export interface StackBaseProps {
7
- /**
8
- * The content of the component.
9
- */
10
- children?: React.ReactNode;
11
- /**
12
- * Defines the `flex-direction` style property.
13
- * It is applied for all screen sizes.
14
- * @default 'column'
15
- */
16
- direction?: ResponsiveStyleValue<'row' | 'row-reverse' | 'column' | 'column-reverse'>;
17
- /**
18
- * Defines the space between immediate children.
19
- * @default 0
20
- */
21
- spacing?: ResponsiveStyleValue<number | string>;
22
- /**
23
- * Add an element between each child.
24
- */
25
- divider?: React.ReactNode;
26
- /**
27
- * If `true`, the CSS flexbox `gap` is used instead of applying `margin` to children.
28
- *
29
- * While CSS `gap` removes the [known limitations](https://mui.com/joy-ui/react-stack/#limitations),
30
- * it is not fully supported in some browsers. We recommend checking https://caniuse.com/?search=flex%20gap before using this flag.
31
- *
32
- * To enable this flag globally, follow the theme's default props configuration.
33
- * @default false
34
- */
35
- useFlexGap?: boolean;
36
- }
37
- export interface StackTypeMap<AdditionalProps = {}, DefaultComponent extends React.ElementType = 'div'> {
38
- props: AdditionalProps & StackBaseProps & {
39
- /**
40
- * The system prop, which allows defining system overrides as well as additional CSS styles.
41
- */
42
- sx?: SxProps<Theme>;
43
- } & SystemProps<Theme>;
44
- defaultComponent: DefaultComponent;
45
- }
46
- export type StackProps<RootComponent extends React.ElementType = StackTypeMap['defaultComponent'], AdditionalProps = {
47
- component?: React.ElementType;
48
- }> = OverrideProps<StackTypeMap<AdditionalProps, RootComponent>, RootComponent>;
49
- export interface StackOwnerState {
50
- direction: StackProps['direction'];
51
- spacing: StackProps['spacing'];
52
- useFlexGap: boolean;
53
- }
@@ -1,24 +0,0 @@
1
- import * as React from 'react';
2
- import { OverridableComponent } from '@mui/types';
3
- import { StackTypeMap, StackOwnerState } from "./StackProps.js";
4
- import { Breakpoints } from "../createBreakpoints/createBreakpoints.js";
5
- import { Spacing } from "../createTheme/createSpacing.js";
6
- interface StyleFunctionProps {
7
- theme: {
8
- breakpoints: Breakpoints;
9
- spacing: Spacing;
10
- };
11
- ownerState: StackOwnerState;
12
- }
13
- declare const defaultCreateStyledComponent: import("@mui/styled-engine").CreateStyledComponent<import("../createStyled/index.js").MUIStyledCommonProps<any>, Pick<React.DetailedHTMLProps<React.HTMLAttributes<HTMLDivElement>, HTMLDivElement>, keyof React.ClassAttributes<HTMLDivElement> | keyof React.HTMLAttributes<HTMLDivElement>>, {}, any>;
14
- declare function useThemePropsDefault<T extends {}>(props: T): T;
15
- export declare const style: ({
16
- ownerState,
17
- theme
18
- }: StyleFunctionProps) => any;
19
- export default function createStack(options?: {
20
- createStyledComponent?: typeof defaultCreateStyledComponent;
21
- useThemeProps?: typeof useThemePropsDefault;
22
- componentName?: string;
23
- }): OverridableComponent<StackTypeMap<{}, "div">>;
24
- export {};
@@ -1,5 +0,0 @@
1
- export { default } from "./Stack.js";
2
- export { default as createStack } from "./createStack.js";
3
- export * from "./StackProps.js";
4
- export { default as stackClasses } from "./stackClasses.js";
5
- export * from "./stackClasses.js";
@@ -1,8 +0,0 @@
1
- export interface StackClasses {
2
- /** Styles applied to the root element. */
3
- root: string;
4
- }
5
- export type StackClassKey = keyof StackClasses;
6
- export declare function getStackUtilityClass(slot: string): string;
7
- declare const stackClasses: StackClasses;
8
- export default stackClasses;
@@ -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,2 +0,0 @@
1
- export { default } from "./ThemeProvider.js";
2
- export * from "./ThemeProvider.js";
@@ -1,14 +0,0 @@
1
- import { PropsFor, borders, SimpleStyleFunction } 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>;
14
- export default borders;
@@ -1,2 +0,0 @@
1
- export { default } from "./borders.js";
2
- export * from "./borders.js";
@@ -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,2 +0,0 @@
1
- export { default } from "./breakpoints.js";
2
- export * from "./breakpoints.js";
@@ -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,2 +0,0 @@
1
- import { ComposedStyleFunction, StyleFunction } from "../Box/index.js";
2
- export default function compose<T extends Array<StyleFunction<any>>>(...args: T): ComposedStyleFunction<T>;
@@ -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://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://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://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://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,3 +0,0 @@
1
- /** This export is intended for internal integration with Pigment CSS */
2
- /* eslint-disable import/prefer-default-export */
3
- export { default as unstable_createBreakpoints } from "./createBreakpoints.js";
@@ -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,2 +0,0 @@
1
- export { default } from "./createStyled.js";
2
- export * from "./createStyled.js";
@@ -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,4 +0,0 @@
1
- export { default } from "./createTheme.js";
2
- export * from "./createTheme.js";
3
- export { default as unstable_applyStyles } from "./applyStyles.js";
4
- export * from "./applyStyles.js";
@@ -1,6 +0,0 @@
1
- export interface Shape {
2
- borderRadius: number;
3
- }
4
- export type ShapeOptions = Partial<Shape>;
5
- declare const shape: Shape;
6
- export default shape;