@skyscanner/backpack-web 23.1.0-beta.2 → 23.1.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.
Files changed (33) hide show
  1. package/bpk-component-aria-live/index.d.ts +26 -0
  2. package/bpk-component-aria-live/src/BpkAriaLive.d.ts +18 -0
  3. package/bpk-component-badge/index.d.ts +24 -0
  4. package/bpk-component-badge/src/BpkBadge.d.ts +47 -0
  5. package/bpk-component-badge/src/BpkBadge.js +13 -29
  6. package/bpk-component-boilerplate/index.d.ts +24 -0
  7. package/bpk-component-boilerplate/src/BpkBoilerplate.d.ts +29 -0
  8. package/bpk-component-boilerplate/src/BpkBoilerplate.js +6 -9
  9. package/bpk-component-dialog/index.d.ts +25 -0
  10. package/bpk-component-dialog/src/BpkDialog.d.ts +33 -0
  11. package/bpk-component-dialog/src/BpkDialog.js +12 -12
  12. package/bpk-component-dialog/src/BpkDialogInner.d.ts +21 -0
  13. package/bpk-component-dialog/src/BpkDialogInner.js +29 -33
  14. package/bpk-component-dialog/src/common-types.d.ts +45 -0
  15. package/bpk-component-dialog/src/common-types.js +20 -71
  16. package/bpk-component-floating-notification/src/BpkFloatingNotification.module.css +1 -1
  17. package/bpk-component-graphic-promotion/index.d.ts +26 -0
  18. package/bpk-component-graphic-promotion/src/BpkGraphicPromo.d.ts +54 -0
  19. package/bpk-component-graphic-promotion/src/BpkGraphicPromo.js +1 -10
  20. package/bpk-component-icon/all.js +12 -4
  21. package/bpk-component-icon/index.d.ts +41 -0
  22. package/bpk-component-icon/lg/upload.js +38 -0
  23. package/bpk-component-icon/sm/upload.js +39 -0
  24. package/bpk-component-icon/src/classNameModifierHOCFactory.d.ts +32 -0
  25. package/bpk-component-icon/src/classNameModifierHOCFactory.js +1 -8
  26. package/bpk-component-icon/src/withAlignment.d.ts +28 -0
  27. package/bpk-component-icon/src/withAlignment.js +1 -1
  28. package/bpk-component-icon/src/withDescription.d.ts +24 -0
  29. package/bpk-component-icon/src/withDescription.js +1 -3
  30. package/bpk-component-icon/src/withRtlSupport.d.ts +29 -0
  31. package/bpk-component-icon/src/withRtlSupport.js +2 -0
  32. package/bpk-component-price/src/BpkPrice.js +1 -1
  33. package/package.json +4 -4
@@ -0,0 +1,26 @@
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 BpkAriaLive, {
20
+ POLITENESS_SETTINGS as ARIA_LIVE_POLITENESS_SETTINGS,
21
+ type Props as BpkAriaLiveProps,
22
+ } from './src/BpkAriaLive';
23
+
24
+ export { ARIA_LIVE_POLITENESS_SETTINGS };
25
+ export type { BpkAriaLiveProps };
26
+ export default BpkAriaLive;
@@ -1,3 +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
+
1
19
  import type { ReactElement } from 'react';
2
20
 
