@skyscanner/backpack-web 31.10.0 → 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 (184) 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.js +2 -2
  124. package/bpk-component-swap-button/src/BpkSwapButton.module.css +2 -2
  125. package/bpk-component-switch/src/BpkSwitch.module.css +2 -2
  126. package/bpk-component-table/src/BpkTable.module.css +2 -2
  127. package/bpk-component-text/src/BpkText.module.css +2 -2
  128. package/bpk-component-textarea/src/BpkTextarea.module.css +2 -2
  129. package/bpk-component-theme-toggle/src/BpkThemeToggle.module.css +2 -2
  130. package/bpk-component-ticket/src/BpkTicket.module.css +2 -2
  131. package/bpk-component-tooltip/src/BpkTooltip.module.css +2 -2
  132. package/bpk-mixins/{src/mixins/_badges-v2.scss → _badges-v2.scss} +3 -1
  133. package/bpk-mixins/{src/mixins/_badges.scss → _badges.scss} +13 -9
  134. package/bpk-mixins/{src/mixins/_borders.scss → _borders.scss} +11 -9
  135. package/bpk-mixins/{src/mixins/_breakpoints.scss → _breakpoints.scss} +3 -1
  136. package/bpk-mixins/{src/mixins/_buttons.scss → _buttons.scss} +7 -4
  137. package/bpk-mixins/{src/mixins/_cards.scss → _cards.scss} +6 -1
  138. package/bpk-mixins/{src/mixins/_chips.scss → _chips.scss} +8 -0
  139. package/bpk-mixins/{src/mixins/_forms.scss → _forms.scss} +5 -1
  140. package/bpk-mixins/_icons.scss +88 -0
  141. package/bpk-mixins/_index.scss +20 -17
  142. package/bpk-mixins/{src/mixins/_layers.scss → _layers.scss} +18 -15
  143. package/bpk-mixins/{src/mixins/_margins.scss → _margins.scss} +4 -0
  144. package/bpk-mixins/{src/mixins/_panels.scss → _panels.scss} +6 -2
  145. package/bpk-mixins/{src/mixins/_radii.scss → _radii.scss} +3 -1
  146. package/bpk-mixins/{src/mixins/_scroll-indicators.scss → _scroll-indicators.scss} +3 -1
  147. package/bpk-mixins/{src/mixins/_shadows.scss → _shadows.scss} +3 -1
  148. package/bpk-mixins/{src/mixins/_svgs.scss → _spinners.scss} +5 -68
  149. package/bpk-mixins/{src/_bonds.scss → _tokens.scss} +2 -0
  150. package/bpk-mixins/{src/mixins/_typography.scss → _typography.scss} +6 -2
  151. package/bpk-mixins/{src/mixins/_utils.scss → _utils.scss} +4 -0
  152. package/bpk-scrim-utils/src/bpk-scrim-content.module.css +2 -2
  153. package/bpk-scrim-utils/src/bpk-scrim.module.css +2 -2
  154. package/bpk-stylesheets/base.css +1 -2
  155. package/bpk-stylesheets/font.css +2 -2
  156. package/bpk-stylesheets/index.scss +18 -14
  157. package/bpk-stylesheets/normalize.css +422 -0
  158. package/package.json +15 -2
  159. package/unstable__bpk-mixins/_badges-v2.scss +240 -0
  160. package/unstable__bpk-mixins/_badges.scss +240 -0
  161. package/unstable__bpk-mixins/_borders.scss +268 -0
  162. package/unstable__bpk-mixins/_breakpoints.scss +221 -0
  163. package/unstable__bpk-mixins/_buttons.scss +568 -0
  164. package/unstable__bpk-mixins/_cards.scss +94 -0
  165. package/unstable__bpk-mixins/_chips.scss +240 -0
  166. package/unstable__bpk-mixins/_forms.scss +1049 -0
  167. package/unstable__bpk-mixins/_icons.scss +88 -0
  168. package/{bpk-mixins/sass-functions.js → unstable__bpk-mixins/_index.scss} +19 -10
  169. package/unstable__bpk-mixins/_layers.scss +199 -0
  170. package/unstable__bpk-mixins/_margins.scss +75 -0
  171. package/unstable__bpk-mixins/_panels.scss +71 -0
  172. package/unstable__bpk-mixins/_radii.scss +80 -0
  173. package/unstable__bpk-mixins/_scroll-indicators.scss +79 -0
  174. package/unstable__bpk-mixins/_shadows.scss +58 -0
  175. package/unstable__bpk-mixins/_spinners.scss +102 -0
  176. package/{bpk-component-datatable/src/sort-types.js → unstable__bpk-mixins/_tokens.scss} +3 -6
  177. package/unstable__bpk-mixins/_typography.scss +1039 -0
  178. package/unstable__bpk-mixins/_utils.scss +266 -0
  179. package/bpk-component-badge/src/BpkBadgeV2/BpkBadge.d.ts +0 -22
  180. package/bpk-component-badge/src/BpkBadgeV2/BpkBadge.js +0 -47
  181. package/bpk-component-badge/src/BpkBadgeV2/BpkBadge.module.css +0 -18
  182. package/bpk-component-datatable/src/BpkDataTableColumn.js +0 -54
  183. package/bpk-component-datatable/src/BpkDataTableColumn.module.css +0 -18
  184. package/bpk-component-datatable/src/hasChildrenOfType.js +0 -35
