@skyscanner/backpack-web 41.9.0 → 41.10.0-beta-v1

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 (104) 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-layout/index.d.ts +18 -0
  42. package/bpk-component-layout/index.js +29 -0
  43. package/bpk-component-layout/src/BpkBox.d.ts +3 -0
  44. package/bpk-component-layout/src/BpkBox.js +33 -0
  45. package/bpk-component-layout/src/BpkFlex.d.ts +3 -0
  46. package/bpk-component-layout/src/BpkFlex.js +51 -0
  47. package/bpk-component-layout/src/BpkGrid.d.ts +3 -0
  48. package/bpk-component-layout/src/BpkGrid.js +57 -0
  49. package/bpk-component-layout/src/BpkGridItem.d.ts +3 -0
  50. package/bpk-component-layout/src/BpkGridItem.js +45 -0
  51. package/bpk-component-layout/src/BpkProvider.d.ts +14 -0
  52. package/bpk-component-layout/src/BpkProvider.js +42 -0
  53. package/bpk-component-layout/src/BpkStack.constant.d.ts +2 -0
  54. package/bpk-component-layout/src/BpkStack.constant.js +22 -0
  55. package/bpk-component-layout/src/BpkStack.d.ts +5 -0
  56. package/bpk-component-layout/src/BpkStack.js +57 -0
  57. package/bpk-component-layout/src/BpkVessel.d.ts +46 -0
  58. package/bpk-component-layout/src/BpkVessel.js +70 -0
  59. package/bpk-component-layout/src/commonProps.d.ts +86 -0
  60. package/bpk-component-layout/src/commonProps.js +1 -0
  61. package/bpk-component-layout/src/theme.d.ts +36 -0
  62. package/bpk-component-layout/src/theme.js +229 -0
  63. package/bpk-component-layout/src/tokenUtils.d.ts +108 -0
  64. package/bpk-component-layout/src/tokenUtils.js +323 -0
  65. package/bpk-component-layout/src/tokens.d.ts +96 -0
  66. package/bpk-component-layout/src/tokens.js +138 -0
  67. package/bpk-component-layout/src/types.d.ts +236 -0
  68. package/bpk-component-layout/src/types.js +1 -0
  69. package/bpk-component-link/src/BpkButtonLink.js +2 -1
  70. package/bpk-component-link/src/BpkLink.js +2 -1
  71. package/bpk-component-list/index.d.ts +5 -0
  72. package/bpk-component-list/index.js +3 -1
  73. package/bpk-component-list/src/BpkList.d.ts +11 -0
  74. package/bpk-component-list/src/BpkList.js +10 -15
  75. package/bpk-component-list/src/BpkListItem.d.ts +7 -0
  76. package/bpk-component-list/src/BpkListItem.js +2 -5
  77. package/bpk-component-loading-button/src/BpkLoadingButton.js +2 -1
  78. package/bpk-component-mobile-scroll-container/src/BpkMobileScrollContainer.js +2 -1
  79. package/bpk-component-modal/src/BpkModal.js +2 -1
  80. package/bpk-component-modal/src/BpkModalV2/BpkModal.js +2 -1
  81. package/bpk-component-navigation-bar/src/BpkNavigationBar.js +2 -1
  82. package/bpk-component-navigation-bar/src/BpkNavigationBarButtonLink.js +2 -0
  83. package/bpk-component-navigation-bar/src/BpkNavigationBarIconButton.js +2 -0
  84. package/bpk-component-navigation-tab-group/src/BpkNavigationTabGroup.js +2 -1
  85. package/bpk-component-nudger/src/BpkNudger.js +2 -1
  86. package/bpk-component-overlay/src/BpkOverlay.js +2 -1
  87. package/bpk-component-panel/src/BpkPanel.js +2 -1
  88. package/bpk-component-popover/src/BpkPopover.js +2 -1
  89. package/bpk-component-rating/src/BpkRating.js +2 -1
  90. package/bpk-component-rtl-toggle/src/BpkRtlToggle.js +2 -0
  91. package/bpk-component-section-header/src/BpkSectionHeader.js +2 -1
  92. package/bpk-component-segmented-control/src/BpkSegmentedControl.js +2 -1
  93. package/bpk-component-skeleton/src/BpkBaseSkeleton.js +2 -1
  94. package/bpk-component-slider/src/BpkSlider.js +2 -1
  95. package/bpk-component-spinner/src/BpkExtraLargeSpinner.js +2 -1
  96. package/bpk-component-spinner/src/BpkLargeSpinner.js +2 -1
  97. package/bpk-component-spinner/src/BpkSpinner.js +2 -1
  98. package/bpk-component-split-input/src/BpkInputField.js +2 -1
  99. package/bpk-component-split-input/src/BpkSplitInput.js +2 -1
  100. package/bpk-component-swap-button/src/BpkSwapButton.js +2 -1
  101. package/bpk-component-switch/src/BpkSwitch.js +2 -1
  102. package/bpk-component-textarea/src/BpkTextarea.js +2 -1
  103. package/bpk-component-theme-toggle/src/BpkThemeToggle.js +2 -0
  104. package/package.json +2 -1
