@skyscanner/backpack-web 41.9.0 → 41.10.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-banner-alert/src/BpkBannerAlert.js +2 -0
- package/bpk-component-banner-alert/src/BpkBannerAlertDismissable.js +2 -0
- package/bpk-component-banner-alert/src/BpkBannerAlertExpandable.js +2 -0
- package/bpk-component-bottom-sheet/src/BpkBottomSheet.js +2 -1
- package/bpk-component-breadcrumb/src/BpkBreadcrumb.js +2 -1
- package/bpk-component-breadcrumb/src/BpkBreadcrumbItem.js +2 -1
- package/bpk-component-button/src/BpkButtonV2/BpkButton.js +3 -1
- package/bpk-component-card/src/BpkCard.js +4 -1
- package/bpk-component-card/src/BpkCardWrapper.js +2 -1
- package/bpk-component-card/src/BpkDividedCard.js +2 -1
- package/bpk-component-card-button/src/BpkSaveButton.js +2 -1
- package/bpk-component-card-list/src/BpkCardList.js +2 -1
- package/bpk-component-card-list/src/BpkCardListGridStack/BpkCardListGridStack.js +2 -1
- package/bpk-component-card-list/src/BpkCardListRowRail/BpkCardListCarousel.js +2 -1
- package/bpk-component-card-list/src/BpkCardListRowRail/BpkCardListRowRailContainer.js +2 -1
- package/bpk-component-carousel/src/BpkCarousel.js +2 -1
- package/bpk-component-carousel/src/BpkCarouselContainer.js +3 -1
- package/bpk-component-carousel/src/BpkCarouselImage.js +2 -1
- package/bpk-component-checkbox/src/BpkCheckbox.js +2 -1
- package/bpk-component-content-cards/src/BpkContentCard.js +2 -1
- package/bpk-component-content-cards/src/BpkContentCards.js +2 -1
- package/bpk-component-datatable/src/BpkDataTable.js +2 -1
- package/bpk-component-datatable/src/BpkDataTableHeader.js +2 -1
- package/bpk-component-datepicker/src/BpkDatepicker.js +2 -1
- package/bpk-component-description-list/src/BpkDescriptionDetails.js +2 -1
- package/bpk-component-description-list/src/BpkDescriptionList.js +2 -1
- package/bpk-component-description-list/src/BpkDescriptionTerm.js +2 -1
- package/bpk-component-dialog/src/BpkDialog.js +2 -1
- package/bpk-component-drawer/src/BpkDrawer.js +2 -1
- package/bpk-component-fieldset/src/BpkFieldset.js +2 -1
- package/bpk-component-floating-notification/src/BpkFloatingNotification.js +2 -1
- package/bpk-component-graphic-promotion/src/BpkGraphicPromo.js +2 -1
- package/bpk-component-image/src/BpkBackgroundImage.js +2 -1
- package/bpk-component-image/src/BpkImage.js +2 -1
- package/bpk-component-info-banner/src/BpkInfoBanner.js +2 -0
- package/bpk-component-info-banner/src/BpkInfoBannerDismissable.js +2 -0
- package/bpk-component-info-banner/src/BpkInfoBannerExpandable.js +2 -0
- package/bpk-component-input/src/BpkInput.js +2 -1
- package/bpk-component-inset-banner/src/BpkInsetBanner.js +2 -1
- package/bpk-component-inset-banner/src/BpkInsetBannerV2/BpkInsetBannerSponsored.js +2 -1
- package/bpk-component-link/src/BpkButtonLink.js +2 -1
- package/bpk-component-link/src/BpkLink.js +2 -1
- package/bpk-component-list/index.d.ts +5 -0
- package/bpk-component-list/index.js +3 -1
- package/bpk-component-list/src/BpkList.d.ts +11 -0
- package/bpk-component-list/src/BpkList.js +10 -15
- package/bpk-component-list/src/BpkListItem.d.ts +7 -0
- package/bpk-component-list/src/BpkListItem.js +2 -5
- package/bpk-component-loading-button/src/BpkLoadingButton.js +2 -1
- package/bpk-component-mobile-scroll-container/src/BpkMobileScrollContainer.js +2 -1
- package/bpk-component-modal/src/BpkModal.js +2 -1
- package/bpk-component-modal/src/BpkModalV2/BpkModal.js +2 -1
- package/bpk-component-navigation-bar/src/BpkNavigationBar.js +2 -1
- package/bpk-component-navigation-bar/src/BpkNavigationBarButtonLink.js +2 -0
- package/bpk-component-navigation-bar/src/BpkNavigationBarIconButton.js +2 -0
- package/bpk-component-navigation-tab-group/src/BpkNavigationTabGroup.js +2 -1
- package/bpk-component-nudger/src/BpkNudger.js +2 -1
- package/bpk-component-overlay/src/BpkOverlay.js +2 -1
- package/bpk-component-panel/src/BpkPanel.js +2 -1
- package/bpk-component-popover/src/BpkPopover.js +2 -1
- package/bpk-component-rating/src/BpkRating.js +2 -1
- package/bpk-component-rtl-toggle/src/BpkRtlToggle.js +2 -0
- package/bpk-component-section-header/src/BpkSectionHeader.js +2 -1
- package/bpk-component-segmented-control/src/BpkSegmentedControl.js +2 -1
- package/bpk-component-skeleton/src/BpkBaseSkeleton.js +2 -1
- package/bpk-component-slider/src/BpkSlider.js +2 -1
- package/bpk-component-spinner/src/BpkExtraLargeSpinner.js +2 -1
- package/bpk-component-spinner/src/BpkLargeSpinner.js +2 -1
- package/bpk-component-spinner/src/BpkSpinner.js +2 -1
- package/bpk-component-split-input/src/BpkInputField.js +2 -1
- package/bpk-component-split-input/src/BpkSplitInput.js +2 -1
- package/bpk-component-swap-button/src/BpkSwapButton.js +2 -1
- package/bpk-component-switch/src/BpkSwitch.js +2 -1
- package/bpk-component-textarea/src/BpkTextarea.js +2 -1
- package/bpk-component-theme-toggle/src/BpkThemeToggle.js +2 -0
- package/package.json +1 -1
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
+
import { getDataComponentAttribute } from "../../bpk-react-utils";
|
|
19
20
|
import BpkBannerAlertInner from "./BpkBannerAlertInner";
|
|
20
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
22
|
const defaultProps = {
|
|
@@ -40,6 +41,7 @@ const BpkBannerAlert = ({
|
|
|
40
41
|
animateOnLeave: animateOnLeave,
|
|
41
42
|
show: show,
|
|
42
43
|
icon: icon,
|
|
44
|
+
...getDataComponentAttribute('BannerAlert'),
|
|
43
45
|
...rest
|
|
44
46
|
});
|
|
45
47
|
export default BpkBannerAlert;
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
+
import { getDataComponentAttribute } from "../../bpk-react-utils";
|
|
19
20
|
import BpkBannerAlertInner, { CONFIGURATION } from "./BpkBannerAlertInner";
|
|
20
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
22
|
const BpkBannerAlertDismissable = ({
|
|
@@ -24,6 +25,7 @@ const BpkBannerAlertDismissable = ({
|
|
|
24
25
|
}) => /*#__PURE__*/_jsx(BpkBannerAlertInner, {
|
|
25
26
|
configuration: CONFIGURATION.DISMISSABLE,
|
|
26
27
|
onDismiss: onDismiss,
|
|
28
|
+
...getDataComponentAttribute('BannerAlertDismissable'),
|
|
27
29
|
...rest
|
|
28
30
|
});
|
|
29
31
|
export default BpkBannerAlertDismissable;
|
|
@@ -16,6 +16,7 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
+
import { getDataComponentAttribute } from "../../bpk-react-utils";
|
|
19
20
|
import BpkBannerAlertInner, { CONFIGURATION } from "./BpkBannerAlertInner";
|
|
20
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
21
22
|
const BpkBannerAlertExpandable = ({
|
|
@@ -27,6 +28,7 @@ const BpkBannerAlertExpandable = ({
|
|
|
27
28
|
configuration: CONFIGURATION.EXPANDABLE,
|
|
28
29
|
expanded: expanded,
|
|
29
30
|
onExpandToggle: onExpandToggle,
|
|
31
|
+
...getDataComponentAttribute('BannerAlertExpandable'),
|
|
30
32
|
...rest,
|
|
31
33
|
children: children
|
|
32
34
|
});
|
|
@@ -23,7 +23,7 @@ import BpkCloseButton from "../../bpk-component-close-button";
|
|
|
23
23
|
import BpkLink from "../../bpk-component-link";
|
|
24
24
|
import BpkNavigationBar from "../../bpk-component-navigation-bar";
|
|
25
25
|
import { TEXT_STYLES } from "../../bpk-component-text/src/BpkText";
|
|
26
|
-
import { BpkDialogWrapper, cssModules } from "../../bpk-react-utils";
|
|
26
|
+
import { BpkDialogWrapper, cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
|
|
27
27
|
import STYLES from "./BpkBottomSheet.module.css";
|
|
28
28
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
29
29
|
const getClassName = cssModules(STYLES);
|
|
@@ -113,6 +113,7 @@ const BpkBottomSheet = ({
|
|
|
113
113
|
appear: animationTimeout,
|
|
114
114
|
exit: isAboveMobile ? 0 : animationTimeout
|
|
115
115
|
},
|
|
116
|
+
...getDataComponentAttribute('BottomSheet'),
|
|
116
117
|
children: /*#__PURE__*/_jsxs(_Fragment, {
|
|
117
118
|
children: [/*#__PURE__*/_jsx("header", {
|
|
118
119
|
className: getClassName('bpk-bottom-sheet--header-wrapper'),
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import { Component, Fragment } from 'react';
|
|
20
|
-
import { cssModules } from "../../bpk-react-utils";
|
|
20
|
+
import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
|
|
21
21
|
import STYLES from "./BpkBreadcrumb.module.css";
|
|
22
22
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
23
|
const getClassName = cssModules(STYLES);
|
|
@@ -63,6 +63,7 @@ class BpkBreadcrumb extends Component {
|
|
|
63
63
|
}
|
|
64
64
|
}), /*#__PURE__*/_jsx("nav", {
|
|
65
65
|
"aria-label": label,
|
|
66
|
+
...getDataComponentAttribute('Breadcrumb'),
|
|
66
67
|
...rest,
|
|
67
68
|
children: /*#__PURE__*/_jsx("ol", {
|
|
68
69
|
className: getClassName('bpk-breadcrumb'),
|
|
@@ -20,7 +20,7 @@ import { withRtlSupport } from "../../bpk-component-icon";
|
|
|
20
20
|
import ArrowRight from "../../bpk-component-icon/sm/arrow-right";
|
|
21
21
|
import BpkLink from "../../bpk-component-link";
|
|
22
22
|
import BpkText from "../../bpk-component-text";
|
|
23
|
-
import { cssModules } from "../../bpk-react-utils";
|
|
23
|
+
import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
|
|
24
24
|
import STYLES from "./BpkBreadcrumbItem.module.css";
|
|
25
25
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
26
26
|
const getClassName = cssModules(STYLES);
|
|
@@ -36,6 +36,7 @@ const BpkBreadcrumbItem = props => {
|
|
|
36
36
|
} = props;
|
|
37
37
|
return /*#__PURE__*/_jsxs("li", {
|
|
38
38
|
className: getClassName('bpk-breadcrumb-item', className),
|
|
39
|
+
...getDataComponentAttribute('BreadcrumbItem'),
|
|
39
40
|
...rest,
|
|
40
41
|
children: [active ? /*#__PURE__*/_jsx("div", {
|
|
41
42
|
className: getClassName('bpk-breadcrumb-item__active-item'),
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
|
-
import { cssModules } from "../../../bpk-react-utils";
|
|
18
|
+
import { cssModules, getDataComponentAttribute } from "../../../bpk-react-utils";
|
|
19
19
|
import { BUTTON_TYPES, SIZE_TYPES } from "./common-types";
|
|
20
20
|
import COMMON_STYLES from "./BpkButton.module.css";
|
|
21
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -53,6 +53,7 @@ export const BpkButtonV2 = ({
|
|
|
53
53
|
return /*#__PURE__*/_jsx("a", {
|
|
54
54
|
href: href,
|
|
55
55
|
className: classNames,
|
|
56
|
+
...getDataComponentAttribute('Button'),
|
|
56
57
|
onClick: onClick,
|
|
57
58
|
target: target,
|
|
58
59
|
rel: rel,
|
|
@@ -64,6 +65,7 @@ export const BpkButtonV2 = ({
|
|
|
64
65
|
type: submit ? 'submit' : 'button',
|
|
65
66
|
disabled: disabled,
|
|
66
67
|
className: classNames,
|
|
68
|
+
...getDataComponentAttribute('Button'),
|
|
67
69
|
onClick: onClick,
|
|
68
70
|
...rest,
|
|
69
71
|
children: content
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import { useContext } from 'react';
|
|
20
|
-
import { cssModules } from "../../bpk-react-utils";
|
|
20
|
+
import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
|
|
21
21
|
import { CardContext } from "./CardContext";
|
|
22
22
|
import STYLES from "./BpkCard.module.css";
|
|
23
23
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -51,6 +51,7 @@ const BpkCard = ({
|
|
|
51
51
|
return /*#__PURE__*/_jsx("a", {
|
|
52
52
|
href: href,
|
|
53
53
|
className: classNames,
|
|
54
|
+
...getDataComponentAttribute('Card'),
|
|
54
55
|
...atomicProps,
|
|
55
56
|
...blankProps,
|
|
56
57
|
...rest,
|
|
@@ -61,12 +62,14 @@ const BpkCard = ({
|
|
|
61
62
|
return /*#__PURE__*/_jsx("button", {
|
|
62
63
|
type: "button",
|
|
63
64
|
className: classNames,
|
|
65
|
+
...getDataComponentAttribute('Card'),
|
|
64
66
|
...rest,
|
|
65
67
|
children: children
|
|
66
68
|
});
|
|
67
69
|
}
|
|
68
70
|
return /*#__PURE__*/_jsx("div", {
|
|
69
71
|
className: classNames,
|
|
72
|
+
...getDataComponentAttribute('Card'),
|
|
70
73
|
...rest,
|
|
71
74
|
children: children
|
|
72
75
|
});
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import { cssModules } from "../../bpk-react-utils";
|
|
19
|
+
import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
|
|
20
20
|
import { CardContext } from "./CardContext";
|
|
21
21
|
import STYLES from "./BpkCardWrapper.module.css";
|
|
22
22
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -38,6 +38,7 @@ const BpkCardWrapper = ({
|
|
|
38
38
|
// @ts-expect-error TS is reporting this incorrectly as --background-color is valid
|
|
39
39
|
'--background-color': backgroundColor
|
|
40
40
|
},
|
|
41
|
+
...getDataComponentAttribute('CardWrapper'),
|
|
41
42
|
children: [/*#__PURE__*/_jsx("div", {
|
|
42
43
|
className: getClassName('bpk-card-wrapper--header'),
|
|
43
44
|
children: header
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import { cssModules } from "../../bpk-react-utils";
|
|
19
|
+
import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
|
|
20
20
|
import BpkCard from "./BpkCard";
|
|
21
21
|
import { CardContext } from "./CardContext";
|
|
22
22
|
import STYLES from "./BpkDividedCard.module.css";
|
|
@@ -44,6 +44,7 @@ const BpkDividedCard = ({
|
|
|
44
44
|
},
|
|
45
45
|
children: /*#__PURE__*/_jsx("div", {
|
|
46
46
|
className: containerClassName,
|
|
47
|
+
...getDataComponentAttribute('DividedCard'),
|
|
47
48
|
children: /*#__PURE__*/_jsx(BpkCard, {
|
|
48
49
|
href: href,
|
|
49
50
|
padded: false,
|
|
@@ -22,7 +22,7 @@ import BpkHeartIcon from "../../bpk-component-icon/lg/heart";
|
|
|
22
22
|
import BpkHeartOutlineIcon from "../../bpk-component-icon/lg/heart--outline";
|
|
23
23
|
import BpkHeartIconSm from "../../bpk-component-icon/sm/heart";
|
|
24
24
|
import BpkHeartOutlineIconSm from "../../bpk-component-icon/sm/heart--outline";
|
|
25
|
-
import { cssModules } from "../../bpk-react-utils";
|
|
25
|
+
import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
|
|
26
26
|
import STYLES from "./BpkSaveButton.module.css";
|
|
27
27
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
28
28
|
export const SIZE_TYPES = {
|
|
@@ -56,6 +56,7 @@ const BpkSaveButton = ({
|
|
|
56
56
|
"aria-label": accessibilityLabel,
|
|
57
57
|
"aria-pressed": checked,
|
|
58
58
|
className: getClassName('bpk-save-button', smallSize && 'bpk-save-button__small', `bpk-save-button__${style}`),
|
|
59
|
+
...getDataComponentAttribute('SaveButton'),
|
|
59
60
|
onClick: e => {
|
|
60
61
|
onCheckedChange(e);
|
|
61
62
|
if (!checked) {
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
import BpkBreakpoint, { BREAKPOINTS } from "../../bpk-component-breakpoint";
|
|
19
19
|
import BpkButton from "../../bpk-component-button";
|
|
20
20
|
import BpkSectionHeader from "../../bpk-component-section-header";
|
|
21
|
-
import { cssModules } from "../../bpk-react-utils";
|
|
21
|
+
import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
|
|
22
22
|
import BpkCardListGridStack from "./BpkCardListGridStack";
|
|
23
23
|
import BpkCardListRowRailContainer from "./BpkCardListRowRail";
|
|
24
24
|
import { ACCESSORY_DESKTOP_TYPES, ACCESSORY_MOBILE_TYPES, LAYOUTS } from "./common-types";
|
|
@@ -61,6 +61,7 @@ const BpkCardList = props => {
|
|
|
61
61
|
});
|
|
62
62
|
return /*#__PURE__*/_jsx("div", {
|
|
63
63
|
className: getClassName('bpk-card-list'),
|
|
64
|
+
...getDataComponentAttribute('CardList'),
|
|
64
65
|
"data-testid": "bpk-card-list",
|
|
65
66
|
children: /*#__PURE__*/_jsx(BpkBreakpoint, {
|
|
66
67
|
query: BREAKPOINTS.MOBILE,
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
import { Children, useState } from 'react';
|
|
20
20
|
import BpkButton from "../../../bpk-component-button";
|
|
21
|
-
import { cssModules } from "../../../bpk-react-utils";
|
|
21
|
+
import { cssModules, getDataComponentAttribute } from "../../../bpk-react-utils";
|
|
22
22
|
import ExpandAccessoryContent from "../BpkExpand/ExpandAccessoryContent";
|
|
23
23
|
import { ACCESSORY_DESKTOP_TYPES } from "../common-types";
|
|
24
24
|
import STYLES from "./BpkCardListGridStack.module.css";
|
|
@@ -67,6 +67,7 @@ const BpkCardListGridStack = props => {
|
|
|
67
67
|
});
|
|
68
68
|
return /*#__PURE__*/_jsxs("div", {
|
|
69
69
|
className: getClassName('bpk-card-list-grid-stack'),
|
|
70
|
+
...getDataComponentAttribute('CardListGridStack'),
|
|
70
71
|
"data-testid": "bpk-card-list-grid-stack",
|
|
71
72
|
children: [/*#__PURE__*/_jsx("div", {
|
|
72
73
|
className: getClassName(`bpk-card-list-grid-stack__${layout}`),
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
import { useRef, useState, useEffect, isValidElement, Children, useMemo } from 'react';
|
|
20
20
|
import throttle from 'lodash/throttle';
|
|
21
|
-
import { cssModules } from "../../../bpk-react-utils";
|
|
21
|
+
import { cssModules, getDataComponentAttribute } from "../../../bpk-react-utils";
|
|
22
22
|
import { RENDER_BUFFER_SIZE } from "./constants";
|
|
23
23
|
import { lockScroll, setA11yTabIndex, useScrollToCard, useIntersectionObserver } from "./utils";
|
|
24
24
|
import STYLES from "./BpkCardListCarousel.module.css";
|
|
@@ -131,6 +131,7 @@ const BpkCardListCarousel = props => {
|
|
|
131
131
|
}, []);
|
|
132
132
|
return /*#__PURE__*/_jsx("div", {
|
|
133
133
|
className: getClassName(`bpk-card-list-row-rail__${layout}`),
|
|
134
|
+
...getDataComponentAttribute('CardListCarousel'),
|
|
134
135
|
"data-testid": "bpk-card-list-row-rail__carousel",
|
|
135
136
|
"aria-label": carouselLabel(initiallyShownCards, childrenLength),
|
|
136
137
|
"aria-roledescription": "carousel"
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
import { useState, Children } from 'react';
|
|
19
19
|
import BpkPageIndicator from "../../../bpk-component-page-indicator";
|
|
20
|
-
import { cssModules } from "../../../bpk-react-utils";
|
|
20
|
+
import { cssModules, getDataComponentAttribute } from "../../../bpk-react-utils";
|
|
21
21
|
import { ACCESSORY_DESKTOP_TYPES, LAYOUTS } from "../common-types";
|
|
22
22
|
import BpkCardListCarousel from "./BpkCardListCarousel";
|
|
23
23
|
import STYLES from "./BpkCardListRowRailContainer.module.css";
|
|
@@ -47,6 +47,7 @@ const BpkCardListRowRailContainer = props => {
|
|
|
47
47
|
}) : null;
|
|
48
48
|
return /*#__PURE__*/_jsxs("div", {
|
|
49
49
|
className: getClassName('bpk-card-list-row-rail'),
|
|
50
|
+
...getDataComponentAttribute('CardListRowRailContainer'),
|
|
50
51
|
"data-testid": "bpk-card-list-row-rail",
|
|
51
52
|
children: [/*#__PURE__*/_jsx(BpkCardListCarousel, {
|
|
52
53
|
initiallyShownCards: initiallyShownCards,
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
import { useRef, useState } from 'react';
|
|
20
20
|
import { BREAKPOINTS, useMediaQuery } from "../../bpk-component-breakpoint";
|
|
21
21
|
import BpkPageIndicator, { VARIANT } from "../../bpk-component-page-indicator";
|
|
22
|
-
import { cssModules } from "../../bpk-react-utils";
|
|
22
|
+
import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
|
|
23
23
|
import BpkCarouselContainer from "./BpkCarouselContainer";
|
|
24
24
|
import { scrollToIndex, useScrollToInitialImage } from "./utils";
|
|
25
25
|
import STYLES from "./BpkCarousel.module.css";
|
|
@@ -44,6 +44,7 @@ const BpkCarousel = ({
|
|
|
44
44
|
useScrollToInitialImage(initialImageIndex, imagesRef);
|
|
45
45
|
return /*#__PURE__*/_jsxs("div", {
|
|
46
46
|
className: getClassName('bpk-carousel'),
|
|
47
|
+
...getDataComponentAttribute('Carousel'),
|
|
47
48
|
children: [/*#__PURE__*/_jsx(BpkCarouselContainer, {
|
|
48
49
|
images: images,
|
|
49
50
|
onVisible: updateShownImageIndex,
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import { memo, useState } from 'react';
|
|
20
|
-
import { cssModules } from "../../bpk-react-utils";
|
|
20
|
+
import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
|
|
21
21
|
import BpkCarouselImage from "./BpkCarouselImage";
|
|
22
22
|
import { useIntersectionObserver } from "./utils";
|
|
23
23
|
import STYLES from "./BpkCarouselContainer.module.css";
|
|
@@ -58,6 +58,7 @@ const BpkScrollContainer = /*#__PURE__*/memo(({
|
|
|
58
58
|
if (images.length === 1) {
|
|
59
59
|
return /*#__PURE__*/_jsx("div", {
|
|
60
60
|
className: getClassName('bpk-carousel-container'),
|
|
61
|
+
...getDataComponentAttribute('CarouselContainer'),
|
|
61
62
|
role: "list",
|
|
62
63
|
"data-testid": "image-gallery-scroll-container",
|
|
63
64
|
children: /*#__PURE__*/_jsx(BpkCarouselImage, {
|
|
@@ -68,6 +69,7 @@ const BpkScrollContainer = /*#__PURE__*/memo(({
|
|
|
68
69
|
}
|
|
69
70
|
return /*#__PURE__*/_jsxs("div", {
|
|
70
71
|
className: getClassName('bpk-carousel-container'),
|
|
72
|
+
...getDataComponentAttribute('CarouselContainer'),
|
|
71
73
|
ref: setRoot,
|
|
72
74
|
"data-testid": "image-gallery-scroll-container",
|
|
73
75
|
role: "list",
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import { forwardRef } from "react";
|
|
20
|
-
import { cssModules } from "../../bpk-react-utils";
|
|
20
|
+
import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
|
|
21
21
|
import STYLES from "./BpkCarouselImage.module.css";
|
|
22
22
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
23
23
|
const getClassName = cssModules(STYLES);
|
|
@@ -26,6 +26,7 @@ const BpkCarouselImage = /*#__PURE__*/forwardRef(({
|
|
|
26
26
|
index
|
|
27
27
|
}, ref) => /*#__PURE__*/_jsx("div", {
|
|
28
28
|
className: getClassName('bpk-carousel-image'),
|
|
29
|
+
...getDataComponentAttribute('CarouselImage'),
|
|
29
30
|
"data-index": index,
|
|
30
31
|
ref: ref,
|
|
31
32
|
role: "listitem",
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import { cssModules } from "../../bpk-react-utils";
|
|
19
|
+
import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
|
|
20
20
|
import STYLES from "./BpkCheckbox.module.css";
|
|
21
21
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
22
|
const getClassName = cssModules(STYLES);
|
|
@@ -41,6 +41,7 @@ const BpkCheckbox = ({
|
|
|
41
41
|
const inputClasses = getClassName('bpk-checkbox__input', white && 'bpk-checkbox__input-white', indeterminate && 'bpk-checkbox__input-indeterminate');
|
|
42
42
|
return /*#__PURE__*/_jsxs("label", {
|
|
43
43
|
className: classNames,
|
|
44
|
+
...getDataComponentAttribute('Checkbox'),
|
|
44
45
|
children: [/*#__PURE__*/_jsx("input", {
|
|
45
46
|
type: "checkbox",
|
|
46
47
|
className: inputClasses,
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import BpkText from "../../bpk-component-text";
|
|
20
|
-
import { cssModules } from "../../bpk-react-utils";
|
|
20
|
+
import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
|
|
21
21
|
import STYLES from "./BpkContentCard.module.css";
|
|
22
22
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
23
|
const getClassName = cssModules(STYLES);
|
|
@@ -29,6 +29,7 @@ const BpkContentCard = ({
|
|
|
29
29
|
href: card.href,
|
|
30
30
|
target: "_blank",
|
|
31
31
|
rel: "noreferrer",
|
|
32
|
+
...getDataComponentAttribute('ContentCard'),
|
|
32
33
|
children: [/*#__PURE__*/_jsx("div", {
|
|
33
34
|
className: getClassName('bpk-content-card--image-container'),
|
|
34
35
|
children: /*#__PURE__*/_jsx("img", {
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
/* eslint react/no-array-index-key: 0 */
|
|
19
19
|
|
|
20
|
-
import { cssModules } from "../../bpk-react-utils";
|
|
20
|
+
import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
|
|
21
21
|
import BpkContentCard from "./BpkContentCard";
|
|
22
22
|
import STYLES from "./BpkContentCards.module.css";
|
|
23
23
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -30,6 +30,7 @@ const BpkContentCards = ({
|
|
|
30
30
|
return null;
|
|
31
31
|
}
|
|
32
32
|
return /*#__PURE__*/_jsxs("div", {
|
|
33
|
+
...getDataComponentAttribute('ContentCards'),
|
|
33
34
|
children: [/*#__PURE__*/_jsx("h2", {
|
|
34
35
|
className: getClassName('bpk-content-cards--header-text'),
|
|
35
36
|
children: heading
|
|
@@ -20,7 +20,7 @@ import { useMemo, useState } from 'react';
|
|
|
20
20
|
|
|
21
21
|
// @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
|
|
22
22
|
import { useTable, useSortBy } from 'react-table';
|
|
23
|
-
import { cssModules } from "../../bpk-react-utils";
|
|
23
|
+
import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
|
|
24
24
|
import BpkDataTableHeader from "./BpkDataTableHeader";
|
|
25
25
|
import { SORT_DIRECTION_TYPES } from "./common-types";
|
|
26
26
|
import { createColumnsSchema } from "./utils";
|
|
@@ -106,6 +106,7 @@ const BpkDataTable = props => {
|
|
|
106
106
|
className: classNames
|
|
107
107
|
}),
|
|
108
108
|
...restOfProps,
|
|
109
|
+
...getDataComponentAttribute('DataTable'),
|
|
109
110
|
children: [/*#__PURE__*/_jsx("div", {
|
|
110
111
|
children: headerGroups.map(headerGroup => /*#__PURE__*/_jsx("div", {
|
|
111
112
|
...headerGroup.getHeaderGroupProps({
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
import { withRtlSupport } from "../../bpk-component-icon";
|
|
20
20
|
import BpkSmallArrowDownIcon from "../../bpk-component-icon/sm/arrow-down";
|
|
21
21
|
import BpkSmallArrowUpIcon from "../../bpk-component-icon/sm/arrow-up";
|
|
22
|
-
import { cssModules } from "../../bpk-react-utils";
|
|
22
|
+
import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
|
|
23
23
|
import { SORT_DIRECTION_TYPES } from "./common-types";
|
|
24
24
|
import STYLES from "./BpkDataTableHeader.module.css";
|
|
25
25
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -97,6 +97,7 @@ const BpkDataTableHeader = ({
|
|
|
97
97
|
},
|
|
98
98
|
className: headerClassNames
|
|
99
99
|
}),
|
|
100
|
+
...getDataComponentAttribute('DataTableHeader'),
|
|
100
101
|
children: [/*#__PURE__*/_jsx("span", {
|
|
101
102
|
onClick: onHeaderClick,
|
|
102
103
|
onKeyDown: handleKeyboardEvent,
|
|
@@ -22,7 +22,7 @@ import { composeCalendar, BpkCalendarGridHeader, BpkCalendarGrid, BpkCalendarDat
|
|
|
22
22
|
import BpkInput, { withOpenEvents } from "../../bpk-component-input";
|
|
23
23
|
import BpkModal from "../../bpk-component-modal";
|
|
24
24
|
import BpkPopover from "../../bpk-component-popover";
|
|
25
|
-
import { setNativeValue } from "../../bpk-react-utils";
|
|
25
|
+
import { setNativeValue, getDataComponentAttribute } from "../../bpk-react-utils";
|
|
26
26
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
27
27
|
const Input = withOpenEvents(BpkInput);
|
|
28
28
|
const DefaultCalendar = withCalendarState(composeCalendar(BpkCalendarNav, BpkCalendarGridHeader, BpkCalendarGrid, BpkCalendarDate));
|
|
@@ -252,6 +252,7 @@ class BpkDatepicker extends Component {
|
|
|
252
252
|
isOpen: this.state.isOpen,
|
|
253
253
|
label: title,
|
|
254
254
|
closeButtonText: closeButtonText,
|
|
255
|
+
...getDataComponentAttribute('Datepicker'),
|
|
255
256
|
...rest,
|
|
256
257
|
children: /*#__PURE__*/_jsx(Calendar, {
|
|
257
258
|
...calendarProps,
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import { cssModules } from "../../bpk-react-utils";
|
|
19
|
+
import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
|
|
20
20
|
import STYLES from "./BpkDescriptionList.module.css";
|
|
21
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
22
|
const getClassName = cssModules(STYLES);
|
|
@@ -27,6 +27,7 @@ export default ({
|
|
|
27
27
|
}) => /*#__PURE__*/_jsx("dd", {
|
|
28
28
|
className: [getClassName('bpk-description-list__details'), className].filter(x => x) // inline drops the className if undefined
|
|
29
29
|
.join(' '),
|
|
30
|
+
...getDataComponentAttribute('DescriptionDetails'),
|
|
30
31
|
...rest,
|
|
31
32
|
children: children
|
|
32
33
|
});
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import { cssModules } from "../../bpk-react-utils";
|
|
19
|
+
import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
|
|
20
20
|
import STYLES from "./BpkDescriptionList.module.css";
|
|
21
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
22
|
const getClassName = cssModules(STYLES);
|
|
@@ -27,6 +27,7 @@ export default ({
|
|
|
27
27
|
}) => /*#__PURE__*/_jsx("dl", {
|
|
28
28
|
className: [getClassName('bpk-description-list'), className].filter(x => x) // inline drops the className if undefined
|
|
29
29
|
.join(' '),
|
|
30
|
+
...getDataComponentAttribute('DescriptionList'),
|
|
30
31
|
...rest,
|
|
31
32
|
children: children
|
|
32
33
|
});
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import { cssModules } from "../../bpk-react-utils";
|
|
19
|
+
import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
|
|
20
20
|
import STYLES from "./BpkDescriptionList.module.css";
|
|
21
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
22
|
const getClassName = cssModules(STYLES);
|
|
@@ -27,6 +27,7 @@ export default ({
|
|
|
27
27
|
}) => /*#__PURE__*/_jsx("dt", {
|
|
28
28
|
className: [getClassName('bpk-description-list__term'), className].filter(x => x) // inline drops the className if undefined
|
|
29
29
|
.join(' '),
|
|
30
|
+
...getDataComponentAttribute('DescriptionTerm'),
|
|
30
31
|
...rest,
|
|
31
32
|
children: children
|
|
32
33
|
});
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
// @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
|
|
20
20
|
import BpkCloseButton from "../../bpk-component-close-button";
|
|
21
|
-
import { cssModules, Portal } from "../../bpk-react-utils";
|
|
21
|
+
import { cssModules, Portal, getDataComponentAttribute } from "../../bpk-react-utils";
|
|
22
22
|
import BpkDialogInner from "./BpkDialogInner";
|
|
23
23
|
import { HEADER_ICON_TYPES } from "./common-types";
|
|
24
24
|
import STYLES from "./BpkDialog.module.css";
|
|
@@ -52,6 +52,7 @@ const BpkDialog = ({
|
|
|
52
52
|
containerClassName: getClassName('bpk-dialog__container'),
|
|
53
53
|
contentClassName: headerIcon ? getClassName('bpk-dialog--with-icon') : undefined,
|
|
54
54
|
...rest,
|
|
55
|
+
...getDataComponentAttribute('Dialog'),
|
|
55
56
|
children: [headerIcon && /*#__PURE__*/_jsx("div", {
|
|
56
57
|
className: headerIconClassNames,
|
|
57
58
|
children: headerIcon
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/import { useState, useEffect } from 'react';
|
|
18
|
-
import { Portal, isDeviceIpad, isDeviceIphone } from "../../bpk-react-utils";
|
|
18
|
+
import { Portal, isDeviceIpad, isDeviceIphone, getDataComponentAttribute } from "../../bpk-react-utils";
|
|
19
19
|
import { withScrim } from "../../bpk-scrim-utils";
|
|
20
20
|
import BpkDrawerContent from "./BpkDrawerContent";
|
|
21
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -59,6 +59,7 @@ const BpkDrawer = ({
|
|
|
59
59
|
isOpen: isOpen,
|
|
60
60
|
onClose: hide,
|
|
61
61
|
renderTarget: renderTarget,
|
|
62
|
+
...getDataComponentAttribute('Drawer'),
|
|
62
63
|
children: /*#__PURE__*/_jsx(BpkScrimDrawerContent, {
|
|
63
64
|
id: id,
|
|
64
65
|
title: title,
|
|
@@ -20,7 +20,7 @@ import { cloneElement } from 'react';
|
|
|
20
20
|
// @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
|
|
21
21
|
import BpkFormValidation from "../../bpk-component-form-validation";
|
|
22
22
|
import BpkLabel from "../../bpk-component-label";
|
|
23
|
-
import { cssModules } from "../../bpk-react-utils";
|
|
23
|
+
import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
|
|
24
24
|
import STYLES from "./BpkFieldset.module.css";
|
|
25
25
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
26
26
|
const getClassName = cssModules(STYLES);
|
|
@@ -74,6 +74,7 @@ const BpkFieldset = ({
|
|
|
74
74
|
}
|
|
75
75
|
return /*#__PURE__*/_jsxs("fieldset", {
|
|
76
76
|
className: classNames.join(' '),
|
|
77
|
+
...getDataComponentAttribute('Fieldset'),
|
|
77
78
|
...rest,
|
|
78
79
|
children: [!isCheckbox && /*#__PURE__*/_jsx("div", {
|
|
79
80
|
className: getClassName('bpk-fieldset__label'),
|
|
@@ -21,7 +21,7 @@ import { CSSTransition } from 'react-transition-group';
|
|
|
21
21
|
import BpkAriaLive from "../../bpk-component-aria-live";
|
|
22
22
|
import BpkButton, { BUTTON_TYPES } from "../../bpk-component-button";
|
|
23
23
|
import BpkText, { TEXT_STYLES } from "../../bpk-component-text";
|
|
24
|
-
import { cssModules } from "../../bpk-react-utils";
|
|
24
|
+
import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
|
|
25
25
|
import STYLES from "./BpkFloatingNotification.module.css";
|
|
26
26
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
27
27
|
const getClassName = cssModules(STYLES);
|
|
@@ -62,6 +62,7 @@ const BpkFloatingNotification = props => {
|
|
|
62
62
|
onExited: onExit,
|
|
63
63
|
children: /*#__PURE__*/_jsxs("div", {
|
|
64
64
|
className: classNames,
|
|
65
|
+
...getDataComponentAttribute('FloatingNotification'),
|
|
65
66
|
...rest,
|
|
66
67
|
children: [Icon && /*#__PURE__*/_jsx("div", {
|
|
67
68
|
className: getClassName('bpk-floating-notification__icon'),
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import BpkButton, { BUTTON_TYPES } from "../../bpk-component-button";
|
|
20
|
-
import { cssModules } from "../../bpk-react-utils";
|
|
20
|
+
import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
|
|
21
21
|
import STYLES from "./BpkGraphicPromo.module.css";
|
|
22
22
|
import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
23
|
const getClassName = cssModules(STYLES);
|
|
@@ -125,6 +125,7 @@ const BpkGraphicPromo = ({
|
|
|
125
125
|
}),
|
|
126
126
|
onClick: onClickWrapper,
|
|
127
127
|
onKeyDown: onKeyWrapper,
|
|
128
|
+
...getDataComponentAttribute('GraphicPromo'),
|
|
128
129
|
children: /*#__PURE__*/_jsxs("div", {
|
|
129
130
|
id: contentId && `${contentId}__content` || '',
|
|
130
131
|
className: containerClasses,
|
|
@@ -20,7 +20,7 @@ import { Component } from 'react';
|
|
|
20
20
|
import CSSTransition from 'react-transition-group/CSSTransition';
|
|
21
21
|
import { animations } from '@skyscanner/bpk-foundations-web/tokens/base.es6';
|
|
22
22
|
import { BpkSpinner } from "../../bpk-component-spinner";
|
|
23
|
-
import { cssModules } from "../../bpk-react-utils";
|
|
23
|
+
import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
|
|
24
24
|
import STYLES from "./BpkBackgroundImage.module.css";
|
|
25
25
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
26
26
|
const getClassName = cssModules(STYLES);
|
|
@@ -102,6 +102,7 @@ class BpkBackgroundImage extends Component {
|
|
|
102
102
|
paddingBottom: aspectRatioPc
|
|
103
103
|
},
|
|
104
104
|
className: classNames.join(' '),
|
|
105
|
+
...getDataComponentAttribute('BackgroundImage'),
|
|
105
106
|
children: [/*#__PURE__*/_jsx("div", {
|
|
106
107
|
style: {
|
|
107
108
|
backgroundImage: !inView || loading ? '' : `url(${src})`,
|
|
@@ -20,7 +20,7 @@ import { Component } from 'react';
|
|
|
20
20
|
import CSSTransition from 'react-transition-group/CSSTransition';
|
|
21
21
|
import { animations } from '@skyscanner/bpk-foundations-web/tokens/base.es6';
|
|
22
22
|
import { BpkSpinner } from "../../bpk-component-spinner";
|
|
23
|
-
import { cssModules } from "../../bpk-react-utils";
|
|
23
|
+
import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
|
|
24
24
|
import BORDER_RADIUS_STYLES from "./BpkImageBorderRadiusStyles";
|
|
25
25
|
import STYLES from "./BpkImage.module.css";
|
|
26
26
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
@@ -110,6 +110,7 @@ class BpkImage extends Component {
|
|
|
110
110
|
return /*#__PURE__*/_jsx("div", {
|
|
111
111
|
style: style,
|
|
112
112
|
className: className,
|
|
113
|
+
...getDataComponentAttribute('Image'),
|
|
113
114
|
children: /*#__PURE__*/_jsxs("div", {
|
|
114
115
|
ref: div => {
|
|
115
116
|
this.placeholder = div;
|