import type { PropsPlugin } from '../../../../../types/component-plugin'; import type { InputUIProps } from '../InputUI'; import type { InputValidator } from '../types'; export const trimInputValuePlugin = (): PropsPlugin => (props) => ({ ...props, onBlur: (event) => { event.target.value = event.target.value.trim(); props.onBlur?.(event); }, }); export const createValidInputPlugin = (onValid: InputValidator) => ({ nextValue, previousValue, timing }: Parameters[0]) => onValid({ nextValue, previousValue, timing, });