@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.
Files changed (76) hide show
  1. package/bpk-component-banner-alert/src/BpkBannerAlert.js +2 -0
  2. package/bpk-component-banner-alert/src/BpkBannerAlertDismissable.js +2 -0
  3. package/bpk-component-banner-alert/src/BpkBannerAlertExpandable.js +2 -0
  4. package/bpk-component-bottom-sheet/src/BpkBottomSheet.js +2 -1
  5. package/bpk-component-breadcrumb/src/BpkBreadcrumb.js +2 -1
  6. package/bpk-component-breadcrumb/src/BpkBreadcrumbItem.js +2 -1
  7. package/bpk-component-button/src/BpkButtonV2/BpkButton.js +3 -1
  8. package/bpk-component-card/src/BpkCard.js +4 -1
  9. package/bpk-component-card/src/BpkCardWrapper.js +2 -1
  10. package/bpk-component-card/src/BpkDividedCard.js +2 -1
  11. package/bpk-component-card-button/src/BpkSaveButton.js +2 -1
  12. package/bpk-component-card-list/src/BpkCardList.js +2 -1
  13. package/bpk-component-card-list/src/BpkCardListGridStack/BpkCardListGridStack.js +2 -1
  14. package/bpk-component-card-list/src/BpkCardListRowRail/BpkCardListCarousel.js +2 -1
  15. package/bpk-component-card-list/src/BpkCardListRowRail/BpkCardListRowRailContainer.js +2 -1
  16. package/bpk-component-carousel/src/BpkCarousel.js +2 -1
  17. package/bpk-component-carousel/src/BpkCarouselContainer.js +3 -1
  18. package/bpk-component-carousel/src/BpkCarouselImage.js +2 -1
  19. package/bpk-component-checkbox/src/BpkCheckbox.js +2 -1
  20. package/bpk-component-content-cards/src/BpkContentCard.js +2 -1
  21. package/bpk-component-content-cards/src/BpkContentCards.js +2 -1
  22. package/bpk-component-datatable/src/BpkDataTable.js +2 -1
  23. package/bpk-component-datatable/src/BpkDataTableHeader.js +2 -1
  24. package/bpk-component-datepicker/src/BpkDatepicker.js +2 -1
  25. package/bpk-component-description-list/src/BpkDescriptionDetails.js +2 -1
  26. package/bpk-component-description-list/src/BpkDescriptionList.js +2 -1
  27. package/bpk-component-description-list/src/BpkDescriptionTerm.js +2 -1
  28. package/bpk-component-dialog/src/BpkDialog.js +2 -1
  29. package/bpk-component-drawer/src/BpkDrawer.js +2 -1
  30. package/bpk-component-fieldset/src/BpkFieldset.js +2 -1
  31. package/bpk-component-floating-notification/src/BpkFloatingNotification.js +2 -1
  32. package/bpk-component-graphic-promotion/src/BpkGraphicPromo.js +2 -1
  33. package/bpk-component-image/src/BpkBackgroundImage.js +2 -1
  34. package/bpk-component-image/src/BpkImage.js +2 -1
  35. package/bpk-component-info-banner/src/BpkInfoBanner.js +2 -0
  36. package/bpk-component-info-banner/src/BpkInfoBannerDismissable.js +2 -0
  37. package/bpk-component-info-banner/src/BpkInfoBannerExpandable.js +2 -0
  38. package/bpk-component-input/src/BpkInput.js +2 -1
  39. package/bpk-component-inset-banner/src/BpkInsetBanner.js +2 -1
  40. package/bpk-component-inset-banner/src/BpkInsetBannerV2/BpkInsetBannerSponsored.js +2 -1
  41. package/bpk-component-link/src/BpkButtonLink.js +2 -1
  42. package/bpk-component-link/src/BpkLink.js +2 -1
  43. package/bpk-component-list/index.d.ts +5 -0
  44. package/bpk-component-list/index.js +3 -1
  45. package/bpk-component-list/src/BpkList.d.ts +11 -0
  46. package/bpk-component-list/src/BpkList.js +10 -15
  47. package/bpk-component-list/src/BpkListItem.d.ts +7 -0
  48. package/bpk-component-list/src/BpkListItem.js +2 -5
  49. package/bpk-component-loading-button/src/BpkLoadingButton.js +2 -1
  50. package/bpk-component-mobile-scroll-container/src/BpkMobileScrollContainer.js +2 -1
  51. package/bpk-component-modal/src/BpkModal.js +2 -1
  52. package/bpk-component-modal/src/BpkModalV2/BpkModal.js +2 -1
  53. package/bpk-component-navigation-bar/src/BpkNavigationBar.js +2 -1
  54. package/bpk-component-navigation-bar/src/BpkNavigationBarButtonLink.js +2 -0
  55. package/bpk-component-navigation-bar/src/BpkNavigationBarIconButton.js +2 -0
  56. package/bpk-component-navigation-tab-group/src/BpkNavigationTabGroup.js +2 -1
  57. package/bpk-component-nudger/src/BpkNudger.js +2 -1
  58. package/bpk-component-overlay/src/BpkOverlay.js +2 -1
  59. package/bpk-component-panel/src/BpkPanel.js +2 -1
  60. package/bpk-component-popover/src/BpkPopover.js +2 -1
  61. package/bpk-component-rating/src/BpkRating.js +2 -1
  62. package/bpk-component-rtl-toggle/src/BpkRtlToggle.js +2 -0
  63. package/bpk-component-section-header/src/BpkSectionHeader.js +2 -1
  64. package/bpk-component-segmented-control/src/BpkSegmentedControl.js +2 -1
  65. package/bpk-component-skeleton/src/BpkBaseSkeleton.js +2 -1
  66. package/bpk-component-slider/src/BpkSlider.js +2 -1
  67. package/bpk-component-spinner/src/BpkExtraLargeSpinner.js +2 -1
  68. package/bpk-component-spinner/src/BpkLargeSpinner.js +2 -1
  69. package/bpk-component-spinner/src/BpkSpinner.js +2 -1
  70. package/bpk-component-split-input/src/BpkInputField.js +2 -1
  71. package/bpk-component-split-input/src/BpkSplitInput.js +2 -1
  72. package/bpk-component-swap-button/src/BpkSwapButton.js +2 -1
  73. package/bpk-component-switch/src/BpkSwitch.js +2 -1
  74. package/bpk-component-textarea/src/BpkTextarea.js +2 -1
  75. package/bpk-component-theme-toggle/src/BpkThemeToggle.js +2 -0
  76. 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 BpkInfoBannerInner from "./BpkInfoBannerInner";