3
21
  export declare const POLITENESS_SETTINGS: {
@@ -0,0 +1,24 @@
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 component, { BADGE_TYPES, type Props } from './src/BpkBadge';
20
+ import themeAttributes from './src/themeAttributes';
21
+
22
+ export type BpkBadgeProps = Props;
23
+ export default component;
24
+ export { BADGE_TYPES, themeAttributes };
@@ -0,0 +1,47 @@
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
+
21
+ export declare const BADGE_TYPES: {
22
+ readonly warning: 'warning';
23
+ readonly success: 'success';
24
+ readonly critical: 'critical';
25
+ readonly normal: 'normal';
26
+ readonly inverse: 'inverse';
27
+ readonly outline: 'outline';
28
+ readonly strong: 'strong';
29
+ readonly brand: 'brand';
30
+ };
31
+ export type BadgeType = typeof BADGE_TYPES[keyof typeof BADGE_TYPES];
32
+ export type Props = {
33
+ type?: BadgeType;
34
+ docked?: 'right' | 'left' | null;
35
+ centered?: boolean;
36
+ className?: string | null;
37
+ children: string | ReactNode;
38
+ [rest: string]: any;
39
+ };
40
+ declare const BpkBadge: ({
41
+ centered,
42
+ className,
43
+ docked,
44
+ type,
45
+ ...rest
46
+ }: Props) => JSX.Element;
47
+ export default BpkBadge;
@@ -4,11 +4,10 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = exports.BADGE_TYPES = void 0;
7
- var _propTypes = _interopRequireDefault(require("prop-types"));
8
7
  var _bpkReactUtils = require("../../bpk-react-utils");
9
8
  var _BpkBadgeModule = _interopRequireDefault(require("./BpkBadge.module.css"));
10
9
  var _jsxRuntime = require("react/jsx-runtime");
11
- const _excluded = ["centered", "className", "docked", "type"];
10
+ const _excluded = ["type", "docked", "centered", "className"];
12
11
  /*
13
12
  * Backpack - Skyscanner's Design System
14
13
  *
@@ -26,6 +25,7 @@ const _excluded = ["centered", "className", "docked", "type"];
26
25
  * See the License for the specific language governing permissions and
27
26
  * limitations under the License.
28
27
  */
28
+ // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
29
29
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
30
30
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
31
31
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -56,34 +56,18 @@ const badgeTypeClassNames = {
56
56
  [BADGE_TYPES.strong]: getClassName('bpk-badge--strong'),
57
57
  [BADGE_TYPES.brand]: getClassName('bpk-badge--brand')
58
58
  };
59
- const BpkBadge = props => {
60
- const {
61
- centered,
62
- className,
63
- docked,
64
- type
65
- } = props,
66
- rest = _objectWithoutProperties(props, _excluded);
59
+ const BpkBadge = _ref => {
60
+ let {
61
+ type = BADGE_TYPES.normal,
62
+ docked = null,
63
+ centered = false,
64
+ className = null
65
+ } = _ref,
66
+ rest = _objectWithoutProperties(_ref, _excluded);
67
67
  const classNames = getClassName('bpk-badge', badgeTypeClassNames[type], docked === 'right' && 'bpk-badge--docked-right', docked === 'left' && 'bpk-badge--docked-left', centered && 'bpk-badge--centered', className);
68
- return (
69
- /*#__PURE__*/
70
- // $FlowFixMe[cannot-spread-inexact] - inexact rest. See 'decisions/flowfixme.md'.
71
- (0, _jsxRuntime.jsx)("span", _objectSpread({
72
- className: classNames
73
- }, rest))
74
- );
75
- };
76
- BpkBadge.propTypes = {
77
- type: _propTypes.default.oneOf(Object.keys(BADGE_TYPES)),
78
- docked: _propTypes.default.oneOf(['right', 'left', null]),
79
- centered: _propTypes.default.bool,
80
- className: _propTypes.default.string
81
- };
82
- BpkBadge.defaultProps = {
83
- type: BADGE_TYPES.normal,
84
- docked: null,
85
- centered: false,
86
- className: null
68
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("span", _objectSpread({
69
+ className: classNames
70
+ }, rest));
87
71
  };
88
72
  var _default = BpkBadge;
89
73
  exports.default = _default;
@@ -0,0 +1,24 @@
1
+ /*
2
+ * Backpack - Skyscanner's Design System
3
+ *
4
+ * Copyright 2022 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 BpkBoilerplate, {
20
+ type Props as BpkBoilerplateProps,
21
+ } from './src/BpkBoilerplate';
22
+
23
+ export type { BpkBoilerplateProps };
24
+ export default BpkBoilerplate;
@@ -0,0 +1,29 @@
1
+ /*
2
+ * Backpack - Skyscanner's Design System
3
+ *
4
+ * Copyright 2022 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 type Props = {
20
+ className?: string | null;
21
+ [rest: string]: any;
22
+ };
23
+ declare const BpkBoilerplate: {
24
+ ({ className, ...rest }: Props): JSX.Element;
25
+ defaultProps: {
26
+ className: null;
27
+ };
28
+ };
29
+ export default BpkBoilerplate;
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _propTypes = _interopRequireDefault(require("prop-types"));
8
7
  var _bpkReactUtils = require("../../bpk-react-utils");
9
8
  var _BpkBoilerplateModule = _interopRequireDefault(require("./BpkBoilerplate.module.css"));
10
9
  var _jsxRuntime = require("react/jsx-runtime");
@@ -26,6 +25,7 @@ const _excluded = ["className"];
26
25
  * See the License for the specific language governing permissions and
27
26
  * limitations under the License.
28
27
  */
28
+ // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
29
29
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
30
30
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
31
31
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -35,11 +35,11 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
35
35
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
36
36
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
37
37
  const getClassName = (0, _bpkReactUtils.cssModules)(_BpkBoilerplateModule.default);
38
- const BpkBoilerplate = props => {
39
- const {
40
- className
41
- } = props,
42
- rest = _objectWithoutProperties(props, _excluded);
38
+ const BpkBoilerplate = _ref => {
39
+ let {
40
+ className = null
41
+ } = _ref,
42
+ rest = _objectWithoutProperties(_ref, _excluded);
43
43
  const classNames = getClassName('bpk-boilerplate', className);
44
44
  return (
45
45
  /*#__PURE__*/
@@ -51,9 +51,6 @@ const BpkBoilerplate = props => {
51
51
  }))
52
52
  );
53
53
  };
54
- BpkBoilerplate.propTypes = {
55
- className: _propTypes.default.string
56
- };
57
54
  BpkBoilerplate.defaultProps = {
58
55
  className: null
59
56
  };
@@ -0,0 +1,25 @@
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 BpkDialog from './src/BpkDialog';
20
+ import type { Props } from './src/common-types';
21
+ import { HEADER_ICON_TYPES } from './src/common-types';
22
+
23
+ export type BpkDialogProps = Props;
24
+ export default BpkDialog;
25
+ export { HEADER_ICON_TYPES };
@@ -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
+ /// <reference types="react" />
20
+ import type { Props } from './common-types';
21
+
22
+ declare const BpkDialog: ({
23
+ children,
24
+ closeLabel,
25
+ dismissible,
26
+ headerIcon,
27
+ headerIconType,
28
+ isOpen,
29
+ onClose,
30
+ renderTarget,
31
+ ...rest
32
+ }: Props) => JSX.Element;
33
+ export default BpkDialog;
@@ -28,6 +28,8 @@ const _excluded = ["children", "closeLabel", "dismissible", "headerIcon", "heade
28
28
  * See the License for the specific language governing permissions and
29
29
  * limitations under the License.
30
30
  */
31
+ // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
32
+ // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
31
33
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
32
34
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
33
35
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
@@ -37,18 +39,18 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
37
39
  function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
38
40
  function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
39
41
  const getClassName = (0, _bpkReactUtils.cssModules)(_BpkDialogModule.default);
40
- const BpkDialog = props => {
41
- const {
42
+ const BpkDialog = _ref => {
43
+ let {
42
44
  children,
43
- closeLabel,
44
- dismissible,
45
- headerIcon,
46
- headerIconType,
45
+ closeLabel = '',
46
+ dismissible = true,
47
+ headerIcon = null,
48
+ headerIconType = _commonTypes.HEADER_ICON_TYPES.primary,
47
49
  isOpen,
48
- onClose,
49
- renderTarget
50
- } = props,
51
- rest = _objectWithoutProperties(props, _excluded);
50
+ onClose = () => {},
51
+ renderTarget = () => null
52
+ } = _ref,
53
+ rest = _objectWithoutProperties(_ref, _excluded);
52
54
  const headerIconClassNames = getClassName('bpk-dialog__icon', `bpk-dialog__icon--${headerIconType}`);
53
55
  const closeButtonClassNames = getClassName('bpk-dialog__close-button');
54
56
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(_bpkReactUtils.Portal, {
@@ -73,7 +75,5 @@ const BpkDialog = props => {
73
75
  }))
74
76
  });
75
77
  };
76
- BpkDialog.propTypes = _objectSpread({}, _commonTypes.propTypes);
77
- BpkDialog.defaultProps = _objectSpread({}, _commonTypes.defaultProps);
78
78
  var _default = BpkDialog;
79
79
  exports.default = _default;
@@ -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
+ /* eslint-disable no-underscore-dangle */
20
+ declare const _default: any;
21
+ export default _default;
@@ -3,45 +3,47 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.propTypes = exports.defaultProps = exports.default = void 0;
6
+ exports.default = void 0;
7
7
  var _bpkReactUtils = require("../../bpk-react-utils");
8
8
  var _bpkScrimUtils = require("../../bpk-scrim-utils");
9
9
  var _bpkComponentFlare = require("../../bpk-component-flare");
10
- var _commonTypes = require("./common-types");
11
10
  var _BpkDialogInnerModule = _interopRequireDefault(require("./BpkDialogInner.module.css"));
12
11
  var _jsxRuntime = require("react/jsx-runtime");
13
12
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
15
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
16
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
17
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
18
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); } /*
19
- * Backpack - Skyscanner's Design System
20
- *
21
- * Copyright 2016 Skyscanner Ltd
22
- *
23
- * Licensed under the Apache License, Version 2.0 (the "License");
24
- * you may not use this file except in compliance with the License.
25
- * You may obtain a copy of the License at
26
- *
27
- * http://www.apache.org/licenses/LICENSE-2.0
28
- *
29
- * Unless required by applicable law or agreed to in writing, software
30
- * distributed under the License is distributed on an "AS IS" BASIS,
31
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
32
- * See the License for the specific language governing permissions and
33
- * limitations under the License.
34
- */
13
+ /*
14
+ * Backpack - Skyscanner's Design System
15
+ *
16
+ * Copyright 2016 Skyscanner Ltd
17
+ *
18
+ * Licensed under the Apache License, Version 2.0 (the "License");
19
+ * you may not use this file except in compliance with the License.
20
+ * You may obtain a copy of the License at
21
+ *
22
+ * http://www.apache.org/licenses/LICENSE-2.0
23
+ *
24
+ * Unless required by applicable law or agreed to in writing, software
25
+ * distributed under the License is distributed on an "AS IS" BASIS,
26
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27
+ * See the License for the specific language governing permissions and
28
+ * limitations under the License.
29
+ */
30
+
31
+ // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
32
+
33
+ // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
34
+
35
+ // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
36
+
35
37
  const getClassName = (0, _bpkReactUtils.cssModules)(_BpkDialogInnerModule.default);
