worked on GarageApp stuff
This commit is contained in:
parent
60aaf17af3
commit
eb606572b0
51919 changed files with 2168177 additions and 18 deletions
42
node_modules/@mui/material/styles/useThemeProps.d.ts
generated
vendored
Normal file
42
node_modules/@mui/material/styles/useThemeProps.d.ts
generated
vendored
Normal file
|
|
@ -0,0 +1,42 @@
|
|||
import { Theme } from "./createTheme.js";
|
||||
import { Components } from "./components.js";
|
||||
export interface ThemeWithProps {
|
||||
components?: Components<Omit<Theme, 'components'>>;
|
||||
}
|
||||
export type ThemedProps<Theme, Name extends keyof any> = Theme extends {
|
||||
components: Record<Name, {
|
||||
defaultProps: infer Props;
|
||||
}>;
|
||||
} ? Props : {};
|
||||
|
||||
/**
|
||||
* Merges input `props` with the `defaultProps` for a component that were defined in the theme.
|
||||
*
|
||||
* The `defaultProps` are defined in the theme under `theme.components[componentName].defaultProps`.
|
||||
*
|
||||
* @example
|
||||
*
|
||||
* ```tsx
|
||||
* const createTheme = () => ({
|
||||
* components: {
|
||||
* MuiStat: {
|
||||
* defaultProps: {
|
||||
* variant: 'outlined',
|
||||
* },
|
||||
* },
|
||||
* },
|
||||
* });
|
||||
*
|
||||
* function Stat(props) {
|
||||
* const themeProps = useThemeProps({ props, name: 'MuiStat' });
|
||||
* return <div {...themeProps} />;
|
||||
* }
|
||||
* ```
|
||||
*
|
||||
* @param params.props The input props
|
||||
* @param params.name The name of the component as defined in the theme
|
||||
*/
|
||||
export default function useThemeProps<Theme extends ThemeWithProps, Props, Name extends keyof any>(params: {
|
||||
props: Props;
|
||||
name: Name;
|
||||
}): Props & ThemedProps<Theme, Name>;
|
||||
Loading…
Add table
Add a link
Reference in a new issue