diff --git a/__snapshots__/storybook.test.ts.snap b/__snapshots__/storybook.test.ts.snap
index ed34d8b5c..980484b23 100644
--- a/__snapshots__/storybook.test.ts.snap
+++ b/__snapshots__/storybook.test.ts.snap
@@ -269118,12 +269118,6 @@ exports[`Storyshots Trip Form Components/Advanced Mode Settings Buttons Advanced
cursor: pointer;
}
-.c3 {
- display: inline-block;
- vertical-align: middle;
- overflow: hidden;
-}
-
.c7 {
display: grid;
grid-column: span 2;
@@ -269196,16 +269190,6 @@ exports[`Storyshots Trip Form Components/Advanced Mode Settings Buttons Advanced
.c1 {
width: 100%;
- max-width: 500px;
-}
-
-.c2 > input {
- -webkit-clip: rect(0,0,0,0);
- clip: rect(0,0,0,0);
- height: 0;
- overflow: hidden;
- position: absolute;
- width: 0;
}
.c2 > label {
@@ -269214,18 +269198,32 @@ exports[`Storyshots Trip Form Components/Advanced Mode Settings Buttons Advanced
-ms-flex-align: center;
align-items: center;
background-color: #fff;
- border: 1px solid #336B9E;
+ border: 2px solid #336B9E;
border-left-width: 2px;
border-right-width: 2px;
color: #336B9E;
+ cursor: pointer;
display: grid;
+ font-size: 18px;
+ font-weight: 400;
gap: 20px;
grid-template-columns: 40px auto 40px;
height: 51px;
justify-items: center;
+ margin-bottom: 0;
+ margin-top: -2px;
padding: 0 10px;
}
+.c2 > input {
+ -webkit-clip: rect(0,0,0,0);
+ clip: rect(0,0,0,0);
+ height: 0;
+ overflow: hidden;
+ position: absolute;
+ width: 0;
+}
+
.c2 > input:checked + label {
background-color: #336B9E;
color: #fff;
@@ -269233,6 +269231,17 @@ exports[`Storyshots Trip Form Components/Advanced Mode Settings Buttons Advanced
border-bottom-right-radius: 0 !important;
}
+.c2 > input:focus-visible + label,
+.c2 > input:focus + label {
+ outline: #336B9E 1px solid;
+ outline-offset: -4px;
+}
+
+.c2 > input:checked:focus-visible + label,
+.c2 > input:checked:focus + label {
+ outline: white 1px solid;
+}
+
.c2 span {
justify-self: flex-start;
}
@@ -269247,33 +269256,38 @@ exports[`Storyshots Trip Form Components/Advanced Mode Settings Buttons Advanced
cursor: pointer;
}
-.c12 > input {
- -webkit-clip: rect(0,0,0,0);
- clip: rect(0,0,0,0);
- height: 0;
- overflow: hidden;
- position: absolute;
- width: 0;
-}
-
.c12 > label {
-webkit-align-items: center;
-webkit-box-align: center;
-ms-flex-align: center;
align-items: center;
background-color: #fff;
- border: 1px solid #336B9E;
+ border: 2px solid #336B9E;
border-left-width: 2px;
border-right-width: 2px;
color: #336B9E;
+ cursor: pointer;
display: grid;
+ font-size: 18px;
+ font-weight: 400;
gap: 20px;
grid-template-columns: 40px auto 40px;
height: 51px;
justify-items: center;
+ margin-bottom: 0;
+ margin-top: -2px;
padding: 0 10px;
}
+.c12 > input {
+ -webkit-clip: rect(0,0,0,0);
+ clip: rect(0,0,0,0);
+ height: 0;
+ overflow: hidden;
+ position: absolute;
+ width: 0;
+}
+
.c12 > input:checked + label {
background-color: #336B9E;
color: #fff;
@@ -269281,6 +269295,17 @@ exports[`Storyshots Trip Form Components/Advanced Mode Settings Buttons Advanced
border-bottom-right-radius: !important;
}
+.c12 > input:focus-visible + label,
+.c12 > input:focus + label {
+ outline: #336B9E 1px solid;
+ outline-offset: -4px;
+}
+
+.c12 > input:checked:focus-visible + label,
+.c12 > input:checked:focus + label {
+ outline: white 1px solid;
+}
+
.c12 span {
justify-self: flex-start;
}
@@ -269304,7 +269329,6 @@ exports[`Storyshots Trip Form Components/Advanced Mode Settings Buttons Advanced
.c0 {
border: none;
margin: 0;
- width: 90%;
display: -webkit-box;
display: -webkit-flex;
display: -ms-flexbox;
@@ -269333,377 +269357,392 @@ exports[`Storyshots Trip Form Components/Advanced Mode Settings Buttons Advanced
border-radius: 0 0 8px 8px;
}
-.c0 div.advanced-submode-container:last-of-type div:last-child {
+.c0 div.advanced-submode-container:last-of-type div.subsettings-container {
border-radius: 0 0 8px 8px;
+ border-bottom: 1px solid #B3B3B3;
}
-
+
+
-
-
-
-
+
-
-
-
-
-
+
-
-
-
- Bike
-
-
+
+
+ Bike
+
+
+
-
-
-
-
-
+
-
-
-
- Car
-
-
+ focusable="false"
+ viewBox="0 0 512 512"
+ xmlns="http://www.w3.org/2000/svg"
+ >
+
+
+
+ Car
+
+
+
-
-
+
+
`;
exports[`Storyshots Trip Form Components/Metro Mode Selector Metro Mode Selector 1`] = `
@@ -269780,12 +269819,6 @@ exports[`Storyshots Trip Form Components/Metro Mode Selector Metro Mode Selector
`;
exports[`Storyshots Trip Form Components/Metro Mode Selector Metro Mode Selector 2`] = `
-.c2 {
- display: inline-block;
- vertical-align: middle;
- overflow: hidden;
-}
-
.c3 {
display: inline-block;
-webkit-clip: rect(0,0,0,0);
@@ -269925,6 +269958,12 @@ exports[`Storyshots Trip Form Components/Metro Mode Selector Metro Mode Selector
color: #eee;
}
+.c2 {
+ display: inline-block;
+ vertical-align: middle;
+ overflow: hidden;
+}
+
@@ -269943,13 +269982,6 @@ exports[`Storyshots Trip Form Components/Metro Mode Selector Metro Mode Selector
/>
-
-
-
-
`;
diff --git a/packages/base-map/package.json b/packages/base-map/package.json
index d8819d3a6..51029971a 100644
--- a/packages/base-map/package.json
+++ b/packages/base-map/package.json
@@ -12,10 +12,10 @@
"mapbox-gl": "npm:empty-npm-package@1.0.0",
"maplibre-gl": "^2.1.9",
"react-map-gl": "^7.0.15",
- "@opentripplanner/map-popup": "^3.1.0"
+ "@opentripplanner/map-popup": "^3.1.1"
},
"peerDependencies": {
- "@opentripplanner/types": "^6.5.0",
+ "@opentripplanner/types": "^6.5.1",
"react": "^16.14.0",
"styled-components": "^5.3.0"
},
diff --git a/packages/building-blocks/package.json b/packages/building-blocks/package.json
index ba6dbb76c..045b14eb6 100644
--- a/packages/building-blocks/package.json
+++ b/packages/building-blocks/package.json
@@ -9,8 +9,8 @@
"module": "esm/index.js",
"private": false,
"devDependencies": {
- "@opentripplanner/types": "^6.5.0",
- "@opentripplanner/core-utils": "^11.4.0"
+ "@opentripplanner/types": "^6.5.1",
+ "@opentripplanner/core-utils": "^11.4.2"
},
"peerDependencies": {
"react": "^16.14.0",
diff --git a/packages/core-utils/package.json b/packages/core-utils/package.json
index 0ea1e7375..31749d8a4 100644
--- a/packages/core-utils/package.json
+++ b/packages/core-utils/package.json
@@ -14,7 +14,7 @@
"dependencies": {
"@conveyal/lonlat": "^1.4.1",
"@mapbox/polyline": "^1.1.0",
- "@opentripplanner/geocoder": "^3.0.0",
+ "@opentripplanner/geocoder": "^3.0.1",
"@styled-icons/foundation": "^10.34.0",
"@turf/along": "^6.0.1",
"chroma-js": "^2.4.2",
@@ -30,7 +30,7 @@
"tsc": "tsc"
},
"devDependencies": {
- "@opentripplanner/types": "^6.5.0",
+ "@opentripplanner/types": "^6.5.1",
"@types/chroma-js": "^2.1.4"
}
}
diff --git a/packages/endpoints-overlay/package.json b/packages/endpoints-overlay/package.json
index 0a4b75a03..fe34e4b9c 100644
--- a/packages/endpoints-overlay/package.json
+++ b/packages/endpoints-overlay/package.json
@@ -19,15 +19,15 @@
"url": "https://github.com/opentripplanner/otp-ui/issues"
},
"dependencies": {
- "@opentripplanner/base-map": "^3.1.0",
+ "@opentripplanner/base-map": "^3.2.0",
"@opentripplanner/location-icon": "^1.4.1",
- "@opentripplanner/core-utils": "^11.4.0",
+ "@opentripplanner/core-utils": "^11.4.2",
"flat": "^5.0.2",
"@styled-icons/fa-solid": "^10.34.0",
- "@opentripplanner/map-popup": "^3.1.0"
+ "@opentripplanner/map-popup": "^3.1.1"
},
"devDependencies": {
- "@opentripplanner/types": "^6.5.0",
+ "@opentripplanner/types": "^6.5.1",
"@types/flat": "^5.0.2"
},
"peerDependencies": {
diff --git a/packages/from-to-location-picker/package.json b/packages/from-to-location-picker/package.json
index 360bec62a..9441e2539 100644
--- a/packages/from-to-location-picker/package.json
+++ b/packages/from-to-location-picker/package.json
@@ -13,7 +13,7 @@
"flat": "^5.0.2"
},
"devDependencies": {
- "@opentripplanner/types": "^6.5.0"
+ "@opentripplanner/types": "^6.5.1"
},
"peerDependencies": {
"react": "^16.14.0",
diff --git a/packages/icons/package.json b/packages/icons/package.json
index a5fcc894e..e1bdccc69 100644
--- a/packages/icons/package.json
+++ b/packages/icons/package.json
@@ -10,7 +10,7 @@
"license": "MIT",
"private": false,
"dependencies": {
- "@opentripplanner/core-utils": "^11.4.0",
+ "@opentripplanner/core-utils": "^11.4.2",
"prop-types": "^15.7.2"
},
"peerDependencies": {
diff --git a/packages/itinerary-body/package.json b/packages/itinerary-body/package.json
index 2ffe85659..20bef12c6 100644
--- a/packages/itinerary-body/package.json
+++ b/packages/itinerary-body/package.json
@@ -10,7 +10,7 @@
"license": "MIT",
"private": false,
"dependencies": {
- "@opentripplanner/core-utils": "^11.4.0",
+ "@opentripplanner/core-utils": "^11.4.2",
"@opentripplanner/humanize-distance": "^1.2.0",
"@opentripplanner/icons": "^2.0.10",
"@opentripplanner/location-icon": "^1.4.1",
@@ -24,7 +24,7 @@
"string-similarity": "^4.0.4"
},
"devDependencies": {
- "@opentripplanner/types": "^6.5.0",
+ "@opentripplanner/types": "^6.5.1",
"@types/flat": "^5.0.2"
},
"peerDependencies": {
diff --git a/packages/location-field/package.json b/packages/location-field/package.json
index 7a91f7d07..5ca2ff1ef 100644
--- a/packages/location-field/package.json
+++ b/packages/location-field/package.json
@@ -10,8 +10,8 @@
"private": false,
"dependencies": {
"@conveyal/geocoder-arcgis-geojson": "^0.0.3",
- "@opentripplanner/core-utils": "^11.4.0",
- "@opentripplanner/geocoder": "^3.0.0",
+ "@opentripplanner/core-utils": "^11.4.2",
+ "@opentripplanner/geocoder": "^3.0.1",
"@opentripplanner/humanize-distance": "^1.2.0",
"@opentripplanner/location-icon": "^1.4.1",
"@styled-icons/fa-solid": "^10.34.0",
diff --git a/packages/map-popup/package.json b/packages/map-popup/package.json
index bd1f12a04..c9938a491 100644
--- a/packages/map-popup/package.json
+++ b/packages/map-popup/package.json
@@ -11,12 +11,12 @@
"license": "MIT",
"private": false,
"dependencies": {
- "@opentripplanner/core-utils": "^11.4.0",
+ "@opentripplanner/core-utils": "^11.4.2",
"@opentripplanner/from-to-location-picker": "^2.1.12",
"flat": "^5.0.2"
},
"devDependencies": {
- "@opentripplanner/types": "^6.5.0"
+ "@opentripplanner/types": "^6.5.1"
},
"peerDependencies": {
"react": "^16.14.0",
diff --git a/packages/otp2-tile-overlay/package.json b/packages/otp2-tile-overlay/package.json
index 3ac5faf5e..b24061f1c 100644
--- a/packages/otp2-tile-overlay/package.json
+++ b/packages/otp2-tile-overlay/package.json
@@ -16,10 +16,10 @@
"react-map-gl": "^7.0.15"
},
"dependencies": {
- "@opentripplanner/map-popup": "^3.1.0"
+ "@opentripplanner/map-popup": "^3.1.1"
},
"devDependencies": {
- "@opentripplanner/base-map": "^3.1.0",
- "@opentripplanner/types": "^6.5.0"
+ "@opentripplanner/base-map": "^3.2.0",
+ "@opentripplanner/types": "^6.5.1"
}
}
diff --git a/packages/park-and-ride-overlay/package.json b/packages/park-and-ride-overlay/package.json
index 4a95a3e37..c431ee964 100644
--- a/packages/park-and-ride-overlay/package.json
+++ b/packages/park-and-ride-overlay/package.json
@@ -19,7 +19,7 @@
"url": "https://github.com/opentripplanner/otp-ui/issues"
},
"dependencies": {
- "@opentripplanner/base-map": "^3.1.0",
+ "@opentripplanner/base-map": "^3.2.0",
"@opentripplanner/from-to-location-picker": "^2.1.12"
},
"peerDependencies": {
diff --git a/packages/printable-itinerary/package.json b/packages/printable-itinerary/package.json
index 1ef8e96e6..27d280df0 100644
--- a/packages/printable-itinerary/package.json
+++ b/packages/printable-itinerary/package.json
@@ -10,7 +10,7 @@
"license": "MIT",
"private": false,
"dependencies": {
- "@opentripplanner/core-utils": "^11.4.0",
+ "@opentripplanner/core-utils": "^11.4.2",
"@opentripplanner/itinerary-body": "^5.3.0"
},
"devDependencies": {
diff --git a/packages/route-viewer-overlay/package.json b/packages/route-viewer-overlay/package.json
index 27ee1e920..c61083114 100644
--- a/packages/route-viewer-overlay/package.json
+++ b/packages/route-viewer-overlay/package.json
@@ -20,12 +20,12 @@
},
"dependencies": {
"@mapbox/polyline": "^1.1.0",
- "@opentripplanner/base-map": "^3.1.0",
- "@opentripplanner/core-utils": "^11.4.0",
+ "@opentripplanner/base-map": "^3.2.0",
+ "@opentripplanner/core-utils": "^11.4.2",
"point-in-polygon": "^1.1.0"
},
"devDependencies": {
- "@opentripplanner/types": "^6.5.0",
+ "@opentripplanner/types": "^6.5.1",
"point-in-polygon": "^1.1.0"
},
"peerDependencies": {
diff --git a/packages/stop-viewer-overlay/package.json b/packages/stop-viewer-overlay/package.json
index 111b5e572..183f02b70 100644
--- a/packages/stop-viewer-overlay/package.json
+++ b/packages/stop-viewer-overlay/package.json
@@ -19,11 +19,11 @@
"url": "https://github.com/opentripplanner/otp-ui/issues"
},
"dependencies": {
- "@opentripplanner/base-map": "^3.1.0",
- "@opentripplanner/core-utils": "^11.4.0"
+ "@opentripplanner/base-map": "^3.2.0",
+ "@opentripplanner/core-utils": "^11.4.2"
},
"devDependencies": {
- "@opentripplanner/types": "^6.5.0"
+ "@opentripplanner/types": "^6.5.1"
},
"peerDependencies": {
"react": "^16.14.0",
diff --git a/packages/stops-overlay/package.json b/packages/stops-overlay/package.json
index 66181a216..6ef66ff0b 100644
--- a/packages/stops-overlay/package.json
+++ b/packages/stops-overlay/package.json
@@ -19,13 +19,13 @@
"url": "https://github.com/opentripplanner/otp-ui/issues"
},
"dependencies": {
- "@opentripplanner/base-map": "^3.1.0",
+ "@opentripplanner/base-map": "^3.2.0",
"@opentripplanner/from-to-location-picker": "^2.1.12",
- "@opentripplanner/map-popup": "^3.1.0",
+ "@opentripplanner/map-popup": "^3.1.1",
"flat": "^5.0.2"
},
"devDependencies": {
- "@opentripplanner/types": "^6.5.0",
+ "@opentripplanner/types": "^6.5.1",
"styled-icons": "^10.34.0"
},
"peerDependencies": {
diff --git a/packages/transit-vehicle-overlay/package.json b/packages/transit-vehicle-overlay/package.json
index 89a55b24e..1acfd516e 100644
--- a/packages/transit-vehicle-overlay/package.json
+++ b/packages/transit-vehicle-overlay/package.json
@@ -9,13 +9,13 @@
"module": "esm/index.js",
"private": false,
"dependencies": {
- "@opentripplanner/base-map": "^3.1.0",
- "@opentripplanner/core-utils": "^11.4.0",
+ "@opentripplanner/base-map": "^3.2.0",
+ "@opentripplanner/core-utils": "^11.4.2",
"@opentripplanner/icons": "^2.0.10",
"flat": "^5.0.2"
},
"devDependencies": {
- "@opentripplanner/types": "^6.5.0"
+ "@opentripplanner/types": "^6.5.1"
},
"peerDependencies": {
"react": "^16.14.0",
diff --git a/packages/transitive-overlay/package.json b/packages/transitive-overlay/package.json
index 481c07455..aa7e4be7a 100644
--- a/packages/transitive-overlay/package.json
+++ b/packages/transitive-overlay/package.json
@@ -20,8 +20,8 @@
},
"dependencies": {
"@mapbox/polyline": "^1.1.1",
- "@opentripplanner/base-map": "^3.1.0",
- "@opentripplanner/core-utils": "^11.4.0",
+ "@opentripplanner/base-map": "^3.2.0",
+ "@opentripplanner/core-utils": "^11.4.2",
"@opentripplanner/itinerary-body": "^5.3.0",
"@turf/bbox": "^6.5.0",
"@turf/bearing": "^6.5.0",
@@ -32,8 +32,8 @@
"lodash.isequal": "^4.5.0"
},
"devDependencies": {
- "@opentripplanner/endpoints-overlay": "^2.0.12",
- "@opentripplanner/types": "^6.5.0"
+ "@opentripplanner/endpoints-overlay": "^2.1.0",
+ "@opentripplanner/types": "^6.5.1"
},
"peerDependencies": {
"react": "^16.14.0",
diff --git a/packages/trip-details/package.json b/packages/trip-details/package.json
index da2c4a6af..87a6d64d4 100644
--- a/packages/trip-details/package.json
+++ b/packages/trip-details/package.json
@@ -11,13 +11,13 @@
"license": "MIT",
"private": false,
"dependencies": {
- "@opentripplanner/core-utils": "^11.4.0",
+ "@opentripplanner/core-utils": "^11.4.2",
"@styled-icons/fa-solid": "^10.34.0",
"flat": "^5.0.2",
"react-animate-height": "^3.0.4"
},
"devDependencies": {
- "@opentripplanner/types": "^6.5.0",
+ "@opentripplanner/types": "^6.5.1",
"@types/flat": "^5.0.2"
},
"peerDependencies": {
diff --git a/packages/trip-form/i18n/en-US.yml b/packages/trip-form/i18n/en-US.yml
index 3cf235912..fc542ad3d 100644
--- a/packages/trip-form/i18n/en-US.yml
+++ b/packages/trip-form/i18n/en-US.yml
@@ -30,10 +30,6 @@ otpUi:
walkTolerance-labelHigh: More Walking
walkTolerance-labelLow: Less Walking
wheelchair-label: Accessible Routing
- settingsLabel: "{mode} settings"
- TripOptions:
- transitOnly: Go by Transit
- openApp: Open app
SettingsSelectorPanel:
bikeOnly: Bike Only
escooterOnly: E-scooter Only
@@ -42,6 +38,9 @@ otpUi:
use: Use
useCompanies: Use companies
walkOnly: Walk Only
+ TripOptions:
+ openApp: Open app
+ transitOnly: Go by Transit
queryParameters:
bikeSpeed: Bicycle Speed
distanceInMiles: |
diff --git a/packages/trip-form/i18n/fr.yml b/packages/trip-form/i18n/fr.yml
index 2fcf44212..0482f8e26 100644
--- a/packages/trip-form/i18n/fr.yml
+++ b/packages/trip-form/i18n/fr.yml
@@ -30,7 +30,6 @@ otpUi:
walkTolerance-labelHigh: Plus de marche
walkTolerance-labelLow: Moins de marche
wheelchair-label: Accès avec mobilité réduite
- settingsLabel: "Paramètres pour : {mode}"
SettingsSelectorPanel:
bikeOnly: Vélo uniquement
escooterOnly: Trottinette uniquement
@@ -40,8 +39,8 @@ otpUi:
useCompanies: Prestataires
walkOnly: À pied uniquement
TripOptions:
- transitOnly: En transports publics
openApp: Ouvrir l'application
+ transitOnly: En transports publics
queryParameters:
bikeSpeed: Vitesse à vélo
distanceInMiles: "{miles, number, :: unit/mile unit-width-full-name}"
diff --git a/packages/trip-form/package.json b/packages/trip-form/package.json
index 249419fbd..e1d36b6ac 100644
--- a/packages/trip-form/package.json
+++ b/packages/trip-form/package.json
@@ -10,8 +10,7 @@
"types": "lib/index.d.ts",
"private": false,
"dependencies": {
- "@opentripplanner/core-utils": "^11.4.0",
- "@floating-ui/react": "^0.19.2",
+ "@opentripplanner/core-utils": "^11.4.2",
"@opentripplanner/building-blocks": "^1.0.3",
"@styled-icons/bootstrap": "^10.34.0",
"@styled-icons/boxicons-regular": "^10.38.0",
@@ -24,8 +23,9 @@
"react-inlinesvg": "^2.3.0"
},
"devDependencies": {
- "@opentripplanner/types": "6.5.0",
- "@types/flat": "^5.0.2"
+ "@types/flat": "^5.0.2",
+ "@opentripplanner/types": "6.5.1"
+
},
"peerDependencies": {
"react": "^16.14.0",
diff --git a/packages/trip-form/src/MetroModeSelector/index.tsx b/packages/trip-form/src/MetroModeSelector/index.tsx
index b21fc14f8..58fefaab9 100644
--- a/packages/trip-form/src/MetroModeSelector/index.tsx
+++ b/packages/trip-form/src/MetroModeSelector/index.tsx
@@ -1,24 +1,8 @@
-import {
- arrow,
- FloatingFocusManager,
- offset,
- safePolygon,
- shift,
- useClick,
- useDismiss,
- useFloating,
- useHover,
- useInteractions,
- useRole
-} from "@floating-ui/react";
import { ModeButtonDefinition } from "@opentripplanner/types";
-import { CaretDown } from "@styled-icons/fa-solid/CaretDown";
-import { CaretUp } from "@styled-icons/fa-solid/CaretUp";
-import React, { ReactElement, useCallback, useRef, useState } from "react";
-import { FormattedMessage, useIntl } from "react-intl";
+import React, { ReactElement, useCallback } from "react";
+import { useIntl } from "react-intl";
import styled, { css } from "styled-components";
-import SubSettingsPane, { defaultMessages } from "./SubSettingsPane";
import generateModeButtonLabel from "./i18n";
export const invisibleCss = css`
@@ -151,34 +135,6 @@ const ModeButtonWrapper = styled.span<{
}
`;
-const HoverPanel = styled.div`
- min-width: 300px;
- padding: 0 10px;
- width: 75%;
- z-index: 100;
-`;
-
-const HoverInnerContainer = styled.div`
- background: #fff;
- border-radius: 4px;
- color: #2e2e2e;
- font-size: 90%;
- font-weight: bold;
- padding: 0px 20px 10px;
- pointer-events: none;
- ${boxShadowCss}
-`;
-
-const Arrow = styled.div`
- background: #fff;
- height: 10px;
- margin-top: -5px;
- position: absolute;
- transform: rotate(-45deg);
- width: 10px;
- ${boxShadowCss}
-`;
-
interface ModeButtonProps {
// Optional properties for styling
accentColor?: string;
@@ -186,10 +142,7 @@ interface ModeButtonProps {
fillModeIcons?: boolean;
id: string;
- itemWithKeyboard?: string;
modeButton: ModeButtonDefinition;
- onPopupClose: () => void;
- onPopupKeyboardExpand: (id: string) => void;
onSettingsUpdate: (QueryParamChangeEvent) => void;
onToggle: () => void;
}
@@ -199,85 +152,13 @@ function ModeButton({
activeHoverColor,
fillModeIcons,
id,
- itemWithKeyboard,
modeButton,
- onPopupClose,
- onPopupKeyboardExpand,
- onSettingsUpdate,
onToggle
}: ModeButtonProps) {
const intl = useIntl();
- const [open, setOpen] = useState(false);
- const [hoverEnabled, setHoverEnabled] = useState(true);
- const arrowRef = useRef(null);
- const onOpenChange = useCallback(
- value => {
- setOpen(value);
- if (!value && typeof onPopupClose === "function") {
- onPopupClose();
- }
- },
- [onPopupClose, setOpen]
- );
- const {
- context,
- floating,
- middlewareData: { arrow: { x: arrowX, y: arrowY } = {} },
- reference,
- strategy,
- x,
- y
- } = useFloating({
- middleware: [offset(8), shift(), arrow({ element: arrowRef })],
- onOpenChange,
- open
- });
-
- const { getFloatingProps, getReferenceProps } = useInteractions([
- useHover(context, {
- // Enable hover only if no popup has been triggered via keyboard.
- // (This is to avoid focus being stolen by hovering out of another button.)
- enabled: itemWithKeyboard === null && hoverEnabled,
- handleClose: safePolygon({
- blockPointerEvents: false,
- restMs: 500,
- buffer: 0
- })
- }),
- useClick(context),
- useRole(context),
- useDismiss(context)
- ]);
-
- const renderDropdown =
- open && modeButton.enabled && modeButton.modeSettings?.length > 0;
- const interactionProps = getReferenceProps();
-
- // ARIA roles are added by the `useRole` hook.
- // Remove the aria-controls, aria-expanded, and aria-haspopup props from the label, they will
- // instead be passed to the button for keyboard/screen reader users to trigger the popup.
- const {
- "aria-controls": ariaControls,
- "aria-expanded": ariaExpanded,
- "aria-haspopup": ariaHasPopup,
- ...labelInteractionProps
- } = interactionProps;
-
const checkboxId = `metro-mode-selector-mode-${id}`;
- const handleButtonClick = useCallback(
- e => {
- if (typeof onPopupKeyboardExpand === "function") {
- onPopupKeyboardExpand(id);
- }
- if (typeof interactionProps.onClick === "function") {
- interactionProps.onClick(e);
- }
- },
- [id, interactionProps, onPopupKeyboardExpand]
- );
-
const label = generateModeButtonLabel(modeButton.key, intl, modeButton.label);
return (
@@ -299,79 +180,13 @@ function ModeButton({
{label}
-
- {renderDropdown && (
-
- {
- setHoverEnabled(false);
- setTimeout(() => setHoverEnabled(true), 100);
- }}
- ref={floating}
- style={{
- left: x ?? 0,
- position: strategy,
- top: y ?? 0
- }}
- >
-
-
-
-
-
-
- )}
);
}
@@ -417,10 +232,6 @@ export default function ModeSelector({
onSettingsUpdate,
onToggleModeButton
}: Props): ReactElement {
- // State that holds the id of the active mode combination popup that was triggered via keyboard.
- // It is used to enable/disable hover effects to avoid keyboard focus being stolen
- // and overlapping popups on mouse hover.
- const [itemWithKeyboard, setItemWithKeyboard] = useState(null);
return (
@@ -430,13 +241,8 @@ export default function ModeSelector({
activeHoverColor={activeHoverColor}
fillModeIcons={fillModeIcons}
id={button.key}
- itemWithKeyboard={itemWithKeyboard}
key={button.label}
modeButton={button}
- onPopupClose={useCallback(() => {
- setItemWithKeyboard(null);
- }, [setItemWithKeyboard])}
- onPopupKeyboardExpand={setItemWithKeyboard}
onSettingsUpdate={onSettingsUpdate}
onToggle={useCallback(() => {
onToggleModeButton(button.key, !button.enabled);
diff --git a/packages/trip-viewer-overlay/package.json b/packages/trip-viewer-overlay/package.json
index ef0187c4d..fcbfa78fc 100644
--- a/packages/trip-viewer-overlay/package.json
+++ b/packages/trip-viewer-overlay/package.json
@@ -20,8 +20,8 @@
},
"dependencies": {
"@mapbox/polyline": "^1.1.0",
- "@opentripplanner/base-map": "^3.1.0",
- "@opentripplanner/core-utils": "^11.4.0"
+ "@opentripplanner/base-map": "^3.2.0",
+ "@opentripplanner/core-utils": "^11.4.2"
},
"peerDependencies": {
"react": "^16.14.0",
diff --git a/packages/vehicle-rental-overlay/package.json b/packages/vehicle-rental-overlay/package.json
index 497edb42c..fec01d9a6 100644
--- a/packages/vehicle-rental-overlay/package.json
+++ b/packages/vehicle-rental-overlay/package.json
@@ -19,16 +19,16 @@
"url": "git+https://github.com/opentripplanner/otp-ui.git"
},
"dependencies": {
- "@opentripplanner/base-map": "^3.1.0",
- "@opentripplanner/core-utils": "^11.4.0",
+ "@opentripplanner/base-map": "^3.2.0",
+ "@opentripplanner/core-utils": "^11.4.2",
"@opentripplanner/from-to-location-picker": "^2.1.12",
- "@opentripplanner/map-popup": "^3.1.0",
+ "@opentripplanner/map-popup": "^3.1.1",
"@styled-icons/fa-solid": "^10.34.0",
"flat": "^5.0.2",
"lodash.memoize": "^4.1.2"
},
"devDependencies": {
- "@opentripplanner/types": "^6.5.0"
+ "@opentripplanner/types": "^6.5.1"
},
"peerDependencies": {
"react": "^16.14.0",
diff --git a/packages/zoom-based-markers/package.json b/packages/zoom-based-markers/package.json
index 501442d70..8a91239bf 100644
--- a/packages/zoom-based-markers/package.json
+++ b/packages/zoom-based-markers/package.json
@@ -19,11 +19,11 @@
"url": "https://github.com/opentripplanner/otp-ui/issues"
},
"dependencies": {
- "@opentripplanner/core-utils": "^11.4.0",
- "@opentripplanner/base-map": "^3.1.0"
+ "@opentripplanner/core-utils": "^11.4.2",
+ "@opentripplanner/base-map": "^3.2.0"
},
"devDependencies": {
- "@opentripplanner/types": "^6.5.0"
+ "@opentripplanner/types": "^6.5.1"
},
"peerDependencies": {
"react": "^16.14.0",
diff --git a/yarn.lock b/yarn.lock
index dbe0c1bd6..d88d923bc 100644
--- a/yarn.lock
+++ b/yarn.lock
@@ -1474,34 +1474,6 @@
unique-filename "^1.1.1"
which "^1.3.1"
-"@floating-ui/core@^1.2.2":
- version "1.2.2"
- resolved "https://registry.yarnpkg.com/@floating-ui/core/-/core-1.2.2.tgz#66f62cf1b7de2ed23a09c101808536e68caffaec"
- integrity sha512-FaO9KVLFnxknZaGWGmNtjD2CVFuc0u4yeGEofoyXO2wgRA7fLtkngT6UB0vtWQWuhH3iMTZZ/Y89CMeyGfn8pA==
-
-"@floating-ui/dom@^1.2.1":
- version "1.2.3"
- resolved "https://registry.yarnpkg.com/@floating-ui/dom/-/dom-1.2.3.tgz#8dc6fbf799fbb5c29f705b54bdd51f3ab0ee03a2"
- integrity sha512-lK9cZUrHSJLMVAdCvDqs6Ug8gr0wmqksYiaoj/bxj2gweRQkSuhg2/V6Jswz2KiQ0RAULbqw1oQDJIMpQ5GfGA==
- dependencies:
- "@floating-ui/core" "^1.2.2"
-
-"@floating-ui/react-dom@^1.3.0":
- version "1.3.0"
- resolved "https://registry.yarnpkg.com/@floating-ui/react-dom/-/react-dom-1.3.0.tgz#4d35d416eb19811c2b0e9271100a6aa18c1579b3"
- integrity sha512-htwHm67Ji5E/pROEAr7f8IKFShuiCKHwUC/UY4vC3I5jiSvGFAYnSYiZO5MlGmads+QqvUkR9ANHEguGrDv72g==
- dependencies:
- "@floating-ui/dom" "^1.2.1"
-
-"@floating-ui/react@^0.19.2":
- version "0.19.2"
- resolved "https://registry.yarnpkg.com/@floating-ui/react/-/react-0.19.2.tgz#c6e4d2097ed0dca665a7c042ddf9cdecc95e9412"
- integrity sha512-JyNk4A0Ezirq8FlXECvRtQOX/iBe5Ize0W/pLkrZjfHW9GUV7Xnq6zm6fyZuQzaHHqEnVizmvlA96e1/CkZv+w==
- dependencies:
- "@floating-ui/react-dom" "^1.3.0"
- aria-hidden "^1.1.3"
- tabbable "^6.0.1"
-
"@formatjs/cli@^4.2.32", "@formatjs/cli@^4.2.33":
version "4.8.4"
resolved "https://registry.yarnpkg.com/@formatjs/cli/-/cli-4.8.4.tgz#c4f4e589b8c77c950b659948dbf0e877a4d910fd"
@@ -3246,11 +3218,6 @@
resolved "https://registry.yarnpkg.com/@open-draft/until/-/until-1.0.3.tgz#db9cc719191a62e7d9200f6e7bab21c5b848adca"
integrity sha512-Aq58f5HiWdyDlFffbbSjAlv596h/cOnt2DO1w3DOC7OJ5EHs0hd/nycJfiu9RJbT6Yk6F1knnRRXNSpxoIVZ9Q==
-"@opentripplanner/types@6.5.0":
- version "6.5.0"
- resolved "https://registry.yarnpkg.com/@opentripplanner/types/-/types-6.5.0.tgz#d8cca355bf30f0984283faa793113ad6c0dba38d"
- integrity sha512-FllEyE+1WQ2GOSKXQOuzrk+OPcJEqr4+zacsHQLB9WVyfm5D/BPHR1/OjfuVngrwLTK5bKP8VlDRS1ba/R8rtg==
-
"@peculiar/asn1-schema@^2.1.6", "@peculiar/asn1-schema@^2.3.0":
version "2.3.3"
resolved "https://registry.yarnpkg.com/@peculiar/asn1-schema/-/asn1-schema-2.3.3.tgz#21418e1f3819e0b353ceff0c2dad8ccb61acd777"
@@ -5959,13 +5926,6 @@ argv-formatter@~1.0.0:
resolved "https://registry.yarnpkg.com/argv-formatter/-/argv-formatter-1.0.0.tgz#a0ca0cbc29a5b73e836eebe1cbf6c5e0e4eb82f9"
integrity sha1-oMoMvCmltz6Dbuvhy/bF4OTrgvk=
-aria-hidden@^1.1.3:
- version "1.2.3"
- resolved "https://registry.yarnpkg.com/aria-hidden/-/aria-hidden-1.2.3.tgz#14aeb7fb692bbb72d69bebfa47279c1fd725e954"
- integrity sha512-xcLxITLe2HYa1cnYnwCjkOO1PqUHQpozB8x9AR0OgWN2woOBi5kSDVxKfd0b7sb1hw5qFeJhXm9H1nu3xSfLeQ==
- dependencies:
- tslib "^2.0.0"
-
aria-query@^3.0.0:
version "3.0.0"
resolved "https://registry.yarnpkg.com/aria-query/-/aria-query-3.0.0.tgz#65b3fcc1ca1155a8c9ae64d6eee297f15d5133cc"
@@ -18002,11 +17962,6 @@ synchronous-promise@^2.0.15, synchronous-promise@^2.0.6:
resolved "https://registry.yarnpkg.com/synchronous-promise/-/synchronous-promise-2.0.15.tgz#07ca1822b9de0001f5ff73595f3d08c4f720eb8e"
integrity sha512-k8uzYIkIVwmT+TcglpdN50pS2y1BDcUnBPK9iJeGu0Pl1lOI8pD6wtzgw91Pjpe+RxtTncw32tLxs/R0yNL2Mg==
-tabbable@^6.0.1:
- version "6.1.1"
- resolved "https://registry.yarnpkg.com/tabbable/-/tabbable-6.1.1.tgz#40cfead5ed11be49043f04436ef924c8890186a0"
- integrity sha512-4kl5w+nCB44EVRdO0g/UGoOp3vlwgycUVtkk/7DPyeLZUCuNFFKCFG6/t/DgHLrUPHjrZg6s5tNm+56Q2B0xyg==
-
table@^5.2.3:
version "5.4.6"
resolved "https://registry.yarnpkg.com/table/-/table-5.4.6.tgz#1292d19500ce3f86053b05f0e8e7e4a3bb21079e"