36
38
  const BpkDialogInner = props => {
37
39
  const {
38
40
  ariaLabel,
39
41
  children,
40
- className,
42
+ className = null,
41
43
  contentClassName,
42
44
  dialogRef,
43
- flare,
44
- flareClassName,
45
+ flare = false,
46
+ flareClassName = null,
45
47
  id
46
48
  } = props;
47
49
  const classNames = getClassName('bpk-dialog-inner', className);
@@ -53,7 +55,7 @@ const BpkDialogInner = props => {
53
55
  transitionTimeout: 300,
54
56
  children: /*#__PURE__*/(0, _jsxRuntime.jsxs)("section", {
55
57
  id: id,
56
- tabIndex: "-1",
58
+ tabIndex: -1,
57
59
  role: "dialog",
58
60
  "aria-label": ariaLabel,
59
61
  className: classNames,
@@ -67,11 +69,5 @@ const BpkDialogInner = props => {
67
69
  })
68
70
  });
69
71
  };
70
- const propTypes = _objectSpread({}, _commonTypes.dialogInnerPropTypes);
71
- exports.propTypes = propTypes;
72
- const defaultProps = _objectSpread({}, _commonTypes.dialogInnerDefaultProps);
73
- exports.defaultProps = defaultProps;
74
- BpkDialogInner.propTypes = _objectSpread({}, propTypes);
75
- BpkDialogInner.defaultProps = _objectSpread({}, defaultProps);
76
72
  var _default = (0, _bpkScrimUtils.withScrim)(BpkDialogInner);
