@skyscanner/backpack-web 18.2.1 → 20.0.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 (265) hide show
  1. package/README.md +0 -1
  2. package/bpk-animate-height/README.md +1 -1
  3. package/bpk-animate-height/src/AnimateHeight.js +1 -1
  4. package/bpk-component-accordion/README.md +0 -3
  5. package/bpk-component-accordion/src/BpkAccordion.js +1 -1
  6. package/bpk-component-accordion/src/BpkAccordionItem.js +3 -2
  7. package/bpk-component-accordion/src/withAccordionItemState.js +2 -1
  8. package/bpk-component-accordion/src/withSingleItemAccordionState.js +2 -8
  9. package/bpk-component-aria-live/README.md +0 -1
  10. package/bpk-component-aria-live/src/BpkAriaLive.js +0 -1
  11. package/bpk-component-autosuggest/README.md +1 -1
  12. package/bpk-component-autosuggest/src/BpkAutosuggest.js +0 -1
  13. package/bpk-component-autosuggest/src/BpkAutosuggestSuggestion.js +1 -1
  14. package/bpk-component-badge/README.md +0 -1
  15. package/bpk-component-badge/src/BpkBadge.js +0 -1
  16. package/bpk-component-banner-alert/README.md +2 -3
  17. package/bpk-component-banner-alert/src/AnimateAndFade.js +2 -1
  18. package/bpk-component-banner-alert/src/BpkBannerAlert.js +1 -3
  19. package/bpk-component-banner-alert/src/BpkBannerAlert.module.scss +0 -8
  20. package/bpk-component-banner-alert/src/BpkBannerAlertDismissable.js +0 -1
  21. package/bpk-component-banner-alert/src/BpkBannerAlertExpandable.js +1 -1
  22. package/bpk-component-banner-alert/src/BpkBannerAlertInner.js +1 -3
  23. package/bpk-component-banner-alert/src/common-types.js +1 -9
  24. package/bpk-component-banner-alert/src/withBannerAlertState.js +2 -1
  25. package/bpk-component-barchart/README.md +0 -1
  26. package/bpk-component-barchart/src/BpkBarchart.js +1 -1
  27. package/bpk-component-barchart/src/BpkBarchartBar.js +0 -1
  28. package/bpk-component-barchart/src/BpkBarchartBars.js +0 -1
  29. package/bpk-component-barchart/src/BpkBarchartDefs.js +0 -2
  30. package/bpk-component-barchart/src/BpkChartAxis.js +1 -1
  31. package/bpk-component-barchart/src/BpkChartDataTable.js +0 -1
  32. package/bpk-component-barchart/src/BpkChartGridLines.js +0 -1
  33. package/bpk-component-barchart/src/BpkChartMargin.js +1 -1
  34. package/bpk-component-blockquote/README.md +0 -1
  35. package/bpk-component-blockquote/src/BpkBlockquote.js +0 -1
  36. package/bpk-component-breadcrumb/README.md +1 -1
  37. package/bpk-component-breadcrumb/src/BpkBreadcrumb.js +5 -4
  38. package/bpk-component-breadcrumb/src/BpkBreadcrumbItem.js +1 -1
  39. package/bpk-component-breakpoint/README.md +0 -1
  40. package/bpk-component-breakpoint/src/BpkBreakpoint.js +1 -1
  41. package/bpk-component-button/README.md +0 -3
  42. package/bpk-component-button/index.js +0 -2
  43. package/bpk-component-button/src/BpkButton.js +0 -9
  44. package/bpk-component-button/src/BpkButtonBase.js +1 -3
  45. package/bpk-component-button/src/BpkButtonDestructive.js +1 -3
  46. package/bpk-component-button/src/BpkButtonFeatured.js +1 -3
  47. package/bpk-component-button/src/BpkButtonLink.js +1 -7
  48. package/bpk-component-button/src/BpkButtonLinkOnDark.js +1 -7
  49. package/bpk-component-button/src/BpkButtonPrimary.js +1 -3
  50. package/bpk-component-button/src/BpkButtonPrimaryOnDark.js +1 -3
  51. package/bpk-component-button/src/BpkButtonPrimaryOnLight.js +1 -3
  52. package/bpk-component-button/src/BpkButtonSecondary.js +1 -3
  53. package/bpk-component-button/src/BpkButtonSecondaryOnDark.js +1 -3
  54. package/bpk-component-button/src/commonButtonTests.js +0 -1
  55. package/bpk-component-calendar/README.md +2 -2
  56. package/bpk-component-calendar/src/BpkCalendarContainer.js +4 -19
  57. package/bpk-component-calendar/src/BpkCalendarDate.js +1 -1
  58. package/bpk-component-calendar/src/BpkCalendarGrid.js +2 -19
  59. package/bpk-component-calendar/src/BpkCalendarGridHeader.js +2 -7
  60. package/bpk-component-calendar/src/BpkCalendarGridTransition.js +1 -1
  61. package/bpk-component-calendar/src/BpkCalendarNav.js +0 -1
  62. package/bpk-component-calendar/src/Week.js +2 -21
  63. package/bpk-component-calendar/src/composeCalendar.js +1 -12
  64. package/bpk-component-card/README.md +0 -2
  65. package/bpk-component-card/src/BpkCard.js +1 -1
  66. package/bpk-component-card/src/BpkDividedCard.js +0 -1
  67. package/bpk-component-checkbox/README.md +0 -1
  68. package/bpk-component-checkbox/src/BpkCheckbox.js +1 -1
  69. package/bpk-component-chip/README.md +0 -1
  70. package/bpk-component-chip/src/BpkDismissibleChip.js +0 -2
  71. package/bpk-component-chip/src/BpkDropdownChip.js +0 -2
  72. package/bpk-component-chip/src/BpkSelectableChip.js +1 -1
  73. package/bpk-component-close-button/README.md +0 -1
  74. package/bpk-component-close-button/src/BpkCloseButton.js +1 -1
  75. package/bpk-component-code/README.md +0 -1
  76. package/bpk-component-code/src/BpkCode.js +1 -1
  77. package/bpk-component-code/src/BpkCodeBlock.js +1 -1
  78. package/bpk-component-content-cards/README.md +0 -1
  79. package/bpk-component-content-cards/src/BpkContentCard.js +0 -2
  80. package/bpk-component-content-cards/src/BpkContentCards.js +0 -2
  81. package/bpk-component-datatable/README.md +3 -4
  82. package/bpk-component-datatable/src/BpkDataTable.js +3 -2
  83. package/bpk-component-datatable/src/BpkDataTableColumn.js +0 -1
  84. package/bpk-component-datatable/src/BpkDataTableHeader.js +2 -2
  85. package/bpk-component-datepicker/README.md +2 -2
  86. package/bpk-component-datepicker/src/BpkDatepicker.js +3 -13
  87. package/bpk-component-description-list/README.md +0 -1
  88. package/bpk-component-description-list/src/ComponentFactory.js +0 -1
  89. package/bpk-component-dialog/README.md +1 -1
  90. package/bpk-component-dialog/src/BpkDialog.js +0 -2
  91. package/bpk-component-dialog/src/BpkDialogInner.js +0 -2
  92. package/bpk-component-drawer/README.md +1 -1
  93. package/bpk-component-drawer/src/BpkDrawer.js +1 -1
  94. package/bpk-component-drawer/src/BpkDrawerContent.js +1 -1
  95. package/bpk-component-fieldset/README.md +1 -1
  96. package/bpk-component-fieldset/src/BpkFieldset.js +2 -1
  97. package/bpk-component-flare/README.md +0 -1
  98. package/bpk-component-flare/src/BpkContentBubble.js +0 -1
  99. package/bpk-component-flare/src/BpkFlareBar.js +0 -1
  100. package/bpk-component-flare/src/svgs/pointer.svg +1 -1
  101. package/bpk-component-floating-notification/README.md +0 -1
  102. package/bpk-component-floating-notification/src/BpkFloatingNotification.js +1 -1
  103. package/bpk-component-form-validation/README.md +0 -1
  104. package/bpk-component-form-validation/src/BpkFormValidation.js +0 -1
  105. package/bpk-component-graphic-promotion/README.md +0 -1
  106. package/bpk-component-graphic-promotion/src/BpkGraphicPromo.js +4 -4
  107. package/bpk-component-grid-toggle/README.md +0 -1
  108. package/bpk-component-grid-toggle/src/BpkGridToggle.js +2 -2
  109. package/bpk-component-horizontal-nav/README.md +1 -1
  110. package/bpk-component-horizontal-nav/src/BpkHorizontalNav.js +4 -3
  111. package/bpk-component-horizontal-nav/src/BpkHorizontalNavItem.js +2 -1
  112. package/bpk-component-icon/README.md +0 -3
  113. package/bpk-component-icon/index.js +0 -4
  114. package/bpk-component-icon/src/classNameModifierHOCFactory.js +0 -1
  115. package/bpk-component-icon/src/withAlignment.js +0 -2
  116. package/bpk-component-icon/src/withDescription.js +1 -1
  117. package/bpk-component-image/README.md +0 -1
  118. package/bpk-component-image/src/BpkBackgroundImage.js +4 -20
  119. package/bpk-component-image/src/BpkImage.js +4 -22
  120. package/bpk-component-image/src/withLazyLoading.js +9 -5
  121. package/bpk-component-image/src/withLoadingBehavior.js +6 -5
  122. package/bpk-component-infinite-scroll/README.md +0 -2
  123. package/bpk-component-infinite-scroll/src/withInfiniteScroll-test.flow.js +3 -3
  124. package/bpk-component-infinite-scroll/src/withInfiniteScroll.js +2 -6
  125. package/bpk-component-input/README.md +0 -2
  126. package/bpk-component-input/index.js +2 -11
  127. package/bpk-component-input/src/BpkClearButton.js +0 -1
  128. package/bpk-component-input/src/BpkInput.js +1 -1
  129. package/bpk-component-input/src/withOpenEvents.js +2 -2
  130. package/bpk-component-label/README.md +0 -1
  131. package/bpk-component-label/src/BpkLabel.js +1 -1
  132. package/bpk-component-link/README.md +0 -1
  133. package/bpk-component-link/src/BpkButtonLink.js +3 -8
  134. package/bpk-component-link/src/BpkLink.js +2 -8
  135. package/bpk-component-list/README.md +0 -1
  136. package/bpk-component-list/src/BpkList.js +1 -1
  137. package/bpk-component-list/src/BpkListItem.js +1 -1
  138. package/bpk-component-loading-button/README.md +0 -1
  139. package/bpk-component-loading-button/src/BpkLoadingButton.js +1 -1
  140. package/bpk-component-map/README.md +0 -3
  141. package/bpk-component-map/src/BpkBasicMapMarker.js +1 -1
  142. package/bpk-component-map/src/BpkIconMarker.js +1 -1
  143. package/bpk-component-map/src/BpkIconMarkerBackground.js +0 -2
  144. package/bpk-component-map/src/BpkMap.js +2 -1
  145. package/bpk-component-map/src/BpkOverlayView.js +1 -1
  146. package/bpk-component-map/src/BpkPriceMarker.js +0 -1
  147. package/bpk-component-map/src/DefaultLoadingElement.js +0 -2
  148. package/bpk-component-map/src/withGoogleMapsScript.js +1 -1
  149. package/bpk-component-mobile-scroll-container/README.md +0 -1
  150. package/bpk-component-mobile-scroll-container/src/BpkMobileScrollContainer.js +2 -1
  151. package/bpk-component-modal/README.md +1 -1
  152. package/bpk-component-modal/src/BpkModal.js +0 -1
  153. package/bpk-component-modal/src/BpkModalInner.js +1 -1
  154. package/bpk-component-navigation-bar/README.md +0 -3
  155. package/bpk-component-navigation-bar/src/BpkNavigationBar.js +3 -2
  156. package/bpk-component-navigation-bar/src/BpkNavigationBarButtonLink.js +1 -1
  157. package/bpk-component-navigation-bar/src/BpkNavigationBarIconButton.js +1 -1
  158. package/bpk-component-nudger/README.md +2 -2
  159. package/bpk-component-nudger/src/BpkConfigurableNudger.js +0 -1
  160. package/bpk-component-nudger/src/BpkNudger.js +0 -1
  161. package/bpk-component-overlay/README.md +1 -3
  162. package/bpk-component-overlay/index.js +1 -2
  163. package/bpk-component-overlay/src/BpkOverlay.js +2 -15
  164. package/bpk-component-page-indicator/README.md +0 -1
  165. package/bpk-component-page-indicator/src/BpkPageIndicator.js +0 -1
  166. package/bpk-component-page-indicator/src/NavButton.js +0 -1
  167. package/bpk-component-pagination/README.md +0 -1
  168. package/bpk-component-pagination/src/BpkPagination.js +0 -1
  169. package/bpk-component-pagination/src/BpkPaginationBreak.js +0 -1
  170. package/bpk-component-pagination/src/BpkPaginationList.js +0 -1
  171. package/bpk-component-pagination/src/BpkPaginationNudger.js +0 -1
  172. package/bpk-component-pagination/src/BpkPaginationPage.js +0 -1
  173. package/bpk-component-panel/README.md +0 -1
  174. package/bpk-component-panel/src/BpkPanel.js +0 -1
  175. package/bpk-component-phone-input/README.md +1 -1
  176. package/bpk-component-phone-input/src/BpkPhoneInput.js +0 -1
  177. package/bpk-component-popover/README.md +1 -1
  178. package/bpk-component-popover/src/BpkPopover.js +1 -1
  179. package/bpk-component-popover/src/BpkPopoverPortal.js +2 -1
  180. package/bpk-component-price/README.md +4 -4
  181. package/bpk-component-price/src/BpkPrice.js +60 -25
  182. package/bpk-component-price/src/BpkPrice.module.scss +18 -5
  183. package/bpk-component-progress/README.md +1 -1
  184. package/bpk-component-progress/src/BpkProgress.js +1 -1
  185. package/bpk-component-radio/README.md +0 -1
  186. package/bpk-component-radio/src/BpkRadio.js +1 -1
  187. package/bpk-component-rating/README.md +0 -1
  188. package/bpk-component-rating/src/BpkRating.js +1 -1
  189. package/bpk-component-rtl-toggle/README.md +0 -1
  190. package/bpk-component-rtl-toggle/src/BpkRtlToggle.js +2 -2
  191. package/bpk-component-rtl-toggle/src/updateOnDirectionChange.js +1 -1
  192. package/bpk-component-scrollable-calendar/README.md +1 -1
  193. package/bpk-component-scrollable-calendar/src/BpkScrollableCalendarDate.js +1 -1
  194. package/bpk-component-scrollable-calendar/src/BpkScrollableCalendarGrid.js +0 -2
  195. package/bpk-component-scrollable-calendar/src/BpkScrollableCalendarGridList.js +3 -8
  196. package/bpk-component-section-list/README.md +0 -1
  197. package/bpk-component-section-list/src/BpkSectionList.js +1 -1
  198. package/bpk-component-section-list/src/BpkSectionListItem.js +1 -1
  199. package/bpk-component-section-list/src/BpkSectionListSection.js +3 -2
  200. package/bpk-component-select/README.md +0 -2
  201. package/bpk-component-select/src/BpkSelect.js +3 -2
  202. package/bpk-component-skip-link/README.md +0 -1
  203. package/bpk-component-skip-link/src/BpkSkipLink.js +0 -1
  204. package/bpk-component-slider/README.md +1 -1
  205. package/bpk-component-slider/src/BpkSlider.js +0 -1
  206. package/bpk-component-spinner/README.md +0 -1
  207. package/bpk-component-spinner/src/BpkExtraLargeSpinner.js +0 -1
  208. package/bpk-component-spinner/src/BpkLargeSpinner.js +0 -1
  209. package/bpk-component-spinner/src/BpkSpinner.js +0 -1
  210. package/bpk-component-split-input/README.md +0 -1
  211. package/bpk-component-split-input/src/BpkInputField.js +1 -1
  212. package/bpk-component-split-input/src/BpkSplitInput.js +1 -1
  213. package/bpk-component-star-rating/README.md +0 -1
  214. package/bpk-component-star-rating/src/BpkInteractiveStar.js +0 -1
  215. package/bpk-component-star-rating/src/BpkInteractiveStarRating.js +0 -1
  216. package/bpk-component-star-rating/src/BpkStar.js +0 -1
  217. package/bpk-component-star-rating/src/BpkStarRating.js +0 -1
  218. package/bpk-component-star-rating/src/withInteractiveStarRatingState.js +2 -1
  219. package/bpk-component-switch/README.md +0 -1
  220. package/bpk-component-switch/index.js +2 -5
  221. package/bpk-component-switch/src/BpkSwitch.js +3 -18
  222. package/bpk-component-switch/src/BpkSwitch.module.scss +6 -13
  223. package/bpk-component-table/README.md +0 -2
  224. package/bpk-component-table/src/BpkTable.js +4 -14
  225. package/bpk-component-table/src/BpkTable.module.scss +0 -8
  226. package/bpk-component-table/src/BpkTableBody.js +1 -1
  227. package/bpk-component-table/src/BpkTableCell.js +1 -1
  228. package/bpk-component-table/src/BpkTableHead.js +1 -1
  229. package/bpk-component-table/src/BpkTableHeadCell.js +5 -10
  230. package/bpk-component-table/src/BpkTableRow.js +1 -1
  231. package/bpk-component-text/README.md +0 -3
  232. package/bpk-component-text/src/BpkText.js +1 -1
  233. package/bpk-component-textarea/README.md +0 -1
  234. package/bpk-component-textarea/src/BpkTextarea.js +0 -1
  235. package/bpk-component-theme-toggle/README.md +0 -2
  236. package/bpk-component-theme-toggle/src/BpkThemeToggle.js +2 -2
  237. package/bpk-component-theme-toggle/src/updateOnThemeChange.js +1 -1
  238. package/bpk-component-ticket/README.md +0 -1
  239. package/bpk-component-ticket/src/BpkTicket.js +1 -1
  240. package/bpk-component-tooltip/README.md +1 -1
  241. package/bpk-component-tooltip/src/BpkTooltip.js +1 -1
  242. package/bpk-component-tooltip/src/BpkTooltipPortal.js +3 -2
  243. package/bpk-react-utils/README.md +1 -7
  244. package/bpk-react-utils/src/TransitionInitialMount.js +1 -1
  245. package/bpk-react-utils/src/withDefaultProps.js +1 -1
  246. package/bpk-scrim-utils/src/BpkScrim.js +0 -1
  247. package/bpk-scrim-utils/src/withScrim.js +1 -1
  248. package/bpk-theming/src/BpkThemeProvider.js +1 -1
  249. package/package.json +2 -2
  250. package/bpk-component-button/BpkButtonOutline.js +0 -21
  251. package/bpk-component-button/src/BpkButtonOutline.js +0 -48
  252. package/bpk-component-button/src/BpkButtonOutline.module.css +0 -18
  253. package/bpk-component-button/src/BpkButtonOutline.module.scss +0 -23
  254. package/bpk-component-grid/README.md +0 -90
  255. package/bpk-component-grid/index.js +0 -25
  256. package/bpk-component-grid/src/BpkGridColumn.js +0 -118
  257. package/bpk-component-grid/src/BpkGridColumn.module.css +0 -18
  258. package/bpk-component-grid/src/BpkGridColumn.module.scss +0 -73
  259. package/bpk-component-grid/src/BpkGridContainer.js +0 -62
  260. package/bpk-component-grid/src/BpkGridContainer.module.css +0 -18
  261. package/bpk-component-grid/src/BpkGridContainer.module.scss +0 -33
  262. package/bpk-component-grid/src/BpkGridRow.js +0 -57
  263. package/bpk-component-grid/src/BpkGridRow.module.css +0 -18
  264. package/bpk-component-grid/src/BpkGridRow.module.scss +0 -29
  265. package/bpk-component-image/src/customPropTypes.js +0 -37
