@@ -15,6 +15,7 @@ import {
1515 Drawer ,
1616 Checkbox ,
1717 VisuallyHidden ,
18+ Stack ,
1819} from "ol-components"
1920
2021import {
@@ -60,8 +61,6 @@ const StyledResourceTabs = styled(ResourceCategoryTabs.TabList)`
6061`
6162
6263const DesktopSortContainer = styled . div `
63- float: right;
64-
6564 ${ ( { theme } ) => theme . breakpoints . down ( "md" ) } {
6665 display: none;
6766 }
@@ -439,10 +438,17 @@ const MobileFacetsTitleContainer = styled.div`
439438 }
440439`
441440
442- const StyledGridContainer = styled ( GridContainer ) `
441+ const ReversedGridContainer = styled ( GridContainer ) `
443442 max-width: 1272px !important;
444443 margin-left: 0 !important;
445444 width: 100% !important;
445+
446+ /**
447+ We want the facets to be visually on left, but occur second in the DOM / tab
448+ order. This makes it easier for keyboard navigators to get directly to the
449+ search results.
450+ */
451+ flex-direction: row-reverse;
446452`
447453
448454const ExplanationContainer = styled . div `
@@ -860,33 +866,8 @@ const SearchDisplay: React.FC<SearchDisplayProps> = ({
860866
861867 return (
862868 < Container >
863- < StyledGridContainer >
869+ < ReversedGridContainer >
864870 < ResourceCategoryTabs . Context activeTabName = { activeTab . name } >
865- < DesktopFiltersColumn
866- component = "section"
867- variant = "sidebar-2"
868- data-testid = "facets-container"
869- >
870- < FacetsTitleContainer >
871- < FilterTitle >
872- < Typography component = { filterHeadingEl } variant = "subtitle1" >
873- Filter
874- </ Typography >
875- < RiEqualizerLine fontSize = "medium" />
876- </ FilterTitle >
877- { hasFacets ? (
878- < Button
879- variant = "text"
880- color = "secondary"
881- size = "small"
882- onClick = { clearAllFacets }
883- >
884- Clear all
885- </ Button >
886- ) : null }
887- </ FacetsTitleContainer >
888- { filterContents }
889- </ DesktopFiltersColumn >
890871 < StyledMainColumn component = "section" variant = "main-2" >
891872 < VisuallyHidden as = { resultsHeadingEl } >
892873 Search Results
@@ -901,13 +882,15 @@ const SearchDisplay: React.FC<SearchDisplayProps> = ({
901882 */ }
902883 { isFetching || isLoading ? "" : `${ data ?. count } results` }
903884 </ VisuallyHidden >
904- < DesktopSortContainer > { sortDropdown } </ DesktopSortContainer >
905- < StyledResourceTabs
906- setSearchParams = { setSearchParams }
907- tabs = { TABS }
908- aggregations = { data ?. metadata . aggregations }
909- onTabChange = { ( ) => setPage ( 1 ) }
910- />
885+ < Stack direction = "row" justifyContent = "space-between" >
886+ < StyledResourceTabs
887+ setSearchParams = { setSearchParams }
888+ tabs = { TABS }
889+ aggregations = { data ?. metadata . aggregations }
890+ onTabChange = { ( ) => setPage ( 1 ) }
891+ />
892+ < DesktopSortContainer > { sortDropdown } </ DesktopSortContainer >
893+ </ Stack >
911894 < ResourceCategoryTabs . TabPanels tabs = { TABS } >
912895 < MobileFilter >
913896 < Button variant = "text" onClick = { toggleMobileDrawer ( true ) } >
@@ -1011,8 +994,33 @@ const SearchDisplay: React.FC<SearchDisplayProps> = ({
1011994 </ PaginationContainer >
1012995 </ ResourceCategoryTabs . TabPanels >
1013996 </ StyledMainColumn >
997+ < DesktopFiltersColumn
998+ component = "section"
999+ variant = "sidebar-2"
1000+ data-testid = "facets-container"
1001+ >
1002+ < FacetsTitleContainer >
1003+ < FilterTitle >
1004+ < Typography component = { filterHeadingEl } variant = "subtitle1" >
1005+ Filter
1006+ </ Typography >
1007+ < RiEqualizerLine fontSize = "medium" />
1008+ </ FilterTitle >
1009+ { hasFacets ? (
1010+ < Button
1011+ variant = "text"
1012+ color = "secondary"
1013+ size = "small"
1014+ onClick = { clearAllFacets }
1015+ >
1016+ Clear all
1017+ </ Button >
1018+ ) : null }
1019+ </ FacetsTitleContainer >
1020+ { filterContents }
1021+ </ DesktopFiltersColumn >
10141022 </ ResourceCategoryTabs . Context >
1015- </ StyledGridContainer >
1023+ </ ReversedGridContainer >
10161024 </ Container >
10171025 )
10181026}
0 commit comments