@skyscanner/backpack-web 33.4.0 → 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 (150) 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-button/index.js +5 -5
  13. package/bpk-component-button/src/BpkButtonDestructive.js +10 -9
  14. package/bpk-component-button/src/BpkButtonFeatured.js +10 -9
  15. package/bpk-component-button/src/BpkButtonLink.js +11 -10
  16. package/bpk-component-button/src/BpkButtonLinkOnDark.js +11 -10
  17. package/bpk-component-button/src/BpkButtonPrimary.js +2 -2
  18. package/bpk-component-button/src/BpkButtonPrimaryOnDark.js +10 -9
  19. package/bpk-component-button/src/BpkButtonPrimaryOnLight.js +10 -9
  20. package/bpk-component-button/src/BpkButtonSecondary.js +10 -10
  21. package/bpk-component-button/src/BpkButtonSecondaryOnDark.js +10 -9
  22. package/bpk-component-calendar/index.js +1 -1
  23. package/bpk-component-calendar/src/BpkCalendarContainer.js +3 -3
  24. package/bpk-component-calendar/src/BpkCalendarGrid.js +2 -2
  25. package/bpk-component-calendar/src/BpkCalendarGrid.module.css +1 -1
  26. package/bpk-component-calendar/src/BpkCalendarGridHeader.js +4 -1
  27. package/bpk-component-calendar/src/BpkCalendarGridTransition.js +5 -2
  28. package/bpk-component-calendar/src/BpkCalendarNav.js +9 -3
  29. package/bpk-component-calendar/src/Week.js +6 -3
  30. package/bpk-component-calendar/src/composeCalendar.js +8 -2
  31. package/bpk-component-calendar/src/date-utils.js +14 -14
  32. package/bpk-component-card/src/BpkDividedCard.js +18 -13
  33. package/bpk-component-card-button/src/BpkSaveButton.js +13 -4
  34. package/bpk-component-chip/index.d.ts +3 -5
  35. package/bpk-component-chip/index.js +3 -2
  36. package/bpk-component-chip/src/BpkDismissibleChip.js +7 -2
  37. package/bpk-component-chip/src/BpkIconChip.d.ts +25 -0
  38. package/bpk-component-chip/src/BpkIconChip.js +31 -0
  39. package/bpk-component-chip/src/BpkSelectableChip.d.ts +0 -2
  40. package/bpk-component-chip/src/BpkSelectableChip.js +3 -3
  41. package/bpk-component-chip/src/BpkSelectableChip.module.css +1 -1
  42. package/bpk-component-chip/src/commonTypes.d.ts +1 -1
  43. package/bpk-component-chip/src/commonTypes.js +1 -24
  44. package/bpk-component-content-cards/src/BpkContentCard.js +8 -2
  45. package/bpk-component-datatable/src/BpkDataTable.js +1 -1
  46. package/bpk-component-datatable/src/BpkDataTableHeader.js +12 -8
  47. package/bpk-component-datatable/src/BpkDataTableHeader.module.css +1 -1
  48. package/bpk-component-datepicker/src/BpkDatepicker.js +2 -2
  49. package/bpk-component-description-list/index.js +1 -1
  50. package/bpk-component-description-list/src/ComponentFactory.js +10 -5
  51. package/bpk-component-dialog/src/BpkDialog.js +6 -4
  52. package/bpk-component-dialog/src/BpkDialog.module.css +1 -1
  53. package/bpk-component-dialog/src/BpkDialogInner.js +6 -3
  54. package/bpk-component-drawer/src/BpkDrawer.js +1 -4
  55. package/bpk-component-drawer/src/BpkDrawerContent.js +7 -5
  56. package/bpk-component-fieldset/src/BpkFieldset.js +9 -7
  57. package/bpk-component-flare/index.js +2 -2
  58. package/bpk-component-flare/src/BpkContentBubble.js +4 -1
  59. package/bpk-component-flare/src/BpkFlareBar.js +13 -4
  60. package/bpk-component-flare/src/__generated__/corner-radius.d.ts +6 -0
  61. package/bpk-component-flare/src/__generated__/pointer.d.ts +6 -0
  62. package/bpk-component-floating-notification/src/BpkFloatingNotification.js +8 -2
  63. package/bpk-component-form-validation/src/BpkFormValidation.js +5 -4
  64. package/bpk-component-graphic-promotion/src/BpkGraphicPromo.js +9 -11
  65. package/bpk-component-graphic-promotion/src/BpkGraphicPromo.module.css +1 -1
  66. package/bpk-component-grid-toggle/src/BpkGridToggle.js +8 -6
  67. package/bpk-component-horizontal-nav/src/BpkHorizontalNav.js +16 -14
  68. package/bpk-component-horizontal-nav/src/BpkHorizontalNav.module.css +1 -1
  69. package/bpk-component-horizontal-nav/src/BpkHorizontalNavItem.js +2 -2
  70. package/bpk-component-icon/index.js +1 -1
  71. package/bpk-component-icon/src/classNameModifierHOCFactory.js +3 -0
  72. package/bpk-component-image/index.js +2 -2
  73. package/bpk-component-image/src/BpkBackgroundImage.js +2 -1
  74. package/bpk-component-image/src/BpkImage.js +2 -1
  75. package/bpk-component-infinite-scroll/src/withInfiniteScroll.js +3 -3
  76. package/bpk-component-info-banner/src/AnimateAndFade.js +33 -31
  77. package/bpk-component-info-banner/src/BpkInfoBanner.module.css +1 -1
  78. package/bpk-component-info-banner/src/BpkInfoBannerInner.js +16 -12
  79. package/bpk-component-input/index.js +1 -1
  80. package/bpk-component-input/src/BpkClearButton.js +3 -1
  81. package/bpk-component-input/src/BpkInput.js +4 -1
  82. package/bpk-component-input/src/withOpenEvents.js +4 -1
  83. package/bpk-component-link/index.js +2 -2
  84. package/bpk-component-list/src/BpkList.js +4 -1
  85. package/bpk-component-loading-button/src/BpkLoadingButton.js +6 -3
  86. package/bpk-component-map/index.js +4 -4
  87. package/bpk-component-map/src/BpkIconMarker.js +1 -1
  88. package/bpk-component-map/src/BpkMap.js +2 -2
  89. package/bpk-component-map/src/BpkPriceMarker.js +7 -5
  90. package/bpk-component-map/src/BpkPriceMarkerV2/BpkPriceMarker.js +1 -1
  91. package/bpk-component-mobile-scroll-container/src/BpkMobileScrollContainer.js +4 -1
  92. package/bpk-component-modal/index.js +4 -3
  93. package/bpk-component-modal/src/BpkModal.d.ts +2 -1
  94. package/bpk-component-modal/src/BpkModal.js +8 -3
  95. package/bpk-component-modal/src/BpkModalInner.d.ts +2 -0
  96. package/bpk-component-modal/src/BpkModalInner.js +24 -8
  97. package/bpk-component-modal/src/BpkModalInner.module.css +1 -1
  98. package/bpk-component-modal/src/BpkModalV2/BpKModal.module.css +1 -1
  99. package/bpk-component-modal/src/BpkModalV2/BpkModal.d.ts +2 -0
  100. package/bpk-component-modal/src/BpkModalV2/BpkModal.js +19 -8
  101. package/bpk-component-navigation-bar/index.js +1 -1
  102. package/bpk-component-navigation-bar/src/BpkNavigationBar.js +7 -5
  103. package/bpk-component-navigation-bar/src/BpkNavigationBarButtonLink.js +4 -1
  104. package/bpk-component-navigation-bar/src/BpkNavigationBarIconButton.js +4 -1
  105. package/bpk-component-nudger/index.js +1 -1
  106. package/bpk-component-nudger/src/BpkConfigurableNudger.js +16 -4
  107. package/bpk-component-nudger/src/BpkNudger.js +16 -5
  108. package/bpk-component-page-indicator/src/BpkPageIndicator.module.css +1 -1
  109. package/bpk-component-page-indicator/src/NavButton.js +1 -1
  110. package/bpk-component-pagination/src/BpkPaginationList.js +1 -1
  111. package/bpk-component-pagination/src/BpkPaginationNudger.js +13 -4
  112. package/bpk-component-pagination/src/BpkPaginationPage.js +4 -1
  113. package/bpk-component-phone-input/src/BpkPhoneInput.js +15 -4
  114. package/bpk-component-popover/src/BpkPopover.js +105 -61
  115. package/bpk-component-popover/src/BpkPopoverPortal.js +121 -115
  116. package/bpk-component-popover/src/keyboardFocusScope.js +1 -1
  117. package/bpk-component-price/src/BpkPrice.js +17 -5
  118. package/bpk-component-rating/src/BpkRating.js +17 -5
  119. package/bpk-component-rtl-toggle/src/BpkRtlToggle.js +4 -1
  120. package/bpk-component-scrollable-calendar/src/BpkScrollableCalendarGrid.js +6 -3
  121. package/bpk-component-scrollable-calendar/src/BpkScrollableCalendarGridList.js +6 -3
  122. package/bpk-component-section-header/src/BpkSectionHeader.js +9 -3
  123. package/bpk-component-section-list/index.js +1 -1
  124. package/bpk-component-section-list/src/BpkSectionListItem.js +10 -4
  125. package/bpk-component-section-list/src/BpkSectionListSection.js +1 -1
  126. package/bpk-component-slider/src/BpkSlider.js +4 -1
  127. package/bpk-component-spinner/index.js +3 -3
  128. package/bpk-component-spinner/src/BpkExtraLargeSpinner.js +7 -4
  129. package/bpk-component-spinner/src/BpkLargeSpinner.js +7 -4
  130. package/bpk-component-spinner/src/BpkSpinner.js +7 -4
  131. package/bpk-component-split-input/src/BpkInputField.js +2 -2
  132. package/bpk-component-split-input/src/BpkSplitInput.js +3 -3
  133. package/bpk-component-star-rating/index.js +4 -4
  134. package/bpk-component-star-rating/src/BpkInteractiveStar.js +6 -2
  135. package/bpk-component-star-rating/src/BpkInteractiveStarRating.js +1 -1
  136. package/bpk-component-star-rating/src/BpkStar.js +22 -15
  137. package/bpk-component-swap-button/src/BpkSwapButton.js +2 -1
  138. package/bpk-component-table/index.js +2 -2
  139. package/bpk-component-text/src/BpkText.js +10 -5
  140. package/bpk-component-theme-toggle/src/BpkThemeToggle.js +4 -1
  141. package/bpk-component-theme-toggle/src/updateOnThemeChange.js +1 -1
  142. package/bpk-component-tooltip/src/BpkTooltipPortal.js +4 -1
  143. package/bpk-mixins/_chips.scss +9 -0
  144. package/bpk-react-utils/index.js +3 -3
  145. package/bpk-react-utils/src/withDefaultProps.js +4 -1
  146. package/bpk-scrim-utils/src/withScrimmedPortal.js +1 -1
  147. package/bpk-theming/src/BpkThemeProvider.js +1 -1
  148. package/package.json +5 -3
  149. package/unstable__bpk-mixins/_chips.scss +9 -0
  150. package/bpk-component-button/src/commonButtonTests.js +0 -133
