@@ -1,14 +1,9 @@ import React from 'react' -import { RegisterOptions } from 'react-hook-form/dist/types/validator' -import { TextField, Typography } from '@mui/material' +import { Typography } from '@mui/material' import Box from '@mui/material/Box' -import { TextFieldProps } from '@mui/material/TextField/TextField' - -import { setParams } from '#/app/store/model-parametres-store' -import { useAppDispatch } from '#/app/store/store' -import { InputStyleDark, InputStyleLight } from '#/shared' import { useThemeAndDevice } from '#/shared/lib/hooks' import TooltipModelTypes from '#/widgets/filters-gpt/ui/tooltip-model-types' +import { CommonTextArea } from '#/shared/ui/common-textarea' interface IProps { title: string @@ -50,15 +45,17 @@ export const InputFilter = ({ filters, item_key, values, title, description, set > {title} - - { + e.target.style.height = 'auto' + e.target.style.height = Math.min(e.target.scrollHeight, 177) + 'px' + setNewParam({ [item_key]: e.target.value }) setValue(e.target.value) }} - fullWidth - sx={theme === 'light' ? { ...InputStyleLight } : { ...InputStyleDark }} /> @@ -56,6 +56,11 @@ font-size: 19px; color: var(--new-ui-text-color) !important; } + &_outline { + font-size: 19px; + color: var(--new-ui-text-color) !important; + max-height: 177px; + } &_error { color: #ff2372 !important; @@ -87,6 +92,21 @@ color: var(--border-color2) !important; } } + &_outline { + color: var(--new-ui-text-color) !important; + padding: 16.5px 14px; + border: var(--new-ui-border); + border-width: 2px; + border-radius: 15px; + + &:hover { + border-color: var(--air-color); + } + + &::placeholder { + color: var(--border-color2) !important; + } + } &_error { border-color: #ff2372; @@ -3,7 +3,7 @@ import { FieldError } from 'react-hook-form' import styles from './common-textarea.module.scss' import React, { ForwardedRef, forwardRef, useEffect } from 'react' -export type TextAreaVariant = 'default' +export type TextAreaVariant = 'default' | 'outline' export interface CommonTextAreaProps extends React.TextareaHTMLAttributes { children?: React.ReactNode @@ -12,7 +12,7 @@ export interface CommonTextAreaProps extends React.TextareaHTMLAttributes(