@skyscanner/backpack-web 41.8.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.
- package/bpk-component-badge/src/BpkBadge.js +2 -1
- 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-blockquote/src/BpkBlockquote.js +2 -1
- package/bpk-component-boilerplate/src/BpkBoilerplate.js +2 -1
- 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 +13 -8
- package/bpk-component-card-list/src/BpkCardListRowRail/BpkCardListCarousel.module.css +1 -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-close-button/src/BpkCloseButton.js +2 -1
- package/bpk-component-code/src/BpkCode.js +2 -1
- package/bpk-component-code/src/BpkCodeBlock.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-journey-arrow/src/BpkJourneyArrow.js +2 -1
- package/bpk-component-label/src/BpkLabel.js +2 -1
- package/bpk-component-layout/index.d.ts +18 -0
- package/bpk-component-layout/index.js +29 -0
- package/bpk-component-layout/src/BpkBox.d.ts +3 -0
- package/bpk-component-layout/src/BpkBox.js +33 -0
- package/bpk-component-layout/src/BpkFlex.d.ts +3 -0
- package/bpk-component-layout/src/BpkFlex.js +51 -0
- package/bpk-component-layout/src/BpkGrid.d.ts +3 -0
- package/bpk-component-layout/src/BpkGrid.js +57 -0
- package/bpk-component-layout/src/BpkGridItem.d.ts +3 -0
- package/bpk-component-layout/src/BpkGridItem.js +45 -0
- package/bpk-component-layout/src/BpkProvider.d.ts +14 -0
- package/bpk-component-layout/src/BpkProvider.js +42 -0
- package/bpk-component-layout/src/BpkStack.constant.d.ts +2 -0
- package/bpk-component-layout/src/BpkStack.constant.js +22 -0
- package/bpk-component-layout/src/BpkStack.d.ts +5 -0
- package/bpk-component-layout/src/BpkStack.js +57 -0
- package/bpk-component-layout/src/BpkVessel.d.ts +46 -0
- package/bpk-component-layout/src/BpkVessel.js +70 -0
- package/bpk-component-layout/src/commonProps.d.ts +86 -0
- package/bpk-component-layout/src/commonProps.js +1 -0
- package/bpk-component-layout/src/theme.d.ts +36 -0
- package/bpk-component-layout/src/theme.js +229 -0
- package/bpk-component-layout/src/tokenUtils.d.ts +108 -0
- package/bpk-component-layout/src/tokenUtils.js +323 -0
- package/bpk-component-layout/src/tokens.d.ts +96 -0
- package/bpk-component-layout/src/tokens.js +138 -0
- package/bpk-component-layout/src/types.d.ts +236 -0
- package/bpk-component-layout/src/types.js +1 -0
- 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-page-indicator/src/BpkPageIndicator.js +2 -1
- package/bpk-component-panel/src/BpkPanel.js +2 -1
- package/bpk-component-popover/src/BpkPopover.js +2 -1
- package/bpk-component-price-range/index.d.ts +2 -3
- package/bpk-component-price-range/index.js +2 -2
- package/bpk-component-price-range/src/BpkPriceRange.d.ts +14 -6
- package/bpk-component-price-range/src/BpkPriceRange.js +34 -14
- package/bpk-component-price-range/src/common-types.d.ts +5 -0
- package/bpk-component-price-range/src/common-types.js +4 -0
- 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-snippet/src/BpkSnippet.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-text/src/BpkText.js +2 -1
- package/bpk-component-textarea/src/BpkTextarea.js +2 -1
- package/bpk-component-theme-toggle/src/BpkThemeToggle.js +2 -0
- package/bpk-component-visually-hidden/src/BpkVisuallyHidden.js +2 -1
- package/bpk-react-utils/index.d.ts +5 -1
- package/bpk-react-utils/index.js +4 -2
- package/bpk-react-utils/src/BpkDialogWrapper/BpkDialogWrapper.js +2 -0
- package/bpk-react-utils/src/getDataComponentAttribute.d.ts +20 -0
- package/bpk-react-utils/src/getDataComponentAttribute.js +38 -0
- package/bpk-scrim-utils/src/BpkScrim.js +2 -1
- package/package.json +2 -1
|
@@ -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;
|
|
@@ -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 STYLES from "./BpkJourneyArrow.module.css";
|
|
21
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
22
|
const getClassName = cssModules(STYLES);
|
|
@@ -28,6 +28,7 @@ const BpkJourneyArrow = ({
|
|
|
28
28
|
const dotCount = Math.min(3, Math.max(0, stops));
|
|
29
29
|
return /*#__PURE__*/_jsx("div", {
|
|
30
30
|
className: getClassName("bpk-journey-arrow"),
|
|
31
|
+
...getDataComponentAttribute('JourneyArrow'),
|
|
31
32
|
...rest,
|
|
32
33
|
children: Array.from({
|
|
33
34
|
length: dotCount
|
|
@@ -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 "./BpkLabel.module.css";
|
|
21
21
|
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
22
22
|
const getClassName = cssModules(STYLES);
|
|
@@ -33,6 +33,7 @@ const BpkLabel = ({
|
|
|
33
33
|
const classNames = getClassName('bpk-label', white && 'bpk-label--white', invalid && 'bpk-label--invalid', disabled && 'bpk-label--disabled', white && disabled && 'bpk-label--disabled--white', className);
|
|
34
34
|
return /*#__PURE__*/_jsxs("label", {
|
|
35
35
|
className: classNames,
|
|
36
|
+
...getDataComponentAttribute('Label'),
|
|
36
37
|
...rest,
|
|
37
38
|
children: [children, !disabled && required && /*#__PURE__*/_jsx("span", {
|
|
38
39
|
className: getClassName('bpk-label__asterisk'),
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
export { BpkProvider } from './src/BpkProvider';
|
|
2
|
+
export { BpkBox } from './src/BpkBox';
|
|
3
|
+
export { BpkVessel } from './src/BpkVessel';
|
|
4
|
+
export { BpkFlex } from './src/BpkFlex';
|
|
5
|
+
export { BpkGrid } from './src/BpkGrid';
|
|
6
|
+
export { BpkGridItem } from './src/BpkGridItem';
|
|
7
|
+
export type { BpkProviderProps } from './src/BpkProvider';
|
|
8
|
+
export type { BpkBoxProps } from './src/BpkBox';
|
|
9
|
+
export type { BpkVesselProps } from './src/BpkVessel';
|
|
10
|
+
export type { BpkFlexProps } from './src/BpkFlex';
|
|
11
|
+
export type { BpkGridProps } from './src/BpkGrid';
|
|
12
|
+
export type { BpkGridItemProps } from './src/BpkGridItem';
|
|
13
|
+
export { BpkStack, BpkHStack, BpkVStack } from './src/BpkStack';
|
|
14
|
+
export type { BpkStackProps } from './src/BpkStack';
|
|
15
|
+
export type { BpkCommonLayoutProps, BpkBoxSpecificProps, BpkFlexSpecificProps, BpkGridSpecificProps, BpkGridItemSpecificProps, } from './src/types';
|
|
16
|
+
export type { BpkStackSpecificProps } from './src/types';
|
|
17
|
+
export type { BpkSpacingToken, BpkBreakpointToken, BpkSpacingValue, BpkBreakpointValue, } from './src/tokens';
|
|
18
|
+
export { BpkSpacing, BpkBreakpoint, isValidSpacingValue, isPercentage, } from './src/tokens';
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Backpack - Skyscanner's Design System
|
|
3
|
+
*
|
|
4
|
+
* Copyright 2016 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
|
+
export { BpkProvider } from "./src/BpkProvider";
|
|
20
|
+
export { BpkBox } from "./src/BpkBox";
|
|
21
|
+
export { BpkVessel } from "./src/BpkVessel";
|
|
22
|
+
export { BpkFlex } from "./src/BpkFlex";
|
|
23
|
+
export { BpkGrid } from "./src/BpkGrid";
|
|
24
|
+
export { BpkGridItem } from "./src/BpkGridItem";
|
|
25
|
+
export { BpkStack, BpkHStack, BpkVStack } from "./src/BpkStack";
|
|
26
|
+
|
|
27
|
+
// Export token types and utilities
|
|
28
|
+
|
|
29
|
+
export { BpkSpacing, BpkBreakpoint, isValidSpacingValue, isPercentage } from "./src/tokens";
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Backpack - Skyscanner's Design System
|
|
3
|
+
*
|
|
4
|
+
* Copyright 2016 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 { Box } from '@chakra-ui/react';
|
|
20
|
+
import { processBpkComponentProps } from "./tokenUtils";
|
|
21
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
|
+
export const BpkBox = ({
|
|
23
|
+
children,
|
|
24
|
+
...props
|
|
25
|
+
}) => {
|
|
26
|
+
const processedProps = processBpkComponentProps(props, {
|
|
27
|
+
component: 'BpkBox'
|
|
28
|
+
});
|
|
29
|
+
return /*#__PURE__*/_jsx(Box, {
|
|
30
|
+
...processedProps,
|
|
31
|
+
children: children
|
|
32
|
+
});
|
|
33
|
+
};
|
|
@@ -0,0 +1,51 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Backpack - Skyscanner's Design System
|
|
3
|
+
*
|
|
4
|
+
* Copyright 2016 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 { Flex } from '@chakra-ui/react';
|
|
20
|
+
import { processBpkComponentProps } from "./tokenUtils";
|
|
21
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
|
+
export const BpkFlex = ({
|
|
23
|
+
align,
|
|
24
|
+
basis,
|
|
25
|
+
children,
|
|
26
|
+
direction,
|
|
27
|
+
grow,
|
|
28
|
+
inline,
|
|
29
|
+
justify,
|
|
30
|
+
shrink,
|
|
31
|
+
wrap,
|
|
32
|
+
...props
|
|
33
|
+
}) => {
|
|
34
|
+
const processedProps = processBpkComponentProps(props, {
|
|
35
|
+
component: 'BpkFlex',
|
|
36
|
+
responsiveProps: {
|
|
37
|
+
flexDirection: direction,
|
|
38
|
+
justifyContent: justify,
|
|
39
|
+
alignItems: align,
|
|
40
|
+
flexWrap: wrap,
|
|
41
|
+
flexGrow: grow,
|
|
42
|
+
flexShrink: shrink,
|
|
43
|
+
flexBasis: basis
|
|
44
|
+
}
|
|
45
|
+
});
|
|
46
|
+
return /*#__PURE__*/_jsx(Flex, {
|
|
47
|
+
...processedProps,
|
|
48
|
+
display: inline ? 'inline-flex' : undefined,
|
|
49
|
+
children: children
|
|
50
|
+
});
|
|
51
|
+
};
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
import type { BpkGridProps } from './types';
|
|
2
|
+
export declare const BpkGrid: ({ align, autoColumns, autoFlow, autoRows, children, column, inline, justify, row, templateAreas, templateColumns, templateRows, ...props }: BpkGridProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export type { BpkGridProps };
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Backpack - Skyscanner's Design System
|
|
3
|
+
*
|
|
4
|
+
* Copyright 2016 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 { Grid } from '@chakra-ui/react';
|
|
20
|
+
import { processBpkComponentProps } from "./tokenUtils";
|
|
21
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
|
+
export const BpkGrid = ({
|
|
23
|
+
align,
|
|
24
|
+
autoColumns,
|
|
25
|
+
autoFlow,
|
|
26
|
+
autoRows,
|
|
27
|
+
children,
|
|
28
|
+
column,
|
|
29
|
+
inline,
|
|
30
|
+
justify,
|
|
31
|
+
row,
|
|
32
|
+
templateAreas,
|
|
33
|
+
templateColumns,
|
|
34
|
+
templateRows,
|
|
35
|
+
...props
|
|
36
|
+
}) => {
|
|
37
|
+
const processedProps = processBpkComponentProps(props, {
|
|
38
|
+
component: 'BpkGrid',
|
|
39
|
+
responsiveProps: {
|
|
40
|
+
justifyContent: justify,
|
|
41
|
+
alignItems: align,
|
|
42
|
+
gridTemplateColumns: templateColumns,
|
|
43
|
+
gridTemplateRows: templateRows,
|
|
44
|
+
gridTemplateAreas: templateAreas,
|
|
45
|
+
gridAutoFlow: autoFlow,
|
|
46
|
+
gridAutoRows: autoRows,
|
|
47
|
+
gridAutoColumns: autoColumns,
|
|
48
|
+
gridColumn: column,
|
|
49
|
+
gridRow: row
|
|
50
|
+
}
|
|
51
|
+
});
|
|
52
|
+
return /*#__PURE__*/_jsx(Grid, {
|
|
53
|
+
...processedProps,
|
|
54
|
+
display: inline ? 'inline-grid' : undefined,
|
|
55
|
+
children: children
|
|
56
|
+
});
|
|
57
|
+
};
|
|
@@ -0,0 +1,45 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Backpack - Skyscanner's Design System
|
|
3
|
+
*
|
|
4
|
+
* Copyright 2016 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 { GridItem } from '@chakra-ui/react';
|
|
20
|
+
import { processBpkProps } from "./tokenUtils";
|
|
21
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
|
+
export const BpkGridItem = ({
|
|
23
|
+
area,
|
|
24
|
+
children,
|
|
25
|
+
colEnd,
|
|
26
|
+
colSpan,
|
|
27
|
+
colStart,
|
|
28
|
+
rowEnd,
|
|
29
|
+
rowSpan,
|
|
30
|
+
rowStart,
|
|
31
|
+
...props
|
|
32
|
+
}) => {
|
|
33
|
+
const processedProps = processBpkProps(props);
|
|
34
|
+
return /*#__PURE__*/_jsx(GridItem, {
|
|
35
|
+
...processedProps,
|
|
36
|
+
area: area,
|
|
37
|
+
colEnd: colEnd,
|
|
38
|
+
colStart: colStart,
|
|
39
|
+
colSpan: colSpan,
|
|
40
|
+
rowEnd: rowEnd,
|
|
41
|
+
rowStart: rowStart,
|
|
42
|
+
rowSpan: rowSpan,
|
|
43
|
+
children: children
|
|
44
|
+
});
|
|
45
|
+
};
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import type { ReactNode } from 'react';
|
|
2
|
+
export interface BpkProviderProps {
|
|
3
|
+
children: ReactNode;
|
|
4
|
+
}
|
|
5
|
+
/**
|
|
6
|
+
* BpkProvider - Provides Chakra UI context for Backpack layout components
|
|
7
|
+
*
|
|
8
|
+
* Chakra UI 3.0 requires the `value` prop to be set to a system object.
|
|
9
|
+
* We create a custom system with Backpack tokens using createSystem.
|
|
10
|
+
*
|
|
11
|
+
* @param {BpkProviderProps} props - The provider props.
|
|
12
|
+
* @returns {JSX.Element} The provider wrapping its children with Chakra context.
|
|
13
|
+
*/
|
|
14
|
+
export declare const BpkProvider: ({ children }: BpkProviderProps) => JSX.Element;
|
|
@@ -0,0 +1,42 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Backpack - Skyscanner's Design System
|
|
3
|
+
*
|
|
4
|
+
* Copyright 2016 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 { ChakraProvider, createSystem, defaultConfig } from '@chakra-ui/react';
|
|
20
|
+
import { createBpkConfig } from "./theme";
|
|
21
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
|
+
/**
|
|
23
|
+
* Creates a Chakra UI system with Backpack token mappings
|
|
24
|
+
* Chakra UI 3.0 uses `createSystem` with `defaultConfig` and custom config
|
|
25
|
+
*/
|
|
26
|
+
const bpkSystem = createSystem(defaultConfig, createBpkConfig());
|
|
27
|
+
|
|
28
|
+
/**
|
|
29
|
+
* BpkProvider - Provides Chakra UI context for Backpack layout components
|
|
30
|
+
*
|
|
31
|
+
* Chakra UI 3.0 requires the `value` prop to be set to a system object.
|
|
32
|
+
* We create a custom system with Backpack tokens using createSystem.
|
|
33
|
+
*
|
|
34
|
+
* @param {BpkProviderProps} props - The provider props.
|
|
35
|
+
* @returns {JSX.Element} The provider wrapping its children with Chakra context.
|
|
36
|
+
*/
|
|
37
|
+
export const BpkProvider = ({
|
|
38
|
+
children
|
|
39
|
+
}) => /*#__PURE__*/_jsx(ChakraProvider, {
|
|
40
|
+
value: bpkSystem,
|
|
41
|
+
children: children
|
|
42
|
+
});
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
/*
|
|
2
|
+
* Backpack - Skyscanner's Design System
|
|
3
|
+
*
|
|
4
|
+
* Copyright 2016 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
|
+
// these options align with Chakra's StackOption excluding separator
|
|
20
|
+
// TODO: add separator to Stack
|
|
21
|
+
const StackOptionKeys = ['align', 'justify', 'wrap', 'direction'];
|
|
22
|
+
export default StackOptionKeys;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import type { BpkStackProps } from './types';
|
|
2
|
+
export declare const BpkStack: ({ children, ...props }: BpkStackProps) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
+
export declare const BpkHStack: ({ children, ...props }: BpkStackProps) => import("react/jsx-runtime").JSX.Element;
|
|
4
|
+
export declare const BpkVStack: ({ children, ...props }: BpkStackProps) => import("react/jsx-runtime").JSX.Element;
|
|
5
|
+
export type { BpkStackProps };
|