77
73
  exports.default = _default;
@@ -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 type { ReactNode, SyntheticEvent } from 'react';
20
+
21
+ export declare const HEADER_ICON_TYPES: {
22
+ readonly primary: 'primary';
23
+ readonly warning: 'warning';
24
+ readonly destructive: 'destructive';
25
+ };
26
+ export type DialogInnerProps = {
27
+ ariaLabel: string;
28
+ id: string;
29
+ children: ReactNode;
30
+ dialogRef: (ref: HTMLElement) => void;
31
+ getApplicationElement: () => HTMLElement;
32
+ className?: string;
33
+ contentClassName?: string;
34
+ flare?: boolean;
35
+ flareClassName?: string;
36
+ };
37
+ export type Props = DialogInnerProps & {
38
+ isOpen: boolean;
39
+ renderTarget?: () => HTMLElement | null;
40
+ onClose: (event: SyntheticEvent) => void | null;
41
+ closeLabel?: string;
42
+ dismissible?: boolean;
43
+ headerIcon?: ReactNode;
44
+ headerIconType?: typeof HEADER_ICON_TYPES[keyof typeof HEADER_ICON_TYPES];
45
+ };
@@ -3,79 +3,28 @@
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.propTypes = exports.dialogInnerPropTypes = exports.dialogInnerDefaultProps = exports.defaultProps = exports.HEADER_ICON_TYPES = void 0;
7
- var _propTypes = _interopRequireDefault(require("prop-types"));
8
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
9
- function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
10
- function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
11
- function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
12
- function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
13
- function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
14
- function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
15
- function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; } /*
16
- * Backpack - Skyscanner's Design System
17
- *
18
- * Copyright 2016 Skyscanner Ltd
19
- *
20
- * Licensed under the Apache License, Version 2.0 (the "License");
21
- * you may not use this file except in compliance with the License.
22
- * You may obtain a copy of the License at
23
- *
24
- * http://www.apache.org/licenses/LICENSE-2.0
25
- *
26
- * Unless required by applicable law or agreed to in writing, software
27
- * distributed under the License is distributed on an "AS IS" BASIS,
28
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29
- * See the License for the specific language governing permissions and
30
- * limitations under the License.
31
- */
6
+ exports.HEADER_ICON_TYPES = void 0;
7
+ /*
8
+ * Backpack - Skyscanner's Design System
9
+ *
10
+ * Copyright 2016 Skyscanner Ltd
11
+ *
12
+ * Licensed under the Apache License, Version 2.0 (the "License");
13
+ * you may not use this file except in compliance with the License.
14
+ * You may obtain a copy of the License at
15
+ *
16
+ * http://www.apache.org/licenses/LICENSE-2.0
17
+ *
18
+ * Unless required by applicable law or agreed to in writing, software
19
+ * distributed under the License is distributed on an "AS IS" BASIS,
20
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
21
+ * See the License for the specific language governing permissions and
22
+ * limitations under the License.
23
+ */
24
+
32
25
  const HEADER_ICON_TYPES = {
33
26
  primary: 'primary',
34
27
  warning: 'warning',
35
28
  destructive: 'destructive'
36
29
  };
