1+ import { useId } from 'react' ;
12import { Link } from '@tanstack/react-router' ;
23import { css } from '@linaria/core' ;
34
45import type { Direction } from '../src/types' ;
56
6- const navClassname = css `
7- display : flex;
8- flex-direction : column;
9- white-space : nowrap;
10-
7+ const headerClassname = css `
118 border-inline-start : 4px solid light-dark (hsl (210deg 50% 80% ), hsl (210deg 50% 40% ));
129
10+ h1 {
11+ font-size : 24px ;
12+ }
13+
1314 h1 ,
1415 h2 {
1516 margin : 8px ;
1617 }
18+ ` ;
19+
20+ const navClassname = css `
21+ display : flex;
22+ flex-direction : column;
23+ white-space : nowrap;
1724
1825 a {
1926 color : inherit;
2027 font-size : 14px ;
2128 line-height : 22px ;
2229 text-decoration : none;
23- padding-block : 0 ;
30+ padding-block : 2 px ;
2431 padding-inline : 16px ;
2532 transition : 0.1s background-color;
2633
@@ -49,57 +56,67 @@ interface Props {
4956}
5057
5158export default function Nav ( { direction, onDirectionChange } : Props ) {
59+ const demosNavId = useId ( ) ;
60+ const linksNavId = useId ( ) ;
61+
5262 return (
53- < nav className = { navClassname } >
63+ < header className = { headerClassname } >
5464 < h1 > react-data-grid</ h1 >
65+ < nav aria-labelledby = { demosNavId } className = { navClassname } >
66+ < h2 id = { demosNavId } > Demos</ h2 >
67+ < Link to = "/CommonFeatures" > Common Features</ Link >
68+ < Link to = "/AllFeatures" > All Features</ Link >
69+ < Link to = "/CellNavigation" > Cell Navigation</ Link >
70+ < Link to = "/ColumnSpanning" > Column Spanning</ Link >
71+ < Link to = "/ColumnGrouping" > Column Grouping</ Link >
72+ < Link to = "/ColumnsReordering" > Columns Reordering</ Link >
73+ < Link to = "/ContextMenu" > Context Menu</ Link >
74+ < Link to = "/CustomizableRenderers" > Customizable Renderers</ Link >
75+ < Link to = "/RowGrouping" > Row Grouping</ Link >
76+ < Link to = "/HeaderFilters" > Header Filters</ Link >
77+ < Link to = "/InfiniteScrolling" > Infinite Scrolling</ Link >
78+ < Link to = "/MasterDetail" > Master Detail</ Link >
79+ < Link to = "/MillionCells" > A Million Cells</ Link >
80+ < Link to = "/NoRows" > No Rows</ Link >
81+ < Link to = "/ResizableGrid" > Resizable Grid</ Link >
82+ < Link to = "/RowsReordering" > Rows Reordering</ Link >
83+ < Link to = "/ScrollToCell" > Scroll To Cell</ Link >
84+ < Link to = "/TreeView" > Tree View</ Link >
85+ < Link to = "/VariableRowHeight" > Variable Row Height</ Link >
86+ < Link to = "/Animation" > Animation</ Link >
87+ </ nav >
5588
56- < h2 > Demos</ h2 >
57- < Link to = "/CommonFeatures" > Common Features</ Link >
58- < Link to = "/AllFeatures" > All Features</ Link >
59- < Link to = "/CellNavigation" > Cell Navigation</ Link >
60- < Link to = "/ColumnSpanning" > Column Spanning</ Link >
61- < Link to = "/ColumnGrouping" > Column Grouping</ Link >
62- < Link to = "/ColumnsReordering" > Columns Reordering</ Link >
63- < Link to = "/ContextMenu" > Context Menu</ Link >
64- < Link to = "/CustomizableRenderers" > Customizable Renderers</ Link >
65- < Link to = "/RowGrouping" > Row Grouping</ Link >
66- < Link to = "/HeaderFilters" > Header Filters</ Link >
67- < Link to = "/InfiniteScrolling" > Infinite Scrolling</ Link >
68- < Link to = "/MasterDetail" > Master Detail</ Link >
69- < Link to = "/MillionCells" > A Million Cells</ Link >
70- < Link to = "/NoRows" > No Rows</ Link >
71- < Link to = "/ResizableGrid" > Resizable Grid</ Link >
72- < Link to = "/RowsReordering" > Rows Reordering</ Link >
73- < Link to = "/ScrollToCell" > Scroll To Cell</ Link >
74- < Link to = "/TreeView" > Tree View</ Link >
75- < Link to = "/VariableRowHeight" > Variable Row Height</ Link >
76- < Link to = "/Animation" > Animation</ Link >
77-
78- < h2 > Links</ h2 >
79- < a
80- href = "https://github.com/adazzle/react-data-grid/blob/main/README.md"
81- target = "_blank"
82- rel = "noreferrer"
83- >
84- Documentation
85- </ a >
86- < a
87- href = "https://github.com/adazzle/react-data-grid/blob/main/CHANGELOG.md"
88- target = "_blank"
89- rel = "noreferrer"
90- >
91- Changelog
92- </ a >
93- < a
94- href = "https://github.com/adazzle/react-data-grid/discussions"
95- target = "_blank"
96- rel = "noreferrer"
97- >
98- Discussions
99- </ a >
100- < a href = "https://github.com/adazzle/react-data-grid/issues" target = "_blank" rel = "noreferrer" >
101- Issues
102- </ a >
89+ < nav aria-labelledby = { linksNavId } className = { navClassname } >
90+ < h2 id = { linksNavId } > Links</ h2 >
91+ < a
92+ href = "https://github.com/adazzle/react-data-grid/blob/main/README.md"
93+ target = "_blank"
94+ rel = "noreferrer"
95+ >
96+ Documentation
97+ </ a >
98+ < a
99+ href = "https://github.com/adazzle/react-data-grid/blob/main/CHANGELOG.md"
100+ target = "_blank"
101+ rel = "noreferrer"
102+ >
103+ Changelog
104+ </ a >
105+ < a
106+ href = "https://github.com/adazzle/react-data-grid/discussions"
107+ target = "_blank"
108+ rel = "noreferrer"
109+ >
110+ Discussions
111+ </ a >
112+ < a
113+ href = "https://github.com/adazzle/react-data-grid/issues"
114+ target = "_blank"
115+ rel = "noreferrer"
116+ >
117+ Issues
118+ </ a >
119+ </ nav >
103120
104121 < h2 > Direction</ h2 >
105122 < label className = { rtlCheckboxClassname } >
@@ -110,6 +127,6 @@ export default function Nav({ direction, onDirectionChange }: Props) {
110127 />
111128 Right to left
112129 </ label >
113- </ nav >
130+ </ header >
114131 ) ;
115132}
0 commit comments