@skyscanner/backpack-web 29.2.0 → 29.3.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.
@@ -17,8 +17,9 @@
17
17
  */import BpkMap from "./src/BpkMap";
18
18
  import BpkIconMarker from "./src/BpkIconMarker";
19
19
  import BpkPriceMarker, { PRICE_MARKER_STATUSES } from "./src/BpkPriceMarker";
20
+ import BpkPriceMarkerV2, { MARKER_STATUSES } from "./src/BpkPriceMarkerV2/BpkPriceMarker";
20
21
  import BpkOverlayView from "./src/BpkOverlayView";
21
22
  import withGoogleMapsScript from "./src/withGoogleMapsScript";
22
23
  import { defaultIconMarkerThemeAttributes, priceMarkerThemeAttributes } from "./src/themeAttributes";
23
24
  export default BpkMap;
24
- export { BpkIconMarker, BpkPriceMarker, BpkOverlayView, withGoogleMapsScript, defaultIconMarkerThemeAttributes, priceMarkerThemeAttributes, PRICE_MARKER_STATUSES };
25
+ export { BpkIconMarker, BpkPriceMarker, BpkPriceMarkerV2, BpkOverlayView, withGoogleMapsScript, defaultIconMarkerThemeAttributes, priceMarkerThemeAttributes, PRICE_MARKER_STATUSES, MARKER_STATUSES };
@@ -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
+ import type { Node } from 'react';
19
+ import { type LatLong } from './common-types';
20
+
21
+ export type Props = {
22
+ children: Node;
23
+ position: LatLong;
24
+ };
25
+
26
+ declare const BpkBasicMapMarker: ({ children, position }: Props) => JSX.Element;
27
+
28
+ export default BpkBasicMapMarker;
@@ -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
+ import type { Node } from 'react';
19
+ import { MouseEvent, ReactNode } from 'react';
20
+
21
+ export const MARKER_STATUSES = {
22
+ unselected: 'unselected',
23
+ selected: 'selected',
24
+ previous_selected: 'previous_selected',
25
+ } as const;
26
+
27
+ export type Status = (typeof MARKER_STATUSES)[keyof typeof MARKER_STATUSES];
28
+
29
+ type Props = {
30
+ label: string;
31
+ icon?: ReactNode;
32
+ accessibilityLabel: string;
33
+ position: {
34
+ latitude: number;
35
+ longitude: number;
36
+ };
37
+ className?: string;
38
+ onClick?: (event: MouseEvent) => void;
39
+ buttonProps?: { [key: string]: string };
40
+ status?: Status;
41
+ };
42
+
43
+ declare const BpkPriceMarkerV2: ({
44
+ label,
45
+ position,
46
+ className,
47
+ onClick,
48
+ buttonProps,
49
+ status,
50
+ style,
51
+ }: Props) => JSX.Element;
52
+
53
+ export default BpkPriceMarkerV2;
@@ -0,0 +1,64 @@
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 { cssModules } from "../../../bpk-react-utils";
20
+ import BpkText, { TEXT_STYLES } from "../../../bpk-component-text";
21
+ import BpkBasicMapMarker from "../BpkBasicMapMarker";
22
+ import STYLES from "./BpkPriceMarker.module.css";
23
+ import { jsx as _jsx } from "react/jsx-runtime";
24
+ import { jsxs as _jsxs } from "react/jsx-runtime";
25
+ const getClassName = cssModules(STYLES);
26
+ export const MARKER_STATUSES = {
27
+ unselected: 'unselected',
28
+ selected: 'selected',
29
+ previous_selected: 'previous_selected'
30
+ };
31
+ const BpkPriceMarkerV2 = props => {
32
+ const {
33
+ accessibilityLabel,
34
+ buttonProps,
35
+ className,
36
+ icon,
37
+ label,
38
+ onClick,
39
+ position,
40
+ status = MARKER_STATUSES.unselected,
41
+ ...rest
42
+ } = props;
43
+ const markerWrapperClassNames = getClassName('bpk-price-marker__wrapper');
44
+ const classNames = getClassName('bpk-price-marker', onClick && 'bpk-price-marker--dynamic', `bpk-price-marker-${status}`, icon && `bpk-price-marker-${status}--icon`, className);
45
+ return /*#__PURE__*/_jsx(BpkBasicMapMarker, {
46
+ position: position,
47
+ "aria-label": accessibilityLabel,
48
+ ...rest,
49
+ children: /*#__PURE__*/_jsx("button", {
50
+ type: "button",
51
+ className: markerWrapperClassNames,
52
+ onClick: onClick,
53
+ ...buttonProps,
54
+ children: /*#__PURE__*/_jsxs("div", {
55
+ className: classNames,
56
+ children: [icon, /*#__PURE__*/_jsx(BpkText, {
57
+ textStyle: TEXT_STYLES.label2,
58
+ children: label
59
+ })]
60
+ })
61
+ })
62
+ });
63
+ };
64
+ export default BpkPriceMarkerV2;
@@ -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-price-marker{display:flex;height:1.5rem;padding:0 0.5rem;justify-content:center;align-items:center;border-radius:.5rem;gap:0.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}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyscanner/backpack-web",
3
- "version": "29.2.0",
3
+ "version": "29.3.0",
4
4
  "description": "Backpack Design System web library",
5
5
  "repository": {
6
6
  "type": "git",
@@ -24,8 +24,8 @@
24
24
  "dependencies": {
25
25
  "@popperjs/core": "^2.11.5",
26
26
  "@react-google-maps/api": "^2.12.0",
27
- "@skyscanner/bpk-foundations-web": "^17.1.0",
28
- "@skyscanner/bpk-svgs": "^18.1.1",
27
+ "@skyscanner/bpk-foundations-web": "^17.2.0",
28
+ "@skyscanner/bpk-svgs": "^18.1.2",
29
29
  "a11y-focus-scope": "^1.1.3",
30
30
  "a11y-focus-store": "^1.0.0",
31
31
  "d3-path": "^2.0.0",