@@ -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 { defaultProps, propTypes } from "./common-types";
18
- import BpkButtonBase, { cssModules } from "./BpkButtonBase";
17
+ */import BpkButtonBase, { cssModules } from "./BpkButtonBase";
18
+ import { defaultProps, propTypes } from "./common-types";
19
19
  import STYLES from "./BpkButtonSecondaryOnDark.module.css";
20
20
  import { jsx as _jsx } from "react/jsx-runtime";
21
21
  const getClassName = cssModules(STYLES);
@@ -29,14 +29,15 @@ const BpkButtonSecondaryOnDark = props => {
29
29
  classNames.push(className);
30
30
  }
31
31
  const classNamesFinal = classNames.join(' ');
32
- return (
33
- /*#__PURE__*/
32
+ return /*#__PURE__*/_jsx(BpkButtonBase
33
+ // TODO: className to be removed
34
+ // eslint-disable-next-line @skyscanner/rules/forbid-component-props
35
+ , {
36
+ className: classNamesFinal
34
37
  // $FlowFixMe[cannot-spread-inexact] - inexact rest. See 'decisions/flowfixme.md'.
35
- _jsx(BpkButtonBase, {
36
- className: classNamesFinal,
37
- ...rest
38
- })
39
- );
38
+ ,
39
+ ...rest
40
+ });
40
41
  };
