@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
|
@@ -18,13 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
/* @flow strict */
|
|
20
20
|
|
|
21
|
-
import
|
|
22
|
-
|
|
23
|
-
import {
|
|
24
|
-
type Props as CommonProps,
|
|
25
|
-
defaultProps,
|
|
26
|
-
propTypes,
|
|
27
|
-
} from './common-types';
|
|
21
|
+
import { Props as CommonProps, defaultProps, propTypes } from './common-types';
|
|
28
22
|
import BpkButtonBase, { cssModules } from './BpkButtonBase';
|
|
29
23
|
import STYLES from './BpkButtonLink.module.scss';
|
|
30
24
|
|
|
@@ -18,13 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
/* @flow strict */
|
|
20
20
|
|
|
21
|
-
import
|
|
22
|
-
|
|
23
|
-
import {
|
|
24
|
-
type Props as CommonProps,
|
|
25
|
-
defaultProps,
|
|
26
|
-
propTypes,
|
|
27
|
-
} from './common-types';
|
|
21
|
+
import { Props as CommonProps, defaultProps, propTypes } from './common-types';
|
|
28
22
|
import BpkButtonBase, { cssModules } from './BpkButtonBase';
|
|
29
23
|
import STYLES from './BpkButtonLinkOnDark.module.scss';
|
|
30
24
|
|
|
@@ -18,9 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
/* @flow strict */
|
|
20
20
|
|
|
21
|
-
import
|
|
22
|
-
|
|
23
|
-
import { type Props, defaultProps, propTypes } from './common-types';
|
|
21
|
+
import { Props, defaultProps, propTypes } from './common-types';
|
|
24
22
|
import BpkButtonBase from './BpkButtonBase';
|
|
25
23
|
|
|
26
24
|
// TODO: BpkButtonBase has the primary button style as it wasn't removed to
|
|
@@ -18,9 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
/* @flow strict */
|
|
20
20
|
|
|
21
|
-
import
|
|
22
|
-
|
|
23
|
-
import { type Props, defaultProps, propTypes } from './common-types';
|
|
21
|
+
import { Props, defaultProps, propTypes } from './common-types';
|
|
24
22
|
import BpkButtonBase, { cssModules } from './BpkButtonBase';
|
|
25
23
|
import STYLES from './BpkButtonPrimaryOnDark.module.scss';
|
|
26
24
|
|
|
@@ -18,9 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
/* @flow strict */
|
|
20
20
|
|
|
21
|
-
import
|
|
22
|
-
|
|
23
|
-
import { type Props, defaultProps, propTypes } from './common-types';
|
|
21
|
+
import { Props, defaultProps, propTypes } from './common-types';
|
|
24
22
|
import BpkButtonBase, { cssModules } from './BpkButtonBase';
|
|
25
23
|
import STYLES from './BpkButtonPrimaryOnLight.module.scss';
|
|
26
24
|
|
|
@@ -18,9 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
/* @flow strict */
|
|
20
20
|
|
|
21
|
-
import
|
|
22
|
-
|
|
23
|
-
import { type Props, defaultProps, propTypes } from './common-types';
|
|
21
|
+
import { Props, defaultProps, propTypes } from './common-types';
|
|
24
22
|
import BpkButtonBase, { cssModules } from './BpkButtonBase';
|
|
25
23
|
import STYLES from './BpkButtonSecondary.module.scss';
|
|
26
24
|
|
|
@@ -18,9 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
/* @flow strict */
|
|
20
20
|
|
|
21
|
-
import
|
|
22
|
-
|
|
23
|
-
import { type Props, defaultProps, propTypes } from './common-types';
|
|
21
|
+
import { Props, defaultProps, propTypes } from './common-types';
|
|
24
22
|
import BpkButtonBase, { cssModules } from './BpkButtonBase';
|
|
25
23
|
import STYLES from './BpkButtonSecondaryOnDark.module.scss';
|
|
26
24
|
|
|
@@ -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 BpkCalendar from '@skyscanner/backpack-web/bpk-component-calendar';
|
|
14
14
|
import BpkInput, { INPUT_TYPES } from '@skyscanner/backpack-web/bpk-component-input';
|
|
15
15
|
import format from 'date-fns/format';
|
|
@@ -373,7 +373,7 @@ const onMonthChange = (event, {
|
|
|
373
373
|
|
|
374
374
|
#### initiallyFocusedDate
|
|
375
375
|
|
|
376
|
-
Sets the date that is focused initially, this prop has no effect if `
|
|
376
|
+
Sets the date that is focused initially, this prop has no effect if `selectionConfiguration` is specified in which case the date specified in this prop is focused. If no selected date is set and `initiallyFocusedDate` is not set the focused date is the `minDate`(defaults to today if it has not been explicitly set).
|
|
377
377
|
|
|
378
378
|
#### navProps, headerProps, gridProps, dateProps
|
|
379
379
|
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import PropTypes from 'prop-types';
|
|
20
|
-
import
|
|
20
|
+
import { Component } from 'react';
|
|
21
21
|
|
|
22
|
-
import {
|
|
22
|
+
import { isRTL } from '../../bpk-react-utils';
|
|
23
23
|
|
|
24
24
|
import CustomPropTypes, { CALENDAR_SELECTION_TYPE } from './custom-proptypes';
|
|
25
25
|
import BpkCalendarNav from './BpkCalendarNav';
|
|
@@ -287,13 +287,8 @@ const withCalendarState = (Calendar) => {
|
|
|
287
287
|
};
|
|
288
288
|
|
|
289
289
|
render() {
|
|
290
|
-
const {
|
|
291
|
-
|
|
292
|
-
maxDate,
|
|
293
|
-
minDate,
|
|
294
|
-
selectionConfiguration,
|
|
295
|
-
...calendarProps
|
|
296
|
-
} = this.props;
|
|
290
|
+
const { maxDate, minDate, selectionConfiguration, ...calendarProps } =
|
|
291
|
+
this.props;
|
|
297
292
|
|
|
298
293
|
delete calendarProps.onDateSelect;
|
|
299
294
|
delete calendarProps.onMonthChange;
|
|
@@ -326,25 +321,16 @@ const withCalendarState = (Calendar) => {
|
|
|
326
321
|
}
|
|
327
322
|
|
|
328
323
|
BpkCalendarContainer.propTypes = {
|
|
329
|
-
date: deprecated(
|
|
330
|
-
PropTypes.instanceOf(Date),
|
|
331
|
-
'Use selectionConfiguration to set selectedDate',
|
|
332
|
-
),
|
|
333
324
|
fixedWidth: PropTypes.bool,
|
|
334
325
|
maxDate: PropTypes.instanceOf(Date),
|
|
335
326
|
minDate: PropTypes.instanceOf(Date),
|
|
336
327
|
onDateSelect: PropTypes.func,
|
|
337
328
|
onMonthChange: PropTypes.func,
|
|
338
329
|
selectionConfiguration: CustomPropTypes.SelectionConfiguration,
|
|
339
|
-
selectedDate: deprecated(
|
|
340
|
-
PropTypes.instanceOf(Date),
|
|
341
|
-
'Use selectionConfiguration to set selectedDate',
|
|
342
|
-
),
|
|
343
330
|
initiallyFocusedDate: PropTypes.instanceOf(Date),
|
|
344
331
|
};
|
|
345
332
|
|
|
346
333
|
BpkCalendarContainer.defaultProps = {
|
|
347
|
-
date: null,
|
|
348
334
|
fixedWidth: true,
|
|
349
335
|
maxDate: addMonths(new Date(), 12),
|
|
350
336
|
minDate: new Date(),
|
|
@@ -354,7 +340,6 @@ const withCalendarState = (Calendar) => {
|
|
|
354
340
|
type: CALENDAR_SELECTION_TYPE.single,
|
|
355
341
|
date: null,
|
|
356
342
|
},
|
|
357
|
-
selectedDate: null,
|
|
358
343
|
initiallyFocusedDate: null,
|
|
359
344
|
};
|
|
360
345
|
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import PropTypes from 'prop-types';
|
|
20
|
-
import
|
|
20
|
+
import { Component } from 'react';
|
|
21
21
|
|
|
22
|
-
import { cssModules,
|
|
22
|
+
import { cssModules, isDeviceIos } from '../../bpk-react-utils';
|
|
23
23
|
|
|
24
24
|
import BpkCalendarGridHeader from './BpkCalendarGridHeader';
|
|
25
25
|
import Week from './Week';
|
|
@@ -103,8 +103,6 @@ class BpkCalendarGrid extends Component {
|
|
|
103
103
|
onDateKeyDown,
|
|
104
104
|
preventKeyboardFocus,
|
|
105
105
|
selectionConfiguration,
|
|
106
|
-
selectionEnd,
|
|
107
|
-
selectionStart,
|
|
108
106
|
weekStartsOn,
|
|
109
107
|
} = this.props;
|
|
110
108
|
|
|
@@ -139,8 +137,6 @@ class BpkCalendarGrid extends Component {
|
|
|
139
137
|
markToday={markToday}
|
|
140
138
|
markOutsideDays={markOutsideDays}
|
|
141
139
|
selectionConfiguration={selectionConfiguration}
|
|
142
|
-
selectionEnd={selectionEnd}
|
|
143
|
-
selectionStart={selectionStart}
|
|
144
140
|
focusedDate={focusedDate}
|
|
145
141
|
minDate={minDate}
|
|
146
142
|
maxDate={maxDate}
|
|
@@ -177,16 +173,6 @@ export const propTypes = {
|
|
|
177
173
|
onDateKeyDown: PropTypes.func,
|
|
178
174
|
preventKeyboardFocus: PropTypes.bool,
|
|
179
175
|
selectionConfiguration: CustomPropTypes.SelectionConfiguration,
|
|
180
|
-
selectedDate: deprecated(
|
|
181
|
-
PropTypes.instanceOf(Date),
|
|
182
|
-
'Use selectionConfiguration to set selectedDate',
|
|
183
|
-
),
|
|
184
|
-
selectionEnd: PropTypes.instanceOf(Date),
|
|
185
|
-
selectionStart: PropTypes.instanceOf(Date),
|
|
186
|
-
showWeekendSeparator: deprecated(
|
|
187
|
-
PropTypes.bool,
|
|
188
|
-
'The showWeekendSeparator prop in BpkCalendarGrid is now deprecated as no longer part of the calendar, so is no longer required',
|
|
189
|
-
),
|
|
190
176
|
ignoreOutsideDate: PropTypes.bool,
|
|
191
177
|
dateProps: PropTypes.object,
|
|
192
178
|
};
|
|
@@ -205,10 +191,7 @@ BpkCalendarGrid.defaultProps = {
|
|
|
205
191
|
onDateClick: null,
|
|
206
192
|
onDateKeyDown: null,
|
|
207
193
|
preventKeyboardFocus: false,
|
|
208
|
-
selectedDate: null,
|
|
209
194
|
selectionConfiguration: { type: CALENDAR_SELECTION_TYPE.single, date: null },
|
|
210
|
-
selectionEnd: null,
|
|
211
|
-
selectionStart: null,
|
|
212
195
|
ignoreOutsideDate: false,
|
|
213
196
|
dateProps: null,
|
|
214
197
|
cellClassName: null,
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import PropTypes from 'prop-types';
|
|
20
|
-
import
|
|
20
|
+
import { PureComponent } from 'react';
|
|
21
21
|
|
|
22
|
-
import { cssModules
|
|
22
|
+
import { cssModules } from '../../bpk-react-utils';
|
|
23
23
|
|
|
24
24
|
import CustomPropTypes from './custom-proptypes';
|
|
25
25
|
import { orderDaysOfWeek } from './date-utils';
|
|
@@ -94,11 +94,6 @@ BpkCalendarGridHeader.propTypes = {
|
|
|
94
94
|
isTableHead: PropTypes.bool,
|
|
95
95
|
className: PropTypes.string,
|
|
96
96
|
weekDayKey: CustomPropTypes.WeekDayKey,
|
|
97
|
-
// eslint-disable-next-line react/require-default-props,react/no-unused-prop-types
|
|
98
|
-
showWeekendSeparator: deprecated(
|
|
99
|
-
PropTypes.bool,
|
|
100
|
-
'The showWeekendSeparator prop in BpkCalendarGridHeader is now deprecated as no longer part of the calendar, so is no longer required',
|
|
101
|
-
),
|
|
102
97
|
};
|
|
103
98
|
|
|
104
99
|
BpkCalendarGridHeader.defaultProps = {
|
|
@@ -17,9 +17,9 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import PropTypes from 'prop-types';
|
|
20
|
-
import
|
|
20
|
+
import { Component } from 'react';
|
|
21
21
|
|
|
22
|
-
import { cssModules
|
|
22
|
+
import { cssModules } from '../../bpk-react-utils';
|
|
23
23
|
|
|
24
24
|
import {
|
|
25
25
|
isSameDay,
|
|
@@ -379,10 +379,6 @@ Week.propTypes = {
|
|
|
379
379
|
isKeyboardFocusable: PropTypes.bool.isRequired,
|
|
380
380
|
month: PropTypes.instanceOf(Date).isRequired,
|
|
381
381
|
weekStartsOn: PropTypes.number.isRequired,
|
|
382
|
-
daysOfWeek: deprecated(
|
|
383
|
-
CustomPropTypes.DaysOfWeek,
|
|
384
|
-
'daysOfWeek property in Week is now deprecated as no longer part of the calendar, so is no longer required',
|
|
385
|
-
),
|
|
386
382
|
focusedDate: PropTypes.instanceOf(Date),
|
|
387
383
|
maxDate: PropTypes.instanceOf(Date),
|
|
388
384
|
minDate: PropTypes.instanceOf(Date),
|
|
@@ -390,33 +386,18 @@ Week.propTypes = {
|
|
|
390
386
|
onDateClick: PropTypes.func,
|
|
391
387
|
onDateKeyDown: PropTypes.func,
|
|
392
388
|
selectionConfiguration: CustomPropTypes.SelectionConfiguration,
|
|
393
|
-
selectedDate: deprecated(
|
|
394
|
-
PropTypes.instanceOf(Date),
|
|
395
|
-
'Use selectionConfiguration to set selectedDate',
|
|
396
|
-
),
|
|
397
|
-
selectionEnd: PropTypes.instanceOf(Date),
|
|
398
|
-
selectionStart: PropTypes.instanceOf(Date),
|
|
399
|
-
// eslint-disable-next-line react/require-default-props
|
|
400
|
-
showWeekendSeparator: deprecated(
|
|
401
|
-
PropTypes.bool,
|
|
402
|
-
'The showWeekendSeparator prop in Week is now deprecated as no longer part of the calendar, so is no longer required',
|
|
403
|
-
),
|
|
404
389
|
ignoreOutsideDate: PropTypes.bool,
|
|
405
390
|
dateProps: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
|
406
391
|
};
|
|
407
392
|
|
|
408
393
|
Week.defaultProps = {
|
|
409
394
|
cellClassName: null,
|
|
410
|
-
daysOfWeek: null,
|
|
411
395
|
focusedDate: null,
|
|
412
396
|
maxDate: null,
|
|
413
397
|
minDate: null,
|
|
414
398
|
onDateClick: null,
|
|
415
399
|
onDateKeyDown: null,
|
|
416
400
|
selectionConfiguration: { type: CALENDAR_SELECTION_TYPE.single, date: null },
|
|
417
|
-
selectedDate: null,
|
|
418
|
-
selectionEnd: null,
|
|
419
|
-
selectionStart: null,
|
|
420
401
|
ignoreOutsideDate: false,
|
|
421
402
|
dateProps: null,
|
|
422
403
|
};
|
|
@@ -17,9 +17,8 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import PropTypes from 'prop-types';
|
|
20
|
-
import React from 'react';
|
|
21
20
|
|
|
22
|
-
import { cssModules
|
|
21
|
+
import { cssModules } from '../../bpk-react-utils';
|
|
23
22
|
|
|
24
23
|
import CustomPropTypes, { CALENDAR_SELECTION_TYPE } from './custom-proptypes';
|
|
25
24
|
import STYLES from './BpkCalendar.module.scss';
|
|
@@ -160,15 +159,6 @@ const composeCalendar = (Nav, GridHeader, Grid, CalendarDate) => {
|
|
|
160
159
|
onDateKeyDown: PropTypes.func,
|
|
161
160
|
preventKeyboardFocus: PropTypes.bool,
|
|
162
161
|
selectionConfiguration: CustomPropTypes.SelectionConfiguration,
|
|
163
|
-
selectedDate: deprecated(
|
|
164
|
-
PropTypes.instanceOf(Date),
|
|
165
|
-
'Use selectionConfiguration to set selectedDate',
|
|
166
|
-
),
|
|
167
|
-
// eslint-disable-next-line react/require-default-props
|
|
168
|
-
showWeekendSeparator: deprecated(
|
|
169
|
-
PropTypes.bool,
|
|
170
|
-
'The showWeekendSeparator prop in composeCalendar is now deprecated as no longer part of the calendar, so is no longer required',
|
|
171
|
-
),
|
|
172
162
|
gridClassName: PropTypes.string,
|
|
173
163
|
weekDayKey: PropTypes.string,
|
|
174
164
|
/* eslint-disable react/forbid-prop-types */
|
|
@@ -197,7 +187,6 @@ const composeCalendar = (Nav, GridHeader, Grid, CalendarDate) => {
|
|
|
197
187
|
type: CALENDAR_SELECTION_TYPE.single,
|
|
198
188
|
date: null,
|
|
199
189
|
},
|
|
200
|
-
selectedDate: null,
|
|
201
190
|
gridClassName: null,
|
|
202
191
|
weekDayKey: 'nameAbbr',
|
|
203
192
|
navProps: null,
|
|
@@ -11,7 +11,6 @@ Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a comp
|
|
|
11
11
|
### BpkCard
|
|
12
12
|
|
|
13
13
|
```js
|
|
14
|
-
import React from 'react';
|
|
15
14
|
import BpkCard from '@skyscanner/backpack-web/bpk-component-card';
|
|
16
15
|
|
|
17
16
|
export default () => (
|
|
@@ -26,7 +25,6 @@ export default () => (
|
|
|
26
25
|
### BpkDividedCard
|
|
27
26
|
|
|
28
27
|
```js
|
|
29
|
-
import React from 'react';
|
|
30
28
|
import { BpkDividedCard, ORIENTATION } from '@skyscanner/backpack-web/bpk-component-card';
|
|
31
29
|
|
|
32
30
|
export default () => (
|
|
@@ -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 BpkSelectableChip, { BpkDismissibleChip, BpkDropdownChip, CHIP_TYPES } from '@skyscanner/backpack-web/bpk-component-chip';
|
|
14
13
|
import BeachIconSm from '@skyscanner/backpack-web/bpk-component-icon/sm/beach';
|
|
15
14
|
|
|
@@ -24,8 +24,6 @@ been hard coded to have disabled={false}, selected and a trailing
|
|
|
24
24
|
accessory view of a close icon.
|
|
25
25
|
*/
|
|
26
26
|
|
|
27
|
-
import React from 'react';
|
|
28
|
-
|
|
29
27
|
import { cssModules } from '../../bpk-react-utils';
|
|
30
28
|
import CloseCircleIconSm from '../../bpk-component-icon/sm/close-circle';
|
|
31
29
|
|
|
@@ -23,8 +23,6 @@ The dropdown chip component is just a selectable chip component
|
|
|
23
23
|
with a trailing accessory view of a chevron down icon.
|
|
24
24
|
*/
|
|
25
25
|
|
|
26
|
-
import React from 'react';
|
|
27
|
-
|
|
28
26
|
import ChevronDownIconSm from '../../bpk-component-icon/sm/chevron-down';
|
|
29
27
|
|
|
30
28
|
import BpkSelectableChip from './BpkSelectableChip';
|
|
@@ -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 BpkText, { TEXT_STYLES } from '../../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 { StatelessFunctionalComponent } from 'react';
|
|
23
23
|
|
|
24
24
|
import CloseIcon from '../../bpk-component-icon/sm/close';
|
|
25
25
|
import { cssModules } from '../../bpk-react-utils';
|
|
@@ -9,7 +9,6 @@ Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a comp
|
|
|
9
9
|
## Usage
|
|
10
10
|
|
|
11
11
|
```js
|
|
12
|
-
import React from 'react';
|
|
13
12
|
import { BpkCode, BpkCodeBlock } from '@skyscanner/backpack-web/bpk-component-code';
|
|
14
13
|
import BpkText from '@skyscanner/backpack-web/bpk-component-text';
|
|
15
14
|
|
|
@@ -16,8 +16,6 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import React from 'react';
|
|
20
|
-
|
|
21
19
|
// @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
|
|
22
20
|
import BpkText from '../../bpk-component-text';
|
|
23
21
|
// @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
|
|
@@ -17,8 +17,6 @@
|
|
|
17
17
|
*/
|
|
18
18
|
/* eslint react/no-array-index-key: 0 */
|
|
19
19
|
|
|
20
|
-
import React from 'react';
|
|
21
|
-
|
|
22
20
|
// @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
|
|
23
21
|
import BpkText from '../../bpk-component-text';
|
|
24
22
|
// @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
|
|
@@ -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 { BpkDataTable, BpkDataTableColumn } from '@skyscanner/backpack-web/bpk-component-datatable';
|
|
14
13
|
|
|
15
14
|
const rows = [
|
|
@@ -39,7 +38,7 @@ export default () => (
|
|
|
39
38
|
By default `BpkDataTable` sorts the column using the value of `dataKey`. For use cases where the data might more complex and requires custom sorting you can pass a `sort` function along with `sortBy` and `sortDirection`.
|
|
40
39
|
|
|
41
40
|
```js
|
|
42
|
-
import
|
|
41
|
+
import { Fragment } from 'react';
|
|
43
42
|
import { BpkDataTable, BpkDataTableColumn } from '@skyscanner/backpack-web/bpk-component-datatable';
|
|
44
43
|
|
|
45
44
|
const complexRows = [
|
|
@@ -97,9 +96,9 @@ export default () => (
|
|
|
97
96
|
width={100}
|
|
98
97
|
flexGrow={1}
|
|
99
98
|
cellRenderer={({ cellData }) => (
|
|
100
|
-
<
|
|
99
|
+
<Fragment>
|
|
101
100
|
{cellData.office} - {cellData.desk}
|
|
102
|
-
</
|
|
101
|
+
</Fragment>
|
|
103
102
|
)}
|
|
104
103
|
/>
|
|
105
104
|
</BpkDataTable>
|
|
@@ -18,7 +18,8 @@
|
|
|
18
18
|
/* @flow strict */
|
|
19
19
|
|
|
20
20
|
import PropTypes from 'prop-types';
|
|
21
|
-
import
|
|
21
|
+
import type { KeyboardEvent } from 'react';
|
|
22
|
+
import { useMemo, useState } from 'react';
|
|
22
23
|
import { useTable, useSortBy } from 'react-table';
|
|
23
24
|
|
|
24
25
|
import { cssModules } from '../../bpk-react-utils';
|
|
@@ -123,7 +124,7 @@ const BpkDataTable = (props: Props) => {
|
|
|
123
124
|
};
|
|
124
125
|
|
|
125
126
|
const handleKeyboardEvent = (
|
|
126
|
-
event:
|
|
127
|
+
event: KeyboardEvent<HTMLElement>,
|
|
127
128
|
i: number,
|
|
128
129
|
) => {
|
|
129
130
|
if (
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
/* @flow strict */
|
|
19
19
|
|
|
20
|
-
import
|
|
20
|
+
import type { KeyboardEvent } from 'react';
|
|
21
21
|
|
|
22
22
|
import { cssModules } from '../../bpk-react-utils';
|
|
23
23
|
import BpkSmallArrowDownIcon from '../../bpk-component-icon/sm/arrow-down';
|
|
@@ -72,7 +72,7 @@ const BpkDataTableHeader = ({ column }: { column: ColumnType }) => {
|
|
|
72
72
|
column.toggleSortBy(isDescending);
|
|
73
73
|
};
|
|
74
74
|
|
|
75
|
-
const handleKeyboardEvent = (event:
|
|
75
|
+
const handleKeyboardEvent = (event: KeyboardEvent<HTMLElement>) => {
|
|
76
76
|
if (
|
|
77
77
|
event.keyCode === KEYCODES.ENTER ||
|
|
78
78
|
event.keyCode === KEYCODES.SPACEBAR
|
|
@@ -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 BpkDatepicker, { CALENDAR_SELECTION_TYPE } from '@skyscanner/backpack-web/bpk-component-datepicker';
|
|
14
14
|
import format from 'date-fns/format';
|
|
15
15
|
|
|
@@ -71,7 +71,7 @@ export default class App extends Component {
|
|
|
71
71
|
By default `BpkCalendar` is used but the calendar component is fully configurable through the `calendarComponent` prop.
|
|
72
72
|
|
|
73
73
|
```js
|
|
74
|
-
import
|
|
74
|
+
import { Component } from 'react';
|
|
75
75
|
import BpkDatepicker from '@skyscanner/backpack-web/bpk-component-datepicker';
|
|
76
76
|
import {
|
|
77
77
|
BpkCalendarNav,
|