Skip to content

Commit 3111d00

Browse files
Merge branch 'dev' into itinerary-a11y-grouping-labels
2 parents c388b25 + f8fd93e commit 3111d00

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+1320
-765
lines changed

Diff for: i18n/en-US.yml

+7-1
Original file line numberDiff line numberDiff line change
@@ -130,8 +130,8 @@ components:
130130
closeMenu: Close Menu
131131
fieldTrip: Field Trip
132132
mailables: Mailables
133-
menuItemIconAlt: "Icon for {label} menu item"
134133
openMenu: Open Menu
134+
skipNavigation: Skip navigation
135135
BackToTripPlanner:
136136
backToTripPlanner: Back to trip planner
137137
BatchResultsScreen:
@@ -426,9 +426,12 @@ components:
426426
zoomToStop: Zoom to stop
427427

428428
SubNav:
429+
languages: "Languages"
429430
myAccount: My account
431+
selectALanguage: Select a language
430432
settings: Settings
431433
trips: Trips
434+
userMenu: Profile options
432435
SwitchButton:
433436
defaultContent: Switch
434437
switchLocations: Switch locations
@@ -555,6 +558,9 @@ components:
555558
bicyclesAllowed: Allowed
556559
header: Trip Viewer
557560
listOfRouteStops: List of stops on this route
561+
tripDescription: Board at {boardAtStop} and disembark at {disembarkAtStop}
562+
startOfTrip: Trip begins here
563+
endOfTrip: Trip ends here
558564
routeHeader: "Route: <strong>{routeShortName}</strong> {routeLongName}"
559565
viewStop: View
560566
UserAccountScreen:

Diff for: i18n/es.yml

-1
Original file line numberDiff line numberDiff line change
@@ -429,7 +429,6 @@ components:
429429
closeMenu: Cerrar Menú
430430
fieldTrip: Título del viaje
431431
mailables: Lista para publicar
432-
menuItemIconAlt: Icono del menú de {label}
433432
openMenu: Abrir Menú
434433
callHistory: Historial de llamadas
435434
BackToTripPlanner:

Diff for: i18n/fr.yml

+2-2
Original file line numberDiff line numberDiff line change
@@ -135,8 +135,8 @@ components:
135135
closeMenu: Fermer le menu
136136
fieldTrip: Groupes scolaires
137137
mailables: Prêt-à-poster
138-
menuItemIconAlt: "Icône pour le menu {label}"
139-
openMenu: "Ouvrir le menu"
138+
openMenu: Ouvrir le menu
139+
skipNavigation: Sauter la navigation
140140
BackToTripPlanner:
141141
backToTripPlanner: Retour au planificateur de trajets
142142
BatchResultsScreen:

Diff for: i18n/ko.yml

-1
Original file line numberDiff line numberDiff line change
@@ -392,7 +392,6 @@ components:
392392
AppMenu:
393393
callHistory: 통화 기록
394394
closeMenu: 메뉴를 닫습니다
395-
menuItemIconAlt: '{label} 메뉴 항목의 아이콘'
396395
fieldTrip: 여행 제목
397396
mailables: 게시 준비
398397
openMenu: 메뉴 열기

Diff for: i18n/vi.yml

