@skyscanner/backpack-web 42.27.3 → 43.0.0-dev-v28222480725.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.
Files changed (115) hide show
  1. package/bpk-component-accordion/src/BpkAccordionItem.d.ts +1 -1
  2. package/bpk-component-accordion/src/withAccordionItemState.d.ts +2 -7
  3. package/bpk-component-accordion/src/withAccordionItemState.js +4 -6
  4. package/bpk-component-accordion/src/withSingleItemAccordionState.d.ts +1 -1
  5. package/bpk-component-aria-live/src/BpkAriaLive.d.ts +1 -1
  6. package/bpk-component-aria-live/src/BpkAriaLive.story-helpers.d.ts +2 -2
  7. package/bpk-component-autosuggest/src/BpkAutosuggestV2/BpkAutosuggest.d.ts +4 -4
  8. package/bpk-component-badge/src/BpkBadge.module.css +1 -1
  9. package/bpk-component-banner-alert/src/AnimateAndFade.d.ts +4 -7
  10. package/bpk-component-banner-alert/src/AnimateAndFade.js +14 -10
  11. package/bpk-component-banner-alert/src/withBannerAlertState.d.ts +0 -10
  12. package/bpk-component-banner-alert/src/withBannerAlertState.js +3 -13
  13. package/bpk-component-barchart/src/BpkBarchart.js +24 -41
  14. package/bpk-component-barchart/src/BpkBarchartBar.js +7 -16
  15. package/bpk-component-barchart/src/BpkBarchartBars.js +6 -14
  16. package/bpk-component-barchart/src/BpkChartAxis.js +5 -12
  17. package/bpk-component-barchart/src/BpkChartDataTable.js +1 -4
  18. package/bpk-component-barchart/src/BpkChartGridLines.js +3 -8
  19. package/bpk-component-calendar/index.d.ts +2 -2
  20. package/bpk-component-calendar/index.js +2 -2
  21. package/bpk-component-calendar/src/BpkCalendarContainer.d.ts +3 -28
  22. package/bpk-component-calendar/src/BpkCalendarContainer.js +47 -34
  23. package/bpk-component-calendar/src/BpkCalendarDate.d.ts +0 -1
  24. package/bpk-component-calendar/src/BpkCalendarDate.js +32 -31
  25. package/bpk-component-calendar/src/BpkCalendarGrid.d.ts +13 -14
  26. package/bpk-component-calendar/src/BpkCalendarGrid.js +28 -37
  27. package/bpk-component-calendar/src/BpkCalendarGridHeader.d.ts +0 -4
  28. package/bpk-component-calendar/src/BpkCalendarGridHeader.js +2 -6
  29. package/bpk-component-calendar/src/BpkCalendarGridTransition.d.ts +0 -5
  30. package/bpk-component-calendar/src/BpkCalendarGridTransition.js +0 -5
  31. package/bpk-component-calendar/src/BpkCalendarWeek.d.ts +0 -1
  32. package/bpk-component-calendar/src/BpkCalendarWeek.js +19 -27
  33. package/bpk-component-calendar/src/custom-proptypes.d.ts +1 -1
  34. package/bpk-component-card-list/src/BpkCardList.js +0 -3
  35. package/bpk-component-card-list/src/BpkCardListRowRail/BpkCardListCarousel.js +1 -3
  36. package/bpk-component-card-list/src/BpkCardListRowRail/BpkCardListRowRailContainer.js +1 -14
  37. package/bpk-component-card-list/src/BpkCardListRowRail/utils.d.ts +1 -2
  38. package/bpk-component-card-list/src/BpkCardListRowRail/utils.js +0 -21
  39. package/bpk-component-card-list/src/common-types.d.ts +4 -7
  40. package/bpk-component-chatbot-input/src/hooks/useChatbotInput.d.ts +1 -1
  41. package/bpk-component-chatbot-input/src/hooks/useTextAreaAutoResize.d.ts +1 -1
  42. package/bpk-component-datepicker/src/BpkDatepicker.d.ts +6 -192
  43. package/bpk-component-datepicker/src/BpkDatepicker.js +47 -53
  44. package/bpk-component-dialog/src/BpkDialogInner.d.ts +0 -7
  45. package/bpk-component-drawer/src/BpkDrawerContent.d.ts +2 -2
  46. package/bpk-component-drawer/src/BpkDrawerContent.js +13 -1
  47. package/bpk-component-fieldset/src/BpkFieldset.d.ts +1 -1
  48. package/bpk-component-floating-notification/src/BpkFloatingNotification.js +4 -1
  49. package/bpk-component-grid-toggle/src/BpkGridToggle.js +9 -7
  50. package/bpk-component-image/src/BpkBackgroundImage.d.ts +1 -9
  51. package/bpk-component-image/src/BpkBackgroundImage.js +18 -18
  52. package/bpk-component-image/src/BpkImage.d.ts +1 -8
  53. package/bpk-component-image/src/BpkImage.js +10 -18
  54. package/bpk-component-image/src/withLazyLoading.d.ts +0 -4
  55. package/bpk-component-image/src/withLazyLoading.js +2 -6
  56. package/bpk-component-infinite-scroll/src/withInfiniteScroll.js +6 -8
  57. package/bpk-component-info-banner/src/AnimateAndFade.d.ts +4 -7
  58. package/bpk-component-info-banner/src/AnimateAndFade.js +14 -10
  59. package/bpk-component-info-banner/src/withBannerAlertState.d.ts +0 -10
  60. package/bpk-component-info-banner/src/withBannerAlertState.js +3 -13
  61. package/bpk-component-input/index.d.ts +2 -2
  62. package/bpk-component-input/index.js +2 -2
  63. package/bpk-component-input/src/BpkInput.d.ts +0 -13
  64. package/bpk-component-input/src/BpkInput.js +13 -12
  65. package/bpk-component-input/src/common-types.d.ts +0 -32
  66. package/bpk-component-input/src/common-types.js +1 -56
  67. package/bpk-component-input/src/withOpenEvents.d.ts +1 -12
  68. package/bpk-component-input/src/withOpenEvents.js +2 -14
  69. package/bpk-component-layout/src/types.d.ts +19 -35
  70. package/bpk-component-map/src/BpkBasicMapMarker.d.ts +1 -8
  71. package/bpk-component-map/src/BpkBasicMapMarker.js +0 -6
  72. package/bpk-component-map/src/BpkIconMarker.js +4 -10
  73. package/bpk-component-map/src/BpkIconMarkerBackground.js +3 -8
  74. package/bpk-component-map/src/BpkMap.js +14 -30
  75. package/bpk-component-map/src/withGoogleMapsScript.js +4 -8
  76. package/bpk-component-mobile-scroll-container/src/BpkMobileScrollContainer.d.ts +0 -1
  77. package/bpk-component-mobile-scroll-container/src/BpkMobileScrollContainer.js +1 -5
  78. package/bpk-component-modal/index.d.ts +1 -2
  79. package/bpk-component-modal/index.js +1 -3
  80. package/bpk-component-navigation-bar/src/BpkNavigationBar.d.ts +2 -2
  81. package/bpk-component-phone-input/src/BpkPhoneInput.js +6 -14
  82. package/bpk-component-popover/src/BpkPopover.d.ts +1 -1
  83. package/bpk-component-popover/src/BpkPopover.js +1 -1
  84. package/bpk-component-progress/src/BpkProgress.d.ts +0 -8
  85. package/bpk-component-progress/src/BpkProgress.js +10 -16
  86. package/bpk-component-scrollable-calendar/src/BpkScrollableCalendar.d.ts +0 -14
  87. package/bpk-component-section-list/src/BpkSectionListItem.js +4 -10
  88. package/bpk-component-section-list/src/BpkSectionListSection.js +1 -4
  89. package/bpk-component-segmented-control/src/BpkSegmentedControl.d.ts +1 -1
  90. package/bpk-component-select/src/BpkSelect.d.ts +1 -1
  91. package/bpk-component-slider/src/BpkSlider.js +1 -1
  92. package/bpk-component-spinner/src/SpinnerLayout.story-helpers.d.ts +1 -7
  93. package/bpk-component-spinner/src/SpinnerLayout.story-helpers.js +0 -4
  94. package/bpk-component-split-input/src/BpkInputField.d.ts +2 -6
  95. package/bpk-component-split-input/src/BpkInputField.js +2 -6
  96. package/bpk-component-split-input/src/BpkSplitInput.d.ts +0 -6
  97. package/bpk-component-split-input/src/BpkSplitInput.js +7 -13
  98. package/bpk-component-star-rating/src/withInteractiveStarRatingState.d.ts +0 -3
  99. package/bpk-component-star-rating/src/withInteractiveStarRatingState.js +0 -3
  100. package/bpk-component-ticket/src/BpkTicket.js +6 -14
  101. package/bpk-mixins/_badges.scss +3 -3
  102. package/bpk-react-utils/index.d.ts +3 -1
  103. package/bpk-react-utils/src/BpkDialogWrapper/BpkDialogWrapper.js +1 -0
  104. package/bpk-react-utils/src/Portal.d.ts +10 -22
  105. package/bpk-react-utils/src/Portal.js +22 -19
  106. package/bpk-react-utils/src/TransitionInitialMount.d.ts +4 -2
  107. package/bpk-react-utils/src/TransitionInitialMount.js +51 -14
  108. package/bpk-scrim-utils/index.d.ts +0 -7
  109. package/bpk-scrim-utils/src/withScrim.d.ts +0 -7
  110. package/bpk-scrim-utils/src/withScrim.js +10 -15
  111. package/bpk-stylesheets/base.css +1 -1
  112. package/bpk-stylesheets/theme-backpack-dark.css +4 -0
  113. package/bpk-stylesheets/theme-backpack-light.css +7 -3
  114. package/package.json +3 -3
  115. package/bpk-component-modal/src/legacy-prop-types.js +0 -74
