@skyscanner/backpack-web 34.16.0 → 35.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +3 -5
- 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 +6 -10
- 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-carousel/src/utils.test.js +30 -0
- 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 +10 -0
- package/bpk-component-close-button/src/BpkCloseButton.js +21 -37
- 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 +3 -5
- 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 +7 -11
- 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 +3 -5
- package/bpk-component-image/src/withLoadingBehavior.d.ts +3 -5
- 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 +3 -5
- package/bpk-component-input/src/BpkInput.d.ts +1 -1
- package/bpk-component-input/src/BpkInput.js +1 -1
- package/bpk-component-input/src/common-types.d.ts +1 -1
- package/bpk-component-input/src/withOpenEvents.d.ts +2 -4
- 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 +6 -38
- package/bpk-component-loading-button/src/BpkLoadingButton.js +13 -44
- 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/index.d.ts +1 -2
- package/bpk-component-nudger/index.js +1 -2
- package/bpk-component-nudger/src/BpkNudger.d.ts +1 -1
- package/bpk-component-nudger/src/BpkNudger.js +102 -20
- package/bpk-component-nudger/src/BpkNudger.module.css +1 -1
- package/bpk-component-nudger/src/common-types.d.ts +7 -5
- 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 +7 -11
- package/bpk-component-scrollable-calendar/src/BpkScrollableCalendar.d.ts +2 -4
- 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 +4 -1
- package/bpk-component-slider/src/BpkSlider.js +51 -3
- package/bpk-component-snippet/src/BpkSnippet.d.ts +1 -1
- package/bpk-component-spinner/src/BpkExtraLargeSpinner.d.ts +4 -14
- package/bpk-component-spinner/src/BpkExtraLargeSpinner.js +5 -16
- package/bpk-component-spinner/src/BpkLargeSpinner.d.ts +5 -17
- package/bpk-component-spinner/src/BpkLargeSpinner.js +6 -19
- package/bpk-component-spinner/src/BpkSpinner.d.ts +5 -17
- package/bpk-component-spinner/src/BpkSpinner.js +6 -19
- package/bpk-component-split-input/src/BpkInputField.d.ts +21 -0
- package/bpk-component-split-input/src/BpkInputField.js +12 -17
- package/bpk-component-split-input/src/BpkSplitInput.d.ts +44 -0
- package/bpk-component-split-input/src/BpkSplitInput.js +21 -40
- package/bpk-component-swap-button/src/BpkSwapButton.d.ts +1 -1
- package/bpk-component-switch/index.d.ts +5 -0
- package/bpk-component-switch/src/BpkSwitch.d.ts +8 -0
- package/bpk-component-switch/src/BpkSwitch.js +9 -22
- package/bpk-component-switch/src/BpkSwitch.module.css +1 -1
- package/bpk-component-switch/src/themeAttributes.d.ts +2 -0
- 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/nativeEventHandler.d.ts +1 -1
- package/bpk-react-utils/src/nativeEventHandler.js +7 -5
- package/bpk-react-utils/src/withDefaultProps.d.ts +1 -1
- package/bpk-scrim-utils/index.d.ts +7 -11
- package/bpk-scrim-utils/src/BpkScrim.d.ts +1 -1
- package/bpk-scrim-utils/src/withScrim.d.ts +7 -11
- package/bpk-scrim-utils/src/withScrimmedPortal.d.ts +1 -1
- package/bpk-theming/src/BpkThemeProvider.js +19 -30
- package/package.json +5 -3
- package/bpk-component-nudger/src/BpkConfigurableNudger.d.ts +0 -26
- package/bpk-component-nudger/src/BpkConfigurableNudger.js +0 -96
|
@@ -12,5 +12,5 @@ export type Props = {
|
|
|
12
12
|
className?: string | null;
|
|
13
13
|
[rest: string]: any;
|
|
14
14
|
};
|
|
15
|
-
declare const BpkAriaLive: ({ className, politenessSetting, visible, ...rest }: Props) => JSX.Element;
|
|
15
|
+
declare const BpkAriaLive: ({ className, politenessSetting, visible, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
export default BpkAriaLive;
|
|
@@ -18,5 +18,5 @@ export type Props = {
|
|
|
18
18
|
children: string | ReactNode;
|
|
19
19
|
[rest: string]: any;
|
|
20
20
|
};
|
|
21
|
-
declare const BpkBadge: ({ centered, className, docked, type, ...rest }: Props) => JSX.Element;
|
|
21
|
+
declare const BpkBadge: ({ centered, className, docked, type, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
22
22
|
export default BpkBadge;
|
|
@@ -27,6 +27,6 @@ declare class AnimateAndFade extends Component<Props, State> {
|
|
|
27
27
|
onAnimateHeightComplete: () => void;
|
|
28
28
|
onFadeComplete: () => void;
|
|
29
29
|
toggle: () => void;
|
|
30
|
-
render(): JSX.Element | null;
|
|
30
|
+
render(): import("react/jsx-runtime").JSX.Element | null;
|
|
31
31
|
}
|
|
32
32
|
export default AnimateAndFade;
|
|
@@ -3,5 +3,5 @@ import type { CommonProps } from './common-types';
|
|
|
3
3
|
* @deprecated use bpk-component-info-banner instead
|
|
4
4
|
* @returns {Component} a banner alert component
|
|
5
5
|
*/
|
|
6
|
-
declare const BpkBannerAlert: ({ animateOnEnter, animateOnLeave, icon, show, ...rest }: CommonProps) => JSX.Element;
|
|
6
|
+
declare const BpkBannerAlert: ({ animateOnEnter, animateOnLeave, icon, show, ...rest }: CommonProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export default BpkBannerAlert;
|
|
@@ -3,5 +3,5 @@ export type Props = CommonProps & {
|
|
|
3
3
|
dismissButtonLabel: string;
|
|
4
4
|
onDismiss?: OnDismissHandler;
|
|
5
5
|
};
|
|
6
|
-
declare const BpkBannerAlertDismissable: ({ onDismiss, ...rest }: Props) => JSX.Element;
|
|
6
|
+
declare const BpkBannerAlertDismissable: ({ onDismiss, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export default BpkBannerAlertDismissable;
|
|
@@ -6,5 +6,5 @@ export type Props = CommonProps & {
|
|
|
6
6
|
toggleButtonLabel: string;
|
|
7
7
|
onExpandToggle?: OnExpandToggleHandler;
|
|
8
8
|
};
|
|
9
|
-
declare const BpkBannerAlertExpandable: ({ children, expanded, onExpandToggle, ...rest }: Props) => JSX.Element;
|
|
9
|
+
declare const BpkBannerAlertExpandable: ({ children, expanded, onExpandToggle, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
10
10
|
export default BpkBannerAlertExpandable;
|
|
@@ -14,5 +14,5 @@ type Props = CommonProps & {
|
|
|
14
14
|
dismissButtonLabel?: string;
|
|
15
15
|
onDismiss?: OnDismissHandler;
|
|
16
16
|
};
|
|
17
|
-
declare const BpkBannerAlertInner: ({ animateOnEnter, animateOnLeave, bannerClassName, children, configuration, dismissButtonLabel, expanded, icon, message, onDismiss, onExpandToggle, show, toggleButtonLabel, type, ...rest }: Props) => JSX.Element;
|
|
17
|
+
declare const BpkBannerAlertInner: ({ animateOnEnter, animateOnLeave, bannerClassName, children, configuration, dismissButtonLabel, expanded, icon, message, onDismiss, onExpandToggle, show, toggleButtonLabel, type, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
18
18
|
export default BpkBannerAlertInner;
|
|
@@ -14,8 +14,8 @@ declare const withBannerAlertState: <P extends BpkBannerAlertProps>(WrappedCompo
|
|
|
14
14
|
onExpandToggle: () => void;
|
|
15
15
|
onDismiss: () => void;
|
|
16
16
|
onHide: () => void;
|
|
17
|
-
render(): JSX.Element;
|
|
18
|
-
context:
|
|
17
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
18
|
+
context: unknown;
|
|
19
19
|
setState<K extends keyof {
|
|
20
20
|
expanded?: boolean;
|
|
21
21
|
show?: boolean;
|
|
@@ -36,9 +36,7 @@ declare const withBannerAlertState: <P extends BpkBannerAlertProps>(WrappedCompo
|
|
|
36
36
|
show?: boolean;
|
|
37
37
|
}, K> | null, callback?: (() => void) | undefined): void;
|
|
38
38
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
39
|
-
readonly props: Readonly<P & WithBannerAlertStateProps
|
|
40
|
-
children?: import("react").ReactNode | undefined;
|
|
41
|
-
}>;
|
|
39
|
+
readonly props: Readonly<P & WithBannerAlertStateProps>;
|
|
42
40
|
state: Readonly<{
|
|
43
41
|
expanded?: boolean;
|
|
44
42
|
show?: boolean;
|
|
@@ -19,5 +19,5 @@ export type Props = CommonProps & ({
|
|
|
19
19
|
} | {
|
|
20
20
|
ariaLabel: string;
|
|
21
21
|
});
|
|
22
|
-
declare const BpkBottomSheet: ({ actionText, children, closeLabel, closeOnEscPressed, closeOnScrimClick, id, isOpen, onAction, onClose, title, wide, ...ariaProps }: Props) => JSX.Element;
|
|
22
|
+
declare const BpkBottomSheet: ({ actionText, children, closeLabel, closeOnEscPressed, closeOnScrimClick, id, isOpen, onAction, onClose, title, wide, ...ariaProps }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
23
23
|
export default BpkBottomSheet;
|
|
@@ -11,7 +11,7 @@ export type Props = CommonProps & {
|
|
|
11
11
|
linkOnDark?: boolean;
|
|
12
12
|
};
|
|
13
13
|
declare const BpkButton: {
|
|
14
|
-
(props: Props): JSX.Element;
|
|
14
|
+
(props: Props): import("react/jsx-runtime").JSX.Element;
|
|
15
15
|
defaultProps: {
|
|
16
16
|
primaryOnDark: boolean;
|
|
17
17
|
primaryOnLight: boolean;
|
|
@@ -14,7 +14,7 @@ type ValueOf<T> = T[keyof T];
|
|
|
14
14
|
declare const BpkButtonBase: {
|
|
15
15
|
(props: Props & {
|
|
16
16
|
type?: ValueOf<typeof BUTTON_TYPES>;
|
|
17
|
-
}): JSX.Element;
|
|
17
|
+
}): import("react/jsx-runtime").JSX.Element;
|
|
18
18
|
propTypes: {
|
|
19
19
|
children: import("prop-types").Validator<NonNullable<import("prop-types").ReactNodeLike>>;
|
|
20
20
|
href: import("prop-types").Requireable<string>;
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
import type { Props } from './common-types';
|
|
2
|
-
export declare const BpkButtonV2: ({ blank, children, className, disabled, fullWidth, href, iconOnly, onClick, rel: propRel, size, submit, type, ...rest }: Props) => JSX.Element;
|
|
2
|
+
export declare const BpkButtonV2: ({ blank, children, className, disabled, fullWidth, href, iconOnly, onClick, rel: propRel, size, submit, type, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
@@ -55,13 +55,11 @@ declare const withCalendarState: <P extends object>(Calendar: ComponentType<P>)
|
|
|
55
55
|
source: string;
|
|
56
56
|
}) => void;
|
|
57
57
|
handleDateKeyDown: (event: KeyboardEvent) => void;
|
|
58
|
-
render(): JSX.Element;
|
|
59
|
-
context:
|
|
58
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
59
|
+
context: unknown;
|
|
60
60
|
setState<K extends keyof State>(state: State | ((prevState: Readonly<State>, props: Readonly<CalendarProps<P>>) => Pick<State, K> | State | null) | Pick<State, K> | null, callback?: (() => void) | undefined): void;
|
|
61
61
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
62
|
-
readonly props: Readonly<CalendarProps<P
|
|
63
|
-
children?: import("react").ReactNode | undefined;
|
|
64
|
-
}>;
|
|
62
|
+
readonly props: Readonly<CalendarProps<P>>;
|
|
65
63
|
state: Readonly<State>;
|
|
66
64
|
refs: {
|
|
67
65
|
[key: string]: import("react").ReactInstance;
|
|
@@ -107,13 +105,11 @@ declare const _default: {
|
|
|
107
105
|
source: string;
|
|
108
106
|
}) => void;
|
|
109
107
|
handleDateKeyDown: (event: KeyboardEvent) => void;
|
|
110
|
-
render(): JSX.Element;
|
|
111
|
-
context:
|
|
108
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
109
|
+
context: unknown;
|
|
112
110
|
setState<K extends keyof State>(state: State | ((prevState: Readonly<State>, props: Readonly<CalendarProps<import("./composeCalendar").Props>>) => Pick<State, K> | State | null) | Pick<State, K> | null, callback?: (() => void) | undefined): void;
|
|
113
111
|
forceUpdate(callback?: (() => void) | undefined): void;
|
|
114
|
-
readonly props: Readonly<CalendarProps<import("./composeCalendar").Props
|
|
115
|
-
children?: import("react").ReactNode | undefined;
|
|
116
|
-
}>;
|
|
112
|
+
readonly props: Readonly<CalendarProps<import("./composeCalendar").Props>>;
|
|
117
113
|
state: Readonly<State>;
|
|
118
114
|
refs: {
|
|
119
115
|
[key: string]: import("react").ReactInstance;
|
|
@@ -46,6 +46,6 @@ declare class BpkCalendarDate extends PureComponent<Props> {
|
|
|
46
46
|
componentDidMount(): void;
|
|
47
47
|
componentDidUpdate(prevProps: Props): void;
|
|
48
48
|
button: HTMLButtonElement | null;
|
|
49
|
-
render(): JSX.Element;
|
|
49
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
50
50
|
}
|
|
51
51
|
export default BpkCalendarDate;
|
|
@@ -40,7 +40,7 @@ declare class BpkCalendarGrid extends Component<Props, State> {
|
|
|
40
40
|
static defaultProps: DefaultProps;
|
|
41
41
|
constructor(props: Props);
|
|
42
42
|
UNSAFE_componentWillReceiveProps(nextProps: Props): void;
|
|
43
|
-
render(): JSX.Element;
|
|
43
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
44
44
|
}
|
|
45
45
|
declare const BpkCalendarGridWithTransition: typeof BpkCalendarGrid | ((props: Omit<DefaultProps & {
|
|
46
46
|
DateComponent: ElementType;
|
|
@@ -60,6 +60,6 @@ declare const BpkCalendarGridWithTransition: typeof BpkCalendarGrid | ((props: O
|
|
|
60
60
|
className?: string | null;
|
|
61
61
|
month?: Date;
|
|
62
62
|
focusedDate?: Date | null;
|
|
63
|
-
}, "TransitionComponent">) => JSX.Element);
|
|
63
|
+
}, "TransitionComponent">) => import("react/jsx-runtime").JSX.Element);
|
|
64
64
|
export default BpkCalendarGrid;
|
|
65
65
|
export { BpkCalendarGridWithTransition };
|
|
@@ -26,8 +26,8 @@ declare class BpkCalendarGridTransition extends Component<Props, State> {
|
|
|
26
26
|
UNSAFE_componentWillReceiveProps({ month: nextMonth }: Props): void;
|
|
27
27
|
componentDidUpdate(): void;
|
|
28
28
|
onMonthTransitionEnd(): void;
|
|
29
|
-
render(): JSX.Element;
|
|
29
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
30
30
|
}
|
|
31
|
-
declare const addCalendarGridTransition: <P extends {}>(TransitionComponent: ComponentType<P>) => (props: Omit<P & Props, keyof InjectedCalendarGridTransitionProps>) => JSX.Element;
|
|
31
|
+
declare const addCalendarGridTransition: <P extends {}>(TransitionComponent: ComponentType<P>) => (props: Omit<P & Props, keyof InjectedCalendarGridTransitionProps>) => import("react/jsx-runtime").JSX.Element;
|
|
32
32
|
export default BpkCalendarGridTransition;
|
|
33
33
|
export { addCalendarGridTransition };
|
|
@@ -19,5 +19,5 @@ type Props = {
|
|
|
19
19
|
}) => void;
|
|
20
20
|
disabled?: boolean;
|
|
21
21
|
};
|
|
22
|
-
declare const BpkCalendarNav: ({ changeMonthLabel, disabled, formatMonth, id, maxDate, minDate, month, nextMonthLabel, onMonthChange, previousMonthLabel, }: Props) => JSX.Element;
|
|
22
|
+
declare const BpkCalendarNav: ({ changeMonthLabel, disabled, formatMonth, id, maxDate, minDate, month, nextMonthLabel, onMonthChange, previousMonthLabel, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
23
23
|
export default BpkCalendarNav;
|
|
@@ -28,6 +28,6 @@ type DefaultProps = {
|
|
|
28
28
|
declare class BpkCalendarWeek extends Component<Props> {
|
|
29
29
|
static defaultProps: DefaultProps;
|
|
30
30
|
shouldComponentUpdate(nextProps: Props): boolean;
|
|
31
|
-
render(): JSX.Element | null;
|
|
31
|
+
render(): import("react/jsx-runtime").JSX.Element | null;
|
|
32
32
|
}
|
|
33
33
|
export default BpkCalendarWeek;
|
|
@@ -78,5 +78,5 @@ export type Props = {
|
|
|
78
78
|
*/
|
|
79
79
|
dateProps?: {} | null;
|
|
80
80
|
};
|
|
81
|
-
declare const composeCalendar: (Nav: ComponentType<any> | string | null, GridHeader: ComponentType<any> | string | null, Grid: ComponentType<any> | string, CalendarDate: ComponentType<any> | string | null) => ({ changeMonthLabel, className, customRowHeight, dateModifiers, dateProps, daysOfWeek, fixedWidth, focusedDate, formatDateFull, formatMonth, gridClassName, gridProps, headerProps, id, markOutsideDays, markToday, maxDate, minDate, month, navProps, nextMonthLabel, onDateClick, onDateKeyDown, onMonthChange, preventKeyboardFocus, previousMonthLabel, selectionConfiguration, weekDayKey, weekStartsOn, }: Props) => JSX.Element;
|
|
81
|
+
declare const composeCalendar: (Nav: ComponentType<any> | string | null, GridHeader: ComponentType<any> | string | null, Grid: ComponentType<any> | string, CalendarDate: ComponentType<any> | string | null) => ({ changeMonthLabel, className, customRowHeight, dateModifiers, dateProps, daysOfWeek, fixedWidth, focusedDate, formatDateFull, formatMonth, gridClassName, gridProps, headerProps, id, markOutsideDays, markToday, maxDate, minDate, month, navProps, nextMonthLabel, onDateClick, onDateKeyDown, onMonthChange, preventKeyboardFocus, previousMonthLabel, selectionConfiguration, weekDayKey, weekStartsOn, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
82
82
|
export default composeCalendar;
|
|
@@ -8,5 +8,5 @@ type Props = {
|
|
|
8
8
|
atomic?: boolean;
|
|
9
9
|
[rest: string]: any;
|
|
10
10
|
};
|
|
11
|
-
declare const BpkCard: ({ atomic, blank, children, className, href, padded, ...rest }: Props) => JSX.Element;
|
|
11
|
+
declare const BpkCard: ({ atomic, blank, children, className, href, padded, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
12
12
|
export default BpkCard;
|
|
@@ -5,5 +5,5 @@ type Props = {
|
|
|
5
5
|
backgroundColor: string;
|
|
6
6
|
header: ReactNode;
|
|
7
7
|
};
|
|
8
|
-
declare const BpkCardWrapper: ({ backgroundColor, card, className, header, }: Props) => JSX.Element;
|
|
8
|
+
declare const BpkCardWrapper: ({ backgroundColor, card, className, header, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export default BpkCardWrapper;
|
|
@@ -12,5 +12,5 @@ export type Props = {
|
|
|
12
12
|
isElevated?: boolean;
|
|
13
13
|
[rest: string]: any;
|
|
14
14
|
};
|
|
15
|
-
declare const BpkDividedCard: ({ href, isElevated, orientation, primaryContent, secondaryContent, ...rest }: Props) => JSX.Element;
|
|
15
|
+
declare const BpkDividedCard: ({ href, isElevated, orientation, primaryContent, secondaryContent, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
16
16
|
export default BpkDividedCard;
|
|
@@ -17,5 +17,5 @@ type Props = {
|
|
|
17
17
|
size?: SizeType;
|
|
18
18
|
style?: StyleType;
|
|
19
19
|
};
|
|
20
|
-
declare const BpkSaveButton: ({ accessibilityLabel, checked, onCheckedChange, size, style, }: Props) => JSX.Element;
|
|
20
|
+
declare const BpkSaveButton: ({ accessibilityLabel, checked, onCheckedChange, size, style, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
21
21
|
export default BpkSaveButton;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Props } from './types';
|
|
2
|
-
declare const BpkCarousel: ({ bottom, images, initialImageIndex, onImageChanged, }: Props) => JSX.Element;
|
|
2
|
+
declare const BpkCarousel: ({ bottom, images, initialImageIndex, onImageChanged, }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default BpkCarousel;
|
|
@@ -6,5 +6,5 @@ type Props = {
|
|
|
6
6
|
imagesRef: MutableRefObject<Array<HTMLElement | null>>;
|
|
7
7
|
onImageChanged: OnImageChangedHandler;
|
|
8
8
|
};
|
|
9
|
-
declare const BpkScrollContainer: import("react").MemoExoticComponent<({ images, imagesRef, onImageChanged, onVisible }: Props) => JSX.Element>;
|
|
9
|
+
declare const BpkScrollContainer: import("react").MemoExoticComponent<({ images, imagesRef, onImageChanged, onVisible }: Props) => import("react/jsx-runtime").JSX.Element>;
|
|
10
10
|
export default BpkScrollContainer;
|
|
@@ -0,0 +1,30 @@
|
|
|
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
|
+
});
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import type { CommonProps as Props } from './commonTypes';
|
|
2
2
|
type BpkDismissibleChipProps = Omit<Props, 'disabled' | 'selected'>;
|
|
3
|
-
declare const BpkDismissibleChip: ({ className, leadingAccessoryView, type, ...rest }: BpkDismissibleChipProps) => JSX.Element;
|
|
3
|
+
declare const BpkDismissibleChip: ({ className, leadingAccessoryView, type, ...rest }: BpkDismissibleChipProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
4
|
export default BpkDismissibleChip;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { CommonProps as Props } from './commonTypes';
|
|
2
|
-
declare const BpkDropdownChip: ({ disabled, leadingAccessoryView, selected, type, ...rest }: Props) => JSX.Element;
|
|
2
|
+
declare const BpkDropdownChip: ({ disabled, leadingAccessoryView, selected, type, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default BpkDropdownChip;
|
|
@@ -3,5 +3,5 @@ import type { CommonProps as Props } from './commonTypes';
|
|
|
3
3
|
export type BpkIconChipProps = {
|
|
4
4
|
leadingAccessoryView: ReactNode;
|
|
5
5
|
} & Omit<Props, 'trailingAccessoryView' | 'leadingAccessoryView' | 'children'>;
|
|
6
|
-
declare const BpkIconChip: (props: BpkIconChipProps) => JSX.Element;
|
|
6
|
+
declare const BpkIconChip: (props: BpkIconChipProps) => import("react/jsx-runtime").JSX.Element;
|
|
7
7
|
export default BpkIconChip;
|
|
@@ -5,5 +5,5 @@ export interface Props extends CommonProps {
|
|
|
5
5
|
role?: string;
|
|
6
6
|
trailingAccessoryView?: ReactNode;
|
|
7
7
|
}
|
|
8
|
-
declare const BpkSelectableChip: ({ accessibilityLabel, children, className, disabled, dismissible, leadingAccessoryView, role, selected, trailingAccessoryView, type, ...rest }: Props) => JSX.Element;
|
|
8
|
+
declare const BpkSelectableChip: ({ accessibilityLabel, children, className, disabled, dismissible, leadingAccessoryView, role, selected, trailingAccessoryView, type, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
9
9
|
export default BpkSelectableChip;
|
|
@@ -43,5 +43,5 @@ export type MultiSelectProps = (RailChipGroupProps & {
|
|
|
43
43
|
} | WrapChipGroupProps & {
|
|
44
44
|
type: typeof CHIP_GROUP_TYPES.wrap;
|
|
45
45
|
});
|
|
46
|
-
declare const BpkMultiSelectChipGroup: (props: MultiSelectProps) => JSX.Element;
|
|
46
|
+
declare const BpkMultiSelectChipGroup: (props: MultiSelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
47
47
|
export default BpkMultiSelectChipGroup;
|
|
@@ -4,5 +4,5 @@ export type SingleSelectProps = {
|
|
|
4
4
|
onItemClick?: (item: SingleSelectChipItem, selected: boolean, index: number) => void;
|
|
5
5
|
selectedIndex?: number;
|
|
6
6
|
} & MultiSelectProps;
|
|
7
|
-
declare const BpkSingleSelectChipGroup: ({ chips, onItemClick, selectedIndex, ...rest }: SingleSelectProps) => JSX.Element;
|
|
7
|
+
declare const BpkSingleSelectChipGroup: ({ chips, onItemClick, selectedIndex, ...rest }: SingleSelectProps) => import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export default BpkSingleSelectChipGroup;
|
|
@@ -10,5 +10,5 @@ type Props = {
|
|
|
10
10
|
scrollContainerRef: MutableRefObject<HTMLElement | null>;
|
|
11
11
|
position: (typeof POSITION)[keyof typeof POSITION];
|
|
12
12
|
};
|
|
13
|
-
declare const Nudger: ({ ariaLabel, chipStyle, position, scrollContainerRef }: Props) => JSX.Element | null;
|
|
13
|
+
declare const Nudger: ({ ariaLabel, chipStyle, position, scrollContainerRef }: Props) => import("react/jsx-runtime").JSX.Element | null;
|
|
14
14
|
export default Nudger;
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import type { SyntheticEvent, FunctionComponent } from 'react';
|
|
2
|
+
type Props = {
|
|
3
|
+
label: string;
|
|
4
|
+
onClick: (event: SyntheticEvent<any>) => any;
|
|
5
|
+
className?: string | null;
|
|
6
|
+
customIcon?: FunctionComponent<any> | null;
|
|
7
|
+
onDark?: Boolean;
|
|
8
|
+
};
|
|
9
|
+
declare const BpkCloseButton: ({ className, customIcon, label, onClick, onDark, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
10
|
+
export default BpkCloseButton;
|
|
@@ -14,53 +14,37 @@
|
|
|
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
|
-
*/
|
|
17
|
+
*/
|
|
18
|
+
|
|
18
19
|
import CloseIcon from "../../bpk-component-icon/sm/close";
|
|
19
20
|
import { cssModules } from "../../bpk-react-utils";
|
|
20
21
|
import STYLES from "./BpkCloseButton.module.css";
|
|
21
22
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
23
|
const getClassName = cssModules(STYLES);
|
|
23
|
-
const BpkCloseButton =
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
} = props;
|
|
24
|
+
const BpkCloseButton = ({
|
|
25
|
+
className = null,
|
|
26
|
+
customIcon = null,
|
|
27
|
+
label,
|
|
28
|
+
onClick,
|
|
29
|
+
onDark = false,
|
|
30
|
+
...rest
|
|
31
|
+
}) => {
|
|
32
32
|
const classNames = [onDark ? getClassName('bpk-close-button__onDark') : getClassName('bpk-close-button__default')];
|
|
33
33
|
const Icon = customIcon || CloseIcon;
|
|
34
34
|
if (className) {
|
|
35
35
|
classNames.push(className);
|
|
36
36
|
}
|
|
37
|
-
return (
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
className:
|
|
46
|
-
|
|
47
|
-
children: /*#__PURE__*/_jsx("span", {
|
|
48
|
-
className: getClassName('bpk-close-button-icon'),
|
|
49
|
-
children: /*#__PURE__*/_jsx(Icon, {})
|
|
50
|
-
})
|
|
37
|
+
return /*#__PURE__*/_jsx("button", {
|
|
38
|
+
type: "button",
|
|
39
|
+
title: label,
|
|
40
|
+
onClick: onClick,
|
|
41
|
+
"aria-label": label,
|
|
42
|
+
className: classNames.join(' '),
|
|
43
|
+
...rest,
|
|
44
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
45
|
+
className: getClassName('bpk-close-button-icon'),
|
|
46
|
+
children: /*#__PURE__*/_jsx(Icon, {})
|
|
51
47
|
})
|
|
52
|
-
);
|
|
53
|
-
};
|
|
54
|
-
BpkCloseButton.propTypes = {
|
|
55
|
-
label: PropTypes.string.isRequired,
|
|
56
|
-
onClick: PropTypes.func.isRequired,
|
|
57
|
-
className: PropTypes.string,
|
|
58
|
-
customIcon: PropTypes.func,
|
|
59
|
-
onDark: PropTypes.bool
|
|
60
|
-
};
|
|
61
|
-
BpkCloseButton.defaultProps = {
|
|
62
|
-
className: null,
|
|
63
|
-
customIcon: null,
|
|
64
|
-
onDark: false
|
|
48
|
+
});
|
|
65
49
|
};
|
|
66
50
|
export default BpkCloseButton;
|
|
@@ -80,8 +80,8 @@ declare class BpkDatepicker extends Component<Props, State> {
|
|
|
80
80
|
source: string;
|
|
81
81
|
}) => void;
|
|
82
82
|
handleDateKeyDown: (event: KeyboardEvent) => void;
|
|
83
|
-
render(): JSX.Element;
|
|
84
|
-
context:
|
|
83
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
84
|
+
context: unknown;
|
|
85
85
|
setState<K extends keyof {
|
|
86
86
|
preventKeyboardFocus: boolean;
|
|
87
87
|
focusedDate: Date;
|
|
@@ -118,8 +118,6 @@ declare class BpkDatepicker extends Component<Props, State> {
|
|
|
118
118
|
maxDate: Date;
|
|
119
119
|
}> & {
|
|
120
120
|
[rest: string]: any;
|
|
121
|
-
}> & Readonly<{
|
|
122
|
-
children?: import("react").ReactNode | undefined;
|
|
123
121
|
}>;
|
|
124
122
|
state: Readonly<{
|
|
125
123
|
preventKeyboardFocus: boolean;
|
|
@@ -260,6 +258,6 @@ declare class BpkDatepicker extends Component<Props, State> {
|
|
|
260
258
|
*/
|
|
261
259
|
getValue: (selectionConfiguration: SelectionConfiguration, formatDate: (date: Date) => string) => string;
|
|
262
260
|
handleDateSelect: (startDate: Date, endDate?: Date | null) => void;
|
|
263
|
-
render(): JSX.Element;
|
|
261
|
+
render(): import("react/jsx-runtime").JSX.Element;
|
|
264
262
|
}
|
|
265
263
|
export default BpkDatepicker;
|
|
@@ -4,5 +4,5 @@ type Props = {
|
|
|
4
4
|
className?: string;
|
|
5
5
|
[rest: string]: any;
|
|
6
6
|
};
|
|
7
|
-
declare const _default: ({ children, className, ...rest }: Props) => JSX.Element;
|
|
7
|
+
declare const _default: ({ children, className, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export default _default;
|
|
@@ -4,5 +4,5 @@ type Props = {
|
|
|
4
4
|
className?: string;
|
|
5
5
|
[rest: string]: any;
|
|
6
6
|
};
|
|
7
|
-
declare const _default: ({ children, className, ...rest }: Props) => JSX.Element;
|
|
7
|
+
declare const _default: ({ children, className, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export default _default;
|
|
@@ -4,5 +4,5 @@ type Props = {
|
|
|
4
4
|
className?: string;
|
|
5
5
|
[rest: string]: any;
|
|
6
6
|
};
|
|
7
|
-
declare const _default: ({ children, className, ...rest }: Props) => JSX.Element;
|
|
7
|
+
declare const _default: ({ children, className, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
8
8
|
export default _default;
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import type { Props } from './common-types';
|
|
2
|
-
declare const BpkDialog: ({ children, closeLabel, dismissible, headerIcon, headerIconType, isOpen, onClose, renderTarget, ...rest }: Props) => JSX.Element;
|
|
2
|
+
declare const BpkDialog: ({ children, closeLabel, dismissible, headerIcon, headerIconType, isOpen, onClose, renderTarget, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
3
3
|
export default BpkDialog;
|