@skyscanner/backpack-web 23.1.2 → 23.2.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.
@@ -57,6 +57,12 @@ Object.defineProperty(exports, "BpkButtonSecondaryOnDark", {
57
57
  return _BpkButtonSecondaryOnDark.default;
58
58
  }
59
59
  });
60
+ Object.defineProperty(exports, "BpkButtonV2", {
61
+ enumerable: true,
62
+ get: function () {
63
+ return _BpkButton2.default;
64
+ }
65
+ });
60
66
  Object.defineProperty(exports, "buttonThemeAttributes", {
61
67
  enumerable: true,
62
68
  get: function () {
@@ -107,6 +113,7 @@ Object.defineProperty(exports, "secondaryThemeAttributes", {
107
113
  }
108
114
  });
109
115
  var _BpkButton = _interopRequireDefault(require("./src/BpkButton"));
116
+ var _BpkButton2 = _interopRequireDefault(require("./src/BpkButtonV2/BpkButton"));
110
117
  var _BpkButtonPrimary = _interopRequireDefault(require("./src/BpkButtonPrimary"));
111
118
  var _BpkButtonPrimaryOnDark = _interopRequireDefault(require("./src/BpkButtonPrimaryOnDark"));
112
119
  var _BpkButtonPrimaryOnLight = _interopRequireDefault(require("./src/BpkButtonPrimaryOnLight"));
@@ -0,0 +1,36 @@
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 BpkButtonV2: ({
23
+ blank,
24
+ children,
25
+ className,
26
+ disabled,
27
+ href,
28
+ iconOnly,
29
+ onClick,
30
+ rel: propRel,
31
+ size,
32
+ submit,
33
+ type,
34
+ ...rest
35
+ }: Props) => JSX.Element;
36
+ export default BpkButtonV2;
@@ -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-button{display:inline-block;min-height:2.25rem;margin:0;padding:.375rem 1rem;border:0;border-radius:.5rem;text-align:center;text-decoration:none;cursor:pointer;vertical-align:middle;user-select:none;font-size:1rem;line-height:1.5rem;font-weight:700;color:#fff;color:var(--bpk-button-primary-text-color, #fff);background-color:#05203c;background-color:var(--bpk-button-primary-background-color, #05203c)}.bpk-no-touch-support .bpk-button:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-primary-hover-text-color, #fff);background-color:#154679;background-color:var(--bpk-button-primary-hover-background-color, #154679)}:global(.bpk-no-touch-support) .bpk-button:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-primary-hover-text-color, #fff);background-color:#154679;background-color:var(--bpk-button-primary-hover-background-color, #154679)}.bpk-button:active{color:#fff;color:var(--bpk-button-primary-active-text-color, #fff);background-color:#154679;background-color:var(--bpk-button-primary-active-background-color, #154679)}.bpk-button:disabled{background-color:#e0e3e5;color:rgba(0,0,0,0.2);cursor:not-allowed}.bpk-button--large{min-height:3rem;padding:.75rem 1rem}.bpk-button--icon-only{border-radius:.5rem;padding-right:.625rem;padding-left:.625rem;border-radius:.5rem}.bpk-button--large-icon-only{border-radius:.5rem;padding-right:.75rem;padding-left:.75rem;border-radius:.5rem}.bpk-button--destructive{color:#161616;color:var(--bpk-button-secondary-text-color, #161616);background-color:#e0e3e5;background-color:var(--bpk-button-secondary-background-color, #e0e3e5);color:#c80456;color:var(--bpk-button-destructive-text-color, #c80456);background-color:#e0e3e5;background-color:var(--bpk-button-destructive-background-color, #e0e3e5)}.bpk-no-touch-support .bpk-button--destructive:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-button-secondary-hover-text-color, #161616);background-color:#c2c9cd;background-color:var(--bpk-button-secondary-hover-background-color, #c2c9cd)}:global(.bpk-no-touch-support) .bpk-button--destructive:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-button-secondary-hover-text-color, #161616);background-color:#c2c9cd;background-color:var(--bpk-button-secondary-hover-background-color, #c2c9cd)}.bpk-button--destructive:active{color:#161616;color:var(--bpk-button-secondary-active-text-color, #161616);background-color:#c2c9cd;background-color:var(--bpk-button-secondary-active-background-color, #c2c9cd)}.bpk-button--destructive:disabled{background-color:#e0e3e5;color:rgba(0,0,0,0.2)}.bpk-no-touch-support .bpk-button--destructive:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-destructive-hover-text-color, #fff);background-color:#c80456;background-color:var(--bpk-button-destructive-hover-background-color, #c80456)}:global(.bpk-no-touch-support) .bpk-button--destructive:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-destructive-hover-text-color, #fff);background-color:#c80456;background-color:var(--bpk-button-destructive-hover-background-color, #c80456)}.bpk-button--destructive:active{color:#fff;color:var(--bpk-button-destructive-active-text-color, #fff);background-color:#c80456;background-color:var(--bpk-button-destructive-active-background-color, #c80456)}.bpk-button--destructive:disabled{background-color:#e0e3e5;color:rgba(0,0,0,0.2)}.bpk-button--featured{color:#fff;color:var(--bpk-button-featured-text-color, #fff);background-color:#0062e3;background-color:var(--bpk-button-featured-background-color, #0062e3)}.bpk-no-touch-support .bpk-button--featured:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-featured-hover-text-color, #fff);background-color:#024daf;background-color:var(--bpk-button-featured-hover-background-color, #024daf)}:global(.bpk-no-touch-support) .bpk-button--featured:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-featured-hover-text-color, #fff);background-color:#024daf;background-color:var(--bpk-button-featured-hover-background-color, #024daf)}.bpk-button--featured:active{color:#fff;color:var(--bpk-button-featured-active-text-color, #fff);background-color:#024daf;background-color:var(--bpk-button-featured-active-background-color, #024daf)}.bpk-button--featured:disabled{background-color:#e0e3e5;color:rgba(0,0,0,0.2)}.bpk-button--link{border-radius:0;background:none;box-shadow:none;padding:0;border:0;background-color:transparent;text-decoration:none;cursor:pointer;appearance:none;color:#0062e3;color:var(--bpk-link-color, #0062e3);padding:.375rem 0;color:#0062e3}.bpk-no-touch-support .bpk-button--link:hover:not(:active):not(:disabled){text-decoration:underline;color:#0062e3;color:var(--bpk-link-hover-color, #0062e3)}:global(.bpk-no-touch-support) .bpk-button--link:hover:not(:active):not(:disabled){text-decoration:underline;color:#0062e3;color:var(--bpk-link-hover-color, #0062e3)}.bpk-button--link:visited{color:#0062e3;color:var(--bpk-link-visited-color, #0062e3)}.bpk-button--link:active{text-decoration:underline;color:#0062e3;color:var(--bpk-link-active-color, #0062e3)}.bpk-no-touch-support .bpk-button--link:hover:not(:active):not(:disabled){background:none;color:#154679;text-decoration:none}:global(.bpk-no-touch-support) .bpk-button--link:hover:not(:active):not(:disabled){background:none;color:#154679;text-decoration:none}.bpk-button--link:active{background:none;color:#154679;text-decoration:none}.bpk-button--link:disabled{background:none;color:rgba(0,0,0,0.2);text-decoration:none}.bpk-button--link-large{padding:.75rem 0}.bpk-button--link-on-dark{border-radius:0;background:none;box-shadow:none;padding:0;border:0;background-color:transparent;text-decoration:none;cursor:pointer;appearance:none;color:#0062e3;color:var(--bpk-link-color, #0062e3);padding:.375rem 0;color:#0062e3;color:#fff;color:var(--bpk-button-link-on-dark-text-color, #fff)}.bpk-no-touch-support .bpk-button--link-on-dark:hover:not(:active):not(:disabled){text-decoration:underline;color:#0062e3;color:var(--bpk-link-hover-color, #0062e3)}:global(.bpk-no-touch-support) .bpk-button--link-on-dark:hover:not(:active):not(:disabled){text-decoration:underline;color:#0062e3;color:var(--bpk-link-hover-color, #0062e3)}.bpk-button--link-on-dark:visited{color:#0062e3;color:var(--bpk-link-visited-color, #0062e3)}.bpk-button--link-on-dark:active{text-decoration:underline;color:#0062e3;color:var(--bpk-link-active-color, #0062e3)}.bpk-no-touch-support .bpk-button--link-on-dark:hover:not(:active):not(:disabled){background:none;color:#154679;text-decoration:none}:global(.bpk-no-touch-support) .bpk-button--link-on-dark:hover:not(:active):not(:disabled){background:none;color:#154679;text-decoration:none}.bpk-button--link-on-dark:active{background:none;color:#154679;text-decoration:none}.bpk-button--link-on-dark:disabled{background:none;color:rgba(0,0,0,0.2);text-decoration:none}.bpk-button--link-on-dark-large{padding:.75rem 0}.bpk-no-touch-support .bpk-button--link-on-dark:hover:not(:active):not(:disabled){color:rgba(255,255,255,0.5);color:var(--bpk-button-link-on-dark-hover-text-color, rgba(255,255,255,0.5))}:global(.bpk-no-touch-support) .bpk-button--link-on-dark:hover:not(:active):not(:disabled){color:rgba(255,255,255,0.5);color:var(--bpk-button-link-on-dark-hover-text-color, rgba(255,255,255,0.5))}.bpk-button--link-on-dark:active{color:rgba(255,255,255,0.5);color:var(--bpk-button-link-on-dark-active-text-color, rgba(255,255,255,0.5))}.bpk-button--link-on-dark:visited{color:#fff;color:var(--bpk-button-link-on-dark-text-color, #fff)}.bpk-button--link-on-dark:disabled{color:rgba(255,255,255,0.2);color:var(--bpk-button-link-on-dark-disabled-color, rgba(255,255,255,0.2))}.bpk-button--primary-on-dark{color:#161616;color:var(--bpk-button-primary-on-dark-text-color, #161616);background-color:#fff;background-color:var(--bpk-button-primary-on-dark-background-color, #fff)}.bpk-no-touch-support .bpk-button--primary-on-dark:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-button-primary-on-dark-hover-text-color, #161616);background-color:#c2c9cd;background-color:var(--bpk-button-primary-on-dark-hover-background-color, #c2c9cd)}:global(.bpk-no-touch-support) .bpk-button--primary-on-dark:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-button-primary-on-dark-hover-text-color, #161616);background-color:#c2c9cd;background-color:var(--bpk-button-primary-on-dark-hover-background-color, #c2c9cd)}.bpk-button--primary-on-dark:active{color:#161616;color:var(--bpk-button-primary-on-dark-active-text-color, #161616);background-color:#c2c9cd;background-color:var(--bpk-button-primary-on-dark-active-background-color, #c2c9cd)}.bpk-button--primary-on-dark:disabled{background-color:#e0e3e5;color:rgba(0,0,0,0.2)}.bpk-button--primary-on-light{color:#fff;color:var(--bpk-button-primary-on-light-text-color, #fff);background-color:#05203c;background-color:var(--bpk-button-primary-on-light-background-color, #05203c)}.bpk-no-touch-support .bpk-button--primary-on-light:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-primary-on-light-hover-text-color, #fff);background-color:#154679;background-color:var(--bpk-button-primary-on-light-hover-background-color, #154679)}:global(.bpk-no-touch-support) .bpk-button--primary-on-light:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-primary-on-light-hover-text-color, #fff);background-color:#154679;background-color:var(--bpk-button-primary-on-light-hover-background-color, #154679)}.bpk-button--primary-on-light:active{color:#fff;color:var(--bpk-button-primary-on-light-active-text-color, #fff);background-color:#154679;background-color:var(--bpk-button-primary-on-light-active-background-color, #154679)}.bpk-button--primary-on-light:disabled{background-color:#e0e3e5;color:rgba(0,0,0,0.2)}.bpk-button--secondary{color:#161616;color:var(--bpk-button-secondary-text-color, #161616);background-color:#e0e3e5;background-color:var(--bpk-button-secondary-background-color, #e0e3e5)}.bpk-no-touch-support .bpk-button--secondary:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-button-secondary-hover-text-color, #161616);background-color:#c2c9cd;background-color:var(--bpk-button-secondary-hover-background-color, #c2c9cd)}:global(.bpk-no-touch-support) .bpk-button--secondary:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-button-secondary-hover-text-color, #161616);background-color:#c2c9cd;background-color:var(--bpk-button-secondary-hover-background-color, #c2c9cd)}.bpk-button--secondary:active{color:#161616;color:var(--bpk-button-secondary-active-text-color, #161616);background-color:#c2c9cd;background-color:var(--bpk-button-secondary-active-background-color, #c2c9cd)}.bpk-button--secondary:disabled{background-color:#e0e3e5;color:rgba(0,0,0,0.2)}.bpk-button--secondary-on-dark{color:#fff;color:var(--bpk-button-secondary-on-dark-text-color, #fff);background-color:#243346;background-color:var(--bpk-button-secondary-on-dark-background-color, #243346)}.bpk-no-touch-support .bpk-button--secondary-on-dark:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-secondary-on-dark-hover-text-color, #fff);background-color:#010913;background-color:var(--bpk-button-secondary-on-dark-hover-background-color, #010913)}:global(.bpk-no-touch-support) .bpk-button--secondary-on-dark:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-secondary-on-dark-hover-text-color, #fff);background-color:#010913;background-color:var(--bpk-button-secondary-on-dark-hover-background-color, #010913)}.bpk-button--secondary-on-dark:active{color:#fff;color:var(--bpk-button-secondary-on-dark-active-text-color, #fff);background-color:#010913;background-color:var(--bpk-button-secondary-on-dark-active-background-color, #010913)}.bpk-button--secondary-on-dark:disabled{background-color:#0b121d;color:rgba(255,255,255,0.2)}.bpk-button span>svg{display:block}.bpk-button svg{fill:currentcolor}
@@ -0,0 +1,78 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.default = void 0;
7
+ var _bpkReactUtils = require("../../../bpk-react-utils");
8
+ var _commonTypes = require("./common-types");
9
+ var _BpkButtonModule = _interopRequireDefault(require("./BpkButton.module.css"));
10
+ var _jsxRuntime = require("react/jsx-runtime");
11
+ const _excluded = ["children", "type", "size", "className", "href", "disabled", "onClick", "submit", "iconOnly", "blank", "rel"];
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
+ // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
30
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
31
+ 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; }
32
+ 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; }
33
+ 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; }
34
+ function _toPropertyKey(arg) { var key = _toPrimitive(arg, "string"); return typeof key === "symbol" ? key : String(key); }
35
+ 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); }
36
+ 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; }
37
+ 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; }
38
+ const getCommonClassName = (0, _bpkReactUtils.cssModules)(_BpkButtonModule.default);
39
+ const BpkButtonV2 = _ref => {
40
+ let {
41
+ children,
42
+ type = _commonTypes.BUTTON_TYPES.primary,
43
+ size = _commonTypes.SIZE_TYPES.small,
44
+ className = null,
45
+ href = null,
46
+ disabled = false,
47
+ onClick = () => {},
48
+ submit = false,
49
+ iconOnly = false,
50
+ blank = false,
51
+ rel: propRel = undefined
52
+ } = _ref,
53
+ rest = _objectWithoutProperties(_ref, _excluded);
54
+ const classNames = getCommonClassName('bpk-button', size === _commonTypes.SIZE_TYPES.large && 'bpk-button--large', iconOnly && 'bpk-button--icon-only', iconOnly && size === _commonTypes.SIZE_TYPES.large && 'bpk-button--large-icon-only', `bpk-button--${type}`, className);
55
+ const target = blank ? '_blank' : '';
56
+ const rel = blank ? propRel || 'noopener noreferrer' : propRel;
57
+ if (!disabled && href) {
58
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("a", _objectSpread(_objectSpread({
59
+ href: href,
60
+ className: classNames,
61
+ onClick: onClick,
62
+ target: target,
63
+ rel: rel
64
+ }, rest), {}, {
65
+ children: children
66
+ }));
67
+ }
68
+ return /*#__PURE__*/(0, _jsxRuntime.jsx)("button", _objectSpread(_objectSpread({
69
+ type: submit ? 'submit' : 'button',
70
+ disabled: disabled,
71
+ className: classNames,
72
+ onClick: onClick
73
+ }, rest), {}, {
74
+ children: children
75
+ }));
76
+ };
77
+ var _default = BpkButtonV2;
78
+ exports.default = _default;
@@ -0,0 +1,41 @@
1
+ "use strict";
2
+
3
+ Object.defineProperty(exports, "__esModule", {
4
+ value: true
5
+ });
6
+ exports.SIZE_TYPES = exports.BUTTON_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
+
25
+ const BUTTON_TYPES = {
26
+ primary: 'primary',
27
+ primaryOnDark: 'primary-on-dark',
28
+ primaryOnLight: 'primary-on-light',
29
+ secondary: 'secondary',
30
+ secondaryOnDark: 'secondary-on-dark',
31
+ destructive: 'destructive',
32
+ featured: 'featured',
33
+ link: 'link',
34
+ linkOnDark: 'link-on-dark'
35
+ };
36
+ exports.BUTTON_TYPES = BUTTON_TYPES;
37
+ const SIZE_TYPES = {
38
+ small: 'small',
39
+ large: 'large'
40
+ };
41
+ exports.SIZE_TYPES = SIZE_TYPES;
@@ -0,0 +1,51 @@
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 BUTTON_TYPES: {
22
+ readonly primary: 'primary';
23
+ readonly primaryOnDark: 'primary-on-dark';
24
+ readonly primaryOnLight: 'primary-on-light';
25
+ readonly secondary: 'secondary';
26
+ readonly secondaryOnDark: 'secondary-on-dark';
27
+ readonly destructive: 'destructive';
28
+ readonly featured: 'featured';
29
+ readonly link: 'link';
30
+ readonly linkOnDark: 'link-on-dark';
31
+ };
32
+ export declare const SIZE_TYPES: {
33
+ readonly small: 'small';
34
+ readonly large: 'large';
35
+ };
36
+ export type ButtonType = typeof BUTTON_TYPES[keyof typeof BUTTON_TYPES];
37
+ export type SizeType = typeof SIZE_TYPES[keyof typeof SIZE_TYPES];
38
+ export type Props = {
39
+ children: string | ReactNode;
40
+ type?: ButtonType;
41
+ size?: SizeType;
42
+ className?: string | null;
43
+ disabled?: boolean;
44
+ iconOnly?: boolean;
45
+ onClick?: (event: SyntheticEvent) => void;
46
+ rel?: string | undefined;
47
+ submit?: boolean;
48
+ href?: string | null;
49
+ blank?: boolean;
50
+ [rest: string]: any;
51
+ };
@@ -36,6 +36,7 @@ const BpkMap = props => {
36
36
  children,
37
37
  className,
38
38
  greedyGestureHandling,
39
+ mapId,
39
40
  mapOptionStyles,
40
41
  mapRef,
41
42
  onRegionChange,
@@ -80,6 +81,8 @@ const BpkMap = props => {
80
81
  } : undefined,
81
82
  zoom: zoom,
82
83
  options: {
84
+ // If you want to set style by mapId, you should remove the styles property: https://developers.google.com/maps/documentation/get-map-id#javascript
85
+ mapId,
83
86
  gestureHandling,
84
87
  disableDefaultUI: !showControls,
85
88
  mapTypeControl: false,
@@ -132,7 +135,8 @@ BpkMap.propTypes = {
132
135
  elementType: _propTypes.default.string,
133
136
  // eslint-disable-next-line react/forbid-prop-types
134
137
  stylers: _propTypes.default.arrayOf(_propTypes.default.object).isRequired
135
- }))
138
+ })),
139
+ mapId: _propTypes.default.string
136
140
  };
137
141
  BpkMap.defaultProps = {
138
142
  bounds: null,
@@ -147,7 +151,8 @@ BpkMap.defaultProps = {
147
151
  showControls: true,
148
152
  zoom: 15,
149
153
  className: null,
150
- mapOptionStyles: null
154
+ mapOptionStyles: null,
155
+ mapId: null
151
156
  };
152
157
  var _default = BpkMap;
153
158
  exports.default = _default;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyscanner/backpack-web",
3
- "version": "23.1.2",
3
+ "version": "23.2.0",
4
4
  "description": "Backpack Design System web library",
5
5
  "repository": {
6
6
  "type": "git",