diff --git a/packages/dataviews/CHANGELOG.md b/packages/dataviews/CHANGELOG.md index 5dac1b82db9fc2..d9268a9003d8c2 100644 --- a/packages/dataviews/CHANGELOG.md +++ b/packages/dataviews/CHANGELOG.md @@ -6,6 +6,10 @@ - Revert the ability to hide the view config via `config` prop and export a `DataViews.Footer` component to support the "Minimal UI" story. [#71276](https://github.com/WordPress/gutenberg/pull/71276) +### Enhancements + +- DataForm: add description support for the combined fields and show the description in the Card layout ([#71380](https://github.com/WordPress/gutenberg/pull/71380)). + ### Bug Fixes - DataViews: Fix incorrect documentation for `defaultLayouts` prop. [#71334](https://github.com/WordPress/gutenberg/pull/71334) diff --git a/packages/dataviews/src/components/dataform/stories/index.story.tsx b/packages/dataviews/src/components/dataform/stories/index.story.tsx index b3c581d6a20198..21f48e195dde56 100644 --- a/packages/dataviews/src/components/dataform/stories/index.story.tsx +++ b/packages/dataviews/src/components/dataform/stories/index.story.tsx @@ -671,6 +671,8 @@ const LayoutCardComponent = ( { withHeader }: { withHeader: boolean } ) => { { id: 'customerCard', label: 'Customer', + description: + 'Enter your contact details, plan type, and addresses to complete your customer information.', children: [ { id: 'customerContact', diff --git a/packages/dataviews/src/dataforms-layouts/card/index.tsx b/packages/dataviews/src/dataforms-layouts/card/index.tsx index 93d9aa9637798c..7fd0a26462ea8e 100644 --- a/packages/dataviews/src/dataforms-layouts/card/index.tsx +++ b/packages/dataviews/src/dataforms-layouts/card/index.tsx @@ -104,6 +104,11 @@ export default function FormCardField< Item >( { // If it doesn't have a header, keep it open. // Otherwise, the card will not be visible. + { field.description && ( +
+ { field.description } +
+ ) } ; };