@skyscanner/backpack-web 25.4.0 → 25.5.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 +2 -0
- package/bpk-component-dialog/src/BpkDialogInner.d.ts +86 -107
- package/bpk-component-dialog/src/common-types.d.ts +2 -1
- package/bpk-component-section-header/index.js +34 -0
- package/bpk-component-section-header/src/BpkSectionHeader.d.ts +32 -0
- package/bpk-component-section-header/src/BpkSectionHeader.js +55 -0
- package/bpk-component-section-header/src/BpkSectionHeader.module.css +18 -0
- package/package.json +1 -1
|
@@ -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: (
|
|
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
|
-
|
|
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:
|
|
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<
|
|
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
|
-
|
|
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<
|
|
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
|
-
|
|
133
|
+
containerClassName?: string | undefined;
|
|
134
|
+
closeOnScrimClick?: boolean | undefined;
|
|
135
|
+
} & Omit<Props, "dialogRef">>, nextState: Readonly<{}>, nextContext: any): void;
|
|
147
136
|
};
|
|
148
|
-
new (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
|
-
|
|
158
|
-
|
|
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:
|
|
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<
|
|
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
|
-
|
|
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<
|
|
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
|
-
|
|
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
|
};
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
Object.defineProperty(exports, "SECTION_TYPES", {
|
|
7
|
+
enumerable: true,
|
|
8
|
+
get: function () {
|
|
9
|
+
return _BpkSectionHeader.SECTION_TYPES;
|
|
10
|
+
}
|
|
11
|
+
});
|
|
12
|
+
exports.default = void 0;
|
|
13
|
+
var _BpkSectionHeader = _interopRequireWildcard(require("./src/BpkSectionHeader"));
|
|
14
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function (nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
15
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || typeof obj !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
16
|
+
/*
|
|
17
|
+
* Backpack - Skyscanner's Design System
|
|
18
|
+
*
|
|
19
|
+
* Copyright 2016 Skyscanner Ltd
|
|
20
|
+
*
|
|
21
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
22
|
+
* you may not use this file except in compliance with the License.
|
|
23
|
+
* You may obtain a copy of the License at
|
|
24
|
+
*
|
|
25
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
26
|
+
*
|
|
27
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
28
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
29
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
30
|
+
* See the License for the specific language governing permissions and
|
|
31
|
+
* limitations under the License.
|
|
32
|
+
*/
|
|
33
|
+
var _default = _BpkSectionHeader.default;
|
|
34
|
+
exports.default = _default;
|
|
@@ -0,0 +1,32 @@
|
|
|
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
|
+
import type { ReactNode } from 'react';
|
|
20
|
+
export declare const SECTION_TYPES: {
|
|
21
|
+
default: 'default',
|
|
22
|
+
onDark: 'onDark',
|
|
23
|
+
};
|
|
24
|
+
export type SectionType = (typeof SECTION_TYPES)[keyof typeof SECTION_TYPES];
|
|
25
|
+
type Props = {
|
|
26
|
+
title: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
button?: ReactNode;
|
|
29
|
+
type?: SectionType;
|
|
30
|
+
};
|
|
31
|
+
declare const BpkSectionHeader: ({ title, description, button, type }: Props) => JSX.Element;
|
|
32
|
+
export default BpkSectionHeader;
|
|
@@ -0,0 +1,55 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
|
|
3
|
+
Object.defineProperty(exports, "__esModule", {
|
|
4
|
+
value: true
|
|
5
|
+
});
|
|
6
|
+
exports.default = exports.SECTION_TYPES = void 0;
|
|
7
|
+
var _bpkReactUtils = require("../../bpk-react-utils");
|
|
8
|
+
var _bpkComponentText = _interopRequireDefault(require("../../bpk-component-text"));
|
|
9
|
+
var _BpkSectionHeaderModule = _interopRequireDefault(require("./BpkSectionHeader.module.css"));
|
|
10
|
+
var _jsxRuntime = require("react/jsx-runtime");
|
|
11
|
+
function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
|
|
12
|
+
/*
|
|
13
|
+
* Backpack - Skyscanner's Design System
|
|
14
|
+
*
|
|
15
|
+
* Copyright 2016 Skyscanner Ltd
|
|
16
|
+
*
|
|
17
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
18
|
+
* you may not use this file except in compliance with the License.
|
|
19
|
+
* You may obtain a copy of the License at
|
|
20
|
+
*
|
|
21
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
22
|
+
*
|
|
23
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
24
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
25
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
26
|
+
* See the License for the specific language governing permissions and
|
|
27
|
+
* limitations under the License.
|
|
28
|
+
*/
|
|
29
|
+
|
|
30
|
+
const getClassName = (0, _bpkReactUtils.cssModules)(_BpkSectionHeaderModule.default);
|
|
31
|
+
const SECTION_TYPES = {
|
|
32
|
+
default: 'default',
|
|
33
|
+
onDark: 'on-dark'
|
|
34
|
+
};
|
|
35
|
+
exports.SECTION_TYPES = SECTION_TYPES;
|
|
36
|
+
const BpkSectionHeader = ({
|
|
37
|
+
button,
|
|
38
|
+
description,
|
|
39
|
+
title,
|
|
40
|
+
type = SECTION_TYPES.default
|
|
41
|
+
}) => /*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
42
|
+
className: getClassName('bpk-section-header'),
|
|
43
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsxs)("div", {
|
|
44
|
+
className: getClassName('bpk-section-header__title-description', `bpk-section-header__title-description--${type}`),
|
|
45
|
+
children: [/*#__PURE__*/(0, _jsxRuntime.jsx)(_bpkComponentText.default, {
|
|
46
|
+
tagName: "h2",
|
|
47
|
+
className: getClassName('bpk-section-header__title'),
|
|
48
|
+
children: title
|
|
49
|
+
}), description && /*#__PURE__*/(0, _jsxRuntime.jsx)(_bpkComponentText.default, {
|
|
50
|
+
children: description
|
|
51
|
+
})]
|
|
52
|
+
}), button]
|
|
53
|
+
});
|
|
54
|
+
var _default = BpkSectionHeader;
|
|
55
|
+
exports.default = _default;
|
|
@@ -0,0 +1,18 @@
|
|
|
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
|
+
@keyframes bpk-keyframe-spin{100%{transform:rotate(1turn)}}.bpk-section-header{display:flex;justify-content:space-between;align-items:flex-start;background-color:transparent}.bpk-section-header__title-description{display:flex;flex-direction:column}.bpk-section-header__title-description--default{color:#161616}.bpk-section-header__title-description--on-dark{color:#fff}.bpk-section-header__title{font-size:2rem;line-height:2.5rem;font-weight:700}@media (max-width: 32rem){.bpk-section-header__title{font-size:1.5rem;line-height:1.75rem;font-weight:700}}
|