20
21
  import { jsx as _jsx } from "react/jsx-runtime";
21
22
  const BpkInfoBanner = ({
@@ -29,6 +30,7 @@ const BpkInfoBanner = ({
29
30
  animateOnLeave: animateOnLeave,
30
31
  show: show,
31
32
  icon: icon,
33
+ ...getDataComponentAttribute('InfoBanner'),
32
34
  ...rest
33
35
  });
34
36
  export default BpkInfoBanner;
@@ -16,6 +16,7 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
+ import { getDataComponentAttribute } from "../../bpk-react-utils";
19
20
  import BpkInfoBannerInner, { CONFIGURATION } from "./BpkInfoBannerInner";
20
21
  import { jsx as _jsx } from "react/jsx-runtime";
21
22
  const BpkInfoBannerDismissable = ({
@@ -24,6 +25,7 @@ const BpkInfoBannerDismissable = ({
24
25
  }) => /*#__PURE__*/_jsx(BpkInfoBannerInner, {
25
26
  configuration: CONFIGURATION.DISMISSABLE,
26
27
  onDismiss: onDismiss,
28
+ ...getDataComponentAttribute('InfoBannerDismissable'),
27
29
  ...rest
28
30
  });
29
31
  export default BpkInfoBannerDismissable;
@@ -16,6 +16,7 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
+ import { getDataComponentAttribute } from "../../bpk-react-utils";
19
20
  import BpkInfoBannerInner, { CONFIGURATION } from "./BpkInfoBannerInner";
20
21
  import { jsx as _jsx } from "react/jsx-runtime";
21
22
  const BpkInfoBannerExpandable = ({
@@ -29,6 +30,7 @@ const BpkInfoBannerExpandable = ({
29
30
  configuration: CONFIGURATION.EXPANDABLE,
30
31
  expanded: expanded,
31
32
  onExpandToggle: onExpandToggle,
33
+ ...getDataComponentAttribute('InfoBannerExpandable'),
32
34
  ...rest,
33
35
  children: children
34
36
  });
@@ -19,7 +19,7 @@
19
19
  import { Component } from 'react';
20
20
  import { withButtonAlignment } from "../../bpk-component-icon";
21
21
  import ClearIcon from "../../bpk-component-icon/sm/close-circle";
22
- import { cssModules } from "../../bpk-react-utils";
22
+ import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
23
23
  import { CLEAR_BUTTON_MODES, defaultProps } from "./common-types";
24
24
  import STYLES from "./BpkInput.module.css";
25
25
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -107,6 +107,7 @@ class BpkInput extends Component {
107
107
  "aria-invalid": isInvalid,
108
108
  value: value,
109
109
  name: name,
110
+ ...getDataComponentAttribute('Input'),
110
111
  ...rest
111
112
  });
112
113
 
@@ -19,7 +19,7 @@ import { surfaceHighlightDay } from '@skyscanner/bpk-foundations-web/tokens/base
19
19
  import InfoIcon from "../../bpk-component-icon/sm/information-circle";
20
20
  import BpkPopover from "../../bpk-component-popover/src/BpkPopover";
21
21
  import BpkText, { TEXT_STYLES } from "../../bpk-component-text/src/BpkText";
22
- import { cssModules } from "../../bpk-react-utils";
22
+ import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
23
23
  import STYLES from "./BpkInsetBanner.module.css";
24
24
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
25
25
  const getClassName = cssModules(STYLES);
@@ -42,6 +42,7 @@ const BpkInsetBanner = ({
42
42
  const popoverMarginStart = callToAction?.popoverMarginStart || 'auto';
43
43
  const popoverMarginEnd = callToAction?.popoverMarginEnd || 'auto';
44
44
  return /*#__PURE__*/_jsxs("div", {
45
+ ...getDataComponentAttribute('InsetBanner'),
45
46
  children: [/*#__PURE__*/_jsxs("div", {
46
47
  "aria-label": accessibilityLabel,
47
48
  className: classNames,
@@ -23,7 +23,7 @@ import ViewIcon from "../../../bpk-component-icon/lg/view";
23
23
  import InfoIcon from "../../../bpk-component-icon/sm/information-circle";
24
24
  import BpkImage from "../../../bpk-component-image";
25
25
  import BpkText, { TEXT_STYLES } from "../../../bpk-component-text/src/BpkText";
26
- import { cssModules } from "../../../bpk-react-utils";
26
+ import { cssModules, getDataComponentAttribute } from "../../../bpk-react-utils";
27
27
  import { VARIANT } from "./common-types";
28
28
  import STYLES from "./BpkInsetBannerSponsored.module.css";
29
29
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -43,6 +43,7 @@ const BpkInsetBannerSponsored = ({
43
43
  const classNames = getClassName('bpk-inset-banner', `bpk-inset-banner--${variant}`, image && 'bpk-inset-banner--with-image');
44
44
  const [sheetOpen, setSheetOpen] = useState(false);
45
45
  return /*#__PURE__*/_jsxs("div", {
46
+ ...getDataComponentAttribute('InsetBannerSponsored'),
46
47
  children: [/*#__PURE__*/_jsxs("div", {
47
48
  "aria-label": accessibilityLabel,
48
49
  className: classNames,
@@ -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 themeAttributes from "./themeAttributes";
21
21
  import STYLES from "./BpkLink.module.css";
22
22
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -60,6 +60,7 @@ const BpkButtonLink = ({
60
60
  return /*#__PURE__*/_jsx("button", {
61
61
  type: "button",
62
62
  className: classNames.join(' '),
63
+ ...getDataComponentAttribute('ButtonLink'),
63
64
  onClick: onClick,
64
65
  ...rest,
65
66
  children: /*#__PURE__*/_jsx("span", {
@@ -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 "./BpkLink.module.css";
22
22
  import { jsx as _jsx } from "react/jsx-runtime";
23
23
  const getClassName = cssModules(STYLES);
@@ -103,6 +103,7 @@ const BpkLinkInner = ({
103
103
  className: linkClassName,
104
104
  ref: ref,
105
105
  ...elementProps,
106
+ ...getDataComponentAttribute('Link'),
106
107
  children: /*#__PURE__*/_jsx("span", {
107
108
  className: underlinedClassName,
108
109
  children: children
@@ -0,0 +1,5 @@
1
+ import BpkList from './src/BpkList';
2
+ import BpkListItem from './src/BpkListItem';
3
+ export type { Props as BpkListProps } from './src/BpkList';
4
+ export type { Props as BpkListItemProps } from './src/BpkListItem';
5
+ export { BpkList, BpkListItem };
@@ -14,6 +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 BpkList from "./src/BpkList";
17
+ */
18
+
19
+ import BpkList from "./src/BpkList";
18
20
  import BpkListItem from "./src/BpkListItem";
19
21
  export { BpkList, BpkListItem };
@@ -0,0 +1,11 @@
1
+ import type { ReactNode } from 'react';
2
+ export type Props = {
3
+ children: ReactNode;
4
+ ordered?: boolean;
5
+ className?: string | null;
6
+ ariaLabel?: string;
7
+ ariaLabelledby?: string;
8
+ title?: string;
9
+ };
10
+ declare const BpkList: ({ ariaLabel, ariaLabelledby, children, className, ordered, title, }: Props) => import("react/jsx-runtime").JSX.Element;
11
+ export default BpkList;
@@ -14,35 +14,30 @@
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 PropTypes from 'prop-types';
17
+ */
18
+
18
19
  import { cssModules } from "../../bpk-react-utils";
19
20
  import STYLES from "./BpkList.module.css";
20
21
  import { jsx as _jsx } from "react/jsx-runtime";
21
22
  const getClassName = cssModules(STYLES);
22
23
  const BpkList = ({
23
- ariaLabel = null,
24
- ariaLabelledby = null,
24
+ ariaLabel,
25
+ ariaLabelledby,
25
26
  children,
26
27
  className = null,
27
28
  ordered = false,
28
- title = null
29
+ title
29
30
  }) => {
30
- const ListElements = ordered ? 'ol' : 'ul';
31
+ const ListElement = ordered ? 'ol' : 'ul';
31
32
  const classNames = getClassName('bpk-list', className);
32
- return /*#__PURE__*/_jsx(ListElements, {
33
+ return /*#__PURE__*/_jsx(ListElement, {
33
34
  "aria-label": ariaLabel,
34
35
  "aria-labelledby": ariaLabelledby,
35
- title: title,
36
+ title: title
37
+ // eslint-disable-next-line @skyscanner/rules/forbid-component-props -- className is required to apply Bpk list styles and allow optional consumer-supplied classes
38
+ ,
36
39
  className: classNames,
37
40
  children: children
38
41
  });
39
42
  };
40
- BpkList.propTypes = {
41
- children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired,
42
- ordered: PropTypes.bool,
43
- className: PropTypes.string,
44
- ariaLabel: PropTypes.string,
45
- ariaLabelledby: PropTypes.string,
46
- title: PropTypes.string
47
- };
48
43
  export default BpkList;
@@ -0,0 +1,7 @@
1
+ import type { ReactNode } from 'react';
2
+ export type Props = {
3
+ children: ReactNode;
4
+ className?: string | null;
5
+ };
6
+ declare const BpkListItem: ({ children, className }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export default BpkListItem;
@@ -14,7 +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 PropTypes from 'prop-types';
17
+ */
18
+
18
19
  import { cssModules } from "../../bpk-react-utils";
19
20
  import STYLES from "./BpkList.module.css";
20
21
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -29,8 +30,4 @@ const BpkListItem = ({
29
30
  children: children
30
31
  });
31
32
  };
32
- BpkListItem.propTypes = {
33
- children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired,
34
- className: PropTypes.string
35
- };
36
33
  export default BpkListItem;
@@ -21,7 +21,7 @@ import { withButtonAlignment, withLargeButtonAlignment, withRtlSupport } from ".
21
21
  import ArrowIconLg from "../../bpk-component-icon/lg/long-arrow-right";
22
22
  import ArrowIconSm from "../../bpk-component-icon/sm/long-arrow-right";
23
23
  import { BpkSpinner, BpkLargeSpinner } from "../../bpk-component-spinner";
24
- import { cssModules } from "../../bpk-react-utils";
24
+ import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
25
25
  import STYLES from "./BpkLoadingButton.module.css";
26
26
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
27
27
  const getClassName = cssModules(STYLES);
@@ -113,6 +113,7 @@ const BpkLoadingButton = props => {
113
113
  disabled: showBtnDisabled,
114
114
  size: large ? SIZE_TYPES.large : SIZE_TYPES.small,
115
115
  type: type,
116
+ ...getDataComponentAttribute('LoadingButton'),
116
117
  ...rest,
117
118
  children: /*#__PURE__*/_jsxs("div", {
118
119
  className: getClassName('bpk-loading-button__container'),
@@ -18,7 +18,7 @@
18
18
 
19
19
  import { Component } from 'react';
20
20
  import debounce from 'lodash/debounce';
21
- import { cssModules, isRTL } from "../../bpk-react-utils";
21
+ import { cssModules, isRTL, getDataComponentAttribute } from "../../bpk-react-utils";
22
22
  import STYLES from "./BpkMobileScrollContainer.module.css";
23
23
  import { jsx as _jsx } from "react/jsx-runtime";
24
24
  const getClassName = cssModules(STYLES);
@@ -131,6 +131,7 @@ class BpkMobileScrollContainer extends Component {
131
131
  ...style,
132
132
  height: this.state.computedHeight
133
133
  },
134
+ ...getDataComponentAttribute('MobileScrollContainer'),
134
135
  children: /*#__PURE__*/_jsx("div", {
135
136
  ref: el => {
136
137
  if (scrollerRef) {
@@ -16,7 +16,7 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- import { Portal, cssModules, isDeviceIphone } from "../../bpk-react-utils";
19
+ import { Portal, cssModules, isDeviceIphone, getDataComponentAttribute } from "../../bpk-react-utils";
20
20
  import { withScrim } from "../../bpk-scrim-utils";
21
21
  import BpkModalInner, { MODAL_STYLING } from "./BpkModalInner";
22
22
  import STYLES from "./BpkModal.module.css";
@@ -74,6 +74,7 @@ const BpkModal = ({
74
74
  accessoryView: accessoryView,
75
75
  dialogRef: dialogRef,
76
76
  modalStyle: modalStyle,
77
+ ...getDataComponentAttribute('Modal'),
77
78
  ...rest
78
79
  })
79
80
  });
@@ -21,7 +21,7 @@ import { useEffect, useRef } from 'react';
21
21
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
22
22
  import BpkCloseButton from "../../../bpk-component-close-button";
23
23
  import BpkText, { TEXT_STYLES } from "../../../bpk-component-text";
24
- import { cssModules, withDefaultProps } from "../../../bpk-react-utils";
24
+ import { cssModules, withDefaultProps, getDataComponentAttribute } from "../../../bpk-react-utils";
25
25
  import { MODAL_STYLING } from "../BpkModalInner";
26
26
  import STYLES from "./BpKModal.module.css";
27
27
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -137,6 +137,7 @@ export const BpkModalV2 = props => {
137
137
  const contentClassNames = getClassName('bpk-modal__container', fullScreenOnDesktop && 'bpk-modal__container--full-screen-desktop', padded && 'bpk-modal__container--padded', modalStyle === MODAL_STYLING.surfaceContrast && 'bpk-modal__container--surface-contrast');
138
138
  return isOpen ? /*#__PURE__*/_jsxs("div", {
139
139
  className: getClassName('bpk-modal-wrapper', dialogSupported ? '' : 'bpk-modal-polyfill'),
140
+ ...getDataComponentAttribute('ModalV2'),
140
141
  children: [!dialogSupported && /*#__PURE__*/_jsx("div", {
141
142
  id: `${id}-polyfill`,
142
143
  className: getClassName('bpk-modal-backdrop'),
@@ -17,7 +17,7 @@
17
17
  */
18
18
 
19
19
  import BpkText, { TEXT_STYLES } from "../../bpk-component-text";
20
- import { cssModules } from "../../bpk-react-utils";
20
+ import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
21
21
  import STYLES from "./BpkNavigationBar.module.css";
22
22
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
23
23
  const getClassNames = cssModules(STYLES);
@@ -45,6 +45,7 @@ const BpkNavigationBar = props => {
45
45
  return /*#__PURE__*/_jsxs("nav", {
46
46
  "aria-labelledby": titleId,
47
47
  className: getClassNames('bpk-navigation-bar', `bpk-navigation-bar--${barStyle}`, sticky && 'bpk-navigation-bar__sticky', className),
48
+ ...getDataComponentAttribute('NavigationBar'),
48
49
  ...rest,
49
50
  children: [leadingButton && /*#__PURE__*/_jsx("div", {
50
51
  className: getClassNames('bpk-navigation-bar__leading-item', `bpk-navigation-bar__leading-item--${barStyle}`),
@@ -17,6 +17,7 @@
17
17
  */
18
18
 
19
19
  import BpkLink from "../../bpk-component-link";
20
+ import { getDataComponentAttribute } from "../../bpk-react-utils";
20
21
  import { BAR_STYLES } from "./BpkNavigationBar";
21
22
  import { jsx as _jsx } from "react/jsx-runtime";
22
23
  const BpkNavigationBarButtonLink = ({
@@ -26,6 +27,7 @@ const BpkNavigationBarButtonLink = ({
26
27
  ...rest
27
28
  }) => /*#__PURE__*/_jsx("span", {
28
29
  className: className,
30
+ ...getDataComponentAttribute('NavigationBarButtonLink'),
29
31
  children: /*#__PURE__*/_jsx(BpkLink, {
30
32
  as: "button",
31
33
  alternate: barStyle === BAR_STYLES.onDark,
@@ -18,6 +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 { getDataComponentAttribute } from "../../bpk-react-utils";
21
22
  import { BAR_STYLES } from "./BpkNavigationBar";
22
23
  import { jsx as _jsx } from "react/jsx-runtime";
23
24
  const BpkNavigationBarIconButton = ({
@@ -27,6 +28,7 @@ const BpkNavigationBarIconButton = ({
27
28
  ...rest
28
29
  }) => /*#__PURE__*/_jsx("span", {
29
30
  className: className,
31
+ ...getDataComponentAttribute('NavigationBarIconButton'),
30
32
  children: /*#__PURE__*/_jsx(BpkCloseButton, {
31
33
  customIcon: icon,
32
34
  onDark: barStyle === BAR_STYLES.onDark,
@@ -19,7 +19,7 @@
19
19
  import { useState } from 'react';
20
20
  import BpkBubble from "../../bpk-component-bubble/src/BpkBubble";
21
21
  import BpkText, { TEXT_STYLES } from "../../bpk-component-text";
22
- import { cssModules } from "../../bpk-react-utils";
22
+ import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
23
23
  import STYLES from "./BpkNavigationTabGroup.module.css";
24
24
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
25
25
  const getClassName = cssModules(STYLES);
@@ -76,6 +76,7 @@ const BpkNavigationTabGroup = ({
76
76
  className: containerStyling,
77
77
  role: "navigation",
78
78
  "aria-label": ariaLabel,
79
+ ...getDataComponentAttribute('NavigationTabGroup'),
79
80
  children: /*#__PURE__*/_jsx("div", {
80
81
  role: "tablist",
81
82
  className: getClassName('bpk-navigation-tab-list'),
@@ -23,7 +23,7 @@ import MinusIcon from "../../bpk-component-icon/sm/minus";
23
23
  import PlusIcon from "../../bpk-component-icon/sm/plus";
24
24
  import BpkLabel from "../../bpk-component-label";
25
25
  import BpkText, { TEXT_STYLES } from "../../bpk-component-text";
26
- import { cssModules, setNativeValue } from "../../bpk-react-utils";
26
+ import { cssModules, setNativeValue, getDataComponentAttribute } from "../../bpk-react-utils";
27
27
  import STYLES from "./BpkNudger.module.css";
28
28
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
29
29
  const getClassName = cssModules(STYLES);
@@ -133,6 +133,7 @@ const BpkNudger = ({
133
133
  valueLimitter(inputElement);
134
134
  },
135
135
  className: inputClassNames,
136
+ ...getDataComponentAttribute('Nudger'),
136
137
  ...rest
137
138
  }), /*#__PURE__*/_jsx(BpkButton, {
138
139
  type: BUTTON_TYPES[buttonType],
@@ -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 "./BpkOverlay.module.css";
21
21
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
22
22
  const getClassName = cssModules(STYLES);
@@ -74,6 +74,7 @@ const BpkOverlay = props => {
74
74
  const overlayClassNames = getClassName('bpk-overlay__overlay', overlayType !== undefined && overlayType !== null && overlayType !== OVERLAY_TYPES.off && `bpk-overlay__overlay--${overlayTypeClassSuffixes[overlayType]}`);
75
75
  return /*#__PURE__*/_jsxs("div", {
76
76
  className: wrapperClassNames,
77
+ ...getDataComponentAttribute('Overlay'),
77
78
  ...rest,
78
79
  children: [children, /*#__PURE__*/_jsx("div", {
79
80
  className: overlayClassNames,
@@ -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 "./BpkPanel.module.css";
21
21
  import { jsx as _jsx } from "react/jsx-runtime";
22
22
  const getClassName = cssModules(STYLES);
@@ -47,6 +47,7 @@ const BpkPanel = ({
47
47
  }
48
48
  return /*#__PURE__*/_jsx("section", {
49
49
  className: classNames.join(' '),
50
+ ...getDataComponentAttribute('Panel'),
50
51
  ...rest,
51
52
  children: children
52
53
  });
@@ -24,7 +24,7 @@ import { surfaceHighlightDay } from '@skyscanner/bpk-foundations-web/tokens/base
24
24
  import BpkCloseButton from "../../bpk-component-close-button";
25
25
  import BpkLink from "../../bpk-component-link";
26
26
  import BpkText, { TEXT_STYLES } from "../../bpk-component-text";
27
- import { TransitionInitialMount, cssModules } from "../../bpk-react-utils";
27
+ import { TransitionInitialMount, cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
28
28
  import { ARROW_ID } from "./constants";
29
29
  import STYLES from "./BpkPopover.module.css";
30
30
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
@@ -156,6 +156,7 @@ const BpkPopover = ({
156
156
  role: "dialog",
157
157
  "aria-labelledby": labelId,
158
158
  className: classNames,
159
+ ...getDataComponentAttribute('Popover'),
159
160
  ...rest,
160
161
  children: [showArrow && /*#__PURE__*/_jsx(FloatingArrow, {
161
162
  ref: arrowRef,
@@ -18,7 +18,7 @@
18
18
 
19
19
  import clamp from 'lodash.clamp';
20
20
  import BpkText, { TEXT_STYLES } from "../../bpk-component-text";
21
- import { cssModules } from "../../bpk-react-utils";
21
+ import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
22
22
  import { RATING_SIZES, RATING_SCALES } from "./common-types";
23
23
  import STYLES from "./BpkRating.module.css";
24
24
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -73,6 +73,7 @@ const BpkRating = ({
73
73
  }
74
74
  return /*#__PURE__*/_jsxs("div", {
75
75
  className: classNames,
76
+ ...getDataComponentAttribute('Rating'),
76
77
  "aria-label": ariaLabel,
77
78
  role: "figure",
78
79
  ...rest,
@@ -18,6 +18,7 @@
18
18
 
19
19
  import { Component } from 'react';
20
20
  import BpkLink from "../../bpk-component-link";
21
+ import { getDataComponentAttribute } from "../../bpk-react-utils";
21
22
  import { getHtmlElement, DIRECTIONS, DIRECTION_CHANGE_EVENT } from "./utils";
22
23
  import { jsxs as _jsxs } from "react/jsx-runtime";
23
24
  const getDirection = () => {
@@ -63,6 +64,7 @@ class BpkRtlToggle extends Component {
63
64
  as: "button",
64
65
  title: "Keyboard Shortcut: ctrl + cmd + r",
65
66
  onClick: this.toggleRtl,
67
+ ...getDataComponentAttribute('RtlToggle'),
66
68
  children: ["RTL ", onOrOff]
67
69
  });
68
70
  }
@@ -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 "./BpkSectionHeader.module.css";
22
22
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
23
23
  const getClassName = cssModules(STYLES);
@@ -32,6 +32,7 @@ const BpkSectionHeader = ({
32
32
  type = SECTION_TYPES.default
33
33
  }) => /*#__PURE__*/_jsxs("div", {
34
34
  className: getClassName('bpk-section-header'),
35
+ ...getDataComponentAttribute('SectionHeader'),
35
36
  children: [/*#__PURE__*/_jsxs("div", {
36
37
  className: getClassName('bpk-section-header__title-description', `bpk-section-header__title-description--${type}`),
37
38
  children: [/*#__PURE__*/_jsx("h2", {
@@ -17,7 +17,7 @@
17
17
  */
18
18
 
19
19
  import { useId, useMemo, useRef, useState } from 'react';
20
- import { cssModules, isRTL } from "../../bpk-react-utils";
20
+ import { cssModules, isRTL, getDataComponentAttribute } from "../../bpk-react-utils";
21
21
  import STYLES from "./BpkSegmentedControl.module.css";
22
22
  import { jsx as _jsx } from "react/jsx-runtime";
23
23
  const getClassName = cssModules(STYLES);
@@ -166,6 +166,7 @@ const BpkSegmentedControl = ({
166
166
  const containerStyling = getClassName('bpk-segmented-control-group', shadow && 'bpk-segmented-control-group-shadow');
167
167
  return /*#__PURE__*/_jsx("div", {
168
168
  className: containerStyling,
169
+ ...getDataComponentAttribute('SegmentedControl'),
169
170
  ...getContainerAriaProps(providedId, label),
170
171
  children: buttonContents.map((content, index) => {
171
172
  const isSelected = index === selectedButton;
@@ -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 "./BpkBaseSkeleton.module.css";
21
21
  import { jsx as _jsx } from "react/jsx-runtime";
22
22
  const getClassName = cssModules(STYLES);
@@ -25,6 +25,7 @@ const BpkBaseSkeleton = ({
25
25
  styleObj = undefined
26
26
  }) => /*#__PURE__*/_jsx("div", {
27
27
  className: getClassName('bpk-skeleton', skeletonStyle),
28
+ ...getDataComponentAttribute('BaseSkeleton'),
28
29
  style: styleObj
29
30
  });
30
31
  export default BpkBaseSkeleton;
@@ -18,7 +18,7 @@
18
18
  import { forwardRef, useRef, useEffect, useCallback } from 'react';
19
19
  import { useComposedRefs } from '@radix-ui/react-compose-refs';
20
20
  import * as Slider from '@radix-ui/react-slider';
21
- import { cssModules, isRTL, setNativeValue } from "../../bpk-react-utils";
21
+ import { cssModules, isRTL, setNativeValue, getDataComponentAttribute } from "../../bpk-react-utils";
22
22
  import STYLES from "./BpkSlider.module.css";
23
23
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
24
  const getClassName = cssModules(STYLES);
@@ -114,6 +114,7 @@ const BpkSlider = ({
114
114
  }, []);
115
115
  return /*#__PURE__*/_jsxs(Slider.Root, {
116
116
  className: getClassName('bpk-slider'),
117
+ ...getDataComponentAttribute('Slider'),
117
118
  defaultValue: currentValue,
118
119
  min: min,
119
120
  max: max,
@@ -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 SPINNER_TYPES from "./spinnerTypes";
21
21
  import XlSpinner from "./spinners/xl";
22
22
  import STYLES from "./BpkSpinner.module.css";
@@ -30,6 +30,7 @@ const BpkExtraLargeSpinner = ({
30
30
  const classNames = getClassName('bpk-spinner', 'bpk-spinner--extra-large', `bpk-spinner--${type}`, className);
31
31
  return /*#__PURE__*/_jsx("span", {
32
32
  className: classNames,
33
+ ...getDataComponentAttribute('ExtraLargeSpinner'),
33
34
  children: /*#__PURE__*/_jsx(XlSpinner, {
34
35
  ...rest
35
36
  })
@@ -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 SPINNER_TYPES from "./spinnerTypes";
21
21
  import LgSpinner from "./spinners/lg";
22
22
  import STYLES from "./BpkSpinner.module.css";
@@ -31,6 +31,7 @@ const BpkLargeSpinner = ({
31
31
  const classNames = getClassName('bpk-spinner', 'bpk-spinner--large', `bpk-spinner--${type}`, alignToButton && 'bpk-spinner--align-to-large-button', className);
32
32
  return /*#__PURE__*/_jsx("span", {
33
33
  className: classNames,
34
+ ...getDataComponentAttribute('LargeSpinner'),
34
35
  children: /*#__PURE__*/_jsx(LgSpinner, {
35
36
  ...rest
36
37
  })
@@ -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 SPINNER_TYPES from "./spinnerTypes";
21
21
  import SmSpinner from "./spinners/sm";
22
22
  import STYLES from "./BpkSpinner.module.css";
@@ -31,6 +31,7 @@ const BpkSpinner = ({
31
31
  const classNames = getClassName('bpk-spinner', `bpk-spinner--${type}`, alignToButton && 'bpk-spinner--align-to-button', className);
32
32
  return /*#__PURE__*/_jsx("span", {
33
33
  className: classNames,
34
+ ...getDataComponentAttribute('Spinner'),
34
35
  children: /*#__PURE__*/_jsx(SmSpinner, {
35
36
  ...rest
36
37
  })
@@ -18,7 +18,7 @@
18
18
 
19
19
  import { PureComponent } from 'react';
20
20
  import BpkInput from "../../bpk-component-input";
21
- import { cssModules } from "../../bpk-react-utils";
21
+ import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
22
22
  import STYLES from "./BpkInputField.module.css";
23
23
  import { jsx as _jsx } from "react/jsx-runtime";
24
24
  const getClassName = cssModules(STYLES);
@@ -49,6 +49,7 @@ class BpkInputField extends PureComponent {
49
49
  } = this.props;
50
50
  return /*#__PURE__*/_jsx("div", {
51
51
  className: getClassName('bpk-input-field'),
52
+ ...getDataComponentAttribute('InputField'),
52
53
  children: /*#__PURE__*/_jsx(BpkInput, {
53
54
  id: id,
54
55
  autoComplete: "off",