@skyscanner/backpack-web 36.7.0 → 36.8.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-calendar/src/BpkCalendarGrid.js +2 -4
- package/bpk-component-popover/src/BpkPopover.d.ts +1 -0
- package/bpk-stylesheets/font.js +1 -1
- package/bpk-stylesheets/index.css +19 -0
- package/bpk-stylesheets/index.js +1 -1
- package/bpk-stylesheets/larken.js +1 -1
- package/package.json +1 -1
- package/bpk-react-utils/src/__mocks__/deferCallback.d.ts +0 -9
- package/bpk-react-utils/src/__mocks__/deferCallback.js +0 -29
- package/bpk-react-utils/src/deferCallback.d.ts +0 -13
- package/bpk-react-utils/src/deferCallback.js +0 -39
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
|
|
19
19
|
import { Component } from 'react';
|
|
20
20
|
import { cssModules, isDeviceIos } from "../../bpk-react-utils";
|
|
21
|
-
import deferCallback from "../../bpk-react-utils/src/deferCallback";
|
|
22
21
|
import { addCalendarGridTransition } from "./BpkCalendarGridTransition";
|
|
23
22
|
import BpkCalendarWeek from "./BpkCalendarWeek";
|
|
24
23
|
import { CALENDAR_SELECTION_TYPE } from "./custom-proptypes";
|
|
@@ -65,10 +64,9 @@ class BpkCalendarGrid extends Component {
|
|
|
65
64
|
};
|
|
66
65
|
}
|
|
67
66
|
componentDidMount() {
|
|
68
|
-
|
|
69
|
-
deferCallback(() => this.setState({
|
|
67
|
+
this.setState({
|
|
70
68
|
calendarMonthWeeks: getCalendar(this.props.month, this.props.weekStartsOn, this.props.formatDateFull)
|
|
71
|
-
})
|
|
69
|
+
});
|
|
72
70
|
}
|
|
73
71
|
UNSAFE_componentWillReceiveProps(nextProps) {
|
|
74
72
|
// We cache expensive calculations (and identities) in state
|
|
@@ -33,6 +33,7 @@ export type Props = CloseButtonProps & {
|
|
|
33
33
|
actionText?: string;
|
|
34
34
|
onAction?: () => void;
|
|
35
35
|
renderTarget?: () => HTMLElement | HTMLElement | undefined;
|
|
36
|
+
[rest: string]: any;
|
|
36
37
|
};
|
|
37
38
|
declare const BpkPopover: ({ actionText, children, className, closeButtonIcon, closeButtonLabel, closeButtonProps, closeButtonText, hoverable, id, isOpen, label, labelAsTitle, onAction, onClose, padded, placement, renderTarget, showArrow, target, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
38
39
|
export default BpkPopover;
|
package/bpk-stylesheets/font.js
CHANGED
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/*
|
|
2
|
+
*
|
|
3
|
+
* Backpack - Skyscanner's Design System
|
|
4
|
+
*
|
|
5
|
+
* Copyright 2016 Skyscanner Ltd
|
|
6
|
+
*
|
|
7
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
8
|
+
* you may not use this file except in compliance with the License.
|
|
9
|
+
* You may obtain a copy of the License at
|
|
10
|
+
*
|
|
11
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
12
|
+
*
|
|
13
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
14
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
15
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
16
|
+
* See the License for the specific language governing permissions and
|
|
17
|
+
* limitations under the License.
|
|
18
|
+
*
|
|
19
|
+
*//*! normalize.css v4.1.1 | MIT License | github.com/necolas/normalize.css */html{font-family:sans-serif;line-height:1.15;-ms-text-size-adjust:100%;-webkit-text-size-adjust:100%}body{margin:0}article,aside,details,figcaption,figure,footer,header,main,menu,nav,section,summary{display:block}audio,canvas,progress,video{display:inline-block}audio:not([controls]){display:none;height:0}progress{vertical-align:baseline}template,[hidden]{display:none}a{background-color:transparent;-webkit-text-decoration-skip:objects}a:active,a:hover{outline-width:0}abbr[title]{border-bottom:none;text-decoration:underline;text-decoration:underline dotted}b,strong{font-weight:inherit}b,strong{font-weight:bolder}dfn{font-style:italic}h1{font-size:2em;margin:.67em 0}mark{background-color:#ff0;color:#000}small{font-size:80%}sub,sup{font-size:75%;line-height:0;position:relative;vertical-align:baseline}sub{bottom:-0.25em}sup{top:-0.5em}img{border-style:none}svg:not(:root){overflow:hidden}code,kbd,pre,samp{font-family:monospace,monospace;font-size:1em}figure{margin:1em 40px}hr{box-sizing:content-box;height:0;overflow:visible}button,input,optgroup,select,textarea{font:inherit;margin:0}optgroup{font-weight:bold}button,input{overflow:visible}button,select{text-transform:none}button,html [type=button],[type=reset],[type=submit]{-webkit-appearance:button}button::-moz-focus-inner,[type=button]::-moz-focus-inner,[type=reset]::-moz-focus-inner,[type=submit]::-moz-focus-inner{border-style:none;padding:0}button:-moz-focusring,[type=button]:-moz-focusring,[type=reset]:-moz-focusring,[type=submit]:-moz-focusring{outline:1px dotted ButtonText}fieldset{border:1px solid silver;margin:0 2px;padding:.35em .625em .75em}legend{box-sizing:border-box;color:inherit;display:table;max-width:100%;padding:0;white-space:normal}textarea{overflow:auto}[type=checkbox],[type=radio]{box-sizing:border-box;padding:0}[type=number]::-webkit-inner-spin-button,[type=number]::-webkit-outer-spin-button{height:auto}[type=search]{-webkit-appearance:textfield;outline-offset:-2px}[type=search]::-webkit-search-cancel-button,[type=search]::-webkit-search-decoration{-webkit-appearance:none}::-webkit-input-placeholder{color:inherit;opacity:.54}::-webkit-file-upload-button{-webkit-appearance:button;font:inherit}html{font-size:100%;box-sizing:border-box}*{box-sizing:inherit}*::before,*::after{box-sizing:inherit}body{color:#161616;font-family:"Skyscanner Relative",-apple-system,BlinkMacSystemFont,"Roboto","Oxygen","Ubuntu","Cantarell","Fira Sans","Droid Sans","Helvetica Neue",sans-serif;font-size:1rem;line-height:1.3rem}body.scaffold-font-size{font-size:13px}body.enable-font-smoothing{-webkit-font-smoothing:antialiased}:focus-visible{outline:.125rem solid #0062e3;outline-offset:.125rem}.hidden,.hide{display:none !important}.visuallyhidden,.visually-hidden{position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;white-space:nowrap;overflow:hidden;clip:rect(0 0 0 0)}.visuallyhidden.focusable:active,.visuallyhidden.focusable:focus,.visually-hidden.focusable:active,.visually-hidden.focusable:focus{position:static;width:auto;height:auto;margin:0;overflow:visible;clip:auto}.invisible{visibility:hidden}.clearfix::before,.clearfix::after{content:"";display:table}.clearfix::after{clear:both}
|
package/bpk-stylesheets/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,9 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Mock deferCallback to immediately invoke the callback. This ensures that
|
|
3
|
-
* asynchronous state updates triggered by `deferCallback` run before asserting.
|
|
4
|
-
* https://developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallback
|
|
5
|
-
* @param {function} callback - callback to execute, value cannot be returned.
|
|
6
|
-
* You'll typically want to wrap the callback `setState` to update React state.
|
|
7
|
-
* @returns {void}
|
|
8
|
-
*/
|
|
9
|
-
export default function deferCallback(callback: () => void): void;
|
|
@@ -1,29 +0,0 @@
|
|
|
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
|
-
/**
|
|
20
|
-
* Mock deferCallback to immediately invoke the callback. This ensures that
|
|
21
|
-
* asynchronous state updates triggered by `deferCallback` run before asserting.
|
|
22
|
-
* https://developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallback
|
|
23
|
-
* @param {function} callback - callback to execute, value cannot be returned.
|
|
24
|
-
* You'll typically want to wrap the callback `setState` to update React state.
|
|
25
|
-
* @returns {void}
|
|
26
|
-
*/
|
|
27
|
-
export default function deferCallback(callback) {
|
|
28
|
-
callback();
|
|
29
|
-
}
|
|
@@ -1,13 +0,0 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* Defer a task until the browser is idle, or till the next "tick" if the
|
|
3
|
-
* browser does not support the idle callback API. This is useful for deferring
|
|
4
|
-
* computationally heavy, non-essential tasks to keep the UI responsive. If the
|
|
5
|
-
* task has not completed within the timeout, it will be executed regardless.
|
|
6
|
-
*
|
|
7
|
-
* https://developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallback
|
|
8
|
-
* @param {function} callback - callback to execute, value cannot be returned.
|
|
9
|
-
* You'll typically want to wrap the callback `setState` to update React state.
|
|
10
|
-
* @returns {void}
|
|
11
|
-
*/
|
|
12
|
-
declare const deferCallback: (callback: () => void) => void;
|
|
13
|
-
export default deferCallback;
|
|
@@ -1,39 +0,0 @@
|
|
|
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
|
-
/**
|
|
20
|
-
* Defer a task until the browser is idle, or till the next "tick" if the
|
|
21
|
-
* browser does not support the idle callback API. This is useful for deferring
|
|
22
|
-
* computationally heavy, non-essential tasks to keep the UI responsive. If the
|
|
23
|
-
* task has not completed within the timeout, it will be executed regardless.
|
|
24
|
-
*
|
|
25
|
-
* https://developer.mozilla.org/en-US/docs/Web/API/Window/requestIdleCallback
|
|
26
|
-
* @param {function} callback - callback to execute, value cannot be returned.
|
|
27
|
-
* You'll typically want to wrap the callback `setState` to update React state.
|
|
28
|
-
* @returns {void}
|
|
29
|
-
*/
|
|
30
|
-
const deferCallback = callback => {
|
|
31
|
-
if (window.requestIdleCallback) {
|
|
32
|
-
window.requestIdleCallback(callback, {
|
|
33
|
-
timeout: 500
|
|
34
|
-
});
|
|
35
|
-
} else {
|
|
36
|
-
setTimeout(callback, 0);
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
export default deferCallback;
|