37
- exports.HEADER_ICON_TYPES = HEADER_ICON_TYPES;
38
- const dialogInnerPropTypes = {
39
- ariaLabel: _propTypes.default.string.isRequired,
40
- children: _propTypes.default.node.isRequired,
41
- dialogRef: _propTypes.default.func.isRequired,
42
- id: _propTypes.default.string.isRequired,
43
- className: _propTypes.default.string,
44
- contentClassName: _propTypes.default.string,
45
- flare: _propTypes.default.bool,
46
- flareClassName: _propTypes.default.string,
47
- withIcon: _propTypes.default.bool
48
- };
49
- exports.dialogInnerPropTypes = dialogInnerPropTypes;
50
- const dialogInnerDefaultProps = {
51
- className: null,
52
- flare: false,
53
- flareClassName: null,
54
- withIcon: false
55
- };
56
-
57
- // Please remove this type when `withScrim` is flow-typed
58
- exports.dialogInnerDefaultProps = dialogInnerDefaultProps;
59
- const {
60
- dialogRef
61
- } = dialogInnerPropTypes,
62
- newDialogPropTypes = _objectWithoutProperties(dialogInnerPropTypes, ["dialogRef"]);
63
- const propTypes = _objectSpread(_objectSpread({}, newDialogPropTypes), {}, {
64
- isOpen: _propTypes.default.bool.isRequired,
65
- renderTarget: _propTypes.default.func,
66
- closeLabel: _propTypes.default.string,
67
- onClose: _propTypes.default.func,
68
- dismissible: _propTypes.default.bool,
69
- headerIcon: _propTypes.default.node,
70
- headerIconType: _propTypes.default.oneOf(Object.keys(HEADER_ICON_TYPES))
71
- });
72
- exports.propTypes = propTypes;
73
- const defaultProps = _objectSpread(_objectSpread({}, dialogInnerDefaultProps), {}, {
74
- renderTarget: null,
75
- closeLabel: '',
76
- onClose: () => null,
77
- dismissible: true,
78
- headerIcon: null,
79
- headerIconType: HEADER_ICON_TYPES.primary
80
- });
81
- exports.defaultProps = defaultProps;
30
+ exports.HEADER_ICON_TYPES = HEADER_ICON_TYPES;
@@ -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
- @keyframes bpk-keyframe-spin{100%{transform:rotate(1turn)}}.bpk-floating-notification{position:absolute;right:0;bottom:2rem;left:0;display:flex;max-width:25rem;margin:auto;padding:1.5rem;transition:opacity 400ms ease-in-out,transform 400ms ease-in-out;border-radius:.75rem;background:#05203c;color:#fff;box-shadow:0px 12px 50px 0px rgba(37,32,31,0.25),0px 4px 14px 0px rgba(37,32,31,0.25)}@media (max-width: 32rem){.bpk-floating-notification{max-width:100%;padding:1rem}}.bpk-floating-notification--leave{transform:translateY(0);opacity:1}.bpk-floating-notification--leave-active{transform:translateY(2rem);opacity:0}.bpk-floating-notification--leave-done{opacity:0}.bpk-floating-notification--appear{transform:translateY(2rem);opacity:0}.bpk-floating-notification--appear-active{transform:translateY(0);opacity:1}.bpk-floating-notification__button{min-height:0;margin:0 0 auto auto;padding:0;color:#fff}.bpk-floating-notification__icon{margin:0.25rem 0.5rem 0 0.25rem;flex-shrink:0;text-align:bottom;fill:#fff}.bpk-floating-notification__text{margin-right:0.5rem}
18
+ @keyframes bpk-keyframe-spin{100%{transform:rotate(1turn)}}.bpk-floating-notification{position:absolute;right:0;bottom:2rem;left:0;display:flex;max-width:25rem;margin:auto;padding:1.5rem;transition:opacity 400ms ease-in-out,transform 400ms ease-in-out;border-radius:.75rem;background:#05203c;color:#fff;box-shadow:0px 12px 50px 0px rgba(37,32,31,0.25),0px 4px 14px 0px rgba(37,32,31,0.25)}@media (max-width: 32rem){.bpk-floating-notification{max-width:100%;padding:1rem}}.bpk-floating-notification--leave{transform:translateY(0);opacity:1}.bpk-floating-notification--leave-active{transform:translateY(2rem);opacity:0}.bpk-floating-notification--leave-done{opacity:0}.bpk-floating-notification--appear{transform:translateY(2rem);opacity:0}.bpk-floating-notification--appear-active{transform:translateY(0);opacity:1}.bpk-floating-notification__button{min-height:0;margin:0 0 auto auto;padding:0;color:#fff}.bpk-floating-notification__icon{margin-right:0.5rem;margin-left:0.25rem;flex-shrink:0;transform:translateY(0.25rem);text-align:bottom;fill:#fff}.bpk-floating-notification__text{margin-right:0.5rem}
@@ -0,0 +1,26 @@
1
+ /*
2
+ * Backpack - Skyscanner's Design System
3
+ *
4
+ * Copyright 2022 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 BpkGraphicPromo, {
20
+ type Props as BpkGraphicPromoProps,
21
+ TEXT_ALIGN,
22
+ } from './src/BpkGraphicPromo';
23
+
24
+ export type { BpkGraphicPromoProps };
25
+ export { TEXT_ALIGN };
26
+ export default BpkGraphicPromo;
@@ -0,0 +1,54 @@
1
+ /*
2
+ * Backpack - Skyscanner's Design System
3
+ *
4
+ * Copyright 2022 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 declare const TEXT_ALIGN: {
20
+ readonly start: 'start';
21
+ readonly center: 'center';
22
+ readonly end: 'end';
23
+ };
24
+ export type Props = {
25
+ className?: string | null;
26
+ contentId?: string | null;
27
+ tagline?: string | null;
28
+ headline: string;
29
+ subheading?: string | null;
30
+ sponsor?: {
31
+ label: string;
32
+ logo: string;
33
+ altText: string;
34
+ } | null;
35
+ buttonText: string;
36
+ onClick: () => void;
37
+ invertVertically?: boolean;
38
+ textAlign: typeof TEXT_ALIGN[keyof typeof TEXT_ALIGN];
39
+ style?: {};
40
+ };
41
+ declare const BpkGraphicPromo: ({
42
+ buttonText,
43
+ className,
44
+ contentId,
45
+ headline,
46
+ invertVertically,
47
+ onClick,
48
+ sponsor,
49
+ style,
50
+ subheading,
51
+ tagline,
52
+ textAlign,
53
+ }: Props) => JSX.Element;
54
+ export default BpkGraphicPromo;
@@ -45,7 +45,7 @@ const TEXT_ALIGN = {
45
45
  start: 'start',
46
46
  center: 'center',
47
47
  end: 'end'
48
- }; // as const; // Temp disabling TS types due to non TS projects compatibility.
48
+ };
49
49
  exports.TEXT_ALIGN = TEXT_ALIGN;
50
50
  const constructAriaLabel = ({
51
51
  buttonText,
@@ -152,14 +152,5 @@ const BpkGraphicPromo = ({
152
152
  })
153
153
  );
154
154
  };
155
- BpkGraphicPromo.defaultProps = {
156
- className: null,
157
- contentId: null,
158
- tagline: null,
159
- subheading: null,
160
- sponsor: null,
161
- invertVertically: false,
162
- style: {}
163
- };
164
155
  var _default = BpkGraphicPromo;
165
156
  exports.default = _default;
@@ -1,5 +1,9 @@
1
1
  "use strict";
2
2
 
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.sm = exports.lg = exports.default = void 0;
3
7
  /*
4
8
  * Backpack - Skyscanner's Design System
5
9
  *
@@ -18,6 +22,8 @@
18
22
  * limitations under the License.
19
23
  */
20
24
 
25
+ // TODO: Work out the correct types for these to move away from 'any'.
26
+
21
27
  function requireAll(requireContext) {
22
28
  const hash = {};
23
29
  requireContext.keys().forEach(key => {
@@ -26,7 +32,9 @@ function requireAll(requireContext) {
26
32
  });
27
33
  return hash;
28
34
  }
29
- module.exports = {
30
- sm: requireAll(require.context('./sm', false, /\.js$/)),
31
- lg: requireAll(require.context('./lg', false, /\.js$/))
32
- };
35
+ const sm = requireAll(require.context('./sm', false, /\.js$/));
36
+ exports.sm = sm;
37
+ const lg = requireAll(require.context('./lg', false, /\.js$/));
38
+ exports.lg = lg;
39
+ var _default = sm;
40
+ exports.default = _default;
@@ -0,0 +1,41 @@
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 { ComponentType } from 'react';
20
+
21
+ import withAlignment from './src/withAlignment';
22
+ import withRtlSupport from './src/withRtlSupport';
23
+ import withDescription from './src/withDescription';
24
+
25
+ declare function withButtonAlignment(WrappedComponent: ComponentType<any>): {
26
+ (props: any): JSX.Element;
27
+ displayName: any;
28
+ };
29
+ declare function withLargeButtonAlignment(
30
+ WrappedComponent: ComponentType<any>,
31
+ ): {
32
+ (props: any): JSX.Element;
33
+ displayName: any;
34
+ };
35
+ export {
36
+ withButtonAlignment,
37
+ withLargeButtonAlignment,
38
+ withAlignment,
39
+ withRtlSupport,
40
+ withDescription,
41
+ };
@@ -0,0 +1,38 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _jsxRuntime = require("react/jsx-runtime");
9
+ const _excluded = ["styles"];
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
12
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
13
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
14
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
15
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
16
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
17
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
18
+ var _default = _ref => {
19
+ let {
20
+ styles = {}
21
+ } = _ref,
22
+ props = _objectWithoutProperties(_ref, _excluded);
23
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", _objectSpread(_objectSpread({
24
+ xmlns: "http://www.w3.org/2000/svg",
25
+ width: "24",
26
+ height: "24",
27
+ style: {
28
+ width: "1.5rem",
29
+ height: "1.5rem"
30
+ }
31
+ }, props), {}, {
32
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
33
+ d: "M17.707 7.292a1 1 0 01-1.414 1.414L13 5.413v8.589a1 1 0 11-2 0V5.413L7.707 8.706a1 1 0 01-1.414-1.414l5-5a1 1 0 011.414 0l5 5zM4 14a1 1 0 011 1v3a2 2 0 002 2h10a2 2 0 002-2v-3a1 1 0 112 0v3a4 4 0 01-4 4H7a4 4 0 01-4-4v-3a1 1 0 011-1z",
34
+ clipRule: "evenodd"
35
+ })
36
+ }));
37
+ };
38
+ exports.default = _default;
@@ -0,0 +1,39 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _react = _interopRequireDefault(require("react"));
8
+ var _jsxRuntime = require("react/jsx-runtime");
9
+ const _excluded = ["styles"];
10
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
11
+ function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
12
+ function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
13
+ function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
14
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
15
+ function _toPrimitive(input, hint) { if (typeof input !== "object" || input === null) return input; var prim = input[Symbol.toPrimitive]; if (prim !== undefined) { var res = prim.call(input, hint || "default"); if (typeof res !== "object") return res; throw new TypeError("@@toPrimitive must return a primitive value."); } return (hint === "string" ? String : Number)(input); }
16
+ function _objectWithoutProperties(source, excluded) { if (source == null) return {}; var target = _objectWithoutPropertiesLoose(source, excluded); var key, i; if (Object.getOwnPropertySymbols) { var sourceSymbolKeys = Object.getOwnPropertySymbols(source); for (i = 0; i < sourceSymbolKeys.length; i++) { key = sourceSymbolKeys[i]; if (excluded.indexOf(key) >= 0) continue; if (!Object.prototype.propertyIsEnumerable.call(source, key)) continue; target[key] = source[key]; } } return target; }
17
+ function _objectWithoutPropertiesLoose(source, excluded) { if (source == null) return {}; var target = {}; var sourceKeys = Object.keys(source); var key, i; for (i = 0; i < sourceKeys.length; i++) { key = sourceKeys[i]; if (excluded.indexOf(key) >= 0) continue; target[key] = source[key]; } return target; }
18
+ var _default = _ref => {
19
+ let {
20
+ styles = {}
21
+ } = _ref,
22
+ props = _objectWithoutProperties(_ref, _excluded);
23
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("svg", _objectSpread(_objectSpread({
24
+ xmlns: "http://www.w3.org/2000/svg",
25
+ viewBox: "0 0 24 24",
26
+ width: "16",
27
+ height: "16",
28
+ style: {
29
+ width: "1rem",
30
+ height: "1rem"
31
+ }
32
+ }, props), {}, {
33
+ children: /*#__PURE__*/(0, _jsxRuntime.jsx)("path", {
34
+ d: "M12 15a1.5 1.5 0 001.5-1.5V6.621l1.94 1.94a1.5 1.5 0 002.12-2.122l-4.5-4.5a1.5 1.5 0 00-2.12 0l-4.5 4.5a1.5 1.5 0 102.12 2.122l1.94-1.94V13.5A1.5 1.5 0 0012 15zm-9-2.25a1.5 1.5 0 011.5 1.5V18A1.5 1.5 0 006 19.5h12a1.5 1.5 0 001.5-1.5v-3.75a1.5 1.5 0 013 0V18a4.5 4.5 0 01-4.5 4.5H6A4.5 4.5 0 011.5 18v-3.75a1.5 1.5 0 011.5-1.5z",
35
+ clipRule: "evenodd"
36
+ })
37
+ }));
38
+ };
39
+ 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 { ComponentType } from 'react';
20
+
21
+ // eslint-disable-next-line no-underscore-dangle
22
+ declare const _default: (
23
+ displayName: string,
24
+ classNamesToAdd?: string[],
25
+ ) => (ComposedComponent: ComponentType<any>) => {
26
+ (props: {
27
+ [rest: string]: any;
28
+ className?: string | null | undefined;
29
+ }): JSX.Element;
30
+ displayName: any;
31
+ };
32
+ export default _default;
@@ -4,7 +4,6 @@ Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
6
  exports.default = void 0;
