Skip to content

The open alternative to Salesforce, designed for AI.

Adopt Base UI compound Field for form fields (#24279)

Raphaël Bosi80b875a03d54
diff --git a/packages/twenty-front/src/modules/advanced-text-editor/components/FormAdvancedTextFieldInput.tsx b/packages/twenty-front/src/modules/advanced-text-editor/components/FormAdvancedTextFieldInput.tsx
index 9acb3124ac4..9f7d8dd8f67 100644
--- a/packages/twenty-front/src/modules/advanced-text-editor/components/FormAdvancedTextFieldInput.tsx
+++ b/packages/twenty-front/src/modules/advanced-text-editor/components/FormAdvancedTextFieldInput.tsx
@@ -17,7 +17,7 @@ import { type Editor } from '@tiptap/core';
import { type ComponentType, useEffect, useId, useState } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { IconMaximize } from 'twenty-ui/icon';
-import { InputHint, InputLabel, LightIconButton } from 'twenty-ui/input';
+import { Field, LightIconButton } from 'twenty-ui/input';
import { themeCssVariables } from 'twenty-ui/theme-constants';
import { useIsMobile } from 'twenty-ui/utilities';
@@ -233,7 +233,7 @@ export const FormAdvancedTextFieldInput = ({
hasFieldChrome={chrome === 'field'}
>
<FormFieldInputContainer>
- {label ? <InputLabel>{label}</InputLabel> : null}
+ {label ? <Field.Label>{label}</Field.Label> : null}
<StyledAdvancedTextFieldFieldContainer>
<StyledAdvancedTextFieldInnerContainer
@@ -271,8 +271,8 @@ export const FormAdvancedTextFieldInput = ({
) : null}
</StyledAdvancedTextFieldInnerContainer>
</StyledAdvancedTextFieldFieldContainer>
- {hint && <InputHint>{hint}</InputHint>}
- {error && <InputHint danger>{error}</InputHint>}
+ {hint && <Field.Description>{hint}</Field.Description>}
+ {error && <Field.Error match>{error}</Field.Error>}
</FormFieldInputContainer>
</StyledAdvancedTextFieldContainerWrapper>
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormAddressFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormAddressFieldInput.tsx
index 29714f0cdb6..97dc171c221 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormAddressFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormAddressFieldInput.tsx
@@ -5,7 +5,7 @@ import { FormTextFieldInput } from '@/object-record/record-field/ui/form-types/c
import { type VariablePickerComponent } from '@/object-record/record-field/ui/form-types/types/VariablePickerComponent';
import { type FieldAddressDraftValue } from '@/object-record/record-field/ui/types/FieldInputDraftValue';
import { type FieldAddressValue } from '@/object-record/record-field/ui/types/FieldMetadata';
-import { InputLabel } from 'twenty-ui/input';
+import { Field } from 'twenty-ui/input';
import { t } from '@lingui/core/macro';
import { normalizeAddressFieldValueForPersist } from '~/utils/normalize-address-field-value-for-persist';
@@ -42,7 +42,7 @@ export const FormAddressFieldInput = ({
return (
<FormFieldInputContainer>
- {label ? <InputLabel>{label}</InputLabel> : null}
+ {label ? <Field.Label>{label}</Field.Label> : null}
<FormNestedFieldInputContainer>
<FormTextFieldInput
label={t`Address 1`}
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormArrayFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormArrayFieldInput.tsx
index 37788334c30..66ec609cd03 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormArrayFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormArrayFieldInput.tsx
@@ -9,7 +9,7 @@ import { MultiItemBaseInput } from '@/object-record/record-field/ui/meta-types/i
import { type FieldArrayValue } from '@/object-record/record-field/ui/types/FieldMetadata';
import { ArrayDisplay } from '@/ui/field/display/components/ArrayDisplay';
import { TextInput } from '@/ui/field/input/components/TextInput';
-import { InputLabel } from 'twenty-ui/input';
+import { Field } from 'twenty-ui/input';
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
import { DropdownContent } from '@/ui/layout/dropdown/components/DropdownContent';
import { DropdownMenuItemsContainer } from '@/ui/layout/dropdown/components/DropdownMenuItemsContainer';
@@ -296,7 +296,7 @@ export const FormArrayFieldInput = ({
return (
<FormFieldInputContainer data-testid={testId}>
- {label ? <InputLabel>{label}</InputLabel> : null}
+ {label ? <Field.Label>{label}</Field.Label> : null}
<FormFieldInputRowContainer>
<FormFieldInputInnerContainer
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormBooleanFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormBooleanFieldInput.tsx
index b4bfe2036b8..9666868c7d4 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormBooleanFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormBooleanFieldInput.tsx
@@ -3,7 +3,7 @@ import { FormFieldInputInnerContainer } from '@/object-record/record-field/ui/fo
import { FormFieldInputRowContainer } from '@/object-record/record-field/ui/form-types/components/FormFieldInputRowContainer';
import { VariableChipStandalone } from '@/object-record/record-field/ui/form-types/components/VariableChipStandalone';
import { type VariablePickerComponent } from '@/object-record/record-field/ui/form-types/types/VariablePickerComponent';
-import { InputLabel } from 'twenty-ui/input';
+import { Field } from 'twenty-ui/input';
import { Select } from '@/ui/input/components/Select';
import { GenericDropdownContentWidth } from '@/ui/layout/dropdown/constants/GenericDropdownContentWidth';
import { useRemoveFocusItemFromFocusStackById } from '@/ui/utilities/focus/hooks/useRemoveFocusItemFromFocusStackById';
@@ -117,7 +117,7 @@ export const FormBooleanFieldInput = ({
return (
<FormFieldInputContainer>
- {label ? <InputLabel>{label}</InputLabel> : null}
+ {label ? <Field.Label>{label}</Field.Label> : null}
<FormFieldInputRowContainer>
{draftValue.type === 'static' ? (
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormBooleanFieldToggleInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormBooleanFieldToggleInput.tsx
index fdb74304109..935e9a47baa 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormBooleanFieldToggleInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormBooleanFieldToggleInput.tsx
@@ -1,7 +1,7 @@
import { FormFieldInputContainer } from '@/ui/input/components/FormFieldInputContainer';
import { FormFieldInputInnerContainer } from '@/object-record/record-field/ui/form-types/components/FormFieldInputInnerContainer';
import { FormFieldInputRowContainer } from '@/object-record/record-field/ui/form-types/components/FormFieldInputRowContainer';
-import { InputHint, InputLabel, Toggle } from 'twenty-ui/input';
+import { Field, Toggle } from 'twenty-ui/input';
import { styled } from '@linaria/react';
import { useId } from 'react';
import { themeCssVariables } from 'twenty-ui/theme-constants';
@@ -51,7 +51,7 @@ export const FormBooleanFieldToggleInput = ({
return (
<FormFieldInputContainer>
- {label ? <InputLabel>{label}</InputLabel> : null}
+ {label ? <Field.Label>{label}</Field.Label> : null}
<FormFieldInputRowContainer>
<FormFieldInputInnerContainer
@@ -72,7 +72,7 @@ export const FormBooleanFieldToggleInput = ({
</StyledToggleContainer>
</FormFieldInputRowContainer>
- {hint && <InputHint>{hint}</InputHint>}
+ {hint && <Field.Description>{hint}</Field.Description>}
</FormFieldInputContainer>
);
};
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormCurrencyFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormCurrencyFieldInput.tsx
index 722f55606bb..c5948f74e76 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormCurrencyFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormCurrencyFieldInput.tsx
@@ -5,7 +5,7 @@ import { FormSelectFieldInput } from '@/object-record/record-field/ui/form-types
import { type VariablePickerComponent } from '@/object-record/record-field/ui/form-types/types/VariablePickerComponent';
import { type FormFieldCurrencyValue } from '@/object-record/record-field/ui/types/FieldMetadata';
import { CURRENCIES } from '@/settings/data-model/constants/Currencies';
-import { InputLabel } from 'twenty-ui/input';
+import { Field } from 'twenty-ui/input';
import { t } from '@lingui/core/macro';
import { useMemo } from 'react';
import { type CurrencyCode } from 'twenty-shared/constants';
@@ -55,7 +55,7 @@ export const FormCurrencyFieldInput = ({
return (
<FormFieldInputContainer>
- {label ? <InputLabel>{label}</InputLabel> : null}
+ {label ? <Field.Label>{label}</Field.Label> : null}
<FormNestedFieldInputContainer>
<FormSelectFieldInput
label={t`Currency Code`}
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormDateFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormDateFieldInput.tsx
index ef3f02fda3c..3c2eb1e9df7 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormDateFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormDateFieldInput.tsx
@@ -3,7 +3,7 @@ import { FormFieldInputInnerContainer } from '@/object-record/record-field/ui/fo
import { FormFieldInputRowContainer } from '@/object-record/record-field/ui/form-types/components/FormFieldInputRowContainer';
import { VariableChipStandalone } from '@/object-record/record-field/ui/form-types/components/VariableChipStandalone';
import { type VariablePickerComponent } from '@/object-record/record-field/ui/form-types/types/VariablePickerComponent';
-import { InputLabel } from 'twenty-ui/input';
+import { Field } from 'twenty-ui/input';
import {
DatePicker,
MONTH_AND_YEAR_DROPDOWN_MONTH_SELECT_ID,
@@ -264,7 +264,7 @@ export const FormDateFieldInput = ({
return (
<FormFieldInputContainer>
- {label ? <InputLabel>{label}</InputLabel> : null}
+ {label ? <Field.Label>{label}</Field.Label> : null}
<FormFieldInputRowContainer>
<StyledDatePickerInputWrapper ref={datePickerWrapperRef}>
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormDateTimeFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormDateTimeFieldInput.tsx
index 658b16f9925..3fcce1760ff 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormDateTimeFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormDateTimeFieldInput.tsx
@@ -3,7 +3,7 @@ import { FormFieldInputInnerContainer } from '@/object-record/record-field/ui/fo
import { FormFieldInputRowContainer } from '@/object-record/record-field/ui/form-types/components/FormFieldInputRowContainer';
import { VariableChipStandalone } from '@/object-record/record-field/ui/form-types/components/VariableChipStandalone';
import { type VariablePickerComponent } from '@/object-record/record-field/ui/form-types/types/VariablePickerComponent';
-import { InputLabel } from 'twenty-ui/input';
+import { Field } from 'twenty-ui/input';
import {
DATE_TIME_PICKER_MONTH_YEAR_PANEL_DROPDOWN_ID,
DateTimePicker,
@@ -259,7 +259,7 @@ export const FormDateTimeFieldInput = ({
return (
<FormFieldInputContainer>
- {label ? <InputLabel>{label}</InputLabel> : null}
+ {label ? <Field.Label>{label}</Field.Label> : null}
<FormFieldInputRowContainer>
<StyledDatePickerInputWrapper ref={datePickerWrapperRef}>
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormEmailsFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormEmailsFieldInput.tsx
index 21eb0b3c51a..414441f0c07 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormEmailsFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormEmailsFieldInput.tsx
@@ -3,7 +3,7 @@ import { FormNestedFieldInputContainer } from '@/object-record/record-field/ui/f
import { FormTextFieldInput } from '@/object-record/record-field/ui/form-types/components/FormTextFieldInput';
import { type VariablePickerComponent } from '@/object-record/record-field/ui/form-types/types/VariablePickerComponent';
import { type FieldEmailsValue } from '@/object-record/record-field/ui/types/FieldMetadata';
-import { InputLabel } from 'twenty-ui/input';
+import { Field } from 'twenty-ui/input';
import { useLingui } from '@lingui/react/macro';
type FormEmailsFieldInputProps = {
@@ -32,7 +32,7 @@ export const FormEmailsFieldInput = ({
return (
<FormFieldInputContainer>
- {label ? <InputLabel>{label}</InputLabel> : null}
+ {label ? <Field.Label>{label}</Field.Label> : null}
<FormNestedFieldInputContainer>
<FormTextFieldInput
label={t`Primary Email`}
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormFilesFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormFilesFieldInput.tsx
index 6faf34f4470..0b86ff13d24 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormFilesFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormFilesFieldInput.tsx
@@ -4,7 +4,7 @@ import { FormFieldInputRowContainer } from '@/object-record/record-field/ui/form
import { TextVariableEditor } from '@/object-record/record-field/ui/form-types/components/TextVariableEditor';
import { useTextVariableEditor } from '@/object-record/record-field/ui/form-types/hooks/useTextVariableEditor';
import { type VariablePickerComponent } from '@/object-record/record-field/ui/form-types/types/VariablePickerComponent';
-import { InputHint, InputLabel } from 'twenty-ui/input';
+import { Field } from 'twenty-ui/input';
import { t } from '@lingui/core/macro';
import { useId } from 'react';
import { isDefined } from 'twenty-shared/utils';
@@ -74,7 +74,7 @@ export const FormFilesFieldInput = ({
return (
<FormFieldInputContainer>
- {label ? <InputLabel>{label}</InputLabel> : null}
+ {label ? <Field.Label>{label}</Field.Label> : null}
<FormFieldInputRowContainer multiline>
<FormFieldInputInnerContainer
@@ -94,7 +94,7 @@ export const FormFilesFieldInput = ({
/>
)}
</FormFieldInputRowContainer>
- {error && <InputHint danger>{error}</InputHint>}
+ {error && <Field.Error match>{error}</Field.Error>}
</FormFieldInputContainer>
);
};
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormFullNameFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormFullNameFieldInput.tsx
index 4d512addd70..3bc4202e6bf 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormFullNameFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormFullNameFieldInput.tsx
@@ -6,7 +6,7 @@ import { type VariablePickerComponent } from '@/object-record/record-field/ui/fo
import { FIRST_NAME_PLACEHOLDER_WITH_SPECIAL_CHARACTER_TO_AVOID_PASSWORD_MANAGERS } from '@/object-record/record-field/ui/meta-types/input/constants/FirstNamePlaceholder';
import { LAST_NAME_PLACEHOLDER_WITH_SPECIAL_CHARACTER_TO_AVOID_PASSWORD_MANAGERS } from '@/object-record/record-field/ui/meta-types/input/constants/LastNamePlaceholder';
import { type FieldFullNameValue } from '@/object-record/record-field/ui/types/FieldMetadata';
-import { InputLabel } from 'twenty-ui/input';
+import { Field } from 'twenty-ui/input';
type FormFullNameFieldInputProps = {
label?: string;
@@ -39,7 +39,7 @@ export const FormFullNameFieldInput = ({
return (
<FormFieldInputContainer>
- {label ? <InputLabel>{label}</InputLabel> : null}
+ {label ? <Field.Label>{label}</Field.Label> : null}
<FormNestedFieldInputContainer>
<FormTextFieldInput
label={t`First Name`}
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormLinksFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormLinksFieldInput.tsx
index 8fcaffde9a8..41b7a1944d1 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormLinksFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormLinksFieldInput.tsx
@@ -5,7 +5,7 @@ import { FormTextFieldInput } from '@/object-record/record-field/ui/form-types/c
import { type VariablePickerComponent } from '@/object-record/record-field/ui/form-types/types/VariablePickerComponent';
import { type FieldLinksDraftValue } from '@/object-record/record-field/ui/types/FieldInputDraftValue';
import { type FieldLinksValue } from '@/object-record/record-field/ui/types/FieldMetadata';
-import { InputLabel } from 'twenty-ui/input';
+import { Field } from 'twenty-ui/input';
type FormLinksFieldInputProps = {
label?: string;
@@ -36,7 +36,7 @@ export const FormLinksFieldInput = ({
return (
<FormFieldInputContainer>
- {label ? <InputLabel>{label}</InputLabel> : null}
+ {label ? <Field.Label>{label}</Field.Label> : null}
<FormNestedFieldInputContainer>
<FormTextFieldInput
label={t`Primary Link Label`}
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMorphRelationToOneFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMorphRelationToOneFieldInput.tsx
index 24ea017c48b..164daad2741 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMorphRelationToOneFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMorphRelationToOneFieldInput.tsx
@@ -12,7 +12,7 @@ import {
} from '@/object-record/record-field/ui/form-types/types/RecordPickerValue';
import { type VariablePickerComponent } from '@/object-record/record-field/ui/form-types/types/VariablePickerComponent';
import { ForbiddenFieldDisplay } from '@/object-record/record-field/ui/meta-types/display/components/ForbiddenFieldDisplay';
-import { InputLabel } from 'twenty-ui/input';
+import { Field } from 'twenty-ui/input';
import { styled } from '@linaria/react';
import { t } from '@lingui/core/macro';
import { isString } from '@sniptt/guards';
@@ -115,7 +115,7 @@ export const FormMorphRelationToOneFieldInput = ({
if (hasForbiddenSelectedRecord) {
return (
<FormFieldInputContainer data-testid={testId}>
- {label ? <InputLabel>{label}</InputLabel> : null}
+ {label ? <Field.Label>{label}</Field.Label> : null}
<FormFieldInputRowContainer>
<StyledReadonlyContainer>
<FormFieldInputInnerContainer
@@ -135,7 +135,7 @@ export const FormMorphRelationToOneFieldInput = ({
if (readableObjectNameSingulars.length === 0) {
return (
<FormFieldInputContainer data-testid={testId}>
- {label ? <InputLabel>{label}</InputLabel> : null}
+ {label ? <Field.Label>{label}</Field.Label> : null}
<FormFieldInputRowContainer>
<StyledReadonlyContainer>
<FormFieldInputInnerContainer
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMultiRecordPicker.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMultiRecordPicker.tsx
index bd623829bb7..2501ddab84b 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMultiRecordPicker.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMultiRecordPicker.tsx
@@ -16,7 +16,7 @@ import {
import { MultipleRecordPicker } from '@/object-record/record-picker/multiple-record-picker/components/MultipleRecordPicker';
import { type RecordPickerPickableMorphItem } from '@/object-record/record-picker/types/RecordPickerPickableMorphItem';
import { useSnackBar } from '@/ui/feedback/snack-bar-manager/hooks/useSnackBar';
-import { InputLabel } from 'twenty-ui/input';
+import { Field } from 'twenty-ui/input';
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
import { GenericDropdownContentWidth } from '@/ui/layout/dropdown/constants/GenericDropdownContentWidth';
import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';
@@ -188,7 +188,7 @@ export const FormMultiRecordPicker = ({
return (
<FormFieldInputContainer data-testid={testId}>
- {label ? <InputLabel>{label}</InputLabel> : null}
+ {label ? <Field.Label>{label}</Field.Label> : null}
<FormFieldInputRowContainer>
{readonly || draftValue.type === 'variable' ? (
<StyledFormSelectContainerWrapper readonly={readonly}>
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMultiSelectFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMultiSelectFieldInput.tsx
index b2dcd32d479..3c045998a8c 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMultiSelectFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMultiSelectFieldInput.tsx
@@ -11,7 +11,7 @@ import { SELECT_FIELD_INPUT_SELECTABLE_LIST_COMPONENT_INSTANCE_ID } from '@/obje
import { type FieldMultiSelectValue } from '@/object-record/record-field/ui/types/FieldMetadata';
import { MultiSelectDisplay } from '@/ui/field/display/components/MultiSelectDisplay';
import { MultiSelectInput } from '@/ui/field/input/components/MultiSelectInput';
-import { InputHint, InputLabel, type SelectOption } from 'twenty-ui/input';
+import { Field, type SelectOption } from 'twenty-ui/input';
import { GenericDropdownContentWidth } from '@/ui/layout/dropdown/constants/GenericDropdownContentWidth';
import { OverlayContainer } from '@/ui/layout/overlay/components/OverlayContainer';
import { usePushFocusItemToFocusStack } from '@/ui/utilities/focus/hooks/usePushFocusItemToFocusStack';
@@ -207,7 +207,7 @@ export const FormMultiSelectFieldInput = ({
return (
<FormFieldInputContainer data-testid={testId}>
- {label ? <InputLabel>{label}</InputLabel> : null}
+ {label ? <Field.Label>{label}</Field.Label> : null}
<FormFieldInputRowContainer>
<FormFieldInputInnerContainer
@@ -293,7 +293,7 @@ export const FormMultiSelectFieldInput = ({
/>
)}
</FormFieldInputRowContainer>
- {hint ? <InputHint>{hint}</InputHint> : null}
+ {hint ? <Field.Description>{hint}</Field.Description> : null}
</FormFieldInputContainer>
);
};
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMultiTextFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMultiTextFieldInput.tsx
index 85e3d102af3..9ef98cb6aa4 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMultiTextFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormMultiTextFieldInput.tsx
@@ -4,7 +4,7 @@ import { FormFieldInputRowContainer } from '@/object-record/record-field/ui/form
import { TextVariableEditor } from '@/object-record/record-field/ui/form-types/components/TextVariableEditor';
import { useMultiItemFieldEditor } from '@/object-record/record-field/ui/form-types/hooks/useMultiItemFieldEditor';
import { type VariablePickerComponent } from '@/object-record/record-field/ui/form-types/types/VariablePickerComponent';
-import { InputLabel } from 'twenty-ui/input';
+import { Field } from 'twenty-ui/input';
import { parseMultiItemEditorContent } from '@/workflow/workflow-variables/utils/parseMultiItemEditorContent';
import { t } from '@lingui/core/macro';
import { useId } from 'react';
@@ -57,7 +57,7 @@ export const FormMultiTextFieldInput = ({
return (
<FormFieldInputContainer>
- {label ? <InputLabel>{label}</InputLabel> : null}
+ {label ? <Field.Label>{label}</Field.Label> : null}
<FormFieldInputRowContainer multiline={false}>
<FormFieldInputInnerContainer
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormNumberFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormNumberFieldInput.tsx
index a6266edfbc7..d289b3e6adc 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormNumberFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormNumberFieldInput.tsx
@@ -4,7 +4,7 @@ import { FormFieldInputRowContainer } from '@/object-record/record-field/ui/form
import { VariableChipStandalone } from '@/object-record/record-field/ui/form-types/components/VariableChipStandalone';
import { type VariablePickerComponent } from '@/object-record/record-field/ui/form-types/types/VariablePickerComponent';
import { TextInput } from '@/ui/field/input/components/TextInput';
-import { InputHint, InputLabel } from 'twenty-ui/input';
+import { Field } from 'twenty-ui/input';
import { isStandaloneVariableString } from 'twenty-shared/workflow';
import { t } from '@lingui/core/macro';
import isEmpty from 'lodash.isempty';
@@ -98,7 +98,7 @@ export const FormNumberFieldInput = ({
return (
<FormFieldInputContainer>
- {label ? <InputLabel htmlFor={instanceId}>{label}</InputLabel> : null}
+ {label ? <Field.Label htmlFor={instanceId}>{label}</Field.Label> : null}
<FormFieldInputRowContainer>
<FormFieldInputInnerContainer
@@ -135,8 +135,8 @@ export const FormNumberFieldInput = ({
) : null}
</FormFieldInputRowContainer>
- {hint ? <InputHint>{hint}</InputHint> : null}
- {error && <InputHint danger>{error}</InputHint>}
+ {hint ? <Field.Description>{hint}</Field.Description> : null}
+ {error && <Field.Error match>{error}</Field.Error>}
</FormFieldInputContainer>
);
};
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormPhoneFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormPhoneFieldInput.tsx
index 2a05188f395..573f1654f1b 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormPhoneFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormPhoneFieldInput.tsx
@@ -7,7 +7,7 @@ import { FormNestedFieldInputContainer } from '@/object-record/record-field/ui/f
import { FormNumberFieldInput } from '@/object-record/record-field/ui/form-types/components/FormNumberFieldInput';
import { type VariablePickerComponent } from '@/object-record/record-field/ui/form-types/types/VariablePickerComponent';
import { type FieldPhonesValue } from '@/object-record/record-field/ui/types/FieldMetadata';
-import { InputLabel } from 'twenty-ui/input';
+import { Field } from 'twenty-ui/input';
import { t } from '@lingui/core/macro';
import { isDefined } from 'twenty-shared/utils';
@@ -46,7 +46,7 @@ export const FormPhoneFieldInput = ({
return (
<FormFieldInputContainer>
- {label && <InputLabel>{label}</InputLabel>}
+ {label && <Field.Label>{label}</Field.Label>}
<FormNestedFieldInputContainer>
<FormCallingCodeSelectInput
label={t`Calling Code`}
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormRawJsonFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormRawJsonFieldInput.tsx
index 775d8f22455..f78cde7260e 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormRawJsonFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormRawJsonFieldInput.tsx
@@ -5,7 +5,7 @@ import { FormFieldInputRowContainer } from '@/object-record/record-field/ui/form
import { TextVariableEditor } from '@/object-record/record-field/ui/form-types/components/TextVariableEditor';
import { useTextVariableEditor } from '@/object-record/record-field/ui/form-types/hooks/useTextVariableEditor';
import { type VariablePickerComponent } from '@/object-record/record-field/ui/form-types/types/VariablePickerComponent';
-import { InputHint, InputLabel } from 'twenty-ui/input';
+import { Field } from 'twenty-ui/input';
import { useId } from 'react';
import { isDefined } from 'twenty-shared/utils';
import { turnIntoEmptyStringIfWhitespacesOnly } from '~/utils/string/turnIntoEmptyStringIfWhitespacesOnly';
@@ -69,7 +69,7 @@ export const FormRawJsonFieldInput = ({
return (
<FormFieldInputContainer className={className}>
- {label ? <InputLabel>{label}</InputLabel> : null}
+ {label ? <Field.Label>{label}</Field.Label> : null}
<FormFieldInputRowContainer multiline>
<FormFieldInputInnerContainer
@@ -89,7 +89,7 @@ export const FormRawJsonFieldInput = ({
/>
)}
</FormFieldInputRowContainer>
- {error && <InputHint danger>{error}</InputHint>}
+ {error && <Field.Error match>{error}</Field.Error>}
</FormFieldInputContainer>
);
};
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormSelectFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormSelectFieldInput.tsx
index ede44ffde99..25617088f55 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormSelectFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormSelectFieldInput.tsx
@@ -4,7 +4,7 @@ import { FormFieldInputInnerContainer } from '@/object-record/record-field/ui/fo
import { FormFieldInputRowContainer } from '@/object-record/record-field/ui/form-types/components/FormFieldInputRowContainer';
import { VariableChipStandalone } from '@/object-record/record-field/ui/form-types/components/VariableChipStandalone';
import { type VariablePickerComponent } from '@/object-record/record-field/ui/form-types/types/VariablePickerComponent';
-import { InputHint, InputLabel, type SelectOption } from 'twenty-ui/input';
+import { Field, type SelectOption } from 'twenty-ui/input';
import { type CallToActionButton, Select } from '@/ui/input/components/Select';
import { GenericDropdownContentWidth } from '@/ui/layout/dropdown/constants/GenericDropdownContentWidth';
import { useRemoveFocusItemFromFocusStackById } from '@/ui/utilities/focus/hooks/useRemoveFocusItemFromFocusStackById';
@@ -135,7 +135,7 @@ export const FormSelectFieldInput = ({
return (
<FormFieldInputContainer>
- {label ? <InputLabel>{label}</InputLabel> : null}
+ {label ? <Field.Label>{label}</Field.Label> : null}
<FormFieldInputRowContainer>
{draftValue.type === 'static' ? (
@@ -173,7 +173,7 @@ export const FormSelectFieldInput = ({
/>
)}
</FormFieldInputRowContainer>
- {hint && <InputHint>{hint}</InputHint>}
+ {hint && <Field.Description>{hint}</Field.Description>}
</FormFieldInputContainer>
);
};
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormSingleRecordPicker.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormSingleRecordPicker.tsx
index fbfa3dbe802..c588b859d92 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormSingleRecordPicker.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormSingleRecordPicker.tsx
@@ -12,7 +12,7 @@ import { SingleRecordPicker } from '@/object-record/record-picker/single-record-
import { singleRecordPickerSearchFilterComponentState } from '@/object-record/record-picker/single-record-picker/states/singleRecordPickerSearchFilterComponentState';
import { singleRecordPickerSelectedIdComponentState } from '@/object-record/record-picker/single-record-picker/states/singleRecordPickerSelectedIdComponentState';
import { type RecordPickerPickableMorphItem } from '@/object-record/record-picker/types/RecordPickerPickableMorphItem';
-import { InputLabel } from 'twenty-ui/input';
+import { Field } from 'twenty-ui/input';
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
import { GenericDropdownContentWidth } from '@/ui/layout/dropdown/constants/GenericDropdownContentWidth';
import { useCloseDropdown } from '@/ui/layout/dropdown/hooks/useCloseDropdown';
@@ -197,7 +197,7 @@ export const FormSingleRecordPicker = ({
return (
<FormFieldInputContainer data-testid={testId}>
- {label ? <InputLabel>{label}</InputLabel> : null}
+ {label ? <Field.Label>{label}</Field.Label> : null}
<FormFieldInputRowContainer>
{disabled ? (
<StyledFormSelectContainerWrapper readonly>
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormTextFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormTextFieldInput.tsx
index 31f5d2d4ab4..b605cc10709 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormTextFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormTextFieldInput.tsx
@@ -5,7 +5,7 @@ import { FormFieldInputRowContainer } from '@/object-record/record-field/ui/form
import { TextVariableEditor } from '@/object-record/record-field/ui/form-types/components/TextVariableEditor';
import { useTextVariableEditor } from '@/object-record/record-field/ui/form-types/hooks/useTextVariableEditor';
import { type VariablePickerComponent } from '@/object-record/record-field/ui/form-types/types/VariablePickerComponent';
-import { InputHint, InputLabel } from 'twenty-ui/input';
+import { Field } from 'twenty-ui/input';
import { parseEditorContent } from '@/workflow/workflow-variables/utils/parseEditorContent';
import { useId } from 'react';
import { isDefined } from 'twenty-shared/utils';
@@ -66,7 +66,7 @@ export const FormTextFieldInput = ({
return (
<FormFieldInputContainer>
- {label ? <InputLabel>{label}</InputLabel> : null}
+ {label ? <Field.Label>{label}</Field.Label> : null}
<FormFieldInputRowContainer multiline={multiline}>
<FormFieldInputInnerContainer
@@ -90,8 +90,8 @@ export const FormTextFieldInput = ({
/>
) : null}
</FormFieldInputRowContainer>
- {hint && <InputHint>{hint}</InputHint>}
- {error && <InputHint danger>{error}</InputHint>}
+ {hint && <Field.Description>{hint}</Field.Description>}
+ {error && <Field.Error match>{error}</Field.Error>}
</FormFieldInputContainer>
);
};
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormUuidFieldInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormUuidFieldInput.tsx
index 6121fb2307d..25fdeac17b5 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormUuidFieldInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormUuidFieldInput.tsx
@@ -4,7 +4,7 @@ import { FormFieldInputRowContainer } from '@/object-record/record-field/ui/form
import { VariableChipStandalone } from '@/object-record/record-field/ui/form-types/components/VariableChipStandalone';
import { type VariablePickerComponent } from '@/object-record/record-field/ui/form-types/types/VariablePickerComponent';
import { TextInput } from '@/ui/field/input/components/TextInput';
-import { InputLabel } from 'twenty-ui/input';
+import { Field } from 'twenty-ui/input';
import { isStandaloneVariableString } from 'twenty-shared/workflow';
import { t } from '@lingui/core/macro';
import { useId, useState } from 'react';
@@ -87,7 +87,7 @@ export const FormUuidFieldInput = ({
return (
<FormFieldInputContainer>
- {label ? <InputLabel htmlFor={instanceId}>{label}</InputLabel> : null}
+ {label ? <Field.Label htmlFor={instanceId}>{label}</Field.Label> : null}
<FormFieldInputRowContainer>
<FormFieldInputInnerContainer
diff --git a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormWorkspaceMemberFilterValueInput.tsx b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormWorkspaceMemberFilterValueInput.tsx
index a52ada64fdc..76ffcb6f60f 100644
--- a/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormWorkspaceMemberFilterValueInput.tsx
+++ b/packages/twenty-front/src/modules/object-record/record-field/ui/form-types/components/FormWorkspaceMemberFilterValueInput.tsx
@@ -29,7 +29,7 @@ import {
} from '@/object-record/record-field/ui/form-types/utils/parseWorkspaceMemberFilterValue';
import { useRecordsForSelect } from '@/object-record/select/hooks/useRecordsForSelect';
import { type SelectableItem } from '@/object-record/select/types/SelectableItem';
-import { InputLabel } from 'twenty-ui/input';
+import { Field } from 'twenty-ui/input';
import { Dropdown } from '@/ui/layout/dropdown/components/Dropdown';
import { isStandaloneVariableString } from 'twenty-shared/workflow';
@@ -233,7 +233,7 @@ export const FormWorkspaceMemberFilterValueInput = ({
return (
<FormFieldInputContainer>
- {label ? <InputLabel>{label}</InputLabel> : null}
+ {label ? <Field.Label>{label}</Field.Label> : null}
<FormFieldInputRowContainer>
{readonly ? (
<StyledFormSelectContainerWrapper readonly>
diff --git a/packages/twenty-front/src/modules/ui/input/components/FormFieldInputContainer.tsx b/packages/twenty-front/src/modules/ui/input/components/FormFieldInputContainer.tsx
index bb76e956daa..b113695ccfc 100644
--- a/packages/twenty-front/src/modules/ui/input/components/FormFieldInputContainer.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/FormFieldInputContainer.tsx
@@ -1,6 +1,7 @@
import { styled } from '@linaria/react';
+import { Field } from 'twenty-ui/input';
-const StyledFormFieldInputContainer = styled.div`
+const StyledFormFieldInputContainer = styled(Field.Root)`
display: flex;
flex-direction: column;
width: 100%;
diff --git a/packages/twenty-front/src/modules/ui/input/components/TextInput.tsx b/packages/twenty-front/src/modules/ui/input/components/TextInput.tsx
index 6006b4c51eb..95e0f938a88 100644
--- a/packages/twenty-front/src/modules/ui/input/components/TextInput.tsx
+++ b/packages/twenty-front/src/modules/ui/input/components/TextInput.tsx
@@ -1,4 +1,4 @@
-import { InputHint, InputLabel } from 'twenty-ui/input';
+import { Field } from 'twenty-ui/input';
import { isNonEmptyString } from '@sniptt/guards';
import { isDefined } from 'twenty-shared/utils';
import { css } from '@linaria/core';
@@ -30,6 +30,10 @@ const StyledErrorHelper = styled.div`
position: absolute;
`;
+const fieldRootClassName = css`
+ display: contents;
+`;
+
const StyledInputContainer = styled.div`
align-items: center;
background-color: inherit;
@@ -313,101 +317,106 @@ const TextInputComponent = forwardRef<
const instanceId = useId();
return (
- <StyledContainer
- className={className}
- fullWidth={fullWidth ?? false}
- data-click-outside-id={textClickOutsideId}
- >
- {label && (
- <InputLabel htmlFor={instanceId}>
- {label + (required ? '*' : '')}
- </InputLabel>
- )}
- <StyledInputContainer>
- {leftAdornment && (
- <StyledAdornmentContainer sizeVariant={sizeVariant} position="left">
- {leftAdornment}
- </StyledAdornmentContainer>
- )}
-
- {!!LeftIcon && (
- <StyledLeftIconContainer sizeVariant={sizeVariant}>
- <StyledTrailingIcon isFocused={isFocused}>
- <LeftIcon size={theme.icon.size.md} />
- </StyledTrailingIcon>
- </StyledLeftIconContainer>
- )}
-
- <StyledInput
- id={instanceId}
- width={width}
- data-testid={dataTestId}
- autoComplete={autoComplete ?? 'off'}
- ref={combinedRef}
- tabIndex={tabIndex ?? 0}
- onFocus={handleFocus}
- onBlur={handleBlur}
- type={passwordVisible ? 'text' : type}
- onChange={(event: ChangeEvent<HTMLInputElement>) => {
- onChange?.(
- turnIntoEmptyStringIfWhitespacesOnly(event.target.value),
- );
- }}
- onKeyDown={onKeyDown}
- {...{
- autoFocus,
- disabled,
- readOnly,
- placeholder,
- required,
- value,
- LeftIcon,
- RightIcon,
- maxLength,
- error,
- sizeVariant,
- inheritFontStyles,
- autoGrow,
- leftAdornment,
- rightAdornment,
- }}
- />
- {rightAdornment && (
- <StyledAdornmentContainer
- sizeVariant={sizeVariant}
- position="right"
- >
- {rightAdornment}
- </StyledAdornmentContainer>
+ <Field.Root className={fieldRootClassName}>
+ <StyledContainer
+ className={className}
+ fullWidth={fullWidth ?? false}
+ data-click-outside-id={textClickOutsideId}
+ >
+ {label && (
+ <Field.Label htmlFor={instanceId}>
+ {label + (required ? '*' : '')}
+ </Field.Label>
)}
- <StyledTrailingIconContainer {...{ error }}>
- {!error && type === INPUT_TYPE_PASSWORD && (
- <StyledTrailingIcon
- onClick={handleTogglePasswordVisibility}
- data-testid="reveal-password-button"
+ <StyledInputContainer>
+ {leftAdornment && (
+ <StyledAdornmentContainer
+ sizeVariant={sizeVariant}
+ position="left"
>
- {passwordVisible ? (
- <IconEyeOff size={theme.icon.size.md} />
- ) : (
- <IconEye size={theme.icon.size.md} />
- )}
- </StyledTrailingIcon>
+ {leftAdornment}
+ </StyledAdornmentContainer>
+ )}
+
+ {!!LeftIcon && (
+ <StyledLeftIconContainer sizeVariant={sizeVariant}>
+ <StyledTrailingIcon isFocused={isFocused}>
+ <LeftIcon size={theme.icon.size.md} />
+ </StyledTrailingIcon>
+ </StyledLeftIconContainer>
)}
- {!error && type !== INPUT_TYPE_PASSWORD && !!RightIcon && (
- <StyledTrailingIcon
- onClick={onRightIconClick ? onRightIconClick : undefined}
+
+ <StyledInput
+ id={instanceId}
+ width={width}
+ data-testid={dataTestId}
+ autoComplete={autoComplete ?? 'off'}
+ ref={combinedRef}
+ tabIndex={tabIndex ?? 0}
+ onFocus={handleFocus}
+ onBlur={handleBlur}
+ type={passwordVisible ? 'text' : type}
+ onChange={(event: ChangeEvent<HTMLInputElement>) => {
+ onChange?.(
+ turnIntoEmptyStringIfWhitespacesOnly(event.target.value),
+ );
+ }}
+ onKeyDown={onKeyDown}
+ {...{
+ autoFocus,
+ disabled,
+ readOnly,
+ placeholder,
+ required,
+ value,
+ LeftIcon,
+ RightIcon,
+ maxLength,
+ error,
+ sizeVariant,
+ inheritFontStyles,
+ autoGrow,
+ leftAdornment,
+ rightAdornment,
+ }}
+ />
+ {rightAdornment && (
+ <StyledAdornmentContainer
+ sizeVariant={sizeVariant}
+ position="right"
>
- <RightIcon size={theme.icon.size.md} />
- </StyledTrailingIcon>
+ {rightAdornment}
+ </StyledAdornmentContainer>
)}
- </StyledTrailingIconContainer>
- </StyledInputContainer>
- {!noErrorHelper && error && (
- <StyledErrorHelper aria-live="polite">
- <InputHint danger>{error}</InputHint>
- </StyledErrorHelper>
- )}
- </StyledContainer>
+ <StyledTrailingIconContainer {...{ error }}>
+ {!error && type === INPUT_TYPE_PASSWORD && (
+ <StyledTrailingIcon
+ onClick={handleTogglePasswordVisibility}
+ data-testid="reveal-password-button"
+ >
+ {passwordVisible ? (
+ <IconEyeOff size={theme.icon.size.md} />
+ ) : (
+ <IconEye size={theme.icon.size.md} />
+ )}
+ </StyledTrailingIcon>
+ )}
+ {!error && type !== INPUT_TYPE_PASSWORD && !!RightIcon && (
+ <StyledTrailingIcon
+ onClick={onRightIconClick ? onRightIconClick : undefined}
+ >
+ <RightIcon size={theme.icon.size.md} />
+ </StyledTrailingIcon>
+ )}
+ </StyledTrailingIconContainer>
+ </StyledInputContainer>
+ {!noErrorHelper && error && (
+ <StyledErrorHelper aria-live="polite">
+ <Field.Error match>{error}</Field.Error>
+ </StyledErrorHelper>
+ )}
+ </StyledContainer>
+ </Field.Root>
);
},
);
diff --git a/packages/twenty-ui/src/input/Field/Field.tsx b/packages/twenty-ui/src/input/Field/Field.tsx
new file mode 100644
index 00000000000..f2ff78f3e01
--- /dev/null
+++ b/packages/twenty-ui/src/input/Field/Field.tsx
@@ -0,0 +1,14 @@
+import { Field as FieldPrimitive } from '@base-ui/react/field';
+
+import { FieldDescription } from './internal/FieldDescription';
+import { FieldError } from './internal/FieldError';
+import { FieldLabel } from './internal/FieldLabel';
+
+export const Field = {
+ Root: FieldPrimitive.Root,
+ Label: FieldLabel,
+ Control: FieldPrimitive.Control,
+ Description: FieldDescription,
+ Error: FieldError,
+ Validity: FieldPrimitive.Validity,
+};
diff --git a/packages/twenty-ui/src/input/Field/__stories__/Field.stories.tsx b/packages/twenty-ui/src/input/Field/__stories__/Field.stories.tsx
new file mode 100644
index 00000000000..92f90f76946
--- /dev/null
+++ b/packages/twenty-ui/src/input/Field/__stories__/Field.stories.tsx
@@ -0,0 +1,35 @@
+import { type Meta, type StoryObj } from '@storybook/react-vite';
+
+import { A11Y_DEFER_COLOR_CONTRAST, ComponentDecorator } from '@ui/testing';
+
+import { Field } from '@ui/input/Field/Field';
+
+const meta: Meta<typeof Field.Root> = {
+ title: 'UI/Input/Field',
+ component: Field.Root,
+ decorators: [ComponentDecorator],
+};
+
+export default meta;
+
+type Story = StoryObj<typeof Field.Root>;
+
+export const Default: Story = {
+ parameters: { a11y: A11Y_DEFER_COLOR_CONTRAST },
+ render: () => (
+ <Field.Root>
+ <Field.Label>Label</Field.Label>
+ <Field.Description>This is a hint</Field.Description>
+ </Field.Root>
+ ),
+};
+
+export const WithError: Story = {
+ parameters: { a11y: A11Y_DEFER_COLOR_CONTRAST },
+ render: () => (
+ <Field.Root>
+ <Field.Label>Label</Field.Label>
+ <Field.Error match>This field is required</Field.Error>
+ </Field.Root>
+ ),
+};
diff --git a/packages/twenty-ui/src/input/Field/internal/FieldDescription.module.scss b/packages/twenty-ui/src/input/Field/internal/FieldDescription.module.scss
new file mode 100644
index 00000000000..62ce6f6093c
--- /dev/null
+++ b/packages/twenty-ui/src/input/Field/internal/FieldDescription.module.scss
@@ -0,0 +1,6 @@
+.description {
+ color: var(--t-font-color-light);
+ font-size: var(--t-font-size-xs);
+ font-weight: var(--t-font-weight-regular);
+ margin: var(--t-spacing-0_5) 0 0;
+}
diff --git a/packages/twenty-ui/src/input/Field/internal/FieldDescription.module.scss.d.ts b/packages/twenty-ui/src/input/Field/internal/FieldDescription.module.scss.d.ts
new file mode 100644
index 00000000000..7e55a3e7c61
--- /dev/null
+++ b/packages/twenty-ui/src/input/Field/internal/FieldDescription.module.scss.d.ts
@@ -0,0 +1,4 @@
+declare const classNames: {
+ readonly description: 'description';
+};
+export default classNames;
diff --git a/packages/twenty-ui/src/input/Field/internal/FieldDescription.tsx b/packages/twenty-ui/src/input/Field/internal/FieldDescription.tsx
new file mode 100644
index 00000000000..776d0d53e15
--- /dev/null
+++ b/packages/twenty-ui/src/input/Field/internal/FieldDescription.tsx
@@ -0,0 +1,23 @@
+import { Field as FieldPrimitive } from '@base-ui/react/field';
+import { forwardRef } from 'react';
+
+import styles from './FieldDescription.module.scss';
+import { mergeFieldPartClassName } from './mergeFieldPartClassName';
+
+type FieldDescriptionProps = React.ComponentPropsWithoutRef<
+ typeof FieldPrimitive.Description
+>;
+
+export const FieldDescription = forwardRef<
+ React.ElementRef<typeof FieldPrimitive.Description>,
+ FieldDescriptionProps
+>(({ className, ...props }, ref) => (
+ <FieldPrimitive.Description
+ ref={ref}
+ className={mergeFieldPartClassName(styles.description, className)}
+ // oxlint-disable-next-line react/jsx-props-no-spreading
+ {...props}
+ />
+));
+
+FieldDescription.displayName = 'FieldDescription';
diff --git a/packages/twenty-ui/src/input/Field/internal/FieldError.module.scss b/packages/twenty-ui/src/input/Field/internal/FieldError.module.scss
new file mode 100644
index 00000000000..74613c44e09
--- /dev/null
+++ b/packages/twenty-ui/src/input/Field/internal/FieldError.module.scss
@@ -0,0 +1,6 @@
+.error {
+ color: var(--t-font-color-danger);
+ font-size: var(--t-font-size-xs);
+ font-weight: var(--t-font-weight-regular);
+ margin: var(--t-spacing-0_5) 0 0;
+}
diff --git a/packages/twenty-ui/src/input/Field/internal/FieldError.module.scss.d.ts b/packages/twenty-ui/src/input/Field/internal/FieldError.module.scss.d.ts
new file mode 100644
index 00000000000..dc39265c18a
--- /dev/null
+++ b/packages/twenty-ui/src/input/Field/internal/FieldError.module.scss.d.ts
@@ -0,0 +1,4 @@
+declare const classNames: {
+ readonly error: 'error';
+};
+export default classNames;
diff --git a/packages/twenty-ui/src/input/Field/internal/FieldError.tsx b/packages/twenty-ui/src/input/Field/internal/FieldError.tsx
new file mode 100644
index 00000000000..ae026505ab8
--- /dev/null
+++ b/packages/twenty-ui/src/input/Field/internal/FieldError.tsx
@@ -0,0 +1,23 @@
+import { Field as FieldPrimitive } from '@base-ui/react/field';
+import { forwardRef } from 'react';
+
+import styles from './FieldError.module.scss';
+import { mergeFieldPartClassName } from './mergeFieldPartClassName';
+
+type FieldErrorProps = React.ComponentPropsWithoutRef<
+ typeof FieldPrimitive.Error
+>;
+
+export const FieldError = forwardRef<
+ React.ElementRef<typeof FieldPrimitive.Error>,
+ FieldErrorProps
+>(({ className, ...props }, ref) => (
+ <FieldPrimitive.Error
+ ref={ref}
+ className={mergeFieldPartClassName(styles.error, className)}
+ // oxlint-disable-next-line react/jsx-props-no-spreading
+ {...props}
+ />
+));
+
+FieldError.displayName = 'FieldError';
diff --git a/packages/twenty-ui/src/input/Field/internal/FieldLabel.module.scss b/packages/twenty-ui/src/input/Field/internal/FieldLabel.module.scss
new file mode 100644
index 00000000000..de60e7cfe68
--- /dev/null
+++ b/packages/twenty-ui/src/input/Field/internal/FieldLabel.module.scss
@@ -0,0 +1,7 @@
+.label {
+ color: var(--t-font-color-light);
+ display: block;
+ font-size: 11px;
+ font-weight: var(--t-font-weight-semi-bold);
+ margin-bottom: var(--t-spacing-1);
+}
diff --git a/packages/twenty-ui/src/input/Field/internal/FieldLabel.module.scss.d.ts b/packages/twenty-ui/src/input/Field/internal/FieldLabel.module.scss.d.ts
new file mode 100644
index 00000000000..2bc360f7d84
--- /dev/null
+++ b/packages/twenty-ui/src/input/Field/internal/FieldLabel.module.scss.d.ts
@@ -0,0 +1,4 @@
+declare const classNames: {
+ readonly label: 'label';
+};
+export default classNames;
diff --git a/packages/twenty-ui/src/input/Field/internal/FieldLabel.tsx b/packages/twenty-ui/src/input/Field/internal/FieldLabel.tsx
new file mode 100644
index 00000000000..eaaea37d736
--- /dev/null
+++ b/packages/twenty-ui/src/input/Field/internal/FieldLabel.tsx
@@ -0,0 +1,23 @@
+import { Field as FieldPrimitive } from '@base-ui/react/field';
+import { forwardRef } from 'react';
+
+import styles from './FieldLabel.module.scss';
+import { mergeFieldPartClassName } from './mergeFieldPartClassName';
+
+type FieldLabelProps = React.ComponentPropsWithoutRef<
+ typeof FieldPrimitive.Label
+>;
+
+export const FieldLabel = forwardRef<
+ React.ElementRef<typeof FieldPrimitive.Label>,
+ FieldLabelProps
+>(({ className, ...props }, ref) => (
+ <FieldPrimitive.Label
+ ref={ref}
+ className={mergeFieldPartClassName(styles.label, className)}
+ // oxlint-disable-next-line react/jsx-props-no-spreading
+ {...props}
+ />
+));
+
+FieldLabel.displayName = 'FieldLabel';
diff --git a/packages/twenty-ui/src/input/Field/internal/mergeFieldPartClassName.ts b/packages/twenty-ui/src/input/Field/internal/mergeFieldPartClassName.ts
new file mode 100644
index 00000000000..0be1b5b4d38
--- /dev/null
+++ b/packages/twenty-ui/src/input/Field/internal/mergeFieldPartClassName.ts
@@ -0,0 +1,10 @@
+import { isFunction } from '@sniptt/guards';
+import { clsx } from 'clsx';
+
+export const mergeFieldPartClassName =
+ <TState>(
+ partClassName: string,
+ className: string | ((state: TState) => string | undefined) | undefined,
+ ) =>
+ (state: TState) =>
+ clsx(partClassName, isFunction(className) ? className(state) : className);
diff --git a/packages/twenty-ui/src/input/InputHint/InputHint.tsx b/packages/twenty-ui/src/input/InputHint/InputHint.tsx
index c9108c5e0a8..182b0c39b4f 100644
--- a/packages/twenty-ui/src/input/InputHint/InputHint.tsx
+++ b/packages/twenty-ui/src/input/InputHint/InputHint.tsx
@@ -8,6 +8,9 @@ type InputHintProps = {
danger?: boolean;
};
+/**
+ * @deprecated Inside `Field.Root` (from `twenty-ui/input`), use `Field.Description` for hints or `Field.Error` for errors (replaces `danger`).
+ */
export const InputHint = ({ children, className, danger }: InputHintProps) => (
<div className={clsx(styles.hint, danger && styles.danger, className)}>
{children}
diff --git a/packages/twenty-ui/src/input/InputLabel/InputLabel.tsx b/packages/twenty-ui/src/input/InputLabel/InputLabel.tsx
index 1b6e74ba061..450721237e7 100644
--- a/packages/twenty-ui/src/input/InputLabel/InputLabel.tsx
+++ b/packages/twenty-ui/src/input/InputLabel/InputLabel.tsx
@@ -8,6 +8,9 @@ type InputLabelProps = {
htmlFor?: string;
};
+/**
+ * @deprecated Compose `Field.Label` inside `Field.Root` (from `twenty-ui/input`) instead.
+ */
export const InputLabel = ({
children,
className,
diff --git a/packages/twenty-ui/src/input/index.ts b/packages/twenty-ui/src/input/index.ts
index 1e1d51c8fb4..5c1b5c1ea60 100644
--- a/packages/twenty-ui/src/input/index.ts
+++ b/packages/twenty-ui/src/input/index.ts
@@ -44,6 +44,7 @@ export type {
export { ColorSchemeCard } from './ColorSchemeCard/ColorSchemeCard';
export type { ColorSchemePickerProps } from './ColorSchemePicker/ColorSchemePicker';
export { ColorSchemePicker } from './ColorSchemePicker/ColorSchemePicker';
+export { Field } from './Field/Field';
export type {
FloatingButtonSize,
FloatingButtonPosition,