/
githubmirror
/
gutenberg
Обзор
Документация
Войти
/
githubmirror
/
gutenberg
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
trunk
packages/components/src/input-control/input-prefix-wrapper.tsx
42 строки
1 KB
Marco Ciampini
ESLint: Replace strict config with bulk suppressions (#81248)
07 авг 2026, 14:34
Не верифицирован
07 авг 2026, 14:34
7f43eaf
Код
Авторство
О чём код?
import type { ForwardedRef } from 'react'; import type { WordPressComponentProps } from '../context'; import { contextConnect, useContextSystem } from '../context'; import type { PrefixSuffixWrapperProps } from './types'; import { PrefixSuffixWrapper } from './styles/input-control-styles'; function UnconnectedInputControlPrefixWrapper( props: WordPressComponentProps< PrefixSuffixWrapperProps, 'div' >, forwardedRef: ForwardedRef< any > ) { const derivedProps = useContextSystem( props, 'InputControlPrefixWrapper' ); return ( <PrefixSuffixWrapper { ...derivedProps } isPrefix 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>} * /> * ``` */ export const InputControlPrefixWrapper = contextConnect( UnconnectedInputControlPrefixWrapper, 'InputControlPrefixWrapper' ); export default InputControlPrefixWrapper;