@skyscanner/backpack-web 33.3.1 → 33.5.0

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.
Files changed (277) hide show
  1. package/bpk-component-accordion/index.js +1 -1
  2. package/bpk-component-accordion/src/BpkAccordionItem.js +12 -13
  3. package/bpk-component-accordion/src/BpkAccordionItem.module.css +1 -1
  4. package/bpk-component-autosuggest/src/BpkAutosuggestSuggestion.js +5 -3
  5. package/bpk-component-banner-alert/index.js +1 -1
  6. package/bpk-component-banner-alert/src/AnimateAndFade.js +37 -35
  7. package/bpk-component-banner-alert/src/BpkBannerAlertInner.js +12 -6
  8. package/bpk-component-barchart/src/BpkBarchart.js +9 -10
  9. package/bpk-component-barchart/src/BpkBarchartBar.js +1 -2
  10. package/bpk-component-barchart/src/BpkBarchartBars.js +2 -2
  11. package/bpk-component-barchart/src/BpkBarchartDefs.js +1 -2
  12. package/bpk-component-barchart/src/BpkChartAxis.js +1 -2
  13. package/bpk-component-barchart/src/BpkChartDataTable.js +1 -2
  14. package/bpk-component-bottom-sheet/src/BpkBottomSheet.js +4 -6
  15. package/bpk-component-breadcrumb/src/BpkBreadcrumb.js +1 -2
  16. package/bpk-component-breadcrumb/src/BpkBreadcrumbItem.js +18 -14
  17. package/bpk-component-breadcrumb/src/BpkBreadcrumbItem.module.css +1 -1
  18. package/bpk-component-breakpoint/index.d.ts +2 -1
  19. package/bpk-component-breakpoint/src/BpkBreakpoint.js +7 -5
  20. package/bpk-component-breakpoint/src/useMediaQuery.js +7 -6
  21. package/bpk-component-button/index.js +5 -5
  22. package/bpk-component-button/src/BpkButtonDestructive.js +10 -9
  23. package/bpk-component-button/src/BpkButtonFeatured.js +10 -9
  24. package/bpk-component-button/src/BpkButtonLink.js +11 -10
  25. package/bpk-component-button/src/BpkButtonLinkOnDark.js +11 -10
  26. package/bpk-component-button/src/BpkButtonPrimary.js +2 -2
  27. package/bpk-component-button/src/BpkButtonPrimaryOnDark.js +10 -9
  28. package/bpk-component-button/src/BpkButtonPrimaryOnLight.js +10 -9
  29. package/bpk-component-button/src/BpkButtonSecondary.js +10 -10
  30. package/bpk-component-button/src/BpkButtonSecondaryOnDark.js +10 -9
  31. package/bpk-component-calendar/index.js +1 -1
  32. package/bpk-component-calendar/src/BpkCalendarContainer.js +3 -3
  33. package/bpk-component-calendar/src/BpkCalendarGrid.js +3 -2
  34. package/bpk-component-calendar/src/BpkCalendarGrid.module.css +1 -1
  35. package/bpk-component-calendar/src/BpkCalendarGridHeader.js +4 -1
  36. package/bpk-component-calendar/src/BpkCalendarGridTransition.js +6 -4
  37. package/bpk-component-calendar/src/BpkCalendarNav.js +10 -5
  38. package/bpk-component-calendar/src/Week.js +6 -3
  39. package/bpk-component-calendar/src/composeCalendar.js +9 -4
  40. package/bpk-component-calendar/src/date-utils.js +14 -14
  41. package/bpk-component-card/src/BpkCardWrapper.js +1 -2
  42. package/bpk-component-card/src/BpkDividedCard.js +19 -15
  43. package/bpk-component-card-button/src/BpkSaveButton.js +14 -6
  44. package/bpk-component-checkbox/src/BpkCheckbox.js +1 -2
  45. package/bpk-component-chip/index.d.ts +3 -5
  46. package/bpk-component-chip/index.js +3 -2
  47. package/bpk-component-chip/src/BpkDismissibleChip.js +7 -2
  48. package/bpk-component-chip/src/BpkIconChip.d.ts +25 -0
  49. package/bpk-component-chip/src/BpkIconChip.js +31 -0
  50. package/bpk-component-chip/src/BpkSelectableChip.d.ts +0 -2
  51. package/bpk-component-chip/src/BpkSelectableChip.js +5 -6
  52. package/bpk-component-chip/src/BpkSelectableChip.module.css +1 -1
  53. package/bpk-component-chip/src/commonTypes.d.ts +1 -1
  54. package/bpk-component-chip/src/commonTypes.js +1 -24
  55. package/bpk-component-close-button/src/BpkCloseButton.js +9 -5
  56. package/bpk-component-close-button/src/BpkCloseButton.module.css +1 -1
  57. package/bpk-component-content-cards/src/BpkContentCard.js +9 -4
  58. package/bpk-component-content-cards/src/BpkContentCards.js +2 -7
  59. package/bpk-component-content-cards/src/BpkContentCards.module.css +1 -1
  60. package/bpk-component-datatable/src/BpkDataTable.js +4 -4
  61. package/bpk-component-datatable/src/BpkDataTableHeader.js +14 -11
  62. package/bpk-component-datatable/src/BpkDataTableHeader.module.css +1 -1
  63. package/bpk-component-datepicker/src/BpkDatepicker.js +3 -5
  64. package/bpk-component-description-list/index.js +1 -1
  65. package/bpk-component-description-list/src/ComponentFactory.js +10 -5
  66. package/bpk-component-dialog/src/BpkDialog.js +7 -6
  67. package/bpk-component-dialog/src/BpkDialog.module.css +1 -1
  68. package/bpk-component-dialog/src/BpkDialogInner.js +7 -5
  69. package/bpk-component-drawer/src/BpkDrawer.js +1 -4
  70. package/bpk-component-drawer/src/BpkDrawerContent.js +8 -7
  71. package/bpk-component-fieldset/src/BpkFieldset.js +10 -9
  72. package/bpk-component-flare/index.js +2 -2
  73. package/bpk-component-flare/src/BpkContentBubble.js +5 -3
  74. package/bpk-component-flare/src/BpkFlareBar.js +15 -7
  75. package/bpk-component-floating-notification/src/BpkFloatingNotification.js +10 -4
  76. package/bpk-component-form-validation/src/BpkFormValidation.js +6 -6
  77. package/bpk-component-graphic-promotion/src/BpkGraphicPromo.js +10 -14
  78. package/bpk-component-graphic-promotion/src/BpkGraphicPromo.module.css +1 -1
  79. package/bpk-component-grid-toggle/src/BpkGridToggle.js +8 -6
  80. package/bpk-component-horizontal-nav/src/BpkHorizontalNav.js +16 -14
  81. package/bpk-component-horizontal-nav/src/BpkHorizontalNav.module.css +1 -1
  82. package/bpk-component-horizontal-nav/src/BpkHorizontalNavItem.js +2 -2
  83. package/bpk-component-icon/index.js +1 -1
  84. package/bpk-component-icon/lg/ai.js +1 -2
  85. package/bpk-component-icon/lg/aircraft.js +1 -2
  86. package/bpk-component-icon/lg/beach.js +1 -2
  87. package/bpk-component-icon/lg/call-back.js +1 -2
  88. package/bpk-component-icon/lg/camper-van.js +1 -2
  89. package/bpk-component-icon/lg/car-wash.js +1 -2
  90. package/bpk-component-icon/lg/cars.js +1 -2
  91. package/bpk-component-icon/lg/clean.js +1 -2
  92. package/bpk-component-icon/lg/cloakroom.js +1 -2
  93. package/bpk-component-icon/lg/content--copy.js +1 -2
  94. package/bpk-component-icon/lg/data.js +1 -2
  95. package/bpk-component-icon/lg/depart.js +1 -2
  96. package/bpk-component-icon/lg/dot.js +20 -0
  97. package/bpk-component-icon/lg/download.js +1 -2
  98. package/bpk-component-icon/lg/education.js +1 -2
  99. package/bpk-component-icon/lg/explore.js +1 -2
  100. package/bpk-component-icon/lg/fast-track.js +1 -2
  101. package/bpk-component-icon/lg/fast-train.js +1 -2
  102. package/bpk-component-icon/lg/flight-landing.js +1 -2
  103. package/bpk-component-icon/lg/flight-takeoff.js +1 -2
  104. package/bpk-component-icon/lg/flight.js +1 -2
  105. package/bpk-component-icon/lg/legroom--extra.js +1 -2
  106. package/bpk-component-icon/lg/legroom--normal.js +1 -2
  107. package/bpk-component-icon/lg/legroom--reduced.js +1 -2
  108. package/bpk-component-icon/lg/logout.js +1 -2
  109. package/bpk-component-icon/lg/lounge.js +1 -2
  110. package/bpk-component-icon/lg/mail.js +1 -2
  111. package/bpk-component-icon/lg/mileage.js +1 -2
  112. package/bpk-component-icon/lg/new-window.js +1 -2
  113. package/bpk-component-icon/lg/plane-seat.js +1 -2
  114. package/bpk-component-icon/lg/return.js +1 -2
  115. package/bpk-component-icon/lg/scales.js +1 -2
  116. package/bpk-component-icon/lg/share--ios.js +1 -2
  117. package/bpk-component-icon/lg/social-distancing.js +1 -2
  118. package/bpk-component-icon/lg/speaker.js +1 -2
  119. package/bpk-component-icon/lg/taxi.js +1 -2
  120. package/bpk-component-icon/lg/unmute.js +1 -2
  121. package/bpk-component-icon/lg/wallet.js +1 -2
  122. package/bpk-component-icon/lg/weather--cloudy.js +1 -2
  123. package/bpk-component-icon/lg/weather--partly-cloudy.js +1 -2
  124. package/bpk-component-icon/lg/weather--rain.js +1 -2
  125. package/bpk-component-icon/lg/weather--thunderstorm.js +1 -2
  126. package/bpk-component-icon/lg/window--reduce.js +1 -2
  127. package/bpk-component-icon/lg/world--emea.js +1 -2
  128. package/bpk-component-icon/sm/ai.js +1 -2
  129. package/bpk-component-icon/sm/aircraft.js +1 -2
  130. package/bpk-component-icon/sm/beach.js +1 -2
  131. package/bpk-component-icon/sm/bus.js +1 -2
  132. package/bpk-component-icon/sm/call-back.js +1 -2
  133. package/bpk-component-icon/sm/camper-van.js +1 -2
  134. package/bpk-component-icon/sm/car-wash.js +1 -2
  135. package/bpk-component-icon/sm/cars.js +1 -2
  136. package/bpk-component-icon/sm/chauffeur.js +1 -2
  137. package/bpk-component-icon/sm/clean.js +1 -2
  138. package/bpk-component-icon/sm/content--copy.js +1 -2
  139. package/bpk-component-icon/sm/data.js +1 -2
  140. package/bpk-component-icon/sm/depart.js +1 -2
  141. package/bpk-component-icon/sm/direct.js +1 -2
  142. package/bpk-component-icon/sm/dot.js +20 -0
  143. package/bpk-component-icon/sm/download.js +1 -2
  144. package/bpk-component-icon/sm/education.js +1 -2
  145. package/bpk-component-icon/sm/explore.js +1 -2
  146. package/bpk-component-icon/sm/fast-track.js +1 -2
  147. package/bpk-component-icon/sm/fast-train.js +1 -2
  148. package/bpk-component-icon/sm/flight-landing.js +1 -2
  149. package/bpk-component-icon/sm/flight-takeoff.js +1 -2
  150. package/bpk-component-icon/sm/flight.js +1 -2
  151. package/bpk-component-icon/sm/hotels--jacuzzi.js +1 -2
  152. package/bpk-component-icon/sm/infant.js +1 -2
  153. package/bpk-component-icon/sm/legroom--extra.js +1 -2
  154. package/bpk-component-icon/sm/legroom--normal.js +1 -2
  155. package/bpk-component-icon/sm/legroom--reduced.js +1 -2
  156. package/bpk-component-icon/sm/logout.js +1 -2
  157. package/bpk-component-icon/sm/mail.js +1 -2
  158. package/bpk-component-icon/sm/mileage.js +1 -2
  159. package/bpk-component-icon/sm/new-window.js +1 -2
  160. package/bpk-component-icon/sm/onsen.js +1 -2
  161. package/bpk-component-icon/sm/plane-seat.js +1 -2
  162. package/bpk-component-icon/sm/return.js +1 -2
  163. package/bpk-component-icon/sm/share--ios.js +1 -2
  164. package/bpk-component-icon/sm/social-distancing.js +1 -2
  165. package/bpk-component-icon/sm/taxi.js +1 -2
  166. package/bpk-component-icon/sm/unmute.js +1 -2
  167. package/bpk-component-icon/sm/weather--cloudy.js +1 -2
  168. package/bpk-component-icon/sm/weather--rain.js +1 -2
  169. package/bpk-component-icon/sm/weather--thunderstorm.js +1 -2
  170. package/bpk-component-icon/sm/weather--wind.js +1 -2
  171. package/bpk-component-icon/sm/window--reduce.js +1 -2
  172. package/bpk-component-icon/src/classNameModifierHOCFactory.js +3 -0
  173. package/bpk-component-icon/src/withDescription.js +1 -2
  174. package/bpk-component-icon/src/withRtlSupport.js +1 -1
  175. package/bpk-component-image/index.js +2 -2
  176. package/bpk-component-image/src/BpkBackgroundImage.js +4 -3
  177. package/bpk-component-image/src/BpkImage.js +6 -4
  178. package/bpk-component-infinite-scroll/src/withInfiniteScroll.js +4 -5
  179. package/bpk-component-info-banner/src/AnimateAndFade.js +37 -35
  180. package/bpk-component-info-banner/src/BpkInfoBanner.module.css +1 -1
  181. package/bpk-component-info-banner/src/BpkInfoBannerInner.js +17 -14
  182. package/bpk-component-input/index.js +1 -1
  183. package/bpk-component-input/src/BpkClearButton.js +3 -1
  184. package/bpk-component-input/src/BpkInput.js +6 -4
  185. package/bpk-component-input/src/withOpenEvents.js +4 -1
  186. package/bpk-component-label/src/BpkLabel.js +1 -2
  187. package/bpk-component-link/index.js +2 -2
  188. package/bpk-component-list/src/BpkList.js +2 -2
  189. package/bpk-component-loading-button/src/BpkLoadingButton.js +7 -5
  190. package/bpk-component-map/index.js +4 -4
  191. package/bpk-component-map/src/BpkIconMarker.js +2 -3
  192. package/bpk-component-map/src/BpkMap.js +2 -2
  193. package/bpk-component-map/src/BpkPriceMarker.js +8 -7
  194. package/bpk-component-map/src/BpkPriceMarkerV2/BpkPriceMarker.js +2 -3
  195. package/bpk-component-mobile-scroll-container/src/BpkMobileScrollContainer.js +1 -9
  196. package/bpk-component-mobile-scroll-container/src/BpkMobileScrollContainer.module.css +1 -1
  197. package/bpk-component-modal/index.js +4 -3
  198. package/bpk-component-modal/src/BpkModal.d.ts +2 -1
  199. package/bpk-component-modal/src/BpkModal.js +4 -2
  200. package/bpk-component-modal/src/BpkModalInner.d.ts +2 -0
  201. package/bpk-component-modal/src/BpkModalInner.js +25 -10
  202. package/bpk-component-modal/src/BpkModalInner.module.css +1 -1
  203. package/bpk-component-modal/src/BpkModalV2/BpKModal.module.css +1 -1
  204. package/bpk-component-modal/src/BpkModalV2/BpkModal.d.ts +2 -0
  205. package/bpk-component-modal/src/BpkModalV2/BpkModal.js +20 -10
  206. package/bpk-component-navigation-bar/index.js +1 -1
  207. package/bpk-component-navigation-bar/src/BpkNavigationBar.js +8 -7
  208. package/bpk-component-navigation-bar/src/BpkNavigationBarButtonLink.js +7 -7
  209. package/bpk-component-navigation-bar/src/BpkNavigationBarIconButton.js +8 -8
  210. package/bpk-component-nudger/index.js +1 -1
  211. package/bpk-component-nudger/src/BpkConfigurableNudger.js +17 -6
  212. package/bpk-component-nudger/src/BpkNudger.js +16 -10
  213. package/bpk-component-nudger/src/BpkNudger.module.css +1 -1
  214. package/bpk-component-overlay/src/BpkOverlay.js +1 -2
  215. package/bpk-component-page-indicator/src/BpkPageIndicator.js +1 -2
  216. package/bpk-component-page-indicator/src/BpkPageIndicator.module.css +1 -1
  217. package/bpk-component-page-indicator/src/NavButton.js +1 -1
  218. package/bpk-component-pagination/src/BpkPagination.js +1 -2
  219. package/bpk-component-pagination/src/BpkPaginationList.js +1 -1
  220. package/bpk-component-pagination/src/BpkPaginationNudger.js +14 -6
  221. package/bpk-component-pagination/src/BpkPaginationPage.js +4 -1
  222. package/bpk-component-phone-input/src/BpkPhoneInput.js +16 -6
  223. package/bpk-component-popover/src/BpkPopover.js +8 -6
  224. package/bpk-component-popover/src/BpkPopoverPortal.js +8 -7
  225. package/bpk-component-popover/src/keyboardFocusScope.js +1 -1
  226. package/bpk-component-price/src/BpkPrice.js +19 -8
  227. package/bpk-component-progress/src/BpkProgress.js +1 -2
  228. package/bpk-component-radio/src/BpkRadio.js +1 -2
  229. package/bpk-component-rating/src/BpkRating.js +19 -8
  230. package/bpk-component-rtl-toggle/src/BpkRtlToggle.js +0 -4
  231. package/bpk-component-scrollable-calendar/src/BpkScrollableCalendarGrid.js +7 -5
  232. package/bpk-component-scrollable-calendar/src/BpkScrollableCalendarGridList.js +7 -4
  233. package/bpk-component-section-header/src/BpkSectionHeader.js +7 -7
  234. package/bpk-component-section-header/src/BpkSectionHeader.module.css +1 -1
  235. package/bpk-component-section-list/index.js +1 -1
  236. package/bpk-component-section-list/src/BpkSectionListItem.js +9 -8
  237. package/bpk-component-section-list/src/BpkSectionListItem.module.css +1 -1
  238. package/bpk-component-section-list/src/BpkSectionListSection.js +2 -3
  239. package/bpk-component-select/src/BpkSelect.js +1 -2
  240. package/bpk-component-skeleton/index.js +21 -0
  241. package/bpk-component-skeleton/src/BpkBaseSkeleton.js +30 -0
  242. package/bpk-component-skeleton/src/BpkBaseSkeleton.module.css +18 -0
  243. package/bpk-component-skeleton/src/BpkSkeleton.js +38 -0
  244. package/bpk-component-skeleton/src/BpkSkeleton.module.css +18 -0
  245. package/bpk-component-skeleton/src/common-types.js +33 -0
  246. package/bpk-component-slider/src/BpkSlider.js +2 -1
  247. package/bpk-component-spinner/index.js +3 -3
  248. package/bpk-component-spinner/src/BpkExtraLargeSpinner.js +8 -7
  249. package/bpk-component-spinner/src/BpkLargeSpinner.js +8 -7
  250. package/bpk-component-spinner/src/BpkSpinner.js +8 -7
  251. package/bpk-component-split-input/src/BpkInputField.js +2 -2
  252. package/bpk-component-split-input/src/BpkSplitInput.js +3 -3
  253. package/bpk-component-star-rating/index.js +4 -4
  254. package/bpk-component-star-rating/src/BpkInteractiveStar.js +6 -3
  255. package/bpk-component-star-rating/src/BpkInteractiveStarRating.js +1 -1
  256. package/bpk-component-star-rating/src/BpkStar.js +18 -18
  257. package/bpk-component-star-rating/src/BpkStar.module.css +1 -1
  258. package/bpk-component-swap-button/src/BpkSwapButton.js +2 -1
  259. package/bpk-component-switch/src/BpkSwitch.js +1 -2
  260. package/bpk-component-table/index.js +2 -2
  261. package/bpk-component-text/src/BpkText.js +10 -5
  262. package/bpk-component-theme-toggle/src/BpkThemeToggle.js +7 -6
  263. package/bpk-component-theme-toggle/src/updateOnThemeChange.js +1 -1
  264. package/bpk-component-tooltip/src/BpkTooltip.js +2 -3
  265. package/bpk-component-tooltip/src/BpkTooltipPortal.js +7 -6
  266. package/bpk-mixins/_chips.scss +9 -0
  267. package/bpk-react-utils/index.js +3 -3
  268. package/bpk-react-utils/src/BpkDialogWrapper/BpkDialogWrapper.js +2 -2
  269. package/bpk-react-utils/src/Portal.js +1 -0
  270. package/bpk-react-utils/src/withDefaultProps.js +4 -1
  271. package/bpk-scrim-utils/src/withScrim.js +3 -3
  272. package/bpk-scrim-utils/src/withScrimmedPortal.js +1 -1
  273. package/bpk-theming/src/BpkThemeProvider.js +1 -1
  274. package/package.json +2 -2
  275. package/unstable__bpk-mixins/_chips.scss +9 -0
  276. package/bpk-component-button/src/commonButtonTests.js +0 -133
  277. package/bpk-component-navigation-bar/src/BpkNavigationBarButtonLink.module.css +0 -18
