@skyscanner/backpack-web 29.4.0 → 29.4.2

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 (47) hide show
  1. package/bpk-component-banner-alert/src/withBannerAlertState.d.ts +86 -143
  2. package/bpk-component-barchart/src/BpkBarchart.js +24 -2
  3. package/bpk-component-barchart/src/BpkChartAxis.js +2 -2
  4. package/bpk-component-breakpoint/src/BpkBreakpoint.d.ts +3 -0
  5. package/bpk-component-button/index.js +1 -1
  6. package/bpk-component-button/src/BpkButtonV2/BpkButton.d.ts +1 -16
  7. package/bpk-component-button/src/BpkButtonV2/BpkButton.js +4 -3
  8. package/bpk-component-calendar/index.d.ts +1 -1
  9. package/bpk-component-calendar/src/BpkCalendarContainer.d.ts +21 -331
  10. package/bpk-component-calendar/src/BpkCalendarDate.d.ts +8 -1
  11. package/bpk-component-calendar/src/BpkCalendarGrid.d.ts +15 -0
  12. package/bpk-component-calendar/src/BpkCalendarGridHeader.d.ts +9 -0
  13. package/bpk-component-calendar/src/BpkCalendarNav.d.ts +4 -0
  14. package/bpk-component-calendar/src/composeCalendar.d.ts +42 -1
  15. package/bpk-component-card-button/src/BpkSaveButton.js +1 -1
  16. package/bpk-component-chip/src/BpkDismissibleChip.d.ts +2 -7
  17. package/bpk-component-datatable/src/BpkDataTable.js +50 -1
  18. package/bpk-component-datepicker/src/BpkDatepicker.d.ts +25 -461
  19. package/bpk-component-dialog/src/common-types.d.ts +12 -0
  20. package/bpk-component-drawer/src/BpkDrawer.js +24 -4
  21. package/bpk-component-fieldset/src/BpkFieldset.js +3 -0
  22. package/bpk-component-floating-notification/src/BpkFloatingNotification.module.css +1 -1
  23. package/bpk-component-graphic-promotion/src/BpkGraphicPromo.d.ts +23 -31
  24. package/bpk-component-horizontal-nav/src/BpkHorizontalNav.js +24 -17
  25. package/bpk-component-horizontal-nav/src/BpkHorizontalNavItem.js +25 -17
  26. package/bpk-component-image/src/BpkImage.d.ts +4 -1
  27. package/bpk-component-input/src/common-types.d.ts +17 -3
  28. package/bpk-component-input/src/common-types.js +7 -0
  29. package/bpk-component-input/src/withOpenEvents.d.ts +13 -1
  30. package/bpk-component-list/src/BpkList.js +4 -1
  31. package/bpk-component-map/index.js +1 -1
  32. package/bpk-component-map/src/BpkMap.js +6 -0
  33. package/bpk-component-map/src/BpkPriceMarkerV2/BpkPriceMarker.d.ts +21 -32
  34. package/bpk-component-map/src/BpkPriceMarkerV2/BpkPriceMarker.js +2 -3
  35. package/bpk-component-mobile-scroll-container/src/BpkMobileScrollContainer.js +25 -20
  36. package/bpk-component-modal/src/BpkModal.d.ts +7 -1
  37. package/bpk-component-modal/src/BpkModalInner.d.ts +4 -1
  38. package/bpk-component-navigation-bar/src/BpkNavigationBar.js +1 -0
  39. package/bpk-component-nudger/src/BpkConfigurableNudger.d.ts +16 -0
  40. package/bpk-component-nudger/src/common-types.d.ts +17 -1
  41. package/bpk-component-nudger/src/common-types.js +22 -1
  42. package/bpk-component-overlay/src/BpkOverlay.d.ts +8 -3
  43. package/bpk-component-popover/src/BpkPopoverPortal.js +50 -24
  44. package/bpk-component-progress/src/BpkProgress.js +25 -19
  45. package/bpk-component-select/src/BpkSelect.js +7 -5
  46. package/bpk-component-tooltip/src/BpkTooltipPortal.d.ts +12 -0
  47. package/package.json +1 -1
@@ -18,7 +18,11 @@
18
18
 
19
19
  import type { ComponentType } from 'react';
20
20
  import type { SelectionConfiguration } from './custom-proptypes';
21
- type Props = {
21
+ export type Props = {
22
+ /**
23
+ * If set to true (default), it sets a fixed width on the calendar container. This is necessary to support transitions and to create the right size for the Datepicker component.
24
+ * If set to false, the calendar is of fluid width and will take up the space of its parent container.
25
+ */
22
26
  fixedWidth?: boolean;
23
27
  maxDate?: Date;
24
28
  minDate?: Date;
@@ -27,7 +31,13 @@ type Props = {
27
31
  month: Date;
28
32
  source: string;
29
33
  }) => void) | null;
