@skyscanner/backpack-web 18.2.0 → 19.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 (243) hide show
  1. package/bpk-animate-height/README.md +1 -1
  2. package/bpk-animate-height/src/AnimateHeight.js +1 -1
  3. package/bpk-component-accordion/README.md +0 -3
  4. package/bpk-component-accordion/src/BpkAccordion.js +1 -1
  5. package/bpk-component-accordion/src/BpkAccordionItem.js +3 -2
  6. package/bpk-component-accordion/src/withAccordionItemState.js +2 -1
  7. package/bpk-component-accordion/src/withSingleItemAccordionState.js +2 -8
  8. package/bpk-component-aria-live/README.md +0 -1
  9. package/bpk-component-aria-live/src/BpkAriaLive.js +0 -1
  10. package/bpk-component-autosuggest/README.md +1 -1
  11. package/bpk-component-autosuggest/src/BpkAutosuggest.js +0 -1
  12. package/bpk-component-autosuggest/src/BpkAutosuggestSuggestion.js +1 -1
  13. package/bpk-component-badge/README.md +0 -1
  14. package/bpk-component-badge/src/BpkBadge.js +0 -1
  15. package/bpk-component-banner-alert/README.md +2 -3
  16. package/bpk-component-banner-alert/src/AnimateAndFade.js +2 -1
  17. package/bpk-component-banner-alert/src/BpkBannerAlert.js +1 -3
  18. package/bpk-component-banner-alert/src/BpkBannerAlertDismissable.js +0 -1
  19. package/bpk-component-banner-alert/src/BpkBannerAlertExpandable.js +1 -1
  20. package/bpk-component-banner-alert/src/BpkBannerAlertInner.js +1 -1
  21. package/bpk-component-banner-alert/src/withBannerAlertState.js +2 -1
  22. package/bpk-component-barchart/README.md +0 -1
  23. package/bpk-component-barchart/src/BpkBarchart.js +1 -1
  24. package/bpk-component-barchart/src/BpkBarchartBar.js +0 -1
  25. package/bpk-component-barchart/src/BpkBarchartBars.js +0 -1
  26. package/bpk-component-barchart/src/BpkBarchartDefs.js +0 -2
  27. package/bpk-component-barchart/src/BpkChartAxis.js +1 -1
  28. package/bpk-component-barchart/src/BpkChartDataTable.js +0 -1
  29. package/bpk-component-barchart/src/BpkChartGridLines.js +0 -1
  30. package/bpk-component-barchart/src/BpkChartMargin.js +1 -1
  31. package/bpk-component-blockquote/README.md +0 -1
  32. package/bpk-component-blockquote/src/BpkBlockquote.js +0 -1
  33. package/bpk-component-breadcrumb/README.md +1 -1
  34. package/bpk-component-breadcrumb/src/BpkBreadcrumb.js +5 -4
  35. package/bpk-component-breadcrumb/src/BpkBreadcrumbItem.js +1 -1
  36. package/bpk-component-breakpoint/README.md +0 -1
  37. package/bpk-component-breakpoint/src/BpkBreakpoint.js +1 -1
  38. package/bpk-component-button/README.md +0 -1
  39. package/bpk-component-button/src/BpkButton.js +0 -1
  40. package/bpk-component-button/src/BpkButtonBase.js +1 -3
  41. package/bpk-component-button/src/BpkButtonDestructive.js +1 -3
  42. package/bpk-component-button/src/BpkButtonFeatured.js +1 -3
  43. package/bpk-component-button/src/BpkButtonLink.js +1 -7
  44. package/bpk-component-button/src/BpkButtonLinkOnDark.js +1 -7
  45. package/bpk-component-button/src/BpkButtonOutline.js +1 -3
  46. package/bpk-component-button/src/BpkButtonPrimary.js +1 -3
  47. package/bpk-component-button/src/BpkButtonPrimaryOnDark.js +1 -3
  48. package/bpk-component-button/src/BpkButtonPrimaryOnLight.js +1 -3
  49. package/bpk-component-button/src/BpkButtonSecondary.js +1 -3
  50. package/bpk-component-button/src/BpkButtonSecondaryOnDark.js +1 -3
  51. package/bpk-component-button/src/commonButtonTests.js +0 -1
  52. package/bpk-component-calendar/README.md +1 -1
  53. package/bpk-component-calendar/src/BpkCalendarContainer.js +1 -1
  54. package/bpk-component-calendar/src/BpkCalendarDate.js +1 -1
  55. package/bpk-component-calendar/src/BpkCalendarGrid.js +1 -1
  56. package/bpk-component-calendar/src/BpkCalendarGridHeader.js +1 -1
  57. package/bpk-component-calendar/src/BpkCalendarGridTransition.js +1 -1
  58. package/bpk-component-calendar/src/BpkCalendarNav.js +0 -1
  59. package/bpk-component-calendar/src/Week.js +1 -1
  60. package/bpk-component-calendar/src/composeCalendar.js +0 -1
  61. package/bpk-component-card/README.md +0 -2
  62. package/bpk-component-card/src/BpkCard.js +1 -1
  63. package/bpk-component-card/src/BpkDividedCard.js +0 -1
  64. package/bpk-component-checkbox/README.md +0 -1
  65. package/bpk-component-checkbox/src/BpkCheckbox.js +1 -1
  66. package/bpk-component-chip/README.md +0 -1
  67. package/bpk-component-chip/src/BpkDismissibleChip.js +0 -2
  68. package/bpk-component-chip/src/BpkDropdownChip.js +0 -2
  69. package/bpk-component-chip/src/BpkSelectableChip.js +1 -1
  70. package/bpk-component-close-button/README.md +0 -1
  71. package/bpk-component-close-button/src/BpkCloseButton.js +1 -1
  72. package/bpk-component-code/README.md +0 -1
  73. package/bpk-component-code/src/BpkCode.js +1 -1
  74. package/bpk-component-code/src/BpkCodeBlock.js +1 -1
  75. package/bpk-component-content-cards/README.md +0 -1
  76. package/bpk-component-content-cards/src/BpkContentCard.js +0 -2
  77. package/bpk-component-content-cards/src/BpkContentCards.js +0 -2
  78. package/bpk-component-datatable/README.md +3 -4
  79. package/bpk-component-datatable/src/BpkDataTable.js +3 -2
  80. package/bpk-component-datatable/src/BpkDataTableColumn.js +0 -1
  81. package/bpk-component-datatable/src/BpkDataTableHeader.js +2 -2
  82. package/bpk-component-datepicker/README.md +2 -2
  83. package/bpk-component-datepicker/src/BpkDatepicker.js +2 -2
  84. package/bpk-component-description-list/README.md +0 -1
  85. package/bpk-component-description-list/src/ComponentFactory.js +0 -1
  86. package/bpk-component-dialog/README.md +1 -1
  87. package/bpk-component-dialog/src/BpkDialog.js +0 -2
  88. package/bpk-component-dialog/src/BpkDialogInner.js +0 -2
  89. package/bpk-component-drawer/README.md +1 -1
  90. package/bpk-component-drawer/src/BpkDrawer.js +1 -1
  91. package/bpk-component-drawer/src/BpkDrawerContent.js +1 -1
  92. package/bpk-component-fieldset/README.md +1 -1
  93. package/bpk-component-fieldset/src/BpkFieldset.js +2 -1
  94. package/bpk-component-flare/README.md +0 -1
  95. package/bpk-component-flare/src/BpkContentBubble.js +0 -1
  96. package/bpk-component-flare/src/BpkFlareBar.js +0 -1
  97. package/bpk-component-floating-notification/README.md +0 -1
  98. package/bpk-component-floating-notification/src/BpkFloatingNotification.js +1 -1
  99. package/bpk-component-form-validation/README.md +0 -1
  100. package/bpk-component-form-validation/src/BpkFormValidation.js +0 -1
  101. package/bpk-component-graphic-promotion/README.md +0 -1
  102. package/bpk-component-graphic-promotion/src/BpkGraphicPromo.js +4 -4
  103. package/bpk-component-grid/README.md +0 -1
  104. package/bpk-component-grid/src/BpkGridColumn.js +0 -1
  105. package/bpk-component-grid/src/BpkGridContainer.js +0 -1
  106. package/bpk-component-grid/src/BpkGridRow.js +0 -1
  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/src/classNameModifierHOCFactory.js +0 -1
  114. package/bpk-component-icon/src/withAlignment.js +0 -2
  115. package/bpk-component-icon/src/withDescription.js +1 -1
  116. package/bpk-component-image/README.md +0 -1
  117. package/bpk-component-image/src/BpkBackgroundImage.js +2 -1
  118. package/bpk-component-image/src/BpkImage.js +2 -1
  119. package/bpk-component-image/src/withLazyLoading.js +9 -5
  120. package/bpk-component-image/src/withLoadingBehavior.js +6 -5
  121. package/bpk-component-infinite-scroll/README.md +0 -2
  122. package/bpk-component-infinite-scroll/src/withInfiniteScroll-test.flow.js +3 -3
  123. package/bpk-component-infinite-scroll/src/withInfiniteScroll.js +2 -6
  124. package/bpk-component-input/README.md +0 -2
  125. package/bpk-component-input/src/BpkClearButton.js +0 -1
  126. package/bpk-component-input/src/BpkInput.js +1 -1
  127. package/bpk-component-input/src/withOpenEvents.js +2 -2
  128. package/bpk-component-label/README.md +0 -1
  129. package/bpk-component-label/src/BpkLabel.js +1 -1
  130. package/bpk-component-link/README.md +0 -1
  131. package/bpk-component-link/src/BpkButtonLink.js +1 -1
  132. package/bpk-component-link/src/BpkLink.js +1 -1
  133. package/bpk-component-list/README.md +0 -1
  134. package/bpk-component-list/src/BpkList.js +1 -1
  135. package/bpk-component-list/src/BpkListItem.js +1 -1
  136. package/bpk-component-loading-button/README.md +0 -1
  137. package/bpk-component-loading-button/src/BpkLoadingButton.js +1 -1
  138. package/bpk-component-map/README.md +0 -3
  139. package/bpk-component-map/src/BpkBasicMapMarker.js +1 -1
  140. package/bpk-component-map/src/BpkIconMarker.js +1 -1
  141. package/bpk-component-map/src/BpkIconMarkerBackground.js +0 -2
  142. package/bpk-component-map/src/BpkMap.js +2 -1
  143. package/bpk-component-map/src/BpkOverlayView.js +1 -1
  144. package/bpk-component-map/src/BpkPriceMarker.js +0 -1
  145. package/bpk-component-map/src/DefaultLoadingElement.js +0 -2
  146. package/bpk-component-map/src/withGoogleMapsScript.js +1 -1
  147. package/bpk-component-mobile-scroll-container/README.md +0 -1
  148. package/bpk-component-mobile-scroll-container/src/BpkMobileScrollContainer.js +2 -1
  149. package/bpk-component-modal/README.md +1 -1
  150. package/bpk-component-modal/src/BpkModal.js +0 -1
  151. package/bpk-component-modal/src/BpkModalInner.js +1 -1
  152. package/bpk-component-navigation-bar/README.md +0 -3
  153. package/bpk-component-navigation-bar/src/BpkNavigationBar.js +3 -2
  154. package/bpk-component-navigation-bar/src/BpkNavigationBarButtonLink.js +1 -1
  155. package/bpk-component-navigation-bar/src/BpkNavigationBarIconButton.js +1 -1
  156. package/bpk-component-nudger/README.md +2 -2
  157. package/bpk-component-nudger/src/BpkConfigurableNudger.js +0 -1
  158. package/bpk-component-nudger/src/BpkNudger.js +0 -1
  159. package/bpk-component-overlay/README.md +0 -1
  160. package/bpk-component-overlay/src/BpkOverlay.js +1 -1
  161. package/bpk-component-page-indicator/README.md +0 -1
  162. package/bpk-component-page-indicator/src/BpkPageIndicator.js +0 -1
  163. package/bpk-component-page-indicator/src/NavButton.js +0 -1
  164. package/bpk-component-pagination/README.md +0 -1
  165. package/bpk-component-pagination/src/BpkPagination.js +0 -1
  166. package/bpk-component-pagination/src/BpkPaginationBreak.js +0 -1
  167. package/bpk-component-pagination/src/BpkPaginationList.js +0 -1
  168. package/bpk-component-pagination/src/BpkPaginationNudger.js +0 -1
  169. package/bpk-component-pagination/src/BpkPaginationPage.js +0 -1
  170. package/bpk-component-panel/README.md +0 -1
  171. package/bpk-component-panel/src/BpkPanel.js +0 -1
  172. package/bpk-component-phone-input/README.md +1 -1
  173. package/bpk-component-phone-input/src/BpkPhoneInput.js +0 -1
  174. package/bpk-component-popover/README.md +1 -1
  175. package/bpk-component-popover/src/BpkPopover.js +1 -1
  176. package/bpk-component-popover/src/BpkPopoverPortal.js +4 -3
  177. package/bpk-component-price/README.md +4 -4
  178. package/bpk-component-price/src/BpkPrice.js +60 -25
  179. package/bpk-component-price/src/BpkPrice.module.scss +18 -5
  180. package/bpk-component-progress/README.md +1 -1
  181. package/bpk-component-progress/src/BpkProgress.js +1 -1
  182. package/bpk-component-radio/README.md +0 -1
  183. package/bpk-component-radio/src/BpkRadio.js +1 -1
  184. package/bpk-component-rating/README.md +0 -1
  185. package/bpk-component-rating/src/BpkRating.js +1 -1
  186. package/bpk-component-rtl-toggle/README.md +0 -1
  187. package/bpk-component-rtl-toggle/src/BpkRtlToggle.js +2 -2
  188. package/bpk-component-rtl-toggle/src/updateOnDirectionChange.js +1 -1
  189. package/bpk-component-scrollable-calendar/README.md +1 -1
  190. package/bpk-component-scrollable-calendar/src/BpkScrollableCalendarDate.js +1 -1
  191. package/bpk-component-scrollable-calendar/src/BpkScrollableCalendarGrid.js +0 -2
  192. package/bpk-component-scrollable-calendar/src/BpkScrollableCalendarGridList.js +2 -2
  193. package/bpk-component-section-list/README.md +0 -1
  194. package/bpk-component-section-list/src/BpkSectionList.js +1 -1
  195. package/bpk-component-section-list/src/BpkSectionListItem.js +1 -1
  196. package/bpk-component-section-list/src/BpkSectionListSection.js +3 -2
  197. package/bpk-component-select/README.md +0 -2
  198. package/bpk-component-select/src/BpkSelect.js +3 -2
  199. package/bpk-component-skip-link/README.md +0 -1
  200. package/bpk-component-skip-link/src/BpkSkipLink.js +0 -1
  201. package/bpk-component-slider/README.md +1 -1
  202. package/bpk-component-slider/src/BpkSlider.js +0 -1
  203. package/bpk-component-spinner/README.md +0 -1
  204. package/bpk-component-spinner/src/BpkExtraLargeSpinner.js +0 -1
  205. package/bpk-component-spinner/src/BpkLargeSpinner.js +0 -1
  206. package/bpk-component-spinner/src/BpkSpinner.js +0 -1
  207. package/bpk-component-split-input/README.md +0 -1
  208. package/bpk-component-split-input/src/BpkInputField.js +1 -1
  209. package/bpk-component-split-input/src/BpkSplitInput.js +1 -1
  210. package/bpk-component-star-rating/README.md +0 -1
  211. package/bpk-component-star-rating/src/BpkInteractiveStar.js +0 -1
  212. package/bpk-component-star-rating/src/BpkInteractiveStarRating.js +0 -1
  213. package/bpk-component-star-rating/src/BpkStar.js +0 -1
  214. package/bpk-component-star-rating/src/BpkStarRating.js +0 -1
  215. package/bpk-component-star-rating/src/withInteractiveStarRatingState.js +2 -1
  216. package/bpk-component-switch/README.md +0 -1
  217. package/bpk-component-switch/src/BpkSwitch.js +1 -1
  218. package/bpk-component-table/README.md +0 -1
  219. package/bpk-component-table/src/BpkTable.js +1 -1
  220. package/bpk-component-table/src/BpkTableBody.js +1 -1
  221. package/bpk-component-table/src/BpkTableCell.js +1 -1
  222. package/bpk-component-table/src/BpkTableHead.js +1 -1
  223. package/bpk-component-table/src/BpkTableHeadCell.js +1 -1
  224. package/bpk-component-table/src/BpkTableRow.js +1 -1
  225. package/bpk-component-text/README.md +0 -3
  226. package/bpk-component-text/src/BpkText.js +1 -1
  227. package/bpk-component-textarea/README.md +0 -1
  228. package/bpk-component-textarea/src/BpkTextarea.js +0 -1
  229. package/bpk-component-theme-toggle/README.md +0 -2
  230. package/bpk-component-theme-toggle/src/BpkThemeToggle.js +2 -2
  231. package/bpk-component-theme-toggle/src/updateOnThemeChange.js +1 -1
  232. package/bpk-component-ticket/README.md +0 -1
  233. package/bpk-component-ticket/src/BpkTicket.js +1 -1
  234. package/bpk-component-tooltip/README.md +1 -1
  235. package/bpk-component-tooltip/src/BpkTooltip.js +1 -1
  236. package/bpk-component-tooltip/src/BpkTooltipPortal.js +5 -4
  237. package/bpk-react-utils/README.md +1 -7
  238. package/bpk-react-utils/src/TransitionInitialMount.js +1 -1
  239. package/bpk-react-utils/src/withDefaultProps.js +1 -1
  240. package/bpk-scrim-utils/src/BpkScrim.js +0 -1
  241. package/bpk-scrim-utils/src/withScrim.js +1 -1
  242. package/bpk-theming/src/BpkThemeProvider.js +1 -1
  243. package/package.json +2 -2
