@skyscanner/backpack-web 37.11.0 → 38.0.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.
@@ -17,10 +17,9 @@
17
17
  */import BpkIconMarker from "./src/BpkIconMarker";
18
18
  import BpkMap from "./src/BpkMap";
19
19
  import BpkOverlayView from "./src/BpkOverlayView";
20
- import BpkPriceMarker, { PRICE_MARKER_STATUSES } from "./src/BpkPriceMarker";
21
- import { BpkPriceMarkerV2 } from "./src/BpkPriceMarkerV2/BpkPriceMarker";
22
- import BpkPriceMarkerButton, { MARKER_STATUSES } from "./src/BpkPriceMarkerV2/BpkPriceMarkerButton";
20
+ import BpkPriceMarker from "./src/BpkPriceMarker";
21
+ import BpkPriceMarkerButton, { MARKER_STATUSES } from "./src/BpkPriceMarkerButton";
23
22
  import { defaultIconMarkerThemeAttributes, priceMarkerThemeAttributes } from "./src/themeAttributes";
24
23
  import withGoogleMapsScript from "./src/withGoogleMapsScript";
25
24
  export default BpkMap;
26
- export { BpkIconMarker, BpkPriceMarker, BpkPriceMarkerV2, BpkOverlayView, withGoogleMapsScript, defaultIconMarkerThemeAttributes, priceMarkerThemeAttributes, PRICE_MARKER_STATUSES, MARKER_STATUSES, BpkPriceMarkerButton };
25
+ export { BpkIconMarker, BpkPriceMarker, BpkOverlayView, withGoogleMapsScript, defaultIconMarkerThemeAttributes, priceMarkerThemeAttributes, MARKER_STATUSES, BpkPriceMarkerButton };
@@ -6,5 +6,5 @@ type Props = {
6
6
  longitude: number;
7
7
  };
8
8
  } & BpkPriceMarkerButtonProps;
9
- export declare const BpkPriceMarkerV2: (props: Props) => import("react/jsx-runtime").JSX.Element;
10
- export {};
9
+ declare const BpkPriceMarker: (props: Props) => import("react/jsx-runtime").JSX.Element;
10
+ export default BpkPriceMarker;
@@ -14,75 +14,38 @@
14
14
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
- */import PropTypes from 'prop-types';
18
- import BpkText, { TEXT_STYLES } from "../../bpk-component-text/src/BpkText";
19
- import { cssModules } from "../../bpk-react-utils";
17
+ */
18
+
20
19
  import BpkBasicMapMarker from "./BpkBasicMapMarker";