34
+ /**
35
+ * An object to indicate which configuration of the calendar is being used. Choices are `single` date selection or `range` date selection.
36
+ */
30
37
  selectionConfiguration?: SelectionConfiguration;
38
+ /**
39
+ * 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).
40
+ */
31
41
  initiallyFocusedDate?: Date | null;
32
42
  markToday?: boolean;
33
43
  markOutsideDays?: boolean;
@@ -99,72 +109,8 @@ declare const withCalendarState: <P extends object>(Calendar: ComponentType<P>)
99
109
  contextType?: import("react").Context<any> | undefined;
100
110
  };
101
111
  declare const _default: {
102
- new (props: CalendarProps<{
103
- changeMonthLabel?: string | null | undefined;
104
- daysOfWeek: import("./custom-proptypes").DaysOfWeek;
105
- formatDateFull: (date: Date) => string | Date;
106
- formatMonth: (date: Date) => string | Date;
107
- id: string;
108
- maxDate: Date;
109
- minDate: Date;
110
- month: Date;
111
- nextMonthLabel?: string | null | undefined;
112
- previousMonthLabel?: string | null | undefined;
113
- weekStartsOn: 0 | 1 | 2 | 3 | 4 | 5 | 6;
114
- className?: string | null | undefined;
115
- dateModifiers?: import("./custom-proptypes").DateModifiers | undefined;
116
- fixedWidth?: boolean | undefined;
117
- focusedDate?: Date | null | undefined;
118
- markOutsideDays?: boolean | undefined;
119
- markToday?: boolean | undefined;
120
- onMonthChange?: ((event: UIEvent, { month, source }: {
121
- month: Date;
122
- source: string;
123
- }) => void) | null | undefined;
124
- onDateClick?: ((date: Date) => void) | null | undefined;
125
- onDateKeyDown?: ((event: KeyboardEvent) => void) | null | undefined;
126
- preventKeyboardFocus?: boolean | undefined;
127
- selectionConfiguration?: SelectionConfiguration | undefined;
128
- gridClassName?: string | null | undefined;
129
- weekDayKey?: string | undefined;
130
- navProps?: {} | null | undefined;
131
- headerProps?: {} | null | undefined;
132
- gridProps?: {} | null | undefined;
133
- dateProps?: {} | null | undefined;
134
- }>): {
135
- UNSAFE_componentWillReceiveProps(nextProps: CalendarProps<{
136
- changeMonthLabel?: string | null | undefined;
137
- daysOfWeek: import("./custom-proptypes").DaysOfWeek;
138
- formatDateFull: (date: Date) => string | Date;
139
- formatMonth: (date: Date) => string | Date;
140
- id: string;
141
- maxDate: Date;
142
- minDate: Date;
143
- month: Date;
144
- nextMonthLabel?: string | null | undefined;
145
- previousMonthLabel?: string | null | undefined;
146
- weekStartsOn: 0 | 1 | 2 | 3 | 4 | 5 | 6;
147
- className?: string | null | undefined;
148
- dateModifiers?: import("./custom-proptypes").DateModifiers | undefined;
149
- fixedWidth?: boolean | undefined;
150
- focusedDate?: Date | null | undefined;
151
- markOutsideDays?: boolean | undefined;
152
- markToday?: boolean | undefined;
153
- onMonthChange?: ((event: UIEvent, { month, source }: {
154
- month: Date;
155
- source: string;
156
- }) => void) | null | undefined;
157
- onDateClick?: ((date: Date) => void) | null | undefined;
158
- onDateKeyDown?: ((event: KeyboardEvent) => void) | null | undefined;
159
- preventKeyboardFocus?: boolean | undefined;
160
- selectionConfiguration?: SelectionConfiguration | undefined;
161
- gridClassName?: string | null | undefined;
162
- weekDayKey?: string | undefined;
163
- navProps?: {} | null | undefined;
164
- headerProps?: {} | null | undefined;
165
- gridProps?: {} | null | undefined;
166
- dateProps?: {} | null | undefined;
167
- }>): void;
112
+ new (props: CalendarProps<import("./composeCalendar").Props>): {
113
+ UNSAFE_componentWillReceiveProps(nextProps: CalendarProps<import("./composeCalendar").Props>): void;
168
114
  handleDateFocus: (event: UIEvent, { date, source }: {
169
115
  date: Date;
170
116
  source: string;
@@ -177,73 +123,9 @@ declare const _default: {
177
123
  handleDateKeyDown: (event: KeyboardEvent) => void;
178
124
  render(): JSX.Element;
179
125
  context: any;
180
- setState<K extends keyof State>(state: State | ((prevState: Readonly<State>, props: Readonly<CalendarProps<{
181
- changeMonthLabel?: string | null | undefined;
182
- daysOfWeek: import("./custom-proptypes").DaysOfWeek;
183
- formatDateFull: (date: Date) => string | Date;
184
- formatMonth: (date: Date) => string | Date;
185
- id: string;
186
- maxDate: Date;
187
- minDate: Date;
188
- month: Date;
189
- nextMonthLabel?: string | null | undefined;
190
- previousMonthLabel?: string | null | undefined;
191
- weekStartsOn: 0 | 1 | 2 | 3 | 4 | 5 | 6;
192
- className?: string | null | undefined;
193
- dateModifiers?: import("./custom-proptypes").DateModifiers | undefined;
194
- fixedWidth?: boolean | undefined;
195
- focusedDate?: Date | null | undefined;
196
- markOutsideDays?: boolean | undefined;
197
- markToday?: boolean | undefined;
198
- onMonthChange?: ((event: UIEvent, { month, source }: {
199
- month: Date;
200
- source: string;
201
- }) => void) | null | undefined;
202
- onDateClick?: ((date: Date) => void) | null | undefined;
203
- onDateKeyDown?: ((event: KeyboardEvent) => void) | null | undefined;
204
- preventKeyboardFocus?: boolean | undefined;
205
- selectionConfiguration?: SelectionConfiguration | undefined;
206
- gridClassName?: string | null | undefined;
207
- weekDayKey?: string | undefined;
208
- navProps?: {} | null | undefined;
209
- headerProps?: {} | null | undefined;
210
- gridProps?: {} | null | undefined;
211
- dateProps?: {} | null | undefined;
212
- }>>) => State | Pick<State, K> | null) | Pick<State, K> | null, callback?: (() => void) | undefined): void;
126
+ setState<K extends keyof State>(state: State | ((prevState: Readonly<State>, props: Readonly<CalendarProps<import("./composeCalendar").Props>>) => State | Pick<State, K> | null) | Pick<State, K> | null, callback?: (() => void) | undefined): void;
213
127
  forceUpdate(callback?: (() => void) | undefined): void;
214
- readonly props: Readonly<CalendarProps<{
215
- changeMonthLabel?: string | null | undefined;
216
- daysOfWeek: import("./custom-proptypes").DaysOfWeek;
217
- formatDateFull: (date: Date) => string | Date;
218
- formatMonth: (date: Date) => string | Date;
219
- id: string;
220
- maxDate: Date;
221
- minDate: Date;
222
- month: Date;
223
- nextMonthLabel?: string | null | undefined;
224
- previousMonthLabel?: string | null | undefined;
225
- weekStartsOn: 0 | 1 | 2 | 3 | 4 | 5 | 6;
226
- className?: string | null | undefined;
227
- dateModifiers?: import("./custom-proptypes").DateModifiers | undefined;
228
- fixedWidth?: boolean | undefined;
229
- focusedDate?: Date | null | undefined;
230
- markOutsideDays?: boolean | undefined;
231
- markToday?: boolean | undefined;
232
- onMonthChange?: ((event: UIEvent, { month, source }: {
233
- month: Date;
234
- source: string;
235
- }) => void) | null | undefined;
236
- onDateClick?: ((date: Date) => void) | null | undefined;
237
- onDateKeyDown?: ((event: KeyboardEvent) => void) | null | undefined;
238
- preventKeyboardFocus?: boolean | undefined;
239
- selectionConfiguration?: SelectionConfiguration | undefined;
240
- gridClassName?: string | null | undefined;
241
- weekDayKey?: string | undefined;
242
- navProps?: {} | null | undefined;
243
- headerProps?: {} | null | undefined;
244
- gridProps?: {} | null | undefined;
245
- dateProps?: {} | null | undefined;
246
- }>> & Readonly<{
128
+ readonly props: Readonly<CalendarProps<import("./composeCalendar").Props>> & Readonly<{
247
129
  children?: import("react").ReactNode;
248
130
  }>;
249
131
  state: Readonly<State>;
@@ -251,208 +133,16 @@ declare const _default: {
251
133
  [key: string]: import("react").ReactInstance;
252
134
  };
253
135
  componentDidMount?(): void;
254
- shouldComponentUpdate?(nextProps: Readonly<CalendarProps<{
255
- changeMonthLabel?: string | null | undefined;
256
- daysOfWeek: import("./custom-proptypes").DaysOfWeek;
257
- formatDateFull: (date: Date) => string | Date;
258
- formatMonth: (date: Date) => string | Date;
259
- id: string;
260
- maxDate: Date;
261
- minDate: Date;
262
- month: Date;
263
- nextMonthLabel?: string | null | undefined;
264
- previousMonthLabel?: string | null | undefined;
265
- weekStartsOn: 0 | 1 | 2 | 3 | 4 | 5 | 6;
266
- className?: string | null | undefined;
267
- dateModifiers?: import("./custom-proptypes").DateModifiers | undefined;
268
- fixedWidth?: boolean | undefined;
269
- focusedDate?: Date | null | undefined;
270
- markOutsideDays?: boolean | undefined;
271
- markToday?: boolean | undefined;
272
- onMonthChange?: ((event: UIEvent, { month, source }: {
273
- month: Date;
274
- source: string;
275
- }) => void) | null | undefined;
276
- onDateClick?: ((date: Date) => void) | null | undefined;
277
- onDateKeyDown?: ((event: KeyboardEvent) => void) | null | undefined;
278
- preventKeyboardFocus?: boolean | undefined;
279
- selectionConfiguration?: SelectionConfiguration | undefined;
280
- gridClassName?: string | null | undefined;
281
- weekDayKey?: string | undefined;
282
- navProps?: {} | null | undefined;
283
- headerProps?: {} | null | undefined;
284
- gridProps?: {} | null | undefined;
285
- dateProps?: {} | null | undefined;
286
- }>>, nextState: Readonly<State>, nextContext: any): boolean;
136
+ shouldComponentUpdate?(nextProps: Readonly<CalendarProps<import("./composeCalendar").Props>>, nextState: Readonly<State>, nextContext: any): boolean;
287
137
  componentWillUnmount?(): void;
288
138
  componentDidCatch?(error: Error, errorInfo: import("react").ErrorInfo): void;
289
- getSnapshotBeforeUpdate?(prevProps: Readonly<CalendarProps<{
290
- changeMonthLabel?: string | null | undefined;
291
- daysOfWeek: import("./custom-proptypes").DaysOfWeek;
292
- formatDateFull: (date: Date) => string | Date;
293
- formatMonth: (date: Date) => string | Date;
294
- id: string;
295
- maxDate: Date;
296
- minDate: Date;
297
- month: Date;
298
- nextMonthLabel?: string | null | undefined;
299
- previousMonthLabel?: string | null | undefined;
300
- weekStartsOn: 0 | 1 | 2 | 3 | 4 | 5 | 6;
301
- className?: string | null | undefined;
302
- dateModifiers?: import("./custom-proptypes").DateModifiers | undefined;
303
- fixedWidth?: boolean | undefined;
304
- focusedDate?: Date | null | undefined;
305
- markOutsideDays?: boolean | undefined;
306
- markToday?: boolean | undefined;
307
- onMonthChange?: ((event: UIEvent, { month, source }: {
308
- month: Date;
309
- source: string;
310
- }) => void) | null | undefined;
311
- onDateClick?: ((date: Date) => void) | null | undefined;
312
- onDateKeyDown?: ((event: KeyboardEvent) => void) | null | undefined;
313
- preventKeyboardFocus?: boolean | undefined;
314
- selectionConfiguration?: SelectionConfiguration | undefined;
315
- gridClassName?: string | null | undefined;
316
- weekDayKey?: string | undefined;
317
- navProps?: {} | null | undefined;
318
- headerProps?: {} | null | undefined;
319
- gridProps?: {} | null | undefined;
320
- dateProps?: {} | null | undefined;
321
- }>>, prevState: Readonly<State>): any;
322
- componentDidUpdate?(prevProps: Readonly<CalendarProps<{
323
- changeMonthLabel?: string | null | undefined;
324
- daysOfWeek: import("./custom-proptypes").DaysOfWeek;
325
- formatDateFull: (date: Date) => string | Date;
326
- formatMonth: (date: Date) => string | Date;
327
- id: string;
328
- maxDate: Date;
329
- minDate: Date;
330
- month: Date;
331
- nextMonthLabel?: string | null | undefined;
332
- previousMonthLabel?: string | null | undefined;
333
- weekStartsOn: 0 | 1 | 2 | 3 | 4 | 5 | 6;
334
- className?: string | null | undefined;
335
- dateModifiers?: import("./custom-proptypes").DateModifiers | undefined;
336
- fixedWidth?: boolean | undefined;
337
- focusedDate?: Date | null | undefined;
338
- markOutsideDays?: boolean | undefined;
339
- markToday?: boolean | undefined;
340
- onMonthChange?: ((event: UIEvent, { month, source }: {
341
- month: Date;
342
- source: string;
343
- }) => void) | null | undefined;
344
- onDateClick?: ((date: Date) => void) | null | undefined;
345
- onDateKeyDown?: ((event: KeyboardEvent) => void) | null | undefined;
346
- preventKeyboardFocus?: boolean | undefined;
347
- selectionConfiguration?: SelectionConfiguration | undefined;
348
- gridClassName?: string | null | undefined;
349
- weekDayKey?: string | undefined;
350
- navProps?: {} | null | undefined;
351
- headerProps?: {} | null | undefined;
352
- gridProps?: {} | null | undefined;
353
- dateProps?: {} | null | undefined;
354
- }>>, prevState: Readonly<State>, snapshot?: any): void;
139
+ getSnapshotBeforeUpdate?(prevProps: Readonly<CalendarProps<import("./composeCalendar").Props>>, prevState: Readonly<State>): any;
140
+ componentDidUpdate?(prevProps: Readonly<CalendarProps<import("./composeCalendar").Props>>, prevState: Readonly<State>, snapshot?: any): void;
355
141
  componentWillMount?(): void;
356
142
  UNSAFE_componentWillMount?(): void;
357
- componentWillReceiveProps?(nextProps: Readonly<CalendarProps<{
358
- changeMonthLabel?: string | null | undefined;
359
- daysOfWeek: import("./custom-proptypes").DaysOfWeek;
360
- formatDateFull: (date: Date) => string | Date;
361
- formatMonth: (date: Date) => string | Date;
362
- id: string;
363
- maxDate: Date;
364
- minDate: Date;
365
- month: Date;
366
- nextMonthLabel?: string | null | undefined;
367
- previousMonthLabel?: string | null | undefined;
368
- weekStartsOn: 0 | 1 | 2 | 3 | 4 | 5 | 6;
369
- className?: string | null | undefined;
370
- dateModifiers?: import("./custom-proptypes").DateModifiers | undefined;
371
- fixedWidth?: boolean | undefined;
372
- focusedDate?: Date | null | undefined;
373
- markOutsideDays?: boolean | undefined;
374
- markToday?: boolean | undefined;
375
- onMonthChange?: ((event: UIEvent, { month, source }: {
376
- month: Date;
377
- source: string;
378
- }) => void) | null | undefined;
379
- onDateClick?: ((date: Date) => void) | null | undefined;
380
- onDateKeyDown?: ((event: KeyboardEvent) => void) | null | undefined;
381
- preventKeyboardFocus?: boolean | undefined;
382
- selectionConfiguration?: SelectionConfiguration | undefined;
383
- gridClassName?: string | null | undefined;
384
- weekDayKey?: string | undefined;
385
- navProps?: {} | null | undefined;
386
- headerProps?: {} | null | undefined;
387
- gridProps?: {} | null | undefined;
388
- dateProps?: {} | null | undefined;
389
- }>>, nextContext: any): void;
390
- componentWillUpdate?(nextProps: Readonly<CalendarProps<{
391
- changeMonthLabel?: string | null | undefined;
392
- daysOfWeek: import("./custom-proptypes").DaysOfWeek;
393
- formatDateFull: (date: Date) => string | Date;
394
- formatMonth: (date: Date) => string | Date;
395
- id: string;
396
- maxDate: Date;
397
- minDate: Date;
398
- month: Date;
399
- nextMonthLabel?: string | null | undefined;
400
- previousMonthLabel?: string | null | undefined;
401
- weekStartsOn: 0 | 1 | 2 | 3 | 4 | 5 | 6;
402
- className?: string | null | undefined;
403
- dateModifiers?: import("./custom-proptypes").DateModifiers | undefined;
404
- fixedWidth?: boolean | undefined;
405
- focusedDate?: Date | null | undefined;
406
- markOutsideDays?: boolean | undefined;
407
- markToday?: boolean | undefined;
408
- onMonthChange?: ((event: UIEvent, { month, source }: {
409
- month: Date;
410
- source: string;
411
- }) => void) | null | undefined;
412
- onDateClick?: ((date: Date) => void) | null | undefined;
413
- onDateKeyDown?: ((event: KeyboardEvent) => void) | null | undefined;
414
- preventKeyboardFocus?: boolean | undefined;
415
- selectionConfiguration?: SelectionConfiguration | undefined;
416
- gridClassName?: string | null | undefined;
417
- weekDayKey?: string | undefined;
418
- navProps?: {} | null | undefined;
419
- headerProps?: {} | null | undefined;
420
- gridProps?: {} | null | undefined;
421
- dateProps?: {} | null | undefined;
422
- }>>, nextState: Readonly<State>, nextContext: any): void;
423
- UNSAFE_componentWillUpdate?(nextProps: Readonly<CalendarProps<{
424
- changeMonthLabel?: string | null | undefined;
425
- daysOfWeek: import("./custom-proptypes").DaysOfWeek;
426
- formatDateFull: (date: Date) => string | Date;
427
- formatMonth: (date: Date) => string | Date;
428
- id: string;
429
- maxDate: Date;
430
- minDate: Date;
431
- month: Date;
432
- nextMonthLabel?: string | null | undefined;
433
- previousMonthLabel?: string | null | undefined;
434
- weekStartsOn: 0 | 1 | 2 | 3 | 4 | 5 | 6;
435
- className?: string | null | undefined;
436
- dateModifiers?: import("./custom-proptypes").DateModifiers | undefined;
437
- fixedWidth?: boolean | undefined;
438
- focusedDate?: Date | null | undefined;
439
- markOutsideDays?: boolean | undefined;
440
- markToday?: boolean | undefined;
441
- onMonthChange?: ((event: UIEvent, { month, source }: {
442
- month: Date;
443
- source: string;
444
- }) => void) | null | undefined;
445
- onDateClick?: ((date: Date) => void) | null | undefined;
446
- onDateKeyDown?: ((event: KeyboardEvent) => void) | null | undefined;
447
- preventKeyboardFocus?: boolean | undefined;
448
- selectionConfiguration?: SelectionConfiguration | undefined;
449
- gridClassName?: string | null | undefined;
450
- weekDayKey?: string | undefined;
451
- navProps?: {} | null | undefined;
452
- headerProps?: {} | null | undefined;
453
- gridProps?: {} | null | undefined;
454
- dateProps?: {} | null | undefined;
455
- }>>, nextState: Readonly<State>, nextContext: any): void;
143
+ componentWillReceiveProps?(nextProps: Readonly<CalendarProps<import("./composeCalendar").Props>>, nextContext: any): void;
144
+ componentWillUpdate?(nextProps: Readonly<CalendarProps<import("./composeCalendar").Props>>, nextState: Readonly<State>, nextContext: any): void;
145
+ UNSAFE_componentWillUpdate?(nextProps: Readonly<CalendarProps<import("./composeCalendar").Props>>, nextState: Readonly<State>, nextContext: any): void;
456
146
  };
457
147
  defaultProps: {
458
148
  fixedWidth: boolean;
@@ -33,7 +33,7 @@ export declare const ROW_TYPES: {
33
33
  readonly end: "end";
34
34
  readonly both: "both";
35
35
  };
36
- export type SelectionTypes = typeof SELECTION_TYPES[keyof typeof SELECTION_TYPES];
36
+ export type SelectionTypes = (typeof SELECTION_TYPES)[keyof typeof SELECTION_TYPES];
37
37
  export type Props = DefaultProps & {
38
38
  date: Date;
39
39
  };
@@ -49,6 +49,13 @@ type DefaultProps = {
49
49
  onClick?: ((date: Date) => void) | null;
50
50
  onDateKeyDown?: (event: KeyboardEvent<HTMLButtonElement>) => void;
51
51
  preventKeyboardFocus?: boolean;
52
+ /**
53
+ * This property determines which selected styles will be applied to the date cell. If using ranges use `start`, `middle` and `end` to apply the correct range styles.
54
+ * - `SELECTION_TYPES.single` - When the date is selected individually i.e. Not as part of a range
55
+ * - `SELECTION_TYPES.start` - When a start date is selected in a range calendar i.e. First date in the range
56
+ * - `SELECTION_TYPES.middle` - When a date is in a range between start and end date i.e. Date in the middle of two dates
57
+ * - `SELECTION_TYPES.end` - When an end date is selected in a range calendar i.e. Last date in the range
58
+ */
52
59
  selectionType?: SelectionTypes;
53
60
  style?: {};
54
61
  };
@@ -32,14 +32,23 @@ type DefaultProps = {
32
32
  onDateClick: () => void;
33
33
  onDateKeyDown: () => void;
34
34
  preventKeyboardFocus: boolean;
35
+ /**
36
+ * An object to indicate which configuration of the calendar is being used. Choices are `single` date selection or `range` date selection.
37
+ */
35
38
  selectionConfiguration: SelectionConfiguration;
36
39
  ignoreOutsideDate: boolean;
37
40
  dateProps: {};
38
41
  };
39
42
  export type Props = DefaultProps & {
40
43
  DateComponent: ElementType;
44
+ /**
45
+ * A function to format a full, human-readable date, for example: "Monday, 8th January 2018".
46
+ */
41
47
  formatDateFull: (date: Date) => Date | string;
42
48
  month: Date;
49
+ /**
50
+ * First day of the week. 0 = Sunday, 1 = Monday, ..., 6 = Saturday.
51
+ */
43
52
  weekStartsOn: 0 | 1 | 2 | 3 | 4 | 5 | 6;
44
53
  };
45
54
  type State = {
@@ -53,8 +62,14 @@ declare class BpkCalendarGrid extends Component<Props, State> {
53
62
  }
54
63
  declare const BpkCalendarGridWithTransition: typeof BpkCalendarGrid | ((props: Omit<DefaultProps & {
55
64
  DateComponent: ElementType;
65
+ /**
66
+ * A function to format a full, human-readable date, for example: "Monday, 8th January 2018".
67
+ */
56
68
  formatDateFull: (date: Date) => Date | string;
57
69
  month: Date;
70
+ /**
71
+ * First day of the week. 0 = Sunday, 1 = Monday, ..., 6 = Saturday.
72
+ */
58
73
  weekStartsOn: 0 | 1 | 2 | 3 | 4 | 5 | 6;
59
74
  } & {
60
75
  TransitionComponent: ElementType<any>;
@@ -19,11 +19,20 @@
19
19
  import { PureComponent } from 'react';
20
20
  import type { DaysOfWeek, WeekDayKey } from './custom-proptypes';
21
21
  type Props = DefaultProps & {
22
+ /**
23
+ * An array of objects describing the days of the week
24
+ */
22
25
  daysOfWeek: DaysOfWeek;
26
+ /**
27
+ * First day of the week. 0 = Sunday, 1 = Monday, ..., 6 = Saturday.
28
+ */
23
29
  weekStartsOn: 0 | 1 | 2 | 3 | 4 | 5 | 6;
24
30
  };
25
31
  type DefaultProps = {
26
32
  className?: string | null;
33
+ /**
34
+ * Key to be used to pick the desired weekDay format from the `daysOfWeek` object, for example: `nameAbbr` or `nameNarrow`.
35
+ */
27
36
  weekDayKey?: WeekDayKey;
28
37
  };
29
38
  declare class BpkCalendarGridHeader extends PureComponent<Props> {
@@ -20,6 +20,10 @@ import type { ChangeEvent, MouseEvent } from 'react';
20
20
  type MonthChangeEvent = ChangeEvent<HTMLInputElement> | MouseEvent<HTMLButtonElement>;
21
21
  type Props = {
22
22
  changeMonthLabel: string;
23
+ /**
24
+ * A function to format a human-readable month, for example: "January 2018":
25
+ * If you just need to quickly prototype, use the following from [`date-fns`](https://date-fns.org/docs/format#usage)
26
+ */
23
27
  formatMonth: (month: Date) => string;
24
28
  id: string;
25
29
  maxDate: Date;
@@ -18,20 +18,46 @@
18
18
 
19
19
  import type { ComponentType } from 'react';
20
20
  import type { DaysOfWeek, SelectionConfiguration, DateModifiers } from './custom-proptypes';
21
- type Props = {
21
+ export type Props = {
22
+ /**
23
+ * **Required** if Nav !== null
24
+ */
22
25
  changeMonthLabel?: string | null;
26
+ /**
27
+ * An array of objects describing the days of the week
28
+ */
23
29
  daysOfWeek: DaysOfWeek;
30
+ /**
31
+ * A function to format a full, human-readable date, for example: "Monday, 8th January 2018".
32
+ */
24
33
  formatDateFull: (date: Date) => Date | string;
34
+ /**
35
+ * A function to format a human-readable month, for example: "January 2018":
36
+ * If you just need to quickly prototype, use the following from [`date-fns`](https://date-fns.org/docs/format#usage)
37
+ */
25
38
  formatMonth: (date: Date) => Date | string;
26
39
  id: string;
27
40
  maxDate: Date;
28
41
  minDate: Date;
29
42
  month: Date;
43
+ /**
44
+ * **Required** if Nav !== null
45
+ */
30
46
  nextMonthLabel?: string | null;
47
+ /**
48
+ * **Required** if Nav !== null
49
+ */
31
50
  previousMonthLabel?: string | null;
51
+ /**
52
+ * First day of the week. 0 = Sunday, 1 = Monday, ..., 6 = Saturday.
53
+ */
32
54
  weekStartsOn: 0 | 1 | 2 | 3 | 4 | 5 | 6;
33
55
  className?: string | null;
34
56
  dateModifiers?: DateModifiers;
57
+ /**
58
+ * If set to true (default), it sets a fixed width on the calendar container. This is necessary to support transitions and to create the right size for the Datepicker component.
59
+ * If set to false, the calendar is of fluid width and will take up the space of its parent container.
60
+ */
35
61
  fixedWidth?: boolean;
36
62
  focusedDate?: Date | null;
37
63
  markOutsideDays?: boolean;
@@ -45,10 +71,25 @@ type Props = {
45
71
  preventKeyboardFocus?: boolean;
46
72
  selectionConfiguration?: SelectionConfiguration;
47
73
  gridClassName?: string | null;
74
+ /**
75
+ * Key to be used to pick the desired weekDay format from the `daysOfWeek` object, for example: `nameAbbr` or `nameNarrow`.
76
+ */
48
77
  weekDayKey?: string;
78
+ /**
79
+ * This is useful if your custom implementation of Nav component requires additional properties. They will be passed, unmodified.
80
+ */
49
81
  navProps?: {} | null;
82
+ /**
83
+ * This is useful if your custom implementation of Header component requires additional properties. They will be passed, unmodified.
84
+ */
50
85
  headerProps?: {} | null;
86
+ /**
87
+ * This is useful if your custom implementation of Grid component requires additional properties. They will be passed, unmodified.
88
+ */
51
89
  gridProps?: {} | null;
90
+ /**
91
+ * This is useful if your custom implementation of Date component requires additional properties. They will be passed, unmodified.
92
+ */
52
93
  dateProps?: {} | null;
53
94
  };
54
95
  declare const composeCalendar: (Nav: ComponentType<any> | string | null, GridHeader: ComponentType<any> | string | null, Grid: ComponentType<any> | string, CalendarDate: ComponentType<any> | string | null) => ({ changeMonthLabel, className, dateModifiers, dateProps, daysOfWeek, fixedWidth, focusedDate, formatDateFull, formatMonth, gridClassName, gridProps, headerProps, id, markOutsideDays, markToday, maxDate, minDate, month, navProps, nextMonthLabel, onDateClick, onDateKeyDown, onMonthChange, preventKeyboardFocus, previousMonthLabel, selectionConfiguration, weekDayKey, weekStartsOn, }: Props) => JSX.Element;
@@ -17,7 +17,7 @@
17
17
  */
18
18
 
19
19
  import { useState } from 'react';
20
- import BpkButtonV2 from "../../bpk-component-button/src/BpkButtonV2/BpkButton";
20
+ import { BpkButtonV2 } from "../../bpk-component-button/src/BpkButtonV2/BpkButton";
21
21
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
22
22
  import BpkHeartIcon from "../../bpk-component-icon/lg/heart";
23
23
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
@@ -18,11 +18,6 @@
18
18
 
19
19
  /// <reference types="react" />
20
20
  import type { CommonProps as Props } from './commonTypes';
21
-
22
- declare const BpkDismissibleChip: ({
23
- className,
24
- leadingAccessoryView,
25
- type,
26
- ...rest
27
- }: Props) => JSX.Element;
21
+ type BpkDismissibleChipProps = Omit<Props, 'disabled' | 'selected'>;
22
+ declare const BpkDismissibleChip: ({ className, leadingAccessoryView, type, ...rest }: BpkDismissibleChipProps) => JSX.Element;
28
23
  export default BpkDismissibleChip;
@@ -167,15 +167,64 @@ const BpkDataTable = props => {
167
167
  };
168
168
  BpkDataTable.propTypes = {
169
169
  rows: PropTypes.arrayOf(Object).isRequired,
170
- children: PropTypes.node.isRequired,
170
+ /**
171
+ * @deprecated Use the columns prop instead to pass the columns to the BpkDataTable component.
172
+ */
173
+ children: PropTypes.node,
174
+ /**
175
+ * Array of objects describing the columns of the table.
176
+ * Note: Header and Cell props are functions to format the header and cell data respectively and should implement the following signatures:
177
+ * ```Header: function({disableSortBy, accessor, label})```,
178
+ * ```Cell: function({rowData, rowIndex, accessor, columnIndex, cellData})```
179
+ */
180
+ columns: PropTypes.arrayOf(PropTypes.shape({
181
+ accessor: PropTypes.string.isRequired,
182
+ Header: PropTypes.func,
183
+ disableSortBy: PropTypes.bool,
184
+ width: PropTypes.string,
185
+ minWidth: PropTypes.string,
186
+ flexGrow: PropTypes.number,
187
+ className: PropTypes.string,
188
+ headerClassName: PropTypes.string,
189
+ headerStyle: {},
190
+ Cell: PropTypes.func,
191
+ label: PropTypes.string,
192
+ style: {},
193
+ defaultSortDirection: PropTypes.oneOf(Object.keys(SORT_DIRECTION_TYPES))
194
+ })),
195
+ /**
196
+ * Table height. Please provide this value in rem.
197
+ */
171
198
  height: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
199
+ /**
200
+ * Table width. Please provide this value in rem.
201
+ * If not provided, the table will expand to fill the available space.
202
+ */
172
203
  width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
204
+ /**
205
+ * Height of the header row. Please provide this value in rem.
206
+ */
173
207
  headerHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
208
+ /**
209
+ * Height of each row. Please provide this value in rem.
210
+ */
174
211
  rowHeight: PropTypes.oneOfType([PropTypes.number, PropTypes.string]),
175
212
  className: PropTypes.string,
213
+ /**
214
+ * The data will be sorted by default based on this column.
215
+ */
176
216
  defaultColumnSortIndex: PropTypes.number,
217
+ /**
218
+ * For custom sorting, pass a sort function.
219
+ */
177
220
  sort: PropTypes.func,
221
+ /**
222
+ * Use sortBy to specify which column the custom sorting will be applied to.
223
+ */
178
224
  sortBy: PropTypes.string,
225
+ /**
226
+ * Use sortDirection to set the direction of sorting. By default, it will be ascending.
227
+ */
179
228
  sortDirection: PropTypes.oneOf(Object.keys(SORT_DIRECTION_TYPES))
180
229
  };
181
230
  BpkDataTable.defaultProps = {