@@ -16,6 +16,6 @@
16
16
  * limitations under the License.
17
17
  */import BpkAccordion from "./src/BpkAccordion";
18
18
  import BpkAccordionItem from "./src/BpkAccordionItem";
19
- import withSingleItemAccordionState from "./src/withSingleItemAccordionState";
20
19
  import withAccordionItemState from "./src/withAccordionItemState";
20
+ import withSingleItemAccordionState from "./src/withSingleItemAccordionState";
21
21
  export { BpkAccordion, BpkAccordionItem, withSingleItemAccordionState, withAccordionItemState };
@@ -23,8 +23,7 @@ import BpkText, { TEXT_STYLES } from "../../bpk-component-text";
23
23
  import { cssModules } from "../../bpk-react-utils";
24
24
  import { BpkAccordionContext } from "./BpkAccordion";
25
25
  import STYLES from "./BpkAccordionItem.module.css";
26
- import { jsxs as _jsxs } from "react/jsx-runtime";
27
- import { jsx as _jsx } from "react/jsx-runtime";
26
+ import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
28
27
  const getClassName = cssModules(STYLES);
29
28
  const ExpandIcon = withButtonAlignment(ChevronDownIcon);
30
29
  const BpkAccordionItem = props => {
@@ -95,18 +94,18 @@ const BpkAccordionItem = props => {
95
94
  "aria-controls": contentId,
96
95
  onClick: onClick,
97
96
  className: getClassName('bpk-accordion__toggle-button'),
98
- children: /*#__PURE__*/_jsxs("span", {
99
- className: getClassName('bpk-accordion__flex-container'),
100
- children: [/*#__PURE__*/_jsxs(BpkText, {
101
- textStyle: textStyle,
102
- tagName: tagName,
97
+ children: /*#__PURE__*/_jsxs("div", {
98
+ className: `${getClassName('bpk-accordion__flex-container')}`,
99
+ children: [/*#__PURE__*/_jsx("div", {
103
100
  className: titleTextClassNames.join(' '),
104
- children: [clonedIcon, title]
105
- }), /*#__PURE__*/_jsx("span", {
106
- className: getClassName('bpk-accordion__icon-wrapper'),
107
- children: /*#__PURE__*/_jsx(ExpandIcon, {
108
- className: iconClassNames.join(' ')
101
+ children: /*#__PURE__*/_jsxs(BpkText, {
102
+ textStyle: textStyle,
103
+ tagName: tagName,
104
+ children: [clonedIcon, title]
109
105
  })
106
+ }), /*#__PURE__*/_jsx("span", {
107
+ className: `${getClassName('bpk-accordion__icon-wrapper')} ${iconClassNames.join(' ')}`,
108
+ children: /*#__PURE__*/_jsx(ExpandIcon, {})
110
109
  })]
111
110
  })
112
111
  })
@@ -136,7 +135,7 @@ BpkAccordionItem.defaultProps = {
136
135
  expanded: false,
137
136
  icon: null,
138
137
  onClick: () => null,
139
- tagName: 'span',
138
+ tagName: 'h3',
140
139
  textStyle: TEXT_STYLES.bodyDefault
141
140
  };
142
141
  export default BpkAccordionItem;
@@ -15,4 +15,4 @@
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
17
  */
18
- .bpk-accordion__title{height:auto}.bpk-accordion__title--collapsed{box-shadow:0 -1px 0 0 #c1c7cf inset}.bpk-accordion__title--collapsed-on-dark{box-shadow:0 -1px 0 0 rgba(255,255,255,.5) inset}.bpk-accordion__toggle-button{width:100%;padding:0;border:0;background-color:rgba(0,0,0,0);color:#161616;text-align:left;cursor:pointer;appearance:none}html[dir=rtl] .bpk-accordion__toggle-button{text-align:right}.bpk-accordion__flex-container{display:inline-flex;width:100%;margin:1rem 0;flex-direction:row}.bpk-accordion__title-text{display:inline-block;flex-grow:1}.bpk-accordion__title-text--on-dark{color:#fff}.bpk-accordion__icon-wrapper{display:inline-block}.bpk-accordion__leading-icon{margin-left:0;margin-right:.5rem}html[dir=rtl] .bpk-accordion__leading-icon{margin-left:.5rem;margin-right:0}.bpk-accordion__item-expand-icon{fill:#161616}.bpk-accordion__item-expand-icon--flipped{transform:scaleY(-1)}.bpk-accordion__item-expand-icon--on-dark{fill:#fff}.bpk-accordion__content-container{margin:0}.bpk-accordion__content-container--expanded{padding-bottom:1rem;box-shadow:0 -1px 0 0 #c1c7cf inset}.bpk-accordion__content-container--expanded-on-dark{padding-bottom:1rem;box-shadow:0 -1px 0 0 rgba(255,255,255,.5) inset}
18
+ .bpk-accordion__title{height:auto}.bpk-accordion__title--collapsed{box-shadow:0 -1px 0 0 #c1c7cf inset}.bpk-accordion__title--collapsed-on-dark{box-shadow:0 -1px 0 0 rgba(255,255,255,.5) inset}.bpk-accordion__toggle-button{width:100%;padding:0;border:0;background-color:rgba(0,0,0,0);color:#161616;text-align:left;cursor:pointer;appearance:none}html[dir=rtl] .bpk-accordion__toggle-button{text-align:right}.bpk-accordion__flex-container{display:inline-flex;width:100%;margin:1rem 0;flex-direction:row}.bpk-accordion__title-text{flex-grow:1}.bpk-accordion__title-text--on-dark{color:#fff}.bpk-accordion__icon-wrapper{display:inline-block}.bpk-accordion__leading-icon{margin-left:0;margin-right:.5rem}html[dir=rtl] .bpk-accordion__leading-icon{margin-left:.5rem;margin-right:0}.bpk-accordion__item-expand-icon{fill:#161616}.bpk-accordion__item-expand-icon--flipped{transform:scaleY(-1)}.bpk-accordion__item-expand-icon--on-dark{fill:#fff}.bpk-accordion__content-container{margin:0}.bpk-accordion__content-container--expanded{padding-bottom:1rem;box-shadow:0 -1px 0 0 #c1c7cf inset}.bpk-accordion__content-container--expanded-on-dark{padding-bottom:1rem;box-shadow:0 -1px 0 0 rgba(255,255,255,.5) inset}
@@ -17,8 +17,7 @@
17
17
  */import PropTypes from 'prop-types';
18
18
  import { cssModules } from "../../bpk-react-utils";
19
19
  import STYLES from "./BpkAutosuggest.module.css";
20
- import { jsx as _jsx } from "react/jsx-runtime";
21
- import { jsxs as _jsxs } from "react/jsx-runtime";
20
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
22
21
  const getClassName = cssModules(STYLES);
23
22
  const BpkAutosuggestSuggestion = props => {
24
23
  const classNames = [getClassName('bpk-autosuggest__suggestion')];
@@ -44,7 +43,10 @@ const BpkAutosuggestSuggestion = props => {
44
43
  _jsxs("section", {
45
44
  className: classNames.join(' '),
46
45
  ...rest,
47
- children: [icon ? /*#__PURE__*/_jsx(Icon, {
46
+ children: [icon ? /*#__PURE__*/_jsx(Icon
47
+ // TODO: className to be removed
48
+ // eslint-disable-next-line @skyscanner/rules/forbid-component-props
49
+ , {
48
50
  className: getClassName('bpk-autosuggest__suggestion-icon')
49
51
  }) : null, /*#__PURE__*/_jsx("div", {
50
52
  className: getClassName('bpk-autosuggest__suggestion-content'),
@@ -20,7 +20,7 @@ import BpkBannerAlert from "./src/BpkBannerAlert";
20
20
  import BpkBannerAlertDismissable from "./src/BpkBannerAlertDismissable";
21
21
  import BpkBannerAlertExpandable from "./src/BpkBannerAlertExpandable";
22
22
  import { ALERT_TYPES } from "./src/common-types";
23
- import withBannerAlertState from "./src/withBannerAlertState";
24
23
  import themeAttributes from "./src/themeAttributes";
24
+ import withBannerAlertState from "./src/withBannerAlertState";
25
25
  export { ALERT_TYPES, BpkBannerAlertDismissable, BpkBannerAlertExpandable, withBannerAlertState, themeAttributes };
26
26
  export default BpkBannerAlert;
@@ -18,22 +18,22 @@
18
18
 
19
19
  import { Component } from 'react';
20
20
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
21
- import { durationSm } from '@skyscanner/bpk-foundations-web/tokens/base.es6';
22
- // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
23
21
  import { TransitionGroup, CSSTransition } from 'react-transition-group';
24
- import { cssModules } from "../../bpk-react-utils";
22
+
23
+ // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
24
+ import { durationSm } from '@skyscanner/bpk-foundations-web/tokens/base.es6';
25
+
25
26
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
26
27
  import BpkAnimateHeight from "../../bpk-animate-height";
28
+ import { cssModules } from "../../bpk-react-utils";
27
29
  import STYLES from "./BpkAnimateAndFade.module.css";
28
- import { jsx as _jsx } from "react/jsx-runtime";
29
- import { jsxs as _jsxs } from "react/jsx-runtime";
30
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
30
31
  const getClassName = cssModules(STYLES);
31
32
  const ANIMATION_DURATION = parseInt(durationSm, 10);
32
33
  class AnimateAndFade extends Component {
33
34
  static defaultProps = {
34
35
  animateOnEnter: false,
35
- animateOnLeave: false,
36
- className: null
36
+ animateOnLeave: false
37
37
  };
38
38
  constructor(props) {
39
39
  super(props);
@@ -110,37 +110,39 @@ class AnimateAndFade extends Component {
110
110
  // While the expanding animation takes place, we render the child element
111
111
  // close to invisible. If we don't do this, the animate-height container
112
112
  // will take on height 0, and will never expand to allow the children to fade in
113
- return this.state.inDom ? /*#__PURE__*/_jsxs(BpkAnimateHeight, {
113
+ return this.state.inDom ? /*#__PURE__*/_jsx("div", {
114
114
  className: className,
115
- onAnimationComplete: this.onAnimateHeightComplete,
116
- duration: ANIMATION_DURATION,
117
- height: this.state.isExpanded ? 'auto' : 0,
118
- children: [showPlaceholder && /*#__PURE__*/_jsx("div", {
119
- style: {
120
- opacity: 0.35
121
- },
122
- children: children
123
- }), /*#__PURE__*/_jsx(TransitionGroup, {
124
- exit: animateOnLeave,
125
- enter: animateOnEnter,
126
- appear: animateOnEnter,
127
- onTransitionEnd: this.onFadeComplete,
128
- children: this.state.visible && /*#__PURE__*/_jsx(CSSTransition, {
129
- classNames: {
130
- exit: getClassName('bpk-animate-and-fade--leave'),
131
- exitActive: getClassName('bpk-animate-and-fade--leave-active'),
132
- enter: getClassName('bpk-animate-and-fade--enter'),
133
- enterActive: getClassName('bpk-animate-and-fade--enter-active'),
134
- appear: getClassName('bpk-animate-and-fade--appear'),
135
- appearActive: getClassName('bpk-animate-and-fade--appear-active')
136
- },
137
- timeout: {
138
- enter: ANIMATION_DURATION * 2,
139
- exit: ANIMATION_DURATION * 2
115
+ children: /*#__PURE__*/_jsxs(BpkAnimateHeight, {
116
+ onAnimationComplete: this.onAnimateHeightComplete,
117
+ duration: ANIMATION_DURATION,
118
+ height: this.state.isExpanded ? 'auto' : 0,
119
+ children: [showPlaceholder && /*#__PURE__*/_jsx("div", {
120
+ style: {
121
+ opacity: 0.35
140
122
  },
141
123
  children: children
142
- })
143
- })]
124
+ }), /*#__PURE__*/_jsx(TransitionGroup, {
125
+ exit: animateOnLeave,
126
+ enter: animateOnEnter,
127
+ appear: animateOnEnter,
128
+ onTransitionEnd: this.onFadeComplete,
129
+ children: this.state.visible && /*#__PURE__*/_jsx(CSSTransition, {
130
+ classNames: {
131
+ exit: getClassName('bpk-animate-and-fade--leave'),
132
+ exitActive: getClassName('bpk-animate-and-fade--leave-active'),
133
+ enter: getClassName('bpk-animate-and-fade--enter'),
134
+ enterActive: getClassName('bpk-animate-and-fade--enter-active'),
135
+ appear: getClassName('bpk-animate-and-fade--appear'),
136
+ appearActive: getClassName('bpk-animate-and-fade--appear-active')
137
+ },
138
+ timeout: {
139
+ enter: ANIMATION_DURATION * 2,
140
+ exit: ANIMATION_DURATION * 2
141
+ },
142
+ children: children
143
+ })
144
+ })]
145
+ })
144
146
  }) : null;
145
147
  }
146
148
  }
@@ -22,23 +22,23 @@
22
22
 
23
23
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
24
24
  import { durationSm } from '@skyscanner/bpk-foundations-web/tokens/base.es6';
25
- import { withButtonAlignment } from "../../bpk-component-icon";
25
+
26
26
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
27
27
  import BpkAnimateHeight from "../../bpk-animate-height";
28
28
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
29
29
  import BpkCloseButton from "../../bpk-component-close-button";
30
- // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
31
- import TickCircleIcon from "../../bpk-component-icon/sm/tick-circle";
30
+ import { withButtonAlignment } from "../../bpk-component-icon";
32
31
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
33
32
  import ChevronDownIcon from "../../bpk-component-icon/lg/chevron-down";
34
33
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
35
34
  import InfoCircleIcon from "../../bpk-component-icon/sm/information-circle";
35
+ // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
36
+ import TickCircleIcon from "../../bpk-component-icon/sm/tick-circle";
36
37
  import { cssModules } from "../../bpk-react-utils";
37
38
  import AnimateAndFade from "./AnimateAndFade";
38
39
  import { ALERT_TYPES } from "./common-types";
39
40
  import STYLES from "./BpkBannerAlert.module.css";
40
- import { jsx as _jsx } from "react/jsx-runtime";
41
- import { jsxs as _jsxs } from "react/jsx-runtime";
41
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
42
42
  const getClassName = cssModules(STYLES);
43
43
  const ExpandIcon = withButtonAlignment(ChevronDownIcon);
44
44
  export const CONFIGURATION = {
@@ -64,6 +64,9 @@ const getIconForType = (type, CustomIcon) => {
64
64
  };
65
65
  const Icon = CustomIcon || componentMap[type];
66
66
  const AlignedIcon = withButtonAlignment(Icon);
67
+
68
+ // TODO: className to be removed
69
+ // eslint-disable-next-line @skyscanner/rules/forbid-component-props
67
70
  return /*#__PURE__*/_jsx(AlignedIcon, {
68
71
  className: className
69
72
  });
@@ -79,7 +82,10 @@ const ToggleButton = props => {
79
82
  "aria-label": props.label,
80
83
  "aria-expanded": props.expanded,
81
84
  title: props.label,
82
- children: /*#__PURE__*/_jsx(ExpandIcon, {
85
+ children: /*#__PURE__*/_jsx(ExpandIcon
86
+ // TODO: className to be removed
87
+ // eslint-disable-next-line @skyscanner/rules/forbid-component-props
88
+ , {
83
89
  className: classNames.join(' ')
84
90
  })
85
91
  });
@@ -15,26 +15,25 @@
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
17
  */import PropTypes from 'prop-types';
18
- import debounce from 'lodash.debounce';
19
18
  import { Component } from 'react';
20
19
  import { scaleLinear, scaleBand } from 'd3-scale';
20
+ import debounce from 'lodash.debounce';
21
21
  import { lineHeightSm } from '@skyscanner/bpk-foundations-web/tokens/base.es6';
22
- import { cssModules } from "../../bpk-react-utils";
23
22
  import BpkMobileScrollContainer from "../../bpk-component-mobile-scroll-container";
24
- import BpkBarchartDefs from "./BpkBarchartDefs";
23
+ import { cssModules } from "../../bpk-react-utils";
24
+ import BpkBarchartBar from "./BpkBarchartBar";
25
25
  import BpkBarchartBars from "./BpkBarchartBars";
26
- import BpkChartDataTable from "./BpkChartDataTable";
27
- import BpkChartMargin from "./BpkChartMargin";
26
+ import BpkBarchartDefs from "./BpkBarchartDefs";
28
27
  import BpkChartAxis from "./BpkChartAxis";
28
+ import BpkChartDataTable from "./BpkChartDataTable";
29
29
  import BpkChartGridLines from "./BpkChartGridLines";
30
- import BpkBarchartBar from "./BpkBarchartBar";
31
- import dataProp from "./customPropTypes";
32
- import { identity, remToPx } from "./utils";
30
+ import BpkChartMargin from "./BpkChartMargin";
33
31
  import { applyArrayRTLTransform, applyMarginRTLTransform } from "./RTLtransforms";
32
+ import dataProp from "./customPropTypes";
34
33
  import { ORIENTATION_X, ORIENTATION_Y } from "./orientation";
34
+ import { identity, remToPx } from "./utils";
35
35
  import STYLES from "./BpkBarchart.module.css";
36
- import { jsx as _jsx } from "react/jsx-runtime";
37
- import { jsxs as _jsxs } from "react/jsx-runtime";
36
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
38
37
  const getClassName = cssModules(STYLES);
39
38
  const spacing = remToPx('.375rem');
40
39
  const lineHeight = remToPx(lineHeightSm);
@@ -19,8 +19,7 @@ import { borderRadiusXs } from '@skyscanner/bpk-foundations-web/tokens/base.es6'
19
19
  import { cssModules } from "../../bpk-react-utils";
20
20
  import { remToPx } from "./utils";
21
21
  import STYLES from "./BpkBarchartBar.module.css";
22
- import { jsx as _jsx } from "react/jsx-runtime";
23
- import { jsxs as _jsxs } from "react/jsx-runtime";
22
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
23
  const getClassName = cssModules(STYLES);
25
24
  const KEYCODES = {
26
25
  ENTER: 13,
@@ -14,8 +14,8 @@
14
14
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
- */import { scaleBand, scaleLinear } from 'd3-scale';
18
- import PropTypes from 'prop-types';
17
+ */import PropTypes from 'prop-types';
18
+ import { scaleBand, scaleLinear } from 'd3-scale';
19
19
  import { borderRadiusXs } from '@skyscanner/bpk-foundations-web/tokens/base.es6';
20
20
  import BpkBarchartBar from "./BpkBarchartBar";
21
21
  import { remToPx } from "./utils";
@@ -1,5 +1,4 @@
1
- import { jsx as _jsx } from "react/jsx-runtime";
2
- import { jsxs as _jsxs } from "react/jsx-runtime";
1
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
3
2
  /*
4
3
  * Backpack - Skyscanner's Design System
5
4
  *
@@ -21,8 +21,7 @@ import { rtlConditionalValue } from "./RTLtransforms";
21
21
  import { ORIENTATION_X, ORIENTATION_Y } from "./orientation";
22
22
  import { identity, center, remToPx } from "./utils";
23
23
  import STYLES from "./BpkChartAxis.module.css";
24
- import { jsx as _jsx } from "react/jsx-runtime";
25
- import { jsxs as _jsxs } from "react/jsx-runtime";
24
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
26
25
  const getClassName = cssModules(STYLES);
27
26
  const spacing = remToPx('.375rem');
28
27
  const lineHeight = remToPx(lineHeightSm);
@@ -18,8 +18,7 @@
18
18
  import { cssModules } from "../../bpk-react-utils";
19
19
  import dataProp from "./customPropTypes";
20
20
  import STYLES from "./BpkChartDataTable.module.css";
21
- import { jsx as _jsx } from "react/jsx-runtime";
22
- import { jsxs as _jsxs } from "react/jsx-runtime";
21
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
23
22
  const getClassName = cssModules(STYLES);
24
23
  const BpkChartDataTable = props => {
25
24
  const {
@@ -19,16 +19,14 @@
19
19
  import { useState } from "react";
20
20
  import BpkBreakpoint, { BREAKPOINTS } from "../../bpk-component-breakpoint";
21
21
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
22
- import { BpkButtonLink } from "../../bpk-component-link";
23
- // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
24
22
  import BpkCloseButton from "../../bpk-component-close-button";
25
- import { BpkDialogWrapper, cssModules } from "../../bpk-react-utils";
23
+ // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
24
+ import { BpkButtonLink } from "../../bpk-component-link";
26
25
  import BpkNavigationBar from "../../bpk-component-navigation-bar";
27
26
  import BpkText, { TEXT_STYLES } from "../../bpk-component-text/src/BpkText";
27
+ import { BpkDialogWrapper, cssModules } from "../../bpk-react-utils";
28
28
  import STYLES from "./BpkBottomSheet.module.css";
29
- import { jsx as _jsx } from "react/jsx-runtime";
30
- import { Fragment as _Fragment } from "react/jsx-runtime";
31
- import { jsxs as _jsxs } from "react/jsx-runtime";
29
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
32
30
  const getClassName = cssModules(STYLES);
33
31
  const BpkBottomSheet = ({
34
32
  actionText = '',
@@ -18,8 +18,7 @@
18
18
  import { Component, Fragment } from 'react';
19
19
  import { cssModules } from "../../bpk-react-utils";
20
20
  import STYLES from "./BpkBreadcrumb.module.css";
21
- import { jsx as _jsx } from "react/jsx-runtime";
22
- import { jsxs as _jsxs } from "react/jsx-runtime";
21
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
23
22
  const getClassName = cssModules(STYLES);
24
23
  /*
25
24
  The google structured data reference for the stringified output of
@@ -15,14 +15,13 @@
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
17
  */import PropTypes from 'prop-types';
18
+ import { withRtlSupport } from "../../bpk-component-icon";
19
+ import ArrowRight from "../../bpk-component-icon/sm/arrow-right";
18
20
  import BpkLink from "../../bpk-component-link";
19
21
  import BpkText from "../../bpk-component-text";
20
22
  import { cssModules } from "../../bpk-react-utils";
21
- import { withRtlSupport } from "../../bpk-component-icon";
22
- import ArrowRight from "../../bpk-component-icon/sm/arrow-right";
23
23
  import STYLES from "./BpkBreadcrumbItem.module.css";
24
- import { jsx as _jsx } from "react/jsx-runtime";
25
- import { jsxs as _jsxs } from "react/jsx-runtime";
24
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
26
25
  const getClassName = cssModules(STYLES);
27
26
  const RtlSupportedArrowRight = withRtlSupport(ArrowRight);
28
27
  const BpkBreadcrumbItem = props => {
@@ -43,21 +42,26 @@ const BpkBreadcrumbItem = props => {
43
42
  children: [active ?
44
43
  /*#__PURE__*/
45
44
  // $FlowFixMe[cannot-spread-inexact] - inexact rest. See 'decisions/flowfixme.md'.
46
- _jsx(BpkText, {
45
+ _jsx("div", {
47
46
  className: getClassName('bpk-breadcrumb-item__active-item'),
48
- "aria-current": "page",
49
- ...linkProps,
50
- children: children
47
+ children: /*#__PURE__*/_jsx(BpkText, {
48
+ "aria-current": "page",
49
+ ...linkProps,
50
+ children: children
51
+ })
51
52
  }) :
52
53
  /*#__PURE__*/
53
54
  // $FlowFixMe[cannot-spread-inexact] - inexact rest. See 'decisions/flowfixme.md'.
54
- _jsx(BpkLink, {
55
- href: href,
55
+ _jsx("div", {
56
56
  className: getClassName('bpk-breadcrumb-item__link'),
57
- ...linkProps,
58
- children: children
59
- }), !active && /*#__PURE__*/_jsx(RtlSupportedArrowRight, {
60
- className: getClassName('bpk-breadcrumb-item__arrow')
57
+ children: /*#__PURE__*/_jsx(BpkLink, {
58
+ href: href,
59
+ ...linkProps,
60
+ children: children
61
+ })
62
+ }), /*#__PURE__*/_jsx("div", {
63
+ className: getClassName('bpk-breadcrumb-item__arrow'),
64
+ children: !active && /*#__PURE__*/_jsx(RtlSupportedArrowRight, {})
61
65
  })]
62
66
  })
63
67
  );
@@ -15,4 +15,4 @@
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
17
  */
18
- .bpk-breadcrumb-item{display:flex;align-items:center;white-space:nowrap}.bpk-breadcrumb-item__link{margin:0}.bpk-breadcrumb-item__active-item{color:#626971}.bpk-breadcrumb-item__arrow{margin:0 .25rem;fill:rgba(0,0,0,.2)}
18
+ .bpk-breadcrumb-item{display:flex;align-items:center;white-space:nowrap}.bpk-breadcrumb-item__link{margin:0}.bpk-breadcrumb-item__active-item{color:#626971}.bpk-breadcrumb-item__arrow{margin:0 .25rem;line-height:.5rem;fill:rgba(0,0,0,.2)}
@@ -17,5 +17,6 @@
17
17
  */
18
18
 
19
19
  import BpkBreakpoint, { BREAKPOINTS } from './src/BpkBreakpoint';
20
- export { BREAKPOINTS };
20
+ import useMediaQuery from './src/useMediaQuery';
21
+ export { BREAKPOINTS, useMediaQuery };
21
22
  export default BpkBreakpoint;
@@ -16,7 +16,7 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- import { useState, useEffect } from 'react';
19
+ import { useEffect, useState } from 'react';
20
20
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
21
21
  import { breakpoints } from '@skyscanner/bpk-foundations-web/tokens/base.es6';
22
22
  import useMediaQuery from "./useMediaQuery";
@@ -38,11 +38,16 @@ const BpkBreakpoint = ({
38
38
  matchSSR = false,
39
39
  query
40
40
  }) => {
41
+ /**
42
+ * The useEffect and useState combination forces BpkBreakpoint to re-render.
43
+ * Consumers of BpkBreakpoint have become reliant on this behaviour particularly when using BpkBreakpoint within a SSR'd application.
44
+ * This shouldn't be removed without a breaking change & understanding how to migrate consumers away from this reliance.
45
+ */
41
46
  const [isClient, setIsClient] = useState(false);
42
- const matches = useMediaQuery(query);
43
47
  useEffect(() => {
44
48
  setIsClient(true);
45
49
  }, []);
50
+ const matches = useMediaQuery(query, matchSSR);
46
51
  if (isClient) {
47
52
  if (!legacy && !Object.values(BREAKPOINTS).includes(query)) {
48
53
  console.warn(`Invalid query ${query}. Use one of the supported queries or pass the legacy prop.`);
@@ -52,9 +57,6 @@ const BpkBreakpoint = ({
52
57
  }
53
58
  return matches ? children : null;
54
59
  }
55
-
56
- // Below code is executed when running in SSR mode
57
-
58
60
  if (typeof children === 'function') {
59
61
  return children(matchSSR);
60
62
  }
@@ -16,11 +16,12 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- import { useState, useEffect } from 'react';
20
- const useMediaQuery = query => {
21
- const [matches, setMatches] = useState(window.matchMedia ? window.matchMedia(query).matches : false);
19
+ import { useEffect, useState } from 'react';
20
+ const useMediaQuery = (query, matchSSR = false) => {
21
+ const isClient = typeof window !== 'undefined' && !!window.matchMedia;
22
+ const [matches, setMatches] = useState(isClient ? window.matchMedia(query).matches : matchSSR);
22
23
  useEffect(() => {
23
- if (window.matchMedia) {
24
+ if (isClient) {
24
25
  const media = window.matchMedia(query);
25
26
  setMatches(media.matches);
26
27
  const listener = () => {
@@ -29,8 +30,8 @@ const useMediaQuery = query => {
29
30
  media.addEventListener('change', listener);
30
31
  return () => media.removeEventListener('change', listener);
31
32
  }
32
- return undefined;
33
- }, [query]);
33
+ return () => {};
34
+ }, [query, isClient]);
34
35
  return matches;
35
36
  };
36
37
  export default useMediaQuery;
@@ -15,16 +15,16 @@
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
17
  */import BpkButton from "./src/BpkButton"; // eslint-disable-line import/no-cycle
18
- import { BpkButtonV2 } from "./src/BpkButtonV2/BpkButton";
18
+ import BpkButtonDestructive from "./src/BpkButtonDestructive";
19
+ import BpkButtonFeatured from "./src/BpkButtonFeatured";
20
+ import BpkButtonLink from "./src/BpkButtonLink";
21
+ import BpkButtonLinkOnDark from "./src/BpkButtonLinkOnDark";
19
22
  import BpkButtonPrimary from "./src/BpkButtonPrimary";
20
23
  import BpkButtonPrimaryOnDark from "./src/BpkButtonPrimaryOnDark";
21
24
  import BpkButtonPrimaryOnLight from "./src/BpkButtonPrimaryOnLight";
22
25
  import BpkButtonSecondary from "./src/BpkButtonSecondary";
23
26
  import BpkButtonSecondaryOnDark from "./src/BpkButtonSecondaryOnDark";
24
- import BpkButtonDestructive from "./src/BpkButtonDestructive";
25
- import BpkButtonLink from "./src/BpkButtonLink";
26
- import BpkButtonLinkOnDark from "./src/BpkButtonLinkOnDark";
27
- import BpkButtonFeatured from "./src/BpkButtonFeatured";
27
+ import { BpkButtonV2 } from "./src/BpkButtonV2/BpkButton";
28
28
  export { BUTTON_TYPES, SIZE_TYPES } from "./src/BpkButtonV2/common-types";
29
29
  export { buttonThemeAttributes, primaryThemeAttributes, primaryOnDarkThemeAttributes, primaryOnLightThemeAttributes, secondaryThemeAttributes, secondaryOnDarkThemeAttributes, featuredThemeAttributes, destructiveThemeAttributes } from "./themeAttributes";
30
30
  export default BpkButton;
@@ -14,8 +14,8 @@
14
14
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
- */import { defaultProps, propTypes } from "./common-types";
18
- import BpkButtonBase, { cssModules } from "./BpkButtonBase";
17
+ */import BpkButtonBase, { cssModules } from "./BpkButtonBase";
18
+ import { defaultProps, propTypes } from "./common-types";
19
19
  import STYLES from "./BpkButtonDestructive.module.css";
20
20
  import { jsx as _jsx } from "react/jsx-runtime";
21
21
  const getClassName = cssModules(STYLES);
@@ -29,14 +29,15 @@ const BpkButtonDestructive = props => {
29
29
  classNames.push(className);
30
30
  }
31
31
  const classNamesFinal = classNames.join(' ');
32
- return (
33
- /*#__PURE__*/
32
+ return /*#__PURE__*/_jsx(BpkButtonBase
33
+ // TODO: className to be removed
34
+ // eslint-disable-next-line @skyscanner/rules/forbid-component-props
35
+ , {
36
+ className: classNamesFinal
34
37
  // $FlowFixMe[cannot-spread-inexact] - inexact rest. See 'decisions/flowfixme.md'.
35
- _jsx(BpkButtonBase, {
36
- className: classNamesFinal,
37
- ...rest
38
- })
39
- );
38
+ ,
39
+ ...rest
40
+ });
40
41
  };
41
42
  BpkButtonDestructive.propTypes = {
42
43
  ...propTypes
@@ -14,8 +14,8 @@
14
14
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
- */import { defaultProps, propTypes } from "./common-types";
18
- import BpkButtonBase, { cssModules } from "./BpkButtonBase";
17
+ */import BpkButtonBase, { cssModules } from "./BpkButtonBase";
18
+ import { defaultProps, propTypes } from "./common-types";
19
19
  import STYLES from "./BpkButtonFeatured.module.css";
20
20
  import { jsx as _jsx } from "react/jsx-runtime";
21
21
  const getClassName = cssModules(STYLES);
@@ -29,14 +29,15 @@ const BpkButtonFeatured = props => {
29
29
  classNames.push(className);
30
30
  }
31
31
  const classNamesFinal = classNames.join(' ');
32
- return (
33
- /*#__PURE__*/
32
+ return /*#__PURE__*/_jsx(BpkButtonBase
33
+ // TODO: className to be removed
34
+ // eslint-disable-next-line @skyscanner/rules/forbid-component-props
35
+ , {
36
+ className: classNamesFinal
34
37
  // $FlowFixMe[cannot-spread-inexact] - inexact rest. See 'decisions/flowfixme.md'.
35
- _jsx(BpkButtonBase, {
36
- className: classNamesFinal,
37
- ...rest
38
- })
39
- );
38
+ ,
39
+ ...rest
40
+ });
40
41
  };
41
42
  BpkButtonFeatured.propTypes = {
42
43
  ...propTypes