@skyscanner/backpack-web 41.8.0 → 41.10.0-beta-v1

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 (129) hide show
  1. package/bpk-component-badge/src/BpkBadge.js +2 -1
  2. package/bpk-component-banner-alert/src/BpkBannerAlert.js +2 -0
  3. package/bpk-component-banner-alert/src/BpkBannerAlertDismissable.js +2 -0
  4. package/bpk-component-banner-alert/src/BpkBannerAlertExpandable.js +2 -0
  5. package/bpk-component-blockquote/src/BpkBlockquote.js +2 -1
  6. package/bpk-component-boilerplate/src/BpkBoilerplate.js +2 -1
  7. package/bpk-component-bottom-sheet/src/BpkBottomSheet.js +2 -1
  8. package/bpk-component-breadcrumb/src/BpkBreadcrumb.js +2 -1
  9. package/bpk-component-breadcrumb/src/BpkBreadcrumbItem.js +2 -1
  10. package/bpk-component-button/src/BpkButtonV2/BpkButton.js +3 -1
  11. package/bpk-component-card/src/BpkCard.js +4 -1
  12. package/bpk-component-card/src/BpkCardWrapper.js +2 -1
  13. package/bpk-component-card/src/BpkDividedCard.js +2 -1
  14. package/bpk-component-card-button/src/BpkSaveButton.js +2 -1
  15. package/bpk-component-card-list/src/BpkCardList.js +2 -1
  16. package/bpk-component-card-list/src/BpkCardListGridStack/BpkCardListGridStack.js +2 -1
  17. package/bpk-component-card-list/src/BpkCardListRowRail/BpkCardListCarousel.js +13 -8
  18. package/bpk-component-card-list/src/BpkCardListRowRail/BpkCardListCarousel.module.css +1 -1
  19. package/bpk-component-card-list/src/BpkCardListRowRail/BpkCardListRowRailContainer.js +2 -1
  20. package/bpk-component-carousel/src/BpkCarousel.js +2 -1
  21. package/bpk-component-carousel/src/BpkCarouselContainer.js +3 -1
  22. package/bpk-component-carousel/src/BpkCarouselImage.js +2 -1
  23. package/bpk-component-checkbox/src/BpkCheckbox.js +2 -1
  24. package/bpk-component-close-button/src/BpkCloseButton.js +2 -1
  25. package/bpk-component-code/src/BpkCode.js +2 -1
  26. package/bpk-component-code/src/BpkCodeBlock.js +2 -1
  27. package/bpk-component-content-cards/src/BpkContentCard.js +2 -1
  28. package/bpk-component-content-cards/src/BpkContentCards.js +2 -1
  29. package/bpk-component-datatable/src/BpkDataTable.js +2 -1
  30. package/bpk-component-datatable/src/BpkDataTableHeader.js +2 -1
  31. package/bpk-component-datepicker/src/BpkDatepicker.js +2 -1
  32. package/bpk-component-description-list/src/BpkDescriptionDetails.js +2 -1
  33. package/bpk-component-description-list/src/BpkDescriptionList.js +2 -1
  34. package/bpk-component-description-list/src/BpkDescriptionTerm.js +2 -1
  35. package/bpk-component-dialog/src/BpkDialog.js +2 -1
  36. package/bpk-component-drawer/src/BpkDrawer.js +2 -1
  37. package/bpk-component-fieldset/src/BpkFieldset.js +2 -1
  38. package/bpk-component-floating-notification/src/BpkFloatingNotification.js +2 -1
  39. package/bpk-component-graphic-promotion/src/BpkGraphicPromo.js +2 -1
  40. package/bpk-component-image/src/BpkBackgroundImage.js +2 -1
  41. package/bpk-component-image/src/BpkImage.js +2 -1
  42. package/bpk-component-info-banner/src/BpkInfoBanner.js +2 -0
  43. package/bpk-component-info-banner/src/BpkInfoBannerDismissable.js +2 -0
  44. package/bpk-component-info-banner/src/BpkInfoBannerExpandable.js +2 -0
  45. package/bpk-component-input/src/BpkInput.js +2 -1
  46. package/bpk-component-inset-banner/src/BpkInsetBanner.js +2 -1
  47. package/bpk-component-inset-banner/src/BpkInsetBannerV2/BpkInsetBannerSponsored.js +2 -1
  48. package/bpk-component-journey-arrow/src/BpkJourneyArrow.js +2 -1
  49. package/bpk-component-label/src/BpkLabel.js +2 -1
  50. package/bpk-component-layout/index.d.ts +18 -0
  51. package/bpk-component-layout/index.js +29 -0
  52. package/bpk-component-layout/src/BpkBox.d.ts +3 -0
  53. package/bpk-component-layout/src/BpkBox.js +33 -0
  54. package/bpk-component-layout/src/BpkFlex.d.ts +3 -0
  55. package/bpk-component-layout/src/BpkFlex.js +51 -0
  56. package/bpk-component-layout/src/BpkGrid.d.ts +3 -0
  57. package/bpk-component-layout/src/BpkGrid.js +57 -0
  58. package/bpk-component-layout/src/BpkGridItem.d.ts +3 -0
  59. package/bpk-component-layout/src/BpkGridItem.js +45 -0
  60. package/bpk-component-layout/src/BpkProvider.d.ts +14 -0
  61. package/bpk-component-layout/src/BpkProvider.js +42 -0
  62. package/bpk-component-layout/src/BpkStack.constant.d.ts +2 -0
  63. package/bpk-component-layout/src/BpkStack.constant.js +22 -0
  64. package/bpk-component-layout/src/BpkStack.d.ts +5 -0
  65. package/bpk-component-layout/src/BpkStack.js +57 -0
  66. package/bpk-component-layout/src/BpkVessel.d.ts +46 -0
  67. package/bpk-component-layout/src/BpkVessel.js +70 -0
  68. package/bpk-component-layout/src/commonProps.d.ts +86 -0
  69. package/bpk-component-layout/src/commonProps.js +1 -0
  70. package/bpk-component-layout/src/theme.d.ts +36 -0
  71. package/bpk-component-layout/src/theme.js +229 -0
  72. package/bpk-component-layout/src/tokenUtils.d.ts +108 -0
  73. package/bpk-component-layout/src/tokenUtils.js +323 -0
  74. package/bpk-component-layout/src/tokens.d.ts +96 -0
  75. package/bpk-component-layout/src/tokens.js +138 -0
  76. package/bpk-component-layout/src/types.d.ts +236 -0
  77. package/bpk-component-layout/src/types.js +1 -0
  78. package/bpk-component-link/src/BpkButtonLink.js +2 -1
  79. package/bpk-component-link/src/BpkLink.js +2 -1
  80. package/bpk-component-list/index.d.ts +5 -0
  81. package/bpk-component-list/index.js +3 -1
  82. package/bpk-component-list/src/BpkList.d.ts +11 -0
  83. package/bpk-component-list/src/BpkList.js +10 -15
  84. package/bpk-component-list/src/BpkListItem.d.ts +7 -0
  85. package/bpk-component-list/src/BpkListItem.js +2 -5
  86. package/bpk-component-loading-button/src/BpkLoadingButton.js +2 -1
  87. package/bpk-component-mobile-scroll-container/src/BpkMobileScrollContainer.js +2 -1
  88. package/bpk-component-modal/src/BpkModal.js +2 -1
  89. package/bpk-component-modal/src/BpkModalV2/BpkModal.js +2 -1
  90. package/bpk-component-navigation-bar/src/BpkNavigationBar.js +2 -1
  91. package/bpk-component-navigation-bar/src/BpkNavigationBarButtonLink.js +2 -0
  92. package/bpk-component-navigation-bar/src/BpkNavigationBarIconButton.js +2 -0
  93. package/bpk-component-navigation-tab-group/src/BpkNavigationTabGroup.js +2 -1
  94. package/bpk-component-nudger/src/BpkNudger.js +2 -1
  95. package/bpk-component-overlay/src/BpkOverlay.js +2 -1
  96. package/bpk-component-page-indicator/src/BpkPageIndicator.js +2 -1
  97. package/bpk-component-panel/src/BpkPanel.js +2 -1
  98. package/bpk-component-popover/src/BpkPopover.js +2 -1
  99. package/bpk-component-price-range/index.d.ts +2 -3
  100. package/bpk-component-price-range/index.js +2 -2
  101. package/bpk-component-price-range/src/BpkPriceRange.d.ts +14 -6
  102. package/bpk-component-price-range/src/BpkPriceRange.js +34 -14
  103. package/bpk-component-price-range/src/common-types.d.ts +5 -0
  104. package/bpk-component-price-range/src/common-types.js +4 -0
  105. package/bpk-component-rating/src/BpkRating.js +2 -1
  106. package/bpk-component-rtl-toggle/src/BpkRtlToggle.js +2 -0
  107. package/bpk-component-section-header/src/BpkSectionHeader.js +2 -1
  108. package/bpk-component-segmented-control/src/BpkSegmentedControl.js +2 -1
  109. package/bpk-component-skeleton/src/BpkBaseSkeleton.js +2 -1
  110. package/bpk-component-slider/src/BpkSlider.js +2 -1
  111. package/bpk-component-snippet/src/BpkSnippet.js +2 -1
  112. package/bpk-component-spinner/src/BpkExtraLargeSpinner.js +2 -1
  113. package/bpk-component-spinner/src/BpkLargeSpinner.js +2 -1
  114. package/bpk-component-spinner/src/BpkSpinner.js +2 -1
  115. package/bpk-component-split-input/src/BpkInputField.js +2 -1
  116. package/bpk-component-split-input/src/BpkSplitInput.js +2 -1
  117. package/bpk-component-swap-button/src/BpkSwapButton.js +2 -1
  118. package/bpk-component-switch/src/BpkSwitch.js +2 -1
  119. package/bpk-component-text/src/BpkText.js +2 -1
  120. package/bpk-component-textarea/src/BpkTextarea.js +2 -1
  121. package/bpk-component-theme-toggle/src/BpkThemeToggle.js +2 -0
  122. package/bpk-component-visually-hidden/src/BpkVisuallyHidden.js +2 -1
  123. package/bpk-react-utils/index.d.ts +5 -1
  124. package/bpk-react-utils/index.js +4 -2
  125. package/bpk-react-utils/src/BpkDialogWrapper/BpkDialogWrapper.js +2 -0
  126. package/bpk-react-utils/src/getDataComponentAttribute.d.ts +20 -0
  127. package/bpk-react-utils/src/getDataComponentAttribute.js +38 -0
  128. package/bpk-scrim-utils/src/BpkScrim.js +2 -1
  129. package/package.json +2 -1
