diff --git a/webapp/packages/core-app/src/AppScreen/Main.tsx b/webapp/packages/core-app/src/AppScreen/Main.tsx index 5f7f3dff4be..9d1fab6a3b3 100644 --- a/webapp/packages/core-app/src/AppScreen/Main.tsx +++ b/webapp/packages/core-app/src/AppScreen/Main.tsx @@ -8,7 +8,21 @@ import { observer } from 'mobx-react-lite'; import styled, { css } from 'reshadow'; -import { getComputed, Loader, Pane, ResizerControls, Split, splitStyles, useSplitUserState, useStyles } from '@cloudbeaver/core-blocks'; +import { + Combobox, + getComputed, + InputField, + InputFiles, + Loader, + Pane, + Radio, + ResizerControls, + Split, + splitStyles, + Textarea, + useSplitUserState, + useStyles, +} from '@cloudbeaver/core-blocks'; import { useService } from '@cloudbeaver/core-di'; import { LeftBarPanelService, SideBarPanel, SideBarPanelService } from '@cloudbeaver/core-ui'; @@ -42,29 +56,7 @@ export const Main = observer(function Main() { return styled(styles)( - - - - - - - - - - - - - - - - - - - - - - - + Label , ); }); diff --git a/webapp/packages/core-blocks/src/FormControls/Checkboxes/Switch.tsx b/webapp/packages/core-blocks/src/FormControls/Checkboxes/Switch.tsx index 661cbae450e..aa2204ac91f 100644 --- a/webapp/packages/core-blocks/src/FormControls/Checkboxes/Switch.tsx +++ b/webapp/packages/core-blocks/src/FormControls/Checkboxes/Switch.tsx @@ -8,10 +8,11 @@ import { observer } from 'mobx-react-lite'; import { filterLayoutFakeProps } from '../../Containers/filterLayoutFakeProps'; -import elementsSizeStyles from '../../Containers/shared/ElementsSize.m.css'; import { s } from '../../s'; import { useS } from '../../useS'; -import formControlStyles from '../FormControl.m.css'; +import { Field } from '../Field'; +import { FieldDescription } from '../FieldDescription'; +import { FieldLabel } from '../FieldLabel'; import { isControlPresented } from '../isControlPresented'; import type { ICheckboxControlledProps, ICheckboxObjectProps } from './Checkbox'; import switchStyles from './Switch.m.css'; @@ -64,19 +65,19 @@ export const Switch: SwitchType = observer(function Switch({ onChange, }); rest = filterLayoutFakeProps(rest); - const styles = useS(elementsSizeStyles, formControlStyles, switchStyles, ...mod.map(mod => switchMod[mod])); + const styles = useS(switchStyles, ...mod.map(mod => switchMod[mod])); if (autoHide && !isControlPresented(name, state)) { return null; } return ( -
-
-
-
-
-
+ +
+
+
+
+
- +
- {description && ( -
- {description} -
- )} -
+ {description && {description}} + ); }); diff --git a/webapp/packages/core-blocks/src/FormControls/Combobox.m.css b/webapp/packages/core-blocks/src/FormControls/Combobox.m.css index 939d725a5b2..1ef3de0a0b8 100644 --- a/webapp/packages/core-blocks/src/FormControls/Combobox.m.css +++ b/webapp/packages/core-blocks/src/FormControls/Combobox.m.css @@ -12,15 +12,17 @@ margin: 0; } -.fieldLabel { - display: block; - padding-bottom: 10px; - composes: theme-typography--body1 from global; - font-weight: 500; +.input { + padding-right: 24px !important; } .input { - padding-right: 24px !important; + font-size: 12px; + + &.select { + cursor: pointer; + user-select: none; + } } .menuButton { diff --git a/webapp/packages/core-blocks/src/FormControls/Combobox.tsx b/webapp/packages/core-blocks/src/FormControls/Combobox.tsx index a47c0ad08e4..67c2010fb4c 100644 --- a/webapp/packages/core-blocks/src/FormControls/Combobox.tsx +++ b/webapp/packages/core-blocks/src/FormControls/Combobox.tsx @@ -11,7 +11,6 @@ import { Menu, MenuButton, MenuItem, useMenuState } from 'reakit/Menu'; import { filterLayoutFakeProps, getLayoutProps } from '../Containers/filterLayoutFakeProps'; import type { ILayoutSizeProps } from '../Containers/ILayoutSizeProps'; -import elementsSizeStyles from '../Containers/shared/ElementsSize.m.css'; import { getComputed } from '../getComputed'; import { Icon } from '../Icon'; import { IconOrImage } from '../IconOrImage'; @@ -20,8 +19,10 @@ import { useTranslate } from '../localization/useTranslate'; import { s } from '../s'; import { useS } from '../useS'; import comboboxStyles from './Combobox.m.css'; +import { Field } from './Field'; +import { FieldDescription } from './FieldDescription'; +import { FieldLabel } from './FieldLabel'; import { FormContext } from './FormContext'; -import formControlStyles from './FormControl.m.css'; type BaseProps = Omit, 'onChange' | 'onSelect' | 'name' | 'value' | 'defaultValue'> & ILayoutSizeProps & { @@ -93,7 +94,7 @@ export const Combobox: ComboboxType = observer(function Combobox({ const context = useContext(FormContext); const menuRef = useRef(null); const [inputRef, setInputRef] = useState(null); - const styles = useS(elementsSizeStyles, formControlStyles, comboboxStyles); + const styles = useS(comboboxStyles); const menu = useMenuState({ placement: 'bottom-end', @@ -255,12 +256,12 @@ export const Combobox: ComboboxType = observer(function Combobox({ } return ( -
+ {children && ( -
+ {children} {rest.required && ' *'} -
+ )}
{(icon || loading) && ( @@ -322,20 +323,14 @@ export const Combobox: ComboboxType = observer(function Combobox({ {icon && typeof icon === 'string' ? : icon}
)} -
- {valueSelector(item)} -
+
{valueSelector(item)}
); }) )}
- {description && ( -
- {description} -
- )} -
+ {description && {description}} +
); }); diff --git a/webapp/packages/core-blocks/src/FormControls/Field.m.css b/webapp/packages/core-blocks/src/FormControls/Field.m.css new file mode 100644 index 00000000000..61015ed6ff0 --- /dev/null +++ b/webapp/packages/core-blocks/src/FormControls/Field.m.css @@ -0,0 +1,8 @@ +.field { + box-sizing: border-box; + + & .field { + height: 32px; + padding: 0; + } +} diff --git a/webapp/packages/core-blocks/src/FormControls/Field.tsx b/webapp/packages/core-blocks/src/FormControls/Field.tsx new file mode 100644 index 00000000000..f6ba8ca2471 --- /dev/null +++ b/webapp/packages/core-blocks/src/FormControls/Field.tsx @@ -0,0 +1,25 @@ +import { observer } from 'mobx-react-lite'; +import type { HTMLAttributes, PropsWithChildren } from 'react'; + +import { getLayoutProps } from '../Containers/filterLayoutFakeProps'; +import type { ILayoutSizeProps } from '../Containers/ILayoutSizeProps'; +import elementsSizeStyles from '../Containers/shared/ElementsSize.m.css'; +import { s } from '../s'; +import { useS } from '../useS'; +import fieldStyles from './Field.m.css'; + +type Props = ILayoutSizeProps & + HTMLAttributes & { + className?: string; + }; +export const Field: React.FC> = observer(function Field({ children, className, ...rest }) { + const styles = useS(fieldStyles, elementsSizeStyles); + + const layoutProps = getLayoutProps(rest); + + return ( +
+ {children} +
+ ); +}); diff --git a/webapp/packages/core-blocks/src/FormControls/FieldDescription.m.css b/webapp/packages/core-blocks/src/FormControls/FieldDescription.m.css new file mode 100644 index 00000000000..8cca77f4871 --- /dev/null +++ b/webapp/packages/core-blocks/src/FormControls/FieldDescription.m.css @@ -0,0 +1,11 @@ +.fieldDescription { + composes: theme-typography--caption from global; + color: var(--theme-text-hint-on-background); + box-sizing: border-box; + padding-top: 4px; + min-height: 24px; + + &.invalid { + color: var(--theme-negative); + } +} diff --git a/webapp/packages/core-blocks/src/FormControls/FieldDescription.tsx b/webapp/packages/core-blocks/src/FormControls/FieldDescription.tsx new file mode 100644 index 00000000000..8ad2c2534d4 --- /dev/null +++ b/webapp/packages/core-blocks/src/FormControls/FieldDescription.tsx @@ -0,0 +1,16 @@ +import { observer } from 'mobx-react-lite'; +import type { PropsWithChildren } from 'react'; + +import { s } from '../s'; +import { useS } from '../useS'; +import fieldDescriptionStyles from './FieldDescription.m.css'; + +interface Props { + className?: string; + invalid?: boolean; +} +export const FieldDescription: React.FC> = observer(function FieldDescription({ children, className, invalid }) { + const styles = useS(fieldDescriptionStyles); + + return
{children}
; +}); diff --git a/webapp/packages/core-blocks/src/FormControls/FieldLabel.m.css b/webapp/packages/core-blocks/src/FormControls/FieldLabel.m.css new file mode 100644 index 00000000000..41d6c5a8da2 --- /dev/null +++ b/webapp/packages/core-blocks/src/FormControls/FieldLabel.m.css @@ -0,0 +1,16 @@ +.fieldLabel { + composes: theme-typography--body1 from global; + display: block; + box-sizing: border-box; + overflow: hidden; + white-space: initial; + text-overflow: ellipsis; + display: -webkit-box; + -webkit-line-clamp: 2; + -webkit-box-orient: vertical; + font-weight: 500; +} + +.fieldLabel:not(:empty) { + padding-bottom: 10px; +} diff --git a/webapp/packages/core-blocks/src/FormControls/FieldLabel.tsx b/webapp/packages/core-blocks/src/FormControls/FieldLabel.tsx new file mode 100644 index 00000000000..e45ed179a96 --- /dev/null +++ b/webapp/packages/core-blocks/src/FormControls/FieldLabel.tsx @@ -0,0 +1,29 @@ +import { observer } from 'mobx-react-lite'; +import type { LabelHTMLAttributes, PropsWithChildren } from 'react'; + +import { s } from '../s'; +import { useS } from '../useS'; +import fieldLabelStyles from './FieldLabel.m.css'; + +type Props = LabelHTMLAttributes & { + className?: string; + title?: string; + required?: boolean; +}; +export const FieldLabel: React.FC> = observer(function FieldLabel({ + children, + className, + htmlFor, + title, + required, + ...rest +}) { + const styles = useS(fieldLabelStyles); + + return ( + + ); +}); diff --git a/webapp/packages/core-blocks/src/FormControls/Filter.m.css b/webapp/packages/core-blocks/src/FormControls/Filter.m.css index 61e7a471a99..071cc78a318 100644 --- a/webapp/packages/core-blocks/src/FormControls/Filter.m.css +++ b/webapp/packages/core-blocks/src/FormControls/Filter.m.css @@ -40,9 +40,6 @@ } } -.innerInputStyle { -} - .toggleMode { composes: theme-background-primary theme-text-on-primary from global; cursor: pointer; diff --git a/webapp/packages/core-blocks/src/FormControls/Filter.tsx b/webapp/packages/core-blocks/src/FormControls/Filter.tsx index 49fd6ab54b9..fb7c1d7a680 100644 --- a/webapp/packages/core-blocks/src/FormControls/Filter.tsx +++ b/webapp/packages/core-blocks/src/FormControls/Filter.tsx @@ -107,8 +107,8 @@ export const Filter = observer>(functio return (
> = observer(function FormFieldDescription({ label, title, children, className, ...rest }) { +export const FormFieldDescription: React.FC> = observer(function FormFieldDescription({ + label, + title, + children, + className, + ...rest +}) { const styles = useS(formControlStyles, elementsSizeStyles, style); const layoutProps = getLayoutProps(rest); rest = filterLayoutFakeProps(rest); diff --git a/webapp/packages/core-blocks/src/FormControls/InputField.m.css b/webapp/packages/core-blocks/src/FormControls/InputField.m.css index 3531611b5b6..1ac0b2448a9 100644 --- a/webapp/packages/core-blocks/src/FormControls/InputField.m.css +++ b/webapp/packages/core-blocks/src/FormControls/InputField.m.css @@ -1,14 +1,6 @@ .icon { composes: theme-text-on-secondary from global; } -.fieldLabel { - display: block; - composes: theme-typography--body1 from global; - font-weight: 500; -} -.fieldLabel:not(:empty) { - margin-bottom: 10px; -} .inputContainer { position: relative; } @@ -38,6 +30,10 @@ cursor: auto; } +.input { + font-size: 12px; +} + .input[disabled] + .iconContainer { cursor: auto; opacity: 0.8; diff --git a/webapp/packages/core-blocks/src/FormControls/InputField.tsx b/webapp/packages/core-blocks/src/FormControls/InputField.tsx index b1630e53b04..5e4f7c9762d 100644 --- a/webapp/packages/core-blocks/src/FormControls/InputField.tsx +++ b/webapp/packages/core-blocks/src/FormControls/InputField.tsx @@ -8,12 +8,10 @@ import { observer } from 'mobx-react-lite'; import React, { forwardRef, useCallback, useContext, useLayoutEffect, useRef, useState } from 'react'; -import type { ComponentStyle } from '@cloudbeaver/core-theming'; import { isNotNullDefined } from '@cloudbeaver/core-utils'; import { filterLayoutFakeProps, getLayoutProps } from '../Containers/filterLayoutFakeProps'; import type { ILayoutSizeProps } from '../Containers/ILayoutSizeProps'; -import elementsSizeStyles from '../Containers/shared/ElementsSize.m.css'; import { Icon } from '../Icon'; import { Loader } from '../Loader/Loader'; import { useTranslate } from '../localization/useTranslate'; @@ -22,9 +20,10 @@ import { useCombinedHandler } from '../useCombinedHandler'; import { useMergeRefs } from '../useMergeRefs'; import { useS } from '../useS'; import { useStateDelay } from '../useStateDelay'; -import { useStyles } from '../useStyles'; +import { Field } from './Field'; +import { FieldDescription } from './FieldDescription'; +import { FieldLabel } from './FieldLabel'; import { FormContext } from './FormContext'; -import formControlStyles from './FormControl.m.css'; import inputFieldStyle from './InputField.m.css'; import { isControlPresented } from './isControlPresented'; import { useCapsLockTracker } from './useCapsLockTracker'; @@ -35,9 +34,7 @@ type BaseProps = Omit, 'onChange' | loading?: boolean; description?: string; labelTooltip?: string; - mod?: 'surface'; ref?: React.ForwardedRef; - style?: ComponentStyle; canShowPassword?: boolean; onCustomCopy?: () => void; icon?: React.ReactElement; @@ -72,7 +69,6 @@ export const InputField: InputFieldType = observer( forwardRef(function InputField( { name, - style, value: valueControlled, defaultValue, required, @@ -85,7 +81,6 @@ export const InputField: InputFieldType = observer( loading, description, labelTooltip, - mod, autoHide, canShowPassword = true, onChange, @@ -102,8 +97,7 @@ export const InputField: InputFieldType = observer( const translate = useTranslate(); const layoutProps = getLayoutProps(rest); rest = filterLayoutFakeProps(rest); - const propStyles = useStyles(style); - const styles = useS(inputFieldStyle, formControlStyles, elementsSizeStyles); + const styles = useS(inputFieldStyle); const context = useContext(FormContext); loading = useStateDelay(loading ?? false, 300); @@ -163,47 +157,42 @@ export const InputField: InputFieldType = observer( } return ( -
-
+ + {children} - {required && ' *'} -
-
+ +
{loading && ( -
+
)} {passwordType && canShowPassword && ( -
+
)} {onCustomCopy && ( -
+
)} - {icon &&
{icon}
} + {icon &&
{icon}
}
- {(description || passwordType) && ( -
- {description} -
- )} -
+ {(description || passwordType) && {description}} + ); }), ); diff --git a/webapp/packages/core-blocks/src/FormControls/InputFileTextContent.m.css b/webapp/packages/core-blocks/src/FormControls/InputFileTextContent.m.css index 99bd8dee984..d47001b99ae 100644 --- a/webapp/packages/core-blocks/src/FormControls/InputFileTextContent.m.css +++ b/webapp/packages/core-blocks/src/FormControls/InputFileTextContent.m.css @@ -1,11 +1,3 @@ -.fieldLabel { - display: block; - composes: theme-typography--body1 from global; - font-weight: 500; -} -.fieldLabel:not(:empty) { - padding-bottom: 10px; -} .fieldDescription { display: flex; align-items: center; diff --git a/webapp/packages/core-blocks/src/FormControls/InputFileTextContent.tsx b/webapp/packages/core-blocks/src/FormControls/InputFileTextContent.tsx index d891f761caa..5a2b3b639c3 100644 --- a/webapp/packages/core-blocks/src/FormControls/InputFileTextContent.tsx +++ b/webapp/packages/core-blocks/src/FormControls/InputFileTextContent.tsx @@ -7,23 +7,21 @@ */ import { observer } from 'mobx-react-lite'; import { ReactNode, useContext, useState } from 'react'; -import styled from 'reshadow'; import type { ComponentStyle } from '@cloudbeaver/core-theming'; import { blobToData, bytesToSize } from '@cloudbeaver/core-utils'; import { Button } from '../Button'; -import { filterLayoutFakeProps, getLayoutProps } from '../Containers/filterLayoutFakeProps'; import type { ILayoutSizeProps } from '../Containers/ILayoutSizeProps'; -import elementsSizeStyles from '../Containers/shared/ElementsSize.m.css'; import { IconButton } from '../IconButton'; import { useTranslate } from '../localization/useTranslate'; import { s } from '../s'; import { UploadArea } from '../UploadArea'; import { useS } from '../useS'; -import { useStyles } from '../useStyles'; +import { Field } from './Field'; +import { FieldDescription } from './FieldDescription'; +import { FieldLabel } from './FieldLabel'; import { FormContext } from './FormContext'; -import formControlStyles from './FormControl.m.css'; import inputFileTextContentStyles from './InputFileTextContent.m.css'; const DEFAULT_MAX_FILE_SIZE = 2048; @@ -56,14 +54,12 @@ export const InputFileTextContent: InputFileTextContentType = observer(function tooltip, required, fileName, - style: styleProp, maxFileSize = DEFAULT_MAX_FILE_SIZE, disabled, className, children, onChange, mapValue, - ...rest }: Props>) { const translate = useTranslate(); const context = useContext(FormContext); @@ -71,9 +67,7 @@ export const InputFileTextContent: InputFileTextContentType = observer(function const [selected, setSelected] = useState(null); const [error, setError] = useState(null); - const layoutProps = getLayoutProps(rest); - rest = filterLayoutFakeProps(rest); - const styles = useS(formControlStyles, elementsSizeStyles, inputFileTextContentStyles); + const styles = useS(inputFileTextContentStyles); const savedExternally = !!fileName && state[name] !== ''; const saved = savedExternally || !!state[name]; @@ -141,28 +135,20 @@ export const InputFileTextContent: InputFileTextContentType = observer(function } } - return styled(useStyles(styleProp))( -
-
+ return ( + + {children} - {required && ' *'} -
+ -
+ {description} - {(selected || saved) && ( - - )} -
-
, + {(selected || saved) && } + + ); }); diff --git a/webapp/packages/core-blocks/src/FormControls/InputFiles.m.css b/webapp/packages/core-blocks/src/FormControls/InputFiles.m.css index e1e4cde4f4d..9367d0ba33a 100644 --- a/webapp/packages/core-blocks/src/FormControls/InputFiles.m.css +++ b/webapp/packages/core-blocks/src/FormControls/InputFiles.m.css @@ -1,11 +1,3 @@ -.fieldLabel { - display: block; - composes: theme-typography--body1 from global; - font-weight: 500; -} -.fieldLabel:not(:empty) { - padding-bottom: 10px; -} .inputContainer { position: relative; } diff --git a/webapp/packages/core-blocks/src/FormControls/InputFiles.tsx b/webapp/packages/core-blocks/src/FormControls/InputFiles.tsx index 65822f928be..197e584ad6d 100644 --- a/webapp/packages/core-blocks/src/FormControls/InputFiles.tsx +++ b/webapp/packages/core-blocks/src/FormControls/InputFiles.tsx @@ -13,7 +13,6 @@ import type { ComponentStyle } from '@cloudbeaver/core-theming'; import { Button } from '../Button'; import { filterLayoutFakeProps, getLayoutProps } from '../Containers/filterLayoutFakeProps'; import type { ILayoutSizeProps } from '../Containers/ILayoutSizeProps'; -import elementsSizeStyles from '../Containers/shared/ElementsSize.m.css'; import { useTranslate } from '../localization/useTranslate'; import { s } from '../s'; import { Tag } from '../Tags/Tag'; @@ -23,8 +22,10 @@ import { useCombinedHandler } from '../useCombinedHandler'; import { useRefInherit } from '../useRefInherit'; import { useS } from '../useS'; import { useStateDelay } from '../useStateDelay'; +import { Field } from './Field'; +import { FieldDescription } from './FieldDescription'; +import { FieldLabel } from './FieldLabel'; import { FormContext } from './FormContext'; -import formControlStyles from './FormControl.m.css'; import InputFilesStyles from './InputFiles.m.css'; import { isControlPresented } from './isControlPresented'; @@ -35,7 +36,6 @@ type BaseProps = Omit, 'onChange' | description?: string; labelTooltip?: string; hideTags?: boolean; - mod?: 'surface'; ref?: React.Ref; style?: ComponentStyle; aggregate?: boolean; @@ -78,7 +78,6 @@ export const InputFiles: InputFilesType = observer( description, labelTooltip, hideTags, - mod, autoHide, aggregate, onChange, @@ -92,7 +91,7 @@ export const InputFiles: InputFilesType = observer( const ref = useRefInherit(refInherit); const [innerState, setInnerState] = useState(null); const translate = useTranslate(); - const styles = useS(formControlStyles, elementsSizeStyles, InputFilesStyles); + const styles = useS(InputFilesStyles); const context = useContext(FormContext); loading = useStateDelay(loading ?? false, 300); @@ -173,11 +172,10 @@ export const InputFiles: InputFilesType = observer( const files = Array.from(value ?? []); return ( -
- +
- {description &&
{description}
} -
+ {description && {description}} + ); }), ); diff --git a/webapp/packages/core-blocks/src/FormControls/Radio.tsx b/webapp/packages/core-blocks/src/FormControls/Radio.tsx index 1ac6c27a363..18aaea36f1a 100644 --- a/webapp/packages/core-blocks/src/FormControls/Radio.tsx +++ b/webapp/packages/core-blocks/src/FormControls/Radio.tsx @@ -7,15 +7,13 @@ */ import { observer } from 'mobx-react-lite'; import { useCallback, useContext } from 'react'; -import styled from 'reshadow'; import { filterLayoutFakeProps, getLayoutProps } from '../Containers/filterLayoutFakeProps'; import type { ILayoutSizeProps } from '../Containers/ILayoutSizeProps'; import elementsSizeStyles from '../Containers/shared/ElementsSize.m.css'; import { s } from '../s'; import { useS } from '../useS'; -import { useStyles } from '../useStyles'; -import { baseFormControlStyles } from './baseFormControlStyles'; +import { Field } from './Field'; import { FormContext } from './FormContext'; import formControlStyles from './FormControl.m.css'; import style from './Radio.m.css'; @@ -104,7 +102,7 @@ export const Radio: RadioType = observer(function Radio({ } return ( -
+
{children} -
+
); }); diff --git a/webapp/packages/core-blocks/src/FormControls/Textarea.m.css b/webapp/packages/core-blocks/src/FormControls/Textarea.m.css index 1a5fc05fc44..1f3d3c2d416 100644 --- a/webapp/packages/core-blocks/src/FormControls/Textarea.m.css +++ b/webapp/packages/core-blocks/src/FormControls/Textarea.m.css @@ -1,5 +1,6 @@ .textarea { line-height: 19px; + font-size: 12px; } .field.embedded { height: 100%; @@ -12,13 +13,3 @@ resize: none !important; } } -.fieldLabel { - display: block; - padding-bottom: 10px; - composes: theme-typography--body1 from global; - font-weight: 500; - - &:empty { - display: none; - } -} diff --git a/webapp/packages/core-blocks/src/FormControls/Textarea.tsx b/webapp/packages/core-blocks/src/FormControls/Textarea.tsx index 00f806f1ece..10b609f5ae5 100644 --- a/webapp/packages/core-blocks/src/FormControls/Textarea.tsx +++ b/webapp/packages/core-blocks/src/FormControls/Textarea.tsx @@ -10,11 +10,12 @@ import { useCallback, useContext } from 'react'; import { filterLayoutFakeProps, getLayoutProps } from '../Containers/filterLayoutFakeProps'; import type { ILayoutSizeProps } from '../Containers/ILayoutSizeProps'; -import elementsSizeStyles from '../Containers/shared/ElementsSize.m.css'; import { s } from '../s'; import { useS } from '../useS'; +import { Field } from './Field'; +import { FieldDescription } from './FieldDescription'; +import { FieldLabel } from './FieldLabel'; import { FormContext } from './FormContext'; -import formControlStyles from './FormControl.m.css'; import textareaStyle from './Textarea.m.css'; type BaseProps = Omit, 'onChange' | 'style'> & @@ -58,7 +59,7 @@ export const Textarea: TextareaType = observer(function Textarea({ }: ControlledProps | ObjectProps) { const layoutProps = getLayoutProps(rest); rest = filterLayoutFakeProps(rest); - const styles = useS(formControlStyles, elementsSizeStyles, textareaStyle); + const styles = useS(textareaStyle); const context = useContext(FormContext); const handleChange = useCallback( @@ -79,11 +80,10 @@ export const Textarea: TextareaType = observer(function Textarea({ const value = state ? state[name] : controlledValue; return ( -
- +