@skyscanner/backpack-web 34.11.0 → 34.12.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/bpk-component-inset-banner/index.d.ts +4 -0
- package/bpk-component-inset-banner/index.js +21 -0
- package/bpk-component-inset-banner/src/BpkInsetBanner.d.ts +23 -0
- package/bpk-component-inset-banner/src/BpkInsetBanner.js +86 -0
- package/bpk-component-inset-banner/src/BpkInsetBanner.module.css +18 -0
- package/bpk-component-segmented-control/src/BpkSegmentedControl.module.css +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,21 @@
|
|
|
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 BpkInsetBanner, { VARIANT } from "./src/BpkInsetBanner";
|
|
20
|
+
export { VARIANT };
|
|
21
|
+
export default BpkInsetBanner;
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
/// <reference types="react" />
|
|
2
|
+
export declare const VARIANT: {
|
|
3
|
+
onLight: string;
|
|
4
|
+
onDark: string;
|
|
5
|
+
};
|
|
6
|
+
export type Props = {
|
|
7
|
+
accessibilityLabel?: string;
|
|
8
|
+
backgroundColor?: string;
|
|
9
|
+
body?: {
|
|
10
|
+
text: string;
|
|
11
|
+
link?: string;
|
|
12
|
+
linkText?: string;
|
|
13
|
+
};
|
|
14
|
+
callToAction?: {
|
|
15
|
+
text?: string;
|
|
16
|
+
};
|
|
17
|
+
logo?: string;
|
|
18
|
+
subheadline?: string;
|
|
19
|
+
title?: string;
|
|
20
|
+
variant?: (typeof VARIANT)[keyof typeof VARIANT];
|
|
21
|
+
};
|
|
22
|
+
declare const BpkInsetBanner: ({ accessibilityLabel, backgroundColor, body, callToAction, logo, subheadline, title, variant, }: Props) => JSX.Element;
|
|
23
|
+
export default BpkInsetBanner;
|
|
@@ -0,0 +1,86 @@
|
|
|
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
|
+
import { surfaceHighlightDay } from '@skyscanner/bpk-foundations-web/tokens/base.es6';
|
|
19
|
+
import BpkText, { TEXT_STYLES } from "../../bpk-component-text/src/BpkText";
|
|
20
|
+
import { cssModules } from "../../bpk-react-utils";
|
|
21
|
+
import STYLES from "./BpkInsetBanner.module.css";
|
|
22
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
23
|
+
const getClassName = cssModules(STYLES);
|
|
24
|
+
export const VARIANT = {
|
|
25
|
+
onLight: 'on-light',
|
|
26
|
+
onDark: 'on-dark'
|
|
27
|
+
};
|
|
28
|
+
const BpkInsetBanner = ({
|
|
29
|
+
accessibilityLabel,
|
|
30
|
+
backgroundColor = surfaceHighlightDay,
|
|
31
|
+
body,
|
|
32
|
+
callToAction,
|
|
33
|
+
logo,
|
|
34
|
+
subheadline,
|
|
35
|
+
title,
|
|
36
|
+
variant = VARIANT.onLight
|
|
37
|
+
}) => {
|
|
38
|
+
const classNames = getClassName('bpk-inset-banner', `bpk-inset-banner--${variant}`, body && 'bpk-inset-banner--with-body');
|
|
39
|
+
return /*#__PURE__*/_jsxs("div", {
|
|
40
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
41
|
+
"aria-label": accessibilityLabel,
|
|
42
|
+
className: classNames,
|
|
43
|
+
style: {
|
|
44
|
+
backgroundColor
|
|
45
|
+
},
|
|
46
|
+
children: [/*#__PURE__*/_jsxs("div", {
|
|
47
|
+
className: getClassName('bpk-inset-banner--content-container'),
|
|
48
|
+
children: [logo && /*#__PURE__*/_jsx("img", {
|
|
49
|
+
className: getClassName('bpk-inset-banner--image'),
|
|
50
|
+
src: logo,
|
|
51
|
+
alt: "",
|
|
52
|
+
"aria-hidden": true
|
|
53
|
+
}), /*#__PURE__*/_jsxs("div", {
|
|
54
|
+
className: getClassName('bpk-inset-banner--text-container'),
|
|
55
|
+
children: [/*#__PURE__*/_jsx(BpkText, {
|
|
56
|
+
textStyle: TEXT_STYLES.label2,
|
|
57
|
+
children: title
|
|
58
|
+
}), /*#__PURE__*/_jsx(BpkText, {
|
|
59
|
+
textStyle: TEXT_STYLES.caption,
|
|
60
|
+
children: subheadline
|
|
61
|
+
})]
|
|
62
|
+
})]
|
|
63
|
+
}), /*#__PURE__*/_jsx("div", {
|
|
64
|
+
className: getClassName('bpk-inset-banner--cta-container'),
|
|
65
|
+
children: callToAction?.text && /*#__PURE__*/_jsx(BpkText, {
|
|
66
|
+
textStyle: TEXT_STYLES.caption,
|
|
67
|
+
children: callToAction.text
|
|
68
|
+
})
|
|
69
|
+
})]
|
|
70
|
+
}), body && /*#__PURE__*/_jsxs("div", {
|
|
71
|
+
className: getClassName('bpk-inset-banner-body-container'),
|
|
72
|
+
children: [/*#__PURE__*/_jsx(BpkText, {
|
|
73
|
+
textStyle: TEXT_STYLES.caption,
|
|
74
|
+
children: body.text
|
|
75
|
+
}), body.link && body.linkText && /*#__PURE__*/_jsx("a", {
|
|
76
|
+
href: body.link,
|
|
77
|
+
className: getClassName('bpk-inset-banner-body-container--link-text'),
|
|
78
|
+
children: /*#__PURE__*/_jsx(BpkText, {
|
|
79
|
+
textStyle: TEXT_STYLES.caption,
|
|
80
|
+
children: body.linkText
|
|
81
|
+
})
|
|
82
|
+
})]
|
|
83
|
+
})]
|
|
84
|
+
});
|
|
85
|
+
};
|
|
86
|
+
export default BpkInsetBanner;
|
|
@@ -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-inset-banner{display:flex;padding:.5rem 1rem;justify-content:space-between;border-radius:.5rem}.bpk-inset-banner--with-body{border-radius:.5rem .5rem 0 0}.bpk-inset-banner--on-light{color:#161616;fill:#161616}.bpk-inset-banner--on-dark{color:#fff;fill:#fff}.bpk-inset-banner--content-container{display:flex;align-items:center}.bpk-inset-banner--image{max-height:2rem;object-fit:contain;padding-inline-end:1rem}@media(max-width: 32rem){.bpk-inset-banner--image{max-height:1.5rem}}.bpk-inset-banner--text-container{display:flex;flex-direction:column}.bpk-inset-banner--cta-container{display:flex;align-items:center}.bpk-inset-banner-body-container{display:flex;padding:1rem;flex-direction:column;border-radius:0 0 .5rem .5rem;background-color:#eff3f8;color:#161616}.bpk-inset-banner-body-container--link-text{color:#0062e3;text-decoration:none}.bpk-no-touch-support .bpk-inset-banner-body-container--link-text:hover:not(:active):not(:disabled){color:#024daf}:global(.bpk-no-touch-support) .bpk-inset-banner-body-container--link-text:hover:not(:active):not(:disabled){color:#024daf}
|
|
@@ -15,4 +15,4 @@
|
|
|
15
15
|
* See the License for the specific language governing permissions and
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
|
-
.bpk-segmented-control-group{display:flex;flex-wrap:nowrap;overflow:hidden;border-radius:.5rem}.bpk-segmented-control-group-shadow{box-shadow:0px 1px 3px 0px rgba(37,32,31,.3)}.bpk-segmented-control{min-height:2rem;padding:.5rem 1rem;flex:1;border:none;text-overflow:ellipsis;cursor:pointer;overflow:hidden;font-size:.875rem;line-height:1.25rem;font-weight:700}.bpk-segmented-control--canvas-default{background-color:#eff3f8;color:#161616}.bpk-segmented-control--canvas-default-selected{background-color:#05203c;color:#fff}.bpk-segmented-control--canvas-contrast{background-color:#fff;color:#161616}.bpk-segmented-control--canvas-contrast-selected{background-color:#05203c;color:#fff}.bpk-segmented-control--surface-default{background-color:#eff3f8;color:#161616}.bpk-segmented-control--surface-default-selected{background-color:#05203c;color:#fff}.bpk-segmented-control--surface-contrast{background-color:rgba(255,255,255,.1);color:#fff}.bpk-segmented-control--surface-contrast-selected{background-color:#024daf;color:#fff}.bpk-segmented-control:not(:first-of-type,[class*=selected]){border-
|
|
18
|
+
.bpk-segmented-control-group{display:flex;flex-wrap:nowrap;overflow:hidden;border-radius:.5rem}.bpk-segmented-control-group-shadow{box-shadow:0px 1px 3px 0px rgba(37,32,31,.3)}.bpk-segmented-control{min-height:2rem;padding:.5rem 1rem;flex:1;border:none;text-overflow:ellipsis;cursor:pointer;overflow:hidden;font-size:.875rem;line-height:1.25rem;font-weight:700}.bpk-segmented-control--canvas-default{background-color:#eff3f8;color:#161616}.bpk-segmented-control--canvas-default-selected{background-color:#05203c;color:#fff}.bpk-segmented-control--canvas-contrast{background-color:#fff;color:#161616}.bpk-segmented-control--canvas-contrast-selected{background-color:#05203c;color:#fff}.bpk-segmented-control--surface-default{background-color:#eff3f8;color:#161616}.bpk-segmented-control--surface-default-selected{background-color:#05203c;color:#fff}.bpk-segmented-control--surface-contrast{background-color:rgba(255,255,255,.1);color:#fff}.bpk-segmented-control--surface-contrast-selected{background-color:#024daf;color:#fff}.bpk-segmented-control:not(:first-of-type,[class*=selected]){border-inline-start:.0625rem solid #c1c7cf}.bpk-segmented-control--surface-contrast:not(:first-of-type,[class*=selected]){border-inline-start:.0625rem solid rgba(255,255,255,.5)}.bpk-segmented-control[class*=rightOfOption]{border-inline-start:none}
|