@@ -0,0 +1,236 @@
1
+ import type { ReactNode } from 'react';
2
+ import type StackOptionKeys from './BpkStack.constant';
3
+ import type { BpkCommonLayoutProps } from './commonProps';
4
+ import type { BpkSpacingValue, BpkResponsiveValue, BpkBasisValue } from './tokens';
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
+ * by default. BpkBox will reintroduce a minimal subset (onClick, onFocus,
9
+ * onBlur) explicitly on its own props type.
10
+ */
11
+ type LayoutEventProps = 'onClick' | '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
+ /**
20
+ * Flexbox & grid layout props that we explicitly support on Backpack layout
21
+ * components. These are a curated subset of the underlying Box flex/grid API
22
+ * that are useful for structural layout.
23
+ */
24
+ export interface BpkFlexGridProps {
25
+ display?: BoxProps['display'];
26
+ flexDirection?: BoxProps['flexDirection'];
27
+ flexWrap?: BoxProps['flexWrap'];
28
+ justifyContent?: BoxProps['justifyContent'];
29
+ alignItems?: BoxProps['alignItems'];
30
+ alignContent?: BoxProps['alignContent'];
31
+ flex?: BoxProps['flex'];
32
+ flexGrow?: BoxProps['flexGrow'];
33
+ flexShrink?: BoxProps['flexShrink'];
34
+ flexBasis?: BoxProps['flexBasis'];
35
+ order?: BoxProps['order'];
36
+ alignSelf?: BoxProps['alignSelf'];
37
+ justifySelf?: BoxProps['justifySelf'];
38
+ gridTemplateColumns?: BoxProps['gridTemplateColumns'];
39
+ gridTemplateRows?: BoxProps['gridTemplateRows'];
40
+ gridTemplateAreas?: BoxProps['gridTemplateAreas'];
41
+ gridAutoFlow?: BoxProps['gridAutoFlow'];
42
+ gridAutoRows?: BoxProps['gridAutoRows'];
43
+ gridAutoColumns?: BoxProps['gridAutoColumns'];
44
+ rowGap?: BoxProps['rowGap'];
45
+ columnGap?: BoxProps['columnGap'];
46
+ }
47
+ export type FlexGridPropKeys = keyof BpkFlexGridProps;
48
+ /**
49
+ * Curated subset of Box layout props that support Backpack responsive values.
50
+ *
51
+ * NOTE:
52
+ * - These are structural layout props (flex/grid/display) that we want to allow
53
+ * on `BpkBox`, but using Backpack breakpoint keys rather than Chakra's
54
+ * array syntax or Chakra breakpoint keys.
55
+ * - Spacing/size/position props are handled separately via `BpkCommonLayoutProps`.
56
+ */
57
+ type BpkBoxResponsiveLayoutProps = {
58
+ display?: BpkResponsiveValue<BoxProps['display']>;
59
+ flexDirection?: BpkResponsiveValue<BoxProps['flexDirection']>;
60
+ flexWrap?: BpkResponsiveValue<BoxProps['flexWrap']>;
61
+ justifyContent?: BpkResponsiveValue<BoxProps['justifyContent']>;
62
+ alignItems?: BpkResponsiveValue<BoxProps['alignItems']>;
63
+ alignContent?: BpkResponsiveValue<BoxProps['alignContent']>;
64
+ flex?: BpkResponsiveValue<BoxProps['flex']>;
65
+ flexGrow?: BpkResponsiveValue<BoxProps['flexGrow']>;
66
+ flexShrink?: BpkResponsiveValue<BoxProps['flexShrink']>;
67
+ flexBasis?: BpkResponsiveValue<BoxProps['flexBasis']>;
68
+ order?: BpkResponsiveValue<BoxProps['order']>;
69
+ alignSelf?: BpkResponsiveValue<BoxProps['alignSelf']>;
70
+ justifySelf?: BpkResponsiveValue<BoxProps['justifySelf']>;
71
+ gridTemplateColumns?: BpkResponsiveValue<BoxProps['gridTemplateColumns']>;
72
+ gridTemplateRows?: BpkResponsiveValue<BoxProps['gridTemplateRows']>;
73
+ gridTemplateAreas?: BpkResponsiveValue<BoxProps['gridTemplateAreas']>;
74
+ gridAutoFlow?: BpkResponsiveValue<BoxProps['gridAutoFlow']>;
75
+ gridAutoRows?: BpkResponsiveValue<BoxProps['gridAutoRows']>;
76
+ gridAutoColumns?: BpkResponsiveValue<BoxProps['gridAutoColumns']>;
77
+ gridColumn?: BpkResponsiveValue<BoxProps['gridColumn']>;
78
+ gridRow?: BpkResponsiveValue<BoxProps['gridRow']>;
79
+ };
80
+ type BpkBoxResponsiveLayoutPropKeys = keyof BpkBoxResponsiveLayoutProps;
81
+ /**
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
91
+ */
92
+ export interface BpkBoxSpecificProps extends Omit<RemoveCommonProps<BoxProps>, BpkBoxResponsiveLayoutPropKeys>, BpkBoxResponsiveLayoutProps, Omit<BpkFlexGridProps, BpkBoxResponsiveLayoutPropKeys> {
93
+ }
94
+ /**
95
+ * Props for BpkBox component
96
+ * Combines Box-specific props with Backpack common layout props
97
+ * and reintroduces a minimal set of interaction props.
98
+ */
99
+ type BoxEventProps = Pick<BoxProps, 'onClick' | 'onFocus' | 'onBlur'>;
100
+ export interface BpkBoxProps extends BpkCommonLayoutProps, BpkBoxSpecificProps {
101
+ children?: ReactNode;
102
+ onClick?: BoxEventProps['onClick'];
103
+ onFocus?: BoxEventProps['onFocus'];
104
+ onBlur?: BoxEventProps['onBlur'];
105
+ }
106
+ /**
107
+ * Valid HTML elements that can be used with BpkVessel
108
+ */
109
+ export type VesselElement = 'div' | 'span' | 'section' | 'article' | 'nav' | 'main' | 'aside' | 'header' | 'footer';
110
+ /**
111
+ * Props for BpkVessel component.
112
+ *
113
+ * BpkVessel is a "migration hatch" that renders an HTML element
114
+ * and accepts all standard HTML attributes for maximum migration flexibility.
115
+ *
116
+ * Accepts all React.HTMLAttributes including:
117
+ * - Styling: className, style
118
+ * - Testing: data-testid, data-cy, data-*
119
+ * - Accessibility: aria-*, role, tabIndex
120
+ * - Basic HTML: id, title, dir, lang, hidden, etc.
121
+ * - All standard DOM events: onClick, onChange, onFocus, etc.
122
+ *
123
+ * @example
124
+ * ```tsx
125
+ * <BpkVessel
126
+ * className="legacy-wrapper"
127
+ * style={{ padding: '16px', transition: 'opacity 0.3s' }}
128
+ * data-testid="migration-wrapper"
129
+ * onClick={handleClick}
130
+ * >
131
+ * Content
132
+ * </BpkVessel>
133
+ *
134
+ * <BpkVessel
135
+ * as="section"
136
+ * className="legacy-section"
137
+ * aria-label="Main content"
138
+ * role="region"
139
+ * dir="rtl"
140
+ * >
141
+ * Section Content
142
+ * </BpkVessel>
143
+ * ```
144
+ */
145
+ export type BpkVesselProps = {
146
+ as?: VesselElement;
147
+ } & React.HTMLAttributes<HTMLElement>;
148
+ /**
149
+ * Component-specific props for BpkFlex
150
+ * Includes all Flex props except those in BpkCommonLayoutProps
151
+ */
152
+ export interface BpkFlexSpecificProps extends RemoveCommonProps<FlexProps> {
153
+ direction?: BpkResponsiveValue<FlexProps['flexDirection']>;
154
+ justify?: BpkResponsiveValue<FlexProps['justifyContent']>;
155
+ align?: BpkResponsiveValue<FlexProps['alignItems']>;
156
+ wrap?: BpkResponsiveValue<FlexProps['flexWrap']>;
157
+ grow?: BpkResponsiveValue<FlexProps['flexGrow']>;
158
+ shrink?: BpkResponsiveValue<FlexProps['flexShrink']>;
159
+ basis?: BpkResponsiveValue<BpkBasisValue>;
160
+ inline?: boolean;
161
+ }
162
+ /**
163
+ * Props for BpkFlex component
164
+ * Combines Flex-specific props with Backpack common layout props
165
+ */
166
+ export interface BpkFlexProps extends BpkCommonLayoutProps, BpkFlexSpecificProps {
167
+ children?: ReactNode;
168
+ }
169
+ /**
170
+ * Component-specific props for BpkGrid
171
+ * Includes all Grid props except those in BpkCommonLayoutProps
172
+ */
173
+ export interface BpkGridSpecificProps extends RemoveCommonProps<GridProps> {
174
+ justify?: BpkResponsiveValue<GridProps['justifyContent']>;
175
+ align?: BpkResponsiveValue<GridProps['alignItems']>;
176
+ templateColumns?: BpkResponsiveValue<GridProps['gridTemplateColumns']>;
177
+ templateRows?: BpkResponsiveValue<GridProps['gridTemplateRows']>;
178
+ templateAreas?: BpkResponsiveValue<GridProps['gridTemplateAreas']>;
179
+ autoFlow?: BpkResponsiveValue<GridProps['gridAutoFlow']>;
180
+ autoRows?: BpkResponsiveValue<GridProps['gridAutoRows']>;
181
+ autoColumns?: BpkResponsiveValue<GridProps['gridAutoColumns']>;
182
+ rowGap?: BpkResponsiveValue<BpkSpacingValue>;
183
+ columnGap?: BpkResponsiveValue<BpkSpacingValue>;
184
+ column?: BpkResponsiveValue<GridProps['gridColumn']>;
185
+ row?: BpkResponsiveValue<GridProps['gridRow']>;
186
+ inline?: boolean;
187
+ }
188
+ /**
189
+ * Props for BpkGrid component
190
+ * Combines Grid-specific props with Backpack common layout props
191
+ */
192
+ export interface BpkGridProps extends BpkCommonLayoutProps, BpkGridSpecificProps {
193
+ children?: ReactNode;
194
+ }
195
+ /**
196
+ * Component-specific props for BpkGridItem
197
+ * Includes all GridItem props except those in BpkCommonLayoutProps
198
+ */
199
+ export interface BpkGridItemSpecificProps extends RemoveCommonProps<GridItemProps> {
200
+ area?: GridItemProps['area'];
201
+ colEnd?: GridItemProps['colEnd'];
202
+ colStart?: GridItemProps['colStart'];
203
+ colSpan?: GridItemProps['colSpan'];
204
+ rowEnd?: GridItemProps['rowEnd'];
205
+ rowStart?: GridItemProps['rowStart'];
206
+ rowSpan?: GridItemProps['rowSpan'];
207
+ }
208
+ /**
209
+ * Props for BpkGridItem component
210
+ * Combines GridItem-specific props with Backpack common layout props
211
+ */
212
+ export interface BpkGridItemProps extends BpkCommonLayoutProps, BpkGridItemSpecificProps {
213
+ children?: ReactNode;
214
+ }
215
+ type StackOptionKeysType = typeof StackOptionKeys[number];
216
+ /**
217
+ * Overrides StackOptions to support BpkResponsiveValue
218
+ */
219
+ type BpkStackOptions = {
220
+ [K in StackOptionKeysType]?: K extends keyof StackProps ? BpkResponsiveValue<StackProps[K]> | StackProps[K] : never;
221
+ };
222
+ /**
223
+ * Component-specific props for BpkStack
224
+ * Includes all Stack props except those in BpkCommonLayoutProps
225
+ * Overrides StackOptions to support BpkResponsiveValue
226
+ */
227
+ export interface BpkStackSpecificProps extends Omit<RemoveCommonProps<StackProps>, StackOptionKeysType>, BpkStackOptions, BpkFlexGridProps {
228
+ }
229
+ /**
230
+ * Props for BpkStack component
231
+ * Combines Stack-specific props with Backpack common layout props
232
+ */
233
+ export interface BpkStackProps extends BpkCommonLayoutProps, BpkStackSpecificProps {
234
+ children?: ReactNode;
235
+ }
236
+ export type { BpkCommonLayoutProps };
@@ -0,0 +1 @@
1
+ export {};
@@ -16,7 +16,7 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- import { cssModules } from "../../bpk-react-utils";
19
+ import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
20
20
  import themeAttributes from "./themeAttributes";
