UNPKG

@wordpress/components

Version:
44 lines (40 loc) 1.38 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.default = exports.InputControlPrefixWrapper = void 0; var _context = require("../context"); var _inputControlStyles = require("./styles/input-control-styles"); var _jsxRuntime = require("react/jsx-runtime"); /** * External dependencies */ /** * Internal dependencies */ function UnconnectedInputControlPrefixWrapper(props, forwardedRef) { const derivedProps = (0, _context.useContextSystem)(props, 'InputControlPrefixWrapper'); return /*#__PURE__*/(0, _jsxRuntime.jsx)(_inputControlStyles.PrefixSuffixWrapper, { ...derivedProps, isPrefix: true, ref: forwardedRef }); } /** * A convenience wrapper for the `prefix` when you want to apply * standard padding in accordance with the size variant. * * ```jsx * import { * __experimentalInputControl as InputControl, * __experimentalInputControlPrefixWrapper as InputControlPrefixWrapper, * } from '@wordpress/components'; * * <InputControl * prefix={<InputControlPrefixWrapper>@</InputControlPrefixWrapper>} * /> * ``` */ const InputControlPrefixWrapper = exports.InputControlPrefixWrapper = (0, _context.contextConnect)(UnconnectedInputControlPrefixWrapper, 'InputControlPrefixWrapper'); var _default = exports.default = InputControlPrefixWrapper; //# sourceMappingURL=input-prefix-wrapper.js.map