UNPKG

@mui/material

Version:

Quickly build beautiful React apps. MUI is a simple and customizable component library to build faster, beautiful, and more accessible React applications. Follow your own design system, or start with Material Design.

99 lines (89 loc) 3.23 kB
import _objectWithoutProperties from "@babel/runtime/helpers/esm/objectWithoutProperties"; import _extends from "@babel/runtime/helpers/esm/extends"; import * as React from 'react'; import PropTypes from 'prop-types'; import clsx from 'clsx'; import { unstable_composeClasses as composeClasses } from '@mui/base'; import useThemeProps from '../styles/useThemeProps'; import styled from '../styles/styled'; import { html, body } from '../CssBaseline/CssBaseline'; import { getScopedCssBaselineUtilityClass } from './scopedCssBaselineClasses'; import { jsx as _jsx } from "react/jsx-runtime"; var useUtilityClasses = function useUtilityClasses(ownerState) { var classes = ownerState.classes; var slots = { root: ['root'] }; return composeClasses(slots, getScopedCssBaselineUtilityClass, classes); }; var ScopedCssBaselineRoot = styled('div', { name: 'MuiScopedCssBaseline', slot: 'Root', overridesResolver: function overridesResolver(props, styles) { return styles.root; } })(function (_ref) { var theme = _ref.theme, ownerState = _ref.ownerState; return _extends({}, html(theme, ownerState.enableColorScheme), body(theme), { '& *, & *::before, & *::after': { boxSizing: 'inherit' }, '& strong, & b': { fontWeight: theme.typography.fontWeightBold } }); }); var ScopedCssBaseline = /*#__PURE__*/React.forwardRef(function ScopedCssBaseline(inProps, ref) { var props = useThemeProps({ props: inProps, name: 'MuiScopedCssBaseline' }); var className = props.className, _props$component = props.component, component = _props$component === void 0 ? 'div' : _props$component, enableColorScheme = props.enableColorScheme, other = _objectWithoutProperties(props, ["className", "component", "enableColorScheme"]); var ownerState = _extends({}, props, { component: component }); var classes = useUtilityClasses(ownerState); return /*#__PURE__*/_jsx(ScopedCssBaselineRoot, _extends({ as: component, className: clsx(classes.root, className), ref: ref, ownerState: ownerState }, other)); }); process.env.NODE_ENV !== "production" ? ScopedCssBaseline.propTypes /* remove-proptypes */ = { // ----------------------------- Warning -------------------------------- // | These PropTypes are generated from the TypeScript type definitions | // | To update them edit the d.ts file and run "yarn proptypes" | // ---------------------------------------------------------------------- /** * The content of the component. */ children: PropTypes.node, /** * Override or extend the styles applied to the component. */ classes: PropTypes.object, /** * @ignore */ className: PropTypes.string, /** * The component used for the root node. * Either a string to use a HTML element or a component. */ component: PropTypes.elementType, /** * Enable `color-scheme` CSS property to use `theme.palette.mode`. * For more details, check out https://developer.mozilla.org/en-US/docs/Web/CSS/color-scheme * For browser support, check out https://caniuse.com/?search=color-scheme */ enableColorScheme: PropTypes.bool } : void 0; export default ScopedCssBaseline;