@skyscanner/backpack-web 21.0.1 → 22.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/README.md CHANGED
@@ -8,7 +8,7 @@
8
8
  ## Quick links
9
9
 
10
10
  - [Documentation](https://www.skyscanner.design/)
11
- - [Changelog](./CHANGELOG.md)
11
+ - [Changelog](https://github.com/Skyscanner/backpack/releases)
12
12
 
13
13
  ## Usage
14
14
 
@@ -20,7 +20,6 @@ import {
20
20
  iconSizeSm,
21
21
  iconSizeLg,
22
22
  privateButtonLineHeight,
23
- privateButtonLargeLineHeight,
24
23
  } from '@skyscanner/bpk-foundations-web/tokens/base.es6';
25
24
 
26
25
  import withAlignment from './src/withAlignment';
@@ -33,11 +32,7 @@ function withButtonAlignment(WrappedComponent) {
33
32
  }
34
33
 
35
34
  function withLargeButtonAlignment(WrappedComponent) {
36
- return withAlignment(
37
- WrappedComponent,
38
- privateButtonLargeLineHeight,
39
- iconSizeLg,
40
- );
35
+ return withAlignment(WrappedComponent, privateButtonLineHeight, iconSizeLg);
41
36
  }
42
37
 
43
38
  export {
@@ -34,7 +34,6 @@ const Slider = () => (
34
34
  | Property | PropType | Required | Default Value |
35
35
  | ------------------------ | ----------------------------- | -------- | ------------- |
36
36
  | className | string | false | null |
37
- | large | bool | false | false |
38
37
 
39
38
  ## Theme Props
40
39
 
@@ -26,7 +26,7 @@ import STYLES from './BpkSlider.module.scss';
26
26
  const getClassName = cssModules(STYLES);
27
27
 
28
28
  const BpkSlider = (props) => {
29
- const { className, large, ...rest } = props;
29
+ const { className, ...rest } = props;
30
30
  const invert = isRTL();
31
31
  const classNames = [getClassName('bpk-slider')];
32
32
  const thumbClassNames = [getClassName('bpk-slider__handle')];
@@ -40,10 +40,6 @@ const BpkSlider = (props) => {
40
40
  if (className) {
41
41
  classNames.push(getClassName(className));
42
42
  }
43
- if (large) {
44
- classNames.push(getClassName('bpk-slider--large'));
45
- thumbClassNames.push(getClassName('bpk-slider__handle--large'));
46
- }
47
43
 
48
44
  return (
49
45
  <Slider
@@ -60,12 +56,10 @@ const BpkSlider = (props) => {
60
56
 
61
57
  BpkSlider.propTypes = {
62
58
  className: PropTypes.string,
63
- large: PropTypes.bool,
64
59
  };
65
60
 
66
61
  BpkSlider.defaultProps = {
67
62
  className: null,
68
- large: false,
69
63
  };
70
64
 
71
65
  export default BpkSlider;
@@ -19,61 +19,45 @@
19
19
  @import '~bpk-mixins/index.scss';
20
20
 
21
21
  $bpk-spacing-v2: true;
22
- $slider-control-inset-size: 22 * $bpk-one-pixel-rem;
23
- $slider-large-control-inset-size: bpk-spacing-sm() * 7;
22
+ $slider-handle-size: bpk-spacing-base() + bpk-spacing-sm();
23
+ $slider-handle-touch-size: bpk-spacing-xxl();
24
+ $slider-bar-height: bpk-spacing-sm();
24
25
 
25
26
  .bpk-slider {
26
- height: bpk-spacing-xl();
27
+ height: $slider-handle-size;
27
28
  -webkit-tap-highlight-color: transparent;
28
29
 
29
- &--large {
30
- height: bpk-spacing-xxl();
31
- }
32
-
33
30
  &__handle {
34
31
  display: flex;
35
- width: bpk-spacing-xl();
36
- height: bpk-spacing-xl();
32
+ width: $slider-handle-size;
33
+ height: $slider-handle-size;
37
34
  justify-content: center;
38
35
  align-items: center;
39
- border: $bpk-one-pixel-rem solid $bpk-surface-highlight-day;
40
- border-radius: $bpk-border-radius-lg;
41
- background-color: $bpk-surface-default-day;
36
+ border-radius: 50%;
37
+ background-color: $bpk-core-accent-day;
42
38
  cursor: pointer;
43
39
 
44
40
  @include bpk-box-shadow-sm;
45
41
 
46
42
  &::after {
43
+ position: absolute;
47
44
  content: '';
48
- display: block;
49
- width: $slider-control-inset-size;
50
- height: $slider-control-inset-size;
51
- border-radius: $bpk-border-radius-lg;
52
- box-shadow: inset 0 0 0 $bpk-one-pixel-rem rgba(37, 32, 31, 0.3);
45
+ width: $slider-handle-touch-size;
46
+ height: $slider-handle-touch-size;
47
+ border-radius: 50%;
53
48
  }
54
49
 
55
50
  &--active {
56
51
  transform: scale(1.2) translate3d(0, 0, 0);
57
- }
58
-
59
- &--large {
60
- width: bpk-spacing-xxl();
61
- height: bpk-spacing-xxl();
62
- border-radius: $bpk-border-radius-lg;
63
-
64
- &::after {
65
- width: $slider-large-control-inset-size;
66
- height: $slider-large-control-inset-size;
67
- border-radius: $bpk-border-radius-lg;
68
- }
52
+ background-color: $bpk-private-slider-selected-day;
69
53
  }
70
54
  }
71
55
 
72
56
  &__bar {
73
- top: calc(50% - #{bpk-spacing-sm()});
74
- height: bpk-spacing-md();
57
+ top: calc(50% - #{$slider-bar-height / 2});
58
+ height: $slider-bar-height;
75
59
  border-radius: $bpk-border-radius-sm;
76
- background-color: $bpk-surface-highlight-day;
60
+ background-color: $bpk-line-day;
77
61
  }
78
62
 
79
63
  // stylelint-disable-next-line selector-attribute-quotes
@@ -81,21 +65,21 @@ $slider-large-control-inset-size: bpk-spacing-sm() * 7;
81
65
  @include bpk-themeable-property(
82
66
  background-color,
83
67
  --bpk-slider-bar-color,
84
- $bpk-core-primary-day
68
+ $bpk-core-accent-day
85
69
  );
86
70
  }
87
71
 
88
72
  &--range {
89
73
  // stylelint-disable-next-line selector-attribute-quotes
90
74
  > div[class$='0'] {
91
- background-color: $bpk-surface-highlight-day;
75
+ background-color: $bpk-line-day;
92
76
  }
93
77
  // stylelint-disable-next-line selector-attribute-quotes
94
78
  > div[class$='1'] {
95
79
  @include bpk-themeable-property(
96
80
  background-color,
97
81
  --bpk-slider-bar-color,
98
- $bpk-core-primary-day
82
+ $bpk-core-accent-day
99
83
  );
100
84
  }
101
85
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@skyscanner/backpack-web",
3
- "version": "21.0.1",
3
+ "version": "22.0.0",
4
4
  "description": "Backpack Design System web library",
5
5
  "repository": {
6
6
  "type": "git",
@@ -24,11 +24,11 @@
24
24
  "dependencies": {
25
25
  "@popperjs/core": "^2.11.5",
26
26
  "@react-google-maps/api": "^2.12.0",
27
- "@skyscanner/bpk-foundations-web": "^15.1.0",
28
- "@skyscanner/bpk-svgs": "^16.2.3",
27
+ "@skyscanner/bpk-foundations-web": "^15.2.0",
28
+ "@skyscanner/bpk-svgs": "^16.2.4",
29
29
  "a11y-focus-scope": "^1.1.3",
30
30
  "a11y-focus-store": "^1.0.0",
31
- "bpk-mixins": "^40.1.0",
31
+ "bpk-mixins": "^40.2.0",
32
32
  "d3-path": "^2.0.0",
33
33
  "d3-scale": "^4.0.2",
34
34
  "date-fns": "^2.21.1",