@@ -18,7 +18,8 @@
18
18
  /* @flow strict */
19
19
 
20
20
  import PropTypes from 'prop-types';
21
- import React, { Component, type Node } from 'react';
21
+ import { Component, Children, cloneElement } from 'react';
22
+ import type { Node } from 'react';
22
23
 
23
24
  import { cssModules } from '../../bpk-react-utils';
24
25
  import BpkMobileScrollContainer from '../../bpk-component-mobile-scroll-container';
@@ -159,7 +160,7 @@ class BpkHorizontalNav extends Component<Props> {
159
160
  let children = rawChildren;
160
161
 
161
162
  if (autoScrollToSelected || type === HORIZONTAL_NAV_TYPES.light) {
162
- children = React.Children.map(rawChildren, (child) => {
163
+ children = Children.map(rawChildren, (child) => {
163
164
  const childProps = {};
164
165
  let childRef;
165
166
  if (autoScrollToSelected) {
@@ -175,7 +176,7 @@ class BpkHorizontalNav extends Component<Props> {
175
176
  }
176
177
 
177
178
  return child ? (
178
- <div ref={childRef}>{React.cloneElement(child, childProps)}</div>
179
+ <div ref={childRef}>{cloneElement(child, childProps)}</div>
179
180
  ) : null;
180
181
  });
181
182
  }
@@ -17,7 +17,8 @@
17
17
  */
18
18
  /* @flow strict */
19
19
 
20
- import React, { Component, type Node } from 'react';
20
+ import { Component } from 'react';
21
+ import type { Node } from 'react';
21
22
  import PropTypes from 'prop-types';
22
23
 
23
24
  import { cssModules } from '../../bpk-react-utils';
@@ -9,7 +9,6 @@ Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a comp
9
9
  ## Basic usage
10
10
 
11
11
  ```js
12
- import React from 'react';
13
12
  import BpkSmallFlightIcon from '@skyscanner/backpack-web/bpk-component-icon/sm/flight';
14
13
  import BpkLargeAccessibilityIcon from '@skyscanner/backpack-web/bpk-component-icon/lg/accessibility';
15
14
 
@@ -39,7 +38,6 @@ export default () => (
39
38
  ### Aligning to BpkButton components
40
39
 
41
40
  ```js
42
- import React from 'react';
43
41
  import BpkButton from '@skyscanner/backpack-web/bpk-component-button';
44
42
  import BpkSmallFlightIcon from '@skyscanner/backpack-web/bpk-component-icon/sm/flight';
45
43
  import BpkLargeAccessibilityIcon from '@skyscanner/backpack-web/bpk-component-icon/lg/accessibility';
@@ -63,7 +61,6 @@ export default () => (
63
61
  ### RTL support
64
62
 
65
63
  ```js
66
- import React from 'react';
67
64
  import BpkSmallFlightIcon from '@skyscanner/backpack-web/bpk-component-icon/sm/flight';
68
65
  import { withRtlSupport } from '@skyscanner/backpack-web/bpk-component-icon';
69
66
 
@@ -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 { wrapDisplayName } from '../../bpk-react-utils';
23
22
 
@@ -16,8 +16,6 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- import React from 'react';
20
-
21
19
  import { wrapDisplayName } from '../../bpk-react-utils';
22
20
 
23
21
  export default function withAlignment(Component, objectHeight, subjectHeight) {
@@ -17,7 +17,7 @@
17
17
  */
18
18
  /* @flow strict */
19
19
 
20
- import React, { type AbstractComponent } from 'react';
20
+ import type { AbstractComponent } from 'react';
21
21
 
22
22
  import { cssModules, wrapDisplayName } from '../../bpk-react-utils';
23
23
 
@@ -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 BpkImage from '@skyscanner/backpack-web/bpk-component-image';
14
13
  import { breakpointDesktop, breakpointTablet } from '@skyscanner/bpk-foundations-web/tokens/base.es6';
15
14
 
@@ -17,7 +17,8 @@
17
17
  */
18
18
  /* @flow strict */
19
19
 
20
- import React, { type Node, Component } from 'react';
20
+ import { Component } from 'react';
21
+ import type { Node } from 'react';
21
22
  import PropTypes from 'prop-types';
22
23
  import CSSTransition from 'react-transition-group/CSSTransition';
23
24
  import { animations } from '@skyscanner/bpk-foundations-web/tokens/base.es6';
@@ -17,7 +17,8 @@
17
17
  */
18
18
  /* @flow strict */
19
19
 
20
- import React, { type Node, Component } from 'react';
20
+ import { Component } from 'react';
21
+ import type { Node } from 'react';
21
22
  import PropTypes from 'prop-types';
22
23
  import CSSTransition from 'react-transition-group/CSSTransition';
23
24
  import { animations } from '@skyscanner/bpk-foundations-web/tokens/base.es6';
@@ -17,7 +17,8 @@
17
17
  */
18
18
  /* @flow strict */
19
19
 
20
- import React, { type Node, type ComponentType } from 'react';
20
+ import type { Node, ComponentType } from 'react';
21
+ import { Component } from 'react';
21
22
  import PropTypes from 'prop-types';
22
23
  import throttle from 'lodash/throttle';
23
24
 
@@ -33,10 +34,10 @@ type WithLazyLoadingState = {
33
34
  };
34
35
 
35
36
  export default function withLazyLoading(
36
- Component: ComponentType<any>,
37
+ WrappedComponent: ComponentType<any>,
37
38
  documentRef: typeof window,
38
39
  ): ComponentType<any> {
39
- class WithLazyLoading extends React.Component<
40
+ class WithLazyLoading extends Component<
40
41
  WithLazyLoadingProps,
41
42
  WithLazyLoadingState,
42
43
  > {
@@ -171,12 +172,15 @@ export default function withLazyLoading(
171
172
  className={className}
172
173
  >
173
174
  {/* $FlowFixMe[cannot-spread-inexact] - inexact rest. See 'decisions/flowfixme.md'. */}
174
- <Component inView={this.state.inView} {...rest} />
175
+ <WrappedComponent inView={this.state.inView} {...rest} />
175
176
  </div>
176
177
  );
177
178
  }
178
179
  }
179
- WithLazyLoading.displayName = wrapDisplayName(Component, 'withLazyLoading');
180
+ WithLazyLoading.displayName = wrapDisplayName(
181
+ WrappedComponent,
182
+ 'withLazyLoading',
183
+ );
180
184
 
181
185
  return WithLazyLoading;
182
186
  }
@@ -17,7 +17,8 @@
17
17
  */
18
18
  /* @flow */
19
19
 
20
- import React, { type AbstractComponent } from 'react';
20
+ import { Component } from 'react';
21
+ import type { AbstractComponent } from 'react';
21
22
 
22
23
  import { wrapDisplayName } from '../../bpk-react-utils';
23
24
 
@@ -27,9 +28,9 @@ type InjectedProps = {|
27
28
  |};
28
29
 
29
30
  export default function withLoadingBehavior<Config>(
30
- Component: AbstractComponent<{| ...Config, ...InjectedProps |}>,
31
+ WrappedComponent: AbstractComponent<{| ...Config, ...InjectedProps |}>,
31
32
  ): AbstractComponent<Config> {
32
- class WithLoadingBehavior<C: Config> extends React.Component<
33
+ class WithLoadingBehavior<C: Config> extends Component<
33
34
  C,
34
35
  {| loading: boolean |},
35
36
  > {
@@ -49,7 +50,7 @@ export default function withLoadingBehavior<Config>(
49
50
 
50
51
  render() {
51
52
  return (
52
- <Component
53
+ <WrappedComponent
53
54
  onLoad={this.onLoad}
54
55
  loading={this.state.loading}
55
56
  {...this.props}
@@ -58,7 +59,7 @@ export default function withLoadingBehavior<Config>(
58
59
  }
59
60
  }
60
61
  WithLoadingBehavior.displayName = wrapDisplayName(
61
- Component,
62
+ WrappedComponent,
62
63
  'withLoadingBehavior',
63
64
  );
64
65
 
@@ -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 PropTypes from 'prop-types';
14
13
  import BpkButton from '@skyscanner/backpack-web/bpk-component-button';
15
14
  import BpkSpinner, { SPINNER_TYPES } from '@skyscanner/backpack-web/bpk-component-spinner';
@@ -104,7 +103,6 @@ used by subclasses to tell the `InfiniteScroll` component it should refresh
104
103
  its data.
105
104
 
106
105
  ```js
107
- import React from 'react';
108
106
  import PropTypes from 'prop-types';
109
107
  import withInfiniteScroll, { DataSource } from '@skyscanner/backpack-web/bpk-component-infinite-scroll';
110
108
 
@@ -18,7 +18,7 @@
18
18
 
19
19
  /* @flow strict */
20
20
 
21
- import React, { Component } from 'react';
21
+ import { Component, Fragment } from 'react';
22
22
 
23
23
  import withInfiniteScroll from './withInfiniteScroll';
24
24
  import { ArrayDataSource } from './DataSource';
@@ -64,7 +64,7 @@ List.defaultProps = {
64
64
  const InfiniteList = withInfiniteScroll(List);
65
65
 
66
66
  (() => (
67
- <React.Fragment>
67
+ <Fragment>
68
68
  {/* $FlowExpectedError[prop-missing] */}
69
69
  <InfiniteList dataSource={new ArrayDataSource([])} />
70
70
 
@@ -98,5 +98,5 @@ const InfiniteList = withInfiniteScroll(List);
98
98
  )}
99
99
  seeMoreAfter={5}
100
100
  />
101
- </React.Fragment>
101
+ </Fragment>
102
102
  ))();
@@ -18,12 +18,8 @@
18
18
 
19
19
  /* @flow strict */
20
20
 
21
- import React, {
22
- Component,
23
- type Element,
24
- type Config,
25
- type AbstractComponent,
26
- } from 'react';
21
+ import { Component } from 'react';
22
+ import type { Element, Config, AbstractComponent } from 'react';
27
23
  import PropTypes from 'prop-types';
28
24
  import omit from 'lodash/omit';
29
25
  import extend from 'lodash/extend';
@@ -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 BpkInput, { INPUT_TYPES, CLEAR_BUTTON_MODES } from '@skyscanner/backpack-web/bpk-component-input';
14
13
 
15
14
  export default () => (
@@ -72,7 +71,6 @@ You can still attach custom handlers for these events as they will still be call
72
71
  | hasTouchSupport | bool | false | (feature detection) |
73
72
 
74
73
  ```js
75
- import React from 'react';
76
74
  import BpkInput, { withOpenEvents } from '@skyscanner/backpack-web/bpk-component-input';
77
75
  import BpkPopover from '@skyscanner/backpack-web/bpk-component-popover';
78
76
 
@@ -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 ClearIcon from '../../bpk-component-icon/sm/close-circle';
24
23
  import { withButtonAlignment } from '../../bpk-component-icon';
@@ -18,7 +18,7 @@
18
18
 
19
19
  /* @flow strict */
20
20
 
21
- import React, { Component } from 'react';
21
+ import { Component } from 'react';
22
22
 
23
23
  import { cssModules } from '../../bpk-react-utils';
24
24
 
@@ -16,7 +16,7 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- import React from 'react';
19
+ import { Component } from 'react';
20
20
  import PropTypes from 'prop-types';
21
21
 
22
22
  import { cssModules, wrapDisplayName } from '../../bpk-react-utils';
@@ -45,7 +45,7 @@ const withEventHandler = (fn, eventHandler) => (e) => {
45
45
  };
46
46
 
47
47
  const withOpenEvents = (InputComponent) => {
48
- class WithOpenEvents extends React.Component {
48
+ class WithOpenEvents extends Component {
49
49
  constructor(props) {
50
50
  super(props);
51
51
 
@@ -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 BpkLabel from '@skyscanner/backpack-web/bpk-component-label';
14
13
 
15
14
  export default () => (
@@ -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 { cssModules } from '../../bpk-react-utils';
24
24
 
@@ -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 BpkLink, { BpkButtonLink } from '@skyscanner/backpack-web/bpk-component-link';
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
 
24
24
  import { cssModules } from '../../bpk-react-utils';
25
25
 
@@ -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 { BpkList, BpkListItem } from '@skyscanner/backpack-web/bpk-component-list';
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
 
24
24
  import { cssModules } from '../../bpk-react-utils';
25
25
 
@@ -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 BpkLoadingButton from '@skyscanner/backpack-web/bpk-component-loading-button';
14
13
  import BaggageIcon from '@skyscanner/backpack-web/bpk-component-icon/sm/baggage';
15
14
  import { withButtonAlignment, withRtlSupport } from '@skyscanner/backpack-web/bpk-component-icon';
@@ -19,7 +19,7 @@
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
23
 
24
24
  import BpkButton from '../../bpk-component-button';
25
25
  import { BpkSpinner, BpkLargeSpinner } from '../../bpk-component-spinner';
@@ -11,7 +11,6 @@ Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a comp
11
11
  ## Usage
12
12
 
13
13
  ```js
14
- import React from 'react';
15
14
  import BpkText from '@skyscanner/backpack-web/bpk-component-text';
16
15
  import { withRtlSupport } from '@skyscanner/backpack-web/bpk-component-icon';
17
16
  import LandmarkIconSm from '@skyscanner/backpack-web/bpk-component-icon/sm/landmark';
@@ -61,7 +60,6 @@ export default () => (
61
60
  Price markers are used to display clickable prices on a map.
62
61
 
63
62
  ```js
64
- import React from 'react';
65
63
  import BpkMap, { BpkPriceMarker, PRICE_MARKER_STATUSES } from '@skyscanner/backpack-web/bpk-component-map';
66
64
 
67
65
  export default () => (
@@ -103,7 +101,6 @@ export default () => (
103
101
  If you intend to include multiple maps on one page, it's better to load the Google Maps JavaScript in this HOC, as it ensures that script will not be re-downloaded every time it's used.
104
102
 
105
103
  ```js
106
- import React from 'react';
107
104
  import BpkMap, { withGoogleMapsScript } from '@skyscanner/backpack-web/bpk-component-map';
108
105
 
109
106
  const BpkMapWithScript = withGoogleMapsScript(BpkMap);
@@ -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
  import BpkOverlayView from './BpkOverlayView';
@@ -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
  import { cssModules } from '../../bpk-react-utils';
@@ -18,8 +18,6 @@
18
18
 
19
19
  /* @flow strict */
20
20
 
21
- import React from 'react';
22
-
23
21
  import { cssModules } from '../../bpk-react-utils';
24
22
 
25
23
  import STYLES from './BpkIconMarkerBackground.module.scss';
@@ -18,7 +18,8 @@
18
18
 
19
19
  /* @flow strict */
20
20
 
21
- import React, { type Node, useCallback, useRef } from 'react';
21
+ import type { Node } from 'react';
22
+ import { useCallback, useRef } from 'react';
22
23
  import PropTypes from 'prop-types';
23
24
  import { GoogleMap } from '@react-google-maps/api';
24
25
 
@@ -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 { OverlayView } from '@react-google-maps/api';
24
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';
@@ -17,8 +17,6 @@
17
17
  */
18
18
  /* @flow strict */
19
19
 
20
- import React from 'react';
21
-
22
20
  import { BpkLargeSpinner, SPINNER_TYPES } from '../../bpk-component-spinner';
23
21
  import { cssModules } from '../../bpk-react-utils';
24
22
 
@@ -17,7 +17,7 @@
17
17
  */
18
18
  /* @flow strict */
19
19
 
20
- import React, { type ComponentType } from 'react';
20
+ import type { ComponentType } from 'react';
21
21
  import PropTypes from 'prop-types';
22
22
  import { useJsApiLoader } from '@react-google-maps/api';
23
23
 
@@ -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 { cssModules } from '@skyscanner/backpack-web/bpk-react-utils';
14
13
  import BpkMobileScrollContainer from '@skyscanner/backpack-web/bpk-component-mobile-scroll-container';
15
14
 
@@ -20,7 +20,8 @@
20
20
 
21
21
  import PropTypes from 'prop-types';
22
22
  import debounce from 'lodash.debounce';
23
- import React, { Component, type Node } from 'react';
23
+ import type { Node } from 'react';
24
+ import { Component } from 'react';
24
25
 
25
26
  import { cssModules, isRTL } from '../../bpk-react-utils';
26
27
 
@@ -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 BpkModal from '@skyscanner/backpack-web/bpk-component-modal';
14
14
  import BpkButton from '@skyscanner/backpack-web/bpk-component-button';
15
15
  import { BpkNavigationBarButtonLink } from '@skyscanner/backpack-web/bpk-component-navigation-bar';
@@ -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 { withScrim } from '../../bpk-scrim-utils';
25
24
  import { Portal, cssModules, isDeviceIphone } from '../../bpk-react-utils';
@@ -19,7 +19,7 @@
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
23
 
24
24
  import { BpkButtonLink } from '../../bpk-component-link';
25
25
  import BpkCloseButton from '../../bpk-component-close-button';
@@ -11,7 +11,6 @@ Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a comp
11
11
  ### BpkNavigationBar
12
12
 
13
13
  ```js
14
- import React from 'react';
15
14
  import ArrowIcon from '@skyscanner/backpack-web/bpk-component-icon/sm/long-arrow-left';
16
15
  import { withRtlSupport } from '@skyscanner/backpack-web/bpk-component-icon';
17
16
 
@@ -55,7 +54,6 @@ export default () => (
55
54
  ### BpkNavigationBarIconButton
56
55
 
57
56
  ```js
58
- import React from 'react';
59
57
  import ArrowIcon from '@skyscanner/backpack-web/bpk-component-icon/sm/long-arrow-left';
60
58
  import { BpkNavigationBarIconButton } from '@skyscanner/backpack-web/bpk-component-navigation-bar';
61
59
 
@@ -86,7 +84,6 @@ export default () => (
86
84
  ### BpkNavigationBarButtonLink
87
85
 
88
86
  ```js
89
- import React from 'react';
90
87
  import { BpkNavigationBarButtonLink } from '@skyscanner/backpack-web/bpk-component-navigation-bar';
91
88
 
92
89
  export default () => (
@@ -18,7 +18,8 @@
18
18
 
19
19
  /* @flow strict */
20
20
 
21
- import React, { type Node, type Element } from 'react';
21
+ import type { Node, Element } from 'react';
22
+ import { cloneElement } from 'react';
22
23
  import PropTypes from 'prop-types';
23
24
 
24
25
  import { cssModules } from '../../bpk-react-utils';
@@ -39,7 +40,7 @@ export type Props = {
39
40
 
40
41
  const cloneWithClass = (elem: Element<any>, newStyle: string) => {
41
42
  const className = getClassNames(elem.props.className, newStyle);
42
- return React.cloneElement(elem, { ...elem.props, className });
43
+ return cloneElement(elem, { ...elem.props, className });
43
44
  };
44
45
 
45
46
  const BpkNavigationBar = (props: Props) => {
@@ -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
  // TODO: close button is not really only a close button, we should rename and update the import here
@@ -18,7 +18,7 @@
18
18
 
19
19
  /* @flow strict */
20
20
 
21
- import React, { type ComponentType } from 'react';
21
+ import type { ComponentType } from 'react';
22
22
  import PropTypes from 'prop-types';
23
23
 
24
24
  // TODO: close button is not really only a close button, we should rename and update the import here