InputPhone
PropsInputPhone1interface IInputPhoneProps extends Omit<React.InputHTMLAttributes<HTMLInputElement>, 'onChange'> {2 onChange: (value: string, event?: React.ChangeEvent<HTMLInputElement>) => void;3 countryCode: string; //default: '+7'4 countryCodeCSS?: SerializedStyles;5 mask?: string; // default: '(999) 999-99-99';6 ref: React.Ref<HTMLInputElement>;7}
+7
1import { InputPhone } from 'neutrino-ui';23const phoneStyle = css({4 height: 48,5 borderRadius: 4,6 width: 250,7 fontSize: 16,8 outline: 0,9 border: '1px #ababab solid',10 '&:hover, &:focus': {11 border: '1px #0ed308 solid',12 },13});1415const [phone, setPhone] = useState('');1617const handleChangePhone = (phone: string) => {18 setPhone(phone);19};2021<InputPhone22 name="phoneNumber"23 countryCode="+7"24 css={phoneStyle}25 onChange={handleChangePhone}26 value={phone}27 placeholder="(___) ___-__-__"28/>