@@ -0,0 +1,88 @@
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 'tokens.scss';
22
+ @use 'utils.scss';
23
+
24
+ ////
25
+ /// @group svgs
26
+ ////
27
+
28
+ /// Button alignment utility.
29
+ ///
30
+ /// @access private
31
+
32
+ @mixin _bpk-svg--align-to-button() {
33
+ vertical-align: text-bottom;
34
+ }
35
+
36
+ /// Large button alignment utility.
37
+ ///
38
+ /// @access private
39
+
40
+ @mixin _bpk-svg--align-to-large-button() {
41
+ margin-top: (tokens.$bpk-private-button-line-height - tokens.$bpk-icon-size-lg) * 0.5;
42
+ vertical-align: top;
43
+ }
44
+
45
+ /// Align to button. Modifies the bpk-icon-sm mixin.
46
+ ///
47
+ /// @require {mixin} bpk-icon-sm
48
+ ///
49
+ /// @example scss
50
+ /// .selector {
51
+ /// @include bpk-icon-sm(flight-sky-gray-tint-02);
52
+ /// @include bpk-icon-sm--align-to-button();
53
+ /// }
54
+
55
+ @mixin bpk-icon-sm--align-to-button() {
56
+ @include _bpk-svg--align-to-button;
57
+ }
58
+
59
+ /// Align to large button. Modifies the bpk-icon-lg mixin.
60
+ ///
61
+ /// @require {mixin} bpk-icon-lg
62
+ ///
63
+ /// @example scss
64
+ /// .selector {
65
+ /// @include bpk-icon-lg(flight-sky-gray-tint-02);
66
+ /// @include bpk-icon-lg--align-to-large-button();
67
+ /// }
68
+
69
+ @mixin bpk-icon-lg--align-to-large-button() {
70
+ @include _bpk-svg--align-to-large-button;
71
+ }
72
+
73
+ /// RTL support. Modifies the bpk-icon-sm or bpk-icon-lg mixin.
74
+ ///
75
+ /// @require {mixin} bpk-icon-sm
76
+ /// @require {mixin} bpk-icon-lg
77
+ ///
78
+ /// @example scss
79
+ /// .selector {
80
+ /// @include bpk-icon-sm(flight-sky-gray-tint-02);
81
+ /// @include bpk-icon--rtl-support();
82
+ /// }
83
+
84
+ @mixin bpk-icon--rtl-support() {
85
+ @include utils.bpk-rtl {
86
+ transform: scaleX(-1);
87
+ }
88
+ }
@@ -16,14 +16,23 @@
16
16
  * limitations under the License.
17
17
  */
18
18
 