@@ -40,7 +40,7 @@ declare const withOpenEvents: <P extends object>(WithOpenEventsInputComponent: C
40
40
  handleTouchEnd: (event: UIEvent) => void;
41
41
  handleFocus: () => void;
42
42
  handleBlur: () => void;
43
- render(): ReactElement;
43
+ render(): ReactElement<any>;
44
44
  context: unknown;
45
45
  setState<K extends never>(state: {} | ((prevState: Readonly<{}>, props: Readonly<P & import("react").ClassAttributes<HTMLInputElement> & import("react").InputHTMLAttributes<HTMLInputElement> & Omit<EventHandlers, "inputMode" | "aria-readonly" | "readOnly"> & WithOpenEventsProps>) => {} | Pick<{}, K> | null) | Pick<{}, K> | null, callback?: (() => void) | undefined): void;
46
46
  forceUpdate(callback?: (() => void) | undefined): void;
@@ -63,17 +63,6 @@ declare const withOpenEvents: <P extends object>(WithOpenEventsInputComponent: C
63
63
  UNSAFE_componentWillUpdate?(nextProps: Readonly<P & import("react").ClassAttributes<HTMLInputElement> & import("react").InputHTMLAttributes<HTMLInputElement> & Omit<EventHandlers, "inputMode" | "aria-readonly" | "readOnly"> & WithOpenEventsProps>, nextState: Readonly<{}>, nextContext: any): void;
64
64
  };
65
65
  displayName: string;
66
- defaultProps: {
67
- isOpen: boolean;
68
- hasTouchSupport: boolean;
69
- onOpen: null;
70
- onClick: null;
71
- onFocus: null;
72
- onBlur: null;
73
- onTouchEnd: null;
74
- onKeyDown: null;
75
- onKeyUp: null;
76
- };
77
66
  contextType?: import("react").Context<any> | undefined;
78
67
  };
