@skyscanner/backpack-web 41.10.0-beta-v1 → 41.11.1-beta.1
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-accordion/src/BpkAccordion.js +2 -1
- package/bpk-component-accordion/src/BpkAccordionItem.js +2 -1
- package/bpk-component-aria-live/src/BpkAriaLive.js +2 -1
- package/bpk-component-autosuggest/src/BpkAutosuggestV2/BpkAutosuggest.js +2 -1
- package/bpk-component-bottom-sheet/src/BpkBottomSheet.js +14 -5
- package/bpk-component-breakpoint/src/BpkBreakpoint.js +2 -2
- package/bpk-component-breakpoint/src/useMediaQuery.js +27 -14
- package/bpk-component-bubble/src/BpkBubble.js +2 -1
- package/bpk-component-calendar/src/BpkCalendarDate.js +2 -1
- package/bpk-component-calendar/src/BpkCalendarGrid.js +2 -1
- package/bpk-component-calendar/src/BpkCalendarGridHeader.js +2 -1
- package/bpk-component-calendar/src/BpkCalendarGridTransition.js +2 -1
- package/bpk-component-calendar/src/BpkCalendarNav.js +2 -1
- package/bpk-component-calendar/src/BpkCalendarWeek.js +2 -1
- package/bpk-component-card-list/src/BpkCardList.js +3 -0
- package/bpk-component-card-list/src/BpkCardListRowRail/BpkCardListCarousel.js +15 -30
- package/bpk-component-card-list/src/BpkCardListRowRail/BpkCardListCarousel.module.css +1 -1
- package/bpk-component-card-list/src/BpkCardListRowRail/BpkCardListRowRailContainer.js +14 -1
- package/bpk-component-card-list/src/BpkCardListRowRail/constants.d.ts +1 -1
- package/bpk-component-card-list/src/BpkCardListRowRail/constants.js +1 -1
- package/bpk-component-card-list/src/BpkCardListRowRail/utils.d.ts +25 -8
- package/bpk-component-card-list/src/BpkCardListRowRail/utils.js +118 -35
- package/bpk-component-card-list/src/common-types.d.ts +3 -0
- package/bpk-component-chip/src/BpkDismissibleChip.js +3 -2
- package/bpk-component-chip/src/BpkDropdownChip.js +2 -0
- package/bpk-component-chip/src/BpkIconChip.js +2 -0
- package/bpk-component-chip/src/BpkSelectableChip.js +2 -1
- package/bpk-component-chip-group/src/BpkMultiSelectChipGroup.js +2 -1
- package/bpk-component-chip-group/src/BpkStickyChip.js +2 -1
- package/bpk-component-content-cards/src/BpkContentCard.module.css +1 -1
- package/bpk-component-input/src/withOpenEvents.d.ts +11 -12
- package/bpk-component-input/src/withOpenEvents.js +3 -3
- package/bpk-component-map/src/BpkBasicMapMarker.js +3 -0
- package/bpk-component-map/src/BpkPriceMarker.js +2 -0
- package/bpk-component-nudger/src/BpkNudger.js +2 -2
- package/bpk-component-panel/index.d.ts +2 -0
- package/bpk-component-panel/index.js +1 -0
- package/bpk-component-panel/src/BpkPanel.d.ts +14 -1
- package/bpk-component-panel/src/BpkPanel.js +4 -1
- package/bpk-component-panel/src/BpkPanel.module.css +1 -1
- package/bpk-component-price-range/src/BpkPriceMarker.js +2 -1
- package/bpk-component-price-range/src/BpkPriceRange.js +2 -1
- package/bpk-component-scrollable-calendar/src/BpkScrollableCalendarGrid.js +2 -1
- package/bpk-component-scrollable-calendar/src/BpkScrollableCalendarGridList.js +2 -1
- package/bpk-component-tooltip/src/BpkTooltip.js +2 -1
- package/bpk-mixins/_index.scss +1 -0
- package/bpk-mixins/_surfaces.scss +52 -0
- package/bpk-react-utils/index.d.ts +13 -1
- package/bpk-react-utils/index.js +4 -2
- package/bpk-react-utils/src/surfaceColors.d.ts +11 -0
- package/{bpk-component-layout/src/BpkStack.constant.js → bpk-react-utils/src/surfaceColors.js} +11 -4
- package/package.json +1 -2
- package/bpk-component-layout/index.d.ts +0 -18
- package/bpk-component-layout/index.js +0 -29
- package/bpk-component-layout/src/BpkBox.d.ts +0 -3
- package/bpk-component-layout/src/BpkBox.js +0 -33
- package/bpk-component-layout/src/BpkFlex.d.ts +0 -3
- package/bpk-component-layout/src/BpkFlex.js +0 -51
- package/bpk-component-layout/src/BpkGrid.d.ts +0 -3
- package/bpk-component-layout/src/BpkGrid.js +0 -57
- package/bpk-component-layout/src/BpkGridItem.d.ts +0 -3
- package/bpk-component-layout/src/BpkGridItem.js +0 -45
- package/bpk-component-layout/src/BpkProvider.d.ts +0 -14
- package/bpk-component-layout/src/BpkProvider.js +0 -42
- package/bpk-component-layout/src/BpkStack.constant.d.ts +0 -2
- package/bpk-component-layout/src/BpkStack.d.ts +0 -5
- package/bpk-component-layout/src/BpkStack.js +0 -57
- package/bpk-component-layout/src/BpkVessel.d.ts +0 -46
- package/bpk-component-layout/src/BpkVessel.js +0 -70
- package/bpk-component-layout/src/commonProps.d.ts +0 -86
- package/bpk-component-layout/src/commonProps.js +0 -1
- package/bpk-component-layout/src/theme.d.ts +0 -36
- package/bpk-component-layout/src/theme.js +0 -229
- package/bpk-component-layout/src/tokenUtils.d.ts +0 -108
- package/bpk-component-layout/src/tokenUtils.js +0 -323
- package/bpk-component-layout/src/tokens.d.ts +0 -96
- package/bpk-component-layout/src/tokens.js +0 -138
- package/bpk-component-layout/src/types.d.ts +0 -236
- package/bpk-component-layout/src/types.js +0 -1
|
@@ -0,0 +1,52 @@
|
|
|
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
|
+
/* stylelint-disable at-rule-disallowed-list */
|
|
20
|
+
|
|
21
|
+
@use 'tokens';
|
|
22
|
+
|
|
23
|
+
////
|
|
24
|
+
/// @group surfaces
|
|
25
|
+
////
|
|
26
|
+
|
|
27
|
+
// Keys must stay in sync with bpk-react-utils/src/surfaceColors.ts
|
|
28
|
+
$bpk-surface-bg-colors: (
|
|
29
|
+
'surface-default': tokens.$bpk-surface-default-day,
|
|
30
|
+
'surface-elevated': tokens.$bpk-surface-elevated-day,
|
|
31
|
+
'surface-hero': tokens.$bpk-surface-hero-day,
|
|
32
|
+
'surface-contrast': tokens.$bpk-surface-contrast-day,
|
|
33
|
+
'surface-highlight': tokens.$bpk-surface-highlight-day,
|
|
34
|
+
'surface-subtle': tokens.$bpk-surface-subtle-day,
|
|
35
|
+
'surface-low-contrast': tokens.$bpk-surface-low-contrast-day,
|
|
36
|
+
'surface-tint': tokens.$bpk-surface-tint-day,
|
|
37
|
+
);
|
|
38
|
+
|
|
39
|
+
/// Generates background-color modifier classes for all surface colors.
|
|
40
|
+
///
|
|
41
|
+
/// @example scss
|
|
42
|
+
/// .bpk-panel {
|
|
43
|
+
/// @include bpk-surface-bg-colors;
|
|
44
|
+
/// }
|
|
45
|
+
|
|
46
|
+
@mixin bpk-surface-bg-colors {
|
|
47
|
+
@each $color-name, $color-value in $bpk-surface-bg-colors {
|
|
48
|
+
&--#{$color-name} {
|
|
49
|
+
background-color: $color-value;
|
|
50
|
+
}
|
|
51
|
+
}
|
|
52
|
+
}
|
|
@@ -7,9 +7,11 @@ import { isDeviceIphone, isDeviceIpad, isDeviceIos } from './src/deviceDetection
|
|
|
7
7
|
import { getDataComponentAttribute } from './src/getDataComponentAttribute';
|
|
8
8
|
import isRTL from './src/isRTL';
|
|
9
9
|
import { setNativeValue } from './src/nativeEventHandler';
|
|
10
|
+
import { SURFACE_COLORS } from './src/surfaceColors';
|
|
10
11
|
import withDefaultProps from './src/withDefaultProps';
|
|
11
12
|
import wrapDisplayName from './src/wrapDisplayName';
|
|
12
|
-
export {
|
|
13
|
+
export type { SurfaceBgColor } from './src/surfaceColors';
|
|
14
|
+
export { Portal, TransitionInitialMount, cssModules, deprecated, withDefaultProps, wrapDisplayName, isDeviceIphone, isDeviceIpad, isDeviceIos, isRTL, BpkDialogWrapper, setNativeValue, getDataComponentAttribute, SURFACE_COLORS, };
|
|
13
15
|
declare const _default: {
|
|
14
16
|
Portal: typeof Portal;
|
|
15
17
|
TransitionInitialMount: ({ appearActiveClassName, appearClassName, children, transitionTimeout, }: {
|
|
@@ -43,5 +45,15 @@ declare const _default: {
|
|
|
43
45
|
getDataComponentAttribute: (componentName: string) => {
|
|
44
46
|
"data-backpack-ds-component": string;
|
|
45
47
|
};
|
|
48
|
+
SURFACE_COLORS: {
|
|
49
|
+
readonly surfaceDefault: "surface-default";
|
|
50
|
+
readonly surfaceElevated: "surface-elevated";
|
|
51
|
+
readonly surfaceHero: "surface-hero";
|
|
52
|
+
readonly surfaceContrast: "surface-contrast";
|
|
53
|
+
readonly surfaceHighlight: "surface-highlight";
|
|
54
|
+
readonly surfaceSubtle: "surface-subtle";
|
|
55
|
+
readonly surfaceLowContrast: "surface-low-contrast";
|
|
56
|
+
readonly surfaceTint: "surface-tint";
|
|
57
|
+
};
|
|
46
58
|
};
|
|
47
59
|
export default _default;
|
package/bpk-react-utils/index.js
CHANGED
|
@@ -26,9 +26,10 @@ import { isDeviceIphone, isDeviceIpad, isDeviceIos } from "./src/deviceDetection
|
|
|
26
26
|
import { getDataComponentAttribute } from "./src/getDataComponentAttribute";
|
|
27
27
|
import isRTL from "./src/isRTL";
|
|
28
28
|
import { setNativeValue } from "./src/nativeEventHandler";
|
|
29
|
+
import { SURFACE_COLORS } from "./src/surfaceColors";
|
|
29
30
|
import withDefaultProps from "./src/withDefaultProps";
|
|
30
31
|
import wrapDisplayName from "./src/wrapDisplayName";
|
|
31
|
-
export { Portal, TransitionInitialMount, cssModules, deprecated, withDefaultProps, wrapDisplayName, isDeviceIphone, isDeviceIpad, isDeviceIos, isRTL, BpkDialogWrapper, setNativeValue, getDataComponentAttribute };
|
|
32
|
+
export { Portal, TransitionInitialMount, cssModules, deprecated, withDefaultProps, wrapDisplayName, isDeviceIphone, isDeviceIpad, isDeviceIos, isRTL, BpkDialogWrapper, setNativeValue, getDataComponentAttribute, SURFACE_COLORS };
|
|
32
33
|
export default {
|
|
33
34
|
Portal,
|
|
34
35
|
TransitionInitialMount,
|
|
@@ -42,5 +43,6 @@ export default {
|
|
|
42
43
|
isRTL,
|
|
43
44
|
BpkDialogWrapper,
|
|
44
45
|
setNativeValue,
|
|
45
|
-
getDataComponentAttribute
|
|
46
|
+
getDataComponentAttribute,
|
|
47
|
+
SURFACE_COLORS
|
|
46
48
|
};
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export declare const SURFACE_COLORS: {
|
|
2
|
+
readonly surfaceDefault: "surface-default";
|
|
3
|
+
readonly surfaceElevated: "surface-elevated";
|
|
4
|
+
readonly surfaceHero: "surface-hero";
|
|
5
|
+
readonly surfaceContrast: "surface-contrast";
|
|
6
|
+
readonly surfaceHighlight: "surface-highlight";
|
|
7
|
+
readonly surfaceSubtle: "surface-subtle";
|
|
8
|
+
readonly surfaceLowContrast: "surface-low-contrast";
|
|
9
|
+
readonly surfaceTint: "surface-tint";
|
|
10
|
+
};
|
|
11
|
+
export type SurfaceBgColor = (typeof SURFACE_COLORS)[keyof typeof SURFACE_COLORS];
|
package/{bpk-component-layout/src/BpkStack.constant.js → bpk-react-utils/src/surfaceColors.js}
RENAMED
|
@@ -16,7 +16,14 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
//
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
19
|
+
// Values must stay in sync with bpk-mixins/_surfaces.scss
|
|
20
|
+
export const SURFACE_COLORS = {
|
|
21
|
+
surfaceDefault: 'surface-default',
|
|
22
|
+
surfaceElevated: 'surface-elevated',
|
|
23
|
+
surfaceHero: 'surface-hero',
|
|
24
|
+
surfaceContrast: 'surface-contrast',
|
|
25
|
+
surfaceHighlight: 'surface-highlight',
|
|
26
|
+
surfaceSubtle: 'surface-subtle',
|
|
27
|
+
surfaceLowContrast: 'surface-low-contrast',
|
|
28
|
+
surfaceTint: 'surface-tint'
|
|
29
|
+
};
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skyscanner/backpack-web",
|
|
3
|
-
"version": "41.
|
|
3
|
+
"version": "41.11.1-beta.1",
|
|
4
4
|
"description": "Backpack Design System web library",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -22,7 +22,6 @@
|
|
|
22
22
|
"access": "public"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
-
"@chakra-ui/react": "^3.30.0",
|
|
26
25
|
"@floating-ui/react": "^0.26.12",
|
|
27
26
|
"@popperjs/core": "^2.11.8",
|
|
28
27
|
"@radix-ui/react-compose-refs": "^1.1.1",
|
|
@@ -1,18 +0,0 @@
|
|
|
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';
|
|
@@ -1,29 +0,0 @@
|
|
|
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";
|
|
@@ -1,33 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,51 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,3 +0,0 @@
|
|
|
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 };
|
|
@@ -1,57 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,45 +0,0 @@
|
|
|
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
|
-
};
|
|
@@ -1,14 +0,0 @@
|
|
|
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;
|
|
@@ -1,42 +0,0 @@
|
|
|
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
|
-
});
|
|
@@ -1,5 +0,0 @@
|
|
|
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 };
|
|
@@ -1,57 +0,0 @@
|
|
|
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 { Stack, VStack, HStack } from '@chakra-ui/react';
|
|
20
|
-
import { processBpkComponentProps } from "./tokenUtils";
|
|
21
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
|
-
export const BpkStack = ({
|
|
23
|
-
children,
|
|
24
|
-
...props
|
|
25
|
-
}) => {
|
|
26
|
-
const processedProps = processBpkComponentProps(props, {
|
|
27
|
-
component: 'BpkStack'
|
|
28
|
-
});
|
|
29
|
-
return /*#__PURE__*/_jsx(Stack, {
|
|
30
|
-
...processedProps,
|
|
31
|
-
children: children
|
|
32
|
-
});
|
|
33
|
-
};
|
|
34
|
-
export const BpkHStack = ({
|
|
35
|
-
children,
|
|
36
|
-
...props
|
|
37
|
-
}) => {
|
|
38
|
-
const processedProps = processBpkComponentProps(props, {
|
|
39
|
-
component: 'BpkStack'
|
|
40
|
-
});
|
|
41
|
-
return /*#__PURE__*/_jsx(HStack, {
|
|
42
|
-
...processedProps,
|
|
43
|
-
children: children
|
|
44
|
-
});
|
|
45
|
-
};
|
|
46
|
-
export const BpkVStack = ({
|
|
47
|
-
children,
|
|
48
|
-
...props
|
|
49
|
-
}) => {
|
|
50
|
-
const processedProps = processBpkComponentProps(props, {
|
|
51
|
-
component: 'BpkStack'
|
|
52
|
-
});
|
|
53
|
-
return /*#__PURE__*/_jsx(VStack, {
|
|
54
|
-
...processedProps,
|
|
55
|
-
children: children
|
|
56
|
-
});
|
|
57
|
-
};
|
|
@@ -1,46 +0,0 @@
|
|
|
1
|
-
import type { BpkVesselProps } from './types';
|
|
2
|
-
/**
|
|
3
|
-
* A "migration hatch" layout primitive designed to ease component migration.
|
|
4
|
-
*
|
|
5
|
-
* BpkVessel renders an HTML element (default: div) and accepts all standard
|
|
6
|
-
* HTML attributes for maximum migration flexibility.
|
|
7
|
-
*
|
|
8
|
-
* **When to use:**
|
|
9
|
-
* - During component migration when you need to maintain existing className/style usage
|
|
10
|
-
* - When you need to pass testing attributes (data-testid) or accessibility props
|
|
11
|
-
* - As a temporary solution while refactoring components
|
|
12
|
-
*
|
|
13
|
-
* **Important:**
|
|
14
|
-
* - This is a temporary migration tool, not a permanent solution
|
|
15
|
-
* - Accepts all React.HTMLAttributes (styling, events, aria, data-*, etc.)
|
|
16
|
-
* - Plan to migrate to BpkBox once legacy styling is removed
|
|
17
|
-
*
|
|
18
|
-
* @example
|
|
19
|
-
* ```tsx
|
|
20
|
-
* <BpkVessel
|
|
21
|
-
* className="legacy-class"
|
|
22
|
-
* style={{ padding: '16px', transition: 'opacity 0.3s' }}
|
|
23
|
-
* data-testid="migration-wrapper"
|
|
24
|
-
* onClick={handleClick}
|
|
25
|
-
* >
|
|
26
|
-
* Content
|
|
27
|
-
* </BpkVessel>
|
|
28
|
-
*
|
|
29
|
-
* <BpkVessel
|
|
30
|
-
* as="section"
|
|
31
|
-
* className="legacy-section"
|
|
32
|
-
* aria-label="Main content"
|
|
33
|
-
* role="region"
|
|
34
|
-
* dir="rtl"
|
|
35
|
-
* >
|
|
36
|
-
* Section Content
|
|
37
|
-
* </BpkVessel>
|
|
38
|
-
* ```
|
|
39
|
-
*
|
|
40
|
-
* @todo Migration component - pending removal after component migration is complete.
|
|
41
|
-
* Replace usages with BpkBox once legacy className/style dependencies are refactored.
|
|
42
|
-
*
|
|
43
|
-
* @returns {JSX.Element} An HTML element with all props applied.
|
|
44
|
-
*/
|
|
45
|
-
export declare const BpkVessel: ({ as: Element, children, ...restProps }: BpkVesselProps) => import("react/jsx-runtime").JSX.Element;
|
|
46
|
-
export type { BpkVesselProps };
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
|
-
/*
|
|
3
|
-
* Backpack - Skyscanner's Design System
|
|
4
|
-
*
|
|
5
|
-
* Copyright 2016 Skyscanner Ltd
|
|
6
|
-
*
|
|
7
|
-
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
-
* you may not use this file except in compliance with the License.
|
|
9
|
-
* You may obtain a copy of the License at
|
|
10
|
-
*
|
|
11
|
-
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
-
*
|
|
13
|
-
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
-
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
-
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
-
* See the License for the specific language governing permissions and
|
|
17
|
-
* limitations under the License.
|
|
18
|
-
*/
|
|
19
|
-
|
|
20
|
-
/**
|
|
21
|
-
* A "migration hatch" layout primitive designed to ease component migration.
|
|
22
|
-
*
|
|
23
|
-
* BpkVessel renders an HTML element (default: div) and accepts all standard
|
|
24
|
-
* HTML attributes for maximum migration flexibility.
|
|
25
|
-
*
|
|
26
|
-
* **When to use:**
|
|
27
|
-
* - During component migration when you need to maintain existing className/style usage
|
|
28
|
-
* - When you need to pass testing attributes (data-testid) or accessibility props
|
|
29
|
-
* - As a temporary solution while refactoring components
|
|
30
|
-
*
|
|
31
|
-
* **Important:**
|
|
32
|
-
* - This is a temporary migration tool, not a permanent solution
|
|
33
|
-
* - Accepts all React.HTMLAttributes (styling, events, aria, data-*, etc.)
|
|
34
|
-
* - Plan to migrate to BpkBox once legacy styling is removed
|
|
35
|
-
*
|
|
36
|
-
* @example
|
|
37
|
-
* ```tsx
|
|
38
|
-
* <BpkVessel
|
|
39
|
-
* className="legacy-class"
|
|
40
|
-
* style={{ padding: '16px', transition: 'opacity 0.3s' }}
|
|
41
|
-
* data-testid="migration-wrapper"
|
|
42
|
-
* onClick={handleClick}
|
|
43
|
-
* >
|
|
44
|
-
* Content
|
|
45
|
-
* </BpkVessel>
|
|
46
|
-
*
|
|
47
|
-
* <BpkVessel
|
|
48
|
-
* as="section"
|
|
49
|
-
* className="legacy-section"
|
|
50
|
-
* aria-label="Main content"
|
|
51
|
-
* role="region"
|
|
52
|
-
* dir="rtl"
|
|
53
|
-
* >
|
|
54
|
-
* Section Content
|
|
55
|
-
* </BpkVessel>
|
|
56
|
-
* ```
|
|
57
|
-
*
|
|
58
|
-
* @todo Migration component - pending removal after component migration is complete.
|
|
59
|
-
* Replace usages with BpkBox once legacy className/style dependencies are refactored.
|
|
60
|
-
*
|
|
61
|
-
* @returns {JSX.Element} An HTML element with all props applied.
|
|
62
|
-
*/
|
|
63
|
-
export const BpkVessel = ({
|
|
64
|
-
as: Element = 'div',
|
|
65
|
-
children,
|
|
66
|
-
...restProps
|
|
67
|
-
}) => /*#__PURE__*/_jsx(Element, {
|
|
68
|
-
...restProps,
|
|
69
|
-
children: children
|
|
70
|
-
});
|