@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
@@ -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 BpkPageIndicator from '@skyscanner/backpack-web/bpk-component-page-indicator';
14
13
 
15
14
  export default () =>
@@ -17,7 +17,6 @@
17
17
  */
18
18
  /* @flow strict */
19
19
 
20
- import React from 'react';
21
20
  import PropTypes from 'prop-types';
22
21
 
23
22
  import { cssModules } from '../../bpk-react-utils';
@@ -17,7 +17,6 @@
17
17
  */
18
18
  /* @flow strict */
19
19
 
20
- import React from 'react';
21
20
  import PropTypes from 'prop-types';
22
21
 
23
22
  import { withButtonAlignment, withRtlSupport } from '../../bpk-component-icon';
@@ -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 BpkPagination from '@skyscanner/backpack-web/bpk-component-pagination';
14
13
 
15
14
  const Pagination = () => (
@@ -16,7 +16,6 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- import React from 'react';
20
19
  import PropTypes from 'prop-types';
21
20
 
22
21
  import { cssModules } from '../../bpk-react-utils';
@@ -16,7 +16,6 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- import React from 'react';
20
19
  import PropTypes from 'prop-types';
21
20
 
22
21
  const BpkPaginationBreak = (props) => {
@@ -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
 
@@ -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
  import BpkButton from '../../bpk-component-button';
@@ -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 BpkButton from '../../bpk-component-button';
23
22
  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
  ## Usage
10
10
 
11
11
  ```js
12
- import React from 'react';
13
12
  import BpkPanel from '@skyscanner/backpack-web/bpk-component-panel';
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
 
@@ -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 BpkPhoneInput from '@skyscanner/backpack-web/bpk-component-phone-input';
14
14
  import BpkImage from '@skyscanner/backpack-web/bpk-component-image';
15
15
 
@@ -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';
@@ -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, { createRef } from 'react';
12
+ import { createRef } from 'react';
13
13
  import BpkButton from '@skyscanner/backpack-web/bpk-component-button';
14
14
  import BpkPopover from '@skyscanner/backpack-web/bpk-component-popover';
15
15
  import BpkText from '@skyscanner/backpack-web/bpk-component-text';
@@ -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 BpkText, { TEXT_STYLES } from '../../bpk-component-text';
25
25
  import { BpkButtonLink } from '../../bpk-component-link';
@@ -20,7 +20,8 @@
20
20
 
21
21
  import { createPopper } from '@popperjs/core';
22
22
  import PropTypes from 'prop-types';
23
- import React, { Component, type Node } from 'react';
23
+ import type { Node } from 'react';
24
+ import { Component } from 'react';
24
25
  import focusStore from 'a11y-focus-store';
25
26
 
26
27
  import { Portal, cssModules } 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 BpkPrice, { SIZES, ALIGNS } from '@skyscanner/backpack-web/bpk-component-price';
14
13
 
15
14
  export default () => (
@@ -27,9 +26,10 @@ export default () => (
27
26
 
28
27
  | Property | PropType | Required | Default Value |
29
28
  | --------- | -------- | -------- | ------------- |
30
- | title | string | true | - |
29
+ | price | string | true | - |
31
30
  | size | oneOf(SIZES) | false | SIZES.small |
32
31
  | align | oneOf(ALIGNS) | false | ALIGNS.left |
33
- | subtitle | string | false | null |
34
- | description | string | false | null |
32
+ | leadingText | string | false | null |
33
+ | trailingText | string | false | null |
34
+ | previousPrice | string | false | null |
35
35
  | className | string | false | null |
@@ -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 { cssModules } from '../../bpk-react-utils';
24
23
  import BpkText, { TEXT_STYLES } from '../../bpk-component-text';
@@ -27,19 +26,28 @@ import STYLES from './BpkPrice.module.scss';
27
26
  import { SIZES, ALIGNS } from './common-types';
28
27
 
29
28
  type Props = {
30
- title: string,
29
+ price: string,
31
30
  size: $Values<typeof SIZES>,
32
31
  align: $Values<typeof ALIGNS>,
33
32
  className: ?string,
34
- subtitle: ?string,
35
- description: ?string,
33
+ leadingText: ?string,
34
+ trailingText: ?string,
35
+ previousPrice: ?string,
36
36
  };
37
37
 
38
38
  const getClassName = cssModules(STYLES);
39
39
 
40
40
  const BpkPrice = (props: Props) => {
41
- const { align, className, description, size, subtitle, title, ...rest } =
42
- props;
41
+ const {
42
+ align,
43
+ className,
44
+ leadingText,
45
+ previousPrice,
46
+ price,
47
+ size,
48
+ trailingText,
49
+ ...rest
50
+ } = props;
43
51
 
44
52
  const isSmall = size === SIZES.small;
45
53
  const isAlignRight = align === ALIGNS.right;
@@ -54,35 +62,60 @@ const BpkPrice = (props: Props) => {
54
62
  // $FlowFixMe[cannot-spread-inexact] - inexact rest. See 'decisions/flowfixme.md'.
55
63
  {...rest}
56
64
  >
57
- {subtitle && (
58
- <BpkText
59
- className={getClassName('bpk-price__subtitle')}
60
- textStyle={isSmall ? TEXT_STYLES.xs : TEXT_STYLES.sm}
61
- tagName="span"
62
- >
63
- {subtitle}
64
- </BpkText>
65
- )}
65
+ <div
66
+ className={getClassName(
67
+ previousPrice && 'bpk-price__leading',
68
+ isAlignRight && 'bpk-price__leading--right',
69
+ )}
70
+ >
71
+ {previousPrice && (
72
+ <BpkText
73
+ className={getClassName('bpk-price__previous-price')}
74
+ textStyle={isSmall ? TEXT_STYLES.xs : TEXT_STYLES.sm}
75
+ tagName="span"
76
+ >
77
+ {previousPrice}
78
+ </BpkText>
79
+ )}
80
+ {previousPrice && (
81
+ <BpkText
82
+ textStyle={isSmall ? TEXT_STYLES.xs : TEXT_STYLES.sm}
83
+ tagName="span"
84
+ className={getClassName('bpk-price__separator')}
85
+ >
86
+ &#67871;
87
+ </BpkText>
88
+ )}
89
+
90
+ {leadingText && (
91
+ <BpkText
92
+ textStyle={isSmall ? TEXT_STYLES.xs : TEXT_STYLES.sm}
93
+ tagName="span"
94
+ >
95
+ {leadingText}
96
+ </BpkText>
97
+ )}
98
+ </div>
66
99
  <div
67
100
  className={isAlignRight && getClassName('bpk-price__column-container')}
68
101
  >
69
102
  <BpkText
70
103
  textStyle={isSmall ? TEXT_STYLES.heading4 : TEXT_STYLES.xxl}
71
104
  className={getClassName(
72
- 'bpk-price__title',
105
+ 'bpk-price__price',
73
106
  !isAlignRight && 'bpk-price__spacing',
74
107
  )}
75
108
  tagName="span"
76
109
  >
77
- {title}
110
+ {price}
78
111
  </BpkText>
79
- {description && (
112
+ {trailingText && (
80
113
  <BpkText
81
114
  textStyle={isSmall ? TEXT_STYLES.xs : TEXT_STYLES.sm}
82
115
  tagName="span"
83
- className={getClassName('bpk-price__description')}
116
+ className={getClassName('bpk-price__trailing')}
84
117
  >
85
- {description}
118
+ {trailingText}
86
119
  </BpkText>
87
120
  )}
88
121
  </div>
@@ -91,20 +124,22 @@ const BpkPrice = (props: Props) => {
91
124
  };
92
125
 
93
126
  BpkPrice.propTypes = {
94
- title: PropTypes.string.isRequired,
127
+ price: PropTypes.string.isRequired,
95
128
  size: PropTypes.oneOf(Object.keys(SIZES)),
96
129
  align: PropTypes.oneOf(Object.keys(ALIGNS)),
97
130
  className: PropTypes.string,
98
- subtitle: PropTypes.string,
99
- description: PropTypes.string,
131
+ leadingText: PropTypes.string,
132
+ trailingText: PropTypes.string,
133
+ previousPrice: PropTypes.string,
100
134
  };
101
135
 
102
136
  BpkPrice.defaultProps = {
103
137
  size: SIZES.small,
104
138
  align: ALIGNS.left,
105
139
  className: null,
106
- subtitle: null,
107
- description: null,
140
+ leadingText: null,
141
+ trailingText: null,
142
+ previousPrice: null,
108
143
  };
109
144
 
110
145
  export default BpkPrice;
@@ -21,6 +21,7 @@
21
21
  .bpk-price {
22
22
  display: flex;
23
23
  flex-direction: column;
24
+ color: $bpk-text-secondary-day;
24
25
 
25
26
  &--right {
26
27
  text-align: right;
@@ -30,17 +31,30 @@
30
31
  }
31
32
  }
32
33
 
33
- &__subtitle {
34
- color: $bpk-text-secondary-day;
34
+ &__leading {
35
+ display: flex;
36
+ flex-direction: row;
37
+
38
+ &--right {
39
+ flex-direction: row-reverse;
40
+ }
41
+ }
42
+
43
+ &__previous-price {
35
44
  text-decoration-line: line-through;
36
45
  }
37
46
 
47
+ &__separator {
48
+ margin: 0 bpk-spacing-sm();
49
+ }
50
+
38
51
  &__column-container {
39
52
  display: flex;
40
53
  flex-direction: column;
41
54
  }
42
55
 
43
- &__title {
56
+ &__price {
57
+ color: $bpk-text-primary-day;
44
58
  word-break: break-all;
45
59
  }
46
60
 
@@ -54,8 +68,7 @@
54
68
  }
55
69
  }
56
70
 
57
- &__description {
58
- color: $bpk-text-secondary-day;
71
+ &__trailing {
59
72
  white-space: nowrap;
60
73
  }
61
74
  }
@@ -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 BpkProgress from '@skyscanner/backpack-web/bpk-component-progress';
14
14
 
15
15
  const Progress = () => (
@@ -19,7 +19,7 @@
19
19
  /* @flow strict */
20
20
 
21
21
  import PropTypes from 'prop-types';
22
- import React, { Component } from 'react';
22
+ import { Component } from 'react';
23
23
  import clamp from 'lodash.clamp';
24
24
 
25
25
  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
  ## Usage
10
10
 
11
11
  ```js
12
- import React from 'react';
13
12
  import BpkRadio from '@skyscanner/backpack-web/bpk-component-radio';
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
 
@@ -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 BpkRating, { RATING_SIZES, RATING_SCALES } from '@skyscanner/backpack-web/bpk-component-rating';
14
13
 
15
14
  export default () => (
@@ -17,7 +17,7 @@
17
17
  */
18
18
  /* @flow strict */
19
19
 
20
- import React, { type Node } from 'react';
20
+ import type { Node } from 'react';
21
21
  import PropTypes from 'prop-types';
22
22
  import clamp from 'lodash.clamp';
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 BpkRtlToggle from '@skyscanner/backpack-web/bpk-component-rtl-toggle';
14
13
 
15
14
  export default () => (
@@ -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 { BpkButtonLink } from '../../bpk-component-link';
@@ -32,7 +32,7 @@ const setDirection = (direction) => {
32
32
  htmlElement.dispatchEvent(new Event(DIRECTION_CHANGE_EVENT));
33
33
  };
34
34
 
35
- class BpkRtlToggle extends React.Component {
35
+ class BpkRtlToggle extends Component {
36
36
  constructor(props) {
37
37
  super(props);
38
38
 
@@ -16,7 +16,7 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- import React, { Component } from 'react';
19
+ import { Component } from 'react';
20
20
 
21
21
  import { wrapDisplayName } from '../../bpk-react-utils';
22
22
 
@@ -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 { DateUtils } from '@skyscanner/backpack-web/bpk-component-calendar';
14
14
  import BpkScrollableCalendar, { CALENDAR_SELECTION_TYPE } from '@skyscanner/backpack-web/bpk-component-scrollable-calendar';
15
15
  import format from 'date-fns/format';
@@ -17,7 +17,7 @@
17
17
  */
18
18
 
19
19
  import PropTypes from 'prop-types';
20
- import React, { PureComponent } from 'react';
20
+ import { PureComponent } from 'react';
21
21
 
22
22
  import {
23
23
  BpkCalendarDate,
@@ -16,8 +16,6 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- import React from 'react';
20
-
21
19
  import { cssModules } from '../../bpk-react-utils';
22
20
  import BpkText, { TEXT_STYLES } from '../../bpk-component-text';
23
21
  import {
@@ -17,11 +17,11 @@
17
17
  */
18
18
 
19
19
  import PropTypes from 'prop-types';
20
- import React from 'react';
20
+ import { Component } from 'react';
21
21
  import { startOfDay, startOfMonth } from 'date-fns';
22
22
  import { VariableSizeList as List } from 'react-window';
23
23
 
24
- import { cssModules, deprecated } from '../../bpk-react-utils';
24
+ import { cssModules } from '../../bpk-react-utils';
25
25
  import {
26
26
  DateUtils,
27
27
  BpkCalendarGridPropTypes,
@@ -42,7 +42,7 @@ const COLUMN_COUNT = 7;
42
42
  // Most calendar grids have 5 rows:
43
43
  const ESTIMATED_MONTH_ITEM_HEIGHT = BASE_MONTH_ITEM_HEIGHT + 5 * ROW_HEIGHT;
44
44
 
45
- class BpkScrollableCalendarGridList extends React.Component {
45
+ class BpkScrollableCalendarGridList extends Component {
46
46
  constructor(props) {
47
47
  super(props);
48
48
 
@@ -174,10 +174,6 @@ BpkScrollableCalendarGridList.propTypes = {
174
174
  className: PropTypes.string,
175
175
  minDate: PropTypes.instanceOf(Date).isRequired,
176
176
  maxDate: PropTypes.instanceOf(Date).isRequired,
177
- selectedDate: deprecated(
178
- PropTypes.instanceOf(Date),
179
- 'Use selectionConfiguration to set selectedDate',
180
- ),
181
177
  focusedDate: PropTypes.instanceOf(Date),
182
178
  ...BpkCalendarGridPropTypes,
183
179
  };
@@ -185,7 +181,6 @@ BpkScrollableCalendarGridList.propTypes = {
185
181
  BpkScrollableCalendarGridList.defaultProps = {
186
182
  className: null,
187
183
  focusedDate: null,
188
- selectedDate: null,
189
184
  };
190
185
 
191
186
  export default BpkScrollableCalendarGridList;
@@ -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 BpkSectionList, { BpkSectionListSection, BpkSectionListItem } from '@skyscanner/backpack-web/bpk-component-section-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
  type Props = {
25
25
  children: Node,
@@ -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
  import BpkLargeChevronRightIcon from '../../bpk-component-icon/lg/chevron-right';
@@ -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 type { Node } from 'react';
23
+ import { Children } from 'react';
23
24
 
24
25
  import { cssModules } from '../../bpk-react-utils';
25
26
  import BpkText, { TEXT_STYLES } from '../../bpk-component-text';
@@ -44,7 +45,7 @@ const BpkSectionListSection = (props: Props) => {
44
45
  </header>
45
46
  )}
46
47
  <ul className={getClassName('bpk-section-list-section')}>
47
- {React.Children.map(children, (child) => (
48
+ {Children.map(children, (child) => (
48
49
  <li>{child}</li>
49
50
  ))}
50
51
  </ul>
@@ -9,7 +9,6 @@ Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a comp
9
9
  ## Usage (controlled)
10
10
 
11
11
  ```js
12
- import React from 'react';
13
12
  import BpkSelect from '@skyscanner/backpack-web/bpk-component-select';
14
13
 
15
14
  export default () => (
@@ -29,7 +28,6 @@ export default () => (
29
28
  ## Usage (uncontrolled)
30
29
 
31
30
  ```js
32
- import React from 'react';
33
31
  import BpkSelect from '@skyscanner/backpack-web/bpk-component-select';
34
32
 
35
33
  export default () => (
@@ -18,7 +18,8 @@
18
18
  /* @flow strict */
19
19
 
20
20
  import PropTypes from 'prop-types';
21
- import React, { type Element } from 'react';
21
+ import type { Element } from 'react';
22
+ import { cloneElement } from 'react';
22
23
 
23
24
  import { cssModules } from '../../bpk-react-utils';
24
25
 
@@ -85,7 +86,7 @@ const BpkSelect = (props: Props) => {
85
86
  if (image) {
86
87
  return (
87
88
  <div className={getClassName('bpk-select-wrapper', wrapperClassName)}>
88
- {React.cloneElement(image, {
89
+ {cloneElement(image, {
89
90
  'aria-hidden': true,
90
91
  className: getClassName(
91
92
  'bpk-select-wrapper__image',
@@ -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 BpkSkipLink from '@skyscanner/backpack-web/bpk-component-skip-link';
14
13
 
15
14
  export default () => <BpkSkipLink href="#main" label="Skip to main content" />;
@@ -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 { cssModules } from '../../bpk-react-utils';
24
23
 
@@ -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 BpkSlider from '@skyscanner/backpack-web/bpk-component-slider';
14
14
 
15
15
  const Slider = () => (