@skyscanner/backpack-web 6.0.0 → 6.1.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.
- package/bpk-component-barchart/data.json +0 -82
- package/bpk-component-barchart/package.json +1 -1
- package/bpk-component-floating-notification/package.json +2 -1
- package/bpk-component-floating-notification/src/BpkFloatingNotification.js +3 -1
- package/bpk-component-horizontal-nav/package.json +1 -1
- package/bpk-component-horizontal-nav/src/BpkHorizontalNav.js +6 -11
- package/package.json +1 -1
|
@@ -15,88 +15,6 @@
|
|
|
15
15
|
{
|
|
16
16
|
"month": "Apr",
|
|
17
17
|
"price": 448
|
|
18
|
-
},
|
|
19
|
-
{
|
|
20
|
-
"month": "May",
|
|
21
|
-
"price": 344
|
|
22
|
-
},
|
|
23
|
-
{
|
|
24
|
-
"month": "Jun",
|
|
25
|
-
"price": 322
|
|
26
|
-
},
|
|
27
|
-
{
|
|
28
|
-
"month": "Jul",
|
|
29
|
-
"price": 340
|
|
30
|
-
},
|
|
31
|
-
{
|
|
32
|
-
"month": "Aug",
|
|
33
|
-
"price": 327
|
|
34
|
-
},
|
|
35
|
-
{
|
|
36
|
-
"month": "Sep",
|
|
37
|
-
"price": 444
|
|
38
|
-
},
|
|
39
|
-
{
|
|
40
|
-
"month": "Oct",
|
|
41
|
-
"price": 422
|
|
42
|
-
},
|
|
43
|
-
{
|
|
44
|
-
"month": "Nov",
|
|
45
|
-
"price": 344
|
|
46
|
-
},
|
|
47
|
-
{
|
|
48
|
-
"month": "Dec",
|
|
49
|
-
"price": 301
|
|
50
|
-
}
|
|
51
|
-
],
|
|
52
|
-
"prices2": [
|
|
53
|
-
{
|
|
54
|
-
"month": "Jan",
|
|
55
|
-
"price": 305
|
|
56
|
-
},
|
|
57
|
-
{
|
|
58
|
-
"month": "Feb",
|
|
59
|
-
"price": 348
|
|
60
|
-
},
|
|
61
|
-
{
|
|
62
|
-
"month": "Mar",
|
|
63
|
-
"price": 418
|
|
64
|
-
},
|
|
65
|
-
{
|
|
66
|
-
"month": "Apr",
|
|
67
|
-
"price": 448
|
|
68
|
-
},
|
|
69
|
-
{
|
|
70
|
-
"month": "May",
|
|
71
|
-
"price": 344
|
|
72
|
-
},
|
|
73
|
-
{
|
|
74
|
-
"month": "Jun",
|
|
75
|
-
"price": 322
|
|
76
|
-
},
|
|
77
|
-
{
|
|
78
|
-
"month": "Jul",
|
|
79
|
-
"price": 840
|
|
80
|
-
},
|
|
81
|
-
{
|
|
82
|
-
"month": "Aug",
|
|
83
|
-
"price": 927
|
|
84
|
-
},
|
|
85
|
-
{
|
|
86
|
-
"month": "Sep",
|
|
87
|
-
"price": 444
|
|
88
|
-
},
|
|
89
|
-
{
|
|
90
|
-
"month": "Oct",
|
|
91
|
-
"price": 422
|
|
92
|
-
},
|
|
93
|
-
{
|
|
94
|
-
"month": "Nov",
|
|
95
|
-
"price": 344
|
|
96
|
-
},
|
|
97
|
-
{
|
|
98
|
-
"month": "Dec",
|
|
99
|
-
"price": 601
|
|
100
18
|
}
|
|
101
19
|
]
|
|
102
20
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bpk-component-floating-notification",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.2.0",
|
|
4
4
|
"description": "Backpack floating-notification component.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -13,6 +13,7 @@
|
|
|
13
13
|
"registry": "https://registry.npmjs.org/"
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
+
"bpk-component-aria-live": "^2.1.19",
|
|
16
17
|
"bpk-component-button": "^6.2.7",
|
|
17
18
|
"bpk-component-text": "^7.0.6",
|
|
18
19
|
"bpk-mixins": "^31.1.1",
|
|
@@ -21,6 +21,7 @@ import PropTypes from 'prop-types';
|
|
|
21
21
|
import React, { useEffect, useState, ReactElement } from 'react';
|
|
22
22
|
import { CSSTransition } from 'react-transition-group';
|
|
23
23
|
|
|
24
|
+
import BpkAriaLive from '../../bpk-component-aria-live';
|
|
24
25
|
import BpkButton from '../../bpk-component-button';
|
|
25
26
|
import BpkText, { TEXT_STYLES } from '../../bpk-component-text';
|
|
26
27
|
import { cssModules } from '../../bpk-react-utils';
|
|
@@ -107,7 +108,7 @@ const BpkFloatingNotification = (props: Props) => {
|
|
|
107
108
|
<div className={classNames} {...rest}>
|
|
108
109
|
{Icon && (
|
|
109
110
|
<div className={iconClassNames}>
|
|
110
|
-
<Icon />
|
|
111
|
+
<Icon aria-hidden />
|
|
111
112
|
</div>
|
|
112
113
|
)}
|
|
113
114
|
<BpkText
|
|
@@ -117,6 +118,7 @@ const BpkFloatingNotification = (props: Props) => {
|
|
|
117
118
|
>
|
|
118
119
|
{text}
|
|
119
120
|
</BpkText>
|
|
121
|
+
<BpkAriaLive aria-hidden>{text}</BpkAriaLive>
|
|
120
122
|
{ctaText && (
|
|
121
123
|
<BpkButton link onClick={onClick} className={buttonClassNames}>
|
|
122
124
|
{ctaText}
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
/* @flow strict */
|
|
19
19
|
|
|
20
20
|
import PropTypes from 'prop-types';
|
|
21
|
-
import ReactDOM from 'react-dom';
|
|
22
21
|
import React, { Component, type Node } from 'react';
|
|
23
22
|
|
|
24
23
|
import { cssModules } from '../../bpk-react-utils';
|
|
@@ -99,17 +98,11 @@ class BpkHorizontalNav extends Component<Props> {
|
|
|
99
98
|
return;
|
|
100
99
|
}
|
|
101
100
|
|
|
102
|
-
// Using find dom node is preferable here over changing the underlying mechanism of BpkHorizontalNavItem to accomodate dom-node refs
|
|
103
|
-
// eslint-disable-next-line react/no-find-dom-node
|
|
104
|
-
const selectedItemRef = ((ReactDOM.findDOMNode(
|
|
105
|
-
this.selectedItemRef,
|
|
106
|
-
): any): Element);
|
|
107
|
-
|
|
108
101
|
if (!this.scrollRef) {
|
|
109
102
|
return;
|
|
110
103
|
}
|
|
111
104
|
|
|
112
|
-
const selectedItemPos = getPos(selectedItemRef);
|
|
105
|
+
const selectedItemPos = getPos(this.selectedItemRef);
|
|
113
106
|
if (!selectedItemPos) {
|
|
114
107
|
return;
|
|
115
108
|
}
|
|
@@ -168,10 +161,10 @@ class BpkHorizontalNav extends Component<Props> {
|
|
|
168
161
|
if (autoScrollToSelected || type === HORIZONTAL_NAV_TYPES.light) {
|
|
169
162
|
children = React.Children.map(rawChildren, (child) => {
|
|
170
163
|
const childProps = {};
|
|
171
|
-
|
|
164
|
+
let childRef;
|
|
172
165
|
if (autoScrollToSelected) {
|
|
173
166
|
if (child && child.props && child.props.selected) {
|
|
174
|
-
|
|
167
|
+
childRef = (ref) => {
|
|
175
168
|
this.selectedItemRef = ref;
|
|
176
169
|
};
|
|
177
170
|
}
|
|
@@ -181,7 +174,9 @@ class BpkHorizontalNav extends Component<Props> {
|
|
|
181
174
|
childProps.type = HORIZONTAL_NAV_TYPES.light;
|
|
182
175
|
}
|
|
183
176
|
|
|
184
|
-
return child ?
|
|
177
|
+
return child ? (
|
|
178
|
+
<div ref={childRef}>{React.cloneElement(child, childProps)}</div>
|
|
179
|
+
) : null;
|
|
185
180
|
});
|
|
186
181
|
}
|
|
187
182
|
|