19
- // We disable eslint here as this package is listed as a peerDep so consumers are required to install this when using this package.
20
-
21
- const nodeSass = require('node-sass');
19
+ @forward 'tokens';
20
+ @forward 'badges';
21
+ @forward 'borders';
22
+ @forward 'breakpoints';
23
+ @forward 'buttons';
24
+ @forward 'cards';
25
+ @forward 'chips';
26
+ @forward 'forms';
27
+ @forward 'icons';
28
+ @forward 'layers';
29
+ @forward 'margins';
30
+ @forward 'panels';
31
+ @forward 'radii';
32
+ @forward 'scroll-indicators';
33
+ @forward 'shadows';
34
+ @forward 'spinners';
35
+ @forward 'typography';
36
+ @forward 'utils';
22
37
 
23
- module.exports = {
24
- 'encodebase64($string)': (str) => {
25
- const buffer = Buffer.from(str.getValue());
26
-
27
- return nodeSass.types.String(buffer.toString('base64'));
28
- },
29
- };
38
+ @warn "You're using blank import of all mixins. This might affect performance of your build tool and your bundle size. \nConsider switching to more granular imports, e.g. @use '@skyscanner/backpack-web/bpk-mixins/buttons'";
@@ -0,0 +1,199 @@
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 'tokens.scss';
22
+ @use 'radii.scss';
23
+ @use 'shadows.scss';
24
+ @use 'utils.scss';
25
+
26
+ ////
27
+ /// @group layers
28
+ ////
29
+
30
+ /// Layer base styles.
31
+ ///
32
+ /// @example scss
33
+ /// .selector {
34
+ /// @include bpk-layer;
35
+ /// }
36
+
37
+ @mixin bpk-layer(
38
+ $background-color: tokens.$bpk-color-white,
39
+ $border-color: tokens.$bpk-surface-highlight-day
40
+ ) {
41
+ border: tokens.$bpk-one-pixel-rem solid $border-color;
42
+ background-color: $background-color;
43
+
44
+ @include radii.bpk-border-radius-sm;
45
+ @include shadows.bpk-box-shadow-lg;
46
+ }
47
+
48
+ /// Layer arrow base styles.
49
+ ///
50
+ /// @example scss
51
+ /// .selector {
52
+ /// @include bpk-layer-arrow(1rem);
53
+ /// }
54
+
55
+ @mixin bpk-layer-arrow($arrow-size) {
56
+ position: absolute;
57
+ pointer-events: none;
58
+
59
+ &::before,
60
+ &::after {
61
+ position: absolute;
62
+ content: '';
63
+ display: block;
64
+ }
65
+
66
+ &::before {
67
+ border: ($arrow-size + tokens.$bpk-one-pixel-rem) solid transparent;
68
+ }
69
+
70
+ &::after {
71
+ border: $arrow-size solid transparent;
72
+ }
73
+ }
74
+
75
+ /// Layer top arrow.
76
+ ///
77
+ /// @example scss
78
+ /// .selector {
79
+ /// @include bpk-layer-arrow(1rem);
80
+ /// @include bpk-layer-arrow-top(1rem);
81
+ /// }
82
+
83
+ @mixin bpk-layer-arrow-top(
84
+ $arrow-size,
85
+ $arrow-color: tokens.$bpk-color-white,
86
+ $border-color: tokens.$bpk-color-sky-gray-tint-06
87
+ ) {
88
+ bottom: 100%;
89
+ width: ($arrow-size * 2);
90
+ height: $arrow-size;
91
+
92
+ &::before {
93
+ top: -1 * ($arrow-size + tokens.$bpk-one-pixel-rem);
94
+ margin-left: -1 * tokens.$bpk-one-pixel-rem;
95
+ border-bottom-color: $border-color;
96
+
97
+ @include utils.bpk-rtl {
98
+ margin-right: -1 * tokens.$bpk-one-pixel-rem;
99
+ margin-left: 0;
100
+ }
101
+ }
102
+
103
+ &::after {
104
+ top: -1 * $arrow-size + tokens.$bpk-one-pixel-rem;
105
+ border-bottom-color: $arrow-color;
106
+ }
107
+ }
108
+
109
+ /// Layer right arrow.
110
+ ///
111
+ /// @example scss
112
+ /// .selector {
113
+ /// @include bpk-layer-arrow(1rem);
114
+ /// @include bpk-layer-arrow-right(1rem);
115
+ /// }
116
+
117
+ @mixin bpk-layer-arrow-right(
118
+ $arrow-size,
119
+ $arrow-color: tokens.$bpk-color-white,
120
+ $border-color: tokens.$bpk-color-sky-gray-tint-06
121
+ ) {
122
+ left: 100%;
123
+ width: $arrow-size;
124
+ height: ($arrow-size * 2);
125
+
126
+ &::before {
127
+ right: -1 * ($arrow-size + tokens.$bpk-one-pixel-rem);
128
+ margin-top: -1 * tokens.$bpk-one-pixel-rem;
129
+ border-left-color: $border-color;
130
+ }
131
+
132
+ &::after {
133
+ right: -1 * $arrow-size + tokens.$bpk-one-pixel-rem;
134
+ border-left-color: $arrow-color;
135
+ }
136
+ }
137
+
138
+ /// Layer bottom arrow.
139
+ ///
140
+ /// @example scss
141
+ /// .selector {
142
+ /// @include bpk-layer-arrow(1rem);
143
+ /// @include bpk-layer-arrow-bottom(1rem);
144
+ /// }
145
+
146
+ @mixin bpk-layer-arrow-bottom(
147
+ $arrow-size,
148
+ $arrow-color: tokens.$bpk-color-white,
149
+ $border-color: tokens.$bpk-color-sky-gray-tint-06
150
+ ) {
151
+ top: 100%;
152
+ width: ($arrow-size * 2);
153
+ height: $arrow-size;
154
+
155
+ &::before {
156
+ bottom: -1 * ($arrow-size + tokens.$bpk-one-pixel-rem);
157
+ margin-left: -1 * tokens.$bpk-one-pixel-rem;
158
+ border-top-color: $border-color;
159
+
160
+ @include utils.bpk-rtl {
161
+ margin-right: -1 * tokens.$bpk-one-pixel-rem;
162
+ margin-left: 0;
163
+ }
164
+ }
165
+
166
+ &::after {
167
+ bottom: -1 * $arrow-size + tokens.$bpk-one-pixel-rem;
168
+ border-top-color: $arrow-color;
169
+ }
170
+ }
171
+
172
+ /// Layer left arrow.
173
+ ///
174
+ /// @example scss
175
+ /// .selector {
176
+ /// @include bpk-layer-arrow(1rem);
177
+ /// @include bpk-layer-arrow-left(1rem);
178
+ /// }
179
+
180
+ @mixin bpk-layer-arrow-left(
181
+ $arrow-size,
182
+ $arrow-color: tokens.$bpk-color-white,
183
+ $border-color: tokens.$bpk-color-sky-gray-tint-06
184
+ ) {
185
+ right: 100%;
186
+ width: $arrow-size;
187
+ height: ($arrow-size * 2);
188
+
189
+ &::before {
190
+ left: -1 * ($arrow-size + tokens.$bpk-one-pixel-rem);
191
+ margin-top: -1 * tokens.$bpk-one-pixel-rem;
192
+ border-right-color: $border-color;
193
+ }
194
+
195
+ &::after {
196
+ left: -1 * $arrow-size + tokens.$bpk-one-pixel-rem;
197
+ border-right-color: $arrow-color;
198
+ }
199
+ }
@@ -0,0 +1,75 @@
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 'utils.scss';
22
+
23
+ /// RTL aware leading margin
24
+ ///
25
+ /// @param {string} $margin The desired leading margin.
26
+ /// @param {boolean} $resetOppositeMargin [true] Whether to reset the opposite margin to 0.
27
+ ///
28
+ /// @content
29
+ ///
30
+ /// @example scss
31
+ /// .selector {
32
+ /// @include bpk-margin-leading(bpk-spacing-base());
33
+ /// }
34
+ @mixin bpk-margin-leading($margin, $resetOppositeMargin: true) {
35
+ margin-left: $margin;
36
+
37
+ @if $resetOppositeMargin {
38
+ margin-right: 0;
39
+ }
40
+
41
+ @include utils.bpk-rtl {
42
+ @if $resetOppositeMargin {
43
+ margin-left: 0;
44
+ }
45
+
46
+ margin-right: $margin;
47
+ }
48
+ }
49
+
50
+ /// RTL aware trailing margin
51
+ ///
52
+ /// @param {string} $margin The desired trailing margin.
53
+ /// @param {boolean} $resetOppositeMargin [true] Whether to reset the opposite margin to 0.
54
+ ///
55
+ /// @content
56
+ ///
57
+ /// @example scss
58
+ /// .selector {
59
+ /// @include bpk-margin-trailing(bpk-spacing-base());
60
+ /// }
61
+ @mixin bpk-margin-trailing($margin, $resetOppositeMargin: true) {
62
+ @if $resetOppositeMargin {
63
+ margin-left: 0;
64
+ }
65
+
66
+ margin-right: $margin;
67
+
68
+ @include utils.bpk-rtl {
69
+ margin-left: $margin;
70
+
71
+ @if $resetOppositeMargin {
72
+ margin-right: 0;
73
+ }
74
+ }
75
+ }
@@ -0,0 +1,71 @@
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 'tokens.scss';
22
+ @use 'borders.scss';
23
+ @use 'radii.scss';
24
+
25
+ ////
26
+ /// @group panels
27
+ ////
28
+
29
+ /// Basic panel.
30
+ ///
31
+ /// @example scss
32
+ /// .selector {
33
+ /// @include @bpk-panel()
34
+ /// }
35
+ @mixin bpk-panel {
36
+ display: block;
37
+ background-color: tokens.$bpk-card-background-color;
38
+
39
+ @include borders.bpk-border-sm(tokens.$bpk-panel-border-color);
40
+ @include radii.bpk-border-radius-md;
41
+ }
42
+
43
+ /// Adds padding to panels. Modifies the bpk-panel mixin.
44
+ ///
45
+ /// @require {mixin} bpk-panel
46
+ ///
47
+ /// @example scss
48
+ /// .selector {
49
+ /// @include bpk-panel();
50
+ /// @include bpk-panel--padded();
51
+ /// }
52
+ @mixin bpk-panel--padded {
53
+ padding: tokens.$bpk-card-padding;
54
+ }
55
+
56
+ /// Makes panel full width by removing left and right border.
57
+ /// Modifies the bpk-panel mixin.
58
+ ///
59
+ /// @require {mixin} bpk-panel
60
+ ///
61
+ /// @example scss
62
+ /// .selector {
63
+ /// @include bpk-panel();
64
+ /// @include bpk-panel--full-width();
65
+ /// }
66
+ @mixin bpk-panel--full-width {
67
+ border-radius: 0;
68
+ box-shadow:
69
+ tokens.$bpk-panel-border-color 0 -1 * tokens.$bpk-one-pixel-rem 0 0 inset,
70
+ tokens.$bpk-panel-border-color 0 tokens.$bpk-one-pixel-rem 0 0 inset;
71
+ }
@@ -0,0 +1,80 @@
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 'tokens.scss';
22
+
23
+ ////
24
+ /// @group radii
25
+ ////
26
+
27
+ /// Extra small border radius.
28
+ ///
29
+ /// @example scss
30
+ /// .selector {
31
+ /// @include bpk-border-radius-xs();
32
+ /// }
33
+
34
+ @mixin bpk-border-radius-xs {
35
+ border-radius: tokens.$bpk-border-radius-xs;
36
+ }
37
+
38
+ /// Small border radius.
39
+ ///
40
+ /// @example scss
41
+ /// .selector {
42
+ /// @include bpk-border-radius-sm();
43
+ /// }
44
+
45
+ @mixin bpk-border-radius-sm {
46
+ border-radius: tokens.$bpk-border-radius-sm;
47
+ }
48
+
49
+ /// Medium border radius.
50
+ ///
51
+ /// @example scss
52
+ /// .selector {
53
+ /// @include bpk-border-radius-md();
54
+ /// }
55
+
56
+ @mixin bpk-border-radius-md {
57
+ border-radius: tokens.$bpk-border-radius-md;
58
+ }
59
+
60
+ /// Large border radius.
61
+ ///
62
+ /// @example scss
63
+ /// .selector {
64
+ /// @include bpk-border-radius-lg();
65
+ /// }
66
+
67
+ @mixin bpk-border-radius-lg {
68
+ border-radius: tokens.$bpk-border-radius-lg;
69
+ }
70
+
71
+ /// Extra large border radius.
72
+ ///
73
+ /// @example scss
74
+ /// .selector {
75
+ /// @include bpk-border-radius-xl();
76
+ /// }
77
+
78
+ @mixin bpk-border-radius-xl {
79
+ border-radius: tokens.$bpk-border-radius-xl;
80
+ }
@@ -0,0 +1,79 @@
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 'tokens.scss';
22
+
23
+ ////
24
+ /// @group scroll-indicator
25
+ ////
26
+
27
+ /// Scroll indicator utility.
28
+ ///
29
+ /// @access private
30
+
31
+ @mixin _bpk-scroll-indicator($gradient-color, $direction: 'left') {
32
+ $gradient-direction: if($direction == 'left', 90deg, 270deg);
33
+
34
+ position: absolute;
35
+ top: 0;
36
+ bottom: 0;
37
+ content: ' ';
38
+ display: block;
39
+ z-index: 1;
40
+ width: tokens.bpk-spacing-xl();
41
+ background-image: linear-gradient(
42
+ $gradient-direction,
43
+ rgba($gradient-color, 1),
44
+ rgba($gradient-color, 0)
45
+ );
46
+ pointer-events: none;
47
+
48
+ @if $direction == 'left' {
49
+ left: 0;
50
+ } @else {
51
+ right: 0;
52
+ }
53
+ }
54
+
55
+ /// Left-sided scroll indicator.
56
+ ///
57
+ /// @example scss
58
+ /// .selector {
59
+ /// @include bpk-scroll-indicator-left($bpk-color-grey-100);
60
+ /// }
61
+
62
+ @mixin bpk-scroll-indicator-left($gradient-color) {
63
+ &::before {
64
+ @include _bpk-scroll-indicator($gradient-color, 'left');
65
+ }
66
+ }
67
+
68
+ /// Right-sided scroll indicator.
69
+ ///
70
+ /// @example scss
71
+ /// .selector {
72
+ /// @include bpk-scroll-indicator-right($bpk-color-grey-100);
73
+ /// }
74
+
75
+ @mixin bpk-scroll-indicator-right($gradient-color) {
76
+ &::after {
77
+ @include _bpk-scroll-indicator($gradient-color, 'right');
78
+ }
79
+ }
@@ -0,0 +1,58 @@
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 'tokens.scss';
22
+
23
+ ////
24
+ /// @group box-shadows
25
+ ////
26
+
27
+ /// Small box shadow.
28
+ ///
29
+ /// @example scss
30
+ /// .selector {
31
+ /// @include bpk-box-shadow-sm();
32
+ /// }
33
+
34
+ @mixin bpk-box-shadow-sm {
35
+ box-shadow: tokens.$bpk-box-shadow-sm;
36
+ }
37
+
38
+ /// Large box shadow.
39
+ ///
40
+ /// @example scss
41
+ /// .selector {
42
+ /// @include bpk-box-shadow-lg();
43
+ /// }
44
+
45
+ @mixin bpk-box-shadow-lg {
46
+ box-shadow: tokens.$bpk-box-shadow-lg;
47
+ }
48
+
49
+ /// Extra large box shadow.
50
+ ///
51
+ /// @example scss
52
+ /// .selector {
53
+ /// @include bpk-box-shadow-xl();
54
+ /// }
55
+
56
+ @mixin bpk-box-shadow-xl {
57
+ box-shadow: tokens.$bpk-box-shadow-xl;
58
+ }