21
21
  import STYLES from "./BpkLink.module.css";
22
22
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -60,6 +60,7 @@ const BpkButtonLink = ({
60
60
  return /*#__PURE__*/_jsx("button", {
61
61
  type: "button",
62
62
  className: classNames.join(' '),
63
+ ...getDataComponentAttribute('ButtonLink'),
63
64
  onClick: onClick,
64
65
  ...rest,
65
66
  children: /*#__PURE__*/_jsx("span", {
@@ -17,7 +17,7 @@
17
17
  */
18
18
 
19
19
  import { forwardRef } from 'react';
20
- import { cssModules } from "../../bpk-react-utils";
20
+ import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
21
21
  import STYLES from "./BpkLink.module.css";
22
22
  import { jsx as _jsx } from "react/jsx-runtime";
23
23
  const getClassName = cssModules(STYLES);
@@ -103,6 +103,7 @@ const BpkLinkInner = ({
103
103
  className: linkClassName,
104
104
  ref: ref,
105
105
  ...elementProps,
106
+ ...getDataComponentAttribute('Link'),
106
107
  children: /*#__PURE__*/_jsx("span", {
107
108
  className: underlinedClassName,
108
109
  children: children
@@ -0,0 +1,5 @@
1
+ import BpkList from './src/BpkList';
2
+ import BpkListItem from './src/BpkListItem';
3
+ export type { Props as BpkListProps } from './src/BpkList';
4
+ export type { Props as BpkListItemProps } from './src/BpkListItem';
5
+ export { BpkList, BpkListItem };
@@ -14,6 +14,8 @@
14
14
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
- */import BpkList from "./src/BpkList";
17
+ */
18
+
19
+ import BpkList from "./src/BpkList";
18
20
  import BpkListItem from "./src/BpkListItem";
19
21
  export { BpkList, BpkListItem };
@@ -0,0 +1,11 @@
1
+ import type { ReactNode } from 'react';
2
+ export type Props = {
3
+ children: ReactNode;
4
+ ordered?: boolean;
5
+ className?: string | null;
6
+ ariaLabel?: string;
7
+ ariaLabelledby?: string;
8
+ title?: string;
9
+ };
10
+ declare const BpkList: ({ ariaLabel, ariaLabelledby, children, className, ordered, title, }: Props) => import("react/jsx-runtime").JSX.Element;
11
+ export default BpkList;
@@ -14,35 +14,30 @@
14
14
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
- */import PropTypes from 'prop-types';
17
+ */
18
+
18
19
  import { cssModules } from "../../bpk-react-utils";
19
20
  import STYLES from "./BpkList.module.css";
20
21
  import { jsx as _jsx } from "react/jsx-runtime";
21
22
  const getClassName = cssModules(STYLES);
22
23
  const BpkList = ({
23
- ariaLabel = null,
24
- ariaLabelledby = null,
24
+ ariaLabel,
25
+ ariaLabelledby,
25
26
  children,
26
27
  className = null,
27
28
  ordered = false,
28
- title = null
29
+ title
29
30
  }) => {
30
- const ListElements = ordered ? 'ol' : 'ul';
31
+ const ListElement = ordered ? 'ol' : 'ul';
31
32
  const classNames = getClassName('bpk-list', className);
32
- return /*#__PURE__*/_jsx(ListElements, {
33
+ return /*#__PURE__*/_jsx(ListElement, {
33
34
  "aria-label": ariaLabel,
34
35
  "aria-labelledby": ariaLabelledby,
35
- title: title,
36
+ title: title
37
+ // eslint-disable-next-line @skyscanner/rules/forbid-component-props -- className is required to apply Bpk list styles and allow optional consumer-supplied classes
38
+ ,
36
39
  className: classNames,
37
40
  children: children
38
41
  });
39
42
  };
40
- BpkList.propTypes = {
41
- children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired,
42
- ordered: PropTypes.bool,
43
- className: PropTypes.string,
44
- ariaLabel: PropTypes.string,
45
- ariaLabelledby: PropTypes.string,
46
- title: PropTypes.string
47
- };
48
43
  export default BpkList;
@@ -0,0 +1,7 @@
1
+ import type { ReactNode } from 'react';
2
+ export type Props = {
3
+ children: ReactNode;
4
+ className?: string | null;
5
+ };
6
+ declare const BpkListItem: ({ children, className }: Props) => import("react/jsx-runtime").JSX.Element;
7
+ export default BpkListItem;
@@ -14,7 +14,8 @@
14
14
  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
- */import PropTypes from 'prop-types';
17
+ */
18
+
18
19
  import { cssModules } from "../../bpk-react-utils";
19
20
  import STYLES from "./BpkList.module.css";
20
21
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -29,8 +30,4 @@ const BpkListItem = ({
29
30
  children: children
30
31
  });
31
32
  };
32
- BpkListItem.propTypes = {
33
- children: PropTypes.oneOfType([PropTypes.arrayOf(PropTypes.node), PropTypes.node]).isRequired,
34
- className: PropTypes.string
35
- };
36
33
  export default BpkListItem;
@@ -21,7 +21,7 @@ import { withButtonAlignment, withLargeButtonAlignment, withRtlSupport } from ".
21
21
  import ArrowIconLg from "../../bpk-component-icon/lg/long-arrow-right";
22
22
  import ArrowIconSm from "../../bpk-component-icon/sm/long-arrow-right";
23
23
  import { BpkSpinner, BpkLargeSpinner } from "../../bpk-component-spinner";
24
- import { cssModules } from "../../bpk-react-utils";
24
+ import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
25
25
  import STYLES from "./BpkLoadingButton.module.css";
26
26
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
27
27
  const getClassName = cssModules(STYLES);
@@ -113,6 +113,7 @@ const BpkLoadingButton = props => {
113
113
  disabled: showBtnDisabled,
114
114
  size: large ? SIZE_TYPES.large : SIZE_TYPES.small,
115
115
  type: type,
116
+ ...getDataComponentAttribute('LoadingButton'),
116
117
  ...rest,
117
118
  children: /*#__PURE__*/_jsxs("div", {
118
119
  className: getClassName('bpk-loading-button__container'),
@@ -18,7 +18,7 @@
18
18
 
19
19
  import { Component } from 'react';
20
20
  import debounce from 'lodash/debounce';
21
- import { cssModules, isRTL } from "../../bpk-react-utils";
21
+ import { cssModules, isRTL, getDataComponentAttribute } from "../../bpk-react-utils";
22
22
  import STYLES from "./BpkMobileScrollContainer.module.css";
23
23
  import { jsx as _jsx } from "react/jsx-runtime";
24
24
  const getClassName = cssModules(STYLES);
@@ -131,6 +131,7 @@ class BpkMobileScrollContainer extends Component {
131
131
  ...style,
132
132
  height: this.state.computedHeight
133
133
  },
134
+ ...getDataComponentAttribute('MobileScrollContainer'),
134
135
  children: /*#__PURE__*/_jsx("div", {
135
136
  ref: el => {
136
137
  if (scrollerRef) {
@@ -16,7 +16,7 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- import { Portal, cssModules, isDeviceIphone } from "../../bpk-react-utils";
19
+ import { Portal, cssModules, isDeviceIphone, getDataComponentAttribute } from "../../bpk-react-utils";
20
20
  import { withScrim } from "../../bpk-scrim-utils";
21
21
  import BpkModalInner, { MODAL_STYLING } from "./BpkModalInner";
22
22
  import STYLES from "./BpkModal.module.css";
@@ -74,6 +74,7 @@ const BpkModal = ({
74
74
  accessoryView: accessoryView,
75
75
  dialogRef: dialogRef,
76
76
  modalStyle: modalStyle,
77
+ ...getDataComponentAttribute('Modal'),
77
78
  ...rest
78
79
  })
79
80
  });
@@ -21,7 +21,7 @@ import { useEffect, useRef } from 'react';
21
21
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
22
22
  import BpkCloseButton from "../../../bpk-component-close-button";
23
23
  import BpkText, { TEXT_STYLES } from "../../../bpk-component-text";
24
- import { cssModules, withDefaultProps } from "../../../bpk-react-utils";
24
+ import { cssModules, withDefaultProps, getDataComponentAttribute } from "../../../bpk-react-utils";
25
25
  import { MODAL_STYLING } from "../BpkModalInner";
26
26
  import STYLES from "./BpKModal.module.css";
27
27
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -137,6 +137,7 @@ export const BpkModalV2 = props => {
137
137
  const contentClassNames = getClassName('bpk-modal__container', fullScreenOnDesktop && 'bpk-modal__container--full-screen-desktop', padded && 'bpk-modal__container--padded', modalStyle === MODAL_STYLING.surfaceContrast && 'bpk-modal__container--surface-contrast');
138
138
  return isOpen ? /*#__PURE__*/_jsxs("div", {
139
139
  className: getClassName('bpk-modal-wrapper', dialogSupported ? '' : 'bpk-modal-polyfill'),
140
+ ...getDataComponentAttribute('ModalV2'),
140
141
  children: [!dialogSupported && /*#__PURE__*/_jsx("div", {
141
142
  id: `${id}-polyfill`,
142
143
  className: getClassName('bpk-modal-backdrop'),
@@ -17,7 +17,7 @@
17
17
  */
18
18
 
19
19
  import BpkText, { TEXT_STYLES } from "../../bpk-component-text";
20
- import { cssModules } from "../../bpk-react-utils";
20
+ import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
21
21
  import STYLES from "./BpkNavigationBar.module.css";
22
22
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
23
23
  const getClassNames = cssModules(STYLES);
@@ -45,6 +45,7 @@ const BpkNavigationBar = props => {
45
45
  return /*#__PURE__*/_jsxs("nav", {
46
46
  "aria-labelledby": titleId,
47
47
  className: getClassNames('bpk-navigation-bar', `bpk-navigation-bar--${barStyle}`, sticky && 'bpk-navigation-bar__sticky', className),
48
+ ...getDataComponentAttribute('NavigationBar'),
48
49
  ...rest,
49
50
  children: [leadingButton && /*#__PURE__*/_jsx("div", {
50
51
  className: getClassNames('bpk-navigation-bar__leading-item', `bpk-navigation-bar__leading-item--${barStyle}`),
@@ -17,6 +17,7 @@
17
17
  */
18
18
 
19
19
  import BpkLink from "../../bpk-component-link";
20
+ import { getDataComponentAttribute } from "../../bpk-react-utils";
20
21
  import { BAR_STYLES } from "./BpkNavigationBar";
21
22
  import { jsx as _jsx } from "react/jsx-runtime";
22
23
  const BpkNavigationBarButtonLink = ({
@@ -26,6 +27,7 @@ const BpkNavigationBarButtonLink = ({
26
27
  ...rest
27
28
  }) => /*#__PURE__*/_jsx("span", {
28
29
  className: className,
30
+ ...getDataComponentAttribute('NavigationBarButtonLink'),
29
31
  children: /*#__PURE__*/_jsx(BpkLink, {
30
32
  as: "button",
31
33
  alternate: barStyle === BAR_STYLES.onDark,
@@ -18,6 +18,7 @@
18
18
 
19
19
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
20
20
  import BpkCloseButton from "../../bpk-component-close-button";
21
+ import { getDataComponentAttribute } from "../../bpk-react-utils";
21
22
  import { BAR_STYLES } from "./BpkNavigationBar";
22
23
  import { jsx as _jsx } from "react/jsx-runtime";
23
24
  const BpkNavigationBarIconButton = ({
@@ -27,6 +28,7 @@ const BpkNavigationBarIconButton = ({
27
28
  ...rest
28
29
  }) => /*#__PURE__*/_jsx("span", {
29
30
  className: className,
31
+ ...getDataComponentAttribute('NavigationBarIconButton'),
30
32
  children: /*#__PURE__*/_jsx(BpkCloseButton, {
31
33
  customIcon: icon,
32
34
  onDark: barStyle === BAR_STYLES.onDark,
@@ -19,7 +19,7 @@
19
19
  import { useState } from 'react';
20
20
  import BpkBubble from "../../bpk-component-bubble/src/BpkBubble";
21
21
  import BpkText, { TEXT_STYLES } from "../../bpk-component-text";
22
- import { cssModules } from "../../bpk-react-utils";
22
+ import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
23
23
  import STYLES from "./BpkNavigationTabGroup.module.css";
24
24
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
25
25
  const getClassName = cssModules(STYLES);
@@ -76,6 +76,7 @@ const BpkNavigationTabGroup = ({
76
76
  className: containerStyling,
77
77
  role: "navigation",
78
78
  "aria-label": ariaLabel,
79
+ ...getDataComponentAttribute('NavigationTabGroup'),
79
80
  children: /*#__PURE__*/_jsx("div", {
80
81
  role: "tablist",
81
82
  className: getClassName('bpk-navigation-tab-list'),
@@ -23,7 +23,7 @@ import MinusIcon from "../../bpk-component-icon/sm/minus";
23
23
  import PlusIcon from "../../bpk-component-icon/sm/plus";
24
24
  import BpkLabel from "../../bpk-component-label";
25
25
  import BpkText, { TEXT_STYLES } from "../../bpk-component-text";
26
- import { cssModules, setNativeValue } from "../../bpk-react-utils";
26
+ import { cssModules, setNativeValue, getDataComponentAttribute } from "../../bpk-react-utils";
27
27
  import STYLES from "./BpkNudger.module.css";
28
28
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
29
29
  const getClassName = cssModules(STYLES);
@@ -133,6 +133,7 @@ const BpkNudger = ({
133
133
  valueLimitter(inputElement);
134
134
  },
135
135
  className: inputClassNames,
136
+ ...getDataComponentAttribute('Nudger'),
136
137
  ...rest
137
138
  }), /*#__PURE__*/_jsx(BpkButton, {
138
139
  type: BUTTON_TYPES[buttonType],
@@ -16,7 +16,7 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- import { cssModules } from "../../bpk-react-utils";
19
+ import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
20
20
  import STYLES from "./BpkOverlay.module.css";
21
21
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
22
22
  const getClassName = cssModules(STYLES);
@@ -74,6 +74,7 @@ const BpkOverlay = props => {
74
74
  const overlayClassNames = getClassName('bpk-overlay__overlay', overlayType !== undefined && overlayType !== null && overlayType !== OVERLAY_TYPES.off && `bpk-overlay__overlay--${overlayTypeClassSuffixes[overlayType]}`);
75
75
  return /*#__PURE__*/_jsxs("div", {
76
76
  className: wrapperClassNames,
77
+ ...getDataComponentAttribute('Overlay'),
77
78
  ...rest,
78
79
  children: [children, /*#__PURE__*/_jsx("div", {
79
80
  className: overlayClassNames,
@@ -17,7 +17,7 @@
17
17
  */
18
18
 
19
19
  import { BUTTON_TYPES } from "../../bpk-component-button";
20
- import { cssModules } from "../../bpk-react-utils";
20
+ import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
21
21
  import NavButton, { DIRECTIONS } from "./NavButton";
22
22
  import STYLES from "./BpkPageIndicator.module.css";
23
23
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -55,6 +55,7 @@ const BpkPageIndicator = ({
55
55
  "data-testid": "indicator-container",
56
56
  children: /*#__PURE__*/_jsxs("div", {
57
57
  className: getClassName('bpk-page-indicator', showNav && 'bpk-page-indicator__showNav'),
58
+ ...getDataComponentAttribute('PageIndicator'),
58
59
  children: [showNav && /*#__PURE__*/_jsx(NavButton, {
59
60
  currentIndex: currentIndex,
60
61
  onClick: onClick,
@@ -16,7 +16,7 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- import { cssModules } from "../../bpk-react-utils";
19
+ import { cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
20
20
  import STYLES from "./BpkPanel.module.css";
21
21
  import { jsx as _jsx } from "react/jsx-runtime";
22
22
  const getClassName = cssModules(STYLES);
@@ -47,6 +47,7 @@ const BpkPanel = ({
47
47
  }
48
48
  return /*#__PURE__*/_jsx("section", {
49
49
  className: classNames.join(' '),
50
+ ...getDataComponentAttribute('Panel'),
50
51
  ...rest,
51
52
  children: children
52
53
  });
@@ -24,7 +24,7 @@ import { surfaceHighlightDay } from '@skyscanner/bpk-foundations-web/tokens/base
24
24
  import BpkCloseButton from "../../bpk-component-close-button";
25
25
  import BpkLink from "../../bpk-component-link";
26
26
  import BpkText, { TEXT_STYLES } from "../../bpk-component-text";
27
- import { TransitionInitialMount, cssModules } from "../../bpk-react-utils";
27
+ import { TransitionInitialMount, cssModules, getDataComponentAttribute } from "../../bpk-react-utils";
28
28
  import { ARROW_ID } from "./constants";
29
29
  import STYLES from "./BpkPopover.module.css";
30
30
  import { jsx as _jsx, jsxs as _jsxs, Fragment as _Fragment } from "react/jsx-runtime";
@@ -156,6 +156,7 @@ const BpkPopover = ({
156
156
  role: "dialog",
157
157
  "aria-labelledby": labelId,
158
158
  className: classNames,
159
+ ...getDataComponentAttribute('Popover'),
159
160
  ...rest,
160
161
  children: [showArrow && /*#__PURE__*/_jsx(FloatingArrow, {
161
162
  ref: arrowRef,
@@ -1,3 +1,2 @@
1
- import BpkPriceRange, { type Props as BpkPriceRangeProps } from './src/BpkPriceRange';
2
- export type { BpkPriceRangeProps };
3
- export default BpkPriceRange;
1
+ export { default, type BpkPriceRangeProps } from './src/BpkPriceRange';
2
+ export { MARKER_DISPLAY_TYPES, type MarkerDisplayType, } from './src/common-types';
@@ -16,5 +16,5 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- import BpkPriceRange from "./src/BpkPriceRange";
20
- export default BpkPriceRange;
19
+ export { default } from "./src/BpkPriceRange";
20
+ export { MARKER_DISPLAY_TYPES } from "./src/common-types";