@skyscanner/backpack-web 33.3.1 → 34.0.0-premajor

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 (263) hide show
  1. package/bpk-component-accordion/index.js +1 -1
  2. package/bpk-component-accordion/src/BpkAccordionItem.js +12 -13
  3. package/bpk-component-accordion/src/BpkAccordionItem.module.css +1 -1
  4. package/bpk-component-autosuggest/src/BpkAutosuggestSuggestion.js +5 -3
  5. package/bpk-component-banner-alert/index.js +1 -1
  6. package/bpk-component-banner-alert/src/AnimateAndFade.js +37 -35
  7. package/bpk-component-banner-alert/src/BpkBannerAlertInner.js +12 -6
  8. package/bpk-component-barchart/src/BpkBarchart.js +9 -10
  9. package/bpk-component-barchart/src/BpkBarchartBar.js +1 -2
  10. package/bpk-component-barchart/src/BpkBarchartBars.js +2 -2
  11. package/bpk-component-barchart/src/BpkBarchartDefs.js +1 -2
  12. package/bpk-component-barchart/src/BpkChartAxis.js +1 -2
  13. package/bpk-component-barchart/src/BpkChartDataTable.js +1 -2
  14. package/bpk-component-bottom-sheet/src/BpkBottomSheet.js +4 -6
  15. package/bpk-component-breadcrumb/src/BpkBreadcrumb.js +1 -2
  16. package/bpk-component-breadcrumb/src/BpkBreadcrumbItem.js +18 -14
  17. package/bpk-component-breadcrumb/src/BpkBreadcrumbItem.module.css +1 -1
  18. package/bpk-component-breakpoint/index.d.ts +2 -1
  19. package/bpk-component-breakpoint/src/BpkBreakpoint.js +5 -19
  20. package/bpk-component-breakpoint/src/useMediaQuery.js +10 -12
  21. package/bpk-component-button/index.js +5 -5
  22. package/bpk-component-button/src/BpkButtonDestructive.js +10 -9
  23. package/bpk-component-button/src/BpkButtonFeatured.js +10 -9
  24. package/bpk-component-button/src/BpkButtonLink.js +11 -10
  25. package/bpk-component-button/src/BpkButtonLinkOnDark.js +11 -10
  26. package/bpk-component-button/src/BpkButtonPrimary.js +2 -2
  27. package/bpk-component-button/src/BpkButtonPrimaryOnDark.js +10 -9
  28. package/bpk-component-button/src/BpkButtonPrimaryOnLight.js +10 -9
  29. package/bpk-component-button/src/BpkButtonSecondary.js +10 -10
  30. package/bpk-component-button/src/BpkButtonSecondaryOnDark.js +10 -9
  31. package/bpk-component-calendar/index.js +1 -1
  32. package/bpk-component-calendar/src/BpkCalendarContainer.js +3 -3
  33. package/bpk-component-calendar/src/BpkCalendarGrid.js +3 -2
  34. package/bpk-component-calendar/src/BpkCalendarGrid.module.css +1 -1
  35. package/bpk-component-calendar/src/BpkCalendarGridHeader.js +4 -1
  36. package/bpk-component-calendar/src/BpkCalendarGridTransition.js +6 -4
  37. package/bpk-component-calendar/src/BpkCalendarNav.js +10 -5
  38. package/bpk-component-calendar/src/Week.js +6 -3
  39. package/bpk-component-calendar/src/composeCalendar.js +9 -4
  40. package/bpk-component-calendar/src/date-utils.js +14 -14
  41. package/bpk-component-card/src/BpkCardWrapper.js +1 -2
  42. package/bpk-component-card/src/BpkDividedCard.js +19 -15
  43. package/bpk-component-card-button/src/BpkSaveButton.js +14 -6
  44. package/bpk-component-checkbox/src/BpkCheckbox.js +1 -2
  45. package/bpk-component-chip/index.d.ts +3 -5
  46. package/bpk-component-chip/index.js +3 -2
  47. package/bpk-component-chip/src/BpkDismissibleChip.js +7 -2
  48. package/bpk-component-chip/src/BpkIconChip.d.ts +25 -0
  49. package/bpk-component-chip/src/BpkIconChip.js +31 -0
  50. package/bpk-component-chip/src/BpkSelectableChip.d.ts +0 -2
  51. package/bpk-component-chip/src/BpkSelectableChip.js +5 -6
  52. package/bpk-component-chip/src/BpkSelectableChip.module.css +1 -1
  53. package/bpk-component-chip/src/commonTypes.d.ts +1 -1
  54. package/bpk-component-chip/src/commonTypes.js +1 -24
  55. package/bpk-component-close-button/src/BpkCloseButton.js +3 -2
  56. package/bpk-component-close-button/src/BpkCloseButton.module.css +1 -1
  57. package/bpk-component-content-cards/src/BpkContentCard.js +9 -4
  58. package/bpk-component-content-cards/src/BpkContentCards.js +2 -7
  59. package/bpk-component-content-cards/src/BpkContentCards.module.css +1 -1
  60. package/bpk-component-datatable/src/BpkDataTable.js +4 -4
  61. package/bpk-component-datatable/src/BpkDataTableHeader.js +14 -11
  62. package/bpk-component-datatable/src/BpkDataTableHeader.module.css +1 -1
  63. package/bpk-component-datepicker/src/BpkDatepicker.js +3 -5
  64. package/bpk-component-description-list/index.js +1 -1
  65. package/bpk-component-description-list/src/ComponentFactory.js +10 -5
  66. package/bpk-component-dialog/src/BpkDialog.js +7 -6
  67. package/bpk-component-dialog/src/BpkDialog.module.css +1 -1
  68. package/bpk-component-dialog/src/BpkDialogInner.js +7 -5
  69. package/bpk-component-drawer/src/BpkDrawer.js +1 -4
  70. package/bpk-component-drawer/src/BpkDrawerContent.js +8 -7
  71. package/bpk-component-fieldset/src/BpkFieldset.js +10 -9
  72. package/bpk-component-flare/index.js +2 -2
  73. package/bpk-component-flare/src/BpkContentBubble.js +5 -3
  74. package/bpk-component-flare/src/BpkFlareBar.js +15 -7
  75. package/bpk-component-flare/src/__generated__/corner-radius.d.ts +6 -0
  76. package/bpk-component-flare/src/__generated__/pointer.d.ts +6 -0
  77. package/bpk-component-floating-notification/src/BpkFloatingNotification.js +10 -4
  78. package/bpk-component-form-validation/src/BpkFormValidation.js +6 -6
  79. package/bpk-component-graphic-promotion/src/BpkGraphicPromo.js +10 -14
  80. package/bpk-component-graphic-promotion/src/BpkGraphicPromo.module.css +1 -1
  81. package/bpk-component-grid-toggle/src/BpkGridToggle.js +8 -6
  82. package/bpk-component-horizontal-nav/src/BpkHorizontalNav.js +16 -14
  83. package/bpk-component-horizontal-nav/src/BpkHorizontalNav.module.css +1 -1
  84. package/bpk-component-horizontal-nav/src/BpkHorizontalNavItem.js +2 -2
  85. package/bpk-component-icon/index.js +1 -1
  86. package/bpk-component-icon/lg/aircraft.js +1 -2
  87. package/bpk-component-icon/lg/beach.js +1 -2
  88. package/bpk-component-icon/lg/call-back.js +1 -2
  89. package/bpk-component-icon/lg/camper-van.js +1 -2
  90. package/bpk-component-icon/lg/car-wash.js +1 -2
  91. package/bpk-component-icon/lg/cars.js +1 -2
  92. package/bpk-component-icon/lg/clean.js +1 -2
  93. package/bpk-component-icon/lg/cloakroom.js +1 -2
  94. package/bpk-component-icon/lg/content--copy.js +1 -2
  95. package/bpk-component-icon/lg/data.js +1 -2
  96. package/bpk-component-icon/lg/depart.js +1 -2
  97. package/bpk-component-icon/lg/download.js +1 -2
  98. package/bpk-component-icon/lg/education.js +1 -2
  99. package/bpk-component-icon/lg/explore.js +1 -2
  100. package/bpk-component-icon/lg/fast-track.js +1 -2
  101. package/bpk-component-icon/lg/fast-train.js +1 -2
  102. package/bpk-component-icon/lg/flight-landing.js +1 -2
  103. package/bpk-component-icon/lg/flight-takeoff.js +1 -2
  104. package/bpk-component-icon/lg/flight.js +1 -2
  105. package/bpk-component-icon/lg/legroom--extra.js +1 -2
  106. package/bpk-component-icon/lg/legroom--normal.js +1 -2
  107. package/bpk-component-icon/lg/legroom--reduced.js +1 -2
  108. package/bpk-component-icon/lg/logout.js +1 -2
  109. package/bpk-component-icon/lg/lounge.js +1 -2
  110. package/bpk-component-icon/lg/mail.js +1 -2
  111. package/bpk-component-icon/lg/mileage.js +1 -2
  112. package/bpk-component-icon/lg/new-window.js +1 -2
  113. package/bpk-component-icon/lg/plane-seat.js +1 -2
  114. package/bpk-component-icon/lg/return.js +1 -2
  115. package/bpk-component-icon/lg/scales.js +1 -2
  116. package/bpk-component-icon/lg/share--ios.js +1 -2
  117. package/bpk-component-icon/lg/social-distancing.js +1 -2
  118. package/bpk-component-icon/lg/speaker.js +1 -2
  119. package/bpk-component-icon/lg/taxi.js +1 -2
  120. package/bpk-component-icon/lg/unmute.js +1 -2
  121. package/bpk-component-icon/lg/wallet.js +1 -2
  122. package/bpk-component-icon/lg/weather--cloudy.js +1 -2
  123. package/bpk-component-icon/lg/weather--partly-cloudy.js +1 -2
  124. package/bpk-component-icon/lg/weather--rain.js +1 -2
  125. package/bpk-component-icon/lg/weather--thunderstorm.js +1 -2
  126. package/bpk-component-icon/lg/window--reduce.js +1 -2
  127. package/bpk-component-icon/lg/world--emea.js +1 -2
  128. package/bpk-component-icon/sm/aircraft.js +1 -2
  129. package/bpk-component-icon/sm/beach.js +1 -2
  130. package/bpk-component-icon/sm/bus.js +1 -2
  131. package/bpk-component-icon/sm/call-back.js +1 -2
  132. package/bpk-component-icon/sm/camper-van.js +1 -2
  133. package/bpk-component-icon/sm/car-wash.js +1 -2
  134. package/bpk-component-icon/sm/cars.js +1 -2
  135. package/bpk-component-icon/sm/chauffeur.js +1 -2
  136. package/bpk-component-icon/sm/clean.js +1 -2
  137. package/bpk-component-icon/sm/content--copy.js +1 -2
  138. package/bpk-component-icon/sm/data.js +1 -2
  139. package/bpk-component-icon/sm/depart.js +1 -2
  140. package/bpk-component-icon/sm/direct.js +1 -2
  141. package/bpk-component-icon/sm/download.js +1 -2
  142. package/bpk-component-icon/sm/education.js +1 -2
  143. package/bpk-component-icon/sm/explore.js +1 -2
  144. package/bpk-component-icon/sm/fast-track.js +1 -2
  145. package/bpk-component-icon/sm/fast-train.js +1 -2
  146. package/bpk-component-icon/sm/flight-landing.js +1 -2
  147. package/bpk-component-icon/sm/flight-takeoff.js +1 -2
  148. package/bpk-component-icon/sm/flight.js +1 -2
  149. package/bpk-component-icon/sm/hotels--jacuzzi.js +1 -2
  150. package/bpk-component-icon/sm/infant.js +1 -2
  151. package/bpk-component-icon/sm/legroom--extra.js +1 -2
  152. package/bpk-component-icon/sm/legroom--normal.js +1 -2
  153. package/bpk-component-icon/sm/legroom--reduced.js +1 -2
  154. package/bpk-component-icon/sm/logout.js +1 -2
  155. package/bpk-component-icon/sm/mail.js +1 -2
  156. package/bpk-component-icon/sm/mileage.js +1 -2
  157. package/bpk-component-icon/sm/new-window.js +1 -2
  158. package/bpk-component-icon/sm/onsen.js +1 -2
  159. package/bpk-component-icon/sm/plane-seat.js +1 -2
  160. package/bpk-component-icon/sm/return.js +1 -2
  161. package/bpk-component-icon/sm/share--ios.js +1 -2
  162. package/bpk-component-icon/sm/social-distancing.js +1 -2
  163. package/bpk-component-icon/sm/taxi.js +1 -2
  164. package/bpk-component-icon/sm/unmute.js +1 -2
  165. package/bpk-component-icon/sm/weather--cloudy.js +1 -2
  166. package/bpk-component-icon/sm/weather--rain.js +1 -2
  167. package/bpk-component-icon/sm/weather--thunderstorm.js +1 -2
  168. package/bpk-component-icon/sm/weather--wind.js +1 -2
  169. package/bpk-component-icon/sm/window--reduce.js +1 -2
  170. package/bpk-component-icon/src/classNameModifierHOCFactory.js +3 -0
  171. package/bpk-component-icon/src/withDescription.js +1 -2
  172. package/bpk-component-icon/src/withRtlSupport.js +1 -1
  173. package/bpk-component-image/index.js +2 -2
  174. package/bpk-component-image/src/BpkBackgroundImage.js +4 -3
  175. package/bpk-component-image/src/BpkImage.js +6 -4
  176. package/bpk-component-infinite-scroll/src/withInfiniteScroll.js +4 -5
  177. package/bpk-component-info-banner/src/AnimateAndFade.js +37 -35
  178. package/bpk-component-info-banner/src/BpkInfoBanner.module.css +1 -1
  179. package/bpk-component-info-banner/src/BpkInfoBannerInner.js +17 -14
  180. package/bpk-component-input/index.js +1 -1
  181. package/bpk-component-input/src/BpkClearButton.js +3 -1
  182. package/bpk-component-input/src/BpkInput.js +6 -4
  183. package/bpk-component-input/src/withOpenEvents.js +4 -1
  184. package/bpk-component-label/src/BpkLabel.js +1 -2
  185. package/bpk-component-link/index.js +2 -2
  186. package/bpk-component-list/src/BpkList.js +4 -1
  187. package/bpk-component-loading-button/src/BpkLoadingButton.js +7 -5
  188. package/bpk-component-map/index.js +4 -4
  189. package/bpk-component-map/src/BpkIconMarker.js +2 -3
  190. package/bpk-component-map/src/BpkMap.js +2 -2
  191. package/bpk-component-map/src/BpkPriceMarker.js +8 -7
  192. package/bpk-component-map/src/BpkPriceMarkerV2/BpkPriceMarker.js +2 -3
  193. package/bpk-component-mobile-scroll-container/src/BpkMobileScrollContainer.js +5 -2
  194. package/bpk-component-modal/index.js +4 -3
  195. package/bpk-component-modal/src/BpkModal.d.ts +2 -1
  196. package/bpk-component-modal/src/BpkModal.js +8 -3
  197. package/bpk-component-modal/src/BpkModalInner.d.ts +2 -0
  198. package/bpk-component-modal/src/BpkModalInner.js +25 -10
  199. package/bpk-component-modal/src/BpkModalInner.module.css +1 -1
  200. package/bpk-component-modal/src/BpkModalV2/BpKModal.module.css +1 -1
  201. package/bpk-component-modal/src/BpkModalV2/BpkModal.d.ts +2 -0
  202. package/bpk-component-modal/src/BpkModalV2/BpkModal.js +20 -10
  203. package/bpk-component-navigation-bar/index.js +1 -1
  204. package/bpk-component-navigation-bar/src/BpkNavigationBar.js +8 -7
  205. package/bpk-component-navigation-bar/src/BpkNavigationBarButtonLink.js +5 -2
  206. package/bpk-component-navigation-bar/src/BpkNavigationBarIconButton.js +5 -2
  207. package/bpk-component-nudger/index.js +1 -1
  208. package/bpk-component-nudger/src/BpkConfigurableNudger.js +17 -6
  209. package/bpk-component-nudger/src/BpkNudger.js +17 -7
  210. package/bpk-component-overlay/src/BpkOverlay.js +1 -2
  211. package/bpk-component-page-indicator/src/BpkPageIndicator.js +1 -2
  212. package/bpk-component-page-indicator/src/BpkPageIndicator.module.css +1 -1
  213. package/bpk-component-page-indicator/src/NavButton.js +1 -1
  214. package/bpk-component-pagination/src/BpkPagination.js +1 -2
  215. package/bpk-component-pagination/src/BpkPaginationList.js +1 -1
  216. package/bpk-component-pagination/src/BpkPaginationNudger.js +14 -6
  217. package/bpk-component-pagination/src/BpkPaginationPage.js +4 -1
  218. package/bpk-component-phone-input/src/BpkPhoneInput.js +16 -6
  219. package/bpk-component-popover/src/BpkPopover.js +106 -63
  220. package/bpk-component-popover/src/BpkPopoverPortal.js +123 -119
  221. package/bpk-component-popover/src/keyboardFocusScope.js +1 -1
  222. package/bpk-component-price/src/BpkPrice.js +19 -8
  223. package/bpk-component-progress/src/BpkProgress.js +1 -2
  224. package/bpk-component-radio/src/BpkRadio.js +1 -2
  225. package/bpk-component-rating/src/BpkRating.js +19 -8
  226. package/bpk-component-rtl-toggle/src/BpkRtlToggle.js +4 -1
  227. package/bpk-component-scrollable-calendar/src/BpkScrollableCalendarGrid.js +7 -5
  228. package/bpk-component-scrollable-calendar/src/BpkScrollableCalendarGridList.js +7 -4
  229. package/bpk-component-section-header/src/BpkSectionHeader.js +10 -5
  230. package/bpk-component-section-list/index.js +1 -1
  231. package/bpk-component-section-list/src/BpkSectionListItem.js +11 -6
  232. package/bpk-component-section-list/src/BpkSectionListSection.js +2 -3
  233. package/bpk-component-select/src/BpkSelect.js +1 -2
  234. package/bpk-component-slider/src/BpkSlider.js +6 -2
  235. package/bpk-component-spinner/index.js +3 -3
  236. package/bpk-component-spinner/src/BpkExtraLargeSpinner.js +9 -7
  237. package/bpk-component-spinner/src/BpkLargeSpinner.js +9 -7
  238. package/bpk-component-spinner/src/BpkSpinner.js +9 -7
  239. package/bpk-component-split-input/src/BpkInputField.js +2 -2
  240. package/bpk-component-split-input/src/BpkSplitInput.js +3 -3
  241. package/bpk-component-star-rating/index.js +4 -4
  242. package/bpk-component-star-rating/src/BpkInteractiveStar.js +6 -2
  243. package/bpk-component-star-rating/src/BpkInteractiveStarRating.js +1 -1
  244. package/bpk-component-star-rating/src/BpkStar.js +22 -15
  245. package/bpk-component-swap-button/src/BpkSwapButton.js +2 -1
  246. package/bpk-component-switch/src/BpkSwitch.js +1 -2
  247. package/bpk-component-table/index.js +2 -2
  248. package/bpk-component-text/src/BpkText.js +10 -5
  249. package/bpk-component-theme-toggle/src/BpkThemeToggle.js +6 -4
  250. package/bpk-component-theme-toggle/src/updateOnThemeChange.js +1 -1
  251. package/bpk-component-tooltip/src/BpkTooltip.js +2 -3
  252. package/bpk-component-tooltip/src/BpkTooltipPortal.js +7 -6
  253. package/bpk-mixins/_chips.scss +9 -0
  254. package/bpk-react-utils/index.js +3 -3
  255. package/bpk-react-utils/src/BpkDialogWrapper/BpkDialogWrapper.js +2 -2
  256. package/bpk-react-utils/src/Portal.js +1 -0
  257. package/bpk-react-utils/src/withDefaultProps.js +4 -1
  258. package/bpk-scrim-utils/src/withScrim.js +3 -3
  259. package/bpk-scrim-utils/src/withScrimmedPortal.js +1 -1
  260. package/bpk-theming/src/BpkThemeProvider.js +1 -1
  261. package/package.json +5 -3
  262. package/unstable__bpk-mixins/_chips.scss +9 -0
  263. package/bpk-component-button/src/commonButtonTests.js +0 -133
