@skyscanner/backpack-web 34.16.0-preminor.2 → 35.0.0-premajor.1
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-aria-live/src/BpkAriaLive.d.ts +1 -1
- package/bpk-component-badge/src/BpkBadge.d.ts +1 -1
- package/bpk-component-banner-alert/src/AnimateAndFade.d.ts +1 -1
- package/bpk-component-banner-alert/src/BpkBannerAlert.d.ts +1 -1
- package/bpk-component-banner-alert/src/BpkBannerAlertDismissable.d.ts +1 -1
- package/bpk-component-banner-alert/src/BpkBannerAlertExpandable.d.ts +1 -1
- package/bpk-component-banner-alert/src/BpkBannerAlertInner.d.ts +1 -1
- package/bpk-component-banner-alert/src/withBannerAlertState.d.ts +5 -3
- package/bpk-component-boilerplate/src/BpkBoilerplate.d.ts +1 -1
- package/bpk-component-bottom-sheet/src/BpkBottomSheet.d.ts +1 -1
- package/bpk-component-button/BpkButtonDestructive.d.ts +1 -1
- package/bpk-component-button/BpkButtonFeatured.d.ts +1 -1
- package/bpk-component-button/BpkButtonLink.d.ts +1 -1
- package/bpk-component-button/BpkButtonLinkOnDark.d.ts +1 -1
- package/bpk-component-button/BpkButtonPrimary.d.ts +1 -1
- package/bpk-component-button/BpkButtonPrimaryOnDark.d.ts +1 -1
- package/bpk-component-button/BpkButtonPrimaryOnLight.d.ts +1 -1
- package/bpk-component-button/BpkButtonSecondary.d.ts +1 -1
- package/bpk-component-button/BpkButtonSecondaryOnDark.d.ts +1 -1
- package/bpk-component-button/src/BpkButton.d.ts +1 -1
- package/bpk-component-button/src/BpkButtonBase.d.ts +1 -1
- package/bpk-component-button/src/BpkButtonV2/BpkButton.d.ts +1 -1
- package/bpk-component-calendar/src/BpkCalendarContainer.d.ts +10 -6
- package/bpk-component-calendar/src/BpkCalendarDate.d.ts +1 -1
- package/bpk-component-calendar/src/BpkCalendarGrid.d.ts +2 -2
- package/bpk-component-calendar/src/BpkCalendarGridHeader.d.ts +1 -1
- package/bpk-component-calendar/src/BpkCalendarGridTransition.d.ts +2 -2
- package/bpk-component-calendar/src/BpkCalendarNav.d.ts +1 -1
- package/bpk-component-calendar/src/BpkCalendarWeek.d.ts +1 -1
- package/bpk-component-calendar/src/composeCalendar.d.ts +1 -1
- package/bpk-component-card/src/BpkCard.d.ts +1 -1
- package/bpk-component-card/src/BpkCardWrapper.d.ts +1 -1
- package/bpk-component-card/src/BpkDividedCard.d.ts +1 -1
- package/bpk-component-card-button/src/BpkSaveButton.d.ts +1 -1
- package/bpk-component-carousel/src/BpkCarousel.d.ts +1 -1
- package/bpk-component-carousel/src/BpkCarouselContainer.d.ts +1 -1
- package/bpk-component-chip/src/BpkDismissibleChip.d.ts +1 -1
- package/bpk-component-chip/src/BpkDropdownChip.d.ts +1 -1
- package/bpk-component-chip/src/BpkIconChip.d.ts +1 -1
- package/bpk-component-chip/src/BpkSelectableChip.d.ts +1 -1
- package/bpk-component-chip-group/src/BpkMultiSelectChipGroup.d.ts +1 -1
- package/bpk-component-chip-group/src/BpkSingleSelectChipGroup.d.ts +1 -1
- package/bpk-component-chip-group/src/Nudger.d.ts +1 -1
- package/bpk-component-close-button/src/BpkCloseButton.d.ts +1 -1
- package/bpk-component-datatable/src/BpkDataTable.d.ts +1 -1
- package/bpk-component-datatable/src/BpkDataTableHeader.d.ts +1 -1
- package/bpk-component-datepicker/src/BpkDatepicker.d.ts +5 -3
- package/bpk-component-description-list/src/BpkDescriptionDetails.d.ts +1 -1
- package/bpk-component-description-list/src/BpkDescriptionList.d.ts +1 -1
- package/bpk-component-description-list/src/BpkDescriptionTerm.d.ts +1 -1
- package/bpk-component-dialog/src/BpkDialog.d.ts +1 -1
- package/bpk-component-dialog/src/BpkDialogInner.d.ts +11 -7
- package/bpk-component-flare/src/__generated__/js/corner-radius.d.ts +1 -1
- package/bpk-component-flare/src/__generated__/js/pointer.d.ts +1 -1
- package/bpk-component-floating-notification/src/BpkFloatingNotification.d.ts +1 -1
- package/bpk-component-graphic-promotion/src/BpkGraphicPromo.d.ts +1 -1
- package/bpk-component-icon/index.d.ts +2 -2
- package/bpk-component-icon/src/classNameModifierHOCFactory.d.ts +1 -1
- package/bpk-component-icon/src/withAlignment.d.ts +1 -1
- package/bpk-component-icon/src/withRtlSupport.d.ts +1 -1
- package/bpk-component-image/src/BpkBackgroundImage.d.ts +1 -1
- package/bpk-component-image/src/BpkImage.d.ts +1 -1
- package/bpk-component-image/src/withLazyLoading.d.ts +5 -3
- package/bpk-component-image/src/withLoadingBehavior.d.ts +5 -3
- package/bpk-component-info-banner/src/AnimateAndFade.d.ts +1 -1
- package/bpk-component-info-banner/src/BpkInfoBanner.d.ts +1 -1
- package/bpk-component-info-banner/src/BpkInfoBannerDismissable.d.ts +1 -1
- package/bpk-component-info-banner/src/BpkInfoBannerExpandable.d.ts +1 -1
- package/bpk-component-info-banner/src/BpkInfoBannerInner.d.ts +1 -1
- package/bpk-component-info-banner/src/withBannerAlertState.d.ts +5 -3
- package/bpk-component-input/src/BpkInput.d.ts +1 -1
- package/bpk-component-input/src/withOpenEvents.d.ts +4 -2
- package/bpk-component-inset-banner/src/BpkInsetBanner.d.ts +1 -1
- package/bpk-component-journey-arrow/src/BpkJourneyArrow.d.ts +1 -1
- package/bpk-component-loading-button/src/BpkLoadingButton.d.ts +1 -1
- package/bpk-component-map/src/BpkBasicMapMarker.d.ts +1 -1
- package/bpk-component-map/src/BpkPriceMarkerV2/BpkPriceMarker.d.ts +1 -1
- package/bpk-component-modal/src/BpkModal.d.ts +1 -1
- package/bpk-component-modal/src/BpkModalInner.d.ts +1 -1
- package/bpk-component-modal/src/BpkModalV2/BpkModal.d.ts +1 -1
- package/bpk-component-navigation-bar/src/BpkNavigationBar.d.ts +1 -1
- package/bpk-component-navigation-bar/src/BpkNavigationBarButtonLink.d.ts +1 -1
- package/bpk-component-navigation-bar/src/BpkNavigationBarIconButton.d.ts +1 -1
- package/bpk-component-nudger/src/BpkNudger.d.ts +1 -1
- package/bpk-component-overlay/src/BpkOverlay.d.ts +1 -1
- package/bpk-component-popover/src/BpkPopover.d.ts +1 -1
- package/bpk-component-rating/src/BpkRating.d.ts +1 -1
- package/bpk-component-rtl-toggle/src/BpkRtlToggle.d.ts +1 -1
- package/bpk-component-rtl-toggle/src/updateOnDirectionChange.d.ts +11 -7
- package/bpk-component-scrollable-calendar/src/BpkScrollableCalendar.d.ts +4 -2
- package/bpk-component-scrollable-calendar/src/BpkScrollableCalendarDate.d.ts +1 -1
- package/bpk-component-scrollable-calendar/src/BpkScrollableCalendarGrid.d.ts +3 -3
- package/bpk-component-scrollable-calendar/src/BpkScrollableCalendarGridList.d.ts +3 -3
- package/bpk-component-section-header/src/BpkSectionHeader.d.ts +1 -1
- package/bpk-component-segmented-control/src/BpkSegmentedControl.d.ts +1 -1
- package/bpk-component-skeleton/src/BpkBaseSkeleton.d.ts +1 -1
- package/bpk-component-skeleton/src/BpkSkeleton.d.ts +1 -1
- package/bpk-component-slider/src/BpkSlider.d.ts +1 -1
- package/bpk-component-snippet/src/BpkSnippet.d.ts +1 -1
- package/bpk-component-spinner/src/BpkExtraLargeSpinner.d.ts +1 -1
- package/bpk-component-spinner/src/BpkLargeSpinner.d.ts +1 -1
- package/bpk-component-spinner/src/BpkSpinner.d.ts +1 -1
- package/bpk-component-split-input/src/BpkInputField.d.ts +1 -1
- package/bpk-component-split-input/src/BpkSplitInput.d.ts +2 -2
- package/bpk-component-swap-button/src/BpkSwapButton.d.ts +1 -1
- package/bpk-component-text/src/BpkText.d.ts +1 -1
- package/bpk-component-tooltip/src/BpkTooltip.d.ts +1 -1
- package/bpk-component-tooltip/src/BpkTooltipPortal.d.ts +1 -1
- package/bpk-react-utils/index.d.ts +3 -3
- package/bpk-react-utils/src/BpkDialogWrapper/BpkDialogWrapper.d.ts +1 -1
- package/bpk-react-utils/src/TransitionInitialMount.d.ts +1 -1
- package/bpk-react-utils/src/withDefaultProps.d.ts +1 -1
- package/bpk-scrim-utils/index.d.ts +11 -7
- package/bpk-scrim-utils/src/BpkScrim.d.ts +1 -1
- package/bpk-scrim-utils/src/withScrim.d.ts +11 -7
- package/bpk-scrim-utils/src/withScrimmedPortal.d.ts +1 -1
- package/bpk-theming/src/BpkThemeProvider.js +30 -19
- package/package.json +3 -3
- package/bpk-component-carousel/src/utils.test.js +0 -30
|
@@ -21,16 +21,18 @@ export type Props = {
|
|
|
21
21
|
[rest: string]: any;
|
|
22
22
|
};
|
|
23
23
|
declare const withScrim: <P extends object>(WrappedComponent: ComponentType<P> | string) => {
|
|
24
|
-
new (props: Props & Omit<P, "dialogRef">): {
|
|
24
|
+
new (props: (Props & Omit<P, "dialogRef">) | Readonly<Props & Omit<P, "dialogRef">>): {
|
|
25
25
|
dialogElement?: HTMLElement | null | undefined;
|
|
26
26
|
componentDidMount(): void;
|
|
27
27
|
componentWillUnmount(): void;
|
|
28
28
|
dialogRef: (ref: HTMLElement | null | undefined) => void;
|
|
29
|
-
render():
|
|
30
|
-
context:
|
|
29
|
+
render(): JSX.Element;
|
|
30
|
+
context: any;
|
|
31
31
|
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Props & Omit<P, "dialogRef">>) => Pick<{}, K> | {} | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
32
32
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
33
|
-
readonly props: Readonly<Props & Omit<P, "dialogRef"
|
|
33
|
+
readonly props: Readonly<Props & Omit<P, "dialogRef">> & Readonly<{
|
|
34
|
+
children?: import("react").ReactNode | undefined;
|
|
35
|
+
}>;
|
|
34
36
|
state: Readonly<{}>;
|
|
35
37
|
refs: {
|
|
36
38
|
[key: string]: import("react").ReactInstance;
|
|
@@ -51,11 +53,13 @@ declare const withScrim: <P extends object>(WrappedComponent: ComponentType<P> |
|
|
|
51
53
|
componentDidMount(): void;
|
|
52
54
|
componentWillUnmount(): void;
|
|
53
55
|
dialogRef: (ref: HTMLElement | null | undefined) => void;
|
|
54
|
-
render():
|
|
55
|
-
context:
|
|
56
|
+
render(): JSX.Element;
|
|
57
|
+
context: any;
|
|
56
58
|
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Props & Omit<P, "dialogRef">>) => Pick<{}, K> | {} | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
57
59
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
58
|
-
readonly props: Readonly<Props & Omit<P, "dialogRef"
|
|
60
|
+
readonly props: Readonly<Props & Omit<P, "dialogRef">> & Readonly<{
|
|
61
|
+
children?: import("react").ReactNode | undefined;
|
|
62
|
+
}>;
|
|
59
63
|
state: Readonly<{}>;
|
|
60
64
|
refs: {
|
|
61
65
|
[key: string]: import("react").ReactInstance;
|
|
@@ -3,5 +3,5 @@ import type { Props as ScrimProps } from './withScrim';
|
|
|
3
3
|
export type Props = ScrimProps & {
|
|
4
4
|
renderTarget?: (() => HTMLElement | null) | null;
|
|
5
5
|
};
|
|
6
|
-
declare const withScrimmedPortal: (WrappedComponent: ComponentType<ScrimProps>) => ({ renderTarget, ...rest }: Props) =>
|
|
6
|
+
declare const withScrimmedPortal: (WrappedComponent: ComponentType<ScrimProps>) => ({ renderTarget, ...rest }: Props) => JSX.Element;
|
|
7
7
|
export default withScrimmedPortal;
|
|
@@ -17,6 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import PropTypes from 'prop-types';
|
|
20
|
+
import { Component } from 'react';
|
|
20
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
22
|
const uniq = (arr = []) => {
|
|
22
23
|
const seen = {};
|
|
@@ -49,25 +50,35 @@ const createStyle = (theme, themeAttributes) => {
|
|
|
49
50
|
}
|
|
50
51
|
return style;
|
|
51
52
|
};
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
...
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
53
|
+
class BpkThemeProvider extends Component {
|
|
54
|
+
getChildContext() {
|
|
55
|
+
return {
|
|
56
|
+
theme: this.props.theme
|
|
57
|
+
};
|
|
58
|
+
}
|
|
59
|
+
render() {
|
|
60
|
+
const {
|
|
61
|
+
children,
|
|
62
|
+
component: WrapperComponent,
|
|
63
|
+
style: userStyle,
|
|
64
|
+
theme,
|
|
65
|
+
themeAttributes,
|
|
66
|
+
...rest
|
|
67
|
+
} = this.props;
|
|
68
|
+
const dedupedThemeAttributes = uniq(themeAttributes);
|
|
69
|
+
const style = createStyle(theme, dedupedThemeAttributes);
|
|
70
|
+
return /*#__PURE__*/_jsx(WrapperComponent, {
|
|
71
|
+
style: {
|
|
72
|
+
...userStyle,
|
|
73
|
+
...style
|
|
74
|
+
},
|
|
75
|
+
...rest,
|
|
76
|
+
children: children
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
}
|
|
80
|
+
BpkThemeProvider.childContextTypes = {
|
|
81
|
+
theme: PropTypes.object // eslint-disable-line react/forbid-prop-types
|
|
71
82
|
};
|
|
72
83
|
const themeAttributesPropType = (props, propName, componentName) => {
|
|
73
84
|
const {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skyscanner/backpack-web",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "35.0.0-premajor.1",
|
|
4
4
|
"description": "Backpack Design System web library",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
},
|
|
50
50
|
"peerDependencies": {
|
|
51
51
|
"node-sass": ">= 7",
|
|
52
|
-
"react": "^17.0.2
|
|
53
|
-
"react-dom": "^17.0.2
|
|
52
|
+
"react": "^17.0.2",
|
|
53
|
+
"react-dom": "^17.0.2",
|
|
54
54
|
"react-transition-group": "^4.4.5",
|
|
55
55
|
"sass": "^1",
|
|
56
56
|
"sass-embedded": "^1"
|
|
@@ -1,30 +0,0 @@
|
|
|
1
|
-
/*
|
|
2
|
-
* Backpack - Skyscanner's Design System
|
|
3
|
-
*
|
|
4
|
-
* Copyright 2022 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 { renderHook } from '@testing-library/react';
|
|
20
|
-
import { useScrollToInitialImage } from "./utils";
|
|
21
|
-
describe('useScrollToInitialImage', () => {
|
|
22
|
-
it('should scroll to initial image on mount', () => {
|
|
23
|
-
const imagesRef = {
|
|
24
|
-
current: [document.createElement('div'), document.createElement('div')]
|
|
25
|
-
};
|
|
26
|
-
const initialImageIndex = 0;
|
|
27
|
-
renderHook(() => useScrollToInitialImage(initialImageIndex, imagesRef));
|
|
28
|
-
expect(imagesRef.current[initialImageIndex].scrollIntoView).toHaveBeenCalledTimes(1);
|
|
29
|
-
});
|
|
30
|
-
});
|