@digitransit-component/digitransit-component-favourite-bar 9.0.11 → 9.0.13

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.js CHANGED
@@ -3761,7 +3761,7 @@ function styleInject(css, ref) {
3761
3761
  }
3762
3762
  }
3763
3763
 
3764
- var css_248z = ".styles_button-shared__RSwxE, .styles_favourite-container__WTJm3 .styles_expandButton__mkemf, .styles_favourite-container__WTJm3 .styles_favourite-content__6gqt1 {\n background-color: white;\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n border-radius: 5px;\n border: 1px solid #ddd;\n cursor: pointer;\n}\n.styles_button-shared__RSwxE:hover, .styles_favourite-container__WTJm3 .styles_expandButton__mkemf:hover, .styles_favourite-container__WTJm3 .styles_favourite-content__6gqt1:hover {\n box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);\n}\n\n.styles_shimmer-shared__MGBAa, .styles_favourite-container__WTJm3 .styles_expandButton__mkemf > div, .styles_favourite-container__WTJm3 .styles_favourite-content__6gqt1 > div {\n display: flex;\n align-items: center;\n overflow: hidden;\n}\n.styles_shimmer-shared__MGBAa .styles_shimmer__bIP9J, .styles_favourite-container__WTJm3 .styles_expandButton__mkemf > div .styles_shimmer__bIP9J, .styles_favourite-container__WTJm3 .styles_favourite-content__6gqt1 > div .styles_shimmer__bIP9J {\n border-radius: 5px;\n}\n\n.styles_favourite-container__WTJm3 {\n display: flex;\n position: relative;\n z-index: 1;\n width: 100%;\n height: 50px;\n flex-shrink: 1;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n}\n.styles_favourite-container__WTJm3 .styles_favourite-content__6gqt1 {\n width: auto;\n min-width: 0;\n flex: 1;\n flex-grow: 1;\n height: 100%;\n position: relative;\n padding: 0;\n margin-right: 8px;\n overflow: hidden;\n}\n.styles_favourite-container__WTJm3 .styles_favourite-content__6gqt1 .styles_icon__mAwUD {\n display: flex;\n width: 50px;\n height: 100%;\n justify-content: center;\n align-items: center;\n flex-shrink: 1;\n}\n@media screen and (min-width: 375px) {\n .styles_favourite-container__WTJm3 .styles_favourite-content__6gqt1 .styles_icon__mAwUD {\n flex-shrink: 0;\n }\n}\n.styles_favourite-container__WTJm3 .styles_favourite-content__6gqt1 .styles_icon__mAwUD svg {\n width: 20px;\n height: 20px;\n position: relative;\n left: 2px;\n}\n.styles_favourite-container__WTJm3 .styles_favourite-content__6gqt1 .styles_icon__mAwUD.styles_place__4mHYj svg {\n width: 24px;\n height: 24px;\n}\n.styles_favourite-container__WTJm3 .styles_favourite-content__6gqt1 .styles_icon__mAwUD.styles_home__msJXd svg, .styles_favourite-container__WTJm3 .styles_favourite-content__6gqt1 .styles_icon__mAwUD.styles_school__Hta8J svg, .styles_favourite-container__WTJm3 .styles_favourite-content__6gqt1 .styles_icon__mAwUD.styles_sport__YFDd0 svg, .styles_favourite-container__WTJm3 .styles_favourite-content__6gqt1 .styles_icon__mAwUD.styles_shopping__jMKed svg {\n width: 18px;\n height: 18px;\n}\n.styles_favourite-container__WTJm3 .styles_favourite-content__6gqt1 .styles_icon__mAwUD.styles_work__uZX4R svg {\n width: 20px;\n height: 20px;\n}\n.styles_favourite-container__WTJm3 .styles_favourite-content__6gqt1 .styles_favourite-location__RiyEV {\n white-space: nowrap;\n overflow: hidden;\n text-align: start;\n width: 100%;\n flex-direction: row;\n}\n.styles_favourite-container__WTJm3 .styles_favourite-content__6gqt1 .styles_favourite-location__RiyEV .styles_name__Fvsvr {\n font-family: inherit;\n font-size: 15px;\n margin-right: 6px;\n font-weight: var(--font-weight-medium, 500);\n font-stretch: normal;\n font-style: normal;\n letter-spacing: -0.6px;\n color: #333;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.styles_favourite-container__WTJm3 .styles_favourite-content__6gqt1 .styles_favourite-location__RiyEV .styles_name__Fvsvr:empty {\n margin-top: 0;\n}\n.styles_favourite-container__WTJm3 .styles_favourite-content__6gqt1 .styles_favourite-location__RiyEV .styles_address__iBEhu {\n font-family: inherit;\n font-size: 12px;\n margin-right: 6px;\n font-weight: normal;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.67;\n letter-spacing: -0.48px;\n color: #666;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.styles_favourite-container__WTJm3 .styles_expandButton__mkemf {\n height: 100%;\n width: 42px;\n flex-shrink: 0;\n overflow: hidden;\n padding: 0;\n}\n.styles_favourite-container__WTJm3 .styles_expandButton__mkemf > div {\n justify-content: center;\n}\n.styles_favourite-container__WTJm3 .styles_expandButton__mkemf.styles_plus__ryt4n svg {\n width: 16px;\n height: 16px;\n}\n.styles_favourite-container__WTJm3 .styles_expandButton__mkemf.styles_arrow__EbmBZ svg {\n width: 19px;\n height: 19px;\n transform: rotate(90deg);\n}\n.styles_favourite-container__WTJm3 .styles_expandButton__mkemf.styles_arrow__EbmBZ.styles_rotate__Nw2-A svg {\n transform: rotate(-90deg);\n}\n\n.styles_favourite-suggestion-container__MVZBj {\n position: relative;\n display: flex;\n justify-content: center;\n padding-top: 9px;\n}\n.styles_favourite-suggestion-container__MVZBj .styles_divider__podkI {\n display: block;\n height: 6px;\n background-color: #f2f5f7;\n border-top: 1px solid rgba(0, 0, 0, 0.1);\n}\n.styles_favourite-suggestion-container__MVZBj .styles_favourite-suggestion-list__boIJY {\n max-height: 30vh;\n list-style-type: none;\n padding: 0;\n position: absolute;\n z-index: 20;\n width: 100%;\n margin: 0 auto;\n border-radius: 5px;\n box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.16);\n border: solid 1px rgba(0, 0, 0, 0.1);\n background-color: #fff;\n overflow-x: hidden;\n overflow-y: scroll;\n}\n.styles_favourite-suggestion-container__MVZBj .styles_favourite-suggestion-item__ptExh.styles_custom__87c-n {\n font-size: 15px;\n font-weight: var(--font-weight-medium, 500);\n letter-spacing: -0.5;\n}\n.styles_favourite-suggestion-container__MVZBj .styles_favourite-suggestion-item__ptExh:hover {\n background-color: #f2f5f7;\n}";
3764
+ var css_248z = ".styles_button-shared__RSwxE, .styles_favourite-container__WTJm3 .styles_expandButton__mkemf, .styles_favourite-container__WTJm3 .styles_favourite-content__6gqt1 {\n background-color: white;\n display: flex;\n flex-direction: row;\n justify-content: center;\n align-items: center;\n border-radius: 5px;\n border: 1px solid #ddd;\n cursor: pointer;\n}\n.styles_button-shared__RSwxE:hover, .styles_favourite-container__WTJm3 .styles_expandButton__mkemf:hover, .styles_favourite-container__WTJm3 .styles_favourite-content__6gqt1:hover {\n box-shadow: 0 0 5px rgba(0, 0, 0, 0.2);\n}\n\n.styles_shimmer-shared__MGBAa, .styles_favourite-container__WTJm3 .styles_expandButton__mkemf > div, .styles_favourite-container__WTJm3 .styles_favourite-content__6gqt1 > div {\n display: flex;\n align-items: center;\n overflow: hidden;\n}\n.styles_shimmer-shared__MGBAa .styles_shimmer__bIP9J, .styles_favourite-container__WTJm3 .styles_expandButton__mkemf > div .styles_shimmer__bIP9J, .styles_favourite-container__WTJm3 .styles_favourite-content__6gqt1 > div .styles_shimmer__bIP9J {\n border-radius: 5px;\n}\n\n.styles_favourite-container__WTJm3 {\n display: flex;\n position: relative;\n z-index: 1;\n width: 100%;\n height: 50px;\n flex-shrink: 1;\n flex-direction: row;\n justify-content: space-between;\n align-items: center;\n}\n.styles_favourite-container__WTJm3 .styles_favourite-content__6gqt1 {\n width: auto;\n min-width: 0;\n flex: 1;\n flex-grow: 1;\n height: 100%;\n position: relative;\n padding: 0;\n margin-right: 8px;\n overflow: hidden;\n}\n.styles_favourite-container__WTJm3 .styles_favourite-content__6gqt1 .styles_icon__mAwUD {\n display: flex;\n width: 50px;\n height: 100%;\n justify-content: center;\n align-items: center;\n flex-shrink: 1;\n}\n@media screen and (min-width: 375px) {\n .styles_favourite-container__WTJm3 .styles_favourite-content__6gqt1 .styles_icon__mAwUD {\n flex-shrink: 0;\n }\n}\n.styles_favourite-container__WTJm3 .styles_favourite-content__6gqt1 .styles_icon__mAwUD svg {\n width: 20px;\n height: 20px;\n position: relative;\n left: 2px;\n}\n.styles_favourite-container__WTJm3 .styles_favourite-content__6gqt1 .styles_icon__mAwUD.styles_place__4mHYj svg {\n width: 24px;\n height: 24px;\n}\n.styles_favourite-container__WTJm3 .styles_favourite-content__6gqt1 .styles_icon__mAwUD.styles_home__msJXd svg, .styles_favourite-container__WTJm3 .styles_favourite-content__6gqt1 .styles_icon__mAwUD.styles_school__Hta8J svg, .styles_favourite-container__WTJm3 .styles_favourite-content__6gqt1 .styles_icon__mAwUD.styles_sport__YFDd0 svg, .styles_favourite-container__WTJm3 .styles_favourite-content__6gqt1 .styles_icon__mAwUD.styles_shopping__jMKed svg {\n width: 18px;\n height: 18px;\n}\n.styles_favourite-container__WTJm3 .styles_favourite-content__6gqt1 .styles_icon__mAwUD.styles_work__uZX4R svg {\n width: 20px;\n height: 20px;\n}\n.styles_favourite-container__WTJm3 .styles_favourite-content__6gqt1 .styles_favourite-location__RiyEV {\n white-space: nowrap;\n overflow: hidden;\n text-align: start;\n width: 100%;\n flex-direction: row;\n}\n.styles_favourite-container__WTJm3 .styles_favourite-content__6gqt1 .styles_favourite-location__RiyEV .styles_name__Fvsvr {\n font-family: inherit;\n font-size: 15px;\n margin-right: 6px;\n font-weight: var(--font-weight-medium, 500);\n font-stretch: normal;\n font-style: normal;\n letter-spacing: -0.6px;\n color: #333;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.styles_favourite-container__WTJm3 .styles_favourite-content__6gqt1 .styles_favourite-location__RiyEV .styles_name__Fvsvr:empty {\n margin-top: 0;\n}\n.styles_favourite-container__WTJm3 .styles_favourite-content__6gqt1 .styles_favourite-location__RiyEV .styles_address__iBEhu {\n font-family: inherit;\n font-size: 12px;\n margin-right: 6px;\n font-weight: normal;\n font-stretch: normal;\n font-style: normal;\n line-height: 1.67;\n letter-spacing: -0.48px;\n color: #666;\n white-space: nowrap;\n overflow: hidden;\n text-overflow: ellipsis;\n}\n.styles_favourite-container__WTJm3 .styles_expandButton__mkemf {\n height: 100%;\n width: 42px;\n flex-shrink: 0;\n overflow: hidden;\n padding: 0;\n}\n.styles_favourite-container__WTJm3 .styles_expandButton__mkemf > div {\n justify-content: center;\n}\n.styles_favourite-container__WTJm3 .styles_expandButton__mkemf.styles_plus__ryt4n svg {\n width: 16px;\n height: 16px;\n}\n.styles_favourite-container__WTJm3 .styles_expandButton__mkemf.styles_arrow__EbmBZ svg {\n width: 19px;\n height: 19px;\n transform: rotate(90deg);\n}\n.styles_favourite-container__WTJm3 .styles_expandButton__mkemf.styles_arrow__EbmBZ.styles_rotate__Nw2-A svg {\n transform: rotate(-90deg);\n}\n\n.styles_favourite-suggestion-container__MVZBj {\n position: relative;\n display: flex;\n justify-content: center;\n padding-top: 9px;\n}\n.styles_favourite-suggestion-container__MVZBj .styles_divider__podkI {\n display: block;\n height: 6px;\n background-color: #f2f5f7;\n border-top: 1px solid rgba(0, 0, 0, 0.1);\n}\n.styles_favourite-suggestion-container__MVZBj .styles_favourite-suggestion-list__boIJY {\n max-height: 30vh;\n list-style-type: none;\n padding: 0;\n position: absolute;\n z-index: 20;\n width: 100%;\n margin: 0 auto;\n border-radius: 5px;\n box-shadow: 0 2px 10px 0 rgba(0, 0, 0, 0.16);\n border: solid 1px rgba(0, 0, 0, 0.1);\n background-color: #fff;\n overflow-x: hidden;\n overflow-y: scroll;\n}\n.styles_favourite-suggestion-container__MVZBj .styles_favourite-suggestion-item__ptExh.styles_custom__87c-n {\n font-size: 15px;\n font-weight: var(--font-weight-medium, 500);\n letter-spacing: -0.5;\n}\n.styles_favourite-suggestion-container__MVZBj .styles_favourite-suggestion-item__ptExh:hover,\n.styles_favourite-suggestion-container__MVZBj .styles_favourite-suggestion-item__ptExh:focus-visible {\n background-color: #f2f5f7;\n outline: 1px solid var(--accessible-primary-color, #000);\n outline-offset: -1px;\n border-radius: 4px;\n}";
3765
3765
  var styles = {"button-shared":"styles_button-shared__RSwxE","favourite-container":"styles_favourite-container__WTJm3","expandButton":"styles_expandButton__mkemf","favourite-content":"styles_favourite-content__6gqt1","shimmer-shared":"styles_shimmer-shared__MGBAa","shimmer":"styles_shimmer__bIP9J","icon":"styles_icon__mAwUD","place":"styles_place__4mHYj","home":"styles_home__msJXd","school":"styles_school__Hta8J","sport":"styles_sport__YFDd0","shopping":"styles_shopping__jMKed","work":"styles_work__uZX4R","favourite-location":"styles_favourite-location__RiyEV","name":"styles_name__Fvsvr","address":"styles_address__iBEhu","plus":"styles_plus__ryt4n","arrow":"styles_arrow__EbmBZ","rotate":"styles_rotate__Nw2-A","favourite-suggestion-container":"styles_favourite-suggestion-container__MVZBj","divider":"styles_divider__podkI","favourite-suggestion-list":"styles_favourite-suggestion-list__boIJY","favourite-suggestion-item":"styles_favourite-suggestion-item__ptExh","custom":"styles_custom__87c-n"};
