@skyscanner/backpack-web 23.3.0 → 24.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.
Files changed (37) hide show
  1. package/bpk-component-calendar/src/BpkCalendarContainer.d.ts +74 -39
  2. package/bpk-component-calendar/src/BpkCalendarContainer.js +4 -4
  3. package/bpk-component-calendar/src/composeCalendar.d.ts +6 -3
  4. package/bpk-component-calendar/src/composeCalendar.js +3 -3
  5. package/bpk-component-chip/src/BpkSelectableChip.js +0 -1
  6. package/bpk-component-dialog/src/BpkDialog.d.ts +1 -12
  7. package/bpk-component-dialog/src/BpkDialog.js +1 -1
  8. package/bpk-component-dialog/src/BpkDialogInner.d.ts +256 -2
  9. package/bpk-component-dialog/src/BpkDialogInner.js +0 -2
  10. package/bpk-component-dialog/src/common-types.d.ts +20 -21
  11. package/bpk-component-graphic-promotion/src/BpkGraphicPromo.js +0 -2
  12. package/bpk-component-modal/index.d.ts +26 -0
  13. package/bpk-component-modal/index.js +5 -5
  14. package/bpk-component-modal/src/BpkModal.d.ts +32 -0
  15. package/bpk-component-modal/src/BpkModal.js +24 -44
  16. package/bpk-component-modal/src/BpkModalInner.d.ts +39 -0
  17. package/bpk-component-modal/src/BpkModalInner.js +67 -84
  18. package/bpk-component-modal/src/BpkModalV2/BpKModal.module.css +1 -1
  19. package/bpk-component-modal/src/BpkModalV2/BpkModal.d.ts +1 -0
  20. package/bpk-component-modal/src/BpkModalV2/BpkModal.js +35 -19
  21. package/bpk-component-modal/src/legacy-prop-types.js +86 -0
  22. package/bpk-component-modal/src/themeAttributes.js +1 -0
  23. package/bpk-component-text/index.d.ts +21 -0
  24. package/bpk-component-text/index.js +0 -6
  25. package/bpk-component-text/src/BpkText.d.ts +60 -0
  26. package/bpk-component-text/src/BpkText.js +16 -56
  27. package/bpk-component-text/src/BpkText.module.css +1 -1
  28. package/bpk-component-tooltip/index.d.ts +24 -0
  29. package/bpk-component-tooltip/src/BpkTooltip.d.ts +29 -0
  30. package/bpk-component-tooltip/src/BpkTooltip.js +9 -26
  31. package/bpk-component-tooltip/src/BpkTooltipPortal.d.ts +60 -0
  32. package/bpk-component-tooltip/src/BpkTooltipPortal.js +13 -21
  33. package/bpk-component-tooltip/src/constants.d.ts +31 -0
  34. package/bpk-component-tooltip/src/constants.js +3 -1
  35. package/bpk-scrim-utils/index.d.ts +283 -0
  36. package/bpk-scrim-utils/src/withScrim.d.ts +2 -1
  37. package/package.json +1 -1
@@ -22,20 +22,25 @@ type Props = {
22
22
  fixedWidth: boolean;
23
23
  maxDate: Date;
24
24
  minDate: Date;
25
- onDateSelect?: (date: Date, newDate?: Date) => void;
26
- onMonthChange?: (event: UIEvent, { month, source }: {
25
+ onDateSelect?: ((date: Date, newDate?: Date) => void) | null;
26
+ onMonthChange?: ((event: UIEvent, { month, source }: {
27
27
  month: Date;
28
28
  source: string;
29
- }) => void;
29
+ }) => void) | null;
30
30
  selectionConfiguration: SelectionConfiguration;
31
31
  initiallyFocusedDate: Date | null;
32
32
  };
33
- type CalendarProps<P> = P & Props;
33
+ type InjectedProps = {
34
+ onDateClick: ((date: Date) => void) | null;
35
+ onDateKeyDown: ((event: KeyboardEvent) => void) | null;
36
+ month: Date;
37
+ };
38
+ type CalendarProps<P> = Omit<P & Props, keyof InjectedProps>;
34
39
  type State = {
35
40
  preventKeyboardFocus: boolean;
36
41
  focusedDate: Date;
37
42
  };
