@skyscanner/backpack-web 19.0.0 → 20.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/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-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.js +0 -61
- 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
package/README.md
CHANGED
|
@@ -48,7 +48,6 @@ To contribute please see [contributing.md](CONTRIBUTING.md).
|
|
|
48
48
|
[`bpk-component-fieldset`](/packages/bpk-component-fieldset)
|
|
49
49
|
[`bpk-component-form-validation`](/packages/bpk-component-form-validation)
|
|
50
50
|
[`bpk-component-graphic-promotion`](/packages/bpk-component-graphic-promotion)
|
|
51
|
-
[`bpk-component-grid`](/packages/bpk-component-grid)
|
|
52
51
|
[`bpk-component-grid-toggle`](/packages/bpk-component-grid-toggle)
|
|
53
52
|
[`bpk-component-horizontal-nav`](/packages/bpk-component-horizontal-nav)
|
|
54
53
|
[`bpk-component-icon`](/packages/bpk-component-icon)
|
|
@@ -58,10 +58,6 @@ $bpk-spacing-v2: true;
|
|
|
58
58
|
@include bpk-border-sm($bpk-banner-alert-neutral-color, '');
|
|
59
59
|
}
|
|
60
60
|
|
|
61
|
-
&--event {
|
|
62
|
-
@include bpk-border-sm($bpk-banner-alert-event-color, '');
|
|
63
|
-
}
|
|
64
|
-
|
|
65
61
|
&__header {
|
|
66
62
|
display: flex;
|
|
67
63
|
padding: bpk-spacing-md();
|
|
@@ -129,10 +125,6 @@ $bpk-spacing-v2: true;
|
|
|
129
125
|
fill: $bpk-text-secondary-day;
|
|
130
126
|
}
|
|
131
127
|
|
|
132
|
-
&__event-icon {
|
|
133
|
-
fill: $bpk-banner-alert-event-color;
|
|
134
|
-
}
|
|
135
|
-
|
|
136
128
|
&__toggle-button {
|
|
137
129
|
padding: 0;
|
|
138
130
|
border: 0;
|
|
@@ -65,7 +65,6 @@ const getIconForType = (
|
|
|
65
65
|
[ALERT_TYPES.WARN]: getClassName('bpk-banner-alert__warn-icon'),
|
|
66
66
|
[ALERT_TYPES.ERROR]: getClassName('bpk-banner-alert__error-icon'),
|
|
67
67
|
[ALERT_TYPES.NEUTRAL]: getClassName('bpk-banner-alert__neutral-icon'),
|
|
68
|
-
[ALERT_TYPES.EVENT]: getClassName('bpk-banner-alert__event-icon'),
|
|
69
68
|
};
|
|
70
69
|
const className = classMap[type];
|
|
71
70
|
const componentMap: { [AlertTypeValue]: Node } = {
|
|
@@ -74,7 +73,6 @@ const getIconForType = (
|
|
|
74
73
|
[ALERT_TYPES.WARN]: InfoCircleIcon,
|
|
75
74
|
[ALERT_TYPES.ERROR]: InfoCircleIcon,
|
|
76
75
|
[ALERT_TYPES.NEUTRAL]: InfoCircleIcon,
|
|
77
|
-
[ALERT_TYPES.EVENT]: InfoCircleIcon,
|
|
78
76
|
};
|
|
79
77
|
const Icon = CustomIcon || componentMap[type];
|
|
80
78
|
const AlignedIcon = withButtonAlignment(Icon);
|
|
@@ -25,7 +25,6 @@ export const ALERT_TYPES = {
|
|
|
25
25
|
WARN: 'warn',
|
|
26
26
|
ERROR: 'error',
|
|
27
27
|
NEUTRAL: 'neutral',
|
|
28
|
-
EVENT: 'event', // DEPRECATED
|
|
29
28
|
};
|
|
30
29
|
|
|
31
30
|
export type AlertTypeValue = $Values<typeof ALERT_TYPES>;
|
|
@@ -45,14 +44,7 @@ export type OnDismissHandler = ?() => void;
|
|
|
45
44
|
export type OnHideHandler = ?() => void;
|
|
46
45
|
|
|
47
46
|
export const COMMON_PROP_TYPES = {
|
|
48
|
-
type: PropTypes.oneOf(
|
|
49
|
-
ALERT_TYPES.PRIMARY,
|
|
50
|
-
ALERT_TYPES.SUCCESS,
|
|
51
|
-
ALERT_TYPES.WARN,
|
|
52
|
-
ALERT_TYPES.ERROR,
|
|
53
|
-
ALERT_TYPES.NEUTRAL,
|
|
54
|
-
ALERT_TYPES.EVENT,
|
|
55
|
-
]).isRequired,
|
|
47
|
+
type: PropTypes.oneOf(Object.values(ALERT_TYPES)).isRequired,
|
|
56
48
|
message: PropTypes.node.isRequired,
|
|
57
49
|
animateOnEnter: PropTypes.bool,
|
|
58
50
|
animateOnLeave: PropTypes.bool,
|
|
@@ -23,7 +23,6 @@ export default () => (
|
|
|
23
23
|
<BpkButton secondaryOnDark>SecondaryOnDark</BpkButton>
|
|
24
24
|
<BpkButton link>Link</BpkButton>
|
|
25
25
|
<BpkButton linkOnDark>LinkOnDark</BpkButton>
|
|
26
|
-
<BpkButton outline>Outline (Deprecated, use PrimaryOnDark or PrimaryOnLight instead)</BpkButton>
|
|
27
26
|
<BpkButton primaryOnDark>PrimaryOnDark</BpkButton>
|
|
28
27
|
<BpkButton primaryOnLight>PrimaryOnLight</BpkButton>
|
|
29
28
|
<BpkButton iconOnly>
|
|
@@ -43,7 +42,6 @@ export default () => (
|
|
|
43
42
|
| featured | bool | false | false |
|
|
44
43
|
| link | bool | false | false |
|
|
45
44
|
| linkOnDark | bool | false | false |
|
|
46
|
-
| outline | bool (deprecated) | false | false |
|
|
47
45
|
| secondary | bool | false | false |
|
|
48
46
|
| secondaryOnDark | bool | false | false |
|
|
49
47
|
| primaryOnDark | bool | false | false |
|
|
@@ -28,7 +28,6 @@ import BpkButtonDestructive from './src/BpkButtonDestructive';
|
|
|
28
28
|
import BpkButtonLink from './src/BpkButtonLink';
|
|
29
29
|
import BpkButtonLinkOnDark from './src/BpkButtonLinkOnDark';
|
|
30
30
|
import BpkButtonFeatured from './src/BpkButtonFeatured';
|
|
31
|
-
import BpkButtonOutline from './src/BpkButtonOutline';
|
|
32
31
|
|
|
33
32
|
export {
|
|
34
33
|
buttonThemeAttributes,
|
|
@@ -53,5 +52,4 @@ export {
|
|
|
53
52
|
BpkButtonLink,
|
|
54
53
|
BpkButtonLinkOnDark,
|
|
55
54
|
BpkButtonFeatured,
|
|
56
|
-
BpkButtonOutline,
|
|
57
55
|
};
|
|
@@ -31,7 +31,6 @@ import {
|
|
|
31
31
|
BpkButtonLink,
|
|
32
32
|
BpkButtonLinkOnDark,
|
|
33
33
|
BpkButtonFeatured,
|
|
34
|
-
BpkButtonOutline,
|
|
35
34
|
} from '../index';
|
|
36
35
|
|
|
37
36
|
import {
|
|
@@ -48,7 +47,6 @@ type Props = {
|
|
|
48
47
|
secondaryOnDark: boolean,
|
|
49
48
|
destructive: boolean,
|
|
50
49
|
featured: boolean,
|
|
51
|
-
outline: boolean,
|
|
52
50
|
link: boolean,
|
|
53
51
|
linkOnDark: boolean,
|
|
54
52
|
};
|
|
@@ -59,7 +57,6 @@ const BpkButton = (props: Props) => {
|
|
|
59
57
|
featured,
|
|
60
58
|
link,
|
|
61
59
|
linkOnDark,
|
|
62
|
-
outline,
|
|
63
60
|
primaryOnDark,
|
|
64
61
|
primaryOnLight,
|
|
65
62
|
secondary,
|
|
@@ -87,9 +84,6 @@ const BpkButton = (props: Props) => {
|
|
|
87
84
|
if (featured) {
|
|
88
85
|
return <BpkButtonFeatured {...rest} />;
|
|
89
86
|
}
|
|
90
|
-
if (outline) {
|
|
91
|
-
return <BpkButtonOutline {...rest} />;
|
|
92
|
-
}
|
|
93
87
|
if (link) {
|
|
94
88
|
return <BpkButtonLink {...rest} />;
|
|
95
89
|
}
|
|
@@ -107,7 +101,6 @@ BpkButton.propTypes = {
|
|
|
107
101
|
secondaryOnDark: PropTypes.bool,
|
|
108
102
|
destructive: PropTypes.bool,
|
|
109
103
|
featured: PropTypes.bool,
|
|
110
|
-
outline: PropTypes.bool,
|
|
111
104
|
link: PropTypes.bool,
|
|
112
105
|
linkOnDark: PropTypes.bool,
|
|
113
106
|
};
|
|
@@ -120,7 +113,6 @@ BpkButton.defaultProps = {
|
|
|
120
113
|
secondaryOnDark: false,
|
|
121
114
|
destructive: false,
|
|
122
115
|
featured: false,
|
|
123
|
-
outline: false,
|
|
124
116
|
link: false,
|
|
125
117
|
linkOnDark: false,
|
|
126
118
|
};
|
|
@@ -373,7 +373,7 @@ const onMonthChange = (event, {
|
|
|
373
373
|
|
|
374
374
|
#### initiallyFocusedDate
|
|
375
375
|
|
|
376
|
-
Sets the date that is focused initially, this prop has no effect if `
|
|
376
|
+
Sets the date that is focused initially, this prop has no effect if `selectionConfiguration` is specified in which case the date specified in this prop is focused. If no selected date is set and `initiallyFocusedDate` is not set the focused date is the `minDate`(defaults to today if it has not been explicitly set).
|
|
377
377
|
|
|
378
378
|
#### navProps, headerProps, gridProps, dateProps
|
|
379
379
|
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
import PropTypes from 'prop-types';
|
|
20
20
|
import { Component } from 'react';
|
|
21
21
|
|
|
22
|
-
import {
|
|
22
|
+
import { isRTL } from '../../bpk-react-utils';
|
|
23
23
|
|
|
24
24
|
import CustomPropTypes, { CALENDAR_SELECTION_TYPE } from './custom-proptypes';
|
|
25
25
|
import BpkCalendarNav from './BpkCalendarNav';
|
|
@@ -287,13 +287,8 @@ const withCalendarState = (Calendar) => {
|
|
|
287
287
|
};
|
|
288
288
|
|
|
289
289
|
render() {
|
|
290
|
-
const {
|
|
291
|
-
|
|
292
|
-
maxDate,
|
|
293
|
-
minDate,
|
|
294
|
-
selectionConfiguration,
|
|
295
|
-
...calendarProps
|
|
296
|
-
} = this.props;
|
|
290
|
+
const { maxDate, minDate, selectionConfiguration, ...calendarProps } =
|
|
291
|
+
this.props;
|
|
297
292
|
|
|
298
293
|
delete calendarProps.onDateSelect;
|
|
299
294
|
delete calendarProps.onMonthChange;
|
|
@@ -326,25 +321,16 @@ const withCalendarState = (Calendar) => {
|
|
|
326
321
|
}
|
|
327
322
|
|
|
328
323
|
BpkCalendarContainer.propTypes = {
|
|
329
|
-
date: deprecated(
|
|
330
|
-
PropTypes.instanceOf(Date),
|
|
331
|
-
'Use selectionConfiguration to set selectedDate',
|
|
332
|
-
),
|
|
333
324
|
fixedWidth: PropTypes.bool,
|
|
334
325
|
maxDate: PropTypes.instanceOf(Date),
|
|
335
326
|
minDate: PropTypes.instanceOf(Date),
|
|
336
327
|
onDateSelect: PropTypes.func,
|
|
337
328
|
onMonthChange: PropTypes.func,
|
|
338
329
|
selectionConfiguration: CustomPropTypes.SelectionConfiguration,
|
|
339
|
-
selectedDate: deprecated(
|
|
340
|
-
PropTypes.instanceOf(Date),
|
|
341
|
-
'Use selectionConfiguration to set selectedDate',
|
|
342
|
-
),
|
|
343
330
|
initiallyFocusedDate: PropTypes.instanceOf(Date),
|
|
344
331
|
};
|
|
345
332
|
|
|
346
333
|
BpkCalendarContainer.defaultProps = {
|
|
347
|
-
date: null,
|
|
348
334
|
fixedWidth: true,
|
|
349
335
|
maxDate: addMonths(new Date(), 12),
|
|
350
336
|
minDate: new Date(),
|
|
@@ -354,7 +340,6 @@ const withCalendarState = (Calendar) => {
|
|
|
354
340
|
type: CALENDAR_SELECTION_TYPE.single,
|
|
355
341
|
date: null,
|
|
356
342
|
},
|
|
357
|
-
selectedDate: null,
|
|
358
343
|
initiallyFocusedDate: null,
|
|
359
344
|
};
|
|
360
345
|
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
import PropTypes from 'prop-types';
|
|
20
20
|
import { Component } from 'react';
|
|
21
21
|
|
|
22
|
-
import { cssModules,
|
|
22
|
+
import { cssModules, isDeviceIos } from '../../bpk-react-utils';
|
|
23
23
|
|
|
24
24
|
import BpkCalendarGridHeader from './BpkCalendarGridHeader';
|
|
25
25
|
import Week from './Week';
|
|
@@ -103,8 +103,6 @@ class BpkCalendarGrid extends Component {
|
|
|
103
103
|
onDateKeyDown,
|
|
104
104
|
preventKeyboardFocus,
|
|
105
105
|
selectionConfiguration,
|
|
106
|
-
selectionEnd,
|
|
107
|
-
selectionStart,
|
|
108
106
|
weekStartsOn,
|
|
109
107
|
} = this.props;
|
|
110
108
|
|
|
@@ -139,8 +137,6 @@ class BpkCalendarGrid extends Component {
|
|
|
139
137
|
markToday={markToday}
|
|
140
138
|
markOutsideDays={markOutsideDays}
|
|
141
139
|
selectionConfiguration={selectionConfiguration}
|
|
142
|
-
selectionEnd={selectionEnd}
|
|
143
|
-
selectionStart={selectionStart}
|
|
144
140
|
focusedDate={focusedDate}
|
|
145
141
|
minDate={minDate}
|
|
146
142
|
maxDate={maxDate}
|
|
@@ -177,16 +173,6 @@ export const propTypes = {
|
|
|
177
173
|
onDateKeyDown: PropTypes.func,
|
|
178
174
|
preventKeyboardFocus: PropTypes.bool,
|
|
179
175
|
selectionConfiguration: CustomPropTypes.SelectionConfiguration,
|
|
180
|
-
selectedDate: deprecated(
|
|
181
|
-
PropTypes.instanceOf(Date),
|
|
182
|
-
'Use selectionConfiguration to set selectedDate',
|
|
183
|
-
),
|
|
184
|
-
selectionEnd: PropTypes.instanceOf(Date),
|
|
185
|
-
selectionStart: PropTypes.instanceOf(Date),
|
|
186
|
-
showWeekendSeparator: deprecated(
|
|
187
|
-
PropTypes.bool,
|
|
188
|
-
'The showWeekendSeparator prop in BpkCalendarGrid is now deprecated as no longer part of the calendar, so is no longer required',
|
|
189
|
-
),
|
|
190
176
|
ignoreOutsideDate: PropTypes.bool,
|
|
191
177
|
dateProps: PropTypes.object,
|
|
192
178
|
};
|
|
@@ -205,10 +191,7 @@ BpkCalendarGrid.defaultProps = {
|
|
|
205
191
|
onDateClick: null,
|
|
206
192
|
onDateKeyDown: null,
|
|
207
193
|
preventKeyboardFocus: false,
|
|
208
|
-
selectedDate: null,
|
|
209
194
|
selectionConfiguration: { type: CALENDAR_SELECTION_TYPE.single, date: null },
|
|
210
|
-
selectionEnd: null,
|
|
211
|
-
selectionStart: null,
|
|
212
195
|
ignoreOutsideDate: false,
|
|
213
196
|
dateProps: null,
|
|
214
197
|
cellClassName: null,
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
import PropTypes from 'prop-types';
|
|
20
20
|
import { PureComponent } from 'react';
|
|
21
21
|
|
|
22
|
-
import { cssModules
|
|
22
|
+
import { cssModules } from '../../bpk-react-utils';
|
|
23
23
|
|
|
24
24
|
import CustomPropTypes from './custom-proptypes';
|
|
25
25
|
import { orderDaysOfWeek } from './date-utils';
|
|
@@ -94,11 +94,6 @@ BpkCalendarGridHeader.propTypes = {
|
|
|
94
94
|
isTableHead: PropTypes.bool,
|
|
95
95
|
className: PropTypes.string,
|
|
96
96
|
weekDayKey: CustomPropTypes.WeekDayKey,
|
|
97
|
-
// eslint-disable-next-line react/require-default-props,react/no-unused-prop-types
|
|
98
|
-
showWeekendSeparator: deprecated(
|
|
99
|
-
PropTypes.bool,
|
|
100
|
-
'The showWeekendSeparator prop in BpkCalendarGridHeader is now deprecated as no longer part of the calendar, so is no longer required',
|
|
101
|
-
),
|
|
102
97
|
};
|
|
103
98
|
|
|
104
99
|
BpkCalendarGridHeader.defaultProps = {
|
|
@@ -19,7 +19,7 @@
|
|
|
19
19
|
import PropTypes from 'prop-types';
|
|
20
20
|
import { Component } from 'react';
|
|
21
21
|
|
|
22
|
-
import { cssModules
|
|
22
|
+
import { cssModules } from '../../bpk-react-utils';
|
|
23
23
|
|
|
24
24
|
import {
|
|
25
25
|
isSameDay,
|
|
@@ -379,10 +379,6 @@ Week.propTypes = {
|
|
|
379
379
|
isKeyboardFocusable: PropTypes.bool.isRequired,
|
|
380
380
|
month: PropTypes.instanceOf(Date).isRequired,
|
|
381
381
|
weekStartsOn: PropTypes.number.isRequired,
|
|
382
|
-
daysOfWeek: deprecated(
|
|
383
|
-
CustomPropTypes.DaysOfWeek,
|
|
384
|
-
'daysOfWeek property in Week is now deprecated as no longer part of the calendar, so is no longer required',
|
|
385
|
-
),
|
|
386
382
|
focusedDate: PropTypes.instanceOf(Date),
|
|
387
383
|
maxDate: PropTypes.instanceOf(Date),
|
|
388
384
|
minDate: PropTypes.instanceOf(Date),
|
|
@@ -390,33 +386,18 @@ Week.propTypes = {
|
|
|
390
386
|
onDateClick: PropTypes.func,
|
|
391
387
|
onDateKeyDown: PropTypes.func,
|
|
392
388
|
selectionConfiguration: CustomPropTypes.SelectionConfiguration,
|
|
393
|
-
selectedDate: deprecated(
|
|
394
|
-
PropTypes.instanceOf(Date),
|
|
395
|
-
'Use selectionConfiguration to set selectedDate',
|
|
396
|
-
),
|
|
397
|
-
selectionEnd: PropTypes.instanceOf(Date),
|
|
398
|
-
selectionStart: PropTypes.instanceOf(Date),
|
|
399
|
-
// eslint-disable-next-line react/require-default-props
|
|
400
|
-
showWeekendSeparator: deprecated(
|
|
401
|
-
PropTypes.bool,
|
|
402
|
-
'The showWeekendSeparator prop in Week is now deprecated as no longer part of the calendar, so is no longer required',
|
|
403
|
-
),
|
|
404
389
|
ignoreOutsideDate: PropTypes.bool,
|
|
405
390
|
dateProps: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
|
406
391
|
};
|
|
407
392
|
|
|
408
393
|
Week.defaultProps = {
|
|
409
394
|
cellClassName: null,
|
|
410
|
-
daysOfWeek: null,
|
|
411
395
|
focusedDate: null,
|
|
412
396
|
maxDate: null,
|
|
413
397
|
minDate: null,
|
|
414
398
|
onDateClick: null,
|
|
415
399
|
onDateKeyDown: null,
|
|
416
400
|
selectionConfiguration: { type: CALENDAR_SELECTION_TYPE.single, date: null },
|
|
417
|
-
selectedDate: null,
|
|
418
|
-
selectionEnd: null,
|
|
419
|
-
selectionStart: null,
|
|
420
401
|
ignoreOutsideDate: false,
|
|
421
402
|
dateProps: null,
|
|
422
403
|
};
|
|
@@ -18,7 +18,7 @@
|
|
|
18
18
|
|
|
19
19
|
import PropTypes from 'prop-types';
|
|
20
20
|
|
|
21
|
-
import { cssModules
|
|
21
|
+
import { cssModules } from '../../bpk-react-utils';
|
|
22
22
|
|
|
23
23
|
import CustomPropTypes, { CALENDAR_SELECTION_TYPE } from './custom-proptypes';
|
|
24
24
|
import STYLES from './BpkCalendar.module.scss';
|
|
@@ -159,15 +159,6 @@ const composeCalendar = (Nav, GridHeader, Grid, CalendarDate) => {
|
|
|
159
159
|
onDateKeyDown: PropTypes.func,
|
|
160
160
|
preventKeyboardFocus: PropTypes.bool,
|
|
161
161
|
selectionConfiguration: CustomPropTypes.SelectionConfiguration,
|
|
162
|
-
selectedDate: deprecated(
|
|
163
|
-
PropTypes.instanceOf(Date),
|
|
164
|
-
'Use selectionConfiguration to set selectedDate',
|
|
165
|
-
),
|
|
166
|
-
// eslint-disable-next-line react/require-default-props
|
|
167
|
-
showWeekendSeparator: deprecated(
|
|
168
|
-
PropTypes.bool,
|
|
169
|
-
'The showWeekendSeparator prop in composeCalendar is now deprecated as no longer part of the calendar, so is no longer required',
|
|
170
|
-
),
|
|
171
162
|
gridClassName: PropTypes.string,
|
|
172
163
|
weekDayKey: PropTypes.string,
|
|
173
164
|
/* eslint-disable react/forbid-prop-types */
|
|
@@ -196,7 +187,6 @@ const composeCalendar = (Nav, GridHeader, Grid, CalendarDate) => {
|
|
|
196
187
|
type: CALENDAR_SELECTION_TYPE.single,
|
|
197
188
|
date: null,
|
|
198
189
|
},
|
|
199
|
-
selectedDate: null,
|
|
200
190
|
gridClassName: null,
|
|
201
191
|
weekDayKey: 'nameAbbr',
|
|
202
192
|
navProps: null,
|
|
@@ -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 };
|