3766
3766
  styleInject(css_248z);
3767
3767
 
@@ -4057,8 +4057,11 @@ function FavouriteBar({
4057
4057
  if (index < listFavourites.length) {
4058
4058
  onClickFavourite(listFavourites[index]);
4059
4059
  } else if (index === listFavourites.length) {
4060
+ // The list closes, so the modal should return focus to the button instead of the row
4061
+ expandListRef.current?.focus();
4060
4062
  onAddPlace();
4061
4063
  } else if (index === listFavourites.length + 1) {
4064
+ expandListRef.current?.focus();
4062
4065
  onEdit();
4063
4066
  }
4064
4067
  toggleList();
@@ -4149,9 +4152,11 @@ function FavouriteBar({
4149
4152
  children: listOpen && /*#__PURE__*/jsxs("ul", {
4150
4153
  className: styles['favourite-suggestion-list'],
4151
4154
  id: "favourite-suggestion-list",
4152
- style: listMaxHeight ? {
4155
+ style: _objectSpread(_objectSpread({}, listMaxHeight ? {
4153
4156
  maxHeight: listMaxHeight
4154
- } : undefined,
4157
+ } : {}), {}, {
4158
+ '--accessible-primary-color': colors.accessiblePrimary
4159
+ }),
4155
4160
  ref: suggestionListRef,
4156
4161
  "aria-label": translate('favourites-list'),
4157
4162
  children: [listFavourites.map((item, index) => {