@skyscanner/backpack-web 33.3.1 → 33.5.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bpk-component-accordion/index.js +1 -1
- package/bpk-component-accordion/src/BpkAccordionItem.js +12 -13
- package/bpk-component-accordion/src/BpkAccordionItem.module.css +1 -1
- package/bpk-component-autosuggest/src/BpkAutosuggestSuggestion.js +5 -3
- package/bpk-component-banner-alert/index.js +1 -1
- package/bpk-component-banner-alert/src/AnimateAndFade.js +37 -35
- package/bpk-component-banner-alert/src/BpkBannerAlertInner.js +12 -6
- package/bpk-component-barchart/src/BpkBarchart.js +9 -10
- package/bpk-component-barchart/src/BpkBarchartBar.js +1 -2
- package/bpk-component-barchart/src/BpkBarchartBars.js +2 -2
- package/bpk-component-barchart/src/BpkBarchartDefs.js +1 -2
- package/bpk-component-barchart/src/BpkChartAxis.js +1 -2
- package/bpk-component-barchart/src/BpkChartDataTable.js +1 -2
- package/bpk-component-bottom-sheet/src/BpkBottomSheet.js +4 -6
- package/bpk-component-breadcrumb/src/BpkBreadcrumb.js +1 -2
- package/bpk-component-breadcrumb/src/BpkBreadcrumbItem.js +18 -14
- package/bpk-component-breadcrumb/src/BpkBreadcrumbItem.module.css +1 -1
- package/bpk-component-breakpoint/index.d.ts +2 -1
- package/bpk-component-breakpoint/src/BpkBreakpoint.js +7 -5
- package/bpk-component-breakpoint/src/useMediaQuery.js +7 -6
- package/bpk-component-button/index.js +5 -5
- package/bpk-component-button/src/BpkButtonDestructive.js +10 -9
- package/bpk-component-button/src/BpkButtonFeatured.js +10 -9
- package/bpk-component-button/src/BpkButtonLink.js +11 -10
- package/bpk-component-button/src/BpkButtonLinkOnDark.js +11 -10
- package/bpk-component-button/src/BpkButtonPrimary.js +2 -2
- package/bpk-component-button/src/BpkButtonPrimaryOnDark.js +10 -9
- package/bpk-component-button/src/BpkButtonPrimaryOnLight.js +10 -9
- package/bpk-component-button/src/BpkButtonSecondary.js +10 -10
- package/bpk-component-button/src/BpkButtonSecondaryOnDark.js +10 -9
- package/bpk-component-calendar/index.js +1 -1
- package/bpk-component-calendar/src/BpkCalendarContainer.js +3 -3
- package/bpk-component-calendar/src/BpkCalendarGrid.js +3 -2
- package/bpk-component-calendar/src/BpkCalendarGrid.module.css +1 -1
- package/bpk-component-calendar/src/BpkCalendarGridHeader.js +4 -1
- package/bpk-component-calendar/src/BpkCalendarGridTransition.js +6 -4
- package/bpk-component-calendar/src/BpkCalendarNav.js +10 -5
- package/bpk-component-calendar/src/Week.js +6 -3
- package/bpk-component-calendar/src/composeCalendar.js +9 -4
- package/bpk-component-calendar/src/date-utils.js +14 -14
- package/bpk-component-card/src/BpkCardWrapper.js +1 -2
- package/bpk-component-card/src/BpkDividedCard.js +19 -15
- package/bpk-component-card-button/src/BpkSaveButton.js +14 -6
- package/bpk-component-checkbox/src/BpkCheckbox.js +1 -2
- package/bpk-component-chip/index.d.ts +3 -5
- package/bpk-component-chip/index.js +3 -2
- package/bpk-component-chip/src/BpkDismissibleChip.js +7 -2
- package/bpk-component-chip/src/BpkIconChip.d.ts +25 -0
- package/bpk-component-chip/src/BpkIconChip.js +31 -0
- package/bpk-component-chip/src/BpkSelectableChip.d.ts +0 -2
- package/bpk-component-chip/src/BpkSelectableChip.js +5 -6
- package/bpk-component-chip/src/BpkSelectableChip.module.css +1 -1
- package/bpk-component-chip/src/commonTypes.d.ts +1 -1
- package/bpk-component-chip/src/commonTypes.js +1 -24
- package/bpk-component-close-button/src/BpkCloseButton.js +9 -5
- package/bpk-component-close-button/src/BpkCloseButton.module.css +1 -1
- package/bpk-component-content-cards/src/BpkContentCard.js +9 -4
- package/bpk-component-content-cards/src/BpkContentCards.js +2 -7
- package/bpk-component-content-cards/src/BpkContentCards.module.css +1 -1
- package/bpk-component-datatable/src/BpkDataTable.js +4 -4
- package/bpk-component-datatable/src/BpkDataTableHeader.js +14 -11
- package/bpk-component-datatable/src/BpkDataTableHeader.module.css +1 -1
- package/bpk-component-datepicker/src/BpkDatepicker.js +3 -5
- package/bpk-component-description-list/index.js +1 -1
- package/bpk-component-description-list/src/ComponentFactory.js +10 -5
- package/bpk-component-dialog/src/BpkDialog.js +7 -6
- package/bpk-component-dialog/src/BpkDialog.module.css +1 -1
- package/bpk-component-dialog/src/BpkDialogInner.js +7 -5
- package/bpk-component-drawer/src/BpkDrawer.js +1 -4
- package/bpk-component-drawer/src/BpkDrawerContent.js +8 -7
- package/bpk-component-fieldset/src/BpkFieldset.js +10 -9
- package/bpk-component-flare/index.js +2 -2
- package/bpk-component-flare/src/BpkContentBubble.js +5 -3
- package/bpk-component-flare/src/BpkFlareBar.js +15 -7
- package/bpk-component-floating-notification/src/BpkFloatingNotification.js +10 -4
- package/bpk-component-form-validation/src/BpkFormValidation.js +6 -6
- package/bpk-component-graphic-promotion/src/BpkGraphicPromo.js +10 -14
- package/bpk-component-graphic-promotion/src/BpkGraphicPromo.module.css +1 -1
- package/bpk-component-grid-toggle/src/BpkGridToggle.js +8 -6
- package/bpk-component-horizontal-nav/src/BpkHorizontalNav.js +16 -14
- package/bpk-component-horizontal-nav/src/BpkHorizontalNav.module.css +1 -1
- package/bpk-component-horizontal-nav/src/BpkHorizontalNavItem.js +2 -2
- package/bpk-component-icon/index.js +1 -1
- package/bpk-component-icon/lg/ai.js +1 -2
- package/bpk-component-icon/lg/aircraft.js +1 -2
- package/bpk-component-icon/lg/beach.js +1 -2
- package/bpk-component-icon/lg/call-back.js +1 -2
- package/bpk-component-icon/lg/camper-van.js +1 -2
- package/bpk-component-icon/lg/car-wash.js +1 -2
- package/bpk-component-icon/lg/cars.js +1 -2
- package/bpk-component-icon/lg/clean.js +1 -2
- package/bpk-component-icon/lg/cloakroom.js +1 -2
- package/bpk-component-icon/lg/content--copy.js +1 -2
- package/bpk-component-icon/lg/data.js +1 -2
- package/bpk-component-icon/lg/depart.js +1 -2
- package/bpk-component-icon/lg/dot.js +20 -0
- package/bpk-component-icon/lg/download.js +1 -2
- package/bpk-component-icon/lg/education.js +1 -2
- package/bpk-component-icon/lg/explore.js +1 -2
- package/bpk-component-icon/lg/fast-track.js +1 -2
- package/bpk-component-icon/lg/fast-train.js +1 -2
- package/bpk-component-icon/lg/flight-landing.js +1 -2
- package/bpk-component-icon/lg/flight-takeoff.js +1 -2
- package/bpk-component-icon/lg/flight.js +1 -2
- package/bpk-component-icon/lg/legroom--extra.js +1 -2
- package/bpk-component-icon/lg/legroom--normal.js +1 -2
- package/bpk-component-icon/lg/legroom--reduced.js +1 -2
- package/bpk-component-icon/lg/logout.js +1 -2
- package/bpk-component-icon/lg/lounge.js +1 -2
- package/bpk-component-icon/lg/mail.js +1 -2
- package/bpk-component-icon/lg/mileage.js +1 -2
- package/bpk-component-icon/lg/new-window.js +1 -2
- package/bpk-component-icon/lg/plane-seat.js +1 -2
- package/bpk-component-icon/lg/return.js +1 -2
- package/bpk-component-icon/lg/scales.js +1 -2
- package/bpk-component-icon/lg/share--ios.js +1 -2
- package/bpk-component-icon/lg/social-distancing.js +1 -2
- package/bpk-component-icon/lg/speaker.js +1 -2
- package/bpk-component-icon/lg/taxi.js +1 -2
- package/bpk-component-icon/lg/unmute.js +1 -2
- package/bpk-component-icon/lg/wallet.js +1 -2
- package/bpk-component-icon/lg/weather--cloudy.js +1 -2
- package/bpk-component-icon/lg/weather--partly-cloudy.js +1 -2
- package/bpk-component-icon/lg/weather--rain.js +1 -2
- package/bpk-component-icon/lg/weather--thunderstorm.js +1 -2
- package/bpk-component-icon/lg/window--reduce.js +1 -2
- package/bpk-component-icon/lg/world--emea.js +1 -2
- package/bpk-component-icon/sm/ai.js +1 -2
- package/bpk-component-icon/sm/aircraft.js +1 -2
- package/bpk-component-icon/sm/beach.js +1 -2
- package/bpk-component-icon/sm/bus.js +1 -2
- package/bpk-component-icon/sm/call-back.js +1 -2
- package/bpk-component-icon/sm/camper-van.js +1 -2
- package/bpk-component-icon/sm/car-wash.js +1 -2
- package/bpk-component-icon/sm/cars.js +1 -2
- package/bpk-component-icon/sm/chauffeur.js +1 -2
- package/bpk-component-icon/sm/clean.js +1 -2
- package/bpk-component-icon/sm/content--copy.js +1 -2
- package/bpk-component-icon/sm/data.js +1 -2
- package/bpk-component-icon/sm/depart.js +1 -2
- package/bpk-component-icon/sm/direct.js +1 -2
- package/bpk-component-icon/sm/dot.js +20 -0
- package/bpk-component-icon/sm/download.js +1 -2
- package/bpk-component-icon/sm/education.js +1 -2
- package/bpk-component-icon/sm/explore.js +1 -2
- package/bpk-component-icon/sm/fast-track.js +1 -2
- package/bpk-component-icon/sm/fast-train.js +1 -2
- package/bpk-component-icon/sm/flight-landing.js +1 -2
- package/bpk-component-icon/sm/flight-takeoff.js +1 -2
- package/bpk-component-icon/sm/flight.js +1 -2
- package/bpk-component-icon/sm/hotels--jacuzzi.js +1 -2
- package/bpk-component-icon/sm/infant.js +1 -2
- package/bpk-component-icon/sm/legroom--extra.js +1 -2
- package/bpk-component-icon/sm/legroom--normal.js +1 -2
- package/bpk-component-icon/sm/legroom--reduced.js +1 -2
- package/bpk-component-icon/sm/logout.js +1 -2
- package/bpk-component-icon/sm/mail.js +1 -2
- package/bpk-component-icon/sm/mileage.js +1 -2
- package/bpk-component-icon/sm/new-window.js +1 -2
- package/bpk-component-icon/sm/onsen.js +1 -2
- package/bpk-component-icon/sm/plane-seat.js +1 -2
- package/bpk-component-icon/sm/return.js +1 -2
- package/bpk-component-icon/sm/share--ios.js +1 -2
- package/bpk-component-icon/sm/social-distancing.js +1 -2
- package/bpk-component-icon/sm/taxi.js +1 -2
- package/bpk-component-icon/sm/unmute.js +1 -2
- package/bpk-component-icon/sm/weather--cloudy.js +1 -2
- package/bpk-component-icon/sm/weather--rain.js +1 -2
- package/bpk-component-icon/sm/weather--thunderstorm.js +1 -2
- package/bpk-component-icon/sm/weather--wind.js +1 -2
- package/bpk-component-icon/sm/window--reduce.js +1 -2
- package/bpk-component-icon/src/classNameModifierHOCFactory.js +3 -0
- package/bpk-component-icon/src/withDescription.js +1 -2
- package/bpk-component-icon/src/withRtlSupport.js +1 -1
- package/bpk-component-image/index.js +2 -2
- package/bpk-component-image/src/BpkBackgroundImage.js +4 -3
- package/bpk-component-image/src/BpkImage.js +6 -4
- package/bpk-component-infinite-scroll/src/withInfiniteScroll.js +4 -5
- package/bpk-component-info-banner/src/AnimateAndFade.js +37 -35
- package/bpk-component-info-banner/src/BpkInfoBanner.module.css +1 -1
- package/bpk-component-info-banner/src/BpkInfoBannerInner.js +17 -14
- package/bpk-component-input/index.js +1 -1
- package/bpk-component-input/src/BpkClearButton.js +3 -1
- package/bpk-component-input/src/BpkInput.js +6 -4
- package/bpk-component-input/src/withOpenEvents.js +4 -1
- package/bpk-component-label/src/BpkLabel.js +1 -2
- package/bpk-component-link/index.js +2 -2
- package/bpk-component-list/src/BpkList.js +2 -2
- package/bpk-component-loading-button/src/BpkLoadingButton.js +7 -5
- package/bpk-component-map/index.js +4 -4
- package/bpk-component-map/src/BpkIconMarker.js +2 -3
- package/bpk-component-map/src/BpkMap.js +2 -2
- package/bpk-component-map/src/BpkPriceMarker.js +8 -7
- package/bpk-component-map/src/BpkPriceMarkerV2/BpkPriceMarker.js +2 -3
- package/bpk-component-mobile-scroll-container/src/BpkMobileScrollContainer.js +1 -9
- package/bpk-component-mobile-scroll-container/src/BpkMobileScrollContainer.module.css +1 -1
- package/bpk-component-modal/index.js +4 -3
- package/bpk-component-modal/src/BpkModal.d.ts +2 -1
- package/bpk-component-modal/src/BpkModal.js +4 -2
- package/bpk-component-modal/src/BpkModalInner.d.ts +2 -0
- package/bpk-component-modal/src/BpkModalInner.js +25 -10
- package/bpk-component-modal/src/BpkModalInner.module.css +1 -1
- package/bpk-component-modal/src/BpkModalV2/BpKModal.module.css +1 -1
- package/bpk-component-modal/src/BpkModalV2/BpkModal.d.ts +2 -0
- package/bpk-component-modal/src/BpkModalV2/BpkModal.js +20 -10
- package/bpk-component-navigation-bar/index.js +1 -1
- package/bpk-component-navigation-bar/src/BpkNavigationBar.js +8 -7
- package/bpk-component-navigation-bar/src/BpkNavigationBarButtonLink.js +7 -7
- package/bpk-component-navigation-bar/src/BpkNavigationBarIconButton.js +8 -8
- package/bpk-component-nudger/index.js +1 -1
- package/bpk-component-nudger/src/BpkConfigurableNudger.js +17 -6
- package/bpk-component-nudger/src/BpkNudger.js +16 -10
- package/bpk-component-nudger/src/BpkNudger.module.css +1 -1
- package/bpk-component-overlay/src/BpkOverlay.js +1 -2
- package/bpk-component-page-indicator/src/BpkPageIndicator.js +1 -2
- package/bpk-component-page-indicator/src/BpkPageIndicator.module.css +1 -1
- package/bpk-component-page-indicator/src/NavButton.js +1 -1
- package/bpk-component-pagination/src/BpkPagination.js +1 -2
- package/bpk-component-pagination/src/BpkPaginationList.js +1 -1
- package/bpk-component-pagination/src/BpkPaginationNudger.js +14 -6
- package/bpk-component-pagination/src/BpkPaginationPage.js +4 -1
- package/bpk-component-phone-input/src/BpkPhoneInput.js +16 -6
- package/bpk-component-popover/src/BpkPopover.js +8 -6
- package/bpk-component-popover/src/BpkPopoverPortal.js +8 -7
- package/bpk-component-popover/src/keyboardFocusScope.js +1 -1
- package/bpk-component-price/src/BpkPrice.js +19 -8
- package/bpk-component-progress/src/BpkProgress.js +1 -2
- package/bpk-component-radio/src/BpkRadio.js +1 -2
- package/bpk-component-rating/src/BpkRating.js +19 -8
- package/bpk-component-rtl-toggle/src/BpkRtlToggle.js +0 -4
- package/bpk-component-scrollable-calendar/src/BpkScrollableCalendarGrid.js +7 -5
- package/bpk-component-scrollable-calendar/src/BpkScrollableCalendarGridList.js +7 -4
- package/bpk-component-section-header/src/BpkSectionHeader.js +7 -7
- package/bpk-component-section-header/src/BpkSectionHeader.module.css +1 -1
- package/bpk-component-section-list/index.js +1 -1
- package/bpk-component-section-list/src/BpkSectionListItem.js +9 -8
- package/bpk-component-section-list/src/BpkSectionListItem.module.css +1 -1
- package/bpk-component-section-list/src/BpkSectionListSection.js +2 -3
- package/bpk-component-select/src/BpkSelect.js +1 -2
- package/bpk-component-skeleton/index.js +21 -0
- package/bpk-component-skeleton/src/BpkBaseSkeleton.js +30 -0
- package/bpk-component-skeleton/src/BpkBaseSkeleton.module.css +18 -0
- package/bpk-component-skeleton/src/BpkSkeleton.js +38 -0
- package/bpk-component-skeleton/src/BpkSkeleton.module.css +18 -0
- package/bpk-component-skeleton/src/common-types.js +33 -0
- package/bpk-component-slider/src/BpkSlider.js +2 -1
- package/bpk-component-spinner/index.js +3 -3
- package/bpk-component-spinner/src/BpkExtraLargeSpinner.js +8 -7
- package/bpk-component-spinner/src/BpkLargeSpinner.js +8 -7
- package/bpk-component-spinner/src/BpkSpinner.js +8 -7
- package/bpk-component-split-input/src/BpkInputField.js +2 -2
- package/bpk-component-split-input/src/BpkSplitInput.js +3 -3
- package/bpk-component-star-rating/index.js +4 -4
- package/bpk-component-star-rating/src/BpkInteractiveStar.js +6 -3
- package/bpk-component-star-rating/src/BpkInteractiveStarRating.js +1 -1
- package/bpk-component-star-rating/src/BpkStar.js +18 -18
- package/bpk-component-star-rating/src/BpkStar.module.css +1 -1
- package/bpk-component-swap-button/src/BpkSwapButton.js +2 -1
- package/bpk-component-switch/src/BpkSwitch.js +1 -2
- package/bpk-component-table/index.js +2 -2
- package/bpk-component-text/src/BpkText.js +10 -5
- package/bpk-component-theme-toggle/src/BpkThemeToggle.js +7 -6
- package/bpk-component-theme-toggle/src/updateOnThemeChange.js +1 -1
- package/bpk-component-tooltip/src/BpkTooltip.js +2 -3
- package/bpk-component-tooltip/src/BpkTooltipPortal.js +7 -6
- package/bpk-mixins/_chips.scss +9 -0
- package/bpk-react-utils/index.js +3 -3
- package/bpk-react-utils/src/BpkDialogWrapper/BpkDialogWrapper.js +2 -2
- package/bpk-react-utils/src/Portal.js +1 -0
- package/bpk-react-utils/src/withDefaultProps.js +4 -1
- package/bpk-scrim-utils/src/withScrim.js +3 -3
- package/bpk-scrim-utils/src/withScrimmedPortal.js +1 -1
- package/bpk-theming/src/BpkThemeProvider.js +1 -1
- package/package.json +2 -2
- package/unstable__bpk-mixins/_chips.scss +9 -0
- package/bpk-component-button/src/commonButtonTests.js +0 -133
- package/bpk-component-navigation-bar/src/BpkNavigationBarButtonLink.module.css +0 -18
|
@@ -15,14 +15,13 @@
|
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/import PropTypes from 'prop-types';
|
|
18
|
-
import BpkText, { TEXT_STYLES } from "../../bpk-component-text";
|
|
19
|
-
import { BpkButtonLink } from "../../bpk-component-link";
|
|
20
18
|
import BpkCloseButton from "../../bpk-component-close-button";
|
|
19
|
+
import { BpkButtonLink } from "../../bpk-component-link";
|
|
20
|
+
import BpkText, { TEXT_STYLES } from "../../bpk-component-text";
|
|
21
21
|
import { TransitionInitialMount, cssModules } from "../../bpk-react-utils";
|
|
22
|
-
import STYLES from "./BpkPopover.module.css";
|
|
23
22
|
import { ARROW_ID } from "./constants";
|
|
24
|
-
import
|
|
25
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
|
+
import STYLES from "./BpkPopover.module.css";
|
|
24
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
26
25
|
const getClassName = cssModules(STYLES);
|
|
27
26
|
const EVENT_SOURCES = {
|
|
28
27
|
CLOSE_BUTTON: 'CLOSE_BUTTON',
|
|
@@ -86,7 +85,10 @@ const BpkPopover = props => {
|
|
|
86
85
|
id: labelId,
|
|
87
86
|
textStyle: TEXT_STYLES.label1,
|
|
88
87
|
children: label
|
|
89
|
-
}), "\xA0", closeButtonIcon ? /*#__PURE__*/_jsx(BpkCloseButton
|
|
88
|
+
}), "\xA0", closeButtonIcon ? /*#__PURE__*/_jsx(BpkCloseButton
|
|
89
|
+
// TODO: className to be removed
|
|
90
|
+
// eslint-disable-next-line @skyscanner/rules/forbid-component-props
|
|
91
|
+
, {
|
|
90
92
|
className: getClassName('bpk-popover__close-button'),
|
|
91
93
|
label: closeButtonText,
|
|
92
94
|
onClick: bindEventSource(EVENT_SOURCES.CLOSE_BUTTON, props.onClose),
|
|
@@ -14,17 +14,15 @@
|
|
|
14
14
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
|
-
*/import
|
|
18
|
-
import PropTypes from 'prop-types';
|
|
17
|
+
*/import PropTypes from 'prop-types';
|
|
19
18
|
import { Component } from 'react';
|
|
19
|
+
import { createPopper } from '@popperjs/core';
|
|
20
20
|
import focusStore from 'a11y-focus-store';
|
|
21
21
|
import { Portal, cssModules } from "../../bpk-react-utils";
|
|
22
|
+
import BpkPopover from "./BpkPopover";
|
|
22
23
|
import keyboardFocusScope from "./keyboardFocusScope";
|
|
23
24
|
import STYLES from "./BpkPopover.module.css";
|
|
24
|
-
import
|
|
25
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
26
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
27
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
26
|
const getClassName = cssModules(STYLES);
|
|
29
27
|
class BpkPopoverPortal extends Component {
|
|
30
28
|
constructor() {
|
|
@@ -150,7 +148,10 @@ class BpkPopoverPortal extends Component {
|
|
|
150
148
|
}
|
|
151
149
|
return /*#__PURE__*/_jsxs(_Fragment, {
|
|
152
150
|
children: [typeof target !== 'function' && target, /*#__PURE__*/_jsx(Portal, {
|
|
153
|
-
beforeClose: this.beforeClose
|
|
151
|
+
beforeClose: this.beforeClose
|
|
152
|
+
// TODO: className to be removed
|
|
153
|
+
// eslint-disable-next-line @skyscanner/rules/forbid-component-props
|
|
154
|
+
,
|
|
154
155
|
className: classNames.join(' '),
|
|
155
156
|
isOpen: isOpen,
|
|
156
157
|
onClose: this.onClose,
|
|
@@ -21,8 +21,8 @@
|
|
|
21
21
|
// it only prevents it leaving due to keyboard events.
|
|
22
22
|
// Clicks outside the target element will move focus as normal.
|
|
23
23
|
|
|
24
|
-
import tabbable from 'tabbable';
|
|
25
24
|
import focusin from 'focusin';
|
|
25
|
+
import tabbable from 'tabbable';
|
|
26
26
|
let polyfilled = false;
|
|
27
27
|
let focusTrapped = false;
|
|
28
28
|
const init = element => {
|
|
@@ -15,12 +15,11 @@
|
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/import PropTypes from 'prop-types';
|
|
18
|
-
import { cssModules } from "../../bpk-react-utils";
|
|
19
18
|
import BpkText, { TEXT_STYLES } from "../../bpk-component-text";
|
|
20
|
-
import
|
|
19
|
+
import { cssModules } from "../../bpk-react-utils";
|
|
21
20
|
import { SIZES, ALIGNS } from "./common-types";
|
|
22
|
-
import
|
|
23
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
|
+
import STYLES from "./BpkPrice.module.css";
|
|
22
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
23
|
const getClassName = cssModules(STYLES);
|
|
25
24
|
const BpkPrice = props => {
|
|
26
25
|
const {
|
|
@@ -43,14 +42,20 @@ const BpkPrice = props => {
|
|
|
43
42
|
...rest,
|
|
44
43
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
45
44
|
className: getClassName(previousPrice && 'bpk-price__leading', isAlignRight && 'bpk-price__leading--right', leadingClassName),
|
|
46
|
-
children: [previousPrice && /*#__PURE__*/_jsx(BpkText
|
|
45
|
+
children: [previousPrice && /*#__PURE__*/_jsx(BpkText
|
|
46
|
+
// TODO: className to be removed
|
|
47
|
+
// eslint-disable-next-line @skyscanner/rules/forbid-component-props
|
|
48
|
+
, {
|
|
47
49
|
className: getClassName('bpk-price__previous-price'),
|
|
48
50
|
textStyle: isSmall ? TEXT_STYLES.xs : TEXT_STYLES.sm,
|
|
49
51
|
tagName: "span",
|
|
50
52
|
children: previousPrice
|
|
51
53
|
}), previousPrice && leadingText && /*#__PURE__*/_jsx(BpkText, {
|
|
52
54
|
textStyle: isSmall ? TEXT_STYLES.xs : TEXT_STYLES.sm,
|
|
53
|
-
tagName: "span"
|
|
55
|
+
tagName: "span"
|
|
56
|
+
// TODO: className to be removed
|
|
57
|
+
// eslint-disable-next-line @skyscanner/rules/forbid-component-props
|
|
58
|
+
,
|
|
54
59
|
className: getClassName('bpk-price__separator'),
|
|
55
60
|
children: "\uD802\uDD1F"
|
|
56
61
|
}), leadingText && /*#__PURE__*/_jsx(BpkText, {
|
|
@@ -61,13 +66,19 @@ const BpkPrice = props => {
|
|
|
61
66
|
}), /*#__PURE__*/_jsxs("div", {
|
|
62
67
|
className: getClassName(isAlignRight && 'bpk-price__column-container'),
|
|
63
68
|
children: [/*#__PURE__*/_jsx(BpkText, {
|
|
64
|
-
textStyle: isSmall ? TEXT_STYLES.heading4 : TEXT_STYLES.xxl
|
|
69
|
+
textStyle: isSmall ? TEXT_STYLES.heading4 : TEXT_STYLES.xxl
|
|
70
|
+
// TODO: className to be removed
|
|
71
|
+
// eslint-disable-next-line @skyscanner/rules/forbid-component-props
|
|
72
|
+
,
|
|
65
73
|
className: getClassName('bpk-price__price', !isAlignRight && 'bpk-price__spacing'),
|
|
66
74
|
tagName: "span",
|
|
67
75
|
children: price
|
|
68
76
|
}), trailingText && /*#__PURE__*/_jsx(BpkText, {
|
|
69
77
|
textStyle: isSmall ? TEXT_STYLES.xs : TEXT_STYLES.sm,
|
|
70
|
-
tagName: "span"
|
|
78
|
+
tagName: "span"
|
|
79
|
+
// TODO: className to be removed
|
|
80
|
+
// eslint-disable-next-line @skyscanner/rules/forbid-component-props
|
|
81
|
+
,
|
|
71
82
|
className: getClassName('bpk-price__trailing'),
|
|
72
83
|
children: trailingText
|
|
73
84
|
})]
|
|
@@ -19,8 +19,7 @@ import { Component } from 'react';
|
|
|
19
19
|
import clamp from 'lodash.clamp';
|
|
20
20
|
import { cssModules } from "../../bpk-react-utils";
|
|
21
21
|
import STYLES from "./BpkProgress.module.css";
|
|
22
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
23
|
const getClassName = cssModules(STYLES);
|
|
25
24
|
const isTransitionEndSupported = () => !!(typeof window !== 'undefined' && 'TransitionEvent' in window);
|
|
26
25
|
const renderSteps = numberOfSteps => {
|
|
@@ -17,8 +17,7 @@
|
|
|
17
17
|
*/import PropTypes from 'prop-types';
|
|
18
18
|
import { cssModules } from "../../bpk-react-utils";
|
|
19
19
|
import STYLES from "./BpkRadio.module.css";
|
|
20
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
20
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
21
|
const getClassName = cssModules(STYLES);
|
|
23
22
|
const BpkRadio = props => {
|
|
24
23
|
const {
|
|
@@ -16,12 +16,11 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/import PropTypes from 'prop-types';
|
|
18
18
|
import clamp from 'lodash.clamp';
|
|
19
|
-
import { cssModules } from "../../bpk-react-utils";
|
|
20
19
|
import BpkText, { TEXT_STYLES } from "../../bpk-component-text";
|
|
21
|
-
import
|
|
20
|
+
import { cssModules } from "../../bpk-react-utils";
|
|
22
21
|
import { RATING_SIZES, RATING_SCALES } from "./common-types";
|
|
23
|
-
import
|
|
24
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
|
+
import STYLES from "./BpkRating.module.css";
|
|
23
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
25
24
|
const getClassName = cssModules(STYLES);
|
|
26
25
|
const getMinValue = () =>
|
|
27
26
|
// Currently the min value is zero no matter what scale is used.
|
|
@@ -80,11 +79,17 @@ const BpkRating = props => {
|
|
|
80
79
|
...rest,
|
|
81
80
|
children: [/*#__PURE__*/_jsxs(BpkText, {
|
|
82
81
|
textStyle: valueTextSize,
|
|
83
|
-
tagName: "span"
|
|
82
|
+
tagName: "span"
|
|
83
|
+
// TODO: className to be removed
|
|
84
|
+
// eslint-disable-next-line @skyscanner/rules/forbid-component-props
|
|
85
|
+
,
|
|
84
86
|
className: valueStyles,
|
|
85
87
|
"aria-hidden": "true",
|
|
86
88
|
children: [adjustedValue, showScale && /*#__PURE__*/_jsxs(BpkText, {
|
|
87
|
-
textStyle: scaleTextSize
|
|
89
|
+
textStyle: scaleTextSize
|
|
90
|
+
// TODO: className to be removed
|
|
91
|
+
// eslint-disable-next-line @skyscanner/rules/forbid-component-props
|
|
92
|
+
,
|
|
88
93
|
className: scaleStyles,
|
|
89
94
|
tagName: "span",
|
|
90
95
|
"aria-hidden": "true",
|
|
@@ -93,12 +98,18 @@ const BpkRating = props => {
|
|
|
93
98
|
}), /*#__PURE__*/_jsxs("div", {
|
|
94
99
|
className: textWrapperStyles,
|
|
95
100
|
children: [title && /*#__PURE__*/_jsx(BpkText, {
|
|
96
|
-
textStyle: titleTextSize
|
|
101
|
+
textStyle: titleTextSize
|
|
102
|
+
// TODO: className to be removed
|
|
103
|
+
// eslint-disable-next-line @skyscanner/rules/forbid-component-props
|
|
104
|
+
,
|
|
97
105
|
className: titleStyles,
|
|
98
106
|
tagName: "span",
|
|
99
107
|
"aria-hidden": "true",
|
|
100
108
|
children: title
|
|
101
|
-
}), subtitle && /*#__PURE__*/_jsx(BpkText
|
|
109
|
+
}), subtitle && /*#__PURE__*/_jsx(BpkText
|
|
110
|
+
// TODO: className to be removed
|
|
111
|
+
// eslint-disable-next-line @skyscanner/rules/forbid-component-props
|
|
112
|
+
, {
|
|
102
113
|
className: subtitleStyles,
|
|
103
114
|
textStyle: subtitleTextSize,
|
|
104
115
|
tagName: "span",
|
|
@@ -60,14 +60,10 @@ class BpkRtlToggle extends Component {
|
|
|
60
60
|
});
|
|
61
61
|
};
|
|
62
62
|
render() {
|
|
63
|
-
const {
|
|
64
|
-
className
|
|
65
|
-
} = this.props;
|
|
66
63
|
const onOrOff = this.state.direction === DIRECTIONS.RTL ? 'off' : 'on';
|
|
67
64
|
return /*#__PURE__*/_jsxs(BpkButtonLink, {
|
|
68
65
|
title: "Keyboard Shortcut: ctrl + cmd + r",
|
|
69
66
|
onClick: this.toggleRtl,
|
|
70
|
-
className: className,
|
|
71
67
|
children: ["RTL ", onOrOff]
|
|
72
68
|
});
|
|
73
69
|
}
|
|
@@ -16,12 +16,11 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import { cssModules } from "../../bpk-react-utils";
|
|
20
|
-
import BpkText, { TEXT_STYLES } from "../../bpk-component-text";
|
|
21
19
|
import { BpkCalendarGrid } from "../../bpk-component-calendar";
|
|
20
|
+
import BpkText, { TEXT_STYLES } from "../../bpk-component-text";
|
|
21
|
+
import { cssModules } from "../../bpk-react-utils";
|
|
22
22
|
import STYLES from "./BpkScrollableCalendarGrid.module.css";
|
|
23
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
25
24
|
const getClassName = cssModules(STYLES);
|
|
26
25
|
const BpkScrollableCalendarGrid = ({
|
|
27
26
|
className,
|
|
@@ -33,7 +32,10 @@ const BpkScrollableCalendarGrid = ({
|
|
|
33
32
|
const classNames = getClassName('bpk-scrollable-calendar-grid', className);
|
|
34
33
|
return /*#__PURE__*/_jsxs("div", {
|
|
35
34
|
className: classNames,
|
|
36
|
-
children: [/*#__PURE__*/_jsx(BpkText
|
|
35
|
+
children: [/*#__PURE__*/_jsx(BpkText
|
|
36
|
+
// TODO: className to be removed
|
|
37
|
+
// eslint-disable-next-line @skyscanner/rules/forbid-component-props
|
|
38
|
+
, {
|
|
37
39
|
className: getClassName('bpk-scrollable-calendar-grid__title'),
|
|
38
40
|
tagName: "h1",
|
|
39
41
|
textStyle: TEXT_STYLES.heading4,
|
|
@@ -18,13 +18,13 @@
|
|
|
18
18
|
|
|
19
19
|
import { useRef, useState, useMemo, useEffect } from 'react';
|
|
20
20
|
import { startOfDay, startOfMonth } from 'date-fns';
|
|
21
|
-
import { VariableSizeList as List } from 'react-window';
|
|
22
21
|
import AutoSizer from 'react-virtualized-auto-sizer';
|
|
23
|
-
import {
|
|
22
|
+
import { VariableSizeList as List } from 'react-window';
|
|
24
23
|
import { CALENDAR_SELECTION_TYPE, DateUtils } from "../../bpk-component-calendar";
|
|
25
|
-
import
|
|
24
|
+
import { cssModules } from "../../bpk-react-utils";
|
|
26
25
|
import BpkScrollableCalendarGrid from "./BpkScrollableCalendarGrid";
|
|
27
26
|
import { getMonthsArray, getMonthItemHeights } from "./utils";
|
|
27
|
+
import STYLES from "./BpkScrollableCalendarGridList.module.css";
|
|
28
28
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
29
29
|
const getClassName = cssModules(STYLES);
|
|
30
30
|
|
|
@@ -82,7 +82,10 @@ const BpkScrollableCalendarGridList = props => {
|
|
|
82
82
|
month: months[index],
|
|
83
83
|
focusedDate: focusedDate,
|
|
84
84
|
preventKeyboardFocus: rest.preventKeyboardFocus,
|
|
85
|
-
"aria-hidden": index !== 1
|
|
85
|
+
"aria-hidden": index !== 1
|
|
86
|
+
// TODO: className to be removed
|
|
87
|
+
// eslint-disable-next-line @skyscanner/rules/forbid-component-props
|
|
88
|
+
,
|
|
86
89
|
className: getClassName('bpk-scrollable-calendar-grid-list__item')
|
|
87
90
|
})
|
|
88
91
|
});
|
|
@@ -16,11 +16,10 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import { cssModules } from "../../bpk-react-utils";
|
|
20
19
|
import BpkText from "../../bpk-component-text";
|
|
20
|
+
import { cssModules } from "../../bpk-react-utils";
|
|
21
21
|
import STYLES from "./BpkSectionHeader.module.css";
|
|
22
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
23
|
const getClassName = cssModules(STYLES);
|
|
25
24
|
export const SECTION_TYPES = {
|
|
26
25
|
default: 'default',
|
|
@@ -35,13 +34,14 @@ const BpkSectionHeader = ({
|
|
|
35
34
|
className: getClassName('bpk-section-header'),
|
|
36
35
|
children: [/*#__PURE__*/_jsxs("div", {
|
|
37
36
|
className: getClassName('bpk-section-header__title-description', `bpk-section-header__title-description--${type}`),
|
|
38
|
-
children: [/*#__PURE__*/_jsx(
|
|
39
|
-
tagName: "h2",
|
|
37
|
+
children: [/*#__PURE__*/_jsx("h2", {
|
|
40
38
|
className: getClassName('bpk-section-header__title'),
|
|
41
39
|
children: title
|
|
42
|
-
}), description && /*#__PURE__*/_jsx(
|
|
40
|
+
}), description && /*#__PURE__*/_jsx("span", {
|
|
43
41
|
className: getClassName('bpk-section-header__description'),
|
|
44
|
-
children:
|
|
42
|
+
children: /*#__PURE__*/_jsx(BpkText, {
|
|
43
|
+
children: description
|
|
44
|
+
})
|
|
45
45
|
})]
|
|
46
46
|
}), button]
|
|
47
47
|
});
|
|
@@ -15,4 +15,4 @@
|
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
|
-
.bpk-section-header{display:flex;justify-content:space-between;align-items:flex-start;background-color:rgba(0,0,0,0)}.bpk-section-header__title-description{display:flex;flex-direction:column}.bpk-section-header__title-description--default{color:#161616}.bpk-section-header__title-description--on-dark{color:#fff}.bpk-section-header__title{font-size:2rem;line-height:2.5rem;font-weight:700}@media(max-width: 32rem){.bpk-section-header__title{font-size:1.5rem;line-height:1.75rem;font-weight:700}}.bpk-section-header__description{padding-top:.25rem}
|
|
18
|
+
.bpk-section-header{display:flex;justify-content:space-between;align-items:flex-start;background-color:rgba(0,0,0,0)}.bpk-section-header__title-description{display:flex;flex-direction:column}.bpk-section-header__title-description--default{color:#161616}.bpk-section-header__title-description--on-dark{color:#fff}.bpk-section-header__title{margin:0;font-size:2rem;line-height:2.5rem;font-weight:700}@media(max-width: 32rem){.bpk-section-header__title{font-size:1.5rem;line-height:1.75rem;font-weight:700}}.bpk-section-header__description{padding-top:.25rem}
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/import BpkSectionList from "./src/BpkSectionList";
|
|
18
|
-
import BpkSectionListSection from "./src/BpkSectionListSection";
|
|
19
18
|
import BpkSectionListItem from "./src/BpkSectionListItem";
|
|
19
|
+
import BpkSectionListSection from "./src/BpkSectionListSection";
|
|
20
20
|
export default BpkSectionList;
|
|
21
21
|
export { BpkSectionListSection, BpkSectionListItem };
|
|
@@ -15,12 +15,11 @@
|
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/import PropTypes from 'prop-types';
|
|
18
|
-
import { cssModules } from "../../bpk-react-utils";
|
|
19
|
-
import BpkLargeChevronRightIcon from "../../bpk-component-icon/lg/chevron-right";
|
|
20
18
|
import { withRtlSupport } from "../../bpk-component-icon";
|
|
19
|
+
import BpkLargeChevronRightIcon from "../../bpk-component-icon/lg/chevron-right";
|
|
20
|
+
import { cssModules } from "../../bpk-react-utils";
|
|
21
21
|
import STYLES from "./BpkSectionListItem.module.css";
|
|
22
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
23
|
const BpkLargeChevronRightIconWithRtlSupport = withRtlSupport(BpkLargeChevronRightIcon);
|
|
25
24
|
const getClassName = cssModules(STYLES);
|
|
26
25
|
const BpkSectionListItem = props => {
|
|
@@ -44,8 +43,9 @@ const BpkSectionListItem = props => {
|
|
|
44
43
|
onClick: onClick,
|
|
45
44
|
className: classNames.join(' '),
|
|
46
45
|
...rest,
|
|
47
|
-
children: [children, /*#__PURE__*/_jsx(
|
|
48
|
-
className: getClassName('bpk-section-list-item__chevron')
|
|
46
|
+
children: [children, /*#__PURE__*/_jsx("span", {
|
|
47
|
+
className: getClassName('bpk-section-list-item__chevron'),
|
|
48
|
+
children: /*#__PURE__*/_jsx(BpkLargeChevronRightIconWithRtlSupport, {})
|
|
49
49
|
})]
|
|
50
50
|
})
|
|
51
51
|
);
|
|
@@ -59,8 +59,9 @@ const BpkSectionListItem = props => {
|
|
|
59
59
|
onClick: onClick,
|
|
60
60
|
className: classNames.join(' '),
|
|
61
61
|
...rest,
|
|
62
|
-
children: [children, /*#__PURE__*/_jsx(
|
|
63
|
-
className: getClassName('bpk-section-list-item__chevron')
|
|
62
|
+
children: [children, /*#__PURE__*/_jsx("span", {
|
|
63
|
+
className: getClassName('bpk-section-list-item__chevron'),
|
|
64
|
+
children: /*#__PURE__*/_jsx(BpkLargeChevronRightIconWithRtlSupport, {})
|
|
64
65
|
})]
|
|
65
66
|
})
|
|
66
67
|
);
|
|
@@ -15,4 +15,4 @@
|
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
|
-
.bpk-section-list-item{display:flex;width:100%;min-height:4rem;padding:.5rem 1rem;justify-content:space-between;align-items:center;border:none;background-color:#fff;color:#161616;text-decoration:none;box-shadow:0 -1px 0 0 #c1c7cf inset}.bpk-section-list-item--interactive{cursor:pointer}.bpk-section-list-item__chevron{fill:#626971}.bpk-section-list-item:hover .bpk-section-list-item__chevron{fill:#161616}.bpk-section-list-item:active .bpk-section-list-item__chevron{fill:#161616}
|
|
18
|
+
.bpk-section-list-item{display:flex;width:100%;min-height:4rem;padding:.5rem 1rem;justify-content:space-between;align-items:center;border:none;background-color:#fff;color:#161616;text-decoration:none;box-shadow:0 -1px 0 0 #c1c7cf inset}.bpk-section-list-item--interactive{cursor:pointer}.bpk-section-list-item__chevron{display:contents;fill:#626971}.bpk-section-list-item:hover .bpk-section-list-item__chevron{fill:#161616}.bpk-section-list-item:active .bpk-section-list-item__chevron{fill:#161616}
|
|
@@ -16,11 +16,10 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/import PropTypes from 'prop-types';
|
|
18
18
|
import { Children } from 'react';
|
|
19
|
-
import { cssModules } from "../../bpk-react-utils";
|
|
20
19
|
import BpkText, { TEXT_STYLES } from "../../bpk-component-text";
|
|
20
|
+
import { cssModules } from "../../bpk-react-utils";
|
|
21
21
|
import STYLES from "./BpkSectionListSection.module.css";
|
|
22
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
23
|
const getClassName = cssModules(STYLES);
|
|
25
24
|
const BpkSectionListSection = props => {
|
|
26
25
|
const {
|
|
@@ -18,8 +18,7 @@
|
|
|
18
18
|
import { cloneElement } from 'react';
|
|
19
19
|
import { cssModules } from "../../bpk-react-utils";
|
|
20
20
|
import STYLES from "./BpkSelect.module.css";
|
|
21
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
21
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
22
|
const getClassName = cssModules(STYLES);
|
|
24
23
|
const BpkSelect = props => {
|
|
25
24
|
const {
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Backpack - Skyscanner's Design System
|
|
3
|
+
*
|
|
4
|
+
* Copyright 2016 Skyscanner Ltd
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import BpkSkeleton from "./src/BpkSkeleton";
|
|
20
|
+
export { SIZE_TYPES, SKELETON_TYPES, IMAGE_SKELETON_STYLE } from "./src/common-types";
|
|
21
|
+
export default BpkSkeleton;
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Backpack - Skyscanner's Design System
|
|
3
|
+
*
|
|
4
|
+
* Copyright 2016 Skyscanner Ltd
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import { cssModules } from "../../bpk-react-utils";
|
|
20
|
+
import STYLES from "./BpkBaseSkeleton.module.css";
|
|
21
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
|
+
const getClassName = cssModules(STYLES);
|
|
23
|
+
const BpkBaseSkeleton = ({
|
|
24
|
+
skeletonStyle,
|
|
25
|
+
styleObj = undefined
|
|
26
|
+
}) => /*#__PURE__*/_jsx("div", {
|
|
27
|
+
className: getClassName('bpk-skeleton', skeletonStyle),
|
|
28
|
+
style: styleObj
|
|
29
|
+
});
|
|
30
|
+
export default BpkBaseSkeleton;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Backpack - Skyscanner's Design System
|
|
3
|
+
*
|
|
4
|
+
* Copyright 2016 Skyscanner Ltd
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
.bpk-skeleton{width:6rem;height:6rem;background:#e0e4e9;background-image:linear-gradient(to right, rgba(255, 255, 255, 0) 7.08%, rgba(255, 255, 255, 0.6) 49.22%, rgba(255, 255, 255, 0) 100%);background-repeat:no-repeat;animation:shimmer-animation 1600ms infinite linear;animation-direction:normal}html[dir=rtl] .bpk-skeleton{animation-direction:reverse}@keyframes shimmer-animation{0%{background-position:-24rem 0}100%{background-position:24rem 0}}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Backpack - Skyscanner's Design System
|
|
3
|
+
*
|
|
4
|
+
* Copyright 2016 Skyscanner Ltd
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
import { cssModules } from "../../bpk-react-utils";
|
|
20
|
+
import BpkBaseSkeleton from "./BpkBaseSkeleton";
|
|
21
|
+
import { SKELETON_TYPES, IMAGE_SKELETON_STYLE, SIZE_TYPES } from "./common-types";
|
|
22
|
+
import STYLES from "./BpkSkeleton.module.css";
|
|
23
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
|
+
const getClassName = cssModules(STYLES);
|
|
25
|
+
const BpkSkeleton = props => {
|
|
26
|
+
const {
|
|
27
|
+
size = SIZE_TYPES.default,
|
|
28
|
+
type
|
|
29
|
+
} = props;
|
|
30
|
+
const isImageRounded = type === SKELETON_TYPES.image && props.style === IMAGE_SKELETON_STYLE.rounded;
|
|
31
|
+
const classNames = getClassName(`bpk-skeleton__${type}`, typeof size !== 'object' && `bpk-skeleton__${type}--${size}`, isImageRounded && 'bpk-skeleton__image--rounded');
|
|
32
|
+
const styleObj = typeof size === 'object' ? size : undefined;
|
|
33
|
+
return /*#__PURE__*/_jsx(BpkBaseSkeleton, {
|
|
34
|
+
skeletonStyle: classNames,
|
|
35
|
+
styleObj: styleObj
|
|
36
|
+
});
|
|
37
|
+
};
|
|
38
|
+
export default BpkSkeleton;
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Backpack - Skyscanner's Design System
|
|
3
|
+
*
|
|
4
|
+
* Copyright 2016 Skyscanner Ltd
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
.bpk-skeleton__image{width:6rem;height:6rem}.bpk-skeleton__image--rounded{border-radius:.5rem}.bpk-skeleton__headline{width:5rem;border-radius:.25rem}.bpk-skeleton__headline--small{height:.5rem;border-radius:.125rem}.bpk-skeleton__headline--default{height:1rem;border-radius:.25rem}.bpk-skeleton__headline--large{height:2rem;border-radius:.25rem}.bpk-skeleton__circle{border-radius:50%}.bpk-skeleton__circle--small{width:2rem;height:2rem}.bpk-skeleton__circle--default{width:3rem;height:3rem}.bpk-skeleton__bodyText{height:.5rem;border-radius:.125rem}.bpk-skeleton__bodyText--small{width:7.125rem}.bpk-skeleton__bodyText--default{width:10.6875rem}.bpk-skeleton__bodyText--large{width:12.5rem}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Backpack - Skyscanner's Design System
|
|
3
|
+
*
|
|
4
|
+
* Copyright 2016 Skyscanner Ltd
|
|
5
|
+
*
|
|
6
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
7
|
+
* you may not use this file except in compliance with the License.
|
|
8
|
+
* You may obtain a copy of the License at
|
|
9
|
+
*
|
|
10
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
11
|
+
*
|
|
12
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
13
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
14
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
|
+
* See the License for the specific language governing permissions and
|
|
16
|
+
* limitations under the License.
|
|
17
|
+
*/
|
|
18
|
+
|
|
19
|
+
export const SIZE_TYPES = {
|
|
20
|
+
small: 'small',
|
|
21
|
+
default: 'default',
|
|
22
|
+
large: 'large'
|
|
23
|
+
};
|
|
24
|
+
export const SKELETON_TYPES = {
|
|
25
|
+
image: 'image',
|
|
26
|
+
bodyText: 'bodyText',
|
|
27
|
+
circle: 'circle',
|
|
28
|
+
headline: 'headline'
|
|
29
|
+
};
|
|
30
|
+
export const IMAGE_SKELETON_STYLE = {
|
|
31
|
+
rounded: 'rounded',
|
|
32
|
+
default: 'default'
|
|
33
|
+
};
|
|
@@ -16,9 +16,10 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
+
import PropTypes from 'prop-types';
|
|
20
|
+
|
|
19
21
|
// @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
|
|
20
22
|
import Slider from 'react-slider';
|
|
21
|
-
import PropTypes from 'prop-types';
|
|
22
23
|
import { cssModules, isRTL } from "../../bpk-react-utils";
|
|
23
24
|
import STYLES from "./BpkSlider.module.css";
|
|
24
25
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -14,9 +14,9 @@
|
|
|
14
14
|
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
|
-
*/import
|
|
18
|
-
import SPINNER_TYPES from "./src/spinnerTypes";
|
|
17
|
+
*/import BpkExtraLargeSpinner from "./src/BpkExtraLargeSpinner";
|
|
19
18
|
import BpkLargeSpinner from "./src/BpkLargeSpinner";
|
|
20
|
-
import
|
|
19
|
+
import BpkSpinner from "./src/BpkSpinner";
|
|
20
|
+
import SPINNER_TYPES from "./src/spinnerTypes";
|
|
21
21
|
import themeAttributes from "./src/themeAttributes";
|
|
22
22
|
export { BpkSpinner, BpkLargeSpinner, BpkExtraLargeSpinner, SPINNER_TYPES, themeAttributes };
|
|
@@ -75,10 +75,9 @@ XlSpinner.defaultProps = {
|
|
|
75
75
|
viewBox: "0 0 32 32"
|
|
76
76
|
};
|
|
77
77
|
import { cssModules } from "../../bpk-react-utils";
|
|
78
|
-
import STYLES from "./BpkSpinner.module.css";
|
|
79
78
|
import SPINNER_TYPES from "./spinnerTypes";
|
|
80
|
-
import
|
|
81
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
79
|
+
import STYLES from "./BpkSpinner.module.css";
|
|
80
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
82
81
|
const getClassName = cssModules(STYLES);
|
|
83
82
|
const BpkExtraLargeSpinner = props => {
|
|
84
83
|
const {
|
|
@@ -87,11 +86,13 @@ const BpkExtraLargeSpinner = props => {
|
|
|
87
86
|
...rest
|
|
88
87
|
} = props;
|
|
89
88
|
const classNames = getClassName('bpk-spinner', 'bpk-spinner--extra-large', `bpk-spinner--${type}`, className);
|
|
90
|
-
|
|
91
|
-
// $FlowFixMe[cannot-spread-inexact] - inexact rest. See 'decisions/flowfixme.md'.
|
|
92
|
-
return /*#__PURE__*/_jsx(XlSpinner, {
|
|
89
|
+
return /*#__PURE__*/_jsx("span", {
|
|
93
90
|
className: classNames,
|
|
94
|
-
|
|
91
|
+
children: /*#__PURE__*/_jsx(XlSpinner
|
|
92
|
+
// $FlowFixMe[cannot-spread-inexact] - inexact rest. See 'decisions/flowfixme.md'.
|
|
93
|
+
, {
|
|
94
|
+
...rest
|
|
95
|
+
})
|
|
95
96
|
});
|
|
96
97
|
};
|
|
97
98
|
BpkExtraLargeSpinner.propTypes = {
|