@skyscanner/backpack-web 41.18.0 → 41.19.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 (47) hide show
  1. package/bpk-component-badge/index.d.ts +2 -2
  2. package/bpk-component-badge/index.js +2 -2
  3. package/bpk-component-badge/src/BpkBadge.module.css +1 -1
  4. package/bpk-component-badge/src/themeAttributes.d.ts +25 -2
  5. package/bpk-component-badge/src/themeAttributes.js +27 -1
  6. package/bpk-component-button/index.d.ts +2 -2
  7. package/bpk-component-button/index.js +1 -1
  8. package/bpk-component-button/src/BpkButtonV2/BpkButton.d.ts +1 -1
  9. package/bpk-component-button/src/BpkButtonV2/BpkButton.js +38 -6
  10. package/bpk-component-button/src/BpkButtonV2/BpkButton.module.css +1 -1
  11. package/bpk-component-button/src/BpkButtonV2/common-types.d.ts +2 -0
  12. package/bpk-component-button/src/themeAttributes.d.ts +1 -0
  13. package/bpk-component-button/src/themeAttributes.js +3 -2
  14. package/bpk-component-chip/index.d.ts +2 -2
  15. package/bpk-component-chip/index.js +2 -2
  16. package/bpk-component-chip/src/BpkSelectableChip.module.css +1 -1
  17. package/bpk-component-chip/src/themeAttributes.d.ts +4 -0
  18. package/bpk-component-chip/src/themeAttributes.js +7 -1
  19. package/bpk-component-pagination/src/BpkPaginationPage.module.css +1 -1
  20. package/bpk-component-scrollable-calendar/src/utils.d.ts +1 -1
  21. package/bpk-component-segmented-control/index.d.ts +2 -0
  22. package/bpk-component-segmented-control/index.js +2 -1
  23. package/bpk-component-segmented-control/src/BpkSegmentedControlV2/BpkSegmentedControlV2.d.ts +19 -0
  24. package/bpk-component-segmented-control/src/BpkSegmentedControlV2/BpkSegmentedControlV2.js +81 -0
  25. package/bpk-component-segmented-control/src/BpkSegmentedControlV2/BpkSegmentedControlV2.module.css +18 -0
  26. package/bpk-component-segmented-control/src/BpkSegmentedControlV2/common-types.d.ts +57 -0
  27. package/bpk-component-segmented-control/src/BpkSegmentedControlV2/common-types.js +24 -0
  28. package/bpk-component-table/index.d.ts +13 -0
  29. package/bpk-component-table/index.js +3 -1
  30. package/bpk-component-table/src/BpkTable.d.ts +8 -0
  31. package/bpk-component-table/src/BpkTable.js +7 -14
  32. package/bpk-component-table/src/BpkTableBody.d.ts +7 -0
  33. package/bpk-component-table/src/BpkTableBody.js +3 -5
  34. package/bpk-component-table/src/BpkTableCell.d.ts +9 -0
  35. package/bpk-component-table/src/BpkTableCell.js +7 -15
  36. package/bpk-component-table/src/BpkTableHead.d.ts +7 -0
  37. package/bpk-component-table/src/BpkTableHead.js +3 -5
  38. package/bpk-component-table/src/BpkTableHeadCell.d.ts +9 -0
  39. package/bpk-component-table/src/BpkTableHeadCell.js +2 -6
  40. package/bpk-component-table/src/BpkTableRow.d.ts +7 -0
  41. package/bpk-component-table/src/BpkTableRow.js +3 -5
  42. package/bpk-mixins/_badges.scss +147 -25
  43. package/bpk-mixins/_buttons.scss +173 -79
  44. package/bpk-mixins/_chips.scss +104 -18
  45. package/bpk-mixins/_index.scss +1 -0
  46. package/bpk-mixins/_segmented-control.scss +263 -0
  47. package/package.json +2 -1
@@ -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": "41.18.0",
3
+ "version": "41.19.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",