@skyscanner/backpack-web 42.5.2 → 42.6.0-dev-v24136780254.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-checkbox/src/BpkCheckboxV2/BpkCheckboxV2Control.js +1 -1
- package/bpk-component-checkbox/src/BpkCheckboxV2/BpkCheckboxV2HiddenInput.js +1 -1
- package/bpk-component-checkbox/src/BpkCheckboxV2/BpkCheckboxV2Label.js +1 -1
- package/bpk-component-checkbox/src/BpkCheckboxV2/BpkCheckboxV2Root.js +1 -1
- package/bpk-component-checkbox-card/src/BpkCheckboxCard.js +1 -1
- package/bpk-component-checkbox-card/src/BpkCheckboxCardRoot.js +1 -1
- package/bpk-component-drawer/src/BpkDrawer.d.ts +1 -1
- package/bpk-component-drawer/src/BpkDrawerContent.d.ts +1 -1
- package/bpk-component-layout/index.d.ts +2 -0
- package/bpk-component-layout/index.js +4 -1
- package/bpk-component-layout/src/BpkBox.js +18 -8
- package/bpk-component-layout/src/BpkFlex.js +11 -3
- package/bpk-component-layout/src/BpkGrid.js +11 -3
- package/bpk-component-layout/src/BpkGridItem.js +11 -3
- package/bpk-component-layout/src/BpkLayout.module.css +18 -0
- package/bpk-component-layout/src/BpkProvider.js +3 -2
- package/bpk-component-layout/src/BpkStack.js +46 -20
- package/bpk-component-layout/src/backgroundColors.d.ts +16 -0
- package/bpk-component-layout/src/backgroundColors.js +37 -0
- package/bpk-component-layout/src/commonProps.d.ts +4 -3
- package/bpk-component-layout/src/theme.js +1 -1
- package/bpk-component-layout/src/types.d.ts +4 -1
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3CloseTrigger/BpkModalV3CloseTrigger.js +1 -1
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3Content/BpkModalV3Content.js +1 -1
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3Description/BpkModalV3Description.js +1 -1
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3Portal/BpkModalV3Portal.js +1 -1
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3Root/BpkModalV3Root.js +1 -1
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3Scrim/BpkModalV3Scrim.js +1 -1
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3Title/BpkModalV3Title.js +1 -1
- package/bpk-component-modal/src/BpkModalV3/BpkModalV3Trigger/BpkModalV3Trigger.js +1 -1
- package/bpk-component-segmented-control/src/BpkSegmentedControlV2/BpkSegmentedControlV2.js +2 -1
- package/bpk-mixins/_borders.scss +20 -4
- package/bpk-mixins/_scroll-indicators.scss +5 -1
- package/package.json +1 -1
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import { Checkbox } from '@ark-ui/react';
|
|
19
|
+
import { Checkbox } from '@ark-ui/react/checkbox';
|
|
20
20
|
import { cssModules } from "../../../bpk-react-utils";
|
|
21
21
|
import STYLES from "./BpkCheckboxV2.module.css";
|
|
22
22
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import { Checkbox } from '@ark-ui/react';
|
|
19
|
+
import { Checkbox } from '@ark-ui/react/checkbox';
|
|
20
20
|
|
|
21
21
|
// Renders Ark's visually hidden native <input type="checkbox">.
|
|
22
22
|
// Include when the checkbox is inside a <form> for native form submission.
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import { Checkbox } from '@ark-ui/react';
|
|
19
|
+
import { Checkbox } from '@ark-ui/react/checkbox';
|
|
20
20
|
import { cssModules } from "../../../bpk-react-utils";
|
|
21
21
|
import STYLES from "./BpkCheckboxV2.module.css";
|
|
22
22
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import { Checkbox } from '@ark-ui/react';
|
|
19
|
+
import { Checkbox } from '@ark-ui/react/checkbox';
|
|
20
20
|
import { cssModules, getDataComponentAttribute } from "../../../bpk-react-utils";
|
|
21
21
|
import STYLES from "./BpkCheckboxV2.module.css";
|
|
22
22
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import { CheckboxHiddenInput } from '@ark-ui/react';
|
|
19
|
+
import { CheckboxHiddenInput } from '@ark-ui/react/checkbox';
|
|
20
20
|
import { withButtonAlignment } from "../../bpk-component-icon";
|
|
21
21
|
import TickCircleIcon from "../../bpk-component-icon/sm/tick-circle";
|
|
22
22
|
import { BpkSpinner, SPINNER_TYPES } from "../../bpk-component-spinner";
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import { useMemo } from 'react';
|
|
20
|
-
import { CheckboxRoot } from '@ark-ui/react';
|
|
20
|
+
import { CheckboxRoot } from '@ark-ui/react/checkbox';
|
|
21
21
|
import { withButtonAlignment } from "../../bpk-component-icon";
|
|
22
22
|
import TickCircleIcon from "../../bpk-component-icon/sm/tick-circle";
|
|
23
23
|
import { cssModules } from "../../bpk-react-utils";
|
|
@@ -6,7 +6,7 @@ export type Props = {
|
|
|
6
6
|
onClose?: (arg0?: TouchEvent | MouseEvent | KeyboardEvent, arg1?: {
|
|
7
7
|
source: 'ESCAPE' | 'DOCUMENT_CLICK';
|
|
8
8
|
}) => void;
|
|
9
|
-
title:
|
|
9
|
+
title: ReactNode;
|
|
10
10
|
getApplicationElement: () => HTMLElement | null;
|
|
11
11
|
width?: string;
|
|
12
12
|
renderTarget?: null | HTMLElement | (() => null | HTMLElement);
|
|
@@ -16,3 +16,5 @@ export type { BpkCommonLayoutProps, BpkBoxSpecificProps, BpkFlexSpecificProps, B
|
|
|
16
16
|
export type { BpkStackSpecificProps } from './src/types';
|
|
17
17
|
export type { BpkSpacingToken, BpkBreakpointToken, BpkSpacingValue, BpkBreakpointValue, } from './src/tokens';
|
|
18
18
|
export { BpkSpacing, BpkBreakpoint, isValidSpacingValue, isPercentage, } from './src/tokens';
|
|
19
|
+
export { BACKGROUND_COLORS } from './src/backgroundColors';
|
|
20
|
+
export type { BpkLayoutBackgroundColor } from './src/backgroundColors';
|
|
@@ -26,4 +26,7 @@ export { BpkStack, BpkHStack, BpkVStack } from "./src/BpkStack";
|
|
|
26
26
|
|
|
27
27
|
// Export token types and utilities
|
|
28
28
|
|
|
29
|
-
export { BpkSpacing, BpkBreakpoint, isValidSpacingValue, isPercentage } from "./src/tokens";
|
|
29
|
+
export { BpkSpacing, BpkBreakpoint, isValidSpacingValue, isPercentage } from "./src/tokens";
|
|
30
|
+
|
|
31
|
+
// Export color constants and types
|
|
32
|
+
export { BACKGROUND_COLORS } from "./src/backgroundColors";
|
|
@@ -17,22 +17,32 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import { forwardRef } from 'react';
|
|
20
|
-
import { Box } from '@chakra-ui/react';
|
|
21
|
-
import { getDataComponentAttribute } from "../../bpk-react-utils";
|
|
20
|
+
import { Box } from '@chakra-ui/react/box';
|
|
21
|
+
import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
|
|
22
22
|
import { processBpkComponentProps } from "./tokenUtils";
|
|
23
|
+
import STYLES from "./BpkLayout.module.css";
|
|
23
24
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
|
+
const getClassName = cssModules(STYLES);
|
|
24
26
|
export const BpkBox = /*#__PURE__*/forwardRef(({
|
|
27
|
+
backgroundColor,
|
|
25
28
|
children,
|
|
29
|
+
color,
|
|
26
30
|
...props
|
|
27
31
|
}, ref) => {
|
|
28
32
|
const processedProps = processBpkComponentProps(props, {
|
|
29
33
|
component: 'BpkBox'
|
|
30
34
|
});
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
const classNames = color || backgroundColor ? getClassName('bpk-layout', color ? `bpk-layout--${color}` : '', backgroundColor ? `bpk-layout--${backgroundColor}` : '') : undefined;
|
|
36
|
+
return (
|
|
37
|
+
/*#__PURE__*/
|
|
38
|
+
// eslint-disable-next-line @skyscanner/rules/forbid-component-props
|
|
39
|
+
_jsx(Box, {
|
|
40
|
+
ref: ref,
|
|
41
|
+
className: classNames,
|
|
42
|
+
...getDataComponentAttribute('Box'),
|
|
43
|
+
...processedProps,
|
|
44
|
+
children: children
|
|
45
|
+
})
|
|
46
|
+
);
|
|
37
47
|
});
|
|
38
48
|
BpkBox.displayName = 'BpkBox';
|
|
@@ -17,14 +17,18 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import { forwardRef } from 'react';
|
|
20
|
-
import { Flex } from '@chakra-ui/react';
|
|
21
|
-
import { getDataComponentAttribute } from "../../bpk-react-utils";
|
|
20
|
+
import { Flex } from '@chakra-ui/react/flex';
|
|
21
|
+
import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
|
|
22
22
|
import { processBpkComponentProps } from "./tokenUtils";
|
|
23
|
+
import STYLES from "./BpkLayout.module.css";
|
|
23
24
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
|
+
const getClassName = cssModules(STYLES);
|
|
24
26
|
export const BpkFlex = /*#__PURE__*/forwardRef(({
|
|
25
27
|
align,
|
|
28
|
+
backgroundColor,
|
|
26
29
|
basis,
|
|
27
30
|
children,
|
|
31
|
+
color,
|
|
28
32
|
direction,
|
|
29
33
|
grow,
|
|
30
34
|
inline,
|
|
@@ -47,8 +51,12 @@ export const BpkFlex = /*#__PURE__*/forwardRef(({
|
|
|
47
51
|
flexBasis: basis
|
|
48
52
|
}
|
|
49
53
|
});
|
|
54
|
+
const classNames = color || backgroundColor ? getClassName('bpk-layout', color ? `bpk-layout--${color}` : '', backgroundColor ? `bpk-layout--${backgroundColor}` : '') : undefined;
|
|
50
55
|
return /*#__PURE__*/_jsx(Flex, {
|
|
51
|
-
ref: ref
|
|
56
|
+
ref: ref
|
|
57
|
+
// eslint-disable-next-line @skyscanner/rules/forbid-component-props
|
|
58
|
+
,
|
|
59
|
+
className: classNames,
|
|
52
60
|
...getDataComponentAttribute('Flex'),
|
|
53
61
|
...processedProps,
|
|
54
62
|
display: inline ? 'inline-flex' : undefined,
|
|
@@ -17,16 +17,20 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import { forwardRef } from 'react';
|
|
20
|
-
import { Grid } from '@chakra-ui/react';
|
|
21
|
-
import { getDataComponentAttribute } from "../../bpk-react-utils";
|
|
20
|
+
import { Grid } from '@chakra-ui/react/grid';
|
|
21
|
+
import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
|
|
22
22
|
import { processBpkComponentProps } from "./tokenUtils";
|
|
23
|
+
import STYLES from "./BpkLayout.module.css";
|
|
23
24
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
|
+
const getClassName = cssModules(STYLES);
|
|
24
26
|
export const BpkGrid = /*#__PURE__*/forwardRef(({
|
|
25
27
|
align,
|
|
26
28
|
autoColumns,
|
|
27
29
|
autoFlow,
|
|
28
30
|
autoRows,
|
|
31
|
+
backgroundColor,
|
|
29
32
|
children,
|
|
33
|
+
color,
|
|
30
34
|
column,
|
|
31
35
|
inline,
|
|
32
36
|
justify,
|
|
@@ -53,8 +57,12 @@ export const BpkGrid = /*#__PURE__*/forwardRef(({
|
|
|
53
57
|
gridRow: row
|
|
54
58
|
}
|
|
55
59
|
});
|
|
60
|
+
const classNames = color || backgroundColor ? getClassName('bpk-layout', color ? `bpk-layout--${color}` : '', backgroundColor ? `bpk-layout--${backgroundColor}` : '') : undefined;
|
|
56
61
|
return /*#__PURE__*/_jsx(Grid, {
|
|
57
|
-
ref: ref
|
|
62
|
+
ref: ref
|
|
63
|
+
// eslint-disable-next-line @skyscanner/rules/forbid-component-props
|
|
64
|
+
,
|
|
65
|
+
className: classNames,
|
|
58
66
|
...getDataComponentAttribute('Grid'),
|
|
59
67
|
...processedProps,
|
|
60
68
|
display: inline ? 'inline-grid' : undefined,
|
|
@@ -17,16 +17,20 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import { forwardRef } from 'react';
|
|
20
|
-
import { GridItem } from '@chakra-ui/react';
|
|
21
|
-
import { getDataComponentAttribute } from "../../bpk-react-utils";
|
|
20
|
+
import { GridItem } from '@chakra-ui/react/grid';
|
|
21
|
+
import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
|
|
22
22
|
import { processBpkComponentProps } from "./tokenUtils";
|
|
23
|
+
import STYLES from "./BpkLayout.module.css";
|
|
23
24
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
|
+
const getClassName = cssModules(STYLES);
|
|
24
26
|
export const BpkGridItem = /*#__PURE__*/forwardRef(({
|
|
25
27
|
area,
|
|
28
|
+
backgroundColor,
|
|
26
29
|
children,
|
|
27
30
|
colEnd,
|
|
28
31
|
colSpan,
|
|
29
32
|
colStart,
|
|
33
|
+
color,
|
|
30
34
|
rowEnd,
|
|
31
35
|
rowSpan,
|
|
32
36
|
rowStart,
|
|
@@ -39,8 +43,12 @@ export const BpkGridItem = /*#__PURE__*/forwardRef(({
|
|
|
39
43
|
}, {
|
|
40
44
|
component: 'BpkGridItem'
|
|
41
45
|
});
|
|
46
|
+
const classNames = color || backgroundColor ? getClassName('bpk-layout', color ? `bpk-layout--${color}` : '', backgroundColor ? `bpk-layout--${backgroundColor}` : '') : undefined;
|
|
42
47
|
return /*#__PURE__*/_jsx(GridItem, {
|
|
43
|
-
ref: ref
|
|
48
|
+
ref: ref
|
|
49
|
+
// eslint-disable-next-line @skyscanner/rules/forbid-component-props
|
|
50
|
+
,
|
|
51
|
+
className: classNames,
|
|
44
52
|
...getDataComponentAttribute('GridItem'),
|
|
45
53
|
...processedProps,
|
|
46
54
|
area: area,
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
.bpk-layout.bpk-layout--text-disabled{color:rgba(0,0,0,.2)}.bpk-layout.bpk-layout--text-disabled-on-dark{color:hsla(0,0%,100%,.5)}.bpk-layout.bpk-layout--text-error{color:#e70866}.bpk-layout.bpk-layout--text-hero{color:#0062e3}.bpk-layout.bpk-layout--text-link{color:#0062e3}.bpk-layout.bpk-layout--text-on-dark{color:#fff}.bpk-layout.bpk-layout--text-on-light{color:#161616}.bpk-layout.bpk-layout--text-primary{color:#161616}.bpk-layout.bpk-layout--text-primary-inverse{color:#fff}.bpk-layout.bpk-layout--text-secondary{color:#626971}.bpk-layout.bpk-layout--text-success{color:#0c838a}.bpk-layout.bpk-layout--surface-default{background-color:#fff}.bpk-layout.bpk-layout--surface-elevated{background-color:#fff}.bpk-layout.bpk-layout--surface-hero{background-color:#0062e3}.bpk-layout.bpk-layout--surface-contrast{background-color:#05203c}.bpk-layout.bpk-layout--surface-highlight{background-color:#e0e4e9}.bpk-layout.bpk-layout--surface-subtle{background-color:#e3f0ff}.bpk-layout.bpk-layout--surface-low-contrast{background-color:#f5f7fa}.bpk-layout.bpk-layout--surface-tint{background-color:hsla(0,0%,100%,.1)}.bpk-layout.bpk-layout--canvas{background-color:#fff}.bpk-layout.bpk-layout--canvas-contrast{background-color:#eff3f8}.bpk-layout.bpk-layout--status-success-fill{background-color:#d4fff2}.bpk-layout.bpk-layout--status-danger-fill{background-color:#ffe9f9}.bpk-layout.bpk-layout--status-warning-fill{background-color:#fff7cf}
|
|
@@ -17,8 +17,9 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import { useEffect, useState } from 'react';
|
|
20
|
-
import { LocaleProvider } from '@ark-ui/react';
|
|
21
|
-
import {
|
|
20
|
+
import { LocaleProvider } from '@ark-ui/react/locale';
|
|
21
|
+
import { defaultBaseConfig } from '@chakra-ui/react/preset-base';
|
|
22
|
+
import { ChakraProvider, createSystem } from '@chakra-ui/react/styled-system';
|
|
22
23
|
import { createBpkConfig } from "./theme";
|
|
23
24
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
24
25
|
/**
|
|
@@ -17,52 +17,78 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import { forwardRef } from 'react';
|
|
20
|
-
import { Stack, VStack, HStack } from '@chakra-ui/react';
|
|
21
|
-
import { getDataComponentAttribute } from "../../bpk-react-utils";
|
|
20
|
+
import { Stack, VStack, HStack } from '@chakra-ui/react/stack';
|
|
21
|
+
import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
|
|
22
22
|
import { processBpkComponentProps } from "./tokenUtils";
|
|
23
|
+
import STYLES from "./BpkLayout.module.css";
|
|
23
24
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
25
|
+
const getClassName = cssModules(STYLES);
|
|
24
26
|
export const BpkStack = /*#__PURE__*/forwardRef(({
|
|
27
|
+
backgroundColor,
|
|
25
28
|
children,
|
|
29
|
+
color,
|
|
26
30
|
...props
|
|
27
31
|
}, ref) => {
|
|
28
32
|
const processedProps = processBpkComponentProps(props, {
|
|
29
33
|
component: 'BpkStack'
|
|
30
34
|
});
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
35
|
+
const classNames = color || backgroundColor ? getClassName('bpk-layout', color ? `bpk-layout--${color}` : '', backgroundColor ? `bpk-layout--${backgroundColor}` : '') : undefined;
|
|
36
|
+
return (
|
|
37
|
+
/*#__PURE__*/
|
|
38
|
+
// eslint-disable-next-line @skyscanner/rules/forbid-component-props
|
|
39
|
+
_jsx(Stack, {
|
|
40
|
+
ref: ref,
|
|
41
|
+
className: classNames,
|
|
42
|
+
...getDataComponentAttribute('Stack'),
|
|
43
|
+
...processedProps,
|
|
44
|
+
children: children
|
|
45
|
+
})
|
|
46
|
+
);
|
|
37
47
|
});
|
|
38
48
|
BpkStack.displayName = 'BpkStack';
|
|
39
49
|
export const BpkHStack = /*#__PURE__*/forwardRef(({
|
|
50
|
+
backgroundColor,
|
|
40
51
|
children,
|
|
52
|
+
color,
|
|
41
53
|
...props
|
|
42
54
|
}, ref) => {
|
|
43
55
|
const processedProps = processBpkComponentProps(props, {
|
|
44
56
|
component: 'BpkStack'
|
|
45
57
|
});
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
58
|
+
const classNames = color || backgroundColor ? getClassName('bpk-layout', color ? `bpk-layout--${color}` : '', backgroundColor ? `bpk-layout--${backgroundColor}` : '') : undefined;
|
|
59
|
+
return (
|
|
60
|
+
/*#__PURE__*/
|
|
61
|
+
// eslint-disable-next-line @skyscanner/rules/forbid-component-props
|
|
62
|
+
_jsx(HStack, {
|
|
63
|
+
ref: ref,
|
|
64
|
+
className: classNames,
|
|
65
|
+
...getDataComponentAttribute('HStack'),
|
|
66
|
+
...processedProps,
|
|
67
|
+
children: children
|
|
68
|
+
})
|
|
69
|
+
);
|
|
52
70
|
});
|
|
53
71
|
BpkHStack.displayName = 'BpkHStack';
|
|
54
72
|
export const BpkVStack = /*#__PURE__*/forwardRef(({
|
|
73
|
+
backgroundColor,
|
|
55
74
|
children,
|
|
75
|
+
color,
|
|
56
76
|
...props
|
|
57
77
|
}, ref) => {
|
|
58
78
|
const processedProps = processBpkComponentProps(props, {
|
|
59
79
|
component: 'BpkStack'
|
|
60
80
|
});
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
81
|
+
const classNames = color || backgroundColor ? getClassName('bpk-layout', color ? `bpk-layout--${color}` : '', backgroundColor ? `bpk-layout--${backgroundColor}` : '') : undefined;
|
|
82
|
+
return (
|
|
83
|
+
/*#__PURE__*/
|
|
84
|
+
// eslint-disable-next-line @skyscanner/rules/forbid-component-props
|
|
85
|
+
_jsx(VStack, {
|
|
86
|
+
ref: ref,
|
|
87
|
+
className: classNames,
|
|
88
|
+
...getDataComponentAttribute('VStack'),
|
|
89
|
+
...processedProps,
|
|
90
|
+
children: children
|
|
91
|
+
})
|
|
92
|
+
);
|
|
67
93
|
});
|
|
68
94
|
BpkVStack.displayName = 'BpkVStack';
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
export declare const BACKGROUND_COLORS: {
|
|
2
|
+
readonly statusSuccessFill: "status-success-fill";
|
|
3
|
+
readonly statusDangerFill: "status-danger-fill";
|
|
4
|
+
readonly statusWarningFill: "status-warning-fill";
|
|
5
|
+
readonly canvas: "canvas";
|
|
6
|
+
readonly canvasContrast: "canvas-contrast";
|
|
7
|
+
readonly surfaceDefault: "surface-default";
|
|
8
|
+
readonly surfaceElevated: "surface-elevated";
|
|
9
|
+
readonly surfaceHero: "surface-hero";
|
|
10
|
+
readonly surfaceContrast: "surface-contrast";
|
|
11
|
+
readonly surfaceHighlight: "surface-highlight";
|
|
12
|
+
readonly surfaceSubtle: "surface-subtle";
|
|
13
|
+
readonly surfaceLowContrast: "surface-low-contrast";
|
|
14
|
+
readonly surfaceTint: "surface-tint";
|
|
15
|
+
};
|
|
16
|
+
export type BpkLayoutBackgroundColor = (typeof BACKGROUND_COLORS)[keyof typeof BACKGROUND_COLORS];
|
|
@@ -0,0 +1,37 @@
|
|
|
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 { SURFACE_COLORS } from "../../bpk-react-utils";
|
|
20
|
+
|
|
21
|
+
// Canvas colors (day mode only)
|
|
22
|
+
const CANVAS_COLORS = {
|
|
23
|
+
canvas: 'canvas',
|
|
24
|
+
canvasContrast: 'canvas-contrast'
|
|
25
|
+
};
|
|
26
|
+
|
|
27
|
+
// Status fill colors (day mode only — only fill, not spot or on-dark)
|
|
28
|
+
const STATUS_FILL_COLORS = {
|
|
29
|
+
statusSuccessFill: 'status-success-fill',
|
|
30
|
+
statusDangerFill: 'status-danger-fill',
|
|
31
|
+
statusWarningFill: 'status-warning-fill'
|
|
32
|
+
};
|
|
33
|
+
export const BACKGROUND_COLORS = {
|
|
34
|
+
...SURFACE_COLORS,
|
|
35
|
+
...CANVAS_COLORS,
|
|
36
|
+
...STATUS_FILL_COLORS
|
|
37
|
+
};
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import type { AriaRole, KeyboardEventHandler, MouseEventHandler } from 'react';
|
|
2
|
+
import type { BpkLayoutBackgroundColor } from './backgroundColors';
|
|
2
3
|
import type { BpkSpacingValue, BpkSizeValue, BpkPositionValue, BpkResponsiveValue } from './tokens';
|
|
3
|
-
import type { TextStyle } from '../../bpk-component-text
|
|
4
|
+
import type { TextColor, TextStyle } from '../../bpk-component-text';
|
|
4
5
|
/**
|
|
5
6
|
* Common spacing-related props shared by all Backpack layout components
|
|
6
7
|
* All spacing props must use Backpack spacing tokens or percentages
|
|
@@ -55,9 +56,9 @@ export interface BpkCommonLayoutProps extends BpkSpacingProps {
|
|
|
55
56
|
textStyle?: BpkResponsiveValue<TextStyle>;
|
|
56
57
|
'data-testid'?: string;
|
|
57
58
|
'data-cy'?: string;
|
|
58
|
-
color?:
|
|
59
|
+
color?: TextColor;
|
|
60
|
+
backgroundColor?: BpkLayoutBackgroundColor;
|
|
59
61
|
background?: never;
|
|
60
|
-
backgroundColor?: never;
|
|
61
62
|
borderColor?: never;
|
|
62
63
|
borderTopColor?: never;
|
|
63
64
|
borderRightColor?: never;
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import { defineConfig } from '@chakra-ui/react';
|
|
19
|
+
import { defineConfig } from '@chakra-ui/react/styled-system';
|
|
20
20
|
|
|
21
21
|
// Import tokens from Backpack foundations
|
|
22
22
|
// Note: Some tokens may not be in TypeScript definitions but exist at runtime
|
|
@@ -2,7 +2,10 @@ import type { HTMLAttributes, ReactNode } from 'react';
|
|
|
2
2
|
import type StackOptionKeys from './BpkStack.constant';
|
|
3
3
|
import type { BpkCommonLayoutProps } from './commonProps';
|
|
4
4
|
import type { BpkSpacingValue, BpkResponsiveValue, BpkBasisValue } from './tokens';
|
|
5
|
-
import type { BoxProps
|
|
5
|
+
import type { BoxProps } from '@chakra-ui/react/box';
|
|
6
|
+
import type { FlexProps } from '@chakra-ui/react/flex';
|
|
7
|
+
import type { GridProps, GridItemProps } from '@chakra-ui/react/grid';
|
|
8
|
+
import type { StackProps } from '@chakra-ui/react/stack';
|
|
6
9
|
/**
|
|
7
10
|
* Layout-level event props that should not be exposed on layout components.
|
|
8
11
|
* onClick is handled via BpkCommonLayoutProps; onFocus/onBlur are reintroduced
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import { Dialog } from '@ark-ui/react';
|
|
19
|
+
import { Dialog } from '@ark-ui/react/dialog';
|
|
20
20
|
|
|
21
21
|
// @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
|
|
22
22
|
import BpkCloseButton from "../../../../bpk-component-close-button";
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import { Dialog } from '@ark-ui/react';
|
|
19
|
+
import { Dialog } from '@ark-ui/react/dialog';
|
|
20
20
|
import { cssModules, getDataComponentAttribute } from "../../../../bpk-react-utils";
|
|
21
21
|
import { useModalType } from "../BpkModalV3Context";
|
|
22
22
|
import STYLES from "./BpkModalV3Content.module.css";
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import { Dialog } from '@ark-ui/react';
|
|
19
|
+
import { Dialog } from '@ark-ui/react/dialog';
|
|
20
20
|
import { getDataComponentAttribute } from "../../../../bpk-react-utils";
|
|
21
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
22
|
const BpkModalV3Description = ({
|
|
@@ -17,7 +17,7 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import { useEffect, useState } from 'react';
|
|
20
|
-
import { Dialog } from '@ark-ui/react';
|
|
20
|
+
import { Dialog } from '@ark-ui/react/dialog';
|
|
21
21
|
import { durationBase } from '@skyscanner/bpk-foundations-web/tokens/base.es6';
|
|
22
22
|
import { getDataComponentAttribute, useBodyLock } from "../../../../bpk-react-utils";
|
|
23
23
|
import { ModalTypeProvider } from "../BpkModalV3Context";
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import { Dialog } from '@ark-ui/react';
|
|
19
|
+
import { Dialog } from '@ark-ui/react/dialog';
|
|
20
20
|
import { cssModules, getDataComponentAttribute } from "../../../../bpk-react-utils";
|
|
21
21
|
import { useModalType } from "../BpkModalV3Context";
|
|
22
22
|
import STYLES from "./BpkModalV3Scrim.module.css";
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import { Dialog } from '@ark-ui/react';
|
|
19
|
+
import { Dialog } from '@ark-ui/react/dialog';
|
|
20
20
|
import { cssModules, getDataComponentAttribute } from "../../../../bpk-react-utils";
|
|
21
21
|
import STYLES from "./BpkModalV3Title.module.css";
|
|
22
22
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import { Dialog } from '@ark-ui/react';
|
|
19
|
+
import { Dialog } from '@ark-ui/react/dialog';
|
|
20
20
|
import { getDataComponentAttribute } from "../../../../bpk-react-utils";
|
|
21
21
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
22
22
|
const BpkModalV3Trigger = ({
|
|
@@ -17,7 +17,8 @@
|
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
19
|
import { useRef } from 'react';
|
|
20
|
-
import {
|
|
20
|
+
import { useLocaleContext } from '@ark-ui/react/locale';
|
|
21
|
+
import { SegmentGroup } from '@ark-ui/react/segment-group';
|
|
21
22
|
import { cssModules, getDataComponentAttribute } from "../../../bpk-react-utils";
|
|
22
23
|
import { SEGMENT_TYPES_V2 } from "./common-types";
|
|
23
24
|
import STYLES from "./BpkSegmentedControlV2.module.css";
|
package/bpk-mixins/_borders.scss
CHANGED
|
@@ -37,7 +37,11 @@
|
|
|
37
37
|
/// @access private
|
|
38
38
|
|
|
39
39
|
@mixin _bpk-border-top($size, $color, $inset) {
|
|
40
|
-
$offset-y:
|
|
40
|
+
$offset-y: $size;
|
|
41
|
+
|
|
42
|
+
@if $inset != inset {
|
|
43
|
+
$offset-y: -#{$size};
|
|
44
|
+
}
|
|
41
45
|
|
|
42
46
|
box-shadow: 0 $offset-y 0 0 $color #{$inset};
|
|
43
47
|
}
|
|
@@ -47,7 +51,11 @@
|
|
|
47
51
|
/// @access private
|
|
48
52
|
|
|
49
53
|
@mixin bpk-border-right($size, $color, $inset) {
|
|
50
|
-
$offset-x:
|
|
54
|
+
$offset-x: -#{$size};
|
|
55
|
+
|
|
56
|
+
@if $inset != inset {
|
|
57
|
+
$offset-x: $size;
|
|
58
|
+
}
|
|
51
59
|
|
|
52
60
|
box-shadow: $offset-x 0 0 0 $color #{$inset};
|
|
53
61
|
}
|
|
@@ -57,7 +65,11 @@
|
|
|
57
65
|
/// @access private
|
|
58
66
|
|
|
59
67
|
@mixin _bpk-border-bottom($size, $color, $inset) {
|
|
60
|
-
$offset-y:
|
|
68
|
+
$offset-y: -#{$size};
|
|
69
|
+
|
|
70
|
+
@if $inset != inset {
|
|
71
|
+
$offset-y: $size;
|
|
72
|
+
}
|
|
61
73
|
|
|
62
74
|
box-shadow: 0 $offset-y 0 0 $color #{$inset};
|
|
63
75
|
}
|
|
@@ -67,7 +79,11 @@
|
|
|
67
79
|
/// @access private
|
|
68
80
|
|
|
69
81
|
@mixin bpk-border-left($size, $color, $inset) {
|
|
70
|
-
$offset-x:
|
|
82
|
+
$offset-x: $size;
|
|
83
|
+
|
|
84
|
+
@if $inset != inset {
|
|
85
|
+
$offset-x: -#{$size};
|
|
86
|
+
}
|
|
71
87
|
|
|
72
88
|
box-shadow: $offset-x 0 0 0 $color #{$inset};
|
|
73
89
|
}
|
|
@@ -29,7 +29,11 @@
|
|
|
29
29
|
/// @access private
|
|
30
30
|
|
|
31
31
|
@mixin _bpk-scroll-indicator($gradient-color, $direction: 'left') {
|
|
32
|
-
$gradient-direction:
|
|
32
|
+
$gradient-direction: 90deg;
|
|
33
|
+
|
|
34
|
+
@if $direction != 'left' {
|
|
35
|
+
$gradient-direction: 270deg;
|
|
36
|
+
}
|
|
33
37
|
|
|
34
38
|
position: absolute;
|
|
35
39
|
top: 0;
|