@skyscanner/backpack-web 37.5.0 → 37.7.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.
@@ -15,4 +15,4 @@
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
17
  */
18
- .bpk-horizontal-nav__item{display:inline-block;display:flex}.bpk-horizontal-nav__item--space-around{margin-right:auto;margin-left:auto}.bpk-horizontal-nav__link{display:inline-block;display:flex;padding:.875rem 1.5rem;border:0;border-radius:0;background:none;text-decoration:none;cursor:pointer;fill:currentcolor}.bpk-horizontal-nav__link--default{color:#626971;color:var(--bpk-horizontal-nav-link-color, rgb(98, 105, 113))}.bpk-no-touch-support .bpk-horizontal-nav__link--default:hover:not(:active):not(:disabled){box-shadow:0 -3px 0 0 #e0e4e9 inset;color:#626971;color:var(--bpk-horizontal-nav-link-hover-color, rgb(98, 105, 113))}:global(.bpk-no-touch-support) .bpk-horizontal-nav__link--default:hover:not(:active):not(:disabled){box-shadow:0 -3px 0 0 #e0e4e9 inset;color:#626971;color:var(--bpk-horizontal-nav-link-hover-color, rgb(98, 105, 113))}.bpk-horizontal-nav__link--default:active{box-shadow:0 -3px 0 0 #c1c7cf inset;color:#626971;color:var(--bpk-horizontal-nav-link-active-color, rgb(98, 105, 113))}.bpk-horizontal-nav__link--default-disabled{color:rgba(0,0,0,.2);cursor:not-allowed}.bpk-horizontal-nav__link--default-disabled:active{color:rgba(0,0,0,.2);box-shadow:unset}.bpk-horizontal-nav__link--default-selected{box-shadow:0 -3px 0 0 #0062e3 inset;box-shadow:0 -3px 0 0 var(--bpk-horizontal-nav-bar-selected-color, rgb(0, 98, 227)) inset;color:#0062e3;color:var(--bpk-horizontal-nav-link-selected-color, rgb(0, 98, 227))}.bpk-no-touch-support .bpk-horizontal-nav__link--default-selected:hover:not(:active):not(:disabled){box-shadow:0 -3px 0 0 #0062e3 inset;box-shadow:0 -3px 0 0 var(--bpk-horizontal-nav-bar-selected-color, rgb(0, 98, 227)) inset}:global(.bpk-no-touch-support) .bpk-horizontal-nav__link--default-selected:hover:not(:active):not(:disabled){box-shadow:0 -3px 0 0 #0062e3 inset;box-shadow:0 -3px 0 0 var(--bpk-horizontal-nav-bar-selected-color, rgb(0, 98, 227)) inset}.bpk-horizontal-nav__link--default-selected:active{box-shadow:0 -3px 0 0 #0062e3 inset;box-shadow:0 -3px 0 0 var(--bpk-horizontal-nav-bar-selected-color, rgb(0, 98, 227)) inset}.bpk-horizontal-nav__link--light{color:#fff}.bpk-no-touch-support .bpk-horizontal-nav__link--light:hover:not(:active):not(:disabled){box-shadow:0 -3px 0 0 #fff inset}:global(.bpk-no-touch-support) .bpk-horizontal-nav__link--light:hover:not(:active):not(:disabled){box-shadow:0 -3px 0 0 #fff inset}.bpk-horizontal-nav__link--light:active{box-shadow:0 -3px 0 0 #fff inset}.bpk-horizontal-nav__link--light-disabled{color:rgba(0,0,0,.2);cursor:not-allowed}.bpk-horizontal-nav__link--light-disabled:active{color:rgba(0,0,0,.2);box-shadow:unset}.bpk-horizontal-nav__link--light-selected{color:#fff;box-shadow:0 -3px 0 0 #fff inset}.bpk-no-touch-support .bpk-horizontal-nav__link--light-selected:hover:not(:active):not(:disabled){box-shadow:0 -3px 0 0 #fff inset}:global(.bpk-no-touch-support) .bpk-horizontal-nav__link--light-selected:hover:not(:active):not(:disabled){box-shadow:0 -3px 0 0 #fff inset}.bpk-horizontal-nav__link--light-selected:active{box-shadow:0 -3px 0 0 #fff inset}
18
+ .bpk-horizontal-nav__item{display:inline-block;display:flex}.bpk-horizontal-nav__item--space-around{margin-right:auto;margin-left:auto}.bpk-horizontal-nav__link{display:inline-block;display:flex;padding:.875rem 1.5rem;border:0;border-radius:0;background:none;text-decoration:none;cursor:pointer;fill:currentcolor}.bpk-horizontal-nav__link:focus-visible{outline-offset:-0.125rem}.bpk-horizontal-nav__link--default{color:#626971;color:var(--bpk-horizontal-nav-link-color, rgb(98, 105, 113))}.bpk-no-touch-support .bpk-horizontal-nav__link--default:hover:not(:active):not(:disabled){box-shadow:0 -3px 0 0 #e0e4e9 inset;color:#626971;color:var(--bpk-horizontal-nav-link-hover-color, rgb(98, 105, 113))}:global(.bpk-no-touch-support) .bpk-horizontal-nav__link--default:hover:not(:active):not(:disabled){box-shadow:0 -3px 0 0 #e0e4e9 inset;color:#626971;color:var(--bpk-horizontal-nav-link-hover-color, rgb(98, 105, 113))}.bpk-horizontal-nav__link--default:active{box-shadow:0 -3px 0 0 #c1c7cf inset;color:#626971;color:var(--bpk-horizontal-nav-link-active-color, rgb(98, 105, 113))}.bpk-horizontal-nav__link--default-disabled{color:rgba(0,0,0,.2);cursor:not-allowed}.bpk-horizontal-nav__link--default-disabled:active{color:rgba(0,0,0,.2);box-shadow:unset}.bpk-horizontal-nav__link--default-selected{box-shadow:0 -3px 0 0 #0062e3 inset;box-shadow:0 -3px 0 0 var(--bpk-horizontal-nav-bar-selected-color, rgb(0, 98, 227)) inset;color:#0062e3;color:var(--bpk-horizontal-nav-link-selected-color, rgb(0, 98, 227))}.bpk-no-touch-support .bpk-horizontal-nav__link--default-selected:hover:not(:active):not(:disabled){box-shadow:0 -3px 0 0 #0062e3 inset;box-shadow:0 -3px 0 0 var(--bpk-horizontal-nav-bar-selected-color, rgb(0, 98, 227)) inset}:global(.bpk-no-touch-support) .bpk-horizontal-nav__link--default-selected:hover:not(:active):not(:disabled){box-shadow:0 -3px 0 0 #0062e3 inset;box-shadow:0 -3px 0 0 var(--bpk-horizontal-nav-bar-selected-color, rgb(0, 98, 227)) inset}.bpk-horizontal-nav__link--default-selected:active{box-shadow:0 -3px 0 0 #0062e3 inset;box-shadow:0 -3px 0 0 var(--bpk-horizontal-nav-bar-selected-color, rgb(0, 98, 227)) inset}.bpk-horizontal-nav__link--light{color:#fff}.bpk-no-touch-support .bpk-horizontal-nav__link--light:hover:not(:active):not(:disabled){box-shadow:0 -3px 0 0 #fff inset}:global(.bpk-no-touch-support) .bpk-horizontal-nav__link--light:hover:not(:active):not(:disabled){box-shadow:0 -3px 0 0 #fff inset}.bpk-horizontal-nav__link--light:active{box-shadow:0 -3px 0 0 #fff inset}.bpk-horizontal-nav__link--light-disabled{color:rgba(0,0,0,.2);cursor:not-allowed}.bpk-horizontal-nav__link--light-disabled:active{color:rgba(0,0,0,.2);box-shadow:unset}.bpk-horizontal-nav__link--light-selected{color:#fff;box-shadow:0 -3px 0 0 #fff inset}.bpk-no-touch-support .bpk-horizontal-nav__link--light-selected:hover:not(:active):not(:disabled){box-shadow:0 -3px 0 0 #fff inset}:global(.bpk-no-touch-support) .bpk-horizontal-nav__link--light-selected:hover:not(:active):not(:disabled){box-shadow:0 -3px 0 0 #fff inset}.bpk-horizontal-nav__link--light-selected:active{box-shadow:0 -3px 0 0 #fff inset}
@@ -18,8 +18,9 @@
18
18
  import BpkMap from "./src/BpkMap";
19
19
  import BpkOverlayView from "./src/BpkOverlayView";
20
20
  import BpkPriceMarker, { PRICE_MARKER_STATUSES } from "./src/BpkPriceMarker";
21
- import { BpkPriceMarkerV2, MARKER_STATUSES } from "./src/BpkPriceMarkerV2/BpkPriceMarker";
21
+ import { BpkPriceMarkerV2 } from "./src/BpkPriceMarkerV2/BpkPriceMarker";
22
+ import BpkPriceMarkerButton, { MARKER_STATUSES } from "./src/BpkPriceMarkerV2/BpkPriceMarkerButton";
22
23
  import { defaultIconMarkerThemeAttributes, priceMarkerThemeAttributes } from "./src/themeAttributes";
23
24
  import withGoogleMapsScript from "./src/withGoogleMapsScript";
24
25
  export default BpkMap;
25
- export { BpkIconMarker, BpkPriceMarker, BpkPriceMarkerV2, BpkOverlayView, withGoogleMapsScript, defaultIconMarkerThemeAttributes, priceMarkerThemeAttributes, PRICE_MARKER_STATUSES, MARKER_STATUSES };
26
+ export { BpkIconMarker, BpkPriceMarker, BpkPriceMarkerV2, BpkOverlayView, withGoogleMapsScript, defaultIconMarkerThemeAttributes, priceMarkerThemeAttributes, PRICE_MARKER_STATUSES, MARKER_STATUSES, BpkPriceMarkerButton };
@@ -1,24 +1,10 @@
1
- import type { MouseEvent, ReactNode } from 'react';
2
- export declare const MARKER_STATUSES: {
3
- readonly unselected: "unselected";
4
- readonly selected: "selected";
5
- readonly previous_selected: "previous_selected";
6
- };
7
- export type Status = (typeof MARKER_STATUSES)[keyof typeof MARKER_STATUSES];
1
+ import type { Props as BpkPriceMarkerButtonProps } from './BpkPriceMarkerButton';
8
2
  type Props = {
9
- label: string;
10
- icon?: ReactNode;
11
3
  accessibilityLabel: string;
12
4
  position: {
13
5
  latitude: number;
14
6
  longitude: number;
15
7
  };
16
- className?: string;
17
- onClick?: (event: MouseEvent) => void;
18
- buttonProps?: {
19
- [key: string]: string;
20
- };
21
- status?: Status;
22
- };
8
+ } & BpkPriceMarkerButtonProps;
23
9
  export declare const BpkPriceMarkerV2: (props: Props) => import("react/jsx-runtime").JSX.Element;
24
10
  export {};
@@ -16,17 +16,10 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- import BpkText, { TEXT_STYLES } from "../../../bpk-component-text";
20
- import { cssModules } from "../../../bpk-react-utils";
21
19
  import BpkBasicMapMarker from "../BpkBasicMapMarker";
22
- import STYLES from "./BpkPriceMarker.module.css";
23
- import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
- const getClassName = cssModules(STYLES);
25
- export const MARKER_STATUSES = {
26
- unselected: 'unselected',
27
- selected: 'selected',
28
- previous_selected: 'previous_selected'
29
- };
20
+ import BpkPriceMarkerButton, { MARKER_STATUSES } from "./BpkPriceMarkerButton";
21
+ import { jsx as _jsx } from "react/jsx-runtime";
22
+ // eslint-disable-next-line import/prefer-default-export
30
23
  export const BpkPriceMarkerV2 = props => {
31
24
  const {
32
25
  accessibilityLabel,
@@ -39,24 +32,20 @@ export const BpkPriceMarkerV2 = props => {
39
32
  status = MARKER_STATUSES.unselected,
40
33
  ...rest
41
34
  } = props;
42
- const markerWrapperClassNames = getClassName('bpk-price-marker__wrapper');
43
- const classNames = getClassName('bpk-price-marker', onClick && 'bpk-price-marker--dynamic', `bpk-price-marker-${status}`, icon && `bpk-price-marker-${status}--icon`, className);
35
+ const allButtonProps = {
36
+ className,
37
+ icon,
38
+ label,
39
+ onClick,
40
+ status,
41
+ buttonProps
42
+ };
44
43
  return /*#__PURE__*/_jsx(BpkBasicMapMarker, {
45
44
  position: position,
46
45
  "aria-label": accessibilityLabel,
47
46
  ...rest,
48
- children: /*#__PURE__*/_jsx("button", {
49
- type: "button",
50
- className: markerWrapperClassNames,
51
- onClick: onClick,
52
- ...buttonProps,
53
- children: /*#__PURE__*/_jsxs("div", {
54
- className: classNames,
55
- children: [icon, /*#__PURE__*/_jsx(BpkText, {
56
- textStyle: TEXT_STYLES.label3,
57
- children: label
58
- })]
59
- })
47
+ children: /*#__PURE__*/_jsx(BpkPriceMarkerButton, {
48
+ ...allButtonProps
60
49
  })
61
50
  });
62
51
  };
@@ -0,0 +1,19 @@
1
+ import type { ReactNode } from 'react';
2
+ export declare const MARKER_STATUSES: {
3
+ readonly unselected: "unselected";
4
+ readonly selected: "selected";
5
+ readonly previous_selected: "previous_selected";
6
+ };
7
+ export type Status = (typeof MARKER_STATUSES)[keyof typeof MARKER_STATUSES];
8
+ export type Props = {
9
+ label: string;
10
+ icon?: ReactNode;
11
+ className?: string | null;
12
+ onClick?: () => void;
13
+ buttonProps?: {
14
+ [key: string]: string;
15
+ };
16
+ status?: Status;
17
+ };
18
+ declare const BpkPriceMarkerButton: ({ buttonProps, className, icon, label, onClick, status, }: Props) => import("react/jsx-runtime").JSX.Element;
19
+ export default BpkPriceMarkerButton;
@@ -0,0 +1,53 @@
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 BpkText, { TEXT_STYLES } from "../../../bpk-component-text";
20
+ import { cssModules } from "../../../bpk-react-utils";
21
+ import STYLES from "./BpkPriceMarkerButton.module.css";
22
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
23
+ const getClassName = cssModules(STYLES);
24
+ export const MARKER_STATUSES = {
25
+ unselected: 'unselected',
26
+ selected: 'selected',
27
+ previous_selected: 'previous_selected'
28
+ };
29
+ const BpkPriceMarkerButton = ({
30
+ buttonProps = {},
31
+ className = null,
32
+ icon,
33
+ label,
34
+ onClick,
35
+ status = MARKER_STATUSES.unselected
36
+ }) => {
37
+ const markerWrapperClassNames = getClassName('bpk-price-marker-button__wrapper');
38
+ const markerClassNames = getClassName('bpk-price-marker-button', onClick && 'bpk-price-marker-button--dynamic', `bpk-price-marker-button-${status}`, icon && `bpk-price-marker-button-${status}--icon`, className);
39
+ return /*#__PURE__*/_jsx("button", {
40
+ type: "button",
41
+ className: markerWrapperClassNames,
42
+ onClick: onClick,
43
+ ...buttonProps,
44
+ children: /*#__PURE__*/_jsxs("div", {
45
+ className: markerClassNames,
46
+ children: [icon, /*#__PURE__*/_jsx(BpkText, {
47
+ textStyle: TEXT_STYLES.label3,
48
+ children: label
49
+ })]
50
+ })
51
+ });
52
+ };
53
+ export default BpkPriceMarkerButton;
@@ -0,0 +1,18 @@
1
+ /*
2
+ * Backpack - Skyscanner's Design System
3
+ *
4
+ * Copyright 2016 Skyscanner Ltd
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+ .bpk-price-marker-button{display:flex;height:1.5rem;padding:0 .5rem;justify-content:center;align-items:center;border-radius:.5rem;box-shadow:0px 1px 3px 0px rgba(37,32,31,.3);gap:.5rem}.bpk-price-marker-button--dynamic{cursor:pointer}.bpk-price-marker-button-unselected{background-color:#fff;color:#161616}.bpk-price-marker-button-unselected--icon{fill:#161616}.bpk-price-marker-button-previous_selected{background-color:#cfe4ff;color:#161616}.bpk-price-marker-button-previous_selected--icon{fill:#161616}.bpk-price-marker-button-selected{background-color:#05203c;color:#fff}.bpk-price-marker-button-selected--icon{fill:#fff}.bpk-price-marker-button__wrapper{position:relative;display:flex;padding:0;flex-direction:column;align-items:center;border:none;background:none}
@@ -44,7 +44,8 @@ const propTypes = {
44
44
  className: PropTypes.string,
45
45
  onComplete: PropTypes.func,
46
46
  onCompleteTransitionEnd: PropTypes.func,
47
- getValueText: PropTypes.func
47
+ getValueText: PropTypes.func,
48
+ tabIndex: PropTypes.number
48
49
  };
49
50
  const defaultProps = {
50
51
  className: null,
@@ -35,7 +35,7 @@ const BpkScrollableCalendarGrid = ({
35
35
  children: [/*#__PURE__*/_jsx("span", {
36
36
  className: getClassName('bpk-scrollable-calendar-grid__title'),
37
37
  children: /*#__PURE__*/_jsx(BpkText, {
38
- tagName: "h1",
38
+ tagName: "h2",
39
39
  textStyle: TEXT_STYLES.heading4,
40
40
  children: formatMonth(month)
41
41
  })
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyscanner/backpack-web",
3
- "version": "37.5.0",
3
+ "version": "37.7.0",
4
4
  "description": "Backpack Design System web library",
5
5
  "repository": {
6
6
  "type": "git",
@@ -1,18 +0,0 @@
1
- /*
2
- * Backpack - Skyscanner's Design System
3
- *
4
- * Copyright 2016 Skyscanner Ltd
5
- *
6
- * Licensed under the Apache License, Version 2.0 (the "License");
7
- * you may not use this file except in compliance with the License.
8
- * You may obtain a copy of the License at
9
- *
10
- * http://www.apache.org/licenses/LICENSE-2.0
11
- *
12
- * Unless required by applicable law or agreed to in writing, software
13
- * distributed under the License is distributed on an "AS IS" BASIS,
14
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
- * See the License for the specific language governing permissions and
16
- * limitations under the License.
17
- */
18
- .bpk-price-marker{display:flex;height:1.5rem;padding:0 .5rem;justify-content:center;align-items:center;border-radius:.5rem;box-shadow:0px 1px 3px 0px rgba(37,32,31,.3);gap:.5rem}.bpk-price-marker--dynamic{cursor:pointer}.bpk-price-marker-unselected{background-color:#fff;color:#161616}.bpk-price-marker-unselected--icon{fill:#161616}.bpk-price-marker-previous_selected{background-color:#cfe4ff;color:#161616}.bpk-price-marker-previous_selected--icon{fill:#161616}.bpk-price-marker-selected{background-color:#05203c;color:#fff}.bpk-price-marker-selected--icon{fill:#fff}.bpk-price-marker__wrapper{position:relative;display:flex;padding:0;flex-direction:column;align-items:center;border:none;background:none}