package/README.md CHANGED
@@ -48,7 +48,6 @@ To contribute please see [contributing.md](CONTRIBUTING.md).
48
48
  [`bpk-component-fieldset`](/packages/bpk-component-fieldset)
49
49
  [`bpk-component-form-validation`](/packages/bpk-component-form-validation)
50
50
  [`bpk-component-graphic-promotion`](/packages/bpk-component-graphic-promotion)
51
- [`bpk-component-grid`](/packages/bpk-component-grid)
52
51
  [`bpk-component-grid-toggle`](/packages/bpk-component-grid-toggle)
53
52
  [`bpk-component-horizontal-nav`](/packages/bpk-component-horizontal-nav)
54
53
  [`bpk-component-icon`](/packages/bpk-component-icon)
@@ -15,7 +15,7 @@ Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a comp
15
15
 
16
16
  ```js
17
17
  import AnimateHeight from '@skyscanner/backpack-web/bpk-animate-height';
18
- import React, { Component } from 'react';
18
+ import { Component } from 'react';
19
19
 
20
20
  class AnimateHeightContainer extends Component {
21
21
  constructor() {
@@ -17,7 +17,7 @@
17
17
  */
18
18
 
19
19
  import PropTypes from 'prop-types';
20
- import React, { Component } from 'react';
20
+ import { Component } from 'react';
21
21
 
22
22
  // IE11 doesn't support `Number.isNaN` so we must use the global.
23
23
  // When IE11 support drops we can migrate.
@@ -13,7 +13,6 @@ Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a comp
13
13
  The `withSingleItemAccordionState` higher-order component is used to limit one section to be expanded at any time.
14
14
 
15
15
  ```js