38
- declare const withCalendarState: <P extends {}>(Calendar: ComponentType<P>) => {
43
+ declare const withCalendarState: <P extends {}>(Calendar: ComponentType<P & InjectedProps>) => {
39
44
  new (props: CalendarProps<P>): {
40
45
  UNSAFE_componentWillReceiveProps(nextProps: CalendarProps<P>): void;
41
46
  handleDateFocus: (event: UIEvent, { date, source }: {
@@ -75,8 +80,8 @@ declare const withCalendarState: <P extends {}>(Calendar: ComponentType<P>) => {
75
80
  fixedWidth: boolean;
76
81
  maxDate: Date;
77
82
  minDate: Date;
78
- onDateSelect: () => void;
79
- onMonthChange: () => void;
83
+ onDateSelect: null;
84
+ onMonthChange: null;
80
85
  selectionConfiguration: {
81
86
  type: "single";
82
87
  date: null;
@@ -104,9 +109,12 @@ declare const _default: {
104
109
  focusedDate?: Date | null | undefined;
105
110
  markOutsideDays?: boolean | undefined;
106
111
  markToday?: boolean | undefined;
107
- onMonthChange?: (() => void) | undefined;
108
- onDateClick?: (() => void) | undefined;
109
- onDateKeyDown?: (() => void) | undefined;
112
+ onMonthChange?: ((event: UIEvent, { month, source }: {
113
+ month: Date;
114
+ source: string;
115
+ }) => void) | null | undefined;
116
+ onDateClick?: ((date: Date) => void) | null | undefined;
117
+ onDateKeyDown?: ((event: KeyboardEvent) => void) | null | undefined;
110
118
  preventKeyboardFocus?: boolean | undefined;
111
119
  selectionConfiguration?: SelectionConfiguration | undefined;
112
120
  gridClassName?: string | null | undefined;
@@ -134,9 +142,12 @@ declare const _default: {
134
142
  focusedDate?: Date | null | undefined;
135
143
  markOutsideDays?: boolean | undefined;
136
144
  markToday?: boolean | undefined;
137
- onMonthChange?: (() => void) | undefined;
138
- onDateClick?: (() => void) | undefined;
139
- onDateKeyDown?: (() => void) | undefined;
145
+ onMonthChange?: ((event: UIEvent, { month, source }: {
146
+ month: Date;
147
+ source: string;
148
+ }) => void) | null | undefined;
149
+ onDateClick?: ((date: Date) => void) | null | undefined;
150
+ onDateKeyDown?: ((event: KeyboardEvent) => void) | null | undefined;
140
151
  preventKeyboardFocus?: boolean | undefined;
141
152
  selectionConfiguration?: SelectionConfiguration | undefined;
142
153
  gridClassName?: string | null | undefined;
@@ -176,9 +187,12 @@ declare const _default: {
176
187
  focusedDate?: Date | null | undefined;
177
188
  markOutsideDays?: boolean | undefined;
178
189
  markToday?: boolean | undefined;
179
- onMonthChange?: (() => void) | undefined;
180
- onDateClick?: (() => void) | undefined;
181
- onDateKeyDown?: (() => void) | undefined;
190
+ onMonthChange?: ((event: UIEvent, { month, source }: {
191
+ month: Date;
192
+ source: string;
193
+ }) => void) | null | undefined;
194
+ onDateClick?: ((date: Date) => void) | null | undefined;
195
+ onDateKeyDown?: ((event: KeyboardEvent) => void) | null | undefined;
182
196
  preventKeyboardFocus?: boolean | undefined;
183
197
  selectionConfiguration?: SelectionConfiguration | undefined;
184
198
  gridClassName?: string | null | undefined;
@@ -207,9 +221,12 @@ declare const _default: {
207
221
  focusedDate?: Date | null | undefined;
208
222
  markOutsideDays?: boolean | undefined;
209
223
  markToday?: boolean | undefined;
210
- onMonthChange?: (() => void) | undefined;
211
- onDateClick?: (() => void) | undefined;
212
- onDateKeyDown?: (() => void) | undefined;
224
+ onMonthChange?: ((event: UIEvent, { month, source }: {
225
+ month: Date;
226
+ source: string;
227
+ }) => void) | null | undefined;
228
+ onDateClick?: ((date: Date) => void) | null | undefined;
229
+ onDateKeyDown?: ((event: KeyboardEvent) => void) | null | undefined;
213
230
  preventKeyboardFocus?: boolean | undefined;
214
231
  selectionConfiguration?: SelectionConfiguration | undefined;
215
232
  gridClassName?: string | null | undefined;
@@ -244,9 +261,12 @@ declare const _default: {
244
261
  focusedDate?: Date | null | undefined;
245
262
  markOutsideDays?: boolean | undefined;
246
263
  markToday?: boolean | undefined;
247
- onMonthChange?: (() => void) | undefined;
248
- onDateClick?: (() => void) | undefined;
249
- onDateKeyDown?: (() => void) | undefined;
264
+ onMonthChange?: ((event: UIEvent, { month, source }: {
265
+ month: Date;
266
+ source: string;
267
+ }) => void) | null | undefined;
268
+ onDateClick?: ((date: Date) => void) | null | undefined;
269
+ onDateKeyDown?: ((event: KeyboardEvent) => void) | null | undefined;
250
270
  preventKeyboardFocus?: boolean | undefined;
251
271
  selectionConfiguration?: SelectionConfiguration | undefined;
252
272
  gridClassName?: string | null | undefined;
@@ -276,9 +296,12 @@ declare const _default: {
276
296
  focusedDate?: Date | null | undefined;
277
297
  markOutsideDays?: boolean | undefined;
278
298
  markToday?: boolean | undefined;
279
- onMonthChange?: (() => void) | undefined;
280
- onDateClick?: (() => void) | undefined;
281
- onDateKeyDown?: (() => void) | undefined;
299
+ onMonthChange?: ((event: UIEvent, { month, source }: {
300
+ month: Date;
301
+ source: string;
302
+ }) => void) | null | undefined;
303
+ onDateClick?: ((date: Date) => void) | null | undefined;
304
+ onDateKeyDown?: ((event: KeyboardEvent) => void) | null | undefined;
282
305
  preventKeyboardFocus?: boolean | undefined;
283
306
  selectionConfiguration?: SelectionConfiguration | undefined;
284
307
  gridClassName?: string | null | undefined;
@@ -306,9 +329,12 @@ declare const _default: {
306
329
  focusedDate?: Date | null | undefined;
307
330
  markOutsideDays?: boolean | undefined;
308
331
  markToday?: boolean | undefined;
309
- onMonthChange?: (() => void) | undefined;
310
- onDateClick?: (() => void) | undefined;
311
- onDateKeyDown?: (() => void) | undefined;
332
+ onMonthChange?: ((event: UIEvent, { month, source }: {
333
+ month: Date;
334
+ source: string;
335
+ }) => void) | null | undefined;
336
+ onDateClick?: ((date: Date) => void) | null | undefined;
337
+ onDateKeyDown?: ((event: KeyboardEvent) => void) | null | undefined;
312
338
  preventKeyboardFocus?: boolean | undefined;
313
339
  selectionConfiguration?: SelectionConfiguration | undefined;
314
340
  gridClassName?: string | null | undefined;
@@ -338,9 +364,12 @@ declare const _default: {
338
364
  focusedDate?: Date | null | undefined;
339
365
  markOutsideDays?: boolean | undefined;
340
366
  markToday?: boolean | undefined;
341
- onMonthChange?: (() => void) | undefined;
342
- onDateClick?: (() => void) | undefined;
343
- onDateKeyDown?: (() => void) | undefined;
367
+ onMonthChange?: ((event: UIEvent, { month, source }: {
368
+ month: Date;
369
+ source: string;
370
+ }) => void) | null | undefined;
371
+ onDateClick?: ((date: Date) => void) | null | undefined;
372
+ onDateKeyDown?: ((event: KeyboardEvent) => void) | null | undefined;
344
373
  preventKeyboardFocus?: boolean | undefined;
345
374
  selectionConfiguration?: SelectionConfiguration | undefined;
346
375
  gridClassName?: string | null | undefined;
@@ -368,9 +397,12 @@ declare const _default: {
368
397
  focusedDate?: Date | null | undefined;
369
398
  markOutsideDays?: boolean | undefined;
370
399
  markToday?: boolean | undefined;
371
- onMonthChange?: (() => void) | undefined;
372
- onDateClick?: (() => void) | undefined;
373
- onDateKeyDown?: (() => void) | undefined;
400
+ onMonthChange?: ((event: UIEvent, { month, source }: {
401
+ month: Date;
402
+ source: string;
403
+ }) => void) | null | undefined;
404
+ onDateClick?: ((date: Date) => void) | null | undefined;
405
+ onDateKeyDown?: ((event: KeyboardEvent) => void) | null | undefined;
374
406
  preventKeyboardFocus?: boolean | undefined;
375
407
  selectionConfiguration?: SelectionConfiguration | undefined;
376
408
  gridClassName?: string | null | undefined;
@@ -398,9 +430,12 @@ declare const _default: {
398
430
  focusedDate?: Date | null | undefined;
399
431
  markOutsideDays?: boolean | undefined;
400
432
  markToday?: boolean | undefined;
401
- onMonthChange?: (() => void) | undefined;
402
- onDateClick?: (() => void) | undefined;
403
- onDateKeyDown?: (() => void) | undefined;
433
+ onMonthChange?: ((event: UIEvent, { month, source }: {
434
+ month: Date;
435
+ source: string;
436
+ }) => void) | null | undefined;
437
+ onDateClick?: ((date: Date) => void) | null | undefined;
438
+ onDateKeyDown?: ((event: KeyboardEvent) => void) | null | undefined;
404
439
  preventKeyboardFocus?: boolean | undefined;
405
440
  selectionConfiguration?: SelectionConfiguration | undefined;
406
441
  gridClassName?: string | null | undefined;
@@ -415,8 +450,8 @@ declare const _default: {
415
450
  fixedWidth: boolean;
416
451
  maxDate: Date;
417
452
  minDate: Date;
418
- onDateSelect: () => void;
419
- onMonthChange: () => void;
453
+ onDateSelect: null;
454
+ onMonthChange: null;
420
455
  selectionConfiguration: {
421
456
  type: "single";
422
457
  date: null;
@@ -252,10 +252,10 @@ const withCalendarState = Calendar => {
252
252
  const sanitisedFocusedDate = (0, _dateUtils.dateToBoundaries)(this.state.focusedDate, sanitisedMinDate, sanitisedMaxDate);
253
253
  const month = (0, _dateUtils.startOfMonth)(sanitisedFocusedDate);
254
254
  return /*#__PURE__*/(0, _jsxRuntime.jsx)(Calendar, _objectSpread(_objectSpread({
255
- onDateClick: this.handleDateSelect,
256
- onDateKeyDown: this.handleDateKeyDown,
257
255
  onMonthChange: this.handleMonthChange,
256
+ onDateClick: this.handleDateSelect,
258
257
  month: month,
258
+ onDateKeyDown: this.handleDateKeyDown,
259
259
  preventKeyboardFocus: this.state.preventKeyboardFocus,
260
260
  focusedDate: sanitisedFocusedDate
261
261
  }, calendarProps), {}, {
@@ -269,8 +269,8 @@ const withCalendarState = Calendar => {
269
269
  fixedWidth: true,
270
270
  maxDate: (0, _dateUtils.addMonths)(new Date(), 12),
271
271
  minDate: new Date(),
272
- onDateSelect: () => {},
273
- onMonthChange: () => {},
272
+ onDateSelect: null,
273
+ onMonthChange: null,
274
274
  selectionConfiguration: {
275
275
  type: _customProptypes.CALENDAR_SELECTION_TYPE.single,
276
276
  date: null
@@ -36,9 +36,12 @@ type Props = {
36
36
  focusedDate?: Date | null;
37
37
  markOutsideDays?: boolean;
38
38
  markToday?: boolean;
39
- onMonthChange?: () => void;
40
- onDateClick?: () => void;
41
- onDateKeyDown?: () => void;
39
+ onMonthChange?: ((event: UIEvent, { month, source }: {
40
+ month: Date;
41
+ source: string;
42
+ }) => void) | null;
43
+ onDateClick?: ((date: Date) => void) | null;
44
+ onDateKeyDown?: ((event: KeyboardEvent) => void) | null;
42
45
  preventKeyboardFocus?: boolean;
43
46
  selectionConfiguration?: SelectionConfiguration;
44
47
  gridClassName?: string | null;
@@ -53,9 +53,9 @@ const composeCalendar = (Nav, GridHeader, Grid, CalendarDate) => {
53
53
  month,
54
54
  navProps = {},
55
55
  nextMonthLabel = null,
56
- onDateClick = () => {},
57
- onDateKeyDown = () => {},
58
- onMonthChange = () => {},
56
+ onDateClick = null,
57
+ onDateKeyDown = null,
58
+ onMonthChange = null,
59
59
  preventKeyboardFocus = false,
60
60
  previousMonthLabel = null,
61
61
  selectionConfiguration = {
@@ -27,7 +27,6 @@ const _excluded = ["role", "selected", "trailingAccessoryView", "className", "di
27
27
  * See the License for the specific language governing permissions and
28
28
  * limitations under the License.
29
29
  */
30
- // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
31
30
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
32
31
  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); }
33
32
  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; }
@@ -18,16 +18,5 @@
18
18
 
19
19
  /// <reference types="react" />
20
20
  import type { Props } from './common-types';
21
-
22
- declare const BpkDialog: ({
23
- children,
24
- closeLabel,
25
- dismissible,
26
- headerIcon,
27
- headerIconType,
28
- isOpen,
29
- onClose,
30
- renderTarget,
31
- ...rest
32
- }: Props) => JSX.Element;
21
+ declare const BpkDialog: ({ children, closeLabel, dismissible, headerIcon, headerIconType, isOpen, onClose, renderTarget, ...rest }: Props) => JSX.Element;
33
22
  export default BpkDialog;
@@ -61,7 +61,7 @@ const BpkDialog = _ref => {
61
61
  onClose: onClose,
62
62
  closeOnScrimClick: dismissible,
63
63
  containerClassName: getClassName('bpk-dialog__container'),
64
- contentClassName: headerIcon ? getClassName('bpk-dialog--with-icon') : null
64
+ contentClassName: headerIcon ? getClassName('bpk-dialog--with-icon') : undefined
65
65
  }, rest), {}, {
66
66
  children: [headerIcon && /*#__PURE__*/(0, _jsxRuntime.jsx)("div", {
67
67
  className: headerIconClassNames,
@@ -16,6 +16,260 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- /* eslint-disable no-underscore-dangle */
20
- declare const _default: any;
19
+ /// <reference types="react" />
20
+ import { type DialogInnerProps as Props } from './common-types';
21
+ declare const _default: {
22
+ new (props: (Props & {
23
+ getApplicationElement: () => HTMLElement | null;
24
+ containerClassName?: string | undefined;
25
+ closeOnScrimClick?: boolean | undefined;
26
+ } & {
27
+ [rest: string]: any;
28
+ onClose?: (() => void | null) | undefined;
29
+ isIphone?: boolean | undefined;
30
+ isIpad?: boolean | undefined;
31
+ }) | Readonly<Props & {
32
+ getApplicationElement: () => HTMLElement | null;
33
+ containerClassName?: string | undefined;
34
+ closeOnScrimClick?: boolean | undefined;
35
+ } & {
36
+ [rest: string]: any;
37
+ onClose?: (() => void | null) | undefined;
38
+ isIphone?: boolean | undefined;
39
+ isIpad?: boolean | undefined;
40
+ }>): {
41
+ dialogElement?: import("react").RefObject<HTMLElement> | undefined;
42
+ componentDidMount(): void;
43
+ componentWillUnmount(): void;
44
+ dialogRef: (ref: import("react").RefObject<HTMLElement>) => void;
45
+ render(): JSX.Element;
46
+ 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
+ } & {
52
+ [rest: string]: any;
53
+ onClose?: (() => void | null) | undefined;
54
+ isIphone?: boolean | undefined;
55
+ 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
+ containerClassName?: string | undefined;
61
+ closeOnScrimClick?: boolean | undefined;
62
+ } & {
63
+ [rest: string]: any;
64
+ onClose?: (() => void | null) | undefined;
65
+ isIphone?: boolean | undefined;
66
+ isIpad?: boolean | undefined;
67
+ }> & Readonly<{
68
+ children?: import("react").ReactNode;
69
+ }>;
70
+ state: Readonly<{}>;
71
+ refs: {
72
+ [key: string]: import("react").ReactInstance;
73
+ };
74
+ shouldComponentUpdate?(nextProps: Readonly<Props & {
75
+ getApplicationElement: () => HTMLElement | null;
76
+ containerClassName?: string | undefined;
77
+ closeOnScrimClick?: boolean | undefined;
78
+ } & {
79
+ [rest: string]: any;
80
+ onClose?: (() => void | null) | undefined;
81
+ isIphone?: boolean | undefined;
82
+ 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
+ containerClassName?: string | undefined;
88
+ closeOnScrimClick?: boolean | undefined;
89
+ } & {
90
+ [rest: string]: any;
91
+ onClose?: (() => void | null) | undefined;
92
+ isIphone?: boolean | undefined;
93
+ isIpad?: boolean | undefined;
94
+ }>, prevState: Readonly<{}>): any;
95
+ componentDidUpdate?(prevProps: Readonly<Props & {
96
+ getApplicationElement: () => HTMLElement | null;
97
+ containerClassName?: string | undefined;
98
+ closeOnScrimClick?: boolean | undefined;
99
+ } & {
100
+ [rest: string]: any;
101
+ onClose?: (() => void | null) | undefined;
102
+ isIphone?: boolean | undefined;
103
+ 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
+ containerClassName?: string | undefined;
110
+ closeOnScrimClick?: boolean | undefined;
111
+ } & {
112
+ [rest: string]: any;
113
+ onClose?: (() => void | null) | undefined;
114
+ isIphone?: boolean | undefined;
115
+ isIpad?: boolean | undefined;
116
+ }>, nextContext: any): void;
117
+ UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Props & {
118
+ getApplicationElement: () => HTMLElement | null;
119
+ containerClassName?: string | undefined;
120
+ closeOnScrimClick?: boolean | undefined;
121
+ } & {
122
+ [rest: string]: any;
123
+ onClose?: (() => void | null) | undefined;
124
+ isIphone?: boolean | undefined;
125
+ isIpad?: boolean | undefined;
126
+ }>, nextContext: any): void;
127
+ componentWillUpdate?(nextProps: Readonly<Props & {
128
+ getApplicationElement: () => HTMLElement | null;
129
+ containerClassName?: string | undefined;
130
+ closeOnScrimClick?: boolean | undefined;
131
+ } & {
132
+ [rest: string]: any;
133
+ onClose?: (() => void | null) | undefined;
134
+ isIphone?: boolean | undefined;
135
+ isIpad?: boolean | undefined;
136
+ }>, nextState: Readonly<{}>, nextContext: any): void;
137
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<Props & {
138
+ getApplicationElement: () => HTMLElement | null;
139
+ containerClassName?: string | undefined;
140
+ closeOnScrimClick?: boolean | undefined;
141
+ } & {
142
+ [rest: string]: any;
143
+ onClose?: (() => void | null) | undefined;
144
+ isIphone?: boolean | undefined;
145
+ isIpad?: boolean | undefined;
146
+ }>, nextState: Readonly<{}>, nextContext: any): void;
147
+ };
148
+ new (props: Props & {
149
+ getApplicationElement: () => HTMLElement | null;
150
+ containerClassName?: string | undefined;
151
+ closeOnScrimClick?: boolean | undefined;
152
+ } & {
153
+ [rest: string]: any;
154
+ onClose?: (() => void | null) | undefined;
155
+ isIphone?: boolean | undefined;
156
+ isIpad?: boolean | undefined;
157
+ }, context: any): {
158
+ dialogElement?: import("react").RefObject<HTMLElement> | undefined;
159
+ componentDidMount(): void;
160
+ componentWillUnmount(): void;
161
+ dialogRef: (ref: import("react").RefObject<HTMLElement>) => void;
162
+ render(): JSX.Element;
163
+ 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
+ } & {
169
+ [rest: string]: any;
170
+ onClose?: (() => void | null) | undefined;
171
+ isIphone?: boolean | undefined;
172
+ 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
+ containerClassName?: string | undefined;
178
+ closeOnScrimClick?: boolean | undefined;
179
+ } & {
180
+ [rest: string]: any;
181
+ onClose?: (() => void | null) | undefined;
182
+ isIphone?: boolean | undefined;
183
+ isIpad?: boolean | undefined;
184
+ }> & Readonly<{
185
+ children?: import("react").ReactNode;
186
+ }>;
187
+ state: Readonly<{}>;
188
+ refs: {
189
+ [key: string]: import("react").ReactInstance;
190
+ };
191
+ shouldComponentUpdate?(nextProps: Readonly<Props & {
192
+ getApplicationElement: () => HTMLElement | null;
193
+ containerClassName?: string | undefined;
194
+ closeOnScrimClick?: boolean | undefined;
195
+ } & {
196
+ [rest: string]: any;
197
+ onClose?: (() => void | null) | undefined;
198
+ isIphone?: boolean | undefined;
199
+ 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
+ containerClassName?: string | undefined;
205
+ closeOnScrimClick?: boolean | undefined;
206
+ } & {
207
+ [rest: string]: any;
208
+ onClose?: (() => void | null) | undefined;
209
+ isIphone?: boolean | undefined;
210
+ isIpad?: boolean | undefined;
211
+ }>, prevState: Readonly<{}>): any;
212
+ componentDidUpdate?(prevProps: Readonly<Props & {
213
+ getApplicationElement: () => HTMLElement | null;
214
+ containerClassName?: string | undefined;
215
+ closeOnScrimClick?: boolean | undefined;
216
+ } & {
217
+ [rest: string]: any;
218
+ onClose?: (() => void | null) | undefined;
219
+ isIphone?: boolean | undefined;
220
+ 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
+ containerClassName?: string | undefined;
227
+ closeOnScrimClick?: boolean | undefined;
228
+ } & {
229
+ [rest: string]: any;
230
+ onClose?: (() => void | null) | undefined;
231
+ isIphone?: boolean | undefined;
232
+ isIpad?: boolean | undefined;
233
+ }>, nextContext: any): void;
234
+ UNSAFE_componentWillReceiveProps?(nextProps: Readonly<Props & {
235
+ getApplicationElement: () => HTMLElement | null;
236
+ containerClassName?: string | undefined;
237
+ closeOnScrimClick?: boolean | undefined;
238
+ } & {
239
+ [rest: string]: any;
240
+ onClose?: (() => void | null) | undefined;
241
+ isIphone?: boolean | undefined;
242
+ isIpad?: boolean | undefined;
243
+ }>, nextContext: any): void;
244
+ componentWillUpdate?(nextProps: Readonly<Props & {
245
+ getApplicationElement: () => HTMLElement | null;
246
+ containerClassName?: string | undefined;
247
+ closeOnScrimClick?: boolean | undefined;
248
+ } & {
249
+ [rest: string]: any;
250
+ onClose?: (() => void | null) | undefined;
251
+ isIphone?: boolean | undefined;
252
+ isIpad?: boolean | undefined;
253
+ }>, nextState: Readonly<{}>, nextContext: any): void;
254
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<Props & {
255
+ getApplicationElement: () => HTMLElement | null;
256
+ containerClassName?: string | undefined;
257
+ closeOnScrimClick?: boolean | undefined;
258
+ } & {
259
+ [rest: string]: any;
260
+ onClose?: (() => void | null) | undefined;
261
+ isIphone?: boolean | undefined;
262
+ isIpad?: boolean | undefined;
263
+ }>, nextState: Readonly<{}>, nextContext: any): void;
264
+ };
265
+ displayName: string;
266
+ defaultProps: {
267
+ onClose: null;
268
+ isIphone: boolean;
269
+ isIpad: boolean;
270
+ containerClassName: null;
271
+ closeOnScrimClick: boolean;
272
+ };
273
+ contextType?: import("react").Context<any> | undefined;
274
+ };
21
275
  export default _default;
@@ -30,8 +30,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
30
30
 
31
31
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
32
32
 
33
- // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
34
-
35
33
  const getClassName = (0, _bpkReactUtils.cssModules)(_BpkDialogInnerModule.default);
36
34
  const BpkDialogInner = props => {
37
35
  const {
@@ -16,30 +16,29 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- import type { ReactNode, SyntheticEvent } from 'react';
20
-
19
+ import type { ReactNode } from 'react';
21
20
  export declare const HEADER_ICON_TYPES: {
22
- readonly primary: 'primary';
23
- readonly warning: 'warning';
24
- readonly destructive: 'destructive';
21
+ readonly primary: "primary";
22
+ readonly warning: "warning";
23
+ readonly destructive: "destructive";
25
24
  };
26
25
  export type DialogInnerProps = {
27
- ariaLabel: string;
28
- id: string;
29
- children: ReactNode;
30
- dialogRef?: (ref: HTMLElement) => void;
31
- getApplicationElement: () => HTMLElement | null;
32
- className?: string;
33
- contentClassName?: string;
34
- flare?: boolean;
35
- flareClassName?: string;
26
+ ariaLabel: string;
27
+ id: string;
28
+ children: ReactNode;
29
+ dialogRef: (ref: HTMLElement | null | undefined) => void;
30
+ getApplicationElement: () => HTMLElement | null;
31
+ className?: string;
32
+ contentClassName?: string;
33
+ flare?: boolean;
34
+ flareClassName?: string;
36
35
  };
37
36
  export type Props = DialogInnerProps & {
38
- isOpen: boolean;
39
- renderTarget?: () => HTMLElement | null;
40
- onClose: (event: SyntheticEvent) => void | null;
41
- closeLabel?: string;
42
- dismissible?: boolean;
43
- headerIcon?: ReactNode;
44
- headerIconType?: typeof HEADER_ICON_TYPES[keyof typeof HEADER_ICON_TYPES];
37
+ isOpen: boolean;
38
+ renderTarget?: () => HTMLElement | null;
39
+ onClose: (event?: TouchEvent | MouseEvent | KeyboardEvent) => void | null;
40
+ closeLabel?: string;
41
+ dismissible?: boolean;
42
+ headerIcon?: ReactNode;
43
+ headerIconType?: typeof HEADER_ICON_TYPES[keyof typeof HEADER_ICON_TYPES];
45
44
  };
@@ -30,8 +30,6 @@ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { de
30
30
 
31
31
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
32
32
 
33
- // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
34
-
35
33
  const getClassName = (0, _bpkReactUtils.cssModules)(_BpkGraphicPromoModule.default);
36
34
  const ACCESSIBILITY_KEYS = {
37
35
  Enter: 13 /* Enter */,