From 0cd133045a95dacbac1165b3ae53e8dd06dc4611 Mon Sep 17 00:00:00 2001 From: Vincent Smedinga Date: Thu, 26 Oct 2023 13:16:24 +0200 Subject: [PATCH] Revert making Footer sections render their visually hidden headings --- packages/react/src/Footer/Footer.tsx | 59 +++---------------- .../src/Footer/Footer.stories.tsx | 7 +++ 2 files changed, 16 insertions(+), 50 deletions(-) diff --git a/packages/react/src/Footer/Footer.tsx b/packages/react/src/Footer/Footer.tsx index b9e2a0b3e5..be0e13ebb4 100644 --- a/packages/react/src/Footer/Footer.tsx +++ b/packages/react/src/Footer/Footer.tsx @@ -13,49 +13,15 @@ import { RefAttributes, } from 'react' import { GridCell, GridCellProps, PageGrid } from '../Grid' -import { Heading } from '../Heading' -import { HeadingLevel } from '../Heading/Heading' -import { VisuallyHidden } from '../VisuallyHidden' - -interface FooterHeadingProps extends HTMLAttributes { - /** - * Describes the scope of the footer menu to users of assistive technologies. - * @default 'Over deze website' - */ - heading?: string - /** - * The hierarchical level of the heading. - * @default 2 - */ - headingLevel?: HeadingLevel -} - -/** Renders a heading for screen readers at the top of both Footer sections. */ -const FooterHeading = ({ heading, headingLevel }: FooterHeadingProps) => { - if (!heading) { - return undefined - } - - return ( - - {heading} - - ) -} - -FooterHeading.displayName = 'FooterHeading' export const FooterTop = forwardRef( ( - { children, className, heading = 'Colofon', headingLevel = 2, ...restProps }: PropsWithChildren, + { children, className, ...restProps }: PropsWithChildren>, ref: ForwardedRef, ) => ( - <> - - - {children} - - + + {children} + ), ) @@ -65,7 +31,7 @@ export type FooterColumnProps = HTMLAttributes & GridCellProps export const FooterColumn = forwardRef( ({ children, className, ...restProps }: PropsWithChildren, ref: ForwardedRef) => ( - + {children} ), @@ -74,12 +40,8 @@ export const FooterColumn = forwardRef( FooterColumn.displayName = 'FooterColumn' export const FooterBottom = forwardRef( - ( - { children, className, heading = 'Over deze website', headingLevel = 2 }: PropsWithChildren, - ref: ForwardedRef, - ) => ( -
- + ({ children, className }: PropsWithChildren>, ref: ForwardedRef) => ( +
{children}
), @@ -89,10 +51,9 @@ FooterBottom.displayName = 'FooterBottom' interface FooterComponent extends ForwardRefExoticComponent> & RefAttributes> { + Top: typeof FooterTop Bottom: typeof FooterBottom Column: typeof FooterColumn - Heading: typeof FooterHeading - Top: typeof FooterTop } export const Footer = forwardRef( @@ -100,7 +61,7 @@ export const Footer = forwardRef( { children, className, ...restProps }: PropsWithChildren>, ref: ForwardedRef, ) => ( -