7
- var _propTypes = _interopRequireDefault(require("prop-types"));
8
7
  var _bpkReactUtils = require("../../bpk-react-utils");
9
8
  var _jsxRuntime = require("react/jsx-runtime");
10
9
  const _excluded = ["className"];
@@ -25,7 +24,7 @@ const _excluded = ["className"];
25
24
  * See the License for the specific language governing permissions and
26
25
  * limitations under the License.
27
26
  */
28
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
27
+ // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
29
28
  function ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }
30
29
  function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }
31
30
  function _defineProperty(obj, key, value) { key = _toPropertyKey(key); if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
@@ -48,12 +47,6 @@ var _default = (displayName, classNamesToAdd = []) => ComposedComponent => {
48
47
  className: classNames.join(' ')
49
48
  }, rest));
50
49
  };
51
- ClassNameModifierHOC.propTypes = {
52
- className: _propTypes.default.string
53
- };
54
- ClassNameModifierHOC.defaultProps = {
55
- className: null
56
- };
57
50
  ClassNameModifierHOC.displayName = (0, _bpkReactUtils.wrapDisplayName)(ComposedComponent, displayName);
58
51
  return ClassNameModifierHOC;
59
52
  };
@@ -0,0 +1,28 @@
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 { ComponentType } from 'react';
20
+
21
+ export default function withAlignment(
22
+ Component: ComponentType,
23
+ objectHeight: string,
24
+ subjectHeight: string,
25
+ ): {
26
+ (props: any): JSX.Element;
27
+ displayName: any;
28
+ };
@@ -26,7 +26,7 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
26
26
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
27
27
  * See the License for the specific language governing permissions and
