@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
|
@@ -17,12 +17,12 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import PropTypes from 'prop-types';
|
|
20
|
-
import
|
|
20
|
+
import { createRef, Component } from 'react';
|
|
21
21
|
|
|
22
22
|
import BpkInput, { withOpenEvents } from '../../bpk-component-input';
|
|
23
23
|
import BpkModal from '../../bpk-component-modal';
|
|
24
24
|
import BpkPopover from '../../bpk-component-popover';
|
|
25
|
-
import { cssModules
|
|
25
|
+
import { cssModules } from '../../bpk-react-utils';
|
|
26
26
|
import BpkBreakpoint, { BREAKPOINTS } from '../../bpk-component-breakpoint';
|
|
27
27
|
import {
|
|
28
28
|
composeCalendar,
|
|
@@ -58,7 +58,7 @@ class BpkDatepicker extends Component {
|
|
|
58
58
|
this.state = {
|
|
59
59
|
isOpen: props.isOpen,
|
|
60
60
|
};
|
|
61
|
-
this.inputRef =
|
|
61
|
+
this.inputRef = createRef();
|
|
62
62
|
}
|
|
63
63
|
|
|
64
64
|
componentDidUpdate(prevProps, prevState) {
|
|
@@ -319,10 +319,6 @@ BpkDatepicker.propTypes = {
|
|
|
319
319
|
// Optional
|
|
320
320
|
calendarComponent: PropTypes.elementType,
|
|
321
321
|
inputComponent: PropTypes.elementType,
|
|
322
|
-
date: deprecated(
|
|
323
|
-
PropTypes.instanceOf(Date),
|
|
324
|
-
'Use selectionConfiguration to set date',
|
|
325
|
-
),
|
|
326
322
|
dateModifiers: CustomPropTypes.DateModifiers,
|
|
327
323
|
fixedWidth: PropTypes.bool,
|
|
328
324
|
inputProps: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
|
@@ -334,11 +330,6 @@ BpkDatepicker.propTypes = {
|
|
|
334
330
|
onOpenChange: PropTypes.func,
|
|
335
331
|
onMonthChange: PropTypes.func,
|
|
336
332
|
selectionConfiguration: CustomPropTypes.SelectionConfiguration,
|
|
337
|
-
// eslint-disable-next-line react/require-default-props
|
|
338
|
-
showWeekendSeparator: deprecated(
|
|
339
|
-
PropTypes.bool,
|
|
340
|
-
'The showWeekendSeparator prop in Week is now deprecated as no longer part of the calendar, so is no longer required',
|
|
341
|
-
),
|
|
342
333
|
initiallyFocusedDate: PropTypes.instanceOf(Date),
|
|
343
334
|
renderTarget: PropTypes.func,
|
|
344
335
|
isOpen: PropTypes.bool,
|
|
@@ -351,7 +342,6 @@ BpkDatepicker.propTypes = {
|
|
|
351
342
|
BpkDatepicker.defaultProps = {
|
|
352
343
|
calendarComponent: DefaultCalendar,
|
|
353
344
|
inputComponent: null,
|
|
354
|
-
date: null,
|
|
355
345
|
dateModifiers: DefaultCalendar.defaultProps.dateModifiers,
|
|
356
346
|
inputProps: {},
|
|
357
347
|
fixedWidth: true,
|
|
@@ -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 { BpkDescriptionList, BpkDescriptionTerm, BpkDescriptionDetails } from '@skyscanner/backpack-web/bpk-component-description-list';
|
|
14
13
|
|
|
15
14
|
export default () => (
|
|
@@ -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 BpkDialog from '@skyscanner/backpack-web/bpk-component-dialog';
|
|
14
14
|
import BpkButton from '@skyscanner/backpack-web/bpk-component-button';
|
|
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 { Component } from 'react';
|
|
13
13
|
import BpkDrawer from '@skyscanner/backpack-web/bpk-component-drawer';
|
|
14
14
|
import BpkButton from '@skyscanner/backpack-web/bpk-component-button';
|
|
15
15
|
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
/* @flow strict */
|
|
20
20
|
|
|
21
21
|
import PropTypes from 'prop-types';
|
|
22
|
-
import
|
|
22
|
+
import { Component } from 'react';
|
|
23
23
|
|
|
24
24
|
import { Portal, cssModules } from '../../bpk-react-utils';
|
|
25
25
|
import { withScrim } from '../../bpk-scrim-utils';
|
|
@@ -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
|
import Transition from 'react-transition-group/Transition';
|
|
24
24
|
import { animations } from '@skyscanner/bpk-foundations-web/tokens/base.es6';
|
|
25
25
|
|
|
@@ -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 BpkFieldset from '@skyscanner/backpack-web/bpk-component-fieldset';
|
|
14
14
|
import BpkInput, { INPUT_TYPES } from '@skyscanner/backpack-web/bpk-component-input';
|
|
15
15
|
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
/* @flow strict */
|
|
19
19
|
|
|
20
20
|
import PropTypes from 'prop-types';
|
|
21
|
-
import
|
|
21
|
+
import type { Element } from 'react';
|
|
22
|
+
import { cloneElement } from 'react';
|
|
22
23
|
|
|
23
24
|
import BpkLabel from '../../bpk-component-label';
|
|
24
25
|
import BpkFormValidation from '../../bpk-component-form-validation';
|
|
@@ -13,7 +13,6 @@ Note that the default background color is white. You will need to apply a custom
|
|
|
13
13
|
### React components
|
|
14
14
|
|
|
15
15
|
```js
|
|
16
|
-
import React from 'react';
|
|
17
16
|
import { BpkContentBubble } from '@skyscanner/backpack-web/bpk-component-flare';
|
|
18
17
|
|
|
19
18
|
export default MyComponent = () => (
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg viewBox="0 0 14832 55"><path d="
|
|
1
|
+
<svg viewBox="0 0 14832 55"><path d="m7501.307 8.517-68.043 39.341c-10.632 6.185-23.795 6.185-34.528 0l-68.144-39.34c-8.91-5.173-18.988-8.215-29.316-8.518H0v55h14832V0H7530.671a63.604 63.604 0 0 0-29.364 8.517z"/></svg>
|
|
@@ -7,7 +7,6 @@ Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a comp
|
|
|
7
7
|
## Usage
|
|
8
8
|
|
|
9
9
|
```js
|
|
10
|
-
import React from 'react';
|
|
11
10
|
import BpkFloatingNotification from '@skyscanner/backpack-web/bpk-component-floating-notification';
|
|
12
11
|
import BpkIconHeart from '../../packages/bpk-component-icon/sm/heart';
|
|
13
12
|
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
/* @flow strict */
|
|
19
19
|
|
|
20
20
|
import PropTypes from 'prop-types';
|
|
21
|
-
import
|
|
21
|
+
import { useEffect, useState, ReactElement } from 'react';
|
|
22
22
|
import { CSSTransition } from 'react-transition-group';
|
|
23
23
|
|
|
24
24
|
import BpkAriaLive from '../../bpk-component-aria-live';
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import
|
|
19
|
+
import type { KeyboardEvent, MouseEvent } from 'react';
|
|
20
20
|
|
|
21
21
|
// @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
|
|
22
22
|
import { cssModules } from '../../bpk-react-utils';
|
|
@@ -34,7 +34,7 @@ const ACCESSIBILITY_KEYS = {
|
|
|
34
34
|
Space: 32 /* Space */,
|
|
35
35
|
};
|
|
36
36
|
|
|
37
|
-
const isAccessibilityClick = (event:
|
|
37
|
+
const isAccessibilityClick = (event: KeyboardEvent<HTMLElement>) =>
|
|
38
38
|
Object.keys(ACCESSIBILITY_KEYS).includes(event.key) ||
|
|
39
39
|
Object.values(ACCESSIBILITY_KEYS).includes(event.keyCode || event.which);
|
|
40
40
|
|
|
@@ -103,11 +103,11 @@ const BpkGraphicPromo = ({
|
|
|
103
103
|
textAlign,
|
|
104
104
|
}: Props) => {
|
|
105
105
|
// FIXME: Use useCallback() here when React is updated.
|
|
106
|
-
const onClickWrapper = (event:
|
|
106
|
+
const onClickWrapper = (event: MouseEvent<HTMLElement>) => {
|
|
107
107
|
event.stopPropagation();
|
|
108
108
|
onClick();
|
|
109
109
|
};
|
|
110
|
-
const onKeyWrapper = (event:
|
|
110
|
+
const onKeyWrapper = (event: KeyboardEvent<HTMLElement>) =>
|
|
111
111
|
isAccessibilityClick(event) && onClick();
|
|
112
112
|
|
|
113
113
|
const cardClasses = getClassName('bpk-card', 'bpk-graphic-promo', className);
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import PropTypes from 'prop-types';
|
|
20
|
-
import
|
|
20
|
+
import { Component } from 'react';
|
|
21
21
|
|
|
22
22
|
import { cssModules } from '../../bpk-react-utils';
|
|
23
23
|
import { BpkButtonLink } from '../../bpk-component-link';
|
|
@@ -28,7 +28,7 @@ const getClassName = cssModules(STYLES);
|
|
|
28
28
|
|
|
29
29
|
const GRID_CLASS_NAME = getClassName('bpk-vertical-grid--on');
|
|
30
30
|
|
|
31
|
-
class BpkGridToggle extends
|
|
31
|
+
class BpkGridToggle extends Component {
|
|
32
32
|
constructor(props) {
|
|
33
33
|
super(props);
|
|
34
34
|
|
|
@@ -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 BpkHorizontalNav, { BpkHorizontalNavItem } from '@skyscanner/backpack-web/bpk-component-horizontal-nav';
|
|
14
14
|
|
|
15
15
|
export default class App extends Component {
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
/* @flow strict */
|
|
19
19
|
|
|
20
20
|
import PropTypes from 'prop-types';
|
|
21
|
-
import
|
|
21
|
+
import { Component, Children, cloneElement } from 'react';
|
|
22
|
+
import type { Node } from 'react';
|
|
22
23
|
|
|
23
24
|
import { cssModules } from '../../bpk-react-utils';
|
|
24
25
|
import BpkMobileScrollContainer from '../../bpk-component-mobile-scroll-container';
|
|
@@ -159,7 +160,7 @@ class BpkHorizontalNav extends Component<Props> {
|
|
|
159
160
|
let children = rawChildren;
|
|
160
161
|
|
|
161
162
|
if (autoScrollToSelected || type === HORIZONTAL_NAV_TYPES.light) {
|
|
162
|
-
children =
|
|
163
|
+
children = Children.map(rawChildren, (child) => {
|
|
163
164
|
const childProps = {};
|
|
164
165
|
let childRef;
|
|
165
166
|
if (autoScrollToSelected) {
|
|
@@ -175,7 +176,7 @@ class BpkHorizontalNav extends Component<Props> {
|
|
|
175
176
|
}
|
|
176
177
|
|
|
177
178
|
return child ? (
|
|
178
|
-
<div ref={childRef}>{
|
|
179
|
+
<div ref={childRef}>{cloneElement(child, childProps)}</div>
|
|
179
180
|
) : null;
|
|
180
181
|
});
|
|
181
182
|
}
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
*/
|
|
18
18
|
/* @flow strict */
|
|
19
19
|
|
|
20
|
-
import
|
|
20
|
+
import { Component } from 'react';
|
|
21
|
+
import type { Node } from 'react';
|
|
21
22
|
import PropTypes from 'prop-types';
|
|
22
23
|
|
|
23
24
|
import { cssModules } from '../../bpk-react-utils';
|
|
@@ -9,7 +9,6 @@ Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a comp
|
|
|
9
9
|
## Basic usage
|
|
10
10
|
|
|
11
11
|
```js
|
|
12
|
-
import React from 'react';
|
|
13
12
|
import BpkSmallFlightIcon from '@skyscanner/backpack-web/bpk-component-icon/sm/flight';
|
|
14
13
|
import BpkLargeAccessibilityIcon from '@skyscanner/backpack-web/bpk-component-icon/lg/accessibility';
|
|
15
14
|
|
|
@@ -39,7 +38,6 @@ export default () => (
|
|
|
39
38
|
### Aligning to BpkButton components
|
|
40
39
|
|
|
41
40
|
```js
|
|
42
|
-
import React from 'react';
|
|
43
41
|
import BpkButton from '@skyscanner/backpack-web/bpk-component-button';
|
|
44
42
|
import BpkSmallFlightIcon from '@skyscanner/backpack-web/bpk-component-icon/sm/flight';
|
|
45
43
|
import BpkLargeAccessibilityIcon from '@skyscanner/backpack-web/bpk-component-icon/lg/accessibility';
|
|
@@ -63,7 +61,6 @@ export default () => (
|
|
|
63
61
|
### RTL support
|
|
64
62
|
|
|
65
63
|
```js
|
|
66
|
-
import React from 'react';
|
|
67
64
|
import BpkSmallFlightIcon from '@skyscanner/backpack-web/bpk-component-icon/sm/flight';
|
|
68
65
|
import { withRtlSupport } from '@skyscanner/backpack-web/bpk-component-icon';
|
|
69
66
|
|
|
@@ -36,11 +36,7 @@ function withLargeButtonAlignment(WrappedComponent) {
|
|
|
36
36
|
return withAlignment(WrappedComponent, buttonLargeLineHeight, iconSizeLg);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
// alias to maintain backwards compat, can be deprecated in due course
|
|
40
|
-
// alias to maintain backwards compat, can be deprecated in due course
|
|
41
39
|
export {
|
|
42
|
-
withButtonAlignment as alignToButton,
|
|
43
|
-
withLargeButtonAlignment as alignToLargeButton,
|
|
44
40
|
withButtonAlignment,
|
|
45
41
|
withLargeButtonAlignment,
|
|
46
42
|
withAlignment,
|
|
@@ -9,7 +9,6 @@ Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a comp
|
|
|
9
9
|
## Usage
|
|
10
10
|
|
|
11
11
|
```js
|
|
12
|
-
import React from 'react';
|
|
13
12
|
import BpkImage from '@skyscanner/backpack-web/bpk-component-image';
|
|
14
13
|
import { breakpointDesktop, breakpointTablet } from '@skyscanner/bpk-foundations-web/tokens/base.es6';
|
|
15
14
|
|
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
*/
|
|
18
18
|
/* @flow strict */
|
|
19
19
|
|
|
20
|
-
import
|
|
20
|
+
import { Component } from 'react';
|
|
21
|
+
import type { Node } from 'react';
|
|
21
22
|
import PropTypes from 'prop-types';
|
|
22
23
|
import CSSTransition from 'react-transition-group/CSSTransition';
|
|
23
24
|
import { animations } from '@skyscanner/bpk-foundations-web/tokens/base.es6';
|
|
24
25
|
|
|
25
|
-
import { cssModules
|
|
26
|
+
import { cssModules } from '../../bpk-react-utils';
|
|
26
27
|
import { BpkSpinner } from '../../bpk-component-spinner';
|
|
27
28
|
|
|
28
|
-
import { widthHeightAspectRatioPropType } from './customPropTypes';
|
|
29
29
|
import STYLES from './BpkBackgroundImage.module.scss';
|
|
30
30
|
|
|
31
31
|
const getClassName = cssModules(STYLES);
|
|
@@ -33,11 +33,9 @@ const getClassName = cssModules(STYLES);
|
|
|
33
33
|
export type BpkBackgroundImageProps = {
|
|
34
34
|
children: Node,
|
|
35
35
|
aspectRatio: ?number,
|
|
36
|
-
height: ?number,
|
|
37
36
|
inView: boolean,
|
|
38
37
|
loading: boolean,
|
|
39
38
|
src: string,
|
|
40
|
-
width: ?number,
|
|
41
39
|
className: ?string,
|
|
42
40
|
onLoad: ?() => mixed,
|
|
43
41
|
style: ?{},
|
|
@@ -54,15 +52,7 @@ class BpkBackgroundImage extends Component<BpkBackgroundImageProps> {
|
|
|
54
52
|
onBackgroundImageLoad: () => mixed;
|
|
55
53
|
|
|
56
54
|
static propTypes = {
|
|
57
|
-
aspectRatio:
|
|
58
|
-
height: deprecated(
|
|
59
|
-
widthHeightAspectRatioPropType,
|
|
60
|
-
'Use "aspectRatio" instead of "width" and "height".',
|
|
61
|
-
),
|
|
62
|
-
width: deprecated(
|
|
63
|
-
widthHeightAspectRatioPropType,
|
|
64
|
-
'Use "aspectRatio" instead of "width" and "height".',
|
|
65
|
-
),
|
|
55
|
+
aspectRatio: PropTypes.number.isRequired,
|
|
66
56
|
src: PropTypes.string.isRequired,
|
|
67
57
|
className: PropTypes.string,
|
|
68
58
|
inView: PropTypes.bool,
|
|
@@ -73,9 +63,6 @@ class BpkBackgroundImage extends Component<BpkBackgroundImageProps> {
|
|
|
73
63
|
};
|
|
74
64
|
|
|
75
65
|
static defaultProps = {
|
|
76
|
-
width: null,
|
|
77
|
-
height: null,
|
|
78
|
-
aspectRatio: null,
|
|
79
66
|
className: null,
|
|
80
67
|
inView: true,
|
|
81
68
|
loading: false,
|
|
@@ -112,9 +99,6 @@ class BpkBackgroundImage extends Component<BpkBackgroundImageProps> {
|
|
|
112
99
|
if (this.props.aspectRatio) {
|
|
113
100
|
return this.props.aspectRatio;
|
|
114
101
|
}
|
|
115
|
-
if (this.props.width && this.props.height) {
|
|
116
|
-
return this.props.width / this.props.height;
|
|
117
|
-
}
|
|
118
102
|
return 1;
|
|
119
103
|
};
|
|
120
104
|
|
|
@@ -17,15 +17,15 @@
|
|
|
17
17
|
*/
|
|
18
18
|
/* @flow strict */
|
|
19
19
|
|
|
20
|
-
import
|
|
20
|
+
import { Component } from 'react';
|
|
21
|
+
import type { Node } from 'react';
|
|
21
22
|
import PropTypes from 'prop-types';
|
|
22
23
|
import CSSTransition from 'react-transition-group/CSSTransition';
|
|
23
24
|
import { animations } from '@skyscanner/bpk-foundations-web/tokens/base.es6';
|
|
24
25
|
|
|
25
|
-
import { cssModules
|
|
26
|
+
import { cssModules } from '../../bpk-react-utils';
|
|
26
27
|
import { BpkSpinner } from '../../bpk-component-spinner';
|
|
27
28
|
|
|
28
|
-
import { widthHeightAspectRatioPropType } from './customPropTypes';
|
|
29
29
|
import STYLES from './BpkImage.module.scss';
|
|
30
30
|
import BORDER_RADIUS_STYLES from './BpkImageBorderRadiusStyles';
|
|
31
31
|
|
|
@@ -92,11 +92,9 @@ class Image extends Component<ImageProps> {
|
|
|
92
92
|
type BpkImageProps = {
|
|
93
93
|
altText: string,
|
|
94
94
|
aspectRatio: ?number,
|
|
95
|
-
height: ?number,
|
|
96
95
|
inView: boolean,
|
|
97
96
|
loading: boolean,
|
|
98
97
|
src: string,
|
|
99
|
-
width: ?number,
|
|
100
98
|
borderRadiusStyle: $Keys<typeof BORDER_RADIUS_STYLES>,
|
|
101
99
|
className: ?string,
|
|
102
100
|
onLoad: ?() => mixed,
|
|
@@ -112,7 +110,7 @@ class BpkImage extends Component<BpkImageProps> {
|
|
|
112
110
|
static propTypes = {
|
|
113
111
|
altText: PropTypes.string.isRequired,
|
|
114
112
|
src: PropTypes.string.isRequired,
|
|
115
|
-
aspectRatio:
|
|
113
|
+
aspectRatio: PropTypes.number.isRequired,
|
|
116
114
|
borderRadiusStyle: PropTypes.oneOf(Object.keys(BORDER_RADIUS_STYLES)),
|
|
117
115
|
className: PropTypes.string,
|
|
118
116
|
inView: PropTypes.bool,
|
|
@@ -120,27 +118,16 @@ class BpkImage extends Component<BpkImageProps> {
|
|
|
120
118
|
onLoad: PropTypes.func,
|
|
121
119
|
style: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
|
122
120
|
suppressHydrationWarning: PropTypes.bool,
|
|
123
|
-
height: deprecated(
|
|
124
|
-
widthHeightAspectRatioPropType,
|
|
125
|
-
'Use "aspectRatio" instead of "width" and "height".',
|
|
126
|
-
),
|
|
127
|
-
width: deprecated(
|
|
128
|
-
widthHeightAspectRatioPropType,
|
|
129
|
-
'Use "aspectRatio" instead of "width" and "height".',
|
|
130
|
-
),
|
|
131
121
|
};
|
|
132
122
|
|
|
133
123
|
static defaultProps = {
|
|
134
|
-
aspectRatio: null,
|
|
135
124
|
borderRadiusStyle: BORDER_RADIUS_STYLES.none,
|
|
136
125
|
className: null,
|
|
137
|
-
height: null,
|
|
138
126
|
inView: true,
|
|
139
127
|
loading: false,
|
|
140
128
|
onLoad: null,
|
|
141
129
|
style: {},
|
|
142
130
|
suppressHydrationWarning: false,
|
|
143
|
-
width: null,
|
|
144
131
|
};
|
|
145
132
|
|
|
146
133
|
onImageLoad = (): void => {
|
|
@@ -153,9 +140,6 @@ class BpkImage extends Component<BpkImageProps> {
|
|
|
153
140
|
if (this.props.aspectRatio) {
|
|
154
141
|
return this.props.aspectRatio;
|
|
155
142
|
}
|
|
156
|
-
if (this.props.width && this.props.height) {
|
|
157
|
-
return this.props.width / this.props.height;
|
|
158
|
-
}
|
|
159
143
|
return 1;
|
|
160
144
|
};
|
|
161
145
|
|
|
@@ -165,12 +149,10 @@ class BpkImage extends Component<BpkImageProps> {
|
|
|
165
149
|
aspectRatio,
|
|
166
150
|
borderRadiusStyle,
|
|
167
151
|
className,
|
|
168
|
-
height,
|
|
169
152
|
inView,
|
|
170
153
|
loading,
|
|
171
154
|
onLoad,
|
|
172
155
|
style,
|
|
173
|
-
width,
|
|
174
156
|
...rest
|
|
175
157
|
} = this.props;
|
|
176
158
|
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
*/
|
|
18
18
|
/* @flow strict */
|
|
19
19
|
|
|
20
|
-
import
|
|
20
|
+
import type { Node, ComponentType } from 'react';
|
|
21
|
+
import { Component } from 'react';
|
|
21
22
|
import PropTypes from 'prop-types';
|
|
22
23
|
import throttle from 'lodash/throttle';
|
|
23
24
|
|
|
@@ -33,10 +34,10 @@ type WithLazyLoadingState = {
|
|
|
33
34
|
};
|
|
34
35
|
|
|
35
36
|
export default function withLazyLoading(
|
|
36
|
-
|
|
37
|
+
WrappedComponent: ComponentType<any>,
|
|
37
38
|
documentRef: typeof window,
|
|
38
39
|
): ComponentType<any> {
|
|
39
|
-
class WithLazyLoading extends
|
|
40
|
+
class WithLazyLoading extends Component<
|
|
40
41
|
WithLazyLoadingProps,
|
|
41
42
|
WithLazyLoadingState,
|
|
42
43
|
> {
|
|
@@ -171,12 +172,15 @@ export default function withLazyLoading(
|
|
|
171
172
|
className={className}
|
|
172
173
|
>
|
|
173
174
|
{/* $FlowFixMe[cannot-spread-inexact] - inexact rest. See 'decisions/flowfixme.md'. */}
|
|
174
|
-
<
|
|
175
|
+
<WrappedComponent inView={this.state.inView} {...rest} />
|
|
175
176
|
</div>
|
|
176
177
|
);
|
|
177
178
|
}
|
|
178
179
|
}
|
|
179
|
-
WithLazyLoading.displayName = wrapDisplayName(
|
|
180
|
+
WithLazyLoading.displayName = wrapDisplayName(
|
|
181
|
+
WrappedComponent,
|
|
182
|
+
'withLazyLoading',
|
|
183
|
+
);
|
|
180
184
|
|
|
181
185
|
return WithLazyLoading;
|
|
182
186
|
}
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
*/
|
|
18
18
|
/* @flow */
|
|
19
19
|
|
|
20
|
-
import
|
|
20
|
+
import { Component } from 'react';
|
|
21
|
+
import type { AbstractComponent } from 'react';
|
|
21
22
|
|
|
22
23
|
import { wrapDisplayName } from '../../bpk-react-utils';
|
|
23
24
|
|
|
@@ -27,9 +28,9 @@ type InjectedProps = {|
|
|
|
27
28
|
|};
|
|
28
29
|
|
|
29
30
|
export default function withLoadingBehavior<Config>(
|
|
30
|
-
|
|
31
|
+
WrappedComponent: AbstractComponent<{| ...Config, ...InjectedProps |}>,
|
|
31
32
|
): AbstractComponent<Config> {
|
|
32
|
-
class WithLoadingBehavior<C: Config> extends
|
|
33
|
+
class WithLoadingBehavior<C: Config> extends Component<
|
|
33
34
|
C,
|
|
34
35
|
{| loading: boolean |},
|
|
35
36
|
> {
|
|
@@ -49,7 +50,7 @@ export default function withLoadingBehavior<Config>(
|
|
|
49
50
|
|
|
50
51
|
render() {
|
|
51
52
|
return (
|
|
52
|
-
<
|
|
53
|
+
<WrappedComponent
|
|
53
54
|
onLoad={this.onLoad}
|
|
54
55
|
loading={this.state.loading}
|
|
55
56
|
{...this.props}
|
|
@@ -58,7 +59,7 @@ export default function withLoadingBehavior<Config>(
|
|
|
58
59
|
}
|
|
59
60
|
}
|
|
60
61
|
WithLoadingBehavior.displayName = wrapDisplayName(
|
|
61
|
-
|
|
62
|
+
WrappedComponent,
|
|
62
63
|
'withLoadingBehavior',
|
|
63
64
|
);
|
|
64
65
|
|