in src/stories/Dialog.stories.tsx [141:161]
function CustomHeader({
title,
subtitle,
dialogLabelId,
dialogDescriptionId,
onClose
}: React.PropsWithChildren<DialogProps & {dialogLabelId: string; dialogDescriptionId: string}>) {
const onCloseClick = useCallback(() => {
onClose('close-button')
}, [onClose])
if (typeof title === 'string' && typeof subtitle === 'string') {
return (
<Box bg="accent.subtle">
<h1 id={dialogLabelId}>{title.toUpperCase()}</h1>
<h2 id={dialogDescriptionId}>{subtitle.toLowerCase()}</h2>
<Dialog.CloseButton onClose={onCloseClick} />
</Box>
)
}
return null
}