@skyscanner/backpack-web 33.4.0 → 33.6.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (169) hide show
  1. package/bpk-component-accordion/index.js +1 -1
  2. package/bpk-component-accordion/src/BpkAccordionItem.js +12 -12
  3. package/bpk-component-accordion/src/BpkAccordionItem.module.css +1 -1
  4. package/bpk-component-autosuggest/src/BpkAutosuggestSuggestion.js +4 -1
  5. package/bpk-component-banner-alert/index.js +1 -1
  6. package/bpk-component-banner-alert/src/AnimateAndFade.js +33 -31
  7. package/bpk-component-banner-alert/src/BpkBannerAlertInner.js +11 -4
  8. package/bpk-component-barchart/src/BpkBarchart.js +8 -8
  9. package/bpk-component-bottom-sheet/src/BpkBottomSheet.js +3 -3
  10. package/bpk-component-breadcrumb/src/BpkBreadcrumbItem.js +17 -12
  11. package/bpk-component-breadcrumb/src/BpkBreadcrumbItem.module.css +1 -1
  12. package/bpk-component-breakpoint/src/BpkBreakpoint.js +20 -4
  13. package/bpk-component-breakpoint/src/useMediaQuery.js +10 -7
  14. package/bpk-component-button/index.js +5 -5
  15. package/bpk-component-button/src/BpkButtonDestructive.js +10 -9
  16. package/bpk-component-button/src/BpkButtonFeatured.js +10 -9
  17. package/bpk-component-button/src/BpkButtonLink.js +11 -10
  18. package/bpk-component-button/src/BpkButtonLinkOnDark.js +11 -10
  19. package/bpk-component-button/src/BpkButtonPrimary.js +2 -2
  20. package/bpk-component-button/src/BpkButtonPrimaryOnDark.js +10 -9
  21. package/bpk-component-button/src/BpkButtonPrimaryOnLight.js +10 -9
  22. package/bpk-component-button/src/BpkButtonSecondary.js +10 -10
  23. package/bpk-component-button/src/BpkButtonSecondaryOnDark.js +10 -9
  24. package/bpk-component-calendar/index.js +1 -1
  25. package/bpk-component-calendar/src/BpkCalendarContainer.js +3 -3
  26. package/bpk-component-calendar/src/BpkCalendarGrid.js +2 -2
  27. package/bpk-component-calendar/src/BpkCalendarGrid.module.css +1 -1
  28. package/bpk-component-calendar/src/BpkCalendarGridHeader.js +4 -1
  29. package/bpk-component-calendar/src/BpkCalendarGridTransition.js +5 -2
  30. package/bpk-component-calendar/src/BpkCalendarNav.js +9 -3
  31. package/bpk-component-calendar/src/Week.js +6 -3
  32. package/bpk-component-calendar/src/composeCalendar.js +8 -2
  33. package/bpk-component-calendar/src/date-utils.js +14 -14
  34. package/bpk-component-card/src/BpkDividedCard.js +18 -13
  35. package/bpk-component-card-button/src/BpkSaveButton.js +13 -4
  36. package/bpk-component-chip/index.d.ts +3 -5
  37. package/bpk-component-chip/index.js +3 -2
  38. package/bpk-component-chip/src/BpkDismissibleChip.js +5 -3
  39. package/bpk-component-chip/src/BpkIconChip.d.ts +25 -0
  40. package/bpk-component-chip/src/BpkIconChip.js +31 -0
  41. package/bpk-component-chip/src/BpkSelectableChip.d.ts +0 -2
  42. package/bpk-component-chip/src/BpkSelectableChip.js +4 -3
  43. package/bpk-component-chip/src/BpkSelectableChip.module.css +1 -1
  44. package/bpk-component-chip/src/commonTypes.d.ts +1 -1
  45. package/bpk-component-chip/src/commonTypes.js +1 -24
  46. package/bpk-component-close-button/src/BpkCloseButton.js +7 -4
  47. package/bpk-component-close-button/src/BpkCloseButton.module.css +1 -1
  48. package/bpk-component-content-cards/src/BpkContentCard.js +8 -2
  49. package/bpk-component-datatable/src/BpkDataTable.js +1 -1
  50. package/bpk-component-datatable/src/BpkDataTableHeader.js +12 -8
  51. package/bpk-component-datatable/src/BpkDataTableHeader.module.css +1 -1
  52. package/bpk-component-datepicker/src/BpkDatepicker.js +2 -7
  53. package/bpk-component-description-list/index.js +1 -1
  54. package/bpk-component-description-list/src/ComponentFactory.js +10 -5
  55. package/bpk-component-dialog/src/BpkDialog.js +6 -4
  56. package/bpk-component-dialog/src/BpkDialog.module.css +1 -1
  57. package/bpk-component-dialog/src/BpkDialogInner.js +6 -3
  58. package/bpk-component-drawer/src/BpkDrawer.js +1 -4
  59. package/bpk-component-drawer/src/BpkDrawerContent.js +7 -5
  60. package/bpk-component-fieldset/src/BpkFieldset.js +9 -7
  61. package/bpk-component-flare/index.js +2 -2
  62. package/bpk-component-flare/src/BpkContentBubble.js +4 -1
  63. package/bpk-component-flare/src/BpkFlareBar.js +13 -4
  64. package/bpk-component-floating-notification/src/BpkFloatingNotification.js +8 -2
  65. package/bpk-component-floating-notification/src/BpkFloatingNotification.module.css +1 -1
  66. package/bpk-component-form-validation/src/BpkFormValidation.js +5 -4
  67. package/bpk-component-graphic-promotion/src/BpkGraphicPromo.js +9 -11
  68. package/bpk-component-graphic-promotion/src/BpkGraphicPromo.module.css +1 -1
  69. package/bpk-component-grid-toggle/src/BpkGridToggle.js +8 -6
  70. package/bpk-component-horizontal-nav/src/BpkHorizontalNav.js +16 -14
  71. package/bpk-component-horizontal-nav/src/BpkHorizontalNav.module.css +1 -1
  72. package/bpk-component-horizontal-nav/src/BpkHorizontalNavItem.js +2 -2
  73. package/bpk-component-icon/index.js +1 -1
  74. package/bpk-component-icon/lg/ai.js +1 -2
  75. package/bpk-component-icon/lg/dot.js +20 -0
  76. package/bpk-component-icon/sm/ai.js +1 -2
  77. package/bpk-component-icon/sm/dot.js +20 -0
  78. package/bpk-component-icon/src/classNameModifierHOCFactory.js +3 -0
  79. package/bpk-component-image/index.js +2 -2
  80. package/bpk-component-image/src/BpkBackgroundImage.js +2 -1
  81. package/bpk-component-image/src/BpkImage.js +2 -1
  82. package/bpk-component-infinite-scroll/src/withInfiniteScroll.js +3 -3
  83. package/bpk-component-info-banner/src/AnimateAndFade.js +33 -31
  84. package/bpk-component-info-banner/src/BpkInfoBanner.module.css +1 -1
  85. package/bpk-component-info-banner/src/BpkInfoBannerInner.js +16 -12
  86. package/bpk-component-input/index.js +1 -1
  87. package/bpk-component-input/src/BpkClearButton.js +3 -1
  88. package/bpk-component-input/src/BpkInput.js +4 -1
  89. package/bpk-component-input/src/withOpenEvents.js +4 -1
  90. package/bpk-component-link/index.js +2 -2
  91. package/bpk-component-list/src/BpkList.js +2 -2
  92. package/bpk-component-loading-button/src/BpkLoadingButton.js +6 -3
  93. package/bpk-component-map/index.js +4 -4
  94. package/bpk-component-map/src/BpkIconMarker.js +1 -1
  95. package/bpk-component-map/src/BpkMap.js +4 -3
  96. package/bpk-component-map/src/BpkPriceMarker.js +7 -5
  97. package/bpk-component-map/src/BpkPriceMarkerV2/BpkPriceMarker.js +1 -1
  98. package/bpk-component-mobile-scroll-container/src/BpkMobileScrollContainer.js +0 -8
  99. package/bpk-component-mobile-scroll-container/src/BpkMobileScrollContainer.module.css +1 -1
  100. package/bpk-component-modal/index.js +4 -3
  101. package/bpk-component-modal/src/BpkModal.d.ts +2 -1
  102. package/bpk-component-modal/src/BpkModal.js +4 -2
  103. package/bpk-component-modal/src/BpkModalInner.d.ts +2 -0
  104. package/bpk-component-modal/src/BpkModalInner.js +24 -8
  105. package/bpk-component-modal/src/BpkModalInner.module.css +1 -1
  106. package/bpk-component-modal/src/BpkModalV2/BpKModal.module.css +1 -1
  107. package/bpk-component-modal/src/BpkModalV2/BpkModal.d.ts +2 -0
  108. package/bpk-component-modal/src/BpkModalV2/BpkModal.js +19 -8
  109. package/bpk-component-navigation-bar/index.js +1 -1
  110. package/bpk-component-navigation-bar/src/BpkNavigationBar.js +7 -5
  111. package/bpk-component-navigation-bar/src/BpkNavigationBarButtonLink.js +7 -7
  112. package/bpk-component-navigation-bar/src/BpkNavigationBarIconButton.js +8 -8
  113. package/bpk-component-nudger/index.js +1 -1
  114. package/bpk-component-nudger/src/BpkConfigurableNudger.js +16 -4
  115. package/bpk-component-nudger/src/BpkNudger.js +15 -8
  116. package/bpk-component-nudger/src/BpkNudger.module.css +1 -1
  117. package/bpk-component-page-indicator/src/BpkPageIndicator.module.css +1 -1
  118. package/bpk-component-page-indicator/src/NavButton.js +1 -1
  119. package/bpk-component-pagination/src/BpkPaginationList.js +1 -1
  120. package/bpk-component-pagination/src/BpkPaginationNudger.js +13 -4
  121. package/bpk-component-pagination/src/BpkPaginationPage.js +4 -1
  122. package/bpk-component-phone-input/src/BpkPhoneInput.js +19 -10
  123. package/bpk-component-popover/src/BpkPopover.js +6 -3
  124. package/bpk-component-popover/src/BpkPopoverPortal.js +5 -2
  125. package/bpk-component-popover/src/keyboardFocusScope.js +1 -1
  126. package/bpk-component-price/src/BpkPrice.js +17 -5
  127. package/bpk-component-rating/src/BpkRating.js +17 -5
  128. package/bpk-component-rtl-toggle/src/BpkRtlToggle.js +0 -4
  129. package/bpk-component-scrollable-calendar/src/BpkScrollableCalendarGrid.js +6 -3
  130. package/bpk-component-scrollable-calendar/src/BpkScrollableCalendarGridList.js +6 -3
  131. package/bpk-component-section-header/src/BpkSectionHeader.js +6 -5
  132. package/bpk-component-section-header/src/BpkSectionHeader.module.css +1 -1
  133. package/bpk-component-section-list/index.js +1 -1
  134. package/bpk-component-section-list/src/BpkSectionListItem.js +8 -6
  135. package/bpk-component-section-list/src/BpkSectionListItem.module.css +1 -1
  136. package/bpk-component-section-list/src/BpkSectionListSection.js +1 -1
  137. package/{bpk-component-datepicker/src/BpkDatepicker.module.css → bpk-component-skeleton/index.js} +8 -5
  138. package/bpk-component-skeleton/src/BpkBaseSkeleton.js +30 -0
  139. package/bpk-component-skeleton/src/BpkBaseSkeleton.module.css +18 -0
  140. package/bpk-component-skeleton/src/BpkSkeleton.js +38 -0
  141. package/bpk-component-skeleton/src/BpkSkeleton.module.css +18 -0
  142. package/bpk-component-skeleton/src/common-types.js +33 -0
  143. package/bpk-component-spinner/index.js +3 -3
  144. package/bpk-component-spinner/src/BpkExtraLargeSpinner.js +6 -4
  145. package/bpk-component-spinner/src/BpkLargeSpinner.js +6 -4
  146. package/bpk-component-spinner/src/BpkSpinner.js +6 -4
  147. package/bpk-component-spinner/src/BpkSpinner.module.css +1 -1
  148. package/bpk-component-split-input/src/BpkInputField.js +2 -2
  149. package/bpk-component-split-input/src/BpkSplitInput.js +3 -3
  150. package/bpk-component-star-rating/index.js +4 -4
  151. package/bpk-component-star-rating/src/BpkInteractiveStar.js +6 -3
  152. package/bpk-component-star-rating/src/BpkInteractiveStarRating.js +1 -1
  153. package/bpk-component-star-rating/src/BpkStar.js +18 -18
  154. package/bpk-component-star-rating/src/BpkStar.module.css +1 -1
  155. package/bpk-component-swap-button/src/BpkSwapButton.js +2 -1
  156. package/bpk-component-table/index.js +2 -2
  157. package/bpk-component-text/src/BpkText.js +10 -5
  158. package/bpk-component-theme-toggle/src/BpkThemeToggle.js +5 -3
  159. package/bpk-component-theme-toggle/src/updateOnThemeChange.js +1 -1
  160. package/bpk-component-tooltip/src/BpkTooltipPortal.js +4 -1
  161. package/bpk-mixins/_chips.scss +9 -0
  162. package/bpk-react-utils/index.js +3 -3
  163. package/bpk-react-utils/src/withDefaultProps.js +4 -1
  164. package/bpk-scrim-utils/src/withScrimmedPortal.js +1 -1
  165. package/bpk-theming/src/BpkThemeProvider.js +1 -1
  166. package/package.json +2 -2
  167. package/unstable__bpk-mixins/_chips.scss +9 -0
  168. package/bpk-component-button/src/commonButtonTests.js +0 -133
  169. package/bpk-component-navigation-bar/src/BpkNavigationBarButtonLink.module.css +0 -18
