@skyscanner/backpack-web 31.10.1 → 32.0.1

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.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.js +2 -2
  156. package/bpk-stylesheets/index.scss +13 -11
  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,568 @@
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 'typography.scss';
23
+ @use 'utils.scss';
24
+
25
+ ////
26
+ /// @group buttons
27
+ ////
28
+
29
+ /// Standard button.
30
+ ///
31
+ /// @example scss
32
+ /// .selector {
33
+ /// @include bpk-button();
34
+ /// }
35
+
36
+ @mixin bpk-button {
37
+ display: inline-block;
38
+ min-height: tokens.$bpk-button-height;
39
+ margin: 0;
40
+ padding: (6 * tokens.$bpk-one-pixel-rem) tokens.bpk-spacing-base();
41
+ border: 0;
42
+ border-radius: tokens.$bpk-button-border-radius;
43
+ text-align: center;
44
+ text-decoration: none;
45
+ cursor: pointer;
46
+ vertical-align: middle;
47
+ user-select: none;
48
+
49
+ @include typography.bpk-label-1;
50
+ @include utils.bpk-themeable-property(
51
+ color,
52
+ --bpk-button-primary-text-color,
53
+ tokens.$bpk-text-on-dark-day
54
+ );
55
+ @include utils.bpk-themeable-property(
56
+ background-color,
57
+ --bpk-button-primary-background-color,
58
+ tokens.$bpk-private-button-primary-normal-background-day
59
+ );
60
+
61
+ @include utils.bpk-hover {
62
+ @include utils.bpk-themeable-property(
63
+ color,
64
+ --bpk-button-primary-hover-text-color,
65
+ tokens.$bpk-text-on-dark-day
66
+ );
67
+ @include utils.bpk-themeable-property(
68
+ background-color,
69
+ --bpk-button-primary-hover-background-color,
70
+ tokens.$bpk-private-button-primary-pressed-background-day
71
+ );
72
+ }
73
+
74
+ &:active {
75
+ @include utils.bpk-themeable-property(
76
+ color,
77
+ --bpk-button-primary-active-text-color,
78
+ tokens.$bpk-text-on-dark-day
79
+ );
80
+ @include utils.bpk-themeable-property(
81
+ background-color,
82
+ --bpk-button-primary-active-background-color,
83
+ tokens.$bpk-private-button-primary-pressed-background-day
84
+ );
85
+ }
86
+
87
+ &:disabled {
88
+ background-color: tokens.$bpk-private-button-disabled-background-day;
89
+ color: tokens.$bpk-text-disabled-day;
90
+ cursor: not-allowed;
91
+ }
92
+ }
93
+
94
+ /// Large button. Modifies the bpk-button mixin.
95
+ ///
96
+ /// @require {mixin} bpk-button
97
+ ///
98
+ /// @example scss
99
+ /// .selector {
100
+ /// @include bpk-button();
101
+ /// @include bpk-button--large();
102
+ /// }
103
+
104
+ @mixin bpk-button--large {
105
+ min-height: tokens.$bpk-button-large-height;
106
+ padding: (12 * tokens.$bpk-one-pixel-rem) tokens.bpk-spacing-base();
107
+ }
108
+
109
+ /// PrimaryOnDark button. Modifies the bpk-button mixin.
110
+ ///
111
+ /// @require {mixin} bpk-button
112
+ ///
113
+ /// @example scss
114
+ /// .selector {
115
+ /// @include bpk-button();
116
+ /// @include bpk-button--primary-on-dark();
117
+ /// }
118
+
119
+ @mixin bpk-button--primary-on-dark {
120
+ @include utils.bpk-themeable-property(
121
+ color,
122
+ --bpk-button-primary-on-dark-text-color,
123
+ tokens.$bpk-text-on-light-day
124
+ );
125
+ @include utils.bpk-themeable-property(
126
+ background-color,
127
+ --bpk-button-primary-on-dark-background-color,
128
+ tokens.$bpk-private-button-primary-on-dark-normal-background-day
129
+ );
130
+
131
+ @include utils.bpk-hover {
132
+ @include utils.bpk-themeable-property(
133
+ color,
134
+ --bpk-button-primary-on-dark-hover-text-color,
135
+ tokens.$bpk-text-on-light-day
136
+ );
137
+ @include utils.bpk-themeable-property(
138
+ background-color,
139
+ --bpk-button-primary-on-dark-hover-background-color,
140
+ tokens.$bpk-private-button-primary-on-dark-pressed-background-day
141
+ );
142
+ }
143
+
144
+ &:active {
145
+ @include utils.bpk-themeable-property(
146
+ color,
147
+ --bpk-button-primary-on-dark-active-text-color,
148
+ tokens.$bpk-text-on-light-day
149
+ );
150
+ @include utils.bpk-themeable-property(
151
+ background-color,
152
+ --bpk-button-primary-on-dark-active-background-color,
153
+ tokens.$bpk-private-button-primary-on-dark-pressed-background-day
154
+ );
155
+ }
156
+
157
+ &:disabled {
158
+ background-color: tokens.$bpk-private-button-primary-on-dark-disabled-background-day;
159
+ color: tokens.$bpk-private-button-primary-on-dark-disabled-foreground-day;
160
+ }
161
+ }
162
+
163
+ /// PrimaryOnLight button. Modifies the bpk-button mixin.
164
+ ///
165
+ /// @require {mixin} bpk-button
166
+ ///
167
+ /// @example scss
168
+ /// .selector {
169
+ /// @include bpk-button();
170
+ /// @include bpk-button--primary-on-light();
171
+ /// }
172
+
173
+ @mixin bpk-button--primary-on-light {
174
+ @include utils.bpk-themeable-property(
175
+ color,
176
+ --bpk-button-primary-on-light-text-color,
177
+ tokens.$bpk-text-on-dark-night
178
+ );
179
+ @include utils.bpk-themeable-property(
180
+ background-color,
181
+ --bpk-button-primary-on-light-background-color,
182
+ tokens.$bpk-private-button-primary-on-light-normal-background-day
183
+ );
184
+
185
+ @include utils.bpk-hover {
186
+ @include utils.bpk-themeable-property(
187
+ color,
188
+ --bpk-button-primary-on-light-hover-text-color,
189
+ tokens.$bpk-text-on-dark-night
190
+ );
191
+ @include utils.bpk-themeable-property(
192
+ background-color,
193
+ --bpk-button-primary-on-light-hover-background-color,
194
+ tokens.$bpk-private-button-primary-on-light-pressed-background-day
195
+ );
196
+ }
197
+
198
+ &:active {
199
+ @include utils.bpk-themeable-property(
200
+ color,
201
+ --bpk-button-primary-on-light-active-text-color,
202
+ tokens.$bpk-text-on-dark-night
203
+ );
204
+ @include utils.bpk-themeable-property(
205
+ background-color,
206
+ --bpk-button-primary-on-light-active-background-color,
207
+ tokens.$bpk-private-button-primary-on-light-pressed-background-day
208
+ );
209
+ }
210
+
211
+ &:disabled {
212
+ background-color: tokens.$bpk-private-button-primary-on-light-disabled-background-day;
213
+ color: tokens.$bpk-private-button-primary-on-light-disabled-foreground-day;
214
+ }
215
+ }
216
+
217
+ /// Secondary button. Modifies the bpk-button mixin.
218
+ ///
219
+ /// @require {mixin} bpk-button
220
+ ///
221
+ /// @example scss
222
+ /// .selector {
223
+ /// @include bpk-button();
224
+ /// @include bpk-button--secondary();
225
+ /// }
226
+
227
+ @mixin bpk-button--secondary {
228
+ @include utils.bpk-themeable-property(
229
+ color,
230
+ --bpk-button-secondary-text-color,
231
+ tokens.$bpk-text-primary-day
232
+ );
233
+ @include utils.bpk-themeable-property(
234
+ background-color,
235
+ --bpk-button-secondary-background-color,
236
+ tokens.$bpk-private-button-secondary-normal-background-day
237
+ );
238
+
239
+ @include utils.bpk-hover {
240
+ @include utils.bpk-themeable-property(
241
+ color,
242
+ --bpk-button-secondary-hover-text-color,
243
+ tokens.$bpk-text-primary-day
244
+ );
245
+ @include utils.bpk-themeable-property(
246
+ background-color,
247
+ --bpk-button-secondary-hover-background-color,
248
+ tokens.$bpk-private-button-secondary-pressed-background-day
249
+ );
250
+ }
251
+
252
+ &:active {
253
+ @include utils.bpk-themeable-property(
254
+ color,
255
+ --bpk-button-secondary-active-text-color,
256
+ tokens.$bpk-text-primary-day
257
+ );
258
+ @include utils.bpk-themeable-property(
259
+ background-color,
260
+ --bpk-button-secondary-active-background-color,
261
+ tokens.$bpk-private-button-secondary-pressed-background-day
262
+ );
263
+ }
264
+
265
+ &:disabled {
266
+ background-color: tokens.$bpk-private-button-disabled-background-day;
267
+ color: tokens.$bpk-text-disabled-day;
268
+ }
269
+ }
270
+
271
+ /// Secondary on dark button. Modifies the bpk-button mixin.
272
+ ///
273
+ /// @require {mixin} bpk-button
274
+ ///
275
+ /// @example scss
276
+ /// .selector {
277
+ /// @include bpk-button();
278
+ /// @include bpk-button--secondary-on-dark();
279
+ /// }
280
+
281
+ @mixin bpk-button--secondary-on-dark {
282
+ @include utils.bpk-themeable-property(
283
+ color,
284
+ --bpk-button-secondary-on-dark-text-color,
285
+ tokens.$bpk-text-on-dark-day
286
+ );
287
+ @include utils.bpk-themeable-property(
288
+ background-color,
289
+ --bpk-button-secondary-on-dark-background-color,
290
+ tokens.$bpk-private-button-secondary-on-dark-normal-background-day
291
+ );
292
+
293
+ @include utils.bpk-hover {
294
+ @include utils.bpk-themeable-property(
295
+ color,
296
+ --bpk-button-secondary-on-dark-hover-text-color,
297
+ tokens.$bpk-text-on-dark-day
298
+ );
299
+ @include utils.bpk-themeable-property(
300
+ background-color,
301
+ --bpk-button-secondary-on-dark-hover-background-color,
302
+ tokens.$bpk-private-button-secondary-on-dark-pressed-background-day
303
+ );
304
+ }
305
+
306
+ &:active {
307
+ @include utils.bpk-themeable-property(
308
+ color,
309
+ --bpk-button-secondary-on-dark-active-text-color,
310
+ tokens.$bpk-text-on-dark-day
311
+ );
312
+ @include utils.bpk-themeable-property(
313
+ background-color,
314
+ --bpk-button-secondary-on-dark-active-background-color,
315
+ tokens.$bpk-private-button-secondary-on-dark-pressed-background-day
316
+ );
317
+ }
318
+
319
+ &:disabled {
320
+ background-color: tokens.$bpk-private-button-secondary-on-dark-disabled-background-day;
321
+ color: tokens.$bpk-private-button-secondary-on-dark-disabled-foreground-day;
322
+ }
323
+ }
324
+
325
+ /// Destructive button. Modifies the bpk-button & bpk-button--secondary lib.
326
+ ///
327
+ /// @require {mixin} bpk-button
328
+ /// @require {mixin} bpk-button--secondary
329
+ ///
330
+ /// @example scss
331
+ /// .selector {
332
+ /// @include bpk-button();
333
+ /// @include bpk-button--secondary();
334
+ /// @include bpk-button--destructive();
335
+ /// }
336
+
337
+ @mixin bpk-button--destructive {
338
+ @include utils.bpk-themeable-property(
339
+ color,
340
+ --bpk-button-destructive-text-color,
341
+ tokens.$bpk-private-button-destructive-normal-foreground-day
342
+ );
343
+ @include utils.bpk-themeable-property(
344
+ background-color,
345
+ --bpk-button-destructive-background-color,
346
+ tokens.$bpk-private-button-destructive-normal-background-day
347
+ );
348
+
349
+ @include utils.bpk-hover {
350
+ @include utils.bpk-themeable-property(
351
+ color,
352
+ --bpk-button-destructive-hover-text-color,
353
+ tokens.$bpk-text-primary-inverse-day
354
+ );
355
+ @include utils.bpk-themeable-property(
356
+ background-color,
357
+ --bpk-button-destructive-hover-background-color,
358
+ tokens.$bpk-private-button-destructive-pressed-background-day
359
+ );
360
+ }
361
+
362
+ &:active {
363
+ @include utils.bpk-themeable-property(
364
+ color,
365
+ --bpk-button-destructive-active-text-color,
366
+ tokens.$bpk-text-primary-inverse-day
367
+ );
368
+ @include utils.bpk-themeable-property(
369
+ background-color,
370
+ --bpk-button-destructive-active-background-color,
371
+ tokens.$bpk-private-button-destructive-pressed-background-day
372
+ );
373
+ }
374
+
375
+ &:disabled {
376
+ background-color: tokens.$bpk-private-button-disabled-background-day;
377
+ color: tokens.$bpk-text-disabled-day;
378
+ }
379
+ }
380
+
381
+ /// Link-style button. Modifies the bpk-button mixin.
382
+ ///
383
+ /// @require {mixin} bpk-button
384
+ ///
385
+ /// @example scss
386
+ /// .selector {
387
+ /// @include bpk-button();
388
+ /// @include bpk-button--link();
389
+ /// }
390
+
391
+ @mixin bpk-button--link {
392
+ $vertical-padding: tokens.$bpk-one-pixel-rem * 6;
393
+ $vertical-padding-large: tokens.$bpk-one-pixel-rem * 12;
394
+
395
+ background: none; /* stylelint-disable-line order/order, order/properties-order */
396
+ box-shadow: none;
397
+
398
+ @include typography.bpk-link;
399
+
400
+ padding: $vertical-padding 0; /* stylelint-disable-line order/order, order/properties-order */
401
+ color: tokens.$bpk-private-button-link-normal-foreground-day;
402
+
403
+ @include utils.bpk-hover {
404
+ background: none;
405
+ color: tokens.$bpk-private-button-link-pressed-foreground-day;
406
+ text-decoration: none;
407
+ }
408
+
409
+ &:active {
410
+ background: none;
411
+ color: tokens.$bpk-private-button-link-pressed-foreground-day;
412
+ text-decoration: none;
413
+ }
414
+
415
+ &:disabled {
416
+ background: none;
417
+ color: tokens.$bpk-text-disabled-day;
418
+ text-decoration: none;
419
+ }
420
+
421
+ &-large {
422
+ padding: $vertical-padding-large 0;
423
+ }
424
+ }
425
+
426
+ /// Link on dark button. Modifies the bpk-button & bpk-button--link lib.
427
+ ///
428
+ /// @require {mixin} bpk-button
429
+
430
+ /// @example scss
431
+ /// .selector {
432
+ /// @include bpk-button();
433
+ /// @include bpk-button--link-on-dark();
434
+ /// }
435
+
436
+ @mixin bpk-button--link-on-dark {
437
+ @include bpk-button--link;
438
+ @include utils.bpk-themeable-property(
439
+ color,
440
+ --bpk-button-link-on-dark-text-color,
441
+ tokens.$bpk-private-button-link-on-dark-normal-foreground-day
442
+ );
443
+
444
+ @include utils.bpk-hover {
445
+ @include utils.bpk-themeable-property(
446
+ color,
447
+ --bpk-button-link-on-dark-hover-text-color,
448
+ tokens.$bpk-private-button-link-on-dark-pressed-foreground-day
449
+ );
450
+ }
451
+
452
+ &:active {
453
+ @include utils.bpk-themeable-property(
454
+ color,
455
+ --bpk-button-link-on-dark-active-text-color,
456
+ tokens.$bpk-private-button-link-on-dark-pressed-foreground-day
457
+ );
458
+ }
459
+
460
+ &:visited {
461
+ @include utils.bpk-themeable-property(
462
+ color,
463
+ --bpk-button-link-on-dark-text-color,
464
+ tokens.$bpk-private-button-link-on-dark-normal-foreground-day
465
+ );
466
+ }
467
+
468
+ &:disabled {
469
+ @include utils.bpk-themeable-property(
470
+ color,
471
+ --bpk-button-link-on-dark-disabled-color,
472
+ tokens.$bpk-private-button-link-on-dark-disabled-foreground-day
473
+ );
474
+ }
475
+ }
476
+
477
+ /// Icon-only button. Modifies the bpk-button mixin.
478
+ ///
479
+ /// @require {mixin} bpk-button
480
+ ///
481
+ /// @example scss
482
+ /// .selector {
483
+ /// @include bpk-button();
484
+ /// @include bpk-button--icon-only();
485
+ /// }
486
+
487
+ @mixin bpk-button--icon-only {
488
+ $horizontal-padding: (tokens.$bpk-button-height - tokens.$bpk-icon-size-sm) * 0.5; // extra padding so that the width will be the same size as the size using sm icons
489
+
490
+ padding-right: $horizontal-padding;
491
+ padding-left: $horizontal-padding;
492
+ border-radius: tokens.$bpk-button-border-radius;
493
+ }
494
+
495
+ /// Large icon-only button. Modifies the bpk-button & bpk-button--large lib.
496
+ ///
497
+ /// @require {mixin} bpk-button
498
+ /// @require {mixin} bpk-button--large
499
+ ///
500
+ /// @example scss
501
+ /// .selector {
502
+ /// @include bpk-button();
503
+ /// @include bpk-button--large();
504
+ /// @include bpk-button--large-icon-only();
505
+ /// }
506
+
507
+ @mixin bpk-button--large-icon-only {
508
+ $horizontal-padding: (tokens.$bpk-button-large-height - tokens.$bpk-icon-size-lg) * 0.5; // extra padding so that the width will be the same size as the size using lg icons
509
+
510
+ padding-right: $horizontal-padding;
511
+ padding-left: $horizontal-padding;
512
+ border-radius: tokens.$bpk-button-border-radius;
513
+ }
514
+
515
+ /// Featured button. Modifies the bpk-button
516
+ ///
517
+ /// @require {mixin} bpk-button
518
+ /// @require {mixin} bpk-button--large
519
+ ///
520
+ /// @example scss
521
+ /// .selector {
522
+ /// @include bpk-button();
523
+ /// @include bpk-button--featured();
524
+ /// }
525
+
526
+ @mixin bpk-button--featured {
527
+ @include utils.bpk-themeable-property(
528
+ color,
529
+ --bpk-button-featured-text-color,
530
+ tokens.$bpk-text-primary-inverse-day
531
+ );
532
+ @include utils.bpk-themeable-property(
533
+ background-color,
534
+ --bpk-button-featured-background-color,
535
+ tokens.$bpk-private-button-featured-normal-background-day
536
+ );
537
+
538
+ @include utils.bpk-hover {
539
+ @include utils.bpk-themeable-property(
540
+ color,
541
+ --bpk-button-featured-hover-text-color,
542
+ tokens.$bpk-text-primary-inverse-day
543
+ );
544
+ @include utils.bpk-themeable-property(
545
+ background-color,
546
+ --bpk-button-featured-hover-background-color,
547
+ tokens.$bpk-private-button-featured-pressed-background-day
548
+ );
549
+ }
550
+
551
+ &:active {
552
+ @include utils.bpk-themeable-property(
553
+ color,
554
+ --bpk-button-featured-active-text-color,
555
+ tokens.$bpk-text-primary-inverse-day
556
+ );
557
+ @include utils.bpk-themeable-property(
558
+ background-color,
559
+ --bpk-button-featured-active-background-color,
560
+ tokens.$bpk-private-button-featured-pressed-background-day
561
+ );
562
+ }
563
+
564
+ &:disabled {
565
+ background-color: tokens.$bpk-private-button-disabled-background-day;
566
+ color: tokens.$bpk-text-disabled-day;
567
+ }
568
+ }
@@ -0,0 +1,94 @@
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 cards
28
+ ////
29
+
30
+ /// Basic card.
31
+ ///
32
+ /// @example scss
33
+ /// .selector {
34
+ /// @include bpk-card();
35
+ /// }
36
+
37
+ @mixin bpk-card {
38
+ position: relative;
39
+ display: block;
40
+ background-color: tokens.$bpk-card-background-color;
41
+ color: tokens.$bpk-text-primary-day;
42
+ text-decoration: none;
43
+ cursor: pointer;
44
+
45
+ @include shadows.bpk-box-shadow-sm;
46
+ @include radii.bpk-border-radius-md;
47
+
48
+ @include utils.bpk-hover {
49
+ &::after {
50
+ opacity: 1;
51
+ }
52
+ }
53
+
54
+ // Keep transitions and animations to only transform and opacity.
55
+ // This pseudo element solution allows us to animate box-shadow in a performant manner.
56
+ // http://tobiasahlin.com/blog/how-to-animate-box-shadow/
57
+ &::after {
58
+ position: absolute;
59
+ top: 0;
60
+ right: 0;
61
+ bottom: 0;
62
+ left: 0;
63
+ content: '';
64
+ transition: opacity tokens.$bpk-duration-sm ease-in-out;
65
+ opacity: 0;
66
+ pointer-events: none; // To prevent the pseudo element absorbing click events
67
+
68
+ @include shadows.bpk-box-shadow-lg;
69
+ @include radii.bpk-border-radius-md;
70
+
71
+ // pointer-events doesn't work on ie
72
+ @media screen\0 {
73
+ z-index: -1;
74
+ }
75
+ }
76
+
77
+ &:active::after {
78
+ box-shadow: none;
79
+ }
80
+ }
81
+
82
+ /// Adds padding to cards. Modifies the bpk-card mixin.
83
+ ///
84
+ /// @require {mixin} bpk-card
85
+ ///
86
+ /// @example scss
87
+ /// .selector {
88
+ /// @include bpk-card();
89
+ /// @include bpk-card--padded();
90
+ /// }
91
+
92
+ @mixin bpk-card--padded {
93
+ padding: tokens.$bpk-card-padding;
94
+ }