@skyscanner/backpack-web 23.3.0 → 24.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-component-calendar/src/BpkCalendarContainer.d.ts +74 -39
- package/bpk-component-calendar/src/BpkCalendarContainer.js +4 -4
- package/bpk-component-calendar/src/composeCalendar.d.ts +6 -3
- package/bpk-component-calendar/src/composeCalendar.js +3 -3
- package/bpk-component-chip/src/BpkSelectableChip.js +0 -1
- package/bpk-component-dialog/src/BpkDialog.d.ts +1 -12
- package/bpk-component-dialog/src/BpkDialog.js +1 -1
- package/bpk-component-dialog/src/BpkDialogInner.d.ts +256 -2
- package/bpk-component-dialog/src/BpkDialogInner.js +0 -2
- package/bpk-component-dialog/src/common-types.d.ts +20 -21
- package/bpk-component-graphic-promotion/src/BpkGraphicPromo.js +0 -2
- package/bpk-component-modal/index.d.ts +26 -0
- package/bpk-component-modal/index.js +5 -5
- package/bpk-component-modal/src/BpkModal.d.ts +32 -0
- package/bpk-component-modal/src/BpkModal.js +24 -44
- package/bpk-component-modal/src/BpkModalInner.d.ts +39 -0
- package/bpk-component-modal/src/BpkModalInner.js +67 -84
- package/bpk-component-modal/src/BpkModalV2/BpkModal.js +0 -2
- package/bpk-component-modal/src/legacy-prop-types.js +86 -0
- package/bpk-component-modal/src/themeAttributes.js +1 -0
- package/bpk-component-text/index.d.ts +21 -0
- package/bpk-component-text/index.js +0 -6
- package/bpk-component-text/src/BpkText.d.ts +60 -0
- package/bpk-component-text/src/BpkText.js +16 -56
- package/bpk-component-text/src/BpkText.module.css +1 -1
- package/bpk-component-tooltip/index.d.ts +24 -0
- package/bpk-component-tooltip/src/BpkTooltip.d.ts +29 -0
- package/bpk-component-tooltip/src/BpkTooltip.js +9 -26
- package/bpk-component-tooltip/src/BpkTooltipPortal.d.ts +60 -0
- package/bpk-component-tooltip/src/BpkTooltipPortal.js +13 -21
- package/bpk-component-tooltip/src/constants.d.ts +31 -0
- package/bpk-component-tooltip/src/constants.js +3 -1
- package/bpk-scrim-utils/index.d.ts +283 -0
- package/bpk-scrim-utils/src/withScrim.d.ts +2 -1
- package/package.json +1 -1
|
@@ -0,0 +1,283 @@
|
|
|
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
|
+
/// <reference types="react" />
|
|
20
|
+
import withScrim from './src/withScrim';
|
|
21
|
+
export { withScrim };
|
|
22
|
+
declare const _default: {
|
|
23
|
+
withScrim: <P extends {
|
|
24
|
+
[rest: string]: any;
|
|
25
|
+
onClose?: (() => void | null) | undefined;
|
|
26
|
+
isIphone?: boolean | undefined;
|
|
27
|
+
isIpad?: boolean | undefined;
|
|
28
|
+
}>(WrappedComponent: string | import("react").ComponentType<P>) => {
|
|
29
|
+
new (props: (P & {
|
|
30
|
+
getApplicationElement: () => HTMLElement | null;
|
|
31
|
+
containerClassName?: string | undefined;
|
|
32
|
+
closeOnScrimClick?: boolean | undefined;
|
|
33
|
+
} & {
|
|
34
|
+
[rest: string]: any;
|
|
35
|
+
onClose?: (() => void | null) | undefined;
|
|
36
|
+
isIphone?: boolean | undefined;
|
|
37
|
+
isIpad?: boolean | undefined;
|
|
38
|
+
}) | Readonly<P & {
|
|
39
|
+
getApplicationElement: () => HTMLElement | null;
|
|
40
|
+
containerClassName?: string | undefined;
|
|
41
|
+
closeOnScrimClick?: boolean | undefined;
|
|
42
|
+
} & {
|
|
43
|
+
[rest: string]: any;
|
|
44
|
+
onClose?: (() => void | null) | undefined;
|
|
45
|
+
isIphone?: boolean | undefined;
|
|
46
|
+
isIpad?: boolean | undefined;
|
|
47
|
+
}>): {
|
|
48
|
+
dialogElement?: import("react").RefObject<HTMLElement> | undefined;
|
|
49
|
+
componentDidMount(): void;
|
|
50
|
+
componentWillUnmount(): void;
|
|
51
|
+
dialogRef: (ref: import("react").RefObject<HTMLElement>) => void;
|
|
52
|
+
render(): JSX.Element;
|
|
53
|
+
context: any;
|
|
54
|
+
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<P & {
|
|
55
|
+
getApplicationElement: () => HTMLElement | null;
|
|
56
|
+
containerClassName?: string | undefined;
|
|
57
|
+
closeOnScrimClick?: boolean | undefined;
|
|
58
|
+
} & {
|
|
59
|
+
[rest: string]: any;
|
|
60
|
+
onClose?: (() => void | null) | undefined;
|
|
61
|
+
isIphone?: boolean | undefined;
|
|
62
|
+
isIpad?: boolean | undefined;
|
|
63
|
+
}>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
64
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
65
|
+
readonly props: Readonly<P & {
|
|
66
|
+
getApplicationElement: () => HTMLElement | null;
|
|
67
|
+
containerClassName?: string | undefined;
|
|
68
|
+
closeOnScrimClick?: boolean | undefined;
|
|
69
|
+
} & {
|
|
70
|
+
[rest: string]: any;
|
|
71
|
+
onClose?: (() => void | null) | undefined;
|
|
72
|
+
isIphone?: boolean | undefined;
|
|
73
|
+
isIpad?: boolean | undefined;
|
|
74
|
+
}> & Readonly<{
|
|
75
|
+
children?: import("react").ReactNode;
|
|
76
|
+
}>;
|
|
77
|
+
state: Readonly<{}>;
|
|
78
|
+
refs: {
|
|
79
|
+
[key: string]: import("react").ReactInstance;
|
|
80
|
+
};
|
|
81
|
+
shouldComponentUpdate?(nextProps: Readonly<P & {
|
|
82
|
+
getApplicationElement: () => HTMLElement | null;
|
|
83
|
+
containerClassName?: string | undefined;
|
|
84
|
+
closeOnScrimClick?: boolean | undefined;
|
|
85
|
+
} & {
|
|
86
|
+
[rest: string]: any;
|
|
87
|
+
onClose?: (() => void | null) | undefined;
|
|
88
|
+
isIphone?: boolean | undefined;
|
|
89
|
+
isIpad?: boolean | undefined;
|
|
90
|
+
}>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
91
|
+
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
|
|
92
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<P & {
|
|
93
|
+
getApplicationElement: () => HTMLElement | null;
|
|
94
|
+
containerClassName?: string | undefined;
|
|
95
|
+
closeOnScrimClick?: boolean | undefined;
|
|
96
|
+
} & {
|
|
97
|
+
[rest: string]: any;
|
|
98
|
+
onClose?: (() => void | null) | undefined;
|
|
99
|
+
isIphone?: boolean | undefined;
|
|
100
|
+
isIpad?: boolean | undefined;
|
|
101
|
+
}>, prevState: Readonly<{}>): any;
|
|
102
|
+
componentDidUpdate?(prevProps: Readonly<P & {
|
|
103
|
+
getApplicationElement: () => HTMLElement | null;
|
|
104
|
+
containerClassName?: string | undefined;
|
|
105
|
+
closeOnScrimClick?: boolean | undefined;
|
|
106
|
+
} & {
|
|
107
|
+
[rest: string]: any;
|
|
108
|
+
onClose?: (() => void | null) | undefined;
|
|
109
|
+
isIphone?: boolean | undefined;
|
|
110
|
+
isIpad?: boolean | undefined;
|
|
111
|
+
}>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
112
|
+
componentWillMount?(): void;
|
|
113
|
+
UNSAFE_componentWillMount?(): void;
|
|
114
|
+
componentWillReceiveProps?(nextProps: Readonly<P & {
|
|
115
|
+
getApplicationElement: () => HTMLElement | null;
|
|
116
|
+
containerClassName?: string | undefined;
|
|
117
|
+
closeOnScrimClick?: boolean | undefined;
|
|
118
|
+
} & {
|
|
119
|
+
[rest: string]: any;
|
|
120
|
+
onClose?: (() => void | null) | undefined;
|
|
121
|
+
isIphone?: boolean | undefined;
|
|
122
|
+
isIpad?: boolean | undefined;
|
|
123
|
+
}>, nextContext: any): void;
|
|
124
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<P & {
|
|
125
|
+
getApplicationElement: () => HTMLElement | null;
|
|
126
|
+
containerClassName?: string | undefined;
|
|
127
|
+
closeOnScrimClick?: boolean | undefined;
|
|
128
|
+
} & {
|
|
129
|
+
[rest: string]: any;
|
|
130
|
+
onClose?: (() => void | null) | undefined;
|
|
131
|
+
isIphone?: boolean | undefined;
|
|
132
|
+
isIpad?: boolean | undefined;
|
|
133
|
+
}>, nextContext: any): void;
|
|
134
|
+
componentWillUpdate?(nextProps: Readonly<P & {
|
|
135
|
+
getApplicationElement: () => HTMLElement | null;
|
|
136
|
+
containerClassName?: string | undefined;
|
|
137
|
+
closeOnScrimClick?: boolean | undefined;
|
|
138
|
+
} & {
|
|
139
|
+
[rest: string]: any;
|
|
140
|
+
onClose?: (() => void | null) | undefined;
|
|
141
|
+
isIphone?: boolean | undefined;
|
|
142
|
+
isIpad?: boolean | undefined;
|
|
143
|
+
}>, nextState: Readonly<{}>, nextContext: any): void;
|
|
144
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<P & {
|
|
145
|
+
getApplicationElement: () => HTMLElement | null;
|
|
146
|
+
containerClassName?: string | undefined;
|
|
147
|
+
closeOnScrimClick?: boolean | undefined;
|
|
148
|
+
} & {
|
|
149
|
+
[rest: string]: any;
|
|
150
|
+
onClose?: (() => void | null) | undefined;
|
|
151
|
+
isIphone?: boolean | undefined;
|
|
152
|
+
isIpad?: boolean | undefined;
|
|
153
|
+
}>, nextState: Readonly<{}>, nextContext: any): void;
|
|
154
|
+
};
|
|
155
|
+
new (props: P & {
|
|
156
|
+
getApplicationElement: () => HTMLElement | null;
|
|
157
|
+
containerClassName?: string | undefined;
|
|
158
|
+
closeOnScrimClick?: boolean | undefined;
|
|
159
|
+
} & {
|
|
160
|
+
[rest: string]: any;
|
|
161
|
+
onClose?: (() => void | null) | undefined;
|
|
162
|
+
isIphone?: boolean | undefined;
|
|
163
|
+
isIpad?: boolean | undefined;
|
|
164
|
+
}, context: any): {
|
|
165
|
+
dialogElement?: import("react").RefObject<HTMLElement> | undefined;
|
|
166
|
+
componentDidMount(): void;
|
|
167
|
+
componentWillUnmount(): void;
|
|
168
|
+
dialogRef: (ref: import("react").RefObject<HTMLElement>) => void;
|
|
169
|
+
render(): JSX.Element;
|
|
170
|
+
context: any;
|
|
171
|
+
setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<P & {
|
|
172
|
+
getApplicationElement: () => HTMLElement | null;
|
|
173
|
+
containerClassName?: string | undefined;
|
|
174
|
+
closeOnScrimClick?: boolean | undefined;
|
|
175
|
+
} & {
|
|
176
|
+
[rest: string]: any;
|
|
177
|
+
onClose?: (() => void | null) | undefined;
|
|
178
|
+
isIphone?: boolean | undefined;
|
|
179
|
+
isIpad?: boolean | undefined;
|
|
180
|
+
}>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
|
|
181
|
+
forceUpdate(callback?: (() => void) | undefined): void;
|
|
182
|
+
readonly props: Readonly<P & {
|
|
183
|
+
getApplicationElement: () => HTMLElement | null;
|
|
184
|
+
containerClassName?: string | undefined;
|
|
185
|
+
closeOnScrimClick?: boolean | undefined;
|
|
186
|
+
} & {
|
|
187
|
+
[rest: string]: any;
|
|
188
|
+
onClose?: (() => void | null) | undefined;
|
|
189
|
+
isIphone?: boolean | undefined;
|
|
190
|
+
isIpad?: boolean | undefined;
|
|
191
|
+
}> & Readonly<{
|
|
192
|
+
children?: import("react").ReactNode;
|
|
193
|
+
}>;
|
|
194
|
+
state: Readonly<{}>;
|
|
195
|
+
refs: {
|
|
196
|
+
[key: string]: import("react").ReactInstance;
|
|
197
|
+
};
|
|
198
|
+
shouldComponentUpdate?(nextProps: Readonly<P & {
|
|
199
|
+
getApplicationElement: () => HTMLElement | null;
|
|
200
|
+
containerClassName?: string | undefined;
|
|
201
|
+
closeOnScrimClick?: boolean | undefined;
|
|
202
|
+
} & {
|
|
203
|
+
[rest: string]: any;
|
|
204
|
+
onClose?: (() => void | null) | undefined;
|
|
205
|
+
isIphone?: boolean | undefined;
|
|
206
|
+
isIpad?: boolean | undefined;
|
|
207
|
+
}>, nextState: Readonly<{}>, nextContext: any): boolean;
|
|
208
|
+
componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
|
|
209
|
+
getSnapshotBeforeUpdate?(prevProps: Readonly<P & {
|
|
210
|
+
getApplicationElement: () => HTMLElement | null;
|
|
211
|
+
containerClassName?: string | undefined;
|
|
212
|
+
closeOnScrimClick?: boolean | undefined;
|
|
213
|
+
} & {
|
|
214
|
+
[rest: string]: any;
|
|
215
|
+
onClose?: (() => void | null) | undefined;
|
|
216
|
+
isIphone?: boolean | undefined;
|
|
217
|
+
isIpad?: boolean | undefined;
|
|
218
|
+
}>, prevState: Readonly<{}>): any;
|
|
219
|
+
componentDidUpdate?(prevProps: Readonly<P & {
|
|
220
|
+
getApplicationElement: () => HTMLElement | null;
|
|
221
|
+
containerClassName?: string | undefined;
|
|
222
|
+
closeOnScrimClick?: boolean | undefined;
|
|
223
|
+
} & {
|
|
224
|
+
[rest: string]: any;
|
|
225
|
+
onClose?: (() => void | null) | undefined;
|
|
226
|
+
isIphone?: boolean | undefined;
|
|
227
|
+
isIpad?: boolean | undefined;
|
|
228
|
+
}>, prevState: Readonly<{}>, snapshot?: any): void;
|
|
229
|
+
componentWillMount?(): void;
|
|
230
|
+
UNSAFE_componentWillMount?(): void;
|
|
231
|
+
componentWillReceiveProps?(nextProps: Readonly<P & {
|
|
232
|
+
getApplicationElement: () => HTMLElement | null;
|
|
233
|
+
containerClassName?: string | undefined;
|
|
234
|
+
closeOnScrimClick?: boolean | undefined;
|
|
235
|
+
} & {
|
|
236
|
+
[rest: string]: any;
|
|
237
|
+
onClose?: (() => void | null) | undefined;
|
|
238
|
+
isIphone?: boolean | undefined;
|
|
239
|
+
isIpad?: boolean | undefined;
|
|
240
|
+
}>, nextContext: any): void;
|
|
241
|
+
UNSAFE_componentWillReceiveProps?(nextProps: Readonly<P & {
|
|
242
|
+
getApplicationElement: () => HTMLElement | null;
|
|
243
|
+
containerClassName?: string | undefined;
|
|
244
|
+
closeOnScrimClick?: boolean | undefined;
|
|
245
|
+
} & {
|
|
246
|
+
[rest: string]: any;
|
|
247
|
+
onClose?: (() => void | null) | undefined;
|
|
248
|
+
isIphone?: boolean | undefined;
|
|
249
|
+
isIpad?: boolean | undefined;
|
|
250
|
+
}>, nextContext: any): void;
|
|
251
|
+
componentWillUpdate?(nextProps: Readonly<P & {
|
|
252
|
+
getApplicationElement: () => HTMLElement | null;
|
|
253
|
+
containerClassName?: string | undefined;
|
|
254
|
+
closeOnScrimClick?: boolean | undefined;
|
|
255
|
+
} & {
|
|
256
|
+
[rest: string]: any;
|
|
257
|
+
onClose?: (() => void | null) | undefined;
|
|
258
|
+
isIphone?: boolean | undefined;
|
|
259
|
+
isIpad?: boolean | undefined;
|
|
260
|
+
}>, nextState: Readonly<{}>, nextContext: any): void;
|
|
261
|
+
UNSAFE_componentWillUpdate?(nextProps: Readonly<P & {
|
|
262
|
+
getApplicationElement: () => HTMLElement | null;
|
|
263
|
+
containerClassName?: string | undefined;
|
|
264
|
+
closeOnScrimClick?: boolean | undefined;
|
|
265
|
+
} & {
|
|
266
|
+
[rest: string]: any;
|
|
267
|
+
onClose?: (() => void | null) | undefined;
|
|
268
|
+
isIphone?: boolean | undefined;
|
|
269
|
+
isIpad?: boolean | undefined;
|
|
270
|
+
}>, nextState: Readonly<{}>, nextContext: any): void;
|
|
271
|
+
};
|
|
272
|
+
displayName: string;
|
|
273
|
+
defaultProps: {
|
|
274
|
+
onClose: null;
|
|
275
|
+
isIphone: boolean;
|
|
276
|
+
isIpad: boolean;
|
|
277
|
+
containerClassName: null;
|
|
278
|
+
closeOnScrimClick: boolean;
|
|
279
|
+
};
|
|
280
|
+
contextType?: import("react").Context<any> | undefined;
|
|
281
|
+
};
|
|
282
|
+
};
|
|
283
|
+
export default _default;
|
|
@@ -21,9 +21,10 @@ type BaseProps = {
|
|
|
21
21
|
onClose?: () => void | null;
|
|
22
22
|
isIphone?: boolean;
|
|
23
23
|
isIpad?: boolean;
|
|
24
|
+
[rest: string]: any;
|
|
24
25
|
};
|
|
25
26
|
type HOCProps = {
|
|
26
|
-
getApplicationElement: () => HTMLElement;
|
|
27
|
+
getApplicationElement: () => HTMLElement | null;
|
|
27
28
|
containerClassName?: string;
|
|
28
29
|
closeOnScrimClick?: boolean;
|
|
29
30
|
};
|