@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.
- package/README.md +0 -1
- 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/BpkBannerAlert.module.scss +0 -8
- 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 -3
- package/bpk-component-banner-alert/src/common-types.js +1 -9
- 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 -3
- package/bpk-component-button/index.js +0 -2
- package/bpk-component-button/src/BpkButton.js +0 -9
- 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/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 +2 -2
- package/bpk-component-calendar/src/BpkCalendarContainer.js +4 -19
- package/bpk-component-calendar/src/BpkCalendarDate.js +1 -1
- package/bpk-component-calendar/src/BpkCalendarGrid.js +2 -19
- package/bpk-component-calendar/src/BpkCalendarGridHeader.js +2 -7
- 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 +2 -21
- package/bpk-component-calendar/src/composeCalendar.js +1 -12
- 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 +3 -13
- 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-flare/src/svgs/pointer.svg +1 -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-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/index.js +0 -4
- 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 +4 -20
- package/bpk-component-image/src/BpkImage.js +4 -22
- 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/index.js +2 -11
- 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 +3 -8
- package/bpk-component-link/src/BpkLink.js +2 -8
- 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 +1 -3
- package/bpk-component-overlay/index.js +1 -2
- package/bpk-component-overlay/src/BpkOverlay.js +2 -15
- 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 +2 -1
- 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 +3 -8
- 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/index.js +2 -5
- package/bpk-component-switch/src/BpkSwitch.js +3 -18
- package/bpk-component-switch/src/BpkSwitch.module.scss +6 -13
- package/bpk-component-table/README.md +0 -2
- package/bpk-component-table/src/BpkTable.js +4 -14
- package/bpk-component-table/src/BpkTable.module.scss +0 -8
- 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 +5 -10
- 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 +3 -2
- 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
- package/bpk-component-button/BpkButtonOutline.js +0 -21
- package/bpk-component-button/src/BpkButtonOutline.js +0 -48
- package/bpk-component-button/src/BpkButtonOutline.module.css +0 -18
- package/bpk-component-button/src/BpkButtonOutline.module.scss +0 -23
- package/bpk-component-grid/README.md +0 -90
- package/bpk-component-grid/index.js +0 -25
- package/bpk-component-grid/src/BpkGridColumn.js +0 -118
- package/bpk-component-grid/src/BpkGridColumn.module.css +0 -18
- package/bpk-component-grid/src/BpkGridColumn.module.scss +0 -73
- package/bpk-component-grid/src/BpkGridContainer.js +0 -62
- package/bpk-component-grid/src/BpkGridContainer.module.css +0 -18
- package/bpk-component-grid/src/BpkGridContainer.module.scss +0 -33
- package/bpk-component-grid/src/BpkGridRow.js +0 -57
- package/bpk-component-grid/src/BpkGridRow.module.css +0 -18
- package/bpk-component-grid/src/BpkGridRow.module.scss +0 -29
- 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 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
|
|
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
|
-
<
|
|
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
|
-
</
|
|
101
|
+
</Fragment>
|
|
102
102
|
))();
|
|
@@ -18,12 +18,8 @@
|
|
|
18
18
|
|
|
19
19
|
/* @flow strict */
|
|
20
20
|
|
|
21
|
-
import
|
|
22
|
-
|
|
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
|
|
|
@@ -23,28 +23,19 @@ import {
|
|
|
23
23
|
propTypes,
|
|
24
24
|
defaultProps,
|
|
25
25
|
CLEAR_BUTTON_MODES,
|
|
26
|
-
INPUT_TYPES
|
|
26
|
+
INPUT_TYPES,
|
|
27
27
|
type Props,
|
|
28
28
|
} from './src/common-types';
|
|
29
29
|
import themeAttributes from './src/themeAttributes';
|
|
30
30
|
|
|
31
31
|
export default BpkInput;
|
|
32
32
|
|
|
33
|
-
// TODO: Remove these in the next major
|
|
34
|
-
const DEPRECATED_INPUT_TYPES = {
|
|
35
|
-
TEXT: 'text',
|
|
36
|
-
EMAIL: 'email',
|
|
37
|
-
NUMBER: 'number',
|
|
38
|
-
PASSWORD: 'password',
|
|
39
|
-
TEL: 'tel',
|
|
40
|
-
};
|
|
41
|
-
|
|
42
33
|
export type BpkInputProps = Props;
|
|
43
|
-
export const INPUT_TYPES = { ...DEPRECATED_INPUT_TYPES, ...TYPES };
|
|
44
34
|
export {
|
|
45
35
|
propTypes,
|
|
46
36
|
defaultProps,
|
|
47
37
|
withOpenEvents,
|
|
38
|
+
INPUT_TYPES,
|
|
48
39
|
CLEAR_BUTTON_MODES,
|
|
49
40
|
themeAttributes,
|
|
50
41
|
};
|
|
@@ -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 { 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
|
|
48
|
+
class WithOpenEvents extends Component {
|
|
49
49
|
constructor(props) {
|
|
50
50
|
super(props);
|
|
51
51
|
|
|
@@ -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
|
|
|
@@ -32,15 +32,14 @@ type Props = {
|
|
|
32
32
|
children: Node,
|
|
33
33
|
className: ?string,
|
|
34
34
|
onClick: (event: SyntheticEvent<>) => mixed,
|
|
35
|
-
white: boolean,
|
|
36
35
|
alternate: boolean,
|
|
37
36
|
};
|
|
38
37
|
|
|
39
38
|
const BpkButtonLink = (props: Props) => {
|
|
40
|
-
const { alternate, children, className, onClick,
|
|
39
|
+
const { alternate, children, className, onClick, ...rest } = props;
|
|
41
40
|
const classNames = [getClassName('bpk-link')];
|
|
42
41
|
|
|
43
|
-
if (
|
|
42
|
+
if (alternate) {
|
|
44
43
|
classNames.push(getClassName('bpk-link--alternate'));
|
|
45
44
|
}
|
|
46
45
|
if (className) {
|
|
@@ -65,15 +64,11 @@ BpkButtonLink.propTypes = {
|
|
|
65
64
|
children: PropTypes.node.isRequired,
|
|
66
65
|
className: PropTypes.string,
|
|
67
66
|
alternate: PropTypes.bool,
|
|
68
|
-
// DEPRECATED
|
|
69
|
-
white: PropTypes.bool,
|
|
70
67
|
};
|
|
71
68
|
|
|
72
69
|
BpkButtonLink.defaultProps = {
|
|
73
70
|
className: null,
|
|
74
71
|
alternate: false,
|
|
75
|
-
// DEPRECATED
|
|
76
|
-
white: false,
|
|
77
72
|
};
|
|
78
73
|
|
|
79
74
|
export { themeAttributes };
|
|
@@ -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
|
|
|
@@ -38,7 +38,6 @@ type Props = {
|
|
|
38
38
|
blank: boolean,
|
|
39
39
|
rel: ?string,
|
|
40
40
|
alternate: boolean,
|
|
41
|
-
white: boolean,
|
|
42
41
|
};
|
|
43
42
|
|
|
44
43
|
const BpkLink = (props: Props) => {
|
|
@@ -50,7 +49,6 @@ const BpkLink = (props: Props) => {
|
|
|
50
49
|
href,
|
|
51
50
|
onClick,
|
|
52
51
|
rel: propRel,
|
|
53
|
-
white,
|
|
54
52
|
...rest
|
|
55
53
|
} = props;
|
|
56
54
|
|
|
@@ -59,7 +57,7 @@ const BpkLink = (props: Props) => {
|
|
|
59
57
|
const target = blank ? '_blank' : null;
|
|
60
58
|
const rel = blank ? propRel || 'noopener noreferrer' : propRel;
|
|
61
59
|
|
|
62
|
-
if (
|
|
60
|
+
if (alternate) {
|
|
63
61
|
classNames.push(getClassName('bpk-link--alternate'));
|
|
64
62
|
}
|
|
65
63
|
if (className) {
|
|
@@ -92,8 +90,6 @@ BpkLink.propTypes = {
|
|
|
92
90
|
blank: PropTypes.bool,
|
|
93
91
|
rel: PropTypes.string,
|
|
94
92
|
alternate: PropTypes.bool,
|
|
95
|
-
// DEPRECATED
|
|
96
|
-
white: PropTypes.bool,
|
|
97
93
|
};
|
|
98
94
|
|
|
99
95
|
BpkLink.defaultProps = {
|
|
@@ -102,8 +98,6 @@ BpkLink.defaultProps = {
|
|
|
102
98
|
blank: false,
|
|
103
99
|
rel: null,
|
|
104
100
|
alternate: false,
|
|
105
|
-
// DEPRECATED
|
|
106
|
-
white: false,
|
|
107
101
|
};
|
|
108
102
|
|
|
109
103
|
export default BpkLink;
|
|
@@ -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
|
|
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,8 @@
|
|
|
18
18
|
|
|
19
19
|
/* @flow strict */
|
|
20
20
|
|
|
21
|
-
import
|
|
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
|
|
|
@@ -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
|
|
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
|
|
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,7 @@
|
|
|
19
19
|
/* @flow strict */
|
|
20
20
|
|
|
21
21
|
import PropTypes from 'prop-types';
|
|
22
|
-
import
|
|
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
|
|
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
|
|
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
|
|
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
|
|
@@ -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,9 +9,8 @@ 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
|
-
import BpkOverlay, {
|
|
13
|
+
import BpkOverlay, { OVERLAY_TYPES } from '@skyscanner/backpack-web/bpk-component-overlay';
|
|
15
14
|
|
|
16
15
|
export default () => (
|
|
17
16
|
<div>
|
|
@@ -44,7 +43,6 @@ export default () => (
|
|
|
44
43
|
| Property | PropType | Required | Default Value |
|
|
45
44
|
| --------- | -------- | -------- | ------------- |
|
|
46
45
|
| children | Node | true | - |
|
|
47
|
-
| borderRadiusStyle (deprecated) | BORDER_RADIUS_STYLES | false | BORDER_RADIUS_STYLES.none |
|
|
48
46
|
| className | string | false | null |
|
|
49
47
|
| foregroundContent | Node | false | null |
|
|
50
48
|
| overlayType | oneOf(OVERLAY_TYPES) | false | OVERLAY_TYPES.solid |
|
|
@@ -20,10 +20,9 @@
|
|
|
20
20
|
import BpkOverlay, {
|
|
21
21
|
OVERLAY_TYPES,
|
|
22
22
|
OVERLAY_LEVELS,
|
|
23
|
-
BORDER_RADIUS_STYLES,
|
|
24
23
|
type Props as BpkOverlayProps,
|
|
25
24
|
} from './src/BpkOverlay';
|
|
26
25
|
|
|
27
26
|
export type { BpkOverlayProps };
|
|
28
27
|
export default BpkOverlay;
|
|
29
|
-
export { OVERLAY_TYPES, OVERLAY_LEVELS
|
|
28
|
+
export { OVERLAY_TYPES, OVERLAY_LEVELS };
|
|
@@ -18,9 +18,9 @@
|
|
|
18
18
|
/* @flow strict */
|
|
19
19
|
|
|
20
20
|
import PropTypes from 'prop-types';
|
|
21
|
-
import
|
|
21
|
+
import type { Node } from 'react';
|
|
22
22
|
|
|
23
|
-
import { cssModules
|
|
23
|
+
import { cssModules } from '../../bpk-react-utils';
|
|
24
24
|
|
|
25
25
|
import STYLES from './BpkOverlay.module.scss';
|
|
26
26
|
|
|
@@ -42,14 +42,7 @@ export const OVERLAY_LEVELS = {
|
|
|
42
42
|
off: 'off',
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
// DEPRECATED
|
|
46
|
-
export const BORDER_RADIUS_STYLES = {
|
|
47
|
-
none: 'none',
|
|
48
|
-
sm: 'sm',
|
|
49
|
-
};
|
|
50
|
-
|
|
51
45
|
export type Props = {
|
|
52
|
-
borderRadiusStyle: ?$Keys<typeof BORDER_RADIUS_STYLES>,
|
|
53
46
|
children: Node,
|
|
54
47
|
overlayType: ?$Keys<typeof OVERLAY_TYPES>,
|
|
55
48
|
overlayLevel: ?$Keys<typeof OVERLAY_LEVELS>,
|
|
@@ -59,7 +52,6 @@ export type Props = {
|
|
|
59
52
|
|
|
60
53
|
const BpkOverlay = (props: Props) => {
|
|
61
54
|
const {
|
|
62
|
-
borderRadiusStyle,
|
|
63
55
|
children,
|
|
64
56
|
className,
|
|
65
57
|
foregroundContent,
|
|
@@ -88,10 +80,6 @@ const BpkOverlay = (props: Props) => {
|
|
|
88
80
|
|
|
89
81
|
BpkOverlay.propTypes = {
|
|
90
82
|
children: PropTypes.node.isRequired,
|
|
91
|
-
borderRadiusStyle: deprecated(
|
|
92
|
-
PropTypes.oneOf(Object.keys(BORDER_RADIUS_STYLES)),
|
|
93
|
-
'This property is deprecated and radius will now be set based on the content. Please remove usage of this property.',
|
|
94
|
-
),
|
|
95
83
|
className: PropTypes.string,
|
|
96
84
|
foregroundContent: PropTypes.node,
|
|
97
85
|
overlayType: PropTypes.oneOf(Object.keys(OVERLAY_TYPES)),
|
|
@@ -99,7 +87,6 @@ BpkOverlay.propTypes = {
|
|
|
99
87
|
};
|
|
100
88
|
|
|
101
89
|
BpkOverlay.defaultProps = {
|
|
102
|
-
borderRadiusStyle: null,
|
|
103
90
|
className: null,
|
|
104
91
|
foregroundContent: null,
|
|
105
92
|
overlayType: OVERLAY_TYPES.solid,
|