@skyscanner/backpack-web 25.4.0 → 25.4.1

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.
@@ -36,6 +36,8 @@ type InjectedProps = {
36
36
  onDateClick: ((date: Date) => void) | null;
37
37
  onDateKeyDown: ((event: KeyboardEvent) => void) | null;
38
38
  month: Date;
39
+ minDate: Date;
40
+ maxDate: Date;
39
41
  };
40
42
  type CalendarProps<P> = Omit<P & Props, keyof InjectedProps> & {
41
43
  [rest: string]: any;
@@ -19,248 +19,227 @@
19
19
  /// <reference types="react" />
20
20
  import { type DialogInnerProps as Props } from './common-types';
21
21
  declare const _default: {
22
- new (props: (Props & {
23
- getApplicationElement: () => HTMLElement | null;
24
- containerClassName?: string | undefined;
25
- closeOnScrimClick?: boolean | undefined;
26
- } & {
22
+ new (props: ({
27
23
  [rest: string]: any;
24
+ getApplicationElement: () => HTMLElement | null;
28
25
  onClose?: (() => void | null) | undefined;
29
26
  isIphone?: boolean | undefined;
30
27
  isIpad?: boolean | undefined;
31
- }) | Readonly<Props & {
32
- getApplicationElement: () => HTMLElement | null;
33
28
  containerClassName?: string | undefined;
34
29
  closeOnScrimClick?: boolean | undefined;
35
- } & {
30
+ } & Omit<Props, "dialogRef">) | Readonly<{
36
31
  [rest: string]: any;
32
+ getApplicationElement: () => HTMLElement | null;
37
33
  onClose?: (() => void | null) | undefined;
38
34
  isIphone?: boolean | undefined;
39
35
  isIpad?: boolean | undefined;
40
- }>): {
41
- dialogElement?: import("react").RefObject<HTMLElement> | undefined;
36
+ containerClassName?: string | undefined;
37
+ closeOnScrimClick?: boolean | undefined;
38
+ } & Omit<Props, "dialogRef">>): {
39
+ dialogElement?: HTMLElement | null | undefined;
42
40
  componentDidMount(): void;
43
41
  componentWillUnmount(): void;
44
- dialogRef: (ref: import("react").RefObject<HTMLElement>) => void;
42
+ dialogRef: (ref: HTMLElement | null | undefined) => void;
45
43
  render(): JSX.Element;
46
44
  context: any;
47
- setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Props & {
48
- getApplicationElement: () => HTMLElement | null;
49
- containerClassName?: string | undefined;
50
- closeOnScrimClick?: boolean | undefined;
51
- } & {
45
+ setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<{
52
46
  [rest: string]: any;
47
+ getApplicationElement: () => HTMLElement | null;
53
48
  onClose?: (() => void | null) | undefined;
54
49
  isIphone?: boolean | undefined;
55
50
  isIpad?: boolean | undefined;
56
- }>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
57
- forceUpdate(callback?: (() => void) | undefined): void;
58
- readonly props: Readonly<Props & {
59
- getApplicationElement: () => HTMLElement | null;
60
51
  containerClassName?: string | undefined;
61
52
  closeOnScrimClick?: boolean | undefined;
62
- } & {
53
+ } & Omit<Props, "dialogRef">>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
54
+ forceUpdate(callback?: (() => void) | undefined): void;
55
+ readonly props: Readonly<{
63
56
  [rest: string]: any;
57
+ getApplicationElement: () => HTMLElement | null;
64
58
  onClose?: (() => void | null) | undefined;
65
59
  isIphone?: boolean | undefined;
66
60
  isIpad?: boolean | undefined;
67
- }> & Readonly<{
61
+ containerClassName?: string | undefined;
62
+ closeOnScrimClick?: boolean | undefined;
63
+ } & Omit<Props, "dialogRef">> & Readonly<{
68
64
  children?: import("react").ReactNode;
69
65
  }>;
70
66
  state: Readonly<{}>;
71
67
  refs: {
72
68
  [key: string]: import("react").ReactInstance;
73
69
  };
74
- shouldComponentUpdate?(nextProps: Readonly<Props & {
75
- getApplicationElement: () => HTMLElement | null;
76
- containerClassName?: string | undefined;
77
- closeOnScrimClick?: boolean | undefined;
78
- } & {
70
+ shouldComponentUpdate?(nextProps: Readonly<{
79
71
  [rest: string]: any;
72
+ getApplicationElement: () => HTMLElement | null;
80
73
  onClose?: (() => void | null) | undefined;
81
74
  isIphone?: boolean | undefined;
82
75
  isIpad?: boolean | undefined;
83
- }>, nextState: Readonly<{}>, nextContext: any): boolean;
84
- componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
85
- getSnapshotBeforeUpdate?(prevProps: Readonly<Props & {
86
- getApplicationElement: () => HTMLElement | null;
87
76
  containerClassName?: string | undefined;
88
77
  closeOnScrimClick?: boolean | undefined;
89
- } & {
78
+ } & Omit<Props, "dialogRef">>, nextState: Readonly<{}>, nextContext: any): boolean;
79
+ componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
80
+ getSnapshotBeforeUpdate?(prevProps: Readonly<{
90
81
  [rest: string]: any;
82
+ getApplicationElement: () => HTMLElement | null;
91
83
  onClose?: (() => void | null) | undefined;
92
84
  isIphone?: boolean | undefined;
93
85
  isIpad?: boolean | undefined;
94
- }>, prevState: Readonly<{}>): any;
95
- componentDidUpdate?(prevProps: Readonly<Props & {
96
- getApplicationElement: () => HTMLElement | null;
97
86
  containerClassName?: string | undefined;
98
87
  closeOnScrimClick?: boolean | undefined;
99
- } & {
88
+ } & Omit<Props, "dialogRef">>, prevState: Readonly<{}>): any;
89
+ componentDidUpdate?(prevProps: Readonly<{
100
90
  [rest: string]: any;
91
+ getApplicationElement: () => HTMLElement | null;
101
92
  onClose?: (() => void | null) | undefined;
102
93
  isIphone?: boolean | undefined;
103
94
  isIpad?: boolean | undefined;
104
- }>, prevState: Readonly<{}>, snapshot?: any): void;
105
- componentWillMount?(): void;
106
- UNSAFE_componentWillMount?(): void;
107
- componentWillReceiveProps?(nextProps: Readonly<Props & {
108
- getApplicationElement: () => HTMLElement | null;
109
95
  containerClassName?: string | undefined;
110
96
  closeOnScrimClick?: boolean | undefined;
111
- } & {
97
+ } & Omit<Props, "dialogRef">>, prevState: Readonly<{}>, snapshot?: any): void;
98
+ componentWillMount?(): void;
99
+ UNSAFE_componentWillMount?(): void;
100
+ componentWillReceiveProps?(nextProps: Readonly<{
112
101
  [rest: string]: any;
102
+ getApplicationElement: () => HTMLElement | null;
113
103
  onClose?: (() => void | null) | undefined;
114
104
  isIphone?: boolean | undefined;
115
105
  isIpad?: boolean | undefined;
116
- }>, nextContext: any): void;
117
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Props & {
118
- getApplicationElement: () => HTMLElement | null;
119
106
  containerClassName?: string | undefined;
120
107
  closeOnScrimClick?: boolean | undefined;
121
- } & {
108
+ } & Omit<Props, "dialogRef">>, nextContext: any): void;
109
+ UNSAFE_componentWillReceiveProps?(nextProps: Readonly<{
122
110
  [rest: string]: any;
111
+ getApplicationElement: () => HTMLElement | null;
123
112
  onClose?: (() => void | null) | undefined;
124
113
  isIphone?: boolean | undefined;
125
114
  isIpad?: boolean | undefined;
126
- }>, nextContext: any): void;
127
- componentWillUpdate?(nextProps: Readonly<Props & {
128
- getApplicationElement: () => HTMLElement | null;
129
115
  containerClassName?: string | undefined;
130
116
  closeOnScrimClick?: boolean | undefined;
131
- } & {
117
+ } & Omit<Props, "dialogRef">>, nextContext: any): void;
118
+ componentWillUpdate?(nextProps: Readonly<{
132
119
  [rest: string]: any;
120
+ getApplicationElement: () => HTMLElement | null;
133
121
  onClose?: (() => void | null) | undefined;
134
122
  isIphone?: boolean | undefined;
135
123
  isIpad?: boolean | undefined;
136
- }>, nextState: Readonly<{}>, nextContext: any): void;
137
- UNSAFE_componentWillUpdate?(nextProps: Readonly<Props & {
138
- getApplicationElement: () => HTMLElement | null;
139
124
  containerClassName?: string | undefined;
140
125
  closeOnScrimClick?: boolean | undefined;
141
- } & {
126
+ } & Omit<Props, "dialogRef">>, nextState: Readonly<{}>, nextContext: any): void;
127
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<{
142
128
  [rest: string]: any;
129
+ getApplicationElement: () => HTMLElement | null;
143
130
  onClose?: (() => void | null) | undefined;
144
131
  isIphone?: boolean | undefined;
145
132
  isIpad?: boolean | undefined;
146
- }>, nextState: Readonly<{}>, nextContext: any): void;
133
+ containerClassName?: string | undefined;
134
+ closeOnScrimClick?: boolean | undefined;
135
+ } & Omit<Props, "dialogRef">>, nextState: Readonly<{}>, nextContext: any): void;
147
136
  };
148
- new (props: Props & {
149
- getApplicationElement: () => HTMLElement | null;
150
- containerClassName?: string | undefined;
151
- closeOnScrimClick?: boolean | undefined;
152
- } & {
137
+ new (props: {
153
138
  [rest: string]: any;
139
+ getApplicationElement: () => HTMLElement | null;
154
140
  onClose?: (() => void | null) | undefined;
155
141
  isIphone?: boolean | undefined;
156
142
  isIpad?: boolean | undefined;
157
- }, context: any): {
158
- dialogElement?: import("react").RefObject<HTMLElement> | undefined;
143
+ containerClassName?: string | undefined;
144
+ closeOnScrimClick?: boolean | undefined;
145
+ } & Omit<Props, "dialogRef">, context: any): {
146
+ dialogElement?: HTMLElement | null | undefined;
159
147
  componentDidMount(): void;
160
148
  componentWillUnmount(): void;
161
- dialogRef: (ref: import("react").RefObject<HTMLElement>) => void;
149
+ dialogRef: (ref: HTMLElement | null | undefined) => void;
162
150
  render(): JSX.Element;
163
151
  context: any;
164
- setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<Props & {
165
- getApplicationElement: () => HTMLElement | null;
166
- containerClassName?: string | undefined;
167
- closeOnScrimClick?: boolean | undefined;
168
- } & {
152
+ setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<{
169
153
  [rest: string]: any;
154
+ getApplicationElement: () => HTMLElement | null;
170
155
  onClose?: (() => void | null) | undefined;
171
156
  isIphone?: boolean | undefined;
172
157
  isIpad?: boolean | undefined;
173
- }>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
174
- forceUpdate(callback?: (() => void) | undefined): void;
175
- readonly props: Readonly<Props & {
176
- getApplicationElement: () => HTMLElement | null;
177
158
  containerClassName?: string | undefined;
178
159
  closeOnScrimClick?: boolean | undefined;
179
- } & {
160
+ } & Omit<Props, "dialogRef">>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
161
+ forceUpdate(callback?: (() => void) | undefined): void;
162
+ readonly props: Readonly<{
180
163
  [rest: string]: any;
164
+ getApplicationElement: () => HTMLElement | null;
181
165
  onClose?: (() => void | null) | undefined;
182
166
  isIphone?: boolean | undefined;
183
167
  isIpad?: boolean | undefined;
184
- }> & Readonly<{
168
+ containerClassName?: string | undefined;
169
+ closeOnScrimClick?: boolean | undefined;
170
+ } & Omit<Props, "dialogRef">> & Readonly<{
185
171
  children?: import("react").ReactNode;
186
172
  }>;
187
173
  state: Readonly<{}>;
188
174
  refs: {
189
175
  [key: string]: import("react").ReactInstance;
190
176
  };
191
- shouldComponentUpdate?(nextProps: Readonly<Props & {
192
- getApplicationElement: () => HTMLElement | null;
193
- containerClassName?: string | undefined;
194
- closeOnScrimClick?: boolean | undefined;
195
- } & {
177
+ shouldComponentUpdate?(nextProps: Readonly<{
196
178
  [rest: string]: any;
179
+ getApplicationElement: () => HTMLElement | null;
197
180
  onClose?: (() => void | null) | undefined;
198
181
  isIphone?: boolean | undefined;
199
182
  isIpad?: boolean | undefined;
200
- }>, nextState: Readonly<{}>, nextContext: any): boolean;
201
- componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
202
- getSnapshotBeforeUpdate?(prevProps: Readonly<Props & {
203
- getApplicationElement: () => HTMLElement | null;
204
183
  containerClassName?: string | undefined;
205
184
  closeOnScrimClick?: boolean | undefined;
206
- } & {
185
+ } & Omit<Props, "dialogRef">>, nextState: Readonly<{}>, nextContext: any): boolean;
186
+ componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
187
+ getSnapshotBeforeUpdate?(prevProps: Readonly<{
207
188
  [rest: string]: any;
189
+ getApplicationElement: () => HTMLElement | null;
208
190
  onClose?: (() => void | null) | undefined;
209
191
  isIphone?: boolean | undefined;
210
192
  isIpad?: boolean | undefined;
211
- }>, prevState: Readonly<{}>): any;
212
- componentDidUpdate?(prevProps: Readonly<Props & {
213
- getApplicationElement: () => HTMLElement | null;
214
193
  containerClassName?: string | undefined;
215
194
  closeOnScrimClick?: boolean | undefined;
216
- } & {
195
+ } & Omit<Props, "dialogRef">>, prevState: Readonly<{}>): any;
196
+ componentDidUpdate?(prevProps: Readonly<{
217
197
  [rest: string]: any;
198
+ getApplicationElement: () => HTMLElement | null;
218
199
  onClose?: (() => void | null) | undefined;
219
200
  isIphone?: boolean | undefined;
220
201
  isIpad?: boolean | undefined;
221
- }>, prevState: Readonly<{}>, snapshot?: any): void;
222
- componentWillMount?(): void;
223
- UNSAFE_componentWillMount?(): void;
224
- componentWillReceiveProps?(nextProps: Readonly<Props & {
225
- getApplicationElement: () => HTMLElement | null;
226
202
  containerClassName?: string | undefined;
227
203
  closeOnScrimClick?: boolean | undefined;
228
- } & {
204
+ } & Omit<Props, "dialogRef">>, prevState: Readonly<{}>, snapshot?: any): void;
205
+ componentWillMount?(): void;
206
+ UNSAFE_componentWillMount?(): void;
207
+ componentWillReceiveProps?(nextProps: Readonly<{
229
208
  [rest: string]: any;
209
+ getApplicationElement: () => HTMLElement | null;
230
210
  onClose?: (() => void | null) | undefined;
231
211
  isIphone?: boolean | undefined;
232
212
  isIpad?: boolean | undefined;
233
- }>, nextContext: any): void;
234
- UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Props & {
235
- getApplicationElement: () => HTMLElement | null;
236
213
  containerClassName?: string | undefined;
237
214
  closeOnScrimClick?: boolean | undefined;
238
- } & {
215
+ } & Omit<Props, "dialogRef">>, nextContext: any): void;
216
+ UNSAFE_componentWillReceiveProps?(nextProps: Readonly<{
239
217
  [rest: string]: any;
218
+ getApplicationElement: () => HTMLElement | null;
240
219
  onClose?: (() => void | null) | undefined;
241
220
  isIphone?: boolean | undefined;
242
221
  isIpad?: boolean | undefined;
243
- }>, nextContext: any): void;
244
- componentWillUpdate?(nextProps: Readonly<Props & {
245
- getApplicationElement: () => HTMLElement | null;
246
222
  containerClassName?: string | undefined;
247
223
  closeOnScrimClick?: boolean | undefined;
248
- } & {
224
+ } & Omit<Props, "dialogRef">>, nextContext: any): void;
225
+ componentWillUpdate?(nextProps: Readonly<{
249
226
  [rest: string]: any;
227
+ getApplicationElement: () => HTMLElement | null;
250
228
  onClose?: (() => void | null) | undefined;
251
229
  isIphone?: boolean | undefined;
252
230
  isIpad?: boolean | undefined;
253
- }>, nextState: Readonly<{}>, nextContext: any): void;
254
- UNSAFE_componentWillUpdate?(nextProps: Readonly<Props & {
255
- getApplicationElement: () => HTMLElement | null;
256
231
  containerClassName?: string | undefined;
257
232
  closeOnScrimClick?: boolean | undefined;
258
- } & {
233
+ } & Omit<Props, "dialogRef">>, nextState: Readonly<{}>, nextContext: any): void;
234
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<{
259
235
  [rest: string]: any;
236
+ getApplicationElement: () => HTMLElement | null;
260
237
  onClose?: (() => void | null) | undefined;
261
238
  isIphone?: boolean | undefined;
262
239
  isIpad?: boolean | undefined;
263
- }>, nextState: Readonly<{}>, nextContext: any): void;
240
+ containerClassName?: string | undefined;
241
+ closeOnScrimClick?: boolean | undefined;
242
+ } & Omit<Props, "dialogRef">>, nextState: Readonly<{}>, nextContext: any): void;
264
243
  };
265
244
  displayName: string;
266
245
  defaultProps: {
@@ -34,11 +34,12 @@ export type DialogInnerProps = {
34
34
  flareClassName?: string;
35
35
  };
36
36
  export type Props = DialogInnerProps & {
37
+ dialogRef?: (ref: HTMLElement | null | undefined) => void;
37
38
  isOpen: boolean;
38
39
  renderTarget?: () => HTMLElement | null;
39
40
  onClose: (event?: TouchEvent | MouseEvent | KeyboardEvent) => void | null;
40
41
  closeLabel?: string;
41
42
  dismissible?: boolean;
42
43
  headerIcon?: ReactNode;
43
- headerIconType?: typeof HEADER_ICON_TYPES[keyof typeof HEADER_ICON_TYPES];
44
+ headerIconType?: (typeof HEADER_ICON_TYPES)[keyof typeof HEADER_ICON_TYPES];
44
45
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyscanner/backpack-web",
3
- "version": "25.4.0",
3
+ "version": "25.4.1",
4
4
  "description": "Backpack Design System web library",
5
5
  "repository": {
6
6
  "type": "git",