import type { ReactNode } from 'react'; import { Box, Container } from '@chakra-ui/react'; type PageSectionProps = { // Id of the heading that names this section for assistive technology. // Without it (a block without a heading) the section is no landmark. labelledBy?: string; id?: string; tone?: 'paper' | 'alt'; // full: no content column, for edge-to-edge content; the section then // places its own Container around what should stay in the column width?: 'default' | 'narrow' | 'full'; // flushTop: no space above, for the first block right below a page head // (design .section--flush-top) spacing?: 'default' | 'tight' | 'flushTop'; 'data-testid'?: string; children: ReactNode; }; // Frame of a content section on any page (design .section): vertical // rhythm, an optional alternate background and the content column. export default function PageSection({ labelledBy, id, tone = 'paper', width = 'default', spacing = 'default', 'data-testid': testId, children, }: PageSectionProps) { const padding = spacing === 'tight' ? 'sectionYTight' : 'sectionY'; return ( {width === 'full' ? ( children ) : ( {children} )} ); }