79
68
  export default withOpenEvents;
@@ -23,6 +23,7 @@ const KEYCODES = {
23
23
  ENTER: 'Enter',
24
24
  SPACEBAR: 'Space'
25
25
  };
26
+ const HAS_TOUCH_SUPPORT = !!(typeof window !== 'undefined' && 'ontouchstart' in window);
26
27
  const handleKeyEvent = callback => e => {
27
28
  if (e.code === KEYCODES.ENTER || e.code === KEYCODES.SPACEBAR) {
28
29
  if (callback) {
@@ -40,19 +41,6 @@ const withEventHandler = (fn, eventHandler) => e => {
40
41
  };
41
42
  const withOpenEvents = WithOpenEventsInputComponent => {
42
43
  class WithOpenEvents extends Component {
43
- static defaultProps = {
44
- // Custom props
45
- isOpen: false,
46
- hasTouchSupport: !!(typeof window !== 'undefined' && 'ontouchstart' in window),
47
- onOpen: null,
48
- // Input props
49
- onClick: null,
50
- onFocus: null,
51
- onBlur: null,
52
- onTouchEnd: null,
53
- onKeyDown: null,
54
- onKeyUp: null
55
- };
56
44
  constructor(props) {
57
45
  super(props);
58
46
  this.focusCanOpen = true;
@@ -87,7 +75,7 @@ const withOpenEvents = WithOpenEventsInputComponent => {
87
75
  render() {
88
76
  const {
89
77
  className,
90
- hasTouchSupport,
78
+ hasTouchSupport = HAS_TOUCH_SUPPORT,
91
79
  isOpen,
92
80
  onBlur,
93
81
  onClick,
@@ -3,19 +3,6 @@ import type StackOptionKeys from './BpkStack.constant';
3
3
  import type { BpkCommonLayoutProps } from './commonProps';
4
4
  import type { BpkSpacingValue, BpkResponsiveValue, BpkBasisValue } from './tokens';
5
5
  import type { BoxProps, FlexProps, GridProps, GridItemProps, StackProps } from '@chakra-ui/react';
6
- /**
7
- * Layout-level event props that should not be exposed on layout components.
8
- * onClick is handled via BpkCommonLayoutProps; onFocus/onBlur are reintroduced
9
- * on BpkBoxProps only.
10
- */
11
- type LayoutEventProps = 'onMouseEnter' | 'onMouseLeave' | 'onMouseOver' | 'onMouseOut' | 'onMouseDown' | 'onMouseUp' | 'onFocus' | 'onBlur' | 'onKeyDown' | 'onKeyUp' | 'onKeyPress';
12
- /**
13
- * Shorthand props from the underlying layout system that we do NOT expose on
14
- * Backpack layout components. These mostly mirror longer-form spacing,
15
- * sizing and visual props that we already model explicitly via
16
- * BpkCommonLayoutProps and BpkFlexGridProps.
17
- */
18
- type DisallowedShorthandProps = 'p' | 'pt' | 'pr' | 'pb' | 'pl' | 'px' | 'py' | 'm' | 'mt' | 'mr' | 'mb' | 'ml' | 'mx' | 'my' | 'w' | 'h' | 'minW' | 'maxW' | 'minH' | 'maxH' | 'bg' | 'rounded' | 'shadow';
19
6
  /**
20
7
  * Flexbox & grid layout props that we explicitly support on Backpack layout
21
8
  * components. These are a curated subset of the underlying Box flex/grid API
@@ -79,17 +66,10 @@ type BpkBoxResponsiveLayoutProps = {
79
66
  };
80
67
  type BpkBoxResponsiveLayoutPropKeys = keyof BpkBoxResponsiveLayoutProps;
81
68
  /**
82
- * Base type that removes common layout props, reserved props (className,
83
- * children) and all layout-level event props from Chakra UI props.
84
- *
85
- * These will be replaced with Backpack-specific types.
86
- */
87
- export type RemoveCommonProps<T> = Omit<T, keyof BpkCommonLayoutProps | 'className' | 'children' | LayoutEventProps | FlexGridPropKeys | DisallowedShorthandProps>;
88
- /**
89
- * Component-specific props for BpkBox
90
- * Includes all Box props except those in BpkCommonLayoutProps
69
+ * Component-specific props for BpkBox.
70
+ * Explicit allowlist does NOT inherit from Chakra BoxProps.
91
71
  */
92
- export interface BpkBoxSpecificProps extends Omit<RemoveCommonProps<BoxProps>, BpkBoxResponsiveLayoutPropKeys>, BpkBoxResponsiveLayoutProps, Omit<BpkFlexGridProps, BpkBoxResponsiveLayoutPropKeys> {
72
+ export interface BpkBoxSpecificProps extends BpkBoxResponsiveLayoutProps, Omit<BpkFlexGridProps, BpkBoxResponsiveLayoutPropKeys> {
93
73
  }
94
74
  /**
95
75
  * Props for BpkBox component
@@ -147,10 +127,10 @@ export type BpkVesselProps = {
147
127
  as?: VesselElement;
148
128
  } & HTMLAttributes<HTMLElement>;
149
129
  /**
150
- * Component-specific props for BpkFlex
151
- * Includes all Flex props except those in BpkCommonLayoutProps
130
+ * Component-specific props for BpkFlex.
131
+ * Explicit allowlist does NOT inherit from Chakra FlexProps.
152
132
  */
153
- export interface BpkFlexSpecificProps extends RemoveCommonProps<FlexProps> {
133
+ export interface BpkFlexSpecificProps {
154
134
  direction?: BpkResponsiveValue<FlexProps['flexDirection']>;
155
135
  justify?: BpkResponsiveValue<FlexProps['justifyContent']>;
156
136
  align?: BpkResponsiveValue<FlexProps['alignItems']>;
@@ -168,10 +148,10 @@ export interface BpkFlexProps extends BpkCommonLayoutProps, BpkFlexSpecificProps
168
148
  children?: ReactNode;
169
149
  }
170
150
  /**
171
- * Component-specific props for BpkGrid
172
- * Includes all Grid props except those in BpkCommonLayoutProps
151
+ * Component-specific props for BpkGrid.
152
+ * Explicit allowlist does NOT inherit from Chakra GridProps.
173
153
  */
174
- export interface BpkGridSpecificProps extends RemoveCommonProps<GridProps> {
154
+ export interface BpkGridSpecificProps {
175
155
  justify?: BpkResponsiveValue<GridProps['justifyContent']>;
176
156
  align?: BpkResponsiveValue<GridProps['alignItems']>;
177
157
  templateColumns?: BpkResponsiveValue<GridProps['gridTemplateColumns']>;
@@ -194,10 +174,10 @@ export interface BpkGridProps extends BpkCommonLayoutProps, BpkGridSpecificProps
194
174
  children?: ReactNode;
195
175
  }
196
176
  /**
197
- * Component-specific props for BpkGridItem
198
- * Includes all GridItem props except those in BpkCommonLayoutProps
177
+ * Component-specific props for BpkGridItem.
178
+ * Explicit allowlist does NOT inherit from Chakra GridItemProps.
199
179
  */
200
- export interface BpkGridItemSpecificProps extends RemoveCommonProps<GridItemProps> {
180
+ export interface BpkGridItemSpecificProps {
201
181
  area?: GridItemProps['area'];
202
182
  colEnd?: GridItemProps['colEnd'];
203
183
  colStart?: GridItemProps['colStart'];
@@ -221,13 +201,17 @@ type BpkStackOptions = {
221
201
  [K in StackOptionKeysType]?: K extends keyof StackProps ? BpkResponsiveValue<StackProps[K]> | StackProps[K] : never;
222
202
  };
223
203
  /**
224
- * Component-specific props for BpkStack
225
- * Includes all Stack props except those in BpkCommonLayoutProps
204
+ * Component-specific props for BpkStack.
205
+ * Explicit allowlist does NOT inherit from Chakra StackProps.
226
206
  * Overrides StackOptions to support BpkResponsiveValue.
227
207
  * `alignItems` and `justifyContent` are accepted as semantic aliases for `align` and `justify`.
228
208
  * If both are provided, `align`/`justify` take precedence.
209
+ *
210
+ * `alignItems` and `justifyContent` are explicitly omitted from `BpkFlexGridProps` here so
211
+ * that the responsive alias declarations below (which match BpkStackOptions) unambiguously
212
+ * replace the non-responsive `BoxProps` variants from `BpkFlexGridProps`.
229
213
  */
230
- export interface BpkStackSpecificProps extends Omit<RemoveCommonProps<StackProps>, StackOptionKeysType>, BpkStackOptions, Omit<BpkFlexGridProps, 'alignItems' | 'justifyContent'> {
214
+ export interface BpkStackSpecificProps extends BpkStackOptions, Omit<BpkFlexGridProps, 'alignItems' | 'justifyContent'> {
231
215
  /** Alias for `align`. Maps to CSS `align-items`. Responsive — replaces the non-responsive BpkFlexGridProps.alignItems. */
232
216
  alignItems?: BpkStackOptions['align'];
233
217
  /** Alias for `justify`. Maps to CSS `justify-content`. Responsive — replaces the non-responsive BpkFlexGridProps.justifyContent. */
@@ -1,15 +1,8 @@
1
- import PropTypes from 'prop-types';
2
1
  import type { ReactNode } from 'react';
3
2
  import { type LatLong } from './common-types';
4
3
  type Props = {
5
4
  children: ReactNode;
6
5
  position: LatLong;
7
6
  };
8
- declare const BpkBasicMapMarker: {
9
- (props: Props): import("react/jsx-runtime").JSX.Element;
10
- propTypes: {
11
- children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
12
- position: any;
13
- };
14
- };
7
+ declare const BpkBasicMapMarker: (props: Props) => import("react/jsx-runtime").JSX.Element;
15
8
  export default BpkBasicMapMarker;
@@ -16,13 +16,11 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- import PropTypes from 'prop-types';
20
19
  import { getDataComponentAttribute } from "../../bpk-react-utils";
21
20
 
22
21
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
23
22
  import BpkOverlayView from "./BpkOverlayView";
24
23
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
25
- import { LatLongPropType } from "./common-types";
26
24
  import { jsx as _jsx } from "react/jsx-runtime";
27
25
  const getPixelPositionOffset = (width, height) => ({
28
26
  x: -(width / 2),
@@ -42,8 +40,4 @@ const BpkBasicMapMarker = props => {
42
40
  children: children
43
41
  });
44
42
  };
45
- BpkBasicMapMarker.propTypes = {
46
- children: PropTypes.node.isRequired,
47
- position: LatLongPropType.isRequired
48
- };
49
43
  export default BpkBasicMapMarker;
@@ -24,12 +24,12 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
24
  const getClassName = cssModules(STYLES);
25
25
  const BpkIconMarker = props => {
26
26
  const {
27
- buttonProps,
28
- className,
27
+ buttonProps = null,
28
+ className = null,
29
29
  icon,
30
- onClick,
30
+ onClick = null,
31
31
  position,
32
- selected,
32
+ selected = false,
33
33
  ...rest
34
34
  } = props;
35
35
  const wrapperClassNames = getClassName('bpk-icon-marker__wrapper', selected && 'bpk-icon-marker__wrapper--selected', className);
@@ -64,10 +64,4 @@ BpkIconMarker.propTypes = {
64
64
  selected: PropTypes.bool,
65
65
  buttonProps: PropTypes.object // eslint-disable-line react/forbid-prop-types
66
66
  };
67
- BpkIconMarker.defaultProps = {
68
- className: null,
69
- onClick: null,
70
- selected: false,
71
- buttonProps: null
72
- };
73
67
  export default BpkIconMarker;
@@ -20,9 +20,9 @@ import { jsx as _jsx } from "react/jsx-runtime";
20
20
  const getClassName = cssModules(STYLES);
21
21
  const BpkIconMarkerBackground = props => {
22
22
  const {
23
- disabled,
24
- interactive,
25
- selected,
23
+ disabled = false,
24
+ interactive = false,
25
+ selected = false,
26
26
  ...rest
27
27
  } = props;
28
28
  const classNames = getClassName('bpk-icon-marker-background', interactive && 'bpk-icon-marker-background--interactive', disabled && 'bpk-icon-marker-background--disabled', selected && 'bpk-icon-marker-background--selected');
@@ -61,9 +61,4 @@ const BpkIconMarkerBackground = props => {
61
61
  })
62
62
  );
63
63
  };
64
- BpkIconMarkerBackground.defaultProps = {
65
- disabled: false,
66
- interactive: false,
67
- selected: false
68
- };
69
64
  export default BpkIconMarkerBackground;
@@ -24,20 +24,20 @@ import { jsx as _jsx } from "react/jsx-runtime";
24
24
  const getClassName = cssModules(STYLES);
25
25
  const BpkMap = props => {
26
26
  const {
27
- bounds,
28
- center,
29
- children,
30
- className,
31
- greedyGestureHandling,
32
- mapId,
33
- mapOptionStyles,
34
- mapRef,
35
- onRegionChange,
36
- onTilesLoaded,
37
- onZoom,
38
- panEnabled,
39
- showControls,
40
- zoom
27
+ bounds = null,
28
+ center = undefined,
29
+ children = null,
30
+ className = null,
31
+ greedyGestureHandling = false,
32
+ mapId = null,
33
+ mapOptionStyles = null,
34
+ mapRef = null,
35
+ onRegionChange = null,
36
+ onTilesLoaded = null,
37
+ onZoom = null,
38
+ panEnabled = true,
39
+ showControls = true,
40
+ zoom = 15
41
41
  } = props;
42
42
  if (!bounds && !center) {
43
43
  throw new Error('BpkMap: Provide either `bounds` or `center` props.');
@@ -138,20 +138,4 @@ BpkMap.propTypes = {
138
138
  })),
139
139
  mapId: PropTypes.string
140
140
  };
141
- BpkMap.defaultProps = {
142
- bounds: null,
143
- center: undefined,
144
- children: null,
145
- greedyGestureHandling: false,
146
- mapRef: null,
147
- onRegionChange: null,
148
- onZoom: null,
149
- onTilesLoaded: null,
150
- panEnabled: true,
151
- showControls: true,
152
- zoom: 15,
153
- className: null,
154
- mapOptionStyles: null,
155
- mapId: null
156
- };
157
141
  export default BpkMap;
@@ -19,12 +19,13 @@ import { useJsApiLoader } from '@react-google-maps/api';
19
19
  import DefaultLoadingElement from "./DefaultLoadingElement";
20
20
  import { jsx as _jsx } from "react/jsx-runtime";
21
21
  export const LibraryShapeType = PropTypes.arrayOf(PropTypes.oneOf(['drawing', 'geometry', 'localContext', 'places', 'visualization']));
22
+ const DEFAULT_LIBRARIES = ['geometry', 'drawing', 'places'];
22
23
  function withGoogleMapsScript(Component) {
23
24
  const WithGoogleMapsScript = ({
24
25
  googleMapsApiKey,
25
- libraries,
26
- loadingElement,
27
- preventGoogleFontsLoading,
26
+ libraries = DEFAULT_LIBRARIES,
27
+ loadingElement = /*#__PURE__*/_jsx(DefaultLoadingElement, {}),
28
+ preventGoogleFontsLoading = false,
28
29
  ...rest
29
30
  }) => {
30
31
  const {
@@ -52,11 +53,6 @@ function withGoogleMapsScript(Component) {
52
53
  libraries: LibraryShapeType,
53
54
  preventGoogleFontsLoading: PropTypes.bool
54
55
  };
55
- WithGoogleMapsScript.defaultProps = {
56
- loadingElement: /*#__PURE__*/_jsx(DefaultLoadingElement, {}),
57
- preventGoogleFontsLoading: false,
58
- libraries: ['geometry', 'drawing', 'places']
59
- };
60
56
  return WithGoogleMapsScript;
61
57
  }
62
58
  export default withGoogleMapsScript;
@@ -21,7 +21,6 @@ type State = {
21
21
  };
22
22
  declare class BpkMobileScrollContainer extends Component<Props, State> {
23
23
  debouncedResize: DebouncedFunc<() => void>;
24
- static defaultProps: Partial<Props>;
25
24
  constructor(props: Props);
26
25
  componentDidMount(): void;
27
26
  componentWillUnmount(): void;
@@ -52,10 +52,6 @@ const computeScrollIndicatorClassName = (scrollerEl, leadingIndicatorClassName,
52
52
  return classNames;
53
53
  };
54
54
  class BpkMobileScrollContainer extends Component {
55
- static defaultProps = {
56
- innerContainerTagName: 'div',
57
- showScrollbar: false
58
- };
59
55
  constructor(props) {
60
56
  super(props);
61
57
  this.state = {
@@ -111,7 +107,7 @@ class BpkMobileScrollContainer extends Component {
111
107
  leadingIndicatorClassName,
112
108
  onScroll,
113
109
  scrollerRef,
114
- showScrollbar,
110
+ showScrollbar = false,
115
111
  style,
116
112
  trailingIndicatorClassName,
117
113
  ...rest
@@ -3,9 +3,8 @@ import { MODAL_STYLING } from './src/BpkModalInner';
3
3
  import { BpkModalV2 } from './src/BpkModalV2/BpkModal';
4
4
  import BpkModalV3 from './src/BpkModalV3/BpkModalV3';
5
5
  import { MODAL_V3_TYPES } from './src/BpkModalV3/common-types';
6
- import { propTypes, defaultProps } from './src/legacy-prop-types';
7
6
  import themeAttributes from './src/themeAttributes';
8
7
  import type { Props } from './src/BpkModal';
9
8
  export type BpkModalProps = Props;
10
9
  export default BpkModal;
11
- export { propTypes, defaultProps, themeAttributes, BpkModalV2, BpkModalV3, MODAL_V3_TYPES, MODAL_STYLING, };
10
+ export { themeAttributes, BpkModalV2, BpkModalV3, MODAL_V3_TYPES, MODAL_STYLING, };
@@ -21,8 +21,6 @@ import { MODAL_STYLING } from "./src/BpkModalInner";
21
21
  import { BpkModalV2 } from "./src/BpkModalV2/BpkModal";
22
22
  import BpkModalV3 from "./src/BpkModalV3/BpkModalV3";
23
23
  import { MODAL_V3_TYPES } from "./src/BpkModalV3/common-types";
24
- // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
25
- import { propTypes, defaultProps } from "./src/legacy-prop-types";
26
24
  import themeAttributes from "./src/themeAttributes";
27
25
  export default BpkModal;
28
- export { propTypes, defaultProps, themeAttributes, BpkModalV2, BpkModalV3, MODAL_V3_TYPES, MODAL_STYLING };
26
+ export { themeAttributes, BpkModalV2, BpkModalV3, MODAL_V3_TYPES, MODAL_STYLING };
@@ -14,8 +14,8 @@ export type Props = {
14
14
  * Note: this prop only applies when `title` is a string; ReactNode titles are not truncated and wrap naturally. */
15
15
  wrapTitle?: boolean;
16
16
  className?: string;
17
- leadingButton?: ReactElement | null;
18
- trailingButton?: ReactElement | null;
17
+ leadingButton?: ReactElement<any> | null;
18
+ trailingButton?: ReactElement<any> | null;
19
19
  sticky?: boolean;
20
20
  barStyle?: BarStyle;
21
21
  [rest: string]: any;
@@ -24,21 +24,21 @@ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
24
24
  const getClassName = cssModules(STYLES);
25
25
  const BpkPhoneInput = props => {
26
26
  const {
27
- className,
27
+ className = null,
28
28
  dialingCode,
29
- dialingCodeMask,
29
+ dialingCodeMask = false,
30
30
  dialingCodeProps,
31
31
  dialingCodes,
32
- disabled,
32
+ disabled = false,
33
33
  id,
34
34
  label,
35
- large,
35
+ large = false,
36
36
  name,
37
37
  onChange,
38
38
  onDialingCodeChange,
39
- valid,
39
+ valid = null,
40
40
  value,
41
- wrapperProps,
41
+ wrapperProps = {},
42
42
  ...rest
43
43
  } = props;
44
44
  const commonProps = {
@@ -164,12 +164,4 @@ BpkPhoneInput.propTypes = {
164
164
  valid: PropTypes.bool,
165
165
  wrapperProps: PropTypes.object // eslint-disable-line react/forbid-prop-types
166
166
  };
167
- BpkPhoneInput.defaultProps = {
168
- className: null,
169
- disabled: false,
170
- dialingCodeMask: false,
171
- large: false,
172
- valid: null,
173
- wrapperProps: {}
174
- };
175
167
  export default BpkPhoneInput;
@@ -34,7 +34,7 @@ export type Props = CloseButtonProps & {
34
34
  actionText?: string;
35
35
  zIndexValue?: number;
36
36
  onAction?: () => void;
37
- renderTarget?: () => HTMLElement | HTMLElement | undefined;
37
+ renderTarget?: null | HTMLElement | (() => HTMLElement | null | undefined);
38
38
  [rest: string]: any;
39
39
  };
40
40
  declare const BpkPopover: ({ actionText, children, className, closeButtonIcon, closeButtonLabel, closeButtonProps, closeButtonText, hoverable, id, isOpen, label, labelAsTitle, onAction, onClose, padded, placement, renderTarget, showArrow, target, zIndexValue, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
@@ -135,7 +135,7 @@ const BpkPopover = ({
135
135
  const renderElement = typeof renderTarget === 'function' ? renderTarget() : renderTarget;
136
136
  return /*#__PURE__*/_jsxs(_Fragment, {
137
137
  children: [targetElement, isOpenState && /*#__PURE__*/_jsx(FloatingPortal, {
138
- root: renderElement,
138
+ root: renderElement ?? undefined,
139
139
  children: /*#__PURE__*/_jsx(FloatingFocusManager, {
140
140
  context: context,
141
141
  children: /*#__PURE__*/_jsx("div", {
@@ -12,14 +12,6 @@ export type Props = Omit<NativeDivProps, 'className'> & {
12
12
  getValueText?: ((value: number, min: number, max: number) => string) | null;
13
13
  };
14
14
  declare class BpkProgress extends Component<Props> {
15
- static defaultProps: {
16
- className: null;
17
- stepped: boolean;
18
- small: boolean;
19
- onComplete: () => null;
20
- onCompleteTransitionEnd: () => null;
21
- getValueText: null;
22
- };
23
15
  componentDidUpdate(previousProps: Props): void;
24
16
  handleCompleteTransitionEnd: () => void;
25
17
  render(): import("react/jsx-runtime").JSX.Element;
@@ -37,23 +37,17 @@ const renderSteps = numberOfSteps => {
37
37
  return steps;
38
38
  };
39
39
  class BpkProgress extends Component {
40
- static defaultProps = {
41
- className: null,
42
- stepped: false,
43
- small: false,
44
- onComplete: () => null,
45
- onCompleteTransitionEnd: () => null,
46
- getValueText: null
47
- };
48
40
  componentDidUpdate(previousProps) {
49
41
  const {
50
42
  max,
43
+ onComplete,
44
+ onCompleteTransitionEnd,
51
45
  value
52
46
  } = this.props;
53
- if (value >= max && value !== previousProps.value && this.props.onComplete) {
54
- this.props.onComplete();
55
- if (!isTransitionEndSupported() && this.props.onCompleteTransitionEnd) {
56
- this.props.onCompleteTransitionEnd();
47
+ if (value >= max && value !== previousProps.value) {
48
+ onComplete?.();
49
+ if (!isTransitionEndSupported() && onCompleteTransitionEnd) {
50
+ onCompleteTransitionEnd();
57
51
  }
58
52
  }
59
53
  }
@@ -69,14 +63,14 @@ class BpkProgress extends Component {
69
63
  };
70
64
  render() {
71
65
  const {
72
- className,
73
- getValueText,
66
+ className = null,
67
+ getValueText = null,
74
68
  max,
75
69
  min,
76
70
  onComplete,
77
71
  onCompleteTransitionEnd,
78
- small,
79
- stepped,
72
+ small = false,
73
+ stepped = false,
80
74
  value,
81
75
  ...rest
82
76
  } = this.props;
@@ -145,20 +145,6 @@ declare const _default: {
145
145
  focusedDate: Date;
146
146
  }>, nextContext: any): void;
147
147
  };
148
- defaultProps: {
149
- fixedWidth: boolean;
150
- maxDate: Date;
151
- minDate: Date;
152
- onDateSelect: null;
153
- onMonthChange: null;
154
- selectionConfiguration: {
155
- type: "single";
156
- date: null;
157
- };
158
- initiallyFocusedDate: null;
159
- markToday: boolean;
160
- markOutsideDays: boolean;
161
- };
162
148
  contextType?: import("react").Context<any> | undefined;
163
149
  };
164
150
  export default _default;
@@ -24,11 +24,11 @@ const BpkLargeChevronRightIconWithRtlSupport = withRtlSupport(BpkLargeChevronRig
24
24
  const getClassName = cssModules(STYLES);
25
25
  const BpkSectionListItem = props => {
26
26
  const {
27
- blank,
27
+ blank = false,
28
28
  children,
29
- className,
30
- href,
31
- onClick,
29
+ className = null,
30
+ href = null,
31
+ onClick = null,
32
32
  ...rest
33
33
  } = props;
34
34
  const classNames = [getClassName('bpk-section-list-item', (href || onClick) && 'bpk-section-list-item--interactive', className)];
@@ -83,10 +83,4 @@ BpkSectionListItem.propTypes = {
83
83
  href: PropTypes.string,
84
84
  onClick: PropTypes.func
85
85
  };
86
- BpkSectionListItem.defaultProps = {
87
- blank: false,
88
- className: null,
89
- href: null,
90
- onClick: null
91
- };
92
86
  export default BpkSectionListItem;
@@ -24,7 +24,7 @@ const getClassName = cssModules(STYLES);
24
24
  const BpkSectionListSection = props => {
25
25
  const {
26
26
  children,
27
- headerText,
27
+ headerText = null,
28
28
  ...rest
29
29
  } = props;
30
30
  return /*#__PURE__*/_jsxs("section", {
@@ -47,7 +47,4 @@ BpkSectionListSection.propTypes = {
47
47
  children: PropTypes.node.isRequired,
48
48
  headerText: PropTypes.string
49
49
  };
50
- BpkSectionListSection.defaultProps = {
51
- headerText: null
52
- };
53
50
  export default BpkSectionListSection;
@@ -27,7 +27,7 @@ export type TabPanelProps = {
27
27
  export declare const useSegmentedControlPanels: (buttonContents: string[] | ReactNode[], selectedIndex: number) => {
28
28
  controlProps: {
29
29
  id: string;
30
- buttonContents: string[] | ReactNode[];
30
+ buttonContents: ReactNode[] | string[];
31
31
  selectedIndex: number;
32
32
  };
33
33
  getPanelProps: (index: number) => TabPanelProps;
@@ -9,7 +9,7 @@ export type Props = Omit<SelectHTMLAttributes<HTMLSelectElement>, 'className' |
9
9
  dockedFirst?: boolean;
10
10
  dockedLast?: boolean;
11
11
  dockedMiddle?: boolean;
12
- image?: ReactElement | null;
12
+ image?: ReactElement<any> | null;
13
13
  large?: boolean;
14
14
  valid?: boolean | null;
15
15
  wrapperClassName?: string | null;
@@ -155,7 +155,7 @@ const BubbleInput = /*#__PURE__*/forwardRef((props, forwardedRef) => {
155
155
  value,
156
156
  ...inputProps
157
157
  } = props;
158
- const ref = useRef();
158
+ const ref = useRef(null);
159
159
  const composedRefs = useComposedRefs(forwardedRef, ref);
160
160
 
161
161
  // This Hook Provides the native behaviour that the input range type would have around the "change" event.
@@ -1,12 +1,6 @@
1
- import PropTypes from 'prop-types';
2
1
  import type { ReactElement } from 'react';
3
2
  type Props = {
4
3
  children: Array<ReactElement<any, any>> | ReactElement<any, any>;
5
4
  };
6
- declare const SpinnerLayout: {
7
- (props: Props): import("react/jsx-runtime").JSX.Element;
8
- propTypes: {
9
- children: PropTypes.Validator<NonNullable<PropTypes.ReactNodeLike>>;
10
- };
11
- };
5
+ declare const SpinnerLayout: (props: Props) => import("react/jsx-runtime").JSX.Element;
12
6
  export default SpinnerLayout;