-1
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,6 @@ components:
399399
\ {# xe đạp của {company} gần đó}\n }\n"
400400
AppMenu:
401401
mailables: Sẵn sàng để đăng
402-
menuItemIconAlt: Biểu tượng cho mục menu {label}
403402
openMenu: Mở thực đơn
404403
callHistory: Lịch sử cuộc gọi
405404
closeMenu: Đóng menu

Diff for: i18n/zh.yml

-1
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,6 @@ components:
394394
closeMenu: 关闭菜单
395395
fieldTrip: 旅行标题
396396
mailables: 准备发布
397-
menuItemIconAlt: '{label} 菜单项的图标'
398397
openMenu: 打开菜单
399398
StopTimeCell:
400399
imminentArrival: 到达

Diff for: index.css

+70-62
Original file line numberDiff line numberDiff line change
@@ -23,43 +23,48 @@ input[type="text"]::-ms-clear {
2323

2424
/* New app menu */
2525
.app-menu-icon {
26-
width: 21px;
27-
height: 15px;
26+
background: none;
27+
border: none;
28+
cursor: pointer;
2829
display: flex;
2930
flex-direction: column;
31+
height: 15px;
3032
justify-content: space-between;
31-
cursor: pointer;
33+
padding: 0;
3234
position: absolute;
33-
z-index: 10;
34-
transition: all 1s ease;
3535
top: 16px;
36+
transition: all 1s ease;
37+
width: 21px;
38+
z-index: 10;
3639
}
3740

3841
@media only screen and (max-width: 768px) {
42+
#locale-selector-wrapper {
43+
display: none;
44+
}
3945
.app-menu-icon {
40-
margin-left: 15px;
46+
left: 15px;
4147
}
4248
}
4349

44-
.menu-top-line,
45-
.menu-middle-line,
46-
.menu-bottom-line,
47-
.menu-left-x,
48-
.menu-right-x {
50+
.app-menu-icon .menu-line {
4951
border-bottom: 3px solid #ffffff;
52+
display: block;
53+
position: relative;
5054
transition: all 0.5s ease;
55+
width: 100%;
5156
}
5257

53-
.menu-left-x {
58+
.app-menu-icon[aria-expanded="true"] .menu-line.top {
5459
transform: rotate(45deg);
5560
top: 7px;
56-
position: relative;
5761
}
58-
59-
.menu-right-x {
62+
.app-menu-icon[aria-expanded="true"] .menu-line.bottom {
6063
transform: rotate(-45deg);
6164
bottom: 5px;
62-
position: relative;
65+
}
66+
.app-menu-icon[aria-expanded="true"] .menu-line.middle {
67+
display: none;
6368
}
6469

6570
.slide-pane {
@@ -70,11 +75,6 @@ input[type="text"]::-ms-clear {
7075
margin: 52px auto 0 0;
7176
}
7277

73-
.slide-pane__header,
74-
.slide-pane__close {
75-
display: none;
76-
}
77-
7878
.slide-pane__content {
7979
padding: 6px 0;
8080
}
@@ -85,28 +85,51 @@ input[type="text"]::-ms-clear {
8585

8686
.app-menu {
8787
margin: 0;
88-
padding: 0;
88+
padding: 0.5rem 0;
8989
}
9090

91-
.app-menu li {
92-
list-style-type: none;
93-
margin: 1rem 2rem;
94-
cursor: pointer;
95-
}
96-
97-
.app-menu li img,
98-
.app-menu li svg {
91+
.app-menu img,
92+
.app-menu svg {
9993
max-height: 1em;
100-
margin-right: 2rem;
94+
margin: 0 2rem;
10195
vertical-align: middle;
10296
width: 1em;
10397
}
10498

105-
.app-menu li a {
99+
.app-menu a,
100+
.app-menu button {
101+
background: none;
102+
border: none;
106103
color: inherit;
104+
cursor: pointer;
105+
display: flex;
107106
font-size: 20px;
107+
padding: 0.5rem 0;
108108
text-decoration: none;
109-
outline: none;
109+
width: 100%;
110+
}
111+
112+
.app-menu a:hover,
113+
.app-menu button:hover {
114+
color: #4c97f5;
115+
}
116+
117+
.app-menu a:focus,
118+
.app-menu button:focus {
119+
background-color: #ddd;
120+
outline: 2px solid #4c97f5;
121+
outline-offset: -2px;
122+
}
123+
124+
.skip-nav-button {
125+
color: initial;
126+
position: fixed;
127+
top: -30px;
128+
}
129+
.skip-nav-button:focus {
130+
padding: 7px 24px;
131+
top: 7px;
132+
z-index: 100
110133
}
111134

112135
.view-switcher {
@@ -119,13 +142,9 @@ input[type="text"]::-ms-clear {
119142
}
120143
}
121144

122-
.menu-item:hover *,
123-
.app-menu li a span *:hover {
124-
color: #4c97f5;
125-
}
126-
127145
.expand-menu-chevron {
128-
margin-right: -2rem;
146+
flex-grow: 1;
147+
text-align: end;
129148
}
130149

131150
.dropdown-header {
@@ -135,34 +154,23 @@ input[type="text"]::-ms-clear {
135154
white-space: nowrap;
136155
}
137156

138-
.expand-submenu-button a {
139-
display: flex;
140-
width: 100%;
141-
justify-content: space-between;
142-
background: transparent;
143-
border: none;
144-
outline: none;
145-
}
146-
147157
.sub-menu-container {
148158
border-top: 1px solid #cccccc;
159+
margin-top: 0.5rem;
160+
padding-left: 2rem;
149161
}
150162

151-
.sub-menu-container li a {
152-
margin-left: 2rem;
153-
}
154-
155-
.sub-menu-container li a span {
156-
color: inherit;
163+
.app-menu .app-menu-divider {
164+
border-bottom: 1px solid #ccc;
165+
padding: 1rem 0;
157166
}
158167

159-
.app-menu-divider::after {
160-
content: "";
161-
display: block;
162-
height: 1px;
163-
background: #ccc;
164-
margin: 1rem;
165-
width: 200%; /* ensures the line extends to the edge of the pane */
168+
/* Header image or title */
169+
/* If an icon is used, visually-hide the title (but keep it visible to screen readers). */
170+
.with-icon div.navbar-title {
171+
height: 0;
172+
overflow: hidden;
173+
width: 0;
166174
}
167175

168176
/* Buttons */
@@ -207,4 +215,4 @@ button.step {
207215
/* we need to override this z-index so that the +/- map controls appear below
208216
the geocoder search results */
209217
z-index: 999;
210-
}
218+
}

Diff for: lib/actions/ui.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -123,7 +123,7 @@ export function setViewedRoute(payload) {
123123
/**
124124
* Sets the main panel content according to the payload (one of the enum values
125125
* of MainPanelContent) and routes the application to the correct path.
126-
* @param {number} payload MainPanelContent value
126+
* @param {number|null} payload MainPanelContent value
127127
*/
128128
export function setMainPanelContent(payload) {
129129
return function (dispatch, getState) {

Diff for: lib/components/app/app-frame.js

-41
This file was deleted.

Diff for: lib/components/app/app-frame.tsx

+46
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
import { Col, Row } from 'react-bootstrap'
2+
import React, { ComponentType, FC, HTMLAttributes } from 'react'
3+
4+
import DesktopNav from './desktop-nav'
5+
import NotFound from './not-found'
6+
7+
interface Props extends HTMLAttributes<HTMLDivElement> {
8+
SubNav?: ComponentType
9+
}
10+
11+
/**
12+
* This component defines the general application frame, to which
13+
* content and an optional sub-navigation component can be inserted.
14+
*/
15+
const AppFrame = ({ children, SubNav }: Props): JSX.Element => (
16+
<div className="otp" id="otp">
17+
{/* TODO: Do mobile view. */}
18+
<DesktopNav />
19+
{SubNav && <SubNav />}
20+
{/* Create a main region here so that the DesktopNav, which contains a "banner" landmark,
21+
is not contained within the main or other landmark
22+
(see https://dequeuniversity.com/rules/axe/4.3/landmark-banner-is-top-level?application=axe-puppeteer) */}
23+
<main tabIndex={-1}>
24+
<div className="container">
25+
<Row>
26+
<Col md={8} mdOffset={2} sm={10} smOffset={1} xs={12}>
27+
{children}
28+
</Col>
29+
</Row>
30+
</div>
31+
</main>
32+
</div>
33+
)
34+
35+
/**
36+
* Creates a simple wrapper component consisting of an AppFrame that surrounds
37+
* the provided component. (Displays "Content not found" if none provided.)
38+
*/
39+
export function frame(Component: ComponentType): FC {
40+
const FramedComponent = () => (
41+
<AppFrame>{Component ? <Component /> : <NotFound />}</AppFrame>
42+
)
43+
return FramedComponent
44+
}
45+
46+
export default AppFrame

0 commit comments

Comments
 (0)