@skyscanner/backpack-web 31.10.1 → 32.0.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 (183) hide show
  1. package/bpk-component-accordion/src/BpkAccordion.module.css +2 -2
  2. package/bpk-component-accordion/src/BpkAccordionItem.module.css +2 -2
  3. package/bpk-component-aria-live/src/BpkAriaLive.module.css +2 -2
  4. package/bpk-component-autosuggest/src/BpkAutosuggest.module.css +2 -2
  5. package/bpk-component-badge/index.js +1 -3
  6. package/bpk-component-badge/src/BpkBadge.module.css +2 -2
  7. package/bpk-component-banner-alert/src/BpkAnimateAndFade.module.css +2 -2
  8. package/bpk-component-banner-alert/src/BpkBannerAlert.module.css +2 -2
  9. package/bpk-component-barchart/src/BpkBarchart.module.css +2 -2
  10. package/bpk-component-barchart/src/BpkBarchartBar.module.css +2 -2
  11. package/bpk-component-barchart/src/BpkChartAxis.module.css +2 -2
  12. package/bpk-component-barchart/src/BpkChartDataTable.module.css +2 -2
  13. package/bpk-component-barchart/src/BpkChartGridLines.module.css +2 -2
  14. package/bpk-component-blockquote/src/BpkBlockquote.module.css +2 -2
  15. package/bpk-component-boilerplate/src/BpkBoilerplate.module.css +2 -2
  16. package/bpk-component-bottom-sheet/src/BpkBottomSheet.module.css +2 -2
  17. package/bpk-component-bottom-sheet/src/BpkBottomSheetInner.module.css +2 -2
  18. package/bpk-component-breadcrumb/src/BpkBreadcrumb.module.css +2 -2
  19. package/bpk-component-breadcrumb/src/BpkBreadcrumbItem.module.css +2 -2
  20. package/bpk-component-button/src/BpkButtonBase.module.css +2 -2
  21. package/bpk-component-button/src/BpkButtonDestructive.module.css +2 -2
  22. package/bpk-component-button/src/BpkButtonFeatured.module.css +2 -2
  23. package/bpk-component-button/src/BpkButtonLink.module.css +2 -2
  24. package/bpk-component-button/src/BpkButtonLinkOnDark.module.css +2 -2
  25. package/bpk-component-button/src/BpkButtonPrimaryOnDark.module.css +2 -2
  26. package/bpk-component-button/src/BpkButtonPrimaryOnLight.module.css +2 -2
  27. package/bpk-component-button/src/BpkButtonSecondary.module.css +2 -2
  28. package/bpk-component-button/src/BpkButtonSecondaryOnDark.module.css +2 -2
  29. package/bpk-component-button/src/BpkButtonV2/BpkButton.module.css +2 -2
  30. package/bpk-component-calendar/src/BpkCalendar.module.css +2 -2
  31. package/bpk-component-calendar/src/BpkCalendarDate.module.css +2 -2
  32. package/bpk-component-calendar/src/BpkCalendarGrid.module.css +2 -2
  33. package/bpk-component-calendar/src/BpkCalendarGridHeader.module.css +2 -2
  34. package/bpk-component-calendar/src/BpkCalendarGridTransition.module.css +2 -2
  35. package/bpk-component-calendar/src/BpkCalendarNav.module.css +2 -2
  36. package/bpk-component-card/src/BpkCard.module.css +2 -2
  37. package/bpk-component-card/src/BpkCardWrapper.module.css +2 -2
  38. package/bpk-component-card/src/BpkDividedCard.module.css +2 -2
  39. package/bpk-component-card-button/src/BpkSaveButton.module.css +2 -2
  40. package/bpk-component-checkbox/src/BpkCheckbox.module.css +2 -2
  41. package/bpk-component-chip/src/BpkSelectableChip.module.css +2 -2
  42. package/bpk-component-close-button/src/BpkCloseButton.module.css +2 -2
  43. package/bpk-component-code/src/BpkCode.module.css +2 -2
  44. package/bpk-component-code/src/BpkCodeBlock.module.css +2 -2
  45. package/bpk-component-content-cards/src/BpkContentCard.module.css +2 -2
  46. package/bpk-component-content-cards/src/BpkContentCards.module.css +2 -2
  47. package/bpk-component-datatable/index.js +3 -2
  48. package/bpk-component-datatable/src/BpkDataTable.js +38 -103
  49. package/bpk-component-datatable/src/BpkDataTable.module.css +2 -2
  50. package/bpk-component-datatable/src/BpkDataTableHeader.js +22 -2
  51. package/bpk-component-datatable/src/BpkDataTableHeader.module.css +2 -2
  52. package/bpk-component-datatable/src/common-types.js +22 -0
  53. package/bpk-component-datatable/src/utils.js +14 -148
  54. package/bpk-component-datepicker/src/BpkDatepicker.module.css +2 -2
  55. package/bpk-component-description-list/src/BpkDescriptionList.module.css +2 -2
  56. package/bpk-component-dialog/src/BpkDialog.module.css +2 -2
  57. package/bpk-component-dialog/src/BpkDialogInner.module.css +2 -2
  58. package/bpk-component-drawer/src/BpkDrawer.module.css +2 -2
  59. package/bpk-component-drawer/src/BpkDrawerContent.module.css +2 -2
  60. package/bpk-component-fieldset/src/BpkFieldset.module.css +2 -2
  61. package/bpk-component-flare/src/bpk-content-bubble.module.css +2 -2
  62. package/bpk-component-flare/src/bpk-flare-bar.module.css +2 -2
  63. package/bpk-component-floating-notification/src/BpkFloatingNotification.module.css +2 -2
  64. package/bpk-component-form-validation/src/BpkFormValidation.module.css +2 -2
  65. package/bpk-component-graphic-promotion/src/BpkGraphicPromo.module.css +2 -2
  66. package/bpk-component-grid-toggle/src/BpkGridToggle.module.css +2 -2
  67. package/bpk-component-horizontal-nav/src/BpkHorizontalNav.module.css +2 -2
  68. package/bpk-component-horizontal-nav/src/BpkHorizontalNavItem.module.css +2 -2
  69. package/bpk-component-icon/src/BpkIcon.module.css +2 -2
  70. package/bpk-component-icon/src/withDescription.module.css +2 -2
  71. package/bpk-component-image/src/BpkBackgroundImage.module.css +2 -2
  72. package/bpk-component-image/src/BpkImage.module.css +2 -2
  73. package/bpk-component-infinite-scroll/src/withInfiniteScroll.module.css +2 -2
  74. package/bpk-component-info-banner/src/BpkAnimateAndFade.module.css +2 -2
  75. package/bpk-component-info-banner/src/BpkInfoBanner.module.css +2 -2
  76. package/bpk-component-input/src/BpkClearButton.module.css +2 -2
  77. package/bpk-component-input/src/BpkInput.module.css +2 -2
  78. package/bpk-component-label/src/BpkLabel.module.css +2 -2
  79. package/bpk-component-link/src/BpkLink.module.css +2 -2
  80. package/bpk-component-list/src/BpkList.module.css +2 -2
  81. package/bpk-component-loading-button/src/BpkLoadingButton.module.css +2 -2
  82. package/bpk-component-map/src/BpkIconMarker.module.css +2 -2
  83. package/bpk-component-map/src/BpkIconMarkerBackground.module.css +2 -2
  84. package/bpk-component-map/src/BpkMap.module.css +2 -2
  85. package/bpk-component-map/src/BpkPriceMarker.module.css +2 -2
  86. package/bpk-component-map/src/BpkPriceMarkerV2/BpkPriceMarker.module.css +2 -2
  87. package/bpk-component-map/src/DefaultLoadingElement.module.css +2 -2
  88. package/bpk-component-mobile-scroll-container/src/BpkMobileScrollContainer.module.css +2 -2
  89. package/bpk-component-modal/src/BpkModal.module.css +2 -2
  90. package/bpk-component-modal/src/BpkModalInner.module.css +2 -2
  91. package/bpk-component-modal/src/BpkModalV2/BpKModal.module.css +2 -2
  92. package/bpk-component-navigation-bar/src/BpkNavigationBar.module.css +2 -2
  93. package/bpk-component-navigation-bar/src/BpkNavigationBarButtonLink.module.css +2 -2
  94. package/bpk-component-navigation-bar/src/BpkNavigationBarIconButton.module.css +2 -2
  95. package/bpk-component-nudger/src/BpkNudger.module.css +2 -2
  96. package/bpk-component-overlay/src/BpkOverlay.module.css +2 -2
  97. package/bpk-component-page-indicator/src/BpkPageIndicator.module.css +2 -2
  98. package/bpk-component-pagination/src/BpkPagination.module.css +2 -2
  99. package/bpk-component-pagination/src/BpkPaginationList.module.css +2 -2
  100. package/bpk-component-pagination/src/BpkPaginationNudger.module.css +2 -2
  101. package/bpk-component-pagination/src/BpkPaginationPage.module.css +2 -2
  102. package/bpk-component-panel/src/BpkPanel.module.css +2 -2
  103. package/bpk-component-phone-input/src/BpkPhoneInput.module.css +2 -2
  104. package/bpk-component-popover/src/BpkPopover.module.css +2 -2
  105. package/bpk-component-price/src/BpkPrice.module.css +2 -2
  106. package/bpk-component-progress/src/BpkProgress.module.css +2 -2
  107. package/bpk-component-radio/src/BpkRadio.module.css +2 -2
  108. package/bpk-component-rating/src/BpkRating.module.css +2 -2
  109. package/bpk-component-scrollable-calendar/src/BpkScrollableCalendarGrid.module.css +2 -2
  110. package/bpk-component-scrollable-calendar/src/BpkScrollableCalendarGridList.module.css +2 -2
  111. package/bpk-component-section-header/src/BpkSectionHeader.module.css +2 -2
  112. package/bpk-component-section-list/src/BpkSectionListItem.module.css +2 -2
  113. package/bpk-component-section-list/src/BpkSectionListSection.module.css +2 -2
  114. package/bpk-component-select/src/BpkSelect.module.css +2 -2
  115. package/bpk-component-skip-link/src/BpkSkipLink.module.css +2 -2
  116. package/bpk-component-slider/src/BpkSlider.module.css +2 -2
  117. package/bpk-component-spinner/src/BpkSpinner.module.css +2 -2
  118. package/bpk-component-split-input/src/BpkInputField.module.css +2 -2
  119. package/bpk-component-split-input/src/BpkSplitInput.module.css +2 -2
  120. package/bpk-component-star-rating/src/BpkInteractiveStar.module.css +2 -2
  121. package/bpk-component-star-rating/src/BpkStar.module.css +2 -2
  122. package/bpk-component-star-rating/src/BpkStarRating.module.css +2 -2
  123. package/bpk-component-swap-button/src/BpkSwapButton.module.css +2 -2
  124. package/bpk-component-switch/src/BpkSwitch.module.css +2 -2
  125. package/bpk-component-table/src/BpkTable.module.css +2 -2
  126. package/bpk-component-text/src/BpkText.module.css +2 -2
  127. package/bpk-component-textarea/src/BpkTextarea.module.css +2 -2
  128. package/bpk-component-theme-toggle/src/BpkThemeToggle.module.css +2 -2
  129. package/bpk-component-ticket/src/BpkTicket.module.css +2 -2
  130. package/bpk-component-tooltip/src/BpkTooltip.module.css +2 -2
  131. package/bpk-mixins/{src/mixins/_badges-v2.scss → _badges-v2.scss} +3 -1
  132. package/bpk-mixins/{src/mixins/_badges.scss → _badges.scss} +13 -9
  133. package/bpk-mixins/{src/mixins/_borders.scss → _borders.scss} +11 -9
  134. package/bpk-mixins/{src/mixins/_breakpoints.scss → _breakpoints.scss} +3 -1
  135. package/bpk-mixins/{src/mixins/_buttons.scss → _buttons.scss} +7 -4
  136. package/bpk-mixins/{src/mixins/_cards.scss → _cards.scss} +6 -1
  137. package/bpk-mixins/{src/mixins/_chips.scss → _chips.scss} +8 -0
  138. package/bpk-mixins/{src/mixins/_forms.scss → _forms.scss} +5 -1
  139. package/bpk-mixins/_icons.scss +88 -0
  140. package/bpk-mixins/_index.scss +20 -17
  141. package/bpk-mixins/{src/mixins/_layers.scss → _layers.scss} +18 -15
  142. package/bpk-mixins/{src/mixins/_margins.scss → _margins.scss} +4 -0
  143. package/bpk-mixins/{src/mixins/_panels.scss → _panels.scss} +6 -2
  144. package/bpk-mixins/{src/mixins/_radii.scss → _radii.scss} +3 -1
  145. package/bpk-mixins/{src/mixins/_scroll-indicators.scss → _scroll-indicators.scss} +3 -1
  146. package/bpk-mixins/{src/mixins/_shadows.scss → _shadows.scss} +3 -1
  147. package/bpk-mixins/{src/mixins/_svgs.scss → _spinners.scss} +5 -68
  148. package/bpk-mixins/{src/_bonds.scss → _tokens.scss} +2 -0
  149. package/bpk-mixins/{src/mixins/_typography.scss → _typography.scss} +6 -2
  150. package/bpk-mixins/{src/mixins/_utils.scss → _utils.scss} +4 -0
  151. package/bpk-scrim-utils/src/bpk-scrim-content.module.css +2 -2
  152. package/bpk-scrim-utils/src/bpk-scrim.module.css +2 -2
  153. package/bpk-stylesheets/base.css +1 -2
  154. package/bpk-stylesheets/font.css +2 -2
  155. package/bpk-stylesheets/index.scss +18 -14
  156. package/bpk-stylesheets/normalize.css +422 -0
  157. package/package.json +15 -2
  158. package/unstable__bpk-mixins/_badges-v2.scss +240 -0
  159. package/unstable__bpk-mixins/_badges.scss +240 -0
  160. package/unstable__bpk-mixins/_borders.scss +268 -0
  161. package/unstable__bpk-mixins/_breakpoints.scss +221 -0
  162. package/unstable__bpk-mixins/_buttons.scss +568 -0
  163. package/unstable__bpk-mixins/_cards.scss +94 -0
  164. package/unstable__bpk-mixins/_chips.scss +240 -0
  165. package/unstable__bpk-mixins/_forms.scss +1049 -0
  166. package/unstable__bpk-mixins/_icons.scss +88 -0
  167. package/{bpk-mixins/sass-functions.js → unstable__bpk-mixins/_index.scss} +19 -10
  168. package/unstable__bpk-mixins/_layers.scss +199 -0
  169. package/unstable__bpk-mixins/_margins.scss +75 -0
  170. package/unstable__bpk-mixins/_panels.scss +71 -0
  171. package/unstable__bpk-mixins/_radii.scss +80 -0
  172. package/unstable__bpk-mixins/_scroll-indicators.scss +79 -0
  173. package/unstable__bpk-mixins/_shadows.scss +58 -0
  174. package/unstable__bpk-mixins/_spinners.scss +102 -0
  175. package/{bpk-component-datatable/src/sort-types.js → unstable__bpk-mixins/_tokens.scss} +3 -6
  176. package/unstable__bpk-mixins/_typography.scss +1039 -0
  177. package/unstable__bpk-mixins/_utils.scss +266 -0
  178. package/bpk-component-badge/src/BpkBadgeV2/BpkBadge.d.ts +0 -22
  179. package/bpk-component-badge/src/BpkBadgeV2/BpkBadge.js +0 -47
  180. package/bpk-component-badge/src/BpkBadgeV2/BpkBadge.module.css +0 -18
  181. package/bpk-component-datatable/src/BpkDataTableColumn.js +0 -54
  182. package/bpk-component-datatable/src/BpkDataTableColumn.module.css +0 -18
  183. package/bpk-component-datatable/src/hasChildrenOfType.js +0 -35
