From 82bae740b9af2d96c654c03d0cd7180bd7a9388b Mon Sep 17 00:00:00 2001 From: amy-corson-ibigroup <115499534+amy-corson-ibigroup@users.noreply.github.com> Date: Mon, 18 Sep 2023 15:45:45 -0500 Subject: [PATCH 1/6] refactor: adjust markup for goecoder results --- packages/location-field/src/index.tsx | 2 -- packages/location-field/src/options.tsx | 17 +++++------- packages/location-field/src/styled.ts | 36 ++++++++++++++++--------- 3 files changed, 30 insertions(+), 25 deletions(-) diff --git a/packages/location-field/src/index.tsx b/packages/location-field/src/index.tsx index d0084d726..75023a6de 100644 --- a/packages/location-field/src/index.tsx +++ b/packages/location-field/src/index.tsx @@ -874,7 +874,6 @@ const LocationField = ({ currentPosition && currentPosition.fetching ? intl.formatMessage({ id: "otpUi.LocationField.fetchingLocation" }) : defaultPlaceholder; - const hasNoEnabledOptions = menuItemCount === 0; const isExpanded = isStatic || menuVisible; const textControl = ( @@ -951,7 +950,6 @@ const LocationField = ({ - - {children} - + {children} ); diff --git a/packages/location-field/src/styled.ts b/packages/location-field/src/styled.ts index 88756f657..437fb5a74 100644 --- a/packages/location-field/src/styled.ts +++ b/packages/location-field/src/styled.ts @@ -74,18 +74,6 @@ export const InputGroup = styled.div` position: relative; `; -export const MenuItemA = styled.a<{ active?: boolean }>` - background-color: ${props => (props.active ? "#337ab7" : "transparent")}; - clear: both; - color: ${props => (props.active ? "#fff" : "#333")}; - display: block; - font-weight: 400; - line-height: 1.42857143; - padding: 3px 20px; - text-decoration: none; - white-space: nowrap; -`; - export const MenuGroupHeader = styled.h2<{ bgColor?: string; fgColor?: string; @@ -101,7 +89,7 @@ export const MenuGroupHeader = styled.h2<{ white-space: nowrap; `; -export const MenuItemLi = styled.li` +export const MenuItemLi = styled.li<{ active?: boolean }>` &:hover { /* TODO: adjust highlight color based on props.color? */ background-color: #f5f5f5; @@ -114,6 +102,28 @@ export const MenuItemLi = styled.li` background-color: unset; cursor: default; } + + background-color: ${props => (props.active ? "#337ab7" : "transparent")}; + clear: both; + color: ${props => (props.active ? "#fff" : "#333")}; + display: block; + font-weight: 400; + line-height: 1.42857143; + padding: 3px 20px; + text-decoration: none; + white-space: nowrap; +`; + +export const MenuItemA = styled.span<{ active?: boolean }>` + background-color: ${props => (props.active ? "#337ab7" : "transparent")}; + clear: both; + color: ${props => (props.active ? "#fff" : "#333")}; + display: block; + font-weight: 400; + line-height: 1.42857143; + padding: 3px 20px; + text-decoration: none; + white-space: nowrap; `; export const OptionContainer = styled.span` From 35a6cd02743edb18634ccb41b76cbe9687fd5698 Mon Sep 17 00:00:00 2001 From: amy-corson-ibigroup <115499534+amy-corson-ibigroup@users.noreply.github.com> Date: Wed, 20 Sep 2023 14:40:06 -0500 Subject: [PATCH 2/6] fix(location-field): add aria-assertive to results --- packages/location-field/src/options.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/packages/location-field/src/options.tsx b/packages/location-field/src/options.tsx index cc7449bfe..d3f1434ba 100644 --- a/packages/location-field/src/options.tsx +++ b/packages/location-field/src/options.tsx @@ -53,6 +53,9 @@ export const MenuItem = ({ Date: Thu, 21 Sep 2023 12:30:11 -0400 Subject: [PATCH 3/6] fix typo in AT message --- packages/location-field/i18n/en-US.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/packages/location-field/i18n/en-US.yml b/packages/location-field/i18n/en-US.yml index 283803a10..de88545ca 100644 --- a/packages/location-field/i18n/en-US.yml +++ b/packages/location-field/i18n/en-US.yml @@ -8,7 +8,7 @@ otpUi: geocoderUnreachable: Unable to obtain suggestions homeLocation: Home howToAccessResults: >- - Use the down arrow key browse the results list. To select a result, use + Use the down arrow key to browse the results list. To select a result, use the Enter key. myPlaces: My Places nearby: Nearby Stops From f6f845308dac871126007d11a47b2a088ca3bba7 Mon Sep 17 00:00:00 2001 From: amy-corson-ibigroup <115499534+amy-corson-ibigroup@users.noreply.github.com> Date: Thu, 21 Sep 2023 13:01:35 -0400 Subject: [PATCH 4/6] refactor: clean up changes --- packages/location-field/src/index.tsx | 2 ++ packages/location-field/src/styled.ts | 12 ------------ 2 files changed, 2 insertions(+), 12 deletions(-) diff --git a/packages/location-field/src/index.tsx b/packages/location-field/src/index.tsx index 75023a6de..d0084d726 100644 --- a/packages/location-field/src/index.tsx +++ b/packages/location-field/src/index.tsx @@ -874,6 +874,7 @@ const LocationField = ({ currentPosition && currentPosition.fetching ? intl.formatMessage({ id: "otpUi.LocationField.fetchingLocation" }) : defaultPlaceholder; + const hasNoEnabledOptions = menuItemCount === 0; const isExpanded = isStatic || menuVisible; const textControl = ( @@ -950,6 +951,7 @@ const LocationField = ({ ` white-space: nowrap; `; -export const MenuItemA = styled.span<{ active?: boolean }>` - background-color: ${props => (props.active ? "#337ab7" : "transparent")}; - clear: both; - color: ${props => (props.active ? "#fff" : "#333")}; - display: block; - font-weight: 400; - line-height: 1.42857143; - padding: 3px 20px; - text-decoration: none; - white-space: nowrap; -`; - export const OptionContainer = styled.span` display: block; padding-top: 5px; From 1f403c2afa7f59bffdb6aa6f2e721ee015163939 Mon Sep 17 00:00:00 2001 From: amy-corson-ibigroup <115499534+amy-corson-ibigroup@users.noreply.github.com> Date: Mon, 25 Sep 2023 11:17:36 -0500 Subject: [PATCH 5/6] test: update snapshots --- __snapshots__/storybook.test.ts.snap | 45 ++++++++++++++++------------ 1 file changed, 26 insertions(+), 19 deletions(-) diff --git a/__snapshots__/storybook.test.ts.snap b/__snapshots__/storybook.test.ts.snap index 1ad56a326..63361c7ba 100644 --- a/__snapshots__/storybook.test.ts.snap +++ b/__snapshots__/storybook.test.ts.snap @@ -208234,7 +208234,9 @@ exports[`Storyshots PrintableItinerary Tnc Transit Itinerary 2`] = ` + > + Burnside/Stark +
Date: Mon, 2 Oct 2023 13:31:58 -0500 Subject: [PATCH 6/6] test: update snapshots --- __snapshots__/storybook.test.ts.snap | 2041 +++++++++++++------------- 1 file changed, 982 insertions(+), 1059 deletions(-) diff --git a/__snapshots__/storybook.test.ts.snap b/__snapshots__/storybook.test.ts.snap index 15209adfa..d526a6121 100644 --- a/__snapshots__/storybook.test.ts.snap +++ b/__snapshots__/storybook.test.ts.snap @@ -184371,7 +184371,7 @@ input[aria-expanded="false"] ~ .c7 { position: relative; } -.c11 { +.c10 { background-color: transparent; clear: both; color: #333; @@ -184394,20 +184394,20 @@ input[aria-expanded="false"] ~ .c7 { cursor: default; } -.c12 { +.c11 { display: block; padding-top: 5px; padding-bottom: 3px; } -.c14 { +.c13 { margin-left: 30px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } -.c13 { +.c12 { float: left; } @@ -184476,50 +184476,47 @@ input[aria-expanded="false"] ~ .c7 { role="listbox" >
  • - - + - - otpUi.LocationField.useCurrentLocation - + /> + - + + otpUi.LocationField.useCurrentLocation + +
  • @@ -184635,7 +184632,7 @@ input[aria-expanded="false"] ~ .c7 { position: relative; } -.c11 { +.c10 { background-color: transparent; clear: both; color: #333; @@ -184658,20 +184655,20 @@ input[aria-expanded="false"] ~ .c7 { cursor: default; } -.c12 { +.c11 { display: block; padding-top: 5px; padding-bottom: 3px; } -.c14 { +.c13 { margin-left: 30px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } -.c13 { +.c12 { float: left; } @@ -184740,50 +184737,47 @@ input[aria-expanded="false"] ~ .c7 { role="listbox" >
  • - - + - - otpUi.LocationField.useCurrentLocation - + /> + - + + otpUi.LocationField.useCurrentLocation + +
  • @@ -184904,7 +184898,7 @@ input[aria-expanded="false"] ~ .c7 { position: relative; } -.c11 { +.c10 { background-color: transparent; clear: both; color: #333; @@ -184927,20 +184921,20 @@ input[aria-expanded="false"] ~ .c7 { cursor: default; } -.c12 { +.c11 { display: block; padding-top: 5px; padding-bottom: 3px; } -.c14 { +.c13 { margin-left: 30px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } -.c13 { +.c12 { float: left; } @@ -185009,50 +185003,47 @@ input[aria-expanded="false"] ~ .c7 { role="listbox" >
  • - - + - - otpUi.LocationField.useCurrentLocation - + /> + - + + otpUi.LocationField.useCurrentLocation + +
  • @@ -185165,7 +185156,7 @@ input[aria-expanded="false"] ~ .c7 { position: relative; } -.c11 { +.c10 { background-color: transparent; clear: both; color: #333; @@ -185188,20 +185179,20 @@ input[aria-expanded="false"] ~ .c7 { cursor: default; } -.c12 { +.c11 { display: block; padding-top: 5px; padding-bottom: 3px; } -.c14 { +.c13 { margin-left: 30px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } -.c13 { +.c12 { float: left; } @@ -185273,49 +185264,47 @@ input[aria-expanded="false"] ~ .c7 { >
  • - - + - - otpUi.LocationField.currentLocationUnavailable - + /> + - + + otpUi.LocationField.currentLocationUnavailable + +
  • @@ -185456,7 +185445,7 @@ input[aria-expanded="false"] ~ .c8 { position: relative; } -.c12 { +.c11 { background-color: transparent; clear: both; color: #333; @@ -185479,20 +185468,20 @@ input[aria-expanded="false"] ~ .c8 { cursor: default; } -.c13 { +.c12 { display: block; padding-top: 5px; padding-bottom: 3px; } -.c15 { +.c14 { margin-left: 30px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } -.c14 { +.c13 { float: left; } @@ -185582,50 +185571,47 @@ input[aria-expanded="false"] ~ .c8 { role="listbox" >
  • - - + - - otpUi.LocationField.useCurrentLocation - + /> + - + + otpUi.LocationField.useCurrentLocation + +
  • @@ -185764,7 +185750,7 @@ input[aria-expanded="false"] ~ .c8 { position: relative; } -.c12 { +.c11 { background-color: transparent; clear: both; color: #333; @@ -185787,20 +185773,20 @@ input[aria-expanded="false"] ~ .c8 { cursor: default; } -.c13 { +.c12 { display: block; padding-top: 5px; padding-bottom: 3px; } -.c15 { +.c14 { margin-left: 30px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } -.c14 { +.c13 { float: left; } @@ -185890,50 +185876,47 @@ input[aria-expanded="false"] ~ .c8 { role="listbox" >
  • - - + - - otpUi.LocationField.useCurrentLocation - + /> + - + + otpUi.LocationField.useCurrentLocation + +
  • @@ -186054,7 +186037,7 @@ input[aria-expanded="false"] ~ .c7 { position: relative; } -.c11 { +.c10 { background-color: transparent; clear: both; color: #333; @@ -186077,20 +186060,20 @@ input[aria-expanded="false"] ~ .c7 { cursor: default; } -.c12 { +.c11 { display: block; padding-top: 5px; padding-bottom: 3px; } -.c14 { +.c13 { margin-left: 30px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } -.c13 { +.c12 { float: left; } @@ -186159,50 +186142,47 @@ input[aria-expanded="false"] ~ .c7 { role="listbox" >
  • - - + - - otpUi.LocationField.useCurrentLocation - + /> + - + + otpUi.LocationField.useCurrentLocation + +
  • @@ -186330,7 +186310,7 @@ input[aria-expanded="false"] ~ .c8 { position: relative; } -.c12 { +.c11 { background-color: transparent; clear: both; color: #333; @@ -186353,20 +186333,20 @@ input[aria-expanded="false"] ~ .c8 { cursor: default; } -.c14 { +.c13 { display: block; padding-top: 5px; padding-bottom: 3px; } -.c16 { +.c15 { margin-left: 30px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } -.c15 { +.c14 { float: left; } @@ -186376,7 +186356,7 @@ input[aria-expanded="false"] ~ .c8 { display: block; } -.c1 .c13 { +.c1 .c12 { background-color: pink; font-size: 24px; } @@ -186440,50 +186420,47 @@ input[aria-expanded="false"] ~ .c8 { role="listbox" >
  • - - + - - otpUi.LocationField.useCurrentLocation - + /> + - + + otpUi.LocationField.useCurrentLocation + +
  • @@ -186658,7 +186635,7 @@ exports[`Storyshots LocationField/Mobile Context With Custom Icons 2`] = ` background: none; } -.c17 { +.c16 { clear: both; } @@ -186709,19 +186686,6 @@ input[aria-expanded="false"] ~ .c6 { position: relative; } -.c11 { - background-color: transparent; - clear: both; - color: #333; - display: block; - font-weight: 400; - line-height: 1.42857143; - padding: 3px 20px; - -webkit-text-decoration: none; - text-decoration: none; - white-space: nowrap; -} - .c9 { color: #eee; background-color: #333; @@ -186734,6 +186698,19 @@ input[aria-expanded="false"] ~ .c6 { white-space: nowrap; } +.c10 { + background-color: transparent; + clear: both; + color: #333; + display: block; + font-weight: 400; + line-height: 1.42857143; + padding: 3px 20px; + -webkit-text-decoration: none; + text-decoration: none; + white-space: nowrap; +} + .c10:hover { background-color: #f5f5f5; cursor: pointer; @@ -186744,24 +186721,24 @@ input[aria-expanded="false"] ~ .c6 { cursor: default; } -.c18 { +.c17 { display: block; padding-top: 5px; padding-bottom: 3px; } -.c20 { +.c19 { margin-left: 30px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } -.c19 { +.c18 { float: left; } -.c16 { +.c15 { background-color: gray; color: white; padding: 2px 3px 0px; @@ -186774,20 +186751,20 @@ input[aria-expanded="false"] ~ .c6 { display: block; } -.c14 { +.c13 { margin-left: 30px; } -.c13 { +.c12 { font-size: 8px; } -.c12 { +.c11 { float: left; padding-top: 3px; } -.c15 { +.c14 { font-size: 9px; } @@ -186855,126 +186832,120 @@ input[aria-expanded="false"] ~ .c6 { otpUi.LocationField.nearby
  • - + - - - 404 ft - + 404 ft + + + + + 1st & Main + ( + 1 + ) - - 1st & Main - ( - 1 - ) - - - 1 - + 1 -
    - + +
  • - + - - - 0.2 mi - + 0.2 mi + + + + + Main & 2nd + ( + 2 + ) - - Main & 2nd - ( - 2 - ) - - - 2 - + 2 -
    - + +
  • - - + - - 123 Main St - - + /> + - + + 123 Main St + + +
  • - - + - - otpUi.LocationField.parenthesisFormat - + /> + - + + otpUi.LocationField.parenthesisFormat + +
  • - - + - - otpUi.LocationField.parenthesisFormat - + /> + - + + otpUi.LocationField.parenthesisFormat + +
  • - - + - - Coffee Roasters Shop, 55 Coffee Street - + /> + - + + Coffee Roasters Shop, 55 Coffee Street + +
  • - - + - - 123 Main St - + /> + - + + 123 Main St + +
  • - - + - - otpUi.LocationField.useCurrentLocation - + /> + - + + otpUi.LocationField.useCurrentLocation + +
  • @@ -187376,7 +187329,7 @@ exports[`Storyshots LocationField/Mobile Context With Nearby Stops 2`] = ` background: none; } -.c18 { +.c17 { clear: both; } @@ -187427,19 +187380,6 @@ input[aria-expanded="false"] ~ .c7 { position: relative; } -.c12 { - background-color: transparent; - clear: both; - color: #333; - display: block; - font-weight: 400; - line-height: 1.42857143; - padding: 3px 20px; - -webkit-text-decoration: none; - text-decoration: none; - white-space: nowrap; -} - .c10 { color: #eee; background-color: #333; @@ -187452,6 +187392,19 @@ input[aria-expanded="false"] ~ .c7 { white-space: nowrap; } +.c11 { + background-color: transparent; + clear: both; + color: #333; + display: block; + font-weight: 400; + line-height: 1.42857143; + padding: 3px 20px; + -webkit-text-decoration: none; + text-decoration: none; + white-space: nowrap; +} + .c11:hover { background-color: #f5f5f5; cursor: pointer; @@ -187462,24 +187415,24 @@ input[aria-expanded="false"] ~ .c7 { cursor: default; } -.c19 { +.c18 { display: block; padding-top: 5px; padding-bottom: 3px; } -.c21 { +.c20 { margin-left: 30px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } -.c20 { +.c19 { float: left; } -.c17 { +.c16 { background-color: gray; color: white; padding: 2px 3px 0px; @@ -187492,20 +187445,20 @@ input[aria-expanded="false"] ~ .c7 { display: block; } -.c15 { +.c14 { margin-left: 30px; } -.c14 { +.c13 { font-size: 8px; } -.c13 { +.c12 { float: left; padding-top: 3px; } -.c16 { +.c15 { font-size: 9px; } @@ -187573,79 +187526,140 @@ input[aria-expanded="false"] ~ .c7 { otpUi.LocationField.nearby

  • - + - - - 404 ft - + 404 ft + + + + + 1st & Main + ( + 1 + ) - 1st & Main - ( 1 - ) + + +
    +
  • +
  • + + + + 0.2 mi + + + + + Main & 2nd + ( + 2 + ) + + - - 1 - - - -
    - + 2 + + + +
  • - - - 0.2 mi - - - - - Main & 2nd - ( - 2 - ) - - - - 2 - - -
    - -
  • -
  • - - - - - - otpUi.LocationField.useCurrentLocation - + otpUi.LocationField.useCurrentLocation - +
  • @@ -187875,19 +187819,6 @@ input[aria-expanded="false"] ~ .c7 { position: relative; } -.c12 { - background-color: transparent; - clear: both; - color: #333; - display: block; - font-weight: 400; - line-height: 1.42857143; - padding: 3px 20px; - -webkit-text-decoration: none; - text-decoration: none; - white-space: nowrap; -} - .c10 { color: #eee; background-color: #333; @@ -187900,6 +187831,19 @@ input[aria-expanded="false"] ~ .c7 { white-space: nowrap; } +.c11 { + background-color: transparent; + clear: both; + color: #333; + display: block; + font-weight: 400; + line-height: 1.42857143; + padding: 3px 20px; + -webkit-text-decoration: none; + text-decoration: none; + white-space: nowrap; +} + .c11:hover { background-color: #f5f5f5; cursor: pointer; @@ -187910,20 +187854,20 @@ input[aria-expanded="false"] ~ .c7 { cursor: default; } -.c13 { +.c12 { display: block; padding-top: 5px; padding-bottom: 3px; } -.c15 { +.c14 { margin-left: 30px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } -.c14 { +.c13 { float: left; } @@ -187997,97 +187941,91 @@ input[aria-expanded="false"] ~ .c7 { otpUi.LocationField.recentlySearched
  • - - + - - 123 Main St - - + /> + - + + 123 Main St + + +
  • - - + - - otpUi.LocationField.useCurrentLocation - + /> + - + + otpUi.LocationField.useCurrentLocation + +
  • @@ -188247,19 +188185,6 @@ input[aria-expanded="false"] ~ .c7 { position: relative; } -.c12 { - background-color: transparent; - clear: both; - color: #333; - display: block; - font-weight: 400; - line-height: 1.42857143; - padding: 3px 20px; - -webkit-text-decoration: none; - text-decoration: none; - white-space: nowrap; -} - .c10 { color: #eee; background-color: #333; @@ -188272,6 +188197,19 @@ input[aria-expanded="false"] ~ .c7 { white-space: nowrap; } +.c11 { + background-color: transparent; + clear: both; + color: #333; + display: block; + font-weight: 400; + line-height: 1.42857143; + padding: 3px 20px; + -webkit-text-decoration: none; + text-decoration: none; + white-space: nowrap; +} + .c11:hover { background-color: #f5f5f5; cursor: pointer; @@ -188282,20 +188220,20 @@ input[aria-expanded="false"] ~ .c7 { cursor: default; } -.c13 { +.c12 { display: block; padding-top: 5px; padding-bottom: 3px; } -.c15 { +.c14 { margin-left: 30px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; } -.c14 { +.c13 { float: left; } @@ -188369,234 +188307,219 @@ input[aria-expanded="false"] ~ .c7 { otpUi.LocationField.myPlaces
  • - - + - - otpUi.LocationField.parenthesisFormat - + /> + - + + otpUi.LocationField.parenthesisFormat + +
  • - - + - - otpUi.LocationField.parenthesisFormat - + /> + - + + otpUi.LocationField.parenthesisFormat + +
  • - - + - - Coffee Roasters Shop, 55 Coffee Street - + /> + - + + Coffee Roasters Shop, 55 Coffee Street + +
  • - - + - - 123 Main St - + /> + - + + 123 Main St + +
  • - - + - - otpUi.LocationField.useCurrentLocation - + /> + - + + otpUi.LocationField.useCurrentLocation + +
  • @@ -214296,6 +214219,24 @@ exports[`Storyshots PrintableItinerary Walk Transit Transfer With A 11 Y Itinera overflow: hidden; } +.c20 { + font-weight: 200; +} + +.c11 { + font-weight: inherit; +} + +.c16 { + font-weight: 500; +} + +.c17 { + font-weight: 200; + opacity: 0.8975; + padding-left: 1ch; +} + .c6 { -webkit-align-items: center; -webkit-box-align: center; @@ -214334,24 +214275,6 @@ exports[`Storyshots PrintableItinerary Walk Transit Transfer With A 11 Y Itinera font-weight: 600; } -.c20 { - font-weight: 200; -} - -.c11 { - font-weight: inherit; -} - -.c16 { - font-weight: 500; -} - -.c17 { - font-weight: 200; - opacity: 0.8975; - padding-left: 1ch; -} - .c0 { margin-bottom: 10px; border-top: 1px solid grey;