Discriminator in username

This commit is contained in:
Fedor Indutny 2022-10-18 10:12:02 -07:00 committed by GitHub
parent 58f0012f14
commit 00f82a6d39
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
54 changed files with 2706 additions and 892 deletions

View file

@ -34,6 +34,7 @@ export type PropsType = {
placeholder: string;
value?: string;
whenToShowRemainingCount?: number;
children?: ReactNode;
};
/**
@ -75,6 +76,7 @@ export const Input = forwardRef<
placeholder,
value = '',
whenToShowRemainingCount = Infinity,
children,
},
ref
) => {
@ -201,7 +203,8 @@ export const Input = forwardRef<
className: classNames(
getClassName('__input'),
icon && getClassName('__input--with-icon'),
isLarge && getClassName('__input--large')
isLarge && getClassName('__input--large'),
expandable && getClassName('__input--expandable')
),
disabled: Boolean(disabled),
spellCheck: !disableSpellcheck,
@ -238,15 +241,21 @@ export const Input = forwardRef<
<div
className={classNames(
getClassName('__container'),
expandable && getClassName('__container--expandable'),
disabled && getClassName('__container--disabled')
)}
>
{icon ? <div className={getClassName('__icon')}>{icon}</div> : null}
{expandable ? <textarea {...inputProps} /> : <input {...inputProps} />}
{expandable ? (
<textarea rows={1} {...inputProps} />
) : (
<input {...inputProps} />
)}
{isLarge ? (
<>
<div className={getClassName('__controls')}>
{clearButtonElement}
{children}
</div>
<div className={getClassName('__remaining-count--large')}>
{lengthCountElement}
@ -256,6 +265,7 @@ export const Input = forwardRef<
<div className={getClassName('__controls')}>
{lengthCountElement}
{clearButtonElement}
{children}
</div>
)}
</div>