28
28
  * limitations under the License.
29
- */
29
+ */ // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
30
30
  function withAlignment(Component, objectHeight, subjectHeight) {
31
31
  const WithAlignment = props => {
32
32
  const objectHeightDecimal = `${objectHeight}`.replace('rem', '');
@@ -0,0 +1,24 @@
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 { ComponentType } from 'react';
20
+
21
+ export default function withDescription(
22
+ Component: ComponentType<any>,
23
+ description: string,
24
+ ): ComponentType<any>;
@@ -28,10 +28,8 @@ function _toPrimitive(input, hint) { if (typeof input !== "object" || input ===
28
28
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
29
29
  * See the License for the specific language governing permissions and
30
30
  * limitations under the License.
31
- */
31
+ */ // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
32
32
  const getClassName = (0, _bpkReactUtils.cssModules)(_withDescriptionModule.default);
33
-
34
- // TODO: Fix flow config. This should receive the component config as a parametized type
35
33
  function withDescription(Component, description) {
36
34
  const WithDescription = props => /*#__PURE__*/(0, _jsxRuntime.jsxs)("span", {
37
35
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(Component, _objectSpread({}, props)), /*#__PURE__*/(0, _jsxRuntime.jsx)("span", {
@@ -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
+ // eslint-disable-next-line no-underscore-dangle
20
+ declare const _default: (
21
+ ComposedComponent: import('react').ComponentType<any>,
22
+ ) => {
23
+ (props: {
24
+ [rest: string]: any;
25
+ className?: string | null | undefined;
26
+ }): JSX.Element;
27
+ displayName: any;
28
+ };
29
+ export default _default;
@@ -26,6 +26,8 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
26
26
  * limitations under the License.
27
27
  */
28
28
 
29
+ // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
30
+
29
31
  const getClassName = (0, _bpkReactUtils.cssModules)(_BpkIconModule.default);
30
32
  var _default = (0, _classNameModifierHOCFactory.default)('withRtlSupport', [getClassName('bpk-icon--rtl-support')]);
31
33
  exports.default = _default;
@@ -74,7 +74,7 @@ const BpkPrice = props => {
74
74
  children: leadingText
75
75
  })]
76
76
  }), /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
77
- className: isAlignRight && getClassName('bpk-price__column-container'),
77
+ className: getClassName(isAlignRight && 'bpk-price__column-container'),
78
78
  children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_bpkComponentText.default, {
79
79
  textStyle: isSmall ? _bpkComponentText.TEXT_STYLES.heading4 : _bpkComponentText.TEXT_STYLES.xxl,
80
80
  className: getClassName('bpk-price__price', !isAlignRight && 'bpk-price__spacing'),
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyscanner/backpack-web",
3
- "version": "23.1.0-beta.2",
3
+ "version": "23.1.1",
4
4
  "description": "Backpack Design System web library",
5
5
  "repository": {
6
6
  "type": "git",
@@ -24,11 +24,11 @@
24
24
  "dependencies": {
25
25
  "@popperjs/core": "^2.11.5",
26
26
  "@react-google-maps/api": "^2.12.0",
27
- "@skyscanner/bpk-foundations-web": "^15.2.0",
28
- "@skyscanner/bpk-svgs": "^16.3.0",
27
+ "@skyscanner/bpk-foundations-web": "^15.3.0",
28
+ "@skyscanner/bpk-svgs": "^16.3.2",
29
29
  "a11y-focus-scope": "^1.1.3",
30
30
  "a11y-focus-store": "^1.0.0",
31
- "bpk-mixins": "^40.2.1",
31
+ "bpk-mixins": "^40.3.1",
32
32
  "d3-path": "^2.0.0",
33
33
  "d3-scale": "^4.0.2",
34
34
  "date-fns": "^2.21.1",