@skyscanner/backpack-web 19.0.0 → 20.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/README.md +0 -1
- package/bpk-component-banner-alert/src/BpkBannerAlert.module.scss +0 -8
- package/bpk-component-banner-alert/src/BpkBannerAlertInner.js +0 -2
- package/bpk-component-banner-alert/src/common-types.js +1 -9
- package/bpk-component-button/README.md +0 -2
- package/bpk-component-button/index.js +0 -2
- package/bpk-component-button/src/BpkButton.js +0 -8
- package/bpk-component-calendar/README.md +1 -1
- package/bpk-component-calendar/src/BpkCalendarContainer.js +3 -18
- package/bpk-component-calendar/src/BpkCalendarGrid.js +1 -18
- package/bpk-component-calendar/src/BpkCalendarGridHeader.js +1 -6
- package/bpk-component-calendar/src/Week.js +1 -20
- package/bpk-component-calendar/src/composeCalendar.js +1 -11
- package/bpk-component-card/README.md +50 -17
- package/bpk-component-card/index.js +2 -1
- package/{bpk-component-grid/src/BpkGridContainer.js → bpk-component-card/src/BpkCardWrapper.js} +28 -23
- package/bpk-component-card/src/BpkCardWrapper.module.scss +61 -0
- package/bpk-component-datatable/README.md +5 -5
- package/bpk-component-datatable/src/BpkDataTable.js +4 -4
- package/bpk-component-datepicker/src/BpkDatepicker.js +1 -11
- package/bpk-component-flare/src/svgs/pointer.svg +1 -1
- package/bpk-component-icon/index.js +0 -4
- package/bpk-component-image/src/BpkBackgroundImage.js +2 -19
- package/bpk-component-image/src/BpkImage.js +2 -21
- package/bpk-component-input/index.js +2 -11
- package/bpk-component-link/src/BpkButtonLink.js +2 -7
- package/bpk-component-link/src/BpkLink.js +1 -7
- package/bpk-component-overlay/README.md +1 -2
- package/bpk-component-overlay/index.js +1 -2
- package/bpk-component-overlay/src/BpkOverlay.js +1 -14
- package/bpk-component-scrollable-calendar/src/BpkScrollableCalendarGridList.js +1 -6
- package/bpk-component-switch/index.js +2 -5
- package/bpk-component-switch/src/BpkSwitch.js +2 -17
- package/bpk-component-switch/src/BpkSwitch.module.scss +6 -13
- package/bpk-component-table/README.md +0 -1
- package/bpk-component-table/src/BpkTable.js +3 -13
- package/bpk-component-table/src/BpkTable.module.scss +0 -8
- package/bpk-component-table/src/BpkTableHeadCell.js +4 -9
- package/package.json +1 -1
- package/bpk-component-button/BpkButtonOutline.js +0 -21
- package/bpk-component-button/src/BpkButtonOutline.js +0 -46
- package/bpk-component-button/src/BpkButtonOutline.module.css +0 -18
- package/bpk-component-button/src/BpkButtonOutline.module.scss +0 -23
- package/bpk-component-grid/README.md +0 -89
- package/bpk-component-grid/index.js +0 -25
- package/bpk-component-grid/src/BpkGridColumn.js +0 -117
- package/bpk-component-grid/src/BpkGridColumn.module.css +0 -18
- package/bpk-component-grid/src/BpkGridColumn.module.scss +0 -73
- package/bpk-component-grid/src/BpkGridContainer.module.css +0 -18
- package/bpk-component-grid/src/BpkGridContainer.module.scss +0 -33
- package/bpk-component-grid/src/BpkGridRow.js +0 -56
- package/bpk-component-grid/src/BpkGridRow.module.css +0 -18
- package/bpk-component-grid/src/BpkGridRow.module.scss +0 -29
- package/bpk-component-image/src/customPropTypes.js +0 -37
|
@@ -22,7 +22,7 @@ import { createRef, Component } from 'react';
|
|
|
22
22
|
import BpkInput, { withOpenEvents } from '../../bpk-component-input';
|
|
23
23
|
import BpkModal from '../../bpk-component-modal';
|
|
24
24
|
import BpkPopover from '../../bpk-component-popover';
|
|
25
|
-
import { cssModules
|
|
25
|
+
import { cssModules } from '../../bpk-react-utils';
|
|
26
26
|
import BpkBreakpoint, { BREAKPOINTS } from '../../bpk-component-breakpoint';
|
|
27
27
|
import {
|
|
28
28
|
composeCalendar,
|
|
@@ -319,10 +319,6 @@ BpkDatepicker.propTypes = {
|
|
|
319
319
|
// Optional
|
|
320
320
|
calendarComponent: PropTypes.elementType,
|
|
321
321
|
inputComponent: PropTypes.elementType,
|
|
322
|
-
date: deprecated(
|
|
323
|
-
PropTypes.instanceOf(Date),
|
|
324
|
-
'Use selectionConfiguration to set date',
|
|
325
|
-
),
|
|
326
322
|
dateModifiers: CustomPropTypes.DateModifiers,
|
|
327
323
|
fixedWidth: PropTypes.bool,
|
|
328
324
|
inputProps: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
|
@@ -334,11 +330,6 @@ BpkDatepicker.propTypes = {
|
|
|
334
330
|
onOpenChange: PropTypes.func,
|
|
335
331
|
onMonthChange: PropTypes.func,
|
|
336
332
|
selectionConfiguration: CustomPropTypes.SelectionConfiguration,
|
|
337
|
-
// eslint-disable-next-line react/require-default-props
|
|
338
|
-
showWeekendSeparator: deprecated(
|
|
339
|
-
PropTypes.bool,
|
|
340
|
-
'The showWeekendSeparator prop in Week is now deprecated as no longer part of the calendar, so is no longer required',
|
|
341
|
-
),
|
|
342
333
|
initiallyFocusedDate: PropTypes.instanceOf(Date),
|
|
343
334
|
renderTarget: PropTypes.func,
|
|
344
335
|
isOpen: PropTypes.bool,
|
|
@@ -351,7 +342,6 @@ BpkDatepicker.propTypes = {
|
|
|
351
342
|
BpkDatepicker.defaultProps = {
|
|
352
343
|
calendarComponent: DefaultCalendar,
|
|
353
344
|
inputComponent: null,
|
|
354
|
-
date: null,
|
|
355
345
|
dateModifiers: DefaultCalendar.defaultProps.dateModifiers,
|
|
356
346
|
inputProps: {},
|
|
357
347
|
fixedWidth: true,
|
|
@@ -1 +1 @@
|
|
|
1
|
-
<svg viewBox="0 0 14832 55"><path d="
|
|
1
|
+
<svg viewBox="0 0 14832 55"><path d="m7501.307 8.517-68.043 39.341c-10.632 6.185-23.795 6.185-34.528 0l-68.144-39.34c-8.91-5.173-18.988-8.215-29.316-8.518H0v55h14832V0H7530.671a63.604 63.604 0 0 0-29.364 8.517z"/></svg>
|
|
@@ -36,11 +36,7 @@ function withLargeButtonAlignment(WrappedComponent) {
|
|
|
36
36
|
return withAlignment(WrappedComponent, buttonLargeLineHeight, iconSizeLg);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
-
// alias to maintain backwards compat, can be deprecated in due course
|
|
40
|
-
// alias to maintain backwards compat, can be deprecated in due course
|
|
41
39
|
export {
|
|
42
|
-
withButtonAlignment as alignToButton,
|
|
43
|
-
withLargeButtonAlignment as alignToLargeButton,
|
|
44
40
|
withButtonAlignment,
|
|
45
41
|
withLargeButtonAlignment,
|
|
46
42
|
withAlignment,
|
|
@@ -23,10 +23,9 @@ import PropTypes from 'prop-types';
|
|
|
23
23
|
import CSSTransition from 'react-transition-group/CSSTransition';
|
|
24
24
|
import { animations } from '@skyscanner/bpk-foundations-web/tokens/base.es6';
|
|
25
25
|
|
|
26
|
-
import { cssModules
|
|
26
|
+
import { cssModules } from '../../bpk-react-utils';
|
|
27
27
|
import { BpkSpinner } from '../../bpk-component-spinner';
|
|
28
28
|
|
|
29
|
-
import { widthHeightAspectRatioPropType } from './customPropTypes';
|
|
30
29
|
import STYLES from './BpkBackgroundImage.module.scss';
|
|
31
30
|
|
|
32
31
|
const getClassName = cssModules(STYLES);
|
|
@@ -34,11 +33,9 @@ const getClassName = cssModules(STYLES);
|
|
|
34
33
|
export type BpkBackgroundImageProps = {
|
|
35
34
|
children: Node,
|
|
36
35
|
aspectRatio: ?number,
|
|
37
|
-
height: ?number,
|
|
38
36
|
inView: boolean,
|
|
39
37
|
loading: boolean,
|
|
40
38
|
src: string,
|
|
41
|
-
width: ?number,
|
|
42
39
|
className: ?string,
|
|
43
40
|
onLoad: ?() => mixed,
|
|
44
41
|
style: ?{},
|
|
@@ -55,15 +52,7 @@ class BpkBackgroundImage extends Component<BpkBackgroundImageProps> {
|
|
|
55
52
|
onBackgroundImageLoad: () => mixed;
|
|
56
53
|
|
|
57
54
|
static propTypes = {
|
|
58
|
-
aspectRatio:
|
|
59
|
-
height: deprecated(
|
|
60
|
-
widthHeightAspectRatioPropType,
|
|
61
|
-
'Use "aspectRatio" instead of "width" and "height".',
|
|
62
|
-
),
|
|
63
|
-
width: deprecated(
|
|
64
|
-
widthHeightAspectRatioPropType,
|
|
65
|
-
'Use "aspectRatio" instead of "width" and "height".',
|
|
66
|
-
),
|
|
55
|
+
aspectRatio: PropTypes.number.isRequired,
|
|
67
56
|
src: PropTypes.string.isRequired,
|
|
68
57
|
className: PropTypes.string,
|
|
69
58
|
inView: PropTypes.bool,
|
|
@@ -74,9 +63,6 @@ class BpkBackgroundImage extends Component<BpkBackgroundImageProps> {
|
|
|
74
63
|
};
|
|
75
64
|
|
|
76
65
|
static defaultProps = {
|
|
77
|
-
width: null,
|
|
78
|
-
height: null,
|
|
79
|
-
aspectRatio: null,
|
|
80
66
|
className: null,
|
|
81
67
|
inView: true,
|
|
82
68
|
loading: false,
|
|
@@ -113,9 +99,6 @@ class BpkBackgroundImage extends Component<BpkBackgroundImageProps> {
|
|
|
113
99
|
if (this.props.aspectRatio) {
|
|
114
100
|
return this.props.aspectRatio;
|
|
115
101
|
}
|
|
116
|
-
if (this.props.width && this.props.height) {
|
|
117
|
-
return this.props.width / this.props.height;
|
|
118
|
-
}
|
|
119
102
|
return 1;
|
|
120
103
|
};
|
|
121
104
|
|
|
@@ -23,10 +23,9 @@ import PropTypes from 'prop-types';
|
|
|
23
23
|
import CSSTransition from 'react-transition-group/CSSTransition';
|
|
24
24
|
import { animations } from '@skyscanner/bpk-foundations-web/tokens/base.es6';
|
|
25
25
|
|
|
26
|
-
import { cssModules
|
|
26
|
+
import { cssModules } from '../../bpk-react-utils';
|
|
27
27
|
import { BpkSpinner } from '../../bpk-component-spinner';
|
|
28
28
|
|
|
29
|
-
import { widthHeightAspectRatioPropType } from './customPropTypes';
|
|
30
29
|
import STYLES from './BpkImage.module.scss';
|
|
31
30
|
import BORDER_RADIUS_STYLES from './BpkImageBorderRadiusStyles';
|
|
32
31
|
|
|
@@ -93,11 +92,9 @@ class Image extends Component<ImageProps> {
|
|
|
93
92
|
type BpkImageProps = {
|
|
94
93
|
altText: string,
|
|
95
94
|
aspectRatio: ?number,
|
|
96
|
-
height: ?number,
|
|
97
95
|
inView: boolean,
|
|
98
96
|
loading: boolean,
|
|
99
97
|
src: string,
|
|
100
|
-
width: ?number,
|
|
101
98
|
borderRadiusStyle: $Keys<typeof BORDER_RADIUS_STYLES>,
|
|
102
99
|
className: ?string,
|
|
103
100
|
onLoad: ?() => mixed,
|
|
@@ -113,7 +110,7 @@ class BpkImage extends Component<BpkImageProps> {
|
|
|
113
110
|
static propTypes = {
|
|
114
111
|
altText: PropTypes.string.isRequired,
|
|
115
112
|
src: PropTypes.string.isRequired,
|
|
116
|
-
aspectRatio:
|
|
113
|
+
aspectRatio: PropTypes.number.isRequired,
|
|
117
114
|
borderRadiusStyle: PropTypes.oneOf(Object.keys(BORDER_RADIUS_STYLES)),
|
|
118
115
|
className: PropTypes.string,
|
|
119
116
|
inView: PropTypes.bool,
|
|
@@ -121,27 +118,16 @@ class BpkImage extends Component<BpkImageProps> {
|
|
|
121
118
|
onLoad: PropTypes.func,
|
|
122
119
|
style: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
|
123
120
|
suppressHydrationWarning: PropTypes.bool,
|
|
124
|
-
height: deprecated(
|
|
125
|
-
widthHeightAspectRatioPropType,
|
|
126
|
-
'Use "aspectRatio" instead of "width" and "height".',
|
|
127
|
-
),
|
|
128
|
-
width: deprecated(
|
|
129
|
-
widthHeightAspectRatioPropType,
|
|
130
|
-
'Use "aspectRatio" instead of "width" and "height".',
|
|
131
|
-
),
|
|
132
121
|
};
|
|
133
122
|
|
|
134
123
|
static defaultProps = {
|
|
135
|
-
aspectRatio: null,
|
|
136
124
|
borderRadiusStyle: BORDER_RADIUS_STYLES.none,
|
|
137
125
|
className: null,
|
|
138
|
-
height: null,
|
|
139
126
|
inView: true,
|
|
140
127
|
loading: false,
|
|
141
128
|
onLoad: null,
|
|
142
129
|
style: {},
|
|
143
130
|
suppressHydrationWarning: false,
|
|
144
|
-
width: null,
|
|
145
131
|
};
|
|
146
132
|
|
|
147
133
|
onImageLoad = (): void => {
|
|
@@ -154,9 +140,6 @@ class BpkImage extends Component<BpkImageProps> {
|
|
|
154
140
|
if (this.props.aspectRatio) {
|
|
155
141
|
return this.props.aspectRatio;
|
|
156
142
|
}
|
|
157
|
-
if (this.props.width && this.props.height) {
|
|
158
|
-
return this.props.width / this.props.height;
|
|
159
|
-
}
|
|
160
143
|
return 1;
|
|
161
144
|
};
|
|
162
145
|
|
|
@@ -166,12 +149,10 @@ class BpkImage extends Component<BpkImageProps> {
|
|
|
166
149
|
aspectRatio,
|
|
167
150
|
borderRadiusStyle,
|
|
168
151
|
className,
|
|
169
|
-
height,
|
|
170
152
|
inView,
|
|
171
153
|
loading,
|
|
172
154
|
onLoad,
|
|
173
155
|
style,
|
|
174
|
-
width,
|
|
175
156
|
...rest
|
|
176
157
|
} = this.props;
|
|
177
158
|
|
|
@@ -23,28 +23,19 @@ import {
|
|
|
23
23
|
propTypes,
|
|
24
24
|
defaultProps,
|
|
25
25
|
CLEAR_BUTTON_MODES,
|
|
26
|
-
INPUT_TYPES
|
|
26
|
+
INPUT_TYPES,
|
|
27
27
|
type Props,
|
|
28
28
|
} from './src/common-types';
|
|
29
29
|
import themeAttributes from './src/themeAttributes';
|
|
30
30
|
|
|
31
31
|
export default BpkInput;
|
|
32
32
|
|
|
33
|
-
// TODO: Remove these in the next major
|
|
34
|
-
const DEPRECATED_INPUT_TYPES = {
|
|
35
|
-
TEXT: 'text',
|
|
36
|
-
EMAIL: 'email',
|
|
37
|
-
NUMBER: 'number',
|
|
38
|
-
PASSWORD: 'password',
|
|
39
|
-
TEL: 'tel',
|
|
40
|
-
};
|
|
41
|
-
|
|
42
33
|
export type BpkInputProps = Props;
|
|
43
|
-
export const INPUT_TYPES = { ...DEPRECATED_INPUT_TYPES, ...TYPES };
|
|
44
34
|
export {
|
|
45
35
|
propTypes,
|
|
46
36
|
defaultProps,
|
|
47
37
|
withOpenEvents,
|
|
38
|
+
INPUT_TYPES,
|
|
48
39
|
CLEAR_BUTTON_MODES,
|
|
49
40
|
themeAttributes,
|
|
50
41
|
};
|
|
@@ -32,15 +32,14 @@ type Props = {
|
|
|
32
32
|
children: Node,
|
|
33
33
|
className: ?string,
|
|
34
34
|
onClick: (event: SyntheticEvent<>) => mixed,
|
|
35
|
-
white: boolean,
|
|
36
35
|
alternate: boolean,
|
|
37
36
|
};
|
|
38
37
|
|
|
39
38
|
const BpkButtonLink = (props: Props) => {
|
|
40
|
-
const { alternate, children, className, onClick,
|
|
39
|
+
const { alternate, children, className, onClick, ...rest } = props;
|
|
41
40
|
const classNames = [getClassName('bpk-link')];
|
|
42
41
|
|
|
43
|
-
if (
|
|
42
|
+
if (alternate) {
|
|
44
43
|
classNames.push(getClassName('bpk-link--alternate'));
|
|
45
44
|
}
|
|
46
45
|
if (className) {
|
|
@@ -65,15 +64,11 @@ BpkButtonLink.propTypes = {
|
|
|
65
64
|
children: PropTypes.node.isRequired,
|
|
66
65
|
className: PropTypes.string,
|
|
67
66
|
alternate: PropTypes.bool,
|
|
68
|
-
// DEPRECATED
|
|
69
|
-
white: PropTypes.bool,
|
|
70
67
|
};
|
|
71
68
|
|
|
72
69
|
BpkButtonLink.defaultProps = {
|
|
73
70
|
className: null,
|
|
74
71
|
alternate: false,
|
|
75
|
-
// DEPRECATED
|
|
76
|
-
white: false,
|
|
77
72
|
};
|
|
78
73
|
|
|
79
74
|
export { themeAttributes };
|
|
@@ -38,7 +38,6 @@ type Props = {
|
|
|
38
38
|
blank: boolean,
|
|
39
39
|
rel: ?string,
|
|
40
40
|
alternate: boolean,
|
|
41
|
-
white: boolean,
|
|
42
41
|
};
|
|
43
42
|
|
|
44
43
|
const BpkLink = (props: Props) => {
|
|
@@ -50,7 +49,6 @@ const BpkLink = (props: Props) => {
|
|
|
50
49
|
href,
|
|
51
50
|
onClick,
|
|
52
51
|
rel: propRel,
|
|
53
|
-
white,
|
|
54
52
|
...rest
|
|
55
53
|
} = props;
|
|
56
54
|
|
|
@@ -59,7 +57,7 @@ const BpkLink = (props: Props) => {
|
|
|
59
57
|
const target = blank ? '_blank' : null;
|
|
60
58
|
const rel = blank ? propRel || 'noopener noreferrer' : propRel;
|
|
61
59
|
|
|
62
|
-
if (
|
|
60
|
+
if (alternate) {
|
|
63
61
|
classNames.push(getClassName('bpk-link--alternate'));
|
|
64
62
|
}
|
|
65
63
|
if (className) {
|
|
@@ -92,8 +90,6 @@ BpkLink.propTypes = {
|
|
|
92
90
|
blank: PropTypes.bool,
|
|
93
91
|
rel: PropTypes.string,
|
|
94
92
|
alternate: PropTypes.bool,
|
|
95
|
-
// DEPRECATED
|
|
96
|
-
white: PropTypes.bool,
|
|
97
93
|
};
|
|
98
94
|
|
|
99
95
|
BpkLink.defaultProps = {
|
|
@@ -102,8 +98,6 @@ BpkLink.defaultProps = {
|
|
|
102
98
|
blank: false,
|
|
103
99
|
rel: null,
|
|
104
100
|
alternate: false,
|
|
105
|
-
// DEPRECATED
|
|
106
|
-
white: false,
|
|
107
101
|
};
|
|
108
102
|
|
|
109
103
|
export default BpkLink;
|
|
@@ -10,7 +10,7 @@ Check the main [Readme](https://github.com/skyscanner/backpack#usage) for a comp
|
|
|
10
10
|
|
|
11
11
|
```js
|
|
12
12
|
import BpkText from '@skyscanner/backpack-web/bpk-component-text';
|
|
13
|
-
import BpkOverlay, {
|
|
13
|
+
import BpkOverlay, { OVERLAY_TYPES } from '@skyscanner/backpack-web/bpk-component-overlay';
|
|
14
14
|
|
|
15
15
|
export default () => (
|
|
16
16
|
<div>
|
|
@@ -43,7 +43,6 @@ export default () => (
|
|
|
43
43
|
| Property | PropType | Required | Default Value |
|
|
44
44
|
| --------- | -------- | -------- | ------------- |
|
|
45
45
|
| children | Node | true | - |
|
|
46
|
-
| borderRadiusStyle (deprecated) | BORDER_RADIUS_STYLES | false | BORDER_RADIUS_STYLES.none |
|
|
47
46
|
| className | string | false | null |
|
|
48
47
|
| foregroundContent | Node | false | null |
|
|
49
48
|
| overlayType | oneOf(OVERLAY_TYPES) | false | OVERLAY_TYPES.solid |
|
|
@@ -20,10 +20,9 @@
|
|
|
20
20
|
import BpkOverlay, {
|
|
21
21
|
OVERLAY_TYPES,
|
|
22
22
|
OVERLAY_LEVELS,
|
|
23
|
-
BORDER_RADIUS_STYLES,
|
|
24
23
|
type Props as BpkOverlayProps,
|
|
25
24
|
} from './src/BpkOverlay';
|
|
26
25
|
|
|
27
26
|
export type { BpkOverlayProps };
|
|
28
27
|
export default BpkOverlay;
|
|
29
|
-
export { OVERLAY_TYPES, OVERLAY_LEVELS
|
|
28
|
+
export { OVERLAY_TYPES, OVERLAY_LEVELS };
|
|
@@ -20,7 +20,7 @@
|
|
|
20
20
|
import PropTypes from 'prop-types';
|
|
21
21
|
import type { Node } from 'react';
|
|
22
22
|
|
|
23
|
-
import { cssModules
|
|
23
|
+
import { cssModules } from '../../bpk-react-utils';
|
|
24
24
|
|
|
25
25
|
import STYLES from './BpkOverlay.module.scss';
|
|
26
26
|
|
|
@@ -42,14 +42,7 @@ export const OVERLAY_LEVELS = {
|
|
|
42
42
|
off: 'off',
|
|
43
43
|
};
|
|
44
44
|
|
|
45
|
-
// DEPRECATED
|
|
46
|
-
export const BORDER_RADIUS_STYLES = {
|
|
47
|
-
none: 'none',
|
|
48
|
-
sm: 'sm',
|
|
49
|
-
};
|
|
50
|
-
|
|
51
45
|
export type Props = {
|
|
52
|
-
borderRadiusStyle: ?$Keys<typeof BORDER_RADIUS_STYLES>,
|
|
53
46
|
children: Node,
|
|
54
47
|
overlayType: ?$Keys<typeof OVERLAY_TYPES>,
|
|
55
48
|
overlayLevel: ?$Keys<typeof OVERLAY_LEVELS>,
|
|
@@ -59,7 +52,6 @@ export type Props = {
|
|
|
59
52
|
|
|
60
53
|
const BpkOverlay = (props: Props) => {
|
|
61
54
|
const {
|
|
62
|
-
borderRadiusStyle,
|
|
63
55
|
children,
|
|
64
56
|
className,
|
|
65
57
|
foregroundContent,
|
|
@@ -88,10 +80,6 @@ const BpkOverlay = (props: Props) => {
|
|
|
88
80
|
|
|
89
81
|
BpkOverlay.propTypes = {
|
|
90
82
|
children: PropTypes.node.isRequired,
|
|
91
|
-
borderRadiusStyle: deprecated(
|
|
92
|
-
PropTypes.oneOf(Object.keys(BORDER_RADIUS_STYLES)),
|
|
93
|
-
'This property is deprecated and radius will now be set based on the content. Please remove usage of this property.',
|
|
94
|
-
),
|
|
95
83
|
className: PropTypes.string,
|
|
96
84
|
foregroundContent: PropTypes.node,
|
|
97
85
|
overlayType: PropTypes.oneOf(Object.keys(OVERLAY_TYPES)),
|
|
@@ -99,7 +87,6 @@ BpkOverlay.propTypes = {
|
|
|
99
87
|
};
|
|
100
88
|
|
|
101
89
|
BpkOverlay.defaultProps = {
|
|
102
|
-
borderRadiusStyle: null,
|
|
103
90
|
className: null,
|
|
104
91
|
foregroundContent: null,
|
|
105
92
|
overlayType: OVERLAY_TYPES.solid,
|
|
@@ -21,7 +21,7 @@ import { Component } from 'react';
|
|
|
21
21
|
import { startOfDay, startOfMonth } from 'date-fns';
|
|
22
22
|
import { VariableSizeList as List } from 'react-window';
|
|
23
23
|
|
|
24
|
-
import { cssModules
|
|
24
|
+
import { cssModules } from '../../bpk-react-utils';
|
|
25
25
|
import {
|
|
26
26
|
DateUtils,
|
|
27
27
|
BpkCalendarGridPropTypes,
|
|
@@ -174,10 +174,6 @@ BpkScrollableCalendarGridList.propTypes = {
|
|
|
174
174
|
className: PropTypes.string,
|
|
175
175
|
minDate: PropTypes.instanceOf(Date).isRequired,
|
|
176
176
|
maxDate: PropTypes.instanceOf(Date).isRequired,
|
|
177
|
-
selectedDate: deprecated(
|
|
178
|
-
PropTypes.instanceOf(Date),
|
|
179
|
-
'Use selectionConfiguration to set selectedDate',
|
|
180
|
-
),
|
|
181
177
|
focusedDate: PropTypes.instanceOf(Date),
|
|
182
178
|
...BpkCalendarGridPropTypes,
|
|
183
179
|
};
|
|
@@ -185,7 +181,6 @@ BpkScrollableCalendarGridList.propTypes = {
|
|
|
185
181
|
BpkScrollableCalendarGridList.defaultProps = {
|
|
186
182
|
className: null,
|
|
187
183
|
focusedDate: null,
|
|
188
|
-
selectedDate: null,
|
|
189
184
|
};
|
|
190
185
|
|
|
191
186
|
export default BpkScrollableCalendarGridList;
|
|
@@ -17,12 +17,9 @@
|
|
|
17
17
|
*/
|
|
18
18
|
/* @flow strict */
|
|
19
19
|
|
|
20
|
-
import BpkSwitch, {
|
|
21
|
-
type Props as BpkSwitchProps,
|
|
22
|
-
SWITCH_TYPES,
|
|
23
|
-
} from './src/BpkSwitch';
|
|
20
|
+
import BpkSwitch, { type Props as BpkSwitchProps } from './src/BpkSwitch';
|
|
24
21
|
import themeAttributes from './src/themeAttributes';
|
|
25
22
|
|
|
26
23
|
export type { BpkSwitchProps };
|
|
27
|
-
export { themeAttributes
|
|
24
|
+
export { themeAttributes };
|
|
28
25
|
export default BpkSwitch;
|
|
@@ -20,32 +20,22 @@
|
|
|
20
20
|
import PropTypes from 'prop-types';
|
|
21
21
|
import type { Node } from 'react';
|
|
22
22
|
|
|
23
|
-
import { cssModules
|
|
23
|
+
import { cssModules } from '../../bpk-react-utils';
|
|
24
24
|
|
|
25
25
|
import STYLES from './BpkSwitch.module.scss';
|
|
26
26
|
|
|
27
27
|
const getClassName = cssModules(STYLES);
|
|
28
28
|
|
|
29
|
-
export const SWITCH_TYPES = {
|
|
30
|
-
primary: 'primary',
|
|
31
|
-
event: 'event',
|
|
32
|
-
};
|
|
33
|
-
|
|
34
|
-
export type SwitchTypeValue = $Values<typeof SWITCH_TYPES>;
|
|
35
|
-
|
|
36
29
|
export type Props = {
|
|
37
30
|
label: Node,
|
|
38
|
-
type: SwitchTypeValue,
|
|
39
31
|
className: ?string,
|
|
40
32
|
};
|
|
41
33
|
|
|
42
34
|
const BpkSwitch = (props: Props) => {
|
|
43
|
-
const { className, label, small,
|
|
44
|
-
const resolvedType = type || SWITCH_TYPES.primary;
|
|
35
|
+
const { className, label, small, ...rest } = props;
|
|
45
36
|
|
|
46
37
|
const switchClassNames = getClassName(
|
|
47
38
|
'bpk-switch__switch',
|
|
48
|
-
`bpk-switch__switch--${resolvedType}`,
|
|
49
39
|
small && 'bpk-switch__switch--small',
|
|
50
40
|
);
|
|
51
41
|
|
|
@@ -68,17 +58,12 @@ const BpkSwitch = (props: Props) => {
|
|
|
68
58
|
|
|
69
59
|
BpkSwitch.propTypes = {
|
|
70
60
|
label: PropTypes.node.isRequired,
|
|
71
|
-
type: deprecated(
|
|
72
|
-
PropTypes.oneOf([SWITCH_TYPES.primary, SWITCH_TYPES.event]),
|
|
73
|
-
'This property is deprecated and only one type supported, please remove your usage of this property',
|
|
74
|
-
),
|
|
75
61
|
className: PropTypes.string,
|
|
76
62
|
small: PropTypes.bool,
|
|
77
63
|
};
|
|
78
64
|
|
|
79
65
|
BpkSwitch.defaultProps = {
|
|
80
66
|
className: null,
|
|
81
|
-
type: null,
|
|
82
67
|
small: false,
|
|
83
68
|
};
|
|
84
69
|
|
|
@@ -34,18 +34,11 @@ $border-width: $bpk-one-pixel-rem * 2;
|
|
|
34
34
|
opacity: 0;
|
|
35
35
|
|
|
36
36
|
&:checked ~ .bpk-switch__switch {
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
);
|
|
43
|
-
}
|
|
44
|
-
|
|
45
|
-
// This is now deprecated and will be removed in the future.
|
|
46
|
-
&--event {
|
|
47
|
-
background: $bpk-color-abisko;
|
|
48
|
-
}
|
|
37
|
+
@include bpk-themeable-property(
|
|
38
|
+
background,
|
|
39
|
+
--bpk-switch-checked-color,
|
|
40
|
+
$bpk-core-accent-day
|
|
41
|
+
);
|
|
49
42
|
|
|
50
43
|
&::before {
|
|
51
44
|
left: ($width - $height) + $border-width;
|
|
@@ -54,8 +47,8 @@ $border-width: $bpk-one-pixel-rem * 2;
|
|
|
54
47
|
}
|
|
55
48
|
|
|
56
49
|
&__label {
|
|
57
|
-
margin-right: bpk-spacing-md();
|
|
58
50
|
line-height: $height;
|
|
51
|
+
margin-inline-end: bpk-spacing-md();
|
|
59
52
|
}
|
|
60
53
|
|
|
61
54
|
// The 'track'.
|
|
@@ -21,7 +21,7 @@
|
|
|
21
21
|
import PropTypes from 'prop-types';
|
|
22
22
|
import type { Node } from 'react';
|
|
23
23
|
|
|
24
|
-
import { cssModules
|
|
24
|
+
import { cssModules } from '../../bpk-react-utils';
|
|
25
25
|
|
|
26
26
|
import STYLES from './BpkTable.module.scss';
|
|
27
27
|
|
|
@@ -30,17 +30,12 @@ const getClassName = cssModules(STYLES);
|
|
|
30
30
|
type Props = {
|
|
31
31
|
children: Node,
|
|
32
32
|
className: ?string,
|
|
33
|
-
alternate: ?boolean,
|
|
34
33
|
};
|
|
35
34
|
|
|
36
35
|
const BpkTable = (props: Props) => {
|
|
37
|
-
const {
|
|
36
|
+
const { children, className, ...rest } = props;
|
|
38
37
|
|
|
39
|
-
const classNames = getClassName(
|
|
40
|
-
'bpk-table',
|
|
41
|
-
className,
|
|
42
|
-
alternate && 'bpk-table--alternate',
|
|
43
|
-
);
|
|
38
|
+
const classNames = getClassName('bpk-table', className);
|
|
44
39
|
|
|
45
40
|
return (
|
|
46
41
|
// $FlowFixMe[cannot-spread-inexact] - inexact rest. See decisions/flowfixme.md
|
|
@@ -53,15 +48,10 @@ const BpkTable = (props: Props) => {
|
|
|
53
48
|
BpkTable.propTypes = {
|
|
54
49
|
children: PropTypes.node.isRequired,
|
|
55
50
|
className: PropTypes.string,
|
|
56
|
-
alternate: deprecated(
|
|
57
|
-
PropTypes.bool,
|
|
58
|
-
'Alternate prop is deprecated, please remove your usage of this property.',
|
|
59
|
-
),
|
|
60
51
|
};
|
|
61
52
|
|
|
62
53
|
BpkTable.defaultProps = {
|
|
63
54
|
className: null,
|
|
64
|
-
alternate: null,
|
|
65
55
|
};
|
|
66
56
|
|
|
67
57
|
export default BpkTable;
|
|
@@ -21,19 +21,11 @@
|
|
|
21
21
|
.bpk-table {
|
|
22
22
|
@include bpk-table;
|
|
23
23
|
|
|
24
|
-
&--alternate {
|
|
25
|
-
@include bpk-table--alternate;
|
|
26
|
-
}
|
|
27
|
-
|
|
28
24
|
&__cell {
|
|
29
25
|
@include bpk-table__cell;
|
|
30
26
|
|
|
31
27
|
&--head {
|
|
32
28
|
@include bpk-table__cell--head;
|
|
33
29
|
}
|
|
34
|
-
|
|
35
|
-
&--head-alternate {
|
|
36
|
-
@include bpk-table__cell--head-alternate;
|
|
37
|
-
}
|
|
38
30
|
}
|
|
39
31
|
}
|
|
@@ -21,20 +21,20 @@
|
|
|
21
21
|
import PropTypes from 'prop-types';
|
|
22
22
|
import type { Node } from 'react';
|
|
23
23
|
|
|
24
|
-
import { cssModules
|
|
24
|
+
import { cssModules } from '../../bpk-react-utils';
|
|
25
25
|
|
|
26
26
|
import STYLES from './BpkTable.module.scss';
|
|
27
27
|
|
|
28
28
|
const getClassName = cssModules(STYLES);
|
|
29
29
|
|
|
30
|
-
type Props = { children: Node,
|
|
30
|
+
type Props = { children: Node, className: ?string };
|
|
31
31
|
|
|
32
32
|
const BpkTableHeadCell = (props: Props) => {
|
|
33
|
-
const {
|
|
33
|
+
const { className, ...rest } = props;
|
|
34
34
|
|
|
35
35
|
const classNames = getClassName(
|
|
36
36
|
'bpk-table__cell',
|
|
37
|
-
|
|
37
|
+
'bpk-table__cell--head',
|
|
38
38
|
className,
|
|
39
39
|
);
|
|
40
40
|
|
|
@@ -43,15 +43,10 @@ const BpkTableHeadCell = (props: Props) => {
|
|
|
43
43
|
|
|
44
44
|
BpkTableHeadCell.propTypes = {
|
|
45
45
|
children: PropTypes.node.isRequired,
|
|
46
|
-
alternate: deprecated(
|
|
47
|
-
PropTypes.bool,
|
|
48
|
-
'Alternate prop is deprecated, please remove your usage of this property.',
|
|
49
|
-
),
|
|
50
46
|
className: PropTypes.string,
|
|
51
47
|
};
|
|
52
48
|
|
|
53
49
|
BpkTableHeadCell.defaultProps = {
|
|
54
|
-
alternate: null,
|
|
55
50
|
className: null,
|
|
56
51
|
};
|
|
57
52
|
|
package/package.json
CHANGED
|
@@ -1,21 +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
|
-
/* @flow strict */
|
|
20
|
-
|
|
21
|
-
export { default } from './src/BpkButtonOutline';
|