@@ -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
- @keyframes bpk-keyframe-spin{100%{transform:rotate(1turn)}}.bpk-spinner{width:1rem;height:1rem;animation:bpk-keyframe-spin 600ms linear infinite}.bpk-spinner--primary{fill:#0062e3;fill:var(--bpk-spinner-primary-color, rgb(0, 98, 227))}.bpk-spinner--light{fill:#fff}.bpk-spinner--dark{fill:#161616}.bpk-spinner--large{width:1.5rem;height:1.5rem}.bpk-spinner--extra-large{width:2rem;height:2rem}.bpk-spinner--align-to-button{vertical-align:baseline}.bpk-spinner--align-to-large-button{margin-top:0rem;vertical-align:top}
18
+ @keyframes bpk-keyframe-spin{100%{transform:rotate(1turn)}}.bpk-spinner{display:block;width:1rem;height:1rem;animation:bpk-keyframe-spin 600ms linear infinite}.bpk-spinner--primary{fill:#0062e3;fill:var(--bpk-spinner-primary-color, rgb(0, 98, 227))}.bpk-spinner--light{fill:#fff}.bpk-spinner--dark{fill:#161616}.bpk-spinner--large{width:1.5rem;height:1.5rem}.bpk-spinner--extra-large{width:2rem;height:2rem}.bpk-spinner--align-to-button{vertical-align:baseline}.bpk-spinner--align-to-large-button{margin-top:0rem;vertical-align:top}
@@ -14,8 +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 { Component } from 'react';
18
- import PropTypes from 'prop-types';
17
+ */import PropTypes from 'prop-types';
18
+ import { Component } from 'react';
19
19
  import BpkInput from "../../bpk-component-input";
20
20
  import { cssModules } from "../../bpk-react-utils";
21
21
  import STYLES from "./BpkInputField.module.css";
@@ -14,10 +14,10 @@
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 { Component } from 'react';
18
- import PropTypes from 'prop-types';
19
- import { cssModules } from "../../bpk-react-utils";
17
+ */import PropTypes from 'prop-types';
18
+ import { Component } from 'react';
20
19
  import { INPUT_TYPES } from "../../bpk-component-input";
20
+ import { cssModules } from "../../bpk-react-utils";
21
21
  import InputField from "./BpkInputField";
22
22
  import STYLES from "./BpkSplitInput.module.css";
23
23
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -14,11 +14,11 @@
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 BpkStar, { BpkStarNonRtl, STAR_TYPES } from "./src/BpkStar";
18
- import BpkInteractiveStar from "./src/BpkInteractiveStar";
19
- import BpkStarRating, { ROUNDING_TYPES } from "./src/BpkStarRating";
17
+ */import BpkInteractiveStar from "./src/BpkInteractiveStar";
20
18
  import BpkInteractiveStarRating from "./src/BpkInteractiveStarRating";
21
- import withInteractiveStarRatingState from "./src/withInteractiveStarRatingState";
19
+ import BpkStar, { BpkStarNonRtl, STAR_TYPES } from "./src/BpkStar";
20
+ import BpkStarRating, { ROUNDING_TYPES } from "./src/BpkStarRating";
22
21
  import themeAttributes from "./src/themeAttributes";
22
+ import withInteractiveStarRatingState from "./src/withInteractiveStarRatingState";
23
23
  export { BpkStar, BpkStarNonRtl, STAR_TYPES, ROUNDING_TYPES, BpkInteractiveStar, BpkInteractiveStarRating, withInteractiveStarRatingState, themeAttributes };
24
24
  export default BpkStarRating;
@@ -44,10 +44,13 @@ const BpkInteractiveStar = props => {
44
44
  className: buttonClassNames,
45
45
  "aria-pressed": selected,
46
46
  type: "button",
47
- children: /*#__PURE__*/_jsx(BpkStarNonRtl, {
47
+ children: /*#__PURE__*/_jsx("div", {
48
48
  className: iconClassNames,
49
- type: type,
50
- ...rest
49
+ children: /*#__PURE__*/_jsx(BpkStarNonRtl, {
50
+ type: type
51
+ /* $FlowFixMe[cannot-spread-inexact] - inexact rest. See decisions/flowfixme.md */,
52
+ ...rest
53
+ })
51
54
  })
52
55
  });
53
56
  };
@@ -16,8 +16,8 @@
16
16
  * limitations under the License.
17
17
  */import PropTypes from 'prop-types';
18
18
  import { cssModules } from "../../bpk-react-utils";
19
- import { STAR_TYPES } from "./BpkStar";
20
19
  import BpkInteractiveStar from "./BpkInteractiveStar";
20
+ import { STAR_TYPES } from "./BpkStar";
21
21
  import STYLES from "./BpkStarRating.module.css";
22
22
  import { jsx as _jsx } from "react/jsx-runtime";
23
23
  const getClassName = cssModules(STYLES);
@@ -15,13 +15,13 @@
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
17
  */import PropTypes from 'prop-types';
18
- import SmallIcon from "../../bpk-component-icon/sm/star";
18
+ import { withRtlSupport } from "../../bpk-component-icon";
19
19
  import LargeIcon from "../../bpk-component-icon/lg/star";
20
- import OutlineSmallIcon from "../../bpk-component-icon/sm/star-outline";
20
+ import HalfLargeIcon from "../../bpk-component-icon/lg/star-half";
21
21
  import OutlineLargeIcon from "../../bpk-component-icon/lg/star-outline";
22
+ import SmallIcon from "../../bpk-component-icon/sm/star";
22
23
  import HalfSmallIcon from "../../bpk-component-icon/sm/star-half";
23
- import HalfLargeIcon from "../../bpk-component-icon/lg/star-half";
24
- import { withRtlSupport } from "../../bpk-component-icon";
24
+ import OutlineSmallIcon from "../../bpk-component-icon/sm/star-outline";
25
25
  import { cssModules } from "../../bpk-react-utils";
26
26
  import STYLES from "./BpkStar.module.css";
27
27
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -54,26 +54,26 @@ const BpkStar = props => {
54
54
  /*#__PURE__*/
55
55
  // $FlowFixMe[cannot-spread-inexact] - inexact rest. See decisions/flowfixme.md
56
56
  _jsx("span", {
57
- className: containerClassNames,
57
+ className: [containerClassNames, halfIconClassNames],
58
58
  ...rest,
59
- children: /*#__PURE__*/_jsx(HalfIcon, {
60
- className: halfIconClassNames
61
- })
59
+ children: /*#__PURE__*/_jsx(HalfIcon, {})
62
60
  })
63
61
  );
64
62
  }
65
- return type === STAR_TYPES.FULL ?
66
- /*#__PURE__*/
67
- // $FlowFixMe[cannot-spread-inexact] - inexact rest. See decisions/flowfixme.md
68
- _jsx(Icon, {
63
+ return type === STAR_TYPES.FULL ? /*#__PURE__*/_jsx("span", {
69
64
  className: iconClassNames,
70
- ...rest
71
- }) :
72
- /*#__PURE__*/
73
- // $FlowFixMe[cannot-spread-inexact] - inexact rest. See decisions/flowfixme.md
74
- _jsx(OutlineIcon, {
65
+ children: /*#__PURE__*/_jsx(Icon
66
+ // $FlowFixMe[cannot-spread-inexact] - inexact rest. See decisions/flowfixme.md
67
+ , {
68
+ ...rest
69
+ })
70
+ }) : /*#__PURE__*/_jsx("span", {
75
71
  className: iconClassNames,
76
- ...rest
72
+ children: /*#__PURE__*/_jsx(OutlineIcon
73
+ // $FlowFixMe[cannot-spread-inexact] - inexact rest. See decisions/flowfixme.md
74
+ , {
75
+ ...rest
76
+ })
77
77
  });
78
78
  };
79
79
  BpkStar.propTypes = {
@@ -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-star{display:inline-block;vertical-align:text-bottom;fill:rgba(0,0,0,.2)}.bpk-star--large{width:1.5rem;height:1.5rem;vertical-align:bottom}.bpk-star--half{position:absolute;left:0}.bpk-star--filled{fill:#f55d42;fill:var(--bpk-star-rating-filled-color, rgb(245, 93, 66))}.bpk-star__container{display:inline-block;width:1rem;height:1rem}.bpk-star__container--half-star{position:relative;vertical-align:text-bottom}.bpk-star__container--large{width:1.5rem;height:1.5rem;vertical-align:bottom}
18
+ .bpk-star{display:inline-flex;width:1rem;height:1rem;vertical-align:text-bottom;fill:rgba(0,0,0,.2)}.bpk-star--large{width:1.5rem;height:1.5rem;vertical-align:bottom}.bpk-star--half{position:absolute;left:0}.bpk-star--filled{fill:#f55d42;fill:var(--bpk-star-rating-filled-color, rgb(245, 93, 66))}.bpk-star__container{display:inline-flex;width:1rem;height:1rem}.bpk-star__container--half-star{position:relative;vertical-align:text-bottom}.bpk-star__container--large{width:1.5rem;height:1.5rem;vertical-align:bottom}
@@ -17,9 +17,10 @@
17
17
  */
18
18
 
19
19
  import { useState } from 'react';
20
- import { cssModules } from "../../bpk-react-utils";
20
+
21
21
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
22
22
  import SwapVertical from "../../bpk-component-icon/sm/swap--vertical";
23
+ import { cssModules } from "../../bpk-react-utils";
23
24
  import STYLES from "./BpkSwapButton.module.css";
24
25
  import { jsx as _jsx } from "react/jsx-runtime";
25
26
  const getClassName = cssModules(STYLES);
@@ -15,9 +15,9 @@
15
15
  * See the License for the specific language governing permissions and
16
16
  * limitations under the License.
17
17
  */import BpkTable from "./src/BpkTable";
18
- import BpkTableHead from "./src/BpkTableHead";
19
18
  import BpkTableBody from "./src/BpkTableBody";
20
- import BpkTableRow from "./src/BpkTableRow";
21
19
  import BpkTableCell from "./src/BpkTableCell";
20
+ import BpkTableHead from "./src/BpkTableHead";
22
21
  import BpkTableHeadCell from "./src/BpkTableHeadCell";
22
+ import BpkTableRow from "./src/BpkTableRow";
23
23
  export { BpkTable, BpkTableHead, BpkTableBody, BpkTableRow, BpkTableCell, BpkTableHeadCell };
@@ -57,10 +57,15 @@ const BpkText = ({
57
57
  ...rest
58
58
  }) => {
59
59
  const classNames = getClassName('bpk-text', `bpk-text--${textStyle}`, className);
60
- return /*#__PURE__*/_jsx(TagName, {
61
- className: classNames,
62
- ...rest,
63
- children: children
64
- });
60
+ return (
61
+ /*#__PURE__*/
62
+ // Allowed, TagName is always a dom element.
63
+ // eslint-disable-next-line @skyscanner/rules/forbid-component-props
64
+ _jsx(TagName, {
65
+ className: classNames,
66
+ ...rest,
67
+ children: children
68
+ })
69
+ );
65
70
  };
66
71
  export default BpkText;
@@ -81,10 +81,12 @@ class BpkThemeToggle extends Component {
81
81
  } = this.props;
82
82
  return /*#__PURE__*/_jsxs("div", {
83
83
  ...rest,
84
- children: [/*#__PURE__*/_jsx(BpkLabel, {
84
+ children: [/*#__PURE__*/_jsx("span", {
85
85
  className: getClassName('bpk-theme-toggle__label'),
86
- htmlFor: inputId,
87
- children: "Change theme"
86
+ children: /*#__PURE__*/_jsx(BpkLabel, {
87
+ htmlFor: inputId,
88
+ children: "Change theme"
89
+ })
88
90
  }), /*#__PURE__*/_jsxs(BpkSelect, {
89
91
  id: inputId,
90
92
  name: inputId,
@@ -16,8 +16,8 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- import { Component } from 'react';
20
19
  import PropTypes from 'prop-types';
20
+ import { Component } from 'react';
21
21
  import { wrapDisplayName } from "../../bpk-react-utils";
22
22
  import { getHtmlElement, THEME_CHANGE_EVENT } from "./utils";
23
23
  import { jsx as _jsx } from "react/jsx-runtime";
@@ -137,7 +137,10 @@ class BpkTooltipPortal extends Component {
137
137
  onOpen: this.onOpen,
138
138
  onClose: this.closeTooltip,
139
139
  style: portalStyle,
140
- renderTarget: renderTarget,
140
+ renderTarget: renderTarget
141
+ // TODO: className to be removed
142
+ // eslint-disable-next-line @skyscanner/rules/forbid-component-props
143
+ ,
141
144
  className: classNames.join(' '),
142
145
  children: /*#__PURE__*/_jsx(BpkTooltip, {
143
146
  padded: padded,
@@ -237,4 +237,13 @@
237
237
  color: $bpk-text-disabled-day;
238
238
  cursor: not-allowed;
239
239
  }
240
+
241
+ &--icon-only {
242
+ padding-inline-end: bpk-spacing-md();
243
+ padding-inline-start: bpk-spacing-md();
244
+
245
+ &__leading-accessory-view {
246
+ @include bpk-margin-trailing(0);
247
+ }
248
+ }
240
249
  }
@@ -16,16 +16,16 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- import wrapDisplayName from "./src/wrapDisplayName";
19
+ import { BpkDialogWrapper } from "./src/BpkDialogWrapper/BpkDialogWrapper";
20
20
  import Portal from "./src/Portal";
21
21
  import TransitionInitialMount from "./src/TransitionInitialMount";
22
22
  import cssModules from "./src/cssModules";
23
23
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
24
24
  import deprecated from "./src/deprecated";
25
25
  import { isDeviceIphone, isDeviceIpad, isDeviceIos } from "./src/deviceDetection";
26
- import withDefaultProps from "./src/withDefaultProps";
27
26
  import isRTL from "./src/isRTL";
28
- import { BpkDialogWrapper } from "./src/BpkDialogWrapper/BpkDialogWrapper";
27
+ import withDefaultProps from "./src/withDefaultProps";
28
+ import wrapDisplayName from "./src/wrapDisplayName";
29
29
  export { Portal, TransitionInitialMount, cssModules, deprecated, withDefaultProps, wrapDisplayName, isDeviceIphone, isDeviceIpad, isDeviceIos, isRTL, BpkDialogWrapper };
30
30
  export default {
31
31
  Portal,
@@ -35,7 +35,10 @@ const withDefaultProps = (WrappedComponent, defaultProps) => {
35
35
  if (innerClassName) {
36
36
  classNames.push(innerClassName);
37
37
  }
38
- return /*#__PURE__*/_jsx(WrappedComponent, {
38
+ return /*#__PURE__*/_jsx(WrappedComponent
39
+ // General HOC difficult/impossible to remove
40
+ // eslint-disable-next-line @skyscanner/rules/forbid-component-props
41
+ , {
39
42
  className: classNames.join(' '),
40
43
  ...defaultRest,
41
44
  ...rest,
@@ -18,8 +18,8 @@
18
18
 
19
19
  import { useState, useEffect } from 'react';
20
20
  import { createPortal } from 'react-dom';
21
- import withScrim from "./withScrim";
22
21
  import BpkScrim from "./BpkScrim";
22
+ import withScrim from "./withScrim";
23
23
  import { jsx as _jsx } from "react/jsx-runtime";
24
24
  const getPortalElement = target => {
25
25
  const portalElement = target && typeof target === 'function' ? target() : null;
@@ -16,8 +16,8 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- import { Component } from 'react';
20
19
  import PropTypes from 'prop-types';
20
+ import { Component } from 'react';
21
21
  import { jsx as _jsx } from "react/jsx-runtime";
22
22
  const uniq = (arr = []) => {
23
23
  const seen = {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyscanner/backpack-web",
3
- "version": "33.4.0",
3
+ "version": "33.6.0",
4
4
  "description": "Backpack Design System web library",
5
5
  "repository": {
6
6
  "type": "git",
@@ -24,7 +24,7 @@
24
24
  "dependencies": {
25
25
  "@popperjs/core": "^2.11.5",
26
26
  "@react-google-maps/api": "^2.12.0",
27
- "@skyscanner/bpk-foundations-web": "^17.5.3",
27
+ "@skyscanner/bpk-foundations-web": "^17.9.0",
28
28
  "@skyscanner/bpk-svgs": "^19.1.0",
29
29
  "a11y-focus-scope": "^1.1.3",
30
30
  "a11y-focus-store": "^1.0.0",
@@ -237,4 +237,13 @@
237
237
  color: tokens.$bpk-text-disabled-day;
238
238
  cursor: not-allowed;
239
239
  }
240
+
241
+ &--icon-only {
242
+ padding-inline-end: tokens.bpk-spacing-md();
243
+ padding-inline-start: tokens.bpk-spacing-md();
244
+
245
+ &__leading-accessory-view {
246
+ @include margins.bpk-margin-trailing(0);
247
+ }
248
+ }
240
249
  }
@@ -1,133 +0,0 @@
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 { render } from '@testing-library/react';
20
- import { jsx as _jsx } from "react/jsx-runtime";
21
- const commonButtonTests = ButtonToTest => {
22
- describe('ButtonToTest', () => {
23
- it('should render correctly', () => {
24
- const {
25
- asFragment
26
- } = render( /*#__PURE__*/_jsx(ButtonToTest, {
27
- children: "My button"
28
- }));
29
- expect(asFragment()).toMatchSnapshot();
30
- });
31
- it('should render correctly with a "href" attribute', () => {
32
- const {
33
- asFragment
34
- } = render( /*#__PURE__*/_jsx(ButtonToTest, {
35
- href: "#",
36
- children: "My button"
37
- }));
38
- expect(asFragment()).toMatchSnapshot();
39
- });
40
- it('should render correctly with a "disabled" attribute', () => {
41
- const {
42
- asFragment
43
- } = render( /*#__PURE__*/_jsx(ButtonToTest, {
44
- disabled: true,
45
- children: "My button"
46
- }));
47
- expect(asFragment()).toMatchSnapshot();
48
- });
49
- it('should render correctly with a "large" attribute', () => {
50
- const {
51
- asFragment
52
- } = render( /*#__PURE__*/_jsx(ButtonToTest, {
53
- large: true,
54
- children: "My button"
55
- }));
56
- expect(asFragment()).toMatchSnapshot();
57
- });
58
- it('should render correctly with an "iconOnly" attribute', () => {
59
- const {
60
- asFragment
61
- } = render( /*#__PURE__*/_jsx(ButtonToTest, {
62
- iconOnly: true,
63
- children: "My button"
64
- }));
65
- expect(asFragment()).toMatchSnapshot();
66
- });
67
- it('should respect the class names entered as a string', () => {
68
- const {
69
- asFragment
70
- } = render( /*#__PURE__*/_jsx(ButtonToTest, {
71
- large: true,
72
- className: "custom-class-1 custom-class-2",
73
- children: "My button"
74
- }));
75
- expect(asFragment()).toMatchSnapshot();
76
- });
77
- it('should add only bpk specific classes if className prop is set to empty string', () => {
78
- const {
79
- asFragment
80
- } = render( /*#__PURE__*/_jsx(ButtonToTest, {
81
- large: true,
82
- className: "",
83
- children: "My button"
84
- }));
85
- expect(asFragment()).toMatchSnapshot();
86
- });
87
- it('should render correctly with "blank" attribute', () => {
88
- const {
89
- asFragment
90
- } = render( /*#__PURE__*/_jsx(ButtonToTest, {
91
- href: "#",
92
- blank: true,
93
- children: "My button"
94
- }));
95
- expect(asFragment()).toMatchSnapshot();
96
- });
97
- it('should render correctly with "rel" attribute', () => {
98
- const {
99
- asFragment
100
- } = render( /*#__PURE__*/_jsx(ButtonToTest, {
101
- href: "#",
102
- rel: "rel-attr",
103
- children: "My button"
104
- }));
105
- expect(asFragment()).toMatchSnapshot();
106
- });
107
- it('should render correctly with "blank" and "rel" attributes', () => {
108
- const {
109
- asFragment
110
- } = render( /*#__PURE__*/_jsx(ButtonToTest, {
111
- href: "#",
112
- blank: true,
113
- rel: "rel-overwrite",
114
- children: "My button"
115
- }));
116
- expect(asFragment()).toMatchSnapshot();
117
- });
118
- it('should render correctly with "disabled" and "href" attributes', () => {
119
- const {
120
- asFragment
121
- } = render( /*#__PURE__*/_jsx(ButtonToTest, {
122
- href: "#",
123
- disabled: true,
124
- children: "My button"
125
- }));
126
- expect(asFragment()).toMatchSnapshot();
127
- });
128
- });
129
- };
130
-
131
- // We export these to reuse them in other tests for buttons.
132
- // eslint-disable-next-line jest/no-export
133
- export default commonButtonTests;
@@ -1,18 +0,0 @@
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
- .bpk-navigation-bar-button-link{color:#161616;color:var(--bpk-navigation-bar-button-link-color, rgb(22, 22, 22))}.bpk-no-touch-support .bpk-navigation-bar-button-link:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-navigation-bar-button-link-hover-color, rgb(22, 22, 22))}:global(.bpk-no-touch-support) .bpk-navigation-bar-button-link:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-navigation-bar-button-link-hover-color, rgb(22, 22, 22))}.bpk-navigation-bar-button-link:active{color:#161616;color:var(--bpk-navigation-bar-button-link-active-color, rgb(22, 22, 22))}.bpk-navigation-bar-button-link:visited{color:#161616;color:var(--bpk-navigation-bar-button-link-visited-color, rgb(22, 22, 22))}.bpk-navigation-bar-button-link--on-dark{color:#fff}.bpk-no-touch-support .bpk-navigation-bar-button-link--on-dark:hover:not(:active):not(:disabled){color:#fff}:global(.bpk-no-touch-support) .bpk-navigation-bar-button-link--on-dark:hover:not(:active):not(:disabled){color:#fff}.bpk-navigation-bar-button-link--on-dark:active{color:#fff}.bpk-navigation-bar-button-link--on-dark:visited{color:#fff}