diff --git a/docs/admin/fields.mdx b/docs/admin/fields.mdx
index 0af47f73f..c330f6569 100644
--- a/docs/admin/fields.mdx
+++ b/docs/admin/fields.mdx
@@ -347,31 +347,13 @@ Custom Label Components receive all [Field Component](#the-field-component) prop
#### TypeScript
-When building Custom Label Components, you can import the component props to ensure type safety in your component. There is an explicit type for the Label Component, one for every [Field Type](../fields/overview). The convention is to append `LabelComponent` to the type of field, i.e. `TextFieldLabelComponent`.
+When building Custom Label Components, you can import the component props to ensure type safety in your component. There is an explicit type for the Label Component, one for every [Field Type](../fields/overview) and server/client environment. The convention is to append `LabelServerComponent` or `LabelClientComponent` to the type of field, i.e. `TextFieldLabelClientComponent`.
```tsx
import type {
- ArrayFieldLabelComponent,
- BlocksFieldLabelComponent,
- CheckboxFieldLabelComponent,
- CodeFieldLabelComponent,
- CollapsibleFieldLabelComponent,
- DateFieldLabelComponent,
- EmailFieldLabelComponent,
- GroupFieldLabelComponent,
- HiddenFieldLabelComponent,
- JSONFieldLabelComponent,
- NumberFieldLabelComponent,
- PointFieldLabelComponent,
- RadioFieldLabelComponent,
- RelationshipFieldLabelComponent,
- RichTextFieldLabelComponent,
- RowFieldLabelComponent,
- SelectFieldLabelComponent,
- TabsFieldLabelComponent,
- TextFieldLabelComponent,
- TextareaFieldLabelComponent,
- UploadFieldLabelComponent
+ TextFieldLabelServerComponent,
+ TextFieldLabelClientComponent,
+ // And so on for each Field Type
} from 'payload'
```
@@ -410,31 +392,13 @@ Custom Error Components receive all [Field Component](#the-field-component) prop
#### TypeScript
-When building Custom Error Components, you can import the component props to ensure type safety in your component. There is an explicit type for the Error Component, one for every [Field Type](../fields/overview). The convention is to append `ErrorComponent` to the type of field, i.e. `TextFieldErrorComponent`.
+When building Custom Error Components, you can import the component props to ensure type safety in your component. There is an explicit type for the Error Component, one for every [Field Type](../fields/overview) and server/client environment. The convention is to append `ErrorServerComponent` or `ErrorClientComponent` to the type of field, i.e. `TextFieldErrorClientComponent`.
```tsx
import type {
- ArrayFieldErrorComponent,
- BlocksFieldErrorComponent,
- CheckboxFieldErrorComponent,
- CodeFieldErrorComponent,
- CollapsibleFieldErrorComponent,
- DateFieldErrorComponent,
- EmailFieldErrorComponent,
- GroupFieldErrorComponent,
- HiddenFieldErrorComponent,
- JSONFieldErrorComponent,
- NumberFieldErrorComponent,
- PointFieldErrorComponent,
- RadioFieldErrorComponent,
- RelationshipFieldErrorComponent,
- RichTextFieldErrorComponent,
- RowFieldErrorComponent,
- SelectFieldErrorComponent,
- TabsFieldErrorComponent,
- TextFieldErrorComponent,
- TextareaFieldErrorComponent,
- UploadFieldErrorComponent
+ TextFieldErrorServerComponent,
+ TextFieldErrorClientComponent,
+ // And so on for each Field Type
} from 'payload'
```
@@ -544,31 +508,13 @@ Custom Description Components receive all [Field Component](#the-field-component
#### TypeScript
-When building Custom Description Components, you can import the component props to ensure type safety in your component. There is an explicit type for the Description Component, one for every [Field Type](../fields/overview). The convention is to append `DescriptionComponent` to the type of field, i.e. `TextFieldDescriptionComponent`.
+When building Custom Description Components, you can import the component props to ensure type safety in your component. There is an explicit type for the Description Component, one for every [Field Type](../fields/overview) and server/client environment. The convention is to append `DescriptionServerComponent` or `DescriptionClientComponent` to the type of field, i.e. `TextFieldDescriptionClientComponent`.
```tsx
import type {
- ArrayFieldDescriptionComponent,
- BlocksFieldDescriptionComponent,
- CheckboxFieldDescriptionComponent,
- CodeFieldDescriptionComponent,
- CollapsibleFieldDescriptionComponent,
- DateFieldDescriptionComponent,
- EmailFieldDescriptionComponent,
- GroupFieldDescriptionComponent,
- HiddenFieldDescriptionComponent,
- JSONFieldDescriptionComponent,
- NumberFieldDescriptionComponent,
- PointFieldDescriptionComponent,
- RadioFieldDescriptionComponent,
- RelationshipFieldDescriptionComponent,
- RichTextFieldDescriptionComponent,
- RowFieldDescriptionComponent,
- SelectFieldDescriptionComponent,
- TabsFieldDescriptionComponent,
- TextFieldDescriptionComponent,
- TextareaFieldDescriptionComponent,
- UploadFieldDescriptionComponent
+ TextFieldDescriptionServerComponent,
+ TextFieldDescriptionClientComponent,
+ // And so on for each Field Type
} from 'payload'
```
diff --git a/docs/migration-guide/overview.mdx b/docs/migration-guide/overview.mdx
index de376d1f0..fd2e0db7c 100644
--- a/docs/migration-guide/overview.mdx
+++ b/docs/migration-guide/overview.mdx
@@ -467,10 +467,10 @@ export const ServerRenderedDescription = () =>
// file: components/ClientRenderedDescription.tsx
'use client'
import React from 'react'
-import type { DescriptionComponent } from 'payload'
+import type { TextFieldDescriptionClientComponent } from 'payload'
import { useFieldProps, useFormFields } from '@payloadcms/ui'
-export const ClientRenderedDescription: DescriptionComponent = () ={
+export const ClientRenderedDescription: TextFieldDescriptionClientComponent = () ={
const { path } = useFieldProps()
const { value } = useFormFields(([fields]) => fields[path])
const customDescription = `Component description: ${path} - ${value}`
diff --git a/packages/next/src/elements/DocumentHeader/Tabs/index.tsx b/packages/next/src/elements/DocumentHeader/Tabs/index.tsx
index 966d15cec..67252a2f4 100644
--- a/packages/next/src/elements/DocumentHeader/Tabs/index.tsx
+++ b/packages/next/src/elements/DocumentHeader/Tabs/index.tsx
@@ -7,7 +7,6 @@ import type {
} from 'payload'
import { RenderComponent, getCreateMappedComponent } from '@payloadcms/ui/shared'
-import { isPlainObject } from 'payload'
import React from 'react'
import { ShouldRenderTabs } from './ShouldRenderTabs.js'
diff --git a/packages/next/src/views/Account/Settings/index.tsx b/packages/next/src/views/Account/Settings/index.tsx
index ffce5ff15..013793951 100644
--- a/packages/next/src/views/Account/Settings/index.tsx
+++ b/packages/next/src/views/Account/Settings/index.tsx
@@ -11,9 +11,9 @@ import './index.scss'
const baseClass = 'payload-settings'
export const Settings: React.FC<{
- className?: string
- i18n: I18n
- languageOptions: LanguageOptions
+ readonly className?: string
+ readonly i18n: I18n
+ readonly languageOptions: LanguageOptions
}> = (props) => {
const { className, i18n, languageOptions } = props
@@ -21,7 +21,7 @@ export const Settings: React.FC<{
{i18n.t('general:payloadSettings')}
-
+
diff --git a/packages/next/src/views/Document/getViewsFromConfig.tsx b/packages/next/src/views/Document/getViewsFromConfig.tsx
index 5f41d2398..ee6d512c6 100644
--- a/packages/next/src/views/Document/getViewsFromConfig.tsx
+++ b/packages/next/src/views/Document/getViewsFromConfig.tsx
@@ -128,8 +128,6 @@ export const getViewsFromConfig = ({
views,
})
- console.log('CustomViewComponent', customViewKey)
-
if (customViewKey) {
viewKey = customViewKey
diff --git a/packages/next/src/views/Edit/Default/Auth/APIKey.tsx b/packages/next/src/views/Edit/Default/Auth/APIKey.tsx
index 9ac99de73..5d233240a 100644
--- a/packages/next/src/views/Edit/Default/Auth/APIKey.tsx
+++ b/packages/next/src/views/Edit/Default/Auth/APIKey.tsx
@@ -129,6 +129,7 @@ export const APIKey: React.FC<{ readonly enabled: boolean; readonly readOnly?: b
Component: null,
RenderedComponent: APIKeyLabel,
}}
+ field={null}
htmlFor={path}
/>
+
export type ArrayFieldProps = {
readonly CustomRowLabel?: MappedComponent
- readonly field: MarkOptional
readonly validate?: ArrayFieldValidation
-} & Omit
+} & Omit, 'validate'>
-export type ArrayFieldLabelComponent = LabelComponent<'array'>
+export type ArrayFieldLabelServerComponent = FieldLabelServerComponent
-export type ArrayFieldDescriptionComponent = DescriptionComponent<'array'>
+export type ArrayFieldLabelClientComponent = FieldLabelClientComponent
-export type ArrayFieldErrorComponent = ErrorComponent<'array'>
+export type ArrayFieldDescriptionServerComponent = FieldDescriptionServerComponent
+
+export type ArrayFieldDescriptionClientComponent =
+ FieldDescriptionClientComponent
+
+export type ArrayFieldErrorServerComponent = FieldErrorServerComponent
+
+export type ArrayFieldErrorClientComponent = FieldErrorClientComponent
diff --git a/packages/payload/src/admin/fields/Blocks.ts b/packages/payload/src/admin/fields/Blocks.ts
index 723beef88..c81d03b7d 100644
--- a/packages/payload/src/admin/fields/Blocks.ts
+++ b/packages/payload/src/admin/fields/Blocks.ts
@@ -1,17 +1,31 @@
import type { MarkOptional } from 'ts-essentials'
-import type { BlockFieldClient } from '../../fields/config/types.js'
+import type { BlockField, BlockFieldClient } from '../../fields/config/types.js'
import type { BlockFieldValidation } from '../../fields/validations.js'
-import type { ErrorComponent } from '../forms/Error.js'
-import type { DescriptionComponent, FormFieldBase, LabelComponent } from '../types.js'
+import type { FieldErrorClientComponent, FieldErrorServerComponent } from '../forms/Error.js'
+import type {
+ FieldDescriptionClientComponent,
+ FieldDescriptionServerComponent,
+ FieldLabelClientComponent,
+ FieldLabelServerComponent,
+ FormFieldBase,
+} from '../types.js'
+
+type BlocksFieldClientWithoutType = MarkOptional
export type BlockFieldProps = {
- readonly field: MarkOptional
readonly validate?: BlockFieldValidation
-} & Omit
+} & Omit, 'validate'>
-export type BlockFieldLabelComponent = LabelComponent<'blocks'>
+export type BlockFieldLabelServerComponent = FieldLabelServerComponent
-export type BlockFieldDescriptionComponent = DescriptionComponent<'blocks'>
+export type BlockFieldLabelClientComponent = FieldLabelClientComponent
-export type BlockFieldErrorComponent = ErrorComponent<'blocks'>
+export type BlockFieldDescriptionServerComponent = FieldDescriptionServerComponent
+
+export type BlockFieldDescriptionClientComponent =
+ FieldDescriptionClientComponent
+
+export type BlockFieldErrorServerComponent = FieldErrorServerComponent
+
+export type BlockFieldErrorClientComponent = FieldErrorClientComponent
diff --git a/packages/payload/src/admin/fields/Checkbox.ts b/packages/payload/src/admin/fields/Checkbox.ts
index 4b1dc2a2f..59d8de2dc 100644
--- a/packages/payload/src/admin/fields/Checkbox.ts
+++ b/packages/payload/src/admin/fields/Checkbox.ts
@@ -1,22 +1,38 @@
import type { MarkOptional } from 'ts-essentials'
-import type { CheckboxFieldClient } from '../../fields/config/types.js'
+import type { CheckboxField, CheckboxFieldClient } from '../../fields/config/types.js'
import type { CheckboxFieldValidation } from '../../fields/validations.js'
-import type { ErrorComponent } from '../forms/Error.js'
-import type { DescriptionComponent, FormFieldBase, LabelComponent } from '../types.js'
+import type { FieldErrorClientComponent, FieldErrorServerComponent } from '../forms/Error.js'
+import type {
+ FieldDescriptionClientComponent,
+ FieldDescriptionServerComponent,
+ FieldLabelClientComponent,
+ FieldLabelServerComponent,
+ FormFieldBase,
+} from '../types.js'
+
+type CheckboxFieldClientWithoutType = MarkOptional
export type CheckboxFieldProps = {
readonly checked?: boolean
readonly disableFormData?: boolean
- readonly field: MarkOptional
readonly id?: string
readonly onChange?: (value: boolean) => void
readonly partialChecked?: boolean
readonly validate?: CheckboxFieldValidation
-} & Omit
+} & Omit, 'validate'>
-export type CheckboxFieldLabelComponent = LabelComponent<'checkbox'>
+export type CheckboxFieldLabelServerComponent = FieldLabelServerComponent
-export type CheckboxFieldDescriptionComponent = DescriptionComponent<'checkbox'>
+export type CheckboxFieldLabelClientComponent =
+ FieldLabelClientComponent
-export type CheckboxFieldErrorComponent = ErrorComponent<'checkbox'>
+export type CheckboxFieldDescriptionServerComponent = FieldDescriptionServerComponent
+
+export type CheckboxFieldDescriptionClientComponent =
+ FieldDescriptionClientComponent
+
+export type CheckboxFieldErrorServerComponent = FieldErrorServerComponent
+
+export type CheckboxFieldErrorClientComponent =
+ FieldErrorClientComponent
diff --git a/packages/payload/src/admin/fields/Code.ts b/packages/payload/src/admin/fields/Code.ts
index 7154d369a..ddf29e04c 100644
--- a/packages/payload/src/admin/fields/Code.ts
+++ b/packages/payload/src/admin/fields/Code.ts
@@ -1,18 +1,32 @@
import type { MarkOptional } from 'ts-essentials'
-import type { CodeFieldClient } from '../../fields/config/types.js'
+import type { CodeField, CodeFieldClient } from '../../fields/config/types.js'
import type { CodeFieldValidation } from '../../fields/validations.js'
-import type { ErrorComponent } from '../forms/Error.js'
-import type { DescriptionComponent, FormFieldBase, LabelComponent } from '../types.js'
+import type { FieldErrorClientComponent, FieldErrorServerComponent } from '../forms/Error.js'
+import type {
+ FieldDescriptionClientComponent,
+ FieldDescriptionServerComponent,
+ FieldLabelClientComponent,
+ FieldLabelServerComponent,
+ FormFieldBase,
+} from '../types.js'
+
+type CodeFieldClientWithoutType = MarkOptional
export type CodeFieldProps = {
readonly autoComplete?: string
- readonly field: MarkOptional
readonly validate?: CodeFieldValidation
-} & Omit
+} & Omit, 'validate'>
-export type CodeFieldLabelComponent = LabelComponent<'code'>
+export type CodeFieldLabelServerComponent = FieldLabelServerComponent
-export type CodeFieldDescriptionComponent = DescriptionComponent<'code'>
+export type CodeFieldLabelClientComponent = FieldLabelClientComponent
-export type CodeFieldErrorComponent = ErrorComponent<'code'>
+export type CodeFieldDescriptionServerComponent = FieldDescriptionServerComponent
+
+export type CodeFieldDescriptionClientComponent =
+ FieldDescriptionClientComponent
+
+export type CodeFieldErrorServerComponent = FieldErrorServerComponent
+
+export type CodeFieldErrorClientComponent = FieldErrorClientComponent
diff --git a/packages/payload/src/admin/fields/Collapsible.ts b/packages/payload/src/admin/fields/Collapsible.ts
index ad941ed83..360e19a42 100644
--- a/packages/payload/src/admin/fields/Collapsible.ts
+++ b/packages/payload/src/admin/fields/Collapsible.ts
@@ -1,15 +1,31 @@
import type { MarkOptional } from 'ts-essentials'
-import type { CollapsibleFieldClient } from '../../fields/config/types.js'
-import type { ErrorComponent } from '../forms/Error.js'
-import type { DescriptionComponent, FormFieldBase, LabelComponent } from '../types.js'
+import type { CollapsibleField, CollapsibleFieldClient } from '../../fields/config/types.js'
+import type { FieldErrorClientComponent, FieldErrorServerComponent } from '../forms/Error.js'
+import type {
+ FieldDescriptionClientComponent,
+ FieldDescriptionServerComponent,
+ FieldLabelClientComponent,
+ FieldLabelServerComponent,
+ FormFieldBase,
+} from '../types.js'
-export type CollapsibleFieldProps = {
- readonly field: MarkOptional
-} & FormFieldBase
+type CollapsibleFieldClientWithoutType = MarkOptional
-export type CollapsibleFieldLabelComponent = LabelComponent<'collapsible'>
+export type CollapsibleFieldProps = FormFieldBase
-export type CollapsibleFieldDescriptionComponent = DescriptionComponent<'collapsible'>
+export type CollapsibleFieldLabelServerComponent = FieldLabelServerComponent
-export type CollapsibleFieldErrorComponent = ErrorComponent<'collapsible'>
+export type CollapsibleFieldLabelClientComponent =
+ FieldLabelClientComponent
+
+export type CollapsibleFieldDescriptionServerComponent =
+ FieldDescriptionServerComponent
+
+export type CollapsibleFieldDescriptionClientComponent =
+ FieldDescriptionClientComponent
+
+export type CollapsibleFieldErrorServerComponent = FieldErrorServerComponent
+
+export type CollapsibleFieldErrorClientComponent =
+ FieldErrorClientComponent
diff --git a/packages/payload/src/admin/fields/Date.ts b/packages/payload/src/admin/fields/Date.ts
index 3a43eb057..9c6a30bc8 100644
--- a/packages/payload/src/admin/fields/Date.ts
+++ b/packages/payload/src/admin/fields/Date.ts
@@ -1,17 +1,31 @@
import type { MarkOptional } from 'ts-essentials'
-import type { DateFieldClient } from '../../fields/config/types.js'
+import type { DateField, DateFieldClient } from '../../fields/config/types.js'
import type { DateFieldValidation } from '../../fields/validations.js'
-import type { ErrorComponent } from '../forms/Error.js'
-import type { DescriptionComponent, FormFieldBase, LabelComponent } from '../types.js'
+import type { FieldErrorClientComponent, FieldErrorServerComponent } from '../forms/Error.js'
+import type {
+ FieldDescriptionClientComponent,
+ FieldDescriptionServerComponent,
+ FieldLabelClientComponent,
+ FieldLabelServerComponent,
+ FormFieldBase,
+} from '../types.js'
+
+type DateFieldClientWithoutType = MarkOptional
export type DateFieldProps = {
- readonly field: MarkOptional
readonly validate?: DateFieldValidation
-} & Omit
+} & Omit, 'validate'>
-export type DateFieldLabelComponent = LabelComponent<'date'>
+export type DateFieldLabelServerComponent = FieldLabelServerComponent
-export type DateFieldDescriptionComponent = DescriptionComponent<'date'>
+export type DateFieldLabelClientComponent = FieldLabelClientComponent
-export type DateFieldErrorComponent = ErrorComponent<'date'>
+export type DateFieldDescriptionServerComponent = FieldDescriptionServerComponent
+
+export type DateFieldDescriptionClientComponent =
+ FieldDescriptionClientComponent
+
+export type DateFieldErrorServerComponent = FieldErrorServerComponent
+
+export type DateFieldErrorClientComponent = FieldErrorClientComponent
diff --git a/packages/payload/src/admin/fields/Email.ts b/packages/payload/src/admin/fields/Email.ts
index 4f7330dd3..2648177f2 100644
--- a/packages/payload/src/admin/fields/Email.ts
+++ b/packages/payload/src/admin/fields/Email.ts
@@ -1,18 +1,32 @@
import type { MarkOptional } from 'ts-essentials'
-import type { EmailFieldClient } from '../../fields/config/types.js'
+import type { EmailField, EmailFieldClient } from '../../fields/config/types.js'
import type { EmailFieldValidation } from '../../fields/validations.js'
-import type { ErrorComponent } from '../forms/Error.js'
-import type { DescriptionComponent, FormFieldBase, LabelComponent } from '../types.js'
+import type { FieldErrorClientComponent, FieldErrorServerComponent } from '../forms/Error.js'
+import type {
+ FieldDescriptionClientComponent,
+ FieldDescriptionServerComponent,
+ FieldLabelClientComponent,
+ FieldLabelServerComponent,
+ FormFieldBase,
+} from '../types.js'
+
+type EmailFieldClientWithoutType = MarkOptional
export type EmailFieldProps = {
readonly autoComplete?: string
- readonly field: MarkOptional
readonly validate?: EmailFieldValidation
-} & Omit
+} & Omit, 'validate'>
-export type EmailFieldLabelComponent = LabelComponent<'email'>
+export type EmailFieldLabelServerComponent = FieldLabelServerComponent
-export type EmailFieldDescriptionComponent = DescriptionComponent<'email'>
+export type EmailFieldLabelClientComponent = FieldLabelClientComponent
-export type EmailFieldErrorComponent = ErrorComponent<'email'>
+export type EmailFieldDescriptionServerComponent = FieldDescriptionServerComponent
+
+export type EmailFieldDescriptionClientComponent =
+ FieldDescriptionClientComponent
+
+export type EmailFieldErrorServerComponent = FieldErrorServerComponent
+
+export type EmailFieldErrorClientComponent = FieldErrorClientComponent
diff --git a/packages/payload/src/admin/fields/Group.ts b/packages/payload/src/admin/fields/Group.ts
index c5fe2f340..ed360d0f5 100644
--- a/packages/payload/src/admin/fields/Group.ts
+++ b/packages/payload/src/admin/fields/Group.ts
@@ -1,15 +1,28 @@
import type { MarkOptional } from 'ts-essentials'
-import type { GroupFieldClient } from '../../fields/config/types.js'
-import type { ErrorComponent } from '../forms/Error.js'
-import type { DescriptionComponent, FormFieldBase, LabelComponent } from '../types.js'
+import type { GroupField, GroupFieldClient } from '../../fields/config/types.js'
+import type { FieldErrorClientComponent, FieldErrorServerComponent } from '../forms/Error.js'
+import type {
+ FieldDescriptionClientComponent,
+ FieldDescriptionServerComponent,
+ FieldLabelClientComponent,
+ FieldLabelServerComponent,
+ FormFieldBase,
+} from '../types.js'
-export type GroupFieldProps = {
- readonly field: MarkOptional
-} & FormFieldBase
+type GroupFieldClientWithoutType = MarkOptional
-export type GroupFieldLabelComponent = LabelComponent<'group'>
+export type GroupFieldProps = FormFieldBase
-export type GroupFieldDescriptionComponent = DescriptionComponent<'group'>
+export type GroupFieldLabelServerComponent = FieldLabelServerComponent
-export type GroupFieldErrorComponent = ErrorComponent<'group'>
+export type GroupFieldLabelClientComponent = FieldLabelClientComponent
+
+export type GroupFieldDescriptionServerComponent = FieldDescriptionServerComponent
+
+export type GroupFieldDescriptionClientComponent =
+ FieldDescriptionClientComponent
+
+export type GroupFieldErrorServerComponent = FieldErrorServerComponent
+
+export type GroupFieldErrorClientComponent = FieldErrorClientComponent
diff --git a/packages/payload/src/admin/fields/Hidden.ts b/packages/payload/src/admin/fields/Hidden.ts
index b1e0b481f..959cbb0e9 100644
--- a/packages/payload/src/admin/fields/Hidden.ts
+++ b/packages/payload/src/admin/fields/Hidden.ts
@@ -1,6 +1,5 @@
import type { ClientField } from '../../fields/config/client.js'
-import type { ErrorComponent } from '../forms/Error.js'
-import type { DescriptionComponent, FormFieldBase, LabelComponent } from '../types.js'
+import type { FormFieldBase } from '../types.js'
export type HiddenFieldProps = {
readonly disableModifyingForm?: false
@@ -10,9 +9,3 @@ export type HiddenFieldProps = {
readonly forceUsePathFromProps?: boolean
readonly value?: unknown
} & FormFieldBase
-
-export type HiddenFieldLabelComponent = LabelComponent<'hidden'>
-
-export type HiddenFieldDescriptionComponent = DescriptionComponent<'hidden'>
-
-export type HiddenFieldErrorComponent = ErrorComponent<'hidden'>
diff --git a/packages/payload/src/admin/fields/JSON.ts b/packages/payload/src/admin/fields/JSON.ts
index f20151226..373498b51 100644
--- a/packages/payload/src/admin/fields/JSON.ts
+++ b/packages/payload/src/admin/fields/JSON.ts
@@ -1,17 +1,31 @@
import type { MarkOptional } from 'ts-essentials'
-import type { JSONFieldClient } from '../../fields/config/types.js'
+import type { JSONField, JSONFieldClient } from '../../fields/config/types.js'
import type { JSONFieldValidation } from '../../fields/validations.js'
-import type { ErrorComponent } from '../forms/Error.js'
-import type { DescriptionComponent, FormFieldBase, LabelComponent } from '../types.js'
+import type { FieldErrorClientComponent, FieldErrorServerComponent } from '../forms/Error.js'
+import type {
+ FieldDescriptionClientComponent,
+ FieldDescriptionServerComponent,
+ FieldLabelClientComponent,
+ FieldLabelServerComponent,
+ FormFieldBase,
+} from '../types.js'
+
+type JSONFieldClientWithoutType = MarkOptional
export type JSONFieldProps = {
- readonly field: MarkOptional
readonly validate?: JSONFieldValidation
-} & Omit
+} & Omit, 'validate'>
-export type JSONFieldLabelComponent = LabelComponent<'json'>
+export type JSONFieldLabelServerComponent = FieldLabelServerComponent
-export type JSONFieldDescriptionComponent = DescriptionComponent<'json'>
+export type JSONFieldLabelClientComponent = FieldLabelClientComponent
-export type JSONFieldErrorComponent = ErrorComponent<'json'>
+export type JSONFieldDescriptionServerComponent = FieldDescriptionServerComponent
+
+export type JSONFieldDescriptionClientComponent =
+ FieldDescriptionClientComponent
+
+export type JSONFieldErrorServerComponent = FieldErrorServerComponent
+
+export type JSONFieldErrorClientComponent = FieldErrorClientComponent
diff --git a/packages/payload/src/admin/fields/Number.ts b/packages/payload/src/admin/fields/Number.ts
index a936605e2..eed165380 100644
--- a/packages/payload/src/admin/fields/Number.ts
+++ b/packages/payload/src/admin/fields/Number.ts
@@ -1,18 +1,34 @@
import type { MarkOptional } from 'ts-essentials'
-import type { NumberFieldClient } from '../../fields/config/types.js'
+import type { NumberField, NumberFieldClient } from '../../fields/config/types.js'
import type { NumberFieldValidation } from '../../fields/validations.js'
-import type { ErrorComponent } from '../forms/Error.js'
-import type { DescriptionComponent, FormFieldBase, LabelComponent } from '../types.js'
+import type { FieldErrorClientComponent, FieldErrorServerComponent } from '../forms/Error.js'
+import type {
+ FieldDescriptionClientComponent,
+ FieldDescriptionServerComponent,
+ FieldLabelClientComponent,
+ FieldLabelServerComponent,
+ FormFieldBase,
+} from '../types.js'
+
+type NumberFieldClientWithoutType = MarkOptional
export type NumberFieldProps = {
- readonly field: MarkOptional
readonly onChange?: (e: number) => void
readonly validate?: NumberFieldValidation
-} & Omit
+} & Omit, 'validate'>
-export type NumberFieldLabelComponent = LabelComponent<'number'>
+export type NumberFieldLabelServerComponent = FieldLabelServerComponent
-export type NumberFieldDescriptionComponent = DescriptionComponent<'number'>
+export type NumberFieldLabelClientComponent =
+ FieldLabelClientComponent
-export type NumberFieldErrorComponent = ErrorComponent<'number'>
+export type NumberFieldDescriptionServerComponent = FieldDescriptionServerComponent
+
+export type NumberFieldDescriptionClientComponent =
+ FieldDescriptionClientComponent
+
+export type NumberFieldErrorServerComponent = FieldErrorServerComponent
+
+export type NumberFieldErrorClientComponent =
+ FieldErrorClientComponent
diff --git a/packages/payload/src/admin/fields/Point.ts b/packages/payload/src/admin/fields/Point.ts
index 4a8302861..8033bb063 100644
--- a/packages/payload/src/admin/fields/Point.ts
+++ b/packages/payload/src/admin/fields/Point.ts
@@ -1,17 +1,31 @@
import type { MarkOptional } from 'ts-essentials'
-import type { PointFieldClient } from '../../fields/config/types.js'
+import type { PointField, PointFieldClient } from '../../fields/config/types.js'
import type { PointFieldValidation } from '../../fields/validations.js'
-import type { ErrorComponent } from '../forms/Error.js'
-import type { DescriptionComponent, FormFieldBase, LabelComponent } from '../types.js'
+import type { FieldErrorClientComponent, FieldErrorServerComponent } from '../forms/Error.js'
+import type {
+ FieldDescriptionClientComponent,
+ FieldDescriptionServerComponent,
+ FieldLabelClientComponent,
+ FieldLabelServerComponent,
+ FormFieldBase,
+} from '../types.js'
+
+type PointFieldClientWithoutType = MarkOptional
export type PointFieldProps = {
- readonly field: MarkOptional
readonly validate?: PointFieldValidation
-} & Omit
+} & Omit, 'validate'>
-export type PointFieldLabelComponent = LabelComponent<'point'>
+export type PointFieldLabelServerComponent = FieldLabelServerComponent
-export type PointFieldDescriptionComponent = DescriptionComponent<'point'>
+export type PointFieldLabelClientComponent = FieldLabelClientComponent
-export type PointFieldErrorComponent = ErrorComponent<'point'>
+export type PointFieldDescriptionServerComponent = FieldDescriptionServerComponent
+
+export type PointFieldDescriptionClientComponent =
+ FieldDescriptionClientComponent
+
+export type PointFieldErrorServerComponent = FieldErrorServerComponent
+
+export type PointFieldErrorClientComponent = FieldErrorClientComponent
diff --git a/packages/payload/src/admin/fields/Radio.ts b/packages/payload/src/admin/fields/Radio.ts
index 06ebe1141..9095dd064 100644
--- a/packages/payload/src/admin/fields/Radio.ts
+++ b/packages/payload/src/admin/fields/Radio.ts
@@ -1,21 +1,35 @@
import type { MarkOptional } from 'ts-essentials'
-import type { RadioFieldClient } from '../../fields/config/types.js'
+import type { RadioField, RadioFieldClient } from '../../fields/config/types.js'
import type { RadioFieldValidation } from '../../fields/validations.js'
-import type { ErrorComponent } from '../forms/Error.js'
-import type { DescriptionComponent, FormFieldBase, LabelComponent } from '../types.js'
+import type { FieldErrorClientComponent, FieldErrorServerComponent } from '../forms/Error.js'
+import type {
+ FieldDescriptionClientComponent,
+ FieldDescriptionServerComponent,
+ FieldLabelClientComponent,
+ FieldLabelServerComponent,
+ FormFieldBase,
+} from '../types.js'
+
+type RadioFieldClientWithoutType = MarkOptional
export type RadioFieldProps = {
- readonly field: MarkOptional
readonly onChange?: OnChange
readonly validate?: RadioFieldValidation
readonly value?: string
-} & Omit
+} & Omit, 'validate'>
export type OnChange = (value: T) => void
-export type RadioFieldLabelComponent = LabelComponent<'radio'>
+export type RadioFieldLabelServerComponent = FieldLabelServerComponent
-export type RadioFieldDescriptionComponent = DescriptionComponent<'radio'>
+export type RadioFieldLabelClientComponent = FieldLabelClientComponent
-export type RadioFieldErrorComponent = ErrorComponent<'radio'>
+export type RadioFieldDescriptionServerComponent = FieldDescriptionServerComponent
+
+export type RadioFieldDescriptionClientComponent =
+ FieldDescriptionClientComponent
+
+export type RadioFieldErrorServerComponent = FieldErrorServerComponent
+
+export type RadioFieldErrorClientComponent = FieldErrorClientComponent
diff --git a/packages/payload/src/admin/fields/Relationship.ts b/packages/payload/src/admin/fields/Relationship.ts
index bdba09ede..03b342c92 100644
--- a/packages/payload/src/admin/fields/Relationship.ts
+++ b/packages/payload/src/admin/fields/Relationship.ts
@@ -1,17 +1,34 @@
import type { MarkOptional } from 'ts-essentials'
-import type { RelationshipFieldClient } from '../../fields/config/types.js'
+import type { RelationshipField, RelationshipFieldClient } from '../../fields/config/types.js'
import type { RelationshipFieldValidation } from '../../fields/validations.js'
-import type { ErrorComponent } from '../forms/Error.js'
-import type { DescriptionComponent, FormFieldBase, LabelComponent } from '../types.js'
+import type { FieldErrorClientComponent, FieldErrorServerComponent } from '../forms/Error.js'
+import type {
+ FieldDescriptionClientComponent,
+ FieldDescriptionServerComponent,
+ FieldLabelClientComponent,
+ FieldLabelServerComponent,
+ FormFieldBase,
+} from '../types.js'
+
+type RelationshipFieldClientWithoutType = MarkOptional
export type RelationshipFieldProps = {
- readonly field: MarkOptional
readonly validate?: RelationshipFieldValidation
-} & Omit
+} & Omit, 'validate'>
-export type RelationshipFieldLabelComponent = LabelComponent<'relationship'>
+export type RelationshipFieldLabelServerComponent = FieldLabelServerComponent
-export type RelationshipFieldDescriptionComponent = DescriptionComponent<'relationship'>
+export type RelationshipFieldLabelClientComponent =
+ FieldLabelClientComponent
-export type RelationshipFieldErrorComponent = ErrorComponent<'relationship'>
+export type RelationshipFieldDescriptionServerComponent =
+ FieldDescriptionServerComponent
+
+export type RelationshipFieldDescriptionClientComponent =
+ FieldDescriptionClientComponent
+
+export type RelationshipFieldErrorServerComponent = FieldErrorServerComponent
+
+export type RelationshipFieldErrorClientComponent =
+ FieldErrorClientComponent
diff --git a/packages/payload/src/admin/fields/RichText.ts b/packages/payload/src/admin/fields/RichText.ts
index eeb56b240..285c882ec 100644
--- a/packages/payload/src/admin/fields/RichText.ts
+++ b/packages/payload/src/admin/fields/RichText.ts
@@ -1,21 +1,37 @@
import type { MarkOptional } from 'ts-essentials'
-import type { RichTextFieldClient } from '../../fields/config/types.js'
+import type { RichTextField, RichTextFieldClient } from '../../fields/config/types.js'
import type { RichTextFieldValidation } from '../../fields/validations.js'
-import type { ErrorComponent } from '../forms/Error.js'
-import type { DescriptionComponent, FormFieldBase, LabelComponent } from '../types.js'
+import type { FieldErrorClientComponent, FieldErrorServerComponent } from '../forms/Error.js'
+import type {
+ FieldDescriptionClientComponent,
+ FieldDescriptionServerComponent,
+ FieldLabelClientComponent,
+ FieldLabelServerComponent,
+ FormFieldBase,
+} from '../types.js'
+
+type RichTextFieldClientWithoutType = MarkOptional
export type RichTextFieldProps<
TValue extends object = any,
TAdapterProps = any,
TExtraProperties = object,
> = {
- readonly field: MarkOptional, 'type'>
readonly validate?: RichTextFieldValidation
-} & Omit
+} & Omit, 'validate'>
-export type RichTextFieldLabelComponent = LabelComponent<'richText'>
+export type RichTextFieldLabelServerComponent = FieldLabelServerComponent
-export type RichTextFieldDescriptionComponent = DescriptionComponent<'richText'>
+export type RichTextFieldLabelClientComponent =
+ FieldLabelClientComponent
-export type RichTextFieldErrorComponent = ErrorComponent<'richText'>
+export type RichTextFieldDescriptionServerComponent = FieldDescriptionServerComponent
+
+export type RichTextFieldDescriptionClientComponent =
+ FieldDescriptionClientComponent
+
+export type RichTextFieldErrorServerComponent = FieldErrorServerComponent
+
+export type RichTextFieldErrorClientComponent =
+ FieldErrorClientComponent
diff --git a/packages/payload/src/admin/fields/Row.ts b/packages/payload/src/admin/fields/Row.ts
index 01aabe4f5..6b915e293 100644
--- a/packages/payload/src/admin/fields/Row.ts
+++ b/packages/payload/src/admin/fields/Row.ts
@@ -1,17 +1,32 @@
-import type { DescriptionComponent, FormFieldBase, LabelComponent } from 'payload'
import type { MarkOptional } from 'ts-essentials'
-import type { RowFieldClient } from '../../fields/config/types.js'
-import type { ErrorComponent } from '../forms/Error.js'
+import type { RowField, RowFieldClient } from '../../fields/config/types.js'
+import type {
+ FieldDescriptionClientComponent,
+ FieldDescriptionServerComponent,
+ FieldErrorClientComponent,
+ FieldErrorServerComponent,
+ FieldLabelClientComponent,
+ FieldLabelServerComponent,
+ FormFieldBase,
+} from '../types.js'
+
+type RowFieldClientWithoutType = MarkOptional
export type RowFieldProps = {
- field: MarkOptional
- forceRender?: boolean
- indexPath: string
-} & FormFieldBase
+ readonly forceRender?: boolean
+ readonly indexPath: string
+} & FormFieldBase
-export type RowFieldLabelComponent = LabelComponent<'row'>
+export type RowFieldLabelServerComponent = FieldLabelServerComponent
-export type RowFieldDescriptionComponent = DescriptionComponent<'row'>
+export type RowFieldLabelClientComponent = FieldLabelClientComponent
-export type RowFieldErrorComponent = ErrorComponent<'row'>
+export type RowFieldDescriptionServerComponent = FieldDescriptionServerComponent
+
+export type RowFieldDescriptionClientComponent =
+ FieldDescriptionClientComponent
+
+export type RowFieldErrorServerComponent = FieldErrorServerComponent
+
+export type RowFieldErrorClientComponent = FieldErrorClientComponent
diff --git a/packages/payload/src/admin/fields/Select.ts b/packages/payload/src/admin/fields/Select.ts
index aa6389dcc..be84f87ae 100644
--- a/packages/payload/src/admin/fields/Select.ts
+++ b/packages/payload/src/admin/fields/Select.ts
@@ -1,19 +1,35 @@
import type { MarkOptional } from 'ts-essentials'
-import type { SelectFieldClient } from '../../fields/config/types.js'
+import type { SelectField, SelectFieldClient } from '../../fields/config/types.js'
import type { SelectFieldValidation } from '../../fields/validations.js'
-import type { ErrorComponent } from '../forms/Error.js'
-import type { DescriptionComponent, FormFieldBase, LabelComponent } from '../types.js'
+import type { FieldErrorClientComponent, FieldErrorServerComponent } from '../forms/Error.js'
+import type {
+ FieldDescriptionClientComponent,
+ FieldDescriptionServerComponent,
+ FieldLabelClientComponent,
+ FieldLabelServerComponent,
+ FormFieldBase,
+} from '../types.js'
+
+type SelectFieldClientWithoutType = MarkOptional
export type SelectFieldProps = {
- readonly field: MarkOptional
readonly onChange?: (e: string | string[]) => void
readonly validate?: SelectFieldValidation
readonly value?: string
-} & Omit
+} & Omit, 'validate'>
-export type SelectFieldLabelComponent = LabelComponent<'select'>
+export type SelectFieldLabelServerComponent = FieldLabelServerComponent
-export type SelectFieldDescriptionComponent = DescriptionComponent<'select'>
+export type SelectFieldLabelClientComponent =
+ FieldLabelClientComponent
-export type SelectFieldErrorComponent = ErrorComponent<'select'>
+export type SelectFieldDescriptionServerComponent = FieldDescriptionServerComponent
+
+export type SelectFieldDescriptionClientComponent =
+ FieldDescriptionClientComponent
+
+export type SelectFieldErrorServerComponent = FieldErrorServerComponent
+
+export type SelectFieldErrorClientComponent =
+ FieldErrorClientComponent
diff --git a/packages/payload/src/admin/fields/Tabs.ts b/packages/payload/src/admin/fields/Tabs.ts
index 938cdf0e9..817621c3e 100644
--- a/packages/payload/src/admin/fields/Tabs.ts
+++ b/packages/payload/src/admin/fields/Tabs.ts
@@ -3,22 +3,36 @@ import type { MarkOptional } from 'ts-essentials'
import type {
ClientField,
NamedTab,
+ TabsField,
TabsFieldClient,
UnnamedTab,
} from '../../fields/config/types.js'
-import type { ErrorComponent } from '../forms/Error.js'
-import type { DescriptionComponent, FormFieldBase, LabelComponent } from '../types.js'
+import type { FieldErrorClientComponent, FieldErrorServerComponent } from '../forms/Error.js'
+import type {
+ FieldDescriptionClientComponent,
+ FieldDescriptionServerComponent,
+ FieldLabelClientComponent,
+ FieldLabelServerComponent,
+ FormFieldBase,
+} from '../types.js'
export type ClientTab =
| ({ fields: ClientField[] } & Omit)
| ({ fields: ClientField[] } & Omit)
-export type TabsFieldProps = {
- readonly field: MarkOptional
-} & FormFieldBase
+export type TabsFieldClientWithoutType = MarkOptional
-export type TabsFieldLabelComponent = LabelComponent<'tabs'>
+export type TabsFieldProps = FormFieldBase
-export type TabsFieldDescriptionComponent = DescriptionComponent<'tabs'>
+export type TabsFieldLabelServerComponent = FieldLabelServerComponent
-export type TabsFieldErrorComponent = ErrorComponent<'tabs'>
+export type TabsFieldLabelClientComponent = FieldLabelClientComponent
+
+export type TabsFieldDescriptionServerComponent = FieldDescriptionServerComponent
+
+export type TabsFieldDescriptionClientComponent =
+ FieldDescriptionClientComponent
+
+export type TabsFieldErrorServerComponent = FieldErrorServerComponent
+
+export type TabsFieldErrorClientComponent = FieldErrorClientComponent
diff --git a/packages/payload/src/admin/fields/Text.ts b/packages/payload/src/admin/fields/Text.ts
index 3b8887667..c8f2f846f 100644
--- a/packages/payload/src/admin/fields/Text.ts
+++ b/packages/payload/src/admin/fields/Text.ts
@@ -1,20 +1,34 @@
import type React from 'react'
import type { MarkOptional } from 'ts-essentials'
-import type { TextFieldClient } from '../../fields/config/types.js'
+import type { TextField, TextFieldClient } from '../../fields/config/types.js'
import type { TextFieldValidation } from '../../fields/validations.js'
-import type { ErrorComponent } from '../forms/Error.js'
-import type { DescriptionComponent, FormFieldBase, LabelComponent } from '../types.js'
+import type { FieldErrorClientComponent, FieldErrorServerComponent } from '../forms/Error.js'
+import type {
+ FieldDescriptionClientComponent,
+ FieldDescriptionServerComponent,
+ FieldLabelClientComponent,
+ FieldLabelServerComponent,
+ FormFieldBase,
+} from '../types.js'
+
+type TextFieldClientWithoutType = MarkOptional
export type TextFieldProps = {
- readonly field: MarkOptional
readonly inputRef?: React.RefObject
readonly onKeyDown?: React.KeyboardEventHandler
readonly validate?: TextFieldValidation
-} & Omit
+} & Omit, 'validate'>
-export type TextFieldLabelComponent = LabelComponent<'text'>
+export type TextFieldLabelServerComponent = FieldLabelServerComponent
-export type TextFieldDescriptionComponent = DescriptionComponent<'text'>
+export type TextFieldLabelClientComponent = FieldLabelClientComponent
-export type TextFieldErrorComponent = ErrorComponent<'text'>
+export type TextFieldDescriptionServerComponent = FieldDescriptionServerComponent
+
+export type TextFieldDescriptionClientComponent =
+ FieldDescriptionClientComponent
+
+export type TextFieldErrorServerComponent = FieldErrorServerComponent
+
+export type TextFieldErrorClientComponent = FieldErrorClientComponent
diff --git a/packages/payload/src/admin/fields/Textarea.ts b/packages/payload/src/admin/fields/Textarea.ts
index 3f1467c7a..a9b74edd5 100644
--- a/packages/payload/src/admin/fields/Textarea.ts
+++ b/packages/payload/src/admin/fields/Textarea.ts
@@ -1,20 +1,36 @@
import type React from 'react'
import type { MarkOptional } from 'ts-essentials'
-import type { TextareaFieldClient } from '../../fields/config/types.js'
+import type { TextareaField, TextareaFieldClient } from '../../fields/config/types.js'
import type { TextareaFieldValidation } from '../../fields/validations.js'
-import type { ErrorComponent } from '../forms/Error.js'
-import type { DescriptionComponent, FormFieldBase, LabelComponent } from '../types.js'
+import type { FieldErrorClientComponent, FieldErrorServerComponent } from '../forms/Error.js'
+import type {
+ FieldDescriptionClientComponent,
+ FieldDescriptionServerComponent,
+ FieldLabelClientComponent,
+ FieldLabelServerComponent,
+ FormFieldBase,
+} from '../types.js'
+
+type TextareaFieldClientWithoutType = MarkOptional
export type TextareaFieldProps = {
- readonly field: MarkOptional
readonly inputRef?: React.Ref
readonly onKeyDown?: React.KeyboardEventHandler
readonly validate?: TextareaFieldValidation
-} & Omit
+} & Omit, 'validate'>
-export type TextareaFieldLabelComponent = LabelComponent<'textarea'>
+export type TextareaFieldLabelServerComponent = FieldLabelServerComponent
-export type TextareaFieldDescriptionComponent = DescriptionComponent<'textarea'>
+export type TextareaFieldLabelClientComponent =
+ FieldLabelClientComponent
-export type TextareaFieldErrorComponent = ErrorComponent<'textarea'>
+export type TextareaFieldDescriptionServerComponent = FieldDescriptionServerComponent
+
+export type TextareaFieldDescriptionClientComponent =
+ FieldDescriptionClientComponent
+
+export type TextareaFieldErrorServerComponent = FieldErrorServerComponent
+
+export type TextareaFieldErrorClientComponent =
+ FieldErrorClientComponent
diff --git a/packages/payload/src/admin/fields/Upload.ts b/packages/payload/src/admin/fields/Upload.ts
index b9e989c0d..ccd36cc71 100644
--- a/packages/payload/src/admin/fields/Upload.ts
+++ b/packages/payload/src/admin/fields/Upload.ts
@@ -1,17 +1,33 @@
import type { MarkOptional } from 'ts-essentials'
-import type { UploadFieldClient } from '../../fields/config/types.js'
+import type { UploadField, UploadFieldClient } from '../../fields/config/types.js'
import type { UploadFieldValidation } from '../../fields/validations.js'
-import type { ErrorComponent } from '../forms/Error.js'
-import type { DescriptionComponent, FormFieldBase, LabelComponent } from '../types.js'
+import type { FieldErrorClientComponent, FieldErrorServerComponent } from '../forms/Error.js'
+import type {
+ FieldDescriptionClientComponent,
+ FieldDescriptionServerComponent,
+ FieldLabelClientComponent,
+ FieldLabelServerComponent,
+ FormFieldBase,
+} from '../types.js'
+
+type UploadFieldClientWithoutType = MarkOptional
export type UploadFieldProps = {
- readonly field: MarkOptional
readonly validate?: UploadFieldValidation
-} & Omit
+} & Omit, 'validate'>
-export type UploadFieldLabelComponent = LabelComponent<'upload'>
+export type UploadFieldLabelServerComponent = FieldLabelServerComponent
-export type UploadFieldDescriptionComponent = DescriptionComponent<'upload'>
+export type UploadFieldLabelClientComponent =
+ FieldLabelClientComponent
-export type UploadFieldErrorComponent = ErrorComponent<'upload'>
+export type UploadFieldDescriptionServerComponent = FieldDescriptionServerComponent
+
+export type UploadFieldDescriptionClientComponent =
+ FieldDescriptionClientComponent
+
+export type UploadFieldErrorServerComponent = FieldErrorServerComponent
+
+export type UploadFieldErrorClientComponent =
+ FieldErrorClientComponent
diff --git a/packages/payload/src/admin/forms/Description.ts b/packages/payload/src/admin/forms/Description.ts
new file mode 100644
index 000000000..30fde7f6d
--- /dev/null
+++ b/packages/payload/src/admin/forms/Description.ts
@@ -0,0 +1,38 @@
+import type { MarkOptional } from 'ts-essentials'
+
+import type { LabelFunction, ServerProps } from '../../config/types.js'
+import type { ClientField, Field } from '../../fields/config/types.js'
+import type { MappedComponent } from '../types.js'
+
+export type DescriptionFunction = LabelFunction
+
+type ClientFieldWithOptionalType = MarkOptional
+
+export type FieldDescriptionClientComponent<
+ TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,
+> = React.ComponentType>
+
+export type FieldDescriptionServerComponent =
+ React.ComponentType>
+
+export type StaticDescription = Record | string
+
+export type Description = DescriptionFunction | StaticDescription
+
+export type GenericDescriptionProps = {
+ readonly Description?: MappedComponent
+ readonly className?: string
+ readonly description?: StaticDescription
+ readonly marginPlacement?: 'bottom' | 'top'
+}
+
+export type FieldDescriptionServerProps = {
+ field: TFieldServer
+} & GenericDescriptionProps &
+ Partial
+
+export type FieldDescriptionClientProps<
+ TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,
+> = {
+ field: TFieldClient
+} & GenericDescriptionProps
diff --git a/packages/payload/src/admin/forms/Error.ts b/packages/payload/src/admin/forms/Error.ts
index a3a405951..487966ba4 100644
--- a/packages/payload/src/admin/forms/Error.ts
+++ b/packages/payload/src/admin/forms/Error.ts
@@ -1,5 +1,7 @@
-import type { CustomComponent, ServerProps } from '../../config/types.js'
-import type { FieldTypes } from '../../fields/config/types.js'
+import type { MarkOptional } from 'ts-essentials'
+
+import type { ServerProps } from '../../config/types.js'
+import type { ClientField, Field } from '../../fields/config/types.js'
import type { MappedComponent } from '../types.js'
export type GenericErrorProps = {
@@ -10,9 +12,23 @@ export type GenericErrorProps = {
readonly showError?: boolean
}
-export type ErrorProps = {
- type: T
+type ClientFieldWithOptionalType = MarkOptional
+
+export type FieldErrorClientProps<
+ TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,
+> = {
+ field: TFieldClient
+} & GenericErrorProps
+
+export type FieldErrorServerProps = {
+ field: TFieldServer
} & GenericErrorProps &
Partial
-export type ErrorComponent = CustomComponent>
+export type FieldErrorClientComponent<
+ TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,
+> = React.ComponentType>
+
+export type FieldErrorServerComponent = React.ComponentType<
+ FieldErrorServerProps
+>
diff --git a/packages/payload/src/admin/forms/Field.ts b/packages/payload/src/admin/forms/Field.ts
index 91d6d91c6..c80b32006 100644
--- a/packages/payload/src/admin/forms/Field.ts
+++ b/packages/payload/src/admin/forms/Field.ts
@@ -1,24 +1,28 @@
+import type { MarkOptional } from 'ts-essentials'
+
import type { User } from '../../auth/types.js'
import type { Locale } from '../../config/types.js'
-import type { Validate } from '../../fields/config/types.js'
+import type { ClientField, Validate } from '../../fields/config/types.js'
import type { DocumentPreferences } from '../../preferences/types.js'
-import type { ErrorProps } from './Error.js'
-import type { FieldDescriptionProps } from './FieldDescription.js'
-import type { LabelProps } from './Label.js'
+import type { FieldDescriptionClientProps } from './Description.js'
+import type { FieldErrorClientProps } from './Error.js'
+import type { FieldLabelClientProps } from './Label.js'
-// TODO: Check if we still need this. Shouldnt most of it be present in the field type?
-export type FormFieldBase = {
- readonly descriptionProps?: FieldDescriptionProps
+export type FormFieldBase<
+ TFieldClient extends MarkOptional = MarkOptional,
+> = {
+ readonly descriptionProps?: FieldDescriptionClientProps
readonly docPreferences?: DocumentPreferences
- readonly errorProps?: ErrorProps
+ readonly errorProps?: FieldErrorClientProps
+ readonly field: TFieldClient
/**
- * forceRender is added by RenderField automatically
+ * `forceRender` is added by RenderField automatically.
*/
readonly forceRender?: boolean
- readonly labelProps?: LabelProps
+ readonly labelProps?: FieldLabelClientProps
readonly locale?: Locale
/**
- * forceRender is added by RenderField automatically. This should be used instead of field.admin.readOnly
+ * `readOnly` is added by RenderField automatically. This should be used instead of `field.admin.readOnly`.
*/
readonly readOnly?: boolean
readonly user?: User
diff --git a/packages/payload/src/admin/forms/FieldDescription.ts b/packages/payload/src/admin/forms/FieldDescription.ts
deleted file mode 100644
index 9ed831886..000000000
--- a/packages/payload/src/admin/forms/FieldDescription.ts
+++ /dev/null
@@ -1,23 +0,0 @@
-import type { CustomComponent, LabelFunction, ServerProps } from '../../config/types.js'
-import type { FieldTypes } from '../../fields/config/types.js'
-import type { MappedComponent } from '../types.js'
-
-export type DescriptionFunction = LabelFunction
-
-export type DescriptionComponent = CustomComponent<
- FieldDescriptionProps
->
-
-export type StaticDescription = Record | string
-
-export type Description = DescriptionFunction | StaticDescription
-export type GenericDescriptionProps = {
- readonly Description?: MappedComponent
- readonly className?: string
- readonly description?: StaticDescription
- readonly marginPlacement?: 'bottom' | 'top'
-}
-export type FieldDescriptionProps = {
- type: T
-} & GenericDescriptionProps &
- Partial
diff --git a/packages/payload/src/admin/forms/Label.ts b/packages/payload/src/admin/forms/Label.ts
index f3839d09c..c4fa71bea 100644
--- a/packages/payload/src/admin/forms/Label.ts
+++ b/packages/payload/src/admin/forms/Label.ts
@@ -1,5 +1,7 @@
-import type { CustomComponent, ServerProps, StaticLabel } from '../../config/types.js'
-import type { FieldTypes } from '../../fields/config/types.js'
+import type { MarkOptional } from 'ts-essentials'
+
+import type { ServerProps, StaticLabel } from '../../config/types.js'
+import type { ClientField, Field } from '../../fields/config/types.js'
import type { MappedComponent } from '../types.js'
export type GenericLabelProps = {
@@ -11,14 +13,28 @@ export type GenericLabelProps = {
readonly unstyled?: boolean
}
-export type LabelProps = {
- type: T
+type ClientFieldWithOptionalType = MarkOptional
+
+export type FieldLabelClientProps<
+ TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,
+> = {
+ field: TFieldClient
+} & GenericLabelProps
+
+export type FieldLabelServerProps = {
+ field: TFieldServer
} & GenericLabelProps &
Partial
-export type SanitizedLabelProps = Omit<
- LabelProps,
+export type SanitizedLabelProps = Omit<
+ FieldLabelClientProps,
'label' | 'required'
>
-export type LabelComponent = CustomComponent>
+export type FieldLabelClientComponent<
+ TFieldClient extends ClientFieldWithOptionalType = ClientFieldWithOptionalType,
+> = React.ComponentType>
+
+export type FieldLabelServerComponent = React.ComponentType<
+ FieldLabelServerProps
+>
diff --git a/packages/payload/src/admin/types.ts b/packages/payload/src/admin/types.ts
index a86e121ec..dad3c7dd6 100644
--- a/packages/payload/src/admin/types.ts
+++ b/packages/payload/src/admin/types.ts
@@ -33,172 +33,237 @@ export type {
} from './elements/WithServerSideProps.js'
export type {
- ArrayFieldDescriptionComponent,
- ArrayFieldErrorComponent,
- ArrayFieldLabelComponent,
+ ArrayFieldDescriptionClientComponent,
+ ArrayFieldDescriptionServerComponent,
+ ArrayFieldErrorClientComponent,
+ ArrayFieldErrorServerComponent,
+ ArrayFieldLabelClientComponent,
+ ArrayFieldLabelServerComponent,
ArrayFieldProps,
} from './fields/Array.js'
export type {
- BlockFieldDescriptionComponent,
- BlockFieldErrorComponent,
- BlockFieldLabelComponent,
+ BlockFieldDescriptionClientComponent,
+ BlockFieldDescriptionServerComponent,
+ BlockFieldErrorClientComponent,
+ BlockFieldErrorServerComponent,
+ BlockFieldLabelClientComponent,
+ BlockFieldLabelServerComponent,
BlockFieldProps,
} from './fields/Blocks.js'
export type {
- CheckboxFieldDescriptionComponent,
- CheckboxFieldErrorComponent,
- CheckboxFieldLabelComponent,
+ CheckboxFieldDescriptionClientComponent,
+ CheckboxFieldDescriptionServerComponent,
+ CheckboxFieldErrorClientComponent,
+ CheckboxFieldErrorServerComponent,
+ CheckboxFieldLabelClientComponent,
+ CheckboxFieldLabelServerComponent,
CheckboxFieldProps,
} from './fields/Checkbox.js'
export type {
- CodeFieldDescriptionComponent,
- CodeFieldErrorComponent,
- CodeFieldLabelComponent,
+ CodeFieldDescriptionClientComponent,
+ CodeFieldDescriptionServerComponent,
+ CodeFieldErrorClientComponent,
+ CodeFieldErrorServerComponent,
+ CodeFieldLabelClientComponent,
+ CodeFieldLabelServerComponent,
CodeFieldProps,
} from './fields/Code.js'
export type {
- CollapsibleFieldDescriptionComponent,
- CollapsibleFieldErrorComponent,
- CollapsibleFieldLabelComponent,
+ CollapsibleFieldDescriptionClientComponent,
+ CollapsibleFieldDescriptionServerComponent,
+ CollapsibleFieldErrorClientComponent,
+ CollapsibleFieldErrorServerComponent,
+ CollapsibleFieldLabelClientComponent,
+ CollapsibleFieldLabelServerComponent,
CollapsibleFieldProps,
} from './fields/Collapsible.js'
export type {
- DateFieldDescriptionComponent,
- DateFieldErrorComponent,
- DateFieldLabelComponent,
+ DateFieldDescriptionClientComponent,
+ DateFieldDescriptionServerComponent,
+ DateFieldErrorClientComponent,
+ DateFieldErrorServerComponent,
+ DateFieldLabelClientComponent,
+ DateFieldLabelServerComponent,
DateFieldProps,
} from './fields/Date.js'
export type {
- EmailFieldDescriptionComponent,
- EmailFieldErrorComponent,
- EmailFieldLabelComponent,
+ EmailFieldDescriptionClientComponent,
+ EmailFieldDescriptionServerComponent,
+ EmailFieldErrorClientComponent,
+ EmailFieldErrorServerComponent,
+ EmailFieldLabelClientComponent,
+ EmailFieldLabelServerComponent,
EmailFieldProps,
} from './fields/Email.js'
export type {
- GroupFieldDescriptionComponent,
- GroupFieldErrorComponent,
- GroupFieldLabelComponent,
+ GroupFieldDescriptionClientComponent,
+ GroupFieldDescriptionServerComponent,
+ GroupFieldErrorClientComponent,
+ GroupFieldErrorServerComponent,
+ GroupFieldLabelClientComponent,
+ GroupFieldLabelServerComponent,
GroupFieldProps,
} from './fields/Group.js'
-export type {
- HiddenFieldDescriptionComponent,
- HiddenFieldErrorComponent,
- HiddenFieldLabelComponent,
- HiddenFieldProps,
-} from './fields/Hidden.js'
+export type { HiddenFieldProps } from './fields/Hidden.js'
export type {
- JSONFieldDescriptionComponent,
- JSONFieldErrorComponent,
- JSONFieldLabelComponent,
+ JSONFieldDescriptionClientComponent,
+ JSONFieldDescriptionServerComponent,
+ JSONFieldErrorClientComponent,
+ JSONFieldErrorServerComponent,
+ JSONFieldLabelClientComponent,
+ JSONFieldLabelServerComponent,
JSONFieldProps,
} from './fields/JSON.js'
export type {
- NumberFieldDescriptionComponent,
- NumberFieldErrorComponent,
- NumberFieldLabelComponent,
+ NumberFieldDescriptionClientComponent,
+ NumberFieldDescriptionServerComponent,
+ NumberFieldErrorClientComponent,
+ NumberFieldErrorServerComponent,
+ NumberFieldLabelClientComponent,
+ NumberFieldLabelServerComponent,
NumberFieldProps,
} from './fields/Number.js'
export type {
- PointFieldDescriptionComponent,
- PointFieldErrorComponent,
- PointFieldLabelComponent,
+ PointFieldDescriptionClientComponent,
+ PointFieldDescriptionServerComponent,
+ PointFieldErrorClientComponent,
+ PointFieldErrorServerComponent,
+ PointFieldLabelClientComponent,
+ PointFieldLabelServerComponent,
PointFieldProps,
} from './fields/Point.js'
export type {
- RadioFieldDescriptionComponent,
- RadioFieldErrorComponent,
- RadioFieldLabelComponent,
+ RadioFieldDescriptionClientComponent,
+ RadioFieldDescriptionServerComponent,
+ RadioFieldErrorClientComponent,
+ RadioFieldErrorServerComponent,
+ RadioFieldLabelClientComponent,
+ RadioFieldLabelServerComponent,
RadioFieldProps,
} from './fields/Radio.js'
export type {
- RelationshipFieldDescriptionComponent,
- RelationshipFieldErrorComponent,
- RelationshipFieldLabelComponent,
+ RelationshipFieldDescriptionClientComponent,
+ RelationshipFieldDescriptionServerComponent,
+ RelationshipFieldErrorClientComponent,
+ RelationshipFieldErrorServerComponent,
+ RelationshipFieldLabelClientComponent,
+ RelationshipFieldLabelServerComponent,
RelationshipFieldProps,
} from './fields/Relationship.js'
export type {
- RichTextFieldDescriptionComponent,
- RichTextFieldErrorComponent,
- RichTextFieldLabelComponent,
+ RichTextFieldDescriptionClientComponent,
+ RichTextFieldDescriptionServerComponent,
+ RichTextFieldErrorClientComponent,
+ RichTextFieldErrorServerComponent,
+ RichTextFieldLabelClientComponent,
+ RichTextFieldLabelServerComponent,
RichTextFieldProps,
} from './fields/RichText.js'
export type {
- RowFieldDescriptionComponent,
- RowFieldErrorComponent,
- RowFieldLabelComponent,
+ RowFieldDescriptionClientComponent,
+ RowFieldDescriptionServerComponent,
+ RowFieldErrorClientComponent,
+ RowFieldErrorServerComponent,
+ RowFieldLabelClientComponent,
+ RowFieldLabelServerComponent,
RowFieldProps,
} from './fields/Row.js'
export type {
- SelectFieldDescriptionComponent,
- SelectFieldErrorComponent,
- SelectFieldLabelComponent,
+ SelectFieldDescriptionClientComponent,
+ SelectFieldDescriptionServerComponent,
+ SelectFieldErrorClientComponent,
+ SelectFieldErrorServerComponent,
+ SelectFieldLabelClientComponent,
+ SelectFieldLabelServerComponent,
SelectFieldProps,
} from './fields/Select.js'
export type {
ClientTab,
- TabsFieldDescriptionComponent,
- TabsFieldErrorComponent,
- TabsFieldLabelComponent,
+ TabsFieldDescriptionClientComponent,
+ TabsFieldDescriptionServerComponent,
+ TabsFieldErrorClientComponent,
+ TabsFieldErrorServerComponent,
+ TabsFieldLabelClientComponent,
+ TabsFieldLabelServerComponent,
TabsFieldProps,
} from './fields/Tabs.js'
export type {
- TextFieldDescriptionComponent,
- TextFieldErrorComponent,
- TextFieldLabelComponent,
+ TextFieldDescriptionClientComponent,
+ TextFieldDescriptionServerComponent,
+ TextFieldErrorClientComponent,
+ TextFieldErrorServerComponent,
+ TextFieldLabelClientComponent,
+ TextFieldLabelServerComponent,
TextFieldProps,
} from './fields/Text.js'
export type {
- TextareaFieldDescriptionComponent,
- TextareaFieldErrorComponent,
- TextareaFieldLabelComponent,
+ TextareaFieldDescriptionClientComponent,
+ TextareaFieldDescriptionServerComponent,
+ TextareaFieldErrorClientComponent,
+ TextareaFieldErrorServerComponent,
+ TextareaFieldLabelClientComponent,
+ TextareaFieldLabelServerComponent,
TextareaFieldProps,
} from './fields/Textarea.js'
export type {
- UploadFieldDescriptionComponent,
- UploadFieldErrorComponent,
- UploadFieldLabelComponent,
+ UploadFieldDescriptionClientComponent,
+ UploadFieldDescriptionServerComponent,
+ UploadFieldErrorClientComponent,
+ UploadFieldErrorServerComponent,
+ UploadFieldLabelClientComponent,
+ UploadFieldLabelServerComponent,
UploadFieldProps,
} from './fields/Upload.js'
-export type { ErrorComponent, ErrorProps, GenericErrorProps } from './forms/Error.js'
-
-export type { FormFieldBase } from './forms/Field.js'
-
export type {
Description,
- DescriptionComponent,
DescriptionFunction,
- FieldDescriptionProps,
+ FieldDescriptionClientComponent,
+ FieldDescriptionClientProps,
+ FieldDescriptionServerComponent,
+ FieldDescriptionServerProps,
GenericDescriptionProps,
StaticDescription,
-} from './forms/FieldDescription.js'
+} from './forms/Description.js'
+
+export type {
+ FieldErrorClientComponent,
+ FieldErrorClientProps,
+ FieldErrorServerComponent,
+ FieldErrorServerProps,
+ GenericErrorProps,
+} from './forms/Error.js'
+
+export type { FormFieldBase } from './forms/Field.js'
export type { Data, FilterOptionsResult, FormField, FormState, Row } from './forms/Form.js'
export type {
+ FieldLabelClientComponent,
+ FieldLabelClientProps,
+ FieldLabelServerComponent,
+ FieldLabelServerProps,
GenericLabelProps,
- LabelComponent,
- LabelProps,
SanitizedLabelProps,
} from './forms/Label.js'
@@ -241,14 +306,20 @@ export type MappedComponent(
component: { Component: React.FC } | PayloadComponent | null,
- props: object,
+ props: {
+ clientProps?: JsonObject
+ serverProps?: object
+ },
fallback: React.FC,
identifier: string,
): MappedComponent(
components: ({ Component: React.FC } | PayloadComponent)[],
- props: object,
+ props: {
+ clientProps?: JsonObject
+ serverProps?: object
+ },
fallback: React.FC,
identifier: string,
): MappedComponent[]
diff --git a/packages/payload/src/collections/config/client.ts b/packages/payload/src/collections/config/client.ts
index 78ca51648..b19a9b20e 100644
--- a/packages/payload/src/collections/config/client.ts
+++ b/packages/payload/src/collections/config/client.ts
@@ -1,4 +1,4 @@
-import type { MappedComponent } from '../../admin/types.js'
+import type { MappedComponent, StaticDescription } from '../../admin/types.js'
import type { MappedView } from '../../admin/views/types.js'
import type { LivePreviewConfig, ServerOnlyLivePreviewProperties } from '../../config/types.js'
import type { ClientField } from '../../fields/config/client.js'
@@ -46,7 +46,7 @@ export type ClientCollectionConfig = {
}
}
}
- description?: Record | string
+ description?: StaticDescription
livePreview?: Omit
} & Omit<
SanitizedCollectionConfig['admin'],
diff --git a/packages/payload/src/config/types.ts b/packages/payload/src/config/types.ts
index cbc4eed99..a6c9e7b0d 100644
--- a/packages/payload/src/config/types.ts
+++ b/packages/payload/src/config/types.ts
@@ -398,14 +398,14 @@ export type EditViewConfig = {
)
export type ServerProps = {
- [key: string]: unknown
- i18n: I18nClient
- locale?: Locale
- params?: { [key: string]: string | string[] | undefined }
- payload: Payload
- permissions?: Permissions
- searchParams?: { [key: string]: string | string[] | undefined }
- user?: TypedUser
+ readonly i18n: I18nClient
+ readonly locale?: Locale
+ readonly params?: { [key: string]: string | string[] | undefined }
+ readonly payload: Payload
+ readonly permissions?: Permissions
+ readonly [key: string]: unknown
+ readonly searchParams?: { [key: string]: string | string[] | undefined }
+ readonly user?: TypedUser
}
export const serverProps: (keyof ServerProps)[] = [
diff --git a/packages/payload/src/fields/config/types.ts b/packages/payload/src/fields/config/types.ts
index 7b651f14e..fe80667b3 100644
--- a/packages/payload/src/fields/config/types.ts
+++ b/packages/payload/src/fields/config/types.ts
@@ -6,16 +6,97 @@ import type { CSSProperties } from 'react'
import type { DeepUndefinable } from 'ts-essentials'
import type { RichTextAdapter, RichTextAdapterProvider } from '../../admin/RichText.js'
-import type { ErrorComponent } from '../../admin/forms/Error.js'
import type {
+ ArrayFieldErrorClientComponent,
+ ArrayFieldErrorServerComponent,
+ ArrayFieldLabelClientComponent,
+ ArrayFieldLabelServerComponent,
+ ArrayFieldProps,
+ BlockFieldErrorClientComponent,
+ BlockFieldErrorServerComponent,
+ BlockFieldProps,
+ CheckboxFieldErrorClientComponent,
+ CheckboxFieldErrorServerComponent,
+ CheckboxFieldLabelClientComponent,
+ CheckboxFieldLabelServerComponent,
+ CheckboxFieldProps,
ClientTab,
+ CodeFieldErrorClientComponent,
+ CodeFieldErrorServerComponent,
+ CodeFieldLabelClientComponent,
+ CodeFieldLabelServerComponent,
+ CodeFieldProps,
+ CollapsibleFieldLabelClientComponent,
+ CollapsibleFieldLabelServerComponent,
+ CollapsibleFieldProps,
ConditionalDateProps,
+ DateFieldErrorClientComponent,
+ DateFieldErrorServerComponent,
+ DateFieldLabelClientComponent,
+ DateFieldLabelServerComponent,
+ DateFieldProps,
Description,
- DescriptionComponent,
- LabelComponent,
+ EmailFieldErrorClientComponent,
+ EmailFieldErrorServerComponent,
+ EmailFieldLabelClientComponent,
+ EmailFieldLabelServerComponent,
+ EmailFieldProps,
+ FieldDescriptionClientComponent,
+ FieldDescriptionServerComponent,
+ GroupFieldLabelClientComponent,
+ GroupFieldLabelServerComponent,
+ GroupFieldProps,
+ HiddenFieldProps,
+ JSONFieldErrorClientComponent,
+ JSONFieldErrorServerComponent,
+ JSONFieldLabelClientComponent,
+ JSONFieldLabelServerComponent,
+ JSONFieldProps,
MappedComponent,
+ NumberFieldErrorClientComponent,
+ NumberFieldErrorServerComponent,
+ NumberFieldLabelClientComponent,
+ NumberFieldLabelServerComponent,
+ NumberFieldProps,
+ PointFieldErrorClientComponent,
+ PointFieldErrorServerComponent,
+ PointFieldLabelClientComponent,
+ PointFieldLabelServerComponent,
+ PointFieldProps,
+ RadioFieldErrorClientComponent,
+ RadioFieldErrorServerComponent,
+ RadioFieldLabelClientComponent,
+ RadioFieldLabelServerComponent,
+ RadioFieldProps,
+ RelationshipFieldErrorClientComponent,
+ RelationshipFieldErrorServerComponent,
+ RelationshipFieldLabelClientComponent,
+ RelationshipFieldLabelServerComponent,
+ RelationshipFieldProps,
+ RichTextFieldProps,
+ RowFieldProps,
RowLabelComponent,
+ SelectFieldErrorClientComponent,
+ SelectFieldErrorServerComponent,
+ SelectFieldLabelClientComponent,
+ SelectFieldLabelServerComponent,
+ SelectFieldProps,
StaticDescription,
+ TabsFieldProps,
+ TextFieldErrorClientComponent,
+ TextFieldErrorServerComponent,
+ TextFieldLabelClientComponent,
+ TextFieldLabelServerComponent,
+ TextareaFieldErrorClientComponent,
+ TextareaFieldErrorServerComponent,
+ TextareaFieldLabelClientComponent,
+ TextareaFieldLabelServerComponent,
+ TextareaFieldProps,
+ UploadFieldErrorClientComponent,
+ UploadFieldErrorServerComponent,
+ UploadFieldLabelClientComponent,
+ UploadFieldLabelServerComponent,
+ UploadFieldProps,
} from '../../admin/types.js'
import type { SanitizedCollectionConfig, TypeWithID } from '../../collections/config/types.js'
import type {
@@ -148,7 +229,7 @@ type Admin = {
className?: string
components?: {
Cell?: CustomComponent
- Description?: DescriptionComponent
+ Description?: CustomComponent
Field?: CustomComponent
/**
* The Filter component has to be a client component
@@ -339,8 +420,8 @@ export type NumberField = {
/** Set this property to a string that will be used for browser autocomplete. */
autoComplete?: string
components?: {
- Error?: ErrorComponent
- Label?: LabelComponent
+ Error?: CustomComponent
+ Label?: CustomComponent
afterInput?: CustomComponent[]
beforeInput?: CustomComponent[]
} & Admin['components']
@@ -392,8 +473,8 @@ export type TextField = {
admin?: {
autoComplete?: string
components?: {
- Error?: ErrorComponent
- Label?: LabelComponent
+ Error?: CustomComponent