Spaces:
Sleeping
Sleeping
File size: 1,935 Bytes
56fda74 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 |
'use client';
import * as React from 'react';
import PropTypes from 'prop-types';
import resolveProps from '@mui/utils/resolveProps';
import { jsx as _jsx } from "react/jsx-runtime";
const PropsContext = /*#__PURE__*/React.createContext(undefined);
function DefaultPropsProvider({
value,
children
}) {
return /*#__PURE__*/_jsx(PropsContext.Provider, {
value: value,
children: children
});
}
process.env.NODE_ENV !== "production" ? DefaultPropsProvider.propTypes /* remove-proptypes */ = {
// βββββββββββββββββββββββββββββββ Warning βββββββββββββββββββββββββββββββ
// β These PropTypes are generated from the TypeScript type definitions. β
// β To update them, edit the TypeScript types and run `pnpm proptypes`. β
// βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
/**
* @ignore
*/
children: PropTypes.node,
/**
* @ignore
*/
value: PropTypes.object
} : void 0;
function getThemeProps(params) {
const {
theme,
name,
props
} = params;
if (!theme || !theme.components || !theme.components[name]) {
return props;
}
const config = theme.components[name];
if (config.defaultProps) {
// compatible with v5 signature
return resolveProps(config.defaultProps, props);
}
if (!config.styleOverrides && !config.variants) {
// v6 signature, no property 'defaultProps'
return resolveProps(config, props);
}
return props;
}
export function useDefaultProps({
props,
name
}) {
const ctx = React.useContext(PropsContext);
return getThemeProps({
props,
name,
theme: {
components: ctx
}
});
}
export default DefaultPropsProvider; |