41
42
  BpkButtonSecondaryOnDark.propTypes = {
42
43
  ...propTypes
@@ -17,10 +17,10 @@
17
17
  */
18
18
 
19
19
  import BpkCalendarContainer, { withCalendarState } from "./src/BpkCalendarContainer";
20
+ import BpkCalendarDate, { ROW_TYPES, SELECTION_TYPES } from "./src/BpkCalendarDate";
20
21
  import BpkCalendarGrid, { BpkCalendarGridWithTransition } from "./src/BpkCalendarGrid";
21
22
  import BpkCalendarGridHeader from "./src/BpkCalendarGridHeader";
22
23
  import BpkCalendarNav from "./src/BpkCalendarNav";
23
- import BpkCalendarDate, { ROW_TYPES, SELECTION_TYPES } from "./src/BpkCalendarDate";
24
24
  import composeCalendar from "./src/composeCalendar";
25
25
  import { CALENDAR_SELECTION_TYPE } from "./src/custom-proptypes";
26
26
  import CustomPropTypes, { BpkCalendarGridPropTypes, BpkCalendarDatePropTypes // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
@@ -18,12 +18,12 @@
18
18
 
19
19
  import { Component } from 'react';
20
20
  import { isRTL } from "../../bpk-react-utils";
21
- import { CALENDAR_SELECTION_TYPE } from "./custom-proptypes";
22
- import BpkCalendarNav from "./BpkCalendarNav";
21
+ import BpkCalendarDate from "./BpkCalendarDate";
23
22
  import { BpkCalendarGridWithTransition } from "./BpkCalendarGrid";
24
23
  import BpkCalendarGridHeader from "./BpkCalendarGridHeader";
25
- import BpkCalendarDate from "./BpkCalendarDate";
24
+ import BpkCalendarNav from "./BpkCalendarNav";
26
25
  import composeCalendar from "./composeCalendar";
26
+ import { CALENDAR_SELECTION_TYPE } from "./custom-proptypes";
27
27
  import { addDays, addMonths, dateToBoundaries, isAfter, isSameMonth, isSameDay, lastDayOfMonth, setMonthYear, startOfDay, startOfMonth } from "./date-utils";
28
28
  import { jsx as _jsx } from "react/jsx-runtime";
29
29
  /**
@@ -18,10 +18,10 @@
18
18
 
19
19
  import { Component } from 'react';
20
20
  import { cssModules, isDeviceIos } from "../../bpk-react-utils";
21
+ import { addCalendarGridTransition } from "./BpkCalendarGridTransition";
21
22
  import Week from "./Week";
22
- import { addMonths, formatIsoDate, getCalendarMonthWeeks, isSameMonth } from "./date-utils";
23
23
  import { CALENDAR_SELECTION_TYPE } from "./custom-proptypes";
24
- import { addCalendarGridTransition } from "./BpkCalendarGridTransition";
24
+ import { addMonths, formatIsoDate, getCalendarMonthWeeks, isSameMonth } from "./date-utils";
25
25
  import STYLES from "./BpkCalendarGrid.module.css";
26
26
 
27
27
  // This should be imported after `./BpkCalendarGrid.module.css`.
@@ -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-calendar-grid{width:100%;border-collapse:separate;border-spacing:0}.bpk-calendar-grid--animating{z-index:1;transition:transform .2s ease-in-out}.bpk-calendar-grid__caption{position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0 0 0 0)}.bpk-calendar-grid__date{width:100%;text-align:center}.bpk-calendar-grid__date--start{background-image:linear-gradient(to right, rgb(255, 255, 255) 50%, rgb(227, 240, 255) 50%)}html[dir=rtl] .bpk-calendar-grid__date--start{background-image:linear-gradient(to left, rgb(255, 255, 255) 50%, rgb(227, 240, 255) 50%)}.bpk-calendar-grid__date--middle{background-color:#e3f0ff}.bpk-calendar-grid__date--end{background-image:linear-gradient(to left, rgb(255, 255, 255) 50%, rgb(227, 240, 255) 50%)}html[dir=rtl] .bpk-calendar-grid__date--end{background-image:linear-gradient(to right, rgb(255, 255, 255) 50%, rgb(227, 240, 255) 50%)}.bpk-calendar-grid__week{display:flex;padding-top:1.5rem}
18
+ .bpk-calendar-grid{border-collapse:separate;border-spacing:0}.bpk-calendar-grid--animating{z-index:1;transition:transform .2s ease-in-out}.bpk-calendar-grid__caption{position:absolute;width:1px;height:1px;margin:-1px;padding:0;border:0;overflow:hidden;clip:rect(0 0 0 0)}.bpk-calendar-grid__date{width:100%;text-align:center}.bpk-calendar-grid__date--start{background-image:linear-gradient(to right, rgb(255, 255, 255) 50%, rgb(227, 240, 255) 50%)}html[dir=rtl] .bpk-calendar-grid__date--start{background-image:linear-gradient(to left, rgb(255, 255, 255) 50%, rgb(227, 240, 255) 50%)}.bpk-calendar-grid__date--middle{background-color:#e3f0ff}.bpk-calendar-grid__date--end{background-image:linear-gradient(to left, rgb(255, 255, 255) 50%, rgb(227, 240, 255) 50%)}html[dir=rtl] .bpk-calendar-grid__date--end{background-image:linear-gradient(to right, rgb(255, 255, 255) 50%, rgb(227, 240, 255) 50%)}.bpk-calendar-grid__week{display:flex;padding-top:1.5rem}
@@ -29,7 +29,10 @@ const WeekDayComponent = ({
29
29
  Element,
30
30
  weekDay,
31
31
  weekDayKey = 'nameAbbr'
32
- }) => /*#__PURE__*/_jsx(Element, {
32
+ }) => /*#__PURE__*/_jsx(Element
33
+ // TODO: className to be removed
34
+ // eslint-disable-next-line @skyscanner/rules/forbid-component-props
35
+ , {
33
36
  className: getClassName('bpk-calendar-header__weekday'),
34
37
  title: weekDay.name,
35
38
  children: /*#__PURE__*/_jsx("span", {
@@ -18,8 +18,8 @@
18
18
 
19
19
  import { Component, createElement as _createElement } from 'react';
20
20
  import { cssModules, isRTL } from "../../bpk-react-utils";
21
- import { getCalendarGridWidth, getTransformStyles, isTransitionEndSupported } from "./utils";
22
21
  import { addMonths, isSameMonth, formatIsoMonth, differenceInCalendarMonths, dateToBoundaries, startOfDay, setMonthYear, isWithinRange, getMonthRange } from "./date-utils";
22
+ import { getCalendarGridWidth, getTransformStyles, isTransitionEndSupported } from "./utils";
23
23
  import STYLES from "./BpkCalendarGridTransition.module.css";
24
24
  import { jsx as _jsx } from "react/jsx-runtime";
25
25
  const getClassName = cssModules(STYLES);
@@ -141,7 +141,10 @@ class BpkCalendarGridTransition extends Component {
141
141
  preventKeyboardFocus: index !== 1 || rest.preventKeyboardFocus,
142
142
  isKeyboardFocusable: !isTransitioning && index === 1,
143
143
  focusedDate: index === 1 ? focusedDate : getFocusedDateForMonth(m, focusedDate, rest.minDate, rest.maxDate),
144
- "aria-hidden": index !== 1,
144
+ "aria-hidden": index !== 1
145
+ // TODO: className to be removed
146
+ // eslint-disable-next-line @skyscanner/rules/forbid-component-props
147
+ ,
145
148
  className: getClassName('bpk-calendar-grid-transition__grid')
146
149
  }) : /*#__PURE__*/_jsx("div", {
147
150
  className: getClassName('bpk-calendar-grid-transition__dummy')
@@ -16,6 +16,7 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
+ import BpkAriaLive from "../../bpk-component-aria-live";
19
20
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
20
21
  import ArrowLeftIcon from "../../bpk-component-icon/lg/arrow-left";
21
22
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
@@ -23,7 +24,6 @@ import ArrowRightIcon from "../../bpk-component-icon/lg/arrow-right";
23
24
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
24
25
  import BpkSelect from "../../bpk-component-select";
25
26
  import { cssModules } from "../../bpk-react-utils";
26
- import BpkAriaLive from "../../bpk-component-aria-live";
27
27
  import { addMonths, formatIsoMonth, getMonthRange, getMonthsInRange, isWithinRange, parseIsoDate, startOfMonth } from "./date-utils";
28
28
  import STYLES from "./BpkCalendarNav.module.css";
29
29
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -91,7 +91,10 @@ const BpkCalendarNav = ({
91
91
  start: min,
92
92
  end: max
93
93
  }),
94
- children: [/*#__PURE__*/_jsx(ArrowLeftIcon, {
94
+ children: [/*#__PURE__*/_jsx(ArrowLeftIcon
95
+ // TODO: className to be removed
96
+ // eslint-disable-next-line @skyscanner/rules/forbid-component-props
97
+ , {
95
98
  className: getClassName('bpk-calendar-nav__icon')
96
99
  }), /*#__PURE__*/_jsx("span", {
97
100
  className: getClassName('bpk-calendar-nav__text--hidden'),
@@ -138,7 +141,10 @@ const BpkCalendarNav = ({
138
141
  start: min,
139
142
  end: max
140
143
  }),
141
- children: [/*#__PURE__*/_jsx(ArrowRightIcon, {
144
+ children: [/*#__PURE__*/_jsx(ArrowRightIcon
145
+ // TODO: className to be removed
146
+ // eslint-disable-next-line @skyscanner/rules/forbid-component-props
147
+ , {
142
148
  className: getClassName('bpk-calendar-nav__icon')
143
149
  }), /*#__PURE__*/_jsx("span", {
144
150
  className: getClassName('bpk-calendar-nav__text--hidden'),
@@ -18,9 +18,9 @@
18
18
 
19
19
  import { Component } from 'react';
20
20
  import { cssModules } from "../../bpk-react-utils";
21
- import { isSameDay, isSameWeek, isSameMonth, isToday, isWithinRange, startOfMonth, endOfMonth } from "./date-utils";
22
- import { CALENDAR_SELECTION_TYPE } from "./custom-proptypes";
23
21
  import { SELECTION_TYPES } from "./BpkCalendarDate";
22
+ import { CALENDAR_SELECTION_TYPE } from "./custom-proptypes";
23
+ import { isSameDay, isSameWeek, isSameMonth, isToday, isWithinRange, startOfMonth, endOfMonth } from "./date-utils";
24
24
  // TODO: Move this to `Week.scss`
25
25
  // This should be using its own css file as `BpkCalendarGrid` is also importing `BpkCalendarGrid.module.css`
26
26
  // and the order of css imports can break the component.
@@ -278,7 +278,10 @@ class Week extends Component {
278
278
  end: maxDate
279
279
  }) : false;
280
280
  const dateSelectionType = getSelectionType(date, selectionConfiguration, formatDateFull, month, weekStartsOn, ignoreOutsideDate);
281
- return /*#__PURE__*/_jsx(DateContainer, {
281
+ return /*#__PURE__*/_jsx(DateContainer
282
+ // TODO: className to be removed
283
+ // eslint-disable-next-line @skyscanner/rules/forbid-component-props
284
+ , {
282
285
  className: cellClassName,
283
286
  isEmptyCell: !isSameMonth(date, month) && ignoreOutsideDate,
284
287
  isBlocked: isBlocked,
@@ -94,7 +94,10 @@ const composeCalendar = (Nav, GridHeader, Grid, CalendarDate) => {
94
94
  }), GridHeader && /*#__PURE__*/_jsx(GridHeader, {
95
95
  daysOfWeek: daysOfWeek,
96
96
  weekStartsOn: weekStartsOn,
97
- weekDayKey: weekDayKey,
97
+ weekDayKey: weekDayKey
98
+ // TODO: className to be removed
99
+ // eslint-disable-next-line @skyscanner/rules/forbid-component-props
100
+ ,
98
101
  className: headerClasses.join(' '),
99
102
  ...headerProps
100
103
  }), /*#__PURE__*/_jsx(Grid, {
@@ -112,7 +115,10 @@ const composeCalendar = (Nav, GridHeader, Grid, CalendarDate) => {
112
115
  minDate: minDate,
113
116
  focusedDate: focusedDate,
114
117
  markToday: markToday,
115
- markOutsideDays: markOutsideDays,
118
+ markOutsideDays: markOutsideDays
119
+ // TODO: className to be removed
120
+ // eslint-disable-next-line @skyscanner/rules/forbid-component-props
121
+ ,
116
122
  className: gridClasses.join(' '),
117
123
  dateProps: dateProps,
118
124
  selectionConfiguration: selectionConfiguration,
@@ -16,27 +16,27 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- import { startOfMonth } from 'date-fns/startOfMonth';
19
+ import { addDays } from 'date-fns/addDays';
20
+ import { addMonths } from 'date-fns/addMonths';
21
+ import { differenceInCalendarMonths } from 'date-fns/differenceInCalendarMonths';
20
22
  import { endOfMonth } from 'date-fns/endOfMonth';
21
- import { lastDayOfMonth } from 'date-fns/lastDayOfMonth';
23
+ import { format } from 'date-fns/format';
22
24
  import { getDay } from 'date-fns/getDay';
23
- import { isWithinInterval as isWithinRange } from 'date-fns/isWithinInterval';
24
- import { isToday } from 'date-fns/isToday';
25
- import { isSaturday } from 'date-fns/isSaturday';
26
- import { isSunday } from 'date-fns/isSunday';
25
+ import { isAfter } from 'date-fns/isAfter';
26
+ import { isBefore } from 'date-fns/isBefore';
27
27
  import { isSameDay } from 'date-fns/isSameDay';
28
- import { isSameWeek } from 'date-fns/isSameWeek';
29
28
  import { isSameMonth } from 'date-fns/isSameMonth';
30
- import { isBefore } from 'date-fns/isBefore';
31
- import { isAfter } from 'date-fns/isAfter';
32
- import { differenceInCalendarMonths } from 'date-fns/differenceInCalendarMonths';
33
- import { addDays } from 'date-fns/addDays';
34
- import { addMonths } from 'date-fns/addMonths';
29
+ import { isSameWeek } from 'date-fns/isSameWeek';
30
+ import { isSaturday } from 'date-fns/isSaturday';
31
+ import { isSunday } from 'date-fns/isSunday';
32
+ import { isToday } from 'date-fns/isToday';
33
+ import { isWithinInterval as isWithinRange } from 'date-fns/isWithinInterval';
34
+ import { lastDayOfMonth } from 'date-fns/lastDayOfMonth';
35
+ import { parseISO } from 'date-fns/parseISO';
35
36
  import { setMonth } from 'date-fns/setMonth';
36
37
  import { setYear } from 'date-fns/setYear';
37
38
  import { startOfDay } from 'date-fns/startOfDay';
38
- import { parseISO } from 'date-fns/parseISO';
39
- import { format } from 'date-fns/format';
39
+ import { startOfMonth } from 'date-fns/startOfMonth';
40
40
  const ONE_MINUTE_IN_MS = 60 * 1000;
41
41
  const ONE_HOUR_IN_MS = 60 * ONE_MINUTE_IN_MS;
42
42
 
@@ -36,18 +36,23 @@ const BpkDividedCard = ({
36
36
  }) => {
37
37
  const isVertical = orientation === ORIENTATION.vertical;
38
38
  const classNames = getClassName('bpk-divided-card', isVertical ? 'bpk-divided-card--vertical' : 'bpk-divided-card--horizontal', !isElevated && 'bpk-divided-card--no-elevation', className);
39
- return /*#__PURE__*/_jsxs(BpkCard, {
40
- className: classNames,
41
- href: href,
42
- padded: false,
43
- ...rest,
44
- children: [/*#__PURE__*/_jsx("div", {
45
- className: getClassName(!isVertical && 'bpk-divided-card__primary--horizontal'),
46
- children: primaryContent
47
- }), /*#__PURE__*/_jsx("div", {
48
- className: getClassName(isVertical ? 'bpk-divided-card__secondary--vertical' : 'bpk-divided-card__secondary--horizontal'),
49
- children: secondaryContent
50
- })]
51
- });
39
+ return (
40
+ /*#__PURE__*/
41
+ // TODO: className to be removed
42
+ // eslint-disable-next-line @skyscanner/rules/forbid-component-props
43
+ _jsxs(BpkCard, {
44
+ className: classNames,
45
+ href: href,
46
+ padded: false,
47
+ ...rest,
48
+ children: [/*#__PURE__*/_jsx("div", {
49
+ className: getClassName(!isVertical && 'bpk-divided-card__primary--horizontal'),
50
+ children: primaryContent
51
+ }), /*#__PURE__*/_jsx("div", {
52
+ className: getClassName(isVertical ? 'bpk-divided-card__secondary--vertical' : 'bpk-divided-card__secondary--horizontal'),
53
+ children: secondaryContent
54
+ })]
55
+ })
56
+ );
52
57
  };
53
58
  export default BpkDividedCard;
@@ -18,6 +18,7 @@
18
18
 
19
19
  import { useState } from 'react';
20
20
  import { BpkButtonV2 } from "../../bpk-component-button";
21
+ import { withLargeButtonAlignment } from "../../bpk-component-icon";
21
22
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
22
23
  import BpkHeartIcon from "../../bpk-component-icon/lg/heart";
23
24
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
@@ -26,7 +27,6 @@ import BpkHeartOutlineIcon from "../../bpk-component-icon/lg/heart--outline";
26
27
  import BpkHeartIconSm from "../../bpk-component-icon/sm/heart";
27
28
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
28
29
  import BpkHeartOutlineIconSm from "../../bpk-component-icon/sm/heart--outline";
29
- import { withLargeButtonAlignment } from "../../bpk-component-icon";
30
30
  import { cssModules } from "../../bpk-react-utils";
31
31
  import STYLES from "./BpkSaveButton.module.css";
32
32
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -56,7 +56,10 @@ const BpkSaveButton = ({
56
56
  const HeartIcon = smallSize ? AlignedHeartIconSm : AlignedHeartIcon;
57
57
  const HeartOutLineIcon = smallSize ? AlignedHeartOutlineIconSm : AlignedHeartOutlineIcon;
58
58
  return /*#__PURE__*/_jsxs(BpkButtonV2, {
59
- "aria-label": accessibilityLabel,
59
+ "aria-label": accessibilityLabel
60
+ // TODO: className to be removed
61
+ // eslint-disable-next-line @skyscanner/rules/forbid-component-props
62
+ ,
60
63
  className: getClassName('bpk-save-button', smallSize && 'bpk-save-button__small', `bpk-save-button__${style}`),
61
64
  onClick: e => {
62
65
  onCheckedChange(e);
@@ -65,9 +68,15 @@ const BpkSaveButton = ({
65
68
  }
66
69
  },
67
70
  iconOnly: true,
68
- children: [/*#__PURE__*/_jsx(HeartIcon, {
71
+ children: [/*#__PURE__*/_jsx(HeartIcon
72
+ // TODO: className to be removed
73
+ // eslint-disable-next-line @skyscanner/rules/forbid-component-props
74
+ , {
69
75
  className: getClassName('bpk-save-button__icon', 'bpk-save-button__heartIcon', toggle && checked && 'bpk-save-button__heartIcon--toggle', `bpk-save-button__heartIcon--${checked ? 'show' : 'hide'}`, `bpk-save-button__heartIcon--${style}`)
70
- }), /*#__PURE__*/_jsx(HeartOutLineIcon, {
76
+ }), /*#__PURE__*/_jsx(HeartOutLineIcon
77
+ // TODO: className to be removed
78
+ // eslint-disable-next-line @skyscanner/rules/forbid-component-props
79
+ , {
71
80
  className: getClassName('bpk-save-button__icon', 'bpk-save-button__heartOutlineIcon', `bpk-save-button__heartOutlineIcon--${checked ? 'hide' : 'show'}`, `bpk-save-button__heartOutlineIcon--${style}`)
72
81
  })]
73
82
  });
@@ -16,17 +16,15 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- import BpkSelectableChip, {
20
- type Props as SelectableProps,
21
- } from './src/BpkSelectableChip';
19
+ import BpkSelectableChip, { type Props as SelectableProps } from './src/BpkSelectableChip';
22
20
  import BpkDismissibleChip from './src/BpkDismissibleChip';
23
21
  import BpkDropdownChip from './src/BpkDropdownChip';
22
+ import BpkIconChip from './src/BpkIconChip';
24
23
  import type { CommonProps } from './src/commonTypes';
25
24
  import { CHIP_TYPES } from './src/commonTypes';
26
25
  import themeAttributes from './src/themeAttributes';
27
-
28
26
  export type BpkSelectableChipProps = SelectableProps;
29
27
  export type BpkDismissibleChipProps = CommonProps;
30
28
  export type BpkDropdownChipProps = CommonProps;
31
29
  export default BpkSelectableChip;
32
- export { BpkDismissibleChip, BpkDropdownChip, CHIP_TYPES, themeAttributes };
30
+ export { BpkDismissibleChip, BpkDropdownChip, BpkIconChip, CHIP_TYPES, themeAttributes };
@@ -16,10 +16,11 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- import BpkSelectableChip from "./src/BpkSelectableChip";
20
19
  import BpkDismissibleChip from "./src/BpkDismissibleChip";
21
20
  import BpkDropdownChip from "./src/BpkDropdownChip";
21
+ import BpkIconChip from "./src/BpkIconChip";
22
+ import BpkSelectableChip from "./src/BpkSelectableChip";
22
23
  import { CHIP_TYPES } from "./src/commonTypes";
23
24
  import themeAttributes from "./src/themeAttributes";
24
25
  export default BpkSelectableChip;
25
- export { BpkDismissibleChip, BpkDropdownChip, CHIP_TYPES, themeAttributes };
26
+ export { BpkDismissibleChip, BpkDropdownChip, BpkIconChip, CHIP_TYPES, themeAttributes };
@@ -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,8 +16,8 @@
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";
20
+ import { cssModules } from "../../bpk-react-utils";
21
21
  import { CHIP_TYPES } from "./commonTypes";
22
22
  import STYLES from "./BpkSelectableChip.module.css";
23
23
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
@@ -34,7 +34,7 @@ const BpkSelectableChip = ({
34
34
  type = CHIP_TYPES.default,
35
35
  ...rest
36
36
  }) => {
37
- 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);
38
38
  return /*#__PURE__*/_jsxs("button", {
39
39
  "aria-checked": role === 'button' || role === 'tab' ? undefined : selected,
40
40
  className: classNames,
@@ -44,7 +44,7 @@ const BpkSelectableChip = ({
44
44
  type: "button",
45
45
  ...rest,
46
46
  children: [leadingAccessoryView && /*#__PURE__*/_jsx("span", {
47
- className: getClassName('bpk-chip__leading-accessory-view'),
47
+ className: getClassName('bpk-chip__leading-accessory-view', !children && 'bpk-chip--icon-only__leading-accessory-view'),
48
48
  children: leadingAccessoryView
49
49
  }), /*#__PURE__*/_jsx(BpkText, {
50
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
@@ -40,11 +40,17 @@ const BpkContentCard = ({
40
40
  loading: "lazy"
41
41
  })
42
42
  }), /*#__PURE__*/_jsxs("div", {
43
- 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
+ , {
44
47
  className: getClassName('bpk-content-card--headline'),
45
48
  tagName: "h3",
46
49
  children: card.headline
47
- }), /*#__PURE__*/_jsx(BpkText, {
50
+ }), /*#__PURE__*/_jsx(BpkText
51
+ // TODO: className to be removed.
52
+ // eslint-disable-next-line @skyscanner/rules/forbid-component-props
53
+ , {
48
54
  className: getClassName('bpk-content-card--description'),
49
55
  tagName: "p",
50
56
  children: card.description
@@ -21,8 +21,8 @@ import { useMemo, useState } from 'react';
21
21
  // @ts-expect-error Untyped import. See `decisions/imports-ts-suppressions.md`.
22
22
  import { useTable, useSortBy } from 'react-table';
23
23
  import { cssModules } from "../../bpk-react-utils";
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
27
  import STYLES from "./BpkDataTable.module.css";
28
28
  import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";