@skyscanner/backpack-web 25.4.1 → 25.5.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.
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "SECTION_TYPES", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _BpkSectionHeader.SECTION_TYPES;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
exports.default = void 0;
|
|
13
|
+
var _BpkSectionHeader = _interopRequireWildcard(require("./src/BpkSectionHeader"));
|
|
14
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
|
+
/*
|
|
17
|
+
* Backpack - Skyscanner's Design System
|
|
18
|
+
*
|
|
19
|
+
* Copyright 2016 Skyscanner Ltd
|
|
20
|
+
*
|
|
21
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
22
|
+
* you may not use this file except in compliance with the License.
|
|
23
|
+
* You may obtain a copy of the License at
|
|
24
|
+
*
|
|
25
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
26
|
+
*
|
|
27
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
28
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
29
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
30
|
+
* See the License for the specific language governing permissions and
|
|
31
|
+
* limitations under the License.
|
|
32
|
+
*/
|
|
33
|
+
var _default = _BpkSectionHeader.default;
|
|
34
|
+
exports.default = _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
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 type { ReactNode } from 'react';
|
|
20
|
+
export declare const SECTION_TYPES: {
|
|
21
|
+
default: 'default',
|
|
22
|
+
onDark: 'onDark',
|
|
23
|
+
};
|
|
24
|
+
export type SectionType = (typeof SECTION_TYPES)[keyof typeof SECTION_TYPES];
|
|
25
|
+
type Props = {
|
|
26
|
+
title: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
button?: ReactNode;
|
|
29
|
+
type?: SectionType;
|
|
30
|
+
};
|
|
31
|
+
declare const BpkSectionHeader: ({ title, description, button, type }: Props) => JSX.Element;
|
|
32
|
+
export default BpkSectionHeader;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.SECTION_TYPES = void 0;
|
|
7
|
+
var _bpkReactUtils = require("../../bpk-react-utils");
|
|
8
|
+
var _bpkComponentText = _interopRequireDefault(require("../../bpk-component-text"));
|
|
9
|
+
var _BpkSectionHeaderModule = _interopRequireDefault(require("./BpkSectionHeader.module.css"));
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
/*
|
|
13
|
+
* Backpack - Skyscanner's Design System
|
|
14
|
+
*
|
|
15
|
+
* Copyright 2016 Skyscanner Ltd
|
|
16
|
+
*
|
|
17
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
18
|
+
* you may not use this file except in compliance with the License.
|
|
19
|
+
* You may obtain a copy of the License at
|
|
20
|
+
*
|
|
21
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
22
|
+
*
|
|
23
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
24
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
25
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
26
|
+
* See the License for the specific language governing permissions and
|
|
27
|
+
* limitations under the License.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
const getClassName = (0, _bpkReactUtils.cssModules)(_BpkSectionHeaderModule.default);
|
|
31
|
+
const SECTION_TYPES = {
|
|
32
|
+
default: 'default',
|
|
33
|
+
onDark: 'on-dark'
|
|
34
|
+
};
|
|
35
|
+
exports.SECTION_TYPES = SECTION_TYPES;
|
|
36
|
+
const BpkSectionHeader = ({
|
|
37
|
+
button,
|
|
38
|
+
description,
|
|
39
|
+
title,
|
|
40
|
+
type = SECTION_TYPES.default
|
|
41
|
+
}) => /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
42
|
+
className: getClassName('bpk-section-header'),
|
|
43
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
44
|
+
className: getClassName('bpk-section-header__title-description', `bpk-section-header__title-description--${type}`),
|
|
45
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_bpkComponentText.default, {
|
|
46
|
+
tagName: "h2",
|
|
47
|
+
className: getClassName('bpk-section-header__title'),
|
|
48
|
+
children: title
|
|
49
|
+
}), description && /*#__PURE__*/(0, _jsxRuntime.jsx)(_bpkComponentText.default, {
|
|
50
|
+
children: description
|
|
51
|
+
})]
|
|
52
|
+
}), button]
|
|
53
|
+
});
|
|
54
|
+
var _default = BpkSectionHeader;
|
|
55
|
+
exports.default = _default;
|
|
@@ -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
|
+
@keyframes bpk-keyframe-spin{100%{transform:rotate(1turn)}}.bpk-section-header{display:flex;justify-content:space-between;align-items:flex-start;background-color:transparent}.bpk-section-header__title-description{display:flex;flex-direction:column}.bpk-section-header__title-description--default{color:#161616}.bpk-section-header__title-description--on-dark{color:#fff}.bpk-section-header__title{font-size:2rem;line-height:2.5rem;font-weight:700}@media (max-width: 32rem){.bpk-section-header__title{font-size:1.5rem;line-height:1.75rem;font-weight:700}}
|