@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.
- package/bpk-animate-height/README.md +1 -1
- package/bpk-animate-height/src/AnimateHeight.js +1 -1
- package/bpk-component-accordion/README.md +0 -3
- package/bpk-component-accordion/src/BpkAccordion.js +1 -1
- package/bpk-component-accordion/src/BpkAccordionItem.js +3 -2
- package/bpk-component-accordion/src/withAccordionItemState.js +2 -1
- package/bpk-component-accordion/src/withSingleItemAccordionState.js +2 -8
- package/bpk-component-aria-live/README.md +0 -1
- package/bpk-component-aria-live/src/BpkAriaLive.js +0 -1
- package/bpk-component-autosuggest/README.md +1 -1
- package/bpk-component-autosuggest/src/BpkAutosuggest.js +0 -1
- package/bpk-component-autosuggest/src/BpkAutosuggestSuggestion.js +1 -1
- package/bpk-component-badge/README.md +0 -1
- package/bpk-component-badge/src/BpkBadge.js +0 -1
- package/bpk-component-banner-alert/README.md +2 -3
- package/bpk-component-banner-alert/src/AnimateAndFade.js +2 -1
- package/bpk-component-banner-alert/src/BpkBannerAlert.js +1 -3
- package/bpk-component-banner-alert/src/BpkBannerAlertDismissable.js +0 -1
- package/bpk-component-banner-alert/src/BpkBannerAlertExpandable.js +1 -1
- package/bpk-component-banner-alert/src/BpkBannerAlertInner.js +1 -1
- package/bpk-component-banner-alert/src/withBannerAlertState.js +2 -1
- package/bpk-component-barchart/README.md +0 -1
- package/bpk-component-barchart/src/BpkBarchart.js +1 -1
- package/bpk-component-barchart/src/BpkBarchartBar.js +0 -1
- package/bpk-component-barchart/src/BpkBarchartBars.js +0 -1
- package/bpk-component-barchart/src/BpkBarchartDefs.js +0 -2
- package/bpk-component-barchart/src/BpkChartAxis.js +1 -1
- package/bpk-component-barchart/src/BpkChartDataTable.js +0 -1
- package/bpk-component-barchart/src/BpkChartGridLines.js +0 -1
- package/bpk-component-barchart/src/BpkChartMargin.js +1 -1
- package/bpk-component-blockquote/README.md +0 -1
- package/bpk-component-blockquote/src/BpkBlockquote.js +0 -1
- package/bpk-component-breadcrumb/README.md +1 -1
- package/bpk-component-breadcrumb/src/BpkBreadcrumb.js +5 -4
- package/bpk-component-breadcrumb/src/BpkBreadcrumbItem.js +1 -1
- package/bpk-component-breakpoint/README.md +0 -1
- package/bpk-component-breakpoint/src/BpkBreakpoint.js +1 -1
- package/bpk-component-button/README.md +0 -1
- package/bpk-component-button/src/BpkButton.js +0 -1
- package/bpk-component-button/src/BpkButtonBase.js +1 -3
- package/bpk-component-button/src/BpkButtonDestructive.js +1 -3
- package/bpk-component-button/src/BpkButtonFeatured.js +1 -3
- package/bpk-component-button/src/BpkButtonLink.js +1 -7
- package/bpk-component-button/src/BpkButtonLinkOnDark.js +1 -7
- package/bpk-component-button/src/BpkButtonOutline.js +1 -3
- package/bpk-component-button/src/BpkButtonPrimary.js +1 -3
- package/bpk-component-button/src/BpkButtonPrimaryOnDark.js +1 -3
- package/bpk-component-button/src/BpkButtonPrimaryOnLight.js +1 -3
- package/bpk-component-button/src/BpkButtonSecondary.js +1 -3
- package/bpk-component-button/src/BpkButtonSecondaryOnDark.js +1 -3
- package/bpk-component-button/src/commonButtonTests.js +0 -1
- package/bpk-component-calendar/README.md +1 -1
- package/bpk-component-calendar/src/BpkCalendarContainer.js +1 -1
- package/bpk-component-calendar/src/BpkCalendarDate.js +1 -1
- package/bpk-component-calendar/src/BpkCalendarGrid.js +1 -1
- package/bpk-component-calendar/src/BpkCalendarGridHeader.js +1 -1
- package/bpk-component-calendar/src/BpkCalendarGridTransition.js +1 -1
- package/bpk-component-calendar/src/BpkCalendarNav.js +0 -1
- package/bpk-component-calendar/src/Week.js +1 -1
- package/bpk-component-calendar/src/composeCalendar.js +0 -1
- package/bpk-component-card/README.md +0 -2
- package/bpk-component-card/src/BpkCard.js +1 -1
- package/bpk-component-card/src/BpkDividedCard.js +0 -1
- package/bpk-component-checkbox/README.md +0 -1
- package/bpk-component-checkbox/src/BpkCheckbox.js +1 -1
- package/bpk-component-chip/README.md +0 -1
- package/bpk-component-chip/src/BpkDismissibleChip.js +0 -2
- package/bpk-component-chip/src/BpkDropdownChip.js +0 -2
- package/bpk-component-chip/src/BpkSelectableChip.js +1 -1
- package/bpk-component-close-button/README.md +0 -1
- package/bpk-component-close-button/src/BpkCloseButton.js +1 -1
- package/bpk-component-code/README.md +0 -1
- package/bpk-component-code/src/BpkCode.js +1 -1
- package/bpk-component-code/src/BpkCodeBlock.js +1 -1
- package/bpk-component-content-cards/README.md +0 -1
- package/bpk-component-content-cards/src/BpkContentCard.js +0 -2
- package/bpk-component-content-cards/src/BpkContentCards.js +0 -2
- package/bpk-component-datatable/README.md +3 -4
- package/bpk-component-datatable/src/BpkDataTable.js +3 -2
- package/bpk-component-datatable/src/BpkDataTableColumn.js +0 -1
- package/bpk-component-datatable/src/BpkDataTableHeader.js +2 -2
- package/bpk-component-datepicker/README.md +2 -2
- package/bpk-component-datepicker/src/BpkDatepicker.js +2 -2
- package/bpk-component-description-list/README.md +0 -1
- package/bpk-component-description-list/src/ComponentFactory.js +0 -1
- package/bpk-component-dialog/README.md +1 -1
- package/bpk-component-dialog/src/BpkDialog.js +0 -2
- package/bpk-component-dialog/src/BpkDialogInner.js +0 -2
- package/bpk-component-drawer/README.md +1 -1
- package/bpk-component-drawer/src/BpkDrawer.js +1 -1
- package/bpk-component-drawer/src/BpkDrawerContent.js +1 -1
- package/bpk-component-fieldset/README.md +1 -1
- package/bpk-component-fieldset/src/BpkFieldset.js +2 -1
- package/bpk-component-flare/README.md +0 -1
- package/bpk-component-flare/src/BpkContentBubble.js +0 -1
- package/bpk-component-flare/src/BpkFlareBar.js +0 -1
- package/bpk-component-floating-notification/README.md +0 -1
- package/bpk-component-floating-notification/src/BpkFloatingNotification.js +1 -1
- package/bpk-component-form-validation/README.md +0 -1
- package/bpk-component-form-validation/src/BpkFormValidation.js +0 -1
- package/bpk-component-graphic-promotion/README.md +0 -1
- package/bpk-component-graphic-promotion/src/BpkGraphicPromo.js +4 -4
- package/bpk-component-grid/README.md +0 -1
- package/bpk-component-grid/src/BpkGridColumn.js +0 -1
- package/bpk-component-grid/src/BpkGridContainer.js +0 -1
- package/bpk-component-grid/src/BpkGridRow.js +0 -1
- package/bpk-component-grid-toggle/README.md +0 -1
- package/bpk-component-grid-toggle/src/BpkGridToggle.js +2 -2
- package/bpk-component-horizontal-nav/README.md +1 -1
- package/bpk-component-horizontal-nav/src/BpkHorizontalNav.js +4 -3
- package/bpk-component-horizontal-nav/src/BpkHorizontalNavItem.js +2 -1
- package/bpk-component-icon/README.md +0 -3
- package/bpk-component-icon/src/classNameModifierHOCFactory.js +0 -1
- package/bpk-component-icon/src/withAlignment.js +0 -2
- package/bpk-component-icon/src/withDescription.js +1 -1
- package/bpk-component-image/README.md +0 -1
- package/bpk-component-image/src/BpkBackgroundImage.js +2 -1
- package/bpk-component-image/src/BpkImage.js +2 -1
- package/bpk-component-image/src/withLazyLoading.js +9 -5
- package/bpk-component-image/src/withLoadingBehavior.js +6 -5
- package/bpk-component-infinite-scroll/README.md +0 -2
- package/bpk-component-infinite-scroll/src/withInfiniteScroll-test.flow.js +3 -3
- package/bpk-component-infinite-scroll/src/withInfiniteScroll.js +2 -6
- package/bpk-component-input/README.md +0 -2
- package/bpk-component-input/src/BpkClearButton.js +0 -1
- package/bpk-component-input/src/BpkInput.js +1 -1
- package/bpk-component-input/src/withOpenEvents.js +2 -2
- package/bpk-component-label/README.md +0 -1
- package/bpk-component-label/src/BpkLabel.js +1 -1
- package/bpk-component-link/README.md +0 -1
- package/bpk-component-link/src/BpkButtonLink.js +1 -1
- package/bpk-component-link/src/BpkLink.js +1 -1
- package/bpk-component-list/README.md +0 -1
- package/bpk-component-list/src/BpkList.js +1 -1
- package/bpk-component-list/src/BpkListItem.js +1 -1
- package/bpk-component-loading-button/README.md +0 -1
- package/bpk-component-loading-button/src/BpkLoadingButton.js +1 -1
- package/bpk-component-map/README.md +0 -3
- package/bpk-component-map/src/BpkBasicMapMarker.js +1 -1
- package/bpk-component-map/src/BpkIconMarker.js +1 -1
- package/bpk-component-map/src/BpkIconMarkerBackground.js +0 -2
- package/bpk-component-map/src/BpkMap.js +2 -1
- package/bpk-component-map/src/BpkOverlayView.js +1 -1
- package/bpk-component-map/src/BpkPriceMarker.js +0 -1
- package/bpk-component-map/src/DefaultLoadingElement.js +0 -2
- package/bpk-component-map/src/withGoogleMapsScript.js +1 -1
- package/bpk-component-mobile-scroll-container/README.md +0 -1
- package/bpk-component-mobile-scroll-container/src/BpkMobileScrollContainer.js +2 -1
- package/bpk-component-modal/README.md +1 -1
- package/bpk-component-modal/src/BpkModal.js +0 -1
- package/bpk-component-modal/src/BpkModalInner.js +1 -1
- package/bpk-component-navigation-bar/README.md +0 -3
- package/bpk-component-navigation-bar/src/BpkNavigationBar.js +3 -2
- package/bpk-component-navigation-bar/src/BpkNavigationBarButtonLink.js +1 -1
- package/bpk-component-navigation-bar/src/BpkNavigationBarIconButton.js +1 -1
- package/bpk-component-nudger/README.md +2 -2
- package/bpk-component-nudger/src/BpkConfigurableNudger.js +0 -1
- package/bpk-component-nudger/src/BpkNudger.js +0 -1
- package/bpk-component-overlay/README.md +0 -1
- package/bpk-component-overlay/src/BpkOverlay.js +1 -1
- package/bpk-component-page-indicator/README.md +0 -1
- package/bpk-component-page-indicator/src/BpkPageIndicator.js +0 -1
- package/bpk-component-page-indicator/src/NavButton.js +0 -1
- package/bpk-component-pagination/README.md +0 -1
- package/bpk-component-pagination/src/BpkPagination.js +0 -1
- package/bpk-component-pagination/src/BpkPaginationBreak.js +0 -1
- package/bpk-component-pagination/src/BpkPaginationList.js +0 -1
- package/bpk-component-pagination/src/BpkPaginationNudger.js +0 -1
- package/bpk-component-pagination/src/BpkPaginationPage.js +0 -1
- package/bpk-component-panel/README.md +0 -1
- package/bpk-component-panel/src/BpkPanel.js +0 -1
- package/bpk-component-phone-input/README.md +1 -1
- package/bpk-component-phone-input/src/BpkPhoneInput.js +0 -1
- package/bpk-component-popover/README.md +1 -1
- package/bpk-component-popover/src/BpkPopover.js +1 -1
- package/bpk-component-popover/src/BpkPopoverPortal.js +4 -3
- package/bpk-component-price/README.md +4 -4
- package/bpk-component-price/src/BpkPrice.js +60 -25
- package/bpk-component-price/src/BpkPrice.module.scss +18 -5
- package/bpk-component-progress/README.md +1 -1
- package/bpk-component-progress/src/BpkProgress.js +1 -1
- package/bpk-component-radio/README.md +0 -1
- package/bpk-component-radio/src/BpkRadio.js +1 -1
- package/bpk-component-rating/README.md +0 -1
- package/bpk-component-rating/src/BpkRating.js +1 -1
- package/bpk-component-rtl-toggle/README.md +0 -1
- package/bpk-component-rtl-toggle/src/BpkRtlToggle.js +2 -2
- package/bpk-component-rtl-toggle/src/updateOnDirectionChange.js +1 -1
- package/bpk-component-scrollable-calendar/README.md +1 -1
- package/bpk-component-scrollable-calendar/src/BpkScrollableCalendarDate.js +1 -1
- package/bpk-component-scrollable-calendar/src/BpkScrollableCalendarGrid.js +0 -2
- package/bpk-component-scrollable-calendar/src/BpkScrollableCalendarGridList.js +2 -2
- package/bpk-component-section-list/README.md +0 -1
- package/bpk-component-section-list/src/BpkSectionList.js +1 -1
- package/bpk-component-section-list/src/BpkSectionListItem.js +1 -1
- package/bpk-component-section-list/src/BpkSectionListSection.js +3 -2
- package/bpk-component-select/README.md +0 -2
- package/bpk-component-select/src/BpkSelect.js +3 -2
- package/bpk-component-skip-link/README.md +0 -1
- package/bpk-component-skip-link/src/BpkSkipLink.js +0 -1
- package/bpk-component-slider/README.md +1 -1
- package/bpk-component-slider/src/BpkSlider.js +0 -1
- package/bpk-component-spinner/README.md +0 -1
- package/bpk-component-spinner/src/BpkExtraLargeSpinner.js +0 -1
- package/bpk-component-spinner/src/BpkLargeSpinner.js +0 -1
- package/bpk-component-spinner/src/BpkSpinner.js +0 -1
- package/bpk-component-split-input/README.md +0 -1
- package/bpk-component-split-input/src/BpkInputField.js +1 -1
- package/bpk-component-split-input/src/BpkSplitInput.js +1 -1
- package/bpk-component-star-rating/README.md +0 -1
- package/bpk-component-star-rating/src/BpkInteractiveStar.js +0 -1
- package/bpk-component-star-rating/src/BpkInteractiveStarRating.js +0 -1
- package/bpk-component-star-rating/src/BpkStar.js +0 -1
- package/bpk-component-star-rating/src/BpkStarRating.js +0 -1
- package/bpk-component-star-rating/src/withInteractiveStarRatingState.js +2 -1
- package/bpk-component-switch/README.md +0 -1
- package/bpk-component-switch/src/BpkSwitch.js +1 -1
- package/bpk-component-table/README.md +0 -1
- package/bpk-component-table/src/BpkTable.js +1 -1
- package/bpk-component-table/src/BpkTableBody.js +1 -1
- package/bpk-component-table/src/BpkTableCell.js +1 -1
- package/bpk-component-table/src/BpkTableHead.js +1 -1
- package/bpk-component-table/src/BpkTableHeadCell.js +1 -1
- package/bpk-component-table/src/BpkTableRow.js +1 -1
- package/bpk-component-text/README.md +0 -3
- package/bpk-component-text/src/BpkText.js +1 -1
- package/bpk-component-textarea/README.md +0 -1
- package/bpk-component-textarea/src/BpkTextarea.js +0 -1
- package/bpk-component-theme-toggle/README.md +0 -2
- package/bpk-component-theme-toggle/src/BpkThemeToggle.js +2 -2
- package/bpk-component-theme-toggle/src/updateOnThemeChange.js +1 -1
- package/bpk-component-ticket/README.md +0 -1
- package/bpk-component-ticket/src/BpkTicket.js +1 -1
- package/bpk-component-tooltip/README.md +1 -1
- package/bpk-component-tooltip/src/BpkTooltip.js +1 -1
- package/bpk-component-tooltip/src/BpkTooltipPortal.js +5 -4
- package/bpk-react-utils/README.md +1 -7
- package/bpk-react-utils/src/TransitionInitialMount.js +1 -1
- package/bpk-react-utils/src/withDefaultProps.js +1 -1
- package/bpk-scrim-utils/src/BpkScrim.js +0 -1
- package/bpk-scrim-utils/src/withScrim.js +1 -1
- package/bpk-theming/src/BpkThemeProvider.js +1 -1
- package/package.json +2 -2
|
@@ -11,7 +11,7 @@ Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a comp
|
|
|
11
11
|
### `BpkNudger`
|
|
12
12
|
|
|
13
13
|
```js
|
|
14
|
-
import
|
|
14
|
+
import { Component } from 'react';
|
|
15
15
|
import BpkLabel from '@skyscanner/backpack-web/bpk-component-label';
|
|
16
16
|
import BpkNudger from '@skyscanner/backpack-web/bpk-component-nudger';
|
|
17
17
|
|
|
@@ -50,7 +50,7 @@ class App extends Component {
|
|
|
50
50
|
### `BpkConfigurableNudger`
|
|
51
51
|
|
|
52
52
|
```js
|
|
53
|
-
import
|
|
53
|
+
import { Component } from 'react';
|
|
54
54
|
import BpkLabel from '@skyscanner/backpack-web/bpk-component-label';
|
|
55
55
|
import { BpkConfigurableNudger } from '@skyscanner/backpack-web/bpk-component-nudger';
|
|
56
56
|
|
|
@@ -20,7 +20,6 @@
|
|
|
20
20
|
/* @flow strict */
|
|
21
21
|
|
|
22
22
|
import PropTypes from 'prop-types';
|
|
23
|
-
import React from 'react';
|
|
24
23
|
|
|
25
24
|
import BpkButtonSecondary from '../../bpk-component-button/BpkButtonSecondary';
|
|
26
25
|
import BpkButtonSecondaryOnDark from '../../bpk-component-button/BpkButtonSecondaryOnDark';
|
|
@@ -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 BpkText from '@skyscanner/backpack-web/bpk-component-text';
|
|
14
13
|
import BpkOverlay, { BORDER_RADIUS_STYLES, OVERLAY_TYPES } from '@skyscanner/backpack-web/bpk-component-overlay';
|
|
15
14
|
|
|
@@ -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
|
|
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
|
|
|
@@ -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
|
|
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
|
|
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
|
|
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';
|
|
@@ -43,7 +44,7 @@ export type Props = {
|
|
|
43
44
|
portalStyle: ?Object,
|
|
44
45
|
portalClassName: ?string,
|
|
45
46
|
renderTarget: ?() => ?HTMLElement,
|
|
46
|
-
popperModifiers: ?Object
|
|
47
|
+
popperModifiers: ?Array<Object>,
|
|
47
48
|
};
|
|
48
49
|
|
|
49
50
|
export const propTypes = {
|
|
@@ -55,7 +56,7 @@ export const propTypes = {
|
|
|
55
56
|
portalStyle: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
|
56
57
|
portalClassName: PropTypes.string,
|
|
57
58
|
renderTarget: PropTypes.func,
|
|
58
|
-
popperModifiers: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
|
59
|
+
popperModifiers: PropTypes.arrayOf(PropTypes.object), // eslint-disable-line react/forbid-prop-types
|
|
59
60
|
};
|
|
60
61
|
|
|
61
62
|
export const defaultProps = {
|
|
@@ -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
|
-
|
|
|
29
|
+
| price | string | true | - |
|
|
31
30
|
| size | oneOf(SIZES) | false | SIZES.small |
|
|
32
31
|
| align | oneOf(ALIGNS) | false | ALIGNS.left |
|
|
33
|
-
|
|
|
34
|
-
|
|
|
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
|
-
|
|
29
|
+
price: string,
|
|
31
30
|
size: $Values<typeof SIZES>,
|
|
32
31
|
align: $Values<typeof ALIGNS>,
|
|
33
32
|
className: ?string,
|
|
34
|
-
|
|
35
|
-
|
|
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 {
|
|
42
|
-
|
|
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
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
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
|
+
𐤟
|
|
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-
|
|
105
|
+
'bpk-price__price',
|
|
73
106
|
!isAlignRight && 'bpk-price__spacing',
|
|
74
107
|
)}
|
|
75
108
|
tagName="span"
|
|
76
109
|
>
|
|
77
|
-
{
|
|
110
|
+
{price}
|
|
78
111
|
</BpkText>
|
|
79
|
-
{
|
|
112
|
+
{trailingText && (
|
|
80
113
|
<BpkText
|
|
81
114
|
textStyle={isSmall ? TEXT_STYLES.xs : TEXT_STYLES.sm}
|
|
82
115
|
tagName="span"
|
|
83
|
-
className={getClassName('bpk-
|
|
116
|
+
className={getClassName('bpk-price__trailing')}
|
|
84
117
|
>
|
|
85
|
-
{
|
|
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
|
-
|
|
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
|
-
|
|
99
|
-
|
|
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
|
-
|
|
107
|
-
|
|
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
|
-
&
|
|
34
|
-
|
|
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
|
-
&
|
|
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
|
-
&
|
|
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
|
|
12
|
+
import { Component } from 'react';
|
|
13
13
|
import BpkProgress from '@skyscanner/backpack-web/bpk-component-progress';
|
|
14
14
|
|
|
15
15
|
const Progress = () => (
|
|
@@ -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 () => (
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import
|
|
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
|
|
35
|
+
class BpkRtlToggle extends Component {
|
|
36
36
|
constructor(props) {
|
|
37
37
|
super(props);
|
|
38
38
|
|
|
@@ -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
|
|
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
|
|
20
|
+
import { Component } from 'react';
|
|
21
21
|
import { startOfDay, startOfMonth } from 'date-fns';
|
|
22
22
|
import { VariableSizeList as List } from 'react-window';
|
|
23
23
|
|
|
@@ -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
|
|
45
|
+
class BpkScrollableCalendarGridList extends Component {
|
|
46
46
|
constructor(props) {
|
|
47
47
|
super(props);
|
|
48
48
|
|
|
@@ -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
|
|
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
|
|
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
|
-
{
|
|
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 () => (
|