UNPKG

@wordpress/components

Version:
41 lines (36 loc) 1.18 kB
import _extends from "@babel/runtime/helpers/esm/extends"; import { createElement } from "@wordpress/element"; /** * External dependencies */ /** * Internal dependencies */ import { Spacer } from '../spacer'; import { contextConnect, useContextSystem } from '../ui/context'; function UnconnectedInputControlSuffixWrapper(props, forwardedRef) { const derivedProps = useContextSystem(props, 'InputControlSuffixWrapper'); return createElement(Spacer, _extends({ marginBottom: 0 }, derivedProps, { ref: forwardedRef })); } /** * A convenience wrapper for the `suffix` when you want to apply * standard padding in accordance with the size variant. * * ```jsx * import { * __experimentalInputControl as InputControl, * __experimentalInputControlSuffixWrapper as InputControlSuffixWrapper, * } from '@wordpress/components'; * * <InputControl * suffix={<InputControlSuffixWrapper>%</InputControlSuffixWrapper>} * /> * ``` */ export const InputControlSuffixWrapper = contextConnect(UnconnectedInputControlSuffixWrapper, 'InputControlSuffixWrapper'); export default InputControlSuffixWrapper; //# sourceMappingURL=input-suffix-wrapper.js.map