@@ -0,0 +1,266 @@
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
+ /* stylelint-disable at-rule-disallowed-list */
20
+
21
+ @use "sass:string";
22
+ @use 'tokens.scss';
23
+
24
+ ////
25
+ /// @group utils
26
+ ////
27
+
28
+ /// Standard focus indicator for elements.
29
+ ///
30
+ /// @example scss
31
+ /// .selector {
32
+ /// @include bpk-focus-indicator();
33
+ /// }
34
+
35
+ @mixin bpk-focus-indicator {
36
+ outline: (tokens.$bpk-one-pixel-rem * 2) solid tokens.$bpk-text-link-day;
37
+ outline-offset: (tokens.$bpk-one-pixel-rem * 2);
38
+ }
39
+
40
+ /// Hide visually and from screen readers.
41
+ ///
42
+ /// @example scss
43
+ /// .selector {
44
+ /// @include bpk-hidden();
45
+ /// }
46
+
47
+ @mixin bpk-hidden {
48
+ display: none !important; /* stylelint-disable-line declaration-no-important */
49
+ }
50
+
51
+ /// Hide only visually, but have it available for screen readers:
52
+ ///
53
+ /// http://snook.ca/archives/html_and_css/hiding-content-for-accessibility
54
+ ///
55
+ /// @example scss
56
+ /// .selector {
57
+ /// @include bpk-visually-hidden();
58
+ /// }
59
+
60
+ @mixin bpk-visually-hidden {
61
+ position: absolute;
62
+ width: 1px; /* stylelint-disable-line unit-disallowed-list */
63
+ height: 1px; /* stylelint-disable-line unit-disallowed-list */
64
+ margin: -1px; /* stylelint-disable-line unit-disallowed-list */
65
+ padding: 0;
66
+ border: 0;
67
+ overflow: hidden;
68
+ clip: rect(0 0 0 0);
69
+ }
70
+
71
+ /// Modifies the bpk-visually-hidden mixin to allow the element to be focusable when navigated to via the keyboard:
72
+ ///
73
+ /// https://www.drupal.org/node/897638
74
+ ///
75
+ /// @require {mixin} bpk-visually-hidden
76
+ ///
77
+ /// @example scss
78
+ /// .selector {
79
+ /// @include bpk-visually-hidden();
80
+ /// @include bpk-visually-hidden--focusable();
81
+ /// }
82
+
83
+ @mixin bpk-visually-hidden--focusable {
84
+ &:active,
85
+ &:focus {
86
+ position: static;
87
+ width: auto;
88
+ height: auto;
89
+ margin: 0;
90
+ overflow: visible;
91
+ clip: auto;
92
+ }
93
+ }
94
+
95
+ /// Hide visually and from screen readers, but maintain layout.
96
+ ///
97
+ /// @example scss
98
+ /// .selector {
99
+ /// @include bpk-invisible();
100
+ /// }
101
+
102
+ @mixin bpk-invisible {
103
+ visibility: hidden;
104
+ }
105
+
106
+ /// Clearfix: contain floats.
107
+ ///
108
+ /// @example scss
109
+ /// .selector {
110
+ /// @include bpk-clearfix();
111
+ /// }
112
+
113
+ @mixin bpk-clearfix {
114
+ &::before,
115
+ &::after {
116
+ content: '';
117
+ display: table;
118
+ }
119
+
120
+ &::after {
121
+ clear: both;
122
+ }
123
+ }
124
+
125
+ /// Target RTL specific styles.
126
+ ///
127
+ /// @content
128
+ ///
129
+ /// @example scss
130
+ /// .selector {
131
+ /// @include bpk-rtl() {
132
+ /// /* RTL scss goes here */
133
+ /// }
134
+ /// }
135
+
136
+ @mixin bpk-rtl {
137
+ html[dir='rtl'] & {
138
+ @content;
139
+ }
140
+ }
141
+
142
+ /// :hover pseudo selector wrapper which prevents styles displaying on touch devices
143
+ ///
144
+ /// @content
145
+ ///
146
+ /// @example scss
147
+ /// .selector {
148
+ /// @include bpk-hover() {
149
+ /// /* Non-touch specific hover scss goes here */
150
+ /// }
151
+ /// }
152
+
153
+ @mixin bpk-hover {
154
+ .bpk-no-touch-support &:hover:not(:active):not(:disabled) {
155
+ @content;
156
+ }
157
+
158
+ // Duplicating the above rule with `:global(...)` pseudo selector around the
159
+ // global `.bpk-no-touch-support` class to provide support for CSS modules.
160
+ // - when processed through css-loader, the `:global(...)` pseudo selector will be dropped
161
+ // leaving a duplicate rule which in turn will be 'uglified' out - so no worries there
162
+ // - when processed through node-sass only, the `:global(...)` pseudo selector will be left
163
+ // intact and ignored by all browsers
164
+ // stylelint-disable-next-line selector-pseudo-class-no-unknown
165
+ :global(.bpk-no-touch-support) &:hover:not(:active):not(:disabled) {
166
+ @content;
167
+ }
168
+ }
169
+
170
+ /// Target locale specific styles.
171
+ ///
172
+ /// @content
173
+ ///
174
+ /// @example scss
175
+ /// .selector {
176
+ /// @include bpk-locale('ja-JP') {
177
+ /// /* ja-JP scss goes here */
178
+ /// }
179
+ /// }
180
+
181
+ @mixin bpk-locale($locale) {
182
+ html[lang='#{$locale}'] &,
183
+ html[lang='#{string.to_lower_case($locale)}'] & {
184
+ @content;
185
+ }
186
+ }
187
+
188
+ /// Create a Backpack themeable property with
189
+ /// fallback support for old browsers and when
190
+ /// the CSS variable is not defined.
191
+ ///
192
+ /// @content
193
+ ///
194
+ /// @example scss
195
+ /// .selector {
196
+ /// @include bpk-themeable-property(color, --bpk-link-text-color, $fallback-text-color);
197
+ /// }
198
+
199
+ @mixin bpk-themeable-property($property, $variableName, $fallback) {
200
+ #{$property}: $fallback;
201
+ #{$property}: var($variableName, $fallback);
202
+ }
203
+
204
+ /// Create a property that uses the Backpack primary color blue-500.
205
+ ///
206
+ /// @content
207
+ ///
208
+ /// @example scss
209
+ /// .selector {
210
+ /// @include bpk-apply-primary-color-to(color);
211
+ /// }
212
+ @mixin bpk-apply-primary-color-to($property) {
213
+ @include bpk-themeable-property(
214
+ $property,
215
+ --bpk-primary-color,
216
+ tokens.$bpk-color-sky-blue
217
+ );
218
+ }
219
+
220
+ /// Replace part of a string with another string.
221
+ ///
222
+ /// @param {string} $string - The string inside which the replacement should take place.
223
+ /// @param {string} $search - The substring to be replaced.
224
+ /// @param {string} $replace [''] - The string to replace $search.
225
+
226
+ @function str-replace($string, $search, $replace: '') {
227
+ /* Disabling rule here as the recommendation method is for newer sass versions that we don't yet support */
228
+ /* stylelint-disable-next-line scss/no-global-function-names */
229
+ $index: string.index($string, $search);
230
+
231
+ @if $index {
232
+ @return string.slice($string, 1, $index - 1) + $replace +
233
+ str-replace(
234
+ string.slice($string, $index + string.length($search)),
235
+ $search,
236
+ $replace
237
+ );
238
+ }
239
+
240
+ @return $string;
241
+ }
242
+
243
+ /// Increases the tappable area of the element to the
244
+ /// minimum required for touch devices.
245
+ ///
246
+ /// @content
247
+ ///
248
+ /// @example scss
249
+ /// .selector {
250
+ /// @include bpk-touch-area;
251
+ /// }
252
+
253
+ @mixin bpk-touch-tappable {
254
+ position: relative;
255
+
256
+ &::before {
257
+ position: absolute;
258
+ /* stylelint-disable-next-line function-calc-no-invalid */
259
+ top: calc((-#{tokens.bpk-spacing-xxl() + tokens.bpk-spacing-sm()} / 2) + 50%);
260
+ /* stylelint-disable-next-line function-calc-no-invalid */
261
+ left: calc((-#{tokens.bpk-spacing-xxl() + tokens.bpk-spacing-sm()} / 2) + 50%);
262
+ content: '';
263
+ width: tokens.bpk-spacing-xxl() + tokens.bpk-spacing-sm();
264
+ height: tokens.bpk-spacing-xxl() + tokens.bpk-spacing-sm();
265
+ }
266
+ }
@@ -1,22 +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
- /// <reference types="react" />
20
- import type { Props } from '../BpkBadge';
21
- declare const BpkBadgeV2: ({ centered, className, docked, type, ...rest }: Props) => JSX.Element;
22
- export default BpkBadgeV2;
@@ -1,47 +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 { cssModules } from "../../../bpk-react-utils";
20
- import { BADGE_TYPES } from "../BpkBadge";
21
- import STYLES from "./BpkBadge.module.css";
22
- import { jsx as _jsx } from "react/jsx-runtime";
23
- const getClassName = cssModules(STYLES);
24
- const badgeTypeClassNames = {
25
- [BADGE_TYPES.warning]: getClassName('bpk-badge--warning'),
26
- [BADGE_TYPES.success]: getClassName('bpk-badge--success'),
27
- [BADGE_TYPES.critical]: getClassName('bpk-badge--critical'),
28
- [BADGE_TYPES.normal]: getClassName('bpk-badge--normal'),
29
- [BADGE_TYPES.inverse]: getClassName('bpk-badge--inverse'),
30
- [BADGE_TYPES.outline]: getClassName('bpk-badge--outline'),
31
- [BADGE_TYPES.strong]: getClassName('bpk-badge--strong'),
32
- [BADGE_TYPES.brand]: getClassName('bpk-badge--brand')
33
- };
34
- const BpkBadgeV2 = ({
35
- centered = false,
36
- className = null,
37
- docked = null,
38
- type = BADGE_TYPES.normal,
39
- ...rest
40
- }) => {
41
- const classNames = getClassName('bpk-badge', badgeTypeClassNames[type], docked === 'right' && 'bpk-badge--docked-right', docked === 'left' && 'bpk-badge--docked-left', centered && 'bpk-badge--centered', className);
42
- return /*#__PURE__*/_jsx("span", {
43
- className: classNames,
44
- ...rest
45
- });
46
- };
47
- export default BpkBadgeV2;
@@ -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-badge{display:inline-flex;padding:0.25rem 0.5rem;align-items:center;border-radius:.25rem;margin:0;font-size:.875rem;line-height:1.25rem;font-weight:400}.bpk-badge--centered{vertical-align:text-bottom}.bpk-badge--docked-right{position:absolute;top:0;right:0;border-top-left-radius:0;border-top-right-radius:0;border-bottom-right-radius:0}html[dir='rtl'] .bpk-badge--docked-right{right:inherit;left:0;border-bottom-left-radius:0;border-bottom-right-radius:.25rem}.bpk-badge--docked-left{position:absolute;top:0;left:0;border-top-left-radius:0;border-top-right-radius:0;border-bottom-left-radius:0}html[dir='rtl'] .bpk-badge--docked-left{right:0;left:inherit;border-bottom-left-radius:.25rem;border-bottom-right-radius:0}.bpk-badge--warning{background-color:#eff1f2;color:#161616;fill:#f55d42}.bpk-badge--success{background-color:#eff1f2;color:#161616;fill:#0c838a}.bpk-badge--critical{background-color:#eff1f2;color:#161616;fill:#e70866}.bpk-badge--normal{background-color:#eff1f2;color:#161616;fill:#161616}.bpk-badge--inverse{background-color:#fff;color:#161616;fill:#161616}.bpk-badge--outline{background-color:transparent;color:#fff;box-shadow:inset 0 0 0 1px #fff;fill:#fff}.bpk-badge--strong{background-color:#05203c;color:#fff;fill:#fff}.bpk-badge--brand{background-color:#0062e3;color:#fff;fill:#fff}
@@ -1,54 +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
- */import PropTypes from 'prop-types';
18
- import { SORT_DIRECTION_TYPES } from "./sort-types";
19
- import { jsx as _jsx } from "react/jsx-runtime";
20
- // BpkDataTableColumn is just a props wrapper
21
- // to maintain backwards compatibility with the old API of BpkDataTable which takes columns as children
22
- // The `react-table` library however expects columns as an array of objects
23
-
24
- const BpkDataTableColumn = props => /*#__PURE__*/_jsx("div", {
25
- ...props
26
- });
27
- BpkDataTableColumn.propTypes = {
28
- dataKey: PropTypes.string.isRequired,
29
- width: PropTypes.oneOfType([PropTypes.number, PropTypes.string]).isRequired,
30
- className: PropTypes.string,
31
- disableSort: PropTypes.bool,
32
- defaultSortDirection: PropTypes.oneOf(Object.keys(SORT_DIRECTION_TYPES)),
33
- flexGrow: PropTypes.number,
34
- label: PropTypes.string,
35
- headerRenderer: PropTypes.func,
36
- headerClassName: PropTypes.string,
37
- headerStyle: PropTypes.object,
38
- // eslint-disable-line react/forbid-prop-types
39
- cellRenderer: PropTypes.func,
40
- cellDataGetter: PropTypes.func
41
- };
42
- BpkDataTableColumn.defaultProps = {
43
- className: null,
44
- disableSort: false,
45
- defaultSortDirection: SORT_DIRECTION_TYPES.ASC,
46
- flexGrow: 0,
47
- label: null,
48
- headerRenderer: null,
49
- headerClassName: null,
50
- headerStyle: null,
51
- cellRenderer: null,
52
- cellDataGetter: null
53
- };
54
- export default BpkDataTableColumn;
@@ -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
- @keyframes bpk-keyframe-spin{100%{transform:rotate(1turn)}}.bpk-data-table-column{margin:1rem;text-overflow:ellipsis;white-space:nowrap;overflow:hidden}.bpk-data-table-column__header{display:inline-block;max-width:100%;text-overflow:ellipsis;overflow:hidden}.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:#b2b2bf}.bpk-data-table-column__sort-icon:hover{fill:#68697f}.bpk-data-table-column__sort-icon--selected,.bpk-data-table-column__sort-icon--selected:hover{fill:#084eb2}.bpk-data-table-column__sort-icon--up{margin-bottom:-0.25rem}
@@ -1,35 +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
- */import { Children } from 'react';
18
- export function getDisplayName(Component) {
19
- return Component.displayName || Component.name || (typeof Component === 'string' && Component.length > 0 ? Component : 'Unknown');
20
- }
21
- const hasChildrenOfType = (type, atLeast = 1) => (props, propType, componentName) => {
22
- if (Children.count(props[propType]) < atLeast) {
23
- const inflectedNoun = atLeast === 1 ? 'child' : 'children';
24
- return Error(`${componentName} requires at least ${atLeast} '${getDisplayName(type)}' ${inflectedNoun}.`);
25
- }
26
- const children = Children.toArray(props[propType]);
27
- for (let i = 0; i < children.length; i += 1) {
28
- const child = children[i];
29
- if (child.type !== type && !(child.type.prototype instanceof type)) {
30
- return Error(`${componentName} only allows '${getDisplayName(type)}' as children. Found '${getDisplayName(child.type)}'.`);
31
- }
32
- }
33
- return undefined;
34
- };
35
- export default hasChildrenOfType;