@skyscanner/backpack-web 42.9.0-dev-v24390905836.1 → 42.9.0-dev-v24441922940.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.
- package/bpk-component-layout/src/theme.js +134 -119
- package/package.json +1 -1
|
@@ -18,9 +18,24 @@
|
|
|
18
18
|
|
|
19
19
|
import { defineConfig } from '@chakra-ui/react';
|
|
20
20
|
|
|
21
|
-
// Import tokens from Backpack foundations
|
|
22
|
-
|
|
23
|
-
|
|
21
|
+
// Import only the tokens we actually use from Backpack foundations
|
|
22
|
+
import {
|
|
23
|
+
// Border sizes
|
|
24
|
+
borderSizeSm, borderSizeLg, borderSizeXl,
|
|
25
|
+
// Border radii
|
|
26
|
+
borderRadiusXs, borderRadiusSm, borderRadiusMd, borderRadiusLg, borderRadiusXl, borderRadiusFull,
|
|
27
|
+
// Box shadows
|
|
28
|
+
boxShadowSm, boxShadowLg, boxShadowXl,
|
|
29
|
+
// Font sizes
|
|
30
|
+
fontSizeXs, fontSizeSm, fontSizeBase, fontSizeLg, fontSizeXl, fontSizeXxl, fontSizeXxxl, fontSizeXxxxl, fontSizeXxxxxl, fontSize6Xl, fontSize7Xl, fontSize8Xl,
|
|
31
|
+
// Line heights
|
|
32
|
+
lineHeightXs, lineHeightSm, lineHeightBase, lineHeightBaseTight, lineHeightLg, lineHeightLgTight, lineHeightXl, lineHeightXlTight, lineHeightXxl, lineHeightXxxl, lineHeightXxxxl, lineHeightXxxxxl, lineHeight6Xl, lineHeight7Xl, lineHeight8Xl,
|
|
33
|
+
// Font weights
|
|
34
|
+
fontWeightLight, fontWeightBook, fontWeightBold, fontWeightBlack,
|
|
35
|
+
// Letter spacing
|
|
36
|
+
letterSpacingTight, letterSpacingHero,
|
|
37
|
+
// Font family
|
|
38
|
+
fontFamilyLarken } from '@skyscanner/bpk-foundations-web/tokens/base.es6';
|
|
24
39
|
// NOTE:
|
|
25
40
|
// We intentionally do not use the raw breakpoint *values* from foundations here.
|
|
26
41
|
// Foundations exports breakpoint values such as `breakpointMobile = "32rem"` which
|
|
@@ -100,9 +115,9 @@ const spacingMap = {
|
|
|
100
115
|
* These come directly from @skyscanner/bpk-foundations-web
|
|
101
116
|
*/
|
|
102
117
|
const borderSizeMap = {
|
|
103
|
-
'bpk-border-size-sm':
|
|
104
|
-
'bpk-border-size-lg':
|
|
105
|
-
'bpk-border-size-xl':
|
|
118
|
+
'bpk-border-size-sm': borderSizeSm,
|
|
119
|
+
'bpk-border-size-lg': borderSizeLg,
|
|
120
|
+
'bpk-border-size-xl': borderSizeXl
|
|
106
121
|
};
|
|
107
122
|
|
|
108
123
|
/**
|
|
@@ -111,12 +126,12 @@ const borderSizeMap = {
|
|
|
111
126
|
*/
|
|
112
127
|
const borderRadiusMap = {
|
|
113
128
|
'bpk-border-radius-none': '0',
|
|
114
|
-
'bpk-border-radius-xs':
|
|
115
|
-
'bpk-border-radius-sm':
|
|
116
|
-
'bpk-border-radius-md':
|
|
117
|
-
'bpk-border-radius-lg':
|
|
118
|
-
'bpk-border-radius-xl':
|
|
119
|
-
'bpk-border-radius-full':
|
|
129
|
+
'bpk-border-radius-xs': borderRadiusXs,
|
|
130
|
+
'bpk-border-radius-sm': borderRadiusSm,
|
|
131
|
+
'bpk-border-radius-md': borderRadiusMd,
|
|
132
|
+
'bpk-border-radius-lg': borderRadiusLg,
|
|
133
|
+
'bpk-border-radius-xl': borderRadiusXl,
|
|
134
|
+
'bpk-border-radius-full': borderRadiusFull
|
|
120
135
|
};
|
|
121
136
|
|
|
122
137
|
/**
|
|
@@ -124,9 +139,9 @@ const borderRadiusMap = {
|
|
|
124
139
|
* These come directly from @skyscanner/bpk-foundations-web
|
|
125
140
|
*/
|
|
126
141
|
const shadowMap = {
|
|
127
|
-
'bpk-shadow-sm':
|
|
128
|
-
'bpk-shadow-lg':
|
|
129
|
-
'bpk-shadow-xl':
|
|
142
|
+
'bpk-shadow-sm': boxShadowSm,
|
|
143
|
+
'bpk-shadow-lg': boxShadowLg,
|
|
144
|
+
'bpk-shadow-xl': boxShadowXl
|
|
130
145
|
};
|
|
131
146
|
|
|
132
147
|
/**
|
|
@@ -218,230 +233,230 @@ export function getShadowValue(token) {
|
|
|
218
233
|
const textStylesMap = {
|
|
219
234
|
xs: {
|
|
220
235
|
value: {
|
|
221
|
-
fontSize:
|
|
222
|
-
lineHeight:
|
|
223
|
-
fontWeight:
|
|
236
|
+
fontSize: fontSizeXs,
|
|
237
|
+
lineHeight: lineHeightXs,
|
|
238
|
+
fontWeight: fontWeightBook
|
|
224
239
|
}
|
|
225
240
|
},
|
|
226
241
|
sm: {
|
|
227
242
|
value: {
|
|
228
|
-
fontSize:
|
|
229
|
-
lineHeight:
|
|
230
|
-
fontWeight:
|
|
243
|
+
fontSize: fontSizeSm,
|
|
244
|
+
lineHeight: lineHeightSm,
|
|
245
|
+
fontWeight: fontWeightBook
|
|
231
246
|
}
|
|
232
247
|
},
|
|
233
248
|
base: {
|
|
234
249
|
value: {
|
|
235
|
-
fontSize:
|
|
236
|
-
lineHeight:
|
|
237
|
-
fontWeight:
|
|
250
|
+
fontSize: fontSizeBase,
|
|
251
|
+
lineHeight: lineHeightBase,
|
|
252
|
+
fontWeight: fontWeightBook
|
|
238
253
|
}
|
|
239
254
|
},
|
|
240
255
|
lg: {
|
|
241
256
|
value: {
|
|
242
|
-
fontSize:
|
|
243
|
-
lineHeight:
|
|
244
|
-
fontWeight:
|
|
257
|
+
fontSize: fontSizeLg,
|
|
258
|
+
lineHeight: lineHeightLg,
|
|
259
|
+
fontWeight: fontWeightBook
|
|
245
260
|
}
|
|
246
261
|
},
|
|
247
262
|
xl: {
|
|
248
263
|
value: {
|
|
249
|
-
fontSize:
|
|
250
|
-
lineHeight:
|
|
251
|
-
fontWeight:
|
|
264
|
+
fontSize: fontSizeXl,
|
|
265
|
+
lineHeight: lineHeightXl,
|
|
266
|
+
fontWeight: fontWeightBook
|
|
252
267
|
}
|
|
253
268
|
},
|
|
254
269
|
xxl: {
|
|
255
270
|
value: {
|
|
256
|
-
fontSize:
|
|
257
|
-
lineHeight:
|
|
258
|
-
fontWeight:
|
|
271
|
+
fontSize: fontSizeXxl,
|
|
272
|
+
lineHeight: lineHeightXxl,
|
|
273
|
+
fontWeight: fontWeightBold
|
|
259
274
|
}
|
|
260
275
|
},
|
|
261
276
|
xxxl: {
|
|
262
277
|
value: {
|
|
263
|
-
fontSize:
|
|
264
|
-
lineHeight:
|
|
265
|
-
fontWeight:
|
|
278
|
+
fontSize: fontSizeXxxl,
|
|
279
|
+
lineHeight: lineHeightXxxl,
|
|
280
|
+
fontWeight: fontWeightBold
|
|
266
281
|
}
|
|
267
282
|
},
|
|
268
283
|
xxxxl: {
|
|
269
284
|
value: {
|
|
270
|
-
fontSize:
|
|
271
|
-
lineHeight:
|
|
272
|
-
fontWeight:
|
|
273
|
-
letterSpacing:
|
|
285
|
+
fontSize: fontSizeXxxxl,
|
|
286
|
+
lineHeight: lineHeightXxxxl,
|
|
287
|
+
fontWeight: fontWeightBold,
|
|
288
|
+
letterSpacing: letterSpacingTight
|
|
274
289
|
}
|
|
275
290
|
},
|
|
276
291
|
xxxxxl: {
|
|
277
292
|
value: {
|
|
278
|
-
fontSize:
|
|
279
|
-
lineHeight:
|
|
280
|
-
fontWeight:
|
|
281
|
-
letterSpacing:
|
|
293
|
+
fontSize: fontSizeXxxxxl,
|
|
294
|
+
lineHeight: lineHeightXxxxxl,
|
|
295
|
+
fontWeight: fontWeightBold,
|
|
296
|
+
letterSpacing: letterSpacingTight
|
|
282
297
|
}
|
|
283
298
|
},
|
|
284
299
|
caption: {
|
|
285
300
|
value: {
|
|
286
|
-
fontSize:
|
|
287
|
-
lineHeight:
|
|
288
|
-
fontWeight:
|
|
301
|
+
fontSize: fontSizeXs,
|
|
302
|
+
lineHeight: lineHeightXs,
|
|
303
|
+
fontWeight: fontWeightBook
|
|
289
304
|
}
|
|
290
305
|
},
|
|
291
306
|
footnote: {
|
|
292
307
|
value: {
|
|
293
|
-
fontSize:
|
|
294
|
-
lineHeight:
|
|
295
|
-
fontWeight:
|
|
308
|
+
fontSize: fontSizeSm,
|
|
309
|
+
lineHeight: lineHeightSm,
|
|
310
|
+
fontWeight: fontWeightBook
|
|
296
311
|
}
|
|
297
312
|
},
|
|
298
313
|
'label-1': {
|
|
299
314
|
value: {
|
|
300
|
-
fontSize:
|
|
301
|
-
lineHeight:
|
|
302
|
-
fontWeight:
|
|
315
|
+
fontSize: fontSizeBase,
|
|
316
|
+
lineHeight: lineHeightBase,
|
|
317
|
+
fontWeight: fontWeightBold
|
|
303
318
|
}
|
|
304
319
|
},
|
|
305
320
|
'label-2': {
|
|
306
321
|
value: {
|
|
307
|
-
fontSize:
|
|
308
|
-
lineHeight:
|
|
309
|
-
fontWeight:
|
|
322
|
+
fontSize: fontSizeSm,
|
|
323
|
+
lineHeight: lineHeightSm,
|
|
324
|
+
fontWeight: fontWeightBold
|
|
310
325
|
}
|
|
311
326
|
},
|
|
312
327
|
'label-3': {
|
|
313
328
|
value: {
|
|
314
|
-
fontSize:
|
|
315
|
-
lineHeight:
|
|
316
|
-
fontWeight:
|
|
329
|
+
fontSize: fontSizeXs,
|
|
330
|
+
lineHeight: lineHeightXs,
|
|
331
|
+
fontWeight: fontWeightBold
|
|
317
332
|
}
|
|
318
333
|
},
|
|
319
334
|
'body-default': {
|
|
320
335
|
value: {
|
|
321
|
-
fontSize:
|
|
322
|
-
lineHeight:
|
|
323
|
-
fontWeight:
|
|
336
|
+
fontSize: fontSizeBase,
|
|
337
|
+
lineHeight: lineHeightBase,
|
|
338
|
+
fontWeight: fontWeightBook
|
|
324
339
|
}
|
|
325
340
|
},
|
|
326
341
|
'body-longform': {
|
|
327
342
|
value: {
|
|
328
|
-
fontSize:
|
|
329
|
-
lineHeight:
|
|
330
|
-
fontWeight:
|
|
343
|
+
fontSize: fontSizeLg,
|
|
344
|
+
lineHeight: lineHeightLg,
|
|
345
|
+
fontWeight: fontWeightBook
|
|
331
346
|
}
|
|
332
347
|
},
|
|
333
348
|
subheading: {
|
|
334
349
|
value: {
|
|
335
|
-
fontSize:
|
|
336
|
-
lineHeight:
|
|
337
|
-
fontWeight:
|
|
350
|
+
fontSize: fontSizeXl,
|
|
351
|
+
lineHeight: lineHeightXl,
|
|
352
|
+
fontWeight: fontWeightBook
|
|
338
353
|
}
|
|
339
354
|
},
|
|
340
355
|
'heading-1': {
|
|
341
356
|
value: {
|
|
342
|
-
fontSize:
|
|
343
|
-
lineHeight:
|
|
344
|
-
fontWeight:
|
|
357
|
+
fontSize: fontSizeXxxl,
|
|
358
|
+
lineHeight: lineHeightXxxl,
|
|
359
|
+
fontWeight: fontWeightBold
|
|
345
360
|
}
|
|
346
361
|
},
|
|
347
362
|
'heading-2': {
|
|
348
363
|
value: {
|
|
349
|
-
fontSize:
|
|
350
|
-
lineHeight:
|
|
351
|
-
fontWeight:
|
|
364
|
+
fontSize: fontSizeXxl,
|
|
365
|
+
lineHeight: lineHeightXxl,
|
|
366
|
+
fontWeight: fontWeightBold
|
|
352
367
|
}
|
|
353
368
|
},
|
|
354
369
|
'heading-3': {
|
|
355
370
|
value: {
|
|
356
|
-
fontSize:
|
|
357
|
-
lineHeight:
|
|
358
|
-
fontWeight:
|
|
371
|
+
fontSize: fontSizeXl,
|
|
372
|
+
lineHeight: lineHeightXlTight,
|
|
373
|
+
fontWeight: fontWeightBold
|
|
359
374
|
}
|
|
360
375
|
},
|
|
361
376
|
'heading-4': {
|
|
362
377
|
value: {
|
|
363
|
-
fontSize:
|
|
364
|
-
lineHeight:
|
|
365
|
-
fontWeight:
|
|
378
|
+
fontSize: fontSizeLg,
|
|
379
|
+
lineHeight: lineHeightLgTight,
|
|
380
|
+
fontWeight: fontWeightBold
|
|
366
381
|
}
|
|
367
382
|
},
|
|
368
383
|
'heading-5': {
|
|
369
384
|
value: {
|
|
370
|
-
fontSize:
|
|
371
|
-
lineHeight:
|
|
372
|
-
fontWeight:
|
|
385
|
+
fontSize: fontSizeBase,
|
|
386
|
+
lineHeight: lineHeightBaseTight,
|
|
387
|
+
fontWeight: fontWeightBold
|
|
373
388
|
}
|
|
374
389
|
},
|
|
375
390
|
'hero-1': {
|
|
376
391
|
value: {
|
|
377
|
-
fontSize:
|
|
378
|
-
lineHeight:
|
|
379
|
-
fontWeight:
|
|
380
|
-
letterSpacing:
|
|
392
|
+
fontSize: fontSize8Xl,
|
|
393
|
+
lineHeight: lineHeight8Xl,
|
|
394
|
+
fontWeight: fontWeightBlack,
|
|
395
|
+
letterSpacing: letterSpacingHero
|
|
381
396
|
}
|
|
382
397
|
},
|
|
383
398
|
'hero-2': {
|
|
384
399
|
value: {
|
|
385
|
-
fontSize:
|
|
386
|
-
lineHeight:
|
|
387
|
-
fontWeight:
|
|
388
|
-
letterSpacing:
|
|
400
|
+
fontSize: fontSize7Xl,
|
|
401
|
+
lineHeight: lineHeight7Xl,
|
|
402
|
+
fontWeight: fontWeightBlack,
|
|
403
|
+
letterSpacing: letterSpacingHero
|
|
389
404
|
}
|
|
390
405
|
},
|
|
391
406
|
'hero-3': {
|
|
392
407
|
value: {
|
|
393
|
-
fontSize:
|
|
394
|
-
lineHeight:
|
|
395
|
-
fontWeight:
|
|
396
|
-
letterSpacing:
|
|
408
|
+
fontSize: fontSize6Xl,
|
|
409
|
+
lineHeight: lineHeight6Xl,
|
|
410
|
+
fontWeight: fontWeightBlack,
|
|
411
|
+
letterSpacing: letterSpacingHero
|
|
397
412
|
}
|
|
398
413
|
},
|
|
399
414
|
'hero-4': {
|
|
400
415
|
value: {
|
|
401
|
-
fontSize:
|
|
402
|
-
lineHeight:
|
|
403
|
-
fontWeight:
|
|
404
|
-
letterSpacing:
|
|
416
|
+
fontSize: fontSizeXxxxxl,
|
|
417
|
+
lineHeight: lineHeightXxxxxl,
|
|
418
|
+
fontWeight: fontWeightBlack,
|
|
419
|
+
letterSpacing: letterSpacingHero
|
|
405
420
|
}
|
|
406
421
|
},
|
|
407
422
|
'hero-5': {
|
|
408
423
|
value: {
|
|
409
|
-
fontSize:
|
|
410
|
-
lineHeight:
|
|
411
|
-
fontWeight:
|
|
412
|
-
letterSpacing:
|
|
424
|
+
fontSize: fontSizeXxxxl,
|
|
425
|
+
lineHeight: lineHeightXxxl,
|
|
426
|
+
fontWeight: fontWeightBlack,
|
|
427
|
+
letterSpacing: letterSpacingHero
|
|
413
428
|
}
|
|
414
429
|
},
|
|
415
430
|
'hero-6': {
|
|
416
431
|
value: {
|
|
417
|
-
fontSize:
|
|
418
|
-
lineHeight:
|
|
419
|
-
fontWeight:
|
|
420
|
-
letterSpacing:
|
|
432
|
+
fontSize: fontSizeXxxl,
|
|
433
|
+
lineHeight: lineHeightXxl,
|
|
434
|
+
fontWeight: fontWeightBlack,
|
|
435
|
+
letterSpacing: letterSpacingHero
|
|
421
436
|
}
|
|
422
437
|
},
|
|
423
438
|
'editorial-1': {
|
|
424
439
|
value: {
|
|
425
|
-
fontFamily: `var(--bpk-larken-font-stack, ${
|
|
426
|
-
fontSize:
|
|
427
|
-
lineHeight:
|
|
428
|
-
fontWeight:
|
|
440
|
+
fontFamily: `var(--bpk-larken-font-stack, ${fontFamilyLarken})`,
|
|
441
|
+
fontSize: fontSizeXxxxl,
|
|
442
|
+
lineHeight: lineHeightXxxxl,
|
|
443
|
+
fontWeight: fontWeightLight
|
|
429
444
|
}
|
|
430
445
|
},
|
|
431
446
|
'editorial-2': {
|
|
432
447
|
value: {
|
|
433
|
-
fontFamily: `var(--bpk-larken-font-stack, ${
|
|
434
|
-
fontSize:
|
|
435
|
-
lineHeight:
|
|
436
|
-
fontWeight:
|
|
448
|
+
fontFamily: `var(--bpk-larken-font-stack, ${fontFamilyLarken})`,
|
|
449
|
+
fontSize: fontSizeXxl,
|
|
450
|
+
lineHeight: lineHeightXxl,
|
|
451
|
+
fontWeight: fontWeightLight
|
|
437
452
|
}
|
|
438
453
|
},
|
|
439
454
|
'editorial-3': {
|
|
440
455
|
value: {
|
|
441
|
-
fontFamily: `var(--bpk-larken-font-stack, ${
|
|
442
|
-
fontSize:
|
|
443
|
-
lineHeight:
|
|
444
|
-
fontWeight:
|
|
456
|
+
fontFamily: `var(--bpk-larken-font-stack, ${fontFamilyLarken})`,
|
|
457
|
+
fontSize: fontSizeLg,
|
|
458
|
+
lineHeight: lineHeightLg,
|
|
459
|
+
fontWeight: fontWeightBook
|
|
445
460
|
}
|
|
446
461
|
}
|
|
447
462
|
};
|