From b5a9cac6a9bcce34eb8124482626c1b11a01746a Mon Sep 17 00:00:00 2001 From: Sam Ferrero Date: Tue, 7 Nov 2023 19:17:37 +0000 Subject: [PATCH 1/8] chore: rename inputWrapper --- .../Common/Layout/Header/Header.tsx | 20 ++++++++----- .../Global/AccountNameField/index.tsx | 10 +++---- .../components/Global/ChainSelect/index.tsx | 6 ++-- .../Global/PredKeysSelect/index.tsx | 6 ++-- .../Global/PublicKeyField/index.tsx | 4 +-- .../FormFieldHeader/FormFieldHeader.css.ts} | 0 .../FormFieldHeader/FormFieldHeader.tsx} | 6 ++-- .../FormFieldHelper/FormFieldHelper.css.ts} | 0 .../FormFieldHelper/FormFieldHelper.tsx} | 6 ++-- .../FormFieldWrapper.context.ts} | 4 +-- .../FormFieldWrapper.css.ts} | 2 +- .../FormFieldWrapper.stories.tsx} | 16 +++++----- .../FormFieldWrapper.tsx} | 29 ++++++++++++------- .../components/Form/FormFieldWrapper/index.ts | 4 +++ .../src/components/Form/Input/Input.tsx | 7 +++-- .../src/components/Form/InputWrapper/index.ts | 1 - .../src/components/Form/Select/Select.tsx | 4 +-- .../Form/SelectField/SelectField.stories.tsx | 4 +-- .../Form/SelectField/SelectField.tsx | 11 +++---- .../Form/TextField/TextField.stories.tsx | 4 +-- .../components/Form/TextField/TextField.tsx | 15 ++++++---- .../src/components/Form/Textarea/Textarea.tsx | 4 +-- .../Form/TextareaField/TextareaField.tsx | 10 +++---- .../react-ui/src/components/Form/index.ts | 5 +++- .../libs/react-ui/src/components/index.ts | 4 +-- packages/libs/react-ui/src/index.ts | 4 +-- 26 files changed, 106 insertions(+), 80 deletions(-) rename packages/libs/react-ui/src/components/Form/{InputWrapper/InputHeader/InputHeader.css.ts => FormFieldWrapper/FormFieldHeader/FormFieldHeader.css.ts} (100%) rename packages/libs/react-ui/src/components/Form/{InputWrapper/InputHeader/InputHeader.tsx => FormFieldWrapper/FormFieldHeader/FormFieldHeader.tsx} (78%) rename packages/libs/react-ui/src/components/Form/{InputWrapper/InputHelper/InputHelper.css.ts => FormFieldWrapper/FormFieldHelper/FormFieldHelper.css.ts} (100%) rename packages/libs/react-ui/src/components/Form/{InputWrapper/InputHelper/InputHelper.tsx => FormFieldWrapper/FormFieldHelper/FormFieldHelper.tsx} (63%) rename packages/libs/react-ui/src/components/Form/{InputWrapper/InputWrapper.context.ts => FormFieldWrapper/FormFieldWrapper.context.ts} (72%) rename packages/libs/react-ui/src/components/Form/{InputWrapper/InputWrapper.css.ts => FormFieldWrapper/FormFieldWrapper.css.ts} (95%) rename packages/libs/react-ui/src/components/Form/{InputWrapper/InputWrapper.stories.tsx => FormFieldWrapper/FormFieldWrapper.stories.tsx} (86%) rename packages/libs/react-ui/src/components/Form/{InputWrapper/InputWrapper.tsx => FormFieldWrapper/FormFieldWrapper.tsx} (50%) create mode 100644 packages/libs/react-ui/src/components/Form/FormFieldWrapper/index.ts delete mode 100644 packages/libs/react-ui/src/components/Form/InputWrapper/index.ts diff --git a/packages/apps/graph-client/src/components/Common/Layout/Header/Header.tsx b/packages/apps/graph-client/src/components/Common/Layout/Header/Header.tsx index d6b89edb24..3961e65870 100644 --- a/packages/apps/graph-client/src/components/Common/Layout/Header/Header.tsx +++ b/packages/apps/graph-client/src/components/Common/Layout/Header/Header.tsx @@ -1,6 +1,12 @@ import routes from '@/constants/routes'; import { Text } from '@components/text'; -import { Button, Grid, Input, InputWrapper, Select } from '@kadena/react-ui'; +import { + Button, + FormFieldWrapper, + Grid, + Input, + Select, +} from '@kadena/react-ui'; import { useRouter } from 'next/router'; import type { FC } from 'react'; import React, { useState } from 'react'; @@ -117,7 +123,7 @@ const Header: FC = (props) => { - + - + - @@ -143,18 +149,18 @@ const Header: FC = (props) => { onChange={handleSearchFieldChange} onKeyDown={handleKeyPress} /> - + {searchType.startsWith('account') && ( - + setModuleField(event.target.value)} /> - + )} diff --git a/packages/apps/tools/src/components/Global/AccountNameField/index.tsx b/packages/apps/tools/src/components/Global/AccountNameField/index.tsx index ad51ff3cad..e6e0280d5a 100644 --- a/packages/apps/tools/src/components/Global/AccountNameField/index.tsx +++ b/packages/apps/tools/src/components/Global/AccountNameField/index.tsx @@ -2,14 +2,14 @@ import { useWalletConnectClient } from '@/context/connect-wallet-context'; import { useDidUpdateEffect } from '@/hooks'; import { getAccounts } from '@/utils/wallet'; import type { + IFormFieldWrapperProps, IInputProps, - IInputWrapperProps, ISelectProps, } from '@kadena/react-ui'; import { + FormFieldWrapper, IconButton, Input, - InputWrapper, Select, maskValue, } from '@kadena/react-ui'; @@ -21,7 +21,7 @@ import * as z from 'zod'; import { accountInputWrapperStyle } from './styles.css'; interface IAccountNameFieldProps - extends Partial> { + extends Partial> { inputProps: Partial< Pick< IInputProps, @@ -98,7 +98,7 @@ export const AccountNameField: FC = ({ return (
- = ({ {...rest} > {lookup[mode]} - + {accounts?.length && ( + - + ); }; diff --git a/packages/apps/tools/src/components/Global/PredKeysSelect/index.tsx b/packages/apps/tools/src/components/Global/PredKeysSelect/index.tsx index b90eb8d2c3..da5fc7fea8 100644 --- a/packages/apps/tools/src/components/Global/PredKeysSelect/index.tsx +++ b/packages/apps/tools/src/components/Global/PredKeysSelect/index.tsx @@ -1,5 +1,5 @@ import type { ISelectProps } from '@kadena/react-ui'; -import { InputWrapper, Select } from '@kadena/react-ui'; +import { FormFieldWrapper, Select } from '@kadena/react-ui'; import type { FC, FormEventHandler } from 'react'; import React, { useCallback } from 'react'; @@ -34,7 +34,7 @@ const PredKeysSelect: FC< }); return ( - + - + ); }; diff --git a/packages/apps/tools/src/components/Global/PublicKeyField/index.tsx b/packages/apps/tools/src/components/Global/PublicKeyField/index.tsx index 1fc33dbd14..14181a0b5a 100644 --- a/packages/apps/tools/src/components/Global/PublicKeyField/index.tsx +++ b/packages/apps/tools/src/components/Global/PublicKeyField/index.tsx @@ -1,4 +1,4 @@ -import type { IInputProps, IInputWrapperProps } from '@kadena/react-ui'; +import type { IFormFieldWrapperProps, IInputProps } from '@kadena/react-ui'; import { TextField } from '@kadena/react-ui'; import useTranslation from 'next-translate/useTranslation'; @@ -8,7 +8,7 @@ import type { FieldError } from 'react-hook-form'; import { publicKeyFieldStyles } from './styles.css'; interface IPublicKeyFieldProps - extends Partial> { + extends Partial> { inputProps: Partial< Pick< IInputProps, diff --git a/packages/libs/react-ui/src/components/Form/InputWrapper/InputHeader/InputHeader.css.ts b/packages/libs/react-ui/src/components/Form/FormFieldWrapper/FormFieldHeader/FormFieldHeader.css.ts similarity index 100% rename from packages/libs/react-ui/src/components/Form/InputWrapper/InputHeader/InputHeader.css.ts rename to packages/libs/react-ui/src/components/Form/FormFieldWrapper/FormFieldHeader/FormFieldHeader.css.ts diff --git a/packages/libs/react-ui/src/components/Form/InputWrapper/InputHeader/InputHeader.tsx b/packages/libs/react-ui/src/components/Form/FormFieldWrapper/FormFieldHeader/FormFieldHeader.tsx similarity index 78% rename from packages/libs/react-ui/src/components/Form/InputWrapper/InputHeader/InputHeader.tsx rename to packages/libs/react-ui/src/components/Form/FormFieldWrapper/FormFieldHeader/FormFieldHeader.tsx index 863bbad572..c2682c0ab3 100644 --- a/packages/libs/react-ui/src/components/Form/InputWrapper/InputHeader/InputHeader.tsx +++ b/packages/libs/react-ui/src/components/Form/FormFieldWrapper/FormFieldHeader/FormFieldHeader.tsx @@ -2,16 +2,16 @@ import { SystemIcon } from '@components/Icon'; import { Label } from '@components/Typography'; import type { FC } from 'react'; import React from 'react'; -import { headerClass, infoClass, tagClass } from './InputHeader.css'; +import { headerClass, infoClass, tagClass } from './FormFieldHeader.css'; -export interface IInputHeaderProps { +export interface IFormFieldHeaderProps { label: string; htmlFor: string; tag?: string; info?: string; } -export const InputHeader: FC = ({ +export const FormFieldHeader: FC = ({ label, htmlFor, tag, diff --git a/packages/libs/react-ui/src/components/Form/InputWrapper/InputHelper/InputHelper.css.ts b/packages/libs/react-ui/src/components/Form/FormFieldWrapper/FormFieldHelper/FormFieldHelper.css.ts similarity index 100% rename from packages/libs/react-ui/src/components/Form/InputWrapper/InputHelper/InputHelper.css.ts rename to packages/libs/react-ui/src/components/Form/FormFieldWrapper/FormFieldHelper/FormFieldHelper.css.ts diff --git a/packages/libs/react-ui/src/components/Form/InputWrapper/InputHelper/InputHelper.tsx b/packages/libs/react-ui/src/components/Form/FormFieldWrapper/FormFieldHelper/FormFieldHelper.tsx similarity index 63% rename from packages/libs/react-ui/src/components/Form/InputWrapper/InputHelper/InputHelper.tsx rename to packages/libs/react-ui/src/components/Form/FormFieldWrapper/FormFieldHelper/FormFieldHelper.tsx index 68c7b4df46..a0f862d1e8 100644 --- a/packages/libs/react-ui/src/components/Form/InputWrapper/InputHelper/InputHelper.tsx +++ b/packages/libs/react-ui/src/components/Form/FormFieldWrapper/FormFieldHelper/FormFieldHelper.tsx @@ -1,13 +1,13 @@ import { SystemIcon } from '@components/Icon'; import type { FC } from 'react'; import React from 'react'; -import { helperClass, helperIconClass } from './InputHelper.css'; +import { helperClass, helperIconClass } from './FormFieldHelper.css'; -interface IInputHelperProps { +interface IFormFieldHelperProps { children: React.ReactNode; } -export const InputHelper: FC = ({ children }) => { +export const FormFieldHelper: FC = ({ children }) => { return ( diff --git a/packages/libs/react-ui/src/components/Form/InputWrapper/InputWrapper.context.ts b/packages/libs/react-ui/src/components/Form/FormFieldWrapper/FormFieldWrapper.context.ts similarity index 72% rename from packages/libs/react-ui/src/components/Form/InputWrapper/InputWrapper.context.ts rename to packages/libs/react-ui/src/components/Form/FormFieldWrapper/FormFieldWrapper.context.ts index 3289393dee..d5a42624a8 100644 --- a/packages/libs/react-ui/src/components/Form/InputWrapper/InputWrapper.context.ts +++ b/packages/libs/react-ui/src/components/Form/FormFieldWrapper/FormFieldWrapper.context.ts @@ -5,12 +5,12 @@ import type { FormFieldStatus } from '../Form.css'; export type OpenSections = string[]; -interface IInputWrapperContext { +interface IFormFieldWrapperContext { status?: FormFieldStatus; leadingTextWidth?: keyof typeof vars.sizes; } -export const InputWrapperContext = createContext({ +export const FormFieldWrapperContext = createContext({ status: undefined, leadingTextWidth: undefined, }); diff --git a/packages/libs/react-ui/src/components/Form/InputWrapper/InputWrapper.css.ts b/packages/libs/react-ui/src/components/Form/FormFieldWrapper/FormFieldWrapper.css.ts similarity index 95% rename from packages/libs/react-ui/src/components/Form/InputWrapper/InputWrapper.css.ts rename to packages/libs/react-ui/src/components/Form/FormFieldWrapper/FormFieldWrapper.css.ts index 00f2d664d1..e5172a483f 100644 --- a/packages/libs/react-ui/src/components/Form/InputWrapper/InputWrapper.css.ts +++ b/packages/libs/react-ui/src/components/Form/FormFieldWrapper/FormFieldWrapper.css.ts @@ -6,7 +6,7 @@ import { statusColor, statusOutlineColor } from '../Form.css'; import { helperIconColor, helperTextColor, -} from './InputHelper/InputHelper.css'; +} from './FormFieldHelper/FormFieldHelper.css'; const statusOptions: Record = { disabled: 'disabled', diff --git a/packages/libs/react-ui/src/components/Form/InputWrapper/InputWrapper.stories.tsx b/packages/libs/react-ui/src/components/Form/FormFieldWrapper/FormFieldWrapper.stories.tsx similarity index 86% rename from packages/libs/react-ui/src/components/Form/InputWrapper/InputWrapper.stories.tsx rename to packages/libs/react-ui/src/components/Form/FormFieldWrapper/FormFieldWrapper.stories.tsx index dd7a49d87f..8dff25fba2 100644 --- a/packages/libs/react-ui/src/components/Form/InputWrapper/InputWrapper.stories.tsx +++ b/packages/libs/react-ui/src/components/Form/FormFieldWrapper/FormFieldWrapper.stories.tsx @@ -1,25 +1,25 @@ -import type { IInputWrapperProps } from '@components/Form'; -import { Input, InputWrapper } from '@components/Form'; +import type { IFormFieldWrapperProps } from '@components/Form'; +import { FormFieldWrapper, Input } from '@components/Form'; import type { SystemIcon } from '@components/Icon'; import type { Meta, StoryObj } from '@storybook/react'; import { vars } from '@theme/vars.css'; import React from 'react'; -import { statusVariant } from './InputWrapper.css'; +import { statusVariant } from './FormFieldWrapper.css'; type StoryProps = { helperText: string; leadingText: string; icon: keyof typeof SystemIcon; rightIcon: keyof typeof SystemIcon; -} & IInputWrapperProps; +} & IFormFieldWrapperProps; const meta: Meta = { - title: 'Form/InputWrapper', + title: 'Form/FormFieldWrapper', parameters: { docs: { description: { component: - 'The InputWrapper component is intended to be used to wrap one or more form input components to provide them with a shared and optional label, tag, info, helper text and status colors.', + 'The FormFieldWrapper component is intended to be used to wrap one or more form input components to provide them with a shared and optional label, tag, info, helper text and status colors.', }, }, }, @@ -113,7 +113,7 @@ export const Group: Story = { leadingTextWidth, }) => { return ( - - + ); }, }; diff --git a/packages/libs/react-ui/src/components/Form/InputWrapper/InputWrapper.tsx b/packages/libs/react-ui/src/components/Form/FormFieldWrapper/FormFieldWrapper.tsx similarity index 50% rename from packages/libs/react-ui/src/components/Form/InputWrapper/InputWrapper.tsx rename to packages/libs/react-ui/src/components/Form/FormFieldWrapper/FormFieldWrapper.tsx index b45b8a6320..03796a235a 100644 --- a/packages/libs/react-ui/src/components/Form/InputWrapper/InputWrapper.tsx +++ b/packages/libs/react-ui/src/components/Form/FormFieldWrapper/FormFieldWrapper.tsx @@ -3,13 +3,15 @@ import type { FC, FunctionComponentElement } from 'react'; import React from 'react'; import type { vars } from 'src/styles'; import type { FormFieldStatus } from '../Form.css'; -import type { IInputHeaderProps } from './InputHeader/InputHeader'; -import { InputHeader } from './InputHeader/InputHeader'; -import { InputHelper } from './InputHelper/InputHelper'; -import { InputWrapperContext } from './InputWrapper.context'; -import { statusVariant } from './InputWrapper.css'; -export interface IInputWrapperProps extends Omit { +import type { IFormFieldHeaderProps } from './FormFieldHeader/FormFieldHeader'; +import { FormFieldHeader } from './FormFieldHeader/FormFieldHeader'; +import { FormFieldHelper } from './FormFieldHelper/FormFieldHelper'; +import { FormFieldWrapperContext } from './FormFieldWrapper.context'; +import { statusVariant } from './FormFieldWrapper.css'; + +export interface IFormFieldWrapperProps + extends Omit { children: | FunctionComponentElement | FunctionComponentElement[]; @@ -20,7 +22,7 @@ export interface IInputWrapperProps extends Omit { leadingTextWidth?: keyof typeof vars.sizes; } -export const InputWrapper: FC = ({ +export const FormFieldWrapper: FC = ({ status, disabled, children, @@ -34,14 +36,19 @@ export const InputWrapper: FC = ({ const statusVal = disabled === true ? 'disabled' : status; return ( - +
{label !== undefined && ( - + )}
{children}
- {Boolean(helperText) && {helperText}} + {Boolean(helperText) && {helperText}}
-
+ ); }; diff --git a/packages/libs/react-ui/src/components/Form/FormFieldWrapper/index.ts b/packages/libs/react-ui/src/components/Form/FormFieldWrapper/index.ts new file mode 100644 index 0000000000..f1ce23ecc3 --- /dev/null +++ b/packages/libs/react-ui/src/components/Form/FormFieldWrapper/index.ts @@ -0,0 +1,4 @@ +export { + FormFieldWrapper, + type IFormFieldWrapperProps, +} from './FormFieldWrapper'; diff --git a/packages/libs/react-ui/src/components/Form/Input/Input.tsx b/packages/libs/react-ui/src/components/Form/Input/Input.tsx index 78a4bf37b4..f6fde4ad58 100644 --- a/packages/libs/react-ui/src/components/Form/Input/Input.tsx +++ b/packages/libs/react-ui/src/components/Form/Input/Input.tsx @@ -4,7 +4,7 @@ import classNames from 'classnames'; import type { FC, InputHTMLAttributes } from 'react'; import React, { forwardRef, useContext } from 'react'; import { baseContainerClass, baseOutlinedClass } from '../Form.css'; -import { InputWrapperContext } from '../InputWrapper/InputWrapper.context'; +import { FormFieldWrapperContext } from '../FormFieldWrapper/FormFieldWrapper.context'; import { disabledClass, inputClass, @@ -43,8 +43,9 @@ export const Input: FC = forwardRef( }, ref, ) { - const { status, leadingTextWidth: wrapperLeadingTextWidth } = - useContext(InputWrapperContext); + const { status, leadingTextWidth: wrapperLeadingTextWidth } = useContext( + FormFieldWrapperContext, + ); const leadingTextWidth = propLeadingTextWidth || wrapperLeadingTextWidth; diff --git a/packages/libs/react-ui/src/components/Form/InputWrapper/index.ts b/packages/libs/react-ui/src/components/Form/InputWrapper/index.ts deleted file mode 100644 index 421cef50c9..0000000000 --- a/packages/libs/react-ui/src/components/Form/InputWrapper/index.ts +++ /dev/null @@ -1 +0,0 @@ -export { InputWrapper, type IInputWrapperProps } from './InputWrapper'; diff --git a/packages/libs/react-ui/src/components/Form/Select/Select.tsx b/packages/libs/react-ui/src/components/Form/Select/Select.tsx index 65d58e1196..273a6bd240 100644 --- a/packages/libs/react-ui/src/components/Form/Select/Select.tsx +++ b/packages/libs/react-ui/src/components/Form/Select/Select.tsx @@ -3,7 +3,7 @@ import classNames from 'classnames'; import type { FC } from 'react'; import React, { forwardRef, useContext } from 'react'; import { baseOutlinedClass } from '../Form.css'; -import { InputWrapperContext } from '../InputWrapper/InputWrapper.context'; +import { FormFieldWrapperContext } from '../FormFieldWrapper/FormFieldWrapper.context'; import { chevronIconClass, containerClass, @@ -35,7 +35,7 @@ export const Select: FC = forwardRef< { ariaLabel, children, disabled = false, outlined = false, icon, ...rest }, ref, ) { - const { status } = useContext(InputWrapperContext); + const { status } = useContext(FormFieldWrapperContext); const Icon = icon && SystemIcon[icon]; const ChevronDown = SystemIcon.ChevronDown; diff --git a/packages/libs/react-ui/src/components/Form/SelectField/SelectField.stories.tsx b/packages/libs/react-ui/src/components/Form/SelectField/SelectField.stories.tsx index e95868a846..28b885cfcd 100644 --- a/packages/libs/react-ui/src/components/Form/SelectField/SelectField.stories.tsx +++ b/packages/libs/react-ui/src/components/Form/SelectField/SelectField.stories.tsx @@ -1,6 +1,6 @@ import type { ISelectFieldProps } from '@components/Form'; import { SelectField } from '@components/Form'; -import { statusVariant } from '@components/Form/InputWrapper/InputWrapper.css'; +import { statusVariant } from '@components/Form/FormFieldWrapper/FormFieldWrapper.css'; import { SystemIcon } from '@components/Icon'; import type { Meta, StoryObj } from '@storybook/react'; import React from 'react'; @@ -15,7 +15,7 @@ const meta: Meta = { docs: { description: { component: - 'SelectField is the composition of the Select and InputWrapper components to provide a select with a label, helper text, and other peripheral information.', + 'SelectField is the composition of the Select and FormFieldWrapper components to provide a select with a label, helper text, and other peripheral information.', }, }, }, diff --git a/packages/libs/react-ui/src/components/Form/SelectField/SelectField.tsx b/packages/libs/react-ui/src/components/Form/SelectField/SelectField.tsx index dc806d4117..649a61877d 100644 --- a/packages/libs/react-ui/src/components/Form/SelectField/SelectField.tsx +++ b/packages/libs/react-ui/src/components/Form/SelectField/SelectField.tsx @@ -1,9 +1,10 @@ -import type { IInputWrapperProps, ISelectProps } from '@components/Form'; -import { InputWrapper, Select } from '@components/Form'; +import type { IFormFieldWrapperProps, ISelectProps } from '@components/Form'; +import { FormFieldWrapper, Select } from '@components/Form'; import type { FC } from 'react'; import React from 'react'; -export interface ISelectFieldProps extends Omit { +export interface ISelectFieldProps + extends Omit { selectProps: Omit; } @@ -16,10 +17,10 @@ export const SelectField: FC = ({ const { id } = selectProps; return ( - + - + ); }; diff --git a/packages/libs/react-ui/src/components/Form/TextField/TextField.stories.tsx b/packages/libs/react-ui/src/components/Form/TextField/TextField.stories.tsx index 3a875f62fc..abcf41e2a5 100644 --- a/packages/libs/react-ui/src/components/Form/TextField/TextField.stories.tsx +++ b/packages/libs/react-ui/src/components/Form/TextField/TextField.stories.tsx @@ -1,6 +1,6 @@ import type { ITextFieldProps } from '@components/Form'; import { TextField } from '@components/Form'; -import { statusVariant } from '@components/Form/InputWrapper/InputWrapper.css'; +import { statusVariant } from '@components/Form/FormFieldWrapper/FormFieldWrapper.css'; import { SystemIcon } from '@components/Icon'; import type { Meta, StoryObj } from '@storybook/react'; import { vars } from '@theme/vars.css'; @@ -19,7 +19,7 @@ const meta: Meta = { docs: { description: { component: - 'TextField is the composition of Input and InputWrapper to provide an input with a label, helper text, and other peripheral information.', + 'TextField is the composition of Input and FormFieldWrapper to provide an input with a label, helper text, and other peripheral information.', }, }, }, diff --git a/packages/libs/react-ui/src/components/Form/TextField/TextField.tsx b/packages/libs/react-ui/src/components/Form/TextField/TextField.tsx index 39c25271d1..4e43f46889 100644 --- a/packages/libs/react-ui/src/components/Form/TextField/TextField.tsx +++ b/packages/libs/react-ui/src/components/Form/TextField/TextField.tsx @@ -1,10 +1,10 @@ -import type { IInputProps, IInputWrapperProps } from '@components/Form'; -import { Input, InputWrapper } from '@components/Form'; +import type { IFormFieldWrapperProps, IInputProps } from '@components/Form'; +import { FormFieldWrapper, Input } from '@components/Form'; import type { FC } from 'react'; import React from 'react'; export interface ITextFieldProps - extends Omit { + extends Omit { inputProps: Omit; } @@ -17,8 +17,13 @@ export const TextField: FC = ({ const { id } = inputProps; return ( - + - + ); }; diff --git a/packages/libs/react-ui/src/components/Form/Textarea/Textarea.tsx b/packages/libs/react-ui/src/components/Form/Textarea/Textarea.tsx index 5b38c2f25b..a9e772e36a 100644 --- a/packages/libs/react-ui/src/components/Form/Textarea/Textarea.tsx +++ b/packages/libs/react-ui/src/components/Form/Textarea/Textarea.tsx @@ -4,7 +4,7 @@ import classNames from 'classnames'; import type { FC, TextareaHTMLAttributes } from 'react'; import React, { forwardRef, useContext } from 'react'; import { baseContainerClass, baseOutlinedClass } from '../Form.css'; -import { InputWrapperContext } from '../InputWrapper/InputWrapper.context'; +import { FormFieldWrapperContext } from '../FormFieldWrapper/FormFieldWrapper.context'; import { disabledClass, textAreaClass, @@ -30,7 +30,7 @@ export const Textarea: FC = forwardRef< { outlined = false, disabled = false, fontFamily, ...rest }, ref, ) { - const { status } = useContext(InputWrapperContext); + const { status } = useContext(FormFieldWrapperContext); return (
{ + extends Omit { textAreaProps: Omit; } @@ -16,8 +16,8 @@ export const TextareaField: FC = ({ const { id } = textAreaProps; return ( - +