1 import { type FC, type RefObject } from 'react';
3 import { type FactoryOpts } from 'imask/esm/masked/factory';
5 import noop from '@proton/utils/noop';
7 import { useFieldMask } from '../../../hooks/useFieldMask';
8 import { FieldBox, type FieldBoxProps } from './Layout/FieldBox';
9 import { BaseTextField, type BaseTextFieldProps } from './TextField';
11 export type MaskedTextFieldProps = FieldBoxProps &
12 BaseTextFieldProps & {
16 export const MaskedTextField: FC<MaskedTextFieldProps> = (props) => {
17 const { actions, actionsContainerClassName, className, icon, mask, ...rest } = props;
18 const { inputRef, maskedValue } = useFieldMask(props, mask);
23 actionsContainerClassName={actionsContainerClassName}
34 ref={inputRef as RefObject<HTMLInputElement>}