@skyscanner/backpack-web 42.0.0-test → 42.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.
- package/bpk-component-button/index.d.ts +3 -3
- package/bpk-component-button/index.js +3 -3
- package/bpk-component-button/src/BpkButton.d.ts +3 -0
- package/bpk-component-button/src/{BpkButton/BpkButton.js → BpkButton.js} +39 -7
- package/bpk-component-button/src/BpkButton.module.css +18 -0
- package/bpk-component-button/src/{BpkButton/common-types.d.ts → common-types.d.ts} +2 -0
- package/bpk-component-button/src/themeAttributes.d.ts +1 -0
- package/bpk-component-button/src/themeAttributes.js +2 -1
- package/bpk-component-chip/index.d.ts +2 -2
- package/bpk-component-chip/index.js +2 -2
- package/bpk-component-chip/src/BpkSelectableChip.module.css +1 -1
- package/bpk-component-chip/src/themeAttributes.d.ts +4 -0
- package/bpk-component-chip/src/themeAttributes.js +7 -1
- package/bpk-component-pagination/src/BpkPaginationPage.module.css +1 -1
- package/bpk-component-scrollable-calendar/src/utils.d.ts +1 -1
- package/bpk-component-segmented-control/index.d.ts +2 -0
- package/bpk-component-segmented-control/index.js +2 -1
- package/bpk-component-segmented-control/src/BpkSegmentedControlV2/BpkSegmentedControlV2.d.ts +19 -0
- package/bpk-component-segmented-control/src/BpkSegmentedControlV2/BpkSegmentedControlV2.js +81 -0
- package/bpk-component-segmented-control/src/BpkSegmentedControlV2/BpkSegmentedControlV2.module.css +18 -0
- package/bpk-component-segmented-control/src/BpkSegmentedControlV2/common-types.d.ts +57 -0
- package/bpk-component-segmented-control/src/BpkSegmentedControlV2/common-types.js +24 -0
- package/bpk-component-table/index.d.ts +13 -0
- package/bpk-component-table/index.js +3 -1
- package/bpk-component-table/src/BpkTable.d.ts +8 -0
- package/bpk-component-table/src/BpkTable.js +7 -14
- package/bpk-component-table/src/BpkTableBody.d.ts +7 -0
- package/bpk-component-table/src/BpkTableBody.js +3 -5
- package/bpk-component-table/src/BpkTableCell.d.ts +9 -0
- package/bpk-component-table/src/BpkTableCell.js +7 -15
- package/bpk-component-table/src/BpkTableHead.d.ts +7 -0
- package/bpk-component-table/src/BpkTableHead.js +3 -5
- package/bpk-component-table/src/BpkTableHeadCell.d.ts +9 -0
- package/bpk-component-table/src/BpkTableHeadCell.js +2 -6
- package/bpk-component-table/src/BpkTableRow.d.ts +7 -0
- package/bpk-component-table/src/BpkTableRow.js +3 -5
- package/bpk-mixins/_buttons.scss +168 -76
- package/bpk-mixins/_chips.scss +104 -18
- package/bpk-mixins/_index.scss +1 -0
- package/bpk-mixins/_segmented-control.scss +263 -0
- package/package.json +2 -1
- package/bpk-component-button/src/BpkButton/BpkButton.d.ts +0 -3
- package/bpk-component-button/src/BpkButton/BpkButton.module.css +0 -18
- /package/bpk-component-button/src/{BpkButton/common-types.js → common-types.js} +0 -0
package/bpk-mixins/_chips.scss
CHANGED
|
@@ -24,15 +24,29 @@
|
|
|
24
24
|
@use 'shadows';
|
|
25
25
|
@use 'utils';
|
|
26
26
|
|
|
27
|
+
// Private helper: applies a box-shadow border with CSS variable fallback.
|
|
28
|
+
// bpk-border-sm() uses a box-shadow shorthand, so bpk-themeable-property cannot
|
|
29
|
+
// embed a CSS variable inside it — this mixin applies the two-line fallback pattern manually.
|
|
30
|
+
@mixin _bpk-chip-themeable-border($var-name, $fallback-color) {
|
|
31
|
+
box-shadow: 0 0 0 tokens.$bpk-border-size-sm $fallback-color inset;
|
|
32
|
+
box-shadow: 0 0 0 tokens.$bpk-border-size-sm
|
|
33
|
+
var(#{$var-name}, $fallback-color) inset;
|
|
34
|
+
}
|
|
35
|
+
|
|
27
36
|
@mixin bpk-chip {
|
|
28
37
|
display: inline-flex;
|
|
29
38
|
height: tokens.bpk-spacing-xl();
|
|
30
39
|
padding: 0 tokens.bpk-spacing-base();
|
|
31
40
|
align-items: center;
|
|
32
41
|
border: none;
|
|
33
|
-
border-radius: tokens.$bpk-border-radius-xs * 2;
|
|
34
42
|
cursor: pointer;
|
|
35
43
|
|
|
44
|
+
@include utils.bpk-themeable-property(
|
|
45
|
+
border-radius,
|
|
46
|
+
--bpk-chip-border-radius,
|
|
47
|
+
tokens.$bpk-border-radius-sm
|
|
48
|
+
);
|
|
49
|
+
|
|
36
50
|
&__leading-accessory-view {
|
|
37
51
|
display: inline-flex;
|
|
38
52
|
fill: currentcolor;
|
|
@@ -49,17 +63,33 @@
|
|
|
49
63
|
}
|
|
50
64
|
|
|
51
65
|
&--on-dark {
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
66
|
+
@include utils.bpk-themeable-property(
|
|
67
|
+
background-color,
|
|
68
|
+
--bpk-chip-on-dark-background-color,
|
|
69
|
+
transparent
|
|
70
|
+
);
|
|
71
|
+
@include utils.bpk-themeable-property(
|
|
72
|
+
color,
|
|
73
|
+
--bpk-chip-on-dark-text-color,
|
|
74
|
+
tokens.$bpk-text-on-dark-day
|
|
75
|
+
);
|
|
76
|
+
@include _bpk-chip-themeable-border(
|
|
77
|
+
--bpk-chip-on-dark-border-color,
|
|
78
|
+
tokens.$bpk-line-on-dark-day
|
|
79
|
+
);
|
|
56
80
|
|
|
57
81
|
@include utils.bpk-hover {
|
|
58
|
-
@include
|
|
82
|
+
@include _bpk-chip-themeable-border(
|
|
83
|
+
--bpk-chip-on-dark-hover-border-color,
|
|
84
|
+
tokens.$bpk-surface-default-day
|
|
85
|
+
);
|
|
59
86
|
}
|
|
60
87
|
|
|
61
88
|
&:active:not(:disabled) {
|
|
62
|
-
@include
|
|
89
|
+
@include _bpk-chip-themeable-border(
|
|
90
|
+
--bpk-chip-on-dark-active-border-color,
|
|
91
|
+
tokens.$bpk-surface-default-day
|
|
92
|
+
);
|
|
63
93
|
}
|
|
64
94
|
|
|
65
95
|
&-selected {
|
|
@@ -76,10 +106,20 @@
|
|
|
76
106
|
@include borders.bpk-border-sm(transparent);
|
|
77
107
|
|
|
78
108
|
@include utils.bpk-hover {
|
|
109
|
+
@include utils.bpk-themeable-property(
|
|
110
|
+
background-color,
|
|
111
|
+
--bpk-chip-on-dark-selected-hover-background-color,
|
|
112
|
+
tokens.$bpk-surface-default-day
|
|
113
|
+
);
|
|
79
114
|
@include borders.bpk-border-sm(transparent);
|
|
80
115
|
}
|
|
81
116
|
|
|
82
117
|
&:active:not(:disabled) {
|
|
118
|
+
@include utils.bpk-themeable-property(
|
|
119
|
+
background-color,
|
|
120
|
+
--bpk-chip-on-dark-selected-active-background-color,
|
|
121
|
+
tokens.$bpk-surface-default-day
|
|
122
|
+
);
|
|
83
123
|
@include borders.bpk-border-sm(transparent);
|
|
84
124
|
}
|
|
85
125
|
}
|
|
@@ -108,17 +148,38 @@
|
|
|
108
148
|
}
|
|
109
149
|
|
|
110
150
|
&--default {
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
151
|
+
@include utils.bpk-themeable-property(
|
|
152
|
+
background-color,
|
|
153
|
+
--bpk-chip-default-background-color,
|
|
154
|
+
transparent
|
|
155
|
+
);
|
|
156
|
+
@include utils.bpk-themeable-property(
|
|
157
|
+
color,
|
|
158
|
+
--bpk-chip-default-text-color,
|
|
159
|
+
tokens.$bpk-text-primary-day
|
|
160
|
+
);
|
|
161
|
+
@include _bpk-chip-themeable-border(
|
|
162
|
+
--bpk-chip-default-border-color,
|
|
163
|
+
tokens.$bpk-line-day
|
|
164
|
+
);
|
|
115
165
|
|
|
116
166
|
@include utils.bpk-hover {
|
|
117
|
-
@include
|
|
167
|
+
@include utils.bpk-themeable-property(
|
|
168
|
+
background-color,
|
|
169
|
+
--bpk-chip-default-hover-background-color,
|
|
170
|
+
transparent
|
|
171
|
+
);
|
|
172
|
+
@include _bpk-chip-themeable-border(
|
|
173
|
+
--bpk-chip-default-hover-border-color,
|
|
174
|
+
tokens.$bpk-core-primary-day
|
|
175
|
+
);
|
|
118
176
|
}
|
|
119
177
|
|
|
120
178
|
&:active:not(:disabled) {
|
|
121
|
-
@include
|
|
179
|
+
@include _bpk-chip-themeable-border(
|
|
180
|
+
--bpk-chip-default-active-border-color,
|
|
181
|
+
tokens.$bpk-core-primary-day
|
|
182
|
+
);
|
|
122
183
|
}
|
|
123
184
|
|
|
124
185
|
&-selected {
|
|
@@ -135,10 +196,20 @@
|
|
|
135
196
|
@include borders.bpk-border-sm(transparent);
|
|
136
197
|
|
|
137
198
|
@include utils.bpk-hover {
|
|
199
|
+
@include utils.bpk-themeable-property(
|
|
200
|
+
background-color,
|
|
201
|
+
--bpk-chip-default-selected-hover-background-color,
|
|
202
|
+
tokens.$bpk-core-primary-day
|
|
203
|
+
);
|
|
138
204
|
@include borders.bpk-border-sm(transparent);
|
|
139
205
|
}
|
|
140
206
|
|
|
141
207
|
&:active:not(:disabled) {
|
|
208
|
+
@include utils.bpk-themeable-property(
|
|
209
|
+
background-color,
|
|
210
|
+
--bpk-chip-default-selected-active-background-color,
|
|
211
|
+
tokens.$bpk-core-primary-day
|
|
212
|
+
);
|
|
142
213
|
@include borders.bpk-border-sm(transparent);
|
|
143
214
|
}
|
|
144
215
|
}
|
|
@@ -167,17 +238,32 @@
|
|
|
167
238
|
}
|
|
168
239
|
|
|
169
240
|
&--on-image {
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
241
|
+
@include utils.bpk-themeable-property(
|
|
242
|
+
background-color,
|
|
243
|
+
--bpk-chip-on-image-background-color,
|
|
244
|
+
tokens.$bpk-surface-default-day
|
|
245
|
+
);
|
|
246
|
+
@include utils.bpk-themeable-property(
|
|
247
|
+
color,
|
|
248
|
+
--bpk-chip-on-image-text-color,
|
|
249
|
+
tokens.$bpk-text-primary-day
|
|
250
|
+
);
|
|
173
251
|
@include shadows.bpk-box-shadow-sm;
|
|
174
252
|
|
|
175
253
|
@include utils.bpk-hover {
|
|
176
|
-
|
|
254
|
+
@include utils.bpk-themeable-property(
|
|
255
|
+
background-color,
|
|
256
|
+
--bpk-chip-on-image-hover-background-color,
|
|
257
|
+
tokens.$bpk-canvas-contrast-day
|
|
258
|
+
);
|
|
177
259
|
}
|
|
178
260
|
|
|
179
261
|
&:active:not(:disabled) {
|
|
180
|
-
|
|
262
|
+
@include utils.bpk-themeable-property(
|
|
263
|
+
background-color,
|
|
264
|
+
--bpk-chip-on-image-active-background-color,
|
|
265
|
+
tokens.$bpk-canvas-contrast-day
|
|
266
|
+
);
|
|
181
267
|
}
|
|
182
268
|
|
|
183
269
|
&-selected {
|
package/bpk-mixins/_index.scss
CHANGED
|
@@ -0,0 +1,263 @@
|
|
|
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';
|
|
22
|
+
@use 'typography';
|
|
23
|
+
@use 'utils';
|
|
24
|
+
@use 'shadows';
|
|
25
|
+
|
|
26
|
+
////
|
|
27
|
+
/// @group segmented-control-v2
|
|
28
|
+
////
|
|
29
|
+
|
|
30
|
+
/// Segmented control group container.
|
|
31
|
+
///
|
|
32
|
+
/// @example scss
|
|
33
|
+
/// .selector {
|
|
34
|
+
/// @include bpk-segmented-control-v2();
|
|
35
|
+
/// }
|
|
36
|
+
|
|
37
|
+
@mixin bpk-segmented-control-v2 {
|
|
38
|
+
position: relative;
|
|
39
|
+
display: grid;
|
|
40
|
+
grid-auto-columns: 1fr;
|
|
41
|
+
grid-auto-flow: column;
|
|
42
|
+
border-radius: tokens.$bpk-border-radius-sm;
|
|
43
|
+
background-color: tokens.$bpk-private-segmented-control-canvas-default-day;
|
|
44
|
+
overflow: hidden;
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
/// Canvas default type. Modifies the bpk-segmented-control-v2 mixin.
|
|
48
|
+
///
|
|
49
|
+
/// @require {mixin} bpk-segmented-control-v2
|
|
50
|
+
///
|
|
51
|
+
/// @example scss
|
|
52
|
+
/// .selector {
|
|
53
|
+
/// @include bpk-segmented-control-v2();
|
|
54
|
+
/// @include bpk-segmented-control-v2--canvas-default();
|
|
55
|
+
/// }
|
|
56
|
+
|
|
57
|
+
@mixin bpk-segmented-control-v2--canvas-default {
|
|
58
|
+
background-color: tokens.$bpk-private-segmented-control-canvas-default-day;
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/// Canvas contrast type. Modifies the bpk-segmented-control-v2 mixin.
|
|
62
|
+
///
|
|
63
|
+
/// @require {mixin} bpk-segmented-control-v2
|
|
64
|
+
///
|
|
65
|
+
/// @example scss
|
|
66
|
+
/// .selector {
|
|
67
|
+
/// @include bpk-segmented-control-v2();
|
|
68
|
+
/// @include bpk-segmented-control-v2--canvas-contrast();
|
|
69
|
+
/// }
|
|
70
|
+
|
|
71
|
+
@mixin bpk-segmented-control-v2--canvas-contrast {
|
|
72
|
+
background-color: tokens.$bpk-surface-default-day;
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
/// Surface default type. Modifies the bpk-segmented-control-v2 mixin.
|
|
76
|
+
///
|
|
77
|
+
/// @require {mixin} bpk-segmented-control-v2
|
|
78
|
+
///
|
|
79
|
+
/// @example scss
|
|
80
|
+
/// .selector {
|
|
81
|
+
/// @include bpk-segmented-control-v2();
|
|
82
|
+
/// @include bpk-segmented-control-v2--surface-default();
|
|
83
|
+
/// }
|
|
84
|
+
|
|
85
|
+
@mixin bpk-segmented-control-v2--surface-default {
|
|
86
|
+
background-color: tokens.$bpk-canvas-contrast-day;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
/// Surface contrast type. Modifies the bpk-segmented-control-v2 mixin.
|
|
90
|
+
///
|
|
91
|
+
/// @require {mixin} bpk-segmented-control-v2
|
|
92
|
+
///
|
|
93
|
+
/// @example scss
|
|
94
|
+
/// .selector {
|
|
95
|
+
/// @include bpk-segmented-control-v2();
|
|
96
|
+
/// @include bpk-segmented-control-v2--surface-contrast();
|
|
97
|
+
/// }
|
|
98
|
+
|
|
99
|
+
@mixin bpk-segmented-control-v2--surface-contrast {
|
|
100
|
+
background-color: tokens.$bpk-private-segmented-control-surface-contrast-day;
|
|
101
|
+
}
|
|
102
|
+
|
|
103
|
+
/// Adds a box shadow to the group container. Modifies the bpk-segmented-control-v2 mixin.
|
|
104
|
+
///
|
|
105
|
+
/// @require {mixin} bpk-segmented-control-v2
|
|
106
|
+
///
|
|
107
|
+
/// @example scss
|
|
108
|
+
/// .selector {
|
|
109
|
+
/// @include bpk-segmented-control-v2();
|
|
110
|
+
/// @include bpk-segmented-control-v2--shadow();
|
|
111
|
+
/// }
|
|
112
|
+
|
|
113
|
+
@mixin bpk-segmented-control-v2--shadow {
|
|
114
|
+
@include shadows.bpk-box-shadow-sm;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/// Visually hidden group label (satisfies aria-labelledby generated by Ark-UI).
|
|
118
|
+
///
|
|
119
|
+
/// @example scss
|
|
120
|
+
/// .selector {
|
|
121
|
+
/// @include bpk-segmented-control-v2__label();
|
|
122
|
+
/// }
|
|
123
|
+
|
|
124
|
+
@mixin bpk-segmented-control-v2__label {
|
|
125
|
+
@include utils.bpk-visually-hidden;
|
|
126
|
+
}
|
|
127
|
+
|
|
128
|
+
/// Segmented control item (label wrapper).
|
|
129
|
+
/// Creates a grid cell in the root grid, and a stacking context for ItemText + ItemControl.
|
|
130
|
+
///
|
|
131
|
+
/// @example scss
|
|
132
|
+
/// .selector {
|
|
133
|
+
/// @include bpk-segmented-control-v2__item();
|
|
134
|
+
/// }
|
|
135
|
+
|
|
136
|
+
@mixin bpk-segmented-control-v2__item {
|
|
137
|
+
display: grid;
|
|
138
|
+
cursor: pointer;
|
|
139
|
+
}
|
|
140
|
+
|
|
141
|
+
/// Segmented control item control (background layer, aria-hidden).
|
|
142
|
+
/// Sits behind ItemText via CSS grid stacking (grid-area: 1 / 1).
|
|
143
|
+
///
|
|
144
|
+
/// @example scss
|
|
145
|
+
/// .selector {
|
|
146
|
+
/// @include bpk-segmented-control-v2__item-control();
|
|
147
|
+
/// }
|
|
148
|
+
|
|
149
|
+
@mixin bpk-segmented-control-v2__item-control {
|
|
150
|
+
display: none;
|
|
151
|
+
}
|
|
152
|
+
|
|
153
|
+
/// Segmented control item text (content layer, visible to accessibility tree).
|
|
154
|
+
/// Sits above ItemControl via CSS grid stacking (grid-area: 1 / 1, z-index: 1).
|
|
155
|
+
///
|
|
156
|
+
/// @example scss
|
|
157
|
+
/// .selector {
|
|
158
|
+
/// @include bpk-segmented-control-v2__item-text();
|
|
159
|
+
/// }
|
|
160
|
+
|
|
161
|
+
@mixin bpk-segmented-control-v2__item-text {
|
|
162
|
+
display: flex;
|
|
163
|
+
z-index: 1;
|
|
164
|
+
min-height: tokens.bpk-spacing-xl();
|
|
165
|
+
|
|
166
|
+
// Content layer: stacked above item-control via shared grid-area
|
|
167
|
+
grid-area: 1 / 1;
|
|
168
|
+
justify-content: center;
|
|
169
|
+
align-items: center;
|
|
170
|
+
transition: color tokens.$bpk-duration-xs ease-in-out;
|
|
171
|
+
color: tokens.$bpk-text-primary-day;
|
|
172
|
+
overflow: hidden;
|
|
173
|
+
border-inline-start: tokens.$bpk-border-size-sm solid tokens.$bpk-line-day;
|
|
174
|
+
pointer-events: none;
|
|
175
|
+
|
|
176
|
+
@include typography.bpk-label-2;
|
|
177
|
+
|
|
178
|
+
// stylelint-disable-next-line selector-max-type
|
|
179
|
+
svg {
|
|
180
|
+
fill: currentcolor;
|
|
181
|
+
}
|
|
182
|
+
|
|
183
|
+
&[data-state='checked'] {
|
|
184
|
+
color: tokens.$bpk-text-on-dark-day;
|
|
185
|
+
}
|
|
186
|
+
}
|
|
187
|
+
|
|
188
|
+
/// Surface contrast item text colors. Modifies the bpk-segmented-control-v2__item-text mixin.
|
|
189
|
+
///
|
|
190
|
+
/// @require {mixin} bpk-segmented-control-v2__item-text
|
|
191
|
+
///
|
|
192
|
+
/// @example scss
|
|
193
|
+
/// .selector {
|
|
194
|
+
/// @include bpk-segmented-control-v2__item-text();
|
|
195
|
+
/// @include bpk-segmented-control-v2__item-text--surface-contrast();
|
|
196
|
+
/// }
|
|
197
|
+
|
|
198
|
+
@mixin bpk-segmented-control-v2__item-text--surface-contrast {
|
|
199
|
+
color: tokens.$bpk-text-on-dark-day;
|
|
200
|
+
border-inline-start-color: tokens.$bpk-line-on-dark-day;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/// Segmented control indicator (floating selection background, positioned by Ark-UI CSS variables).
|
|
204
|
+
/// Mirrors ItemControl visually but uses absolute positioning driven by --left/--top/--height
|
|
205
|
+
/// injected by Ark. --transition-duration is set to 0ms to prevent sliding animation.
|
|
206
|
+
///
|
|
207
|
+
/// @example scss
|
|
208
|
+
/// .selector {
|
|
209
|
+
/// @include bpk-segmented-control-v2__indicator();
|
|
210
|
+
/// }
|
|
211
|
+
|
|
212
|
+
@mixin bpk-segmented-control-v2__indicator {
|
|
213
|
+
position: absolute;
|
|
214
|
+
top: var(--top);
|
|
215
|
+
left: var(--left);
|
|
216
|
+
width: var(--width);
|
|
217
|
+
height: var(--height);
|
|
218
|
+
background-color: tokens.$bpk-core-primary-day;
|
|
219
|
+
|
|
220
|
+
--transition-duration: 0ms;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/// Canvas contrast indicator color. Modifies the bpk-segmented-control-v2__indicator mixin.
|
|
224
|
+
///
|
|
225
|
+
/// @require {mixin} bpk-segmented-control-v2__indicator
|
|
226
|
+
///
|
|
227
|
+
/// @example scss
|
|
228
|
+
/// .selector {
|
|
229
|
+
/// @include bpk-segmented-control-v2__indicator();
|
|
230
|
+
/// @include bpk-segmented-control-v2__indicator--canvas-contrast();
|
|
231
|
+
/// }
|
|
232
|
+
|
|
233
|
+
@mixin bpk-segmented-control-v2__indicator--canvas-contrast {
|
|
234
|
+
background-color: tokens.$bpk-surface-default-day;
|
|
235
|
+
}
|
|
236
|
+
|
|
237
|
+
/// Surface default indicator color. Modifies the bpk-segmented-control-v2__indicator mixin.
|
|
238
|
+
///
|
|
239
|
+
/// @require {mixin} bpk-segmented-control-v2__indicator
|
|
240
|
+
///
|
|
241
|
+
/// @example scss
|
|
242
|
+
/// .selector {
|
|
243
|
+
/// @include bpk-segmented-control-v2__indicator();
|
|
244
|
+
/// @include bpk-segmented-control-v2__indicator--surface-default();
|
|
245
|
+
/// }
|
|
246
|
+
|
|
247
|
+
@mixin bpk-segmented-control-v2__indicator--surface-default {
|
|
248
|
+
background-color: tokens.$bpk-canvas-contrast-day;
|
|
249
|
+
}
|
|
250
|
+
|
|
251
|
+
/// Surface contrast indicator color. Modifies the bpk-segmented-control-v2__indicator mixin.
|
|
252
|
+
///
|
|
253
|
+
/// @require {mixin} bpk-segmented-control-v2__indicator
|
|
254
|
+
///
|
|
255
|
+
/// @example scss
|
|
256
|
+
/// .selector {
|
|
257
|
+
/// @include bpk-segmented-control-v2__indicator();
|
|
258
|
+
/// @include bpk-segmented-control-v2__indicator--surface-contrast();
|
|
259
|
+
/// }
|
|
260
|
+
|
|
261
|
+
@mixin bpk-segmented-control-v2__indicator--surface-contrast {
|
|
262
|
+
background-color: tokens.$bpk-private-segmented-control-surface-contrast-on-day;
|
|
263
|
+
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@skyscanner/backpack-web",
|
|
3
|
-
"version": "42.0.0
|
|
3
|
+
"version": "42.0.0",
|
|
4
4
|
"description": "Backpack Design System web library",
|
|
5
5
|
"repository": {
|
|
6
6
|
"type": "git",
|
|
@@ -22,6 +22,7 @@
|
|
|
22
22
|
"access": "public"
|
|
23
23
|
},
|
|
24
24
|
"dependencies": {
|
|
25
|
+
"@ark-ui/react": "^5.34.1",
|
|
25
26
|
"@chakra-ui/react": "^3.33.0",
|
|
26
27
|
"@floating-ui/react": "^0.26.12",
|
|
27
28
|
"@popperjs/core": "^2.11.8",
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
import type { Props } from './common-types';
|
|
2
|
-
declare const BpkButton: ({ blank, children, className, disabled, fullWidth, href, iconOnly, implicit, onClick, rel: propRel, size, submit, type, ...rest }: Props) => import("react/jsx-runtime").JSX.Element;
|
|
3
|
-
export default BpkButton;
|
|
@@ -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-button{display:inline-block;min-height:2.25rem;margin:0;padding:.375rem 1rem;border:0;text-align:center;text-decoration:none;cursor:pointer;vertical-align:middle;user-select:none;border-radius:.5rem;border-radius:var(--bpk-button-border-radius, 0.5rem);font-size:1rem;line-height:1.5rem;font-weight:700;color:#fff;color:var(--bpk-button-primary-text-color, rgb(255, 255, 255));background-color:#05203c;background-color:var(--bpk-button-primary-background-color, rgb(5, 32, 60))}.bpk-no-touch-support .bpk-button:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-primary-hover-text-color, rgb(255, 255, 255));background-color:#154679;background-color:var(--bpk-button-primary-hover-background-color, rgb(21, 70, 121))}:global(.bpk-no-touch-support) .bpk-button:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-primary-hover-text-color, rgb(255, 255, 255));background-color:#154679;background-color:var(--bpk-button-primary-hover-background-color, rgb(21, 70, 121))}.bpk-button:active{color:#fff;color:var(--bpk-button-primary-active-text-color, rgb(255, 255, 255));background-color:#154679;background-color:var(--bpk-button-primary-active-background-color, rgb(21, 70, 121))}.bpk-button:disabled{background-color:#e0e4e9;color:rgba(0,0,0,.2);cursor:not-allowed}.bpk-button--large{min-height:3rem;padding:.75rem 1rem}.bpk-button--icon-only{padding-right:.625rem;padding-left:.625rem}.bpk-button--large-icon-only{padding-right:.75rem;padding-left:.75rem}.bpk-button--destructive{color:#161616;color:var(--bpk-button-secondary-text-color, rgb(22, 22, 22));background-color:#e0e4e9;background-color:var(--bpk-button-secondary-background-color, rgb(224, 228, 233));color:#e70866;color:var(--bpk-button-destructive-text-color, rgb(231, 8, 102));background-color:#e0e4e9;background-color:var(--bpk-button-destructive-background-color, rgb(224, 228, 233))}.bpk-no-touch-support .bpk-button--destructive:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-button-secondary-hover-text-color, rgb(22, 22, 22));background-color:#c1c7cf;background-color:var(--bpk-button-secondary-hover-background-color, rgb(193, 199, 207))}:global(.bpk-no-touch-support) .bpk-button--destructive:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-button-secondary-hover-text-color, rgb(22, 22, 22));background-color:#c1c7cf;background-color:var(--bpk-button-secondary-hover-background-color, rgb(193, 199, 207))}.bpk-button--destructive:active{color:#161616;color:var(--bpk-button-secondary-active-text-color, rgb(22, 22, 22));background-color:#c1c7cf;background-color:var(--bpk-button-secondary-active-background-color, rgb(193, 199, 207))}.bpk-button--destructive:disabled{background-color:#e0e4e9;color:rgba(0,0,0,.2)}.bpk-no-touch-support .bpk-button--destructive:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-destructive-hover-text-color, rgb(255, 255, 255));background-color:#e70866;background-color:var(--bpk-button-destructive-hover-background-color, rgb(231, 8, 102))}:global(.bpk-no-touch-support) .bpk-button--destructive:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-destructive-hover-text-color, rgb(255, 255, 255));background-color:#e70866;background-color:var(--bpk-button-destructive-hover-background-color, rgb(231, 8, 102))}.bpk-button--destructive:active{color:#fff;color:var(--bpk-button-destructive-active-text-color, rgb(255, 255, 255));background-color:#e70866;background-color:var(--bpk-button-destructive-active-background-color, rgb(231, 8, 102))}.bpk-button--destructive:disabled{background-color:#e0e4e9;color:rgba(0,0,0,.2)}.bpk-button--featured{color:#fff;color:var(--bpk-button-featured-text-color, rgb(255, 255, 255));background-color:#0062e3;background-color:var(--bpk-button-featured-background-color, rgb(0, 98, 227))}.bpk-no-touch-support .bpk-button--featured:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-featured-hover-text-color, rgb(255, 255, 255));background-color:#024daf;background-color:var(--bpk-button-featured-hover-background-color, rgb(2, 77, 175))}:global(.bpk-no-touch-support) .bpk-button--featured:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-featured-hover-text-color, rgb(255, 255, 255));background-color:#024daf;background-color:var(--bpk-button-featured-hover-background-color, rgb(2, 77, 175))}.bpk-button--featured:active{color:#fff;color:var(--bpk-button-featured-active-text-color, rgb(255, 255, 255));background-color:#024daf;background-color:var(--bpk-button-featured-active-background-color, rgb(2, 77, 175))}.bpk-button--featured:disabled{background-color:#e0e4e9;color:rgba(0,0,0,.2)}.bpk-button--link{background:none;box-shadow:none;color:#161616;color:var(--bpk-link-color, rgb(22, 22, 22));padding:.375rem 0;color:#0062e3;position:relative;display:inline;padding:0;border:0;background-color:rgba(0,0,0,0);text-decoration:none;cursor:pointer;appearance:none;color:#161616;color:var(--bpk-link-color, rgb(22, 22, 22));--bpk-button-svg-display: inline-block;--bpk-button-svg-vertical-align: middle}.bpk-no-touch-support .bpk-button--link:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-link-hover-color, rgb(22, 22, 22))}:global(.bpk-no-touch-support) .bpk-button--link:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-link-hover-color, rgb(22, 22, 22))}.bpk-button--link:active{text-decoration:none;color:#161616;color:var(--bpk-link-active-color, rgb(22, 22, 22))}.bpk-button--link::after{bottom:auto}.bpk-no-touch-support .bpk-button--link:hover:not(:active):not(:disabled){background:none;color:#024daf;text-decoration:none}:global(.bpk-no-touch-support) .bpk-button--link:hover:not(:active):not(:disabled){background:none;color:#024daf;text-decoration:none}.bpk-button--link:active{background:none;color:#024daf;text-decoration:none}.bpk-button--link:disabled,.bpk-button--link:disabled:active{background:none;color:rgba(0,0,0,.2);text-decoration:none}.bpk-button--link-large{padding:.75rem 0}.bpk-no-touch-support .bpk-button--link:hover:not(:active):not(:disabled){text-decoration:none;color:#161616;color:var(--bpk-link-hover-color, rgb(22, 22, 22))}:global(.bpk-no-touch-support) .bpk-button--link:hover:not(:active):not(:disabled){text-decoration:none;color:#161616;color:var(--bpk-link-hover-color, rgb(22, 22, 22))}.bpk-button--link:visited{color:#161616;color:var(--bpk-link-visited-color, rgb(22, 22, 22))}.bpk-button--link:active{color:#161616;color:var(--bpk-link-active-color, rgb(22, 22, 22))}.bpk-button--link--implicit{color:#161616;color:var(--bpk-link-color, rgb(22, 22, 22))}.bpk-no-touch-support .bpk-button--link--implicit:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-link-hover-color, rgb(22, 22, 22))}:global(.bpk-no-touch-support) .bpk-button--link--implicit:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-link-hover-color, rgb(22, 22, 22))}.bpk-button--link--implicit:active{text-decoration:none;color:#161616;color:var(--bpk-link-active-color, rgb(22, 22, 22))}.bpk-button--link--icon-only{display:inline-flex;justify-content:center;align-items:center;vertical-align:middle}.bpk-button--link-on-dark{background:none;box-shadow:none;color:#161616;color:var(--bpk-link-color, rgb(22, 22, 22));padding:.375rem 0;color:#0062e3;color:#fff;color:var(--bpk-button-link-on-dark-text-color, rgb(255, 255, 255));color:#fff;color:var(--bpk-link-alternate-color, rgb(255, 255, 255));--bpk-button-svg-display: inline-block;--bpk-button-svg-vertical-align: middle}.bpk-no-touch-support .bpk-button--link-on-dark:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-link-hover-color, rgb(22, 22, 22))}:global(.bpk-no-touch-support) .bpk-button--link-on-dark:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-link-hover-color, rgb(22, 22, 22))}.bpk-button--link-on-dark:active{text-decoration:none;color:#161616;color:var(--bpk-link-active-color, rgb(22, 22, 22))}.bpk-button--link-on-dark::after{bottom:auto}.bpk-no-touch-support .bpk-button--link-on-dark:hover:not(:active):not(:disabled){background:none;color:#024daf;text-decoration:none}:global(.bpk-no-touch-support) .bpk-button--link-on-dark:hover:not(:active):not(:disabled){background:none;color:#024daf;text-decoration:none}.bpk-button--link-on-dark:active{background:none;color:#024daf;text-decoration:none}.bpk-button--link-on-dark:disabled,.bpk-button--link-on-dark:disabled:active{background:none;color:rgba(0,0,0,.2);text-decoration:none}.bpk-button--link-on-dark-large{padding:.75rem 0}.bpk-no-touch-support .bpk-button--link-on-dark:hover:not(:active):not(:disabled){color:hsla(0,0%,100%,.5);color:var(--bpk-button-link-on-dark-hover-text-color, rgba(255, 255, 255, 0.5))}:global(.bpk-no-touch-support) .bpk-button--link-on-dark:hover:not(:active):not(:disabled){color:hsla(0,0%,100%,.5);color:var(--bpk-button-link-on-dark-hover-text-color, rgba(255, 255, 255, 0.5))}.bpk-button--link-on-dark:active{color:hsla(0,0%,100%,.5);color:var(--bpk-button-link-on-dark-active-text-color, rgba(255, 255, 255, 0.5))}.bpk-button--link-on-dark:visited{color:#fff;color:var(--bpk-button-link-on-dark-text-color, rgb(255, 255, 255))}.bpk-button--link-on-dark:disabled,.bpk-button--link-on-dark:disabled:active{color:hsla(0,0%,100%,.2);color:var(--bpk-button-link-on-dark-disabled-color, rgba(255, 255, 255, 0.2))}.bpk-no-touch-support .bpk-button--link-on-dark:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-link-alternate-hover-color, rgb(255, 255, 255))}:global(.bpk-no-touch-support) .bpk-button--link-on-dark:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-link-alternate-hover-color, rgb(255, 255, 255))}.bpk-button--link-on-dark:visited{color:#fff;color:var(--bpk-link-alternate-visited-color, rgb(255, 255, 255))}.bpk-button--link-on-dark:active{color:#fff;color:var(--bpk-link-alternate-active-color, rgb(255, 255, 255))}.bpk-button--link-on-dark--implicit{color:#161616;color:var(--bpk-link-color, rgb(22, 22, 22))}.bpk-no-touch-support .bpk-button--link-on-dark--implicit:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-link-hover-color, rgb(22, 22, 22))}:global(.bpk-no-touch-support) .bpk-button--link-on-dark--implicit:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-link-hover-color, rgb(22, 22, 22))}.bpk-button--link-on-dark--implicit:active{text-decoration:none;color:#161616;color:var(--bpk-link-active-color, rgb(22, 22, 22))}.bpk-button--link-underlined{gap:.5rem;display:inline-flex;justify-content:center;align-items:center;vertical-align:middle;padding-bottom:.0625rem;transition:background-size 200ms ease;background:linear-gradient(rgb(22, 22, 22), rgb(22, 22, 22));background-repeat:no-repeat;background-position:0 100%;background-size:100% 1px}.bpk-no-touch-support .bpk-button--link-underlined:hover:not(:active):not(:disabled){background-size:0 1px}:global(.bpk-no-touch-support) .bpk-button--link-underlined:hover:not(:active):not(:disabled){background-size:0 1px}.bpk-button--link-underlined--implicit{background-size:0 1px}.bpk-no-touch-support .bpk-button--link-underlined--implicit:hover:not(:active):not(:disabled){background-size:100% 1px}:global(.bpk-no-touch-support) .bpk-button--link-underlined--implicit:hover:not(:active):not(:disabled){background-size:100% 1px}.bpk-button--link-underlined--alternate{background:linear-gradient(rgb(255, 255, 255), rgb(255, 255, 255));background-repeat:no-repeat;background-position:0 100%;background-size:100% 1px}.bpk-no-touch-support .bpk-button--link-underlined--alternate:hover:not(:active):not(:disabled){background-size:0 1px}:global(.bpk-no-touch-support) .bpk-button--link-underlined--alternate:hover:not(:active):not(:disabled){background-size:0 1px}.bpk-button--link-underlined--implicit--alternate{background:linear-gradient(rgb(255, 255, 255), rgb(255, 255, 255));background-repeat:no-repeat;background-position:0 100%;background-size:0 1px}.bpk-no-touch-support .bpk-button--link-underlined--implicit--alternate:hover:not(:active):not(:disabled){background-size:100% 1px}:global(.bpk-no-touch-support) .bpk-button--link-underlined--implicit--alternate:hover:not(:active):not(:disabled){background-size:100% 1px}.bpk-button--primary-on-dark{color:#161616;color:var(--bpk-button-primary-on-dark-text-color, rgb(22, 22, 22));background-color:#fff;background-color:var(--bpk-button-primary-on-dark-background-color, rgb(255, 255, 255))}.bpk-no-touch-support .bpk-button--primary-on-dark:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-button-primary-on-dark-hover-text-color, rgb(22, 22, 22));background-color:#c1c7cf;background-color:var(--bpk-button-primary-on-dark-hover-background-color, rgb(193, 199, 207))}:global(.bpk-no-touch-support) .bpk-button--primary-on-dark:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-button-primary-on-dark-hover-text-color, rgb(22, 22, 22));background-color:#c1c7cf;background-color:var(--bpk-button-primary-on-dark-hover-background-color, rgb(193, 199, 207))}.bpk-button--primary-on-dark:active{color:#161616;color:var(--bpk-button-primary-on-dark-active-text-color, rgb(22, 22, 22));background-color:#c1c7cf;background-color:var(--bpk-button-primary-on-dark-active-background-color, rgb(193, 199, 207))}.bpk-button--primary-on-dark:disabled{background-color:#e0e4e9;color:rgba(0,0,0,.2)}.bpk-button--primary-on-light{color:#fff;color:var(--bpk-button-primary-on-light-text-color, rgb(255, 255, 255));background-color:#05203c;background-color:var(--bpk-button-primary-on-light-background-color, rgb(5, 32, 60))}.bpk-no-touch-support .bpk-button--primary-on-light:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-primary-on-light-hover-text-color, rgb(255, 255, 255));background-color:#154679;background-color:var(--bpk-button-primary-on-light-hover-background-color, rgb(21, 70, 121))}:global(.bpk-no-touch-support) .bpk-button--primary-on-light:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-primary-on-light-hover-text-color, rgb(255, 255, 255));background-color:#154679;background-color:var(--bpk-button-primary-on-light-hover-background-color, rgb(21, 70, 121))}.bpk-button--primary-on-light:active{color:#fff;color:var(--bpk-button-primary-on-light-active-text-color, rgb(255, 255, 255));background-color:#154679;background-color:var(--bpk-button-primary-on-light-active-background-color, rgb(21, 70, 121))}.bpk-button--primary-on-light:disabled{background-color:#e0e4e9;color:rgba(0,0,0,.2)}.bpk-button--secondary{color:#161616;color:var(--bpk-button-secondary-text-color, rgb(22, 22, 22));background-color:#e0e4e9;background-color:var(--bpk-button-secondary-background-color, rgb(224, 228, 233))}.bpk-no-touch-support .bpk-button--secondary:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-button-secondary-hover-text-color, rgb(22, 22, 22));background-color:#c1c7cf;background-color:var(--bpk-button-secondary-hover-background-color, rgb(193, 199, 207))}:global(.bpk-no-touch-support) .bpk-button--secondary:hover:not(:active):not(:disabled){color:#161616;color:var(--bpk-button-secondary-hover-text-color, rgb(22, 22, 22));background-color:#c1c7cf;background-color:var(--bpk-button-secondary-hover-background-color, rgb(193, 199, 207))}.bpk-button--secondary:active{color:#161616;color:var(--bpk-button-secondary-active-text-color, rgb(22, 22, 22));background-color:#c1c7cf;background-color:var(--bpk-button-secondary-active-background-color, rgb(193, 199, 207))}.bpk-button--secondary:disabled{background-color:#e0e4e9;color:rgba(0,0,0,.2)}.bpk-button--secondary-on-dark{color:#fff;color:var(--bpk-button-secondary-on-dark-text-color, rgb(255, 255, 255));background-color:hsla(0,0%,100%,.1);background-color:var(--bpk-button-secondary-on-dark-background-color, rgba(255, 255, 255, 0.1))}.bpk-no-touch-support .bpk-button--secondary-on-dark:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-secondary-on-dark-hover-text-color, rgb(255, 255, 255));background-color:#04182d;background-color:var(--bpk-button-secondary-on-dark-hover-background-color, rgb(4, 24, 45))}:global(.bpk-no-touch-support) .bpk-button--secondary-on-dark:hover:not(:active):not(:disabled){color:#fff;color:var(--bpk-button-secondary-on-dark-hover-text-color, rgb(255, 255, 255));background-color:#04182d;background-color:var(--bpk-button-secondary-on-dark-hover-background-color, rgb(4, 24, 45))}.bpk-button--secondary-on-dark:active{color:#fff;color:var(--bpk-button-secondary-on-dark-active-text-color, rgb(255, 255, 255));background-color:#04182d;background-color:var(--bpk-button-secondary-on-dark-active-background-color, rgb(4, 24, 45))}.bpk-button--secondary-on-dark:disabled{background-color:#0b121d;color:hsla(0,0%,100%,.2)}.bpk-button--full-width{display:block;width:100%}.bpk-button span>svg{display:var(--bpk-button-svg-display, block);vertical-align:var(--bpk-button-svg-vertical-align, baseline)}.bpk-button svg{fill:currentcolor}
|
|
File without changes
|