@skyscanner/backpack-web 31.9.3 → 31.10.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.
@@ -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 PropTypes from 'prop-types';
18
- import { useEffect, useState, ReactElement } from 'react';
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}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyscanner/backpack-web",
3
- "version": "31.9.3",
3
+ "version": "31.10.0",
4
4
  "description": "Backpack Design System web library",
5
5
  "repository": {
6
6
  "type": "git",