UNPKG

@wordpress/components

Version:
49 lines (45 loc) 1.16 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.Surface = void 0; var _context = require("../context"); var _view = require("../view"); var _hook = require("./hook"); var _jsxRuntime = require("react/jsx-runtime"); /** * External dependencies */ /** * Internal dependencies */ function UnconnectedSurface(props, forwardedRef) { const surfaceProps = (0, _hook.useSurface)(props); return /*#__PURE__*/(0, _jsxRuntime.jsx)(_view.View, { ...surfaceProps, ref: forwardedRef }); } /** * `Surface` is a core component that renders a primary background color. * * In the example below, notice how the `Surface` renders in white (or dark gray if in dark mode). * * ```jsx * import { * __experimentalSurface as Surface, * __experimentalText as Text, * } from '@wordpress/components'; * * function Example() { * return ( * <Surface> * <Text>Code is Poetry</Text> * </Surface> * ); * } * ``` */ const Surface = exports.Surface = (0, _context.contextConnect)(UnconnectedSurface, 'Surface'); var _default = exports.default = Surface; //# sourceMappingURL=component.js.map