@skyscanner/backpack-web 1.0.1 → 3.0.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-animate-height/package.json +2 -2
- package/bpk-component-accordion/package.json +6 -6
- package/bpk-component-aria-live/package.json +7 -7
- package/bpk-component-autosuggest/package.json +4 -4
- package/bpk-component-badge/package.json +4 -4
- package/bpk-component-banner-alert/package.json +8 -8
- package/bpk-component-barchart/package.json +7 -7
- package/bpk-component-barchart/src/BpkBarchartBar.js +3 -2
- package/bpk-component-blockquote/package.json +2 -2
- package/bpk-component-breadcrumb/package.json +5 -5
- package/bpk-component-breakpoint/package.json +2 -2
- package/bpk-component-button/package.json +2 -2
- package/bpk-component-calendar/package.json +8 -8
- package/bpk-component-calendar/src/BpkCalendarGridTransition.js +4 -2
- package/bpk-component-calendar/src/Week.js +3 -1
- package/bpk-component-card/package.json +4 -4
- package/bpk-component-checkbox/package.json +4 -4
- package/bpk-component-chip/package.json +5 -5
- package/bpk-component-close-button/package.json +4 -4
- package/bpk-component-code/package.json +2 -2
- package/bpk-component-content-container/package.json +2 -2
- package/bpk-component-datatable/package.json +3 -3
- package/bpk-component-datepicker/package.json +8 -8
- package/bpk-component-description-list/package.json +2 -2
- package/bpk-component-dialog/package.json +8 -8
- package/bpk-component-drawer/package.json +8 -8
- package/bpk-component-fieldset/package.json +12 -12
- package/bpk-component-flare/package.json +4 -4
- package/bpk-component-flare/src/__generated__/js/pointer.js +1 -1
- package/bpk-component-flare/src/svgs/pointer.svg +1 -1
- package/bpk-component-form-validation/package.json +9 -9
- package/bpk-component-graphic-promotion/package.json +5 -5
- package/bpk-component-grid/package.json +2 -2
- package/bpk-component-grid-toggle/package.json +3 -3
- package/bpk-component-horizontal-nav/package.json +5 -5
- package/bpk-component-icon/package.json +5 -5
- package/bpk-component-image/package.json +5 -5
- package/bpk-component-infinite-scroll/package.json +6 -6
- package/bpk-component-input/package.json +6 -6
- package/bpk-component-label/package.json +2 -2
- package/bpk-component-link/package.json +3 -3
- package/bpk-component-list/package.json +2 -2
- package/bpk-component-loading-button/package.json +6 -6
- package/bpk-component-map/package.json +6 -6
- package/bpk-component-mobile-scroll-container/package.json +2 -2
- package/bpk-component-modal/package.json +9 -9
- package/bpk-component-navigation-bar/package.json +7 -7
- package/bpk-component-navigation-stack/package.json +6 -6
- package/bpk-component-nudger/package.json +6 -6
- package/bpk-component-overlay/package.json +4 -4
- package/bpk-component-pagination/package.json +4 -4
- package/bpk-component-panel/package.json +2 -2
- package/bpk-component-phone-input/package.json +8 -8
- package/bpk-component-popover/README.md +2 -2
- package/bpk-component-popover/package.json +9 -9
- package/bpk-component-popover/src/BpkPopover.js +1 -0
- package/bpk-component-popover/src/BpkPopover.module.scss +28 -26
- package/bpk-component-popover/src/BpkPopoverPortal.js +43 -17
- package/bpk-component-progress/package.json +4 -4
- package/bpk-component-radio/package.json +3 -3
- package/bpk-component-rating/README.md +16 -7
- package/bpk-component-rating/package.json +3 -3
- package/bpk-component-rating/src/BpkRating.js +9 -6
- package/bpk-component-rating/src/common-types.js +1 -1
- package/bpk-component-rtl-toggle/package.json +3 -3
- package/bpk-component-scrollable-calendar/package.json +5 -5
- package/bpk-component-section-list/package.json +5 -5
- package/bpk-component-select/package.json +3 -3
- package/bpk-component-skip-link/package.json +2 -2
- package/bpk-component-slider/package.json +3 -3
- package/bpk-component-spinner/package.json +2 -2
- package/bpk-component-star-rating/package.json +5 -5
- package/bpk-component-star-rating/src/BpkStarRating.js +6 -1
- package/bpk-component-switch/package.json +2 -2
- package/bpk-component-table/package.json +2 -2
- package/bpk-component-text/package.json +2 -2
- package/bpk-component-textarea/package.json +4 -4
- package/bpk-component-theme-toggle/package.json +4 -4
- package/bpk-component-ticket/package.json +4 -4
- package/bpk-component-tooltip/README.md +2 -2
- package/bpk-component-tooltip/package.json +4 -4
- package/bpk-component-tooltip/src/BpkTooltip.js +6 -1
- package/bpk-component-tooltip/src/BpkTooltip.module.scss +46 -55
- package/bpk-component-tooltip/src/BpkTooltipPortal.js +21 -12
- package/bpk-react-utils/package.json +1 -1
- package/bpk-scrim-utils/package.json +2 -2
- package/bpk-theming/package.json +1 -1
- package/package.json +1 -2
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bpk-component-overlay",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.11",
|
|
4
4
|
"description": "Backpack overlay component.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"bpk-mixins": "^31.1.1",
|
|
17
|
-
"bpk-react-utils": "^4.1.
|
|
17
|
+
"bpk-react-utils": "^4.1.2",
|
|
18
18
|
"prop-types": "^15.5.8"
|
|
19
19
|
},
|
|
20
20
|
"peerDependencies": {
|
|
21
21
|
"react": "^16.3.0 || ^17.0.0"
|
|
22
22
|
},
|
|
23
23
|
"devDependencies": {
|
|
24
|
-
"bpk-component-image": "^5.1.
|
|
25
|
-
"bpk-component-text": "^7.0.
|
|
24
|
+
"bpk-component-image": "^5.1.11",
|
|
25
|
+
"bpk-component-text": "^7.0.4"
|
|
26
26
|
},
|
|
27
27
|
"gitHead": "f9f94f86d7cfc75e43bc6ad5eb01b23e62a89cc8"
|
|
28
28
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bpk-component-pagination",
|
|
3
|
-
"version": "4.0.
|
|
3
|
+
"version": "4.0.9",
|
|
4
4
|
"description": "Backpack pagination component.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -14,15 +14,15 @@
|
|
|
14
14
|
},
|
|
15
15
|
"gitHead": "f9f94f86d7cfc75e43bc6ad5eb01b23e62a89cc8",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"bpk-component-button": "^6.2.
|
|
17
|
+
"bpk-component-button": "^6.2.5",
|
|
18
18
|
"bpk-mixins": "^31.1.1",
|
|
19
|
-
"bpk-react-utils": "^4.1.
|
|
19
|
+
"bpk-react-utils": "^4.1.2",
|
|
20
20
|
"prop-types": "^15.7.2"
|
|
21
21
|
},
|
|
22
22
|
"peerDependencies": {
|
|
23
23
|
"react": "^16.3.0 || ^17.0.0"
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
|
-
"bpk-component-icon": "^9.2.
|
|
26
|
+
"bpk-component-icon": "^9.2.11"
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bpk-component-panel",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.10",
|
|
4
4
|
"description": "Backpack panel component.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"gitHead": "5c156b97cb0ba5e75851d3c763334578714c895e",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"bpk-mixins": "^31.1.1",
|
|
18
|
-
"bpk-react-utils": "^4.1.
|
|
18
|
+
"bpk-react-utils": "^4.1.2",
|
|
19
19
|
"prop-types": "^15.7.2"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bpk-component-phone-input",
|
|
3
|
-
"version": "7.1.
|
|
3
|
+
"version": "7.1.15",
|
|
4
4
|
"description": "Backpack phone input component.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -15,19 +15,19 @@
|
|
|
15
15
|
"gitHead": "f9f94f86d7cfc75e43bc6ad5eb01b23e62a89cc8",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@skyscanner/bpk-foundations-web": "^8.0.0",
|
|
18
|
-
"bpk-component-input": "^6.1.
|
|
19
|
-
"bpk-component-label": "^5.1.
|
|
20
|
-
"bpk-component-select": "^5.1.
|
|
21
|
-
"bpk-component-text": "^7.0.
|
|
18
|
+
"bpk-component-input": "^6.1.13",
|
|
19
|
+
"bpk-component-label": "^5.1.10",
|
|
20
|
+
"bpk-component-select": "^5.1.10",
|
|
21
|
+
"bpk-component-text": "^7.0.4",
|
|
22
22
|
"bpk-mixins": "^31.1.1",
|
|
23
|
-
"bpk-react-utils": "^4.1.
|
|
23
|
+
"bpk-react-utils": "^4.1.2",
|
|
24
24
|
"prop-types": "^15.7.2"
|
|
25
25
|
},
|
|
26
26
|
"peerDependencies": {
|
|
27
27
|
"react": "^16.3.0 || ^17.0.0"
|
|
28
28
|
},
|
|
29
29
|
"devDependencies": {
|
|
30
|
-
"bpk-component-fieldset": "^4.1.
|
|
31
|
-
"bpk-component-image": "^5.1.
|
|
30
|
+
"bpk-component-fieldset": "^4.1.15",
|
|
31
|
+
"bpk-component-image": "^5.1.11"
|
|
32
32
|
}
|
|
33
33
|
}
|
|
@@ -84,7 +84,7 @@ class App extends Component {
|
|
|
84
84
|
| labelAsTitle | bool | false | false |
|
|
85
85
|
| padded | bool | false | true |
|
|
86
86
|
| placement | oneOf(['top', 'right', 'bottom', 'left']) | false | 'bottom' |
|
|
87
|
-
| popperModifiers | object
|
|
87
|
+
| popperModifiers | arrayOf(object) | false | null |
|
|
88
88
|
| portalClassName | string | false | null |
|
|
89
89
|
| portalStyle | object | false | null |
|
|
90
90
|
| renderTarget | func | false | null |
|
|
@@ -118,7 +118,7 @@ const onClose = (event, {
|
|
|
118
118
|
|
|
119
119
|
#### popperModifiers
|
|
120
120
|
|
|
121
|
-
Please refer to the [documentation](https://
|
|
121
|
+
Please refer to the [documentation](https://popper.js.org/docs/v2/modifiers/) for the underlying positioning library "Popper.js". You can achieve various behaviours such as allowing the popover to overflow the viewport etc.
|
|
122
122
|
|
|
123
123
|
## Theme Props
|
|
124
124
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bpk-component-popover",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.0",
|
|
4
4
|
"description": "Backpack popover component.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -14,22 +14,22 @@
|
|
|
14
14
|
},
|
|
15
15
|
"gitHead": "f9f94f86d7cfc75e43bc6ad5eb01b23e62a89cc8",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"@
|
|
17
|
+
"@popperjs/core": "^2.11.5",
|
|
18
18
|
"a11y-focus-scope": "^1.1.3",
|
|
19
19
|
"a11y-focus-store": "^1.0.0",
|
|
20
|
-
"bpk-component-close-button": "^3.1.
|
|
21
|
-
"bpk-component-link": "^3.1.
|
|
22
|
-
"bpk-component-text": "^7.0.
|
|
20
|
+
"bpk-component-close-button": "^3.1.11",
|
|
21
|
+
"bpk-component-link": "^3.1.10",
|
|
22
|
+
"bpk-component-text": "^7.0.4",
|
|
23
23
|
"bpk-mixins": "^31.1.1",
|
|
24
|
-
"bpk-react-utils": "^4.1.
|
|
24
|
+
"bpk-react-utils": "^4.1.2",
|
|
25
25
|
"prop-types": "^15.7.2"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": "^16.3.0 || ^17.0.0"
|
|
29
29
|
},
|
|
30
30
|
"devDependencies": {
|
|
31
|
-
"bpk-component-button": "^6.2.
|
|
32
|
-
"bpk-component-content-container": "^5.0.
|
|
33
|
-
"bpk-component-input": "^6.1.
|
|
31
|
+
"bpk-component-button": "^6.2.5",
|
|
32
|
+
"bpk-component-content-container": "^5.0.4",
|
|
33
|
+
"bpk-component-input": "^6.1.13"
|
|
34
34
|
}
|
|
35
35
|
}
|
|
@@ -20,7 +20,8 @@
|
|
|
20
20
|
|
|
21
21
|
$bpk-spacing-v2: true;
|
|
22
22
|
|
|
23
|
-
$arrow-size: bpk-spacing-
|
|
23
|
+
$arrow-size: bpk-spacing-lg();
|
|
24
|
+
$arrow-inset-margin: -($bpk-one-pixel-rem * 11);
|
|
24
25
|
|
|
25
26
|
.bpk-popover-portal {
|
|
26
27
|
z-index: $bpk-zindex-popover;
|
|
@@ -29,22 +30,6 @@ $arrow-size: bpk-spacing-sm() * 3;
|
|
|
29
30
|
margin-right: bpk-spacing-base();
|
|
30
31
|
margin-left: bpk-spacing-base();
|
|
31
32
|
}
|
|
32
|
-
|
|
33
|
-
&[x-placement='top'] {
|
|
34
|
-
margin-bottom: $arrow-size;
|
|
35
|
-
}
|
|
36
|
-
|
|
37
|
-
&[x-placement='right'] {
|
|
38
|
-
margin-left: $arrow-size;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
|
-
&[x-placement='bottom'] {
|
|
42
|
-
margin-top: $arrow-size;
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
&[x-placement='left'] {
|
|
46
|
-
margin-right: $arrow-size;
|
|
47
|
-
}
|
|
48
33
|
}
|
|
49
34
|
|
|
50
35
|
.bpk-popover {
|
|
@@ -68,22 +53,39 @@ $arrow-size: bpk-spacing-sm() * 3;
|
|
|
68
53
|
}
|
|
69
54
|
|
|
70
55
|
&__arrow {
|
|
71
|
-
|
|
56
|
+
position: aboslute;
|
|
57
|
+
width: $arrow-size;
|
|
58
|
+
height: $arrow-size;
|
|
59
|
+
transform: rotate(45deg);
|
|
60
|
+
border: $bpk-one-pixel-rem solid transparent;
|
|
61
|
+
background: inherit;
|
|
62
|
+
|
|
63
|
+
.bpk-popover-portal[data-popper-placement='top'] & {
|
|
64
|
+
bottom: $arrow-inset-margin;
|
|
65
|
+
border-right-color: $bpk-color-sky-gray-tint-06;
|
|
66
|
+
border-bottom-color: $bpk-color-sky-gray-tint-06;
|
|
67
|
+
}
|
|
72
68
|
|
|
73
|
-
.bpk-popover-portal[
|
|
74
|
-
|
|
69
|
+
.bpk-popover-portal[data-popper-placement='right'] & {
|
|
70
|
+
left: $arrow-inset-margin;
|
|
71
|
+
border-bottom-color: $bpk-color-sky-gray-tint-06;
|
|
72
|
+
border-left-color: $bpk-color-sky-gray-tint-06;
|
|
75
73
|
}
|
|
76
74
|
|
|
77
|
-
.bpk-popover-portal[
|
|
78
|
-
|
|
75
|
+
.bpk-popover-portal[data-popper-placement='bottom'] & {
|
|
76
|
+
top: $arrow-inset-margin;
|
|
77
|
+
border-top-color: $bpk-color-sky-gray-tint-06;
|
|
78
|
+
border-left-color: $bpk-color-sky-gray-tint-06;
|
|
79
79
|
}
|
|
80
80
|
|
|
81
|
-
.bpk-popover-portal[
|
|
82
|
-
|
|
81
|
+
.bpk-popover-portal[data-popper-placement='left'] & {
|
|
82
|
+
right: $arrow-inset-margin;
|
|
83
|
+
border-top-color: $bpk-color-sky-gray-tint-06;
|
|
84
|
+
border-right-color: $bpk-color-sky-gray-tint-06;
|
|
83
85
|
}
|
|
84
86
|
|
|
85
|
-
|
|
86
|
-
|
|
87
|
+
&[data-hide] {
|
|
88
|
+
visibility: hidden;
|
|
87
89
|
}
|
|
88
90
|
}
|
|
89
91
|
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
/* @flow strict */
|
|
20
20
|
|
|
21
|
-
import
|
|
21
|
+
import { createPopper, basePlacements } from '@popperjs/core';
|
|
22
22
|
import PropTypes from 'prop-types';
|
|
23
23
|
import React, { Component, type Node } from 'react';
|
|
24
24
|
import focusStore from 'a11y-focus-store';
|
|
@@ -31,7 +31,6 @@ import BpkPopover, {
|
|
|
31
31
|
defaultProps as popoverDefaultProps,
|
|
32
32
|
type Props as PopoverProps,
|
|
33
33
|
} from './BpkPopover';
|
|
34
|
-
import { ARROW_ID } from './constants';
|
|
35
34
|
|
|
36
35
|
const getClassName = cssModules(STYLES);
|
|
37
36
|
|
|
@@ -51,7 +50,7 @@ export const propTypes = {
|
|
|
51
50
|
target: PropTypes.oneOfType([PropTypes.func, PropTypes.node]).isRequired,
|
|
52
51
|
isOpen: PropTypes.bool.isRequired,
|
|
53
52
|
onClose: PropTypes.func.isRequired,
|
|
54
|
-
placement: PropTypes.oneOf(
|
|
53
|
+
placement: PropTypes.oneOf(basePlacements),
|
|
55
54
|
portalStyle: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
|
56
55
|
portalClassName: PropTypes.string,
|
|
57
56
|
renderTarget: PropTypes.func,
|
|
@@ -68,7 +67,7 @@ export const defaultProps = {
|
|
|
68
67
|
};
|
|
69
68
|
|
|
70
69
|
class BpkPopoverPortal extends Component<Props> {
|
|
71
|
-
popper: ?typeof
|
|
70
|
+
popper: ?typeof createPopper;
|
|
72
71
|
|
|
73
72
|
suppressRestoreFocus: boolean;
|
|
74
73
|
|
|
@@ -139,34 +138,61 @@ class BpkPopoverPortal extends Component<Props> {
|
|
|
139
138
|
this.popper = null;
|
|
140
139
|
}
|
|
141
140
|
|
|
141
|
+
// Custom modifier that makes the arrow display at the edge of the target.
|
|
142
|
+
const applyArrowHide = {
|
|
143
|
+
name: 'applyArrowHide',
|
|
144
|
+
enabled: true,
|
|
145
|
+
phase: 'write',
|
|
146
|
+
fn({ state }) {
|
|
147
|
+
const { arrow } = state.elements;
|
|
148
|
+
if (arrow) {
|
|
149
|
+
if (state.modifiersData.arrow.centerOffset !== 0) {
|
|
150
|
+
arrow.setAttribute('data-hide', '');
|
|
151
|
+
} else {
|
|
152
|
+
arrow.removeAttribute('data-hide');
|
|
153
|
+
}
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
};
|
|
157
|
+
|
|
158
|
+
// The default modifiers for the popper
|
|
142
159
|
// Note that GPU acceleration should be disabled otherwise Popper will use `translate3d`
|
|
143
160
|
// which can cause blurriness in Safari and Chrome.
|
|
161
|
+
const stdModifiers = [
|
|
162
|
+
{
|
|
163
|
+
name: 'computeStyles',
|
|
164
|
+
options: {
|
|
165
|
+
gpuAcceleration: false,
|
|
166
|
+
},
|
|
167
|
+
},
|
|
168
|
+
{
|
|
169
|
+
name: 'offset',
|
|
170
|
+
options: {
|
|
171
|
+
offset: [0, 17],
|
|
172
|
+
},
|
|
173
|
+
},
|
|
174
|
+
applyArrowHide,
|
|
175
|
+
];
|
|
176
|
+
|
|
144
177
|
if (!this.popper) {
|
|
145
|
-
this.popper =
|
|
178
|
+
this.popper = createPopper(targetElement, popoverElement, {
|
|
146
179
|
placement: this.props.placement,
|
|
147
|
-
|
|
180
|
+
onFirstUpdate: () => {
|
|
148
181
|
if (targetElement) {
|
|
149
182
|
targetElement.focus();
|
|
150
183
|
}
|
|
151
184
|
focusStore.storeFocus();
|
|
152
185
|
keyboardFocusScope.scopeFocus(popoverElement);
|
|
153
186
|
},
|
|
154
|
-
modifiers:
|
|
155
|
-
...this.props.popperModifiers,
|
|
156
|
-
|
|
157
|
-
gpuAcceleration: false,
|
|
158
|
-
},
|
|
159
|
-
arrow: {
|
|
160
|
-
element: `#${ARROW_ID}`,
|
|
161
|
-
},
|
|
162
|
-
},
|
|
187
|
+
modifiers: this.props.popperModifiers
|
|
188
|
+
? [...this.props.popperModifiers, ...stdModifiers]
|
|
189
|
+
: stdModifiers,
|
|
163
190
|
});
|
|
164
191
|
}
|
|
165
192
|
|
|
166
193
|
this.previousTargetElement = targetElement;
|
|
167
|
-
|
|
168
194
|
if (this.popper) {
|
|
169
|
-
this.popper.
|
|
195
|
+
this.popper.update();
|
|
170
196
|
}
|
|
171
197
|
}
|
|
172
198
|
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bpk-component-progress",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.10",
|
|
4
4
|
"description": "Backpack progress bar component.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@skyscanner/bpk-foundations-web": "^8.0.0",
|
|
18
18
|
"bpk-mixins": "^31.1.1",
|
|
19
|
-
"bpk-react-utils": "^4.1.
|
|
19
|
+
"bpk-react-utils": "^4.1.2",
|
|
20
20
|
"lodash.clamp": "^4.0.3",
|
|
21
21
|
"prop-types": "^15.7.2"
|
|
22
22
|
},
|
|
@@ -24,7 +24,7 @@
|
|
|
24
24
|
"react": "^16.3.0 || ^17.0.0"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"bpk-component-button": "^6.2.
|
|
28
|
-
"bpk-storybook-utils": "^1.1.
|
|
27
|
+
"bpk-component-button": "^6.2.5",
|
|
28
|
+
"bpk-storybook-utils": "^1.1.9"
|
|
29
29
|
}
|
|
30
30
|
}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bpk-component-radio",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.11",
|
|
4
4
|
"description": "Backpack radio button component.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"gitHead": "5c156b97cb0ba5e75851d3c763334578714c895e",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"bpk-mixins": "^31.1.1",
|
|
18
|
-
"bpk-react-utils": "^4.1.
|
|
18
|
+
"bpk-react-utils": "^4.1.2",
|
|
19
19
|
"prop-types": "^15.7.2"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
@@ -23,6 +23,6 @@
|
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
25
|
"@skyscanner/bpk-foundations-web": "^8.0.0",
|
|
26
|
-
"bpk-storybook-utils": "^1.1.
|
|
26
|
+
"bpk-storybook-utils": "^1.1.9"
|
|
27
27
|
}
|
|
28
28
|
}
|
|
@@ -24,9 +24,9 @@ export default () => (
|
|
|
24
24
|
|
|
25
25
|
// Large size rating
|
|
26
26
|
<BpkRating
|
|
27
|
-
ariaLabel="4.4 Very good
|
|
27
|
+
ariaLabel="4.4 Very good 120 reviews"
|
|
28
28
|
title="Very good"
|
|
29
|
-
subtitle="
|
|
29
|
+
subtitle="120 reviews"
|
|
30
30
|
size={RATING_SIZES.large}
|
|
31
31
|
value={4.4}
|
|
32
32
|
/>
|
|
@@ -40,17 +40,26 @@ export default () => (
|
|
|
40
40
|
|
|
41
41
|
// Show scale rating
|
|
42
42
|
<BpkRating
|
|
43
|
-
ariaLabel="3.8 Good
|
|
43
|
+
ariaLabel="3.8 Good 530 reviews"
|
|
44
44
|
title="Good"
|
|
45
|
-
subtitle="
|
|
45
|
+
subtitle="530 reviews"
|
|
46
46
|
value={3.8}
|
|
47
47
|
/>
|
|
48
48
|
|
|
49
|
+
// Hide scale rating
|
|
50
|
+
<BpkRating
|
|
51
|
+
ariaLabel="3.8 Good 530 reviews"
|
|
52
|
+
title="Good"
|
|
53
|
+
subtitle="530 reviews"
|
|
54
|
+
value={3.8}
|
|
55
|
+
showScale={false}
|
|
56
|
+
/>
|
|
57
|
+
|
|
49
58
|
// 0-10 scale
|
|
50
59
|
<BpkRating
|
|
51
|
-
ariaLabel="9.9 Awesome
|
|
60
|
+
ariaLabel="9.9 Awesome 6,549 reviews"
|
|
52
61
|
title="Awesome"
|
|
53
|
-
subtitle="
|
|
62
|
+
subtitle="6,549 reviews"
|
|
54
63
|
value={9.9}
|
|
55
64
|
ratingScale={RATING_SCALES.zeroToTen}
|
|
56
65
|
/>
|
|
@@ -63,7 +72,7 @@ export default () => (
|
|
|
63
72
|
| --------- | --------------------- | -------- | ----------------- |
|
|
64
73
|
| ariaLabel | string | true | - |
|
|
65
74
|
| title | oneOfType(string, node) | true | - |
|
|
66
|
-
| value | number
|
|
75
|
+
| value | oneOfType(string, number) | true | - |
|
|
67
76
|
| className | string | false | null |
|
|
68
77
|
| ratingScale | oneOf(RATING_SCALES) | false | RATING_SCALES.zeroToFive |
|
|
69
78
|
| size | oneOf(RATING_SIZES) | false | RATING_SIZES.base |
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bpk-component-rating",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "5.0.1",
|
|
4
4
|
"description": "Backpack rating component.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -15,7 +15,7 @@
|
|
|
15
15
|
"gitHead": "f9f94f86d7cfc75e43bc6ad5eb01b23e62a89cc8",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"bpk-mixins": "^31.1.1",
|
|
18
|
-
"bpk-react-utils": "^4.1.
|
|
18
|
+
"bpk-react-utils": "^4.1.2",
|
|
19
19
|
"lodash.clamp": "^4.0.3",
|
|
20
20
|
"prop-types": "^15.5.8"
|
|
21
21
|
},
|
|
@@ -24,6 +24,6 @@
|
|
|
24
24
|
},
|
|
25
25
|
"devDependencies": {
|
|
26
26
|
"@skyscanner/bpk-foundations-web": "^8.0.0",
|
|
27
|
-
"bpk-component-text": "^7.0.
|
|
27
|
+
"bpk-component-text": "^7.0.4"
|
|
28
28
|
}
|
|
29
29
|
}
|
|
@@ -51,7 +51,7 @@ type Props = {
|
|
|
51
51
|
size: $Values<typeof RATING_SIZES>,
|
|
52
52
|
subtitle: ?string,
|
|
53
53
|
title: string | Node,
|
|
54
|
-
value: number,
|
|
54
|
+
value: string | number,
|
|
55
55
|
};
|
|
56
56
|
|
|
57
57
|
const BpkRating = (props: Props) => {
|
|
@@ -97,14 +97,17 @@ const BpkRating = (props: Props) => {
|
|
|
97
97
|
let adjustedValue = value;
|
|
98
98
|
|
|
99
99
|
if (adjustedValue >= maxValue || adjustedValue <= minValue) {
|
|
100
|
-
adjustedValue = clamp(adjustedValue, minValue, maxValue)
|
|
101
|
-
} else {
|
|
102
|
-
adjustedValue = value.toFixed(1);
|
|
100
|
+
adjustedValue = clamp(adjustedValue, minValue, maxValue);
|
|
103
101
|
}
|
|
104
102
|
|
|
105
103
|
return (
|
|
106
104
|
// $FlowFixMe[cannot-spread-inexact] - inexact rest. See 'decisions/flowfixme.md'.
|
|
107
|
-
<div
|
|
105
|
+
<div
|
|
106
|
+
className={classNames.join(' ')}
|
|
107
|
+
aria-label={ariaLabel}
|
|
108
|
+
role="figure"
|
|
109
|
+
{...rest}
|
|
110
|
+
>
|
|
108
111
|
<BpkText
|
|
109
112
|
textStyle={valueTextSize}
|
|
110
113
|
tagName="span"
|
|
@@ -153,7 +156,7 @@ const BpkRating = (props: Props) => {
|
|
|
153
156
|
BpkRating.propTypes = {
|
|
154
157
|
ariaLabel: PropTypes.string.isRequired,
|
|
155
158
|
title: PropTypes.oneOfType([PropTypes.string, PropTypes.node]).isRequired,
|
|
156
|
-
value: PropTypes.number.isRequired,
|
|
159
|
+
value: PropTypes.oneOfType([PropTypes.string, PropTypes.number]).isRequired,
|
|
157
160
|
className: PropTypes.string,
|
|
158
161
|
ratingScale: PropTypes.oneOf(Object.keys(RATING_SCALES)),
|
|
159
162
|
size: PropTypes.oneOf(Object.keys(RATING_SIZES)),
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bpk-component-rtl-toggle",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.10",
|
|
4
4
|
"description": "Backpack RTL toggle component.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
},
|
|
15
15
|
"gitHead": "5c156b97cb0ba5e75851d3c763334578714c895e",
|
|
16
16
|
"dependencies": {
|
|
17
|
-
"bpk-component-link": "^3.1.
|
|
18
|
-
"bpk-react-utils": "^4.1.
|
|
17
|
+
"bpk-component-link": "^3.1.10",
|
|
18
|
+
"bpk-react-utils": "^4.1.2",
|
|
19
19
|
"prop-types": "^15.7.2"
|
|
20
20
|
},
|
|
21
21
|
"peerDependencies": {
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bpk-component-scrollable-calendar",
|
|
3
|
-
"version": "6.1.
|
|
3
|
+
"version": "6.1.15",
|
|
4
4
|
"description": "Backpack scrollable calendar component.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -15,16 +15,16 @@
|
|
|
15
15
|
"gitHead": "4e4ec9add28e1db54d6a38a10c331bbd163f2926",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@skyscanner/bpk-foundations-web": "^8.0.0",
|
|
18
|
-
"bpk-component-calendar": "^11.1.
|
|
19
|
-
"bpk-component-text": "^7.0.
|
|
18
|
+
"bpk-component-calendar": "^11.1.15",
|
|
19
|
+
"bpk-component-text": "^7.0.4",
|
|
20
20
|
"bpk-mixins": "^31.1.1",
|
|
21
|
-
"bpk-react-utils": "^4.1.
|
|
21
|
+
"bpk-react-utils": "^4.1.2",
|
|
22
22
|
"date-fns": "^2.21.1",
|
|
23
23
|
"prop-types": "^15.5.8",
|
|
24
24
|
"react-virtualized": "^9.22.3"
|
|
25
25
|
},
|
|
26
26
|
"devDependencies": {
|
|
27
|
-
"bpk-storybook-utils": "^1.1.
|
|
27
|
+
"bpk-storybook-utils": "^1.1.9"
|
|
28
28
|
},
|
|
29
29
|
"peerDependencies": {
|
|
30
30
|
"react": "^16.3.0 || ^17.0.0"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bpk-component-section-list",
|
|
3
|
-
"version": "3.2.
|
|
3
|
+
"version": "3.2.11",
|
|
4
4
|
"description": "Backpack section list component.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -15,14 +15,14 @@
|
|
|
15
15
|
"gitHead": "f9f94f86d7cfc75e43bc6ad5eb01b23e62a89cc8",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"@skyscanner/bpk-foundations-web": "^8.0.0",
|
|
18
|
-
"bpk-component-icon": "^9.2.
|
|
19
|
-
"bpk-component-text": "^7.0.
|
|
18
|
+
"bpk-component-icon": "^9.2.11",
|
|
19
|
+
"bpk-component-text": "^7.0.4",
|
|
20
20
|
"bpk-mixins": "^31.1.1",
|
|
21
|
-
"bpk-react-utils": "^4.1.
|
|
21
|
+
"bpk-react-utils": "^4.1.2",
|
|
22
22
|
"prop-types": "^15.7.2"
|
|
23
23
|
},
|
|
24
24
|
"devDependencies": {
|
|
25
|
-
"bpk-storybook-utils": "^1.1.
|
|
25
|
+
"bpk-storybook-utils": "^1.1.9"
|
|
26
26
|
},
|
|
27
27
|
"peerDependencies": {
|
|
28
28
|
"react": "^16.3.0 || ^17.0.0"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bpk-component-select",
|
|
3
|
-
"version": "5.1.
|
|
3
|
+
"version": "5.1.10",
|
|
4
4
|
"description": "Backpack select component.",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"repository": {
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
"gitHead": "5c156b97cb0ba5e75851d3c763334578714c895e",
|
|
16
16
|
"dependencies": {
|
|
17
17
|
"bpk-mixins": "^31.1.1",
|
|
18
|
-
"bpk-react-utils": "^4.1.
|
|
18
|
+
"bpk-react-utils": "^4.1.2",
|
|
19
19
|
"prop-types": "^15.7.2"
|
|
20
20
|
},
|
|
21
21
|
"devDependencies": {
|
|
22
|
-
"bpk-storybook-utils": "^1.1.
|
|
22
|
+
"bpk-storybook-utils": "^1.1.9"
|
|
23
23
|
},
|
|
24
24
|
"peerDependencies": {
|
|
25
25
|
"react": "^16.3.0 || ^17.0.0"
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "bpk-component-skip-link",
|
|
3
|
-
"version": "2.1.
|
|
3
|
+
"version": "2.1.10",
|
|
4
4
|
"description": "Backpack skip-link component.",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"repository": {
|
|
@@ -14,7 +14,7 @@
|
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
16
|
"bpk-mixins": "^31.1.1",
|
|
17
|
-
"bpk-react-utils": "^4.1.
|
|
17
|
+
"bpk-react-utils": "^4.1.2",
|
|
18
18
|
"prop-types": "^15.5.8"
|
|
19
19
|
},
|
|
20
20
|
"publishConfig": {
|