Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion packages/ui/src/fields/FieldDescription/index.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@layer payload-default {
.field-description {
display: flex;
color: var(--text-tertiary);
color: var(--text-secondary);
}

.field-description--margin-bottom {
Expand Down
14 changes: 7 additions & 7 deletions packages/ui/src/fields/Group/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down Expand Up @@ -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 {
Expand Down
18 changes: 9 additions & 9 deletions packages/ui/src/fields/Group/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -81,8 +81,8 @@ export const GroupFieldComponent: GroupFieldClientComponent = (props) => {
<div className={`${baseClass}__wrap`}>
{Boolean(Label || Description || label || fieldHasErrors) && (
<div className={`${baseClass}__header`}>
{Boolean(Label || Description || label) && (
<header>
<div className={`${baseClass}__title-row`}>
Comment thread
PatrikKozak marked this conversation as resolved.
{Boolean(Label || Description || label) && (
<RenderCustomComponent
CustomComponent={Label}
Fallback={
Expand All @@ -97,13 +97,13 @@ export const GroupFieldComponent: GroupFieldClientComponent = (props) => {
</h3>
}
/>
<RenderCustomComponent
CustomComponent={Description}
Fallback={<FieldDescription description={description} path={path} />}
/>
</header>
)}
{fieldHasErrors && <ErrorPill count={errorCount} i18n={i18n} withMessage />}
)}
{fieldHasErrors && <ErrorPill count={errorCount} i18n={i18n} withMessage />}
</div>
<RenderCustomComponent
CustomComponent={Description}
Fallback={<FieldDescription description={description} path={path} />}
/>
</div>
)}
{BeforeInput}
Expand Down
38 changes: 38 additions & 0 deletions test/v4/collections/Group/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,9 @@ const GroupFields: CollectionConfig = {
name: 'shippingInfo',
type: 'group',
label: 'Shipping Info',
admin: {
description: 'Enter the shipping address details',
},
fields: [
{
name: 'name',
Expand Down Expand Up @@ -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,
},
],
},
],
}

Expand Down
Loading