16
- import React from 'react';
17
16
  import { BpkAccordion, BpkAccordionItem, withSingleItemAccordionState } from '@skyscanner/backpack-web/bpk-component-accordion';
18
17
 
19
18
  const SingleItemAccordion = withSingleItemAccordionState(BpkAccordion);
@@ -38,7 +37,6 @@ export default () => (
38
37
  The `withAccordionItemState` higher-order component is used to allow multiple items to be expanded simultaneously.
39
38
 
40
39
  ```js
41
- import React from 'react';
42
40
  import { BpkAccordion, BpkAccordionItem, withAccordionItemState } from '@skyscanner/backpack-web/bpk-component-accordion';
43
41
 
44
42
  const StatefulAccordionItem = withAccordionItemState(BpkAccordionItem);
@@ -63,7 +61,6 @@ export default () => (
63
61
  `BpkAccordionItem` supports the use of displaying icons alongside the title. To do this you will need to align your icon to the text using `withAlignment` and pass through the matching sizes for the icon you wish to use. For more information see [Alignment](https://skyscanner.design/latest/components/alignment/web.html)
64
62
 
65
63
  ```js
66
- import React from 'react';
67
64
  import { BpkAccordion, BpkAccordionItem } from '@skyscanner/backpack-web/bpk-component-accordion';
68
65
  import { withAlignment } from '@skyscanner/backpack-web/bpk-component-icon';
69
66
  import StopsIcon from '@skyscanner/backpack-web/bpk-component-icon/sm/stops';
@@ -19,7 +19,7 @@
19
19
  /* @flow strict */
20
20
 
21
21
  import PropTypes from 'prop-types';
22
- import React, { type Node } from 'react';
22
+ import type { Node } from 'react';
23
23
 
24
24
  import { cssModules } from '../../bpk-react-utils';
25
25
 
@@ -19,7 +19,8 @@
19
19
  /* @flow strict */
20
20
 
21
21
  import PropTypes from 'prop-types';
22
- import React, { type Node, type Element } from 'react';
22
+ import type { Node, Element } from 'react';
23
+ import { cloneElement } from 'react';
23
24
 
24
25
  import AnimateHeight from '../../bpk-animate-height';
25
26
  import { withButtonAlignment } from '../../bpk-component-icon';
@@ -72,7 +73,7 @@ const BpkAccordionItem = (props: Props) => {
72
73
 
73
74
  const contentId = `${id}_content`;
74
75
  const clonedIcon = icon
75
- ? React.cloneElement(icon, {
76
+ ? cloneElement(icon, {
76
77
  className: getClassName('bpk-accordion__leading-icon'),
77
78
  })
78
79
  : null;
@@ -19,7 +19,8 @@
19
19
  /* @flow strict */
20
20
 
21
21
  import PropTypes from 'prop-types';
22
- import React, { Component, type ComponentType } from 'react';
22
+ import { Component } from 'react';
23
+ import type { ComponentType } from 'react';
23
24
 
24
25
  import { wrapDisplayName } from '../../bpk-react-utils';
25
26
 
@@ -19,14 +19,8 @@
19
19
  /* @flow strict */
20
20
 
21
21
  import PropTypes from 'prop-types';
22
- import React, {
23
- Component,
24
- Children,
25
- cloneElement,
26
- type Node,
27
- type Element,
28
- type ComponentType,
29
- } from 'react';
22
+ import { Component, Children, cloneElement } from 'react';
23
+ import type { Node, Element, ComponentType } from 'react';
30
24
 
31
25
  import { wrapDisplayName } from '../../bpk-react-utils';
32
26
 
@@ -9,7 +9,6 @@ Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a comp
9
9
  ## Usage
10
10
 
11
11
  ```tsx
12
- import React from 'react';
13
12
  import BpkAriaLive, { ARIA_LIVE_POLITENESS_SETTINGS } from '@skyscanner/backpack-web/bpk-component-aria-live';
14
13
 
15
14
  export default () => (
@@ -16,7 +16,6 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- import React from 'react';
20
19
  import type { ReactElement } from 'react';
21
20
 
22
21
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
@@ -9,7 +9,7 @@ Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a comp
9
9
  ## Usage
10
10
 
11
11
  ```js
12
- import React, { Component } from 'react';
12
+ import { Component } from 'react';
13
13
  import BpkLabel from '@skyscanner/backpack-web/bpk-component-label';
14
14
  import { withRtlSupport } from '@skyscanner/backpack-web/bpk-component-icon';
15
15
  import FlightIcon from '@skyscanner/backpack-web/bpk-component-icon/lg/flight';
@@ -18,7 +18,6 @@
18
18
 
19
19
  /* @flow strict */
20
20
 
21
- import React from 'react';
22
21
  import Autosuggest from 'react-autosuggest';
23
22
 
24
23
  import BpkInput from '../../bpk-component-input';
@@ -19,7 +19,7 @@
19
19
  /* @flow strict */
20
20
 
21
21
  import PropTypes from 'prop-types';
22
- import React, { type Node } from 'react';
22
+ import type { Node } from 'react';
23
23
 
24
24
  import { cssModules } from '../../bpk-react-utils';
25
25
 
@@ -9,7 +9,6 @@ Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a comp
9
9
  ## Usage
10
10
 
11
11
  ```js
12
- import React from 'react';
13
12
  import BpkBadge, { BADGE_TYPES } from '@skyscanner/backpack-web/bpk-component-badge';
14
13
 
15
14
  export default () => (
@@ -19,7 +19,6 @@
19
19
  /* @flow strict */
20
20
 
21
21
  import PropTypes from 'prop-types';
22
- import React from 'react';
23
22
 
24
23
  import { cssModules } from '../../bpk-react-utils';
25
24
 
@@ -11,7 +11,6 @@ Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a comp
11
11
  ### Default
12
12
 
13
13
  ```js
14
- import React from 'react';
15
14
  import BpkBannerAlert, { ALERT_TYPES } from '@skyscanner/backpack-web/bpk-component-banner-alert';
16
15
 
17
16
  export default () => (
@@ -25,7 +24,7 @@ export default () => (
25
24
  ### Dismissable
26
25
 
27
26
  ```js
28
- import React, { Component } from 'react';
27
+ import { Component } from 'react';
29
28
  import { ALERT_TYPES, BpkBannerAlertDismissable } from '@skyscanner/backpack-web/bpk-component-banner-alert';
30
29
 
31
30
  class DismissableBpkBannerAlert extends Component {
@@ -65,7 +64,7 @@ export default () => (
65
64
  ### withBannerAlertState(BpkBannerAlert)
66
65
 
67
66
  ```js
68
- import React, { Component } from 'react';
67
+ import { Component } from 'react';
69
68
  import { ALERT_TYPES, withBannerAlertState, BpkBannerAlertDismissable, BpkBannerAlertExpandable } from '@skyscanner/backpack-web/bpk-component-banner-alert';
70
69
 
71
70
  const BannerAlertDismissableState = withBannerAlertState(BpkBannerAlertDismissable);
@@ -18,7 +18,8 @@
18
18
  /* @flow strict */
19
19
 
20
20
  import PropTypes from 'prop-types';
21
- import React, { type Node, Component } from 'react';
21
+ import { Component } from 'react';
22
+ import type { Node } from 'react';
22
23
  import { durationSm } from '@skyscanner/bpk-foundations-web/tokens/base.es6';
23
24
  import { TransitionGroup, CSSTransition } from 'react-transition-group';
24
25
 
@@ -16,10 +16,8 @@
16
16
  * limitations under the License.
17
17
  */
18
18
  /* @flow strict */
19
- import React from 'react';
20
-
21
19
  import {
22
- type CommonProps,
20
+ CommonProps,
23
21
  COMMON_PROP_TYPES,
24
22
  COMMON_DEFAULT_PROPS,
25
23
  } from './common-types';
@@ -58,10 +58,6 @@ $bpk-spacing-v2: true;
58
58
  @include bpk-border-sm($bpk-banner-alert-neutral-color, '');
59
59
  }
60
60
 
61
- &--event {
62
- @include bpk-border-sm($bpk-banner-alert-event-color, '');
63
- }
64
-
65
61
  &__header {
66
62
  display: flex;
67
63
  padding: bpk-spacing-md();
@@ -129,10 +125,6 @@ $bpk-spacing-v2: true;
129
125
  fill: $bpk-text-secondary-day;
130
126
  }
131
127
 
132
- &__event-icon {
133
- fill: $bpk-banner-alert-event-color;
134
- }
135
-
136
128
  &__toggle-button {
137
129
  padding: 0;
138
130
  border: 0;
@@ -18,7 +18,6 @@
18
18
  /* @flow strict */
19
19
 
20
20
  import PropTypes from 'prop-types';
21
- import React from 'react';
22
21
 
23
22
  import {
24
23
  type CommonProps,
@@ -18,7 +18,7 @@
18
18
  /* @flow strict */
19
19
 
20
20
  import PropTypes from 'prop-types';
21
- import React, { type Node } from 'react';
21
+ import type { Node } from 'react';
22
22
 
23
23
  import {
24
24
  type CommonProps,
@@ -22,7 +22,7 @@
22
22
  */
23
23
 
24
24
  import PropTypes from 'prop-types';
25
- import React, { type Node, type StatelessFunctionalComponent } from 'react';
25
+ import type { Node, StatelessFunctionalComponent } from 'react';
26
26
  import { durationSm } from '@skyscanner/bpk-foundations-web/tokens/base.es6';
27
27
 
28
28
  import { withButtonAlignment } from '../../bpk-component-icon';
@@ -65,7 +65,6 @@ const getIconForType = (
65
65
  [ALERT_TYPES.WARN]: getClassName('bpk-banner-alert__warn-icon'),
66
66
  [ALERT_TYPES.ERROR]: getClassName('bpk-banner-alert__error-icon'),
67
67
  [ALERT_TYPES.NEUTRAL]: getClassName('bpk-banner-alert__neutral-icon'),
68
- [ALERT_TYPES.EVENT]: getClassName('bpk-banner-alert__event-icon'),
69
68
  };
70
69
  const className = classMap[type];
71
70
  const componentMap: { [AlertTypeValue]: Node } = {
@@ -74,7 +73,6 @@ const getIconForType = (
74
73
  [ALERT_TYPES.WARN]: InfoCircleIcon,
75
74
  [ALERT_TYPES.ERROR]: InfoCircleIcon,
76
75
  [ALERT_TYPES.NEUTRAL]: InfoCircleIcon,
77
- [ALERT_TYPES.EVENT]: InfoCircleIcon,
78
76
  };
79
77
  const Icon = CustomIcon || componentMap[type];
80
78
  const AlignedIcon = withButtonAlignment(Icon);
@@ -25,7 +25,6 @@ export const ALERT_TYPES = {
25
25
  WARN: 'warn',
26
26
  ERROR: 'error',
27
27
  NEUTRAL: 'neutral',
28
- EVENT: 'event', // DEPRECATED
29
28
  };
30
29
 
31
30
  export type AlertTypeValue = $Values<typeof ALERT_TYPES>;
@@ -45,14 +44,7 @@ export type OnDismissHandler = ?() => void;
45
44
  export type OnHideHandler = ?() => void;
46
45
 
47
46
  export const COMMON_PROP_TYPES = {
48
- type: PropTypes.oneOf([
49
- ALERT_TYPES.PRIMARY,
50
- ALERT_TYPES.SUCCESS,
51
- ALERT_TYPES.WARN,
52
- ALERT_TYPES.ERROR,
53
- ALERT_TYPES.NEUTRAL,
54
- ALERT_TYPES.EVENT,
55
- ]).isRequired,
47
+ type: PropTypes.oneOf(Object.values(ALERT_TYPES)).isRequired,
56
48
  message: PropTypes.node.isRequired,
57
49
  animateOnEnter: PropTypes.bool,
58
50
  animateOnLeave: PropTypes.bool,
@@ -17,7 +17,8 @@
17
17
  */
18
18
  /* @flow strict */
19
19
 
20
- import React, { type Node, type ComponentType, Component } from 'react';
20
+ import { Component } from 'react';
21
+ import type { Node, ComponentType } from 'react';
21
22
  import PropTypes from 'prop-types';
22
23
 
23
24
  import { wrapDisplayName } from '../../bpk-react-utils';
@@ -9,7 +9,6 @@ Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a comp
9
9
  ## Usage
10
10
 
11
11
  ```js
12
- import React from 'react';
13
12
  import BpkBarchart from '@skyscanner/backpack-web/bpk-component-barchart';
14
13
 
15
14
  const priceData = [
@@ -20,7 +20,7 @@
20
20
 
21
21
  import PropTypes from 'prop-types';
22
22
  import debounce from 'lodash.debounce';
23
- import React, { Component } from 'react';
23
+ import { Component } from 'react';
24
24
  import { scaleLinear, scaleBand } from 'd3-scale';
25
25
  import {
26
26
  spacingXs,
@@ -18,7 +18,6 @@
18
18
 
19
19
  /* @flow strict */
20
20
 
21
- import React from 'react';
22
21
  import PropTypes from 'prop-types';
23
22
  import { borderRadiusXs } from '@skyscanner/bpk-foundations-web/tokens/base.es6';
24
23
 
@@ -18,7 +18,6 @@
18
18
 
19
19
  /* @flow strict */
20
20
 
21
- import React from 'react';
22
21
  import { scaleBand, scaleLinear } from 'd3-scale';
23
22
  import PropTypes from 'prop-types';
24
23
  import { borderRadiusXs } from '@skyscanner/bpk-foundations-web/tokens/base.es6';
@@ -18,8 +18,6 @@
18
18
 
19
19
  /* @flow strict */
20
20
 
21
- import React from 'react';
22
-
23
21
  const GRADIENT_ATTRIBUTES = {
24
22
  x1: 0,
25
23
  y1: 0,
@@ -18,7 +18,7 @@
18
18
 
19
19
  /* @flow strict */
20
20
 
21
- import React, { type Node } from 'react';
21
+ import type { Node } from 'react';
22
22
  import PropTypes from 'prop-types';
23
23
  import {
24
24
  spacingXs,
@@ -19,7 +19,6 @@
19
19
  /* @flow strict */
20
20
 
21
21
  import PropTypes from 'prop-types';
22
- import React from 'react';
23
22
 
24
23
  import { cssModules } from '../../bpk-react-utils';
25
24
 
@@ -18,7 +18,6 @@
18
18
 
19
19
  /* @flow strict */
20
20
 
21
- import React from 'react';
22
21
  import PropTypes from 'prop-types';
23
22
 
24
23
  import { cssModules } from '../../bpk-react-utils';
@@ -18,7 +18,7 @@
18
18
 
19
19
  /* @flow strict */
20
20
 
21
- import React, { type Node } from 'react';
21
+ import type { Node } from 'react';
22
22
  import PropTypes from 'prop-types';
23
23
 
24
24
  type Props = {
@@ -9,7 +9,6 @@ Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a comp
9
9
  ## Usage
10
10
 
11
11
  ```js
12
- import React from 'react';
13
12
  import BpkBlockquote from '@skyscanner/backpack-web/bpk-component-blockquote';
14
13
 
15
14
  export default () => (
@@ -17,7 +17,6 @@
17
17
  */
18
18
 
19
19
  import PropTypes from 'prop-types';
20
- import React from 'react';
21
20
 
22
21
  import { cssModules } from '../../bpk-react-utils';
23
22
 
@@ -8,7 +8,7 @@ Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a comp
8
8
 
9
9
  ## Usage
10
10
  ```js
11
- import React, { Component } from 'react';
11
+ import { Component } from 'react';
12
12
  import BpkBreadcrumb, { BpkBreadcrumbItem } from '@skyscanner/backpack-web/bpk-component-breadcrumb';
13
13
 
14
14
 
@@ -19,7 +19,8 @@
19
19
  /* @flow strict */
20
20
 
21
21
  import PropTypes from 'prop-types';
22
- import React, { type Node } from 'react';
22
+ import { Component, Fragment } from 'react';
23
+ import type { Node } from 'react';
23
24
 
24
25
  import { cssModules } from '../../bpk-react-utils';
25
26
 
@@ -60,7 +61,7 @@ const buildMetaData = (schemaMetaData: SchemaMetaDataItem[]): string => {
60
61
  });
61
62
  };
62
63
 
63
- class BpkBreadcrumb extends React.Component<Props> {
64
+ class BpkBreadcrumb extends Component<Props> {
64
65
  metaData: ?string;
65
66
 
66
67
  static defaultProps = {
@@ -77,7 +78,7 @@ class BpkBreadcrumb extends React.Component<Props> {
77
78
  const { children, label, schemaMetaData, ...rest } = this.props;
78
79
 
79
80
  return (
80
- <React.Fragment>
81
+ <Fragment>
81
82
  {this.metaData && (
82
83
  <script
83
84
  type="application/ld+json"
@@ -89,7 +90,7 @@ class BpkBreadcrumb extends React.Component<Props> {
89
90
  <nav aria-label={label} {...rest}>
90
91
  <ol className={getClassName('bpk-breadcrumb')}>{children}</ol>
91
92
  </nav>
92
- </React.Fragment>
93
+ </Fragment>
93
94
  );
94
95
  }
95
96
  }
@@ -19,7 +19,7 @@
19
19
  /* @flow strict */
20
20
 
21
21
  import PropTypes from 'prop-types';
22
- import React, { type Node } from 'react';
22
+ import type { Node } from 'react';
23
23
 
24
24
  import BpkLink from '../../bpk-component-link';
25
25
  import BpkText from '../../bpk-component-text';
@@ -9,7 +9,6 @@ Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a comp
9
9
  ## Usage
10
10
 
11
11
  ```js
12
- import React from 'react';
13
12
  import BpkBreakpoint, { BREAKPOINTS } from '@skyscanner/backpack-web/bpk-component-breakpoint';
14
13
 
15
14
  export default () => (
@@ -19,7 +19,7 @@
19
19
  /* @flow strict */
20
20
 
21
21
  import PropTypes from 'prop-types';
22
- import React, { type Node } from 'react';
22
+ import type { Node } from 'react';
23
23
  import MediaQuery from 'react-responsive';
24
24
  import TOKENS from '@skyscanner/bpk-foundations-web/tokens/breakpoints.common';
25
25
 
@@ -9,7 +9,6 @@ Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a comp
9
9
  ## Usage
10
10
 
11
11
  ```js
12
- import React from 'react';
13
12
  import { withButtonAlignment, withRtlSupport } from '@skyscanner/backpack-web/bpk-component-icon';
14
13
  import ArrowIcon from '@skyscanner/backpack-web/bpk-component-icon/sm/long-arrow-right';
15
14
  import BpkButton from '@skyscanner/backpack-web/bpk-component-button';
@@ -24,7 +23,6 @@ export default () => (
24
23
  <BpkButton secondaryOnDark>SecondaryOnDark</BpkButton>
25
24
  <BpkButton link>Link</BpkButton>
26
25
  <BpkButton linkOnDark>LinkOnDark</BpkButton>
27
- <BpkButton outline>Outline (Deprecated, use PrimaryOnDark or PrimaryOnLight instead)</BpkButton>
28
26
  <BpkButton primaryOnDark>PrimaryOnDark</BpkButton>
29
27
  <BpkButton primaryOnLight>PrimaryOnLight</BpkButton>
30
28
  <BpkButton iconOnly>
@@ -44,7 +42,6 @@ export default () => (
44
42
  | featured | bool | false | false |
45
43
  | link | bool | false | false |
46
44
  | linkOnDark | bool | false | false |
47
- | outline | bool (deprecated) | false | false |
48
45
  | secondary | bool | false | false |
49
46
  | secondaryOnDark | bool | false | false |
50
47
  | primaryOnDark | bool | false | false |
@@ -28,7 +28,6 @@ import BpkButtonDestructive from './src/BpkButtonDestructive';
28
28
  import BpkButtonLink from './src/BpkButtonLink';
29
29
  import BpkButtonLinkOnDark from './src/BpkButtonLinkOnDark';
30
30
  import BpkButtonFeatured from './src/BpkButtonFeatured';
31
- import BpkButtonOutline from './src/BpkButtonOutline';
32
31
 
33
32
  export {
34
33
  buttonThemeAttributes,
@@ -53,5 +52,4 @@ export {
53
52
  BpkButtonLink,
54
53
  BpkButtonLinkOnDark,
55
54
  BpkButtonFeatured,
56
- BpkButtonOutline,
57
55
  };
@@ -18,7 +18,6 @@
18
18
 
19
19
  /* @flow strict */
20
20
 
21
- import React from 'react';
22
21
  import PropTypes from 'prop-types';
23
22
 
24
23
  // eslint-disable-next-line import/no-cycle
@@ -32,7 +31,6 @@ import {
32
31
  BpkButtonLink,
33
32
  BpkButtonLinkOnDark,
34
33
  BpkButtonFeatured,
35
- BpkButtonOutline,
36
34
  } from '../index';
37
35
 
38
36
  import {
@@ -49,7 +47,6 @@ type Props = {
49
47
  secondaryOnDark: boolean,
50
48
  destructive: boolean,
51
49
  featured: boolean,
52
- outline: boolean,
53
50
  link: boolean,
54
51
  linkOnDark: boolean,
55
52
  };
@@ -60,7 +57,6 @@ const BpkButton = (props: Props) => {
60
57
  featured,
61
58
  link,
62
59
  linkOnDark,
63
- outline,
64
60
  primaryOnDark,
65
61
  primaryOnLight,
66
62
  secondary,
@@ -88,9 +84,6 @@ const BpkButton = (props: Props) => {
88
84
  if (featured) {
89
85
  return <BpkButtonFeatured {...rest} />;
90
86
  }
91
- if (outline) {
92
- return <BpkButtonOutline {...rest} />;
93
- }
94
87
  if (link) {
95
88
  return <BpkButtonLink {...rest} />;
96
89
  }
@@ -108,7 +101,6 @@ BpkButton.propTypes = {
108
101
  secondaryOnDark: PropTypes.bool,
109
102
  destructive: PropTypes.bool,
110
103
  featured: PropTypes.bool,
111
- outline: PropTypes.bool,
112
104
  link: PropTypes.bool,
113
105
  linkOnDark: PropTypes.bool,
114
106
  };
@@ -121,7 +113,6 @@ BpkButton.defaultProps = {
121
113
  secondaryOnDark: false,
122
114
  destructive: false,
123
115
  featured: false,
124
- outline: false,
125
116
  link: false,
126
117
  linkOnDark: false,
127
118
  };
@@ -18,9 +18,7 @@
18
18
 
19
19
  /* @flow strict */
20
20
 
21
- import React from 'react';
22
-
23
- import { type Props, propTypes, defaultProps } from './common-types';
21
+ import { Props, propTypes, defaultProps } from './common-types';
24
22
  import COMMON_STYLES from './BpkButtonBase.module.scss';
25
23
 
26
24
  // This was originally depended upon from the bpk-react-utils package, however
@@ -18,9 +18,7 @@
18
18
 
19
19
  /* @flow strict */
20
20
 
21
- import React from 'react';
22
-
23
- import { type Props, defaultProps, propTypes } from './common-types';
21
+ import { Props, defaultProps, propTypes } from './common-types';
24
22
  import BpkButtonBase, { cssModules } from './BpkButtonBase';
25
23
  import STYLES from './BpkButtonDestructive.module.scss';
26
24
 
@@ -18,9 +18,7 @@
18
18
 
19
19
  /* @flow strict */
20
20
 
21
- import React from 'react';
22
-
23
- import { type Props, defaultProps, propTypes } from './common-types';
21
+ import { Props, defaultProps, propTypes } from './common-types';
24
22
  import BpkButtonBase, { cssModules } from './BpkButtonBase';
25
23
  import STYLES from './BpkButtonFeatured.module.scss';
26
24