@@ -22,9 +22,9 @@ been hard coded to have disabled={false}, selected and a trailing
22
22
  accessory view of a close icon.
23
23
  */
24
24
 
25
- import { cssModules } from "../../bpk-react-utils";
26
25
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
27
26
  import CloseCircleIconSm from "../../bpk-component-icon/sm/close-circle";
27
+ import { cssModules } from "../../bpk-react-utils";
28
28
  import BpkSelectableChip from "./BpkSelectableChip";
29
29
  import { CHIP_TYPES } from "./commonTypes";
30
30
  import STYLES from "./BpkSelectableChip.module.css";
@@ -42,12 +42,17 @@ const BpkDismissibleChip = ({
42
42
  ...rest,
43
43
  leadingAccessoryView: leadingAccessoryView,
44
44
  disabled: false,
45
- trailingAccessoryView: /*#__PURE__*/_jsx(CloseCircleIconSm, {
45
+ trailingAccessoryView: /*#__PURE__*/_jsx(CloseCircleIconSm
46
+ // TODO: className to be removed
47
+ // eslint-disable-next-line @skyscanner/rules/forbid-component-props
48
+ , {
46
49
  className: iconClassNames
47
50
  }),
48
51
  selected: true,
49
52
  type: type,
50
53
  role: "button" // Override role="checkbox" because this chip is not selectable.
54
+ // TODO: className to be removed
55
+ // eslint-disable-next-line @skyscanner/rules/forbid-component-props
51
56
  ,
52
57
  className: classNames
53
58
  });
@@ -0,0 +1,25 @@
1
+ /*
2
+ * Backpack - Skyscanner's Design System
3
+ *
4
+ * Copyright 2016 Skyscanner Ltd
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+
19
+ import type { ReactNode } from 'react';
20
+ import type { CommonProps as Props } from './commonTypes';
21
+ export type BpkIconChipProps = {
22
+ leadingAccessoryView: ReactNode;
23
+ } & Omit<Props, 'trailingAccessoryView' | 'leadingAccessoryView' | 'children'>;
24
+ declare const BpkIconChip: ({ className, ...rest }: BpkIconChipProps) => JSX.Element;
25
+ export default BpkIconChip;
@@ -0,0 +1,31 @@
1
+ /*
2
+ * Backpack - Skyscanner's Design System
3
+ *
4
+ * Copyright 2016 Skyscanner Ltd
5
+ *
6
+ * Licensed under the Apache License, Version 2.0 (the "License");
7
+ * you may not use this file except in compliance with the License.
8
+ * You may obtain a copy of the License at
9
+ *
10
+ * http://www.apache.org/licenses/LICENSE-2.0
11
+ *
12
+ * Unless required by applicable law or agreed to in writing, software
13
+ * distributed under the License is distributed on an "AS IS" BASIS,
14
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15
+ * See the License for the specific language governing permissions and
16
+ * limitations under the License.
17
+ */
18
+
19
+ /*
20
+ The icon chip component is just a selectable chip that's
21
+ been hard coded to have no text or trailing icon and padding/margin
22
+ to match.
23
+ */
24
+
25
+ import BpkSelectableChip from "./BpkSelectableChip";
26
+ import { jsx as _jsx } from "react/jsx-runtime";
27
+ const BpkIconChip = props => /*#__PURE__*/_jsx(BpkSelectableChip, {
28
+ ...props,
29
+ children: null
30
+ });
31
+ export default BpkIconChip;
@@ -17,9 +17,7 @@
17
17
  */
18
18
 
19
19
  import type { ReactNode } from 'react';
20
-
21
20
  import type { CommonProps } from './commonTypes';
22
-
23
21
  export interface Props extends CommonProps {
24
22
  role?: string;
25
23
  trailingAccessoryView?: ReactNode;
@@ -16,12 +16,11 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- import { cssModules } from "../../bpk-react-utils";
20
19
  import BpkText, { TEXT_STYLES } from "../../bpk-component-text";
21
- import STYLES from "./BpkSelectableChip.module.css";
20
+ import { cssModules } from "../../bpk-react-utils";
22
21
  import { CHIP_TYPES } from "./commonTypes";
23
- import { jsx as _jsx } from "react/jsx-runtime";
24
- import { jsxs as _jsxs } from "react/jsx-runtime";
22
+ import STYLES from "./BpkSelectableChip.module.css";
23
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
25
24
  const getClassName = cssModules(STYLES);
26
25
  const BpkSelectableChip = ({
27
26
  accessibilityLabel,
@@ -35,7 +34,7 @@ const BpkSelectableChip = ({
35
34
  type = CHIP_TYPES.default,
36
35
  ...rest
37
36
  }) => {
38
- const classNames = getClassName('bpk-chip', `bpk-chip--${type}`, disabled && 'bpk-chip--disabled', disabled && `bpk-chip--${type}-disabled`, !disabled && selected && `bpk-chip--${type}-selected`, className);
37
+ const classNames = getClassName('bpk-chip', `bpk-chip--${type}`, disabled && 'bpk-chip--disabled', disabled && `bpk-chip--${type}-disabled`, !children && 'bpk-chip--icon-only', !disabled && selected && `bpk-chip--${type}-selected`, className);
39
38
  return /*#__PURE__*/_jsxs("button", {
40
39
  "aria-checked": role === 'button' || role === 'tab' ? undefined : selected,
41
40
  className: classNames,
@@ -45,7 +44,7 @@ const BpkSelectableChip = ({
45
44
  type: "button",
46
45
  ...rest,
47
46
  children: [leadingAccessoryView && /*#__PURE__*/_jsx("span", {
48
- className: getClassName('bpk-chip__leading-accessory-view'),
47
+ className: getClassName('bpk-chip__leading-accessory-view', !children && 'bpk-chip--icon-only__leading-accessory-view'),
49
48
  children: leadingAccessoryView
50
49
  }), /*#__PURE__*/_jsx(BpkText, {
51
50
  textStyle: TEXT_STYLES.footnote,
@@ -15,4 +15,4 @@
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
17
  */
18
- .bpk-chip{display:inline-flex;height:2rem;padding:0 1rem;align-items:center;border:none;border-radius:.5rem;cursor:pointer}.bpk-chip__leading-accessory-view{display:inline-flex;fill:currentcolor;margin-left:0;margin-right:.5rem}html[dir=rtl] .bpk-chip__leading-accessory-view{margin-left:.5rem;margin-right:0}.bpk-chip__trailing-accessory-view{display:inline-flex;fill:currentcolor;margin-left:.5rem;margin-right:-0.5rem}html[dir=rtl] .bpk-chip__trailing-accessory-view{margin-right:.5rem}html[dir=rtl] .bpk-chip__trailing-accessory-view{margin-left:-0.5rem}.bpk-chip--on-dark{background-color:rgba(0,0,0,0);color:#fff;box-shadow:0 0 0 1px rgba(255,255,255,.5) inset}.bpk-no-touch-support .bpk-chip--on-dark:hover:not(:active):not(:disabled){box-shadow:0 0 0 1px #fff inset}:global(.bpk-no-touch-support) .bpk-chip--on-dark:hover:not(:active):not(:disabled){box-shadow:0 0 0 1px #fff inset}.bpk-chip--on-dark:active:not(:disabled){box-shadow:0 0 0 1px #fff inset}.bpk-chip--on-dark-selected{color:#161616;color:var(--bpk-chip-on-dark-selected-text-color, rgb(22, 22, 22));background-color:#fff;background-color:var(--bpk-chip-on-dark-selected-background-color, rgb(255, 255, 255));box-shadow:0 0 0 1px rgba(0,0,0,0) inset}.bpk-no-touch-support .bpk-chip--on-dark-selected:hover:not(:active):not(:disabled){box-shadow:0 0 0 1px rgba(0,0,0,0) inset}:global(.bpk-no-touch-support) .bpk-chip--on-dark-selected:hover:not(:active):not(:disabled){box-shadow:0 0 0 1px rgba(0,0,0,0) inset}.bpk-chip--on-dark-selected:active:not(:disabled){box-shadow:0 0 0 1px rgba(0,0,0,0) inset}.bpk-no-touch-support .bpk-chip--on-dark-dismissible:hover:not(:active):not(:disabled) svg{fill:currentcolor}:global(.bpk-no-touch-support) .bpk-chip--on-dark-dismissible:hover:not(:active):not(:disabled) svg{fill:currentcolor}.bpk-chip--on-dark-dismissible:active:not(:disabled) svg{fill:currentcolor}.bpk-chip--on-dark-dismissible__trailing-accessory-view{fill:#626971}.bpk-chip--on-dark-disabled{box-shadow:0 0 0 1px rgba(0,0,0,0) inset}.bpk-chip--default{background-color:rgba(0,0,0,0);color:#161616;box-shadow:0 0 0 1px #c1c7cf inset}.bpk-no-touch-support .bpk-chip--default:hover:not(:active):not(:disabled){box-shadow:0 0 0 1px #05203c inset}:global(.bpk-no-touch-support) .bpk-chip--default:hover:not(:active):not(:disabled){box-shadow:0 0 0 1px #05203c inset}.bpk-chip--default:active:not(:disabled){box-shadow:0 0 0 1px #05203c inset}.bpk-chip--default-selected{color:#fff;color:var(--bpk-chip-default-selected-text-color, rgb(255, 255, 255));background-color:#05203c;background-color:var(--bpk-chip-default-selected-background-color, rgb(5, 32, 60));box-shadow:0 0 0 1px rgba(0,0,0,0) inset}.bpk-no-touch-support .bpk-chip--default-selected:hover:not(:active):not(:disabled){box-shadow:0 0 0 1px rgba(0,0,0,0) inset}:global(.bpk-no-touch-support) .bpk-chip--default-selected:hover:not(:active):not(:disabled){box-shadow:0 0 0 1px rgba(0,0,0,0) inset}.bpk-chip--default-selected:active:not(:disabled){box-shadow:0 0 0 1px rgba(0,0,0,0) inset}.bpk-no-touch-support .bpk-chip--default-dismissible:hover:not(:active):not(:disabled) svg{fill:currentcolor}:global(.bpk-no-touch-support) .bpk-chip--default-dismissible:hover:not(:active):not(:disabled) svg{fill:currentcolor}.bpk-chip--default-dismissible:active:not(:disabled) svg{fill:currentcolor}.bpk-chip--default-dismissible__trailing-accessory-view{fill:rgba(255,255,255,.5)}.bpk-chip--default-disabled{box-shadow:0 0 0 1px rgba(0,0,0,0) inset}.bpk-chip--on-image{background-color:#fff;color:#161616;box-shadow:0px 1px 3px 0px rgba(37,32,31,.3)}.bpk-no-touch-support .bpk-chip--on-image:hover:not(:active):not(:disabled){background-color:#eff3f8}:global(.bpk-no-touch-support) .bpk-chip--on-image:hover:not(:active):not(:disabled){background-color:#eff3f8}.bpk-chip--on-image:active:not(:disabled){background-color:#eff3f8}.bpk-chip--on-image-selected{color:#fff;color:var(--bpk-chip-on-image-selected-text-color, rgb(255, 255, 255));background-color:#05203c;background-color:var(--bpk-chip-on-image-selected-background-color, rgb(5, 32, 60))}.bpk-no-touch-support .bpk-chip--on-image-selected:hover:not(:active):not(:disabled){background-color:#05203c;background-color:var(--bpk-chip-on-image-selected-hover-background-color, rgb(5, 32, 60))}:global(.bpk-no-touch-support) .bpk-chip--on-image-selected:hover:not(:active):not(:disabled){background-color:#05203c;background-color:var(--bpk-chip-on-image-selected-hover-background-color, rgb(5, 32, 60))}.bpk-chip--on-image-selected:active:not(:disabled){background-color:#05203c;background-color:var(--bpk-chip-on-image-selected-active-background-color, rgb(5, 32, 60))}.bpk-no-touch-support .bpk-chip--on-image-dismissible:hover:not(:active):not(:disabled) svg{fill:currentcolor}:global(.bpk-no-touch-support) .bpk-chip--on-image-dismissible:hover:not(:active):not(:disabled) svg{fill:currentcolor}.bpk-chip--on-image-dismissible:active:not(:disabled) svg{fill:currentcolor}.bpk-chip--on-image-dismissible__trailing-accessory-view{fill:rgba(255,255,255,.5)}.bpk-chip--on-image-disabled{box-shadow:0px 1px 3px 0px rgba(37,32,31,.3)}.bpk-chip--disabled{background-color:#e0e4e9;color:rgba(0,0,0,.2);cursor:not-allowed}
18
+ .bpk-chip{display:inline-flex;height:2rem;padding:0 1rem;align-items:center;border:none;border-radius:.5rem;cursor:pointer}.bpk-chip__leading-accessory-view{display:inline-flex;fill:currentcolor;margin-left:0;margin-right:.5rem}html[dir=rtl] .bpk-chip__leading-accessory-view{margin-left:.5rem;margin-right:0}.bpk-chip__trailing-accessory-view{display:inline-flex;fill:currentcolor;margin-left:.5rem;margin-right:-0.5rem}html[dir=rtl] .bpk-chip__trailing-accessory-view{margin-right:.5rem}html[dir=rtl] .bpk-chip__trailing-accessory-view{margin-left:-0.5rem}.bpk-chip--on-dark{background-color:rgba(0,0,0,0);color:#fff;box-shadow:0 0 0 1px rgba(255,255,255,.5) inset}.bpk-no-touch-support .bpk-chip--on-dark:hover:not(:active):not(:disabled){box-shadow:0 0 0 1px #fff inset}:global(.bpk-no-touch-support) .bpk-chip--on-dark:hover:not(:active):not(:disabled){box-shadow:0 0 0 1px #fff inset}.bpk-chip--on-dark:active:not(:disabled){box-shadow:0 0 0 1px #fff inset}.bpk-chip--on-dark-selected{color:#161616;color:var(--bpk-chip-on-dark-selected-text-color, rgb(22, 22, 22));background-color:#fff;background-color:var(--bpk-chip-on-dark-selected-background-color, rgb(255, 255, 255));box-shadow:0 0 0 1px rgba(0,0,0,0) inset}.bpk-no-touch-support .bpk-chip--on-dark-selected:hover:not(:active):not(:disabled){box-shadow:0 0 0 1px rgba(0,0,0,0) inset}:global(.bpk-no-touch-support) .bpk-chip--on-dark-selected:hover:not(:active):not(:disabled){box-shadow:0 0 0 1px rgba(0,0,0,0) inset}.bpk-chip--on-dark-selected:active:not(:disabled){box-shadow:0 0 0 1px rgba(0,0,0,0) inset}.bpk-no-touch-support .bpk-chip--on-dark-dismissible:hover:not(:active):not(:disabled) svg{fill:currentcolor}:global(.bpk-no-touch-support) .bpk-chip--on-dark-dismissible:hover:not(:active):not(:disabled) svg{fill:currentcolor}.bpk-chip--on-dark-dismissible:active:not(:disabled) svg{fill:currentcolor}.bpk-chip--on-dark-dismissible__trailing-accessory-view{fill:#626971}.bpk-chip--on-dark-disabled{box-shadow:0 0 0 1px rgba(0,0,0,0) inset}.bpk-chip--default{background-color:rgba(0,0,0,0);color:#161616;box-shadow:0 0 0 1px #c1c7cf inset}.bpk-no-touch-support .bpk-chip--default:hover:not(:active):not(:disabled){box-shadow:0 0 0 1px #05203c inset}:global(.bpk-no-touch-support) .bpk-chip--default:hover:not(:active):not(:disabled){box-shadow:0 0 0 1px #05203c inset}.bpk-chip--default:active:not(:disabled){box-shadow:0 0 0 1px #05203c inset}.bpk-chip--default-selected{color:#fff;color:var(--bpk-chip-default-selected-text-color, rgb(255, 255, 255));background-color:#05203c;background-color:var(--bpk-chip-default-selected-background-color, rgb(5, 32, 60));box-shadow:0 0 0 1px rgba(0,0,0,0) inset}.bpk-no-touch-support .bpk-chip--default-selected:hover:not(:active):not(:disabled){box-shadow:0 0 0 1px rgba(0,0,0,0) inset}:global(.bpk-no-touch-support) .bpk-chip--default-selected:hover:not(:active):not(:disabled){box-shadow:0 0 0 1px rgba(0,0,0,0) inset}.bpk-chip--default-selected:active:not(:disabled){box-shadow:0 0 0 1px rgba(0,0,0,0) inset}.bpk-no-touch-support .bpk-chip--default-dismissible:hover:not(:active):not(:disabled) svg{fill:currentcolor}:global(.bpk-no-touch-support) .bpk-chip--default-dismissible:hover:not(:active):not(:disabled) svg{fill:currentcolor}.bpk-chip--default-dismissible:active:not(:disabled) svg{fill:currentcolor}.bpk-chip--default-dismissible__trailing-accessory-view{fill:rgba(255,255,255,.5)}.bpk-chip--default-disabled{box-shadow:0 0 0 1px rgba(0,0,0,0) inset}.bpk-chip--on-image{background-color:#fff;color:#161616;box-shadow:0px 1px 3px 0px rgba(37,32,31,.3)}.bpk-no-touch-support .bpk-chip--on-image:hover:not(:active):not(:disabled){background-color:#eff3f8}:global(.bpk-no-touch-support) .bpk-chip--on-image:hover:not(:active):not(:disabled){background-color:#eff3f8}.bpk-chip--on-image:active:not(:disabled){background-color:#eff3f8}.bpk-chip--on-image-selected{color:#fff;color:var(--bpk-chip-on-image-selected-text-color, rgb(255, 255, 255));background-color:#05203c;background-color:var(--bpk-chip-on-image-selected-background-color, rgb(5, 32, 60))}.bpk-no-touch-support .bpk-chip--on-image-selected:hover:not(:active):not(:disabled){background-color:#05203c;background-color:var(--bpk-chip-on-image-selected-hover-background-color, rgb(5, 32, 60))}:global(.bpk-no-touch-support) .bpk-chip--on-image-selected:hover:not(:active):not(:disabled){background-color:#05203c;background-color:var(--bpk-chip-on-image-selected-hover-background-color, rgb(5, 32, 60))}.bpk-chip--on-image-selected:active:not(:disabled){background-color:#05203c;background-color:var(--bpk-chip-on-image-selected-active-background-color, rgb(5, 32, 60))}.bpk-no-touch-support .bpk-chip--on-image-dismissible:hover:not(:active):not(:disabled) svg{fill:currentcolor}:global(.bpk-no-touch-support) .bpk-chip--on-image-dismissible:hover:not(:active):not(:disabled) svg{fill:currentcolor}.bpk-chip--on-image-dismissible:active:not(:disabled) svg{fill:currentcolor}.bpk-chip--on-image-dismissible__trailing-accessory-view{fill:rgba(255,255,255,.5)}.bpk-chip--on-image-disabled{box-shadow:0px 1px 3px 0px rgba(37,32,31,.3)}.bpk-chip--disabled{background-color:#e0e4e9;color:rgba(0,0,0,.2);cursor:not-allowed}.bpk-chip--icon-only{padding-inline-end:.5rem;padding-inline-start:.5rem}.bpk-chip--icon-only__leading-accessory-view{margin-left:0;margin-right:0}html[dir=rtl] .bpk-chip--icon-only__leading-accessory-view{margin-left:0;margin-right:0}
@@ -26,7 +26,7 @@ export declare const CHIP_TYPES: {
26
26
  };
27
27
  interface ButtonProps extends Omit<ComponentProps<'button'>, 'type'> {
28
28
  onClick: (event: SyntheticEvent<HTMLButtonElement>) => void | null;
29
- children: ReactNode | string;
29
+ children?: ReactNode | string;
30
30
  type?: typeof CHIP_TYPES[keyof typeof CHIP_TYPES];
31
31
  }
32
32
  export interface CommonProps extends ButtonProps {
@@ -16,33 +16,10 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- import PropTypes from 'prop-types';
20
19
  export const CHIP_TYPES = {
21
20
  default: 'default',
22
21
  onDark: 'on-dark',
23
22
  onImage: 'on-image'
24
23
  };
25
24
 
26
- // onClick and children are already part of the button props, but we need to specify that they are required
27
-
28
- // TODO: Remove once chip examples have been migrated to TS
29
- export const COMMON_PROP_TYPES = {
30
- accessibilityLabel: PropTypes.string.isRequired,
31
- children: PropTypes.node.isRequired,
32
- onClick: PropTypes.func.isRequired,
33
- className: PropTypes.string,
34
- disabled: PropTypes.bool,
35
- leadingAccessoryView: PropTypes.node,
36
- selected: PropTypes.bool,
37
- trailingAccessoryView: PropTypes.node,
38
- type: PropTypes.oneOf(Object.values(CHIP_TYPES))
39
- };
40
-
41
- // TODO: Remove once chip examples have been migrated to TS
42
- export const COMMON_DEFAULT_PROPS = {
43
- disabled: false,
44
- leadingAccessoryView: null,
45
- selected: false,
46
- trailingAccessoryView: null,
47
- type: CHIP_TYPES.default
48
- };
25
+ // onClick is already part of the button props, but we need to specify that they are required
@@ -43,8 +43,9 @@ const BpkCloseButton = props => {
43
43
  "aria-label": label,
44
44
  className: classNames.join(' '),
45
45
  ...rest,
46
- children: /*#__PURE__*/_jsx(Icon, {
47
- className: getClassName('bpk-close-button__icon')
46
+ children: /*#__PURE__*/_jsx("span", {
47
+ className: getClassName('bpk-close-button__icon'),
48
+ children: /*#__PURE__*/_jsx(Icon, {})
48
49
  })
49
50
  })
50
51
  );
@@ -15,4 +15,4 @@
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
17
  */
18
- .bpk-close-button{width:1.5rem;height:1.5rem;margin-right:-0.125rem;margin-left:-0.125rem;padding:0;border:0;background-color:rgba(0,0,0,0);color:#626971;cursor:pointer;appearance:none;position:relative}.bpk-close-button::before{position:absolute;top:calc(-2.75rem/2 + 50%);left:calc(-2.75rem/2 + 50%);content:"";width:2.75rem;height:2.75rem}.bpk-no-touch-support .bpk-close-button:hover:not(:active):not(:disabled){color:#161616}:global(.bpk-no-touch-support) .bpk-close-button:hover:not(:active):not(:disabled){color:#161616}.bpk-close-button:active{color:#161616}.bpk-close-button__icon{vertical-align:-0.125rem;fill:currentcolor}
18
+ .bpk-close-button{width:1.5rem;height:1.5rem;margin-right:-0.125rem;margin-left:-0.125rem;padding:0;border:0;background-color:rgba(0,0,0,0);color:#626971;cursor:pointer;appearance:none;position:relative}.bpk-close-button::before{position:absolute;top:calc(-2.75rem/2 + 50%);left:calc(-2.75rem/2 + 50%);content:"";width:2.75rem;height:2.75rem}.bpk-no-touch-support .bpk-close-button:hover:not(:active):not(:disabled){color:#161616}:global(.bpk-no-touch-support) .bpk-close-button:hover:not(:active):not(:disabled){color:#161616}.bpk-close-button:active{color:#161616}.bpk-close-button__icon{vertical-align:-0.21875rem;fill:currentcolor}
@@ -21,8 +21,7 @@ import BpkText from "../../bpk-component-text";
21
21
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
22
22
  import { cssModules } from "../../bpk-react-utils";
23
23
  import STYLES from "./BpkContentCard.module.css";
24
- import { jsx as _jsx } from "react/jsx-runtime";
25
- import { jsxs as _jsxs } from "react/jsx-runtime";
24
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
26
25
  const getClassName = cssModules(STYLES);
27
26
  const BpkContentCard = ({
28
27
  card,
@@ -41,11 +40,17 @@ const BpkContentCard = ({
41
40
  loading: "lazy"
42
41
  })
43
42
  }), /*#__PURE__*/_jsxs("div", {
44
- children: [/*#__PURE__*/_jsx(BpkText, {
43
+ children: [/*#__PURE__*/_jsx(BpkText
44
+ // TODO: className to be removed.
45
+ // eslint-disable-next-line @skyscanner/rules/forbid-component-props
46
+ , {
45
47
  className: getClassName('bpk-content-card--headline'),
46
48
  tagName: "h3",
47
49
  children: card.headline
48
- }), /*#__PURE__*/_jsx(BpkText, {
50
+ }), /*#__PURE__*/_jsx(BpkText
51
+ // TODO: className to be removed.
52
+ // eslint-disable-next-line @skyscanner/rules/forbid-component-props
53
+ , {
49
54
  className: getClassName('bpk-content-card--description'),
50
55
  tagName: "p",
51
56
  children: card.description
@@ -17,14 +17,10 @@
17
17
  */
18
18
  /* eslint react/no-array-index-key: 0 */
19
19
 
20
- // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
21
- import BpkText from "../../bpk-component-text";
22
- // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
23
20
  import { cssModules } from "../../bpk-react-utils";
24
21
  import BpkContentCard from "./BpkContentCard";
25
22
  import STYLES from "./BpkContentCards.module.css";
26
- import { jsx as _jsx } from "react/jsx-runtime";
27
- import { jsxs as _jsxs } from "react/jsx-runtime";
23
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
28
24
  const getClassName = cssModules(STYLES);
29
25
  const BpkContentCards = ({
30
26
  cards,
@@ -34,8 +30,7 @@ const BpkContentCards = ({
34
30
  return null;
35
31
  }
36
32
  return /*#__PURE__*/_jsxs("div", {
37
- children: [/*#__PURE__*/_jsx(BpkText, {
38
- tagName: "h2",
33
+ children: [/*#__PURE__*/_jsx("h2", {
39
34
  className: getClassName('bpk-content-cards--header-text'),
40
35
  children: heading
41
36
  }), /*#__PURE__*/_jsx("div", {
@@ -15,4 +15,4 @@
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
17
  */
18
- .bpk-content-cards--header-text{margin-bottom:1rem;font-size:2rem;line-height:2.5rem;font-weight:700}@media(max-width: 32rem){.bpk-content-cards--header-text{font-size:1.5rem;line-height:1.75rem;font-weight:700}}.bpk-content-cards--layout{display:grid;grid-template-columns:repeat(auto-fit, minmax(3.125rem, 1fr));grid-auto-flow:column;gap:1.5rem}@media(max-width: 48rem){.bpk-content-cards--layout{grid-template-columns:1fr;grid-auto-flow:row;gap:1.5rem}}
18
+ .bpk-content-cards--header-text{margin-top:0;margin-bottom:1rem;font-size:2rem;line-height:2.5rem;font-weight:700}@media(max-width: 32rem){.bpk-content-cards--header-text{font-size:1.5rem;line-height:1.75rem;font-weight:700}}.bpk-content-cards--layout{display:grid;grid-template-columns:repeat(auto-fit, minmax(3.125rem, 1fr));grid-auto-flow:column;gap:1.5rem}@media(max-width: 48rem){.bpk-content-cards--layout{grid-template-columns:1fr;grid-auto-flow:row;gap:1.5rem}}
@@ -17,15 +17,15 @@
17
17
  */
18
18
 
19
19
  import { useMemo, useState } from 'react';
20
+
20
21
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
21
22
  import { useTable, useSortBy } from 'react-table';
22
23
  import { cssModules } from "../../bpk-react-utils";
23
- import STYLES from "./BpkDataTable.module.css";
24
- import { SORT_DIRECTION_TYPES } from "./common-types";
25
24
  import BpkDataTableHeader from "./BpkDataTableHeader";
25
+ import { SORT_DIRECTION_TYPES } from "./common-types";
26
26
  import { createColumnsSchema } from "./utils";
27
- import { jsx as _jsx } from "react/jsx-runtime";
28
- import { jsxs as _jsxs } from "react/jsx-runtime";
27
+ import STYLES from "./BpkDataTable.module.css";
28
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
29
29
  const getClassName = cssModules(STYLES);
30
30
  const KEYCODES = {
31
31
  ENTER: 13,
@@ -16,16 +16,15 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- import { cssModules } from "../../bpk-react-utils";
19
+ import { withRtlSupport } from "../../bpk-component-icon";
20
20
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
21
21
  import BpkSmallArrowDownIcon from "../../bpk-component-icon/sm/arrow-down";
22
22
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
23
23
  import BpkSmallArrowUpIcon from "../../bpk-component-icon/sm/arrow-up";
24
- import { withRtlSupport } from "../../bpk-component-icon";
25
- import STYLES from "./BpkDataTableHeader.module.css";
24
+ import { cssModules } from "../../bpk-react-utils";
26
25
  import { SORT_DIRECTION_TYPES } from "./common-types";
27
- import { jsx as _jsx } from "react/jsx-runtime";
28
- import { jsxs as _jsxs } from "react/jsx-runtime";
26
+ import STYLES from "./BpkDataTableHeader.module.css";
27
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
29
28
  const DownIcon = withRtlSupport(BpkSmallArrowDownIcon);
30
29
  const UpIcon = withRtlSupport(BpkSmallArrowUpIcon);
31
30
  const getClassName = cssModules(STYLES);
@@ -111,12 +110,16 @@ const BpkDataTableHeader = ({
111
110
  }), !disableSortBy && /*#__PURE__*/_jsxs("div", {
112
111
  className: getClassName('bpk-data-table-column__sort-icons'),
113
112
  "aria-hidden": true,
114
- children: [/*#__PURE__*/_jsx(UpIcon, {
115
- onClick: () => column.toggleSortBy(false),
116
- className: upIconClassNames
117
- }), /*#__PURE__*/_jsx(DownIcon, {
118
- onClick: () => column.toggleSortBy(true),
119
- className: downIconClassNames
113
+ children: [/*#__PURE__*/_jsx("div", {
114
+ className: upIconClassNames,
115
+ children: /*#__PURE__*/_jsx(UpIcon, {
116
+ onClick: () => column.toggleSortBy(false)
117
+ })
118
+ }), /*#__PURE__*/_jsx("div", {
119
+ className: downIconClassNames,
120
+ children: /*#__PURE__*/_jsx(DownIcon, {
121
+ onClick: () => column.toggleSortBy(true)
122
+ })
120
123
  })]
121
124
  }, "sort")]
122
125
  });
@@ -15,4 +15,4 @@
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
17
  */
18
- .bpk-data-table-column__header{display:flex;height:100%;margin:1rem;flex-direction:row;align-items:center;outline-offset:-0.25rem;font-size:.875rem;line-height:1.25rem;font-weight:700}.bpk-data-table-column__header:hover{cursor:pointer}.bpk-data-table-column__sort-icons{margin:0 0 0 .75rem}html[dir=rtl] .bpk-data-table-column__sort-icons{margin:0 .75rem 0 0}.bpk-data-table-column__sort-icon{display:block;fill:#c1c7cf}.bpk-data-table-column__sort-icon:hover{fill:#c1c7cf}.bpk-data-table-column__sort-icon--selected,.bpk-data-table-column__sort-icon--selected:hover{fill:#0062e3}.bpk-data-table-column__sort-icon--up{margin-bottom:-0.25rem}
18
+ .bpk-data-table-column__header{display:flex;height:100%;margin:1rem;flex-direction:row;align-items:center;outline-offset:-0.25rem;font-size:.875rem;line-height:1.25rem;font-weight:700}.bpk-data-table-column__header:hover{cursor:pointer}.bpk-data-table-column__sort-icons{margin:0 0 0 .75rem}html[dir=rtl] .bpk-data-table-column__sort-icons{margin:0 .75rem 0 0}.bpk-data-table-column__sort-icon{display:block;line-height:.5rem;fill:#c1c7cf}.bpk-data-table-column__sort-icon:hover{fill:#c1c7cf}.bpk-data-table-column__sort-icon--selected,.bpk-data-table-column__sort-icon--selected:hover{fill:#0062e3}.bpk-data-table-column__sort-icon--up{margin-bottom:-0.25rem}
@@ -17,17 +17,15 @@
17
17
  */
18
18
 
19
19
  import { createRef, Component } from 'react';
20
+ import BpkBreakpoint, { BREAKPOINTS } from "../../bpk-component-breakpoint";
21
+ import { composeCalendar, BpkCalendarGridHeader, BpkCalendarGrid, BpkCalendarDate, withCalendarState, CALENDAR_SELECTION_TYPE, DateUtils, BpkCalendarNav } from "../../bpk-component-calendar";
20
22
  import BpkInput, { withOpenEvents } from "../../bpk-component-input";
21
23
  import BpkModal from "../../bpk-component-modal";
22
24
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
23
25
  import BpkPopover from "../../bpk-component-popover";
24
26
  import { cssModules } from "../../bpk-react-utils";
25
- import BpkBreakpoint, { BREAKPOINTS } from "../../bpk-component-breakpoint";
26
- import { composeCalendar, BpkCalendarGridHeader, BpkCalendarGrid, BpkCalendarDate, withCalendarState, CALENDAR_SELECTION_TYPE, DateUtils, BpkCalendarNav } from "../../bpk-component-calendar";
27
27
  import STYLES from "./BpkDatepicker.module.css";
28
- import { jsx as _jsx } from "react/jsx-runtime";
29
- import { Fragment as _Fragment } from "react/jsx-runtime";
30
- import { jsxs as _jsxs } from "react/jsx-runtime";
28
+ import { jsx as _jsx, Fragment as _Fragment, jsxs as _jsxs } from "react/jsx-runtime";
31
29
  const getClassName = cssModules(STYLES);
32
30
  const Input = withOpenEvents(BpkInput);
33
31
  const DefaultCalendar = withCalendarState(composeCalendar(BpkCalendarNav, BpkCalendarGridHeader, BpkCalendarGrid, BpkCalendarDate));
@@ -16,7 +16,7 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
+ import BpkDescriptionDetails from "./src/BpkDescriptionDetails";
19
20
  import BpkDescriptionList from "./src/BpkDescriptionList";
20
21
  import BpkDescriptionTerm from "./src/BpkDescriptionTerm";
21
- import BpkDescriptionDetails from "./src/BpkDescriptionDetails";
22
22
  export { BpkDescriptionList, BpkDescriptionTerm, BpkDescriptionDetails };
@@ -31,11 +31,16 @@ const buildComponent = (TagName, baseClassName) => {
31
31
  if (className) {
32
32
  classNames.push(className);
33
33
  }
34
- return /*#__PURE__*/_jsx(TagName, {
35
- className: classNames.join(' '),
36
- ...rest,
37
- children: children
38
- });
34
+ return (
35
+ /*#__PURE__*/
36
+ // TODO: className to be removed
37
+ // eslint-disable-next-line @skyscanner/rules/forbid-component-props
38
+ _jsx(TagName, {
39
+ className: classNames.join(' '),
40
+ ...rest,
41
+ children: children
42
+ })
43
+ );
39
44
  };
40
45
  Component.propTypes = {
41
46
  children: PropTypes.node.isRequired,
@@ -16,14 +16,13 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- import { cssModules, Portal } from "../../bpk-react-utils";
20
19
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
21
20
  import BpkCloseButton from "../../bpk-component-close-button";
21
+ import { cssModules, Portal } from "../../bpk-react-utils";
22
22
  import BpkDialogInner from "./BpkDialogInner";
23
23
  import { HEADER_ICON_TYPES } from "./common-types";
24
24
  import STYLES from "./BpkDialog.module.css";
25
- import { jsx as _jsx } from "react/jsx-runtime";
26
- import { jsxs as _jsxs } from "react/jsx-runtime";
25
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
27
26
  const getClassName = cssModules(STYLES);
28
27
  const BpkDialog = ({
29
28
  children,
@@ -56,10 +55,12 @@ const BpkDialog = ({
56
55
  children: [headerIcon && /*#__PURE__*/_jsx("div", {
57
56
  className: headerIconClassNames,
58
57
  children: headerIcon
59
- }), dismissible && /*#__PURE__*/_jsx(BpkCloseButton, {
58
+ }), dismissible && /*#__PURE__*/_jsx("span", {
60
59
  className: closeButtonClassNames,
61
- label: closeLabel,
62
- onClick: onClose
60
+ children: /*#__PURE__*/_jsx(BpkCloseButton, {
61
+ label: closeLabel,
62
+ onClick: onClose
63
+ })
63
64
  }), children]
64
65
  })
65
66
  });
@@ -15,4 +15,4 @@
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
17
  */
18
- .bpk-dialog__container{display:flex;padding:1.5rem}@media screen\0 {.bpk-dialog__container{display:block}}.bpk-dialog__close-button{float:right;margin:0 0 1rem 1rem}html[dir=rtl] .bpk-dialog__close-button{float:left;margin:0 1rem 1rem 0}.bpk-dialog--with-icon{margin-top:2rem}.bpk-dialog__icon{position:absolute;top:0;left:50%;display:flex;width:3.5rem;height:3.5rem;margin-top:-1.75rem;margin-left:-1.75rem;justify-content:center;align-items:center;border:4px #fff solid;border-radius:50%}.bpk-dialog__icon--primary{background-color:#0062e3}.bpk-dialog__icon--warning{background-color:#f55d42}.bpk-dialog__icon--destructive{background-color:#e70866}.bpk-dialog__icon>svg{fill:#fff}
18
+ .bpk-dialog__container{display:flex;padding:1.5rem}@media screen\0 {.bpk-dialog__container{display:block}}.bpk-dialog__close-button{float:right;margin:0 .125rem 1rem 1rem}html[dir=rtl] .bpk-dialog__close-button{float:left;margin:0 1rem 1rem .125rem}.bpk-dialog--with-icon{margin-top:2rem}.bpk-dialog__icon{position:absolute;top:0;left:50%;display:flex;width:3.5rem;height:3.5rem;margin-top:-1.75rem;margin-left:-1.75rem;justify-content:center;align-items:center;border:4px #fff solid;border-radius:50%}.bpk-dialog__icon--primary{background-color:#0062e3}.bpk-dialog__icon--warning{background-color:#f55d42}.bpk-dialog__icon--destructive{background-color:#e70866}.bpk-dialog__icon>svg{fill:#fff}
@@ -16,13 +16,12 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- import { TransitionInitialMount, cssModules } from "../../bpk-react-utils";
20
- import { withScrim } from "../../bpk-scrim-utils";
21
19
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
22
20
  import { BpkContentBubble } from "../../bpk-component-flare";
21
+ import { TransitionInitialMount, cssModules } from "../../bpk-react-utils";
22
+ import { withScrim } from "../../bpk-scrim-utils";
23
23
  import STYLES from "./BpkDialogInner.module.css";
24
- import { jsx as _jsx } from "react/jsx-runtime";
25
- import { jsxs as _jsxs } from "react/jsx-runtime";
24
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
26
25
  const getClassName = cssModules(STYLES);
27
26
  const BpkDialogInner = props => {
28
27
  const {
@@ -49,7 +48,10 @@ const BpkDialogInner = props => {
49
48
  "aria-label": ariaLabel,
50
49
  className: classNames,
51
50
  ref: dialogRef,
52
- children: [flare && /*#__PURE__*/_jsx(BpkContentBubble, {
51
+ children: [flare && /*#__PURE__*/_jsx(BpkContentBubble
52
+ // TODO: className to be removed
53
+ // eslint-disable-next-line @skyscanner/rules/forbid-component-props
54
+ , {
53
55
  className: flareClassNames
54
56
  }), /*#__PURE__*/_jsx("div", {
55
57
  className: contentClassNames,
@@ -16,12 +16,10 @@
16
16
  * limitations under the License.
17
17
  */import PropTypes from 'prop-types';
18
18
  import { Component } from 'react';
19
- import { Portal, cssModules } from "../../bpk-react-utils";
19
+ import { Portal } from "../../bpk-react-utils";
20
20
  import { withScrim } from "../../bpk-scrim-utils";
21
21
  import BpkDrawerContent from "./BpkDrawerContent";
22
- import STYLES from "./BpkDrawer.module.css";
23
22
  import { jsx as _jsx } from "react/jsx-runtime";
24
- const getClassName = cssModules(STYLES);
25
23
  const BpkScrimDrawerContent = withScrim(BpkDrawerContent);
26
24
  class BpkDrawer extends Component {
27
25
  constructor() {
@@ -63,7 +61,6 @@ class BpkDrawer extends Component {
63
61
  isDrawerShown: isDrawerShown,
64
62
  onClose: this.hide,
65
63
  onCloseAnimationComplete: this.onCloseAnimationComplete,
66
- containerClassName: getClassName('bpk-drawer__container'),
67
64
  ...rest
68
65
  })
69
66
  });
@@ -17,12 +17,11 @@
17
17
  */import PropTypes from 'prop-types';
18
18
  import Transition from 'react-transition-group/Transition';
19
19
  import { animations } from '@skyscanner/bpk-foundations-web/tokens/base.es6';
20
- import { cssModules } from "../../bpk-react-utils";
21
- import { BpkButtonLink } from "../../bpk-component-link";
22
20
  import BpkCloseButton from "../../bpk-component-close-button";
21
+ import { BpkButtonLink } from "../../bpk-component-link";
22
+ import { cssModules } from "../../bpk-react-utils";
23
23
  import STYLES from "./BpkDrawerContent.module.css";
24
- import { jsx as _jsx } from "react/jsx-runtime";
25
- import { jsxs as _jsxs } from "react/jsx-runtime";
24
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
26
25
  const getClassName = cssModules(STYLES);
27
26
  const BpkDrawerContent = props => {
28
27
  const {
@@ -89,10 +88,12 @@ const BpkDrawerContent = props => {
89
88
  }), "\xA0", closeText ? /*#__PURE__*/_jsx(BpkButtonLink, {
90
89
  onClick: onClose,
91
90
  children: closeText
92
- }) : /*#__PURE__*/_jsx(BpkCloseButton, {
91
+ }) : /*#__PURE__*/_jsx("div", {
93
92
  className: getClassName('bpk-drawer__close-button'),
94
- label: closeLabel,
95
- onClick: onClose
93
+ children: /*#__PURE__*/_jsx(BpkCloseButton, {
94
+ label: closeLabel,
95
+ onClick: onClose
96
+ })
96
97
  })]
97
98
  }), /*#__PURE__*/_jsx("div", {
98
99
  className: contentClassNames.join(' '),
@@ -16,12 +16,11 @@
16
16
  * limitations under the License.
17
17
  */import PropTypes from 'prop-types';
18
18
  import { cloneElement } from 'react';
19
- import BpkLabel from "../../bpk-component-label";
20
19
  import BpkFormValidation from "../../bpk-component-form-validation";
20
+ import BpkLabel from "../../bpk-component-label";
21
21
  import { cssModules } from "../../bpk-react-utils";
22
22
  import STYLES from "./BpkFieldset.module.css";
23
- import { jsx as _jsx } from "react/jsx-runtime";
24
- import { jsxs as _jsxs } from "react/jsx-runtime";
23
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
25
24
  const getClassName = cssModules(STYLES);
26
25
  const BpkFieldset = props => {
27
26
  const {
@@ -83,13 +82,15 @@ const BpkFieldset = props => {
83
82
  _jsxs("fieldset", {
84
83
  className: classNames.join(' '),
85
84
  ...rest,
86
- children: [!isCheckbox && /*#__PURE__*/_jsx(BpkLabel, {
85
+ children: [!isCheckbox && /*#__PURE__*/_jsx("div", {
87
86
  className: getClassName('bpk-fieldset__label'),
88
- htmlFor: childId,
89
- required: required,
90
- disabled: disabled,
91
- valid: isValid,
92
- children: label
87
+ children: /*#__PURE__*/_jsx(BpkLabel, {
88
+ htmlFor: childId,
89
+ required: required,
90
+ disabled: disabled,
91
+ valid: isValid,
92
+ children: label
93
+ })
93
94
  }), clonedChildren, description && /*#__PURE__*/_jsx("span", {
94
95
  className: getClassName('bpk-fieldset__description'),
95
96
  id: descriptionId,
@@ -14,7 +14,7 @@
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 BpkFlareBar from "./src/BpkFlareBar";
18
- import BpkContentBubble from "./src/BpkContentBubble";
17
+ */import BpkContentBubble from "./src/BpkContentBubble";
18
+ import BpkFlareBar from "./src/BpkFlareBar";
19
19
  export default BpkFlareBar;
20
20
  export { BpkFlareBar, BpkContentBubble };
@@ -20,8 +20,7 @@ import PropTypes from 'prop-types';
20
20
  import { cssModules } from "../../bpk-react-utils";
21
21
  import BpkFlareBar from "./BpkFlareBar";
22
22
  import STYLES from "./bpk-content-bubble.module.css";
23
- import { jsx as _jsx } from "react/jsx-runtime";
24
- import { jsxs as _jsxs } from "react/jsx-runtime";
23
+ import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
25
24
  const getClassName = cssModules(STYLES);
26
25
  const BpkContentBubble = props => {
27
26
  const {
@@ -59,7 +58,10 @@ const BpkContentBubble = props => {
59
58
  className: contentClassNames.join(' '),
60
59
  children: content && content
61
60
  }), showPointer && /*#__PURE__*/_jsx(BpkFlareBar, {
62
- rounded: rounded,
61
+ rounded: rounded
62
+ // TODO: className to be removed
63
+ // eslint-disable-next-line @skyscanner/rules/forbid-component-props
64
+ ,
63
65
  className: getClassName('bpk-content-bubble__pointer'),
64
66
  ...flareProps
65
67
  })]