@skyscanner/backpack-web 25.8.2 → 25.8.4
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-banner-alert/src/AnimateAndFade.js +1 -1
- package/bpk-component-barchart/src/BpkBarchart.js +0 -1
- package/bpk-component-button/src/BpkButtonBase.js +1 -1
- package/bpk-component-button/src/BpkButtonDestructive.js +1 -1
- package/bpk-component-button/src/BpkButtonFeatured.js +1 -1
- package/bpk-component-button/src/BpkButtonLink.js +1 -1
- package/bpk-component-button/src/BpkButtonLinkOnDark.js +1 -1
- package/bpk-component-button/src/BpkButtonPrimary.js +1 -1
- package/bpk-component-button/src/BpkButtonPrimaryOnDark.js +1 -1
- package/bpk-component-button/src/BpkButtonPrimaryOnLight.js +1 -1
- package/bpk-component-button/src/BpkButtonSecondary.js +1 -1
- package/bpk-component-button/src/BpkButtonSecondaryOnDark.js +1 -1
- package/bpk-component-button/src/BpkButtonV2/common-types.d.ts +2 -2
- package/bpk-component-calendar/src/utils.js +1 -1
- package/bpk-component-horizontal-nav/src/BpkHorizontalNav.js +2 -2
- package/bpk-component-infinite-scroll/src/DataSource.js +1 -1
- package/bpk-component-modal/src/BpkModalV2/BpKModal.module.css +1 -1
- package/bpk-component-nudger/src/BpkConfigurableNudger.js +0 -1
- package/bpk-component-scrollable-calendar/src/BpkScrollableCalendarGridList.js +4 -4
- package/bpk-component-select/src/BpkSelect.js +1 -1
- package/bpk-component-skip-link/src/BpkSkipLink.module.css +1 -1
- package/bpk-theming/src/BpkThemeProvider.js +0 -1
- package/package.json +1 -1
|
@@ -62,7 +62,7 @@ class AnimateAndFade extends Component {
|
|
|
62
62
|
if (this.state.initiateShow) {
|
|
63
63
|
// React doesn't like us calling setState from componentDidUpdate as it can lead to an infinite re-renders.
|
|
64
64
|
// I think it is ok here, however, as this will only happen conditionally (ie once)
|
|
65
|
-
|
|
65
|
+
|
|
66
66
|
this.setState({
|
|
67
67
|
initiateShow: false,
|
|
68
68
|
isExpanded: true,
|
|
@@ -215,7 +215,6 @@ class BpkBarchart extends Component {
|
|
|
215
215
|
}
|
|
216
216
|
BpkBarchart.propTypes = {
|
|
217
217
|
data: dataProp,
|
|
218
|
-
// eslint-disable-line react/require-default-props
|
|
219
218
|
xScaleDataKey: PropTypes.string.isRequired,
|
|
220
219
|
yScaleDataKey: PropTypes.string.isRequired,
|
|
221
220
|
xAxisLabel: PropTypes.string.isRequired,
|
|
@@ -14,7 +14,7 @@
|
|
|
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 {
|
|
17
|
+
*/import { propTypes, defaultProps } from "./common-types";
|
|
18
18
|
import COMMON_STYLES from "./BpkButtonBase.module.css";
|
|
19
19
|
|
|
20
20
|
// This was originally depended upon from the bpk-react-utils package, however
|
|
@@ -14,7 +14,7 @@
|
|
|
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 {
|
|
17
|
+
*/import { defaultProps, propTypes } from "./common-types";
|
|
18
18
|
import BpkButtonBase, { cssModules } from "./BpkButtonBase";
|
|
19
19
|
import STYLES from "./BpkButtonDestructive.module.css";
|
|
20
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -14,7 +14,7 @@
|
|
|
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 {
|
|
17
|
+
*/import { defaultProps, propTypes } from "./common-types";
|
|
18
18
|
import BpkButtonBase, { cssModules } from "./BpkButtonBase";
|
|
19
19
|
import STYLES from "./BpkButtonFeatured.module.css";
|
|
20
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -14,7 +14,7 @@
|
|
|
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 {
|
|
17
|
+
*/import { defaultProps, propTypes } from "./common-types";
|
|
18
18
|
import BpkButtonBase, { cssModules } from "./BpkButtonBase";
|
|
19
19
|
import STYLES from "./BpkButtonLink.module.css";
|
|
20
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -14,7 +14,7 @@
|
|
|
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 {
|
|
17
|
+
*/import { defaultProps, propTypes } from "./common-types";
|
|
18
18
|
import BpkButtonBase, { cssModules } from "./BpkButtonBase";
|
|
19
19
|
import STYLES from "./BpkButtonLinkOnDark.module.css";
|
|
20
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -14,7 +14,7 @@
|
|
|
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 {
|
|
17
|
+
*/import { defaultProps, propTypes } from "./common-types";
|
|
18
18
|
import BpkButtonBase from "./BpkButtonBase";
|
|
19
19
|
|
|
20
20
|
// TODO: BpkButtonBase has the primary button style as it wasn't removed to
|
|
@@ -14,7 +14,7 @@
|
|
|
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 {
|
|
17
|
+
*/import { defaultProps, propTypes } from "./common-types";
|
|
18
18
|
import BpkButtonBase, { cssModules } from "./BpkButtonBase";
|
|
19
19
|
import STYLES from "./BpkButtonPrimaryOnDark.module.css";
|
|
20
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -14,7 +14,7 @@
|
|
|
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 {
|
|
17
|
+
*/import { defaultProps, propTypes } from "./common-types";
|
|
18
18
|
import BpkButtonBase, { cssModules } from "./BpkButtonBase";
|
|
19
19
|
import STYLES from "./BpkButtonPrimaryOnLight.module.css";
|
|
20
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -14,7 +14,7 @@
|
|
|
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 {
|
|
17
|
+
*/import { defaultProps, propTypes } from "./common-types";
|
|
18
18
|
import BpkButtonBase, { cssModules } from "./BpkButtonBase";
|
|
19
19
|
import STYLES from "./BpkButtonSecondary.module.css";
|
|
20
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -14,7 +14,7 @@
|
|
|
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 {
|
|
17
|
+
*/import { defaultProps, propTypes } from "./common-types";
|
|
18
18
|
import BpkButtonBase, { cssModules } from "./BpkButtonBase";
|
|
19
19
|
import STYLES from "./BpkButtonSecondaryOnDark.module.css";
|
|
20
20
|
import { jsx as _jsx } from "react/jsx-runtime";
|
|
@@ -16,7 +16,7 @@
|
|
|
16
16
|
* limitations under the License.
|
|
17
17
|
*/
|
|
18
18
|
|
|
19
|
-
import type { ReactNode,
|
|
19
|
+
import type { ReactNode, MouseEvent } from 'react';
|
|
20
20
|
|
|
21
21
|
export declare const BUTTON_TYPES: {
|
|
22
22
|
readonly primary: 'primary';
|
|
@@ -42,7 +42,7 @@ export type Props = {
|
|
|
42
42
|
className?: string | null;
|
|
43
43
|
disabled?: boolean;
|
|
44
44
|
iconOnly?: boolean;
|
|
45
|
-
onClick?: (event:
|
|
45
|
+
onClick?: (event: MouseEvent) => void;
|
|
46
46
|
rel?: string | undefined;
|
|
47
47
|
submit?: boolean;
|
|
48
48
|
href?: string | null;
|
|
@@ -24,7 +24,7 @@ const splitToken = value => {
|
|
|
24
24
|
if (!match) {
|
|
25
25
|
throw new Error(`Invalid token value. Expecting a valid css unit, got ${value}`);
|
|
26
26
|
}
|
|
27
|
-
const [_, val, unit] = match;
|
|
27
|
+
const [_, val, unit] = match;
|
|
28
28
|
return [parseFloat(val), unit];
|
|
29
29
|
};
|
|
30
30
|
export const getCalendarGridWidth = (multiplier = 1) => {
|
|
@@ -55,9 +55,9 @@ class BpkHorizontalNav extends Component {
|
|
|
55
55
|
this.scrollRef = null;
|
|
56
56
|
this.selectedItemRef = null;
|
|
57
57
|
}
|
|
58
|
-
componentDidMount
|
|
58
|
+
componentDidMount() {
|
|
59
59
|
this.scrollSelectedIntoView(false);
|
|
60
|
-
}
|
|
60
|
+
}
|
|
61
61
|
componentDidUpdate() {
|
|
62
62
|
this.scrollSelectedIntoView(true);
|
|
63
63
|
}
|
|
@@ -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)}}@keyframes bpk-modal-scrim{0%{opacity:0}100%{opacity:1}}@keyframes bpk-modal-scale{0%{transform:scale(0.9)}100%{transform:scale(1)}}.bpk-modal-wrapper.bpk-modal-polyfill .bpk-modal-backdrop{position:fixed;
|
|
18
|
+
@keyframes bpk-keyframe-spin{100%{transform:rotate(1turn)}}@keyframes bpk-modal-scrim{0%{opacity:0}100%{opacity:1}}@keyframes bpk-modal-scale{0%{transform:scale(0.9)}100%{transform:scale(1)}}.bpk-modal-wrapper.bpk-modal-polyfill .bpk-modal-backdrop{position:fixed;z-index:0;margin:0 auto;background-color:rgba(0,0,0,0.7);animation:bpk-modal-scrim 200ms ease-in-out;inset:0;inset-block-end:0;inset-inline:0;inset-inline-end:0}.bpk-modal-wrapper.bpk-modal-polyfill .bpk-modal{position:fixed;top:50%;left:50%;display:block;z-index:1;transform:translate(-50%, -50%) scale(1);transition:transform 200ms ease-in-out 200ms}.bpk-modal-wrapper.bpk-modal-polyfill .bpk-modal:not([data-open='true']),.bpk-modal-wrapper.bpk-modal-polyfill .bpk-modal-backdrop:not([data-open='true']){display:none}.bpk-modal{padding:0;border:none;border-radius:.75rem;background:#fff;overflow-y:scroll;scrollbar-width:none;box-shadow:0px 12px 50px 0px rgba(37,32,31,0.25)}@media (min-width: 32.0625rem){.bpk-modal{width:32rem;max-width:none;height:fit-content;max-height:90%}.bpk-modal--full-screen-desktop{width:100%;height:100%;max-height:100%;border-radius:0}.bpk-modal--wide{width:64rem}}.bpk-modal[open]{animation:bpk-modal-scale 200ms ease-in-out}.bpk-modal--no-full-screen-mobile{width:90%;max-width:none;height:fit-content;max-height:90%}@media (min-width: 32.0625rem){.bpk-modal--no-full-screen-mobile{width:32rem;max-width:none}}.bpk-modal::backdrop{position:fixed;background-color:rgba(0,0,0,0.7);animation:bpk-modal-scrim 200ms ease-in-out;inset:0;inset-block-end:0;inset-inline:0;inset-inline-end:0}.bpk-modal::-webkit-scrollbar{display:none}.bpk-modal__header-title{padding:1rem;border-block-end:solid 0.0625rem #C2C9CD;display:flex;min-height:1.5rem;flex-wrap:nowrap;justify-content:flex-end;align-items:center}.bpk-modal__header-title-container{display:flex;width:100%;justify-content:flex-start}.bpk-modal__title{padding-inline-end:1rem;font-size:1rem;line-height:1.5rem;font-weight:700}.bpk-modal__button-container{padding-block-start:1rem;padding-inline-end:1rem;display:flex;min-height:1.5rem;flex-wrap:nowrap;justify-content:flex-end;align-items:center}.bpk-modal__container{min-height:100%;padding:1rem}.bpk-modal__container--padded{padding:0}.bpk-modal__container--full-screen-desktop{height:100%}
|
|
@@ -57,21 +57,21 @@ class BpkScrollableCalendarGridList extends Component {
|
|
|
57
57
|
outerHeight: ESTIMATED_MONTH_ITEM_HEIGHT
|
|
58
58
|
};
|
|
59
59
|
}
|
|
60
|
-
componentDidMount
|
|
60
|
+
componentDidMount() {
|
|
61
61
|
this.setComponentHeight();
|
|
62
62
|
if (typeof document !== 'undefined') {
|
|
63
63
|
window.addEventListener('resize', this.setComponentHeight);
|
|
64
64
|
document.addEventListener('orientationchange', this.setComponentHeight);
|
|
65
65
|
document.addEventListener('fullscreenchange', this.setComponentHeight);
|
|
66
66
|
}
|
|
67
|
-
}
|
|
68
|
-
componentWillUnmount
|
|
67
|
+
}
|
|
68
|
+
componentWillUnmount() {
|
|
69
69
|
if (typeof document !== 'undefined') {
|
|
70
70
|
window.removeEventListener('resize', this.setComponentHeight);
|
|
71
71
|
document.removeEventListener('orientationchange', this.setComponentHeight);
|
|
72
72
|
document.removeEventListener('fullscreenchange', this.setComponentHeight);
|
|
73
73
|
}
|
|
74
|
-
}
|
|
74
|
+
}
|
|
75
75
|
getHtmlElement = () => typeof document !== 'undefined' ? document.querySelector('html') : {};
|
|
76
76
|
getItemSize = index => this.state.monthItemHeights[index] || ESTIMATED_MONTH_ITEM_HEIGHT;
|
|
77
77
|
setComponentHeight = () => {
|
|
@@ -67,7 +67,7 @@ BpkSelect.propTypes = {
|
|
|
67
67
|
// In this case value is not required and nor should it be given a default value (as the linter thinks)
|
|
68
68
|
// Prop types are not expressive enough (without a drastic increase in complexity of writing a custom validator) to encode this relationship. Equally, this wouldn't actually solve the linting issue (AFAIK).
|
|
69
69
|
// As a solution, the require-default-props has been disabled for this line.
|
|
70
|
-
|
|
70
|
+
|
|
71
71
|
value: PropTypes.string,
|
|
72
72
|
className: PropTypes.string,
|
|
73
73
|
disabled: PropTypes.bool,
|
|
@@ -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-skip-link{display:inline-block;padding:.75rem;transition:opacity 200ms ease-in-out;border-radius:.5rem;color:#fff;
|
|
18
|
+
@keyframes bpk-keyframe-spin{100%{transform:rotate(1turn)}}.bpk-skip-link{display:inline-block;padding:.75rem;transition:opacity 200ms ease-in-out;border-radius:.5rem;color:#fff;text-decoration:none;opacity:0;overflow:hidden;pointer-events:none;transition-delay:200ms;font-size:1rem;line-height:1.25rem;font-weight:700;background-color:#e70866;background-color:var(--bpk-skip-link-background-color, #e70866)}.bpk-skip-link:focus-within,.bpk-skip-link:focus{transition:none;opacity:1;transition-delay:0}
|
|
@@ -127,7 +127,6 @@ BpkThemeProvider.propTypes = {
|
|
|
127
127
|
theme: PropTypes.object,
|
|
128
128
|
// eslint-disable-line react/forbid-prop-types
|
|
129
129
|
themeAttributes: themeAttributesPropType,
|
|
130
|
-
// eslint-disable-line react/require-default-props
|
|
131
130
|
// (disabled because isRequired is inside the custom validator)
|
|
132
131
|
component: PropTypes.elementType,
|
|
133
132
|
style: PropTypes.object // eslint-disable-line react/forbid-prop-types
|