21
- import { LatLongPropType } from "./common-types";
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 PRICE_MARKER_STATUSES = {
26
- default: 'default',
27
- focused: 'focused',
28
- viewed: 'viewed'
29
- };
20
+ import BpkPriceMarkerButton, { MARKER_STATUSES } from "./BpkPriceMarkerButton";
21
+ import { jsx as _jsx } from "react/jsx-runtime";
30
22
  const BpkPriceMarker = props => {
31
23
  const {
32
- arrowClassName,
24
+ accessibilityLabel,
33
25
  buttonProps,
34
26
  className,
35
- disabled,
27
+ icon,
36
28
  label,
37
29
  onClick,
38
30
  position,
39
- status,
31
+ status = MARKER_STATUSES.unselected,
40
32
  ...rest
41
33
  } = props;
42
- const markerWrapperClassNames = getClassName('bpk-price-marker__wrapper');
43
- const classNames = getClassName('bpk-price-marker', `bpk-price-marker-${status}`, onClick && 'bpk-price-marker--dynamic', className, disabled && `bpk-price-marker-disabled`);
44
- const arrowClassNames = getClassName('bpk-price-marker__arrow', `bpk-price-marker__arrow-${status}`, arrowClassName, disabled && `bpk-price-marker__arrow-disabled`);
45
- return (
46
- /*#__PURE__*/
47
- // $FlowFixMe[cannot-spread-inexact] - inexact rest. See 'decisions/flowfixme.md'.
48
- _jsx(BpkBasicMapMarker, {
49
- position: position,
50
- ...rest,
51
- children: /*#__PURE__*/_jsxs("button", {
52
- type: "button",
53
- className: markerWrapperClassNames,
54
- onClick: onClick,
55
- disabled: disabled,
56
- ...buttonProps,
57
- children: [/*#__PURE__*/_jsx("span", {
58
- className: classNames,
59
- children: /*#__PURE__*/_jsx(BpkText, {
60
- textStyle: status === PRICE_MARKER_STATUSES.focused ? TEXT_STYLES.label1 : TEXT_STYLES.label2,
61
- children: label
62
- })
63
- }), /*#__PURE__*/_jsx("div", {
64
- className: arrowClassNames
65
- })]
66
- })
34
+ const allButtonProps = {
35
+ className,
36
+ icon,
37
+ label,
38
+ onClick,
39
+ status,
40
+ buttonProps
41
+ };
42
+ return /*#__PURE__*/_jsx(BpkBasicMapMarker, {
43
+ position: position,
44
+ "aria-label": accessibilityLabel,
45
+ ...rest,
46
+ children: /*#__PURE__*/_jsx(BpkPriceMarkerButton, {
47
+ ...allButtonProps
67
48
  })
68
- );
69
- };
70
- BpkPriceMarker.propTypes = {
71
- label: PropTypes.string.isRequired,
72
- position: LatLongPropType.isRequired,
73
- arrowClassName: PropTypes.string,
74
- className: PropTypes.string,
75
- onClick: PropTypes.func,
76
- disabled: PropTypes.bool,
77
- status: PropTypes.oneOf(Object.keys(PRICE_MARKER_STATUSES)),
78
- buttonProps: PropTypes.object // eslint-disable-line react/forbid-prop-types
79
- };
80
- BpkPriceMarker.defaultProps = {
81
- className: null,
82
- arrowClassName: null,
83
- onClick: null,
84
- disabled: false,
85
- status: PRICE_MARKER_STATUSES.default,
86
- buttonProps: null
49
+ });
87
50
  };
88
51
  export default BpkPriceMarker;
@@ -16,8 +16,8 @@
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";
19
+ import BpkText, { TEXT_STYLES } from "../../bpk-component-text";
20
+ import { cssModules } from "../../bpk-react-utils";
21
21
  import STYLES from "./BpkPriceMarkerButton.module.css";
22
22
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
23
23
  const getClassName = cssModules(STYLES);
@@ -4,9 +4,9 @@ type ValueOf<T> = T[keyof T];
4
4
  type Props = {
5
5
  ariaLabel: string;
6
6
  className?: string;
7
- ratingScale: ValueOf<typeof RATING_SCALES>;
7
+ ratingScale?: ValueOf<typeof RATING_SCALES>;
8
8
  showScale?: boolean;
9
- size: ValueOf<typeof RATING_SIZES>;
9
+ size?: ValueOf<typeof RATING_SIZES>;
10
10
  subtitle?: string;
11
11
  title?: string | ReactNode;
12
12
  value: string | number;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyscanner/backpack-web",
3
- "version": "37.11.0",
3
+ "version": "38.0.1",
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;padding:.125rem .5rem;justify-content:center;align-items:center;border:3px solid;border-radius:.5rem}.bpk-price-marker--dynamic{cursor:pointer}.bpk-price-marker-default{color:#fff;border-color:#0062e3;border-color:var(--bpk-price-marker-background-color, rgb(0, 98, 227));background-color:#0062e3;background-color:var(--bpk-price-marker-background-color, rgb(0, 98, 227))}.bpk-price-marker-viewed{color:hsla(0,0%,100%,.8);color:var(--bpk-price-marker-viewed-color, rgba(255, 255, 255, 0.8));border-color:#0062e3;border-color:var(--bpk-price-marker-viewed-border-color, rgb(0, 98, 227));background-color:#0062e3;background-color:var(--bpk-price-marker-viewed-background-color, rgb(0, 98, 227))}.bpk-price-marker-focused{padding:.375rem .5rem;background-color:#fff;border-color:#0062e3;border-color:var(--bpk-price-marker-selected-border-color, rgb(0, 98, 227));color:#0062e3;color:var(--bpk-price-marker-selected-color, rgb(0, 98, 227))}.bpk-price-marker-disabled{z-index:-2;border-color:#fff;background-color:#fff;color:rgba(0,0,0,.2)}.bpk-price-marker__wrapper{position:relative;display:flex;padding:0;flex-direction:column;align-items:center;transform:translate(calc(-50% - 3px), calc(-100% - 3px - 1rem / 2));border:none;background:none}.bpk-price-marker__arrow{position:absolute;top:50%;z-index:-1;width:1rem;height:1rem;transform:rotate(45deg);border-radius:25%;background-color:#0062e3}.bpk-price-marker__arrow-default{background-color:#0062e3;background-color:var(--bpk-price-marker-background-color, rgb(0, 98, 227))}.bpk-price-marker__arrow-viewed{background-color:#0062e3;background-color:var(--bpk-price-marker-viewed-border-color, rgb(0, 98, 227))}.bpk-price-marker__arrow-focused{top:75%;background-color:#0062e3;background-color:var(--bpk-price-marker-selected-border-color, rgb(0, 98, 227))}.bpk-price-marker__arrow-disabled{top:75%;z-index:-3;background-color:#fff}
@@ -1,51 +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
-
19
- import BpkBasicMapMarker from "../BpkBasicMapMarker";
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
23
- export const BpkPriceMarkerV2 = props => {
24
- const {
25
- accessibilityLabel,
26
- buttonProps,
27
- className,
28
- icon,
29
- label,
30
- onClick,
31
- position,
32
- status = MARKER_STATUSES.unselected,
33
- ...rest
34
- } = props;
35
- const allButtonProps = {
36
- className,
37
- icon,
38
- label,
39
- onClick,
40
- status,
41
- buttonProps
42
- };
43
- return /*#__PURE__*/_jsx(BpkBasicMapMarker, {
44
- position: position,
45
- "aria-label": accessibilityLabel,
46
- ...rest,
47
- children: /*#__PURE__*/_jsx(BpkPriceMarkerButton, {
48
- ...allButtonProps
49
- })
50
- });
51
- };