diff --git a/packages/ui/src/fields/FieldDescription/index.css b/packages/ui/src/fields/FieldDescription/index.css index afb25a7b35d..3491c2a8c6d 100644 --- a/packages/ui/src/fields/FieldDescription/index.css +++ b/packages/ui/src/fields/FieldDescription/index.css @@ -1,7 +1,7 @@ @layer payload-default { .field-description { display: flex; - color: var(--text-tertiary); + color: var(--text-secondary); } .field-description--margin-bottom { diff --git a/packages/ui/src/fields/Group/index.css b/packages/ui/src/fields/Group/index.css index 3896132a49d..10e8c41e114 100644 --- a/packages/ui/src/fields/Group/index.css +++ b/packages/ui/src/fields/Group/index.css @@ -9,7 +9,7 @@ &::before { content: ''; position: absolute; - top: calc(var(--spacer-5) / 2); + top: calc(var(--spacer-5) / -2); left: calc(var(--gutter-h) * -1); right: calc(var(--gutter-h) * -1); height: 0; @@ -87,15 +87,15 @@ .group-field__header { margin-bottom: var(--spacer-2-5); + display: flex; + flex-direction: column; + gap: var(--spacer-1); + } + + .group-field__title-row { display: flex; align-items: center; gap: var(--spacer-2); - - > header { - display: flex; - flex-direction: column; - gap: var(--spacer-1); - } } .group-field__title { diff --git a/packages/ui/src/fields/Group/index.tsx b/packages/ui/src/fields/Group/index.tsx index 53e58ddfd26..debcfac10ee 100644 --- a/packages/ui/src/fields/Group/index.tsx +++ b/packages/ui/src/fields/Group/index.tsx @@ -81,8 +81,8 @@ export const GroupFieldComponent: GroupFieldClientComponent = (props) => {
{Boolean(Label || Description || label || fieldHasErrors) && (
- {Boolean(Label || Description || label) && ( -
+
+ {Boolean(Label || Description || label) && ( { } /> - } - /> -
- )} - {fieldHasErrors && } + )} + {fieldHasErrors && } +
+ } + />
)} {BeforeInput} diff --git a/test/v4/collections/Group/index.ts b/test/v4/collections/Group/index.ts index 6d66b97d78f..cce574f0e15 100644 --- a/test/v4/collections/Group/index.ts +++ b/test/v4/collections/Group/index.ts @@ -9,6 +9,9 @@ const GroupFields: CollectionConfig = { name: 'shippingInfo', type: 'group', label: 'Shipping Info', + admin: { + description: 'Enter the shipping address details', + }, fields: [ { name: 'name', @@ -37,6 +40,41 @@ const GroupFields: CollectionConfig = { }, ], }, + { + name: 'requiredInfo', + type: 'group', + label: 'Required Info', + admin: { + description: 'This group has required fields to test error state', + }, + fields: [ + { + name: 'requiredField', + type: 'text', + label: 'Required Field', + required: true, + }, + { + name: 'anotherRequired', + type: 'text', + label: 'Another Required', + required: true, + }, + ], + }, + { + type: 'group', + name: 'unnamedGroup', + label: '', + fields: [ + { + name: 'unnamedGroupField', + type: 'text', + label: 'Field in Unnamed Group', + required: true, + }, + ], + }, ], }