@skyscanner/backpack-web 33.3.1 → 34.0.0-premajor
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 +5 -19
- package/bpk-component-breakpoint/src/useMediaQuery.js +10 -12
- 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 +3 -2
- 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-flare/src/__generated__/corner-radius.d.ts +6 -0
- package/bpk-component-flare/src/__generated__/pointer.d.ts +6 -0
- 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/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/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/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/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 +4 -1
- 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 +5 -2
- 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 +8 -3
- 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 +5 -2
- package/bpk-component-navigation-bar/src/BpkNavigationBarIconButton.js +5 -2
- package/bpk-component-nudger/index.js +1 -1
- package/bpk-component-nudger/src/BpkConfigurableNudger.js +17 -6
- package/bpk-component-nudger/src/BpkNudger.js +17 -7
- 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 +106 -63
- package/bpk-component-popover/src/BpkPopoverPortal.js +123 -119
- 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 +4 -1
- 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 +10 -5
- package/bpk-component-section-list/index.js +1 -1
- package/bpk-component-section-list/src/BpkSectionListItem.js +11 -6
- package/bpk-component-section-list/src/BpkSectionListSection.js +2 -3
- package/bpk-component-select/src/BpkSelect.js +1 -2
- package/bpk-component-slider/src/BpkSlider.js +6 -2
- package/bpk-component-spinner/index.js +3 -3
- package/bpk-component-spinner/src/BpkExtraLargeSpinner.js +9 -7
- package/bpk-component-spinner/src/BpkLargeSpinner.js +9 -7
- package/bpk-component-spinner/src/BpkSpinner.js +9 -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 -2
- package/bpk-component-star-rating/src/BpkInteractiveStarRating.js +1 -1
- package/bpk-component-star-rating/src/BpkStar.js +22 -15
- 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 +6 -4
- 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 +5 -3
- package/unstable__bpk-mixins/_chips.scss +9 -0
- package/bpk-component-button/src/commonButtonTests.js +0 -133
|
@@ -16,6 +16,6 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/import BpkAccordion from "./src/BpkAccordion";
|
|
18
18
|
import BpkAccordionItem from "./src/BpkAccordionItem";
|
|
19
|
-
import withSingleItemAccordionState from "./src/withSingleItemAccordionState";
|
|
20
19
|
import withAccordionItemState from "./src/withAccordionItemState";
|
|
20
|
+
import withSingleItemAccordionState from "./src/withSingleItemAccordionState";
|
|
21
21
|
export { BpkAccordion, BpkAccordionItem, withSingleItemAccordionState, withAccordionItemState };
|
|
@@ -23,8 +23,7 @@ import BpkText, { TEXT_STYLES } from "../../bpk-component-text";
|
|
|
23
23
|
import { cssModules } from "../../bpk-react-utils";
|
|
24
24
|
import { BpkAccordionContext } from "./BpkAccordion";
|
|
25
25
|
import STYLES from "./BpkAccordionItem.module.css";
|
|
26
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
27
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
26
|
+
import { jsxs as _jsxs, jsx as _jsx } from "react/jsx-runtime";
|
|
28
27
|
const getClassName = cssModules(STYLES);
|
|
29
28
|
const ExpandIcon = withButtonAlignment(ChevronDownIcon);
|
|
30
29
|
const BpkAccordionItem = props => {
|
|
@@ -95,18 +94,18 @@ const BpkAccordionItem = props => {
|
|
|
95
94
|
"aria-controls": contentId,
|
|
96
95
|
onClick: onClick,
|
|
97
96
|
className: getClassName('bpk-accordion__toggle-button'),
|
|
98
|
-
children: /*#__PURE__*/_jsxs("
|
|
99
|
-
className: getClassName('bpk-accordion__flex-container')
|
|
100
|
-
children: [/*#__PURE__*/
|
|
101
|
-
textStyle: textStyle,
|
|
102
|
-
tagName: tagName,
|
|
97
|
+
children: /*#__PURE__*/_jsxs("div", {
|
|
98
|
+
className: `${getClassName('bpk-accordion__flex-container')}`,
|
|
99
|
+
children: [/*#__PURE__*/_jsx("div", {
|
|
103
100
|
className: titleTextClassNames.join(' '),
|
|
104
|
-
children:
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
className: iconClassNames.join(' ')
|
|
101
|
+
children: /*#__PURE__*/_jsxs(BpkText, {
|
|
102
|
+
textStyle: textStyle,
|
|
103
|
+
tagName: tagName,
|
|
104
|
+
children: [clonedIcon, title]
|
|
109
105
|
})
|
|
106
|
+
}), /*#__PURE__*/_jsx("span", {
|
|
107
|
+
className: `${getClassName('bpk-accordion__icon-wrapper')} ${iconClassNames.join(' ')}`,
|
|
108
|
+
children: /*#__PURE__*/_jsx(ExpandIcon, {})
|
|
110
109
|
})]
|
|
111
110
|
})
|
|
112
111
|
})
|
|
@@ -136,7 +135,7 @@ BpkAccordionItem.defaultProps = {
|
|
|
136
135
|
expanded: false,
|
|
137
136
|
icon: null,
|
|
138
137
|
onClick: () => null,
|
|
139
|
-
tagName: '
|
|
138
|
+
tagName: 'h3',
|
|
140
139
|
textStyle: TEXT_STYLES.bodyDefault
|
|
141
140
|
};
|
|
142
141
|
export default BpkAccordionItem;
|
|
@@ -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-accordion__title{height:auto}.bpk-accordion__title--collapsed{box-shadow:0 -1px 0 0 #c1c7cf inset}.bpk-accordion__title--collapsed-on-dark{box-shadow:0 -1px 0 0 rgba(255,255,255,.5) inset}.bpk-accordion__toggle-button{width:100%;padding:0;border:0;background-color:rgba(0,0,0,0);color:#161616;text-align:left;cursor:pointer;appearance:none}html[dir=rtl] .bpk-accordion__toggle-button{text-align:right}.bpk-accordion__flex-container{display:inline-flex;width:100%;margin:1rem 0;flex-direction:row}.bpk-accordion__title-text{
|
|
18
|
+
.bpk-accordion__title{height:auto}.bpk-accordion__title--collapsed{box-shadow:0 -1px 0 0 #c1c7cf inset}.bpk-accordion__title--collapsed-on-dark{box-shadow:0 -1px 0 0 rgba(255,255,255,.5) inset}.bpk-accordion__toggle-button{width:100%;padding:0;border:0;background-color:rgba(0,0,0,0);color:#161616;text-align:left;cursor:pointer;appearance:none}html[dir=rtl] .bpk-accordion__toggle-button{text-align:right}.bpk-accordion__flex-container{display:inline-flex;width:100%;margin:1rem 0;flex-direction:row}.bpk-accordion__title-text{flex-grow:1}.bpk-accordion__title-text--on-dark{color:#fff}.bpk-accordion__icon-wrapper{display:inline-block}.bpk-accordion__leading-icon{margin-left:0;margin-right:.5rem}html[dir=rtl] .bpk-accordion__leading-icon{margin-left:.5rem;margin-right:0}.bpk-accordion__item-expand-icon{fill:#161616}.bpk-accordion__item-expand-icon--flipped{transform:scaleY(-1)}.bpk-accordion__item-expand-icon--on-dark{fill:#fff}.bpk-accordion__content-container{margin:0}.bpk-accordion__content-container--expanded{padding-bottom:1rem;box-shadow:0 -1px 0 0 #c1c7cf inset}.bpk-accordion__content-container--expanded-on-dark{padding-bottom:1rem;box-shadow:0 -1px 0 0 rgba(255,255,255,.5) inset}
|
|
@@ -17,8 +17,7 @@
|
|
|
17
17
|
*/import PropTypes from 'prop-types';
|
|
18
18
|
import { cssModules } from "../../bpk-react-utils";
|
|
19
19
|
import STYLES from "./BpkAutosuggest.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 BpkAutosuggestSuggestion = props => {
|
|
24
23
|
const classNames = [getClassName('bpk-autosuggest__suggestion')];
|
|
@@ -44,7 +43,10 @@ const BpkAutosuggestSuggestion = props => {
|
|
|
44
43
|
_jsxs("section", {
|
|
45
44
|
className: classNames.join(' '),
|
|
46
45
|
...rest,
|
|
47
|
-
children: [icon ? /*#__PURE__*/_jsx(Icon
|
|
46
|
+
children: [icon ? /*#__PURE__*/_jsx(Icon
|
|
47
|
+
// TODO: className to be removed
|
|
48
|
+
// eslint-disable-next-line @skyscanner/rules/forbid-component-props
|
|
49
|
+
, {
|
|
48
50
|
className: getClassName('bpk-autosuggest__suggestion-icon')
|
|
49
51
|
}) : null, /*#__PURE__*/_jsx("div", {
|
|
50
52
|
className: getClassName('bpk-autosuggest__suggestion-content'),
|
|
@@ -20,7 +20,7 @@ import BpkBannerAlert from "./src/BpkBannerAlert";
|
|
|
20
20
|
import BpkBannerAlertDismissable from "./src/BpkBannerAlertDismissable";
|
|
21
21
|
import BpkBannerAlertExpandable from "./src/BpkBannerAlertExpandable";
|
|
22
22
|
import { ALERT_TYPES } from "./src/common-types";
|
|
23
|
-
import withBannerAlertState from "./src/withBannerAlertState";
|
|
24
23
|
import themeAttributes from "./src/themeAttributes";
|
|
24
|
+
import withBannerAlertState from "./src/withBannerAlertState";
|
|
25
25
|
export { ALERT_TYPES, BpkBannerAlertDismissable, BpkBannerAlertExpandable, withBannerAlertState, themeAttributes };
|
|
26
26
|
export default BpkBannerAlert;
|
|
@@ -18,22 +18,22 @@
|
|
|
18
18
|
|
|
19
19
|
import { Component } from 'react';
|
|
20
20
|
// @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
|
|
21
|
-
import { durationSm } from '@skyscanner/bpk-foundations-web/tokens/base.es6';
|
|
22
|
-
// @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
|
|
23
21
|
import { TransitionGroup, CSSTransition } from 'react-transition-group';
|
|
24
|
-
|
|
22
|
+
|
|
23
|
+
// @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
|
|
24
|
+
import { durationSm } from '@skyscanner/bpk-foundations-web/tokens/base.es6';
|
|
25
|
+
|
|
25
26
|
// @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
|
|
26
27
|
import BpkAnimateHeight from "../../bpk-animate-height";
|
|
28
|
+
import { cssModules } from "../../bpk-react-utils";
|
|
27
29
|
import STYLES from "./BpkAnimateAndFade.module.css";
|
|
28
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
29
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
30
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
30
31
|
const getClassName = cssModules(STYLES);
|
|
31
32
|
const ANIMATION_DURATION = parseInt(durationSm, 10);
|
|
32
33
|
class AnimateAndFade extends Component {
|
|
33
34
|
static defaultProps = {
|
|
34
35
|
animateOnEnter: false,
|
|
35
|
-
animateOnLeave: false
|
|
36
|
-
className: null
|
|
36
|
+
animateOnLeave: false
|
|
37
37
|
};
|
|
38
38
|
constructor(props) {
|
|
39
39
|
super(props);
|
|
@@ -110,37 +110,39 @@ class AnimateAndFade extends Component {
|
|
|
110
110
|
// While the expanding animation takes place, we render the child element
|
|
111
111
|
// close to invisible. If we don't do this, the animate-height container
|
|
112
112
|
// will take on height 0, and will never expand to allow the children to fade in
|
|
113
|
-
return this.state.inDom ? /*#__PURE__*/
|
|
113
|
+
return this.state.inDom ? /*#__PURE__*/_jsx("div", {
|
|
114
114
|
className: className,
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
children: children
|
|
123
|
-
}), /*#__PURE__*/_jsx(TransitionGroup, {
|
|
124
|
-
exit: animateOnLeave,
|
|
125
|
-
enter: animateOnEnter,
|
|
126
|
-
appear: animateOnEnter,
|
|
127
|
-
onTransitionEnd: this.onFadeComplete,
|
|
128
|
-
children: this.state.visible && /*#__PURE__*/_jsx(CSSTransition, {
|
|
129
|
-
classNames: {
|
|
130
|
-
exit: getClassName('bpk-animate-and-fade--leave'),
|
|
131
|
-
exitActive: getClassName('bpk-animate-and-fade--leave-active'),
|
|
132
|
-
enter: getClassName('bpk-animate-and-fade--enter'),
|
|
133
|
-
enterActive: getClassName('bpk-animate-and-fade--enter-active'),
|
|
134
|
-
appear: getClassName('bpk-animate-and-fade--appear'),
|
|
135
|
-
appearActive: getClassName('bpk-animate-and-fade--appear-active')
|
|
136
|
-
},
|
|
137
|
-
timeout: {
|
|
138
|
-
enter: ANIMATION_DURATION * 2,
|
|
139
|
-
exit: ANIMATION_DURATION * 2
|
|
115
|
+
children: /*#__PURE__*/_jsxs(BpkAnimateHeight, {
|
|
116
|
+
onAnimationComplete: this.onAnimateHeightComplete,
|
|
117
|
+
duration: ANIMATION_DURATION,
|
|
118
|
+
height: this.state.isExpanded ? 'auto' : 0,
|
|
119
|
+
children: [showPlaceholder && /*#__PURE__*/_jsx("div", {
|
|
120
|
+
style: {
|
|
121
|
+
opacity: 0.35
|
|
140
122
|
},
|
|
141
123
|
children: children
|
|
142
|
-
})
|
|
143
|
-
|
|
124
|
+
}), /*#__PURE__*/_jsx(TransitionGroup, {
|
|
125
|
+
exit: animateOnLeave,
|
|
126
|
+
enter: animateOnEnter,
|
|
127
|
+
appear: animateOnEnter,
|
|
128
|
+
onTransitionEnd: this.onFadeComplete,
|
|
129
|
+
children: this.state.visible && /*#__PURE__*/_jsx(CSSTransition, {
|
|
130
|
+
classNames: {
|
|
131
|
+
exit: getClassName('bpk-animate-and-fade--leave'),
|
|
132
|
+
exitActive: getClassName('bpk-animate-and-fade--leave-active'),
|
|
133
|
+
enter: getClassName('bpk-animate-and-fade--enter'),
|
|
134
|
+
enterActive: getClassName('bpk-animate-and-fade--enter-active'),
|
|
135
|
+
appear: getClassName('bpk-animate-and-fade--appear'),
|
|
136
|
+
appearActive: getClassName('bpk-animate-and-fade--appear-active')
|
|
137
|
+
},
|
|
138
|
+
timeout: {
|
|
139
|
+
enter: ANIMATION_DURATION * 2,
|
|
140
|
+
exit: ANIMATION_DURATION * 2
|
|
141
|
+
},
|
|
142
|
+
children: children
|
|
143
|
+
})
|
|
144
|
+
})]
|
|
145
|
+
})
|
|
144
146
|
}) : null;
|
|
145
147
|
}
|
|
146
148
|
}
|
|
@@ -22,23 +22,23 @@
|
|
|
22
22
|
|
|
23
23
|
// @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
|
|
24
24
|
import { durationSm } from '@skyscanner/bpk-foundations-web/tokens/base.es6';
|
|
25
|
-
|
|
25
|
+
|
|
26
26
|
// @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
|
|
27
27
|
import BpkAnimateHeight from "../../bpk-animate-height";
|
|
28
28
|
// @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
|
|
29
29
|
import BpkCloseButton from "../../bpk-component-close-button";
|
|
30
|
-
|
|
31
|
-
import TickCircleIcon from "../../bpk-component-icon/sm/tick-circle";
|
|
30
|
+
import { withButtonAlignment } from "../../bpk-component-icon";
|
|
32
31
|
// @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
|
|
33
32
|
import ChevronDownIcon from "../../bpk-component-icon/lg/chevron-down";
|
|
34
33
|
// @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
|
|
35
34
|
import InfoCircleIcon from "../../bpk-component-icon/sm/information-circle";
|
|
35
|
+
// @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
|
|
36
|
+
import TickCircleIcon from "../../bpk-component-icon/sm/tick-circle";
|
|
36
37
|
import { cssModules } from "../../bpk-react-utils";
|
|
37
38
|
import AnimateAndFade from "./AnimateAndFade";
|
|
38
39
|
import { ALERT_TYPES } from "./common-types";
|
|
39
40
|
import STYLES from "./BpkBannerAlert.module.css";
|
|
40
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
41
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
41
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
42
42
|
const getClassName = cssModules(STYLES);
|
|
43
43
|
const ExpandIcon = withButtonAlignment(ChevronDownIcon);
|
|
44
44
|
export const CONFIGURATION = {
|
|
@@ -64,6 +64,9 @@ const getIconForType = (type, CustomIcon) => {
|
|
|
64
64
|
};
|
|
65
65
|
const Icon = CustomIcon || componentMap[type];
|
|
66
66
|
const AlignedIcon = withButtonAlignment(Icon);
|
|
67
|
+
|
|
68
|
+
// TODO: className to be removed
|
|
69
|
+
// eslint-disable-next-line @skyscanner/rules/forbid-component-props
|
|
67
70
|
return /*#__PURE__*/_jsx(AlignedIcon, {
|
|
68
71
|
className: className
|
|
69
72
|
});
|
|
@@ -79,7 +82,10 @@ const ToggleButton = props => {
|
|
|
79
82
|
"aria-label": props.label,
|
|
80
83
|
"aria-expanded": props.expanded,
|
|
81
84
|
title: props.label,
|
|
82
|
-
children: /*#__PURE__*/_jsx(ExpandIcon
|
|
85
|
+
children: /*#__PURE__*/_jsx(ExpandIcon
|
|
86
|
+
// TODO: className to be removed
|
|
87
|
+
// eslint-disable-next-line @skyscanner/rules/forbid-component-props
|
|
88
|
+
, {
|
|
83
89
|
className: classNames.join(' ')
|
|
84
90
|
})
|
|
85
91
|
});
|
|
@@ -15,26 +15,25 @@
|
|
|
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 debounce from 'lodash.debounce';
|
|
19
18
|
import { Component } from 'react';
|
|
20
19
|
import { scaleLinear, scaleBand } from 'd3-scale';
|
|
20
|
+
import debounce from 'lodash.debounce';
|
|
21
21
|
import { lineHeightSm } from '@skyscanner/bpk-foundations-web/tokens/base.es6';
|
|
22
|
-
import { cssModules } from "../../bpk-react-utils";
|
|
23
22
|
import BpkMobileScrollContainer from "../../bpk-component-mobile-scroll-container";
|
|
24
|
-
import
|
|
23
|
+
import { cssModules } from "../../bpk-react-utils";
|
|
24
|
+
import BpkBarchartBar from "./BpkBarchartBar";
|
|
25
25
|
import BpkBarchartBars from "./BpkBarchartBars";
|
|
26
|
-
import
|
|
27
|
-
import BpkChartMargin from "./BpkChartMargin";
|
|
26
|
+
import BpkBarchartDefs from "./BpkBarchartDefs";
|
|
28
27
|
import BpkChartAxis from "./BpkChartAxis";
|
|
28
|
+
import BpkChartDataTable from "./BpkChartDataTable";
|
|
29
29
|
import BpkChartGridLines from "./BpkChartGridLines";
|
|
30
|
-
import
|
|
31
|
-
import dataProp from "./customPropTypes";
|
|
32
|
-
import { identity, remToPx } from "./utils";
|
|
30
|
+
import BpkChartMargin from "./BpkChartMargin";
|
|
33
31
|
import { applyArrayRTLTransform, applyMarginRTLTransform } from "./RTLtransforms";
|
|
32
|
+
import dataProp from "./customPropTypes";
|
|
34
33
|
import { ORIENTATION_X, ORIENTATION_Y } from "./orientation";
|
|
34
|
+
import { identity, remToPx } from "./utils";
|
|
35
35
|
import STYLES from "./BpkBarchart.module.css";
|
|
36
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
37
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
36
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
38
37
|
const getClassName = cssModules(STYLES);
|
|
39
38
|
const spacing = remToPx('.375rem');
|
|
40
39
|
const lineHeight = remToPx(lineHeightSm);
|
|
@@ -19,8 +19,7 @@ import { borderRadiusXs } from '@skyscanner/bpk-foundations-web/tokens/base.es6'
|
|
|
19
19
|
import { cssModules } from "../../bpk-react-utils";
|
|
20
20
|
import { remToPx } from "./utils";
|
|
21
21
|
import STYLES from "./BpkBarchartBar.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 KEYCODES = {
|
|
26
25
|
ENTER: 13,
|
|
@@ -14,8 +14,8 @@
|
|
|
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
|
|
17
|
+
*/import PropTypes from 'prop-types';
|
|
18
|
+
import { scaleBand, scaleLinear } from 'd3-scale';
|
|
19
19
|
import { borderRadiusXs } from '@skyscanner/bpk-foundations-web/tokens/base.es6';
|
|
20
20
|
import BpkBarchartBar from "./BpkBarchartBar";
|
|
21
21
|
import { remToPx } from "./utils";
|
|
@@ -21,8 +21,7 @@ import { rtlConditionalValue } from "./RTLtransforms";
|
|
|
21
21
|
import { ORIENTATION_X, ORIENTATION_Y } from "./orientation";
|
|
22
22
|
import { identity, center, remToPx } from "./utils";
|
|
23
23
|
import STYLES from "./BpkChartAxis.module.css";
|
|
24
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
26
25
|
const getClassName = cssModules(STYLES);
|
|
27
26
|
const spacing = remToPx('.375rem');
|
|
28
27
|
const lineHeight = remToPx(lineHeightSm);
|
|
@@ -18,8 +18,7 @@
|
|
|
18
18
|
import { cssModules } from "../../bpk-react-utils";
|
|
19
19
|
import dataProp from "./customPropTypes";
|
|
20
20
|
import STYLES from "./BpkChartDataTable.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 BpkChartDataTable = props => {
|
|
25
24
|
const {
|
|
@@ -19,16 +19,14 @@
|
|
|
19
19
|
import { useState } from "react";
|
|
20
20
|
import BpkBreakpoint, { BREAKPOINTS } from "../../bpk-component-breakpoint";
|
|
21
21
|
// @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
|
|
22
|
-
import { BpkButtonLink } from "../../bpk-component-link";
|
|
23
|
-
// @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
|
|
24
22
|
import BpkCloseButton from "../../bpk-component-close-button";
|
|
25
|
-
|
|
23
|
+
// @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
|
|
24
|
+
import { BpkButtonLink } from "../../bpk-component-link";
|
|
26
25
|
import BpkNavigationBar from "../../bpk-component-navigation-bar";
|
|
27
26
|
import BpkText, { TEXT_STYLES } from "../../bpk-component-text/src/BpkText";
|
|
27
|
+
import { BpkDialogWrapper, cssModules } from "../../bpk-react-utils";
|
|
28
28
|
import STYLES from "./BpkBottomSheet.module.css";
|
|
29
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
30
|
-
import { Fragment as _Fragment } from "react/jsx-runtime";
|
|
31
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
29
|
+
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
32
30
|
const getClassName = cssModules(STYLES);
|
|
33
31
|
const BpkBottomSheet = ({
|
|
34
32
|
actionText = '',
|
|
@@ -18,8 +18,7 @@
|
|
|
18
18
|
import { Component, Fragment } from 'react';
|
|
19
19
|
import { cssModules } from "../../bpk-react-utils";
|
|
20
20
|
import STYLES from "./BpkBreadcrumb.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
|
/*
|
|
25
24
|
The google structured data reference for the stringified output of
|
|
@@ -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 { withRtlSupport } from "../../bpk-component-icon";
|
|
19
|
+
import ArrowRight from "../../bpk-component-icon/sm/arrow-right";
|
|
18
20
|
import BpkLink from "../../bpk-component-link";
|
|
19
21
|
import BpkText from "../../bpk-component-text";
|
|
20
22
|
import { cssModules } from "../../bpk-react-utils";
|
|
21
|
-
import { withRtlSupport } from "../../bpk-component-icon";
|
|
22
|
-
import ArrowRight from "../../bpk-component-icon/sm/arrow-right";
|
|
23
23
|
import STYLES from "./BpkBreadcrumbItem.module.css";
|
|
24
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
|
-
import { jsxs as _jsxs } from "react/jsx-runtime";
|
|
24
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
26
25
|
const getClassName = cssModules(STYLES);
|
|
27
26
|
const RtlSupportedArrowRight = withRtlSupport(ArrowRight);
|
|
28
27
|
const BpkBreadcrumbItem = props => {
|
|
@@ -43,21 +42,26 @@ const BpkBreadcrumbItem = props => {
|
|
|
43
42
|
children: [active ?
|
|
44
43
|
/*#__PURE__*/
|
|
45
44
|
// $FlowFixMe[cannot-spread-inexact] - inexact rest. See 'decisions/flowfixme.md'.
|
|
46
|
-
_jsx(
|
|
45
|
+
_jsx("div", {
|
|
47
46
|
className: getClassName('bpk-breadcrumb-item__active-item'),
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
47
|
+
children: /*#__PURE__*/_jsx(BpkText, {
|
|
48
|
+
"aria-current": "page",
|
|
49
|
+
...linkProps,
|
|
50
|
+
children: children
|
|
51
|
+
})
|
|
51
52
|
}) :
|
|
52
53
|
/*#__PURE__*/
|
|
53
54
|
// $FlowFixMe[cannot-spread-inexact] - inexact rest. See 'decisions/flowfixme.md'.
|
|
54
|
-
_jsx(
|
|
55
|
-
href: href,
|
|
55
|
+
_jsx("div", {
|
|
56
56
|
className: getClassName('bpk-breadcrumb-item__link'),
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
57
|
+
children: /*#__PURE__*/_jsx(BpkLink, {
|
|
58
|
+
href: href,
|
|
59
|
+
...linkProps,
|
|
60
|
+
children: children
|
|
61
|
+
})
|
|
62
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
63
|
+
className: getClassName('bpk-breadcrumb-item__arrow'),
|
|
64
|
+
children: !active && /*#__PURE__*/_jsx(RtlSupportedArrowRight, {})
|
|
61
65
|
})]
|
|
62
66
|
})
|
|
63
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-breadcrumb-item{display:flex;align-items:center;white-space:nowrap}.bpk-breadcrumb-item__link{margin:0}.bpk-breadcrumb-item__active-item{color:#626971}.bpk-breadcrumb-item__arrow{margin:0 .25rem;fill:rgba(0,0,0,.2)}
|
|
18
|
+
.bpk-breadcrumb-item{display:flex;align-items:center;white-space:nowrap}.bpk-breadcrumb-item__link{margin:0}.bpk-breadcrumb-item__active-item{color:#626971}.bpk-breadcrumb-item__arrow{margin:0 .25rem;line-height:.5rem;fill:rgba(0,0,0,.2)}
|
|
@@ -16,7 +16,6 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import { useState, useEffect } from 'react';
|
|
20
19
|
// @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
|
|
21
20
|
import { breakpoints } from '@skyscanner/bpk-foundations-web/tokens/base.es6';
|
|
22
21
|
import useMediaQuery from "./useMediaQuery";
|
|
@@ -38,27 +37,14 @@ const BpkBreakpoint = ({
|
|
|
38
37
|
matchSSR = false,
|
|
39
38
|
query
|
|
40
39
|
}) => {
|
|
41
|
-
const
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
setIsClient(true);
|
|
45
|
-
}, []);
|
|
46
|
-
if (isClient) {
|
|
47
|
-
if (!legacy && !Object.values(BREAKPOINTS).includes(query)) {
|
|
48
|
-
console.warn(`Invalid query ${query}. Use one of the supported queries or pass the legacy prop.`);
|
|
49
|
-
}
|
|
50
|
-
if (typeof children === 'function') {
|
|
51
|
-
return children(matches);
|
|
52
|
-
}
|
|
53
|
-
return matches ? children : null;
|
|
40
|
+
const matches = useMediaQuery(query, matchSSR);
|
|
41
|
+
if (!legacy && !Object.values(BREAKPOINTS).includes(query)) {
|
|
42
|
+
console.warn(`Invalid query ${query}. Use one of the supported queries or pass the legacy prop.`);
|
|
54
43
|
}
|
|
55
|
-
|
|
56
|
-
// Below code is executed when running in SSR mode
|
|
57
|
-
|
|
58
44
|
if (typeof children === 'function') {
|
|
59
|
-
return children(
|
|
45
|
+
return children(matches);
|
|
60
46
|
}
|
|
61
|
-
return
|
|
47
|
+
return matches ? children : null;
|
|
62
48
|
};
|
|
63
49
|
export { BREAKPOINTS };
|
|
64
50
|
export default BpkBreakpoint;
|
|
@@ -16,20 +16,18 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import {
|
|
20
|
-
const useMediaQuery = query => {
|
|
21
|
-
const
|
|
19
|
+
import { useEffect, useState } from 'react';
|
|
20
|
+
const useMediaQuery = (query, matchSSR = false) => {
|
|
21
|
+
const isClient = typeof window !== 'undefined' && !!window.matchMedia;
|
|
22
|
+
const [matches, setMatches] = useState(isClient ? window.matchMedia(query).matches : matchSSR);
|
|
22
23
|
useEffect(() => {
|
|
23
|
-
|
|
24
|
-
|
|
24
|
+
const media = window.matchMedia(query);
|
|
25
|
+
setMatches(media.matches);
|
|
26
|
+
const listener = () => {
|
|
25
27
|
setMatches(media.matches);
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
media.addEventListener('change', listener);
|
|
30
|
-
return () => media.removeEventListener('change', listener);
|
|
31
|
-
}
|
|
32
|
-
return undefined;
|
|
28
|
+
};
|
|
29
|
+
media.addEventListener('change', listener);
|
|
30
|
+
return () => media.removeEventListener('change', listener);
|
|
33
31
|
}, [query]);
|
|
34
32
|
return matches;
|
|
35
33
|
};
|
|
@@ -15,16 +15,16 @@
|
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/import BpkButton from "./src/BpkButton"; // eslint-disable-line import/no-cycle
|
|
18
|
-
import
|
|
18
|
+
import BpkButtonDestructive from "./src/BpkButtonDestructive";
|
|
19
|
+
import BpkButtonFeatured from "./src/BpkButtonFeatured";
|
|
20
|
+
import BpkButtonLink from "./src/BpkButtonLink";
|
|
21
|
+
import BpkButtonLinkOnDark from "./src/BpkButtonLinkOnDark";
|
|
19
22
|
import BpkButtonPrimary from "./src/BpkButtonPrimary";
|
|
20
23
|
import BpkButtonPrimaryOnDark from "./src/BpkButtonPrimaryOnDark";
|
|
21
24
|
import BpkButtonPrimaryOnLight from "./src/BpkButtonPrimaryOnLight";
|
|
22
25
|
import BpkButtonSecondary from "./src/BpkButtonSecondary";
|
|
23
26
|
import BpkButtonSecondaryOnDark from "./src/BpkButtonSecondaryOnDark";
|
|
24
|
-
import
|
|
25
|
-
import BpkButtonLink from "./src/BpkButtonLink";
|
|
26
|
-
import BpkButtonLinkOnDark from "./src/BpkButtonLinkOnDark";
|
|
27
|
-
import BpkButtonFeatured from "./src/BpkButtonFeatured";
|
|
27
|
+
import { BpkButtonV2 } from "./src/BpkButtonV2/BpkButton";
|
|
28
28
|
export { BUTTON_TYPES, SIZE_TYPES } from "./src/BpkButtonV2/common-types";
|
|
29
29
|
export { buttonThemeAttributes, primaryThemeAttributes, primaryOnDarkThemeAttributes, primaryOnLightThemeAttributes, secondaryThemeAttributes, secondaryOnDarkThemeAttributes, featuredThemeAttributes, destructiveThemeAttributes } from "./themeAttributes";
|
|
30
30
|
export default BpkButton;
|
|
@@ -14,8 +14,8 @@
|
|
|
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
|
|
17
|
+
*/import BpkButtonBase, { cssModules } from "./BpkButtonBase";
|
|
18
|
+
import { defaultProps, propTypes } from "./common-types";
|
|
19
19
|
import STYLES from "./BpkButtonDestructive.module.css";
|
|
20
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
21
|
const getClassName = cssModules(STYLES);
|
|
@@ -29,14 +29,15 @@ const BpkButtonDestructive = props => {
|
|
|
29
29
|
classNames.push(className);
|
|
30
30
|
}
|
|
31
31
|
const classNamesFinal = classNames.join(' ');
|
|
32
|
-
return (
|
|
33
|
-
|
|
32
|
+
return /*#__PURE__*/_jsx(BpkButtonBase
|
|
33
|
+
// TODO: className to be removed
|
|
34
|
+
// eslint-disable-next-line @skyscanner/rules/forbid-component-props
|
|
35
|
+
, {
|
|
36
|
+
className: classNamesFinal
|
|
34
37
|
// $FlowFixMe[cannot-spread-inexact] - inexact rest. See 'decisions/flowfixme.md'.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
})
|
|
39
|
-
);
|
|
38
|
+
,
|
|
39
|
+
...rest
|
|
40
|
+
});
|
|
40
41
|
};
|
|
41
42
|
BpkButtonDestructive.propTypes = {
|
|
42
43
|
...propTypes
|
|
@@ -14,8 +14,8 @@
|
|
|
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
|
|
17
|
+
*/import BpkButtonBase, { cssModules } from "./BpkButtonBase";
|
|
18
|
+
import { defaultProps, propTypes } from "./common-types";
|
|
19
19
|
import STYLES from "./BpkButtonFeatured.module.css";
|
|
20
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
21
|
const getClassName = cssModules(STYLES);
|
|
@@ -29,14 +29,15 @@ const BpkButtonFeatured = props => {
|
|
|
29
29
|
classNames.push(className);
|
|
30
30
|
}
|
|
31
31
|
const classNamesFinal = classNames.join(' ');
|
|
32
|
-
return (
|
|
33
|
-
|
|
32
|
+
return /*#__PURE__*/_jsx(BpkButtonBase
|
|
33
|
+
// TODO: className to be removed
|
|
34
|
+
// eslint-disable-next-line @skyscanner/rules/forbid-component-props
|
|
35
|
+
, {
|
|
36
|
+
className: classNamesFinal
|
|
34
37
|
// $FlowFixMe[cannot-spread-inexact] - inexact rest. See 'decisions/flowfixme.md'.
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
})
|
|
39
|
-
);
|
|
38
|
+
,
|
|
39
|
+
...rest
|
|
40
|
+
});
|
|
40
41
|
};
|
|
41
42
|
BpkButtonFeatured.propTypes = {
|
|
42
43
|
...propTypes
|