@@ -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",
@@ -18,7 +18,7 @@
18
18
 
19
19
  import { Component } from 'react';
20
20
  import { INPUT_TYPES } from "../../bpk-component-input";
21
- import { cssModules } from "../../bpk-react-utils";
21
+ import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
22
22
  import InputField from "./BpkInputField";
23
23
  import STYLES from "./BpkSplitInput.module.css";
24
24
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -203,6 +203,7 @@ class BpkSplitInput extends Component {
203
203
  render() {
204
204
  return /*#__PURE__*/_jsx("div", {
205
205
  className: getClassName('bpk-split-input'),
206
+ ...getDataComponentAttribute('SplitInput'),
206
207
  children: this.renderInputs()
207
208
  });
208
209
  }
@@ -18,7 +18,7 @@
18
18
 
19
19
  import { useState } from 'react';
20
20
  import SwapVertical from "../../bpk-component-icon/sm/swap--vertical";
21
- import { cssModules } from "../../bpk-react-utils";
21
+ import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
22
22
  import STYLES from "./BpkSwapButton.module.css";
23
23
  import { jsx as _jsx } from "react/jsx-runtime";
24
24
  const getClassName = cssModules(STYLES);
@@ -43,6 +43,7 @@ const BpkSwapButton = props => {
43
43
  };
44
44
  return /*#__PURE__*/_jsx("div", {
45
45
  className: getClassName('bpk-swap-button'),
46
+ ...getDataComponentAttribute('SwapButton'),
46
47
  children: /*#__PURE__*/_jsx("button", {
47
48
  type: "button",
48
49
  className: getClassName('bpk-swap-button__button', `bpk-swap-button__button--${swapButtonStyle}`),
@@ -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 "./BpkSwitch.module.css";
21
21
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
22
22
  const getClassName = cssModules(STYLES);
@@ -29,6 +29,7 @@ const BpkSwitch = ({
29
29
  const switchClassNames = getClassName('bpk-switch__switch', small && 'bpk-switch__switch--small');
30
30
  return /*#__PURE__*/_jsxs("label", {
31
31
  className: getClassName('bpk-switch', className),
32
+ ...getDataComponentAttribute('Switch'),
32
33
  children: [/*#__PURE__*/_jsx("input", {
33
34
  type: "checkbox",
34
35
  className: getClassName('bpk-switch__checkbox'),
@@ -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 "./BpkTextarea.module.css";
21
21
  import { jsx as _jsx } from "react/jsx-runtime";
22
22
  const getClassName = cssModules(STYLES);
@@ -31,6 +31,7 @@ const BpkTextarea = ({
31
31
  const isInvalid = valid === false;
32
32
  return /*#__PURE__*/_jsx("textarea", {
33
33
  className: getClassName('bpk-textarea', isInvalid && 'bpk-textarea--invalid', large && 'bpk-textarea--large', className),
34
+ ...getDataComponentAttribute('Textarea'),
34
35
  "aria-invalid": isInvalid,
35
36
  ...rest
36
37
  });
@@ -21,6 +21,7 @@ import BpkLabel from "../../bpk-component-label";
21
21
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
22
22
  import BpkSelect from "../../bpk-component-select";
23
23
  import BpkVisuallyHidden from "../../bpk-component-visually-hidden";
24
+ import { getDataComponentAttribute } from "../../bpk-react-utils";
24
25
  import bpkCustomThemes from "./theming";
25
26
  import { getHtmlElement, THEME_CHANGE_EVENT } from "./utils";
26
27
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -81,6 +82,7 @@ class BpkThemeToggle extends Component {
81
82
  ...rest
82
83
  } = this.props;
83
84
  return /*#__PURE__*/_jsxs("div", {
85
+ ...getDataComponentAttribute('ThemeToggle'),
84
86
  ...rest,
85
87
  children: [/*#__PURE__*/_jsx(BpkVisuallyHidden, {
86
88
  children: /*#__PURE__*/_jsx(BpkLabel, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyscanner/backpack-web",
3
- "version": "41.9.0",
3
+ "version": "41.10.0-beta-v1",
4
4
  "description": "Backpack Design System web library",
5
5
  "repository": {
6
6
  "type": "git",
@@ -22,6 +22,7 @@
22
22
  "access": "public"
23
23
  },
24
24
  "dependencies": {
25
+ "@chakra-ui/react": "^3.30.0",
25
26
  "@floating-ui/react": "^0.26.12",
26
27
  "@popperjs/core": "^2.11.8",
27
28
  "@radix-ui/react-compose-refs": "^1.1.1",