@skyscanner/backpack-web 31.9.3 → 31.10.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.
- package/bpk-component-floating-notification/src/BpkFloatingNotification.d.ts +45 -0
- package/bpk-component-floating-notification/src/BpkFloatingNotification.js +5 -26
- package/bpk-component-rating/src/BpkRating.module.css +1 -1
- package/bpk-component-swap-button/src/BpkSwapButton.js +2 -2
- package/bpk-component-swap-button/src/BpkSwapButton.module.css +1 -1
- package/package.json +1 -1
|
@@ -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, ReactElement, MouseEvent } from 'react';
|
|
20
|
+
|
|
21
|
+
export type Props = {
|
|
22
|
+
animateOnEnter?: boolean;
|
|
23
|
+
animateOnExit?: boolean;
|
|
24
|
+
className?: string;
|
|
25
|
+
ctaText?: string;
|
|
26
|
+
hideAfter?: number;
|
|
27
|
+
icon?: () => ReactElement;
|
|
28
|
+
onClick?: (e: MouseEvent) => void;
|
|
29
|
+
onExit?: () => void;
|
|
30
|
+
text: string;
|
|
31
|
+
[rest: string]: any;
|
|
32
|
+
};
|
|
33
|
+
declare const BpkFloatingNotification: ({
|
|
34
|
+
animateOnEnter,
|
|
35
|
+
animateOnExit,
|
|
36
|
+
className,
|
|
37
|
+
ctaText,
|
|
38
|
+
hideAfter,
|
|
39
|
+
icon,
|
|
40
|
+
onClick,
|
|
41
|
+
onExit,
|
|
42
|
+
text,
|
|
43
|
+
...rest
|
|
44
|
+
}: Props) => JSX.Element;
|
|
45
|
+
export default BpkFloatingNotification;
|
|
@@ -14,8 +14,8 @@
|
|
|
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
|
|
18
|
-
|
|
17
|
+
*/import { useEffect, useState } from 'react';
|
|
18
|
+
// @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
|
|
19
19
|
import { CSSTransition } from 'react-transition-group';
|
|
20
20
|
import BpkAriaLive from "../../bpk-component-aria-live";
|
|
21
21
|
import { BUTTON_TYPES, BpkButtonV2 } from "../../bpk-component-button";
|
|
@@ -28,11 +28,11 @@ const getClassName = cssModules(STYLES);
|
|
|
28
28
|
const BpkFloatingNotification = props => {
|
|
29
29
|
const [showMessage, setShowMessage] = useState(true);
|
|
30
30
|
const {
|
|
31
|
-
animateOnEnter,
|
|
32
|
-
animateOnExit,
|
|
31
|
+
animateOnEnter = true,
|
|
32
|
+
animateOnExit = true,
|
|
33
33
|
className,
|
|
34
34
|
ctaText,
|
|
35
|
-
hideAfter,
|
|
35
|
+
hideAfter = 4000,
|
|
36
36
|
icon: Icon,
|
|
37
37
|
onClick,
|
|
38
38
|
onExit,
|
|
@@ -85,25 +85,4 @@ const BpkFloatingNotification = props => {
|
|
|
85
85
|
})
|
|
86
86
|
});
|
|
87
87
|
};
|
|
88
|
-
BpkFloatingNotification.propTypes = {
|
|
89
|
-
animateOnEnter: PropTypes.bool,
|
|
90
|
-
animateOnExit: PropTypes.bool,
|
|
91
|
-
className: PropTypes.string,
|
|
92
|
-
ctaText: PropTypes.string,
|
|
93
|
-
hideAfter: PropTypes.number,
|
|
94
|
-
icon: PropTypes.ReactElement,
|
|
95
|
-
onClick: PropTypes.func,
|
|
96
|
-
onExit: PropTypes.func,
|
|
97
|
-
text: PropTypes.string.isRequired
|
|
98
|
-
};
|
|
99
|
-
BpkFloatingNotification.defaultProps = {
|
|
100
|
-
animateOnEnter: true,
|
|
101
|
-
animateOnExit: true,
|
|
102
|
-
className: null,
|
|
103
|
-
ctaText: null,
|
|
104
|
-
hideAfter: 4000,
|
|
105
|
-
icon: null,
|
|
106
|
-
onClick: null,
|
|
107
|
-
onExit: null
|
|
108
|
-
};
|
|
109
88
|
export default BpkFloatingNotification;
|
|
@@ -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-rating{display:flex;flex-flow:row nowrap;align-items:baseline}.bpk-rating--large{align-items:center}.bpk-rating__value{display:flex;padding-right:0.5rem;justify-content:center;align-items:baseline;color:#161616}html[dir='rtl'] .bpk-rating__value{padding-right:0;padding-left:0.5rem}.bpk-rating__text-wrapper{display:flex;flex-direction:row;align-items:baseline;white-space:nowrap}.bpk-rating__text-wrapper--large{flex-direction:column;align-items:flex-start}.bpk-rating__scale{color:#545860}.bpk-rating__title--with-subtitle{padding-right:0.5rem}html[dir='rtl'] .bpk-rating__title--with-subtitle{padding-right:0;padding-left:0.5rem}.bpk-rating__title--large{padding-top:.0625rem}.bpk-rating__subtitle{color:#545860}
|
|
18
|
+
@keyframes bpk-keyframe-spin{100%{transform:rotate(1turn)}}.bpk-rating{display:flex;flex-flow:row nowrap;align-items:baseline}.bpk-rating--large{align-items:center}.bpk-rating__value{display:flex;padding-right:0.5rem;justify-content:center;align-items:baseline;color:#161616}html[dir='rtl'] .bpk-rating__value{padding-right:0;padding-left:0.5rem;direction:ltr}.bpk-rating__text-wrapper{display:flex;flex-direction:row;align-items:baseline;white-space:nowrap}.bpk-rating__text-wrapper--large{flex-direction:column;align-items:flex-start}.bpk-rating__scale{color:#545860}.bpk-rating__title--with-subtitle{padding-right:0.5rem}html[dir='rtl'] .bpk-rating__title--with-subtitle{padding-right:0;padding-left:0.5rem}.bpk-rating__title--large{padding-top:.0625rem}.bpk-rating__subtitle{color:#545860}
|
|
@@ -55,8 +55,8 @@ const BpkSwapButton = props => {
|
|
|
55
55
|
onClick();
|
|
56
56
|
handleRotation();
|
|
57
57
|
},
|
|
58
|
-
children: /*#__PURE__*/_jsx(
|
|
59
|
-
|
|
58
|
+
children: /*#__PURE__*/_jsx("span", {
|
|
59
|
+
children: /*#__PURE__*/_jsx(SwapVertical, {})
|
|
60
60
|
})
|
|
61
61
|
})
|
|
62
62
|
});
|
|
@@ -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-swap-button{
|
|
18
|
+
@keyframes bpk-keyframe-spin{100%{transform:rotate(1turn)}}.bpk-swap-button{transform:translateY(-50%) rotate(90deg)}@media (max-width: 48rem){.bpk-swap-button{transform:rotate(0deg)}}.bpk-swap-button :focus-visible{box-shadow:0 0 0 0.125rem #fff,0 0 0 0.25rem #0062e3}.bpk-swap-button__button{display:flex;width:2.5rem;height:2.5rem;justify-content:center;align-items:center;transition:transform 400ms;border:3px solid #05203c;border-radius:50%;background-color:#fff}@media (max-width: 48rem){.bpk-swap-button__button{border:2px solid #05203c}}.bpk-no-touch-support .bpk-swap-button__button:hover:not(:active):not(:disabled){background-color:#e0e3e5}:global(.bpk-no-touch-support) .bpk-swap-button__button:hover:not(:active):not(:disabled){background-color:#e0e3e5}.bpk-swap-button__button span{display:inline-flex;line-height:1rem}.bpk-swap-button__button--canvas-default{border:3px solid #fff;background-color:#eff1f2}.bpk-swap-button__button--canvas-contrast{border:3px solid #eff1f2}
|