File tree Expand file tree Collapse file tree 2 files changed +8
-2
lines changed
packages/ui-components/src/Common/TableOfContents Expand file tree Collapse file tree 2 files changed +8
-2
lines changed Original file line number Diff line number Diff line change @@ -17,6 +17,8 @@ export const CustomDepth: Story = {
1717export default {
1818 component : TableOfContents ,
1919 args : {
20+ ariaLabel : 'Table of Contents' ,
21+ summaryTitle : 'On this page' ,
2022 headings : [
2123 {
2224 value : 'OpenSSL update assessment, and Node.js project plans' ,
Original file line number Diff line number Diff line change @@ -9,13 +9,17 @@ import styles from './index.module.css';
99
1010type TableOfContentsProps = {
1111 headings : Array < Heading > ;
12+ ariaLabel : string ;
13+ summaryTitle : string ;
1214 minDepth ?: number ;
1315 maxDepth ?: number ;
1416 as ?: LinkLike ;
1517} ;
1618
1719const TableOfContents : FC < TableOfContentsProps > = ( {
1820 headings,
21+ ariaLabel,
22+ summaryTitle,
1923 minDepth = 2 ,
2024 maxDepth = 4 ,
2125 as : Component = 'a' ,
@@ -25,8 +29,8 @@ const TableOfContents: FC<TableOfContentsProps> = ({
2529 ) ;
2630
2731 return (
28- < details className = { styles . details } aria-label = "Table of Contents" >
29- < summary className = { styles . summary } > On this page </ summary >
32+ < details className = { styles . details } aria-label = { ariaLabel } >
33+ < summary className = { styles . summary } > { summaryTitle } </ summary >
3034 < ul className = { styles . list } >
3135 { filteredHeadings . map ( ( head , index ) => (
3236 < li key = { head . data ?. id ?? index } >
You can’t perform that action at this time.
0 commit comments