import { __experimentalVStack as VStack, __experimentalHStack as HStack, __experimentalText as Text, } from '@wordpress/components'; import clsx from 'clsx'; import type { SectionHeaderProps } from './types'; import './style.scss'; /** * The SectionHeader component provides a consistently structured introduction * to a section of content, combining a title, optional description/decoration, * and contextual actions. It is used to add hierarchy and clarity within page * content or nested in composite components such as SummaryButtonList, or DataFormFields. */ export const SectionHeader = ( { title, description, actions, decoration, headingId, prefix, className, level = 2, }: SectionHeaderProps ) => { const HeadingTag = `h${ level }` as keyof JSX.IntrinsicElements; return ( { prefix &&
{ prefix }
} { decoration && ( { decoration } ) } { title } { /* The wrapper is always needed for view transitions. */ } { actions } { description && ( { description } ) }
); };